@jonmilner/ui 0.22.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/Alert/Alert.css +2 -0
- package/dist/Alert/Alert.css.mjs +9 -0
- package/dist/Alert/index.d.mts +13 -0
- package/dist/Alert/index.mjs +45 -0
- package/dist/AlertDialog/client.mjs +4 -4
- package/dist/AlertDialog/index.d.mts +3 -2
- package/dist/AlertDialog/index.mjs +10 -9
- package/dist/Avatar/Avatar.css +1 -1
- package/dist/Badge/Badge.css +1 -1
- package/dist/Body/index.d.mts +9 -0
- package/dist/Body/index.mjs +12 -0
- package/dist/Box/Box.css +1 -1
- package/dist/Button/Button.css +1 -1
- package/dist/Caption/index.d.mts +6 -0
- package/dist/Caption/index.mjs +14 -0
- package/dist/Checkbox/Checkbox.css +1 -1
- package/dist/Chip/Chip.css +1 -1
- package/dist/Clickable/Clickable.css +1 -1
- package/dist/Code/Code.css +2 -0
- package/dist/Code/Code.css.mjs +7 -0
- package/dist/Code/index.d.mts +10 -0
- package/dist/Code/index.mjs +40 -0
- package/dist/ColorField/ColorField.css +2 -2
- package/dist/ColorField/client.mjs +2 -1
- package/dist/Combobox/Combobox.css +2 -2
- package/dist/Combobox/client.mjs +5 -1
- package/dist/Dialog/Dialog.css +2 -2
- package/dist/Dialog/client.d.mts +1 -1
- package/dist/Dialog/client.mjs +14 -12
- package/dist/Dialog/index.d.mts +1 -1
- package/dist/Field/Field.css +1 -1
- package/dist/Flex/index.d.mts +5 -0
- package/dist/Flex/index.mjs +14 -0
- package/dist/Heading/Heading.css +1 -1
- package/dist/Heading/index.d.mts +1 -1
- package/dist/Icon/Icon.css +1 -1
- package/dist/IconButton/IconButton.css +1 -1
- package/dist/Inline/Inline.css +1 -1
- package/dist/Inline/index.mjs +1 -1
- package/dist/Label/index.d.mts +9 -0
- package/dist/Label/index.mjs +19 -0
- package/dist/Menu/Menu.css +2 -2
- package/dist/Menu/Menu.css.mjs +2 -2
- package/dist/Menu/client.mjs +56 -77
- package/dist/Menu/item-row.mjs +2 -2
- package/dist/MultiSelect/MultiSelect.css +2 -2
- package/dist/NavList/NavList.css +2 -2
- package/dist/NavList/index.mjs +11 -2
- package/dist/NumberField/NumberField.css +2 -2
- package/dist/Popover/Popover.css +2 -0
- package/dist/Popover/Popover.css.mjs +7 -0
- package/dist/Popover/client.d.mts +11 -0
- package/dist/Popover/client.mjs +54 -0
- package/dist/Popover/index.d.mts +20 -0
- package/dist/Popover/index.mjs +39 -0
- package/dist/RadioGroup/RadioGroup.css +2 -2
- package/dist/RadioGroup/index.mjs +1 -0
- package/dist/SearchField/SearchField.css +2 -2
- package/dist/Select/Select.css +2 -2
- package/dist/Sidebar/Sidebar.css +2 -2
- package/dist/Sidebar/index.mjs +10 -3
- package/dist/SidebarLayout/SidebarLayout.css +1 -1
- package/dist/Stack/Stack.css +1 -1
- package/dist/Stack/index.mjs +1 -1
- package/dist/Switch/Switch.css +2 -2
- package/dist/Switch/index.mjs +7 -1
- package/dist/Table/Table.css +2 -2
- package/dist/Table/Table.css.mjs +4 -2
- package/dist/Table/index.d.mts +3 -9
- package/dist/Table/index.mjs +60 -74
- package/dist/Tabs/Tabs.css +1 -1
- package/dist/Tag/Tag.css +1 -1
- package/dist/Text/Text.css +1 -1
- package/dist/TextField/TextField.css +2 -2
- package/dist/Textarea/Textarea.css +2 -2
- package/dist/Toast/Toast.css +2 -2
- package/dist/Toast/Toast.css.mjs +10 -7
- package/dist/Toast/client.d.mts +3 -18
- package/dist/Toast/client.mjs +95 -134
- package/dist/Tooltip/Tooltip.css +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
- package/dist/base.css +2 -2
- package/dist/brands/default.mjs +2 -1
- package/dist/brands/forced-colors.mjs +2 -1
- package/dist/brands/neutral.mjs +8 -7
- package/dist/contrast/contrast.mjs +43 -35
- package/dist/contrast/mixes.mjs +15 -8
- package/dist/docs/Alert.md +106 -0
- package/dist/docs/AlertDialog.md +25 -11
- package/dist/docs/Body.md +74 -0
- package/dist/docs/Box.md +4 -3
- package/dist/docs/Caption.md +77 -0
- package/dist/docs/Code.md +84 -0
- package/dist/docs/ColorField.md +1 -1
- package/dist/docs/Combobox.md +2 -1
- package/dist/docs/Dialog.md +28 -4
- package/dist/docs/Flex.md +76 -0
- package/dist/docs/Heading.md +3 -3
- package/dist/docs/Icon.md +1 -0
- package/dist/docs/Inline.md +3 -2
- package/dist/docs/Label.md +77 -0
- package/dist/docs/Menu.md +3 -3
- package/dist/docs/MultiSelect.md +1 -0
- package/dist/docs/NumberField.md +1 -1
- package/dist/docs/Popover.md +135 -0
- package/dist/docs/SearchField.md +1 -1
- package/dist/docs/Select.md +1 -0
- package/dist/docs/Stack.md +12 -10
- package/dist/docs/Table.md +5 -5
- package/dist/docs/Text.md +30 -23
- package/dist/docs/TextField.md +1 -1
- package/dist/docs/Textarea.md +1 -1
- package/dist/docs/Toast.md +7 -7
- package/dist/docs/Tooltip.md +2 -2
- package/dist/docs/lint.md +18 -0
- package/dist/docs/llms.txt +19 -10
- package/dist/docs/manifest.json +559 -8
- package/dist/docs/migrations/0.23.0.md +84 -0
- package/dist/docs/theming.md +3 -3
- package/dist/icons/TriangleAlertIcon.d.mts +2 -0
- package/dist/icons/TriangleAlertIcon.mjs +10 -0
- package/dist/icons/index.d.mts +3 -2
- package/dist/icons/index.mjs +4 -3
- package/dist/index.d.mts +11 -3
- package/dist/index.mjs +47 -40
- package/dist/lint/index.d.mts +20 -1
- package/dist/lint/index.mjs +18 -3
- package/dist/popup/client.mjs +20 -19
- package/dist/popup/direction.d.mts +2 -1
- package/dist/popup/listbox-base.mjs +3 -2
- package/dist/popup/positioner.mjs +27 -0
- package/dist/scroll-region/scroll-region.d.mts +12 -0
- package/dist/scroll-region/scroll-region.mjs +29 -0
- package/dist/status-message/status-message.d.mts +5 -0
- package/dist/status-message/status-message.mjs +74 -0
- package/dist/status-message/tones.d.mts +7 -0
- package/dist/status-message/tones.mjs +8 -0
- package/dist/styles/atom-values.mjs +131 -0
- package/dist/styles/atoms.css +1 -1
- package/dist/styles/layers.css +1 -1
- package/dist/styles/responsive.css +1 -1
- package/dist/styles/scroll-region.css +2 -0
- package/dist/styles/scroll-region.css.mjs +7 -0
- package/dist/styles/status-message.css +2 -0
- package/dist/styles/status-message.css.mjs +7 -0
- package/dist/tokens/contract.d.mts +1 -1
- package/dist/tokens/roles.d.mts +1 -1
- package/dist/tokens/roles.mjs +1 -1
- 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.
|
package/dist/docs/theming.md
CHANGED
|
@@ -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,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 };
|
package/dist/icons/index.d.mts
CHANGED
|
@@ -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 };
|
package/dist/icons/index.mjs
CHANGED
|
@@ -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 {
|
|
32
|
+
import { TriangleAlertIcon as j } from "./TriangleAlertIcon.mjs";
|
|
33
|
+
import { XIcon as M } from "./XIcon.mjs";
|
|
33
34
|
// src/icons/index.ts
|
|
34
|
-
var
|
|
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
|
|
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 {
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
|
|
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 };
|
package/dist/lint/index.d.mts
CHANGED
|
@@ -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>>;
|
package/dist/lint/index.mjs
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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 };
|
package/dist/popup/client.mjs
CHANGED
|
@@ -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
|
-
}
|
|
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:
|
|
94
|
-
|
|
95
|
-
let n = v(e, t), r =
|
|
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
|
-
|
|
97
|
+
_.current = null, r?.(), n();
|
|
98
98
|
};
|
|
99
|
-
}, [e,
|
|
99
|
+
}, [e, g]);
|
|
100
100
|
return o(() => {
|
|
101
|
-
let e =
|
|
102
|
-
if (!r || !e ||
|
|
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
|
-
|
|
104
|
+
m.current = {
|
|
105
105
|
keyboard: !1,
|
|
106
106
|
opener: i
|
|
107
107
|
};
|
|
108
|
-
}, [r,
|
|
109
|
-
let e =
|
|
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 } =
|
|
116
|
-
|
|
117
|
-
let s = o?.isConnected ? o :
|
|
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
|
-
|
|
127
|
+
c,
|
|
128
128
|
m,
|
|
129
|
-
|
|
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";
|
|
@@ -37,13 +37,14 @@ function h({ children: e, className: t, iconStart: r, size: i }) {
|
|
|
37
37
|
children: e
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
function g(t) {
|
|
40
|
+
function g(t, n) {
|
|
41
41
|
return /* @__PURE__ */ u(e, {
|
|
42
42
|
backgroundColor: "bgRaised",
|
|
43
43
|
borderRadius: "med",
|
|
44
44
|
boxShadow: "med",
|
|
45
45
|
className: t,
|
|
46
|
-
padding: "4"
|
|
46
|
+
padding: "4",
|
|
47
|
+
...n
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
50
|
var _ = {
|
|
@@ -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,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 };
|