inputs.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. export const settingsInputs = {
  2. dropdown: {
  3. cnt: ' rounded-2xl overflow-hidden p-1.5 bg-card/80 backdrop-blur-lg shadow-card-outline dark:shadow-card-outline-deep z-50 ',
  4. },
  5. checkbox_set: {
  6. container: ' gap-x-2 rounded-lg shadow-input-outline dark:shadow-input-outline-deep bg-input/60 p-1',
  7. },
  8. doublerange: {
  9. container: 'w-full items-center justify-between mt-2',
  10. value_container:
  11. 'w-36 bg-input/50 border border-border/60 py-2 px-4 text-center rounded-lg justify-between min-h-10',
  12. text_value: 'text-muted-foreground ',
  13. text_info: '',
  14. track_height: 4,
  15. thumb_size: 15,
  16. outbound_color: {
  17. light: 'rgb(242, 242, 242)',
  18. dark: 'rgb(242, 242, 242)',
  19. },
  20. inbound_color: {
  21. light: 'rgb(242, 242, 242)',
  22. dark: 'rgb(242, 242, 242)',
  23. },
  24. thumb_tint_color: {
  25. light: '#2563eb',
  26. dark: '#2563eb',
  27. },
  28. },
  29. inputs: {
  30. // Default radius lives in `size.*`. `full` forces a pill; `default` is for
  31. // shells/wrappers that need radius without size padding (matches regular).
  32. rounded:{
  33. default: 'rounded-xl',
  34. full: 'rounded-full',
  35. },
  36. // Shared control heights + default radius — text inputs, selects, matching surfaces.
  37. size:{
  38. small: 'px-3 py-1.5 leading-4 min-h-9 rounded-lg',
  39. regular: 'px-3 py-2 leading-5 min-h-11 rounded-xl',
  40. large: 'px-4 py-2 leading-6 min-h-14 rounded-2xl',
  41. },
  42. // Height-only tokens for chip wells / wrappers that bring their own padding.
  43. surface_size:{
  44. small: 'min-h-9',
  45. regular: 'min-h-11',
  46. large: 'min-h-12',
  47. },
  48. base:
  49. 'text-card-foreground placeholder:text-muted-foreground bg-input/50 shadow-input-outline dark:shadow-input-outline-deep text-base placeholder-muted-foreground web:duration-200 web:file:text-foreground web:selection:bg-primary selection:text-primary-foreground web:focus-visible:bg-card web:focus-visible:border-ring/80 web:focus-visible:border web:focus-visible:shadow-none web:overflow-hidden',
  50. // Height/padding come from `size` (same as Input) so select stays in sync.
  51. select: ' pr-10 bg-input/50 shadow-input-outline dark:shadow-input-outline-deep web:focus:bg-card flex-auto text-base leading-6 overflow-hidden placeholder:text-muted-foreground text-card-foreground web:duration-300 ',
  52. // Adaptive / floating eyebrow labels (`forms.adaptive_labels`)
  53. // Chip owns height; web `[&_label]` kills the inherited line-height strut
  54. // on FieldCaption's <label class="block"> so the span can flex-center.
  55. // Do not put h-* on the text — web Text is a <span>, height is ignored.
  56. adaptive_label:
  57. 'ml-3 self-start web:[&_label]:flex web:[&_label]:items-center web:[&_label]:leading-none',
  58. adaptive_label_floated:
  59. 'bg-accent px-1.5 h-5 rounded-md justify-center web:[&_label]:h-full',
  60. adaptive_label_text_resting: 'text-base leading-none text-muted-foreground',
  61. adaptive_label_text_floated: 'text-xs leading-none text-accent-foreground',
  62. adaptive_label_resting_offset: 0,
  63. adaptive_label_floated_offset: -1.5,
  64. adaptive_label_duration: 100,
  65. },
  66. switcher: {
  67. // Container (height/padding via size.*)
  68. 'u-controls-switcher-container':
  69. 'items-center flex-row-reverse justify-between gap-x-2 min-w-12 flex-auto shadow-input-outline dark:shadow-input-outline-deep bg-input/50 ',
  70. size: {
  71. small: 'min-h-10 px-2 rounded-lg',
  72. regular: 'min-h-11 px-3 rounded-xl',
  73. large: 'min-h-16 px-4 rounded-xl',
  74. },
  75. // Text
  76. 'u-controls-switcher-text': 'text-card-foreground text-base flex-1 ',
  77. // Track
  78. 'u-controls-switcher-track':
  79. 'flex-row items-center rounded-full shrink-0 web:transition-colors web:duration-200',
  80. 'u-controls-switcher-track-regular': 'h-7 w-14 px-1 ',
  81. 'u-controls-switcher-track-small': 'h-4 w-8 px-0.5 ',
  82. 'u-controls-switcher-track-large': 'h-8 w-16 px-1',
  83. 'u-controls-switcher-track-disabled': 'opacity-50',
  84. // Thumb (position/scale animated in `ui/atoms/switcher.tsx` — no CSS transform transition)
  85. 'u-controls-switcher-thumb':
  86. 'rounded-full bg-white/90 shadow-sm',
  87. 'u-controls-switcher-thumb-regular': 'h-5 w-7 ',
  88. 'u-controls-switcher-thumb-small': 'h-3 w-4 ',
  89. 'u-controls-switcher-thumb-large': 'h-6 w-8 ',
  90. // Thumb travel distance in px (rem=16). Used by Animated spring in switcher atom.
  91. thumb_travel: {
  92. small: 12,
  93. regular: 20,
  94. large: 24,
  95. },
  96. // Legacy active translate classes (unused by animated switcher; kept for forks)
  97. 'u-controls-switcher-thumb-active-regular': 'translate-x-5',
  98. 'u-controls-switcher-thumb-active-small': 'translate-x-3',
  99. 'u-controls-switcher-thumb-active-large': 'translate-x-6',
  100. // Track Colors
  101. 'u-controls-switcher-track-col':
  102. ' bg-border ',
  103. 'u-controls-switcher-track-active-col': 'bg-primary ',
  104. },
  105. checkbox: {
  106. // Container
  107. 'u-controls-checkbox-container':
  108. 'items-center px-2.5 py-2 rounded-md w-full gap-2 min-h-10',
  109. // Hover & Active backgrounds (optional — Web-only)
  110. 'u-controls-checkbox-container-bg':
  111. 'web:active:bg-muted web:hover:bg-muted',
  112. // Text labels
  113. 'u-controls-checkbox-text':
  114. 'text-secondary-foreground text-sm leading-5 font-medium text-wrap',
  115. 'u-controls-checkbox-text2':
  116. 'text-muted-foreground text-sm leading-5',
  117. // Icon (e.g. if checkbox is custom-rendered)
  118. 'u-controls-checkbox-icon':
  119. 'text-foreground my-auto h-6 w-6',
  120. // Checkbox square indicator
  121. 'u-controls-checkbox-indicator':
  122. 'shrink-0 h-5 w-5 rounded-md shadow-btn-outline dark:shadow-btn-outline-deep bg-input/50 justify-center items-center',
  123. // Explicit border for contrast on light card / grid surfaces
  124. 'u-controls-checkbox-indicator-border':
  125. 'border border-border',
  126. // Radiobutton circular indicator
  127. 'u-controls-radiobutton-indicator':
  128. 'h-5 w-5 m-1 rounded-full border-2 border-border bg-transparent justify-center items-center ',
  129. // Active mark inside checkbox (filled square) — no margin; parent centers it
  130. 'u-controls-checkbox-indicator-active':
  131. 'h-3 w-3 bg-primary rounded',
  132. // Active mark inside radiobutton (filled circle)
  133. 'u-controls-radiobutton-indicator-active':
  134. 'h-2.5 w-2.5 rounded-full bg-primary m-1 items-center justify-center',
  135. },
  136. }