@radix-ui/react-progress 0.1.5-rc.9 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"mappings":";;;AAeA,OAAA,0FAAsF,CAAC;AAQvF,yBAAyB,MAAM,wBAAwB,CAAC,OAAO,UAAU,GAAG,CAAC,CAAC;AAC9E,8BAAwB,SAAQ,iBAAiB;IAC/C,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACpD;AAED,OAAA,MAAM,8FA+BL,CAAC;AA+BF,uCAAiC,SAAQ,iBAAiB;CAAG;AAE7D,OAAA,MAAM,gHAcL,CAAC;AAmDF,OAAA,MAAM,0FAAe,CAAC;AACtB,OAAA,MAAM,wGAA6B,CAAC","sources":["packages/react/progress/src/packages/react/progress/src/Progress.tsx","packages/react/progress/src/packages/react/progress/src/index.ts","packages/react/progress/src/index.ts"],"sourcesContent":[null,null,"export * from './Progress';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
1
+ {"mappings":";;;AAeA,OAAA,0FAAsF,CAAC;AAQvF,yBAAyB,MAAM,wBAAwB,CAAC,OAAO,UAAU,GAAG,CAAC,CAAC;AAC9E,8BAAwB,SAAQ,iBAAiB;IAC/C,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACpD;AAED,OAAA,MAAM,8FA+BL,CAAC;AA+BF,uCAAiC,SAAQ,iBAAiB;CAAG;AAE7D,OAAA,MAAM,gHAcL,CAAC;AAmDF,OAAA,MAAM,0FAAe,CAAC;AACtB,OAAA,MAAM,wGAA6B,CAAC","sources":["packages/react/progress/src/packages/react/progress/src/Progress.tsx","packages/react/progress/src/packages/react/progress/src/index.ts","packages/react/progress/src/index.ts"],"sourcesContent":[null,null,"export {\n createProgressScope,\n //\n Progress,\n ProgressIndicator,\n //\n Root,\n Indicator,\n} from './Progress';\nexport type { ProgressProps, ProgressIndicatorProps } from './Progress';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
package/dist/index.js CHANGED
@@ -3,35 +3,18 @@ var $1DGzP$react = require("react");
3
3
  var $1DGzP$radixuireactcontext = require("@radix-ui/react-context");
4
4
  var $1DGzP$radixuireactprimitive = require("@radix-ui/react-primitive");
5
5
 
6
- function $parcel$exportWildcard(dest, source) {
7
- Object.keys(source).forEach(function(key) {
8
- if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
9
- return;
10
- }
11
-
12
- Object.defineProperty(dest, key, {
13
- enumerable: true,
14
- get: function get() {
15
- return source[key];
16
- }
17
- });
18
- });
19
-
20
- return dest;
6
+ function $parcel$export(e, n, v, s) {
7
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
21
8
  }
22
9
  function $parcel$interopDefault(a) {
23
10
  return a && a.__esModule ? a.default : a;
24
11
  }
25
- function $parcel$export(e, n, v, s) {
26
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
27
- }
28
- var $66e9ff9cece0fdb5$exports = {};
29
12
 
30
- $parcel$export($66e9ff9cece0fdb5$exports, "createProgressScope", () => $66e9ff9cece0fdb5$export$388eb2d8f6d3261f);
31
- $parcel$export($66e9ff9cece0fdb5$exports, "Progress", () => $66e9ff9cece0fdb5$export$b25a304ec7d746bb);
32
- $parcel$export($66e9ff9cece0fdb5$exports, "ProgressIndicator", () => $66e9ff9cece0fdb5$export$2b776f7e7ee60dbd);
33
- $parcel$export($66e9ff9cece0fdb5$exports, "Root", () => $66e9ff9cece0fdb5$export$be92b6f5f03c0fe9);
34
- $parcel$export($66e9ff9cece0fdb5$exports, "Indicator", () => $66e9ff9cece0fdb5$export$adb584737d712b70);
13
+ $parcel$export(module.exports, "createProgressScope", () => $66e9ff9cece0fdb5$export$388eb2d8f6d3261f);
14
+ $parcel$export(module.exports, "Progress", () => $66e9ff9cece0fdb5$export$b25a304ec7d746bb);
15
+ $parcel$export(module.exports, "ProgressIndicator", () => $66e9ff9cece0fdb5$export$2b776f7e7ee60dbd);
16
+ $parcel$export(module.exports, "Root", () => $66e9ff9cece0fdb5$export$be92b6f5f03c0fe9);
17
+ $parcel$export(module.exports, "Indicator", () => $66e9ff9cece0fdb5$export$adb584737d712b70);
35
18
 
36
19
 
37
20
 
@@ -132,7 +115,6 @@ const $66e9ff9cece0fdb5$export$be92b6f5f03c0fe9 = $66e9ff9cece0fdb5$export$b25a3
132
115
  const $66e9ff9cece0fdb5$export$adb584737d712b70 = $66e9ff9cece0fdb5$export$2b776f7e7ee60dbd;
133
116
 
134
117
 
135
- $parcel$exportWildcard(module.exports, $66e9ff9cece0fdb5$exports);
136
118
 
137
119
 
138
120
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;ACOA;;oGAEA,CAEA,MAAMG,mCAAa,GAAG,UAAtB,AAAA;AACA,MAAMC,iCAAW,GAAG,GAApB,AAAA;AAGA,MAAM,CAACC,2CAAD,EAAwBC,yCAAxB,CAAA,GAA+CL,6CAAkB,CAACE,mCAAD,CAAvE,AAAA;AAIA,MAAM,CAACI,sCAAD,EAAmBC,wCAAnB,CAAA,GACJH,2CAAqB,CAAuBF,mCAAvB,CADvB,AAAA;AAWA,MAAMM,yCAAQ,GAAA,aAAGT,CAAAA,uBAAA,CACf,CAACW,KAAD,EAAoCC,YAApC,GAAqD;IACnD,MAAM,E,iBACJC,eADI,CAAA,EAEJC,KAAK,EAAEC,SAFH,CAAA,EAGJC,GAAG,EAAEC,OAHD,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K,CAAC7B,KAAD,CADN,IAEAA,KAAK,IAAIE,GAFT,IAGAF,KAAK,IAAI,CAJX,CAAA;C,CAQF,+DAFC;AAGD,SAASoB,wCAAT,CAA4BJ,SAA5B,EAA+CD,aAA/C,EAAsE;IACpE,OAAQ,CAAA,gCAAA,EAAkCC,SAAU,CAAA,iBAAA,EAAmBD,aAAc,CAAA,sEAAA,EAAwEzB,iCAAY,CAAA,GAAA,CAAzK,CAAA;CACD;AAED,SAAS+B,0CAAT,CAA8BL,SAA9B,EAAiDD,aAAjD,EAAwE;IACtE,OAAQ,CAAA,kCAAA,EAAoCC,SAAU,CAAA,iBAAA,EAAmBD,aAAc,CAAvF;;8CAEF,EAAgDzB,iCAAY,CAA5D;;;uBAGA,CALE,CAKF;CACC;AAED,MAAMwC,yCAAI,GAAGnC,yCAAb,AAAA;AACA,MAAMoC,yCAAS,GAAGR,yCAAlB,AAAA;;ADhKA","sources":["packages/react/progress/src/index.ts","packages/react/progress/src/Progress.tsx"],"sourcesContent":["export * from './Progress';\n","import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst PROGRESS_NAME = 'Progress';\nconst DEFAULT_MAX = 100;\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope };\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading';\ntype ProgressContextValue = { value: number | null; max: number };\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME);\n\ntype ProgressElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface ProgressProps extends PrimitiveDivProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?(value: number, max: number): string;\n}\n\nconst Progress = React.forwardRef<ProgressElement, ProgressProps>(\n (props: ScopedProps<ProgressProps>, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\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 <Primitive.div\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\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\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\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator';\n\ntype ProgressIndicatorElement = React.ElementRef<typeof Primitive.div>;\ninterface ProgressIndicatorProps extends PrimitiveDivProps {}\n\nconst ProgressIndicator = React.forwardRef<ProgressIndicatorElement, ProgressIndicatorProps>(\n (props: ScopedProps<ProgressIndicatorProps>, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return (\n <Primitive.div\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n {...indicatorProps}\n ref={forwardedRef}\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\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"],"names":["React","createContextScope","Primitive","PROGRESS_NAME","DEFAULT_MAX","createProgressContext","createProgressScope","ProgressProvider","useProgressContext","Progress","forwardRef","props","forwardedRef","__scopeProgress","value","valueProp","max","maxProp","getValueLabel","defaultGetValueLabel","progressProps","isValidMaxNumber","isValidValueNumber","valueLabel","isNumber","undefined","getProgressState","propTypes","propName","componentName","propValue","strVal","String","Error","getInvalidMaxError","getInvalidValueError","INDICATOR_NAME","ProgressIndicator","indicatorProps","context","Math","round","maxValue","isNaN","Root","Indicator"],"version":3,"file":"index.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;A;;;;ACOA;;oGAEA,CAEA,MAAMQ,mCAAa,GAAG,UAAtB,AAAA;AACA,MAAMC,iCAAW,GAAG,GAApB,AAAA;AAGA,MAAM,CAACC,2CAAD,EAAwBV,yCAAxB,CAAA,GAA+CM,6CAAkB,CAACE,mCAAD,CAAvE,AAAA;AAIA,MAAM,CAACG,sCAAD,EAAmBC,wCAAnB,CAAA,GACJF,2CAAqB,CAAuBF,mCAAvB,CADvB,AAAA;AAWA,MAAMP,yCAAQ,GAAA,aAAGI,CAAAA,uBAAA,CACf,CAACS,KAAD,EAAoCC,YAApC,GAAqD;IACnD,MAAM,E,iBACJC,eADI,CAAA,EAEJC,KAAK,EAAEC,SAFH,CAAA,EAGJC,GAAG,EAAEC,OAHD,CAAA,iBAIJC,aAAa,GAAGC,0CAJZ,GAKJ,GAAGC,aAAH,EALI,GAMFT,KANJ,AAAM;IAQN,MAAMK,GAAG,GAAGK,sCAAgB,CAACJ,OAAD,CAAhB,GAA4BA,OAA5B,GAAsCX,iCAAlD,AAAA;IACA,MAAMQ,KAAK,GAAGQ,wCAAkB,CAACP,SAAD,EAAYC,GAAZ,CAAlB,GAAqCD,SAArC,GAAiD,IAA/D,AAAA;IACA,MAAMQ,UAAU,GAAGC,8BAAQ,CAACV,KAAD,CAAR,GAAkBI,aAAa,CAACJ,KAAD,EAAQE,GAAR,CAA/B,GAA8CS,SAAjE,AAAA;IAEA,OAAA,aACE,CAAA,0BAAA,CAAC,sCAAD,EADF;QACoB,KAAK,EAAEZ,eAAzB;QAA0C,KAAK,EAAEC,KAAjD;QAAwD,GAAG,EAA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,MAAMG,yCAAS,GAAGF,yCAAlB,AAAA;;ADhKA","sources":["packages/react/progress/src/index.ts","packages/react/progress/src/Progress.tsx"],"sourcesContent":["export {\n createProgressScope,\n //\n Progress,\n ProgressIndicator,\n //\n Root,\n Indicator,\n} from './Progress';\nexport type { ProgressProps, ProgressIndicatorProps } from './Progress';\n","import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst PROGRESS_NAME = 'Progress';\nconst DEFAULT_MAX = 100;\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope };\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading';\ntype ProgressContextValue = { value: number | null; max: number };\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME);\n\ntype ProgressElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface ProgressProps extends PrimitiveDivProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?(value: number, max: number): string;\n}\n\nconst Progress = React.forwardRef<ProgressElement, ProgressProps>(\n (props: ScopedProps<ProgressProps>, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\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 <Primitive.div\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\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\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\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator';\n\ntype ProgressIndicatorElement = React.ElementRef<typeof Primitive.div>;\ninterface ProgressIndicatorProps extends PrimitiveDivProps {}\n\nconst ProgressIndicator = React.forwardRef<ProgressIndicatorElement, ProgressIndicatorProps>(\n (props: ScopedProps<ProgressIndicatorProps>, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return (\n <Primitive.div\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n {...indicatorProps}\n ref={forwardedRef}\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\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"],"names":["createProgressScope","Progress","ProgressIndicator","Root","Indicator","React","createContextScope","Primitive","PROGRESS_NAME","DEFAULT_MAX","createProgressContext","ProgressProvider","useProgressContext","forwardRef","props","forwardedRef","__scopeProgress","value","valueProp","max","maxProp","getValueLabel","defaultGetValueLabel","progressProps","isValidMaxNumber","isValidValueNumber","valueLabel","isNumber","undefined","getProgressState","propTypes","propName","componentName","propValue","strVal","String","Error","getInvalidMaxError","getInvalidValueError","INDICATOR_NAME","indicatorProps","context","Math","round","maxValue","isNaN"],"version":3,"file":"index.js.map"}
@@ -3,16 +3,6 @@ import {forwardRef as $k03wI$forwardRef, createElement as $k03wI$createElement}
3
3
  import {createContextScope as $k03wI$createContextScope} from "@radix-ui/react-context";
4
4
  import {Primitive as $k03wI$Primitive} from "@radix-ui/react-primitive";
5
5
 
6
- function $parcel$export(e, n, v, s) {
7
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
8
- }
9
- var $67824d98245208a0$exports = {};
10
-
11
- $parcel$export($67824d98245208a0$exports, "createProgressScope", () => $67824d98245208a0$export$388eb2d8f6d3261f);
12
- $parcel$export($67824d98245208a0$exports, "Progress", () => $67824d98245208a0$export$b25a304ec7d746bb);
13
- $parcel$export($67824d98245208a0$exports, "ProgressIndicator", () => $67824d98245208a0$export$2b776f7e7ee60dbd);
14
- $parcel$export($67824d98245208a0$exports, "Root", () => $67824d98245208a0$export$be92b6f5f03c0fe9);
15
- $parcel$export($67824d98245208a0$exports, "Indicator", () => $67824d98245208a0$export$adb584737d712b70);
16
6
 
17
7
 
18
8
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;A;;;;ACOA;;oGAEA,CAEA,MAAMG,mCAAa,GAAG,UAAtB,AAAA;AACA,MAAMC,iCAAW,GAAG,GAApB,AAAA;AAGA,MAAM,CAACC,2CAAD,EAAwBC,yCAAxB,CAAA,GAA+CL,yBAAkB,CAACE,mCAAD,CAAvE,AAAA;AAIA,MAAM,CAACI,sCAAD,EAAmBC,wCAAnB,CAAA,GACJH,2CAAqB,CAAuBF,mCAAvB,CADvB,AAAA;AAWA,MAAMM,yCAAQ,GAAA,aAAGT,CAAAA,iBAAA,CACf,CAACW,KAAD,EAAoCC,YAApC,GAAqD;IACnD,MAAM,E,iBACJC,eADI,CAAA,EAEJC,KAAK,EAAEC,SAFH,CAAA,EAGJC,GAAG,EAAEC,OAHD,CAAA,iBAIJC,aAAa,GAAGC,0CAJZ,GAKJ,GAAGC,aAAH,EALI,GAMFT,KANJ,AAAM;IAQN,MAAMK,GAAG,GAAGK,sCAAgB,CAACJ,OAAD,CAAhB,GAA4BA,OAA5B,GAAsCb,iCAAlD,AAAA;IACA,MAAMU,KAAK,GAAGQ,wCAAkB,CAACP,SAAD,EAAYC,GAAZ,CAAlB,GAAqCD,SAArC,GAAiD,IAA/D,AAAA;IACA,MAAMQ,UAAU,GAAGC,8BAAQ,C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AA9B,EAAiDD,aAAjD,EAAwE;IACtE,OAAQ,CAAA,kCAAA,EAAoCC,SAAU,CAAA,iBAAA,EAAmBD,aAAc,CAAvF;;8CAEF,EAAgDzB,iCAAY,CAA5D;;;uBAGA,CALE,CAKF;CACC;AAED,MAAMwC,yCAAI,GAAGnC,yCAAb,AAAA;AACA,MAAMoC,yCAAS,GAAGR,yCAAlB,AAAA;;ADhKA","sources":["packages/react/progress/src/index.ts","packages/react/progress/src/Progress.tsx"],"sourcesContent":["export * from './Progress';\n","import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst PROGRESS_NAME = 'Progress';\nconst DEFAULT_MAX = 100;\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope };\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading';\ntype ProgressContextValue = { value: number | null; max: number };\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME);\n\ntype ProgressElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface ProgressProps extends PrimitiveDivProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?(value: number, max: number): string;\n}\n\nconst Progress = React.forwardRef<ProgressElement, ProgressProps>(\n (props: ScopedProps<ProgressProps>, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\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 <Primitive.div\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\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\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\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator';\n\ntype ProgressIndicatorElement = React.ElementRef<typeof Primitive.div>;\ninterface ProgressIndicatorProps extends PrimitiveDivProps {}\n\nconst ProgressIndicator = React.forwardRef<ProgressIndicatorElement, ProgressIndicatorProps>(\n (props: ScopedProps<ProgressIndicatorProps>, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return (\n <Primitive.div\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n {...indicatorProps}\n ref={forwardedRef}\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\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"],"names":["React","createContextScope","Primitive","PROGRESS_NAME","DEFAULT_MAX","createProgressContext","createProgressScope","ProgressProvider","useProgressContext","Progress","forwardRef","props","forwardedRef","__scopeProgress","value","valueProp","max","maxProp","getValueLabel","defaultGetValueLabel","progressProps","isValidMaxNumber","isValidValueNumber","valueLabel","isNumber","undefined","getProgressState","propTypes","propName","componentName","propValue","strVal","String","Error","getInvalidMaxError","getInvalidValueError","INDICATOR_NAME","ProgressIndicator","indicatorProps","context","Math","round","maxValue","isNaN","Root","Indicator"],"version":3,"file":"index.module.js.map"}
1
+ {"mappings":";;;;;A;;;;ACOA;;oGAEA,CAEA,MAAMQ,mCAAa,GAAG,UAAtB,AAAA;AACA,MAAMC,iCA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AED,SAASjB,8BAAT,CAAkBV,KAAlB,EAA+C;IAC7C,OAAO,OAAOA,KAAP,KAAiB,QAAxB,CAAA;CACD;AAED,SAASO,sCAAT,CAA0BL,GAA1B,EAAmD;IACjD,kBAAA;IACA,OACEQ,8BAAQ,CAACR,GAAD,CAAR,IACA,CAAC0B,KAAK,CAAC1B,GAAD,CADN,IAEAA,GAAG,GAAG,CAHR,CAAA;CAKD;AAED,SAASM,wCAAT,CAA4BR,KAA5B,EAAwCE,GAAxC,EAAsE;IACpE,kBAAA;IACA,OACEQ,8BAAQ,CAACV,KAAD,CAAR,IACA,CAAC4B,KAAK,CAAC5B,KAAD,CADN,IAEAA,KAAK,IAAIE,GAFT,IAGAF,KAAK,IAAI,CAJX,CAAA;C,CAQF,+DAFC;AAGD,SAASoB,wCAAT,CAA4BJ,SAA5B,EAA+CD,aAA/C,EAAsE;IACpE,OAAQ,CAAA,gCAAA,EAAkCC,SAAU,CAAA,iBAAA,EAAmBD,aAAc,CAAA,sEAAA,EAAwEvB,iCAAY,CAAA,GAAA,CAAzK,CAAA;CACD;AAED,SAAS6B,0CAAT,CAA8BL,SAA9B,EAAiDD,aAAjD,EAAwE;IACtE,OAAQ,CAAA,kCAAA,EAAoCC,SAAU,CAAA,iBAAA,EAAmBD,aAAc,CAAvF;;8CAEF,EAAgDvB,iCAAY,CAA5D;;;uBAGA,CALE,CAKF;CACC;AAED,MAAMN,yCAAI,GAAGF,yCAAb,AAAA;AACA,MAAMG,yCAAS,GAAGF,yCAAlB,AAAA;;ADhKA","sources":["packages/react/progress/src/index.ts","packages/react/progress/src/Progress.tsx"],"sourcesContent":["export {\n createProgressScope,\n //\n Progress,\n ProgressIndicator,\n //\n Root,\n Indicator,\n} from './Progress';\nexport type { ProgressProps, ProgressIndicatorProps } from './Progress';\n","import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst PROGRESS_NAME = 'Progress';\nconst DEFAULT_MAX = 100;\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope };\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading';\ntype ProgressContextValue = { value: number | null; max: number };\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME);\n\ntype ProgressElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface ProgressProps extends PrimitiveDivProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?(value: number, max: number): string;\n}\n\nconst Progress = React.forwardRef<ProgressElement, ProgressProps>(\n (props: ScopedProps<ProgressProps>, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\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 <Primitive.div\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\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\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\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator';\n\ntype ProgressIndicatorElement = React.ElementRef<typeof Primitive.div>;\ninterface ProgressIndicatorProps extends PrimitiveDivProps {}\n\nconst ProgressIndicator = React.forwardRef<ProgressIndicatorElement, ProgressIndicatorProps>(\n (props: ScopedProps<ProgressIndicatorProps>, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return (\n <Primitive.div\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n {...indicatorProps}\n ref={forwardedRef}\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\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"],"names":["createProgressScope","Progress","ProgressIndicator","Root","Indicator","React","createContextScope","Primitive","PROGRESS_NAME","DEFAULT_MAX","createProgressContext","ProgressProvider","useProgressContext","forwardRef","props","forwardedRef","__scopeProgress","value","valueProp","max","maxProp","getValueLabel","defaultGetValueLabel","progressProps","isValidMaxNumber","isValidValueNumber","valueLabel","isNumber","undefined","getProgressState","propTypes","propName","componentName","propValue","strVal","String","Error","getInvalidMaxError","getInvalidValueError","INDICATOR_NAME","indicatorProps","context","Math","round","maxValue","isNaN"],"version":3,"file":"index.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-progress",
3
- "version": "0.1.5-rc.9",
3
+ "version": "1.0.0-rc.1",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -17,11 +17,12 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@babel/runtime": "^7.13.10",
20
- "@radix-ui/react-context": "0.1.2-rc.9",
21
- "@radix-ui/react-primitive": "0.1.5-rc.9"
20
+ "@radix-ui/react-context": "1.0.0-rc.1",
21
+ "@radix-ui/react-primitive": "1.0.0-rc.1"
22
22
  },
23
23
  "peerDependencies": {
24
- "react": "^16.8 || ^17.0 || ^18.0"
24
+ "react": "^16.8 || ^17.0 || ^18.0",
25
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
25
26
  },
26
27
  "homepage": "https://radix-ui.com/primitives",
27
28
  "repository": {