@anyknown/ui 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -7
- package/dist/brand.css +111 -124
- package/dist/components/badge/Badge.d.ts +11 -3
- package/dist/components/badge/Badge.js +21 -3
- 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/data-table/DataTable.d.ts +7 -1
- package/dist/components/data-table/DataTable.js +34 -34
- package/dist/components/dialog/Dialog.d.ts +6 -1
- package/dist/components/dialog/Dialog.js +11 -3
- 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/live-dot/LiveDot.d.ts +7 -0
- package/dist/components/live-dot/LiveDot.js +35 -0
- package/dist/components/message/Message.d.ts +3 -1
- package/dist/components/message/Message.js +2 -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/slider/Slider.d.ts +19 -0
- package/dist/components/slider/Slider.js +103 -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 +14 -0
- package/dist/index.js +14 -0
- package/dist/lib/layers.d.ts +7 -0
- package/dist/lib/layers.js +12 -0
- package/dist/themes.stylex.d.ts +54 -206
- package/dist/themes.stylex.js +55 -157
- package/dist/tokens.css +63 -46
- package/dist/tokens.stylex.d.ts +41 -54
- package/dist/tokens.stylex.js +64 -85
- package/package.json +2 -2
- 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,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
|
@@ -9,6 +9,7 @@ export { Checkbox, type CheckboxProps } from "./components/checkbox/Checkbox.js"
|
|
|
9
9
|
export { Radio, type RadioProps } from "./components/radio/Radio.js";
|
|
10
10
|
export { RadioGroup, type RadioGroupProps } from "./components/radio/RadioGroup.js";
|
|
11
11
|
export { Switch, type SwitchProps } from "./components/switch/Switch.js";
|
|
12
|
+
export { Slider, type SliderProps } from "./components/slider/Slider.js";
|
|
12
13
|
export { Select, SelectGroup, SelectItem, type SelectProps, type SelectGroupProps, type SelectItemProps, } from "./components/select/Select.js";
|
|
13
14
|
export { DropdownMenu, DropdownItem, DropdownCheckboxItem, DropdownGroup, DropdownSeparator, DropdownSub, type DropdownMenuProps, type DropdownItemProps, type DropdownCheckboxItemProps, type DropdownGroupProps, type DropdownSubProps, } from "./components/dropdown/DropdownMenu.js";
|
|
14
15
|
export { Dialog, DialogTrigger, DialogContent, DialogActions, DialogClose, ConfirmDialog, } from "./components/dialog/Dialog.js";
|
|
@@ -42,7 +43,9 @@ export type { HandoffReceiptProps, HandoffReason } from "./components/handoff-re
|
|
|
42
43
|
export { Composer } from "./components/composer/Composer.js";
|
|
43
44
|
export type { ComposerProps, SourceRef, SlashCommand } from "./components/composer/Composer.js";
|
|
44
45
|
export { VoiceIndicator, type VoiceIndicatorProps } from "./components/voice-indicator/VoiceIndicator.js";
|
|
46
|
+
export { LiveDot, type LiveDotProps } from "./components/live-dot/LiveDot.js";
|
|
45
47
|
export type { VoiceState } from "./lib/voice.js";
|
|
48
|
+
export { layerUp, type LayerName } from "./lib/layers.js";
|
|
46
49
|
export { PasswordInput, defaultScorer } from "./components/password-input/PasswordInput.js";
|
|
47
50
|
export type { PasswordInputProps } from "./components/password-input/PasswordInput.js";
|
|
48
51
|
export { RecoveryKey, type RecoveryKeyProps } from "./components/recovery-key/RecoveryKey.js";
|
|
@@ -55,3 +58,14 @@ export { DataTable } from "./components/data-table/DataTable.js";
|
|
|
55
58
|
export type { DataTableProps, DataTableColumn, SortState } from "./components/data-table/DataTable.js";
|
|
56
59
|
export { Markdown, type MarkdownProps, type MarkdownBlock } from "./components/markdown/Markdown.js";
|
|
57
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
|
@@ -9,6 +9,7 @@ export { Checkbox } from "./components/checkbox/Checkbox.js";
|
|
|
9
9
|
export { Radio } from "./components/radio/Radio.js";
|
|
10
10
|
export { RadioGroup } from "./components/radio/RadioGroup.js";
|
|
11
11
|
export { Switch } from "./components/switch/Switch.js";
|
|
12
|
+
export { Slider } from "./components/slider/Slider.js";
|
|
12
13
|
export { Select, SelectGroup, SelectItem, } from "./components/select/Select.js";
|
|
13
14
|
export { DropdownMenu, DropdownItem, DropdownCheckboxItem, DropdownGroup, DropdownSeparator, DropdownSub, } from "./components/dropdown/DropdownMenu.js";
|
|
14
15
|
export { Dialog, DialogTrigger, DialogContent, DialogActions, DialogClose, ConfirmDialog, } from "./components/dialog/Dialog.js";
|
|
@@ -30,6 +31,8 @@ export { PermissionCard, DecisionCard } from "./components/interaction-card/Inte
|
|
|
30
31
|
export { HandoffReceipt } from "./components/handoff-receipt/HandoffReceipt.js";
|
|
31
32
|
export { Composer } from "./components/composer/Composer.js";
|
|
32
33
|
export { VoiceIndicator } from "./components/voice-indicator/VoiceIndicator.js";
|
|
34
|
+
export { LiveDot } from "./components/live-dot/LiveDot.js";
|
|
35
|
+
export { layerUp } from "./lib/layers.js";
|
|
33
36
|
export { PasswordInput, defaultScorer } from "./components/password-input/PasswordInput.js";
|
|
34
37
|
export { RecoveryKey } from "./components/recovery-key/RecoveryKey.js";
|
|
35
38
|
export { Dropzone, UploadList } from "./components/dropzone/Dropzone.js";
|
|
@@ -38,3 +41,14 @@ export { DiffViewer } from "./components/diff-viewer/DiffViewer.js";
|
|
|
38
41
|
export { DataTable } from "./components/data-table/DataTable.js";
|
|
39
42
|
export { Markdown } from "./components/markdown/Markdown.js";
|
|
40
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";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** rail → main → 訊息 → fold → 列。數字越大越深,面與面靠深淺分,不靠邊框。 */
|
|
2
|
+
export type LayerName = "layer1" | "layer2" | "layer3" | "layer4" | "layer5";
|
|
3
|
+
/**
|
|
4
|
+
* hover 升一階:一塊面的 hover 底色就是下一階。
|
|
5
|
+
* layer5 已經是最深的一階,再深的那一階沒有名字,用 borderStrong。
|
|
6
|
+
*/
|
|
7
|
+
export declare const layerUp: Record<LayerName, string>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { color } from "../tokens.stylex.js";
|
|
2
|
+
/**
|
|
3
|
+
* hover 升一階:一塊面的 hover 底色就是下一階。
|
|
4
|
+
* layer5 已經是最深的一階,再深的那一階沒有名字,用 borderStrong。
|
|
5
|
+
*/
|
|
6
|
+
export const layerUp = {
|
|
7
|
+
layer1: color.layer2,
|
|
8
|
+
layer2: color.layer3,
|
|
9
|
+
layer3: color.layer4,
|
|
10
|
+
layer4: color.layer5,
|
|
11
|
+
layer5: color.borderStrong,
|
|
12
|
+
};
|
package/dist/themes.stylex.d.ts
CHANGED
|
@@ -24,64 +24,24 @@ export declare const lightColor: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
|
24
24
|
sheen: string;
|
|
25
25
|
successHl: string;
|
|
26
26
|
dangerHl: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
y1: string;
|
|
33
|
-
y2: string;
|
|
34
|
-
y3: string;
|
|
35
|
-
y4: string;
|
|
36
|
-
hi: string;
|
|
37
|
-
shadow: string;
|
|
38
|
-
}>, symbol>, symbol>;
|
|
39
|
-
export declare const lightYarnSecondary: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
40
|
-
un: string;
|
|
41
|
-
sh: string;
|
|
42
|
-
y0: string;
|
|
43
|
-
y1: string;
|
|
44
|
-
y2: string;
|
|
45
|
-
y3: string;
|
|
46
|
-
y4: string;
|
|
47
|
-
hi: string;
|
|
48
|
-
shadow: string;
|
|
49
|
-
}>, symbol>, symbol>;
|
|
50
|
-
export declare const lightYarnGhost: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
51
|
-
un: string;
|
|
52
|
-
sh: string;
|
|
53
|
-
y0: string;
|
|
54
|
-
y1: string;
|
|
55
|
-
y2: string;
|
|
56
|
-
y3: string;
|
|
57
|
-
y4: string;
|
|
58
|
-
hi: string;
|
|
59
|
-
shadow: string;
|
|
60
|
-
}>, symbol>, symbol>;
|
|
61
|
-
export declare const lightYarnDanger: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
62
|
-
un: string;
|
|
63
|
-
sh: string;
|
|
64
|
-
y0: string;
|
|
65
|
-
y1: string;
|
|
66
|
-
y2: string;
|
|
67
|
-
y3: string;
|
|
68
|
-
y4: string;
|
|
69
|
-
hi: string;
|
|
70
|
-
shadow: string;
|
|
71
|
-
}>, symbol>, symbol>;
|
|
72
|
-
export declare const lightYarnSubtle: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
73
|
-
un: string;
|
|
74
|
-
sh: string;
|
|
75
|
-
y0: string;
|
|
76
|
-
y1: string;
|
|
77
|
-
y2: string;
|
|
78
|
-
y3: string;
|
|
79
|
-
y4: string;
|
|
80
|
-
hi: string;
|
|
27
|
+
layer1: string;
|
|
28
|
+
layer2: string;
|
|
29
|
+
layer3: string;
|
|
30
|
+
layer4: string;
|
|
31
|
+
layer5: string;
|
|
81
32
|
}>, symbol>, symbol>;
|
|
82
33
|
export declare const lightShadow: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
83
34
|
popover: string;
|
|
84
35
|
raised: string;
|
|
36
|
+
pop: string;
|
|
37
|
+
sheet: string;
|
|
38
|
+
dock: string;
|
|
39
|
+
}>, symbol>, symbol>;
|
|
40
|
+
export declare const lightTone: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
41
|
+
layer6: string;
|
|
42
|
+
faint: string;
|
|
43
|
+
railLayer2: string;
|
|
44
|
+
railLayer3: string;
|
|
85
45
|
}>, symbol>, symbol>;
|
|
86
46
|
export declare const darkColor: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
87
47
|
bg: string;
|
|
@@ -108,64 +68,24 @@ export declare const darkColor: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
|
108
68
|
sheen: string;
|
|
109
69
|
successHl: string;
|
|
110
70
|
dangerHl: string;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
y1: string;
|
|
117
|
-
y2: string;
|
|
118
|
-
y3: string;
|
|
119
|
-
y4: string;
|
|
120
|
-
hi: string;
|
|
121
|
-
shadow: string;
|
|
122
|
-
}>, symbol>, symbol>;
|
|
123
|
-
export declare const darkYarnSecondary: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
124
|
-
un: string;
|
|
125
|
-
sh: string;
|
|
126
|
-
y0: string;
|
|
127
|
-
y1: string;
|
|
128
|
-
y2: string;
|
|
129
|
-
y3: string;
|
|
130
|
-
y4: string;
|
|
131
|
-
hi: string;
|
|
132
|
-
shadow: string;
|
|
133
|
-
}>, symbol>, symbol>;
|
|
134
|
-
export declare const darkYarnGhost: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
135
|
-
un: string;
|
|
136
|
-
sh: string;
|
|
137
|
-
y0: string;
|
|
138
|
-
y1: string;
|
|
139
|
-
y2: string;
|
|
140
|
-
y3: string;
|
|
141
|
-
y4: string;
|
|
142
|
-
hi: string;
|
|
143
|
-
shadow: string;
|
|
144
|
-
}>, symbol>, symbol>;
|
|
145
|
-
export declare const darkYarnDanger: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
146
|
-
un: string;
|
|
147
|
-
sh: string;
|
|
148
|
-
y0: string;
|
|
149
|
-
y1: string;
|
|
150
|
-
y2: string;
|
|
151
|
-
y3: string;
|
|
152
|
-
y4: string;
|
|
153
|
-
hi: string;
|
|
154
|
-
shadow: string;
|
|
155
|
-
}>, symbol>, symbol>;
|
|
156
|
-
export declare const darkYarnSubtle: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
157
|
-
un: string;
|
|
158
|
-
sh: string;
|
|
159
|
-
y0: string;
|
|
160
|
-
y1: string;
|
|
161
|
-
y2: string;
|
|
162
|
-
y3: string;
|
|
163
|
-
y4: string;
|
|
164
|
-
hi: string;
|
|
71
|
+
layer1: string;
|
|
72
|
+
layer2: string;
|
|
73
|
+
layer3: string;
|
|
74
|
+
layer4: string;
|
|
75
|
+
layer5: string;
|
|
165
76
|
}>, symbol>, symbol>;
|
|
166
77
|
export declare const darkShadow: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
167
78
|
popover: string;
|
|
168
79
|
raised: string;
|
|
80
|
+
pop: string;
|
|
81
|
+
sheet: string;
|
|
82
|
+
dock: string;
|
|
83
|
+
}>, symbol>, symbol>;
|
|
84
|
+
export declare const darkTone: stylex.Theme<stylex.VarGroup<Readonly<{
|
|
85
|
+
layer6: string;
|
|
86
|
+
faint: string;
|
|
87
|
+
railLayer2: string;
|
|
88
|
+
railLayer3: string;
|
|
169
89
|
}>, symbol>, symbol>;
|
|
170
90
|
/** 套在 root element 上:`<div {...stylex.props(...light)}>` */
|
|
171
91
|
export declare const light: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
|
|
@@ -193,58 +113,22 @@ export declare const light: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
|
|
|
193
113
|
sheen: string;
|
|
194
114
|
successHl: string;
|
|
195
115
|
dangerHl: string;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
y2: string;
|
|
202
|
-
y3: string;
|
|
203
|
-
y4: string;
|
|
204
|
-
hi: string;
|
|
205
|
-
shadow: string;
|
|
206
|
-
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
207
|
-
un: string;
|
|
208
|
-
sh: string;
|
|
209
|
-
y0: string;
|
|
210
|
-
y1: string;
|
|
211
|
-
y2: string;
|
|
212
|
-
y3: string;
|
|
213
|
-
y4: string;
|
|
214
|
-
hi: string;
|
|
215
|
-
shadow: string;
|
|
216
|
-
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
217
|
-
un: string;
|
|
218
|
-
sh: string;
|
|
219
|
-
y0: string;
|
|
220
|
-
y1: string;
|
|
221
|
-
y2: string;
|
|
222
|
-
y3: string;
|
|
223
|
-
y4: string;
|
|
224
|
-
hi: string;
|
|
225
|
-
shadow: string;
|
|
226
|
-
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
227
|
-
un: string;
|
|
228
|
-
sh: string;
|
|
229
|
-
y0: string;
|
|
230
|
-
y1: string;
|
|
231
|
-
y2: string;
|
|
232
|
-
y3: string;
|
|
233
|
-
y4: string;
|
|
234
|
-
hi: string;
|
|
235
|
-
shadow: string;
|
|
236
|
-
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
237
|
-
un: string;
|
|
238
|
-
sh: string;
|
|
239
|
-
y0: string;
|
|
240
|
-
y1: string;
|
|
241
|
-
y2: string;
|
|
242
|
-
y3: string;
|
|
243
|
-
y4: string;
|
|
244
|
-
hi: string;
|
|
116
|
+
layer1: string;
|
|
117
|
+
layer2: string;
|
|
118
|
+
layer3: string;
|
|
119
|
+
layer4: string;
|
|
120
|
+
layer5: string;
|
|
245
121
|
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
246
122
|
popover: string;
|
|
247
123
|
raised: string;
|
|
124
|
+
pop: string;
|
|
125
|
+
sheet: string;
|
|
126
|
+
dock: string;
|
|
127
|
+
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
128
|
+
layer6: string;
|
|
129
|
+
faint: string;
|
|
130
|
+
railLayer2: string;
|
|
131
|
+
railLayer3: string;
|
|
248
132
|
}>, symbol>, symbol>];
|
|
249
133
|
export declare const dark: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
|
|
250
134
|
bg: string;
|
|
@@ -271,56 +155,20 @@ export declare const dark: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
|
|
|
271
155
|
sheen: string;
|
|
272
156
|
successHl: string;
|
|
273
157
|
dangerHl: string;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
y2: string;
|
|
280
|
-
y3: string;
|
|
281
|
-
y4: string;
|
|
282
|
-
hi: string;
|
|
283
|
-
shadow: string;
|
|
284
|
-
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
285
|
-
un: string;
|
|
286
|
-
sh: string;
|
|
287
|
-
y0: string;
|
|
288
|
-
y1: string;
|
|
289
|
-
y2: string;
|
|
290
|
-
y3: string;
|
|
291
|
-
y4: string;
|
|
292
|
-
hi: string;
|
|
293
|
-
shadow: string;
|
|
294
|
-
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
295
|
-
un: string;
|
|
296
|
-
sh: string;
|
|
297
|
-
y0: string;
|
|
298
|
-
y1: string;
|
|
299
|
-
y2: string;
|
|
300
|
-
y3: string;
|
|
301
|
-
y4: string;
|
|
302
|
-
hi: string;
|
|
303
|
-
shadow: string;
|
|
304
|
-
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
305
|
-
un: string;
|
|
306
|
-
sh: string;
|
|
307
|
-
y0: string;
|
|
308
|
-
y1: string;
|
|
309
|
-
y2: string;
|
|
310
|
-
y3: string;
|
|
311
|
-
y4: string;
|
|
312
|
-
hi: string;
|
|
313
|
-
shadow: string;
|
|
314
|
-
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
315
|
-
un: string;
|
|
316
|
-
sh: string;
|
|
317
|
-
y0: string;
|
|
318
|
-
y1: string;
|
|
319
|
-
y2: string;
|
|
320
|
-
y3: string;
|
|
321
|
-
y4: string;
|
|
322
|
-
hi: string;
|
|
158
|
+
layer1: string;
|
|
159
|
+
layer2: string;
|
|
160
|
+
layer3: string;
|
|
161
|
+
layer4: string;
|
|
162
|
+
layer5: string;
|
|
323
163
|
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
324
164
|
popover: string;
|
|
325
165
|
raised: string;
|
|
166
|
+
pop: string;
|
|
167
|
+
sheet: string;
|
|
168
|
+
dock: string;
|
|
169
|
+
}>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
|
|
170
|
+
layer6: string;
|
|
171
|
+
faint: string;
|
|
172
|
+
railLayer2: string;
|
|
173
|
+
railLayer3: string;
|
|
326
174
|
}>, symbol>, symbol>];
|