@a4ui/core 0.1.1 → 0.3.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 (56) hide show
  1. package/README.md +23 -0
  2. package/dist/index.js +451 -432
  3. package/dist/layout/AppShell.d.ts +19 -1
  4. package/dist/layout/EffectsToggle.d.ts +19 -1
  5. package/dist/layout/NavGroup.d.ts +15 -0
  6. package/dist/layout/SpaceBackground.d.ts +13 -0
  7. package/dist/layout/ThemeToggle.d.ts +17 -1
  8. package/dist/lib/cn.d.ts +11 -1
  9. package/dist/lib/effects.d.ts +21 -0
  10. package/dist/lib/media.d.ts +12 -0
  11. package/dist/lib/motion.d.ts +37 -0
  12. package/dist/lib/theme.d.ts +52 -3
  13. package/dist/lib/virtual.d.ts +16 -0
  14. package/dist/styles.css +4 -4
  15. package/dist/ui/Accordion.d.ts +19 -0
  16. package/dist/ui/Alert.d.ts +14 -0
  17. package/dist/ui/AlertDialog.d.ts +15 -0
  18. package/dist/ui/Avatar.d.ts +11 -0
  19. package/dist/ui/Badge.d.ts +12 -0
  20. package/dist/ui/Breadcrumb.d.ts +17 -0
  21. package/dist/ui/Button.d.ts +11 -0
  22. package/dist/ui/Card.d.ts +18 -0
  23. package/dist/ui/Checkbox.d.ts +11 -0
  24. package/dist/ui/Combobox.d.ts +16 -0
  25. package/dist/ui/ContextMenu.d.ts +14 -0
  26. package/dist/ui/DateField.d.ts +18 -0
  27. package/dist/ui/Drawer.d.ts +17 -0
  28. package/dist/ui/Dropdown.d.ts +18 -1
  29. package/dist/ui/Dropzone.d.ts +11 -0
  30. package/dist/ui/HoverCard.d.ts +13 -0
  31. package/dist/ui/Input.d.ts +12 -0
  32. package/dist/ui/Meter.d.ts +12 -0
  33. package/dist/ui/Modal.d.ts +22 -0
  34. package/dist/ui/NumberInput.d.ts +12 -0
  35. package/dist/ui/PageHeader.d.ts +17 -0
  36. package/dist/ui/Pagination.d.ts +19 -0
  37. package/dist/ui/Popover.d.ts +13 -0
  38. package/dist/ui/Progress.d.ts +11 -0
  39. package/dist/ui/RadioGroup.d.ts +20 -0
  40. package/dist/ui/SegmentedControl.d.ts +19 -0
  41. package/dist/ui/Select.d.ts +14 -0
  42. package/dist/ui/Separator.d.ts +11 -0
  43. package/dist/ui/Skeleton.d.ts +11 -0
  44. package/dist/ui/Slider.d.ts +14 -0
  45. package/dist/ui/Spinner.d.ts +10 -0
  46. package/dist/ui/Stat.d.ts +12 -0
  47. package/dist/ui/Switch.d.ts +11 -0
  48. package/dist/ui/Table.d.ts +61 -0
  49. package/dist/ui/Tabs.d.ts +20 -0
  50. package/dist/ui/Textarea.d.ts +12 -0
  51. package/dist/ui/Toast.d.ts +12 -0
  52. package/dist/ui/Toggle.d.ts +12 -0
  53. package/dist/ui/ToggleGroup.d.ts +20 -0
  54. package/dist/ui/Tooltip.d.ts +13 -0
  55. package/dist/ui/VirtualList.d.ts +14 -0
  56. package/package.json +4 -3
@@ -1,4 +1,5 @@
1
1
  import { JSX, ParentProps } from 'solid-js';
2
+ /** Props for {@link AppShell}. All slots are optional — pass only what your app needs. */
2
3
  interface AppShellProps extends ParentProps {
3
4
  /** Left column (e.g. a Sidebar). Rendered as a flex child; owns its own width. */
4
5
  sidebar?: JSX.Element;
@@ -11,8 +12,25 @@ interface AppShellProps extends ParentProps {
11
12
  background?: JSX.Element;
12
13
  /** Max content width for <main>. Default '1400px'. */
13
14
  maxWidth?: string;
14
- /** Override the default error fallback shown when a route throws. */
15
+ /** Override the default error fallback shown when a route throws. Receives
16
+ the caught error and a `reset` callback that re-renders the ErrorBoundary's
17
+ children. */
15
18
  errorFallback?: (err: unknown, reset: () => void) => JSX.Element;
16
19
  }
20
+ /**
21
+ * Generic app shell: a fixed {@link SpaceBackground} behind a flex layout of
22
+ * an optional sidebar slot plus a content column (optional banner + topbar +
23
+ * routed `<main>`). Slot-based and unopinionated about the sidebar — pass
24
+ * your own component via `sidebar` and it manages its own width/collapse.
25
+ * `<main>` is wrapped in `Suspense` + an `ErrorBoundary` (with a ~160ms page
26
+ * cross-fade) so a route chunk failing or still loading never blanks the shell.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * <AppShell sidebar={<Sidebar />} topbar={<Topbar />}>
31
+ * <Route />
32
+ * </AppShell>
33
+ * ```
34
+ */
17
35
  export declare function AppShell(props: ParentProps<AppShellProps>): JSX.Element;
18
36
  export {};
@@ -1 +1,19 @@
1
- export declare function EffectsToggle(): import("solid-js").JSX.Element;
1
+ /** Props for {@link EffectsToggle}. */
2
+ interface EffectsToggleProps {
3
+ /** Accessible label / tooltip text. Defaults to `'Visual effects'`. */
4
+ label?: string;
5
+ }
6
+ /**
7
+ * Icon button that toggles the "visual effects" switch: pressed (default) is
8
+ * the full space-glass experience (translucent glass, starfield, animation);
9
+ * un-pressed is calm mode (opaque surfaces, no starfield, no motion) — useful
10
+ * for contrast, motion sensitivity, and low-power devices. Wraps
11
+ * {@link useEffects} + {@link setEffects}.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * <EffectsToggle label="Toggle effects" />
16
+ * ```
17
+ */
18
+ export declare function EffectsToggle(props: EffectsToggleProps): import("solid-js").JSX.Element;
19
+ export {};
@@ -1,6 +1,21 @@
1
1
  import { JSX, ParentProps } from 'solid-js';
2
+ /** Props for {@link NavGroup}. */
2
3
  interface NavGroupProps extends ParentProps {
4
+ /** Category heading shown in the summary row (rendered uppercase). */
3
5
  title: string;
4
6
  }
7
+ /**
8
+ * Collapsible sidebar nav category. Uses native `<details>`/`<summary>` (no
9
+ * JS state), with a chevron that rotates via a `group-[[open]]` CSS variant.
10
+ * Expanded by default; wrap a list of nav links as `children`.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <NavGroup title="Settings">
15
+ * <NavLink href="/settings/profile">Profile</NavLink>
16
+ * <NavLink href="/settings/billing">Billing</NavLink>
17
+ * </NavGroup>
18
+ * ```
19
+ */
5
20
  export declare function NavGroup(props: NavGroupProps): JSX.Element;
6
21
  export {};
@@ -1 +1,14 @@
1
+ /**
2
+ * The "space glass" backdrop: a fixed, `aria-hidden` layer (z-0) meant to sit
3
+ * behind all page content (this is {@link AppShell}'s default `background`).
4
+ * Renders a randomized starfield (with twinkle + occasional shooting stars,
5
+ * or rockets in light theme), static nebula/planets, gyroscope parallax on
6
+ * phones, and cursor-glow/magnetic-button effects. Takes no props; reacts to
7
+ * {@link useTheme} for star tints and to `motionReduced()` to skip all motion.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <SpaceBackground />
12
+ * ```
13
+ */
1
14
  export declare function SpaceBackground(): import("solid-js").JSX.Element;
@@ -1,2 +1,18 @@
1
1
  import { JSX } from 'solid-js';
2
- export declare function ThemeToggle(): JSX.Element;
2
+ /** Props for {@link ThemeToggle}. */
3
+ interface ThemeToggleProps {
4
+ /** Accessible label / tooltip text. Defaults to `'Toggle theme'`. */
5
+ label?: string;
6
+ }
7
+ /**
8
+ * Icon button that flips between dark and light theme. The icon shows the
9
+ * CURRENT theme (moon when dark, sun when light), not the theme you'd switch
10
+ * to. Wraps {@link useTheme} + {@link toggleTheme}.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <ThemeToggle label="Switch theme" />
15
+ * ```
16
+ */
17
+ export declare function ThemeToggle(props: ThemeToggleProps): JSX.Element;
18
+ export {};
package/dist/lib/cn.d.ts CHANGED
@@ -1,3 +1,13 @@
1
1
  import { ClassValue } from 'clsx';
2
- /** Merge Tailwind class lists, resolving conflicting utilities left-to-right. */
2
+ /**
3
+ * Merge Tailwind class lists, resolving conflicting utilities left-to-right
4
+ * (via `tailwind-merge`) after flattening conditionals/arrays/objects (via `clsx`).
5
+ * Use this instead of template-string concatenation whenever a component
6
+ * accepts a `class` override that should win over its own defaults.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * cn('px-2 py-1 text-sm', isActive && 'bg-primary text-primary-foreground', props.class)
11
+ * ```
12
+ */
3
13
  export declare function cn(...inputs: ClassValue[]): string;
@@ -1,4 +1,25 @@
1
+ /**
2
+ * Reactive accessor for the "visual effects" switch: `true` = full
3
+ * space-glass experience (glass, starfield, animation), `false` = calm mode.
4
+ * Backing signal shared module-wide, so every consumer (e.g.
5
+ * {@link EffectsToggle}) reads the same source of truth.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const effectsOn = useEffects()
10
+ * console.log(effectsOn()) // true | false
11
+ * ```
12
+ */
1
13
  export declare function useEffects(): import('solid-js').Accessor<boolean>;
2
14
  /** True when visual effects are OFF (calm mode). Read by motion + charts. */
3
15
  export declare function isCalm(): boolean;
16
+ /**
17
+ * Persist and apply the visual-effects switch: toggles `html.calm` (opaque
18
+ * surfaces, no starfield, no motion when off) and updates {@link useEffects}.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * setEffects(false) // enter calm mode
23
+ * ```
24
+ */
4
25
  export declare function setEffects(on: boolean): void;
@@ -1 +1,13 @@
1
+ /**
2
+ * Reactive `matchMedia` matcher: returns a signal accessor that updates when
3
+ * the query's match state changes, cleaning up its listener on unmount.
4
+ * Handy for rendering either a desktop or mobile layout instead of hiding one
5
+ * with CSS.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * const isDesktop = useMediaQuery('(min-width: 768px)')
10
+ * return isDesktop() ? <DesktopTable /> : <MobileCards />
11
+ * ```
12
+ */
1
13
  export declare function useMediaQuery(query: string): () => boolean;
@@ -3,15 +3,46 @@ import { Accessor } from 'solid-js';
3
3
  * Snapshot of the user's reduced-motion preference at call time. Not
4
4
  * reactive to preference changes mid-session (matches theme.ts's one-shot
5
5
  * environment read) — reload picks up changes.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * if (prefersReducedMotion()) skipEntranceAnimation()
10
+ * ```
6
11
  */
7
12
  export declare function prefersReducedMotion(): boolean;
13
+ /**
14
+ * Reactive accessor for the persisted "force full motion" opt-out (the ⚡
15
+ * MotionToggle) — `true` re-enables animation even when the OS requests
16
+ * reduced motion.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const forced = useMotionForced()
21
+ * console.log(forced()) // true | false
22
+ * ```
23
+ */
8
24
  export declare function useMotionForced(): Accessor<boolean>;
25
+ /**
26
+ * Persist the "force full motion" choice, toggle `html.force-motion`
27
+ * (which the reduced-motion `@media` block in styles.css keys off), and
28
+ * update {@link useMotionForced}.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * setMotionForced(true) // opt back into full motion despite OS setting
33
+ * ```
34
+ */
9
35
  export declare function setMotionForced(on: boolean): void;
10
36
  /**
11
37
  * Effective reduced-motion: reduced when calm mode (visual effects OFF) is on,
12
38
  * or when the OS asks for reduced motion and the user hasn't forced it. JS-driven
13
39
  * motion (SpaceBackground, count-up) gates on this rather than
14
40
  * prefersReducedMotion() directly.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * if (!motionReduced()) startParallaxLoop()
45
+ * ```
15
46
  */
16
47
  export declare function motionReduced(): boolean;
17
48
  /**
@@ -20,5 +51,11 @@ export declare function motionReduced(): boolean;
20
51
  * yet, and this needs to interpolate a plain number rather than a DOM
21
52
  * property, so it's a small hand-rolled WAAPI-adjacent tween for KPI count-up).
22
53
  * Jumps straight to the target under prefers-reduced-motion.
54
+ *
55
+ * @example
56
+ * ```tsx
57
+ * const animated = createCountUp(() => props.value, 800)
58
+ * return <span>{Math.round(animated())}</span>
59
+ * ```
23
60
  */
24
61
  export declare function createCountUp(target: Accessor<number>, durationMs?: number): Accessor<number>;
@@ -1,10 +1,59 @@
1
+ /** The two supported color schemes. `'dark'` (the "night" palette) is the default. */
1
2
  export type Theme = 'dark' | 'light';
2
- /** The persisted choice, defaulting to dark when nothing is stored. */
3
+ /**
4
+ * Read the persisted theme choice from `localStorage`, defaulting to `'dark'`
5
+ * when nothing is stored (or storage is unavailable).
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const initial = storedTheme() // 'dark' | 'light'
10
+ * ```
11
+ */
3
12
  export declare function storedTheme(): Theme;
4
- /** Reflect the theme onto <html data-theme>: dark is the default (no attribute). */
13
+ /**
14
+ * Reflect a theme onto `<html data-theme>` without touching storage or the
15
+ * shared signal. Dark is the default (no attribute); light sets
16
+ * `data-theme="light"`. Prefer {@link setTheme} unless you specifically need
17
+ * to apply without persisting.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * applyTheme('light')
22
+ * ```
23
+ */
5
24
  export declare function applyTheme(theme: Theme): void;
6
- /** Persist and apply a theme choice. */
25
+ /**
26
+ * Persist a theme choice to `localStorage` and apply it to `<html>`. Does not
27
+ * update the shared `useTheme()` signal directly — {@link toggleTheme} does
28
+ * that after calling this.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * setTheme('light')
33
+ * ```
34
+ */
7
35
  export declare function setTheme(theme: Theme): void;
36
+ /**
37
+ * The opposite of the given theme. Pure helper (no signal/storage side effects)
38
+ * used by {@link toggleTheme}.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * toggled('dark') // 'light'
43
+ * ```
44
+ */
8
45
  export declare function toggled(theme: Theme): Theme;
46
+ /**
47
+ * Reactive accessor for the current theme, shared module-wide so every
48
+ * consumer (e.g. {@link ThemeToggle}, `SpaceBackground`) reads the same
49
+ * source of truth.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const theme = useTheme()
54
+ * console.log(theme()) // 'dark' | 'light'
55
+ * ```
56
+ */
9
57
  export declare function useTheme(): import('solid-js').Accessor<Theme>;
58
+ /** Flip the current theme (dark↔light), persisting and applying the new value. */
10
59
  export declare function toggleTheme(): void;
@@ -1,2 +1,18 @@
1
1
  import { Accessor } from 'solid-js';
2
+ /**
3
+ * Works around a `@tanstack/solid-virtual` bug where the virtualizer measures
4
+ * a 0×0 viewport: it attaches its `ResizeObserver` during the render pass
5
+ * (when `getScrollElement` first returns the scroll container), before the
6
+ * container has been laid out, so it caches a 0×0 size and never renders any
7
+ * rows. Once layout settles, this detaches+reattaches the scroll element so
8
+ * the observer re-measures the real height. Call it right after wiring up
9
+ * the virtualizer, passing the scroll-element signal's getter and setter.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const [scrollEl, setScrollEl] = createSignal<HTMLElement>()
14
+ * const virtualizer = createVirtualizer({ getScrollElement: scrollEl, ... })
15
+ * remeasureAfterLayout(scrollEl, setScrollEl)
16
+ * ```
17
+ */
2
18
  export declare function remeasureAfterLayout(scrollEl: Accessor<HTMLElement | undefined>, setScrollEl: (v: HTMLElement | undefined) => void): void;
package/dist/styles.css CHANGED
@@ -18,11 +18,11 @@
18
18
  --muted-foreground: 215 25% 75%;
19
19
  --border: 217 30% 22%;
20
20
  --input: 217 30% 22%;
21
- --primary: 217 91% 60%;
21
+ --primary: 217 91% 52%;
22
22
  --primary-foreground: 0 0% 100%;
23
23
  --accent: 199 89% 55%;
24
24
  --accent-foreground: 0 0% 100%;
25
- --ring: 217 91% 60%;
25
+ --ring: 217 91% 52%;
26
26
  --destructive: 0 72% 55%;
27
27
  --destructive-foreground: 0 0% 100%;
28
28
 
@@ -54,11 +54,11 @@
54
54
  --muted-foreground: 215 22% 38%;
55
55
  --border: 214 24% 84%;
56
56
  --input: 214 32% 91%;
57
- --primary: 217 91% 55%;
57
+ --primary: 217 91% 52%;
58
58
  --primary-foreground: 0 0% 100%;
59
59
  --accent: 199 89% 48%;
60
60
  --accent-foreground: 0 0% 100%;
61
- --ring: 217 91% 55%;
61
+ --ring: 217 91% 52%;
62
62
  --destructive: 0 72% 51%;
63
63
  --destructive-foreground: 0 0% 100%;
64
64
  }
@@ -1,13 +1,32 @@
1
1
  import { JSX } from 'solid-js';
2
+ /** A single collapsible section rendered by {@link Accordion}. */
2
3
  export interface AccordionItem {
4
+ /** Unique identifier for the item; used to track expanded state. */
3
5
  value: string;
6
+ /** Text shown in the trigger row. */
4
7
  title: string;
8
+ /** Content revealed when the item is expanded. */
5
9
  content: JSX.Element;
6
10
  }
7
11
  interface AccordionProps {
8
12
  items: AccordionItem[];
13
+ /** Allow more than one item to be expanded at the same time. Defaults to `false` (single-open). */
9
14
  multiple?: boolean;
10
15
  class?: string;
11
16
  }
17
+ /**
18
+ * Accessible, collapsible list of sections built on Kobalte's `Accordion` primitive.
19
+ * Each entry in `items` renders as a header/trigger row plus a content panel.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <Accordion
24
+ * items={[
25
+ * { value: 'a', title: 'What is A4ui?', content: <p>A SolidJS design system.</p> },
26
+ * { value: 'b', title: 'How do I install it?', content: <p>npm install a4ui</p> },
27
+ * ]}
28
+ * />
29
+ * ```
30
+ */
12
31
  export declare function Accordion(props: AccordionProps): JSX.Element;
13
32
  export {};
@@ -1,9 +1,23 @@
1
1
  import { JSX, ParentProps } from 'solid-js';
2
+ /** Semantic tone of an {@link Alert}; drives the border/background tint and icon. */
2
3
  export type AlertTone = 'info' | 'success' | 'warning' | 'danger';
3
4
  interface AlertProps extends ParentProps {
5
+ /** Visual/semantic tone. Defaults to `'info'`. */
4
6
  tone?: AlertTone;
7
+ /** Optional bold heading shown above the body text. */
5
8
  title?: string;
6
9
  class?: string;
7
10
  }
11
+ /**
12
+ * Inline status banner (not a toast/dialog) built on Kobalte's `Alert` primitive,
13
+ * for surfacing info/success/warning/danger messages inline in the page.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <Alert tone="warning" title="Heads up">
18
+ * Your session will expire in 5 minutes.
19
+ * </Alert>
20
+ * ```
21
+ */
8
22
  export declare function Alert(props: AlertProps): JSX.Element;
9
23
  export {};
@@ -1,9 +1,24 @@
1
1
  import { JSX, ParentProps } from 'solid-js';
2
2
  interface AlertDialogProps extends ParentProps {
3
+ /** Whether the dialog is currently visible. */
3
4
  open: boolean;
5
+ /** Called when the dialog requests to open/close (overlay click, Escape, etc). */
4
6
  onOpenChange: (open: boolean) => void;
7
+ /** Optional heading rendered above the description. */
5
8
  title?: string;
6
9
  class?: string;
7
10
  }
11
+ /**
12
+ * Centered, focus-trapped confirmation modal built on Kobalte's `AlertDialog`
13
+ * primitive. Use for interruptive confirmations (e.g. "Delete this item?")
14
+ * rather than for general-purpose dialogs.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <AlertDialog open={confirmOpen()} onOpenChange={setConfirmOpen} title="Delete project?">
19
+ * This action cannot be undone.
20
+ * </AlertDialog>
21
+ * ```
22
+ */
8
23
  export declare function AlertDialog(props: AlertDialogProps): JSX.Element;
9
24
  export {};
@@ -1,9 +1,20 @@
1
1
  import { JSX } from 'solid-js';
2
2
  interface AvatarProps {
3
+ /** Image URL. If it fails to load (or is omitted), `fallback` is shown instead. */
3
4
  src?: string;
4
5
  alt?: string;
6
+ /** Text shown when there is no image or it fails to load (typically initials). */
5
7
  fallback: string;
6
8
  class?: string;
7
9
  }
10
+ /**
11
+ * Circular user avatar built on Kobalte's `Image` primitive; automatically
12
+ * falls back to initials/text when the image is missing or fails to load.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <Avatar src={user.avatarUrl} alt={user.name} fallback="JD" />
17
+ * ```
18
+ */
8
19
  export declare function Avatar(props: AvatarProps): JSX.Element;
9
20
  export {};
@@ -1,8 +1,20 @@
1
1
  import { JSX, ParentProps } from 'solid-js';
2
+ /** Semantic tone of a {@link Badge}; drives its background/text/ring color. */
2
3
  export type BadgeTone = 'neutral' | 'success' | 'warning' | 'danger' | 'info';
3
4
  interface BadgeProps extends ParentProps {
5
+ /** Visual/semantic tone. Defaults to `'neutral'`. */
4
6
  tone?: BadgeTone;
5
7
  class?: string;
6
8
  }
9
+ /**
10
+ * Small rounded pill for status/labels, e.g. counts, states, or tags.
11
+ * Generic design-system primitive — app-specific tone mappers (e.g. mapping a
12
+ * business status to a {@link BadgeTone}) should live in the consuming app.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <Badge tone="success">Active</Badge>
17
+ * ```
18
+ */
7
19
  export declare function Badge(props: BadgeProps): JSX.Element;
8
20
  export {};
@@ -1,11 +1,28 @@
1
1
  import { JSX } from 'solid-js';
2
+ /** A single crumb rendered by {@link Breadcrumb}. */
2
3
  export interface BreadcrumbItem {
3
4
  label: string;
5
+ /** Link target. Omit (or leave undefined on the last item) to render plain text for the current page. */
4
6
  href?: string;
5
7
  }
6
8
  interface BreadcrumbProps {
9
+ /** Ordered trail from root to current page; the last item is treated as the current location. */
7
10
  items: BreadcrumbItem[];
8
11
  class?: string;
9
12
  }
13
+ /**
14
+ * Navigation trail built on Kobalte's `Breadcrumbs` primitive. The last item
15
+ * in `items` is rendered as plain (non-link) text to indicate the current page.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <Breadcrumb
20
+ * items={[
21
+ * { label: 'Projects', href: '/projects' },
22
+ * { label: 'A4ui' },
23
+ * ]}
24
+ * />
25
+ * ```
26
+ */
10
27
  export declare function Breadcrumb(props: BreadcrumbProps): JSX.Element;
11
28
  export {};
@@ -1,10 +1,21 @@
1
1
  import { JSX, ParentProps } from 'solid-js';
2
+ /** Visual style of a {@link Button}. Defaults to `'primary'`. */
2
3
  export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost';
3
4
  interface ButtonProps extends ParentProps, Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
5
+ /** Visual style. Defaults to `'primary'`. */
4
6
  variant?: ButtonVariant;
5
7
  class?: string;
6
8
  /** Defaults to "button" so action buttons inside a form never submit it by accident. */
7
9
  type?: 'button' | 'submit' | 'reset';
8
10
  }
11
+ /**
12
+ * Base button primitive: a plain `<button>` with A4ui's variants, focus ring,
13
+ * and press/hover transitions. Accepts all standard button HTML attributes.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <Button variant="outline" onClick={() => save()}>Save</Button>
18
+ * ```
19
+ */
9
20
  export declare function Button(props: ButtonProps): JSX.Element;
10
21
  export {};
package/dist/ui/Card.d.ts CHANGED
@@ -11,8 +11,26 @@ interface CardProps extends DivProps {
11
11
  */
12
12
  glow?: boolean;
13
13
  }
14
+ /**
15
+ * Container surface for grouping related content, with an optional frosted
16
+ * "space glass" look. Compose with {@link CardHeader}, {@link CardTitle}, and
17
+ * {@link CardContent}.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <Card glass>
22
+ * <CardHeader>
23
+ * <CardTitle>Usage</CardTitle>
24
+ * </CardHeader>
25
+ * <CardContent>1,204 requests today</CardContent>
26
+ * </Card>
27
+ * ```
28
+ */
14
29
  export declare function Card(props: CardProps): JSX.Element;
30
+ /** Header region of a {@link Card}; typically wraps a {@link CardTitle}. */
15
31
  export declare function CardHeader(props: DivProps): JSX.Element;
32
+ /** Heading text (rendered as an `<h2>`) for a {@link Card}. */
16
33
  export declare function CardTitle(props: DivProps): JSX.Element;
34
+ /** Main body region of a {@link Card}, below the header. */
17
35
  export declare function CardContent(props: DivProps): JSX.Element;
18
36
  export {};
@@ -1,9 +1,20 @@
1
1
  import { JSX } from 'solid-js';
2
2
  interface CheckboxProps {
3
3
  checked: boolean;
4
+ /** Called with the new checked state whenever the input is toggled. */
4
5
  onChange: (checked: boolean) => void;
6
+ /** Visible label rendered next to the checkbox; also makes the whole row clickable. */
5
7
  label: string;
6
8
  class?: string;
7
9
  }
10
+ /**
11
+ * Plain labeled checkbox (native `<input type="checkbox">`, not a Kobalte
12
+ * wrapper) for simple boolean toggles with a visible label.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <Checkbox checked={agreed()} onChange={setAgreed} label="I agree to the terms" />
17
+ * ```
18
+ */
8
19
  export declare function Checkbox(props: CheckboxProps): JSX.Element;
9
20
  export {};
@@ -1,10 +1,26 @@
1
1
  import { JSX } from 'solid-js';
2
2
  interface ComboboxProps {
3
+ /** Full list of selectable string options (filtered as the user types). */
3
4
  options: string[];
4
5
  value: string;
6
+ /** Called with the newly selected option, or `''` if the selection is cleared. */
5
7
  onChange: (value: string) => void;
6
8
  placeholder?: string;
7
9
  class?: string;
8
10
  }
11
+ /**
12
+ * Searchable single-select dropdown for plain string options, built on
13
+ * Kobalte's `Combobox` primitive with a filterable text input and trigger.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <Combobox
18
+ * options={['Draft', 'Active', 'Archived']}
19
+ * value={status()}
20
+ * onChange={setStatus}
21
+ * placeholder="Select a status"
22
+ * />
23
+ * ```
24
+ */
9
25
  export declare function Combobox(props: ComboboxProps): JSX.Element;
10
26
  export {};
@@ -1,7 +1,10 @@
1
1
  import { JSX, ParentProps } from 'solid-js';
2
+ /** A single actionable row rendered by {@link ContextMenu}. */
2
3
  export interface ContextMenuItem {
3
4
  label: string;
5
+ /** Called when the item is chosen (click or keyboard activation). */
4
6
  onSelect: () => void;
7
+ /** Styles the label as a destructive action (e.g. "Delete"). */
5
8
  destructive?: boolean;
6
9
  disabled?: boolean;
7
10
  }
@@ -9,5 +12,16 @@ interface ContextMenuProps extends ParentProps {
9
12
  items: ContextMenuItem[];
10
13
  class?: string;
11
14
  }
15
+ /**
16
+ * Right-click (or long-press) menu built on Kobalte's `ContextMenu`
17
+ * primitive. `children` is the element that acts as the trigger/target area.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <ContextMenu items={[{ label: 'Rename', onSelect: rename }, { label: 'Delete', onSelect: remove, destructive: true }]}>
22
+ * <div class="rounded border p-4">Right-click me</div>
23
+ * </ContextMenu>
24
+ * ```
25
+ */
12
26
  export declare function ContextMenu(props: ContextMenuProps): JSX.Element;
13
27
  export {};
@@ -1,10 +1,28 @@
1
1
  import { JSX } from 'solid-js';
2
2
  interface DateFieldProps {
3
+ /** Selected date as `YYYY-MM-DD` (local, no timezone shift), or `''` for none. */
3
4
  value: string;
5
+ /** Called with the newly picked date as `YYYY-MM-DD`. */
4
6
  onChange: (value: string) => void;
7
+ /** Placeholder shown on the trigger when `value` is empty. */
5
8
  label?: string;
6
9
  disabled?: boolean;
7
10
  class?: string;
11
+ /** Full month names, January … December order (12 entries). */
12
+ months?: string[];
13
+ /** Weekday headers, Monday-first (7 entries). */
14
+ weekdays?: string[];
8
15
  }
16
+ /**
17
+ * Compact hand-rolled month-grid date picker (no Kobalte primitive covers this yet).
18
+ * Trigger button opens a portaled popover calendar; closes on outside click, Escape,
19
+ * scroll, or resize. Speaks plain `YYYY-MM-DD` strings, never `Date`/`toISOString`.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * const [date, setDate] = createSignal('2026-07-14')
24
+ * <DateField value={date()} onChange={setDate} label="Due date" />
25
+ * ```
26
+ */
9
27
  export declare function DateField(props: DateFieldProps): JSX.Element;
10
28
  export {};