@adea-ai/ui 0.106.2 → 0.108.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/layout/contextual-sidebar/contextual-sidebar.d.ts +55 -0
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts.map +1 -0
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +199 -0
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -0
- package/dist/components/layout/contextual-sidebar/index.d.ts +3 -0
- package/dist/components/layout/contextual-sidebar/index.d.ts.map +1 -0
- package/dist/components/layout/contextual-sidebar/index.js +3 -0
- package/dist/components/layout/pixel-resize-handle/index.d.ts +2 -0
- package/dist/components/layout/pixel-resize-handle/index.d.ts.map +1 -0
- package/dist/components/layout/pixel-resize-handle/index.js +2 -0
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts +29 -0
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -0
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +183 -0
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -0
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.d.ts +3 -19
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +8 -76
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js.map +1 -1
- 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/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/resizable/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable/resizable.js +2 -2
- package/dist/components/ui/resizable/resizable.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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -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/lint/index.d.ts.map +1 -1
- package/dist/lint.js +154 -20
- package/dist/lint.js.map +1 -1
- package/dist/r/appearance-editor.json +1 -1
- package/dist/r/contextual-sidebar.json +25 -0
- package/dist/r/pixel-resize-handle.json +23 -0
- package/dist/r/registry.json +50 -2
- package/dist/r/sidebar-nav.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/layout/contextual-sidebar/contextual-sidebar.tsx +180 -0
- package/dist/r/src/components/layout/contextual-sidebar/index.ts +6 -0
- package/dist/r/src/components/layout/pixel-resize-handle/index.ts +1 -0
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +177 -0
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx +7 -55
- 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/menubar/menubar.tsx +3 -0
- package/dist/r/src/components/ui/popover/popover.tsx +8 -1
- package/dist/r/src/components/ui/resizable/resizable.tsx +4 -2
- 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 +13 -0
- package/package.json +3 -1
- package/registry.json +50 -2
- 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/layout/contextual-sidebar/contextual-sidebar.tsx +180 -0
- package/src/components/layout/contextual-sidebar/index.ts +6 -0
- package/src/components/layout/pixel-resize-handle/index.ts +1 -0
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +177 -0
- package/src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx +7 -55
- 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/menubar/menubar.tsx +3 -0
- package/src/components/ui/popover/popover.tsx +8 -1
- package/src/components/ui/resizable/resizable.tsx +4 -2
- package/src/components/ui/select/select.tsx +2 -1
- package/src/components/ui/sheet/sheet.tsx +78 -15
- package/src/index.ts +1 -0
- package/src/lib/overlay.ts +14 -0
- package/src/lint/index.ts +234 -22
- package/src/styles/base.css +13 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextual-sidebar.js","names":["Accessor","JSX","Show","createSignal","createUniqueId","onCleanup","onMount","cn","Sheet","SheetContent","SheetTitle","SidebarNav","SidebarNavContent","SidebarNavFooter","SidebarNavHeader","SidebarNavTitle","PixelResizeHandle","ContextualSidebarRenderContext","mobile","portalMount","HTMLElement","ContextualSidebarProps","id","label","title","open","onOpenChange","width","minimum","maximum","step","wideViewportAtLoad","resizeLabel","restoreFocusRef","onSidebarElement","element","sidebarClass","sheetClass","headerClass","contentClass","footerClass","headingAs","header","context","Element","content","footer","onWidthChange","onWidthCommit","ContextualSidebar","props","isNarrowViewport","setIsNarrowViewport","mobileMount","setMobileMount","connected","mount","isConnected","undefined","media","window","matchMedia","updateViewport","wasNarrow","matches","addEventListener","removeEventListener","renderSidebar","navigationId","_$createComponent","as","aria-label","aria-hidden","inert","data-open","String","ref","node","queueMicrotask","class","children","when","side","value","controls","onChange","onCommit","_$memo","_wide","_$createComponent","_$memo"],"sources":["../../../../src/components/layout/contextual-sidebar/contextual-sidebar.tsx"],"sourcesContent":["import type { Accessor, JSX } from 'solid-js'\nimport { Show, createSignal, createUniqueId, onCleanup, onMount } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Sheet, SheetContent, SheetTitle } from '../../ui/sheet'\nimport {\n SidebarNav,\n SidebarNavContent,\n SidebarNavFooter,\n SidebarNavHeader,\n SidebarNavTitle,\n} from '../sidebar-nav/sidebar-nav'\nimport { PixelResizeHandle } from '../pixel-resize-handle/pixel-resize-handle'\n\nexport type ContextualSidebarRenderContext = {\n /** Whether the slot is being rendered inside the modal mobile sheet. */\n mobile: boolean\n /** Mount nested popovers and menus inside the mobile dialog's accessibility tree. */\n portalMount(): HTMLElement | undefined\n}\n\nexport type ContextualSidebarProps = {\n /** Stable host id prefix; generated when omitted. */\n id?: string\n /** Landmark name shared by the desktop and mobile navigation. */\n label: string\n /** Visible navigation title and mobile dialog title. */\n title: string\n /** Host-controlled expanded state for the desktop panel and mobile dialog. */\n open: boolean\n onOpenChange(open: boolean): void\n /** Current host-owned pixel width, reflected by the resize handle. */\n width: number\n minimum: number\n maximum: number\n step?: number\n /** Pass the host's initial viewport seed to distinguish stale desktop state. */\n wideViewportAtLoad?: boolean\n resizeLabel?: string\n /** Stable external opener used when the modal mobile sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n /** Called with the nav node so a host can project width onto its layout root. */\n onSidebarElement?: (element: HTMLElement | undefined, mobile: boolean) => void\n /** Host-owned layout classes applied to both nav instances. */\n sidebarClass?: string\n /** Host-owned responsive constraints for the modal sheet. */\n sheetClass?: string\n headerClass?: string\n contentClass?: string\n footerClass?: string\n headingAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n /** Optional action/content slot alongside the shared heading. */\n header?(context: ContextualSidebarRenderContext): JSX.Element\n /** View-specific navigation rows, projects, rooms, files, or sessions. */\n content(context: ContextualSidebarRenderContext): JSX.Element\n /** Optional view-specific footer, such as an archive affordance. */\n footer?(context: ContextualSidebarRenderContext): JSX.Element\n onWidthChange(width: number): void\n onWidthCommit?(width: number): void\n}\n\n/**\n * ContextualSidebar.\n *\n * Shared navigation geometry and interaction policy for an application's\n * contextual sidebar. The host keeps ownership of the actual grid width,\n * persisted preference, open state, and view-specific navigation content.\n */\nexport function ContextualSidebar(props: ContextualSidebarProps) {\n const [isNarrowViewport, setIsNarrowViewport] = createSignal(false)\n const [mobileMount, setMobileMount] = createSignal<\n { element: HTMLElement; connected: boolean } | undefined\n >()\n const id = props.id ?? `contextual-sidebar-${createUniqueId()}`\n const resizeLabel = () => props.resizeLabel ?? `Resize ${props.label}`\n const portalMount = () => {\n const mount = mobileMount()\n return mount?.connected && mount.element.isConnected ? mount.element : undefined\n }\n\n onMount(() => {\n const media = window.matchMedia('(max-width: 48rem)')\n const updateViewport = () => {\n const wasNarrow = isNarrowViewport()\n // Close before mounting a modal. A desktop-expanded host state is not\n // mobile intent, and opening the Sheet for one frame can steal focus.\n if (media.matches && !wasNarrow) props.onOpenChange(false)\n setIsNarrowViewport(media.matches)\n }\n\n // A route can mount after a wide-loaded host crosses into mobile. Clear\n // that stale seed, but preserve a sidebar intentionally opened at a\n // narrow boot viewport.\n if (media.matches && props.wideViewportAtLoad && props.open) props.onOpenChange(false)\n setIsNarrowViewport(media.matches)\n media.addEventListener('change', updateViewport)\n onCleanup(() => media.removeEventListener('change', updateViewport))\n })\n\n const renderSidebar = (mobile: boolean) => {\n let element: HTMLElement | undefined\n const context: ContextualSidebarRenderContext = {\n mobile,\n portalMount: () => (mobile ? portalMount() : undefined),\n }\n const navigationId = `${id}-${mobile ? 'mobile' : 'desktop'}`\n\n onCleanup(() => {\n if (mobile && mobileMount()?.element === element) setMobileMount(undefined)\n element = undefined\n props.onSidebarElement?.(undefined, mobile)\n })\n\n return (\n <SidebarNav\n as=\"aside\"\n id={navigationId}\n aria-label={props.label}\n aria-hidden={!mobile && !props.open ? 'true' : undefined}\n inert={!mobile && !props.open}\n data-contextual-sidebar={mobile ? 'mobile' : 'desktop'}\n data-open={mobile ? undefined : String(props.open)}\n ref={(node) => {\n element = node\n if (mobile) {\n setMobileMount({ element: node, connected: node.isConnected })\n queueMicrotask(() => {\n if (node.isConnected && mobileMount()?.element === node)\n setMobileMount({ element: node, connected: true })\n })\n }\n props.onSidebarElement?.(node, mobile)\n }}\n class={cn('relative h-full w-full max-w-full', props.sidebarClass)}\n >\n <Show when={!mobile && props.open}>\n <PixelResizeHandle\n side=\"left\"\n value={props.width}\n minimum={props.minimum}\n maximum={props.maximum}\n step={props.step}\n label={resizeLabel()}\n controls={navigationId}\n onChange={props.onWidthChange}\n onCommit={props.onWidthCommit}\n />\n </Show>\n <Show when={!mobile || mobileMount()?.connected}>\n <SidebarNavHeader class={cn(mobile && 'pe-12', props.headerClass)}>\n <SidebarNavTitle as={props.headingAs ?? 'h2'}>{props.title}</SidebarNavTitle>\n {props.header?.(context)}\n </SidebarNavHeader>\n <SidebarNavContent class={props.contentClass}>{props.content(context)}</SidebarNavContent>\n {props.footer ? (\n <SidebarNavFooter class={props.footerClass}>{props.footer(context)}</SidebarNavFooter>\n ) : null}\n </Show>\n </SidebarNav>\n )\n }\n\n return (\n <Sheet\n open={isNarrowViewport() && props.open}\n onOpenChange={(open) => props.onOpenChange(open)}\n >\n <Show when={!isNarrowViewport()}>{(_wide) => renderSidebar(false)}</Show>\n <Show when={isNarrowViewport()}>\n <SheetContent\n side=\"start\"\n class={cn('gap-0 p-0', props.sheetClass)}\n restoreFocusRef={props.restoreFocusRef}\n >\n <SheetTitle class=\"sr-only\">{props.title} navigation</SheetTitle>\n {renderSidebar(true)}\n </SheetContent>\n </Show>\n </Sheet>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAmEA,SAAgBiD,kBAAkBC,OAA+B;CAC/D,MAAM,CAACC,kBAAkBC,uBAAuBjD,aAAa,KAAK;CAClE,MAAM,CAACkD,aAAaC,kBAAkBnD,aAEpC;CACF,MAAMmB,KAAK4B,MAAM5B,MAAM,sBAAsBlB,eAAe;CAC5D,MAAM4B,oBAAoBkB,MAAMlB,eAAe,UAAUkB,MAAM3B;CAC/D,MAAMJ,oBAAoB;EACxB,MAAMqC,QAAQH,YAAY;EAC1B,OAAOG,OAAOD,aAA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,SAAA;QAAA,IAAAsE,WAAA;SAAA,OAAA,CAAAO,WAAkBrC,MAAM1B,KAAK,GAAA,aAAA;QAAA;OAAA,CAAA,GAAA+D,WACvCpB,cAAc,IAAI,CAAC,CAAA;MAAA;KAAA,CAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAK9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/contextual-sidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,8BAA8B,GACpC,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/pixel-resize-handle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type PixelResizeHandleProps = {
|
|
2
|
+
/** Which physical edge of the ruler the resizable surface is attached to. */
|
|
3
|
+
side: 'left' | 'right';
|
|
4
|
+
/** Current width in CSS pixels. */
|
|
5
|
+
value: number;
|
|
6
|
+
minimum: number;
|
|
7
|
+
maximum: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
label?: string;
|
|
10
|
+
controls?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
onChange(value: number): void;
|
|
13
|
+
onCommit?(value: number): void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* PixelResizeHandle.
|
|
17
|
+
*
|
|
18
|
+
* A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the
|
|
19
|
+
* pane's actual width and any persistence in its layout owner; this component
|
|
20
|
+
* reports a bounded pixel value and places the shared resizable grip at the
|
|
21
|
+
* matching left or right edge.
|
|
22
|
+
*
|
|
23
|
+
* Corvu 0.2.5 supplies geometry, keyboard resizing, ARIA and the shared grip,
|
|
24
|
+
* but its global drag handler does not end on pointer cancellation. Prevent
|
|
25
|
+
* that handler through its public start hook and use local pointer capture
|
|
26
|
+
* for bounded pixel gestures, including cancellation and lost capture.
|
|
27
|
+
*/
|
|
28
|
+
export declare function PixelResizeHandle(props: PixelResizeHandleProps): import("solid-js").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=pixel-resize-handle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixel-resize-handle.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,sBAAsB,GAAG;IACnC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,kCAgJ9D"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "../../ui/resizable/resizable.js";
|
|
3
|
+
import { createComponent, memo } from "solid-js/web";
|
|
4
|
+
import { createSignal, onCleanup } from "solid-js";
|
|
5
|
+
//#region src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx
|
|
6
|
+
/**
|
|
7
|
+
* PixelResizeHandle.
|
|
8
|
+
*
|
|
9
|
+
* A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the
|
|
10
|
+
* pane's actual width and any persistence in its layout owner; this component
|
|
11
|
+
* reports a bounded pixel value and places the shared resizable grip at the
|
|
12
|
+
* matching left or right edge.
|
|
13
|
+
*
|
|
14
|
+
* Corvu 0.2.5 supplies geometry, keyboard resizing, ARIA and the shared grip,
|
|
15
|
+
* but its global drag handler does not end on pointer cancellation. Prevent
|
|
16
|
+
* that handler through its public start hook and use local pointer capture
|
|
17
|
+
* for bounded pixel gestures, including cancellation and lost capture.
|
|
18
|
+
*/
|
|
19
|
+
function PixelResizeHandle(props) {
|
|
20
|
+
const maximum = () => Math.max(1, props.maximum);
|
|
21
|
+
const minimum = () => Math.min(maximum(), Math.max(0, props.minimum));
|
|
22
|
+
const value = () => Math.min(maximum(), Math.max(minimum(), Math.round(props.value)));
|
|
23
|
+
const ratio = () => value() / maximum();
|
|
24
|
+
const isRight = () => props.side === "right";
|
|
25
|
+
const rulerSizes = () => isRight() ? [1 - ratio(), ratio()] : [ratio(), 1 - ratio()];
|
|
26
|
+
const commit = () => props.onCommit?.(value());
|
|
27
|
+
let interacting = false;
|
|
28
|
+
const [drag, setDrag] = createSignal();
|
|
29
|
+
const endPointer = (shouldCommit) => {
|
|
30
|
+
const current = drag();
|
|
31
|
+
if (!current) return;
|
|
32
|
+
setDrag(void 0);
|
|
33
|
+
if (current.handle.hasPointerCapture(current.pointerId)) current.handle.releasePointerCapture(current.pointerId);
|
|
34
|
+
if (shouldCommit) commit();
|
|
35
|
+
};
|
|
36
|
+
const endKeyboard = () => {
|
|
37
|
+
const wasInteracting = interacting;
|
|
38
|
+
interacting = false;
|
|
39
|
+
if (wasInteracting) commit();
|
|
40
|
+
};
|
|
41
|
+
onCleanup(() => {
|
|
42
|
+
endKeyboard();
|
|
43
|
+
endPointer(false);
|
|
44
|
+
});
|
|
45
|
+
return createComponent(ResizablePanelGroup, {
|
|
46
|
+
orientation: "horizontal",
|
|
47
|
+
dir: "ltr",
|
|
48
|
+
get sizes() {
|
|
49
|
+
return rulerSizes();
|
|
50
|
+
},
|
|
51
|
+
get keyboardDelta() {
|
|
52
|
+
return `${props.step ?? 16}px`;
|
|
53
|
+
},
|
|
54
|
+
get style() {
|
|
55
|
+
return { width: `${maximum()}px` };
|
|
56
|
+
},
|
|
57
|
+
get ["class"]() {
|
|
58
|
+
return cn("pointer-events-none absolute inset-y-0 flex", {
|
|
59
|
+
"left-0": props.side === "left",
|
|
60
|
+
"right-0": props.side === "right"
|
|
61
|
+
}, props.class);
|
|
62
|
+
},
|
|
63
|
+
onSizesChange: (sizes) => {
|
|
64
|
+
if (!interacting || sizes.length !== 2) return;
|
|
65
|
+
const next = Math.round((sizes[isRight() ? 1 : 0] ?? ratio()) * maximum());
|
|
66
|
+
const bounded = Math.min(maximum(), Math.max(minimum(), next));
|
|
67
|
+
if (bounded !== value()) props.onChange(bounded);
|
|
68
|
+
},
|
|
69
|
+
get children() {
|
|
70
|
+
return [
|
|
71
|
+
createComponent(ResizablePanel, {
|
|
72
|
+
get minSize() {
|
|
73
|
+
return memo(() => !!isRight())() ? 0 : minimum() / maximum();
|
|
74
|
+
},
|
|
75
|
+
maxSize: 1,
|
|
76
|
+
"aria-hidden": "true"
|
|
77
|
+
}),
|
|
78
|
+
createComponent(ResizableHandle, {
|
|
79
|
+
withHandle: true,
|
|
80
|
+
get label() {
|
|
81
|
+
return props.label ?? `Resize ${props.side} pane`;
|
|
82
|
+
},
|
|
83
|
+
get ["aria-controls"]() {
|
|
84
|
+
return props.controls;
|
|
85
|
+
},
|
|
86
|
+
get ["aria-valuemin"]() {
|
|
87
|
+
return minimum();
|
|
88
|
+
},
|
|
89
|
+
get ["aria-valuemax"]() {
|
|
90
|
+
return maximum();
|
|
91
|
+
},
|
|
92
|
+
get ["aria-valuenow"]() {
|
|
93
|
+
return value();
|
|
94
|
+
},
|
|
95
|
+
get ["aria-valuetext"]() {
|
|
96
|
+
return `${value()} pixels`;
|
|
97
|
+
},
|
|
98
|
+
get ["data-dragging"]() {
|
|
99
|
+
return drag() ? "" : void 0;
|
|
100
|
+
},
|
|
101
|
+
onHandleDragStart: (event) => {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
if (event.button !== 0 || !event.isPrimary) return;
|
|
104
|
+
const handle = event.currentTarget;
|
|
105
|
+
if (!(handle instanceof HTMLElement)) return;
|
|
106
|
+
endPointer(false);
|
|
107
|
+
interacting = false;
|
|
108
|
+
handle.focus();
|
|
109
|
+
handle.setPointerCapture(event.pointerId);
|
|
110
|
+
setDrag({
|
|
111
|
+
pointerId: event.pointerId,
|
|
112
|
+
startX: event.clientX,
|
|
113
|
+
startValue: value(),
|
|
114
|
+
handle
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
onPointerMove: (event) => {
|
|
118
|
+
const current = drag();
|
|
119
|
+
if (!current || event.pointerId !== current.pointerId) return;
|
|
120
|
+
if (!current.handle.hasPointerCapture(current.pointerId)) {
|
|
121
|
+
endPointer(false);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const delta = (event.clientX - current.startX) * (isRight() ? -1 : 1);
|
|
125
|
+
const next = Math.min(maximum(), Math.max(minimum(), Math.round(current.startValue + delta)));
|
|
126
|
+
if (next !== value()) props.onChange(next);
|
|
127
|
+
},
|
|
128
|
+
onPointerUp: (event) => {
|
|
129
|
+
if (event.pointerId === drag()?.pointerId) endPointer(true);
|
|
130
|
+
},
|
|
131
|
+
onPointerCancel: (event) => {
|
|
132
|
+
if (event.pointerId === drag()?.pointerId) endPointer(false);
|
|
133
|
+
},
|
|
134
|
+
onLostPointerCapture: (event) => {
|
|
135
|
+
if (event.pointerId === drag()?.pointerId) endPointer(false);
|
|
136
|
+
},
|
|
137
|
+
onBlur: () => {
|
|
138
|
+
endKeyboard();
|
|
139
|
+
endPointer(false);
|
|
140
|
+
},
|
|
141
|
+
onKeyDown: (event) => {
|
|
142
|
+
const current = drag();
|
|
143
|
+
if (current && !current.handle.hasPointerCapture(current.pointerId)) endPointer(false);
|
|
144
|
+
if (drag()) {
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if ([
|
|
149
|
+
"ArrowLeft",
|
|
150
|
+
"ArrowRight",
|
|
151
|
+
"Home",
|
|
152
|
+
"End"
|
|
153
|
+
].includes(event.key)) interacting = true;
|
|
154
|
+
if (event.key === "Home" || event.key === "End") {
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
props.onChange(event.key === "Home" ? minimum() : maximum());
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
onKeyUp: (event) => {
|
|
160
|
+
if ([
|
|
161
|
+
"ArrowLeft",
|
|
162
|
+
"ArrowRight",
|
|
163
|
+
"Home",
|
|
164
|
+
"End"
|
|
165
|
+
].includes(event.key)) endKeyboard();
|
|
166
|
+
},
|
|
167
|
+
"class": "pointer-events-auto"
|
|
168
|
+
}),
|
|
169
|
+
createComponent(ResizablePanel, {
|
|
170
|
+
get minSize() {
|
|
171
|
+
return memo(() => !!isRight())() ? minimum() / maximum() : 0;
|
|
172
|
+
},
|
|
173
|
+
maxSize: 1,
|
|
174
|
+
"aria-hidden": "true"
|
|
175
|
+
})
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
export { PixelResizeHandle };
|
|
182
|
+
|
|
183
|
+
//# sourceMappingURL=pixel-resize-handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixel-resize-handle.js","names":["ResizableHandle","ResizablePanel","ResizablePanelGroup","createSignal","onCleanup","cn","PixelResizeHandleProps","side","value","minimum","maximum","step","label","controls","class","onChange","onCommit","PixelResizeHandle","props","Math","max","min","round","ratio","isRight","rulerSizes","commit","interacting","drag","setDrag","pointerId","startX","startValue","handle","HTMLElement","endPointer","shouldCommit","current","undefined","hasPointerCapture","releasePointerCapture","endKeyboard","wasInteracting","_$createComponent","orientation","dir","sizes","keyboardDelta","style","width","onSizesChange","length","next","bounded","children","minSize","_$memo","maxSize","withHandle","aria-controls","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","data-dragging","onHandleDragStart","event","preventDefault","button","isPrimary","currentTarget","focus","setPointerCapture","clientX","onPointerMove","PointerEvent","delta","onPointerUp","onPointerCancel","onLostPointerCapture","onBlur","onKeyDown","includes","key","onKeyUp","_$createComponent","_$memo"],"sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"sourcesContent":["import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '../../ui/resizable'\nimport { createSignal, onCleanup } from 'solid-js'\nimport { cn } from '#lib/utils'\n\nexport type PixelResizeHandleProps = {\n /** Which physical edge of the ruler the resizable surface is attached to. */\n side: 'left' | 'right'\n /** Current width in CSS pixels. */\n value: number\n minimum: number\n maximum: number\n step?: number\n label?: string\n controls?: string\n class?: string\n onChange(value: number): void\n onCommit?(value: number): void\n}\n\n/**\n * PixelResizeHandle.\n *\n * A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the\n * pane's actual width and any persistence in its layout owner; this component\n * reports a bounded pixel value and places the shared resizable grip at the\n * matching left or right edge.\n *\n * Corvu 0.2.5 supplies geometry, keyboard resizing, ARIA and the shared grip,\n * but its global drag handler does not end on pointer cancellation. Prevent\n * that handler through its public start hook and use local pointer capture\n * for bounded pixel gestures, including cancellation and lost capture.\n */\nexport function PixelResizeHandle(props: PixelResizeHandleProps) {\n const maximum = () => Math.max(1, props.maximum)\n const minimum = () => Math.min(maximum(), Math.max(0, props.minimum))\n const value = () => Math.min(maximum(), Math.max(minimum(), Math.round(props.value)))\n const ratio = () => value() / maximum()\n const isRight = () => props.side === 'right'\n const rulerSizes = () => (isRight() ? [1 - ratio(), ratio()] : [ratio(), 1 - ratio()])\n const commit = () => props.onCommit?.(value())\n let interacting = false\n const [drag, setDrag] = createSignal<{\n pointerId: number\n startX: number\n startValue: number\n handle: HTMLElement\n }>()\n const endPointer = (shouldCommit: boolean) => {\n const current = drag()\n if (!current) return\n setDrag(undefined)\n if (current.handle.hasPointerCapture(current.pointerId))\n current.handle.releasePointerCapture(current.pointerId)\n if (shouldCommit) commit()\n }\n const endKeyboard = () => {\n const wasInteracting = interacting\n interacting = false\n if (wasInteracting) commit()\n }\n onCleanup(() => {\n endKeyboard()\n endPointer(false)\n })\n\n return (\n <ResizablePanelGroup\n orientation=\"horizontal\"\n dir=\"ltr\"\n sizes={rulerSizes()}\n keyboardDelta={`${props.step ?? 16}px`}\n style={{ width: `${maximum()}px` }}\n class={cn(\n 'pointer-events-none absolute inset-y-0 flex',\n {\n 'left-0': props.side === 'left',\n 'right-0': props.side === 'right',\n },\n props.class\n )}\n onSizesChange={(sizes) => {\n // Panel registration and teardown also emit sizes. Only user resizing\n // may update the host preference; collapsing must preserve its width.\n if (!interacting || sizes.length !== 2) return\n const next = Math.round((sizes[isRight() ? 1 : 0] ?? ratio()) * maximum())\n const bounded = Math.min(maximum(), Math.max(minimum(), next))\n if (bounded !== value()) props.onChange(bounded)\n }}\n >\n <ResizablePanel\n minSize={isRight() ? 0 : minimum() / maximum()}\n maxSize={1}\n aria-hidden=\"true\"\n />\n <ResizableHandle\n withHandle\n label={props.label ?? `Resize ${props.side} pane`}\n aria-controls={props.controls}\n aria-valuemin={minimum()}\n aria-valuemax={maximum()}\n aria-valuenow={value()}\n aria-valuetext={`${value()} pixels`}\n data-dragging={drag() ? '' : undefined}\n onHandleDragStart={(event) => {\n // Corvu checks defaultPrevented before starting its global handler.\n event.preventDefault()\n if (event.button !== 0 || !event.isPrimary) return\n const handle = event.currentTarget\n if (!(handle instanceof HTMLElement)) return\n endPointer(false)\n interacting = false\n handle.focus()\n handle.setPointerCapture(event.pointerId)\n setDrag({\n pointerId: event.pointerId,\n startX: event.clientX,\n startValue: value(),\n handle,\n })\n }}\n onPointerMove={(event: PointerEvent) => {\n const current = drag()\n if (!current || event.pointerId !== current.pointerId) return\n if (!current.handle.hasPointerCapture(current.pointerId)) {\n endPointer(false)\n return\n }\n const delta = (event.clientX - current.startX) * (isRight() ? -1 : 1)\n const next = Math.min(\n maximum(),\n Math.max(minimum(), Math.round(current.startValue + delta))\n )\n if (next !== value()) props.onChange(next)\n }}\n onPointerUp={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(true)\n }}\n onPointerCancel={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onLostPointerCapture={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onBlur={() => {\n endKeyboard()\n endPointer(false)\n }}\n onKeyDown={(event) => {\n const current = drag()\n if (current && !current.handle.hasPointerCapture(current.pointerId)) endPointer(false)\n if (drag()) {\n event.preventDefault()\n return\n }\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) interacting = true\n // Corvu operates on physical panel order. Home/End here describe\n // the controlled pane width, including a pane after the separator.\n if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault()\n props.onChange(event.key === 'Home' ? minimum() : maximum())\n }\n }}\n onKeyUp={(event) => {\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) {\n endKeyboard()\n }\n }}\n class=\"pointer-events-auto\"\n />\n <ResizablePanel\n minSize={isRight() ? minimum() / maximum() : 0}\n maxSize={1}\n aria-hidden=\"true\"\n />\n </ResizablePanelGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA,SAAgBiB,kBAAkBC,OAA+B;CAC/D,MAAMR,gBAAgBS,KAAKC,IAAI,GAAGF,MAAMR,OAAO;CAC/C,MAAMD,gBAAgBU,KAAKE,IAAIX,QAAQ,GAAGS,KAAKC,IAAI,GAAGF,MAAMT,OAAO,CAAC;CACpE,MAAM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E,QAAQ,IAAIC,QAAQ,CAAC;MAC7D;KACF;KACA0E,UAAUlB,UAAU;MAClB,IAAI;OAAC;OAAa;OAAc;OAAQ;MAAK,CAAC,CAACgB,SAAShB,MAAMiB,GAAG,GAC/D1C,YAAY;KAEhB;KAAC,SAAA;IAAA,CAAA;IAAAE,gBAGF1C,gBAAc;KAAA,IACbsD,UAAO;MAAA,OAAEC,WAAA,CAAA,CAAAhC,QAAQ,CAAC,CAAA,CAAA,IAAGf,QAAQ,IAAIC,QAAQ,IAAI;KAAC;KAC9C+C,SAAS;KAAC,eAAA;IAAA,CAAA;GAAA;EAAA;CAAA,CAAA;AAKlB"}
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
maximum: number;
|
|
5
|
-
step?: number;
|
|
6
|
-
label?: string;
|
|
7
|
-
controls?: string;
|
|
8
|
-
class?: string;
|
|
9
|
-
onChange(value: number): void;
|
|
10
|
-
onCommit?(value: number): void;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Resize a contextual sidebar without making its host recreate a separator
|
|
14
|
-
* widget. Corvu owns pointer capture, cancellation, constraints, keyboard
|
|
15
|
-
* movement and cleanup. Its two invisible panels provide a bounded pixel
|
|
16
|
-
* ruler; the host retains the real pane layout and preference persistence.
|
|
17
|
-
* Place this inside the positioned sidebar. The ruler can extend over the
|
|
18
|
-
* adjacent content, but only its handle participates in pointer hit testing.
|
|
19
|
-
*/
|
|
1
|
+
import { type PixelResizeHandleProps } from '../pixel-resize-handle/pixel-resize-handle';
|
|
2
|
+
export type SidebarNavResizeHandleProps = Omit<PixelResizeHandleProps, 'side'>;
|
|
3
|
+
/** Keep the established left-sidebar API as a thin adapter over the shared edge ruler. */
|
|
20
4
|
export declare function SidebarNavResizeHandle(props: SidebarNavResizeHandleProps): import("solid-js").JSX.Element;
|
|
21
5
|
//# sourceMappingURL=sidebar-nav-resize-handle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-nav-resize-handle.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sidebar-nav-resize-handle.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,4CAA4C,CAAA;AAEnD,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAA;AAE9E,0FAA0F;AAC1F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,kCAExE"}
|
|
@@ -1,82 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createComponent } from "solid-js/web";
|
|
3
|
-
import Resizable from "@corvu/resizable";
|
|
1
|
+
import { PixelResizeHandle } from "../pixel-resize-handle/pixel-resize-handle.js";
|
|
2
|
+
import { createComponent, mergeProps } from "solid-js/web";
|
|
4
3
|
//#region src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Resize a contextual sidebar without making its host recreate a separator
|
|
7
|
-
* widget. Corvu owns pointer capture, cancellation, constraints, keyboard
|
|
8
|
-
* movement and cleanup. Its two invisible panels provide a bounded pixel
|
|
9
|
-
* ruler; the host retains the real pane layout and preference persistence.
|
|
10
|
-
* Place this inside the positioned sidebar. The ruler can extend over the
|
|
11
|
-
* adjacent content, but only its handle participates in pointer hit testing.
|
|
12
|
-
*/
|
|
4
|
+
/** Keep the established left-sidebar API as a thin adapter over the shared edge ruler. */
|
|
13
5
|
function SidebarNavResizeHandle(props) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return createComponent(Resizable, {
|
|
19
|
-
orientation: "horizontal",
|
|
20
|
-
get sizes() {
|
|
21
|
-
return [value() / maximum(), 1 - value() / maximum()];
|
|
22
|
-
},
|
|
23
|
-
get keyboardDelta() {
|
|
24
|
-
return `${props.step ?? 16}px`;
|
|
25
|
-
},
|
|
26
|
-
get style() {
|
|
27
|
-
return { width: `${maximum()}px` };
|
|
28
|
-
},
|
|
29
|
-
get ["class"]() {
|
|
30
|
-
return cn("pointer-events-none absolute inset-y-0 start-0 flex", props.class);
|
|
31
|
-
},
|
|
32
|
-
onSizesChange: (sizes) => {
|
|
33
|
-
const next = Math.round((sizes[0] ?? 0) * maximum());
|
|
34
|
-
if (next !== value()) props.onChange(Math.min(maximum(), Math.max(minimum(), next)));
|
|
35
|
-
},
|
|
36
|
-
get children() {
|
|
37
|
-
return [
|
|
38
|
-
createComponent(Resizable.Panel, {
|
|
39
|
-
get minSize() {
|
|
40
|
-
return minimum() / maximum();
|
|
41
|
-
},
|
|
42
|
-
maxSize: 1,
|
|
43
|
-
"aria-hidden": "true"
|
|
44
|
-
}),
|
|
45
|
-
createComponent(Resizable.Handle, {
|
|
46
|
-
get ["aria-label"]() {
|
|
47
|
-
return props.label ?? "Resize navigation";
|
|
48
|
-
},
|
|
49
|
-
get ["aria-controls"]() {
|
|
50
|
-
return props.controls;
|
|
51
|
-
},
|
|
52
|
-
"aria-orientation": "vertical",
|
|
53
|
-
get ["aria-valuemin"]() {
|
|
54
|
-
return minimum();
|
|
55
|
-
},
|
|
56
|
-
get ["aria-valuemax"]() {
|
|
57
|
-
return maximum();
|
|
58
|
-
},
|
|
59
|
-
get ["aria-valuenow"]() {
|
|
60
|
-
return value();
|
|
61
|
-
},
|
|
62
|
-
onHandleDragEnd: commit,
|
|
63
|
-
onKeyUp: (event) => {
|
|
64
|
-
if ([
|
|
65
|
-
"ArrowLeft",
|
|
66
|
-
"ArrowRight",
|
|
67
|
-
"Home",
|
|
68
|
-
"End"
|
|
69
|
-
].includes(event.key)) commit();
|
|
70
|
-
},
|
|
71
|
-
"class": "pointer-events-auto relative z-(--z-docked) w-px -translate-x-full shrink-0 bg-transparent after:absolute after:inset-y-0 after:-inset-x-1 after:w-3 hover:bg-primary focus-visible:bg-primary focus-visible:ring-3 focus-visible:ring-primary-subtle focus-visible:outline-none"
|
|
72
|
-
}),
|
|
73
|
-
createComponent(Resizable.Panel, {
|
|
74
|
-
minSize: 0,
|
|
75
|
-
"aria-hidden": "true"
|
|
76
|
-
})
|
|
77
|
-
];
|
|
6
|
+
return createComponent(PixelResizeHandle, mergeProps(props, {
|
|
7
|
+
side: "left",
|
|
8
|
+
get label() {
|
|
9
|
+
return props.label ?? "Resize navigation";
|
|
78
10
|
}
|
|
79
|
-
});
|
|
11
|
+
}));
|
|
80
12
|
}
|
|
81
13
|
//#endregion
|
|
82
14
|
export { SidebarNavResizeHandle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-nav-resize-handle.js","names":["
|
|
1
|
+
{"version":3,"file":"sidebar-nav-resize-handle.js","names":["PixelResizeHandle","PixelResizeHandleProps","SidebarNavResizeHandleProps","Omit","SidebarNavResizeHandle","props","_$createComponent","_$mergeProps","side","label","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx"],"sourcesContent":["import {\n PixelResizeHandle,\n type PixelResizeHandleProps,\n} from '../pixel-resize-handle/pixel-resize-handle'\n\nexport type SidebarNavResizeHandleProps = Omit<PixelResizeHandleProps, 'side'>\n\n/** Keep the established left-sidebar API as a thin adapter over the shared edge ruler. */\nexport function SidebarNavResizeHandle(props: SidebarNavResizeHandleProps) {\n return <PixelResizeHandle {...props} side=\"left\" label={props.label ?? 'Resize navigation'} />\n}\n"],"mappings":";;;;AAQA,SAAgBI,uBAAuBC,OAAoC;CACzE,OAAAC,gBAAQN,mBAAiBO,WAAKF,OAAK;EAAEG,MAAI;EAAA,IAAQC,QAAK;GAAA,OAAEJ,MAAMI,SAAS;EAAmB;CAAA,CAAA,CAAA;AAC5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAmC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAmC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;8EAqCzB,CAAA;AAED,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,cAAc,GAAG,MAAM,IAAI,gBAAgB,CAC1E,CAAC,EACD,iBAAiB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CACvC,CAAA;AAED,wBAAgB,KAAK,CAAC,CAAC,SAAS,cAAc,GAAG,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,kCAU5E"}
|
|
@@ -18,11 +18,15 @@ var badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center
|
|
|
18
18
|
default: "bg-primary text-primary-foreground",
|
|
19
19
|
secondary: "bg-secondary text-secondary-foreground",
|
|
20
20
|
outline: "border-border text-foreground",
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Tinted status fills, for counts and states rather than actions. The
|
|
23
|
+
* word stays in `foreground` for contrast; the glyph takes the status
|
|
24
|
+
* hue, so tags of different tones read apart at a glance.
|
|
25
|
+
*/
|
|
26
|
+
success: "bg-success-subtle text-foreground [&_svg]:text-success",
|
|
27
|
+
warning: "bg-warning-subtle text-foreground [&_svg]:text-warning",
|
|
28
|
+
destructive: "bg-destructive-subtle text-foreground [&_svg]:text-destructive",
|
|
29
|
+
info: "bg-info-subtle text-foreground [&_svg]:text-info",
|
|
26
30
|
subtle: "bg-primary-subtle text-primary",
|
|
27
31
|
/**
|
|
28
32
|
* A count that asks for attention, pinned to a corner of another control
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","names":["Polymorphic","PolymorphicProps","ComponentProps","splitProps","ValidComponent","cva","VariantProps","cn","badgeVariants","variants","variant","default","secondary","outline","success","warning","destructive","info","subtle","notification","size","sm","md","lg","defaultVariants","BadgeVariantProps","BadgeProps","T","class","Badge","props","local","rest","_$createComponent","_$mergeProps","as","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport { type ComponentProps, splitProps, type ValidComponent } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge — the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-md border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n
|
|
1
|
+
{"version":3,"file":"badge.js","names":["Polymorphic","PolymorphicProps","ComponentProps","splitProps","ValidComponent","cva","VariantProps","cn","badgeVariants","variants","variant","default","secondary","outline","success","warning","destructive","info","subtle","notification","size","sm","md","lg","defaultVariants","BadgeVariantProps","BadgeProps","T","class","Badge","props","local","rest","_$createComponent","_$mergeProps","as","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport { type ComponentProps, splitProps, type ValidComponent } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge — the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-md border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n /**\n * Tinted status fills, for counts and states rather than actions. The\n * word stays in `foreground` for contrast; the glyph takes the status\n * hue, so tags of different tones read apart at a glance.\n */\n success: 'bg-success-subtle text-foreground [&_svg]:text-success',\n warning: 'bg-warning-subtle text-foreground [&_svg]:text-warning',\n destructive: 'bg-destructive-subtle text-foreground [&_svg]:text-destructive',\n info: 'bg-info-subtle text-foreground [&_svg]:text-info',\n subtle: 'bg-primary-subtle text-primary',\n /**\n * A count that asks for attention, pinned to a corner of another control\n * (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever\n * surface sits behind the corner, where the destructive tint all but\n * disappears — so it takes the solid, contrast-measured action fill.\n */\n notification: 'bg-destructive-action text-destructive-action-foreground',\n },\n size: {\n sm: 'h-4 px-1.5 text-2xs',\n md: 'h-5 px-2 text-xs',\n lg: 'h-6 px-2.5 text-xs',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n)\n\ntype BadgeVariantProps = VariantProps<typeof badgeVariants>\n\nexport type BadgeProps<T extends ValidComponent = 'span'> = PolymorphicProps<\n T,\n BadgeVariantProps & { class?: string }\n>\n\nexport function Badge<T extends ValidComponent = 'span'>(props: BadgeProps<T>) {\n const [local, rest] = splitProps(props as BadgeProps, ['variant', 'size', 'class'])\n\n return (\n <Polymorphic\n as=\"span\"\n class={cn(badgeVariants({ variant: local.variant, size: local.size }), local.class)}\n {...(rest as ComponentProps<'span'>)}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAaQ,gBAAgBH,IAC3B,iNACA;CACEI,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,WAAW;GACXC,SAAS;;;;;;GAMTC,SAAS;GACTC,SAAS;GACTC,aAAa;GACbC,MAAM;GACNC,QAAQ;;;;;;;GAORC,cAAc;EAChB;EACAC,MAAM;GACJC,IAAI;GACJC,IAAI;GACJC,IAAI;EACN;CACF;CACAC,iBAAiB;EACfd,SAAS;EACTU,MAAM;CACR;AACF,CACF;AASA,SAAgBS,MAAyCC,OAAsB;CAC7E,MAAM,CAACC,OAAOC,QAAQ7B,WAAW2B,OAAqB;EAAC;EAAW;EAAQ;CAAO,CAAC;CAElF,OAAAG,gBACGjC,aAAWkC,WAAA;EACVC,IAAE;EAAA,KAAA,WAAA;GAAA,OACK5B,GAAGC,cAAc;IAAEE,SAASqB,MAAMrB;IAASU,MAAMW,MAAMX;GAAK,CAAC,GAAGW,MAAMH,KAAK;EAAC;CAAA,GAC9EI,IAA8B,CAAA;AAGzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/combobox/combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAA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C,OAAO,eAAe,CAAC,OAAO,CAAC,kCAuBpF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,kCAW9E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAGpF;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,kCAkB3E"}
|
|
@@ -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 { useFormFieldControl } from "../../../lib/form-field.js";
|
|
4
4
|
import { className, createComponent, delegateEvents, effect, insert, memo, mergeProps, template } from "solid-js/web";
|
|
5
5
|
import { Check, ChevronDown, X } from "lucide-solid";
|
|
@@ -84,7 +84,7 @@ function ComboboxTrigger(props) {
|
|
|
84
84
|
function ComboboxContent(props) {
|
|
85
85
|
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
86
86
|
return createComponent(Combobox.Portal, { get children() {
|
|
87
|
-
return createComponent(Combobox.Content, mergeProps({ get ["class"]() {
|
|
87
|
+
return createComponent(Combobox.Content, mergeProps(topLayerProps, { get ["class"]() {
|
|
88
88
|
return cn("bg-popover text-popover-foreground rounded-xl border border-border shadow-lg", "z-(--z-menu) max-h-72 min-w-(--kb-popper-anchor-width) origin-(--kb-combobox-content-transform-origin) overflow-hidden", "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);
|
|
89
89
|
} }, rest, { get children() {
|
|
90
90
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.js","names":["Combobox","KobalteCombobox","Check","ChevronDown","X","ComponentProps","Show","splitProps","menuContentPadding","menuItem","popoverArrow","useFormFieldControl","cn","props","Option","OptGroup","_$createComponent","ComboboxControl","Control","local","rest","_$mergeProps","class","ComboboxInput","Input","field","id","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","ComboboxTrigger","Trigger","children","_$memo","Icon","ComboboxContent","Content","Portal","Listbox","Arrow","ComboboxItem","Item","ItemLabel","ItemIndicator","ComboboxSection","Section","ComboboxClear","onClear","when","_el$","_tmpl$","$$click","_$insert","_$effect","_$className","_$delegateEvents","Combobox","_$createComponent","KobalteCombobox","_$mergeProps","_$memo","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as KobalteCombobox } from '@kobalte/core/combobox'\nimport { Check, ChevronDown, X } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow } from '#lib/overlay'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Combobox.\n *\n * A Select whose list is filterable by typing. The difference from Select is\n * not cosmetic: a Combobox has a text input, so the user can narrow forty\n * options to one without reading the list. Above roughly ten options the\n * search is the feature; below it, a Select is quieter and a RadioGroup is\n * better still.\n *\n * Kobalte supplies the filtering, the `aria-activedescendant` wiring, the\n * keyboard selection and the multiple-selection mode, which is the part a\n * hand-rolled version reliably gets wrong.\n */\nexport function Combobox<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteCombobox<Option, OptGroup>>\n) {\n return <KobalteCombobox {...props} />\n}\n\nexport function ComboboxControl(props: ComponentProps<typeof KobalteCombobox.Control>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Control\n class={cn(\n 'border-input bg-transparent flex h-control-md w-full items-center gap-1.5 rounded-md border px-control-sm',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxInput(props: ComponentProps<typeof KobalteCombobox.Input>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <KobalteCombobox.Input\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'h-full flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxTrigger(props: ComponentProps<typeof KobalteCombobox.Trigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Trigger\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center justify-center rounded-sm outline-none',\n 'transition-colors ease-out hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteCombobox.Icon>\n <ChevronDown class=\"size-4\" />\n </KobalteCombobox.Icon>\n </KobalteCombobox.Trigger>\n )\n}\n\nexport function ComboboxContent(props: ComponentProps<typeof KobalteCombobox.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Portal>\n <KobalteCombobox.Content\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-72 min-w-(--kb-popper-anchor-width) origin-(--kb-combobox-content-transform-origin) overflow-hidden',\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 <KobalteCombobox.Listbox class={cn('max-h-72 overflow-y-auto', menuContentPadding)} />\n {local.children}\n <KobalteCombobox.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteCombobox.Content>\n </KobalteCombobox.Portal>\n )\n}\n\nexport function ComboboxItem(props: ComponentProps<typeof KobalteCombobox.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteCombobox.ItemLabel>{local.children}</KobalteCombobox.ItemLabel>\n <KobalteCombobox.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteCombobox.ItemIndicator>\n </KobalteCombobox.Item>\n )\n}\n\nexport function ComboboxSection(props: ComponentProps<typeof KobalteCombobox.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCombobox.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\n/** The clear affordance for a single-select Combobox with a value. */\nexport function ComboboxClear(props: { class?: string; onClear: () => void }) {\n return (\n <Show when={props.onClear}>\n <button\n type=\"button\"\n aria-label=\"Clear selection\"\n onClick={() => props.onClear()}\n class={cn(\n 'text-muted-foreground flex size-4 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n props.class\n )}\n >\n <X class=\"size-3.5\" />\n </button>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgBA,WACda,OACA;CACA,OAAAG,gBAAQf,UAAoBY,KAAK;AACnC;AAEA,SAAgBI,gBAAgBJ,OAAuD;CACrF,MAAM,CAACM,OAAOC,QAAQb,WAAWM,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAG,gBACGf,SAAgBiB,SAAOG,WAAA,EAAA,KAAA,WAAA;EAAA,OACfT,GACL,6GACA,uDACA,iFACA,kGACA,iEACAO,MAAMG,KACR;CAAC,EAAA,GACGF,IAAI,CAAA;AAGd;AAEA,SAAgBG,cAAcV,OAAqD;CACjF,MAAM,CAACM,OAAOC,QAAQb,WAAWM,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CAAmB,CACpB;CACD,MAAMY,QAAQd,oBAAoB,WAAW;EAC3Ce,IAAIP,MAAMO;EACV,cAAcP,MAAM;EACpB,mBAAmBA,MAAM;EACzB,oBAAoBA,MAAM;EAC1B,gBAAgBA,MAAM;EACtB,qBAAqBA,MAAM;CAC7B,CAAC;CAED,OAAAH,gBACGf,SAAgBuB,OAAKH,WAAA;EAAA,IACpBK,KAAE;GAAA,OAAED,OAAOC,MAAMP,MAAMO;EAAE;EAAA,KAAA,gBAAA;GAAA,OACbP,MAAM;EAAa;EAAA,KAAA,qBAAA;GAAA,OACdM,QAAQ,sBAAsBN,MAAM;EAAkB;EAAA,KAAA,sBAAA;GAAA,OACrDM,QAAQ,uBAAuBN,MAAM;EAAmB;EAAA,KAAA,kBAAA;GAAA,OAC5DM,QAAQ,mBAAmBN,MAAM;EAAe;EAAA,KAAA,uBAAA;GAAA,OAC3CM,QAAQ,wBAAwBN,MAAM;EAAoB;EAAA,KAAA,WAAA;GAAA,OACtEP,GACL,uFACA,+BACAO,MAAMG,KACR;EAAC;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AAItB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQT,GAAGH,UAAU,QAAQU,MAAMG,KAAK;CAAC,EAAA,GAAMF,MAAI,EAAA,IAAAc,WAAA;EAAA,OAAA,CAAAlB,gBACrEf,SAAgB2C,WAAS,EAAA,IAAAV,WAAA;GAAA,OAAEf,MAAMe;EAAQ,EAAA,CAAA,GAAAlB,gBACzCf,SAAgB4C,eAAa;GAAA,SAAA;GAAA,IAAAX,WAAA;IAAA,OAAAlB,gBAC3Bd,OAAK,EAAA,SAAA,SAAA,CAAA;GAAA;EAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAId;AAEA,SAAgB4C,gBAAgBjC,OAAuD;CACrF,MAAM,CAACM,OAAOC,QAAQb,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQf,SAAgB8C,SAAO1B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQT,GAAG,iBAAiBO,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AACnF;;AAGA,SAAgB4B,cAAcnC,OAAgD;CAC5E,OAAAG,gBACGV,MAAI;EAAA,IAAC4C,OAAI;GAAA,OAAErC,MAAMoC;EAAO;EAAA,IAAAf,WAAA;GAAA,IAAAiB,OAAAC,OAAA;GAAAD,KAAAE,gBAINxC,MAAMoC,QAAQ;GAACK,OAAAH,MAAAnC,gBAQ7BZ,GAAC,EAAA,SAAA,WAAA,CAAA,CAAA;GAAAmD,aAAAC,UAAAL,MAPKvC,GACL,qFACA,iEACA,oFACAC,MAAMS,KACR,CAAC,CAAA;GAAA,OAAA6B;EAAA;CAAA,CAAA;AAMT;AAACM,eAAA,CAAA,OAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"combobox.js","names":["Combobox","KobalteCombobox","Check","ChevronDown","X","ComponentProps","Show","splitProps","menuContentPadding","menuItem","popoverArrow","topLayerProps","useFormFieldControl","cn","props","Option","OptGroup","_$createComponent","ComboboxControl","Control","local","rest","_$mergeProps","class","ComboboxInput","Input","field","id","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","ComboboxTrigger","Trigger","children","_$memo","Icon","ComboboxContent","Content","Portal","Listbox","Arrow","ComboboxItem","Item","ItemLabel","ItemIndicator","ComboboxSection","Section","ComboboxClear","onClear","when","_el$","_tmpl$","$$click","_$insert","_$effect","_$className","_$delegateEvents","Combobox","_$createComponent","KobalteCombobox","_$mergeProps","_$memo","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as KobalteCombobox } from '@kobalte/core/combobox'\nimport { Check, ChevronDown, X } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow, topLayerProps } from '#lib/overlay'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Combobox.\n *\n * A Select whose list is filterable by typing. The difference from Select is\n * not cosmetic: a Combobox has a text input, so the user can narrow forty\n * options to one without reading the list. Above roughly ten options the\n * search is the feature; below it, a Select is quieter and a RadioGroup is\n * better still.\n *\n * Kobalte supplies the filtering, the `aria-activedescendant` wiring, the\n * keyboard selection and the multiple-selection mode, which is the part a\n * hand-rolled version reliably gets wrong.\n */\nexport function Combobox<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteCombobox<Option, OptGroup>>\n) {\n return <KobalteCombobox {...props} />\n}\n\nexport function ComboboxControl(props: ComponentProps<typeof KobalteCombobox.Control>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Control\n class={cn(\n 'border-input bg-transparent flex h-control-md w-full items-center gap-1.5 rounded-md border px-control-sm',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxInput(props: ComponentProps<typeof KobalteCombobox.Input>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <KobalteCombobox.Input\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'h-full flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxTrigger(props: ComponentProps<typeof KobalteCombobox.Trigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Trigger\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center justify-center rounded-sm outline-none',\n 'transition-colors ease-out hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteCombobox.Icon>\n <ChevronDown class=\"size-4\" />\n </KobalteCombobox.Icon>\n </KobalteCombobox.Trigger>\n )\n}\n\nexport function ComboboxContent(props: ComponentProps<typeof KobalteCombobox.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Portal>\n <KobalteCombobox.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-72 min-w-(--kb-popper-anchor-width) origin-(--kb-combobox-content-transform-origin) overflow-hidden',\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 <KobalteCombobox.Listbox class={cn('max-h-72 overflow-y-auto', menuContentPadding)} />\n {local.children}\n <KobalteCombobox.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteCombobox.Content>\n </KobalteCombobox.Portal>\n )\n}\n\nexport function ComboboxItem(props: ComponentProps<typeof KobalteCombobox.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteCombobox.ItemLabel>{local.children}</KobalteCombobox.ItemLabel>\n <KobalteCombobox.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteCombobox.ItemIndicator>\n </KobalteCombobox.Item>\n )\n}\n\nexport function ComboboxSection(props: ComponentProps<typeof KobalteCombobox.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCombobox.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\n/** The clear affordance for a single-select Combobox with a value. */\nexport function ComboboxClear(props: { class?: string; onClear: () => void }) {\n return (\n <Show when={props.onClear}>\n <button\n type=\"button\"\n aria-label=\"Clear selection\"\n onClick={() => props.onClear()}\n class={cn(\n 'text-muted-foreground flex size-4 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n props.class\n )}\n >\n <X class=\"size-3.5\" />\n </button>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,S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AlB,gBACrEhB,SAAgB4C,WAAS,EAAA,IAAAV,WAAA;GAAA,OAAEf,MAAMe;EAAQ,EAAA,CAAA,GAAAlB,gBACzChB,SAAgB6C,eAAa;GAAA,SAAA;GAAA,IAAAX,WAAA;IAAA,OAAAlB,gBAC3Bf,OAAK,EAAA,SAAA,SAAA,CAAA;GAAA;EAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAId;AAEA,SAAgB6C,gBAAgBjC,OAAuD;CACrF,MAAM,CAACM,OAAOC,QAAQd,WAAWO,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQhB,SAAgB+C,SAAO1B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQT,GAAG,iBAAiBO,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AACnF;;AAGA,SAAgB4B,cAAcnC,OAAgD;CAC5E,OAAAG,gBACGX,MAAI;EAAA,IAAC6C,OAAI;GAAA,OAAErC,MAAMoC;EAAO;EAAA,IAAAf,WAAA;GAAA,IAAAiB,OAAAC,OAAA;GAAAD,KAAAE,gBAINxC,MAAMoC,QAAQ;GAACK,OAAAH,MAAAnC,gBAQ7Bb,GAAC,EAAA,SAAA,WAAA,CAAA,CAAA;GAAAoD,aAAAC,UAAAL,MAPKvC,GACL,qFACA,iEACA,oFACAC,MAAMS,KACR,CAAC,CAAA;GAAA,OAAA6B;EAAA;CAAA,CAAA;AAMT;AAACM,eAAA,CAAA,OAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/context-menu/context-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/context-menu/context-menu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CAAC,kCAG9F;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,GAAG,CAAC,kCAElF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,UAAU,CAAC,kCAShG;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,kBAAkB,CAAC,UAAU,CAAC,kCAkBhG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
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, template } from "solid-js/web";
|
|
4
4
|
import { Check, ChevronRight, Circle } from "lucide-solid";
|
|
5
5
|
import { splitProps } from "solid-js";
|
|
@@ -28,7 +28,7 @@ function ContextMenuTrigger(props) {
|
|
|
28
28
|
function ContextMenuContent(props) {
|
|
29
29
|
const [local, rest] = splitProps(props, ["class"]);
|
|
30
30
|
return createComponent(ContextMenu.Portal, { get children() {
|
|
31
|
-
return createComponent(ContextMenu.Content, mergeProps({ get ["class"]() {
|
|
31
|
+
return createComponent(ContextMenu.Content, mergeProps(topLayerProps, { get ["class"]() {
|
|
32
32
|
return cn(overlaySurface, overlayMotion, "z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden", "p-1", local.class);
|
|
33
33
|
} }, rest));
|
|
34
34
|
} });
|
|
@@ -122,7 +122,7 @@ function ContextMenuSubTrigger(props) {
|
|
|
122
122
|
function ContextMenuSubContent(props) {
|
|
123
123
|
const [local, rest] = splitProps(props, ["class"]);
|
|
124
124
|
return createComponent(ContextMenu.Portal, { get children() {
|
|
125
|
-
return createComponent(ContextMenu.SubContent, mergeProps({ get ["class"]() {
|
|
125
|
+
return createComponent(ContextMenu.SubContent, mergeProps(topLayerProps, { get ["class"]() {
|
|
126
126
|
return cn(overlaySurface, overlayMotion, "z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden", "p-1", local.class);
|
|
127
127
|
} }, rest));
|
|
128
128
|
} });
|