pixelize-design-library 2.4.2-beta.3 → 2.4.2-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/dist/Components/Accordion/Accordion.js +5 -3
  2. package/dist/Components/AppSwitcher/AppMark.d.ts +19 -0
  3. package/dist/Components/AppSwitcher/AppMark.js +62 -0
  4. package/dist/Components/AppSwitcher/AppSwitcher.d.ts +4 -0
  5. package/dist/Components/AppSwitcher/AppSwitcher.js +315 -0
  6. package/dist/Components/AppSwitcher/AppSwitcherProps.d.ts +64 -0
  7. package/dist/Components/AppSwitcher/AppSwitcherProps.js +86 -0
  8. package/dist/Components/AppSwitcher/useAppSwitcherShortcut.d.ts +3 -0
  9. package/dist/Components/AppSwitcher/useAppSwitcherShortcut.js +31 -0
  10. package/dist/Components/AppearanceSettings/AppearanceSettings.js +2 -1
  11. package/dist/Components/Button/Button.d.ts +2 -2
  12. package/dist/Components/Button/Button.js +4 -3
  13. package/dist/Components/Button/Button.styles.js +62 -15
  14. package/dist/Components/Button/ButtonProps.d.ts +6 -1
  15. package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +6 -6
  16. package/dist/Components/Card/Card.d.ts +1 -1
  17. package/dist/Components/Card/Card.js +2 -2
  18. package/dist/Components/Card/CardProps.d.ts +0 -1
  19. package/dist/Components/Card/PaymentCard/PaymentCard.js +7 -7
  20. package/dist/Components/Checkbox/Checkbox.js +1 -1
  21. package/dist/Components/Checkbox/Checkbox.styles.js +12 -7
  22. package/dist/Components/Common/fieldStyles.js +1 -1
  23. package/dist/Components/CopyButton/CopyButton.js +6 -2
  24. package/dist/Components/CustomModulesTable/EditModuleModal.js +1 -1
  25. package/dist/Components/DatePicker/CalendarPanel.d.ts +5 -0
  26. package/dist/Components/DatePicker/CalendarPanel.js +24 -5
  27. package/dist/Components/DatePicker/DatePickerProps.d.ts +21 -0
  28. package/dist/Components/DatePicker/RangeDatePicker.js +4 -4
  29. package/dist/Components/DatePicker/SingleDatePicker.js +2 -2
  30. package/dist/Components/DatePicker/TimeOnlyPicker.js +1 -1
  31. package/dist/Components/DatePicker/dayStates.d.ts +56 -0
  32. package/dist/Components/DatePicker/dayStates.js +87 -0
  33. package/dist/Components/Dropdown/DropDown.js +7 -15
  34. package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
  35. package/dist/Components/EmptyState/EmptyState.js +2 -1
  36. package/dist/Components/FilePreview/FilePreview.js +1 -1
  37. package/dist/Components/FileUpload/FileUpload.js +5 -4
  38. package/dist/Components/FileUpload/FileUploadProps.d.ts +3 -1
  39. package/dist/Components/FileUpload/constants.js +1 -0
  40. package/dist/Components/FilterSidebar/FilterSidebar.js +4 -4
  41. package/dist/Components/FilterSidebar/filterHoverStyle.d.ts +0 -9
  42. package/dist/Components/FilterSidebar/filterHoverStyle.js +4 -10
  43. package/dist/Components/Form/FormWrapper.js +1 -1
  44. package/dist/Components/Header/components/mobileMenu.js +12 -3
  45. package/dist/Components/Input/TextInput.styles.js +6 -4
  46. package/dist/Components/InputTextArea/InputTextArea.style.js +5 -4
  47. package/dist/Components/KanbanBoard/KanbanBoard.js +5 -45
  48. package/dist/Components/LimitReachedModal/LimitReachedModal.js +4 -5
  49. package/dist/Components/Loading/Loading.js +15 -14
  50. package/dist/Components/MultiSelect/MultiSelect.js +1 -1
  51. package/dist/Components/NavigationBar/NavigationBar.js +3 -3
  52. package/dist/Components/NoteTextArea/NoteTextArea.js +9 -4
  53. package/dist/Components/NumberInput/NumberInput.js +3 -1
  54. package/dist/Components/NumberInput/NumberInput.styles.js +5 -4
  55. package/dist/Components/OrgSwitcher/OrgSwitcher.js +2 -2
  56. package/dist/Components/PdfViewer/PdfViewer.js +6 -1
  57. package/dist/Components/PinInput/PinInput.js +1 -1
  58. package/dist/Components/PlanPill/PlanPill.js +5 -5
  59. package/dist/Components/PlanPill/planPillGradient.d.ts +2 -14
  60. package/dist/Components/PlanPill/planPillGradient.js +3 -15
  61. package/dist/Components/Primitives/Primitives.d.ts +6 -0
  62. package/dist/Components/Primitives/Primitives.js +113 -0
  63. package/dist/Components/ProductCard/ProductPrice.js +1 -1
  64. package/dist/Components/ProductCard/ProductReview.js +6 -1
  65. package/dist/Components/ProductCard/ProductTags.js +1 -1
  66. package/dist/Components/ProfileCard/ProfileCard.js +1 -1
  67. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
  68. package/dist/Components/RadioButton/RadioButton.js +3 -2
  69. package/dist/Components/Reorder/Reorder.js +1 -1
  70. package/dist/Components/ScrollToTop/ScrollToTop.js +2 -0
  71. package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +13 -0
  72. package/dist/Components/ScrollbarBox/ScrollbarBox.js +11 -0
  73. package/dist/Components/Search/Search.js +2 -2
  74. package/dist/Components/SearchSelect/SearchSelect.js +14 -9
  75. package/dist/Components/SegmentedControl/SegmentedControl.d.ts +2 -0
  76. package/dist/Components/SegmentedControl/SegmentedControl.js +58 -0
  77. package/dist/Components/SegmentedControl/SegmentedControlProps.d.ts +16 -0
  78. package/dist/Components/SegmentedControl/SegmentedControlProps.js +2 -0
  79. package/dist/Components/Select/Select.d.ts +1 -1
  80. package/dist/Components/Select/Select.js +4 -2
  81. package/dist/Components/Select/Select.styles.js +3 -2
  82. package/dist/Components/Select/SelectProps.d.ts +3 -0
  83. package/dist/Components/SelectSearch/SelectSearch.js +7 -4
  84. package/dist/Components/SelectV2/SelectV2.js +18 -14
  85. package/dist/Components/SideBar/SecondaryBar.js +1 -1
  86. package/dist/Components/SideBar/SideBar.js +1 -1
  87. package/dist/Components/SideBar/components/MenuPopoverContent.js +2 -2
  88. package/dist/Components/Slider/Slider.js +8 -1
  89. package/dist/Components/StageProgress/StageProgress.js +2 -9
  90. package/dist/Components/StageProgress/StepperStage.js +2 -2
  91. package/dist/Components/Table/Table.d.ts +1 -1
  92. package/dist/Components/Table/Table.js +17 -24
  93. package/dist/Components/Table/TableProps.d.ts +4 -0
  94. package/dist/Components/Table/components/Pagination.js +1 -1
  95. package/dist/Components/Table/components/TableActions.js +2 -2
  96. package/dist/Components/Table/components/TableBody.js +41 -12
  97. package/dist/Components/Table/components/TableGroupRow.js +1 -1
  98. package/dist/Components/Table/components/TableHeader.js +21 -8
  99. package/dist/Components/Table/components/TableSearch.js +1 -1
  100. package/dist/Components/Table/filters/ActiveFilters.js +2 -18
  101. package/dist/Components/Table/settings/ManageColumns.js +4 -17
  102. package/dist/Components/Table/settings/TableSettings.js +5 -11
  103. package/dist/Components/Table/variants/TableVariantContext.d.ts +4 -0
  104. package/dist/Components/Table/variants/TableVariantContext.js +17 -0
  105. package/dist/Components/Table/variants/classic.d.ts +6 -0
  106. package/dist/Components/Table/variants/classic.js +47 -0
  107. package/dist/Components/Table/variants/index.d.ts +7 -0
  108. package/dist/Components/Table/variants/index.js +27 -0
  109. package/dist/Components/Table/variants/pillInk.d.ts +6 -0
  110. package/dist/Components/Table/variants/pillInk.js +21 -0
  111. package/dist/Components/Table/variants/studio.d.ts +6 -0
  112. package/dist/Components/Table/variants/studio.js +50 -0
  113. package/dist/Components/Table/variants/tokens.d.ts +49 -0
  114. package/dist/Components/Table/variants/tokens.js +2 -0
  115. package/dist/Components/Tag/Tag.styles.js +3 -4
  116. package/dist/Components/Timeline/Timeline.js +2 -2
  117. package/dist/Components/Toaster/Toaster.js +1 -1
  118. package/dist/Components/Toggle/TableToggle.js +11 -7
  119. package/dist/Components/ToggleSwitch/ToggleSwitch.d.ts +2 -0
  120. package/dist/Components/ToggleSwitch/ToggleSwitch.js +18 -0
  121. package/dist/Components/ToggleSwitch/ToggleSwitchProps.d.ts +11 -0
  122. package/dist/Components/ToggleSwitch/ToggleSwitchProps.js +2 -0
  123. package/dist/Components/ToolTip/ToolTip.js +6 -6
  124. package/dist/Components/ToolTip/ToolTipProps.d.ts +3 -1
  125. package/dist/Components/Trail/TrailWorks.js +1 -1
  126. package/dist/Components/UpgradeButton/UpgradeButton.js +3 -3
  127. package/dist/Constants/Sidebar.js +3 -2
  128. package/dist/Theme/assertPalette.d.ts +1 -1
  129. package/dist/Theme/assertPalette.js +3 -2
  130. package/dist/Theme/chakra/Menu.styles.d.ts +3 -0
  131. package/dist/Theme/chakra/Menu.styles.js +5 -0
  132. package/dist/Theme/chakra/Popover.styles.d.ts +3 -0
  133. package/dist/Theme/chakra/Popover.styles.js +5 -1
  134. package/dist/Theme/chakra/componentStyles.d.ts +6 -0
  135. package/dist/Theme/chakra/createBrandTheme.js +10 -16
  136. package/dist/Theme/chakra/focusRing.styles.d.ts +52 -0
  137. package/dist/Theme/chakra/focusRing.styles.js +46 -0
  138. package/dist/Theme/provider/ThemeSwitcher.js +5 -2
  139. package/dist/Theme/tokens/brands/index.js +6 -1
  140. package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +1 -0
  141. package/dist/Theme/tokens/builders/buildDarkPalette.js +6 -1
  142. package/dist/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
  143. package/dist/Theme/tokens/builders/focusRing.d.ts +52 -0
  144. package/dist/Theme/tokens/builders/focusRing.js +92 -0
  145. package/dist/Theme/tokens/builders/gradientInk.d.ts +22 -0
  146. package/dist/Theme/tokens/builders/gradientInk.js +28 -0
  147. package/dist/Theme/tokens/builders/index.d.ts +4 -0
  148. package/dist/Theme/tokens/builders/index.js +4 -0
  149. package/dist/Theme/tokens/builders/outlineRung.d.ts +46 -3
  150. package/dist/Theme/tokens/builders/outlineRung.js +101 -5
  151. package/dist/Theme/tokens/builders/placeholderInk.d.ts +19 -0
  152. package/dist/Theme/tokens/builders/placeholderInk.js +35 -0
  153. package/dist/Theme/tokens/builders/resolvedRungs.d.ts +5 -1
  154. package/dist/Theme/tokens/builders/resolvedRungs.js +7 -2
  155. package/dist/Theme/tokens/builders/rowStates.d.ts +13 -0
  156. package/dist/Theme/tokens/builders/rowStates.js +19 -0
  157. package/dist/Theme/tokens/builders/scrollbar.d.ts +12 -0
  158. package/dist/Theme/tokens/builders/scrollbar.js +57 -0
  159. package/dist/Theme/tokens/builders/surfaceRungs.d.ts +5 -0
  160. package/dist/Theme/tokens/builders/surfaceRungs.js +20 -5
  161. package/dist/Theme/tokens/types.d.ts +21 -1
  162. package/dist/esm/Components/Accordion/Accordion.js +5 -3
  163. package/dist/esm/Components/AppSwitcher/AppMark.js +56 -0
  164. package/dist/esm/Components/AppSwitcher/AppSwitcher.js +280 -0
  165. package/dist/esm/Components/AppSwitcher/AppSwitcherProps.js +78 -0
  166. package/dist/esm/Components/AppSwitcher/useAppSwitcherShortcut.js +27 -0
  167. package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +2 -1
  168. package/dist/esm/Components/Button/Button.js +5 -4
  169. package/dist/esm/Components/Button/Button.styles.js +63 -16
  170. package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +6 -6
  171. package/dist/esm/Components/Card/Card.js +2 -2
  172. package/dist/esm/Components/Card/PaymentCard/PaymentCard.js +7 -7
  173. package/dist/esm/Components/Checkbox/Checkbox.js +1 -1
  174. package/dist/esm/Components/Checkbox/Checkbox.styles.js +13 -8
  175. package/dist/esm/Components/Common/fieldStyles.js +1 -1
  176. package/dist/esm/Components/CopyButton/CopyButton.js +7 -3
  177. package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +1 -1
  178. package/dist/esm/Components/DatePicker/CalendarPanel.js +24 -5
  179. package/dist/esm/Components/DatePicker/RangeDatePicker.js +4 -4
  180. package/dist/esm/Components/DatePicker/SingleDatePicker.js +2 -2
  181. package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +1 -1
  182. package/dist/esm/Components/DatePicker/dayStates.js +79 -0
  183. package/dist/esm/Components/Dropdown/DropDown.js +7 -15
  184. package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
  185. package/dist/esm/Components/EmptyState/EmptyState.js +2 -1
  186. package/dist/esm/Components/FilePreview/FilePreview.js +1 -1
  187. package/dist/esm/Components/FileUpload/FileUpload.js +6 -5
  188. package/dist/esm/Components/FileUpload/constants.js +1 -0
  189. package/dist/esm/Components/FilterSidebar/FilterSidebar.js +4 -4
  190. package/dist/esm/Components/FilterSidebar/filterHoverStyle.js +4 -10
  191. package/dist/esm/Components/Form/FormWrapper.js +1 -1
  192. package/dist/esm/Components/Header/components/mobileMenu.js +12 -3
  193. package/dist/esm/Components/Input/TextInput.styles.js +6 -4
  194. package/dist/esm/Components/InputTextArea/InputTextArea.style.js +5 -4
  195. package/dist/esm/Components/KanbanBoard/KanbanBoard.js +5 -45
  196. package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +4 -5
  197. package/dist/esm/Components/Loading/Loading.js +12 -11
  198. package/dist/esm/Components/MultiSelect/MultiSelect.js +1 -1
  199. package/dist/esm/Components/NavigationBar/NavigationBar.js +3 -3
  200. package/dist/esm/Components/NoteTextArea/NoteTextArea.js +9 -4
  201. package/dist/esm/Components/NumberInput/NumberInput.js +4 -2
  202. package/dist/esm/Components/NumberInput/NumberInput.styles.js +5 -4
  203. package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +2 -2
  204. package/dist/esm/Components/PdfViewer/PdfViewer.js +6 -1
  205. package/dist/esm/Components/PinInput/PinInput.js +1 -1
  206. package/dist/esm/Components/PlanPill/PlanPill.js +6 -6
  207. package/dist/esm/Components/PlanPill/planPillGradient.js +3 -15
  208. package/dist/esm/Components/Primitives/Primitives.js +6 -0
  209. package/dist/esm/Components/ProductCard/ProductPrice.js +1 -1
  210. package/dist/esm/Components/ProductCard/ProductReview.js +6 -1
  211. package/dist/esm/Components/ProductCard/ProductTags.js +1 -1
  212. package/dist/esm/Components/ProfileCard/ProfileCard.js +1 -1
  213. package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
  214. package/dist/esm/Components/RadioButton/RadioButton.js +3 -2
  215. package/dist/esm/Components/Reorder/Reorder.js +1 -1
  216. package/dist/esm/Components/ScrollToTop/ScrollToTop.js +2 -0
  217. package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +9 -0
  218. package/dist/esm/Components/Search/Search.js +2 -2
  219. package/dist/esm/Components/SearchSelect/SearchSelect.js +14 -9
  220. package/dist/esm/Components/SegmentedControl/SegmentedControl.js +55 -0
  221. package/dist/esm/Components/SegmentedControl/SegmentedControlProps.js +1 -0
  222. package/dist/esm/Components/Select/Select.js +5 -3
  223. package/dist/esm/Components/Select/Select.styles.js +3 -2
  224. package/dist/esm/Components/SelectSearch/SelectSearch.js +7 -4
  225. package/dist/esm/Components/SelectV2/SelectV2.js +18 -14
  226. package/dist/esm/Components/SideBar/SecondaryBar.js +1 -1
  227. package/dist/esm/Components/SideBar/SideBar.js +1 -1
  228. package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +2 -2
  229. package/dist/esm/Components/Slider/Slider.js +8 -1
  230. package/dist/esm/Components/StageProgress/StageProgress.js +2 -9
  231. package/dist/esm/Components/StageProgress/StepperStage.js +2 -2
  232. package/dist/esm/Components/Table/Table.js +17 -24
  233. package/dist/esm/Components/Table/components/Pagination.js +1 -1
  234. package/dist/esm/Components/Table/components/TableActions.js +2 -2
  235. package/dist/esm/Components/Table/components/TableBody.js +42 -13
  236. package/dist/esm/Components/Table/components/TableGroupRow.js +1 -1
  237. package/dist/esm/Components/Table/components/TableHeader.js +21 -8
  238. package/dist/esm/Components/Table/components/TableSearch.js +1 -1
  239. package/dist/esm/Components/Table/filters/ActiveFilters.js +2 -18
  240. package/dist/esm/Components/Table/settings/ManageColumns.js +4 -17
  241. package/dist/esm/Components/Table/settings/TableSettings.js +5 -11
  242. package/dist/esm/Components/Table/variants/TableVariantContext.js +13 -0
  243. package/dist/esm/Components/Table/variants/classic.js +43 -0
  244. package/dist/esm/Components/Table/variants/index.js +9 -0
  245. package/dist/esm/Components/Table/variants/pillInk.js +18 -0
  246. package/dist/esm/Components/Table/variants/studio.js +46 -0
  247. package/dist/esm/Components/Table/variants/tokens.js +1 -0
  248. package/dist/esm/Components/Tag/Tag.styles.js +3 -4
  249. package/dist/esm/Components/Timeline/Timeline.js +2 -2
  250. package/dist/esm/Components/Toaster/Toaster.js +1 -1
  251. package/dist/esm/Components/Toggle/TableToggle.js +11 -7
  252. package/dist/esm/Components/ToggleSwitch/ToggleSwitch.js +15 -0
  253. package/dist/esm/Components/ToggleSwitch/ToggleSwitchProps.js +1 -0
  254. package/dist/esm/Components/ToolTip/ToolTip.js +6 -6
  255. package/dist/esm/Components/Trail/TrailWorks.js +1 -1
  256. package/dist/esm/Components/UpgradeButton/UpgradeButton.js +3 -3
  257. package/dist/esm/Constants/Sidebar.js +3 -2
  258. package/dist/esm/Theme/assertPalette.js +3 -2
  259. package/dist/esm/Theme/chakra/Menu.styles.js +5 -0
  260. package/dist/esm/Theme/chakra/Popover.styles.js +5 -1
  261. package/dist/esm/Theme/chakra/createBrandTheme.js +10 -16
  262. package/dist/esm/Theme/chakra/focusRing.styles.js +40 -0
  263. package/dist/esm/Theme/provider/ThemeSwitcher.js +5 -2
  264. package/dist/esm/Theme/tokens/brands/index.js +6 -1
  265. package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +6 -1
  266. package/dist/esm/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
  267. package/dist/esm/Theme/tokens/builders/focusRing.js +85 -0
  268. package/dist/esm/Theme/tokens/builders/gradientInk.js +22 -0
  269. package/dist/esm/Theme/tokens/builders/index.js +4 -0
  270. package/dist/esm/Theme/tokens/builders/outlineRung.js +96 -4
  271. package/dist/esm/Theme/tokens/builders/placeholderInk.js +29 -0
  272. package/dist/esm/Theme/tokens/builders/resolvedRungs.js +7 -2
  273. package/dist/esm/Theme/tokens/builders/rowStates.js +15 -0
  274. package/dist/esm/Theme/tokens/builders/scrollbar.js +52 -0
  275. package/dist/esm/Theme/tokens/builders/surfaceRungs.js +20 -5
  276. package/dist/esm/index.js +24 -1
  277. package/dist/index.d.ts +27 -3
  278. package/dist/index.js +64 -4
  279. package/package.json +8 -2
@@ -45,17 +45,17 @@ export default function NavBar({ userAvathar, userName, userRole, navMenu, moreI
45
45
  _focus: { bg: menuHoverBg, color: menuHoverInk },
46
46
  _active: { bg: menuHoverBg, color: menuHoverInk },
47
47
  };
48
- return (_jsx(Box, { bg: theme.colors.backgroundColor.light, px: 4, borderBottom: "1px solid", borderColor: theme.colors.border[500], children: _jsxs(Flex, { h: 16, alignItems: "center", justifyContent: "space-between", children: [_jsxs(Box, { display: "flex", gap: 1.5, alignItems: "center", children: [_jsx(Box, { as: "button", type: "button", onClick: () => onSideBarToggole === null || onSideBarToggole === void 0 ? void 0 : onSideBarToggole(), onMouseEnter: onSideBarPeek, onFocus: onSideBarPeek, "aria-label": sideBarToggole ? "Close navigation menu" : "Open navigation menu", "aria-expanded": !!sideBarToggole, ...iconButtonStyle, display: forceSideBarToggle ? "flex" : { base: "flex", lg: "none" }, w: SIDEBAR_TOGGLE_HIT, h: SIDEBAR_TOGGLE_HIT, children: sideBarToggole ? (_jsx(PanelLeftClose, { size: "1.25rem" })) : (_jsx(PanelRightClose, { size: "1.25rem" })) }), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) && (_jsx(Box, { ...iconButtonStyle, as: "button", type: "button", "aria-label": "Go back", display: "flex", onClick: () => { var _a; return (_a = navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) === null || _a === void 0 ? void 0 : _a.call(navigationBarText); }, children: _jsx(CircleArrowLeft, { size: "1.25rem", color: theme.colors.text[500] }) })), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text) && (_jsx(Text, { color: accentTextOnCanvas(theme.colors.secondary, theme.colors.backgroundColor.light), fontSize: "1.25rem", fontWeight: 600, fontFamily: "open-sans, sans-serif", letterSpacing: "-0.013rem", children: navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text }))] }), _jsx(Flex, { minW: 0, flexShrink: 1, children: _jsxs(Stack, { direction: "row", alignItems: "center", spacing: 4, minW: 0, children: [moreIcon && (_jsx(Box, { display: "flex", alignItems: "center", minW: 0, children: moreIcon })), _jsxs(Menu, { children: [_jsx(MenuButton, { as: Button, rounded: "full", variant: "link", cursor: "pointer", minW: 0, flexShrink: 0, children: _jsx(Avatar, { size: "sm", name: userName, src: userAvathar }) }), _jsx(MenuList, { alignItems: "center", zIndex: 5, p: 0, py: "0.375rem",
48
+ return (_jsx(Box, { bg: theme.colors.backgroundColor.light, px: 4, borderBottom: "1px solid", borderColor: theme.colors.boxborder[200], children: _jsxs(Flex, { h: 16, alignItems: "center", justifyContent: "space-between", children: [_jsxs(Box, { display: "flex", gap: 1.5, alignItems: "center", children: [_jsx(Box, { as: "button", type: "button", onClick: () => onSideBarToggole === null || onSideBarToggole === void 0 ? void 0 : onSideBarToggole(), onMouseEnter: onSideBarPeek, onFocus: onSideBarPeek, "aria-label": sideBarToggole ? "Close navigation menu" : "Open navigation menu", "aria-expanded": !!sideBarToggole, ...iconButtonStyle, display: forceSideBarToggle ? "flex" : { base: "flex", lg: "none" }, w: SIDEBAR_TOGGLE_HIT, h: SIDEBAR_TOGGLE_HIT, children: sideBarToggole ? (_jsx(PanelLeftClose, { size: "1.25rem" })) : (_jsx(PanelRightClose, { size: "1.25rem" })) }), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) && (_jsx(Box, { ...iconButtonStyle, as: "button", type: "button", "aria-label": "Go back", display: "flex", onClick: () => { var _a; return (_a = navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) === null || _a === void 0 ? void 0 : _a.call(navigationBarText); }, children: _jsx(CircleArrowLeft, { size: "1.25rem", color: theme.colors.text[500] }) })), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text) && (_jsx(Text, { color: accentTextOnCanvas(theme.colors.secondary, theme.colors.backgroundColor.light), fontSize: "1.25rem", fontWeight: 600, fontFamily: "open-sans, sans-serif", letterSpacing: "-0.013rem", children: navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text }))] }), _jsx(Flex, { minW: 0, flexShrink: 1, children: _jsxs(Stack, { direction: "row", alignItems: "center", spacing: 4, minW: 0, children: [moreIcon && (_jsx(Box, { display: "flex", alignItems: "center", minW: 0, children: moreIcon })), _jsxs(Menu, { children: [_jsx(MenuButton, { as: Button, rounded: "full", variant: "link", cursor: "pointer", minW: 0, flexShrink: 0, children: _jsx(Avatar, { size: "sm", name: userName, src: userAvathar }) }), _jsx(MenuList, { alignItems: "center", zIndex: 5, p: 0, py: "0.375rem",
49
49
  // Without a cap one long title stretches the whole dropdown; titles truncate instead.
50
50
  maxW: "18rem", bg: theme.colors.backgroundColor.light,
51
51
  // Chakra's MenuItem renders `background: var(--menu-bg)` at rest; its MenuList
52
52
  // baseStyle hardcodes that var to "#fff" (gated behind `_dark`, which this theme-swap
53
53
  // app never triggers). The `bg` prop above only recolors the list itself, not the
54
54
  // inherited var, so items fall back to white until hover/focus — set the var too.
55
- sx: { "--menu-bg": theme.colors.backgroundColor.light }, border: "1px solid", borderColor: theme.colors.boxborder[500], borderRadius: "xl", boxShadow: "lg", color: theme.colors.text[900], overflow: "hidden", children: _jsxs(Box, { display: "flex", flexDirection: "column", maxH: "90vh", children: [_jsx(Center, { pt: 4, pb: 2, children: _jsx(Avatar, { size: "xl", name: userName, src: userAvathar }) }), _jsxs(Center, { flexDirection: "column", gap: "0.125rem", pb: 2, px: 4, children: [_jsx(Text, { fontWeight: 600, fontSize: "14px", color: theme.colors.text[900], isTruncated: true, maxW: "100%", children: userName }), userRole && (_jsx(Text, { fontSize: "11px", color: theme.colors.text[500], isTruncated: true, maxW: "100%", children: userRole }))] }), _jsx(MenuDivider, { borderColor: theme.colors.border[500] }), _jsx(Box, { flex: 1, overflowY: "auto", overflowX: "hidden", children: navMenu === null || navMenu === void 0 ? void 0 : navMenu.map((menu, idx) => {
55
+ sx: { "--menu-bg": theme.colors.backgroundColor.light }, borderRadius: "xl", boxShadow: "lg", color: theme.colors.text[900], overflow: "hidden", children: _jsxs(Box, { display: "flex", flexDirection: "column", maxH: "90vh", children: [_jsx(Center, { pt: 4, pb: 2, children: _jsx(Avatar, { size: "xl", name: userName, src: userAvathar }) }), _jsxs(Center, { flexDirection: "column", gap: "0.125rem", pb: 2, px: 4, children: [_jsx(Text, { fontWeight: 600, fontSize: "14px", color: theme.colors.text[900], isTruncated: true, maxW: "100%", children: userName }), userRole && (_jsx(Text, { fontSize: "11px", color: theme.colors.text[500], isTruncated: true, maxW: "100%", children: userRole }))] }), _jsx(MenuDivider, { borderColor: theme.colors.boxborder[200] }), _jsx(Box, { flex: 1, overflowY: "auto", overflowX: "hidden", children: navMenu === null || navMenu === void 0 ? void 0 : navMenu.map((menu, idx) => {
56
56
  var _a, _b, _c, _d;
57
57
  return (_jsxs(MenuItem, { onClick: () => handleNavOnClick(menu.url), sx: menuItemStyle, children: [menu.icon && (_jsx(Box, { display: "flex", alignItems: "center", flexShrink: 0, sx: { "& svg": { width: "16px", height: "16px" } }, children: menu === null || menu === void 0 ? void 0 : menu.icon })), _jsx(Box, { minW: 0, isTruncated: true, title: String((_a = menu.title) !== null && _a !== void 0 ? _a : ""), children: menu.title })] }, `${String((_d = (_c = (_b = menu.id) !== null && _b !== void 0 ? _b : menu.url) !== null && _c !== void 0 ? _c : menu.title) !== null && _d !== void 0 ? _d : idx)}-${idx}`));
58
- }) }), _jsx(MenuDivider, { borderColor: theme.colors.border[500] }), _jsxs(MenuItem, { onClick: handleLogout, sx: {
58
+ }) }), _jsx(MenuDivider, { borderColor: theme.colors.boxborder[200] }), _jsxs(MenuItem, { onClick: handleLogout, sx: {
59
59
  ...menuItemStyle,
60
60
  color: theme.colors.semanticText.error,
61
61
  _hover: { bg: dangerTone.bg, color: dangerTone.fg },
@@ -3,6 +3,8 @@ import { useEffect, useRef, useState } from "react";
3
3
  import { Box, Flex, Text, Input, Textarea, Button, Divider, Spinner, Tooltip, } from "@chakra-ui/react";
4
4
  import { Paperclip, X, SquarePen, File as FileIcon } from "lucide-react";
5
5
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
+ import { placeholderInk } from "../../Theme/tokens/builders/placeholderInk.js";
7
+ import { resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
6
8
  import { FIELD_RADIUS } from "../Common/fieldStyles.js";
7
9
  const countWords = (text = "") => {
8
10
  const t = text.trim();
@@ -114,14 +116,17 @@ export default function NoteTextArea({ width = "100%", handleSubmit, handleCance
114
116
  };
115
117
  const noteWordCount = countWords(noteValue);
116
118
  const isOverLimit = noteWordCount > maxNoteWordCount;
117
- return (_jsxs(Box, { w: width, borderRadius: FIELD_RADIUS, overflow: "hidden", border: "1px solid", borderColor: isActive ? theme.colors.primary[500] : theme.colors.boxborder[500], bg: isActive ? theme.colors.gray[50] : theme.colors.background[50], transition: "border-color 0.2s", children: [!isActive && (_jsxs(Flex, { px: 3, gap: 2, align: "center", cursor: "text", onClick: handleTextArea, bg: theme.colors.background[50], borderRadius: FIELD_RADIUS, minH: "2.5rem", transition: "background 0.15s", _hover: { bg: theme.colors.gray[50] }, children: [_jsx(SquarePen, { size: 16, color: theme.colors.textMuted }), _jsx(Text, { color: theme.colors.textMuted, fontSize: "sm", children: customPlaceholder })] })), isActive && (_jsxs(_Fragment, { children: [_jsxs(Box, { bg: theme.colors.background[50], children: [titleShow && (_jsxs(_Fragment, { children: [_jsx(Input, { ref: inputRef, value: titleValue, onChange: (e) => {
119
+ const collapsedHoverBg = resolveHoverTint(theme.colors.gray[50], theme.colors.background[50]);
120
+ const activeControlHoverBg = resolveHoverTint(theme.colors.gray[100], theme.colors.gray[50]);
121
+ return (_jsxs(Box, { w: width, borderRadius: FIELD_RADIUS, overflow: "hidden", border: "1px solid", borderColor: isActive ? theme.colors.primary[500] : theme.colors.boxborder[500], bg: isActive ? theme.colors.gray[50] : theme.colors.background[50], transition: "border-color 0.2s", children: [!isActive && (_jsxs(Flex, { px: 3, gap: 2, align: "center", cursor: "text", onClick: handleTextArea, bg: theme.colors.background[50], borderRadius: FIELD_RADIUS, minH: "2.5rem", transition: "background 0.15s", _hover: { bg: collapsedHoverBg }, children: [_jsx(SquarePen, { size: 16, color: theme.colors.textMuted }), _jsx(Text, { color: theme.colors.textMuted, fontSize: "sm", children: customPlaceholder })] })), isActive && (_jsxs(_Fragment, { children: [_jsxs(Box, { bg: theme.colors.background[50], children: [titleShow && (_jsxs(_Fragment, { children: [_jsx(Input, { ref: inputRef, value: titleValue, onChange: (e) => {
118
122
  if (e.target.value.length === 0)
119
123
  setTitleShow(false);
120
124
  setTitleValue(e.target.value);
121
125
  }, placeholder: "Add a title...", variant: "unstyled", px: 3, pt: 2.5, pb: 1.5, fontWeight: 600, fontSize: "0.875rem", color: theme.colors.text[700], _placeholder: {
122
- fontStyle: "italic",
123
- color: theme.colors.textMuted,
124
- } }), _jsx(Divider, { borderColor: theme.colors.gray[200] })] })), _jsx(Box, { bg: theme.colors.background[50], minH: "76px", px: 3, pt: 2.5, position: "relative", children: _jsx(Textarea, { ref: noteAreaRef, value: noteValue, onChange: handleNoteChange, placeholder: customPlaceholder, variant: "unstyled", resize: "none", minH: "76px", fontSize: "0.75rem", color: theme.colors.text[700], _placeholder: { fontStyle: "italic", color: theme.colors.textMuted }, style: { overflow: "hidden" }, p: 0 }) })] }), _jsx(Divider, { borderColor: theme.colors.gray[200] }), _jsxs(Box, { px: 3, py: 2.5, children: [_jsxs(Flex, { align: "center", justify: "space-between", w: "100%", gap: 3, children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(Tooltip, { label: "Attach files", hasArrow: true, placement: "top", children: _jsx(Box, { as: "label", htmlFor: "file-upload", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", w: "1.75rem", h: "1.75rem", borderRadius: "md", color: theme.colors.textMuted, transition: "background 0.15s", _hover: { bg: theme.colors.gray[100] }, children: _jsx(Paperclip, { size: 16 }) }) }), _jsx(Box, { h: "1rem", w: "1px", bg: theme.colors.gray[200] }), !titleShow ? (_jsx(Box, { as: "button", type: "button", onClick: () => setTitleShow(true), px: 2, py: 1, borderRadius: "md", color: theme.colors.textMuted, fontWeight: 500, fontSize: "sm", transition: "background 0.15s", _hover: { bg: theme.colors.gray[100] }, children: "+ Add a title" })) : (_jsx(Tooltip, { label: titleValue, hasArrow: true, isDisabled: !titleValue, children: _jsx(Text, { color: theme.colors.textMuted, fontSize: "sm", fontWeight: 500, isTruncated: true, maxW: "180px", children: titleValue || "Title" }) }))] }), _jsxs(Flex, { gap: 2.5, align: "center", ml: "auto", flexShrink: 0, children: [_jsxs(Text, { fontSize: "xs", fontWeight: 500, color: isOverLimit ? theme.colors.semanticText.error : theme.colors.textMuted, whiteSpace: "nowrap", children: [noteWordCount, "/", maxNoteWordCount] }), cancelButtonHide ? null : (_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleCloseTextArea, children: "Cancel" })), _jsxs(Button, { size: "sm", variant: "solid", isLoading: !!saveButtonLoading, isDisabled: !noteValue || isSaveDisabled, onClick: () => handleSubmit(noteValue, titleValue, files), children: [saveButtonLoading ? (_jsx(Spinner, { size: "xs", thickness: "2px", mr: 2 })) : null, "Save"] })] })] }), _jsx("input", { id: "file-upload", type: "file", style: { display: "none" }, onChange: (e) => {
126
+ color: placeholderInk(theme.colors),
127
+ } }), _jsx(Divider, { borderColor: theme.colors.gray[200] })] })), _jsx(Box, { bg: theme.colors.background[50], minH: "76px", px: 3, pt: 2.5, position: "relative", children: _jsx(Textarea, { ref: noteAreaRef, value: noteValue, onChange: handleNoteChange, placeholder: customPlaceholder, variant: "unstyled", resize: "none", minH: "76px", fontSize: "0.75rem", color: theme.colors.text[700], _placeholder: {
128
+ color: placeholderInk(theme.colors),
129
+ }, style: { overflow: "hidden" }, p: 0 }) })] }), _jsx(Divider, { borderColor: theme.colors.gray[200] }), _jsxs(Box, { px: 3, py: 2.5, children: [_jsxs(Flex, { align: "center", justify: "space-between", w: "100%", gap: 3, children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(Tooltip, { label: "Attach files", hasArrow: true, placement: "top", children: _jsx(Box, { as: "label", htmlFor: "file-upload", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", w: "1.75rem", h: "1.75rem", borderRadius: "md", color: theme.colors.textMuted, transition: "background 0.15s", _hover: { bg: activeControlHoverBg }, children: _jsx(Paperclip, { size: 16 }) }) }), _jsx(Box, { h: "1rem", w: "1px", bg: theme.colors.gray[200] }), !titleShow ? (_jsx(Box, { as: "button", type: "button", onClick: () => setTitleShow(true), px: 2, py: 1, borderRadius: "md", color: theme.colors.textMuted, fontWeight: 500, fontSize: "sm", transition: "background 0.15s", _hover: { bg: activeControlHoverBg }, children: "+ Add a title" })) : (_jsx(Tooltip, { label: titleValue, hasArrow: true, isDisabled: !titleValue, children: _jsx(Text, { color: theme.colors.textMuted, fontSize: "sm", fontWeight: 500, isTruncated: true, maxW: "180px", children: titleValue || "Title" }) }))] }), _jsxs(Flex, { gap: 2.5, align: "center", ml: "auto", flexShrink: 0, children: [_jsxs(Text, { fontSize: "xs", fontWeight: 500, color: isOverLimit ? theme.colors.semanticText.error : theme.colors.textMuted, whiteSpace: "nowrap", children: [noteWordCount, "/", maxNoteWordCount] }), cancelButtonHide ? null : (_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleCloseTextArea, children: "Cancel" })), _jsxs(Button, { size: "sm", variant: "solid", isLoading: !!saveButtonLoading, isDisabled: !noteValue || isSaveDisabled, onClick: () => handleSubmit(noteValue, titleValue, files), children: [saveButtonLoading ? (_jsx(Spinner, { size: "xs", thickness: "2px", mr: 2 })) : null, "Save"] })] })] }), _jsx("input", { id: "file-upload", type: "file", style: { display: "none" }, onChange: (e) => {
125
130
  const newFiles = Array.from(e.target.files || []);
126
131
  const validFiles = newFiles.filter((f) => f.size <= maxFileSize);
127
132
  const invalidFiles = newFiles.filter((f) => f.size > maxFileSize);
@@ -1,8 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { NumberDecrementStepper, NumberIncrementStepper, NumberInput as ChakraNumberInput, NumberInputField, NumberInputStepper, FormControl, } from "@chakra-ui/react";
3
- import { forwardRef } from "react";
3
+ import { forwardRef, useId } from "react";
4
4
  import { TextLabel } from "../Common/FormLabel.js";
5
5
  const NumberInput = forwardRef(function NumberInput({ defaultValue, min, max, precision, step, clampValueOnBlur, keepWithinRange, value, onChange, onBlur, name, size, maxW, allowMouseWheel, NumberIncrementStepperBg, NumberIncrementStepperActive, NumberIncrementStepperChildren, NumberDecrementStepperBg, NumberDecrementStepperChildren, NumberDecrementStepperActive, label, isInformation, informationMessage, isRequired, id, width = "100%", minW, ...props }, ref) {
6
- return (_jsxs(FormControl, { w: width, minW: minW, maxW: maxW, children: [label && (_jsx(TextLabel, { label: label, id: id, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired })), _jsxs(ChakraNumberInput, { defaultValue: defaultValue, min: min, max: max, step: step, precision: precision, clampValueOnBlur: clampValueOnBlur, keepWithinRange: keepWithinRange, value: value, onChange: onChange, onBlur: onBlur, name: name, size: size, maxW: maxW, allowMouseWheel: allowMouseWheel, ...props, children: [_jsx(NumberInputField, { ref: ref }), _jsxs(NumberInputStepper, { children: [_jsx(NumberIncrementStepper, { bg: NumberIncrementStepperBg, _active: NumberIncrementStepperActive, children: NumberIncrementStepperChildren }), _jsx(NumberDecrementStepper, { bg: NumberDecrementStepperBg, _active: NumberDecrementStepperActive, children: NumberDecrementStepperChildren })] })] })] }));
6
+ const generatedId = useId();
7
+ const resolvedId = id !== null && id !== void 0 ? id : generatedId;
8
+ return (_jsxs(FormControl, { w: width, minW: minW, maxW: maxW, id: resolvedId, isRequired: isRequired, children: [label && (_jsx(TextLabel, { label: label, id: resolvedId, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired })), _jsxs(ChakraNumberInput, { defaultValue: defaultValue, min: min, max: max, step: step, precision: precision, clampValueOnBlur: clampValueOnBlur, keepWithinRange: keepWithinRange, value: value, onChange: onChange, onBlur: onBlur, name: name, size: size, maxW: maxW, allowMouseWheel: allowMouseWheel, ...props, children: [_jsx(NumberInputField, { ref: ref }), _jsxs(NumberInputStepper, { children: [_jsx(NumberIncrementStepper, { bg: NumberIncrementStepperBg, _active: NumberIncrementStepperActive, children: NumberIncrementStepperChildren }), _jsx(NumberDecrementStepper, { bg: NumberDecrementStepperBg, _active: NumberDecrementStepperActive, children: NumberDecrementStepperChildren })] })] })] }));
7
9
  });
8
10
  export default NumberInput;
@@ -1,5 +1,6 @@
1
+ import { placeholderInk } from "../../Theme/tokens/builders/placeholderInk.js";
1
2
  export const NumberInput = {
2
- baseStyle: {
3
+ baseStyle: ({ theme }) => ({
3
4
  field: {
4
5
  fontWeight: 500,
5
6
  fontSize: "0.875rem",
@@ -9,10 +10,10 @@ export const NumberInput = {
9
10
  borderRadius: "lg",
10
11
  transition: "border-color 0.2s, box-shadow 0.2s",
11
12
  _placeholder: {
12
- fontStyle: "italic",
13
+ color: placeholderInk(theme.colors),
13
14
  },
14
15
  },
15
- },
16
+ }),
16
17
  sizes: {
17
18
  md: {
18
19
  field: {
@@ -35,7 +36,7 @@ export const NumberInput = {
35
36
  border: "0.063rem solid",
36
37
  borderColor,
37
38
  _placeholder: {
38
- color: theme.colors.textMuted,
39
+ color: placeholderInk(theme.colors),
39
40
  },
40
41
  _hover: {
41
42
  borderColor: primary,
@@ -63,11 +63,11 @@ const OrgSwitcher = ({ organizations, value, onChange, isLoading = false, isSear
63
63
  focusOption(filtered.length - 1);
64
64
  }
65
65
  }, [activeIndex, filtered.length, focusOption]);
66
- // boxborder[800], not raw gray[200]: this styles a real `<button>` (Flex as="button" below),
66
+ // boxborder[500], not raw gray[200]: this styles a real `<button>` (Flex as="button" below),
67
67
  // so its border is a control boundary — WCAG 1.4.11 needs >=3.0 against any named surface up
68
68
  // to `muted` (lightest); gray[200] fails there in dark mode.
69
69
  const triggerStyles = triggerVariant === "outline"
70
- ? { border: "1px solid", borderColor: theme.colors.boxborder[800], bg: theme.colors.background[50] }
70
+ ? { border: "1px solid", borderColor: theme.colors.boxborder[500], bg: theme.colors.background[50] }
71
71
  : triggerVariant === "subtle"
72
72
  ? { bg: theme.colors.gray[50] }
73
73
  : { bg: "transparent" };
@@ -2,9 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Flex, Text } from "@chakra-ui/react";
3
3
  import { Download, ExternalLink, FileText } from "lucide-react";
4
4
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
5
+ import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
6
+ import { resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
5
7
  import ToolTip from "../ToolTip/ToolTip.js";
6
8
  const PdfViewer = ({ pdfUrl, fileName = "Document.pdf", height = "480px", showToolbar = true, borderRadius = "xl", }) => {
7
9
  const theme = useCustomTheme();
8
- return (_jsxs(Box, { border: "1px solid", borderColor: theme.colors.gray[200], borderRadius: borderRadius, overflow: "hidden", bg: theme.colors.background[50], children: [showToolbar && (_jsxs(Flex, { align: "center", justify: "space-between", px: 4, py: 2.5, borderBottom: "1px solid", borderColor: theme.colors.gray[100], bg: theme.colors.gray[50], children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(FileText, { size: 18, color: theme.colors.accentText }), _jsx(Text, { fontSize: "sm", fontWeight: 500, color: theme.colors.gray[700], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: fileName })] }), _jsxs(Flex, { align: "center", gap: 1, children: [_jsx(ToolTip, { label: "Open in new tab", placement: "top", children: _jsx(Box, { as: "a", href: pdfUrl, target: "_blank", rel: "noopener noreferrer", p: 2, borderRadius: "lg", color: theme.colors.gray[600], _hover: { bg: theme.colors.primary[50], color: theme.colors.primary[500] }, children: _jsx(ExternalLink, { size: 16 }) }) }), _jsx(ToolTip, { label: "Download", placement: "top", children: _jsx(Box, { as: "a", href: pdfUrl, download: fileName, p: 2, borderRadius: "lg", color: theme.colors.gray[600], _hover: { bg: theme.colors.primary[50], color: theme.colors.primary[500] }, children: _jsx(Download, { size: 16 }) }) })] })] })), _jsx(Box, { as: "embed", src: pdfUrl, type: "application/pdf", width: "100%", height: height, display: "block" })] }));
10
+ const toolbarSurface = theme.colors.gray[50];
11
+ const iconHoverInk = accentTextOnCanvas(theme.colors.primary, toolbarSurface);
12
+ const iconHoverBg = resolveHoverTint(theme.colors.primary[50], toolbarSurface);
13
+ return (_jsxs(Box, { border: "1px solid", borderColor: theme.colors.gray[200], borderRadius: borderRadius, overflow: "hidden", bg: theme.colors.background[50], children: [showToolbar && (_jsxs(Flex, { align: "center", justify: "space-between", px: 4, py: 2.5, borderBottom: "1px solid", borderColor: theme.colors.gray[100], bg: theme.colors.gray[50], children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(FileText, { size: 18, color: theme.colors.accentText }), _jsx(Text, { fontSize: "sm", fontWeight: 500, color: theme.colors.gray[700], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: fileName })] }), _jsxs(Flex, { align: "center", gap: 1, children: [_jsx(ToolTip, { label: "Open in new tab", placement: "top", children: _jsx(Box, { as: "a", href: pdfUrl, target: "_blank", rel: "noopener noreferrer", p: 2, borderRadius: "lg", color: theme.colors.gray[600], _hover: { bg: iconHoverBg, color: iconHoverInk }, children: _jsx(ExternalLink, { size: 16 }) }) }), _jsx(ToolTip, { label: "Download", placement: "top", children: _jsx(Box, { as: "a", href: pdfUrl, download: fileName, p: 2, borderRadius: "lg", color: theme.colors.gray[600], _hover: { bg: iconHoverBg, color: iconHoverInk }, children: _jsx(Download, { size: 16 }) }) })] })] })), _jsx(Box, { as: "embed", src: pdfUrl, type: "application/pdf", width: "100%", height: height, display: "block" })] }));
9
14
  };
10
15
  export default PdfViewer;
@@ -8,7 +8,7 @@ export default function PinInputs({ otp, mask, defaultValue, placeholder, manage
8
8
  // [800], not [300]/[700]: WCAG 1.4.11 needs >=3.0 for a control boundary, measured
9
9
  // against the parent surface — up to `muted` (lightest). [700] fails there (2.41-2.72);
10
10
  // [800] clears all named surfaces with margin (3.44-3.90).
11
- borderColor: theme.colors.boxborder[800], _focus: {
11
+ borderColor: theme.colors.boxborder[500], _focus: {
12
12
  borderColor: theme.colors.primary[500],
13
13
  boxShadow: `0 0 0 0.063rem ${theme.colors.primary[500]}`,
14
14
  } }, index))) }) })] }));
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Flex, Text } from "@chakra-ui/react";
3
3
  import { AlertCircle, Clock, Sparkles } from "lucide-react";
4
4
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
5
- import { onGradient } from "../../Theme/tokens/builders/accentText.js";
6
- import { chipBorder, chipFill, inkSafeGradient, statusGradient, } from "./planPillGradient.js";
5
+ import { resolveGradient, gradientCss } from "../../Theme/tokens/builders/gradientInk.js";
6
+ import { chipBorder, chipFill, statusGradient, } from "./planPillGradient.js";
7
7
  const TONE_ICON = {
8
8
  normal: Sparkles,
9
9
  warning: Clock,
@@ -13,15 +13,15 @@ const PlanPill = ({ label, mobileLabel, status, tone = "normal", icon, gradient,
13
13
  const theme = useCustomTheme();
14
14
  const c = theme.colors;
15
15
  const toneGradient = {
16
- normal: inkSafeGradient(c.gradient),
16
+ normal: c.gradient,
17
17
  warning: statusGradient(c.semantic.warning),
18
18
  danger: statusGradient(c.semantic.error),
19
19
  };
20
- const resolved = inkSafeGradient(gradient !== null && gradient !== void 0 ? gradient : toneGradient[tone]);
21
- const ink = onGradient(resolved.from, resolved.to, c.white, c.black);
20
+ const resolved = resolveGradient(gradient !== null && gradient !== void 0 ? gradient : toneGradient[tone], c.white, c.black);
21
+ const ink = resolved.ink;
22
22
  const Icon = icon === undefined ? TONE_ICON[tone] : icon;
23
23
  const hasMobile = !!mobileLabel && mobileLabel !== label;
24
- return (_jsxs(Box, { as: "button", type: "button", "aria-label": ariaLabel || (status ? `${label} — ${status}` : label), onClick: onClick, display: "inline-flex", alignItems: "center", gap: "7px", pl: "12px", pr: status ? "5px" : "12px", py: "3px", bgImage: `linear-gradient(135deg, ${resolved.from} 0%, ${resolved.to} 100%)`, color: ink, borderRadius: "full", whiteSpace: "nowrap", cursor: "pointer", transition: "transform 0.2s ease, box-shadow 0.2s ease", _hover: {
24
+ return (_jsxs(Box, { as: "button", type: "button", "aria-label": ariaLabel || (status ? `${label} — ${status}` : label), onClick: onClick, display: "inline-flex", alignItems: "center", gap: "7px", pl: "12px", pr: status ? "5px" : "12px", py: "3px", bgImage: gradientCss(resolved), color: ink, borderRadius: "full", whiteSpace: "nowrap", cursor: "pointer", transition: "transform 0.2s ease, box-shadow 0.2s ease", _hover: {
25
25
  transform: "translateY(-1px)",
26
26
  boxShadow: `0 6px 18px ${resolved.from}59`,
27
27
  }, _focusVisible: {
@@ -2,22 +2,10 @@ import { resolveAvatarFill } from "../../Theme/tokens/builders/statusTone.js";
2
2
  import { relativeLuminance } from "../../Theme/tokens/builders/color.js";
3
3
  export const STATUS_INK = "#ffffff";
4
4
  /**
5
- * The plan badge's `normal` tone is a single fixed accent not brand-driven, and
6
- * not mode-dependent.
7
- *
8
- * Its tone carries meaning (normal / warning / danger), and a brand gradient can
9
- * collide with that: rosewood's `#c74962 → #ea0727` is red, so a healthy plan
10
- * rendered as if it had expired. Greyscale brands failed the other way, sinking
11
- * the badge into the header chrome.
12
- *
13
- * One accent for both color modes is deliberate: a lighter dark-mode variant was
14
- * tried and flipped `onGradient`'s ink to black, which read as a washed-out candy
15
- * pill on dark chrome. These stops keep white ink in both modes, so the badge looks
16
- * like the same component everywhere. Verified at AA (>= 4.5:1) on both stops.
17
- *
18
- * Consumers who genuinely want another colour still pass `gradient`.
5
+ * Opt-in accent for consumers who want a fixed badge colour instead of the brand `gradient`.
6
+ * One hue, like every brand gradient — a second hue reads as a status change, not a style.
19
7
  */
20
- export const ACCENT_GRADIENT = { from: "#8B3FC8", to: "#df187a" };
8
+ export const ACCENT_GRADIENT = { from: "#8b3fc8", to: "#762d9d" };
21
9
  /**
22
10
  * Sinks both stops until WHITE ink clears AA, keeping each stop's hue. Any mid-tone gradient —
23
11
  * a brand `gradient` token, a status scale — otherwise flips `onGradient` to black ink, so the
@@ -0,0 +1,6 @@
1
+ export { Box, Flex, Stack, VStack, HStack, Grid, GridItem, SimpleGrid, Wrap, WrapItem, Center, Spacer, Container, Divider, Text, Heading, Link, Image, Icon, Avatar, AvatarGroup, Badge, Spinner, Alert, AlertIcon, AlertTitle, AlertDescription, Portal, Collapse, Show, Hide, List, ListItem, ListIcon, OrderedList, UnorderedList, Tabs, TabList, Tab, TabPanels, TabPanel, Popover, PopoverTrigger, PopoverContent, PopoverBody, PopoverHeader, PopoverFooter, PopoverArrow, PopoverCloseButton, FormControl, FormLabel, FormErrorMessage, FormHelperText, IconButton, TableContainer, Thead, Tbody, Tfoot, Tr, Th, Td, Menu, MenuButton, MenuList, MenuItem, MenuGroup, MenuDivider, MenuOptionGroup, MenuItemOption, Accordion, AccordionItem, AccordionButton, AccordionPanel, AccordionIcon, SliderTrack, SliderFilledTrack, SliderThumb, SliderMark, ChakraProvider, extendTheme, useDisclosure, useMediaQuery, useToken, useBreakpointValue, } from "@chakra-ui/react";
2
+ // Renamed: the library's own Table and Slider own these names.
3
+ export { Table as TableRoot, Slider as RangeSlider } from "@chakra-ui/react";
4
+ export { Input, Textarea, Progress, Radio, RadioGroup, Skeleton, ModalOverlay, ModalContent, ModalCloseButton, CardBody, } from "@chakra-ui/react";
5
+ // Prefixed because the library ships its own component under each of these names.
6
+ export { Card as ChakraCard, Select as ChakraSelect, Modal as ChakraModal, ModalBody as ChakraModalBody, ModalHeader as ChakraModalHeader, ModalFooter as ChakraModalFooter, } from "@chakra-ui/react";
@@ -104,7 +104,7 @@ const ProductPrice = ({ options, size, onSelect, rightSlot }) => {
104
104
  }, templateColumns: { base: '1fr auto', md: '1fr auto' },
105
105
  // columnGap={{ base: 2, md: 3 }}
106
106
  // rowGap={{ base: 1.5, md: 2 }}
107
- alignItems: "center", children: [_jsx(HStack, { gridColumn: 1, gridRow: 1, spacing: 2, align: "center", minW: 0, mb: 0, children: _jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: { base: "xs", md: "sm" }, fontWeight: "medium", whiteSpace: "nowrap", children: option.label }) }) }), _jsx(Box, { gridColumn: 1, gridRow: 2, mt: 0, textAlign: "left", children: _jsxs(HStack, { spacing: 2, align: "center", children: [option.offer > 0 && (_jsx(Badge, { bg: theme.colors.green[100], color: accentTextOnCanvas(theme.colors.green, theme.colors.green[100]), borderRadius: "md", px: { base: 0, md: 0.5 }, py: { base: 0, md: 0.25 }, fontWeight: "bold", fontSize: "10px", flexShrink: 0, children: isMobile ? `${option.offer}%` : `${option.offer}% OFF` })), _jsxs(Text, { fontSize: "sm", fontWeight: "bold", color: accentTextOnCanvas(theme.colors.red, isSelected ? theme.colors.red[50] : theme.colors.background[50]), whiteSpace: "nowrap", children: ["\u20B9", discounted] }), option.offer > 0 && (_jsxs(Text, { fontSize: "xs", color: theme.colors.textMuted, textDecoration: "line-through", whiteSpace: "nowrap", children: ["\u20B9", option.price] }))] }) }), _jsx(Box, { gridColumn: 2, gridRow: 1, ml: { base: 0, md: 0 }, justifySelf: "end", w: { base: "0.625rem", md: "0.75rem" }, h: { base: "0.625rem", md: "0.75rem" }, minW: { base: "0.625rem", md: "0.75rem" }, borderRadius: "full", border: "0.125rem solid", borderColor: isSelected ? theme.colors.red[500] : theme.colors.boxborder[800], bg: theme.colors.background[50], display: "flex", alignItems: "center", justifyContent: "center", boxShadow: "none", children: isSelected && (_jsx(Box, { w: { base: "0.25rem", md: "0.3125rem" }, h: { base: "0.25rem", md: "0.3125rem" }, bg: theme.colors.red[500], borderRadius: "full" })) })] }, option.var_id));
107
+ alignItems: "center", children: [_jsx(HStack, { gridColumn: 1, gridRow: 1, spacing: 2, align: "center", minW: 0, mb: 0, children: _jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: { base: "xs", md: "sm" }, fontWeight: "medium", whiteSpace: "nowrap", children: option.label }) }) }), _jsx(Box, { gridColumn: 1, gridRow: 2, mt: 0, textAlign: "left", children: _jsxs(HStack, { spacing: 2, align: "center", children: [option.offer > 0 && (_jsx(Badge, { bg: theme.colors.green[100], color: accentTextOnCanvas(theme.colors.green, theme.colors.green[100]), borderRadius: "md", px: { base: 0, md: 0.5 }, py: { base: 0, md: 0.25 }, fontWeight: "bold", fontSize: "10px", flexShrink: 0, children: isMobile ? `${option.offer}%` : `${option.offer}% OFF` })), _jsxs(Text, { fontSize: "sm", fontWeight: "bold", color: accentTextOnCanvas(theme.colors.red, isSelected ? theme.colors.red[50] : theme.colors.background[50]), whiteSpace: "nowrap", children: ["\u20B9", discounted] }), option.offer > 0 && (_jsxs(Text, { fontSize: "xs", color: theme.colors.textMuted, textDecoration: "line-through", whiteSpace: "nowrap", children: ["\u20B9", option.price] }))] }) }), _jsx(Box, { gridColumn: 2, gridRow: 1, ml: { base: 0, md: 0 }, justifySelf: "end", w: { base: "0.625rem", md: "0.75rem" }, h: { base: "0.625rem", md: "0.75rem" }, minW: { base: "0.625rem", md: "0.75rem" }, borderRadius: "full", border: "0.125rem solid", borderColor: isSelected ? theme.colors.red[500] : theme.colors.boxborder[500], bg: theme.colors.background[50], display: "flex", alignItems: "center", justifyContent: "center", boxShadow: "none", children: isSelected && (_jsx(Box, { w: { base: "0.25rem", md: "0.3125rem" }, h: { base: "0.25rem", md: "0.3125rem" }, bg: theme.colors.red[500], borderRadius: "full" })) })] }, option.var_id));
108
108
  }) }) })), _jsxs(Flex, { mt: 2, w: "full", gap: 3, direction: { base: "column", md: "row" }, align: { base: "flex-start", md: "center" }, justify: { base: "flex-start", md: rightSlot ? "space-between" : "flex-start" }, children: [_jsxs(Box, { display: "flex", alignItems: "center", fontSize: cfg.price, gap: 2, minW: 0, children: [selected.offer > 0 && (_jsxs(Text, { color: theme.colors.textMuted, textDecoration: "line-through", children: ["\u20B9", selected.price] })), _jsxs(Text, { color: accentTextOnCanvas(theme.colors.red, theme.colors.backgroundColor.main), fontWeight: "semibold", children: ["\u20B9", getDiscountedPrice(selected)] })] }), rightSlot && (_jsx(Box, { flexShrink: 0, mt: { base: 2, md: 0 }, children: rightSlot }))] })] }));
109
109
  };
110
110
  export default ProductPrice;
@@ -3,6 +3,8 @@ import { Box, Flex, Text, Icon } from '@chakra-ui/react';
3
3
  import { BookCheck, Star } from 'lucide-react';
4
4
  import { useCustomTheme } from '../../Theme/useCustomTheme.js';
5
5
  import { accentTextOnCanvas } from '../../Theme/tokens/builders/accentText.js';
6
+ import { contrastRatio } from '../../Theme/tokens/builders/color.js';
7
+ import { AA_NON_TEXT } from '../../Theme/tokens/builders/outlineRung.js';
6
8
  // The theme's `yellow` scale reverses index roles in dark mode (like every utility hue), so
7
9
  // pulling it through the theme would silently flip this decorative "filled star" from gold to
8
10
  // pale. A rating star is a universal, brand-independent gold — not something that should follow
@@ -17,6 +19,9 @@ const ProductReview = ({ rating, reviewCount, mb = 0 }) => {
17
19
  // Calculate fill percentage: (rating / 5) * 100%
18
20
  const numericRating = hasRating ? Math.min(Math.max(Number(rating), 0), 5) : 0;
19
21
  const fillPercentage = (numericRating / 6) * 100;
20
- return (_jsxs(Flex, { align: "center", gap: 2, mb: mb, children: [hasRating && (_jsxs(Flex, { align: "center", gap: 1, bg: colors.teal[50], color: accentTextOnCanvas(colors.teal, colors.teal[50]), px: 2, borderRadius: "md", children: [_jsxs(Box, { position: "relative", flexShrink: 0, display: "inline-block", width: "14px", height: "14px", lineHeight: 0, children: [_jsx(Box, { position: "absolute", top: 0, left: 0, width: "14px", height: "14px", children: _jsx(Star, { size: 14, fill: "none", strokeWidth: 1.5 }) }), fillPercentage > 0 && (_jsx(Box, { position: "absolute", top: 0, left: 0, width: `${fillPercentage}%`, height: "100%", overflow: "hidden", children: _jsx(Star, { size: 14, color: RATING_STAR_FILL, fill: RATING_STAR_FILL }) }))] }), _jsx(Text, { fontSize: "sm", fontWeight: "bold", children: numericRating })] })), hasRating && hasReviewCount && _jsx(Box, { h: "4", w: "0.063rem", bg: colors.boxborder[500] }), hasReviewCount && (_jsxs(Flex, { align: "center", gap: "1", children: [_jsx(Icon, { as: BookCheck, boxSize: 3.5 }), _jsxs(Text, { fontSize: "sm", color: colors.textMuted, children: ["(", reviewCount, ")"] })] }))] }));
22
+ const chipBg = colors.teal[50];
23
+ const chipInk = accentTextOnCanvas(colors.teal, chipBg);
24
+ const starFill = contrastRatio(RATING_STAR_FILL, chipBg) >= AA_NON_TEXT ? RATING_STAR_FILL : chipInk;
25
+ return (_jsxs(Flex, { align: "center", gap: 2, mb: mb, children: [hasRating && (_jsxs(Flex, { align: "center", gap: 1, bg: chipBg, color: chipInk, px: 2, borderRadius: "md", children: [_jsxs(Box, { position: "relative", flexShrink: 0, display: "inline-block", width: "14px", height: "14px", lineHeight: 0, children: [_jsx(Box, { position: "absolute", top: 0, left: 0, width: "14px", height: "14px", children: _jsx(Star, { size: 14, fill: "none", strokeWidth: 1.5 }) }), fillPercentage > 0 && (_jsx(Box, { position: "absolute", top: 0, left: 0, width: `${fillPercentage}%`, height: "100%", overflow: "hidden", children: _jsx(Star, { size: 14, color: starFill, fill: starFill }) }))] }), _jsx(Text, { fontSize: "sm", fontWeight: "bold", children: numericRating })] })), hasRating && hasReviewCount && _jsx(Box, { h: "4", w: "0.063rem", bg: colors.boxborder[500] }), hasReviewCount && (_jsxs(Flex, { align: "center", gap: "1", children: [_jsx(Icon, { as: BookCheck, boxSize: 3.5 }), _jsxs(Text, { fontSize: "sm", color: colors.textMuted, children: ["(", reviewCount, ")"] })] }))] }));
21
26
  };
22
27
  export default ProductReview;
@@ -20,8 +20,8 @@ const ProductTags = ({ tags, className, size = 'sm' }) => {
20
20
  };
21
21
  const Tag = ({ children, fullWidth = false, size = 'sm', }) => {
22
22
  const { colors } = useCustomTheme();
23
- const tagBorder = colors.semanticText.error;
24
23
  const tagText = colors.text[900];
24
+ const tagBorder = colors.boxborder[500];
25
25
  // Size map for tags
26
26
  const tagSizes = {
27
27
  xs: { fontSize: '0.625rem', px: '0.5rem', py: '0.125rem' },
@@ -13,7 +13,7 @@ export const ProfileCardFooter = ({ children, }) => {
13
13
  };
14
14
  export default function ProfileCard({ maxW, align, variant, direction, justify, children, size, color, overflow, dividercolor, dividersize = "0.5px", dividervariant = "solid", CardStyle, CardHeaderStyle, CardBodyStyle, borderTopColor, borderLeftColor, }) {
15
15
  const { colors } = useCustomTheme();
16
- const resolvedDividerColor = dividercolor !== null && dividercolor !== void 0 ? dividercolor : colors.border[400];
16
+ const resolvedDividerColor = dividercolor !== null && dividercolor !== void 0 ? dividercolor : colors.boxborder[200];
17
17
  const accentBorder = `2px solid ${colors.primary[500]}`;
18
18
  const isReactElement = (child) => {
19
19
  return child !== null && typeof child === "object" && "type" in child;
@@ -35,7 +35,7 @@ export default function ProfilePhotoViewer({ photoUrl, onPhotoChange, imageWidth
35
35
  // [800], not [300]: the edit IconButton's border is a control boundary — WCAG 1.4.11 needs
36
36
  // >=3.0 against any named surface up to `muted` (lightest); [300] fails there, [800] clears
37
37
  // all with margin.
38
- const border = c.boxborder[800];
38
+ const border = c.boxborder[500];
39
39
  // Shared modern frame for whichever media we render (photo / pdf / fallback).
40
40
  const mediaFrame = {
41
41
  boxSize: imageWidth,
@@ -2,9 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Radio as ChakraRadio, RadioGroup as ChakraRadioGroup, Stack, } from "@chakra-ui/react";
3
3
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
4
4
  import { TextLabel } from "../Common/FormLabel.js";
5
+ import { liftToContrast, AA_NON_TEXT } from "../../Theme/tokens/builders/outlineRung.js";
5
6
  const RadioButton = ({ label, colorScheme, isChecked, onChange, isDisabled, size, value, defaultChecked, labelFontSize = "0.75rem", labelClampLines = 2, showLabelTooltip = (label || "").length > 18, labelTooltip = label, }) => {
6
7
  const theme = useCustomTheme();
7
- return (_jsx(ChakraRadio, { colorScheme: colorScheme, isChecked: isChecked, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.gray[500], borderWidth: "1.6px", _hover: {
8
+ return (_jsx(ChakraRadio, { colorScheme: colorScheme, isChecked: isChecked, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.boxborder[500], borderWidth: "1.6px", _hover: {
8
9
  borderColor: theme.colors.primary[500],
9
10
  backgroundColor: theme.colors.background[100],
10
11
  }, sx: {
@@ -15,7 +16,7 @@ const RadioButton = ({ label, colorScheme, isChecked, onChange, isDisabled, size
15
16
  "&[data-checked]:hover": {
16
17
  backgroundColor: theme.colors.primary[500],
17
18
  borderColor: theme.colors.primary[500],
18
- boxShadow: `0 0 0 2px ${theme.colors.primary[200]}`,
19
+ boxShadow: `0 0 0 2px ${liftToContrast(theme.colors.primary[200], theme.colors.backgroundColor.main, AA_NON_TEXT)}`,
19
20
  },
20
21
  }, children: _jsx(TextLabel, { label: label, fontSize: labelFontSize, showTooltip: showLabelTooltip, tooltipLabel: labelTooltip, clampLines: labelClampLines, inline: true }) }));
21
22
  };
@@ -15,7 +15,7 @@ const ReorderList = ({ label = "", items, onReorder, showRemoveIcon = false, onR
15
15
  };
16
16
  return (_jsxs(Box, { borderWidth: "0.063rem", borderRadius: "md", px: 3, py: 2, bg: colors.background[50], children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(BetweenHorizonalStart, {}), _jsx(Text, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize: 14, lineHeight: "100%", letterSpacing: "4%", textTransform: "uppercase", py: 4, children: label })] }), _jsx(Divider, {}), _jsx("br", {}), _jsx(DragDropContext, { onDragEnd: handleDragEnd, children: _jsx(Droppable, { droppableId: "item-list", direction: "horizontal", children: (provided) => (_jsxs(HStack, { ref: provided.innerRef, ...provided.droppableProps, spacing: 4, overflowX: "auto", children: [items.map((item, index) => (_jsx(Draggable, { draggableId: item.id, index: index, children: (provided) => {
17
17
  var _a;
18
- return (_jsxs(Box, { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, position: "relative", border: "0.063rem solid", borderColor: colors.boxborder[300], borderRadius: "md", overflow: "hidden", children: [_jsx(Image, { src: item.previewUrl, alt: (_a = item.name) !== null && _a !== void 0 ? _a : `item-${index}`, boxSize: "7.5rem", objectFit: "cover" }), _jsx(IconButton, { icon: _jsx(GripVertical, { size: 16, color: colors.textMuted }), "aria-label": "Drag", size: "sm", position: "absolute", top: 1, left: 1, variant: "ghost" }), _jsx(Badge, { position: "absolute", colorScheme: "gray", variant: "solid", bottom: 1, right: 1, children: index + 1 }), showRemoveIcon && (_jsx(IconButton, { icon: _jsx(X, { size: 16, color: colors.semanticText.error }), "aria-label": "Remove", size: "sm", position: "absolute", top: 1, right: 1, variant: "ghost", onClick: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove(item.id) }))] }));
18
+ return (_jsxs(Box, { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, position: "relative", border: "0.063rem solid", borderColor: colors.boxborder[200], borderRadius: "md", overflow: "hidden", children: [_jsx(Image, { src: item.previewUrl, alt: (_a = item.name) !== null && _a !== void 0 ? _a : `item-${index}`, boxSize: "7.5rem", objectFit: "cover" }), _jsx(IconButton, { icon: _jsx(GripVertical, { size: 16, color: colors.textMuted }), "aria-label": "Drag", size: "sm", position: "absolute", top: 1, left: 1, variant: "ghost" }), _jsx(Badge, { position: "absolute", colorScheme: "gray", variant: "solid", bottom: 1, right: 1, children: index + 1 }), showRemoveIcon && (_jsx(IconButton, { icon: _jsx(X, { size: 16, color: colors.semanticText.error }), "aria-label": "Remove", size: "sm", position: "absolute", top: 1, right: 1, variant: "ghost", onClick: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove(item.id) }))] }));
19
19
  } }, item.id))), provided.placeholder] })) }) })] }));
20
20
  };
21
21
  export default ReorderList;
@@ -5,6 +5,7 @@ import { ChevronUp } from "lucide-react";
5
5
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
6
  import ToolTip from "../ToolTip/ToolTip.js";
7
7
  import { rafThrottle } from "../../Utils/rafThrottle.js";
8
+ import { onFilled } from "../../Theme/tokens/builders/accentText.js";
8
9
  const ScrollToTop = ({ children, tooltipLabel = "Scroll to top", threshold = 300, duration = 600, useWindow = false, bottom = "2rem", right = "2rem", }) => {
9
10
  const [visible, setVisible] = useState(false);
10
11
  const anchorRef = useRef(null);
@@ -59,6 +60,7 @@ const ScrollToTop = ({ children, tooltipLabel = "Scroll to top", threshold = 300
59
60
  }, [useWindow, threshold]);
60
61
  return (_jsxs(Box, { ref: anchorRef, position: "relative", children: [children, _jsx(ToolTip, { label: tooltipLabel, placement: "left", children: _jsx(Box, { as: "button", type: "button", onClick: scrollToTop, "aria-label": tooltipLabel, border: "none", position: "fixed", bottom: bottom, right: right, zIndex: 1000, display: "flex", alignItems: "center", justifyContent: "center", boxSize: "44px", borderRadius: "full", cursor: "pointer", bg: theme.colors.primary[500], color: theme.colors.onPrimary, boxShadow: "md", opacity: visible ? 1 : 0, transform: visible ? "translateY(0) scale(1)" : "translateY(16px) scale(0.85)", pointerEvents: visible ? "auto" : "none", transition: "all 0.25s cubic-bezier(0.16, 1, 0.3, 1)", _hover: {
61
62
  bg: theme.colors.primary[600],
63
+ color: onFilled(theme.colors.primary[600], theme.colors.white, theme.colors.black),
62
64
  transform: "translateY(-2px) scale(1.05)",
63
65
  boxShadow: "lg",
64
66
  }, _active: { transform: "scale(0.95)" }, children: _jsx(ChevronUp, { size: 24, strokeWidth: 2.5 }) }) })] }));
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box } from "@chakra-ui/react";
3
+ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
4
+ import { scrollbarStyles, } from "../../Theme/tokens/builders/scrollbar.js";
5
+ const ScrollbarBox = ({ children, height, maxHeight, overflowX, overflowY = "auto", variant = "default", scrollContainerRef, }) => {
6
+ const { colors } = useCustomTheme();
7
+ return (_jsx(Box, { ref: scrollContainerRef, height: height, maxHeight: maxHeight, position: "relative", sx: { overflowX, overflowY, ...scrollbarStyles(colors, variant) }, children: children }));
8
+ };
9
+ export default ScrollbarBox;
@@ -24,6 +24,6 @@ export default function Search({ placeholder = "Search...", onSearch, onclose, s
24
24
  window.removeEventListener("keydown", handleKeyDown);
25
25
  };
26
26
  }, [shortcut]);
27
- return (_jsxs(FormControl, { id: id, isInvalid: !!error, children: [label && (_jsx(TextLabel, { label: label, id: id, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired })), _jsxs(InputGroup, { w: "100%", children: [_jsx(InputLeftElement, { pointerEvents: "none", children: _jsx(Icon, { as: SearchIconComponent, color: theme.colors.gray[500] }) }), _jsx(Input, { ref: inputRef, type: "text", value: query, onChange: onSearch, placeholder: placeholder, variant: "outline", isInvalid: error }), _jsxs(InputRightElement, { w: "auto", pr: "3", display: "flex", alignItems: "center" // ✅ centers vertically
28
- , gap: "2", children: [query && (_jsx(Icon, { as: X, color: theme.colors.gray[500], boxSize: 5, cursor: "pointer", onClick: onclose })), shortcut && (_jsx(Text, { fontSize: "sm", color: theme.colors.gray[500], px: "2", py: "0.5", borderRadius: "md", bg: theme.colors.gray[100], children: shortcut }))] })] }), error && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
27
+ return (_jsxs(FormControl, { id: id, isInvalid: !!error, children: [label && (_jsx(TextLabel, { label: label, id: id, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired })), _jsxs(InputGroup, { w: "100%", children: [_jsx(InputLeftElement, { pointerEvents: "none", children: _jsx(Icon, { as: SearchIconComponent, color: theme.colors.textMuted }) }), _jsx(Input, { ref: inputRef, type: "text", value: query, onChange: onSearch, placeholder: placeholder, variant: "outline", isInvalid: error }), _jsxs(InputRightElement, { w: "auto", pr: "3", display: "flex", alignItems: "center" // ✅ centers vertically
28
+ , gap: "2", children: [query && (_jsx(Icon, { as: X, color: theme.colors.textMuted, boxSize: 5, cursor: "pointer", onClick: onclose })), shortcut && (_jsx(Text, { fontSize: "sm", color: theme.colors.textMuted, px: "2", py: "0.5", borderRadius: "md", bg: theme.colors.backgroundColor.subtle, children: shortcut }))] })] }), error && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
29
29
  }
@@ -5,6 +5,8 @@ import { Check, ChevronDown, ChevronUp, CircleX, Plus, X } from "lucide-react";
5
5
  import { TextLabel } from "../Common/FormLabel.js";
6
6
  import Tag from "../Tag/Tag.js";
7
7
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
8
+ import { placeholderInk } from "../../Theme/tokens/builders/placeholderInk.js";
9
+ import { resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
8
10
  import ErrorMessage from "../Common/ErrorMessage.js";
9
11
  import HelperText from "../Common/HelperText.js";
10
12
  import ToolTip from "../ToolTip/ToolTip.js";
@@ -49,6 +51,9 @@ const SearchSelect = ({ id, label, options, onSelect, onSearch, isOptionLoading
49
51
  width: 0,
50
52
  });
51
53
  const theme = useCustomTheme();
54
+ const customSelectActiveTint = useMemo(() => resolveHoverTint(theme.colors.primary[500], theme.colors.background[400]), [theme.colors.primary, theme.colors.background]);
55
+ const dropdownActiveTint = useMemo(() => resolveHoverTint(theme.colors.primary[500], theme.colors.background[50]), [theme.colors.primary, theme.colors.background]);
56
+ const dropdownHoverTint = useMemo(() => resolveHoverTint(theme.colors.gray[50], theme.colors.background[50]), [theme.colors.gray, theme.colors.background]);
52
57
  // `searchselect-dropdown-portal` is also the DOM id an existing outside-click check and
53
58
  // several tests look up directly — kept as a literal constant, not derived from `baseId`,
54
59
  // so those keep working unchanged.
@@ -449,25 +454,25 @@ const SearchSelect = ({ id, label, options, onSelect, onSearch, isOptionLoading
449
454
  var _a, _b, _c, _d, _e;
450
455
  const insideLabel = (_a = insideSelect.value) === null || _a === void 0 ? void 0 : _a.label;
451
456
  const insidePlaceholder = (_b = insideSelect.placeholder) !== null && _b !== void 0 ? _b : "Select";
452
- return (_jsxs(Box, { position: "relative", ref: customSelectRef, flexShrink: 0, ml: s.insideSelectMarginLeft, h: "-webkit-fill-available", borderRight: "0.063rem solid", borderColor: theme.colors.boxborder[300], bg: customSelectOpen
453
- ? theme.colors.primary.opacity[8]
457
+ return (_jsxs(Box, { position: "relative", ref: customSelectRef, flexShrink: 0, ml: s.insideSelectMarginLeft, h: "-webkit-fill-available", borderRight: "0.063rem solid", borderColor: theme.colors.boxborder[200], bg: customSelectOpen
458
+ ? customSelectActiveTint
454
459
  : theme.colors.background[400], borderLeftRadius: "md", borderRightRadius: 0, transition: "background 0.15s ease, box-shadow 0.15s ease", boxShadow: customSelectOpen
455
460
  ? `inset 0 0 0 0.063rem ${theme.colors.primary[500]}`
456
461
  : "none", onClick: (e) => {
457
462
  e.stopPropagation();
458
463
  setIsOpen(false);
459
464
  setCustomSelectOpen((prev) => !prev);
460
- }, children: [_jsxs(Box, { minW: "4.5rem", cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", gap: 1, width: insideSelect.width, height: insideSelectBoxHeight, pl: "0.5rem", pr: "0.375rem", children: [insideLabel ? (_jsx(SelectTruncatedLabel, { label: insideLabel, maxWidth: insideSelect.width || "6rem", fontSize: s.fieldFontSize })) : (_jsx(Text, { fontSize: s.fieldFontSize, fontWeight: 500, color: theme.colors.placeholder[500], isTruncated: true, maxW: insideSelect.width || "6rem", children: insidePlaceholder })), _jsx(Box, { as: "span", display: "inline-flex", flexShrink: 0, color: customSelectOpen ? theme.colors.accentText : theme.colors.textMuted, transition: "transform 0.2s ease, color 0.15s ease", transform: customSelectOpen ? "rotate(180deg)" : "rotate(0deg)", children: _jsx(ChevronDown, { size: s.chevronSize }) })] }), customSelectOpen && (_jsx(Portal, { children: _jsx(Box, { ref: setInsideSelectMenuRef, id: "custom-select-portal", position: "fixed", top: `${customSelectPos.top}px`, left: `${customSelectPos.left}px`, zIndex: 1510, bg: theme.colors.background[50], border: "0.063rem solid", borderColor: theme.colors.boxborder[200], borderRadius: "lg", boxShadow: (_d = (_c = theme.shadows) === null || _c === void 0 ? void 0 : _c.md) !== null && _d !== void 0 ? _d : "md", minW: `${customSelectPos.width}px`, maxW: "20rem", py: 1, overflow: "hidden", children: (_e = insideSelect.option) === null || _e === void 0 ? void 0 : _e.map((item) => {
465
+ }, children: [_jsxs(Box, { minW: "4.5rem", cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", gap: 1, width: insideSelect.width, height: insideSelectBoxHeight, pl: "0.5rem", pr: "0.375rem", children: [insideLabel ? (_jsx(SelectTruncatedLabel, { label: insideLabel, maxWidth: insideSelect.width || "6rem", fontSize: s.fieldFontSize })) : (_jsx(Text, { fontSize: s.fieldFontSize, fontWeight: 500, color: placeholderInk(theme.colors), isTruncated: true, maxW: insideSelect.width || "6rem", children: insidePlaceholder })), _jsx(Box, { as: "span", display: "inline-flex", flexShrink: 0, color: customSelectOpen ? theme.colors.accentText : theme.colors.textMuted, transition: "transform 0.2s ease, color 0.15s ease", transform: customSelectOpen ? "rotate(180deg)" : "rotate(0deg)", children: _jsx(ChevronDown, { size: s.chevronSize }) })] }), customSelectOpen && (_jsx(Portal, { children: _jsx(Box, { ref: setInsideSelectMenuRef, id: "custom-select-portal", position: "fixed", top: `${customSelectPos.top}px`, left: `${customSelectPos.left}px`, zIndex: 1510, bg: theme.colors.background[50], border: "0.063rem solid", borderColor: theme.colors.boxborder[200], borderRadius: "lg", boxShadow: (_d = (_c = theme.shadows) === null || _c === void 0 ? void 0 : _c.md) !== null && _d !== void 0 ? _d : "md", minW: `${customSelectPos.width}px`, maxW: "20rem", py: 1, overflow: "hidden", children: (_e = insideSelect.option) === null || _e === void 0 ? void 0 : _e.map((item) => {
461
466
  var _a;
462
467
  const selected = ((_a = insideSelect.value) === null || _a === void 0 ? void 0 : _a.id) === item.id;
463
468
  return (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, minH: s.optionRowMinH, py: s.optionRowPy, px: "0.75rem", fontSize: s.dropdownTextFontSize, fontWeight: selected ? 600 : 500, color: selected
464
469
  ? theme.colors.accentText
465
470
  : theme.colors.text[700], bg: selected
466
- ? theme.colors.primary.opacity[8]
471
+ ? dropdownActiveTint
467
472
  : "transparent", _hover: {
468
473
  bg: selected
469
- ? theme.colors.primary.opacity[8]
470
- : theme.colors.gray[50],
474
+ ? dropdownActiveTint
475
+ : dropdownHoverTint,
471
476
  }, cursor: "pointer", onClick: (e) => {
472
477
  e.stopPropagation();
473
478
  handleCustomSelect(item);
@@ -506,10 +511,10 @@ const SearchSelect = ({ id, label, options, onSelect, onSearch, isOptionLoading
506
511
  setCustomSelectOpen(false);
507
512
  return !prev;
508
513
  });
509
- }, "aria-label": "toggle-dropdown", display: "flex", alignItems: "center", children: isOpen ? (_jsx(ChevronUp, { size: s.chevronSize })) : (_jsx(ChevronDown, { size: s.chevronSize })) }))] })] }) }), isOpen && (_jsx(Portal, { children: _jsxs(Box, { ref: setDropdownMenuRef, id: listboxId, role: "listbox", "aria-multiselectable": isMultiple || undefined, position: "fixed", top: `${dropdownPos.top}px`, left: `${dropdownPos.left}px`, width: `${dropdownPos.width}px`, zIndex: 1500, maxH: "20rem", borderWidth: 1, borderColor: theme.colors.boxborder[200], borderRadius: "sm", bg: theme.colors.background[50], boxShadow: "md", display: "flex", flexDirection: "column", children: [isMultiple && isSelectAll && (_jsxs(Box, { py: s.optionRowPy, px: 3, cursor: "pointer", onClick: handleSelectAll, display: "flex", alignItems: "center", gap: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[100]}`, children: [_jsx(Checkbox, { isChecked: allFilteredSelected, sx: { pointerEvents: "none" }, size: s.checkboxSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: allFilteredSelected ? "Unselect All" : "Select All" })] })), _jsx(Box, { flex: "1", overflowY: "auto", onScroll: handleScroll, maxH: "15rem", borderBottom: "0.063rem solid", borderColor: theme.colors.boxborder[200], children: isOptionLoading && filteredOptions.length === 0 ? (_jsxs(Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH, children: [_jsx(Spinner, { size: s.spinnerSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: loadingText })] })) : !isOptionLoading && filteredOptions.length === 0 ? (_jsx(Text, { p: 3, fontSize: s.dropdownTextFontSize, color: theme.colors.textMuted, children: "No results found" })) : (_jsxs(_Fragment, { children: [filteredOptions.map((option, index) => (_jsxs(Box, { id: getOptionId(index), role: "option", "aria-selected": isSelected(option.id), py: s.optionRowPy, px: 3, minH: s.optionRowMinH, cursor: "pointer", bg: index === activeIndex
510
- ? theme.colors.primary.opacity[8]
514
+ }, "aria-label": "toggle-dropdown", display: "flex", alignItems: "center", children: isOpen ? (_jsx(ChevronUp, { size: s.chevronSize })) : (_jsx(ChevronDown, { size: s.chevronSize })) }))] })] }) }), isOpen && (_jsx(Portal, { children: _jsxs(Box, { ref: setDropdownMenuRef, id: listboxId, role: "listbox", "aria-multiselectable": isMultiple || undefined, position: "fixed", top: `${dropdownPos.top}px`, left: `${dropdownPos.left}px`, width: `${dropdownPos.width}px`, zIndex: 1500, maxH: "20rem", borderWidth: 1, borderColor: theme.colors.boxborder[200], borderRadius: "sm", bg: theme.colors.background[50], boxShadow: "md", display: "flex", flexDirection: "column", children: [isMultiple && isSelectAll && (_jsxs(Box, { py: s.optionRowPy, px: 3, cursor: "pointer", onClick: handleSelectAll, display: "flex", alignItems: "center", gap: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[200]}`, children: [_jsx(Checkbox, { isChecked: allFilteredSelected, sx: { pointerEvents: "none" }, size: s.checkboxSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: allFilteredSelected ? "Unselect All" : "Select All" })] })), _jsx(Box, { flex: "1", overflowY: "auto", onScroll: handleScroll, maxH: "15rem", borderBottom: "0.063rem solid", borderColor: theme.colors.boxborder[200], children: isOptionLoading && filteredOptions.length === 0 ? (_jsxs(Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH, children: [_jsx(Spinner, { size: s.spinnerSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: loadingText })] })) : !isOptionLoading && filteredOptions.length === 0 ? (_jsx(Text, { p: 3, fontSize: s.dropdownTextFontSize, color: theme.colors.textMuted, children: "No results found" })) : (_jsxs(_Fragment, { children: [filteredOptions.map((option, index) => (_jsxs(Box, { id: getOptionId(index), role: "option", "aria-selected": isSelected(option.id), py: s.optionRowPy, px: 3, minH: s.optionRowMinH, cursor: "pointer", bg: index === activeIndex
515
+ ? dropdownActiveTint
511
516
  : isSelected(option.id)
512
517
  ? theme.colors.gray[100]
513
- : "transparent", _hover: { bg: theme.colors.gray[50] }, onClick: () => handleSelect(option), onMouseEnter: () => setActiveIndex(index), display: "flex", alignItems: "center", gap: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[100]}`, children: [isMultiple && (_jsx(Checkbox, { isChecked: isSelected(option.id), sx: { pointerEvents: "none" }, size: s.checkboxSize })), option.view ? (_jsx(_Fragment, { children: option.view })) : (_jsx(Text, { fontSize: s.dropdownTextFontSize, children: option.label }))] }, option.id))), ((pagination === null || pagination === void 0 ? void 0 : pagination.scrollLoading) || (isOptionLoading && filteredOptions.length > 0)) && (_jsxs(Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", justifyContent: "center", gap: 2, minH: s.optionRowMinH, children: [_jsx(Spinner, { size: s.spinnerSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: loadingText })] }))] })) }), (addNew === null || addNew === void 0 ? void 0 : addNew.enabled) && (_jsxs(Box, { py: s.optionRowPy, px: 3, borderTop: "0.063rem solid", borderColor: theme.colors.boxborder[200], bg: theme.colors.background[50], display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH, cursor: "pointer", onClick: addNew.onClick, _hover: { bg: theme.colors.gray[50] }, children: [addNew.icon || _jsx(Plus, { size: s.addNewIconSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: addNew.text || "Add New" })] }))] }) })), helperText && !error && _jsx(HelperText, { helperText: helperText }), error && _jsx(ErrorMessage, { errorMessage: errorMessage })] }));
518
+ : "transparent", _hover: { bg: dropdownHoverTint }, onClick: () => handleSelect(option), onMouseEnter: () => setActiveIndex(index), display: "flex", alignItems: "center", gap: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[200]}`, children: [isMultiple && (_jsx(Checkbox, { isChecked: isSelected(option.id), sx: { pointerEvents: "none" }, size: s.checkboxSize })), option.view ? (_jsx(_Fragment, { children: option.view })) : (_jsx(Text, { fontSize: s.dropdownTextFontSize, children: option.label }))] }, option.id))), ((pagination === null || pagination === void 0 ? void 0 : pagination.scrollLoading) || (isOptionLoading && filteredOptions.length > 0)) && (_jsxs(Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", justifyContent: "center", gap: 2, minH: s.optionRowMinH, children: [_jsx(Spinner, { size: s.spinnerSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: loadingText })] }))] })) }), (addNew === null || addNew === void 0 ? void 0 : addNew.enabled) && (_jsxs(Box, { py: s.optionRowPy, px: 3, borderTop: "0.063rem solid", borderColor: theme.colors.boxborder[200], bg: theme.colors.background[50], display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH, cursor: "pointer", onClick: addNew.onClick, _hover: { bg: dropdownHoverTint }, children: [addNew.icon || _jsx(Plus, { size: s.addNewIconSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: addNew.text || "Add New" })] }))] }) })), helperText && !error && _jsx(HelperText, { helperText: helperText }), error && _jsx(ErrorMessage, { errorMessage: errorMessage })] }));
514
519
  };
515
520
  export default SearchSelect;
@@ -0,0 +1,55 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRef } from "react";
3
+ import { Box, Flex } from "@chakra-ui/react";
4
+ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
5
+ const SIZES = {
6
+ sm: { h: "1.625rem", px: "0.625rem", fontSize: "0.75rem" },
7
+ md: { h: "2rem", px: "0.875rem", fontSize: "0.8125rem" },
8
+ };
9
+ export default function SegmentedControl({ options, value, onChange, size = "md", isFullWidth = false, "aria-label": ariaLabel, }) {
10
+ const { colors } = useCustomTheme();
11
+ const dims = SIZES[size];
12
+ const refs = useRef([]);
13
+ const selectedIndex = options.findIndex((o) => o.value === value);
14
+ const enabled = options.reduce((acc, o, i) => (o.isDisabled ? acc : [...acc, i]), []);
15
+ // WAI-APG: with nothing selected, the first enabled segment owns the tab stop.
16
+ const tabIndex = selectedIndex >= 0 ? selectedIndex : enabled[0];
17
+ const selectAt = (index) => {
18
+ var _a;
19
+ (_a = refs.current[index]) === null || _a === void 0 ? void 0 : _a.focus();
20
+ onChange(options[index].value);
21
+ };
22
+ const handleKeyDown = (event) => {
23
+ if (enabled.length === 0)
24
+ return;
25
+ const step = (delta) => {
26
+ const position = enabled.indexOf(tabIndex);
27
+ selectAt(enabled[(position + delta + enabled.length) % enabled.length]);
28
+ };
29
+ if (event.key === "ArrowRight" || event.key === "ArrowDown") {
30
+ event.preventDefault();
31
+ step(1);
32
+ }
33
+ else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
34
+ event.preventDefault();
35
+ step(-1);
36
+ }
37
+ else if (event.key === "Home") {
38
+ event.preventDefault();
39
+ selectAt(enabled[0]);
40
+ }
41
+ else if (event.key === "End") {
42
+ event.preventDefault();
43
+ selectAt(enabled[enabled.length - 1]);
44
+ }
45
+ };
46
+ return (_jsx(Flex, { role: "radiogroup", "aria-label": ariaLabel, onKeyDown: handleKeyDown, display: "inline-flex", align: "center", gap: "0.125rem", p: "0.125rem", borderRadius: "md", bg: colors.background[600], w: isFullWidth ? "100%" : "fit-content", children: options.map((option, index) => {
47
+ const isSelected = option.value === value;
48
+ return (_jsxs(Box, { as: "button", type: "button", ref: (node) => {
49
+ refs.current[index] = node;
50
+ }, role: "radio", "aria-checked": isSelected, disabled: option.isDisabled, tabIndex: index === tabIndex ? 0 : -1, onClick: () => onChange(option.value), display: "inline-flex", alignItems: "center", justifyContent: "center", gap: "0.375rem", flex: isFullWidth ? "1" : undefined, h: dims.h, px: dims.px, borderRadius: "base", borderWidth: "1px", borderStyle: "solid", borderColor: isSelected ? colors.background[400] : "transparent", bg: isSelected ? colors.background[50] : "transparent", boxShadow: isSelected ? "sm" : "none", color: isSelected ? colors.text[900] : colors.text[600], fontSize: dims.fontSize, fontWeight: isSelected ? 600 : 500, whiteSpace: "nowrap", opacity: option.isDisabled ? 0.5 : 1, cursor: option.isDisabled ? "not-allowed" : "pointer", transition: "background-color 0.2s ease, color 0.2s ease", _hover: option.isDisabled || isSelected ? undefined : { color: colors.text[900] }, _focusVisible: {
51
+ outline: "none",
52
+ boxShadow: `0 0 0 2px ${colors.primary[300]}`,
53
+ }, children: [option.icon, option.label] }, option.value));
54
+ }) }));
55
+ }