@adea-ai/ui 0.106.1 → 0.107.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/dist/components/composites/appearance-editor/appearance-editor.d.ts +9 -3
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +61 -29
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-types.d.ts +2 -0
- package/dist/components/composites/appearance-editor/appearance-types.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/index.d.ts +1 -1
- package/dist/components/composites/appearance-editor/index.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/index.js +2 -2
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.js +9 -5
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.js +2 -2
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js +3 -3
- package/dist/components/ui/context-menu/context-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +7 -4
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/kbd/kbd.js +2 -2
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/menubar/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar/menubar.js +3 -3
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/popover/popover.d.ts.map +1 -1
- package/dist/components/ui/popover/popover.js +2 -2
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/select/select.js +2 -2
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts +16 -0
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.js +82 -16
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/overlay.d.ts +15 -0
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +14 -1
- package/dist/lib/overlay.js.map +1 -1
- package/dist/r/appearance-editor.json +1 -1
- package/dist/r/registry.json +1 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +55 -33
- package/dist/r/src/components/composites/appearance-editor/appearance-types.ts +2 -0
- package/dist/r/src/components/composites/appearance-editor/index.ts +1 -1
- package/dist/r/src/components/ui/badge/badge.tsx +9 -5
- package/dist/r/src/components/ui/combobox/combobox.tsx +2 -1
- package/dist/r/src/components/ui/context-menu/context-menu.tsx +3 -0
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +9 -0
- package/dist/r/src/components/ui/kbd/kbd.tsx +2 -2
- package/dist/r/src/components/ui/menubar/menubar.tsx +3 -0
- package/dist/r/src/components/ui/popover/popover.tsx +8 -1
- package/dist/r/src/components/ui/select/select.tsx +2 -1
- package/dist/r/src/components/ui/sheet/sheet.tsx +78 -15
- package/dist/r/src/lib/overlay.ts +14 -0
- package/dist/r/src/styles/base.css +35 -0
- package/dist/r/src/styles/theme.css +0 -15
- package/package.json +1 -1
- package/registry.json +1 -1
- package/src/components/composites/appearance-editor/appearance-editor.tsx +55 -33
- package/src/components/composites/appearance-editor/appearance-types.ts +2 -0
- package/src/components/composites/appearance-editor/index.ts +1 -1
- package/src/components/ui/badge/badge.tsx +9 -5
- package/src/components/ui/combobox/combobox.tsx +2 -1
- package/src/components/ui/context-menu/context-menu.tsx +3 -0
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +9 -0
- package/src/components/ui/kbd/kbd.tsx +2 -2
- package/src/components/ui/menubar/menubar.tsx +3 -0
- package/src/components/ui/popover/popover.tsx +8 -1
- package/src/components/ui/select/select.tsx +2 -1
- package/src/components/ui/sheet/sheet.tsx +78 -15
- package/src/lib/overlay.ts +14 -0
- package/src/styles/base.css +35 -0
- package/src/styles/theme.css +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjF,OAAO,KAAK,EAAY,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjF,OAAO,KAAK,EAAY,cAAc,EAAE,MAAM,UAAU,CAAA;AA2BxD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,kCAQ7E;AAqED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,OAAO,CAAC,kCA8D5F;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,MAAM,CAAC,kCAE1F;AAED,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,OAAO,CAAC,GAAG;IAC1F,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gGAAgG;IAChG,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,kCAqBlE;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,cAAc,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";
|
|
2
|
-
import { destructiveMenuItem, menuItem, menuLabel, menuSeparator, overlayMotion, overlaySurface } from "../../../lib/overlay.js";
|
|
2
|
+
import { destructiveMenuItem, menuItem, menuLabel, menuSeparator, overlayMotion, overlaySurface, topLayerProps } from "../../../lib/overlay.js";
|
|
3
3
|
import { createComponent, insert, memo, mergeProps, spread, template } from "solid-js/web";
|
|
4
4
|
import { Check, ChevronRight, Circle } from "lucide-solid";
|
|
5
5
|
import { createContext, splitProps, useContext } from "solid-js";
|
|
@@ -103,7 +103,10 @@ function DropdownMenuTrigger(props) {
|
|
|
103
103
|
if (local.disabled || event.defaultPrevented || !event.isPrimary || event.button !== 0 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
104
104
|
const trigger = event.currentTarget;
|
|
105
105
|
const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute("href");
|
|
106
|
-
if (trigger instanceof HTMLElement && !isNativeLink)
|
|
106
|
+
if (trigger instanceof HTMLElement && !isNativeLink) {
|
|
107
|
+
trigger.focus({ preventScroll: true });
|
|
108
|
+
if (event.pointerType !== "touch") event.preventDefault();
|
|
109
|
+
}
|
|
107
110
|
};
|
|
108
111
|
const onKeyDown = (event) => {
|
|
109
112
|
if (typeof local.onKeyDown === "function") local.onKeyDown(event);
|
|
@@ -143,7 +146,7 @@ function DropdownMenuContent(props) {
|
|
|
143
146
|
return local.portalMount;
|
|
144
147
|
},
|
|
145
148
|
get children() {
|
|
146
|
-
return createComponent(DropdownMenu.Content, mergeProps({ get ["class"]() {
|
|
149
|
+
return createComponent(DropdownMenu.Content, mergeProps(topLayerProps, { get ["class"]() {
|
|
147
150
|
return cn(overlaySurface, overlayMotion, "z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden", "p-1", local.class);
|
|
148
151
|
} }, rest, { get children() {
|
|
149
152
|
return [memo(() => memo(() => !!!local.hideArrow)() && createComponent(DropdownMenu.Arrow, {
|
|
@@ -266,7 +269,7 @@ function DropdownMenuSubTrigger(props) {
|
|
|
266
269
|
function DropdownMenuSubContent(props) {
|
|
267
270
|
const [local, rest] = splitProps(props, ["class"]);
|
|
268
271
|
return createComponent(DropdownMenu.Portal, { get children() {
|
|
269
|
-
return createComponent(DropdownMenu.SubContent, mergeProps({ get ["class"]() {
|
|
272
|
+
return createComponent(DropdownMenu.SubContent, mergeProps(topLayerProps, { get ["class"]() {
|
|
270
273
|
return cn(overlaySurface, overlayMotion, "z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden", "p-1", local.class);
|
|
271
274
|
} }, rest));
|
|
272
275
|
} });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","names":["DropdownMenu","KobalteDropdownMenu","Check","ChevronRight","Circle","Accessor","ComponentProps","createContext","splitProps","useContext","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","popoverArrow","cn","MenuOrientation","DropdownMenuOrientationContext","HandlerEvent","Handler","args","Arguments","DropdownMenuTriggerKeyEvent","NonNullable","Trigger","DropdownMenuTriggerPointerEvent","props","local","rest","orientation","_$createComponent","Provider","value","children","_$mergeProps","modal","SCROLLABLE_OVERFLOW","OVERFLOW_PROPERTIES","const","OverflowProperty","OverflowDeclaration","Readonly","property","priority","readInlineOverflow","element","HTMLElement","map","style","getPropertyValue","getPropertyPriority","declarationsMatch","declarations","every","bypassUnboundedScrollLookup","trigger","scrollRoot","document","scrollingElement","documentElement","window","getComputedStyle","overflow","temporaryStyles","Array","original","applied","parent","parentElement","computed","overflowX","overflowY","test","setProperty","push","length","queueMicrotask","isConnected","removeProperty","DropdownMenuTrigger","inheritedOrientation","onPointerDown","event","disabled","defaultPrevented","isPrimary","button","altKey","ctrlKey","metaKey","shiftKey","currentTarget","isNativeLink","HTMLAnchorElement","hasAttribute","focus","preventScroll","onKeyDown","menubarOrientation","closest","getAttribute","openingArrow","includes","key","DropdownMenuPortal","Portal","DropdownMenuContentProps","Content","hideArrow","portalMount","DropdownMenuContent","mount","class","_$memo","Arrow","DropdownMenuItem","Item","variant","shortcut","keyshortcuts","aria-keyshortcuts","_el$","_tmpl$","_$insert","DropdownMenuShortcut","_el$2","_tmpl$2","_$spread","DropdownMenuCheckboxItem","CheckboxItem","ItemIndicator","DropdownMenuRadioGroup","RadioGroup","DropdownMenuRadioItem","RadioItem","DropdownMenuLabel","GroupLabel","DropdownMenuGroup","Group","DropdownMenuSeparator","Separator","DropdownMenuSub","Sub","DropdownMenuSubTrigger","SubTrigger","DropdownMenuSubContent","SubContent","DropdownMenu","_$createComponent","KobalteDropdownMenu","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport { createContext, splitProps, useContext } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\ntype MenuOrientation = 'horizontal' | 'vertical'\nconst DropdownMenuOrientationContext = createContext<Accessor<MenuOrientation | undefined>>()\ntype HandlerEvent<Handler> = Handler extends (...args: infer Arguments) => void\n ? Arguments[0]\n : never\ntype DropdownMenuTriggerKeyEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onKeyDown']>\n>\ntype DropdownMenuTriggerPointerEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onPointerDown']>\n>\n\n/**\n * DropdownMenu.\n *\n * A list of actions on a trigger, with radio groups for persistent choices\n * that fit naturally in a compact menu. Use Select for form inputs whose\n * selected value needs the field-style control, and Popover for arbitrary\n * content.\n *\n * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving\n * highlight, Escape to close and return focus — which is exactly what a\n * hand-rolled `div` with click handlers gets wrong.\n * Menus are nonmodal by default so their generated focus guards do not become\n * invalid direct children of the ARIA menu. Set `modal` explicitly when the\n * surrounding interaction needs modal containment.\n *\n * The `destructive` variant marks the row with a status-coloured edge and\n * highlighted tint while keeping its label on the body foreground. Pairing it\n * with an AlertDialog is the caller's job.\n */\nexport function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {\n const [local, rest] = splitProps(props, ['modal', 'orientation'])\n const orientation = () => local.orientation\n return (\n <DropdownMenuOrientationContext.Provider value={orientation}>\n <KobalteDropdownMenu modal={local.modal ?? false} orientation={local.orientation} {...rest} />\n </DropdownMenuOrientationContext.Provider>\n )\n}\n\nconst SCROLLABLE_OVERFLOW = /(auto|scroll)/\nconst OVERFLOW_PROPERTIES = ['overflow', 'overflow-x', 'overflow-y'] as const\n\ntype OverflowProperty = (typeof OVERFLOW_PROPERTIES)[number]\ntype OverflowDeclaration = Readonly<{\n property: OverflowProperty\n value: string\n priority: string\n}>\n\nfunction readInlineOverflow(element: HTMLElement): OverflowDeclaration[] {\n return OVERFLOW_PROPERTIES.map((property) => ({\n property,\n value: element.style.getPropertyValue(property),\n priority: element.style.getPropertyPriority(property),\n }))\n}\n\nfunction declarationsMatch(element: HTMLElement, declarations: OverflowDeclaration[]) {\n return declarations.every(\n ({ property, value, priority }) =>\n element.style.getPropertyValue(property) === value &&\n element.style.getPropertyPriority(property) === priority\n )\n}\n\nfunction bypassUnboundedScrollLookup(trigger: HTMLElement) {\n const scrollRoot = document.scrollingElement ?? document.documentElement\n if (window.getComputedStyle(scrollRoot).overflow !== 'hidden') return\n\n const temporaryStyles: Array<{\n element: HTMLElement\n original: OverflowDeclaration[]\n applied: OverflowDeclaration[]\n }> = []\n\n for (let element: HTMLElement | null = trigger; element;) {\n const parent: HTMLElement | null = element.parentElement\n if (element !== scrollRoot) {\n const computed = window.getComputedStyle(element)\n const overflow = `${computed.overflow} ${computed.overflowX} ${computed.overflowY}`\n if (SCROLLABLE_OVERFLOW.test(overflow)) {\n const original = readInlineOverflow(element)\n element.style.setProperty('overflow', 'clip', 'important')\n temporaryStyles.push({ element, original, applied: readInlineOverflow(element) })\n }\n }\n element = parent\n }\n\n if (temporaryStyles.length === 0) return\n\n // Kobalte's keyboard path synchronously walks scroll parents before it opens\n // the menu. Clipping only non-root scroll ancestors makes that walk stop at\n // the locked viewport. Restore those declarations once the event handler\n // finishes, and leave any newer owner write untouched.\n queueMicrotask(() => {\n for (const { element, original, applied } of temporaryStyles) {\n if (!element.isConnected || !declarationsMatch(element, applied)) continue\n for (const property of OVERFLOW_PROPERTIES) element.style.removeProperty(property)\n for (const { property, value, priority } of original) {\n if (value) element.style.setProperty(property, value, priority)\n }\n }\n })\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>) {\n const inheritedOrientation = useContext(DropdownMenuOrientationContext)\n const [local, rest] = splitProps(props, ['disabled', 'onKeyDown', 'onPointerDown'])\n const onPointerDown = (event: DropdownMenuTriggerPointerEvent) => {\n if (typeof local.onPointerDown === 'function') local.onPointerDown(event)\n else if (local.onPointerDown) local.onPointerDown[0](local.onPointerDown[1], event)\n\n // WebKit can leave focus on a previous control when a native button gets\n // a pointer click. Focus the trigger before Kobalte opens the menu so an\n // enclosing modal focus scope does not restore focus and dismiss the menu.\n if (\n local.disabled ||\n event.defaultPrevented ||\n !event.isPrimary ||\n event.button !== 0 ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n ) {\n return\n }\n const trigger = event.currentTarget\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (trigger instanceof HTMLElement && !isNativeLink) {\n trigger.focus({ preventScroll: true })\n }\n }\n const onKeyDown = (event: DropdownMenuTriggerKeyEvent) => {\n // Kobalte's MenuTrigger does not consult defaultPrevented before its own\n // open-key handling. Preserve its existing callback behavior; this wrapper\n // only makes the pre-open scroll-parent lookup terminate.\n if (typeof local.onKeyDown === 'function') local.onKeyDown(event)\n else if (local.onKeyDown) local.onKeyDown[0](local.onKeyDown[1], event)\n\n if (local.disabled) return\n const trigger = event.currentTarget\n if (!(trigger instanceof HTMLElement)) return\n const menubarOrientation = trigger.closest('[role=\"menubar\"]')?.getAttribute('aria-orientation')\n const orientation =\n inheritedOrientation?.() ?? (menubarOrientation === 'vertical' ? 'vertical' : 'horizontal')\n const openingArrow = orientation === 'horizontal' ? 'ArrowDown' : 'ArrowRight'\n if (!['Enter', ' ', openingArrow].includes(event.key)) return\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (isNativeLink && (event.key === 'Enter' || event.key === ' ')) return\n bypassUnboundedScrollLookup(trigger)\n }\n\n return (\n <KobalteDropdownMenu.Trigger\n {...rest}\n disabled={local.disabled}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n />\n )\n}\n\nexport function DropdownMenuPortal(props: ComponentProps<typeof KobalteDropdownMenu.Portal>) {\n return <KobalteDropdownMenu.Portal {...props} />\n}\n\nexport type DropdownMenuContentProps = ComponentProps<typeof KobalteDropdownMenu.Content> & {\n hideArrow?: boolean\n /** Mount under an owner element such as a modal, keeping the menu in its accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function DropdownMenuContent(props: DropdownMenuContentProps) {\n const [local, rest] = splitProps(props, ['class', 'hideArrow', 'children', 'portalMount'])\n\n return (\n <KobalteDropdownMenu.Portal mount={local.portalMount}>\n <KobalteDropdownMenu.Content\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n {!local.hideArrow && <KobalteDropdownMenu.Arrow aria-hidden=\"true\" class={popoverArrow} />}\n {local.children}\n </KobalteDropdownMenu.Content>\n </KobalteDropdownMenu.Portal>\n )\n}\n\nexport function DropdownMenuItem(\n props: ComponentProps<typeof KobalteDropdownMenu.Item> & {\n /** Colour the row as a destructive action. Confirm it separately. */\n variant?: 'default' | 'destructive'\n /** Draw a shortcut hint at the trailing edge of the row. */\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+E`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n\n return (\n <KobalteDropdownMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteDropdownMenu.Item>\n )\n}\n\n/**\n * The chord drawn at a row's trailing edge.\n *\n * A component as well as the `shortcut` prop on an item, because a caller composing\n * a row by hand needs the same treatment — and because the alternative is every\n * caller inventing the same mono-and-dimmed span.\n *\n * The glyphs are decorative: the span is `aria-hidden` and the parseable chord\n * belongs in the row's `aria-keyshortcuts`, so the item's accessible name stays\n * exactly its label.\n */\nexport function DropdownMenuShortcut(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n aria-hidden=\"true\"\n class={cn('text-muted-foreground ms-auto font-code text-code tracking-widest', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DropdownMenuCheckboxItem(\n props: ComponentProps<typeof KobalteDropdownMenu.CheckboxItem>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteDropdownMenu.ItemIndicator\n data-slot=\"dropdown-menu-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.CheckboxItem>\n )\n}\n\nexport function DropdownMenuRadioGroup(\n props: ComponentProps<typeof KobalteDropdownMenu.RadioGroup>\n) {\n return <KobalteDropdownMenu.RadioGroup {...props} />\n}\n\nexport function DropdownMenuRadioItem(props: ComponentProps<typeof KobalteDropdownMenu.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n {/* The indicator reads in the accent, like every other selected state in\n the system — a canvas-colored dot on a checked row reads as decoration. */}\n <KobalteDropdownMenu.ItemIndicator\n data-slot=\"dropdown-menu-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Circle class=\"size-2 fill-current\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.RadioItem>\n )\n}\n\n/**\n * The caption of a `DropdownMenuGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function DropdownMenuLabel(props: ComponentProps<typeof KobalteDropdownMenu.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function DropdownMenuGroup(props: ComponentProps<typeof KobalteDropdownMenu.Group>) {\n return <KobalteDropdownMenu.Group {...props} />\n}\n\nexport function DropdownMenuSeparator(props: ComponentProps<typeof KobalteDropdownMenu.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof KobalteDropdownMenu.Sub>) {\n return <KobalteDropdownMenu.Sub {...props} />\n}\n\nexport function DropdownMenuSubTrigger(\n props: ComponentProps<typeof KobalteDropdownMenu.SubTrigger>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteDropdownMenu.SubTrigger>\n )\n}\n\nexport function DropdownMenuSubContent(\n props: ComponentProps<typeof KobalteDropdownMenu.SubContent>\n) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteDropdownMenu.Portal>\n <KobalteDropdownMenu.SubContent\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteDropdownMenu.Portal>\n )\n}\n"],"mappings":";;;;;;;;;AAiBA,IAAMoB,iCAAiCb,cAAqD;;;;;;;;;;;;;;;;;;;;AA8B5F,SAAgBP,eAAa6B,OAAmD;CAC9E,MAAM,CAACC,OAAOC,QAAQvB,WAAWqB,OAAO,CAAC,SAAS,aAAa,CAAC;CAChE,MAAMG,oBAAoBF,MAAME;CAChC,OAAAC,gBACGb,+BAA+Bc,UAAQ;EAACC,OAAOH;EAAW,IAAAI,WAAA;GAAA,OAAAH,gBACxDhC,cAAmBoC,WAAA;IAAA,IAACC,QAAK;KAAA,OAAER,MAAMQ,SAAS;IAAK;IAAA,IAAEN,cAAW;KAAA,OAAEF,MAAME;IAAW;GAAA,GAAMD,IAAI,CAAA;EAAA;CAAA,CAAA;AAGhG;AAEA,IAAMQ,sBAAsB;AAC5B,IAAMC,sBAAsB;CAAC;CAAY;CAAc;AAAY;AASnE,SAASO,mBAAmBC,SAA6C;CACvE,OAAOR,oBAAoBU,KAAKL,cAAc;EAC5CA;EACAV,OAAOa,QA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,OACA;CACA,MAAM,CAACC,OAAOC,QAAQvB,WAAWqB,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,OAAAI,gBACGhC,aAAoBkJ,YAAU9G,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQnB,GAAGN,UAAUkB,MAAMqF,KAAK;CAAC,EAAA,GAAMpF,MAAI,EAAA,IAAAK,WAAA;EAAA,OAAA,CAAAgF,WACvEtF,MAAMM,QAAQ,GAAAH,gBACd9B,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAGnB;AAEA,SAAgBiJ,uBACdvH,OACA;CACA,MAAM,CAACC,OAAOC,QAAQvB,WAAWqB,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAI,gBACGhC,aAAoB2G,QAAM,EAAA,IAAAxE,WAAA;EAAA,OAAAH,gBACxBhC,aAAoBoJ,YAAUhH,WAAA,EAAA,KAAA,WAAA;GAAA,OACtBnB,GACLF,gBACAD,eACA,yFAAA,OAEAe,MAAMqF,KACR;EAAC,EAAA,GACGpF,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","names":["DropdownMenu","KobalteDropdownMenu","Check","ChevronRight","Circle","Accessor","ComponentProps","createContext","splitProps","useContext","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","popoverArrow","topLayerProps","cn","MenuOrientation","DropdownMenuOrientationContext","HandlerEvent","Handler","args","Arguments","DropdownMenuTriggerKeyEvent","NonNullable","Trigger","DropdownMenuTriggerPointerEvent","props","local","rest","orientation","_$createComponent","Provider","value","children","_$mergeProps","modal","SCROLLABLE_OVERFLOW","OVERFLOW_PROPERTIES","const","OverflowProperty","OverflowDeclaration","Readonly","property","priority","readInlineOverflow","element","HTMLElement","map","style","getPropertyValue","getPropertyPriority","declarationsMatch","declarations","every","bypassUnboundedScrollLookup","trigger","scrollRoot","document","scrollingElement","documentElement","window","getComputedStyle","overflow","temporaryStyles","Array","original","applied","parent","parentElement","computed","overflowX","overflowY","test","setProperty","push","length","queueMicrotask","isConnected","removeProperty","DropdownMenuTrigger","inheritedOrientation","onPointerDown","event","disabled","defaultPrevented","isPrimary","button","altKey","ctrlKey","metaKey","shiftKey","currentTarget","isNativeLink","HTMLAnchorElement","hasAttribute","focus","preventScroll","pointerType","preventDefault","onKeyDown","menubarOrientation","closest","getAttribute","openingArrow","includes","key","DropdownMenuPortal","Portal","DropdownMenuContentProps","Content","hideArrow","portalMount","DropdownMenuContent","mount","class","_$memo","Arrow","DropdownMenuItem","Item","variant","shortcut","keyshortcuts","aria-keyshortcuts","_el$","_tmpl$","_$insert","DropdownMenuShortcut","_el$2","_tmpl$2","_$spread","DropdownMenuCheckboxItem","CheckboxItem","ItemIndicator","DropdownMenuRadioGroup","RadioGroup","DropdownMenuRadioItem","RadioItem","DropdownMenuLabel","GroupLabel","DropdownMenuGroup","Group","DropdownMenuSeparator","Separator","DropdownMenuSub","Sub","DropdownMenuSubTrigger","SubTrigger","DropdownMenuSubContent","SubContent","DropdownMenu","_$createComponent","KobalteDropdownMenu","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport { createContext, splitProps, useContext } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\ntype MenuOrientation = 'horizontal' | 'vertical'\nconst DropdownMenuOrientationContext = createContext<Accessor<MenuOrientation | undefined>>()\ntype HandlerEvent<Handler> = Handler extends (...args: infer Arguments) => void\n ? Arguments[0]\n : never\ntype DropdownMenuTriggerKeyEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onKeyDown']>\n>\ntype DropdownMenuTriggerPointerEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onPointerDown']>\n>\n\n/**\n * DropdownMenu.\n *\n * A list of actions on a trigger, with radio groups for persistent choices\n * that fit naturally in a compact menu. Use Select for form inputs whose\n * selected value needs the field-style control, and Popover for arbitrary\n * content.\n *\n * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving\n * highlight, Escape to close and return focus — which is exactly what a\n * hand-rolled `div` with click handlers gets wrong.\n * Menus are nonmodal by default so their generated focus guards do not become\n * invalid direct children of the ARIA menu. Set `modal` explicitly when the\n * surrounding interaction needs modal containment.\n *\n * The `destructive` variant marks the row with a status-coloured edge and\n * highlighted tint while keeping its label on the body foreground. Pairing it\n * with an AlertDialog is the caller's job.\n */\nexport function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {\n const [local, rest] = splitProps(props, ['modal', 'orientation'])\n const orientation = () => local.orientation\n return (\n <DropdownMenuOrientationContext.Provider value={orientation}>\n <KobalteDropdownMenu modal={local.modal ?? false} orientation={local.orientation} {...rest} />\n </DropdownMenuOrientationContext.Provider>\n )\n}\n\nconst SCROLLABLE_OVERFLOW = /(auto|scroll)/\nconst OVERFLOW_PROPERTIES = ['overflow', 'overflow-x', 'overflow-y'] as const\n\ntype OverflowProperty = (typeof OVERFLOW_PROPERTIES)[number]\ntype OverflowDeclaration = Readonly<{\n property: OverflowProperty\n value: string\n priority: string\n}>\n\nfunction readInlineOverflow(element: HTMLElement): OverflowDeclaration[] {\n return OVERFLOW_PROPERTIES.map((property) => ({\n property,\n value: element.style.getPropertyValue(property),\n priority: element.style.getPropertyPriority(property),\n }))\n}\n\nfunction declarationsMatch(element: HTMLElement, declarations: OverflowDeclaration[]) {\n return declarations.every(\n ({ property, value, priority }) =>\n element.style.getPropertyValue(property) === value &&\n element.style.getPropertyPriority(property) === priority\n )\n}\n\nfunction bypassUnboundedScrollLookup(trigger: HTMLElement) {\n const scrollRoot = document.scrollingElement ?? document.documentElement\n if (window.getComputedStyle(scrollRoot).overflow !== 'hidden') return\n\n const temporaryStyles: Array<{\n element: HTMLElement\n original: OverflowDeclaration[]\n applied: OverflowDeclaration[]\n }> = []\n\n for (let element: HTMLElement | null = trigger; element;) {\n const parent: HTMLElement | null = element.parentElement\n if (element !== scrollRoot) {\n const computed = window.getComputedStyle(element)\n const overflow = `${computed.overflow} ${computed.overflowX} ${computed.overflowY}`\n if (SCROLLABLE_OVERFLOW.test(overflow)) {\n const original = readInlineOverflow(element)\n element.style.setProperty('overflow', 'clip', 'important')\n temporaryStyles.push({ element, original, applied: readInlineOverflow(element) })\n }\n }\n element = parent\n }\n\n if (temporaryStyles.length === 0) return\n\n // Kobalte's keyboard path synchronously walks scroll parents before it opens\n // the menu. Clipping only non-root scroll ancestors makes that walk stop at\n // the locked viewport. Restore those declarations once the event handler\n // finishes, and leave any newer owner write untouched.\n queueMicrotask(() => {\n for (const { element, original, applied } of temporaryStyles) {\n if (!element.isConnected || !declarationsMatch(element, applied)) continue\n for (const property of OVERFLOW_PROPERTIES) element.style.removeProperty(property)\n for (const { property, value, priority } of original) {\n if (value) element.style.setProperty(property, value, priority)\n }\n }\n })\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>) {\n const inheritedOrientation = useContext(DropdownMenuOrientationContext)\n const [local, rest] = splitProps(props, ['disabled', 'onKeyDown', 'onPointerDown'])\n const onPointerDown = (event: DropdownMenuTriggerPointerEvent) => {\n if (typeof local.onPointerDown === 'function') local.onPointerDown(event)\n else if (local.onPointerDown) local.onPointerDown[0](local.onPointerDown[1], event)\n\n // WebKit can leave focus on a previous control when a native button gets\n // a pointer click. Focus the trigger before Kobalte opens the menu so an\n // enclosing modal focus scope does not restore focus and dismiss the menu.\n if (\n local.disabled ||\n event.defaultPrevented ||\n !event.isPrimary ||\n event.button !== 0 ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n ) {\n return\n }\n const trigger = event.currentTarget\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (trigger instanceof HTMLElement && !isNativeLink) {\n trigger.focus({ preventScroll: true })\n // Focusing first is not enough in WebKit: the press's default mousedown\n // action runs afterwards and moves focus off a button to the nearest\n // focusable ancestor — inside a dialog, the dialog — so the menu that\n // just opened still reads focus leaving it and closes. Cancelling the\n // default keeps focus where it was put.\n if (event.pointerType !== 'touch') event.preventDefault()\n }\n }\n const onKeyDown = (event: DropdownMenuTriggerKeyEvent) => {\n // Kobalte's MenuTrigger does not consult defaultPrevented before its own\n // open-key handling. Preserve its existing callback behavior; this wrapper\n // only makes the pre-open scroll-parent lookup terminate.\n if (typeof local.onKeyDown === 'function') local.onKeyDown(event)\n else if (local.onKeyDown) local.onKeyDown[0](local.onKeyDown[1], event)\n\n if (local.disabled) return\n const trigger = event.currentTarget\n if (!(trigger instanceof HTMLElement)) return\n const menubarOrientation = trigger.closest('[role=\"menubar\"]')?.getAttribute('aria-orientation')\n const orientation =\n inheritedOrientation?.() ?? (menubarOrientation === 'vertical' ? 'vertical' : 'horizontal')\n const openingArrow = orientation === 'horizontal' ? 'ArrowDown' : 'ArrowRight'\n if (!['Enter', ' ', openingArrow].includes(event.key)) return\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (isNativeLink && (event.key === 'Enter' || event.key === ' ')) return\n bypassUnboundedScrollLookup(trigger)\n }\n\n return (\n <KobalteDropdownMenu.Trigger\n {...rest}\n disabled={local.disabled}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n />\n )\n}\n\nexport function DropdownMenuPortal(props: ComponentProps<typeof KobalteDropdownMenu.Portal>) {\n return <KobalteDropdownMenu.Portal {...props} />\n}\n\nexport type DropdownMenuContentProps = ComponentProps<typeof KobalteDropdownMenu.Content> & {\n hideArrow?: boolean\n /** Mount under an owner element such as a modal, keeping the menu in its accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function DropdownMenuContent(props: DropdownMenuContentProps) {\n const [local, rest] = splitProps(props, ['class', 'hideArrow', 'children', 'portalMount'])\n\n return (\n <KobalteDropdownMenu.Portal mount={local.portalMount}>\n <KobalteDropdownMenu.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n {!local.hideArrow && <KobalteDropdownMenu.Arrow aria-hidden=\"true\" class={popoverArrow} />}\n {local.children}\n </KobalteDropdownMenu.Content>\n </KobalteDropdownMenu.Portal>\n )\n}\n\nexport function DropdownMenuItem(\n props: ComponentProps<typeof KobalteDropdownMenu.Item> & {\n /** Colour the row as a destructive action. Confirm it separately. */\n variant?: 'default' | 'destructive'\n /** Draw a shortcut hint at the trailing edge of the row. */\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+E`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n\n return (\n <KobalteDropdownMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteDropdownMenu.Item>\n )\n}\n\n/**\n * The chord drawn at a row's trailing edge.\n *\n * A component as well as the `shortcut` prop on an item, because a caller composing\n * a row by hand needs the same treatment — and because the alternative is every\n * caller inventing the same mono-and-dimmed span.\n *\n * The glyphs are decorative: the span is `aria-hidden` and the parseable chord\n * belongs in the row's `aria-keyshortcuts`, so the item's accessible name stays\n * exactly its label.\n */\nexport function DropdownMenuShortcut(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n aria-hidden=\"true\"\n class={cn('text-muted-foreground ms-auto font-code text-code tracking-widest', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DropdownMenuCheckboxItem(\n props: ComponentProps<typeof KobalteDropdownMenu.CheckboxItem>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteDropdownMenu.ItemIndicator\n data-slot=\"dropdown-menu-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.CheckboxItem>\n )\n}\n\nexport function DropdownMenuRadioGroup(\n props: ComponentProps<typeof KobalteDropdownMenu.RadioGroup>\n) {\n return <KobalteDropdownMenu.RadioGroup {...props} />\n}\n\nexport function DropdownMenuRadioItem(props: ComponentProps<typeof KobalteDropdownMenu.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n {/* The indicator reads in the accent, like every other selected state in\n the system — a canvas-colored dot on a checked row reads as decoration. */}\n <KobalteDropdownMenu.ItemIndicator\n data-slot=\"dropdown-menu-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Circle class=\"size-2 fill-current\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.RadioItem>\n )\n}\n\n/**\n * The caption of a `DropdownMenuGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function DropdownMenuLabel(props: ComponentProps<typeof KobalteDropdownMenu.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function DropdownMenuGroup(props: ComponentProps<typeof KobalteDropdownMenu.Group>) {\n return <KobalteDropdownMenu.Group {...props} />\n}\n\nexport function DropdownMenuSeparator(props: ComponentProps<typeof KobalteDropdownMenu.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof KobalteDropdownMenu.Sub>) {\n return <KobalteDropdownMenu.Sub {...props} />\n}\n\nexport function DropdownMenuSubTrigger(\n props: ComponentProps<typeof KobalteDropdownMenu.SubTrigger>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteDropdownMenu.SubTrigger>\n )\n}\n\nexport function DropdownMenuSubContent(\n props: ComponentProps<typeof KobalteDropdownMenu.SubContent>\n) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteDropdownMenu.Portal>\n <KobalteDropdownMenu.SubContent\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteDropdownMenu.Portal>\n )\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAMqB,iCAAiCd,cAAqD;;;;;;;;;;;;;;;;;;;;AA8B5F,SAAgBP,eAAa8B,OAAmD;CAC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,EAAA,GACGtF,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
|
|
@@ -21,10 +21,10 @@ var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=kbd-group>`);
|
|
|
21
21
|
* `KbdGroup` exists because a shortcut is a sequence: typing `⌘` then `K`
|
|
22
22
|
* needs a gap between them that is a layout concern, not punctuation.
|
|
23
23
|
*/
|
|
24
|
-
var kbdVariants = cva("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none", {
|
|
24
|
+
var kbdVariants = cva("bg-muted text-muted-foreground pointer-events-none inline-flex min-h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none", {
|
|
25
25
|
variants: { size: {
|
|
26
26
|
default: "",
|
|
27
|
-
compact: "h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none"
|
|
27
|
+
compact: "min-h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none"
|
|
28
28
|
} },
|
|
29
29
|
defaultVariants: { size: "default" }
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd.js","names":["ComponentProps","For","splitProps","cva","VariantProps","cn","kbdVariants","variants","size","default","compact","defaultVariants","KbdSize","NonNullable","Kbd","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","kbdGroupVariants","KbdGroup","_el$2","_tmpl$2","kbdChordKeys","keys","KbdChordProps","Omit","KbdChord","_$createComponent","children","each","key","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/ui/kbd/kbd.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Kbd.\n *\n * A keyboard key, in the order the user presses them. The element is a real\n * `<kbd>` so the semantics survive copy-paste, and the mono face is what makes\n * a shortcut visually distinct from the sentence around it.\n *\n * `size=\"compact\"` exists for the dense rows a default cap would outweigh — a\n * rail search row, a sidebar shortcut hint. It drops a height rung, and it\n * lightens the fill and weight with it because at that size a solid muted cap\n * reads heavier than the row text it sits in. The default rendering is every\n * cap that is not inside such a row, and it is untouched by the rung.\n *\n * `KbdGroup` exists because a shortcut is a sequence: typing `⌘` then `K`\n * needs a gap between them that is a layout concern, not punctuation.\n */\nexport const kbdVariants = cva(\n 'bg-muted text-muted-foreground pointer-events-none inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none',\n {\n variants: {\n size: {\n default: '',\n compact: 'h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n)\n\nexport type KbdSize = NonNullable<VariantProps<typeof kbdVariants>['size']>\n\nexport function Kbd(props: ComponentProps<'kbd'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <kbd data-slot=\"kbd\" class={cn(kbdVariants({ size: local.size }), local.class)} {...rest} />\n )\n}\n\nexport const kbdGroupVariants = cva('inline-flex items-center gap-1', {\n variants: {\n size: {\n default: '',\n /** The gap is what separates caps, so it tightens with them. */\n compact: 'gap-0.5',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n})\n\nexport function KbdGroup(props: ComponentProps<'span'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <span\n data-slot=\"kbd-group\"\n class={cn(kbdGroupVariants({ size: local.size }), local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * Split a written chord into one entry per key cap. Every character is a key:\n * `⌘K` renders as `⌘` + `K`, and a longer chord like `⇧⌘P` stays three caps\n * wide, which matches how the system draws chords in menus.\n */\nexport function kbdChordKeys(keys: string): string[] {\n return [...keys]\n}\n\nexport type KbdChordProps = Omit<ComponentProps<'span'>, 'children'> & {\n /** The chord as it is drawn, e.g. `\"⌘K\"` or `\"⇧⌘P\"`. One cap per character. */\n keys: string\n size?: KbdSize\n}\n\n/**\n * KbdChord.\n *\n * A written chord drawn as caps, one per character. Decoration only: the\n * composition renders `aria-hidden`, so the accessible name and the parseable\n * `aria-keyshortcuts` stay on the control the chord belongs to. That is why\n * there is no children — the chord says what was drawn, nothing more.\n */\nexport function KbdChord(props: KbdChordProps) {\n const [local, rest] = splitProps(props, ['keys', 'size', 'class'])\n\n return (\n <KbdGroup {...rest} size={local.size} class={local.class} aria-hidden=\"true\">\n <For each={kbdChordKeys(local.keys)}>{(key) => <Kbd size={local.size}>{key}</Kbd>}</For>\n </KbdGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAaM,cAAcH,IACzB,
|
|
1
|
+
{"version":3,"file":"kbd.js","names":["ComponentProps","For","splitProps","cva","VariantProps","cn","kbdVariants","variants","size","default","compact","defaultVariants","KbdSize","NonNullable","Kbd","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","kbdGroupVariants","KbdGroup","_el$2","_tmpl$2","kbdChordKeys","keys","KbdChordProps","Omit","KbdChord","_$createComponent","children","each","key","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/ui/kbd/kbd.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Kbd.\n *\n * A keyboard key, in the order the user presses them. The element is a real\n * `<kbd>` so the semantics survive copy-paste, and the mono face is what makes\n * a shortcut visually distinct from the sentence around it.\n *\n * `size=\"compact\"` exists for the dense rows a default cap would outweigh — a\n * rail search row, a sidebar shortcut hint. It drops a height rung, and it\n * lightens the fill and weight with it because at that size a solid muted cap\n * reads heavier than the row text it sits in. The default rendering is every\n * cap that is not inside such a row, and it is untouched by the rung.\n *\n * `KbdGroup` exists because a shortcut is a sequence: typing `⌘` then `K`\n * needs a gap between them that is a layout concern, not punctuation.\n */\nexport const kbdVariants = cva(\n 'bg-muted text-muted-foreground pointer-events-none inline-flex min-h-5 min-w-5 items-center justify-center gap-1 rounded-sm border border-border px-1 font-code text-code font-medium select-none',\n {\n variants: {\n size: {\n default: '',\n compact: 'min-h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n)\n\nexport type KbdSize = NonNullable<VariantProps<typeof kbdVariants>['size']>\n\nexport function Kbd(props: ComponentProps<'kbd'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <kbd data-slot=\"kbd\" class={cn(kbdVariants({ size: local.size }), local.class)} {...rest} />\n )\n}\n\nexport const kbdGroupVariants = cva('inline-flex items-center gap-1', {\n variants: {\n size: {\n default: '',\n /** The gap is what separates caps, so it tightens with them. */\n compact: 'gap-0.5',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n})\n\nexport function KbdGroup(props: ComponentProps<'span'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <span\n data-slot=\"kbd-group\"\n class={cn(kbdGroupVariants({ size: local.size }), local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * Split a written chord into one entry per key cap. Every character is a key:\n * `⌘K` renders as `⌘` + `K`, and a longer chord like `⇧⌘P` stays three caps\n * wide, which matches how the system draws chords in menus.\n */\nexport function kbdChordKeys(keys: string): string[] {\n return [...keys]\n}\n\nexport type KbdChordProps = Omit<ComponentProps<'span'>, 'children'> & {\n /** The chord as it is drawn, e.g. `\"⌘K\"` or `\"⇧⌘P\"`. One cap per character. */\n keys: string\n size?: KbdSize\n}\n\n/**\n * KbdChord.\n *\n * A written chord drawn as caps, one per character. Decoration only: the\n * composition renders `aria-hidden`, so the accessible name and the parseable\n * `aria-keyshortcuts` stay on the control the chord belongs to. That is why\n * there is no children — the chord says what was drawn, nothing more.\n */\nexport function KbdChord(props: KbdChordProps) {\n const [local, rest] = splitProps(props, ['keys', 'size', 'class'])\n\n return (\n <KbdGroup {...rest} size={local.size} class={local.class} aria-hidden=\"true\">\n <For each={kbdChordKeys(local.keys)}>{(key) => <Kbd size={local.size}>{key}</Kbd>}</For>\n </KbdGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAaM,cAAcH,IACzB,qMACA;CACEI,UAAU,EACRC,MAAM;EACJC,SAAS;EACTC,SAAS;CACX,EACF;CACAC,iBAAiB,EACfH,MAAM,UACR;AACF,CACF;AAIA,SAAgBM,IAAIC,OAAmD;CACrE,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO,CAAC,QAAQ,OAAO,CAAC;CAEzD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAC8BhB,GAAGC,YAAY,EAAEE,MAAMQ,MAAMR,KAAK,CAAC,GAAGQ,MAAMM,KAAK;EAAC,EAAA,GAAML,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAE5F;AAEA,IAAaK,mBAAmBpB,IAAI,kCAAkC;CACpEI,UAAU,EACRC,MAAM;EACJC,SAAS;;EAETC,SAAS;CACX,EACF;CACAC,iBAAiB,EACfH,MAAM,UACR;AACF,CAAC;AAED,SAAgBgB,SAAST,OAAoD;CAC3E,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO,CAAC,QAAQ,OAAO,CAAC;CAEzD,cAAA;EAAA,IAAAU,QAAAC,QAAA;EAAAN,OAAAK,OAAAJ,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWhB,GAAGkB,iBAAiB,EAAEf,MAAMQ,MAAMR,KAAK,CAAC,GAAGQ,MAAMM,KAAK;EAAC,EAAA,GAC1DL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAQ;CAAA,EAAA,CAAA;AAGd;;;;;;AAOA,SAAgBE,aAAaC,MAAwB;CACnD,OAAO,CAAC,GAAGA,IAAI;AACjB;;;;;;;;;AAgBA,SAAgBG,SAAShB,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO;EAAC;EAAQ;EAAQ;CAAO,CAAC;CAEjE,OAAAiB,gBACGR,UAAQH,WAAKJ,MAAI;EAAA,IAAET,OAAI;GAAA,OAAEQ,MAAMR;EAAI;EAAA,KAAA,WAAA;GAAA,OAASQ,MAAMM;EAAK;EAAA,eAAA;EAAA,IAAAW,WAAA;GAAA,OAAAD,gBACrD/B,KAAG;IAAA,IAACiC,OAAI;KAAA,OAAEP,aAAaX,MAAMY,IAAI;IAAC;IAAAK,WAAIE,QAAGH,gBAAMlB,KAAG;KAAA,IAACN,OAAI;MAAA,OAAEQ,MAAMR;KAAI;KAAAyB,UAAGE;IAAG,CAAA;GAAO,CAAA;EAAA;CAAA,CAAA,CAAA;AAGvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/menubar/menubar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/menubar/menubar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAe9C;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,kCAWnE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,kCAE5E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,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|
|
2
|
-
import { destructiveMenuItem, menuItem, menuLabel, menuSeparator, overlayMotion, overlaySurface, popoverArrow } from "../../../lib/overlay.js";
|
|
2
|
+
import { destructiveMenuItem, menuItem, menuLabel, menuSeparator, overlayMotion, overlaySurface, popoverArrow, topLayerProps } from "../../../lib/overlay.js";
|
|
3
3
|
import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
|
|
4
4
|
import { Check, ChevronRight, Circle } from "lucide-solid";
|
|
5
5
|
import { splitProps } from "solid-js";
|
|
@@ -42,7 +42,7 @@ function MenubarTrigger(props) {
|
|
|
42
42
|
function MenubarContent(props) {
|
|
43
43
|
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
44
44
|
return createComponent(Menubar.Portal, { get children() {
|
|
45
|
-
return createComponent(Menubar.Content, mergeProps({ get ["class"]() {
|
|
45
|
+
return createComponent(Menubar.Content, mergeProps(topLayerProps, { get ["class"]() {
|
|
46
46
|
return cn(overlaySurface, overlayMotion, "z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden", "p-1", local.class);
|
|
47
47
|
} }, rest, { get children() {
|
|
48
48
|
return [createComponent(Menubar.Arrow, {
|
|
@@ -141,7 +141,7 @@ function MenubarSubTrigger(props) {
|
|
|
141
141
|
function MenubarSubContent(props) {
|
|
142
142
|
const [local, rest] = splitProps(props, ["class"]);
|
|
143
143
|
return createComponent(Menubar.Portal, { get children() {
|
|
144
|
-
return createComponent(Menubar.SubContent, mergeProps({ get ["class"]() {
|
|
144
|
+
return createComponent(Menubar.SubContent, mergeProps(topLayerProps, { get ["class"]() {
|
|
145
145
|
return cn(overlaySurface, overlayMotion, "z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden", "p-1", local.class);
|
|
146
146
|
} }, rest));
|
|
147
147
|
} });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menubar.js","names":["Menubar","KobalteMenubar","Check","ChevronRight","Circle","ComponentProps","splitProps","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","popoverArrow","cn","props","local","rest","_$createComponent","_$mergeProps","class","MenubarMenu","Menu","MenubarTrigger","Trigger","MenubarContent","Content","Portal","children","Arrow","_$memo","MenubarItem","Item","variant","shortcut","keyshortcuts","aria-keyshortcuts","_el$","_tmpl$","_$insert","MenubarCheckboxItem","CheckboxItem","ItemIndicator","MenubarRadioGroup","RadioGroup","MenubarRadioItem","RadioItem","MenubarLabel","GroupLabel","MenubarGroup","Group","MenubarSeparator","Separator","MenubarSub","Sub","MenubarSubTrigger","SubTrigger","MenubarSubContent","SubContent","Menubar","_$createComponent","KobalteMenubar","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/menubar/menubar.tsx"],"sourcesContent":["import { Menubar as KobalteMenubar } from '@kobalte/core/menubar'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Menubar.\n *\n * A persistent row of menus at the top of a surface — the desktop application\n * pattern. Each trigger opens its own menu, and the arrow keys move *between*\n * menus once one is open, which is what makes a menubar a single control rather\n * than five menus that happen to be adjacent.\n *\n * This is for a window-level command surface. For actions on one thing, use\n * DropdownMenu; a menubar on a row would be a menu pretending to be chrome.\n */\nexport function Menubar(props: ComponentProps<typeof KobalteMenubar>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar\n class={cn(\n 'flex items-center gap-0.5 rounded-md border border-border bg-card p-0.5',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * One top-level menu: a trigger and the panel it opens.\n *\n * Required, and the reason the component is not just a row of triggers — the\n * menubar's arrow keys move *between* menus, which only works when each trigger\n * belongs to a menu the bar knows about. `value` names it.\n */\nexport function MenubarMenu(props: ComponentProps<typeof KobalteMenubar.Menu>) {\n return <KobalteMenubar.Menu {...props} />\n}\n\nexport function MenubarTrigger(props: ComponentProps<typeof KobalteMenubar.Trigger>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar.Trigger\n class={cn(\n 'flex items-center rounded-sm px-2 py-1 text-sm font-medium select-none',\n 'transition-colors ease-out outline-none',\n 'data-[expanded]:bg-surface-active',\n 'data-[highlighted]:bg-surface-hover',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function MenubarContent(props: ComponentProps<typeof KobalteMenubar.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.Portal>\n <KobalteMenubar.Content\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n <KobalteMenubar.Arrow aria-hidden=\"true\" class={popoverArrow} />\n {local.children}\n </KobalteMenubar.Content>\n </KobalteMenubar.Portal>\n )\n}\n\nexport function MenubarItem(\n props: ComponentProps<typeof KobalteMenubar.Item> & {\n variant?: 'default' | 'destructive'\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+N`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n return (\n <KobalteMenubar.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteMenubar.Item>\n )\n}\n\nexport function MenubarCheckboxItem(props: ComponentProps<typeof KobalteMenubar.CheckboxItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteMenubar.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteMenubar.ItemIndicator>\n </KobalteMenubar.CheckboxItem>\n )\n}\n\nexport function MenubarRadioGroup(props: ComponentProps<typeof KobalteMenubar.RadioGroup>) {\n return <KobalteMenubar.RadioGroup {...props} />\n}\n\nexport function MenubarRadioItem(props: ComponentProps<typeof KobalteMenubar.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteMenubar.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </KobalteMenubar.ItemIndicator>\n </KobalteMenubar.RadioItem>\n )\n}\n\n/**\n * The caption of a `MenubarGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function MenubarLabel(props: ComponentProps<typeof KobalteMenubar.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteMenubar.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function MenubarGroup(props: ComponentProps<typeof KobalteMenubar.Group>) {\n return <KobalteMenubar.Group {...props} />\n}\n\nexport function MenubarSeparator(props: ComponentProps<typeof KobalteMenubar.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteMenubar.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function MenubarSub(props: ComponentProps<typeof KobalteMenubar.Sub>) {\n return <KobalteMenubar.Sub {...props} />\n}\n\nexport function MenubarSubTrigger(props: ComponentProps<typeof KobalteMenubar.SubTrigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteMenubar.SubTrigger>\n )\n}\n\nexport function MenubarSubContent(props: ComponentProps<typeof KobalteMenubar.SubContent>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar.Portal>\n <KobalteMenubar.SubContent\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteMenubar.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2BA,SAAgBA,UAAQgB,OAA8C;CACpE,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGlB,SAAcmB,WAAA,EAAA,KAAA,WAAA;EAAA,OACNL,GACL,2EACAE,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;;;;;;;;AASA,SAAgBI,YAAYN,OAAmD;CAC7E,OAAAG,gBAAQlB,QAAesB,MAASP,KAAK;AACvC;AAEA,SAAgBQ,eAAeR,OAAsD;CACnF,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGlB,QAAewB,SAAOL,WAAA,EAAA,KAAA,WAAA;EAAA,OACdL,GACL,0EACA,2CACA,qCACA,uCACA,oFACAE,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;AAEA,SAAgBQ,eAAeV,OAAsD;CACnF,MAAM,C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Z,WAAWU,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQlB,QAAeoD,WAASjC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQL,GAAGJ,eAAeM,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AAClF;AAEA,SAAgBoC,WAAWtC,OAAkD;CAC3E,OAAAG,gBAAQlB,QAAesD,KAAQvC,KAAK;AACtC;AAEA,SAAgBwC,kBAAkBxC,OAAyD;CACzF,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,SAAS,UAAU,CAAC;CAC7D,OAAAG,gBACGlB,QAAewD,YAAUrC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQL,GAAGN,UAAUQ,MAAMI,KAAK;CAAC,EAAA,GAAMH,MAAI,EAAA,IAAAW,WAAA;EAAA,OAAA,CAAAE,WAClEd,MAAMY,QAAQ,GAAAV,gBACdhB,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAGnB;AAEA,SAAgBuD,kBAAkB1C,OAAyD;CACzF,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGlB,QAAe2B,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAV,gBACnBlB,QAAe0D,YAAUvC,WAAA,EAAA,KAAA,WAAA;GAAA,OACjBL,GACLF,gBACAD,eACA,yFAAA,OAEAK,MAAMI,KACR;EAAC,EAAA,GACGH,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
|
|
1
|
+
{"version":3,"file":"menubar.js","names":["Menubar","KobalteMenubar","Check","ChevronRight","Circle","ComponentProps","splitProps","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSeparator","overlayMotion","overlaySurface","popoverArrow","topLayerProps","cn","props","local","rest","_$createComponent","_$mergeProps","class","MenubarMenu","Menu","MenubarTrigger","Trigger","MenubarContent","Content","Portal","children","Arrow","_$memo","MenubarItem","Item","variant","shortcut","keyshortcuts","aria-keyshortcuts","_el$","_tmpl$","_$insert","MenubarCheckboxItem","CheckboxItem","ItemIndicator","MenubarRadioGroup","RadioGroup","MenubarRadioItem","RadioItem","MenubarLabel","GroupLabel","MenubarGroup","Group","MenubarSeparator","Separator","MenubarSub","Sub","MenubarSubTrigger","SubTrigger","MenubarSubContent","SubContent","Menubar","_$createComponent","KobalteMenubar","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/menubar/menubar.tsx"],"sourcesContent":["import { Menubar as KobalteMenubar } from '@kobalte/core/menubar'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Menubar.\n *\n * A persistent row of menus at the top of a surface — the desktop application\n * pattern. Each trigger opens its own menu, and the arrow keys move *between*\n * menus once one is open, which is what makes a menubar a single control rather\n * than five menus that happen to be adjacent.\n *\n * This is for a window-level command surface. For actions on one thing, use\n * DropdownMenu; a menubar on a row would be a menu pretending to be chrome.\n */\nexport function Menubar(props: ComponentProps<typeof KobalteMenubar>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar\n class={cn(\n 'flex items-center gap-0.5 rounded-md border border-border bg-card p-0.5',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * One top-level menu: a trigger and the panel it opens.\n *\n * Required, and the reason the component is not just a row of triggers — the\n * menubar's arrow keys move *between* menus, which only works when each trigger\n * belongs to a menu the bar knows about. `value` names it.\n */\nexport function MenubarMenu(props: ComponentProps<typeof KobalteMenubar.Menu>) {\n return <KobalteMenubar.Menu {...props} />\n}\n\nexport function MenubarTrigger(props: ComponentProps<typeof KobalteMenubar.Trigger>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar.Trigger\n class={cn(\n 'flex items-center rounded-sm px-2 py-1 text-sm font-medium select-none',\n 'transition-colors ease-out outline-none',\n 'data-[expanded]:bg-surface-active',\n 'data-[highlighted]:bg-surface-hover',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function MenubarContent(props: ComponentProps<typeof KobalteMenubar.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.Portal>\n <KobalteMenubar.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n <KobalteMenubar.Arrow aria-hidden=\"true\" class={popoverArrow} />\n {local.children}\n </KobalteMenubar.Content>\n </KobalteMenubar.Portal>\n )\n}\n\nexport function MenubarItem(\n props: ComponentProps<typeof KobalteMenubar.Item> & {\n variant?: 'default' | 'destructive'\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+N`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'children',\n ])\n return (\n <KobalteMenubar.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteMenubar.Item>\n )\n}\n\nexport function MenubarCheckboxItem(props: ComponentProps<typeof KobalteMenubar.CheckboxItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteMenubar.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteMenubar.ItemIndicator>\n </KobalteMenubar.CheckboxItem>\n )\n}\n\nexport function MenubarRadioGroup(props: ComponentProps<typeof KobalteMenubar.RadioGroup>) {\n return <KobalteMenubar.RadioGroup {...props} />\n}\n\nexport function MenubarRadioItem(props: ComponentProps<typeof KobalteMenubar.RadioItem>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n {local.children}\n <KobalteMenubar.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </KobalteMenubar.ItemIndicator>\n </KobalteMenubar.RadioItem>\n )\n}\n\n/**\n * The caption of a `MenubarGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function MenubarLabel(props: ComponentProps<typeof KobalteMenubar.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteMenubar.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function MenubarGroup(props: ComponentProps<typeof KobalteMenubar.Group>) {\n return <KobalteMenubar.Group {...props} />\n}\n\nexport function MenubarSeparator(props: ComponentProps<typeof KobalteMenubar.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteMenubar.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function MenubarSub(props: ComponentProps<typeof KobalteMenubar.Sub>) {\n return <KobalteMenubar.Sub {...props} />\n}\n\nexport function MenubarSubTrigger(props: ComponentProps<typeof KobalteMenubar.SubTrigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <KobalteMenubar.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteMenubar.SubTrigger>\n )\n}\n\nexport function MenubarSubContent(props: ComponentProps<typeof KobalteMenubar.SubContent>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteMenubar.Portal>\n <KobalteMenubar.SubContent\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteMenubar.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BA,SAAgBA,UAAQiB,OAA8C;CACpE,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGnB,SAAcoB,WAAA,EAAA,KAAA,WAAA;EAAA,OACNL,GACL,2EACAE,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;;;;;;;;AASA,SAAgBI,YAAYN,OAAmD;CAC7E,OAAAG,gBAAQnB,QAAeuB,MAASP,KAAK;AACvC;AAEA,SAAgBQ,eAAeR,OAAsD;CACnF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGnB,QAAeyB,SAAOL,WAAA,EAAA,KAAA,WAAA;EAAA,OACdL,GACL,0EACA,2CACA,qCACA,uCACA,oFACAE,MAAMI,KACR;CAAC,EAAA,GACGH,IAAI,CAAA;AAGd;AAEA,SAAgBQ,eAAeV,OAAsD;CACnF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,SAAS,UAAU,CAAC;CAC7D,OAAAG,gBACGnB,QAAe4B,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAV,gBACn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I,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AAClF;AAEA,SAAgBoC,WAAWtC,OAAkD;CAC3E,OAAAG,gBAAQnB,QAAeuD,KAAQvC,KAAK;AACtC;AAEA,SAAgBwC,kBAAkBxC,OAAyD;CACzF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,SAAS,UAAU,CAAC;CAC7D,OAAAG,gBACGnB,QAAeyD,YAAUrC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQL,GAAGP,UAAUS,MAAMI,KAAK;CAAC,EAAA,GAAMH,MAAI,EAAA,IAAAW,WAAA;EAAA,OAAA,CAAAE,WAClEd,MAAMY,QAAQ,GAAAV,gBACdjB,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAGnB;AAEA,SAAgBwD,kBAAkB1C,OAAyD;CACzF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGnB,QAAe4B,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAV,gBACnBnB,QAAe2D,YAAUvC,WACpBN,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GACLH,gBACAD,eACA,yFAAA,OAEAM,MAAMI,KACR;EAAC,EAAA,GACGH,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAW9C;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,kCAEnE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,kCAElF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,MAAM,CAAC,kCAEhF;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,GAAG;IAChF,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,kCAqBxD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,kCAQ9E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,WAAW,CAAC,kCAQ1F;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,WAAW,CAAC,kCAG1F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
-
import { overlaySurface, popoverArrow, popoverMotion } from "../../../lib/overlay.js";
|
|
2
|
+
import { overlaySurface, popoverArrow, popoverMotion, topLayerProps } from "../../../lib/overlay.js";
|
|
3
3
|
import { createComponent, memo, mergeProps } from "solid-js/web";
|
|
4
4
|
import { splitProps } from "solid-js";
|
|
5
5
|
import { Popover } from "@kobalte/core/popover";
|
|
@@ -32,7 +32,7 @@ function PopoverContent(props) {
|
|
|
32
32
|
"children"
|
|
33
33
|
]);
|
|
34
34
|
return createComponent(Popover.Portal, { get children() {
|
|
35
|
-
return createComponent(Popover.Content, mergeProps({ get ["class"]() {
|
|
35
|
+
return createComponent(Popover.Content, mergeProps(topLayerProps, { get ["class"]() {
|
|
36
36
|
return cn(overlaySurface, popoverMotion, "z-(--z-menu) w-72 origin-(--kb-popover-content-transform-origin)", "p-1", local.class);
|
|
37
37
|
} }, rest, { get children() {
|
|
38
38
|
return [memo(() => local.children), createComponent(Popover.Arrow, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":["Popover","KobaltePopover","ComponentProps","splitProps","menuContentPadding","popoverArrow","popoverMotion","overlaySurface","cn","props","_$createComponent","PopoverTrigger","Trigger","PopoverAnchor","Anchor","PopoverContentProps","Content","hideArrow","PopoverContent","local","rest","Portal","children","_$mergeProps","class","_$memo","Arrow","PopoverTitle","Title","PopoverDescription","Description","PopoverCloseButton","CloseButton","Popover","_$createComponent","KobaltePopover","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/popover/popover.tsx"],"sourcesContent":["import { Popover as KobaltePopover } from '@kobalte/core/popover'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {
|
|
1
|
+
{"version":3,"file":"popover.js","names":["Popover","KobaltePopover","ComponentProps","splitProps","menuContentPadding","popoverArrow","popoverMotion","overlaySurface","topLayerProps","cn","props","_$createComponent","PopoverTrigger","Trigger","PopoverAnchor","Anchor","PopoverContentProps","Content","hideArrow","PopoverContent","local","rest","Portal","children","_$mergeProps","class","_$memo","Arrow","PopoverTitle","Title","PopoverDescription","Description","PopoverCloseButton","CloseButton","Popover","_$createComponent","KobaltePopover","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/popover/popover.tsx"],"sourcesContent":["import { Popover as KobaltePopover } from '@kobalte/core/popover'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport {\n menuContentPadding,\n popoverArrow,\n popoverMotion,\n overlaySurface,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Popover.\n *\n * A floating surface with arbitrary content, anchored to a control. Use it for\n * something interactive that would not fit in a menu: a small form, a colour\n * picker, a filter panel. For a list of *actions* use DropdownMenu, which\n * carries the menu keyboard contract; for a sentence of explanation use\n * Tooltip, which is not focusable and cannot hold a control.\n *\n * Kobalte handles the anchoring, collision flipping, the focus trap for modal\n * popovers, and dismissal on outside click and Escape.\n */\nexport function Popover(props: ComponentProps<typeof KobaltePopover>) {\n return <KobaltePopover {...props} />\n}\n\nexport function PopoverTrigger(props: ComponentProps<typeof KobaltePopover.Trigger>) {\n return <KobaltePopover.Trigger {...props} />\n}\n\nexport function PopoverAnchor(props: ComponentProps<typeof KobaltePopover.Anchor>) {\n return <KobaltePopover.Anchor {...props} />\n}\n\nexport type PopoverContentProps = ComponentProps<typeof KobaltePopover.Content> & {\n /** Hide the caret pointing at the trigger. */\n hideArrow?: boolean\n}\n\nexport function PopoverContent(props: PopoverContentProps) {\n const [local, rest] = splitProps(props, ['class', 'hideArrow', 'children'])\n\n return (\n <KobaltePopover.Portal>\n <KobaltePopover.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n popoverMotion,\n 'z-(--z-menu) w-72 origin-(--kb-popover-content-transform-origin)',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobaltePopover.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobaltePopover.Content>\n </KobaltePopover.Portal>\n )\n}\n\nexport function PopoverTitle(props: ComponentProps<typeof KobaltePopover.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobaltePopover.Title\n class={cn('px-2 pt-1 pb-1.5 text-sm font-medium', local.class)}\n {...rest}\n />\n )\n}\n\nexport function PopoverDescription(props: ComponentProps<typeof KobaltePopover.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobaltePopover.Description\n class={cn('text-muted-foreground px-2 pb-1.5 text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function PopoverCloseButton(props: ComponentProps<typeof KobaltePopover.CloseButton>) {\n const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EAAE,OAAO,KAAK,MAAM,CAAA;IACzC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CAC/B,CAAA;AAkBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,kCAalD;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG;IAC9E,0EAA0E;IAC1E,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,kCAwBtD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,kCAW1E;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,kCAGhF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,kCAQ5E;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAEhE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
-
import { menuItem, popoverArrow } from "../../../lib/overlay.js";
|
|
2
|
+
import { menuItem, popoverArrow, topLayerProps } from "../../../lib/overlay.js";
|
|
3
3
|
import { createComponent, memo, mergeProps } from "solid-js/web";
|
|
4
4
|
import { Check, ChevronDown, ChevronsUpDown } from "lucide-solid";
|
|
5
5
|
import { Show, splitProps } from "solid-js";
|
|
@@ -94,7 +94,7 @@ function SelectContent(props) {
|
|
|
94
94
|
return local.portalMount;
|
|
95
95
|
},
|
|
96
96
|
get children() {
|
|
97
|
-
return createComponent(Select.Content, mergeProps({ get ["class"]() {
|
|
97
|
+
return createComponent(Select.Content, mergeProps(topLayerProps, { get ["class"]() {
|
|
98
98
|
return cn("bg-popover text-popover-foreground rounded-xl border border-border shadow-lg", "z-(--z-menu) max-h-(--kb-popper-content-available-height) min-w-[8rem] origin-(--kb-select-content-transform-origin) overflow-y-auto overflow-x-hidden", "p-1", "data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "data-expanded:duration-150 data-closed:duration-100", local.class);
|
|
99
99
|
} }, rest, { get children() {
|
|
100
100
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":["Select","KobalteSelect","Check","ChevronDown","ChevronsUpDown","ComponentProps","Show","splitProps","menuContentPadding","menuItem","popoverArrow","cn","props","Option","OptGroup","_$createComponent","SelectTriggerProps","Trigger","size","hideIcon","SelectTrigger","local","rest","_$mergeProps","class","undefined","children","_$memo","when","Icon","SelectValueChildren","Value","SelectValueProps","optionLabel","option","LABEL_FIELDS","const","labelFromOption","field","value","Record","SelectValue","readLabel","state","selectedOption","SelectContentProps","Content","portalMount","HTMLElement","SelectContent","Portal","mount","Listbox","Arrow","SelectItem","Item","ItemLabel","ItemIndicator","SelectSection","Section","SelectLabel","Label","SelectChevronsUpDown","Select","_$createComponent","KobalteSelect","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import { Select as KobalteSelect } from '@kobalte/core/select'\nimport { Check, ChevronDown, ChevronsUpDown } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Select.\n *\n * A single choice from a list that is too long to show, or whose options are\n * only known at runtime. The distinction from RadioGroup is disclosure: a\n * Select hides the choices behind a click, which is right above roughly seven\n * options and wrong below it.\n *\n * `Select.Value` renders the human-readable label of the selection, not its\n * value — the reason a Select takes both `options` and `optionValue`/`optionText`\n * rather than a bare list of strings, and the reason the trigger never shows a\n * raw id.\n */\nexport function Select<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteSelect<Option, OptGroup>>\n) {\n return <KobalteSelect {...props} />\n}\n\nexport type SelectTriggerProps = ComponentProps<typeof KobalteSelect.Trigger> & {\n size?: 'sm' | 'md' | 'lg'\n /** Hide the chevron, e.g. when a caller draws its own affordance. */\n hideIcon?: boolean\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const [local, rest] = splitProps(props, ['class', 'size', 'hideIcon', 'children'])\n\n return (\n <KobalteSelect.Trigger\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': local.size === 'sm',\n 'h-control-md text-sm': local.size === 'md' || local.size === undefined,\n 'h-control-lg text-sm': local.size === 'lg',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={!local.hideIcon}>\n <KobalteSelect.Icon class=\"text-muted-foreground\">\n <ChevronDown />\n </KobalteSelect.Icon>\n </Show>\n </KobalteSelect.Trigger>\n )\n}\n\n/**\n * What the trigger shows for the current selection.\n *\n * The default renderer is the reason a single-select needs no render prop at all.\n * Kobalte's own `Value` draws *only* its children, so a bare `<SelectValue />`\n * shows the placeholder and then goes blank the moment something is chosen: the\n * value is there, nothing paints it.\n *\n * Kobalte cannot supply a default itself, because an option is the caller's type\n * — it has no way to know which field is the label. So this reads a field by\n * convention: `label`, then `name`, then `textValue`. An option shaped\n * `{ value, label }` therefore needs nothing, and anything else passes\n * `optionLabel`.\n *\n * A multiple-select still supplies its own renderer, because \"3 selected\" is a\n * summary a caller has to phrase, not something a component can guess.\n */\ntype SelectValueChildren = ComponentProps<typeof KobalteSelect.Value>['children']\n\nexport type SelectValueProps = ComponentProps<typeof KobalteSelect.Value> & {\n /**\n * Read the display text from the selected option. Supply this when the option's\n * label does not live in a field called `label`, `name` or `textValue`.\n */\n optionLabel?: (option: unknown) => string\n /** Replace the default readout entirely, for a multiple-select summary. */\n children?: SelectValueChildren\n}\n\n/** Fields a label is read from, in order. See `SelectValueProps.optionLabel`. */\nconst LABEL_FIELDS = ['label', 'name', 'textValue'] as const\n\nfunction labelFromOption(option: unknown): string {\n if (option === null || typeof option !== 'object') {\n return typeof option === 'string' ? option : ''\n }\n\n for (const field of LABEL_FIELDS) {\n const value = (option as Record<string, unknown>)[field]\n if (typeof value === 'string') return value\n }\n\n return ''\n}\n\nexport function SelectValue(props: SelectValueProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'optionLabel'])\n\n const readLabel = (state: { selectedOption: () => unknown }): string => {\n const option = state.selectedOption()\n return local.optionLabel ? local.optionLabel(option) : labelFromOption(option)\n }\n\n return (\n <KobalteSelect.Value data-slot=\"select-value\" class={cn('truncate', local.class)} {...rest}>\n {local.children ?? (readLabel as unknown as SelectValueChildren)}\n </KobalteSelect.Value>\n )\n}\n\n/**\n * The option list. The items themselves come from the root's `itemComponent`,\n * which is what makes a Select able to render a typed option rather than a\n * string; `children` here is for content above the list, such as a filter hint.\n */\nexport type SelectContentProps = ComponentProps<typeof KobalteSelect.Content> & {\n /** Keep a nested menu inside its enclosing modal's accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'portalMount'])\n\n return (\n <KobalteSelect.Portal mount={local.portalMount}>\n <KobalteSelect.Content\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--kb-popper-content-available-height) min-w-[8rem] origin-(--kb-select-content-transform-origin) overflow-y-auto overflow-x-hidden',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteSelect.Listbox class=\"flex flex-col\" />\n <KobalteSelect.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteSelect.Content>\n </KobalteSelect.Portal>\n )\n}\n\nexport function SelectItem(props: ComponentProps<typeof KobalteSelect.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteSelect.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteSelect.ItemLabel>{local.children}</KobalteSelect.ItemLabel>\n <KobalteSelect.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteSelect.ItemIndicator>\n </KobalteSelect.Item>\n )\n}\n\nexport function SelectSection(props: ComponentProps<typeof KobalteSelect.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteSelect.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\nexport function SelectLabel(props: ComponentProps<typeof KobalteSelect.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSelect.Label\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', local.class)}\n {...rest}\n />\n )\n}\n\n/** The chevron pair used when a Select is composed by hand in a field. */\nexport function SelectChevronsUpDown(props: ComponentProps<'svg'>) {\n return <ChevronsUpDown aria-hidden=\"true\" {...props} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAgBA,SACdY,OACA;CACA,OAAAG,gBAAQd,QAAkBW,KAAK;AACjC;AAQA,SAAgBQ,cAAcR,OA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AAA;GAAA,IAAA/B,WAAA;IAAA,OAAAX,gBACzBb,OAAK,EAAA,SAAA,SAAA,CAAA;GAAA;EAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAId;AAEA,SAAgBwD,cAAc9C,OAAqD;CACjF,MAAM,CAACS,OAAOC,QAAQf,WAAWK,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQd,OAAc0D,SAAOpC,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQZ,GAAG,iBAAiBU,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AACjF;AAEA,SAAgBsC,YAAYhD,OAAmD;CAC7E,MAAM,CAACS,OAAOC,QAAQf,WAAWK,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBACGd,OAAc4D,OAAKtC,WAAA,EAAA,KAAA,WAAA;EAAA,OACXZ,GAAG,oEAAoEU,MAAMG,KAAK;CAAC,EAAA,GACtFF,IAAI,CAAA;AAGd;;AAGA,SAAgBwC,qBAAqBlD,OAA8B;CACjE,OAAAG,gBAAQX,gBAAcmB,WAAA,EAAA,eAAA,OAAA,GAAwBX,KAAK,CAAA;AACrD"}
|
|
1
|
+
{"version":3,"file":"select.js","names":["Select","KobalteSelect","Check","ChevronDown","ChevronsUpDown","ComponentProps","Show","splitProps","menuContentPadding","menuItem","popoverArrow","topLayerProps","cn","props","Option","OptGroup","_$createComponent","SelectTriggerProps","Trigger","size","hideIcon","SelectTrigger","local","rest","_$mergeProps","class","undefined","children","_$memo","when","Icon","SelectValueChildren","Value","SelectValueProps","optionLabel","option","LABEL_FIELDS","const","labelFromOption","field","value","Record","SelectValue","readLabel","state","selectedOption","SelectContentProps","Content","portalMount","HTMLElement","SelectContent","Portal","mount","Listbox","Arrow","SelectItem","Item","ItemLabel","ItemIndicator","SelectSection","Section","SelectLabel","Label","SelectChevronsUpDown","Select","_$createComponent","KobalteSelect","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import { Select as KobalteSelect } from '@kobalte/core/select'\nimport { Check, ChevronDown, ChevronsUpDown } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow, topLayerProps } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Select.\n *\n * A single choice from a list that is too long to show, or whose options are\n * only known at runtime. The distinction from RadioGroup is disclosure: a\n * Select hides the choices behind a click, which is right above roughly seven\n * options and wrong below it.\n *\n * `Select.Value` renders the human-readable label of the selection, not its\n * value — the reason a Select takes both `options` and `optionValue`/`optionText`\n * rather than a bare list of strings, and the reason the trigger never shows a\n * raw id.\n */\nexport function Select<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteSelect<Option, OptGroup>>\n) {\n return <KobalteSelect {...props} />\n}\n\nexport type SelectTriggerProps = ComponentProps<typeof KobalteSelect.Trigger> & {\n size?: 'sm' | 'md' | 'lg'\n /** Hide the chevron, e.g. when a caller draws its own affordance. */\n hideIcon?: boolean\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const [local, rest] = splitProps(props, ['class', 'size', 'hideIcon', 'children'])\n\n return (\n <KobalteSelect.Trigger\n class={cn(\n 'border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md',\n 'whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none',\n 'data-[placeholder-shown]:text-muted-foreground',\n 'hover:border-input',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n {\n 'h-control-sm text-xs': local.size === 'sm',\n 'h-control-md text-sm': local.size === 'md' || local.size === undefined,\n 'h-control-lg text-sm': local.size === 'lg',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n <Show when={!local.hideIcon}>\n <KobalteSelect.Icon class=\"text-muted-foreground\">\n <ChevronDown />\n </KobalteSelect.Icon>\n </Show>\n </KobalteSelect.Trigger>\n )\n}\n\n/**\n * What the trigger shows for the current selection.\n *\n * The default renderer is the reason a single-select needs no render prop at all.\n * Kobalte's own `Value` draws *only* its children, so a bare `<SelectValue />`\n * shows the placeholder and then goes blank the moment something is chosen: the\n * value is there, nothing paints it.\n *\n * Kobalte cannot supply a default itself, because an option is the caller's type\n * — it has no way to know which field is the label. So this reads a field by\n * convention: `label`, then `name`, then `textValue`. An option shaped\n * `{ value, label }` therefore needs nothing, and anything else passes\n * `optionLabel`.\n *\n * A multiple-select still supplies its own renderer, because \"3 selected\" is a\n * summary a caller has to phrase, not something a component can guess.\n */\ntype SelectValueChildren = ComponentProps<typeof KobalteSelect.Value>['children']\n\nexport type SelectValueProps = ComponentProps<typeof KobalteSelect.Value> & {\n /**\n * Read the display text from the selected option. Supply this when the option's\n * label does not live in a field called `label`, `name` or `textValue`.\n */\n optionLabel?: (option: unknown) => string\n /** Replace the default readout entirely, for a multiple-select summary. */\n children?: SelectValueChildren\n}\n\n/** Fields a label is read from, in order. See `SelectValueProps.optionLabel`. */\nconst LABEL_FIELDS = ['label', 'name', 'textValue'] as const\n\nfunction labelFromOption(option: unknown): string {\n if (option === null || typeof option !== 'object') {\n return typeof option === 'string' ? option : ''\n }\n\n for (const field of LABEL_FIELDS) {\n const value = (option as Record<string, unknown>)[field]\n if (typeof value === 'string') return value\n }\n\n return ''\n}\n\nexport function SelectValue(props: SelectValueProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'optionLabel'])\n\n const readLabel = (state: { selectedOption: () => unknown }): string => {\n const option = state.selectedOption()\n return local.optionLabel ? local.optionLabel(option) : labelFromOption(option)\n }\n\n return (\n <KobalteSelect.Value data-slot=\"select-value\" class={cn('truncate', local.class)} {...rest}>\n {local.children ?? (readLabel as unknown as SelectValueChildren)}\n </KobalteSelect.Value>\n )\n}\n\n/**\n * The option list. The items themselves come from the root's `itemComponent`,\n * which is what makes a Select able to render a typed option rather than a\n * string; `children` here is for content above the list, such as a filter hint.\n */\nexport type SelectContentProps = ComponentProps<typeof KobalteSelect.Content> & {\n /** Keep a nested menu inside its enclosing modal's accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const [local, rest] = splitProps(props, ['class', 'children', 'portalMount'])\n\n return (\n <KobalteSelect.Portal mount={local.portalMount}>\n <KobalteSelect.Content\n {...topLayerProps}\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-(--kb-popper-content-available-height) min-w-[8rem] origin-(--kb-select-content-transform-origin) overflow-y-auto overflow-x-hidden',\n menuContentPadding,\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteSelect.Listbox class=\"flex flex-col\" />\n <KobalteSelect.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteSelect.Content>\n </KobalteSelect.Portal>\n )\n}\n\nexport function SelectItem(props: ComponentProps<typeof KobalteSelect.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteSelect.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteSelect.ItemLabel>{local.children}</KobalteSelect.ItemLabel>\n <KobalteSelect.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteSelect.ItemIndicator>\n </KobalteSelect.Item>\n )\n}\n\nexport function SelectSection(props: ComponentProps<typeof KobalteSelect.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteSelect.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\nexport function SelectLabel(props: ComponentProps<typeof KobalteSelect.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSelect.Label\n class={cn('text-muted-foreground px-2 py-1.5 text-2xs font-medium uppercase', local.class)}\n {...rest}\n />\n )\n}\n\n/** The chevron pair used when a Select is composed by hand in a field. */\nexport function SelectChevronsUpDown(props: ComponentProps<'svg'>) {\n return <ChevronsUpDown aria-hidden=\"true\" {...props} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAgBA,SACda,OACA;CACA,OAAAG,gBAAQf,QAAkBY,KAAK;AACjC;AAQA,SAAgBQ,cAAcR,OAA2B;CACvD,MAAM,CAACS,OAAOC,QAAQhB,WAAWM,OAAO;EAAC;EAAS;EAAQ;EAAY;CAAU,CAAC;CAEjF,OAAAG,gBACGf,OAAciB,SAAOM,WAAA,EAAA,KAAA,WAAA;EAAA,OACbZ,GACL,6GACA,sFACA,kDACA,sBACA,oFACA,4FACA,gFACA,oJACA,+DACA;GACE,wBAAwBU,MAAMH,SAAS;GACvC,wBAAwBG,MAAMH,SAAS,QAAQG,MAAMH,SAASO,KAAAA;GAC9D,wBAAwBJ,MAAMH,SAAS;EACzC,GACAG,MAAMG,KACR;CAAC,EAAA,GACGF,MAAI,EAAA,IAAAI,WAAA;EAAA,OAAA,CAAAC,WAEPN,MAAMK,QAAQ,GAAAX,gBACdV,MAAI;GAAA,IAACuB,OAAI;IAAA,OAAE,CAACP,MAAMF;GAAQ;GAAA,IAAAO,WAAA;IAAA,OAAAX,gBACxBf,OAAc6B,MAAI;KAAA,SAAA;KAAA,IAAAH,WAAA;MAAA,OAAAX,gBAChBb,aAAW,CAAA,CAAA;KAAA;IAAA,CAAA;GAAA;EAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAKtB;;AAgCA,IAAMiC,eAAe;CAAC;CAAS;CAAQ;AAAW;AAElD,SAASE,gBAAgBH,Q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
13
13
|
* `end`, and a full-width row for `top` and `bottom`. The slide-in direction
|
|
14
14
|
* follows from the side, so a caller never pairs them by hand.
|
|
15
15
|
*
|
|
16
|
+
* `variant` decides how it meets that edge. `inset` — the default for `end` —
|
|
17
|
+
* docks the panel inside the main view: below the top bar, one equal gap from
|
|
18
|
+
* the top bar, the end edge and the bottom, with no scrim, so the work it edits
|
|
19
|
+
* stays visible and the top bar stays reachable. It is the shape for editing one
|
|
20
|
+
* thing beside its context (appearance settings, a task, a record). `edge` runs
|
|
21
|
+
* edge to edge over a scrim — the shape of a navigation drawer, and the default
|
|
22
|
+
* for every other side.
|
|
23
|
+
*
|
|
24
|
+
* Its parts read alike everywhere: `SheetHeader` holds a heading, a description
|
|
25
|
+
* and a full-width rule beneath, with the close button in the corner;
|
|
26
|
+
* `SheetBody` scrolls on its own; `SheetFooter` is a full-width tinted band that
|
|
27
|
+
* holds the decision.
|
|
28
|
+
*
|
|
16
29
|
* Controlled sheets opened from outside a `SheetTrigger` restore focus to the
|
|
17
30
|
* element focused before opening. Pass `restoreFocusRef` when a stable external
|
|
18
31
|
* opener must be used instead, such as when another layer closes before the
|
|
@@ -20,9 +33,12 @@ import { type VariantProps } from '#lib/variants';
|
|
|
20
33
|
*/
|
|
21
34
|
declare const sheetVariants: (props?: ({
|
|
22
35
|
side?: "end" | "start" | "bottom" | "top" | null | undefined;
|
|
36
|
+
variant?: "inset" | "edge" | null | undefined;
|
|
23
37
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
24
38
|
export type SheetContentProps = ComponentProps<typeof KobalteDialogContent> & VariantProps<typeof sheetVariants> & {
|
|
25
39
|
closeButton?: JSX.Element | false;
|
|
40
|
+
/** The close button's accessible name. Defaults to "Close". */
|
|
41
|
+
closeLabel?: string;
|
|
26
42
|
/** Supplies the stable external element to focus when the controlled sheet closes. */
|
|
27
43
|
restoreFocusRef?: Accessor<HTMLElement | undefined>;
|
|
28
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sheet/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,aAAa,EACvB,OAAO,IAAI,oBAAoB,EAEhC,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE7D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAKtD
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sheet/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,aAAa,EACvB,OAAO,IAAI,oBAAoB,EAEhC,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE7D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAKtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,QAAA,MAAM,aAAa;;;8EAuClB,CAAA;AAQD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,oBAAoB,CAAC,GACzE,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IACnC,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;IACjC,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,sFAAsF;IACtF,eAAe,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;CACpD,CAAA;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eA0DpD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,eAEhE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,aAAa,CAA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