@vygruppen/spor-react 10.6.2 → 10.7.0
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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +10 -0
- package/dist/{CountryCodeSelect-ANPDQEJN.mjs → CountryCodeSelect-NZI7KBTH.mjs} +1 -1
- package/dist/{chunk-CILVSJHM.mjs → chunk-Q3JX25BX.mjs} +54 -45
- package/dist/index.d.mts +21 -12
- package/dist/index.d.ts +21 -12
- package/dist/index.js +55 -46
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/loader/ProgressBar.tsx +10 -2
- package/src/theme/components/divider.ts +36 -35
- package/src/theme/components/progress-bar.ts +9 -8
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> @vygruppen/spor-react@10.
|
2
|
+
> @vygruppen/spor-react@10.7.0 build
|
3
3
|
> tsup src/index.tsx --dts --treeshake --format cjs,esm
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
@@ -9,12 +9,12 @@
|
|
9
9
|
[34mCJS[39m Build start
|
10
10
|
[34mESM[39m Build start
|
11
11
|
[34mDTS[39m Build start
|
12
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
13
|
-
[32mCJS[39m ⚡️ Build success in
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m539.38 KB[39m
|
13
|
+
[32mCJS[39m ⚡️ Build success in 2260ms
|
14
14
|
[32mESM[39m [1mdist/index.mjs [22m[32m2.16 KB[39m
|
15
|
-
[32mESM[39m [1mdist/CountryCodeSelect-
|
16
|
-
[32mESM[39m [1mdist/chunk-
|
17
|
-
[32mESM[39m ⚡️ Build success in
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
15
|
+
[32mESM[39m [1mdist/CountryCodeSelect-NZI7KBTH.mjs [22m[32m1.22 KB[39m
|
16
|
+
[32mESM[39m [1mdist/chunk-Q3JX25BX.mjs [22m[32m425.89 KB[39m
|
17
|
+
[32mESM[39m ⚡️ Build success in 2261ms
|
18
|
+
[32mDTS[39m ⚡️ Build success in 15580ms
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m340.55 KB[39m
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m340.55 KB[39m
|
package/CHANGELOG.md
CHANGED
@@ -1841,7 +1841,7 @@ var texts4 = createTexts({
|
|
1841
1841
|
sv: "Landskod"
|
1842
1842
|
}
|
1843
1843
|
});
|
1844
|
-
var LazyCountryCodeSelect = React85__default.lazy(() => import('./CountryCodeSelect-
|
1844
|
+
var LazyCountryCodeSelect = React85__default.lazy(() => import('./CountryCodeSelect-NZI7KBTH.mjs'));
|
1845
1845
|
var Radio = forwardRef((props, ref) => {
|
1846
1846
|
return /* @__PURE__ */ React85__default.createElement(Radio$1, { ...props, ref });
|
1847
1847
|
});
|
@@ -2323,6 +2323,7 @@ var ProgressBar = ({
|
|
2323
2323
|
height = "0.5rem",
|
2324
2324
|
width = "100%",
|
2325
2325
|
"aria-label": ariaLabel,
|
2326
|
+
isActive = true,
|
2326
2327
|
...rest
|
2327
2328
|
}) => {
|
2328
2329
|
const { t: t2 } = useTranslation();
|
@@ -2335,7 +2336,7 @@ var ProgressBar = ({
|
|
2335
2336
|
value,
|
2336
2337
|
"aria-label": ariaLabel || t2(texts6.label(value))
|
2337
2338
|
});
|
2338
|
-
const styles3 = useMultiStyleConfig("ProgressBar", {});
|
2339
|
+
const styles3 = useMultiStyleConfig("ProgressBar", { isActive });
|
2339
2340
|
return /* @__PURE__ */ React85__default.createElement(React85__default.Fragment, null, /* @__PURE__ */ React85__default.createElement(
|
2340
2341
|
Box,
|
2341
2342
|
{
|
@@ -2344,7 +2345,14 @@ var ProgressBar = ({
|
|
2344
2345
|
__css: styles3.container,
|
2345
2346
|
...rest
|
2346
2347
|
},
|
2347
|
-
/* @__PURE__ */ React85__default.createElement(Box, { width, __css: styles3.background }, /* @__PURE__ */ React85__default.createElement(
|
2348
|
+
/* @__PURE__ */ React85__default.createElement(Box, { width, __css: styles3.background }, /* @__PURE__ */ React85__default.createElement(
|
2349
|
+
Box,
|
2350
|
+
{
|
2351
|
+
__css: styles3.progress,
|
2352
|
+
height,
|
2353
|
+
width: isActive ? `${value}%` : "100%"
|
2354
|
+
}
|
2355
|
+
)),
|
2348
2356
|
currentLoadingText && /* @__PURE__ */ React85__default.createElement(Text, { sx: styles3.description, ...labelProps }, currentLoadingText)
|
2349
2357
|
));
|
2350
2358
|
};
|
@@ -12025,37 +12033,41 @@ var config14 = helpers8.defineMultiStyleConfig({
|
|
12025
12033
|
}
|
12026
12034
|
});
|
12027
12035
|
var datepicker_default = config14;
|
12028
|
-
var
|
12029
|
-
|
12030
|
-
|
12031
|
-
|
12032
|
-
|
12033
|
-
})
|
12034
|
-
|
12035
|
-
|
12036
|
-
|
12037
|
-
|
12038
|
-
|
12039
|
-
|
12040
|
-
|
12041
|
-
|
12042
|
-
|
12043
|
-
|
12044
|
-
|
12036
|
+
var isSolid = (props) => props.variant === "solid";
|
12037
|
+
var isDashed = (props) => props.variant === "dashed";
|
12038
|
+
var divider_default = defineStyleConfig({
|
12039
|
+
baseStyle: (props) => ({
|
12040
|
+
borderColor: mode("blackAlpha.300", "whiteAlpha.300")(props)
|
12041
|
+
}),
|
12042
|
+
variants: {
|
12043
|
+
solid: {
|
12044
|
+
borderStyle: "solid"
|
12045
|
+
},
|
12046
|
+
dashed: (props) => ({
|
12047
|
+
backgroundImage: `repeating-linear-gradient(90deg, ${mode("blackAlpha.300", "whiteAlpha.300")(props)}, ${mode("blackAlpha.300", "whiteAlpha.300")(props)} 4px, transparent 4px, transparent 10px)`,
|
12048
|
+
backgroundPosition: "left bottom",
|
12049
|
+
backgroundRepeat: "repeat-x",
|
12050
|
+
backgroundSize: "100% 3px",
|
12051
|
+
borderRadius: props.size === "sm" ? "0.5px" : props.size === "md" ? "1px" : "1.5px"
|
12052
|
+
})
|
12045
12053
|
},
|
12046
|
-
|
12047
|
-
|
12048
|
-
|
12054
|
+
sizes: {
|
12055
|
+
sm: (props) => ({
|
12056
|
+
borderWidth: isSolid(props) ? "1px" : void 0,
|
12057
|
+
borderRadius: isSolid(props) ? "0.5px" : void 0,
|
12058
|
+
height: isDashed(props) ? "1px" : void 0
|
12059
|
+
}),
|
12060
|
+
md: (props) => ({
|
12061
|
+
borderWidth: isSolid(props) ? "2px" : void 0,
|
12062
|
+
borderRadius: isSolid(props) ? "1px" : "10px",
|
12063
|
+
height: isDashed(props) ? "2px" : void 0
|
12064
|
+
}),
|
12065
|
+
lg: (props) => ({
|
12066
|
+
borderWidth: isSolid(props) ? "3px" : void 0,
|
12067
|
+
borderRadius: isSolid(props) ? "1.5px" : void 0,
|
12068
|
+
height: isDashed(props) ? "3px" : void 0
|
12069
|
+
})
|
12049
12070
|
},
|
12050
|
-
lg: {
|
12051
|
-
borderWidth: "3px",
|
12052
|
-
borderRadius: "1.5px"
|
12053
|
-
}
|
12054
|
-
};
|
12055
|
-
var divider_default = defineStyleConfig({
|
12056
|
-
baseStyle: baseStyle43,
|
12057
|
-
variants: variants14,
|
12058
|
-
sizes: sizes25,
|
12059
12071
|
defaultProps: {
|
12060
12072
|
variant: "solid",
|
12061
12073
|
size: "md"
|
@@ -13014,7 +13026,7 @@ var link_default = config24;
|
|
13014
13026
|
|
13015
13027
|
// src/theme/components/list.ts
|
13016
13028
|
var { defineMultiStyleConfig: defineMultiStyleConfig28, definePartsStyle: definePartsStyle28 } = createMultiStyleConfigHelpers(listAnatomy.keys);
|
13017
|
-
var
|
13029
|
+
var baseStyle43 = definePartsStyle28({
|
13018
13030
|
container: {
|
13019
13031
|
fontSize: ["mobile.sm", "desktop.sm"]
|
13020
13032
|
},
|
@@ -13028,7 +13040,7 @@ var baseStyle44 = definePartsStyle28({
|
|
13028
13040
|
}
|
13029
13041
|
});
|
13030
13042
|
var list_default = defineMultiStyleConfig28({
|
13031
|
-
baseStyle:
|
13043
|
+
baseStyle: baseStyle43
|
13032
13044
|
});
|
13033
13045
|
function outlineBorder(state2, props) {
|
13034
13046
|
switch (state2) {
|
@@ -13477,19 +13489,16 @@ var config31 = helpers23.defineMultiStyleConfig({
|
|
13477
13489
|
},
|
13478
13490
|
background: {
|
13479
13491
|
display: "flex",
|
13480
|
-
backgroundColor: mode(
|
13492
|
+
backgroundColor: props.isActive ? mode(
|
13481
13493
|
"brand.surface.default.dark",
|
13482
13494
|
"brand.surface.default.light"
|
13483
|
-
)(props),
|
13495
|
+
)(props) : void 0,
|
13484
13496
|
borderRadius: "sm",
|
13485
13497
|
justifyContent: "flex-start",
|
13486
13498
|
marginX: "auto"
|
13487
13499
|
},
|
13488
13500
|
progress: {
|
13489
|
-
backgroundColor: mode(
|
13490
|
-
"brand.surface.active.light",
|
13491
|
-
"brand.surface.active.dark"
|
13492
|
-
)(props),
|
13501
|
+
backgroundColor: props.isActive ? mode("brand.surface.active.light", "brand.surface.active.dark")(props) : mode("icon.disabled.light", "icon.disabled.dark")(props),
|
13493
13502
|
borderRadius: "sm",
|
13494
13503
|
maxWidth: "100%",
|
13495
13504
|
transition: "width .2s ease-out"
|
@@ -14756,17 +14765,17 @@ function useSizes({
|
|
14756
14765
|
getNodes,
|
14757
14766
|
observeMutation = true
|
14758
14767
|
}) {
|
14759
|
-
const [
|
14768
|
+
const [sizes25, setSizes] = useState([]);
|
14760
14769
|
const [count, setCount] = useState(0);
|
14761
14770
|
useSafeLayoutEffect(() => {
|
14762
14771
|
const elements = getNodes();
|
14763
14772
|
const cleanups = elements.map(
|
14764
14773
|
(element, index) => trackElementSize(element, (size2) => {
|
14765
|
-
setSizes((
|
14774
|
+
setSizes((sizes26) => {
|
14766
14775
|
return [
|
14767
|
-
...
|
14776
|
+
...sizes26.slice(0, index),
|
14768
14777
|
size2,
|
14769
|
-
...
|
14778
|
+
...sizes26.slice(index + 1)
|
14770
14779
|
];
|
14771
14780
|
});
|
14772
14781
|
})
|
@@ -14785,7 +14794,7 @@ function useSizes({
|
|
14785
14794
|
});
|
14786
14795
|
};
|
14787
14796
|
}, [count]);
|
14788
|
-
return
|
14797
|
+
return sizes25;
|
14789
14798
|
}
|
14790
14799
|
function isRef(ref) {
|
14791
14800
|
return typeof ref === "object" && ref !== null && "current" in ref;
|
package/dist/index.d.mts
CHANGED
@@ -1760,6 +1760,8 @@ type ProgressBarProps = BoxProps & {
|
|
1760
1760
|
* Defaults to 5000 (5 seconds).
|
1761
1761
|
*/
|
1762
1762
|
labelRotationDelay?: number;
|
1763
|
+
/** Pass to disable the color of the component */
|
1764
|
+
isActive?: boolean;
|
1763
1765
|
};
|
1764
1766
|
/**
|
1765
1767
|
* Shows the progress of a loading process.
|
@@ -1788,7 +1790,7 @@ type ProgressBarProps = BoxProps & {
|
|
1788
1790
|
* <ProgressBar value={50} aria-label="Loading..." />
|
1789
1791
|
* ```
|
1790
1792
|
*/
|
1791
|
-
declare const ProgressBar: ({ value, label, labelRotationDelay, height, width, "aria-label": ariaLabel, ...rest }: ProgressBarProps) => React.JSX.Element;
|
1793
|
+
declare const ProgressBar: ({ value, label, labelRotationDelay, height, width, "aria-label": ariaLabel, isActive, ...rest }: ProgressBarProps) => React.JSX.Element;
|
1792
1794
|
|
1793
1795
|
type ProgressLoaderProps = BoxProps & {
|
1794
1796
|
/** The percentage of progress made.
|
@@ -3759,25 +3761,32 @@ declare const theme: {
|
|
3759
3761
|
borderColor: string;
|
3760
3762
|
}) | undefined;
|
3761
3763
|
sizes?: {
|
3762
|
-
sm: {
|
3763
|
-
borderWidth: string;
|
3764
|
-
borderRadius: string;
|
3764
|
+
sm: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
3765
|
+
borderWidth: string | undefined;
|
3766
|
+
borderRadius: string | undefined;
|
3767
|
+
height: string | undefined;
|
3765
3768
|
};
|
3766
|
-
md: {
|
3767
|
-
borderWidth: string;
|
3769
|
+
md: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
3770
|
+
borderWidth: string | undefined;
|
3768
3771
|
borderRadius: string;
|
3772
|
+
height: string | undefined;
|
3769
3773
|
};
|
3770
|
-
lg: {
|
3771
|
-
borderWidth: string;
|
3772
|
-
borderRadius: string;
|
3774
|
+
lg: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
3775
|
+
borderWidth: string | undefined;
|
3776
|
+
borderRadius: string | undefined;
|
3777
|
+
height: string | undefined;
|
3773
3778
|
};
|
3774
3779
|
} | undefined;
|
3775
3780
|
variants?: {
|
3776
3781
|
solid: {
|
3777
3782
|
borderStyle: string;
|
3778
3783
|
};
|
3779
|
-
dashed: {
|
3780
|
-
|
3784
|
+
dashed: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
3785
|
+
backgroundImage: string;
|
3786
|
+
backgroundPosition: string;
|
3787
|
+
backgroundRepeat: string;
|
3788
|
+
backgroundSize: string;
|
3789
|
+
borderRadius: string;
|
3781
3790
|
};
|
3782
3791
|
} | undefined;
|
3783
3792
|
defaultProps?: {
|
@@ -5453,7 +5462,7 @@ declare const theme: {
|
|
5453
5462
|
};
|
5454
5463
|
background: {
|
5455
5464
|
display: string;
|
5456
|
-
backgroundColor: string;
|
5465
|
+
backgroundColor: string | undefined;
|
5457
5466
|
borderRadius: string;
|
5458
5467
|
justifyContent: string;
|
5459
5468
|
marginX: string;
|
package/dist/index.d.ts
CHANGED
@@ -1760,6 +1760,8 @@ type ProgressBarProps = BoxProps & {
|
|
1760
1760
|
* Defaults to 5000 (5 seconds).
|
1761
1761
|
*/
|
1762
1762
|
labelRotationDelay?: number;
|
1763
|
+
/** Pass to disable the color of the component */
|
1764
|
+
isActive?: boolean;
|
1763
1765
|
};
|
1764
1766
|
/**
|
1765
1767
|
* Shows the progress of a loading process.
|
@@ -1788,7 +1790,7 @@ type ProgressBarProps = BoxProps & {
|
|
1788
1790
|
* <ProgressBar value={50} aria-label="Loading..." />
|
1789
1791
|
* ```
|
1790
1792
|
*/
|
1791
|
-
declare const ProgressBar: ({ value, label, labelRotationDelay, height, width, "aria-label": ariaLabel, ...rest }: ProgressBarProps) => React.JSX.Element;
|
1793
|
+
declare const ProgressBar: ({ value, label, labelRotationDelay, height, width, "aria-label": ariaLabel, isActive, ...rest }: ProgressBarProps) => React.JSX.Element;
|
1792
1794
|
|
1793
1795
|
type ProgressLoaderProps = BoxProps & {
|
1794
1796
|
/** The percentage of progress made.
|
@@ -3759,25 +3761,32 @@ declare const theme: {
|
|
3759
3761
|
borderColor: string;
|
3760
3762
|
}) | undefined;
|
3761
3763
|
sizes?: {
|
3762
|
-
sm: {
|
3763
|
-
borderWidth: string;
|
3764
|
-
borderRadius: string;
|
3764
|
+
sm: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
3765
|
+
borderWidth: string | undefined;
|
3766
|
+
borderRadius: string | undefined;
|
3767
|
+
height: string | undefined;
|
3765
3768
|
};
|
3766
|
-
md: {
|
3767
|
-
borderWidth: string;
|
3769
|
+
md: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
3770
|
+
borderWidth: string | undefined;
|
3768
3771
|
borderRadius: string;
|
3772
|
+
height: string | undefined;
|
3769
3773
|
};
|
3770
|
-
lg: {
|
3771
|
-
borderWidth: string;
|
3772
|
-
borderRadius: string;
|
3774
|
+
lg: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
3775
|
+
borderWidth: string | undefined;
|
3776
|
+
borderRadius: string | undefined;
|
3777
|
+
height: string | undefined;
|
3773
3778
|
};
|
3774
3779
|
} | undefined;
|
3775
3780
|
variants?: {
|
3776
3781
|
solid: {
|
3777
3782
|
borderStyle: string;
|
3778
3783
|
};
|
3779
|
-
dashed: {
|
3780
|
-
|
3784
|
+
dashed: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
3785
|
+
backgroundImage: string;
|
3786
|
+
backgroundPosition: string;
|
3787
|
+
backgroundRepeat: string;
|
3788
|
+
backgroundSize: string;
|
3789
|
+
borderRadius: string;
|
3781
3790
|
};
|
3782
3791
|
} | undefined;
|
3783
3792
|
defaultProps?: {
|
@@ -5453,7 +5462,7 @@ declare const theme: {
|
|
5453
5462
|
};
|
5454
5463
|
background: {
|
5455
5464
|
display: string;
|
5456
|
-
backgroundColor: string;
|
5465
|
+
backgroundColor: string | undefined;
|
5457
5466
|
borderRadius: string;
|
5458
5467
|
justifyContent: string;
|
5459
5468
|
marginX: string;
|
package/dist/index.js
CHANGED
@@ -2726,6 +2726,7 @@ var init_ProgressBar = __esm({
|
|
2726
2726
|
height = "0.5rem",
|
2727
2727
|
width = "100%",
|
2728
2728
|
"aria-label": ariaLabel,
|
2729
|
+
isActive = true,
|
2729
2730
|
...rest
|
2730
2731
|
}) => {
|
2731
2732
|
const { t: t2 } = useTranslation();
|
@@ -2738,7 +2739,7 @@ var init_ProgressBar = __esm({
|
|
2738
2739
|
value,
|
2739
2740
|
"aria-label": ariaLabel || t2(texts7.label(value))
|
2740
2741
|
});
|
2741
|
-
const styles3 = react.useMultiStyleConfig("ProgressBar", {});
|
2742
|
+
const styles3 = react.useMultiStyleConfig("ProgressBar", { isActive });
|
2742
2743
|
return /* @__PURE__ */ React86__namespace.default.createElement(React86__namespace.default.Fragment, null, /* @__PURE__ */ React86__namespace.default.createElement(
|
2743
2744
|
react.Box,
|
2744
2745
|
{
|
@@ -2747,7 +2748,14 @@ var init_ProgressBar = __esm({
|
|
2747
2748
|
__css: styles3.container,
|
2748
2749
|
...rest
|
2749
2750
|
},
|
2750
|
-
/* @__PURE__ */ React86__namespace.default.createElement(react.Box, { width, __css: styles3.background }, /* @__PURE__ */ React86__namespace.default.createElement(
|
2751
|
+
/* @__PURE__ */ React86__namespace.default.createElement(react.Box, { width, __css: styles3.background }, /* @__PURE__ */ React86__namespace.default.createElement(
|
2752
|
+
react.Box,
|
2753
|
+
{
|
2754
|
+
__css: styles3.progress,
|
2755
|
+
height,
|
2756
|
+
width: isActive ? `${value}%` : "100%"
|
2757
|
+
}
|
2758
|
+
)),
|
2751
2759
|
currentLoadingText && /* @__PURE__ */ React86__namespace.default.createElement(react.Text, { sx: styles3.description, ...labelProps }, currentLoadingText)
|
2752
2760
|
));
|
2753
2761
|
};
|
@@ -13595,41 +13603,45 @@ var init_datepicker2 = __esm({
|
|
13595
13603
|
datepicker_default = config14;
|
13596
13604
|
}
|
13597
13605
|
});
|
13598
|
-
var
|
13606
|
+
var isSolid, isDashed, divider_default;
|
13599
13607
|
var init_divider = __esm({
|
13600
13608
|
"src/theme/components/divider.ts"() {
|
13601
13609
|
init_dist3();
|
13602
|
-
|
13603
|
-
|
13604
|
-
|
13605
|
-
|
13606
|
-
|
13607
|
-
|
13608
|
-
|
13609
|
-
|
13610
|
-
|
13611
|
-
|
13612
|
-
|
13613
|
-
|
13614
|
-
|
13615
|
-
|
13616
|
-
|
13617
|
-
|
13618
|
-
|
13610
|
+
isSolid = (props) => props.variant === "solid";
|
13611
|
+
isDashed = (props) => props.variant === "dashed";
|
13612
|
+
divider_default = defineStyleConfig({
|
13613
|
+
baseStyle: (props) => ({
|
13614
|
+
borderColor: themeTools.mode("blackAlpha.300", "whiteAlpha.300")(props)
|
13615
|
+
}),
|
13616
|
+
variants: {
|
13617
|
+
solid: {
|
13618
|
+
borderStyle: "solid"
|
13619
|
+
},
|
13620
|
+
dashed: (props) => ({
|
13621
|
+
backgroundImage: `repeating-linear-gradient(90deg, ${themeTools.mode("blackAlpha.300", "whiteAlpha.300")(props)}, ${themeTools.mode("blackAlpha.300", "whiteAlpha.300")(props)} 4px, transparent 4px, transparent 10px)`,
|
13622
|
+
backgroundPosition: "left bottom",
|
13623
|
+
backgroundRepeat: "repeat-x",
|
13624
|
+
backgroundSize: "100% 3px",
|
13625
|
+
borderRadius: props.size === "sm" ? "0.5px" : props.size === "md" ? "1px" : "1.5px"
|
13626
|
+
})
|
13619
13627
|
},
|
13620
|
-
|
13621
|
-
|
13622
|
-
|
13628
|
+
sizes: {
|
13629
|
+
sm: (props) => ({
|
13630
|
+
borderWidth: isSolid(props) ? "1px" : void 0,
|
13631
|
+
borderRadius: isSolid(props) ? "0.5px" : void 0,
|
13632
|
+
height: isDashed(props) ? "1px" : void 0
|
13633
|
+
}),
|
13634
|
+
md: (props) => ({
|
13635
|
+
borderWidth: isSolid(props) ? "2px" : void 0,
|
13636
|
+
borderRadius: isSolid(props) ? "1px" : "10px",
|
13637
|
+
height: isDashed(props) ? "2px" : void 0
|
13638
|
+
}),
|
13639
|
+
lg: (props) => ({
|
13640
|
+
borderWidth: isSolid(props) ? "3px" : void 0,
|
13641
|
+
borderRadius: isSolid(props) ? "1.5px" : void 0,
|
13642
|
+
height: isDashed(props) ? "3px" : void 0
|
13643
|
+
})
|
13623
13644
|
},
|
13624
|
-
lg: {
|
13625
|
-
borderWidth: "3px",
|
13626
|
-
borderRadius: "1.5px"
|
13627
|
-
}
|
13628
|
-
};
|
13629
|
-
divider_default = defineStyleConfig({
|
13630
|
-
baseStyle: baseStyle43,
|
13631
|
-
variants: variants14,
|
13632
|
-
sizes: sizes25,
|
13633
13645
|
defaultProps: {
|
13634
13646
|
variant: "solid",
|
13635
13647
|
size: "md"
|
@@ -14671,13 +14683,13 @@ var init_link2 = __esm({
|
|
14671
14683
|
});
|
14672
14684
|
|
14673
14685
|
// src/theme/components/list.ts
|
14674
|
-
var defineMultiStyleConfig28, definePartsStyle28,
|
14686
|
+
var defineMultiStyleConfig28, definePartsStyle28, baseStyle43, list_default;
|
14675
14687
|
var init_list2 = __esm({
|
14676
14688
|
"src/theme/components/list.ts"() {
|
14677
14689
|
init_dist4();
|
14678
14690
|
init_dist3();
|
14679
14691
|
({ defineMultiStyleConfig: defineMultiStyleConfig28, definePartsStyle: definePartsStyle28 } = createMultiStyleConfigHelpers(listAnatomy.keys));
|
14680
|
-
|
14692
|
+
baseStyle43 = definePartsStyle28({
|
14681
14693
|
container: {
|
14682
14694
|
fontSize: ["mobile.sm", "desktop.sm"]
|
14683
14695
|
},
|
@@ -14691,7 +14703,7 @@ var init_list2 = __esm({
|
|
14691
14703
|
}
|
14692
14704
|
});
|
14693
14705
|
list_default = defineMultiStyleConfig28({
|
14694
|
-
baseStyle:
|
14706
|
+
baseStyle: baseStyle43
|
14695
14707
|
});
|
14696
14708
|
}
|
14697
14709
|
});
|
@@ -15200,19 +15212,16 @@ var init_progress_bar = __esm({
|
|
15200
15212
|
},
|
15201
15213
|
background: {
|
15202
15214
|
display: "flex",
|
15203
|
-
backgroundColor: themeTools.mode(
|
15215
|
+
backgroundColor: props.isActive ? themeTools.mode(
|
15204
15216
|
"brand.surface.default.dark",
|
15205
15217
|
"brand.surface.default.light"
|
15206
|
-
)(props),
|
15218
|
+
)(props) : void 0,
|
15207
15219
|
borderRadius: "sm",
|
15208
15220
|
justifyContent: "flex-start",
|
15209
15221
|
marginX: "auto"
|
15210
15222
|
},
|
15211
15223
|
progress: {
|
15212
|
-
backgroundColor: themeTools.mode(
|
15213
|
-
"brand.surface.active.light",
|
15214
|
-
"brand.surface.active.dark"
|
15215
|
-
)(props),
|
15224
|
+
backgroundColor: props.isActive ? themeTools.mode("brand.surface.active.light", "brand.surface.active.dark")(props) : themeTools.mode("icon.disabled.light", "icon.disabled.dark")(props),
|
15216
15225
|
borderRadius: "sm",
|
15217
15226
|
maxWidth: "100%",
|
15218
15227
|
transition: "width .2s ease-out"
|
@@ -16760,17 +16769,17 @@ function useSizes({
|
|
16760
16769
|
getNodes,
|
16761
16770
|
observeMutation = true
|
16762
16771
|
}) {
|
16763
|
-
const [
|
16772
|
+
const [sizes25, setSizes] = React86.useState([]);
|
16764
16773
|
const [count, setCount] = React86.useState(0);
|
16765
16774
|
useSafeLayoutEffect(() => {
|
16766
16775
|
const elements = getNodes();
|
16767
16776
|
const cleanups = elements.map(
|
16768
16777
|
(element, index) => trackElementSize(element, (size2) => {
|
16769
|
-
setSizes((
|
16778
|
+
setSizes((sizes26) => {
|
16770
16779
|
return [
|
16771
|
-
...
|
16780
|
+
...sizes26.slice(0, index),
|
16772
16781
|
size2,
|
16773
|
-
...
|
16782
|
+
...sizes26.slice(index + 1)
|
16774
16783
|
];
|
16775
16784
|
});
|
16776
16785
|
})
|
@@ -16789,7 +16798,7 @@ function useSizes({
|
|
16789
16798
|
});
|
16790
16799
|
};
|
16791
16800
|
}, [count]);
|
16792
|
-
return
|
16801
|
+
return sizes25;
|
16793
16802
|
}
|
16794
16803
|
function isRef(ref) {
|
16795
16804
|
return typeof ref === "object" && ref !== null && "current" in ref;
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, CardSelect, CargonetLogo, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, FullScreenDrawer, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, Pagination, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, RadioGroup, ScaleFade, SearchInput, Section, ServiceAlert, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, StaticCard, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, VyLogoPride, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-
|
1
|
+
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, CardSelect, CargonetLogo, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, FullScreenDrawer, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, Pagination, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, RadioGroup, ScaleFade, SearchInput, Section, ServiceAlert, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, StaticCard, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, VyLogoPride, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-Q3JX25BX.mjs';
|
package/package.json
CHANGED
@@ -31,6 +31,9 @@ type ProgressBarProps = BoxProps & {
|
|
31
31
|
* Defaults to 5000 (5 seconds).
|
32
32
|
*/
|
33
33
|
labelRotationDelay?: number;
|
34
|
+
|
35
|
+
/** Pass to disable the color of the component */
|
36
|
+
isActive?: boolean;
|
34
37
|
};
|
35
38
|
|
36
39
|
/**
|
@@ -67,6 +70,7 @@ export const ProgressBar = ({
|
|
67
70
|
height = "0.5rem",
|
68
71
|
width = "100%",
|
69
72
|
"aria-label": ariaLabel,
|
73
|
+
isActive = true,
|
70
74
|
...rest
|
71
75
|
}: ProgressBarProps) => {
|
72
76
|
const { t } = useTranslation();
|
@@ -79,7 +83,7 @@ export const ProgressBar = ({
|
|
79
83
|
value,
|
80
84
|
"aria-label": ariaLabel || t(texts.label(value)),
|
81
85
|
});
|
82
|
-
const styles = useMultiStyleConfig("ProgressBar", {});
|
86
|
+
const styles = useMultiStyleConfig("ProgressBar", { isActive });
|
83
87
|
return (
|
84
88
|
<>
|
85
89
|
<Box
|
@@ -89,7 +93,11 @@ export const ProgressBar = ({
|
|
89
93
|
{...rest}
|
90
94
|
>
|
91
95
|
<Box width={width} __css={styles.background}>
|
92
|
-
<Box
|
96
|
+
<Box
|
97
|
+
__css={styles.progress}
|
98
|
+
height={height}
|
99
|
+
width={isActive ? `${value}%` : "100%"}
|
100
|
+
/>
|
93
101
|
</Box>
|
94
102
|
{currentLoadingText && (
|
95
103
|
<Text sx={styles.description} {...labelProps}>
|
@@ -1,42 +1,43 @@
|
|
1
|
-
import {
|
2
|
-
import { mode } from "@chakra-ui/theme-tools";
|
1
|
+
import { defineStyleConfig } from "@chakra-ui/styled-system";
|
2
|
+
import { mode, StyleFunctionProps } from "@chakra-ui/theme-tools";
|
3
3
|
|
4
|
-
const
|
5
|
-
|
6
|
-
}));
|
4
|
+
const isSolid = (props: StyleFunctionProps) => props.variant === "solid";
|
5
|
+
const isDashed = (props: StyleFunctionProps) => props.variant === "dashed";
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
borderRadius: "0.5px",
|
25
|
-
},
|
26
|
-
md: {
|
27
|
-
borderWidth: "2px",
|
28
|
-
borderRadius: "1px",
|
7
|
+
export default defineStyleConfig({
|
8
|
+
baseStyle: (props) => ({
|
9
|
+
borderColor: mode("blackAlpha.300", "whiteAlpha.300")(props),
|
10
|
+
}),
|
11
|
+
variants: {
|
12
|
+
solid: {
|
13
|
+
borderStyle: "solid",
|
14
|
+
},
|
15
|
+
dashed: (props) => ({
|
16
|
+
backgroundImage: `repeating-linear-gradient(90deg, ${mode("blackAlpha.300", "whiteAlpha.300")(props)}, ${mode("blackAlpha.300", "whiteAlpha.300")(props)} 4px, transparent 4px, transparent 10px)`,
|
17
|
+
backgroundPosition: "left bottom",
|
18
|
+
backgroundRepeat: "repeat-x",
|
19
|
+
backgroundSize: "100% 3px",
|
20
|
+
borderRadius:
|
21
|
+
props.size === "sm" ? "0.5px" : props.size === "md" ? "1px" : "1.5px",
|
22
|
+
}),
|
29
23
|
},
|
30
|
-
|
31
|
-
|
32
|
-
|
24
|
+
sizes: {
|
25
|
+
sm: (props) => ({
|
26
|
+
borderWidth: isSolid(props) ? "1px" : undefined,
|
27
|
+
borderRadius: isSolid(props) ? "0.5px" : undefined,
|
28
|
+
height: isDashed(props) ? "1px" : undefined,
|
29
|
+
}),
|
30
|
+
md: (props) => ({
|
31
|
+
borderWidth: isSolid(props) ? "2px" : undefined,
|
32
|
+
borderRadius: isSolid(props) ? "1px" : "10px",
|
33
|
+
height: isDashed(props) ? "2px" : undefined,
|
34
|
+
}),
|
35
|
+
lg: (props) => ({
|
36
|
+
borderWidth: isSolid(props) ? "3px" : undefined,
|
37
|
+
borderRadius: isSolid(props) ? "1.5px" : undefined,
|
38
|
+
height: isDashed(props) ? "3px" : undefined,
|
39
|
+
}),
|
33
40
|
},
|
34
|
-
};
|
35
|
-
|
36
|
-
export default defineStyleConfig({
|
37
|
-
baseStyle,
|
38
|
-
variants,
|
39
|
-
sizes,
|
40
41
|
defaultProps: {
|
41
42
|
variant: "solid",
|
42
43
|
size: "md",
|
@@ -17,19 +17,20 @@ const config = helpers.defineMultiStyleConfig({
|
|
17
17
|
},
|
18
18
|
background: {
|
19
19
|
display: "flex",
|
20
|
-
backgroundColor:
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
backgroundColor: props.isActive
|
21
|
+
? mode(
|
22
|
+
"brand.surface.default.dark",
|
23
|
+
"brand.surface.default.light",
|
24
|
+
)(props)
|
25
|
+
: undefined,
|
24
26
|
borderRadius: "sm",
|
25
27
|
justifyContent: "flex-start",
|
26
28
|
marginX: "auto",
|
27
29
|
},
|
28
30
|
progress: {
|
29
|
-
backgroundColor:
|
30
|
-
"brand.surface.active.light",
|
31
|
-
"
|
32
|
-
)(props),
|
31
|
+
backgroundColor: props.isActive
|
32
|
+
? mode("brand.surface.active.light", "brand.surface.active.dark")(props)
|
33
|
+
: mode("icon.disabled.light", "icon.disabled.dark")(props),
|
33
34
|
borderRadius: "sm",
|
34
35
|
maxWidth: "100%",
|
35
36
|
transition: "width .2s ease-out",
|