haze-ui 1.31.0 → 1.33.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 +87 -1178
- package/dist/coi-serviceworker.LICENSE +21 -0
- package/dist/coi-serviceworker.js +118 -0
- 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/Countdown/Countdown.js +49 -0
- package/dist/components/Countdown/index.js +3 -0
- 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/HoverCard/HoverCard.js +63 -43
- package/dist/components/ImageCrop/ImageCrop.js +188 -0
- package/dist/components/ImageCrop/image-crop-geometry.js +81 -0
- package/dist/components/ImageCrop/index.js +3 -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/LoadingOverlay/LoadingOverlay.js +30 -0
- package/dist/components/LoadingOverlay/index.js +3 -0
- package/dist/components/LocaleProvider/ar-sa.js +10 -0
- package/dist/components/LocaleProvider/de-de.js +10 -0
- package/dist/components/LocaleProvider/es-es.js +10 -0
- package/dist/components/LocaleProvider/fr-fr.js +10 -0
- package/dist/components/LocaleProvider/it-it.js +10 -0
- package/dist/components/LocaleProvider/ja-jp.js +10 -0
- package/dist/components/LocaleProvider/ko-kr.js +10 -0
- package/dist/components/LocaleProvider/locale.js +10 -0
- package/dist/components/LocaleProvider/pt-br.js +10 -0
- package/dist/components/LocaleProvider/ru-ru.js +10 -0
- package/dist/components/LocaleProvider/zh-cn.js +10 -0
- 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 +6 -6
- package/dist/components/PasswordInput/PasswordInputCore.js +27 -26
- package/dist/components/Rating/RatingCore.js +18 -18
- package/dist/components/Resizable/index.js +1 -1
- 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/Splitter/Splitter.js +199 -0
- package/dist/components/Splitter/index.js +3 -0
- package/dist/components/Spoiler/Spoiler.js +36 -0
- package/dist/components/Spoiler/index.js +3 -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/TagInputCore.js +10 -10
- package/dist/components/TimePicker/TimePickerPanel.js +3 -3
- package/dist/components/Toast/ToastContainer.js +4 -4
- package/dist/components/TreeSelect/TreeSelect.js +6 -6
- package/dist/components/VisuallyHidden/VisuallyHidden.js +15 -0
- package/dist/components/VisuallyHidden/index.js +2 -0
- package/dist/css/accordion.css +2 -0
- package/dist/css/activity-rail.css +2 -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 +2 -0
- 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 +2 -0
- 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 +2 -0
- 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 +2 -0
- package/dist/css/confirm-dialog.css +2 -0
- package/dist/css/container.css +2 -0
- package/dist/css/context-menu.css +2 -0
- package/dist/css/conversation-list.css +2 -0
- package/dist/css/count-up.css +2 -0
- package/dist/css/countdown.css +4 -0
- package/dist/css/data-table.css +2 -0
- package/dist/css/date-range-picker.css +2 -0
- 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 +2 -0
- package/dist/css/dropdown-menu.css +2 -0
- 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 +2 -0
- package/dist/css/icon.css +2 -0
- package/dist/css/image-crop.css +4 -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 +2 -0
- 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 +3 -1
- 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 +2 -0
- 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 +2 -0
- package/dist/css/rating.css +2 -0
- package/dist/css/resizable.css +2 -0
- package/dist/css/result.css +2 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/segmented.css +2 -0
- package/dist/css/select.css +2 -0
- package/dist/css/sidebar.css +2 -0
- package/dist/css/signature.css +2 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +2 -0
- package/dist/css/sources.css +2 -0
- package/dist/css/sparkline.css +2 -0
- package/dist/css/spinner.css +2 -0
- package/dist/css/splitter.css +4 -0
- package/dist/css/spoiler.css +4 -0
- package/dist/css/stat.css +2 -0
- package/dist/css/status-bar.css +2 -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 +2 -0
- package/dist/css/tab-bar.css +2 -0
- package/dist/css/table.css +2 -0
- package/dist/css/tabs.css +2 -0
- package/dist/css/tag-group.css +2 -0
- package/dist/css/tag-input.css +2 -0
- package/dist/css/tag.css +2 -0
- 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 +2 -0
- 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 +2 -0
- package/dist/css-manifest.json +190 -4
- package/dist/haze-ui.css +417 -5
- package/dist/headless/index.js +18 -17
- package/dist/hooks/useBusyPressable.js +10 -0
- package/dist/hooks/useHotkeys.js +78 -24
- package/dist/index.js +277 -264
- package/dist/mcp-docs.json +728 -32
- package/dist/registry.json +212 -14
- package/dist/robots.txt +4 -0
- package/dist/sitemap.xml +160 -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 +22 -1
- 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/Countdown/Countdown.d.ts +30 -0
- package/dist/types/components/Countdown/index.d.ts +2 -0
- 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/HoverCard/HoverCard.d.ts +18 -1
- package/dist/types/components/ImageCrop/ImageCrop.d.ts +67 -0
- package/dist/types/components/ImageCrop/image-crop-geometry.d.ts +65 -0
- package/dist/types/components/ImageCrop/index.d.ts +3 -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/LoadingOverlay/LoadingOverlay.d.ts +25 -0
- package/dist/types/components/LoadingOverlay/index.d.ts +2 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +10 -0
- 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/index.d.ts +0 -2
- 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/Splitter/Splitter.d.ts +33 -0
- package/dist/types/components/Splitter/index.d.ts +2 -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/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/VisuallyHidden/VisuallyHidden.d.ts +4 -0
- package/dist/types/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/types/headless/index.d.ts +16 -6
- 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/useHotkeys.d.ts +16 -4
- 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 +31 -8
- package/package.json +24 -5
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Guido Zuidhof
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*! coi-serviceworker v0.1.7 - Guido Zuidhof and contributors, licensed under MIT */
|
|
2
|
+
let coepCredentialless = false;
|
|
3
|
+
if (typeof window === 'undefined') {
|
|
4
|
+
self.addEventListener("install", () => self.skipWaiting());
|
|
5
|
+
self.addEventListener("activate", (event) => event.waitUntil(self.clients.claim()));
|
|
6
|
+
|
|
7
|
+
self.addEventListener("message", (ev) => {
|
|
8
|
+
if (!ev.data) {
|
|
9
|
+
return;
|
|
10
|
+
} else if (ev.data.type === "deregister") {
|
|
11
|
+
self.registration
|
|
12
|
+
.unregister()
|
|
13
|
+
.then(() => {
|
|
14
|
+
return self.clients.matchAll();
|
|
15
|
+
})
|
|
16
|
+
.then(clients => {
|
|
17
|
+
clients.forEach((client) => client.navigate(client.url));
|
|
18
|
+
});
|
|
19
|
+
} else if (ev.data.type === "coepCredentialless") {
|
|
20
|
+
coepCredentialless = ev.data.value;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
self.addEventListener("fetch", function (event) {
|
|
25
|
+
const r = event.request;
|
|
26
|
+
if (r.cache === "only-if-cached" && r.mode !== "same-origin") {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const request = (coepCredentialless && r.mode === "no-cors")
|
|
31
|
+
? new Request(r, {
|
|
32
|
+
credentials: "omit",
|
|
33
|
+
})
|
|
34
|
+
: r;
|
|
35
|
+
event.respondWith(
|
|
36
|
+
fetch(request)
|
|
37
|
+
.then((response) => {
|
|
38
|
+
if (response.status === 0) {
|
|
39
|
+
return response;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const newHeaders = new Headers(response.headers);
|
|
43
|
+
newHeaders.set("Cross-Origin-Embedder-Policy",
|
|
44
|
+
coepCredentialless ? "credentialless" : "require-corp"
|
|
45
|
+
);
|
|
46
|
+
if (!coepCredentialless) {
|
|
47
|
+
newHeaders.set("Cross-Origin-Resource-Policy", "cross-origin");
|
|
48
|
+
}
|
|
49
|
+
newHeaders.set("Cross-Origin-Opener-Policy", "same-origin");
|
|
50
|
+
|
|
51
|
+
return new Response(response.body, {
|
|
52
|
+
status: response.status,
|
|
53
|
+
statusText: response.statusText,
|
|
54
|
+
headers: newHeaders,
|
|
55
|
+
});
|
|
56
|
+
})
|
|
57
|
+
.catch((e) => console.error(e))
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
} else {
|
|
62
|
+
(() => {
|
|
63
|
+
// You can customize the behavior of this script through a global `coi` variable.
|
|
64
|
+
const coi = {
|
|
65
|
+
shouldRegister: () => true,
|
|
66
|
+
shouldDeregister: () => false,
|
|
67
|
+
coepCredentialless: () => !(window.chrome || window.netscape),
|
|
68
|
+
doReload: () => window.location.reload(),
|
|
69
|
+
quiet: false,
|
|
70
|
+
...window.coi
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const n = navigator;
|
|
74
|
+
|
|
75
|
+
if (n.serviceWorker && n.serviceWorker.controller) {
|
|
76
|
+
n.serviceWorker.controller.postMessage({
|
|
77
|
+
type: "coepCredentialless",
|
|
78
|
+
value: coi.coepCredentialless(),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
if (coi.shouldDeregister()) {
|
|
82
|
+
n.serviceWorker.controller.postMessage({ type: "deregister" });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// If we're already coi: do nothing. Perhaps it's due to this script doing its job, or COOP/COEP are
|
|
87
|
+
// already set from the origin server. Also if the browser has no notion of crossOriginIsolated, just give up here.
|
|
88
|
+
if (window.crossOriginIsolated !== false || !coi.shouldRegister()) return;
|
|
89
|
+
|
|
90
|
+
if (!window.isSecureContext) {
|
|
91
|
+
!coi.quiet && console.log("COOP/COEP Service Worker not registered, a secure context is required.");
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// In some environments (e.g. Chrome incognito mode) this won't be available
|
|
96
|
+
if (n.serviceWorker) {
|
|
97
|
+
n.serviceWorker.register(window.document.currentScript.src).then(
|
|
98
|
+
(registration) => {
|
|
99
|
+
!coi.quiet && console.log("COOP/COEP Service Worker registered", registration.scope);
|
|
100
|
+
|
|
101
|
+
registration.addEventListener("updatefound", () => {
|
|
102
|
+
!coi.quiet && console.log("Reloading page to make use of updated COOP/COEP Service Worker.");
|
|
103
|
+
coi.doReload();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// If the registration is active, but it's not controlling the page
|
|
107
|
+
if (registration.active && !n.serviceWorker.controller) {
|
|
108
|
+
!coi.quiet && console.log("Reloading page to make use of COOP/COEP Service Worker.");
|
|
109
|
+
coi.doReload();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
(err) => {
|
|
113
|
+
!coi.quiet && console.error("COOP/COEP Service Worker failed to register:", err);
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
})();
|
|
118
|
+
}
|
|
@@ -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,
|