@senvenli/react 0.3.3 → 0.3.4

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 (93) hide show
  1. package/dist/action/fab.d.ts +7 -0
  2. package/dist/action/fab.js +22 -3
  3. package/dist/action/fab.js.map +1 -1
  4. package/dist/collection/data-table.d.ts +1 -1
  5. package/dist/collection/data-table.js +2 -2
  6. package/dist/collection/data-table.js.map +1 -1
  7. package/dist/collection/table.d.ts +7 -2
  8. package/dist/collection/table.js +17 -7
  9. package/dist/collection/table.js.map +1 -1
  10. package/dist/i18n.d.ts +8 -0
  11. package/dist/i18n.js +18 -1
  12. package/dist/i18n.js.map +1 -1
  13. package/dist/navigation/index.d.ts +2 -2
  14. package/dist/navigation/index.js +1 -1
  15. package/dist/navigation/index.js.map +1 -1
  16. package/dist/navigation/sidebar.d.ts +18 -0
  17. package/dist/navigation/sidebar.js +26 -2
  18. package/dist/navigation/sidebar.js.map +1 -1
  19. package/dist/overlay/floating.js +4 -1
  20. package/dist/overlay/floating.js.map +1 -1
  21. package/dist/overlay/index.d.ts +2 -0
  22. package/dist/overlay/index.js +2 -1
  23. package/dist/overlay/index.js.map +1 -1
  24. package/dist/overlay/tour.d.ts +88 -0
  25. package/dist/overlay/tour.js +302 -0
  26. package/dist/overlay/tour.js.map +1 -0
  27. package/package.json +2 -2
  28. package/dist/action/files.d.ts +0 -70
  29. package/dist/action/files.js +0 -156
  30. package/dist/action/files.js.map +0 -1
  31. package/dist/action/theme-toggle.d.ts +0 -43
  32. package/dist/action/theme-toggle.js +0 -259
  33. package/dist/action/theme-toggle.js.map +0 -1
  34. package/dist/display/image-crop.d.ts +0 -106
  35. package/dist/display/image-crop.js +0 -117
  36. package/dist/display/image-crop.js.map +0 -1
  37. package/dist/display/image-cropper.d.ts +0 -68
  38. package/dist/display/image-cropper.js +0 -284
  39. package/dist/display/image-cropper.js.map +0 -1
  40. package/dist/display/lozenge.d.ts +0 -30
  41. package/dist/display/lozenge.js +0 -55
  42. package/dist/display/lozenge.js.map +0 -1
  43. package/dist/display/scroll-area.d.ts +0 -29
  44. package/dist/display/scroll-area.js +0 -95
  45. package/dist/display/scroll-area.js.map +0 -1
  46. package/dist/feedback/cooldown.d.ts +0 -17
  47. package/dist/feedback/cooldown.js +0 -59
  48. package/dist/feedback/cooldown.js.map +0 -1
  49. package/dist/feedback/status-dot.d.ts +0 -23
  50. package/dist/feedback/status-dot.js +0 -37
  51. package/dist/feedback/status-dot.js.map +0 -1
  52. package/dist/form/input-otp.d.ts +0 -35
  53. package/dist/form/input-otp.js +0 -83
  54. package/dist/form/input-otp.js.map +0 -1
  55. package/dist/layout/auth-form-layout.d.ts +0 -71
  56. package/dist/layout/auth-form-layout.js +0 -61
  57. package/dist/layout/auth-form-layout.js.map +0 -1
  58. package/dist/layout/auth-layout.d.ts +0 -59
  59. package/dist/layout/auth-layout.js +0 -26
  60. package/dist/layout/auth-layout.js.map +0 -1
  61. package/dist/layout/pressable.d.ts +0 -40
  62. package/dist/layout/pressable.js +0 -65
  63. package/dist/layout/pressable.js.map +0 -1
  64. package/dist/layout/reset-sent-card.d.ts +0 -39
  65. package/dist/layout/reset-sent-card.js +0 -22
  66. package/dist/layout/reset-sent-card.js.map +0 -1
  67. package/dist/navigation/dock.d.ts +0 -27
  68. package/dist/navigation/dock.js +0 -47
  69. package/dist/navigation/dock.js.map +0 -1
  70. package/dist/navigation/footer.d.ts +0 -43
  71. package/dist/navigation/footer.js +0 -43
  72. package/dist/navigation/footer.js.map +0 -1
  73. package/dist/navigation/language-names.d.ts +0 -19
  74. package/dist/navigation/language-names.js +0 -79
  75. package/dist/navigation/language-names.js.map +0 -1
  76. package/dist/navigation/language-switcher.d.ts +0 -55
  77. package/dist/navigation/language-switcher.js +0 -53
  78. package/dist/navigation/language-switcher.js.map +0 -1
  79. package/dist/navigation/panel-header.d.ts +0 -37
  80. package/dist/navigation/panel-header.js +0 -50
  81. package/dist/navigation/panel-header.js.map +0 -1
  82. package/dist/navigation/toolbar.d.ts +0 -37
  83. package/dist/navigation/toolbar.js +0 -334
  84. package/dist/navigation/toolbar.js.map +0 -1
  85. package/dist/overlay/command-palette.d.ts +0 -53
  86. package/dist/overlay/command-palette.js +0 -130
  87. package/dist/overlay/command-palette.js.map +0 -1
  88. package/dist/overlay/overlay.d.ts +0 -299
  89. package/dist/overlay/overlay.js +0 -558
  90. package/dist/overlay/overlay.js.map +0 -1
  91. package/dist/selection/radio-card.d.ts +0 -31
  92. package/dist/selection/radio-card.js +0 -29
  93. package/dist/selection/radio-card.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-palette.js","sourceRoot":"","sources":["../../src/overlay/command-palette.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,YAAY,EACZ,MAAM,IAAI,UAAU,EACpB,MAAM,EACN,KAAK,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,KAAK,EACL,YAAY,EACZ,WAAW,EACX,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAoB,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACzK,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAoC7D,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB,iHAAiH;AACjH,SAAS,MAAM,CAAC,MAA+B;IAC7C,MAAM,KAAK,GAAG,EAAE,MAAM,EAA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,CAAC,CAAC,CAAC,KAAK,IAAtF,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAuE,CAAC,KAJ7G,KAAK,CAAC,EAAE,CAKZ,CAClB,CAAC,GACM,EACV,4BAAgB,QAAQ,EAAC,SAAS,EAAC,SAAS,eAAW,wBAAwB,YAC5E,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GACtC,IACM,EACf,4BAAe,wBAAwB,EAAC,SAAS,EAAC,+IAA+I,aAC/L,gBAAM,SAAS,EAAC,8BAA8B,aAAC,KAAC,GAAG,yBAAQ,EAAA,KAAC,GAAG,yBAAQ,EAAC,KAAK,CAAC,IAAI,IAAQ,EAC1F,gBAAM,SAAS,EAAC,8BAA8B,aAAC,KAAC,GAAG,yBAAQ,EAAC,KAAK,CAAC,IAAI,IAAQ,EAC9E,gBAAM,SAAS,EAAC,8BAA8B,aAAC,KAAC,GAAG,sBAAU,EAAC,KAAK,CAAC,KAAK,IAAQ,IAC7E,IACA,GACK,GACP,GACK,CAChB,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Autocomplete,\n Dialog as AriaDialog,\n Header,\n Input,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Modal,\n ModalOverlay,\n SearchField,\n useLocale,\n} from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { Kbd } from \"../display/kbd\";\nimport { Lozenge, type LozengeTone } from \"../display/lozenge\";\nimport { actionFailedLabel, commandHints, commandPaletteLabel, commandSearchLabel, frequentActionsLabel, loadingLabel, noMatchLabel, recentRecordsLabel } from \"../i18n\";\nimport { Highlight, matchesQuery } from \"../selection/match\";\n\nexport type CommandItem = {\n id: string;\n /** \"Pro plan\", \"Create order\". */\n label: string;\n /** Beside the label in mono: a code, an order number (\"ORD-482\"). */\n detail?: string;\n icon?: IconName;\n /** A record's status (\"Available\", success). */\n status?: { label: string; tone: LozengeTone };\n /** An action's shortcut (\"N\"). */\n shortcut?: string;\n /** Extra words it is found by (a customer's phone number, an old name). */\n keywords?: readonly string[];\n /** Records come first, then actions, then pages; \"action\" items fill the \"most used\" list. */\n kind?: \"record\" | \"action\" | \"page\";\n};\n\nexport type CommandGroup = { id: string; title: string; items: readonly CommandItem[] };\n\nexport type CommandPaletteProps = {\n isOpen?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n /** Actions and pages, most used first; matched here, diacritic-insensitive. */\n groups: readonly CommandGroup[];\n /** Records found by the server (codes, order numbers, names, phones); shown before the groups. */\n search?: (query: string, signal: AbortSignal) => Promise<readonly CommandGroup[]>;\n /** Shown while the query is empty, above the five most used actions. */\n recent?: readonly CommandItem[];\n onSelect: (item: CommandItem) => void;\n /** Bind ⌘K / Ctrl K to open and close it. */\n shortcut?: boolean;\n};\n\nconst SEARCH_DELAY = 150;\n\n/** Records first, then actions, then pages; a group ranks by its highest kind; equal groups keep their order. */\nfunction byKind(groups: readonly CommandGroup[]) {\n const order = { record: 0, action: 1, page: 2 } as const;\n const rank = (group: CommandGroup) => Math.min(...group.items.map((item) => order[item.kind ?? \"action\"]));\n return [...groups].sort((a, b) => rank(a) - rank(b));\n}\n\n/** The server's results for a query, debounced and cancelled when the query moves on. */\nfunction useSearch(query: string, search: CommandPaletteProps[\"search\"]) {\n const [state, setState] = React.useState<{ query: string; groups: readonly CommandGroup[]; loading: boolean; failed: boolean }>({\n query: \"\", groups: [], loading: false, failed: false,\n });\n React.useEffect(() => {\n if (!search || !query.trim()) {\n setState({ query, groups: [], loading: false, failed: false });\n return;\n }\n const controller = new AbortController();\n // The last answer stays (filtered by the caller) while the next one loads, so records do not flicker away.\n setState((current) => ({ ...current, loading: true, failed: false }));\n const timer = setTimeout(() => {\n search(query, controller.signal).then(\n (groups) => !controller.signal.aborted && setState({ query, groups, loading: false, failed: false }),\n () => !controller.signal.aborted && setState({ query, groups: [], loading: false, failed: true }),\n );\n }, SEARCH_DELAY);\n return () => {\n clearTimeout(timer);\n controller.abort();\n };\n }, [query, search]);\n return state;\n}\n\n/** A row's key: group and item, since ids repeat across groups (a product and an order both \"12\"). */\nconst rowKey = (group: CommandGroup, item: CommandItem) => `${group.id}\\u0000${item.id}`;\n\nfunction Row({ item, query, rowId }: { item: CommandItem; query: string; rowId: string }) {\n return (\n <ListBoxItem\n id={rowId}\n textValue={item.detail ? `${item.label} ${item.detail}` : item.label}\n data-slot=\"command-item\"\n data-kind={item.kind}\n className=\"flex min-h-10 cursor-default items-center gap-ds-150 rounded-ds-medium px-ds-150 text-body text-ds-text outline-hidden data-[focused]:bg-ds-background-selected data-[hovered]:bg-ds-background-neutral-subtle-hovered data-[focused]:data-[hovered]:bg-ds-background-selected\"\n >\n {item.icon && <IconGlyph name={item.icon} size=\"small\" data-slot=\"command-item-icon\" className=\"text-ds-icon-subtle\" />}\n <span data-slot=\"command-item-label\" className=\"min-w-0 flex-1 truncate\">\n <Highlight text={item.label} query={query} />\n {item.detail && (\n <>\n <span aria-hidden> · </span>\n <bdi data-slot=\"command-item-detail\" className=\"font-ds-mono text-code text-ds-text-subtle\">\n <Highlight text={item.detail} query={query} />\n </bdi>\n </>\n )}\n </span>\n {item.status && <Lozenge tone={item.status.tone}>{item.status.label}</Lozenge>}\n {item.shortcut && <Kbd>{item.shortcut}</Kbd>}\n </ListBoxItem>\n );\n}\n\n/**\n * ⌘K / Ctrl K: find any record and run any action from the keyboard. 560px in the top third over the\n * blanket; one field, results grouped (records, then actions, then pages), 40px rows, the active row on\n * ds-background-selected, records with their status. Empty, it shows recent records and the five most used\n * actions. Typing matches labels, codes and keywords without regard to case or accents (\"durovic\" finds\n * \"Đurović\"), and asks `search` for records (the last answer stays while the next loads; a failed search says\n * so). Arrows move, Enter opens, Esc closes and returns focus. Rows are keyed by group and id, so ids may repeat\n * across groups. When records arrive after the actions, the active row stays where it was (React Aria's\n * Autocomplete keeps its virtual focus); arrows reach the records first in the list.\n * Everything here must also be reachable through visible UI.\n */\nexport function CommandPalette({ isOpen, defaultOpen, onOpenChange, groups, search, recent = [], onSelect, shortcut }: CommandPaletteProps) {\n const { locale } = useLocale();\n const [own, setOwn] = React.useState(defaultOpen ?? false);\n const open = isOpen ?? own;\n const setOpen = (next: boolean) => {\n if (isOpen === undefined) setOwn(next);\n onOpenChange?.(next);\n };\n const latest = React.useRef({ open, setOpen });\n latest.current = { open, setOpen };\n\n React.useEffect(() => {\n if (!shortcut) return;\n // ⌘K on Apple platforms (Ctrl K there is \"delete to end of line\" in every field), Ctrl K elsewhere. The\n // physical key counts too, for Cyrillic and Greek layouts; a key an editor already handled is left alone.\n const apple = /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);\n const listener = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.isComposing || event.repeat || event.altKey || event.shiftKey) return;\n const modifier = apple ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;\n if (modifier && (event.key.toLowerCase() === \"k\" || event.code === \"KeyK\")) {\n event.preventDefault();\n latest.current.setOpen(!latest.current.open);\n }\n };\n document.addEventListener(\"keydown\", listener);\n return () => document.removeEventListener(\"keydown\", listener);\n }, [shortcut]);\n\n const [query, setQuery] = React.useState(\"\");\n // A new opening starts from an empty query.\n const [wasOpen, setWasOpen] = React.useState(open);\n if (wasOpen !== open) {\n setWasOpen(open);\n if (open) setQuery(\"\");\n }\n const remote = useSearch(query, search);\n const empty = !query.trim();\n\n const shown: CommandGroup[] = React.useMemo(() => {\n if (empty) {\n const actions = groups.flatMap((group) => group.items).filter((item) => (item.kind ?? \"action\") === \"action\").slice(0, 5);\n return [\n ...(recent.length ? [{ id: \"__recent\", title: recentRecordsLabel(locale), items: recent }] : []),\n ...(actions.length ? [{ id: \"__frequent\", title: frequentActionsLabel(locale), items: actions }] : []),\n ];\n }\n const local = groups\n .map((group) => ({ ...group, items: group.items.filter((item) => matchesQuery(query, item.label, item.detail, ...(item.keywords ?? []))) }))\n .filter((group) => group.items.length);\n // The newest answer, or the previous one (still matching the query) while the next one loads.\n const found = (remote.query === query ? remote.groups : remote.groups.map((group) => ({ ...group, items: group.items.filter((item) => matchesQuery(query, item.label, item.detail, ...(item.keywords ?? []))) })))\n .filter((group) => group.items.length);\n return byKind([...found, ...local]);\n }, [empty, groups, recent, locale, query, remote]);\n\n const items = React.useMemo(() => new Map(shown.flatMap((group) => group.items.map((item) => [rowKey(group, item), item] as const))), [shown]);\n const hints = commandHints(locale);\n\n return (\n <ModalOverlay\n isOpen={open}\n onOpenChange={setOpen}\n isDismissable\n data-slot=\"command-palette-overlay\"\n className=\"fixed inset-0 z-50 flex items-start justify-center bg-ds-blanket px-ds-200 pt-[15dvh] transition-opacity duration-(--ds-duration-medium) data-[entering]:opacity-0 data-[exiting]:opacity-0 motion-reduce:transition-none\"\n >\n <Modal\n data-slot=\"command-palette\"\n className=\"flex max-h-[70dvh] w-full max-w-140 flex-col overflow-hidden rounded-ds-xlarge bg-ds-surface-overlay text-ds-text shadow-ds-overlay outline-hidden\"\n >\n <AriaDialog aria-label={commandPaletteLabel(locale)} data-slot=\"command-palette-dialog\" className=\"flex min-h-0 flex-1 flex-col outline-hidden\">\n <div\n className=\"flex min-h-0 flex-1 flex-col\"\n // Esc closes at once, as the footer says (the search field would otherwise clear itself first).\n onKeyDownCapture={(event) => {\n if (event.key === \"Escape\" && !event.nativeEvent.isComposing) {\n event.preventDefault();\n event.stopPropagation();\n setOpen(false);\n }\n }}\n >\n <Autocomplete inputValue={query} onInputChange={setQuery}>\n <SearchField aria-label={commandSearchLabel(locale)} autoFocus data-slot=\"command-palette-search\" className=\"flex min-h-13 items-center gap-ds-150 border-b border-ds-border px-ds-200\">\n <IconGlyph name=\"search\" className=\"size-5 shrink-0 text-ds-icon-subtle\" />\n <Input\n placeholder={commandSearchLabel(locale)}\n data-slot=\"command-palette-input\"\n className=\"min-w-0 flex-1 bg-transparent text-body text-ds-text outline-hidden placeholder:text-ds-text-subtlest [&::-webkit-search-cancel-button]:hidden\"\n />\n <Kbd>Esc</Kbd>\n </SearchField>\n <ListBox\n aria-label={commandPaletteLabel(locale)}\n data-slot=\"command-palette-results\"\n onAction={(key) => {\n const item = items.get(String(key));\n if (!item) return;\n setOpen(false);\n onSelect(item);\n }}\n renderEmptyState={() => (\n <div data-slot=\"command-palette-empty\" className=\"px-ds-200 py-ds-300 text-center text-body text-ds-text-subtle\">\n {remote.loading ? loadingLabel(locale) : remote.failed ? actionFailedLabel(locale) : empty ? null : noMatchLabel(locale, query.trim())}\n </div>\n )}\n className=\"min-h-0 flex-1 overflow-y-auto p-ds-100 outline-hidden\"\n >\n {shown.map((group) => (\n <ListBoxSection key={group.id} id={group.id} data-slot=\"command-palette-group\" className=\"flex flex-col\">\n <Header data-slot=\"command-palette-group-title\" className=\"px-ds-150 pt-ds-150 pb-ds-050 text-heading-xxsmall text-ds-text-subtle\">\n {group.title}\n </Header>\n {group.items.map((item) => <Row key={rowKey(group, item)} rowId={rowKey(group, item)} item={item} query={empty ? \"\" : query} />)}\n </ListBoxSection>\n ))}\n </ListBox>\n <span aria-live=\"polite\" className=\"sr-only\" data-slot=\"command-palette-status\">\n {remote.loading ? loadingLabel(locale) : \"\"}\n </span>\n </Autocomplete>\n <div data-slot=\"command-palette-footer\" className=\"flex flex-wrap items-center gap-ds-300 border-t border-ds-border bg-ds-surface-sunken px-ds-200 py-ds-100 text-body-small text-ds-text-subtle\">\n <span className=\"flex items-center gap-ds-050\"><Kbd>↑</Kbd><Kbd>↓</Kbd>{hints.move}</span>\n <span className=\"flex items-center gap-ds-050\"><Kbd>↵</Kbd>{hints.open}</span>\n <span className=\"flex items-center gap-ds-050\"><Kbd>Esc</Kbd>{hints.close}</span>\n </div>\n </div>\n </AriaDialog>\n </Modal>\n </ModalOverlay>\n );\n}\n"]}
@@ -1,299 +0,0 @@
1
- import * as React from "react";
2
- import { type DialogTriggerProps } from "react-aria-components";
3
- import { type ButtonProps } from "../action/button.js";
4
- import { type IconName } from "../display/icon.js";
5
- /**
6
- * One size dictionary for Dialog and Drawer: small, medium, large. A dialog is 440, 600 or
7
- * 800px wide; a drawer is 380 or 560px (it has no medium; medium reads as large).
8
- */
9
- export type OverlaySize = "small" | "medium" | "large";
10
- /** Overlay contents: a nested overlay must not see the outer one's trigger. */
11
- export declare function OverlayContents({ children }: {
12
- children: React.ReactNode;
13
- }): React.JSX.Element;
14
- /**
15
- * The button that opens a Dialog, AlertDialog or Drawer: put it first, the overlay after it. Inside another
16
- * overlay (a Dialog in a Drawer) use this one, not React Aria's own DialogTrigger, which there only sees the
17
- * outer overlay's state.
18
- */
19
- export declare function DialogTrigger({ children, ...props }: DialogTriggerProps): React.JSX.Element;
20
- type OpenProps = {
21
- /**
22
- * Open without a DialogTrigger (a URL, a row click). Inside a DialogTrigger, put `onOpenChange` on the
23
- * trigger instead: the trigger owns the state there.
24
- */
25
- isOpen?: boolean;
26
- defaultOpen?: boolean;
27
- onOpenChange?: (isOpen: boolean) => void;
28
- };
29
- /**
30
- * `isDisabled`: the action cannot be pressed yet, e.g. until the form is valid.
31
- * `iconBefore` / `iconAfter`: a Lucide icon beside the label ("Continue" with `arrow-right`), as on
32
- * Button. The label is always shown and is the button's name, so the icon is decorative (`aria-hidden`); the
33
- * button keeps its size and focus ring. Left out, the button's DOM is unchanged.
34
- */
35
- export type DialogAction = Pick<ButtonProps, "isPending" | "isDisabled" | "iconBefore" | "iconAfter"> & DataAttributes & {
36
- /** The verb of the title: "Cancel order", never "OK". */
37
- label: string;
38
- variant?: "primary" | "danger";
39
- onPress?: () => void;
40
- /**
41
- * The `id` of the form this action submits: the button becomes `type="submit"` with that `form`
42
- * attribute, so it submits the form from the footer, outside the form element, and Enter in one of the form's
43
- * fields submits it too (the browser's implicit submission). Handle the submit in the form's `onSubmit`;
44
- * `onPress`, when given, still runs first. `isDisabled` keeps the form from submitting (click or Enter), and
45
- * so does `isPending`: while pending, a submit of that form is stopped before it reaches `onSubmit`, so the
46
- * action never runs twice. Left out, the button is `type="button"` as before.
47
- *
48
- * The id must be unique on the page. With two forms of that id, the browser's `form=` targets the first one in
49
- * document order, and the pending block also stops a submit of a same-id form outside the dialog.
50
- */
51
- form?: string;
52
- };
53
- /**
54
- * `data-*` attributes, such as `data-testid`, passed through to a part of the dialog. `data-slot`
55
- * (and the footer's `data-layout`) is the DS's own and is never overridden. Not exported: the props that take it name it.
56
- */
57
- type DataAttributes = {
58
- [name: `data-${string}`]: string | number | boolean | undefined;
59
- };
60
- /** The secondary action: "Cancel" (closing) unless given a label or a handler. Not exported: DialogProps["secondaryAction"] names it. */
61
- type DialogSecondaryAction = Pick<ButtonProps, "iconBefore" | "iconAfter"> & DataAttributes & {
62
- label?: string;
63
- onPress?: () => void;
64
- isDisabled?: boolean;
65
- };
66
- export type DialogProps = OpenProps & DataAttributes & {
67
- title: React.ReactNode;
68
- /**
69
- * One short line under the title: what the dialog is about. When given, the dialog is
70
- * described by it (`aria-describedby`); without it (or with `""`, `false`, `null`) nothing is rendered.
71
- */
72
- description?: React.ReactNode;
73
- children: React.ReactNode;
74
- primaryAction?: DialogAction;
75
- /**
76
- * "Cancel" by default, closing the dialog; pass a label or a handler to change it. `isDisabled`
77
- * blocks it, e.g. while the primary action runs; `iconBefore` / `iconAfter` add a
78
- * decorative icon. `null` leaves it out: a
79
- * full-screen dialog whose steps carry their own buttons, or a locked completion view, has no secondary action,
80
- * and with no `primaryAction` either it has no footer at all (the body then takes the bottom padding, and on
81
- * `fullscreen` reaches down to the home indicator). With `null` and a `danger` primary there is no safe button
82
- * to focus first, so focus goes to the body's first field (as for any other dialog), or to the dialog itself
83
- * when the body has none. `data-*` keys reach the button.
84
- */
85
- secondaryAction?: DialogSecondaryAction | null;
86
- /**
87
- * Leaves out the close button in the header, and does nothing else: Esc and a press outside
88
- * still follow `isDismissable`. A locked view the user must not dismiss before the flow ends, such as a
89
- * completion step, sets both: `isCloseButtonHidden` and `isDismissable={false}`. It then closes only when the
90
- * app closes it (`isOpen`/`onOpenChange`, or an action whose handler does) or through the secondary action, when
91
- * there is one; a locked dialog inside a DialogTrigger has no close handle, so control it with `isOpen`. Focus
92
- * stays trapped inside and the title still names the dialog. Give it a way on (a `primaryAction` or a control
93
- * in the body): with the close button hidden and nothing a keyboard can reach inside, the dialog warns in
94
- * development (with `isDismissable` Esc still closes it, but a touch user on `fullscreen` has no press outside).
95
- */
96
- isCloseButtonHidden?: boolean;
97
- /**
98
- * The element that takes focus when the dialog opens, in place of the DS rule (the first field,
99
- * or the secondary action before a `danger` primary). Pass a ref to an element inside the dialog. Left
100
- * out, or empty when the dialog opens, the rule applies as before.
101
- *
102
- * The ref keeps focus only if, once the dialog calls its `focus()`, focus is on that element or inside it;
103
- * otherwise the rule applies after all. So a ref to an element that cannot take focus (a container without a
104
- * `tabIndex`, a hidden title) falls through to the rule, and so does a ref whose own focus handler moves focus
105
- * to an element outside it: the rule then moves focus again, to the safe action or the first field (with
106
- * neither, focus stays where the handler put it). A handler that moves focus to an element inside the ref keeps
107
- * it there. To open on a container, give it `tabIndex={-1}`; to open on another element, pass that element's ref.
108
- */
109
- initialFocusRef?: React.RefObject<HTMLElement | null>;
110
- /**
111
- * Where focus goes when the dialog closes, in place of the element that opened it (the
112
- * trigger): the next step's heading, or a control that stays when the trigger is gone. Read when the dialog
113
- * closes, so it may point at an element mounted by then. If the app has already moved focus elsewhere on
114
- * close, it stays there; if the ref is empty, focus returns to the trigger as before.
115
- */
116
- returnFocusRef?: React.RefObject<HTMLElement | null>;
117
- /**
118
- * A ref to the title's heading, for an app that puts focus on the title: on open (a completion view,
119
- * "Password saved"), or when the dialog's content moves to its next step. Given, the heading takes
120
- * `tabIndex={-1}`: focusable from code (`titleRef.current.focus()`), never a Tab stop, and a pointer press on it
121
- * focuses it. It stays the dialog's heading (`role` heading, level 2) and its name (`aria-labelledby`), so a screen
122
- * reader reads "heading" with the title when focus lands on it.
123
- *
124
- * To open on the title, pass the same ref as `initialFocusRef` (`initialFocusRef={titleRef}`): that ref comes first
125
- * on open, before the first field and the safe secondary action, as for any other element. The title shows the DS
126
- * focus ring only for keyboard focus (`:focus-visible`), never for a pointer user's; focus on close returns as
127
- * before (`returnFocusRef`, or the trigger). Left out, the heading renders exactly as before.
128
- *
129
- * A hidden title (`isTitleHidden`, fullscreen) is never a focus target: it is `sr-only`, so focus on it would show
130
- * no indicator. With `isTitleHidden` the ref still holds the heading, but it takes no `tabIndex` and no focus ring,
131
- * so `titleRef.current.focus()` does nothing and `initialFocusRef={titleRef}` falls through to the dialog's own
132
- * rule (the first field, or the safe secondary action). To land on something there, aim at a visible element
133
- * instead: the first field (the default), or a visible heading or control in the body via `initialFocusRef`.
134
- */
135
- titleRef?: React.Ref<HTMLHeadingElement>;
136
- /**
137
- * `data-*` attributes for the dialog's parts: `header`, `title`, `body`, `footer` and the
138
- * `close` button. The dialog itself (`role="dialog"`, `data-slot="dialog"`) takes the `data-*` props given to
139
- * Dialog (`data-testid="set-password"`); the actions take theirs on `primaryAction` / `secondaryAction`. The
140
- * footer's `data-layout` (`spread`) is the DS's own, like `data-slot`: `partData.footer` cannot set it.
141
- */
142
- partData?: Partial<Record<"header" | "title" | "body" | "footer" | "close", DataAttributes>>;
143
- /**
144
- * `small` (default, 440px), `medium` (600px) or `large` (800px); `xlarge` (1152px) for a form in two
145
- * or three columns over the page it edits, such as an order edit; or `fullscreen` for a long
146
- * task that needs the whole screen, such as a signup: it fills the viewport at every width, slides up as a sheet
147
- * on phones (below 640px) and fades in above. The header (title, close) and the footer (actions) stay put, clear
148
- * of the notch and the home indicator, while the body scrolls between them. Below its width every size but
149
- * `fullscreen` takes the viewport less 24px a side, and its body scrolls inside 100dvh less 48px. Focus, Esc and
150
- * naming are the same at every size.
151
- */
152
- size?: OverlaySize | "xlarge" | "fullscreen";
153
- /**
154
- * Scrim click and Esc close it (default). Off for destructive flows with typed input. A `fullscreen`
155
- * dialog has no scrim, so a press outside it (a toast or banner layered above) never closes it; there
156
- * this prop controls Esc only. It is independent of `isCloseButtonHidden`: a locked view sets
157
- * both, `isCloseButtonHidden` and `isDismissable={false}`; a locked dialog inside a DialogTrigger has no close
158
- * handle, so control it with `isOpen`.
159
- */
160
- isDismissable?: boolean;
161
- /**
162
- * `fullscreen` only. How the footer places its actions: `end` (default) groups them at the
163
- * inline end; `spread` puts the secondary action at the inline start and the primary at the inline end
164
- * ("Back" … "Continue"), mirrored in RTL. A lone primary action stays at the end; a lone secondary action
165
- * (no `primaryAction`) sits at the inline start.
166
- */
167
- footerLayout?: "end" | "spread";
168
- /**
169
- * `fullscreen` only. Shown before the title in the header, such as the product's logo. The
170
- * title then keeps to one line and truncates with an ellipsis (its full text is still the dialog's name);
171
- * the close button keeps its place at the inline end.
172
- */
173
- headerStart?: React.ReactNode;
174
- /**
175
- * `fullscreen` only. Hides the title visually, for a frame whose header shows a logo instead;
176
- * the title stays in the DOM and still names the dialog (`aria-labelledby`), so `title` is still required.
177
- * A description, when given, stays visible. An empty title (`""`, blank, `null`, `false`) would leave the dialog
178
- * unnamed, and warns in development.
179
- */
180
- isTitleHidden?: boolean;
181
- };
182
- /**
183
- * A decision or a short input that must be resolved before the user goes on. Put it inside a DialogTrigger
184
- * after its button, or control it with `isOpen`. Focus moves to the first field (to "Cancel" when the
185
- * primary action is destructive and "Cancel" is there), stays inside, and returns to the trigger on close; Esc closes it.
186
- * `size="fullscreen"` covers the viewport, a sheet on phones, for a long task like a signup; it
187
- * also takes a logo before the title (`headerStart`), a visually hidden title (`isTitleHidden`) and a spread footer
188
- * (`footerLayout`). Every size: a primary action that submits a form
189
- * (`primaryAction.form`), no secondary action (`secondaryAction={null}`; with no primary either, no footer), no
190
- * close button (`isCloseButtonHidden`; a locked view adds `isDismissable={false}`), `data-*` attributes on the
191
- * dialog and its parts (`partData`, the actions' own), and focus hooks (`initialFocusRef`, `returnFocusRef`). A
192
- * focusable title (`titleRef`), which `initialFocusRef` can name to open on it.
193
- */
194
- export declare function Dialog({ size, isDismissable, isOpen, defaultOpen, onOpenChange, footerLayout, headerStart, isTitleHidden, ...content }: DialogProps): React.JSX.Element;
195
- export type AlertDialogProps = OpenProps & {
196
- /**
197
- * `danger` (default: a delete, `trash-2`, a danger button), `warning` (`triangle-alert`, a primary button), or
198
- * `neutral` for a confirm that neither destroys nor risks anything, such as reactivating an account
199
- * (`info` on a neutral ground, a primary button).
200
- */
201
- tone?: "danger" | "warning" | "neutral";
202
- /** The action as a question with the object's name: "PG AB 482 filodan silinsin mi?" */
203
- title: React.ReactNode;
204
- /** The consequence, and what to do first. */
205
- children: React.ReactNode;
206
- /** The verb again: "Delete item". */
207
- confirmLabel: string;
208
- /**
209
- * The cancel button's text, and so its accessible name ("No, keep it"), in place of the library's "Cancel"
210
- *. The app passes it already localized; the DS does not translate it. Left out (or `""`), the
211
- * locale's "Cancel" renders and the DOM is unchanged. A long label wraps inside the button, which takes at
212
- * most the footer's width; focus, Esc and the pending lock are the same either way.
213
- */
214
- cancelLabel?: string;
215
- /**
216
- * May be async: the button shows pending until it settles, and while it runs the dialog cannot be cancelled
217
- * (the action is under way); it closes when the action succeeds and stays open when it fails.
218
- */
219
- onConfirm: () => void | Promise<void>;
220
- /** For irreversible deletes: the text the user types before the button enables ("PG AB 482"). */
221
- requireTypedConfirmation?: string;
222
- /**
223
- * Holds the confirm back while the app loads what it needs ("Loading linked orders"). The
224
- * button keeps its name and stays in the dialog, disabled as with `requireTypedConfirmation`: it cannot be pressed
225
- * (pointer, Enter or Space) and Tab passes it, so "Cancel" stays the one control; screen readers list it as
226
- * unavailable. Say why in the description or in the element `aria-describedby` names. Esc and "Cancel" still work.
227
- */
228
- isConfirmDisabled?: boolean;
229
- /**
230
- * More of what the alert says, by id: an element the app renders, inside the alert (a Banner in its
231
- * body) or outside it (a page notice). Added to the alert's own description in `aria-describedby`, after it, so
232
- * the alert is announced with both when it opens.
233
- */
234
- "aria-describedby"?: string;
235
- /** The field's label; "Type ORD-482 to confirm" by default. */
236
- typedConfirmationLabel?: string;
237
- /** Overrides the tone's icon (danger `trash-2`, warning `triangle-alert`). */
238
- icon?: IconName;
239
- /**
240
- * Where focus goes when the alert closes and React Aria's return would leave it on the page or on the
241
- * opener, as on Dialog. Needed when the element React Aria returns to is gone by the close: an alert
242
- * opened from a menu whose trigger unmounts when it closes (pass a stable button), or a confirmed action that removes the row
243
- * with its Menu (pass a stable element). Opened from a DS Menu item it is not needed: React Aria returns focus to
244
- * the Menu button itself, and a ref naming another element does not override that. Read when the alert closes; if
245
- * the app has already moved focus elsewhere on close, it stays there; if the ref is empty, focus returns as before.
246
- * There is no `initialFocusRef`: the alert's controls are its own, and "Cancel" takes the first focus. Nor is there a
247
- * `titleRef`: the alert is announced with its title and consequence when it opens (`aria-labelledby`,
248
- * `aria-describedby`), and focus starts on the safe answer, never on its text.
249
- */
250
- returnFocusRef?: React.RefObject<HTMLElement | null>;
251
- };
252
- /**
253
- * Confirms an action that destroys data, costs money or cannot be undone (role="alertdialog"). Not closed
254
- * by a scrim click; Esc cancels (not while the action runs); "Cancel" (or the app's `cancelLabel`) has the first focus. With
255
- * `requireTypedConfirmation` the action enables only once the text is typed. If the action can be undone,
256
- * skip it and offer "Undo" in a Toast. Opened from a menu whose trigger unmounts, or when the confirmed action
257
- * removes the opener, pass `returnFocusRef` so focus has somewhere to go back to.
258
- */
259
- export declare function AlertDialog({ isOpen, defaultOpen, onOpenChange, "aria-describedby": ariaDescribedBy, ...content }: AlertDialogProps): React.JSX.Element;
260
- export type DrawerProps = OpenProps & {
261
- title: React.ReactNode;
262
- /**
263
- * Under the title: "Ana Petrović · 14–18 Eki". When given, the drawer is described by it
264
- * (`aria-describedby`); without it (or with `""`, `false`, `null`) nothing is rendered.
265
- */
266
- subtitle?: React.ReactNode;
267
- /** Beside the close button: a status lozenge, a menu. */
268
- headerActions?: React.ReactNode;
269
- children: React.ReactNode;
270
- /** Sticky at the bottom: the record's actions. */
271
- footer?: React.ReactNode;
272
- /** small 380px, large 560px (medium reads as large). */
273
- size?: OverlaySize;
274
- /** `end` (the side; a bottom sheet on phones) or `bottom` everywhere. */
275
- placement?: "end" | "bottom";
276
- /** Closing (button, Esc, scrim, useDrawerClose) asks first: "Unsaved changes". */
277
- hasUnsavedChanges?: boolean;
278
- };
279
- export type DrawerClose = (options?: {
280
- /**
281
- * Close without the unsaved question: after a save ("Save and close"), when the parent's
282
- * `hasUnsavedChanges` has not re-rendered yet.
283
- */
284
- force?: boolean;
285
- }) => void;
286
- /**
287
- * The drawer's close, for its footer or body. By default it asks first with unsaved edits, like the close
288
- * button, Esc and the scrim; after saving call `close({ force: true })`.
289
- */
290
- export declare function useDrawerClose(): DrawerClose;
291
- /**
292
- * A panel over the page to show or edit one record without losing the list behind it: on the inline end
293
- * (380 or 560px, full height), a bottom sheet on phones that snaps between half and full height. Header with
294
- * title, subtitle and status; a scrolling body; a sticky footer; both keep clear of notches and the home
295
- * indicator. With unsaved edits every way of closing asks first. The title names the drawer and the
296
- * subtitle, when there is one, describes it.
297
- */
298
- export declare function Drawer({ size, placement, isOpen, defaultOpen, onOpenChange, hasUnsavedChanges, title, subtitle, headerActions, children, footer, }: DrawerProps): React.JSX.Element;
299
- export {};