@a4ui/core 0.2.0 → 0.3.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.
- package/README.md +61 -7
- package/dist/index.js +2 -1
- package/dist/layout/AppShell.d.ts +19 -1
- package/dist/layout/EffectsToggle.d.ts +14 -0
- package/dist/layout/NavGroup.d.ts +15 -0
- package/dist/layout/SpaceBackground.d.ts +13 -0
- package/dist/layout/ThemeToggle.d.ts +12 -0
- package/dist/lib/cn.d.ts +11 -1
- package/dist/lib/effects.d.ts +21 -0
- package/dist/lib/media.d.ts +12 -0
- package/dist/lib/motion.d.ts +37 -0
- package/dist/lib/theme.d.ts +52 -3
- package/dist/lib/virtual.d.ts +16 -0
- package/dist/styles.css +344 -95
- package/dist/ui/Accordion.d.ts +19 -0
- package/dist/ui/Alert.d.ts +14 -0
- package/dist/ui/AlertDialog.d.ts +15 -0
- package/dist/ui/Avatar.d.ts +11 -0
- package/dist/ui/Badge.d.ts +12 -0
- package/dist/ui/Breadcrumb.d.ts +17 -0
- package/dist/ui/Button.d.ts +11 -0
- package/dist/ui/Card.d.ts +18 -0
- package/dist/ui/Checkbox.d.ts +11 -0
- package/dist/ui/Combobox.d.ts +16 -0
- package/dist/ui/ContextMenu.d.ts +14 -0
- package/dist/ui/DateField.d.ts +14 -0
- package/dist/ui/Drawer.d.ts +16 -0
- package/dist/ui/Dropdown.d.ts +18 -1
- package/dist/ui/Dropzone.d.ts +11 -0
- package/dist/ui/HoverCard.d.ts +13 -0
- package/dist/ui/Input.d.ts +12 -0
- package/dist/ui/Meter.d.ts +12 -0
- package/dist/ui/Modal.d.ts +21 -0
- package/dist/ui/NumberInput.d.ts +12 -0
- package/dist/ui/PageHeader.d.ts +17 -0
- package/dist/ui/Pagination.d.ts +14 -0
- package/dist/ui/Popover.d.ts +13 -0
- package/dist/ui/Progress.d.ts +11 -0
- package/dist/ui/RadioGroup.d.ts +20 -0
- package/dist/ui/SegmentedControl.d.ts +19 -0
- package/dist/ui/Select.d.ts +14 -0
- package/dist/ui/Separator.d.ts +11 -0
- package/dist/ui/Skeleton.d.ts +11 -0
- package/dist/ui/Slider.d.ts +14 -0
- package/dist/ui/Spinner.d.ts +10 -0
- package/dist/ui/Stat.d.ts +12 -0
- package/dist/ui/Switch.d.ts +11 -0
- package/dist/ui/Table.d.ts +61 -0
- package/dist/ui/Tabs.d.ts +20 -0
- package/dist/ui/Textarea.d.ts +12 -0
- package/dist/ui/Toast.d.ts +12 -0
- package/dist/ui/Toggle.d.ts +12 -0
- package/dist/ui/ToggleGroup.d.ts +20 -0
- package/dist/ui/Tooltip.d.ts +13 -0
- package/dist/ui/VirtualList.d.ts +14 -0
- package/package.json +18 -5
package/dist/ui/Spinner.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
2
|
interface SpinnerProps {
|
|
3
3
|
class?: string;
|
|
4
|
+
/** Accessible label announced to screen readers via `aria-label`. Default: `'Loading'`. */
|
|
4
5
|
label?: string;
|
|
5
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Small spinning loading indicator (inline SVG, no primitive). Use for
|
|
9
|
+
* indeterminate loading states such as button/inline busy states.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Spinner label="Saving" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
6
16
|
export declare function Spinner(props: SpinnerProps): JSX.Element;
|
|
7
17
|
export {};
|
package/dist/ui/Stat.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
|
+
/** Color scheme applied to a {@link Stat}'s icon badge. */
|
|
2
3
|
export type StatTone = 'primary' | 'success' | 'danger' | 'neutral';
|
|
3
4
|
interface StatProps {
|
|
4
5
|
label: string;
|
|
@@ -12,5 +13,16 @@ interface StatProps {
|
|
|
12
13
|
delay?: number;
|
|
13
14
|
class?: string;
|
|
14
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* KPI / stat card showing a label, an animated count-up numeric value, and
|
|
18
|
+
* an optional tone-colored icon badge. Combines a `solid-motionone` fade-up
|
|
19
|
+
* entrance (use `delay` to stagger a row of stats) with the `createCountUp`
|
|
20
|
+
* tween — both automatically disabled under `prefers-reduced-motion`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <Stat label="Active users" value={activeUsers()} tone="success" icon={<UsersIcon />} />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
15
27
|
export declare function Stat(props: StatProps): JSX.Element;
|
|
16
28
|
export {};
|
package/dist/ui/Switch.d.ts
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
2
|
interface SwitchProps {
|
|
3
|
+
/** Whether the switch is on. Controlled — pair with `onChange`. */
|
|
3
4
|
checked: boolean;
|
|
4
5
|
onChange: (checked: boolean) => void;
|
|
6
|
+
/** Optional visible label rendered next to the control. */
|
|
5
7
|
label?: string;
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
class?: string;
|
|
8
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Accessible on/off switch, built on Kobalte's Switch primitive.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const [enabled, setEnabled] = createSignal(false)
|
|
17
|
+
* <Switch checked={enabled()} onChange={setEnabled} label="Enable notifications" />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
9
20
|
export declare function Switch(props: SwitchProps): JSX.Element;
|
|
10
21
|
export {};
|
package/dist/ui/Table.d.ts
CHANGED
|
@@ -2,10 +2,71 @@ import { JSX, ParentProps } from 'solid-js';
|
|
|
2
2
|
interface TableProps extends ParentProps {
|
|
3
3
|
class?: string;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Table root — a plain `<table>` wrapped in a horizontal-scroll container.
|
|
7
|
+
* Compose with {@link TableHead}, {@link TableBody}, {@link TableRow},
|
|
8
|
+
* {@link TableHeadCell}, and {@link TableCell}.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Table>
|
|
13
|
+
* <TableHead>
|
|
14
|
+
* <TableRow>
|
|
15
|
+
* <TableHeadCell>Name</TableHeadCell>
|
|
16
|
+
* </TableRow>
|
|
17
|
+
* </TableHead>
|
|
18
|
+
* <TableBody>
|
|
19
|
+
* <TableRow>
|
|
20
|
+
* <TableCell>Alfredo</TableCell>
|
|
21
|
+
* </TableRow>
|
|
22
|
+
* </TableBody>
|
|
23
|
+
* </Table>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
5
26
|
export declare function Table(props: TableProps): JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* `<thead>` wrapper with the muted, bottom-bordered header styling.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <TableHead><TableRow><TableHeadCell>Name</TableHeadCell></TableRow></TableHead>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
6
35
|
export declare function TableHead(props: TableProps): JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* `<tbody>` wrapper — no default styling beyond passing through `class`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <TableBody><TableRow><TableCell>Alfredo</TableCell></TableRow></TableBody>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
7
44
|
export declare function TableBody(props: TableProps): JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* `<tr>` wrapper — adds the row bottom-border and hover highlight.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <TableRow><TableCell>Alfredo</TableCell></TableRow>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
8
53
|
export declare function TableRow(props: TableProps): JSX.Element;
|
|
54
|
+
/**
|
|
55
|
+
* `<th>` wrapper — small uppercase heading style, use inside {@link TableHead}.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* <TableHeadCell>Name</TableHeadCell>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
9
62
|
export declare function TableHeadCell(props: TableProps): JSX.Element;
|
|
63
|
+
/**
|
|
64
|
+
* `<td>` wrapper — standard cell padding and vertical alignment.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <TableCell>Alfredo</TableCell>
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
10
71
|
export declare function TableCell(props: TableProps): JSX.Element;
|
|
11
72
|
export {};
|
package/dist/ui/Tabs.d.ts
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
|
+
/** One tab: its unique `value`, trigger `label`, and panel `content`. */
|
|
2
3
|
export interface TabItem {
|
|
3
4
|
value: string;
|
|
4
5
|
label: string;
|
|
5
6
|
content: JSX.Element;
|
|
6
7
|
}
|
|
7
8
|
interface TabsProps {
|
|
9
|
+
/** Tabs to render, in order — each contributes a trigger and a panel. */
|
|
8
10
|
items: TabItem[];
|
|
11
|
+
/** Currently selected tab's `value`. Controlled — pair with `onChange`. */
|
|
9
12
|
value: string;
|
|
10
13
|
onChange: (value: string) => void;
|
|
11
14
|
class?: string;
|
|
12
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Accessible tabs, built on Kobalte's Tabs primitive, with a sliding selection
|
|
18
|
+
* indicator.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const [tab, setTab] = createSignal('profile')
|
|
23
|
+
* <Tabs
|
|
24
|
+
* value={tab()}
|
|
25
|
+
* onChange={setTab}
|
|
26
|
+
* items={[
|
|
27
|
+
* { value: 'profile', label: 'Profile', content: <ProfilePanel /> },
|
|
28
|
+
* { value: 'billing', label: 'Billing', content: <BillingPanel /> },
|
|
29
|
+
* ]}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
13
33
|
export declare function Tabs(props: TabsProps): JSX.Element;
|
|
14
34
|
export {};
|
package/dist/ui/Textarea.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
2
|
interface TextareaProps extends Omit<JSX.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'onInput'> {
|
|
3
3
|
value: string;
|
|
4
|
+
/** Called with the new string value on every input event (not the raw DOM event). */
|
|
4
5
|
onInput: (value: string) => void;
|
|
5
6
|
class?: string;
|
|
6
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Controlled multi-line text field — a plain `<textarea>` styled to match
|
|
10
|
+
* {@link Input}. Any other native textarea attribute (e.g. `rows`, `placeholder`,
|
|
11
|
+
* `disabled`) is passed through.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const [bio, setBio] = createSignal('')
|
|
16
|
+
* <Textarea value={bio()} onInput={setBio} placeholder="Tell us about yourself" />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
7
19
|
export declare function Textarea(props: TextareaProps): JSX.Element;
|
|
8
20
|
export {};
|
package/dist/ui/Toast.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
|
+
/** Visual/semantic tone of a toast — controls its border/background accent color. */
|
|
2
3
|
export type ToastTone = 'success' | 'error' | 'info';
|
|
4
|
+
/**
|
|
5
|
+
* Imperative API to show a toast notification from anywhere in the app (event
|
|
6
|
+
* handlers, mutation `onError`/`onSuccess`, etc.) — no component context
|
|
7
|
+
* needed. Requires a mounted {@link Toaster} to render into.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* toast.success('Saved', 'Your changes were saved.')
|
|
12
|
+
* toast.error('Something went wrong')
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
3
15
|
export declare const toast: {
|
|
4
16
|
success: (title: string, description?: string) => void;
|
|
5
17
|
error: (title: string, description?: string) => void;
|
package/dist/ui/Toggle.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { JSX, ParentProps } from 'solid-js';
|
|
2
2
|
interface ToggleProps extends ParentProps {
|
|
3
|
+
/** Whether the toggle is pressed/"on". Controlled — pair with `onChange`. */
|
|
3
4
|
pressed: boolean;
|
|
4
5
|
onChange: (pressed: boolean) => void;
|
|
5
6
|
class?: string;
|
|
6
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Two-state toggle button (e.g. bold/italic, mute, favorite), built on
|
|
10
|
+
* Kobalte's ToggleButton primitive. `children` is the button's content
|
|
11
|
+
* (icon and/or text).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const [pressed, setPressed] = createSignal(false)
|
|
16
|
+
* <Toggle pressed={pressed()} onChange={setPressed}><StarIcon /></Toggle>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
7
19
|
export declare function Toggle(props: ToggleProps): JSX.Element;
|
|
8
20
|
export {};
|
package/dist/ui/ToggleGroup.d.ts
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
|
+
/** One option in a {@link ToggleGroup}: its `value` and visible `label`. */
|
|
2
3
|
export interface ToggleGroupOption {
|
|
3
4
|
value: string;
|
|
4
5
|
label: string;
|
|
5
6
|
}
|
|
6
7
|
interface ToggleGroupProps {
|
|
8
|
+
/** Currently selected option's `value`, or `null` if none is selected. Controlled — pair with `onChange`. */
|
|
7
9
|
value: string | null;
|
|
8
10
|
onChange: (value: string | null) => void;
|
|
11
|
+
/** Options to render, in order, as segmented buttons. */
|
|
9
12
|
options: ToggleGroupOption[];
|
|
10
13
|
class?: string;
|
|
11
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Single-select segmented button row, built on Kobalte's ToggleGroup
|
|
17
|
+
* primitive — for exclusive-choice controls like view mode or alignment.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const [align, setAlign] = createSignal<string | null>('left')
|
|
22
|
+
* <ToggleGroup
|
|
23
|
+
* value={align()}
|
|
24
|
+
* onChange={setAlign}
|
|
25
|
+
* options={[
|
|
26
|
+
* { value: 'left', label: 'Left' },
|
|
27
|
+
* { value: 'center', label: 'Center' },
|
|
28
|
+
* ]}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
12
32
|
export declare function ToggleGroup(props: ToggleGroupProps): JSX.Element;
|
|
13
33
|
export {};
|
package/dist/ui/Tooltip.d.ts
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { JSX, ParentProps } from 'solid-js';
|
|
2
2
|
interface TooltipProps extends ParentProps {
|
|
3
|
+
/** Content shown inside the tooltip popover. */
|
|
3
4
|
content: JSX.Element;
|
|
5
|
+
/** Applied to the tooltip popover (`KTooltip.Content`), not the trigger. */
|
|
4
6
|
class?: string;
|
|
5
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Hover/focus tooltip, built on Kobalte's Tooltip primitive. `children` is
|
|
10
|
+
* the trigger element; `content` is rendered in a portal on hover/focus.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Tooltip content="Delete this item">
|
|
15
|
+
* <IconButton icon={<TrashIcon />} aria-label="Delete" />
|
|
16
|
+
* </Tooltip>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
6
19
|
export declare function Tooltip(props: TooltipProps): JSX.Element;
|
|
7
20
|
export {};
|
package/dist/ui/VirtualList.d.ts
CHANGED
|
@@ -11,5 +11,19 @@ interface VirtualListProps<T> {
|
|
|
11
11
|
/** Row renderer. `index` is an accessor so it stays reactive as rows recycle. */
|
|
12
12
|
children: (item: T, index: Accessor<number>) => JSX.Element;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Virtualized list built on `@tanstack/solid-virtual` — renders only the
|
|
16
|
+
* visible rows (plus `overscan`) so lists of any length mount and scroll
|
|
17
|
+
* instantly. The scroll container's height MUST be constrained via `class`
|
|
18
|
+
* (e.g. `"h-[65vh]"`); virtualization requires a fixed viewport to measure
|
|
19
|
+
* against.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <VirtualList each={rows()} estimateSize={40} class="h-[65vh]">
|
|
24
|
+
* {(row, index) => <div>{index()}: {row.name}</div>}
|
|
25
|
+
* </VirtualList>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
14
28
|
export declare function VirtualList<T>(props: VirtualListProps<T>): JSX.Element;
|
|
15
29
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a4ui/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
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",
|
|
@@ -48,10 +48,14 @@
|
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "vite build",
|
|
50
50
|
"dev": "vite build --watch",
|
|
51
|
-
"preview": "vite --config vite.preview.config.ts",
|
|
52
|
-
"preview:build": "vite build --config vite.preview.config.ts",
|
|
51
|
+
"preview": "node scripts/gen-llms.mjs && vite --config vite.preview.config.ts",
|
|
52
|
+
"preview:build": "node scripts/gen-llms.mjs && vite build --config vite.preview.config.ts",
|
|
53
|
+
"gen:llms": "node scripts/gen-llms.mjs",
|
|
53
54
|
"typecheck": "tsc --noEmit",
|
|
54
|
-
"lint": "eslint
|
|
55
|
+
"lint": "eslint .",
|
|
56
|
+
"format": "prettier --write .",
|
|
57
|
+
"format:check": "prettier --check .",
|
|
58
|
+
"test:unit": "vitest run",
|
|
55
59
|
"test": "playwright test",
|
|
56
60
|
"test:ui": "playwright test --ui",
|
|
57
61
|
"test:report": "playwright show-report",
|
|
@@ -70,13 +74,22 @@
|
|
|
70
74
|
"tailwind-merge": "^3.6.0"
|
|
71
75
|
},
|
|
72
76
|
"devDependencies": {
|
|
77
|
+
"@eslint/js": "^9.39.5",
|
|
73
78
|
"@playwright/test": "^1.61.1",
|
|
79
|
+
"@solidjs/testing-library": "^0.8.10",
|
|
80
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
81
|
+
"eslint": "^9.39.5",
|
|
82
|
+
"eslint-config-prettier": "^10.1.8",
|
|
74
83
|
"eslint-plugin-solid": "^0.14.5",
|
|
84
|
+
"jsdom": "^29.1.1",
|
|
75
85
|
"playwright-core": "^1.61.1",
|
|
86
|
+
"prettier": "^3.9.5",
|
|
76
87
|
"tailwindcss": "^3.4.19",
|
|
77
88
|
"typescript": "^5.6.0",
|
|
89
|
+
"typescript-eslint": "^8.64.0",
|
|
78
90
|
"vite": "^6.0.0",
|
|
79
91
|
"vite-plugin-dts": "^4.3.0",
|
|
80
|
-
"vite-plugin-solid": "^2.11.12"
|
|
92
|
+
"vite-plugin-solid": "^2.11.12",
|
|
93
|
+
"vitest": "^4.1.10"
|
|
81
94
|
}
|
|
82
95
|
}
|