@tamagui/progress 1.0.1-beta.159 → 1.0.1-beta.162
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.map +1 -1
- package/dist/esm/Progress.js.map +1 -1
- package/dist/jsx/Progress.js.map +1 -1
- package/package.json +6 -6
- package/src/Progress.tsx +1 -1
- package/types/Progress.d.ts +175 -175
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, 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"],
|
|
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"],
|
|
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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"],
|
|
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
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,CA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AA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,WAAW;AAAA,EACb;AACF;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;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/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, 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"],
|
|
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
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,QAAQ,GAAG,GACvD,YAAY,QAAQ,SAAS,QAC7B,UAAU,QAAQ,KAClB,GAAG,GACH,OAAO,QAAQ,WACX,gBACJ,KAAK,cACP;AAAA,IAEJ;AAAA,EACF;AACF;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AAO;AAAA,EACT;AACF;",
|
|
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.
|
|
3
|
+
"version": "1.0.1-beta.162",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"clean:build": "tamagui-build clean:build"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tamagui/compose-refs": "^1.0.1-beta.
|
|
27
|
-
"@tamagui/core": "^1.0.1-beta.
|
|
28
|
-
"@tamagui/create-context": "^1.0.1-beta.
|
|
29
|
-
"@tamagui/stacks": "^1.0.1-beta.
|
|
26
|
+
"@tamagui/compose-refs": "^1.0.1-beta.162",
|
|
27
|
+
"@tamagui/core": "^1.0.1-beta.162",
|
|
28
|
+
"@tamagui/create-context": "^1.0.1-beta.162",
|
|
29
|
+
"@tamagui/stacks": "^1.0.1-beta.162"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "*",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"react-native": "*"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
37
|
+
"@tamagui/build": "^1.0.1-beta.162",
|
|
38
38
|
"@types/react-native": "^0.69.2",
|
|
39
39
|
"react": "*",
|
|
40
40
|
"react-dom": "*",
|
package/src/Progress.tsx
CHANGED
package/types/Progress.d.ts
CHANGED
|
@@ -9,120 +9,120 @@ export declare const ProgressIndicatorFrame: import("@tamagui/core").TamaguiComp
|
|
|
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 | "all" | undefined;
|
|
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
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<{
|
|
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 | "all" | undefined;
|
|
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
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<{
|
|
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 | "all" | undefined;
|
|
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
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<{
|
|
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 | "all" | 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
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<{
|
|
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 | "all" | 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
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<{
|
|
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 | "all" | 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
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 | "all" | 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
|
})>;
|
|
@@ -132,74 +132,74 @@ export declare const ProgressFrame: import("@tamagui/core").TamaguiComponent<Omi
|
|
|
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 | "all" | 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;
|
|
148
|
+
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
149
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<{
|
|
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 | "all" | 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;
|
|
166
|
+
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
167
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<{
|
|
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 | "all" | 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;
|
|
184
|
+
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
185
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 | "all" | 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;
|
|
@@ -210,56 +210,56 @@ declare const Progress: React.ForwardRefExoticComponent<Omit<import("react-nativ
|
|
|
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 | "all" | 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;
|
|
226
|
+
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
227
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<{
|
|
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 | "all" | 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;
|
|
244
|
+
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
245
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<{
|
|
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 | "all" | 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;
|