@twentyfirstmedia/ui-core 0.5.0 → 0.6.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.
Files changed (148) hide show
  1. package/dist/components/admin.d.ts.map +1 -1
  2. package/dist/components/admin.js +31 -21
  3. package/dist/components/admin.js.map +1 -1
  4. package/dist/components/agents.d.ts.map +1 -1
  5. package/dist/components/agents.js +21 -18
  6. package/dist/components/agents.js.map +1 -1
  7. package/dist/components/app-chrome.d.ts.map +1 -1
  8. package/dist/components/app-chrome.js +5 -5
  9. package/dist/components/app-chrome.js.map +1 -1
  10. package/dist/components/approvals.d.ts.map +1 -1
  11. package/dist/components/approvals.js +2 -2
  12. package/dist/components/approvals.js.map +1 -1
  13. package/dist/components/building-blocks.d.ts.map +1 -1
  14. package/dist/components/building-blocks.js +13 -10
  15. package/dist/components/building-blocks.js.map +1 -1
  16. package/dist/components/charts.d.ts +2 -2
  17. package/dist/components/charts.d.ts.map +1 -1
  18. package/dist/components/charts.js +14 -11
  19. package/dist/components/charts.js.map +1 -1
  20. package/dist/components/chat.d.ts +2 -2
  21. package/dist/components/chat.d.ts.map +1 -1
  22. package/dist/components/chat.js +22 -18
  23. package/dist/components/chat.js.map +1 -1
  24. package/dist/components/commerce.d.ts.map +1 -1
  25. package/dist/components/commerce.js +20 -16
  26. package/dist/components/commerce.js.map +1 -1
  27. package/dist/components/data-display.d.ts +0 -5
  28. package/dist/components/data-display.d.ts.map +1 -1
  29. package/dist/components/data-display.js +41 -22
  30. package/dist/components/data-display.js.map +1 -1
  31. package/dist/components/data-table.d.ts +2 -2
  32. package/dist/components/data-table.d.ts.map +1 -1
  33. package/dist/components/data-table.js +3 -3
  34. package/dist/components/data-table.js.map +1 -1
  35. package/dist/components/developer.d.ts.map +1 -1
  36. package/dist/components/developer.js +7 -6
  37. package/dist/components/developer.js.map +1 -1
  38. package/dist/components/feedback.d.ts.map +1 -1
  39. package/dist/components/feedback.js +5 -4
  40. package/dist/components/feedback.js.map +1 -1
  41. package/dist/components/forms.d.ts.map +1 -1
  42. package/dist/components/forms.js +63 -21
  43. package/dist/components/forms.js.map +1 -1
  44. package/dist/components/foundation.d.ts.map +1 -1
  45. package/dist/components/foundation.js +13 -9
  46. package/dist/components/foundation.js.map +1 -1
  47. package/dist/components/index.d.ts +2 -1
  48. package/dist/components/index.d.ts.map +1 -1
  49. package/dist/components/index.js +2 -1
  50. package/dist/components/index.js.map +1 -1
  51. package/dist/components/inputs.d.ts.map +1 -1
  52. package/dist/components/inputs.js +33 -8
  53. package/dist/components/inputs.js.map +1 -1
  54. package/dist/components/mail.d.ts.map +1 -1
  55. package/dist/components/mail.js +5 -5
  56. package/dist/components/mail.js.map +1 -1
  57. package/dist/components/media.d.ts.map +1 -1
  58. package/dist/components/media.js +62 -11
  59. package/dist/components/media.js.map +1 -1
  60. package/dist/components/navigation.d.ts +3 -1
  61. package/dist/components/navigation.d.ts.map +1 -1
  62. package/dist/components/navigation.js +287 -20
  63. package/dist/components/navigation.js.map +1 -1
  64. package/dist/components/operations.d.ts.map +1 -1
  65. package/dist/components/operations.js +10 -10
  66. package/dist/components/operations.js.map +1 -1
  67. package/dist/components/overlays.d.ts.map +1 -1
  68. package/dist/components/overlays.js +2 -2
  69. package/dist/components/overlays.js.map +1 -1
  70. package/dist/components/previews.js +2 -2
  71. package/dist/components/previews.js.map +1 -1
  72. package/dist/components/primitives.js +2 -2
  73. package/dist/components/primitives.js.map +1 -1
  74. package/dist/components/qr-code.d.ts +8 -0
  75. package/dist/components/qr-code.d.ts.map +1 -0
  76. package/dist/components/qr-code.js +18 -0
  77. package/dist/components/qr-code.js.map +1 -0
  78. package/dist/components/real-estate.d.ts.map +1 -1
  79. package/dist/components/real-estate.js +5 -5
  80. package/dist/components/real-estate.js.map +1 -1
  81. package/dist/components/rich-text-editor.d.ts.map +1 -1
  82. package/dist/components/rich-text-editor.js +1 -1
  83. package/dist/components/rich-text-editor.js.map +1 -1
  84. package/dist/components/select-menu.js +1 -1
  85. package/dist/components/select-menu.js.map +1 -1
  86. package/dist/components/shell.d.ts +0 -4
  87. package/dist/components/shell.d.ts.map +1 -1
  88. package/dist/components/shell.js +100 -7
  89. package/dist/components/shell.js.map +1 -1
  90. package/dist/components/site.d.ts.map +1 -1
  91. package/dist/components/site.js +8 -6
  92. package/dist/components/site.js.map +1 -1
  93. package/dist/components/status.d.ts.map +1 -1
  94. package/dist/components/status.js +2 -2
  95. package/dist/components/status.js.map +1 -1
  96. package/dist/components/system.d.ts.map +1 -1
  97. package/dist/components/system.js +3 -2
  98. package/dist/components/system.js.map +1 -1
  99. package/dist/components/types.d.ts +257 -18
  100. package/dist/components/types.d.ts.map +1 -1
  101. package/dist/components/workspace.d.ts.map +1 -1
  102. package/dist/components/workspace.js +15 -12
  103. package/dist/components/workspace.js.map +1 -1
  104. package/dist/qr.d.ts +14 -0
  105. package/dist/qr.d.ts.map +1 -0
  106. package/dist/qr.js +298 -0
  107. package/dist/qr.js.map +1 -0
  108. package/dist/strings.d.ts +30 -4
  109. package/dist/strings.d.ts.map +1 -1
  110. package/dist/strings.js +15 -0
  111. package/dist/strings.js.map +1 -1
  112. package/dist/themes.css +2345 -176
  113. package/package.json +2 -1
  114. package/src/components/admin.tsx +66 -23
  115. package/src/components/agents.tsx +22 -20
  116. package/src/components/app-chrome.tsx +9 -5
  117. package/src/components/approvals.tsx +3 -1
  118. package/src/components/building-blocks.tsx +24 -13
  119. package/src/components/charts.tsx +17 -12
  120. package/src/components/chat.tsx +54 -31
  121. package/src/components/commerce.tsx +58 -24
  122. package/src/components/data-display.tsx +106 -38
  123. package/src/components/data-table.tsx +11 -7
  124. package/src/components/developer.tsx +15 -6
  125. package/src/components/feedback.tsx +5 -3
  126. package/src/components/forms.tsx +101 -23
  127. package/src/components/foundation.tsx +9 -5
  128. package/src/components/index.ts +10 -1
  129. package/src/components/inputs.tsx +44 -7
  130. package/src/components/mail.tsx +7 -3
  131. package/src/components/media.tsx +88 -16
  132. package/src/components/navigation.tsx +651 -71
  133. package/src/components/operations.tsx +17 -8
  134. package/src/components/overlays.tsx +7 -2
  135. package/src/components/previews.tsx +2 -2
  136. package/src/components/primitives.tsx +2 -2
  137. package/src/components/qr-code.tsx +30 -0
  138. package/src/components/real-estate.tsx +7 -4
  139. package/src/components/rich-text-editor.tsx +7 -1
  140. package/src/components/select-menu.tsx +1 -1
  141. package/src/components/shell.tsx +237 -11
  142. package/src/components/site.tsx +18 -4
  143. package/src/components/status.tsx +2 -0
  144. package/src/components/system.tsx +3 -2
  145. package/src/components/types.ts +261 -18
  146. package/src/components/workspace.tsx +37 -15
  147. package/src/qr.ts +300 -0
  148. package/src/strings.ts +56 -1
@@ -1,4 +1,4 @@
1
- import type { ChangeEvent, CSSProperties, MouseEvent, ReactNode } from "react";
1
+ import type { ChangeEvent, CSSProperties, ElementType, FocusEvent, InputHTMLAttributes, KeyboardEvent, MouseEvent, ReactNode, Ref } from "react";
2
2
  import type { IconName } from "../icons.js";
3
3
  import type { ToastOptions } from "../toast-store.js";
4
4
  import type { Surface } from "../provider.js";
@@ -131,9 +131,21 @@ export interface SearchFieldProps extends BaseProps {
131
131
  placeholder?: string;
132
132
  /** Accessible name (default: the placeholder, or "Search"). */
133
133
  label?: string;
134
+ /** The key hint, e.g. "⌘K" (hidden on touch screens). */
134
135
  shortcut?: string;
136
+ /** ⌘/Ctrl + the hint's last key (K for "⌘K") focuses the field, except while typing elsewhere. */
137
+ bindShortcut?: boolean;
135
138
  value?: string;
139
+ defaultValue?: string;
136
140
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
141
+ onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
142
+ onFocus?: (e: FocusEvent<HTMLInputElement>) => void;
143
+ onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
144
+ id?: string;
145
+ name?: string;
146
+ autoFocus?: boolean;
147
+ /** For a search with suggestions (combobox): role, aria-controls, aria-activedescendant … */
148
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
137
149
  }
138
150
  export interface CheckboxProps extends BaseProps {
139
151
  name?: string;
@@ -208,7 +220,10 @@ export interface PanelProps extends BaseProps {
208
220
  surface?: Surface;
209
221
  }
210
222
  export interface PageHeaderProps extends BaseProps {
211
- crumbs?: string[];
223
+ /** A breadcrumb above the title (see `Breadcrumb`): labels, or items with `href`/`onClick`. */
224
+ crumbs?: (string | Crumb)[];
225
+ /** The element crumb links render as, e.g. Next.js `Link`. */
226
+ crumbLinkAs?: ElementType;
212
227
  title: string;
213
228
  subtitle?: string;
214
229
  actions?: ReactNode[];
@@ -219,7 +234,8 @@ export interface NavItem {
219
234
  count?: number;
220
235
  }
221
236
  export interface TopBarProps extends BaseProps {
222
- brand?: string;
237
+ /** The product name, or a node (a logo mark with the name). */
238
+ brand?: ReactNode;
223
239
  tag?: string;
224
240
  items: NavItem[];
225
241
  active?: string;
@@ -242,6 +258,14 @@ export interface RailItem {
242
258
  export interface SideRailProps extends BaseProps {
243
259
  top?: RailItem[];
244
260
  bottom?: RailItem[];
261
+ /** Names next to the icons (controlled); every button has a tooltip while collapsed. */
262
+ expanded?: boolean;
263
+ defaultExpanded?: boolean;
264
+ onExpandedChange?: (expanded: boolean) => void;
265
+ /** A button at the foot that expands and collapses the rail. */
266
+ toggle?: boolean;
267
+ /** Accessible name of the rail (default "Tools"). */
268
+ label?: string;
245
269
  }
246
270
  export interface FloatingLayoutProps extends BaseProps {
247
271
  /** What the UI floats over, filling the layout: a map, a 3D canvas, a video, a photo. */
@@ -254,7 +278,23 @@ export interface FloatingLayoutProps extends BaseProps {
254
278
  end?: ReactNode;
255
279
  /** Bar along the bottom edge (dock, playback, a summary). */
256
280
  bottom?: ReactNode;
257
- /** Height of the layout (default 640). Below 720px of width the slots stack: top, start, end, bottom. */
281
+ /** Controls of the background (zoom, compass, locate) in the free corner above the bottom bar. */
282
+ controls?: ReactNode;
283
+ /** Source notes of the background (map attribution), under `controls`, clear of every slot. */
284
+ attribution?: ReactNode;
285
+ /** Width of the start column (default 320px) and of the end column (default 340px). */
286
+ startWidth?: number | string;
287
+ endWidth?: number | string;
288
+ /**
289
+ * Below 720px of width the end slot becomes a bottom sheet over the background, with a handle
290
+ * that expands and collapses it (default true). `false` stacks it with the others.
291
+ */
292
+ endSheet?: boolean;
293
+ /**
294
+ * Height of the layout (default 640). Below 720px of width the slots stack: top, start, end,
295
+ * bottom. The layout sets `--floating-safe-top/-start/-end/-bottom` (px) to the space its
296
+ * slots take, so map libraries can keep their own controls clear of them.
297
+ */
258
298
  height?: number | string;
259
299
  /** Glass for every surface in the slots (default) or solid surfaces. */
260
300
  surface?: Surface;
@@ -299,6 +339,11 @@ export interface TableProps extends BaseProps {
299
339
  columns: TableColumn[];
300
340
  rows: Record<string, any>[];
301
341
  animate?: boolean;
342
+ /**
343
+ * Cards instead of columns when the table's box is narrow (up to 600px): every row stacks its
344
+ * cells, each with its column label. Without it narrow tables scroll sideways.
345
+ */
346
+ stack?: boolean;
302
347
  }
303
348
  export interface ProgressProps extends BaseProps {
304
349
  value: number;
@@ -319,8 +364,21 @@ export interface EmptyStateProps extends BaseProps {
319
364
  tint?: Tint;
320
365
  action?: ReactNode;
321
366
  }
367
+ /** A breadcrumb: a plain label, or one with an address or a handler. */
368
+ export interface Crumb {
369
+ label: string;
370
+ href?: string;
371
+ onClick?: () => void;
372
+ }
322
373
  export interface BreadcrumbProps extends BaseProps {
323
- items: string[];
374
+ /** The trail; the last one is the current page. Items with `href` are links, with `onClick` buttons. */
375
+ items: (string | Crumb)[];
376
+ /** The element links render as (default `a`), e.g. Next.js `Link`. */
377
+ linkAs?: ElementType;
378
+ /** Makes every crumb but the last a button; receives its index. */
379
+ onNavigate?: (index: number) => void;
380
+ /** Accessible name of the navigation (default "Breadcrumb"). */
381
+ label?: string;
324
382
  }
325
383
  export interface PaginationProps extends BaseProps {
326
384
  /** Number of pages. */
@@ -334,10 +392,17 @@ export interface PaginationProps extends BaseProps {
334
392
  defaultPage?: number;
335
393
  /** A page was picked (previous, next or a number); receives the new 1-based page. */
336
394
  onChange?: (page: number) => void;
395
+ /** Link mode for server-rendered lists: the address of a page; pages become links. */
396
+ href?: (page: number) => string;
397
+ /** The element links render as (default `a`), e.g. Next.js `Link`. */
398
+ linkAs?: ElementType;
399
+ /** Accessible name of the navigation (default "Pagination"), e.g. "Search results pages". */
400
+ label?: string;
337
401
  }
338
402
  export interface AppShellProps extends BaseProps {
339
403
  active?: string;
340
- brand?: string;
404
+ /** The product name, or a node (a logo mark with the name; collapsed sidebars show it whole). */
405
+ brand?: ReactNode;
341
406
  tag?: string;
342
407
  nav?: NavItem[];
343
408
  user?: {
@@ -353,6 +418,19 @@ export interface AppShellProps extends BaseProps {
353
418
  dockItems?: DockProps["items"];
354
419
  railTop?: RailItem[];
355
420
  railBottom?: RailItem[];
421
+ /**
422
+ * `top` (default): navigation in the top bar, tools in the side rail. `sidebar`: a labelled
423
+ * sidebar on the frame, with groups, nesting and a drawer on phones.
424
+ */
425
+ navigation?: "top" | "sidebar";
426
+ /** With `navigation="sidebar"`: groups instead of the flat `nav` list. */
427
+ sidebarGroups?: SidebarGroup[];
428
+ /** With `navigation="sidebar"`: more sidebar props (collapsed, storageKey, shortcut, linkAs …). */
429
+ sidebar?: Partial<Omit<SidebarProps, "variant" | "groups">>;
430
+ /** With `navigation="sidebar"`: the workspace switcher at the top instead of the brand. */
431
+ workspaces?: WorkspaceSwitcherProps;
432
+ /** The account menu's entries (with `navigation="sidebar"` at the foot of the sidebar). */
433
+ userMenu?: (MenuItem | "-")[];
356
434
  children?: ReactNode;
357
435
  }
358
436
  export interface StaggerProps extends BaseProps {
@@ -370,6 +448,8 @@ export interface CountUpProps extends BaseProps {
370
448
  duration?: number;
371
449
  delay?: number;
372
450
  className?: string;
451
+ /** `false`: show the value without counting (it is always the value on the server). */
452
+ animate?: boolean;
373
453
  }
374
454
  export interface ListRowProps extends BaseProps {
375
455
  avatar?: string;
@@ -383,6 +463,18 @@ export interface ListRowProps extends BaseProps {
383
463
  unread?: boolean;
384
464
  active?: boolean;
385
465
  onClick?: () => void;
466
+ /** Makes the row a link (with `linkAs` for a router's link). */
467
+ href?: string;
468
+ linkAs?: ElementType;
469
+ /**
470
+ * Buttons of the row's own (rename, remove …), outside the clickable area so nothing interactive
471
+ * is nested. Without `onClick` and `href` the row is not interactive at all.
472
+ */
473
+ actions?: ReactNode;
474
+ /** Lines the title may take before it ends in an ellipsis (default: it wraps freely). */
475
+ titleLines?: number;
476
+ /** Lines the subtitle may take (default 1); badges and facts wrap within them. */
477
+ subtitleLines?: number;
386
478
  }
387
479
  export interface TimelineProps extends BaseProps {
388
480
  items: {
@@ -698,6 +790,14 @@ export interface TextFieldProps extends Omit<FormFieldProps, "children"> {
698
790
  inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";
699
791
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
700
792
  onBlur?: (e: ChangeEvent<HTMLInputElement>) => void;
793
+ onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
794
+ /**
795
+ * An interactive control at the end of the field (an `IconButton`: clear, copy, locate …). Unlike
796
+ * `suffix` it can be clicked, and it stays when the field shows an error or success mark.
797
+ */
798
+ action?: ReactNode;
799
+ /** For `type="password"`: a button that shows and hides the password (default true). */
800
+ reveal?: boolean;
701
801
  }
702
802
  export interface RadioGroupProps extends BaseProps {
703
803
  label?: string;
@@ -791,10 +891,18 @@ export interface SliderProps extends BaseProps {
791
891
  marks?: boolean;
792
892
  hint?: string;
793
893
  }
894
+ export interface OtpInputHandle {
895
+ /** Empties every cell and focuses the first. */
896
+ reset: () => void;
897
+ }
794
898
  export interface OtpInputProps extends BaseProps {
795
899
  length?: number;
796
900
  onComplete?: (code: string) => void;
797
901
  error?: boolean;
902
+ /** Empties the cells when `error` turns on, ready for the next try (default true). */
903
+ clearOnError?: boolean;
904
+ /** `ref.current.reset()` empties the cells on demand. */
905
+ ref?: Ref<OtpInputHandle>;
798
906
  label?: string;
799
907
  }
800
908
  export interface UploadFile {
@@ -814,9 +922,10 @@ export interface FileDropProps extends BaseProps {
814
922
  /**
815
923
  * The person picked or dropped files: the real `File` objects, after `accept` and `multiple`.
816
924
  * Upload them yourself. To show progress, control `files` and set each `progress`; an
817
- * uncontrolled list shows them with their size only.
925
+ * uncontrolled list shows them with their size only. Return `false` to list none of them, or
926
+ * the files to list (for example after checking their size).
818
927
  */
819
- onFiles?: (files: File[]) => void;
928
+ onFiles?: (files: File[]) => void | boolean | File[];
820
929
  /** Dropped files that do not match `accept` (show an inline Alert). */
821
930
  onReject?: (files: File[]) => void;
822
931
  /** A listed file was removed or its upload cancelled. */
@@ -831,6 +940,10 @@ export interface FileDropProps extends BaseProps {
831
940
  /** Accepted types, as for `<input type="file">` ("image/*,.pdf"); also checked on drop. */
832
941
  accept?: string;
833
942
  multiple?: boolean;
943
+ /** No picking or dropping; the list stays visible. */
944
+ disabled?: boolean;
945
+ /** Takes part in a surrounding form under this name: the listed files are submitted with it. */
946
+ name?: string;
834
947
  }
835
948
  export interface TooltipProps extends BaseProps {
836
949
  label: ReactNode;
@@ -998,6 +1111,8 @@ export interface LegendProps extends BaseProps {
998
1111
  }
999
1112
  export interface Source {
1000
1113
  title: string;
1114
+ /** More about the source in a tooltip: dataset, publisher, date ("Stand") … */
1115
+ detail?: ReactNode;
1001
1116
  icon?: IconName;
1002
1117
  url?: string;
1003
1118
  onClick?: () => void;
@@ -1228,6 +1343,11 @@ export interface CheckoutStepsProps extends BaseProps {
1228
1343
  steps?: string[];
1229
1344
  current?: number;
1230
1345
  onPick?: (i: number) => void;
1346
+ /**
1347
+ * Numbers only, with the label of the current step (screen readers still hear every label).
1348
+ * Narrow containers (up to 560px) get this on their own.
1349
+ */
1350
+ compact?: boolean;
1231
1351
  }
1232
1352
  export interface OrderTimelineProps extends BaseProps {
1233
1353
  status: "Placed" | "Paid" | "Packed" | "Shipped" | "Delivered" | "Refunded" | "Cancelled";
@@ -1236,7 +1356,15 @@ export interface OrderTimelineProps extends BaseProps {
1236
1356
  export interface PlanCardProps extends BaseProps {
1237
1357
  name: string;
1238
1358
  text?: string;
1239
- price: number | null;
1359
+ /**
1360
+ * A number is formatted as money (0 = "Free", null = "Let's talk"); any other node is shown as
1361
+ * it is, e.g. a placeholder ("—") or a price the app formatted itself.
1362
+ */
1363
+ price: number | null | ReactNode;
1364
+ /** Before the price, e.g. "from". */
1365
+ pricePrefix?: ReactNode;
1366
+ /** Under the price: net or gross, billed yearly, VAT note … */
1367
+ priceNote?: ReactNode;
1240
1368
  was?: number;
1241
1369
  per?: string;
1242
1370
  features?: string[];
@@ -1247,6 +1375,9 @@ export interface PlanCardProps extends BaseProps {
1247
1375
  /** Disable the button, e.g. while a checkout starts or when the plan cannot be picked. */
1248
1376
  disabled?: boolean;
1249
1377
  onPick?: () => void;
1378
+ /** The action as a link (checkout or sign-up page), with `linkAs` for a router's link. */
1379
+ href?: string;
1380
+ linkAs?: ElementType;
1250
1381
  }
1251
1382
  export interface StatusScreenProps extends BaseProps {
1252
1383
  code?: "404" | "500" | "403" | "maintenance" | "offline" | string;
@@ -2010,6 +2141,8 @@ export interface TilePickerProps extends BaseProps {
2010
2141
  multiple?: boolean;
2011
2142
  min?: number;
2012
2143
  label?: string;
2144
+ /** `list`: one compact row per option (small picture or icon beside the label), e.g. on phones. */
2145
+ layout?: "grid" | "list";
2013
2146
  }
2014
2147
  export interface ColorFieldProps extends BaseProps {
2015
2148
  label?: ReactNode;
@@ -2296,6 +2429,8 @@ export interface WorkspaceSwitcherProps extends BaseProps {
2296
2429
  footer?: ReactNode;
2297
2430
  variant?: "frame";
2298
2431
  width?: number;
2432
+ /** Only the workspace's mark, its name as the accessible name (a collapsed sidebar). */
2433
+ compact?: boolean;
2299
2434
  }
2300
2435
  export interface ExportDialogProps extends BaseProps {
2301
2436
  open?: boolean;
@@ -2328,6 +2463,12 @@ export interface ExportDialogProps extends BaseProps {
2328
2463
  }
2329
2464
  export interface TwoFactorSetupProps extends BaseProps {
2330
2465
  qr?: ReactNode;
2466
+ /** The otpauth:// link: the kit draws its QR code (instead of `qr`). */
2467
+ qrValue?: string;
2468
+ /** A "Trust this device" checkbox under the code field; a string replaces its label. */
2469
+ trustDevice?: boolean | string;
2470
+ /** The trust checkbox changed. */
2471
+ onTrustChange?: (trusted: boolean) => void;
2331
2472
  secret: string;
2332
2473
  onVerify?: (code: string) => boolean | Promise<boolean>;
2333
2474
  codes?: string[];
@@ -2373,7 +2514,13 @@ export interface GalleryProps extends BaseProps {
2373
2514
  loading?: "lazy" | "eager";
2374
2515
  /** `referrerPolicy` of every image, e.g. `"no-referrer"` for photos from other hosts. */
2375
2516
  referrerPolicy?: ImageReferrerPolicy;
2517
+ /** First image when uncontrolled. */
2376
2518
  start?: number;
2519
+ /** The shown image (controlled, 0-based), with `onIndexChange`. */
2520
+ index?: number;
2521
+ onIndexChange?: (index: number) => void;
2522
+ /** Accessible name of the gallery (default "Images"), e.g. the listing's title. */
2523
+ label?: string;
2377
2524
  ratio?: string;
2378
2525
  thumbs?: boolean;
2379
2526
  fullscreen?: boolean;
@@ -2514,13 +2661,21 @@ export interface CookieConsentProps extends BaseProps {
2514
2661
  categories?: {
2515
2662
  id: string;
2516
2663
  label: string;
2517
- text?: string;
2664
+ /** What the category covers; may hold a link to the details. */
2665
+ text?: ReactNode;
2518
2666
  required?: boolean;
2519
2667
  default?: boolean;
2520
2668
  }[];
2521
2669
  onSave?: (choices: Record<string, boolean>) => void;
2522
2670
  open?: boolean;
2523
2671
  inline?: boolean;
2672
+ /**
2673
+ * "Only necessary" and "Accept all" with the same weight (both secondary buttons), as German
2674
+ * data protection authorities expect on the first layer.
2675
+ */
2676
+ equalChoice?: boolean;
2677
+ /** Id of the banner (its text is referenced by `aria-describedby`). */
2678
+ id?: string;
2524
2679
  }
2525
2680
  export interface AnnouncementBarProps extends BaseProps {
2526
2681
  children: ReactNode;
@@ -2588,6 +2743,8 @@ export interface ToggleGroupProps extends BaseProps {
2588
2743
  /** Accessible name of the group. */
2589
2744
  label: string;
2590
2745
  size?: "sm" | "md";
2746
+ /** Fills the width and shares it evenly; labels end in an ellipsis when space runs short. */
2747
+ block?: boolean;
2591
2748
  }
2592
2749
  export interface ButtonGroupProps extends BaseProps {
2593
2750
  /** Accessible name of the group. */
@@ -2667,6 +2824,8 @@ export interface SelectMenuProps extends FieldProps, BaseProps {
2667
2824
  onChange?: (value: string) => void;
2668
2825
  placeholder?: string;
2669
2826
  disabled?: boolean;
2827
+ /** `sm`: a compact trigger, e.g. a sort menu next to a heading. */
2828
+ size?: "sm" | "md";
2670
2829
  }
2671
2830
  export interface MenubarMenu {
2672
2831
  label: string;
@@ -2701,31 +2860,99 @@ export interface NavigationMenuProps extends BaseProps {
2701
2860
  export interface SidebarItem {
2702
2861
  id?: string;
2703
2862
  label: string;
2704
- icon: IconName;
2863
+ /** Required for pages; options in a filter group usually go without. */
2864
+ icon?: IconName;
2705
2865
  count?: number;
2706
- /** One level of nested pages, shown when the item is open. */
2866
+ /** A small marker instead of a number: `"dot"` for new activity, or a short word such as "New". */
2867
+ badge?: string;
2868
+ /** Renders the item as a link to this address (with `linkAs` for a router's link, e.g. Next.js `Link`). */
2869
+ href?: string;
2870
+ /** Opens `href` in a new tab and says so. */
2871
+ external?: boolean;
2872
+ disabled?: boolean;
2873
+ /** A menu behind a "…" button on the item (rename, share, remove …). */
2874
+ actions?: (MenuItem | "-")[];
2875
+ /** One level of nested pages, shown when the item is open (as a flyout when the sidebar is collapsed). */
2707
2876
  items?: Omit<SidebarItem, "items">[];
2877
+ /**
2878
+ * Makes the item a filter option: a checkbox (or a radio in a group with `select: "single"`)
2879
+ * with its label and `count`, instead of a page.
2880
+ */
2881
+ checked?: boolean;
2882
+ onCheckedChange?: (checked: boolean) => void;
2708
2883
  }
2709
2884
  export interface SidebarGroup {
2885
+ id?: string;
2710
2886
  label?: string;
2711
- items: SidebarItem[];
2887
+ items?: SidebarItem[];
2888
+ /** Any content instead of (or after) the items: a `RangeSlider`, `DateRangePicker`, chips … */
2889
+ content?: ReactNode;
2890
+ /** For filter options (items with `checked`): `single` makes them radios (one choice per group). */
2891
+ select?: "multiple" | "single";
2892
+ /** The label folds the group open and shut. */
2893
+ collapsible?: boolean;
2894
+ /** For a collapsible group: starts open (default true). */
2895
+ defaultOpen?: boolean;
2896
+ /** A small button next to the label, e.g. "+" to add a project. */
2897
+ action?: {
2898
+ label: string;
2899
+ icon?: IconName;
2900
+ onClick?: () => void;
2901
+ };
2712
2902
  }
2713
2903
  export interface SidebarProps extends BaseProps {
2714
2904
  groups: SidebarGroup[];
2715
2905
  /** Id (or label) of the current page. */
2716
2906
  current?: string;
2717
2907
  onPick?: (id: string) => void;
2908
+ /**
2909
+ * `floating` (default): a card with rounded corners and a shadow. `attached`: full height, flush
2910
+ * with the edge of the screen, divided by a line. `shell`: on the dark frame of `AppShell`.
2911
+ */
2912
+ variant?: "floating" | "attached" | "shell";
2718
2913
  /** Icons only. */
2719
2914
  collapsed?: boolean;
2720
2915
  defaultCollapsed?: boolean;
2721
2916
  onCollapsedChange?: (collapsed: boolean) => void;
2722
- /** Top of the sidebar (brand, workspace switcher). */
2723
- header?: ReactNode;
2724
- /** Bottom of the sidebar (account, settings). */
2725
- footer?: ReactNode;
2726
- /** Accessible name of the navigation. */
2917
+ /** Remember the collapsed state in the browser under this key. */
2918
+ storageKey?: string;
2919
+ /** ⌘B (Ctrl+B) collapses and expands the sidebar, except while typing in a field. */
2920
+ shortcut?: boolean;
2921
+ /** The element items with an `href` render as (default `a`), e.g. Next.js `Link`. */
2922
+ linkAs?: ElementType;
2923
+ /** On phones (up to 760px wide): whether the drawer is open (controlled). */
2924
+ mobileOpen?: boolean;
2925
+ onMobileOpenChange?: (open: boolean) => void;
2926
+ /** Top of the sidebar (brand, `WorkspaceSwitcher`); a function gets the collapsed state. */
2927
+ header?: ReactNode | ((state: {
2928
+ collapsed: boolean;
2929
+ }) => ReactNode);
2930
+ /** Bottom of the sidebar (`UserMenu`, settings); a function gets the collapsed state. */
2931
+ footer?: ReactNode | ((state: {
2932
+ collapsed: boolean;
2933
+ }) => ReactNode);
2934
+ /**
2935
+ * `nav` (default) for app navigation. `aside` for filters, settings or other tools beside the
2936
+ * content: a complementary region instead of a navigation landmark.
2937
+ */
2938
+ as?: "nav" | "aside";
2939
+ /** Offers the collapse button and the icons-only mode (default true; filters usually set false). */
2940
+ collapsible?: boolean;
2941
+ /** Accessible name of the navigation (or the aside). */
2727
2942
  label?: string;
2728
2943
  }
2944
+ export interface UserMenuProps extends BaseProps {
2945
+ name: string;
2946
+ email?: string;
2947
+ /** Picture URL; initials otherwise. */
2948
+ avatar?: string;
2949
+ /** The menu: profile, settings, sign out … */
2950
+ items?: (MenuItem | "-")[];
2951
+ /** Only the avatar (a collapsed sidebar). */
2952
+ compact?: boolean;
2953
+ /** Where the menu opens (default `top`, for the foot of a sidebar). */
2954
+ side?: "top" | "bottom";
2955
+ }
2729
2956
  export interface ResizablePanelsProps extends BaseProps {
2730
2957
  panels: ReactNode[];
2731
2958
  /** Start sizes in percent (default: equal). */
@@ -2738,4 +2965,16 @@ export interface ResizablePanelsProps extends BaseProps {
2738
2965
  /** Accessible names of the panels, used for the resize handles. */
2739
2966
  labels?: string[];
2740
2967
  }
2968
+ export interface QrCodeProps extends BaseProps {
2969
+ /** The text to encode: an otpauth:// link, a URL … */
2970
+ value: string;
2971
+ /** Error correction: L, M (default), Q or H. */
2972
+ level?: "L" | "M" | "Q" | "H";
2973
+ /** Width and height (default: the width of its container). */
2974
+ size?: number | string;
2975
+ /** Light modules around the code (default 4, the standard quiet zone). */
2976
+ quiet?: number;
2977
+ /** Accessible name (default "QR code"). */
2978
+ label?: string;
2979
+ }
2741
2980
  //# sourceMappingURL=types.d.ts.map