@jonmilner/ui 0.8.2 → 0.9.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/dist/Avatar/Avatar.css +1 -1
- package/dist/Avatar/index.d.mts +1 -1
- package/dist/Avatar/index.mjs +1 -1
- package/dist/Badge/Badge.css +1 -1
- package/dist/Badge/index.d.mts +1 -1
- package/dist/Badge/index.mjs +1 -1
- package/dist/Box/Box.css +1 -1
- package/dist/Box/ResponsiveCheck.mjs +17 -0
- package/dist/Box/base.d.mts +8 -0
- package/dist/Box/base.mjs +17 -0
- package/dist/Box/index.d.mts +4 -7
- package/dist/Box/index.mjs +4 -13
- package/dist/Button/Button.css +1 -1
- package/dist/Button/index.d.mts +1 -1
- package/dist/Button/index.mjs +1 -1
- package/dist/Checkbox/Checkbox.css +1 -1
- package/dist/Checkbox/index.mjs +1 -1
- package/dist/Chip/Chip.css +1 -1
- package/dist/Chip/index.mjs +1 -1
- package/dist/Clickable/Clickable.css +1 -1
- package/dist/Clickable/index.d.mts +1 -1
- package/dist/Clickable/index.mjs +1 -1
- package/dist/ColorField/ColorField.css +1 -1
- package/dist/ColorField/client.mjs +8 -8
- package/dist/ColorField/index.d.mts +1 -1
- package/dist/Dialog/Dialog.css +1 -1
- package/dist/Dialog/client.d.mts +1 -1
- package/dist/Dialog/client.mjs +1 -1
- package/dist/Dialog/index.d.mts +1 -1
- package/dist/Dialog/index.mjs +1 -1
- package/dist/Field/Field.css +1 -1
- package/dist/Field/client.mjs +1 -1
- package/dist/Field/index.mjs +18 -18
- package/dist/Heading/Heading.css +1 -1
- package/dist/Icon/Icon.css +1 -1
- package/dist/IconButton/IconButton.css +1 -1
- package/dist/IconButton/index.d.mts +1 -1
- package/dist/Inline/Inline.css +1 -1
- package/dist/Inline/index.d.mts +2 -1
- package/dist/Menu/Menu.css +1 -1
- package/dist/Menu/client.mjs +16 -16
- package/dist/Menu/index.d.mts +1 -1
- package/dist/Menu/index.mjs +25 -25
- package/dist/MultiSelect/MultiSelect.css +1 -1
- package/dist/MultiSelect/client.mjs +25 -25
- package/dist/MultiSelect/index.d.mts +1 -1
- package/dist/MultiSelect/index.mjs +1 -1
- package/dist/SearchField/SearchField.css +1 -1
- package/dist/SearchField/client.mjs +9 -9
- package/dist/SearchField/index.d.mts +1 -1
- package/dist/Stack/Stack.css +1 -1
- package/dist/Stack/index.d.mts +2 -1
- package/dist/Tabs/Tabs.css +1 -1
- package/dist/Tabs/index.mjs +1 -1
- package/dist/Tag/Tag.css +1 -1
- package/dist/Tag/index.d.mts +1 -1
- package/dist/Tag/index.mjs +1 -1
- package/dist/Text/Text.css +1 -1
- package/dist/Text/index.d.mts +1 -1
- package/dist/Text/index.mjs +1 -1
- package/dist/TextField/TextField.css +1 -1
- package/dist/TextField/index.d.mts +1 -1
- package/dist/Toast/Toast.css +1 -1
- package/dist/Toast/client.mjs +42 -42
- package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
- package/dist/base.css +1 -1
- package/dist/docs/Box.md +15 -0
- package/dist/docs/manifest.json +1 -1
- package/dist/docs/migrations/0.9.0.md +27 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +11 -11
- package/dist/popup/client.mjs +24 -24
- package/dist/styles/atoms.css +2 -2
- package/dist/styles/atoms.css.d.mts +31 -31
- package/dist/styles/atoms.css.mjs +1500 -1500
- package/dist/styles/layers.css +2 -2
- package/dist/styles/part-props.d.mts +1 -1
- package/dist/styles/responsive.css +2 -0
- package/dist/styles/responsive.css.mjs +6 -0
- package/package.json +5 -3
package/dist/Toast/client.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { join as e } from "../styles/join.mjs";
|
|
3
|
-
import { Box as t } from "../Box/
|
|
3
|
+
import { Box as t } from "../Box/base.mjs";
|
|
4
4
|
import { Clickable as n } from "../Clickable/index.mjs";
|
|
5
5
|
import { Text as r } from "../Text/index.mjs";
|
|
6
6
|
import { Button as i } from "../Button/index.mjs";
|
|
@@ -10,8 +10,8 @@ import { XIcon as s } from "../icons/XIcon.mjs";
|
|
|
10
10
|
import { CircleCheckIcon as c } from "../icons/CircleCheckIcon.mjs";
|
|
11
11
|
import { InfoIcon as l } from "../icons/InfoIcon.mjs";
|
|
12
12
|
import { announcer as u, close as d, content as f, list as p, root as m, toast as h, viewport as g } from "./Toast.css.mjs";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { createContext as _, use as v, useCallback as y, useEffect as b, useLayoutEffect as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
14
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
15
15
|
import { Toast as D } from "@base-ui/react/toast";
|
|
16
16
|
//#region src/Toast/client.tsx
|
|
17
17
|
var O = {
|
|
@@ -27,29 +27,29 @@ var O = {
|
|
|
27
27
|
Icon: o,
|
|
28
28
|
color: "danger"
|
|
29
29
|
}
|
|
30
|
-
}, k =
|
|
30
|
+
}, k = _(null), A = _(null), j = (e) => e !== void 0 && Object.hasOwn(O, e);
|
|
31
31
|
function M({ limit: e = 3, closeLabel: n = "Dismiss", regionLabel: r = "Notifications", className: i, style: o, children: s }) {
|
|
32
|
-
let { container: c, ref: l } = a(), [u] =
|
|
33
|
-
return /* @__PURE__ */
|
|
32
|
+
let { container: c, ref: l } = a(), [u] = w(D.createToastManager);
|
|
33
|
+
return /* @__PURE__ */ T(D.Provider, {
|
|
34
34
|
limit: e,
|
|
35
35
|
toastManager: u,
|
|
36
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ E(k, {
|
|
37
37
|
value: u,
|
|
38
38
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ T(t, {
|
|
40
40
|
as: "span",
|
|
41
41
|
hidden: !0,
|
|
42
42
|
ref: l
|
|
43
43
|
}),
|
|
44
44
|
s,
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ T(P, {}),
|
|
46
|
+
/* @__PURE__ */ T(D.Portal, {
|
|
47
47
|
container: c,
|
|
48
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ T(N, {
|
|
49
49
|
className: i,
|
|
50
50
|
regionLabel: r,
|
|
51
51
|
style: o,
|
|
52
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ T(F, { closeLabel: n })
|
|
53
53
|
})
|
|
54
54
|
})
|
|
55
55
|
]
|
|
@@ -57,8 +57,8 @@ function M({ limit: e = 3, closeLabel: n = "Dismiss", regionLabel: r = "Notifica
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
function N({ regionLabel: n, className: r, style: i, children: a }) {
|
|
60
|
-
let o =
|
|
61
|
-
return
|
|
60
|
+
let o = C(null), s = C(null);
|
|
61
|
+
return b(() => {
|
|
62
62
|
let e = s.current;
|
|
63
63
|
if (!e) return;
|
|
64
64
|
let t = e.ownerDocument, n = !1, r = (t) => {
|
|
@@ -73,7 +73,7 @@ function N({ regionLabel: n, className: r, style: i, children: a }) {
|
|
|
73
73
|
return t.addEventListener("mouseover", r), t.addEventListener("mouseout", i), () => {
|
|
74
74
|
t.removeEventListener("mouseover", r), t.removeEventListener("mouseout", i);
|
|
75
75
|
};
|
|
76
|
-
}, []), /* @__PURE__ */
|
|
76
|
+
}, []), /* @__PURE__ */ T(D.Viewport, {
|
|
77
77
|
"aria-atomic": void 0,
|
|
78
78
|
"aria-label": n,
|
|
79
79
|
"aria-live": "off",
|
|
@@ -83,15 +83,15 @@ function N({ regionLabel: n, className: r, style: i, children: a }) {
|
|
|
83
83
|
t && !e.currentTarget.contains(t) && (o.current = t);
|
|
84
84
|
},
|
|
85
85
|
ref: s,
|
|
86
|
-
render: /* @__PURE__ */
|
|
86
|
+
render: /* @__PURE__ */ T(t, {
|
|
87
87
|
className: e(g, r),
|
|
88
88
|
position: "fixed",
|
|
89
89
|
style: i,
|
|
90
90
|
zIndex: "toast"
|
|
91
91
|
}),
|
|
92
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ T("div", {
|
|
93
93
|
className: p,
|
|
94
|
-
children: /* @__PURE__ */
|
|
94
|
+
children: /* @__PURE__ */ T(A, {
|
|
95
95
|
value: o,
|
|
96
96
|
children: a
|
|
97
97
|
})
|
|
@@ -99,19 +99,19 @@ function N({ regionLabel: n, className: r, style: i, children: a }) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
function P() {
|
|
102
|
-
let { toasts: e } = D.useToastManager(), t = (t) => e.filter((e) => e.type === "error" === t).map((e) => /* @__PURE__ */
|
|
102
|
+
let { toasts: e } = D.useToastManager(), t = (t) => e.filter((e) => e.type === "error" === t).map((e) => /* @__PURE__ */ E("div", { children: [
|
|
103
103
|
e.title,
|
|
104
104
|
" ",
|
|
105
105
|
e.description
|
|
106
106
|
] }, e.id));
|
|
107
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ E("div", {
|
|
108
108
|
className: u,
|
|
109
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ T("div", {
|
|
110
110
|
"aria-atomic": !1,
|
|
111
111
|
"aria-live": "polite",
|
|
112
112
|
role: "status",
|
|
113
113
|
children: t(!1)
|
|
114
|
-
}), /* @__PURE__ */
|
|
114
|
+
}), /* @__PURE__ */ T("div", {
|
|
115
115
|
"aria-atomic": !1,
|
|
116
116
|
"aria-live": "assertive",
|
|
117
117
|
role: "alert",
|
|
@@ -121,16 +121,16 @@ function P() {
|
|
|
121
121
|
}
|
|
122
122
|
function F({ closeLabel: e }) {
|
|
123
123
|
let { toasts: t } = D.useToastManager();
|
|
124
|
-
return t.map((t) => /* @__PURE__ */
|
|
124
|
+
return t.map((t) => /* @__PURE__ */ T(I, {
|
|
125
125
|
closeLabel: e,
|
|
126
126
|
toast: t
|
|
127
127
|
}, t.id));
|
|
128
128
|
}
|
|
129
129
|
function I({ toast: a, closeLabel: o }) {
|
|
130
|
-
let c = j(a.type) ? a.type : "info", { Icon: l, color: u } = O[c], p =
|
|
131
|
-
e &&
|
|
132
|
-
}, []), M =
|
|
133
|
-
return
|
|
130
|
+
let c = j(a.type) ? a.type : "info", { Icon: l, color: u } = O[c], p = v(k), g = v(A), [_, b] = w(!1), S = y((e) => {
|
|
131
|
+
e && b(getComputedStyle(e).direction === "rtl");
|
|
132
|
+
}, []), M = C(!1), N = a.transitionStatus === "ending";
|
|
133
|
+
return x(() => {
|
|
134
134
|
let e = a.ref?.current, t = e?.ownerDocument.activeElement;
|
|
135
135
|
if (!N || M.current || !t || !e.contains(t)) return;
|
|
136
136
|
let n = g?.current;
|
|
@@ -139,10 +139,10 @@ function I({ toast: a, closeLabel: o }) {
|
|
|
139
139
|
N,
|
|
140
140
|
g,
|
|
141
141
|
a.ref
|
|
142
|
-
]), /* @__PURE__ */
|
|
142
|
+
]), /* @__PURE__ */ E(D.Root, {
|
|
143
143
|
"aria-modal": void 0,
|
|
144
|
-
ref:
|
|
145
|
-
render: /* @__PURE__ */
|
|
144
|
+
ref: S,
|
|
145
|
+
render: /* @__PURE__ */ T(t, {
|
|
146
146
|
alignItems: "start",
|
|
147
147
|
backgroundColor: "bgRaised",
|
|
148
148
|
borderRadius: "med",
|
|
@@ -153,16 +153,16 @@ function I({ toast: a, closeLabel: o }) {
|
|
|
153
153
|
padding: "12"
|
|
154
154
|
}),
|
|
155
155
|
role: "group",
|
|
156
|
-
swipeDirection: ["down",
|
|
156
|
+
swipeDirection: ["down", _ ? "left" : "right"],
|
|
157
157
|
toast: a,
|
|
158
158
|
children: [
|
|
159
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ T(t, {
|
|
160
160
|
display: "flex",
|
|
161
161
|
flexShrink: 0,
|
|
162
162
|
paddingBlock: "2",
|
|
163
|
-
children: /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ T(l, { color: u })
|
|
164
164
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ E(t, {
|
|
166
166
|
alignItems: "start",
|
|
167
167
|
className: f,
|
|
168
168
|
display: "flex",
|
|
@@ -170,22 +170,22 @@ function I({ toast: a, closeLabel: o }) {
|
|
|
170
170
|
flexGrow: 1,
|
|
171
171
|
gap: "8",
|
|
172
172
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ T(D.Title, { render: /* @__PURE__ */ T(r, {
|
|
174
174
|
as: "div",
|
|
175
175
|
weight: "medium"
|
|
176
176
|
}) }),
|
|
177
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ T(D.Description, { render: /* @__PURE__ */ T(r, {
|
|
178
178
|
as: "div",
|
|
179
179
|
color: "fgMuted",
|
|
180
180
|
size: "sm"
|
|
181
181
|
}) }),
|
|
182
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ T(D.Action, { render: /* @__PURE__ */ T(i, {
|
|
183
183
|
size: "sm",
|
|
184
184
|
variant: "secondary"
|
|
185
185
|
}) })
|
|
186
186
|
]
|
|
187
187
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ T(D.Close, {
|
|
189
189
|
"aria-hidden": !1,
|
|
190
190
|
"aria-label": o,
|
|
191
191
|
onClick: (e) => {
|
|
@@ -195,13 +195,13 @@ function I({ toast: a, closeLabel: o }) {
|
|
|
195
195
|
n.isConnected && n.focus();
|
|
196
196
|
}));
|
|
197
197
|
},
|
|
198
|
-
render: /* @__PURE__ */
|
|
198
|
+
render: /* @__PURE__ */ T(n, {
|
|
199
199
|
borderRadius: "sm",
|
|
200
200
|
className: d,
|
|
201
201
|
flexShrink: 0,
|
|
202
202
|
padding: "4"
|
|
203
203
|
}),
|
|
204
|
-
children: /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ T(s, {})
|
|
205
205
|
})
|
|
206
206
|
]
|
|
207
207
|
});
|
|
@@ -211,9 +211,9 @@ function L(e) {
|
|
|
211
211
|
return (t(e.nextElementSibling, !0) ?? t(e.previousElementSibling, !1))?.querySelector(`.${d}`);
|
|
212
212
|
}
|
|
213
213
|
function R() {
|
|
214
|
-
let e =
|
|
214
|
+
let e = v(k);
|
|
215
215
|
if (!e) throw Error("useToast must be called under Toast.Provider.");
|
|
216
|
-
return
|
|
216
|
+
return S(() => {
|
|
217
217
|
let t = (t) => e.close(t);
|
|
218
218
|
return {
|
|
219
219
|
add: ({ title: n, description: r, variant: i = "info", duration: a = i === "error" ? 0 : 5e3, action: o }) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer tokens, reset, atoms, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
2
2
|
@layer components.visually-hidden{._1qk18b30{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}}
|
package/dist/base.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@layer tokens, reset, atoms, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
2
2
|
@layer tokens{:root{--space-0:0rem;--space-1:.0625rem;--space-2:.125rem;--space-4:.25rem;--space-6:.375rem;--space-8:.5rem;--space-12:.75rem;--space-16:1rem;--space-20:1.25rem;--space-24:1.5rem;--space-32:2rem;--space-40:2.5rem;--space-48:3rem;--space-64:4rem;--space-80:5rem;--space-96:6rem;--size-xs:1.5rem;--size-sm:2rem;--size-med:2.5rem;--size-lg:3rem;--size-xl:3.5rem;--container-prose:40rem;--container-page:64rem;--container-wide:80rem;--radius-none:0;--radius-sm:.25rem;--radius-med:.5rem;--radius-lg:.75rem;--radius-xl:1rem;--radius-full:9999px;--font-size-xs:.75rem;--font-size-sm:.875rem;--font-size-med:1rem;--font-size-lg:1.125rem;--font-size-xl:1.25rem;--font-size-2xl:1.5rem;--font-size-3xl:1.875rem;--font-size-4xl:2.25rem;--font-weight-regular:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--line-height-sm:1.25;--line-height-med:1.5;--line-height-lg:1.75;--z-index-base:0;--z-index-raised:1;--z-index-dropdown:1000;--z-index-sticky:1100;--z-index-overlay:1200;--z-index-modal:1300;--z-index-popover:1400;--z-index-toast:1500;--z-index-tooltip:1600;--duration-fast:.12s;--duration-med:.2s;--duration-slow:.32s;--easing-standard:cubic-bezier(.2, 0, 0, 1);--easing-enter:cubic-bezier(0, 0, 0, 1);--easing-exit:cubic-bezier(.3, 0, 1, 1);--distance-sm:.25rem;--distance-med:.5rem;--distance-lg:1rem;--scale-sm:.02;--scale-med:.05;--scale-lg:.1}[data-brand]{--shadow-sm:0 1px 2px color-mix(in srgb, var(--color-shadow) 12%, transparent);--shadow-med:0 2px 8px color-mix(in srgb, var(--color-shadow) 14%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 8%, transparent);--shadow-lg:0 8px 24px color-mix(in srgb, var(--color-shadow) 16%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 8%, transparent)}[data-brand][data-mode=light]{color-scheme:light}[data-brand][data-mode=dark]{--shadow-sm:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 40%, transparent);--shadow-med:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 2px 8px color-mix(in srgb, var(--color-shadow) 48%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 32%, transparent);--shadow-lg:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 8px 24px color-mix(in srgb, var(--color-shadow) 56%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 32%, transparent);color-scheme:dark}[data-brand][data-mode=system]{color-scheme:light dark}:dir(ltr){--dir:1}:dir(rtl){--dir:-1}@media (prefers-color-scheme:dark){[data-brand][data-mode=system]{--shadow-sm:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 40%, transparent);--shadow-med:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 2px 8px color-mix(in srgb, var(--color-shadow) 48%, transparent), 0 1px 2px color-mix(in srgb, var(--color-shadow) 32%, transparent);--shadow-lg:0 0 0 1px color-mix(in srgb, var(--color-fg) 10%, transparent), 0 8px 24px color-mix(in srgb, var(--color-shadow) 56%, transparent), 0 2px 6px color-mix(in srgb, var(--color-shadow) 32%, transparent)}}@media (prefers-reduced-motion:reduce){:root{--distance-sm:0rem;--distance-med:0rem;--distance-lg:0rem;--scale-sm:0;--scale-med:0;--scale-lg:0;--duration-fast:.12s;--duration-med:.12s;--duration-slow:.12s}}}
|
|
3
3
|
|
|
4
4
|
@font-face{src:local(Arial),local(ArialMT);font-weight:400;font-style:normal;size-adjust:101.568%;ascent-override:95.3892%;descent-override:23.7511%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Bold),local(Arial-BoldMT);font-weight:700;font-style:normal;size-adjust:101.637%;ascent-override:95.3241%;descent-override:23.7349%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Italic),local(Arial-ItalicMT);font-weight:400;font-style:italic;size-adjust:101.637%;ascent-override:95.3241%;descent-override:23.7349%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Arial Bold Italic),local(Arial-BoldItalicMT);font-weight:700;font-style:italic;size-adjust:101.706%;ascent-override:95.2591%;descent-override:23.7187%;line-gap-override:0%;font-family:Inter Fallback Arial}@font-face{src:local(Menlo Regular),local(Menlo-Regular);font-weight:400;font-style:normal;size-adjust:100.137%;ascent-override:101.871%;descent-override:29.9621%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Bold),local(Menlo-Bold);font-weight:700;font-style:normal;size-adjust:100.003%;ascent-override:102.007%;descent-override:30.0022%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Italic),local(Menlo-Italic);font-weight:400;font-style:italic;size-adjust:100.137%;ascent-override:101.871%;descent-override:29.9621%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Menlo Bold Italic),local(Menlo-BoldItalic);font-weight:700;font-style:italic;size-adjust:100.003%;ascent-override:102.007%;descent-override:30.0022%;line-gap-override:0%;font-family:JetBrains Mono Fallback Menlo}@font-face{src:local(Consolas);font-weight:400;font-style:normal;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Bold),local(Consolas-Bold);font-weight:700;font-style:normal;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Italic),local(Consolas-Italic);font-weight:400;font-style:italic;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Consolas Bold Italic),local(Consolas-BoldItalic);font-weight:700;font-style:italic;size-adjust:114.387%;ascent-override:89.1798%;descent-override:26.2293%;line-gap-override:0%;font-family:JetBrains Mono Fallback Consolas}@font-face{src:local(Courier New),local(CourierNewPSMT);font-weight:400;font-style:normal;size-adjust:127.781%;ascent-override:79.8319%;descent-override:23.48%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Bold),local(CourierNewPS-BoldMT);font-weight:700;font-style:normal;size-adjust:123.353%;ascent-override:82.6977%;descent-override:24.3229%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Italic),local(CourierNewPS-ItalicMT);font-weight:400;font-style:italic;size-adjust:127.781%;ascent-override:79.8319%;descent-override:23.48%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@font-face{src:local(Courier New Bold Italic),local(CourierNewPS-BoldItalicMT);font-weight:700;font-style:italic;size-adjust:123.353%;ascent-override:82.6977%;descent-override:24.3229%;line-gap-override:0%;font-family:JetBrains Mono Fallback Courier New}@layer tokens{[data-brand=default]{--color-bg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-bg-muted:light-dark(oklch(96.8% .004 265),oklch(27% .01 265));--color-bg-raised:light-dark(oklch(100% 0 0),oklch(20.5% .008 265));--color-fg:light-dark(oklch(14.5% .006 265),oklch(98.5% .002 265));--color-fg-muted:light-dark(oklch(44.5% .014 265),oklch(71% .012 265));--color-border:light-dark(oklch(92.5% .006 265),oklch(27% .01 265));--color-border-strong:oklch(55.5% .014 265);--color-accent:light-dark(oklch(54.6% .19 258),oklch(70.7% .14 258));--color-accent-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-accent-fill:light-dark(oklch(54.6% .19 258),oklch(48.8% .18 258));--color-accent-fill-fg:oklch(100% 0 0);--color-danger:light-dark(oklch(56% .2 25),oklch(70.4% .17 25));--color-danger-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-success:light-dark(oklch(52% .135 150),oklch(76% .15 150));--color-success-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-warning:light-dark(oklch(53% .11 75),oklch(81% .145 75));--color-warning-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-done:light-dark(oklch(55% .2 295),oklch(72% .15 295));--color-done-fg:light-dark(oklch(100% 0 0),oklch(14.5% .006 265));--color-neutral-subtle:light-dark(oklch(96.8% .004 265),oklch(27% .01 265));--color-neutral-subtle-fg:light-dark(oklch(37% .013 265),oklch(92.5% .006 265));--color-accent-subtle:light-dark(oklch(93.2% .032 258),oklch(28.2% .09 258));--color-accent-subtle-fg:light-dark(oklch(48.8% .18 258),oklch(80.9% .095 258));--color-success-subtle:light-dark(oklch(94.5% .04 150),oklch(26% .06 150));--color-success-subtle-fg:light-dark(oklch(46.5% .12 150),oklch(84% .115 150));--color-warning-subtle:light-dark(oklch(95.5% .03 75),oklch(27% .05 75));--color-warning-subtle-fg:light-dark(oklch(47.5% .1 75),oklch(86% .105 75));--color-danger-subtle:light-dark(oklch(93.6% .032 25),oklch(25.8% .085 25));--color-danger-subtle-fg:light-dark(oklch(50.5% .19 25),oklch(80.8% .105 25));--color-done-subtle:light-dark(oklch(93.8% .032 295),oklch(28% .095 295));--color-done-subtle-fg:light-dark(oklch(49% .19 295),oklch(81.5% .1 295));--color-focus:light-dark(oklch(54.6% .19 258),oklch(70.7% .14 258));--color-shadow:light-dark(oklch(14.5% .006 265),oklch(0% 0 0));--font-body:"Inter", "Inter Fallback Arial", sans-serif;--font-heading:"Inter", "Inter Fallback Arial", sans-serif;--font-display:"Inter", "Inter Fallback Arial", sans-serif;--font-label:"Inter", "Inter Fallback Arial", sans-serif;--font-mono:"JetBrains Mono", "JetBrains Mono Fallback Menlo", "JetBrains Mono Fallback Consolas", "JetBrains Mono Fallback Courier New", monospace;--font-trim-body-cap:.36377;--font-trim-body-baseline:.36377;--font-trim-heading-cap:.36377;--font-trim-heading-baseline:.36377;--font-trim-display-cap:.36377;--font-trim-display-baseline:.36377;--font-trim-label-cap:.36377;--font-trim-label-baseline:.36377;--font-trim-mono-cap:.37;--font-trim-mono-baseline:.36}@media (forced-colors:active){[data-brand][data-brand]{--color-bg:Canvas;--color-bg-muted:Canvas;--color-bg-raised:Canvas;--color-fg:CanvasText;--color-fg-muted:CanvasText;--color-border:CanvasText;--color-border-strong:CanvasText;--color-accent:LinkText;--color-accent-fg:Canvas;--color-accent-fill:LinkText;--color-accent-fill-fg:Canvas;--color-danger:CanvasText;--color-danger-fg:Canvas;--color-success:CanvasText;--color-success-fg:Canvas;--color-warning:CanvasText;--color-warning-fg:Canvas;--color-done:CanvasText;--color-done-fg:Canvas;--color-neutral-subtle:Canvas;--color-neutral-subtle-fg:CanvasText;--color-accent-subtle:Canvas;--color-accent-subtle-fg:CanvasText;--color-success-subtle:Canvas;--color-success-subtle-fg:CanvasText;--color-warning-subtle:Canvas;--color-warning-subtle-fg:CanvasText;--color-danger-subtle:Canvas;--color-danger-subtle-fg:CanvasText;--color-done-subtle:Canvas;--color-done-subtle-fg:CanvasText;--color-focus:Highlight;--color-shadow:CanvasText}}}
|
package/dist/docs/Box.md
CHANGED
|
@@ -22,6 +22,9 @@ The base element every component builds on: one element, chosen with `as`, style
|
|
|
22
22
|
- Properties are logical: `paddingInline`, `marginBlockStart`, `inlineSize`. There is no `paddingLeft` or `width`.
|
|
23
23
|
- Sizing keys `xs`, `sm`, `med`, `lg` and `xl` are control heights, 24 to 56px: `maxInlineSize="lg"` is 48px wide. For a page or panel width use a container width, on `inlineSize`, `minInlineSize` and `maxInlineSize` only: `prose` (40rem, a reading column), `page` (64rem) or `wide` (80rem). `full`, `fit`, `min`, `max` and `auto` work on every sizing prop.
|
|
24
24
|
- Only layout props are responsive: `{ base: "none", med: "flex" }` with breakpoints `sm`, `med`, `lg`, `xl`. Color and the rest take one value.
|
|
25
|
+
- The style-prop CSS ships in two files (decision 0111). Every component brings the base rules. The `sm`, `med`, `lg` and `xl` rules are `@jonmilner/ui/responsive.css`, which only Box, Stack and Inline import, so a Button alone ships none of them, whether imported from `@jonmilner/ui/Button` or from `@jonmilner/ui`.
|
|
26
|
+
- A responsive value on any other component (`<Button marginBlock={{ base: "8", med: "16" }}>`) keeps only its `base` value unless `responsive.css` is on the page. A Box, Stack or Inline on the page brings it, but one on another route only does if that route loaded first. So an app that sets one imports it once, as a JS import, in its root module beside `base.css`.
|
|
27
|
+
- In development a console warning names the missing import, but only where the rules are really absent: in development the root `@jonmilner/ui` import loads every component, Box included, so there the value works and the warning stays silent, and only the production build drops it.
|
|
25
28
|
- There are no hover, focus or active props; states belong in component CSS.
|
|
26
29
|
- `null` and `false` leave a prop unset, so `paddingInline={dense && "8"}` works.
|
|
27
30
|
- The consumer's `className` comes last and `style` is passed through, so consumer values win.
|
|
@@ -46,6 +49,12 @@ The base element every component builds on: one element, chosen with `as`, style
|
|
|
46
49
|
</Box>
|
|
47
50
|
```
|
|
48
51
|
|
|
52
|
+
```ts
|
|
53
|
+
// app root: responsive values on components other than Box, Stack and Inline.
|
|
54
|
+
import "@jonmilner/ui/base.css";
|
|
55
|
+
import "@jonmilner/ui/responsive.css";
|
|
56
|
+
```
|
|
57
|
+
|
|
49
58
|
## Don't
|
|
50
59
|
|
|
51
60
|
```tsx
|
|
@@ -63,6 +72,12 @@ The base element every component builds on: one element, chosen with `as`, style
|
|
|
63
72
|
<Box style={{ color: "#333" }} />
|
|
64
73
|
```
|
|
65
74
|
|
|
75
|
+
```tsx
|
|
76
|
+
// Without `responsive.css` imported at the app root, the `med` margin applies only if a Box,
|
|
77
|
+
// Stack or Inline happened to load the rules first.
|
|
78
|
+
<Button marginBlock={{ base: "8", med: "16" }}>Save</Button>
|
|
79
|
+
```
|
|
80
|
+
|
|
66
81
|
```tsx
|
|
67
82
|
// A clickable Box has no focus ring, role or keyboard support.
|
|
68
83
|
<Box onClick={open}>Open</Box>
|
package/dist/docs/manifest.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# 0.9.0
|
|
2
|
+
|
|
3
|
+
The style-prop atoms are split by breakpoint (decision 0111): `atoms.css` keeps the base rules, and the `sm`, `med`, `lg` and `xl` rules move to `@jonmilner/ui/responsive.css`, which only Box, Stack and Inline import. A responsive style prop on any other component (`<Button marginBlock={{ base: "8", med: "16" }}>`) keeps only its `base` value unless `responsive.css` is on the page. No prop, value, breakpoint or existing import path changes.
|
|
4
|
+
|
|
5
|
+
## Find
|
|
6
|
+
|
|
7
|
+
In the app's source (`*.tsx`), every responsive style-prop value: regex `=\{\{\s*(base|sm|med|lg|xl)\s*:`. A match on an element other than `Box`, `Stack` or `Inline` needs the import below, unless every page that renders it also renders a Box, Stack or Inline from `@jonmilner/ui`. Values built elsewhere and spread in (`{...layout}`) are not found by the regex; search for the breakpoint keys `\b(sm|med|lg|xl)\s*:` near style props too.
|
|
8
|
+
|
|
9
|
+
In development, the browser console also shows `@jonmilner/ui: a responsive style prop rendered without the breakpoint rules` on any page that misses it.
|
|
10
|
+
|
|
11
|
+
## Replace
|
|
12
|
+
|
|
13
|
+
Import the breakpoint rules once, as a JS import, in the app's root module (the root layout or entry), beside any `@jonmilner/ui/base.css` import. A CSS `@import` may be inlined into a second copy, so use the JS form.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// before
|
|
17
|
+
import "@jonmilner/ui/base.css";
|
|
18
|
+
// after
|
|
19
|
+
import "@jonmilner/ui/base.css";
|
|
20
|
+
import "@jonmilner/ui/responsive.css";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
An app with no responsive value outside Box, Stack and Inline needs no change; the import is still safe, since it is the same file those three load.
|
|
24
|
+
|
|
25
|
+
## Verify
|
|
26
|
+
|
|
27
|
+
Run the app in development and load each page that has a responsive value outside Box, Stack and Inline; the console shows no `@jonmilner/ui: a responsive style prop rendered without the breakpoint rules` warning, and at a viewport of 48em or wider a `med` value applies (for example, the computed `margin-block` of the Button above is 16px).
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BoxProps, StyleProps } from "./Box/base.mjs";
|
|
2
2
|
import { Clickable, ClickableProps } from "./Clickable/index.mjs";
|
|
3
3
|
import { Icon, IconProps } from "./Icon/index.mjs";
|
|
4
4
|
import { Button, ButtonProps } from "./Button/index.mjs";
|
|
@@ -7,6 +7,7 @@ import { DialogCloseProps, DialogTriggerProps } from "./Dialog/client.mjs";
|
|
|
7
7
|
import { AlertDialog, AlertDialogProps, AlertDialogTriggerProps } from "./AlertDialog/index.mjs";
|
|
8
8
|
import { Avatar, AvatarProps } from "./Avatar/index.mjs";
|
|
9
9
|
import { Badge, BadgeProps } from "./Badge/index.mjs";
|
|
10
|
+
import { Box } from "./Box/index.mjs";
|
|
10
11
|
import { Checkbox, CheckboxProps } from "./Checkbox/index.mjs";
|
|
11
12
|
import { Chip, ChipGroup, ChipGroupProps, ChipProps } from "./Chip/index.mjs";
|
|
12
13
|
import { SearchFieldInputProps } from "./SearchField/client.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { Clickable as e } from "./Clickable/index.mjs";
|
|
2
|
+
import { Icon as t } from "./Icon/index.mjs";
|
|
3
|
+
import { Text as n } from "./Text/index.mjs";
|
|
4
|
+
import { Button as r } from "./Button/index.mjs";
|
|
5
|
+
import { Heading as i } from "./Heading/index.mjs";
|
|
6
|
+
import { Dialog as a } from "./Dialog/index.mjs";
|
|
7
|
+
import { AlertDialog as o } from "./AlertDialog/index.mjs";
|
|
8
|
+
import { Avatar as s } from "./Avatar/index.mjs";
|
|
9
|
+
import { Badge as c } from "./Badge/index.mjs";
|
|
10
|
+
import { Box as l } from "./Box/index.mjs";
|
|
11
11
|
import { Checkbox as u } from "./Checkbox/index.mjs";
|
|
12
12
|
import { Chip as d, ChipGroup as f } from "./Chip/index.mjs";
|
|
13
13
|
import { Field as p } from "./Field/index.mjs";
|
|
@@ -26,4 +26,4 @@ import { ThemeProvider as T } from "./theme/ThemeProvider.mjs";
|
|
|
26
26
|
import { useToast as E } from "./Toast/client.mjs";
|
|
27
27
|
import { Toast as D } from "./Toast/index.mjs";
|
|
28
28
|
import { VisuallyHidden as O } from "./VisuallyHidden/index.mjs";
|
|
29
|
-
export {
|
|
29
|
+
export { o as AlertDialog, s as Avatar, c as Badge, l as Box, r as Button, u as Checkbox, d as Chip, f as ChipGroup, e as Clickable, m as ColorField, a as Dialog, p as Field, i as Heading, t as Icon, h as IconButton, g as Inline, _ as Menu, v as MultiSelect, y as SearchField, b as Stack, x as Tabs, S as Tag, n as Text, C as TextField, T as ThemeProvider, D as Toast, O as VisuallyHidden, w as defineTheme, E as useToast };
|
package/dist/popup/client.mjs
CHANGED
|
@@ -2,44 +2,44 @@
|
|
|
2
2
|
import { Clickable as e } from "../Clickable/index.mjs";
|
|
3
3
|
import { Button as t } from "../Button/index.mjs";
|
|
4
4
|
import { useThemeContainer as n } from "../theme/use-theme-container.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { createContext as r, use as i, useCallback as a, useLayoutEffect as o, useRef as s } from "react";
|
|
6
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
7
7
|
//#region src/popup/client.tsx
|
|
8
|
-
var l =
|
|
8
|
+
var l = r({
|
|
9
9
|
container: { current: null },
|
|
10
10
|
ref: () => {},
|
|
11
11
|
trigger: { current: null }
|
|
12
|
-
}), u =
|
|
12
|
+
}), u = r({ current: {
|
|
13
13
|
keyboard: !1,
|
|
14
14
|
opener: null
|
|
15
15
|
} });
|
|
16
16
|
function d({ children: e }) {
|
|
17
|
-
let t =
|
|
17
|
+
let t = s({
|
|
18
18
|
keyboard: !1,
|
|
19
19
|
opener: null
|
|
20
20
|
});
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ c(l, {
|
|
22
22
|
value: n(),
|
|
23
|
-
children: /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ c(u, {
|
|
24
24
|
value: t,
|
|
25
25
|
children: e
|
|
26
26
|
})
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
function f() {
|
|
30
|
-
return
|
|
30
|
+
return i(l);
|
|
31
31
|
}
|
|
32
|
-
function p({ variant: n, size:
|
|
33
|
-
return n ||
|
|
34
|
-
...
|
|
32
|
+
function p({ variant: n, size: r, iconStart: i, iconEnd: a, ...o }) {
|
|
33
|
+
return n || r || i || a ? /* @__PURE__ */ c(t, {
|
|
34
|
+
...o,
|
|
35
35
|
variant: n,
|
|
36
|
-
size:
|
|
37
|
-
iconStart:
|
|
38
|
-
iconEnd:
|
|
39
|
-
}) : /* @__PURE__ */
|
|
36
|
+
size: r,
|
|
37
|
+
iconStart: i,
|
|
38
|
+
iconEnd: a
|
|
39
|
+
}) : /* @__PURE__ */ c(e, { ...o });
|
|
40
40
|
}
|
|
41
41
|
function m(e) {
|
|
42
|
-
let t =
|
|
42
|
+
let t = i(u);
|
|
43
43
|
return (n, r) => {
|
|
44
44
|
t.current = n ? {
|
|
45
45
|
keyboard: !1,
|
|
@@ -73,14 +73,14 @@ function v(e) {
|
|
|
73
73
|
} })), _;
|
|
74
74
|
}
|
|
75
75
|
function y(e, { finalFocus: t, modal: n = !1, open: r }) {
|
|
76
|
-
let { trigger:
|
|
76
|
+
let { trigger: c } = f(), l = i(u), d = s(null), p = a((t) => {
|
|
77
77
|
d.current = t;
|
|
78
78
|
let n = h(e, t);
|
|
79
79
|
return () => {
|
|
80
80
|
d.current = null, n();
|
|
81
81
|
};
|
|
82
82
|
}, [e]);
|
|
83
|
-
return
|
|
83
|
+
return o(() => {
|
|
84
84
|
let e = d.current;
|
|
85
85
|
if (!r || !e || l.current.recorded) return;
|
|
86
86
|
let { activeElement: t, body: n } = e.ownerDocument, i = t === n || e.contains(t) ? null : t;
|
|
@@ -88,19 +88,19 @@ function y(e, { finalFocus: t, modal: n = !1, open: r }) {
|
|
|
88
88
|
keyboard: !1,
|
|
89
89
|
opener: i
|
|
90
90
|
};
|
|
91
|
-
}, [r, l]),
|
|
91
|
+
}, [r, l]), o(() => {
|
|
92
92
|
let e = d.current;
|
|
93
93
|
if (!e) return;
|
|
94
94
|
if (r) {
|
|
95
95
|
e.inert = !1;
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
|
-
let { reason:
|
|
98
|
+
let { reason: i, keyboard: a, opener: o } = l.current;
|
|
99
99
|
l.current.recorded = !1;
|
|
100
|
-
let
|
|
101
|
-
if (!t &&
|
|
100
|
+
let s = o?.isConnected ? o : c.current, { activeElement: u } = e.ownerDocument, f = n && i === "outside-press" && v(e.ownerDocument);
|
|
101
|
+
if (!t && s instanceof HTMLElement && (f || e.contains(u) && !g.has(i ?? ""))) {
|
|
102
102
|
let e = { preventScroll: !0 };
|
|
103
|
-
|
|
103
|
+
a && (e.focusVisible = !0), s.focus(e);
|
|
104
104
|
}
|
|
105
105
|
e.inert = !0;
|
|
106
106
|
}, [
|
|
@@ -108,7 +108,7 @@ function y(e, { finalFocus: t, modal: n = !1, open: r }) {
|
|
|
108
108
|
t,
|
|
109
109
|
n,
|
|
110
110
|
l,
|
|
111
|
-
|
|
111
|
+
c
|
|
112
112
|
]), {
|
|
113
113
|
"aria-hidden": !r || void 0,
|
|
114
114
|
ref: p
|