@sesamehr/react-design-system 1.6.1 → 2.0.0-beta.10

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 (132) hide show
  1. package/README.md +34 -0
  2. package/dist/Button/ActionItem/ActionItem.d.ts +40 -0
  3. package/dist/Button/ActionItem/index.d.ts +1 -0
  4. package/dist/Button/IconButton/IconButton.d.ts +32 -0
  5. package/dist/Button/IconButton/index.d.ts +27 -0
  6. package/dist/Data/Table/Table.d.ts +1 -1
  7. package/dist/Data/Table/TableBody/TableBody.d.ts +3 -0
  8. package/dist/Data/Table/TableHead/TableHead.d.ts +25 -1
  9. package/dist/Data/Table/TableScrollbar/TableScrollbar.d.ts +21 -0
  10. package/dist/Data/Table/TableSelectCell/TableSelectCell.d.ts +8 -0
  11. package/dist/Data/Table/TableVirtualized/TableVirtualized.d.ts +45 -0
  12. package/dist/Data/Table/TableVirtualized/index.d.ts +2 -0
  13. package/dist/Data/Table/hooks/index.d.ts +3 -0
  14. package/dist/Data/Table/hooks/useDragToScroll/useDragToScroll.d.ts +12 -2
  15. package/dist/Data/Table/hooks/useTableVirtual/context.d.ts +16 -0
  16. package/dist/Data/Table/hooks/useTableVirtual/index.d.ts +3 -0
  17. package/dist/Data/Table/hooks/useTableVirtual/useTableVirtual.d.ts +36 -0
  18. package/dist/Data/Table/hooks/useTableVirtual/useTableVirtual.types.d.ts +74 -0
  19. package/dist/Data/Table/index.d.ts +2 -2
  20. package/dist/Display/Avatar/AvatarSkeleton/AvatarSkeleton.d.ts +30 -0
  21. package/dist/Display/Avatar/index.d.ts +2 -0
  22. package/dist/Display/AvatarDetails/AvatarDetails.d.ts +68 -0
  23. package/dist/Display/AvatarDetails/index.d.ts +1 -0
  24. package/dist/Display/Badge/Badge.d.ts +3 -2
  25. package/dist/Display/Badge/index.d.ts +10 -1
  26. package/dist/Display/ChatBubble/ChatBubble.d.ts +28 -0
  27. package/dist/Display/ChatBubble/ChatBubbleStatus/ChatBubbleStatus.d.ts +8 -0
  28. package/dist/Display/ChatBubble/ChatBubbleStatus/index.d.ts +10 -0
  29. package/dist/Display/ChatBubble/index.d.ts +44 -0
  30. package/dist/Display/Chip/Chip.d.ts +21 -5
  31. package/dist/Display/Chip/index.d.ts +19 -10
  32. package/dist/Display/FileCard/FileCard.d.ts +66 -0
  33. package/dist/Display/FileCard/index.d.ts +1 -0
  34. package/dist/Display/FilePreviewCard/FilePreviewCard.d.ts +49 -0
  35. package/dist/Display/FilePreviewCard/index.d.ts +1 -0
  36. package/dist/Feedback/Alert/AlertIcon.d.ts +1 -1
  37. package/dist/Feedback/Dialog/DialogBody.d.ts +18 -0
  38. package/dist/Feedback/Dialog/index.d.ts +1 -0
  39. package/dist/Feedback/Loader/Loader.d.ts +16 -0
  40. package/dist/Feedback/Loader/index.d.ts +2 -0
  41. package/dist/Feedback/Popover/PopoverContent.d.ts +0 -1
  42. package/dist/Feedback/Progress/Progress.d.ts +3 -0
  43. package/dist/Feedback/Progress/index.d.ts +17 -0
  44. package/dist/Feedback/Skeleton/Skeleton.d.ts +20 -0
  45. package/dist/Feedback/Skeleton/index.d.ts +2 -0
  46. package/dist/Feedback/Tooltip/TooltipContent.d.ts +0 -1
  47. package/dist/Forms/Field/Counter/Counter.d.ts +9 -0
  48. package/dist/Forms/Field/Counter/index.d.ts +13 -0
  49. package/dist/Forms/Field/FieldGroup/FieldGroup.d.ts +16 -1
  50. package/dist/Forms/Field/FieldLabel/FieldLabel.d.ts +16 -0
  51. package/dist/Forms/Field/FieldMessage/FieldMessage.d.ts +22 -2
  52. package/dist/Forms/Field/index.d.ts +1 -0
  53. package/dist/Forms/Field/useFieldGroup.d.ts +108 -0
  54. package/dist/Forms/Inputs/Calendar/Calendar.d.ts +55 -0
  55. package/dist/Forms/Inputs/Calendar/CalendarDay.d.ts +37 -0
  56. package/dist/Forms/Inputs/Calendar/CalendarRange.d.ts +56 -0
  57. package/dist/Forms/Inputs/Calendar/constraints.d.ts +19 -0
  58. package/dist/Forms/Inputs/Calendar/date.d.ts +28 -0
  59. package/dist/Forms/Inputs/Calendar/index.d.ts +21 -0
  60. package/dist/Forms/Inputs/Calendar/nav.d.ts +34 -0
  61. package/dist/Forms/Inputs/Calendar/testids.d.ts +28 -0
  62. package/dist/Forms/Inputs/Calendar/useCalendarLocale.d.ts +40 -0
  63. package/dist/Forms/Inputs/ChatInput/ChatInput.d.ts +68 -0
  64. package/dist/Forms/Inputs/ChatInput/index.d.ts +46 -0
  65. package/dist/Forms/Inputs/Combobox/ComboboxCancel.d.ts +14 -0
  66. package/dist/Forms/Inputs/Combobox/ComboboxChipsInput.d.ts +4 -0
  67. package/dist/Forms/Inputs/Combobox/ComboboxContent.d.ts +0 -6
  68. package/dist/Forms/Inputs/Combobox/ComboboxGroup.d.ts +6 -2
  69. package/dist/Forms/Inputs/Combobox/ComboboxInput.d.ts +6 -1
  70. package/dist/Forms/Inputs/Combobox/ComboboxItem.d.ts +4 -0
  71. package/dist/Forms/Inputs/Combobox/ComboboxItemEdit.d.ts +124 -0
  72. package/dist/Forms/Inputs/Combobox/context.d.ts +15 -1
  73. package/dist/Forms/Inputs/Combobox/index.d.ts +2 -0
  74. package/dist/Forms/Inputs/Combobox/useChipOverflow.d.ts +30 -0
  75. package/dist/Forms/Inputs/Combobox/useComboboxEditing.d.ts +40 -0
  76. package/dist/Forms/Inputs/Combobox/useComboboxLabels.d.ts +21 -0
  77. package/dist/Forms/Inputs/DatePicker/DatePicker.d.ts +51 -0
  78. package/dist/Forms/Inputs/DatePicker/DatePickerHeader.d.ts +65 -0
  79. package/dist/Forms/Inputs/DatePicker/DatePickerMonthSelect.d.ts +27 -0
  80. package/dist/Forms/Inputs/DatePicker/DatePickerTrigger.d.ts +29 -0
  81. package/dist/Forms/Inputs/DatePicker/DatePickerYearSelect.d.ts +25 -0
  82. package/dist/Forms/Inputs/DatePicker/DateRangePicker.d.ts +61 -0
  83. package/dist/Forms/Inputs/DatePicker/format.d.ts +44 -0
  84. package/dist/Forms/Inputs/DatePicker/index.d.ts +6 -0
  85. package/dist/Forms/Inputs/DatePicker/month.d.ts +28 -0
  86. package/dist/Forms/Inputs/DatePicker/useDatePickerHeader.d.ts +23 -0
  87. package/dist/Forms/Inputs/InputOtp/InputOtp.d.ts +7 -0
  88. package/dist/Forms/Inputs/InputPassword/InputPassword.d.ts +9 -1
  89. package/dist/Forms/Inputs/InputText/InputText.d.ts +9 -0
  90. package/dist/Forms/Inputs/SearchBar/SearchBar.d.ts +35 -0
  91. package/dist/Forms/Inputs/SearchBar/index.d.ts +22 -0
  92. package/dist/Forms/Inputs/SearchBar/useSearchDelay.d.ts +24 -0
  93. package/dist/Forms/Inputs/SearchPanel/SearchPanel.d.ts +71 -0
  94. package/dist/Forms/Inputs/SearchPanel/SearchPanelEmpty.d.ts +16 -0
  95. package/dist/Forms/Inputs/SearchPanel/SearchPanelGroup.d.ts +14 -0
  96. package/dist/Forms/Inputs/SearchPanel/SearchPanelInput.d.ts +31 -0
  97. package/dist/Forms/Inputs/SearchPanel/SearchPanelItem.d.ts +20 -0
  98. package/dist/Forms/Inputs/SearchPanel/SearchPanelList.d.ts +11 -0
  99. package/dist/Forms/Inputs/SearchPanel/context.d.ts +11 -0
  100. package/dist/Forms/Inputs/SearchPanel/index.d.ts +6 -0
  101. package/dist/Forms/Inputs/Select/SelectContent.d.ts +0 -4
  102. package/dist/Forms/Inputs/Select/SelectGroup.d.ts +6 -2
  103. package/dist/Forms/Inputs/Select/SelectItem.d.ts +6 -0
  104. package/dist/Forms/Inputs/Textarea/Textarea.d.ts +69 -0
  105. package/dist/Forms/Inputs/Textarea/index.d.ts +21 -0
  106. package/dist/Forms/Inputs/Toggle/RadioButton/RadioGroup.d.ts +5 -0
  107. package/dist/Forms/Inputs/Toggle/ToggleLabel/ToggleLabel.d.ts +10 -1
  108. package/dist/Forms/Inputs/index.d.ts +6 -0
  109. package/dist/Layout/Scrollbar/Scrollbar.d.ts +46 -0
  110. package/dist/Layout/Scrollbar/index.d.ts +2 -0
  111. package/dist/Layout/Scrollbar/useScrollbar.d.ts +52 -0
  112. package/dist/hooks/index.d.ts +12 -0
  113. package/dist/hooks/useAutoGrow.d.ts +22 -0
  114. package/dist/internal/Listbox/ListboxEmpty.d.ts +3 -0
  115. package/dist/internal/Listbox/ListboxItem.d.ts +23 -0
  116. package/dist/internal/Listbox/ListboxLabel.d.ts +9 -0
  117. package/dist/internal/Listbox/ListboxSeparator.d.ts +3 -0
  118. package/dist/internal/Listbox/ListboxViewport.d.ts +9 -0
  119. package/dist/internal/Surface/Surface.d.ts +35 -0
  120. package/dist/internal/index.d.ts +13 -0
  121. package/dist/lib/cssModules.d.ts +13 -0
  122. package/dist/main.d.ts +18 -7
  123. package/dist/preflight.css +391 -0
  124. package/dist/react-design-system.css +1 -1
  125. package/dist/react-design-system.js +17345 -10589
  126. package/dist/react-design-system.umd.cjs +164 -117
  127. package/package.json +4 -2
  128. package/src/assets/styles/theme-v2.css +6 -6
  129. package/src/assets/styles/theme-v3.css +13 -5
  130. package/dist/Data/Table/TableAvatar/TableAvatar.d.ts +0 -14
  131. package/dist/Display/Tag/Tag.d.ts +0 -19
  132. package/dist/Display/Tag/index.d.ts +0 -2
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ import { ChatBubbleDelivery, ChatBubbleVariants } from './index.ts';
3
+ export interface ChatBubbleProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** Who said it: the reader, or someone else */
5
+ author?: ChatBubbleVariants['author'];
6
+ /**
7
+ * When the message went and whether it arrived, drawn as the footer line.
8
+ *
9
+ * Each key stands alone, so `{ time }`, `{ status }`, both or neither all
10
+ * work and an omitted key renders nothing — there is no flag to set and no
11
+ * line to assemble. Anything this cannot express (a delivery error, an
12
+ * "edited" marker, an avatar) goes in `footer` instead, which replaces this
13
+ * line wholesale when both are given.
14
+ */
15
+ delivery?: ChatBubbleDelivery;
16
+ /**
17
+ * The line under the message, drawn by hand. Ports the Vue `#footer` slot,
18
+ * and wins over `delivery` when both are supplied.
19
+ *
20
+ * Spelled `ReactNode` inline rather than behind an alias because
21
+ * `orxata/max-props` discounts a slot by reading the type *text*, and an alias
22
+ * hides it.
23
+ */
24
+ footer?: ReactNode;
25
+ dataTestid: string;
26
+ }
27
+ /** ChatBubble — mirrors `@sesame/orxata-core` ChatBubble. */
28
+ export declare const ChatBubble: import('react').ForwardRefExoticComponent<ChatBubbleProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,8 @@
1
+ import { ChatBubbleStatusVariants } from './index.ts';
2
+ export interface ChatBubbleStatusProps extends React.HTMLAttributes<HTMLElement> {
3
+ /** How far along the message is */
4
+ status?: NonNullable<ChatBubbleStatusVariants['status']>;
5
+ dataTestid: string;
6
+ }
7
+ /** ChatBubbleStatus — mirrors `@sesame/orxata-core` ChatBubbleStatus. */
8
+ export declare const ChatBubbleStatus: import('react').ForwardRefExoticComponent<ChatBubbleStatusProps & import('react').RefAttributes<HTMLElement>>;
@@ -0,0 +1,10 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export { ChatBubbleStatus, type ChatBubbleStatusProps, } from './ChatBubbleStatus.tsx';
3
+ /**
4
+ * How far along a sent message is. Only the reader's own messages carry one —
5
+ * there is no receipt for what somebody else said.
6
+ */
7
+ export declare const chatBubbleStatusVariants: (props?: ({
8
+ status?: "pending" | "sent" | "delivered" | "read" | null | undefined;
9
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
10
+ export type ChatBubbleStatusVariants = VariantProps<typeof chatBubbleStatusVariants>;
@@ -0,0 +1,44 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { ChatBubbleStatusVariants } from './ChatBubbleStatus/index.ts';
3
+ export { ChatBubble, type ChatBubbleProps } from './ChatBubble.tsx';
4
+ /**
5
+ * When the message went and whether it arrived — the bubble's footer, as data
6
+ * rather than as markup.
7
+ *
8
+ * One object rather than a prop each, for the same reason `ChatInput` takes one
9
+ * `actionLabels`: the parts belong together, they are all optional, and spending
10
+ * a prop per part would put a two-field component against the five-prop cap for
11
+ * no gain. Every key is independent — a time with no receipt, a receipt with no
12
+ * time, both, or neither — and an omitted key renders nothing at all, so the
13
+ * four combinations need no flags to select between them.
14
+ *
15
+ * Nothing here is prose the design system invents. `time` is a string the caller
16
+ * has already formatted, because formatting a date needs a locale, a timezone
17
+ * and a house style, and this package ships no strings and knows none of those.
18
+ * `status` is not text at all — it is an enum the bubble draws as an icon.
19
+ */
20
+ export interface ChatBubbleDelivery {
21
+ /**
22
+ * The timestamp, already formatted — `'13 mar'`, `'09:41'`, whatever the
23
+ * product shows. Omit it for a bubble that carries only a receipt.
24
+ */
25
+ time?: string;
26
+ /**
27
+ * How far along the message is, drawn as a receipt.
28
+ *
29
+ * Only your own messages have one: there is no receipt for what somebody else
30
+ * said, so a bubble with `author: 'other'` normally omits this.
31
+ */
32
+ status?: NonNullable<ChatBubbleStatusVariants['status']>;
33
+ }
34
+ /**
35
+ * Who said it, which is the only thing that varies.
36
+ *
37
+ * The design draws a `Hover` state too, and it holds exactly one thing: a
38
+ * circled chevron for the message's actions menu. That is out of scope here, so
39
+ * hover has nothing left to change and the component does not pretend it does.
40
+ */
41
+ export declare const chatBubbleVariants: (props?: ({
42
+ author?: "other" | "user" | null | undefined;
43
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
44
+ export type ChatBubbleVariants = VariantProps<typeof chatBubbleVariants>;
@@ -1,8 +1,24 @@
1
1
  import { ChipVariants } from './index.ts';
2
- export interface ChipProps extends React.HTMLAttributes<HTMLSpanElement> {
3
- /** Which semantic colour it is tinted with */
4
- tone?: ChipVariants['tone'];
2
+ export interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
3
+ /** How tall it is, and whether it holds a label or a single icon */
4
+ size?: ChipVariants['size'];
5
+ /** How its corners are cut */
6
+ shape?: ChipVariants['shape'];
7
+ /**
8
+ * Whether it is being dragged.
9
+ *
10
+ * Of the four states the design draws, this is the only one the browser
11
+ * cannot tell us about on its own: rest, hover and focus are `:hover` and
12
+ * `:focus-visible`, and there is no `:dragging`.
13
+ */
14
+ dragged?: boolean;
15
+ /** Render as the child element instead of a `<button>` (Radix Slot). */
16
+ asChild?: boolean;
5
17
  dataTestid: string;
6
18
  }
7
- /** Chip — mirrors `@sesame/orxata-core` Chip. */
8
- export declare const Chip: import('react').ForwardRefExoticComponent<ChipProps & import('react').RefAttributes<HTMLSpanElement>>;
19
+ /**
20
+ * Chip — mirrors `@sesame/orxata-core` Chip.
21
+ * `asChild` renders the child element instead of a `<button>`, via
22
+ * `@radix-ui/react-slot`. It is what the Vue side spells `as` / `as-child`.
23
+ */
24
+ export declare const Chip: import('react').ForwardRefExoticComponent<ChipProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -2,18 +2,27 @@ import { VariantProps } from 'class-variance-authority';
2
2
  export { Chip } from './Chip.tsx';
3
3
  export type { ChipProps } from './Chip.tsx';
4
4
  /**
5
- * A chip is a piece of the user's own data — a value they picked, a label they
6
- * applied. `Badge` is the system talking back: a status it assigned, a count it
7
- * worked out. That is the line between the two, and it is why one is a soft
8
- * tint and the other a solid fill.
5
+ * A chip is a value the user picked — one they can drop, a filter they can
6
+ * press. `Badge` is the system talking back: a status it assigned, a count it
7
+ * worked out. That is the line between them, and it is why this one is outlined
8
+ * and that one a solid fill.
9
9
  *
10
- * The tints are opacity over the semantic colour rather than a `-100` step,
11
- * because no such token exists for `warning` or `destructive` and inventing one
12
- * would put a colour in the theme that Figma has never seen. `Table` already
13
- * tints this way. The pair also cannot drift: background and text come off the
14
- * same token, so re-pointing `--success` moves both.
10
+ * It renders a `<button>` by default because pressing one is the common case,
11
+ * but that is a default and not the component: `asChild` renders it as anything,
12
+ * and a chip that only shows a value should be a `<span>` rather than a control
13
+ * with nothing behind it.
14
+ *
15
+ * Class names, not utilities: the declarations live in `Chip.module.css` behind
16
+ * `@apply`. See `Button/index.ts` for the full reasoning.
17
+ *
18
+ * The two axes are the design's own, with one renaming. Its `Form` is `shape`
19
+ * here because `form` on a `<button>` is a native attribute that associates the
20
+ * button with a form, and a prop of that name would quietly eat it. Its
21
+ * `Circle` is this `rounded`: an icon chip's box is already square, so the
22
+ * circle is the same radius as a text chip's pill and needs no value of its own.
15
23
  */
16
24
  export declare const chipVariants: (props?: ({
17
- tone?: "success" | "warning" | "neutral" | "brand" | "error" | null | undefined;
25
+ size?: "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
26
+ shape?: "square" | "rounded" | null | undefined;
18
27
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
19
28
  export type ChipVariants = VariantProps<typeof chipVariants>;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * One attached file as a row. Mirrors `@sesame/orxata-core` FileCard.
3
+ *
4
+ * Built on `Card` rather than redrawing the shell. The radius, the border and
5
+ * the white surface are already a component, and the only reason this file has
6
+ * a stylesheet at all is the row inside it. `flat` is the card the design
7
+ * draws: border, no lift — `Card`'s `flat` keeps the outline and drops only the
8
+ * shadow and the glass.
9
+ *
10
+ * ### Why `name` and `meta` are props and the other two are nodes
11
+ *
12
+ * Sameness is the product for the text, exactly as in `AvatarDetails`: every
13
+ * file row we ship is two lines at the same sizes and weights, and a node is
14
+ * where that guarantee goes to die — the first caller to put a link, a badge or
15
+ * a third line in it ends the point of having the component. `meta` is
16
+ * deliberately not called `size`: what the second line says is the
17
+ * application's business ("1,56 MB", "PDF · yesterday", "Uploaded by Ana"), and
18
+ * naming it after one of those would be a lie the day someone passes another.
19
+ *
20
+ * The glyph and the action are the opposite case. Mapping an extension to an
21
+ * icon is application knowledge — there are hundreds of extensions and we know
22
+ * none of them — so `icon` takes a node and falls back to a generic file glyph,
23
+ * which is the one honest thing a design system can draw. And `action` takes a
24
+ * node because *which* action is not ours either: download, delete, share,
25
+ * retry, or nothing at all. It also settles the accessible name, which we
26
+ * cannot supply since the design system ships no strings — whatever the caller
27
+ * puts there brings its own, and `IconButton` refuses to render without one.
28
+ *
29
+ * ### What it deliberately does not do
30
+ *
31
+ * **It has no width.** The design pins 300px with `min-width`, `max-width` and
32
+ * `width`, and that figure belongs to the screen it was drawn on, not to the
33
+ * component: a card that hardcodes its own width cannot sit in a grid, a
34
+ * sidebar or a flexible column, and the parent owns external layout. It fills
35
+ * what it is given. The 72px height stays, because that one is internal — a
36
+ * list of these has to have rows of equal height, and long names truncate
37
+ * rather than growing the row.
38
+ *
39
+ * **The root is not a button.** It already contains an interactive control, and
40
+ * a button inside a button is invalid HTML; making the root activate would also
41
+ * mean inventing a focus and keyboard contract the design has nothing to say
42
+ * about. A caller who wants the whole row to do something wraps it, or puts a
43
+ * link in `action`.
44
+ */
45
+ export interface FileCardProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title'> {
46
+ /** The file's name. Truncates rather than wrapping — the row is a fixed height. */
47
+ name: string;
48
+ /**
49
+ * The second line: whatever the app knows about the file. Size in the
50
+ * design, but a type, a date or an author read just as well. Omit it and the
51
+ * row is one line.
52
+ */
53
+ meta?: string;
54
+ /**
55
+ * The glyph in the ring. Defaults to a generic file — mapping an extension to
56
+ * an icon is the application's knowledge, not ours.
57
+ */
58
+ icon?: React.ReactNode;
59
+ /**
60
+ * The one thing you can do to this file. Nothing by default; whatever you put
61
+ * here brings its own accessible name.
62
+ */
63
+ action?: React.ReactNode;
64
+ dataTestid: string;
65
+ }
66
+ export declare const FileCard: import('react').ForwardRefExoticComponent<FileCardProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export { FileCard, type FileCardProps } from './FileCard.tsx';
@@ -0,0 +1,49 @@
1
+ /**
2
+ * A file you can see: a square thumbnail with one line under it. Mirrors
3
+ * `@sesame/orxata-core` FilePreviewCard.
4
+ *
5
+ * The sibling of `FileCard`, and deliberately not a variant of it. They differ
6
+ * in axis, in padding, in how they take their width and in what they contain —
7
+ * and, decisively, this one has neither a title nor an action. A `variant` prop
8
+ * would have to flip the layout *and* switch off the title *and* switch off the
9
+ * action, which is three configuration props spent hiding the fact that these
10
+ * are two components. What they genuinely share is the shell, and both get it
11
+ * the same way: from `Card`.
12
+ *
13
+ * ### The image
14
+ *
15
+ * `src` and `alt` rather than a node, because there is nothing to compose — it
16
+ * is one `<img>`, and taking a node would only invite a second one. `alt` is
17
+ * required and has no default for the usual reason: the design system ships no
18
+ * strings, and only the caller knows what the picture is of. Pass `""` if it is
19
+ * genuinely decorative; that is a decision, and it should have to be made.
20
+ *
21
+ * Two failure modes, both handled without a state machine. **Not loaded yet**
22
+ * is a tinted square, so the card holds its shape and reads as a pending
23
+ * thumbnail instead of a white hole. **Failed to load** swaps the `<img>` for a
24
+ * generic picture glyph carrying the same `alt` through `role="img"` — the
25
+ * browser's broken-image icon is neither styleable nor meaningful, and dropping
26
+ * the `<img>` is the only way to be rid of it. A new `src` clears the flag, so
27
+ * one bad URL does not poison the ones after it.
28
+ *
29
+ * ### Size
30
+ *
31
+ * The thumbnail is 150px square from the design, exposed as
32
+ * `--ox-file-preview-card-size` rather than a prop — a dimension is a style
33
+ * concern and CSS variables are how this system inherits those. The card itself
34
+ * has no width at all: it hugs the thumbnail, which is why the design needed no
35
+ * width on it either.
36
+ */
37
+ export interface FilePreviewCardProps extends React.ComponentPropsWithoutRef<'div'> {
38
+ /** The image to show. */
39
+ src: string;
40
+ /** What the image is of. Required — pass `""` only if it is decorative. */
41
+ alt: string;
42
+ /**
43
+ * The single line under the thumbnail: "JPG - 937 KB" in the design, but the
44
+ * app decides what is worth saying.
45
+ */
46
+ meta: string;
47
+ dataTestid: string;
48
+ }
49
+ export declare const FilePreviewCard: import('react').ForwardRefExoticComponent<FilePreviewCardProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export { FilePreviewCard, type FilePreviewCardProps, } from './FilePreviewCard.tsx';
@@ -1,5 +1,5 @@
1
1
  export interface AlertIconProps extends React.HTMLAttributes<HTMLDivElement> {
2
2
  dataTestid: string;
3
3
  }
4
- /** AlertIcon — renders the variant's default lucide icon, or `children` if provided. */
4
+ /** AlertIcon — renders the variant's default icon, or `children` if provided. */
5
5
  export declare const AlertIcon: import('react').ForwardRefExoticComponent<AlertIconProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,18 @@
1
+ export interface DialogBodyProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ dataTestid: string;
3
+ }
4
+ /**
5
+ * DialogBody — mirrors `@sesame/orxata-core` DialogBody. The scrolling region
6
+ * of a dialog.
7
+ *
8
+ * Everything else in the panel — header, footer, steppers, alerts — stays put;
9
+ * only this scrolls once the panel reaches its `max-height`. It carries no
10
+ * styling of its own: the declarations that make it the flexible, scrolling
11
+ * item live on `DialogContent` next to the `max-height` they depend on, since
12
+ * a body is only a scroll region because the panel is capped and splitting
13
+ * that pair across two files is how one of them gets changed alone.
14
+ *
15
+ * `data-slot` rather than position, so it can sit anywhere among the panel's
16
+ * children.
17
+ */
18
+ export declare const DialogBody: import('react').ForwardRefExoticComponent<DialogBodyProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,5 +1,6 @@
1
1
  export { Dialog, type DialogProps } from './Dialog.tsx';
2
2
  export { DialogContent, type DialogContentProps } from './DialogContent.tsx';
3
+ export { DialogBody, type DialogBodyProps } from './DialogBody.tsx';
3
4
  export { DialogTitle, type DialogTitleProps } from './DialogTitle.tsx';
4
5
  export { DialogDescription, type DialogDescriptionProps, } from './DialogDescription.tsx';
5
6
  export { DialogOverlay, type DialogOverlayProps } from './DialogOverlay.tsx';
@@ -0,0 +1,16 @@
1
+ export interface LoaderProps extends React.HTMLAttributes<HTMLSpanElement> {
2
+ dataTestid: string;
3
+ }
4
+ /**
5
+ * The Sesame mark drawing itself, ported from the `HR-loading` After Effects
6
+ * composition the product ships as a Lottie.
7
+ *
8
+ * Nothing in that composition moves: all twelve layers have a static transform
9
+ * and the whole animation lives in trim paths, which is `stroke-dasharray` plus
10
+ * `stroke-dashoffset` under another name. So the port needs no player — the
11
+ * twelve layers collapse to two shapes drawn twice, and the trims become the
12
+ * `@keyframes` in the stylesheet. That is the reason there is no `lottie-web`
13
+ * here: 250 KB on every consumer to replay an animation the stylesheet can
14
+ * express itself.
15
+ */
16
+ export declare const Loader: import('react').ForwardRefExoticComponent<LoaderProps & import('react').RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,2 @@
1
+ export { Loader } from './Loader.tsx';
2
+ export type { LoaderProps } from './Loader.tsx';
@@ -3,5 +3,4 @@ export interface PopoverContentProps extends React.ComponentPropsWithoutRef<type
3
3
  showArrow?: boolean;
4
4
  dataTestid: string;
5
5
  }
6
- /** PopoverContent — portalled Radix popover content with optional arrow. */
7
6
  export declare const PopoverContent: import('react').ForwardRefExoticComponent<PopoverContentProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,7 +1,10 @@
1
+ import { ProgressVariants } from './index.ts';
1
2
  import * as ProgressPrimitive from '@radix-ui/react-progress';
2
3
  export interface ProgressProps extends Omit<React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>, 'value'> {
3
4
  /** How far along, 0 to 100 */
4
5
  value?: number;
6
+ /** What the bar is saying: still going, done, done with a caveat, or failed */
7
+ variant?: ProgressVariants['variant'];
5
8
  dataTestid: string;
6
9
  }
7
10
  /** Progress — mirrors `@sesame/orxata-core` Progress. */
@@ -1,2 +1,19 @@
1
+ import { VariantProps } from 'class-variance-authority';
1
2
  export { Progress } from './Progress.tsx';
2
3
  export type { ProgressProps } from './Progress.tsx';
4
+ /**
5
+ * What the bar is saying, not how far along it is.
6
+ *
7
+ * `brand` is a bar still filling. The other three are a bar that has stopped
8
+ * and has something to report: a job that finished, one that finished with
9
+ * something to look at, one that failed. They are the same three the rest of
10
+ * the system uses for that, and they read the same here.
11
+ *
12
+ * A determinate bar at 100% is not automatically `success` — an upload that
13
+ * reached the end and then failed to process is at 100% and is not good news.
14
+ * The variant is the caller's to say.
15
+ */
16
+ export declare const progressVariants: (props?: ({
17
+ variant?: "success" | "error" | "warning" | "brand" | null | undefined;
18
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
19
+ export type ProgressVariants = VariantProps<typeof progressVariants>;
@@ -0,0 +1,20 @@
1
+ export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ dataTestid: string;
3
+ }
4
+ /**
5
+ * A block that pulses while the content it stands in for is still loading.
6
+ *
7
+ * It configures nothing. One surface, and the caller gives it its shape with
8
+ * ordinary classes — `h-4 w-48` is a line of text, `size-10 rounded-full` is an
9
+ * avatar, `h-32 w-full` is a block. A `shape` or `variant` prop would be three
10
+ * names for three combinations of width, height and radius that CSS already
11
+ * says better, and it would run out the moment somebody needed a fourth.
12
+ *
13
+ * `OxLoader` and `OxProgress` are the other two, and the three are not
14
+ * interchangeable — see the MDX for which is which.
15
+ *
16
+ * `aria-hidden` sits before the spread so a caller who genuinely needs one of
17
+ * these in the accessibility tree can override it. The region carrying
18
+ * `aria-busy` is the right level, and that is the caller's.
19
+ */
20
+ export declare const Skeleton: import('react').ForwardRefExoticComponent<SkeletonProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ export { Skeleton } from './Skeleton.tsx';
2
+ export type { SkeletonProps } from './Skeleton.tsx';
@@ -3,5 +3,4 @@ export interface TooltipContentProps extends React.ComponentPropsWithoutRef<type
3
3
  showArrow?: boolean;
4
4
  dataTestid: string;
5
5
  }
6
- /** TooltipContent — portalled Radix tooltip content with optional arrow. */
7
6
  export declare const TooltipContent: import('react').ForwardRefExoticComponent<TooltipContentProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,9 @@
1
+ export interface CounterProps extends React.HTMLAttributes<HTMLSpanElement> {
2
+ /** How much the field holds now */
3
+ value: number;
4
+ /** How much it is allowed to hold */
5
+ max: number;
6
+ dataTestid: string;
7
+ }
8
+ /** Counter — mirrors `@sesame/orxata-core` Counter. */
9
+ export declare const Counter: import('react').ForwardRefExoticComponent<CounterProps & import('react').RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,13 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export { Counter, type CounterProps } from './Counter.tsx';
3
+ /**
4
+ * Whether the field is still within its limit.
5
+ *
6
+ * Not a prop: the component has `value` and `max`, so asking a caller to also
7
+ * tell it which state that adds up to invites the two to disagree — a red
8
+ * counter reading 20/100, or a grey one reading 150/100.
9
+ */
10
+ export declare const counterVariants: (props?: ({
11
+ state?: "over" | "within" | null | undefined;
12
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
13
+ export type CounterVariants = VariantProps<typeof counterVariants>;
@@ -1,4 +1,19 @@
1
+ import { FieldVariant } from '../useFieldGroup.ts';
1
2
  export interface FieldGroupProps extends React.HTMLAttributes<HTMLDivElement> {
2
- variant?: 'default' | 'error' | 'success' | 'warning';
3
+ variant?: FieldVariant;
3
4
  }
5
+ /**
6
+ * A label, a control and a message, ordered and wired to each other.
7
+ *
8
+ * Two mechanisms, and they are not redundant. The custom properties in the
9
+ * stylesheet paint whatever is inside — including a consumer's own control,
10
+ * which never imported anything from here — with no prop drilling. The context
11
+ * in `useFieldGroup.ts` carries what a custom property cannot: the `id` the
12
+ * label points `htmlFor` at, the `aria-describedby` that reaches the message,
13
+ * and the `aria-invalid` that says the control is wrong.
14
+ *
15
+ * Ordering is done with direct-child selectors, so the label, the control and
16
+ * the message have to be direct children of this element. Anything a consumer
17
+ * wants to wrap around the field goes outside the group, not inside it.
18
+ */
4
19
  export declare const FieldGroup: import('react').ForwardRefExoticComponent<FieldGroupProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,2 +1,18 @@
1
1
  export type FieldLabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;
2
+ /**
3
+ * The field's label.
4
+ *
5
+ * `htmlFor` comes from the surrounding `<OxFieldGroup>` and points at whichever
6
+ * control claimed the field's id — without it this is a bare `<label>` that
7
+ * neither wraps a control nor names one, so clicking it focuses nothing and a
8
+ * screen reader reaching the control announces no name. It is left off
9
+ * entirely when no control has claimed the id, since a `htmlFor` pointing at
10
+ * nothing is not an improvement on no `htmlFor`.
11
+ *
12
+ * `id` is always there so a composite control — one with several focusable
13
+ * children, where `htmlFor` has no single target — can name itself with
14
+ * `aria-labelledby`.
15
+ *
16
+ * A `htmlFor` written by the caller comes in `...props` and wins, as it should.
17
+ */
2
18
  export declare const FieldLabel: import('react').ForwardRefExoticComponent<FieldLabelProps & import('react').RefAttributes<HTMLLabelElement>>;
@@ -1,5 +1,25 @@
1
+ import { FieldVariant } from '../useFieldGroup.ts';
1
2
  export interface FieldMessageProps extends React.HTMLAttributes<HTMLDivElement> {
2
- message?: string;
3
- variant?: 'default' | 'error' | 'success' | 'warning';
3
+ /**
4
+ * Overrides the group's variant. Leave it out inside an `<OxFieldGroup>` and
5
+ * the group's own variant comes through the context, so `error` is written
6
+ * once instead of on both.
7
+ */
8
+ variant?: FieldVariant;
4
9
  }
10
+ /**
11
+ * The field's feedback line.
12
+ *
13
+ * `id` comes from the surrounding `<OxFieldGroup>` so the control can point
14
+ * `aria-describedby` at it. Without one, the error was announced when it
15
+ * appeared and never again: tab back to a field that is already wrong and
16
+ * nothing described it.
17
+ *
18
+ * `role="alert"` and nothing else. The pair it used to carry — `role="alert"`
19
+ * with `aria-live="polite"` — contradicted itself, since `alert` already
20
+ * implies `assertive`. `alert` is the half worth keeping: it is what makes a
21
+ * message that appears after a submit interrupt, and the case it does not
22
+ * cover, a field that is *already* wrong when you reach it, is now covered by
23
+ * `aria-describedby` instead.
24
+ */
5
25
  export declare const FieldMessage: import('react').ForwardRefExoticComponent<FieldMessageProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,4 @@
1
1
  export { FieldGroup, type FieldGroupProps } from './FieldGroup/FieldGroup.tsx';
2
2
  export { FieldLabel, type FieldLabelProps } from './FieldLabel/FieldLabel.tsx';
3
3
  export { FieldMessage, type FieldMessageProps, } from './FieldMessage/FieldMessage.tsx';
4
+ export { useFieldControl, useFieldControlGroup, type FieldControlAttrs, type FieldControlGroupAttrs, type FieldVariant, } from './useFieldGroup.ts';
@@ -0,0 +1,108 @@
1
+ /**
2
+ * What a `<OxFieldGroup>` hands to the label, the control and the message
3
+ * inside it.
4
+ *
5
+ * `FieldGroup` already paints its children through custom properties
6
+ * (`--message-text-color`, `--controller-border-color`), and that stays: it is
7
+ * what lets a consumer's own control inherit the error colour with no prop
8
+ * drilling. A custom property cannot carry an `id` or an `aria-invalid`,
9
+ * though, so the accessible half needs a real context beside it.
10
+ *
11
+ * Every piece is optional. A control used on its own — no `FieldGroup`
12
+ * anywhere above it — gets an empty attribute bag and renders exactly as it
13
+ * did before, which is why `useFieldGroup` returns `undefined` instead of
14
+ * throwing the way `useInputPassword` does. There, a subcomponent outside its
15
+ * root is meaningless; here, a bare `<OxInputText>` is a perfectly good input.
16
+ *
17
+ * Nothing emits an IDREF that points at nothing. `aria-describedby` waits for
18
+ * a message to mount, `aria-labelledby` for a label, and `<label htmlFor>` for
19
+ * a control to claim the id — a reference to an element that is not there is
20
+ * worse than no reference, because some readers then announce nothing at all
21
+ * rather than falling back.
22
+ */
23
+ export type FieldVariant = 'default' | 'error' | 'success' | 'warning';
24
+ /** The parts of the group that announce themselves so an IDREF never dangles. */
25
+ type FieldPart = 'label' | 'message';
26
+ export interface FieldGroupContextValue {
27
+ /**
28
+ * Id on the `<label>`. A composite control — one with several focusable
29
+ * children, where `htmlFor` has no single target — names itself by pointing
30
+ * `aria-labelledby` here.
31
+ */
32
+ labelId: string;
33
+ /** Id on the message, and what a control points `aria-describedby` at. */
34
+ messageId: string;
35
+ /** What `<label htmlFor>` points at, once a control has claimed it. */
36
+ controlId: string | undefined;
37
+ variant: FieldVariant;
38
+ hasLabel: boolean;
39
+ hasMessage: boolean;
40
+ /** Announce a part as mounted. Returns the call that takes it back. */
41
+ register: (_part: FieldPart) => () => void;
42
+ /**
43
+ * Offer an id as the one the label names. The first control to ask gets it;
44
+ * a second is refused, because one label names one thing.
45
+ */
46
+ claimControl: (_id: string) => () => void;
47
+ }
48
+ export interface FieldControlAttrs {
49
+ id?: string;
50
+ 'aria-invalid'?: true;
51
+ 'aria-describedby'?: string;
52
+ }
53
+ export interface FieldControlGroupAttrs {
54
+ 'aria-labelledby'?: string;
55
+ 'aria-invalid'?: true;
56
+ 'aria-describedby'?: string;
57
+ }
58
+ export interface FieldLabelAttrs {
59
+ id?: string;
60
+ htmlFor?: string;
61
+ }
62
+ export declare const FieldGroupContext: import('react').Context<FieldGroupContextValue | null>;
63
+ /**
64
+ * The surrounding field, or `undefined` when there is none.
65
+ *
66
+ * Deliberately not a throwing `useXxx`: the context is optional, so its
67
+ * absence is not an error.
68
+ */
69
+ export declare function useFieldGroup(): FieldGroupContextValue | undefined;
70
+ /**
71
+ * Wiring for a control the `<label>` can point `htmlFor` at — anything
72
+ * labelable: `input`, `textarea`, `select`, and the `button`s Radix renders
73
+ * for a checkbox, a switch or a select trigger.
74
+ *
75
+ * Spread it *before* `{...props}` so the caller's attributes win over it, and
76
+ * hand it the caller's own `id`: that is what makes an explicit `id` survive,
77
+ * with the label following it there rather than staying on the generated one.
78
+ * Vue's half reads the id out of `useAttrs()` instead — React has no such
79
+ * channel, so the prop has to be passed in.
80
+ */
81
+ export declare function useFieldControl(id?: string): FieldControlAttrs;
82
+ /**
83
+ * Wiring for a composite — `OxRadioGroup`, `OxInputOtp` — where "put the id on
84
+ * the control" has no single answer because there are several focusable
85
+ * elements and one id cannot be on all of them.
86
+ *
87
+ * It names itself with `aria-labelledby` instead, so the element it goes on
88
+ * needs a role that takes a name from the author: Radix gives its radio group
89
+ * `role="radiogroup"`, and anything else has to say `role="group"` itself. On
90
+ * a plain `<div>` the name is dropped on the floor.
91
+ */
92
+ export declare function useFieldControlGroup(): FieldControlGroupAttrs;
93
+ /** Wiring for a `<label>` inside the group: its own id, and what it names. */
94
+ export declare function useFieldLabel(): FieldLabelAttrs;
95
+ /**
96
+ * Wiring for the message: the id a control describes itself with, and the
97
+ * group's variant so it does not have to be written on both.
98
+ */
99
+ export declare function useFieldMessage(): {
100
+ id?: string;
101
+ variant?: FieldVariant;
102
+ };
103
+ /**
104
+ * The state a `<OxFieldGroup>` owns. Split out of the component so the ids and
105
+ * the bookkeeping live next to the hooks that read them.
106
+ */
107
+ export declare function useProvideFieldGroup(variant: FieldVariant): FieldGroupContextValue;
108
+ export {};