@adamosuiteservices/ui 1.0.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 +1 -0
- package/dist/accordion-rounded.cjs +6 -0
- package/dist/accordion-rounded.js +85 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.js +65 -0
- package/dist/alert.cjs +1 -0
- package/dist/alert.js +69 -0
- package/dist/avatar.cjs +17 -0
- package/dist/avatar.js +248 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.js +54 -0
- package/dist/button-BFK0LYE1.js +58 -0
- package/dist/button-BnuVhhWO.cjs +1 -0
- package/dist/button-group.cjs +1 -0
- package/dist/button-group.js +76 -0
- package/dist/button.cjs +1 -0
- package/dist/button.js +5 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.js +2852 -0
- package/dist/card.cjs +1 -0
- package/dist/card.js +112 -0
- package/dist/check-CLxNVljQ.cjs +6 -0
- package/dist/check-Ci0GjV-B.js +11 -0
- package/dist/checkbox-BlfeC4MI.js +271 -0
- package/dist/checkbox-uByYIkZe.cjs +1 -0
- package/dist/checkbox.cjs +1 -0
- package/dist/checkbox.js +4 -0
- package/dist/chevron-down-BqEHzml5.cjs +6 -0
- package/dist/chevron-down-CpVS2Z7w.js +11 -0
- package/dist/chevron-left-B8QsBNvc.cjs +6 -0
- package/dist/chevron-left-Eal-WYLp.js +11 -0
- package/dist/chevron-right-BpzggHsr.cjs +6 -0
- package/dist/chevron-right-Cnc2tB4-.js +11 -0
- package/dist/circle-CX7JIirj.cjs +6 -0
- package/dist/circle-DYv-7Qb9.js +11 -0
- package/dist/collapsible.cjs +1 -0
- package/dist/collapsible.js +34 -0
- package/dist/colors.css +1 -0
- package/dist/combobox.cjs +6 -0
- package/dist/combobox.js +515 -0
- package/dist/components/layout/sidebar/index.d.ts +1 -0
- package/dist/components/layout/sidebar/sidebar.d.ts +17 -0
- package/dist/components/layout/sidebar/sidebar.stories.d.ts +6 -0
- package/dist/components/layout/toaster/index.d.ts +2 -0
- package/dist/components/layout/toaster/toaster.d.ts +26 -0
- package/dist/components/layout/toaster/toaster.stories.d.ts +15 -0
- package/dist/components/layout/toaster/use-toast.d.ts +1 -0
- package/dist/components/ui/accordion/accordion.d.ts +7 -0
- package/dist/components/ui/accordion/accordion.stories.d.ts +17 -0
- package/dist/components/ui/accordion/index.d.ts +1 -0
- package/dist/components/ui/accordion-rounded/accordion-rounded.d.ts +11 -0
- package/dist/components/ui/accordion-rounded/accordion-rounded.stories.d.ts +21 -0
- package/dist/components/ui/accordion-rounded/index.d.ts +1 -0
- package/dist/components/ui/alert/alert.d.ts +9 -0
- package/dist/components/ui/alert/alert.stories.d.ts +24 -0
- package/dist/components/ui/alert/index.d.ts +1 -0
- package/dist/components/ui/avatar/avatar.d.ts +6 -0
- package/dist/components/ui/avatar/avatar.stories.d.ts +14 -0
- package/dist/components/ui/avatar/index.d.ts +1 -0
- package/dist/components/ui/badge/badge.d.ts +10 -0
- package/dist/components/ui/badge/badge.stories.d.ts +41 -0
- package/dist/components/ui/badge/index.d.ts +1 -0
- package/dist/components/ui/button/button.d.ts +10 -0
- package/dist/components/ui/button/button.stories.d.ts +38 -0
- package/dist/components/ui/button/index.d.ts +1 -0
- package/dist/components/ui/button-group/button-group.d.ts +11 -0
- package/dist/components/ui/button-group/button-group.stories.d.ts +19 -0
- package/dist/components/ui/button-group/index.d.ts +1 -0
- package/dist/components/ui/calendar/calendar.d.ts +8 -0
- package/dist/components/ui/calendar/calendar.stories.d.ts +27 -0
- package/dist/components/ui/calendar/index.d.ts +1 -0
- package/dist/components/ui/card/card.d.ts +13 -0
- package/dist/components/ui/card/card.stories.d.ts +18 -0
- package/dist/components/ui/card/index.d.ts +1 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox/checkbox.stories.d.ts +15 -0
- package/dist/components/ui/checkbox/index.d.ts +1 -0
- package/dist/components/ui/collapsible/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible/collapsible.stories.d.ts +12 -0
- package/dist/components/ui/collapsible/index.d.ts +1 -0
- package/dist/components/ui/combobox/combobox.d.ts +35 -0
- package/dist/components/ui/combobox/combobox.stories.d.ts +27 -0
- package/dist/components/ui/combobox/index.d.ts +1 -0
- package/dist/components/ui/command/command.d.ts +18 -0
- package/dist/components/ui/command/index.d.ts +1 -0
- package/dist/components/ui/context-menu/context-menu.d.ts +25 -0
- package/dist/components/ui/context-menu/context-menu.stories.d.ts +10 -0
- package/dist/components/ui/context-menu/index.d.ts +1 -0
- package/dist/components/ui/dialog/dialog.d.ts +17 -0
- package/dist/components/ui/dialog/dialog.stories.d.ts +13 -0
- package/dist/components/ui/dialog/index.d.ts +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.stories.d.ts +14 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
- package/dist/components/ui/field/field.d.ts +24 -0
- package/dist/components/ui/field/field.stories.d.ts +18 -0
- package/dist/components/ui/field/index.d.ts +1 -0
- package/dist/components/ui/hover-card/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card/hover-card.stories.d.ts +25 -0
- package/dist/components/ui/hover-card/index.d.ts +1 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/input/input.d.ts +3 -0
- package/dist/components/ui/input/input.stories.d.ts +23 -0
- package/dist/components/ui/input-group/Input-group.stories.d.ts +28 -0
- package/dist/components/ui/input-group/index.d.ts +1 -0
- package/dist/components/ui/input-group/input-group.d.ts +16 -0
- package/dist/components/ui/kbd/index.d.ts +1 -0
- package/dist/components/ui/kbd/kbd.d.ts +3 -0
- package/dist/components/ui/kbd/kbd.stories.d.ts +26 -0
- package/dist/components/ui/label/index.d.ts +1 -0
- package/dist/components/ui/label/label.d.ts +4 -0
- package/dist/components/ui/label/label.stories.d.ts +24 -0
- package/dist/components/ui/pagination/index.d.ts +1 -0
- package/dist/components/ui/pagination/pagination.d.ts +13 -0
- package/dist/components/ui/pagination/pagination.stories.d.ts +28 -0
- package/dist/components/ui/popover/index.d.ts +1 -0
- package/dist/components/ui/popover/popover.d.ts +7 -0
- package/dist/components/ui/popover/popover.stories.d.ts +26 -0
- package/dist/components/ui/progress/index.d.ts +1 -0
- package/dist/components/ui/progress/progress.d.ts +9 -0
- package/dist/components/ui/progress/progress.stories.d.ts +29 -0
- package/dist/components/ui/radio-group/index.d.ts +1 -0
- package/dist/components/ui/radio-group/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group/radio-group.stories.d.ts +18 -0
- package/dist/components/ui/select/index.d.ts +1 -0
- package/dist/components/ui/select/select.d.ts +15 -0
- package/dist/components/ui/select/select.stories.d.ts +19 -0
- package/dist/components/ui/separator/index.d.ts +1 -0
- package/dist/components/ui/separator/separator.d.ts +4 -0
- package/dist/components/ui/separator/separator.stories.d.ts +18 -0
- package/dist/components/ui/sheet/index.d.ts +1 -0
- package/dist/components/ui/sheet/sheet.d.ts +14 -0
- package/dist/components/ui/sheet/sheet.stories.d.ts +17 -0
- package/dist/components/ui/skeleton/index.d.ts +1 -0
- package/dist/components/ui/skeleton/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton/skeleton.stories.d.ts +22 -0
- package/dist/components/ui/slider/index.d.ts +1 -0
- package/dist/components/ui/slider/slider.d.ts +7 -0
- package/dist/components/ui/slider/slider.stories.d.ts +21 -0
- package/dist/components/ui/spinner/index.d.ts +1 -0
- package/dist/components/ui/spinner/spinner.d.ts +2 -0
- package/dist/components/ui/spinner/spinner.stories.d.ts +20 -0
- package/dist/components/ui/switch/index.d.ts +1 -0
- package/dist/components/ui/switch/switch.d.ts +4 -0
- package/dist/components/ui/switch/switch.stories.d.ts +17 -0
- package/dist/components/ui/table/index.d.ts +1 -0
- package/dist/components/ui/table/table.d.ts +10 -0
- package/dist/components/ui/table/table.stories.d.ts +11 -0
- package/dist/components/ui/tabs/index.d.ts +1 -0
- package/dist/components/ui/tabs/tabs.d.ts +7 -0
- package/dist/components/ui/tabs/tabs.stories.d.ts +16 -0
- package/dist/components/ui/tabs-underline/index.d.ts +1 -0
- package/dist/components/ui/tabs-underline/tabs-underline.d.ts +7 -0
- package/dist/components/ui/tabs-underline/tabs-underline.stories.d.ts +16 -0
- package/dist/components/ui/textarea/index.d.ts +1 -0
- package/dist/components/ui/textarea/textarea.d.ts +3 -0
- package/dist/components/ui/textarea/textarea.stories.d.ts +21 -0
- package/dist/components/ui/toggle/index.d.ts +1 -0
- package/dist/components/ui/toggle/toggle.d.ts +9 -0
- package/dist/components/ui/toggle/toggle.stories.d.ts +21 -0
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip/tooltip.stories.d.ts +19 -0
- package/dist/components/ui/typography/index.d.ts +1 -0
- package/dist/components/ui/typography/typography.d.ts +8 -0
- package/dist/components/ui/typography/typography.stories.d.ts +33 -0
- package/dist/context-menu.cjs +1 -0
- package/dist/context-menu.js +427 -0
- package/dist/createLucideIcon-B_8CJpcQ.js +94 -0
- package/dist/createLucideIcon-CAtnV-yz.cjs +21 -0
- package/dist/custom-layered-styles.css +1 -0
- package/dist/dialog.cjs +1 -0
- package/dist/dialog.js +139 -0
- package/dist/dropdown-menu.cjs +1 -0
- package/dist/dropdown-menu.js +423 -0
- package/dist/field.cjs +1 -0
- package/dist/field.js +221 -0
- package/dist/fonts.css +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-portal-container.d.ts +31 -0
- package/dist/hover-card.cjs +1 -0
- package/dist/hover-card.js +210 -0
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/index-6oTEokEx.js +82 -0
- package/dist/index-B-NyefE0.js +243 -0
- package/dist/index-B-ZRqW0J.js +118 -0
- package/dist/index-B-cHTKrs.js +158 -0
- package/dist/index-BGQepRFJ.js +27 -0
- package/dist/index-BGiGvaq8.cjs +1 -0
- package/dist/index-BKbK2GzY.cjs +1 -0
- package/dist/index-BMitW9UR.cjs +1 -0
- package/dist/index-BRLtxFFr.cjs +1 -0
- package/dist/index-BWaO7kQK.cjs +1 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-BpvjJ_T6.cjs +5 -0
- package/dist/index-C0UREtMP.js +59 -0
- package/dist/index-C329e3yQ.js +134 -0
- package/dist/index-C5wjudc-.js +36 -0
- package/dist/index-C8ni3LLa.cjs +1 -0
- package/dist/index-CAOY367Y.js +1540 -0
- package/dist/index-CCKe-Mpx.js +6 -0
- package/dist/index-CQhYMnjT.js +34 -0
- package/dist/index-Ce3QBKyj.cjs +1 -0
- package/dist/index-CezwiPd_.js +615 -0
- package/dist/index-Cv867SGx.js +13 -0
- package/dist/index-CwUFT-GQ.js +228 -0
- package/dist/index-CzY-WZXL.cjs +1 -0
- package/dist/index-D02K8KOB.js +54 -0
- package/dist/index-D3S7dBDI.cjs +1 -0
- package/dist/index-D3wSWKST.cjs +1 -0
- package/dist/index-D7hQvndv.cjs +1 -0
- package/dist/index-DQvx1rG_.cjs +1 -0
- package/dist/index-DXQ-7kNJ.cjs +41 -0
- package/dist/index-DYxWvftI.cjs +1 -0
- package/dist/index-DnS_sBBe.cjs +1 -0
- package/dist/index-DulPG3F9.js +179 -0
- package/dist/index-EUea2gfp.js +70 -0
- package/dist/index-FxyLF8MY.js +68 -0
- package/dist/index-IKJMQref.cjs +1 -0
- package/dist/index-MQ0c3ZX_.cjs +1 -0
- package/dist/index-P1sVIHE3.js +32 -0
- package/dist/index-VIUqZjyP.cjs +1 -0
- package/dist/index-WIv2ndLu.cjs +1 -0
- package/dist/index-bSPhqlcX.cjs +1 -0
- package/dist/index-cwZN7ZY3.cjs +1 -0
- package/dist/index-gO_QEiaK.cjs +1 -0
- package/dist/index-iAvn1gzj.cjs +1 -0
- package/dist/index-o0sNTcKe.js +674 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/index-yR-v1A4G.js +15 -0
- package/dist/input-3MDa_DYk.cjs +1 -0
- package/dist/input-Cl7xmQYQ.js +22 -0
- package/dist/input-group.cjs +1 -0
- package/dist/input-group.js +152 -0
- package/dist/input.cjs +1 -0
- package/dist/input.js +4 -0
- package/dist/jsx-runtime-BB_1_6y_.cjs +22 -0
- package/dist/jsx-runtime-BzflLqGi.js +282 -0
- package/dist/kbd.cjs +1 -0
- package/dist/kbd.js +31 -0
- package/dist/label-MxqN87DQ.cjs +1 -0
- package/dist/label-hg_jN6Y8.js +35 -0
- package/dist/label.cjs +1 -0
- package/dist/label.js +4 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/minus-C0pHPx21.cjs +6 -0
- package/dist/minus-DE-onYs2.js +11 -0
- package/dist/pagination.cjs +6 -0
- package/dist/pagination.js +134 -0
- package/dist/popover-BBXe2myL.cjs +1 -0
- package/dist/popover-DNiRNCdn.js +263 -0
- package/dist/popover.cjs +1 -0
- package/dist/popover.js +7 -0
- package/dist/progress.cjs +6 -0
- package/dist/progress.js +137 -0
- package/dist/radio-group.cjs +1 -0
- package/dist/radio-group.js +271 -0
- package/dist/radius.css +1 -0
- package/dist/select.cjs +6 -0
- package/dist/select.js +987 -0
- package/dist/separator-C9kqOQR-.js +44 -0
- package/dist/separator-Dbx-SVIs.cjs +1 -0
- package/dist/separator.cjs +1 -0
- package/dist/separator.js +4 -0
- package/dist/sheet-0jRbqkzj.cjs +1 -0
- package/dist/sheet-RAbg4M5A.js +128 -0
- package/dist/sheet.cjs +1 -0
- package/dist/sheet.js +11 -0
- package/dist/sidebar.cjs +6 -0
- package/dist/sidebar.js +139 -0
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.js +15 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.js +486 -0
- package/dist/space.css +1 -0
- package/dist/spinner.cjs +6 -0
- package/dist/spinner.js +24 -0
- package/dist/styles.css +1 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.js +154 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +115 -0
- package/dist/tabs-underline.cjs +1 -0
- package/dist/tabs-underline.js +68 -0
- package/dist/tabs.cjs +1 -0
- package/dist/tabs.js +68 -0
- package/dist/tailwind-animations.css +1 -0
- package/dist/tailwind-colors.css +1 -0
- package/dist/tailwind-fonts.css +1 -0
- package/dist/tailwind-radius.css +1 -0
- package/dist/tailwind-spacing.css +1 -0
- package/dist/tailwind-theme.css +1 -0
- package/dist/textarea-D76719tg.js +19 -0
- package/dist/textarea-UdELO_Jn.cjs +1 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.js +4 -0
- package/dist/themes.css +1 -0
- package/dist/toaster.cjs +1 -0
- package/dist/toaster.js +87 -0
- package/dist/toggle.cjs +1 -0
- package/dist/toggle.js +69 -0
- package/dist/tooltip.cjs +1 -0
- package/dist/tooltip.js +375 -0
- package/dist/types/theme.type.d.ts +2 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +34 -0
- package/dist/use-portal-container.cjs +1 -0
- package/dist/use-portal-container.js +21 -0
- package/dist/utils-CRiPKpXj.js +2743 -0
- package/dist/utils-DoxiiusW.cjs +1 -0
- package/dist/x-CBKgg4YL.cjs +6 -0
- package/dist/x-Dl66o_vF.js +14 -0
- package/package.json +275 -0
package/dist/combobox.js
ADDED
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
import { j as w } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { useState as fe } from "react";
|
|
4
|
+
import { c as A } from "./utils-CRiPKpXj.js";
|
|
5
|
+
import { B as Ce } from "./button-BFK0LYE1.js";
|
|
6
|
+
import { R as Ie, P as je, O as Re, a as Ae } from "./index-B-NyefE0.js";
|
|
7
|
+
import { P as N } from "./index-C5wjudc-.js";
|
|
8
|
+
import { u as O } from "./index-Cv867SGx.js";
|
|
9
|
+
import { c as G } from "./index-6oTEokEx.js";
|
|
10
|
+
import { c as $e } from "./createLucideIcon-B_8CJpcQ.js";
|
|
11
|
+
import { P as Me, a as Ne, b as Pe } from "./popover-DNiRNCdn.js";
|
|
12
|
+
import { C as De } from "./checkbox-BlfeC4MI.js";
|
|
13
|
+
import { C as Le } from "./chevron-down-CpVS2Z7w.js";
|
|
14
|
+
import { C as ze } from "./check-Ci0GjV-B.js";
|
|
15
|
+
/**
|
|
16
|
+
* @license lucide-react v0.546.0 - ISC
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the ISC license.
|
|
19
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
const Fe = [
|
|
22
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
23
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
24
|
+
], Ke = $e("search", Fe);
|
|
25
|
+
var pe = 1, Oe = 0.9, qe = 0.8, Be = 0.17, te = 0.1, re = 0.999, Ve = 0.9999, Te = 0.99, _e = /[\\\/_+.#"@\[\(\{&]/, Ge = /[\\\/_+.#"@\[\(\{&]/g, Ue = /[\s-]/, ge = /[\s-]/g;
|
|
26
|
+
function ae(e, n, r, s, o, u, d) {
|
|
27
|
+
if (u === n.length) return o === e.length ? pe : Te;
|
|
28
|
+
var m = `${o},${u}`;
|
|
29
|
+
if (d[m] !== void 0) return d[m];
|
|
30
|
+
for (var x = s.charAt(u), i = r.indexOf(x, o), h = 0, b, v, S, C; i >= 0; ) b = ae(e, n, r, s, i + 1, u + 1, d), b > h && (i === o ? b *= pe : _e.test(e.charAt(i - 1)) ? (b *= qe, S = e.slice(o, i - 1).match(Ge), S && o > 0 && (b *= Math.pow(re, S.length))) : Ue.test(e.charAt(i - 1)) ? (b *= Oe, C = e.slice(o, i - 1).match(ge), C && o > 0 && (b *= Math.pow(re, C.length))) : (b *= Be, o > 0 && (b *= Math.pow(re, i - o))), e.charAt(i) !== n.charAt(u) && (b *= Ve)), (b < te && r.charAt(i - 1) === s.charAt(u + 1) || s.charAt(u + 1) === s.charAt(u) && r.charAt(i - 1) !== s.charAt(u)) && (v = ae(e, n, r, s, i + 1, u + 2, d), v * te > b && (b = v * te)), b > h && (h = b), i = r.indexOf(x, i + 1);
|
|
31
|
+
return d[m] = h, h;
|
|
32
|
+
}
|
|
33
|
+
function ve(e) {
|
|
34
|
+
return e.toLowerCase().replace(ge, " ");
|
|
35
|
+
}
|
|
36
|
+
function He(e, n, r) {
|
|
37
|
+
return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, ae(e, n, ve(e), ve(n), 0, 0, {});
|
|
38
|
+
}
|
|
39
|
+
var _ = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', We = '[cmdk-group-heading=""]', be = '[cmdk-item=""]', he = `${be}:not([aria-disabled="true"])`, le = "cmdk-item-select", F = "data-value", Je = (e, n, r) => He(e, n, r), xe = a.createContext(void 0), U = () => a.useContext(xe), ye = a.createContext(void 0), oe = () => a.useContext(ye), ke = a.createContext(void 0), we = a.forwardRef((e, n) => {
|
|
40
|
+
let r = K(() => {
|
|
41
|
+
var t, c;
|
|
42
|
+
return { search: "", value: (c = (t = e.value) != null ? t : e.defaultValue) != null ? c : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
43
|
+
}), s = K(() => /* @__PURE__ */ new Set()), o = K(() => /* @__PURE__ */ new Map()), u = K(() => /* @__PURE__ */ new Map()), d = K(() => /* @__PURE__ */ new Set()), m = Ee(e), { label: x, children: i, value: h, onValueChange: b, filter: v, shouldFilter: S, loop: C, disablePointerSelection: D = !1, vimBindings: $ = !0, ...L } = e, B = O(), V = O(), p = O(), I = a.useRef(null), k = ot();
|
|
44
|
+
P(() => {
|
|
45
|
+
if (h !== void 0) {
|
|
46
|
+
let t = h.trim();
|
|
47
|
+
r.current.value = t, E.emit();
|
|
48
|
+
}
|
|
49
|
+
}, [h]), P(() => {
|
|
50
|
+
k(6, ie);
|
|
51
|
+
}, []);
|
|
52
|
+
let E = a.useMemo(() => ({ subscribe: (t) => (d.current.add(t), () => d.current.delete(t)), snapshot: () => r.current, setState: (t, c, f) => {
|
|
53
|
+
var l, g, y, R;
|
|
54
|
+
if (!Object.is(r.current[t], c)) {
|
|
55
|
+
if (r.current[t] = c, t === "search") Q(), X(), k(1, Y);
|
|
56
|
+
else if (t === "value") {
|
|
57
|
+
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
58
|
+
let j = document.getElementById(p);
|
|
59
|
+
j ? j.focus() : (l = document.getElementById(B)) == null || l.focus();
|
|
60
|
+
}
|
|
61
|
+
if (k(7, () => {
|
|
62
|
+
var j;
|
|
63
|
+
r.current.selectedItemId = (j = z()) == null ? void 0 : j.id, E.emit();
|
|
64
|
+
}), f || k(5, ie), ((g = m.current) == null ? void 0 : g.value) !== void 0) {
|
|
65
|
+
let j = c ?? "";
|
|
66
|
+
(R = (y = m.current).onValueChange) == null || R.call(y, j);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
E.emit();
|
|
71
|
+
}
|
|
72
|
+
}, emit: () => {
|
|
73
|
+
d.current.forEach((t) => t());
|
|
74
|
+
} }), []), J = a.useMemo(() => ({ value: (t, c, f) => {
|
|
75
|
+
var l;
|
|
76
|
+
c !== ((l = u.current.get(t)) == null ? void 0 : l.value) && (u.current.set(t, { value: c, keywords: f }), r.current.filtered.items.set(t, de(c, f)), k(2, () => {
|
|
77
|
+
X(), E.emit();
|
|
78
|
+
}));
|
|
79
|
+
}, item: (t, c) => (s.current.add(t), c && (o.current.has(c) ? o.current.get(c).add(t) : o.current.set(c, /* @__PURE__ */ new Set([t]))), k(3, () => {
|
|
80
|
+
Q(), X(), r.current.value || Y(), E.emit();
|
|
81
|
+
}), () => {
|
|
82
|
+
u.current.delete(t), s.current.delete(t), r.current.filtered.items.delete(t);
|
|
83
|
+
let f = z();
|
|
84
|
+
k(4, () => {
|
|
85
|
+
Q(), f?.getAttribute("id") === t && Y(), E.emit();
|
|
86
|
+
});
|
|
87
|
+
}), group: (t) => (o.current.has(t) || o.current.set(t, /* @__PURE__ */ new Set()), () => {
|
|
88
|
+
u.current.delete(t), o.current.delete(t);
|
|
89
|
+
}), filter: () => m.current.shouldFilter, label: x || e["aria-label"], getDisablePointerSelection: () => m.current.disablePointerSelection, listId: B, inputId: p, labelId: V, listInnerRef: I }), []);
|
|
90
|
+
function de(t, c) {
|
|
91
|
+
var f, l;
|
|
92
|
+
let g = (l = (f = m.current) == null ? void 0 : f.filter) != null ? l : Je;
|
|
93
|
+
return t ? g(t, r.current.search, c) : 0;
|
|
94
|
+
}
|
|
95
|
+
function X() {
|
|
96
|
+
if (!r.current.search || m.current.shouldFilter === !1) return;
|
|
97
|
+
let t = r.current.filtered.items, c = [];
|
|
98
|
+
r.current.filtered.groups.forEach((l) => {
|
|
99
|
+
let g = o.current.get(l), y = 0;
|
|
100
|
+
g.forEach((R) => {
|
|
101
|
+
let j = t.get(R);
|
|
102
|
+
y = Math.max(j, y);
|
|
103
|
+
}), c.push([l, y]);
|
|
104
|
+
});
|
|
105
|
+
let f = I.current;
|
|
106
|
+
T().sort((l, g) => {
|
|
107
|
+
var y, R;
|
|
108
|
+
let j = l.getAttribute("id"), H = g.getAttribute("id");
|
|
109
|
+
return ((y = t.get(H)) != null ? y : 0) - ((R = t.get(j)) != null ? R : 0);
|
|
110
|
+
}).forEach((l) => {
|
|
111
|
+
let g = l.closest(ne);
|
|
112
|
+
g ? g.appendChild(l.parentElement === g ? l : l.closest(`${ne} > *`)) : f.appendChild(l.parentElement === f ? l : l.closest(`${ne} > *`));
|
|
113
|
+
}), c.sort((l, g) => g[1] - l[1]).forEach((l) => {
|
|
114
|
+
var g;
|
|
115
|
+
let y = (g = I.current) == null ? void 0 : g.querySelector(`${_}[${F}="${encodeURIComponent(l[0])}"]`);
|
|
116
|
+
y?.parentElement.appendChild(y);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function Y() {
|
|
120
|
+
let t = T().find((f) => f.getAttribute("aria-disabled") !== "true"), c = t?.getAttribute(F);
|
|
121
|
+
E.setState("value", c || void 0);
|
|
122
|
+
}
|
|
123
|
+
function Q() {
|
|
124
|
+
var t, c, f, l;
|
|
125
|
+
if (!r.current.search || m.current.shouldFilter === !1) {
|
|
126
|
+
r.current.filtered.count = s.current.size;
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
r.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
130
|
+
let g = 0;
|
|
131
|
+
for (let y of s.current) {
|
|
132
|
+
let R = (c = (t = u.current.get(y)) == null ? void 0 : t.value) != null ? c : "", j = (l = (f = u.current.get(y)) == null ? void 0 : f.keywords) != null ? l : [], H = de(R, j);
|
|
133
|
+
r.current.filtered.items.set(y, H), H > 0 && g++;
|
|
134
|
+
}
|
|
135
|
+
for (let [y, R] of o.current) for (let j of R) if (r.current.filtered.items.get(j) > 0) {
|
|
136
|
+
r.current.filtered.groups.add(y);
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
r.current.filtered.count = g;
|
|
140
|
+
}
|
|
141
|
+
function ie() {
|
|
142
|
+
var t, c, f;
|
|
143
|
+
let l = z();
|
|
144
|
+
l && (((t = l.parentElement) == null ? void 0 : t.firstChild) === l && ((f = (c = l.closest(_)) == null ? void 0 : c.querySelector(We)) == null || f.scrollIntoView({ block: "nearest" })), l.scrollIntoView({ block: "nearest" }));
|
|
145
|
+
}
|
|
146
|
+
function z() {
|
|
147
|
+
var t;
|
|
148
|
+
return (t = I.current) == null ? void 0 : t.querySelector(`${be}[aria-selected="true"]`);
|
|
149
|
+
}
|
|
150
|
+
function T() {
|
|
151
|
+
var t;
|
|
152
|
+
return Array.from(((t = I.current) == null ? void 0 : t.querySelectorAll(he)) || []);
|
|
153
|
+
}
|
|
154
|
+
function Z(t) {
|
|
155
|
+
let c = T()[t];
|
|
156
|
+
c && E.setState("value", c.getAttribute(F));
|
|
157
|
+
}
|
|
158
|
+
function ee(t) {
|
|
159
|
+
var c;
|
|
160
|
+
let f = z(), l = T(), g = l.findIndex((R) => R === f), y = l[g + t];
|
|
161
|
+
(c = m.current) != null && c.loop && (y = g + t < 0 ? l[l.length - 1] : g + t === l.length ? l[0] : l[g + t]), y && E.setState("value", y.getAttribute(F));
|
|
162
|
+
}
|
|
163
|
+
function ue(t) {
|
|
164
|
+
let c = z(), f = c?.closest(_), l;
|
|
165
|
+
for (; f && !l; ) f = t > 0 ? at(f, _) : lt(f, _), l = f?.querySelector(he);
|
|
166
|
+
l ? E.setState("value", l.getAttribute(F)) : ee(t);
|
|
167
|
+
}
|
|
168
|
+
let ce = () => Z(T().length - 1), se = (t) => {
|
|
169
|
+
t.preventDefault(), t.metaKey ? ce() : t.altKey ? ue(1) : ee(1);
|
|
170
|
+
}, me = (t) => {
|
|
171
|
+
t.preventDefault(), t.metaKey ? Z(0) : t.altKey ? ue(-1) : ee(-1);
|
|
172
|
+
};
|
|
173
|
+
return a.createElement(N.div, { ref: n, tabIndex: -1, ...L, "cmdk-root": "", onKeyDown: (t) => {
|
|
174
|
+
var c;
|
|
175
|
+
(c = L.onKeyDown) == null || c.call(L, t);
|
|
176
|
+
let f = t.nativeEvent.isComposing || t.keyCode === 229;
|
|
177
|
+
if (!(t.defaultPrevented || f)) switch (t.key) {
|
|
178
|
+
case "n":
|
|
179
|
+
case "j": {
|
|
180
|
+
$ && t.ctrlKey && se(t);
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
case "ArrowDown": {
|
|
184
|
+
se(t);
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
case "p":
|
|
188
|
+
case "k": {
|
|
189
|
+
$ && t.ctrlKey && me(t);
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
case "ArrowUp": {
|
|
193
|
+
me(t);
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
case "Home": {
|
|
197
|
+
t.preventDefault(), Z(0);
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
case "End": {
|
|
201
|
+
t.preventDefault(), ce();
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
case "Enter": {
|
|
205
|
+
t.preventDefault();
|
|
206
|
+
let l = z();
|
|
207
|
+
if (l) {
|
|
208
|
+
let g = new Event(le);
|
|
209
|
+
l.dispatchEvent(g);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
} }, a.createElement("label", { "cmdk-label": "", htmlFor: J.inputId, id: J.labelId, style: it }, x), W(e, (t) => a.createElement(ye.Provider, { value: E }, a.createElement(xe.Provider, { value: J }, t))));
|
|
214
|
+
}), Xe = a.forwardRef((e, n) => {
|
|
215
|
+
var r, s;
|
|
216
|
+
let o = O(), u = a.useRef(null), d = a.useContext(ke), m = U(), x = Ee(e), i = (s = (r = x.current) == null ? void 0 : r.forceMount) != null ? s : d?.forceMount;
|
|
217
|
+
P(() => {
|
|
218
|
+
if (!i) return m.item(o, d?.id);
|
|
219
|
+
}, [i]);
|
|
220
|
+
let h = Se(o, u, [e.value, e.children, u], e.keywords), b = oe(), v = M((k) => k.value && k.value === h.current), S = M((k) => i || m.filter() === !1 ? !0 : k.search ? k.filtered.items.get(o) > 0 : !0);
|
|
221
|
+
a.useEffect(() => {
|
|
222
|
+
let k = u.current;
|
|
223
|
+
if (!(!k || e.disabled)) return k.addEventListener(le, C), () => k.removeEventListener(le, C);
|
|
224
|
+
}, [S, e.onSelect, e.disabled]);
|
|
225
|
+
function C() {
|
|
226
|
+
var k, E;
|
|
227
|
+
D(), (E = (k = x.current).onSelect) == null || E.call(k, h.current);
|
|
228
|
+
}
|
|
229
|
+
function D() {
|
|
230
|
+
b.setState("value", h.current, !0);
|
|
231
|
+
}
|
|
232
|
+
if (!S) return null;
|
|
233
|
+
let { disabled: $, value: L, onSelect: B, forceMount: V, keywords: p, ...I } = e;
|
|
234
|
+
return a.createElement(N.div, { ref: G(u, n), ...I, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!$, "aria-selected": !!v, "data-disabled": !!$, "data-selected": !!v, onPointerMove: $ || m.getDisablePointerSelection() ? void 0 : D, onClick: $ ? void 0 : C }, e.children);
|
|
235
|
+
}), Ye = a.forwardRef((e, n) => {
|
|
236
|
+
let { heading: r, children: s, forceMount: o, ...u } = e, d = O(), m = a.useRef(null), x = a.useRef(null), i = O(), h = U(), b = M((S) => o || h.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(d) : !0);
|
|
237
|
+
P(() => h.group(d), []), Se(d, m, [e.value, e.heading, x]);
|
|
238
|
+
let v = a.useMemo(() => ({ id: d, forceMount: o }), [o]);
|
|
239
|
+
return a.createElement(N.div, { ref: G(m, n), ...u, "cmdk-group": "", role: "presentation", hidden: b ? void 0 : !0 }, r && a.createElement("div", { ref: x, "cmdk-group-heading": "", "aria-hidden": !0, id: i }, r), W(e, (S) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? i : void 0 }, a.createElement(ke.Provider, { value: v }, S))));
|
|
240
|
+
}), Qe = a.forwardRef((e, n) => {
|
|
241
|
+
let { alwaysRender: r, ...s } = e, o = a.useRef(null), u = M((d) => !d.search);
|
|
242
|
+
return !r && !u ? null : a.createElement(N.div, { ref: G(o, n), ...s, "cmdk-separator": "", role: "separator" });
|
|
243
|
+
}), Ze = a.forwardRef((e, n) => {
|
|
244
|
+
let { onValueChange: r, ...s } = e, o = e.value != null, u = oe(), d = M((i) => i.search), m = M((i) => i.selectedItemId), x = U();
|
|
245
|
+
return a.useEffect(() => {
|
|
246
|
+
e.value != null && u.setState("search", e.value);
|
|
247
|
+
}, [e.value]), a.createElement(N.input, { ref: n, ...s, "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": m, id: x.inputId, type: "text", value: o ? e.value : d, onChange: (i) => {
|
|
248
|
+
o || u.setState("search", i.target.value), r?.(i.target.value);
|
|
249
|
+
} });
|
|
250
|
+
}), et = a.forwardRef((e, n) => {
|
|
251
|
+
let { children: r, label: s = "Suggestions", ...o } = e, u = a.useRef(null), d = a.useRef(null), m = M((i) => i.selectedItemId), x = U();
|
|
252
|
+
return a.useEffect(() => {
|
|
253
|
+
if (d.current && u.current) {
|
|
254
|
+
let i = d.current, h = u.current, b, v = new ResizeObserver(() => {
|
|
255
|
+
b = requestAnimationFrame(() => {
|
|
256
|
+
let S = i.offsetHeight;
|
|
257
|
+
h.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
return v.observe(i), () => {
|
|
261
|
+
cancelAnimationFrame(b), v.unobserve(i);
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
}, []), a.createElement(N.div, { ref: G(u, n), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": m, "aria-label": s, id: x.listId }, W(e, (i) => a.createElement("div", { ref: G(d, x.listInnerRef), "cmdk-list-sizer": "" }, i)));
|
|
265
|
+
}), tt = a.forwardRef((e, n) => {
|
|
266
|
+
let { open: r, onOpenChange: s, overlayClassName: o, contentClassName: u, container: d, ...m } = e;
|
|
267
|
+
return a.createElement(Ie, { open: r, onOpenChange: s }, a.createElement(je, { container: d }, a.createElement(Re, { "cmdk-overlay": "", className: o }), a.createElement(Ae, { "aria-label": e.label, "cmdk-dialog": "", className: u }, a.createElement(we, { ref: n, ...m }))));
|
|
268
|
+
}), rt = a.forwardRef((e, n) => M((r) => r.filtered.count === 0) ? a.createElement(N.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), nt = a.forwardRef((e, n) => {
|
|
269
|
+
let { progress: r, children: s, label: o = "Loading...", ...u } = e;
|
|
270
|
+
return a.createElement(N.div, { ref: n, ...u, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, W(e, (d) => a.createElement("div", { "aria-hidden": !0 }, d)));
|
|
271
|
+
}), q = Object.assign(we, { List: et, Item: Xe, Input: Ze, Group: Ye, Separator: Qe, Dialog: tt, Empty: rt, Loading: nt });
|
|
272
|
+
function at(e, n) {
|
|
273
|
+
let r = e.nextElementSibling;
|
|
274
|
+
for (; r; ) {
|
|
275
|
+
if (r.matches(n)) return r;
|
|
276
|
+
r = r.nextElementSibling;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function lt(e, n) {
|
|
280
|
+
let r = e.previousElementSibling;
|
|
281
|
+
for (; r; ) {
|
|
282
|
+
if (r.matches(n)) return r;
|
|
283
|
+
r = r.previousElementSibling;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function Ee(e) {
|
|
287
|
+
let n = a.useRef(e);
|
|
288
|
+
return P(() => {
|
|
289
|
+
n.current = e;
|
|
290
|
+
}), n;
|
|
291
|
+
}
|
|
292
|
+
var P = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
|
|
293
|
+
function K(e) {
|
|
294
|
+
let n = a.useRef();
|
|
295
|
+
return n.current === void 0 && (n.current = e()), n;
|
|
296
|
+
}
|
|
297
|
+
function M(e) {
|
|
298
|
+
let n = oe(), r = () => e(n.snapshot());
|
|
299
|
+
return a.useSyncExternalStore(n.subscribe, r, r);
|
|
300
|
+
}
|
|
301
|
+
function Se(e, n, r, s = []) {
|
|
302
|
+
let o = a.useRef(), u = U();
|
|
303
|
+
return P(() => {
|
|
304
|
+
var d;
|
|
305
|
+
let m = (() => {
|
|
306
|
+
var i;
|
|
307
|
+
for (let h of r) {
|
|
308
|
+
if (typeof h == "string") return h.trim();
|
|
309
|
+
if (typeof h == "object" && "current" in h) return h.current ? (i = h.current.textContent) == null ? void 0 : i.trim() : o.current;
|
|
310
|
+
}
|
|
311
|
+
})(), x = s.map((i) => i.trim());
|
|
312
|
+
u.value(e, m, x), (d = n.current) == null || d.setAttribute(F, m), o.current = m;
|
|
313
|
+
}), o;
|
|
314
|
+
}
|
|
315
|
+
var ot = () => {
|
|
316
|
+
let [e, n] = a.useState(), r = K(() => /* @__PURE__ */ new Map());
|
|
317
|
+
return P(() => {
|
|
318
|
+
r.current.forEach((s) => s()), r.current = /* @__PURE__ */ new Map();
|
|
319
|
+
}, [e]), (s, o) => {
|
|
320
|
+
r.current.set(s, o), n({});
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
function dt(e) {
|
|
324
|
+
let n = e.type;
|
|
325
|
+
return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
|
|
326
|
+
}
|
|
327
|
+
function W({ asChild: e, children: n }, r) {
|
|
328
|
+
return e && a.isValidElement(n) ? a.cloneElement(dt(n), { ref: n.ref }, r(n.props.children)) : r(n);
|
|
329
|
+
}
|
|
330
|
+
var it = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
331
|
+
function ut({
|
|
332
|
+
className: e,
|
|
333
|
+
...n
|
|
334
|
+
}) {
|
|
335
|
+
return /* @__PURE__ */ w.jsx(
|
|
336
|
+
q,
|
|
337
|
+
{
|
|
338
|
+
"data-slot": "command",
|
|
339
|
+
className: A(
|
|
340
|
+
"adm:bg-popover adm:text-popover-foreground adm:flex adm:h-full adm:w-full adm:flex-col adm:overflow-hidden adm:rounded-md",
|
|
341
|
+
e
|
|
342
|
+
),
|
|
343
|
+
...n
|
|
344
|
+
}
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
function ct({
|
|
348
|
+
className: e,
|
|
349
|
+
...n
|
|
350
|
+
}) {
|
|
351
|
+
return /* @__PURE__ */ w.jsxs(
|
|
352
|
+
"div",
|
|
353
|
+
{
|
|
354
|
+
"data-slot": "command-input-wrapper",
|
|
355
|
+
className: "adm:flex adm:h-9 adm:items-center adm:gap-2 adm:border-b adm:px-3",
|
|
356
|
+
children: [
|
|
357
|
+
/* @__PURE__ */ w.jsx(Ke, { className: "adm:size-4 adm:shrink-0 adm:opacity-50" }),
|
|
358
|
+
/* @__PURE__ */ w.jsx(
|
|
359
|
+
q.Input,
|
|
360
|
+
{
|
|
361
|
+
"data-slot": "command-input",
|
|
362
|
+
className: A(
|
|
363
|
+
"adm:placeholder:text-muted-foreground adm:flex adm:h-10 adm:w-full adm:rounded-md adm:bg-transparent adm:py-3 adm:text-sm adm:outline-hidden adm:disabled:cursor-not-allowed adm:disabled:opacity-50",
|
|
364
|
+
e
|
|
365
|
+
),
|
|
366
|
+
...n
|
|
367
|
+
}
|
|
368
|
+
)
|
|
369
|
+
]
|
|
370
|
+
}
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
function st({
|
|
374
|
+
className: e,
|
|
375
|
+
...n
|
|
376
|
+
}) {
|
|
377
|
+
return /* @__PURE__ */ w.jsx(
|
|
378
|
+
q.List,
|
|
379
|
+
{
|
|
380
|
+
"data-slot": "command-list",
|
|
381
|
+
className: A(
|
|
382
|
+
"adm:max-h-[300px] adm:scroll-py-1 adm:overflow-x-hidden adm:overflow-y-auto",
|
|
383
|
+
e
|
|
384
|
+
),
|
|
385
|
+
...n
|
|
386
|
+
}
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
function mt({
|
|
390
|
+
className: e,
|
|
391
|
+
...n
|
|
392
|
+
}) {
|
|
393
|
+
return /* @__PURE__ */ w.jsx(
|
|
394
|
+
q.Empty,
|
|
395
|
+
{
|
|
396
|
+
"data-slot": "command-empty",
|
|
397
|
+
className: A("adm:py-6 adm:text-center adm:text-sm", e),
|
|
398
|
+
...n
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
function ft({
|
|
403
|
+
className: e,
|
|
404
|
+
...n
|
|
405
|
+
}) {
|
|
406
|
+
return /* @__PURE__ */ w.jsx(
|
|
407
|
+
q.Group,
|
|
408
|
+
{
|
|
409
|
+
"data-slot": "command-group",
|
|
410
|
+
className: A(
|
|
411
|
+
"adm:text-foreground adm:overflow-hidden adm:p-1 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-muted-foreground adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:px-2 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:py-1.5 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-xs adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:font-medium",
|
|
412
|
+
e
|
|
413
|
+
),
|
|
414
|
+
...n
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
function pt({
|
|
419
|
+
className: e,
|
|
420
|
+
...n
|
|
421
|
+
}) {
|
|
422
|
+
return /* @__PURE__ */ w.jsx(
|
|
423
|
+
q.Item,
|
|
424
|
+
{
|
|
425
|
+
"data-slot": "command-item",
|
|
426
|
+
className: A(
|
|
427
|
+
"adm:data-[selected=true]:bg-accent adm:data-[selected=true]:text-accent-foreground adm:[&_svg:not([class*=text-])]:text-muted-foreground adm:relative adm:flex adm:cursor-default adm:items-center adm:gap-2 adm:rounded-sm adm:px-2 adm:py-1.5 adm:text-sm adm:outline-hidden adm:select-none adm:data-[disabled=true]:pointer-events-none adm:data-[disabled=true]:opacity-50 adm:[&_svg]:pointer-events-none adm:[&_svg]:shrink-0 adm:[&_svg:not([class*=size-])]:size-4",
|
|
428
|
+
e
|
|
429
|
+
),
|
|
430
|
+
...n
|
|
431
|
+
}
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
function Rt({
|
|
435
|
+
searchable: e,
|
|
436
|
+
multiple: n,
|
|
437
|
+
value: r,
|
|
438
|
+
onValueChange: s,
|
|
439
|
+
labels: o,
|
|
440
|
+
options: u,
|
|
441
|
+
classNames: d,
|
|
442
|
+
selectedFeedback: m = "checkbox"
|
|
443
|
+
}) {
|
|
444
|
+
const [x, i] = fe(!1), [h, b] = fe(n ? [] : ""), v = r !== void 0 ? r : h, C = { ...{
|
|
445
|
+
placeholder: "Select options...",
|
|
446
|
+
searchPlaceholder: "Search options...",
|
|
447
|
+
noItemsFound: "No options found.",
|
|
448
|
+
multipleSelected: (p) => `${p} options selected`
|
|
449
|
+
}, ...o }, D = (p) => {
|
|
450
|
+
s ? s(p) : b(p);
|
|
451
|
+
}, $ = () => n && Array.isArray(v) ? v.length === 0 ? C.placeholder : v.length === 1 ? u.find((p) => p.value === v[0])?.label : C.multipleSelected?.(v.length) || `${v.length} options selected` : !n && typeof v == "string" && v ? u.find((p) => p.value === v)?.label : C.placeholder, L = (p) => n && Array.isArray(v) ? v.includes(p) : v === p, B = (p) => {
|
|
452
|
+
if (n) {
|
|
453
|
+
const I = Array.isArray(v) ? v : [], k = I.includes(p) ? I.filter((E) => E !== p) : [...I, p];
|
|
454
|
+
D(k);
|
|
455
|
+
} else
|
|
456
|
+
D(p === v ? "" : p), i(!1);
|
|
457
|
+
}, V = (p) => {
|
|
458
|
+
const I = L(p);
|
|
459
|
+
return m === "check" ? /* @__PURE__ */ w.jsx("span", { className: A("adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center", d?.check), children: I && /* @__PURE__ */ w.jsx(ze, { className: "adm:size-4" }) }) : /* @__PURE__ */ w.jsx(
|
|
460
|
+
De,
|
|
461
|
+
{
|
|
462
|
+
checked: I,
|
|
463
|
+
className: d?.checkbox
|
|
464
|
+
}
|
|
465
|
+
);
|
|
466
|
+
};
|
|
467
|
+
return /* @__PURE__ */ w.jsxs(Me, { open: x, onOpenChange: i, children: [
|
|
468
|
+
/* @__PURE__ */ w.jsx(Ne, { asChild: !0, children: /* @__PURE__ */ w.jsxs(
|
|
469
|
+
Ce,
|
|
470
|
+
{
|
|
471
|
+
variant: "outline",
|
|
472
|
+
role: "combobox",
|
|
473
|
+
"aria-expanded": x,
|
|
474
|
+
className: A("adm:justify-between adm:font-normal", d?.trigger),
|
|
475
|
+
children: [
|
|
476
|
+
$(),
|
|
477
|
+
/* @__PURE__ */ w.jsx(Le, { className: "adm:size-4 adm:opacity-50" })
|
|
478
|
+
]
|
|
479
|
+
}
|
|
480
|
+
) }),
|
|
481
|
+
/* @__PURE__ */ w.jsx(Pe, { align: "start", className: A("adm:p-0", d?.popover), children: /* @__PURE__ */ w.jsxs(ut, { className: d?.command, children: [
|
|
482
|
+
e && /* @__PURE__ */ w.jsx(
|
|
483
|
+
ct,
|
|
484
|
+
{
|
|
485
|
+
placeholder: C.searchPlaceholder,
|
|
486
|
+
className: d?.input
|
|
487
|
+
}
|
|
488
|
+
),
|
|
489
|
+
/* @__PURE__ */ w.jsxs(st, { className: d?.list, children: [
|
|
490
|
+
/* @__PURE__ */ w.jsx(mt, { className: d?.empty, children: C.noItemsFound }),
|
|
491
|
+
/* @__PURE__ */ w.jsx(ft, { className: d?.group, children: u.map((p) => /* @__PURE__ */ w.jsxs(
|
|
492
|
+
pt,
|
|
493
|
+
{
|
|
494
|
+
value: p.value,
|
|
495
|
+
onSelect: B,
|
|
496
|
+
disabled: p.disabled,
|
|
497
|
+
className: A(
|
|
498
|
+
d?.item,
|
|
499
|
+
m === "check" && "adm:pr-8"
|
|
500
|
+
),
|
|
501
|
+
children: [
|
|
502
|
+
m === "checkbox" && V(p.value),
|
|
503
|
+
p.label,
|
|
504
|
+
m === "check" && V(p.value)
|
|
505
|
+
]
|
|
506
|
+
},
|
|
507
|
+
p.value
|
|
508
|
+
)) })
|
|
509
|
+
] })
|
|
510
|
+
] }) })
|
|
511
|
+
] });
|
|
512
|
+
}
|
|
513
|
+
export {
|
|
514
|
+
Rt as Combobox
|
|
515
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sidebar';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentProps, PropsWithChildren, Dispatch } from 'react';
|
|
2
|
+
type SidebarContextType = {
|
|
3
|
+
isXl: boolean;
|
|
4
|
+
sidebarHeight: string;
|
|
5
|
+
setSidebarHeight: Dispatch<React.SetStateAction<string>>;
|
|
6
|
+
};
|
|
7
|
+
declare function Sidebar({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function SidebarContent({ className, children, ...props }: PropsWithChildren<ComponentProps<"div">>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function SidebarInset({ className, children, ...props }: PropsWithChildren<ComponentProps<"div">>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function SidebarHeader({ className, children, ...props }: PropsWithChildren<ComponentProps<"header">>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function SidebarFooter({ className, children, ...props }: PropsWithChildren<ComponentProps<"footer">>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function SidebarMenu({ className, children, ...props }: PropsWithChildren<ComponentProps<"div">>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function SidebarMenuItem({ asChild, className, ...props }: ComponentProps<"button"> & {
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function useSidebarContext(): SidebarContextType;
|
|
17
|
+
export { Sidebar, SidebarContent, SidebarInset, SidebarHeader, SidebarFooter, SidebarMenu, SidebarMenuItem, useSidebarContext, };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const toastVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
type ToastOptions = {
|
|
7
|
+
id?: string;
|
|
8
|
+
message: string;
|
|
9
|
+
variant?: VariantProps<typeof Toast>["variant"];
|
|
10
|
+
autoClose?: number;
|
|
11
|
+
};
|
|
12
|
+
type ToastContextType = {
|
|
13
|
+
showToast: (options: ToastOptions) => void;
|
|
14
|
+
closeToast: () => void;
|
|
15
|
+
};
|
|
16
|
+
declare const ToasterContext: import('react').Context<ToastContextType | undefined>;
|
|
17
|
+
declare function ToasterProvider({ children }: PropsWithChildren): import('react').FunctionComponentElement<import('react').ProviderProps<ToastContextType | undefined>>;
|
|
18
|
+
type ToastProps = Readonly<{
|
|
19
|
+
message: string;
|
|
20
|
+
variant?: VariantProps<typeof toastVariants>["variant"];
|
|
21
|
+
open?: boolean;
|
|
22
|
+
autoClose?: number;
|
|
23
|
+
onClose?: () => void;
|
|
24
|
+
}>;
|
|
25
|
+
declare function Toast({ message, variant, open, autoClose, onClose, }: ToastProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export { Toast, ToasterProvider, ToasterContext, type ToastOptions, type ToastContextType, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Toast } from '.';
|
|
3
|
+
declare const meta: Meta<typeof Toast>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Toast>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const Success: Story;
|
|
9
|
+
export declare const Warning: Story;
|
|
10
|
+
export declare const Destructive: Story;
|
|
11
|
+
export declare const CustomDuration: Story;
|
|
12
|
+
export declare const QueuedToasts: Story;
|
|
13
|
+
export declare const RealWorldExamples: Story;
|
|
14
|
+
export declare const LongMessages: Story;
|
|
15
|
+
export declare const ManualClose: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useToast(): import('./toaster').ToastContextType;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Accordion } from '.';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Accordion;
|
|
6
|
+
tags: string[];
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof meta>;
|
|
10
|
+
export declare const Default: Story;
|
|
11
|
+
export declare const WithDefaultValue: Story;
|
|
12
|
+
export declare const MultipleType: Story;
|
|
13
|
+
export declare const NonCollapsible: Story;
|
|
14
|
+
export declare const ControlledAccordion: Story;
|
|
15
|
+
export declare const ProductInformation: Story;
|
|
16
|
+
export declare const ProjectTimeline: Story;
|
|
17
|
+
export declare const LearningCourse: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './accordion';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
type AccordionTriggerProps = React.ComponentProps<typeof AccordionPrimitive.Trigger> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
badge?: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
declare function AccordionTrigger({ className, children, title, badge, ...props }: AccordionTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Accordion } from './accordion-rounded';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Accordion;
|
|
6
|
+
tags: string[];
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof meta>;
|
|
10
|
+
export declare const Default: Story;
|
|
11
|
+
export declare const WithWarningBadge: Story;
|
|
12
|
+
export declare const WithSuccessBadge: Story;
|
|
13
|
+
export declare const WithErrorBadge: Story;
|
|
14
|
+
export declare const WithInfoBadge: Story;
|
|
15
|
+
export declare const WithTextOnlyBadge: Story;
|
|
16
|
+
export declare const MultipleItems: Story;
|
|
17
|
+
export declare const MultipleType: Story;
|
|
18
|
+
export declare const DefaultOpen: Story;
|
|
19
|
+
export declare const RichContent: Story;
|
|
20
|
+
export declare const MixedStates: Story;
|
|
21
|
+
export declare const CompactVersion: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './accordion-rounded';
|