@glasshome/ui 1.41.0 → 1.43.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/SPEC.md +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/anchor-placement.d.ts +34 -0
- package/dist/lib/balance-rows.d.ts +10 -4
- package/dist/lib/behavior/anchored.d.ts +26 -0
- package/dist/lib/behavior/button-root.d.ts +7 -0
- package/dist/lib/behavior/collection.d.ts +32 -0
- package/dist/lib/behavior/controllable.d.ts +8 -0
- package/dist/lib/behavior/dismiss.d.ts +13 -0
- package/dist/lib/behavior/focus-scope.d.ts +24 -0
- package/dist/lib/behavior/hide-outside.d.ts +7 -0
- package/dist/lib/behavior/layer-stack.d.ts +34 -0
- package/dist/lib/behavior/menu.d.ts +59 -0
- package/dist/lib/behavior/modal-root.d.ts +68 -0
- package/dist/lib/behavior/polymorphic.d.ts +6 -0
- package/dist/lib/behavior/presence.d.ts +18 -0
- package/dist/lib/behavior/range.d.ts +44 -0
- package/dist/lib/behavior/solid.d.ts +13 -0
- package/dist/lib/color/color.d.ts +41 -0
- package/dist/lib/color/index.d.ts +2 -0
- package/dist/lib/color/intl.d.ts +40 -0
- package/dist/lib/dock-slot-classes.d.ts +2 -0
- package/dist/lib/hold.d.ts +1 -1
- package/dist/lib/locale.d.ts +3 -0
- package/dist/lib/menu-classes.d.ts +2 -0
- package/dist/lib/motion-classes.d.ts +5 -2
- package/dist/lib/overlay-classes.d.ts +4 -0
- package/dist/lib/page-cover.d.ts +8 -0
- package/dist/lib/scroll-track.d.ts +3 -2
- package/dist/lib/section-tokens.d.ts +1 -1
- package/dist/lib/segment-classes.d.ts +2 -0
- package/dist/lib/shadow-layer.d.ts +0 -43
- package/dist/lib/toggle-set.d.ts +44 -0
- package/dist/lib/visually-hidden.d.ts +3 -0
- package/dist/solid/accordion.d.ts +35 -11
- package/dist/solid/alert-dialog.d.ts +5 -8
- package/dist/solid/avatar.d.ts +8 -4
- package/dist/solid/bottom-sheet/bottom-sheet.d.ts +2 -2
- package/dist/solid/bottom-sheet/constants.d.ts +1 -1
- package/dist/solid/button.d.ts +5 -4
- package/dist/solid/charts.d.ts +1 -1
- package/dist/solid/checkbox.d.ts +14 -4
- package/dist/solid/collapsible.d.ts +33 -5
- package/dist/solid/color-disc.d.ts +1 -1
- package/dist/solid/color-slider.d.ts +1 -1
- package/dist/solid/color-wheel.d.ts +1 -1
- package/dist/solid/context-menu.d.ts +58 -24
- package/dist/solid/dialog-parts.d.ts +53 -16
- package/dist/solid/dialog.d.ts +7 -10
- package/dist/solid/dropdown-menu.d.ts +55 -24
- package/dist/solid/empty.d.ts +1 -1
- package/dist/solid/form.d.ts +5 -6
- package/dist/solid/hover-card.d.ts +65 -9
- package/dist/solid/index.d.ts +5 -2
- package/dist/solid/index.js +8671 -14317
- package/dist/solid/input-group.d.ts +6 -6
- package/dist/solid/item.d.ts +1 -1
- package/dist/solid/menu-parts.d.ts +175 -24
- package/dist/solid/option-card.d.ts +1 -4
- package/dist/solid/picker-row.d.ts +2 -0
- package/dist/solid/popover.d.ts +77 -12
- package/dist/solid/progress.d.ts +11 -3
- package/dist/solid/radio-group.d.ts +31 -6
- package/dist/solid/responsive-dialog.d.ts +3 -1
- package/dist/solid/scroll-area.d.ts +1 -1
- package/dist/solid/section-card.d.ts +2 -3
- package/dist/solid/select.d.ts +107 -10
- package/dist/solid/selection.d.ts +10 -1
- package/dist/solid/sheet.d.ts +6 -9
- package/dist/solid/sliding-indicator.d.ts +1 -1
- package/dist/solid/sonner.d.ts +1 -1
- package/dist/solid/stale-veil.d.ts +7 -0
- package/dist/solid/tabs.d.ts +28 -9
- package/dist/solid/toggle-group.d.ts +30 -5
- package/dist/solid/toggle.d.ts +11 -3
- package/dist/solid/tooltip.d.ts +71 -9
- package/dist/tokens/index.js +54 -51
- package/dist/{utils-CGN4X-2O.js → utils-3Codx-NZ.js} +848 -618
- package/package.json +6 -7
- package/src/index.ts +1 -0
- package/src/lib/anchor-placement.ts +77 -4
- package/src/lib/balance-rows.ts +115 -40
- package/src/lib/behavior/anchored.ts +106 -0
- package/src/lib/behavior/button-root.tsx +103 -0
- package/src/lib/behavior/collection.ts +218 -0
- package/src/lib/behavior/controllable.ts +22 -0
- package/src/lib/behavior/dismiss.ts +185 -0
- package/src/lib/behavior/focus-scope.ts +227 -0
- package/src/lib/behavior/hide-outside.ts +85 -0
- package/src/lib/behavior/layer-stack.ts +150 -0
- package/src/lib/behavior/menu.ts +470 -0
- package/src/lib/behavior/modal-root.tsx +452 -0
- package/src/lib/behavior/polymorphic.tsx +30 -0
- package/src/lib/behavior/presence.ts +89 -0
- package/src/lib/behavior/range.ts +212 -0
- package/src/lib/behavior/solid.ts +30 -0
- package/src/lib/clipboard.ts +4 -4
- package/src/lib/color/color.ts +746 -0
- package/src/lib/color/index.ts +2 -0
- package/src/lib/color/intl.ts +60 -0
- package/src/lib/dock-slot-classes.ts +3 -0
- package/src/lib/hold.ts +1 -1
- package/src/lib/locale.ts +62 -0
- package/src/lib/menu-classes.ts +3 -0
- package/src/lib/motion-classes.ts +33 -8
- package/src/lib/overlay-classes.ts +8 -3
- package/src/lib/page-cover.ts +47 -0
- package/src/lib/scroll-track.ts +11 -6
- package/src/lib/section-tokens.ts +1 -1
- package/src/lib/segment-classes.ts +3 -0
- package/src/lib/shadow-layer.ts +0 -136
- package/src/lib/toggle-set.ts +133 -0
- package/src/lib/visually-hidden.ts +15 -0
- package/src/solid/accordion.tsx +294 -20
- package/src/solid/alert-dialog.tsx +36 -85
- package/src/solid/area-picker.tsx +5 -3
- package/src/solid/avatar.tsx +98 -24
- package/src/solid/badge.tsx +5 -5
- package/src/solid/bottom-sheet/bottom-sheet.tsx +73 -129
- package/src/solid/bottom-sheet/constants.ts +3 -1
- package/src/solid/bottom-sheet/drag-controller.ts +11 -0
- package/src/solid/breadcrumb.tsx +4 -4
- package/src/solid/button-group.tsx +4 -4
- package/src/solid/button.tsx +12 -6
- package/src/solid/card.tsx +5 -4
- package/src/solid/charts.tsx +1 -1
- package/src/solid/checkbox.tsx +167 -44
- package/src/solid/collapsible.tsx +260 -12
- package/src/solid/color-disc.tsx +11 -12
- package/src/solid/color-slider.tsx +114 -47
- package/src/solid/color-wheel.tsx +137 -39
- package/src/solid/context-menu.tsx +287 -86
- package/src/solid/dialog-parts.tsx +135 -46
- package/src/solid/dialog.tsx +44 -76
- package/src/solid/dock-edit.tsx +5 -4
- package/src/solid/dock.tsx +6 -5
- package/src/solid/dropdown-menu.tsx +252 -107
- package/src/solid/empty.tsx +1 -1
- package/src/solid/entity-selector.tsx +5 -3
- package/src/solid/face-toggle.tsx +43 -18
- package/src/solid/form.tsx +9 -9
- package/src/solid/glyph-tile.tsx +48 -21
- package/src/solid/hover-card.tsx +288 -21
- package/src/solid/icon-picker.tsx +2 -1
- package/src/solid/image-picker.tsx +6 -5
- package/src/solid/index.ts +5 -4
- package/src/solid/input-group.tsx +7 -5
- package/src/solid/input-otp.tsx +2 -1
- package/src/solid/item.tsx +5 -5
- package/src/solid/logo.tsx +5 -4
- package/src/solid/menu-parts.tsx +619 -145
- package/src/solid/option-card.tsx +6 -10
- package/src/solid/picker-row.tsx +10 -5
- package/src/solid/picker-search.tsx +2 -1
- package/src/solid/popover.tsx +424 -71
- package/src/solid/preview-tile.tsx +1 -1
- package/src/solid/progress.tsx +84 -15
- package/src/solid/radio-group.tsx +271 -34
- package/src/solid/responsive-dialog.tsx +10 -10
- package/src/solid/schema-form.tsx +1 -6
- package/src/solid/scroll-area.tsx +1 -1
- package/src/solid/section-card.tsx +3 -4
- package/src/solid/select.tsx +950 -95
- package/src/solid/selection.tsx +142 -66
- package/src/solid/sheet.tsx +48 -80
- package/src/solid/slider.tsx +115 -65
- package/src/solid/sliding-indicator.tsx +1 -1
- package/src/solid/sonner.tsx +1 -1
- package/src/solid/spotlight.tsx +23 -11
- package/src/solid/stale-veil.tsx +20 -0
- package/src/solid/switch.tsx +8 -6
- package/src/solid/tabs.tsx +377 -52
- package/src/solid/term.tsx +3 -4
- package/src/solid/toggle-group.tsx +237 -95
- package/src/solid/toggle.tsx +43 -9
- package/src/solid/tooltip.tsx +285 -26
- package/src/styles/globals.css +64 -10
- package/src/styles/theme.css +12 -4
- package/src/tokens/material.ts +11 -2
- package/dist/lib/when-animations-settle.d.ts +0 -4
- package/dist/solid/bottom-sheet/focus-trap.d.ts +0 -6
- package/dist/solid/bottom-sheet/scroll-lock.d.ts +0 -2
- package/dist/solid/bottom-sheet/sheet-motion.d.ts +0 -1
- package/src/lib/when-animations-settle.ts +0 -12
- package/src/solid/bottom-sheet/focus-trap.ts +0 -63
- package/src/solid/bottom-sheet/scroll-lock.ts +0 -66
- package/src/solid/bottom-sheet/sheet-motion.ts +0 -4
|
@@ -3,12 +3,15 @@ export declare const FIELD_MOTION = "data-[closed]:animate-select-out data-[expa
|
|
|
3
3
|
export declare const MORPH_MOTION = "[--morph-w:var(--kb-popper-anchor-width)] min-w-[var(--kb-popper-anchor-width)] data-[expanded]:animate-morph-in data-[closed]:animate-morph-out";
|
|
4
4
|
export declare const ANCHORED_MOTION = "data-[expanded]:animate-anchored-in data-[closed]:animate-morph-out";
|
|
5
5
|
export declare const STAGGER = "gh-stagger";
|
|
6
|
-
export declare const MODAL_MOTION = "data-[expanded]:animate-in data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[expanded]:fade-in-0 data-[expanded]:zoom-in-[0.94] data-[expanded]:slide-in-from-bottom-2 data-[closed]:animate-out data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:fade-out-0 data-[closed]:zoom-out-[0.96]";
|
|
7
|
-
export declare const SCRIM_MOTION = "data-[expanded]:animate-in data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[expanded]:fade-in-0 data-[closed]:animate-out data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:fade-out-0";
|
|
6
|
+
export declare const MODAL_MOTION = "data-[expanded]:animate-in data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[expanded]:fade-in-0 data-[expanded]:zoom-in-[0.94] data-[expanded]:slide-in-from-bottom-2 data-[closed]:animate-out data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:fill-mode-forwards data-[closed]:fade-out-0 data-[closed]:zoom-out-[0.96]";
|
|
7
|
+
export declare const SCRIM_MOTION = "data-[expanded]:animate-in data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[expanded]:fade-in-0 data-[closed]:animate-out data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:fill-mode-forwards data-[closed]:fade-out-0";
|
|
8
8
|
export declare const SETTLE_MOTION = "animate-in fade-in-0 slide-in-from-bottom-1 duration-(--duration-state) ease-(--ease-expand)";
|
|
9
|
+
export declare const VEIL_MOTION = "animate-in fade-in-0 duration-(--duration-state) ease-(--ease-emphasis) motion-reduce:animate-none in-[.reduce-motion]:animate-none";
|
|
10
|
+
export declare const STALE_CONTENT = "grayscale";
|
|
9
11
|
export declare const PRESS_DIP = "active:scale-[0.97]";
|
|
10
12
|
export declare const HOLD_MOTION = "scale-0 opacity-0 transition-[scale,opacity] duration-(--duration-state) ease-(--ease-contract) data-[hold]:scale-100 data-[hold]:opacity-100 data-[hold]:duration-(--duration-hold) data-[hold]:ease-linear data-[fired]:scale-100 data-[fired]:opacity-0";
|
|
11
13
|
export declare const DOCK_ARRIVE_MOTION = "pointer-events-none absolute inset-0 rounded-[inherit] opacity-0 ring-2 ring-primary shadow-[0_0_14px_var(--primary)] group-data-[arrived]:animate-dock-arrive";
|
|
12
14
|
export declare const DOCK_EDIT_MOTION = "data-[editing]:animate-dock-jiggle data-[editing]:nth-even:[animation-direction:alternate-reverse] data-[dragging]:animate-none";
|
|
13
15
|
export declare const RISE_MOTION = "origin-bottom transition-[opacity,scale,translate] data-[expanded]:duration-(--duration-expand) data-[expanded]:ease-(--ease-expand) data-[closed]:duration-(--duration-micro) data-[closed]:ease-(--ease-contract) data-[closed]:pointer-events-none data-[closed]:translate-y-2 data-[closed]:scale-95 data-[closed]:opacity-0";
|
|
14
16
|
export declare const TRAVEL_MOTION = "transition-[translate,clip-path] duration-(--duration-morph) ease-(--ease-expand)";
|
|
17
|
+
export declare const MOTION_EXIT_MS: Record<"overlay" | "modal" | "anchored" | "scrim" | "field" | "sheet" | "disclosure", number>;
|
|
@@ -3,12 +3,16 @@ export declare const OVERLAY_SURFACE_BASE = "glass glass-frost [--glass-rim:0.5]
|
|
|
3
3
|
export declare const OVERLAY_SURFACE = "glass glass-frost [--glass-rim:0.5] [--glass-lift:0.6] [--glass-light:0] [--glass-edge:color-mix(in_srgb,var(--border)_90%,transparent)] [--glass-base:color-mix(in_srgb,var(--popover)_92%,transparent)] backdrop-blur-[var(--glass-blur,var(--material-blur,24px))] backdrop-saturate-[calc(var(--_material-vibrancy,1)*1.2)] backdrop-brightness-[calc(1+(var(--_material-vibrancy,1)-1)*0.2)]";
|
|
4
4
|
export declare const OVERLAY_SURFACE_OPAQUE = "glass glass-frost [--glass-rim:0.5] [--glass-lift:0.6] [--glass-light:0] [--glass-edge:color-mix(in_srgb,var(--border)_90%,transparent)] [--glass-base:var(--popover)]";
|
|
5
5
|
export declare const SCRIM_CLASS = "bg-scrim backdrop-blur-md pointer-coarse:backdrop-blur-none";
|
|
6
|
+
export declare const SCROLL_CONTAIN = "overscroll-contain";
|
|
7
|
+
export declare const SCRIM_CONTAIN = "overscroll-contain overflow-hidden";
|
|
6
8
|
export declare const PANEL_TAIL: string;
|
|
7
9
|
export declare const FLOATING_PANEL_SURFACE: string;
|
|
8
10
|
export declare const FLOATING_PANEL: string;
|
|
11
|
+
/** @deprecated Ignored; removed in 2.0.0. */
|
|
9
12
|
export declare const anchorToTriggerTop: (anchor?: HTMLElement) => {
|
|
10
13
|
x: number;
|
|
11
14
|
y: number;
|
|
12
15
|
width: number;
|
|
13
16
|
height: number;
|
|
14
17
|
};
|
|
18
|
+
export declare const LAYER_ROOT: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** On a modal's panel from the end of its open animation; the widget realm carries it out of a sealed widget. */
|
|
2
|
+
export declare const COVERING_ATTR = "data-covering";
|
|
3
|
+
/** Pauses the page's ambient loops while a modal covers it: one attribute on the app's [data-page] root, never on html. Returns the release. */
|
|
4
|
+
export declare function coverPage(): () => void;
|
|
5
|
+
/** A modal panel covers the page from now until the returned release runs. */
|
|
6
|
+
export declare function coverNow(panel: Element): () => void;
|
|
7
|
+
/** A modal panel covers the page once its open animation ends, if it is still open then, until the returned release runs. */
|
|
8
|
+
export declare function coverOnceOpen(panel: Element, open: () => boolean): () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { Accessor } from "solid-js";
|
|
1
2
|
/** Fades whichever edge the track writes as clipped. */
|
|
2
3
|
export declare const SCROLL_TRACK_FADE = "data-[clip-end]:[mask-image:linear-gradient(to_right,black_85%,transparent)] data-[clip-start]:[mask-image:linear-gradient(to_left,black_85%,transparent)] data-[clip-start]:data-[clip-end]:[mask-image:linear-gradient(to_right,transparent,black_15%,black_85%,transparent)]";
|
|
3
|
-
/** Centres the segment matching `selected` whenever
|
|
4
|
+
/** Centres the segment matching `selected` whenever `selection` changes; drives
|
|
4
5
|
* scrollLeft, since scrollIntoView would scroll the page with it. */
|
|
5
|
-
export declare function trackScroll(list: HTMLElement, selected: string,
|
|
6
|
+
export declare function trackScroll(list: HTMLElement, selected: string, selection: Accessor<unknown>): () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const SECTION_OUTER_RADIUS = "rounded-[var(--radius)]";
|
|
2
2
|
export declare const SECTION_INNER_RADIUS = "rounded-[max(0px,calc(var(--radius)-var(--spacing)*3))]";
|
|
3
3
|
export declare const SECTION_PADDING = "p-3";
|
|
4
|
-
/** @deprecated
|
|
4
|
+
/** @deprecated `SectionRow`, or `SECTION_ROW_SURFACE` from card-classes; removed in 2.0.0. */
|
|
5
5
|
export declare const SECTION_ROW_CLASS = "rounded-[max(0px,calc(var(--radius)-var(--spacing)*3))] border border-border/60 bg-card/60 p-3";
|
|
@@ -1,45 +1,2 @@
|
|
|
1
|
-
import { type Accessor } from "solid-js";
|
|
2
|
-
import { type InitialFocus } from "../solid/bottom-sheet/focus-trap.js";
|
|
3
1
|
/** True for a node inside a shadow root, where page-level layer logic sees only the root's host. */
|
|
4
2
|
export declare const inShadowRoot: (node: Node | undefined) => boolean;
|
|
5
|
-
type OutsideEvent = {
|
|
6
|
-
target: EventTarget | null;
|
|
7
|
-
preventDefault(): void;
|
|
8
|
-
};
|
|
9
|
-
type AutoFocusEvent = {
|
|
10
|
-
preventDefault(): void;
|
|
11
|
-
};
|
|
12
|
-
export interface LayerHandlers {
|
|
13
|
-
onInteractOutside: (e: OutsideEvent) => void;
|
|
14
|
-
onCloseAutoFocus: (e: AutoFocusEvent) => void;
|
|
15
|
-
onOpenAutoFocus: (e: AutoFocusEvent) => void;
|
|
16
|
-
/** The shadow root's host while the layer is in one: what the page sees as the target of anything inside. */
|
|
17
|
-
host: () => Element | undefined;
|
|
18
|
-
}
|
|
19
|
-
interface ShadowLayerOptions {
|
|
20
|
-
content: Accessor<HTMLElement | undefined>;
|
|
21
|
-
open: Accessor<boolean>;
|
|
22
|
-
/** Absent for layers that close on pointer leave (tooltips, hover cards): they never join the stack. */
|
|
23
|
-
dismiss?: () => void;
|
|
24
|
-
/** A press on it is the trigger's own toggle, never an outside press. */
|
|
25
|
-
trigger?: Accessor<Element | undefined>;
|
|
26
|
-
/** Menus: any press outside the layer and the layers above it dismisses it, newest or not, as Kobalte's menus do. */
|
|
27
|
-
tree?: boolean;
|
|
28
|
-
/** The layer keeps Tab inside itself (dialogs); its initial focus is then ui's, not Kobalte's. */
|
|
29
|
-
trapsFocus?: boolean;
|
|
30
|
-
initialFocus?: InitialFocus;
|
|
31
|
-
consumer: {
|
|
32
|
-
onInteractOutside?: (e: never) => void;
|
|
33
|
-
onCloseAutoFocus?: (e: never) => void;
|
|
34
|
-
onOpenAutoFocus?: (e: never) => void;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Kobalte decides "outside" from the page, where a press or focus inside a shadow root is one on
|
|
39
|
-
* the root's host, so a layer portaled into a shadow root would dismiss on every press inside it.
|
|
40
|
-
* The handlers ignore those; while the layer is open in a shadow root, a press elsewhere in that
|
|
41
|
-
* root dismisses the newest layer from a listener on the root itself. Outside a shadow root the
|
|
42
|
-
* handlers only pass the consumer's own through.
|
|
43
|
-
*/
|
|
44
|
-
export declare function shadowLayer(options: ShadowLayerOptions): LayerHandlers;
|
|
45
|
-
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
import { type Collection } from "./behavior/collection.js";
|
|
3
|
+
type Orientation = "horizontal" | "vertical";
|
|
4
|
+
export interface ToggleSet {
|
|
5
|
+
id: Accessor<string>;
|
|
6
|
+
orientation: Accessor<Orientation>;
|
|
7
|
+
isPressed: (value: string) => boolean;
|
|
8
|
+
toggle: (value: string) => void;
|
|
9
|
+
collection: Collection;
|
|
10
|
+
/** Changes as items mount and unmount. */
|
|
11
|
+
members: Accessor<number>;
|
|
12
|
+
joined: (delta: 1 | -1) => void;
|
|
13
|
+
}
|
|
14
|
+
/** The shared core of a row of toggles: which are pressed, what a press does, and the roving focus between them. */
|
|
15
|
+
export declare function createToggleSet(options: {
|
|
16
|
+
root: Accessor<HTMLElement | undefined>;
|
|
17
|
+
itemSelector: string;
|
|
18
|
+
values: Accessor<readonly string[]>;
|
|
19
|
+
setValues: (next: string[]) => void;
|
|
20
|
+
multiple: Accessor<boolean>;
|
|
21
|
+
orientation?: Accessor<Orientation>;
|
|
22
|
+
id?: Accessor<string | undefined>;
|
|
23
|
+
disabledFocusable?: boolean;
|
|
24
|
+
}): ToggleSet;
|
|
25
|
+
/** One toggle in a set: its ref, its pressed and roving-focus attributes, and its press, bound on the element so it works inside a closed shadow root. */
|
|
26
|
+
export declare function createToggleItem(set: ToggleSet, item: {
|
|
27
|
+
value: Accessor<string>;
|
|
28
|
+
disabled: Accessor<boolean>;
|
|
29
|
+
locked?: Accessor<boolean>;
|
|
30
|
+
}): {
|
|
31
|
+
ref: import("solid-js").Setter<HTMLElement | undefined>;
|
|
32
|
+
pressed: () => boolean;
|
|
33
|
+
props: {
|
|
34
|
+
id: string;
|
|
35
|
+
readonly tabIndex: -1 | 0;
|
|
36
|
+
readonly disabled: boolean;
|
|
37
|
+
readonly "aria-pressed": boolean;
|
|
38
|
+
readonly "data-pressed": "" | undefined;
|
|
39
|
+
readonly "data-disabled": "" | undefined;
|
|
40
|
+
readonly "data-key": string;
|
|
41
|
+
readonly "data-orientation": Orientation;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
@@ -1,12 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { type Component, type ComponentProps, type ParentComponent, type ValidComponent } from "solid-js";
|
|
2
|
+
type AccordionProps = Omit<ComponentProps<"div">, "onChange"> & {
|
|
3
|
+
as?: ValidComponent;
|
|
4
|
+
value?: string[];
|
|
5
|
+
defaultValue?: string[];
|
|
6
|
+
onChange?: (value: string[]) => void;
|
|
7
|
+
multiple?: boolean;
|
|
8
|
+
collapsible?: boolean;
|
|
9
|
+
shouldFocusWrap?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type AccordionItemProps = Omit<ComponentProps<"div">, "onChange"> & {
|
|
12
|
+
as?: ValidComponent;
|
|
13
|
+
value: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
forceMount?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type AccordionHeaderProps = ComponentProps<"h3"> & {
|
|
18
|
+
as?: ValidComponent;
|
|
19
|
+
};
|
|
20
|
+
type AccordionTriggerProps = ComponentProps<"button"> & {
|
|
21
|
+
as?: ValidComponent;
|
|
22
|
+
};
|
|
23
|
+
type AccordionContentProps = ComponentProps<"div"> & {
|
|
24
|
+
as?: ValidComponent;
|
|
25
|
+
};
|
|
26
|
+
declare const Accordion: Component<AccordionProps> & {
|
|
27
|
+
Root: Component<AccordionProps>;
|
|
28
|
+
Item: Component<AccordionItemProps>;
|
|
29
|
+
Header: Component<AccordionHeaderProps>;
|
|
30
|
+
Trigger: Component<AccordionTriggerProps>;
|
|
31
|
+
Content: Component<AccordionContentProps>;
|
|
32
|
+
};
|
|
33
|
+
declare const AccordionItem: Component<AccordionItemProps>;
|
|
34
|
+
declare const AccordionTrigger: ParentComponent<AccordionTriggerProps>;
|
|
35
|
+
declare const AccordionContent: ParentComponent<AccordionContentProps>;
|
|
12
36
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { AlertDialog as AlertDialogPrimitive } from "@kobalte/core/alert-dialog";
|
|
2
1
|
import type { VariantProps } from "cva";
|
|
3
|
-
import { type Component, type
|
|
2
|
+
import { type Component, type JSX, type ParentComponent } from "solid-js";
|
|
4
3
|
import { buttonVariants } from "../lib/button-variants.js";
|
|
5
|
-
import { type ModalHeadProps, type ModalDismissProps, type ModalSize } from "./dialog-parts.js";
|
|
6
|
-
declare const AlertDialog: ParentComponent<
|
|
7
|
-
declare const AlertDialogTrigger:
|
|
8
|
-
type AlertDialogContentProps =
|
|
4
|
+
import { type ModalHeadProps, type ModalContentProps, type ModalDismissProps, type ModalSize } from "./dialog-parts.js";
|
|
5
|
+
declare const AlertDialog: ParentComponent<import("./dialog-parts.js").ModalRootSkinProps>;
|
|
6
|
+
declare const AlertDialogTrigger: <T extends import("solid-js").ValidComponent = "button">(props: import("../lib/behavior/modal-root.js").ModalPartProps<T>) => JSX.Element, AlertDialogTitle: <T extends import("solid-js").ValidComponent = "h2">(props: import("../lib/behavior/modal-root.js").ModalPartProps<T>) => JSX.Element, AlertDialogDescription: <T extends import("solid-js").ValidComponent = "p">(props: import("../lib/behavior/modal-root.js").ModalPartProps<T>) => JSX.Element;
|
|
7
|
+
type AlertDialogContentProps = ModalContentProps & {
|
|
9
8
|
size?: ModalSize;
|
|
10
9
|
/** Names a panel that has no `AlertDialogTitle`. A registered Title wins. */
|
|
11
10
|
ariaLabel?: string;
|
|
@@ -14,8 +13,6 @@ declare const AlertDialogContent: ParentComponent<AlertDialogContentProps>;
|
|
|
14
13
|
declare const AlertDialogHeader: Component<import("./dialog-parts.js").ModalHeaderProps>, AlertDialogBody: Component<JSX.HTMLAttributes<HTMLDivElement> & {
|
|
15
14
|
as?: import("solid-js").ValidComponent;
|
|
16
15
|
}>, AlertDialogFooter: Component<JSX.HTMLAttributes<HTMLDivElement>>;
|
|
17
|
-
declare const AlertDialogTitle: Component<ComponentProps<typeof AlertDialogPrimitive.Title>>;
|
|
18
|
-
declare const AlertDialogDescription: Component<ComponentProps<typeof AlertDialogPrimitive.Description>>;
|
|
19
16
|
/** An alert dialog is read aloud as a description, and the line carries the consequence. */
|
|
20
17
|
type AlertDialogHeadProps = ModalHeadProps & {
|
|
21
18
|
line: JSX.Element;
|
package/dist/solid/avatar.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { Image as ImagePrimitive } from "@kobalte/core/image";
|
|
2
1
|
import { type Component, type ComponentProps } from "solid-js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
type LoadingStatus = "idle" | "loading" | "loaded" | "error";
|
|
3
|
+
type AvatarProps = ComponentProps<"span"> & {
|
|
4
|
+
fallbackDelay?: number;
|
|
5
|
+
onLoadingStatusChange?: (status: LoadingStatus) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const Avatar: Component<AvatarProps>;
|
|
8
|
+
declare const AvatarImage: Component<ComponentProps<"img">>;
|
|
9
|
+
declare const AvatarFallback: Component<ComponentProps<"span">>;
|
|
6
10
|
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component, type ComponentProps, type JSX, type ParentComponent, type ValidComponent } from "solid-js";
|
|
2
|
-
import { type InitialFocus } from "
|
|
2
|
+
import { type InitialFocus } from "../../lib/behavior/focus-scope.js";
|
|
3
3
|
interface BottomSheetRootProps {
|
|
4
4
|
open?: boolean;
|
|
5
5
|
defaultOpen?: boolean;
|
|
@@ -31,5 +31,5 @@ declare const BottomSheetHeader: Component<import("../dialog-parts.js").ModalHea
|
|
|
31
31
|
declare const BottomSheetTitle: Component<ComponentProps<"h2">>;
|
|
32
32
|
declare const BottomSheetDescription: Component<ComponentProps<"p">>;
|
|
33
33
|
declare const BottomSheetClose: ParentComponent<SheetButtonProps>;
|
|
34
|
-
/** @deprecated
|
|
34
|
+
/** @deprecated The shared modal parts; removed in 2.0.0. */
|
|
35
35
|
export { BottomSheet, BottomSheetBody, BottomSheetClose, BottomSheetContent, BottomSheetDescription, BottomSheetFooter, BottomSheetHandle, BottomSheetHeader, BottomSheetOverlay, BottomSheetPortal, BottomSheetTitle, BottomSheetTrigger, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const EASE = "cubic-bezier(0.32, 0.72, 0, 1)";
|
|
2
|
-
export declare const TRANSITION_MS
|
|
2
|
+
export declare const TRANSITION_MS: number;
|
|
3
3
|
export declare const DEAD_ZONE_PX = 6;
|
|
4
4
|
export declare const CLOSE_DISTANCE_RATIO = 0.4;
|
|
5
5
|
export declare const CLOSE_VELOCITY_PX_PER_MS = 0.5;
|
package/dist/solid/button.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Button as KobalteButton } from "@kobalte/core/button";
|
|
2
1
|
import type { VariantProps } from "cva";
|
|
3
|
-
import { type
|
|
2
|
+
import { type JSX, type ValidComponent } from "solid-js";
|
|
3
|
+
import { type ButtonRootProps } from "../lib/behavior/button-root.js";
|
|
4
4
|
import { buttonVariants } from "../lib/button-variants.js";
|
|
5
|
-
type ButtonProps =
|
|
5
|
+
type ButtonProps<T extends ValidComponent = "button"> = ButtonRootProps<T> & VariantProps<typeof buttonVariants> & {
|
|
6
6
|
/** Presses do nothing; unlike `disabled` it keeps focus, so the popover or dialog around it stays. */
|
|
7
7
|
busy?: boolean;
|
|
8
|
+
class?: string;
|
|
8
9
|
};
|
|
9
|
-
declare function Button(props: ButtonProps): JSX.Element;
|
|
10
|
+
declare function Button<T extends ValidComponent = "button">(props: ButtonProps<T>): JSX.Element;
|
|
10
11
|
declare function ButtonWell(props: {
|
|
11
12
|
icon?: string;
|
|
12
13
|
children?: JSX.Element;
|
package/dist/solid/charts.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ type StackedBarSegment = {
|
|
|
40
40
|
value: number;
|
|
41
41
|
/** CSS color driving the segment's own glass tint. */
|
|
42
42
|
tone?: string;
|
|
43
|
-
/** @deprecated
|
|
43
|
+
/** @deprecated `tone`; removed in 2.0.0. */
|
|
44
44
|
class?: string;
|
|
45
45
|
};
|
|
46
46
|
/** Segmented proportion bar (e.g. staleness fresh/aging/stale). */
|
package/dist/solid/checkbox.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type Component, type ComponentProps } from "solid-js";
|
|
1
|
+
import { type ComponentProps, type JSX } from "solid-js";
|
|
3
2
|
declare const CHECKBOX_SIZE: {
|
|
4
3
|
readonly sm: {
|
|
5
4
|
readonly box: "size-5";
|
|
@@ -13,7 +12,18 @@ declare const CHECKBOX_SIZE: {
|
|
|
13
12
|
};
|
|
14
13
|
};
|
|
15
14
|
type CheckboxSize = keyof typeof CHECKBOX_SIZE;
|
|
16
|
-
|
|
15
|
+
type CheckboxProps = Omit<ComponentProps<"div">, "onChange" | "children"> & {
|
|
16
|
+
checked?: boolean;
|
|
17
|
+
defaultChecked?: boolean;
|
|
18
|
+
onChange?: (checked: boolean) => void;
|
|
19
|
+
indeterminate?: boolean;
|
|
20
|
+
value?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
readOnly?: boolean;
|
|
17
25
|
size?: CheckboxSize;
|
|
18
|
-
|
|
26
|
+
children?: JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
declare const Checkbox: (props: CheckboxProps) => JSX.Element;
|
|
19
29
|
export { Checkbox };
|
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { type Accessor, type Component, type ComponentProps, type ValidComponent } from "solid-js";
|
|
2
|
+
type CollapsibleProps = Omit<ComponentProps<"div">, "onChange"> & {
|
|
3
|
+
as?: ValidComponent;
|
|
4
|
+
open?: boolean;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
forceMount?: boolean;
|
|
9
|
+
};
|
|
10
|
+
type CollapsibleTriggerProps = ComponentProps<"button"> & {
|
|
11
|
+
as?: ValidComponent;
|
|
12
|
+
};
|
|
13
|
+
type CollapsibleContentProps = ComponentProps<"div"> & {
|
|
14
|
+
as?: ValidComponent;
|
|
15
|
+
};
|
|
16
|
+
type Markers = Record<"data-expanded" | "data-closed" | "data-disabled", "" | undefined>;
|
|
17
|
+
interface CollapsibleContextValue {
|
|
18
|
+
open: Accessor<boolean>;
|
|
19
|
+
disabled: Accessor<boolean>;
|
|
20
|
+
forceMount: Accessor<boolean>;
|
|
21
|
+
markers: Markers;
|
|
22
|
+
toggle: () => void;
|
|
23
|
+
defaultContentId: Accessor<string>;
|
|
24
|
+
controls: Accessor<string | undefined>;
|
|
25
|
+
registerContent: (id: string) => () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function useCollapsible(): CollapsibleContextValue;
|
|
28
|
+
export declare const CollapsibleRoot: Component<CollapsibleProps>;
|
|
29
|
+
export declare const CollapsibleTriggerRoot: Component<CollapsibleTriggerProps>;
|
|
30
|
+
export declare const CollapsibleContentRoot: Component<CollapsibleContentProps>;
|
|
31
|
+
declare const Collapsible: Component<CollapsibleProps>;
|
|
32
|
+
declare const CollapsibleTrigger: Component<CollapsibleTriggerProps>;
|
|
33
|
+
declare const CollapsibleContent: Component<CollapsibleContentProps>;
|
|
6
34
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Color } from "../lib/color/index.js";
|
|
2
2
|
import { type Component } from "solid-js";
|
|
3
3
|
interface ColorDiscProps {
|
|
4
4
|
/** The colour shown and moved: its hue is the direction from the centre, its saturation the distance. */
|
|
@@ -1,26 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
declare const
|
|
1
|
+
import { type Component, type ComponentProps, type JSX, type ValidComponent } from "solid-js";
|
|
2
|
+
import { type DeprecatedMenuRootProps, type MenuCheckboxItemProps, type MenuContentProps, type MenuItemProps, type MenuLabelProps, type MenuPlacement, type MenuRadioItemProps, type MenuSubTriggerProps } from "./menu-parts.js";
|
|
3
|
+
interface ContextMenuRootProps extends DeprecatedMenuRootProps {
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
placement?: MenuPlacement;
|
|
6
|
+
gutter?: number;
|
|
7
|
+
children?: JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
type TriggerOwnProps = {
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
id?: string;
|
|
12
|
+
ref?: unknown;
|
|
13
|
+
style?: JSX.CSSProperties | string;
|
|
14
|
+
onContextMenu?: JSX.EventHandlerUnion<HTMLElement, MouseEvent>;
|
|
15
|
+
onPointerDown?: JSX.EventHandlerUnion<HTMLElement, PointerEvent>;
|
|
16
|
+
onPointerMove?: JSX.EventHandlerUnion<HTMLElement, PointerEvent>;
|
|
17
|
+
onPointerUp?: JSX.EventHandlerUnion<HTMLElement, PointerEvent>;
|
|
18
|
+
onPointerCancel?: JSX.EventHandlerUnion<HTMLElement, PointerEvent>;
|
|
19
|
+
};
|
|
20
|
+
type ContextMenuTriggerProps<T extends ValidComponent = "div"> = TriggerOwnProps & {
|
|
21
|
+
as?: T;
|
|
22
|
+
} & Omit<ComponentProps<T>, "as" | keyof TriggerOwnProps>;
|
|
23
|
+
declare function ContextMenuTrigger<T extends ValidComponent = "div">(props: ContextMenuTriggerProps<T>): JSX.Element;
|
|
24
|
+
declare const ContextMenuContent: Component<MenuContentProps>;
|
|
25
|
+
declare function ContextMenuItem<T extends ValidComponent = "div">(props: MenuItemProps<T>): JSX.Element;
|
|
26
|
+
declare function ContextMenuSubTrigger<T extends ValidComponent = "div">(props: MenuSubTriggerProps<T>): JSX.Element;
|
|
27
|
+
declare const ContextMenuSubContent: Component<MenuContentProps>;
|
|
28
|
+
declare function ContextMenuCheckboxItem<T extends ValidComponent = "div">(props: MenuCheckboxItemProps<T>): JSX.Element;
|
|
29
|
+
declare function ContextMenuRadioItem<T extends ValidComponent = "div">(props: MenuRadioItemProps<T>): JSX.Element;
|
|
30
|
+
declare const ContextMenuLabel: Component<MenuLabelProps>;
|
|
31
|
+
declare const ContextMenuSeparator: Component<ComponentProps<"hr">>;
|
|
25
32
|
declare const ContextMenuShortcut: Component<ComponentProps<"span">>;
|
|
33
|
+
declare const ContextMenuGroup: Component<import("./menu-parts.js").MenuGroupProps>;
|
|
34
|
+
declare const ContextMenuSub: Component<import("./menu-parts.js").MenuSubProps>;
|
|
35
|
+
declare const ContextMenuRadioGroup: Component<import("./menu-parts.js").MenuRadioGroupProps>;
|
|
36
|
+
declare const ContextMenu: Component<ContextMenuRootProps> & {
|
|
37
|
+
Root: Component<ContextMenuRootProps>;
|
|
38
|
+
Trigger: typeof ContextMenuTrigger;
|
|
39
|
+
Portal: Component<{
|
|
40
|
+
children?: JSX.Element;
|
|
41
|
+
mount?: Node;
|
|
42
|
+
}>;
|
|
43
|
+
Content: Component<MenuContentProps>;
|
|
44
|
+
Arrow: Component;
|
|
45
|
+
Item: typeof ContextMenuItem;
|
|
46
|
+
CheckboxItem: typeof ContextMenuCheckboxItem;
|
|
47
|
+
RadioGroup: Component<import("./menu-parts.js").MenuRadioGroupProps>;
|
|
48
|
+
RadioItem: typeof ContextMenuRadioItem;
|
|
49
|
+
Group: Component<import("./menu-parts.js").MenuGroupProps>;
|
|
50
|
+
GroupLabel: Component<MenuLabelProps>;
|
|
51
|
+
Separator: Component<JSX.HTMLAttributes<HTMLHRElement>>;
|
|
52
|
+
Sub: Component<import("./menu-parts.js").MenuSubProps>;
|
|
53
|
+
SubTrigger: typeof ContextMenuSubTrigger;
|
|
54
|
+
SubContent: Component<MenuContentProps>;
|
|
55
|
+
ItemIndicator: Component<import("./menu-parts.js").ItemIndicatorProps>;
|
|
56
|
+
Icon: Component<JSX.HTMLAttributes<HTMLSpanElement>>;
|
|
57
|
+
ItemLabel: Component<JSX.HTMLAttributes<HTMLSpanElement>>;
|
|
58
|
+
ItemDescription: Component<JSX.HTMLAttributes<HTMLSpanElement>>;
|
|
59
|
+
};
|
|
26
60
|
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, };
|
|
@@ -1,5 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type ButtonRootProps } from "../lib/behavior/button-root.js";
|
|
2
2
|
import { type Accessor, type Component, type ComponentProps, type JSX, type ParentComponent, type ValidComponent } from "solid-js";
|
|
3
|
+
import { type FocusOutsideEvent, type InteractOutsideEvent, type ModalPartProps, type PointerDownOutsideEvent, type ModalRole } from "../lib/behavior/modal-root.js";
|
|
4
|
+
export interface ModalRootSkinProps {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
/** Modal toward the page. Defaults to true on the page and false inside a shadow root. */
|
|
9
|
+
modal?: boolean;
|
|
10
|
+
/** Stays mounted and dormant after it closes, so the next open shows the same nodes instead of building them. */
|
|
11
|
+
keep?: boolean;
|
|
12
|
+
/** @deprecated Ignored; removed in 2.0.0. */
|
|
13
|
+
id?: string;
|
|
14
|
+
/** @deprecated Ignored; removed in 2.0.0. */
|
|
15
|
+
forceMount?: boolean;
|
|
16
|
+
/** @deprecated Ignored; removed in 2.0.0. */
|
|
17
|
+
preventScroll?: boolean;
|
|
18
|
+
/** @deprecated Ignored; removed in 2.0.0. */
|
|
19
|
+
translations?: Record<string, string>;
|
|
20
|
+
children?: JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
export declare function createModalRootSkin(role: ModalRole): ParentComponent<ModalRootSkinProps>;
|
|
23
|
+
export type ModalContentProps = Omit<ComponentProps<"div">, "style" | "role"> & {
|
|
24
|
+
as?: ValidComponent;
|
|
25
|
+
style?: JSX.CSSProperties | string;
|
|
26
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
27
|
+
onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
|
|
28
|
+
onInteractOutside?: (event: InteractOutsideEvent) => void;
|
|
29
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
30
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
31
|
+
/** @deprecated Ignored; removed in 2.0.0. */
|
|
32
|
+
onFocusOutside?: (event: FocusOutsideEvent) => void;
|
|
33
|
+
/** @deprecated Ignored; removed in 2.0.0. */
|
|
34
|
+
forceMount?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export interface ModalTextParts {
|
|
37
|
+
Trigger: <T extends ValidComponent = "button">(props: ModalPartProps<T>) => JSX.Element;
|
|
38
|
+
Title: <T extends ValidComponent = "h2">(props: ModalPartProps<T>) => JSX.Element;
|
|
39
|
+
Description: <T extends ValidComponent = "p">(props: ModalPartProps<T>) => JSX.Element;
|
|
40
|
+
}
|
|
41
|
+
export declare function createModalTextParts(slot: string): ModalTextParts;
|
|
3
42
|
export type ModalSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
4
43
|
export declare const MODAL_MAX_H = "[--modal-max-h:85dvh] max-h-[var(--modal-max-h)]";
|
|
5
44
|
export declare const MODAL_WIDTH: Record<ModalSize, string>;
|
|
@@ -54,21 +93,19 @@ export type ModalHeadProps = ModalMedia & {
|
|
|
54
93
|
* hands in its own Header, Title and Description so ResponsiveDialog still
|
|
55
94
|
* switches between dialog and sheet parts at render time. */
|
|
56
95
|
export declare function createModalHead<P extends ModalHeadProps = ModalHeadProps>(Header: Component<ModalHeaderProps>, Title: Component<ComponentProps<"h2">>, Description: Component<ComponentProps<"p">>): Component<P>;
|
|
57
|
-
|
|
58
|
-
* `[handler, data]` form that calls `handler(data, event)`. A wrapper that
|
|
59
|
-
* only checks for a function silently drops the bound one. */
|
|
60
|
-
export declare function callEventHandler<T, E extends Event>(event: E & {
|
|
61
|
-
currentTarget: T;
|
|
62
|
-
target: Element;
|
|
63
|
-
}, handler: JSX.EventHandlerUnion<T, E> | undefined): void;
|
|
64
|
-
export type ModalDismissProps = ComponentProps<typeof KobalteButton> & {
|
|
96
|
+
export type ModalDismissProps = ButtonRootProps<ValidComponent> & {
|
|
65
97
|
/** Presses do nothing, the dialog stays open and focus stays put; see Button. */
|
|
66
98
|
busy?: boolean;
|
|
67
99
|
};
|
|
68
|
-
export declare function createModalDismiss(slot: string
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
100
|
+
export declare function createModalDismiss(slot: string, useCloser: () => {
|
|
101
|
+
close(): void;
|
|
102
|
+
}): ParentComponent<ModalDismissProps>;
|
|
103
|
+
/** Renderless, inside the modal's portal: the panel covers the page from the end of its open animation until the portal leaves. */
|
|
104
|
+
export declare const ModalCover: Component<{
|
|
105
|
+
panel: Accessor<Element | undefined>;
|
|
106
|
+
open: Accessor<boolean>;
|
|
107
|
+
dormant: Accessor<boolean>;
|
|
108
|
+
}>;
|
|
72
109
|
export interface ModalLabels {
|
|
73
110
|
titleId: string;
|
|
74
111
|
descriptionId: string;
|
|
@@ -77,9 +114,9 @@ export interface ModalLabels {
|
|
|
77
114
|
registerTitle: (id: string | undefined) => void;
|
|
78
115
|
registerDescription: (id: string | undefined) => void;
|
|
79
116
|
}
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
117
|
+
/** ModalRoot wires title/description ids for its families; BottomSheet wires
|
|
118
|
+
* them through this. The part registers the id it actually rendered, so a
|
|
119
|
+
* caller's own `id` still labels the panel. */
|
|
83
120
|
export declare function createModalLabels(): ModalLabels;
|
|
84
121
|
export declare const ModalLabelsProvider: import("solid-js").ContextProviderComponent<ModalLabels | undefined>;
|
|
85
122
|
export declare function useModalLabels(): ModalLabels | undefined;
|