@anyknown/ui 0.7.0 → 0.8.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 +7 -8
- package/dist/brand.css +101 -214
- package/dist/components/button/Button.d.ts +3 -2
- package/dist/components/button/Button.js +32 -48
- package/dist/components/checkbox/Checkbox.js +24 -48
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/empty-state/EmptyState.js +1 -1
- package/dist/components/ghost/Ghost.d.ts +16 -0
- package/dist/components/ghost/Ghost.js +50 -0
- package/dist/components/group/Group.d.ts +66 -0
- package/dist/components/group/Group.js +166 -0
- package/dist/components/handoff-receipt/HandoffReceipt.js +12 -42
- package/dist/components/icon/Chevron.d.ts +9 -0
- package/dist/components/icon/Chevron.js +6 -0
- package/dist/components/icon/icon.d.ts +35 -0
- package/dist/components/icon/icon.js +10 -0
- package/dist/components/icon-button/IconButton.d.ts +17 -0
- package/dist/components/icon-button/IconButton.js +66 -0
- package/dist/components/input/Input.d.ts +3 -1
- package/dist/components/input/Input.js +3 -2
- package/dist/components/page/Page.d.ts +64 -0
- package/dist/components/page/Page.js +163 -0
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/progress/Progress.js +49 -104
- package/dist/components/radio/Radio.js +17 -28
- package/dist/components/segmented/Segmented.d.ts +12 -0
- package/dist/components/segmented/Segmented.js +43 -0
- package/dist/components/settings-rows/SettingsRows.d.ts +25 -0
- package/dist/components/settings-rows/SettingsRows.js +63 -0
- package/dist/components/spin/Spin.d.ts +5 -0
- package/dist/components/spin/Spin.js +25 -0
- package/dist/components/status-chip/StatusChip.d.ts +18 -0
- package/dist/components/status-chip/StatusChip.js +68 -0
- package/dist/components/switch/Switch.js +20 -63
- package/dist/components/table/Table.d.ts +39 -0
- package/dist/components/table/Table.js +125 -0
- package/dist/components/table/TableCells.d.ts +52 -0
- package/dist/components/table/TableCells.js +103 -0
- package/dist/components/tabs/Tabs.js +16 -48
- package/dist/components/text/Text.js +2 -2
- package/dist/components/toast/Toast.js +7 -8
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/themes.stylex.d.ts +33 -496
- package/dist/themes.stylex.js +25 -253
- package/dist/tokens.css +53 -126
- package/dist/tokens.stylex.d.ts +36 -54
- package/dist/tokens.stylex.js +62 -90
- package/package.json +1 -1
- package/dist/lib/paths.d.ts +0 -3
- package/dist/lib/paths.js +0 -11
- package/dist/lib/progress.d.ts +0 -2
- package/dist/lib/progress.js +0 -28
- package/dist/lib/silk.d.ts +0 -66
- package/dist/lib/silk.js +0 -337
- package/dist/lib/svgId.d.ts +0 -1
- package/dist/lib/svgId.js +0 -4
- package/dist/lib/weave.d.ts +0 -28
- package/dist/lib/weave.js +0 -83
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as stylex from "@stylexjs/stylex";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
type Sx = {
|
|
4
|
+
sx?: stylex.StyleXStyles;
|
|
5
|
+
};
|
|
6
|
+
export type CellProps = {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
mono?: boolean;
|
|
9
|
+
num?: boolean;
|
|
10
|
+
faint?: boolean;
|
|
11
|
+
/** Where the cell lands once the row wraps on a phone. */
|
|
12
|
+
order?: number;
|
|
13
|
+
/** On a phone the cell opens with `· `, the way the prototype joins the second line. */
|
|
14
|
+
prefixed?: boolean;
|
|
15
|
+
/** On a phone the cell goes to the end of its line. */
|
|
16
|
+
pushed?: boolean;
|
|
17
|
+
grow?: boolean;
|
|
18
|
+
/** Not drawn on a phone. */
|
|
19
|
+
hidden?: boolean;
|
|
20
|
+
} & Sx;
|
|
21
|
+
export declare function Cell({ children, mono, num, faint, order, prefixed, pushed, grow, hidden, sx }: CellProps): import("react").JSX.Element;
|
|
22
|
+
export type StatusCellProps = {
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
warn?: boolean;
|
|
25
|
+
order?: number;
|
|
26
|
+
pushed?: boolean;
|
|
27
|
+
} & Sx;
|
|
28
|
+
/** The state column: nothing when fine, a warning dot and a mono code when not. */
|
|
29
|
+
export declare function StatusCell({ children, warn, order, pushed, sx }: StatusCellProps): import("react").JSX.Element;
|
|
30
|
+
/** The line break a phone row wraps at; nothing on a desk. */
|
|
31
|
+
export declare function Break({ order }: {
|
|
32
|
+
order?: number;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
export type ToggleProps = {
|
|
35
|
+
open: boolean;
|
|
36
|
+
onPress: () => void;
|
|
37
|
+
label: string;
|
|
38
|
+
controls?: string;
|
|
39
|
+
order?: number;
|
|
40
|
+
} & Sx;
|
|
41
|
+
/** `.rowtog`: the chevron at the end of a row that has a detail under it. */
|
|
42
|
+
export declare function Toggle({ open, onPress, label, controls, order, sx }: ToggleProps): import("react").JSX.Element;
|
|
43
|
+
export type SubjectProps = {
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
onPress: () => void;
|
|
46
|
+
title?: string;
|
|
47
|
+
order?: number;
|
|
48
|
+
grow?: boolean;
|
|
49
|
+
} & Sx;
|
|
50
|
+
/** `.subj`: a mono identifier that is also the way to filter by it. */
|
|
51
|
+
export declare function Subject({ children, onPress, title, order, grow, sx }: SubjectProps): import("react").JSX.Element;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as stylex from "@stylexjs/stylex";
|
|
3
|
+
import { color, corner, font, ink, motion, space, tone, type } from "../../tokens.stylex.js";
|
|
4
|
+
import { Chevron } from "../icon/Chevron.js";
|
|
5
|
+
import { icon } from "../icon/icon.js";
|
|
6
|
+
/** The cells a `Tr` is made of; each says where it lands once the row wraps on a phone. */
|
|
7
|
+
const PHONE = "@media (max-width: 45rem)";
|
|
8
|
+
const REDUCED = "@media (prefers-reduced-motion: reduce)";
|
|
9
|
+
const styles = stylex.create({
|
|
10
|
+
cell: { minWidth: 0 },
|
|
11
|
+
mono: {
|
|
12
|
+
fontFamily: font.mono,
|
|
13
|
+
fontSize: type.t2,
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
textOverflow: "ellipsis",
|
|
16
|
+
whiteSpace: "nowrap",
|
|
17
|
+
},
|
|
18
|
+
num: {
|
|
19
|
+
fontFamily: font.mono,
|
|
20
|
+
textAlign: { default: "end", [PHONE]: "start" },
|
|
21
|
+
whiteSpace: "nowrap",
|
|
22
|
+
},
|
|
23
|
+
faint: { color: color.textMuted, fontFamily: font.mono, fontSize: type.t1, whiteSpace: "nowrap" },
|
|
24
|
+
status: {
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
color: color.textMuted,
|
|
27
|
+
display: "inline-flex",
|
|
28
|
+
fontFamily: font.mono,
|
|
29
|
+
gap: space.xs,
|
|
30
|
+
},
|
|
31
|
+
warn: { color: color.warning },
|
|
32
|
+
dot: { backgroundColor: color.warning, borderRadius: "50%", flex: "none", height: 6, width: 6 },
|
|
33
|
+
order: (order) => ({ order: { default: 0, [PHONE]: order } }),
|
|
34
|
+
prefixed: { "::before": { content: { default: "none", [PHONE]: '"· "' } } },
|
|
35
|
+
pushed: { marginInlineStart: { default: 0, [PHONE]: "auto" } },
|
|
36
|
+
grow: { flex: { default: "none", [PHONE]: "1 1 auto" } },
|
|
37
|
+
brk: { display: { default: "none", [PHONE]: "block" }, flex: "0 0 100%", height: 0 },
|
|
38
|
+
hidden: { display: { default: "block", [PHONE]: "none" } },
|
|
39
|
+
toggle: {
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
backgroundColor: { default: "transparent", ":hover": ink.n8 },
|
|
42
|
+
borderRadius: corner.xs,
|
|
43
|
+
borderStyle: "none",
|
|
44
|
+
borderWidth: 0,
|
|
45
|
+
color: { default: tone.faint, ":hover": color.text },
|
|
46
|
+
cursor: "pointer",
|
|
47
|
+
display: "inline-grid",
|
|
48
|
+
height: 24,
|
|
49
|
+
justifySelf: "end",
|
|
50
|
+
margin: 0,
|
|
51
|
+
outline: { default: "none", ":focus-visible": `2px solid ${color.accent}` },
|
|
52
|
+
padding: 0,
|
|
53
|
+
placeItems: "center",
|
|
54
|
+
width: 24,
|
|
55
|
+
},
|
|
56
|
+
toggleIcon: {
|
|
57
|
+
transitionDuration: { default: motion.normal, [REDUCED]: "0s" },
|
|
58
|
+
transitionProperty: "rotate",
|
|
59
|
+
transitionTimingFunction: motion.easeOut,
|
|
60
|
+
},
|
|
61
|
+
turned: { rotate: "180deg" },
|
|
62
|
+
subject: {
|
|
63
|
+
backgroundColor: { default: "transparent", ":hover": color.layer3 },
|
|
64
|
+
borderRadius: corner.xs,
|
|
65
|
+
borderStyle: "none",
|
|
66
|
+
borderWidth: 0,
|
|
67
|
+
color: color.text,
|
|
68
|
+
cursor: "pointer",
|
|
69
|
+
fontFamily: font.mono,
|
|
70
|
+
fontSize: type.t2,
|
|
71
|
+
justifySelf: "start",
|
|
72
|
+
lineHeight: "inherit",
|
|
73
|
+
margin: 0,
|
|
74
|
+
marginInlineStart: -4,
|
|
75
|
+
maxWidth: "100%",
|
|
76
|
+
outline: { default: "none", ":focus-visible": `2px solid ${color.accent}` },
|
|
77
|
+
overflow: "hidden",
|
|
78
|
+
paddingBlock: 0,
|
|
79
|
+
paddingInline: 4,
|
|
80
|
+
textAlign: "start",
|
|
81
|
+
textOverflow: "ellipsis",
|
|
82
|
+
whiteSpace: "nowrap",
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
export function Cell({ children, mono, num, faint, order, prefixed, pushed, grow, hidden, sx }) {
|
|
86
|
+
return (_jsx("span", { ...stylex.props(styles.cell, mono === true && styles.mono, num === true && styles.num, faint === true && styles.faint, order !== undefined && styles.order(order), prefixed === true && styles.prefixed, pushed === true && styles.pushed, grow === true && styles.grow, hidden === true && styles.hidden, sx), children: children }));
|
|
87
|
+
}
|
|
88
|
+
/** The state column: nothing when fine, a warning dot and a mono code when not. */
|
|
89
|
+
export function StatusCell({ children, warn = false, order, pushed, sx }) {
|
|
90
|
+
return (_jsxs("span", { ...stylex.props(styles.status, warn && styles.warn, order !== undefined && styles.order(order), pushed === true && styles.pushed, sx), children: [warn && _jsx("span", { ...stylex.props(styles.dot), "aria-hidden": "true" }), children] }));
|
|
91
|
+
}
|
|
92
|
+
/** The line break a phone row wraps at; nothing on a desk. */
|
|
93
|
+
export function Break({ order }) {
|
|
94
|
+
return _jsx("span", { "aria-hidden": "true", ...stylex.props(styles.brk, order !== undefined && styles.order(order)) });
|
|
95
|
+
}
|
|
96
|
+
/** `.rowtog`: the chevron at the end of a row that has a detail under it. */
|
|
97
|
+
export function Toggle({ open, onPress, label, controls, order, sx }) {
|
|
98
|
+
return (_jsx("button", { type: "button", "aria-expanded": open, "aria-label": label, ...(controls ? { "aria-controls": controls } : {}), onClick: onPress, ...stylex.props(styles.toggle, order !== undefined && styles.order(order), sx), children: _jsx(Chevron, { direction: "down", ...stylex.props(icon.sm, styles.toggleIcon, open && styles.turned), "aria-hidden": "true" }) }));
|
|
99
|
+
}
|
|
100
|
+
/** `.subj`: a mono identifier that is also the way to filter by it. */
|
|
101
|
+
export function Subject({ children, onPress, title, order, grow, sx }) {
|
|
102
|
+
return (_jsx("button", { type: "button", onClick: onPress, ...(title ? { title } : {}), ...stylex.props(styles.subject, order !== undefined && styles.order(order), grow === true && styles.grow, sx), children: children }));
|
|
103
|
+
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Tabs as BaseTabs } from "@base-ui/react/tabs";
|
|
3
3
|
import * as stylex from "@stylexjs/stylex";
|
|
4
|
-
import { createContext,
|
|
4
|
+
import { createContext, useContext } from "react";
|
|
5
5
|
import { styled } from "../../lib/styled.js";
|
|
6
|
-
import {
|
|
7
|
-
import { buildWeave, weaveRand } from "../../lib/weave.js";
|
|
8
|
-
import { color, font, motion, radius, space, text, yarnSubtle } from "../../tokens.stylex.js";
|
|
6
|
+
import { color, font, ink, motion, radius, space, text } from "../../tokens.stylex.js";
|
|
9
7
|
const REDUCED = "@media (prefers-reduced-motion: reduce)";
|
|
10
8
|
const VariantContext = createContext("underline");
|
|
11
9
|
const styles = stylex.create({
|
|
@@ -29,7 +27,7 @@ const styles = stylex.create({
|
|
|
29
27
|
gap: "0.15rem",
|
|
30
28
|
},
|
|
31
29
|
tab: {
|
|
32
|
-
backgroundColor: "transparent",
|
|
30
|
+
backgroundColor: { default: "transparent", ":hover": ink.n6 },
|
|
33
31
|
borderWidth: 0,
|
|
34
32
|
fontFamily: font.body,
|
|
35
33
|
fontSize: text.sm,
|
|
@@ -47,7 +45,7 @@ const styles = stylex.create({
|
|
|
47
45
|
},
|
|
48
46
|
tabDisabled: { opacity: 0.4, cursor: "not-allowed", color: color.textFaint },
|
|
49
47
|
tabSelectedUnderline: { color: color.accent },
|
|
50
|
-
tabSelectedPills: { color: color.
|
|
48
|
+
tabSelectedPills: { color: color.text, backgroundColor: "transparent" },
|
|
51
49
|
pillTab: { zIndex: 1 },
|
|
52
50
|
indicator: {
|
|
53
51
|
position: "absolute",
|
|
@@ -61,30 +59,22 @@ const styles = stylex.create({
|
|
|
61
59
|
transitionDuration: { default: "240ms", [REDUCED]: "0s" },
|
|
62
60
|
transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
63
61
|
},
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
pillWindow: {
|
|
70
|
-
x: "var(--active-tab-left)",
|
|
71
|
-
y: "var(--active-tab-top)",
|
|
62
|
+
// Indicator 本來就把 --active-tab-* 寫成 inline style,pills 直接拿它當滑動的藥丸。
|
|
63
|
+
pillIndicator: {
|
|
64
|
+
position: "absolute",
|
|
65
|
+
insetBlockStart: 0,
|
|
66
|
+
insetInlineStart: 0,
|
|
72
67
|
width: "var(--active-tab-width)",
|
|
73
68
|
height: "var(--active-tab-height)",
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
translate: "var(--active-tab-left) var(--active-tab-top)",
|
|
70
|
+
borderRadius: radius.sm,
|
|
71
|
+
backgroundColor: color.surfaceRaised,
|
|
72
|
+
boxShadow: `inset 0 0 0 1px ${color.border}`,
|
|
73
|
+
pointerEvents: "none",
|
|
74
|
+
transitionProperty: "translate, width",
|
|
76
75
|
transitionDuration: { default: "240ms", [REDUCED]: "0s" },
|
|
77
76
|
transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
78
77
|
},
|
|
79
|
-
cloth: { fill: "none", strokeLinecap: "round" },
|
|
80
|
-
un: { stroke: yarnSubtle.un },
|
|
81
|
-
sh: { stroke: yarnSubtle.sh, opacity: 0.5 },
|
|
82
|
-
y0: { stroke: yarnSubtle.y0 },
|
|
83
|
-
y1: { stroke: yarnSubtle.y1 },
|
|
84
|
-
y2: { stroke: yarnSubtle.y2 },
|
|
85
|
-
y3: { stroke: yarnSubtle.y3 },
|
|
86
|
-
y4: { stroke: yarnSubtle.y4 },
|
|
87
|
-
hi: { stroke: yarnSubtle.hi, opacity: 0.45 },
|
|
88
78
|
panel: {
|
|
89
79
|
fontFamily: font.body,
|
|
90
80
|
fontSize: text.sm,
|
|
@@ -98,31 +88,9 @@ const styles = stylex.create({
|
|
|
98
88
|
export function Tabs({ variant = "underline", children, ...props }) {
|
|
99
89
|
return (_jsx(VariantContext, { value: variant, children: _jsx(BaseTabs.Root, { ...props, ...styled(props, styles.root), children: children }) }));
|
|
100
90
|
}
|
|
101
|
-
const BUCKETS = [styles.y0, styles.y1, styles.y2, styles.y3, styles.y4];
|
|
102
|
-
function PillCloth({ w, h }) {
|
|
103
|
-
const clipId = useSvgId("ak-pill");
|
|
104
|
-
const cloth = useMemo(() => buildWeave({ w, h }, weaveRand()), [w, h]);
|
|
105
|
-
return (_jsxs("svg", { viewBox: `0 0 ${w} ${h}`, "aria-hidden": "true", ...stylex.props(styles.pillSvg), children: [_jsx("defs", { children: _jsx("clipPath", { id: clipId, children: _jsx("rect", { ...stylex.props(styles.pillWindow) }) }) }), _jsxs("g", { clipPath: `url(#${clipId})`, ...stylex.props(styles.cloth), children: [_jsx("g", { ...stylex.props(styles.un), children: cloth.under.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw }, i))) }), _jsx("g", { ...stylex.props(styles.sh), children: cloth.seams.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw }, i))) }), cloth.face.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw, ...stylex.props(BUCKETS[t.bucket]) }, i))), _jsx("g", { ...stylex.props(styles.hi), children: cloth.hi.map((t, i) => (_jsx("path", { d: t.d, strokeWidth: t.sw }, i))) })] })] }));
|
|
106
|
-
}
|
|
107
91
|
export function TabsList({ children, ...rest }) {
|
|
108
92
|
const variant = useContext(VariantContext);
|
|
109
|
-
|
|
110
|
-
// 要織滿 tablist 就得先量它:ref callback + ResizeObserver(不用 effect,SSR 上零副作用)。
|
|
111
|
-
// 同尺寸 early return,resize 才重織。
|
|
112
|
-
const measure = useCallback((node) => {
|
|
113
|
-
if (!node)
|
|
114
|
-
return;
|
|
115
|
-
const read = () => setSize((current) => {
|
|
116
|
-
const w = node.clientWidth;
|
|
117
|
-
const h = node.clientHeight;
|
|
118
|
-
return current != null && current.w === w && current.h === h ? current : { w, h };
|
|
119
|
-
});
|
|
120
|
-
read();
|
|
121
|
-
const ro = new ResizeObserver(read);
|
|
122
|
-
ro.observe(node);
|
|
123
|
-
return () => ro.disconnect();
|
|
124
|
-
}, []);
|
|
125
|
-
return (_jsxs(BaseTabs.List, { ...rest, ref: variant === "pills" ? measure : undefined, ...styled(rest, styles.list, variant === "underline" ? styles.underlineList : styles.pillsList), children: [children, variant === "underline" && _jsx(BaseTabs.Indicator, { ...stylex.props(styles.indicator) }), variant === "pills" && size != null && size.w > 0 && (_jsx(BaseTabs.Indicator, { ...stylex.props(styles.pillLayer), children: _jsx(PillCloth, { w: size.w, h: size.h }) }))] }));
|
|
93
|
+
return (_jsxs(BaseTabs.List, { ...rest, ...styled(rest, styles.list, variant === "underline" ? styles.underlineList : styles.pillsList), children: [children, _jsx(BaseTabs.Indicator, { ...stylex.props(variant === "underline" ? styles.indicator : styles.pillIndicator) })] }));
|
|
126
94
|
}
|
|
127
95
|
export function TabsTab({ children, ...rest }) {
|
|
128
96
|
const variant = useContext(VariantContext);
|
|
@@ -12,14 +12,14 @@ const styles = stylex.create({
|
|
|
12
12
|
display: {
|
|
13
13
|
fontFamily: font.display,
|
|
14
14
|
fontSize: text.display,
|
|
15
|
-
fontWeight:
|
|
15
|
+
fontWeight: 600,
|
|
16
16
|
lineHeight: text.leadingTight,
|
|
17
17
|
letterSpacing: "-0.01em",
|
|
18
18
|
},
|
|
19
19
|
title: {
|
|
20
20
|
fontFamily: font.display,
|
|
21
21
|
fontSize: text.xl,
|
|
22
|
-
fontWeight:
|
|
22
|
+
fontWeight: 600,
|
|
23
23
|
lineHeight: text.leadingTight,
|
|
24
24
|
},
|
|
25
25
|
body: { fontSize: text.base },
|
|
@@ -4,16 +4,15 @@ import * as stylex from "@stylexjs/stylex";
|
|
|
4
4
|
import { createContext, useContext, useState } from "react";
|
|
5
5
|
import { reset } from "../../lib/styled.js";
|
|
6
6
|
import { usePrefersReducedMotion } from "../../lib/motion.js";
|
|
7
|
-
import { UNWEAVE_PATH } from "../../lib/paths.js";
|
|
8
7
|
import { layerStyles } from "../../lib/popup.js";
|
|
9
|
-
import { color, font, motion, radius, shadow, space, text } from "../../tokens.stylex.js";
|
|
8
|
+
import { color, corner, font, motion, radius, shadow, space, text } from "../../tokens.stylex.js";
|
|
10
9
|
const REDUCED = "@media (prefers-reduced-motion: reduce)";
|
|
11
10
|
const DEFAULT_TIMEOUT = 5000;
|
|
12
11
|
const slideIn = stylex.keyframes({
|
|
13
12
|
from: { opacity: 0, translate: "1rem 0" },
|
|
14
13
|
to: { opacity: 1, translate: "0 0" },
|
|
15
14
|
});
|
|
16
|
-
const
|
|
15
|
+
const drain = stylex.keyframes({
|
|
17
16
|
from: { strokeDashoffset: 0 },
|
|
18
17
|
to: { strokeDashoffset: -100 },
|
|
19
18
|
});
|
|
@@ -36,12 +35,12 @@ const styles = stylex.create({
|
|
|
36
35
|
display: "flex",
|
|
37
36
|
alignItems: "center",
|
|
38
37
|
gap: space.xs,
|
|
39
|
-
backgroundColor: color.
|
|
38
|
+
backgroundColor: color.surfaceRaised,
|
|
40
39
|
borderWidth: 1,
|
|
41
40
|
borderStyle: "solid",
|
|
42
41
|
borderColor: color.border,
|
|
43
|
-
borderRadius:
|
|
44
|
-
boxShadow: shadow.
|
|
42
|
+
borderRadius: corner.md,
|
|
43
|
+
boxShadow: shadow.pop,
|
|
45
44
|
paddingBlock: space.xs,
|
|
46
45
|
paddingInline: space.xs,
|
|
47
46
|
fontFamily: font.body,
|
|
@@ -58,7 +57,7 @@ const styles = stylex.create({
|
|
|
58
57
|
strokeWidth: 1.5,
|
|
59
58
|
strokeLinecap: "round",
|
|
60
59
|
strokeDasharray: 100,
|
|
61
|
-
animationName:
|
|
60
|
+
animationName: drain,
|
|
62
61
|
animationTimingFunction: "linear",
|
|
63
62
|
animationFillMode: "forwards",
|
|
64
63
|
},
|
|
@@ -171,5 +170,5 @@ function ToastItem({ toast: item, fallbackTimeout, paused }) {
|
|
|
171
170
|
const reduced = usePrefersReducedMotion();
|
|
172
171
|
const tone = TONE[item.type in TONE ? item.type : "default"];
|
|
173
172
|
const duration = item.timeout ?? fallbackTimeout;
|
|
174
|
-
return (_jsxs(BaseToast.Root, { toast: item, ...stylex.props(styles.toast), children: [!reduced && duration > 0 && (_jsx("svg", { viewBox: "0 0 320 6", preserveAspectRatio: "none", "aria-hidden": "true", ...stylex.props(styles.countdown), children: _jsx("path", { d:
|
|
173
|
+
return (_jsxs(BaseToast.Root, { toast: item, ...stylex.props(styles.toast), children: [!reduced && duration > 0 && (_jsx("svg", { viewBox: "0 0 320 6", preserveAspectRatio: "none", "aria-hidden": "true", ...stylex.props(styles.countdown), children: _jsx("path", { d: "M0 3H320", pathLength: "100", ...stylex.props(styles.countLine, tone.line, styles.running(duration, paused)) }) })), _jsx("span", { "aria-hidden": "true", ...stylex.props(styles.dot, tone.dot) }), _jsxs(BaseToast.Content, { ...stylex.props(styles.content), children: [tone.word !== "" && _jsx("span", { ...stylex.props(styles.srOnly), children: tone.word }), _jsx(BaseToast.Title, { ...stylex.props(styles.title) }), item.description != null && _jsx(BaseToast.Description, { ...stylex.props(styles.description) })] }), item.actionProps != null && _jsx(BaseToast.Action, { ...stylex.props(reset.control, styles.action) })] }));
|
|
175
174
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -58,3 +58,14 @@ export { DataTable } from "./components/data-table/DataTable.js";
|
|
|
58
58
|
export type { DataTableProps, DataTableColumn, SortState } from "./components/data-table/DataTable.js";
|
|
59
59
|
export { Markdown, type MarkdownProps, type MarkdownBlock } from "./components/markdown/Markdown.js";
|
|
60
60
|
export { Formula, type FormulaProps } from "./components/markdown/Formula.js";
|
|
61
|
+
export { Ghost, GhostLink, type GhostProps, type GhostLinkProps } from "./components/ghost/Ghost.js";
|
|
62
|
+
export { IconButton, type IconButtonProps } from "./components/icon-button/IconButton.js";
|
|
63
|
+
export { ICON_STROKE, icon } from "./components/icon/icon.js";
|
|
64
|
+
export { Segmented, type SegmentedProps } from "./components/segmented/Segmented.js";
|
|
65
|
+
export { Spin } from "./components/spin/Spin.js";
|
|
66
|
+
export { Pill, StatusChip, type PillProps, type StatusChipProps } from "./components/status-chip/StatusChip.js";
|
|
67
|
+
export { Acts, Empty, Expand, Group, Item, Mark, Note, Row, Sep, Status, Tag, type ExpandProps, type MarkProps, type RowProps, type StatusProps, } from "./components/group/Group.js";
|
|
68
|
+
export { B, Bars, Faint, FootNote, Hint, PageHead, Panel, SectionLabel, Snippet, StatBar, StatLine, Sub, type BarsProps, type PageHeadProps, type SectionLabelProps, } from "./components/page/Page.js";
|
|
69
|
+
export { Dot, Help, SettingsRow, SettingsRows, Value, type SettingsRowProps, } from "./components/settings-rows/SettingsRows.js";
|
|
70
|
+
export { Detail, Head, ListScroll, MoreRow, Table, Tr, type TableProps } from "./components/table/Table.js";
|
|
71
|
+
export { Break, Cell, StatusCell, Subject, Toggle, type CellProps } from "./components/table/TableCells.js";
|
package/dist/index.js
CHANGED
|
@@ -41,3 +41,14 @@ export { DiffViewer } from "./components/diff-viewer/DiffViewer.js";
|
|
|
41
41
|
export { DataTable } from "./components/data-table/DataTable.js";
|
|
42
42
|
export { Markdown } from "./components/markdown/Markdown.js";
|
|
43
43
|
export { Formula } from "./components/markdown/Formula.js";
|
|
44
|
+
export { Ghost, GhostLink } from "./components/ghost/Ghost.js";
|
|
45
|
+
export { IconButton } from "./components/icon-button/IconButton.js";
|
|
46
|
+
export { ICON_STROKE, icon } from "./components/icon/icon.js";
|
|
47
|
+
export { Segmented } from "./components/segmented/Segmented.js";
|
|
48
|
+
export { Spin } from "./components/spin/Spin.js";
|
|
49
|
+
export { Pill, StatusChip } from "./components/status-chip/StatusChip.js";
|
|
50
|
+
export { Acts, Empty, Expand, Group, Item, Mark, Note, Row, Sep, Status, Tag, } from "./components/group/Group.js";
|
|
51
|
+
export { B, Bars, Faint, FootNote, Hint, PageHead, Panel, SectionLabel, Snippet, StatBar, StatLine, Sub, } from "./components/page/Page.js";
|
|
52
|
+
export { Dot, Help, SettingsRow, SettingsRows, Value, } from "./components/settings-rows/SettingsRows.js";
|
|
53
|
+
export { Detail, Head, ListScroll, MoreRow, Table, Tr } from "./components/table/Table.js";
|
|
54
|
+
export { Break, Cell, StatusCell, Subject, Toggle } from "./components/table/TableCells.js";
|