@hirobius/design-system 0.13.1 → 0.15.0

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 (95) hide show
  1. package/README.md +49 -6
  2. package/dist/chunks/TokenDisplayContext-B3gxyQN7.js +1 -0
  3. package/dist/chunks/form-DnGRy27o.js +1 -0
  4. package/dist/contexts.js +63 -60
  5. package/dist/form.js +1 -0
  6. package/dist/hirobius-ui.js +4092 -3389
  7. package/dist/manifest.js +7 -7
  8. package/dist/scroll.js +1 -0
  9. package/dist/styles.css +1 -1
  10. package/dist/tokens.css +1 -1
  11. package/dist/types/src/app/components/activity-feed.d.ts +6 -0
  12. package/dist/types/src/app/components/alert.d.ts +1 -1
  13. package/dist/types/src/app/components/asset-img.d.ts +1 -1
  14. package/dist/types/src/app/components/avatar.d.ts +1 -0
  15. package/dist/types/src/app/components/badge.d.ts +1 -0
  16. package/dist/types/src/app/components/bleed.d.ts +1 -1
  17. package/dist/types/src/app/components/box.d.ts +2 -2
  18. package/dist/types/src/app/components/breadcrumb.d.ts +1 -0
  19. package/dist/types/src/app/components/button.d.ts +1 -0
  20. package/dist/types/src/app/components/callout.d.ts +1 -0
  21. package/dist/types/src/app/components/card.d.ts +10 -5
  22. package/dist/types/src/app/components/center.d.ts +1 -1
  23. package/dist/types/src/app/components/checkbox.d.ts +2 -2
  24. package/dist/types/src/app/components/cinematic-link.d.ts +1 -2
  25. package/dist/types/src/app/components/cluster.d.ts +1 -1
  26. package/dist/types/src/app/components/code-block.d.ts +2 -1
  27. package/dist/types/src/app/components/combobox.d.ts +1 -0
  28. package/dist/types/src/app/components/container.d.ts +1 -1
  29. package/dist/types/src/app/components/cover.d.ts +1 -1
  30. package/dist/types/src/app/components/dialog.d.ts +5 -0
  31. package/dist/types/src/app/components/disclosure.d.ts +2 -1
  32. package/dist/types/src/app/components/divider.d.ts +4 -0
  33. package/dist/types/src/app/components/doc-link-card.d.ts +1 -1
  34. package/dist/types/src/app/components/empty-state.d.ts +1 -0
  35. package/dist/types/src/app/components/error-boundary.d.ts +1 -1
  36. package/dist/types/src/app/components/error-pattern.d.ts +1 -2
  37. package/dist/types/src/app/components/field.d.ts +1 -0
  38. package/dist/types/src/app/components/form.d.ts +7 -1
  39. package/dist/types/src/app/components/frame.d.ts +1 -1
  40. package/dist/types/src/app/components/grid.d.ts +2 -2
  41. package/dist/types/src/app/components/heading-stack.d.ts +1 -1
  42. package/dist/types/src/app/components/icon-button.d.ts +3 -4
  43. package/dist/types/src/app/components/icon.d.ts +1 -1
  44. package/dist/types/src/app/components/image-lightbox.d.ts +1 -2
  45. package/dist/types/src/app/components/inline-code.d.ts +4 -1
  46. package/dist/types/src/app/components/inline-link.d.ts +2 -2
  47. package/dist/types/src/app/components/input.d.ts +1 -0
  48. package/dist/types/src/app/components/menu.d.ts +1 -0
  49. package/dist/types/src/app/components/nav-group.d.ts +3 -3
  50. package/dist/types/src/app/components/nav-item.d.ts +2 -2
  51. package/dist/types/src/app/components/page.d.ts +1 -1
  52. package/dist/types/src/app/components/pagination.d.ts +1 -0
  53. package/dist/types/src/app/components/pin.d.ts +1 -2
  54. package/dist/types/src/app/components/popover.d.ts +1 -0
  55. package/dist/types/src/app/components/progress.d.ts +1 -0
  56. package/dist/types/src/app/components/radio.d.ts +2 -2
  57. package/dist/types/src/app/components/reveal.d.ts +1 -2
  58. package/dist/types/src/app/components/segmented-control.d.ts +1 -1
  59. package/dist/types/src/app/components/sidebar.d.ts +1 -1
  60. package/dist/types/src/app/components/skeleton.d.ts +1 -0
  61. package/dist/types/src/app/components/slider.d.ts +2 -2
  62. package/dist/types/src/app/components/spinner.d.ts +1 -0
  63. package/dist/types/src/app/components/stack.d.ts +2 -2
  64. package/dist/types/src/app/components/stat.d.ts +1 -0
  65. package/dist/types/src/app/components/status-list-item.d.ts +1 -0
  66. package/dist/types/src/app/components/status-tile.d.ts +1 -0
  67. package/dist/types/src/app/components/stepper-field.d.ts +1 -2
  68. package/dist/types/src/app/components/surface.d.ts +2 -2
  69. package/dist/types/src/app/components/switcher.d.ts +1 -1
  70. package/dist/types/src/app/components/table.d.ts +1 -0
  71. package/dist/types/src/app/components/tabs.d.ts +6 -0
  72. package/dist/types/src/app/components/tag.d.ts +1 -0
  73. package/dist/types/src/app/components/textarea.d.ts +1 -0
  74. package/dist/types/src/app/components/toast.d.ts +1 -0
  75. package/dist/types/src/app/components/toggle.d.ts +2 -2
  76. package/dist/types/src/app/components/token.d.ts +1 -1
  77. package/dist/types/src/app/context/TenantContext.d.ts +19 -5
  78. package/dist/types/src/app/context/index.d.ts +7 -7
  79. package/dist/types/src/app/design-system/generated-token-refs.d.ts +1 -1
  80. package/dist/types/src/app/design-system/generated-token-values.d.ts +1 -1
  81. package/dist/types/src/app/design-system/theme.d.ts +1 -1
  82. package/dist/types/src/app/design-system/tokens.d.ts +2 -2
  83. package/dist/types/src/app/hooks/useHdsMotion.d.ts +1 -1
  84. package/dist/types/src/app/layouts/CaseStudyLayout.d.ts +2 -3
  85. package/dist/types/src/app/layouts/HdsSystemDocLayout.d.ts +1 -1
  86. package/dist/types/src/app/lib/hds-search.d.ts +1 -1
  87. package/dist/types/src/brand/index.d.ts +1 -1
  88. package/dist/types/src/form/index.d.ts +3 -3
  89. package/dist/types/src/index.d.ts +116 -116
  90. package/dist/types/src/lib/env.d.ts +31 -0
  91. package/dist/types/src/lib/manifest-entry.d.ts +1 -1
  92. package/dist/types/src/scroll/index.d.ts +2 -2
  93. package/hirobius.tokens.json +3 -3
  94. package/package.json +9 -6
  95. package/public/hds-manifest.json +785 -92
package/README.md CHANGED
@@ -14,7 +14,7 @@ A publishable React + TypeScript component library backed by a governed design-t
14
14
 
15
15
  - **108** public component modules, exported from `src/index.ts`
16
16
  - **362** DTCG tokens in `hirobius.tokens.json`, compiled to CSS variables and TypeScript constants
17
- - **442** Storybook stories in **112** story files, reviewed visually in Chromatic
17
+ - **447** Storybook stories in **113** story files, reviewed visually in Chromatic
18
18
 
19
19
  <!-- auto:end:front-door-counts -->
20
20
 
@@ -153,11 +153,54 @@ Source-of-truth files:
153
153
 
154
154
  Each component has one Figma source: `figmaUrl` in `public/hds-manifest.json`, which `pnpm manifest:generate` sets from the `@figma` tag in the component JSDoc. `pnpm figma:links` keeps this table current and Storybook reads the same field (`parameters.design`). The Figma-side links (dev resources and component descriptions) exist only once someone runs their steps in [`figma/README.md`](figma/README.md).
155
155
 
156
- **1 of 120** components link a Figma node.
157
-
158
- | Component | Figma node | Story | Source |
159
- | --------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------- | ----------------------------------------- |
160
- | `Alert` | [33:34](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=33-34) | [alert.stories.tsx](src/stories/alert.stories.tsx) | [alert.tsx](src/app/components/alert.tsx) |
156
+ **44 of 139** components link a Figma node.
157
+
158
+ | Component | Figma node | Story | Source |
159
+ | ------------------ | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------- |
160
+ | `Alert` | [33:34](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=33-34) | [alert.stories.tsx](src/stories/alert.stories.tsx) | [alert.tsx](src/app/components/alert.tsx) |
161
+ | `Avatar` | [34:18](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=34-18) | [avatar.stories.tsx](src/stories/avatar.stories.tsx) | [avatar.tsx](src/app/components/avatar.tsx) |
162
+ | `Badge` | [31:15](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=31-15) | [badge.stories.tsx](src/stories/badge.stories.tsx) | [badge.tsx](src/app/components/badge.tsx) |
163
+ | `Breadcrumb` | [86:159](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=86-159) | [breadcrumb.stories.tsx](src/stories/breadcrumb.stories.tsx) | [breadcrumb.tsx](src/app/components/breadcrumb.tsx) |
164
+ | `Button` | [28:138](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=28-138) | [button.stories.tsx](src/stories/button.stories.tsx) | [button.tsx](src/app/components/button.tsx) |
165
+ | `Callout` | [88:85](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-85) | [callout.stories.tsx](src/stories/callout.stories.tsx) | [callout.tsx](src/app/components/callout.tsx) |
166
+ | `Card` | [39:11](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=39-11) | [card.stories.tsx](src/stories/card.stories.tsx) | [card.tsx](src/app/components/card.tsx) |
167
+ | `CodeBlock` | [89:154](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=89-154) | [code-block.stories.tsx](src/stories/code-block.stories.tsx) | [code-block.tsx](src/app/components/code-block.tsx) |
168
+ | `Combobox` | [82:237](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=82-237) | [combobox.stories.tsx](src/stories/combobox.stories.tsx) | [combobox.tsx](src/app/components/combobox.tsx) |
169
+ | `Dialog` | [93:27](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=93-27) | [dialog.stories.tsx](src/stories/dialog.stories.tsx) | [dialog.tsx](src/app/components/dialog.tsx) |
170
+ | `Disclosure` | [88:453](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-453) | [disclosure.stories.tsx](src/stories/disclosure.stories.tsx) | [disclosure.tsx](src/app/components/disclosure.tsx) |
171
+ | `Divider` | [89:26](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=89-26) | [divider.stories.tsx](src/stories/divider.stories.tsx) | [divider.tsx](src/app/components/divider.tsx) |
172
+ | `EmptyState` | [88:352](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-352) | [empty-state.stories.tsx](src/stories/empty-state.stories.tsx) | [empty-state.tsx](src/app/components/empty-state.tsx) |
173
+ | `Field` | [85:81](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=85-81) | [field.stories.tsx](src/stories/field.stories.tsx) | [field.tsx](src/app/components/field.tsx) |
174
+ | `Form` | [85:94](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=85-94) | [form.stories.tsx](src/stories/form.stories.tsx) | [form.tsx](src/app/components/form.tsx) |
175
+ | `HdsCheckbox` | [35:29](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=35-29) | [checkbox.stories.tsx](src/stories/checkbox.stories.tsx) | [checkbox.tsx](src/app/components/checkbox.tsx) |
176
+ | `HdsRadio` | [36:17](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=36-17) | [radio.stories.tsx](src/stories/radio.stories.tsx) | [radio.tsx](src/app/components/radio.tsx) |
177
+ | `HdsSelect` | [82:49](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=82-49) | [select.stories.tsx](src/stories/select.stories.tsx) | [select.tsx](src/app/components/select.tsx) |
178
+ | `HdsSlider` | [82:265](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=82-265) | [slider.stories.tsx](src/stories/slider.stories.tsx) | [slider.tsx](src/app/components/slider.tsx) |
179
+ | `HdsToggle` | [37:19](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=37-19) | [toggle.stories.tsx](src/stories/toggle.stories.tsx) | [toggle.tsx](src/app/components/toggle.tsx) |
180
+ | `IconButton` | [40:39](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=40-39) | [icon-button.stories.tsx](src/stories/icon-button.stories.tsx) | [icon-button.tsx](src/app/components/icon-button.tsx) |
181
+ | `InlineCode` | [89:155](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=89-155) | [inline-code.stories.tsx](src/stories/inline-code.stories.tsx) | [inline-code.tsx](src/app/components/inline-code.tsx) |
182
+ | `InlineLink` | [89:161](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=89-161) | [inline-link.stories.tsx](src/stories/inline-link.stories.tsx) | [inline-link.tsx](src/app/components/inline-link.tsx) |
183
+ | `Input` | [38:20](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=38-20) | [input.stories.tsx](src/stories/input.stories.tsx) | [input.tsx](src/app/components/input.tsx) |
184
+ | `Menu` | [93:59](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=93-59) | [menu.stories.tsx](src/stories/menu.stories.tsx) | [menu.tsx](src/app/components/menu.tsx) |
185
+ | `NavGroup` | [86:304](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=86-304) | [nav-group.stories.tsx](src/stories/nav-group.stories.tsx) | [nav-group.tsx](src/app/components/nav-group.tsx) |
186
+ | `NavItem` | [86:258](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=86-258) | [nav-item.stories.tsx](src/stories/nav-item.stories.tsx) | [nav-item.tsx](src/app/components/nav-item.tsx) |
187
+ | `Pagination` | [86:194](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=86-194) | [pagination.stories.tsx](src/stories/pagination.stories.tsx) | [pagination.tsx](src/app/components/pagination.tsx) |
188
+ | `Popover` | [93:32](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=93-32) | [popover.stories.tsx](src/stories/popover.stories.tsx) | [popover.tsx](src/app/components/popover.tsx) |
189
+ | `Progress` | [88:91](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-91) | [progress.stories.tsx](src/stories/progress.stories.tsx) | [progress.tsx](src/app/components/progress.tsx) |
190
+ | `SegmentedControl` | [82:334](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=82-334) | [segmented-control.stories.tsx](src/stories/segmented-control.stories.tsx) | [segmented-control.tsx](src/app/components/segmented-control.tsx) |
191
+ | `SideNav` | [86:332](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=86-332) | [side-nav.stories.tsx](src/stories/side-nav.stories.tsx) | [side-nav.tsx](src/app/components/side-nav.tsx) |
192
+ | `Skeleton` | [88:95](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-95) | [skeleton.stories.tsx](src/stories/skeleton.stories.tsx) | [skeleton.tsx](src/app/components/skeleton.tsx) |
193
+ | `Spinner` | [88:106](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-106) | [spinner.stories.tsx](src/stories/spinner.stories.tsx) | [spinner.tsx](src/app/components/spinner.tsx) |
194
+ | `Stat` | [88:247](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-247) | [stat.stories.tsx](src/stories/stat.stories.tsx) | [stat.tsx](src/app/components/stat.tsx) |
195
+ | `StatusListItem` | [88:350](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-350) | [status-list-item.stories.tsx](src/stories/status-list-item.stories.tsx) | [status-list-item.tsx](src/app/components/status-list-item.tsx) |
196
+ | `StatusTile` | [88:292](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-292) | [status-tile.stories.tsx](src/stories/status-tile.stories.tsx) | [status-tile.tsx](src/app/components/status-tile.tsx) |
197
+ | `StepperField` | [82:425](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=82-425) | [stepper-field.stories.tsx](src/stories/stepper-field.stories.tsx) | [stepper-field.tsx](src/app/components/stepper-field.tsx) |
198
+ | `Surface` | [89:27](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=89-27) | [surface.stories.tsx](src/stories/surface.stories.tsx) | [surface.tsx](src/app/components/surface.tsx) |
199
+ | `Table` | [89:300](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=89-300) | [table.stories.tsx](src/stories/table.stories.tsx) | [table.tsx](src/app/components/table.tsx) |
200
+ | `Tabs` | [86:89](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=86-89) | [tabs.stories.tsx](src/stories/tabs.stories.tsx) | [tabs.tsx](src/app/components/tabs.tsx) |
201
+ | `Tag` | [32:11](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=32-11) | [tag.stories.tsx](src/stories/tag.stories.tsx) | [tag.tsx](src/app/components/tag.tsx) |
202
+ | `Textarea` | [85:14](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=85-14) | [textarea.stories.tsx](src/stories/textarea.stories.tsx) | [textarea.tsx](src/app/components/textarea.tsx) |
203
+ | `ToastProvider` | [93:367](https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=93-367) | [toast.stories.tsx](src/stories/toast.stories.tsx) | [toast.tsx](src/app/components/toast.tsx) |
161
204
 
162
205
  <!-- design-links:end -->
163
206
 
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as r } from "react/jsx-runtime";
2
3
  import { useContext as i, createContext as a, forwardRef as w, useState as l, useEffect as L, useCallback as c } from "react";
3
4
  const d = a(null);
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as m, jsxs as u } from "react/jsx-runtime";
2
3
  import * as s from "react";
3
4
  import { cn as p } from "../cn.js";
package/dist/contexts.js CHANGED
@@ -1,7 +1,8 @@
1
- import { jsx as f, Fragment as M } from "react/jsx-runtime";
2
- import { useState as u, useCallback as s, useEffect as a, useContext as S, createContext as D } from "react";
3
- import { F as K, H as Y, L as j, T as q, b as J, u as Q, a as W, c as X } from "./chunks/TokenDisplayContext-B3gxyQN7.js";
4
- const L = ["system", "light", "dark"], m = "hds-theme-mode", x = "hds-theme", _ = D({
1
+ 'use client';
2
+ import { jsx as l, Fragment as I } from "react/jsx-runtime";
3
+ import { useState as i, useCallback as a, useEffect as s, useContext as E, createContext as S } from "react";
4
+ import { F as j, H as q, L as N, T as V, b as J, u as Q, a as U, c as W } from "./chunks/TokenDisplayContext-B3gxyQN7.js";
5
+ const x = ["system", "light", "dark"], d = "hds-theme-mode", P = "hds-theme", T = S({
5
6
  isDark: !0,
6
7
  toggleDark: () => {
7
8
  },
@@ -14,22 +15,22 @@ const L = ["system", "light", "dark"], m = "hds-theme-mode", x = "hds-theme", _
14
15
  setDensity: () => {
15
16
  }
16
17
  });
17
- function T() {
18
+ function y() {
18
19
  try {
19
- const t = localStorage.getItem(m);
20
- if (t && L.includes(t)) return t;
20
+ const t = localStorage.getItem(d);
21
+ if (t && x.includes(t)) return t;
21
22
  } catch {
22
23
  }
23
24
  return "system";
24
25
  }
25
- function P() {
26
+ function L() {
26
27
  var t;
27
28
  return typeof window > "u" ? !1 : !!((t = window.matchMedia) != null && t.call(window, "(prefers-color-scheme: dark)").matches);
28
29
  }
29
- function E(t) {
30
- return t === "dark" ? !0 : t === "light" ? !1 : P();
30
+ function D(t) {
31
+ return t === "dark" ? !0 : t === "light" ? !1 : L();
31
32
  }
32
- function N() {
33
+ function C() {
33
34
  try {
34
35
  const t = localStorage.getItem("hds-density");
35
36
  if (t === "compact" || t === "comfortable") return t;
@@ -38,100 +39,102 @@ function N() {
38
39
  return "comfortable";
39
40
  }
40
41
  function F({ children: t }) {
41
- const [n, g] = u(T), [r, i] = u(() => E(T())), [c, h] = u(N), y = s((e) => {
42
+ const [n, f] = i(y), [r, u] = i(() => D(y())), [c, h] = i(C), g = a((e) => {
42
43
  const o = e ? "dark" : "light";
43
44
  try {
44
- localStorage.setItem(x, o);
45
+ localStorage.setItem(P, o);
45
46
  } catch {
46
47
  }
47
48
  document.documentElement.setAttribute("data-theme", o), document.documentElement.classList.toggle("dark", e);
48
49
  }, []);
49
- a(() => {
50
+ s(() => {
50
51
  try {
51
52
  localStorage.setItem("hds-density", c);
52
53
  } catch {
53
54
  }
54
55
  document.documentElement.setAttribute("data-density", c);
55
- }, [c]), a(() => {
56
- y(r);
57
- }, [r, y]), a(() => {
56
+ }, [c]), s(() => {
57
+ g(r);
58
+ }, [r, g]), s(() => {
58
59
  if (n !== "system" || typeof window > "u" || !window.matchMedia) return;
59
60
  const e = window.matchMedia("(prefers-color-scheme: dark)"), o = () => {
60
- i(e.matches);
61
+ u(e.matches);
61
62
  };
62
63
  return e.addEventListener("change", o), () => {
63
64
  e.removeEventListener("change", o);
64
65
  };
65
66
  }, [n]);
66
- const A = s(() => {
67
+ const b = a(() => {
67
68
  const e = !r, o = e ? "dark" : "light";
68
- g(o), i(e);
69
+ f(o), u(e);
69
70
  try {
70
- localStorage.setItem(m, o);
71
+ localStorage.setItem(d, o);
71
72
  } catch {
72
73
  }
73
- }, [r]), b = s((e) => {
74
- g(e), i(E(e));
74
+ }, [r]), A = a((e) => {
75
+ f(e), u(D(e));
75
76
  try {
76
- localStorage.setItem(m, e);
77
+ localStorage.setItem(d, e);
77
78
  } catch {
78
79
  }
79
- }, []), I = s(
80
+ }, []), w = a(
80
81
  () => h((e) => e === "comfortable" ? "compact" : "comfortable"),
81
82
  []
82
- ), w = s((e) => h(e), []);
83
- return /* @__PURE__ */ f(
84
- _.Provider,
83
+ ), M = a((e) => h(e), []);
84
+ return /* @__PURE__ */ l(
85
+ T.Provider,
85
86
  {
86
- value: { isDark: r, toggleDark: A, mode: n, setMode: b, density: c, toggleDensity: I, setDensity: w },
87
+ value: { isDark: r, toggleDark: b, mode: n, setMode: A, density: c, toggleDensity: w, setDensity: M },
87
88
  children: t
88
89
  }
89
90
  );
90
91
  }
91
- function G() {
92
- return S(_);
92
+ function O() {
93
+ return E(T);
93
94
  }
94
- const d = {}, v = D({ tenantSlug: null }), p = ["data-brand", "data-tenant"];
95
- function l(t) {
96
- for (const n of p) document.documentElement.setAttribute(n, t);
95
+ const k = S({ tenantSlug: null }), v = ["data-brand", "data-tenant"];
96
+ function m(t) {
97
+ for (const n of v) document.documentElement.setAttribute(n, t);
97
98
  }
98
- function k() {
99
- for (const t of p) document.documentElement.removeAttribute(t);
99
+ function p() {
100
+ for (const t of v) document.documentElement.removeAttribute(t);
100
101
  }
101
- function O({ children: t }) {
102
- const n = typeof d.VITE_TENANT_SLUG == "string" && d.VITE_TENANT_SLUG.trim().length > 0 ? d.VITE_TENANT_SLUG.trim() : null;
103
- return a(() => {
102
+ function B({
103
+ children: t,
104
+ slug: n = null
105
+ }) {
106
+ return s(() => {
104
107
  if (n)
105
- return l(n), () => k();
106
- }, [n]), /* @__PURE__ */ f(v.Provider, { value: { tenantSlug: n }, children: t });
108
+ return m(n), () => p();
109
+ }, [n]), /* @__PURE__ */ l(k.Provider, { value: { tenantSlug: n }, children: t });
107
110
  }
108
- function B() {
109
- return S(v);
111
+ function H() {
112
+ return E(k);
110
113
  }
111
- function H(t) {
112
- a(() => {
114
+ function z(t) {
115
+ s(() => {
113
116
  const n = document.documentElement.getAttribute("data-brand");
114
- return l(t), () => {
115
- n !== null ? l(n) : k();
117
+ return m(t), () => {
118
+ n !== null ? m(n) : p();
116
119
  };
117
120
  }, [t]);
118
121
  }
119
- function V({ children: t }) {
120
- return /* @__PURE__ */ f(M, { children: t });
122
+ function G({ children: t }) {
123
+ return /* @__PURE__ */ l(I, { children: t });
121
124
  }
122
125
  export {
123
- V as FontProvider,
124
- K as FreezeState,
125
- Y as HdsRouterProvider,
126
- j as LanguageProvider,
127
- O as TenantProvider,
126
+ G as FontProvider,
127
+ j as FreezeState,
128
+ q as HdsRouterProvider,
129
+ N as LanguageProvider,
130
+ B as TenantProvider,
128
131
  F as ThemeProvider,
129
- q as TokenDisplayProvider,
132
+ V as TokenDisplayProvider,
130
133
  J as useFrozenState,
131
134
  Q as useHdsRouter,
132
- W as useLanguage,
133
- B as useTenant,
134
- H as useTenantOnDocument,
135
- G as useTheme,
136
- X as useTokenDisplay
135
+ U as useLanguage,
136
+ H as useTenant,
137
+ z as useTenantOnDocument,
138
+ O as useTheme,
139
+ W as useTokenDisplay
137
140
  };
package/dist/form.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { useForm as f, FormProvider as h, useController as v } from "react-hook-form";
2
3
  import { zodResolver as b } from "@hookform/resolvers/zod";
3
4
  import { jsx as t } from "react/jsx-runtime";