@enya-learning/nova 0.6.0 → 0.7.1
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/chunks/dist-fahbq1psobj0ox6s.js.map +1 -1
- package/dist/chunks/dist-i6l6wqicjhnap81o.js +37 -0
- package/dist/chunks/{dist-o8x0ip0z71xkr2oh.js.map → dist-i6l6wqicjhnap81o.js.map} +1 -1
- package/dist/chunks/utils-chr77evsz8gs6wle.js +10 -0
- package/dist/chunks/{utils-kyb5nny4y41y7hd8.js.map → utils-chr77evsz8gs6wle.js.map} +1 -1
- package/dist/chunks/{vendor-styling-eeiy57tyznmxsfky.js → vendor-styling-bq164a52kub0yzw7.js} +84 -81
- package/dist/chunks/{vendor-styling-eeiy57tyznmxsfky.js.map → vendor-styling-bq164a52kub0yzw7.js.map} +1 -1
- package/dist/chunks/{vendor-utils-egkaeebaqpft6cxj.js → vendor-utils-dzqqqwem43r86lbz.js} +48 -48
- package/dist/chunks/{vendor-utils-egkaeebaqpft6cxj.js.map → vendor-utils-dzqqqwem43r86lbz.js.map} +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert.js +2 -2
- package/dist/components/aspect-ratio.js +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/badge.js +2 -2
- package/dist/components/box.js +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.js +2 -2
- package/dist/components/button.js +2 -2
- package/dist/components/calendar.js +59 -58
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +27 -26
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/chart.js +1460 -1455
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.js +7 -7
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.js +83 -83
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.js +1 -1
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.js +2 -2
- package/dist/components/enya-logo.js +88 -78
- package/dist/components/enya-logo.js.map +1 -1
- package/dist/components/field.js +2 -2
- package/dist/components/field.js.map +1 -1
- package/dist/components/heading.js +11 -11
- package/dist/components/heading.js.map +1 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input-group.js +2 -2
- package/dist/components/input-otp.js +61 -60
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/item.js +2 -2
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/native-select.js +1 -1
- package/dist/components/native-select.js.map +1 -1
- package/dist/components/navigation-menu.js +2 -2
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/resizable.js +119 -116
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +10 -10
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sonner.js +163 -165
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +2 -2
- package/dist/components/text.js +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +2 -2
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/index.js +28 -21
- package/dist/src/index.d.ts +1 -0
- package/dist/styles/nova.css +1 -1
- package/dist/styles/shadcn-variants.css +98 -0
- package/dist/utils.js +1 -1
- package/package.json +15 -11
- package/src/eslint/no-primitive-colors.test.ts +1 -1
- package/dist/chunks/dist-o8x0ip0z71xkr2oh.js +0 -37
- package/dist/chunks/utils-kyb5nny4y41y7hd8.js +0 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as o } from "../chunks/utils-
|
|
2
|
+
import { t as o } from "../chunks/utils-chr77evsz8gs6wle.js";
|
|
3
3
|
import { jsx as r } from "react/jsx-runtime";
|
|
4
4
|
import { HugeiconsIcon as t } from "@hugeicons/react";
|
|
5
5
|
import { CheckIcon as d } from "@hugeicons/core-free-icons";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":[],"sources":["../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\"\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\n\nimport { cn } from \"../../lib/utils\"\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport { CheckIcon } from \"@hugeicons/core-free-icons\"\n\nfunction Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer relative flex size-4 shrink-0 items-center justify-center rounded-[6px] border border-border transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-border/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <HugeiconsIcon icon={CheckIcon} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n"],"mappings":";;;;;;AAQA,SAAS,EAAS,EAAE,WAAA,GAAW,GAAG,EAAA,GAAuC;AACvE,SACE,gBAAA,EAAC,EAAkB,MAAnB;AAAA,IACE,aAAU;AAAA,IACV,WAAW,EACT,+qBACA,CACF;AAAA,IACA,GAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":[],"sources":["../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\"\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\n\nimport { cn } from \"../../lib/utils\"\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport { CheckIcon } from \"@hugeicons/core-free-icons\"\n\nfunction Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer relative flex size-4 shrink-0 items-center justify-center rounded-[6px] border border-border transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-border/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <HugeiconsIcon icon={CheckIcon} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n"],"mappings":";;;;;;AAQA,SAAS,EAAS,EAAE,WAAA,GAAW,GAAG,EAAA,GAAuC;AACvE,SACE,gBAAA,EAAC,EAAkB,MAAnB;AAAA,IACE,aAAU;AAAA,IACV,WAAW,EACT,+qBACA,CACF;AAAA,IACA,GAAI;AAAA,IAEJ,UAAA,gBAAA,EAAC,EAAkB,WAAnB;AAAA,MACE,aAAU;AAAA,MACV,WAAU;AAAA,MAEV,UAAA,gBAAA,EAAC,GAAD,EAAe,MAAM,EAAY,CAAA;AAAA,IACN,CAAA;AAAA,EACP,CAAA;AAE5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as n } from "../chunks/utils-
|
|
2
|
+
import { t as n } from "../chunks/utils-chr77evsz8gs6wle.js";
|
|
3
3
|
import { Button as b } from "./button.js";
|
|
4
4
|
import { InputGroup as x, InputGroupAddon as h, InputGroupButton as m, InputGroupInput as g } from "./input-group.js";
|
|
5
5
|
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
@@ -120,21 +120,21 @@ function V({ ...o }) {
|
|
|
120
120
|
...o
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function $({ className: o, ...e }) {
|
|
124
124
|
return /* @__PURE__ */ t(a.Empty, {
|
|
125
125
|
"data-slot": "combobox-empty",
|
|
126
126
|
className: n("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", o),
|
|
127
127
|
...e
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function D({ className: o, ...e }) {
|
|
131
131
|
return /* @__PURE__ */ t(a.Separator, {
|
|
132
132
|
"data-slot": "combobox-separator",
|
|
133
133
|
className: n("-mx-1 my-1 h-px bg-border/50", o),
|
|
134
134
|
...e
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function H({ className: o, ...e }) {
|
|
138
138
|
return /* @__PURE__ */ t(a.Chips, {
|
|
139
139
|
"data-slot": "combobox-chips",
|
|
140
140
|
className: n("flex min-h-9 flex-wrap items-center gap-1.5 rounded-4xl border border-border bg-border/30 bg-clip-padding px-2.5 py-1.5 text-sm transition-colors focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-[3px] has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40", o),
|
|
@@ -173,17 +173,17 @@ function J() {
|
|
|
173
173
|
export {
|
|
174
174
|
R as Combobox,
|
|
175
175
|
q as ComboboxChip,
|
|
176
|
-
|
|
176
|
+
H as ComboboxChips,
|
|
177
177
|
F as ComboboxChipsInput,
|
|
178
178
|
V as ComboboxCollection,
|
|
179
179
|
A as ComboboxContent,
|
|
180
|
-
|
|
180
|
+
$ as ComboboxEmpty,
|
|
181
181
|
S as ComboboxGroup,
|
|
182
182
|
P as ComboboxInput,
|
|
183
183
|
E as ComboboxItem,
|
|
184
184
|
T as ComboboxLabel,
|
|
185
185
|
B as ComboboxList,
|
|
186
|
-
|
|
186
|
+
D as ComboboxSeparator,
|
|
187
187
|
w as ComboboxTrigger,
|
|
188
188
|
_ as ComboboxValue,
|
|
189
189
|
J as useComboboxAnchor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.js","names":[],"sources":["../../src/components/combobox/combobox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"../button\"\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"../input-group\"\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport {\n ChevronDownIcon,\n Cancel01Icon,\n CheckIcon,\n} from \"@hugeicons/core-free-icons\"\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Trigger.Props) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n >\n {children}\n <HugeiconsIcon\n icon={ChevronDownIcon}\n className=\"pointer-events-none size-4 text-muted-foreground\"\n />\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={cn(className)}\n {...props}\n >\n <HugeiconsIcon icon={Cancel01Icon} className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...props\n}: ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean\n showClear?: boolean\n}) {\n return (\n <InputGroup className={cn(\"w-auto\", className)}>\n <ComboboxPrimitive.Input\n render={<InputGroupInput disabled={disabled} />}\n {...props}\n />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n render={<ComboboxTrigger />}\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n />\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = \"bottom\",\n sideOffset = 6,\n align = \"start\",\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxPrimitive.Popup.Props &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n \"side\" | \"align\" | \"sideOffset\" | \"alignOffset\" | \"anchor\"\n >) {\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n \"group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-2xl bg-popover text-popover-foreground shadow-2xl ring-1 ring-foreground/5 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-9 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-border/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n \"no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Item.Props) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center gap-2.5 rounded-xl py-2 ps-3 pe-8 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute end-2 flex size-4 items-center justify-center\" />\n }\n >\n <HugeiconsIcon icon={CheckIcon} className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxLabel({\n className,\n ...props\n}: ComboboxPrimitive.GroupLabel.Props) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn(\"px-3.5 py-2.5 text-xs text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {\n return (\n <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n )\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n \"hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({\n className,\n ...props\n}: ComboboxPrimitive.Separator.Props) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border/50\", className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({\n className,\n ...props\n}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &\n ComboboxPrimitive.Chips.Props) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n \"flex min-h-9 flex-wrap items-center gap-1.5 rounded-4xl border border-border bg-border/30 bg-clip-padding px-2.5 py-1.5 text-sm transition-colors focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-[3px] has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({\n className,\n children,\n showRemove = true,\n ...props\n}: ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n}) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n \"flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-4xl bg-muted-foreground/10 px-2 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-0\",\n className\n )}\n {...props}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" size=\"icon-xs\" />}\n className=\"-ms-1 opacity-50 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <HugeiconsIcon icon={Cancel01Icon} className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({\n className,\n ...props\n}: ComboboxPrimitive.Input.Props) {\n return (\n <ComboboxPrimitive.Input\n data-slot=\"combobox-chip-input\"\n className={cn(\"min-w-16 flex-1 outline-none\", className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxContent,\n ComboboxList,\n ComboboxItem,\n ComboboxGroup,\n ComboboxLabel,\n ComboboxCollection,\n ComboboxEmpty,\n ComboboxSeparator,\n ComboboxChips,\n ComboboxChip,\n ComboboxChipsInput,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor,\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAM,IAAW,EAAkB;AAEnC,SAAS,EAAc,EAAE,GAAG,EAAA,GAAwC;AAClE,SAAO,gBAAA,EAAC,EAAkB,OAAnB;AAAA,IAAyB,aAAU;AAAA,IAAiB,GAAI;AAAA,EAAQ,CAAA;AACzE;AAEA,SAAS,EAAgB,EACvB,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GAC+B;AAClC,SACE,gBAAA,EAAC,EAAkB,SAAnB;AAAA,IACE,aAAU;AAAA,IACV,WAAW,EAAG,wCAAwC,CAAS;AAAA,IAC/D,GAAI;AAAA,cAHN,CAKG,GACD,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACN,WAAU;AAAA,IACX,CAAA,CACwB;AAAA;AAE/B;AAEA,SAAS,EAAc,EAAE,WAAA,GAAW,GAAG,EAAA,GAAwC;AAC7E,SACE,gBAAA,EAAC,EAAkB,OAAnB;AAAA,IACE,aAAU;AAAA,IACV,QAAQ,gBAAA,EAAC,GAAD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AgC,CAAS;AAAA,IACvD,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,IAAoB;AAC3B,SAAO,EAAM,OAA8B,IAAI;AACjD"}
|
|
1
|
+
{"version":3,"file":"combobox.js","names":[],"sources":["../../src/components/combobox/combobox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"../button\"\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"../input-group\"\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport {\n ChevronDownIcon,\n Cancel01Icon,\n CheckIcon,\n} from \"@hugeicons/core-free-icons\"\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Trigger.Props) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n >\n {children}\n <HugeiconsIcon\n icon={ChevronDownIcon}\n className=\"pointer-events-none size-4 text-muted-foreground\"\n />\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={cn(className)}\n {...props}\n >\n <HugeiconsIcon icon={Cancel01Icon} className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...props\n}: ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean\n showClear?: boolean\n}) {\n return (\n <InputGroup className={cn(\"w-auto\", className)}>\n <ComboboxPrimitive.Input\n render={<InputGroupInput disabled={disabled} />}\n {...props}\n />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n render={<ComboboxTrigger />}\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n />\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = \"bottom\",\n sideOffset = 6,\n align = \"start\",\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxPrimitive.Popup.Props &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n \"side\" | \"align\" | \"sideOffset\" | \"alignOffset\" | \"anchor\"\n >) {\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n \"group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-2xl bg-popover text-popover-foreground shadow-2xl ring-1 ring-foreground/5 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-9 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-border/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n \"no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Item.Props) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center gap-2.5 rounded-xl py-2 ps-3 pe-8 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute end-2 flex size-4 items-center justify-center\" />\n }\n >\n <HugeiconsIcon icon={CheckIcon} className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxLabel({\n className,\n ...props\n}: ComboboxPrimitive.GroupLabel.Props) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn(\"px-3.5 py-2.5 text-xs text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {\n return (\n <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n )\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n \"hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({\n className,\n ...props\n}: ComboboxPrimitive.Separator.Props) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border/50\", className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({\n className,\n ...props\n}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &\n ComboboxPrimitive.Chips.Props) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n \"flex min-h-9 flex-wrap items-center gap-1.5 rounded-4xl border border-border bg-border/30 bg-clip-padding px-2.5 py-1.5 text-sm transition-colors focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-[3px] has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({\n className,\n children,\n showRemove = true,\n ...props\n}: ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n}) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n \"flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-4xl bg-muted-foreground/10 px-2 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-0\",\n className\n )}\n {...props}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" size=\"icon-xs\" />}\n className=\"-ms-1 opacity-50 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <HugeiconsIcon icon={Cancel01Icon} className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({\n className,\n ...props\n}: ComboboxPrimitive.Input.Props) {\n return (\n <ComboboxPrimitive.Input\n data-slot=\"combobox-chip-input\"\n className={cn(\"min-w-16 flex-1 outline-none\", className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxContent,\n ComboboxList,\n ComboboxItem,\n ComboboxGroup,\n ComboboxLabel,\n ComboboxCollection,\n ComboboxEmpty,\n ComboboxSeparator,\n ComboboxChips,\n ComboboxChip,\n ComboboxChipsInput,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor,\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAM,IAAW,EAAkB;AAEnC,SAAS,EAAc,EAAE,GAAG,EAAA,GAAwC;AAClE,SAAO,gBAAA,EAAC,EAAkB,OAAnB;AAAA,IAAyB,aAAU;AAAA,IAAiB,GAAI;AAAA,EAAQ,CAAA;AACzE;AAEA,SAAS,EAAgB,EACvB,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GAC+B;AAClC,SACE,gBAAA,EAAC,EAAkB,SAAnB;AAAA,IACE,aAAU;AAAA,IACV,WAAW,EAAG,wCAAwC,CAAS;AAAA,IAC/D,GAAI;AAAA,IAHN,UAAA,CAKG,GACD,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACN,WAAU;AAAA,IACX,CAAA,CACwB;AAAA;AAE/B;AAEA,SAAS,EAAc,EAAE,WAAA,GAAW,GAAG,EAAA,GAAwC;AAC7E,SACE,gBAAA,EAAC,EAAkB,OAAnB;AAAA,IAC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GAC6B;AAChC,SACE,gBAAA,EAAC,EAAkB,OAAnB;AAAA,IACE,aAAU;AAAA,IACV,WAAW,EAAG,gCAAgC,CAAS;AAAA,IACvD,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,IAAoB;AAC3B,SAAO,EAAM,OAA8B,IAAI;AACjD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as I } from "../chunks/utils-
|
|
2
|
+
import { t as I } from "../chunks/utils-chr77evsz8gs6wle.js";
|
|
3
3
|
import { InputGroup as Ae, InputGroupAddon as $e } from "./input-group.js";
|
|
4
4
|
import { a as De, i as Ne, l as F, n as Pe, o as Me, u as O } from "../chunks/dist-fahbq1psobj0ox6s.js";
|
|
5
5
|
import { Dialog as je, DialogContent as Le, DialogDescription as Ve, DialogHeader as Fe, DialogTitle as Oe } from "./dialog.js";
|
|
@@ -9,11 +9,11 @@ import { CheckIcon as ze, SearchIcon as Ke } from "@hugeicons/core-free-icons";
|
|
|
9
9
|
import * as l from "react";
|
|
10
10
|
import "react-dom";
|
|
11
11
|
var pe = 1, Te = 0.9, qe = 0.8, We = 0.17, te = 0.1, re = 0.999, _e = 0.9999, Be = 0.99, Ge = /[\\\/_+.#"@\[\(\{&]/, He = /[\\\/_+.#"@\[\(\{&]/g, Ue = /[\s-]/, be = /[\s-]/g;
|
|
12
|
-
function le(e, t, r, i,
|
|
13
|
-
if (
|
|
14
|
-
var m = `${
|
|
12
|
+
function le(e, t, r, i, a, o, d) {
|
|
13
|
+
if (o === t.length) return a === e.length ? pe : Be;
|
|
14
|
+
var m = `${a},${o}`;
|
|
15
15
|
if (d[m] !== void 0) return d[m];
|
|
16
|
-
for (var g = i.charAt(
|
|
16
|
+
for (var g = i.charAt(o), c = r.indexOf(g, a), p = 0, h, S, x, R; c >= 0; ) h = le(e, t, r, i, c + 1, o + 1, d), h > p && (c === a ? h *= pe : Ge.test(e.charAt(c - 1)) ? (h *= qe, x = e.slice(a, c - 1).match(He), x && a > 0 && (h *= Math.pow(re, x.length))) : Ue.test(e.charAt(c - 1)) ? (h *= Te, R = e.slice(a, c - 1).match(be), R && a > 0 && (h *= Math.pow(re, R.length))) : (h *= We, a > 0 && (h *= Math.pow(re, c - a))), e.charAt(c) !== t.charAt(o) && (h *= _e)), (h < te && r.charAt(c - 1) === i.charAt(o + 1) || i.charAt(o + 1) === i.charAt(o) && r.charAt(c - 1) !== i.charAt(o)) && (S = le(e, t, r, i, c + 1, o + 2, d), S * te > h && (h = S * te)), h > p && (p = h), c = r.indexOf(g, c + 1);
|
|
17
17
|
return d[m] = p, p;
|
|
18
18
|
}
|
|
19
19
|
function ve(e) {
|
|
@@ -31,22 +31,22 @@ function ye(e) {
|
|
|
31
31
|
}
|
|
32
32
|
// @__NO_SIDE_EFFECTS__
|
|
33
33
|
function Xe(e) {
|
|
34
|
-
const t = /* @__PURE__ */ Qe(e), r = l.forwardRef((i,
|
|
35
|
-
let { children:
|
|
36
|
-
ye(
|
|
37
|
-
const m = l.Children.toArray(
|
|
34
|
+
const t = /* @__PURE__ */ Qe(e), r = l.forwardRef((i, a) => {
|
|
35
|
+
let { children: o, ...d } = i;
|
|
36
|
+
ye(o) && typeof _ == "function" && (o = _(o._payload));
|
|
37
|
+
const m = l.Children.toArray(o), g = m.find(tt);
|
|
38
38
|
if (g) {
|
|
39
39
|
const c = g.props.children, p = m.map((h) => h === g ? l.Children.count(c) > 1 ? l.Children.only(null) : l.isValidElement(c) ? c.props.children : null : h);
|
|
40
40
|
return /* @__PURE__ */ w(t, {
|
|
41
41
|
...d,
|
|
42
|
-
ref:
|
|
42
|
+
ref: a,
|
|
43
43
|
children: l.isValidElement(c) ? l.cloneElement(c, void 0, p) : null
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
return /* @__PURE__ */ w(t, {
|
|
47
47
|
...d,
|
|
48
|
-
ref:
|
|
49
|
-
children:
|
|
48
|
+
ref: a,
|
|
49
|
+
children: o
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
return r.displayName = `${e}.Slot`, r;
|
|
@@ -54,12 +54,12 @@ function Xe(e) {
|
|
|
54
54
|
// @__NO_SIDE_EFFECTS__
|
|
55
55
|
function Qe(e) {
|
|
56
56
|
const t = l.forwardRef((r, i) => {
|
|
57
|
-
let { children:
|
|
58
|
-
if (ye(
|
|
59
|
-
const d = nt(
|
|
60
|
-
return
|
|
57
|
+
let { children: a, ...o } = r;
|
|
58
|
+
if (ye(a) && typeof _ == "function" && (a = _(a._payload)), l.isValidElement(a)) {
|
|
59
|
+
const d = nt(a), m = rt(o, a.props);
|
|
60
|
+
return a.type !== l.Fragment && (m.ref = i ? O(i, d) : d), l.cloneElement(a, m);
|
|
61
61
|
}
|
|
62
|
-
return l.Children.count(
|
|
62
|
+
return l.Children.count(a) > 1 ? l.Children.only(null) : null;
|
|
63
63
|
});
|
|
64
64
|
return t.displayName = `${e}.SlotClone`, t;
|
|
65
65
|
}
|
|
@@ -70,14 +70,14 @@ function tt(e) {
|
|
|
70
70
|
function rt(e, t) {
|
|
71
71
|
const r = { ...t };
|
|
72
72
|
for (const i in t) {
|
|
73
|
-
const
|
|
74
|
-
/^on[A-Z]/.test(i) ?
|
|
75
|
-
const m =
|
|
76
|
-
return
|
|
77
|
-
} :
|
|
78
|
-
...
|
|
79
|
-
...
|
|
80
|
-
} : i === "className" && (r[i] = [
|
|
73
|
+
const a = e[i], o = t[i];
|
|
74
|
+
/^on[A-Z]/.test(i) ? a && o ? r[i] = (...d) => {
|
|
75
|
+
const m = o(...d);
|
|
76
|
+
return a(...d), m;
|
|
77
|
+
} : a && (r[i] = a) : i === "style" ? r[i] = {
|
|
78
|
+
...a,
|
|
79
|
+
...o
|
|
80
|
+
} : i === "className" && (r[i] = [a, o].filter(Boolean).join(" "));
|
|
81
81
|
}
|
|
82
82
|
return {
|
|
83
83
|
...e,
|
|
@@ -107,18 +107,18 @@ var $ = [
|
|
|
107
107
|
"svg",
|
|
108
108
|
"ul"
|
|
109
109
|
].reduce((e, t) => {
|
|
110
|
-
const r = /* @__PURE__ */ Xe(`Primitive.${t}`), i = l.forwardRef((
|
|
111
|
-
const { asChild: d, ...m } =
|
|
110
|
+
const r = /* @__PURE__ */ Xe(`Primitive.${t}`), i = l.forwardRef((a, o) => {
|
|
111
|
+
const { asChild: d, ...m } = a, g = d ? r : t;
|
|
112
112
|
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ w(g, {
|
|
113
113
|
...m,
|
|
114
|
-
ref:
|
|
114
|
+
ref: o
|
|
115
115
|
});
|
|
116
116
|
});
|
|
117
117
|
return i.displayName = `Primitive.${t}`, {
|
|
118
118
|
...e,
|
|
119
119
|
[t]: i
|
|
120
120
|
};
|
|
121
|
-
}, {}), K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', lt = '[cmdk-group-heading=""]', we = '[cmdk-item=""]', ge = `${we}:not([aria-disabled="true"])`,
|
|
121
|
+
}, {}), K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', lt = '[cmdk-group-heading=""]', we = '[cmdk-item=""]', ge = `${we}:not([aria-disabled="true"])`, ae = "cmdk-item-select", L = "data-value", at = (e, t, r) => Ye(e, t, r), xe = l.createContext(void 0), T = () => l.useContext(xe), Ee = l.createContext(void 0), oe = () => l.useContext(Ee), Ce = l.createContext(void 0), ke = l.forwardRef((e, t) => {
|
|
122
122
|
let r = V(() => {
|
|
123
123
|
var n, s;
|
|
124
124
|
return {
|
|
@@ -131,7 +131,7 @@ var $ = [
|
|
|
131
131
|
groups: /* @__PURE__ */ new Set()
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
|
-
}), i = V(() => /* @__PURE__ */ new Set()),
|
|
134
|
+
}), i = V(() => /* @__PURE__ */ new Set()), a = V(() => /* @__PURE__ */ new Map()), o = V(() => /* @__PURE__ */ new Map()), d = V(() => /* @__PURE__ */ new Set()), m = Se(e), { label: g, children: c, value: p, onValueChange: h, filter: S, shouldFilter: x, loop: R, disablePointerSelection: G = !1, vimBindings: D = !0, ...q } = e, H = F(), ie = F(), U = F(), N = l.useRef(null), y = gt();
|
|
135
135
|
P(() => {
|
|
136
136
|
if (p !== void 0) {
|
|
137
137
|
let n = p.trim();
|
|
@@ -170,24 +170,24 @@ var $ = [
|
|
|
170
170
|
}), []), Y = l.useMemo(() => ({
|
|
171
171
|
value: (n, s, f) => {
|
|
172
172
|
var u;
|
|
173
|
-
s !== ((u =
|
|
173
|
+
s !== ((u = o.current.get(n)) == null ? void 0 : u.value) && (o.current.set(n, {
|
|
174
174
|
value: s,
|
|
175
175
|
keywords: f
|
|
176
176
|
}), r.current.filtered.items.set(n, ue(s, f)), y(2, () => {
|
|
177
177
|
Z(), E.emit();
|
|
178
178
|
}));
|
|
179
179
|
},
|
|
180
|
-
item: (n, s) => (i.current.add(n), s && (
|
|
180
|
+
item: (n, s) => (i.current.add(n), s && (a.current.has(s) ? a.current.get(s).add(n) : a.current.set(s, /* @__PURE__ */ new Set([n]))), y(3, () => {
|
|
181
181
|
X(), Z(), r.current.value || J(), E.emit();
|
|
182
182
|
}), () => {
|
|
183
|
-
|
|
183
|
+
o.current.delete(n), i.current.delete(n), r.current.filtered.items.delete(n);
|
|
184
184
|
let f = j();
|
|
185
185
|
y(4, () => {
|
|
186
186
|
X(), f?.getAttribute("id") === n && J(), E.emit();
|
|
187
187
|
});
|
|
188
188
|
}),
|
|
189
|
-
group: (n) => (
|
|
190
|
-
|
|
189
|
+
group: (n) => (a.current.has(n) || a.current.set(n, /* @__PURE__ */ new Set()), () => {
|
|
190
|
+
o.current.delete(n), a.current.delete(n);
|
|
191
191
|
}),
|
|
192
192
|
filter: () => m.current.shouldFilter,
|
|
193
193
|
label: g || e["aria-label"],
|
|
@@ -199,14 +199,14 @@ var $ = [
|
|
|
199
199
|
}), []);
|
|
200
200
|
function ue(n, s) {
|
|
201
201
|
var f, u;
|
|
202
|
-
let v = (u = (f = m.current) == null ? void 0 : f.filter) != null ? u :
|
|
202
|
+
let v = (u = (f = m.current) == null ? void 0 : f.filter) != null ? u : at;
|
|
203
203
|
return n ? v(n, r.current.search, s) : 0;
|
|
204
204
|
}
|
|
205
205
|
function Z() {
|
|
206
206
|
if (!r.current.search || m.current.shouldFilter === !1) return;
|
|
207
207
|
let n = r.current.filtered.items, s = [];
|
|
208
208
|
r.current.filtered.groups.forEach((u) => {
|
|
209
|
-
let v =
|
|
209
|
+
let v = a.current.get(u), b = 0;
|
|
210
210
|
v.forEach((C) => {
|
|
211
211
|
let k = n.get(C);
|
|
212
212
|
b = Math.max(k, b);
|
|
@@ -239,10 +239,10 @@ var $ = [
|
|
|
239
239
|
r.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
240
240
|
let v = 0;
|
|
241
241
|
for (let b of i.current) {
|
|
242
|
-
let C = ue((s = (n =
|
|
242
|
+
let C = ue((s = (n = o.current.get(b)) == null ? void 0 : n.value) != null ? s : "", (u = (f = o.current.get(b)) == null ? void 0 : f.keywords) != null ? u : []);
|
|
243
243
|
r.current.filtered.items.set(b, C), C > 0 && v++;
|
|
244
244
|
}
|
|
245
|
-
for (let [b, C] of
|
|
245
|
+
for (let [b, C] of a.current) for (let k of C) if (r.current.filtered.items.get(k) > 0) {
|
|
246
246
|
r.current.filtered.groups.add(b);
|
|
247
247
|
break;
|
|
248
248
|
}
|
|
@@ -314,7 +314,7 @@ var $ = [
|
|
|
314
314
|
n.preventDefault();
|
|
315
315
|
let u = j();
|
|
316
316
|
if (u) {
|
|
317
|
-
let v = new Event(
|
|
317
|
+
let v = new Event(ae);
|
|
318
318
|
u.dispatchEvent(v);
|
|
319
319
|
}
|
|
320
320
|
}
|
|
@@ -326,20 +326,20 @@ var $ = [
|
|
|
326
326
|
id: Y.labelId,
|
|
327
327
|
style: bt
|
|
328
328
|
}, g), B(e, (n) => l.createElement(Ee.Provider, { value: E }, l.createElement(xe.Provider, { value: Y }, n))));
|
|
329
|
-
}),
|
|
329
|
+
}), ot = l.forwardRef((e, t) => {
|
|
330
330
|
var r, i;
|
|
331
|
-
let
|
|
331
|
+
let a = F(), o = l.useRef(null), d = l.useContext(Ce), m = T(), g = Se(e), c = (i = (r = g.current) == null ? void 0 : r.forceMount) != null ? i : d?.forceMount;
|
|
332
332
|
P(() => {
|
|
333
|
-
if (!c) return m.item(
|
|
333
|
+
if (!c) return m.item(a, d?.id);
|
|
334
334
|
}, [c]);
|
|
335
|
-
let p = Ie(
|
|
335
|
+
let p = Ie(a, o, [
|
|
336
336
|
e.value,
|
|
337
337
|
e.children,
|
|
338
|
-
|
|
339
|
-
], e.keywords), h =
|
|
338
|
+
o
|
|
339
|
+
], e.keywords), h = oe(), S = A((y) => y.value && y.value === p.current), x = A((y) => c || m.filter() === !1 ? !0 : y.search ? y.filtered.items.get(a) > 0 : !0);
|
|
340
340
|
l.useEffect(() => {
|
|
341
|
-
let y =
|
|
342
|
-
if (!(!y || e.disabled)) return y.addEventListener(
|
|
341
|
+
let y = o.current;
|
|
342
|
+
if (!(!y || e.disabled)) return y.addEventListener(ae, R), () => y.removeEventListener(ae, R);
|
|
343
343
|
}, [
|
|
344
344
|
x,
|
|
345
345
|
e.onSelect,
|
|
@@ -355,9 +355,9 @@ var $ = [
|
|
|
355
355
|
if (!x) return null;
|
|
356
356
|
let { disabled: D, value: q, onSelect: H, forceMount: ie, keywords: U, ...N } = e;
|
|
357
357
|
return l.createElement($.div, {
|
|
358
|
-
ref: O(
|
|
358
|
+
ref: O(o, t),
|
|
359
359
|
...N,
|
|
360
|
-
id:
|
|
360
|
+
id: a,
|
|
361
361
|
"cmdk-item": "",
|
|
362
362
|
role: "option",
|
|
363
363
|
"aria-disabled": !!D,
|
|
@@ -368,7 +368,7 @@ var $ = [
|
|
|
368
368
|
onClick: D ? void 0 : R
|
|
369
369
|
}, e.children);
|
|
370
370
|
}), it = l.forwardRef((e, t) => {
|
|
371
|
-
let { heading: r, children: i, forceMount:
|
|
371
|
+
let { heading: r, children: i, forceMount: a, ...o } = e, d = F(), m = l.useRef(null), g = l.useRef(null), c = F(), p = T(), h = A((x) => a || p.filter() === !1 ? !0 : x.search ? x.filtered.groups.has(d) : !0);
|
|
372
372
|
P(() => p.group(d), []), Ie(d, m, [
|
|
373
373
|
e.value,
|
|
374
374
|
e.heading,
|
|
@@ -376,11 +376,11 @@ var $ = [
|
|
|
376
376
|
]);
|
|
377
377
|
let S = l.useMemo(() => ({
|
|
378
378
|
id: d,
|
|
379
|
-
forceMount:
|
|
380
|
-
}), [
|
|
379
|
+
forceMount: a
|
|
380
|
+
}), [a]);
|
|
381
381
|
return l.createElement($.div, {
|
|
382
382
|
ref: O(m, t),
|
|
383
|
-
...
|
|
383
|
+
...o,
|
|
384
384
|
"cmdk-group": "",
|
|
385
385
|
role: "presentation",
|
|
386
386
|
hidden: h ? void 0 : !0
|
|
@@ -395,17 +395,17 @@ var $ = [
|
|
|
395
395
|
"aria-labelledby": r ? c : void 0
|
|
396
396
|
}, l.createElement(Ce.Provider, { value: S }, x))));
|
|
397
397
|
}), ut = l.forwardRef((e, t) => {
|
|
398
|
-
let { alwaysRender: r, ...i } = e,
|
|
399
|
-
return !r && !
|
|
400
|
-
ref: O(
|
|
398
|
+
let { alwaysRender: r, ...i } = e, a = l.useRef(null), o = A((d) => !d.search);
|
|
399
|
+
return !r && !o ? null : l.createElement($.div, {
|
|
400
|
+
ref: O(a, t),
|
|
401
401
|
...i,
|
|
402
402
|
"cmdk-separator": "",
|
|
403
403
|
role: "separator"
|
|
404
404
|
});
|
|
405
405
|
}), ct = l.forwardRef((e, t) => {
|
|
406
|
-
let { onValueChange: r, ...i } = e,
|
|
406
|
+
let { onValueChange: r, ...i } = e, a = e.value != null, o = oe(), d = A((c) => c.search), m = A((c) => c.selectedItemId), g = T();
|
|
407
407
|
return l.useEffect(() => {
|
|
408
|
-
e.value != null &&
|
|
408
|
+
e.value != null && o.setState("search", e.value);
|
|
409
409
|
}, [e.value]), l.createElement($.input, {
|
|
410
410
|
ref: t,
|
|
411
411
|
...i,
|
|
@@ -421,16 +421,16 @@ var $ = [
|
|
|
421
421
|
"aria-activedescendant": m,
|
|
422
422
|
id: g.inputId,
|
|
423
423
|
type: "text",
|
|
424
|
-
value:
|
|
424
|
+
value: a ? e.value : d,
|
|
425
425
|
onChange: (c) => {
|
|
426
|
-
|
|
426
|
+
a || o.setState("search", c.target.value), r?.(c.target.value);
|
|
427
427
|
}
|
|
428
428
|
});
|
|
429
429
|
}), dt = l.forwardRef((e, t) => {
|
|
430
|
-
let { children: r, label: i = "Suggestions", ...
|
|
430
|
+
let { children: r, label: i = "Suggestions", ...a } = e, o = l.useRef(null), d = l.useRef(null), m = A((c) => c.selectedItemId), g = T();
|
|
431
431
|
return l.useEffect(() => {
|
|
432
|
-
if (d.current &&
|
|
433
|
-
let c = d.current, p =
|
|
432
|
+
if (d.current && o.current) {
|
|
433
|
+
let c = d.current, p = o.current, h, S = new ResizeObserver(() => {
|
|
434
434
|
h = requestAnimationFrame(() => {
|
|
435
435
|
let x = c.offsetHeight;
|
|
436
436
|
p.style.setProperty("--cmdk-list-height", x.toFixed(1) + "px");
|
|
@@ -441,8 +441,8 @@ var $ = [
|
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
443
|
}, []), l.createElement($.div, {
|
|
444
|
-
ref: O(
|
|
445
|
-
...
|
|
444
|
+
ref: O(o, t),
|
|
445
|
+
...a,
|
|
446
446
|
"cmdk-list": "",
|
|
447
447
|
role: "listbox",
|
|
448
448
|
tabIndex: -1,
|
|
@@ -454,17 +454,17 @@ var $ = [
|
|
|
454
454
|
"cmdk-list-sizer": ""
|
|
455
455
|
}, c)));
|
|
456
456
|
}), st = l.forwardRef((e, t) => {
|
|
457
|
-
let { open: r, onOpenChange: i, overlayClassName:
|
|
457
|
+
let { open: r, onOpenChange: i, overlayClassName: a, contentClassName: o, container: d, ...m } = e;
|
|
458
458
|
return l.createElement(Me, {
|
|
459
459
|
open: r,
|
|
460
460
|
onOpenChange: i
|
|
461
461
|
}, l.createElement(De, { container: d }, l.createElement(Ne, {
|
|
462
462
|
"cmdk-overlay": "",
|
|
463
|
-
className:
|
|
463
|
+
className: a
|
|
464
464
|
}), l.createElement(Pe, {
|
|
465
465
|
"aria-label": e.label,
|
|
466
466
|
"cmdk-dialog": "",
|
|
467
|
-
className:
|
|
467
|
+
className: o
|
|
468
468
|
}, l.createElement(ke, {
|
|
469
469
|
ref: t,
|
|
470
470
|
...m
|
|
@@ -475,20 +475,20 @@ var $ = [
|
|
|
475
475
|
"cmdk-empty": "",
|
|
476
476
|
role: "presentation"
|
|
477
477
|
}) : null), ft = l.forwardRef((e, t) => {
|
|
478
|
-
let { progress: r, children: i, label:
|
|
478
|
+
let { progress: r, children: i, label: a = "Loading...", ...o } = e;
|
|
479
479
|
return l.createElement($.div, {
|
|
480
480
|
ref: t,
|
|
481
|
-
...
|
|
481
|
+
...o,
|
|
482
482
|
"cmdk-loading": "",
|
|
483
483
|
role: "progressbar",
|
|
484
484
|
"aria-valuenow": r,
|
|
485
485
|
"aria-valuemin": 0,
|
|
486
486
|
"aria-valuemax": 100,
|
|
487
|
-
"aria-label":
|
|
487
|
+
"aria-label": a
|
|
488
488
|
}, B(e, (d) => l.createElement("div", { "aria-hidden": !0 }, d)));
|
|
489
489
|
}), M = Object.assign(ke, {
|
|
490
490
|
List: dt,
|
|
491
|
-
Item:
|
|
491
|
+
Item: ot,
|
|
492
492
|
Input: ct,
|
|
493
493
|
Group: it,
|
|
494
494
|
Separator: ut,
|
|
@@ -522,29 +522,29 @@ function V(e) {
|
|
|
522
522
|
return t.current === void 0 && (t.current = e()), t;
|
|
523
523
|
}
|
|
524
524
|
function A(e) {
|
|
525
|
-
let t =
|
|
525
|
+
let t = oe(), r = () => e(t.snapshot());
|
|
526
526
|
return l.useSyncExternalStore(t.subscribe, r, r);
|
|
527
527
|
}
|
|
528
528
|
function Ie(e, t, r, i = []) {
|
|
529
|
-
let
|
|
529
|
+
let a = l.useRef(), o = T();
|
|
530
530
|
return P(() => {
|
|
531
531
|
var d;
|
|
532
532
|
let m = (() => {
|
|
533
533
|
var c;
|
|
534
534
|
for (let p of r) {
|
|
535
535
|
if (typeof p == "string") return p.trim();
|
|
536
|
-
if (typeof p == "object" && "current" in p) return p.current ? (c = p.current.textContent) == null ? void 0 : c.trim() :
|
|
536
|
+
if (typeof p == "object" && "current" in p) return p.current ? (c = p.current.textContent) == null ? void 0 : c.trim() : a.current;
|
|
537
537
|
}
|
|
538
538
|
})(), g = i.map((c) => c.trim());
|
|
539
|
-
|
|
540
|
-
}),
|
|
539
|
+
o.value(e, m, g), (d = t.current) == null || d.setAttribute(L, m), a.current = m;
|
|
540
|
+
}), a;
|
|
541
541
|
}
|
|
542
542
|
var gt = () => {
|
|
543
543
|
let [e, t] = l.useState(), r = V(() => /* @__PURE__ */ new Map());
|
|
544
544
|
return P(() => {
|
|
545
545
|
r.current.forEach((i) => i()), r.current = /* @__PURE__ */ new Map();
|
|
546
|
-
}, [e]), (i,
|
|
547
|
-
r.current.set(i,
|
|
546
|
+
}, [e]), (i, a) => {
|
|
547
|
+
r.current.set(i, a), t({});
|
|
548
548
|
};
|
|
549
549
|
};
|
|
550
550
|
function ht(e) {
|
|
@@ -572,15 +572,15 @@ function At({ className: e, ...t }) {
|
|
|
572
572
|
...t
|
|
573
573
|
});
|
|
574
574
|
}
|
|
575
|
-
function $t({ title: e = "Command Palette", description: t = "Search for a command to run...", children: r, className: i, showCloseButton:
|
|
575
|
+
function $t({ title: e = "Command Palette", description: t = "Search for a command to run...", children: r, className: i, showCloseButton: a = !1, ...o }) {
|
|
576
576
|
return /* @__PURE__ */ W(je, {
|
|
577
|
-
...
|
|
577
|
+
...o,
|
|
578
578
|
children: [/* @__PURE__ */ W(Fe, {
|
|
579
579
|
className: "sr-only",
|
|
580
580
|
children: [/* @__PURE__ */ w(Oe, { children: e }), /* @__PURE__ */ w(Ve, { children: t })]
|
|
581
581
|
}), /* @__PURE__ */ w(Le, {
|
|
582
582
|
className: I("top-1/3 translate-y-0 overflow-hidden rounded-4xl! p-0", i),
|
|
583
|
-
showCloseButton:
|
|
583
|
+
showCloseButton: a,
|
|
584
584
|
children: r
|
|
585
585
|
})]
|
|
586
586
|
});
|