@tamagui/progress 3.0.0-beta.924.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,11 +60,10 @@ const ProgressIndicator = (0, import_core.createStyledHOC)(ProgressIndicatorFram
60
60
  "data-max": context.max,
61
61
  x,
62
62
  width: "200%",
63
- animateOnly: ["transform"],
64
63
  ...!import_core.isWeb && context.width === 0 && { opacity: 0 },
65
64
  ...indicatorProps,
66
65
  ref: forwardedRef,
67
- transition: !import_core.isWeb && !context.width ? null : transition
66
+ transition: !import_core.isWeb && !context.width ? null : { transform: transition }
68
67
  });
69
68
  });
70
69
  function defaultGetValueLabel(value, max) {
@@ -83,17 +82,33 @@ function isValidValueNumber(value, max) {
83
82
  return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
84
83
  }
85
84
  const DEFAULT_MAX = 100;
85
+ const progressTrackHeight = {
86
+ xs: 4,
87
+ sm: 6,
88
+ md: 9,
89
+ lg: 12,
90
+ xl: 16
91
+ };
92
+ const resolveProgressSize = (val) => {
93
+ if (typeof val === "string" && val in progressTrackHeight) {
94
+ return progressTrackHeight[val];
95
+ }
96
+ const resolved = Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(val === true ? 36 : val)));
97
+ const base = Number.isFinite(resolved) ? resolved : Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(36)));
98
+ return Math.round(base * .25);
99
+ };
100
+ const getProgressSize = import_core.styled.dynamic((val) => {
101
+ const size = resolveProgressSize(val);
102
+ return {
103
+ height: size,
104
+ minWidth: size * 20,
105
+ width: "100%"
106
+ };
107
+ });
86
108
  const ProgressFrame = (0, import_core.styled)(import_stacks.YStack, {
87
109
  displayName: "Progress",
88
110
  overflow: "hidden",
89
- variants: { size: import_core.styled.dynamic((val) => {
90
- const size = Math.round((0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) * .25);
91
- return {
92
- height: size,
93
- minWidth: (0, import_core.getVariableValue)(size) * 20,
94
- width: "100%"
95
- };
96
- }) }
111
+ variants: { size: getProgressSize }
97
112
  });
98
113
  const Progress = (0, import_helpers.withStaticProperties)((0, import_core.createStyledHOC)(ProgressFrame, function Progress2(props, forwardedRef) {
99
114
  const { __scopeProgress, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, size = true, ...progressProps } = props;
@@ -64,11 +64,10 @@ var ProgressIndicator = (0, import_core.createStyledHOC)(ProgressIndicatorFrame,
64
64
  "data-max": context.max,
65
65
  x,
66
66
  width: "200%",
67
- animateOnly: ["transform"],
68
67
  ...!import_core.isWeb && context.width === 0 && { opacity: 0 },
69
68
  ...indicatorProps,
70
69
  ref: forwardedRef,
71
- transition: !import_core.isWeb && !context.width ? null : transition
70
+ transition: !import_core.isWeb && !context.width ? null : { transform: transition }
72
71
  });
73
72
  });
74
73
  function defaultGetValueLabel(value, max) {
@@ -87,17 +86,33 @@ function isValidValueNumber(value, max) {
87
86
  return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
88
87
  }
89
88
  var DEFAULT_MAX = 100;
89
+ var progressTrackHeight = {
90
+ xs: 4,
91
+ sm: 6,
92
+ md: 9,
93
+ lg: 12,
94
+ xl: 16
95
+ };
96
+ var resolveProgressSize = function(val) {
97
+ if (typeof val === "string" && val in progressTrackHeight) {
98
+ return progressTrackHeight[val];
99
+ }
100
+ var resolved = Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(val === true ? 36 : val)));
101
+ var base = Number.isFinite(resolved) ? resolved : Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(36)));
102
+ return Math.round(base * .25);
103
+ };
104
+ var getProgressSize = import_core.styled.dynamic(function(val) {
105
+ var size = resolveProgressSize(val);
106
+ return {
107
+ height: size,
108
+ minWidth: size * 20,
109
+ width: "100%"
110
+ };
111
+ });
90
112
  var ProgressFrame = (0, import_core.styled)(import_stacks.YStack, {
91
113
  displayName: "Progress",
92
114
  overflow: "hidden",
93
- variants: { size: import_core.styled.dynamic(function(val) {
94
- var size = Math.round((0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) * .25);
95
- return {
96
- height: size,
97
- minWidth: (0, import_core.getVariableValue)(size) * 20,
98
- width: "100%"
99
- };
100
- }) }
115
+ variants: { size: getProgressSize }
101
116
  });
102
117
  var Progress = (0, import_helpers.withStaticProperties)((0, import_core.createStyledHOC)(ProgressFrame, function Progress2(props, forwardedRef) {
103
118
  var { __scopeProgress, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, size = true, ...progressProps } = props;
@@ -64,11 +64,10 @@ var ProgressIndicator = (0, import_core.createStyledHOC)(ProgressIndicatorFrame,
64
64
  "data-max": context.max,
65
65
  x,
66
66
  width: "200%",
67
- animateOnly: ["transform"],
68
67
  ...!import_core.isWeb && context.width === 0 && { opacity: 0 },
69
68
  ...indicatorProps,
70
69
  ref: forwardedRef,
71
- transition: !import_core.isWeb && !context.width ? null : transition
70
+ transition: !import_core.isWeb && !context.width ? null : { transform: transition }
72
71
  });
73
72
  });
74
73
  function defaultGetValueLabel(value, max) {
@@ -87,17 +86,33 @@ function isValidValueNumber(value, max) {
87
86
  return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
88
87
  }
89
88
  var DEFAULT_MAX = 100;
89
+ var progressTrackHeight = {
90
+ xs: 4,
91
+ sm: 6,
92
+ md: 9,
93
+ lg: 12,
94
+ xl: 16
95
+ };
96
+ var resolveProgressSize = function(val) {
97
+ if (typeof val === "string" && val in progressTrackHeight) {
98
+ return progressTrackHeight[val];
99
+ }
100
+ var resolved = Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(val === true ? 36 : val)));
101
+ var base = Number.isFinite(resolved) ? resolved : Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(36)));
102
+ return Math.round(base * .25);
103
+ };
104
+ var getProgressSize = import_core.styled.dynamic(function(val) {
105
+ var size = resolveProgressSize(val);
106
+ return {
107
+ height: size,
108
+ minWidth: size * 20,
109
+ width: "100%"
110
+ };
111
+ });
90
112
  var ProgressFrame = (0, import_core.styled)(import_stacks.YStack, {
91
113
  displayName: "Progress",
92
114
  overflow: "hidden",
93
- variants: { size: import_core.styled.dynamic(function(val) {
94
- var size = Math.round((0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) * .25);
95
- return {
96
- height: size,
97
- minWidth: (0, import_core.getVariableValue)(size) * 20,
98
- width: "100%"
99
- };
100
- }) }
115
+ variants: { size: getProgressSize }
101
116
  });
102
117
  var Progress = (0, import_helpers.withStaticProperties)((0, import_core.createStyledHOC)(ProgressFrame, function Progress2(props, forwardedRef) {
103
118
  var { __scopeProgress, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, size = true, ...progressProps } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.native.js","names":[],"sources":["cjs/Progress.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Progress_exports = {};\n__export(Progress_exports, {\n Progress: () => Progress,\n ProgressFrame: () => ProgressFrame,\n ProgressIndicator: () => ProgressIndicator,\n ProgressIndicatorFrame: () => ProgressIndicatorFrame,\n createProgressScope: () => createProgressScope\n});\nmodule.exports = __toCommonJS(Progress_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_create_context = require(\"@tamagui/create-context\");\nvar import_get_token = require(\"@tamagui/get-token\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_react = require(\"react\");\nvar PROGRESS_NAME = \"Progress\";\nvar [createProgressContext, createProgressScope] = (0, import_create_context.createContextScope)(PROGRESS_NAME);\nvar [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nvar INDICATOR_NAME = \"ProgressIndicator\";\nvar ProgressIndicatorFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: INDICATOR_NAME,\n height: \"100%\",\n width: \"100%\"\n});\nvar ProgressIndicator = (0, import_core.createStyledHOC)(ProgressIndicatorFrame, function ProgressIndicator2(props, forwardedRef) {\n var { __scopeProgress, transition, ...indicatorProps } = props;\n var context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n var _context_value;\n var progressRatio = ((_context_value = context.value) !== null && _context_value !== void 0 ? _context_value : 0) / context.max;\n var x;\n if (import_core.isWeb) {\n x = `${-100 + progressRatio * 50}%`;\n } else {\n var baseWidth = context.width || 0;\n x = Math.ceil(-baseWidth * (2 - progressRatio));\n }\n var _context_value1;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressIndicatorFrame, {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": (_context_value1 = context.value) !== null && _context_value1 !== void 0 ? _context_value1 : void 0,\n \"data-max\": context.max,\n x,\n width: \"200%\",\n animateOnly: [\n \"transform\"\n ],\n ...!import_core.isWeb && context.width === 0 && {\n opacity: 0\n },\n ...indicatorProps,\n ref: forwardedRef,\n transition: !import_core.isWeb && !context.width ? null : transition\n });\n});\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !Number.isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;\n}\nvar DEFAULT_MAX = 100;\nvar ProgressFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: \"Progress\",\n overflow: \"hidden\",\n variants: {\n size: import_core.styled.dynamic(function(val) {\n var size = Math.round((0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) * 0.25);\n return {\n height: size,\n minWidth: (0, import_core.getVariableValue)(size) * 20,\n width: \"100%\"\n };\n })\n }\n});\nvar Progress = (0, import_helpers.withStaticProperties)((0, import_core.createStyledHOC)(ProgressFrame, function Progress2(props, forwardedRef) {\n var {\n // @ts-expect-error\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = true,\n ...progressProps\n } = props;\n var max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n var value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;\n var valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n var [width, setWidth] = (0, import_react.useState)(0);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressProvider, {\n scope: __scopeProgress,\n value,\n max,\n width,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressFrame, {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n // @ts-ignore\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value !== null && value !== void 0 ? value : void 0,\n \"data-max\": max,\n size,\n ...progressProps,\n ...!import_core.isWeb && {\n onLayout: function(e) {\n var _progressProps_onLayout;\n var newWidth = Math.round(e.nativeEvent.layout.width);\n if (newWidth !== width) {\n setWidth(newWidth);\n }\n (_progressProps_onLayout = progressProps.onLayout) === null || _progressProps_onLayout === void 0 ? void 0 : _progressProps_onLayout.call(progressProps, e);\n }\n },\n ref: forwardedRef\n })\n });\n}), {\n Indicator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,QAAQ,KAAK;GAChD,kBAAkB;GAElB,MAAM;GACN,cAAc,iBAAiB,OAAO,GAAG;GACzC,cAAc,UAAU,QAAQ,UAAU,KAAK,IAAI,QAAQ,KAAK;GAChE,YAAY;GACZ;GACA,GAAG;GACH,GAAG,CAAC,YAAY,SAAS,EACvB,UAAU,SAAS,GAAG;IACpB,IAAI;IACJ,IAAI,WAAW,KAAK,MAAM,EAAE,YAAY,OAAO,KAAK;IACpD,IAAI,aAAa,OAAO;KACtB,SAAS,QAAQ;IACnB;IACA,CAAC,0BAA0B,cAAc,cAAc,QAAQ,4BAA4B,KAAK,IAAI,KAAK,IAAI,wBAAwB,KAAK,eAAe,CAAC;GAC5J,EACF;GACA,KAAK;EACP,CAAC;CACH,CAAC;AACH,CAAC,GAAG,EACF,WAAW,kBACb,CAAC"}
1
+ {"version":3,"file":"Progress.native.js","names":[],"sources":["cjs/Progress.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Progress_exports = {};\n__export(Progress_exports, {\n Progress: () => Progress,\n ProgressFrame: () => ProgressFrame,\n ProgressIndicator: () => ProgressIndicator,\n ProgressIndicatorFrame: () => ProgressIndicatorFrame,\n createProgressScope: () => createProgressScope\n});\nmodule.exports = __toCommonJS(Progress_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_create_context = require(\"@tamagui/create-context\");\nvar import_get_token = require(\"@tamagui/get-token\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_react = require(\"react\");\nvar PROGRESS_NAME = \"Progress\";\nvar [createProgressContext, createProgressScope] = (0, import_create_context.createContextScope)(PROGRESS_NAME);\nvar [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nvar INDICATOR_NAME = \"ProgressIndicator\";\nvar ProgressIndicatorFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: INDICATOR_NAME,\n height: \"100%\",\n width: \"100%\"\n});\nvar ProgressIndicator = (0, import_core.createStyledHOC)(ProgressIndicatorFrame, function ProgressIndicator2(props, forwardedRef) {\n var { __scopeProgress, transition, ...indicatorProps } = props;\n var context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n var _context_value;\n var progressRatio = ((_context_value = context.value) !== null && _context_value !== void 0 ? _context_value : 0) / context.max;\n var x;\n if (import_core.isWeb) {\n x = `${-100 + progressRatio * 50}%`;\n } else {\n var baseWidth = context.width || 0;\n x = Math.ceil(-baseWidth * (2 - progressRatio));\n }\n var _context_value1;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressIndicatorFrame, {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": (_context_value1 = context.value) !== null && _context_value1 !== void 0 ? _context_value1 : void 0,\n \"data-max\": context.max,\n x,\n width: \"200%\",\n ...!import_core.isWeb && context.width === 0 && {\n opacity: 0\n },\n ...indicatorProps,\n ref: forwardedRef,\n // only the indicator's slide transitions; `width` is a layout jump\n transition: !import_core.isWeb && !context.width ? null : {\n transform: transition\n }\n });\n});\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !Number.isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;\n}\nvar DEFAULT_MAX = 100;\nvar progressTrackHeight = {\n xs: 4,\n sm: 6,\n md: 9,\n lg: 12,\n xl: 16\n};\nvar resolveProgressSize = function(val) {\n if (typeof val === \"string\" && val in progressTrackHeight) {\n return progressTrackHeight[val];\n }\n var resolved = Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(val === true ? 36 : val)));\n var base = Number.isFinite(resolved) ? resolved : Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(36)));\n return Math.round(base * 0.25);\n};\nvar getProgressSize = import_core.styled.dynamic(function(val) {\n var size = resolveProgressSize(val);\n return {\n height: size,\n minWidth: size * 20,\n width: \"100%\"\n };\n});\nvar ProgressFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: \"Progress\",\n overflow: \"hidden\",\n variants: {\n size: getProgressSize\n }\n});\nvar Progress = (0, import_helpers.withStaticProperties)((0, import_core.createStyledHOC)(ProgressFrame, function Progress2(props, forwardedRef) {\n var {\n // @ts-expect-error\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = true,\n ...progressProps\n } = props;\n var max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n var value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;\n var valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n var [width, setWidth] = (0, import_react.useState)(0);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressProvider, {\n scope: __scopeProgress,\n value,\n max,\n width,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressFrame, {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n // @ts-ignore\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value !== null && value !== void 0 ? value : void 0,\n \"data-max\": max,\n size,\n ...progressProps,\n ...!import_core.isWeb && {\n onLayout: function(e) {\n var _progressProps_onLayout;\n var newWidth = Math.round(e.nativeEvent.layout.width);\n if (newWidth !== width) {\n setWidth(newWidth);\n }\n (_progressProps_onLayout = progressProps.onLayout) === null || _progressProps_onLayout === void 0 ? void 0 : _progressProps_onLayout.call(progressProps, e);\n }\n },\n ref: forwardedRef\n })\n });\n}), {\n Indicator: ProgressIndicator\n});\n//# sourceMappingURL=Progress.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,mBAAmB,CAAC;AACxB,SAAS,kBAAkB;CACzB,gBAAgB;CAChB,qBAAqB;CACrB,yBAAyB;CACzB,8BAA8B;CAC9B,2BAA2B;AAC7B,CAAC;AACD,OAAO,UAAU,aAAa,gBAAgB;AAC9C,IAAI,qBAAqB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@@ -32,11 +32,10 @@ const ProgressIndicator = createStyledHOC(ProgressIndicatorFrame, function Progr
32
32
  "data-max": context.max,
33
33
  x,
34
34
  width: "200%",
35
- animateOnly: ["transform"],
36
35
  ...!isWeb && context.width === 0 && { opacity: 0 },
37
36
  ...indicatorProps,
38
37
  ref: forwardedRef,
39
- transition: !isWeb && !context.width ? null : transition
38
+ transition: !isWeb && !context.width ? null : { transform: transition }
40
39
  });
41
40
  });
42
41
  function defaultGetValueLabel(value, max) {
@@ -55,17 +54,33 @@ function isValidValueNumber(value, max) {
55
54
  return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
56
55
  }
57
56
  const DEFAULT_MAX = 100;
57
+ const progressTrackHeight = {
58
+ xs: 4,
59
+ sm: 6,
60
+ md: 9,
61
+ lg: 12,
62
+ xl: 16
63
+ };
64
+ const resolveProgressSize = (val) => {
65
+ if (typeof val === "string" && val in progressTrackHeight) {
66
+ return progressTrackHeight[val];
67
+ }
68
+ const resolved = Number(getVariableValue(getSize(val === true ? 36 : val)));
69
+ const base = Number.isFinite(resolved) ? resolved : Number(getVariableValue(getSize(36)));
70
+ return Math.round(base * .25);
71
+ };
72
+ const getProgressSize = styled.dynamic((val) => {
73
+ const size = resolveProgressSize(val);
74
+ return {
75
+ height: size,
76
+ minWidth: size * 20,
77
+ width: "100%"
78
+ };
79
+ });
58
80
  const ProgressFrame = styled(YStack, {
59
81
  displayName: "Progress",
60
82
  overflow: "hidden",
61
- variants: { size: styled.dynamic((val) => {
62
- const size = Math.round(getVariableValue(getSize(val)) * .25);
63
- return {
64
- height: size,
65
- minWidth: getVariableValue(size) * 20,
66
- width: "100%"
67
- };
68
- }) }
83
+ variants: { size: getProgressSize }
69
84
  });
70
85
  const Progress = withStaticProperties(createStyledHOC(ProgressFrame, function Progress2(props, forwardedRef) {
71
86
  const { __scopeProgress, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, size = true, ...progressProps } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.js","names":[],"sources":["esm/Progress.js"],"sourcesContent":["import { createStyledHOC, getVariableValue, isWeb, styled } from \"@tamagui/core\";\nimport { createContextScope } from \"@tamagui/create-context\";\nimport { getSize } from \"@tamagui/get-token\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst PROGRESS_NAME = \"Progress\";\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\nconst [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nconst INDICATOR_NAME = \"ProgressIndicator\";\nconst ProgressIndicatorFrame = styled(YStack, {\n displayName: INDICATOR_NAME,\n height: \"100%\",\n width: \"100%\"\n});\nconst ProgressIndicator = createStyledHOC(\n ProgressIndicatorFrame,\n function ProgressIndicator2(props, forwardedRef) {\n const { __scopeProgress, transition, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n const progressRatio = (context.value ?? 0) / context.max;\n let x;\n if (isWeb) {\n x = `${-100 + progressRatio * 50}%`;\n } else {\n const baseWidth = context.width || 0;\n x = Math.ceil(-baseWidth * (2 - progressRatio));\n }\n return /* @__PURE__ */ jsx(\n ProgressIndicatorFrame,\n {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": context.value ?? void 0,\n \"data-max\": context.max,\n x,\n width: \"200%\",\n animateOnly: [\"transform\"],\n ...!isWeb && context.width === 0 && { opacity: 0 },\n ...indicatorProps,\n ref: forwardedRef,\n transition: !isWeb && !context.width ? null : transition\n }\n );\n }\n);\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !Number.isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;\n}\nconst DEFAULT_MAX = 100;\nconst ProgressFrame = styled(YStack, {\n displayName: \"Progress\",\n overflow: \"hidden\",\n variants: {\n size: styled.dynamic((val) => {\n const size = Math.round(getVariableValue(getSize(val)) * 0.25);\n return {\n height: size,\n minWidth: getVariableValue(size) * 20,\n width: \"100%\"\n };\n })\n }\n});\nconst Progress = withStaticProperties(\n createStyledHOC(ProgressFrame, function Progress2(props, forwardedRef) {\n const {\n // @ts-expect-error\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = true,\n ...progressProps\n } = props;\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n const value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n const [width, setWidth] = useState(0);\n return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, width, children: /* @__PURE__ */ jsx(\n ProgressFrame,\n {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value ?? void 0,\n \"data-max\": max,\n size,\n ...progressProps,\n ...!isWeb && {\n onLayout: (e) => {\n const newWidth = Math.round(e.nativeEvent.layout.width);\n if (newWidth !== width) {\n setWidth(newWidth);\n }\n progressProps.onLayout?.(e);\n }\n },\n ref: forwardedRef\n }\n ) });\n }),\n {\n Indicator: ProgressIndicator\n }\n);\nexport {\n Progress,\n ProgressFrame,\n ProgressIndicator,\n ProgressIndicatorFrame,\n createProgressScope\n};\n//# sourceMappingURL=Progress.js.map\n"],"mappings":";;;;;;;;;AAOA,MAAM,gBAAgB;AACtB,MAAM,CAAC,uBAAuB,uBAAuB,mBAAmB,aAAa;AACrF,MAAM,CAAC,kBAAkB,sBAAsB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Progress.js"],"sourcesContent":["import { createStyledHOC, getVariableValue, isWeb, styled } from \"@tamagui/core\";\nimport { createContextScope } from \"@tamagui/create-context\";\nimport { getSize } from \"@tamagui/get-token\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst PROGRESS_NAME = \"Progress\";\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\nconst [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nconst INDICATOR_NAME = \"ProgressIndicator\";\nconst ProgressIndicatorFrame = styled(YStack, {\n displayName: INDICATOR_NAME,\n height: \"100%\",\n width: \"100%\"\n});\nconst ProgressIndicator = createStyledHOC(\n ProgressIndicatorFrame,\n function ProgressIndicator2(props, forwardedRef) {\n const { __scopeProgress, transition, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n const progressRatio = (context.value ?? 0) / context.max;\n let x;\n if (isWeb) {\n x = `${-100 + progressRatio * 50}%`;\n } else {\n const baseWidth = context.width || 0;\n x = Math.ceil(-baseWidth * (2 - progressRatio));\n }\n return /* @__PURE__ */ jsx(\n ProgressIndicatorFrame,\n {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": context.value ?? void 0,\n \"data-max\": context.max,\n x,\n width: \"200%\",\n ...!isWeb && context.width === 0 && { opacity: 0 },\n ...indicatorProps,\n ref: forwardedRef,\n transition: !isWeb && !context.width ? null : { transform: transition }\n }\n );\n }\n);\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !Number.isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;\n}\nconst DEFAULT_MAX = 100;\nconst progressTrackHeight = {\n xs: 4,\n sm: 6,\n md: 9,\n lg: 12,\n xl: 16\n};\nconst resolveProgressSize = (val) => {\n if (typeof val === \"string\" && val in progressTrackHeight) {\n return progressTrackHeight[val];\n }\n const resolved = Number(getVariableValue(getSize(val === true ? 36 : val)));\n const base = Number.isFinite(resolved) ? resolved : Number(getVariableValue(getSize(36)));\n return Math.round(base * 0.25);\n};\nconst getProgressSize = styled.dynamic((val) => {\n const size = resolveProgressSize(val);\n return {\n height: size,\n minWidth: size * 20,\n width: \"100%\"\n };\n});\nconst ProgressFrame = styled(YStack, {\n displayName: \"Progress\",\n overflow: \"hidden\",\n variants: {\n size: getProgressSize\n }\n});\nconst Progress = withStaticProperties(\n createStyledHOC(ProgressFrame, function Progress2(props, forwardedRef) {\n const {\n // @ts-expect-error\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = true,\n ...progressProps\n } = props;\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n const value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n const [width, setWidth] = useState(0);\n return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, width, children: /* @__PURE__ */ jsx(\n ProgressFrame,\n {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value ?? void 0,\n \"data-max\": max,\n size,\n ...progressProps,\n ...!isWeb && {\n onLayout: (e) => {\n const newWidth = Math.round(e.nativeEvent.layout.width);\n if (newWidth !== width) {\n setWidth(newWidth);\n }\n progressProps.onLayout?.(e);\n }\n },\n ref: forwardedRef\n }\n ) });\n }),\n {\n Indicator: ProgressIndicator\n }\n);\nexport {\n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S,CAAC;CACpC,OAAuB,oBAAI,kBAAkB;EAAE,OAAO;EAAiB;EAAO;EAAK;EAAO,UAA0B,oBAClH,eACA;GACE,iBAAiB;GACjB,iBAAiB;GACjB,iBAAiB,SAAS,KAAK,IAAI,QAAQ,KAAK;GAChD,kBAAkB;GAClB,MAAM;GACN,cAAc,iBAAiB,OAAO,GAAG;GACzC,cAAc,SAAS,KAAK;GAC5B,YAAY;GACZ;GACA,GAAG;GACH,GAAG,CAAC,SAAS,EACX,WAAW,MAAM;IACf,MAAM,WAAW,KAAK,MAAM,EAAE,YAAY,OAAO,KAAK;IACtD,IAAI,aAAa,OAAO;KACtB,SAAS,QAAQ;IACnB;IACA,cAAc,WAAW,CAAC;GAC5B,EACF;GACA,KAAK;EACP,CACF;CAAE,CAAC;AACL,CAAC,GACD,EACE,WAAW,kBACb,CACF"}
@@ -34,11 +34,10 @@ var ProgressIndicator = createStyledHOC(ProgressIndicatorFrame, function Progres
34
34
  "data-max": context.max,
35
35
  x,
36
36
  width: "200%",
37
- animateOnly: ["transform"],
38
37
  ...!isWeb && context.width === 0 && { opacity: 0 },
39
38
  ...indicatorProps,
40
39
  ref: forwardedRef,
41
- transition: !isWeb && !context.width ? null : transition
40
+ transition: !isWeb && !context.width ? null : { transform: transition }
42
41
  });
43
42
  });
44
43
  function defaultGetValueLabel(value, max) {
@@ -57,17 +56,33 @@ function isValidValueNumber(value, max) {
57
56
  return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
58
57
  }
59
58
  var DEFAULT_MAX = 100;
59
+ var progressTrackHeight = {
60
+ xs: 4,
61
+ sm: 6,
62
+ md: 9,
63
+ lg: 12,
64
+ xl: 16
65
+ };
66
+ var resolveProgressSize = function(val) {
67
+ if (typeof val === "string" && val in progressTrackHeight) {
68
+ return progressTrackHeight[val];
69
+ }
70
+ var resolved = Number(getVariableValue(getSize(val === true ? 36 : val)));
71
+ var base = Number.isFinite(resolved) ? resolved : Number(getVariableValue(getSize(36)));
72
+ return Math.round(base * .25);
73
+ };
74
+ var getProgressSize = styled.dynamic(function(val) {
75
+ var size = resolveProgressSize(val);
76
+ return {
77
+ height: size,
78
+ minWidth: size * 20,
79
+ width: "100%"
80
+ };
81
+ });
60
82
  var ProgressFrame = styled(YStack, {
61
83
  displayName: "Progress",
62
84
  overflow: "hidden",
63
- variants: { size: styled.dynamic(function(val) {
64
- var size = Math.round(getVariableValue(getSize(val)) * .25);
65
- return {
66
- height: size,
67
- minWidth: getVariableValue(size) * 20,
68
- width: "100%"
69
- };
70
- }) }
85
+ variants: { size: getProgressSize }
71
86
  });
72
87
  var Progress = withStaticProperties(createStyledHOC(ProgressFrame, function Progress2(props, forwardedRef) {
73
88
  var { __scopeProgress, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, size = true, ...progressProps } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.native.js","names":[],"sources":["esm/Progress.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createStyledHOC, getVariableValue, isWeb, styled } from \"@tamagui/core\";\nimport { createContextScope } from \"@tamagui/create-context\";\nimport { getSize } from \"@tamagui/get-token\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { useState } from \"react\";\nvar PROGRESS_NAME = \"Progress\";\nvar [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\nvar [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nvar INDICATOR_NAME = \"ProgressIndicator\";\nvar ProgressIndicatorFrame = styled(YStack, {\n displayName: INDICATOR_NAME,\n height: \"100%\",\n width: \"100%\"\n});\nvar ProgressIndicator = createStyledHOC(ProgressIndicatorFrame, function ProgressIndicator2(props, forwardedRef) {\n var { __scopeProgress, transition, ...indicatorProps } = props;\n var context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n var _context_value;\n var progressRatio = ((_context_value = context.value) !== null && _context_value !== void 0 ? _context_value : 0) / context.max;\n var x;\n if (isWeb) {\n x = `${-100 + progressRatio * 50}%`;\n } else {\n var baseWidth = context.width || 0;\n x = Math.ceil(-baseWidth * (2 - progressRatio));\n }\n var _context_value1;\n return /* @__PURE__ */ _jsx(ProgressIndicatorFrame, {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": (_context_value1 = context.value) !== null && _context_value1 !== void 0 ? _context_value1 : void 0,\n \"data-max\": context.max,\n x,\n width: \"200%\",\n animateOnly: [\n \"transform\"\n ],\n ...!isWeb && context.width === 0 && {\n opacity: 0\n },\n ...indicatorProps,\n ref: forwardedRef,\n transition: !isWeb && !context.width ? null : transition\n });\n});\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !Number.isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;\n}\nvar DEFAULT_MAX = 100;\nvar ProgressFrame = styled(YStack, {\n displayName: \"Progress\",\n overflow: \"hidden\",\n variants: {\n size: styled.dynamic(function(val) {\n var size = Math.round(getVariableValue(getSize(val)) * 0.25);\n return {\n height: size,\n minWidth: getVariableValue(size) * 20,\n width: \"100%\"\n };\n })\n }\n});\nvar Progress = withStaticProperties(createStyledHOC(ProgressFrame, function Progress2(props, forwardedRef) {\n var {\n // @ts-expect-error\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = true,\n ...progressProps\n } = props;\n var max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n var value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;\n var valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n var [width, setWidth] = useState(0);\n return /* @__PURE__ */ _jsx(ProgressProvider, {\n scope: __scopeProgress,\n value,\n max,\n width,\n children: /* @__PURE__ */ _jsx(ProgressFrame, {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n // @ts-ignore\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value !== null && value !== void 0 ? value : void 0,\n \"data-max\": max,\n size,\n ...progressProps,\n ...!isWeb && {\n onLayout: function(e) {\n var _progressProps_onLayout;\n var newWidth = Math.round(e.nativeEvent.layout.width);\n if (newWidth !== width) {\n setWidth(newWidth);\n }\n (_progressProps_onLayout = progressProps.onLayout) === null || _progressProps_onLayout === void 0 ? void 0 : _progressProps_onLayout.call(progressProps, e);\n }\n },\n ref: forwardedRef\n })\n });\n}), {\n Indicator: ProgressIndicator\n});\nexport {\n Progress,\n ProgressFrame,\n ProgressIndicator,\n ProgressIndicatorFrame,\n createProgressScope\n};\n//# sourceMappingURL=Progress.js.map\n"],"mappings":";;;;;;;;;AAOA,IAAI,gBAAgB;AACpB,IAAI,CAAC,uBAAuB,uBAAuB,mBAAmB,aAAa;AACnF,IAAI,CAAC,kBAAkB,sBAAsB,sBAAsB,aAAa;AAChF,IAAI,iBAAiB;AACrB,IAAI,yBAAyB,OAAO,QAAQ;CAC1C,aAAa;CACb,QAAQ;CACR,OAAO;AACT,CAAC;AACD,IAAI,oBAAoB,gBAAgB,wBAAwB,SAAS,mBAAmB,OAAO,cAAc;CAC/G,IAAI,EAAE,iBAAiB,YAAY,GAAG,mBAAmB;CACzD,IAAI,UAAU,mBAAmB,gBAAgB,eAAe;CAChE,IAAI;CACJ,IAAI,kBAAkB,iBAAiB,QAAQ,WAAW,QAAQ,mBAAmB,KAAK,IAAI,iBAAiB,KAAK,QAAQ;CAC5H,IAAI;CACJ,IAAI,OAAO;EACT,IAAI,GAAG,CAAC,MAAM,gBAAgB,GAAG;CACnC,OAAO;EACL,IAAI,YAAY,QAAQ,SAAS;EACjC,IAAI,K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AEF,iBACA,OAAO,WACP,KAAK,SACL,gBAAgB,sBAChB,OAAO,MACP,GAAG,kBACD;CACJ,IAAI,MAAM,iBAAiB,OAAO,IAAI,UAAU;CAChD,IAAI,QAAQ,mBAAmB,WAAW,GAAG,IAAI,KAAK,MAAM,SAAS,IAAI;CACzE,IAAI,aAAa,SAAS,KAAK,IAAI,cAAc,OAAO,GAAG,IAAI,KAAK;CACpE,IAAI,CAAC,OAAO,YAAY,SAAS,CAAC;CAClC,OAAuB,oBAAK,kBAAkB;EAC5C,OAAO;EACP;EACA;EACA;EACA,UAA0B,oBAAK,eAAe;GAC5C,iBAAiB;GACjB,iBAAiB;GACjB,iBAAiB,SAAS,KAAK,IAAI,QAAQ,KAAK;GAChD,kBAAkB;GAElB,MAAM;GACN,cAAc,iBAAiB,OAAO,GAAG;GACzC,cAAc,UAAU,QAAQ,UAAU,KAAK,IAAI,QAAQ,KAAK;GAChE,YAAY;GACZ;GACA,GAAG;GACH,GAAG,CAAC,SAAS,EACX,UAAU,SAAS,GAAG;IACpB,IAAI;IACJ,IAAI,WAAW,KAAK,MAAM,EAAE,YAAY,OAAO,KAAK;IACpD,IAAI,aAAa,OAAO;KACtB,SAAS,QAAQ;IACnB;IACA,CAAC,0BAA0B,cAAc,cAAc,QAAQ,4BAA4B,KAAK,IAAI,KAAK,IAAI,wBAAwB,KAAK,eAAe,CAAC;GAC5J,EACF;GACA,KAAK;EACP,CAAC;CACH,CAAC;AACH,CAAC,GAAG,EACF,WAAW,kBACb,CAAC"}
1
+ {"version":3,"file":"Progress.native.js","names":[],"sources":["esm/Progress.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createStyledHOC, getVariableValue, isWeb, styled } from \"@tamagui/core\";\nimport { createContextScope } from \"@tamagui/create-context\";\nimport { getSize } from \"@tamagui/get-token\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { useState } from \"react\";\nvar PROGRESS_NAME = \"Progress\";\nvar [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\nvar [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nvar INDICATOR_NAME = \"ProgressIndicator\";\nvar ProgressIndicatorFrame = styled(YStack, {\n displayName: INDICATOR_NAME,\n height: \"100%\",\n width: \"100%\"\n});\nvar ProgressIndicator = createStyledHOC(ProgressIndicatorFrame, function ProgressIndicator2(props, forwardedRef) {\n var { __scopeProgress, transition, ...indicatorProps } = props;\n var context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n var _context_value;\n var progressRatio = ((_context_value = context.value) !== null && _context_value !== void 0 ? _context_value : 0) / context.max;\n var x;\n if (isWeb) {\n x = `${-100 + progressRatio * 50}%`;\n } else {\n var baseWidth = context.width || 0;\n x = Math.ceil(-baseWidth * (2 - progressRatio));\n }\n var _context_value1;\n return /* @__PURE__ */ _jsx(ProgressIndicatorFrame, {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": (_context_value1 = context.value) !== null && _context_value1 !== void 0 ? _context_value1 : void 0,\n \"data-max\": context.max,\n x,\n width: \"200%\",\n ...!isWeb && context.width === 0 && {\n opacity: 0\n },\n ...indicatorProps,\n ref: forwardedRef,\n // only the indicator's slide transitions; `width` is a layout jump\n transition: !isWeb && !context.width ? null : {\n transform: transition\n }\n });\n});\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !Number.isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;\n}\nvar DEFAULT_MAX = 100;\nvar progressTrackHeight = {\n xs: 4,\n sm: 6,\n md: 9,\n lg: 12,\n xl: 16\n};\nvar resolveProgressSize = function(val) {\n if (typeof val === \"string\" && val in progressTrackHeight) {\n return progressTrackHeight[val];\n }\n var resolved = Number(getVariableValue(getSize(val === true ? 36 : val)));\n var base = Number.isFinite(resolved) ? resolved : Number(getVariableValue(getSize(36)));\n return Math.round(base * 0.25);\n};\nvar getProgressSize = styled.dynamic(function(val) {\n var size = resolveProgressSize(val);\n return {\n height: size,\n minWidth: size * 20,\n width: \"100%\"\n };\n});\nvar ProgressFrame = styled(YStack, {\n displayName: \"Progress\",\n overflow: \"hidden\",\n variants: {\n size: getProgressSize\n }\n});\nvar Progress = withStaticProperties(createStyledHOC(ProgressFrame, function Progress2(props, forwardedRef) {\n var {\n // @ts-expect-error\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = true,\n ...progressProps\n } = props;\n var max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n var value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;\n var valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n var [width, setWidth] = useState(0);\n return /* @__PURE__ */ _jsx(ProgressProvider, {\n scope: __scopeProgress,\n value,\n max,\n width,\n children: /* @__PURE__ */ _jsx(ProgressFrame, {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n // @ts-ignore\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value !== null && value !== void 0 ? value : void 0,\n \"data-max\": max,\n size,\n ...progressProps,\n ...!isWeb && {\n onLayout: function(e) {\n var _progressProps_onLayout;\n var newWidth = Math.round(e.nativeEvent.layout.width);\n if (newWidth !== width) {\n setWidth(newWidth);\n }\n (_progressProps_onLayout = progressProps.onLayout) === null || _progressProps_onLayout === void 0 ? void 0 : _progressProps_onLayout.call(progressProps, e);\n }\n },\n ref: forwardedRef\n })\n });\n}), {\n Indicator: ProgressIndicator\n});\nexport {\n Progress,\n ProgressFrame,\n ProgressInd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;CACzE,IAAI,aAAa,SAAS,KAAK,IAAI,cAAc,OAAO,GAAG,IAAI,KAAK;CACpE,IAAI,CAAC,OAAO,YAAY,SAAS,CAAC;CAClC,OAAuB,oBAAK,kBAAkB;EAC5C,OAAO;EACP;EACA;EACA;EACA,UAA0B,oBAAK,eAAe;GAC5C,iBAAiB;GACjB,iBAAiB;GACjB,iBAAiB,SAAS,KAAK,IAAI,QAAQ,KAAK;GAChD,kBAAkB;GAElB,MAAM;GACN,cAAc,iBAAiB,OAAO,GAAG;GACzC,cAAc,UAAU,QAAQ,UAAU,KAAK,IAAI,QAAQ,KAAK;GAChE,YAAY;GACZ;GACA,GAAG;GACH,GAAG,CAAC,SAAS,EACX,UAAU,SAAS,GAAG;IACpB,IAAI;IACJ,IAAI,WAAW,KAAK,MAAM,EAAE,YAAY,OAAO,KAAK;IACpD,IAAI,aAAa,OAAO;KACtB,SAAS,QAAQ;IACnB;IACA,CAAC,0BAA0B,cAAc,cAAc,QAAQ,4BAA4B,KAAK,IAAI,KAAK,IAAI,wBAAwB,KAAK,eAAe,CAAC;GAC5J,EACF;GACA,KAAK;EACP,CAAC;CACH,CAAC;AACH,CAAC,GAAG,EACF,WAAW,kBACb,CAAC"}
@@ -32,11 +32,10 @@ const ProgressIndicator = createStyledHOC(ProgressIndicatorFrame, function Progr
32
32
  "data-max": context.max,
33
33
  x,
34
34
  width: "200%",
35
- animateOnly: ["transform"],
36
35
  ...!isWeb && context.width === 0 && { opacity: 0 },
37
36
  ...indicatorProps,
38
37
  ref: forwardedRef,
39
- transition: !isWeb && !context.width ? null : transition
38
+ transition: !isWeb && !context.width ? null : { transform: transition }
40
39
  });
41
40
  });
42
41
  function defaultGetValueLabel(value, max) {
@@ -55,17 +54,33 @@ function isValidValueNumber(value, max) {
55
54
  return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
56
55
  }
57
56
  const DEFAULT_MAX = 100;
57
+ const progressTrackHeight = {
58
+ xs: 4,
59
+ sm: 6,
60
+ md: 9,
61
+ lg: 12,
62
+ xl: 16
63
+ };
64
+ const resolveProgressSize = (val) => {
65
+ if (typeof val === "string" && val in progressTrackHeight) {
66
+ return progressTrackHeight[val];
67
+ }
68
+ const resolved = Number(getVariableValue(getSize(val === true ? 36 : val)));
69
+ const base = Number.isFinite(resolved) ? resolved : Number(getVariableValue(getSize(36)));
70
+ return Math.round(base * .25);
71
+ };
72
+ const getProgressSize = styled.dynamic((val) => {
73
+ const size = resolveProgressSize(val);
74
+ return {
75
+ height: size,
76
+ minWidth: size * 20,
77
+ width: "100%"
78
+ };
79
+ });
58
80
  const ProgressFrame = styled(YStack, {
59
81
  displayName: "Progress",
60
82
  overflow: "hidden",
61
- variants: { size: styled.dynamic((val) => {
62
- const size = Math.round(getVariableValue(getSize(val)) * .25);
63
- return {
64
- height: size,
65
- minWidth: getVariableValue(size) * 20,
66
- width: "100%"
67
- };
68
- }) }
83
+ variants: { size: getProgressSize }
69
84
  });
70
85
  const Progress = withStaticProperties(createStyledHOC(ProgressFrame, function Progress2(props, forwardedRef) {
71
86
  const { __scopeProgress, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, size = true, ...progressProps } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.js","names":[],"sources":["jsx/Progress.js"],"sourcesContent":["import { createStyledHOC, getVariableValue, isWeb, styled } from \"@tamagui/core\";\nimport { createContextScope } from \"@tamagui/create-context\";\nimport { getSize } from \"@tamagui/get-token\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst PROGRESS_NAME = \"Progress\";\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\nconst [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nconst INDICATOR_NAME = \"ProgressIndicator\";\nconst ProgressIndicatorFrame = styled(YStack, {\n displayName: INDICATOR_NAME,\n height: \"100%\",\n width: \"100%\"\n});\nconst ProgressIndicator = createStyledHOC(\n ProgressIndicatorFrame,\n function ProgressIndicator2(props, forwardedRef) {\n const { __scopeProgress, transition, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n const progressRatio = (context.value ?? 0) / context.max;\n let x;\n if (isWeb) {\n x = `${-100 + progressRatio * 50}%`;\n } else {\n const baseWidth = context.width || 0;\n x = Math.ceil(-baseWidth * (2 - progressRatio));\n }\n return /* @__PURE__ */ jsx(\n ProgressIndicatorFrame,\n {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": context.value ?? void 0,\n \"data-max\": context.max,\n x,\n width: \"200%\",\n animateOnly: [\"transform\"],\n ...!isWeb && context.width === 0 && { opacity: 0 },\n ...indicatorProps,\n ref: forwardedRef,\n transition: !isWeb && !context.width ? null : transition\n }\n );\n }\n);\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !Number.isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;\n}\nconst DEFAULT_MAX = 100;\nconst ProgressFrame = styled(YStack, {\n displayName: \"Progress\",\n overflow: \"hidden\",\n variants: {\n size: styled.dynamic((val) => {\n const size = Math.round(getVariableValue(getSize(val)) * 0.25);\n return {\n height: size,\n minWidth: getVariableValue(size) * 20,\n width: \"100%\"\n };\n })\n }\n});\nconst Progress = withStaticProperties(\n createStyledHOC(ProgressFrame, function Progress2(props, forwardedRef) {\n const {\n // @ts-expect-error\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = true,\n ...progressProps\n } = props;\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n const value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n const [width, setWidth] = useState(0);\n return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, width, children: /* @__PURE__ */ jsx(\n ProgressFrame,\n {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value ?? void 0,\n \"data-max\": max,\n size,\n ...progressProps,\n ...!isWeb && {\n onLayout: (e) => {\n const newWidth = Math.round(e.nativeEvent.layout.width);\n if (newWidth !== width) {\n setWidth(newWidth);\n }\n progressProps.onLayout?.(e);\n }\n },\n ref: forwardedRef\n }\n ) });\n }),\n {\n Indicator: ProgressIndicator\n }\n);\nexport {\n Progress,\n ProgressFrame,\n ProgressIndicator,\n ProgressIndicatorFrame,\n createProgressScope\n};\n//# sourceMappingURL=Progress.js.map\n"],"mappings":";;;;;;;;;AAOA,MAAM,gBAAgB;AACtB,MAAM,CAAC,uBAAuB,uBAAuB,mBAAmB,aAAa;AACrF,MAAM,CAAC,kBAAkB,sBAAsB,sBAAsB,aAAa;AAClF,MAAM,iBAAiB;AACvB,MAAM,yBAAyB,OAAO,QAAQ;CAC5C,aAAa;CACb,QAAQ;CACR,OAAO;AACT,CAAC;AACD,MAAM,oBAAoB,gBACxB,wBACA,SAAS,mBAAmB,OAAO,cAAc;CAC/C,MAAM,EAAE,iBAAiB,YAAY,GAAG,mBAAmB;CAC3D,MAAM,UAAU,mBAAmB,gBAAgB,eAAe;CAClE,MAAM,iBAAiB,QAAQ,SAAS,KAAK,QAAQ;CACrD,IAAI;CACJ,IAAI,OAAO;EACT,IAAI,GAAG,CAAC,MAAM,gBAAgB,GAAG;CACnC,OAAO;EACL,MAAM,YAAY,QAAQ,SAAS;EACnC,IAAI,KAAK,KAAK,CAAC,aAAa,IAAI,cAAc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,OAAO,IAAI,UAAU;CAClD,MAAM,QAAQ,mBAAmB,WAAW,GAAG,IAAI,KAAK,MAAM,SAAS,IAAI;CAC3E,MAAM,aAAa,SAAS,KAAK,IAAI,cAAc,OAAO,GAAG,IAAI,KAAK;CACtE,MAAM,CAAC,OAAO,YAAY,SAAS,CAAC;CACpC,OAAuB,oBAAI,kBAAkB;EAAE,OAAO;EAAiB;EAAO;EAAK;EAAO,UAA0B,oBAClH,eACA;GACE,iBAAiB;GACjB,iBAAiB;GACjB,iBAAiB,SAAS,KAAK,IAAI,QAAQ,KAAK;GAChD,kBAAkB;GAClB,MAAM;GACN,cAAc,iBAAiB,OAAO,GAAG;GACzC,cAAc,SAAS,KAAK;GAC5B,YAAY;GACZ;GACA,GAAG;GACH,GAAG,CAAC,SAAS,EACX,WAAW,MAAM;IACf,MAAM,WAAW,KAAK,MAAM,EAAE,YAAY,OAAO,KAAK;IACtD,IAAI,aAAa,OAAO;KACtB,SAAS,QAAQ;IACnB;IACA,cAAc,WAAW,CAAC;GAC5B,EACF;GACA,KAAK;EACP,CACF;CAAE,CAAC;AACL,CAAC,GACD,EACE,WAAW,kBACb,CACF"}
1
+ {"version":3,"file":"Progress.js","names":[],"sources":["jsx/Progress.js"],"sourcesContent":["import { createStyledHOC, getVariableValue, isWeb, styled } from \"@tamagui/core\";\nimport { createContextScope } from \"@tamagui/create-context\";\nimport { getSize } from \"@tamagui/get-token\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst PROGRESS_NAME = \"Progress\";\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\nconst [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nconst INDICATOR_NAME = \"ProgressIndicator\";\nconst ProgressIndicatorFrame = styled(YStack, {\n displayName: INDICATOR_NAME,\n height: \"100%\",\n width: \"100%\"\n});\nconst ProgressIndicator = createStyledHOC(\n ProgressIndicatorFrame,\n function ProgressIndicator2(props, forwardedRef) {\n const { __scopeProgress, transition, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n const progressRatio = (context.value ?? 0) / context.max;\n let x;\n if (isWeb) {\n x = `${-100 + progressRatio * 50}%`;\n } else {\n const baseWidth = context.width || 0;\n x = Math.ceil(-baseWidth * (2 - progressRatio));\n }\n return /* @__PURE__ */ jsx(\n ProgressIndicatorFrame,\n {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": context.value ?? void 0,\n \"data-max\": context.max,\n x,\n width: \"200%\",\n ...!isWeb && context.width === 0 && { opacity: 0 },\n ...indicatorProps,\n ref: forwardedRef,\n transition: !isWeb && !context.width ? null : { transform: transition }\n }\n );\n }\n);\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !Number.isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;\n}\nconst DEFAULT_MAX = 100;\nconst progressTrackHeight = {\n xs: 4,\n sm: 6,\n md: 9,\n lg: 12,\n xl: 16\n};\nconst resolveProgressSize = (val) => {\n if (typeof val === \"string\" && val in progressTrackHeight) {\n return progressTrackHeight[val];\n }\n const resolved = Number(getVariableValue(getSize(val === true ? 36 : val)));\n const base = Number.isFinite(resolved) ? resolved : Number(getVariableValue(getSize(36)));\n return Math.round(base * 0.25);\n};\nconst getProgressSize = styled.dynamic((val) => {\n const size = resolveProgressSize(val);\n return {\n height: size,\n minWidth: size * 20,\n width: \"100%\"\n };\n});\nconst ProgressFrame = styled(YStack, {\n displayName: \"Progress\",\n overflow: \"hidden\",\n variants: {\n size: getProgressSize\n }\n});\nconst Progress = withStaticProperties(\n createStyledHOC(ProgressFrame, function Progress2(props, forwardedRef) {\n const {\n // @ts-expect-error\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = true,\n ...progressProps\n } = props;\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n const value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n const [width, setWidth] = useState(0);\n return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, width, children: /* @__PURE__ */ jsx(\n ProgressFrame,\n {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value ?? void 0,\n \"data-max\": max,\n size,\n ...progressProps,\n ...!isWeb && {\n onLayout: (e) => {\n const newWidth = Math.round(e.nativeEvent.layout.width);\n if (newWidth !== width) {\n setWidth(newWidth);\n }\n progressProps.onLayout?.(e);\n }\n },\n ref: forwardedRef\n }\n ) });\n }),\n {\n Indicator: ProgressIndicator\n }\n);\nexport {\n Progress,\n ProgressFrame,\n ProgressIndicator,\n ProgressIndicatorFrame,\n createProgressScope\n};\n//# sourceMappingURL=Progress.js.map\n"],"mappings":";;;;;;;;;AAOA,MAAM,gBAAgB;AACtB,MAAM,CAAC,uBAAuB,uBAAuB,mBAAmB,aAAa;AACrF,MAAM,CAAC,kBAAkB,sBAAsB,sBAAsB,aAAa;AAClF,MAAM,iBAAiB;AACvB,MAAM,yBAAyB,OAAO,QAAQ;CAC5C,aAAa;CACb,QAAQ;CACR,OAAO;AACT,CAAC;AACD,MAAM,oBAAoB,gBACxB,wBACA,SAAS,mBAAmB,OAAO,cAAc;CAC/C,MAAM,EAAE,iBAAiB,YAAY,GAAG,mBAAmB;CAC3D,MAAM,UAAU,mBAAmB,gBAAgB,eAA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F;CAAE,CAAC;AACL,CAAC,GACD,EACE,WAAW,kBACb,CACF"}
@@ -64,11 +64,10 @@ var ProgressIndicator = (0, import_core.createStyledHOC)(ProgressIndicatorFrame,
64
64
  "data-max": context.max,
65
65
  x,
66
66
  width: "200%",
67
- animateOnly: ["transform"],
68
67
  ...!import_core.isWeb && context.width === 0 && { opacity: 0 },
69
68
  ...indicatorProps,
70
69
  ref: forwardedRef,
71
- transition: !import_core.isWeb && !context.width ? null : transition
70
+ transition: !import_core.isWeb && !context.width ? null : { transform: transition }
72
71
  });
73
72
  });
74
73
  function defaultGetValueLabel(value, max) {
@@ -87,17 +86,33 @@ function isValidValueNumber(value, max) {
87
86
  return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
88
87
  }
89
88
  var DEFAULT_MAX = 100;
89
+ var progressTrackHeight = {
90
+ xs: 4,
91
+ sm: 6,
92
+ md: 9,
93
+ lg: 12,
94
+ xl: 16
95
+ };
96
+ var resolveProgressSize = function(val) {
97
+ if (typeof val === "string" && val in progressTrackHeight) {
98
+ return progressTrackHeight[val];
99
+ }
100
+ var resolved = Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(val === true ? 36 : val)));
101
+ var base = Number.isFinite(resolved) ? resolved : Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(36)));
102
+ return Math.round(base * .25);
103
+ };
104
+ var getProgressSize = import_core.styled.dynamic(function(val) {
105
+ var size = resolveProgressSize(val);
106
+ return {
107
+ height: size,
108
+ minWidth: size * 20,
109
+ width: "100%"
110
+ };
111
+ });
90
112
  var ProgressFrame = (0, import_core.styled)(import_stacks.YStack, {
91
113
  displayName: "Progress",
92
114
  overflow: "hidden",
93
- variants: { size: import_core.styled.dynamic(function(val) {
94
- var size = Math.round((0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) * .25);
95
- return {
96
- height: size,
97
- minWidth: (0, import_core.getVariableValue)(size) * 20,
98
- width: "100%"
99
- };
100
- }) }
115
+ variants: { size: getProgressSize }
101
116
  });
102
117
  var Progress = (0, import_helpers.withStaticProperties)((0, import_core.createStyledHOC)(ProgressFrame, function Progress2(props, forwardedRef) {
103
118
  var { __scopeProgress, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, size = true, ...progressProps } = props;
@@ -64,11 +64,10 @@ var ProgressIndicator = (0, import_core.createStyledHOC)(ProgressIndicatorFrame,
64
64
  "data-max": context.max,
65
65
  x,
66
66
  width: "200%",
67
- animateOnly: ["transform"],
68
67
  ...!import_core.isWeb && context.width === 0 && { opacity: 0 },
69
68
  ...indicatorProps,
70
69
  ref: forwardedRef,
71
- transition: !import_core.isWeb && !context.width ? null : transition
70
+ transition: !import_core.isWeb && !context.width ? null : { transform: transition }
72
71
  });
73
72
  });
74
73
  function defaultGetValueLabel(value, max) {
@@ -87,17 +86,33 @@ function isValidValueNumber(value, max) {
87
86
  return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
88
87
  }
89
88
  var DEFAULT_MAX = 100;
89
+ var progressTrackHeight = {
90
+ xs: 4,
91
+ sm: 6,
92
+ md: 9,
93
+ lg: 12,
94
+ xl: 16
95
+ };
96
+ var resolveProgressSize = function(val) {
97
+ if (typeof val === "string" && val in progressTrackHeight) {
98
+ return progressTrackHeight[val];
99
+ }
100
+ var resolved = Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(val === true ? 36 : val)));
101
+ var base = Number.isFinite(resolved) ? resolved : Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(36)));
102
+ return Math.round(base * .25);
103
+ };
104
+ var getProgressSize = import_core.styled.dynamic(function(val) {
105
+ var size = resolveProgressSize(val);
106
+ return {
107
+ height: size,
108
+ minWidth: size * 20,
109
+ width: "100%"
110
+ };
111
+ });
90
112
  var ProgressFrame = (0, import_core.styled)(import_stacks.YStack, {
91
113
  displayName: "Progress",
92
114
  overflow: "hidden",
93
- variants: { size: import_core.styled.dynamic(function(val) {
94
- var size = Math.round((0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) * .25);
95
- return {
96
- height: size,
97
- minWidth: (0, import_core.getVariableValue)(size) * 20,
98
- width: "100%"
99
- };
100
- }) }
115
+ variants: { size: getProgressSize }
101
116
  });
102
117
  var Progress = (0, import_helpers.withStaticProperties)((0, import_core.createStyledHOC)(ProgressFrame, function Progress2(props, forwardedRef) {
103
118
  var { __scopeProgress, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, size = true, ...progressProps } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.native.js","names":[],"sources":["jsx/Progress.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Progress_exports = {};\n__export(Progress_exports, {\n Progress: () => Progress,\n ProgressFrame: () => ProgressFrame,\n ProgressIndicator: () => ProgressIndicator,\n ProgressIndicatorFrame: () => ProgressIndicatorFrame,\n createProgressScope: () => createProgressScope\n});\nmodule.exports = __toCommonJS(Progress_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_create_context = require(\"@tamagui/create-context\");\nvar import_get_token = require(\"@tamagui/get-token\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_react = require(\"react\");\nvar PROGRESS_NAME = \"Progress\";\nvar [createProgressContext, createProgressScope] = (0, import_create_context.createContextScope)(PROGRESS_NAME);\nvar [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nvar INDICATOR_NAME = \"ProgressIndicator\";\nvar ProgressIndicatorFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: INDICATOR_NAME,\n height: \"100%\",\n width: \"100%\"\n});\nvar ProgressIndicator = (0, import_core.createStyledHOC)(ProgressIndicatorFrame, function ProgressIndicator2(props, forwardedRef) {\n var { __scopeProgress, transition, ...indicatorProps } = props;\n var context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n var _context_value;\n var progressRatio = ((_context_value = context.value) !== null && _context_value !== void 0 ? _context_value : 0) / context.max;\n var x;\n if (import_core.isWeb) {\n x = `${-100 + progressRatio * 50}%`;\n } else {\n var baseWidth = context.width || 0;\n x = Math.ceil(-baseWidth * (2 - progressRatio));\n }\n var _context_value1;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressIndicatorFrame, {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": (_context_value1 = context.value) !== null && _context_value1 !== void 0 ? _context_value1 : void 0,\n \"data-max\": context.max,\n x,\n width: \"200%\",\n animateOnly: [\n \"transform\"\n ],\n ...!import_core.isWeb && context.width === 0 && {\n opacity: 0\n },\n ...indicatorProps,\n ref: forwardedRef,\n transition: !import_core.isWeb && !context.width ? null : transition\n });\n});\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !Number.isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;\n}\nvar DEFAULT_MAX = 100;\nvar ProgressFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: \"Progress\",\n overflow: \"hidden\",\n variants: {\n size: import_core.styled.dynamic(function(val) {\n var size = Math.round((0, import_core.getVariableValue)((0, import_get_token.getSize)(val)) * 0.25);\n return {\n height: size,\n minWidth: (0, import_core.getVariableValue)(size) * 20,\n width: \"100%\"\n };\n })\n }\n});\nvar Progress = (0, import_helpers.withStaticProperties)((0, import_core.createStyledHOC)(ProgressFrame, function Progress2(props, forwardedRef) {\n var {\n // @ts-expect-error\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = true,\n ...progressProps\n } = props;\n var max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n var value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;\n var valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n var [width, setWidth] = (0, import_react.useState)(0);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressProvider, {\n scope: __scopeProgress,\n value,\n max,\n width,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressFrame, {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n // @ts-ignore\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value !== null && value !== void 0 ? value : void 0,\n \"data-max\": max,\n size,\n ...progressProps,\n ...!import_core.isWeb && {\n onLayout: function(e) {\n var _progressProps_onLayout;\n var newWidth = Math.round(e.nativeEvent.layout.width);\n if (newWidth !== width) {\n setWidth(newWidth);\n }\n (_progressProps_onLayout = progressProps.onLayout) === null || _progressProps_onLayout === void 0 ? void 0 : _progressProps_onLayout.call(progressProps, e);\n }\n },\n ref: forwardedRef\n })\n });\n}), {\n Indicator: ProgressIndicator\n});\n//# sourceMappingURL=Progress.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACp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AG,CAAC,YAAY,SAAS,EACvB,UAAU,SAAS,GAAG;IACpB,IAAI;IACJ,IAAI,WAAW,KAAK,MAAM,EAAE,YAAY,OAAO,KAAK;IACpD,IAAI,aAAa,OAAO;KACtB,SAAS,QAAQ;IACnB;IACA,CAAC,0BAA0B,cAAc,cAAc,QAAQ,4BAA4B,KAAK,IAAI,KAAK,IAAI,wBAAwB,KAAK,eAAe,CAAC;GAC5J,EACF;GACA,KAAK;EACP,CAAC;CACH,CAAC;AACH,CAAC,GAAG,EACF,WAAW,kBACb,CAAC"}
1
+ {"version":3,"file":"Progress.native.js","names":[],"sources":["jsx/Progress.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Progress_exports = {};\n__export(Progress_exports, {\n Progress: () => Progress,\n ProgressFrame: () => ProgressFrame,\n ProgressIndicator: () => ProgressIndicator,\n ProgressIndicatorFrame: () => ProgressIndicatorFrame,\n createProgressScope: () => createProgressScope\n});\nmodule.exports = __toCommonJS(Progress_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_create_context = require(\"@tamagui/create-context\");\nvar import_get_token = require(\"@tamagui/get-token\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_react = require(\"react\");\nvar PROGRESS_NAME = \"Progress\";\nvar [createProgressContext, createProgressScope] = (0, import_create_context.createContextScope)(PROGRESS_NAME);\nvar [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nvar INDICATOR_NAME = \"ProgressIndicator\";\nvar ProgressIndicatorFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: INDICATOR_NAME,\n height: \"100%\",\n width: \"100%\"\n});\nvar ProgressIndicator = (0, import_core.createStyledHOC)(ProgressIndicatorFrame, function ProgressIndicator2(props, forwardedRef) {\n var { __scopeProgress, transition, ...indicatorProps } = props;\n var context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n var _context_value;\n var progressRatio = ((_context_value = context.value) !== null && _context_value !== void 0 ? _context_value : 0) / context.max;\n var x;\n if (import_core.isWeb) {\n x = `${-100 + progressRatio * 50}%`;\n } else {\n var baseWidth = context.width || 0;\n x = Math.ceil(-baseWidth * (2 - progressRatio));\n }\n var _context_value1;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressIndicatorFrame, {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": (_context_value1 = context.value) !== null && _context_value1 !== void 0 ? _context_value1 : void 0,\n \"data-max\": context.max,\n x,\n width: \"200%\",\n ...!import_core.isWeb && context.width === 0 && {\n opacity: 0\n },\n ...indicatorProps,\n ref: forwardedRef,\n // only the indicator's slide transitions; `width` is a layout jump\n transition: !import_core.isWeb && !context.width ? null : {\n transform: transition\n }\n });\n});\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !Number.isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;\n}\nvar DEFAULT_MAX = 100;\nvar progressTrackHeight = {\n xs: 4,\n sm: 6,\n md: 9,\n lg: 12,\n xl: 16\n};\nvar resolveProgressSize = function(val) {\n if (typeof val === \"string\" && val in progressTrackHeight) {\n return progressTrackHeight[val];\n }\n var resolved = Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(val === true ? 36 : val)));\n var base = Number.isFinite(resolved) ? resolved : Number((0, import_core.getVariableValue)((0, import_get_token.getSize)(36)));\n return Math.round(base * 0.25);\n};\nvar getProgressSize = import_core.styled.dynamic(function(val) {\n var size = resolveProgressSize(val);\n return {\n height: size,\n minWidth: size * 20,\n width: \"100%\"\n };\n});\nvar ProgressFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: \"Progress\",\n overflow: \"hidden\",\n variants: {\n size: getProgressSize\n }\n});\nvar Progress = (0, import_helpers.withStaticProperties)((0, import_core.createStyledHOC)(ProgressFrame, function Progress2(props, forwardedRef) {\n var {\n // @ts-expect-error\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = true,\n ...progressProps\n } = props;\n var max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n var value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;\n var valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n var [width, setWidth] = (0, import_react.useState)(0);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressProvider, {\n scope: __scopeProgress,\n value,\n max,\n width,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressFrame, {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n // @ts-ignore\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value !== null && value !== void 0 ? value : void 0,\n \"data-max\": max,\n size,\n ...progressProps,\n ...!import_core.isWeb && {\n onLayout: function(e) {\n var _progressProps_onLayout;\n var newWidth = Math.round(e.nativeEvent.layout.width);\n if (newWidth !== width) {\n setWidth(newWidth);\n }\n (_progressProps_onLayout = progressProps.onLayout) === null || _progressProps_onLayout === void 0 ? void 0 : _progressProps_onLayout.call(progressProps, e);\n }\n },\n ref: forwardedRef\n })\n });\n}), {\n Indicator: ProgressIndicator\n});\n//# sourceMappingURL=Progress.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,mBAAmB,CAAC;AACxB,SAAS,kBAAkB;CACzB,gBAAgB;CAChB,qBAAqB;CACrB,yBAAyB;CACzB,8BAA8B;CAC9B,2BAA2B;AAC7B,CAAC;AACD,OAAO,UAAU,aAAa,gBAAgB;AAC9C,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,wBAAwB,QAAQ,yBAAyB;AAC7D,IAAI,mBAAmB,QAAQ,oBAAoB;AACnD,IAAI,iBAAiB,QAAQ,kBAAkB;AAC/C,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CAAE,eAAe,SAAS,UAAU,OAAO,cAAc;CAC9I,IAAI,EAEF,iBACA,OAAO,WACP,KAAK,SACL,gBAAgB,sBAChB,OAAO,MACP,GAAG,kBACD;CACJ,IAAI,MAAM,iBAAiB,OAAO,IAAI,UAAU;CAChD,IAAI,QAAQ,mBAAmB,WAAW,GAAG,IAAI,KAAK,MAAM,SAAS,IAAI;CACzE,IAAI,aAAa,SAAS,KAAK,IAAI,cAAc,OAAO,GAAG,IAAI,KAAK;CACpE,IAAI,CAAC,OAAO,aAAa,GAAG,aAAa,SAAQ,CAAE,CAAC;CACpD,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,kBAAkB;EACnE,OAAO;EACP;EACA;EACA;EACA,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,eAAe;GACnE,iBAAiB;GACjB,iBAAiB;GACjB,iBAAiB,SAAS,KAAK,IAAI,QAAQ,KAAK;GAChD,kBAAkB;GAElB,MAAM;GACN,cAAc,iBAAiB,OAAO,GAAG;GACzC,cAAc,UAAU,QAAQ,UAAU,KAAK,IAAI,QAAQ,KAAK;GAChE,YAAY;GACZ;GACA,GAAG;GACH,GAAG,CAAC,YAAY,SAAS,EACvB,UAAU,SAAS,GAAG;IACpB,IAAI;IACJ,IAAI,WAAW,KAAK,MAAM,EAAE,YAAY,OAAO,KAAK;IACpD,IAAI,aAAa,OAAO;KACtB,SAAS,QAAQ;IACnB;IACA,CAAC,0BAA0B,cAAc,cAAc,QAAQ,4BAA4B,KAAK,IAAI,KAAK,IAAI,wBAAwB,KAAK,eAAe,CAAC;GAC5J,EACF;GACA,KAAK;EACP,CAAC;CACH,CAAC;AACH,CAAC,GAAG,EACF,WAAW,kBACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@tamagui/progress",
3
- "version": "3.0.0-beta.924.1",
3
+ "version": "3.0.0",
4
+ "license": "MIT",
4
5
  "source": "src/index.ts",
5
6
  "files": [
6
7
  "src",
@@ -34,17 +35,17 @@
34
35
  "clean:build": "tamagui-build clean:build"
35
36
  },
36
37
  "dependencies": {
37
- "@tamagui/compose-refs": "3.0.0-beta.924.1",
38
- "@tamagui/core": "3.0.0-beta.924.1",
39
- "@tamagui/create-context": "3.0.0-beta.924.1",
40
- "@tamagui/get-token": "3.0.0-beta.924.1",
41
- "@tamagui/helpers": "3.0.0-beta.924.1",
42
- "@tamagui/stacks": "3.0.0-beta.924.1"
38
+ "@tamagui/compose-refs": "3.0.0",
39
+ "@tamagui/core": "3.0.0",
40
+ "@tamagui/create-context": "3.0.0",
41
+ "@tamagui/get-token": "3.0.0",
42
+ "@tamagui/helpers": "3.0.0",
43
+ "@tamagui/stacks": "3.0.0"
43
44
  },
44
45
  "devDependencies": {
45
- "@tamagui/build": "3.0.0-beta.924.1",
46
+ "@tamagui/build": "3.0.0",
46
47
  "react": "19.2.3",
47
- "react-native": "0.86.2"
48
+ "react-native": "0.87.1"
48
49
  },
49
50
  "peerDependencies": {
50
51
  "react": ">=19"
@@ -54,5 +55,6 @@
54
55
  "type": "git",
55
56
  "url": "git+https://github.com/tamagui/tamagui.git",
56
57
  "directory": "code/ui/progress"
57
- }
58
+ },
59
+ "releaseSourceCommit": "15fbca480b143f876f6975601e23a17d3f90d2ee"
58
60
  }
package/src/Progress.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  // forked from Radix UI
2
2
  // https://github.com/radix-ui/primitives/blob/main/packages/react/progress/src/Progress.tsx
3
3
 
4
- import type { GetProps } from '@tamagui/core'
4
+ import type { ComponentSize, GetProps, SizeTokens } from '@tamagui/core'
5
5
  import { createStyledHOC, getVariableValue, isWeb, styled } from '@tamagui/core'
6
6
  import type { Scope } from '@tamagui/create-context'
7
7
  import { createContextScope } from '@tamagui/create-context'
@@ -69,11 +69,11 @@ const ProgressIndicator = createStyledHOC(
69
69
  data-max={context.max}
70
70
  x={x}
71
71
  width="200%"
72
- animateOnly={['transform']}
73
72
  {...(!isWeb && context.width === 0 && { opacity: 0 })}
74
73
  {...indicatorProps}
75
74
  ref={forwardedRef}
76
- transition={!isWeb && !context.width ? null : transition}
75
+ // only the indicator's slide transitions; `width` is a layout jump
76
+ transition={!isWeb && !context.width ? null : { transform: transition }}
77
77
  />
78
78
  )
79
79
  }
@@ -114,6 +114,44 @@ type ScopedProps<P> = P & { __scopeProgress?: Scope }
114
114
 
115
115
  type ProgressState = 'indeterminate' | 'complete' | 'loading'
116
116
 
117
+ export type ProgressSize = ComponentSize | SizeTokens | number | boolean
118
+
119
+ // the track is a thin bar: named rungs on the xs-xl control ladder, like the
120
+ // slider track. md is the historical default track (size token 36 at quarter
121
+ // scale), so `true` and `md` agree and existing numeric sizes keep their px.
122
+ const progressTrackHeight = {
123
+ xs: 4,
124
+ sm: 6,
125
+ md: 9,
126
+ lg: 12,
127
+ xl: 16,
128
+ } as const
129
+
130
+ const resolveProgressSize = (val: ProgressSize): number => {
131
+ if (typeof val === 'string' && val in progressTrackHeight) {
132
+ return progressTrackHeight[val as keyof typeof progressTrackHeight]
133
+ }
134
+ // getSize hands back the key itself when it is not in the size scale, so an
135
+ // unresolvable key would multiply to NaN here. A NaN height reads as no
136
+ // height at all, and the Indicator inside asks for 100% of it, so the track
137
+ // stops being a bar and fills whatever it is in. Fall back to the same token
138
+ // `true` uses.
139
+ const resolved = Number(getVariableValue(getSize(val === true ? 36 : val)))
140
+ const base = Number.isFinite(resolved)
141
+ ? resolved
142
+ : Number(getVariableValue(getSize(36)))
143
+ return Math.round(base * 0.25)
144
+ }
145
+
146
+ const getProgressSize = styled.dynamic<ProgressSize>((val) => {
147
+ const size = resolveProgressSize(val)
148
+ return {
149
+ height: size,
150
+ minWidth: size * 20,
151
+ width: '100%',
152
+ }
153
+ })
154
+
117
155
  // Unstyled Progress frame: the clip (overflow hidden) + the size mechanism
118
156
  // (size-derived track height) only. The pill radius and theme background live in
119
157
  // the tamagui skin (code/ui/tamagui/src/components/Progress.tsx).
@@ -122,14 +160,7 @@ export const ProgressFrame = styled(YStack, {
122
160
  overflow: 'hidden',
123
161
 
124
162
  variants: {
125
- size: styled.dynamic<any>((val) => {
126
- const size = Math.round(getVariableValue(getSize(val)) * 0.25)
127
- return {
128
- height: size,
129
- minWidth: getVariableValue(size) * 20,
130
- width: '100%',
131
- }
132
- }),
163
+ size: getProgressSize,
133
164
  } as const,
134
165
  })
135
166
 
@@ -1,43 +1,25 @@
1
- import type { GetProps } from '@tamagui/core';
1
+ import type { ComponentSize, GetProps, SizeTokens } from '@tamagui/core';
2
2
  import type { Scope } from '@tamagui/create-context';
3
3
  declare const createProgressScope: import("@tamagui/create-context").CreateScope;
4
- export declare const ProgressIndicatorFrame: import("react").FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
5
- elevation?: number | false | import("@tamagui/core").Size | undefined;
6
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
4
+ export declare const ProgressIndicatorFrame: import("react").FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, never> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, never>> & import("@tamagui/core").WithFlatVariantValues<{}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & {
7
5
  ref?: import("react").Ref<import("@tamagui/core").TamaguiElement> | undefined;
8
- }> & import("@tamagui/core").StaticComponentObject<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
9
- elevation?: number | false | import("@tamagui/core").Size | undefined;
10
- }, import("@tamagui/core").StaticConfigPublic> & Omit<import("@tamagui/core").StaticConfigPublic, "staticConfig"> & {
11
- __tama: [import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
12
- elevation?: number | false | import("@tamagui/core").Size | undefined;
13
- }, import("@tamagui/core").StaticConfigPublic];
6
+ }> & import("@tamagui/core").StaticComponentObject<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {}, import("@tamagui/core").StaticConfigPublic> & Omit<import("@tamagui/core").StaticConfigPublic, "staticConfig"> & {
7
+ __tama: [import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {}, import("@tamagui/core").StaticConfigPublic];
14
8
  };
15
9
  export type ProgressIndicatorProps = GetProps<typeof ProgressIndicatorFrame>;
16
- declare const ProgressIndicator: import("@tamagui/core").TamaguiComponent<Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
17
- elevation?: number | false | import("@tamagui/core").Size | undefined;
18
- }>, "__scopeProgress" | "elevation" | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
19
- elevation?: number | false | import("@tamagui/core").Size | undefined;
20
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
10
+ declare const ProgressIndicator: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "__scopeProgress" | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, never> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, never>> & import("@tamagui/core").WithFlatVariantValues<{}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & {
21
11
  __scopeProgress?: Scope;
22
- }, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
23
- elevation?: number | false | import("@tamagui/core").Size | undefined;
24
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
25
- __scopeProgress?: Scope;
26
- }, import("@tamagui/core").StackStyleBase, {
27
- elevation?: number | false | import("@tamagui/core").Size | undefined;
28
- }, import("@tamagui/core").StaticConfigPublic>;
29
- export declare const ProgressFrame: import("react").FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | "size" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
30
- elevation?: number | false | import("@tamagui/core").Size | undefined;
31
- size?: any;
32
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
12
+ }, import("@tamagui/core").StackStyleBase, Omit<{}, "__scopeProgress" | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase>, import("@tamagui/core").StaticConfigPublic>;
13
+ export type ProgressSize = ComponentSize | SizeTokens | number | boolean;
14
+ export declare const ProgressFrame: import("react").FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "size"> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, "size">> & import("@tamagui/core").WithFlatVariantValues<{
15
+ size?: ProgressSize | undefined;
16
+ }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & {
33
17
  ref?: import("react").Ref<import("@tamagui/core").TamaguiElement> | undefined;
34
18
  }> & import("@tamagui/core").StaticComponentObject<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
35
- elevation?: number | false | import("@tamagui/core").Size | undefined;
36
- size?: any;
19
+ size?: ProgressSize | undefined;
37
20
  }, import("@tamagui/core").StaticConfigPublic> & Omit<import("@tamagui/core").StaticConfigPublic, "staticConfig"> & {
38
21
  __tama: [import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
39
- elevation?: number | false | import("@tamagui/core").Size | undefined;
40
- size?: any;
22
+ size?: ProgressSize | undefined;
41
23
  }, import("@tamagui/core").StaticConfigPublic];
42
24
  };
43
25
  export interface ProgressExtraProps {
@@ -46,54 +28,26 @@ export interface ProgressExtraProps {
46
28
  getValueLabel?(value: number, max: number): string;
47
29
  }
48
30
  export type ProgressProps = GetProps<typeof ProgressFrame> & ProgressExtraProps;
49
- declare const Progress: import("react").FunctionComponent<Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
50
- elevation?: number | false | import("@tamagui/core").Size | undefined;
51
- size?: any;
52
- }>, "elevation" | "size" | keyof ProgressExtraProps | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | "size" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
53
- elevation?: number | false | import("@tamagui/core").Size | undefined;
54
- size?: any;
55
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & ProgressExtraProps & {
31
+ declare const Progress: import("react").FunctionComponent<Omit<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "size" | keyof ProgressExtraProps | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "size"> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, "size">> & import("@tamagui/core").WithFlatVariantValues<{
32
+ size?: ProgressSize | undefined;
33
+ }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & ProgressExtraProps, never> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, never>> & import("@tamagui/core").WithFlatVariantValues<Omit<{
34
+ size?: ProgressSize | undefined;
35
+ }, "size" | keyof ProgressExtraProps | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase>> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, "size" | keyof ProgressExtraProps | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & {
56
36
  ref?: import("react").Ref<import("@tamagui/core").TamaguiElement> | undefined;
57
- }> & import("@tamagui/core").StaticComponentObject<Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
58
- elevation?: number | false | import("@tamagui/core").Size | undefined;
59
- size?: any;
60
- }>, "elevation" | "size" | keyof ProgressExtraProps | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | "size" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
61
- elevation?: number | false | import("@tamagui/core").Size | undefined;
62
- size?: any;
63
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & ProgressExtraProps, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | "size" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
64
- elevation?: number | false | import("@tamagui/core").Size | undefined;
65
- size?: any;
66
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & ProgressExtraProps, import("@tamagui/core").StackStyleBase, {
67
- elevation?: number | false | import("@tamagui/core").Size | undefined;
68
- size?: any;
69
- }, import("@tamagui/core").StaticConfigPublic> & Omit<import("@tamagui/core").StaticConfigPublic, "staticConfig"> & {
70
- __tama: [Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
71
- elevation?: number | false | import("@tamagui/core").Size | undefined;
72
- size?: any;
73
- }>, "elevation" | "size" | keyof ProgressExtraProps | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | "size" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
74
- elevation?: number | false | import("@tamagui/core").Size | undefined;
75
- size?: any;
76
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & ProgressExtraProps, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | "size" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
77
- elevation?: number | false | import("@tamagui/core").Size | undefined;
78
- size?: any;
79
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & ProgressExtraProps, import("@tamagui/core").StackStyleBase, {
80
- elevation?: number | false | import("@tamagui/core").Size | undefined;
81
- size?: any;
82
- }, import("@tamagui/core").StaticConfigPublic];
37
+ }> & import("@tamagui/core").StaticComponentObject<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "size" | keyof ProgressExtraProps | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "size"> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, "size">> & import("@tamagui/core").WithFlatVariantValues<{
38
+ size?: ProgressSize | undefined;
39
+ }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & ProgressExtraProps, import("@tamagui/core").StackStyleBase, Omit<{
40
+ size?: ProgressSize | undefined;
41
+ }, "size" | keyof ProgressExtraProps | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase>, import("@tamagui/core").StaticConfigPublic> & Omit<import("@tamagui/core").StaticConfigPublic, "staticConfig"> & {
42
+ __tama: [import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "size" | keyof ProgressExtraProps | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "size"> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, "size">> & import("@tamagui/core").WithFlatVariantValues<{
43
+ size?: ProgressSize | undefined;
44
+ }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & ProgressExtraProps, import("@tamagui/core").StackStyleBase, Omit<{
45
+ size?: ProgressSize | undefined;
46
+ }, "size" | keyof ProgressExtraProps | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase>, import("@tamagui/core").StaticConfigPublic];
83
47
  } & {
84
- Indicator: import("@tamagui/core").TamaguiComponent<Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {
85
- elevation?: number | false | import("@tamagui/core").Size | undefined;
86
- }>, "__scopeProgress" | "elevation" | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
87
- elevation?: number | false | import("@tamagui/core").Size | undefined;
88
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
89
- __scopeProgress?: Scope;
90
- }, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | keyof import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase> & import("@tamagui/core").WithFlatVariantValues<{
91
- elevation?: number | false | import("@tamagui/core").Size | undefined;
92
- }> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
48
+ Indicator: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "__scopeProgress" | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase> & Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, never> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, never>> & import("@tamagui/core").WithFlatVariantValues<{}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & {
93
49
  __scopeProgress?: Scope;
94
- }, import("@tamagui/core").StackStyleBase, {
95
- elevation?: number | false | import("@tamagui/core").Size | undefined;
96
- }, import("@tamagui/core").StaticConfigPublic>;
50
+ }, import("@tamagui/core").StackStyleBase, Omit<{}, "__scopeProgress" | keyof import("@tamagui/core").RNTamaguiViewNonStyleProps | keyof import("@tamagui/core").StackStyleBase>, import("@tamagui/core").StaticConfigPublic>;
97
51
  };
98
52
  export { createProgressScope, Progress, ProgressIndicator };
99
53
  //# sourceMappingURL=Progress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../src/Progress.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7C,OAAO,KAAK,EAAE,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