@jonmilner/ui 0.22.0 → 0.23.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 (142) hide show
  1. package/README.md +17 -0
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/Alert/Alert.css +2 -0
  4. package/dist/Alert/Alert.css.mjs +9 -0
  5. package/dist/Alert/index.d.mts +13 -0
  6. package/dist/Alert/index.mjs +45 -0
  7. package/dist/AlertDialog/client.mjs +4 -4
  8. package/dist/AlertDialog/index.d.mts +3 -2
  9. package/dist/AlertDialog/index.mjs +10 -9
  10. package/dist/Avatar/Avatar.css +1 -1
  11. package/dist/Badge/Badge.css +1 -1
  12. package/dist/Body/index.d.mts +9 -0
  13. package/dist/Body/index.mjs +12 -0
  14. package/dist/Box/Box.css +1 -1
  15. package/dist/Button/Button.css +1 -1
  16. package/dist/Caption/index.d.mts +6 -0
  17. package/dist/Caption/index.mjs +14 -0
  18. package/dist/Checkbox/Checkbox.css +1 -1
  19. package/dist/Chip/Chip.css +1 -1
  20. package/dist/Clickable/Clickable.css +1 -1
  21. package/dist/Code/Code.css +2 -0
  22. package/dist/Code/Code.css.mjs +7 -0
  23. package/dist/Code/index.d.mts +10 -0
  24. package/dist/Code/index.mjs +40 -0
  25. package/dist/ColorField/ColorField.css +2 -2
  26. package/dist/Combobox/Combobox.css +2 -2
  27. package/dist/Dialog/Dialog.css +2 -2
  28. package/dist/Dialog/client.d.mts +1 -1
  29. package/dist/Dialog/client.mjs +14 -12
  30. package/dist/Dialog/index.d.mts +1 -1
  31. package/dist/Field/Field.css +1 -1
  32. package/dist/Flex/index.d.mts +5 -0
  33. package/dist/Flex/index.mjs +14 -0
  34. package/dist/Heading/Heading.css +1 -1
  35. package/dist/Icon/Icon.css +1 -1
  36. package/dist/IconButton/IconButton.css +1 -1
  37. package/dist/Inline/Inline.css +1 -1
  38. package/dist/Inline/index.mjs +1 -1
  39. package/dist/Label/index.d.mts +9 -0
  40. package/dist/Label/index.mjs +19 -0
  41. package/dist/Menu/Menu.css +2 -2
  42. package/dist/Menu/Menu.css.mjs +2 -2
  43. package/dist/Menu/client.mjs +56 -77
  44. package/dist/Menu/item-row.mjs +2 -2
  45. package/dist/MultiSelect/MultiSelect.css +2 -2
  46. package/dist/NavList/NavList.css +1 -1
  47. package/dist/NumberField/NumberField.css +2 -2
  48. package/dist/Popover/Popover.css +2 -0
  49. package/dist/Popover/Popover.css.mjs +7 -0
  50. package/dist/Popover/client.d.mts +11 -0
  51. package/dist/Popover/client.mjs +54 -0
  52. package/dist/Popover/index.d.mts +20 -0
  53. package/dist/Popover/index.mjs +39 -0
  54. package/dist/RadioGroup/RadioGroup.css +1 -1
  55. package/dist/SearchField/SearchField.css +2 -2
  56. package/dist/Select/Select.css +2 -2
  57. package/dist/Sidebar/Sidebar.css +1 -1
  58. package/dist/SidebarLayout/SidebarLayout.css +1 -1
  59. package/dist/Stack/Stack.css +1 -1
  60. package/dist/Stack/index.mjs +1 -1
  61. package/dist/Switch/Switch.css +1 -1
  62. package/dist/Table/Table.css +2 -2
  63. package/dist/Table/Table.css.mjs +4 -2
  64. package/dist/Table/index.d.mts +3 -9
  65. package/dist/Table/index.mjs +60 -74
  66. package/dist/Tabs/Tabs.css +1 -1
  67. package/dist/Tag/Tag.css +1 -1
  68. package/dist/Text/Text.css +1 -1
  69. package/dist/TextField/TextField.css +2 -2
  70. package/dist/Textarea/Textarea.css +2 -2
  71. package/dist/Toast/Toast.css +2 -2
  72. package/dist/Toast/Toast.css.mjs +10 -7
  73. package/dist/Toast/client.d.mts +3 -18
  74. package/dist/Toast/client.mjs +90 -132
  75. package/dist/Tooltip/Tooltip.css +1 -1
  76. package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
  77. package/dist/base.css +2 -2
  78. package/dist/brands/default.mjs +2 -1
  79. package/dist/brands/forced-colors.mjs +2 -1
  80. package/dist/brands/neutral.mjs +8 -7
  81. package/dist/contrast/contrast.mjs +43 -35
  82. package/dist/contrast/mixes.mjs +15 -8
  83. package/dist/docs/Alert.md +106 -0
  84. package/dist/docs/AlertDialog.md +25 -11
  85. package/dist/docs/Body.md +74 -0
  86. package/dist/docs/Box.md +4 -3
  87. package/dist/docs/Caption.md +77 -0
  88. package/dist/docs/Code.md +84 -0
  89. package/dist/docs/ColorField.md +1 -1
  90. package/dist/docs/Combobox.md +2 -1
  91. package/dist/docs/Dialog.md +28 -4
  92. package/dist/docs/Flex.md +76 -0
  93. package/dist/docs/Icon.md +1 -0
  94. package/dist/docs/Inline.md +3 -2
  95. package/dist/docs/Label.md +77 -0
  96. package/dist/docs/Menu.md +3 -3
  97. package/dist/docs/MultiSelect.md +1 -0
  98. package/dist/docs/NumberField.md +1 -1
  99. package/dist/docs/Popover.md +135 -0
  100. package/dist/docs/SearchField.md +1 -1
  101. package/dist/docs/Select.md +1 -0
  102. package/dist/docs/Stack.md +12 -10
  103. package/dist/docs/Table.md +5 -5
  104. package/dist/docs/Text.md +30 -23
  105. package/dist/docs/TextField.md +1 -1
  106. package/dist/docs/Textarea.md +1 -1
  107. package/dist/docs/Toast.md +7 -7
  108. package/dist/docs/Tooltip.md +2 -2
  109. package/dist/docs/lint.md +18 -0
  110. package/dist/docs/llms.txt +19 -10
  111. package/dist/docs/manifest.json +557 -7
  112. package/dist/docs/migrations/0.23.0.md +84 -0
  113. package/dist/docs/theming.md +3 -3
  114. package/dist/icons/TriangleAlertIcon.d.mts +2 -0
  115. package/dist/icons/TriangleAlertIcon.mjs +10 -0
  116. package/dist/icons/index.d.mts +3 -2
  117. package/dist/icons/index.mjs +4 -3
  118. package/dist/index.d.mts +11 -3
  119. package/dist/index.mjs +47 -40
  120. package/dist/lint/index.d.mts +20 -1
  121. package/dist/lint/index.mjs +18 -3
  122. package/dist/popup/client.mjs +20 -19
  123. package/dist/popup/direction.d.mts +2 -1
  124. package/dist/popup/positioner.mjs +27 -0
  125. package/dist/scroll-region/scroll-region.d.mts +12 -0
  126. package/dist/scroll-region/scroll-region.mjs +29 -0
  127. package/dist/status-message/status-message.d.mts +5 -0
  128. package/dist/status-message/status-message.mjs +74 -0
  129. package/dist/status-message/tones.d.mts +7 -0
  130. package/dist/status-message/tones.mjs +8 -0
  131. package/dist/styles/atom-values.mjs +131 -0
  132. package/dist/styles/atoms.css +1 -1
  133. package/dist/styles/layers.css +1 -1
  134. package/dist/styles/responsive.css +1 -1
  135. package/dist/styles/scroll-region.css +2 -0
  136. package/dist/styles/scroll-region.css.mjs +7 -0
  137. package/dist/styles/status-message.css +2 -0
  138. package/dist/styles/status-message.css.mjs +7 -0
  139. package/dist/tokens/contract.d.mts +1 -1
  140. package/dist/tokens/roles.d.mts +1 -1
  141. package/dist/tokens/roles.mjs +1 -1
  142. package/package.json +30 -2
@@ -0,0 +1,84 @@
1
+ # 0.23.0
2
+
3
+ Three breaking changes: the `backdrop` color role, Toast's `error` variant renamed `danger`, and Toast's title offset.
4
+
5
+ **`backdrop` color role.** `Brand["color"]` gains a required role, `backdrop`, the scrim behind a Dialog (decision 0182). Dialog's backdrop was a fixed 40% of `shadow`, which barely dimmed a dark page. It now uses the role: 40% in light mode and 70% in dark in the presets. A brand that lists its own color roles must add it.
6
+
7
+ **Toast `error` is now `danger`.** Toast's variants are now `info`, `success`, `warning` and `danger`, the names every status message uses (decision 0184). `error` has no alias and is a type error. Toast also takes its variant's tinted fill, and `defineTheme` checks each tinted fill under a secondary Button, so a brand with its own subtle fills can now fail the contrast check.
8
+
9
+ **Toast's title offset.** Toast's title drops to center its first line on the icon, and its close button shares that center without adding height (decision 0186). A toast with only a one-line title shrinks 4px; a taller one, with a description, an action or a wrapped title, grows about 4px. Apps still type-check; most only update their visual baselines.
10
+
11
+ ## Find
12
+
13
+ ### `backdrop` color role
14
+
15
+ In the app's source (`*.ts`, `*.tsx`), every custom brand: regex `defineTheme\(` and `:\s*Brand\b`.
16
+
17
+ - It spreads a preset (`...defaultBrand.color`): nothing to add, and it gets the preset's `backdrop`. The backdrop no longer follows `shadow`, so a brand that recolors `shadow` and wants a matching scrim sets `backdrop` too.
18
+ - It lists every role itself: it is missing `backdrop`.
19
+
20
+ Every workaround that restyled the backdrop through the portal's DOM: regex `data-base-ui-portal|\[role="presentation"\]` in `*.css.ts` and `*.css`.
21
+
22
+ ### Toast `error` is now `danger`
23
+
24
+ In the app's source (`*.ts`, `*.tsx`), every toast with the old variant: regex `variant:\s*["']error["']` near `useToast` or `.add(`. The regex misses a value held in a variable, which the typecheck catches. It also misses one cast past the type or set from untyped code, so check those by hand: at runtime an unknown variant falls back to `info`, a polite toast that closes itself.
25
+
26
+ ### Toast's title offset
27
+
28
+ In the app's visual tests, every baseline that shows a toast: regex `useToast` in the app's source (`*.ts`, `*.tsx`), then find the screens and tests that fire each match. In the app's styles, anything that assumes a toast's height: regex `toast` in `*.css.ts` and `*.css`, then read each match for a fixed height or offset.
29
+
30
+ ## Replace
31
+
32
+ ### `backdrop` color role
33
+
34
+ Add `backdrop` after `shadow`, a `light-dark(<light>, <dark>)` pair of translucent colors.
35
+
36
+ ```ts
37
+ // before
38
+ shadow: "light-dark(#111, #000)",
39
+ // after
40
+ shadow: "light-dark(#111, #000)",
41
+ backdrop: "light-dark(oklch(0.145 0 0 / 0.4), oklch(0 0 0 / 0.7))",
42
+ ```
43
+
44
+ Or take the `default` brand's value: `backdrop: defaultBrand.color.backdrop`.
45
+
46
+ Replace a structural `globalStyle` on the backdrop with the role: delete the rule and set the color in the brand, or override `--color-backdrop` on `[data-brand]` from `@layer app` under a preset. A rule on `:root` has no effect.
47
+
48
+ ### Toast `error` is now `danger`
49
+
50
+ ```ts
51
+ // before
52
+ toast.add({ title: "Couldn't save", variant: "error" });
53
+ // after
54
+ toast.add({ title: "Couldn't save", variant: "danger" });
55
+ ```
56
+
57
+ `danger` keeps what `error` did: it is announced at once and stays until dismissed.
58
+
59
+ A brand that fails the new contrast check names `controlFill` over one of `accentSubtle`, `successSubtle`, `warningSubtle` or `dangerSubtle`, or the mix `secondary Button hover on <fill>` for one of the same fills. Either way, lighten that fill in light mode or darken it in dark mode until `fg` passes 4.5:1.
60
+
61
+ ### Toast's title offset
62
+
63
+ No API changed. Update the baselines found above, and change any fixed height or offset that holds a toast: 4px less for one with only a one-line title, about 4px more for a taller one.
64
+
65
+ ```ts
66
+ // before, a toast with a description
67
+ blockSize: "88px",
68
+ // after
69
+ blockSize: "92px",
70
+ ```
71
+
72
+ ## Verify
73
+
74
+ ### `backdrop` color role
75
+
76
+ Run the app's typecheck (`pnpm typecheck`); it passes with no error naming `backdrop`. Then open a Dialog in dark mode: the page behind it is clearly dimmed, and the backdrop's computed `background-color` has an alpha of 0.7, or the value the brand sets.
77
+
78
+ ### Toast `error` is now `danger`
79
+
80
+ Run the app's typecheck (`pnpm typecheck`); it passes with no error naming `"error"` on a toast. Then trigger a `danger` toast: it has a red tint and stays until dismissed.
81
+
82
+ ### Toast's title offset
83
+
84
+ Run the app's visual tests; the only differences are toasts and dark-mode Dialog backdrops. Then trigger a toast with a description: the icon's center lines up with the center of the title's first line, and the description is not clipped.
@@ -42,11 +42,11 @@ const inbox = defineTheme({
42
42
 
43
43
  `accent` colors links, tabs, checked boxes and pressed chips, and is also text on a surface; `accentFill` is the primary Button's solid fill, with `accentFillFg` text on it in both modes. Recolor both together, and the accent's subtle pair so an accent Tag or subtle Badge turns red too.
44
44
 
45
- Each tone (`neutral`, `accent`, `success`, `warning`, `danger`, `done`) also has a subtle pair, `<tone>Subtle` with `<tone>SubtleFg` text, for Badge's `subtle` variants and Tag's fills. Recolor a tone's subtle pair with it: the text needs 4.5:1 on its fill and 3:1 on `bg`, and `focus` 3:1 on the fill.
45
+ Each tone (`neutral`, `accent`, `success`, `warning`, `danger`, `done`) also has a subtle pair, `<tone>Subtle` with `<tone>SubtleFg` text, for Badge's `subtle` variants and Tag's fills. Recolor a tone's subtle pair with it: the text needs 4.5:1 on its fill and 3:1 on `bg`, and `focus` 3:1 on the fill. A Toast's fills (`accentSubtle`, `successSubtle`, `warningSubtle`, `dangerSubtle`) also carry a secondary Button, so `fg` needs 4.5:1 on `controlFill` over each of them, and on that Button's hover tint.
46
46
 
47
- The neutrals (`bg`, `bgMuted`, `bgRaised`, `bgPanel`, `fg`, `fgMuted`, `border`, `borderStrong`, `neutralSubtle`, `neutralSubtleFg`, `shadow`) come from one OKLCH ramp in the presets: a hue and a chroma on a lightness table every brand shares. Text and borders mirror in dark mode (`fgMuted` is step 600 light, 400 dark); surfaces climb instead, so a raised surface is lighter than the page in dark mode and the same white with a shadow in light.
47
+ The neutrals (`bg`, `bgMuted`, `bgRaised`, `bgPanel`, `fg`, `fgMuted`, `border`, `borderStrong`, `neutralSubtle`, `neutralSubtleFg`, `shadow`, `backdrop`) come from one OKLCH ramp in the presets: a hue and a chroma on a lightness table every brand shares. Text and borders mirror in dark mode (`fgMuted` is step 600 light, 400 dark); surfaces climb instead, so a raised surface is lighter than the page in dark mode and the same white with a shadow in light.
48
48
 
49
- Three overlay roles lay a tint over whatever surface is under them: `hover` for a hovered item, `controlFill` for a resting control, `selected` for a selected one. Each is `fg` at a low alpha (4%, 5% and 7% in the presets), so set them from your `fg` when you recolor it. They are fills, never text, and the only roles that may be translucent. `fg` and `fgMuted` need 4.5:1 on each overlay over every surface. Under forced colors `hover` and `selected` turn `Highlight` and `controlFill` turns `ButtonFace`, so text on a hovered or selected item takes `HighlightText` there.
49
+ Three overlay roles lay a tint over whatever surface is under them: `hover` for a hovered item, `controlFill` for a resting control, `selected` for a selected one. Each is `fg` at a low alpha (4%, 5% and 7% in the presets), so set them from your `fg` when you recolor it. They are fills, never text, and with `backdrop` the only roles that may be translucent. `fg` and `fgMuted` need 4.5:1 on each overlay over every surface. Under forced colors `hover` and `selected` turn `Highlight` and `controlFill` turns `ButtonFace`, so text on a hovered or selected item takes `HighlightText` there.
50
50
 
51
51
  `defineTheme(brand)` takes a full `Brand`: every color role as `light-dark(<light>, <dark>)` and every font role. A missing role is a type error, and a missing color role also throws in every mode. It returns CSS that `ThemeProvider` renders as `<style href precedence="ui-theme">`; React hoists it into `<head>` and renders it once per name.
52
52
 
@@ -0,0 +1,2 @@
1
+ import { IconProps } from "../Icon/index.mjs";
2
+ export declare function TriangleAlertIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Icon as e } from "../Icon/index.mjs";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ // src/icons/TriangleAlertIcon.tsx
4
+ function n(n) {
5
+ return /* @__PURE__ */ t(e, {
6
+ ...n,
7
+ children: /* @__PURE__ */ t("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4M12 17h.01" })
8
+ });
9
+ }
10
+ export { n as TriangleAlertIcon };
@@ -29,7 +29,8 @@ import { ReplyIcon } from "./ReplyIcon.mjs";
29
29
  import { SearchIcon } from "./SearchIcon.mjs";
30
30
  import { SettingsIcon } from "./SettingsIcon.mjs";
31
31
  import { Trash2Icon } from "./Trash2Icon.mjs";
32
+ import { TriangleAlertIcon } from "./TriangleAlertIcon.mjs";
32
33
  import { XIcon } from "./XIcon.mjs";
33
- export declare const iconNames: readonly ["ArrowDownIcon", "ArrowLeftIcon", "ArrowRightIcon", "ArrowUpIcon", "CheckIcon", "ChevronDownIcon", "ChevronRightIcon", "CircleAlertIcon", "CircleCheckIcon", "CircleDotIcon", "CircleSlashIcon", "EllipsisIcon", "GitMergeIcon", "GitPullRequestClosedIcon", "GitPullRequestDraftIcon", "GitPullRequestIcon", "InboxIcon", "InfoIcon", "LoaderCircleIcon", "LockOpenIcon", "MinusIcon", "PanelLeftCloseIcon", "PanelLeftOpenIcon", "PencilIcon", "PlayIcon", "PlusIcon", "RefreshCwIcon", "ReplyIcon", "SearchIcon", "SettingsIcon", "Trash2Icon", "XIcon"];
34
+ export declare const iconNames: readonly ["ArrowDownIcon", "ArrowLeftIcon", "ArrowRightIcon", "ArrowUpIcon", "CheckIcon", "ChevronDownIcon", "ChevronRightIcon", "CircleAlertIcon", "CircleCheckIcon", "CircleDotIcon", "CircleSlashIcon", "EllipsisIcon", "GitMergeIcon", "GitPullRequestClosedIcon", "GitPullRequestDraftIcon", "GitPullRequestIcon", "InboxIcon", "InfoIcon", "LoaderCircleIcon", "LockOpenIcon", "MinusIcon", "PanelLeftCloseIcon", "PanelLeftOpenIcon", "PencilIcon", "PlayIcon", "PlusIcon", "RefreshCwIcon", "ReplyIcon", "SearchIcon", "SettingsIcon", "Trash2Icon", "TriangleAlertIcon", "XIcon"];
34
35
  export type IconName = (typeof iconNames)[number];
35
- export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CircleAlertIcon, CircleCheckIcon, CircleDotIcon, CircleSlashIcon, EllipsisIcon, GitMergeIcon, GitPullRequestClosedIcon, GitPullRequestDraftIcon, GitPullRequestIcon, InboxIcon, InfoIcon, LoaderCircleIcon, LockOpenIcon, MinusIcon, PanelLeftCloseIcon, PanelLeftOpenIcon, PencilIcon, PlayIcon, PlusIcon, RefreshCwIcon, ReplyIcon, SearchIcon, SettingsIcon, Trash2Icon, XIcon };
36
+ export { ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CircleAlertIcon, CircleCheckIcon, CircleDotIcon, CircleSlashIcon, EllipsisIcon, GitMergeIcon, GitPullRequestClosedIcon, GitPullRequestDraftIcon, GitPullRequestIcon, InboxIcon, InfoIcon, LoaderCircleIcon, LockOpenIcon, MinusIcon, PanelLeftCloseIcon, PanelLeftOpenIcon, PencilIcon, PlayIcon, PlusIcon, RefreshCwIcon, ReplyIcon, SearchIcon, SettingsIcon, Trash2Icon, TriangleAlertIcon, XIcon };
@@ -29,7 +29,8 @@ import { ReplyIcon as D } from "./ReplyIcon.mjs";
29
29
  import { SearchIcon as O } from "./SearchIcon.mjs";
30
30
  import { SettingsIcon as k } from "./SettingsIcon.mjs";
31
31
  import { Trash2Icon as A } from "./Trash2Icon.mjs";
32
- import { XIcon as j } from "./XIcon.mjs";
32
+ import { TriangleAlertIcon as j } from "./TriangleAlertIcon.mjs";
33
+ import { XIcon as M } from "./XIcon.mjs";
33
34
  // src/icons/index.ts
34
- var M = /* @__PURE__ */ "ArrowDownIcon.ArrowLeftIcon.ArrowRightIcon.ArrowUpIcon.CheckIcon.ChevronDownIcon.ChevronRightIcon.CircleAlertIcon.CircleCheckIcon.CircleDotIcon.CircleSlashIcon.EllipsisIcon.GitMergeIcon.GitPullRequestClosedIcon.GitPullRequestDraftIcon.GitPullRequestIcon.InboxIcon.InfoIcon.LoaderCircleIcon.LockOpenIcon.MinusIcon.PanelLeftCloseIcon.PanelLeftOpenIcon.PencilIcon.PlayIcon.PlusIcon.RefreshCwIcon.ReplyIcon.SearchIcon.SettingsIcon.Trash2Icon.XIcon".split(".");
35
- export { e as ArrowDownIcon, t as ArrowLeftIcon, n as ArrowRightIcon, r as ArrowUpIcon, i as CheckIcon, a as ChevronDownIcon, o as ChevronRightIcon, s as CircleAlertIcon, c as CircleCheckIcon, l as CircleDotIcon, u as CircleSlashIcon, d as EllipsisIcon, f as GitMergeIcon, p as GitPullRequestClosedIcon, m as GitPullRequestDraftIcon, h as GitPullRequestIcon, g as InboxIcon, _ as InfoIcon, v as LoaderCircleIcon, y as LockOpenIcon, b as MinusIcon, x as PanelLeftCloseIcon, S as PanelLeftOpenIcon, C as PencilIcon, w as PlayIcon, T as PlusIcon, E as RefreshCwIcon, D as ReplyIcon, O as SearchIcon, k as SettingsIcon, A as Trash2Icon, j as XIcon, M as iconNames };
35
+ var N = /* @__PURE__ */ "ArrowDownIcon.ArrowLeftIcon.ArrowRightIcon.ArrowUpIcon.CheckIcon.ChevronDownIcon.ChevronRightIcon.CircleAlertIcon.CircleCheckIcon.CircleDotIcon.CircleSlashIcon.EllipsisIcon.GitMergeIcon.GitPullRequestClosedIcon.GitPullRequestDraftIcon.GitPullRequestIcon.InboxIcon.InfoIcon.LoaderCircleIcon.LockOpenIcon.MinusIcon.PanelLeftCloseIcon.PanelLeftOpenIcon.PencilIcon.PlayIcon.PlusIcon.RefreshCwIcon.ReplyIcon.SearchIcon.SettingsIcon.Trash2Icon.TriangleAlertIcon.XIcon".split(".");
36
+ export { e as ArrowDownIcon, t as ArrowLeftIcon, n as ArrowRightIcon, r as ArrowUpIcon, i as CheckIcon, a as ChevronDownIcon, o as ChevronRightIcon, s as CircleAlertIcon, c as CircleCheckIcon, l as CircleDotIcon, u as CircleSlashIcon, d as EllipsisIcon, f as GitMergeIcon, p as GitPullRequestClosedIcon, m as GitPullRequestDraftIcon, h as GitPullRequestIcon, g as InboxIcon, _ as InfoIcon, v as LoaderCircleIcon, y as LockOpenIcon, b as MinusIcon, x as PanelLeftCloseIcon, S as PanelLeftOpenIcon, C as PencilIcon, w as PlayIcon, T as PlusIcon, E as RefreshCwIcon, D as ReplyIcon, O as SearchIcon, k as SettingsIcon, A as Trash2Icon, j as TriangleAlertIcon, M as XIcon, N as iconNames };
package/dist/index.d.mts CHANGED
@@ -1,29 +1,37 @@
1
1
  import { BoxProps, StyleProps } from "./Box/base.mjs";
2
+ import { Alert, AlertProps } from "./Alert/index.mjs";
2
3
  import { AlertDialog, AlertDialogProps, AlertDialogTriggerProps } from "./AlertDialog/index.mjs";
3
4
  import { Avatar, AvatarProps } from "./Avatar/index.mjs";
4
5
  import { Badge, BadgeProps } from "./Badge/index.mjs";
6
+ import { Body, BodyProps, BodySize } from "./Body/index.mjs";
5
7
  import { Box } from "./Box/index.mjs";
6
8
  import { DialogCloseProps, DialogTriggerProps } from "./Dialog/client.mjs";
7
9
  import { Button, ButtonProps } from "./Button/index.mjs";
10
+ import { Caption, CaptionProps } from "./Caption/index.mjs";
8
11
  import { Checkbox, CheckboxProps } from "./Checkbox/index.mjs";
9
12
  import { Chip, ChipGroup, ChipGroupProps, ChipProps } from "./Chip/index.mjs";
10
13
  import { Clickable, ClickableProps } from "./Clickable/index.mjs";
14
+ import { Code, CodeBlockProps, CodeInlineProps, CodeProps } from "./Code/index.mjs";
11
15
  import { ColorField, ColorFieldProps } from "./ColorField/index.mjs";
12
16
  import { Combobox, ComboboxOption, ComboboxProps } from "./Combobox/index.mjs";
13
- import { SearchFieldInputProps } from "./SearchField/client.mjs";
14
17
  import { Dialog, DialogActionsProps, DialogBodyProps, DialogPopupProps, DialogProps } from "./Dialog/index.mjs";
15
- import { ColorFieldInputProps } from "./ColorField/client.mjs";
18
+ import { SearchFieldInputProps } from "./SearchField/client.mjs";
16
19
  import { Field, FieldDescriptionProps, FieldErrorProps, FieldLabelProps, FieldProps } from "./Field/index.mjs";
20
+ import { ColorFieldInputProps } from "./ColorField/client.mjs";
21
+ import { Flex, FlexProps } from "./Flex/index.mjs";
17
22
  import { Heading, HeadingLevel, HeadingProps, HeadingSize } from "./Heading/index.mjs";
18
23
  import { Icon, IconProps } from "./Icon/index.mjs";
19
24
  import { IconButton, IconButtonProps } from "./IconButton/index.mjs";
20
25
  import { Inline, InlineProps } from "./Inline/index.mjs";
26
+ import { Label, LabelProps, LabelSize } from "./Label/index.mjs";
21
27
  import { Menu, MenuGroupProps, MenuItemProps, MenuLinkItemProps, MenuPopupProps, MenuProps, MenuSeparatorProps, MenuSubmenuRootProps, MenuSubmenuTriggerProps } from "./Menu/index.mjs";
22
28
  import { MultiSelect, MultiSelectOption, MultiSelectProps } from "./MultiSelect/index.mjs";
23
29
  import { MenuTriggerProps } from "./Menu/client.mjs";
24
30
  import { NavList, NavListGroupProps, NavListItemOwnProps, NavListItemProps, NavListProps } from "./NavList/index.mjs";
25
31
  import { NumberField, NumberFieldInputProps, NumberFieldProps } from "./NumberField/index.mjs";
32
+ import { Popover, PopoverPopupProps, PopoverProps } from "./Popover/index.mjs";
26
33
  import { RadioGroup, RadioGroupOption, RadioGroupProps } from "./RadioGroup/index.mjs";
34
+ import { PopoverCloseProps, PopoverTriggerProps } from "./Popover/client.mjs";
27
35
  import { SearchField, SearchFieldProps } from "./SearchField/index.mjs";
28
36
  import { Select, SelectOption, SelectProps } from "./Select/index.mjs";
29
37
  import { Sidebar, SidebarProps } from "./Sidebar/index.mjs";
@@ -44,4 +52,4 @@ import { ThemeProvider, ThemeProviderProps } from "./theme/ThemeProvider.mjs";
44
52
  import { Toast } from "./Toast/index.mjs";
45
53
  import { Tooltip, TooltipProps, TooltipProviderProps } from "./Tooltip/index.mjs";
46
54
  import { VisuallyHidden, VisuallyHiddenProps } from "./VisuallyHidden/index.mjs";
47
- export { AlertDialog, type AlertDialogProps, type AlertDialogTriggerProps, Avatar, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Clickable, type ClickableProps, ColorField, type ColorFieldInputProps, type ColorFieldProps, Combobox, type ComboboxOption, type ComboboxProps, Dialog, type DialogActionsProps, type DialogBodyProps, type DialogCloseProps, type DialogPopupProps, type DialogProps, type DialogTriggerProps, Field, type FieldDescriptionProps, type FieldErrorProps, type FieldLabelProps, type FieldProps, Heading, type HeadingLevel, type HeadingProps, type HeadingSize, Icon, IconButton, type IconButtonProps, type IconProps, Inline, type InlineProps, Menu, type MenuGroupProps, type MenuItemProps, type MenuLinkItemProps, type MenuPopupProps, type MenuProps, type MenuSeparatorProps, type MenuSubmenuRootProps, type MenuSubmenuTriggerProps, type MenuTriggerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, NavList, type NavListGroupProps, type NavListItemOwnProps, type NavListItemProps, type NavListProps, NumberField, type NumberFieldInputProps, type NumberFieldProps, RadioGroup, type RadioGroupOption, type RadioGroupProps, SearchField, type SearchFieldInputProps, type SearchFieldProps, Select, type SelectOption, type SelectProps, Sidebar, SidebarLayout, type SidebarLayoutMainProps, type SidebarLayoutProps, type SidebarLayoutSidebarProps, type SidebarProps, Stack, type StackProps, type StyleProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnGroupProps, type TableColumnProps, type TableFootProps, type TableHeadProps, type TableHeaderCellProps, type TableProps, type TableRowProps, type TableScrollAreaProps, type TableSortDirection, Tabs, type TabsListProps, type TabsPanelProps, type TabsProps, type TabsTabProps, Tag, type TagProps, Text, TextField, type TextFieldInputProps, type TextFieldProps, type TextProps, Textarea, type TextareaInputProps, type TextareaProps, type Theme, ThemeProvider, type ThemeProviderProps, Toast, type ToastOptions, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPopupProps, type TooltipProps, type TooltipProviderProps, type TooltipTriggerProps, VisuallyHidden, type VisuallyHiddenProps, defineTheme, useToast };
55
+ export { Alert, AlertDialog, type AlertDialogProps, type AlertDialogTriggerProps, type AlertProps, Avatar, type AvatarProps, Badge, type BadgeProps, Body, type BodyProps, type BodySize, Box, type BoxProps, Button, type ButtonProps, Caption, type CaptionProps, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Clickable, type ClickableProps, Code, type CodeBlockProps, type CodeInlineProps, type CodeProps, ColorField, type ColorFieldInputProps, type ColorFieldProps, Combobox, type ComboboxOption, type ComboboxProps, Dialog, type DialogActionsProps, type DialogBodyProps, type DialogCloseProps, type DialogPopupProps, type DialogProps, type DialogTriggerProps, Field, type FieldDescriptionProps, type FieldErrorProps, type FieldLabelProps, type FieldProps, Flex, type FlexProps, Heading, type HeadingLevel, type HeadingProps, type HeadingSize, Icon, IconButton, type IconButtonProps, type IconProps, Inline, type InlineProps, Label, type LabelProps, type LabelSize, Menu, type MenuGroupProps, type MenuItemProps, type MenuLinkItemProps, type MenuPopupProps, type MenuProps, type MenuSeparatorProps, type MenuSubmenuRootProps, type MenuSubmenuTriggerProps, type MenuTriggerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, NavList, type NavListGroupProps, type NavListItemOwnProps, type NavListItemProps, type NavListProps, NumberField, type NumberFieldInputProps, type NumberFieldProps, Popover, type PopoverCloseProps, type PopoverPopupProps, type PopoverProps, type PopoverTriggerProps, RadioGroup, type RadioGroupOption, type RadioGroupProps, SearchField, type SearchFieldInputProps, type SearchFieldProps, Select, type SelectOption, type SelectProps, Sidebar, SidebarLayout, type SidebarLayoutMainProps, type SidebarLayoutProps, type SidebarLayoutSidebarProps, type SidebarProps, Stack, type StackProps, type StyleProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnGroupProps, type TableColumnProps, type TableFootProps, type TableHeadProps, type TableHeaderCellProps, type TableProps, type TableRowProps, type TableScrollAreaProps, type TableSortDirection, Tabs, type TabsListProps, type TabsPanelProps, type TabsProps, type TabsTabProps, Tag, type TagProps, Text, TextField, type TextFieldInputProps, type TextFieldProps, type TextProps, Textarea, type TextareaInputProps, type TextareaProps, type Theme, ThemeProvider, type ThemeProviderProps, Toast, type ToastOptions, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPopupProps, type TooltipProps, type TooltipProviderProps, type TooltipTriggerProps, VisuallyHidden, type VisuallyHiddenProps, defineTheme, useToast };
package/dist/index.mjs CHANGED
@@ -1,40 +1,47 @@
1
- import { AlertDialog as e } from "./AlertDialog/index.mjs";
2
- import { Avatar as t } from "./Avatar/index.mjs";
3
- import { Badge as n } from "./Badge/index.mjs";
4
- import { Box as r } from "./Box/index.mjs";
5
- import { Button as i } from "./Button/index.mjs";
6
- import { Checkbox as a } from "./Checkbox/index.mjs";
7
- import { Chip as o, ChipGroup as s } from "./Chip/index.mjs";
8
- import { Clickable as c } from "./Clickable/index.mjs";
9
- import { ColorField as l } from "./ColorField/index.mjs";
10
- import { Combobox as u } from "./Combobox/index.mjs";
11
- import { Dialog as d } from "./Dialog/index.mjs";
12
- import { Field as f } from "./Field/index.mjs";
13
- import { Heading as p } from "./Heading/index.mjs";
14
- import { Icon as m } from "./Icon/index.mjs";
15
- import { IconButton as h } from "./IconButton/index.mjs";
16
- import { Inline as g } from "./Inline/index.mjs";
17
- import { Menu as _ } from "./Menu/index.mjs";
18
- import { MultiSelect as v } from "./MultiSelect/index.mjs";
19
- import { NavList as y } from "./NavList/index.mjs";
20
- import { NumberField as b } from "./NumberField/index.mjs";
21
- import { RadioGroup as x } from "./RadioGroup/index.mjs";
22
- import { SearchField as S } from "./SearchField/index.mjs";
23
- import { Select as C } from "./Select/index.mjs";
24
- import { Sidebar as w } from "./Sidebar/index.mjs";
25
- import { SidebarLayout as T } from "./SidebarLayout/index.mjs";
26
- import { Stack as E } from "./Stack/index.mjs";
27
- import { Switch as D } from "./Switch/index.mjs";
28
- import { Table as O } from "./Table/index.mjs";
29
- import { Tabs as k } from "./Tabs/index.mjs";
30
- import { Tag as A } from "./Tag/index.mjs";
31
- import { Text as j } from "./Text/index.mjs";
32
- import { Textarea as M } from "./Textarea/index.mjs";
33
- import { TextField as N } from "./TextField/index.mjs";
34
- import { defineTheme as P } from "./theme/define-theme.mjs";
35
- import { ThemeProvider as F } from "./theme/ThemeProvider.mjs";
36
- import { Toast as I } from "./Toast/index.mjs";
37
- import { useToast as L } from "./Toast/client.mjs";
38
- import { Tooltip as R } from "./Tooltip/index.mjs";
39
- import { VisuallyHidden as z } from "./VisuallyHidden/index.mjs";
40
- export { e as AlertDialog, t as Avatar, n as Badge, r as Box, i as Button, a as Checkbox, o as Chip, s as ChipGroup, c as Clickable, l as ColorField, u as Combobox, d as Dialog, f as Field, p as Heading, m as Icon, h as IconButton, g as Inline, _ as Menu, v as MultiSelect, y as NavList, b as NumberField, x as RadioGroup, S as SearchField, C as Select, w as Sidebar, T as SidebarLayout, E as Stack, D as Switch, O as Table, k as Tabs, A as Tag, j as Text, N as TextField, M as Textarea, F as ThemeProvider, I as Toast, R as Tooltip, z as VisuallyHidden, P as defineTheme, L as useToast };
1
+ import { Alert as e } from "./Alert/index.mjs";
2
+ import { AlertDialog as t } from "./AlertDialog/index.mjs";
3
+ import { Avatar as n } from "./Avatar/index.mjs";
4
+ import { Badge as r } from "./Badge/index.mjs";
5
+ import { Body as i } from "./Body/index.mjs";
6
+ import { Box as a } from "./Box/index.mjs";
7
+ import { Button as o } from "./Button/index.mjs";
8
+ import { Caption as s } from "./Caption/index.mjs";
9
+ import { Checkbox as c } from "./Checkbox/index.mjs";
10
+ import { Chip as l, ChipGroup as u } from "./Chip/index.mjs";
11
+ import { Clickable as d } from "./Clickable/index.mjs";
12
+ import { Code as f } from "./Code/index.mjs";
13
+ import { ColorField as p } from "./ColorField/index.mjs";
14
+ import { Combobox as m } from "./Combobox/index.mjs";
15
+ import { Dialog as h } from "./Dialog/index.mjs";
16
+ import { Field as g } from "./Field/index.mjs";
17
+ import { Flex as _ } from "./Flex/index.mjs";
18
+ import { Heading as v } from "./Heading/index.mjs";
19
+ import { Icon as y } from "./Icon/index.mjs";
20
+ import { IconButton as b } from "./IconButton/index.mjs";
21
+ import { Inline as x } from "./Inline/index.mjs";
22
+ import { Label as S } from "./Label/index.mjs";
23
+ import { Menu as C } from "./Menu/index.mjs";
24
+ import { MultiSelect as w } from "./MultiSelect/index.mjs";
25
+ import { NavList as T } from "./NavList/index.mjs";
26
+ import { NumberField as E } from "./NumberField/index.mjs";
27
+ import { Popover as D } from "./Popover/index.mjs";
28
+ import { RadioGroup as O } from "./RadioGroup/index.mjs";
29
+ import { SearchField as k } from "./SearchField/index.mjs";
30
+ import { Select as A } from "./Select/index.mjs";
31
+ import { Sidebar as j } from "./Sidebar/index.mjs";
32
+ import { SidebarLayout as M } from "./SidebarLayout/index.mjs";
33
+ import { Stack as N } from "./Stack/index.mjs";
34
+ import { Switch as P } from "./Switch/index.mjs";
35
+ import { Table as F } from "./Table/index.mjs";
36
+ import { Tabs as I } from "./Tabs/index.mjs";
37
+ import { Tag as L } from "./Tag/index.mjs";
38
+ import { Text as R } from "./Text/index.mjs";
39
+ import { Textarea as z } from "./Textarea/index.mjs";
40
+ import { TextField as B } from "./TextField/index.mjs";
41
+ import { defineTheme as V } from "./theme/define-theme.mjs";
42
+ import { ThemeProvider as H } from "./theme/ThemeProvider.mjs";
43
+ import { Toast as U } from "./Toast/index.mjs";
44
+ import { useToast as W } from "./Toast/client.mjs";
45
+ import { Tooltip as G } from "./Tooltip/index.mjs";
46
+ import { VisuallyHidden as K } from "./VisuallyHidden/index.mjs";
47
+ export { e as Alert, t as AlertDialog, n as Avatar, r as Badge, i as Body, a as Box, o as Button, s as Caption, c as Checkbox, l as Chip, u as ChipGroup, d as Clickable, f as Code, p as ColorField, m as Combobox, h as Dialog, g as Field, _ as Flex, v as Heading, y as Icon, b as IconButton, x as Inline, S as Label, C as Menu, w as MultiSelect, T as NavList, E as NumberField, D as Popover, O as RadioGroup, k as SearchField, A as Select, j as Sidebar, M as SidebarLayout, N as Stack, P as Switch, F as Table, I as Tabs, L as Tag, R as Text, B as TextField, z as Textarea, H as ThemeProvider, U as Toast, G as Tooltip, K as VisuallyHidden, V as defineTheme, W as useToast };
@@ -5,4 +5,23 @@
5
5
  * `Tooltip.Popup`, named by its full tag so Menu's and Dialog's popups are still checked (ADR 0168).
6
6
  * Spread it and add the app's own text components; see `docs/lint.md`.
7
7
  */
8
- export declare const textComponents: readonly string[];
8
+ export declare const textComponents: readonly string[];
9
+ /** One style prop: the keys it takes and the CSS value each key sets. */
10
+ export interface StyleProp {
11
+ /** The keys, sorted as `manifest.json` `styleProps` lists them: `"16"`, `"flex"`, `"bgRaised"`. */
12
+ readonly values: readonly (string | number)[];
13
+ /**
14
+ * The CSS value each key sets, so a rule can match a `*.css.ts` property/value pair a style prop
15
+ * covers: `display: "flex"` is `flex`, `gap: vars.space["16"]` is `var(--space-16)`. A shorthand
16
+ * (`padding`) sets the value on each of its logical longhands.
17
+ */
18
+ readonly css: Readonly<Record<string, string>>;
19
+ /** Also takes a breakpoint object (`{ base: "8", med: "16" }`): the layout props (ADR 0011). */
20
+ readonly responsive: boolean;
21
+ }
22
+ /**
23
+ * Every style prop `Box` and the components built on it take, by name, from the values the style
24
+ * props are built from, so it matches `manifest.json` `styleProps`. For a lint rule that reports a
25
+ * `*.css.ts` property/value pair a style prop covers; see `docs/lint.md`.
26
+ */
27
+ export declare const styleProps: Readonly<Record<string, StyleProp>>;
@@ -1,7 +1,11 @@
1
+ import { responsiveValues as e, shorthands as t, staticValues as n } from "../styles/atom-values.mjs";
1
2
  // src/lint/index.ts
2
- var e = Object.freeze([
3
+ var r = Object.freeze([
3
4
  "Text",
4
5
  "Heading",
6
+ "Body",
7
+ "Caption",
8
+ "Code",
5
9
  "Button",
6
10
  "Badge",
7
11
  "Tag",
@@ -19,5 +23,16 @@ var e = Object.freeze([
19
23
  "Cell",
20
24
  "Tooltip.Popup",
21
25
  "VisuallyHidden"
22
- ]);
23
- export { e as textComponents };
26
+ ]), i = (e) => Array.isArray(e) ? e.map((e) => [e, String(e)]) : Object.entries(e), a = new Intl.Collator("en", { numeric: !0 }), o = (e, t) => {
27
+ let n = i(e).toSorted(([e], [t]) => a.compare(String(e), String(t)));
28
+ return Object.freeze({
29
+ values: Object.freeze(n.map(([e]) => e)),
30
+ css: Object.freeze(Object.fromEntries(n)),
31
+ responsive: t
32
+ });
33
+ }, s = (e, t) => Object.entries(e).map(([e, n]) => [e, o(n, t)]), c = s(e, !0), l = new Map(c), u = [
34
+ ...c,
35
+ ...Object.entries(t).map(([e, [t]]) => [e, l.get(t)]),
36
+ ...s(n, !1)
37
+ ], d = Object.freeze(Object.fromEntries(u.toSorted(([e], [t]) => e.localeCompare(t, "en"))));
38
+ export { d as styleProps, r as textComponents };
@@ -57,7 +57,7 @@ function g({ variant: n, size: r, iconStart: i, iconEnd: a, uppercase: o, ...s }
57
57
  function _(e) {
58
58
  let t = i(u);
59
59
  return (n, r) => {
60
- t.current = n ? {
60
+ e?.(n, r), r.isCanceled || (t.current = n ? {
61
61
  keyboard: !1,
62
62
  opener: r.trigger ?? null,
63
63
  recorded: !0
@@ -66,7 +66,7 @@ function _(e) {
66
66
  keyboard: r.event instanceof KeyboardEvent,
67
67
  reason: r.reason,
68
68
  recorded: !1
69
- }, e?.(n, r);
69
+ });
70
70
  };
71
71
  }
72
72
  function v(e, t) {
@@ -89,32 +89,32 @@ function x(e) {
89
89
  return b = !0, !1;
90
90
  } })), b;
91
91
  }
92
- function S(e, { finalFocus: t, modal: n = !1, open: r }) {
93
- let { trigger: c } = h(), l = i(u), m = i(d), g = s(null), _ = a((t) => {
94
- g.current = t;
95
- let n = v(e, t), r = m && f(m.current, t);
92
+ function S(e, { finalFocus: t, modal: n = !1, open: r, returnTo: c }) {
93
+ let { trigger: l } = h(), m = i(u), g = i(d), _ = s(null), b = a((t) => {
94
+ _.current = t;
95
+ let n = v(e, t), r = g && f(g.current, t);
96
96
  return () => {
97
- g.current = null, r?.(), n();
97
+ _.current = null, r?.(), n();
98
98
  };
99
- }, [e, m]);
99
+ }, [e, g]);
100
100
  return o(() => {
101
- let e = g.current;
102
- if (!r || !e || l.current.recorded) return;
101
+ let e = _.current;
102
+ if (!r || !e || m.current.recorded) return;
103
103
  let { activeElement: t, body: n } = e.ownerDocument, i = t === n || e.contains(t) ? null : t;
104
- l.current = {
104
+ m.current = {
105
105
  keyboard: !1,
106
106
  opener: i
107
107
  };
108
- }, [r, l]), o(() => {
109
- let e = g.current;
108
+ }, [r, m]), o(() => {
109
+ let e = _.current;
110
110
  if (!e) return;
111
111
  if (r) {
112
112
  e.inert = !1;
113
113
  return;
114
114
  }
115
- let { reason: i, keyboard: a, opener: o } = l.current;
116
- l.current.recorded = !1;
117
- let s = o?.isConnected ? o : c.current, { activeElement: u } = e.ownerDocument, d = n && i === "outside-press" && x(e.ownerDocument), f = e.contains(u) || [...m?.current.nested ?? []].some((e) => p(e, u));
115
+ let { reason: i, keyboard: a, opener: o } = m.current;
116
+ m.current.recorded = !1;
117
+ let s = c?.current ?? (o?.isConnected ? o : l.current), { activeElement: u } = e.ownerDocument, d = n && i === "outside-press" && x(e.ownerDocument), f = e.contains(u) || [...g?.current.nested ?? []].some((e) => p(e, u));
118
118
  if (!t && s instanceof HTMLElement && (d || f && !y.has(i ?? ""))) {
119
119
  let e = { preventScroll: !0 };
120
120
  a && (e.focusVisible = !0), s.focus(e);
@@ -124,12 +124,13 @@ function S(e, { finalFocus: t, modal: n = !1, open: r }) {
124
124
  r,
125
125
  t,
126
126
  n,
127
- l,
127
+ c,
128
128
  m,
129
- c
129
+ g,
130
+ l
130
131
  ]), {
131
132
  "aria-hidden": !r || void 0,
132
- ref: _
133
+ ref: b
133
134
  };
134
135
  }
135
136
  export { m as PopupScope, g as triggerElement, S as useClosingRule, h as usePopupScope, _ as useRecordOpenChange };
@@ -1 +1,2 @@
1
- import "react";
1
+ import "react";
2
+ export type PopupSide = "top" | "bottom" | "left" | "right" | "inline-start" | "inline-end";
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { Box as e } from "../Box/base.mjs";
3
+ import { splitStyleProps as t } from "../styles/split-style-props.mjs";
4
+ import { useClosingRule as n } from "./client.mjs";
5
+ import { jsx as r } from "react/jsx-runtime";
6
+ // src/popup/positioner.tsx
7
+ function i(e) {
8
+ return function(n, { open: i }) {
9
+ let [, o] = t(n);
10
+ return /* @__PURE__ */ r(a, {
11
+ ...o,
12
+ finalFocus: e,
13
+ open: i
14
+ });
15
+ };
16
+ }
17
+ function a({ open: t, finalFocus: i, ref: a, ...o }) {
18
+ return /* @__PURE__ */ r(e, {
19
+ ...o,
20
+ ...n(a, {
21
+ finalFocus: i,
22
+ open: t
23
+ }),
24
+ zIndex: "popover"
25
+ });
26
+ }
27
+ export { i as positionerElement };
@@ -0,0 +1,12 @@
1
+ import "../Box/base.mjs";
2
+ import { PartProps } from "../styles/part-props.mjs";
3
+ import { ComponentPropsWithRef, ReactNode } from "react";
4
+ export type NamedScrollRegionProps = Omit<PartProps<Omit<ComponentPropsWithRef<"section">, "aria-label" | "aria-labelledby">>, "blockSize" | "minBlockSize" | "maxBlockSize"> & ({
5
+ /** The region's name. Required unless `aria-labelledby` names it. */
6
+ "aria-label": string;
7
+ "aria-labelledby"?: never;
8
+ } | {
9
+ "aria-label"?: never;
10
+ /** The id of the element that names the region. Required unless `aria-label` names it. */
11
+ "aria-labelledby": string;
12
+ });
@@ -0,0 +1,29 @@
1
+ import { Box as e } from "../Box/base.mjs";
2
+ import { join as t } from "../styles/join.mjs";
3
+ import { scrollThumb as n, scrollbar as r, viewport as i } from "../styles/scroll-region.css.mjs";
4
+ import { splitStyleProps as a } from "../styles/split-style-props.mjs";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { ScrollArea as c } from "@base-ui/react/scroll-area";
7
+ // src/scroll-region/scroll-region.tsx
8
+ function l({ children: l, className: u, ref: d, rootProps: f, style: p, viewportClassName: m, ...h }) {
9
+ let [g, _] = a(h);
10
+ return /* @__PURE__ */ s(c.Root, {
11
+ render: /* @__PURE__ */ o(e, {
12
+ ...f,
13
+ ...g,
14
+ className: u,
15
+ style: p
16
+ }),
17
+ children: [/* @__PURE__ */ o(c.Viewport, {
18
+ ..._,
19
+ className: t(i, m),
20
+ render: /* @__PURE__ */ o("section", { ref: d }),
21
+ children: /* @__PURE__ */ o(c.Content, { children: l })
22
+ }), /* @__PURE__ */ o(c.Scrollbar, {
23
+ className: r,
24
+ orientation: "horizontal",
25
+ children: /* @__PURE__ */ o(c.Thumb, { className: n })
26
+ })]
27
+ });
28
+ }
29
+ export { l as ScrollRegion };
@@ -0,0 +1,5 @@
1
+ import "../Box/base.mjs";
2
+ import "../Text/index.mjs";
3
+ import { StatusVariant, statusTones } from "./tones.mjs";
4
+ import { ReactNode } from "react";
5
+ export type { StatusVariant };
@@ -0,0 +1,74 @@
1
+ import { Box as e } from "../Box/base.mjs";
2
+ import { CircleAlertIcon as t } from "../icons/CircleAlertIcon.mjs";
3
+ import { CircleCheckIcon as n } from "../icons/CircleCheckIcon.mjs";
4
+ import { InfoIcon as r } from "../icons/InfoIcon.mjs";
5
+ import { TriangleAlertIcon as i } from "../icons/TriangleAlertIcon.mjs";
6
+ import { join as a } from "../styles/join.mjs";
7
+ import { close as o, content as s, message as c, row as l, title as u } from "../styles/status-message.css.mjs";
8
+ import { subtleFills as d } from "../styles/subtle-fills.mjs";
9
+ import { Text as f } from "../Text/index.mjs";
10
+ import { statusTones as p } from "./tones.mjs";
11
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
+ // src/status-message/status-message.tsx
13
+ var g = {
14
+ info: r,
15
+ success: n,
16
+ warning: i,
17
+ danger: t
18
+ };
19
+ function _({ variant: t, close: n, children: r, className: i, ...o }) {
20
+ let u = g[t], { backgroundColor: f, color: _ } = d[p[t]];
21
+ return /* @__PURE__ */ m(e, {
22
+ backgroundColor: f,
23
+ borderRadius: "med",
24
+ color: _,
25
+ padding: "12",
26
+ ...o,
27
+ className: a(c, i),
28
+ children: /* @__PURE__ */ h(e, {
29
+ alignItems: "start",
30
+ className: l,
31
+ display: "flex",
32
+ gap: "12",
33
+ children: [
34
+ /* @__PURE__ */ m(e, {
35
+ display: "flex",
36
+ flexShrink: 0,
37
+ paddingBlock: "2",
38
+ children: /* @__PURE__ */ m(u, {})
39
+ }),
40
+ /* @__PURE__ */ m(e, {
41
+ alignItems: "start",
42
+ className: s,
43
+ display: "flex",
44
+ flexDirection: "column",
45
+ flexGrow: 1,
46
+ gap: "8",
47
+ children: r
48
+ }),
49
+ n && /* @__PURE__ */ m(e, {
50
+ className: "_1ed90zt5",
51
+ display: "flex",
52
+ flexShrink: 0,
53
+ children: n
54
+ })
55
+ ]
56
+ })
57
+ });
58
+ }
59
+ function v({ className: e, ...t }) {
60
+ return /* @__PURE__ */ m(f, {
61
+ as: "div",
62
+ weight: "medium",
63
+ ...t,
64
+ className: a(u, e)
65
+ });
66
+ }
67
+ function y(e) {
68
+ return /* @__PURE__ */ m(f, {
69
+ as: "div",
70
+ size: "sm",
71
+ ...e
72
+ });
73
+ }
74
+ export { _ as StatusMessage, y as StatusMessageDescription, v as StatusMessageTitle, o as statusMessageClose, p as statusTones };
@@ -0,0 +1,7 @@
1
+ export declare const statusTones: {
2
+ readonly info: "accent";
3
+ readonly success: "success";
4
+ readonly warning: "warning";
5
+ readonly danger: "danger";
6
+ };
7
+ export type StatusVariant = keyof typeof statusTones;
@@ -0,0 +1,8 @@
1
+ // src/status-message/tones.ts
2
+ var e = {
3
+ info: "accent",
4
+ success: "success",
5
+ warning: "warning",
6
+ danger: "danger"
7
+ };
8
+ export { e as statusTones };