haze-ui 1.30.0 → 1.32.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 +67 -1
- package/dist/components/ActivityRail/ActivityRail.js +76 -0
- package/dist/components/ActivityRail/index.js +3 -0
- package/dist/components/BottomSheet/BottomSheet.js +12 -26
- package/dist/components/Button/Button.js +33 -15
- package/dist/components/Button/ButtonLink.js +12 -21
- package/dist/components/Button/styles.js +2 -2
- package/dist/components/Cascader/Cascader.js +11 -11
- package/dist/components/ColorPicker/ColorPicker.js +4 -4
- package/dist/components/Combobox/Combobox.js +128 -119
- package/dist/components/Command/Command.js +9 -9
- package/dist/components/ConfigProvider/ConfigContext.js +16 -0
- package/dist/components/ConfirmDialog/confirm.js +41 -0
- package/dist/components/ConfirmDialog/index.js +2 -1
- package/dist/components/ConversationList/ConversationList.js +16 -7
- package/dist/components/DataTable/DataTable.js +24 -24
- package/dist/components/DateTimePicker/DateTimePicker.js +25 -0
- package/dist/components/DateTimePicker/index.js +3 -0
- package/dist/components/Datepicker/Datepicker.js +8 -7
- package/dist/components/Datepicker/DatepickerCore.js +60 -59
- package/dist/components/Drawer/Drawer.js +45 -40
- package/dist/components/Fieldset/Fieldset.js +25 -0
- package/dist/components/Fieldset/index.js +2 -0
- package/dist/components/Highlight/Highlight.js +19 -0
- package/dist/components/Highlight/index.js +2 -0
- package/dist/components/Indicator/Indicator.js +37 -0
- package/dist/components/Indicator/index.js +2 -0
- package/dist/components/InlineCompletion/InlineCompletion.js +4 -4
- package/dist/components/Input/Input.js +9 -7
- package/dist/components/Input/InputCore.js +32 -13
- package/dist/components/List/List.js +14 -10
- package/dist/components/LoadingOverlay/LoadingOverlay.js +30 -0
- package/dist/components/LoadingOverlay/index.js +3 -0
- package/dist/components/LocaleProvider/ar-sa.js +11 -0
- package/dist/components/LocaleProvider/de-de.js +11 -0
- package/dist/components/LocaleProvider/es-es.js +11 -0
- package/dist/components/LocaleProvider/fr-fr.js +11 -0
- package/dist/components/LocaleProvider/it-it.js +11 -0
- package/dist/components/LocaleProvider/ja-jp.js +11 -0
- package/dist/components/LocaleProvider/ko-kr.js +11 -0
- package/dist/components/LocaleProvider/locale.js +11 -0
- package/dist/components/LocaleProvider/pt-br.js +11 -0
- package/dist/components/LocaleProvider/ru-ru.js +11 -0
- package/dist/components/LocaleProvider/zh-cn.js +11 -0
- package/dist/components/LogViewer/LogViewer.js +45 -38
- package/dist/components/Mark/Mark.js +20 -0
- package/dist/components/Mark/index.js +2 -0
- package/dist/components/Mentions/MentionsCore.js +3 -3
- package/dist/components/Menu/MenuItem.js +6 -4
- package/dist/components/NumberFormatter/NumberFormatter.js +16 -0
- package/dist/components/NumberFormatter/index.js +2 -0
- package/dist/components/OTPInput/OTPInputCore.js +7 -6
- package/dist/components/PasswordInput/PasswordInputCore.js +27 -26
- package/dist/components/Rating/RatingCore.js +18 -18
- package/dist/components/Resizable/Resizable.js +266 -36
- package/dist/components/Select/Select.js +28 -23
- package/dist/components/Select/SelectCore.js +26 -23
- package/dist/components/Select/SelectFloating.js +157 -153
- package/dist/components/Sparkline/Sparkline.js +45 -0
- package/dist/components/Sparkline/index.js +3 -0
- package/dist/components/Sparkline/sparkline-styles.js +18 -0
- package/dist/components/Spoiler/Spoiler.js +36 -0
- package/dist/components/Spoiler/index.js +3 -0
- package/dist/components/StatusBar/StatusBar.js +47 -0
- package/dist/components/StatusBar/index.js +3 -0
- package/dist/components/TabBar/TabBar.js +60 -0
- package/dist/components/TabBar/index.js +3 -0
- package/dist/components/Tabs/SortableTabList.js +116 -0
- package/dist/components/Tabs/Tab.js +83 -16
- package/dist/components/Tabs/TabList.js +94 -38
- package/dist/components/Tabs/edge-scroll.js +6 -0
- package/dist/components/Tabs/index.js +4 -3
- package/dist/components/Tabs/tab-metas.js +24 -0
- package/dist/components/TagGroup/SortableTagGroup.js +32 -20
- package/dist/components/TagGroup/TagGroup.js +23 -9
- package/dist/components/TagGroup/TagGroupItem.js +21 -15
- package/dist/components/TagInput/SortableTagInputCore.js +11 -11
- package/dist/components/TagInput/TagInputCore.js +10 -10
- package/dist/components/TimePicker/TimePickerPanel.js +3 -3
- package/dist/components/Toast/ToastContainer.js +5 -5
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toast/{toast2.js → toast-channel.js} +1 -1
- package/dist/components/Toast/useToast.js +1 -1
- package/dist/components/Tree/SortableTree.js +39 -39
- package/dist/components/TreeSelect/TreeSelect.js +6 -6
- package/dist/components/VirtualList/VirtualList.js +133 -121
- package/dist/components/VisuallyHidden/VisuallyHidden.js +15 -0
- package/dist/components/VisuallyHidden/index.js +2 -0
- package/dist/components/Workbench/Workbench.js +144 -0
- package/dist/components/Workbench/index.js +3 -0
- package/dist/css/accordion.css +2 -0
- package/dist/css/activity-rail.css +4 -0
- package/dist/css/affix.css +2 -0
- package/dist/css/alert.css +2 -0
- package/dist/css/anchor.css +2 -0
- package/dist/css/app-shell.css +3 -1
- package/dist/css/approval-card.css +2 -0
- package/dist/css/aspect-ratio.css +2 -0
- package/dist/css/async-section.css +2 -0
- package/dist/css/avatar-group.css +2 -0
- package/dist/css/avatar.css +2 -0
- package/dist/css/back-to-top.css +2 -0
- package/dist/css/badge.css +2 -0
- package/dist/css/banner.css +2 -0
- package/dist/css/bottom-sheet.css +2 -0
- package/dist/css/breadcrumb.css +3 -1
- package/dist/css/button.css +3 -2
- package/dist/css/calendar.css +2 -0
- package/dist/css/card.css +2 -0
- package/dist/css/carousel.css +2 -0
- package/dist/css/cascader.css +2 -0
- package/dist/css/chart.css +2 -0
- package/dist/css/chat-container.css +2 -0
- package/dist/css/chat-input.css +2 -0
- package/dist/css/chat-message.css +2 -0
- package/dist/css/checkbox.css +3 -1
- package/dist/css/chip.css +2 -0
- package/dist/css/code-block.css +2 -0
- package/dist/css/collapsible.css +2 -0
- package/dist/css/color-picker.css +2 -0
- package/dist/css/combobox.css +2 -0
- package/dist/css/command.css +3 -1
- package/dist/css/confirm-dialog.css +2 -0
- package/dist/css/container.css +2 -0
- package/dist/css/context-menu.css +3 -1
- package/dist/css/conversation-list.css +2 -0
- package/dist/css/count-up.css +2 -0
- package/dist/css/data-table.css +2 -0
- package/dist/css/date-range-picker.css +3 -1
- package/dist/css/datepicker.css +2 -0
- package/dist/css/descriptions.css +2 -0
- package/dist/css/dialog.css +2 -0
- package/dist/css/diff-viewer.css +2 -0
- package/dist/css/disclosure.css +2 -0
- package/dist/css/divider.css +2 -0
- package/dist/css/drawer.css +3 -1
- package/dist/css/dropdown-menu.css +4 -2
- package/dist/css/ellipsis.css +2 -0
- package/dist/css/empty.css +2 -0
- package/dist/css/fieldset.css +4 -0
- package/dist/css/file-input.css +2 -0
- package/dist/css/file-preview.css +2 -0
- package/dist/css/flex.css +2 -0
- package/dist/css/float-button.css +2 -0
- package/dist/css/form.css +2 -0
- package/dist/css/grid.css +2 -0
- package/dist/css/hover-card.css +3 -1
- package/dist/css/icon.css +2 -0
- package/dist/css/image.css +2 -0
- package/dist/css/indicator.css +4 -0
- package/dist/css/inline-completion.css +2 -0
- package/dist/css/inline-edit.css +2 -0
- package/dist/css/input.css +3 -1
- package/dist/css/json-view.css +2 -0
- package/dist/css/kbd.css +2 -0
- package/dist/css/list.css +3 -1
- package/dist/css/loading-overlay.css +4 -0
- package/dist/css/log-viewer.css +2 -0
- package/dist/css/mark.css +4 -0
- package/dist/css/markdown-renderer.css +2 -0
- package/dist/css/masonry.css +2 -0
- package/dist/css/mentions.css +2 -0
- package/dist/css/menu.css +5 -3
- package/dist/css/model-picker.css +2 -0
- package/dist/css/navigation-bar.css +2 -0
- package/dist/css/number-input.css +2 -0
- package/dist/css/otp-input.css +2 -0
- package/dist/css/pagination.css +2 -0
- package/dist/css/password-input.css +3 -1
- package/dist/css/popover.css +3 -1
- package/dist/css/progress.css +2 -0
- package/dist/css/prompt-input.css +2 -0
- package/dist/css/qr-code.css +2 -0
- package/dist/css/radio.css +3 -1
- package/dist/css/rating.css +2 -0
- package/dist/css/resizable.css +3 -1
- package/dist/css/result.css +2 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/segmented.css +3 -1
- package/dist/css/select.css +2 -0
- package/dist/css/sidebar.css +3 -1
- package/dist/css/signature.css +2 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +3 -1
- package/dist/css/sources.css +2 -0
- package/dist/css/sparkline.css +4 -0
- package/dist/css/spinner.css +2 -0
- package/dist/css/spoiler.css +4 -0
- package/dist/css/stat.css +2 -0
- package/dist/css/status-bar.css +4 -0
- package/dist/css/step-timeline.css +2 -0
- package/dist/css/stepper.css +2 -0
- package/dist/css/streaming-text.css +2 -0
- package/dist/css/swipe-action.css +2 -0
- package/dist/css/switch.css +3 -1
- package/dist/css/tab-bar.css +4 -0
- package/dist/css/table.css +2 -0
- package/dist/css/tabs.css +5 -2
- package/dist/css/tag-group.css +2 -0
- package/dist/css/tag-input.css +2 -0
- package/dist/css/tag.css +3 -1
- package/dist/css/textarea.css +2 -0
- package/dist/css/thinking-indicator.css +2 -0
- package/dist/css/time-picker.css +2 -0
- package/dist/css/timeline.css +2 -0
- package/dist/css/toast.css +2 -0
- package/dist/css/toggle.css +2 -0
- package/dist/css/token-counter.css +2 -0
- package/dist/css/tokens.css +2 -0
- package/dist/css/tool-call-card.css +2 -0
- package/dist/css/toolbar.css +2 -0
- package/dist/css/tooltip.css +2 -0
- package/dist/css/tour.css +2 -0
- package/dist/css/transfer.css +2 -0
- package/dist/css/tree-select.css +2 -0
- package/dist/css/tree.css +3 -1
- package/dist/css/typography.css +2 -0
- package/dist/css/upload.css +2 -0
- package/dist/css/virtual-list.css +2 -0
- package/dist/css/visually-hidden.css +4 -0
- package/dist/css/watermark.css +2 -0
- package/dist/css/workbench.css +4 -0
- package/dist/css-manifest.json +202 -1
- package/dist/dates/adapter.js +9 -1
- package/dist/dates/buddhist.js +43 -0
- package/dist/dates/ethiopic.js +67 -0
- package/dist/dates/hebrew.js +95 -0
- package/dist/dates/japanese.js +41 -0
- package/dist/dates/persian.js +121 -0
- package/dist/dates/registry.js +14 -4
- package/dist/haze-ui.css +435 -29
- package/dist/headless/index.js +18 -17
- package/dist/hooks/useBusyPressable.js +10 -0
- package/dist/index.js +263 -241
- package/dist/mcp-docs.json +1073 -33
- package/dist/registry.json +256 -14
- package/dist/types/components/ActivityRail/ActivityRail.d.ts +30 -0
- package/dist/types/components/ActivityRail/index.d.ts +4 -0
- package/dist/types/components/Button/Button.d.ts +50 -5
- package/dist/types/components/Button/ButtonLink.d.ts +27 -15
- package/dist/types/components/Button/styles.d.ts +34 -0
- package/dist/types/components/Combobox/Combobox.d.ts +20 -2
- package/dist/types/components/Combobox/index.d.ts +1 -1
- package/dist/types/components/ConfigProvider/ConfigContext.d.ts +20 -0
- package/dist/types/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/dist/types/components/ConfirmDialog/confirm.d.ts +33 -0
- package/dist/types/components/ConfirmDialog/index.d.ts +2 -0
- package/dist/types/components/ConversationList/ConversationList.d.ts +10 -1
- package/dist/types/components/DateTimePicker/DateTimePicker.d.ts +36 -0
- package/dist/types/components/DateTimePicker/index.d.ts +2 -0
- package/dist/types/components/Datepicker/Datepicker.d.ts +3 -3
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +3 -3
- package/dist/types/components/Drawer/Drawer.d.ts +15 -2
- package/dist/types/components/Drawer/index.d.ts +1 -1
- package/dist/types/components/Fieldset/Fieldset.d.ts +16 -0
- package/dist/types/components/Fieldset/index.d.ts +2 -0
- package/dist/types/components/Highlight/Highlight.d.ts +27 -0
- package/dist/types/components/Highlight/index.d.ts +2 -0
- package/dist/types/components/Indicator/Indicator.d.ts +24 -0
- package/dist/types/components/Indicator/index.d.ts +2 -0
- package/dist/types/components/Input/Input.d.ts +8 -2
- package/dist/types/components/Input/InputCore.d.ts +11 -2
- package/dist/types/components/List/List.d.ts +10 -1
- package/dist/types/components/LoadingOverlay/LoadingOverlay.d.ts +25 -0
- package/dist/types/components/LoadingOverlay/index.d.ts +2 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +11 -0
- package/dist/types/components/LogViewer/LogViewer.d.ts +10 -1
- package/dist/types/components/Mark/Mark.d.ts +12 -0
- package/dist/types/components/Mark/index.d.ts +2 -0
- package/dist/types/components/Menu/MenuItem.d.ts +15 -4
- package/dist/types/components/NumberFormatter/NumberFormatter.d.ts +23 -0
- package/dist/types/components/NumberFormatter/index.d.ts +2 -0
- package/dist/types/components/Resizable/Resizable.d.ts +24 -7
- package/dist/types/components/Resizable/index.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +23 -2
- package/dist/types/components/Select/SelectCore.d.ts +4 -1
- package/dist/types/components/Select/SelectFloating.d.ts +6 -1
- package/dist/types/components/Select/index.d.ts +1 -1
- package/dist/types/components/Sparkline/Sparkline.d.ts +31 -0
- package/dist/types/components/Sparkline/index.d.ts +3 -0
- package/dist/types/components/Sparkline/sparkline-styles.d.ts +26 -0
- package/dist/types/components/Spoiler/Spoiler.d.ts +20 -0
- package/dist/types/components/Spoiler/index.d.ts +2 -0
- package/dist/types/components/StatusBar/StatusBar.d.ts +18 -0
- package/dist/types/components/StatusBar/index.d.ts +3 -0
- package/dist/types/components/TabBar/TabBar.d.ts +23 -0
- package/dist/types/components/TabBar/index.d.ts +4 -0
- package/dist/types/components/Tabs/SortableTabList.d.ts +46 -0
- package/dist/types/components/Tabs/Tab.d.ts +54 -3
- package/dist/types/components/Tabs/TabList.d.ts +26 -2
- package/dist/types/components/Tabs/edge-scroll.d.ts +17 -0
- package/dist/types/components/Tabs/index.d.ts +3 -1
- package/dist/types/components/Tabs/tab-metas.d.ts +20 -0
- package/dist/types/components/TagGroup/SortableTagGroup.d.ts +5 -1
- package/dist/types/components/TagGroup/TagGroup.d.ts +24 -2
- package/dist/types/components/TagGroup/index.d.ts +1 -1
- package/dist/types/components/Toast/index.d.ts +2 -2
- package/dist/types/components/Toast/useToast.d.ts +1 -1
- package/dist/types/components/VirtualList/VirtualList.d.ts +20 -1
- package/dist/types/components/VisuallyHidden/VisuallyHidden.d.ts +4 -0
- package/dist/types/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/types/components/Workbench/Workbench.d.ts +50 -0
- package/dist/types/components/Workbench/index.d.ts +2 -0
- package/dist/types/dates/adapter.d.ts +33 -6
- package/dist/types/dates/buddhist.d.ts +14 -0
- package/dist/types/dates/ethiopic.d.ts +15 -0
- package/dist/types/dates/hebrew.d.ts +19 -0
- package/dist/types/dates/index.d.ts +5 -0
- package/dist/types/dates/japanese.d.ts +16 -0
- package/dist/types/dates/persian.d.ts +18 -0
- package/dist/types/dates/registry.d.ts +1 -1
- package/dist/types/headless/index.d.ts +9 -0
- package/dist/types/hooks/index.d.ts +13 -0
- package/dist/types/hooks/useBusyPressable.d.ts +33 -0
- package/dist/types/hooks/useElementSize.d.ts +38 -0
- package/dist/types/hooks/useIdle.d.ts +45 -0
- package/dist/types/hooks/useMutationObserver.d.ts +35 -0
- package/dist/types/hooks/useNetwork.d.ts +31 -0
- package/dist/types/hooks/useOrientation.d.ts +23 -0
- package/dist/types/hooks/useResizeObserver.d.ts +48 -0
- package/dist/types/index.d.ts +37 -9
- package/dist/types/utils/sortable.d.ts +8 -1
- package/dist/types/utils/use-end-reached.d.ts +56 -0
- package/dist/types/utils/viewport.d.ts +12 -0
- package/dist/utils/sortable-shared.js +3 -3
- package/dist/utils/sortable.js +15 -14
- package/dist/utils/use-end-reached.js +46 -0
- package/dist/utils/viewport.js +20 -0
- package/package.json +13 -5
- /package/dist/types/components/Toast/{toast.d.ts → toast-channel.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ English | [简体中文](./README-zh_CN.md)
|
|
|
31
31
|
|
|
32
32
|
**`haze-ui/css-manifest.json` is machine-readable data.** The authoritative export → CSS-file mapping (family absorption included) is regenerated on every build, so bundler plugins and codemods read one source of truth instead of re-deriving kebab-case file names. A directory of pasted components has no equivalent — the mapping exists only in your head or your fork, and it drifts.
|
|
33
33
|
|
|
34
|
-
**The `ControlOrValue<T>` protocol needs a real runtime.** One prop — `checked?: Control<T> | T` — covers controlled *and* uncontrolled usage because `react-use-control` carries the wiring; a published package is the contract that keeps that behavior identical across every component and version. None of this is hostile to the shadcn / Base UI ecosystem: haze-ui tokens are plain CSS custom properties,
|
|
34
|
+
**The `ControlOrValue<T>` protocol needs a real runtime.** One prop — `checked?: Control<T> | T` — covers controlled *and* uncontrolled usage because `react-use-control` carries the wiring; a published package is the contract that keeps that behavior identical across every component and version. None of this is hostile to the shadcn / Base UI ecosystem: haze-ui tokens are plain CSS custom properties, and haze components compose alongside copy-pasted primitives wherever each fits.
|
|
35
35
|
|
|
36
36
|
## Getting Started
|
|
37
37
|
|
|
@@ -194,11 +194,43 @@ import 'haze-ui/css/tokens.css';
|
|
|
194
194
|
import 'haze-ui/css/button.css';
|
|
195
195
|
import { Button } from 'haze-ui';
|
|
196
196
|
|
|
197
|
+
// …or zero CSS imports at all — the official Vite plugin injects the
|
|
198
|
+
// right per-component CSS for you (see "Automatic CSS with haze-ui-vite"):
|
|
199
|
+
// vite.config.ts → hazeCss() from 'haze-ui-vite'
|
|
200
|
+
import { Button } from 'haze-ui';
|
|
201
|
+
|
|
197
202
|
export default function MyComponent() {
|
|
198
203
|
return <Button>Start</Button>;
|
|
199
204
|
}
|
|
200
205
|
```
|
|
201
206
|
|
|
207
|
+
#### Automatic CSS with haze-ui-vite
|
|
208
|
+
|
|
209
|
+
[`haze-ui-vite`](https://www.npmjs.com/package/haze-ui-vite) is the
|
|
210
|
+
official companion Vite plugin: it scans each module's named imports from
|
|
211
|
+
`haze-ui` (`import { Button, Select } from 'haze-ui'`), maps them through
|
|
212
|
+
`haze-ui/css-manifest.json`, and prepends the matching
|
|
213
|
+
`haze-ui/css/*.css` side-effect imports — `tokens.css` always first. CSS
|
|
214
|
+
enters the module graph exactly where it's consumed, so code-split views
|
|
215
|
+
carry only their own component CSS and HMR works through Vite's native
|
|
216
|
+
pipeline.
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
// vite.config.ts
|
|
220
|
+
import hazeCss from 'haze-ui-vite';
|
|
221
|
+
|
|
222
|
+
export default {
|
|
223
|
+
plugins: [react(), hazeCss()],
|
|
224
|
+
};
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
It reads the manifest shipped by your installed haze-ui version (no
|
|
228
|
+
hardcoded name mapping), validates every injected file exists in the
|
|
229
|
+
actual package, and warns on namespace imports it cannot collect. Works
|
|
230
|
+
with Vite 5–8, zero runtime dependencies. Not on Vite? Keep the explicit
|
|
231
|
+
imports above, or read `haze-ui/css-manifest.json` from your own bundler
|
|
232
|
+
tooling — it's the same data the plugin uses.
|
|
233
|
+
|
|
202
234
|
Component CSS files are kebab-case versions of the component name
|
|
203
235
|
(`OTPInput` → `haze-ui/css/otp-input.css`). Per-component files only
|
|
204
236
|
cover that component's rules — tokens (themes, spacing, typography)
|
|
@@ -222,6 +254,40 @@ authoritative export → css-file mapping ships as data:
|
|
|
222
254
|
included); `noCss` lists pure-logic exports with no css of their own.
|
|
223
255
|
Bundler plugins and codemods should read this manifest instead of
|
|
224
256
|
re-deriving file names — the mapping changes in lockstep with the build.
|
|
257
|
+
The official [`haze-ui-vite`](https://www.npmjs.com/package/haze-ui-vite)
|
|
258
|
+
plugin (above) is the reference consumer of this data.
|
|
259
|
+
|
|
260
|
+
#### Styling & overriding (the `@layer haze` contract)
|
|
261
|
+
|
|
262
|
+
All shipped CSS lives inside **`@layer haze`**, so your own *unlayered*
|
|
263
|
+
styles beat every library rule regardless of source order or
|
|
264
|
+
specificity — no `!important`, no selector wrestling:
|
|
265
|
+
|
|
266
|
+
```css
|
|
267
|
+
/* your stylesheet, plain CSS — always wins over the library */
|
|
268
|
+
[data-slot='button'] {
|
|
269
|
+
letter-spacing: 0.02em;
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Every element a component renders carries a stable **`data-slot`**
|
|
274
|
+
attribute (`data-slot='button'`, `'label'`, `'panel'`, `'menu-item'`,
|
|
275
|
+
…). It is the official override surface: the attribute set is enforced
|
|
276
|
+
by a coverage test, so it cannot silently drift between releases. The
|
|
277
|
+
cascade is intentional — prefer, in order:
|
|
278
|
+
|
|
279
|
+
1. **tokens** — `var(--haze-color-primary)` and friends re-derive whole
|
|
280
|
+
interaction-state families at runtime; per-component
|
|
281
|
+
`--haze-button-*` variables retheme one family;
|
|
282
|
+
2. **`ConfigProvider` defaults** — app-wide per-component prop defaults
|
|
283
|
+
(and `classNames` where the component exposes slots);
|
|
284
|
+
3. **`data-slot` CSS targeting** — structural overrides (the escape
|
|
285
|
+
hatch above);
|
|
286
|
+
4. **`className` / `classNames`** — per-instance overrides, reserved
|
|
287
|
+
for one-offs.
|
|
288
|
+
|
|
289
|
+
If your own framework ships layered styles too, declare order explicitly
|
|
290
|
+
(e.g. `@layer haze, app;`) to keep the last word.
|
|
225
291
|
|
|
226
292
|
### Server Components (Next.js App Router)
|
|
227
293
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
+
import t from "../Badge/Badge.js";
|
|
5
|
+
import n from "../Tooltip/Tooltip.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { Children as r, isValidElement as i } from "react";
|
|
8
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
9
|
+
//#region src/lib/components/ActivityRail/ActivityRail.tsx
|
|
10
|
+
var s = "haze-ActivityRail__rail", c = "haze-ActivityRail__railHorizontal", l = "haze-ActivityRail__endGroup", u = "haze-ActivityRail__endGroupHorizontal";
|
|
11
|
+
function d({ orientation: t, children: n, className: d, ...f }) {
|
|
12
|
+
let p = [], m = [];
|
|
13
|
+
return r.forEach(n, (e) => {
|
|
14
|
+
i(e) && e.props.slot === "end" ? m.push(e) : p.push(e);
|
|
15
|
+
}), /* @__PURE__ */ o("nav", {
|
|
16
|
+
"data-slot": "activity-rail",
|
|
17
|
+
"data-orientation": t,
|
|
18
|
+
...f,
|
|
19
|
+
className: e([
|
|
20
|
+
s,
|
|
21
|
+
c,
|
|
22
|
+
d
|
|
23
|
+
]),
|
|
24
|
+
children: [p, m.length > 0 && /* @__PURE__ */ a("div", {
|
|
25
|
+
"data-slot": "activity-rail-end",
|
|
26
|
+
className: e([l, u]),
|
|
27
|
+
children: m
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
var f = "haze-ActivityRail__item", p = "haze-ActivityRail__itemActive", m = "haze-ActivityRail__indicator", h = "haze-ActivityRail__itemIcon", g = "haze-ActivityRail__itemBadge";
|
|
32
|
+
function _({ icon: r, label: i, badge: s, active: c = !1, onSelect: l, slot: u = "start", className: d, onClick: _, ...v }) {
|
|
33
|
+
let y = /* @__PURE__ */ o("button", {
|
|
34
|
+
type: "button",
|
|
35
|
+
"data-slot": "activity-rail-item",
|
|
36
|
+
"aria-label": i,
|
|
37
|
+
"aria-current": c ? "true" : void 0,
|
|
38
|
+
onClick: (e) => {
|
|
39
|
+
_?.(e), l?.();
|
|
40
|
+
},
|
|
41
|
+
...v,
|
|
42
|
+
className: e([
|
|
43
|
+
f,
|
|
44
|
+
c && p,
|
|
45
|
+
d
|
|
46
|
+
]),
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ a("span", {
|
|
49
|
+
"data-slot": "activity-rail-item-icon",
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
className: e(h),
|
|
52
|
+
children: r
|
|
53
|
+
}),
|
|
54
|
+
s != null && /* @__PURE__ */ a("span", {
|
|
55
|
+
"data-slot": "activity-rail-item-badge",
|
|
56
|
+
className: e(g),
|
|
57
|
+
children: /* @__PURE__ */ a(t, {
|
|
58
|
+
size: "sm",
|
|
59
|
+
children: s
|
|
60
|
+
})
|
|
61
|
+
}),
|
|
62
|
+
c && /* @__PURE__ */ a("span", {
|
|
63
|
+
"data-slot": "activity-rail-item-indicator",
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
className: e(m)
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
return /* @__PURE__ */ a(n, {
|
|
70
|
+
content: i,
|
|
71
|
+
position: "right",
|
|
72
|
+
children: y
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { _ as ActivityRailItem, d as default };
|
|
@@ -4,8 +4,9 @@ import { classnames as e } from "../../utils/classnames.js";
|
|
|
4
4
|
import { Presence as t } from "../../utils/presence.js";
|
|
5
5
|
import { useFocusScope as n } from "../../utils/focus-scope.js";
|
|
6
6
|
import { useViewTransitionFlip as r } from "../../utils/view-transition.js";
|
|
7
|
+
import { useVisualViewportInset as i } from "../../utils/viewport.js";
|
|
7
8
|
/* empty css */
|
|
8
|
-
import { useCallback as
|
|
9
|
+
import { useCallback as a, useEffect as o, useImperativeHandle as s, useRef as c } from "react";
|
|
9
10
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
11
|
import { useControl as d } from "react-use-control";
|
|
11
12
|
//#region src/lib/components/BottomSheet/BottomSheet.tsx
|
|
@@ -19,24 +20,9 @@ function v(e, t) {
|
|
|
19
20
|
}
|
|
20
21
|
return !0;
|
|
21
22
|
}
|
|
22
|
-
function y(
|
|
23
|
-
let [
|
|
24
|
-
|
|
25
|
-
if (!e || !t) return;
|
|
26
|
-
let n = window.visualViewport;
|
|
27
|
-
if (!n) return;
|
|
28
|
-
let i = () => {
|
|
29
|
-
let e = Math.max(0, Math.round(window.innerHeight - n.height - n.offsetTop));
|
|
30
|
-
r((t) => t === e ? t : e);
|
|
31
|
-
};
|
|
32
|
-
return i(), n.addEventListener("resize", i), n.addEventListener("scroll", i), () => {
|
|
33
|
-
n.removeEventListener("resize", i), n.removeEventListener("scroll", i);
|
|
34
|
-
};
|
|
35
|
-
}, [e, t]), n;
|
|
36
|
-
}
|
|
37
|
-
function b({ open: c, onClose: b, viewTransition: x = !1, swipeToDismiss: S = !1, virtualKeyboard: C = !1, children: w, className: T, style: E, ref: D, ...O }) {
|
|
38
|
-
let [k, A] = d(c, !1), j = r(x, A), M = s(null);
|
|
39
|
-
a(() => {
|
|
23
|
+
function y({ open: y, onClose: b, viewTransition: x = !1, swipeToDismiss: S = !1, virtualKeyboard: C = !1, children: w, className: T, style: E, ref: D, ...O }) {
|
|
24
|
+
let [k, A] = d(y, !1), j = r(x, A), M = c(null);
|
|
25
|
+
o(() => {
|
|
40
26
|
if (!k) return;
|
|
41
27
|
let e = document.activeElement;
|
|
42
28
|
M.current = e instanceof HTMLElement ? e : null;
|
|
@@ -44,10 +30,10 @@ function b({ open: c, onClose: b, viewTransition: x = !1, swipeToDismiss: S = !1
|
|
|
44
30
|
let N = n({
|
|
45
31
|
enabled: k,
|
|
46
32
|
trapped: !0
|
|
47
|
-
}), P =
|
|
33
|
+
}), P = a(() => {
|
|
48
34
|
j(!1), b?.();
|
|
49
35
|
}, [j, b]);
|
|
50
|
-
|
|
36
|
+
s(D, () => ({
|
|
51
37
|
open: () => {
|
|
52
38
|
j(!0);
|
|
53
39
|
},
|
|
@@ -57,13 +43,13 @@ function b({ open: c, onClose: b, viewTransition: x = !1, swipeToDismiss: S = !1
|
|
|
57
43
|
e?.isConnected && e.focus();
|
|
58
44
|
}
|
|
59
45
|
}), [j, P]);
|
|
60
|
-
let F =
|
|
46
|
+
let F = i(C && k), I = C ? {
|
|
61
47
|
"--haze-sheet-kb-inset": `${F}px`,
|
|
62
48
|
maxHeight: `min(80dvh, calc(100dvh - ${F}px))`,
|
|
63
49
|
...F > 0 ? { transform: `translateY(${-F}px)` } : null
|
|
64
|
-
} : void 0, L =
|
|
50
|
+
} : void 0, L = c(null), R = a((e) => {
|
|
65
51
|
N(e), L.current = e;
|
|
66
|
-
}, [N]), z =
|
|
52
|
+
}, [N]), z = c(null), B = a((e) => {
|
|
67
53
|
let t = z.current, n = L.current;
|
|
68
54
|
if (!t || !n || e.touches.length !== 1 || e.defaultPrevented) return;
|
|
69
55
|
let [r] = e.touches;
|
|
@@ -111,7 +97,7 @@ function b({ open: c, onClose: b, viewTransition: x = !1, swipeToDismiss: S = !1
|
|
|
111
97
|
let t = z.current, n = L.current;
|
|
112
98
|
t && n && t.pointerId === e.pointerId && (z.current = null, H(n), t.dragging && U(n));
|
|
113
99
|
};
|
|
114
|
-
return
|
|
100
|
+
return o(() => {
|
|
115
101
|
if (k) return;
|
|
116
102
|
z.current = null;
|
|
117
103
|
let e = L.current;
|
|
@@ -154,4 +140,4 @@ function b({ open: c, onClose: b, viewTransition: x = !1, swipeToDismiss: S = !1
|
|
|
154
140
|
});
|
|
155
141
|
}
|
|
156
142
|
//#endregion
|
|
157
|
-
export {
|
|
143
|
+
export { y as default };
|
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import { useBusyPressable as t } from "../../hooks/useBusyPressable.js";
|
|
4
|
+
import n from "../Spinner/Spinner.js";
|
|
5
|
+
import { useConfigDefaults as r } from "../ConfigProvider/useConfigDefaults.js";
|
|
6
|
+
import { base as i, label as a, sizes as o, squareSizes as s, variants as c } from "./styles.js";
|
|
7
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
8
|
//#region src/lib/components/Button/Button.tsx
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
function f({ variant: f = "solid", size: p, square: m = !1, loading: h = !1, as: g, className: _, children: v, disabled: y, ...b }) {
|
|
10
|
+
let x = r("Button"), S = p ?? x.size ?? "md", C = m ? s[S] : o[S], w = !!h, T = t(w, y), E = typeof h == "object" ? h.icon : void 0, D = typeof h == "object" ? h.text : void 0, O = g ?? "button", k = g === void 0 || g === "button";
|
|
11
|
+
return /* @__PURE__ */ u(O, {
|
|
12
|
+
...k ? {
|
|
13
|
+
type: "button",
|
|
14
|
+
disabled: T.disabled
|
|
15
|
+
} : { "aria-disabled": T.disabled || void 0 },
|
|
16
|
+
"data-slot": k ? "button" : "button-link",
|
|
17
|
+
"data-loading": w || void 0,
|
|
18
|
+
"aria-busy": T["aria-busy"],
|
|
19
|
+
...b,
|
|
13
20
|
className: e([
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
i,
|
|
22
|
+
c[f],
|
|
23
|
+
C,
|
|
24
|
+
!k && "haze-styles__link",
|
|
25
|
+
w && "haze-styles__loading",
|
|
26
|
+
_
|
|
27
|
+
]),
|
|
28
|
+
children: w ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", {
|
|
29
|
+
"data-slot": "label",
|
|
30
|
+
className: e([a]),
|
|
31
|
+
children: D === void 0 ? v : D
|
|
32
|
+
}), /* @__PURE__ */ u("span", {
|
|
33
|
+
"data-slot": "indicator",
|
|
34
|
+
"aria-hidden": !0,
|
|
35
|
+
children: E ?? /* @__PURE__ */ u(n, { size: "sm" })
|
|
36
|
+
})] }) : v
|
|
19
37
|
});
|
|
20
38
|
}
|
|
21
39
|
//#endregion
|
|
22
|
-
export {
|
|
40
|
+
export { f as default };
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
|
|
2
1
|
"use client";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { forwardRef as o } from "react";
|
|
8
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useConfigDefaults as e } from "../ConfigProvider/useConfigDefaults.js";
|
|
3
|
+
import t from "./Button.js";
|
|
4
|
+
import { forwardRef as n } from "react";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
9
6
|
//#region src/lib/components/Button/ButtonLink.tsx
|
|
10
|
-
var
|
|
11
|
-
let
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
n,
|
|
18
|
-
a[o],
|
|
19
|
-
g,
|
|
20
|
-
c,
|
|
21
|
-
d
|
|
22
|
-
])
|
|
7
|
+
var i = n(function({ size: n, ...i }, a) {
|
|
8
|
+
let o = e("ButtonLink"), s = n ?? o.size;
|
|
9
|
+
return /* @__PURE__ */ r(t, {
|
|
10
|
+
as: "a",
|
|
11
|
+
ref: a,
|
|
12
|
+
size: s,
|
|
13
|
+
...i
|
|
23
14
|
});
|
|
24
15
|
});
|
|
25
16
|
//#endregion
|
|
26
|
-
export {
|
|
17
|
+
export { i as default };
|
|
@@ -14,6 +14,6 @@ var e = "haze-styles__base", t = {
|
|
|
14
14
|
sm: a,
|
|
15
15
|
md: o,
|
|
16
16
|
lg: s
|
|
17
|
-
};
|
|
17
|
+
}, u = "haze-styles__label", d = "haze-styles__link", f = "haze-styles__loading";
|
|
18
18
|
//#endregion
|
|
19
|
-
export { e as base, i as sizeLg, r as sizeMd, n as sizeSm, c as sizes, s as squareLg, o as squareMd, l as squareSizes, a as squareSm, t as variants };
|
|
19
|
+
export { e as base, u as label, d as link, f as loading, i as sizeLg, r as sizeMd, n as sizeSm, c as sizes, s as squareLg, o as squareMd, l as squareSizes, a as squareSm, t as variants };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import o from "
|
|
4
|
+
import { getDirection as t } from "../../utils/direction.js";
|
|
5
|
+
import { useStrings as n } from "../LocaleProvider/useStrings.js";
|
|
6
|
+
import r from "../Spinner/Spinner.js";
|
|
7
|
+
import { mergeRefs as i } from "../../utils/refs.js";
|
|
8
|
+
import { FloatingPanel as a, useFloating as o } from "../../utils/floating.js";
|
|
9
9
|
import ee from "../VirtualList/VirtualList.js";
|
|
10
10
|
import { useFocusScope as te } from "../../utils/focus-scope.js";
|
|
11
11
|
/* empty css */
|
|
@@ -41,7 +41,7 @@ function g(e) {
|
|
|
41
41
|
return e ? Array.from(e.querySelectorAll(m)) : [];
|
|
42
42
|
}
|
|
43
43
|
function _({ options: _, value: v, onChange: je, placeholder: Me, changeOnSelect: Ne = !1, expandTrigger: Pe = "click", onSearch: y, loading: b = !1, virtualized: x, className: Fe, ref: S, ...Ie }) {
|
|
44
|
-
let Le =
|
|
44
|
+
let Le = n("cascader"), C = n("select"), [w, T] = p(!1, !1), E = ae(v), [D, O] = p(oe(E ? v : void 0, se((e) => je?.(e))), E ? [] : v ?? []), [k, A] = u([]), [j, M] = u(null), N = y !== void 0, [P, Re] = u(""), F = x !== void 0 && x !== !1, I = typeof x == "object" ? x : void 0, L = I?.itemHeight ?? Ce, ze = I?.overscan, R = re(), z = l(null), Be = s((e) => i(z, S)(e), [z, S]), B = l(null), V = l(null), H = l(/* @__PURE__ */ new Map()), U = l(!1), W = o({
|
|
45
45
|
open: w,
|
|
46
46
|
setOpen: T,
|
|
47
47
|
triggerRef: z,
|
|
@@ -148,9 +148,9 @@ function _({ options: _, value: v, onChange: je, placeholder: Me, changeOnSelect
|
|
|
148
148
|
}, Ge = (e) => {
|
|
149
149
|
!w && (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), T(!0));
|
|
150
150
|
}, Ke = (e) => {
|
|
151
|
-
let
|
|
152
|
-
if (!
|
|
153
|
-
let r = (document.activeElement instanceof HTMLElement ? document.activeElement : null)?.closest(m) ?? void 0, i = r ? Number(r.dataset.level) : 0, a = n
|
|
151
|
+
let n = B.current;
|
|
152
|
+
if (!n) return;
|
|
153
|
+
let r = (document.activeElement instanceof HTMLElement ? document.activeElement : null)?.closest(m) ?? void 0, i = r ? Number(r.dataset.level) : 0, a = t(n) === "rtl" ? "ArrowLeft" : "ArrowRight", o = a === "ArrowLeft" ? "ArrowRight" : "ArrowLeft";
|
|
154
154
|
switch (e.key) {
|
|
155
155
|
case "ArrowDown":
|
|
156
156
|
case "ArrowUp": {
|
|
@@ -252,7 +252,7 @@ function _({ options: _, value: v, onChange: je, placeholder: Me, changeOnSelect
|
|
|
252
252
|
}, n)), $ = b ? /* @__PURE__ */ f("div", {
|
|
253
253
|
"data-slot": "loading",
|
|
254
254
|
className: e(ve),
|
|
255
|
-
children: [/* @__PURE__ */ d(
|
|
255
|
+
children: [/* @__PURE__ */ d(r, { size: "sm" }), /* @__PURE__ */ d("span", { children: C.loading })]
|
|
256
256
|
}) : N && _.length === 0 ? /* @__PURE__ */ d("div", {
|
|
257
257
|
"data-slot": "empty",
|
|
258
258
|
className: e(ye),
|
|
@@ -291,7 +291,7 @@ function _({ options: _, value: v, onChange: je, placeholder: Me, changeOnSelect
|
|
|
291
291
|
className: e(fe),
|
|
292
292
|
children: /* @__PURE__ */ d(Ae, {})
|
|
293
293
|
})]
|
|
294
|
-
}), /* @__PURE__ */ d(
|
|
294
|
+
}), /* @__PURE__ */ d(a, {
|
|
295
295
|
ref: Ve,
|
|
296
296
|
behavior: W,
|
|
297
297
|
placement: "bottom",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { classnames as e } from "../../utils/classnames.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
5
|
+
import { mergeRefs as n } from "../../utils/refs.js";
|
|
6
6
|
import { FloatingPanel as r, useFloating as i } from "../../utils/floating.js";
|
|
7
7
|
import { cssColor as a, parseColor as o, rgbHexKey as s } from "./color-math.js";
|
|
8
8
|
import { checkerboard as c, panelVisuals as l, swatchFill as u, trigger as d } from "./color-picker-styles.js";
|
|
@@ -14,7 +14,7 @@ import { useControl as b } from "react-use-control";
|
|
|
14
14
|
//#region src/lib/components/ColorPicker/ColorPicker.tsx
|
|
15
15
|
var x = 10, S = "haze-ColorPicker__container";
|
|
16
16
|
function C({ value: C, onChange: w, open: T, inline: E = !1, format: D = "hex", allowAlpha: O = !1, presets: k, recent: A = !1, className: j, "aria-label": M, ref: N }) {
|
|
17
|
-
let P =
|
|
17
|
+
let P = t("colorPicker"), [F, I] = b(C, "#000000"), [L, R] = b(T, !1), z = M ?? P.pickColor, B = o(F)?.rgb ?? {
|
|
18
18
|
r: 0,
|
|
19
19
|
g: 0,
|
|
20
20
|
b: 0
|
|
@@ -39,7 +39,7 @@ function C({ value: C, onChange: w, open: T, inline: E = !1, format: D = "hex",
|
|
|
39
39
|
allowAlpha: O,
|
|
40
40
|
presets: k,
|
|
41
41
|
recentColors: A ? H : void 0
|
|
42
|
-
}), K = g(null), q = g(null), J = p((e) =>
|
|
42
|
+
}), K = g(null), q = g(null), J = p((e) => n(K, N)(e), [N]), Y = h(), X = i({
|
|
43
43
|
open: L,
|
|
44
44
|
setOpen: R,
|
|
45
45
|
triggerRef: K,
|