@adamosuiteservices/ui 1.7.12 → 1.8.13
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/dist/accordion-rounded.cjs +24 -2
- package/dist/accordion-rounded.js +46 -8
- package/dist/accordion.cjs +20 -1
- package/dist/accordion.js +29 -5
- package/dist/alert.cjs +26 -1
- package/dist/alert.js +33 -8
- package/dist/avatar.cjs +7 -1
- package/dist/avatar.js +8 -2
- package/dist/badge.cjs +83 -1
- package/dist/badge.js +106 -24
- package/dist/breadcrumb.cjs +8 -1
- package/dist/breadcrumb.js +11 -4
- package/dist/button-B7ZP4LZN.js +127 -0
- package/dist/button-D-qFRXiM.cjs +70 -0
- package/dist/button-group.cjs +25 -1
- package/dist/button-group.js +33 -9
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.cjs +74 -1
- package/dist/calendar.js +114 -35
- package/dist/card.cjs +35 -1
- package/dist/card.js +45 -11
- package/dist/{checkbox-YWAnswaW.cjs → checkbox-CdnZ8VFJ.cjs} +21 -1
- package/dist/{checkbox-Dr487kAg.js → checkbox-DhBcmKze.js} +34 -4
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/combobox.cjs +36 -2
- package/dist/combobox.js +302 -253
- package/dist/components/icons/account-balance-icon.d.ts +3 -0
- package/dist/components/icons/account-icon.d.ts +3 -0
- package/dist/components/icons/add-circle-icon.d.ts +3 -0
- package/dist/components/icons/alarm-icon.d.ts +3 -0
- package/dist/components/icons/archive-icon.d.ts +3 -0
- package/dist/components/icons/arrow-back-icon.d.ts +3 -0
- package/dist/components/icons/arrow-circle-up-icon.d.ts +3 -0
- package/dist/components/icons/arrow-forward-icon.d.ts +3 -0
- package/dist/components/icons/arrow-outward-icon.d.ts +3 -0
- package/dist/components/icons/article-icon.d.ts +3 -0
- package/dist/components/icons/attach-file-icon.d.ts +3 -0
- package/dist/components/icons/autorenew-icon.d.ts +3 -0
- package/dist/components/icons/bookmark-icon.d.ts +3 -0
- package/dist/components/icons/calculate-icon.d.ts +3 -0
- package/dist/components/icons/calendar-today-icon.d.ts +3 -0
- package/dist/components/icons/call-split-icon.d.ts +3 -0
- package/dist/components/icons/cancel-filled-icon.d.ts +3 -0
- package/dist/components/icons/cancel-icon.d.ts +3 -0
- package/dist/components/icons/check-circle-icon.d.ts +3 -0
- package/dist/components/icons/check-icon.d.ts +3 -0
- package/dist/components/icons/chevron-back-icon.d.ts +3 -0
- package/dist/components/icons/chevron-down-icon.d.ts +3 -0
- package/dist/components/icons/chevron-forward-icon.d.ts +3 -0
- package/dist/components/icons/chevron-up-icon.d.ts +3 -0
- package/dist/components/icons/clarify-icon.d.ts +3 -0
- package/dist/components/icons/clock-icon.d.ts +3 -0
- package/dist/components/icons/close-icon.d.ts +3 -0
- package/dist/components/icons/confirmation-number-icon.d.ts +3 -0
- package/dist/components/icons/contacts-icon.d.ts +3 -0
- package/dist/components/icons/contract-delete-icon.d.ts +3 -0
- package/dist/components/icons/copy-icon.d.ts +3 -0
- package/dist/components/icons/do-not-touch-icon.d.ts +3 -0
- package/dist/components/icons/download-icon.d.ts +3 -0
- package/dist/components/icons/dragger-icon.d.ts +3 -0
- package/dist/components/icons/edit-icon.d.ts +3 -0
- package/dist/components/icons/edit-square-icon.d.ts +3 -0
- package/dist/components/icons/exclamation-icon.d.ts +3 -0
- package/dist/components/icons/expand-circle-right-icon.d.ts +3 -0
- package/dist/components/icons/feature-search-icon.d.ts +3 -0
- package/dist/components/icons/filter-icon.d.ts +3 -0
- package/dist/components/icons/folder-icon.d.ts +3 -0
- package/dist/components/icons/folder-open-icon.d.ts +3 -0
- package/dist/components/icons/format-list-bulleted-icon.d.ts +3 -0
- package/dist/components/icons/hamburger-menu-icon.d.ts +3 -0
- package/dist/components/icons/help-icon.d.ts +3 -0
- package/dist/components/icons/hide-pass-icon.d.ts +3 -0
- package/dist/components/icons/home-icon.d.ts +3 -0
- package/dist/components/icons/id-card-icon.d.ts +3 -0
- package/dist/components/icons/index.d.ts +88 -0
- package/dist/components/icons/info-icon.d.ts +3 -0
- package/dist/components/icons/kid-star-icon.d.ts +3 -0
- package/dist/components/icons/language-icon.d.ts +3 -0
- package/dist/components/icons/last-page-icon.d.ts +3 -0
- package/dist/components/icons/layers-icon.d.ts +3 -0
- package/dist/components/icons/location-icon.d.ts +3 -0
- package/dist/components/icons/mail-icon.d.ts +3 -0
- package/dist/components/icons/manage-search-icon.d.ts +3 -0
- package/dist/components/icons/menu-icon.d.ts +3 -0
- package/dist/components/icons/message-icon.d.ts +3 -0
- package/dist/components/icons/metrics-icon.d.ts +3 -0
- package/dist/components/icons/mic-icon.d.ts +3 -0
- package/dist/components/icons/minus-icon.d.ts +3 -0
- package/dist/components/icons/mode-comment-icon.d.ts +3 -0
- package/dist/components/icons/money-icon.d.ts +3 -0
- package/dist/components/icons/monitoring-icon.d.ts +3 -0
- package/dist/components/icons/more-icon.d.ts +3 -0
- package/dist/components/icons/notifications-icon.d.ts +3 -0
- package/dist/components/icons/open-in-new-icon.d.ts +3 -0
- package/dist/components/icons/palette-icon.d.ts +3 -0
- package/dist/components/icons/password-icon.d.ts +3 -0
- package/dist/components/icons/pending-icon.d.ts +3 -0
- package/dist/components/icons/person-add-icon.d.ts +3 -0
- package/dist/components/icons/person-search-icon.d.ts +3 -0
- package/dist/components/icons/photo-icon.d.ts +3 -0
- package/dist/components/icons/plus-icon.d.ts +3 -0
- package/dist/components/icons/policy-icon.d.ts +3 -0
- package/dist/components/icons/publish-icon.d.ts +3 -0
- package/dist/components/icons/ready-icon.d.ts +3 -0
- package/dist/components/icons/receipt-icon.d.ts +3 -0
- package/dist/components/icons/receive-icon.d.ts +3 -0
- package/dist/components/icons/refresh-icon.d.ts +3 -0
- package/dist/components/icons/search-icon.d.ts +3 -0
- package/dist/components/icons/see-icon.d.ts +3 -0
- package/dist/components/icons/send-icon.d.ts +3 -0
- package/dist/components/icons/settings-icon.d.ts +3 -0
- package/dist/components/icons/shield-icon.d.ts +3 -0
- package/dist/components/icons/swap-horiz-icon.d.ts +3 -0
- package/dist/components/icons/tag-icon.d.ts +3 -0
- package/dist/components/icons/trash-icon.d.ts +3 -0
- package/dist/components/layout/toaster/toaster.d.ts +1 -1
- package/dist/components/layout/toaster/toaster.stories.d.ts +1 -1
- package/dist/components/ui/accordion/accordion.d.ts +1 -1
- package/dist/components/ui/accordion/accordion.stories.d.ts +1 -1
- package/dist/components/ui/accordion-rounded/accordion-rounded.d.ts +1 -1
- package/dist/components/ui/accordion-rounded/accordion-rounded.stories.d.ts +1 -1
- package/dist/components/ui/alert/alert.stories.d.ts +1 -1
- package/dist/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/components/ui/avatar/avatar.stories.d.ts +1 -1
- package/dist/components/ui/badge/badge.stories.d.ts +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.stories.d.ts +1 -1
- package/dist/components/ui/button/button.stories.d.ts +1 -1
- package/dist/components/ui/button-group/button-group.d.ts +1 -1
- package/dist/components/ui/button-group/button-group.stories.d.ts +1 -1
- package/dist/components/ui/calendar/calendar.d.ts +1 -1
- package/dist/components/ui/calendar/calendar.stories.d.ts +1 -1
- package/dist/components/ui/card/card.stories.d.ts +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts +1 -1
- package/dist/components/ui/checkbox/checkbox.stories.d.ts +1 -1
- package/dist/components/ui/collapsible/collapsible.stories.d.ts +1 -1
- package/dist/components/ui/combobox/combobox.stories.d.ts +1 -1
- package/dist/components/ui/command/command.d.ts +1 -1
- package/dist/components/ui/context-menu/context-menu.d.ts +1 -1
- package/dist/components/ui/context-menu/context-menu.stories.d.ts +1 -1
- package/dist/components/ui/dialog/dialog.d.ts +1 -1
- package/dist/components/ui/dialog/dialog.stories.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.stories.d.ts +1 -1
- package/dist/components/ui/field/field.d.ts +1 -1
- package/dist/components/ui/field/field.stories.d.ts +1 -1
- package/dist/components/ui/hover-card/hover-card.d.ts +1 -1
- package/dist/components/ui/hover-card/hover-card.stories.d.ts +1 -1
- package/dist/components/ui/input/input.stories.d.ts +1 -1
- package/dist/components/ui/input-group/Input-group.stories.d.ts +1 -1
- package/dist/components/ui/input-group/input-group.d.ts +1 -1
- package/dist/components/ui/kbd/kbd.stories.d.ts +1 -1
- package/dist/components/ui/label/label.d.ts +1 -1
- package/dist/components/ui/label/label.stories.d.ts +1 -1
- package/dist/components/ui/pagination/pagination.stories.d.ts +1 -1
- package/dist/components/ui/popover/popover.d.ts +1 -1
- package/dist/components/ui/popover/popover.stories.d.ts +1 -1
- package/dist/components/ui/progress/progress.d.ts +1 -1
- package/dist/components/ui/progress/progress.stories.d.ts +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts +1 -1
- package/dist/components/ui/radio-group/radio-group.stories.d.ts +1 -1
- package/dist/components/ui/scroll-area/scroll-area.d.ts +1 -1
- package/dist/components/ui/scroll-area/scroll-area.stories.d.ts +1 -1
- package/dist/components/ui/select/select.d.ts +1 -1
- package/dist/components/ui/select/select.stories.d.ts +1 -1
- package/dist/components/ui/separator/separator.d.ts +1 -1
- package/dist/components/ui/separator/separator.stories.d.ts +1 -1
- package/dist/components/ui/sheet/sheet.d.ts +1 -1
- package/dist/components/ui/sheet/sheet.stories.d.ts +1 -1
- package/dist/components/ui/skeleton/skeleton.stories.d.ts +1 -1
- package/dist/components/ui/slider/slider.d.ts +1 -1
- package/dist/components/ui/slider/slider.stories.d.ts +1 -1
- package/dist/components/ui/spinner/spinner.stories.d.ts +1 -1
- package/dist/components/ui/switch/switch.d.ts +1 -1
- package/dist/components/ui/switch/switch.stories.d.ts +1 -1
- package/dist/components/ui/tabs/tabs.d.ts +1 -1
- package/dist/components/ui/tabs/tabs.stories.d.ts +1 -1
- package/dist/components/ui/tabs-underline/tabs-underline.d.ts +1 -1
- package/dist/components/ui/tabs-underline/tabs-underline.stories.d.ts +1 -1
- package/dist/components/ui/textarea/textarea.stories.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.stories.d.ts +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts +1 -1
- package/dist/components/ui/tooltip/tooltip.stories.d.ts +1 -1
- package/dist/context-menu.cjs +79 -1
- package/dist/context-menu.js +101 -11
- package/dist/custom-layered-styles.css +1 -1
- package/dist/dialog.cjs +30 -1
- package/dist/dialog.js +35 -6
- package/dist/dropdown-menu.cjs +79 -1
- package/dist/dropdown-menu.js +101 -11
- package/dist/field.cjs +66 -1
- package/dist/field.js +91 -26
- package/dist/hover-card.cjs +15 -1
- package/dist/hover-card.js +15 -1
- package/dist/icons.cjs +1 -0
- package/dist/icons.js +1507 -0
- package/dist/input-BQZUpTEY.js +42 -0
- package/dist/input-DSmxdfq5.cjs +21 -0
- package/dist/input-group.cjs +76 -1
- package/dist/input-group.js +99 -24
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/kbd.cjs +10 -1
- package/dist/kbd.js +11 -2
- package/dist/{label-CmwGvhy1.js → label-BJ8Yf6Ft.js} +7 -1
- package/dist/{label-BjXORCBM.cjs → label-CNGQhi5L.cjs} +7 -1
- package/dist/label.cjs +1 -1
- package/dist/label.js +1 -1
- package/dist/pagination.cjs +13 -1
- package/dist/pagination.js +30 -6
- package/dist/{popover-FCKBtFo-.cjs → popover-CYbik-H4.cjs} +15 -1
- package/dist/{popover-3rIoNCXs.js → popover-DAwH8jUh.js} +15 -1
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +1 -1
- package/dist/radio-group.cjs +14 -1
- package/dist/radio-group.js +20 -2
- package/dist/select.cjs +68 -1
- package/dist/select.js +83 -10
- package/dist/{separator-BaZqZZ9R.cjs → separator-Brpax0EI.cjs} +7 -1
- package/dist/{separator-DR7lQjv9.js → separator-DVypR3Qf.js} +7 -1
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +1 -1
- package/dist/sheet-CGahUP7F.cjs +41 -0
- package/dist/sheet-Q3dBOQG-.js +174 -0
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.cjs +20 -2
- package/dist/sidebar.js +58 -26
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider.cjs +27 -1
- package/dist/slider.js +30 -4
- package/dist/space.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/switch.cjs +18 -1
- package/dist/switch.js +19 -2
- package/dist/table.cjs +20 -1
- package/dist/table.js +26 -7
- package/dist/tabs-underline.cjs +21 -1
- package/dist/tabs-underline.js +23 -3
- package/dist/tabs.cjs +22 -1
- package/dist/tabs.js +24 -3
- package/dist/textarea-CG7iQcb3.cjs +14 -0
- package/dist/textarea-CUPWKl-S.js +32 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/toaster.cjs +4 -1
- package/dist/toaster.js +9 -6
- package/dist/toggle.cjs +17 -1
- package/dist/toggle.js +25 -9
- package/dist/tooltip.cjs +16 -1
- package/dist/tooltip.js +22 -2
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +6 -6
- package/docs/AI-GUIDE.md +321 -321
- package/docs/components/layout/sidebar.md +404 -404
- package/docs/components/layout/toaster.md +436 -436
- package/docs/components/ui/accordion-rounded.md +583 -583
- package/docs/components/ui/accordion.md +267 -267
- package/docs/components/ui/alert.md +671 -671
- package/docs/components/ui/avatar.md +588 -588
- package/docs/components/ui/badge.md +1024 -1024
- package/docs/components/ui/button-group.md +1002 -1002
- package/docs/components/ui/button.md +1078 -1078
- package/docs/components/ui/calendar.md +1159 -1159
- package/docs/components/ui/card.md +1265 -1265
- package/docs/components/ui/checkbox.md +292 -292
- package/docs/components/ui/collapsible.md +320 -320
- package/docs/components/ui/command.md +454 -454
- package/docs/components/ui/context-menu.md +540 -540
- package/docs/components/ui/dialog.md +628 -628
- package/docs/components/ui/dropdown-menu.md +731 -731
- package/docs/components/ui/field.md +706 -706
- package/docs/components/ui/hover-card.md +446 -446
- package/docs/components/ui/input-group.md +509 -509
- package/docs/components/ui/input.md +362 -362
- package/docs/components/ui/kbd.md +434 -434
- package/docs/components/ui/label.md +359 -359
- package/docs/components/ui/pagination.md +650 -650
- package/docs/components/ui/popover.md +536 -536
- package/docs/components/ui/progress.md +182 -182
- package/docs/components/ui/radio-group.md +311 -311
- package/docs/components/ui/select.md +352 -352
- package/docs/components/ui/separator.md +214 -214
- package/docs/components/ui/sheet.md +142 -142
- package/docs/components/ui/skeleton.md +140 -140
- package/docs/components/ui/slider.md +341 -341
- package/docs/components/ui/spinner.md +170 -170
- package/docs/components/ui/switch.md +402 -402
- package/docs/components/ui/table.md +183 -183
- package/docs/components/ui/tabs-underline.md +106 -106
- package/docs/components/ui/tabs.md +122 -122
- package/docs/components/ui/textarea.md +243 -243
- package/docs/components/ui/toggle.md +243 -243
- package/docs/components/ui/tooltip.md +320 -320
- package/docs/components/ui/typography.md +191 -191
- package/package.json +7 -1
- package/dist/button-2GdKenQI.js +0 -58
- package/dist/button-DEQVHMrX.cjs +0 -1
- package/dist/input-BF73maXg.cjs +0 -1
- package/dist/input-C04hsVXE.js +0 -22
- package/dist/sheet-B-9YHdR5.js +0 -128
- package/dist/sheet-CU-sFSaJ.cjs +0 -1
- package/dist/textarea-3ZdbFRDN.cjs +0 -1
- package/dist/textarea-BZbcAAAu.js +0 -19
package/dist/combobox.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { j as p } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { B as je } from "./button-B7ZP4LZN.js";
|
|
3
|
+
import { C as Ce } from "./checkbox-DhBcmKze.js";
|
|
4
4
|
import { c as M } from "./index-CRiPKpXj.js";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { P } from "./index-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { c as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { C as
|
|
14
|
-
import { C as
|
|
5
|
+
import * as a from "react";
|
|
6
|
+
import { useRef as Ie, useState as fe } from "react";
|
|
7
|
+
import { R as Re, P as Ae, O as Ne, a as $e } from "./index-DniCthJA.js";
|
|
8
|
+
import { P as F } from "./index-BMWt1NBG.js";
|
|
9
|
+
import { u as W } from "./index-Cv867SGx.js";
|
|
10
|
+
import { c as ee } from "./index-DLcqcWxM.js";
|
|
11
|
+
import { c as Me } from "./createLucideIcon-B_8CJpcQ.js";
|
|
12
|
+
import { P as Le, a as De, b as Pe } from "./popover-DAwH8jUh.js";
|
|
13
|
+
import { C as Fe } from "./check-Ci0GjV-B.js";
|
|
14
|
+
import { C as Oe } from "./chevron-down-CpVS2Z7w.js";
|
|
15
15
|
/**
|
|
16
16
|
* @license lucide-react v0.546.0 - ISC
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the ISC license.
|
|
19
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
|
-
const
|
|
21
|
+
const Ve = [
|
|
22
22
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
23
23
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
24
|
-
],
|
|
25
|
-
var pe = 1,
|
|
26
|
-
function ce(e, n, r, h, o,
|
|
27
|
-
if (
|
|
28
|
-
var s = `${o},${
|
|
24
|
+
], ze = Me("search", Ve);
|
|
25
|
+
var pe = 1, Ke = 0.9, Te = 0.8, qe = 0.17, ie = 0.1, de = 0.999, Be = 0.9999, We = 0.99, _e = /[\\\/_+.#"@\[\(\{&]/, Ge = /[\\\/_+.#"@\[\(\{&]/g, Ue = /[\s-]/, ge = /[\s-]/g;
|
|
26
|
+
function ce(e, n, r, h, o, c, m) {
|
|
27
|
+
if (c === n.length) return o === e.length ? pe : We;
|
|
28
|
+
var s = `${o},${c}`;
|
|
29
29
|
if (m[s] !== void 0) return m[s];
|
|
30
|
-
for (var
|
|
31
|
-
return m[s] =
|
|
30
|
+
for (var x = h.charAt(c), i = r.indexOf(x, o), g = 0, u, j, S, R; i >= 0; ) u = ce(e, n, r, h, i + 1, c + 1, m), u > g && (i === o ? u *= pe : _e.test(e.charAt(i - 1)) ? (u *= Te, S = e.slice(o, i - 1).match(Ge), S && o > 0 && (u *= Math.pow(de, S.length))) : Ue.test(e.charAt(i - 1)) ? (u *= Ke, R = e.slice(o, i - 1).match(ge), R && o > 0 && (u *= Math.pow(de, R.length))) : (u *= qe, o > 0 && (u *= Math.pow(de, i - o))), e.charAt(i) !== n.charAt(c) && (u *= Be)), (u < ie && r.charAt(i - 1) === h.charAt(c + 1) || h.charAt(c + 1) === h.charAt(c) && r.charAt(i - 1) !== h.charAt(c)) && (j = ce(e, n, r, h, i + 1, c + 2, m), j * ie > u && (u = j * ie)), u > g && (g = u), i = r.indexOf(x, i + 1);
|
|
31
|
+
return m[s] = g, g;
|
|
32
32
|
}
|
|
33
33
|
function he(e) {
|
|
34
34
|
return e.toLowerCase().replace(ge, " ");
|
|
@@ -36,247 +36,247 @@ function he(e) {
|
|
|
36
36
|
function He(e, n, r) {
|
|
37
37
|
return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, ce(e, n, he(e), he(n), 0, 0, {});
|
|
38
38
|
}
|
|
39
|
-
var
|
|
40
|
-
let r =
|
|
41
|
-
var t,
|
|
42
|
-
return { search: "", value: (
|
|
43
|
-
}), h =
|
|
39
|
+
var Z = '[cmdk-group=""]', ue = '[cmdk-group-items=""]', Je = '[cmdk-group-heading=""]', xe = '[cmdk-item=""]', ve = `${xe}:not([aria-disabled="true"])`, se = "cmdk-item-select", q = "data-value", Xe = (e, n, r) => He(e, n, r), be = a.createContext(void 0), te = () => a.useContext(be), ye = a.createContext(void 0), me = () => a.useContext(ye), ke = a.createContext(void 0), we = a.forwardRef((e, n) => {
|
|
40
|
+
let r = B(() => {
|
|
41
|
+
var t, d;
|
|
42
|
+
return { search: "", value: (d = (t = e.value) != null ? t : e.defaultValue) != null ? d : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
43
|
+
}), h = B(() => /* @__PURE__ */ new Set()), o = B(() => /* @__PURE__ */ new Map()), c = B(() => /* @__PURE__ */ new Map()), m = B(() => /* @__PURE__ */ new Set()), s = Se(e), { label: x, children: i, value: g, onValueChange: u, filter: j, shouldFilter: S, loop: R, disablePointerSelection: G = !1, vimBindings: L = !0, ...y } = e, re = W(), A = W(), K = W(), N = a.useRef(null), k = it();
|
|
44
44
|
z(() => {
|
|
45
|
-
if (
|
|
46
|
-
let t =
|
|
47
|
-
r.current.value = t,
|
|
45
|
+
if (g !== void 0) {
|
|
46
|
+
let t = g.trim();
|
|
47
|
+
r.current.value = t, E.emit();
|
|
48
48
|
}
|
|
49
|
-
}, [
|
|
50
|
-
k(6,
|
|
49
|
+
}, [g]), z(() => {
|
|
50
|
+
k(6, X);
|
|
51
51
|
}, []);
|
|
52
|
-
let
|
|
53
|
-
var l,
|
|
54
|
-
if (!Object.is(r.current[t],
|
|
55
|
-
if (r.current[t] =
|
|
52
|
+
let E = a.useMemo(() => ({ subscribe: (t) => (m.current.add(t), () => m.current.delete(t)), snapshot: () => r.current, setState: (t, d, v) => {
|
|
53
|
+
var l, b, w, I;
|
|
54
|
+
if (!Object.is(r.current[t], d)) {
|
|
55
|
+
if (r.current[t] = d, t === "search") J(), T(), k(1, O);
|
|
56
56
|
else if (t === "value") {
|
|
57
57
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
58
|
-
let C = document.getElementById(
|
|
59
|
-
C ? C.focus() : (l = document.getElementById(
|
|
58
|
+
let C = document.getElementById(K);
|
|
59
|
+
C ? C.focus() : (l = document.getElementById(re)) == null || l.focus();
|
|
60
60
|
}
|
|
61
61
|
if (k(7, () => {
|
|
62
62
|
var C;
|
|
63
|
-
r.current.selectedItemId = (C =
|
|
64
|
-
}), v || k(5,
|
|
65
|
-
let C =
|
|
66
|
-
(
|
|
63
|
+
r.current.selectedItemId = (C = D()) == null ? void 0 : C.id, E.emit();
|
|
64
|
+
}), v || k(5, X), ((b = s.current) == null ? void 0 : b.value) !== void 0) {
|
|
65
|
+
let C = d ?? "";
|
|
66
|
+
(I = (w = s.current).onValueChange) == null || I.call(w, C);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
E.emit();
|
|
71
71
|
}
|
|
72
72
|
}, emit: () => {
|
|
73
73
|
m.current.forEach((t) => t());
|
|
74
|
-
} }), []),
|
|
74
|
+
} }), []), U = a.useMemo(() => ({ value: (t, d, v) => {
|
|
75
75
|
var l;
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
d !== ((l = c.current.get(t)) == null ? void 0 : l.value) && (c.current.set(t, { value: d, keywords: v }), r.current.filtered.items.set(t, H(d, v)), k(2, () => {
|
|
77
|
+
T(), E.emit();
|
|
78
78
|
}));
|
|
79
|
-
}, item: (t,
|
|
80
|
-
|
|
79
|
+
}, item: (t, d) => (h.current.add(t), d && (o.current.has(d) ? o.current.get(d).add(t) : o.current.set(d, /* @__PURE__ */ new Set([t]))), k(3, () => {
|
|
80
|
+
J(), T(), r.current.value || O(), E.emit();
|
|
81
81
|
}), () => {
|
|
82
|
-
|
|
83
|
-
let v =
|
|
82
|
+
c.current.delete(t), h.current.delete(t), r.current.filtered.items.delete(t);
|
|
83
|
+
let v = D();
|
|
84
84
|
k(4, () => {
|
|
85
|
-
|
|
85
|
+
J(), v?.getAttribute("id") === t && O(), E.emit();
|
|
86
86
|
});
|
|
87
87
|
}), group: (t) => (o.current.has(t) || o.current.set(t, /* @__PURE__ */ new Set()), () => {
|
|
88
|
-
|
|
89
|
-
}), filter: () => s.current.shouldFilter, label:
|
|
90
|
-
function
|
|
88
|
+
c.current.delete(t), o.current.delete(t);
|
|
89
|
+
}), filter: () => s.current.shouldFilter, label: x || e["aria-label"], getDisablePointerSelection: () => s.current.disablePointerSelection, listId: re, inputId: K, labelId: A, listInnerRef: N }), []);
|
|
90
|
+
function H(t, d) {
|
|
91
91
|
var v, l;
|
|
92
|
-
let
|
|
93
|
-
return t ?
|
|
92
|
+
let b = (l = (v = s.current) == null ? void 0 : v.filter) != null ? l : Xe;
|
|
93
|
+
return t ? b(t, r.current.search, d) : 0;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function T() {
|
|
96
96
|
if (!r.current.search || s.current.shouldFilter === !1) return;
|
|
97
|
-
let t = r.current.filtered.items,
|
|
97
|
+
let t = r.current.filtered.items, d = [];
|
|
98
98
|
r.current.filtered.groups.forEach((l) => {
|
|
99
|
-
let
|
|
100
|
-
|
|
101
|
-
let C = t.get(
|
|
99
|
+
let b = o.current.get(l), w = 0;
|
|
100
|
+
b.forEach((I) => {
|
|
101
|
+
let C = t.get(I);
|
|
102
102
|
w = Math.max(C, w);
|
|
103
|
-
}),
|
|
103
|
+
}), d.push([l, w]);
|
|
104
104
|
});
|
|
105
|
-
let v =
|
|
106
|
-
V().sort((l,
|
|
107
|
-
var w,
|
|
108
|
-
let C = l.getAttribute("id"), le =
|
|
109
|
-
return ((w = t.get(le)) != null ? w : 0) - ((
|
|
105
|
+
let v = N.current;
|
|
106
|
+
V().sort((l, b) => {
|
|
107
|
+
var w, I;
|
|
108
|
+
let C = l.getAttribute("id"), le = b.getAttribute("id");
|
|
109
|
+
return ((w = t.get(le)) != null ? w : 0) - ((I = t.get(C)) != null ? I : 0);
|
|
110
110
|
}).forEach((l) => {
|
|
111
|
-
let
|
|
112
|
-
|
|
113
|
-
}),
|
|
114
|
-
var
|
|
115
|
-
let w = (
|
|
111
|
+
let b = l.closest(ue);
|
|
112
|
+
b ? b.appendChild(l.parentElement === b ? l : l.closest(`${ue} > *`)) : v.appendChild(l.parentElement === v ? l : l.closest(`${ue} > *`));
|
|
113
|
+
}), d.sort((l, b) => b[1] - l[1]).forEach((l) => {
|
|
114
|
+
var b;
|
|
115
|
+
let w = (b = N.current) == null ? void 0 : b.querySelector(`${Z}[${q}="${encodeURIComponent(l[0])}"]`);
|
|
116
116
|
w?.parentElement.appendChild(w);
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
let t = V().find((v) => v.getAttribute("aria-disabled") !== "true"),
|
|
121
|
-
|
|
119
|
+
function O() {
|
|
120
|
+
let t = V().find((v) => v.getAttribute("aria-disabled") !== "true"), d = t?.getAttribute(q);
|
|
121
|
+
E.setState("value", d || void 0);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
var t,
|
|
123
|
+
function J() {
|
|
124
|
+
var t, d, v, l;
|
|
125
125
|
if (!r.current.search || s.current.shouldFilter === !1) {
|
|
126
126
|
r.current.filtered.count = h.current.size;
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
r.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
130
|
-
let
|
|
130
|
+
let b = 0;
|
|
131
131
|
for (let w of h.current) {
|
|
132
|
-
let
|
|
133
|
-
r.current.filtered.items.set(w, le), le > 0 &&
|
|
132
|
+
let I = (d = (t = c.current.get(w)) == null ? void 0 : t.value) != null ? d : "", C = (l = (v = c.current.get(w)) == null ? void 0 : v.keywords) != null ? l : [], le = H(I, C);
|
|
133
|
+
r.current.filtered.items.set(w, le), le > 0 && b++;
|
|
134
134
|
}
|
|
135
|
-
for (let [w,
|
|
135
|
+
for (let [w, I] of o.current) for (let C of I) if (r.current.filtered.items.get(C) > 0) {
|
|
136
136
|
r.current.filtered.groups.add(w);
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
|
-
r.current.filtered.count =
|
|
139
|
+
r.current.filtered.count = b;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
var t,
|
|
143
|
-
let l =
|
|
144
|
-
l && (((t = l.parentElement) == null ? void 0 : t.firstChild) === l && ((v = (
|
|
141
|
+
function X() {
|
|
142
|
+
var t, d, v;
|
|
143
|
+
let l = D();
|
|
144
|
+
l && (((t = l.parentElement) == null ? void 0 : t.firstChild) === l && ((v = (d = l.closest(Z)) == null ? void 0 : d.querySelector(Je)) == null || v.scrollIntoView({ block: "nearest" })), l.scrollIntoView({ block: "nearest" }));
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function D() {
|
|
147
147
|
var t;
|
|
148
|
-
return (t =
|
|
148
|
+
return (t = N.current) == null ? void 0 : t.querySelector(`${xe}[aria-selected="true"]`);
|
|
149
149
|
}
|
|
150
150
|
function V() {
|
|
151
151
|
var t;
|
|
152
|
-
return Array.from(((t =
|
|
152
|
+
return Array.from(((t = N.current) == null ? void 0 : t.querySelectorAll(ve)) || []);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
let
|
|
156
|
-
|
|
154
|
+
function Y(t) {
|
|
155
|
+
let d = V()[t];
|
|
156
|
+
d && E.setState("value", d.getAttribute(q));
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
var
|
|
160
|
-
let v =
|
|
161
|
-
(
|
|
158
|
+
function Q(t) {
|
|
159
|
+
var d;
|
|
160
|
+
let v = D(), l = V(), b = l.findIndex((I) => I === v), w = l[b + t];
|
|
161
|
+
(d = s.current) != null && d.loop && (w = b + t < 0 ? l[l.length - 1] : b + t === l.length ? l[0] : l[b + t]), w && E.setState("value", w.getAttribute(q));
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
let
|
|
165
|
-
for (; v && !l; ) v = t > 0 ?
|
|
166
|
-
l ?
|
|
163
|
+
function ne(t) {
|
|
164
|
+
let d = D(), v = d?.closest(Z), l;
|
|
165
|
+
for (; v && !l; ) v = t > 0 ? lt(v, Z) : ot(v, Z), l = v?.querySelector(ve);
|
|
166
|
+
l ? E.setState("value", l.getAttribute(q)) : Q(t);
|
|
167
167
|
}
|
|
168
|
-
let
|
|
169
|
-
t.preventDefault(), t.metaKey ?
|
|
170
|
-
},
|
|
171
|
-
t.preventDefault(), t.metaKey ?
|
|
168
|
+
let ae = () => Y(V().length - 1), f = (t) => {
|
|
169
|
+
t.preventDefault(), t.metaKey ? ae() : t.altKey ? ne(1) : Q(1);
|
|
170
|
+
}, $ = (t) => {
|
|
171
|
+
t.preventDefault(), t.metaKey ? Y(0) : t.altKey ? ne(-1) : Q(-1);
|
|
172
172
|
};
|
|
173
|
-
return a.createElement(
|
|
174
|
-
var
|
|
175
|
-
(
|
|
173
|
+
return a.createElement(F.div, { ref: n, tabIndex: -1, ...y, "cmdk-root": "", onKeyDown: (t) => {
|
|
174
|
+
var d;
|
|
175
|
+
(d = y.onKeyDown) == null || d.call(y, t);
|
|
176
176
|
let v = t.nativeEvent.isComposing || t.keyCode === 229;
|
|
177
177
|
if (!(t.defaultPrevented || v)) switch (t.key) {
|
|
178
178
|
case "n":
|
|
179
179
|
case "j": {
|
|
180
|
-
|
|
180
|
+
L && t.ctrlKey && f(t);
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
183
|
case "ArrowDown": {
|
|
184
|
-
|
|
184
|
+
f(t);
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
case "p":
|
|
188
188
|
case "k": {
|
|
189
|
-
|
|
189
|
+
L && t.ctrlKey && $(t);
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
case "ArrowUp": {
|
|
193
|
-
|
|
193
|
+
$(t);
|
|
194
194
|
break;
|
|
195
195
|
}
|
|
196
196
|
case "Home": {
|
|
197
|
-
t.preventDefault(),
|
|
197
|
+
t.preventDefault(), Y(0);
|
|
198
198
|
break;
|
|
199
199
|
}
|
|
200
200
|
case "End": {
|
|
201
|
-
t.preventDefault(),
|
|
201
|
+
t.preventDefault(), ae();
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
case "Enter": {
|
|
205
205
|
t.preventDefault();
|
|
206
|
-
let l =
|
|
206
|
+
let l = D();
|
|
207
207
|
if (l) {
|
|
208
|
-
let
|
|
209
|
-
l.dispatchEvent(
|
|
208
|
+
let b = new Event(se);
|
|
209
|
+
l.dispatchEvent(b);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
} }, a.createElement("label", { "cmdk-label": "", htmlFor:
|
|
214
|
-
}),
|
|
213
|
+
} }, a.createElement("label", { "cmdk-label": "", htmlFor: U.inputId, id: U.labelId, style: ut }, x), oe(e, (t) => a.createElement(ye.Provider, { value: E }, a.createElement(be.Provider, { value: U }, t))));
|
|
214
|
+
}), Ye = a.forwardRef((e, n) => {
|
|
215
215
|
var r, h;
|
|
216
|
-
let o =
|
|
216
|
+
let o = W(), c = a.useRef(null), m = a.useContext(ke), s = te(), x = Se(e), i = (h = (r = x.current) == null ? void 0 : r.forceMount) != null ? h : m?.forceMount;
|
|
217
217
|
z(() => {
|
|
218
218
|
if (!i) return s.item(o, m?.id);
|
|
219
219
|
}, [i]);
|
|
220
|
-
let
|
|
220
|
+
let g = Ee(o, c, [e.value, e.children, c], e.keywords), u = me(), j = P((k) => k.value && k.value === g.current), S = P((k) => i || s.filter() === !1 ? !0 : k.search ? k.filtered.items.get(o) > 0 : !0);
|
|
221
221
|
a.useEffect(() => {
|
|
222
|
-
let k =
|
|
223
|
-
if (!(!k || e.disabled)) return k.addEventListener(se,
|
|
224
|
-
}, [
|
|
225
|
-
function
|
|
226
|
-
var k,
|
|
227
|
-
|
|
222
|
+
let k = c.current;
|
|
223
|
+
if (!(!k || e.disabled)) return k.addEventListener(se, R), () => k.removeEventListener(se, R);
|
|
224
|
+
}, [S, e.onSelect, e.disabled]);
|
|
225
|
+
function R() {
|
|
226
|
+
var k, E;
|
|
227
|
+
G(), (E = (k = x.current).onSelect) == null || E.call(k, g.current);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
229
|
+
function G() {
|
|
230
|
+
u.setState("value", g.current, !0);
|
|
231
231
|
}
|
|
232
|
-
if (!
|
|
233
|
-
let { disabled:
|
|
234
|
-
return a.createElement(
|
|
235
|
-
}), Ye = a.forwardRef((e, n) => {
|
|
236
|
-
let { heading: r, children: h, forceMount: o, ...u } = e, m = G(), s = a.useRef(null), b = a.useRef(null), i = G(), x = re(), d = D((E) => o || x.filter() === !1 ? !0 : E.search ? E.filtered.groups.has(m) : !0);
|
|
237
|
-
z(() => x.group(m), []), Ee(m, s, [e.value, e.heading, b]);
|
|
238
|
-
let S = a.useMemo(() => ({ id: m, forceMount: o }), [o]);
|
|
239
|
-
return a.createElement(P.div, { ref: te(s, n), ...u, "cmdk-group": "", role: "presentation", hidden: d ? void 0 : !0 }, r && a.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": !0, id: i }, r), oe(e, (E) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? i : void 0 }, a.createElement(ke.Provider, { value: S }, E))));
|
|
232
|
+
if (!S) return null;
|
|
233
|
+
let { disabled: L, value: y, onSelect: re, forceMount: A, keywords: K, ...N } = e;
|
|
234
|
+
return a.createElement(F.div, { ref: ee(c, n), ...N, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!L, "aria-selected": !!j, "data-disabled": !!L, "data-selected": !!j, onPointerMove: L || s.getDisablePointerSelection() ? void 0 : G, onClick: L ? void 0 : R }, e.children);
|
|
240
235
|
}), Qe = a.forwardRef((e, n) => {
|
|
241
|
-
let {
|
|
242
|
-
|
|
236
|
+
let { heading: r, children: h, forceMount: o, ...c } = e, m = W(), s = a.useRef(null), x = a.useRef(null), i = W(), g = te(), u = P((S) => o || g.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(m) : !0);
|
|
237
|
+
z(() => g.group(m), []), Ee(m, s, [e.value, e.heading, x]);
|
|
238
|
+
let j = a.useMemo(() => ({ id: m, forceMount: o }), [o]);
|
|
239
|
+
return a.createElement(F.div, { ref: ee(s, n), ...c, "cmdk-group": "", role: "presentation", hidden: u ? void 0 : !0 }, r && a.createElement("div", { ref: x, "cmdk-group-heading": "", "aria-hidden": !0, id: i }, r), oe(e, (S) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? i : void 0 }, a.createElement(ke.Provider, { value: j }, S))));
|
|
243
240
|
}), Ze = a.forwardRef((e, n) => {
|
|
244
|
-
let {
|
|
241
|
+
let { alwaysRender: r, ...h } = e, o = a.useRef(null), c = P((m) => !m.search);
|
|
242
|
+
return !r && !c ? null : a.createElement(F.div, { ref: ee(o, n), ...h, "cmdk-separator": "", role: "separator" });
|
|
243
|
+
}), et = a.forwardRef((e, n) => {
|
|
244
|
+
let { onValueChange: r, ...h } = e, o = e.value != null, c = me(), m = P((i) => i.search), s = P((i) => i.selectedItemId), x = te();
|
|
245
245
|
return a.useEffect(() => {
|
|
246
|
-
e.value != null &&
|
|
247
|
-
}, [e.value]), a.createElement(
|
|
248
|
-
o ||
|
|
246
|
+
e.value != null && c.setState("search", e.value);
|
|
247
|
+
}, [e.value]), a.createElement(F.input, { ref: n, ...h, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": x.listId, "aria-labelledby": x.labelId, "aria-activedescendant": s, id: x.inputId, type: "text", value: o ? e.value : m, onChange: (i) => {
|
|
248
|
+
o || c.setState("search", i.target.value), r?.(i.target.value);
|
|
249
249
|
} });
|
|
250
|
-
}),
|
|
251
|
-
let { children: r, label: h = "Suggestions", ...o } = e,
|
|
250
|
+
}), tt = a.forwardRef((e, n) => {
|
|
251
|
+
let { children: r, label: h = "Suggestions", ...o } = e, c = a.useRef(null), m = a.useRef(null), s = P((i) => i.selectedItemId), x = te();
|
|
252
252
|
return a.useEffect(() => {
|
|
253
|
-
if (m.current &&
|
|
254
|
-
let i = m.current,
|
|
255
|
-
|
|
256
|
-
let
|
|
257
|
-
|
|
253
|
+
if (m.current && c.current) {
|
|
254
|
+
let i = m.current, g = c.current, u, j = new ResizeObserver(() => {
|
|
255
|
+
u = requestAnimationFrame(() => {
|
|
256
|
+
let S = i.offsetHeight;
|
|
257
|
+
g.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
|
|
258
258
|
});
|
|
259
259
|
});
|
|
260
|
-
return
|
|
261
|
-
cancelAnimationFrame(
|
|
260
|
+
return j.observe(i), () => {
|
|
261
|
+
cancelAnimationFrame(u), j.unobserve(i);
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
-
}, []), a.createElement(
|
|
265
|
-
}),
|
|
266
|
-
let { open: r, onOpenChange: h, overlayClassName: o, contentClassName:
|
|
267
|
-
return a.createElement(
|
|
268
|
-
}),
|
|
269
|
-
let { progress: r, children: h, label: o = "Loading...", ...
|
|
270
|
-
return a.createElement(
|
|
271
|
-
}),
|
|
272
|
-
function
|
|
264
|
+
}, []), a.createElement(F.div, { ref: ee(c, n), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": s, "aria-label": h, id: x.listId }, oe(e, (i) => a.createElement("div", { ref: ee(m, x.listInnerRef), "cmdk-list-sizer": "" }, i)));
|
|
265
|
+
}), rt = a.forwardRef((e, n) => {
|
|
266
|
+
let { open: r, onOpenChange: h, overlayClassName: o, contentClassName: c, container: m, ...s } = e;
|
|
267
|
+
return a.createElement(Re, { open: r, onOpenChange: h }, a.createElement(Ae, { container: m }, a.createElement(Ne, { "cmdk-overlay": "", className: o }), a.createElement($e, { "aria-label": e.label, "cmdk-dialog": "", className: c }, a.createElement(we, { ref: n, ...s }))));
|
|
268
|
+
}), nt = a.forwardRef((e, n) => P((r) => r.filtered.count === 0) ? a.createElement(F.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), at = a.forwardRef((e, n) => {
|
|
269
|
+
let { progress: r, children: h, label: o = "Loading...", ...c } = e;
|
|
270
|
+
return a.createElement(F.div, { ref: n, ...c, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, oe(e, (m) => a.createElement("div", { "aria-hidden": !0 }, m)));
|
|
271
|
+
}), _ = Object.assign(we, { List: tt, Item: Ye, Input: et, Group: Qe, Separator: Ze, Dialog: rt, Empty: nt, Loading: at });
|
|
272
|
+
function lt(e, n) {
|
|
273
273
|
let r = e.nextElementSibling;
|
|
274
274
|
for (; r; ) {
|
|
275
275
|
if (r.matches(n)) return r;
|
|
276
276
|
r = r.nextElementSibling;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function ot(e, n) {
|
|
280
280
|
let r = e.previousElementSibling;
|
|
281
281
|
for (; r; ) {
|
|
282
282
|
if (r.matches(n)) return r;
|
|
@@ -290,61 +290,64 @@ function Se(e) {
|
|
|
290
290
|
}), n;
|
|
291
291
|
}
|
|
292
292
|
var z = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
|
|
293
|
-
function
|
|
293
|
+
function B(e) {
|
|
294
294
|
let n = a.useRef();
|
|
295
295
|
return n.current === void 0 && (n.current = e()), n;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function P(e) {
|
|
298
298
|
let n = me(), r = () => e(n.snapshot());
|
|
299
299
|
return a.useSyncExternalStore(n.subscribe, r, r);
|
|
300
300
|
}
|
|
301
301
|
function Ee(e, n, r, h = []) {
|
|
302
|
-
let o = a.useRef(),
|
|
302
|
+
let o = a.useRef(), c = te();
|
|
303
303
|
return z(() => {
|
|
304
304
|
var m;
|
|
305
305
|
let s = (() => {
|
|
306
306
|
var i;
|
|
307
|
-
for (let
|
|
308
|
-
if (typeof
|
|
309
|
-
if (typeof
|
|
307
|
+
for (let g of r) {
|
|
308
|
+
if (typeof g == "string") return g.trim();
|
|
309
|
+
if (typeof g == "object" && "current" in g) return g.current ? (i = g.current.textContent) == null ? void 0 : i.trim() : o.current;
|
|
310
310
|
}
|
|
311
|
-
})(),
|
|
312
|
-
|
|
311
|
+
})(), x = h.map((i) => i.trim());
|
|
312
|
+
c.value(e, s, x), (m = n.current) == null || m.setAttribute(q, s), o.current = s;
|
|
313
313
|
}), o;
|
|
314
314
|
}
|
|
315
|
-
var
|
|
316
|
-
let [e, n] = a.useState(), r =
|
|
315
|
+
var it = () => {
|
|
316
|
+
let [e, n] = a.useState(), r = B(() => /* @__PURE__ */ new Map());
|
|
317
317
|
return z(() => {
|
|
318
318
|
r.current.forEach((h) => h()), r.current = /* @__PURE__ */ new Map();
|
|
319
319
|
}, [e]), (h, o) => {
|
|
320
320
|
r.current.set(h, o), n({});
|
|
321
321
|
};
|
|
322
322
|
};
|
|
323
|
-
function
|
|
323
|
+
function dt(e) {
|
|
324
324
|
let n = e.type;
|
|
325
325
|
return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
|
|
326
326
|
}
|
|
327
327
|
function oe({ asChild: e, children: n }, r) {
|
|
328
|
-
return e && a.isValidElement(n) ? a.cloneElement(
|
|
328
|
+
return e && a.isValidElement(n) ? a.cloneElement(dt(n), { ref: n.ref }, r(n.props.children)) : r(n);
|
|
329
329
|
}
|
|
330
|
-
var
|
|
331
|
-
function
|
|
330
|
+
var ut = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
331
|
+
function ct({
|
|
332
332
|
className: e,
|
|
333
333
|
...n
|
|
334
334
|
}) {
|
|
335
335
|
return /* @__PURE__ */ p.jsx(
|
|
336
|
-
|
|
336
|
+
_,
|
|
337
337
|
{
|
|
338
338
|
"data-slot": "command",
|
|
339
339
|
className: M(
|
|
340
|
-
|
|
340
|
+
`
|
|
341
|
+
adm:flex adm:h-full adm:w-full adm:flex-col adm:overflow-hidden
|
|
342
|
+
adm:rounded-md adm:bg-popover adm:text-popover-foreground
|
|
343
|
+
`,
|
|
341
344
|
e
|
|
342
345
|
),
|
|
343
346
|
...n
|
|
344
347
|
}
|
|
345
348
|
);
|
|
346
349
|
}
|
|
347
|
-
function
|
|
350
|
+
function st({
|
|
348
351
|
className: e,
|
|
349
352
|
...n
|
|
350
353
|
}) {
|
|
@@ -352,15 +355,22 @@ function ct({
|
|
|
352
355
|
"div",
|
|
353
356
|
{
|
|
354
357
|
"data-slot": "command-input-wrapper",
|
|
355
|
-
className:
|
|
358
|
+
className: `
|
|
359
|
+
adm:flex adm:h-9 adm:items-center adm:gap-2 adm:border-b adm:px-3
|
|
360
|
+
`,
|
|
356
361
|
children: [
|
|
357
|
-
/* @__PURE__ */ p.jsx(
|
|
362
|
+
/* @__PURE__ */ p.jsx(ze, { className: "adm:size-4 adm:shrink-0 adm:opacity-50" }),
|
|
358
363
|
/* @__PURE__ */ p.jsx(
|
|
359
|
-
|
|
364
|
+
_.Input,
|
|
360
365
|
{
|
|
361
366
|
"data-slot": "command-input",
|
|
362
367
|
className: M(
|
|
363
|
-
|
|
368
|
+
`
|
|
369
|
+
adm:flex adm:h-10 adm:w-full adm:rounded-md adm:bg-transparent
|
|
370
|
+
adm:py-3 adm:text-sm adm:outline-hidden
|
|
371
|
+
adm:placeholder:text-muted-foreground
|
|
372
|
+
adm:disabled:cursor-not-allowed adm:disabled:opacity-50
|
|
373
|
+
`,
|
|
364
374
|
e
|
|
365
375
|
),
|
|
366
376
|
...n
|
|
@@ -370,28 +380,31 @@ function ct({
|
|
|
370
380
|
}
|
|
371
381
|
);
|
|
372
382
|
}
|
|
373
|
-
function
|
|
383
|
+
function mt({
|
|
374
384
|
className: e,
|
|
375
385
|
...n
|
|
376
386
|
}) {
|
|
377
387
|
return /* @__PURE__ */ p.jsx(
|
|
378
|
-
|
|
388
|
+
_.List,
|
|
379
389
|
{
|
|
380
390
|
"data-slot": "command-list",
|
|
381
391
|
className: M(
|
|
382
|
-
|
|
392
|
+
`
|
|
393
|
+
adm:max-h-[300px] adm:scroll-py-1 adm:overflow-x-hidden
|
|
394
|
+
adm:overflow-y-auto
|
|
395
|
+
`,
|
|
383
396
|
e
|
|
384
397
|
),
|
|
385
398
|
...n
|
|
386
399
|
}
|
|
387
400
|
);
|
|
388
401
|
}
|
|
389
|
-
function
|
|
402
|
+
function ft({
|
|
390
403
|
className: e,
|
|
391
404
|
...n
|
|
392
405
|
}) {
|
|
393
406
|
return /* @__PURE__ */ p.jsx(
|
|
394
|
-
|
|
407
|
+
_.Empty,
|
|
395
408
|
{
|
|
396
409
|
"data-slot": "command-empty",
|
|
397
410
|
className: M("adm:py-6 adm:text-center adm:text-sm", e),
|
|
@@ -399,160 +412,196 @@ function mt({
|
|
|
399
412
|
}
|
|
400
413
|
);
|
|
401
414
|
}
|
|
402
|
-
function
|
|
415
|
+
function pt({
|
|
403
416
|
className: e,
|
|
404
417
|
...n
|
|
405
418
|
}) {
|
|
406
419
|
return /* @__PURE__ */ p.jsx(
|
|
407
|
-
|
|
420
|
+
_.Group,
|
|
408
421
|
{
|
|
409
422
|
"data-slot": "command-group",
|
|
410
423
|
className: M(
|
|
411
|
-
|
|
424
|
+
`
|
|
425
|
+
adm:overflow-hidden adm:p-1 adm:text-foreground
|
|
426
|
+
adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:px-2
|
|
427
|
+
adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:py-1.5
|
|
428
|
+
adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-xs
|
|
429
|
+
adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:font-medium
|
|
430
|
+
adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-muted-foreground
|
|
431
|
+
`,
|
|
412
432
|
e
|
|
413
433
|
),
|
|
414
434
|
...n
|
|
415
435
|
}
|
|
416
436
|
);
|
|
417
437
|
}
|
|
418
|
-
function
|
|
438
|
+
function ht({
|
|
419
439
|
className: e,
|
|
420
440
|
...n
|
|
421
441
|
}) {
|
|
422
442
|
return /* @__PURE__ */ p.jsx(
|
|
423
|
-
|
|
443
|
+
_.Item,
|
|
424
444
|
{
|
|
425
445
|
"data-slot": "command-item",
|
|
426
446
|
className: M(
|
|
427
|
-
|
|
447
|
+
`
|
|
448
|
+
adm:relative adm:flex adm:cursor-default adm:items-center adm:gap-2
|
|
449
|
+
adm:rounded-sm adm:px-2 adm:py-1.5 adm:text-sm adm:outline-hidden
|
|
450
|
+
adm:select-none
|
|
451
|
+
adm:data-[disabled=true]:pointer-events-none
|
|
452
|
+
adm:data-[disabled=true]:opacity-50
|
|
453
|
+
adm:data-[selected=true]:bg-accent
|
|
454
|
+
adm:data-[selected=true]:text-accent-foreground
|
|
455
|
+
adm:[&_svg]:pointer-events-none adm:[&_svg]:shrink-0
|
|
456
|
+
adm:[&_svg:not([class*=size-])]:size-4
|
|
457
|
+
adm:[&_svg:not([class*=text-])]:text-muted-foreground
|
|
458
|
+
`,
|
|
428
459
|
e
|
|
429
460
|
),
|
|
430
461
|
...n
|
|
431
462
|
}
|
|
432
463
|
);
|
|
433
464
|
}
|
|
434
|
-
function
|
|
465
|
+
function At({
|
|
435
466
|
searchable: e,
|
|
436
467
|
multiple: n,
|
|
437
468
|
icon: r,
|
|
438
469
|
value: h,
|
|
439
470
|
onValueChange: o,
|
|
440
|
-
labels:
|
|
471
|
+
labels: c,
|
|
441
472
|
options: m,
|
|
442
473
|
classNames: s,
|
|
443
|
-
selectedFeedback:
|
|
474
|
+
selectedFeedback: x = "checkbox",
|
|
444
475
|
alwaysShowPlaceholder: i = !1,
|
|
445
|
-
valuePosition:
|
|
446
|
-
renders:
|
|
476
|
+
valuePosition: g = "right",
|
|
477
|
+
renders: u
|
|
447
478
|
}) {
|
|
448
|
-
const [S,
|
|
479
|
+
const j = Ie(null), [S, R] = fe(!1), [G, L] = fe(n ? [] : ""), y = h !== void 0 ? h : G, A = { ...{
|
|
449
480
|
placeholder: "Select options...",
|
|
450
481
|
searchPlaceholder: "Search options...",
|
|
451
482
|
noItemsFound: "No options found.",
|
|
452
483
|
multipleSelected: (f) => `${f} options selected`
|
|
453
|
-
}, ...
|
|
454
|
-
o ? o(f) :
|
|
455
|
-
},
|
|
484
|
+
}, ...c }, K = (f) => {
|
|
485
|
+
o ? o(f) : L(f);
|
|
486
|
+
}, N = () => n && Array.isArray(y) ? y.length === 0 ? null : y.length === 1 ? m.find((f) => f.value === y[0])?.label : A.multipleSelected?.(y.length) || `${y.length} options selected` : !n && typeof y == "string" && y ? m.find((f) => f.value === y)?.label : null, k = () => n && Array.isArray(y) ? y.length > 0 : typeof y == "string" && y !== "", E = (f) => n && Array.isArray(y) ? y.includes(f) : y === f, U = (f) => {
|
|
456
487
|
if (n) {
|
|
457
|
-
const
|
|
458
|
-
|
|
488
|
+
const $ = Array.isArray(y) ? y : [], t = $.includes(f) ? $.filter((d) => d !== f) : [...$, f];
|
|
489
|
+
K(t);
|
|
459
490
|
} else
|
|
460
|
-
|
|
461
|
-
},
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
option:
|
|
465
|
-
isSelected:
|
|
466
|
-
type:
|
|
467
|
-
}) :
|
|
468
|
-
|
|
491
|
+
K(f === y ? "" : f), R(!1);
|
|
492
|
+
}, H = (f) => {
|
|
493
|
+
const $ = E(f), t = m.find((d) => d.value === f);
|
|
494
|
+
return u?.selectedFeedback ? u.selectedFeedback({
|
|
495
|
+
option: t,
|
|
496
|
+
isSelected: $,
|
|
497
|
+
type: x
|
|
498
|
+
}) : x === "check" ? /* @__PURE__ */ p.jsx(
|
|
499
|
+
"span",
|
|
469
500
|
{
|
|
470
|
-
|
|
501
|
+
className: M(`
|
|
502
|
+
adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center
|
|
503
|
+
adm:justify-center
|
|
504
|
+
`, s?.check),
|
|
505
|
+
children: $ && /* @__PURE__ */ p.jsx(Fe, { className: "adm:size-4" })
|
|
506
|
+
}
|
|
507
|
+
) : /* @__PURE__ */ p.jsx(
|
|
508
|
+
Ce,
|
|
509
|
+
{
|
|
510
|
+
checked: $,
|
|
471
511
|
className: s?.checkbox
|
|
472
512
|
}
|
|
473
513
|
);
|
|
474
|
-
},
|
|
514
|
+
}, T = () => u?.placeholder ? u.placeholder({
|
|
475
515
|
text: A.placeholder || "",
|
|
476
|
-
hasValue:
|
|
477
|
-
}) : /* @__PURE__ */ p.jsx("span", { className: "adm:opacity-70", children: A.placeholder }), O = () =>
|
|
478
|
-
text:
|
|
479
|
-
value:
|
|
480
|
-
}) : /* @__PURE__ */ p.jsx("span", { children:
|
|
516
|
+
hasValue: k()
|
|
517
|
+
}) : /* @__PURE__ */ p.jsx("span", { className: "adm:opacity-70", children: A.placeholder }), O = () => u?.displayValue ? u.displayValue({
|
|
518
|
+
text: N() ?? null,
|
|
519
|
+
value: y
|
|
520
|
+
}) : /* @__PURE__ */ p.jsx("span", { children: N() }), J = () => i ? /* @__PURE__ */ p.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
481
521
|
r && /* @__PURE__ */ p.jsx(r, { className: "adm:opacity-50" }),
|
|
482
|
-
|
|
483
|
-
|
|
522
|
+
T(),
|
|
523
|
+
k() && g === "left" && O()
|
|
484
524
|
] }) : /* @__PURE__ */ p.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
485
525
|
r && /* @__PURE__ */ p.jsx(r, { className: "adm:opacity-50" }),
|
|
486
|
-
|
|
487
|
-
] }),
|
|
526
|
+
k() ? O() : T()
|
|
527
|
+
] }), X = () => u?.triggerIcon ? u.triggerIcon({
|
|
488
528
|
open: S
|
|
489
|
-
}) : /* @__PURE__ */ p.jsx(
|
|
529
|
+
}) : /* @__PURE__ */ p.jsx(Oe, { className: "adm:size-4 adm:opacity-50" }), D = () => i && k() && g === "right" ? /* @__PURE__ */ p.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
490
530
|
O(),
|
|
491
|
-
|
|
492
|
-
] }) : /* @__PURE__ */ p.jsx("span", { className: "adm:flex adm:items-center adm:gap-2", children:
|
|
531
|
+
X()
|
|
532
|
+
] }) : /* @__PURE__ */ p.jsx("span", { className: "adm:flex adm:items-center adm:gap-2", children: X() }), V = () => u?.trigger ? u.trigger({
|
|
493
533
|
open: S,
|
|
494
|
-
value:
|
|
495
|
-
displayText:
|
|
534
|
+
value: y,
|
|
535
|
+
displayText: N() ?? null,
|
|
496
536
|
placeholder: A.placeholder || "",
|
|
497
|
-
hasValue:
|
|
537
|
+
hasValue: k(),
|
|
498
538
|
icon: r
|
|
499
539
|
}) : /* @__PURE__ */ p.jsxs(
|
|
500
540
|
je,
|
|
501
541
|
{
|
|
542
|
+
ref: j,
|
|
502
543
|
variant: "outline",
|
|
503
544
|
role: "combobox",
|
|
504
545
|
"aria-expanded": S,
|
|
505
546
|
className: M("adm:justify-between adm:font-normal", s?.trigger),
|
|
506
547
|
children: [
|
|
507
|
-
|
|
508
|
-
|
|
548
|
+
J(),
|
|
549
|
+
D()
|
|
509
550
|
]
|
|
510
551
|
}
|
|
511
|
-
),
|
|
552
|
+
), Y = () => e ? u?.searchInput ? u.searchInput({
|
|
512
553
|
placeholder: A.searchPlaceholder || ""
|
|
513
554
|
}) : /* @__PURE__ */ p.jsx(
|
|
514
|
-
|
|
555
|
+
st,
|
|
515
556
|
{
|
|
516
557
|
placeholder: A.searchPlaceholder,
|
|
517
558
|
className: s?.input
|
|
518
559
|
}
|
|
519
|
-
) : null, Q = () =>
|
|
560
|
+
) : null, Q = () => u?.empty ? u.empty({
|
|
520
561
|
text: A.noItemsFound || ""
|
|
521
|
-
}) : /* @__PURE__ */ p.jsx(p.Fragment, { children: A.noItemsFound }),
|
|
562
|
+
}) : /* @__PURE__ */ p.jsx(p.Fragment, { children: A.noItemsFound }), ne = (f) => u?.optionLabel ? u.optionLabel({
|
|
522
563
|
option: f
|
|
523
|
-
}) : /* @__PURE__ */ p.jsx(p.Fragment, { children: f.label }), ae = (f) =>
|
|
564
|
+
}) : /* @__PURE__ */ p.jsx(p.Fragment, { children: f.label }), ae = (f) => u?.option ? /* @__PURE__ */ p.jsx("div", { children: u.option({
|
|
524
565
|
option: f,
|
|
525
|
-
isSelected:
|
|
526
|
-
selectedFeedback:
|
|
566
|
+
isSelected: E(f.value),
|
|
567
|
+
selectedFeedback: x
|
|
527
568
|
}) }, f.value) : /* @__PURE__ */ p.jsxs(
|
|
528
|
-
|
|
569
|
+
ht,
|
|
529
570
|
{
|
|
530
571
|
value: f.value,
|
|
531
|
-
onSelect:
|
|
572
|
+
onSelect: U,
|
|
532
573
|
disabled: f.disabled,
|
|
533
574
|
className: M(
|
|
534
575
|
s?.item,
|
|
535
|
-
|
|
576
|
+
x === "check" && "adm:pr-8"
|
|
536
577
|
),
|
|
537
578
|
children: [
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
579
|
+
x === "checkbox" && H(f.value),
|
|
580
|
+
ne(f),
|
|
581
|
+
x === "check" && H(f.value)
|
|
541
582
|
]
|
|
542
583
|
},
|
|
543
584
|
f.value
|
|
544
585
|
);
|
|
545
|
-
return /* @__PURE__ */ p.jsxs(
|
|
546
|
-
/* @__PURE__ */ p.jsx(
|
|
547
|
-
/* @__PURE__ */ p.jsx(
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
586
|
+
return /* @__PURE__ */ p.jsxs(Le, { open: S, onOpenChange: R, children: [
|
|
587
|
+
/* @__PURE__ */ p.jsx(De, { asChild: !0, children: V() }),
|
|
588
|
+
/* @__PURE__ */ p.jsx(
|
|
589
|
+
Pe,
|
|
590
|
+
{
|
|
591
|
+
align: "start",
|
|
592
|
+
className: M("adm:p-0", s?.popover),
|
|
593
|
+
style: { minWidth: j.current?.offsetWidth },
|
|
594
|
+
children: /* @__PURE__ */ p.jsxs(ct, { className: s?.command, children: [
|
|
595
|
+
Y(),
|
|
596
|
+
/* @__PURE__ */ p.jsxs(mt, { className: s?.list, children: [
|
|
597
|
+
/* @__PURE__ */ p.jsx(ft, { className: s?.empty, children: Q() }),
|
|
598
|
+
/* @__PURE__ */ p.jsx(pt, { className: s?.group, children: m.map((f) => ae(f)) })
|
|
599
|
+
] })
|
|
600
|
+
] })
|
|
601
|
+
}
|
|
602
|
+
)
|
|
554
603
|
] });
|
|
555
604
|
}
|
|
556
605
|
export {
|
|
557
|
-
|
|
606
|
+
At as Combobox
|
|
558
607
|
};
|