@yamada-ui/progress 1.1.0-next-20240619220221 → 2.0.0-next-20240704080818

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,9 +33,6 @@ var Progress = forwardRef((props, ref) => {
33
33
  } = omitThemeProps(mergedProps, ["filledTrackColor"]);
34
34
  const borderRadius = (_b = _borderRadius != null ? _borderRadius : rounded) != null ? _b : (_a = styles.track) == null ? void 0 : _a.borderRadius;
35
35
  const css = {
36
- w: "100%",
37
- overflow: "hidden",
38
- pos: "relative",
39
36
  ...styles.track
40
37
  };
41
38
  return /* @__PURE__ */ jsx(ProgressProvider, { value: styles, children: /* @__PURE__ */ jsxs(
@@ -109,7 +106,6 @@ var ProgressFilledTrack = ({
109
106
  };
110
107
  const __css = {
111
108
  w: `${percent}%`,
112
- h: "100%",
113
109
  ...styles.filledTrack
114
110
  };
115
111
  return /* @__PURE__ */ jsx(ui.div, { css, __css, ...rest });
@@ -118,4 +114,4 @@ var ProgressFilledTrack = ({
118
114
  export {
119
115
  Progress
120
116
  };
121
- //# sourceMappingURL=chunk-JKDRLJJ6.mjs.map
117
+ //# sourceMappingURL=chunk-2ERWECSP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/progress.tsx"],"sourcesContent":["import type {\n HTMLUIProps,\n ThemeProps,\n CSSUIObject,\n Interpolation,\n ColorModeToken,\n CSS,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useMultiComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { createContext, cx, valueToPercent } from \"@yamada-ui/utils\"\nimport type { FC } from \"react\"\n\nconst [ProgressProvider, useProgress] = createContext<\n Record<string, CSSUIObject>\n>({\n name: `ProgressStylesContext`,\n errorMessage: `useProgress returned is 'undefined'. Seems you forgot to wrap the components in \"<Progress />\" `,\n})\n\ntype 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 type ProgressProps = HTMLUIProps<\"div\"> &\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] = useMultiComponentStyle(\"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 ...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\ntype ProgressFilledTrackProps = HTMLUIProps<\"div\"> & 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 ...styles.filledTrack,\n }\n\n return <ui.div css={css} __css={__css} {...rest} />\n}\n"],"mappings":";;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B,SAAS,eAAe,IAAI,sBAAsB;AA8F5C,SAOE,KAPF;AA3FN,IAAM,CAAC,kBAAkB,WAAW,IAAI,cAEtC;AAAA,EACA,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AA4DM,IAAM,WAAW,WAAiC,CAAC,OAAO,QAAQ;AAnFzE;AAoFE,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,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,IAAI,eAAe,aAAa,CAAC,k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D,QAAM,MAAyB;AAAA,IAC7B,GAAI,oBACA;AAAA,MACE,WAAW;AAAA,IACb,IACA,CAAC;AAAA,IACL,GAAI,cACA;AAAA,MACE,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,WAAW;AAAA,IACb,IACA,CAAC;AAAA,EACP;AAEA,QAAM,QAAqB;AAAA,IACzB,GAAG,GAAG,OAAO;AAAA,IACb,GAAG,OAAO;AAAA,EACZ;AAEA,SAAO,oBAAC,GAAG,KAAH,EAAO,KAAU,OAAe,GAAG,MAAM;AACnD;","names":[]}
package/dist/index.js CHANGED
@@ -55,9 +55,6 @@ var Progress = (0, import_core.forwardRef)((props, ref) => {
55
55
  } = (0, import_core.omitThemeProps)(mergedProps, ["filledTrackColor"]);
56
56
  const borderRadius = (_b = _borderRadius != null ? _borderRadius : rounded) != null ? _b : (_a = styles.track) == null ? void 0 : _a.borderRadius;
57
57
  const css = {
58
- w: "100%",
59
- overflow: "hidden",
60
- pos: "relative",
61
58
  ...styles.track
62
59
  };
63
60
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -131,7 +128,6 @@ var ProgressFilledTrack = ({
131
128
  };
132
129
  const __css = {
133
130
  w: `${percent}%`,
134
- h: "100%",
135
131
  ...styles.filledTrack
136
132
  };
137
133
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.div, { css, __css, ...rest });
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} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useMultiComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { createContext, cx, valueToPercent } from \"@yamada-ui/utils\"\nimport type { FC } from \"react\"\n\nconst [ProgressProvider, useProgress] = createContext<\n Record<string, CSSUIObject>\n>({\n name: `ProgressStylesContext`,\n errorMessage: `useProgress returned is 'undefined'. Seems you forgot to wrap the components in \"<Progress />\" `,\n})\n\ntype 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 type ProgressProps = HTMLUIProps<\"div\"> &\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] = useMultiComponentStyle(\"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\ntype ProgressFilledTrackProps = HTMLUIProps<\"div\"> & 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","import type { HTMLUIProps, CSSUIObject, CSSUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { useToken } from \"@yamada-ui/use-token\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { cx, valueToPercent } from \"@yamada-ui/utils\"\nimport type { FC } from \"react\"\n\ntype CircleProgressOptions = {\n /**\n * The CSS `box-size` property.\n *\n * @default '6rem'\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 type CircleProgressProps = Omit<HTMLUIProps<\"div\">, \"color\"> &\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 (\n {\n className,\n children,\n size = \"6rem\",\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 },\n ref,\n ) => {\n size = (useToken(\"sizes\", useValue(size)) ?? size) as string | number\n thickness = (useToken(\"sizes\", useValue(thickness)) ?? thickness) as\n | string\n | number\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 display: \"inline-block\",\n position: \"relative\",\n verticalAlign: \"middle\",\n fontSize: size,\n }\n\n const props: 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 size={size} 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 {...props}\n />\n </Shape>\n {children}\n </ui.div>\n )\n },\n)\n\ntype CircleProps = HTMLUIProps<\"circle\">\n\nconst Circle: FC<CircleProps> = ({ ...rest }) => (\n <ui.circle cx={50} cy={50} r={42} fill=\"transparent\" {...rest} />\n)\n\ntype ShapeProps = Omit<HTMLUIProps<\"svg\">, \"speed\"> &\n Pick<\n Required<CircleProgressProps>,\n \"children\" | \"size\" | \"isAnimation\" | \"speed\"\n >\n\nconst Shape: FC<ShapeProps> = ({ size, 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: size,\n ...(isAnimation ? { animation } : {}),\n }\n\n return <ui.svg viewBox=\"0 0 100 100\" __css={css} {...rest} />\n}\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQA,kBAKO;AACP,2BAA6B;AAC7B,mBAAkD;AAiG5C;AA9FN,IAAM,CAAC,kBAAkB,WAAW,QAAI,4BAEtC;AAAA,EACA,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AA4DM,IAAM,eAAW,wBAAiC,CAAC,OAAO,QAAQ;AAnFzE;AAoFE,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;AAAA,IACvB,GAAG;AAAA,IACH,UAAU;AAAA,IACV,KAAK;AAAA,IACL,GAAG,OAAO;AAAA,EACZ;AAEA,SACE,4CAAC,oBAAiB,OAAO,QACvB;AAAA,IAAC,eAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,eAAW,iBAAG,eAAe,SAAS;AAAA,MACtC,OAAO;AAAA,MACP;AAAA,MACC,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ACvB,SAAS;AAAA,IACT,SAAS;AAAA,IACT,GAAI,cAAc,EAAE,UAAU,IAAI,CAAC;AAAA,EACrC;AAEA,SAAO,6CAAC,gBAAG,KAAH,EAAO,SAAQ,eAAc,OAAO,KAAM,GAAG,MAAM;AAC7D;AAEO,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;","names":["import_core","import_use_animation","import_utils","import_jsx_runtime"]}
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} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useMultiComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { createContext, cx, valueToPercent } from \"@yamada-ui/utils\"\nimport type { FC } from \"react\"\n\nconst [ProgressProvider, useProgress] = createContext<\n Record<string, CSSUIObject>\n>({\n name: `ProgressStylesContext`,\n errorMessage: `useProgress returned is 'undefined'. Seems you forgot to wrap the components in \"<Progress />\" `,\n})\n\ntype 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 type ProgressProps = HTMLUIProps<\"div\"> &\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] = useMultiComponentStyle(\"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 ...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\ntype ProgressFilledTrackProps = HTMLUIProps<\"div\"> & 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 ...styles.filledTrack,\n }\n\n return <ui.div css={css} __css={__css} {...rest} />\n}\n","import type { HTMLUIProps, CSSUIObject, CSSUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { useToken } from \"@yamada-ui/use-token\"\nimport { useValue } from \"@yamada-ui/use-value\"\nimport { cx, valueToPercent } from \"@yamada-ui/utils\"\nimport type { FC } from \"react\"\n\ntype CircleProgressOptions = {\n /**\n * The CSS `box-size` property.\n *\n * @default '6rem'\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 type CircleProgressProps = Omit<HTMLUIProps<\"div\">, \"color\"> &\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 (\n {\n className,\n children,\n size = \"6rem\",\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 },\n ref,\n ) => {\n size = (useToken(\"sizes\", useValue(size)) ?? size) as string | number\n thickness = (useToken(\"sizes\", useValue(thickness)) ?? thickness) as\n | string\n | number\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 display: \"inline-block\",\n position: \"relative\",\n verticalAlign: \"middle\",\n fontSize: size,\n }\n\n const props: 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 size={size} 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 {...props}\n />\n </Shape>\n {children}\n </ui.div>\n )\n },\n)\n\ntype CircleProps = HTMLUIProps<\"circle\">\n\nconst Circle: FC<CircleProps> = ({ ...rest }) => (\n <ui.circle cx={50} cy={50} r={42} fill=\"transparent\" {...rest} />\n)\n\ntype ShapeProps = Omit<HTMLUIProps<\"svg\">, \"speed\"> &\n Pick<\n Required<CircleProgressProps>,\n \"children\" | \"size\" | \"isAnimation\" | \"speed\"\n >\n\nconst Shape: FC<ShapeProps> = ({ size, 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: size,\n ...(isAnimation ? { animation } : {}),\n }\n\n return <ui.svg viewBox=\"0 0 100 100\" __css={css} {...rest} />\n}\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQA,kBAKO;AACP,2BAA6B;AAC7B,mBAAkD;AA8F5C;AA3FN,IAAM,CAAC,kBAAkB,WAAW,QAAI,4BAEtC;AAAA,EACA,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AA4DM,IAAM,eAAW,wBA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AAAA,IACH;AAAA,EAEJ;AACF;AAIA,IAAM,SAA0B,CAAC,EAAE,GAAG,KAAK,MACzC,6CAAC,gBAAG,QAAH,EAAU,IAAI,IAAI,IAAI,IAAI,GAAG,IAAI,MAAK,eAAe,GAAG,MAAM;AASjE,IAAM,QAAwB,CAAC,EAAE,MAAM,aAAa,OAAO,GAAG,KAAK,MAAM;AACvE,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,SAAS;AAAA,IACT,GAAI,cAAc,EAAE,UAAU,IAAI,CAAC;AAAA,EACrC;AAEA,SAAO,6CAAC,gBAAG,KAAH,EAAO,SAAQ,eAAc,OAAO,KAAM,GAAG,MAAM;AAC7D;AAEO,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;","names":["import_core","import_use_animation","import_utils","import_jsx_runtime"]}
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-GJAFLWEF.mjs";
6
6
  import {
7
7
  Progress
8
- } from "./chunk-JKDRLJJ6.mjs";
8
+ } from "./chunk-2ERWECSP.mjs";
9
9
  export {
10
10
  CircleProgress,
11
11
  CircleProgressLabel,
package/dist/progress.js CHANGED
@@ -51,9 +51,6 @@ var Progress = (0, import_core.forwardRef)((props, ref) => {
51
51
  } = (0, import_core.omitThemeProps)(mergedProps, ["filledTrackColor"]);
52
52
  const borderRadius = (_b = _borderRadius != null ? _borderRadius : rounded) != null ? _b : (_a = styles.track) == null ? void 0 : _a.borderRadius;
53
53
  const css = {
54
- w: "100%",
55
- overflow: "hidden",
56
- pos: "relative",
57
54
  ...styles.track
58
55
  };
59
56
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -127,7 +124,6 @@ var ProgressFilledTrack = ({
127
124
  };
128
125
  const __css = {
129
126
  w: `${percent}%`,
130
- h: "100%",
131
127
  ...styles.filledTrack
132
128
  };
133
129
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.div, { css, __css, ...rest });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/progress.tsx"],"sourcesContent":["import type {\n HTMLUIProps,\n ThemeProps,\n CSSUIObject,\n Interpolation,\n ColorModeToken,\n CSS,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useMultiComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { createContext, cx, valueToPercent } from \"@yamada-ui/utils\"\nimport type { FC } from \"react\"\n\nconst [ProgressProvider, useProgress] = createContext<\n Record<string, CSSUIObject>\n>({\n name: `ProgressStylesContext`,\n errorMessage: `useProgress returned is 'undefined'. Seems you forgot to wrap the components in \"<Progress />\" `,\n})\n\ntype 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 type ProgressProps = HTMLUIProps<\"div\"> &\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] = useMultiComponentStyle(\"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\ntype ProgressFilledTrackProps = HTMLUIProps<\"div\"> & 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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,kBAKO;AACP,2BAA6B;AAC7B,mBAAkD;AAiG5C;AA9FN,IAAM,CAAC,kBAAkB,WAAW,QAAI,4BAEtC;AAAA,EACA,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AA4DM,IAAM,eAAW,wBAAiC,CAAC,OAAO,QAAQ;AAnFzE;AAoFE,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;AAAA,IACvB,GAAG;AAAA,IACH,UAAU;AAAA,IACV,KAAK;AAAA,IACL,GAAG,OAAO;AAAA,EACZ;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,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,WAAW;AAAA,IACb,IACA,CAAC;AAAA,EACP;AAEA,QAAM,QAAqB;AAAA,IACzB,GAAG,GAAG,OAAO;AAAA,IACb,GAAG;AAAA,IACH,GAAG,OAAO;AAAA,EACZ;AAEA,SAAO,4CAAC,eAAG,KAAH,EAAO,KAAU,OAAe,GAAG,MAAM;AACnD;","names":[]}
1
+ {"version":3,"sources":["../src/progress.tsx"],"sourcesContent":["import type {\n HTMLUIProps,\n ThemeProps,\n CSSUIObject,\n Interpolation,\n ColorModeToken,\n CSS,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useMultiComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { createContext, cx, valueToPercent } from \"@yamada-ui/utils\"\nimport type { FC } from \"react\"\n\nconst [ProgressProvider, useProgress] = createContext<\n Record<string, CSSUIObject>\n>({\n name: `ProgressStylesContext`,\n errorMessage: `useProgress returned is 'undefined'. Seems you forgot to wrap the components in \"<Progress />\" `,\n})\n\ntype 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 type ProgressProps = HTMLUIProps<\"div\"> &\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] = useMultiComponentStyle(\"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 ...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\ntype ProgressFilledTrackProps = HTMLUIProps<\"div\"> & 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 ...styles.filledTrack,\n }\n\n return <ui.div css={css} __css={__css} {...rest} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,kBAKO;AACP,2BAA6B;AAC7B,mBAAkD;AA8F5C;AA3FN,IAAM,CAAC,kBAAkB,WAAW,QAAI,4BAEtC;AAAA,EACA,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AA4DM,IAAM,eAAW,wBAAiC,CAAC,OAAO,QAAQ;AAnFzE;AAoFE,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;AAAA,IACvB,GAAG,OAAO;AAAA,EACZ;AAEA,SACE,4CAAC,oBAAiB,OAAO,QACvB;AAAA,IAAC,eAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,eAAW,iBAAG,eAAe,SAAS;AAAA,MACtC,OAAO;AAAA,MACP;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA,QACC;AAAA;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AAID,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SP.mjs";
5
5
  export {
6
6
  Progress
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/progress",
3
- "version": "1.1.0-next-20240619220221",
3
+ "version": "2.0.0-next-20240704080818",
4
4
  "description": "Yamada UI progress components",
5
5
  "keywords": [
6
6
  "yamada",
@@ -36,11 +36,11 @@
36
36
  "url": "https://github.com/yamada-ui/yamada-ui/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@yamada-ui/core": "1.7.2",
40
- "@yamada-ui/utils": "1.2.1",
41
- "@yamada-ui/use-value": "1.1.16",
42
- "@yamada-ui/use-token": "1.1.16",
43
- "@yamada-ui/use-animation": "1.0.28"
39
+ "@yamada-ui/core": "1.9.1-next-20240704080818",
40
+ "@yamada-ui/utils": "1.3.1-next-20240704080818",
41
+ "@yamada-ui/use-value": "1.1.19-next-20240704080818",
42
+ "@yamada-ui/use-token": "1.1.19-next-20240704080818",
43
+ "@yamada-ui/use-animation": "1.0.31-next-20240704080818"
44
44
  },
45
45
  "devDependencies": {
46
46
  "react": "^18.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/progress.tsx"],"sourcesContent":["import type {\n HTMLUIProps,\n ThemeProps,\n CSSUIObject,\n Interpolation,\n ColorModeToken,\n CSS,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useMultiComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { useAnimation } from \"@yamada-ui/use-animation\"\nimport { createContext, cx, valueToPercent } from \"@yamada-ui/utils\"\nimport type { FC } from \"react\"\n\nconst [ProgressProvider, useProgress] = createContext<\n Record<string, CSSUIObject>\n>({\n name: `ProgressStylesContext`,\n errorMessage: `useProgress returned is 'undefined'. Seems you forgot to wrap the components in \"<Progress />\" `,\n})\n\ntype 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 type ProgressProps = HTMLUIProps<\"div\"> &\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] = useMultiComponentStyle(\"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\ntype ProgressFilledTrackProps = HTMLUIProps<\"div\"> & 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"],"mappings":";;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B,SAAS,eAAe,IAAI,sBAAsB;AAiG5C,SAOE,KAPF;AA9FN,IAAM,CAAC,kBAAkB,WAAW,IAAI,cAEtC;AAAA,EACA,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AA4DM,IAAM,WAAW,WAAiC,CAAC,OAAO,QAAQ;AAnFzE;AAoFE,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,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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