@yamada-ui/progress 1.1.4-dev-20241005224505 → 1.1.4-dev-20241006032009

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/circle-progress.tsx"],"sourcesContent":["import type {\n HTMLUIProps,\n CSSUIObject,\n CSSUIProps,\n ThemeProps,\n FC,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { cx, valueToPercent } from \"@yamada-ui/utils\"\n\ninterface CircleProgressOptions {\n /**\n * The CSS `box-size` property.\n *\n * @default '6rem'\n * @deprecated Use `boxSize` instead.\n */\n size?: CSSUIProps[\"boxSize\"]\n /**\n * The CSS `width` property.\n *\n * @default '0.625ewm'\n */\n thickness?: CSSUIProps[\"width\"]\n /**\n * The CSS `color` property.\n *\n * @default 'primary'\n */\n color?: CSSUIProps[\"color\"]\n /**\n * The CSS `color` property.\n *\n * @default 'border'\n */\n trackColor?: CSSUIProps[\"color\"]\n /**\n * The value of the progress.\n *\n * @default 0\n */\n value?: number\n /**\n * The minimum value of the progress.\n *\n * @default 0\n */\n min?: number\n /**\n * The maximum value of the progress.\n *\n * @default 100\n */\n max?: number\n /**\n * If `true`, the cap of the progress indicator will be rounded.\n *\n * @default false\n */\n isRounded?: boolean\n /**\n * If `true`, the progress will be indeterminate and the `value` prop will be ignored.\n *\n * @default false\n */\n isAnimation?: boolean\n /**\n * The animation speed in seconds.\n *\n * @default '[1.4s, 2s]'\n */\n speed?: [string | number, string | number]\n}\n\nexport interface CircleProgressProps\n extends Omit<HTMLUIProps, \"color\">,\n Omit<ThemeProps<\"CircleProgress\">, \"size\">,\n CircleProgressOptions {}\n\n/**\n * `CircleProgress` is a component that displays progress in a circular progress bar.\n *\n * @see Docs https://yamada-ui.com/components/feedback/circle-progress\n */\nexport const CircleProgress = forwardRef<CircleProgressProps, \"div\">(\n (props, ref) => {\n const [styles, { size = \"6rem\", ...mergedProps }] = useComponentStyle(\n \"CircleProgress\",\n props,\n )\n let {\n className,\n children,\n boxSize = size,\n thickness = \"0.625rem\",\n color = \"primary\",\n trackColor = \"border\",\n value = 0,\n min = 0,\n max = 100,\n isAnimation = false,\n isRounded,\n speed = [\"1.4s\", \"2s\"],\n ...rest\n } = omitThemeProps(mergedProps)\n\n const isTransparent = value === 0 && !isAnimation\n const percent = valueToPercent(value, min, max)\n\n const interval = !isAnimation ? percent * 2.64 : undefined\n\n const animation = useAnimation({\n keyframes: {\n \"0%\": {\n strokeDasharray: \"1, 400\",\n strokeDashoffset: \"0\",\n },\n \"50%\": {\n strokeDasharray: \"400, 400\",\n strokeDashoffset: \"-100\",\n },\n \"100%\": {\n strokeDasharray: \"400, 400\",\n strokeDashoffset: \"-260\",\n },\n },\n duration: typeof speed[0] === \"string\" ? speed[0] : `${speed[0]}s`,\n iterationCount: \"infinite\",\n timingFunction: \"linear\",\n })\n\n const css: CSSUIObject = {\n ...styles,\n vars: [\n { name: \"boxSize\", token: \"sizes\", value: boxSize },\n { name: \"thickness\", token: \"sizes\", value: thickness },\n ],\n fontSize: \"$boxSize\",\n }\n\n const circleProps: CircleProps = isAnimation\n ? {\n animation,\n }\n : {\n strokeDashoffset: 66,\n strokeDasharray:\n interval == null ? undefined : `${interval} ${264 - interval}`,\n transitionProperty: \"stroke-dasharray, stroke\",\n transitionDuration: \"0.6s\",\n transitionTimingFunction: \"ease\",\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-circle-progress\", className)}\n __css={css}\n {...rest}\n >\n <Shape boxSize={boxSize} isAnimation={isAnimation} speed={speed}>\n <Circle stroke={trackColor} strokeWidth=\"$thickness\" />\n <Circle\n stroke={color}\n strokeWidth=\"$thickness\"\n strokeLinecap={isRounded ? \"round\" : undefined}\n opacity={isTransparent ? 0 : undefined}\n {...circleProps}\n />\n </Shape>\n {children}\n </ui.div>\n )\n },\n)\n\nCircleProgress.displayName = \"CircleProgress\"\nCircleProgress.__ui__ = \"CircleProgress\"\n\ninterface CircleProps extends HTMLUIProps<\"circle\"> {}\n\nconst Circle: FC<CircleProps> = ({ ...rest }) => (\n <ui.circle cx={50} cy={50} r={42} fill=\"transparent\" {...rest} />\n)\n\nCircle.displayName = \"Circle\"\nCircle.__ui__ = \"Circle\"\n\ninterface ShapeProps\n extends Omit<HTMLUIProps<\"svg\">, \"children\" | \"speed\">,\n Pick<Required<CircleProgressProps>, \"children\" | \"isAnimation\" | \"speed\"> {}\n\nconst Shape: FC<ShapeProps> = ({ boxSize, isAnimation, speed, ...rest }) => {\n const animation = useAnimation({\n keyframes: {\n \"0%\": {\n transform: \"rotate(0deg)\",\n },\n \"100%\": {\n transform: \"rotate(360deg)\",\n },\n },\n duration: typeof speed[1] === \"string\" ? speed[1] : `${speed[1]}s`,\n iterationCount: \"infinite\",\n timingFunction: \"linear\",\n })\n\n const css: CSSUIObject = {\n display: \"block\",\n boxSize,\n ...(isAnimation ? { animation } : {}),\n }\n\n return <ui.svg viewBox=\"0 0 100 100\" __css={css} {...rest} />\n}\n\nShape.displayName = \"Shape\"\nShape.__ui__ = \"Shape\"\n\nexport const CircleProgressLabel = ui(\"span\", {\n baseStyle: {\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"100%\",\n fontSize: \"0.25em\",\n textAlign: \"center\",\n },\n})\n\nCircleProgressLabel.displayName = \"CircleProgressLabel\"\nCircleProgressLabel.__ui__ = \"CircleProgressLabel\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,kBAKO;AACP,2BAA6B;AAC7B,mBAAmC;AAwJ3B;AA5ED,IAAM,qBAAiB;AAAA,EAC5B,CAAC,OAAO,QAAQ;AACd,UAAM,CAAC,QAAQ,EAAE,OAAO,QAAQ,GAAG,YAAY,CAAC,QAA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AM,GAAG,MAAM;AAC7D;AAEA,MAAM,cAAc;AACpB,MAAM,SAAS;AAER,IAAM,0BAAsB,gBAAG,QAAQ;AAAA,EAC5C,WAAW;AAAA,IACT,UAAU;AAAA,IACV,KAAK;AAAA,IACL,MAAM;AAAA,IACN,WAAW;AAAA,IACX,OAAO;AAAA,IACP,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AACF,CAAC;AAED,oBAAoB,cAAc;AAClC,oBAAoB,SAAS;","names":[]}
1
+ {"version":3,"sources":["../src/circle-progress.tsx"],"sourcesContent":["import type {\n CSSUIObject,\n CSSUIProps,\n FC,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentStyle,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { cx, valueToPercent } from \"@yamada-ui/utils\"\n\ninterface CircleProgressOptions {\n /**\n * The CSS `color` property.\n *\n * @default 'primary'\n */\n color?: CSSUIProps[\"color\"]\n /**\n * If `true`, the progress will be indeterminate and the `value` prop will be ignored.\n *\n * @default false\n */\n isAnimation?: boolean\n /**\n * If `true`, the cap of the progress indicator will be rounded.\n *\n * @default false\n */\n isRounded?: boolean\n /**\n * The maximum value of the progress.\n *\n * @default 100\n */\n max?: number\n /**\n * The minimum value of the progress.\n *\n * @default 0\n */\n min?: number\n /**\n * The CSS `box-size` property.\n *\n * @default '6rem'\n * @deprecated Use `boxSize` instead.\n */\n size?: CSSUIProps[\"boxSize\"]\n /**\n * The animation speed in seconds.\n *\n * @default '[1.4s, 2s]'\n */\n speed?: [number | string, number | string]\n /**\n * The CSS `width` property.\n *\n * @default '0.625ewm'\n */\n thickness?: CSSUIProps[\"width\"]\n /**\n * The CSS `color` property.\n *\n * @default 'border'\n */\n trackColor?: CSSUIProps[\"color\"]\n /**\n * The value of the progress.\n *\n * @default 0\n */\n value?: number\n}\n\nexport interface CircleProgressProps\n extends Omit<HTMLUIProps, \"color\">,\n Omit<ThemeProps<\"CircleProgress\">, \"size\">,\n CircleProgressOptions {}\n\n/**\n * `CircleProgress` is a component that displays progress in a circular progress bar.\n *\n * @see Docs https://yamada-ui.com/components/feedback/circle-progress\n */\nexport const CircleProgress = forwardRef<CircleProgressProps, \"div\">(\n (props, ref) => {\n const [styles, { size = \"6rem\", ...mergedProps }] = useComponentStyle(\n \"CircleProgress\",\n props,\n )\n let {\n className,\n boxSize = size,\n children,\n color = \"primary\",\n isAnimation = false,\n isRounded,\n max = 100,\n min = 0,\n speed = [\"1.4s\", \"2s\"],\n thickness = \"0.625rem\",\n trackColor = \"border\",\n value = 0,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const isTransparent = value === 0 && !isAnimation\n const percent = valueToPercent(value, min, max)\n\n const interval = !isAnimation ? percent * 2.64 : undefined\n\n const animation = useAnimation({\n duration: typeof speed[0] === \"string\" ? speed[0] : `${speed[0]}s`,\n iterationCount: \"infinite\",\n keyframes: {\n \"0%\": {\n strokeDasharray: \"1, 400\",\n strokeDashoffset: \"0\",\n },\n \"50%\": {\n strokeDasharray: \"400, 400\",\n strokeDashoffset: \"-100\",\n },\n \"100%\": {\n strokeDasharray: \"400, 400\",\n strokeDashoffset: \"-260\",\n },\n },\n timingFunction: \"linear\",\n })\n\n const css: CSSUIObject = {\n ...styles,\n fontSize: \"$boxSize\",\n vars: [\n { name: \"boxSize\", token: \"sizes\", value: boxSize },\n { name: \"thickness\", token: \"sizes\", value: thickness },\n ],\n }\n\n const circleProps: CircleProps = isAnimation\n ? {\n animation,\n }\n : {\n strokeDasharray:\n interval == null ? undefined : `${interval} ${264 - interval}`,\n strokeDashoffset: 66,\n transitionDuration: \"0.6s\",\n transitionProperty: \"stroke-dasharray, stroke\",\n transitionTimingFunction: \"ease\",\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-circle-progress\", className)}\n __css={css}\n {...rest}\n >\n <Shape boxSize={boxSize} isAnimation={isAnimation} speed={speed}>\n <Circle stroke={trackColor} strokeWidth=\"$thickness\" />\n <Circle\n opacity={isTransparent ? 0 : undefined}\n stroke={color}\n strokeLinecap={isRounded ? \"round\" : undefined}\n strokeWidth=\"$thickness\"\n {...circleProps}\n />\n </Shape>\n {children}\n </ui.div>\n )\n },\n)\n\nCircleProgress.displayName = \"CircleProgress\"\nCircleProgress.__ui__ = \"CircleProgress\"\n\ninterface CircleProps extends HTMLUIProps<\"circle\"> {}\n\nconst Circle: FC<CircleProps> = ({ ...rest }) => (\n <ui.circle cx={50} cy={50} fill=\"transparent\" r={42} {...rest} />\n)\n\nCircle.displayName = \"Circle\"\nCircle.__ui__ = \"Circle\"\n\ninterface ShapeProps\n extends Omit<HTMLUIProps<\"svg\">, \"children\" | \"speed\">,\n Pick<Required<CircleProgressProps>, \"children\" | \"isAnimation\" | \"speed\"> {}\n\nconst Shape: FC<ShapeProps> = ({ boxSize, isAnimation, speed, ...rest }) => {\n const animation = useAnimation({\n duration: typeof speed[1] === \"string\" ? speed[1] : `${speed[1]}s`,\n iterationCount: \"infinite\",\n keyframes: {\n \"0%\": {\n transform: \"rotate(0deg)\",\n },\n \"100%\": {\n transform: \"rotate(360deg)\",\n },\n },\n timingFunction: \"linear\",\n })\n\n const css: CSSUIObject = {\n boxSize,\n display: \"block\",\n ...(isAnimation ? { animation } : {}),\n }\n\n return <ui.svg viewBox=\"0 0 100 100\" __css={css} {...rest} />\n}\n\nShape.displayName = \"Shape\"\nShape.__ui__ = \"Shape\"\n\nexport const CircleProgressLabel = ui(\"span\", {\n baseStyle: {\n fontSize: \"0.25em\",\n left: \"50%\",\n position: \"absolute\",\n textAlign: \"center\",\n top: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"100%\",\n },\n})\n\nCircleProgressLabel.displayName = \"CircleProgressLabel\"\nCircleProgressLabel.__ui__ = \"CircleProgressLabel\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,kBAKO;AACP,2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B;AAAA,IACvB;AAAA,IACA,SAAS;AAAA,IACT,GAAI,cAAc,EAAE,UAAU,IAAI,CAAC;AAAA,EACrC;AAEA,SAAO,4CAAC,eAAG,KAAH,EAAO,SAAQ,eAAc,OAAO,KAAM,GAAG,MAAM;AAC7D;AAEA,MAAM,cAAc;AACpB,MAAM,SAAS;AAER,IAAM,0BAAsB,gBAAG,QAAQ;AAAA,EAC5C,WAAW;AAAA,IACT,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,WAAW;AAAA,IACX,KAAK;AAAA,IACL,WAAW;AAAA,IACX,OAAO;AAAA,EACT;AACF,CAAC;AAED,oBAAoB,cAAc;AAClC,oBAAoB,SAAS;","names":[]}
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CircleProgress,
4
4
  CircleProgressLabel
5
- } from "./chunk-ALBGJOCS.mjs";
5
+ } from "./chunk-UD3A4RXP.mjs";
6
6
  export {
7
7
  CircleProgress,
8
8
  CircleProgressLabel
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- export { Progress, ProgressProps } from './progress.mjs';
2
1
  export { CircleProgress, CircleProgressLabel, CircleProgressProps } from './circle-progress.mjs';
2
+ export { Progress, ProgressProps } from './progress.mjs';
3
3
  import '@yamada-ui/core';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { Progress, ProgressProps } from './progress.js';
2
1
  export { CircleProgress, CircleProgressLabel, CircleProgressProps } from './circle-progress.js';
2
+ export { Progress, ProgressProps } from './progress.js';
3
3
  import '@yamada-ui/core';
package/dist/index.js CHANGED
@@ -27,150 +27,38 @@ __export(src_exports, {
27
27
  });
28
28
  module.exports = __toCommonJS(src_exports);
29
29
 
30
- // src/progress.tsx
30
+ // src/circle-progress.tsx
31
31
  var import_core = require("@yamada-ui/core");
32
32
  var import_use_animation = require("@yamada-ui/use-animation");
33
33
  var import_utils = require("@yamada-ui/utils");
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
- var [ProgressProvider, useProgress] = (0, import_utils.createContext)({
36
- name: `ProgressStylesContext`,
37
- errorMessage: `useProgress returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `
38
- });
39
- var Progress = (0, import_core.forwardRef)((props, ref) => {
40
- var _a, _b;
41
- const [styles, mergedProps] = (0, import_core.useComponentMultiStyle)("Progress", props);
42
- const {
43
- className,
44
- children,
45
- value,
46
- min,
47
- max,
48
- hasStripe,
49
- isStripeAnimation,
50
- isAnimation,
51
- speed,
52
- borderRadius: _borderRadius,
53
- rounded,
54
- ...rest
55
- } = (0, import_core.omitThemeProps)(mergedProps, ["filledTrackColor"]);
56
- const borderRadius = (_b = _borderRadius != null ? _borderRadius : rounded) != null ? _b : (_a = styles.track) == null ? void 0 : _a.borderRadius;
57
- const css = {
58
- w: "100%",
59
- overflow: "hidden",
60
- pos: "relative",
61
- ...styles.track
62
- };
63
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
64
- import_core.ui.div,
65
- {
66
- ref,
67
- className: (0, import_utils.cx)("ui-progress", className),
68
- __css: css,
69
- borderRadius,
70
- ...rest,
71
- children: [
72
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
- ProgressFilledTrack,
74
- {
75
- min,
76
- max,
77
- value,
78
- hasStripe,
79
- isStripeAnimation,
80
- isAnimation,
81
- speed,
82
- borderRadius
83
- }
84
- ),
85
- children
86
- ]
87
- }
88
- ) });
89
- });
90
- Progress.displayName = "Progress";
91
- Progress.__ui__ = "Progress";
92
- var ProgressFilledTrack = ({
93
- value = 0,
94
- min = 0,
95
- max = 100,
96
- hasStripe,
97
- isStripeAnimation,
98
- isAnimation,
99
- speed = "1.4s",
100
- ...rest
101
- }) => {
102
- const percent = (0, import_utils.valueToPercent)(value, min, max);
103
- const styles = useProgress();
104
- const stripeAnimation = (0, import_use_animation.useAnimation)({
105
- keyframes: {
106
- "0%": { bgPosition: "1rem 0" },
107
- "100%": { bgPosition: "0 0" }
108
- },
109
- duration: typeof speed === "string" ? speed : `${speed}s`,
110
- iterationCount: "infinite",
111
- timingFunction: "linear"
112
- });
113
- const interpolationAnimation = (0, import_use_animation.useAnimation)({
114
- keyframes: {
115
- "0%": { left: "-40%" },
116
- "100%": { left: "100%" }
117
- },
118
- duration: typeof speed === "string" ? speed : `${speed}s`,
119
- iterationCount: "infinite",
120
- timingFunction: "ease"
121
- });
122
- isStripeAnimation = !isAnimation && hasStripe && isStripeAnimation;
123
- const css = {
124
- ...isStripeAnimation ? {
125
- animation: stripeAnimation
126
- } : {},
127
- ...isAnimation ? {
128
- position: "absolute",
129
- willChange: "left",
130
- minWidth: "50%",
131
- animation: interpolationAnimation
132
- } : {}
133
- };
134
- const __css = {
135
- w: `${percent}%`,
136
- h: "100%",
137
- ...styles.filledTrack
138
- };
139
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.div, { css, __css, ...rest });
140
- };
141
- ProgressFilledTrack.displayName = "ProgressFilledTrack";
142
- ProgressFilledTrack.__ui__ = "ProgressFilledTrack";
143
-
144
- // src/circle-progress.tsx
145
- var import_core2 = require("@yamada-ui/core");
146
- var import_use_animation2 = require("@yamada-ui/use-animation");
147
- var import_utils2 = require("@yamada-ui/utils");
148
- var import_jsx_runtime2 = require("react/jsx-runtime");
149
- var CircleProgress = (0, import_core2.forwardRef)(
35
+ var CircleProgress = (0, import_core.forwardRef)(
150
36
  (props, ref) => {
151
- const [styles, { size = "6rem", ...mergedProps }] = (0, import_core2.useComponentStyle)(
37
+ const [styles, { size = "6rem", ...mergedProps }] = (0, import_core.useComponentStyle)(
152
38
  "CircleProgress",
153
39
  props
154
40
  );
155
41
  let {
156
42
  className,
157
- children,
158
43
  boxSize = size,
159
- thickness = "0.625rem",
44
+ children,
160
45
  color = "primary",
161
- trackColor = "border",
162
- value = 0,
163
- min = 0,
164
- max = 100,
165
46
  isAnimation = false,
166
47
  isRounded,
48
+ max = 100,
49
+ min = 0,
167
50
  speed = ["1.4s", "2s"],
51
+ thickness = "0.625rem",
52
+ trackColor = "border",
53
+ value = 0,
168
54
  ...rest
169
- } = (0, import_core2.omitThemeProps)(mergedProps);
55
+ } = (0, import_core.omitThemeProps)(mergedProps);
170
56
  const isTransparent = value === 0 && !isAnimation;
171
- const percent = (0, import_utils2.valueToPercent)(value, min, max);
57
+ const percent = (0, import_utils.valueToPercent)(value, min, max);
172
58
  const interval = !isAnimation ? percent * 2.64 : void 0;
173
- const animation = (0, import_use_animation2.useAnimation)({
59
+ const animation = (0, import_use_animation.useAnimation)({
60
+ duration: typeof speed[0] === "string" ? speed[0] : `${speed[0]}s`,
61
+ iterationCount: "infinite",
174
62
  keyframes: {
175
63
  "0%": {
176
64
  strokeDasharray: "1, 400",
@@ -185,44 +73,42 @@ var CircleProgress = (0, import_core2.forwardRef)(
185
73
  strokeDashoffset: "-260"
186
74
  }
187
75
  },
188
- duration: typeof speed[0] === "string" ? speed[0] : `${speed[0]}s`,
189
- iterationCount: "infinite",
190
76
  timingFunction: "linear"
191
77
  });
192
78
  const css = {
193
79
  ...styles,
80
+ fontSize: "$boxSize",
194
81
  vars: [
195
82
  { name: "boxSize", token: "sizes", value: boxSize },
196
83
  { name: "thickness", token: "sizes", value: thickness }
197
- ],
198
- fontSize: "$boxSize"
84
+ ]
199
85
  };
200
86
  const circleProps = isAnimation ? {
201
87
  animation
202
88
  } : {
203
- strokeDashoffset: 66,
204
89
  strokeDasharray: interval == null ? void 0 : `${interval} ${264 - interval}`,
205
- transitionProperty: "stroke-dasharray, stroke",
90
+ strokeDashoffset: 66,
206
91
  transitionDuration: "0.6s",
92
+ transitionProperty: "stroke-dasharray, stroke",
207
93
  transitionTimingFunction: "ease"
208
94
  };
209
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
210
- import_core2.ui.div,
95
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
96
+ import_core.ui.div,
211
97
  {
212
98
  ref,
213
- className: (0, import_utils2.cx)("ui-circle-progress", className),
99
+ className: (0, import_utils.cx)("ui-circle-progress", className),
214
100
  __css: css,
215
101
  ...rest,
216
102
  children: [
217
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Shape, { boxSize, isAnimation, speed, children: [
218
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Circle, { stroke: trackColor, strokeWidth: "$thickness" }),
219
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Shape, { boxSize, isAnimation, speed, children: [
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Circle, { stroke: trackColor, strokeWidth: "$thickness" }),
105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
220
106
  Circle,
221
107
  {
108
+ opacity: isTransparent ? 0 : void 0,
222
109
  stroke: color,
223
- strokeWidth: "$thickness",
224
110
  strokeLinecap: isRounded ? "round" : void 0,
225
- opacity: isTransparent ? 0 : void 0,
111
+ strokeWidth: "$thickness",
226
112
  ...circleProps
227
113
  }
228
114
  )
@@ -235,11 +121,13 @@ var CircleProgress = (0, import_core2.forwardRef)(
235
121
  );
236
122
  CircleProgress.displayName = "CircleProgress";
237
123
  CircleProgress.__ui__ = "CircleProgress";
238
- var Circle = ({ ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.ui.circle, { cx: 50, cy: 50, r: 42, fill: "transparent", ...rest });
124
+ var Circle = ({ ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.circle, { cx: 50, cy: 50, fill: "transparent", r: 42, ...rest });
239
125
  Circle.displayName = "Circle";
240
126
  Circle.__ui__ = "Circle";
241
127
  var Shape = ({ boxSize, isAnimation, speed, ...rest }) => {
242
- const animation = (0, import_use_animation2.useAnimation)({
128
+ const animation = (0, import_use_animation.useAnimation)({
129
+ duration: typeof speed[1] === "string" ? speed[1] : `${speed[1]}s`,
130
+ iterationCount: "infinite",
243
131
  keyframes: {
244
132
  "0%": {
245
133
  transform: "rotate(0deg)"
@@ -248,32 +136,144 @@ var Shape = ({ boxSize, isAnimation, speed, ...rest }) => {
248
136
  transform: "rotate(360deg)"
249
137
  }
250
138
  },
251
- duration: typeof speed[1] === "string" ? speed[1] : `${speed[1]}s`,
252
- iterationCount: "infinite",
253
139
  timingFunction: "linear"
254
140
  });
255
141
  const css = {
256
- display: "block",
257
142
  boxSize,
143
+ display: "block",
258
144
  ...isAnimation ? { animation } : {}
259
145
  };
260
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.ui.svg, { viewBox: "0 0 100 100", __css: css, ...rest });
146
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.svg, { viewBox: "0 0 100 100", __css: css, ...rest });
261
147
  };
262
148
  Shape.displayName = "Shape";
263
149
  Shape.__ui__ = "Shape";
264
- var CircleProgressLabel = (0, import_core2.ui)("span", {
150
+ var CircleProgressLabel = (0, import_core.ui)("span", {
265
151
  baseStyle: {
152
+ fontSize: "0.25em",
153
+ left: "50%",
266
154
  position: "absolute",
155
+ textAlign: "center",
267
156
  top: "50%",
268
- left: "50%",
269
157
  transform: "translate(-50%, -50%)",
270
- width: "100%",
271
- fontSize: "0.25em",
272
- textAlign: "center"
158
+ width: "100%"
273
159
  }
274
160
  });
275
161
  CircleProgressLabel.displayName = "CircleProgressLabel";
276
162
  CircleProgressLabel.__ui__ = "CircleProgressLabel";
163
+
164
+ // src/progress.tsx
165
+ var import_core2 = require("@yamada-ui/core");
166
+ var import_use_animation2 = require("@yamada-ui/use-animation");
167
+ var import_utils2 = require("@yamada-ui/utils");
168
+ var import_jsx_runtime2 = require("react/jsx-runtime");
169
+ var [ProgressProvider, useProgress] = (0, import_utils2.createContext)({
170
+ name: `ProgressStylesContext`,
171
+ errorMessage: `useProgress returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `
172
+ });
173
+ var Progress = (0, import_core2.forwardRef)((props, ref) => {
174
+ var _a, _b;
175
+ const [styles, mergedProps] = (0, import_core2.useComponentMultiStyle)("Progress", props);
176
+ const {
177
+ className,
178
+ borderRadius: _borderRadius,
179
+ children,
180
+ hasStripe,
181
+ isAnimation,
182
+ isStripeAnimation,
183
+ max,
184
+ min,
185
+ rounded,
186
+ speed,
187
+ value,
188
+ ...rest
189
+ } = (0, import_core2.omitThemeProps)(mergedProps, ["filledTrackColor"]);
190
+ const borderRadius = (_b = _borderRadius != null ? _borderRadius : rounded) != null ? _b : (_a = styles.track) == null ? void 0 : _a.borderRadius;
191
+ const css = {
192
+ overflow: "hidden",
193
+ pos: "relative",
194
+ w: "100%",
195
+ ...styles.track
196
+ };
197
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ProgressProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
198
+ import_core2.ui.div,
199
+ {
200
+ ref,
201
+ className: (0, import_utils2.cx)("ui-progress", className),
202
+ borderRadius,
203
+ __css: css,
204
+ ...rest,
205
+ children: [
206
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
207
+ ProgressFilledTrack,
208
+ {
209
+ borderRadius,
210
+ hasStripe,
211
+ isAnimation,
212
+ isStripeAnimation,
213
+ max,
214
+ min,
215
+ speed,
216
+ value
217
+ }
218
+ ),
219
+ children
220
+ ]
221
+ }
222
+ ) });
223
+ });
224
+ Progress.displayName = "Progress";
225
+ Progress.__ui__ = "Progress";
226
+ var ProgressFilledTrack = ({
227
+ hasStripe,
228
+ isAnimation,
229
+ isStripeAnimation,
230
+ max = 100,
231
+ min = 0,
232
+ speed = "1.4s",
233
+ value = 0,
234
+ ...rest
235
+ }) => {
236
+ const percent = (0, import_utils2.valueToPercent)(value, min, max);
237
+ const styles = useProgress();
238
+ const stripeAnimation = (0, import_use_animation2.useAnimation)({
239
+ duration: typeof speed === "string" ? speed : `${speed}s`,
240
+ iterationCount: "infinite",
241
+ keyframes: {
242
+ "0%": { bgPosition: "1rem 0" },
243
+ "100%": { bgPosition: "0 0" }
244
+ },
245
+ timingFunction: "linear"
246
+ });
247
+ const interpolationAnimation = (0, import_use_animation2.useAnimation)({
248
+ duration: typeof speed === "string" ? speed : `${speed}s`,
249
+ iterationCount: "infinite",
250
+ keyframes: {
251
+ "0%": { left: "-40%" },
252
+ "100%": { left: "100%" }
253
+ },
254
+ timingFunction: "ease"
255
+ });
256
+ isStripeAnimation = !isAnimation && hasStripe && isStripeAnimation;
257
+ const css = {
258
+ ...isStripeAnimation ? {
259
+ animation: stripeAnimation
260
+ } : {},
261
+ ...isAnimation ? {
262
+ animation: interpolationAnimation,
263
+ minWidth: "50%",
264
+ position: "absolute",
265
+ willChange: "left"
266
+ } : {}
267
+ };
268
+ const __css = {
269
+ h: "100%",
270
+ w: `${percent}%`,
271
+ ...styles.filledTrack
272
+ };
273
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.ui.div, { css, __css, ...rest });
274
+ };
275
+ ProgressFilledTrack.displayName = "ProgressFilledTrack";
276
+ ProgressFilledTrack.__ui__ = "ProgressFilledTrack";
277
277
  // Annotate the CommonJS export names for ESM import in node:
278
278
  0 && (module.exports = {
279
279
  CircleProgress,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/progress.tsx","../src/circle-progress.tsx"],"sourcesContent":["export { Progress } from \"./progress\"\nexport type { ProgressProps } from \"./progress\"\nexport { CircleProgress, CircleProgressLabel } from \"./circle-progress\"\nexport type { CircleProgressProps } from \"./circle-progress\"\n","import type {\n HTMLUIProps,\n ThemeProps,\n CSSUIObject,\n Interpolation,\n ColorModeToken,\n CSS,\n FC,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentMultiStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { createContext, cx, valueToPercent } from \"@yamada-ui/utils\"\n\nconst [ProgressProvider, useProgress] = createContext<{\n [key: string]: CSSUIObject\n}>({\n name: `ProgressStylesContext`,\n errorMessage: `useProgress returned is 'undefined'. Seems you forgot to wrap the components in \"<Progress />\" `,\n})\n\ninterface ProgressOptions {\n /**\n * The value of the progress.\n *\n * @default 0\n */\n value?: number\n /**\n * The minimum value of the progress.\n *\n * @default 0\n */\n min?: number\n /**\n * The maximum value of the progress.\n *\n * @default 100\n */\n max?: number\n /**\n * If `true`, the progress bar will show stripe.\n *\n * @default false\n */\n hasStripe?: boolean\n /**\n * If `true`, and hasStripe is `true`, the stripes will be animated.\n *\n * @default false\n */\n isStripeAnimation?: boolean\n /**\n * If `true`, the progress will be indeterminate and the `value` prop will be ignored.\n *\n * @default false\n */\n isAnimation?: boolean\n /**\n * The animation speed in seconds.\n *\n * @default '1.4s'\n */\n speed?: string | number\n /**\n * The CSS `color` property.\n */\n filledTrackColor?: ColorModeToken<CSS.Property.Color, \"colors\">\n}\n\nexport interface ProgressProps\n extends HTMLUIProps,\n ThemeProps<\"Progress\">,\n ProgressOptions {}\n\n/**\n * `Progress` is a component for visually indicating progress.\n *\n * @see Docs https://yamada-ui.com/components/feedback/progress\n */\nexport const Progress = forwardRef<ProgressProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Progress\", props)\n const {\n className,\n children,\n value,\n min,\n max,\n hasStripe,\n isStripeAnimation,\n isAnimation,\n speed,\n borderRadius: _borderRadius,\n rounded,\n ...rest\n } = omitThemeProps(mergedProps, [\"filledTrackColor\"])\n\n const borderRadius =\n _borderRadius ?? rounded ?? (styles.track?.borderRadius as string | number)\n\n const css: CSSUIObject = {\n w: \"100%\",\n overflow: \"hidden\",\n pos: \"relative\",\n ...styles.track,\n }\n\n return (\n <ProgressProvider value={styles}>\n <ui.div\n ref={ref}\n className={cx(\"ui-progress\", className)}\n __css={css}\n borderRadius={borderRadius}\n {...rest}\n >\n <ProgressFilledTrack\n min={min}\n max={max}\n value={value}\n hasStripe={hasStripe}\n isStripeAnimation={isStripeAnimation}\n isAnimation={isAnimation}\n speed={speed}\n borderRadius={borderRadius}\n />\n {children}\n </ui.div>\n </ProgressProvider>\n )\n})\n\nProgress.displayName = \"Progress\"\nProgress.__ui__ = \"Progress\"\n\ninterface ProgressFilledTrackProps extends HTMLUIProps, ProgressProps {}\n\nconst ProgressFilledTrack: FC<ProgressFilledTrackProps> = ({\n value = 0,\n min = 0,\n max = 100,\n hasStripe,\n isStripeAnimation,\n isAnimation,\n speed = \"1.4s\",\n ...rest\n}) => {\n const percent = valueToPercent(value, min, max)\n\n const styles = useProgress()\n\n const stripeAnimation = useAnimation({\n keyframes: {\n \"0%\": { bgPosition: \"1rem 0\" },\n \"100%\": { bgPosition: \"0 0\" },\n },\n duration: typeof speed === \"string\" ? speed : `${speed}s`,\n iterationCount: \"infinite\",\n timingFunction: \"linear\",\n })\n\n const interpolationAnimation = useAnimation({\n keyframes: {\n \"0%\": { left: \"-40%\" },\n \"100%\": { left: \"100%\" },\n },\n duration: typeof speed === \"string\" ? speed : `${speed}s`,\n iterationCount: \"infinite\",\n timingFunction: \"ease\",\n })\n\n isStripeAnimation = !isAnimation && hasStripe && isStripeAnimation\n\n const css: Interpolation<{}> = {\n ...(isStripeAnimation\n ? {\n animation: stripeAnimation,\n }\n : {}),\n ...(isAnimation\n ? {\n position: \"absolute\",\n willChange: \"left\",\n minWidth: \"50%\",\n animation: interpolationAnimation,\n }\n : {}),\n }\n\n const __css: CSSUIObject = {\n w: `${percent}%`,\n h: \"100%\",\n ...styles.filledTrack,\n }\n\n return <ui.div css={css} __css={__css} {...rest} />\n}\n\nProgressFilledTrack.displayName = \"ProgressFilledTrack\"\nProgressFilledTrack.__ui__ = \"ProgressFilledTrack\"\n","import type {\n HTMLUIProps,\n CSSUIObject,\n CSSUIProps,\n ThemeProps,\n FC,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { cx, valueToPercent } from \"@yamada-ui/utils\"\n\ninterface CircleProgressOptions {\n /**\n * The CSS `box-size` property.\n *\n * @default '6rem'\n * @deprecated Use `boxSize` instead.\n */\n size?: CSSUIProps[\"boxSize\"]\n /**\n * The CSS `width` property.\n *\n * @default '0.625ewm'\n */\n thickness?: CSSUIProps[\"width\"]\n /**\n * The CSS `color` property.\n *\n * @default 'primary'\n */\n color?: CSSUIProps[\"color\"]\n /**\n * The CSS `color` property.\n *\n * @default 'border'\n */\n trackColor?: CSSUIProps[\"color\"]\n /**\n * The value of the progress.\n *\n * @default 0\n */\n value?: number\n /**\n * The minimum value of the progress.\n *\n * @default 0\n */\n min?: number\n /**\n * The maximum value of the progress.\n *\n * @default 100\n */\n max?: number\n /**\n * If `true`, the cap of the progress indicator will be rounded.\n *\n * @default false\n */\n isRounded?: boolean\n /**\n * If `true`, the progress will be indeterminate and the `value` prop will be ignored.\n *\n * @default false\n */\n isAnimation?: boolean\n /**\n * The animation speed in seconds.\n *\n * @default '[1.4s, 2s]'\n */\n speed?: [string | number, string | number]\n}\n\nexport interface CircleProgressProps\n extends Omit<HTMLUIProps, \"color\">,\n Omit<ThemeProps<\"CircleProgress\">, \"size\">,\n CircleProgressOptions {}\n\n/**\n * `CircleProgress` is a component that displays progress in a circular progress bar.\n *\n * @see Docs https://yamada-ui.com/components/feedback/circle-progress\n */\nexport const CircleProgress = forwardRef<CircleProgressProps, \"div\">(\n (props, ref) => {\n const [styles, { size = \"6rem\", ...mergedProps }] = useComponentStyle(\n \"CircleProgress\",\n props,\n )\n let {\n className,\n children,\n boxSize = size,\n thickness = \"0.625rem\",\n color = \"primary\",\n trackColor = \"border\",\n value = 0,\n min = 0,\n max = 100,\n isAnimation = false,\n isRounded,\n speed = [\"1.4s\", \"2s\"],\n ...rest\n } = omitThemeProps(mergedProps)\n\n const isTransparent = value === 0 && !isAnimation\n const percent = valueToPercent(value, min, max)\n\n const interval = !isAnimation ? percent * 2.64 : undefined\n\n const animation = useAnimation({\n keyframes: {\n \"0%\": {\n strokeDasharray: \"1, 400\",\n strokeDashoffset: \"0\",\n },\n \"50%\": {\n strokeDasharray: \"400, 400\",\n strokeDashoffset: \"-100\",\n },\n \"100%\": {\n strokeDasharray: \"400, 400\",\n strokeDashoffset: \"-260\",\n },\n },\n duration: typeof speed[0] === \"string\" ? speed[0] : `${speed[0]}s`,\n iterationCount: \"infinite\",\n timingFunction: \"linear\",\n })\n\n const css: CSSUIObject = {\n ...styles,\n vars: [\n { name: \"boxSize\", token: \"sizes\", value: boxSize },\n { name: \"thickness\", token: \"sizes\", value: thickness },\n ],\n fontSize: \"$boxSize\",\n }\n\n const circleProps: CircleProps = isAnimation\n ? {\n animation,\n }\n : {\n strokeDashoffset: 66,\n strokeDasharray:\n interval == null ? undefined : `${interval} ${264 - interval}`,\n transitionProperty: \"stroke-dasharray, stroke\",\n transitionDuration: \"0.6s\",\n transitionTimingFunction: \"ease\",\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-circle-progress\", className)}\n __css={css}\n {...rest}\n >\n <Shape boxSize={boxSize} isAnimation={isAnimation} speed={speed}>\n <Circle stroke={trackColor} strokeWidth=\"$thickness\" />\n <Circle\n stroke={color}\n strokeWidth=\"$thickness\"\n strokeLinecap={isRounded ? \"round\" : undefined}\n opacity={isTransparent ? 0 : undefined}\n {...circleProps}\n />\n </Shape>\n {children}\n </ui.div>\n )\n },\n)\n\nCircleProgress.displayName = \"CircleProgress\"\nCircleProgress.__ui__ = \"CircleProgress\"\n\ninterface CircleProps extends HTMLUIProps<\"circle\"> {}\n\nconst Circle: FC<CircleProps> = ({ ...rest }) => (\n <ui.circle cx={50} cy={50} r={42} fill=\"transparent\" {...rest} />\n)\n\nCircle.displayName = \"Circle\"\nCircle.__ui__ = \"Circle\"\n\ninterface ShapeProps\n extends Omit<HTMLUIProps<\"svg\">, \"children\" | \"speed\">,\n Pick<Required<CircleProgressProps>, \"children\" | \"isAnimation\" | \"speed\"> {}\n\nconst Shape: FC<ShapeProps> = ({ boxSize, isAnimation, speed, ...rest }) => {\n const animation = useAnimation({\n keyframes: {\n \"0%\": {\n transform: \"rotate(0deg)\",\n },\n \"100%\": {\n transform: \"rotate(360deg)\",\n },\n },\n duration: typeof speed[1] === \"string\" ? speed[1] : `${speed[1]}s`,\n iterationCount: \"infinite\",\n timingFunction: \"linear\",\n })\n\n const css: CSSUIObject = {\n display: \"block\",\n boxSize,\n ...(isAnimation ? { animation } : {}),\n }\n\n return <ui.svg viewBox=\"0 0 100 100\" __css={css} {...rest} />\n}\n\nShape.displayName = \"Shape\"\nShape.__ui__ = \"Shape\"\n\nexport const CircleProgressLabel = ui(\"span\", {\n baseStyle: {\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"100%\",\n fontSize: \"0.25em\",\n textAlign: \"center\",\n },\n})\n\nCircleProgressLabel.displayName = \"CircleProgressLabel\"\nCircleProgressLabel.__ui__ = \"CircleProgressLabel\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSA,kBAKO;AACP,2BAA6B;AAC7B,mBAAkD;AAiG5C;AA/FN,IAAM,CAAC,kBAAkB,WAAW,QAAI,4BAErC;AAAA,EACD,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AA6DM,IAAM,eAAW,wBAAiC,CAAC,OAAO,QAAQ;AApFzE;AAqFE,QAAM,CAAC,QAAQ,WAAW,QAAI,oCAAuB,YAAY,KAAK;AACtE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA,GAAG;AAAA,EACL,QAAI,4BAAe,aAAa,CAAC,kBAAkB,CAAC;AAEpD,QAAM,gBACJ,6CAAiB,YAAjB,aAA6B,YAAO,UAAP,mBAAc;AAE7C,QAAM,MAAmB;A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I,IAAI,IAAI,GAAG,IAAI,MAAK,eAAe,GAAG,MAAM;AAGjE,OAAO,cAAc;AACrB,OAAO,SAAS;AAMhB,IAAM,QAAwB,CAAC,EAAE,SAAS,aAAa,OAAO,GAAG,KAAK,MAAM;AAC1E,QAAM,gBAAY,oCAAa;AAAA,IAC7B,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,MACA,QAAQ;AAAA,QACN,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,UAAU,OAAO,MAAM,CAAC,MAAM,WAAW,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;AAAA,IAC/D,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,EAClB,CAAC;AAED,QAAM,MAAmB;AAAA,IACvB,SAAS;AAAA,IACT;AAAA,IACA,GAAI,cAAc,EAAE,UAAU,IAAI,CAAC;AAAA,EACrC;AAEA,SAAO,6CAAC,gBAAG,KAAH,EAAO,SAAQ,eAAc,OAAO,KAAM,GAAG,MAAM;AAC7D;AAEA,MAAM,cAAc;AACpB,MAAM,SAAS;AAER,IAAM,0BAAsB,iBAAG,QAAQ;AAAA,EAC5C,WAAW;AAAA,IACT,UAAU;AAAA,IACV,KAAK;AAAA,IACL,MAAM;AAAA,IACN,WAAW;AAAA,IACX,OAAO;AAAA,IACP,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AACF,CAAC;AAED,oBAAoB,cAAc;AAClC,oBAAoB,SAAS;","names":["import_core","import_use_animation","import_utils","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/circle-progress.tsx","../src/progress.tsx"],"sourcesContent":["export { CircleProgress, CircleProgressLabel } from \"./circle-progress\"\nexport type { CircleProgressProps } from \"./circle-progress\"\nexport { Progress } from \"./progress\"\nexport type { ProgressProps } from \"./progress\"\n","import type {\n CSSUIObject,\n CSSUIProps,\n FC,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentStyle,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { cx, valueToPercent } from \"@yamada-ui/utils\"\n\ninterface CircleProgressOptions {\n /**\n * The CSS `color` property.\n *\n * @default 'primary'\n */\n color?: CSSUIProps[\"color\"]\n /**\n * If `true`, the progress will be indeterminate and the `value` prop will be ignored.\n *\n * @default false\n */\n isAnimation?: boolean\n /**\n * If `true`, the cap of the progress indicator will be rounded.\n *\n * @default false\n */\n isRounded?: boolean\n /**\n * The maximum value of the progress.\n *\n * @default 100\n */\n max?: number\n /**\n * The minimum value of the progress.\n *\n * @default 0\n */\n min?: number\n /**\n * The CSS `box-size` property.\n *\n * @default '6rem'\n * @deprecated Use `boxSize` instead.\n */\n size?: CSSUIProps[\"boxSize\"]\n /**\n * The animation speed in seconds.\n *\n * @default '[1.4s, 2s]'\n */\n speed?: [number | string, number | string]\n /**\n * The CSS `width` property.\n *\n * @default '0.625ewm'\n */\n thickness?: CSSUIProps[\"width\"]\n /**\n * The CSS `color` property.\n *\n * @default 'border'\n */\n trackColor?: CSSUIProps[\"color\"]\n /**\n * The value of the progress.\n *\n * @default 0\n */\n value?: number\n}\n\nexport interface CircleProgressProps\n extends Omit<HTMLUIProps, \"color\">,\n Omit<ThemeProps<\"CircleProgress\">, \"size\">,\n CircleProgressOptions {}\n\n/**\n * `CircleProgress` is a component that displays progress in a circular progress bar.\n *\n * @see Docs https://yamada-ui.com/components/feedback/circle-progress\n */\nexport const CircleProgress = forwardRef<CircleProgressProps, \"div\">(\n (props, ref) => {\n const [styles, { size = \"6rem\", ...mergedProps }] = useComponentStyle(\n \"CircleProgress\",\n props,\n )\n let {\n className,\n boxSize = size,\n children,\n color = \"primary\",\n isAnimation = false,\n isRounded,\n max = 100,\n min = 0,\n speed = [\"1.4s\", \"2s\"],\n thickness = \"0.625rem\",\n trackColor = \"border\",\n value = 0,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const isTransparent = value === 0 && !isAnimation\n const percent = valueToPercent(value, min, max)\n\n const interval = !isAnimation ? percent * 2.64 : undefined\n\n const animation = useAnimation({\n duration: typeof speed[0] === \"string\" ? speed[0] : `${speed[0]}s`,\n iterationCount: \"infinite\",\n keyframes: {\n \"0%\": {\n strokeDasharray: \"1, 400\",\n strokeDashoffset: \"0\",\n },\n \"50%\": {\n strokeDasharray: \"400, 400\",\n strokeDashoffset: \"-100\",\n },\n \"100%\": {\n strokeDasharray: \"400, 400\",\n strokeDashoffset: \"-260\",\n },\n },\n timingFunction: \"linear\",\n })\n\n const css: CSSUIObject = {\n ...styles,\n fontSize: \"$boxSize\",\n vars: [\n { name: \"boxSize\", token: \"sizes\", value: boxSize },\n { name: \"thickness\", token: \"sizes\", value: thickness },\n ],\n }\n\n const circleProps: CircleProps = isAnimation\n ? {\n animation,\n }\n : {\n strokeDasharray:\n interval == null ? undefined : `${interval} ${264 - interval}`,\n strokeDashoffset: 66,\n transitionDuration: \"0.6s\",\n transitionProperty: \"stroke-dasharray, stroke\",\n transitionTimingFunction: \"ease\",\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-circle-progress\", className)}\n __css={css}\n {...rest}\n >\n <Shape boxSize={boxSize} isAnimation={isAnimation} speed={speed}>\n <Circle stroke={trackColor} strokeWidth=\"$thickness\" />\n <Circle\n opacity={isTransparent ? 0 : undefined}\n stroke={color}\n strokeLinecap={isRounded ? \"round\" : undefined}\n strokeWidth=\"$thickness\"\n {...circleProps}\n />\n </Shape>\n {children}\n </ui.div>\n )\n },\n)\n\nCircleProgress.displayName = \"CircleProgress\"\nCircleProgress.__ui__ = \"CircleProgress\"\n\ninterface CircleProps extends HTMLUIProps<\"circle\"> {}\n\nconst Circle: FC<CircleProps> = ({ ...rest }) => (\n <ui.circle cx={50} cy={50} fill=\"transparent\" r={42} {...rest} />\n)\n\nCircle.displayName = \"Circle\"\nCircle.__ui__ = \"Circle\"\n\ninterface ShapeProps\n extends Omit<HTMLUIProps<\"svg\">, \"children\" | \"speed\">,\n Pick<Required<CircleProgressProps>, \"children\" | \"isAnimation\" | \"speed\"> {}\n\nconst Shape: FC<ShapeProps> = ({ boxSize, isAnimation, speed, ...rest }) => {\n const animation = useAnimation({\n duration: typeof speed[1] === \"string\" ? speed[1] : `${speed[1]}s`,\n iterationCount: \"infinite\",\n keyframes: {\n \"0%\": {\n transform: \"rotate(0deg)\",\n },\n \"100%\": {\n transform: \"rotate(360deg)\",\n },\n },\n timingFunction: \"linear\",\n })\n\n const css: CSSUIObject = {\n boxSize,\n display: \"block\",\n ...(isAnimation ? { animation } : {}),\n }\n\n return <ui.svg viewBox=\"0 0 100 100\" __css={css} {...rest} />\n}\n\nShape.displayName = \"Shape\"\nShape.__ui__ = \"Shape\"\n\nexport const CircleProgressLabel = ui(\"span\", {\n baseStyle: {\n fontSize: \"0.25em\",\n left: \"50%\",\n position: \"absolute\",\n textAlign: \"center\",\n top: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"100%\",\n },\n})\n\nCircleProgressLabel.displayName = \"CircleProgressLabel\"\nCircleProgressLabel.__ui__ = \"CircleProgressLabel\"\n","import type {\n ColorModeToken,\n CSS,\n CSSUIObject,\n FC,\n HTMLUIProps,\n Interpolation,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { createContext, cx, valueToPercent } from \"@yamada-ui/utils\"\n\nconst [ProgressProvider, useProgress] = createContext<{\n [key: string]: CSSUIObject | undefined\n}>({\n name: `ProgressStylesContext`,\n errorMessage: `useProgress returned is 'undefined'. Seems you forgot to wrap the components in \"<Progress />\" `,\n})\n\ninterface ProgressOptions {\n /**\n * The CSS `color` property.\n */\n filledTrackColor?: ColorModeToken<CSS.Property.Color, \"colors\">\n /**\n * If `true`, the progress bar will show stripe.\n *\n * @default false\n */\n hasStripe?: boolean\n /**\n * If `true`, the progress will be indeterminate and the `value` prop will be ignored.\n *\n * @default false\n */\n isAnimation?: boolean\n /**\n * If `true`, and hasStripe is `true`, the stripes will be animated.\n *\n * @default false\n */\n isStripeAnimation?: boolean\n /**\n * The maximum value of the progress.\n *\n * @default 100\n */\n max?: number\n /**\n * The minimum value of the progress.\n *\n * @default 0\n */\n min?: number\n /**\n * The animation speed in seconds.\n *\n * @default '1.4s'\n */\n speed?: number | string\n /**\n * The value of the progress.\n *\n * @default 0\n */\n value?: number\n}\n\nexport interface ProgressProps\n extends HTMLUIProps,\n ThemeProps<\"Progress\">,\n ProgressOptions {}\n\n/**\n * `Progress` is a component for visually indicating progress.\n *\n * @see Docs https://yamada-ui.com/components/feedback/progress\n */\nexport const Progress = forwardRef<ProgressProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Progress\", props)\n const {\n className,\n borderRadius: _borderRadius,\n children,\n hasStripe,\n isAnimation,\n isStripeAnimation,\n max,\n min,\n rounded,\n speed,\n value,\n ...rest\n } = omitThemeProps(mergedProps, [\"filledTrackColor\"])\n\n const borderRadius =\n _borderRadius ?? rounded ?? (styles.track?.borderRadius as number | string)\n\n const css: CSSUIObject = {\n overflow: \"hidden\",\n pos: \"relative\",\n w: \"100%\",\n ...styles.track,\n }\n\n return (\n <ProgressProvider value={styles}>\n <ui.div\n ref={ref}\n className={cx(\"ui-progress\", className)}\n borderRadius={borderRadius}\n __css={css}\n {...rest}\n >\n <ProgressFilledTrack\n borderRadius={borderRadius}\n hasStripe={hasStripe}\n isAnimation={isAnimation}\n isStripeAnimation={isStripeAnimation}\n max={max}\n min={min}\n speed={speed}\n value={value}\n />\n {children}\n </ui.div>\n </ProgressProvider>\n )\n})\n\nProgress.displayName = \"Progress\"\nProgress.__ui__ = \"Progress\"\n\ninterface ProgressFilledTrackProps extends HTMLUIProps, ProgressProps {}\n\nconst ProgressFilledTrack: FC<ProgressFilledTrackProps> = ({\n hasStripe,\n isAnimation,\n isStripeAnimation,\n max = 100,\n min = 0,\n speed = \"1.4s\",\n value = 0,\n ...rest\n}) => {\n const percent = valueToPercent(value, min, max)\n\n const styles = useProgress()\n\n const stripeAnimation = useAnimation({\n duration: typeof speed === \"string\" ? speed : `${speed}s`,\n iterationCount: \"infinite\",\n keyframes: {\n \"0%\": { bgPosition: \"1rem 0\" },\n \"100%\": { bgPosition: \"0 0\" },\n },\n timingFunction: \"linear\",\n })\n\n const interpolationAnimation = useAnimation({\n duration: typeof speed === \"string\" ? speed : `${speed}s`,\n iterationCount: \"infinite\",\n keyframes: {\n \"0%\": { left: \"-40%\" },\n \"100%\": { left: \"100%\" },\n },\n timingFunction: \"ease\",\n })\n\n isStripeAnimation = !isAnimation && hasStripe && isStripeAnimation\n\n const css: Interpolation<{}> = {\n ...(isStripeAnimation\n ? {\n animation: stripeAnimation,\n }\n : {}),\n ...(isAnimation\n ? {\n animation: interpolationAnimation,\n minWidth: \"50%\",\n position: \"absolute\",\n willChange: \"left\",\n }\n : {}),\n }\n\n const __css: CSSUIObject = {\n h: \"100%\",\n w: `${percent}%`,\n ...styles.filledTrack,\n }\n\n return <ui.div css={css} __css={__css} {...rest} />\n}\n\nProgressFilledTrack.displayName = \"ProgressFilledTrack\"\nProgressFilledTrack.__ui__ = \"ProgressFilledTrack\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,kBAKO;AACP,2BAA6B;AAC7B,mBAAmC;AAwJ3B;AA5ED,IAAM,qBAAiB;AAAA,EAC5B,CAAC,OAAO,QAAQ;AACd,UAAM,CAAC,QAAQ,EAAE,OAAO,QAAQ,GAAG,YAAY,CAAC,QAAI;AAAA,MAClD;AAAA,MACA;AAAA,IACF;AACA,QAAI;AAAA,MACF;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA,QAAQ;AAAA,MACR,cAAc;AAAA,MACd;AAAA,MACA,MAAM;AAAA,MACN,MAAM;AAAA,MACN,QAAQ,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A,EACA,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,GAAG;AACL,MAAM;AACJ,QAAM,cAAU,8BAAe,OAAO,KAAK,GAAG;AAE9C,QAAM,SAAS,YAAY;AAE3B,QAAM,sBAAkB,oCAAa;AAAA,IACnC,UAAU,OAAO,UAAU,WAAW,QAAQ,GAAG,KAAK;AAAA,IACtD,gBAAgB;AAAA,IAChB,WAAW;AAAA,MACT,MAAM,EAAE,YAAY,SAAS;AAAA,MAC7B,QAAQ,EAAE,YAAY,MAAM;AAAA,IAC9B;AAAA,IACA,gBAAgB;AAAA,EAClB,CAAC;AAED,QAAM,6BAAyB,oCAAa;AAAA,IAC1C,UAAU,OAAO,UAAU,WAAW,QAAQ,GAAG,KAAK;AAAA,IACtD,gBAAgB;AAAA,IAChB,WAAW;AAAA,MACT,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,QAAQ,EAAE,MAAM,OAAO;AAAA,IACzB;AAAA,IACA,gBAAgB;AAAA,EAClB,CAAC;AAED,sBAAoB,CAAC,eAAe,aAAa;AAEjD,QAAM,MAAyB;AAAA,IAC7B,GAAI,oBACA;AAAA,MACE,WAAW;AAAA,IACb,IACA,CAAC;AAAA,IACL,GAAI,cACA;AAAA,MACE,WAAW;AAAA,MACX,UAAU;AAAA,MACV,UAAU;AAAA,MACV,YAAY;AAAA,IACd,IACA,CAAC;AAAA,EACP;AAEA,QAAM,QAAqB;AAAA,IACzB,GAAG;AAAA,IACH,GAAG,GAAG,OAAO;AAAA,IACb,GAAG,OAAO;AAAA,EACZ;AAEA,SAAO,6CAAC,gBAAG,KAAH,EAAO,KAAU,OAAe,GAAG,MAAM;AACnD;AAEA,oBAAoB,cAAc;AAClC,oBAAoB,SAAS;","names":["import_core","import_use_animation","import_utils","import_jsx_runtime"]}
package/dist/index.mjs CHANGED
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  CircleProgress,
4
4
  CircleProgressLabel
5
- } from "./chunk-ALBGJOCS.mjs";
5
+ } from "./chunk-UD3A4RXP.mjs";
6
6
  import {
7
7
  Progress
8
- } from "./chunk-KPKODACS.mjs";
8
+ } from "./chunk-QOIOQFER.mjs";
9
9
  export {
10
10
  CircleProgress,
11
11
  CircleProgressLabel,
@@ -3,29 +3,21 @@ import { HTMLUIProps, ThemeProps, ColorModeToken, CSS } from '@yamada-ui/core';
3
3
 
4
4
  interface ProgressOptions {
5
5
  /**
6
- * The value of the progress.
7
- *
8
- * @default 0
9
- */
10
- value?: number;
11
- /**
12
- * The minimum value of the progress.
13
- *
14
- * @default 0
6
+ * The CSS `color` property.
15
7
  */
16
- min?: number;
8
+ filledTrackColor?: ColorModeToken<CSS.Property.Color, "colors">;
17
9
  /**
18
- * The maximum value of the progress.
10
+ * If `true`, the progress bar will show stripe.
19
11
  *
20
- * @default 100
12
+ * @default false
21
13
  */
22
- max?: number;
14
+ hasStripe?: boolean;
23
15
  /**
24
- * If `true`, the progress bar will show stripe.
16
+ * If `true`, the progress will be indeterminate and the `value` prop will be ignored.
25
17
  *
26
18
  * @default false
27
19
  */
28
- hasStripe?: boolean;
20
+ isAnimation?: boolean;
29
21
  /**
30
22
  * If `true`, and hasStripe is `true`, the stripes will be animated.
31
23
  *
@@ -33,21 +25,29 @@ interface ProgressOptions {
33
25
  */
34
26
  isStripeAnimation?: boolean;
35
27
  /**
36
- * If `true`, the progress will be indeterminate and the `value` prop will be ignored.
28
+ * The maximum value of the progress.
37
29
  *
38
- * @default false
30
+ * @default 100
39
31
  */
40
- isAnimation?: boolean;
32
+ max?: number;
33
+ /**
34
+ * The minimum value of the progress.
35
+ *
36
+ * @default 0
37
+ */
38
+ min?: number;
41
39
  /**
42
40
  * The animation speed in seconds.
43
41
  *
44
42
  * @default '1.4s'
45
43
  */
46
- speed?: string | number;
44
+ speed?: number | string;
47
45
  /**
48
- * The CSS `color` property.
46
+ * The value of the progress.
47
+ *
48
+ * @default 0
49
49
  */
50
- filledTrackColor?: ColorModeToken<CSS.Property.Color, "colors">;
50
+ value?: number;
51
51
  }
52
52
  interface ProgressProps extends HTMLUIProps, ThemeProps<"Progress">, ProgressOptions {
53
53
  }