@a4ui/core 0.7.0 → 0.8.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.
@@ -7,10 +7,10 @@ export interface CalendarProps {
7
7
  class?: string;
8
8
  }
9
9
  /**
10
- * Full-month calendar: a header with the month/year and prev/next navigation, a
11
- * row of weekday labels, and a 6×7 grid of day buttons. Days outside the shown
12
- * month are muted; the selected day is filled and "today" gets a ring. Clicking a
13
- * day calls `onChange`. Theme-agnostic (semantic tokens only), always visible.
10
+ * Full-month calendar: a header with month/year navigation and a 6×7 grid of
11
+ * day buttons. Click the month or year in the header to jump straight to a month
12
+ * or year picker; the double chevrons step a whole year at a time. The selected
13
+ * day is filled and "today" gets a ring. Theme-agnostic, always visible.
14
14
  *
15
15
  * @example
16
16
  * ```tsx
@@ -0,0 +1,28 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface ClockProps {
3
+ /** 'digital' (default) or 'analog'. */
4
+ variant?: 'digital' | 'analog';
5
+ /** Show the seconds hand / seconds digits. @default true */
6
+ seconds?: boolean;
7
+ /** 12-hour clock with AM/PM instead of 24-hour. @default false */
8
+ hour12?: boolean;
9
+ /** IANA time zone (e.g. 'America/Hermosillo'); defaults to the local zone. */
10
+ timeZone?: string;
11
+ /** Diameter in px for the analog face. @default 160 */
12
+ size?: number;
13
+ class?: string;
14
+ }
15
+ /**
16
+ * Live, self-updating clock. Ticks once per second from a single interval
17
+ * (started in `onMount`, cleared in `onCleanup`) and renders either a digital
18
+ * `HH:MM:SS` readout or an analog SVG dial. Pass `timeZone` to show a specific
19
+ * IANA zone instead of the viewer's local time.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <Clock />
24
+ * <Clock variant="analog" size={200} timeZone="America/Hermosillo" />
25
+ * <Clock hour12 seconds={false} />
26
+ * ```
27
+ */
28
+ export declare function Clock(props: ClockProps): JSX.Element;
@@ -9,7 +9,8 @@ export interface CountdownProps {
9
9
  /**
10
10
  * Live countdown to `props.to`, shown as four cells (Days / Hours / Mins /
11
11
  * Secs). Updates every second and calls `props.onComplete` once when it hits
12
- * zero. Hours, minutes, and seconds are zero-padded to two digits.
12
+ * zero. Each digit rolls like an old flip clock as it changes. Hours, minutes,
13
+ * and seconds are zero-padded to two digits.
13
14
  *
14
15
  * @example
15
16
  * ```tsx
@@ -0,0 +1,28 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface DateTimeFieldProps {
3
+ /** Selected moment as `YYYY-MM-DD HH:MM` (local), or `''` for none. */
4
+ value: string;
5
+ /** Called with the combined `YYYY-MM-DD HH:MM` (either part may be missing). */
6
+ onChange: (value: string) => void;
7
+ /** 12-hour time display with AM/PM. @default false */
8
+ hour12?: boolean;
9
+ /** Minute increment for the time options. @default 5 */
10
+ minuteStep?: number;
11
+ /** Placeholder for the date half. */
12
+ dateLabel?: string;
13
+ /** Placeholder for the time half. */
14
+ timeLabel?: string;
15
+ disabled?: boolean;
16
+ class?: string;
17
+ }
18
+ /**
19
+ * Date + time picker built from {@link DateField} and {@link TimeField}. Speaks a
20
+ * single `YYYY-MM-DD HH:MM` string; the two halves fill in independently.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * const [when, setWhen] = createSignal('2026-07-15 09:30')
25
+ * <DateTimeField value={when()} onChange={setWhen} hour12 />
26
+ * ```
27
+ */
28
+ export declare function DateTimeField(props: DateTimeFieldProps): JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface SortableProps<T> {
3
+ /** The items to render, in current order. */
4
+ items: T[];
5
+ /** Stable unique key for an item (used for drag tracking + list keying). */
6
+ itemKey: (item: T) => string;
7
+ /** Render an item's content (the grip handle is added automatically to its left). */
8
+ children: (item: T) => JSX.Element;
9
+ /** Called with the new order after a drop. */
10
+ onReorder: (items: T[]) => void;
11
+ /** Disable dragging. */
12
+ disabled?: boolean;
13
+ class?: string;
14
+ }
15
+ /**
16
+ * Vertical list whose rows reorder by dragging a grip handle. Pointer-events
17
+ * driven (works with mouse and touch): the grabbed row leaves behind a dashed
18
+ * placeholder while a floating clone follows the pointer, and other rows shift
19
+ * live as the pointer crosses their midpoint. `onReorder` fires once on drop
20
+ * with the final order.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <Sortable
25
+ * items={fields()}
26
+ * itemKey={(f) => f.id}
27
+ * onReorder={setFields}
28
+ * >
29
+ * {(field) => <span>{field.label}</span>}
30
+ * </Sortable>
31
+ * ```
32
+ */
33
+ export declare function Sortable<T>(props: SortableProps<T>): JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface TimeFieldProps {
3
+ /** Selected time as canonical 24h "HH:MM" (e.g. "15:05"), or "" for none. */
4
+ value: string;
5
+ /** Called with the newly picked time as "HH:MM" (24h). */
6
+ onChange: (value: string) => void;
7
+ /** 12-hour display with AM/PM instead of 24-hour. @default false */
8
+ hour12?: boolean;
9
+ /** Minute increment for the options list. @default 5 */
10
+ minuteStep?: number;
11
+ /** Placeholder shown on the trigger when value is empty. */
12
+ label?: string;
13
+ disabled?: boolean;
14
+ class?: string;
15
+ }
16
+ /**
17
+ * Compact hand-rolled hour/minute (/ AM-PM) column picker (no Kobalte primitive
18
+ * covers this yet). Trigger button opens a portaled popover; closes on outside
19
+ * click, Escape, scroll, or resize. Speaks plain 24h `HH:MM` strings.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * const [time, setTime] = createSignal('15:05')
24
+ * <TimeField value={time()} onChange={setTime} label="Start time" hour12 />
25
+ * ```
26
+ */
27
+ export declare function TimeField(props: TimeFieldProps): JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface CalendarCoreProps {
3
+ /** Currently selected day (for highlight); undefined = none. */
4
+ selected?: Date;
5
+ /** Called with the newly picked day. */
6
+ onPick: (date: Date) => void;
7
+ /** 0 = Sunday-first, 1 = Monday-first. @default 0 */
8
+ weekStart?: 0 | 1;
9
+ /** Full month names, January…December order (12). */
10
+ months?: string[];
11
+ /** Weekday headers in DISPLAY order, matching `weekStart` (7). */
12
+ weekdays?: string[];
13
+ /** Month first shown (its year/month seed the view). @default today */
14
+ initialView?: Date;
15
+ class?: string;
16
+ }
17
+ /**
18
+ * The interactive calendar body: a header (year/month jumps + drill-down) and a
19
+ * grid that switches between day, month, and year views. Stateless about
20
+ * open/closed — the caller decides where it lives.
21
+ */
22
+ export declare function CalendarCore(props: CalendarCoreProps): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a4ui/core",
3
- "version": "0.7.0",
3
+ "version": "0.8.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",
@@ -37,16 +37,30 @@
37
37
  "exports": {
38
38
  ".": {
39
39
  "types": "./dist/index.d.ts",
40
- "import": "./dist/index.js"
40
+ "import": "./dist/index.js",
41
+ "default": "./dist/index.js"
41
42
  },
42
- "./preset": "./preset.js",
43
- "./styles.css": "./dist/styles.css"
43
+ "./preset": {
44
+ "import": "./preset.js",
45
+ "default": "./preset.js"
46
+ },
47
+ "./styles.css": "./dist/styles.css",
48
+ "./elements": {
49
+ "import": "./dist/elements.js",
50
+ "default": "./dist/elements.js"
51
+ },
52
+ "./elements.css": "./dist/elements.css",
53
+ "./package.json": "./package.json"
54
+ },
55
+ "engines": {
56
+ "node": ">=20"
44
57
  },
45
58
  "publishConfig": {
46
59
  "access": "public"
47
60
  },
48
61
  "scripts": {
49
- "build": "vite build",
62
+ "build": "vite build && npm run build:elements",
63
+ "build:elements": "vite build --config vite.elements.config.ts && node scripts/build-elements-css.mjs",
50
64
  "dev": "vite build --watch",
51
65
  "preview": "node scripts/gen-llms.mjs && vite --config vite.preview.config.ts",
52
66
  "preview:build": "node scripts/gen-llms.mjs && vite build --config vite.preview.config.ts",
@@ -60,7 +74,9 @@
60
74
  "test:ui": "playwright test --ui",
61
75
  "test:a11y": "playwright test a11y --project=desktop",
62
76
  "test:report": "playwright show-report",
63
- "prepublishOnly": "npm run build",
77
+ "test:package": "node scripts/test-package.mjs",
78
+ "validate": "npm run typecheck && npm run lint && npm run test:unit && npm run build",
79
+ "prepublishOnly": "npm run validate",
64
80
  "prepare": "husky"
65
81
  },
66
82
  "lint-staged": {
@@ -99,6 +115,7 @@
99
115
  "lint-staged": "^16.4.0",
100
116
  "playwright-core": "^1.61.1",
101
117
  "prettier": "^3.9.5",
118
+ "solid-element": "^1.9.2",
102
119
  "tailwindcss": "^3.4.19",
103
120
  "typescript": "^5.6.0",
104
121
  "typescript-eslint": "^8.64.0",
package/preset.js CHANGED
@@ -14,7 +14,9 @@
14
14
  // content: ['./src/**/*.{ts,tsx}', './node_modules/@a4ui/core/dist/**/*.js'],
15
15
  // }
16
16
 
17
- import plugin from 'tailwindcss/plugin'
17
+ // Explicit .js extension so the preset resolves under strict Node ESM (used by
18
+ // our elements-css build), not just bundlers.
19
+ import plugin from 'tailwindcss/plugin.js'
18
20
 
19
21
  // Frosted "space glass" surfaces. addComponents so they tree-shake like any
20
22
  // utility (emitted only when the class is found in scanned content — a4ui's own