@tamagui/progress 1.0.1-beta.41 → 1.0.1-beta.44
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.
- package/dist/cjs/Progress.js +3 -1
- package/dist/cjs/Progress.js.map +2 -2
- package/dist/esm/Progress.js +3 -1
- package/dist/esm/Progress.js.map +2 -2
- package/dist/jsx/Progress.js +3 -1
- package/package.json +6 -6
- package/types/Progress.d.ts +50 -30
- package/types/Progress.d.ts.map +1 -1
package/dist/cjs/Progress.js
CHANGED
|
@@ -68,7 +68,8 @@ const INDICATOR_NAME = "ProgressIndicator";
|
|
|
68
68
|
const ProgressIndicatorFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
69
69
|
name: INDICATOR_NAME,
|
|
70
70
|
height: "100%",
|
|
71
|
-
width: "100%"
|
|
71
|
+
width: "100%",
|
|
72
|
+
backgrounded: true
|
|
72
73
|
});
|
|
73
74
|
const ProgressIndicator = ProgressIndicatorFrame.extractable(React.forwardRef((props, forwardedRef) => {
|
|
74
75
|
const _a = props, { __scopeProgress } = _a, indicatorProps = __objRest(_a, ["__scopeProgress"]);
|
|
@@ -122,6 +123,7 @@ const ProgressFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
|
122
123
|
name: PROGRESS_NAME,
|
|
123
124
|
borderRadius: 1e5,
|
|
124
125
|
overflow: "hidden",
|
|
126
|
+
backgrounded: true,
|
|
125
127
|
variants: {
|
|
126
128
|
size: {
|
|
127
129
|
"...size": (val, extras) => {
|
package/dist/cjs/Progress.js.map
CHANGED
|
@@ -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, styled, withStaticProperties } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, YStackProps, getCircleSize } 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 }\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\nconst ProgressIndicatorFrame = styled(ThemeableStack, {\n name: INDICATOR_NAME,\n height: '100%',\n width: '100%',\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 progress = context.max - (context.value ?? 0)\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={`${-progress}%`}\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\nconst ProgressFrame = styled(ThemeableStack, {\n name: PROGRESS_NAME,\n borderRadius: 100_000,\n overflow: 'hidden',\n\n variants: {\n size: {\n '...size': (val, extras) => {\n const circleSize = getCircleSize(val, extras)\n const size = circleSize / 3\n return {\n height: size,\n width: size * 20,\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\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max}>\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 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\nconst Root = Progress\nconst Indicator = ProgressIndicator\n\nexport {\n createProgressScope,\n //\n Progress,\n ProgressIndicator,\n //\n Root,\n Indicator,\n}\nexport type { ProgressProps, ProgressIndicatorProps }\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuD;AACvD,4BAA0C;AAC1C,oBAA2D;AAC3D,YAAuB;AAGvB,MAAM,gBAAgB;AAEtB,MAAM,CAAC,uBAAuB,uBAAuB,8CAAmB,aAAa;AAErF,MAAM,CAAC,kBAAkB,sBACvB,sBAA4C,aAAa;AAM3D,MAAM,iBAAiB;AAKvB,MAAM,yBAAyB,wBAAO,8BAAgB;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;
|
|
4
|
+
"sourcesContent": ["// forked from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/react/progress/src/Progress.tsx\n\nimport { GetProps, styled, withStaticProperties } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, YStackProps, getCircleSize } 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 }\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\nconst 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 progress = context.max - (context.value ?? 0)\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={`${-progress}%`}\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\nconst 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, extras) => {\n const circleSize = getCircleSize(val, extras)\n const size = circleSize / 3\n return {\n height: size,\n width: size * 20,\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\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max}>\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 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\nconst Root = Progress\nconst Indicator = ProgressIndicator\n\nexport {\n createProgressScope,\n //\n Progress,\n ProgressIndicator,\n //\n Root,\n Indicator,\n}\nexport type { ProgressProps, ProgressIndicatorProps }\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuD;AACvD,4BAA0C;AAC1C,oBAA2D;AAC3D,YAAuB;AAGvB,MAAM,gBAAgB;AAEtB,MAAM,CAAC,uBAAuB,uBAAuB,8CAAmB,aAAa;AAErF,MAAM,CAAC,kBAAkB,sBACvB,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I,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;AAEA,MAAM,OAAO;AACb,MAAM,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/Progress.js
CHANGED
|
@@ -11,7 +11,8 @@ const INDICATOR_NAME = "ProgressIndicator";
|
|
|
11
11
|
const ProgressIndicatorFrame = styled(ThemeableStack, {
|
|
12
12
|
name: INDICATOR_NAME,
|
|
13
13
|
height: "100%",
|
|
14
|
-
width: "100%"
|
|
14
|
+
width: "100%",
|
|
15
|
+
backgrounded: true
|
|
15
16
|
});
|
|
16
17
|
const ProgressIndicator = ProgressIndicatorFrame.extractable(React.forwardRef((props, forwardedRef) => {
|
|
17
18
|
var _a, _b;
|
|
@@ -66,6 +67,7 @@ const ProgressFrame = styled(ThemeableStack, {
|
|
|
66
67
|
name: PROGRESS_NAME,
|
|
67
68
|
borderRadius: 1e5,
|
|
68
69
|
overflow: "hidden",
|
|
70
|
+
backgrounded: true,
|
|
69
71
|
variants: {
|
|
70
72
|
size: {
|
|
71
73
|
"...size": (val, extras) => {
|
package/dist/esm/Progress.js.map
CHANGED
|
@@ -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, styled, withStaticProperties } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, YStackProps, getCircleSize } 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 }\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\nconst ProgressIndicatorFrame = styled(ThemeableStack, {\n name: INDICATOR_NAME,\n height: '100%',\n width: '100%',\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 progress = context.max - (context.value ?? 0)\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={`${-progress}%`}\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\nconst ProgressFrame = styled(ThemeableStack, {\n name: PROGRESS_NAME,\n borderRadius: 100_000,\n overflow: 'hidden',\n\n variants: {\n size: {\n '...size': (val, extras) => {\n const circleSize = getCircleSize(val, extras)\n const size = circleSize / 3\n return {\n height: size,\n width: size * 20,\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\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max}>\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 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\nconst Root = Progress\nconst Indicator = ProgressIndicator\n\nexport {\n createProgressScope,\n //\n Progress,\n ProgressIndicator,\n //\n Root,\n Indicator,\n}\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;AAKvB,MAAM,yBAAyB,OAAO,gBAAgB;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;
|
|
4
|
+
"sourcesContent": ["// forked from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/react/progress/src/Progress.tsx\n\nimport { GetProps, styled, withStaticProperties } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, YStackProps, getCircleSize } 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 }\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\nconst 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 progress = context.max - (context.value ?? 0)\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={`${-progress}%`}\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\nconst 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, extras) => {\n const circleSize = getCircleSize(val, extras)\n const size = circleSize / 3\n return {\n height: size,\n width: size * 20,\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\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max}>\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 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\nconst Root = Progress\nconst Indicator = ProgressIndicator\n\nexport {\n createProgressScope,\n //\n Progress,\n ProgressIndicator,\n //\n Root,\n Indicator,\n}\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;AAKvB,MAAM,yBAAyB,OAAO,gBAAgB;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO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A,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;AAEA,MAAM,OAAO;AACb,MAAM,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/Progress.js
CHANGED
|
@@ -11,7 +11,8 @@ const INDICATOR_NAME = "ProgressIndicator";
|
|
|
11
11
|
const ProgressIndicatorFrame = styled(ThemeableStack, {
|
|
12
12
|
name: INDICATOR_NAME,
|
|
13
13
|
height: "100%",
|
|
14
|
-
width: "100%"
|
|
14
|
+
width: "100%",
|
|
15
|
+
backgrounded: true
|
|
15
16
|
});
|
|
16
17
|
const ProgressIndicator = ProgressIndicatorFrame.extractable(React.forwardRef((props, forwardedRef) => {
|
|
17
18
|
var _a, _b;
|
|
@@ -59,6 +60,7 @@ const ProgressFrame = styled(ThemeableStack, {
|
|
|
59
60
|
name: PROGRESS_NAME,
|
|
60
61
|
borderRadius: 1e5,
|
|
61
62
|
overflow: "hidden",
|
|
63
|
+
backgrounded: true,
|
|
62
64
|
variants: {
|
|
63
65
|
size: {
|
|
64
66
|
"...size": (val, extras) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/progress",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.44",
|
|
4
4
|
"sideEffects": true,
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tamagui/compose-refs": "^1.0.1-beta.
|
|
22
|
-
"@tamagui/core": "^1.0.1-beta.
|
|
23
|
-
"@tamagui/create-context": "^1.0.1-beta.
|
|
24
|
-
"@tamagui/stacks": "^1.0.1-beta.
|
|
21
|
+
"@tamagui/compose-refs": "^1.0.1-beta.44",
|
|
22
|
+
"@tamagui/core": "^1.0.1-beta.44",
|
|
23
|
+
"@tamagui/create-context": "^1.0.1-beta.44",
|
|
24
|
+
"@tamagui/stacks": "^1.0.1-beta.44"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "*",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"react-native": "*"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
32
|
+
"@tamagui/build": "^1.0.1-beta.44",
|
|
33
33
|
"@types/react-native": "^0.67.3",
|
|
34
34
|
"react": "*",
|
|
35
35
|
"react-dom": "*",
|
package/types/Progress.d.ts
CHANGED
|
@@ -8,15 +8,17 @@ interface ProgressIndicatorProps extends YStackProps {
|
|
|
8
8
|
declare const ProgressIndicator: React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<TamaguiElement>>;
|
|
9
9
|
declare type TamaguiElement = HTMLElement | View;
|
|
10
10
|
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<{
|
|
11
|
-
fullscreen?: boolean | undefined;
|
|
12
|
-
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
11
|
+
readonly fullscreen?: boolean | undefined;
|
|
12
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
13
13
|
} & {
|
|
14
14
|
fontFamily?: unknown;
|
|
15
|
+
backgrounded?: boolean | undefined;
|
|
16
|
+
radiused?: boolean | undefined;
|
|
15
17
|
hoverable?: boolean | undefined;
|
|
16
18
|
pressable?: boolean | undefined;
|
|
17
19
|
focusable?: boolean | undefined;
|
|
18
20
|
circular?: boolean | undefined;
|
|
19
|
-
|
|
21
|
+
padded?: boolean | undefined;
|
|
20
22
|
elevate?: boolean | undefined;
|
|
21
23
|
bordered?: number | boolean | undefined;
|
|
22
24
|
transparent?: boolean | undefined;
|
|
@@ -24,15 +26,17 @@ declare const ProgressFrame: import("@tamagui/core").TamaguiComponent<Omit<impor
|
|
|
24
26
|
}, "size"> & {
|
|
25
27
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
26
28
|
} & 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<{
|
|
27
|
-
fullscreen?: boolean | undefined;
|
|
28
|
-
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
29
|
+
readonly fullscreen?: boolean | undefined;
|
|
30
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
29
31
|
} & {
|
|
30
32
|
fontFamily?: unknown;
|
|
33
|
+
backgrounded?: boolean | undefined;
|
|
34
|
+
radiused?: boolean | undefined;
|
|
31
35
|
hoverable?: boolean | undefined;
|
|
32
36
|
pressable?: boolean | undefined;
|
|
33
37
|
focusable?: boolean | undefined;
|
|
34
38
|
circular?: boolean | undefined;
|
|
35
|
-
|
|
39
|
+
padded?: boolean | undefined;
|
|
36
40
|
elevate?: boolean | undefined;
|
|
37
41
|
bordered?: number | boolean | undefined;
|
|
38
42
|
transparent?: boolean | undefined;
|
|
@@ -40,15 +44,17 @@ declare const ProgressFrame: import("@tamagui/core").TamaguiComponent<Omit<impor
|
|
|
40
44
|
}, "size"> & {
|
|
41
45
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
42
46
|
}>> & 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<{
|
|
43
|
-
fullscreen?: boolean | undefined;
|
|
44
|
-
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
47
|
+
readonly fullscreen?: boolean | undefined;
|
|
48
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
45
49
|
} & {
|
|
46
50
|
fontFamily?: unknown;
|
|
51
|
+
backgrounded?: boolean | undefined;
|
|
52
|
+
radiused?: boolean | undefined;
|
|
47
53
|
hoverable?: boolean | undefined;
|
|
48
54
|
pressable?: boolean | undefined;
|
|
49
55
|
focusable?: boolean | undefined;
|
|
50
56
|
circular?: boolean | undefined;
|
|
51
|
-
|
|
57
|
+
padded?: boolean | undefined;
|
|
52
58
|
elevate?: boolean | undefined;
|
|
53
59
|
bordered?: number | boolean | undefined;
|
|
54
60
|
transparent?: boolean | undefined;
|
|
@@ -56,15 +62,17 @@ declare const ProgressFrame: import("@tamagui/core").TamaguiComponent<Omit<impor
|
|
|
56
62
|
}, "size"> & {
|
|
57
63
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
58
64
|
}>>, any, import("@tamagui/core").StackPropsBase, {
|
|
59
|
-
fullscreen?: boolean | undefined;
|
|
60
|
-
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
65
|
+
readonly fullscreen?: boolean | undefined;
|
|
66
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
61
67
|
} & {
|
|
62
68
|
fontFamily?: unknown;
|
|
69
|
+
backgrounded?: boolean | undefined;
|
|
70
|
+
radiused?: boolean | undefined;
|
|
63
71
|
hoverable?: boolean | undefined;
|
|
64
72
|
pressable?: boolean | undefined;
|
|
65
73
|
focusable?: boolean | undefined;
|
|
66
74
|
circular?: boolean | undefined;
|
|
67
|
-
|
|
75
|
+
padded?: boolean | undefined;
|
|
68
76
|
elevate?: boolean | undefined;
|
|
69
77
|
bordered?: number | boolean | undefined;
|
|
70
78
|
transparent?: boolean | undefined;
|
|
@@ -78,15 +86,17 @@ declare type ProgressProps = GetProps<typeof ProgressFrame> & {
|
|
|
78
86
|
getValueLabel?(value: number, max: number): string;
|
|
79
87
|
};
|
|
80
88
|
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<{
|
|
81
|
-
fullscreen?: boolean | undefined;
|
|
82
|
-
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
89
|
+
readonly fullscreen?: boolean | undefined;
|
|
90
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
83
91
|
} & {
|
|
84
92
|
fontFamily?: unknown;
|
|
93
|
+
backgrounded?: boolean | undefined;
|
|
94
|
+
radiused?: boolean | undefined;
|
|
85
95
|
hoverable?: boolean | undefined;
|
|
86
96
|
pressable?: boolean | undefined;
|
|
87
97
|
focusable?: boolean | undefined;
|
|
88
98
|
circular?: boolean | undefined;
|
|
89
|
-
|
|
99
|
+
padded?: boolean | undefined;
|
|
90
100
|
elevate?: boolean | undefined;
|
|
91
101
|
bordered?: number | boolean | undefined;
|
|
92
102
|
transparent?: boolean | undefined;
|
|
@@ -94,15 +104,17 @@ declare const Progress: React.ForwardRefExoticComponent<Omit<import("react-nativ
|
|
|
94
104
|
}, "size"> & {
|
|
95
105
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
96
106
|
} & 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<{
|
|
97
|
-
fullscreen?: boolean | undefined;
|
|
98
|
-
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
107
|
+
readonly fullscreen?: boolean | undefined;
|
|
108
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
99
109
|
} & {
|
|
100
110
|
fontFamily?: unknown;
|
|
111
|
+
backgrounded?: boolean | undefined;
|
|
112
|
+
radiused?: boolean | undefined;
|
|
101
113
|
hoverable?: boolean | undefined;
|
|
102
114
|
pressable?: boolean | undefined;
|
|
103
115
|
focusable?: boolean | undefined;
|
|
104
116
|
circular?: boolean | undefined;
|
|
105
|
-
|
|
117
|
+
padded?: boolean | undefined;
|
|
106
118
|
elevate?: boolean | undefined;
|
|
107
119
|
bordered?: number | boolean | undefined;
|
|
108
120
|
transparent?: boolean | undefined;
|
|
@@ -110,15 +122,17 @@ declare const Progress: React.ForwardRefExoticComponent<Omit<import("react-nativ
|
|
|
110
122
|
}, "size"> & {
|
|
111
123
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
112
124
|
}>> & 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<{
|
|
113
|
-
fullscreen?: boolean | undefined;
|
|
114
|
-
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
125
|
+
readonly fullscreen?: boolean | undefined;
|
|
126
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
115
127
|
} & {
|
|
116
128
|
fontFamily?: unknown;
|
|
129
|
+
backgrounded?: boolean | undefined;
|
|
130
|
+
radiused?: boolean | undefined;
|
|
117
131
|
hoverable?: boolean | undefined;
|
|
118
132
|
pressable?: boolean | undefined;
|
|
119
133
|
focusable?: boolean | undefined;
|
|
120
134
|
circular?: boolean | undefined;
|
|
121
|
-
|
|
135
|
+
padded?: boolean | undefined;
|
|
122
136
|
elevate?: boolean | undefined;
|
|
123
137
|
bordered?: number | boolean | undefined;
|
|
124
138
|
transparent?: boolean | undefined;
|
|
@@ -133,15 +147,17 @@ declare const Progress: React.ForwardRefExoticComponent<Omit<import("react-nativ
|
|
|
133
147
|
Indicator: React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<TamaguiElement>>;
|
|
134
148
|
};
|
|
135
149
|
declare const Root: 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<{
|
|
136
|
-
fullscreen?: boolean | undefined;
|
|
137
|
-
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
150
|
+
readonly fullscreen?: boolean | undefined;
|
|
151
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
138
152
|
} & {
|
|
139
153
|
fontFamily?: unknown;
|
|
154
|
+
backgrounded?: boolean | undefined;
|
|
155
|
+
radiused?: boolean | undefined;
|
|
140
156
|
hoverable?: boolean | undefined;
|
|
141
157
|
pressable?: boolean | undefined;
|
|
142
158
|
focusable?: boolean | undefined;
|
|
143
159
|
circular?: boolean | undefined;
|
|
144
|
-
|
|
160
|
+
padded?: boolean | undefined;
|
|
145
161
|
elevate?: boolean | undefined;
|
|
146
162
|
bordered?: number | boolean | undefined;
|
|
147
163
|
transparent?: boolean | undefined;
|
|
@@ -149,15 +165,17 @@ declare const Root: React.ForwardRefExoticComponent<Omit<import("react-native").
|
|
|
149
165
|
}, "size"> & {
|
|
150
166
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
151
167
|
} & 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<{
|
|
152
|
-
fullscreen?: boolean | undefined;
|
|
153
|
-
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
168
|
+
readonly fullscreen?: boolean | undefined;
|
|
169
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
154
170
|
} & {
|
|
155
171
|
fontFamily?: unknown;
|
|
172
|
+
backgrounded?: boolean | undefined;
|
|
173
|
+
radiused?: boolean | undefined;
|
|
156
174
|
hoverable?: boolean | undefined;
|
|
157
175
|
pressable?: boolean | undefined;
|
|
158
176
|
focusable?: boolean | undefined;
|
|
159
177
|
circular?: boolean | undefined;
|
|
160
|
-
|
|
178
|
+
padded?: boolean | undefined;
|
|
161
179
|
elevate?: boolean | undefined;
|
|
162
180
|
bordered?: number | boolean | undefined;
|
|
163
181
|
transparent?: boolean | undefined;
|
|
@@ -165,15 +183,17 @@ declare const Root: React.ForwardRefExoticComponent<Omit<import("react-native").
|
|
|
165
183
|
}, "size"> & {
|
|
166
184
|
size?: import("@tamagui/core").SizeTokens | undefined;
|
|
167
185
|
}>> & 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<{
|
|
168
|
-
fullscreen?: boolean | undefined;
|
|
169
|
-
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
186
|
+
readonly fullscreen?: boolean | undefined;
|
|
187
|
+
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
170
188
|
} & {
|
|
171
189
|
fontFamily?: unknown;
|
|
190
|
+
backgrounded?: boolean | undefined;
|
|
191
|
+
radiused?: boolean | undefined;
|
|
172
192
|
hoverable?: boolean | undefined;
|
|
173
193
|
pressable?: boolean | undefined;
|
|
174
194
|
focusable?: boolean | undefined;
|
|
175
195
|
circular?: boolean | undefined;
|
|
176
|
-
|
|
196
|
+
padded?: boolean | undefined;
|
|
177
197
|
elevate?: boolean | undefined;
|
|
178
198
|
bordered?: number | boolean | undefined;
|
|
179
199
|
transparent?: boolean | undefined;
|
package/types/Progress.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../src/Progress.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAgC,MAAM,eAAe,CAAA;AAEtE,OAAO,EAAkB,WAAW,EAAiB,MAAM,iBAAiB,CAAA;AAC5E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAInC,QAAA,MAA8B,mBAAmB,+CAAqC,CAAA;AAYtF,UAAU,sBAAuB,SAAQ,WAAW;CAAG;
|
|
1
|
+
{"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../src/Progress.tsx"],"names":[],"mappings":"AAGA,OAA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