pixelize-design-library 2.4.2-beta.0 → 2.4.2-beta.2

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 (356) hide show
  1. package/dist/Components/Accordion/Accordion.js +13 -15
  2. package/dist/Components/Accordion/accordionColors.js +6 -9
  3. package/dist/Components/AlertDialog/AlertDialog.js +1 -2
  4. package/dist/Components/Apexcharts/ApexAreaChart/ApexAreaChart.js +2 -3
  5. package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.js +2 -3
  6. package/dist/Components/Apexcharts/ApexRadialChart/ApexRadialChart.js +2 -3
  7. package/dist/Components/AppearanceSettings/AppearanceSettings.js +9 -7
  8. package/dist/Components/Button/Button.styles.js +4 -10
  9. package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +9 -10
  10. package/dist/Components/Common/ErrorComponent.js +5 -8
  11. package/dist/Components/Common/ErrorMessage.js +2 -8
  12. package/dist/Components/Common/FormLabel.js +1 -3
  13. package/dist/Components/Common/FormattedDescription.js +3 -1
  14. package/dist/Components/Common/Label.js +3 -8
  15. package/dist/Components/Common/fieldStyles.js +6 -7
  16. package/dist/Components/ContactForm/ContactForm.js +1 -2
  17. package/dist/Components/CopyButton/CopyButton.js +3 -6
  18. package/dist/Components/CustomModulesTable/CustomModulesTable.js +7 -10
  19. package/dist/Components/CustomModulesTable/DeleteModuleModal.js +2 -2
  20. package/dist/Components/CustomModulesTable/EditModuleModal.js +2 -3
  21. package/dist/Components/DatePicker/CalendarPanel.js +2 -3
  22. package/dist/Components/DatePicker/RangeDatePicker.js +9 -9
  23. package/dist/Components/DatePicker/SingleDatePicker.js +11 -11
  24. package/dist/Components/DatePicker/TimeOnlyPicker.js +2 -2
  25. package/dist/Components/DatePicker/TimePicker.js +6 -7
  26. package/dist/Components/DatePicker/TimePickerInput.js +6 -7
  27. package/dist/Components/Divider/Divider.js +1 -2
  28. package/dist/Components/Drawer/Drawer.js +1 -2
  29. package/dist/Components/Dropdown/DropDown.js +22 -26
  30. package/dist/Components/Editor/Editor.js +10 -13
  31. package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -2
  32. package/dist/Components/EmptyState/EmptyState.js +11 -11
  33. package/dist/Components/FieldSelectModal/FieldSelectModal.js +1 -1
  34. package/dist/Components/FilePreview/FilePreview.js +2 -2
  35. package/dist/Components/FileUpload/FileUpload.js +18 -24
  36. package/dist/Components/FileUploader/FileUploader.js +5 -6
  37. package/dist/Components/FilterSidebar/FilterSidebar.js +156 -160
  38. package/dist/Components/Form/FormWrapper.js +1 -2
  39. package/dist/Components/Header/Header.js +6 -6
  40. package/dist/Components/Header/HeaderActions.d.ts +3 -1
  41. package/dist/Components/Header/HeaderActions.js +8 -4
  42. package/dist/Components/Header/components/desktopMenu.js +7 -20
  43. package/dist/Components/Header/components/mobileMenu.js +3 -15
  44. package/dist/Components/Input/Input/Input.js +13 -17
  45. package/dist/Components/Input/TextInput.styles.js +10 -13
  46. package/dist/Components/InputTextArea/InputTextArea.d.ts +1 -1
  47. package/dist/Components/InputTextArea/InputTextArea.style.js +10 -11
  48. package/dist/Components/KanbanBoard/AccountCard.js +10 -4
  49. package/dist/Components/KanbanBoard/AccountRow.js +1 -2
  50. package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
  51. package/dist/Components/KanbanBoard/KanbanBoard.js +21 -28
  52. package/dist/Components/LazyWrapper/LazyWrapper.js +1 -1
  53. package/dist/Components/LimitReachedModal/LimitReachedModal.js +3 -15
  54. package/dist/Components/Loading/Loading.js +1 -1
  55. package/dist/Components/Modal/Modal.js +3 -1
  56. package/dist/Components/MoreItems/MoreItems.js +3 -7
  57. package/dist/Components/MultiSelect/MultiSelect.js +5 -6
  58. package/dist/Components/NavigationBar/NavigationBar.d.ts +1 -1
  59. package/dist/Components/NavigationBar/NavigationBar.js +22 -18
  60. package/dist/Components/NavigationBar/NavigationBarProps.d.ts +5 -0
  61. package/dist/Components/NoteTextArea/NoteTextArea.js +4 -8
  62. package/dist/Components/Notification/Notification.js +17 -15
  63. package/dist/Components/NumberInput/NumberInput.styles.js +10 -11
  64. package/dist/Components/OrgSwitcher/OrgSwitcher.js +6 -7
  65. package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +2 -0
  66. package/dist/Components/OrgSwitcher/OrgSwitcherProps.js +6 -2
  67. package/dist/Components/OrganizationDetails/CreateOrgModal.js +1 -2
  68. package/dist/Components/OrganizationDetails/DeleteOrgModal.js +5 -2
  69. package/dist/Components/OrganizationDetails/OrganizationDetails.js +25 -22
  70. package/dist/Components/PdfViewer/PdfViewer.js +1 -1
  71. package/dist/Components/PinInputs/PinInputs.js +7 -14
  72. package/dist/Components/PlanPill/PlanPill.js +5 -8
  73. package/dist/Components/PlanPill/planPillGradient.d.ts +19 -0
  74. package/dist/Components/PlanPill/planPillGradient.js +30 -1
  75. package/dist/Components/ProductCard/ProductPrice.js +6 -6
  76. package/dist/Components/ProductCard/ProductReview.js +4 -1
  77. package/dist/Components/ProductCard/ProductTags.js +4 -4
  78. package/dist/Components/ProductDetails/ProductDetails.js +3 -1
  79. package/dist/Components/ProductDetails/ProductDtlPrice.js +3 -3
  80. package/dist/Components/ProfileCard/ProfileCard.js +4 -4
  81. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +19 -16
  82. package/dist/Components/Reorder/Reorder.js +3 -4
  83. package/dist/Components/RolesPermission/DeleteRoleModal.js +5 -4
  84. package/dist/Components/RolesPermission/RolesPermission.js +12 -14
  85. package/dist/Components/ScrollToTop/ScrollToTop.js +2 -3
  86. package/dist/Components/SearchSelect/SearchSelect.js +25 -28
  87. package/dist/Components/Select/Select.styles.js +33 -37
  88. package/dist/Components/SelectSearch/SelectSearch.js +8 -8
  89. package/dist/Components/SelectV2/SelectV2.js +14 -20
  90. package/dist/Components/SideBar/SecondaryBar.js +10 -15
  91. package/dist/Components/SideBar/SideBar.d.ts +1 -1
  92. package/dist/Components/SideBar/SideBar.js +41 -34
  93. package/dist/Components/SideBar/SideBarProps.d.ts +6 -0
  94. package/dist/Components/SideBar/components/MenuItemBox.js +10 -12
  95. package/dist/Components/SideBar/components/MenuItems.js +3 -1
  96. package/dist/Components/SideBar/components/MenuPopoverContent.js +7 -9
  97. package/dist/Components/SideBar/components/OtherApps.js +4 -4
  98. package/dist/Components/SideBar/sidebarAccentColors.d.ts +4 -17
  99. package/dist/Components/SideBar/sidebarAccentColors.js +6 -33
  100. package/dist/Components/SignInActivityTable/SignInActivityTable.js +6 -7
  101. package/dist/Components/Slider/Slider.js +2 -2
  102. package/dist/Components/StageProgress/StageProgressProps.js +9 -13
  103. package/dist/Components/Table/Table.js +10 -10
  104. package/dist/Components/Table/components/HeaderActions.js +6 -7
  105. package/dist/Components/Table/components/Pagination.js +1 -1
  106. package/dist/Components/Table/components/TableActions.js +4 -4
  107. package/dist/Components/Table/components/TableBody.js +18 -20
  108. package/dist/Components/Table/components/TableGroupRow.js +1 -2
  109. package/dist/Components/Table/components/TableHeader.js +8 -12
  110. package/dist/Components/Table/components/TableSearch.js +1 -2
  111. package/dist/Components/Table/components/tableRowHoverStyle.js +2 -3
  112. package/dist/Components/Table/filters/ActiveFilters.js +5 -8
  113. package/dist/Components/Table/filters/CompactSelect.js +4 -5
  114. package/dist/Components/Table/filters/LeftFilterPane.js +4 -5
  115. package/dist/Components/Table/filters/TableFilters.js +1 -2
  116. package/dist/Components/Table/hooks/useTable.js +8 -11
  117. package/dist/Components/Table/settings/ManageColumns.js +1 -1
  118. package/dist/Components/Table/settings/TableSettings.js +12 -14
  119. package/dist/Components/Tag/Tag.styles.js +8 -6
  120. package/dist/Components/Timeline/Timeline.js +32 -45
  121. package/dist/Components/Toaster/Toaster.js +43 -44
  122. package/dist/Components/ToolTip/ToolTip.js +1 -6
  123. package/dist/Components/Trail/EditableCell.js +4 -1
  124. package/dist/Components/Trail/TrailWorks.js +3 -3
  125. package/dist/Components/UpgradeButton/UpgradeButton.js +2 -4
  126. package/dist/Components/UserDetails/AddUserModal.js +3 -3
  127. package/dist/Components/UserDetails/ChangeRoleModal.js +2 -2
  128. package/dist/Components/UserDetails/DeactivateConfirmModal.js +5 -5
  129. package/dist/Components/UserDetails/UserDetails.js +14 -16
  130. package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +1 -2
  131. package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +3 -4
  132. package/dist/Theme/assertPalette.d.ts +11 -0
  133. package/dist/Theme/assertPalette.js +55 -0
  134. package/dist/Theme/chakra/Avatar.styles.d.ts +5 -5
  135. package/dist/Theme/chakra/Avatar.styles.js +2 -2
  136. package/dist/Theme/chakra/Drawer.styles.d.ts +5 -5
  137. package/dist/Theme/chakra/Drawer.styles.js +8 -10
  138. package/dist/Theme/chakra/Modal.styles.d.ts +5 -5
  139. package/dist/Theme/chakra/Modal.styles.js +8 -10
  140. package/dist/Theme/chakra/Popover.styles.d.ts +3 -3
  141. package/dist/Theme/chakra/Slider.styles.d.ts +1 -1
  142. package/dist/Theme/chakra/Slider.styles.js +7 -9
  143. package/dist/Theme/chakra/Tabs.styles.d.ts +2 -2
  144. package/dist/Theme/chakra/Tabs.styles.js +13 -18
  145. package/dist/Theme/chakra/componentStyles.d.ts +54 -21
  146. package/dist/Theme/chakra/componentStyles.js +52 -43
  147. package/dist/Theme/chakra/paletteFromTheme.d.ts +10 -0
  148. package/dist/Theme/chakra/paletteFromTheme.js +14 -0
  149. package/dist/Theme/provider/PixelizeThemeProvider.js +5 -0
  150. package/dist/Theme/testing/testPalette.d.ts +16 -0
  151. package/dist/Theme/testing/testPalette.js +24 -0
  152. package/dist/Theme/tokens/brands/emerald/palette.light.d.ts +2 -373
  153. package/dist/Theme/tokens/brands/emerald/palette.light.js +5 -7
  154. package/dist/Theme/tokens/brands/index.d.ts +3 -2
  155. package/dist/Theme/tokens/brands/index.js +29 -23
  156. package/dist/Theme/tokens/brands/lavender/palette.light.d.ts +2 -373
  157. package/dist/Theme/tokens/brands/lavender/palette.light.js +3 -110
  158. package/dist/Theme/tokens/brands/meadow/palette.light.d.ts +2 -373
  159. package/dist/Theme/tokens/brands/meadow/palette.light.js +5 -7
  160. package/dist/Theme/tokens/brands/neutrals.d.ts +8 -0
  161. package/dist/Theme/tokens/brands/neutrals.js +119 -0
  162. package/dist/Theme/tokens/brands/radiant/palette.light.d.ts +2 -373
  163. package/dist/Theme/tokens/brands/radiant/palette.light.js +5 -7
  164. package/dist/Theme/tokens/brands/rosewood/palette.light.d.ts +2 -373
  165. package/dist/Theme/tokens/brands/rosewood/palette.light.js +5 -7
  166. package/dist/Theme/tokens/brands/skyline/palette.light.d.ts +2 -373
  167. package/dist/Theme/tokens/brands/skyline/palette.light.js +5 -7
  168. package/dist/Theme/tokens/brands/slate/palette.light.d.ts +2 -373
  169. package/dist/Theme/tokens/brands/slate/palette.light.js +6 -8
  170. package/dist/Theme/tokens/brands/storefront/palette.light.d.ts +2 -373
  171. package/dist/Theme/tokens/brands/storefront/palette.light.js +5 -7
  172. package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +5 -3
  173. package/dist/Theme/tokens/brands/zinc/palette.dark.js +2 -1
  174. package/dist/Theme/tokens/brands/zinc/palette.light.d.ts +2 -373
  175. package/dist/Theme/tokens/builders/accentText.d.ts +2 -2
  176. package/dist/Theme/tokens/builders/accentText.js +8 -27
  177. package/dist/Theme/tokens/builders/brandInk.d.ts +11 -0
  178. package/dist/Theme/tokens/builders/brandInk.js +106 -0
  179. package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +2 -2
  180. package/dist/Theme/tokens/builders/buildDarkPalette.js +16 -8
  181. package/dist/Theme/tokens/builders/mutedText.d.ts +5 -0
  182. package/dist/Theme/tokens/builders/mutedText.js +9 -0
  183. package/dist/Theme/tokens/builders/outlineRung.d.ts +7 -6
  184. package/dist/Theme/tokens/builders/outlineRung.js +20 -18
  185. package/dist/Theme/tokens/builders/resolvedRungs.d.ts +7 -0
  186. package/dist/Theme/tokens/builders/resolvedRungs.js +25 -0
  187. package/dist/Theme/tokens/builders/semanticText.d.ts +10 -0
  188. package/dist/Theme/tokens/builders/semanticText.js +22 -0
  189. package/dist/Theme/tokens/builders/sidebarAccent.d.ts +9 -0
  190. package/dist/Theme/tokens/builders/sidebarAccent.js +29 -0
  191. package/dist/Theme/tokens/builders/statusTone.js +3 -4
  192. package/dist/Theme/tokens/builders/surfaceRungs.d.ts +5 -0
  193. package/dist/Theme/tokens/builders/surfaceRungs.js +39 -0
  194. package/dist/Theme/tokens/types.d.ts +41 -13
  195. package/dist/Theme/useCustomTheme.js +4 -1
  196. package/dist/Utils/table.d.ts +1 -7
  197. package/dist/Utils/table.js +27 -35
  198. package/dist/esm/Components/Accordion/Accordion.js +14 -16
  199. package/dist/esm/Components/Accordion/accordionColors.js +6 -9
  200. package/dist/esm/Components/AlertDialog/AlertDialog.js +1 -2
  201. package/dist/esm/Components/Apexcharts/ApexAreaChart/ApexAreaChart.js +2 -3
  202. package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +2 -3
  203. package/dist/esm/Components/Apexcharts/ApexRadialChart/ApexRadialChart.js +2 -3
  204. package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +9 -7
  205. package/dist/esm/Components/Button/Button.styles.js +4 -10
  206. package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +9 -10
  207. package/dist/esm/Components/Common/ErrorComponent.js +6 -9
  208. package/dist/esm/Components/Common/ErrorMessage.js +2 -8
  209. package/dist/esm/Components/Common/FormLabel.js +1 -3
  210. package/dist/esm/Components/Common/FormattedDescription.js +3 -1
  211. package/dist/esm/Components/Common/Label.js +3 -8
  212. package/dist/esm/Components/Common/fieldStyles.js +6 -7
  213. package/dist/esm/Components/ContactForm/ContactForm.js +1 -2
  214. package/dist/esm/Components/CopyButton/CopyButton.js +3 -6
  215. package/dist/esm/Components/CustomModulesTable/CustomModulesTable.js +7 -10
  216. package/dist/esm/Components/CustomModulesTable/DeleteModuleModal.js +2 -2
  217. package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +2 -3
  218. package/dist/esm/Components/DatePicker/CalendarPanel.js +2 -3
  219. package/dist/esm/Components/DatePicker/RangeDatePicker.js +9 -9
  220. package/dist/esm/Components/DatePicker/SingleDatePicker.js +11 -11
  221. package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +2 -2
  222. package/dist/esm/Components/DatePicker/TimePicker.js +6 -7
  223. package/dist/esm/Components/DatePicker/TimePickerInput.js +6 -7
  224. package/dist/esm/Components/Divider/Divider.js +1 -2
  225. package/dist/esm/Components/Drawer/Drawer.js +1 -2
  226. package/dist/esm/Components/Dropdown/DropDown.js +22 -26
  227. package/dist/esm/Components/Editor/Editor.js +11 -14
  228. package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -2
  229. package/dist/esm/Components/EmptyState/EmptyState.js +11 -11
  230. package/dist/esm/Components/FieldSelectModal/FieldSelectModal.js +1 -1
  231. package/dist/esm/Components/FilePreview/FilePreview.js +2 -2
  232. package/dist/esm/Components/FileUpload/FileUpload.js +18 -24
  233. package/dist/esm/Components/FileUploader/FileUploader.js +6 -7
  234. package/dist/esm/Components/FilterSidebar/FilterSidebar.js +157 -161
  235. package/dist/esm/Components/Form/FormWrapper.js +1 -2
  236. package/dist/esm/Components/Header/Header.js +6 -6
  237. package/dist/esm/Components/Header/HeaderActions.js +9 -5
  238. package/dist/esm/Components/Header/components/desktopMenu.js +8 -21
  239. package/dist/esm/Components/Header/components/mobileMenu.js +3 -15
  240. package/dist/esm/Components/Input/Input/Input.js +14 -18
  241. package/dist/esm/Components/Input/TextInput.styles.js +10 -13
  242. package/dist/esm/Components/InputTextArea/InputTextArea.style.js +10 -11
  243. package/dist/esm/Components/KanbanBoard/AccountCard.js +10 -4
  244. package/dist/esm/Components/KanbanBoard/AccountRow.js +1 -2
  245. package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
  246. package/dist/esm/Components/KanbanBoard/KanbanBoard.js +21 -28
  247. package/dist/esm/Components/LazyWrapper/LazyWrapper.js +1 -1
  248. package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +4 -16
  249. package/dist/esm/Components/Loading/Loading.js +1 -1
  250. package/dist/esm/Components/Modal/Modal.js +3 -1
  251. package/dist/esm/Components/MoreItems/MoreItems.js +3 -7
  252. package/dist/esm/Components/MultiSelect/MultiSelect.js +5 -6
  253. package/dist/esm/Components/NavigationBar/NavigationBar.js +23 -19
  254. package/dist/esm/Components/NoteTextArea/NoteTextArea.js +4 -8
  255. package/dist/esm/Components/Notification/Notification.js +18 -16
  256. package/dist/esm/Components/NumberInput/NumberInput.styles.js +10 -11
  257. package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +7 -8
  258. package/dist/esm/Components/OrgSwitcher/OrgSwitcherProps.js +5 -1
  259. package/dist/esm/Components/OrganizationDetails/CreateOrgModal.js +1 -2
  260. package/dist/esm/Components/OrganizationDetails/DeleteOrgModal.js +5 -2
  261. package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +25 -22
  262. package/dist/esm/Components/PdfViewer/PdfViewer.js +1 -1
  263. package/dist/esm/Components/PinInputs/PinInputs.js +8 -15
  264. package/dist/esm/Components/PlanPill/PlanPill.js +6 -9
  265. package/dist/esm/Components/PlanPill/planPillGradient.js +24 -0
  266. package/dist/esm/Components/ProductCard/ProductPrice.js +6 -6
  267. package/dist/esm/Components/ProductCard/ProductReview.js +4 -1
  268. package/dist/esm/Components/ProductCard/ProductTags.js +5 -5
  269. package/dist/esm/Components/ProductDetails/ProductDetails.js +3 -1
  270. package/dist/esm/Components/ProductDetails/ProductDtlPrice.js +3 -3
  271. package/dist/esm/Components/ProfileCard/ProfileCard.js +5 -5
  272. package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +20 -17
  273. package/dist/esm/Components/Reorder/Reorder.js +3 -4
  274. package/dist/esm/Components/RolesPermission/DeleteRoleModal.js +5 -4
  275. package/dist/esm/Components/RolesPermission/RolesPermission.js +12 -14
  276. package/dist/esm/Components/ScrollToTop/ScrollToTop.js +2 -3
  277. package/dist/esm/Components/SearchSelect/SearchSelect.js +25 -28
  278. package/dist/esm/Components/Select/Select.styles.js +33 -37
  279. package/dist/esm/Components/SelectSearch/SelectSearch.js +8 -8
  280. package/dist/esm/Components/SelectV2/SelectV2.js +14 -20
  281. package/dist/esm/Components/SideBar/SecondaryBar.js +11 -16
  282. package/dist/esm/Components/SideBar/SideBar.js +43 -36
  283. package/dist/esm/Components/SideBar/components/MenuItemBox.js +11 -13
  284. package/dist/esm/Components/SideBar/components/MenuItems.js +3 -1
  285. package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +8 -10
  286. package/dist/esm/Components/SideBar/components/OtherApps.js +4 -4
  287. package/dist/esm/Components/SideBar/sidebarAccentColors.js +5 -31
  288. package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +6 -7
  289. package/dist/esm/Components/Slider/Slider.js +2 -2
  290. package/dist/esm/Components/StageProgress/StageProgressProps.js +9 -13
  291. package/dist/esm/Components/Table/Table.js +10 -10
  292. package/dist/esm/Components/Table/components/HeaderActions.js +6 -7
  293. package/dist/esm/Components/Table/components/Pagination.js +1 -1
  294. package/dist/esm/Components/Table/components/TableActions.js +4 -4
  295. package/dist/esm/Components/Table/components/TableBody.js +18 -20
  296. package/dist/esm/Components/Table/components/TableGroupRow.js +1 -2
  297. package/dist/esm/Components/Table/components/TableHeader.js +8 -12
  298. package/dist/esm/Components/Table/components/TableSearch.js +1 -2
  299. package/dist/esm/Components/Table/components/tableRowHoverStyle.js +2 -3
  300. package/dist/esm/Components/Table/filters/ActiveFilters.js +5 -8
  301. package/dist/esm/Components/Table/filters/CompactSelect.js +4 -5
  302. package/dist/esm/Components/Table/filters/LeftFilterPane.js +4 -5
  303. package/dist/esm/Components/Table/filters/TableFilters.js +1 -2
  304. package/dist/esm/Components/Table/hooks/useTable.js +8 -11
  305. package/dist/esm/Components/Table/settings/ManageColumns.js +1 -1
  306. package/dist/esm/Components/Table/settings/TableSettings.js +12 -14
  307. package/dist/esm/Components/Tag/Tag.styles.js +9 -7
  308. package/dist/esm/Components/Timeline/Timeline.js +33 -46
  309. package/dist/esm/Components/Toaster/Toaster.js +44 -45
  310. package/dist/esm/Components/ToolTip/ToolTip.js +1 -6
  311. package/dist/esm/Components/Trail/EditableCell.js +4 -1
  312. package/dist/esm/Components/Trail/TrailWorks.js +4 -4
  313. package/dist/esm/Components/UpgradeButton/UpgradeButton.js +2 -4
  314. package/dist/esm/Components/UserDetails/AddUserModal.js +3 -3
  315. package/dist/esm/Components/UserDetails/ChangeRoleModal.js +2 -2
  316. package/dist/esm/Components/UserDetails/DeactivateConfirmModal.js +5 -5
  317. package/dist/esm/Components/UserDetails/UserDetails.js +15 -17
  318. package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +1 -2
  319. package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +3 -4
  320. package/dist/esm/Theme/assertPalette.js +50 -0
  321. package/dist/esm/Theme/chakra/Avatar.styles.js +2 -2
  322. package/dist/esm/Theme/chakra/Drawer.styles.js +8 -10
  323. package/dist/esm/Theme/chakra/Modal.styles.js +8 -10
  324. package/dist/esm/Theme/chakra/Slider.styles.js +7 -9
  325. package/dist/esm/Theme/chakra/Tabs.styles.js +13 -18
  326. package/dist/esm/Theme/chakra/componentStyles.js +53 -44
  327. package/dist/esm/Theme/chakra/paletteFromTheme.js +9 -0
  328. package/dist/esm/Theme/provider/PixelizeThemeProvider.js +5 -0
  329. package/dist/esm/Theme/testing/testPalette.js +19 -0
  330. package/dist/esm/Theme/tokens/brands/emerald/palette.light.js +5 -4
  331. package/dist/esm/Theme/tokens/brands/index.js +28 -23
  332. package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +3 -110
  333. package/dist/esm/Theme/tokens/brands/meadow/palette.light.js +5 -4
  334. package/dist/esm/Theme/tokens/brands/neutrals.js +116 -0
  335. package/dist/esm/Theme/tokens/brands/radiant/palette.light.js +5 -4
  336. package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +5 -4
  337. package/dist/esm/Theme/tokens/brands/skyline/palette.light.js +5 -4
  338. package/dist/esm/Theme/tokens/brands/slate/palette.light.js +6 -5
  339. package/dist/esm/Theme/tokens/brands/storefront/palette.light.js +5 -4
  340. package/dist/esm/Theme/tokens/brands/zinc/palette.dark.js +3 -2
  341. package/dist/esm/Theme/tokens/builders/accentText.js +8 -27
  342. package/dist/esm/Theme/tokens/builders/brandInk.js +103 -0
  343. package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +17 -9
  344. package/dist/esm/Theme/tokens/builders/mutedText.js +5 -0
  345. package/dist/esm/Theme/tokens/builders/outlineRung.js +21 -19
  346. package/dist/esm/Theme/tokens/builders/resolvedRungs.js +20 -0
  347. package/dist/esm/Theme/tokens/builders/semanticText.js +17 -0
  348. package/dist/esm/Theme/tokens/builders/sidebarAccent.js +23 -0
  349. package/dist/esm/Theme/tokens/builders/statusTone.js +3 -4
  350. package/dist/esm/Theme/tokens/builders/surfaceRungs.js +33 -0
  351. package/dist/esm/Theme/useCustomTheme.js +4 -1
  352. package/dist/esm/Utils/table.js +28 -36
  353. package/dist/esm/index.js +1 -0
  354. package/dist/index.d.ts +1 -0
  355. package/dist/index.js +9 -2
  356. package/package.json +1 -1
@@ -5,6 +5,6 @@ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
5
5
  import ToolTip from "../ToolTip/ToolTip.js";
6
6
  const PdfViewer = ({ pdfUrl, fileName = "Document.pdf", height = "480px", showToolbar = true, borderRadius = "xl", }) => {
7
7
  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.primary[500] }), _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" })] }));
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" })] }));
9
9
  };
10
10
  export default PdfViewer;
@@ -1,23 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef, useState } from "react";
3
- import { Box, HStack, Input, useTheme } from "@chakra-ui/react";
3
+ import { Box, HStack, Input } from "@chakra-ui/react";
4
4
  import Label from "../Common/Label.js";
5
5
  import ErrorComponent from "../Common/ErrorComponent.js";
6
+ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
7
  const PinInputs = ({ length = 3, label, error, onChange, onComplete, mask = false, placeholder = "*", }) => {
7
- var _a, _b, _c, _d, _e;
8
- const theme = useTheme();
9
- const { colors } = theme;
8
+ const { colors } = useCustomTheme();
10
9
  const [values, setValues] = useState(Array(length).fill(""));
11
10
  const inputsRef = useRef([]);
12
- // [800], not [500]: WCAG 1.4.11 needs >=3.0 for a control boundary against any named surface
13
- // up to `muted` (lightest); [500] fails there, [800] clears all with margin.
14
11
  const borderColor = error
15
- ? (_b = (_a = colors.semantic) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b[500]
16
- : (_c = colors.boxborder) === null || _c === void 0 ? void 0 : _c[800];
17
- const focusRing = error ? (_d = colors.boxShadow) === null || _d === void 0 ? void 0 : _d.error : (_e = colors.boxShadow) === null || _e === void 0 ? void 0 : _e.primary;
18
- const focusShadow = focusRing
19
- ? `0 0 0 0.125rem ${focusRing}`
20
- : undefined;
12
+ ? colors.semanticText.error
13
+ : colors.boxborder[500];
14
+ const focusRing = error ? colors.boxShadow.error : colors.boxShadow.primary;
15
+ const focusShadow = `0 0 0 0.125rem ${focusRing}`;
21
16
  const handleChange = (index, value) => {
22
17
  var _a;
23
18
  if (!/^[0-9]?$/.test(value))
@@ -41,8 +36,6 @@ const PinInputs = ({ length = 3, label, error, onChange, onComplete, mask = fals
41
36
  };
42
37
  return (_jsxs(Box, { children: [label && _jsx(Label, { label: label }), _jsx(HStack, { spacing: 2, children: Array.from({ length }).map((_, index) => (_jsx(Input, { ref: (el) => {
43
38
  inputsRef.current[index] = el;
44
- }, type: mask ? "password" : "text", inputMode: "numeric", maxLength: 1, placeholder: placeholder, value: values[index], onChange: (e) => handleChange(index, e.target.value), onKeyDown: (e) => handleKeyDown(e, index), w: 12, h: 12, textAlign: "center", fontSize: "lg", borderWidth: "1px", borderColor: borderColor, borderRadius: "md", _focus: focusShadow
45
- ? { boxShadow: focusShadow, outline: "none" }
46
- : { outline: "none" } }, index))) }), error && _jsx(ErrorComponent, { error: error })] }));
39
+ }, type: mask ? "password" : "text", inputMode: "numeric", maxLength: 1, placeholder: placeholder, value: values[index], onChange: (e) => handleChange(index, e.target.value), onKeyDown: (e) => handleKeyDown(e, index), w: 12, h: 12, textAlign: "center", fontSize: "lg", borderWidth: "1px", borderColor: borderColor, borderRadius: "md", _focus: { boxShadow: focusShadow, outline: "none" } }, index))) }), error && _jsx(ErrorComponent, { error: error })] }));
47
40
  };
48
41
  export default PinInputs;
@@ -3,7 +3,7 @@ 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
5
  import { onGradient } from "../../Theme/tokens/builders/accentText.js";
6
- import { ACCENT_GRADIENT } from "./planPillGradient.js";
6
+ import { chipBorder, chipFill, inkSafeGradient, statusGradient, } from "./planPillGradient.js";
7
7
  const TONE_ICON = {
8
8
  normal: Sparkles,
9
9
  warning: Clock,
@@ -13,15 +13,12 @@ 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: ACCENT_GRADIENT,
17
- warning: { from: c.semantic.warning[400], to: c.semantic.warning[600] },
18
- danger: { from: c.semantic.error[400], to: c.semantic.error[600] },
16
+ normal: inkSafeGradient(c.gradient),
17
+ warning: statusGradient(c.semantic.warning),
18
+ danger: statusGradient(c.semantic.error),
19
19
  };
20
- const resolved = gradient !== null && gradient !== void 0 ? gradient : toneGradient[tone];
20
+ const resolved = inkSafeGradient(gradient !== null && gradient !== void 0 ? gradient : toneGradient[tone]);
21
21
  const ink = onGradient(resolved.from, resolved.to, c.white, c.black);
22
- // The chip is a translucent inset of the pill itself, so it tints with whichever
23
- // ink won — a white wash under black text would wash the chip out entirely.
24
- const onDark = ink === c.white;
25
22
  const Icon = icon === undefined ? TONE_ICON[tone] : icon;
26
23
  const hasMobile = !!mobileLabel && mobileLabel !== label;
27
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: {
@@ -35,6 +32,6 @@ const PlanPill = ({ label, mobileLabel, status, tone = "normal", icon, gradient,
35
32
  transition: "none",
36
33
  _hover: { transform: "none" },
37
34
  },
38
- }, children: [Icon ? _jsx(Icon, { size: 12, strokeWidth: 2.5, "aria-hidden": true }) : null, _jsx(Text, { as: "span", fontSize: "12.5px", fontWeight: "600", lineHeight: "18px", overflow: "hidden", textOverflow: "ellipsis", maxW: maxLabelWidth, display: hasMobile ? { base: "none", md: "block" } : "block", children: label }), hasMobile ? (_jsx(Text, { as: "span", fontSize: "12.5px", fontWeight: "600", lineHeight: "18px", display: { base: "block", md: "none" }, children: mobileLabel })) : null, status ? (_jsx(Flex, { as: "span", align: "center", px: "8px", borderRadius: "full", bg: onDark ? "rgba(255,255,255,0.22)" : "rgba(0,0,0,0.12)", border: "1px solid", borderColor: onDark ? "rgba(255,255,255,0.28)" : "rgba(0,0,0,0.08)", fontSize: "11px", fontWeight: "700", lineHeight: "18px", sx: { fontVariantNumeric: "tabular-nums" }, children: status })) : null] }));
35
+ }, children: [Icon ? _jsx(Icon, { size: 12, strokeWidth: 2.5, "aria-hidden": true }) : null, _jsx(Text, { as: "span", fontSize: "12.5px", fontWeight: "600", lineHeight: "18px", overflow: "hidden", textOverflow: "ellipsis", maxW: maxLabelWidth, display: hasMobile ? { base: "none", md: "block" } : "block", children: label }), hasMobile ? (_jsx(Text, { as: "span", fontSize: "12.5px", fontWeight: "600", lineHeight: "18px", display: { base: "block", md: "none" }, children: mobileLabel })) : null, status ? (_jsx(Flex, { as: "span", align: "center", px: "8px", borderRadius: "full", bg: chipFill(resolved), border: "1px solid", borderColor: chipBorder(resolved), fontSize: "11px", fontWeight: "700", lineHeight: "18px", sx: { fontVariantNumeric: "tabular-nums" }, children: status })) : null] }));
39
36
  };
40
37
  export default PlanPill;
@@ -1,3 +1,6 @@
1
+ import { resolveAvatarFill } from "../../Theme/tokens/builders/statusTone.js";
2
+ import { relativeLuminance } from "../../Theme/tokens/builders/color.js";
3
+ export const STATUS_INK = "#ffffff";
1
4
  /**
2
5
  * The plan badge's `normal` tone is a single fixed accent — not brand-driven, and
3
6
  * not mode-dependent.
@@ -15,3 +18,24 @@
15
18
  * Consumers who genuinely want another colour still pass `gradient`.
16
19
  */
17
20
  export const ACCENT_GRADIENT = { from: "#8B3FC8", to: "#df187a" };
21
+ /**
22
+ * Sinks both stops until WHITE ink clears AA, keeping each stop's hue. Any mid-tone gradient —
23
+ * a brand `gradient` token, a status scale — otherwise flips `onGradient` to black ink, so the
24
+ * same badge reads white-on-colour in one brand and black-on-pastel in the next.
25
+ */
26
+ export const inkSafeGradient = (gradient) => ({
27
+ from: resolveAvatarFill(gradient.from),
28
+ to: resolveAvatarFill(gradient.to),
29
+ });
30
+ /** Status tones are semantic scales, not designed as label backdrops. */
31
+ export const statusGradient = (scale) => inkSafeGradient({ from: scale[400], to: scale[600] });
32
+ const CHIP_INK_CONTRAST = 7;
33
+ export const darkerStop = (g) => relativeLuminance(g.from) <= relativeLuminance(g.to) ? g.from : g.to;
34
+ /**
35
+ * Solid inset chip in the pill's own hue. A translucent scrim was a guessed alpha that
36
+ * composited into a muddy dark lozenge on every mid-tone gradient; a derived rung reads as
37
+ * one step down from the pill in every brand and both modes.
38
+ */
39
+ export const chipFill = (g) => resolveAvatarFill(darkerStop(g), CHIP_INK_CONTRAST);
40
+ /** The pill's lighter stop — guaranteed lighter than `chipFill`, so it draws the inset edge. */
41
+ export const chipBorder = (g) => relativeLuminance(g.from) > relativeLuminance(g.to) ? g.from : g.to;
@@ -91,20 +91,20 @@ const ProductPrice = ({ options, size, onSelect, rightSlot }) => {
91
91
  useEffect(() => {
92
92
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(selected);
93
93
  }, [selected, onSelect]);
94
- return (_jsxs(_Fragment, { children: [isSingleOption ? (_jsx(Box, { border: "0.063rem solid", borderColor: "red.300", bg: "red.50", px: cfg.px,
94
+ return (_jsxs(_Fragment, { children: [isSingleOption ? (_jsx(Box, { border: "0.063rem solid", borderColor: theme.colors.red[300], bg: theme.colors.red[50], px: cfg.px,
95
95
  // py={cfg.py}
96
- rounded: "md", display: "inline-block", w: "100%", children: _jsx(Text, { fontSize: cfg.label, fontWeight: "medium", children: options[0].label }) })) : (_jsxs(Box, { ref: buttonRef, onClick: () => setIsOpen(!isOpen), border: "0.063rem solid", borderColor: "red.300", bg: "red.50", px: cfg.px,
96
+ rounded: "md", display: "inline-block", w: "100%", children: _jsx(Text, { fontSize: cfg.label, fontWeight: "medium", children: options[0].label }) })) : (_jsxs(Box, { ref: buttonRef, onClick: () => setIsOpen(!isOpen), border: "0.063rem solid", borderColor: theme.colors.red[300], bg: theme.colors.red[50], px: cfg.px,
97
97
  // py={cfg.py}
98
- rounded: "md", cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", w: "100%", children: [_jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: cfg.label, fontWeight: "medium", whiteSpace: "nowrap", children: selected.label }) }), _jsx(Text, { fontSize: cfg.font, color: accentTextOnCanvas(theme.colors.red, theme.colors.red[50]), transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)', transition: "transform 0.2s", children: "\u25BE" })] })), !isSingleOption && isOpen && (_jsx(Portal, { children: _jsx(Box, { ref: dropdownRef, position: "fixed", top: `${dropdownPosition.top}px`, left: `${dropdownPosition.left}px`, width: `${dropdownPosition.width}px`, bg: theme.colors.background[50], border: "0.063rem solid", borderColor: "red.300", borderRadius: "md", overflow: "hidden", maxH: "13rem", overflowY: "auto", shadow: "md", zIndex: 100000, children: options.map((option) => {
98
+ rounded: "md", cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", w: "100%", children: [_jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: cfg.label, fontWeight: "medium", whiteSpace: "nowrap", children: selected.label }) }), _jsx(Text, { fontSize: cfg.font, color: accentTextOnCanvas(theme.colors.red, theme.colors.red[50]), transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)', transition: "transform 0.2s", children: "\u25BE" })] })), !isSingleOption && isOpen && (_jsx(Portal, { children: _jsx(Box, { ref: dropdownRef, position: "fixed", top: `${dropdownPosition.top}px`, left: `${dropdownPosition.left}px`, width: `${dropdownPosition.width}px`, bg: theme.colors.background[50], border: "0.063rem solid", borderColor: theme.colors.red[300], borderRadius: "md", overflow: "hidden", maxH: "13rem", overflowY: "auto", shadow: "md", zIndex: 100000, children: options.map((option) => {
99
99
  const discounted = getDiscountedPrice(option);
100
100
  const isSelected = selected.var_id === option.var_id;
101
- return (_jsxs(Grid, { px: 1, py: 0.5, cursor: "pointer", bg: isSelected ? 'red.50' : theme.colors.background[50], borderLeft: isSelected ? '0.25rem solid' : '0.25rem solid transparent', borderLeftColor: isSelected ? 'red.300' : 'transparent', _hover: { bg: 'red.100' }, onClick: () => {
101
+ return (_jsxs(Grid, { px: 1, py: 0.5, cursor: "pointer", bg: isSelected ? theme.colors.red[50] : theme.colors.background[50], borderLeft: isSelected ? '0.25rem solid' : '0.25rem solid transparent', borderLeftColor: isSelected ? theme.colors.red[300] : "transparent", _hover: { bg: theme.colors.red[100] }, onClick: () => {
102
102
  setSelected(option);
103
103
  setIsOpen(false);
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: "green.100", color: "green.700", 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: "gray.500", 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 ? 'red.500' : 'gray.600', 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: "red.500", borderRadius: "full" })) })] }, option.var_id));
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: "gray.500", 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 }))] })] }));
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));
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;
@@ -1,6 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Flex, Text, Icon } from '@chakra-ui/react';
3
3
  import { BookCheck, Star } from 'lucide-react';
4
+ import { useCustomTheme } from '../../Theme/useCustomTheme.js';
5
+ import { accentTextOnCanvas } from '../../Theme/tokens/builders/accentText.js';
4
6
  // The theme's `yellow` scale reverses index roles in dark mode (like every utility hue), so
5
7
  // pulling it through the theme would silently flip this decorative "filled star" from gold to
6
8
  // pale. A rating star is a universal, brand-independent gold — not something that should follow
@@ -8,12 +10,13 @@ import { BookCheck, Star } from 'lucide-react';
8
10
  // "rating gold") to pixelize-design-library if this pattern is needed elsewhere.
9
11
  const RATING_STAR_FILL = "#ECC94B";
10
12
  const ProductReview = ({ rating, reviewCount, mb = 0 }) => {
13
+ const { colors } = useCustomTheme();
11
14
  const hasRating = rating !== undefined && rating !== null;
12
15
  const hasReviewCount = reviewCount !== undefined && reviewCount !== null;
13
16
  // Convert rating to number and ensure it's between 0 and 5
14
17
  // Calculate fill percentage: (rating / 5) * 100%
15
18
  const numericRating = hasRating ? Math.min(Math.max(Number(rating), 0), 5) : 0;
16
19
  const fillPercentage = (numericRating / 6) * 100;
17
- return (_jsxs(Flex, { align: "center", gap: 2, mb: mb, children: [hasRating && (_jsxs(Flex, { align: "center", gap: 1, bg: "teal.50", color: "teal.900", 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: "gray.400" }), hasReviewCount && (_jsxs(Flex, { align: "center", gap: "1", children: [_jsx(Icon, { as: BookCheck, boxSize: 3.5 }), _jsxs(Text, { fontSize: "sm", color: "gray.600", children: ["(", reviewCount, ")"] })] }))] }));
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, ")"] })] }))] }));
18
21
  };
19
22
  export default ProductReview;
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { Box, Flex, useTheme } from '@chakra-ui/react';
3
+ import { Box, Flex } from '@chakra-ui/react';
4
4
  import ToolTip from '../ToolTip/ToolTip.js';
5
+ import { useCustomTheme } from '../../Theme/useCustomTheme.js';
5
6
  const ProductTags = ({ tags, className, size = 'sm' }) => {
6
7
  const getRows = (tags) => {
7
8
  const count = tags.length;
@@ -18,10 +19,9 @@ const ProductTags = ({ tags, className, size = 'sm' }) => {
18
19
  return (_jsx(Flex, { direction: "column", gap: "1", className: className, w: "full", children: getRows(tags).map((row, rowIndex) => (_jsx(Flex, { gap: "1", children: row.map((tag, tagIndex) => (_jsx(Tag, { fullWidth: row.length === 1, size: size, children: tag }, tagIndex))) }, rowIndex))) }));
19
20
  };
20
21
  const Tag = ({ children, fullWidth = false, size = 'sm', }) => {
21
- var _a, _b, _c, _d;
22
- const theme = useTheme();
23
- const tagBorder = (_c = (_b = (_a = theme.colors.semantic) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b[200]) !== null && _c !== void 0 ? _c : (_d = theme.colors.red) === null || _d === void 0 ? void 0 : _d[200];
24
- const tagText = theme.colors.text[900];
22
+ const { colors } = useCustomTheme();
23
+ const tagBorder = colors.semanticText.error;
24
+ const tagText = colors.text[900];
25
25
  // Size map for tags
26
26
  const tagSizes = {
27
27
  xs: { fontSize: '0.625rem', px: '0.5rem', py: '0.125rem' },
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { Box, Flex, Text, HStack, IconButton, useBreakpointValue } from "@chakra-ui/react";
4
+ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
4
5
  import ProductImageSlider from "./ProductImageSlider.js";
5
6
  import ProductLabel from "../ProductCard/ProductLabel.js";
6
7
  import ProductTags from "../ProductCard/ProductTags.js";
@@ -11,6 +12,7 @@ import ProductReview from "../ProductCard/ProductReview.js";
11
12
  import FormattedDescription from "../Common/FormattedDescription.js";
12
13
  const ProductDetails = ({ id, price, label, shortdesc, tags, images, batch, onAddToCart, onNotifyMe, onOptionChange, addToCart, goToCart, OnGoToCart, rating, reviews, notifyMe, isQtyEditable = false, displayRating = true, }) => {
13
14
  var _a, _b, _c, _d, _e;
15
+ const { colors } = useCustomTheme();
14
16
  const isMobile = useBreakpointValue({ base: true, md: false });
15
17
  const [selectedOption, setSelectedOption] = React.useState(price === null || price === void 0 ? void 0 : price[0]);
16
18
  const [qty, setQty] = React.useState(1);
@@ -29,7 +31,7 @@ const ProductDetails = ({ id, price, label, shortdesc, tags, images, batch, onAd
29
31
  const handleDecrement = () => {
30
32
  setQty((prev) => (prev > 1 ? prev - 1 : 1));
31
33
  };
32
- return (_jsxs(Flex, { direction: ["column", "row"], maxW: "6xl", mx: "auto", align: "start", gap: 5, children: [_jsx(Box, { position: "relative", color: "white", borderRadius: "md", flex: "1", minH: isMobile ? undefined : "31.25rem", children: _jsx(ProductImageSlider, { images: images, thumbHeight: isMobile ? 48 : 80, imageSize: isMobile ? 360 : 480, thumbnailsToShow: isMobile ? 4 : 6, batch: batch }) }), _jsxs(Box, { flex: "1", children: [label && _jsx(ProductLabel, { label: label, size: "sm" }), shortdesc && _jsx(Box, { my: 3, children: _jsx(FormattedDescription, { content: shortdesc }) }), ((rating !== undefined && rating !== null) || (reviews !== undefined && reviews !== null)) && displayRating && (_jsx(ProductReview, { rating: rating, reviewCount: reviews, mb: 3 })), tags && _jsx(ProductTags, { tags: tags, size: "sm" }), price && (_jsx(ProductDtlPrice, { price: price, onSelect: (option) => {
34
+ return (_jsxs(Flex, { direction: ["column", "row"], maxW: "6xl", mx: "auto", align: "start", gap: 5, children: [_jsx(Box, { position: "relative", color: colors.text[500], borderRadius: "md", flex: "1", minH: isMobile ? undefined : "31.25rem", children: _jsx(ProductImageSlider, { images: images, thumbHeight: isMobile ? 48 : 80, imageSize: isMobile ? 360 : 480, thumbnailsToShow: isMobile ? 4 : 6, batch: batch }) }), _jsxs(Box, { flex: "1", children: [label && _jsx(ProductLabel, { label: label, size: "sm" }), shortdesc && _jsx(Box, { my: 3, children: _jsx(FormattedDescription, { content: shortdesc }) }), ((rating !== undefined && rating !== null) || (reviews !== undefined && reviews !== null)) && displayRating && (_jsx(ProductReview, { rating: rating, reviewCount: reviews, mb: 3 })), tags && _jsx(ProductTags, { tags: tags, size: "sm" }), price && (_jsx(ProductDtlPrice, { price: price, onSelect: (option) => {
33
35
  setSelectedOption(option);
34
36
  onOptionChange === null || onOptionChange === void 0 ? void 0 : onOptionChange(option);
35
37
  } })), typeof (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) === "number" && ((_a = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _a !== void 0 ? _a : 0) <= 0 && (_jsx(Box, { sx: { ml: "1.1rem", mt: "0.5rem", mb: "0.5rem" }, children: _jsx(Button, { colorScheme: "gray", size: "sm",
@@ -11,12 +11,12 @@ const ProductDtlPrice = ({ price, onSelect }) => {
11
11
  useEffect(() => {
12
12
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(selected);
13
13
  }, [selected, onSelect]);
14
- return (_jsxs(VStack, { align: "start", spacing: 3, p: 4, borderRadius: "md", w: "full", children: [_jsxs(HStack, { spacing: 2, align: "center", children: [selected.offer > 0 && (_jsxs(Text, { fontSize: "lg", color: theme.colors.gray[500], as: "s", children: ["\u20B9", selected.price] })), _jsxs(Text, { fontSize: "xl", color: accentTextOnCanvas(theme.colors.red, theme.colors.backgroundColor.main), fontWeight: "bold", children: ["\u20B9", discounted] }), selected.offer > 0 && (_jsxs(Badge, { colorScheme: "pink", fontSize: "xs", borderRadius: "sm", px: 2, py: 0.5, children: ["SAVE ", selected.offer, "%"] }))] }), _jsx(Text, { fontSize: "sm", color: theme.colors.gray[600], children: "(Incl. of all taxes)" }), _jsxs(Box, { children: [_jsxs(Text, { fontSize: "sm", fontWeight: "bold", textTransform: "uppercase", mb: 1, children: ["Packs : ", selected.label] }), _jsx(HStack, { spacing: 2, children: price.map((pack, idx) => (_jsx(Button, { size: "xs", variant: "outline", borderColor: idx === selectedIndex ? "orange.400" : "orange.200", bg: idx === selectedIndex ? "orange.50" : theme.colors.background[50],
14
+ return (_jsxs(VStack, { align: "start", spacing: 3, p: 4, borderRadius: "md", w: "full", children: [_jsxs(HStack, { spacing: 2, align: "center", children: [selected.offer > 0 && (_jsxs(Text, { fontSize: "lg", color: theme.colors.textMuted, as: "s", children: ["\u20B9", selected.price] })), _jsxs(Text, { fontSize: "xl", color: accentTextOnCanvas(theme.colors.red, theme.colors.backgroundColor.main), fontWeight: "bold", children: ["\u20B9", discounted] }), selected.offer > 0 && (_jsxs(Badge, { colorScheme: "pink", fontSize: "xs", borderRadius: "sm", px: 2, py: 0.5, children: ["SAVE ", selected.offer, "%"] }))] }), _jsx(Text, { fontSize: "sm", color: theme.colors.textMuted, children: "(Incl. of all taxes)" }), _jsxs(Box, { children: [_jsxs(Text, { fontSize: "sm", fontWeight: "bold", textTransform: "uppercase", mb: 1, children: ["Packs : ", selected.label] }), _jsx(HStack, { spacing: 2, children: price.map((pack, idx) => (_jsx(Button, { size: "xs", variant: "outline", borderColor: idx === selectedIndex ? theme.colors.orange[400] : theme.colors.orange[200], bg: idx === selectedIndex ? theme.colors.orange[50] : theme.colors.background[50],
15
15
  // orange.600 fails AA against both possible bg states — walk the scale per canvas
16
16
  color: accentTextOnCanvas(theme.colors.orange, idx === selectedIndex ? theme.colors.orange[50] : theme.colors.background[50]), borderRadius: "md", fontWeight: "medium", _hover: {
17
- bg: "orange.100",
17
+ bg: theme.colors.orange[100],
18
18
  }, _active: {
19
- bg: "orange.100",
19
+ bg: theme.colors.orange[100],
20
20
  }, onClick: () => setSelectedIndex(idx), children: pack.label }, pack.var_id))) })] })] }));
21
21
  };
22
22
  export default ProductDtlPrice;
@@ -1,6 +1,7 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
- import { Card as ChakraCard, CardBody, CardFooter, CardHeader, Divider, useTheme, } from "@chakra-ui/react";
3
+ import { Card as ChakraCard, CardBody, CardFooter, CardHeader, Divider, } from "@chakra-ui/react";
4
+ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
4
5
  export const ProfileCardHeader = ({ children, }) => {
5
6
  return _jsx(_Fragment, { children: children });
6
7
  };
@@ -11,10 +12,9 @@ export const ProfileCardFooter = ({ children, }) => {
11
12
  return _jsx(_Fragment, { children: children });
12
13
  };
13
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, }) {
14
- var _a, _b, _c, _d;
15
- const theme = useTheme();
16
- const resolvedDividerColor = (_b = dividercolor !== null && dividercolor !== void 0 ? dividercolor : (_a = theme.colors.border) === null || _a === void 0 ? void 0 : _a[400]) !== null && _b !== void 0 ? _b : (_c = theme.colors.gray) === null || _c === void 0 ? void 0 : _c[300];
17
- const accentBorder = `2px solid ${(_d = theme.colors.primary) === null || _d === void 0 ? void 0 : _d[500]}`;
15
+ const { colors } = useCustomTheme();
16
+ const resolvedDividerColor = dividercolor !== null && dividercolor !== void 0 ? dividercolor : colors.border[400];
17
+ const accentBorder = `2px solid ${colors.primary[500]}`;
18
18
  const isReactElement = (child) => {
19
19
  return child !== null && typeof child === "object" && "type" in child;
20
20
  };
@@ -3,13 +3,13 @@ import { useRef, useState } from "react";
3
3
  import { Box, Image, IconButton, Input, Text, Tooltip, HStack, } from "@chakra-ui/react";
4
4
  import { Eye, FileText, SquarePen, User } from "lucide-react";
5
5
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
- import { DEFAULT_WHITE } from "../../Theme/tokens/builders/accentText.js";
6
+ import { accentTextOnCanvas, onFilled } from "../../Theme/tokens/builders/accentText.js";
7
7
  export default function ProfilePhotoViewer({ photoUrl, onPhotoChange, imageWidth = "100px", imageAlt = "Profile Photo", imageObjectFit = "cover", imageBorderRadius = "full", editIconSize = "sm", editIconPositionRight = "0px", editIconPositionBottom = "0px", isRound = true, boxStyle, isEditable = false, isView = false, style, handleIsView, fallbackText, revealOnHover = true, }) {
8
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
8
+ var _a, _b, _c, _d, _e;
9
9
  const [photo, setPhoto] = useState(photoUrl);
10
10
  const fileInputRef = useRef(null);
11
11
  const theme = useCustomTheme();
12
- const c = (_a = theme.colors) !== null && _a !== void 0 ? _a : {};
12
+ const c = theme.colors;
13
13
  const handlePhotoChange = (event) => {
14
14
  var _a;
15
15
  if (!isEditable)
@@ -35,37 +35,40 @@ 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 = (_b = c.boxborder) === null || _b === void 0 ? void 0 : _b[800]) !== null && _c !== void 0 ? _c : (_d = c.gray) === null || _d === void 0 ? void 0 : _d[200];
38
+ const border = c.boxborder[800];
39
39
  // Shared modern frame for whichever media we render (photo / pdf / fallback).
40
40
  const mediaFrame = {
41
41
  boxSize: imageWidth,
42
42
  borderRadius: imageBorderRadius,
43
43
  border: `0.063rem solid ${border}`,
44
- boxShadow: (_e = theme.shadows) === null || _e === void 0 ? void 0 : _e.sm,
44
+ boxShadow: (_a = theme.shadows) === null || _a === void 0 ? void 0 : _a.sm,
45
45
  };
46
46
  const renderMedia = () => {
47
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48
47
  if (photo) {
49
- return isPdf ? (_jsx(Box, { ...mediaFrame, bg: (_b = (_a = c.gray) === null || _a === void 0 ? void 0 : _a[100]) !== null && _b !== void 0 ? _b : "gray.100", color: (_c = c.gray) === null || _c === void 0 ? void 0 : _c[500], display: "flex", alignItems: "center", justifyContent: "center", overflow: "hidden", children: _jsx(FileText, { size: "45%" }) })) : (_jsx(Image, { src: photo, alt: imageAlt, objectFit: imageObjectFit, ...mediaFrame }));
48
+ return isPdf ? (_jsx(Box, { ...mediaFrame, bg: c.gray[100], color: accentTextOnCanvas(c.gray, c.gray[100]), display: "flex", alignItems: "center", justifyContent: "center", overflow: "hidden", children: _jsx(FileText, { size: "45%" }) })) : (_jsx(Image, { src: photo, alt: imageAlt, objectFit: imageObjectFit, ...mediaFrame }));
50
49
  }
51
50
  // Fallback: branded tinted avatar (initials or user glyph).
52
- return (_jsx(Box, { ...mediaFrame, display: "flex", alignItems: "center", justifyContent: "center", bg: (_f = (_e = (_d = c.primary) === null || _d === void 0 ? void 0 : _d.opacity) === null || _e === void 0 ? void 0 : _e[16]) !== null && _f !== void 0 ? _f : (_g = c.gray) === null || _g === void 0 ? void 0 : _g[100], color: (_j = (_h = c.primary) === null || _h === void 0 ? void 0 : _h[600]) !== null && _j !== void 0 ? _j : (_k = c.gray) === null || _k === void 0 ? void 0 : _k[500], children: fallbackText ? (_jsx(Text, { fontSize: "1.75rem", fontWeight: 700, lineHeight: "1", children: fallbackText })) : (_jsx(User, { size: "48%" })) }));
51
+ return (_jsx(Box, { ...mediaFrame, display: "flex", alignItems: "center", justifyContent: "center", bg: c.primary.opacity[16], color: accentTextOnCanvas(c.primary, c.backgroundColor.main), children: fallbackText ? (_jsx(Text, { fontSize: "1.75rem", fontWeight: 700, lineHeight: "1", children: fallbackText })) : (_jsx(User, { size: "48%" })) }));
53
52
  };
54
53
  const hasActions = isEditable || isView;
55
54
  return (_jsxs(Box, { position: "relative", display: "inline-block", style: boxStyle, borderRadius: imageBorderRadius, transition: "box-shadow 0.2s ease", sx: {
56
55
  "&:hover .ppv-overlay": { opacity: 1 },
57
56
  "&:hover .ppv-actions": { opacity: 1 },
58
57
  "&:hover .ppv-media": {
59
- boxShadow: `0 0 0 0.1875rem ${(_h = (_g = (_f = c.primary) === null || _f === void 0 ? void 0 : _f.opacity) === null || _g === void 0 ? void 0 : _g[24]) !== null && _h !== void 0 ? _h : "transparent"}`,
58
+ boxShadow: `0 0 0 0.1875rem ${c.primary.opacity[24]}`,
60
59
  },
61
- }, children: [_jsx(Box, { className: "ppv-media", borderRadius: imageBorderRadius, transition: "box-shadow 0.2s ease", children: renderMedia() }), hasActions && (_jsxs(_Fragment, { children: [_jsx(Box, { className: "ppv-overlay", position: "absolute", inset: 0, borderRadius: imageBorderRadius, bg: "blackAlpha.300", opacity: 0, transition: "opacity 0.2s ease", pointerEvents: "none" }), _jsxs(HStack, { className: "ppv-actions", position: "absolute", right: editIconPositionRight, bottom: editIconPositionBottom, transform: "translate(-15%, -15%)", spacing: 1.5, opacity: revealOnHover ? 0 : 1, transition: "opacity 0.2s ease", children: [isEditable && (_jsx(Tooltip, { label: "Edit", "aria-label": "Edit", hasArrow: true, children: _jsx(IconButton, { icon: _jsx(SquarePen, { size: 14 }), isRound: isRound, size: editIconSize, onClick: handleClick, "aria-label": "Edit photo", bg: (_j = c.primary) === null || _j === void 0 ? void 0 : _j[500], color: (_k = c.white) !== null && _k !== void 0 ? _k : DEFAULT_WHITE, border: `0.125rem solid ${(_l = c.white) !== null && _l !== void 0 ? _l : DEFAULT_WHITE}`, boxShadow: (_m = theme.shadows) === null || _m === void 0 ? void 0 : _m.md, style: style, transition: "transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease", _hover: {
62
- bg: (_o = c.primary) === null || _o === void 0 ? void 0 : _o[600],
60
+ }, children: [_jsx(Box, { className: "ppv-media", borderRadius: imageBorderRadius, transition: "box-shadow 0.2s ease", children: renderMedia() }), hasActions && (_jsxs(_Fragment, { children: [_jsx(Box, { className: "ppv-overlay", position: "absolute", inset: 0, borderRadius: imageBorderRadius, bg: "blackAlpha.300", opacity: 0, transition: "opacity 0.2s ease", pointerEvents: "none" }), _jsxs(HStack, { className: "ppv-actions", position: "absolute", right: editIconPositionRight, bottom: editIconPositionBottom, transform: "translate(-15%, -15%)", spacing: 1.5, opacity: revealOnHover ? 0 : 1, transition: "opacity 0.2s ease", children: [isEditable && (_jsx(Tooltip, { label: "Edit", "aria-label": "Edit", hasArrow: true, children: _jsx(IconButton, { icon: _jsx(SquarePen, { size: 14 }), isRound: isRound, size: editIconSize, onClick: handleClick, "aria-label": "Edit photo", bg: c.primary[500], color: onFilled(c.primary[500], c.white, c.black), border: `0.125rem solid ${c.background[50]}`, boxShadow: (_b = theme.shadows) === null || _b === void 0 ? void 0 : _b.md, style: style, transition: "transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease", _hover: {
61
+ bg: c.primary[600],
62
+ color: onFilled(c.primary[600], c.white, c.black),
63
63
  transform: "scale(1.1)",
64
- boxShadow: (_p = theme.shadows) === null || _p === void 0 ? void 0 : _p.lg,
65
- }, _active: { bg: (_q = c.primary) === null || _q === void 0 ? void 0 : _q[700] } }) })), isView && (_jsx(Tooltip, { label: "View", "aria-label": "View", hasArrow: true, children: _jsx(IconButton, { icon: _jsx(Eye, { size: 14 }), isRound: isRound, size: editIconSize, onClick: handleIsView, "aria-label": "View photo", bg: (_s = (_r = c.background) === null || _r === void 0 ? void 0 : _r[50]) !== null && _s !== void 0 ? _s : DEFAULT_WHITE, color: (_t = c.gray) === null || _t === void 0 ? void 0 : _t[700], border: `0.063rem solid ${border}`, boxShadow: (_u = theme.shadows) === null || _u === void 0 ? void 0 : _u.md, style: style, transition: "transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease", _hover: {
66
- bg: (_v = c.gray) === null || _v === void 0 ? void 0 : _v[50],
67
- color: (_w = c.primary) === null || _w === void 0 ? void 0 : _w[600],
64
+ boxShadow: (_c = theme.shadows) === null || _c === void 0 ? void 0 : _c.lg,
65
+ }, _active: {
66
+ bg: c.primary[700],
67
+ color: onFilled(c.primary[700], c.white, c.black),
68
+ } }) })), isView && (_jsx(Tooltip, { label: "View", "aria-label": "View", hasArrow: true, children: _jsx(IconButton, { icon: _jsx(Eye, { size: 14 }), isRound: isRound, size: editIconSize, onClick: handleIsView, "aria-label": "View photo", bg: c.background[50], color: c.text[700], border: `0.063rem solid ${border}`, boxShadow: (_d = theme.shadows) === null || _d === void 0 ? void 0 : _d.md, style: style, transition: "transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease", _hover: {
69
+ bg: c.gray[50],
70
+ color: accentTextOnCanvas(c.primary, c.gray[50]),
68
71
  transform: "scale(1.1)",
69
- boxShadow: (_x = theme.shadows) === null || _x === void 0 ? void 0 : _x.lg,
70
- }, _active: { bg: (_y = c.gray) === null || _y === void 0 ? void 0 : _y[100] } }) }))] }), isEditable && (_jsx(Input, { type: "file", accept: "image/*", onChange: handlePhotoChange, hidden: true, ref: fileInputRef }))] }))] }));
72
+ boxShadow: (_e = theme.shadows) === null || _e === void 0 ? void 0 : _e.lg,
73
+ }, _active: { bg: c.gray[100] } }) }))] }), isEditable && (_jsx(Input, { type: "file", accept: "image/*", onChange: handlePhotoChange, hidden: true, ref: fileInputRef }))] }))] }));
71
74
  }
@@ -4,7 +4,6 @@ import { DragDropContext, Droppable, Draggable, } from "@hello-pangea/dnd";
4
4
  import { BetweenHorizonalStart, GripVertical, X } from "lucide-react";
5
5
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
6
  const ReorderList = ({ label = "", items, onReorder, showRemoveIcon = false, onRemove, }) => {
7
- var _a;
8
7
  const { colors } = useCustomTheme();
9
8
  const handleDragEnd = (result) => {
10
9
  if (!result.destination)
@@ -14,9 +13,9 @@ const ReorderList = ({ label = "", items, onReorder, showRemoveIcon = false, onR
14
13
  reordered.splice(result.destination.index, 0, moved);
15
14
  onReorder(reordered);
16
15
  };
17
- return (_jsxs(Box, { borderWidth: "0.063rem", borderRadius: "md", px: 3, py: 2, bg: (_a = colors === null || colors === void 0 ? void 0 : colors.background) === null || _a === void 0 ? void 0 : _a[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) => {
18
- var _a, _b, _c, _d;
19
- return (_jsxs(Box, { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, position: "relative", border: "0.063rem solid", borderColor: (_a = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _a === void 0 ? void 0 : _a[300], borderRadius: "md", overflow: "hidden", children: [_jsx(Image, { src: item.previewUrl, alt: (_b = item.name) !== null && _b !== void 0 ? _b : `item-${index}`, boxSize: "7.5rem", objectFit: "cover" }), _jsx(IconButton, { icon: _jsx(GripVertical, { size: 16, color: (_c = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _c === void 0 ? void 0 : _c[500] }), "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: (_d = colors === null || colors === void 0 ? void 0 : colors.red) === null || _d === void 0 ? void 0 : _d[500] }), "aria-label": "Remove", size: "sm", position: "absolute", top: 1, right: 1, variant: "ghost", onClick: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove(item.id) }))] }));
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
+ 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) }))] }));
20
19
  } }, item.id))), provided.placeholder] })) }) })] }));
21
20
  };
22
21
  export default ReorderList;
@@ -2,12 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Modal, ModalOverlay, ModalContent, ModalHeader, ModalCloseButton, ModalBody, Flex, HStack, Text, } from "@chakra-ui/react";
3
3
  import { AlertTriangle, Trash2 } from "lucide-react";
4
4
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
5
+ import { isDarkCanvas } from "../../Theme/tokens/builders/accentText.js";
6
+ import { resolveStatusTone } from "../../Theme/tokens/builders/statusTone.js";
5
7
  import Button from "../Button/Button.js";
6
8
  const DeleteRoleModal = ({ isOpen, onClose, onConfirm, isLoading, labels, }) => {
7
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
8
9
  const { colors } = useCustomTheme();
9
- return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, children: [_jsx(ModalOverlay, { backdropFilter: "blur(4px)" }), _jsxs(ModalContent, { bg: (_a = colors === null || colors === void 0 ? void 0 : colors.background) === null || _a === void 0 ? void 0 : _a[50], borderRadius: "2xl", overflow: "hidden", children: [_jsxs(ModalHeader, { borderBottom: "1px solid", borderColor: (_c = (_b = colors === null || colors === void 0 ? void 0 : colors.boxborder) === null || _b === void 0 ? void 0 : _b[200]) !== null && _c !== void 0 ? _c : (_d = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _d === void 0 ? void 0 : _d[200], display: "flex", alignItems: "center", gap: 3, children: [_jsx(Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "full",
10
- // Pale badge bg: `red` reverses in dark; `semantic.error` is lifted and would stay near-white.
11
- bg: (_e = colors === null || colors === void 0 ? void 0 : colors.red) === null || _e === void 0 ? void 0 : _e[50], color: (_h = (_g = (_f = colors === null || colors === void 0 ? void 0 : colors.semantic) === null || _f === void 0 ? void 0 : _f.error) === null || _g === void 0 ? void 0 : _g[500]) !== null && _h !== void 0 ? _h : (_j = colors === null || colors === void 0 ? void 0 : colors.red) === null || _j === void 0 ? void 0 : _j[500], children: _jsx(AlertTriangle, { size: 18 }) }), _jsx(Text, { fontSize: "1.05rem", fontWeight: 600, children: labels.deleteRole })] }), _jsx(ModalCloseButton, {}), _jsxs(ModalBody, { py: 6, children: [_jsx(Text, { color: (_k = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _k === void 0 ? void 0 : _k[600], fontSize: "sm", mb: 5, children: labels.deleteRoleConfirm }), _jsxs(HStack, { justifyContent: "flex-end", spacing: 3, children: [_jsx(Button, { label: labels.cancel, onClick: onClose, variant: "outline", colorScheme: "gray", size: "sm" }), _jsx(Button, { label: labels.delete, onClick: onConfirm, colorScheme: "red", size: "sm", isLoading: isLoading, leftIcon: _jsx(Trash2, { size: 15 }) })] })] })] })] }));
10
+ const mode = isDarkCanvas(colors.backgroundColor.main) ? "dark" : "light";
11
+ const errorTone = resolveStatusTone(colors.semantic.error, mode);
12
+ return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, children: [_jsx(ModalOverlay, { backdropFilter: "blur(4px)" }), _jsxs(ModalContent, { bg: colors.background[50], borderRadius: "2xl", overflow: "hidden", children: [_jsxs(ModalHeader, { borderBottom: "1px solid", borderColor: colors.boxborder[200], display: "flex", alignItems: "center", gap: 3, children: [_jsx(Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "full", bg: errorTone.bg, color: errorTone.fg, children: _jsx(AlertTriangle, { size: 18 }) }), _jsx(Text, { fontSize: "1.05rem", fontWeight: 600, children: labels.deleteRole })] }), _jsx(ModalCloseButton, {}), _jsxs(ModalBody, { py: 6, children: [_jsx(Text, { color: colors.textMuted, fontSize: "sm", mb: 5, children: labels.deleteRoleConfirm }), _jsxs(HStack, { justifyContent: "flex-end", spacing: 3, children: [_jsx(Button, { label: labels.cancel, onClick: onClose, variant: "outline", colorScheme: "gray", size: "sm" }), _jsx(Button, { label: labels.delete, onClick: onConfirm, colorScheme: "red", size: "sm", isLoading: isLoading, leftIcon: _jsx(Trash2, { size: 15 }) })] })] })] })] }));
12
13
  };
13
14
  export default DeleteRoleModal;
@@ -3,6 +3,7 @@ import { useMemo, useState } from "react";
3
3
  import { Badge, Box, Checkbox, Divider, Flex, Heading, HStack, IconButton, Skeleton, Table, Tbody, Td, Text, Th, Thead, Tooltip, Tr, VStack, } from "@chakra-ui/react";
4
4
  import { ArrowLeft, Check, Pencil, Plus, ShieldCheck, SquareArrowOutUpRight, Trash2, } from "lucide-react";
5
5
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
+ import { resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
6
7
  import Button from "../Button/Button.js";
7
8
  import TextInput from "../Input/TextInput.js";
8
9
  import EmptyState from "../EmptyState/EmptyState.js";
@@ -51,15 +52,15 @@ const DEFAULT_KEYS = [
51
52
  "export",
52
53
  ];
53
54
  const RolesPermission = ({ view, mode = "create", roles, isRolesLoading = false, permissions, permissionKeys = DEFAULT_KEYS, roleName, roleNameError, isSuperAdmin, isTrackLocation, isShowRecords, isEditing = false, isSaving = false, onNewRole, onViewRole, onEditRole, onDeleteRole, onBack, onRoleNameChange, onToggleSuperAdmin, onToggleTrackLocation, onToggleShowRecords, onPermissionChange, onSave, onCancelForm, footerSlot, checkIcon, labels: labelOverrides, padding = "16px", }) => {
54
- var _a, _b, _c, _d, _e, _f, _g, _h;
55
55
  const { colors } = useCustomTheme();
56
56
  const labels = useMemo(() => ({ ...DEFAULT_LABELS, ...labelOverrides }), [labelOverrides]);
57
57
  const [deleteId, setDeleteId] = useState(null);
58
- const border = (_b = (_a = colors === null || colors === void 0 ? void 0 : colors.boxborder) === null || _a === void 0 ? void 0 : _a[200]) !== null && _b !== void 0 ? _b : (_c = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _c === void 0 ? void 0 : _c[200];
59
- const surface = (_d = colors === null || colors === void 0 ? void 0 : colors.background) === null || _d === void 0 ? void 0 : _d[50];
60
- const muted = (_e = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _e === void 0 ? void 0 : _e[500];
61
- const heading = (_f = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _f === void 0 ? void 0 : _f[800];
62
- const headBg = (_g = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _g === void 0 ? void 0 : _g[50];
58
+ const border = colors.boxborder[200];
59
+ const surface = colors.background[50];
60
+ const muted = colors.textMuted;
61
+ const heading = colors.text[900];
62
+ const headBg = colors.gray[50];
63
+ const rowHover = resolveHoverTint(colors.gray[50], surface);
63
64
  const isViewMode = mode === "view";
64
65
  const columnLabels = {
65
66
  read: labels.read,
@@ -92,18 +93,15 @@ const RolesPermission = ({ view, mode = "create", roles, isRolesLoading = false,
92
93
  borderColor: border,
93
94
  py: 3,
94
95
  };
95
- const renderGrantedCheck = () => {
96
- var _a;
97
- return checkIcon !== null && checkIcon !== void 0 ? checkIcon : (_jsx(Box, { color: (_a = colors === null || colors === void 0 ? void 0 : colors.green) === null || _a === void 0 ? void 0 : _a[500], display: "inline-flex", children: _jsx(Check, { size: 18, strokeWidth: 3 }) }));
98
- };
96
+ const renderGrantedCheck = () => checkIcon !== null && checkIcon !== void 0 ? checkIcon : (_jsx(Box, { color: colors.semanticText.success, display: "inline-flex", children: _jsx(Check, { size: 18, strokeWidth: 3 }) }));
99
97
  const renderListView = () => (_jsxs(VStack, { align: "stretch", spacing: 4, children: [_jsxs(Box, { ...cardSx, children: [_jsxs(Flex, { ...cardHeaderSx, alignItems: "center", justifyContent: "space-between", children: [_jsxs(HStack, { spacing: 2, children: [onBack && (_jsx(IconButton, { "aria-label": "Go back", icon: _jsx(ArrowLeft, { size: 16 }), variant: "ghost", size: "xs", color: muted, onClick: onBack })), _jsx(Heading, { size: "sm", fontWeight: 600, color: heading, children: labels.title }), !isRolesLoading && (_jsxs(Badge, { colorScheme: "blue", variant: "subtle", borderRadius: "full", px: 2, py: 0.5, fontSize: "0.65rem", textTransform: "none", children: [labels.totalRoles, ": ", roles.length] }))] }), _jsx(Button, { label: labels.newRole, onClick: onNewRole, size: "sm", sx: { fontSize: "xs" }, colorScheme: "primary", leftIcon: _jsx(Plus, { size: 15 }) })] }), _jsx(Box, { overflowX: "auto", children: isRolesLoading ? (_jsx(VStack, { spacing: 3, p: 4, align: "stretch", children: Array.from({ length: 6 }).map((_, idx) => (_jsx(Skeleton, { height: "18px", borderRadius: "md" }, idx))) })) : roles.length === 0 ? (_jsx(EmptyState, { icon: ShieldCheck, title: labels.noRoles, size: "sm", minH: "200px" })) : (_jsxs(Table, { variant: "simple", size: "sm", children: [_jsx(Thead, { bg: headBg, children: _jsxs(Tr, { children: [_jsx(Th, { ...thStyle, width: "56px", children: labels.sNo }), _jsx(Th, { ...thStyle, children: labels.roleNameColumn }), _jsx(Th, { ...thStyle, children: labels.createdBy }), _jsx(Th, { ...thStyle, children: labels.createdTime }), _jsx(Th, { ...thStyle, textAlign: "right", children: labels.actions })] }) }), _jsx(Tbody, { children: roles.map((role, index) => {
100
- var _a, _b;
101
- return (_jsxs(Tr, { _hover: { bg: headBg }, transition: "background 0.15s ease", children: [_jsx(Td, { borderColor: border, color: muted, fontSize: "sm", children: index + 1 }), _jsx(Td, { borderColor: border, maxW: "160px", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", fontSize: "sm", fontWeight: 600, color: heading, children: role.roleName }), _jsx(Td, { borderColor: border, fontSize: "sm", color: muted, children: role.createdBy }), _jsx(Td, { borderColor: border, fontSize: "sm", color: muted, children: role.created_at }), _jsx(Td, { borderColor: border, children: _jsxs(HStack, { spacing: 1, justifyContent: "flex-end", children: [_jsx(Tooltip, { label: labels.view, hasArrow: true, children: _jsx(IconButton, { icon: _jsx(SquareArrowOutUpRight, { size: 15 }), "aria-label": labels.view, variant: "ghost", size: "xs", color: muted, onClick: () => onViewRole === null || onViewRole === void 0 ? void 0 : onViewRole(role) }) }), _jsx(Tooltip, { label: labels.edit, hasArrow: true, children: _jsx(IconButton, { icon: _jsx(Pencil, { size: 15 }), "aria-label": labels.edit, variant: "ghost", size: "xs", color: muted, onClick: () => onEditRole === null || onEditRole === void 0 ? void 0 : onEditRole(role) }) }), _jsx(Tooltip, { label: labels.delete, hasArrow: true, children: _jsx(IconButton, { icon: _jsx(Trash2, { size: 15 }), "aria-label": labels.delete, variant: "ghost", size: "xs", colorScheme: "red", color: (_a = colors === null || colors === void 0 ? void 0 : colors.red) === null || _a === void 0 ? void 0 : _a[400], onClick: () => setDeleteId(Number(role.roles_id)) }) })] }) })] }, (_b = role.roles_id) !== null && _b !== void 0 ? _b : role.roleName));
98
+ var _a;
99
+ return (_jsxs(Tr, { _hover: { bg: rowHover }, transition: "background 0.15s ease", children: [_jsx(Td, { borderColor: border, color: muted, fontSize: "sm", children: index + 1 }), _jsx(Td, { borderColor: border, maxW: "160px", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", fontSize: "sm", fontWeight: 600, color: heading, children: role.roleName }), _jsx(Td, { borderColor: border, fontSize: "sm", color: muted, children: role.createdBy }), _jsx(Td, { borderColor: border, fontSize: "sm", color: muted, children: role.created_at }), _jsx(Td, { borderColor: border, children: _jsxs(HStack, { spacing: 1, justifyContent: "flex-end", children: [_jsx(Tooltip, { label: labels.view, hasArrow: true, children: _jsx(IconButton, { icon: _jsx(SquareArrowOutUpRight, { size: 15 }), "aria-label": labels.view, variant: "ghost", size: "xs", color: muted, onClick: () => onViewRole === null || onViewRole === void 0 ? void 0 : onViewRole(role) }) }), _jsx(Tooltip, { label: labels.edit, hasArrow: true, children: _jsx(IconButton, { icon: _jsx(Pencil, { size: 15 }), "aria-label": labels.edit, variant: "ghost", size: "xs", color: muted, onClick: () => onEditRole === null || onEditRole === void 0 ? void 0 : onEditRole(role) }) }), _jsx(Tooltip, { label: labels.delete, hasArrow: true, children: _jsx(IconButton, { icon: _jsx(Trash2, { size: 15 }), "aria-label": labels.delete, variant: "ghost", size: "xs", colorScheme: "red", color: colors.semanticText.error, onClick: () => setDeleteId(Number(role.roles_id)) }) })] }) })] }, (_a = role.roles_id) !== null && _a !== void 0 ? _a : role.roleName));
102
100
  }) })] })) })] }), footerSlot] }));
103
101
  const renderFormView = () => (_jsxs(VStack, { align: "stretch", spacing: 4, children: [_jsxs(Box, { ...cardSx, children: [_jsxs(Flex, { ...cardHeaderSx, alignItems: "center", gap: 2, children: [onCancelForm && (_jsx(IconButton, { "aria-label": "Go back", icon: _jsx(ArrowLeft, { size: 16 }), variant: "ghost", size: "xs", color: muted, onClick: onCancelForm })), _jsx(Heading, { size: "sm", fontWeight: 600, color: heading, children: labels.roleInformation })] }), _jsxs(Box, { p: 4, children: [_jsx(Box, { maxW: "320px", children: _jsx(Tooltip, { label: isViewMode ? labels.readOnly : "", isDisabled: !isViewMode, children: _jsx(Box, { children: _jsx(TextInput, { label: labels.roleName, value: roleName, placeholder: labels.roleNamePlaceholder, error: !!roleNameError, errorMessage: roleNameError, onChange: (e) => onRoleNameChange === null || onRoleNameChange === void 0 ? void 0 : onRoleNameChange(e.target.value), isRequired: true, width: "100%", isDisabled: isViewMode }) }) }) }), _jsxs(VStack, { align: "stretch", spacing: 3, mt: 4, children: [_jsx(Checkbox, { isChecked: isSuperAdmin, isDisabled: isViewMode, size: "sm", onChange: (e) => onToggleSuperAdmin === null || onToggleSuperAdmin === void 0 ? void 0 : onToggleSuperAdmin(e.target.checked), children: _jsx(Text, { fontSize: "sm", color: heading, children: labels.enableAllPermissions }) }), _jsx(Checkbox, { isChecked: isTrackLocation, isDisabled: isViewMode, size: "sm", onChange: (e) => onToggleTrackLocation === null || onToggleTrackLocation === void 0 ? void 0 : onToggleTrackLocation(e.target.checked), children: _jsx(Text, { fontSize: "sm", color: heading, children: labels.trackLocation }) }), _jsx(Checkbox, { isChecked: isShowRecords, isDisabled: isViewMode, size: "sm", onChange: (e) => onToggleShowRecords === null || onToggleShowRecords === void 0 ? void 0 : onToggleShowRecords(e.target.checked), children: _jsx(Text, { fontSize: "sm", color: heading, children: labels.showAllUserRecords }) })] })] })] }), _jsxs(Box, { ...cardSx, children: [_jsx(Flex, { ...cardHeaderSx, alignItems: "center", children: _jsx(Heading, { size: "sm", fontWeight: 600, color: heading, children: labels.permissionSettings }) }), _jsx(Box, { overflowX: "auto", children: _jsxs(Table, { variant: "simple", size: "sm", children: [_jsx(Thead, { bg: headBg, children: _jsxs(Tr, { children: [_jsx(Th, { ...thStyle, children: labels.moduleName }), permissionKeys.map((key) => (_jsx(Th, { ...thStyle, textAlign: "center", children: columnLabels[key] }, key)))] }) }), _jsx(Tbody, { children: permissions.length === 0 ? (_jsx(Tr, { children: _jsx(Td, { colSpan: permissionKeys.length + 1, textAlign: "center", borderColor: border, children: _jsx(Text, { color: muted, fontSize: "sm", py: 4, children: labels.noPermissions }) }) })) : (permissions.map((perm) => {
104
102
  var _a;
105
103
  const isAutomationModule = ((_a = perm.module) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "automation";
106
- return (_jsxs(Tr, { _hover: { bg: headBg }, transition: "background 0.15s ease", children: [_jsx(Td, { borderColor: border, color: heading, fontSize: "sm", fontWeight: 500, maxW: "160px", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", children: perm.module }), permissionKeys.map((key) => {
104
+ return (_jsxs(Tr, { _hover: { bg: rowHover }, transition: "background 0.15s ease", children: [_jsx(Td, { borderColor: border, color: heading, fontSize: "sm", fontWeight: 500, maxW: "160px", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", children: perm.module }), permissionKeys.map((key) => {
107
105
  const isRead = key === "read";
108
106
  return (_jsx(Td, { textAlign: "center", borderColor: border, children: _jsx(Flex, { justify: "center", children: isViewMode ? (isAutomationModule ? (isRead &&
109
107
  perm.automation &&
@@ -112,7 +110,7 @@ const RolesPermission = ({ view, mode = "create", roles, isRolesLoading = false,
112
110
  : perm[key], isDisabled: isAutomationModule && !isRead, onChange: () => onPermissionChange === null || onPermissionChange === void 0 ? void 0 : onPermissionChange(perm.module, isAutomationModule ? "automation" : key) })) }) }, key));
113
111
  })] }, perm.module));
114
112
  })) })] }) }), !isViewMode && (_jsxs(_Fragment, { children: [_jsx(Divider, { borderColor: border }), _jsxs(Flex, { justifyContent: "flex-end", gap: 3, p: 4, children: [_jsx(Button, { onClick: onCancelForm, size: "sm", sx: { fontSize: "xs" }, label: labels.cancel, colorScheme: "red", variant: "outline" }), _jsx(Button, { onClick: onSave, size: "sm", sx: { fontSize: "xs" }, colorScheme: "primary", isLoading: isSaving, label: isEditing ? labels.updateChanges : labels.saveChanges })] })] }))] })] }));
115
- return (_jsxs(Box, { p: padding, backgroundColor: (_h = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _h === void 0 ? void 0 : _h[50], minHeight: "100%", children: [view === "list" ? renderListView() : renderFormView(), _jsx(DeleteRoleModal, { isOpen: deleteId !== null, onClose: () => setDeleteId(null), onConfirm: () => {
113
+ return (_jsxs(Box, { p: padding, backgroundColor: colors.backgroundColor.main, minHeight: "100%", children: [view === "list" ? renderListView() : renderFormView(), _jsx(DeleteRoleModal, { isOpen: deleteId !== null, onClose: () => setDeleteId(null), onConfirm: () => {
116
114
  if (deleteId !== null)
117
115
  onDeleteRole === null || onDeleteRole === void 0 ? void 0 : onDeleteRole(deleteId);
118
116
  setDeleteId(null);
@@ -6,7 +6,6 @@ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
6
  import ToolTip from "../ToolTip/ToolTip.js";
7
7
  import { rafThrottle } from "../../Utils/rafThrottle.js";
8
8
  const ScrollToTop = ({ children, tooltipLabel = "Scroll to top", threshold = 300, duration = 600, useWindow = false, bottom = "2rem", right = "2rem", }) => {
9
- var _a;
10
9
  const [visible, setVisible] = useState(false);
11
10
  const anchorRef = useRef(null);
12
11
  const theme = useCustomTheme();
@@ -58,8 +57,8 @@ const ScrollToTop = ({ children, tooltipLabel = "Scroll to top", threshold = 300
58
57
  };
59
58
  // eslint-disable-next-line react-hooks/exhaustive-deps
60
59
  }, [useWindow, threshold]);
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.white, 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: {
62
- bg: (_a = theme.colors.primary[600]) !== null && _a !== void 0 ? _a : theme.colors.primary[500],
60
+ 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
+ bg: theme.colors.primary[600],
63
62
  transform: "translateY(-2px) scale(1.05)",
64
63
  boxShadow: "lg",
65
64
  }, _active: { transform: "scale(0.95)" }, children: _jsx(ChevronUp, { size: 24, strokeWidth: 2.5 }) }) })] }));