@a4ui/core 0.37.1 → 0.38.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.
- package/README.md +8 -7
- package/dist/Collapse-Cr5cDqAl.js +375 -0
- package/dist/charts/AreaChart.d.ts +38 -0
- package/dist/charts/BarChart.d.ts +17 -1
- package/dist/charts/PieChart.d.ts +29 -0
- package/dist/charts/RadialBarChart.d.ts +33 -0
- package/dist/charts/index.d.ts +5 -0
- package/dist/charts/shared.d.ts +111 -0
- package/dist/charts.js +1493 -780
- package/dist/commerce.js +625 -634
- package/dist/elements.css +1076 -8
- package/dist/elements.iife.js +1 -6
- package/dist/elements.js +7774 -9133
- package/dist/full.css +1076 -8
- package/dist/index.d.ts +30 -3
- package/dist/index.js +17502 -15126
- package/dist/layout/Aurora.d.ts +16 -0
- package/dist/layout/EffectsToggle.d.ts +1 -1
- package/dist/layout/SpaceBackground.d.ts +1 -1
- package/dist/motion-CTIBwMCA.js +104 -0
- package/dist/styles.css +110 -3
- package/dist/ui/AspectRatio.d.ts +19 -0
- package/dist/ui/Attachment.d.ts +70 -0
- package/dist/ui/ButtonGroup.d.ts +37 -0
- package/dist/ui/ChatMarker.d.ts +20 -0
- package/dist/ui/ChatThread.d.ts +32 -8
- package/dist/ui/ContactSection.d.ts +49 -0
- package/dist/ui/CtaBanner.d.ts +28 -0
- package/dist/ui/Drawer.d.ts +5 -2
- package/dist/ui/Faq.d.ts +29 -0
- package/dist/ui/FeatureGrid.d.ts +35 -0
- package/dist/ui/Field.d.ts +148 -0
- package/dist/ui/Hero.d.ts +48 -0
- package/dist/ui/InputGroup.d.ts +93 -0
- package/dist/ui/Item.d.ts +63 -0
- package/dist/ui/Label.d.ts +23 -0
- package/dist/ui/Menubar.d.ts +83 -0
- package/dist/ui/Message.d.ts +51 -5
- package/dist/ui/Modal.d.ts +8 -2
- package/dist/ui/NativeSelect.d.ts +26 -0
- package/dist/ui/NavigationMenu.d.ts +85 -0
- package/dist/ui/PromptComposer.d.ts +5 -0
- package/dist/ui/Prose.d.ts +21 -0
- package/dist/ui/Questionnaire.d.ts +71 -0
- package/dist/ui/ScrollArea.d.ts +30 -0
- package/dist/ui/Sidebar.d.ts +229 -0
- package/dist/ui/SiteFooter.d.ts +39 -0
- package/dist/ui/SiteNav.d.ts +35 -0
- package/dist/ui/TeamGrid.d.ts +33 -0
- package/dist/ui/Testimonials.d.ts +37 -0
- package/dist/ui/internal/sectionKit.d.ts +22 -0
- package/dist/ui/internal/socialIcons.d.ts +9 -0
- package/package.json +38 -26
- package/preset.d.ts +23 -0
- package/src/charts/AreaChart.tsx +206 -0
- package/src/charts/BarChart.tsx +241 -5
- package/src/charts/DonutChart.tsx +8 -11
- package/src/charts/LineChart.tsx +2 -3
- package/src/charts/PieChart.tsx +145 -0
- package/src/charts/RadialBarChart.tsx +141 -0
- package/src/charts/index.ts +14 -0
- package/src/charts/shared.tsx +304 -0
- package/src/index.ts +192 -3
- package/src/layout/Aurora.tsx +36 -7
- package/src/layout/sceneEffects.ts +22 -3
- package/src/ui/AspectRatio.tsx +35 -0
- package/src/ui/Attachment.tsx +189 -0
- package/src/ui/ButtonGroup.tsx +89 -0
- package/src/ui/ChatMarker.tsx +58 -0
- package/src/ui/ChatThread.tsx +115 -23
- package/src/ui/ContactSection.tsx +199 -0
- package/src/ui/CtaBanner.tsx +62 -0
- package/src/ui/DateField.tsx +2 -1
- package/src/ui/DateRangePicker.tsx +2 -1
- package/src/ui/Drawer.tsx +37 -4
- package/src/ui/Faq.tsx +57 -0
- package/src/ui/FeatureGrid.tsx +77 -0
- package/src/ui/Field.tsx +374 -0
- package/src/ui/Hero.tsx +146 -0
- package/src/ui/InputGroup.tsx +219 -0
- package/src/ui/Item.tsx +185 -0
- package/src/ui/Label.tsx +50 -0
- package/src/ui/Menubar.tsx +212 -0
- package/src/ui/Message.tsx +139 -13
- package/src/ui/Modal.tsx +41 -5
- package/src/ui/MultiSelect.tsx +2 -1
- package/src/ui/NativeSelect.tsx +66 -0
- package/src/ui/NavigationMenu.tsx +262 -0
- package/src/ui/PromptComposer.tsx +11 -0
- package/src/ui/Prose.tsx +63 -0
- package/src/ui/Questionnaire.tsx +331 -0
- package/src/ui/ScrollArea.tsx +70 -0
- package/src/ui/Sidebar.tsx +753 -0
- package/src/ui/SiteFooter.tsx +112 -0
- package/src/ui/SiteNav.tsx +146 -0
- package/src/ui/TeamGrid.tsx +81 -0
- package/src/ui/Testimonials.tsx +103 -0
- package/src/ui/TimeField.tsx +2 -1
- package/src/ui/internal/sectionKit.tsx +72 -0
- package/src/ui/internal/socialIcons.tsx +41 -0
- package/dist/NumberInput-Bnh2u7pp.js +0 -381
- package/dist/motion-jYMWmZqB.js +0 -119
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { JSX, ParentProps } from 'solid-js';
|
|
2
|
+
/** Layout direction of a {@link Field}. */
|
|
3
|
+
export type FieldOrientation = 'vertical' | 'horizontal' | 'responsive';
|
|
4
|
+
export interface FieldSetProps extends ParentProps, JSX.FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Semantic `<fieldset>` that groups related fields. Pair with {@link FieldLegend}.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <FieldSet>
|
|
13
|
+
* <FieldLegend>Profile</FieldLegend>
|
|
14
|
+
* <FieldGroup>...</FieldGroup>
|
|
15
|
+
* </FieldSet>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function FieldSet(props: FieldSetProps): JSX.Element;
|
|
19
|
+
export interface FieldLegendProps extends ParentProps, JSX.HTMLAttributes<HTMLLegendElement> {
|
|
20
|
+
/** `legend` is a section heading; `label` is the smaller label size. Defaults to `legend`. */
|
|
21
|
+
variant?: 'legend' | 'label';
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Caption of a {@link FieldSet}.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <FieldLegend variant="label">Notifications</FieldLegend>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function FieldLegend(props: FieldLegendProps): JSX.Element;
|
|
33
|
+
export interface FieldGroupProps extends ParentProps, JSX.HTMLAttributes<HTMLDivElement> {
|
|
34
|
+
class?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Vertical stack of {@link Field}s with consistent spacing.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <FieldGroup><Field>...</Field><Field>...</Field></FieldGroup>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function FieldGroup(props: FieldGroupProps): JSX.Element;
|
|
45
|
+
export interface FieldProps extends ParentProps, JSX.HTMLAttributes<HTMLDivElement> {
|
|
46
|
+
/** `vertical` (default), `horizontal`, or `responsive` (stacked below `sm`, a row above). */
|
|
47
|
+
orientation?: FieldOrientation;
|
|
48
|
+
/** Marks the field invalid: sets `data-invalid` and `aria-invalid` on the control. */
|
|
49
|
+
invalid?: boolean;
|
|
50
|
+
class?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* One labelled form field. Provides the id context used by {@link FieldLabel},
|
|
54
|
+
* {@link FieldDescription} and {@link FieldError}, and wires the control inside
|
|
55
|
+
* it (`id`, `aria-describedby`, `aria-errormessage`, `aria-invalid`).
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* <Field invalid={!!error()}>
|
|
60
|
+
* <FieldLabel>Email</FieldLabel>
|
|
61
|
+
* <Input value={email()} onInput={setEmail} />
|
|
62
|
+
* <FieldDescription>We never share it.</FieldDescription>
|
|
63
|
+
* <FieldError>{error()}</FieldError>
|
|
64
|
+
* </Field>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function Field(props: FieldProps): JSX.Element;
|
|
68
|
+
/**
|
|
69
|
+
* Wrapper for a title + description block next to a control, e.g. the text half
|
|
70
|
+
* of a horizontal switch row.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <FieldContent><FieldTitle>Alerts</FieldTitle><FieldDescription>Email me.</FieldDescription></FieldContent>
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function FieldContent(props: ParentProps<{
|
|
78
|
+
class?: string;
|
|
79
|
+
}>): JSX.Element;
|
|
80
|
+
export interface FieldLabelProps extends ParentProps, JSX.LabelHTMLAttributes<HTMLLabelElement> {
|
|
81
|
+
class?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* `<label>` bound to the enclosing {@link Field}'s control through `for`.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```tsx
|
|
88
|
+
* <FieldLabel>Full name</FieldLabel>
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare function FieldLabel(props: FieldLabelProps): JSX.Element;
|
|
92
|
+
/**
|
|
93
|
+
* Non-label title text for a field (use where a `<label>` would be wrong).
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* <FieldTitle>Two-factor authentication</FieldTitle>
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare function FieldTitle(props: ParentProps<{
|
|
101
|
+
class?: string;
|
|
102
|
+
}>): JSX.Element;
|
|
103
|
+
/**
|
|
104
|
+
* Helper text, linked to the control through `aria-describedby`.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* <FieldDescription>Use 8 or more characters.</FieldDescription>
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare function FieldDescription(props: ParentProps<{
|
|
112
|
+
class?: string;
|
|
113
|
+
id?: string;
|
|
114
|
+
}>): JSX.Element;
|
|
115
|
+
export interface FieldSeparatorProps {
|
|
116
|
+
/** Optional text shown in the middle of the rule. */
|
|
117
|
+
children?: JSX.Element;
|
|
118
|
+
class?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Horizontal rule between fields, optionally with text in the middle.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* <FieldSeparator>or continue with</FieldSeparator>
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export declare function FieldSeparator(props: FieldSeparatorProps): JSX.Element;
|
|
129
|
+
export interface FieldErrorProps {
|
|
130
|
+
/** Error messages; entries may be strings or `{ message }` objects (e.g. schema issues). */
|
|
131
|
+
errors?: Array<string | {
|
|
132
|
+
message?: string;
|
|
133
|
+
} | undefined>;
|
|
134
|
+
/** Custom content, used when `errors` is not given. */
|
|
135
|
+
children?: JSX.Element;
|
|
136
|
+
class?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Validation message(s) for a field. Renders nothing when empty, a single line
|
|
140
|
+
* for one message and a list for several. `role="alert"` is set only while
|
|
141
|
+
* something is shown, so assistive tech announces it when it appears.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```tsx
|
|
145
|
+
* <FieldError errors={['Too short', 'Needs a number']} />
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
export declare function FieldError(props: FieldErrorProps): JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { SectionLink } from './internal/sectionKit';
|
|
3
|
+
/** Arrangement of a {@link Hero}: text centered, or text beside the image. */
|
|
4
|
+
export type HeroLayout = 'center' | 'split';
|
|
5
|
+
/** Backdrop of a {@link Hero}. `'image'` uses `image` as a full-bleed photo. */
|
|
6
|
+
export type HeroBackground = 'none' | 'aurora' | 'image';
|
|
7
|
+
export interface HeroProps {
|
|
8
|
+
/** Small label above the title, e.g. a category or announcement. */
|
|
9
|
+
eyebrow?: string;
|
|
10
|
+
/** Main headline, rendered as the page `<h1>`. */
|
|
11
|
+
title: string;
|
|
12
|
+
/** Supporting paragraph under the title. */
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
/** Main call-to-action (filled button). */
|
|
15
|
+
primary?: SectionLink;
|
|
16
|
+
/** Secondary call-to-action (outline button). */
|
|
17
|
+
secondary?: SectionLink;
|
|
18
|
+
/** Image URL. Shown beside the text in `split` layout, under it in `center`, or behind it with `background="image"`. */
|
|
19
|
+
image?: string;
|
|
20
|
+
/** Alt text of `image`. Defaults to empty (decorative). */
|
|
21
|
+
imageAlt?: string;
|
|
22
|
+
/** Defaults to `'center'`. */
|
|
23
|
+
layout?: HeroLayout;
|
|
24
|
+
/** Defaults to `'aurora'`. */
|
|
25
|
+
background?: HeroBackground;
|
|
26
|
+
/** Anchor id for in-page navigation. */
|
|
27
|
+
id?: string;
|
|
28
|
+
class?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Opening section of a landing page: eyebrow, headline, subtitle and up to two
|
|
32
|
+
* call-to-action links, with an optional image. `layout="split"` puts the image
|
|
33
|
+
* beside the text on wide screens (stacked on phones); `background` picks a
|
|
34
|
+
* theme-tinted aurora glow, a full-bleed photo with a legibility scrim, or
|
|
35
|
+
* nothing.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <Hero
|
|
40
|
+
* eyebrow="New"
|
|
41
|
+
* title="Ship your site this week"
|
|
42
|
+
* subtitle="Everything you need to launch, nothing you don't."
|
|
43
|
+
* primary={{ label: 'Get started', href: '/signup' }}
|
|
44
|
+
* secondary={{ label: 'See pricing', href: '#pricing' }}
|
|
45
|
+
* />
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function Hero(props: HeroProps): JSX.Element;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { JSX, ParentProps } from 'solid-js';
|
|
2
|
+
export interface InputGroupProps extends ParentProps, JSX.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Wrapper that owns a single border and focus ring for an input and its addons.
|
|
7
|
+
* Addons are placed by their `align` prop, whatever their order in the DOM.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <InputGroup>
|
|
12
|
+
* <InputGroupAddon><Search class="h-4 w-4" /></InputGroupAddon>
|
|
13
|
+
* <InputGroupInput value={q()} onInput={setQ} placeholder="Search" />
|
|
14
|
+
* </InputGroup>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function InputGroup(props: InputGroupProps): JSX.Element;
|
|
18
|
+
export type InputGroupAddonAlign = 'inline-start' | 'inline-end' | 'block-start' | 'block-end';
|
|
19
|
+
export interface InputGroupAddonProps extends ParentProps, JSX.HTMLAttributes<HTMLDivElement> {
|
|
20
|
+
/** Where the addon sits. Defaults to `inline-start`. */
|
|
21
|
+
align?: InputGroupAddonAlign;
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Adornment around the control. Clicking anywhere on it (except on a button)
|
|
26
|
+
* focuses the group's input or textarea.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <InputGroupAddon align="inline-end"><Kbd>/</Kbd></InputGroupAddon>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function InputGroupAddon(props: InputGroupAddonProps): JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Plain text inside an addon (a prefix like `https://` or a unit).
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <InputGroupAddon><InputGroupText>https://</InputGroupText></InputGroupAddon>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function InputGroupText(props: ParentProps<{
|
|
43
|
+
class?: string;
|
|
44
|
+
}>): JSX.Element;
|
|
45
|
+
/** Compact sizes for {@link InputGroupButton}. */
|
|
46
|
+
export type InputGroupButtonSize = 'xs' | 'sm' | 'icon-xs' | 'icon-sm';
|
|
47
|
+
export interface InputGroupButtonProps extends ParentProps, Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
48
|
+
/** Compact size. Defaults to `xs`. */
|
|
49
|
+
size?: InputGroupButtonSize;
|
|
50
|
+
/** Button variant; ghost by default so it blends into the group. */
|
|
51
|
+
variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
|
|
52
|
+
type?: 'button' | 'submit' | 'reset';
|
|
53
|
+
class?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Compact {@link Button} for use inside an addon. Ghost by default.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <InputGroupButton size="icon-xs" aria-label="Show password"><Eye /></InputGroupButton>
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function InputGroupButton(props: InputGroupButtonProps): JSX.Element;
|
|
64
|
+
export interface InputGroupInputProps extends Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onInput'> {
|
|
65
|
+
value: string;
|
|
66
|
+
/** Called with the raw string value on every input event. */
|
|
67
|
+
onInput: (value: string) => void;
|
|
68
|
+
class?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Borderless `<input>` for an {@link InputGroup} (same value/onInput API as `Input`).
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* <InputGroupInput value={url()} onInput={setUrl} placeholder="example.com" />
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function InputGroupInput(props: InputGroupInputProps): JSX.Element;
|
|
79
|
+
export interface InputGroupTextareaProps extends Omit<JSX.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'onInput'> {
|
|
80
|
+
value: string;
|
|
81
|
+
/** Called with the new string value on every input event. */
|
|
82
|
+
onInput: (value: string) => void;
|
|
83
|
+
class?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Borderless `<textarea>` for an {@link InputGroup}.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```tsx
|
|
90
|
+
* <InputGroupTextarea value={msg()} onInput={setMsg} rows={3} />
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function InputGroupTextarea(props: InputGroupTextareaProps): JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { JSX, ParentProps } from 'solid-js';
|
|
2
|
+
export type ItemVariant = 'default' | 'outline' | 'muted';
|
|
3
|
+
export type ItemSize = 'default' | 'sm' | 'xs';
|
|
4
|
+
interface ItemProps extends ParentProps {
|
|
5
|
+
/** @default 'default' (transparent) */
|
|
6
|
+
variant?: ItemVariant;
|
|
7
|
+
/** Padding + gap density. @default 'default' */
|
|
8
|
+
size?: ItemSize;
|
|
9
|
+
/**
|
|
10
|
+
* Render the row as a link. The whole row becomes the hit target and gets a
|
|
11
|
+
* hover/focus state.
|
|
12
|
+
*/
|
|
13
|
+
href?: string;
|
|
14
|
+
/** Render the row as a `<button>` with this click handler (when no `href`). */
|
|
15
|
+
onClick?: JSX.EventHandlerUnion<HTMLElement, MouseEvent>;
|
|
16
|
+
/** Element to render when neither `href` nor `onClick` is set. @default 'div' */
|
|
17
|
+
as?: 'div' | 'li' | 'article' | 'section';
|
|
18
|
+
class?: string;
|
|
19
|
+
}
|
|
20
|
+
export type { ItemProps };
|
|
21
|
+
/**
|
|
22
|
+
* A row of content: optional `ItemMedia`, an `ItemContent` column with
|
|
23
|
+
* `ItemTitle`/`ItemDescription`, and trailing `ItemActions`. `ItemHeader` and
|
|
24
|
+
* `ItemFooter` span the full width above/below. Group rows with `ItemGroup`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <Item variant="outline">
|
|
29
|
+
* <ItemMedia variant="icon"><Bell /></ItemMedia>
|
|
30
|
+
* <ItemContent>
|
|
31
|
+
* <ItemTitle>Weekly digest</ItemTitle>
|
|
32
|
+
* <ItemDescription>Every Monday at 9:00</ItemDescription>
|
|
33
|
+
* </ItemContent>
|
|
34
|
+
* <ItemActions><Switch checked /></ItemActions>
|
|
35
|
+
* </Item>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function Item(props: ItemProps): JSX.Element;
|
|
39
|
+
interface SlotProps extends ParentProps {
|
|
40
|
+
class?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Vertical stack of `Item`s. */
|
|
43
|
+
export declare function ItemGroup(props: SlotProps): JSX.Element;
|
|
44
|
+
/** Thin divider between `Item`s inside an `ItemGroup`. */
|
|
45
|
+
export declare function ItemSeparator(props: {
|
|
46
|
+
class?: string;
|
|
47
|
+
}): JSX.Element;
|
|
48
|
+
export type ItemMediaVariant = 'default' | 'icon' | 'image';
|
|
49
|
+
/** Leading visual: an icon tile, an image thumbnail, or anything (`default`). */
|
|
50
|
+
export declare function ItemMedia(props: SlotProps & {
|
|
51
|
+
variant?: ItemMediaVariant;
|
|
52
|
+
}): JSX.Element;
|
|
53
|
+
/** The flexible text column (title + description). */
|
|
54
|
+
export declare function ItemContent(props: SlotProps): JSX.Element;
|
|
55
|
+
export declare function ItemTitle(props: SlotProps): JSX.Element;
|
|
56
|
+
/** Muted secondary text, clamped to two lines. */
|
|
57
|
+
export declare function ItemDescription(props: SlotProps): JSX.Element;
|
|
58
|
+
/** Trailing controls (buttons, a switch, a badge). */
|
|
59
|
+
export declare function ItemActions(props: SlotProps): JSX.Element;
|
|
60
|
+
/** Full-width row above the media/content line. */
|
|
61
|
+
export declare function ItemHeader(props: SlotProps): JSX.Element;
|
|
62
|
+
/** Full-width row below the media/content line. */
|
|
63
|
+
export declare function ItemFooter(props: SlotProps): JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JSX, ParentProps } from 'solid-js';
|
|
2
|
+
interface LabelProps extends ParentProps, Omit<JSX.LabelHTMLAttributes<HTMLLabelElement>, 'for'> {
|
|
3
|
+
/** Id of the control this label names. */
|
|
4
|
+
for?: string;
|
|
5
|
+
/** Appends an `*` marker (hidden from assistive tech; set `required` on the control too). */
|
|
6
|
+
required?: boolean;
|
|
7
|
+
/** Dims the label. It also dims when it follows a disabled `.peer` control. */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
export type { LabelProps };
|
|
12
|
+
/**
|
|
13
|
+
* Styled `<label>`. Clicking it focuses/activates the control matching `for`.
|
|
14
|
+
* Dims when `disabled`, inside a `.group` with `data-disabled`, or after a
|
|
15
|
+
* disabled `.peer` control.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Label for="email" required>Email</Label>
|
|
20
|
+
* <Input id="email" value={email()} onInput={setEmail} required />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function Label(props: LabelProps): JSX.Element;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { JSX, ParentProps } from 'solid-js';
|
|
2
|
+
interface ClassProps extends ParentProps {
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
/** Props of {@link Menubar}. */
|
|
6
|
+
export interface MenubarProps extends ClassProps {
|
|
7
|
+
/** Accessible name of the menubar. @default 'Application menu' */
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Horizontal bar of top-level menus. Arrow Left/Right moves between the
|
|
12
|
+
* triggers; once one menu is open, hovering another trigger switches to it.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <Menubar>
|
|
17
|
+
* <MenubarMenu label="File">
|
|
18
|
+
* <MenubarItem shortcut={['⌘', 'N']}>New project</MenubarItem>
|
|
19
|
+
* <MenubarSeparator />
|
|
20
|
+
* <MenubarItem>Quit</MenubarItem>
|
|
21
|
+
* </MenubarMenu>
|
|
22
|
+
* </Menubar>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function Menubar(props: MenubarProps): JSX.Element;
|
|
26
|
+
/** Props of {@link MenubarMenu}. */
|
|
27
|
+
export interface MenubarMenuProps extends ClassProps {
|
|
28
|
+
/** Text of the top-level trigger. */
|
|
29
|
+
label: string;
|
|
30
|
+
/** Extra classes for the popover content. */
|
|
31
|
+
contentClass?: string;
|
|
32
|
+
}
|
|
33
|
+
/** One top-level menu: a trigger button plus its popover of items. */
|
|
34
|
+
export declare function MenubarMenu(props: MenubarMenuProps): JSX.Element;
|
|
35
|
+
/** Props of {@link MenubarItem}. */
|
|
36
|
+
export interface MenubarItemProps extends ClassProps {
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/** Called when the item is chosen (click, Enter or Space). */
|
|
39
|
+
onSelect?: () => void;
|
|
40
|
+
/** Keys shown right-aligned as keycaps, e.g. `['⌘', 'N']`. */
|
|
41
|
+
shortcut?: string[];
|
|
42
|
+
/** Styles the item as destructive (e.g. "Delete"). */
|
|
43
|
+
destructive?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** A plain action row, with an optional keyboard-shortcut hint. */
|
|
46
|
+
export declare function MenubarItem(props: MenubarItemProps): JSX.Element;
|
|
47
|
+
/** Props of {@link MenubarCheckboxItem}. */
|
|
48
|
+
export interface MenubarCheckboxItemProps extends ClassProps {
|
|
49
|
+
checked?: boolean;
|
|
50
|
+
onChange?: (checked: boolean) => void;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
shortcut?: string[];
|
|
53
|
+
}
|
|
54
|
+
/** A toggle row exposing `role="menuitemcheckbox"` / `aria-checked`. */
|
|
55
|
+
export declare function MenubarCheckboxItem(props: MenubarCheckboxItemProps): JSX.Element;
|
|
56
|
+
/** Props of {@link MenubarRadioGroup}. */
|
|
57
|
+
export interface MenubarRadioGroupProps extends ParentProps {
|
|
58
|
+
value?: string;
|
|
59
|
+
onChange?: (value: string) => void;
|
|
60
|
+
}
|
|
61
|
+
/** Groups {@link MenubarRadioItem}s so exactly one is selected. */
|
|
62
|
+
export declare function MenubarRadioGroup(props: MenubarRadioGroupProps): JSX.Element;
|
|
63
|
+
/** Props of {@link MenubarRadioItem}. */
|
|
64
|
+
export interface MenubarRadioItemProps extends ClassProps {
|
|
65
|
+
value: string;
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** A single-choice row inside a {@link MenubarRadioGroup} (`role="menuitemradio"`). */
|
|
69
|
+
export declare function MenubarRadioItem(props: MenubarRadioItemProps): JSX.Element;
|
|
70
|
+
/** Props of {@link MenubarSub}. */
|
|
71
|
+
export interface MenubarSubProps extends ClassProps {
|
|
72
|
+
/** Text of the submenu trigger row. */
|
|
73
|
+
label: string;
|
|
74
|
+
}
|
|
75
|
+
/** A nested submenu: opens with ArrowRight / hover, closes with ArrowLeft. */
|
|
76
|
+
export declare function MenubarSub(props: MenubarSubProps): JSX.Element;
|
|
77
|
+
/** Thin divider between groups of items. */
|
|
78
|
+
export declare function MenubarSeparator(props: {
|
|
79
|
+
class?: string;
|
|
80
|
+
}): JSX.Element;
|
|
81
|
+
/** Non-interactive section heading inside a menu. */
|
|
82
|
+
export declare function MenubarLabel(props: ClassProps): JSX.Element;
|
|
83
|
+
export {};
|
package/dist/ui/Message.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
2
|
/** Who sent a {@link Message}; drives its subtle visual treatment. */
|
|
3
3
|
export type ChatRole = 'user' | 'assistant' | 'system';
|
|
4
|
+
/** Bubble style of a {@link Message}. */
|
|
5
|
+
export type MessageVariant = 'default' | 'secondary' | 'muted' | 'tinted' | 'outline' | 'ghost' | 'destructive';
|
|
6
|
+
/** Which side of the thread a message sits on. */
|
|
7
|
+
export type MessageAlign = 'start' | 'end';
|
|
4
8
|
export interface MessageProps {
|
|
5
9
|
role: ChatRole;
|
|
6
10
|
children: JSX.Element;
|
|
@@ -10,19 +14,61 @@ export interface MessageProps {
|
|
|
10
14
|
avatar?: JSX.Element;
|
|
11
15
|
/** Preformatted timestamp string, e.g. `'2:45 PM'`. */
|
|
12
16
|
timestamp?: string;
|
|
17
|
+
/** Stable id, rendered as `data-message-id` so `ChatThread.scrollToMessage` can find it. */
|
|
18
|
+
id?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Bubble style. When omitted the legacy role-based treatment applies
|
|
21
|
+
* (`assistant` faint panel, `user` faint tint).
|
|
22
|
+
*/
|
|
23
|
+
variant?: MessageVariant;
|
|
24
|
+
/** Push the message to one side and shrink it to its content (max 85% wide). */
|
|
25
|
+
align?: MessageAlign;
|
|
26
|
+
/** Slot under the content, e.g. a row of reaction chips. */
|
|
27
|
+
reactions?: JSX.Element;
|
|
28
|
+
/** Slot under the content for `Attachment`s (wrap several in `AttachmentGroup`). */
|
|
29
|
+
attachments?: JSX.Element;
|
|
13
30
|
class?: string;
|
|
14
31
|
}
|
|
15
32
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* subtle, token-based treatment
|
|
19
|
-
* `
|
|
33
|
+
* One chat message: an optional avatar/author header followed by a prose
|
|
34
|
+
* content block, with optional `reactions` and `attachments` slots. Role is
|
|
35
|
+
* differentiated with subtle, token-based treatment — or choose a bubble
|
|
36
|
+
* `variant` and an `align` side. Inside a {@link MessageGroup} the header is
|
|
37
|
+
* suppressed (the group shows the sender once).
|
|
20
38
|
*
|
|
21
39
|
* @example
|
|
22
40
|
* ```tsx
|
|
23
|
-
* <Message role="assistant" author="Nova" timestamp="2:45 PM">
|
|
41
|
+
* <Message role="assistant" author="Nova" timestamp="2:45 PM" variant="secondary" align="start">
|
|
24
42
|
* <p>Here's the summary you asked for.</p>
|
|
25
43
|
* </Message>
|
|
26
44
|
* ```
|
|
27
45
|
*/
|
|
28
46
|
export declare function Message(props: MessageProps): JSX.Element;
|
|
47
|
+
export interface MessageGroupProps {
|
|
48
|
+
/** Sender name, shown once above the group. */
|
|
49
|
+
author?: string;
|
|
50
|
+
/** Sender avatar, shown once next to the name. */
|
|
51
|
+
avatar?: JSX.Element;
|
|
52
|
+
/** Timestamp of the first message, shown once. */
|
|
53
|
+
timestamp?: string;
|
|
54
|
+
/** Side for every message in the group (a message can still override it). */
|
|
55
|
+
align?: MessageAlign;
|
|
56
|
+
/** Bubble style for every message in the group (a message can still override it). */
|
|
57
|
+
variant?: MessageVariant;
|
|
58
|
+
/** The consecutive `Message`s from this sender. */
|
|
59
|
+
children: JSX.Element;
|
|
60
|
+
class?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Visually groups consecutive messages from one sender: avatar, name and time
|
|
64
|
+
* appear once, and the bubbles sit closer together than separate messages.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <MessageGroup author="Nova" avatar={<Avatar name="Nova" size="sm" />} variant="secondary" align="start">
|
|
69
|
+
* <Message role="assistant">First thought.</Message>
|
|
70
|
+
* <Message role="assistant">And a follow-up.</Message>
|
|
71
|
+
* </MessageGroup>
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function MessageGroup(props: MessageGroupProps): JSX.Element;
|
package/dist/ui/Modal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX, ParentProps } from 'solid-js';
|
|
2
|
-
interface ModalProps extends ParentProps {
|
|
2
|
+
export interface ModalProps extends ParentProps {
|
|
3
3
|
open: boolean;
|
|
4
4
|
onOpenChange: (open: boolean) => void;
|
|
5
5
|
/** Header title; omitting it hides the whole header bar. */
|
|
@@ -11,6 +11,13 @@ interface ModalProps extends ParentProps {
|
|
|
11
11
|
* @default 'drawer'
|
|
12
12
|
*/
|
|
13
13
|
variant?: 'drawer' | 'center';
|
|
14
|
+
/**
|
|
15
|
+
* Width of the dialog: `'sm'` 24rem, `'md'` 32rem, `'lg'` 42rem, `'xl'` 56rem,
|
|
16
|
+
* `'full'` the whole viewport minus margin. Omitted keeps the historical width
|
|
17
|
+
* (`variant="center"`: 32rem, `variant="drawer"`: 520px). Content taller than
|
|
18
|
+
* the viewport scrolls inside the dialog; the header stays pinned.
|
|
19
|
+
*/
|
|
20
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
14
21
|
class?: string;
|
|
15
22
|
/** Accessible label for the close button. @default 'Close' */
|
|
16
23
|
closeLabel?: string;
|
|
@@ -29,4 +36,3 @@ interface ModalProps extends ParentProps {
|
|
|
29
36
|
* ```
|
|
30
37
|
*/
|
|
31
38
|
export declare function Modal(props: ModalProps): JSX.Element;
|
|
32
|
-
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export type NativeSelectSize = 'sm' | 'default';
|
|
3
|
+
interface NativeSelectProps extends Omit<JSX.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
4
|
+
/** @default 'default' */
|
|
5
|
+
size?: NativeSelectSize;
|
|
6
|
+
/** Marks the field invalid (destructive border + `aria-invalid`). */
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
/** Class for the `<select>`; use `wrapperClass` for the outer box. */
|
|
9
|
+
class?: string;
|
|
10
|
+
wrapperClass?: string;
|
|
11
|
+
}
|
|
12
|
+
export type { NativeSelectProps };
|
|
13
|
+
/**
|
|
14
|
+
* Styled native `<select>` — gets the OS picker on mobile. Takes `<option>` and
|
|
15
|
+
* `<optgroup>` children; `value`, `onChange` and every other select attribute
|
|
16
|
+
* pass straight through.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <NativeSelect value={plan()} onChange={(e) => setPlan(e.currentTarget.value)} aria-label="Plan">
|
|
21
|
+
* <option value="free">Free</option>
|
|
22
|
+
* <option value="pro">Pro</option>
|
|
23
|
+
* </NativeSelect>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function NativeSelect(props: NativeSelectProps): JSX.Element;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { JSX, ParentProps } from 'solid-js';
|
|
2
|
+
/** One section of the collapsed (mobile) navigation. */
|
|
3
|
+
export interface NavigationMenuMobileSection {
|
|
4
|
+
/** Section title shown on the accordion trigger (or the link label). */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Destination when the section is a plain link with no children. */
|
|
7
|
+
href?: string;
|
|
8
|
+
/** Child links; when present the section becomes an accordion entry. */
|
|
9
|
+
links?: {
|
|
10
|
+
title: string;
|
|
11
|
+
href: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
/** Props of {@link NavigationMenu}. */
|
|
16
|
+
export interface NavigationMenuProps extends ParentProps {
|
|
17
|
+
/** Accessible name of the navigation landmark. @default 'Main' */
|
|
18
|
+
label?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The same sections as `children`, as data. Used below the `md` breakpoint,
|
|
21
|
+
* where the menu collapses into a hamburger + drawer. Required: the mobile
|
|
22
|
+
* layout cannot be derived from the desktop JSX.
|
|
23
|
+
*/
|
|
24
|
+
mobileSections: NavigationMenuMobileSection[];
|
|
25
|
+
/** Drawer title. @default 'Menu' */
|
|
26
|
+
mobileTitle?: string;
|
|
27
|
+
/** Accessible label of the hamburger button. @default 'Open navigation' */
|
|
28
|
+
mobileButtonLabel?: string;
|
|
29
|
+
class?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Site navigation bar whose triggers open rich panels (links with icon, title
|
|
33
|
+
* and description, featured cards) inside a shared, size-animating viewport.
|
|
34
|
+
* Hover or click opens a panel, Escape closes it, and the links inside are
|
|
35
|
+
* reachable with Tab. The root is the `<ul>` list of items.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <NavigationMenu mobileSections={[{ label: 'Docs', href: '/docs' }]}>
|
|
40
|
+
* <NavigationMenuItem>
|
|
41
|
+
* <NavigationMenuTrigger>Product</NavigationMenuTrigger>
|
|
42
|
+
* <NavigationMenuContent>
|
|
43
|
+
* <NavigationMenuPanelLink href="/tour" title="Tour" description="A quick walkthrough" />
|
|
44
|
+
* </NavigationMenuContent>
|
|
45
|
+
* </NavigationMenuItem>
|
|
46
|
+
* <NavigationMenuLink href="/docs">Docs</NavigationMenuLink>
|
|
47
|
+
* </NavigationMenu>
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function NavigationMenu(props: NavigationMenuProps): JSX.Element;
|
|
51
|
+
/** One top-level entry: pairs a trigger with its panel. */
|
|
52
|
+
export declare function NavigationMenuItem(props: ParentProps): JSX.Element;
|
|
53
|
+
/** Button that opens the sibling {@link NavigationMenuContent}; shows a chevron. */
|
|
54
|
+
export declare function NavigationMenuTrigger(props: ParentProps & {
|
|
55
|
+
class?: string;
|
|
56
|
+
}): JSX.Element;
|
|
57
|
+
/** Props of {@link NavigationMenuContent}. */
|
|
58
|
+
export interface NavigationMenuContentProps extends ParentProps {
|
|
59
|
+
class?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The panel of one item. Rendered inside the shared viewport, which resizes to
|
|
63
|
+
* fit it. Put {@link NavigationMenuPanelLink}s in it, laid out with a grid.
|
|
64
|
+
*/
|
|
65
|
+
export declare function NavigationMenuContent(props: NavigationMenuContentProps): JSX.Element;
|
|
66
|
+
/** Props of {@link NavigationMenuLink}. */
|
|
67
|
+
export interface NavigationMenuLinkProps extends ParentProps {
|
|
68
|
+
href: string;
|
|
69
|
+
class?: string;
|
|
70
|
+
}
|
|
71
|
+
/** A top-level link with no panel; takes part in the trigger roving focus. */
|
|
72
|
+
export declare function NavigationMenuLink(props: NavigationMenuLinkProps): JSX.Element;
|
|
73
|
+
/** Props of {@link NavigationMenuPanelLink}. */
|
|
74
|
+
export interface NavigationMenuPanelLinkProps {
|
|
75
|
+
href: string;
|
|
76
|
+
title: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
/** Leading icon element (e.g. a lucide icon). */
|
|
79
|
+
icon?: JSX.Element;
|
|
80
|
+
/** Renders as a large highlighted card, typically spanning several grid rows. */
|
|
81
|
+
featured?: boolean;
|
|
82
|
+
class?: string;
|
|
83
|
+
}
|
|
84
|
+
/** A link inside a panel: icon + title + description, or a featured card. */
|
|
85
|
+
export declare function NavigationMenuPanelLink(props: NavigationMenuPanelLinkProps): JSX.Element;
|