pixelize-design-library 2.3.22 → 2.3.25

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 (190) hide show
  1. package/dist/Assets/defaultLogo.tsx +30 -0
  2. package/dist/Components/Accordion/accordionColors.d.ts +6 -0
  3. package/dist/Components/Accordion/accordionColors.d.ts.map +1 -0
  4. package/dist/Components/Accordion/accordionColors.js +20 -0
  5. package/dist/Components/Editor/joditThemeVars.d.ts +21 -0
  6. package/dist/Components/Editor/joditThemeVars.d.ts.map +1 -0
  7. package/dist/Components/Editor/joditThemeVars.js +70 -0
  8. package/dist/Components/FilterSidebar/filterHoverStyle.d.ts +12 -0
  9. package/dist/Components/FilterSidebar/filterHoverStyle.d.ts.map +1 -0
  10. package/dist/Components/FilterSidebar/filterHoverStyle.js +14 -0
  11. package/dist/Components/OrganizationDetails/CreateOrgModal.js +6 -4
  12. package/dist/Components/OrganizationDetails/OrganizationDetails.d.ts.map +1 -1
  13. package/dist/Components/OrganizationDetails/OrganizationDetails.js +55 -7
  14. package/dist/Components/OrganizationDetails/OrganizationDetailsProps.d.ts +24 -14
  15. package/dist/Components/OrganizationDetails/OrganizationDetailsProps.d.ts.map +1 -1
  16. package/dist/Components/SelectV2/SelectV2.d.ts +3 -0
  17. package/dist/Components/SelectV2/SelectV2.d.ts.map +1 -0
  18. package/dist/Components/SelectV2/SelectV2.js +185 -0
  19. package/dist/Components/SelectV2/SelectV2Props.d.ts +67 -0
  20. package/dist/Components/SelectV2/SelectV2Props.d.ts.map +1 -0
  21. package/dist/Components/SelectV2/SelectV2Props.js +2 -0
  22. package/dist/Components/SideBar/sidebarAccentColors.d.ts +21 -0
  23. package/dist/Components/SideBar/sidebarAccentColors.d.ts.map +1 -0
  24. package/dist/Components/SideBar/sidebarAccentColors.js +36 -0
  25. package/dist/Components/Table/components/tableRowHoverStyle.d.ts +13 -0
  26. package/dist/Components/Table/components/tableRowHoverStyle.d.ts.map +1 -0
  27. package/dist/Components/Table/components/tableRowHoverStyle.js +26 -0
  28. package/dist/Theme/chakra/Avatar.styles.d.ts +33 -0
  29. package/dist/Theme/chakra/Avatar.styles.d.ts.map +1 -0
  30. package/dist/Theme/chakra/Avatar.styles.js +28 -0
  31. package/dist/Theme/chakra/Drawer.styles.d.ts +32 -0
  32. package/dist/Theme/chakra/Drawer.styles.d.ts.map +1 -0
  33. package/dist/Theme/chakra/Drawer.styles.js +26 -0
  34. package/dist/Theme/chakra/Menu.styles.d.ts +70 -0
  35. package/dist/Theme/chakra/Menu.styles.d.ts.map +1 -0
  36. package/dist/Theme/chakra/Menu.styles.js +50 -0
  37. package/dist/Theme/chakra/Modal.styles.d.ts +32 -0
  38. package/dist/Theme/chakra/Modal.styles.d.ts.map +1 -0
  39. package/dist/Theme/chakra/Modal.styles.js +26 -0
  40. package/dist/Theme/chakra/Popover.styles.d.ts +37 -0
  41. package/dist/Theme/chakra/Popover.styles.d.ts.map +1 -0
  42. package/dist/Theme/chakra/Popover.styles.js +30 -0
  43. package/dist/Theme/chakra/Slider.styles.d.ts +31 -0
  44. package/dist/Theme/chakra/Slider.styles.d.ts.map +1 -0
  45. package/dist/Theme/chakra/Slider.styles.js +25 -0
  46. package/dist/Theme/chakra/Switch.styles.d.ts +31 -0
  47. package/dist/Theme/chakra/Switch.styles.d.ts.map +1 -0
  48. package/dist/Theme/chakra/Switch.styles.js +24 -0
  49. package/dist/Theme/chakra/Tabs.styles.d.ts +43 -0
  50. package/dist/Theme/chakra/Tabs.styles.d.ts.map +1 -0
  51. package/dist/Theme/chakra/Tabs.styles.js +41 -0
  52. package/dist/Theme/chakra/common.web.d.ts +171 -0
  53. package/dist/Theme/chakra/common.web.d.ts.map +1 -0
  54. package/dist/Theme/chakra/common.web.js +21 -0
  55. package/dist/Theme/chakra/componentStyles.d.ts +240 -0
  56. package/dist/Theme/chakra/componentStyles.d.ts.map +1 -0
  57. package/dist/Theme/chakra/componentStyles.js +150 -0
  58. package/dist/Theme/chakra/createBrandTheme.d.ts +18 -0
  59. package/dist/Theme/chakra/createBrandTheme.d.ts.map +1 -0
  60. package/dist/Theme/chakra/createBrandTheme.js +78 -0
  61. package/dist/Theme/chakra/fonts.web.d.ts +42 -0
  62. package/dist/Theme/chakra/fonts.web.d.ts.map +1 -0
  63. package/dist/Theme/chakra/fonts.web.js +15 -0
  64. package/dist/Theme/provider/PixelizeThemeProvider.d.ts +46 -0
  65. package/dist/Theme/provider/PixelizeThemeProvider.d.ts.map +1 -0
  66. package/dist/Theme/provider/PixelizeThemeProvider.js +124 -0
  67. package/dist/Theme/provider/ThemeSwitcher.d.ts +8 -0
  68. package/dist/Theme/provider/ThemeSwitcher.d.ts.map +1 -0
  69. package/dist/Theme/provider/ThemeSwitcher.js +111 -0
  70. package/dist/Theme/provider/colorModeStorage.d.ts +10 -0
  71. package/dist/Theme/provider/colorModeStorage.d.ts.map +1 -0
  72. package/dist/Theme/provider/colorModeStorage.js +106 -0
  73. package/dist/Theme/provider/index.d.ts +6 -0
  74. package/dist/Theme/provider/index.d.ts.map +1 -0
  75. package/dist/Theme/provider/index.js +9 -0
  76. package/dist/Theme/provider/useThemeMode.d.ts +3 -0
  77. package/dist/Theme/provider/useThemeMode.d.ts.map +1 -0
  78. package/dist/Theme/provider/useThemeMode.js +13 -0
  79. package/dist/Theme/tokens/brands/emerald/palette.dark.d.ts +7 -0
  80. package/dist/Theme/tokens/brands/emerald/palette.dark.d.ts.map +1 -0
  81. package/dist/Theme/tokens/brands/emerald/palette.dark.js +13 -0
  82. package/dist/Theme/tokens/brands/emerald/palette.light.d.ts +375 -0
  83. package/dist/Theme/tokens/brands/emerald/palette.light.d.ts.map +1 -0
  84. package/dist/Theme/tokens/brands/emerald/palette.light.js +135 -0
  85. package/dist/Theme/tokens/brands/index.d.ts +28 -0
  86. package/dist/Theme/tokens/brands/index.d.ts.map +1 -0
  87. package/dist/Theme/tokens/brands/index.js +93 -0
  88. package/dist/Theme/tokens/brands/lavender/palette.dark.d.ts +7 -0
  89. package/dist/Theme/tokens/brands/lavender/palette.dark.d.ts.map +1 -0
  90. package/dist/Theme/tokens/brands/lavender/palette.dark.js +13 -0
  91. package/dist/Theme/tokens/brands/lavender/palette.light.d.ts +375 -0
  92. package/dist/Theme/tokens/brands/lavender/palette.light.d.ts.map +1 -0
  93. package/dist/Theme/tokens/brands/lavender/palette.light.js +316 -0
  94. package/dist/Theme/tokens/brands/meadow/palette.dark.d.ts +7 -0
  95. package/dist/Theme/tokens/brands/meadow/palette.dark.d.ts.map +1 -0
  96. package/dist/Theme/tokens/brands/meadow/palette.dark.js +13 -0
  97. package/dist/Theme/tokens/brands/meadow/palette.light.d.ts +375 -0
  98. package/dist/Theme/tokens/brands/meadow/palette.light.d.ts.map +1 -0
  99. package/dist/Theme/tokens/brands/meadow/palette.light.js +133 -0
  100. package/dist/Theme/tokens/brands/radiant/palette.dark.d.ts +7 -0
  101. package/dist/Theme/tokens/brands/radiant/palette.dark.d.ts.map +1 -0
  102. package/dist/Theme/tokens/brands/radiant/palette.dark.js +13 -0
  103. package/dist/Theme/tokens/brands/radiant/palette.light.d.ts +375 -0
  104. package/dist/Theme/tokens/brands/radiant/palette.light.d.ts.map +1 -0
  105. package/dist/Theme/tokens/brands/radiant/palette.light.js +135 -0
  106. package/dist/Theme/tokens/brands/rosewood/palette.dark.d.ts +7 -0
  107. package/dist/Theme/tokens/brands/rosewood/palette.dark.d.ts.map +1 -0
  108. package/dist/Theme/tokens/brands/rosewood/palette.dark.js +13 -0
  109. package/dist/Theme/tokens/brands/rosewood/palette.light.d.ts +375 -0
  110. package/dist/Theme/tokens/brands/rosewood/palette.light.d.ts.map +1 -0
  111. package/dist/Theme/tokens/brands/rosewood/palette.light.js +139 -0
  112. package/dist/Theme/tokens/brands/skyline/palette.dark.d.ts +7 -0
  113. package/dist/Theme/tokens/brands/skyline/palette.dark.d.ts.map +1 -0
  114. package/dist/Theme/tokens/brands/skyline/palette.dark.js +13 -0
  115. package/dist/Theme/tokens/brands/skyline/palette.light.d.ts +375 -0
  116. package/dist/Theme/tokens/brands/skyline/palette.light.d.ts.map +1 -0
  117. package/dist/Theme/tokens/brands/skyline/palette.light.js +133 -0
  118. package/dist/Theme/tokens/brands/slate/palette.dark.d.ts +7 -0
  119. package/dist/Theme/tokens/brands/slate/palette.dark.d.ts.map +1 -0
  120. package/dist/Theme/tokens/brands/slate/palette.dark.js +13 -0
  121. package/dist/Theme/tokens/brands/slate/palette.light.d.ts +375 -0
  122. package/dist/Theme/tokens/brands/slate/palette.light.d.ts.map +1 -0
  123. package/dist/Theme/tokens/brands/slate/palette.light.js +137 -0
  124. package/dist/Theme/tokens/brands/storefront/palette.dark.d.ts +7 -0
  125. package/dist/Theme/tokens/brands/storefront/palette.dark.d.ts.map +1 -0
  126. package/dist/Theme/tokens/brands/storefront/palette.dark.js +13 -0
  127. package/dist/Theme/tokens/brands/storefront/palette.light.d.ts +375 -0
  128. package/dist/Theme/tokens/brands/storefront/palette.light.d.ts.map +1 -0
  129. package/dist/Theme/tokens/brands/storefront/palette.light.js +127 -0
  130. package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +204 -0
  131. package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts.map +1 -0
  132. package/dist/Theme/tokens/brands/zinc/palette.dark.js +204 -0
  133. package/dist/Theme/tokens/brands/zinc/palette.light.d.ts +375 -0
  134. package/dist/Theme/tokens/brands/zinc/palette.light.d.ts.map +1 -0
  135. package/dist/Theme/tokens/brands/zinc/palette.light.js +383 -0
  136. package/dist/Theme/tokens/builders/accentText.d.ts +56 -0
  137. package/dist/Theme/tokens/builders/accentText.d.ts.map +1 -0
  138. package/dist/Theme/tokens/builders/accentText.js +92 -0
  139. package/dist/Theme/tokens/builders/buildBrandTokens.d.ts +16 -0
  140. package/dist/Theme/tokens/builders/buildBrandTokens.d.ts.map +1 -0
  141. package/dist/Theme/tokens/builders/buildBrandTokens.js +33 -0
  142. package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +23 -0
  143. package/dist/Theme/tokens/builders/buildDarkPalette.d.ts.map +1 -0
  144. package/dist/Theme/tokens/builders/buildDarkPalette.js +282 -0
  145. package/dist/Theme/tokens/builders/chartColorsFromTheme.d.ts +17 -0
  146. package/dist/Theme/tokens/builders/chartColorsFromTheme.d.ts.map +1 -0
  147. package/dist/Theme/tokens/builders/chartColorsFromTheme.js +26 -0
  148. package/dist/Theme/tokens/builders/color.d.ts +50 -0
  149. package/dist/Theme/tokens/builders/color.d.ts.map +1 -0
  150. package/dist/Theme/tokens/builders/color.js +156 -0
  151. package/dist/Theme/tokens/builders/index.d.ts +6 -0
  152. package/dist/Theme/tokens/builders/index.d.ts.map +1 -0
  153. package/dist/Theme/tokens/builders/index.js +21 -0
  154. package/dist/Theme/tokens/index.d.ts +15 -0
  155. package/dist/Theme/tokens/index.d.ts.map +1 -0
  156. package/dist/Theme/tokens/index.js +30 -0
  157. package/dist/Theme/tokens/primitives/breakpoints.d.ts +9 -0
  158. package/dist/Theme/tokens/primitives/breakpoints.d.ts.map +1 -0
  159. package/dist/Theme/tokens/primitives/breakpoints.js +10 -0
  160. package/dist/Theme/tokens/primitives/index.d.ts +10 -0
  161. package/dist/Theme/tokens/primitives/index.d.ts.map +1 -0
  162. package/dist/Theme/tokens/primitives/index.js +27 -0
  163. package/dist/Theme/tokens/primitives/letterSpacings.d.ts +10 -0
  164. package/dist/Theme/tokens/primitives/letterSpacings.d.ts.map +1 -0
  165. package/dist/Theme/tokens/primitives/letterSpacings.js +11 -0
  166. package/dist/Theme/tokens/primitives/lineHeights.d.ts +19 -0
  167. package/dist/Theme/tokens/primitives/lineHeights.d.ts.map +1 -0
  168. package/dist/Theme/tokens/primitives/lineHeights.js +20 -0
  169. package/dist/Theme/tokens/primitives/radii.d.ts +13 -0
  170. package/dist/Theme/tokens/primitives/radii.d.ts.map +1 -0
  171. package/dist/Theme/tokens/primitives/radii.js +14 -0
  172. package/dist/Theme/tokens/primitives/shadows.d.ts +16 -0
  173. package/dist/Theme/tokens/primitives/shadows.d.ts.map +1 -0
  174. package/dist/Theme/tokens/primitives/shadows.js +17 -0
  175. package/dist/Theme/tokens/primitives/sizes.d.ts +63 -0
  176. package/dist/Theme/tokens/primitives/sizes.d.ts.map +1 -0
  177. package/dist/Theme/tokens/primitives/sizes.js +39 -0
  178. package/dist/Theme/tokens/primitives/space.d.ts +34 -0
  179. package/dist/Theme/tokens/primitives/space.d.ts.map +1 -0
  180. package/dist/Theme/tokens/primitives/space.js +35 -0
  181. package/dist/Theme/tokens/primitives/typography.d.ts +73 -0
  182. package/dist/Theme/tokens/primitives/typography.d.ts.map +1 -0
  183. package/dist/Theme/tokens/primitives/typography.js +43 -0
  184. package/dist/Theme/tokens/primitives/zIndices.d.ts +17 -0
  185. package/dist/Theme/tokens/primitives/zIndices.d.ts.map +1 -0
  186. package/dist/Theme/tokens/primitives/zIndices.js +18 -0
  187. package/dist/Theme/tokens/types.d.ts +116 -0
  188. package/dist/Theme/tokens/types.d.ts.map +1 -0
  189. package/dist/Theme/tokens/types.js +8 -0
  190. package/package.json +1 -1
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PixelizeThemeProvider = exports.ThemeModeContext = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const react_2 = require("@chakra-ui/react");
10
+ const index_1 = require("../index");
11
+ const Toaster_1 = __importDefault(require("../../Components/Toaster/Toaster"));
12
+ const colorModeStorage_1 = require("./colorModeStorage");
13
+ const DEFAULT_BRAND = "lavender";
14
+ const DEFAULT_MODE = "system";
15
+ const DEFAULT_STORAGE_KEY = "pixelize-theme";
16
+ /**
17
+ * Chakra's default `colorModeManager` reads/writes its OWN `localStorage["chakra-ui-color-mode"]`
18
+ * key — entirely separate from this app's `storageKey` above — and that stored value wins over
19
+ * `theme.config.initialColorMode` on every load. `createBrandTheme` sets `initialColorMode: "light"`
20
+ * on every theme object specifically so Chakra's native dark mode (and every un-migrated built-in
21
+ * `_dark:` block — Card's "elevated" variant reaches for `gray.700`, which our reversed dark ramp
22
+ * makes LIGHT) never fires. But a stale `"dark"` value in that key — from Chakra's own toggle ever
23
+ * having been used on this origin, by this app or a prior version of it — silently overrides that
24
+ * default and reintroduces exactly the bug `initialColorMode: "light"` was meant to prevent: a
25
+ * washed-out light Card on an otherwise-correct dark canvas, while everything reading the palette
26
+ * directly (i.e. everything else) stays right. Forcing this manager to always report `"light"` and
27
+ * never persist removes Chakra's native color mode from the equation entirely, so no stray
28
+ * `_dark:` block anywhere (present or future) can ever fire, regardless of what's in storage.
29
+ */
30
+ const forcedLightColorModeManager = {
31
+ type: "localStorage",
32
+ ssr: false,
33
+ get: () => "light",
34
+ set: () => { },
35
+ };
36
+ exports.ThemeModeContext = (0, react_1.createContext)(undefined);
37
+ /**
38
+ * Chakra's own color mode is deliberately NOT synced to `resolvedMode`, and must not be.
39
+ *
40
+ * This provider adapts for dark by swapping the palette, so `theme.colors` is already correct for
41
+ * the active mode. Putting Chakra into dark mode on top of that adapts a second time: its built-in
42
+ * `_dark` blocks reach for `gray.700`/`gray.800` expecting those rungs to be dark, but our dark
43
+ * ramp runs dark -> light, so they resolve LIGHT — a white Card/Skeleton/Menu on a dark canvas.
44
+ * A previous revision synced it to keep `useColorModeValue()` working and shipped exactly that.
45
+ *
46
+ * Consequence for consumers: `useColorModeValue(light, dark)` always returns its LIGHT argument.
47
+ * That is correct here — the palette has already resolved the mode, so the "light" argument is
48
+ * whatever the active palette says. Read the mode from `useThemeMode()` instead. Existing apps are
49
+ * unaffected: they are light-only, where that argument was always the one returned anyway.
50
+ */
51
+ const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRAND, defaultMode = DEFAULT_MODE, storageKey = DEFAULT_STORAGE_KEY, disablePersistence = false, themeOverrides, }) => {
52
+ const [mode, setModeState] = (0, react_1.useState)(defaultMode);
53
+ const [brand, setBrandState] = (0, react_1.useState)(brandProp);
54
+ // Deterministic on the server and on the first client render — the real OS value lands in
55
+ // the effect below, so hydration always matches.
56
+ const [systemMode, setSystemMode] = (0, react_1.useState)("light");
57
+ (0, react_1.useEffect)(() => {
58
+ setSystemMode((0, colorModeStorage_1.getSystemColorMode)());
59
+ return (0, colorModeStorage_1.subscribeToSystemColorMode)(setSystemMode);
60
+ }, []);
61
+ (0, react_1.useEffect)(() => {
62
+ if (disablePersistence)
63
+ return;
64
+ const stored = (0, colorModeStorage_1.readStoredTheme)(storageKey);
65
+ if (stored.mode)
66
+ setModeState(stored.mode);
67
+ if (stored.brand)
68
+ setBrandState(stored.brand);
69
+ }, [disablePersistence, storageKey]);
70
+ // `brandProp` only seeds initial state above, so a consumer that re-renders with a new
71
+ // `brand` prop after mount (e.g. persisting the pick through its own store, like tickets'
72
+ // Settings page dispatching Redux instead of calling `setBrand`) would otherwise never see
73
+ // it applied — the same gap `colorMode` has, which callers work around with an effect
74
+ // mirroring `mode`. Sync it here instead so every consumer gets it for free.
75
+ const isFirstBrandPropRun = (0, react_1.useRef)(true);
76
+ (0, react_1.useEffect)(() => {
77
+ if (isFirstBrandPropRun.current) {
78
+ isFirstBrandPropRun.current = false;
79
+ return;
80
+ }
81
+ setBrandState(brandProp);
82
+ // Only re-sync when the prop itself changes — not on every local `setBrand` call (that
83
+ // would fight the user's own in-session brand picking, e.g. via ThemeSwitcher).
84
+ // eslint-disable-next-line react-hooks/exhaustive-deps
85
+ }, [brandProp]);
86
+ // Skipping the mount run keeps the defaults from being written over a stored value before
87
+ // the rehydrate effect above has applied it.
88
+ const isFirstPersistRun = (0, react_1.useRef)(true);
89
+ (0, react_1.useEffect)(() => {
90
+ if (isFirstPersistRun.current) {
91
+ isFirstPersistRun.current = false;
92
+ return;
93
+ }
94
+ if (disablePersistence)
95
+ return;
96
+ (0, colorModeStorage_1.writeStoredTheme)(storageKey, { mode, brand });
97
+ }, [mode, brand, disablePersistence, storageKey]);
98
+ const resolvedMode = mode === "system" ? systemMode : mode;
99
+ /**
100
+ * Native browser UI (the `<select>` dropdown popup chrome, the `<input type="date">` calendar
101
+ * picker) is painted by the browser's own UA stylesheet keyed off the CSS `color-scheme`
102
+ * property, entirely separate from Chakra/React theming — no component style or palette swap
103
+ * above can reach it. Without this, that chrome always renders light, even on an otherwise dark
104
+ * page. Scoped to this provider (not a global stylesheet) so `withTheme` consumers — deliberately
105
+ * light-only, see the module doc's "Key rules" — are untouched.
106
+ */
107
+ (0, react_1.useEffect)(() => {
108
+ document.documentElement.style.colorScheme = resolvedMode;
109
+ }, [resolvedMode]);
110
+ const setMode = (0, react_1.useCallback)((next) => setModeState(next), []);
111
+ const setBrand = (0, react_1.useCallback)((next) => setBrandState(next), []);
112
+ // From "system", flip to the opposite of what the OS currently gives, so a click always
113
+ // visibly changes the UI.
114
+ const toggle = (0, react_1.useCallback)(() => setModeState(resolvedMode === "dark" ? "light" : "dark"), [resolvedMode]);
115
+ const value = (0, react_1.useMemo)(() => ({ mode, resolvedMode, setMode, toggle, brand, setBrand }), [mode, resolvedMode, setMode, toggle, brand, setBrand]);
116
+ const resolvedTheme = (0, react_1.useMemo)(() => {
117
+ const base = index_1.brandThemes[brand][resolvedMode];
118
+ return themeOverrides
119
+ ? (0, react_2.extendTheme)(base, themeOverrides)
120
+ : base;
121
+ }, [brand, resolvedMode, themeOverrides]);
122
+ return ((0, jsx_runtime_1.jsx)(exports.ThemeModeContext.Provider, { value: value, children: (0, jsx_runtime_1.jsx)(react_2.ChakraProvider, { theme: resolvedTheme, colorModeManager: forcedLightColorModeManager, children: (0, jsx_runtime_1.jsx)(Toaster_1.default, { children: children }) }) }));
123
+ };
124
+ exports.PixelizeThemeProvider = PixelizeThemeProvider;
@@ -0,0 +1,8 @@
1
+ export type ThemeSwitcherProps = {
2
+ variant?: "icon" | "segmented" | "menu";
3
+ showBrandPicker?: boolean;
4
+ size?: "sm" | "md" | "lg";
5
+ "aria-label"?: string;
6
+ };
7
+ export declare const ThemeSwitcher: ({ variant, showBrandPicker, size, "aria-label": ariaLabel, }: ThemeSwitcherProps) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=ThemeSwitcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeSwitcher.d.ts","sourceRoot":"","sources":["../../../src/Theme/provider/ThemeSwitcher.tsx"],"names":[],"mappings":"AAqBA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IACxC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAkSF,eAAO,MAAM,aAAa,GAAI,8DAK3B,kBAAkB,4CAuBpB,CAAC"}
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThemeSwitcher = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const react_2 = require("@chakra-ui/react");
7
+ const lucide_react_1 = require("lucide-react");
8
+ const index_1 = require("../index");
9
+ const useCustomTheme_1 = require("../useCustomTheme");
10
+ const useThemeMode_1 = require("./useThemeMode");
11
+ const MODE_OPTIONS = [
12
+ { value: "light", label: "Light", Icon: lucide_react_1.Sun },
13
+ { value: "system", label: "System", Icon: lucide_react_1.Monitor },
14
+ { value: "dark", label: "Dark", Icon: lucide_react_1.Moon },
15
+ ];
16
+ const SIZES = {
17
+ sm: { control: "sm", icon: 14 },
18
+ md: { control: "md", icon: 16 },
19
+ lg: { control: "lg", icon: 18 },
20
+ };
21
+ const toBrandLabel = (brand) => brand.charAt(0).toUpperCase() + brand.slice(1);
22
+ /**
23
+ * Same swatch each brand's own theme carries at `colors.primary[500]` (the
24
+ * anchor a filled button reads) — resolved per brand from its OWN palette so
25
+ * the dot always matches what selecting that brand actually looks like,
26
+ * regardless of which brand/mode is currently active.
27
+ */
28
+ const brandSwatchColor = (brand) => {
29
+ var _a, _b, _c, _d, _e;
30
+ return (_e = (_d = (_c = (_b = (_a = index_1.brandThemes[brand]) === null || _a === void 0 ? void 0 : _a.light) === null || _b === void 0 ? void 0 : _b.colors) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d[500]) !== null && _e !== void 0 ? _e : "gray.400";
31
+ };
32
+ const BrandSwatch = ({ brand }) => ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-block", w: "0.625rem", h: "0.625rem", borderRadius: "full", bg: brandSwatchColor(brand), border: "1px solid", borderColor: "whiteAlpha.300", flexShrink: 0 }));
33
+ /**
34
+ * Palette values already differ per color mode (`brandThemes[brand].light|dark`), so tokens
35
+ * are read straight from the active theme — no `useColorModeValue` pairing needed here.
36
+ * Fallbacks are Chakra token names, never literal colors, for themes without a brand palette.
37
+ */
38
+ const useSwitcherColors = () => {
39
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
40
+ const colors = (0, useCustomTheme_1.useCustomTheme)().colors;
41
+ return {
42
+ trackBg: (_d = (_b = (_a = colors === null || colors === void 0 ? void 0 : colors.backgroundColor) === null || _a === void 0 ? void 0 : _a.secondary) !== null && _b !== void 0 ? _b : (_c = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _c === void 0 ? void 0 : _c[100]) !== null && _d !== void 0 ? _d : "gray.100",
43
+ activeBg: (_g = (_f = (_e = colors === null || colors === void 0 ? void 0 : colors.backgroundColor) === null || _e === void 0 ? void 0 : _e.main) !== null && _f !== void 0 ? _f : colors === null || colors === void 0 ? void 0 : colors.white) !== null && _g !== void 0 ? _g : "white",
44
+ activeColor: (_l = (_j = (_h = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _h === void 0 ? void 0 : _h[500]) !== null && _j !== void 0 ? _j : (_k = colors === null || colors === void 0 ? void 0 : colors.text) === null || _k === void 0 ? void 0 : _k[900]) !== null && _l !== void 0 ? _l : "inherit",
45
+ mutedColor: (_q = (_o = (_m = colors === null || colors === void 0 ? void 0 : colors.text) === null || _m === void 0 ? void 0 : _m[600]) !== null && _o !== void 0 ? _o : (_p = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _p === void 0 ? void 0 : _p[600]) !== null && _q !== void 0 ? _q : "gray.600",
46
+ hoverBg: (_s = (_r = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _r === void 0 ? void 0 : _r[100]) !== null && _s !== void 0 ? _s : "gray.100",
47
+ borderColor: (_w = (_u = (_t = colors === null || colors === void 0 ? void 0 : colors.border) === null || _t === void 0 ? void 0 : _t[200]) !== null && _u !== void 0 ? _u : (_v = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _v === void 0 ? void 0 : _v[200]) !== null && _w !== void 0 ? _w : "gray.200",
48
+ // `--menu-bg` (and its hover/focus/active states) is now fixed centrally in the theme's
49
+ // Menu component style (Theme/chakra/Menu.styles.ts) — every MenuList gets it from there.
50
+ // Re-deriving it here too and pushing it back via `sx` on every render caused a redundant
51
+ // Emotion style recompute per render, which showed up as flicker while hovering/scrolling
52
+ // this list. Keep menuColor (Menu.styles.ts doesn't set list `color` per this component's
53
+ // needs) but stop duplicating menuBg.
54
+ menuColor: (_0 = (_y = (_x = colors === null || colors === void 0 ? void 0 : colors.text) === null || _x === void 0 ? void 0 : _x[900]) !== null && _y !== void 0 ? _y : (_z = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _z === void 0 ? void 0 : _z[900]) !== null && _0 !== void 0 ? _0 : "gray.900",
55
+ };
56
+ };
57
+ const BrandMenu = ({ size }) => {
58
+ const { brand, setBrand } = (0, useThemeMode_1.useThemeMode)();
59
+ const { mutedColor, menuColor } = useSwitcherColors();
60
+ const brands = Object.keys(index_1.brandThemes);
61
+ return ((0, jsx_runtime_1.jsxs)(react_2.Menu, { children: [(0, jsx_runtime_1.jsx)(react_2.MenuButton, { as: react_2.Button, size: SIZES[size].control, variant: "ghost", color: mutedColor, borderRadius: "full", fontWeight: 500, "aria-label": `Brand theme, current ${toBrandLabel(brand)}`, _focusVisible: { boxShadow: "outline" }, children: (0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(BrandSwatch, { brand: brand }), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: toBrandLabel(brand) })] }) }), (0, jsx_runtime_1.jsx)(react_2.MenuList, { minW: "9rem", color: menuColor, children: (0, jsx_runtime_1.jsx)(react_2.MenuOptionGroup, { title: "Brand", type: "radio", value: brand, onChange: (value) => setBrand(value), children: brands.map((option) => ((0, jsx_runtime_1.jsx)(react_2.MenuItemOption, { value: option, children: (0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(BrandSwatch, { brand: option }), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: toBrandLabel(option) })] }) }, option))) }) })] }));
62
+ };
63
+ const IconVariant = ({ size, label, }) => {
64
+ const { resolvedMode, toggle } = (0, useThemeMode_1.useThemeMode)();
65
+ const { mutedColor, hoverBg } = useSwitcherColors();
66
+ const isDark = resolvedMode === "dark";
67
+ const Icon = isDark ? lucide_react_1.Moon : lucide_react_1.Sun;
68
+ const accessibleLabel = label !== null && label !== void 0 ? label : `Switch to ${isDark ? "light" : "dark"} mode`;
69
+ return ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: accessibleLabel, openDelay: 400, children: (0, jsx_runtime_1.jsx)(react_2.IconButton, { "aria-label": accessibleLabel, "aria-pressed": isDark, icon: (0, jsx_runtime_1.jsx)(Icon, { size: SIZES[size].icon, "aria-hidden": true }), onClick: toggle, size: SIZES[size].control, variant: "ghost", color: mutedColor, borderRadius: "full", _hover: { bg: hoverBg }, _focusVisible: { boxShadow: "outline" } }) }));
70
+ };
71
+ const SegmentedVariant = ({ size, label, showBrandPicker, }) => {
72
+ const { mode, setMode } = (0, useThemeMode_1.useThemeMode)();
73
+ const { trackBg, activeBg, activeColor, mutedColor, borderColor } = useSwitcherColors();
74
+ const optionRefs = (0, react_1.useRef)([]);
75
+ // APG radiogroup behavior: arrows move focus and selection together.
76
+ const handleKeyDown = (event, index) => {
77
+ var _a;
78
+ const forward = event.key === "ArrowRight" || event.key === "ArrowDown";
79
+ const backward = event.key === "ArrowLeft" || event.key === "ArrowUp";
80
+ if (!forward && !backward)
81
+ return;
82
+ event.preventDefault();
83
+ const next = (index + (forward ? 1 : -1) + MODE_OPTIONS.length) % MODE_OPTIONS.length;
84
+ setMode(MODE_OPTIONS[next].value);
85
+ (_a = optionRefs.current[next]) === null || _a === void 0 ? void 0 : _a.focus();
86
+ };
87
+ return ((0, jsx_runtime_1.jsxs)(react_2.HStack, { role: "radiogroup", "aria-label": label !== null && label !== void 0 ? label : "Color mode", display: "inline-flex", spacing: 1, p: "0.25rem", bg: trackBg, border: "0.063rem solid", borderColor: borderColor, borderRadius: "full", children: [MODE_OPTIONS.map(({ value, label: optionLabel, Icon }, index) => {
88
+ const isSelected = mode === value;
89
+ return ((0, jsx_runtime_1.jsx)(react_2.Button, { ref: (node) => {
90
+ optionRefs.current[index] = node;
91
+ }, role: "radio", "aria-checked": isSelected, "aria-label": optionLabel, onClick: () => setMode(value), onKeyDown: (event) => handleKeyDown(event, index), size: SIZES[size].control, variant: "ghost", borderRadius: "full", bg: isSelected ? activeBg : "transparent", color: isSelected ? activeColor : mutedColor, boxShadow: isSelected ? "sm" : "none", _hover: { color: activeColor }, _focusVisible: { boxShadow: "outline" }, children: (0, jsx_runtime_1.jsx)(Icon, { size: SIZES[size].icon, "aria-hidden": true }) }, value));
92
+ }), showBrandPicker && (0, jsx_runtime_1.jsx)(BrandMenu, { size: size })] }));
93
+ };
94
+ const MenuVariant = ({ size, label, showBrandPicker, }) => {
95
+ var _a;
96
+ const { mode, brand, setMode, setBrand } = (0, useThemeMode_1.useThemeMode)();
97
+ const { mutedColor, hoverBg, menuColor } = useSwitcherColors();
98
+ const active = (_a = MODE_OPTIONS.find((option) => option.value === mode)) !== null && _a !== void 0 ? _a : MODE_OPTIONS[0];
99
+ const brands = Object.keys(index_1.brandThemes);
100
+ return ((0, jsx_runtime_1.jsxs)(react_2.Menu, { children: [(0, jsx_runtime_1.jsx)(react_2.MenuButton, { as: react_2.IconButton, "aria-label": label !== null && label !== void 0 ? label : `Color mode, current ${active.label}`, icon: (0, jsx_runtime_1.jsx)(active.Icon, { size: SIZES[size].icon, "aria-hidden": true }), size: SIZES[size].control, variant: "ghost", color: mutedColor, borderRadius: "full", _hover: { bg: hoverBg }, _focusVisible: { boxShadow: "outline" } }), (0, jsx_runtime_1.jsxs)(react_2.MenuList, { minW: "10rem", color: menuColor, children: [(0, jsx_runtime_1.jsx)(react_2.MenuOptionGroup, { title: "Appearance", type: "radio", value: mode, onChange: (value) => setMode(value), children: MODE_OPTIONS.map(({ value, label: optionLabel, Icon }) => ((0, jsx_runtime_1.jsx)(react_2.MenuItemOption, { value: value, children: (0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(Icon, { size: SIZES[size].icon, "aria-hidden": true }), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: optionLabel })] }) }, value))) }), showBrandPicker && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.MenuDivider, {}), (0, jsx_runtime_1.jsx)(react_2.MenuOptionGroup, { title: "Brand", type: "radio", value: brand, onChange: (value) => setBrand(value), children: brands.map((option) => ((0, jsx_runtime_1.jsx)(react_2.MenuItemOption, { value: option, children: (0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(BrandSwatch, { brand: option }), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: toBrandLabel(option) })] }) }, option))) })] }))] })] }));
101
+ };
102
+ const ThemeSwitcher = ({ variant = "icon", showBrandPicker = false, size = "md", "aria-label": ariaLabel, }) => {
103
+ if (variant === "segmented") {
104
+ return ((0, jsx_runtime_1.jsx)(SegmentedVariant, { size: size, label: ariaLabel, showBrandPicker: showBrandPicker }));
105
+ }
106
+ if (variant === "menu") {
107
+ return ((0, jsx_runtime_1.jsx)(MenuVariant, { size: size, label: ariaLabel, showBrandPicker: showBrandPicker }));
108
+ }
109
+ return ((0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 1, display: "inline-flex", children: [(0, jsx_runtime_1.jsx)(IconVariant, { size: size, label: ariaLabel }), showBrandPicker && (0, jsx_runtime_1.jsx)(BrandMenu, { size: size })] }));
110
+ };
111
+ exports.ThemeSwitcher = ThemeSwitcher;
@@ -0,0 +1,10 @@
1
+ import type { ColorMode, ResolvedColorMode, ThemeName } from "../tokens/types";
2
+ export type StoredTheme = {
3
+ mode?: ColorMode;
4
+ brand?: ThemeName;
5
+ };
6
+ export declare const readStoredTheme: (storageKey: string) => StoredTheme;
7
+ export declare const writeStoredTheme: (storageKey: string, value: StoredTheme) => void;
8
+ export declare const getSystemColorMode: () => ResolvedColorMode;
9
+ export declare const subscribeToSystemColorMode: (callback: (mode: ResolvedColorMode) => void) => (() => void);
10
+ //# sourceMappingURL=colorModeStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colorModeStorage.d.ts","sourceRoot":"","sources":["../../../src/Theme/provider/colorModeStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE/E,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAiCF,eAAO,MAAM,eAAe,GAAI,YAAY,MAAM,KAAG,WAmBpD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,EAAE,OAAO,WAAW,KAAG,IASzE,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAO,iBASrC,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,UAAU,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,KAC1C,CAAC,MAAM,IAAI,CA0Bb,CAAC"}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribeToSystemColorMode = exports.getSystemColorMode = exports.writeStoredTheme = exports.readStoredTheme = void 0;
4
+ const DARK_QUERY = "(prefers-color-scheme: dark)";
5
+ /**
6
+ * Stored values are untrusted input — a stale or hand-edited entry must never reach
7
+ * `brandThemes[brand]` and hand Chakra an `undefined` theme.
8
+ */
9
+ const VALID_MODES = ["light", "dark", "system"];
10
+ const VALID_BRANDS = [
11
+ "lavender",
12
+ "meadow",
13
+ "radiant",
14
+ "skyline",
15
+ "slate",
16
+ "emerald",
17
+ "rosewood",
18
+ "storefront",
19
+ "zinc",
20
+ ];
21
+ const noop = () => { };
22
+ /** Safari private mode throws on `localStorage` access rather than returning null. */
23
+ const getStorage = () => {
24
+ var _a;
25
+ try {
26
+ if (typeof window === "undefined")
27
+ return null;
28
+ return (_a = window.localStorage) !== null && _a !== void 0 ? _a : null;
29
+ }
30
+ catch {
31
+ return null;
32
+ }
33
+ };
34
+ const readStoredTheme = (storageKey) => {
35
+ const storage = getStorage();
36
+ if (!storage)
37
+ return {};
38
+ try {
39
+ const raw = storage.getItem(storageKey);
40
+ if (!raw)
41
+ return {};
42
+ const parsed = JSON.parse(raw);
43
+ if (!parsed || typeof parsed !== "object")
44
+ return {};
45
+ const { mode, brand } = parsed;
46
+ const stored = {};
47
+ if (mode && VALID_MODES.includes(mode))
48
+ stored.mode = mode;
49
+ if (brand && VALID_BRANDS.includes(brand))
50
+ stored.brand = brand;
51
+ return stored;
52
+ }
53
+ catch {
54
+ return {};
55
+ }
56
+ };
57
+ exports.readStoredTheme = readStoredTheme;
58
+ const writeStoredTheme = (storageKey, value) => {
59
+ const storage = getStorage();
60
+ if (!storage)
61
+ return;
62
+ try {
63
+ storage.setItem(storageKey, JSON.stringify(value));
64
+ }
65
+ catch {
66
+ // Quota / private mode. Persistence is best-effort — never break the app over it.
67
+ }
68
+ };
69
+ exports.writeStoredTheme = writeStoredTheme;
70
+ const getSystemColorMode = () => {
71
+ try {
72
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
73
+ return "light";
74
+ }
75
+ return window.matchMedia(DARK_QUERY).matches ? "dark" : "light";
76
+ }
77
+ catch {
78
+ return "light";
79
+ }
80
+ };
81
+ exports.getSystemColorMode = getSystemColorMode;
82
+ const subscribeToSystemColorMode = (callback) => {
83
+ try {
84
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
85
+ return noop;
86
+ }
87
+ const query = window.matchMedia(DARK_QUERY);
88
+ const handler = (event) => {
89
+ callback(event.matches ? "dark" : "light");
90
+ };
91
+ if (typeof query.addEventListener === "function") {
92
+ query.addEventListener("change", handler);
93
+ return () => query.removeEventListener("change", handler);
94
+ }
95
+ // Safari < 14 only has the deprecated listener API.
96
+ if (typeof query.addListener === "function") {
97
+ query.addListener(handler);
98
+ return () => query.removeListener(handler);
99
+ }
100
+ return noop;
101
+ }
102
+ catch {
103
+ return noop;
104
+ }
105
+ };
106
+ exports.subscribeToSystemColorMode = subscribeToSystemColorMode;
@@ -0,0 +1,6 @@
1
+ export { PixelizeThemeProvider } from "./PixelizeThemeProvider";
2
+ export type { PixelizeThemeProviderProps, ThemeModeContextValue, } from "./PixelizeThemeProvider";
3
+ export { useThemeMode } from "./useThemeMode";
4
+ export { ThemeSwitcher } from "./ThemeSwitcher";
5
+ export type { ThemeSwitcherProps } from "./ThemeSwitcher";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Theme/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EACV,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThemeSwitcher = exports.useThemeMode = exports.PixelizeThemeProvider = void 0;
4
+ var PixelizeThemeProvider_1 = require("./PixelizeThemeProvider");
5
+ Object.defineProperty(exports, "PixelizeThemeProvider", { enumerable: true, get: function () { return PixelizeThemeProvider_1.PixelizeThemeProvider; } });
6
+ var useThemeMode_1 = require("./useThemeMode");
7
+ Object.defineProperty(exports, "useThemeMode", { enumerable: true, get: function () { return useThemeMode_1.useThemeMode; } });
8
+ var ThemeSwitcher_1 = require("./ThemeSwitcher");
9
+ Object.defineProperty(exports, "ThemeSwitcher", { enumerable: true, get: function () { return ThemeSwitcher_1.ThemeSwitcher; } });
@@ -0,0 +1,3 @@
1
+ import { ThemeModeContextValue } from "./PixelizeThemeProvider";
2
+ export declare const useThemeMode: () => ThemeModeContextValue;
3
+ //# sourceMappingURL=useThemeMode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useThemeMode.d.ts","sourceRoot":"","sources":["../../../src/Theme/provider/useThemeMode.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAElF,eAAO,MAAM,YAAY,QAAO,qBAU/B,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useThemeMode = void 0;
4
+ const react_1 = require("react");
5
+ const PixelizeThemeProvider_1 = require("./PixelizeThemeProvider");
6
+ const useThemeMode = () => {
7
+ const context = (0, react_1.useContext)(PixelizeThemeProvider_1.ThemeModeContext);
8
+ if (!context) {
9
+ throw new Error("useThemeMode must be used inside <PixelizeThemeProvider>. Wrap your app (or at least the subtree that calls useThemeMode) in <PixelizeThemeProvider> from pixelize-design-library.");
10
+ }
11
+ return context;
12
+ };
13
+ exports.useThemeMode = useThemeMode;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Dark palette for the emerald brand, derived from its own light palette so the brand hue
3
+ * carries through. Override individual tokens here if this brand needs a bespoke dark value.
4
+ */
5
+ declare const palette: import("../..").PaletteProps;
6
+ export default palette;
7
+ //# sourceMappingURL=palette.dark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"palette.dark.d.ts","sourceRoot":"","sources":["../../../../../src/Theme/tokens/brands/emerald/palette.dark.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,QAAA,MAAM,OAAO,8BAA0B,CAAC;AAExC,eAAe,OAAO,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const buildDarkPalette_1 = require("../../builders/buildDarkPalette");
7
+ const palette_light_1 = __importDefault(require("./palette.light"));
8
+ /**
9
+ * Dark palette for the emerald brand, derived from its own light palette so the brand hue
10
+ * carries through. Override individual tokens here if this brand needs a bespoke dark value.
11
+ */
12
+ const palette = (0, buildDarkPalette_1.buildDarkPalette)(palette_light_1.default);
13
+ exports.default = palette;