@jonmilner/ui 0.11.1 → 0.11.3
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/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/AlertDialog/client.mjs +1 -2
- package/dist/AlertDialog/index.d.mts +0 -2
- package/dist/AlertDialog/index.mjs +1 -2
- package/dist/Avatar/Avatar.css.mjs +1 -2
- package/dist/Avatar/index.d.mts +0 -2
- package/dist/Avatar/index.mjs +1 -2
- package/dist/Avatar/ink.mjs +1 -2
- package/dist/Badge/Badge.css.mjs +1 -2
- package/dist/Badge/index.d.mts +1 -3
- package/dist/Badge/index.mjs +1 -2
- package/dist/Box/Box.css.mjs +1 -2
- package/dist/Box/ResponsiveCheck.mjs +1 -2
- package/dist/Box/base.d.mts +1 -3
- package/dist/Box/base.mjs +1 -2
- package/dist/Box/index.d.mts +0 -2
- package/dist/Box/index.mjs +1 -2
- package/dist/Button/Button.css.mjs +1 -2
- package/dist/Button/index.d.mts +1 -3
- package/dist/Button/index.mjs +1 -2
- package/dist/Checkbox/Checkbox.css.mjs +1 -2
- package/dist/Checkbox/index.d.mts +1 -3
- package/dist/Checkbox/index.mjs +1 -2
- package/dist/Chip/Chip.css.mjs +1 -2
- package/dist/Chip/index.d.mts +1 -3
- package/dist/Chip/index.mjs +1 -2
- package/dist/Clickable/Clickable.css.mjs +1 -2
- package/dist/Clickable/index.d.mts +1 -3
- package/dist/Clickable/index.mjs +1 -2
- package/dist/ColorField/ColorField.css.mjs +1 -2
- package/dist/ColorField/client.d.mts +1 -3
- package/dist/ColorField/client.mjs +1 -2
- package/dist/ColorField/index.d.mts +0 -2
- package/dist/ColorField/index.mjs +1 -2
- package/dist/Dialog/Dialog.css.d.mts +1 -3
- package/dist/Dialog/Dialog.css.mjs +1 -2
- package/dist/Dialog/client.d.mts +0 -2
- package/dist/Dialog/client.mjs +1 -2
- package/dist/Dialog/index.d.mts +0 -2
- package/dist/Dialog/index.mjs +1 -2
- package/dist/Field/Field.css.mjs +1 -2
- package/dist/Field/client.mjs +1 -2
- package/dist/Field/index.d.mts +0 -2
- package/dist/Field/index.mjs +1 -2
- package/dist/Heading/Heading.css.mjs +1 -2
- package/dist/Heading/index.d.mts +1 -3
- package/dist/Heading/index.mjs +1 -2
- package/dist/Icon/Icon.css.mjs +1 -2
- package/dist/Icon/index.d.mts +1 -3
- package/dist/Icon/index.mjs +1 -2
- package/dist/IconButton/IconButton.css.mjs +1 -2
- package/dist/IconButton/index.d.mts +1 -3
- package/dist/IconButton/index.mjs +1 -2
- package/dist/Inline/Inline.css.mjs +1 -2
- package/dist/Inline/index.d.mts +0 -2
- package/dist/Inline/index.mjs +1 -2
- package/dist/Menu/Menu.css.mjs +1 -2
- package/dist/Menu/client.d.mts +0 -2
- package/dist/Menu/client.mjs +1 -2
- package/dist/Menu/index.d.mts +0 -2
- package/dist/Menu/index.mjs +1 -2
- package/dist/MultiSelect/MultiSelect.css.mjs +1 -2
- package/dist/MultiSelect/client.d.mts +1 -3
- package/dist/MultiSelect/client.mjs +1 -2
- package/dist/MultiSelect/index.d.mts +1 -3
- package/dist/MultiSelect/index.mjs +1 -2
- package/dist/SearchField/SearchField.css.mjs +1 -2
- package/dist/SearchField/client.d.mts +1 -3
- package/dist/SearchField/client.mjs +1 -2
- package/dist/SearchField/index.d.mts +0 -2
- package/dist/SearchField/index.mjs +1 -2
- package/dist/Stack/Stack.css.mjs +1 -2
- package/dist/Stack/index.d.mts +0 -2
- package/dist/Stack/index.mjs +1 -2
- package/dist/Tabs/Tabs.css.mjs +1 -2
- package/dist/Tabs/index.d.mts +0 -2
- package/dist/Tabs/index.mjs +1 -2
- package/dist/Tag/Tag.css.mjs +1 -2
- package/dist/Tag/index.d.mts +1 -3
- package/dist/Tag/index.mjs +1 -2
- package/dist/Text/Text.css.mjs +1 -2
- package/dist/Text/index.d.mts +1 -3
- package/dist/Text/index.mjs +1 -2
- package/dist/TextField/TextField.css.mjs +1 -2
- package/dist/TextField/index.d.mts +1 -3
- package/dist/TextField/index.mjs +1 -2
- package/dist/Toast/Toast.css.mjs +1 -2
- package/dist/Toast/client.d.mts +0 -2
- package/dist/Toast/client.mjs +2 -3
- package/dist/Toast/index.d.mts +0 -2
- package/dist/Toast/index.mjs +1 -2
- package/dist/VisuallyHidden/VisuallyHidden.css.mjs +1 -2
- package/dist/VisuallyHidden/index.d.mts +1 -3
- package/dist/VisuallyHidden/index.mjs +1 -2
- package/dist/brands/brand.d.mts +1 -3
- package/dist/brands/brand.mjs +1 -2
- package/dist/brands/check-fonts.mjs +1 -2
- package/dist/brands/default.d.mts +1 -3
- package/dist/brands/default.mjs +1 -2
- package/dist/brands/font.d.mts +1 -3
- package/dist/brands/font.mjs +1 -2
- package/dist/brands/forced-colors.mjs +1 -2
- package/dist/brands/index.d.mts +0 -2
- package/dist/brands/index.mjs +1 -2
- package/dist/brands/metrics.mjs +1 -2
- package/dist/contrast/color.d.mts +1 -3
- package/dist/contrast/color.mjs +1 -2
- package/dist/contrast/contrast.d.mts +0 -2
- package/dist/contrast/contrast.mjs +1 -2
- package/dist/contrast/mixes.mjs +1 -2
- package/dist/docs/Box.md +24 -3
- package/dist/docs/Checkbox.md +2 -2
- package/dist/docs/Field.md +2 -2
- package/dist/docs/Menu.md +1 -1
- package/dist/docs/MultiSelect.md +2 -2
- package/dist/docs/SearchField.md +1 -1
- package/dist/docs/Stack.md +26 -0
- package/dist/docs/TextField.md +3 -3
- package/dist/docs/llms.txt +7 -0
- package/dist/docs/manifest.json +1 -1
- package/dist/icons/ArrowLeftIcon.d.mts +1 -3
- package/dist/icons/ArrowLeftIcon.mjs +1 -2
- package/dist/icons/ArrowRightIcon.d.mts +1 -3
- package/dist/icons/ArrowRightIcon.mjs +1 -2
- package/dist/icons/CheckIcon.d.mts +1 -3
- package/dist/icons/CheckIcon.mjs +1 -2
- package/dist/icons/ChevronDownIcon.d.mts +1 -3
- package/dist/icons/ChevronDownIcon.mjs +1 -2
- package/dist/icons/ChevronRightIcon.d.mts +1 -3
- package/dist/icons/ChevronRightIcon.mjs +1 -2
- package/dist/icons/CircleAlertIcon.d.mts +1 -3
- package/dist/icons/CircleAlertIcon.mjs +1 -2
- package/dist/icons/CircleCheckIcon.d.mts +1 -3
- package/dist/icons/CircleCheckIcon.mjs +1 -2
- package/dist/icons/CircleDotIcon.d.mts +1 -3
- package/dist/icons/CircleDotIcon.mjs +1 -2
- package/dist/icons/CircleSlashIcon.d.mts +1 -3
- package/dist/icons/CircleSlashIcon.mjs +1 -2
- package/dist/icons/EllipsisIcon.d.mts +1 -3
- package/dist/icons/EllipsisIcon.mjs +1 -2
- package/dist/icons/GitMergeIcon.d.mts +1 -3
- package/dist/icons/GitMergeIcon.mjs +1 -2
- package/dist/icons/GitPullRequestClosedIcon.d.mts +1 -3
- package/dist/icons/GitPullRequestClosedIcon.mjs +1 -2
- package/dist/icons/GitPullRequestDraftIcon.d.mts +1 -3
- package/dist/icons/GitPullRequestDraftIcon.mjs +1 -2
- package/dist/icons/GitPullRequestIcon.d.mts +1 -3
- package/dist/icons/GitPullRequestIcon.mjs +1 -2
- package/dist/icons/InboxIcon.d.mts +1 -3
- package/dist/icons/InboxIcon.mjs +1 -2
- package/dist/icons/InfoIcon.d.mts +1 -3
- package/dist/icons/InfoIcon.mjs +1 -2
- package/dist/icons/LoaderCircleIcon.d.mts +1 -3
- package/dist/icons/LoaderCircleIcon.mjs +1 -2
- package/dist/icons/LockOpenIcon.d.mts +1 -3
- package/dist/icons/LockOpenIcon.mjs +1 -2
- package/dist/icons/PencilIcon.d.mts +1 -3
- package/dist/icons/PencilIcon.mjs +1 -2
- package/dist/icons/PlayIcon.d.mts +1 -3
- package/dist/icons/PlayIcon.mjs +1 -2
- package/dist/icons/PlusIcon.d.mts +1 -3
- package/dist/icons/PlusIcon.mjs +1 -2
- package/dist/icons/RefreshCwIcon.d.mts +1 -3
- package/dist/icons/RefreshCwIcon.mjs +1 -2
- package/dist/icons/ReplyIcon.d.mts +1 -3
- package/dist/icons/ReplyIcon.mjs +1 -2
- package/dist/icons/SearchIcon.d.mts +1 -3
- package/dist/icons/SearchIcon.mjs +1 -2
- package/dist/icons/SettingsIcon.d.mts +1 -3
- package/dist/icons/SettingsIcon.mjs +1 -2
- package/dist/icons/Trash2Icon.d.mts +1 -3
- package/dist/icons/Trash2Icon.mjs +1 -2
- package/dist/icons/XIcon.d.mts +1 -3
- package/dist/icons/XIcon.mjs +1 -2
- package/dist/icons/index.d.mts +0 -2
- package/dist/icons/index.mjs +1 -2
- package/dist/lint/index.d.mts +1 -3
- package/dist/lint/index.mjs +1 -2
- package/dist/popup/client.d.mts +1 -3
- package/dist/popup/client.mjs +1 -2
- package/dist/styles/atoms.css.d.mts +1 -3
- package/dist/styles/atoms.css.mjs +1 -2
- package/dist/styles/button-fills.mjs +1 -2
- package/dist/styles/button-parts.css.mjs +1 -2
- package/dist/styles/control-size.mjs +1 -2
- package/dist/styles/highlight.mjs +1 -2
- package/dist/styles/hover-tint.mjs +1 -2
- package/dist/styles/join.mjs +1 -2
- package/dist/styles/part-props.d.mts +1 -3
- package/dist/styles/split-style-props.mjs +1 -2
- package/dist/styles/split-text-props.mjs +1 -2
- package/dist/styles/subtle-fills.d.mts +1 -3
- package/dist/styles/subtle-fills.mjs +1 -2
- package/dist/testing/motion.d.mts +1 -3
- package/dist/testing/motion.mjs +1 -2
- package/dist/theme/FontCheck.mjs +1 -2
- package/dist/theme/ThemeProvider.d.mts +1 -3
- package/dist/theme/ThemeProvider.mjs +1 -2
- package/dist/theme/define-theme.d.mts +1 -3
- package/dist/theme/define-theme.mjs +1 -2
- package/dist/theme/use-theme-container.mjs +1 -2
- package/dist/tokens/contract.d.mts +0 -2
- package/dist/tokens/contract.mjs +1 -2
- package/dist/tokens/roles.d.mts +1 -3
- package/dist/tokens/roles.mjs +1 -2
- package/dist/tokens/scales.d.mts +1 -3
- package/dist/tokens/scales.mjs +1 -2
- package/dist/types.d.mts +1 -3
- package/package.json +4 -4
package/dist/Toast/client.d.mts
CHANGED
|
@@ -3,7 +3,6 @@ import { CircleCheckIcon } from "../icons/CircleCheckIcon.mjs";
|
|
|
3
3
|
import { InfoIcon } from "../icons/InfoIcon.mjs";
|
|
4
4
|
import { CSSProperties, ReactNode } from "react";
|
|
5
5
|
import "@base-ui/react/toast";
|
|
6
|
-
//#region src/Toast/client.d.ts
|
|
7
6
|
export type ToastVariant = keyof typeof icons;
|
|
8
7
|
export type ToastOptions = {
|
|
9
8
|
action?: {
|
|
@@ -42,5 +41,4 @@ export declare function useToast(): {
|
|
|
42
41
|
add: ({ title, description, variant, duration, action }: ToastOptions) => string;
|
|
43
42
|
close: (id: string) => void;
|
|
44
43
|
};
|
|
45
|
-
//#endregion
|
|
46
44
|
export { ToastProvider };
|
package/dist/Toast/client.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { announcer as u, close as d, content as f, list as p, root as m, toast a
|
|
|
13
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
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
|
+
// src/Toast/client.tsx
|
|
17
17
|
var O = {
|
|
18
18
|
info: {
|
|
19
19
|
Icon: l,
|
|
@@ -68,7 +68,7 @@ function N({ regionLabel: n, className: r, style: i, children: a }) {
|
|
|
68
68
|
})));
|
|
69
69
|
}, i = (t) => {
|
|
70
70
|
let r = t.relatedTarget;
|
|
71
|
-
|
|
71
|
+
r && e.contains(r) || (n = !1);
|
|
72
72
|
};
|
|
73
73
|
return t.addEventListener("mouseover", r), t.addEventListener("mouseout", i), () => {
|
|
74
74
|
t.removeEventListener("mouseover", r), t.removeEventListener("mouseout", i);
|
|
@@ -243,5 +243,4 @@ function R() {
|
|
|
243
243
|
};
|
|
244
244
|
}, [e]);
|
|
245
245
|
}
|
|
246
|
-
//#endregion
|
|
247
246
|
export { P as ToastAnnouncer, I as ToastItem, M as ToastProvider, N as ToastStack, R as useToast };
|
package/dist/Toast/index.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ToastOptions, ToastProvider, ToastProviderProps, ToastVariant, useToast } from "./client.mjs";
|
|
2
|
-
//#region src/Toast/index.d.ts
|
|
3
2
|
export declare const Toast: {
|
|
4
3
|
Provider: typeof ToastProvider;
|
|
5
4
|
};
|
|
6
|
-
//#endregion
|
|
7
5
|
export { type ToastOptions, type ToastProviderProps, type ToastVariant, useToast };
|
package/dist/Toast/index.mjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { PolymorphicProps } from "../types.mjs";
|
|
2
2
|
import { ElementType } from "react";
|
|
3
|
-
//#region src/VisuallyHidden/index.d.ts
|
|
4
3
|
export type VisuallyHiddenProps<T extends ElementType = "span"> = PolymorphicProps<T>;
|
|
5
|
-
export declare function VisuallyHidden<T extends ElementType = "span">({ as, className, ...props }: VisuallyHiddenProps<T>): import("react").JSX.Element;
|
|
6
|
-
//#endregion
|
|
4
|
+
export declare function VisuallyHidden<T extends ElementType = "span">({ as, className, ...props }: VisuallyHiddenProps<T>): import("react").JSX.Element;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { join as e } from "../styles/join.mjs";
|
|
2
2
|
import { root as t } from "./VisuallyHidden.css.mjs";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/VisuallyHidden/index.tsx
|
|
5
5
|
function r({ as: r, className: i, ...a }) {
|
|
6
6
|
return /* @__PURE__ */ n(r ?? "span", {
|
|
7
7
|
...a,
|
|
8
8
|
className: e(t, i)
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { r as VisuallyHidden };
|
package/dist/brands/brand.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ColorRole, FontRole } from "../tokens/roles.mjs";
|
|
2
2
|
import { BrandFont } from "./font.mjs";
|
|
3
|
-
//#region src/brands/brand.d.ts
|
|
4
3
|
export interface Brand {
|
|
5
4
|
readonly name: string;
|
|
6
5
|
readonly color: Readonly<Record<ColorRole, string>>;
|
|
7
6
|
readonly font: Readonly<Record<FontRole, BrandFont>>;
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
7
|
+
}
|
package/dist/brands/brand.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/brands/check-fonts.ts
|
|
2
2
|
var e = /* @__PURE__ */ new Set();
|
|
3
3
|
async function t(t, n = 5e3) {
|
|
4
4
|
if (process.env.NODE_ENV === "production" || typeof document > "u") return;
|
|
@@ -11,5 +11,4 @@ async function t(t, n = 5e3) {
|
|
|
11
11
|
a && (e.add(t), console.warn(`@jonmilner/ui: font "${t}" ${a}, so text uses its fallback. Load the font files for this brand (see the brand docs).`));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { t as checkFonts };
|
package/dist/brands/default.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { lightDark as e } from "./brand.mjs";
|
|
2
2
|
import { arial as t, consolas as n, courierNew as r, inter as i, jetBrainsMono as a, menlo as o } from "./metrics.mjs";
|
|
3
|
-
|
|
3
|
+
// src/brands/default.ts
|
|
4
4
|
var s = (e, t) => Object.fromEntries(Object.entries(t).map(([t, [n, r]]) => [t, `oklch(${n} ${r} ${e})`])), c = "oklch(1 0 0)", l = "oklch(0 0 0)", u = s(265, {
|
|
5
5
|
50: [.985, .002],
|
|
6
6
|
100: [.968, .004],
|
|
@@ -130,5 +130,4 @@ var s = (e, t) => Object.fromEntries(Object.entries(t).map(([t, [n, r]]) => [t,
|
|
|
130
130
|
mono: _
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
|
-
//#endregion
|
|
134
133
|
export { v as defaultBrand };
|
package/dist/brands/font.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/brands/font.d.ts
|
|
2
1
|
export interface FontMetrics {
|
|
3
2
|
readonly familyName: string;
|
|
4
3
|
readonly fullName?: string;
|
|
@@ -15,5 +14,4 @@ export interface BrandFont {
|
|
|
15
14
|
readonly metrics: FontMetrics;
|
|
16
15
|
readonly fallback: FontMetrics | readonly [FontMetrics, ...FontMetrics[]];
|
|
17
16
|
readonly generic: "sans-serif" | "serif" | "monospace";
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
17
|
+
}
|
package/dist/brands/font.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/brands/font.ts
|
|
2
2
|
var e = (e) => `"${e}"`, t = (e) => String(Number(e.toFixed(6))), n = (e) => `${t(e * 100)}%`;
|
|
3
3
|
function r({ metrics: e, fallback: t }) {
|
|
4
4
|
let n = [t].flat();
|
|
@@ -48,5 +48,4 @@ function f(e) {
|
|
|
48
48
|
}
|
|
49
49
|
return new Map([...t].map(([e, t]) => [e, [...t.values()]]));
|
|
50
50
|
}
|
|
51
|
-
//#endregion
|
|
52
51
|
export { d as fallbackFace, f as fallbackFaces, i as fallbackFamily, r as fallbackPairs, u as fallbackVariants, a as fontStack, o as fontTrim };
|
package/dist/brands/index.d.mts
CHANGED
package/dist/brands/index.mjs
CHANGED
package/dist/brands/metrics.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/brands/metrics.ts
|
|
2
2
|
var e = {
|
|
3
3
|
familyName: "Inter",
|
|
4
4
|
fullName: "Inter Regular",
|
|
@@ -159,5 +159,4 @@ var e = {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
|
-
//#endregion
|
|
163
162
|
export { n as arial, c as consolas, r as courierNew, e as inter, t as jetBrainsMono, o as menlo };
|
package/dist/contrast/color.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ColorRole } from "../tokens/roles.mjs";
|
|
2
2
|
import { Brand } from "../brands/brand.mjs";
|
|
3
3
|
import { Mode } from "./color.mjs";
|
|
4
|
-
//#region src/contrast/contrast.d.ts
|
|
5
4
|
export interface ContrastPair {
|
|
6
5
|
fg: ColorRole;
|
|
7
6
|
bg: ColorRole;
|
|
@@ -14,5 +13,4 @@ export interface ContrastFailure extends ContrastPair {
|
|
|
14
13
|
export declare const contrastPairs: readonly ContrastPair[];
|
|
15
14
|
export declare function contrastRatio(fg: string, bg: string, mode?: Mode): number;
|
|
16
15
|
export declare function checkContrast(brand: Brand): ContrastFailure[];
|
|
17
|
-
//#endregion
|
|
18
16
|
export type { Mode };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { subtleFills as e } from "../styles/subtle-fills.mjs";
|
|
2
2
|
import { decode as t, resolveColor as n } from "./color.mjs";
|
|
3
|
-
|
|
3
|
+
// src/contrast/contrast.ts
|
|
4
4
|
var r = [
|
|
5
5
|
"bg",
|
|
6
6
|
"bgMuted",
|
|
@@ -59,5 +59,4 @@ function d(e) {
|
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
//#endregion
|
|
63
62
|
export { d as checkContrast, o as contrastPairs, l as contrastRatio, r as surfaces };
|
package/dist/contrast/mixes.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { fills as e } from "../styles/button-fills.mjs";
|
|
|
2
2
|
import { contrastRatio as t, surfaces as n } from "./contrast.mjs";
|
|
3
3
|
import { highlightFill as r, highlightText as i } from "../styles/highlight.mjs";
|
|
4
4
|
import { hoverFill as a } from "../styles/hover-tint.mjs";
|
|
5
|
-
|
|
5
|
+
// src/contrast/mixes.ts
|
|
6
6
|
var o = [
|
|
7
7
|
{
|
|
8
8
|
name: "Menu highlight",
|
|
@@ -38,5 +38,4 @@ function s(e) {
|
|
|
38
38
|
});
|
|
39
39
|
}));
|
|
40
40
|
}
|
|
41
|
-
//#endregion
|
|
42
41
|
export { s as checkMixes, o as contrastMixes };
|
package/dist/docs/Box.md
CHANGED
|
@@ -6,14 +6,14 @@ The base element every component builds on: one element, chosen with `as`, style
|
|
|
6
6
|
|
|
7
7
|
## When to use
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
- Surfaces that need tokens but no behavior: a padded panel, a sticky bar, a grid.
|
|
10
10
|
- A semantic element (`as="section"`, `as="nav"`, `as="ul"`) that needs style props.
|
|
11
11
|
- Building a new component: render a `Box` and pass its tunable values as default style props.
|
|
12
12
|
|
|
13
13
|
## When not to use
|
|
14
14
|
|
|
15
15
|
- Text: use `Text` or `Heading`; all visible text goes through them.
|
|
16
|
-
- Stacks and rows of children with a gap: use `Stack` or `Inline`.
|
|
16
|
+
- Stacks and rows of children with a gap: use `Stack` or `Inline`. A Box with `display="flex"`, `flexDirection="column"` and `gap` is a `Stack` rebuilt by hand.
|
|
17
17
|
- Anything interactive: use `Button` or a link component, which bring focus and states.
|
|
18
18
|
|
|
19
19
|
## Rules
|
|
@@ -33,7 +33,20 @@ The base element every component builds on: one element, chosen with `as`, style
|
|
|
33
33
|
## Do
|
|
34
34
|
|
|
35
35
|
```tsx
|
|
36
|
-
|
|
36
|
+
// A centered column: `Stack`, not a Box with flex props (see Don't).
|
|
37
|
+
<Stack gap="16" alignItems="center">
|
|
38
|
+
<Heading>No projects yet</Heading>
|
|
39
|
+
<Button variant="primary">Create project</Button>
|
|
40
|
+
</Stack>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
<Box
|
|
45
|
+
as="section"
|
|
46
|
+
aria-label="Billing"
|
|
47
|
+
padding={{ base: "16", med: "24" }}
|
|
48
|
+
backgroundColor="bgRaised"
|
|
49
|
+
>
|
|
37
50
|
…
|
|
38
51
|
</Box>
|
|
39
52
|
```
|
|
@@ -57,6 +70,14 @@ import "@jonmilner/ui/responsive.css";
|
|
|
57
70
|
|
|
58
71
|
## Don't
|
|
59
72
|
|
|
73
|
+
```tsx
|
|
74
|
+
// A Box rebuilding Stack: write `<Stack gap="16" alignItems="center">` (see Do).
|
|
75
|
+
<Box display="flex" flexDirection="column" alignItems="center" gap="16">
|
|
76
|
+
<Heading>No projects yet</Heading>
|
|
77
|
+
<Button variant="primary">Create project</Button>
|
|
78
|
+
</Box>
|
|
79
|
+
```
|
|
80
|
+
|
|
60
81
|
```tsx
|
|
61
82
|
// Physical property, `md`: neither type-checks.
|
|
62
83
|
<Box paddingLeft="16" gap="md" />
|
package/dist/docs/Checkbox.md
CHANGED
|
@@ -11,8 +11,8 @@ A two-state choice, with a third mixed state for a "select all" over a partly se
|
|
|
11
11
|
|
|
12
12
|
## When not to use
|
|
13
13
|
|
|
14
|
-
- A setting that applies the moment it flips:
|
|
15
|
-
- One choice out of several:
|
|
14
|
+
- A setting that applies the moment it flips: `Switch` is planned.
|
|
15
|
+
- One choice out of several: `RadioGroup` is planned.
|
|
16
16
|
- Picking several options from a long list in a popup: use `MultiSelect`.
|
|
17
17
|
|
|
18
18
|
## Rules
|
package/dist/docs/Field.md
CHANGED
|
@@ -7,13 +7,13 @@ Wires one form control to its label, description and error: ids, `htmlFor`, `ari
|
|
|
7
7
|
## When to use
|
|
8
8
|
|
|
9
9
|
- Any form control that needs a visible label, help text or an error, including a control a component builds (Checkbox, MultiSelect build on Field rather than their own wiring).
|
|
10
|
-
- Showing a server validation error
|
|
10
|
+
- Showing a server validation error next to its control. The app's action or submit handler returns it; set `invalid` and put the message in `Field.Error` (a props control such as `TextField` takes it as `error` instead; ADR 0133).
|
|
11
11
|
|
|
12
12
|
## When not to use
|
|
13
13
|
|
|
14
14
|
- An error about the whole form (a failed save, a network error): put it in a reserved slot at the form level, not on one field.
|
|
15
15
|
- The result of submitting the form ("Profile saved"): use `Toast`; the field's message is for that one input.
|
|
16
|
-
- A group of controls with one legend
|
|
16
|
+
- A group of controls with one legend: a public `Fieldset` is not planned (ADR 0133). For checkboxes, write a native `fieldset` and `legend` with one Field per Checkbox. For one choice among a few, `RadioGroup` is planned and carries its own legend.
|
|
17
17
|
- A single line of text, a search, a colour or a choice from a list: use `TextField`, `SearchField`, `ColorField` or `MultiSelect`, which build on this Field.
|
|
18
18
|
|
|
19
19
|
## Rules
|
package/dist/docs/Menu.md
CHANGED
|
@@ -12,7 +12,7 @@ A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a
|
|
|
12
12
|
|
|
13
13
|
## When not to use
|
|
14
14
|
|
|
15
|
-
- Picking a value for a form field:
|
|
15
|
+
- Picking a value for a form field: a single `Select` and `RadioGroup` are planned; for several values from a long list, use `MultiSelect`.
|
|
16
16
|
- Navigation between pages: a menu that is only links is still navigation, so show the links on the page or in a nav. Link items are for a menu that mixes actions and links.
|
|
17
17
|
- One or two actions: show them as buttons.
|
|
18
18
|
- Content a user reads, or anything interactive inside the list (fields, toggles): use a popover or a dialog.
|
package/dist/docs/MultiSelect.md
CHANGED
|
@@ -12,10 +12,10 @@ A form field for picking any number of values from a list too long to show at on
|
|
|
12
12
|
## When not to use
|
|
13
13
|
|
|
14
14
|
- A few options, all visible on the page: use `ChipGroup multiple`.
|
|
15
|
-
- A short list shown inline, each with its own label: use a `Checkbox`
|
|
15
|
+
- A short list shown inline, each with its own label: use a group of `Checkbox`es, one `Field` each, in a native `fieldset` with a `legend`.
|
|
16
16
|
- Actions: use `Menu`; a multi-select picks values and runs nothing.
|
|
17
17
|
- One choice out of several: use a radio group or a single select.
|
|
18
|
-
- Search, filtering or async options: wait for Select and Combobox (
|
|
18
|
+
- Search, filtering or async options: wait for `Select` and `Combobox` (planned).
|
|
19
19
|
- Users who need to see every selected value at once: use `Chip` or `ChipGroup`, or show the selection beside the field.
|
|
20
20
|
|
|
21
21
|
## Rules
|
package/dist/docs/SearchField.md
CHANGED
|
@@ -12,7 +12,7 @@ A form field for a search query: an `<input type="search">` (role `searchbox`) w
|
|
|
12
12
|
## When not to use
|
|
13
13
|
|
|
14
14
|
- Any other single-line text: use `TextField`; a search field announces itself as a search.
|
|
15
|
-
- Picking from a known list as the user types: wait for Combobox (
|
|
15
|
+
- Picking from a known list as the user types: wait for `Combobox` (planned).
|
|
16
16
|
- Picking several values from a list: use `MultiSelect` or `ChipGroup`.
|
|
17
17
|
- A colour: use `ColorField`.
|
|
18
18
|
|
package/dist/docs/Stack.md
CHANGED
|
@@ -22,6 +22,7 @@ A vertical column of children with even space between them. `Stack` is a `Box` w
|
|
|
22
22
|
- Space comes from `gap`, never from margins on the children.
|
|
23
23
|
- It takes every `Box` prop, and the layout defaults are style props, so `display`, `flexDirection` and `alignItems` override them.
|
|
24
24
|
- Children are not wrapped, so each child is a flex item: it stretches to the column's width unless `alignItems` says otherwise.
|
|
25
|
+
- A list needs no `className` or stylesheet. `paddingInlineStart="0"` drops the `ul` indent, and a row that is a `Box as="li"` with a `display` other than `list-item` draws no marker.
|
|
25
26
|
- The consumer's `className` comes last and `style` is passed through; `ref` is a plain prop typed for the `as` element.
|
|
26
27
|
|
|
27
28
|
## Do
|
|
@@ -39,8 +40,33 @@ A vertical column of children with even space between them. `Stack` is a `Box` w
|
|
|
39
40
|
</Stack>
|
|
40
41
|
```
|
|
41
42
|
|
|
43
|
+
```tsx
|
|
44
|
+
// A styled list with no className: the rows are surfaces, and a flex `li` draws no marker.
|
|
45
|
+
<Stack as="ul" gap="8" paddingInlineStart="0" aria-label="Projects">
|
|
46
|
+
{projects.map((project) => (
|
|
47
|
+
<Box
|
|
48
|
+
as="li"
|
|
49
|
+
key={project.id}
|
|
50
|
+
display="flex"
|
|
51
|
+
padding="12"
|
|
52
|
+
backgroundColor="bgRaised"
|
|
53
|
+
borderRadius="med"
|
|
54
|
+
>
|
|
55
|
+
<Text>{project.name}</Text>
|
|
56
|
+
</Box>
|
|
57
|
+
))}
|
|
58
|
+
</Stack>
|
|
59
|
+
```
|
|
60
|
+
|
|
42
61
|
## Don't
|
|
43
62
|
|
|
63
|
+
```tsx
|
|
64
|
+
// A class and an app stylesheet for what style props cover.
|
|
65
|
+
<Stack as="ul" gap="8" className="project-list">
|
|
66
|
+
<li>…</li>
|
|
67
|
+
</Stack>
|
|
68
|
+
```
|
|
69
|
+
|
|
44
70
|
```tsx
|
|
45
71
|
// Margins on children instead of gap; and `gap` is required.
|
|
46
72
|
<Stack>
|
package/dist/docs/TextField.md
CHANGED
|
@@ -12,9 +12,9 @@ A form field for one line of text that is not a search: an `<input>` (role `text
|
|
|
12
12
|
## When not to use
|
|
13
13
|
|
|
14
14
|
- A query that searches or filters: use `SearchField`; it is announced as a search and has a clear button.
|
|
15
|
-
- Several lines of text: wait for
|
|
16
|
-
- A number with steppers or a range:
|
|
17
|
-
- Picking from a known list as the user types: wait for Combobox (planned
|
|
15
|
+
- Several lines of text: wait for `Textarea` (planned).
|
|
16
|
+
- A number with steppers or a range: a number field is not planned (ADR 0133); use `TextField` with `inputMode` in `inputProps` and validate in the app.
|
|
17
|
+
- Picking from a known list as the user types: wait for `Combobox` (planned).
|
|
18
18
|
- Picking one or several values from a list: use `MultiSelect` or `ChipGroup`.
|
|
19
19
|
- A colour: use `ColorField`; it pairs the hex with the browser's colour picker.
|
|
20
20
|
- A password: TextField has no `password` type, since a password field needs a show and hide toggle of its own.
|
package/dist/docs/llms.txt
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
> React design system. Each component's docs say when to use it, its rules and props.
|
|
4
4
|
|
|
5
|
+
## Rules for every screen
|
|
6
|
+
|
|
7
|
+
- Lay out with `Stack` (a column) and `Inline` (a row that wraps), spaced by their `gap`. Never rebuild them from a `Box` with `display`, `flexDirection` and `gap`.
|
|
8
|
+
- `Box` is for a surface (padding, background, radius, shadow) or a semantic element that needs style props.
|
|
9
|
+
- No `className`, `style` or app stylesheet for what a style prop or a component covers. Style props take token keys, so no raw colors or lengths either.
|
|
10
|
+
- A list is `Stack as="ul"` with `li` children. For one without markers or indent, add `paddingInlineStart="0"` and make each row a `Box as="li" display="flex"`, as Stack's docs show.
|
|
11
|
+
|
|
5
12
|
## Components
|
|
6
13
|
|
|
7
14
|
- [AlertDialog](AlertDialog.md): Asks the user to confirm a consequential action before it runs: delete a project, discard unsaved changes, sign out every device. Built on Base UI's AlertDialog, which owns the behavior: `role="alertdialog"`, focus moves into the dialog and stays there, the page behind is inert, Esc closes it, and a click outside does not. It wears Dialog's panel at the `sm` width with a title, a description, Cancel and one confirm button, and Cancel takes focus on open.
|
package/dist/docs/manifest.json
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { IconProps } from "../Icon/index.mjs";
|
|
2
|
-
|
|
3
|
-
export declare function ArrowLeftIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
4
|
-
//#endregion
|
|
2
|
+
export declare function ArrowLeftIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/index.mjs";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/icons/ArrowLeftIcon.tsx
|
|
4
4
|
function n(n) {
|
|
5
5
|
return /* @__PURE__ */ t(e, {
|
|
6
6
|
...n,
|
|
7
7
|
children: /* @__PURE__ */ t("path", { d: "m12 19-7-7 7-7M19 12H5" })
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { n as ArrowLeftIcon };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { IconProps } from "../Icon/index.mjs";
|
|
2
|
-
|
|
3
|
-
export declare function ArrowRightIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
4
|
-
//#endregion
|
|
2
|
+
export declare function ArrowRightIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/index.mjs";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/icons/ArrowRightIcon.tsx
|
|
4
4
|
function n(n) {
|
|
5
5
|
return /* @__PURE__ */ t(e, {
|
|
6
6
|
...n,
|
|
7
7
|
children: /* @__PURE__ */ t("path", { d: "M5 12h14M12 5l7 7-7 7" })
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { n as ArrowRightIcon };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { IconProps } from "../Icon/index.mjs";
|
|
2
|
-
|
|
3
|
-
export declare function CheckIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
4
|
-
//#endregion
|
|
2
|
+
export declare function CheckIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
package/dist/icons/CheckIcon.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/index.mjs";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/icons/CheckIcon.tsx
|
|
4
4
|
function n(n) {
|
|
5
5
|
return /* @__PURE__ */ t(e, {
|
|
6
6
|
...n,
|
|
7
7
|
children: /* @__PURE__ */ t("path", { d: "M20 6 9 17l-5-5" })
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { n as CheckIcon };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { IconProps } from "../Icon/index.mjs";
|
|
2
|
-
|
|
3
|
-
export declare function ChevronDownIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
4
|
-
//#endregion
|
|
2
|
+
export declare function ChevronDownIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/index.mjs";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/icons/ChevronDownIcon.tsx
|
|
4
4
|
function n(n) {
|
|
5
5
|
return /* @__PURE__ */ t(e, {
|
|
6
6
|
...n,
|
|
7
7
|
children: /* @__PURE__ */ t("path", { d: "m6 9 6 6 6-6" })
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { n as ChevronDownIcon };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { IconProps } from "../Icon/index.mjs";
|
|
2
|
-
|
|
3
|
-
export declare function ChevronRightIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
4
|
-
//#endregion
|
|
2
|
+
export declare function ChevronRightIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/index.mjs";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/icons/ChevronRightIcon.tsx
|
|
4
4
|
function n(n) {
|
|
5
5
|
return /* @__PURE__ */ t(e, {
|
|
6
6
|
...n,
|
|
7
7
|
children: /* @__PURE__ */ t("path", { d: "m9 18 6-6-6-6" })
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { n as ChevronRightIcon };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { IconProps } from "../Icon/index.mjs";
|
|
2
|
-
|
|
3
|
-
export declare function CircleAlertIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
4
|
-
//#endregion
|
|
2
|
+
export declare function CircleAlertIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/index.mjs";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/icons/CircleAlertIcon.tsx
|
|
4
4
|
function r(r) {
|
|
5
5
|
return /* @__PURE__ */ n(e, {
|
|
6
6
|
...r,
|
|
@@ -11,5 +11,4 @@ function r(r) {
|
|
|
11
11
|
}), /* @__PURE__ */ t("path", { d: "M12 8v4M12 16h.01" })]
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { r as CircleAlertIcon };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { IconProps } from "../Icon/index.mjs";
|
|
2
|
-
|
|
3
|
-
export declare function CircleCheckIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
4
|
-
//#endregion
|
|
2
|
+
export declare function CircleCheckIcon(props: Omit<IconProps, "children" | "viewBox">): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/index.mjs";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/icons/CircleCheckIcon.tsx
|
|
4
4
|
function r(r) {
|
|
5
5
|
return /* @__PURE__ */ n(e, {
|
|
6
6
|
...r,
|
|
@@ -11,5 +11,4 @@ function r(r) {
|
|
|
11
11
|
}), /* @__PURE__ */ t("path", { d: "m16 9-5.5 5.5L8 12" })]
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { r as CircleCheckIcon };
|