@bmsuisse/ui 0.18.0 → 0.20.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/CATALOG.md +101 -0
- package/dist/index.d.ts +197 -8
- package/dist/index.js +808 -78
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/CATALOG.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# @bmsuisse/ui catalog
|
|
2
|
+
|
|
3
|
+
One line per export: what it is and when to reach for it. Written for coding
|
|
4
|
+
agents and people in consuming apps: **check here before building a local
|
|
5
|
+
component** — if it's listed, import it from `@bmsuisse/ui` instead.
|
|
6
|
+
|
|
7
|
+
Shipped in the npm package (`node_modules/@bmsuisse/ui/CATALOG.md`). Every
|
|
8
|
+
runtime export of `src/index.ts` must appear here; `tests/catalog.test.ts`
|
|
9
|
+
fails otherwise. Longer docs and examples: `docs-site/docs/ui/` and the
|
|
10
|
+
repo's `AGENTS.md`.
|
|
11
|
+
|
|
12
|
+
## Primitives (shadcn/ui on Radix)
|
|
13
|
+
|
|
14
|
+
| Export | Use for |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `Button`, `buttonVariants` | Every button. Variants `default` `secondary` `outline` `ghost` `destructive` `link` `ai*`; sizes `xs` `sm` `default` `lg` `icon*`. |
|
|
17
|
+
| `Input` | Single-line text input. For dates use `DateInput`; for search use `SearchBar`. |
|
|
18
|
+
| `Textarea` | Multi-line text. |
|
|
19
|
+
| `Label` | Form label. Prefer `FormField`, which wires label + error + ids. |
|
|
20
|
+
| `Checkbox`, `Switch` | Boolean inputs. |
|
|
21
|
+
| `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectTrigger`, `SelectValue` | Short fixed option list without search. With search use `Combobox`. |
|
|
22
|
+
| `Card`, `CardHeader`, `CardTitle`, `CardDescription`, `CardContent`, `CardFooter` | Bordered content block. |
|
|
23
|
+
| `Badge`, `badgeVariants` | Small label. For statuses use `StatusBadge`. |
|
|
24
|
+
| `Dialog`, `DialogTrigger`, `DialogContent`, `DialogHeader`, `DialogTitle`, `DialogDescription`, `DialogBody`, `DialogFooter` | Low-level dialog. Usually use `Modal` / `FormModal` / `ConfirmDialog` / `ResponsivePanel` instead. |
|
|
25
|
+
| `Sheet`, `SheetTrigger`, `SheetContent`, `SheetHeader`, `SheetTitle`, `SheetDescription`, `SheetBody`, `SheetFooter`, `SheetClose`, `SheetPortal`, `sheetVariants` | Side or bottom drawer. |
|
|
26
|
+
| `Popover`, `PopoverTrigger`, `PopoverContent`, `PopoverAnchor` | Floating panel anchored to a trigger. |
|
|
27
|
+
| `Tooltip`, `TooltipTrigger`, `TooltipContent`, `TooltipProvider` | Hover/focus hint text. |
|
|
28
|
+
| `DropdownMenu`, `DropdownMenuTrigger`, `DropdownMenuContent`, `DropdownMenuItem`, `DropdownMenuCheckboxItem`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuLabel`, `DropdownMenuSeparator`, `DropdownMenuShortcut`, `DropdownMenuGroup`, `DropdownMenuPortal`, `DropdownMenuSub`, `DropdownMenuSubTrigger`, `DropdownMenuSubContent` | Action menus ("⋯" menus, row actions). |
|
|
29
|
+
| `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` | Switching between views of one page. |
|
|
30
|
+
| `Table`, `TableHeader`, `TableBody`, `TableFooter`, `TableRow`, `TableHead`, `TableCell`, `TableCaption` | Static HTML table. For sorting/filtering/paging data use `@bmsuisse/datagrid`. |
|
|
31
|
+
| `Separator` | Horizontal/vertical rule. |
|
|
32
|
+
| `ScrollArea`, `ScrollBar` | Styled scroll container. |
|
|
33
|
+
| `Skeleton` | Loading placeholder block. |
|
|
34
|
+
|
|
35
|
+
## Dialogs
|
|
36
|
+
|
|
37
|
+
| Export | Use for |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `Modal` | Generic dialog: title, description, body, footer. |
|
|
40
|
+
| `FormModal` | Dialog wrapping a form; does **not** auto-close on submit (server validation). |
|
|
41
|
+
| `ConfirmDialog` | "Are you sure?"; closes itself after a successful confirm. |
|
|
42
|
+
| `QuestionDialog` | Question with several actions + Cancel ("Save changes before closing?"). |
|
|
43
|
+
| `DialogActions` | Buttons in the platform's order (Cancel right on Windows, left elsewhere). |
|
|
44
|
+
| `ResponsivePanel` | Large dialog on desktop, bottom sheet on phones. Prefer over `Modal` for long forms/lists. |
|
|
45
|
+
|
|
46
|
+
## Forms and inputs
|
|
47
|
+
|
|
48
|
+
| Export | Use for |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `FormField` | Label + control + error/description with ids wired. Wrap every form control. |
|
|
51
|
+
| `DateInput`, `defaultDateInputLabels` | Day field in the app locale (dd.mm.yyyy), ISO value, `min`/`max`, calendar button, native `<input type="date">` on touch devices. Instead of `<input type="date">`. |
|
|
52
|
+
| `parseIsoDay`, `formatIsoDay`, `shiftIsoDay`, `datePlaceholder`, `toLocalIsoDay` | Date helpers. `toLocalIsoDay(new Date())` instead of `toISOString().slice(0, 10)` (UTC day bug). |
|
|
53
|
+
| `Combobox` | Searchable dropdown, single or `multiple`. |
|
|
54
|
+
| `TagCombobox` | Multi-select with chips inline in the field. |
|
|
55
|
+
| `ButtonGroup` | Connected single-select segment buttons. |
|
|
56
|
+
| `SearchBar` | Pill search input with clear button; caller renders results. |
|
|
57
|
+
| `SearchPanel`, `SearchTrigger` | Bordered search card with mode pills; icon button that opens a search overlay. |
|
|
58
|
+
| `Stepper` | Numbered wizard progress. |
|
|
59
|
+
|
|
60
|
+
## Feedback and states
|
|
61
|
+
|
|
62
|
+
| Export | Use for |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| `AsyncBoundary` | Loading → error → empty → content switch for fetched data. Start here for any query-backed view. |
|
|
65
|
+
| `EmptyState` | "Nothing here" with icon, title, description, action. |
|
|
66
|
+
| `FilteredEmptyState`, `defaultFilteredEmptyStateLabels` | "No results" with a Reset filters button. |
|
|
67
|
+
| `ErrorState`, `InlineError`, `defaultErrorStateLabels`, `toErrorInfo` | Load failure: block or one-line, with Retry. |
|
|
68
|
+
| `LoadingState`, `RefreshBar`, `useDelayedFlag` | Initial-load placeholder; thin bar for refetch; delay flag to avoid spinner flash. |
|
|
69
|
+
| `LoadingSpinner`, `LoadingOverlay`, `loadingSpinnerIconVariants` | Inline spinner; centered overlay spinner. |
|
|
70
|
+
| `toast`, `Toaster`, `defaultToasterLabels`, `MAX_TOASTS`, `resetToasts` | Brief notices (`toast.success("Saved")`). Mount `<Toaster />` once. `resetToasts()` clears the queue between tests. |
|
|
71
|
+
| `AlertBox` | Inline error/warning/info/success banner. |
|
|
72
|
+
| `StatusBadge` | Status string → colored badge. |
|
|
73
|
+
|
|
74
|
+
## Data display
|
|
75
|
+
|
|
76
|
+
| Export | Use for |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `KpiCard`, `Sparkline`, `DonutChart` | KPI tile with trend sparkline or donut. |
|
|
79
|
+
|
|
80
|
+
## Navigation and shell
|
|
81
|
+
|
|
82
|
+
| Export | Use for |
|
|
83
|
+
| --- | --- |
|
|
84
|
+
| `Sidebar`, `SidebarNav`, `NavGroup`, `NavItem`, `useSidebarCollapsed` | App left navigation, resizable and rail-collapsible. |
|
|
85
|
+
| `AnimatedBrand`, `BRAND_ANIMATIONS` | One* product wordmark with optional intro animation. |
|
|
86
|
+
|
|
87
|
+
## AI
|
|
88
|
+
|
|
89
|
+
| Export | Use for |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| `AiButton` | "Do it with AI" button with in-flight state. |
|
|
92
|
+
| `AiExplainButton` | Sparkle button that opens a popover with a lazily generated explanation. |
|
|
93
|
+
| `VoiceInputButton`, `VoiceTranscript`, `useSpeechRecognition`, `describeSpeechError` | Dictation button; dictate-then-rewrite workflow; the hook underneath. |
|
|
94
|
+
|
|
95
|
+
## Utilities
|
|
96
|
+
|
|
97
|
+
| Export | Use for |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| `cn` | `clsx` + `tailwind-merge` class joiner. |
|
|
100
|
+
| `useMediaQuery` | Reactive media query. |
|
|
101
|
+
| `getConfirmButtonPlacement`, `isWindowsPlatform` | Platform-dependent button order. |
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ButtonHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes, ReactElement, ComponentPropsWithoutRef, TdHTMLAttributes, ThHTMLAttributes, ReactNode, ComponentProps, ComponentType, Ref, ElementType, CSSProperties } from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes, ReactElement, ComponentPropsWithoutRef, TdHTMLAttributes, ThHTMLAttributes, ReactNode, ComponentProps, ComponentType, Ref, ElementType, SVGProps, CSSProperties } from 'react';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -1236,8 +1236,8 @@ interface StepperStep {
|
|
|
1236
1236
|
n: number;
|
|
1237
1237
|
/** Visible label under the chip. */
|
|
1238
1238
|
label: string;
|
|
1239
|
-
/** Small uppercase caption under the label (e.g. a phase/section name). */
|
|
1240
|
-
phase
|
|
1239
|
+
/** Small uppercase caption under the label (e.g. a phase/section name). Omit to render no caption. */
|
|
1240
|
+
phase?: string;
|
|
1241
1241
|
}
|
|
1242
1242
|
interface StepperProps {
|
|
1243
1243
|
/** The current step number (1-based, matches a `StepperStep.n`). */
|
|
@@ -1258,11 +1258,21 @@ interface StepperProps {
|
|
|
1258
1258
|
scrollTestId?: string;
|
|
1259
1259
|
/** `data-testid` for the trailing `onNew` button, when rendered. */
|
|
1260
1260
|
newTestId?: string;
|
|
1261
|
+
/**
|
|
1262
|
+
* Minimum width of the steps track; below it the track scrolls horizontally instead of
|
|
1263
|
+
* shrinking further (a number is px, a string is any CSS length, e.g. `"40rem"`). By default
|
|
1264
|
+
* the track has no fixed minimum: it fills the available width and only scrolls once the
|
|
1265
|
+
* chips themselves no longer fit. Set it to give the chips more room than their own content.
|
|
1266
|
+
*/
|
|
1267
|
+
minWidth?: number | string;
|
|
1268
|
+
/** Extra classes for the root element (e.g. to constrain or centre the stepper). */
|
|
1269
|
+
className?: string;
|
|
1261
1270
|
}
|
|
1262
1271
|
/**
|
|
1263
|
-
* Numbered-chip wizard progress indicator: a
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1272
|
+
* Numbered-chip wizard progress indicator: a row of step chips
|
|
1273
|
+
* (done/active/upcoming, connected by a line that fills in as steps complete)
|
|
1274
|
+
* that scrolls horizontally only when the chips don't fit, plus an optional
|
|
1275
|
+
* trailing "start over" button. Replaces
|
|
1266
1276
|
* the same shape hand-rolled independently by more than one multi-step
|
|
1267
1277
|
* wizard.
|
|
1268
1278
|
*
|
|
@@ -1274,7 +1284,186 @@ interface StepperProps {
|
|
|
1274
1284
|
* that needs a one-off extra chip should compose its own around this
|
|
1275
1285
|
* component instead.
|
|
1276
1286
|
*/
|
|
1277
|
-
declare function Stepper({ step, maxStep, onNavigate, onNew, steps, navLabel, newLabel, scrollTestId, newTestId, }: StepperProps): react.JSX.Element;
|
|
1287
|
+
declare function Stepper({ step, maxStep, onNavigate, onNew, steps, navLabel, newLabel, scrollTestId, newTestId, minWidth, className, }: StepperProps): react.JSX.Element;
|
|
1288
|
+
|
|
1289
|
+
interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1290
|
+
title: ReactNode;
|
|
1291
|
+
/** Secondary line under the title: why it's empty or what to do next. */
|
|
1292
|
+
description?: ReactNode;
|
|
1293
|
+
/** Heroicon-style component shown in a muted round tile above the title. Omit for text only. */
|
|
1294
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
1295
|
+
/** A reset-filters or "New …" button rendered under the text. */
|
|
1296
|
+
action?: ReactNode;
|
|
1297
|
+
/** `md` (default) for a whole panel or list; `sm` for an empty card section ("no tasks"). */
|
|
1298
|
+
size?: "sm" | "md";
|
|
1299
|
+
/** Grow to fill a flex parent and center vertically in it. */
|
|
1300
|
+
fill?: boolean;
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* "Nothing here" placeholder: optional icon, title, description and action.
|
|
1304
|
+
* Use it for a list, table or panel with no data; use `ErrorState` when loading failed
|
|
1305
|
+
* and `FilteredEmptyState` when filters hide every row.
|
|
1306
|
+
*/
|
|
1307
|
+
declare const EmptyState: ({ title, description, icon: Icon, action, size, fill, className, ...props }: EmptyStateProps) => ReactElement;
|
|
1308
|
+
interface FilteredEmptyStateLabels {
|
|
1309
|
+
title: string;
|
|
1310
|
+
description: string;
|
|
1311
|
+
reset: string;
|
|
1312
|
+
}
|
|
1313
|
+
declare const defaultFilteredEmptyStateLabels: FilteredEmptyStateLabels;
|
|
1314
|
+
interface FilteredEmptyStateProps extends Omit<EmptyStateProps, "title" | "description" | "action"> {
|
|
1315
|
+
/** Clears search and filters. */
|
|
1316
|
+
onReset: () => void;
|
|
1317
|
+
labels?: Partial<FilteredEmptyStateLabels>;
|
|
1318
|
+
}
|
|
1319
|
+
/** Empty state for a filtered list or table: says nothing matches and offers a way back with a Reset button. */
|
|
1320
|
+
declare const FilteredEmptyState: ({ onReset, labels, icon, size, ...props }: FilteredEmptyStateProps) => ReactElement;
|
|
1321
|
+
|
|
1322
|
+
type ToastTone = "info" | "success" | "warning" | "error";
|
|
1323
|
+
interface ToastAction {
|
|
1324
|
+
label: string;
|
|
1325
|
+
onClick: () => void;
|
|
1326
|
+
}
|
|
1327
|
+
interface ToastOptions {
|
|
1328
|
+
/** Short secondary line under the message. */
|
|
1329
|
+
description?: string;
|
|
1330
|
+
tone?: ToastTone;
|
|
1331
|
+
/** One inline button, e.g. "Undo". Clicking it also dismisses the toast. */
|
|
1332
|
+
action?: ToastAction;
|
|
1333
|
+
/** Milliseconds before it hides. Falls back to the `<Toaster duration>` default (4000; errors 8000). `Infinity` keeps it until dismissed. */
|
|
1334
|
+
duration?: number;
|
|
1335
|
+
}
|
|
1336
|
+
interface ToastItem {
|
|
1337
|
+
id: number;
|
|
1338
|
+
message: string;
|
|
1339
|
+
description?: string;
|
|
1340
|
+
tone: ToastTone;
|
|
1341
|
+
action?: ToastAction;
|
|
1342
|
+
/** Set only when the caller passed one; otherwise `<Toaster>` resolves it from its own default. */
|
|
1343
|
+
duration?: number;
|
|
1344
|
+
/** Dismissed and playing its exit transition before removal. */
|
|
1345
|
+
leaving: boolean;
|
|
1346
|
+
}
|
|
1347
|
+
/** Toasts kept at once; showing a 4th drops the oldest. */
|
|
1348
|
+
declare const MAX_TOASTS = 3;
|
|
1349
|
+
/** Starts the exit transition of one toast, or of every toast when `id` is omitted. */
|
|
1350
|
+
declare function dismissToast(id?: number): void;
|
|
1351
|
+
declare function show(message: string, options?: ToastOptions): number;
|
|
1352
|
+
type ToneOptions = Omit<ToastOptions, "tone">;
|
|
1353
|
+
/**
|
|
1354
|
+
* Show a brief, non-blocking notice. Needs one `<Toaster />` mounted in the app;
|
|
1355
|
+
* the countdown runs in the rendered toast, so a toast queued while no Toaster
|
|
1356
|
+
* is mounted waits until one is.
|
|
1357
|
+
* Returns the toast id for `toast.dismiss(id)`.
|
|
1358
|
+
*/
|
|
1359
|
+
declare const toast: typeof show & {
|
|
1360
|
+
info: (message: string, options?: ToneOptions) => number;
|
|
1361
|
+
success: (message: string, options?: ToneOptions) => number;
|
|
1362
|
+
warning: (message: string, options?: ToneOptions) => number;
|
|
1363
|
+
error: (message: string, options?: ToneOptions) => number;
|
|
1364
|
+
dismiss: typeof dismissToast;
|
|
1365
|
+
};
|
|
1366
|
+
/** Test helper: drop every toast immediately. */
|
|
1367
|
+
declare function resetToasts(): void;
|
|
1368
|
+
|
|
1369
|
+
type ToasterPosition = "bottom-center" | "bottom-left" | "bottom-right" | "top-center" | "top-left" | "top-right";
|
|
1370
|
+
interface ToasterLabels {
|
|
1371
|
+
/** Accessible name of the toast region. */
|
|
1372
|
+
region: string;
|
|
1373
|
+
dismiss: string;
|
|
1374
|
+
}
|
|
1375
|
+
declare const defaultToasterLabels: ToasterLabels;
|
|
1376
|
+
interface ToasterProps {
|
|
1377
|
+
/** Where the stack sits. Defaults to `bottom-center`. */
|
|
1378
|
+
position?: ToasterPosition;
|
|
1379
|
+
/** Default lifetime in ms for toasts that don't pass their own `duration`: one number for all tones, or per tone
|
|
1380
|
+
* (`{ error: 12000 }`; missing tones keep their default of 4000, errors 8000). `Infinity` keeps toasts until dismissed. */
|
|
1381
|
+
duration?: number | Partial<Record<ToastTone, number>>;
|
|
1382
|
+
labels?: Partial<ToasterLabels>;
|
|
1383
|
+
className?: string;
|
|
1384
|
+
}
|
|
1385
|
+
/**
|
|
1386
|
+
* Renders the toasts queued with `toast(...)`. Mount once near the app root.
|
|
1387
|
+
* Each toast fades in, shows the time it has left as a thin bar, pauses while
|
|
1388
|
+
* hovered or focused, and fades out on dismiss. No CSS or animation plugin needed.
|
|
1389
|
+
*/
|
|
1390
|
+
declare const Toaster: ({ position, duration, labels, className }: ToasterProps) => ReactElement;
|
|
1391
|
+
|
|
1392
|
+
/** Why the typed text was rejected: it is no date (`invalid`), or a real date outside `min`/`max` (`range`). */
|
|
1393
|
+
type DateInputError = "invalid" | "range";
|
|
1394
|
+
interface DateInputLabels {
|
|
1395
|
+
/** Message for text that is no date. */
|
|
1396
|
+
invalid: string;
|
|
1397
|
+
/** Message for a date before `min` or after `max`. */
|
|
1398
|
+
outOfRange: string;
|
|
1399
|
+
/** Accessible name of the calendar button. */
|
|
1400
|
+
openCalendar: string;
|
|
1401
|
+
}
|
|
1402
|
+
declare const defaultDateInputLabels: DateInputLabels;
|
|
1403
|
+
interface DateInputProps extends Omit<InputProps, "value" | "defaultValue" | "onChange" | "type" | "min" | "max"> {
|
|
1404
|
+
/** ISO day `yyyy-mm-dd` (the date part of an ISO datetime is accepted too), or `""` for none. */
|
|
1405
|
+
value: string;
|
|
1406
|
+
/** Called with an ISO day (or `""` when cleared). Only real dates within `min`/`max` get here. */
|
|
1407
|
+
onValueChange: (iso: string) => void;
|
|
1408
|
+
/** Called when the field becomes (in)valid, so a form can block submit while it holds a non-date. `reason` is set when `invalid` is true. */
|
|
1409
|
+
onInvalidChange?: (invalid: boolean, reason?: DateInputError) => void;
|
|
1410
|
+
/** Display and parse order of the typed field. Default `de-CH` (dd.mm.yyyy). Ignored by the native control, which follows the device. */
|
|
1411
|
+
locale?: string;
|
|
1412
|
+
/** Earliest allowed ISO day. Typed dates before it are rejected; the calendar greys them out. */
|
|
1413
|
+
min?: string;
|
|
1414
|
+
/** Latest allowed ISO day. Typed dates after it are rejected; the calendar greys them out. */
|
|
1415
|
+
max?: string;
|
|
1416
|
+
/** Shows the error text under the field when the entry is rejected. Turn off to render it yourself (e.g. via `onInvalidChange`). Default `true`. */
|
|
1417
|
+
showError?: boolean;
|
|
1418
|
+
/** Translations for the error messages and the calendar button. */
|
|
1419
|
+
labels?: Partial<DateInputLabels>;
|
|
1420
|
+
/**
|
|
1421
|
+
* `auto` (default) uses the browser's own `<input type="date">` on touch devices
|
|
1422
|
+
* (`pointer: coarse`), where its wheel/calendar is far better than a typed field, and
|
|
1423
|
+
* the typed `locale` field elsewhere. `always` / `never` force one of them.
|
|
1424
|
+
*/
|
|
1425
|
+
native?: "auto" | "always" | "never";
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
/**
|
|
1429
|
+
* Day field that shows and reads the app's locale (dd.mm.yyyy in de-CH) instead of
|
|
1430
|
+
* the browser's own `type="date"` format. The value is an ISO day. Text is committed
|
|
1431
|
+
* on blur or Enter. The calendar button opens the browser's own date picker
|
|
1432
|
+
* (`showPicker()`), restricted to `min`/`max`; the picker itself uses the browser's
|
|
1433
|
+
* language, not `locale`.
|
|
1434
|
+
*
|
|
1435
|
+
* Only real dates within `min`/`max` reach `onValueChange`. Rejected text keeps the
|
|
1436
|
+
* previous value, marks the field `aria-invalid` with an error message, and sets
|
|
1437
|
+
* the field's native validity, so a surrounding `<form>` refuses to submit while it
|
|
1438
|
+
* holds text that is no date. With `name`, a hidden input submits the ISO day.
|
|
1439
|
+
*/
|
|
1440
|
+
declare const DateInput: react.ForwardRefExoticComponent<DateInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
1441
|
+
|
|
1442
|
+
/** "dd.mm.yyyy" for de-CH, "mm/dd/yyyy" for en-US. */
|
|
1443
|
+
declare function datePlaceholder(locale: string): string;
|
|
1444
|
+
/** An ISO day (or the date part of an ISO datetime) as the field shows it; empty string for anything else. */
|
|
1445
|
+
declare function formatIsoDay(iso: string, locale: string): string;
|
|
1446
|
+
/**
|
|
1447
|
+
* Typed text -> ISO day, or null when it isn't a real date. Accepts the
|
|
1448
|
+
* locale's order, two-digit years (`3.2.26` -> 2026, `1.2.99` -> 1999), any run
|
|
1449
|
+
* of `. / -` or spaces as separator (`3. 2. 2026`), bare digits (`03022026`,
|
|
1450
|
+
* `030226`), ISO days and ISO datetimes (date part only).
|
|
1451
|
+
*/
|
|
1452
|
+
declare function parseIsoDay(text: string, locale: string): string | null;
|
|
1453
|
+
/**
|
|
1454
|
+
* Local calendar day as ISO. Not `d.toISOString().slice(0, 10)`: that is the
|
|
1455
|
+
* UTC day, which in Swiss time is still "yesterday" after 22:00/23:00.
|
|
1456
|
+
*/
|
|
1457
|
+
declare function toLocalIsoDay(d: Date): string;
|
|
1458
|
+
/**
|
|
1459
|
+
* Moves an ISO day by whole months (the day of month is kept, or clamped to the
|
|
1460
|
+
* month's last day: Jan 31 + 1 month = Feb 28/29) and then by days. Returns the
|
|
1461
|
+
* input unchanged when it isn't an ISO day or the result leaves years 1000-9999.
|
|
1462
|
+
*/
|
|
1463
|
+
declare function shiftIsoDay(iso: string, by: {
|
|
1464
|
+
days?: number;
|
|
1465
|
+
months?: number;
|
|
1466
|
+
}): string;
|
|
1278
1467
|
|
|
1279
1468
|
/** Merges conditional class names, then dedupes conflicting Tailwind utility classes. */
|
|
1280
1469
|
declare function cn(...inputs: ClassValue[]): string;
|
|
@@ -1353,4 +1542,4 @@ interface AnimatedBrandProps {
|
|
|
1353
1542
|
/** A static accessible brand with an optional finite, reduced-motion-aware introduction. */
|
|
1354
1543
|
declare function AnimatedBrand({ product, dotColor, textColor, oneColor, productColor, ringColor, mode, animation, size, autoPlay, replayKey, onComplete, className, style, }: AnimatedBrandProps): ReactElement;
|
|
1355
1544
|
|
|
1356
|
-
export { AiButton, type AiButtonProps, type AiButtonVariant, AiExplainButton, type AiExplainButtonProps, AlertBox, type AlertBoxProps, type AlertBoxVariant, AnimatedBrand, type AnimatedBrandProps, AsyncBoundary, type AsyncBoundaryProps, BRAND_ANIMATIONS, Badge, type BadgeProps, type BrandAnimation, type BrandMode, Button, ButtonGroup, type ButtonGroupOption, type ButtonGroupProps, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, type GridColumn as ComboboxColumn, type ComboboxMultiProps, type ComboboxOption, type ComboboxProps, type ComboboxSingleProps, type ConfirmButtonPlacement, ConfirmDialog, type ConfirmDialogProps, Dialog, DialogActions, type DialogActionsProps, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DonutChart, type DonutSegment, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ErrorInfo, type ErrorInput, ErrorState, type ErrorStateLabels, type ErrorStateProps, FormField, type FormFieldProps, FormModal, type FormModalProps, InlineError, type InlineErrorProps, Input, type InputProps, KpiCard, type KpiCardProps, Label, LoadingOverlay, type LoadingOverlayProps, LoadingSpinner, type LoadingSpinnerProps, LoadingState, type LoadingStateProps, Modal, type ModalProps, NavGroup, type NavGroupProps, type NavIconProps, NavItem, type NavItemProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, QuestionDialog, type QuestionDialogAction, type QuestionDialogProps, RefreshBar, ResponsivePanel, type ResponsivePanelProps, type ResponsivePanelSize, ScrollArea, ScrollBar, SearchBar, type SearchBarProps, SearchPanel, type SearchPanelMode, type SearchPanelProps, SearchTrigger, type SearchTriggerProps, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarNav, type SidebarNavProps, type SidebarProps, Skeleton, Sparkline, type SpeechRecognitionEngine, type SpeechRecognitionEngineFactory, type SpeechRecognitionState, StatusBadge, type StatusBadgeProps, type StatusTone, Stepper, type StepperProps, type StepperStep, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagCombobox, type TagComboboxOption, type TagComboboxProps, Textarea, type TextareaProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseSpeechRecognitionOptions, VoiceInputButton, type VoiceInputButtonProps, VoiceTranscript, type VoiceTranscriptProps, badgeVariants, buttonVariants, cn, defaultErrorStateLabels, describeSpeechError, getConfirmButtonPlacement, isWindowsPlatform, loadingSpinnerIconVariants, sheetVariants, toErrorInfo, useDelayedFlag, useMediaQuery, useSidebarCollapsed, useSpeechRecognition };
|
|
1545
|
+
export { AiButton, type AiButtonProps, type AiButtonVariant, AiExplainButton, type AiExplainButtonProps, AlertBox, type AlertBoxProps, type AlertBoxVariant, AnimatedBrand, type AnimatedBrandProps, AsyncBoundary, type AsyncBoundaryProps, BRAND_ANIMATIONS, Badge, type BadgeProps, type BrandAnimation, type BrandMode, Button, ButtonGroup, type ButtonGroupOption, type ButtonGroupProps, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, type GridColumn as ComboboxColumn, type ComboboxMultiProps, type ComboboxOption, type ComboboxProps, type ComboboxSingleProps, type ConfirmButtonPlacement, ConfirmDialog, type ConfirmDialogProps, DateInput, type DateInputError, type DateInputLabels, type DateInputProps, Dialog, DialogActions, type DialogActionsProps, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DonutChart, type DonutSegment, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, type ErrorInfo, type ErrorInput, ErrorState, type ErrorStateLabels, type ErrorStateProps, FilteredEmptyState, type FilteredEmptyStateLabels, type FilteredEmptyStateProps, FormField, type FormFieldProps, FormModal, type FormModalProps, InlineError, type InlineErrorProps, Input, type InputProps, KpiCard, type KpiCardProps, Label, LoadingOverlay, type LoadingOverlayProps, LoadingSpinner, type LoadingSpinnerProps, LoadingState, type LoadingStateProps, MAX_TOASTS, Modal, type ModalProps, NavGroup, type NavGroupProps, type NavIconProps, NavItem, type NavItemProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, QuestionDialog, type QuestionDialogAction, type QuestionDialogProps, RefreshBar, ResponsivePanel, type ResponsivePanelProps, type ResponsivePanelSize, ScrollArea, ScrollBar, SearchBar, type SearchBarProps, SearchPanel, type SearchPanelMode, type SearchPanelProps, SearchTrigger, type SearchTriggerProps, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarNav, type SidebarNavProps, type SidebarProps, Skeleton, Sparkline, type SpeechRecognitionEngine, type SpeechRecognitionEngineFactory, type SpeechRecognitionState, StatusBadge, type StatusBadgeProps, type StatusTone, Stepper, type StepperProps, type StepperStep, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagCombobox, type TagComboboxOption, type TagComboboxProps, Textarea, type TextareaProps, type ToastAction, type ToastItem, type ToastOptions, type ToastTone, Toaster, type ToasterLabels, type ToasterPosition, type ToasterProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseSpeechRecognitionOptions, VoiceInputButton, type VoiceInputButtonProps, VoiceTranscript, type VoiceTranscriptProps, badgeVariants, buttonVariants, cn, datePlaceholder, defaultDateInputLabels, defaultErrorStateLabels, defaultFilteredEmptyStateLabels, defaultToasterLabels, describeSpeechError, formatIsoDay, getConfirmButtonPlacement, isWindowsPlatform, loadingSpinnerIconVariants, parseIsoDay, resetToasts, sheetVariants, shiftIsoDay, toErrorInfo, toLocalIsoDay, toast, useDelayedFlag, useMediaQuery, useSidebarCollapsed, useSpeechRecognition };
|