@cascivo/react 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +6 -1
  2. package/dist/badge/badge.js +1 -1
  3. package/dist/context-menu/context-menu.js +42 -38
  4. package/dist/index.d.ts +235 -141
  5. package/dist/infinite-scroll/infinite-scroll.css +1 -0
  6. package/dist/infinite-scroll/infinite-scroll.js +49 -0
  7. package/dist/infinite-scroll/infinite-scroll.module.js +8 -0
  8. package/dist/large-title-header/large-title-header.css +1 -0
  9. package/dist/large-title-header/large-title-header.js +38 -0
  10. package/dist/large-title-header/large-title-header.module.js +13 -0
  11. package/dist/link/link.css +1 -1
  12. package/dist/link/link.module.js +1 -1
  13. package/dist/menu/menu.js +47 -43
  14. package/dist/node/badge/badge.js +1 -1
  15. package/dist/node/context-menu/context-menu.js +42 -38
  16. package/dist/node/infinite-scroll/infinite-scroll.js +49 -0
  17. package/dist/node/infinite-scroll/infinite-scroll.module.js +7 -0
  18. package/dist/node/large-title-header/large-title-header.js +38 -0
  19. package/dist/node/large-title-header/large-title-header.module.js +12 -0
  20. package/dist/node/link/link.module.js +1 -1
  21. package/dist/node/menu/menu.js +47 -43
  22. package/dist/node/react/src/index.js +27 -23
  23. package/dist/node/reorder-list/reorder-list.js +143 -0
  24. package/dist/node/reorder-list/reorder-list.module.js +11 -0
  25. package/dist/node/skip-nav/skip-nav.js +1 -0
  26. package/dist/node/tabs/tabs.js +38 -38
  27. package/dist/node/tag/tag.module.js +2 -2
  28. package/dist/node/virtual-list/virtual-list.js +40 -0
  29. package/dist/node/virtual-list/virtual-list.module.js +7 -0
  30. package/dist/node/wheel-picker/wheel-picker.js +84 -0
  31. package/dist/node/wheel-picker/wheel-picker.module.js +8 -0
  32. package/dist/react/src/index.js +27 -23
  33. package/dist/reorder-list/reorder-list.css +1 -0
  34. package/dist/reorder-list/reorder-list.js +143 -0
  35. package/dist/reorder-list/reorder-list.module.js +12 -0
  36. package/dist/skip-nav/skip-nav.js +1 -0
  37. package/dist/styles.css +41 -4
  38. package/dist/tabs/tabs.js +38 -38
  39. package/dist/tag/tag.css +1 -1
  40. package/dist/tag/tag.module.js +2 -2
  41. package/dist/virtual-list/virtual-list.css +1 -0
  42. package/dist/virtual-list/virtual-list.js +40 -0
  43. package/dist/virtual-list/virtual-list.module.js +8 -0
  44. package/dist/wheel-picker/wheel-picker.css +1 -0
  45. package/dist/wheel-picker/wheel-picker.js +84 -0
  46. package/dist/wheel-picker/wheel-picker.module.js +9 -0
  47. package/package.json +4 -4
  48. package/readme.body.md +6 -1
  49. package/dist/node/react/src/theme.js +0 -78
  50. package/dist/node/storage/src/drivers.js +0 -34
  51. package/dist/node/storage/src/persisted-signal.js +0 -41
  52. package/dist/react/src/theme.js +0 -78
  53. package/dist/storage/src/drivers.js +0 -34
  54. package/dist/storage/src/persisted-signal.js +0 -41
package/README.md CHANGED
@@ -249,7 +249,7 @@ routing break after adding one of these, check that the import resolves to
249
249
 
250
250
  ## Component index
251
251
 
252
- 192 components, exported from `@cascivo/react`. Full props, examples, and live demos at [cascivo.com/docs](https://cascivo.com/docs).
252
+ 197 components, exported from `@cascivo/react`. Full props, examples, and live demos at [cascivo.com/docs](https://cascivo.com/docs).
253
253
 
254
254
  ### Inputs
255
255
 
@@ -282,6 +282,7 @@ routing break after adding one of these, check that the import resolves to
282
282
  - **Radio** — Single choice from a set, grouped with RadioGroup
283
283
  - **RadioCard** — Selectable card backed by a native radio input. Use RadioCardGroup for single-select groups.
284
284
  - **RatingGroup** — Star rating input with accessible radio group pattern
285
+ - **ReorderList** — List whose rows can be reordered by pointer drag or entirely by keyboard
285
286
  - **Search** — Search input with debounced search callback and clear button
286
287
  - **SegmentedControl** — Mutually exclusive toggle group
287
288
  - **Select** — Native select menu styled to match the design system
@@ -293,6 +294,7 @@ routing break after adding one of these, check that the import resolves to
293
294
  - **TimePicker** — Native time input wrapper with label, hint, error, and size variants
294
295
  - **Toggle** — On/off switch built as an accessible button
295
296
  - **ToggleGroup** — A set of toggle buttons for single or multiple selection
297
+ - **WheelPicker** — iOS-style drum picker — a column of options that scrolls and snaps to a selection
296
298
 
297
299
  ### Display
298
300
 
@@ -353,6 +355,7 @@ routing break after adding one of these, check that the import resolves to
353
355
  - **TreeView** — Hierarchical, expandable tree of nodes with keyboard navigation and selection
354
356
  - **User** — Identity composite: an avatar with a name, description, and optional action slot
355
357
  - **UsersTablePage** — Full users management page with table, search, and invite action.
358
+ - **VirtualList** — Renders only the rows inside the viewport, so list length costs no extra DOM
356
359
  - **VisuallyHidden** — Hides content visually while keeping it available to screen readers
357
360
 
358
361
  ### Overlay
@@ -381,6 +384,7 @@ routing break after adding one of these, check that the import resolves to
381
384
  - **Dock** — Fixed bottom navigation bar for mobile app shells with up to 5 items
382
385
  - **Header** — App top bar with brand, primary navigation links, and an actions slot
383
386
  - **HeaderPanel** — Non-modal panel anchored below the shell header at the inline-end edge — hosts notifications, app switcher, user settings
387
+ - **LargeTitleHeader** — Scrolling region whose large title collapses into a compact sticky bar as it scrolls
384
388
  - **Link** — Styled anchor for navigation, standalone or inline within prose
385
389
  - **Menubar** — Horizontal application menu bar with keyboard-navigable dropdown menus
386
390
  - **MenuButton** — A button that opens an anchored action menu of one-shot commands
@@ -427,6 +431,7 @@ routing break after adding one of these, check that the import resolves to
427
431
 
428
432
  ### Feedback
429
433
 
434
+ - **InfiniteScroll** — Loads the next page when the end of a list scrolls into view
430
435
  - **InlineLoading** — Compact inline status indicator that pairs a label with a loading, success, or error state
431
436
  - **Notification** — Inline, actionable notification banner that surfaces a titled message with an optional recovery action
432
437
  - **Progress** — Horizontal bar showing the completion progress of a tracked operation
@@ -3,7 +3,7 @@ import { cn as t, normalizeTone as n } from "@cascivo/core/pure";
3
3
  import { jsx as r } from "react/jsx-runtime";
4
4
  //#region ../components/src/badge/badge.tsx
5
5
  var i = {
6
- neutral: "default",
6
+ neutral: "secondary",
7
7
  info: "info",
8
8
  success: "success",
9
9
  warning: "warning",
@@ -1,89 +1,93 @@
1
1
  "use client";
2
2
 
3
3
  import e from "./context-menu.module.js";
4
- import { useRef as t } from "react";
5
- import { useSignal as n, useSignalEffect as r, useSignals as i } from "@cascivo/core";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
+ import { Children as t, isValidElement as n, useRef as r } from "react";
5
+ import { useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  //#region ../components/src/context-menu/context-menu.tsx
8
- function s({ children: s }) {
9
- i();
10
- let c = t(null), l = t(null), u = n(!1), d = () => {
11
- let e = c.current;
8
+ function l() {
9
+ return globalThis.process?.env?.NODE_ENV !== "production";
10
+ }
11
+ function u({ children: u }) {
12
+ o();
13
+ let f = r(null), p = r(null), m = i(!1), h = () => {
14
+ let e = f.current;
12
15
  return e ? Array.from(e.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")) : [];
13
- }, f = (e) => {
14
- let t = d();
16
+ }, g = (e) => {
17
+ let t = h();
15
18
  t.length !== 0 && t[e(t, t.indexOf(document.activeElement))]?.focus();
16
- }, p = (e) => {
19
+ }, _ = (e) => {
17
20
  switch (e.key) {
18
21
  case "ArrowDown":
19
- e.preventDefault(), f((e, t) => t < 0 ? 0 : (t + 1) % e.length);
22
+ e.preventDefault(), g((e, t) => t < 0 ? 0 : (t + 1) % e.length);
20
23
  break;
21
24
  case "ArrowUp":
22
- e.preventDefault(), f((e, t) => t < 0 ? e.length - 1 : (t - 1 + e.length) % e.length);
25
+ e.preventDefault(), g((e, t) => t < 0 ? e.length - 1 : (t - 1 + e.length) % e.length);
23
26
  break;
24
27
  case "Home":
25
- e.preventDefault(), f(() => 0);
28
+ e.preventDefault(), g(() => 0);
26
29
  break;
27
30
  case "End":
28
- e.preventDefault(), f((e) => e.length - 1);
31
+ e.preventDefault(), g((e) => e.length - 1);
29
32
  break;
30
33
  }
31
34
  };
32
- r(() => {
33
- let e = c.current;
34
- if (e) if (u.value) {
35
+ a(() => {
36
+ let e = f.current;
37
+ if (e) if (m.value) {
35
38
  try {
36
39
  e.showPopover();
37
40
  } catch {}
38
- d()[0]?.focus();
41
+ h()[0]?.focus();
39
42
  } else try {
40
43
  e.hidePopover();
41
44
  } catch {}
42
- }), r(() => {
43
- let e = c.current;
45
+ }), a(() => {
46
+ let e = f.current;
44
47
  if (!e) return;
45
48
  let t = (e) => {
46
- e.newState === "closed" && (u.value = !1);
49
+ e.newState === "closed" && (m.value = !1);
47
50
  };
48
51
  return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
49
52
  });
50
- function m(e) {
53
+ function v(e) {
51
54
  e.preventDefault();
52
- let t = l.current;
53
- t && (t.style.setProperty("--cascivo-context-x", `${e.clientX}px`), t.style.setProperty("--cascivo-context-y", `${e.clientY}px`), u.value = !0);
55
+ let t = p.current;
56
+ t && (t.style.setProperty("--cascivo-context-x", `${e.clientX}px`), t.style.setProperty("--cascivo-context-y", `${e.clientY}px`), m.value = !0);
54
57
  }
55
- let [h, ...g] = Array.isArray(s) ? s : [s];
56
- return /* @__PURE__ */ o("div", {
57
- ref: l,
58
- onContextMenu: m,
58
+ let y = t.toArray(u), b = y.filter((e) => n(e) && e.type === d), x = y.filter((e) => !b.includes(e));
59
+ if (b.length === 0 && l()) throw Error("<ContextMenu> requires at least one <ContextMenuItem> child. Items are matched by component identity, so they must be direct children — not wrapped in a fragment or another component.");
60
+ return /* @__PURE__ */ c("div", {
61
+ ref: p,
62
+ onContextMenu: v,
59
63
  className: e.wrapper,
60
- children: [h, /* @__PURE__ */ a("div", {
61
- ref: c,
64
+ children: [x, /* @__PURE__ */ s("div", {
65
+ ref: f,
62
66
  popover: "auto",
63
67
  role: "menu",
64
- "data-state": u.value ? "open" : "closed",
68
+ "data-state": m.value ? "open" : "closed",
65
69
  className: e.menu,
66
- onKeyDown: p,
67
- children: g
70
+ onKeyDown: _,
71
+ children: b
68
72
  })]
69
73
  });
70
74
  }
71
- function c({ children: t, onSelect: n, disabled: r }) {
75
+ function d({ children: t, onSelect: n, disabled: r }) {
72
76
  function i() {
73
77
  r || n();
74
78
  }
75
- function o(e) {
79
+ function a(e) {
76
80
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i());
77
81
  }
78
- return /* @__PURE__ */ a("div", {
82
+ return /* @__PURE__ */ s("div", {
79
83
  role: "menuitem",
80
84
  tabIndex: r ? -1 : 0,
81
85
  "aria-disabled": r,
82
86
  onClick: i,
83
- onKeyDown: o,
87
+ onKeyDown: a,
84
88
  className: e.item,
85
89
  children: t
86
90
  });
87
91
  }
88
92
  //#endregion
89
- export { s as ContextMenu, c as ContextMenuItem };
93
+ export { u as ContextMenu, d as ContextMenuItem };
package/dist/index.d.ts CHANGED
@@ -22,7 +22,7 @@
22
22
  * npx -y @cascivo/docs (index; `npx @cascivo/docs <component>` for one doc)
23
23
  */
24
24
  import { AnchorHTMLAttributes, ButtonHTMLAttributes, FormHTMLAttributes, HTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, MouseEvent, ReactElement, ReactNode, RefObject, SelectHTMLAttributes, TextareaHTMLAttributes, TimeHTMLAttributes } from "react";
25
- import { DismissableLayer, DismissableLayerProps, ErrorBoundary, FocusScope, LinkComponent, LinkComponentProps, Machine, MachineConfig, Portal, Presence, ProgressInput, RovingOrientation, Signal, Slot, SlotProps, SpaceStep, SuspenseBoundary, ToneInput, UseClipboardOptions, UseClipboardReturn, UseControllableSignalOptions, UseDisclosureOptions, UseDisclosureReturn, VisuallyHidden, VisuallyHiddenProps, batch, cn, composeRefs, computePosition, computed, createMachine, createScope, createStreamBuffer, effect, getLinkComponent, mergeProps, setLinkComponent, signal, useAnchorPosition, useClipboard, useComputed, useControllableSignal, useDisclosure, useEffectPropSignal, useId, useMachine, useMediaQuery, useRovingFocus, useScope, useScrollLock, useSignal, useSignalEffect, useSignals, useStreamBuffer, useTypeahead } from "@cascivo/core";
25
+ import { DismissableLayer, DismissableLayerProps, ErrorBoundary, FocusScope, LinkComponent, LinkComponentProps, Machine, MachineConfig, Portal, Presence, ProgressInput, RovingOrientation, Signal, Slot, SlotProps, SpaceStep, SuspenseBoundary, ThemeProvider, ThemeProviderProps, ToneInput, UseClipboardOptions, UseClipboardReturn, UseControllableSignalOptions, UseDisclosureOptions, UseDisclosureReturn, VisuallyHidden, VisuallyHiddenProps, applyTheme, batch, cn, composeRefs, computePosition, computed, createMachine, createScope, createStreamBuffer, effect, getLinkComponent, mergeProps, setLinkComponent, setTheme, signal, themePreloadScript, themeSignal, useAnchorPosition, useClipboard, useComputed, useControllableSignal, useDisclosure, useEffectPropSignal, useId, useMachine, useMediaQuery, useRovingFocus, useScope, useScrollLock, useSignal, useSignalEffect, useSignals, useStreamBuffer, useTheme, useTypeahead } from "@cascivo/core";
26
26
 
27
27
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
28
28
  /**
@@ -668,6 +668,26 @@ declare function TabsList({
668
668
  interface TabsTriggerProps extends HTMLAttributes<HTMLButtonElement> {
669
669
  value: string;
670
670
  disabled?: boolean;
671
+ /**
672
+ * Render your own element instead of the `<button>`, keeping every tab behaviour
673
+ * (`role="tab"`, `aria-selected`, `aria-controls`, the roving `tabIndex`, `data-state`)
674
+ * and the tab styling.
675
+ *
676
+ * This exists for **URL-driven tabs**, the canonical dashboard shape: one route per tab.
677
+ * Navigating from `onValueChange` instead loses middle-click, cmd-click, open-in-new-tab
678
+ * and a crawlable `href` — a real anchor gives you all four for free.
679
+ *
680
+ * ```tsx
681
+ * <TabsTrigger value="overview" asChild>
682
+ * <Link to="/projects/$id/overview">Overview</Link>
683
+ * </TabsTrigger>
684
+ * ```
685
+ *
686
+ * With `asChild`, `disabled` becomes `aria-disabled`: it is not a valid attribute on an
687
+ * anchor, and a slotted element gets no `type` either. See
688
+ * [USING-WITH-A-ROUTER.md](../../../../docs/USING-WITH-A-ROUTER.md) for the full recipe.
689
+ */
690
+ asChild?: boolean;
671
691
  }
672
692
  /**
673
693
  * `forwardRef` so `ref` reaches the tab `<button>` — see `textarea.tsx` for the full
@@ -4126,6 +4146,219 @@ declare function Dock({
4126
4146
  className,
4127
4147
  ariaLabel
4128
4148
  }: DockProps): import("react").JSX.Element;
4149
+ interface LargeTitleHeaderProps {
4150
+ /** The page title. Rendered as the large heading and mirrored in the collapsed bar. */
4151
+ title: string;
4152
+ /** Content of the scrolling region, rendered below the title. */
4153
+ children: ReactNode;
4154
+ /** Leading slot of the compact bar — typically a back control. */
4155
+ leading?: ReactNode;
4156
+ /** Trailing slot of the compact bar — typically icon buttons. */
4157
+ actions?: ReactNode;
4158
+ /**
4159
+ * Heading level for the title, mapping to h1–h3.
4160
+ *
4161
+ * @defaultValue `1`
4162
+ * @see the component manifest
4163
+ */
4164
+ level?: 1 | 2 | 3;
4165
+ /**
4166
+ * Scroll distance (px) over which the large title collapses into the bar.
4167
+ *
4168
+ * @defaultValue `48`
4169
+ * @see the component manifest
4170
+ */
4171
+ collapseDistance?: number;
4172
+ className?: string;
4173
+ }
4174
+ /**
4175
+ * Scrolling region with an iOS-style page header: the large title scrolls away and a
4176
+ * compact sticky bar reveals the same title in its place.
4177
+ *
4178
+ * The collapse is a CSS scroll-driven animation — no scroll listener, no
4179
+ * IntersectionObserver, no client JavaScript of any kind, so this renders complete from
4180
+ * the server and never hydrates. Where `animation-timeline` is unsupported the mirrored
4181
+ * title stays hidden and the region degrades to a plain sticky bar above a heading; the
4182
+ * heading itself is always present, so no content depends on the enhancement.
4183
+ *
4184
+ * The component owns the scroll container so the sticky bar and the scroll timeline
4185
+ * cannot be broken by the surrounding markup. Give it a parent with a resolved height.
4186
+ */
4187
+ declare function LargeTitleHeader({
4188
+ title,
4189
+ children,
4190
+ leading,
4191
+ actions,
4192
+ level,
4193
+ collapseDistance,
4194
+ className
4195
+ }: LargeTitleHeaderProps): import("react").JSX.Element;
4196
+ interface InfiniteScrollProps {
4197
+ /** Called when the sentinel comes into view, or the button is activated. */
4198
+ onLoadMore: () => Promise<unknown> | unknown;
4199
+ /**
4200
+ * When true, stops observing and renders nothing — there are no more pages.
4201
+ *
4202
+ * @defaultValue `false`
4203
+ * @see the component manifest
4204
+ */
4205
+ disabled?: boolean;
4206
+ /**
4207
+ * How far ahead of the end to start loading, as an IntersectionObserver root margin.
4208
+ *
4209
+ * @defaultValue `'200px'`
4210
+ * @see the component manifest
4211
+ */
4212
+ rootMargin?: string;
4213
+ labels?: {
4214
+ loadMore?: string;
4215
+ loading?: string;
4216
+ };
4217
+ className?: string;
4218
+ }
4219
+ /**
4220
+ * Loads the next page when the end of a list comes into view.
4221
+ *
4222
+ * Place it as the last child of the scrolling region, after the list. It renders a real
4223
+ * "Load more" button and auto-activates it via an `IntersectionObserver` — so the next
4224
+ * page is reachable by keyboard and by screen reader, not only by scrolling, which is the
4225
+ * standing accessibility complaint against scroll-only infinite lists. Re-entry is
4226
+ * guarded, so a sentinel that stays visible after a short page cannot loop.
4227
+ */
4228
+ declare function InfiniteScroll({
4229
+ onLoadMore,
4230
+ disabled,
4231
+ rootMargin,
4232
+ labels,
4233
+ className
4234
+ }: InfiniteScrollProps): import("react").JSX.Element | null;
4235
+ interface ReorderItem {
4236
+ id: string;
4237
+ label: ReactNode;
4238
+ /** Plain-text name used in announcements when `label` is not a string. */
4239
+ name?: string;
4240
+ }
4241
+ interface ReorderListProps {
4242
+ value: ReorderItem[];
4243
+ onValueChange: (value: ReorderItem[]) => void;
4244
+ /**
4245
+ * When true, disables the control and removes it from the tab order.
4246
+ *
4247
+ * @defaultValue `false`
4248
+ * @see the component manifest
4249
+ */
4250
+ disabled?: boolean;
4251
+ labels?: {
4252
+ handle?: string;
4253
+ grabbed?: string;
4254
+ moved?: string;
4255
+ dropped?: string;
4256
+ cancelled?: string;
4257
+ };
4258
+ className?: string;
4259
+ }
4260
+ /**
4261
+ * A list whose rows can be reordered by pointer drag or entirely by keyboard.
4262
+ *
4263
+ * Each row carries a drag handle. Space or Enter picks the row up, Arrow keys move it,
4264
+ * Space or Enter drops it, and Escape restores the order it had before the pick-up — the
4265
+ * keyboard path Ionic's pointer-only `ion-reorder` has no equivalent for. Every transition
4266
+ * is announced through a polite live region.
4267
+ */
4268
+ declare function ReorderList({
4269
+ value,
4270
+ onValueChange,
4271
+ disabled,
4272
+ labels,
4273
+ className
4274
+ }: ReorderListProps): import("react").JSX.Element;
4275
+ interface VirtualListProps<Item> {
4276
+ items: Item[];
4277
+ /** Fixed row height in px. Rows must all be this tall for positions to be correct. */
4278
+ itemHeight: number;
4279
+ /**
4280
+ * Height of the scrolling viewport, in px.
4281
+ *
4282
+ * Deliberately not a CSS length: the visible row count is computed from this number, and
4283
+ * a relative length like `100%` cannot be resolved without measuring. Wrap the list and
4284
+ * pass a measured px value if the height has to be fluid.
4285
+ */
4286
+ height: number;
4287
+ renderItem: (item: Item, index: number) => ReactNode;
4288
+ /**
4289
+ * Extra rows rendered above and below the visible window, to cover fast scrolling.
4290
+ *
4291
+ * @defaultValue `3`
4292
+ * @see the component manifest
4293
+ */
4294
+ overscan?: number;
4295
+ /** Accessible label for the list; defaults to none, so label it when standalone. */
4296
+ ariaLabel?: string;
4297
+ className?: string;
4298
+ }
4299
+ /**
4300
+ * Renders only the rows inside the scrolled viewport, so a list of any length costs a
4301
+ * constant number of DOM nodes.
4302
+ *
4303
+ * Row height is fixed: positions are arithmetic rather than measured, which keeps scrolling
4304
+ * on the compositor and avoids a layout pass per frame. Each rendered row carries
4305
+ * `aria-setsize` and `aria-posinset` for the **full** collection, so assistive technology
4306
+ * reports "3 of 10000" rather than the size of the rendered window.
4307
+ */
4308
+ declare function VirtualList<Item>({
4309
+ items,
4310
+ itemHeight,
4311
+ height,
4312
+ renderItem,
4313
+ overscan,
4314
+ ariaLabel,
4315
+ className
4316
+ }: VirtualListProps<Item>): import("react").JSX.Element;
4317
+ interface WheelPickerOption {
4318
+ value: string;
4319
+ label: string;
4320
+ }
4321
+ interface WheelPickerProps {
4322
+ options: WheelPickerOption[];
4323
+ value: string;
4324
+ onValueChange: (value: string) => void;
4325
+ /**
4326
+ * How many rows are visible. Odd numbers keep the selection centred.
4327
+ *
4328
+ * @defaultValue `5`
4329
+ * @see the component manifest
4330
+ */
4331
+ visibleCount?: number;
4332
+ /**
4333
+ * Row height in px.
4334
+ *
4335
+ * @defaultValue `36`
4336
+ * @see the component manifest
4337
+ */
4338
+ itemHeight?: number;
4339
+ ariaLabel?: string;
4340
+ className?: string;
4341
+ }
4342
+ /**
4343
+ * iOS-style drum picker: a column of options that scrolls and snaps to a centred selection.
4344
+ *
4345
+ * The wheel is CSS scroll-snap, not a JavaScript gesture engine — momentum, rubber-banding
4346
+ * and snapping are the platform's, so the whole gesture runs on the compositor and behaves
4347
+ * natively on every device. JavaScript only reads which row settled and moves the column
4348
+ * when the value changes from outside.
4349
+ *
4350
+ * Semantically a single-select listbox whose selection follows focus: Arrow keys, Home and
4351
+ * End move the selection and scroll to match, so there is nothing to confirm.
4352
+ */
4353
+ declare function WheelPicker({
4354
+ options,
4355
+ value,
4356
+ onValueChange,
4357
+ visibleCount,
4358
+ itemHeight,
4359
+ ariaLabel,
4360
+ className
4361
+ }: WheelPickerProps): import("react").JSX.Element;
4129
4362
  interface DrawerProps {
4130
4363
  /** Controlled open state. */
4131
4364
  open?: boolean;
@@ -4749,143 +4982,4 @@ declare function PageHeader({
4749
4982
  actions,
4750
4983
  className
4751
4984
  }: PageHeaderProps): import("react").JSX.Element;
4752
- /**
4753
- * Set the active theme imperatively, from anywhere. Persists the choice and
4754
- * drives the `data-theme` attribute through the mounted {@link ThemeProvider}.
4755
- *
4756
- * Requires a mounted {@link ThemeProvider} — this writes the signal, the provider writes
4757
- * the DOM. Without one, nothing restyles (dev builds warn). To write the attribute
4758
- * directly, with no provider and no React, use {@link applyTheme}.
4759
- */
4760
- declare function setTheme(next: string): void;
4761
- /**
4762
- * Write a theme onto an element directly, with no provider and no React.
4763
- *
4764
- * The escape hatch for imperative setups: a theme toggle in a non-React shell, a
4765
- * pre-hydration inline script, a Storybook decorator, an e2e test. Also updates the theme
4766
- * signal, so a React tree reading {@link useTheme} stays in sync.
4767
- *
4768
- * `setTheme` deliberately does **not** do this itself: it is SSR-callable, and
4769
- * `ThemeProvider` can scope a theme to any subtree via its `target` ref. A direct document
4770
- * write inside `setTheme` would break scoped theming and touch `document` on the server.
4771
- *
4772
- * ```ts
4773
- * applyTheme('midnight') // <html data-theme="midnight">
4774
- * applyTheme('warm', panelRef.current) // scope to a subtree
4775
- * ```
4776
- *
4777
- * No-op on the server (no `document`).
4778
- */
4779
- declare function applyTheme(next: string, target?: HTMLElement | null): void;
4780
- /**
4781
- * Read and set the active theme. Returns the current theme **name** (a plain
4782
- * string) and a setter — the component re-renders when the theme changes with no
4783
- * signal handling on your part (this hook calls `useSignals()` for you, so it
4784
- * works in React apps with no Babel transform). This is the React-idiomatic shape;
4785
- * for signal-native code (`computed()`, `effect()`, Preact) use {@link themeSignal}.
4786
- *
4787
- * ```tsx
4788
- * const [theme, setTheme] = useTheme()
4789
- * return <button onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>
4790
- * {theme}
4791
- * </button>
4792
- * ```
4793
- */
4794
- declare function useTheme(): readonly [string, (next: string) => void];
4795
- /**
4796
- * The underlying theme signal, for signal-native code — `computed()`, `effect()`,
4797
- * or a Preact app where signals are natively reactive. Most React apps want
4798
- * {@link useTheme}, which hands back a plain string and handles subscription.
4799
- */
4800
- declare function themeSignal(): Signal<string>;
4801
- interface ThemeProviderProps {
4802
- /**
4803
- * Theme to use when nothing is persisted yet. When set, it **wins over** the
4804
- * visitor's OS `prefers-color-scheme` — pass it for a "dark by default" or
4805
- * custom-theme (`'midnight'`, …) app. Omit it to follow the OS (light/dark),
4806
- * falling back to `'light'`. Precedence: persisted value > `defaultTheme` (if
4807
- * set) > OS preference > `'light'`.
4808
- */
4809
- defaultTheme?: string;
4810
- /**
4811
- * Controlled theme. When set, the provider mirrors it on every render and the
4812
- * persisted value is ignored — the parent owns the state (React semantics).
4813
- */
4814
- value?: string;
4815
- /** localStorage key for the persisted choice. Defaults to `cascivo-theme`. */
4816
- storageKey?: string;
4817
- /** Attribute written to the target element. Defaults to `data-theme`. */
4818
- attribute?: string;
4819
- /**
4820
- * Element to theme. Omit to theme the whole document (`<html>`). Pass a ref to
4821
- * a container to scope the theme to a subtree — cascivo themes resolve against
4822
- * the nearest `data-theme`, so a scoped subtree can differ from the page.
4823
- */
4824
- target?: RefObject<HTMLElement | null>;
4825
- /** Called whenever the active theme changes. */
4826
- onChange?: (theme: string) => void;
4827
- /**
4828
- * CSP nonce forwarded to the inline attribute-setter script emitted for the
4829
- * controlled ({@link ThemeProviderProps.value}) SSR flow. Set it to match your
4830
- * Content-Security-Policy `script-src 'nonce-…'`.
4831
- */
4832
- nonce?: string;
4833
- children?: ReactNode;
4834
- }
4835
- /**
4836
- * Binds the active theme signal to a `data-theme` attribute and persists the
4837
- * choice — the reusable, SSR-safe form of the wiring apps otherwise hand-roll.
4838
- *
4839
- * - No flash of the wrong theme: pair with {@link themePreloadScript} in your
4840
- * document `<head>` so the correct theme paints on first byte.
4841
- * - No banned React hooks: the DOM write happens in `useSignalEffect`, not
4842
- * `useEffect`; there is no `useState`/`useContext`.
4843
- * - Uncontrolled by default (persists to localStorage); pass `value` to control.
4844
- * - SSR-safe when controlled: with a `value` (and no scoped `target`), the
4845
- * provider renders a tiny inline script that sets `data-theme` during HTML
4846
- * parsing, so the server-rendered first paint is themed — no flash, no
4847
- * hydration mismatch (the same markup renders on both sides; the client effect
4848
- * owns every update after hydration). For the uncontrolled/persisted flow, pair
4849
- * with {@link themePreloadScript} in `<head>` instead.
4850
- */
4851
- declare function ThemeProvider({
4852
- defaultTheme,
4853
- value,
4854
- storageKey,
4855
- attribute,
4856
- target,
4857
- onChange,
4858
- nonce,
4859
- children
4860
- }: ThemeProviderProps): ReactNode;
4861
- /**
4862
- * A tiny script to inline in your document `<head>` (before the app bundle) so
4863
- * the persisted theme paints on the first byte — no flash of the wrong theme on
4864
- * SSR or a hard reload. Pass the same `storageKey`/`attribute`/`defaultTheme`
4865
- * you give {@link ThemeProvider}.
4866
- *
4867
- * Precedence matches {@link ThemeProvider}: persisted value > `defaultTheme`
4868
- * (if set) > OS `prefers-color-scheme` > `'light'`. Passing `defaultTheme`
4869
- * suppresses the OS check, so a "dark by default" app stays dark on a light-OS
4870
- * visitor.
4871
- *
4872
- * The script sets `data-theme` **before** React hydrates, so add
4873
- * `suppressHydrationWarning` to the element that carries the attribute (usually
4874
- * `<html>`) — the mutation is intentional, and without the flag React 19 logs a
4875
- * hydration mismatch.
4876
- *
4877
- * ```tsx
4878
- * // Next.js app/layout.tsx
4879
- * <html suppressHydrationWarning>
4880
- * <head>
4881
- * <script dangerouslySetInnerHTML={{ __html: themePreloadScript({ defaultTheme: 'dark' }) }} />
4882
- * </head>
4883
- * </html>
4884
- * ```
4885
- */
4886
- declare function themePreloadScript(options?: {
4887
- storageKey?: string;
4888
- attribute?: string;
4889
- defaultTheme?: string;
4890
- }): string;
4891
- export { Accordion, AccordionContent, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, ActionSheet, ActionSheetAction, ActionSheetProps, Alert, AlertDialog, AlertDialogLabels, AlertDialogProps, AlertProps, AppShell, AppShellProps, AspectRatio, AspectRatioProps, AutoGrid, AutoGridProps, Avatar, AvatarGroup, AvatarGroupLabels, AvatarGroupProps, AvatarProps, Badge, BadgeProps, Blockquote, BlockquoteProps, BottomSheet, BottomSheetProps, Breadcrumb, BreadcrumbItem, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Calendar, CalendarLabels, CalendarProps, Card, CardContent, CardContentProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselLabels, CarouselProps, Center, CenterProps, ChatBubble, ChatBubbleProps, ChatBubbleSide, Checkbox, CheckboxCard, CheckboxCardProps, CheckboxProps, Code, type CodeLang, CodeProps, CodeSnippet, CodeSnippetProps, Collapsible, CollapsibleProps, ColorPicker, ColorPickerLabels, ColorPickerProps, Column, Columns, ColumnsProps, Combobox, ComboboxLabels, ComboboxOption, ComboboxProps, CommandAction, CommandGroup, CommandItem, CommandMenu, CommandMenuProps, CommandPage, CommandScope, CommandStatus, Comparison, ComparisonProps, ContainedList, ContainedListItem, ContainedListItemProps, ContainedListProps, ContextMenu, ContextMenuItem, ContextMenuItemProps, ContextMenuProps, CopyButton, CopyButtonProps, DataList, DataListItem, DataListProps, DataTable, DataTableLabels, DataTableProps, DatePicker, DatePickerLabels, DatePickerProps, DateRange, DateRangePicker, DateRangePickerLabels, DateRangePickerProps, DateRangePreset, DismissableLayer, type DismissableLayerProps, Dock, DockItem, DockProps, Drawer, DrawerProps, Dropdown, DropdownItem, DropdownProps, Editable, EditableProps, EmptyState, EmptyStateProps, ErrorBoundary, Fab, FabAction, FabProps, Field, FieldProps, FileUploader, FileUploaderLabels, FileUploaderProps, Filter, FilterOption, FilterProps, FilterVariant, Flex, FlexProps, FocusScope, Form, FormConfig, FormProps, FormStore, FuzzyMatch, Grid, GridAlign, GridItem, GridItemProps, GridProps, Header, HeaderLabels, HeaderLink, HeaderPanel, HeaderPanelLabels, HeaderPanelProps, HeaderProps, Heading, HeadingLevel, HeadingProps, HeadingSize, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, IconButton, IconButtonProps, Image, ImageProps, Indicator, IndicatorPlacement, IndicatorProps, InlineLoading, InlineLoadingProps, InlineLoadingStatus, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, type InputGroupProps, InputProps, Item, ItemActions, ItemActionsProps, ItemContent, ItemContentProps, ItemDescription, ItemDescriptionProps, ItemMedia, ItemMediaProps, ItemProps, ItemTitle, ItemTitleProps, Join, JoinOrientation, JoinProps, Kbd, KbdProps, Label, LabelProps, Link, type LinkComponent, type LinkComponentProps, LinkProps, List, ListItem, ListItemProps, ListProps, LogLevel, LogLine, LogViewer, LogViewerLabels, LogViewerProps, type Machine, type MachineConfig, Menu, MenuButton, MenuButtonItem, MenuButtonProps, MenuItem, MenuItemProps, MenuProps, MenuSeparator, MenuTrigger, MenuTriggerProps, Menubar, MenubarBaseProps, MenubarItem, MenubarMenu, MenubarProps, Modal, ModalProps, MultiSelect, MultiSelectLabels, MultiSelectOption, MultiSelectProps, NativeSelect, NativeSelectOption, NativeSelectProps, NavigationMenu, NavigationMenuItem, NavigationMenuProps, Notification, NotificationProps, NotificationVariant, NumberInput, NumberInputProps, OtpInput, OtpInputProps, OverflowMenu, OverflowMenuItem, OverflowMenuProps, PageHeader, PageHeaderProps, Pagination, PaginationLabels, PaginationProps, PasswordInput, PasswordInputLabels, PasswordInputProps, Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps, Portal, Presence, Progress, ProgressBar, ProgressBarProps, ProgressCircle, ProgressCircleProps, ProgressIndicator, ProgressIndicatorProps, ProgressProps, ProgressSize, ProgressStep, ProgressVariant, Prose, ProseProps, PullToRefresh, PullToRefreshProps, QrCode, QrCodeProps, RadialProgress, RadialProgressProps, RadialProgressSize, RadialProgressVariant, Radio, RadioCard, RadioCardGroup, RadioCardGroupProps, RadioCardProps, RadioGroup, RadioGroupProps, RadioProps, RatingGroup, RatingGroupLabels, RatingGroupProps, RelativeTime, RelativeTimeProps, Resizable, ResizableProps, Responsive, ScrollArea, ScrollAreaProps, Search, SearchProps, SegmentedControl, SegmentedControlOption, SegmentedControlProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, ShellHeader, ShellHeaderAction, ShellHeaderBrand, ShellHeaderLabels, ShellHeaderNavItem, ShellHeaderNavLink, ShellHeaderNavMenu, ShellHeaderNavMenuItem, ShellHeaderProps, SideNav, SideNavGroup, SideNavItem, SideNavLinkProps, SideNavLinkSubItem, SideNavProps, SideNavSubItem, SideNavTone, Skeleton, SkeletonProps, SkipNavLink, SkipNavLinkProps, SkipNavTarget, SkipNavTargetProps, Slider, SliderProps, Slot, type SlotProps, SortDirection, SortState, Spacer, SpacerProps, Spinner, SpinnerProps, Stack, StackProps, type StandardSchemaV1, Stat, StatProps, Status, StatusProps, Step, StepState, Steps, StepsProps, StructuredList, StructuredListItem, StructuredListProps, SuspenseBoundary, Swap, SwapMode, SwapProps, SwipeAction, SwipeItem, SwipeItemProps, Switcher, SwitcherEntry, SwitcherLink, SwitcherProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsProps, TabsTrigger, TabsTriggerProps, Tag, TagProps, TagsInput, TagsInputProps, Text, TextProps, Textarea, TextareaProps, ThemeProvider, type ThemeProviderProps, Tile, TileProps, TimePicker, TimePickerProps, Timeline, TimelineItem, TimelineProps, ToastOptions, ToastProvider, ToastVariant, Toc, TocItem, TocProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupProps, ToggleProps, Toggletip, ToggletipPlacement, ToggletipProps, Tooltip, TooltipProps, TreeNode, TreeView, TreeViewProps, UploaderFile, type UseClipboardOptions, type UseClipboardReturn, type UseControllableSignalOptions, type UseDisclosureOptions, type UseDisclosureReturn, type UsePopoverOptions, type UsePopoverReturn, type UseTocFromRegionOptions, User, UserProps, VisuallyHidden, VisuallyHiddenProps, applyTheme, batch, cn, composeRefs, computePosition, computed, createForm, createMachine, createScope, createStreamBuffer, dismissAllToasts, effect, fuzzyMatch, fuzzyScore, getLinkComponent, mergeProps, setLinkComponent, setTheme, signal, themePreloadScript, themeSignal, treeViewMessages, useAnchorPosition, useClipboard, useComputed, useControllableSignal, useDisclosure, useEffectPropSignal, useForm, useId, useMachine, useMediaQuery, usePopover, useRovingFocus, useScope, useScrollLock, useSignal, useSignalEffect, useSignals, useStreamBuffer, useTheme, useToast, useTocFromRegion, useTypeahead };
4985
+ export { Accordion, AccordionContent, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, ActionSheet, ActionSheetAction, ActionSheetProps, Alert, AlertDialog, AlertDialogLabels, AlertDialogProps, AlertProps, AppShell, AppShellProps, AspectRatio, AspectRatioProps, AutoGrid, AutoGridProps, Avatar, AvatarGroup, AvatarGroupLabels, AvatarGroupProps, AvatarProps, Badge, BadgeProps, Blockquote, BlockquoteProps, BottomSheet, BottomSheetProps, Breadcrumb, BreadcrumbItem, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Calendar, CalendarLabels, CalendarProps, Card, CardContent, CardContentProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselLabels, CarouselProps, Center, CenterProps, ChatBubble, ChatBubbleProps, ChatBubbleSide, Checkbox, CheckboxCard, CheckboxCardProps, CheckboxProps, Code, type CodeLang, CodeProps, CodeSnippet, CodeSnippetProps, Collapsible, CollapsibleProps, ColorPicker, ColorPickerLabels, ColorPickerProps, Column, Columns, ColumnsProps, Combobox, ComboboxLabels, ComboboxOption, ComboboxProps, CommandAction, CommandGroup, CommandItem, CommandMenu, CommandMenuProps, CommandPage, CommandScope, CommandStatus, Comparison, ComparisonProps, ContainedList, ContainedListItem, ContainedListItemProps, ContainedListProps, ContextMenu, ContextMenuItem, ContextMenuItemProps, ContextMenuProps, CopyButton, CopyButtonProps, DataList, DataListItem, DataListProps, DataTable, DataTableLabels, DataTableProps, DatePicker, DatePickerLabels, DatePickerProps, DateRange, DateRangePicker, DateRangePickerLabels, DateRangePickerProps, DateRangePreset, DismissableLayer, type DismissableLayerProps, Dock, DockItem, DockProps, Drawer, DrawerProps, Dropdown, DropdownItem, DropdownProps, Editable, EditableProps, EmptyState, EmptyStateProps, ErrorBoundary, Fab, FabAction, FabProps, Field, FieldProps, FileUploader, FileUploaderLabels, FileUploaderProps, Filter, FilterOption, FilterProps, FilterVariant, Flex, FlexProps, FocusScope, Form, FormConfig, FormProps, FormStore, FuzzyMatch, Grid, GridAlign, GridItem, GridItemProps, GridProps, Header, HeaderLabels, HeaderLink, HeaderPanel, HeaderPanelLabels, HeaderPanelProps, HeaderProps, Heading, HeadingLevel, HeadingProps, HeadingSize, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, IconButton, IconButtonProps, Image, ImageProps, Indicator, IndicatorPlacement, IndicatorProps, InfiniteScroll, InfiniteScrollProps, InlineLoading, InlineLoadingProps, InlineLoadingStatus, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, type InputGroupProps, InputProps, Item, ItemActions, ItemActionsProps, ItemContent, ItemContentProps, ItemDescription, ItemDescriptionProps, ItemMedia, ItemMediaProps, ItemProps, ItemTitle, ItemTitleProps, Join, JoinOrientation, JoinProps, Kbd, KbdProps, Label, LabelProps, LargeTitleHeader, LargeTitleHeaderProps, Link, type LinkComponent, type LinkComponentProps, LinkProps, List, ListItem, ListItemProps, ListProps, LogLevel, LogLine, LogViewer, LogViewerLabels, LogViewerProps, type Machine, type MachineConfig, Menu, MenuButton, MenuButtonItem, MenuButtonProps, MenuItem, MenuItemProps, MenuProps, MenuSeparator, MenuTrigger, MenuTriggerProps, Menubar, MenubarBaseProps, MenubarItem, MenubarMenu, MenubarProps, Modal, ModalProps, MultiSelect, MultiSelectLabels, MultiSelectOption, MultiSelectProps, NativeSelect, NativeSelectOption, NativeSelectProps, NavigationMenu, NavigationMenuItem, NavigationMenuProps, Notification, NotificationProps, NotificationVariant, NumberInput, NumberInputProps, OtpInput, OtpInputProps, OverflowMenu, OverflowMenuItem, OverflowMenuProps, PageHeader, PageHeaderProps, Pagination, PaginationLabels, PaginationProps, PasswordInput, PasswordInputLabels, PasswordInputProps, Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps, Portal, Presence, Progress, ProgressBar, ProgressBarProps, ProgressCircle, ProgressCircleProps, ProgressIndicator, ProgressIndicatorProps, ProgressProps, ProgressSize, ProgressStep, ProgressVariant, Prose, ProseProps, PullToRefresh, PullToRefreshProps, QrCode, QrCodeProps, RadialProgress, RadialProgressProps, RadialProgressSize, RadialProgressVariant, Radio, RadioCard, RadioCardGroup, RadioCardGroupProps, RadioCardProps, RadioGroup, RadioGroupProps, RadioProps, RatingGroup, RatingGroupLabels, RatingGroupProps, RelativeTime, RelativeTimeProps, ReorderItem, ReorderList, ReorderListProps, Resizable, ResizableProps, Responsive, ScrollArea, ScrollAreaProps, Search, SearchProps, SegmentedControl, SegmentedControlOption, SegmentedControlProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, ShellHeader, ShellHeaderAction, ShellHeaderBrand, ShellHeaderLabels, ShellHeaderNavItem, ShellHeaderNavLink, ShellHeaderNavMenu, ShellHeaderNavMenuItem, ShellHeaderProps, SideNav, SideNavGroup, SideNavItem, SideNavLinkProps, SideNavLinkSubItem, SideNavProps, SideNavSubItem, SideNavTone, Skeleton, SkeletonProps, SkipNavLink, SkipNavLinkProps, SkipNavTarget, SkipNavTargetProps, Slider, SliderProps, Slot, type SlotProps, SortDirection, SortState, Spacer, SpacerProps, Spinner, SpinnerProps, Stack, StackProps, type StandardSchemaV1, Stat, StatProps, Status, StatusProps, Step, StepState, Steps, StepsProps, StructuredList, StructuredListItem, StructuredListProps, SuspenseBoundary, Swap, SwapMode, SwapProps, SwipeAction, SwipeItem, SwipeItemProps, Switcher, SwitcherEntry, SwitcherLink, SwitcherProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsProps, TabsTrigger, TabsTriggerProps, Tag, TagProps, TagsInput, TagsInputProps, Text, TextProps, Textarea, TextareaProps, ThemeProvider, type ThemeProviderProps, Tile, TileProps, TimePicker, TimePickerProps, Timeline, TimelineItem, TimelineProps, ToastOptions, ToastProvider, ToastVariant, Toc, TocItem, TocProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupProps, ToggleProps, Toggletip, ToggletipPlacement, ToggletipProps, Tooltip, TooltipProps, TreeNode, TreeView, TreeViewProps, UploaderFile, type UseClipboardOptions, type UseClipboardReturn, type UseControllableSignalOptions, type UseDisclosureOptions, type UseDisclosureReturn, type UsePopoverOptions, type UsePopoverReturn, type UseTocFromRegionOptions, User, UserProps, VirtualList, VirtualListProps, VisuallyHidden, VisuallyHiddenProps, WheelPicker, WheelPickerOption, WheelPickerProps, applyTheme, batch, cn, composeRefs, computePosition, computed, createForm, createMachine, createScope, createStreamBuffer, dismissAllToasts, effect, fuzzyMatch, fuzzyScore, getLinkComponent, mergeProps, setLinkComponent, setTheme, signal, themePreloadScript, themeSignal, treeViewMessages, useAnchorPosition, useClipboard, useComputed, useControllableSignal, useDisclosure, useEffectPropSignal, useForm, useId, useMachine, useMediaQuery, usePopover, useRovingFocus, useScope, useScrollLock, useSignal, useSignalEffect, useSignals, useStreamBuffer, useTheme, useToast, useTocFromRegion, useTypeahead };
@@ -0,0 +1 @@
1
+ @layer cascivo.component{._root_50go8_2{padding-block:var(--cascivo-space-4);justify-content:center;align-items:center;display:flex}._status_50go8_9{align-items:center;gap:var(--cascivo-space-2);color:var(--cascivo-color-text-muted);font-size:var(--cascivo-text-ui);display:inline-flex}._button_50go8_17{padding-inline:var(--cascivo-space-4);padding-block:var(--cascivo-space-2);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-md);color:var(--cascivo-color-foreground);font:inherit;font-size:var(--cascivo-text-ui);cursor:pointer;background:0 0;justify-content:center;align-items:center;display:inline-flex}._button_50go8_17:hover{background:var(--cascivo-color-surface-2)}._button_50go8_17:focus-visible{outline:var(--cascivo-ring-width) solid var(--cascivo-ring-color);outline-offset:2px}@media (pointer:coarse){._button_50go8_17{min-block-size:var(--cascivo-target-min-coarse,2.75rem)}}}
@@ -0,0 +1,49 @@
1
+ "use client";
2
+
3
+ import { Spinner as e } from "../spinner/spinner.js";
4
+ import t from "./infinite-scroll.module.js";
5
+ import { useRef as n } from "react";
6
+ import { cn as r, useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
7
+ import { builtin as s, t as c } from "@cascivo/i18n";
8
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
+ //#region ../components/src/infinite-scroll/infinite-scroll.tsx
10
+ function d({ onLoadMore: d, disabled: f = !1, rootMargin: p = "200px", labels: m, className: h }) {
11
+ o();
12
+ let g = n(null), _ = i(!1), v = n(d);
13
+ v.current = d;
14
+ let y = n(f);
15
+ y.current = f;
16
+ let b = () => {
17
+ _.value || y.current || (_.value = !0, Promise.resolve(v.current()).then(() => {
18
+ _.value = !1;
19
+ }, () => {
20
+ _.value = !1;
21
+ }));
22
+ }, x = n(b);
23
+ return x.current = b, a(() => {
24
+ let e = g.current;
25
+ if (!e || f || typeof IntersectionObserver > "u") return;
26
+ let t = new IntersectionObserver((e) => {
27
+ e.some((e) => e.isIntersecting) && x.current();
28
+ }, { rootMargin: p });
29
+ return t.observe(e), () => t.disconnect();
30
+ }), f ? null : /* @__PURE__ */ l("div", {
31
+ ref: g,
32
+ className: r(t.root, h),
33
+ children: _.value ? /* @__PURE__ */ u("span", {
34
+ className: t.status,
35
+ role: "status",
36
+ children: [/* @__PURE__ */ l(e, {
37
+ size: "sm",
38
+ "aria-hidden": "true"
39
+ }), m?.loading ?? c(s.infiniteScroll.loading)]
40
+ }) : /* @__PURE__ */ l("button", {
41
+ type: "button",
42
+ className: t.button,
43
+ onClick: b,
44
+ children: m?.loadMore ?? c(s.infiniteScroll.loadMore)
45
+ })
46
+ });
47
+ }
48
+ //#endregion
49
+ export { d as InfiniteScroll };