@anyknown/ui 0.6.0 → 0.7.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.
@@ -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 { useId, useRef, useState } from "react";
4
+ import { color, font, motion, radius, shadow, space, text } from "../../tokens.stylex.js";
5
+ const REDUCED = "@media (prefers-reduced-motion: reduce)";
6
+ const ARROW_FRACTION = 0.05;
7
+ const styles = stylex.create({
8
+ root: { display: "flex", flexDirection: "column", gap: space.xs, fontFamily: font.body },
9
+ label: { fontSize: text.sm, fontWeight: 500, color: color.text },
10
+ control: {
11
+ position: "relative",
12
+ height: "1.5rem",
13
+ borderRadius: radius.full,
14
+ backgroundColor: color.layer4,
15
+ cursor: "pointer",
16
+ touchAction: "none",
17
+ outline: { default: "none", ":focus-visible": `2px solid ${color.focusRing}` },
18
+ outlineOffset: 2,
19
+ },
20
+ disabled: { cursor: "not-allowed", opacity: 0.5 },
21
+ fill: {
22
+ position: "absolute",
23
+ insetInlineStart: 0,
24
+ insetBlock: 0,
25
+ borderRadius: radius.full,
26
+ backgroundColor: color.borderStrong,
27
+ },
28
+ thumb: {
29
+ position: "absolute",
30
+ insetBlock: "0.2rem",
31
+ width: "1.6rem",
32
+ borderRadius: radius.md,
33
+ backgroundColor: color.surfaceRaised,
34
+ boxShadow: shadow.raised,
35
+ transitionProperty: "inset-inline-start",
36
+ transitionDuration: { default: motion.normal, [REDUCED]: "0s" },
37
+ transitionTimingFunction: motion.easeOut,
38
+ },
39
+ still: { transitionDuration: { default: "0s", [REDUCED]: "0s" } },
40
+ grown: (ratio) => ({ width: `calc(1.6rem + (100% - 1.6rem) * ${ratio})` }),
41
+ slid: (ratio) => ({ insetInlineStart: `calc((100% - 1.6rem) * ${ratio})` }),
42
+ });
43
+ function snap(raw, min, max, step) {
44
+ const clamped = Math.min(max, Math.max(min, raw));
45
+ if (step <= 0)
46
+ return clamped;
47
+ const decimals = (String(step).split(".")[1] ?? "").length;
48
+ const stepped = min + Math.round((clamped - min) / step) * step;
49
+ return Number(Math.min(max, Math.max(min, stepped)).toFixed(decimals));
50
+ }
51
+ export function Slider({ value, onChange, min = 0, max = 1, step = 0.01, label, valueText, disabled = false, sx, "aria-label": ariaLabel, }) {
52
+ const labelId = useId();
53
+ const control = useRef(null);
54
+ const thumb = useRef(null);
55
+ const [dragging, setDragging] = useState(false);
56
+ const current = snap(value, min, max, step);
57
+ const ratio = max === min ? 0 : (current - min) / (max - min);
58
+ function emit(raw) {
59
+ const next = snap(raw, min, max, step);
60
+ if (next !== current)
61
+ onChange(next);
62
+ }
63
+ function ratioAt(clientX) {
64
+ const track = control.current;
65
+ const knob = thumb.current;
66
+ if (track == null || knob == null)
67
+ return ratio;
68
+ const rect = track.getBoundingClientRect();
69
+ const span = rect.width - knob.offsetWidth;
70
+ if (span <= 0)
71
+ return ratio;
72
+ return (clientX - rect.left - knob.offsetWidth / 2) / span;
73
+ }
74
+ function drag(event) {
75
+ emit(min + ratioAt(event.clientX) * (max - min));
76
+ }
77
+ return (_jsxs("div", { ...stylex.props(styles.root, sx), children: [label != null && (_jsx("span", { id: labelId, ...stylex.props(styles.label), children: label })), _jsxs("div", { ref: control, role: "slider", tabIndex: disabled ? -1 : 0, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": current, "aria-valuetext": valueText?.(current), "aria-orientation": "horizontal", "aria-disabled": disabled || undefined, "aria-labelledby": label != null ? labelId : undefined, "aria-label": ariaLabel, onPointerDown: (event) => {
78
+ if (disabled)
79
+ return;
80
+ event.currentTarget.setPointerCapture(event.pointerId);
81
+ event.currentTarget.focus();
82
+ setDragging(true);
83
+ drag(event);
84
+ }, onPointerMove: (event) => {
85
+ if (dragging)
86
+ drag(event);
87
+ }, onPointerUp: () => setDragging(false), onPointerCancel: () => setDragging(false), onKeyDown: (event) => {
88
+ if (disabled)
89
+ return;
90
+ const nudge = (max - min) * ARROW_FRACTION;
91
+ if (event.key === "ArrowRight" || event.key === "ArrowUp")
92
+ emit(current + nudge);
93
+ else if (event.key === "ArrowLeft" || event.key === "ArrowDown")
94
+ emit(current - nudge);
95
+ else if (event.key === "Home")
96
+ emit(min);
97
+ else if (event.key === "End")
98
+ emit(max);
99
+ else
100
+ return;
101
+ event.preventDefault();
102
+ }, ...stylex.props(styles.control, disabled && styles.disabled), children: [_jsx("span", { "aria-hidden": "true", ...stylex.props(styles.fill, styles.grown(ratio)) }), _jsx("span", { ref: thumb, "aria-hidden": "true", ...stylex.props(styles.thumb, dragging && styles.still, styles.slid(ratio)) })] })] }));
103
+ }
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";
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";
@@ -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
+ };
@@ -24,6 +24,11 @@ export declare const lightColor: stylex.Theme<stylex.VarGroup<Readonly<{
24
24
  sheen: string;
25
25
  successHl: string;
26
26
  dangerHl: string;
27
+ layer1: string;
28
+ layer2: string;
29
+ layer3: string;
30
+ layer4: string;
31
+ layer5: string;
27
32
  }>, symbol>, symbol>;
28
33
  export declare const lightYarn: stylex.Theme<stylex.VarGroup<Readonly<{
29
34
  un: string;
@@ -108,6 +113,11 @@ export declare const darkColor: stylex.Theme<stylex.VarGroup<Readonly<{
108
113
  sheen: string;
109
114
  successHl: string;
110
115
  dangerHl: string;
116
+ layer1: string;
117
+ layer2: string;
118
+ layer3: string;
119
+ layer4: string;
120
+ layer5: string;
111
121
  }>, symbol>, symbol>;
112
122
  export declare const darkYarn: stylex.Theme<stylex.VarGroup<Readonly<{
113
123
  un: string;
@@ -167,6 +177,99 @@ export declare const darkShadow: stylex.Theme<stylex.VarGroup<Readonly<{
167
177
  popover: string;
168
178
  raised: string;
169
179
  }>, symbol>, symbol>;
180
+ export declare const neutralColor: stylex.Theme<stylex.VarGroup<Readonly<{
181
+ bg: string;
182
+ surface: string;
183
+ surfaceRaised: string;
184
+ border: string;
185
+ borderStrong: string;
186
+ text: string;
187
+ textMuted: string;
188
+ textFaint: string;
189
+ accent: string;
190
+ accentText: string;
191
+ accentSubtle: string;
192
+ danger: string;
193
+ dangerSubtle: string;
194
+ success: string;
195
+ successSubtle: string;
196
+ warning: string;
197
+ warningSubtle: string;
198
+ info: string;
199
+ infoSubtle: string;
200
+ focusRing: string;
201
+ bone: string;
202
+ sheen: string;
203
+ successHl: string;
204
+ dangerHl: string;
205
+ layer1: string;
206
+ layer2: string;
207
+ layer3: string;
208
+ layer4: string;
209
+ layer5: string;
210
+ }>, symbol>, symbol>;
211
+ export declare const neutralLightColor: stylex.Theme<stylex.VarGroup<Readonly<{
212
+ bg: string;
213
+ surface: string;
214
+ surfaceRaised: string;
215
+ border: string;
216
+ borderStrong: string;
217
+ text: string;
218
+ textMuted: string;
219
+ textFaint: string;
220
+ accent: string;
221
+ accentText: string;
222
+ accentSubtle: string;
223
+ danger: string;
224
+ dangerSubtle: string;
225
+ success: string;
226
+ successSubtle: string;
227
+ warning: string;
228
+ warningSubtle: string;
229
+ info: string;
230
+ infoSubtle: string;
231
+ focusRing: string;
232
+ bone: string;
233
+ sheen: string;
234
+ successHl: string;
235
+ dangerHl: string;
236
+ layer1: string;
237
+ layer2: string;
238
+ layer3: string;
239
+ layer4: string;
240
+ layer5: string;
241
+ }>, symbol>, symbol>;
242
+ export declare const neutralDarkColor: stylex.Theme<stylex.VarGroup<Readonly<{
243
+ bg: string;
244
+ surface: string;
245
+ surfaceRaised: string;
246
+ border: string;
247
+ borderStrong: string;
248
+ text: string;
249
+ textMuted: string;
250
+ textFaint: string;
251
+ accent: string;
252
+ accentText: string;
253
+ accentSubtle: string;
254
+ danger: string;
255
+ dangerSubtle: string;
256
+ success: string;
257
+ successSubtle: string;
258
+ warning: string;
259
+ warningSubtle: string;
260
+ info: string;
261
+ infoSubtle: string;
262
+ focusRing: string;
263
+ bone: string;
264
+ sheen: string;
265
+ successHl: string;
266
+ dangerHl: string;
267
+ layer1: string;
268
+ layer2: string;
269
+ layer3: string;
270
+ layer4: string;
271
+ layer5: string;
272
+ }>, symbol>, symbol>;
170
273
  /** 套在 root element 上:`<div {...stylex.props(...light)}>` */
171
274
  export declare const light: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
172
275
  bg: string;
@@ -193,6 +296,11 @@ export declare const light: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
193
296
  sheen: string;
194
297
  successHl: string;
195
298
  dangerHl: string;
299
+ layer1: string;
300
+ layer2: string;
301
+ layer3: string;
302
+ layer4: string;
303
+ layer5: string;
196
304
  }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
197
305
  un: string;
198
306
  sh: string;
@@ -271,6 +379,209 @@ export declare const dark: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
271
379
  sheen: string;
272
380
  successHl: string;
273
381
  dangerHl: string;
382
+ layer1: string;
383
+ layer2: string;
384
+ layer3: string;
385
+ layer4: string;
386
+ layer5: string;
387
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
388
+ un: string;
389
+ sh: string;
390
+ y0: string;
391
+ y1: string;
392
+ y2: string;
393
+ y3: string;
394
+ y4: string;
395
+ hi: string;
396
+ shadow: string;
397
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
398
+ un: string;
399
+ sh: string;
400
+ y0: string;
401
+ y1: string;
402
+ y2: string;
403
+ y3: string;
404
+ y4: string;
405
+ hi: string;
406
+ shadow: string;
407
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
408
+ un: string;
409
+ sh: string;
410
+ y0: string;
411
+ y1: string;
412
+ y2: string;
413
+ y3: string;
414
+ y4: string;
415
+ hi: string;
416
+ shadow: string;
417
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
418
+ un: string;
419
+ sh: string;
420
+ y0: string;
421
+ y1: string;
422
+ y2: string;
423
+ y3: string;
424
+ y4: string;
425
+ hi: string;
426
+ shadow: string;
427
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
428
+ un: string;
429
+ sh: string;
430
+ y0: string;
431
+ y1: string;
432
+ y2: string;
433
+ y3: string;
434
+ y4: string;
435
+ hi: string;
436
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
437
+ popover: string;
438
+ raised: string;
439
+ }>, symbol>, symbol>];
440
+ /** neutral palette。`neutral` 跟隨系統 scheme,另外兩個鎖定。 */
441
+ export declare const neutral: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
442
+ bg: string;
443
+ surface: string;
444
+ surfaceRaised: string;
445
+ border: string;
446
+ borderStrong: string;
447
+ text: string;
448
+ textMuted: string;
449
+ textFaint: string;
450
+ accent: string;
451
+ accentText: string;
452
+ accentSubtle: string;
453
+ danger: string;
454
+ dangerSubtle: string;
455
+ success: string;
456
+ successSubtle: string;
457
+ warning: string;
458
+ warningSubtle: string;
459
+ info: string;
460
+ infoSubtle: string;
461
+ focusRing: string;
462
+ bone: string;
463
+ sheen: string;
464
+ successHl: string;
465
+ dangerHl: string;
466
+ layer1: string;
467
+ layer2: string;
468
+ layer3: string;
469
+ layer4: string;
470
+ layer5: string;
471
+ }>, symbol>, symbol>];
472
+ export declare const neutralLight: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
473
+ bg: string;
474
+ surface: string;
475
+ surfaceRaised: string;
476
+ border: string;
477
+ borderStrong: string;
478
+ text: string;
479
+ textMuted: string;
480
+ textFaint: string;
481
+ accent: string;
482
+ accentText: string;
483
+ accentSubtle: string;
484
+ danger: string;
485
+ dangerSubtle: string;
486
+ success: string;
487
+ successSubtle: string;
488
+ warning: string;
489
+ warningSubtle: string;
490
+ info: string;
491
+ infoSubtle: string;
492
+ focusRing: string;
493
+ bone: string;
494
+ sheen: string;
495
+ successHl: string;
496
+ dangerHl: string;
497
+ layer1: string;
498
+ layer2: string;
499
+ layer3: string;
500
+ layer4: string;
501
+ layer5: string;
502
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
503
+ un: string;
504
+ sh: string;
505
+ y0: string;
506
+ y1: string;
507
+ y2: string;
508
+ y3: string;
509
+ y4: string;
510
+ hi: string;
511
+ shadow: string;
512
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
513
+ un: string;
514
+ sh: string;
515
+ y0: string;
516
+ y1: string;
517
+ y2: string;
518
+ y3: string;
519
+ y4: string;
520
+ hi: string;
521
+ shadow: string;
522
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
523
+ un: string;
524
+ sh: string;
525
+ y0: string;
526
+ y1: string;
527
+ y2: string;
528
+ y3: string;
529
+ y4: string;
530
+ hi: string;
531
+ shadow: string;
532
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
533
+ un: string;
534
+ sh: string;
535
+ y0: string;
536
+ y1: string;
537
+ y2: string;
538
+ y3: string;
539
+ y4: string;
540
+ hi: string;
541
+ shadow: string;
542
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
543
+ un: string;
544
+ sh: string;
545
+ y0: string;
546
+ y1: string;
547
+ y2: string;
548
+ y3: string;
549
+ y4: string;
550
+ hi: string;
551
+ }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
552
+ popover: string;
553
+ raised: string;
554
+ }>, symbol>, symbol>];
555
+ export declare const neutralDark: readonly [stylex.Theme<stylex.VarGroup<Readonly<{
556
+ bg: string;
557
+ surface: string;
558
+ surfaceRaised: string;
559
+ border: string;
560
+ borderStrong: string;
561
+ text: string;
562
+ textMuted: string;
563
+ textFaint: string;
564
+ accent: string;
565
+ accentText: string;
566
+ accentSubtle: string;
567
+ danger: string;
568
+ dangerSubtle: string;
569
+ success: string;
570
+ successSubtle: string;
571
+ warning: string;
572
+ warningSubtle: string;
573
+ info: string;
574
+ infoSubtle: string;
575
+ focusRing: string;
576
+ bone: string;
577
+ sheen: string;
578
+ successHl: string;
579
+ dangerHl: string;
580
+ layer1: string;
581
+ layer2: string;
582
+ layer3: string;
583
+ layer4: string;
584
+ layer5: string;
274
585
  }>, symbol>, symbol>, stylex.Theme<stylex.VarGroup<Readonly<{
275
586
  un: string;
276
587
  sh: string;
@@ -3,8 +3,11 @@
3
3
  //
4
4
  // 給有使用者切換主題的 app(例如 next-themes)。tokens 本身跟隨 OS,套上 theme 才會鎖定。
5
5
  // **要套就整組套**:只套 color 會讓布停在另一個主題,深色布配深色字。
6
+ //
7
+ // palette 是另一個維度:neutral 只換 color(紙與墨),布跟著亮暗走。
6
8
  import * as stylex from "@stylexjs/stylex";
7
9
  import { color, yarn, yarnSecondary, yarnGhost, yarnDanger, yarnSubtle, shadow } from "./tokens.stylex.js";
10
+ const DARK = "@media (prefers-color-scheme: dark)";
8
11
  export const lightColor = stylex.createTheme(color, {
9
12
  bg: "#FAFAF6",
10
13
  surface: "#FFFFFF",
@@ -30,6 +33,11 @@ export const lightColor = stylex.createTheme(color, {
30
33
  sheen: "#F6F4EC",
31
34
  successHl: "#C6E0C6",
32
35
  dangerHl: "#EFCEC3",
36
+ layer1: "#EFECE3",
37
+ layer2: "#FAFAF6",
38
+ layer3: "#F1EFE7",
39
+ layer4: "#E8E5DA",
40
+ layer5: "#DEDACD",
33
41
  });
34
42
  export const lightYarn = stylex.createTheme(yarn, {
35
43
  un: "#11362C",
@@ -114,6 +122,11 @@ export const darkColor = stylex.createTheme(color, {
114
122
  sheen: "#35302A",
115
123
  successHl: "#2F4A2E",
116
124
  dangerHl: "#573328",
125
+ layer1: "#0E0C09",
126
+ layer2: "#181613",
127
+ layer3: "#211E19",
128
+ layer4: "#2B2721",
129
+ layer5: "#35302A",
117
130
  });
118
131
  export const darkYarn = stylex.createTheme(yarn, {
119
132
  un: "#173629",
@@ -173,6 +186,99 @@ export const darkShadow = stylex.createTheme(shadow, {
173
186
  popover: "0 8px 24px rgba(0, 0, 0, 0.4)",
174
187
  raised: "0 1px 2px rgba(0, 0, 0, 0.3)",
175
188
  });
189
+ export const neutralColor = stylex.createTheme(color, {
190
+ bg: { default: "#FFFFFF", [DARK]: "#000000" },
191
+ surface: { default: "#F5F5F7", [DARK]: "#1C1C1E" },
192
+ surfaceRaised: { default: "#FFFFFF", [DARK]: "#2C2C2E" },
193
+ border: { default: "#E5E5EA", [DARK]: "#38383A" },
194
+ borderStrong: { default: "#C7C7CC", [DARK]: "#48484A" },
195
+ text: { default: "#1D1D1F", [DARK]: "#F5F5F7" },
196
+ textMuted: { default: "#6E6E73", [DARK]: "#98989D" },
197
+ textFaint: { default: "#86868B", [DARK]: "#8E8E93" },
198
+ accent: { default: "#1D1D1F", [DARK]: "#F5F5F7" },
199
+ accentText: { default: "#FFFFFF", [DARK]: "#000000" },
200
+ accentSubtle: { default: "#E8E8ED", [DARK]: "#2C2C2E" },
201
+ danger: { default: "#B3402E", [DARK]: "#DD7059" },
202
+ dangerSubtle: { default: "#F7E7E3", [DARK]: "#3D231E" },
203
+ success: { default: "#23705A", [DARK]: "#4FA184" },
204
+ successSubtle: { default: "#E7F0EB", [DARK]: "#22352E" },
205
+ warning: { default: "#B25000", [DARK]: "#FFB340" },
206
+ warningSubtle: { default: "#F5EBD9", [DARK]: "#3A2F1D" },
207
+ info: { default: "#2C5C86", [DARK]: "#6FA3CE" },
208
+ infoSubtle: { default: "#E4EDF5", [DARK]: "#1E2C38" },
209
+ focusRing: { default: "#1D1D1F", [DARK]: "#F5F5F7" },
210
+ bone: { default: "#E6E6EA", [DARK]: "#2C2C2E" },
211
+ sheen: { default: "#F2F2F5", [DARK]: "#3F3F42" },
212
+ successHl: { default: "#C6E0C6", [DARK]: "#2F4A2E" },
213
+ dangerHl: { default: "#EFCEC3", [DARK]: "#573328" },
214
+ layer1: { default: "#EFEFF2", [DARK]: "#000000" },
215
+ layer2: { default: "#FFFFFF", [DARK]: "#161618" },
216
+ layer3: { default: "#F2F2F5", [DARK]: "#242426" },
217
+ layer4: { default: "#E6E6EA", [DARK]: "#323234" },
218
+ layer5: { default: "#D9D9DE", [DARK]: "#3F3F42" },
219
+ });
220
+ export const neutralLightColor = stylex.createTheme(color, {
221
+ bg: "#FFFFFF",
222
+ surface: "#F5F5F7",
223
+ surfaceRaised: "#FFFFFF",
224
+ border: "#E5E5EA",
225
+ borderStrong: "#C7C7CC",
226
+ text: "#1D1D1F",
227
+ textMuted: "#6E6E73",
228
+ textFaint: "#86868B",
229
+ accent: "#1D1D1F",
230
+ accentText: "#FFFFFF",
231
+ accentSubtle: "#E8E8ED",
232
+ danger: "#B3402E",
233
+ dangerSubtle: "#F7E7E3",
234
+ success: "#23705A",
235
+ successSubtle: "#E7F0EB",
236
+ warning: "#B25000",
237
+ warningSubtle: "#F5EBD9",
238
+ info: "#2C5C86",
239
+ infoSubtle: "#E4EDF5",
240
+ focusRing: "#1D1D1F",
241
+ bone: "#E6E6EA",
242
+ sheen: "#F2F2F5",
243
+ successHl: "#C6E0C6",
244
+ dangerHl: "#EFCEC3",
245
+ layer1: "#EFEFF2",
246
+ layer2: "#FFFFFF",
247
+ layer3: "#F2F2F5",
248
+ layer4: "#E6E6EA",
249
+ layer5: "#D9D9DE",
250
+ });
251
+ export const neutralDarkColor = stylex.createTheme(color, {
252
+ bg: "#000000",
253
+ surface: "#1C1C1E",
254
+ surfaceRaised: "#2C2C2E",
255
+ border: "#38383A",
256
+ borderStrong: "#48484A",
257
+ text: "#F5F5F7",
258
+ textMuted: "#98989D",
259
+ textFaint: "#8E8E93",
260
+ accent: "#F5F5F7",
261
+ accentText: "#000000",
262
+ accentSubtle: "#2C2C2E",
263
+ danger: "#DD7059",
264
+ dangerSubtle: "#3D231E",
265
+ success: "#4FA184",
266
+ successSubtle: "#22352E",
267
+ warning: "#FFB340",
268
+ warningSubtle: "#3A2F1D",
269
+ info: "#6FA3CE",
270
+ infoSubtle: "#1E2C38",
271
+ focusRing: "#F5F5F7",
272
+ bone: "#2C2C2E",
273
+ sheen: "#3F3F42",
274
+ successHl: "#2F4A2E",
275
+ dangerHl: "#573328",
276
+ layer1: "#000000",
277
+ layer2: "#161618",
278
+ layer3: "#242426",
279
+ layer4: "#323234",
280
+ layer5: "#3F3F42",
281
+ });
176
282
  /** 套在 root element 上:`<div {...stylex.props(...light)}>` */
177
283
  export const light = [
178
284
  lightColor,
@@ -192,3 +298,23 @@ export const dark = [
192
298
  darkYarnSubtle,
193
299
  darkShadow,
194
300
  ];
301
+ /** neutral palette。`neutral` 跟隨系統 scheme,另外兩個鎖定。 */
302
+ export const neutral = [neutralColor];
303
+ export const neutralLight = [
304
+ neutralLightColor,
305
+ lightYarn,
306
+ lightYarnSecondary,
307
+ lightYarnGhost,
308
+ lightYarnDanger,
309
+ lightYarnSubtle,
310
+ lightShadow,
311
+ ];
312
+ export const neutralDark = [
313
+ neutralDarkColor,
314
+ darkYarn,
315
+ darkYarnSecondary,
316
+ darkYarnGhost,
317
+ darkYarnDanger,
318
+ darkYarnSubtle,
319
+ darkShadow,
320
+ ];