@a4ui/core 0.4.2 → 0.5.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.
@@ -0,0 +1,23 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface RingProgressProps {
3
+ value: number;
4
+ /** Outer diameter of the ring in px. @default 96 */
5
+ size?: number;
6
+ /** Stroke width of the track and arc in px. @default 8 */
7
+ thickness?: number;
8
+ /** Content centered over the ring. Defaults to the rounded percent. */
9
+ label?: JSX.Element;
10
+ class?: string;
11
+ }
12
+ /**
13
+ * Circular progress indicator drawn with two concentric SVG circles: a muted
14
+ * track and a primary arc whose length is derived from `value` (0–100). Use for
15
+ * compact, radial completion feedback where a linear bar would be too wide.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <RingProgress value={72} />
20
+ * <RingProgress value={40} size={128} thickness={12} label={<span>4/10</span>} />
21
+ * ```
22
+ */
23
+ export declare function RingProgress(props: RingProgressProps): JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { JSX } from 'solid-js';
2
+ /** A single action in a {@link SpeedDial} — an icon button with an accessible label. */
3
+ export interface SpeedDialAction {
4
+ icon: JSX.Element;
5
+ label: string;
6
+ onClick: () => void;
7
+ }
8
+ export interface SpeedDialProps {
9
+ actions: SpeedDialAction[];
10
+ /** Icon for the main FAB. Defaults to a `Plus` that rotates to an ✕ when open. */
11
+ icon?: JSX.Element;
12
+ class?: string;
13
+ }
14
+ /**
15
+ * A fixed floating action button (FAB) pinned to the bottom-right. Clicking the
16
+ * main circular button toggles an open state; while open, `actions` fan out
17
+ * upward as a vertical stack of smaller circular buttons. Selecting an action
18
+ * runs its `onClick` and closes the dial. Theme-agnostic — colors come from
19
+ * semantic tokens only.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <SpeedDial actions={[
24
+ * { icon: <Share class="h-5 w-5" />, label: 'Share', onClick: () => share() },
25
+ * { icon: <Copy class="h-5 w-5" />, label: 'Copy', onClick: () => copy() },
26
+ * ]} />
27
+ * ```
28
+ */
29
+ export declare function SpeedDial(props: SpeedDialProps): JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface SplitterProps {
3
+ /** Content of the first pane (left when horizontal, top when vertical). */
4
+ start: JSX.Element;
5
+ /** Content of the second pane (right when horizontal, bottom when vertical). */
6
+ end: JSX.Element;
7
+ /** Layout axis. `'horizontal'` (default) splits side-by-side with a vertical divider; `'vertical'` stacks the panes with a horizontal divider. */
8
+ orientation?: 'horizontal' | 'vertical';
9
+ /** Initial size of the first pane, as a percentage of the container. Defaults to `50`. */
10
+ initial?: number;
11
+ /** Minimum size of the first pane, as a percentage. Defaults to `15`. */
12
+ min?: number;
13
+ /** Maximum size of the first pane, as a percentage. Defaults to `85`. */
14
+ max?: number;
15
+ class?: string;
16
+ }
17
+ /**
18
+ * Two panes separated by a draggable divider that resizes them. Drag the
19
+ * divider with a pointer or focus it and use the Arrow keys to nudge the split.
20
+ * The first pane's size is tracked as a percentage and clamped to `[min, max]`.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <Splitter
25
+ * orientation="horizontal"
26
+ * initial={40}
27
+ * start={<div class="p-4">Sidebar</div>}
28
+ * end={<div class="p-4">Main content</div>}
29
+ * />
30
+ * ```
31
+ */
32
+ export declare function Splitter(props: SplitterProps): JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { JSX } from 'solid-js';
2
+ /** A single step rendered by {@link Stepper}. */
3
+ export interface StepItem {
4
+ /** Text shown beside the step indicator. */
5
+ label: string;
6
+ /** Optional secondary line shown under the label. */
7
+ description?: string;
8
+ }
9
+ export interface StepperProps {
10
+ /** Ordered list of steps to display. */
11
+ steps: StepItem[];
12
+ /** Index of the currently active step; steps before it are completed. */
13
+ active: number;
14
+ /** When provided, indicators become clickable buttons reporting their index. */
15
+ onStepClick?: (index: number) => void;
16
+ /** Layout direction. Defaults to `'horizontal'`. */
17
+ orientation?: 'horizontal' | 'vertical';
18
+ class?: string;
19
+ }
20
+ /**
21
+ * Multi-step progress indicator. Steps before `active` render as completed
22
+ * (with a check), the `active` step is highlighted with a ring, and later
23
+ * steps are dimmed. Pass `onStepClick` to let users jump between steps.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <Stepper
28
+ * active={1}
29
+ * steps={[
30
+ * { label: 'Account', description: 'Your details' },
31
+ * { label: 'Shipping' },
32
+ * { label: 'Payment' },
33
+ * ]}
34
+ * onStepClick={setActive}
35
+ * />
36
+ * ```
37
+ */
38
+ export declare function Stepper(props: StepperProps): JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface TagInputProps {
3
+ /** Current tags (controlled). */
4
+ value: string[];
5
+ /** Called with the next tag array whenever tags are added or removed. */
6
+ onChange: (tags: string[]) => void;
7
+ placeholder?: string;
8
+ class?: string;
9
+ }
10
+ /**
11
+ * Bordered field that turns free text into removable chips. Press Enter or comma
12
+ * to add the trimmed input as a tag (empty and duplicate values are ignored),
13
+ * click a chip's `×` to remove it, or press Backspace on an empty input to drop
14
+ * the last tag. Theme-agnostic — colors come from semantic tokens.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const [tags, setTags] = createSignal<string[]>(['solid', 'ui'])
19
+ * <TagInput value={tags()} onChange={setTags} placeholder="Add tag…" />
20
+ * ```
21
+ */
22
+ export declare function TagInput(props: TagInputProps): JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { JSX } from 'solid-js';
2
+ /** Accent applied to a {@link TimelineItem}'s dot on the line. */
3
+ export type TimelineTone = 'default' | 'primary' | 'success' | 'danger';
4
+ /** A single event rendered by {@link Timeline}. */
5
+ export interface TimelineItem {
6
+ /** Headline for the event (rendered emphasized). */
7
+ title: string;
8
+ /** Optional supporting copy shown under the title. */
9
+ description?: string;
10
+ /** Optional timestamp / relative time label. */
11
+ time?: string;
12
+ /** Accent for the dot on the line. Defaults to `'default'`. */
13
+ tone?: TimelineTone;
14
+ }
15
+ export interface TimelineProps {
16
+ items: TimelineItem[];
17
+ class?: string;
18
+ }
19
+ /**
20
+ * Vertical timeline of events. A continuous line runs down the left with a
21
+ * tone-colored dot marking each entry; to the right sit the title, an optional
22
+ * right-aligned time, and an optional description. The line segment stops at the
23
+ * last item's dot. Renders as a semantic `<ol>`/`<li>` list.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <Timeline
28
+ * items={[
29
+ * { title: 'Order placed', time: '09:24', tone: 'primary' },
30
+ * { title: 'Shipped', description: 'Left the warehouse.', time: '11:02', tone: 'success' },
31
+ * { title: 'Delayed', description: 'Weather hold.', time: '14:30', tone: 'danger' },
32
+ * ]}
33
+ * />
34
+ * ```
35
+ */
36
+ export declare function Timeline(props: TimelineProps): JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { JSX } from 'solid-js';
2
+ /** A single option shown in either pane of a {@link Transfer}. */
3
+ export interface TransferItem {
4
+ value: string;
5
+ label: string;
6
+ }
7
+ export interface TransferProps {
8
+ /** Full pool of options; membership in `selected` decides which pane each lands in. */
9
+ items: TransferItem[];
10
+ /** Values currently in the right ("selected") pane. */
11
+ selected: string[];
12
+ /** Called with the next selected-value array whenever items are moved across. */
13
+ onChange: (selected: string[]) => void;
14
+ /** Pane headers, `[availableTitle, selectedTitle]`. Defaults to `['Available', 'Selected']`. */
15
+ titles?: [string, string];
16
+ class?: string;
17
+ }
18
+ /**
19
+ * Dual-list picker: two side-by-side panes let the user shuttle items between
20
+ * an "available" pool and a "selected" set. Tick rows in either pane, then use
21
+ * the middle chevrons to move the ticked items across; `onChange` receives the
22
+ * updated array of selected values.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * const [picked, setPicked] = createSignal<string[]>(['a'])
27
+ * <Transfer
28
+ * items={[{ value: 'a', label: 'Apple' }, { value: 'b', label: 'Banana' }]}
29
+ * selected={picked()}
30
+ * onChange={setPicked}
31
+ * titles={['Fruits', 'Basket']}
32
+ * />
33
+ * ```
34
+ */
35
+ export declare function Transfer(props: TransferProps): JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { JSX } from 'solid-js';
2
+ /** A single node in a {@link Tree}; nodes may nest via `children`. */
3
+ export interface TreeNode {
4
+ /** Unique identifier; used to track expanded state. */
5
+ id: string;
6
+ /** Text shown in the node's row. */
7
+ label: string;
8
+ /** Optional icon rendered before the label. */
9
+ icon?: JSX.Element;
10
+ /** Child nodes revealed when this node is expanded. */
11
+ children?: TreeNode[];
12
+ }
13
+ export interface TreeProps {
14
+ nodes: TreeNode[];
15
+ /** Ids of nodes expanded on first render. */
16
+ defaultExpanded?: string[];
17
+ class?: string;
18
+ }
19
+ /**
20
+ * Accessible, indented tree view. Nodes with children render a chevron that
21
+ * rotates when expanded; clicking a row toggles its subtree. Expanded state is
22
+ * tracked internally, seeded from `defaultExpanded`.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * <Tree
27
+ * defaultExpanded={['src']}
28
+ * nodes={[
29
+ * {
30
+ * id: 'src',
31
+ * label: 'src',
32
+ * children: [
33
+ * { id: 'index', label: 'index.ts' },
34
+ * { id: 'ui', label: 'ui', children: [{ id: 'tree', label: 'Tree.tsx' }] },
35
+ * ],
36
+ * },
37
+ * ]}
38
+ * />
39
+ * ```
40
+ */
41
+ export declare function Tree(props: TreeProps): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a4ui/core",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "A4ui — Spatial Glass design system & component library for SolidJS (Kobalte behavior + Tailwind glass tokens + motion).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -60,7 +60,17 @@
60
60
  "test:ui": "playwright test --ui",
61
61
  "test:a11y": "playwright test a11y --project=desktop",
62
62
  "test:report": "playwright show-report",
63
- "prepublishOnly": "npm run build"
63
+ "prepublishOnly": "npm run build",
64
+ "prepare": "husky"
65
+ },
66
+ "lint-staged": {
67
+ "*.{ts,tsx}": [
68
+ "eslint --fix",
69
+ "prettier --write"
70
+ ],
71
+ "*.{js,mjs,cjs,json,css,md,yml,html}": [
72
+ "prettier --write"
73
+ ]
64
74
  },
65
75
  "peerDependencies": {
66
76
  "solid-js": "^1.9.13"
@@ -84,7 +94,9 @@
84
94
  "eslint": "^9.39.5",
85
95
  "eslint-config-prettier": "^10.1.8",
86
96
  "eslint-plugin-solid": "^0.14.5",
97
+ "husky": "^9.1.7",
87
98
  "jsdom": "^29.1.1",
99
+ "lint-staged": "^16.4.0",
88
100
  "playwright-core": "^1.61.1",
89
101
  "prettier": "^3.9.5",
90
102
  "tailwindcss": "^3.4.19",