@a4ui/core 0.8.1 → 0.10.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,29 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface DateRange {
3
+ /** 'YYYY-MM-DD' (local) or '' if unset. */
4
+ start: string;
5
+ end: string;
6
+ }
7
+ export interface DateRangePickerProps {
8
+ value: DateRange;
9
+ onChange: (value: DateRange) => void;
10
+ /** Placeholder shown when nothing is selected. */
11
+ label?: string;
12
+ disabled?: boolean;
13
+ months?: string[];
14
+ weekdays?: string[];
15
+ class?: string;
16
+ }
17
+ /**
18
+ * Compact hand-rolled range picker built on the same popover mechanism as
19
+ * `DateField`, but tracking a start/end pair instead of a single day. The
20
+ * first click begins a range, the second completes it (closing the popover);
21
+ * clicking again once complete starts a fresh range.
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * const [range, setRange] = createSignal<DateRange>({ start: '2026-03-15', end: '' })
26
+ * <DateRangePicker value={range()} onChange={setRange} label="Stay dates" />
27
+ * ```
28
+ */
29
+ export declare function DateRangePicker(props: DateRangePickerProps): JSX.Element;
@@ -0,0 +1,54 @@
1
+ import { JSX } from 'solid-js';
2
+ /** A single file entry rendered by {@link FileUpload}. The consumer owns this state. */
3
+ export interface UploadFile {
4
+ id: string;
5
+ name: string;
6
+ /** File size in bytes. */
7
+ size: number;
8
+ /** Upload progress, 0-100. */
9
+ progress: number;
10
+ status: 'pending' | 'uploading' | 'done' | 'error';
11
+ /** Optional preview/thumbnail URL (e.g. an object URL for an image). */
12
+ url?: string;
13
+ /** Error message when `status === 'error'`. */
14
+ error?: string;
15
+ }
16
+ export interface FileUploadProps {
17
+ files: UploadFile[];
18
+ /** Called with the newly chosen File[] (from drop or the file dialog). */
19
+ onAdd: (files: File[]) => void;
20
+ onRemove?: (id: string) => void;
21
+ onRetry?: (id: string) => void;
22
+ /** `accept` attribute for the hidden input, e.g. ".png,.jpg,application/pdf". */
23
+ accept?: string;
24
+ /** Allow choosing/dropping more than one file at a time. Default: `true`. */
25
+ multiple?: boolean;
26
+ /** Helper text shown inside the drop zone. */
27
+ hint?: string;
28
+ disabled?: boolean;
29
+ class?: string;
30
+ }
31
+ /**
32
+ * Advanced, controlled file uploader: a click-or-drag drop zone plus a list of
33
+ * files showing per-file progress, error/retry, a preview thumbnail, and a
34
+ * remove action. This component owns no file state — the consumer supplies
35
+ * `files` and performs the actual upload, updating `files` as progress comes in.
36
+ *
37
+ * @example
38
+ * ```tsx
39
+ * const [files, setFiles] = createSignal<UploadFile[]>([])
40
+ *
41
+ * <FileUpload
42
+ * files={files()}
43
+ * accept="image/*"
44
+ * onAdd={(added) => {
45
+ * const entries = added.map((f) => ({ id: crypto.randomUUID(), name: f.name, size: f.size, progress: 0, status: 'pending' as const }))
46
+ * setFiles((prev) => [...prev, ...entries])
47
+ * entries.forEach((entry, i) => upload(added[i], entry.id, setFiles))
48
+ * }}
49
+ * onRemove={(id) => setFiles((prev) => prev.filter((f) => f.id !== id))}
50
+ * onRetry={(id) => retryUpload(id, setFiles)}
51
+ * />
52
+ * ```
53
+ */
54
+ export declare function FileUpload(props: FileUploadProps): JSX.Element;
@@ -0,0 +1,57 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface FormFieldProps {
3
+ /** Optional explicit id; otherwise auto-generated. */
4
+ id?: string;
5
+ children: JSX.Element;
6
+ class?: string;
7
+ }
8
+ /**
9
+ * Container/provider that gives `FormLabel`, `FormControl`,
10
+ * `FormDescription`, and `FormError` a shared field id so they wire up
11
+ * `for`/`id`/`aria-describedby` automatically.
12
+ *
13
+ * Pairs well with a schema validator (Valibot/Zod): the consumer computes
14
+ * the error string and passes it to `FormError`.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <FormField>
19
+ * <FormLabel>Email</FormLabel>
20
+ * <FormControl>
21
+ * {(fieldProps) => <input type="email" {...fieldProps} />}
22
+ * </FormControl>
23
+ * <FormDescription>We'll never share your email.</FormDescription>
24
+ * <FormError>{errors().email}</FormError>
25
+ * </FormField>
26
+ * ```
27
+ */
28
+ export declare function FormField(props: FormFieldProps): JSX.Element;
29
+ /** Label associated with the enclosing `FormField`'s control via `for`. */
30
+ export declare function FormLabel(props: {
31
+ children: JSX.Element;
32
+ class?: string;
33
+ }): JSX.Element;
34
+ /**
35
+ * Render-prop bridge that hands the enclosing `FormField`'s `id` and
36
+ * `aria-describedby` to the caller's control, to be spread onto the actual
37
+ * input/select/textarea element.
38
+ */
39
+ export declare function FormControl(props: {
40
+ children: (fieldProps: {
41
+ id: string;
42
+ 'aria-describedby': string;
43
+ }) => JSX.Element;
44
+ }): JSX.Element;
45
+ /** Helper text for the enclosing `FormField`, linked via `aria-describedby`. */
46
+ export declare function FormDescription(props: {
47
+ children: JSX.Element;
48
+ class?: string;
49
+ }): JSX.Element;
50
+ /**
51
+ * Error text for the enclosing `FormField`, linked via `aria-describedby`.
52
+ * Renders nothing when there is no error to show.
53
+ */
54
+ export declare function FormError(props: {
55
+ children?: JSX.Element;
56
+ class?: string;
57
+ }): JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { JSX } from 'solid-js';
2
+ /** One selectable option: a stable `value` and its display `label`. */
3
+ export interface MultiSelectOption {
4
+ value: string;
5
+ label: string;
6
+ }
7
+ export interface MultiSelectProps {
8
+ options: MultiSelectOption[];
9
+ value: string[];
10
+ onChange: (value: string[]) => void;
11
+ placeholder?: string;
12
+ /** Show a search box in the dropdown. Default `true`. */
13
+ searchable?: boolean;
14
+ disabled?: boolean;
15
+ class?: string;
16
+ }
17
+ /**
18
+ * Multi-select dropdown: the trigger shows selected options as removable
19
+ * chips, and the portaled popover lists (optionally search-filtered) options
20
+ * to toggle. Picking an option keeps the popover open so several values can
21
+ * be chosen in a row; the popover closes on outside click, Escape, scroll, or
22
+ * resize.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * const [tags, setTags] = createSignal<string[]>([])
27
+ * <MultiSelect
28
+ * options={[{ value: 'a', label: 'Alpha' }, { value: 'b', label: 'Beta' }]}
29
+ * value={tags()}
30
+ * onChange={setTags}
31
+ * placeholder="Select tags…"
32
+ * />
33
+ * ```
34
+ */
35
+ export declare function MultiSelect(props: MultiSelectProps): JSX.Element;
@@ -2,6 +2,10 @@ import { JSX } from 'solid-js';
2
2
  export interface CalendarCoreProps {
3
3
  /** Currently selected day (for highlight); undefined = none. */
4
4
  selected?: Date;
5
+ /** Range start — endpoints fill, days strictly between get a soft band. */
6
+ rangeStart?: Date;
7
+ /** Range end (see `rangeStart`). */
8
+ rangeEnd?: Date;
5
9
  /** Called with the newly picked day. */
6
10
  onPick: (date: Date) => void;
7
11
  /** 0 = Sunday-first, 1 = Monday-first. @default 0 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a4ui/core",
3
- "version": "0.8.1",
3
+ "version": "0.10.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",
@@ -40,6 +40,16 @@
40
40
  "import": "./dist/index.js",
41
41
  "default": "./dist/index.js"
42
42
  },
43
+ "./commerce": {
44
+ "types": "./dist/commerce/index.d.ts",
45
+ "import": "./dist/commerce.js",
46
+ "default": "./dist/commerce.js"
47
+ },
48
+ "./charts": {
49
+ "types": "./dist/charts/index.d.ts",
50
+ "import": "./dist/charts.js",
51
+ "default": "./dist/charts.js"
52
+ },
43
53
  "./preset": {
44
54
  "import": "./preset.js",
45
55
  "default": "./preset.js"