pixelize-design-library 2.4.2-beta.1 → 2.4.2-beta.11

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 (201) hide show
  1. package/dist/Components/Accordion/Accordion.js +2 -2
  2. package/dist/Components/Button/Button.styles.js +4 -3
  3. package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +6 -6
  4. package/dist/Components/Checkbox/Checkbox.js +1 -1
  5. package/dist/Components/Checkbox/Checkbox.styles.js +2 -0
  6. package/dist/Components/Common/fieldStyles.js +1 -1
  7. package/dist/Components/CopyButton/CopyButton.js +1 -1
  8. package/dist/Components/CustomModulesTable/EditModuleModal.js +1 -1
  9. package/dist/Components/DatePicker/CalendarPanel.js +1 -1
  10. package/dist/Components/DatePicker/RangeDatePicker.js +2 -2
  11. package/dist/Components/DatePicker/SingleDatePicker.js +2 -2
  12. package/dist/Components/DatePicker/TimeOnlyPicker.js +1 -1
  13. package/dist/Components/Dropdown/DropDown.js +3 -13
  14. package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
  15. package/dist/Components/FilePreview/FilePreview.js +1 -1
  16. package/dist/Components/FilterSidebar/FilterSidebar.js +4 -4
  17. package/dist/Components/Form/FormWrapper.js +1 -1
  18. package/dist/Components/Header/HeaderActions.d.ts +3 -1
  19. package/dist/Components/Header/HeaderActions.js +7 -3
  20. package/dist/Components/Input/TextInput.styles.js +6 -4
  21. package/dist/Components/InputTextArea/InputTextArea.style.js +5 -4
  22. package/dist/Components/KanbanBoard/KanbanBoard.js +5 -45
  23. package/dist/Components/LimitReachedModal/LimitReachedModal.js +4 -5
  24. package/dist/Components/MultiSelect/MultiSelect.js +1 -1
  25. package/dist/Components/NavigationBar/NavigationBar.js +3 -3
  26. package/dist/Components/NoteTextArea/NoteTextArea.js +5 -3
  27. package/dist/Components/NumberInput/NumberInput.styles.js +5 -4
  28. package/dist/Components/OrgSwitcher/OrgSwitcher.js +2 -2
  29. package/dist/Components/PinInput/PinInput.js +1 -1
  30. package/dist/Components/PlanPill/PlanPill.js +5 -5
  31. package/dist/Components/PlanPill/planPillGradient.d.ts +2 -14
  32. package/dist/Components/PlanPill/planPillGradient.js +3 -15
  33. package/dist/Components/ProductCard/ProductPrice.js +1 -1
  34. package/dist/Components/ProfileCard/ProfileCard.js +1 -1
  35. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
  36. package/dist/Components/RadioButton/RadioButton.js +1 -1
  37. package/dist/Components/Reorder/Reorder.js +1 -1
  38. package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +13 -0
  39. package/dist/Components/ScrollbarBox/ScrollbarBox.js +11 -0
  40. package/dist/Components/SearchSelect/SearchSelect.js +5 -4
  41. package/dist/Components/Select/Select.styles.js +3 -2
  42. package/dist/Components/SelectSearch/SelectSearch.js +3 -3
  43. package/dist/Components/SelectV2/SelectV2.js +5 -11
  44. package/dist/Components/SideBar/SecondaryBar.js +1 -1
  45. package/dist/Components/StageProgress/StageProgress.js +2 -9
  46. package/dist/Components/Table/Table.d.ts +1 -1
  47. package/dist/Components/Table/Table.js +17 -24
  48. package/dist/Components/Table/TableProps.d.ts +4 -0
  49. package/dist/Components/Table/components/TableActions.js +2 -2
  50. package/dist/Components/Table/components/TableBody.js +41 -12
  51. package/dist/Components/Table/components/TableGroupRow.js +1 -1
  52. package/dist/Components/Table/components/TableHeader.js +21 -8
  53. package/dist/Components/Table/components/TableSearch.js +1 -1
  54. package/dist/Components/Table/filters/ActiveFilters.js +2 -18
  55. package/dist/Components/Table/settings/ManageColumns.js +3 -17
  56. package/dist/Components/Table/settings/TableSettings.js +5 -11
  57. package/dist/Components/Table/variants/TableVariantContext.d.ts +4 -0
  58. package/dist/Components/Table/variants/TableVariantContext.js +17 -0
  59. package/dist/Components/Table/variants/classic.d.ts +6 -0
  60. package/dist/Components/Table/variants/classic.js +47 -0
  61. package/dist/Components/Table/variants/index.d.ts +7 -0
  62. package/dist/Components/Table/variants/index.js +27 -0
  63. package/dist/Components/Table/variants/pillInk.d.ts +6 -0
  64. package/dist/Components/Table/variants/pillInk.js +21 -0
  65. package/dist/Components/Table/variants/studio.d.ts +6 -0
  66. package/dist/Components/Table/variants/studio.js +50 -0
  67. package/dist/Components/Table/variants/tokens.d.ts +49 -0
  68. package/dist/Components/Table/variants/tokens.js +2 -0
  69. package/dist/Components/Timeline/Timeline.js +2 -2
  70. package/dist/Components/Toaster/Toaster.js +1 -1
  71. package/dist/Components/Trail/TrailWorks.js +1 -1
  72. package/dist/Components/UpgradeButton/UpgradeButton.js +3 -3
  73. package/dist/Constants/Sidebar.js +3 -2
  74. package/dist/Theme/chakra/Menu.styles.d.ts +9 -6
  75. package/dist/Theme/chakra/Menu.styles.js +11 -5
  76. package/dist/Theme/chakra/Popover.styles.d.ts +6 -3
  77. package/dist/Theme/chakra/Popover.styles.js +11 -6
  78. package/dist/Theme/chakra/Switch.styles.d.ts +1 -1
  79. package/dist/Theme/chakra/Switch.styles.js +7 -9
  80. package/dist/Theme/chakra/componentStyles.d.ts +15 -9
  81. package/dist/Theme/chakra/createBrandTheme.js +3 -16
  82. package/dist/Theme/provider/PixelizeThemeProvider.js +18 -20
  83. package/dist/Theme/provider/ThemeSwitcher.js +13 -20
  84. package/dist/Theme/tokens/brands/emerald/palette.light.js +5 -7
  85. package/dist/Theme/tokens/brands/lavender/palette.light.js +5 -116
  86. package/dist/Theme/tokens/brands/meadow/palette.light.js +5 -7
  87. package/dist/Theme/tokens/brands/neutrals.d.ts +8 -0
  88. package/dist/Theme/tokens/brands/neutrals.js +119 -0
  89. package/dist/Theme/tokens/brands/radiant/palette.light.js +5 -7
  90. package/dist/Theme/tokens/brands/rosewood/palette.light.js +5 -7
  91. package/dist/Theme/tokens/brands/skyline/palette.light.js +5 -7
  92. package/dist/Theme/tokens/brands/slate/palette.light.js +6 -12
  93. package/dist/Theme/tokens/brands/storefront/palette.light.js +5 -7
  94. package/dist/Theme/tokens/builders/brandInk.d.ts +11 -0
  95. package/dist/Theme/tokens/builders/brandInk.js +106 -0
  96. package/dist/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
  97. package/dist/Theme/tokens/builders/gradientInk.d.ts +22 -0
  98. package/dist/Theme/tokens/builders/gradientInk.js +28 -0
  99. package/dist/Theme/tokens/builders/index.d.ts +3 -0
  100. package/dist/Theme/tokens/builders/index.js +3 -0
  101. package/dist/Theme/tokens/builders/outlineRung.d.ts +32 -3
  102. package/dist/Theme/tokens/builders/outlineRung.js +74 -5
  103. package/dist/Theme/tokens/builders/placeholderInk.d.ts +19 -0
  104. package/dist/Theme/tokens/builders/placeholderInk.js +35 -0
  105. package/dist/Theme/tokens/builders/resolvedRungs.d.ts +5 -1
  106. package/dist/Theme/tokens/builders/resolvedRungs.js +7 -2
  107. package/dist/Theme/tokens/builders/scrollbar.d.ts +12 -0
  108. package/dist/Theme/tokens/builders/scrollbar.js +57 -0
  109. package/dist/Theme/tokens/builders/surfaceRungs.d.ts +5 -0
  110. package/dist/Theme/tokens/builders/surfaceRungs.js +20 -5
  111. package/dist/Theme/tokens/types.d.ts +5 -0
  112. package/dist/esm/Components/Accordion/Accordion.js +2 -2
  113. package/dist/esm/Components/Button/Button.styles.js +5 -4
  114. package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +6 -6
  115. package/dist/esm/Components/Checkbox/Checkbox.js +1 -1
  116. package/dist/esm/Components/Checkbox/Checkbox.styles.js +2 -0
  117. package/dist/esm/Components/Common/fieldStyles.js +1 -1
  118. package/dist/esm/Components/CopyButton/CopyButton.js +1 -1
  119. package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +1 -1
  120. package/dist/esm/Components/DatePicker/CalendarPanel.js +1 -1
  121. package/dist/esm/Components/DatePicker/RangeDatePicker.js +2 -2
  122. package/dist/esm/Components/DatePicker/SingleDatePicker.js +2 -2
  123. package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +1 -1
  124. package/dist/esm/Components/Dropdown/DropDown.js +3 -13
  125. package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
  126. package/dist/esm/Components/FilePreview/FilePreview.js +1 -1
  127. package/dist/esm/Components/FilterSidebar/FilterSidebar.js +4 -4
  128. package/dist/esm/Components/Form/FormWrapper.js +1 -1
  129. package/dist/esm/Components/Header/HeaderActions.js +8 -4
  130. package/dist/esm/Components/Input/TextInput.styles.js +6 -4
  131. package/dist/esm/Components/InputTextArea/InputTextArea.style.js +5 -4
  132. package/dist/esm/Components/KanbanBoard/KanbanBoard.js +5 -45
  133. package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +4 -5
  134. package/dist/esm/Components/MultiSelect/MultiSelect.js +1 -1
  135. package/dist/esm/Components/NavigationBar/NavigationBar.js +3 -3
  136. package/dist/esm/Components/NoteTextArea/NoteTextArea.js +5 -3
  137. package/dist/esm/Components/NumberInput/NumberInput.styles.js +5 -4
  138. package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +2 -2
  139. package/dist/esm/Components/PinInput/PinInput.js +1 -1
  140. package/dist/esm/Components/PlanPill/PlanPill.js +6 -6
  141. package/dist/esm/Components/PlanPill/planPillGradient.js +3 -15
  142. package/dist/esm/Components/ProductCard/ProductPrice.js +1 -1
  143. package/dist/esm/Components/ProfileCard/ProfileCard.js +1 -1
  144. package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
  145. package/dist/esm/Components/RadioButton/RadioButton.js +1 -1
  146. package/dist/esm/Components/Reorder/Reorder.js +1 -1
  147. package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +9 -0
  148. package/dist/esm/Components/SearchSelect/SearchSelect.js +5 -4
  149. package/dist/esm/Components/Select/Select.styles.js +3 -2
  150. package/dist/esm/Components/SelectSearch/SelectSearch.js +3 -3
  151. package/dist/esm/Components/SelectV2/SelectV2.js +5 -11
  152. package/dist/esm/Components/SideBar/SecondaryBar.js +1 -1
  153. package/dist/esm/Components/StageProgress/StageProgress.js +2 -9
  154. package/dist/esm/Components/Table/Table.js +17 -24
  155. package/dist/esm/Components/Table/components/TableActions.js +2 -2
  156. package/dist/esm/Components/Table/components/TableBody.js +42 -13
  157. package/dist/esm/Components/Table/components/TableGroupRow.js +1 -1
  158. package/dist/esm/Components/Table/components/TableHeader.js +21 -8
  159. package/dist/esm/Components/Table/components/TableSearch.js +1 -1
  160. package/dist/esm/Components/Table/filters/ActiveFilters.js +2 -18
  161. package/dist/esm/Components/Table/settings/ManageColumns.js +3 -17
  162. package/dist/esm/Components/Table/settings/TableSettings.js +5 -11
  163. package/dist/esm/Components/Table/variants/TableVariantContext.js +13 -0
  164. package/dist/esm/Components/Table/variants/classic.js +43 -0
  165. package/dist/esm/Components/Table/variants/index.js +9 -0
  166. package/dist/esm/Components/Table/variants/pillInk.js +18 -0
  167. package/dist/esm/Components/Table/variants/studio.js +46 -0
  168. package/dist/esm/Components/Table/variants/tokens.js +1 -0
  169. package/dist/esm/Components/Timeline/Timeline.js +2 -2
  170. package/dist/esm/Components/Toaster/Toaster.js +1 -1
  171. package/dist/esm/Components/Trail/TrailWorks.js +1 -1
  172. package/dist/esm/Components/UpgradeButton/UpgradeButton.js +3 -3
  173. package/dist/esm/Constants/Sidebar.js +3 -2
  174. package/dist/esm/Theme/chakra/Menu.styles.js +11 -5
  175. package/dist/esm/Theme/chakra/Popover.styles.js +11 -6
  176. package/dist/esm/Theme/chakra/Switch.styles.js +7 -9
  177. package/dist/esm/Theme/chakra/createBrandTheme.js +3 -16
  178. package/dist/esm/Theme/provider/PixelizeThemeProvider.js +18 -20
  179. package/dist/esm/Theme/provider/ThemeSwitcher.js +13 -20
  180. package/dist/esm/Theme/tokens/brands/emerald/palette.light.js +5 -4
  181. package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +5 -116
  182. package/dist/esm/Theme/tokens/brands/meadow/palette.light.js +5 -4
  183. package/dist/esm/Theme/tokens/brands/neutrals.js +116 -0
  184. package/dist/esm/Theme/tokens/brands/radiant/palette.light.js +5 -4
  185. package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +5 -4
  186. package/dist/esm/Theme/tokens/brands/skyline/palette.light.js +5 -4
  187. package/dist/esm/Theme/tokens/brands/slate/palette.light.js +6 -9
  188. package/dist/esm/Theme/tokens/brands/storefront/palette.light.js +5 -4
  189. package/dist/esm/Theme/tokens/builders/brandInk.js +103 -0
  190. package/dist/esm/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
  191. package/dist/esm/Theme/tokens/builders/gradientInk.js +22 -0
  192. package/dist/esm/Theme/tokens/builders/index.js +3 -0
  193. package/dist/esm/Theme/tokens/builders/outlineRung.js +70 -4
  194. package/dist/esm/Theme/tokens/builders/placeholderInk.js +29 -0
  195. package/dist/esm/Theme/tokens/builders/resolvedRungs.js +7 -2
  196. package/dist/esm/Theme/tokens/builders/scrollbar.js +52 -0
  197. package/dist/esm/Theme/tokens/builders/surfaceRungs.js +20 -5
  198. package/dist/esm/index.js +5 -1
  199. package/dist/index.d.ts +10 -2
  200. package/dist/index.js +17 -3
  201. package/package.json +4 -2
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hardestSurface = exports.namedSurfaces = void 0;
3
+ exports.hardestSurface = exports.namedSurfaces = exports.PLACEHOLDER_TEXT = void 0;
4
4
  exports.withSurfaceRungs = withSurfaceRungs;
5
5
  const color_1 = require("./color");
6
6
  const outlineRung_1 = require("./outlineRung");
7
7
  const accentText_1 = require("./accentText");
8
8
  const semanticText_1 = require("./semanticText");
9
+ /**
10
+ * A hint is held to the non-text floor, not the body-text one. Deliberate: at 4.5 an empty field
11
+ * reads as one already typed into. See CHROME-CONSISTENCY.md.
12
+ */
13
+ exports.PLACEHOLDER_TEXT = outlineRung_1.AA_NON_TEXT;
9
14
  const namedSurfaces = (palette) => [
10
15
  ...Object.values(palette.backgroundColor),
11
16
  palette.background[50],
@@ -19,6 +24,8 @@ exports.hardestSurface = hardestSurface;
19
24
  function withSurfaceRungs(palette) {
20
25
  const surfaces = (0, exports.namedSurfaces)(palette);
21
26
  const lift = (ink, target) => (0, outlineRung_1.liftToContrast)(ink, (0, exports.hardestSurface)(ink, surfaces), target);
27
+ const settle = (ink, target) => (0, outlineRung_1.settleAcross)(ink, surfaces, target);
28
+ const rule = (ink) => (0, outlineRung_1.ruleInk)(ink, [palette.backgroundColor.main, palette.background[50]], outlineRung_1.CHROME_RULE);
22
29
  const semanticText = semanticText_1.SEMANTIC_TONES.reduce((acc, tone) => {
23
30
  acc[tone] = lift(palette.semanticText[tone], accentText_1.AA_NORMAL_TEXT);
24
31
  return acc;
@@ -30,10 +37,18 @@ function withSurfaceRungs(palette) {
30
37
  semanticText,
31
38
  text: { ...palette.text, 500: lift(palette.text[500], accentText_1.AA_NORMAL_TEXT) },
32
39
  header: { ...palette.header, 500: lift(palette.header[500], accentText_1.AA_NORMAL_TEXT) },
33
- placeholder: {
34
- ...palette.placeholder,
35
- 500: lift(palette.placeholder[500], accentText_1.AA_NORMAL_TEXT),
40
+ // `placeholder` is deliberately absent: the brand authors that rung and the published
41
+ // library ships it untouched. Its floor is enforced in `placeholderInk`, against the
42
+ // surfaces a FIELD renders on — not `table.hover`, which no field sits on.
43
+ // Settled, not lifted: this rung already passed through `withOutlineRung`, and lifting it
44
+ // again here to AA_NON_TEXT is what shipped 3.85-4.95:1 outlines. See CHROME_BORDER.
45
+ boxborder: {
46
+ ...palette.boxborder,
47
+ 200: rule(palette.boxborder[200]),
48
+ 500: settle(palette.boxborder[500], outlineRung_1.CHROME_BORDER),
36
49
  },
37
- boxborder: { ...palette.boxborder, 500: lift(palette.boxborder[500], outlineRung_1.AA_NON_TEXT) },
50
+ // The 200 rung of both ramps is the same job under two names; settle them together or an
51
+ // app picking `border` gets a heavier rule than one picking `boxborder`.
52
+ border: { ...palette.border, 200: rule(palette.border[200]) },
38
53
  };
39
54
  }
@@ -130,6 +130,11 @@ export type BrandPaletteSource = Omit<PaletteProps, "accentText" | "textMuted" |
130
130
  background: ColorScale;
131
131
  };
132
132
  };
133
+ /** Utility scales carrying no brand identity. The only tokens a brand may inherit. */
134
+ export type NeutralPaletteKey = "transparent" | "black" | "white" | "semantic" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink";
135
+ export type NeutralPaletteTokens = Pick<BrandPaletteSource, NeutralPaletteKey>;
136
+ /** Everything a brand must state itself — never by spreading another brand. */
137
+ export type BrandIdentityTokens = Omit<BrandPaletteSource, NeutralPaletteKey>;
133
138
  /** Brand identities shipped by the library. */
134
139
  export type ThemeName = "lavender" | "meadow" | "radiant" | "skyline" | "slate" | "emerald" | "rosewood" | "storefront" | "zinc";
135
140
  /** User-selectable color mode. `system` follows the OS setting. */
@@ -8,13 +8,13 @@ import { getAccordionHoverColors } from "./accordionColors.js";
8
8
  const Accordion = ({ allowMultiple, allowToggle, index, onChange, reduceMotion, items, ...rest }) => {
9
9
  const { colors } = useCustomTheme();
10
10
  const isDark = isDarkCanvas(colors.backgroundColor.main);
11
- const border = colors.boxborder[300];
11
+ const border = colors.boxborder[200];
12
12
  const headingColor = colors.text[800];
13
13
  const bodyColor = colors.text[600];
14
14
  const { expandedBg, softHover } = useMemo(() => getAccordionHoverColors(colors, isDark), [colors, isDark]);
15
15
  return (_jsx(ChakraAccordian, { allowMultiple: allowMultiple, allowToggle: allowToggle, index: index, onChange: onChange, reduceMotion: reduceMotion, ...rest, children: items.map((item, idx) => {
16
16
  var _a;
17
- return (_jsx(AccordionItem, { border: `0.063rem solid ${border}`, borderRadius: "xl", bg: colors.background[50], mb: 3, overflow: "hidden", transition: "border-color 0.15s ease, box-shadow 0.15s ease", _last: { mb: 0 }, _hover: { borderColor: colors.boxborder[400] }, ...item.itemProps, sx: (_a = item.customStyles) === null || _a === void 0 ? void 0 : _a.itemStyle, children: ({ isExpanded }) => {
17
+ return (_jsx(AccordionItem, { border: `0.063rem solid ${border}`, borderRadius: "xl", bg: colors.background[50], mb: 3, overflow: "hidden", transition: "border-color 0.15s ease, box-shadow 0.15s ease", _last: { mb: 0 }, _hover: { borderColor: colors.boxborder[200] }, ...item.itemProps, sx: (_a = item.customStyles) === null || _a === void 0 ? void 0 : _a.itemStyle, children: ({ isExpanded }) => {
18
18
  var _a, _b, _c;
19
19
  return (_jsxs(_Fragment, { children: [_jsx("h2", { children: _jsxs(AccordionButton, { px: 4, py: 3, gap: 3, fontSize: "0.875rem", fontWeight: 600, color: headingColor, bg: isExpanded ? expandedBg : "transparent", transition: "background 0.15s ease", _hover: { bg: isExpanded ? expandedBg : softHover }, _focusVisible: {
20
20
  boxShadow: "none",
@@ -1,4 +1,5 @@
1
- import { accentTextOnCanvas, isDarkCanvas, onFilled, onGradient } from "../../Theme/tokens/builders/accentText.js";
1
+ import { accentTextOnCanvas, isDarkCanvas, onFilled } from "../../Theme/tokens/builders/accentText.js";
2
+ import { resolveGradient, gradientCss } from "../../Theme/tokens/builders/gradientInk.js";
2
3
  /**
3
4
  * Outline/ghost/link text sits ON the canvas, so it needs a rung that stays readable there —
4
5
  * `[500]` is pinned dark enough to carry a white label on the solid variant and measures only
@@ -138,11 +139,11 @@ export const Button = {
138
139
  // Theme-based two-tone gradient: each theme defines its own `gradient` {from,to} pair.
139
140
  // Ignores colorScheme; hover/active shift brightness so it works for any pair.
140
141
  gradient: ({ theme }) => {
141
- const g = theme.colors.gradient;
142
- const bg = `linear-gradient(135deg, ${g.from} 0%, ${g.to} 100%)`;
142
+ const g = resolveGradient(theme.colors.gradient, theme.colors.white, theme.colors.black);
143
+ const bg = gradientCss(g);
143
144
  return {
144
145
  bgImage: bg,
145
- color: onGradient(g.from, g.to, theme.colors.white, theme.colors.black),
146
+ color: g.ink,
146
147
  border: "none",
147
148
  _hover: {
148
149
  bgImage: bg,
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useRef, useEffect } from "react";
3
3
  import { Box, Button, ButtonGroup, IconButton, Menu, MenuButton, MenuItem, MenuList, Tooltip, } from "@chakra-ui/react";
4
4
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
5
- import { onGradient } from "../../Theme/tokens/builders/accentText.js";
5
+ import { resolveGradient, gradientCss } from "../../Theme/tokens/builders/gradientInk.js";
6
6
  import { hexToRgb } from "../../Theme/tokens/builders/color.js";
7
7
  import { rafThrottle } from "../../Utils/rafThrottle.js";
8
8
  export default function ButtonGroupIcon({ leftIcon, rightIcon, onLeftIconClick, onRightIconClick, buttonText, onButtonClick, onButtongroupClick, size, variant, color, buttonGroupStyle, buttonGroupLeftIconStyle, buttonGroupRightIconStyle, buttonStyle, onBlurLeftIcon, onBlurRightIcon, dropdownOptions, // New prop for dropdown options
@@ -46,9 +46,9 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
46
46
  // keep the segments transparent (so it doesn't restart per button/icon), with a
47
47
  // translucent-white hover overlay for per-segment feedback.
48
48
  const isGradient = variant === "gradient";
49
- const gradientStops = theme.colors.gradient;
50
- const gradientBg = `linear-gradient(135deg, ${gradientStops.from} 0%, ${gradientStops.to} 100%)`;
51
- const gradientInk = onGradient(gradientStops.from, gradientStops.to, theme.colors.white, theme.colors.black);
49
+ const gradientStops = resolveGradient(theme.colors.gradient, theme.colors.white, theme.colors.black);
50
+ const gradientBg = gradientCss(gradientStops);
51
+ const gradientInk = gradientStops.ink;
52
52
  const whiteRgb = hexToRgb(theme.colors.white);
53
53
  const whiteOverlay = (alpha) => `rgba(${whiteRgb.r}, ${whiteRgb.g}, ${whiteRgb.b}, ${alpha})`;
54
54
  const gradientItemSx = isGradient
@@ -69,7 +69,7 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
69
69
  // this theme-swap app never triggers) — our `bg` prop above only recolors the list
70
70
  // itself, not the inherited var, so items fell back to white until hover/focus (which
71
71
  // our own sx already overrides). Setting the var here fixes the rest state too.
72
- sx: { "--menu-bg": theme.colors.backgroundColor.light }, border: "1px solid", borderColor: theme.colors.boxborder[500], borderRadius: "xl", boxShadow: "lg", py: "0.375rem", minW: "12rem", overflow: "hidden", children: dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option, index) => (_jsxs(MenuItem, { onClick: (event) => handleMenuClick(event, option), style: menuItemStyle, sx: {
72
+ sx: { "--menu-bg": theme.colors.backgroundColor.light }, borderRadius: "xl", boxShadow: "lg", py: "0.375rem", minW: "12rem", overflow: "hidden", children: dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option, index) => (_jsxs(MenuItem, { onClick: (event) => handleMenuClick(event, option), style: menuItemStyle, sx: {
73
73
  display: "flex",
74
74
  alignItems: "center",
75
75
  gap: "0.5rem",
@@ -87,7 +87,7 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
87
87
  mx: 0,
88
88
  borderRadius: "none",
89
89
  borderBottom: "1px solid",
90
- borderColor: theme.colors.boxborder[300],
90
+ borderColor: theme.colors.boxborder[200],
91
91
  }
92
92
  : {}),
93
93
  _hover: { bg: theme.colors.primary[50], color: theme.colors.primary[700] },
@@ -21,7 +21,7 @@ export default function CheckBox({ label, labelFontSize, showLabelTooltip, label
21
21
  ...labelSx,
22
22
  }
23
23
  : { ...labelSx };
24
- return (_jsxs(_Fragment, { children: [_jsx(ChakraCheckbox, { ...aria, onClick: onClick, spacing: spacing !== null && spacing !== void 0 ? spacing : "0.5rem", isInvalid: isInvalid, colorScheme: color, iconColor: iconColor, iconSize: iconSize, isChecked: isChecked, isIndeterminate: isIndeterminate, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.gray[500], display: "flex", alignItems: "center", sx: {
24
+ return (_jsxs(_Fragment, { children: [_jsx(ChakraCheckbox, { ...aria, onClick: onClick, spacing: spacing !== null && spacing !== void 0 ? spacing : "0.5rem", isInvalid: isInvalid, colorScheme: color, iconColor: iconColor, iconSize: iconSize, isChecked: isChecked, isIndeterminate: isIndeterminate, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.boxborder[500], display: "flex", alignItems: "center", sx: {
25
25
  ...sx,
26
26
  ".chakra-checkbox__control": { w: controlSize, h: controlSize },
27
27
  }, children: label && (showLabelTooltip ? (_jsx(ToolTip, { label: labelTooltip !== null && labelTooltip !== void 0 ? labelTooltip : label, hasArrow: true, placement: "top", fontSize: "0.75rem", children: _jsx(Box, { as: "span", sx: clampStyles, fontSize: labelFontSize !== null && labelFontSize !== void 0 ? labelFontSize : "0.8125rem", color: theme.colors.text[700], fontWeight: 500, ml: 0, children: label }) })) : (_jsx(Box, { as: "span", sx: clampStyles, fontSize: labelFontSize !== null && labelFontSize !== void 0 ? labelFontSize : "0.8125rem", color: theme.colors.text[700], fontWeight: 500, ml: 0, children: label }))) }), error && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
@@ -15,6 +15,8 @@ export const Checkbox = {
15
15
  height: "1.25rem",
16
16
  borderWidth: "1.6px",
17
17
  borderRadius: "base",
18
+ // Without a resting colour Chakra falls back to its own gray.500.
19
+ borderColor: theme.colors.boxborder[500],
18
20
  transition: "background 0.15s, border-color 0.15s, box-shadow 0.15s",
19
21
  _disabled: {
20
22
  bg: theme.colors.background[50],
@@ -11,7 +11,7 @@ export const FIELD_TRANSITION = "border-color 0.2s, box-shadow 0.2s";
11
11
  export const getFieldStateStyles = (theme, { error = false, focused = false } = {}) => {
12
12
  // [800], not [500]: WCAG 1.4.11 needs >=3.0 for a control boundary against any named surface
13
13
  // up to `muted` (lightest); [500] fails there, [800] clears all with margin.
14
- const idleBorder = theme.colors.boxborder[800];
14
+ const idleBorder = theme.colors.boxborder[500];
15
15
  const primary = theme.colors.primary[500];
16
16
  const errorColor = theme.colors.semanticText.error;
17
17
  const ringPrimary = theme.colors.boxShadow.primary;
@@ -34,7 +34,7 @@ const CopyButton = ({ value, variant = "icon", label = "Copy", copiedLabel = "Co
34
34
  if (variant === "button") {
35
35
  return (_jsxs(Flex, { as: "button", align: "center", gap: "6px", px: "12px", py: "6px", borderRadius: "lg", border: "1px solid",
36
36
  // [800], not [500]: a real control boundary needs >=3:1 on every surface up to `muted`.
37
- borderColor: copied ? success : theme.colors.boxborder[800], bg: "transparent", color: copied ? success : theme.colors.gray[700], fontSize: "14px", fontWeight: 500, transition: "all 0.15s ease", _hover: { borderColor: accent, color: accent }, onClick: handleCopy, children: [copied ? _jsx(Check, { size: iconSize }) : _jsx(Copy, { size: iconSize }), _jsx(Text, { children: copied ? copiedLabel : label })] }));
37
+ borderColor: copied ? success : theme.colors.boxborder[500], bg: "transparent", color: copied ? success : theme.colors.gray[700], fontSize: "14px", fontWeight: 500, transition: "all 0.15s ease", _hover: { borderColor: accent, color: accent }, onClick: handleCopy, children: [copied ? _jsx(Check, { size: iconSize }) : _jsx(Copy, { size: iconSize }), _jsx(Text, { children: copied ? copiedLabel : label })] }));
38
38
  }
39
39
  return (_jsx(ToolTip, { label: copied ? copiedLabel : tooltip, placement: "top", children: _jsx(IconButton, { "aria-label": tooltip, size: size, variant: "ghost", onClick: handleCopy, color: copied ? success : theme.colors.gray[500], _hover: { color: accent, bg: theme.colors.primary[50] }, icon: copied ? _jsx(Check, { size: iconSize }) : _jsx(Copy, { size: iconSize }) }) }));
40
40
  };
@@ -14,6 +14,6 @@ const EditModuleModal = ({ isOpen, onClose, initialName, isLoading, onSubmit, la
14
14
  // [200] is the decorative divider rung (~1.2:1, correct for the ModalHeader border
15
15
  // above) — a real control's resting outline needs 1.4.11's 3:1, which is what every
16
16
  // other input in this library (TextInput, NumberInput, DatePicker) reads from [800].
17
- borderColor: colors.boxborder[800], mb: 5 }), _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.update, onClick: () => onSubmit(name.trim()), colorScheme: "primary", size: "sm", isLoading: isLoading, isDisabled: !name.trim() })] })] })] })] }));
17
+ borderColor: colors.boxborder[500], mb: 5 }), _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.update, onClick: () => onSubmit(name.trim()), colorScheme: "primary", size: "sm", isLoading: isLoading, isDisabled: !name.trim() })] })] })] })] }));
18
18
  };
19
19
  export default EditModuleModal;
@@ -20,7 +20,7 @@ export const CalendarPanel = ({ currentMonth, setCurrentMonth, today, isRange, t
20
20
  const hasRange = !!(rangeStart && rangeEnd && !isSameDay(rangeStart, rangeEnd));
21
21
  const selectStyles = {
22
22
  border: "1px solid",
23
- // boxborder[500] is the control-outline rung the sibling pickers already use; boxborder[300]
23
+ // boxborder[500] is the control-outline rung the sibling pickers already use; boxborder[200]
24
24
  // is decorative and measured 1.85:1 on the dark canvas — the select read as borderless.
25
25
  borderColor: theme.colors.boxborder[500],
26
26
  borderRadius: "md",
@@ -172,7 +172,7 @@ export const RangeDatePicker = (props) => {
172
172
  : `0 0 0 1px ${theme.colors.primary[500]}`,
173
173
  }, _hover: {
174
174
  borderColor: error ? theme.colors.semanticText.error : undefined,
175
- }, cursor: "pointer" }), _jsx(InputRightElement, { height: "100%", display: "flex", alignItems: "center", pointerEvents: "auto", style: { cursor: "pointer" }, onClick: () => (isOpen ? onClose() : handleOpen()), children: _jsx(Box, { as: "span", sx: calendarIconWrapperSx, children: _jsx(CalendarIcon, { size: calendarIconPx, color: theme.colors.textMuted }) }) })] }) }) }), _jsx(PopoverContent, { w: "18rem", maxW: "18rem", p: 3, ref: popoverRef, boxShadow: "lg", borderRadius: "xl", border: "1px solid", borderColor: theme.colors.boxborder[500], bg: theme.colors.background[50], children: _jsxs(PopoverBody, { p: 0, children: [_jsx(Box, { display: "flex", flexWrap: "wrap", gap: 2, mb: 3, children: presets.map((p) => (_jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", sx: { flex: "1 1 auto" }, onClick: () => {
175
+ }, cursor: "pointer" }), _jsx(InputRightElement, { height: "100%", display: "flex", alignItems: "center", pointerEvents: "auto", style: { cursor: "pointer" }, onClick: () => (isOpen ? onClose() : handleOpen()), children: _jsx(Box, { as: "span", sx: calendarIconWrapperSx, children: _jsx(CalendarIcon, { size: calendarIconPx, color: theme.colors.textMuted }) }) })] }) }) }), _jsx(PopoverContent, { w: "18rem", maxW: "18rem", p: 3, ref: popoverRef, boxShadow: "lg", borderRadius: "xl", bg: theme.colors.background[50], children: _jsxs(PopoverBody, { p: 0, children: [_jsx(Box, { display: "flex", flexWrap: "wrap", gap: 2, mb: 3, children: presets.map((p) => (_jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", sx: { flex: "1 1 auto" }, onClick: () => {
176
176
  const [from, to] = p.getRange();
177
177
  applyPreset(from, to);
178
178
  }, children: p.label }, p.label))) }), _jsx(CalendarPanel, { currentMonth: currentMonth, setCurrentMonth: (updater) => setCurrentMonthState((prev) => updater(prev)), today: today, isRange: true, tempDate: null, tempRangeStart: tempRangeStart, tempRangeEnd: tempRangeEnd, hoveredDate: hoveredDate, onDayHover: setHoveredDate, isSameDay: isSameDay, isBefore: isBefore, isAfter: isAfter, minDate: minDate, maxDate: maxDate, disablePastDates: disablePastDates, disableFutureDates: disableFutureDates, disableToday: disableToday, onDaySelect: handleDaySelect }), formatHasTime && (_jsxs(Box, { mt: 3, display: "grid", gridTemplateColumns: "1fr", gap: 2, children: [_jsxs(Box, { children: [_jsx(Box, { fontSize: "xs", color: theme.colors.textMuted, mb: 1, children: "Start time" }), shouldUseSelectTimePicker ? (_jsx(TimePicker, { date: startTimeBaseDate, onChange: (updated) => {
@@ -201,6 +201,6 @@ export const RangeDatePicker = (props) => {
201
201
  return;
202
202
  }
203
203
  setTempRangeEnd(setTimeFrom(endTimeBaseDate, t));
204
- }, dateFormat: timePickerFormat, disabled: disabled || !tempRangeEnd, size: sizeKey }))] })] })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[300], children: [_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleClear, children: "Clear" }), _jsx(Button, { size: "sm", variant: "gradient", onClick: requestClose, children: "Apply" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
204
+ }, dateFormat: timePickerFormat, disabled: disabled || !tempRangeEnd, size: sizeKey }))] })] })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleClear, children: "Clear" }), _jsx(Button, { size: "sm", variant: "gradient", onClick: requestClose, children: "Apply" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
205
205
  };
206
206
  export default RangeDatePicker;
@@ -956,7 +956,7 @@ export const SingleDatePicker = (props) => {
956
956
  else {
957
957
  onClose();
958
958
  }
959
- }, style: { cursor: "pointer" }, children: _jsx(Box, { as: "span", sx: calendarIconWrapperSx, children: _jsx(CalendarIcon, { size: calendarIconPx, color: theme.colors.textMuted }) }) })] }) }) }), _jsx(PopoverContent, { width: "auto", p: 3, ref: popoverRef, boxShadow: "lg", borderRadius: "xl", border: "1px solid", borderColor: theme.colors.boxborder[500], bg: theme.colors.background[50], children: _jsxs(PopoverBody, { p: 0, children: [showDate && (_jsx(CalendarPanel, { currentMonth: currentMonth, setCurrentMonth: (updater) => setCurrentMonth((prev) => updater(prev)), today: today, isRange: false, tempDate: tempDate, tempRangeStart: null, tempRangeEnd: null, isSameDay: isSameDay, isBefore: isBefore, isAfter: isAfter, minDate: minDate, maxDate: maxDate, disablePastDates: disablePastDates, disableFutureDates: disableFutureDates, disableToday: disableToday, onDaySelect: handleDaySelect })), showTime && (_jsx(Box, { mt: showDate ? 3 : 0, children: resolvedPickerType === "time" ? (_jsx(TimePickerInput, { value: tempDate, onChange: (updatedDate) => {
959
+ }, style: { cursor: "pointer" }, children: _jsx(Box, { as: "span", sx: calendarIconWrapperSx, children: _jsx(CalendarIcon, { size: calendarIconPx, color: theme.colors.textMuted }) }) })] }) }) }), _jsx(PopoverContent, { width: "auto", p: 3, ref: popoverRef, boxShadow: "lg", borderRadius: "xl", bg: theme.colors.background[50], children: _jsxs(PopoverBody, { p: 0, children: [showDate && (_jsx(CalendarPanel, { currentMonth: currentMonth, setCurrentMonth: (updater) => setCurrentMonth((prev) => updater(prev)), today: today, isRange: false, tempDate: tempDate, tempRangeStart: null, tempRangeEnd: null, isSameDay: isSameDay, isBefore: isBefore, isAfter: isAfter, minDate: minDate, maxDate: maxDate, disablePastDates: disablePastDates, disableFutureDates: disableFutureDates, disableToday: disableToday, onDaySelect: handleDaySelect })), showTime && (_jsx(Box, { mt: showDate ? 3 : 0, children: resolvedPickerType === "time" ? (_jsx(TimePickerInput, { value: tempDate, onChange: (updatedDate) => {
960
960
  setTempDate(updatedDate);
961
961
  setInputValue(updatedDate ? format(updatedDate, resolvedDateFormat) : "");
962
962
  setIsTyping(false);
@@ -964,7 +964,7 @@ export const SingleDatePicker = (props) => {
964
964
  setTempDate(updatedDate);
965
965
  setInputValue(format(updatedDate, resolvedDateFormat));
966
966
  setIsTyping(false);
967
- }, disabled: disabled })) })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[300], children: [_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: () => {
967
+ }, disabled: disabled })) })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: () => {
968
968
  setTempDate(null);
969
969
  requestClose(null);
970
970
  }, children: "Clear" }), _jsx(Button, { size: "sm", variant: "gradient", onClick: () => requestClose(), children: "Apply" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
@@ -73,6 +73,6 @@ export const TimeOnlyPicker = (props) => {
73
73
  onOpen();
74
74
  }, error: error, size: sizeKey }) }) }) }), _jsx(PopoverContent, { width: "auto", p: 4, ref: popoverRef, boxShadow: "lg", bg: theme.colors.background[50], children: _jsxs(PopoverBody, { children: [_jsx(TimePicker, { date: resolvedTempDate, dateFormat: dateFormat, onChange: (updatedDate) => {
75
75
  handleTimePickerChange(updatedDate);
76
- } }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 4, pt: 4, borderTop: "1px solid", borderColor: theme.colors.boxborder[300], children: [_jsx(ChakraButton, { size: "sm", variant: "ghost", onClick: handleClear, children: "Clear" }), _jsx(ChakraButton, { size: "sm", colorScheme: "primary", onClick: handleOk, children: "OK" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
76
+ } }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 4, pt: 4, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(ChakraButton, { size: "sm", variant: "ghost", onClick: handleClear, children: "Clear" }), _jsx(ChakraButton, { size: "sm", colorScheme: "primary", onClick: handleOk, children: "OK" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
77
77
  };
78
78
  export default TimeOnlyPicker;
@@ -3,6 +3,7 @@ import { forwardRef, useCallback, useEffect, useId, useRef, useState } from "rea
3
3
  import { Box, Flex, Button, useDisclosure, List, ListItem, Portal, } from "@chakra-ui/react";
4
4
  import { motion } from "framer-motion";
5
5
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
+ import { scrollbarStyles } from "../../Theme/tokens/builders/scrollbar.js";
6
7
  import { ChevronDown } from "lucide-react";
7
8
  import { rafThrottle } from "../../Utils/rafThrottle.js";
8
9
  const MotionBox = motion(forwardRef((props, ref) => (_jsx(Box, { ref: ref, ...props }))));
@@ -211,18 +212,7 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
211
212
  };
212
213
  const DropdownContentRender = () => {
213
214
  var _a;
214
- return (_jsx(List, { id: menuId, role: "menu", onKeyDown: handleMenuKeyDown, bg: theme.colors.background[50], border: `0.063rem solid ${theme.colors.boxborder[200]}`, borderRadius: "xl", boxShadow: (_a = theme.shadows) === null || _a === void 0 ? void 0 : _a.lg, py: 1.5, mt: "0.375rem", minWidth: s.minW, maxH: "18rem", overflowY: "auto", overflowX: "hidden", sx: {
215
- scrollbarWidth: "thin",
216
- scrollbarColor: `${theme.colors.gray[300]} transparent`,
217
- "&::-webkit-scrollbar": { width: "6px" },
218
- "&::-webkit-scrollbar-thumb": {
219
- background: theme.colors.gray[300],
220
- borderRadius: "base",
221
- },
222
- "&::-webkit-scrollbar-thumb:hover": {
223
- background: theme.colors.gray[400],
224
- },
225
- }, style: ListStyle, children: options.map((option, index) => (_jsxs(ListItem, { ref: (node) => {
215
+ return (_jsx(List, { id: menuId, role: "menu", onKeyDown: handleMenuKeyDown, bg: theme.colors.background[50], border: `0.063rem solid ${theme.colors.boxborder[200]}`, borderRadius: "xl", boxShadow: (_a = theme.shadows) === null || _a === void 0 ? void 0 : _a.lg, py: 1.5, mt: "0.375rem", minWidth: s.minW, maxH: "18rem", overflowY: "auto", overflowX: "hidden", sx: scrollbarStyles(theme.colors, "overlay"), style: ListStyle, children: options.map((option, index) => (_jsxs(ListItem, { ref: (node) => {
226
216
  itemRefs.current[index] = node;
227
217
  }, role: "menuitem", tabIndex: index === activeIndex ? 0 : -1, onClick: () => {
228
218
  handleListItemClick(option.id, option.label);
@@ -234,7 +224,7 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
234
224
  bg: theme.colors.primary.opacity[8],
235
225
  color: theme.colors.accentText,
236
226
  }, borderBottom: divider
237
- ? `0.063rem solid ${theme.colors.boxborder[100]}`
227
+ ? `0.063rem solid ${theme.colors.boxborder[200]}`
238
228
  : undefined, sx: { "&:last-child": { borderBottom: "none" } }, style: ItemStyle, fontWeight: 500, children: [(option === null || option === void 0 ? void 0 : option.image) && (_jsx(Box, { as: option.image, boxSize: s.img, flexShrink: 0, color: theme.colors.textMuted, style: ImageStyle })), _jsx(Box, { as: "span", fontSize: s.fontSize, isTruncated: true,
239
229
  // fontWeight={400}
240
230
  style: LabelStyle, children: option.label })] }, option.id))) }));
@@ -8,7 +8,7 @@ export default function VerifyEmailOtp({ resendMail, onChange, onComplete, place
8
8
  // [800], not [300]: WCAG 1.4.11 needs >=3.0 for a control boundary against any
9
9
  // named surface up to `muted` (lightest); [300] fails there, [800] clears all
10
10
  // with margin.
11
- borderColor: theme.colors.boxborder[800], backgroundColor: theme.colors.background[200], _focus: {
11
+ borderColor: theme.colors.boxborder[500], backgroundColor: theme.colors.background[200], _focus: {
12
12
  borderColor: theme.colors.primary[500],
13
13
  boxShadow: `0 0 0 0.063rem ${theme.colors.primary[500]}`,
14
14
  } }, index))) }) }), _jsx(Flex, { justify: "center", children: _jsxs(Text, { fontSize: "sm", color: theme.colors.gray[600], children: ["Didn\u2019t receive the code?", " ", _jsx(Button, { variant: "link", color: theme.colors.accentText, fontWeight: "semibold", onClick: resendMail, children: "Resend Code" })] }) })] }));
@@ -64,7 +64,7 @@ export const FilePreview = ({ isOpen, onClose, fileUrl, fileName, fileType, hide
64
64
  , {
65
65
  // Chakra's default Modal drives its bg off `--modal-bg`, which flips to
66
66
  // `colors.gray.700` under `_dark` — a light grey in our derived dark palettes.
67
- bg: theme.colors.background[50], borderRadius: "2xl", overflow: "hidden", initial: { opacity: 0, scale: 0.96, y: 8 }, animate: { opacity: 1, scale: 1, y: 0 }, transition: { duration: 0.2, ease: "easeOut" }, children: [_jsxs(Flex, { align: "center", justify: "space-between", px: 4, py: 3, borderBottom: "1px solid", borderColor: theme.colors.boxborder[100], children: [_jsx(ToolTip, { label: fileName || "File", placement: "bottom", children: _jsx(Text, { fontSize: "sm", fontWeight: 600, maxW: "60%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: fileName || "Preview" }) }), _jsxs(Flex, { align: "center", gap: 1, children: [kind === "image" && (_jsxs(_Fragment, { children: [_jsx(ToolTip, { label: "Zoom out", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Zoom out", size: "sm", variant: "ghost", icon: _jsx(Minus, { size: 16 }), onClick: () => setZoom((z) => Math.max(0.25, z - 0.25)) }) }), _jsx(ToolTip, { label: "Zoom in", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Zoom in", size: "sm", variant: "ghost", icon: _jsx(Plus, { size: 16 }), onClick: () => setZoom((z) => Math.min(4, z + 0.25)) }) }), _jsx(ToolTip, { label: "Rotate", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Rotate", size: "sm", variant: "ghost", icon: _jsx(RotateCw, { size: 16 }), onClick: () => setRotation((r) => (r + 90) % 360) }) })] })), !hideDownload && (_jsx(ToolTip, { label: "Download", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Download", size: "sm", variant: "ghost", color: theme.colors.semanticText.success, icon: _jsx(Download, { size: 18 }), onClick: () => downloadFile(fileUrl, fileName) }) })), _jsx(ModalCloseButton, { position: "static" })] })] }), _jsx(ModalBody, { p: 5, children: renderBody() })] })] }));
67
+ bg: theme.colors.background[50], borderRadius: "2xl", overflow: "hidden", initial: { opacity: 0, scale: 0.96, y: 8 }, animate: { opacity: 1, scale: 1, y: 0 }, transition: { duration: 0.2, ease: "easeOut" }, children: [_jsxs(Flex, { align: "center", justify: "space-between", px: 4, py: 3, borderBottom: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(ToolTip, { label: fileName || "File", placement: "bottom", children: _jsx(Text, { fontSize: "sm", fontWeight: 600, maxW: "60%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: fileName || "Preview" }) }), _jsxs(Flex, { align: "center", gap: 1, children: [kind === "image" && (_jsxs(_Fragment, { children: [_jsx(ToolTip, { label: "Zoom out", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Zoom out", size: "sm", variant: "ghost", icon: _jsx(Minus, { size: 16 }), onClick: () => setZoom((z) => Math.max(0.25, z - 0.25)) }) }), _jsx(ToolTip, { label: "Zoom in", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Zoom in", size: "sm", variant: "ghost", icon: _jsx(Plus, { size: 16 }), onClick: () => setZoom((z) => Math.min(4, z + 0.25)) }) }), _jsx(ToolTip, { label: "Rotate", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Rotate", size: "sm", variant: "ghost", icon: _jsx(RotateCw, { size: 16 }), onClick: () => setRotation((r) => (r + 90) % 360) }) })] })), !hideDownload && (_jsx(ToolTip, { label: "Download", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Download", size: "sm", variant: "ghost", color: theme.colors.semanticText.success, icon: _jsx(Download, { size: 18 }), onClick: () => downloadFile(fileUrl, fileName) }) })), _jsx(ModalCloseButton, { position: "static" })] })] }), _jsx(ModalBody, { p: 5, children: renderBody() })] })] }));
68
68
  };
69
69
  /** Thumbnail with a hover "preview" affordance that opens {@link FilePreview}. */
70
70
  export const FilePreviewTrigger = ({ fileUrl, fileName, fileType, thumbWidth = "100px", thumbHeight = "60px", hideDownload = false, }) => {
@@ -144,13 +144,13 @@ panelPadding = 3, clearAllButton = true, onClearAllHandler,
144
144
  pointerEvents: 'none', // Allow clicks to pass through track
145
145
  zIndex: 3,
146
146
  margin: 0,
147
- } })] }), _jsxs(SimpleGrid, { columns: 2, spacing: 2, pt: 2, w: "full", children: [_jsxs(Popover, { isOpen: openPrice.id === section.id && openPrice.target === "min", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [_jsx(PopoverTrigger, { children: _jsx(Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.gray[50], borderColor: theme.colors.gray[300], cursor: "pointer", onClick: () => setOpenPrice({ id: section.id, target: "min" }), gap: 2, overflow: "hidden", children: _jsx(Box, { ml: "auto", children: _jsxs(Text, { fontSize: "12px", color: theme.colors.text[500], whiteSpace: "nowrap", children: [currentMin, range.unit ? ` ${range.unit}` : ""] }) }) }) }), _jsx(Portal, { children: _jsx(PopoverContent, { width: "6rem", p: 0, zIndex: 1600, bg: theme.colors.background[50], children: _jsx(PopoverBody, { p: 0, children: _jsx(VStack, { align: "stretch", spacing: 0, maxH: "12rem", overflowY: "auto", children: values.map((v) => (_jsxs(Flex, { px: 2, py: 1, align: "center", justify: "space-between", cursor: "pointer", bg: currentMin === v ? theme.colors.red[50] : theme.colors.background[50], borderLeftWidth: currentMin === v ? 3 : 0, borderLeftStyle: "solid", borderLeftColor: currentMin === v ? theme.colors.red[400] : "transparent", _hover: { bg: hoverBg }, onClick: () => {
147
+ } })] }), _jsxs(SimpleGrid, { columns: 2, spacing: 2, pt: 2, w: "full", children: [_jsxs(Popover, { isOpen: openPrice.id === section.id && openPrice.target === "min", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [_jsx(PopoverTrigger, { children: _jsx(Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.gray[50], borderColor: theme.colors.boxborder[500], cursor: "pointer", onClick: () => setOpenPrice({ id: section.id, target: "min" }), gap: 2, overflow: "hidden", children: _jsx(Box, { ml: "auto", children: _jsxs(Text, { fontSize: "12px", color: theme.colors.text[500], whiteSpace: "nowrap", children: [currentMin, range.unit ? ` ${range.unit}` : ""] }) }) }) }), _jsx(Portal, { children: _jsx(PopoverContent, { width: "6rem", p: 0, zIndex: 1600, bg: theme.colors.background[50], children: _jsx(PopoverBody, { p: 0, children: _jsx(VStack, { align: "stretch", spacing: 0, maxH: "12rem", overflowY: "auto", children: values.map((v) => (_jsxs(Flex, { px: 2, py: 1, align: "center", justify: "space-between", cursor: "pointer", bg: currentMin === v ? theme.colors.red[50] : theme.colors.background[50], borderLeftWidth: currentMin === v ? 3 : 0, borderLeftStyle: "solid", borderLeftColor: currentMin === v ? theme.colors.red[400] : "transparent", _hover: { bg: hoverBg }, onClick: () => {
148
148
  const min = v;
149
149
  const max = currentMax;
150
150
  const nextVal = [Math.min(min, max), Math.max(min, max)];
151
151
  setInternalSelected((prev) => { const next = { ...prev, [section.id]: nextVal }; onChange === null || onChange === void 0 ? void 0 : onChange(next); return next; });
152
152
  setOpenPrice({});
153
- }, children: [_jsxs(Text, { fontSize: "sm", color: theme.colors.gray[800], children: [v, range.unit ? ` ${range.unit}` : ""] }), currentMin === v ? (_jsx(Box, { bg: theme.colors.red[100], borderRadius: "full", p: 1, display: "flex", alignItems: "center", children: _jsx(Check, { size: 9, color: onFilled(theme.colors.red[100], theme.colors.white, theme.colors.black) }) })) : null] }, `min-${v}`))) }) }) }) })] }), _jsxs(Popover, { isOpen: openPrice.id === section.id && openPrice.target === "max", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [_jsx(PopoverTrigger, { children: _jsx(Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.gray[50], borderColor: theme.colors.gray[300], cursor: "pointer", onClick: () => setOpenPrice({ id: section.id, target: "max" }), gap: 2, overflow: "hidden", children: _jsx(Box, { ml: "auto", children: _jsxs(Text, { fontSize: "12px", color: theme.colors.text[500], whiteSpace: "nowrap", children: [currentMax, range.unit ? ` ${range.unit}` : ""] }) }) }) }), _jsx(PopoverContent, { width: "6rem", p: 0, bg: theme.colors.background[50], children: _jsx(PopoverBody, { p: 0, children: _jsx(VStack, { align: "stretch", spacing: 0, maxH: "12rem", overflowY: "auto", children: values.map((v) => (_jsxs(Flex, { px: 2, py: 1, align: "center", justify: "space-between", cursor: "pointer", bg: currentMax === v ? theme.colors.red[50] : theme.colors.background[50], borderLeftWidth: currentMax === v ? 3 : 0, borderLeftStyle: "solid", borderLeftColor: currentMax === v ? theme.colors.red[400] : "transparent", _hover: { bg: hoverBg }, onClick: () => {
153
+ }, children: [_jsxs(Text, { fontSize: "sm", color: theme.colors.gray[800], children: [v, range.unit ? ` ${range.unit}` : ""] }), currentMin === v ? (_jsx(Box, { bg: theme.colors.red[100], borderRadius: "full", p: 1, display: "flex", alignItems: "center", children: _jsx(Check, { size: 9, color: onFilled(theme.colors.red[100], theme.colors.white, theme.colors.black) }) })) : null] }, `min-${v}`))) }) }) }) })] }), _jsxs(Popover, { isOpen: openPrice.id === section.id && openPrice.target === "max", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [_jsx(PopoverTrigger, { children: _jsx(Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.gray[50], borderColor: theme.colors.boxborder[500], cursor: "pointer", onClick: () => setOpenPrice({ id: section.id, target: "max" }), gap: 2, overflow: "hidden", children: _jsx(Box, { ml: "auto", children: _jsxs(Text, { fontSize: "12px", color: theme.colors.text[500], whiteSpace: "nowrap", children: [currentMax, range.unit ? ` ${range.unit}` : ""] }) }) }) }), _jsx(PopoverContent, { width: "6rem", p: 0, bg: theme.colors.background[50], children: _jsx(PopoverBody, { p: 0, children: _jsx(VStack, { align: "stretch", spacing: 0, maxH: "12rem", overflowY: "auto", children: values.map((v) => (_jsxs(Flex, { px: 2, py: 1, align: "center", justify: "space-between", cursor: "pointer", bg: currentMax === v ? theme.colors.red[50] : theme.colors.background[50], borderLeftWidth: currentMax === v ? 3 : 0, borderLeftStyle: "solid", borderLeftColor: currentMax === v ? theme.colors.red[400] : "transparent", _hover: { bg: hoverBg }, onClick: () => {
154
154
  const max = v;
155
155
  const min = currentMin;
156
156
  const nextVal = [Math.min(min, max), Math.max(min, max)];
@@ -170,10 +170,10 @@ panelPadding = 3, clearAllButton = true, onClearAllHandler,
170
170
  const starColor = accentTextOnCanvas(theme.colors.orange, isRowSelected ? theme.colors.red[50] : theme.colors.background[50]);
171
171
  return Array.from({ length: 5 }, (_, i) => (_jsx(Box, { children: _jsx(Star, { size: 16, color: starColor, fill: i < r ? starColor : "none" }) }, `star-${r}-${i}`)));
172
172
  })() }), _jsx(Text, { fontSize: "sm", color: theme.colors.text[500], children: "& Up" })] }) }, `rating-${r}`))) })) : null, section.searchable && (_jsx(Input, { size: "xs", h: "26px", fontSize: "xs", placeholder: `Search ${section.label}...`, borderRadius: "md", bg: theme.colors.gray[50], border: "1px solid",
173
- // boxborder[800], not raw gray[200]: WCAG 1.4.11 needs >=3.0 for a control
173
+ // boxborder[500], not raw gray[200]: WCAG 1.4.11 needs >=3.0 for a control
174
174
  // boundary against any named surface up to `muted` (lightest); gray[200] fails
175
175
  // there in dark mode.
176
- borderColor: theme.colors.boxborder[800], _focus: { borderColor: theme.colors.red[400], boxShadow: "none" }, value: searchTerms[section.id] || "", onChange: (e) => {
176
+ borderColor: theme.colors.boxborder[500], _focus: { borderColor: theme.colors.red[400], boxShadow: "none" }, value: searchTerms[section.id] || "", onChange: (e) => {
177
177
  const v = e.target.value;
178
178
  setSearchTerms((prev) => ({ ...prev, [section.id]: v }));
179
179
  if (v)
@@ -3,6 +3,6 @@ import { Box, Icon } from "@chakra-ui/react";
3
3
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
4
4
  const FormWrapper = ({ icon, text, children, }) => {
5
5
  const { colors } = useCustomTheme();
6
- return (_jsxs(Box, { children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 2, children: [icon && _jsx(Icon, { as: icon, size: "1rem", color: colors.header[500] }), text && (_jsx(Box, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize: 12, lineHeight: "100%", letterSpacing: "4%", textTransform: "uppercase", color: colors.header[500], children: text }))] }), _jsx(Box, { borderRadius: "base", bg: colors.background[50], border: `0.075rem solid ${colors.border[500]}`, boxShadow: `0 0.063rem 0.125rem 0 ${colors.boxShadow.primary}`, p: "1.5rem", children: children })] }));
6
+ return (_jsxs(Box, { children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 2, children: [icon && _jsx(Icon, { as: icon, size: "1rem", color: colors.header[500] }), text && (_jsx(Box, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize: 12, lineHeight: "100%", letterSpacing: "4%", textTransform: "uppercase", color: colors.header[500], children: text }))] }), _jsx(Box, { borderRadius: "base", bg: colors.background[50], border: `0.075rem solid ${colors.boxborder[200]}`, boxShadow: `0 0.063rem 0.125rem 0 ${colors.boxShadow.primary}`, p: "1.5rem", children: children })] }));
7
7
  };
8
8
  export default FormWrapper;
@@ -3,21 +3,25 @@ import { Box, Text } from "@chakra-ui/react";
3
3
  import React from "react";
4
4
  import { CirclePlus, SquarePen } from "lucide-react";
5
5
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
- import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
6
+ import { AA_NORMAL_TEXT } from "../../Theme/tokens/builders/accentText.js";
7
+ import { AA_NON_TEXT, liftToContrast } from "../../Theme/tokens/builders/outlineRung.js";
7
8
  import Select from "../Select/Select.js";
8
9
  import VeritcalDivider from "../Divider/Divider.js";
9
- const HeaderActions = ({ select, edit, create, }) => {
10
+ const HeaderActions = ({ select, edit, create, surface, }) => {
10
11
  var _a, _b;
11
12
  const { colors } = useCustomTheme();
13
+ const canvas = surface !== null && surface !== void 0 ? surface : colors.backgroundColor.main;
14
+ const ink = liftToContrast(colors.secondary[500], canvas, AA_NORMAL_TEXT);
15
+ const iconInk = liftToContrast(colors.secondary[500], canvas, AA_NON_TEXT);
12
16
  const elements = [];
13
17
  if (select === null || select === void 0 ? void 0 : select.isSelect) {
14
18
  elements.push(_jsx(Box, { width: (_a = select.width) !== null && _a !== void 0 ? _a : "12.5rem", children: _jsx(Select, { options: (_b = select.options) !== null && _b !== void 0 ? _b : [], placeholder: select.selectPlaceholderText, onChange: (option) => { var _a; return (_a = select.onSelectChange) === null || _a === void 0 ? void 0 : _a.call(select, option); }, value: select.value }, "select") }, "select"));
15
19
  }
16
20
  if (edit === null || edit === void 0 ? void 0 : edit.isEditable) {
17
- elements.push(_jsxs(Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = edit.onEdit) === null || _a === void 0 ? void 0 : _a.call(edit); }, children: [_jsx(SquarePen, { size: 16, color: colors.text[500] }), _jsx(Text, { color: accentTextOnCanvas(colors.secondary, colors.backgroundColor.main), children: edit.label ? edit.label : "Edit Layout" })] }, "edit"));
21
+ elements.push(_jsxs(Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = edit.onEdit) === null || _a === void 0 ? void 0 : _a.call(edit); }, children: [_jsx(SquarePen, { size: 16, color: iconInk }), _jsx(Text, { color: ink, children: edit.label ? edit.label : "Edit Layout" })] }, "edit"));
18
22
  }
19
23
  if (create === null || create === void 0 ? void 0 : create.isCreatable) {
20
- elements.push(_jsxs(Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = create.onCreate) === null || _a === void 0 ? void 0 : _a.call(create); }, children: [_jsx(CirclePlus, { size: 16, color: colors.text[500] }), _jsxs(Text, { color: accentTextOnCanvas(colors.secondary, colors.backgroundColor.main), children: [" ", create.label ? create.label : "Create New", " "] })] }, "create"));
24
+ elements.push(_jsxs(Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = create.onCreate) === null || _a === void 0 ? void 0 : _a.call(create); }, children: [_jsx(CirclePlus, { size: 16, color: iconInk }), _jsxs(Text, { color: ink, children: [" ", create.label ? create.label : "Create New", " "] })] }, "create"));
21
25
  }
22
26
  return (_jsx(Box, { display: "flex", alignItems: "center", gap: "0.625rem", children: elements.map((el, i) => (_jsxs(React.Fragment, { children: [i > 0 && _jsx(VeritcalDivider, {}), el] }, i))) }));
23
27
  };
@@ -1,5 +1,6 @@
1
+ import { placeholderInk } from "../../Theme/tokens/builders/placeholderInk.js";
1
2
  export const Input = {
2
- baseStyle: {
3
+ baseStyle: ({ theme }) => ({
3
4
  field: {
4
5
  fontWeight: 500,
5
6
  fontSize: "0.875rem",
@@ -10,11 +11,12 @@ export const Input = {
10
11
  alignItems: "center",
11
12
  borderRadius: "lg",
12
13
  transition: "border-color 0.2s, box-shadow 0.2s",
14
+ // Every variant inherits the hint ink; only `outline` used to set it.
13
15
  _placeholder: {
14
- fontStyle: "italic",
16
+ color: placeholderInk(theme.colors),
15
17
  },
16
18
  },
17
- },
19
+ }),
18
20
  sizes: {
19
21
  sm: {
20
22
  field: {
@@ -49,7 +51,7 @@ export const Input = {
49
51
  border: "0.063rem solid",
50
52
  borderColor,
51
53
  _placeholder: {
52
- color: theme.colors.textMuted,
54
+ color: placeholderInk(theme.colors),
53
55
  },
54
56
  _hover: {
55
57
  borderColor: primary,
@@ -1,5 +1,6 @@
1
+ import { placeholderInk } from "../../Theme/tokens/builders/placeholderInk.js";
1
2
  export const Textarea = {
2
- baseStyle: {
3
+ baseStyle: ({ theme }) => ({
3
4
  fontWeight: 500,
4
5
  fontSize: "0.875rem",
5
6
  letterSpacing: "0.044rem",
@@ -8,9 +9,9 @@ export const Textarea = {
8
9
  borderRadius: "lg",
9
10
  transition: "border-color 0.2s, box-shadow 0.2s",
10
11
  _placeholder: {
11
- fontStyle: "italic",
12
+ color: placeholderInk(theme.colors),
12
13
  },
13
- },
14
+ }),
14
15
  sizes: {
15
16
  md: {
16
17
  fontSize: "0.875rem",
@@ -30,7 +31,7 @@ export const Textarea = {
30
31
  borderColor,
31
32
  bg: theme.colors.gray[50],
32
33
  _placeholder: {
33
- color: theme.colors.textMuted,
34
+ color: placeholderInk(theme.colors),
34
35
  },
35
36
  _hover: {
36
37
  borderColor: primary,
@@ -5,6 +5,7 @@ import { DragDropContext, Droppable, Draggable, } from "@hello-pangea/dnd";
5
5
  import { Plus, Trash2, GripVertical, ChevronLeft, ChevronRight } from "lucide-react";
6
6
  import { VariableSizeList as List, } from "react-window";
7
7
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
8
+ import { scrollbarStyles } from "../../Theme/tokens/builders/scrollbar.js";
8
9
  import { useGetPreferences, useSavePreferences, } from "../../Hooks/usePreferences.js";
9
10
  import AccountCard from "./AccountCard.js";
10
11
  import HeaderActions from "../Header/HeaderActions.js";
@@ -364,37 +365,15 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
364
365
  : colors.boxborder[200]}`, transition: "background 0.15s ease, border-color 0.15s ease, width 0.2s ease", display: "flex", flexDirection: "column", flexShrink: 0, overflow: isColCollapsed ? "visible" : "hidden", height: `${containerHeight - 60}px`, onMouseEnter: () => setHoveredColumn(colId), onMouseLeave: () => setHoveredColumn(null), children: [isColCollapsed ? (_jsxs(Flex, { direction: "column", align: "stretch", flex: "1", width: "100%", minH: 0, overflow: "visible", position: "relative", children: [_jsxs(Flex, { as: "header", direction: "column", align: "center", flexShrink: 0, width: "100%", py: 3, px: 1, gap: 3, borderTop: "0.25rem solid", borderTopColor: (_a = column.color) !== null && _a !== void 0 ? _a : colors.primary[500], bg: colors.background[100], position: "relative", zIndex: 1, children: [enableColumnReorder && columnDragHandleProps ? (_jsx(Flex, { align: "center", justify: "center", flexShrink: 0, cursor: "grab", ...columnDragHandleProps, children: _jsx(Box, { as: GripVertical, size: 14, color: colors.textMuted }) })) : null, enableColumnCollapse && (_jsx(Flex, { flexShrink: 0, w: "100%", justify: "center", bg: colors.background[100], position: "relative", zIndex: 3, children: _jsx(IconButton, { "aria-label": "Expand column", icon: _jsx(ChevronRight, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", onClick: () => toggleColumnCollapsed(colId) }) })), _jsx(Text, { as: "span", fontWeight: "700", fontSize: "0.75rem", color: colors.text[700], sx: {
365
366
  writingMode: "vertical-rl",
366
367
  textOrientation: "mixed",
367
- }, maxH: `${Math.max(120, containerHeight - 200)}px`, overflow: "hidden", lineHeight: "1.2", title: column.title, children: column.title }), _jsx(Badge, { minW: "1.25rem", h: "1.25rem", borderRadius: "full", border: "1px solid", borderColor: colors.boxborder[200], display: "flex", backgroundColor: colors.background[100], alignItems: "center", justifyContent: "center", color: colors.text[900], fontWeight: 600, fontSize: "10px", children: (_b = column === null || column === void 0 ? void 0 : column.items) === null || _b === void 0 ? void 0 : _b.length })] }), column.customNode ? (_jsx(Box, { flexShrink: 0, minH: COLLAPSED_CUSTOM_NODE_TOP_RESERVE, w: "100%", bg: colors.background[100], "aria-hidden": true })) : null, column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", flex: "1", minH: 0, w: "100%", overflow: "visible", py: 2, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "flex-start", bg: colors.background[100], position: "relative", zIndex: 2, children: _jsx(Box, { position: "relative", transform: "rotate(90deg)", transformOrigin: "center center", marginTop: '1rem', children: _jsx(VStack, { align: "stretch", spacing: 1, minW: "max-content", fontSize: "xs", color: colors.text[600], children: column.customNode() }) }) })) : (_jsx(Box, { flex: "1", minH: 0 }))] })) : (_jsxs(Flex, { width: "100%", h: !isColCollapsed && !!((_c = column.customNode) === null || _c === void 0 ? void 0 : _c.call(column)) ? "auto" : "2.75rem", align: !isColCollapsed && !!((_d = column.customNode) === null || _d === void 0 ? void 0 : _d.call(column)) ? "flex-start" : "center", px: 3, py: 2, flexShrink: 0, justifyContent: "space-between", position: "relative", gap: 2, borderBottom: `0.063rem solid ${colors.boxborder[100]}`, children: [_jsxs(Flex, { direction: "column", gap: 1, minW: 0, flex: "1", children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(Box, { boxSize: "0.625rem", borderRadius: "full", bg: (_e = column.color) !== null && _e !== void 0 ? _e : colors.primary[500], flexShrink: 0 }), enableColumnReorder && columnDragHandleProps ? (_jsx(Flex, { align: "center", justify: "center", flexShrink: 0, cursor: "grab", ...columnDragHandleProps, children: _jsx(Box, { as: GripVertical, size: 14, color: colors.textMuted }) })) : null, _jsx(Text, { as: "span", fontWeight: "600", fontSize: "0.875rem", color: colors.text[700], noOfLines: 1, minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", children: column.title }) })] }), column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", width: "100%", flexShrink: 0, fontSize: "xs", color: colors.text[600], children: (_f = column.customNode) === null || _f === void 0 ? void 0 : _f.call(column) })) : null] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(Badge, { minW: "1.5rem", h: "1.5rem", px: 2, borderRadius: "full", backgroundColor: colors.gray[100], display: "flex", alignItems: "center", justifyContent: "center", color: colors.text[700], fontWeight: 600, fontSize: "0.625rem", children: (_g = column === null || column === void 0 ? void 0 : column.items) === null || _g === void 0 ? void 0 : _g.length }), enableColumnCollapse && (_jsx(IconButton, { "aria-label": "Collapse column", icon: _jsx(ChevronLeft, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", flexShrink: 0, onClick: () => toggleColumnCollapsed(colId) })), canDelete &&
368
+ }, maxH: `${Math.max(120, containerHeight - 200)}px`, overflow: "hidden", lineHeight: "1.2", title: column.title, children: column.title }), _jsx(Badge, { minW: "1.25rem", h: "1.25rem", borderRadius: "full", border: "1px solid", borderColor: colors.boxborder[200], display: "flex", backgroundColor: colors.background[100], alignItems: "center", justifyContent: "center", color: colors.text[900], fontWeight: 600, fontSize: "10px", children: (_b = column === null || column === void 0 ? void 0 : column.items) === null || _b === void 0 ? void 0 : _b.length })] }), column.customNode ? (_jsx(Box, { flexShrink: 0, minH: COLLAPSED_CUSTOM_NODE_TOP_RESERVE, w: "100%", bg: colors.background[100], "aria-hidden": true })) : null, column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", flex: "1", minH: 0, w: "100%", overflow: "visible", py: 2, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "flex-start", bg: colors.background[100], position: "relative", zIndex: 2, children: _jsx(Box, { position: "relative", transform: "rotate(90deg)", transformOrigin: "center center", marginTop: '1rem', children: _jsx(VStack, { align: "stretch", spacing: 1, minW: "max-content", fontSize: "xs", color: colors.text[600], children: column.customNode() }) }) })) : (_jsx(Box, { flex: "1", minH: 0 }))] })) : (_jsxs(Flex, { width: "100%", h: !isColCollapsed && !!((_c = column.customNode) === null || _c === void 0 ? void 0 : _c.call(column)) ? "auto" : "2.75rem", align: !isColCollapsed && !!((_d = column.customNode) === null || _d === void 0 ? void 0 : _d.call(column)) ? "flex-start" : "center", px: 3, py: 2, flexShrink: 0, justifyContent: "space-between", position: "relative", gap: 2, borderBottom: `0.063rem solid ${colors.boxborder[200]}`, children: [_jsxs(Flex, { direction: "column", gap: 1, minW: 0, flex: "1", children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(Box, { boxSize: "0.625rem", borderRadius: "full", bg: (_e = column.color) !== null && _e !== void 0 ? _e : colors.primary[500], flexShrink: 0 }), enableColumnReorder && columnDragHandleProps ? (_jsx(Flex, { align: "center", justify: "center", flexShrink: 0, cursor: "grab", ...columnDragHandleProps, children: _jsx(Box, { as: GripVertical, size: 14, color: colors.textMuted }) })) : null, _jsx(Text, { as: "span", fontWeight: "600", fontSize: "0.875rem", color: colors.text[700], noOfLines: 1, minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", children: column.title }) })] }), column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", width: "100%", flexShrink: 0, fontSize: "xs", color: colors.text[600], children: (_f = column.customNode) === null || _f === void 0 ? void 0 : _f.call(column) })) : null] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(Badge, { minW: "1.5rem", h: "1.5rem", px: 2, borderRadius: "full", backgroundColor: colors.gray[100], display: "flex", alignItems: "center", justifyContent: "center", color: colors.text[700], fontWeight: 600, fontSize: "0.625rem", children: (_g = column === null || column === void 0 ? void 0 : column.items) === null || _g === void 0 ? void 0 : _g.length }), enableColumnCollapse && (_jsx(IconButton, { "aria-label": "Collapse column", icon: _jsx(ChevronLeft, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", flexShrink: 0, onClick: () => toggleColumnCollapsed(colId) })), canDelete &&
368
369
  hoveredColumn === colId &&
369
370
  column.items.length > 0 && (_jsx(Box, { as: Trash2, size: 16, cursor: "pointer", color: colors.text[600], _hover: { color: colors.semanticText.error }, onClick: () => handleColumnDelete(colId), transition: "color 0.2s ease", flexShrink: 0 })), !(canDelete &&
370
371
  hoveredColumn === colId &&
371
372
  column.items.length > 0) && _jsx(Box, { width: "16px", height: "16px", flexShrink: 0 })] })] })), !isColCollapsed && (_jsxs(Box, { px: 2, flex: "1", overflowY: "auto", width: "100%", sx: {
373
+ ...scrollbarStyles(colors),
372
374
  overflowY: "auto",
373
375
  overflowX: "hidden",
374
- scrollbarWidth: "thin",
375
- scrollbarColor: `${colors.gray[300]} transparent`,
376
- "&::-webkit-scrollbar": {
377
- width: "6px !important",
378
- height: "6px !important",
379
- },
380
- "&::-webkit-scrollbar-track": {
381
- background: colors.gray[100],
382
- borderRadius: "base",
383
- marginTop: "4px",
384
- marginBottom: "4px",
385
- },
386
- "&::-webkit-scrollbar-thumb": {
387
- background: colors.gray[300],
388
- borderRadius: "base",
389
- border: "1px solid",
390
- borderColor: colors.gray[100],
391
- },
392
- "&::-webkit-scrollbar-thumb:hover": {
393
- background: colors.gray[400],
394
- },
395
- "&": {
396
- scrollbarGutter: "stable both-edges",
397
- },
376
+ "&": { scrollbarGutter: "stable both-edges" },
398
377
  cursor: canDrag ? "grab" : "not-allowed",
399
378
  }, children: [(noItems === null || noItems === void 0 ? void 0 : noItems.isVisible) && column.items.length === 0 && (_jsx(NoItemsTemplate, { column: column, noItems: noItems, colors: colors })), virtualization ? (_jsx(List, { ref: (el) => {
400
379
  if (el)
@@ -409,26 +388,7 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
409
388
  return null;
410
389
  const showAddColumn = Boolean(customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.isVisible);
411
390
  const hasAnyColumns = Object.keys(columns).length > 0;
412
- const flexScrollSx = {
413
- "&::-webkit-scrollbar": {
414
- height: "6px",
415
- },
416
- "&::-webkit-scrollbar-track": {
417
- background: colors.gray[100],
418
- borderRadius: "base",
419
- margin: "0 4px",
420
- },
421
- "&::-webkit-scrollbar-thumb": {
422
- background: colors.gray[400],
423
- borderRadius: "base",
424
- border: `1px solid ${colors.gray[100]}`,
425
- },
426
- "&::-webkit-scrollbar-thumb:hover": {
427
- background: colors.gray[500],
428
- },
429
- scrollbarWidth: "thin",
430
- scrollbarColor: `${colors.gray[400]} ${colors.gray[100]}`,
431
- };
391
+ const flexScrollSx = scrollbarStyles(colors);
432
392
  const addColumnBox = !isBoardLoading && showAddColumn && hasAnyColumns && (_jsx(Box, { width: columnWidth, borderRadius: "lg", border: `0.125rem dashed ${colors.boxborder[500]}`, bg: colors.background[100], flexShrink: 0, height: `${containerHeight - 60}px`, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", _hover: { borderColor: colors.primary[500] }, onClick: () => { var _a; return (_a = customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.onAddColumn) === null || _a === void 0 ? void 0 : _a.call(customizeColumn); }, children: _jsxs(Flex, { direction: "column", align: "center", gap: 2, children: [_jsx(Box, { as: Plus, size: 20, color: colors.text[700] }), _jsx(Text, { fontSize: "sm", color: colors.text[600], children: (customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.buttonText) || "Add column" })] }) }));
433
393
  const columnsList = Object.entries(columns).map(([colId, column], colIndex) => {
434
394
  const isColCollapsed = enableColumnCollapse && Boolean(collapsedColumns[colId]);