@serendie/ui 3.5.1 → 3.6.0-dev.202606260532

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 (59) hide show
  1. package/dist/client.js +128 -124
  2. package/dist/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  3. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +84 -0
  4. package/dist/components/Breadcrumbs/Breadcrumbs.js +268 -0
  5. package/dist/components/Breadcrumbs/index.d.ts +2 -0
  6. package/dist/components/Breadcrumbs/index.js +6 -0
  7. package/dist/components/DataTable/DataTable.sampleData.d.ts +12 -0
  8. package/dist/components/DataTable/DataTable.sampleData.test.d.ts +1 -0
  9. package/dist/components/DataTable/DataTableComponent.d.ts +1 -1
  10. package/dist/components/DataTable/table/BodyCheckbox.d.ts +1 -1
  11. package/dist/components/Divider/Divider.d.ts +1 -1
  12. package/dist/components/List/List.d.ts +1 -1
  13. package/dist/components/List/ListItem.d.ts +42 -12
  14. package/dist/components/List/ListItem.js +122 -75
  15. package/dist/components/ProgressIndicator/AnimatedArc.d.ts +1 -0
  16. package/dist/components/ProgressIndicator/AnimatedArc.js +31 -34
  17. package/dist/components/ProgressIndicator/AnimatedArc.test.d.ts +1 -0
  18. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
  19. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +2 -1
  20. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +49 -36
  21. package/dist/components/ProgressIndicator/animatedArcProps.d.ts +11 -0
  22. package/dist/components/ProgressIndicator/animatedArcProps.js +19 -0
  23. package/dist/components/Tabs/TabItem.d.ts +1 -1
  24. package/dist/components/Tabs/Tabs.d.ts +1 -1
  25. package/dist/i18n/dictionary.d.ts +4 -0
  26. package/dist/i18n/dictionary.js +8 -4
  27. package/dist/i18n/provider.d.ts +1 -1
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +128 -124
  30. package/dist/node_modules/@zag-js/accordion/dist/accordion.connect.js +49 -50
  31. package/dist/node_modules/@zag-js/combobox/dist/combobox.connect.js +70 -68
  32. package/dist/node_modules/@zag-js/combobox/dist/combobox.machine.js +1 -1
  33. package/dist/node_modules/@zag-js/date-picker/dist/date-picker.connect.js +322 -308
  34. package/dist/node_modules/@zag-js/date-picker/dist/date-picker.machine.js +93 -79
  35. package/dist/node_modules/@zag-js/date-picker/dist/date-picker.utils.js +35 -43
  36. package/dist/node_modules/@zag-js/date-utils/dist/locale.js +12 -0
  37. package/dist/node_modules/@zag-js/dialog/dist/dialog.dom.js +36 -35
  38. package/dist/node_modules/@zag-js/dialog/dist/dialog.machine.js +27 -37
  39. package/dist/node_modules/@zag-js/dismissable/dist/dismissable-layer.js +56 -41
  40. package/dist/node_modules/@zag-js/dismissable/dist/layer-stack.js +51 -31
  41. package/dist/node_modules/@zag-js/dismissable/dist/pointer-event-outside.js +46 -25
  42. package/dist/node_modules/@zag-js/dom-query/dist/controller.js +5 -5
  43. package/dist/node_modules/@zag-js/dom-query/dist/overflow.js +13 -21
  44. package/dist/node_modules/@zag-js/dom-query/dist/scroll.js +11 -0
  45. package/dist/node_modules/@zag-js/live-region/dist/index.js +29 -19
  46. package/dist/node_modules/@zag-js/menu/dist/menu.connect.js +138 -135
  47. package/dist/node_modules/@zag-js/menu/dist/menu.dom.js +24 -24
  48. package/dist/node_modules/@zag-js/menu/dist/menu.machine.js +1 -1
  49. package/dist/node_modules/@zag-js/popper/dist/get-placement.js +82 -71
  50. package/dist/node_modules/@zag-js/react/dist/machine.js +105 -96
  51. package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +34 -26
  52. package/dist/node_modules/@zag-js/select/dist/select.connect.js +104 -101
  53. package/dist/node_modules/@zag-js/select/dist/select.machine.js +1 -1
  54. package/dist/node_modules/@zag-js/tabs/dist/tabs.machine.js +63 -60
  55. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +27 -25
  56. package/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +15 -14
  57. package/dist/styles.css +1 -1
  58. package/dist/theme/initColorScheme.d.ts +1 -1
  59. package/package.json +8 -8
@@ -2,5 +2,5 @@ import { TableOptions } from '@tanstack/react-table';
2
2
  export interface DataTableComponentProps<TData = Record<string, unknown>> extends Omit<TableOptions<TData>, "getCoreRowModel" | "getSortedRowModel"> {
3
3
  className?: string;
4
4
  }
5
- export declare function DataTableComponent<TData = Record<string, unknown>>({ className, enableRowSelection, onRowSelectionChange, onSortingChange, state, ...tableOptions }: DataTableComponentProps<TData>): import("react/jsx-runtime").JSX.Element;
5
+ export declare function DataTableComponent<TData = Record<string, unknown>>({ className, enableRowSelection, onRowSelectionChange, onSortingChange, state, ...tableOptions }: DataTableComponentProps<TData>): import("react").JSX.Element;
6
6
  export default DataTableComponent;
@@ -1,4 +1,4 @@
1
1
  import { ChoiceBoxProps } from '../../ChoiceBox';
2
2
  export declare const BodyCheckbox: ({ checked, onChange, value, state, ...props }: {
3
3
  state?: "enabled" | "hovered" | "selected";
4
- } & Omit<ChoiceBoxProps, "type">) => import("react/jsx-runtime").JSX.Element;
4
+ } & Omit<ChoiceBoxProps, "type">) => import("react").JSX.Element;
@@ -29,5 +29,5 @@ export declare const DividerStyle: import('../../../styled-system/types').Recipe
29
29
  };
30
30
  }>;
31
31
  type DividerProps = ComponentProps<"hr"> & RecipeVariantProps<typeof DividerStyle>;
32
- export declare const Divider: (props: DividerProps) => import("react/jsx-runtime").JSX.Element;
32
+ export declare const Divider: (props: DividerProps) => import("react").JSX.Element;
33
33
  export {};
@@ -1,2 +1,2 @@
1
1
  import { ComponentProps } from 'react';
2
- export declare const List: ({ children, ...props }: ComponentProps<"ul">) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const List: ({ children, ...props }: ComponentProps<"ul">) => import("react").JSX.Element;
@@ -1,8 +1,19 @@
1
- import { ComponentProps } from 'react';
2
- export declare const ListItemStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"title" | "description" | "root" | "badge" | "leftIcon" | "rightIcon" | "wrapper" | "textGroup", {
3
- isLargeLeftIcon: {
1
+ import { default as React, ComponentProps } from 'react';
2
+ export declare const ListItemStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"title" | "description" | "root" | "badge" | "wrapper" | "textGroup" | "subDescription" | "trailingElement" | "headingElement", {
3
+ isLargeHeadingElement: {
4
4
  true: {
5
- leftIcon: {
5
+ headingElement: {
6
+ "& svg": {
7
+ width: "40px";
8
+ height: "40px";
9
+ };
10
+ };
11
+ };
12
+ false: {};
13
+ };
14
+ isLargeTrailingElement: {
15
+ true: {
16
+ trailingElement: {
6
17
  "& svg": {
7
18
  width: "40px";
8
19
  height: "40px";
@@ -22,25 +33,44 @@ export declare const ListItemStyle: import('../../../styled-system/types').SlotR
22
33
  type ListItemBaseProps = {
23
34
  title: string;
24
35
  description?: string;
25
- rightIcon?: React.ReactElement;
26
- leftIcon?: React.ReactElement;
27
- isLargeLeftIcon?: boolean;
36
+ subDescription?: string;
37
+ trailingElement?: React.ReactElement;
38
+ headingElement?: React.ReactElement;
39
+ isLargeHeadingElement?: boolean;
40
+ isLargeTrailingElement?: boolean;
28
41
  badge?: number;
29
42
  children?: React.ReactNode;
30
43
  disabled?: boolean;
31
44
  selected?: boolean;
32
45
  focusVisible?: boolean;
33
46
  size?: "small";
47
+ /** @deprecated `leftIcon` は廃止予定です。`headingElement` を使ってください */
48
+ leftIcon?: React.ReactElement;
49
+ /** @deprecated `rightIcon` は廃止予定です。`trailingElement` を使ってください */
50
+ rightIcon?: React.ReactElement;
51
+ /** @deprecated `isLargeLeftIcon` は廃止予定です。`isLargeHeadingElement` を使ってください */
52
+ isLargeLeftIcon?: boolean;
53
+ /** @deprecated `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください */
54
+ isLargeRightIcon?: boolean;
34
55
  };
35
- type ExclusiveRightItemProps = ({
56
+ type ExclusiveTrailingItemProps = ({
36
57
  badge?: number;
37
58
  } & {
59
+ trailingElement?: never;
60
+ isLargeTrailingElement?: never;
61
+ /** @deprecated `rightIcon` は廃止予定です。`trailingElement` を使ってください */
38
62
  rightIcon?: never;
39
- }) | ({
63
+ /** @deprecated `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください */
64
+ isLargeRightIcon?: never;
65
+ }) | {
40
66
  badge?: never;
41
- } & {
67
+ trailingElement?: React.ReactElement;
68
+ isLargeTrailingElement?: boolean;
69
+ /** @deprecated `rightIcon` は廃止予定です。`trailingElement` を使ってください */
42
70
  rightIcon?: React.ReactElement;
43
- });
44
- type ListItemProps = ComponentProps<"li"> & ListItemBaseProps & ExclusiveRightItemProps;
71
+ /** @deprecated `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください */
72
+ isLargeRightIcon?: boolean;
73
+ };
74
+ type ListItemProps = ComponentProps<"li"> & ListItemBaseProps & ExclusiveTrailingItemProps;
45
75
  export declare const ListItem: React.FC<ListItemProps>;
46
76
  export {};
@@ -1,17 +1,19 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import { NotificationBadge as b } from "../NotificationBadge/NotificationBadge.js";
3
- import { cx as o } from "../../styled-system/css/cx.js";
4
- import { css as c } from "../../styled-system/css/css.js";
5
- import { sva as v } from "../../styled-system/css/sva.js";
6
- const p = v({
1
+ import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
+ import { useRef as D, useEffect as G } from "react";
3
+ import { NotificationBadge as O } from "../NotificationBadge/NotificationBadge.js";
4
+ import { cx as i } from "../../styled-system/css/cx.js";
5
+ import { css as g } from "../../styled-system/css/css.js";
6
+ import { sva as P } from "../../styled-system/css/sva.js";
7
+ const E = P({
7
8
  slots: [
8
9
  "root",
9
10
  "wrapper",
10
11
  "textGroup",
11
12
  "title",
12
13
  "description",
13
- "rightIcon",
14
- "leftIcon",
14
+ "subDescription",
15
+ "trailingElement",
16
+ "headingElement",
15
17
  "badge"
16
18
  ],
17
19
  base: {
@@ -64,8 +66,6 @@ const p = v({
64
66
  }
65
67
  },
66
68
  description: {
67
- display: "flex",
68
- flexDirection: "column",
69
69
  textStyle: "sd.system.typography.body.extraSmall_compact",
70
70
  color: "sd.system.color.component.onSurfaceVariant",
71
71
  _expanded: {
@@ -75,7 +75,17 @@ const p = v({
75
75
  opacity: 0.3
76
76
  }
77
77
  },
78
- leftIcon: {
78
+ subDescription: {
79
+ textStyle: "sd.system.typography.body.extraSmall_compact",
80
+ color: "sd.system.color.component.onSurfaceVariant",
81
+ _expanded: {
82
+ textStyle: "sd.system.typography.body.extraSmall_expanded"
83
+ },
84
+ _disabled: {
85
+ opacity: 0.3
86
+ }
87
+ },
88
+ headingElement: {
79
89
  flexShrink: 0,
80
90
  "& svg": {
81
91
  display: "block",
@@ -88,7 +98,7 @@ const p = v({
88
98
  opacity: 0.3
89
99
  }
90
100
  },
91
- rightIcon: {
101
+ trailingElement: {
92
102
  flexShrink: 0,
93
103
  "& svg": {
94
104
  width: "24px",
@@ -99,17 +109,24 @@ const p = v({
99
109
  }
100
110
  },
101
111
  badge: {
102
- position: "absolute",
103
- right: "sd.system.dimension.spacing.medium",
104
- top: "sd.system.dimension.spacing.extraSmall",
105
- height: 24,
106
- minW: 24
112
+ flexShrink: 0
107
113
  }
108
114
  },
109
115
  variants: {
110
- isLargeLeftIcon: {
116
+ isLargeHeadingElement: {
117
+ true: {
118
+ headingElement: {
119
+ "& svg": {
120
+ width: "40px",
121
+ height: "40px"
122
+ }
123
+ }
124
+ },
125
+ false: {}
126
+ },
127
+ isLargeTrailingElement: {
111
128
  true: {
112
- leftIcon: {
129
+ trailingElement: {
113
130
  "& svg": {
114
131
  width: "40px",
115
132
  height: "40px"
@@ -126,65 +143,95 @@ const p = v({
126
143
  }
127
144
  }
128
145
  }
129
- }), L = ({
130
- leftIcon: a,
146
+ }), Y = ({
147
+ headingElement: v,
148
+ trailingElement: b,
149
+ title: w,
150
+ description: s,
151
+ subDescription: a,
152
+ badge: n,
153
+ children: S,
154
+ disabled: _,
155
+ selected: L,
156
+ focusVisible: N,
157
+ className: H,
158
+ leftIcon: l,
131
159
  rightIcon: r,
132
- title: m,
133
- description: i,
134
- badge: l,
135
- children: d,
136
- disabled: x,
137
- selected: y,
138
- focusVisible: g,
139
- className: h,
140
- ...n
160
+ isLargeLeftIcon: o,
161
+ isLargeRightIcon: d,
162
+ ...m
141
163
  }) => {
142
- const [u, f] = p.splitVariantProps(n), e = p(u);
143
- return /* @__PURE__ */ s("li", { className: o(e.root, h), ...f, children: [
144
- /* @__PURE__ */ s(
145
- "div",
146
- {
147
- tabIndex: 1,
148
- className: o(
149
- e.wrapper,
150
- i && c({ alignItems: "flex-start" })
164
+ const y = D(!1);
165
+ G(() => {
166
+ y.current || process.env.NODE_ENV !== "production" && (l || r || o || d) && (y.current = !0, l && console.warn(
167
+ "[ListItem] `leftIcon` は廃止予定です。`headingElement` を使ってください。"
168
+ ), r && console.warn(
169
+ "[ListItem] `rightIcon` は廃止予定です。`trailingElement` を使ってください。"
170
+ ), o && console.warn(
171
+ "[ListItem] `isLargeLeftIcon` は廃止予定です。`isLargeHeadingElement` を使ってください。"
172
+ ), d && console.warn(
173
+ "[ListItem] `isLargeRightIcon` は廃止予定です。`isLargeTrailingElement` を使ってください。"
174
+ ));
175
+ }, []);
176
+ const x = v ?? l, h = b ?? r, c = m.isLargeHeadingElement ?? o, u = m.isLargeTrailingElement ?? d, [T, k] = E.splitVariantProps(m), e = E({
177
+ ...T,
178
+ isLargeHeadingElement: c,
179
+ isLargeTrailingElement: u
180
+ }), p = (!!s || !!a) && !(!!c && !!s && !a), I = i(
181
+ e.wrapper,
182
+ p && g({ alignItems: "flex-start" })
183
+ ), V = i(
184
+ e.headingElement,
185
+ p && g({ marginTop: "sd.system.dimension.spacing.twoExtraSmall" })
186
+ ), C = i(
187
+ e.trailingElement,
188
+ p && g({ marginTop: "sd.system.dimension.spacing.twoExtraSmall" })
189
+ );
190
+ return /* @__PURE__ */ t("li", { className: i(e.root, H), ...k, children: /* @__PURE__ */ f(
191
+ "div",
192
+ {
193
+ tabIndex: 1,
194
+ className: I,
195
+ "data-disabled": _ ? !0 : void 0,
196
+ "data-selected": L ? !0 : void 0,
197
+ "data-focus-visible": N ? !0 : void 0,
198
+ children: [
199
+ x && /* @__PURE__ */ t(
200
+ "div",
201
+ {
202
+ className: V,
203
+ style: c ? { padding: "0", width: "40px", height: "40px" } : { padding: "0", width: "24px", height: "24px" },
204
+ children: x
205
+ }
151
206
  ),
152
- "data-disabled": x ? !0 : void 0,
153
- "data-selected": y ? !0 : void 0,
154
- "data-focus-visible": g ? !0 : void 0,
155
- children: [
156
- a && /* @__PURE__ */ t(
157
- "div",
158
- {
159
- className: e.leftIcon,
160
- style: n.isLargeLeftIcon ? { padding: "0", width: "40px", height: "40px" } : { padding: "0", width: "24px", height: "24px" },
161
- children: a
162
- }
163
- ),
164
- /* @__PURE__ */ s(
165
- "div",
166
- {
167
- className: o(
168
- e.textGroup,
169
- (!!i || !!d) && c({ alignItems: "flex-start" })
170
- ),
171
- children: [
172
- /* @__PURE__ */ t("span", { className: e.title, children: m }),
173
- /* @__PURE__ */ s("div", { className: e.description, children: [
174
- i,
175
- d
176
- ] })
177
- ]
178
- }
179
- ),
180
- r && /* @__PURE__ */ t("div", { className: e.rightIcon, children: r })
181
- ]
182
- }
183
- ),
184
- l && /* @__PURE__ */ t("div", { className: e.badge, children: /* @__PURE__ */ t(b, { count: l, variant: "secondary" }) })
185
- ] });
207
+ /* @__PURE__ */ f("div", { className: e.textGroup, children: [
208
+ /* @__PURE__ */ t("span", { className: e.title, children: w }),
209
+ s && /* @__PURE__ */ t("span", { className: e.description, children: s }),
210
+ a && /* @__PURE__ */ t("span", { className: e.subDescription, children: a }),
211
+ S
212
+ ] }),
213
+ h && /* @__PURE__ */ t(
214
+ "div",
215
+ {
216
+ className: C,
217
+ style: u ? { width: "40px", height: "40px" } : { width: "24px", height: "24px" },
218
+ children: h
219
+ }
220
+ ),
221
+ n != null && n > 0 && /* @__PURE__ */ t("div", { className: e.badge, children: /* @__PURE__ */ t(
222
+ O,
223
+ {
224
+ count: n,
225
+ variant: "secondary",
226
+ size: "small",
227
+ position: "relative"
228
+ }
229
+ ) })
230
+ ]
231
+ }
232
+ ) });
186
233
  };
187
234
  export {
188
- L as ListItem,
189
- p as ListItemStyle
235
+ Y as ListItem,
236
+ E as ListItemStyle
190
237
  };
@@ -3,4 +3,5 @@ export declare const AnimatedArc: React.FC<{
3
3
  className?: string;
4
4
  radius: number;
5
5
  width: number;
6
+ progress?: number;
6
7
  }>;
@@ -1,46 +1,43 @@
1
- import { jsx as A } from "react/jsx-runtime";
2
- import n from "react";
3
- import { describeArc as R } from "./util.js";
4
- const h = 2.5, S = ({ className: f, radius: o, width: c }) => {
5
- const [t, i] = n.useState(0), s = n.useRef(null), a = n.useRef(null);
6
- n.useEffect(() => {
7
- const e = (r) => {
8
- s.current == null && (s.current = r);
9
- const u = (r - s.current) / 1e3;
10
- s.current = r;
11
- const m = u / h;
12
- i((p) => (p + m) % 1), a.current = requestAnimationFrame(e);
1
+ import { jsx as R } from "react/jsx-runtime";
2
+ import e from "react";
3
+ import { getAnimatedArcProps as P } from "./animatedArcProps.js";
4
+ const F = 2.5, E = ({ className: l, radius: u, width: o, progress: t }) => {
5
+ const [s, m] = e.useState(0), r = e.useRef(null), n = e.useRef(null);
6
+ e.useEffect(() => {
7
+ if (t != null)
8
+ return;
9
+ const a = (c) => {
10
+ r.current == null && (r.current = c);
11
+ const d = (c - r.current) / 1e3;
12
+ r.current = c;
13
+ const A = d / F;
14
+ m((p) => (p + A) % 1), n.current = requestAnimationFrame(a);
13
15
  };
14
- return a.current = requestAnimationFrame(e), () => {
15
- a.current != null && cancelAnimationFrame(a.current);
16
+ return n.current = requestAnimationFrame(a), () => {
17
+ n.current != null && cancelAnimationFrame(n.current);
16
18
  };
17
- }, []);
18
- const { d: l, rotationDeg: d } = n.useMemo(() => {
19
- const e = t * Math.PI * 2, r = 180 + 40 * Math.sin(-e) + 40, u = 90 * Math.sin(e) + 90;
20
- return { d: R(
21
- o + c,
22
- // cx
23
- o + c,
24
- // cy
25
- o,
26
- // r
27
- t * 360 + u,
28
- t * 360 + r
29
- ), rotationDeg: t * 360 };
30
- }, [t, o, c]);
31
- return /* @__PURE__ */ A(
19
+ }, [t]);
20
+ const { d: f, rotationDeg: i } = e.useMemo(
21
+ () => P({
22
+ progress: t ?? s,
23
+ radius: u,
24
+ width: o
25
+ }),
26
+ [t, s, u, o]
27
+ );
28
+ return /* @__PURE__ */ R(
32
29
  "path",
33
30
  {
34
- d: l,
35
- transform: `rotate(${d})`,
31
+ d: f,
32
+ transform: `rotate(${i})`,
36
33
  strokeLinecap: "butt",
37
34
  stroke: "currentColor",
38
- strokeWidth: c,
35
+ strokeWidth: o,
39
36
  fill: "none",
40
- className: f
37
+ className: l
41
38
  }
42
39
  );
43
40
  };
44
41
  export {
45
- S as AnimatedArc
42
+ E as AnimatedArc
46
43
  };
@@ -6,6 +6,6 @@ export interface ProgressIndicatorProps extends React.ComponentProps<"div"> {
6
6
  max?: number;
7
7
  }
8
8
  export declare const ProgressIndicator: {
9
- ({ value, max, type, size, className, style, ...props }: ProgressIndicatorProps): import("react/jsx-runtime").JSX.Element;
9
+ ({ value, max, type, size, className, style, ...props }: ProgressIndicatorProps): React.JSX.Element;
10
10
  displayName: string;
11
11
  };
@@ -3,8 +3,9 @@ export interface ProgressIndicatorIndeterminateProps extends React.ComponentProp
3
3
  type?: "linear" | "circular";
4
4
  size?: "small" | "medium" | "large";
5
5
  color?: "primary" | "subtle";
6
+ animationProgress?: number;
6
7
  }
7
8
  export declare const ProgressIndicatorIndeterminate: {
8
- ({ type, size, color, className, style, ...props }: ProgressIndicatorIndeterminateProps): import("react/jsx-runtime").JSX.Element;
9
+ ({ type, size, color, animationProgress, className, style, ...props }: ProgressIndicatorIndeterminateProps): React.JSX.Element;
9
10
  displayName: string;
10
11
  };
@@ -1,8 +1,9 @@
1
- import { jsx as i, jsxs as p } from "react/jsx-runtime";
2
- import { AnimatedArc as h } from "./AnimatedArc.js";
3
- import { cx as c } from "../../styled-system/css/cx.js";
4
- import { cva as o } from "../../styled-system/css/cva.js";
5
- const m = o({
1
+ import { jsx as i, jsxs as h } from "react/jsx-runtime";
2
+ import { AnimatedArc as y } from "./AnimatedArc.js";
3
+ import { normalizeProgress as f } from "./animatedArcProps.js";
4
+ import { cx as u } from "../../styled-system/css/cx.js";
5
+ import { cva as l } from "../../styled-system/css/cva.js";
6
+ const p = l({
6
7
  base: {
7
8
  position: "relative",
8
9
  display: "flex",
@@ -80,7 +81,7 @@ const m = o({
80
81
  size: "medium",
81
82
  color: "primary"
82
83
  }
83
- }), g = o({
84
+ }), b = l({
84
85
  base: {
85
86
  position: "absolute",
86
87
  backgroundColor: "sd.reference.color.scale.gray.100"
@@ -106,7 +107,7 @@ const m = o({
106
107
  }
107
108
  },
108
109
  compoundVariants: []
109
- }), u = o({
110
+ }), g = l({
110
111
  base: {
111
112
  position: "absolute"
112
113
  },
@@ -140,7 +141,7 @@ const m = o({
140
141
  }
141
142
  },
142
143
  compoundVariants: []
143
- }), y = (e) => ({
144
+ }), x = (r) => ({
144
145
  small: {
145
146
  radius: 6,
146
147
  strokeWidth: 2
@@ -153,37 +154,40 @@ const m = o({
153
154
  radius: 20,
154
155
  strokeWidth: 8
155
156
  }
156
- })[e], f = ({
157
- type: e = "linear",
158
- size: r = "medium",
157
+ })[r], v = ({
158
+ type: r = "linear",
159
+ size: e = "medium",
159
160
  color: s = "primary",
160
- className: l,
161
- style: n,
162
- ...d
161
+ animationProgress: n,
162
+ className: d,
163
+ style: c,
164
+ ...m
163
165
  }) => {
164
- if (e === "circular") {
165
- const { radius: a, strokeWidth: t } = y(r);
166
+ const a = n == null ? void 0 : f(n);
167
+ if (r === "circular") {
168
+ const { radius: t, strokeWidth: o } = x(e);
166
169
  return /* @__PURE__ */ i(
167
170
  "div",
168
171
  {
169
- className: c(
170
- m({ type: e, size: r, color: s }),
171
- l
172
+ className: u(
173
+ p({ type: r, size: e, color: s }),
174
+ d
172
175
  ),
173
176
  role: "progressbar",
174
177
  "aria-valuetext": "Loading",
175
- style: n,
176
- ...d,
178
+ style: c,
179
+ ...m,
177
180
  children: /* @__PURE__ */ i(
178
181
  "svg",
179
182
  {
180
- viewBox: `0 0 ${a * 2 + t * 2} ${a * 2 + t * 2}`,
183
+ viewBox: `0 0 ${t * 2 + o * 2} ${t * 2 + o * 2}`,
181
184
  children: /* @__PURE__ */ i(
182
- h,
185
+ y,
183
186
  {
184
- className: u({ type: e, size: r, color: s }),
185
- radius: a,
186
- width: t
187
+ className: g({ type: r, size: e, color: s }),
188
+ radius: t,
189
+ width: o,
190
+ progress: a
187
191
  }
188
192
  )
189
193
  }
@@ -191,25 +195,34 @@ const m = o({
191
195
  }
192
196
  );
193
197
  }
194
- return /* @__PURE__ */ p(
198
+ return /* @__PURE__ */ h(
195
199
  "div",
196
200
  {
197
- className: c(
198
- m({ type: e, size: r, color: s }),
199
- l
201
+ className: u(
202
+ p({ type: r, size: e, color: s }),
203
+ d
200
204
  ),
201
205
  role: "progressbar",
202
206
  "aria-valuetext": "Loading",
203
- style: n,
204
- ...d,
207
+ style: c,
208
+ ...m,
205
209
  children: [
206
- /* @__PURE__ */ i("div", { className: g({ type: e, size: r }) }),
207
- /* @__PURE__ */ i("div", { className: u({ type: e, size: r, color: s }) })
210
+ /* @__PURE__ */ i("div", { className: b({ type: r, size: e }) }),
211
+ /* @__PURE__ */ i(
212
+ "div",
213
+ {
214
+ className: g({ type: r, size: e, color: s }),
215
+ style: a == null ? void 0 : {
216
+ animation: "none",
217
+ transform: `translateX(${a * 300 - 150}%)`
218
+ }
219
+ }
220
+ )
208
221
  ]
209
222
  }
210
223
  );
211
224
  };
212
- f.displayName = "ProgressIndicatorIndeterminate";
225
+ v.displayName = "ProgressIndicatorIndeterminate";
213
226
  export {
214
- f as ProgressIndicatorIndeterminate
227
+ v as ProgressIndicatorIndeterminate
215
228
  };
@@ -0,0 +1,11 @@
1
+ type AnimatedArcProps = {
2
+ progress: number;
3
+ radius: number;
4
+ width: number;
5
+ };
6
+ export declare const normalizeProgress: (progress: number) => number;
7
+ export declare const getAnimatedArcProps: ({ progress, radius, width, }: AnimatedArcProps) => {
8
+ d: string;
9
+ rotationDeg: number;
10
+ };
11
+ export {};
@@ -0,0 +1,19 @@
1
+ import { describeArc as a } from "./util.js";
2
+ const i = (n) => (n % 1 + 1) % 1, h = ({
3
+ progress: n,
4
+ radius: o,
5
+ width: r
6
+ }) => {
7
+ const t = i(n), e = t * Math.PI * 2, s = 180 + 40 * Math.sin(-e) + 40, c = 90 * Math.sin(e) + 90;
8
+ return { d: a(
9
+ o + r,
10
+ o + r,
11
+ o,
12
+ t * 360 + c,
13
+ t * 360 + s
14
+ ), rotationDeg: t * 360 };
15
+ };
16
+ export {
17
+ h as getAnimatedArcProps,
18
+ i as normalizeProgress
19
+ };
@@ -18,5 +18,5 @@ type ExclusiveBadgeProps = ({
18
18
  dot?: boolean;
19
19
  });
20
20
  export type TabItemProps = TabItemBaseProps & RecipeVariantProps<typeof TabItemStyle> & ArkTabs.TriggerProps & ExclusiveBadgeProps;
21
- export declare const TabItem: ({ title, value, disabled, dot, badge, className, ...props }: TabItemProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const TabItem: ({ title, value, disabled, dot, badge, className, ...props }: TabItemProps) => import("react").JSX.Element;
22
22
  export {};
@@ -1,3 +1,3 @@
1
1
  import { Tabs as ArkTabs } from '@ark-ui/react';
2
2
  export declare const TabsStyle: import('../../../styled-system/types').SlotRecipeRuntimeFn<"list" | "root", import('../../../styled-system/types').SlotRecipeVariantRecord<"list" | "root">>;
3
- export declare const Tabs: ({ children, className, ...props }: ArkTabs.RootProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Tabs: ({ children, className, ...props }: ArkTabs.RootProps) => import("react").JSX.Element;