@omnific/atelier 0.3.0 → 0.4.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 CHANGED
@@ -11,12 +11,16 @@ const system = createSystem('app', defaultColors);
11
11
 
12
12
  function App() {
13
13
  useTheme(system); // injects CSS variables onto :root
14
- return <Button variant='primary'>Continue</Button>;
14
+ return (
15
+ <Button color='primary' variant='solid'>
16
+ Continue
17
+ </Button>
18
+ );
15
19
  }
16
20
  ```
17
21
 
18
22
  Color values come from `createSystem` and are injected at runtime by `useTheme`.
19
- Spacing, radii, fonts, control heights, shadows and component styles ship via `@omnific/atelier/styles.css`.
23
+ Spacing, radii, fonts, control heights, shadows, body defaults, border-box sizing and component styles ship via `@omnific/atelier/styles.css`.
20
24
 
21
25
  ## Storybook
22
26
 
package/dist/box/index.js CHANGED
@@ -1,2 +1 @@
1
- import { Box } from "./Box.js";
2
- export { Box };
1
+ export { Box } from "./Box.js";
@@ -8,10 +8,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
8
8
  * 通用按钮。
9
9
  */
10
10
  const Button = (props) => {
11
- const { block = false, children, className, disabled, icon, loading = false, onClick, ref, shape = "default", size = "default", type = "button", variant = "secondary", ...rest } = props;
11
+ const { block = false, children, className, color = "default", disabled, icon, loading = false, onClick, ref, shape = "default", size = "default", type = "button", variant = "outlined", ...rest } = props;
12
12
  const hasChildren = hasValue(children);
13
13
  const isIconOnly = isNil(children) && (hasValue(icon) || loading);
14
- const classes = clsx(buttonPrefixCls, `${buttonPrefixCls}-${variant}`, `${buttonPrefixCls}-size-${size}`, {
14
+ const classes = clsx(buttonPrefixCls, `${buttonPrefixCls}-variant-${variant}`, `${buttonPrefixCls}-size-${size}`, {
15
15
  [`${buttonPrefixCls}-shape-${shape}`]: shape !== "default",
16
16
  [`${buttonPrefixCls}-icon-only`]: isIconOnly,
17
17
  [`${buttonPrefixCls}-block`]: block,
@@ -32,6 +32,7 @@ const Button = (props) => {
32
32
  ...rest,
33
33
  "aria-busy": loading || void 0,
34
34
  className: classes,
35
+ "data-color": color,
35
36
  disabled,
36
37
  onClick: handleClick,
37
38
  ref,
@@ -1,3 +1,3 @@
1
- import { ButtonProps, ButtonShape, ButtonVariant } from "./types.js";
1
+ import { ButtonColor, ButtonProps, ButtonShape, ButtonVariant } from "./types.js";
2
2
  import { Button } from "./Button.js";
3
- export { Button, type ButtonProps, type ButtonShape, type ButtonVariant };
3
+ export { Button, type ButtonColor, type ButtonProps, type ButtonShape, type ButtonVariant };
@@ -1,2 +1 @@
1
- import { Button } from "./Button.js";
2
- export { Button };
1
+ export { Button } from "./Button.js";
@@ -2,19 +2,29 @@ import { ComponentSize } from "../types.js";
2
2
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
3
3
  //#region button/types.d.ts
4
4
  /**
5
- * 按钮形状。
5
+ * 按钮颜色角色。
6
6
  */
7
- export type ButtonShape = 'default' | 'circle' | 'round';
7
+ export type ButtonColor = 'default' | 'primary' | 'danger';
8
+ /**
9
+ * 按钮形态。
10
+ */
11
+ export type ButtonVariant = 'solid' | 'outlined' | 'dashed';
8
12
  /**
9
- * 按钮视觉变体。危险操作用 `danger`,不再与其他变体叠加。
13
+ * 按钮形状。
10
14
  */
11
- export type ButtonVariant = 'primary' | 'secondary' | 'dashed' | 'outline' | 'danger';
15
+ export type ButtonShape = 'default' | 'circle' | 'round';
12
16
  /**
13
17
  * 按钮属性。
14
18
  *
15
19
  * 使用 `interface` 扩展原生 button props,便于 Storybook Docgen 推断 Controls。
16
20
  */
17
21
  export interface ButtonProps extends ComponentPropsWithRef<'button'> {
22
+ /**
23
+ * 设置按钮颜色角色。
24
+ *
25
+ * 省略时使用 `default`。
26
+ */
27
+ color?: ButtonColor;
18
28
  /**
19
29
  * 将按钮宽度调整为父容器宽度。
20
30
  */
@@ -36,7 +46,7 @@ export interface ButtonProps extends ComponentPropsWithRef<'button'> {
36
46
  */
37
47
  size?: ComponentSize;
38
48
  /**
39
- * 设置按钮视觉变体。
49
+ * 设置按钮形态。
40
50
  */
41
51
  variant?: ButtonVariant;
42
52
  }
@@ -10,7 +10,7 @@ import { PositionEdgeValue, PositionValue } from "./position.props.js";
10
10
  import { RadiusValue } from "./radius.props.js";
11
11
  import { ShadowValue } from "./shadow.props.js";
12
12
  import { WidthValue } from "./width.props.js";
13
- import { DefaultColorKey } from "../system/defaults/colors.js";
13
+ import { DefaultColorKey } from "../system/defaults/color-keys.gen.js";
14
14
  import { CSSProperties } from "react";
15
15
  //#region props/index.d.ts
16
16
  /**
package/dist/styles.css CHANGED
@@ -67,11 +67,32 @@
67
67
  }
68
68
 
69
69
  :root {
70
- --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
71
- 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
72
- 'Noto Color Emoji';
70
+ --font-sans: 'Noto Sans', Inter, Roboto, 'Noto Sans SC', 'Source Han Sans SC', 'Sarasa Gothic SC';
73
71
  --font-size-md: 14px;
74
72
  --font-size-lg: 16px;
73
+ --font-weight-regular: 400;
74
+ --line-height-md: 1.5;
75
+ }
76
+
77
+ html {
78
+ box-sizing: border-box;
79
+ }
80
+
81
+ *,
82
+ *::before,
83
+ *::after {
84
+ box-sizing: inherit;
85
+ }
86
+
87
+ body {
88
+ margin: 0;
89
+ color: var(--color-fg);
90
+ background: var(--color-bg);
91
+ font-family: var(--font-sans), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
92
+ font-size: var(--font-size-md);
93
+ font-weight: var(--font-weight-regular);
94
+ line-height: var(--line-height-md);
95
+ letter-spacing: 0;
75
96
  }
76
97
 
77
98
  .atelier-align-items-start {
@@ -254,6 +275,54 @@
254
275
  border: 1px solid var(--color-border);
255
276
  }
256
277
 
278
+ :where([data-color=default]) {
279
+ --color-role-contrast: var(--color-fg);
280
+ --color-role-fg: var(--color-fg);
281
+ --color-role-bg: var(--color-bg);
282
+ --color-role-subtle: var(--color-bg-muted);
283
+ --color-role-muted: var(--color-bg-emphasized);
284
+ --color-role-emphasized: var(--color-border-emphasized);
285
+ --color-role-solid: var(--color-bg-muted);
286
+ --color-role-solid-hover: var(--color-bg-emphasized);
287
+ --color-role-solid-active: var(--color-border-emphasized);
288
+ --color-role-hover: var(--color-accent-hover);
289
+ --color-role-active: var(--color-accent-active);
290
+ --color-role-focus-ring: var(--color-accent-focus-ring);
291
+ --color-role-border: var(--color-border);
292
+ }
293
+
294
+ :where([data-color=primary]) {
295
+ --color-role-contrast: var(--color-accent-contrast);
296
+ --color-role-fg: var(--color-accent-fg);
297
+ --color-role-bg: transparent;
298
+ --color-role-subtle: var(--color-accent-subtle);
299
+ --color-role-muted: var(--color-accent-muted);
300
+ --color-role-emphasized: var(--color-accent-emphasized);
301
+ --color-role-solid: var(--color-accent-solid);
302
+ --color-role-solid-hover: var(--color-accent-hover);
303
+ --color-role-solid-active: var(--color-accent-active);
304
+ --color-role-hover: var(--color-accent-hover);
305
+ --color-role-active: var(--color-accent-active);
306
+ --color-role-focus-ring: var(--color-accent-focus-ring);
307
+ --color-role-border: var(--color-accent-border);
308
+ }
309
+
310
+ :where([data-color=danger]) {
311
+ --color-role-contrast: var(--color-danger-contrast);
312
+ --color-role-fg: var(--color-danger-fg);
313
+ --color-role-bg: transparent;
314
+ --color-role-subtle: var(--color-danger-subtle);
315
+ --color-role-muted: var(--color-danger-muted);
316
+ --color-role-emphasized: var(--color-danger-emphasized);
317
+ --color-role-solid: var(--color-danger-solid);
318
+ --color-role-solid-hover: var(--color-danger-hover);
319
+ --color-role-solid-active: var(--color-danger-active);
320
+ --color-role-hover: var(--color-danger-hover);
321
+ --color-role-active: var(--color-danger-active);
322
+ --color-role-focus-ring: var(--color-danger-focus-ring);
323
+ --color-role-border: var(--color-danger-border);
324
+ }
325
+
257
326
  .atelier-display-none {
258
327
  display: none;
259
328
  }
@@ -2363,7 +2432,6 @@
2363
2432
  }
2364
2433
 
2365
2434
  .atelier-box {
2366
- box-sizing: border-box;
2367
2435
  min-width: 0;
2368
2436
  }
2369
2437
 
@@ -2373,7 +2441,6 @@
2373
2441
  justify-content: center;
2374
2442
  height: var(--control-height-md);
2375
2443
  padding: 0 15px;
2376
- line-height: 1.5715;
2377
2444
  white-space: nowrap;
2378
2445
  }
2379
2446
  .atelier-button > :first-child:not(:only-child) {
@@ -2409,29 +2476,16 @@
2409
2476
  .atelier-button {
2410
2477
  appearance: none;
2411
2478
  font: inherit;
2412
- font-family: var(--font-sans);
2413
- font-weight: 400;
2414
- color: var(--color-fg);
2479
+ line-height: 1.5715;
2415
2480
  user-select: none;
2416
2481
  cursor: pointer;
2417
- background: var(--color-bg);
2418
- border: 1px solid var(--color-border);
2482
+ border: 1px solid transparent;
2419
2483
  border-radius: var(--radius-md);
2420
2484
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
2421
2485
  transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);
2422
2486
  }
2423
- .atelier-button:not(.atelier-button-loading):hover:not(:disabled) {
2424
- color: var(--color-accent-hover);
2425
- background: var(--color-bg);
2426
- border-color: var(--color-accent-hover);
2427
- }
2428
- .atelier-button:not(.atelier-button-loading):active:not(:disabled) {
2429
- color: var(--color-accent-active);
2430
- background: var(--color-bg);
2431
- border-color: var(--color-accent-active);
2432
- }
2433
2487
  .atelier-button:focus-visible {
2434
- outline: 3px solid var(--color-accent-focus-ring);
2488
+ outline: 3px solid var(--color-role-focus-ring);
2435
2489
  outline-offset: 2px;
2436
2490
  }
2437
2491
  .atelier-button:disabled {
@@ -2445,6 +2499,50 @@
2445
2499
  opacity: 0.65;
2446
2500
  pointer-events: none;
2447
2501
  }
2502
+ .atelier-button-variant-solid {
2503
+ color: var(--color-role-contrast);
2504
+ background: var(--color-role-solid);
2505
+ border-color: transparent;
2506
+ }
2507
+ .atelier-button-variant-solid:not(.atelier-button-loading):hover:not(:disabled) {
2508
+ background: var(--color-role-solid-hover);
2509
+ }
2510
+ .atelier-button-variant-solid:not(.atelier-button-loading):active:not(:disabled) {
2511
+ background: var(--color-role-solid-active);
2512
+ }
2513
+ .atelier-button-variant-outlined {
2514
+ color: var(--color-role-fg);
2515
+ background: var(--color-role-bg);
2516
+ border-color: var(--color-role-border);
2517
+ }
2518
+ .atelier-button-variant-outlined:not(.atelier-button-loading):hover:not(:disabled) {
2519
+ color: var(--color-role-hover);
2520
+ background: var(--color-role-bg);
2521
+ border-color: var(--color-role-hover);
2522
+ }
2523
+ .atelier-button-variant-outlined:not(.atelier-button-loading):active:not(:disabled) {
2524
+ color: var(--color-role-active);
2525
+ background: var(--color-role-bg);
2526
+ border-color: var(--color-role-active);
2527
+ }
2528
+ .atelier-button-variant-dashed {
2529
+ color: var(--color-role-fg);
2530
+ background: var(--color-role-bg);
2531
+ border-color: var(--color-role-border);
2532
+ }
2533
+ .atelier-button-variant-dashed:not(.atelier-button-loading):hover:not(:disabled) {
2534
+ color: var(--color-role-hover);
2535
+ background: var(--color-role-bg);
2536
+ border-color: var(--color-role-hover);
2537
+ }
2538
+ .atelier-button-variant-dashed:not(.atelier-button-loading):active:not(:disabled) {
2539
+ color: var(--color-role-active);
2540
+ background: var(--color-role-bg);
2541
+ border-color: var(--color-role-active);
2542
+ }
2543
+ .atelier-button-variant-dashed {
2544
+ border-style: dashed;
2545
+ }
2448
2546
  .atelier-button-size-small {
2449
2547
  font-size: var(--font-size-md);
2450
2548
  border-radius: var(--radius-sm);
@@ -2472,54 +2570,6 @@
2472
2570
  .atelier-button > span {
2473
2571
  display: inline-block;
2474
2572
  }
2475
- .atelier-button-primary {
2476
- color: var(--color-accent-contrast);
2477
- background: var(--color-accent-solid);
2478
- border-color: transparent;
2479
- }
2480
- .atelier-button-primary:not(.atelier-button-loading):hover:not(:disabled) {
2481
- color: var(--color-accent-contrast);
2482
- background: var(--color-accent-hover);
2483
- border-color: transparent;
2484
- }
2485
- .atelier-button-primary:not(.atelier-button-loading):active:not(:disabled) {
2486
- color: var(--color-accent-contrast);
2487
- background: var(--color-accent-active);
2488
- border-color: transparent;
2489
- }
2490
- .atelier-button-dashed {
2491
- border-style: dashed;
2492
- }
2493
- .atelier-button-outline {
2494
- color: var(--color-accent-solid);
2495
- background: transparent;
2496
- border-color: var(--color-accent-solid);
2497
- }
2498
- .atelier-button-outline:not(.atelier-button-loading):hover:not(:disabled) {
2499
- color: var(--color-accent-hover);
2500
- background: transparent;
2501
- border-color: var(--color-accent-hover);
2502
- }
2503
- .atelier-button-outline:not(.atelier-button-loading):active:not(:disabled) {
2504
- color: var(--color-accent-active);
2505
- background: transparent;
2506
- border-color: var(--color-accent-active);
2507
- }
2508
- .atelier-button-danger {
2509
- color: var(--color-danger-contrast);
2510
- background: var(--color-danger-solid);
2511
- border-color: transparent;
2512
- }
2513
- .atelier-button-danger:not(.atelier-button-loading):hover:not(:disabled) {
2514
- color: var(--color-danger-contrast);
2515
- background: var(--color-danger-hover);
2516
- border-color: transparent;
2517
- }
2518
- .atelier-button-danger:not(.atelier-button-loading):active:not(:disabled) {
2519
- color: var(--color-danger-contrast);
2520
- background: var(--color-danger-active);
2521
- border-color: transparent;
2522
- }
2523
2573
  .atelier-button-loading-icon > svg {
2524
2574
  animation: atelier-button-spin 0.7s linear infinite;
2525
2575
  }
@@ -2528,4 +2578,4 @@
2528
2578
  to {
2529
2579
  transform: rotate(360deg);
2530
2580
  }
2531
- }
2581
+ }
@@ -1,4 +1,4 @@
1
- import { ColorSet } from "./types.js";
1
+ import { ColorSet, FlatColorSet } from "./types.js";
2
2
  //#region system/create-system.d.ts
3
3
  /**
4
4
  * 合并扁平颜色表并返回 system 实例。
@@ -8,7 +8,7 @@ import { ColorSet } from "./types.js";
8
8
  */
9
9
  export declare function createSystem(nameOrColors: string | ColorSet, ...colorSets: ColorSet[]): {
10
10
  name: string;
11
- colors: ColorSet;
11
+ colors: FlatColorSet;
12
12
  cssVars: Readonly<Record<string, string>>;
13
13
  };
14
14
  //#endregion
@@ -1,11 +1,11 @@
1
- import { ColorSet } from "./types.js";
1
+ import { FlatColorSet } from "./types.js";
2
2
  //#region system/default-system.d.ts
3
3
  /**
4
4
  * 基于 `defaultColors` 的共享默认 system(单例,可直接 `useTheme` / `applyCssVars`)。
5
5
  */
6
6
  export declare const defaultSystem: {
7
7
  name: string;
8
- colors: ColorSet;
8
+ colors: FlatColorSet;
9
9
  cssVars: Readonly<Record<string, string>>;
10
10
  };
11
11
  //#endregion
@@ -0,0 +1,3 @@
1
+ //#region system/defaults/color-keys.gen.d.ts
2
+ export type DefaultColorKey = 'bg' | 'bg-subtle' | 'bg-muted' | 'bg-emphasized' | 'bg-inverted' | 'bg-panel' | 'bg-disabled' | 'bg-danger' | 'bg-warning' | 'bg-success' | 'bg-info' | 'fg' | 'fg-muted' | 'fg-subtle' | 'fg-inverted' | 'fg-disabled' | 'fg-danger' | 'fg-warning' | 'fg-success' | 'fg-info' | 'border' | 'border-muted' | 'border-subtle' | 'border-emphasized' | 'border-inverted' | 'border-danger' | 'border-warning' | 'border-success' | 'border-info' | 'accent-contrast' | 'accent-fg' | 'accent-subtle' | 'accent-muted' | 'accent-emphasized' | 'accent-solid' | 'accent-hover' | 'accent-active' | 'accent-focus-ring' | 'accent-border' | 'danger-contrast' | 'danger-fg' | 'danger-subtle' | 'danger-muted' | 'danger-emphasized' | 'danger-solid' | 'danger-hover' | 'danger-active' | 'danger-focus-ring' | 'danger-border' | 'warning-contrast' | 'warning-fg' | 'warning-subtle' | 'warning-muted' | 'warning-emphasized' | 'warning-solid' | 'warning-hover' | 'warning-active' | 'warning-focus-ring' | 'warning-border' | 'success-contrast' | 'success-fg' | 'success-subtle' | 'success-muted' | 'success-emphasized' | 'success-solid' | 'success-hover' | 'success-active' | 'success-focus-ring' | 'success-border' | 'info-contrast' | 'info-fg' | 'info-subtle' | 'info-muted' | 'info-emphasized' | 'info-solid' | 'info-hover' | 'info-active' | 'info-focus-ring' | 'info-border';
3
+ //#endregion
@@ -2,253 +2,103 @@
2
2
  /**
3
3
  * 默认语义颜色。
4
4
  *
5
- * 颜色键使用扁平 kebab-case 语义名,运行时统一映射为 `--color-*`。
5
+ * 分组内使用 base 表示当前分组自己的颜色。
6
6
  */
7
7
  export declare const defaultColors: {
8
8
  readonly bg: {
9
- readonly value: "#ffffff";
10
- };
11
- readonly 'bg-subtle': {
12
- readonly value: "#fafafa";
13
- };
14
- readonly 'bg-muted': {
15
- readonly value: "#f4f4f5";
16
- };
17
- readonly 'bg-emphasized': {
18
- readonly value: "#e4e4e7";
19
- };
20
- readonly 'bg-inverted': {
21
- readonly value: "#09090b";
22
- };
23
- readonly 'bg-panel': {
24
- readonly value: "#ffffff";
25
- };
26
- readonly 'bg-disabled': {
27
- readonly value: "rgb(239 239 239)";
28
- };
29
- readonly 'bg-danger': {
30
- readonly value: "#fef2f2";
31
- };
32
- readonly 'bg-warning': {
33
- readonly value: "#fff7ed";
34
- };
35
- readonly 'bg-success': {
36
- readonly value: "#f0fdf4";
37
- };
38
- readonly 'bg-info': {
39
- readonly value: "#e6f4ff";
9
+ readonly base: "#ffffff";
10
+ readonly subtle: "#fafafa";
11
+ readonly muted: "#f4f4f5";
12
+ readonly emphasized: "#e4e4e7";
13
+ readonly inverted: "#09090b";
14
+ readonly panel: "#ffffff";
15
+ readonly disabled: "rgb(239 239 239)";
16
+ readonly danger: "#fef2f2";
17
+ readonly warning: "#fff7ed";
18
+ readonly success: "#f0fdf4";
19
+ readonly info: "#e6f4ff";
40
20
  };
41
21
  readonly fg: {
42
- readonly value: "rgb(0 0 0 / 88%)";
43
- };
44
- readonly 'fg-muted': {
45
- readonly value: "rgb(0 0 0 / 45%)";
46
- };
47
- readonly 'fg-subtle': {
48
- readonly value: "rgb(0 0 0 / 25%)";
49
- };
50
- readonly 'fg-inverted': {
51
- readonly value: "#ffffff";
52
- };
53
- readonly 'fg-disabled': {
54
- readonly value: "rgb(0 0 0 / 25%)";
55
- };
56
- readonly 'fg-danger': {
57
- readonly value: "#ff4d4f";
58
- };
59
- readonly 'fg-warning': {
60
- readonly value: "#faad14";
61
- };
62
- readonly 'fg-success': {
63
- readonly value: "#52c41a";
64
- };
65
- readonly 'fg-info': {
66
- readonly value: "#1677ff";
22
+ readonly base: "rgb(0 0 0 / 88%)";
23
+ readonly muted: "rgb(0 0 0 / 45%)";
24
+ readonly subtle: "rgb(0 0 0 / 25%)";
25
+ readonly inverted: "#ffffff";
26
+ readonly disabled: "rgb(0 0 0 / 25%)";
27
+ readonly danger: "#ff4d4f";
28
+ readonly warning: "#faad14";
29
+ readonly success: "#52c41a";
30
+ readonly info: "#1677ff";
67
31
  };
68
32
  readonly border: {
69
- readonly value: "#d9d9d9";
70
- };
71
- readonly 'border-muted': {
72
- readonly value: "#f0f0f0";
73
- };
74
- readonly 'border-subtle': {
75
- readonly value: "#fafafa";
76
- };
77
- readonly 'border-emphasized': {
78
- readonly value: "#d9d9d9";
79
- };
80
- readonly 'border-inverted': {
81
- readonly value: "#434343";
82
- };
83
- readonly 'border-danger': {
84
- readonly value: "#ff4d4f";
85
- };
86
- readonly 'border-warning': {
87
- readonly value: "#faad14";
88
- };
89
- readonly 'border-success': {
90
- readonly value: "#52c41a";
91
- };
92
- readonly 'border-info': {
93
- readonly value: "#1677ff";
94
- };
95
- readonly 'accent-contrast': {
96
- readonly value: "#ffffff";
97
- };
98
- readonly 'accent-fg': {
99
- readonly value: "#1677ff";
100
- };
101
- readonly 'accent-subtle': {
102
- readonly value: "#e6f4ff";
103
- };
104
- readonly 'accent-muted': {
105
- readonly value: "#bae0ff";
106
- };
107
- readonly 'accent-emphasized': {
108
- readonly value: "#69b1ff";
109
- };
110
- readonly 'accent-solid': {
111
- readonly value: "#1677ff";
112
- };
113
- readonly 'accent-hover': {
114
- readonly value: "#4096ff";
115
- };
116
- readonly 'accent-active': {
117
- readonly value: "#0958d9";
118
- };
119
- readonly 'accent-focus-ring': {
120
- readonly value: "rgb(21 112 239 / 25%)";
121
- };
122
- readonly 'accent-border': {
123
- readonly value: "#1677ff";
124
- };
125
- readonly 'danger-contrast': {
126
- readonly value: "#ffffff";
127
- };
128
- readonly 'danger-fg': {
129
- readonly value: "#ff4d4f";
130
- };
131
- readonly 'danger-subtle': {
132
- readonly value: "#fff1f0";
133
- };
134
- readonly 'danger-muted': {
135
- readonly value: "#ffccc7";
136
- };
137
- readonly 'danger-emphasized': {
138
- readonly value: "#ffa39e";
139
- };
140
- readonly 'danger-solid': {
141
- readonly value: "#ff4d4f";
142
- };
143
- readonly 'danger-hover': {
144
- readonly value: "#ff7875";
145
- };
146
- readonly 'danger-active': {
147
- readonly value: "#d9363e";
148
- };
149
- readonly 'danger-focus-ring': {
150
- readonly value: "rgb(255 77 79 / 25%)";
151
- };
152
- readonly 'danger-border': {
153
- readonly value: "#ff4d4f";
154
- };
155
- readonly 'warning-contrast': {
156
- readonly value: "#ffffff";
157
- };
158
- readonly 'warning-fg': {
159
- readonly value: "#faad14";
160
- };
161
- readonly 'warning-subtle': {
162
- readonly value: "#fff7ed";
163
- };
164
- readonly 'warning-muted': {
165
- readonly value: "#ffe7ba";
166
- };
167
- readonly 'warning-emphasized': {
168
- readonly value: "#ffd666";
169
- };
170
- readonly 'warning-solid': {
171
- readonly value: "#faad14";
172
- };
173
- readonly 'warning-hover': {
174
- readonly value: "#ffc53d";
175
- };
176
- readonly 'warning-active': {
177
- readonly value: "#d48806";
178
- };
179
- readonly 'warning-focus-ring': {
180
- readonly value: "rgb(250 173 20 / 25%)";
181
- };
182
- readonly 'warning-border': {
183
- readonly value: "#faad14";
184
- };
185
- readonly 'success-contrast': {
186
- readonly value: "#ffffff";
187
- };
188
- readonly 'success-fg': {
189
- readonly value: "#52c41a";
190
- };
191
- readonly 'success-subtle': {
192
- readonly value: "#f0fdf4";
193
- };
194
- readonly 'success-muted': {
195
- readonly value: "#b7eb8f";
196
- };
197
- readonly 'success-emphasized': {
198
- readonly value: "#95de64";
199
- };
200
- readonly 'success-solid': {
201
- readonly value: "#52c41a";
202
- };
203
- readonly 'success-hover': {
204
- readonly value: "#73d13d";
205
- };
206
- readonly 'success-active': {
207
- readonly value: "#389e0d";
208
- };
209
- readonly 'success-focus-ring': {
210
- readonly value: "rgb(82 196 26 / 25%)";
211
- };
212
- readonly 'success-border': {
213
- readonly value: "#52c41a";
214
- };
215
- readonly 'info-contrast': {
216
- readonly value: "#ffffff";
217
- };
218
- readonly 'info-fg': {
219
- readonly value: "#1677ff";
220
- };
221
- readonly 'info-subtle': {
222
- readonly value: "#e6f4ff";
223
- };
224
- readonly 'info-muted': {
225
- readonly value: "#bae0ff";
226
- };
227
- readonly 'info-emphasized': {
228
- readonly value: "#69b1ff";
229
- };
230
- readonly 'info-solid': {
231
- readonly value: "#1677ff";
232
- };
233
- readonly 'info-hover': {
234
- readonly value: "#4096ff";
235
- };
236
- readonly 'info-active': {
237
- readonly value: "#0958d9";
238
- };
239
- readonly 'info-focus-ring': {
240
- readonly value: "rgb(21 112 239 / 25%)";
241
- };
242
- readonly 'info-border': {
243
- readonly value: "#1677ff";
33
+ readonly base: "#d9d9d9";
34
+ readonly muted: "#f0f0f0";
35
+ readonly subtle: "#fafafa";
36
+ readonly emphasized: "#d9d9d9";
37
+ readonly inverted: "#434343";
38
+ readonly danger: "#ff4d4f";
39
+ readonly warning: "#faad14";
40
+ readonly success: "#52c41a";
41
+ readonly info: "#1677ff";
42
+ };
43
+ readonly accent: {
44
+ readonly contrast: "#ffffff";
45
+ readonly fg: "#1677ff";
46
+ readonly subtle: "#e6f4ff";
47
+ readonly muted: "#bae0ff";
48
+ readonly emphasized: "#69b1ff";
49
+ readonly solid: "#1677ff";
50
+ readonly hover: "#4096ff";
51
+ readonly active: "#0958d9";
52
+ readonly 'focus-ring': "rgb(21 112 239 / 25%)";
53
+ readonly border: "#1677ff";
54
+ };
55
+ readonly danger: {
56
+ readonly contrast: "#ffffff";
57
+ readonly fg: "#ff4d4f";
58
+ readonly subtle: "#fff1f0";
59
+ readonly muted: "#ffccc7";
60
+ readonly emphasized: "#ffa39e";
61
+ readonly solid: "#ff4d4f";
62
+ readonly hover: "#ff7875";
63
+ readonly active: "#d9363e";
64
+ readonly 'focus-ring': "rgb(255 77 79 / 25%)";
65
+ readonly border: "#ff4d4f";
66
+ };
67
+ readonly warning: {
68
+ readonly contrast: "#ffffff";
69
+ readonly fg: "#faad14";
70
+ readonly subtle: "#fff7ed";
71
+ readonly muted: "#ffe7ba";
72
+ readonly emphasized: "#ffd666";
73
+ readonly solid: "#faad14";
74
+ readonly hover: "#ffc53d";
75
+ readonly active: "#d48806";
76
+ readonly 'focus-ring': "rgb(250 173 20 / 25%)";
77
+ readonly border: "#faad14";
78
+ };
79
+ readonly success: {
80
+ readonly contrast: "#ffffff";
81
+ readonly fg: "#52c41a";
82
+ readonly subtle: "#f0fdf4";
83
+ readonly muted: "#b7eb8f";
84
+ readonly emphasized: "#95de64";
85
+ readonly solid: "#52c41a";
86
+ readonly hover: "#73d13d";
87
+ readonly active: "#389e0d";
88
+ readonly 'focus-ring': "rgb(82 196 26 / 25%)";
89
+ readonly border: "#52c41a";
90
+ };
91
+ readonly info: {
92
+ readonly contrast: "#ffffff";
93
+ readonly fg: "#1677ff";
94
+ readonly subtle: "#e6f4ff";
95
+ readonly muted: "#bae0ff";
96
+ readonly emphasized: "#69b1ff";
97
+ readonly solid: "#1677ff";
98
+ readonly hover: "#4096ff";
99
+ readonly active: "#0958d9";
100
+ readonly 'focus-ring': "rgb(21 112 239 / 25%)";
101
+ readonly border: "#1677ff";
244
102
  };
245
103
  };
246
- /**
247
- * 默认颜色键列表。
248
- */
249
- export declare const defaultColorKeys: Array<keyof typeof defaultColors>;
250
- /**
251
- * 默认颜色键类型。
252
- */
253
- export type DefaultColorKey = (typeof defaultColorKeys)[number];
254
104
  //#endregion
@@ -3,92 +3,104 @@ import { defineColors } from "../define-colors.js";
3
3
  /**
4
4
  * 默认语义颜色。
5
5
  *
6
- * 颜色键使用扁平 kebab-case 语义名,运行时统一映射为 `--color-*`。
6
+ * 分组内使用 base 表示当前分组自己的颜色。
7
7
  */
8
8
  const defaultColors = defineColors({
9
- bg: { value: "#ffffff" },
10
- "bg-subtle": { value: "#fafafa" },
11
- "bg-muted": { value: "#f4f4f5" },
12
- "bg-emphasized": { value: "#e4e4e7" },
13
- "bg-inverted": { value: "#09090b" },
14
- "bg-panel": { value: "#ffffff" },
15
- "bg-disabled": { value: "rgb(239 239 239)" },
16
- "bg-danger": { value: "#fef2f2" },
17
- "bg-warning": { value: "#fff7ed" },
18
- "bg-success": { value: "#f0fdf4" },
19
- "bg-info": { value: "#e6f4ff" },
20
- fg: { value: "rgb(0 0 0 / 88%)" },
21
- "fg-muted": { value: "rgb(0 0 0 / 45%)" },
22
- "fg-subtle": { value: "rgb(0 0 0 / 25%)" },
23
- "fg-inverted": { value: "#ffffff" },
24
- "fg-disabled": { value: "rgb(0 0 0 / 25%)" },
25
- "fg-danger": { value: "#ff4d4f" },
26
- "fg-warning": { value: "#faad14" },
27
- "fg-success": { value: "#52c41a" },
28
- "fg-info": { value: "#1677ff" },
29
- border: { value: "#d9d9d9" },
30
- "border-muted": { value: "#f0f0f0" },
31
- "border-subtle": { value: "#fafafa" },
32
- "border-emphasized": { value: "#d9d9d9" },
33
- "border-inverted": { value: "#434343" },
34
- "border-danger": { value: "#ff4d4f" },
35
- "border-warning": { value: "#faad14" },
36
- "border-success": { value: "#52c41a" },
37
- "border-info": { value: "#1677ff" },
38
- "accent-contrast": { value: "#ffffff" },
39
- "accent-fg": { value: "#1677ff" },
40
- "accent-subtle": { value: "#e6f4ff" },
41
- "accent-muted": { value: "#bae0ff" },
42
- "accent-emphasized": { value: "#69b1ff" },
43
- "accent-solid": { value: "#1677ff" },
44
- "accent-hover": { value: "#4096ff" },
45
- "accent-active": { value: "#0958d9" },
46
- "accent-focus-ring": { value: "rgb(21 112 239 / 25%)" },
47
- "accent-border": { value: "#1677ff" },
48
- "danger-contrast": { value: "#ffffff" },
49
- "danger-fg": { value: "#ff4d4f" },
50
- "danger-subtle": { value: "#fff1f0" },
51
- "danger-muted": { value: "#ffccc7" },
52
- "danger-emphasized": { value: "#ffa39e" },
53
- "danger-solid": { value: "#ff4d4f" },
54
- "danger-hover": { value: "#ff7875" },
55
- "danger-active": { value: "#d9363e" },
56
- "danger-focus-ring": { value: "rgb(255 77 79 / 25%)" },
57
- "danger-border": { value: "#ff4d4f" },
58
- "warning-contrast": { value: "#ffffff" },
59
- "warning-fg": { value: "#faad14" },
60
- "warning-subtle": { value: "#fff7ed" },
61
- "warning-muted": { value: "#ffe7ba" },
62
- "warning-emphasized": { value: "#ffd666" },
63
- "warning-solid": { value: "#faad14" },
64
- "warning-hover": { value: "#ffc53d" },
65
- "warning-active": { value: "#d48806" },
66
- "warning-focus-ring": { value: "rgb(250 173 20 / 25%)" },
67
- "warning-border": { value: "#faad14" },
68
- "success-contrast": { value: "#ffffff" },
69
- "success-fg": { value: "#52c41a" },
70
- "success-subtle": { value: "#f0fdf4" },
71
- "success-muted": { value: "#b7eb8f" },
72
- "success-emphasized": { value: "#95de64" },
73
- "success-solid": { value: "#52c41a" },
74
- "success-hover": { value: "#73d13d" },
75
- "success-active": { value: "#389e0d" },
76
- "success-focus-ring": { value: "rgb(82 196 26 / 25%)" },
77
- "success-border": { value: "#52c41a" },
78
- "info-contrast": { value: "#ffffff" },
79
- "info-fg": { value: "#1677ff" },
80
- "info-subtle": { value: "#e6f4ff" },
81
- "info-muted": { value: "#bae0ff" },
82
- "info-emphasized": { value: "#69b1ff" },
83
- "info-solid": { value: "#1677ff" },
84
- "info-hover": { value: "#4096ff" },
85
- "info-active": { value: "#0958d9" },
86
- "info-focus-ring": { value: "rgb(21 112 239 / 25%)" },
87
- "info-border": { value: "#1677ff" }
9
+ bg: {
10
+ base: "#ffffff",
11
+ subtle: "#fafafa",
12
+ muted: "#f4f4f5",
13
+ emphasized: "#e4e4e7",
14
+ inverted: "#09090b",
15
+ panel: "#ffffff",
16
+ disabled: "rgb(239 239 239)",
17
+ danger: "#fef2f2",
18
+ warning: "#fff7ed",
19
+ success: "#f0fdf4",
20
+ info: "#e6f4ff"
21
+ },
22
+ fg: {
23
+ base: "rgb(0 0 0 / 88%)",
24
+ muted: "rgb(0 0 0 / 45%)",
25
+ subtle: "rgb(0 0 0 / 25%)",
26
+ inverted: "#ffffff",
27
+ disabled: "rgb(0 0 0 / 25%)",
28
+ danger: "#ff4d4f",
29
+ warning: "#faad14",
30
+ success: "#52c41a",
31
+ info: "#1677ff"
32
+ },
33
+ border: {
34
+ base: "#d9d9d9",
35
+ muted: "#f0f0f0",
36
+ subtle: "#fafafa",
37
+ emphasized: "#d9d9d9",
38
+ inverted: "#434343",
39
+ danger: "#ff4d4f",
40
+ warning: "#faad14",
41
+ success: "#52c41a",
42
+ info: "#1677ff"
43
+ },
44
+ accent: {
45
+ contrast: "#ffffff",
46
+ fg: "#1677ff",
47
+ subtle: "#e6f4ff",
48
+ muted: "#bae0ff",
49
+ emphasized: "#69b1ff",
50
+ solid: "#1677ff",
51
+ hover: "#4096ff",
52
+ active: "#0958d9",
53
+ "focus-ring": "rgb(21 112 239 / 25%)",
54
+ border: "#1677ff"
55
+ },
56
+ danger: {
57
+ contrast: "#ffffff",
58
+ fg: "#ff4d4f",
59
+ subtle: "#fff1f0",
60
+ muted: "#ffccc7",
61
+ emphasized: "#ffa39e",
62
+ solid: "#ff4d4f",
63
+ hover: "#ff7875",
64
+ active: "#d9363e",
65
+ "focus-ring": "rgb(255 77 79 / 25%)",
66
+ border: "#ff4d4f"
67
+ },
68
+ warning: {
69
+ contrast: "#ffffff",
70
+ fg: "#faad14",
71
+ subtle: "#fff7ed",
72
+ muted: "#ffe7ba",
73
+ emphasized: "#ffd666",
74
+ solid: "#faad14",
75
+ hover: "#ffc53d",
76
+ active: "#d48806",
77
+ "focus-ring": "rgb(250 173 20 / 25%)",
78
+ border: "#faad14"
79
+ },
80
+ success: {
81
+ contrast: "#ffffff",
82
+ fg: "#52c41a",
83
+ subtle: "#f0fdf4",
84
+ muted: "#b7eb8f",
85
+ emphasized: "#95de64",
86
+ solid: "#52c41a",
87
+ hover: "#73d13d",
88
+ active: "#389e0d",
89
+ "focus-ring": "rgb(82 196 26 / 25%)",
90
+ border: "#52c41a"
91
+ },
92
+ info: {
93
+ contrast: "#ffffff",
94
+ fg: "#1677ff",
95
+ subtle: "#e6f4ff",
96
+ muted: "#bae0ff",
97
+ emphasized: "#69b1ff",
98
+ solid: "#1677ff",
99
+ hover: "#4096ff",
100
+ active: "#0958d9",
101
+ "focus-ring": "rgb(21 112 239 / 25%)",
102
+ border: "#1677ff"
103
+ }
88
104
  });
89
- /**
90
- * 默认颜色键列表。
91
- */
92
- const defaultColorKeys = Object.keys(defaultColors);
93
105
  //#endregion
94
- export { defaultColorKeys, defaultColors };
106
+ export { defaultColors };
@@ -1,7 +1,7 @@
1
1
  import { ColorSet } from "./types.js";
2
2
  //#region system/define-colors.d.ts
3
3
  /**
4
- * 标注并返回扁平颜色表,保留字面量键供类型自动推导。
4
+ * 标注并返回嵌套颜色配置,保留字面量结构。
5
5
  */
6
6
  export declare const defineColors: <const T extends ColorSet>(colors: T) => T;
7
7
  //#endregion
@@ -1,6 +1,6 @@
1
1
  //#region system/define-colors.ts
2
2
  /**
3
- * 标注并返回扁平颜色表,保留字面量键供类型自动推导。
3
+ * 标注并返回嵌套颜色配置,保留字面量结构。
4
4
  */
5
5
  const defineColors = (colors) => colors;
6
6
  //#endregion
@@ -0,0 +1,11 @@
1
+ import { ColorSet } from "./types.js";
2
+ //#region system/flatten-colors.d.ts
3
+ /**
4
+ * 将嵌套颜色配置展开为扁平 key。
5
+ *
6
+ * bg.base -> bg
7
+ * bg.muted -> bg-muted
8
+ * accent.solid -> accent-solid
9
+ */
10
+ export declare const flattenColors: (colors: ColorSet, prefix?: string, result?: Record<string, string>) => Record<string, string>;
11
+ //#endregion
@@ -0,0 +1,26 @@
1
+ import { isNil, isString } from "@omnific/utils";
2
+ //#region system/flatten-colors.ts
3
+ /**
4
+ * 将嵌套颜色配置展开为扁平 key。
5
+ *
6
+ * bg.base -> bg
7
+ * bg.muted -> bg-muted
8
+ * accent.solid -> accent-solid
9
+ */
10
+ const flattenColors = (colors, prefix = "", result = {}) => {
11
+ const keys = Object.keys(colors);
12
+ for (const key of keys) {
13
+ if (isNil(key)) continue;
14
+ const value = colors[key];
15
+ const path = key === "base" ? prefix : prefix ? `${prefix}-${key}` : key;
16
+ if (isString(value)) {
17
+ result[path] = value;
18
+ continue;
19
+ }
20
+ if (isNil(value)) continue;
21
+ flattenColors(value, path, result);
22
+ }
23
+ return result;
24
+ };
25
+ //#endregion
26
+ export { flattenColors };
@@ -1,9 +1,11 @@
1
- import { DefaultColorKey, defaultColorKeys, defaultColors } from "./defaults/colors.js";
2
- import { ColorSet, ColorValue, SystemContext } from "./types.js";
1
+ import { defaultColors } from "./defaults/colors.js";
2
+ import { DefaultColorKey } from "./defaults/color-keys.gen.js";
3
+ import { ColorSet, ColorValue, FlatColorSet, SystemContext } from "./types.js";
3
4
  import { applyCssVars, toColorVarName } from "./css-vars.js";
4
5
  import { createSystem } from "./create-system.js";
5
6
  import { defaultSystem } from "./default-system.js";
6
7
  import { defineColors } from "./define-colors.js";
8
+ import { flattenColors } from "./flatten-colors.js";
7
9
  import { mergeColors } from "./merge-colors.js";
8
10
  import { useTheme } from "./use-theme.js";
9
- export { type ColorSet, type ColorValue, type DefaultColorKey, type SystemContext, applyCssVars, createSystem, defaultColorKeys, defaultColors, defaultSystem, defineColors, mergeColors, toColorVarName, useTheme };
11
+ export { type ColorSet, type ColorValue, type DefaultColorKey, type FlatColorSet, type SystemContext, applyCssVars, createSystem, defaultColors, defaultSystem, defineColors, flattenColors, mergeColors, toColorVarName, useTheme };
@@ -1,8 +1,9 @@
1
1
  import { applyCssVars, toColorVarName } from "./css-vars.js";
2
+ import { flattenColors } from "./flatten-colors.js";
2
3
  import { mergeColors } from "./merge-colors.js";
3
4
  import { createSystem } from "./create-system.js";
4
5
  import { defineColors } from "./define-colors.js";
5
- import { defaultColorKeys, defaultColors } from "./defaults/colors.js";
6
+ import { defaultColors } from "./defaults/colors.js";
6
7
  import { defaultSystem } from "./default-system.js";
7
8
  import { useTheme } from "./use-theme.js";
8
- export { applyCssVars, createSystem, defaultColorKeys, defaultColors, defaultSystem, defineColors, mergeColors, toColorVarName, useTheme };
9
+ export { applyCssVars, createSystem, defaultColors, defaultSystem, defineColors, flattenColors, mergeColors, toColorVarName, useTheme };
@@ -1,10 +1,12 @@
1
- import { ColorSet } from "./types.js";
1
+ import { ColorSet, FlatColorSet } from "./types.js";
2
2
  //#region system/merge-colors.d.ts
3
3
  /**
4
- * 按传入顺序浅合并扁平颜色表,后写入覆盖同名键,并生成颜色 CSS 变量。
4
+ * 展开并合并嵌套颜色表,输出扁平颜色和 CSS 变量。
5
+ *
6
+ * 后传入的颜色覆盖前面同名 key。
5
7
  */
6
8
  export declare const mergeColors: (...colorSets: ColorSet[]) => {
7
- colors: ColorSet;
9
+ colors: FlatColorSet;
8
10
  cssVars: Readonly<Record<string, string>>;
9
11
  };
10
12
  //#endregion
@@ -1,16 +1,25 @@
1
1
  import { toColorVarName } from "./css-vars.js";
2
+ import { flattenColors } from "./flatten-colors.js";
2
3
  import { isNil } from "@omnific/utils";
3
4
  //#region system/merge-colors.ts
4
5
  /**
5
- * 按传入顺序浅合并扁平颜色表,后写入覆盖同名键,并生成颜色 CSS 变量。
6
+ * 展开并合并嵌套颜色表,输出扁平颜色和 CSS 变量。
7
+ *
8
+ * 后传入的颜色覆盖前面同名 key。
6
9
  */
7
10
  const mergeColors = (...colorSets) => {
8
11
  const colors = {};
12
+ for (const colorSet of colorSets) {
13
+ if (isNil(colorSet)) continue;
14
+ Object.assign(colors, flattenColors(colorSet));
15
+ }
16
+ const colorKeys = Object.keys(colors);
9
17
  const cssVars = {};
10
- for (const next of colorSets) for (const [key, node] of Object.entries(next)) {
11
- if (isNil(node)) continue;
12
- colors[key] = node;
13
- cssVars[toColorVarName(key)] = node.value;
18
+ for (const key of colorKeys) {
19
+ if (isNil(key)) continue;
20
+ const value = colors[key];
21
+ if (isNil(value)) continue;
22
+ cssVars[toColorVarName(key)] = value;
14
23
  }
15
24
  return {
16
25
  colors,
@@ -1,36 +1,34 @@
1
1
  //#region system/types.d.ts
2
2
  /**
3
- * 单个颜色值节点。
3
+ * 颜色叶子值。
4
4
  */
5
- export type ColorValue = {
6
- /**
7
- * CSS 颜色值。
8
- */
9
- value: string;
10
- };
5
+ export type ColorValue = string;
11
6
  /**
12
- * 扁平语义颜色表。
7
+ * 嵌套颜色配置。
13
8
  *
14
- * 只约束值的结构,不枚举颜色键。
15
- * 具体颜色键由 `defineColors` 或 `defaultColors` 自动推导。
9
+ * base 是保留键,表示当前分组自己的颜色。
16
10
  */
17
- export type ColorSet = Record<string, ColorValue>;
11
+ export type ColorSet = {
12
+ [key: string]: ColorValue | ColorSet;
13
+ };
14
+ /**
15
+ * 展开后的扁平颜色表。
16
+ */
17
+ export type FlatColorSet = Record<string, string>;
18
18
  /**
19
19
  * applyCssVars / useTheme 的参数契约。
20
- *
21
- * 不是 createSystem 的返回值类型来源;返回值仍由 createSystem 自动推导。
22
20
  */
23
21
  export type SystemContext = {
24
22
  /**
25
- * 主题名称;同名 system 在注入时复用同一张 `<style>`。
23
+ * 主题名称。
26
24
  */
27
25
  name: string;
28
26
  /**
29
- * 合并后的扁平颜色表。
27
+ * 展开后的扁平颜色表。
30
28
  */
31
- colors: ColorSet;
29
+ colors: FlatColorSet;
32
30
  /**
33
- * 已缓存的颜色 CSS 变量表。
31
+ * 扁平颜色 CSS 变量表。
34
32
  */
35
33
  cssVars: Readonly<Record<string, string>>;
36
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnific/atelier",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A refined React component library for Omnific",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -58,31 +58,28 @@
58
58
  "dist",
59
59
  "README.md"
60
60
  ],
61
+ "scripts": {
62
+ "build": "tsx ../../scripts/build/atelier.ts",
63
+ "test": "vitest run",
64
+ "typecheck": "tsc -p tsconfig.json --noEmit"
65
+ },
61
66
  "dependencies": {
62
- "@omnific/hooks": "0.2.2",
63
- "@omnific/icons": "0.1.0",
64
- "@omnific/types": "0.0.8",
65
- "@omnific/utils": "0.4.0",
67
+ "@omnific/hooks": "workspace:*",
68
+ "@omnific/icons": "workspace:*",
69
+ "@omnific/types": "workspace:*",
70
+ "@omnific/utils": "workspace:*",
66
71
  "clsx": "^2.1.1",
67
- "motion": "^13.4.4"
72
+ "motion": "^14.4.0"
68
73
  },
69
74
  "peerDependencies": {
70
75
  "react": "^19.2.8",
71
76
  "react-dom": "^19.2.8"
72
77
  },
73
78
  "devDependencies": {
74
- "@omnific/tsconfig": "0.2.0",
79
+ "@omnific/tsconfig": "workspace:*",
75
80
  "@types/react": "^19.3.0",
76
81
  "@types/react-dom": "^19.3.0",
77
- "react": "^19.3.0",
78
- "react-dom": "^19.3.0",
79
- "sass-embedded": "^1.105.0"
80
- },
81
- "scripts": {
82
- "dev": "pnpm --dir ../.. storybook",
83
- "build": "tsdown -c tsdown.config.mjs && pnpm build:styles",
84
- "build:styles": "sass --style=expanded --no-source-map styles/index.scss dist/styles.css",
85
- "test": "vitest run",
86
- "typecheck": "tsc -p tsconfig.json --noEmit"
82
+ "react": "^19.3.1",
83
+ "react-dom": "^19.3.1"
87
84
  }
88
- }
85
+ }