@veracity/vui-poc 0.1.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/dist/index.d.mts +584 -0
- package/dist/index.mjs +653 -0
- package/package.json +47 -0
- package/src/color-dark.css +185 -0
- package/src/color-light.css +185 -0
- package/src/color-primitives.css +318 -0
- package/src/default.css +184 -0
- package/src/styles.css +323 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode, SVGProps } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { ButtonProps, FieldErrorProps, InputProps as InputProps$1, LabelProps, LinkProps, TextFieldProps, TextProps } from "react-aria-components";
|
|
4
|
+
|
|
5
|
+
//#region src/components/shared/buttonStyles.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Shared style maps for `Button` and `IconButton`.
|
|
8
|
+
*
|
|
9
|
+
* Both components share the same intent / variant matrix and the same
|
|
10
|
+
* disabled treatment per variant. Only the *size* table differs (text
|
|
11
|
+
* buttons size by `h-* px-*`, icon buttons by `size-*`), so size lives
|
|
12
|
+
* in each component file.
|
|
13
|
+
*/
|
|
14
|
+
type ButtonIntent = "brand" | "contrast" | "success" | "danger";
|
|
15
|
+
type ButtonVariant = "primary" | "secondary" | "tertiary";
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/Button/Button.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* `Button` is a single styled component that renders **either** a real
|
|
20
|
+
* `<button>` (for actions) or an `<a>` (for navigation), chosen based on
|
|
21
|
+
* whether `href` is set:
|
|
22
|
+
*
|
|
23
|
+
* <Button onPress={save}>Save</Button> // -> <button> via react-aria-components
|
|
24
|
+
* <Button href="/docs">Read the docs</Button> // -> <a> via react-aria-components
|
|
25
|
+
*
|
|
26
|
+
* This is **not** an `asChild` / generic-`as` polymorphic component. The
|
|
27
|
+
* choice is a simple discriminated union on `href`, so semantics and a11y
|
|
28
|
+
* stay correct (real `<button>` for actions, real `<a>` for navigation)
|
|
29
|
+
* and React Aria's render-prop / press / focus model still works.
|
|
30
|
+
*/
|
|
31
|
+
type SharedButtonProps = {
|
|
32
|
+
intent?: ButtonIntent;
|
|
33
|
+
isActive?: boolean;
|
|
34
|
+
variant?: ButtonVariant;
|
|
35
|
+
/**
|
|
36
|
+
* Visual size. Defaults to `"lg"` (40px tall) to match the Figma
|
|
37
|
+
* source-of-truth and to give a comfortable touch target out of the
|
|
38
|
+
* box. `"md"` is the right pick for dense forms / toolbars; `"sm"`
|
|
39
|
+
* for chrome inside other components; `"xl"` for landing-page CTAs.
|
|
40
|
+
* The default is intentionally not `"md"` — do not "fix" it without
|
|
41
|
+
* updating the design system.
|
|
42
|
+
*/
|
|
43
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
44
|
+
/** Static class names. The render-prop callback form (`className={(state) => ...}`)
|
|
45
|
+
* is intentionally not exposed here — use `data-*` selectors against the
|
|
46
|
+
* emitted state attributes instead, or drop down to `react-aria-components`. */
|
|
47
|
+
className?: string; /** Icon rendered before the label. Wrapped in an `aria-hidden` span. */
|
|
48
|
+
startIcon?: ReactNode; /** Icon rendered after the label. Wrapped in an `aria-hidden` span. */
|
|
49
|
+
endIcon?: ReactNode;
|
|
50
|
+
};
|
|
51
|
+
type VuiButtonProps = (SharedButtonProps & Omit<ButtonProps, "className"> & {
|
|
52
|
+
href?: undefined;
|
|
53
|
+
}) | (SharedButtonProps & Omit<LinkProps, "className"> & {
|
|
54
|
+
href: string;
|
|
55
|
+
});
|
|
56
|
+
declare function Button(props: VuiButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/Notification/parts.d.ts
|
|
59
|
+
type NotificationIconProps = {
|
|
60
|
+
/** Override the default intent-driven icon. */children?: ReactNode;
|
|
61
|
+
className?: string;
|
|
62
|
+
};
|
|
63
|
+
declare function NotificationIcon({
|
|
64
|
+
children,
|
|
65
|
+
className
|
|
66
|
+
}: NotificationIconProps): _$react_jsx_runtime0.JSX.Element;
|
|
67
|
+
/**
|
|
68
|
+
* Element used to render `Notification.Title`. Defaults to `"p"`.
|
|
69
|
+
*
|
|
70
|
+
* Notifications appear in many contexts and the right heading level is
|
|
71
|
+
* context-dependent, so the `as` prop is a narrow polymorphism: only
|
|
72
|
+
* heading-like elements are accepted.
|
|
73
|
+
*
|
|
74
|
+
* - In a toast / inline status (the default usage), keep `"p"` — the
|
|
75
|
+
* surrounding `role="status"` / `role="alert"` already announces the
|
|
76
|
+
* whole notification, and an extra heading would pollute the document
|
|
77
|
+
* outline.
|
|
78
|
+
* - In a dialog or page banner where the notification *is* a section,
|
|
79
|
+
* pass `as="h2"` / `as="h3"` so screen-reader users can navigate to it
|
|
80
|
+
* via heading shortcuts.
|
|
81
|
+
*/
|
|
82
|
+
type NotificationTitleElement = "p" | "div" | "span" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
83
|
+
type NotificationTitleProps = {
|
|
84
|
+
children: ReactNode;
|
|
85
|
+
className?: string; /** HTML element to render as. See {@link NotificationTitleElement}. Default: `"p"`. */
|
|
86
|
+
as?: NotificationTitleElement;
|
|
87
|
+
};
|
|
88
|
+
declare function NotificationTitle({
|
|
89
|
+
children,
|
|
90
|
+
className,
|
|
91
|
+
as: Component
|
|
92
|
+
}: NotificationTitleProps): _$react_jsx_runtime0.JSX.Element;
|
|
93
|
+
type NotificationBodyProps = {
|
|
94
|
+
children: ReactNode;
|
|
95
|
+
className?: string;
|
|
96
|
+
};
|
|
97
|
+
declare function NotificationBody({
|
|
98
|
+
children,
|
|
99
|
+
className
|
|
100
|
+
}: NotificationBodyProps): _$react_jsx_runtime0.JSX.Element;
|
|
101
|
+
/**
|
|
102
|
+
* Wraps title, body, and inline actions in a vertical flex column inside the
|
|
103
|
+
* notification. Children stack top-to-bottom, growing to fill the available
|
|
104
|
+
* horizontal space without affecting the sibling `<Notification.Icon>` or
|
|
105
|
+
* `<Notification.Dismiss>` slots.
|
|
106
|
+
*
|
|
107
|
+
* The flat API renders this automatically; reach for it in the compound API
|
|
108
|
+
* whenever you need to control the title / body / actions stack.
|
|
109
|
+
*/
|
|
110
|
+
type NotificationContentProps = ComponentProps<"div"> & {
|
|
111
|
+
children: ReactNode;
|
|
112
|
+
};
|
|
113
|
+
declare function NotificationContent({
|
|
114
|
+
children,
|
|
115
|
+
className,
|
|
116
|
+
...rest
|
|
117
|
+
}: NotificationContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
118
|
+
/**
|
|
119
|
+
* Canonical action button for a notification: a `Button` pre-styled with the
|
|
120
|
+
* notification's inverted accent (background = current intent accent, text =
|
|
121
|
+
* notification surface). Use inside `<Notification.Actions>` instead of
|
|
122
|
+
* importing `<Button>` directly so the action always tracks the host
|
|
123
|
+
* notification's intent without per-call wiring.
|
|
124
|
+
*
|
|
125
|
+
* Forwards all `Button` props. `style` is shallow-merged so consumers can
|
|
126
|
+
* still override individual CSS properties when needed.
|
|
127
|
+
*/
|
|
128
|
+
type NotificationActionProps = Extract<VuiButtonProps, {
|
|
129
|
+
href?: undefined;
|
|
130
|
+
}>;
|
|
131
|
+
declare function NotificationAction({
|
|
132
|
+
variant,
|
|
133
|
+
size: sizeProp,
|
|
134
|
+
style,
|
|
135
|
+
className,
|
|
136
|
+
...rest
|
|
137
|
+
}: NotificationActionProps): _$react_jsx_runtime0.JSX.Element;
|
|
138
|
+
/**
|
|
139
|
+
* Layout slot for one or more action buttons inside a notification. Renamed
|
|
140
|
+
* from `Action` to `Actions` because the slot routinely holds multiple
|
|
141
|
+
* controls (e.g. "Retry" + "Cancel").
|
|
142
|
+
*
|
|
143
|
+
* Rendered as an unstyled `<div>` — vertical spacing between this slot and
|
|
144
|
+
* the title/body is owned by the parent `<Notification>` (via its `gap-*`
|
|
145
|
+
* class). This avoids the `mt-2` / consumer-`mt-3` className collision that
|
|
146
|
+
* the previous implementation could produce.
|
|
147
|
+
*/
|
|
148
|
+
type NotificationActionsProps = ComponentProps<"div"> & {
|
|
149
|
+
children: ReactNode;
|
|
150
|
+
};
|
|
151
|
+
declare function NotificationActions({
|
|
152
|
+
children,
|
|
153
|
+
className,
|
|
154
|
+
...rest
|
|
155
|
+
}: NotificationActionsProps): _$react_jsx_runtime0.JSX.Element;
|
|
156
|
+
type NotificationDismissProps = {
|
|
157
|
+
className?: string; /** Accessible label for the dismiss button. Defaults to `"Close"`. */
|
|
158
|
+
"aria-label"?: string; /** ID of the element that labels the dismiss button. */
|
|
159
|
+
"aria-labelledby"?: string;
|
|
160
|
+
};
|
|
161
|
+
declare function NotificationDismiss({
|
|
162
|
+
className,
|
|
163
|
+
"aria-label": ariaLabel,
|
|
164
|
+
"aria-labelledby": ariaLabelledBy
|
|
165
|
+
}: NotificationDismissProps): _$react_jsx_runtime0.JSX.Element;
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/components/Notification/helpers.d.ts
|
|
168
|
+
type NotificationIntent = "info" | "success" | "warning" | "danger";
|
|
169
|
+
type NotificationAlign = "top" | "center";
|
|
170
|
+
/**
|
|
171
|
+
* Sizing scale.
|
|
172
|
+
*
|
|
173
|
+
* - `"md"` (default) — Figma default. Used for inline page-level notifications.
|
|
174
|
+
* - `"sm"` — compact layout for dense UIs (toasts, side panels). Reduces
|
|
175
|
+
* padding, gap, icon size, action button size, and the dismiss icon.
|
|
176
|
+
*/
|
|
177
|
+
type NotificationSize = "sm" | "md";
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/components/Notification/Notification.d.ts
|
|
180
|
+
/**
|
|
181
|
+
* `Notification` supports **two interchangeable APIs**:
|
|
182
|
+
*
|
|
183
|
+
* 1. **Flat / convenience** — pass `title`, `body`, `action`, and toggle
|
|
184
|
+
* `showDismissButton` for the standard layout in one element:
|
|
185
|
+
*
|
|
186
|
+
* <Notification
|
|
187
|
+
* intent="danger"
|
|
188
|
+
* title="Could not save"
|
|
189
|
+
* body="Check your connection and try again."
|
|
190
|
+
* action={<Button size="sm">Retry</Button>}
|
|
191
|
+
* showDismissButton
|
|
192
|
+
* />
|
|
193
|
+
*
|
|
194
|
+
* 2. **Compound** — pass children using the named sub-components when you
|
|
195
|
+
* need to control element order, add extra markup, or skip parts:
|
|
196
|
+
*
|
|
197
|
+
* <Notification intent="danger">
|
|
198
|
+
* <Notification.Icon />
|
|
199
|
+
* <Notification.Title>Could not save</Notification.Title>
|
|
200
|
+
* <Notification.Body>Check your connection and try again.</Notification.Body>
|
|
201
|
+
* <Notification.Actions>
|
|
202
|
+
* <Button size="sm">Retry</Button>
|
|
203
|
+
* </Notification.Actions>
|
|
204
|
+
* <Notification.Dismiss />
|
|
205
|
+
* </Notification>
|
|
206
|
+
*
|
|
207
|
+
* Selection is purely a function of whether `children` is provided: any
|
|
208
|
+
* `children` switches to compound mode and the flat props are ignored. This
|
|
209
|
+
* avoids runtime children-shape detection — there is no "mixed" mode.
|
|
210
|
+
*/
|
|
211
|
+
type NotificationVariant = "inline" | "banner";
|
|
212
|
+
/**
|
|
213
|
+
* ARIA role values accepted as an explicit override. When omitted, the role
|
|
214
|
+
* is derived from `intent` (`"warning"` / `"danger"` → `"alert"`, otherwise
|
|
215
|
+
* `"status"`). Use `"none"` to suppress the implicit live region entirely —
|
|
216
|
+
* e.g. when the notification sits inside a parent live region that already
|
|
217
|
+
* announces.
|
|
218
|
+
*/
|
|
219
|
+
type NotificationRole = "alert" | "status" | "log" | "none";
|
|
220
|
+
/**
|
|
221
|
+
* Shorthand `action` value. When the prop is given this object shape instead
|
|
222
|
+
* of a `ReactNode`, the component renders a small, inverted-intent `Button`
|
|
223
|
+
* inline — matching the canonical VUI 4.x action pattern so consumers don't
|
|
224
|
+
* have to import `Button` for the common case. Pass a `ReactNode` (e.g. a
|
|
225
|
+
* fully configured `<Button>`) when you need more control.
|
|
226
|
+
*/
|
|
227
|
+
type NotificationActionObject = {
|
|
228
|
+
label: ReactNode;
|
|
229
|
+
onClick: () => void;
|
|
230
|
+
};
|
|
231
|
+
type NotificationProps = Omit<ComponentProps<"div">, "role" | "children"> & {
|
|
232
|
+
intent?: NotificationIntent; /** Vertical alignment of the icon and dismiss button relative to the body. */
|
|
233
|
+
align?: NotificationAlign;
|
|
234
|
+
/**
|
|
235
|
+
* Sizing scale.
|
|
236
|
+
*
|
|
237
|
+
* - `"md"` (default) — Figma default. Comfortable padding/gap, 24px icon,
|
|
238
|
+
* medium action button, 16px dismiss icon.
|
|
239
|
+
* - `"sm"` — compact for dense UIs (toasts, side panels). Tighter padding
|
|
240
|
+
* and gap, 20px icon, small action button, 12px dismiss icon.
|
|
241
|
+
*
|
|
242
|
+
* The size is propagated to all sub-components via context.
|
|
243
|
+
*/
|
|
244
|
+
size?: NotificationSize;
|
|
245
|
+
/**
|
|
246
|
+
* Visual variant. `"inline"` (default) is a bordered card sized to its
|
|
247
|
+
* content (`w-fit`). `"banner"` is the full-width edge-to-edge layout
|
|
248
|
+
* used by `<BannerNotification>`.
|
|
249
|
+
*/
|
|
250
|
+
variant?: NotificationVariant;
|
|
251
|
+
/**
|
|
252
|
+
* When true, `<Notification.Icon>` renders a spinner instead of the
|
|
253
|
+
* intent-derived icon. Useful for in-progress operations whose outcome
|
|
254
|
+
* will later swap the notification to `success` / `danger`.
|
|
255
|
+
*/
|
|
256
|
+
isLoading?: boolean;
|
|
257
|
+
/**
|
|
258
|
+
* ARIA role override. When omitted, the role is derived from `intent`
|
|
259
|
+
* (`warning` / `danger` → `alert`, otherwise `status`). `aria-live` is
|
|
260
|
+
* intentionally not set: notifications are mounted with their final
|
|
261
|
+
* content, and `role="alert"` already announces on insertion.
|
|
262
|
+
*/
|
|
263
|
+
role?: NotificationRole;
|
|
264
|
+
/**
|
|
265
|
+
* Called when `<Notification.Dismiss>` is pressed. If omitted, the
|
|
266
|
+
* notification dismisses itself by unmounting.
|
|
267
|
+
*/
|
|
268
|
+
onClose?: () => void; /** Flat-API title. Equivalent to `<Notification.Title>{title}</Notification.Title>`. */
|
|
269
|
+
title?: ReactNode; /** Flat-API body. Equivalent to `<Notification.Body>{body}</Notification.Body>`. */
|
|
270
|
+
body?: ReactNode;
|
|
271
|
+
/**
|
|
272
|
+
* Alias for {@link NotificationProps.body}. Kept for parity with the
|
|
273
|
+
* historical VUI 4.x API. When both are provided, `body` wins.
|
|
274
|
+
* @deprecated Use `body` instead.
|
|
275
|
+
*/
|
|
276
|
+
text?: ReactNode;
|
|
277
|
+
/**
|
|
278
|
+
* Flat-API action slot. Either a `ReactNode` forwarded as-is to
|
|
279
|
+
* `<Notification.Actions>`, or a shorthand `{ label, onClick }` object —
|
|
280
|
+
* see {@link NotificationActionObject}. Use the compound API if you need
|
|
281
|
+
* props on the actions container itself.
|
|
282
|
+
*/
|
|
283
|
+
action?: ReactNode | NotificationActionObject;
|
|
284
|
+
/**
|
|
285
|
+
* Flat-API icon override. Pass a custom icon node to replace the
|
|
286
|
+
* intent-driven default, or `false` to suppress the icon entirely. Has no
|
|
287
|
+
* effect on the spinner shown when `isLoading` is true (toggle that via
|
|
288
|
+
* `isLoading` instead).
|
|
289
|
+
*/
|
|
290
|
+
icon?: ReactNode | false; /** Flat-API: render a trailing dismiss button. Defaults to `false`. */
|
|
291
|
+
showDismissButton?: boolean;
|
|
292
|
+
children?: ReactNode;
|
|
293
|
+
};
|
|
294
|
+
declare function NotificationRoot({
|
|
295
|
+
intent,
|
|
296
|
+
align,
|
|
297
|
+
size,
|
|
298
|
+
variant,
|
|
299
|
+
isLoading,
|
|
300
|
+
role: roleProp,
|
|
301
|
+
onClose,
|
|
302
|
+
className,
|
|
303
|
+
children,
|
|
304
|
+
title,
|
|
305
|
+
body,
|
|
306
|
+
text,
|
|
307
|
+
action,
|
|
308
|
+
icon,
|
|
309
|
+
showDismissButton,
|
|
310
|
+
...rest
|
|
311
|
+
}: NotificationProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
312
|
+
/**
|
|
313
|
+
* Compound API. Each sub-component reads from `NotificationContext` and is
|
|
314
|
+
* meaningless outside a `<Notification>` (or `<BannerNotification>`) parent.
|
|
315
|
+
*/
|
|
316
|
+
declare const Notification: typeof NotificationRoot & {
|
|
317
|
+
Icon: typeof NotificationIcon;
|
|
318
|
+
Title: typeof NotificationTitle;
|
|
319
|
+
Body: typeof NotificationBody;
|
|
320
|
+
Content: typeof NotificationContent;
|
|
321
|
+
Action: typeof NotificationAction;
|
|
322
|
+
Actions: typeof NotificationActions;
|
|
323
|
+
Dismiss: typeof NotificationDismiss;
|
|
324
|
+
};
|
|
325
|
+
//#endregion
|
|
326
|
+
//#region src/components/BannerNotification/BannerNotification.d.ts
|
|
327
|
+
/**
|
|
328
|
+
* `BannerNotification` is the page-level / edge-to-edge variant of
|
|
329
|
+
* `Notification`. It is a thin wrapper that hard-codes
|
|
330
|
+
* `variant="banner"` and re-exports the same compound parts. Any prop
|
|
331
|
+
* accepted by `Notification` (other than `variant`) is forwarded.
|
|
332
|
+
*
|
|
333
|
+
* <BannerNotification intent="warning">
|
|
334
|
+
* <BannerNotification.Icon />
|
|
335
|
+
* <BannerNotification.Title>Scheduled maintenance</BannerNotification.Title>
|
|
336
|
+
* <BannerNotification.Body>The portal is offline Friday 02:00–03:00 UTC.</BannerNotification.Body>
|
|
337
|
+
* <BannerNotification.Dismiss />
|
|
338
|
+
* </BannerNotification>
|
|
339
|
+
*/
|
|
340
|
+
type BannerNotificationProps = Omit<NotificationProps, "variant">;
|
|
341
|
+
declare function BannerNotificationRoot(props: BannerNotificationProps): _$react_jsx_runtime0.JSX.Element;
|
|
342
|
+
declare const BannerNotification: typeof BannerNotificationRoot & {
|
|
343
|
+
Icon: typeof NotificationIcon;
|
|
344
|
+
Title: typeof NotificationTitle;
|
|
345
|
+
Body: typeof NotificationBody;
|
|
346
|
+
Content: typeof NotificationContent;
|
|
347
|
+
Actions: typeof NotificationActions;
|
|
348
|
+
Dismiss: typeof NotificationDismiss;
|
|
349
|
+
};
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/components/IconButton/IconButton.d.ts
|
|
352
|
+
/**
|
|
353
|
+
* Icon-only counterpart to {@link Button}. Renders a `<button>` for actions
|
|
354
|
+
* and an `<a>` when `href` is set.
|
|
355
|
+
*
|
|
356
|
+
* <IconButton aria-label="Save" icon={<SaveIcon />} onPress={save} />
|
|
357
|
+
* <IconButton aria-label="Settings" href="/settings" icon={<SettingsIcon />} />
|
|
358
|
+
*
|
|
359
|
+
* Always provide an `aria-label` (or `aria-labelledby`) — the visible icon
|
|
360
|
+
* is decorative and `aria-hidden`, so without an explicit label the control
|
|
361
|
+
* is unnamed.
|
|
362
|
+
*/
|
|
363
|
+
type SharedIconButtonProps = {
|
|
364
|
+
intent?: ButtonIntent;
|
|
365
|
+
isActive?: boolean;
|
|
366
|
+
isElevated?: boolean;
|
|
367
|
+
isRound?: boolean;
|
|
368
|
+
variant?: ButtonVariant;
|
|
369
|
+
/**
|
|
370
|
+
* Visual size. Defaults to `"lg"` (40×40px) to match the Figma
|
|
371
|
+
* source-of-truth and the default `Button` size, so an icon button
|
|
372
|
+
* sits flush next to a text button without manual sizing. The
|
|
373
|
+
* default is intentionally not `"md"` — see `Button` for the
|
|
374
|
+
* rationale.
|
|
375
|
+
*/
|
|
376
|
+
size?: "sm" | "md" | "lg" | "xl"; /** Static class names; render-prop callback form is not supported here. */
|
|
377
|
+
className?: string;
|
|
378
|
+
/**
|
|
379
|
+
* The icon to render. Wrapped in an `aria-hidden` span so the visible
|
|
380
|
+
* glyph is never announced — the control is named exclusively by
|
|
381
|
+
* `aria-label` / `aria-labelledby`.
|
|
382
|
+
*/
|
|
383
|
+
icon: ReactNode;
|
|
384
|
+
};
|
|
385
|
+
type VuiIconButtonProps = (SharedIconButtonProps & Omit<ButtonProps, "className" | "children"> & {
|
|
386
|
+
href?: undefined;
|
|
387
|
+
}) | (SharedIconButtonProps & Omit<LinkProps, "className" | "children"> & {
|
|
388
|
+
href: string;
|
|
389
|
+
});
|
|
390
|
+
declare function IconButton(props: VuiIconButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
391
|
+
//#endregion
|
|
392
|
+
//#region src/components/IconButton/presets.d.ts
|
|
393
|
+
type OmitDistributive<T, K extends string> = T extends unknown ? Omit<T, K> : never;
|
|
394
|
+
type IconPresetProps = OmitDistributive<VuiIconButtonProps, "children" | "icon">;
|
|
395
|
+
type BackButtonProps = IconPresetProps;
|
|
396
|
+
declare const BackButton: (props: BackButtonProps) => ReactNode;
|
|
397
|
+
type DismissButtonProps = IconPresetProps;
|
|
398
|
+
declare const DismissButton: (props: DismissButtonProps) => ReactNode;
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/components/Input/context.d.ts
|
|
401
|
+
/**
|
|
402
|
+
* Visual flavor of the field. `"brand"` is the resting state; `"success"`
|
|
403
|
+
* tints the border / message green for confirmed-valid input; `"danger"`
|
|
404
|
+
* forces the red error styling **without** setting `isInvalid`.
|
|
405
|
+
*
|
|
406
|
+
* Prefer `isInvalid` (or, on `<Input>`, `errorMessage`) for real validation
|
|
407
|
+
* — it sets `aria-invalid` and is announced to assistive tech. Reach for
|
|
408
|
+
* `intent="danger"` only when you need the red look without claiming the
|
|
409
|
+
* field is invalid (e.g. a parent-level error highlights its inputs but
|
|
410
|
+
* the inputs themselves are not individually invalid).
|
|
411
|
+
*/
|
|
412
|
+
type TextFieldIntent = "brand" | "success" | "danger";
|
|
413
|
+
type TextFieldSize = "sm" | "md" | "lg" | "xl";
|
|
414
|
+
type TextFieldContextValue = {
|
|
415
|
+
count: number;
|
|
416
|
+
intent: TextFieldIntent;
|
|
417
|
+
maxLength?: number;
|
|
418
|
+
showCount: boolean;
|
|
419
|
+
size: TextFieldSize;
|
|
420
|
+
};
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region src/components/Input/parts.d.ts
|
|
423
|
+
type TextFieldLabelProps = LabelProps;
|
|
424
|
+
type TextFieldInputProps = InputProps$1;
|
|
425
|
+
type TextFieldDescriptionProps = Omit<TextProps, "slot">;
|
|
426
|
+
type TextFieldErrorProps = FieldErrorProps;
|
|
427
|
+
type TextFieldCounterProps = {
|
|
428
|
+
className?: string;
|
|
429
|
+
};
|
|
430
|
+
declare function TextFieldLabel({
|
|
431
|
+
className,
|
|
432
|
+
...props
|
|
433
|
+
}: TextFieldLabelProps): _$react_jsx_runtime0.JSX.Element;
|
|
434
|
+
declare function TextFieldInput({
|
|
435
|
+
className,
|
|
436
|
+
...props
|
|
437
|
+
}: TextFieldInputProps): _$react_jsx_runtime0.JSX.Element;
|
|
438
|
+
declare function TextFieldDescription({
|
|
439
|
+
className,
|
|
440
|
+
...props
|
|
441
|
+
}: TextFieldDescriptionProps): _$react_jsx_runtime0.JSX.Element;
|
|
442
|
+
declare function TextFieldError({
|
|
443
|
+
className,
|
|
444
|
+
...props
|
|
445
|
+
}: TextFieldErrorProps): _$react_jsx_runtime0.JSX.Element;
|
|
446
|
+
declare function TextFieldCounter({
|
|
447
|
+
className
|
|
448
|
+
}: TextFieldCounterProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
449
|
+
type TextFieldIconProps = {
|
|
450
|
+
/** Where the icon sits relative to the input. Used for layout / spacing only. */position?: "start" | "end";
|
|
451
|
+
children: ReactNode;
|
|
452
|
+
className?: string;
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* Decorative icon for an input. Render *inside* `TextField.InputGroup`,
|
|
456
|
+
* either before or after `TextField.Input`.
|
|
457
|
+
*/
|
|
458
|
+
declare function TextFieldIcon({
|
|
459
|
+
position,
|
|
460
|
+
children,
|
|
461
|
+
className
|
|
462
|
+
}: TextFieldIconProps): _$react_jsx_runtime0.JSX.Element;
|
|
463
|
+
type TextFieldInputGroupProps = {
|
|
464
|
+
children: ReactNode;
|
|
465
|
+
className?: string;
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* Wrapper around `TextField.Input` that lays out adjacent
|
|
469
|
+
* `TextField.Icon` siblings in a single row.
|
|
470
|
+
*/
|
|
471
|
+
declare function TextFieldInputGroup({
|
|
472
|
+
children,
|
|
473
|
+
className
|
|
474
|
+
}: TextFieldInputGroupProps): _$react_jsx_runtime0.JSX.Element;
|
|
475
|
+
//#endregion
|
|
476
|
+
//#region src/components/Input/TextField.d.ts
|
|
477
|
+
/**
|
|
478
|
+
* `TextField` is the **advanced / compound** text-field API. For the
|
|
479
|
+
* common case (label + input + description/error + counter) prefer
|
|
480
|
+
* `<Input>`, which composes these parts into the standard layout for
|
|
481
|
+
* you.
|
|
482
|
+
*
|
|
483
|
+
* Reach for `TextField` directly when you need something `<Input>` can
|
|
484
|
+
* not express — e.g. icons inside the input, a non-standard label or
|
|
485
|
+
* footer layout, or extra elements interleaved with the parts.
|
|
486
|
+
*/
|
|
487
|
+
type VuiTextFieldProps = TextFieldProps & {
|
|
488
|
+
/**
|
|
489
|
+
* Visual flavor of the field. See {@link TextFieldIntent} for the
|
|
490
|
+
* difference between `intent="danger"` (cosmetic only) and `isInvalid`
|
|
491
|
+
* (semantic + a11y). Prefer `isInvalid` for real validation errors.
|
|
492
|
+
*/
|
|
493
|
+
intent?: TextFieldIntent;
|
|
494
|
+
showCount?: boolean;
|
|
495
|
+
/**
|
|
496
|
+
* Visual size. Defaults to `"lg"` (40px tall) to align with the
|
|
497
|
+
* default `Button` size, so a text field and its submit button match
|
|
498
|
+
* heights without manual sizing. The default is intentionally not
|
|
499
|
+
* `"md"` — see `Button` for the rationale.
|
|
500
|
+
*/
|
|
501
|
+
size?: TextFieldSize;
|
|
502
|
+
};
|
|
503
|
+
declare function TextFieldRoot({
|
|
504
|
+
className,
|
|
505
|
+
defaultValue,
|
|
506
|
+
intent,
|
|
507
|
+
maxLength,
|
|
508
|
+
onChange,
|
|
509
|
+
showCount,
|
|
510
|
+
size,
|
|
511
|
+
value,
|
|
512
|
+
...props
|
|
513
|
+
}: VuiTextFieldProps): _$react_jsx_runtime0.JSX.Element;
|
|
514
|
+
declare const TextField: typeof TextFieldRoot & {
|
|
515
|
+
Counter: typeof TextFieldCounter;
|
|
516
|
+
Description: typeof TextFieldDescription;
|
|
517
|
+
Error: typeof TextFieldError;
|
|
518
|
+
Icon: typeof TextFieldIcon;
|
|
519
|
+
Input: typeof TextFieldInput;
|
|
520
|
+
InputGroup: typeof TextFieldInputGroup;
|
|
521
|
+
Label: typeof TextFieldLabel;
|
|
522
|
+
};
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/components/Input/Input.d.ts
|
|
525
|
+
/**
|
|
526
|
+
* `Input` is the **default text-field component**. Reach for it first.
|
|
527
|
+
*
|
|
528
|
+
* It composes the `TextField` parts (`Label`, `Input`, `Description`,
|
|
529
|
+
* `Error`, `Counter`) into the standard layout and wires the standard
|
|
530
|
+
* accessibility behavior, so the common case is one element with flat
|
|
531
|
+
* props:
|
|
532
|
+
*
|
|
533
|
+
* <Input label="Email" description="Work email only" errorMessage={err} />
|
|
534
|
+
*
|
|
535
|
+
* Drop down to `<TextField>` (the compound API) only when you need
|
|
536
|
+
* something the flat API cannot express — e.g. an icon inside the input
|
|
537
|
+
* via `<TextField.InputGroup>` + `<TextField.Icon>`, or a custom layout
|
|
538
|
+
* around the label and footer.
|
|
539
|
+
*/
|
|
540
|
+
type InputProps = Omit<VuiTextFieldProps, "children"> & {
|
|
541
|
+
description?: ReactNode;
|
|
542
|
+
errorMessage?: ReactNode;
|
|
543
|
+
label?: ReactNode;
|
|
544
|
+
placeholder?: string;
|
|
545
|
+
};
|
|
546
|
+
declare function Input({
|
|
547
|
+
description,
|
|
548
|
+
errorMessage,
|
|
549
|
+
isInvalid,
|
|
550
|
+
label,
|
|
551
|
+
placeholder,
|
|
552
|
+
showCount,
|
|
553
|
+
...props
|
|
554
|
+
}: InputProps): _$react_jsx_runtime0.JSX.Element;
|
|
555
|
+
//#endregion
|
|
556
|
+
//#region src/icons/index.d.ts
|
|
557
|
+
/**
|
|
558
|
+
* Central place for all VUI icons.
|
|
559
|
+
*
|
|
560
|
+
* Conventions:
|
|
561
|
+
* - All icons accept standard SVG props so consumers can size / color via
|
|
562
|
+
* `width`, `height`, `className`, or override `fill` / `stroke`.
|
|
563
|
+
* - Default size is `1em` so the icon scales with the surrounding text /
|
|
564
|
+
* button by default. Components that want a fixed size pass `width` /
|
|
565
|
+
* `height` explicitly.
|
|
566
|
+
* - Icons are purely decorative by default (`aria-hidden="true"`).
|
|
567
|
+
* When used as the *only* content of an interactive element, the parent
|
|
568
|
+
* is responsible for providing `aria-label`.
|
|
569
|
+
*/
|
|
570
|
+
type VuiIconProps = SVGProps<SVGSVGElement>;
|
|
571
|
+
declare function CheckCircleIcon(props: VuiIconProps): _$react_jsx_runtime0.JSX.Element;
|
|
572
|
+
declare function WarningTriangleIcon(props: VuiIconProps): _$react_jsx_runtime0.JSX.Element;
|
|
573
|
+
declare function InfoCircleIcon(props: VuiIconProps): _$react_jsx_runtime0.JSX.Element;
|
|
574
|
+
declare function TimesIcon(props: VuiIconProps): _$react_jsx_runtime0.JSX.Element;
|
|
575
|
+
declare function ArrowLeftIcon(props: VuiIconProps): _$react_jsx_runtime0.JSX.Element;
|
|
576
|
+
declare function ArrowRightIcon(props: VuiIconProps): _$react_jsx_runtime0.JSX.Element;
|
|
577
|
+
/**
|
|
578
|
+
* Indeterminate spinner. Animation is applied via the `vui-spin` class
|
|
579
|
+
* (defined in `styles.css`) rather than inline keyframes so callers can
|
|
580
|
+
* opt out of motion with `prefers-reduced-motion` or scope-level CSS.
|
|
581
|
+
*/
|
|
582
|
+
declare function SpinnerIcon(props: VuiIconProps): _$react_jsx_runtime0.JSX.Element;
|
|
583
|
+
//#endregion
|
|
584
|
+
export { ArrowLeftIcon, ArrowRightIcon, BackButton, type BackButtonProps, BannerNotification, type BannerNotificationProps, Button, CheckCircleIcon, DismissButton, type DismissButtonProps, IconButton, InfoCircleIcon, Input, type InputProps, Notification, type NotificationActionObject, type NotificationActionProps, type NotificationActionsProps, type NotificationAlign, type NotificationBodyProps, type NotificationContentProps, type NotificationDismissProps, type NotificationIconProps, type NotificationIntent, type NotificationProps, type NotificationRole, type NotificationTitleElement, type NotificationTitleProps, type NotificationVariant, SpinnerIcon, TextField, type TextFieldContextValue, type TextFieldCounterProps, type TextFieldDescriptionProps, type TextFieldErrorProps, type TextFieldIconProps, type TextFieldInputGroupProps, type TextFieldInputProps, type TextFieldIntent, type TextFieldLabelProps, type TextFieldSize, TimesIcon, type VuiButtonProps, type VuiIconButtonProps, VuiIconProps, type VuiTextFieldProps, WarningTriangleIcon };
|