@cdx-ui/components 0.0.1-beta.167 → 0.0.1-beta.168
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/lib/commonjs/components/ProgressSegmented/index.js +1 -14
- package/lib/commonjs/components/ProgressSegmented/index.js.map +1 -1
- package/lib/module/components/ProgressSegmented/index.js +2 -15
- package/lib/module/components/ProgressSegmented/index.js.map +1 -1
- package/lib/typescript/components/ProgressSegmented/index.d.ts +0 -5
- package/lib/typescript/components/ProgressSegmented/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/ProgressSegmented/index.tsx +2 -21
|
@@ -9,27 +9,16 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _utils = require("@cdx-ui/utils");
|
|
10
10
|
var _styles = require("./styles");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
/* `ProgressSegmentedProps.total` remains in the public API until the next major release. */
|
|
13
|
-
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
14
|
-
|
|
15
12
|
const ProgressSegmented = exports.ProgressSegmented = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
16
13
|
step,
|
|
17
14
|
segments,
|
|
18
|
-
total,
|
|
19
15
|
isStepComplete = false,
|
|
20
16
|
getAccessibilityText,
|
|
21
17
|
className,
|
|
22
18
|
accessibilityLabel = 'Progress',
|
|
23
19
|
...props
|
|
24
20
|
}, ref) => {
|
|
25
|
-
const segmentCount = segments ??
|
|
26
|
-
|
|
27
|
-
// TODO: Remove this once the `total` prop is removed.
|
|
28
|
-
(0, _react.useEffect)(() => {
|
|
29
|
-
if (__DEV__ && total !== undefined && segments === undefined) {
|
|
30
|
-
console.warn('[ProgressSegmented] The `total` prop is deprecated and will be removed in a future major release. Use `segments` instead.');
|
|
31
|
-
}
|
|
32
|
-
}, [total, segments]);
|
|
21
|
+
const segmentCount = segments ?? 5;
|
|
33
22
|
const clampedStep = Math.max(0, Math.min(step, segmentCount));
|
|
34
23
|
const segmentStates = (0, _react.useMemo)(() => {
|
|
35
24
|
return Array.from({
|
|
@@ -71,6 +60,4 @@ const ProgressSegmented = exports.ProgressSegmented = /*#__PURE__*/(0, _react.fo
|
|
|
71
60
|
});
|
|
72
61
|
});
|
|
73
62
|
ProgressSegmented.displayName = 'ProgressSegmented';
|
|
74
|
-
|
|
75
|
-
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
76
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_utils","_styles","_jsxRuntime","ProgressSegmented","exports","forwardRef","step","segments","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_utils","_styles","_jsxRuntime","ProgressSegmented","exports","forwardRef","step","segments","isStepComplete","getAccessibilityText","className","accessibilityLabel","props","ref","segmentCount","clampedStep","Math","max","min","segmentStates","useMemo","Array","from","length","_","index","segmentIndex","state","accessibilityText","String","jsx","View","accessibilityRole","accessibilityValue","now","text","cn","progressSegmentedVariants","children","map","segmentVariants","displayName"],"sourceRoot":"../../../../src","sources":["components/ProgressSegmented/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAIkB,IAAAI,WAAA,GAAAJ,OAAA;AAwBX,MAAMK,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,gBAAG,IAAAE,iBAAU,EACzC,CACE;EACEC,IAAI;EACJC,QAAQ;EACRC,cAAc,GAAG,KAAK;EACtBC,oBAAoB;EACpBC,SAAS;EACTC,kBAAkB,GAAG,UAAU;EAC/B,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAMC,YAAY,GAAGP,QAAQ,IAAI,CAAC;EAElC,MAAMQ,WAAW,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GA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AAC,IAAAC,iCAAyB,EAAC,CAAC,EAAE3B,SAAS,CAAE;IAAA,GAClDE,KAAK;IAAA0B,QAAA,EAERnB,aAAa,CAACoB,GAAG,CAAC,CAACZ,KAAK,EAAEF,KAAK,kBAC9B,IAAAvB,WAAA,CAAA4B,GAAA,EAAC/B,YAAA,CAAAgC,IAAI;MAAarB,SAAS,EAAE,IAAA0B,SAAE,EAAC,IAAAI,uBAAe,EAAC;QAAEb;MAAM,CAAC,CAAC;IAAE,GAAjDF,KAAmD,CAC/D;EAAC,CACE,CAAC;AAEX,CACF,CAAC;AAEDtB,iBAAiB,CAACsC,WAAW,GAAG,mBAAmB","ignoreList":[]}
|
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { forwardRef,
|
|
3
|
+
import { forwardRef, useMemo } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import { cn } from '@cdx-ui/utils';
|
|
6
6
|
import { progressSegmentedVariants, segmentVariants } from './styles';
|
|
7
|
-
|
|
8
|
-
/* `ProgressSegmentedProps.total` remains in the public API until the next major release. */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
10
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
8
|
export const ProgressSegmented = /*#__PURE__*/forwardRef(({
|
|
12
9
|
step,
|
|
13
10
|
segments,
|
|
14
|
-
total,
|
|
15
11
|
isStepComplete = false,
|
|
16
12
|
getAccessibilityText,
|
|
17
13
|
className,
|
|
18
14
|
accessibilityLabel = 'Progress',
|
|
19
15
|
...props
|
|
20
16
|
}, ref) => {
|
|
21
|
-
const segmentCount = segments ??
|
|
22
|
-
|
|
23
|
-
// TODO: Remove this once the `total` prop is removed.
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (__DEV__ && total !== undefined && segments === undefined) {
|
|
26
|
-
console.warn('[ProgressSegmented] The `total` prop is deprecated and will be removed in a future major release. Use `segments` instead.');
|
|
27
|
-
}
|
|
28
|
-
}, [total, segments]);
|
|
17
|
+
const segmentCount = segments ?? 5;
|
|
29
18
|
const clampedStep = Math.max(0, Math.min(step, segmentCount));
|
|
30
19
|
const segmentStates = useMemo(() => {
|
|
31
20
|
return Array.from({
|
|
@@ -67,6 +56,4 @@ export const ProgressSegmented = /*#__PURE__*/forwardRef(({
|
|
|
67
56
|
});
|
|
68
57
|
});
|
|
69
58
|
ProgressSegmented.displayName = 'ProgressSegmented';
|
|
70
|
-
|
|
71
|
-
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
72
59
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","
|
|
1
|
+
{"version":3,"names":["forwardRef","useMemo","View","cn","progressSegmentedVariants","segmentVariants","jsx","_jsx","ProgressSegmented","step","segments","isStepComplete","getAccessibilityText","className","accessibilityLabel","props","ref","segmentCount","clampedStep","Math","max","min","segmentStates","Array","from","length","_","index","segmentIndex","state","accessibilityText","String","accessibilityRole","accessibilityValue","now","text","children","map","displayName"],"sourceRoot":"../../../../src","sources":["components/ProgressSegmented/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,EAAE,QAAQ,eAAe;AAClC,SACEC,yBAAyB,EACzBC,eAAe,QAEV,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAwBlB,OAAO,MAAMC,iBAAiB,gBAAGR,UAAU,CACzC,CACE;EACES,IAAI;EACJC,QAAQ;EACRC,cAAc,GAAG,KAAK;EACtBC,oBAAoB;EACpBC,SAAS;EACTC,kBAAkB,GAAG,UAAU;EAC/B,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAMC,YAAY,GAAGP,QAAQ,IAAI,CAAC;EAElC,MAAMQ,WAAW,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAACZ,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K;IAAAqB,QAAA,EAERd,aAAa,CAACe,GAAG,CAAC,CAACR,KAAK,EAAEF,KAAK,kBAC9BpB,IAAA,CAACL,IAAI;MAAaW,SAAS,EAAEV,EAAE,CAACE,eAAe,CAAC;QAAEwB;MAAM,CAAC,CAAC;IAAE,GAAjDF,KAAmD,CAC/D;EAAC,CACE,CAAC;AAEX,CACF,CAAC;AAEDnB,iBAAiB,CAAC8B,WAAW,GAAG,mBAAmB","ignoreList":[]}
|
|
@@ -8,11 +8,6 @@ export interface ProgressSegmentedProps extends ViewProps, ProgressSegmentedVari
|
|
|
8
8
|
* system file); the prop accepts any positive integer for backward compatibility.
|
|
9
9
|
*/
|
|
10
10
|
readonly segments?: number;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use {@link ProgressSegmentedProps.segments} instead. This alias will be removed
|
|
13
|
-
* in a future major release.
|
|
14
|
-
*/
|
|
15
|
-
readonly total?: number;
|
|
16
11
|
/** When true, the current step segment is marked as complete rather than in-progress */
|
|
17
12
|
readonly isStepComplete?: boolean;
|
|
18
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressSegmented/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ProgressSegmented/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,sBAAuB,SAAQ,SAAS,EAAE,yBAAyB;IAClF,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,wFAAwF;IACxF,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAC9B,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,OAAO,KACpB,MAAM,CAAC;IACZ,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,iBAAiB,yGA2D7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.168",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
"@marceloterreiro/flash-calendar": "2.0.0",
|
|
82
82
|
"react-native-reanimated-carousel": "5.0.0-beta.5",
|
|
83
83
|
"uniwind": "1.10.0",
|
|
84
|
-
"@cdx-ui/primitives": "0.0.1-beta.
|
|
85
|
-
"@cdx-ui/
|
|
86
|
-
"@cdx-ui/
|
|
87
|
-
"@cdx-ui/
|
|
84
|
+
"@cdx-ui/primitives": "0.0.1-beta.168",
|
|
85
|
+
"@cdx-ui/formatters": "0.0.1-beta.168",
|
|
86
|
+
"@cdx-ui/utils": "0.0.1-beta.168",
|
|
87
|
+
"@cdx-ui/icons": "0.0.1-beta.168"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@react-navigation/bottom-tabs": "*",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { forwardRef,
|
|
1
|
+
import { forwardRef, useMemo } from 'react';
|
|
2
2
|
import { View, type ViewProps } from 'react-native';
|
|
3
3
|
import { cn } from '@cdx-ui/utils';
|
|
4
4
|
import {
|
|
@@ -7,8 +7,6 @@ import {
|
|
|
7
7
|
type ProgressSegmentedVariants,
|
|
8
8
|
} from './styles';
|
|
9
9
|
|
|
10
|
-
/* `ProgressSegmentedProps.total` remains in the public API until the next major release. */
|
|
11
|
-
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
12
10
|
export interface ProgressSegmentedProps extends ViewProps, ProgressSegmentedVariants {
|
|
13
11
|
/** Current step (1-based index into the segment count) */
|
|
14
12
|
readonly step: number;
|
|
@@ -17,11 +15,6 @@ export interface ProgressSegmentedProps extends ViewProps, ProgressSegmentedVari
|
|
|
17
15
|
* system file); the prop accepts any positive integer for backward compatibility.
|
|
18
16
|
*/
|
|
19
17
|
readonly segments?: number;
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated Use {@link ProgressSegmentedProps.segments} instead. This alias will be removed
|
|
22
|
-
* in a future major release.
|
|
23
|
-
*/
|
|
24
|
-
readonly total?: number;
|
|
25
18
|
/** When true, the current step segment is marked as complete rather than in-progress */
|
|
26
19
|
readonly isStepComplete?: boolean;
|
|
27
20
|
/**
|
|
@@ -41,7 +34,6 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
|
|
|
41
34
|
{
|
|
42
35
|
step,
|
|
43
36
|
segments,
|
|
44
|
-
total,
|
|
45
37
|
isStepComplete = false,
|
|
46
38
|
getAccessibilityText,
|
|
47
39
|
className,
|
|
@@ -50,16 +42,7 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
|
|
|
50
42
|
},
|
|
51
43
|
ref,
|
|
52
44
|
) => {
|
|
53
|
-
const segmentCount = segments ??
|
|
54
|
-
|
|
55
|
-
// TODO: Remove this once the `total` prop is removed.
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
if (__DEV__ && total !== undefined && segments === undefined) {
|
|
58
|
-
console.warn(
|
|
59
|
-
'[ProgressSegmented] The `total` prop is deprecated and will be removed in a future major release. Use `segments` instead.',
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
}, [total, segments]);
|
|
45
|
+
const segmentCount = segments ?? 5;
|
|
63
46
|
|
|
64
47
|
const clampedStep = Math.max(0, Math.min(step, segmentCount));
|
|
65
48
|
|
|
@@ -108,5 +91,3 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
|
|
|
108
91
|
);
|
|
109
92
|
|
|
110
93
|
ProgressSegmented.displayName = 'ProgressSegmented';
|
|
111
|
-
|
|
112
|
-
/* eslint-enable @typescript-eslint/no-deprecated */
|