@serendie/ui 2.5.1 → 3.0.0-dev.202602170843

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.
Files changed (51) hide show
  1. package/README.md +63 -8
  2. package/dist/client.js +135 -119
  3. package/dist/components/Avatar/Avatar.js +3 -3
  4. package/dist/components/Badge/Badge.d.ts +6 -6
  5. package/dist/components/Badge/Badge.js +21 -21
  6. package/dist/components/Banner/Banner.d.ts +1 -4
  7. package/dist/components/Banner/Banner.js +8 -11
  8. package/dist/components/Button/Button.d.ts +0 -2
  9. package/dist/components/Button/Button.js +10 -11
  10. package/dist/components/CheckBox/CheckBox.js +4 -4
  11. package/dist/components/DatePicker/styles.js +1 -1
  12. package/dist/components/Divider/Divider.d.ts +2 -2
  13. package/dist/components/Divider/Divider.js +11 -11
  14. package/dist/components/Drawer/Drawer.js +3 -3
  15. package/dist/components/DropdownMenu/DropdownMenu.js +5 -5
  16. package/dist/components/IconButton/IconButton.d.ts +0 -1
  17. package/dist/components/IconButton/IconButton.js +0 -1
  18. package/dist/components/ModalDialog/ModalDialog.js +1 -1
  19. package/dist/components/ProgressIndicator/ProgressIndicator.js +9 -9
  20. package/dist/components/Search/Search.js +5 -5
  21. package/dist/components/Select/Select.js +14 -14
  22. package/dist/components/Switch/Switch.js +5 -5
  23. package/dist/components/Toast/Toast.d.ts +3 -5
  24. package/dist/components/Toast/Toast.js +8 -10
  25. package/dist/i18n/index.d.ts +1 -1
  26. package/dist/i18n/provider.d.ts +29 -4
  27. package/dist/i18n/provider.js +31 -11
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.js +135 -119
  30. package/dist/node_modules/@serendie/design-token/dist/panda-tokens.js +310 -0
  31. package/dist/node_modules/@serendie/design-token/dist/tokens.js +126 -0
  32. package/dist/preset.d.ts +310 -0
  33. package/dist/styled-system/css/conditions.js +1 -1
  34. package/dist/styled-system/jsx/is-valid-prop.js +1 -1
  35. package/dist/styles.css +1 -1
  36. package/dist/theme/ThemeContext.d.ts +55 -0
  37. package/dist/theme/ThemeContext.js +15 -0
  38. package/dist/theme/index.d.ts +3 -0
  39. package/dist/theme/index.js +11 -0
  40. package/dist/theme/initColorScheme.d.ts +74 -0
  41. package/dist/theme/initColorScheme.js +32 -0
  42. package/dist/theme/useSystemColorScheme.d.ts +15 -0
  43. package/dist/theme/useSystemColorScheme.js +19 -0
  44. package/dist/tokens/getToken.d.ts +126 -0
  45. package/dist/tokens/index.d.ts +310 -0
  46. package/package.json +2 -2
  47. package/styled-system/css/conditions.js +1 -1
  48. package/styled-system/jsx/is-valid-prop.js +1 -1
  49. package/styled-system/themes/index.d.ts +6 -1
  50. package/styled-system/themes/theme-konjo-dark.json +5 -0
  51. package/styled-system/types/conditions.d.ts +2 -0
@@ -40,9 +40,9 @@ const v = {
40
40
  }, N = {
41
41
  width: 24,
42
42
  height: 24,
43
- color: "sd.system.color.component.outline",
43
+ color: "sd.system.color.component.outlineDim",
44
44
  _disabled: {
45
- color: "color-mix(in srgb, {colors.sd.system.color.component.outline}, {colors.sd.system.color.interaction.hoveredOnPrimary});"
45
+ color: "color-mix(in srgb, {colors.sd.system.color.component.outlineDim}, {colors.sd.system.color.interaction.hoveredOnPrimary});"
46
46
  }
47
47
  }, n = b({
48
48
  slots: [
@@ -93,7 +93,7 @@ const v = {
93
93
  }
94
94
  }
95
95
  }
96
- }), H = ({
96
+ }), F = ({
97
97
  value: m,
98
98
  label: l,
99
99
  helperText: s,
@@ -122,7 +122,7 @@ const v = {
122
122
  );
123
123
  };
124
124
  export {
125
- H as CheckBox,
125
+ F as CheckBox,
126
126
  n as CheckBoxStyle,
127
127
  _ as checkboxCheckedIconCss,
128
128
  v as checkboxIconCss,
@@ -21,7 +21,7 @@ const o = e({
21
21
  zIndex: "sd.system.elevation.zIndex.dropdown"
22
22
  },
23
23
  content: {
24
- background: "sd.system.color.component.surface",
24
+ background: "sd.system.color.component.surfaceContainerBright",
25
25
  borderRadius: "sd.system.dimension.radius.medium",
26
26
  boxShadow: "sd.system.elevation.shadow.level1",
27
27
  flexDirection: "column",
@@ -3,10 +3,10 @@ import { RecipeVariantProps } from '../../../styled-system/css';
3
3
  export declare const DividerStyle: import('../../../styled-system/types').RecipeRuntimeFn<{
4
4
  color: {
5
5
  light: {
6
- borderColor: "sd.reference.color.scale.gray.200";
6
+ borderColor: "sd.system.color.component.outlineBright";
7
7
  };
8
8
  normal: {
9
- borderColor: "sd.reference.color.scale.gray.300";
9
+ borderColor: "sd.system.color.component.outline";
10
10
  };
11
11
  dark: {
12
12
  borderColor: "sd.system.color.component.outlineDim";
@@ -1,17 +1,17 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { cva as n } from "../../styled-system/css/cva.js";
3
- import { cx as l } from "../../styled-system/css/cx.js";
4
- const r = n({
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { cva as d } from "../../styled-system/css/cva.js";
3
+ import { cx as m } from "../../styled-system/css/cx.js";
4
+ const o = d({
5
5
  base: {
6
6
  border: "none"
7
7
  },
8
8
  variants: {
9
9
  color: {
10
10
  light: {
11
- borderColor: "sd.reference.color.scale.gray.200"
11
+ borderColor: "sd.system.color.component.outlineBright"
12
12
  },
13
13
  normal: {
14
- borderColor: "sd.reference.color.scale.gray.300"
14
+ borderColor: "sd.system.color.component.outline"
15
15
  },
16
16
  dark: {
17
17
  borderColor: "sd.system.color.component.outlineDim"
@@ -37,11 +37,11 @@ const r = n({
37
37
  color: "normal",
38
38
  type: "horizontal"
39
39
  }
40
- }), h = (e) => {
41
- const [o, s] = r.splitVariantProps(e), { className: t, ...i } = s;
42
- return /* @__PURE__ */ d("hr", { className: l(r(o), t), ...i });
40
+ }), p = (e) => {
41
+ const [r, t] = o.splitVariantProps(e), { className: s, ...i } = t;
42
+ return /* @__PURE__ */ n("hr", { className: m(o(r), s), ...i });
43
43
  };
44
44
  export {
45
- h as Divider,
46
- r as DividerStyle
45
+ p as Divider,
46
+ o as DividerStyle
47
47
  };
@@ -25,7 +25,7 @@ const n = h({
25
25
  maxWidth: "375px",
26
26
  height: "100vh",
27
27
  gap: "sd.system.dimension.spacing.twoExtraLarge",
28
- backgroundColor: "sd.system.color.component.surface",
28
+ backgroundColor: "sd.system.color.component.surfaceContainerBright",
29
29
  boxShadow: "sd.system.elevation.shadow.level5",
30
30
  zIndex: "sd.system.elevation.zIndex.modal"
31
31
  },
@@ -68,7 +68,7 @@ const n = h({
68
68
  defaultVariants: {
69
69
  type: "right"
70
70
  }
71
- }), W = ({
71
+ }), N = ({
72
72
  isOpen: r,
73
73
  children: i,
74
74
  contentClassName: a,
@@ -92,5 +92,5 @@ const n = h({
92
92
  ] }) });
93
93
  };
94
94
  export {
95
- W as Drawer
95
+ N as Drawer
96
96
  };
@@ -8,16 +8,16 @@ import { sva as b } from "../../styled-system/css/sva.js";
8
8
  import { MenuRoot as S } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-root.js";
9
9
  import { MenuTrigger as I } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-trigger.js";
10
10
  import { MenuPositioner as v } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-positioner.js";
11
- import { MenuContent as _ } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-content.js";
12
- import { MenuItemGroup as C } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js";
11
+ import { MenuContent as C } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-content.js";
12
+ import { MenuItemGroup as _ } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js";
13
13
  import { MenuItem as M } from "../../node_modules/@ark-ui/react/dist/components/menu/menu-item.js";
14
14
  const w = b({
15
15
  slots: ["content", "itemGroup", "item", "itemIcon", "button", "buttonIcon"],
16
16
  base: {
17
17
  content: {
18
- bgColor: "sd.system.color.component.surface",
18
+ bgColor: "sd.system.color.component.surfaceContainerBright",
19
19
  borderRadius: "sd.system.dimension.radius.medium",
20
- bg: "sd.system.color.component.surface",
20
+ bg: "sd.system.color.component.surfaceContainerBright",
21
21
  boxShadow: "sd.system.elevation.shadow.level1",
22
22
  outline: "none",
23
23
  zIndex: "sd.system.elevation.zIndex.dropdown"
@@ -126,7 +126,7 @@ const w = b({
126
126
  children: n
127
127
  }
128
128
  ) }),
129
- /* @__PURE__ */ e(x, { disabled: !i, container: p, children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(_, { className: o.content, children: /* @__PURE__ */ e(C, { className: o.itemGroup, children: a.map((t) => /* @__PURE__ */ m(
129
+ /* @__PURE__ */ e(x, { disabled: !i, container: p, children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(C, { className: o.content, children: /* @__PURE__ */ e(_, { className: o.itemGroup, children: a.map((t) => /* @__PURE__ */ m(
130
130
  M,
131
131
  {
132
132
  value: t.value,
@@ -27,7 +27,6 @@ export declare const IconButtonStyle: import('../../../styled-system/types').Rec
27
27
  };
28
28
  outlined: {
29
29
  outlineColor: "sd.system.color.component.outline";
30
- bgColor: "sd.system.color.component.surface";
31
30
  _enabled: {
32
31
  _hover: {
33
32
  bgColor: "sd.system.color.interaction.hoveredVariant";
@@ -52,7 +52,6 @@ const e = a({
52
52
  },
53
53
  outlined: {
54
54
  outlineColor: "sd.system.color.component.outline",
55
- bgColor: "sd.system.color.component.surface",
56
55
  _enabled: {
57
56
  _hover: {
58
57
  bgColor: "sd.system.color.interaction.hoveredVariant"
@@ -44,7 +44,7 @@ const N = f({
44
44
  paddingRight: "sd.system.dimension.spacing.extraLarge",
45
45
  paddingBottom: "sd.system.dimension.spacing.large",
46
46
  paddingLeft: "sd.system.dimension.spacing.extraLarge",
47
- backgroundColor: "sd.system.color.component.surface",
47
+ backgroundColor: "sd.system.color.component.surfaceContainerBright",
48
48
  boxShadow: "sd.system.elevation.shadow.level5",
49
49
  borderRadius: "sd.system.dimension.radius.medium",
50
50
  zIndex: "sd.system.elevation.zIndex.modal"
@@ -2,8 +2,8 @@ import { jsx as a, jsxs as f } from "react/jsx-runtime";
2
2
  import { useMemo as v } from "react";
3
3
  import { describeArc as b } from "./util.js";
4
4
  import { cx as h } from "../../styled-system/css/cx.js";
5
- import { cva as c } from "../../styled-system/css/cva.js";
6
- const u = c({
5
+ import { cva as n } from "../../styled-system/css/cva.js";
6
+ const u = n({
7
7
  base: {
8
8
  position: "relative",
9
9
  display: "flex",
@@ -74,10 +74,10 @@ const u = c({
74
74
  type: "linear",
75
75
  size: "medium"
76
76
  }
77
- }), p = c({
77
+ }), p = n({
78
78
  base: {
79
79
  position: "absolute",
80
- backgroundColor: "sd.reference.color.scale.gray.100",
80
+ backgroundColor: "sd.system.color.component.surfaceContainerDim",
81
81
  overflow: "hidden"
82
82
  },
83
83
  variants: {
@@ -101,7 +101,7 @@ const u = c({
101
101
  }
102
102
  },
103
103
  compoundVariants: []
104
- }), g = c({
104
+ }), g = n({
105
105
  base: {
106
106
  position: "absolute",
107
107
  backgroundColor: "sd.system.color.impression.primary"
@@ -138,7 +138,7 @@ const u = c({
138
138
  max: o = 1,
139
139
  type: i = "linear",
140
140
  size: s = "medium",
141
- className: n,
141
+ className: c,
142
142
  style: d,
143
143
  ...m
144
144
  }) => {
@@ -157,7 +157,7 @@ const u = c({
157
157
  return /* @__PURE__ */ a(
158
158
  "div",
159
159
  {
160
- className: h(u({ type: i, size: s }), n),
160
+ className: h(u({ type: i, size: s }), c),
161
161
  role: "progressbar",
162
162
  "aria-valuenow": t,
163
163
  "aria-valuemin": 0,
@@ -177,7 +177,7 @@ const u = c({
177
177
  cy: r + e,
178
178
  r,
179
179
  className: p({ type: i, size: s }),
180
- stroke: "var(--colors-sd-reference-color-scale-gray-100)",
180
+ stroke: "var(--colors-sd-system-color-component-surface-container-dim)",
181
181
  strokeWidth: e
182
182
  }
183
183
  ),
@@ -198,7 +198,7 @@ const u = c({
198
198
  return /* @__PURE__ */ a(
199
199
  "div",
200
200
  {
201
- className: h(u({ type: i, size: s }), n),
201
+ className: h(u({ type: i, size: s }), c),
202
202
  role: "progressbar",
203
203
  "aria-valuenow": t,
204
204
  "aria-valuemin": 0,
@@ -64,7 +64,7 @@ const h = M({
64
64
  }
65
65
  },
66
66
  combobox: {
67
- bgColor: "sd.system.color.component.surface",
67
+ bgColor: "sd.system.color.component.surfaceContainerBright",
68
68
  borderRadius: "sd.system.dimension.radius.medium",
69
69
  boxShadow: "sd.system.elevation.shadow.level1",
70
70
  zIndex: "sd.system.elevation.zIndex.dropdown",
@@ -157,10 +157,10 @@ const h = M({
157
157
  () => !!(e.inputValue || e.defaultInputValue)
158
158
  ), m = l.useRef(null), R = l.useMemo(() => a ? r.filter(
159
159
  (o) => o.toLowerCase().includes(a.toLowerCase())
160
- ) : r, [r, a]), f = j({ items: R }), _ = (o) => {
160
+ ) : r, [r, a]), f = j({ items: R }), B = (o) => {
161
161
  var n;
162
162
  d || g(o.inputValue), c(o.inputValue.length > 0), (n = e.onInputValueChange) == null || n.call(e, o);
163
- }, B = (o) => {
163
+ }, _ = (o) => {
164
164
  var n;
165
165
  o.value.length > 0 && (i == null || i(o.value[0])), (n = e.onValueChange) == null || n.call(e, o);
166
166
  }, N = (o) => {
@@ -180,8 +180,8 @@ const h = M({
180
180
  collection: f,
181
181
  openOnClick: !0,
182
182
  allowCustomValue: x,
183
- onInputValueChange: _,
184
- onValueChange: B,
183
+ onInputValueChange: B,
184
+ onValueChange: _,
185
185
  onHighlightChange: N,
186
186
  lazyMount: !0,
187
187
  unmountOnExit: !0,
@@ -6,8 +6,8 @@ import { useAutoPortalContainer as R } from "../../hooks/useAutoPortalContainer.
6
6
  import { useTranslations as z } from "../../i18n/index.js";
7
7
  import { createListCollection as P } from "../../node_modules/@ark-ui/react/dist/components/collection/list-collection.js";
8
8
  import { Portal as V } from "../../node_modules/@ark-ui/react/dist/components/portal/portal.js";
9
- import { sva as L } from "../../styled-system/css/sva.js";
10
- import { SelectRoot as B } from "../../node_modules/@ark-ui/react/dist/components/select/select-root.js";
9
+ import { sva as B } from "../../styled-system/css/sva.js";
10
+ import { SelectRoot as L } from "../../node_modules/@ark-ui/react/dist/components/select/select-root.js";
11
11
  import { cx as I } from "../../styled-system/css/cx.js";
12
12
  import { SelectLabel as A } from "../../node_modules/@ark-ui/react/dist/components/select/select-label.js";
13
13
  import { css as r } from "../../styled-system/css/css.js";
@@ -17,7 +17,7 @@ import { SelectValueText as W } from "../../node_modules/@ark-ui/react/dist/comp
17
17
  import { SelectPositioner as E } from "../../node_modules/@ark-ui/react/dist/components/select/select-positioner.js";
18
18
  import { SelectContent as k } from "../../node_modules/@ark-ui/react/dist/components/select/select-content.js";
19
19
  import { SelectItem as q } from "../../node_modules/@ark-ui/react/dist/components/select/select-item.js";
20
- const c = L({
20
+ const c = B({
21
21
  slots: ["root", "valueText", "trigger", "content", "item", "iconBox"],
22
22
  base: {
23
23
  root: {
@@ -82,7 +82,7 @@ const c = L({
82
82
  }
83
83
  },
84
84
  content: {
85
- bgColor: "sd.system.color.component.surface",
85
+ bgColor: "sd.system.color.component.surfaceContainerBright",
86
86
  borderRadius: "sd.system.dimension.radius.medium",
87
87
  boxShadow: "sd.system.elevation.shadow.level1",
88
88
  zIndex: "sd.system.elevation.zIndex.dropdown",
@@ -164,19 +164,19 @@ const c = L({
164
164
  required: y,
165
165
  requiredLabel: g,
166
166
  invalid: d,
167
- invalidMessage: m,
167
+ invalidMessage: n,
168
168
  className: u,
169
- items: x = [],
170
- portalled: n = !0,
171
- ...h
169
+ items: h = [],
170
+ portalled: m = !0,
171
+ ...x
172
172
  }) => {
173
- const b = z(), [t, f] = c.splitVariantProps(h), o = c(t), { collection: D, ...S } = f, { triggerRef: v, portalContainerRef: w } = R(n), l = P({
174
- items: x,
173
+ const b = z(), [t, f] = c.splitVariantProps(x), o = c(t), { collection: D, ...S } = f, { triggerRef: v, portalContainerRef: w } = R(m), l = P({
174
+ items: h,
175
175
  itemToString: (s) => s.label,
176
176
  itemToValue: (s) => s.value
177
177
  });
178
178
  return /* @__PURE__ */ i(
179
- B,
179
+ L,
180
180
  {
181
181
  ...S,
182
182
  collection: l,
@@ -225,7 +225,7 @@ const c = L({
225
225
  ),
226
226
  /* @__PURE__ */ e(C, { className: o.iconBox })
227
227
  ] }) }),
228
- d && m && /* @__PURE__ */ e(
228
+ d && n && /* @__PURE__ */ e(
229
229
  "div",
230
230
  {
231
231
  className: r({
@@ -235,10 +235,10 @@ const c = L({
235
235
  },
236
236
  color: "sd.system.color.impression.negative"
237
237
  }),
238
- children: m
238
+ children: n
239
239
  }
240
240
  ),
241
- /* @__PURE__ */ e(V, { disabled: !n, container: w, children: /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(k, { className: o.content, children: /* @__PURE__ */ e(T, { children: l.items.map((s, _) => /* @__PURE__ */ e(q, { item: s, children: /* @__PURE__ */ e(
241
+ /* @__PURE__ */ e(V, { disabled: !m, container: w, children: /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(k, { className: o.content, children: /* @__PURE__ */ e(T, { children: l.items.map((s, _) => /* @__PURE__ */ e(q, { item: s, children: /* @__PURE__ */ e(
242
242
  N,
243
243
  {
244
244
  title: s.label,
@@ -35,8 +35,8 @@ const n = u({
35
35
  transitionProperty: "background, borderColor",
36
36
  transitionTimingFunction: "cubic-bezier(.2, 0, 0, 1)",
37
37
  _checked: {
38
- backgroundColor: "sd.system.color.impression.primary",
39
- borderColor: "sd.system.color.impression.primary",
38
+ backgroundColor: "sd.system.color.impression.primaryContainer",
39
+ borderColor: "sd.system.color.impression.primaryContainer",
40
40
  _disabled: {
41
41
  backgroundColor: "color-mix(in srgb, {colors.sd.system.color.impression.primary}, {colors.sd.system.color.interaction.hoveredOnPrimary});",
42
42
  borderColor: "transparent"
@@ -97,7 +97,7 @@ const n = u({
97
97
  }
98
98
  }
99
99
  }), F = y(
100
- ({ label: d, helperText: s, className: a, ...l }, m) => {
100
+ ({ label: a, helperText: s, className: d, ...l }, m) => {
101
101
  const [c, p] = n.splitVariantProps(l), o = n(c);
102
102
  return /* @__PURE__ */ e(
103
103
  b,
@@ -107,12 +107,12 @@ const n = u({
107
107
  "group",
108
108
  o.root,
109
109
  s && x({ alignItems: "flex-start" }),
110
- a
110
+ d
111
111
  ),
112
112
  ...p,
113
113
  children: [
114
114
  /* @__PURE__ */ e("div", { className: o.textGroup, children: [
115
- /* @__PURE__ */ r(i, { className: o.label, children: d }),
115
+ /* @__PURE__ */ r(i, { className: o.label, children: a }),
116
116
  s && /* @__PURE__ */ r(i, { className: o.helperText, children: s })
117
117
  ] }),
118
118
  /* @__PURE__ */ r(h, { className: t("control", o.control), children: /* @__PURE__ */ r(g, { className: o.thumb }) }),
@@ -3,20 +3,18 @@ export declare const ToastStyle: import('../../../styled-system/types').SlotReci
3
3
  variant: {
4
4
  default: {
5
5
  root: {
6
- background: "sd.system.color.component.inverseSurface";
6
+ background: "sd.system.color.impression.positiveContainer";
7
7
  };
8
8
  text: {
9
- color: "sd.system.color.component.inverseOnSurface";
9
+ color: "sd.system.color.impression.onPositiveContainer";
10
10
  };
11
11
  icon: {
12
- color: "sd.system.color.impression.positive";
12
+ color: "sd.system.color.impression.onPositiveContainer";
13
13
  };
14
14
  };
15
15
  error: {
16
16
  root: {
17
17
  background: "sd.system.color.impression.negativeContainer";
18
- borderColor: "sd.system.color.impression.negative";
19
- borderWidth: number;
20
18
  };
21
19
  text: {
22
20
  color: "sd.system.color.impression.negative";
@@ -35,20 +35,18 @@ const x = d({
35
35
  variant: {
36
36
  default: {
37
37
  root: {
38
- background: "sd.system.color.component.inverseSurface"
38
+ background: "sd.system.color.impression.positiveContainer"
39
39
  },
40
40
  text: {
41
- color: "sd.system.color.component.inverseOnSurface"
41
+ color: "sd.system.color.impression.onPositiveContainer"
42
42
  },
43
43
  icon: {
44
- color: "sd.system.color.impression.positive"
44
+ color: "sd.system.color.impression.onPositiveContainer"
45
45
  }
46
46
  },
47
47
  error: {
48
48
  root: {
49
- background: "sd.system.color.impression.negativeContainer",
50
- borderColor: "sd.system.color.impression.negative",
51
- borderWidth: 1
49
+ background: "sd.system.color.impression.negativeContainer"
52
50
  },
53
51
  text: {
54
52
  color: "sd.system.color.impression.negative"
@@ -62,9 +60,9 @@ const x = d({
62
60
  defaultVariants: {
63
61
  variant: "default"
64
62
  }
65
- }), T = m({
63
+ }), C = m({
66
64
  placement: "bottom"
67
- }), C = ({ toaster: r }) => /* @__PURE__ */ o(c, { toaster: r, children: (t) => {
65
+ }), T = ({ toaster: r }) => /* @__PURE__ */ o(c, { toaster: r, children: (t) => {
68
66
  const s = t.type === "error" ? "error" : "default", e = x({ variant: s }), i = s === "error" ? /* @__PURE__ */ o(n, { className: e.icon }) : /* @__PURE__ */ o(l, { className: e.icon });
69
67
  return /* @__PURE__ */ o(p, { className: e.root, children: /* @__PURE__ */ a("div", { className: e.textGroup, children: [
70
68
  i,
@@ -72,7 +70,7 @@ const x = d({
72
70
  ] }) }, t.id);
73
71
  } });
74
72
  export {
75
- C as Toast,
73
+ T as Toast,
76
74
  x as ToastStyle,
77
- T as toaster
75
+ C as toaster
78
76
  };
@@ -1,6 +1,6 @@
1
1
  import { dictionary } from './dictionary';
2
2
  import { Language } from './provider';
3
- export { SerendieProvider, LanguageProvider, type Language } from './provider';
3
+ export { SerendieProvider, LanguageProvider, type Language, type SerendieProviderProps, } from './provider';
4
4
  export type TranslationKey = keyof typeof dictionary.ja;
5
5
  /**
6
6
  * 翻訳関数を生成するヘルパー
@@ -1,13 +1,38 @@
1
+ import { ColorMode, ColorTheme } from '../theme/ThemeContext';
1
2
  export type Language = "ja" | "en";
2
3
  export declare const LanguageContext: import('react').Context<Language | undefined>;
4
+ export interface SerendieProviderProps {
5
+ /** 言語設定 */
6
+ lang: Language;
7
+ /** カラーテーマ(デフォルト: 'konjo') */
8
+ colorTheme?: ColorTheme;
9
+ /** カラーモード(デフォルト: undefined = ライトモード) */
10
+ colorMode?: ColorMode;
11
+ children: React.ReactNode;
12
+ }
3
13
  /**
4
14
  * Serendie UIの設定を提供するProvider
5
15
  * アプリケーションのルートで使用してください
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * // 基本的な使い方(言語のみ)
20
+ * <SerendieProvider lang="ja">
21
+ * <App />
22
+ * </SerendieProvider>
23
+ *
24
+ * // カラーモードを指定(OSの設定に従う)
25
+ * <SerendieProvider lang="ja" colorMode="system">
26
+ * <App />
27
+ * </SerendieProvider>
28
+ *
29
+ * // カラーテーマとモードを指定
30
+ * <SerendieProvider lang="ja" colorTheme="asagi" colorMode="system">
31
+ * <App />
32
+ * </SerendieProvider>
33
+ * ```
6
34
  */
7
- export declare function SerendieProvider({ lang, children, }: {
8
- lang: Language;
9
- children: React.ReactNode;
10
- }): import("react/jsx-runtime").JSX.Element;
35
+ export declare function SerendieProvider({ lang, colorTheme, colorMode, children, }: SerendieProviderProps): import("react/jsx-runtime").JSX.Element;
11
36
  /**
12
37
  * @deprecated LanguageProvider は SerendieProvider にリネームされました
13
38
  */
@@ -1,15 +1,35 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { createContext as t } from "react";
3
- const n = t(void 0);
4
- function i({
5
- lang: e,
6
- children: r
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useMemo as m, useEffect as u, createContext as f } from "react";
3
+ import { resolveTheme as c, ThemeContext as v } from "../theme/ThemeContext.js";
4
+ import { useSystemColorScheme as h } from "../theme/useSystemColorScheme.js";
5
+ const l = f(void 0);
6
+ function p({
7
+ lang: d,
8
+ colorTheme: t = "konjo",
9
+ colorMode: o,
10
+ children: i
7
11
  }) {
8
- return /* @__PURE__ */ o(n.Provider, { value: e, children: r });
12
+ const r = h() === "dark", e = m(() => c(t, o ?? "light", r), [t, o, r]);
13
+ u(() => {
14
+ if (typeof document > "u") return;
15
+ const n = document.documentElement;
16
+ return e ? n.dataset.pandaTheme = e : delete n.dataset.pandaTheme, () => {
17
+ };
18
+ }, [e]);
19
+ const a = m(
20
+ () => ({
21
+ colorTheme: t,
22
+ colorMode: o ?? "light",
23
+ resolvedTheme: e,
24
+ systemPrefersDark: r
25
+ }),
26
+ [t, o, e, r]
27
+ );
28
+ return /* @__PURE__ */ s(l.Provider, { value: d, children: /* @__PURE__ */ s(v.Provider, { value: a, children: i }) });
9
29
  }
10
- const u = i;
30
+ const S = p;
11
31
  export {
12
- n as LanguageContext,
13
- u as LanguageProvider,
14
- i as SerendieProvider
32
+ l as LanguageContext,
33
+ S as LanguageProvider,
34
+ p as SerendieProvider
15
35
  };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { SerendiePreset } from './preset';
2
+ export { ThemeContext, useThemeContext, useSystemColorScheme, resolveTheme, getColorSchemeScript, ColorSchemeScript, type ColorMode, type ColorTheme, type ThemeContextValue, type ColorSchemeScriptOptions, } from './theme/index';
3
+ export { SerendieProvider, LanguageProvider, useTranslations, getTranslations, formatDateByLang, type Language, type SerendieProviderProps, } from './i18n/index';
2
4
  export * from './components/Accordion/index.ts';
3
5
  export * from './components/Avatar/index.ts';
4
6
  export * from './components/Badge/index.ts';