@tamagui/progress 1.0.1-beta.99 → 1.0.1-rc.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,38 +1,10 @@
1
+ "use strict";
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
6
  var __getProtoOf = Object.getPrototypeOf;
9
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b)) {
18
- if (__propIsEnum.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __objRest = (source, exclude) => {
25
- var target = {};
26
- for (var prop in source)
27
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
- target[prop] = source[prop];
29
- if (source != null && __getOwnPropSymbols)
30
- for (var prop of __getOwnPropSymbols(source)) {
31
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
- target[prop] = source[prop];
33
- }
34
- return target;
35
- };
36
8
  var __export = (target, all) => {
37
9
  for (var name in all)
38
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -45,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
45
17
  }
46
18
  return to;
47
19
  };
48
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
49
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50
25
  var Progress_exports = {};
51
26
  __export(Progress_exports, {
@@ -56,6 +31,7 @@ __export(Progress_exports, {
56
31
  createProgressScope: () => createProgressScope
57
32
  });
58
33
  module.exports = __toCommonJS(Progress_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
59
35
  var import_core = require("@tamagui/core");
60
36
  var import_create_context = require("@tamagui/create-context");
61
37
  var import_stacks = require("@tamagui/stacks");
@@ -70,21 +46,25 @@ const ProgressIndicatorFrame = (0, import_core.styled)(import_stacks.ThemeableSt
70
46
  width: "100%",
71
47
  backgrounded: true
72
48
  });
73
- const ProgressIndicator = ProgressIndicatorFrame.extractable(React.forwardRef((props, forwardedRef) => {
74
- const _a = props, { __scopeProgress } = _a, indicatorProps = __objRest(_a, ["__scopeProgress"]);
75
- const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
76
- const pct = context.max - (context.value ?? 0);
77
- const x = -context.width * (pct / 100);
78
- return /* @__PURE__ */ React.createElement(ProgressIndicatorFrame, __spreadProps(__spreadValues({
79
- "data-state": getProgressState(context.value, context.max),
80
- "data-value": context.value ?? void 0,
81
- "data-max": context.max,
82
- x,
83
- width: context.width
84
- }, indicatorProps), {
85
- ref: forwardedRef
86
- }));
87
- }));
49
+ const ProgressIndicator = ProgressIndicatorFrame.extractable(
50
+ React.forwardRef(
51
+ (props, forwardedRef) => {
52
+ const { __scopeProgress, ...indicatorProps } = props;
53
+ const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
54
+ const pct = context.max - (context.value ?? 0);
55
+ const x = -context.width * (pct / 100);
56
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressIndicatorFrame, {
57
+ "data-state": getProgressState(context.value, context.max),
58
+ "data-value": context.value ?? void 0,
59
+ "data-max": context.max,
60
+ x,
61
+ width: context.width,
62
+ ...indicatorProps,
63
+ ref: forwardedRef
64
+ });
65
+ }
66
+ )
67
+ );
88
68
  ProgressIndicator.displayName = INDICATOR_NAME;
89
69
  function defaultGetValueLabel(value, max) {
90
70
  return `${Math.round(value / max * 100)}%`;
@@ -131,50 +111,53 @@ const ProgressFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
131
111
  }
132
112
  }
133
113
  });
134
- const Progress = (0, import_core.withStaticProperties)(ProgressFrame.extractable(React.forwardRef((props, forwardedRef) => {
135
- const _a = props, {
136
- __scopeProgress,
137
- value: valueProp,
138
- max: maxProp,
139
- getValueLabel = defaultGetValueLabel,
140
- size = "$4"
141
- } = _a, progressProps = __objRest(_a, [
142
- "__scopeProgress",
143
- "value",
144
- "max",
145
- "getValueLabel",
146
- "size"
147
- ]);
148
- const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
149
- const value = isValidValueNumber(valueProp, max) ? valueProp : null;
150
- const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
151
- const [width, setWidth] = React.useState(0);
152
- return /* @__PURE__ */ React.createElement(ProgressProvider, {
153
- scope: __scopeProgress,
154
- value,
155
- max,
156
- width
157
- }, /* @__PURE__ */ React.createElement(ProgressFrame, __spreadProps(__spreadValues({
158
- size,
159
- "aria-valuemax": max,
160
- "aria-valuemin": 0,
161
- "aria-valuenow": isNumber(value) ? value : void 0,
162
- "aria-valuetext": valueLabel,
163
- role: "progressbar",
164
- "data-state": getProgressState(value, max),
165
- "data-value": value ?? void 0,
166
- "data-max": max
167
- }, progressProps), {
168
- onLayout: (e) => {
169
- var _a2;
170
- setWidth(e.nativeEvent.layout.width);
171
- (_a2 = progressProps.onLayout) == null ? void 0 : _a2.call(progressProps, e);
172
- },
173
- ref: forwardedRef
174
- })));
175
- })), {
176
- Indicator: ProgressIndicator
177
- });
114
+ const Progress = (0, import_core.withStaticProperties)(
115
+ ProgressFrame.extractable(
116
+ React.forwardRef(
117
+ (props, forwardedRef) => {
118
+ const {
119
+ __scopeProgress,
120
+ value: valueProp,
121
+ max: maxProp,
122
+ getValueLabel = defaultGetValueLabel,
123
+ size = "$4",
124
+ ...progressProps
125
+ } = props;
126
+ const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
127
+ const value = isValidValueNumber(valueProp, max) ? valueProp : null;
128
+ const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
129
+ const [width, setWidth] = React.useState(0);
130
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressProvider, {
131
+ scope: __scopeProgress,
132
+ value,
133
+ max,
134
+ width,
135
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressFrame, {
136
+ size,
137
+ "aria-valuemax": max,
138
+ "aria-valuemin": 0,
139
+ "aria-valuenow": isNumber(value) ? value : void 0,
140
+ "aria-valuetext": valueLabel,
141
+ role: "progressbar",
142
+ "data-state": getProgressState(value, max),
143
+ "data-value": value ?? void 0,
144
+ "data-max": max,
145
+ ...progressProps,
146
+ onLayout: (e) => {
147
+ var _a;
148
+ setWidth(e.nativeEvent.layout.width);
149
+ (_a = progressProps.onLayout) == null ? void 0 : _a.call(progressProps, e);
150
+ },
151
+ ref: forwardedRef
152
+ })
153
+ });
154
+ }
155
+ )
156
+ ),
157
+ {
158
+ Indicator: ProgressIndicator
159
+ }
160
+ );
178
161
  Progress.displayName = PROGRESS_NAME;
179
162
  Progress.propTypes = {
180
163
  max(props, propName, componentName) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Progress.tsx"],
4
- "sourcesContent": ["// forked from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/react/progress/src/Progress.tsx\n\nimport { GetProps, getSize, getVariableValue, styled, withStaticProperties } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { View } from 'react-native'\n\nconst PROGRESS_NAME = 'Progress'\n\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME)\ntype ProgressContextValue = { value: number | null; max: number; width: number }\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME)\n\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator'\n\ntype ProgressIndicatorElement = TamaguiElement\ninterface ProgressIndicatorProps extends YStackProps {}\n\nexport const ProgressIndicatorFrame = styled(ThemeableStack, {\n name: INDICATOR_NAME,\n height: '100%',\n width: '100%',\n backgrounded: true,\n})\n\nconst ProgressIndicator = ProgressIndicatorFrame.extractable(\n React.forwardRef<ProgressIndicatorElement, ProgressIndicatorProps>(\n (props: ScopedProps<ProgressIndicatorProps>, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress)\n const pct = context.max - (context.value ?? 0)\n const x = -context.width * (pct / 100)\n return (\n <ProgressIndicatorFrame\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n x={x}\n width={context.width}\n {...indicatorProps}\n ref={forwardedRef}\n />\n )\n }\n )\n)\n\nProgressIndicator.displayName = INDICATOR_NAME\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`\n}\n\nfunction getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading'\n}\n\nfunction isNumber(value: any): value is number {\n return typeof value === 'number'\n}\n\nfunction isValidMaxNumber(max: any): max is number {\n // prettier-ignore\n return (\n isNumber(max) &&\n !isNaN(max) &&\n max > 0\n );\n}\n\nfunction isValidValueNumber(value: any, max: number): value is number {\n // prettier-ignore\n return (\n isNumber(value) &&\n !isNaN(value) &&\n value <= max &&\n value >= 0\n );\n}\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidMaxError(propValue: string, componentName: string) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`\n}\n\nfunction getInvalidValueError(propValue: string, componentName: string) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst DEFAULT_MAX = 100\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope }\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading'\n\ntype TamaguiElement = HTMLElement | View\n\ntype ProgressElement = TamaguiElement\n\nexport const ProgressFrame = styled(ThemeableStack, {\n name: PROGRESS_NAME,\n borderRadius: 100_000,\n overflow: 'hidden',\n backgrounded: true,\n\n variants: {\n size: {\n '...size': (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 },\n})\n\ntype ProgressProps = GetProps<typeof ProgressFrame> & {\n value?: number | null | undefined\n max?: number\n getValueLabel?(value: number, max: number): string\n}\n\nconst Progress = withStaticProperties(\n ProgressFrame.extractable(\n React.forwardRef<ProgressElement, ProgressProps>(\n (props: ScopedProps<ProgressProps>, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = '$4',\n ...progressProps\n } = props\n\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX\n const value = isValidValueNumber(valueProp, max) ? valueProp : null\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined\n const [width, setWidth] = React.useState(0)\n\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max} width={width}>\n <ProgressFrame\n size={size}\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\n // @ts-ignore\n role=\"progressbar\"\n data-state={getProgressState(value, max)}\n data-value={value ?? undefined}\n data-max={max}\n {...progressProps}\n onLayout={(e) => {\n setWidth(e.nativeEvent.layout.width)\n progressProps.onLayout?.(e)\n }}\n ref={forwardedRef}\n />\n </ProgressProvider>\n )\n }\n )\n ),\n {\n Indicator: ProgressIndicator,\n }\n)\n\nProgress.displayName = PROGRESS_NAME\n\nProgress.propTypes = {\n max(props, propName, componentName) {\n const propValue = props[propName]\n const strVal = String(propValue)\n if (propValue && !isValidMaxNumber(propValue)) {\n return new Error(getInvalidMaxError(strVal, componentName))\n }\n return null\n },\n value(props, propName, componentName) {\n const valueProp = props[propName]\n const strVal = String(valueProp)\n const max = isValidMaxNumber(props.max) ? props.max : DEFAULT_MAX\n if (valueProp != null && !isValidValueNumber(valueProp, max)) {\n return new Error(getInvalidValueError(strVal, componentName))\n }\n return null\n },\n}\n\nexport { createProgressScope, Progress, ProgressIndicator }\nexport type { ProgressProps, ProgressIndicatorProps }\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAkF;AAClF,4BAA0C;AAC1C,oBAA4C;AAC5C,YAAuB;AAGvB,MAAM,gBAAgB;AAEtB,MAAM,CAAC,uBAAuB,uBAAu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;AAAA,KACN,gBAXL;AAAA,IAYC,UAAU,CAAC,MAAM;AA/K/B;AAgLgB,eAAS,EAAE,YAAY,OAAO,KAAK;AACnC,2BAAc,aAAd,wCAAyB;AAAA,IAC3B;AAAA,IACA,KAAK;AAAA,IACP,CACF;AAEJ,CACF,CACF,GACA;AAAA,EACE,WAAW;AACb,CACF;AAEA,SAAS,cAAc;AAEvB,SAAS,YAAY;AAAA,EACnB,IAAI,OAAO,UAAU,eAAe;AAClC,UAAM,YAAY,MAAM;AACxB,UAAM,SAAS,OAAO,SAAS;AAC/B,QAAI,aAAa,CAAC,iBAAiB,SAAS,GAAG;AAC7C,aAAO,IAAI,MAAM,mBAAmB,QAAQ,aAAa,CAAC;AAAA,IAC5D;AACA,WAAO;AAAA,EACT;AAAA,EACA,MAAM,OAAO,UAAU,eAAe;AACpC,UAAM,YAAY,MAAM;AACxB,UAAM,SAAS,OAAO,SAAS;AAC/B,UAAM,MAAM,iBAAiB,MAAM,GAAG,IAAI,MAAM,MAAM;AACtD,QAAI,aAAa,QAAQ,CAAC,mBAAmB,WAAW,GAAG,GAAG;AAC5D,aAAO,IAAI,MAAM,qBAAqB,QAAQ,aAAa,CAAC;AAAA,IAC9D;AACA,WAAO;AAAA,EACT;AACF;",
4
+ "sourcesContent": ["// forked from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/react/progress/src/Progress.tsx\n\nimport { GetProps, getSize, getVariableValue, styled, withStaticProperties } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { View } from 'react-native'\n\nconst PROGRESS_NAME = 'Progress'\n\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME)\ntype ProgressContextValue = { value: number | null; max: number; width: number }\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME)\n\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator'\n\ntype ProgressIndicatorElement = TamaguiElement\ninterface ProgressIndicatorProps extends YStackProps {}\n\nexport const ProgressIndicatorFrame = styled(ThemeableStack, {\n name: INDICATOR_NAME,\n height: '100%',\n width: '100%',\n backgrounded: true,\n})\n\nconst ProgressIndicator = ProgressIndicatorFrame.extractable(\n React.forwardRef<ProgressIndicatorElement, ProgressIndicatorProps>(\n (props: ScopedProps<ProgressIndicatorProps>, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress)\n const pct = context.max - (context.value ?? 0)\n const x = -context.width * (pct / 100)\n return (\n <ProgressIndicatorFrame\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n x={x}\n width={context.width}\n {...indicatorProps}\n ref={forwardedRef}\n />\n )\n }\n )\n)\n\nProgressIndicator.displayName = INDICATOR_NAME\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`\n}\n\nfunction getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading'\n}\n\nfunction isNumber(value: any): value is number {\n return typeof value === 'number'\n}\n\nfunction isValidMaxNumber(max: any): max is number {\n // prettier-ignore\n return (\n isNumber(max) &&\n !isNaN(max) &&\n max > 0\n );\n}\n\nfunction isValidValueNumber(value: any, max: number): value is number {\n // prettier-ignore\n return (\n isNumber(value) &&\n !isNaN(value) &&\n value <= max &&\n value >= 0\n );\n}\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidMaxError(propValue: string, componentName: string) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`\n}\n\nfunction getInvalidValueError(propValue: string, componentName: string) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst DEFAULT_MAX = 100\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope }\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading'\n\ntype TamaguiElement = HTMLElement | View\n\ntype ProgressElement = TamaguiElement\n\nexport const ProgressFrame = styled(ThemeableStack, {\n name: PROGRESS_NAME,\n borderRadius: 100_000,\n overflow: 'hidden',\n backgrounded: true,\n\n variants: {\n size: {\n '...size': (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 } as const,\n})\n\ntype ProgressProps = GetProps<typeof ProgressFrame> & {\n value?: number | null | undefined\n max?: number\n getValueLabel?(value: number, max: number): string\n}\n\nconst Progress = withStaticProperties(\n ProgressFrame.extractable(\n React.forwardRef<ProgressElement, ProgressProps>(\n (props: ScopedProps<ProgressProps>, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = '$4',\n ...progressProps\n } = props\n\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX\n const value = isValidValueNumber(valueProp, max) ? valueProp : null\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined\n const [width, setWidth] = React.useState(0)\n\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max} width={width}>\n <ProgressFrame\n size={size}\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\n // @ts-ignore\n role=\"progressbar\"\n data-state={getProgressState(value, max)}\n data-value={value ?? undefined}\n data-max={max}\n {...progressProps}\n onLayout={(e) => {\n setWidth(e.nativeEvent.layout.width)\n progressProps.onLayout?.(e)\n }}\n ref={forwardedRef}\n />\n </ProgressProvider>\n )\n }\n )\n ),\n {\n Indicator: ProgressIndicator,\n }\n)\n\nProgress.displayName = PROGRESS_NAME\n\nProgress.propTypes = {\n max(props, propName, componentName) {\n const propValue = props[propName]\n const strVal = String(propValue)\n if (propValue && !isValidMaxNumber(propValue)) {\n return new Error(getInvalidMaxError(strVal, componentName))\n }\n return null\n },\n value(props, propName, componentName) {\n const valueProp = props[propName]\n const strVal = String(valueProp)\n const max = isValidMaxNumber(props.max) ? props.max : DEFAULT_MAX\n if (valueProp != null && !isValidValueNumber(valueProp, max)) {\n return new Error(getInvalidValueError(strVal, componentName))\n }\n return null\n },\n}\n\nexport { createProgressScope, Progress, ProgressIndicator }\nexport type { ProgressProps, ProgressIndicatorProps }\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCQ;AArCR,kBAAkF;AAClF,4BAA0C;AAC1C,oBAA4C;AAC5C,YAAuB;AAGvB,MAAM,gBAAgB;AAEtB,MAAM,CAAC,uBAAuB,mBAAmB,QAAI,0CAAmB,aAAa;AAErF,MAAM,CAAC,kBAAkB,kBAAkB,IACzC,sBAA4C,aAAa;AAM3D,MAAM,iBAAiB;AAKhB,MAAM,6BAAyB,oBAAO,8BAAgB;AAAA,EAC3D,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,cAAc;AAChB,CAAC;AAED,MAAM,oBAAoB,uBAAuB;AAAA,EAC/C,MAAM;AAAA,IACJ,CAAC,OAA4C,iBAAiB;AAC5D,YAAM,EAAE,oBAAoB,eAAe,IAAI;AAC/C,YAAM,UAAU,mBAAmB,gBAAgB,eAAe;AAClE,YAAM,MAAM,QAAQ,OAAO,QAAQ,SAAS;AAC5C,YA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AAiB,SAAS,GAAG;AAC7C,aAAO,IAAI,MAAM,mBAAmB,QAAQ,aAAa,CAAC;AAAA,IAC5D;AACA,WAAO;AAAA,EACT;AAAA,EACA,MAAM,OAAO,UAAU,eAAe;AACpC,UAAM,YAAY,MAAM;AACxB,UAAM,SAAS,OAAO,SAAS;AAC/B,UAAM,MAAM,iBAAiB,MAAM,GAAG,IAAI,MAAM,MAAM;AACtD,QAAI,aAAa,QAAQ,CAAC,mBAAmB,WAAW,GAAG,GAAG;AAC5D,aAAO,IAAI,MAAM,qBAAqB,QAAQ,aAAa,CAAC;AAAA,IAC9D;AACA,WAAO;AAAA,EACT;AACF;",
6
6
  "names": []
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './Progress'\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,uBAAd;",
5
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,uBAAd;",
6
6
  "names": []
7
7
  }
@@ -1,34 +1,4 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
1
+ import { jsx } from "react/jsx-runtime";
32
2
  import { getSize, getVariableValue, styled, withStaticProperties } from "@tamagui/core";
33
3
  import { createContextScope } from "@tamagui/create-context";
34
4
  import { ThemeableStack } from "@tamagui/stacks";
@@ -43,21 +13,25 @@ const ProgressIndicatorFrame = styled(ThemeableStack, {
43
13
  width: "100%",
44
14
  backgrounded: true
45
15
  });
46
- const ProgressIndicator = ProgressIndicatorFrame.extractable(React.forwardRef((props, forwardedRef) => {
47
- const _a = props, { __scopeProgress } = _a, indicatorProps = __objRest(_a, ["__scopeProgress"]);
48
- const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
49
- const pct = context.max - (context.value ?? 0);
50
- const x = -context.width * (pct / 100);
51
- return /* @__PURE__ */ React.createElement(ProgressIndicatorFrame, __spreadProps(__spreadValues({
52
- "data-state": getProgressState(context.value, context.max),
53
- "data-value": context.value ?? void 0,
54
- "data-max": context.max,
55
- x,
56
- width: context.width
57
- }, indicatorProps), {
58
- ref: forwardedRef
59
- }));
60
- }));
16
+ const ProgressIndicator = ProgressIndicatorFrame.extractable(
17
+ React.forwardRef(
18
+ (props, forwardedRef) => {
19
+ const { __scopeProgress, ...indicatorProps } = props;
20
+ const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
21
+ const pct = context.max - (context.value ?? 0);
22
+ const x = -context.width * (pct / 100);
23
+ return /* @__PURE__ */ jsx(ProgressIndicatorFrame, {
24
+ "data-state": getProgressState(context.value, context.max),
25
+ "data-value": context.value ?? void 0,
26
+ "data-max": context.max,
27
+ x,
28
+ width: context.width,
29
+ ...indicatorProps,
30
+ ref: forwardedRef
31
+ });
32
+ }
33
+ )
34
+ );
61
35
  ProgressIndicator.displayName = INDICATOR_NAME;
62
36
  function defaultGetValueLabel(value, max) {
63
37
  return `${Math.round(value / max * 100)}%`;
@@ -104,50 +78,53 @@ const ProgressFrame = styled(ThemeableStack, {
104
78
  }
105
79
  }
106
80
  });
107
- const Progress = withStaticProperties(ProgressFrame.extractable(React.forwardRef((props, forwardedRef) => {
108
- const _a = props, {
109
- __scopeProgress,
110
- value: valueProp,
111
- max: maxProp,
112
- getValueLabel = defaultGetValueLabel,
113
- size = "$4"
114
- } = _a, progressProps = __objRest(_a, [
115
- "__scopeProgress",
116
- "value",
117
- "max",
118
- "getValueLabel",
119
- "size"
120
- ]);
121
- const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
122
- const value = isValidValueNumber(valueProp, max) ? valueProp : null;
123
- const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
124
- const [width, setWidth] = React.useState(0);
125
- return /* @__PURE__ */ React.createElement(ProgressProvider, {
126
- scope: __scopeProgress,
127
- value,
128
- max,
129
- width
130
- }, /* @__PURE__ */ React.createElement(ProgressFrame, __spreadProps(__spreadValues({
131
- size,
132
- "aria-valuemax": max,
133
- "aria-valuemin": 0,
134
- "aria-valuenow": isNumber(value) ? value : void 0,
135
- "aria-valuetext": valueLabel,
136
- role: "progressbar",
137
- "data-state": getProgressState(value, max),
138
- "data-value": value ?? void 0,
139
- "data-max": max
140
- }, progressProps), {
141
- onLayout: (e) => {
142
- var _a2;
143
- setWidth(e.nativeEvent.layout.width);
144
- (_a2 = progressProps.onLayout) == null ? void 0 : _a2.call(progressProps, e);
145
- },
146
- ref: forwardedRef
147
- })));
148
- })), {
149
- Indicator: ProgressIndicator
150
- });
81
+ const Progress = withStaticProperties(
82
+ ProgressFrame.extractable(
83
+ React.forwardRef(
84
+ (props, forwardedRef) => {
85
+ const {
86
+ __scopeProgress,
87
+ value: valueProp,
88
+ max: maxProp,
89
+ getValueLabel = defaultGetValueLabel,
90
+ size = "$4",
91
+ ...progressProps
92
+ } = props;
93
+ const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
94
+ const value = isValidValueNumber(valueProp, max) ? valueProp : null;
95
+ const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
96
+ const [width, setWidth] = React.useState(0);
97
+ return /* @__PURE__ */ jsx(ProgressProvider, {
98
+ scope: __scopeProgress,
99
+ value,
100
+ max,
101
+ width,
102
+ children: /* @__PURE__ */ jsx(ProgressFrame, {
103
+ size,
104
+ "aria-valuemax": max,
105
+ "aria-valuemin": 0,
106
+ "aria-valuenow": isNumber(value) ? value : void 0,
107
+ "aria-valuetext": valueLabel,
108
+ role: "progressbar",
109
+ "data-state": getProgressState(value, max),
110
+ "data-value": value ?? void 0,
111
+ "data-max": max,
112
+ ...progressProps,
113
+ onLayout: (e) => {
114
+ var _a;
115
+ setWidth(e.nativeEvent.layout.width);
116
+ (_a = progressProps.onLayout) == null ? void 0 : _a.call(progressProps, e);
117
+ },
118
+ ref: forwardedRef
119
+ })
120
+ });
121
+ }
122
+ )
123
+ ),
124
+ {
125
+ Indicator: ProgressIndicator
126
+ }
127
+ );
151
128
  Progress.displayName = PROGRESS_NAME;
152
129
  Progress.propTypes = {
153
130
  max(props, propName, componentName) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Progress.tsx"],
4
- "sourcesContent": ["// forked from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/react/progress/src/Progress.tsx\n\nimport { GetProps, getSize, getVariableValue, styled, withStaticProperties } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { View } from 'react-native'\n\nconst PROGRESS_NAME = 'Progress'\n\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME)\ntype ProgressContextValue = { value: number | null; max: number; width: number }\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME)\n\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator'\n\ntype ProgressIndicatorElement = TamaguiElement\ninterface ProgressIndicatorProps extends YStackProps {}\n\nexport const ProgressIndicatorFrame = styled(ThemeableStack, {\n name: INDICATOR_NAME,\n height: '100%',\n width: '100%',\n backgrounded: true,\n})\n\nconst ProgressIndicator = ProgressIndicatorFrame.extractable(\n React.forwardRef<ProgressIndicatorElement, ProgressIndicatorProps>(\n (props: ScopedProps<ProgressIndicatorProps>, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress)\n const pct = context.max - (context.value ?? 0)\n const x = -context.width * (pct / 100)\n return (\n <ProgressIndicatorFrame\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n x={x}\n width={context.width}\n {...indicatorProps}\n ref={forwardedRef}\n />\n )\n }\n )\n)\n\nProgressIndicator.displayName = INDICATOR_NAME\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`\n}\n\nfunction getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading'\n}\n\nfunction isNumber(value: any): value is number {\n return typeof value === 'number'\n}\n\nfunction isValidMaxNumber(max: any): max is number {\n // prettier-ignore\n return (\n isNumber(max) &&\n !isNaN(max) &&\n max > 0\n );\n}\n\nfunction isValidValueNumber(value: any, max: number): value is number {\n // prettier-ignore\n return (\n isNumber(value) &&\n !isNaN(value) &&\n value <= max &&\n value >= 0\n );\n}\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidMaxError(propValue: string, componentName: string) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`\n}\n\nfunction getInvalidValueError(propValue: string, componentName: string) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst DEFAULT_MAX = 100\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope }\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading'\n\ntype TamaguiElement = HTMLElement | View\n\ntype ProgressElement = TamaguiElement\n\nexport const ProgressFrame = styled(ThemeableStack, {\n name: PROGRESS_NAME,\n borderRadius: 100_000,\n overflow: 'hidden',\n backgrounded: true,\n\n variants: {\n size: {\n '...size': (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 },\n})\n\ntype ProgressProps = GetProps<typeof ProgressFrame> & {\n value?: number | null | undefined\n max?: number\n getValueLabel?(value: number, max: number): string\n}\n\nconst Progress = withStaticProperties(\n ProgressFrame.extractable(\n React.forwardRef<ProgressElement, ProgressProps>(\n (props: ScopedProps<ProgressProps>, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = '$4',\n ...progressProps\n } = props\n\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX\n const value = isValidValueNumber(valueProp, max) ? valueProp : null\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined\n const [width, setWidth] = React.useState(0)\n\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max} width={width}>\n <ProgressFrame\n size={size}\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\n // @ts-ignore\n role=\"progressbar\"\n data-state={getProgressState(value, max)}\n data-value={value ?? undefined}\n data-max={max}\n {...progressProps}\n onLayout={(e) => {\n setWidth(e.nativeEvent.layout.width)\n progressProps.onLayout?.(e)\n }}\n ref={forwardedRef}\n />\n </ProgressProvider>\n )\n }\n )\n ),\n {\n Indicator: ProgressIndicator,\n }\n)\n\nProgress.displayName = PROGRESS_NAME\n\nProgress.propTypes = {\n max(props, propName, componentName) {\n const propValue = props[propName]\n const strVal = String(propValue)\n if (propValue && !isValidMaxNumber(propValue)) {\n return new Error(getInvalidMaxError(strVal, componentName))\n }\n return null\n },\n value(props, propName, componentName) {\n const valueProp = props[propName]\n const strVal = String(valueProp)\n const max = isValidMaxNumber(props.max) ? props.max : DEFAULT_MAX\n if (valueProp != null && !isValidValueNumber(valueProp, max)) {\n return new Error(getInvalidValueError(strVal, componentName))\n }\n return null\n },\n}\n\nexport { createProgressScope, Progress, ProgressIndicator }\nexport type { ProgressProps, ProgressIndicatorProps }\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;AACA;AAGA,MAAM,gBAAgB;AAEtB,MAAM,CAAC,uBAAuB,uBAAuB,mBAAmB,aAAa;AAErF,MAAM,CAAC,kBAAkB,sBACvB,sBAA4C,aAAa;AAM3D,MAAM,iBAAiB;AAKhB,MAAM,yBAAyB,OAAO,gBAAgB;AAAA,EAC3D,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,cAAc;AAChB,CAAC;AAED,MAAM,oBAAoB,uBAAuB,YAC/C,MAAM,WACJ,CAAC,OAA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,IAAI,OAAO,UAAU,eAAe;AAClC,UAAM,YAAY,MAAM;AACxB,UAAM,SAAS,OAAO,SAAS;AAC/B,QAAI,aAAa,CAAC,iBAAiB,SAAS,GAAG;AAC7C,aAAO,IAAI,MAAM,mBAAmB,QAAQ,aAAa,CAAC;AAAA,IAC5D;AACA,WAAO;AAAA,EACT;AAAA,EACA,MAAM,OAAO,UAAU,eAAe;AACpC,UAAM,YAAY,MAAM;AACxB,UAAM,SAAS,OAAO,SAAS;AAC/B,UAAM,MAAM,iBAAiB,MAAM,GAAG,IAAI,MAAM,MAAM;AACtD,QAAI,aAAa,QAAQ,CAAC,mBAAmB,WAAW,GAAG,GAAG;AAC5D,aAAO,IAAI,MAAM,qBAAqB,QAAQ,aAAa,CAAC;AAAA,IAC9D;AACA,WAAO;AAAA,EACT;AACF;",
4
+ "sourcesContent": ["// forked from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/react/progress/src/Progress.tsx\n\nimport { GetProps, getSize, getVariableValue, styled, withStaticProperties } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { View } from 'react-native'\n\nconst PROGRESS_NAME = 'Progress'\n\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME)\ntype ProgressContextValue = { value: number | null; max: number; width: number }\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME)\n\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator'\n\ntype ProgressIndicatorElement = TamaguiElement\ninterface ProgressIndicatorProps extends YStackProps {}\n\nexport const ProgressIndicatorFrame = styled(ThemeableStack, {\n name: INDICATOR_NAME,\n height: '100%',\n width: '100%',\n backgrounded: true,\n})\n\nconst ProgressIndicator = ProgressIndicatorFrame.extractable(\n React.forwardRef<ProgressIndicatorElement, ProgressIndicatorProps>(\n (props: ScopedProps<ProgressIndicatorProps>, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress)\n const pct = context.max - (context.value ?? 0)\n const x = -context.width * (pct / 100)\n return (\n <ProgressIndicatorFrame\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n x={x}\n width={context.width}\n {...indicatorProps}\n ref={forwardedRef}\n />\n )\n }\n )\n)\n\nProgressIndicator.displayName = INDICATOR_NAME\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`\n}\n\nfunction getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading'\n}\n\nfunction isNumber(value: any): value is number {\n return typeof value === 'number'\n}\n\nfunction isValidMaxNumber(max: any): max is number {\n // prettier-ignore\n return (\n isNumber(max) &&\n !isNaN(max) &&\n max > 0\n );\n}\n\nfunction isValidValueNumber(value: any, max: number): value is number {\n // prettier-ignore\n return (\n isNumber(value) &&\n !isNaN(value) &&\n value <= max &&\n value >= 0\n );\n}\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidMaxError(propValue: string, componentName: string) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`\n}\n\nfunction getInvalidValueError(propValue: string, componentName: string) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst DEFAULT_MAX = 100\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope }\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading'\n\ntype TamaguiElement = HTMLElement | View\n\ntype ProgressElement = TamaguiElement\n\nexport const ProgressFrame = styled(ThemeableStack, {\n name: PROGRESS_NAME,\n borderRadius: 100_000,\n overflow: 'hidden',\n backgrounded: true,\n\n variants: {\n size: {\n '...size': (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 } as const,\n})\n\ntype ProgressProps = GetProps<typeof ProgressFrame> & {\n value?: number | null | undefined\n max?: number\n getValueLabel?(value: number, max: number): string\n}\n\nconst Progress = withStaticProperties(\n ProgressFrame.extractable(\n React.forwardRef<ProgressElement, ProgressProps>(\n (props: ScopedProps<ProgressProps>, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = '$4',\n ...progressProps\n } = props\n\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX\n const value = isValidValueNumber(valueProp, max) ? valueProp : null\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined\n const [width, setWidth] = React.useState(0)\n\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max} width={width}>\n <ProgressFrame\n size={size}\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\n // @ts-ignore\n role=\"progressbar\"\n data-state={getProgressState(value, max)}\n data-value={value ?? undefined}\n data-max={max}\n {...progressProps}\n onLayout={(e) => {\n setWidth(e.nativeEvent.layout.width)\n progressProps.onLayout?.(e)\n }}\n ref={forwardedRef}\n />\n </ProgressProvider>\n )\n }\n )\n ),\n {\n Indicator: ProgressIndicator,\n }\n)\n\nProgress.displayName = PROGRESS_NAME\n\nProgress.propTypes = {\n max(props, propName, componentName) {\n const propValue = props[propName]\n const strVal = String(propValue)\n if (propValue && !isValidMaxNumber(propValue)) {\n return new Error(getInvalidMaxError(strVal, componentName))\n }\n return null\n },\n value(props, propName, componentName) {\n const valueProp = props[propName]\n const strVal = String(valueProp)\n const max = isValidMaxNumber(props.max) ? props.max : DEFAULT_MAX\n if (valueProp != null && !isValidValueNumber(valueProp, max)) {\n return new Error(getInvalidValueError(strVal, componentName))\n }\n return null\n },\n}\n\nexport { createProgressScope, Progress, ProgressIndicator }\nexport type { ProgressProps, ProgressIndicatorProps }\n"],
5
+ "mappings": "AAwCQ;AArCR,SAAmB,SAAS,kBAAkB,QAAQ,4BAA4B;AAClF,SAAgB,0BAA0B;AAC1C,SAAS,sBAAmC;AAC5C,YAAY,WAAW;AAGvB,MAAM,gBAAgB;AAEtB,MAAM,CAAC,uBAAuB,mBAAmB,IAAI,mBAAmB,aAAa;AAErF,MAAM,CAAC,kBAAkB,kBAAkB,IACzC,sBAA4C,aAAa;AAM3D,MAAM,iBAAiB;AAKhB,MAAM,yBAAyB,OAAO,gBAAgB;AAAA,EAC3D,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,cAAc;AAChB,CAAC;AAED,MAAM,oBAAoB,uBAAuB;AAAA,EAC/C,MAAM;AAAA,IACJ,CAAC,OAA4C,iBAAiB;AAC5D,YAAM,EAAE,oBAAoB,eAAe,IAAI;AAC/C,YAAM,UAAU,mBAAmB,gBAAgB,eAAe;AAClE,YAAM,MAAM,QAAQ,OAAO,QAAQ,SAAS;AAC5C,YAAM,IAAI,CAAC,QAAQ,SAAS,MAAM;AAClC,aACE,oBAAC;AAAA,QACC,cAAY,iBAAiB,QAAQ,OAAO,QAAQ,GAAG;AAAA,QACvD,cAAY,QAAQ,SAAS;AAAA,QAC7B,YAAU,QAAQ;AAAA,QAClB;AAAA,QACA,OAAO,QAAQ;AAAA,QACd,GAAG;AAAA,QACJ,KAAK;AAAA,OACP;AAAA,IAEJ;AAAA,EACF;AACF;AAEA,kBAAkB,cAAc;AAIhC,SA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AAG;AAC5D,aAAO,IAAI,MAAM,qBAAqB,QAAQ,aAAa,CAAC;AAAA,IAC9D;AACA,WAAO;AAAA,EACT;AACF;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
File without changes
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './Progress'\n"],
5
- "mappings": "AAAA;",
5
+ "mappings": "AAAA,cAAc;",
6
6
  "names": []
7
7
  }
@@ -12,14 +12,17 @@ const ProgressIndicatorFrame = styled(ThemeableStack, {
12
12
  width: "100%",
13
13
  backgrounded: true
14
14
  });
15
- const ProgressIndicator = ProgressIndicatorFrame.extractable(React.forwardRef((props, forwardedRef) => {
16
- var _a, _b;
17
- const { __scopeProgress, ...indicatorProps } = props;
18
- const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
19
- const pct = context.max - ((_a = context.value) != null ? _a : 0);
20
- const x = -context.width * (pct / 100);
21
- return <ProgressIndicatorFrame data-state={getProgressState(context.value, context.max)} data-value={(_b = context.value) != null ? _b : void 0} data-max={context.max} x={x} width={context.width} {...indicatorProps} ref={forwardedRef} />;
22
- }));
15
+ const ProgressIndicator = ProgressIndicatorFrame.extractable(
16
+ React.forwardRef(
17
+ (props, forwardedRef) => {
18
+ const { __scopeProgress, ...indicatorProps } = props;
19
+ const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
20
+ const pct = context.max - (context.value ?? 0);
21
+ const x = -context.width * (pct / 100);
22
+ return <ProgressIndicatorFrame data-state={getProgressState(context.value, context.max)} data-value={context.value ?? void 0} data-max={context.max} x={x} width={context.width} {...indicatorProps} ref={forwardedRef} />;
23
+ }
24
+ )
25
+ );
23
26
  ProgressIndicator.displayName = INDICATOR_NAME;
24
27
  function defaultGetValueLabel(value, max) {
25
28
  return `${Math.round(value / max * 100)}%`;
@@ -66,27 +69,33 @@ const ProgressFrame = styled(ThemeableStack, {
66
69
  }
67
70
  }
68
71
  });
69
- const Progress = withStaticProperties(ProgressFrame.extractable(React.forwardRef((props, forwardedRef) => {
70
- const {
71
- __scopeProgress,
72
- value: valueProp,
73
- max: maxProp,
74
- getValueLabel = defaultGetValueLabel,
75
- size = "$4",
76
- ...progressProps
77
- } = props;
78
- const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
79
- const value = isValidValueNumber(valueProp, max) ? valueProp : null;
80
- const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
81
- const [width, setWidth] = React.useState(0);
82
- return <ProgressProvider scope={__scopeProgress} value={value} max={max} width={width}><ProgressFrame size={size} aria-valuemax={max} aria-valuemin={0} aria-valuenow={isNumber(value) ? value : void 0} aria-valuetext={valueLabel} role="progressbar" data-state={getProgressState(value, max)} data-value={value != null ? value : void 0} data-max={max} {...progressProps} onLayout={(e) => {
83
- var _a;
84
- setWidth(e.nativeEvent.layout.width);
85
- (_a = progressProps.onLayout) == null ? void 0 : _a.call(progressProps, e);
86
- }} ref={forwardedRef} /></ProgressProvider>;
87
- })), {
88
- Indicator: ProgressIndicator
89
- });
72
+ const Progress = withStaticProperties(
73
+ ProgressFrame.extractable(
74
+ React.forwardRef(
75
+ (props, forwardedRef) => {
76
+ const {
77
+ __scopeProgress,
78
+ value: valueProp,
79
+ max: maxProp,
80
+ getValueLabel = defaultGetValueLabel,
81
+ size = "$4",
82
+ ...progressProps
83
+ } = props;
84
+ const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
85
+ const value = isValidValueNumber(valueProp, max) ? valueProp : null;
86
+ const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
87
+ const [width, setWidth] = React.useState(0);
88
+ return <ProgressProvider scope={__scopeProgress} value={value} max={max} width={width}><ProgressFrame size={size} aria-valuemax={max} aria-valuemin={0} aria-valuenow={isNumber(value) ? value : void 0} aria-valuetext={valueLabel} role="progressbar" data-state={getProgressState(value, max)} data-value={value ?? void 0} data-max={max} {...progressProps} onLayout={(e) => {
89
+ setWidth(e.nativeEvent.layout.width);
90
+ progressProps.onLayout?.(e);
91
+ }} ref={forwardedRef} /></ProgressProvider>;
92
+ }
93
+ )
94
+ ),
95
+ {
96
+ Indicator: ProgressIndicator
97
+ }
98
+ );
90
99
  Progress.displayName = PROGRESS_NAME;
91
100
  Progress.propTypes = {
92
101
  max(props, propName, componentName) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Progress.tsx"],
4
- "sourcesContent": ["// forked from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/react/progress/src/Progress.tsx\n\nimport { GetProps, getSize, getVariableValue, styled, withStaticProperties } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { View } from 'react-native'\n\nconst PROGRESS_NAME = 'Progress'\n\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME)\ntype ProgressContextValue = { value: number | null; max: number; width: number }\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME)\n\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator'\n\ntype ProgressIndicatorElement = TamaguiElement\ninterface ProgressIndicatorProps extends YStackProps {}\n\nexport const ProgressIndicatorFrame = styled(ThemeableStack, {\n name: INDICATOR_NAME,\n height: '100%',\n width: '100%',\n backgrounded: true,\n})\n\nconst ProgressIndicator = ProgressIndicatorFrame.extractable(\n React.forwardRef<ProgressIndicatorElement, ProgressIndicatorProps>(\n (props: ScopedProps<ProgressIndicatorProps>, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress)\n const pct = context.max - (context.value ?? 0)\n const x = -context.width * (pct / 100)\n return (\n <ProgressIndicatorFrame\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n x={x}\n width={context.width}\n {...indicatorProps}\n ref={forwardedRef}\n />\n )\n }\n )\n)\n\nProgressIndicator.displayName = INDICATOR_NAME\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`\n}\n\nfunction getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading'\n}\n\nfunction isNumber(value: any): value is number {\n return typeof value === 'number'\n}\n\nfunction isValidMaxNumber(max: any): max is number {\n // prettier-ignore\n return (\n isNumber(max) &&\n !isNaN(max) &&\n max > 0\n );\n}\n\nfunction isValidValueNumber(value: any, max: number): value is number {\n // prettier-ignore\n return (\n isNumber(value) &&\n !isNaN(value) &&\n value <= max &&\n value >= 0\n );\n}\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidMaxError(propValue: string, componentName: string) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`\n}\n\nfunction getInvalidValueError(propValue: string, componentName: string) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst DEFAULT_MAX = 100\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope }\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading'\n\ntype TamaguiElement = HTMLElement | View\n\ntype ProgressElement = TamaguiElement\n\nexport const ProgressFrame = styled(ThemeableStack, {\n name: PROGRESS_NAME,\n borderRadius: 100_000,\n overflow: 'hidden',\n backgrounded: true,\n\n variants: {\n size: {\n '...size': (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 },\n})\n\ntype ProgressProps = GetProps<typeof ProgressFrame> & {\n value?: number | null | undefined\n max?: number\n getValueLabel?(value: number, max: number): string\n}\n\nconst Progress = withStaticProperties(\n ProgressFrame.extractable(\n React.forwardRef<ProgressElement, ProgressProps>(\n (props: ScopedProps<ProgressProps>, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = '$4',\n ...progressProps\n } = props\n\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX\n const value = isValidValueNumber(valueProp, max) ? valueProp : null\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined\n const [width, setWidth] = React.useState(0)\n\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max} width={width}>\n <ProgressFrame\n size={size}\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\n // @ts-ignore\n role=\"progressbar\"\n data-state={getProgressState(value, max)}\n data-value={value ?? undefined}\n data-max={max}\n {...progressProps}\n onLayout={(e) => {\n setWidth(e.nativeEvent.layout.width)\n progressProps.onLayout?.(e)\n }}\n ref={forwardedRef}\n />\n </ProgressProvider>\n )\n }\n )\n ),\n {\n Indicator: ProgressIndicator,\n }\n)\n\nProgress.displayName = PROGRESS_NAME\n\nProgress.propTypes = {\n max(props, propName, componentName) {\n const propValue = props[propName]\n const strVal = String(propValue)\n if (propValue && !isValidMaxNumber(propValue)) {\n return new Error(getInvalidMaxError(strVal, componentName))\n }\n return null\n },\n value(props, propName, componentName) {\n const valueProp = props[propName]\n const strVal = String(valueProp)\n const max = isValidMaxNumber(props.max) ? props.max : DEFAULT_MAX\n if (valueProp != null && !isValidValueNumber(valueProp, max)) {\n return new Error(getInvalidValueError(strVal, componentName))\n }\n return null\n },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,CAAC,MAAM;AA/K/B;AAgLgB,aAAS,EAAE,YAAY,OAAO,KAAK;AACnC,wBAAc,aAAd,uCAAyB;AAAA,EAC3B,GACA,KAAK,cACP,EACF,EAnBC;AAqBL,CACF,CACF,GACA;AAAA,EACE,WAAW;AACb,CACF;AAEA,SAAS,cAAc;AAEvB,SAAS,YAAY;AAAA,EACnB,IAAI,OAAO,UAAU,eAAe;AAClC,UAAM,YAAY,MAAM;AACxB,UAAM,SAAS,OAAO,SAAS;AAC/B,QAAI,aAAa,CAAC,iBAAiB,SAAS,GAAG;AAC7C,aAAO,IAAI,MAAM,mBAAmB,QAAQ,aAAa,CAAC;AAAA,IAC5D;AACA,WAAO;AAAA,EACT;AAAA,EACA,MAAM,OAAO,UAAU,eAAe;AACpC,UAAM,YAAY,MAAM;AACxB,UAAM,SAAS,OAAO,SAAS;AAC/B,UAAM,MAAM,iBAAiB,MAAM,GAAG,IAAI,MAAM,MAAM;AACtD,QAAI,aAAa,QAAQ,CAAC,mBAAmB,WAAW,GAAG,GAAG;AAC5D,aAAO,IAAI,MAAM,qBAAqB,QAAQ,aAAa,CAAC;AAAA,IAC9D;AACA,WAAO;AAAA,EACT;AACF;",
4
+ "sourcesContent": ["// forked from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/react/progress/src/Progress.tsx\n\nimport { GetProps, getSize, getVariableValue, styled, withStaticProperties } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { View } from 'react-native'\n\nconst PROGRESS_NAME = 'Progress'\n\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME)\ntype ProgressContextValue = { value: number | null; max: number; width: number }\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME)\n\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator'\n\ntype ProgressIndicatorElement = TamaguiElement\ninterface ProgressIndicatorProps extends YStackProps {}\n\nexport const ProgressIndicatorFrame = styled(ThemeableStack, {\n name: INDICATOR_NAME,\n height: '100%',\n width: '100%',\n backgrounded: true,\n})\n\nconst ProgressIndicator = ProgressIndicatorFrame.extractable(\n React.forwardRef<ProgressIndicatorElement, ProgressIndicatorProps>(\n (props: ScopedProps<ProgressIndicatorProps>, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress)\n const pct = context.max - (context.value ?? 0)\n const x = -context.width * (pct / 100)\n return (\n <ProgressIndicatorFrame\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n x={x}\n width={context.width}\n {...indicatorProps}\n ref={forwardedRef}\n />\n )\n }\n )\n)\n\nProgressIndicator.displayName = INDICATOR_NAME\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`\n}\n\nfunction getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading'\n}\n\nfunction isNumber(value: any): value is number {\n return typeof value === 'number'\n}\n\nfunction isValidMaxNumber(max: any): max is number {\n // prettier-ignore\n return (\n isNumber(max) &&\n !isNaN(max) &&\n max > 0\n );\n}\n\nfunction isValidValueNumber(value: any, max: number): value is number {\n // prettier-ignore\n return (\n isNumber(value) &&\n !isNaN(value) &&\n value <= max &&\n value >= 0\n );\n}\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidMaxError(propValue: string, componentName: string) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`\n}\n\nfunction getInvalidValueError(propValue: string, componentName: string) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst DEFAULT_MAX = 100\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope }\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading'\n\ntype TamaguiElement = HTMLElement | View\n\ntype ProgressElement = TamaguiElement\n\nexport const ProgressFrame = styled(ThemeableStack, {\n name: PROGRESS_NAME,\n borderRadius: 100_000,\n overflow: 'hidden',\n backgrounded: true,\n\n variants: {\n size: {\n '...size': (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 } as const,\n})\n\ntype ProgressProps = GetProps<typeof ProgressFrame> & {\n value?: number | null | undefined\n max?: number\n getValueLabel?(value: number, max: number): string\n}\n\nconst Progress = withStaticProperties(\n ProgressFrame.extractable(\n React.forwardRef<ProgressElement, ProgressProps>(\n (props: ScopedProps<ProgressProps>, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n size = '$4',\n ...progressProps\n } = props\n\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX\n const value = isValidValueNumber(valueProp, max) ? valueProp : null\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined\n const [width, setWidth] = React.useState(0)\n\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max} width={width}>\n <ProgressFrame\n size={size}\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\n // @ts-ignore\n role=\"progressbar\"\n data-state={getProgressState(value, max)}\n data-value={value ?? undefined}\n data-max={max}\n {...progressProps}\n onLayout={(e) => {\n setWidth(e.nativeEvent.layout.width)\n progressProps.onLayout?.(e)\n }}\n ref={forwardedRef}\n />\n </ProgressProvider>\n )\n }\n )\n ),\n {\n Indicator: ProgressIndicator,\n }\n)\n\nProgress.displayName = PROGRESS_NAME\n\nProgress.propTypes = {\n max(props, propName, componentName) {\n const propValue = props[propName]\n const strVal = String(propValue)\n if (propValue && !isValidMaxNumber(propValue)) {\n return new Error(getInvalidMaxError(strVal, componentName))\n }\n return null\n },\n value(props, propName, componentName) {\n const valueProp = props[propName]\n const strVal = String(valueProp)\n const max = isValidMaxNumber(props.max) ? props.max : DEFAULT_MAX\n if (valueProp != null && !isValidValueNumber(valueProp, max)) {\n return new Error(getInvalidValueError(strVal, componentName))\n }\n return null\n },\n}\n\nexport { createProgressScope, Progress, ProgressIndicator }\nexport type { ProgressProps, ProgressIndicatorProps }\n"],
5
+ "mappings": "AAGA,SAAmB,SAAS,kBAAkB,QAAQ,4BAA4B;AAClF,SAAgB,0BAA0B;AAC1C,SAAS,sBAAmC;AAC5C,YAAY,WAAW;AAGvB,MAAM,gBAAgB;AAEtB,MAAM,CAAC,uBAAuB,mBAAmB,IAAI,mBAAmB,aAAa;AAErF,MAAM,CAAC,kBAAkB,kBAAkB,IACzC,sBAA4C,aAAa;AAM3D,MAAM,iBAAiB;AAKhB,MAAM,yBAAyB,OAAO,gBAAgB;AAAA,EAC3D,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,cAAc;AAChB,CAAC;AAED,MAAM,oBAAoB,uBAAuB;AAAA,EAC/C,MAAM;AAAA,IACJ,CAAC,OAA4C,iBAAiB;AAC5D,YAAM,EAAE,oBAAoB,eAAe,IAAI;AAC/C,YAAM,UAAU,mBAAmB,gBAAgB,eAAe;AAClE,YAAM,MAAM,QAAQ,OAAO,QAAQ,SAAS;AAC5C,YAAM,IAAI,CAAC,QAAQ,SAAS,MAAM;AAClC,aACE,CAAC,uBACC,YAAY,iBAAiB,QAAQ,OAAO,Q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AM,MAAM;AACtD,QAAI,aAAa,QAAQ,CAAC,mBAAmB,WAAW,GAAG,GAAG;AAC5D,aAAO,IAAI,MAAM,qBAAqB,QAAQ,aAAa,CAAC;AAAA,IAC9D;AACA,WAAO;AAAA,EACT;AACF;",
6
6
  "names": []
7
7
  }
package/dist/jsx/index.js CHANGED
File without changes
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './Progress'\n"],
5
- "mappings": "AAAA;",
5
+ "mappings": "AAAA,cAAc;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/progress",
3
- "version": "1.0.1-beta.99",
3
+ "version": "1.0.1-rc.0.1",
4
4
  "sideEffects": [
5
5
  "*.css"
6
6
  ],
@@ -17,25 +17,27 @@
17
17
  "scripts": {
18
18
  "build": "tamagui-build",
19
19
  "watch": "tamagui-build --watch",
20
+ "lint": "eslint src",
21
+ "lint:fix": "yarn lint --fix",
20
22
  "clean": "tamagui-build clean",
21
23
  "clean:build": "tamagui-build clean:build"
22
24
  },
23
25
  "dependencies": {
24
- "@tamagui/compose-refs": "^1.0.1-beta.99",
25
- "@tamagui/core": "^1.0.1-beta.99",
26
- "@tamagui/create-context": "^1.0.1-beta.99",
27
- "@tamagui/stacks": "^1.0.1-beta.99"
26
+ "@tamagui/compose-refs": "^1.0.1-rc.0.1",
27
+ "@tamagui/core": "^1.0.1-rc.0.1",
28
+ "@tamagui/create-context": "^1.0.1-rc.0.1",
29
+ "@tamagui/stacks": "^1.0.1-rc.0.1"
28
30
  },
29
31
  "peerDependencies": {
30
- "react": "*",
31
- "react-dom": "*",
32
+ "react": ">=18",
33
+ "react-dom": ">=18",
32
34
  "react-native": "*"
33
35
  },
34
36
  "devDependencies": {
35
- "@tamagui/build": "^1.0.1-beta.99",
36
- "@types/react-native": "^0.67.3",
37
- "react": "*",
38
- "react-dom": "*",
37
+ "@tamagui/build": "^1.0.1-rc.0.1",
38
+ "@types/react-native": "^0.69.2",
39
+ "react": ">=18",
40
+ "react-dom": ">=18",
39
41
  "react-native": "*"
40
42
  },
41
43
  "publishConfig": {
package/src/Progress.tsx CHANGED
@@ -132,7 +132,7 @@ export const ProgressFrame = styled(ThemeableStack, {
132
132
  }
133
133
  },
134
134
  },
135
- },
135
+ } as const,
136
136
  })
137
137
 
138
138
  type ProgressProps = GetProps<typeof ProgressFrame> & {
@@ -5,261 +5,261 @@ import { View } from 'react-native';
5
5
  declare const createProgressScope: import("@tamagui/create-context").CreateScope;
6
6
  interface ProgressIndicatorProps extends YStackProps {
7
7
  }
8
- export declare const ProgressIndicatorFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
8
+ export declare const ProgressIndicatorFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
9
9
  readonly fullscreen?: boolean | undefined;
10
10
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
11
11
  }, "fontFamily" | "hoverTheme" | "pressTheme" | "focusTheme" | "circular" | "elevate" | "bordered" | "transparent" | "backgrounded" | "radiused" | "padded" | "chromeless"> & {
12
- fontFamily?: unknown;
13
- backgrounded?: boolean | undefined;
14
- radiused?: boolean | undefined;
15
- hoverTheme?: boolean | undefined;
16
- pressTheme?: boolean | undefined;
17
- focusTheme?: boolean | undefined;
18
- circular?: boolean | undefined;
19
- padded?: boolean | undefined;
20
- elevate?: boolean | undefined;
21
- bordered?: number | boolean | undefined;
22
- transparent?: boolean | undefined;
23
- chromeless?: boolean | undefined;
24
- } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
12
+ readonly fontFamily?: unknown;
13
+ readonly backgrounded?: boolean | undefined;
14
+ readonly radiused?: boolean | undefined;
15
+ readonly hoverTheme?: boolean | undefined;
16
+ readonly pressTheme?: boolean | undefined;
17
+ readonly focusTheme?: boolean | undefined;
18
+ readonly circular?: boolean | undefined;
19
+ readonly padded?: boolean | undefined;
20
+ readonly elevate?: boolean | undefined;
21
+ readonly bordered?: number | boolean | undefined;
22
+ readonly transparent?: boolean | undefined;
23
+ readonly chromeless?: boolean | "all" | undefined;
24
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
25
25
  readonly fullscreen?: boolean | undefined;
26
26
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
27
27
  }, "fontFamily" | "hoverTheme" | "pressTheme" | "focusTheme" | "circular" | "elevate" | "bordered" | "transparent" | "backgrounded" | "radiused" | "padded" | "chromeless"> & {
28
- fontFamily?: unknown;
29
- backgrounded?: boolean | undefined;
30
- radiused?: boolean | undefined;
31
- hoverTheme?: boolean | undefined;
32
- pressTheme?: boolean | undefined;
33
- focusTheme?: boolean | undefined;
34
- circular?: boolean | undefined;
35
- padded?: boolean | undefined;
36
- elevate?: boolean | undefined;
37
- bordered?: number | boolean | undefined;
38
- transparent?: boolean | undefined;
39
- chromeless?: boolean | undefined;
40
- }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
28
+ readonly fontFamily?: unknown;
29
+ readonly backgrounded?: boolean | undefined;
30
+ readonly radiused?: boolean | undefined;
31
+ readonly hoverTheme?: boolean | undefined;
32
+ readonly pressTheme?: boolean | undefined;
33
+ readonly focusTheme?: boolean | undefined;
34
+ readonly circular?: boolean | undefined;
35
+ readonly padded?: boolean | undefined;
36
+ readonly elevate?: boolean | undefined;
37
+ readonly bordered?: number | boolean | undefined;
38
+ readonly transparent?: boolean | undefined;
39
+ readonly chromeless?: boolean | "all" | undefined;
40
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
41
41
  readonly fullscreen?: boolean | undefined;
42
42
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
43
43
  }, "fontFamily" | "hoverTheme" | "pressTheme" | "focusTheme" | "circular" | "elevate" | "bordered" | "transparent" | "backgrounded" | "radiused" | "padded" | "chromeless"> & {
44
- fontFamily?: unknown;
45
- backgrounded?: boolean | undefined;
46
- radiused?: boolean | undefined;
47
- hoverTheme?: boolean | undefined;
48
- pressTheme?: boolean | undefined;
49
- focusTheme?: boolean | undefined;
50
- circular?: boolean | undefined;
51
- padded?: boolean | undefined;
52
- elevate?: boolean | undefined;
53
- bordered?: number | boolean | undefined;
54
- transparent?: boolean | undefined;
55
- chromeless?: boolean | undefined;
56
- }>>) | (Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
44
+ readonly fontFamily?: unknown;
45
+ readonly backgrounded?: boolean | undefined;
46
+ readonly radiused?: boolean | undefined;
47
+ readonly hoverTheme?: boolean | undefined;
48
+ readonly pressTheme?: boolean | undefined;
49
+ readonly focusTheme?: boolean | undefined;
50
+ readonly circular?: boolean | undefined;
51
+ readonly padded?: boolean | undefined;
52
+ readonly elevate?: boolean | undefined;
53
+ readonly bordered?: number | boolean | undefined;
54
+ readonly transparent?: boolean | undefined;
55
+ readonly chromeless?: boolean | "all" | undefined;
56
+ }>>) | (Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
57
57
  readonly fullscreen?: boolean | undefined;
58
58
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
59
59
  } & {
60
- fontFamily?: unknown;
61
- backgrounded?: boolean | undefined;
62
- radiused?: boolean | undefined;
63
- hoverTheme?: boolean | undefined;
64
- pressTheme?: boolean | undefined;
65
- focusTheme?: boolean | undefined;
66
- circular?: boolean | undefined;
67
- padded?: boolean | undefined;
68
- elevate?: boolean | undefined;
69
- bordered?: number | boolean | undefined;
70
- transparent?: boolean | undefined;
71
- chromeless?: boolean | undefined;
60
+ readonly fontFamily?: unknown;
61
+ readonly backgrounded?: boolean | undefined;
62
+ readonly radiused?: boolean | undefined;
63
+ readonly hoverTheme?: boolean | undefined;
64
+ readonly pressTheme?: boolean | undefined;
65
+ readonly focusTheme?: boolean | undefined;
66
+ readonly circular?: boolean | undefined;
67
+ readonly padded?: boolean | undefined;
68
+ readonly elevate?: boolean | undefined;
69
+ readonly bordered?: number | boolean | undefined;
70
+ readonly transparent?: boolean | undefined;
71
+ readonly chromeless?: boolean | "all" | undefined;
72
72
  }, string | number> & {
73
73
  [x: string]: undefined;
74
- } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
74
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
75
75
  readonly fullscreen?: boolean | undefined;
76
76
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
77
77
  } & {
78
- fontFamily?: unknown;
79
- backgrounded?: boolean | undefined;
80
- radiused?: boolean | undefined;
81
- hoverTheme?: boolean | undefined;
82
- pressTheme?: boolean | undefined;
83
- focusTheme?: boolean | undefined;
84
- circular?: boolean | undefined;
85
- padded?: boolean | undefined;
86
- elevate?: boolean | undefined;
87
- bordered?: number | boolean | undefined;
88
- transparent?: boolean | undefined;
89
- chromeless?: boolean | undefined;
78
+ readonly fontFamily?: unknown;
79
+ readonly backgrounded?: boolean | undefined;
80
+ readonly radiused?: boolean | undefined;
81
+ readonly hoverTheme?: boolean | undefined;
82
+ readonly pressTheme?: boolean | undefined;
83
+ readonly focusTheme?: boolean | undefined;
84
+ readonly circular?: boolean | undefined;
85
+ readonly padded?: boolean | undefined;
86
+ readonly elevate?: boolean | undefined;
87
+ readonly bordered?: number | boolean | undefined;
88
+ readonly transparent?: boolean | undefined;
89
+ readonly chromeless?: boolean | "all" | undefined;
90
90
  }, string | number> & {
91
91
  [x: string]: undefined;
92
- }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
92
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
93
93
  readonly fullscreen?: boolean | undefined;
94
94
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
95
95
  } & {
96
- fontFamily?: unknown;
97
- backgrounded?: boolean | undefined;
98
- radiused?: boolean | undefined;
99
- hoverTheme?: boolean | undefined;
100
- pressTheme?: boolean | undefined;
101
- focusTheme?: boolean | undefined;
102
- circular?: boolean | undefined;
103
- padded?: boolean | undefined;
104
- elevate?: boolean | undefined;
105
- bordered?: number | boolean | undefined;
106
- transparent?: boolean | undefined;
107
- chromeless?: boolean | undefined;
96
+ readonly fontFamily?: unknown;
97
+ readonly backgrounded?: boolean | undefined;
98
+ readonly radiused?: boolean | undefined;
99
+ readonly hoverTheme?: boolean | undefined;
100
+ readonly pressTheme?: boolean | undefined;
101
+ readonly focusTheme?: boolean | undefined;
102
+ readonly circular?: boolean | undefined;
103
+ readonly padded?: boolean | undefined;
104
+ readonly elevate?: boolean | undefined;
105
+ readonly bordered?: number | boolean | undefined;
106
+ readonly transparent?: boolean | undefined;
107
+ readonly chromeless?: boolean | "all" | undefined;
108
108
  }, string | number> & {
109
109
  [x: string]: undefined;
110
- }>>), any, import("@tamagui/core").StackPropsBase, {
110
+ }>>), import("@tamagui/core").TamaguiElement, import("@tamagui/core").StackPropsBase, {
111
111
  readonly fullscreen?: boolean | undefined;
112
112
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
113
113
  } & {
114
- fontFamily?: unknown;
115
- backgrounded?: boolean | undefined;
116
- radiused?: boolean | undefined;
117
- hoverTheme?: boolean | undefined;
118
- pressTheme?: boolean | undefined;
119
- focusTheme?: boolean | undefined;
120
- circular?: boolean | undefined;
121
- padded?: boolean | undefined;
122
- elevate?: boolean | undefined;
123
- bordered?: number | boolean | undefined;
124
- transparent?: boolean | undefined;
125
- chromeless?: boolean | undefined;
114
+ readonly fontFamily?: unknown;
115
+ readonly backgrounded?: boolean | undefined;
116
+ readonly radiused?: boolean | undefined;
117
+ readonly hoverTheme?: boolean | undefined;
118
+ readonly pressTheme?: boolean | undefined;
119
+ readonly focusTheme?: boolean | undefined;
120
+ readonly circular?: boolean | undefined;
121
+ readonly padded?: boolean | undefined;
122
+ readonly elevate?: boolean | undefined;
123
+ readonly bordered?: number | boolean | undefined;
124
+ readonly transparent?: boolean | undefined;
125
+ readonly chromeless?: boolean | "all" | undefined;
126
126
  } & ({} | {
127
127
  [x: string]: undefined;
128
128
  })>;
129
129
  declare const ProgressIndicator: React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<TamaguiElement>>;
130
130
  declare type TamaguiElement = HTMLElement | View;
131
- export declare const ProgressFrame: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
131
+ export declare const ProgressFrame: import("@tamagui/core").TamaguiComponent<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
132
132
  readonly fullscreen?: boolean | undefined;
133
133
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
134
134
  } & {
135
- fontFamily?: unknown;
136
- backgrounded?: boolean | undefined;
137
- radiused?: boolean | undefined;
138
- hoverTheme?: boolean | undefined;
139
- pressTheme?: boolean | undefined;
140
- focusTheme?: boolean | undefined;
141
- circular?: boolean | undefined;
142
- padded?: boolean | undefined;
143
- elevate?: boolean | undefined;
144
- bordered?: number | boolean | undefined;
145
- transparent?: boolean | undefined;
146
- chromeless?: boolean | undefined;
135
+ readonly fontFamily?: unknown;
136
+ readonly backgrounded?: boolean | undefined;
137
+ readonly radiused?: boolean | undefined;
138
+ readonly hoverTheme?: boolean | undefined;
139
+ readonly pressTheme?: boolean | undefined;
140
+ readonly focusTheme?: boolean | undefined;
141
+ readonly circular?: boolean | undefined;
142
+ readonly padded?: boolean | undefined;
143
+ readonly elevate?: boolean | undefined;
144
+ readonly bordered?: number | boolean | undefined;
145
+ readonly transparent?: boolean | undefined;
146
+ readonly chromeless?: boolean | "all" | undefined;
147
147
  }, "size"> & {
148
- size?: import("@tamagui/core").SizeTokens | undefined;
149
- } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
148
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
149
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
150
150
  readonly fullscreen?: boolean | undefined;
151
151
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
152
152
  } & {
153
- fontFamily?: unknown;
154
- backgrounded?: boolean | undefined;
155
- radiused?: boolean | undefined;
156
- hoverTheme?: boolean | undefined;
157
- pressTheme?: boolean | undefined;
158
- focusTheme?: boolean | undefined;
159
- circular?: boolean | undefined;
160
- padded?: boolean | undefined;
161
- elevate?: boolean | undefined;
162
- bordered?: number | boolean | undefined;
163
- transparent?: boolean | undefined;
164
- chromeless?: boolean | undefined;
153
+ readonly fontFamily?: unknown;
154
+ readonly backgrounded?: boolean | undefined;
155
+ readonly radiused?: boolean | undefined;
156
+ readonly hoverTheme?: boolean | undefined;
157
+ readonly pressTheme?: boolean | undefined;
158
+ readonly focusTheme?: boolean | undefined;
159
+ readonly circular?: boolean | undefined;
160
+ readonly padded?: boolean | undefined;
161
+ readonly elevate?: boolean | undefined;
162
+ readonly bordered?: number | boolean | undefined;
163
+ readonly transparent?: boolean | undefined;
164
+ readonly chromeless?: boolean | "all" | undefined;
165
165
  }, "size"> & {
166
- size?: import("@tamagui/core").SizeTokens | undefined;
167
- }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
166
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
167
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
168
168
  readonly fullscreen?: boolean | undefined;
169
169
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
170
170
  } & {
171
- fontFamily?: unknown;
172
- backgrounded?: boolean | undefined;
173
- radiused?: boolean | undefined;
174
- hoverTheme?: boolean | undefined;
175
- pressTheme?: boolean | undefined;
176
- focusTheme?: boolean | undefined;
177
- circular?: boolean | undefined;
178
- padded?: boolean | undefined;
179
- elevate?: boolean | undefined;
180
- bordered?: number | boolean | undefined;
181
- transparent?: boolean | undefined;
182
- chromeless?: boolean | undefined;
171
+ readonly fontFamily?: unknown;
172
+ readonly backgrounded?: boolean | undefined;
173
+ readonly radiused?: boolean | undefined;
174
+ readonly hoverTheme?: boolean | undefined;
175
+ readonly pressTheme?: boolean | undefined;
176
+ readonly focusTheme?: boolean | undefined;
177
+ readonly circular?: boolean | undefined;
178
+ readonly padded?: boolean | undefined;
179
+ readonly elevate?: boolean | undefined;
180
+ readonly bordered?: number | boolean | undefined;
181
+ readonly transparent?: boolean | undefined;
182
+ readonly chromeless?: boolean | "all" | undefined;
183
183
  }, "size"> & {
184
- size?: import("@tamagui/core").SizeTokens | undefined;
185
- }>>, any, import("@tamagui/core").StackPropsBase, {
184
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
185
+ }>>, import("@tamagui/core").TamaguiElement, import("@tamagui/core").StackPropsBase, {
186
186
  readonly fullscreen?: boolean | undefined;
187
187
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
188
188
  } & {
189
- fontFamily?: unknown;
190
- backgrounded?: boolean | undefined;
191
- radiused?: boolean | undefined;
192
- hoverTheme?: boolean | undefined;
193
- pressTheme?: boolean | undefined;
194
- focusTheme?: boolean | undefined;
195
- circular?: boolean | undefined;
196
- padded?: boolean | undefined;
197
- elevate?: boolean | undefined;
198
- bordered?: number | boolean | undefined;
199
- transparent?: boolean | undefined;
200
- chromeless?: boolean | undefined;
189
+ readonly fontFamily?: unknown;
190
+ readonly backgrounded?: boolean | undefined;
191
+ readonly radiused?: boolean | undefined;
192
+ readonly hoverTheme?: boolean | undefined;
193
+ readonly pressTheme?: boolean | undefined;
194
+ readonly focusTheme?: boolean | undefined;
195
+ readonly circular?: boolean | undefined;
196
+ readonly padded?: boolean | undefined;
197
+ readonly elevate?: boolean | undefined;
198
+ readonly bordered?: number | boolean | undefined;
199
+ readonly transparent?: boolean | undefined;
200
+ readonly chromeless?: boolean | "all" | undefined;
201
201
  } & {
202
- size?: import("@tamagui/core").SizeTokens | undefined;
202
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
203
203
  }>;
204
204
  declare type ProgressProps = GetProps<typeof ProgressFrame> & {
205
205
  value?: number | null | undefined;
206
206
  max?: number;
207
207
  getValueLabel?(value: number, max: number): string;
208
208
  };
209
- declare const Progress: React.ForwardRefExoticComponent<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
209
+ declare const Progress: React.ForwardRefExoticComponent<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
210
210
  readonly fullscreen?: boolean | undefined;
211
211
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
212
212
  } & {
213
- fontFamily?: unknown;
214
- backgrounded?: boolean | undefined;
215
- radiused?: boolean | undefined;
216
- hoverTheme?: boolean | undefined;
217
- pressTheme?: boolean | undefined;
218
- focusTheme?: boolean | undefined;
219
- circular?: boolean | undefined;
220
- padded?: boolean | undefined;
221
- elevate?: boolean | undefined;
222
- bordered?: number | boolean | undefined;
223
- transparent?: boolean | undefined;
224
- chromeless?: boolean | undefined;
213
+ readonly fontFamily?: unknown;
214
+ readonly backgrounded?: boolean | undefined;
215
+ readonly radiused?: boolean | undefined;
216
+ readonly hoverTheme?: boolean | undefined;
217
+ readonly pressTheme?: boolean | undefined;
218
+ readonly focusTheme?: boolean | undefined;
219
+ readonly circular?: boolean | undefined;
220
+ readonly padded?: boolean | undefined;
221
+ readonly elevate?: boolean | undefined;
222
+ readonly bordered?: number | boolean | undefined;
223
+ readonly transparent?: boolean | undefined;
224
+ readonly chromeless?: boolean | "all" | undefined;
225
225
  }, "size"> & {
226
- size?: import("@tamagui/core").SizeTokens | undefined;
227
- } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
226
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
227
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
228
228
  readonly fullscreen?: boolean | undefined;
229
229
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
230
230
  } & {
231
- fontFamily?: unknown;
232
- backgrounded?: boolean | undefined;
233
- radiused?: boolean | undefined;
234
- hoverTheme?: boolean | undefined;
235
- pressTheme?: boolean | undefined;
236
- focusTheme?: boolean | undefined;
237
- circular?: boolean | undefined;
238
- padded?: boolean | undefined;
239
- elevate?: boolean | undefined;
240
- bordered?: number | boolean | undefined;
241
- transparent?: boolean | undefined;
242
- chromeless?: boolean | undefined;
231
+ readonly fontFamily?: unknown;
232
+ readonly backgrounded?: boolean | undefined;
233
+ readonly radiused?: boolean | undefined;
234
+ readonly hoverTheme?: boolean | undefined;
235
+ readonly pressTheme?: boolean | undefined;
236
+ readonly focusTheme?: boolean | undefined;
237
+ readonly circular?: boolean | undefined;
238
+ readonly padded?: boolean | undefined;
239
+ readonly elevate?: boolean | undefined;
240
+ readonly bordered?: number | boolean | undefined;
241
+ readonly transparent?: boolean | undefined;
242
+ readonly chromeless?: boolean | "all" | undefined;
243
243
  }, "size"> & {
244
- size?: import("@tamagui/core").SizeTokens | undefined;
245
- }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
244
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
245
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
246
246
  readonly fullscreen?: boolean | undefined;
247
247
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
248
248
  } & {
249
- fontFamily?: unknown;
250
- backgrounded?: boolean | undefined;
251
- radiused?: boolean | undefined;
252
- hoverTheme?: boolean | undefined;
253
- pressTheme?: boolean | undefined;
254
- focusTheme?: boolean | undefined;
255
- circular?: boolean | undefined;
256
- padded?: boolean | undefined;
257
- elevate?: boolean | undefined;
258
- bordered?: number | boolean | undefined;
259
- transparent?: boolean | undefined;
260
- chromeless?: boolean | undefined;
249
+ readonly fontFamily?: unknown;
250
+ readonly backgrounded?: boolean | undefined;
251
+ readonly radiused?: boolean | undefined;
252
+ readonly hoverTheme?: boolean | undefined;
253
+ readonly pressTheme?: boolean | undefined;
254
+ readonly focusTheme?: boolean | undefined;
255
+ readonly circular?: boolean | undefined;
256
+ readonly padded?: boolean | undefined;
257
+ readonly elevate?: boolean | undefined;
258
+ readonly bordered?: number | boolean | undefined;
259
+ readonly transparent?: boolean | undefined;
260
+ readonly chromeless?: boolean | "all" | undefined;
261
261
  }, "size"> & {
262
- size?: import("@tamagui/core").SizeTokens | undefined;
262
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
263
263
  }>> & {
264
264
  value?: number | null | undefined;
265
265
  max?: number | undefined;
package/types/index.d.ts CHANGED
File without changes
@@ -1 +0,0 @@
1
- {"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../src/Progress.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAA2D,MAAM,eAAe,CAAA;AAEjG,OAAO,EAAkB,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAInC,QAAA,MAA8B,mBAAmB,+CAAqC,CAAA;AAYtF,UAAU,s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