elements.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. export const settingsElements = {
  2. conductor: {
  3. menu: ' w-full items-left justify-center',
  4. menu_is_dynamic: false,
  5. // Padding lives on the scroll *content* (w-max), not the overflow parent —
  6. // otherwise tabs clip at the inset instead of scrolling edge-to-edge.
  7. // Below lg: a 52px row (8px above and below the pills) plus mb-0.5,
  8. // 10px from the pills to the end of the header band.
  9. menu_cnt: ' flex-row flex-none w-max gap-2 min-h-13 lg:min-h-14 mb-0.5 lg:mb-0 items-center px-4 ',
  10. menu_categ_indent: ' pl-8 ',
  11. topmenu_cnt:
  12. 'w-full px-8 pt-6 items-stretch justify-stretch sticky z-50 t-8 gap-x-8 hidden lg:flex p',
  13. topmenu_button_variant: 'secondary',
  14. topmenu_button_variant_active: 'secondary',
  15. topmenu_button_align: 'start',
  16. topmenu_button_fullWidth: false,
  17. topmenu_button_size: 'base',
  18. topmenu_button_pressed: true,
  19. left_menu_cnt: ' ',
  20. cover_base: 'ns--cover-base- w-full bg-card ne--',
  21. cover_content:
  22. 'ns--conductor-cover-content-- items-center h-full w-full justify-between lg:p-4 ne--',
  23. cover_small: 'mx-auto flex-row items-center ',
  24. hide_top_menu_from: 'xl',
  25. // Section title + icon next to conductor tabs (TopSidebar).
  26. show_title: true,
  27. standalone_context_selector: 'items-center justify-center w-full h-14 px-2',
  28. },
  29. dropdown_menu: {
  30. content_shadow: ' shadow-lg ',
  31. content_ver: 'flex-col gap-1',
  32. content_hor: 'flex-row ',
  33. item_ver:
  34. ' group px-2 flex w-full min-w-0 min-h-11 flex-row items-center rounded-xl font-medium web:hover:bg-muted/50 text-card-foreground web:hover:text-foreground web:hover:cursor-pointer ',
  35. item_hor:
  36. 'flex block web:dark:hover:text-white rounded-full web:hover:cursor-pointer text-muted-foreground web:duration-200 outline-none ',
  37. item_np:
  38. 'flex flex-row web:focus:outline-none items-center justify-between px-1 py-0.5 rounded-lg font-medium text-sm text-muted-foreground web:hover:cursor-pointer',
  39. /** Tabs overflow menu — match tab strip item height, padding, hover; text aligned in dropdown-item via item_text_key */
  40. item_tabs_overflow_sm:
  41. 'group flex w-full min-h-9 h-9 px-3 flex-row items-center rounded-lg font-medium text-secondary-foreground web:hover:bg-muted/50 web:duration-200 web:hover:text-foreground web:cursor-pointer web:focus-visible:outline-2',
  42. item_tabs_overflow_md:
  43. 'group flex w-full min-h-10 h-10 px-4 flex-row items-center rounded-lg font-medium text-base text-secondary-foreground web:hover:bg-muted/50 web:duration-200 web:hover:text-foreground web:cursor-pointer web:focus-visible:outline-2',
  44. item_tabs_overflow_lg:
  45. 'group flex w-full min-h-12 h-12 px-6 flex-row items-center rounded-lg font-medium text-lg text-secondary-foreground web:hover:bg-muted/50 web:duration-200 web:hover:text-foreground web:cursor-pointer web:focus-visible:outline-2',
  46. item_tabs_overflow_text_sm:
  47. 'text-left text-sm font-medium text-secondary-foreground web:group-hover:text-foreground whitespace-nowrap',
  48. item_tabs_overflow_text_md:
  49. 'text-left text-base font-medium text-secondary-foreground web:group-hover:text-foreground whitespace-nowrap',
  50. item_tabs_overflow_text_lg:
  51. 'text-left text-lg font-medium text-secondary-foreground web:group-hover:text-foreground whitespace-nowrap',
  52. item_cnt: 'items-center w-full min-w-0 flex-row',
  53. item_text_cnt: 'min-w-0 flex-1 flex flex-col self-center justify-center overflow-hidden',
  54. item_cnt_tabs_overflow: 'items-center w-full flex-row justify-start flex-1',
  55. item_text: ' block w-full text-sm font-semibold text-secondary-foreground web:group-hover:text-foreground px-2',
  56. /** Selected item (current tab / page, picked option): the toggled look — `bg-accent` + `text-accent-foreground`. */
  57. item_selected: ' bg-accent ',
  58. item_text_selected: ' block w-full text-sm font-semibold text-accent-foreground px-2',
  59. item_icon_selected: 'text-accent-foreground',
  60. item_description: 'block w-full text-xs font-normal leading-tight text-pretty text-muted-foreground px-2 break-words',
  61. item_group_header: 'px-2 pt-3 pb-1',
  62. item_group_header_first: 'p-2.5',
  63. item_group_header_text: 'text-xs font-semibold uppercase tracking-wide text-muted-foreground',
  64. /** Sectioned menus (More): column tracks are set in dropdown-menu. */
  65. content_sections: 'items-stretch gap-1',
  66. content_sections_stacked: 'flex-col gap-1 w-full',
  67. section: 'min-w-0',
  68. /** Apps launcher waffle — icon above label, no description. */
  69. content_grid: 'w-full',
  70. item_grid:
  71. 'group flex w-full min-w-0 min-h-24 flex-col items-center justify-start gap-1.5 rounded-xl px-1 py-2.5 text-secondary-foreground web:hover:bg-muted/50 web:hover:text-foreground web:hover:cursor-pointer web:focus-visible:outline-2 web:duration-200',
  72. item_icon_grid:
  73. 'flex shrink-0 items-center w-12 h-12 bg-muted/50 web:group-hover:bg-border rounded-full justify-center',
  74. item_text_grid:
  75. 'w-full text-center text-xs font-medium leading-tight text-secondary-foreground web:group-hover:text-foreground px-0.5',
  76. item_icon:
  77. 'flex shrink-0 items-center w-9 h-9 bg-muted/50 web:group-hover:bg-border rounded-full justify-center',
  78. item_icon_active:
  79. 'flex shrink-0 items-center w-9 h-9 bg-accent rounded-full justify-center',
  80. icon_size: 20, // Default icon size for dropdown menu icons
  81. icon_size_grid: 24,
  82. },
  83. modal: {
  84. fog: ' bg-background/95 ',
  85. container:
  86. ' bg-card/60 backdrop-blur shadow-card-outline dark:shadow-card-outline-deep md:rounded-3xl overflow-hidden ',
  87. content: '',
  88. header: ' px-3 py-2 min-h-14 items-start justify-start border-b border-border/60 ',
  89. },
  90. cards: {
  91. // Mobile: edge to edge on the solid card surface, no outline shadow; from
  92. // sm the detached, rounded cards are /80 with the outline shadow.
  93. 'u-card-list': ' u-card-list bg-card sm:bg-card/80 sm:shadow-card-outline sm:dark:shadow-card-outline-deep sm:rounded-2xl ',
  94. 'u-card-list-padding': 'p-4 sm:rounded-2xl',
  95. // Profile listings: photo + meta + actions on mobile, card chrome from sm (grid).
  96. // Mobile: edge-to-edge rows on the card surface, 1px apart (feed cards are 2px), like
  97. // the Messages and Notifications rows.
  98. 'u-card-list-flush': ' u-card-list u-flush-nav relative isolate mt-px sm:mt-0 bg-card sm:bg-card/80 sm:shadow-card-outline sm:dark:shadow-card-outline-deep sm:rounded-2xl transition-colors duration-200 ease-out active:bg-muted/60 group-active:bg-muted/60 sm:active:bg-muted/60 sm:group-active:bg-muted/60 ',
  99. 'u-card-list-flush-padding': 'px-4 py-2 sm:p-4 sm:rounded-2xl',
  100. 'u-card-base': 'u-card-base rounded-2xl bg-card/80 text-card-foreground shadow-card-outline dark:shadow-card-outline-deep ',
  101. 'u-card-padding': 'py-4 ',
  102. 'u-card-header': 'px-4',
  103. 'u-card-icon': ' ',
  104. 'u-card-title': 'font-semibold text-base tracking-tight text-secondary-foreground',
  105. 'u-card-description': 'text-muted-foreground text-sm sm:text-base text-balance',
  106. 'u-card-actions': ' ',
  107. 'u-card-content': 'px-4 ',
  108. 'u-card-footer': 'px-4 gap-1',
  109. },
  110. panels: {
  111. 'u-panel-base': ' ns--panel-base-- web:h-full min-w-0 flex-col ne-- ',
  112. // Invisible until hovered. Tailwind v4 applies variants left to right: `hover:before:` is
  113. // `:hover::before`, while `before:hover:` would be `::before:hover`, which never matches.
  114. // The line's `group-*` variants need the plain `group` marker PanelHandler puts on the handle.
  115. 'u-panel-handler': 'relative w-0 web:before:absolute web:before:inset-y-0 web:before:-left-0.5 web:before:-right-0.5 web:before:bg-transparent web:hover:before:bg-accent web:active:before:bg-accent/50 web:before:duration-200 ',
  116. 'u-panel-line':
  117. 'absolute w-px web:h-full web:group-hover:bg-primary/50 web:group-active:bg-primary/50 rounded-full left-0 top-0 ',
  118. 'u-panel-group': ' ns--panel-group-- web:h-full flex ne-- ',
  119. },
  120. blocks: {
  121. 'u-block-base':
  122. ' text-card-foreground gap-4 ',
  123. 'u-block-bg':
  124. ' bg-card/60 shadow-block-outline dark:shadow-block-outline-deep ',
  125. // The fill on tiers in a block's `designbox.solid` (replaces u-block-bg's bg- utility).
  126. 'u-block-bg-solid': 'bg-card',
  127. 'u-block-pad':
  128. ' p-4 ',
  129. 'u-block-pad-y':
  130. ' py-4 ',
  131. 'u-block-pad-x':
  132. ' px-4 ',
  133. 'u-block-rounded': 'rounded-2xl',
  134. 'u-block-rounded-default': 'sm:rounded-2xl',
  135. 'u-block-header':
  136. ' flex-row gap-3 ',
  137. 'u-block-icon': ' items-center w-9 h-9 justify-center bg-muted/50 rounded-lg text-card-foreground flex-none',
  138. 'u-block-icon-size': 20, // Default icon size for block header icons
  139. 'u-block-name': ' flex-auto gap-1 ',
  140. 'u-block-title':
  141. 'text-card-foreground px-0.5 text-lg font-semibold tracking-tight',
  142. 'u-block-description': 'text-muted-foreground text-xs lg:text-sm leading-5 px-px',
  143. 'u-block-content': 'gap-0.5 ',
  144. 'u-block-footer':
  145. 'flex text-card-foreground gap-4 pt-2',
  146. 'u-block-actions':
  147. 'flex flex-row text-card-foreground gap-2 ',
  148. 'u-block-animate':
  149. 'animate-in fade-in slide-in-from-top-2 duration-200',
  150. },
  151. tables: {
  152. // Base
  153. 'u-table-base':
  154. 'w-full border border-border/60 bg-transparent border-collapse overflow-hidden rounded-lg',
  155. 'u-table-header': 'border-border',
  156. 'u-table-body': 'border-border',
  157. 'u-table-footer': 'bg-muted/50 font-medium',
  158. 'u-table-row':
  159. 'flex overflow-hidden flex-row border-border border-b web:transition-colors web:hover:bg-muted/50 web:data-[state=selected]:bg-muted',
  160. 'u-table-head':
  161. 'text-muted-foreground text-left justify-center font-medium flex-1 h-12 px-4 text-sm',
  162. 'u-table-cell':
  163. ' flex-row items-center text-foreground px-3 text-sm py-2',
  164. 'u-table-head-text':
  165. 'text-muted-foreground font-semibold tracking-tight leading-tight text-sm',
  166. 'u-table-cell-text': 'text-foreground text-sm',
  167. },
  168. // Tooltip component styles and configuration
  169. tooltip: {
  170. // Content container (no overflow-hidden to allow arrow to show)
  171. 'tooltip-content': [
  172. 'z-50 rounded-lg px-3 py-2',
  173. 'bg-foreground shadow-lg',
  174. ].join(' '),
  175. // Text inside tooltip
  176. 'tooltip-text': 'text-background text-sm font-medium',
  177. // Arrow base (rotated square approach - works with NativeWind)
  178. 'tooltip-arrow': 'absolute w-3 h-3 bg-foreground rotate-45',
  179. // Arrow positions per placement
  180. 'tooltip-arrow-bottom': '-top-1 left-1/2 -translate-x-1/2', // tooltip below trigger
  181. 'tooltip-arrow-top': '-bottom-1 left-1/2 -translate-x-1/2', // tooltip above trigger
  182. 'tooltip-arrow-left': '-right-1 top-1/2 -translate-y-1/2', // tooltip left of trigger
  183. 'tooltip-arrow-right': '-left-1 top-1/2 -translate-y-1/2', // tooltip right of trigger
  184. },
  185. }