@glasshome/ui 1.42.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.
Files changed (147) hide show
  1. package/dist/index.js +2 -2
  2. package/dist/lib/anchor-placement.d.ts +4 -0
  3. package/dist/lib/balance-rows.d.ts +10 -4
  4. package/dist/lib/behavior/anchored.d.ts +16 -2
  5. package/dist/lib/behavior/button-root.d.ts +7 -0
  6. package/dist/lib/behavior/collection.d.ts +8 -0
  7. package/dist/lib/behavior/dismiss.d.ts +6 -4
  8. package/dist/lib/behavior/focus-scope.d.ts +7 -1
  9. package/dist/lib/behavior/hide-outside.d.ts +1 -1
  10. package/dist/lib/behavior/layer-stack.d.ts +3 -2
  11. package/dist/lib/behavior/menu.d.ts +59 -0
  12. package/dist/lib/behavior/modal-root.d.ts +2 -0
  13. package/dist/lib/behavior/range.d.ts +44 -0
  14. package/dist/lib/color/color.d.ts +41 -0
  15. package/dist/lib/color/index.d.ts +2 -0
  16. package/dist/lib/color/intl.d.ts +40 -0
  17. package/dist/lib/dock-slot-classes.d.ts +2 -0
  18. package/dist/lib/hold.d.ts +1 -1
  19. package/dist/lib/locale.d.ts +3 -0
  20. package/dist/lib/menu-classes.d.ts +2 -0
  21. package/dist/lib/motion-classes.d.ts +1 -1
  22. package/dist/lib/overlay-classes.d.ts +1 -0
  23. package/dist/lib/scroll-track.d.ts +3 -2
  24. package/dist/lib/section-tokens.d.ts +1 -1
  25. package/dist/lib/segment-classes.d.ts +2 -0
  26. package/dist/lib/shadow-layer.d.ts +0 -45
  27. package/dist/lib/toggle-set.d.ts +44 -0
  28. package/dist/lib/visually-hidden.d.ts +3 -0
  29. package/dist/solid/accordion.d.ts +35 -11
  30. package/dist/solid/avatar.d.ts +8 -4
  31. package/dist/solid/bottom-sheet/bottom-sheet.d.ts +1 -1
  32. package/dist/solid/button.d.ts +5 -4
  33. package/dist/solid/charts.d.ts +1 -1
  34. package/dist/solid/checkbox.d.ts +14 -4
  35. package/dist/solid/collapsible.d.ts +33 -5
  36. package/dist/solid/color-disc.d.ts +1 -1
  37. package/dist/solid/color-slider.d.ts +1 -1
  38. package/dist/solid/color-wheel.d.ts +1 -1
  39. package/dist/solid/context-menu.d.ts +58 -24
  40. package/dist/solid/dialog-parts.d.ts +8 -8
  41. package/dist/solid/dropdown-menu.d.ts +55 -24
  42. package/dist/solid/empty.d.ts +1 -1
  43. package/dist/solid/form.d.ts +5 -6
  44. package/dist/solid/hover-card.d.ts +65 -9
  45. package/dist/solid/index.d.ts +1 -1
  46. package/dist/solid/index.js +7725 -13458
  47. package/dist/solid/input-group.d.ts +6 -6
  48. package/dist/solid/item.d.ts +1 -1
  49. package/dist/solid/menu-parts.d.ts +175 -24
  50. package/dist/solid/option-card.d.ts +1 -4
  51. package/dist/solid/picker-row.d.ts +2 -0
  52. package/dist/solid/popover.d.ts +77 -12
  53. package/dist/solid/progress.d.ts +11 -3
  54. package/dist/solid/radio-group.d.ts +31 -6
  55. package/dist/solid/responsive-dialog.d.ts +1 -1
  56. package/dist/solid/scroll-area.d.ts +1 -1
  57. package/dist/solid/section-card.d.ts +2 -3
  58. package/dist/solid/select.d.ts +107 -10
  59. package/dist/solid/selection.d.ts +10 -1
  60. package/dist/solid/sheet.d.ts +1 -1
  61. package/dist/solid/sliding-indicator.d.ts +1 -1
  62. package/dist/solid/sonner.d.ts +1 -1
  63. package/dist/solid/toggle.d.ts +11 -3
  64. package/dist/solid/tooltip.d.ts +22 -22
  65. package/dist/tokens/index.js +54 -51
  66. package/dist/{utils-CxAii-e9.js → utils-3Codx-NZ.js} +527 -489
  67. package/package.json +3 -6
  68. package/src/lib/anchor-placement.ts +10 -3
  69. package/src/lib/balance-rows.ts +115 -40
  70. package/src/lib/behavior/anchored.ts +26 -8
  71. package/src/lib/behavior/button-root.tsx +103 -0
  72. package/src/lib/behavior/collection.ts +66 -29
  73. package/src/lib/behavior/dismiss.ts +61 -21
  74. package/src/lib/behavior/focus-scope.ts +31 -6
  75. package/src/lib/behavior/hide-outside.ts +2 -2
  76. package/src/lib/behavior/layer-stack.ts +33 -8
  77. package/src/lib/behavior/menu.ts +470 -0
  78. package/src/lib/behavior/modal-root.tsx +24 -18
  79. package/src/lib/behavior/polymorphic.tsx +1 -1
  80. package/src/lib/behavior/presence.ts +1 -1
  81. package/src/lib/behavior/range.ts +212 -0
  82. package/src/lib/clipboard.ts +2 -3
  83. package/src/lib/color/color.ts +746 -0
  84. package/src/lib/color/index.ts +2 -0
  85. package/src/lib/color/intl.ts +60 -0
  86. package/src/lib/dock-slot-classes.ts +3 -0
  87. package/src/lib/hold.ts +1 -1
  88. package/src/lib/locale.ts +62 -0
  89. package/src/lib/menu-classes.ts +3 -0
  90. package/src/lib/motion-classes.ts +7 -7
  91. package/src/lib/overlay-classes.ts +1 -3
  92. package/src/lib/scroll-track.ts +11 -6
  93. package/src/lib/section-tokens.ts +1 -1
  94. package/src/lib/segment-classes.ts +3 -0
  95. package/src/lib/shadow-layer.ts +0 -118
  96. package/src/lib/toggle-set.ts +133 -0
  97. package/src/lib/visually-hidden.ts +15 -0
  98. package/src/solid/accordion.tsx +294 -20
  99. package/src/solid/area-picker.tsx +3 -2
  100. package/src/solid/avatar.tsx +98 -24
  101. package/src/solid/bottom-sheet/bottom-sheet.tsx +1 -1
  102. package/src/solid/button.tsx +12 -6
  103. package/src/solid/charts.tsx +1 -1
  104. package/src/solid/checkbox.tsx +167 -44
  105. package/src/solid/collapsible.tsx +260 -12
  106. package/src/solid/color-disc.tsx +11 -12
  107. package/src/solid/color-slider.tsx +114 -47
  108. package/src/solid/color-wheel.tsx +137 -39
  109. package/src/solid/context-menu.tsx +285 -94
  110. package/src/solid/dialog-parts.tsx +9 -9
  111. package/src/solid/dock.tsx +3 -2
  112. package/src/solid/dropdown-menu.tsx +252 -115
  113. package/src/solid/empty.tsx +1 -1
  114. package/src/solid/entity-selector.tsx +3 -2
  115. package/src/solid/face-toggle.tsx +43 -18
  116. package/src/solid/form.tsx +5 -6
  117. package/src/solid/glyph-tile.tsx +48 -21
  118. package/src/solid/hover-card.tsx +287 -25
  119. package/src/solid/image-picker.tsx +2 -2
  120. package/src/solid/index.ts +1 -3
  121. package/src/solid/input-group.tsx +2 -2
  122. package/src/solid/item.tsx +1 -1
  123. package/src/solid/menu-parts.tsx +619 -145
  124. package/src/solid/option-card.tsx +6 -10
  125. package/src/solid/picker-row.tsx +5 -1
  126. package/src/solid/popover.tsx +424 -79
  127. package/src/solid/preview-tile.tsx +1 -1
  128. package/src/solid/progress.tsx +84 -15
  129. package/src/solid/radio-group.tsx +271 -34
  130. package/src/solid/responsive-dialog.tsx +1 -1
  131. package/src/solid/schema-form.tsx +1 -6
  132. package/src/solid/scroll-area.tsx +1 -1
  133. package/src/solid/section-card.tsx +3 -4
  134. package/src/solid/select.tsx +950 -95
  135. package/src/solid/selection.tsx +142 -66
  136. package/src/solid/sheet.tsx +1 -1
  137. package/src/solid/slider.tsx +115 -65
  138. package/src/solid/sliding-indicator.tsx +1 -1
  139. package/src/solid/sonner.tsx +1 -1
  140. package/src/solid/tabs.tsx +12 -6
  141. package/src/solid/term.tsx +3 -4
  142. package/src/solid/toggle-group.tsx +29 -99
  143. package/src/solid/toggle.tsx +43 -9
  144. package/src/solid/tooltip.tsx +24 -24
  145. package/src/styles/globals.css +61 -7
  146. package/src/styles/theme.css +7 -4
  147. package/src/tokens/material.ts +11 -2
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as e, B as t, Bt as n, C as r, Cn as i, D as a, Dn as ee, En as te, F as ne, G as o, Gt as s, H as c, I as l, J as u, K as d, L as f, M as p, Mt as m, N as h, P as g, Qt as _, R as v, S as y, Sn as b, T as x, Tn as S, U as C, V as w, Vt as T, W as E, Wt as D, X as O, Y as k, Yt as A, Z as j, Zt as M, _ as N, _n as P, _t as F, an as I, at as L, b as R, bn as z, bt as B, c as V, ct as H, d as U, dn as W, dt as G, en as K, et as q, f as J, fn as Y, ft as X, g as Z, gn as re, gt as ie, h as ae, hn as oe, ht as se, i as ce, in as le, it as ue, j as de, l as fe, ln as pe, lt as me, m as he, mt as ge, n as _e, nt as ve, o as ye, on as be, ot as xe, p as Se, pn as Ce, pt as we, q as Te, r as Ee, rn as De, rt as Oe, s as ke, st as Ae, t as je, tn as Me, u as Ne, un as Pe, ut as Fe, v as Q, vn as Ie, vt as Le, w as Re, wn as ze, y as Be, yn as Ve, yt as He, z as Ue, zt as We } from "./utils-CxAii-e9.js";
1
+ import { $ as e, An as t, B as n, C as r, Cn as i, Dn as a, E as ee, En as te, F as ne, Ft as o, G as s, H as c, Ht as l, I as u, J as d, Jt as f, K as p, L as m, M as h, N as g, O as _, On as v, P as y, Q as b, Qt as x, Sn as S, St as C, T as w, Tn as T, U as E, Ut as D, V as O, W as k, Wt as A, X as j, Y as M, Z as N, _ as P, _t as F, at as I, b as L, bn as R, bt as z, c as B, cn as V, ct as H, d as U, dt as W, en as G, f as K, fn as q, ft as J, g as Y, gn as X, gt as Z, h as re, hn as ie, ht as ae, i as oe, in as se, it as ce, j as le, kn as ue, l as de, ln as fe, lt as pe, m as me, mn as he, mt as ge, n as _e, nt as ve, o as ye, on as be, ot as xe, p as Se, pn as Ce, pt as we, q as Te, qt as Ee, r as De, rn as Oe, s as ke, sn as Ae, st as je, t as Me, tn as Ne, ut as Pe, v as Fe, vn as Q, vt as Ie, w as Le, x as Re, xn as ze, xt as Be, y as Ve, yn as He, yt as Ue, z as We } from "./utils-3Codx-NZ.js";
2
2
  //#region src/lib/motion-window.ts
3
3
  var $ = 3e4;
4
4
  function Ge(e = $) {
@@ -17,4 +17,4 @@ function Ge(e = $) {
17
17
  };
18
18
  }
19
19
  //#endregion
20
- export { oe as ALERT_CLASS, re as ALERT_CONTENT_CLASS, P as ALERT_DESCRIPTION_CLASS, Ie as ALERT_ICON_BG_CLASS, Ve as ALERT_ICON_CLASS, z as ALERT_ICON_PATHS, b as ALERT_TITLE_CLASS, i as ALERT_TONES, pe as BUTTON_DEFAULT_CLASS, Pe as BUTTON_OUTLINE_CLASS, m as CARD_BLUR, We as CARD_SURFACE, n as CARD_SURFACE_BASE, T as CARD_SURFACE_OPAQUE, Oe as CAROUSEL_DOTS, ue as CAROUSEL_VIEWPORT, he as CHIP, Fe as CONTROL_H, N as CONTROL_H_TOUCH, G as CONTROL_ON, X as FIELD_CHROME, we as FIELD_CONTROL, A as FIELD_MOTION, ge as FIELD_TEXT, R as FLOATING_PANEL, se as FOCUS_RING, de as HOLD_GRACE_MS, p as HOLD_MS, W as ICON_BUTTON_CLASS, ae as ICON_PILL, Z as ICON_PILL_TINT, ie as INPUT_CLASS, F as INPUT_SURFACE, Le as INVALID_RING, t as LOGO_DEFAULT_SIZE, w as LOGO_DEFAULT_SRC, c as LOGO_DEFAULT_SUB, C as LOGO_MARK_CLASS, E as LOGO_MARK_PX, o as LOGO_NAME_CLASS, d as LOGO_ROOT_CLASS, Te as LOGO_SIZES, u as LOGO_STACK_CLASS, k as LOGO_SUB_CLASS, ne as MENU_ITEM, l as MENU_ITEM_BASE, f as MENU_ITEM_X, v as MENU_LABEL, Ue as MENU_SEPARATOR, _e as MOBILE_BREAKPOINT, M as MODAL_MOTION, _ as MORPH_MOTION, $ as MOTION_WINDOW_MS, Y as OUTLINE_SURFACE, y as OVERLAY_BLUR, K as OVERLAY_MOTION, r as OVERLAY_SURFACE, Re as OVERLAY_SURFACE_BASE, x as OVERLAY_SURFACE_OPAQUE, Q as PICKER_LIST, Be as PICKER_TRIGGER, H as POSITION_BAR, me as POSITION_BAR_LIT, Me as PRESS_DIP, a as SCRIM_CLASS, De as SCRIM_MOTION, Ne as SECTION_INNER_RADIUS, U as SECTION_OUTER_RADIUS, J as SECTION_PADDING, Se as SECTION_ROW_CLASS, D as SECTION_ROW_SURFACE, fe as SEGMENT_ITEM, le as SETTLE_MOTION, I as STAGGER, be as STALE_CONTENT, ce as THUMB_CLASS, ye as THUMB_RAIL_BLEED, ke as THUMB_RAIL_PAD, V as THUMB_SIZE, s as TRACK_SURFACE, O as Z, j as Z_CLASS, ze as alertBorder, S as alertFill, te as alertIconBgStyle, ee as alertIconFill, e as anchorToTriggerTop, Ce as buttonVariants, L as carouselDot, xe as carouselItem, Ae as carouselTrack, je as cn, He as copyImage, B as copyText, h as createHold, Ee as createIsMobile, q as glassToneText, g as spendLongPress, Ge as startMotionWindow, ve as toneTextMix };
20
+ export { Q as ALERT_CLASS, He as ALERT_CONTENT_CLASS, R as ALERT_DESCRIPTION_CLASS, ze as ALERT_ICON_BG_CLASS, S as ALERT_ICON_CLASS, i as ALERT_ICON_PATHS, T as ALERT_TITLE_CLASS, te as ALERT_TONES, q as BUTTON_DEFAULT_CLASS, Ce as BUTTON_OUTLINE_CLASS, o as CARD_BLUR, l as CARD_SURFACE, D as CARD_SURFACE_BASE, A as CARD_SURFACE_OPAQUE, I as CAROUSEL_DOTS, xe as CAROUSEL_VIEWPORT, re as CHIP, J as CONTROL_H, Fe as CONTROL_H_TOUCH, we as CONTROL_ON, ge as FIELD_CHROME, ae as FIELD_CONTROL, x as FIELD_MOTION, Z as FIELD_TEXT, Re as FLOATING_PANEL, F as FOCUS_RING, h as HOLD_GRACE_MS, g as HOLD_MS, he as ICON_BUTTON_CLASS, Y as ICON_PILL, P as ICON_PILL_TINT, Ie as INPUT_CLASS, Ue as INPUT_SURFACE, z as INVALID_RING, c as LOGO_DEFAULT_SIZE, E as LOGO_DEFAULT_SRC, k as LOGO_DEFAULT_SUB, s as LOGO_MARK_CLASS, p as LOGO_MARK_PX, Te as LOGO_NAME_CLASS, d as LOGO_ROOT_CLASS, M as LOGO_SIZES, j as LOGO_STACK_CLASS, N as LOGO_SUB_CLASS, u as MENU_ITEM, m as MENU_ITEM_BASE, We as MENU_ITEM_X, n as MENU_LABEL, O as MENU_SEPARATOR, _e as MOBILE_BREAKPOINT, G as MODAL_MOTION, Ne as MORPH_MOTION, $ as MOTION_WINDOW_MS, ie as OUTLINE_SURFACE, r as OVERLAY_BLUR, Oe as OVERLAY_MOTION, Le as OVERLAY_SURFACE, w as OVERLAY_SURFACE_BASE, ee as OVERLAY_SURFACE_OPAQUE, Ve as PICKER_LIST, L as PICKER_TRIGGER, Pe as POSITION_BAR, W as POSITION_BAR_LIT, se as PRESS_DIP, _ as SCRIM_CLASS, be as SCRIM_MOTION, U as SECTION_INNER_RADIUS, K as SECTION_OUTER_RADIUS, Se as SECTION_PADDING, me as SECTION_ROW_CLASS, Ee as SECTION_ROW_SURFACE, de as SEGMENT_ITEM, Ae as SETTLE_MOTION, V as STAGGER, fe as STALE_CONTENT, oe as THUMB_CLASS, ye as THUMB_RAIL_BLEED, ke as THUMB_RAIL_PAD, B as THUMB_SIZE, f as TRACK_SURFACE, b as Z, e as Z_CLASS, a as alertBorder, v as alertFill, ue as alertIconBgStyle, t as alertIconFill, le as anchorToTriggerTop, X as buttonVariants, je as carouselDot, H as carouselItem, pe as carouselTrack, Me as cn, Be as copyImage, C as copyText, y as createHold, De as createIsMobile, ve as glassToneText, ne as spendLongPress, Ge as startMotionWindow, ce as toneTextMix };
@@ -12,6 +12,8 @@ export interface AnchorPlace {
12
12
  align: Align;
13
13
  offset: number;
14
14
  matchAnchorWidth: boolean;
15
+ /** False keeps the chosen side even without room; the part only shifts to stay inside the viewport. */
16
+ flip?: boolean;
15
17
  }
16
18
  export interface Placement {
17
19
  left: number;
@@ -29,6 +31,8 @@ export declare function placeBeside(anchor: Box, floating: {
29
31
  width: number;
30
32
  height: number;
31
33
  }, place: AnchorPlace): Placement;
34
+ /** The corner a control takes (rounded-lg is --radius), clamped to a capsule at its height; read from the theme so opening a panel asks the page for no style. */
35
+ export declare const controlRadius: (height: number) => string;
32
36
  /** A panel that grows out of the element that opened it. The --morph-* values start the panel
33
37
  * clipped to the element's box (MORPH_MOTION's keyframes), so it unrolls out of it. */
34
38
  export declare function overAnchor(anchor: HTMLElement, width: number, height?: number): JSX.CSSProperties;
@@ -1,7 +1,13 @@
1
- /** Classes for the element holding the items: one row, then the balanced grid once `data-wrapped` is set. */
2
- export declare const BALANCED_ROWS = "grid grid-flow-col auto-cols-[minmax(max-content,1fr)] data-[wrapped]:grid-flow-row data-[wrapped]:grid-cols-[repeat(var(--balance-columns),minmax(max-content,1fr))]";
1
+ import type { Accessor } from "solid-js";
2
+ /** Marks the element holding the items: a wrapping row until the column count is known, then a grid of that many equal columns (globals.css). */
3
+ export declare const BALANCED_ROWS = "data-balanced-rows";
4
+ /** Marks the node inside each item that sizes to its content in either layout. */
5
+ export declare const BALANCE_CONTENT = "data-balance-content";
3
6
  /**
4
7
  * Lays `items` out in `BALANCED_ROWS`. `sizer` is the element that fills its line once wrapped
5
- * (it takes `data-wrapped` too); `item` selects the items among `items`' children.
8
+ * (it takes `data-wrapped` too); `item` selects the items among `items`' children, each holding
9
+ * one `BALANCE_CONTENT` node. Sizes come from a ResizeObserver only, never a layout read: an
10
+ * item's own width is its content node's width plus its padding and border, the same in either
11
+ * layout, so only the column count waits a frame, and the wrapping row never overflows meanwhile.
6
12
  */
7
- export declare function balanceRows(sizer: HTMLElement, items: HTMLElement, item: string): () => void;
13
+ export declare function balanceRows(sizer: HTMLElement, items: HTMLElement, item: string, members: Accessor<unknown>): () => void;
@@ -1,12 +1,26 @@
1
1
  import type { Accessor } from "solid-js";
2
- import { type Align, type Side } from "../anchor-placement";
2
+ import { type Align, type Side } from "../anchor-placement.js";
3
+ /** An element, or a point or box with no element of its own: a context menu opens at the pointer. */
4
+ export interface AnchorLike {
5
+ getBoundingClientRect(): {
6
+ left: number;
7
+ top: number;
8
+ width: number;
9
+ height: number;
10
+ };
11
+ getRootNode?(): Node;
12
+ }
3
13
  export interface AnchoredOptions {
4
- anchor: Accessor<Element | undefined>;
14
+ anchor: Accessor<AnchorLike | undefined>;
5
15
  floating: Accessor<HTMLElement | undefined>;
6
16
  open: Accessor<boolean>;
7
17
  side?: Accessor<Side>;
8
18
  align?: Accessor<Align>;
9
19
  offset?: number;
10
20
  matchAnchorWidth?: boolean;
21
+ /** The anchor counts as its top edge and the part never flips: placed below, it covers the anchor. */
22
+ coverAnchor?: boolean;
23
+ /** A custom property the part gets the anchor's width in, for styles sized by the anchor. */
24
+ widthVar?: string;
11
25
  }
12
26
  export declare function createAnchored(options: AnchoredOptions): void;
@@ -0,0 +1,7 @@
1
+ import { type ComponentProps, type JSX, type ValidComponent } from "solid-js";
2
+ export type ButtonRootProps<T extends ValidComponent = "button"> = Omit<ComponentProps<T>, "as" | "disabled"> & {
3
+ as?: T;
4
+ disabled?: boolean;
5
+ };
6
+ /** A press target: a native button, a link, or any other element made one (role, Tab stop, Enter and Space). */
7
+ export declare function ButtonRoot<T extends ValidComponent = "button">(props: ButtonRootProps<T>): JSX.Element;
@@ -11,6 +11,8 @@ export interface CollectionOptions {
11
11
  dir?: Accessor<"ltr" | "rtl">;
12
12
  /** Keys that hold the tab stop while focus is outside, first present wins (a selected tab). */
13
13
  preferred?: Accessor<readonly string[]>;
14
+ /** APG's focusable when disabled: an `aria-disabled` item stays in the arrow order and can hold the tab stop. */
15
+ disabledFocusable?: boolean;
14
16
  }
15
17
  export interface Collection {
16
18
  highlighted: Accessor<string | undefined>;
@@ -20,5 +22,11 @@ export interface Collection {
20
22
  /** Items call this as they mount, unmount or change disabled, so the tab stop always sits on a present, enabled item. */
21
23
  refresh: () => void;
22
24
  }
25
+ export interface Typeahead {
26
+ /** The index in `texts` the key leads to: -1 when nothing matches, `undefined` when the key types nothing. */
27
+ match: (event: KeyboardEvent, texts: readonly string[], from: number) => number | undefined;
28
+ }
29
+ /** The typing buffer alone, for a list whose items are not in the DOM (a closed Select's trigger). */
30
+ export declare function createTypeahead(): Typeahead;
23
31
  export declare function createCollection(options: CollectionOptions): Collection;
24
32
  export {};
@@ -1,11 +1,13 @@
1
1
  import type { Accessor } from "solid-js";
2
- import { type LayerHandle } from "./layer-stack";
3
- export type DismissReason = "escape" | "outside-press";
2
+ import { type LayerHandle } from "./layer-stack.js";
3
+ export type DismissReason = "escape" | "outside-press" | "focus-outside";
4
4
  export interface DismissOptions {
5
5
  layer: LayerHandle;
6
- /** `event` is the keydown for `escape` and the pointerdown for `outside-press`. */
7
- onDismiss: (reason: DismissReason, event: KeyboardEvent | PointerEvent) => void;
6
+ /** `event` is the keydown for `escape`, the pointerdown for `outside-press` and the focusin for `focus-outside`. */
7
+ onDismiss: (reason: DismissReason, event: KeyboardEvent | PointerEvent | FocusEvent) => void;
8
8
  outsidePress?: Accessor<boolean>;
9
+ /** Off unless asked: a non-modal layer closes when focus lands outside it. */
10
+ focusOutside?: Accessor<boolean>;
9
11
  escapeFrom?: "layer" | "document";
10
12
  }
11
13
  export declare function createDismiss(options: DismissOptions): void;
@@ -11,7 +11,13 @@ export interface FocusScope {
11
11
  skipRestore(): void;
12
12
  untrap(): void;
13
13
  }
14
- export declare const hasFocus: (el: Element) => boolean;
14
+ /** The focused element in the node's own root, or null while focus is in another root. */
15
+ export declare function activeOf(node: Node): Element | null;
16
+ /** Whether `el` holds focus, from its own focus and blur events, which a sealed widget receives without asking the page. */
17
+ export declare function trackFocus(el: Element): {
18
+ has: () => boolean;
19
+ stop: () => void;
20
+ };
15
21
  export declare function focusWithoutTracking(el: HTMLElement | null | undefined, options?: {
16
22
  preventScroll?: boolean;
17
23
  }): boolean;
@@ -1,5 +1,5 @@
1
1
  import { type Accessor } from "solid-js";
2
- import type { LayerHandle } from "./layer-stack";
2
+ import type { LayerHandle } from "./layer-stack.js";
3
3
  export interface HideOutsideOptions {
4
4
  layer: LayerHandle;
5
5
  active: Accessor<boolean>;
@@ -6,18 +6,19 @@ export interface LayerOptions {
6
6
  open: Accessor<boolean>;
7
7
  kind: LayerKind;
8
8
  escape: Accessor<boolean>;
9
- readsOwnEscape?: boolean;
10
9
  dismiss?: () => void;
11
10
  trigger?: Accessor<Element | undefined>;
12
11
  topLayer?: TopLayer;
12
+ /** While open, the page takes no pointer events; this layer and the ones above it still do. */
13
+ blockPointer?: Accessor<boolean>;
13
14
  }
14
15
  export interface Layer {
15
16
  readonly id: number;
16
17
  readonly kind: LayerKind;
17
- readonly readsOwnEscape: boolean;
18
18
  element(): HTMLElement | undefined;
19
19
  trigger(): Element | undefined;
20
20
  escape(): boolean;
21
+ readonly blocksPointer: boolean;
21
22
  dismiss?: () => void;
22
23
  }
23
24
  export interface LayerHandle {
@@ -0,0 +1,59 @@
1
+ import { type Accessor } from "solid-js";
2
+ import type { Align, Side } from "../anchor-placement.js";
3
+ import { type AnchorLike } from "./anchored.js";
4
+ export declare const SUBMENU_OPEN_DELAY_MS = 100;
5
+ export declare const POINTER_GRACE_MS = 300;
6
+ /** Where focus goes as a menu opens: an item, the panel itself, or nowhere (a submenu opened by hover). */
7
+ export type MenuFocus = "first" | "last" | "content" | "none";
8
+ type Dir = "ltr" | "rtl";
9
+ export interface MenuItemEntry {
10
+ disabled: Accessor<boolean>;
11
+ closeOnSelect: Accessor<boolean>;
12
+ onSelect: () => void;
13
+ submenu?: Menu;
14
+ }
15
+ export interface MenuOptions {
16
+ open: Accessor<boolean>;
17
+ onOpenChange: (open: boolean) => void;
18
+ parent?: Menu;
19
+ /** What the menu sits beside, given its trigger; unset, the trigger itself, as a submenu always does. */
20
+ anchor?: (trigger: HTMLElement | undefined) => AnchorLike | undefined;
21
+ /** The panel covers its anchor from the anchor's top edge, as createAnchored's coverAnchor. */
22
+ coverAnchor?: boolean;
23
+ side?: Accessor<Side>;
24
+ align?: Accessor<Align>;
25
+ offset?: number;
26
+ dir?: Accessor<Dir>;
27
+ /** A press on the trigger counts as outside: a context menu's trigger is the area it opens over. */
28
+ triggerIsArea?: boolean;
29
+ }
30
+ export interface Menu {
31
+ parent: Menu | undefined;
32
+ open: Accessor<boolean>;
33
+ dir: Accessor<Dir>;
34
+ content: Accessor<HTMLElement | undefined>;
35
+ setContent: (el: HTMLElement | undefined) => void;
36
+ trigger: Accessor<HTMLElement | undefined>;
37
+ setTrigger: (el: HTMLElement | undefined) => void;
38
+ highlighted: Accessor<string | undefined>;
39
+ tabIndex: (key: string) => 0 | -1;
40
+ show: (focus: MenuFocus) => void;
41
+ /** Closes this menu and its submenus; with `returnFocus`, focus held inside goes back to the trigger. */
42
+ hide: (returnFocus: boolean) => void;
43
+ /** Closes every menu from the root down, as choosing an item does. */
44
+ closeTree: () => void;
45
+ register: (key: string, entry: MenuItemEntry) => void;
46
+ holdsFocus: () => boolean;
47
+ unhighlight: () => void;
48
+ /** A submenu joins its parent, so focus inside it counts as inside the tree. */
49
+ adopt: (child: Menu) => void;
50
+ }
51
+ export interface MenuButton {
52
+ onPointerDown: (event: PointerEvent) => void;
53
+ onClick: () => void;
54
+ onKeyDown: (event: KeyboardEvent) => void;
55
+ }
56
+ export declare function createMenu(options: MenuOptions): Menu;
57
+ /** The APG menu button: a mouse press toggles, a finger toggles on its click, Enter, Space and ArrowDown open on the first item, ArrowUp on the last. */
58
+ export declare function createMenuButton(menu: Menu, disabled: Accessor<boolean>): MenuButton;
59
+ export {};
@@ -62,5 +62,7 @@ interface OutsideDetail<T extends Event> {
62
62
  export type PointerDownOutsideEvent = CustomEvent<OutsideDetail<PointerEvent>>;
63
63
  export type FocusOutsideEvent = CustomEvent<OutsideDetail<FocusEvent>>;
64
64
  export type InteractOutsideEvent = PointerDownOutsideEvent | FocusOutsideEvent;
65
+ export declare function vetoed<E extends Event>(handler: ((event: E) => void) | undefined, event: E): boolean;
66
+ export declare function interactOutside<T extends PointerEvent | FocusEvent>(original: T, handle: (event: CustomEvent<OutsideDetail<T>>) => void): CustomEvent<OutsideDetail<T>>;
65
67
  export declare function ModalFrame(props: ModalFrameProps): JSX.Element;
66
68
  export {};
@@ -0,0 +1,44 @@
1
+ import { type Accessor } from "solid-js";
2
+ export type RangeKey = "decrease" | "increase" | "pageDown" | "pageUp" | "first" | "last";
3
+ export declare function rangeKeyOf(e: KeyboardEvent): RangeKey | undefined;
4
+ export interface RangeOptions {
5
+ values: Accessor<number[] | undefined>;
6
+ defaultValues: Accessor<number[]>;
7
+ min: Accessor<number>;
8
+ max: Accessor<number>;
9
+ step: Accessor<number>;
10
+ minStepsBetween?: Accessor<number>;
11
+ disabled: Accessor<boolean>;
12
+ onChange?: (values: number[]) => void;
13
+ onChangeEnd?: (values: number[]) => void;
14
+ }
15
+ export interface Range {
16
+ values: Accessor<number[]>;
17
+ fraction: (value: number) => number;
18
+ valueAt: (fraction: number) => number;
19
+ setThumb: (index: number, value: number) => void;
20
+ closestThumb: (value: number) => number;
21
+ keyDown: (e: KeyboardEvent, index: number) => void;
22
+ blur: () => void;
23
+ dragEnd: () => void;
24
+ }
25
+ /** Thumbs on a stepped linear track that never cross; a key change ends on blur, a drag on release. */
26
+ export declare function createRange(options: RangeOptions): Range;
27
+ export declare const alongTrack: (e: PointerEvent, rect: DOMRect) => number;
28
+ type Pointer = PointerEvent & {
29
+ currentTarget: HTMLElement;
30
+ };
31
+ export interface DragOptions {
32
+ disabled: Accessor<boolean>;
33
+ start: (e: PointerEvent, rect: DOMRect) => void;
34
+ move: (e: PointerEvent, rect: DOMRect) => void;
35
+ end: () => void;
36
+ }
37
+ /** One primary-pointer drag at a time, captured on the pressed element, its rect read once per drag. */
38
+ export declare function createDrag(options: DragOptions): {
39
+ onPointerDown: (e: Pointer) => void;
40
+ onPointerMove: (e: Pointer) => void;
41
+ onPointerUp: (e: Pointer) => void;
42
+ onPointerCancel: (e: Pointer) => void;
43
+ };
44
+ export {};
@@ -0,0 +1,41 @@
1
+ import type { ColorIntlTranslations } from "./intl.js";
2
+ type ColorFormat = "hex" | "hexa" | "rgb" | "rgba" | "hsl" | "hsla" | "hsb" | "hsba";
3
+ type ColorSpace = "rgb" | "hsl" | "hsb";
4
+ export type ColorChannel = "hue" | "saturation" | "brightness" | "lightness" | "red" | "green" | "blue" | "alpha";
5
+ interface ColorAxes {
6
+ xChannel: ColorChannel;
7
+ yChannel: ColorChannel;
8
+ zChannel: ColorChannel;
9
+ }
10
+ interface ColorChannelRange {
11
+ minValue: number;
12
+ maxValue: number;
13
+ step: number;
14
+ pageSize: number;
15
+ }
16
+ /** A color value; every method that changes it returns a new one. */
17
+ export interface Color {
18
+ toFormat(format: ColorFormat): Color;
19
+ toString(format?: ColorFormat | "css"): string;
20
+ clone(): Color;
21
+ toHexInt(): number;
22
+ /** Throws when the channel is not in the color's space. */
23
+ getChannelValue(channel: ColorChannel): number;
24
+ /** Throws when the channel is not in the color's space. */
25
+ withChannelValue(channel: ColorChannel, value: number): Color;
26
+ getChannelRange(channel: ColorChannel): ColorChannelRange;
27
+ getChannelName(channel: ColorChannel, translations: ColorIntlTranslations): string;
28
+ getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
29
+ formatChannelValue(channel: ColorChannel): string;
30
+ getColorSpace(): ColorSpace;
31
+ getColorSpaceAxes(xyChannels: {
32
+ xChannel?: ColorChannel;
33
+ yChannel?: ColorChannel;
34
+ }): ColorAxes;
35
+ getColorChannels(): [ColorChannel, ColorChannel, ColorChannel];
36
+ getColorName(translations: ColorIntlTranslations): string;
37
+ getHueName(translations: ColorIntlTranslations): string;
38
+ }
39
+ /** Parses a color from a string value. Throws an error if the string could not be parsed. */
40
+ export declare function parseColor(value: string): Color;
41
+ export {};
@@ -0,0 +1,2 @@
1
+ export { type Color, type ColorChannel, parseColor } from "./color.js";
2
+ export { COLOR_INTL_TRANSLATIONS } from "./intl.js";
@@ -0,0 +1,40 @@
1
+ export declare const COLOR_INTL_TRANSLATIONS: {
2
+ hue: string;
3
+ saturation: string;
4
+ lightness: string;
5
+ brightness: string;
6
+ red: string;
7
+ green: string;
8
+ blue: string;
9
+ alpha: string;
10
+ colorName: (lightness: string, chroma: string, hue: string) => string;
11
+ transparentColorName: (lightness: string, chroma: string, hue: string, percentTransparent: string) => string;
12
+ "very dark": string;
13
+ dark: string;
14
+ light: string;
15
+ "very light": string;
16
+ pale: string;
17
+ grayish: string;
18
+ vibrant: string;
19
+ black: string;
20
+ white: string;
21
+ gray: string;
22
+ pink: string;
23
+ "pink red": string;
24
+ "red orange": string;
25
+ brown: string;
26
+ orange: string;
27
+ "orange yellow": string;
28
+ "brown yellow": string;
29
+ yellow: string;
30
+ "yellow green": string;
31
+ "green cyan": string;
32
+ cyan: string;
33
+ "cyan blue": string;
34
+ "blue purple": string;
35
+ purple: string;
36
+ "purple magenta": string;
37
+ magenta: string;
38
+ "magenta pink": string;
39
+ };
40
+ export type ColorIntlTranslations = typeof COLOR_INTL_TRANSLATIONS;
@@ -1 +1,3 @@
1
+ /** The rounded-lg in DOCK_SLOT_SHAPE, for a selection flyer that crosses slots. */
2
+ export declare const DOCK_SLOT_RADIUS = "var(--radius-lg)";
1
3
  export declare const DOCK_SLOT_SHAPE = "flex size-11 touch-manipulation items-center justify-center rounded-lg sm:size-12";
@@ -6,7 +6,7 @@ export declare const HOLD_MS = 350;
6
6
  export declare const HOLD_GRACE_MS = 100;
7
7
  /** A fired hold spends the press: the browser's own long press (text selection, context menu)
8
8
  * must not land on what the hold opened under the finger. Lasts until the release.
9
- * @deprecated use createHold, which also spends the release. */
9
+ * @deprecated `createHold`; removed in 2.0.0. */
10
10
  export declare function spendLongPress(): void;
11
11
  /** What a hold reads from a press: a PointerEvent fits, and so does a touch or a recorded point. */
12
12
  export interface HoldPress {
@@ -0,0 +1,3 @@
1
+ export type ReadingDirection = "ltr" | "rtl";
2
+ export declare const locale: string;
3
+ export declare const readingDirection: ReadingDirection;
@@ -1,4 +1,6 @@
1
1
  export declare const MENU_ITEM_BASE = "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&:not([data-tone])_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&>[data-slot=icon]]:shrink-0 [&>[data-slot=icon]]:text-[16px]";
2
+ /** The rounded-sm in MENU_ITEM_BASE, for a selection flyer that crosses rows. */
3
+ export declare const MENU_ITEM_RADIUS = "var(--radius-sm)";
2
4
  export declare const MENU_ITEM_X = "px-2";
3
5
  export declare const MENU_ITEM = "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&:not([data-tone])_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&>[data-slot=icon]]:shrink-0 [&>[data-slot=icon]]:text-[16px] px-2";
4
6
  export declare const MENU_LABEL = "px-2 py-1.5 font-medium text-muted-foreground text-xs";
@@ -14,4 +14,4 @@ export declare const DOCK_ARRIVE_MOTION = "pointer-events-none absolute inset-0
14
14
  export declare const DOCK_EDIT_MOTION = "data-[editing]:animate-dock-jiggle data-[editing]:nth-even:[animation-direction:alternate-reverse] data-[dragging]:animate-none";
15
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";
16
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", number>;
17
+ export declare const MOTION_EXIT_MS: Record<"overlay" | "modal" | "anchored" | "scrim" | "field" | "sheet" | "disclosure", number>;
@@ -8,6 +8,7 @@ export declare const SCRIM_CONTAIN = "overscroll-contain overflow-hidden";
8
8
  export declare const PANEL_TAIL: string;
9
9
  export declare const FLOATING_PANEL_SURFACE: string;
10
10
  export declare const FLOATING_PANEL: string;
11
+ /** @deprecated Ignored; removed in 2.0.0. */
11
12
  export declare const anchorToTriggerTop: (anchor?: HTMLElement) => {
12
13
  x: number;
13
14
  y: number;
@@ -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 it changes; drives
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, attribute: string): () => void;
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 Render `SectionRow`, or compose `SECTION_ROW_SURFACE` from card-classes. */
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 +1,3 @@
1
+ /** The rounded-md of a segment (SEGMENT_ITEM, a toggle-group item), for a selection flyer that crosses segments. */
2
+ export declare const SEGMENT_RADIUS = "var(--radius-md)";
1
3
  export declare const SEGMENT_ITEM: string;
@@ -1,47 +1,2 @@
1
- import { type Accessor } from "solid-js";
2
1
  /** True for a node inside a shadow root, where page-level layer logic sees only the root's host. */
3
2
  export declare const inShadowRoot: (node: Node | undefined) => boolean;
4
- export declare const ReportCovered: import("solid-js").Context<((covered: Accessor<boolean>) => void) | undefined>;
5
- /** True while a layer of this Kobalte root sits under an owned modal; the root drops `modal` then. */
6
- export declare function createCoveredRoot(): {
7
- covered: Accessor<boolean>;
8
- report: (covered: Accessor<boolean>) => void;
9
- };
10
- type OutsideEvent = {
11
- target: EventTarget | null;
12
- preventDefault(): void;
13
- };
14
- type AutoFocusEvent = {
15
- preventDefault(): void;
16
- };
17
- export interface LayerHandlers {
18
- onInteractOutside: (e: OutsideEvent) => void;
19
- onCloseAutoFocus: (e: AutoFocusEvent) => void;
20
- /** The shadow root's host while the layer is in one: what the page sees as the target of anything inside. */
21
- host: () => Element | undefined;
22
- /** An owned modal sits above the layer: the modal owns every press and focus until it closes. */
23
- covered: Accessor<boolean>;
24
- }
25
- interface ShadowLayerOptions {
26
- content: Accessor<HTMLElement | undefined>;
27
- open: Accessor<boolean>;
28
- /** Absent for layers that close on pointer leave (tooltips, hover cards): they never join the stack. */
29
- dismiss?: () => void;
30
- /** A press on it is the trigger's own toggle, never an outside press. */
31
- trigger?: Accessor<Element | undefined>;
32
- /** Menus: any press outside the layer and the layers above it dismisses it, newest or not, as Kobalte's menus do. */
33
- tree?: boolean;
34
- consumer: {
35
- onInteractOutside?: (e: never) => void;
36
- onCloseAutoFocus?: (e: never) => void;
37
- };
38
- }
39
- /**
40
- * Kobalte decides "outside" from the page, where a press or focus inside a shadow root is one on
41
- * the root's host, so a layer portaled into a shadow root would dismiss on every press inside it.
42
- * The handlers ignore those; while the layer is open in a shadow root, a press elsewhere in that
43
- * root dismisses the newest layer from a listener on the root itself. Outside a shadow root the
44
- * handlers only pass the consumer's own through.
45
- */
46
- export declare function shadowLayer(options: ShadowLayerOptions): LayerHandlers;
47
- 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 {};
@@ -0,0 +1,3 @@
1
+ import type { JSX } from "solid-js";
2
+ /** Kept for assistive tech and form submission, gone from sight and layout. */
3
+ export declare const VISUALLY_HIDDEN: JSX.CSSProperties;
@@ -1,12 +1,36 @@
1
- import { Accordion as AccordionPrimitive } from "@kobalte/core/accordion";
2
- import { type Component, type ComponentProps, type ParentComponent } from "solid-js";
3
- declare const Accordion: typeof import("@kobalte/core/accordion").Root & {
4
- Content: typeof import("@kobalte/core/accordion").Content;
5
- Header: typeof import("@kobalte/core/accordion").Header;
6
- Item: typeof import("@kobalte/core/accordion").Item;
7
- Trigger: typeof import("@kobalte/core/accordion").Trigger;
8
- };
9
- declare const AccordionItem: Component<ComponentProps<typeof AccordionPrimitive.Item>>;
10
- declare const AccordionTrigger: ParentComponent<ComponentProps<typeof AccordionPrimitive.Trigger>>;
11
- declare const AccordionContent: ParentComponent<ComponentProps<typeof AccordionPrimitive.Content>>;
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,6 +1,10 @@
1
- import { Image as ImagePrimitive } from "@kobalte/core/image";
2
1
  import { type Component, type ComponentProps } from "solid-js";
3
- declare const Avatar: Component<ComponentProps<typeof ImagePrimitive>>;
4
- declare const AvatarImage: Component<ComponentProps<typeof ImagePrimitive.Img>>;
5
- declare const AvatarFallback: Component<ComponentProps<typeof ImagePrimitive.Fallback>>;
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 };