@flipdish/ui-library 0.31.3 → 0.31.5

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 (176) hide show
  1. package/dist/components/molecules/CodeSnippet/index.cjs.map +1 -1
  2. package/dist/components/molecules/CodeSnippet/index.d.ts.map +1 -1
  3. package/dist/components/molecules/CodeSnippet/index.js.map +1 -1
  4. package/dist/components/molecules/Pagination/index.cjs.map +1 -1
  5. package/dist/components/molecules/Pagination/index.d.ts.map +1 -1
  6. package/dist/components/molecules/Pagination/index.js.map +1 -1
  7. package/dist/components/organisms/ApplicationHeader/index.cjs +4 -5
  8. package/dist/components/organisms/ApplicationHeader/index.cjs.map +1 -1
  9. package/dist/components/organisms/ApplicationHeader/index.d.ts +4 -5
  10. package/dist/components/organisms/ApplicationHeader/index.d.ts.map +1 -1
  11. package/dist/components/organisms/ApplicationHeader/index.js +4 -5
  12. package/dist/components/organisms/ApplicationHeader/index.js.map +1 -1
  13. package/dist/components/organisms/Charts/components/PieChart.cjs +2 -4
  14. package/dist/components/organisms/Charts/components/PieChart.cjs.map +1 -1
  15. package/dist/components/organisms/Charts/components/PieChart.d.ts +2 -4
  16. package/dist/components/organisms/Charts/components/PieChart.d.ts.map +1 -1
  17. package/dist/components/organisms/Charts/components/PieChart.js +2 -4
  18. package/dist/components/organisms/Charts/components/PieChart.js.map +1 -1
  19. package/dist/components/organisms/Charts/index.d.ts +0 -2
  20. package/dist/components/organisms/Charts/index.d.ts.map +1 -1
  21. package/dist/components/organisms/ColorPicker/index.cjs +3 -2
  22. package/dist/components/organisms/ColorPicker/index.cjs.map +1 -1
  23. package/dist/components/organisms/ColorPicker/index.d.ts +3 -2
  24. package/dist/components/organisms/ColorPicker/index.d.ts.map +1 -1
  25. package/dist/components/organisms/ColorPicker/index.js +3 -2
  26. package/dist/components/organisms/ColorPicker/index.js.map +1 -1
  27. package/dist/components/organisms/ImagePicker/index.cjs +3 -2
  28. package/dist/components/organisms/ImagePicker/index.cjs.map +1 -1
  29. package/dist/components/organisms/ImagePicker/index.d.ts +3 -2
  30. package/dist/components/organisms/ImagePicker/index.d.ts.map +1 -1
  31. package/dist/components/organisms/ImagePicker/index.js +3 -2
  32. package/dist/components/organisms/ImagePicker/index.js.map +1 -1
  33. package/dist/components/organisms/PageHeader/index.cjs +4 -6
  34. package/dist/components/organisms/PageHeader/index.cjs.map +1 -1
  35. package/dist/components/organisms/PageHeader/index.d.ts +4 -6
  36. package/dist/components/organisms/PageHeader/index.d.ts.map +1 -1
  37. package/dist/components/organisms/PageHeader/index.js +4 -6
  38. package/dist/components/organisms/PageHeader/index.js.map +1 -1
  39. package/dist/components/organisms/SidePanel/index.cjs +5 -7
  40. package/dist/components/organisms/SidePanel/index.cjs.map +1 -1
  41. package/dist/components/organisms/SidePanel/index.d.ts +5 -7
  42. package/dist/components/organisms/SidePanel/index.d.ts.map +1 -1
  43. package/dist/components/organisms/SidePanel/index.js +5 -7
  44. package/dist/components/organisms/SidePanel/index.js.map +1 -1
  45. package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.cjs +7 -4
  46. package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.cjs.map +1 -1
  47. package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.d.ts +7 -4
  48. package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.d.ts.map +1 -1
  49. package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.js +7 -4
  50. package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.js.map +1 -1
  51. package/dist/components/organisms/SidebarNavigation/index.cjs +4 -8
  52. package/dist/components/organisms/SidebarNavigation/index.cjs.map +1 -1
  53. package/dist/components/organisms/SidebarNavigation/index.d.ts +4 -8
  54. package/dist/components/organisms/SidebarNavigation/index.d.ts.map +1 -1
  55. package/dist/components/organisms/SidebarNavigation/index.js +4 -8
  56. package/dist/components/organisms/SidebarNavigation/index.js.map +1 -1
  57. package/dist/components/templates/AppShell/index.cjs +5 -7
  58. package/dist/components/templates/AppShell/index.cjs.map +1 -1
  59. package/dist/components/templates/AppShell/index.d.ts +5 -7
  60. package/dist/components/templates/AppShell/index.d.ts.map +1 -1
  61. package/dist/components/templates/AppShell/index.js +5 -7
  62. package/dist/components/templates/AppShell/index.js.map +1 -1
  63. package/dist/components/templates/NotFoundPage/index.cjs +3 -9
  64. package/dist/components/templates/NotFoundPage/index.cjs.map +1 -1
  65. package/dist/components/templates/NotFoundPage/index.d.ts +3 -9
  66. package/dist/components/templates/NotFoundPage/index.d.ts.map +1 -1
  67. package/dist/components/templates/NotFoundPage/index.js +3 -9
  68. package/dist/components/templates/NotFoundPage/index.js.map +1 -1
  69. package/dist/components/templates/PageLayout/index.cjs +5 -12
  70. package/dist/components/templates/PageLayout/index.cjs.map +1 -1
  71. package/dist/components/templates/PageLayout/index.d.ts +5 -12
  72. package/dist/components/templates/PageLayout/index.d.ts.map +1 -1
  73. package/dist/components/templates/PageLayout/index.js +5 -12
  74. package/dist/components/templates/PageLayout/index.js.map +1 -1
  75. package/dist/hooks/useBreakpoints/index.cjs +5 -5
  76. package/dist/hooks/useBreakpoints/index.d.ts +5 -5
  77. package/dist/hooks/useBreakpoints/index.js +5 -5
  78. package/dist/hooks/useClipboard/index.cjs +5 -2
  79. package/dist/hooks/useClipboard/index.cjs.map +1 -1
  80. package/dist/hooks/useClipboard/index.d.ts +5 -2
  81. package/dist/hooks/useClipboard/index.d.ts.map +1 -1
  82. package/dist/hooks/useClipboard/index.js +5 -2
  83. package/dist/hooks/useClipboard/index.js.map +1 -1
  84. package/dist/hooks/usePlatform/index.cjs +4 -5
  85. package/dist/hooks/usePlatform/index.cjs.map +1 -1
  86. package/dist/hooks/usePlatform/index.d.ts +4 -5
  87. package/dist/hooks/usePlatform/index.d.ts.map +1 -1
  88. package/dist/hooks/usePlatform/index.js +4 -5
  89. package/dist/hooks/usePlatform/index.js.map +1 -1
  90. package/dist/hooks/useResizeObserver/index.cjs +7 -2
  91. package/dist/hooks/useResizeObserver/index.cjs.map +1 -1
  92. package/dist/hooks/useResizeObserver/index.d.ts +7 -2
  93. package/dist/hooks/useResizeObserver/index.d.ts.map +1 -1
  94. package/dist/hooks/useResizeObserver/index.js +7 -2
  95. package/dist/hooks/useResizeObserver/index.js.map +1 -1
  96. package/dist/hooks/useSidePanel/index.cjs +7 -5
  97. package/dist/hooks/useSidePanel/index.cjs.map +1 -1
  98. package/dist/hooks/useSidePanel/index.d.ts +7 -5
  99. package/dist/hooks/useSidePanel/index.d.ts.map +1 -1
  100. package/dist/hooks/useSidePanel/index.js +7 -5
  101. package/dist/hooks/useSidePanel/index.js.map +1 -1
  102. package/dist/native/utilities/cx/index.d.ts +9 -9
  103. package/dist/native/utilities/cx/index.d.ts.map +1 -1
  104. package/dist/native/utilities/cx/index.js +9 -9
  105. package/dist/native/utilities/cx/index.js.map +1 -1
  106. package/dist/native/utilities/testIdUtils/index.d.ts +44 -10
  107. package/dist/native/utilities/testIdUtils/index.d.ts.map +1 -1
  108. package/dist/native/utilities/testIdUtils/index.js +44 -10
  109. package/dist/native/utilities/testIdUtils/index.js.map +1 -1
  110. package/dist/providers/ErrorBoundary/index.cjs +5 -7
  111. package/dist/providers/ErrorBoundary/index.cjs.map +1 -1
  112. package/dist/providers/ErrorBoundary/index.d.ts +4 -7
  113. package/dist/providers/ErrorBoundary/index.d.ts.map +1 -1
  114. package/dist/providers/ErrorBoundary/index.js +5 -7
  115. package/dist/providers/ErrorBoundary/index.js.map +1 -1
  116. package/dist/providers/RouteProvider/index.cjs +5 -1
  117. package/dist/providers/RouteProvider/index.cjs.map +1 -1
  118. package/dist/providers/RouteProvider/index.d.ts +5 -1
  119. package/dist/providers/RouteProvider/index.d.ts.map +1 -1
  120. package/dist/providers/RouteProvider/index.js +5 -1
  121. package/dist/providers/RouteProvider/index.js.map +1 -1
  122. package/dist/providers/ThemeProvider/index.cjs +11 -1
  123. package/dist/providers/ThemeProvider/index.cjs.map +1 -1
  124. package/dist/providers/ThemeProvider/index.d.ts +11 -1
  125. package/dist/providers/ThemeProvider/index.d.ts.map +1 -1
  126. package/dist/providers/ThemeProvider/index.js +11 -1
  127. package/dist/providers/ThemeProvider/index.js.map +1 -1
  128. package/dist/providers/UIProvider/index.cjs +5 -1
  129. package/dist/providers/UIProvider/index.cjs.map +1 -1
  130. package/dist/providers/UIProvider/index.d.ts +5 -1
  131. package/dist/providers/UIProvider/index.d.ts.map +1 -1
  132. package/dist/providers/UIProvider/index.js +5 -1
  133. package/dist/providers/UIProvider/index.js.map +1 -1
  134. package/dist/utilities/cssScopeUtils/index.cjs +6 -5
  135. package/dist/utilities/cssScopeUtils/index.cjs.map +1 -1
  136. package/dist/utilities/cssScopeUtils/index.d.ts +6 -5
  137. package/dist/utilities/cssScopeUtils/index.d.ts.map +1 -1
  138. package/dist/utilities/cssScopeUtils/index.js +6 -5
  139. package/dist/utilities/cssScopeUtils/index.js.map +1 -1
  140. package/dist/utilities/cx/index.cjs +9 -9
  141. package/dist/utilities/cx/index.cjs.map +1 -1
  142. package/dist/utilities/cx/index.d.ts +9 -9
  143. package/dist/utilities/cx/index.d.ts.map +1 -1
  144. package/dist/utilities/cx/index.js +9 -9
  145. package/dist/utilities/cx/index.js.map +1 -1
  146. package/dist/utilities/hrefUtils/index.cjs +10 -11
  147. package/dist/utilities/hrefUtils/index.cjs.map +1 -1
  148. package/dist/utilities/hrefUtils/index.d.ts +10 -11
  149. package/dist/utilities/hrefUtils/index.d.ts.map +1 -1
  150. package/dist/utilities/hrefUtils/index.js +10 -11
  151. package/dist/utilities/hrefUtils/index.js.map +1 -1
  152. package/dist/utilities/localStorageUtils/index.cjs +8 -5
  153. package/dist/utilities/localStorageUtils/index.cjs.map +1 -1
  154. package/dist/utilities/localStorageUtils/index.d.ts +8 -5
  155. package/dist/utilities/localStorageUtils/index.d.ts.map +1 -1
  156. package/dist/utilities/localStorageUtils/index.js +8 -5
  157. package/dist/utilities/localStorageUtils/index.js.map +1 -1
  158. package/dist/utilities/renderUtils/index.cjs +31 -30
  159. package/dist/utilities/renderUtils/index.cjs.map +1 -1
  160. package/dist/utilities/renderUtils/index.d.ts +31 -30
  161. package/dist/utilities/renderUtils/index.d.ts.map +1 -1
  162. package/dist/utilities/renderUtils/index.js +31 -30
  163. package/dist/utilities/renderUtils/index.js.map +1 -1
  164. package/dist/utilities/sessionStorageUtils/index.cjs +8 -5
  165. package/dist/utilities/sessionStorageUtils/index.cjs.map +1 -1
  166. package/dist/utilities/sessionStorageUtils/index.d.ts +8 -5
  167. package/dist/utilities/sessionStorageUtils/index.d.ts.map +1 -1
  168. package/dist/utilities/sessionStorageUtils/index.js +8 -5
  169. package/dist/utilities/sessionStorageUtils/index.js.map +1 -1
  170. package/dist/utilities/testIdUtils/index.cjs +44 -10
  171. package/dist/utilities/testIdUtils/index.cjs.map +1 -1
  172. package/dist/utilities/testIdUtils/index.d.ts +44 -10
  173. package/dist/utilities/testIdUtils/index.d.ts.map +1 -1
  174. package/dist/utilities/testIdUtils/index.js +44 -10
  175. package/dist/utilities/testIdUtils/index.js.map +1 -1
  176. package/package.json +1 -1
@@ -4,6 +4,12 @@ var jsxRuntime = require('react/jsx-runtime');
4
4
  var React = require('react');
5
5
 
6
6
  const ThemeContext = React.createContext(undefined);
7
+ /**
8
+ * Reads the current theme and its setter from the nearest `ThemeProvider`.
9
+ *
10
+ * @returns The chosen `theme` and `setTheme`, the `resolvedMode` (light or dark) and the `themeRoot`
11
+ * element carrying `data-theme`.
12
+ */
7
13
  const useTheme = () => {
8
14
  const context = React.useContext(ThemeContext);
9
15
  if (context === undefined) {
@@ -17,7 +23,11 @@ const resolveSystemPreference = () => {
17
23
  return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
18
24
  };
19
25
  /**
20
- * @summary app-wide light/dark/system theme provider that renders a themed `display: contents` wrapper carrying `data-theme`
26
+ * Provides light/dark/system theme context, persisted to `localStorage` and following the OS
27
+ * when set to `system`. Renders a `display: contents` wrapper carrying `data-theme` so tokens
28
+ * and the Tailwind `dark:` variant cascade, including inside CSS-scoped micro-frontends.
29
+ *
30
+ * @summary light/dark/system theme provider carrying data-theme
21
31
  */
22
32
  const ThemeProvider = ({ children, defaultTheme = 'system', storageKey = 'ui-theme', themeModeOverride }) => {
23
33
  const [theme, setTheme] = React.useState(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["createContext","useContext","useState","useEffect","useMemo","_jsx"],"mappings":";;;;;AAcA,MAAM,YAAY,GAAGA,mBAAa,CAA+B,SAAS,CAAC;AAEpE,MAAM,QAAQ,GAAG,MAAuB;AAC7C,IAAA,MAAM,OAAO,GAAGC,gBAAU,CAAC,YAAY,CAAC;AAExC,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,QAAA,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC;IACjE;AAEA,IAAA,OAAO,OAAO;AAChB;AAEA,MAAM,uBAAuB,GAAG,MAAuB;IACrD,IAAI,OAAO,MAAM,KAAK,WAAW;AAAE,QAAA,OAAO,OAAO;AACjD,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO;AACrF,CAAC;AAqBD;;AAEG;AACI,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,GAAG,QAAQ,EAAE,UAAU,GAAG,UAAU,EAAE,iBAAiB,EAAsB,KAAI;IACrI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAGC,cAAQ,CAAQ,MAAK;AAC7C,QAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAiB;YACnE,OAAO,UAAU,IAAI,YAAY;QACnC;AACA,QAAA,OAAO,YAAY;AACrB,IAAA,CAAC,CAAC;IAEF,MAAM,CAAC,gBAAgB,EAAE,mB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AAA,EAAK,GAAG,EAAE,YAAY,EAAA,YAAA,EAAc,YAAY,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAA,QAAA,EAC7E,QAAQ,EAAA,CACL,EAAA,CACgB;AAE5B;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["createContext","useContext","useState","useEffect","useMemo","_jsx"],"mappings":";;;;;AAcA,MAAM,YAAY,GAAGA,mBAAa,CAA+B,SAAS,CAAC;AAE3E;;;;;AAKG;AACI,MAAM,QAAQ,GAAG,MAAuB;AAC7C,IAAA,MAAM,OAAO,GAAGC,gBAAU,CAAC,YAAY,CAAC;AAExC,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,QAAA,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC;IACjE;AAEA,IAAA,OAAO,OAAO;AAChB;AAEA,MAAM,uBAAuB,GAAG,MAAuB;IACrD,IAAI,OAAO,MAAM,KAAK,WAAW;AAAE,QAAA,OAAO,OAAO;AACjD,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO;AACrF,CAAC;AAqBD;;;;;;AAMG;AACI,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,GAAG,QAAQ,EAAE,UAAU,GAAG,UAAU,EAAE,iBAAiB,EAAsB,KAAI;IACrI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAGC,cAAQ,CAAQ,MAAK;AAC7C,QAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAiB;YACnE,OAAO,UAAU,IAAI,YAAY;QACnC;AACA,QAAA,OAAO,YAAY;AACrB,IAAA,CAAC,CAAC;IAEF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAGA,cAAQ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AY,EAAA,YAAA,EAAc,YAAY,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAA,QAAA,EAC7E,QAAQ,EAAA,CACL,EAAA,CACgB;AAE5B;;;"}
@@ -6,6 +6,12 @@ interface ThemeContextType {
6
6
  themeRoot: HTMLElement | null;
7
7
  resolvedMode: 'light' | 'dark';
8
8
  }
9
+ /**
10
+ * Reads the current theme and its setter from the nearest `ThemeProvider`.
11
+ *
12
+ * @returns The chosen `theme` and `setTheme`, the `resolvedMode` (light or dark) and the `themeRoot`
13
+ * element carrying `data-theme`.
14
+ */
9
15
  export declare const useTheme: () => ThemeContextType;
10
16
  interface ThemeProviderProps {
11
17
  children: ReactNode;
@@ -26,7 +32,11 @@ interface ThemeProviderProps {
26
32
  themeModeOverride?: 'light' | 'dark';
27
33
  }
28
34
  /**
29
- * @summary app-wide light/dark/system theme provider that renders a themed `display: contents` wrapper carrying `data-theme`
35
+ * Provides light/dark/system theme context, persisted to `localStorage` and following the OS
36
+ * when set to `system`. Renders a `display: contents` wrapper carrying `data-theme` so tokens
37
+ * and the Tailwind `dark:` variant cascade, including inside CSS-scoped micro-frontends.
38
+ *
39
+ * @summary light/dark/system theme provider carrying data-theme
30
40
  */
31
41
  export declare const ThemeProvider: ({ children, defaultTheme, storageKey, themeModeOverride }: ThemeProviderProps) => import("react").JSX.Element;
32
42
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ThemeProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzC,UAAU,gBAAgB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC;AAID,eAAO,MAAM,QAAQ,QAAO,gBAQ3B,CAAC;AAOF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACtC;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,2DAAmF,kBAAkB,gCA0ClI,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ThemeProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzC,UAAU,gBAAgB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC;AAID;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,QAAO,gBAQ3B,CAAC;AAOF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACtC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,2DAAmF,kBAAkB,gCA0ClI,CAAC"}
@@ -2,6 +2,12 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { createContext, useState, useEffect, useMemo, useContext } from 'react';
3
3
 
4
4
  const ThemeContext = createContext(undefined);
5
+ /**
6
+ * Reads the current theme and its setter from the nearest `ThemeProvider`.
7
+ *
8
+ * @returns The chosen `theme` and `setTheme`, the `resolvedMode` (light or dark) and the `themeRoot`
9
+ * element carrying `data-theme`.
10
+ */
5
11
  const useTheme = () => {
6
12
  const context = useContext(ThemeContext);
7
13
  if (context === undefined) {
@@ -15,7 +21,11 @@ const resolveSystemPreference = () => {
15
21
  return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
16
22
  };
17
23
  /**
18
- * @summary app-wide light/dark/system theme provider that renders a themed `display: contents` wrapper carrying `data-theme`
24
+ * Provides light/dark/system theme context, persisted to `localStorage` and following the OS
25
+ * when set to `system`. Renders a `display: contents` wrapper carrying `data-theme` so tokens
26
+ * and the Tailwind `dark:` variant cascade, including inside CSS-scoped micro-frontends.
27
+ *
28
+ * @summary light/dark/system theme provider carrying data-theme
19
29
  */
20
30
  const ThemeProvider = ({ children, defaultTheme = 'system', storageKey = 'ui-theme', themeModeOverride }) => {
21
31
  const [theme, setTheme] = useState(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/providers/ThemeProvider/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;AAcA,MAAM,YAAY,GAAG,aAAa,CAA+B,SAAS,CAAC;AAEpE,MAAM,QAAQ,GAAG,MAAuB;AAC7C,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC;AAExC,IAAA,IAAI,OAAO,KAAK,SAAS,EAAE;AACzB,QAAA,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC;IACjE;AAEA,IAAA,OAAO,OAAO;AAChB;AAEA,MAAM,uBAAuB,GAAG,MAAuB;IACrD,IAAI,OAAO,MAAM,KAAK,WAAW;AAAE,QAAA,OAAO,OAAO;AACjD,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,GAAG,MAAM,GAAG,OAA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rE,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAE9D,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAEvI,IAAA,QACEA,GAAA,CAAC,YAAY,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,YAAY,EAAA,QAAA,EACxCA,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,YAAY,EAAA,YAAA,EAAc,YAAY,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAA,QAAA,EAC7E,QAAQ,EAAA,CACL,EAAA,CACgB;AAE5B;;"}
@@ -71,7 +71,11 @@ const UIProviderInner = ({ children, baseUrl, errorBoundary, portalContainer })
71
71
  return (jsxRuntime.jsx(reactRouter.BrowserRouter, { basename: baseUrl, children: jsxRuntime.jsx(RouteProvider.RouteProvider, { children: jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { ...errorBoundary, children: jsxRuntime.jsx(PortalContainer.PortalContainer, { getContainer: getContainer, children: children }) }) }) }));
72
72
  };
73
73
  /**
74
- * @summary single entry-point provider that composes theme, routing, and an error boundary for consuming apps
74
+ * Single entry-point provider that composes `ThemeProvider`, `RouteProvider`, `ErrorBoundary`
75
+ * and overlay portalling for a consuming app. Wire it once at the root; pass `portalContainer`
76
+ * only when overlays must land in a specific container.
77
+ *
78
+ * @summary root provider composing theme, routing, errors and portals
75
79
  */
76
80
  const UIProvider = ({ children, themeModeOverride, ...rest }) => {
77
81
  // TODO(i18n): add an internal library translation context so ui-library components can
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/providers/UIProvider/index.tsx"],"sourcesContent":[null],"names":["useTheme","useState","useRef","useLayoutEffect","useCallback","_jsx","BrowserR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{"version":3,"file":"index.cjs","sources":["../../../src/providers/UIProvider/index.tsx"],"sourcesContent":[null],"names":["useTheme","useState","useRef","useLayoutEffect","useCallback","_jsx","BrowserRouter","RouteProvider","ErrorBoundary","PortalContainer","ThemeProvider"],"mappings":";;;;;;;;;;AA2CA,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAiE,KAAI;IAC/I,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAGA,sBAAQ,EAAE;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGC,cAAQ,CAAqB,IAAI,CAAC;AAC1E,IAAA,MAAM,gBAAgB,GAAGC,YAAM,CAAqB,IAAI,CAAC;AACzD,IAAA,MAAM,qBAAqB,GAAGA,YAAM,CAAqB,IAAI,CAAC;;;;;;;;IAS9DC,qBAAe,CAAC,MAAK;AACnB,QAAA,MAAM,QAAQ,GAAG,eAAe,IAAI,IAAI,IAAI;AAC5C,QAAA,IAAI,QAAQ,KAAK,qBAAqB,CAAC,OAAO,EAAE;YAC9C;QACF;AAEA,QAAA,qBAAqB,CAAC,OAAO,GAAG,QAAQ;AACxC,QAAA,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE;AAClC,QAAA,gBAAgB,CAAC,OAAO,GAAG,IAAI;QAE/B,IAAI,CAAC,QAAQ,EAAE;YACb,eAAe,CAAC,IAAI,CAAC;YACrB;QACF;QAEA,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AAC5C,QAAA,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,UAAU;AACjC,QAAA,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC;AAC/C,QAAA,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC;AAC5B,QAAA,gBAAgB,CAAC,OAAO,GAAG,MAAM;QACjC,eAAe,CAAC,MAAM,CAAC;AACzB,IAAA,CAAC,CAAC;AAE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AAA,QAAA,EACjDL,cAAA,CAAC,eAAe,OAAK,IAAI,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CACzC;AAEpB;;"}
@@ -34,7 +34,11 @@ export interface UIProviderProps {
34
34
  portalContainer?: (() => HTMLElement | null) | null;
35
35
  }
36
36
  /**
37
- * @summary single entry-point provider that composes theme, routing, and an error boundary for consuming apps
37
+ * Single entry-point provider that composes `ThemeProvider`, `RouteProvider`, `ErrorBoundary`
38
+ * and overlay portalling for a consuming app. Wire it once at the root; pass `portalContainer`
39
+ * only when overlays must land in a specific container.
40
+ *
41
+ * @summary root provider composing theme, routing, errors and portals
38
42
  */
39
43
  export declare const UIProvider: ({ children, themeModeOverride, ...rest }: PropsWithChildren<UIProviderProps>) => import("react").JSX.Element;
40
44
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/UIProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAItG,OAAO,EAAE,KAAK,iBAAiB,EAAkD,MAAM,OAAO,CAAC;AAG/F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IACpD;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;CACrD;AAoFD;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,0CAA0C,iBAAiB,CAAC,eAAe,CAAC,gCAUtG,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/UIProvider/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAItG,OAAO,EAAE,KAAK,iBAAiB,EAAkD,MAAM,OAAO,CAAC;AAG/F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IACpD;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;CACrD;AAoFD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,0CAA0C,iBAAiB,CAAC,eAAe,CAAC,gCAUtG,CAAC"}
@@ -69,7 +69,11 @@ const UIProviderInner = ({ children, baseUrl, errorBoundary, portalContainer })
69
69
  return (jsx(BrowserRouter, { basename: baseUrl, children: jsx(RouteProvider, { children: jsx(ErrorBoundary, { ...errorBoundary, children: jsx(PortalContainer, { getContainer: getContainer, children: children }) }) }) }));
70
70
  };
71
71
  /**
72
- * @summary single entry-point provider that composes theme, routing, and an error boundary for consuming apps
72
+ * Single entry-point provider that composes `ThemeProvider`, `RouteProvider`, `ErrorBoundary`
73
+ * and overlay portalling for a consuming app. Wire it once at the root; pass `portalContainer`
74
+ * only when overlays must land in a specific container.
75
+ *
76
+ * @summary root provider composing theme, routing, errors and portals
73
77
  */
74
78
  const UIProvider = ({ children, themeModeOverride, ...rest }) => {
75
79
  // TODO(i18n): add an internal library translation context so ui-library components can
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/providers/UIProvider/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;;AA2CA,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAiE,KAAI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AC,YAAY,EAAE,YAAY,CAAC;AACpE,IAAA,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;;;;;;;AAQlB,IAAA,MAAM,YAAY,GAAG,WAAW,CAAC,MAAK;AACpC,QAAA,MAAM,QAAQ,GAAG,eAAe,IAAI,IAAI,IAAI;QAC5C,IAAI,QAAQ,EAAE;AACZ,YAAA,OAAO,QAAQ,KAAK,qBAAqB,CAAC,OAAO,GAAG,YAAY,GAAG,IAAI;QACzE;QACA,IAAI,eAAe,EAAE;AACnB,YAAA,OAAO,IAAI;QACb;AACA,QAAA,OAAO,SAAS;IAClB,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;AAE9C,IAAA,QACEA,GAAA,CAAC,aAAa,EAAA,EAAC,QAAQ,EAAE,OAAO,EAAA,QAAA,EAC9BA,GAAA,CAAC,aAAa,EAAA,EAAA,QAAA,EACZA,GAAA,CAAC,aAAa,EAAA,EAAA,GAAK,aAAa,EAAA,QAAA,EAC9BA,GAAA,CAAC,eAAe,EAAA,EAAC,YAAY,EAAE,YAAY,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CAC3D,EAAA,CACF,EAAA,CACF;AAEpB,CAAC;AAED;;;;;;AAMG;AACI,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAI,EAAsC,KAAI;;;;;AAKzG,IAAA,QACEA,GAAA,CAAC,aAAa,EAAA,EAAC,iBAAiB,EAAE,iBAAiB,EAAA,QAAA,EACjDA,GAAA,CAAC,eAAe,OAAK,IAAI,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAmB,EAAA,CACzC;AAEpB;;"}
@@ -45,13 +45,14 @@ const KEYFRAME_STEP = /^(from|to|\d+(\.\d+)?%)$/;
45
45
  /** Escape a string for safe use as a literal inside a `RegExp`. */
46
46
  const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
47
47
  /**
48
- * Build the `transform` callback for `postcss-prefix-selector` that scopes Tailwind v4 output
48
+ * Builds the `transform` callback for `postcss-prefix-selector` that scopes Tailwind v4 output
49
49
  * under `scopeSelector`.
50
50
  *
51
- * @param scopeSelector The selector every rule is scoped under (e.g. `'#flipdish-micro-frontend'`
52
- * or `'[data-tailwind]'`). Must match the `prefix` passed to `postcss-prefix-selector`.
53
- * @param options Behavioural toggles — see {@link ScopedPrefixTransformOptions}.
54
- * @returns A `(prefix, selector, prefixedSelector, filePath?) => string` transform.
51
+ * @param scopeSelector The selector every rule is scoped under, such as
52
+ * `'#flipdish-micro-frontend'`; must match the `prefix` passed to `postcss-prefix-selector`.
53
+ * @param options Behavioural toggles; see `ScopedPrefixTransformOptions`.
54
+ * @returns The `(prefix, selector, prefixedSelector, filePath?) => string` transform to pass
55
+ * to the plugin.
55
56
  */
56
57
  function createScopedPrefixTransform(scopeSelector, options = {}) {
57
58
  const { shouldScope, scopeBody = false, matchRootElement = false } = options;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/utilities/cssScopeUtils/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AA4BH;AACA,MAAM,aAAa,GAAG,0BAA0B;AAEhD;AACA,MAAM,YAAY,GAAG,CAAC,KAAa,KAAa,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;AAE5F;;;;;;;;AAQG;SACa,2BAA2B,CACzC,aAAqB,EACrB,UAAwC,EAAE,EAAA;AAE1C,IAAA,MAAM,EAAE,WAAW,EAAE,SAAS,GAAG,KAAK,EAAE,gBAAgB,GAAG,KAAK,EAAE,GAAG,OAAO;AAE5E,IAAA,MAAM,uBAAuB,GAAG,aAAa,CAAC,IAAI,EAAE;IACpD,IAAI,CAAC,uBAAuB,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC;IAC/F;;;;;AAM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G,QAAQ,CAAA,EAAA,EAAK,gBAAgB,EAAE;QACpD;;;AAIA,QAAA,OAAO,gBAAgB;AACzB,IAAA,CAAC;AACH;;"}
@@ -64,13 +64,14 @@ export interface ScopedPrefixTransformOptions {
64
64
  matchRootElement?: boolean;
65
65
  }
66
66
  /**
67
- * Build the `transform` callback for `postcss-prefix-selector` that scopes Tailwind v4 output
67
+ * Builds the `transform` callback for `postcss-prefix-selector` that scopes Tailwind v4 output
68
68
  * under `scopeSelector`.
69
69
  *
70
- * @param scopeSelector The selector every rule is scoped under (e.g. `'#flipdish-micro-frontend'`
71
- * or `'[data-tailwind]'`). Must match the `prefix` passed to `postcss-prefix-selector`.
72
- * @param options Behavioural toggles — see {@link ScopedPrefixTransformOptions}.
73
- * @returns A `(prefix, selector, prefixedSelector, filePath?) => string` transform.
70
+ * @param scopeSelector The selector every rule is scoped under, such as
71
+ * `'#flipdish-micro-frontend'`; must match the `prefix` passed to `postcss-prefix-selector`.
72
+ * @param options Behavioural toggles; see `ScopedPrefixTransformOptions`.
73
+ * @returns The `(prefix, selector, prefixedSelector, filePath?) => string` transform to pass
74
+ * to the plugin.
74
75
  */
75
76
  export declare function createScopedPrefixTransform(scopeSelector: string, options?: ScopedPrefixTransformOptions): (prefix: string, selector: string, prefixedSelector: string, filePath?: string) => string;
76
77
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/cssScopeUtils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,MAAM,WAAW,4BAA4B;IAC3C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC;IACxD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAQD;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,4BAAiC,GACzC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CA0D3F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/cssScopeUtils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,MAAM,WAAW,4BAA4B;IAC3C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC;IACxD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAQD;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,4BAAiC,GACzC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CA0D3F"}
@@ -43,13 +43,14 @@ const KEYFRAME_STEP = /^(from|to|\d+(\.\d+)?%)$/;
43
43
  /** Escape a string for safe use as a literal inside a `RegExp`. */
44
44
  const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
45
45
  /**
46
- * Build the `transform` callback for `postcss-prefix-selector` that scopes Tailwind v4 output
46
+ * Builds the `transform` callback for `postcss-prefix-selector` that scopes Tailwind v4 output
47
47
  * under `scopeSelector`.
48
48
  *
49
- * @param scopeSelector The selector every rule is scoped under (e.g. `'#flipdish-micro-frontend'`
50
- * or `'[data-tailwind]'`). Must match the `prefix` passed to `postcss-prefix-selector`.
51
- * @param options Behavioural toggles — see {@link ScopedPrefixTransformOptions}.
52
- * @returns A `(prefix, selector, prefixedSelector, filePath?) => string` transform.
49
+ * @param scopeSelector The selector every rule is scoped under, such as
50
+ * `'#flipdish-micro-frontend'`; must match the `prefix` passed to `postcss-prefix-selector`.
51
+ * @param options Behavioural toggles; see `ScopedPrefixTransformOptions`.
52
+ * @returns The `(prefix, selector, prefixedSelector, filePath?) => string` transform to pass
53
+ * to the plugin.
53
54
  */
54
55
  function createScopedPrefixTransform(scopeSelector, options = {}) {
55
56
  const { shouldScope, scopeBody = false, matchRootElement = false } = options;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/utilities/cssScopeUtils/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AA4BH;AACA,MAAM,aAAa,GAAG,0BAA0B;AAEhD;AACA,MAAM,YAAY,GAAG,CAAC,KAAa,KAAa,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;AAE5F;;;;;;;;AAQG;SACa,2BAA2B,CACzC,aAAqB,EACrB,UAAwC,EAAE,EAAA;AAE1C,IAAA,MAAM,EAAE,WAAW,EAAE,SAAS,GAAG,KAAK,EAAE,gBAAgB,GAAG,KAAK,EAAE,GAAG,OAAO;AAE5E,IAAA,MAAM,uBAAuB,GAAG,aAAa,CAAC,IAAI,EAAE;IACpD,IAAI,CAAC,uBAAuB,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC;IAC/F;;;;;AAMA,IAAA,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,CAAA,CAAA,EAAI,YAAY,CAAC,uBAAuB,CAAC,CAAA,qBAAA,CAAuB,CAAC;IAElG,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,KAAI;;QAEtD,IAAI,WAAW,IAAI,CAAC,WA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- * same inputs as tailwind-merge — strings, arrays, and falsy values for
23
- * conditionals — so it composes cleanly:
21
+ * Merges Tailwind class strings so the last conflicting value wins; accepts strings, arrays
22
+ * and falsy values like tailwind-merge, and is pure JS so it works on web and React Native.
24
23
  *
25
24
  * cx('px-2', isActive && 'bg-primary', ['text-sm', null]);
26
25
  *
27
- * Pure JS with no DOM dependency, so the same helper works on web (PostCSS) and
28
- * React Native (NativeWind). Imported by components as
29
- * `@flipdish/ui-library/utilities/cx`.
26
+ * @param inputs Class strings, arrays of them, or falsy values for conditionals.
27
+ * @returns One class string with conflicts resolved and falsy inputs dropped.
30
28
  */
31
29
  const cx = twMerge;
32
30
  /**
33
- * Identity helper that exists only so Tailwind IntelliSense recognises and sorts
34
- * the class strings held inside style-config objects (the `*.styles.ts` sortCx
35
- * maps components use). Returns its argument unchanged.
31
+ * Identity helper so Tailwind IntelliSense recognises and sorts the class strings inside
32
+ * `*.styles.ts` maps.
33
+ *
34
+ * @param classes A style map of literal Tailwind class strings.
35
+ * @returns The same object, unchanged.
36
36
  */
37
37
  const sortCx = (classes) => classes;
38
38
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/utilities/cx/index.ts"],"sourcesContent":[null],"names":["extendTailwindMerge"],"mappings":";;;;AAEA;;;;;;;AAOG;AACH,MAAM,OAAO,GAAGA,iCAAmB,CAAC;AAClC,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC;AAC5F,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEF;;;;;;;;;;AAUG;AACI,MAAM,EAAE,GAAG;AAKlB;;;;AAIG;AACI,MAAM,MAAM,GAAG,CAA4B,OAAU,KAAQ;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/utilities/cx/index.ts"],"sourcesContent":[null],"names":["extendTailwindMerge"],"mappings":";;;;AAEA;;;;;;;AAOG;AACH,MAAM,OAAO,GAAGA,iCAAmB,CAAC;AAClC,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC;AAC5F,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEF;;;;;;;;AAQG;AACI,MAAM,EAAE,GAAG;AAKlB;;;;;;AAMG;AACI,MAAM,MAAM,GAAG,CAA4B,OAAU,KAAQ;;;"}
@@ -1,21 +1,21 @@
1
1
  /**
2
- * Merge Tailwind class strings, resolving conflicts (last value wins). Accepts the
3
- * same inputs as tailwind-merge — strings, arrays, and falsy values for
4
- * conditionals — so it composes cleanly:
2
+ * Merges Tailwind class strings so the last conflicting value wins; accepts strings, arrays
3
+ * and falsy values like tailwind-merge, and is pure JS so it works on web and React Native.
5
4
  *
6
5
  * cx('px-2', isActive && 'bg-primary', ['text-sm', null]);
7
6
  *
8
- * Pure JS with no DOM dependency, so the same helper works on web (PostCSS) and
9
- * React Native (NativeWind). Imported by components as
10
- * `@flipdish/ui-library/utilities/cx`.
7
+ * @param inputs Class strings, arrays of them, or falsy values for conditionals.
8
+ * @returns One class string with conflicts resolved and falsy inputs dropped.
11
9
  */
12
10
  export declare const cx: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
13
11
  type ClassValue = string | number;
14
12
  type ClassDefinition = Record<string, ClassValue | Record<string, ClassValue | Record<string, ClassValue>>>;
15
13
  /**
16
- * Identity helper that exists only so Tailwind IntelliSense recognises and sorts
17
- * the class strings held inside style-config objects (the `*.styles.ts` sortCx
18
- * maps components use). Returns its argument unchanged.
14
+ * Identity helper so Tailwind IntelliSense recognises and sorts the class strings inside
15
+ * `*.styles.ts` maps.
16
+ *
17
+ * @param classes A style map of literal Tailwind class strings.
18
+ * @returns The same object, unchanged.
19
19
  */
20
20
  export declare const sortCx: <T extends ClassDefinition>(classes: T) => T;
21
21
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/cx/index.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,EAAE,sEAAU,CAAC;AAE1B,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAClC,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;AAE5G;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,eAAe,EAAE,SAAS,CAAC,KAAG,CAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/cx/index.ts"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,eAAO,MAAM,EAAE,sEAAU,CAAC;AAE1B,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAClC,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;AAE5G;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,eAAe,EAAE,SAAS,CAAC,KAAG,CAAY,CAAC"}
@@ -16,21 +16,21 @@ const twMerge = extendTailwindMerge({
16
16
  },
17
17
  });
18
18
  /**
19
- * Merge Tailwind class strings, resolving conflicts (last value wins). Accepts the
20
- * same inputs as tailwind-merge — strings, arrays, and falsy values for
21
- * conditionals — so it composes cleanly:
19
+ * Merges Tailwind class strings so the last conflicting value wins; accepts strings, arrays
20
+ * and falsy values like tailwind-merge, and is pure JS so it works on web and React Native.
22
21
  *
23
22
  * cx('px-2', isActive && 'bg-primary', ['text-sm', null]);
24
23
  *
25
- * Pure JS with no DOM dependency, so the same helper works on web (PostCSS) and
26
- * React Native (NativeWind). Imported by components as
27
- * `@flipdish/ui-library/utilities/cx`.
24
+ * @param inputs Class strings, arrays of them, or falsy values for conditionals.
25
+ * @returns One class string with conflicts resolved and falsy inputs dropped.
28
26
  */
29
27
  const cx = twMerge;
30
28
  /**
31
- * Identity helper that exists only so Tailwind IntelliSense recognises and sorts
32
- * the class strings held inside style-config objects (the `*.styles.ts` sortCx
33
- * maps components use). Returns its argument unchanged.
29
+ * Identity helper so Tailwind IntelliSense recognises and sorts the class strings inside
30
+ * `*.styles.ts` maps.
31
+ *
32
+ * @param classes A style map of literal Tailwind class strings.
33
+ * @returns The same object, unchanged.
34
34
  */
35
35
  const sortCx = (classes) => classes;
36
36
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/utilities/cx/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;AAOG;AACH,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAClC,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC;AAC5F,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEF;;;;;;;;;;AAUG;AACI,MAAM,EAAE,GAAG;AAKlB;;;;AAIG;AACI,MAAM,MAAM,GAAG,CAA4B,OAAU,KAAQ;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/utilities/cx/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;AAOG;AACH,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAClC,IAAA,MAAM,EAAE;AACN,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC;AAC5F,SAAA;AACF,KAAA;AACF,CAAA,CAAC;AAEF;;;;;;;;AAQG;AACI,MAAM,EAAE,GAAG;AAKlB;;;;;;AAMG;AACI,MAAM,MAAM,GAAG,CAA4B,OAAU,KAAQ;;"}
@@ -10,14 +10,12 @@ const KNOWN_BLOCKED_SCHEMES = ['javascript:', 'data:', 'vbscript:', 'file:', 'bl
10
10
  // biome-ignore lint/suspicious/noControlCharactersInRegex: removing control characters is the point
11
11
  const CONTROL_CHARACTERS = /[\u0000-\u001F\u007F]/g;
12
12
  /**
13
- * Validates a consumer-supplied `href` for safe use on an anchor.
13
+ * Validates a consumer-supplied `href` before it reaches an anchor: strips control characters
14
+ * and rejects schemes outside http, https, mailto and tel, blocking `javascript:` and `data:`
15
+ * URLs.
14
16
  *
15
- * Strips ASCII control characters, then rejects any explicit scheme outside
16
- * http/https/mailto/tel — blocking `javascript:`, `data:` and friends. Scheme-less
17
- * values (relative paths, fragments, bare domains) are allowed.
18
- *
19
- * @returns the cleaned href, or `undefined` when the href is not allowed (rendering
20
- * an anchor with no `href` rather than an executable one).
17
+ * @param href The value a consumer passed, possibly from user or CMS data.
18
+ * @returns The cleaned href, or `undefined` when blocked so the anchor renders without one.
21
19
  */
22
20
  const safeHref = (href) => {
23
21
  if (href === undefined) {
@@ -38,10 +36,11 @@ const safeHref = (href) => {
38
36
  return cleaned;
39
37
  };
40
38
  /**
41
- * Whether an href points at an external site (http/https), for `target="_blank"`
42
- * decisions. Unlike a bare `startsWith('http')`, this requires a real scheme match on
43
- * the control-character-stripped value, so `javascript:` never classifies as internal
44
- * by falling through, and `httpfoo` never classifies as external.
39
+ * Whether an href points at an external http/https site, for `target="_blank"` decisions,
40
+ * matched on the real scheme so `javascript:` and `httpfoo` never misclassify.
41
+ *
42
+ * @param href The value to classify; control characters are stripped first.
43
+ * @returns `true` only for an explicit `http:` or `https:` scheme.
45
44
  */
46
45
  const isExternalHref = (href) => /^https?:/i.test((href ?? '').replace(CONTROL_CHARACTERS, '').trim());
47
46
 
@@ -1 +1 @@
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BAAkB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;;;"}
@@ -1,19 +1,18 @@
1
1
  /**
2
- * Validates a consumer-supplied `href` for safe use on an anchor.
2
+ * Validates a consumer-supplied `href` before it reaches an anchor: strips control characters
3
+ * and rejects schemes outside http, https, mailto and tel, blocking `javascript:` and `data:`
4
+ * URLs.
3
5
  *
4
- * Strips ASCII control characters, then rejects any explicit scheme outside
5
- * http/https/mailto/tel — blocking `javascript:`, `data:` and friends. Scheme-less
6
- * values (relative paths, fragments, bare domains) are allowed.
7
- *
8
- * @returns the cleaned href, or `undefined` when the href is not allowed (rendering
9
- * an anchor with no `href` rather than an executable one).
6
+ * @param href The value a consumer passed, possibly from user or CMS data.
7
+ * @returns The cleaned href, or `undefined` when blocked so the anchor renders without one.
10
8
  */
11
9
  export declare const safeHref: (href: string | undefined) => string | undefined;
12
10
  /**
13
- * Whether an href points at an external site (http/https), for `target="_blank"`
14
- * decisions. Unlike a bare `startsWith('http')`, this requires a real scheme match on
15
- * the control-character-stripped value, so `javascript:` never classifies as internal
16
- * by falling through, and `httpfoo` never classifies as external.
11
+ * Whether an href points at an external http/https site, for `target="_blank"` decisions,
12
+ * matched on the real scheme so `javascript:` and `httpfoo` never misclassify.
13
+ *
14
+ * @param href The value to classify; control characters are stripped first.
15
+ * @returns `true` only for an explicit `http:` or `https:` scheme.
17
16
  */
18
17
  export declare const isExternalHref: (href: string | undefined) => boolean;
19
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/hrefUtils/index.ts"],"names":[],"mappings":"AAYA;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAoB5D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,GAAG,SAAS,KAAG,OAAgF,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/hrefUtils/index.ts"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAoB5D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,GAAG,SAAS,KAAG,OAAgF,CAAC"}
@@ -8,14 +8,12 @@ const KNOWN_BLOCKED_SCHEMES = ['javascript:', 'data:', 'vbscript:', 'file:', 'bl
8
8
  // biome-ignore lint/suspicious/noControlCharactersInRegex: removing control characters is the point
9
9
  const CONTROL_CHARACTERS = /[\u0000-\u001F\u007F]/g;
10
10
  /**
11
- * Validates a consumer-supplied `href` for safe use on an anchor.
11
+ * Validates a consumer-supplied `href` before it reaches an anchor: strips control characters
12
+ * and rejects schemes outside http, https, mailto and tel, blocking `javascript:` and `data:`
13
+ * URLs.
12
14
  *
13
- * Strips ASCII control characters, then rejects any explicit scheme outside
14
- * http/https/mailto/tel — blocking `javascript:`, `data:` and friends. Scheme-less
15
- * values (relative paths, fragments, bare domains) are allowed.
16
- *
17
- * @returns the cleaned href, or `undefined` when the href is not allowed (rendering
18
- * an anchor with no `href` rather than an executable one).
15
+ * @param href The value a consumer passed, possibly from user or CMS data.
16
+ * @returns The cleaned href, or `undefined` when blocked so the anchor renders without one.
19
17
  */
20
18
  const safeHref = (href) => {
21
19
  if (href === undefined) {
@@ -36,10 +34,11 @@ const safeHref = (href) => {
36
34
  return cleaned;
37
35
  };
38
36
  /**
39
- * Whether an href points at an external site (http/https), for `target="_blank"`
40
- * decisions. Unlike a bare `startsWith('http')`, this requires a real scheme match on
41
- * the control-character-stripped value, so `javascript:` never classifies as internal
42
- * by falling through, and `httpfoo` never classifies as external.
37
+ * Whether an href points at an external http/https site, for `target="_blank"` decisions,
38
+ * matched on the real scheme so `javascript:` and `httpfoo` never misclassify.
39
+ *
40
+ * @param href The value to classify; control characters are stripped first.
41
+ * @returns `true` only for an explicit `http:` or `https:` scheme.
43
42
  */
44
43
  const isExternalHref = (href) => /^https?:/i.test((href ?? '').replace(CONTROL_CHARACTERS, '').trim());
45
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/utilities/hrefUtils/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;AAEhE;AACA,MAAM,qBAAqB,GAAG,CAAC,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;AAE7F;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,wBAAwB;AAEnD;;;;;;;;;AASG;AACI,MAAM,QAAQ,GAAG,CAAC,IAAwB,KAAwB;AACvE,IAAA,IAAI,IAAI,KAAK,SAAS,EAAE;AACtB,QAAA,OAAO,SAAS;IAClB;IACA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;AACpD,IAAA,MAAM,MAAM,GAAG,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE;IAC7E,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;;;;;;QAMjD,MAAM,KAAK,GAAG,qBAAqB,CAAC,QAAQ,CAAC,MAAM,CAAC;QACpD,QAAQ,CACN,CAAA,SAAA,EAAY,KAAK,GAAG,MAAM,GAAG,cAAc,CAAA,CAAE,EAC7C,CAAA,8BAAA,EAAiC,KAAK,GAAG,CAAA,mBAAA,EAAsB,MAAM,CAAA,CAAA,CAAG,GAAG,0BAA0B,CAAA,4FAAA,CAA8F,CACpM;AACD,QAAA,OAAO,SAAS;IAClB;AACA,IAAA,OAAO,OAAO;AAChB;AAEA;;;;;AAKG;AACI,MAAM,cAAc,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AM,cAAc,GAAG,CAAC,IAAwB,KAAc,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,EAAE,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;;"}
@@ -14,12 +14,15 @@ var localStorageUtils_constants = require('./localStorageUtils.constants.cjs');
14
14
  * — check there for the full list before adding a new one.
15
15
  */
16
16
  /**
17
- * Build a typed, failure-safe accessor for a single `localStorage` key.
17
+ * Builds a typed, failure-safe accessor for a single `localStorage` key.
18
18
  *
19
- * @example
20
- * const draft = createLocalStorageItem<Draft>('fd-draft');
21
- * draft.set({ title: 'Hi' });
22
- * const value = draft.get(); // Draft | null
19
+ * const draft = createLocalStorageItem<Draft>('fd-draft'); draft.set({ title: 'Hi' }); draft.get(); // Draft | null
20
+ *
21
+ * @param key The storage key; register it in `LOCAL_STORAGE_KEYS` first.
22
+ * @param options Custom `serialize`/`deserialize` and a `validate` guard; see
23
+ * `LocalStorageItemOptions`.
24
+ * @returns `get`, `set` and `clear` that never throw; `get()` returns `null` when storage is
25
+ * unavailable, while `set()` and `clear()` return `void` and ignore failures.
23
26
  */
24
27
  const createLocalStorageItem = (key, options = {}) => webStorage_utils.createWebStorageItem(() => window.localStorage, key, options);
25
28
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/utilities/localStorageUtils/index.ts"],"sourcesContent":[null],"names":["createWebStorageItem","LOCAL_STORAGE_KEYS","parseBooleanString","isBoolean","isString"],"mappings":";;;;;AAAA;;;;;;;;;AASG;AA2BH;;;;;;;AAOG;AACI,MAAM,sBAAsB,GAAG,CAAI,GAAW,EAAE,OAAA,GAAsC,EAAE,KAC7FA,qCAAoB,CAAC,MAAM,MAAM,CAAC,YAAY,EAAE,GAAG,EAAE,OAAO;AAE9D;;;AAGG;MACU,uBAAuB,GAAG,sBAAsB,CAAUC,8CAAkB,CAAC,gBAAgB,EAAE;AAC1G,IAAA,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,CAAC,GAAG,KAAKC,mCAAkB,CAAC,GAAG,EAAE,iCAAiC,CAAC;AAChF,IAAA,QAAQ,EAAEC,0BAAS;AACpB,CAAA;AAED;MACa,gBAAgB,GAAG,sBAAsB,CAASF,8CAAkB,CAAC,SAAS,EAAE;AAC3F,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,WAAW,EAAE,CAAC,GAAG,KAAK,GAAG;AACzB,IAAA,QAAQ,EAAEG,yBAAQ;AACnB,CAAA;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/utilities/localStorageUtils/index.ts"],"sourcesContent":[null],"names":["createWebStorageItem","LOCAL_STORAGE_KEYS","parseBooleanString","isBoolean","isString"],"mappings":";;;;;AAAA;;;;;;;;;AASG;AA2BH;;;;;;;;;;AAUG;AACI,MAAM,sBAAsB,GAAG,CAAI,GAAW,EAAE,OAAA,GAAsC,EAAE,KAC7FA,qCAAoB,CAAC,MAAM,MAAM,CAAC,YAAY,EAAE,GAAG,EAAE,OAAO;AAE9D;;;AAGG;MACU,uBAAuB,GAAG,sBAAsB,CAAUC,8CAAkB,CAAC,gBAAgB,EAAE;AAC1G,IAAA,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,CAAC,GAAG,KAAKC,mCAAkB,CAAC,GAAG,EAAE,iCAAiC,CAAC;AAChF,IAAA,QAAQ,EAAEC,0BAAS;AACpB,CAAA;AAED;MACa,gBAAgB,GAAG,sBAAsB,CAASF,8CAAkB,CAAC,SAAS,EAAE;AAC3F,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,WAAW,EAAE,CAAC,GAAG,KAAK,GAAG;AACzB,IAAA,QAAQ,EAAEG,yBAAQ;AACnB,CAAA;;;;;"}
@@ -27,12 +27,15 @@ export interface LocalStorageItemOptions<T> {
27
27
  validate?: (value: unknown) => value is T;
28
28
  }
29
29
  /**
30
- * Build a typed, failure-safe accessor for a single `localStorage` key.
30
+ * Builds a typed, failure-safe accessor for a single `localStorage` key.
31
31
  *
32
- * @example
33
- * const draft = createLocalStorageItem<Draft>('fd-draft');
34
- * draft.set({ title: 'Hi' });
35
- * const value = draft.get(); // Draft | null
32
+ * const draft = createLocalStorageItem<Draft>('fd-draft'); draft.set({ title: 'Hi' }); draft.get(); // Draft | null
33
+ *
34
+ * @param key The storage key; register it in `LOCAL_STORAGE_KEYS` first.
35
+ * @param options Custom `serialize`/`deserialize` and a `validate` guard; see
36
+ * `LocalStorageItemOptions`.
37
+ * @returns `get`, `set` and `clear` that never throw; `get()` returns `null` when storage is
38
+ * unavailable, while `set()` and `clear()` return `void` and ignore failures.
36
39
  */
37
40
  export declare const createLocalStorageItem: <T>(key: string, options?: LocalStorageItemOptions<T>) => LocalStorageItem<T>;
38
41
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/localStorageUtils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAI9B,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,gFAAgF;IAChF,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChB,wEAAwE;IACxE,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IACpB,mDAAmD;IACnD,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC;IACjC,2DAA2D;IAC3D,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,CAAC;IACjC,oEAAoE;IACpE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC;CAC3C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,G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