@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.
- package/README.md +49 -6
- package/dist/chunks/TokenDisplayContext-B3gxyQN7.js +1 -0
- package/dist/chunks/form-DnGRy27o.js +1 -0
- package/dist/contexts.js +63 -60
- package/dist/form.js +1 -0
- package/dist/hirobius-ui.js +4092 -3389
- package/dist/manifest.js +7 -7
- package/dist/scroll.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/tokens.css +1 -1
- package/dist/types/src/app/components/activity-feed.d.ts +6 -0
- package/dist/types/src/app/components/alert.d.ts +1 -1
- package/dist/types/src/app/components/asset-img.d.ts +1 -1
- package/dist/types/src/app/components/avatar.d.ts +1 -0
- package/dist/types/src/app/components/badge.d.ts +1 -0
- package/dist/types/src/app/components/bleed.d.ts +1 -1
- package/dist/types/src/app/components/box.d.ts +2 -2
- package/dist/types/src/app/components/breadcrumb.d.ts +1 -0
- package/dist/types/src/app/components/button.d.ts +1 -0
- package/dist/types/src/app/components/callout.d.ts +1 -0
- package/dist/types/src/app/components/card.d.ts +10 -5
- package/dist/types/src/app/components/center.d.ts +1 -1
- package/dist/types/src/app/components/checkbox.d.ts +2 -2
- package/dist/types/src/app/components/cinematic-link.d.ts +1 -2
- package/dist/types/src/app/components/cluster.d.ts +1 -1
- package/dist/types/src/app/components/code-block.d.ts +2 -1
- package/dist/types/src/app/components/combobox.d.ts +1 -0
- package/dist/types/src/app/components/container.d.ts +1 -1
- package/dist/types/src/app/components/cover.d.ts +1 -1
- package/dist/types/src/app/components/dialog.d.ts +5 -0
- package/dist/types/src/app/components/disclosure.d.ts +2 -1
- package/dist/types/src/app/components/divider.d.ts +4 -0
- package/dist/types/src/app/components/doc-link-card.d.ts +1 -1
- package/dist/types/src/app/components/empty-state.d.ts +1 -0
- package/dist/types/src/app/components/error-boundary.d.ts +1 -1
- package/dist/types/src/app/components/error-pattern.d.ts +1 -2
- package/dist/types/src/app/components/field.d.ts +1 -0
- package/dist/types/src/app/components/form.d.ts +7 -1
- package/dist/types/src/app/components/frame.d.ts +1 -1
- package/dist/types/src/app/components/grid.d.ts +2 -2
- package/dist/types/src/app/components/heading-stack.d.ts +1 -1
- package/dist/types/src/app/components/icon-button.d.ts +3 -4
- package/dist/types/src/app/components/icon.d.ts +1 -1
- package/dist/types/src/app/components/image-lightbox.d.ts +1 -2
- package/dist/types/src/app/components/inline-code.d.ts +4 -1
- package/dist/types/src/app/components/inline-link.d.ts +2 -2
- package/dist/types/src/app/components/input.d.ts +1 -0
- package/dist/types/src/app/components/menu.d.ts +1 -0
- package/dist/types/src/app/components/nav-group.d.ts +3 -3
- package/dist/types/src/app/components/nav-item.d.ts +2 -2
- package/dist/types/src/app/components/page.d.ts +1 -1
- package/dist/types/src/app/components/pagination.d.ts +1 -0
- package/dist/types/src/app/components/pin.d.ts +1 -2
- package/dist/types/src/app/components/popover.d.ts +1 -0
- package/dist/types/src/app/components/progress.d.ts +1 -0
- package/dist/types/src/app/components/radio.d.ts +2 -2
- package/dist/types/src/app/components/reveal.d.ts +1 -2
- package/dist/types/src/app/components/segmented-control.d.ts +1 -1
- package/dist/types/src/app/components/sidebar.d.ts +1 -1
- package/dist/types/src/app/components/skeleton.d.ts +1 -0
- package/dist/types/src/app/components/slider.d.ts +2 -2
- package/dist/types/src/app/components/spinner.d.ts +1 -0
- package/dist/types/src/app/components/stack.d.ts +2 -2
- package/dist/types/src/app/components/stat.d.ts +1 -0
- package/dist/types/src/app/components/status-list-item.d.ts +1 -0
- package/dist/types/src/app/components/status-tile.d.ts +1 -0
- package/dist/types/src/app/components/stepper-field.d.ts +1 -2
- package/dist/types/src/app/components/surface.d.ts +2 -2
- package/dist/types/src/app/components/switcher.d.ts +1 -1
- package/dist/types/src/app/components/table.d.ts +1 -0
- package/dist/types/src/app/components/tabs.d.ts +6 -0
- package/dist/types/src/app/components/tag.d.ts +1 -0
- package/dist/types/src/app/components/textarea.d.ts +1 -0
- package/dist/types/src/app/components/toast.d.ts +1 -0
- package/dist/types/src/app/components/toggle.d.ts +2 -2
- package/dist/types/src/app/components/token.d.ts +1 -1
- package/dist/types/src/app/context/TenantContext.d.ts +19 -5
- package/dist/types/src/app/context/index.d.ts +7 -7
- package/dist/types/src/app/design-system/generated-token-refs.d.ts +1 -1
- package/dist/types/src/app/design-system/generated-token-values.d.ts +1 -1
- package/dist/types/src/app/design-system/theme.d.ts +1 -1
- package/dist/types/src/app/design-system/tokens.d.ts +2 -2
- package/dist/types/src/app/hooks/useHdsMotion.d.ts +1 -1
- package/dist/types/src/app/layouts/CaseStudyLayout.d.ts +2 -3
- package/dist/types/src/app/layouts/HdsSystemDocLayout.d.ts +1 -1
- package/dist/types/src/app/lib/hds-search.d.ts +1 -1
- package/dist/types/src/brand/index.d.ts +1 -1
- package/dist/types/src/form/index.d.ts +3 -3
- package/dist/types/src/index.d.ts +116 -116
- package/dist/types/src/lib/env.d.ts +31 -0
- package/dist/types/src/lib/manifest-entry.d.ts +1 -1
- package/dist/types/src/scroll/index.d.ts +2 -2
- package/hirobius.tokens.json +3 -3
- package/package.json +9 -6
- 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
|
-
- **
|
|
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
|
-
**
|
|
157
|
-
|
|
158
|
-
| Component
|
|
159
|
-
|
|
|
160
|
-
| `Alert`
|
|
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
|
|
package/dist/contexts.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
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
|
|
18
|
+
function y() {
|
|
18
19
|
try {
|
|
19
|
-
const t = localStorage.getItem(
|
|
20
|
-
if (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
|
|
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
|
|
30
|
-
return t === "dark" ? !0 : t === "light" ? !1 :
|
|
30
|
+
function D(t) {
|
|
31
|
+
return t === "dark" ? !0 : t === "light" ? !1 : L();
|
|
31
32
|
}
|
|
32
|
-
function
|
|
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,
|
|
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(
|
|
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
|
-
|
|
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]),
|
|
56
|
-
|
|
57
|
-
}, [r,
|
|
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
|
-
|
|
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
|
|
67
|
+
const b = a(() => {
|
|
67
68
|
const e = !r, o = e ? "dark" : "light";
|
|
68
|
-
|
|
69
|
+
f(o), u(e);
|
|
69
70
|
try {
|
|
70
|
-
localStorage.setItem(
|
|
71
|
+
localStorage.setItem(d, o);
|
|
71
72
|
} catch {
|
|
72
73
|
}
|
|
73
|
-
}, [r]),
|
|
74
|
-
|
|
74
|
+
}, [r]), A = a((e) => {
|
|
75
|
+
f(e), u(D(e));
|
|
75
76
|
try {
|
|
76
|
-
localStorage.setItem(
|
|
77
|
+
localStorage.setItem(d, e);
|
|
77
78
|
} catch {
|
|
78
79
|
}
|
|
79
|
-
}, []),
|
|
80
|
+
}, []), w = a(
|
|
80
81
|
() => h((e) => e === "comfortable" ? "compact" : "comfortable"),
|
|
81
82
|
[]
|
|
82
|
-
),
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
|
|
83
|
+
), M = a((e) => h(e), []);
|
|
84
|
+
return /* @__PURE__ */ l(
|
|
85
|
+
T.Provider,
|
|
85
86
|
{
|
|
86
|
-
value: { isDark: r, toggleDark:
|
|
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
|
|
92
|
-
return
|
|
92
|
+
function O() {
|
|
93
|
+
return E(T);
|
|
93
94
|
}
|
|
94
|
-
const
|
|
95
|
-
function
|
|
96
|
-
for (const n of
|
|
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
|
|
99
|
-
for (const t of
|
|
99
|
+
function p() {
|
|
100
|
+
for (const t of v) document.documentElement.removeAttribute(t);
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
function B({
|
|
103
|
+
children: t,
|
|
104
|
+
slug: n = null
|
|
105
|
+
}) {
|
|
106
|
+
return s(() => {
|
|
104
107
|
if (n)
|
|
105
|
-
return
|
|
106
|
-
}, [n]), /* @__PURE__ */
|
|
108
|
+
return m(n), () => p();
|
|
109
|
+
}, [n]), /* @__PURE__ */ l(k.Provider, { value: { tenantSlug: n }, children: t });
|
|
107
110
|
}
|
|
108
|
-
function
|
|
109
|
-
return
|
|
111
|
+
function H() {
|
|
112
|
+
return E(k);
|
|
110
113
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
114
|
+
function z(t) {
|
|
115
|
+
s(() => {
|
|
113
116
|
const n = document.documentElement.getAttribute("data-brand");
|
|
114
|
-
return
|
|
115
|
-
n !== null ?
|
|
117
|
+
return m(t), () => {
|
|
118
|
+
n !== null ? m(n) : p();
|
|
116
119
|
};
|
|
117
120
|
}, [t]);
|
|
118
121
|
}
|
|
119
|
-
function
|
|
120
|
-
return /* @__PURE__ */
|
|
122
|
+
function G({ children: t }) {
|
|
123
|
+
return /* @__PURE__ */ l(I, { children: t });
|
|
121
124
|
}
|
|
122
125
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
132
|
+
V as TokenDisplayProvider,
|
|
130
133
|
J as useFrozenState,
|
|
131
134
|
Q as useHdsRouter,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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