fis-component 0.0.28 → 0.0.31
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/index.js +192 -150
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/IconButton/IconButton.stories.d.ts +4 -0
- package/dist/cjs/types/src/components/IconButton/index.d.ts +4 -0
- package/dist/cjs/types/src/components/IconButton/styles.d.ts +1 -0
- package/dist/esm/index.js +192 -150
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/IconButton/IconButton.stories.d.ts +4 -0
- package/dist/esm/types/src/components/IconButton/index.d.ts +4 -0
- package/dist/esm/types/src/components/IconButton/styles.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/package.json +4 -2
- package/src/styles/design-system/index.ts +4 -0
- package/src/styles/design-system/variable.ts +3329 -0
- package/src/styles/fonts.css +40 -0
- package/dist/cjs/types/src/styles-entry.d.ts +0 -1
- package/dist/esm/types/src/styles-entry.d.ts +0 -1
- package/dist/styles-entry.css +0 -1
- package/dist/styles-entry.js +0 -2
- package/dist/styles-entry.js.map +0 -1
|
@@ -12,6 +12,10 @@ export interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
|
|
|
12
12
|
icon?: ReactNode;
|
|
13
13
|
/** whether the button should be active */
|
|
14
14
|
active?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Defines if the button is currently being requested.
|
|
17
|
+
*/
|
|
18
|
+
loading?: boolean;
|
|
15
19
|
}
|
|
16
20
|
declare const FISIconButton: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
21
|
export default FISIconButton;
|
|
@@ -3,6 +3,7 @@ interface ButtonProps {
|
|
|
3
3
|
$variant: ButtonVariant;
|
|
4
4
|
$size: ButtonSize;
|
|
5
5
|
$active: boolean;
|
|
6
|
+
$loading?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const ButtonStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ButtonProps>> & string;
|
|
8
9
|
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -62213,6 +62213,7 @@ const ButtonStyled = dt.button `
|
|
|
62213
62213
|
align-items: center;
|
|
62214
62214
|
border: none;
|
|
62215
62215
|
padding: 0;
|
|
62216
|
+
position: relative;
|
|
62216
62217
|
|
|
62217
62218
|
&:hover {
|
|
62218
62219
|
cursor: pointer;
|
|
@@ -62310,6 +62311,11 @@ const ButtonStyled = dt.button `
|
|
|
62310
62311
|
background-color: ${getTheme("com/button/disable/background-color")};
|
|
62311
62312
|
color: ${getTheme("com/button/disable/icon-color")} !important;
|
|
62312
62313
|
}
|
|
62314
|
+
|
|
62315
|
+
${props.$loading &&
|
|
62316
|
+
lt `
|
|
62317
|
+
background-color: ${getTheme("com/button/disable/background-color")} !important;
|
|
62318
|
+
`}
|
|
62313
62319
|
`;
|
|
62314
62320
|
case "secondary":
|
|
62315
62321
|
return lt `
|
|
@@ -62345,6 +62351,12 @@ const ButtonStyled = dt.button `
|
|
|
62345
62351
|
border-color: ${getTheme("com/button/disable/stroke-color")};
|
|
62346
62352
|
color: ${getTheme("com/button/disable/icon-color")} !important;
|
|
62347
62353
|
}
|
|
62354
|
+
|
|
62355
|
+
${props.$loading &&
|
|
62356
|
+
lt `
|
|
62357
|
+
background-color: ${getTheme("com/button/disable/background-color")} !important;
|
|
62358
|
+
border-color: ${getTheme("com/button/disable/stroke-color")} !important;
|
|
62359
|
+
`}
|
|
62348
62360
|
`;
|
|
62349
62361
|
case "secondary-invisible":
|
|
62350
62362
|
return lt `
|
|
@@ -62408,6 +62420,12 @@ const ButtonStyled = dt.button `
|
|
|
62408
62420
|
border-color: ${getTheme("com/button/disable/stroke-color")};
|
|
62409
62421
|
color: ${getTheme("com/button/disable/icon-color")} !important;
|
|
62410
62422
|
}
|
|
62423
|
+
|
|
62424
|
+
${props.$loading &&
|
|
62425
|
+
lt `
|
|
62426
|
+
background-color: ${getTheme("com/button/disable/background-color")} !important;
|
|
62427
|
+
border-color: ${getTheme("com/button/disable/stroke-color")} !important;
|
|
62428
|
+
`}
|
|
62411
62429
|
`;
|
|
62412
62430
|
case "tertiary-invisible":
|
|
62413
62431
|
return lt `
|
|
@@ -62465,6 +62483,11 @@ const ButtonStyled = dt.button `
|
|
|
62465
62483
|
background-color: ${getTheme("com/button/disable/background-color")};
|
|
62466
62484
|
color: ${getTheme("com/button/disable/icon-color")} !important;
|
|
62467
62485
|
}
|
|
62486
|
+
|
|
62487
|
+
${props.$loading &&
|
|
62488
|
+
lt `
|
|
62489
|
+
background-color: ${getTheme("com/button/disable/background-color")} !important;
|
|
62490
|
+
`}
|
|
62468
62491
|
`;
|
|
62469
62492
|
case "secondary-negative":
|
|
62470
62493
|
return lt `
|
|
@@ -62501,6 +62524,12 @@ const ButtonStyled = dt.button `
|
|
|
62501
62524
|
border-color: ${getTheme("com/button/disable/stroke-color")};
|
|
62502
62525
|
color: ${getTheme("com/button/disable/icon-color")} !important;
|
|
62503
62526
|
}
|
|
62527
|
+
|
|
62528
|
+
${props.$loading &&
|
|
62529
|
+
lt `
|
|
62530
|
+
background-color: ${getTheme("com/button/disable/background-color")} !important;
|
|
62531
|
+
border-color: ${getTheme("com/button/disable/stroke-color")} !important;
|
|
62532
|
+
`}
|
|
62504
62533
|
`;
|
|
62505
62534
|
case "secondary-invisible-negative":
|
|
62506
62535
|
return lt `
|
|
@@ -62559,6 +62588,11 @@ const ButtonStyled = dt.button `
|
|
|
62559
62588
|
background-color: ${getTheme("com/button/disable-invert/solid-background-color")};
|
|
62560
62589
|
color: ${getTheme("com/button/disable-invert/icon-color")} !important;
|
|
62561
62590
|
}
|
|
62591
|
+
|
|
62592
|
+
${props.$loading &&
|
|
62593
|
+
lt `
|
|
62594
|
+
background-color: ${getTheme("com/button/disable-invert/solid-background-color")} !important;
|
|
62595
|
+
`}
|
|
62562
62596
|
`;
|
|
62563
62597
|
case "secondary-white":
|
|
62564
62598
|
return lt `
|
|
@@ -62596,6 +62630,12 @@ const ButtonStyled = dt.button `
|
|
|
62596
62630
|
border-color: ${getTheme("com/button/disable-invert/stroke-color")};
|
|
62597
62631
|
color: ${getTheme("com/button/disable-invert/icon-color")} !important;
|
|
62598
62632
|
}
|
|
62633
|
+
|
|
62634
|
+
${props.$loading &&
|
|
62635
|
+
lt `
|
|
62636
|
+
background-color: ${getTheme("com/button/disable-invert/background-color-transparent")} !important;
|
|
62637
|
+
border-color: ${getTheme("com/button/disable-invert/stroke-color")} !important;
|
|
62638
|
+
`}
|
|
62599
62639
|
`;
|
|
62600
62640
|
case "secondary-invisible-white":
|
|
62601
62641
|
return lt `
|
|
@@ -62637,9 +62677,150 @@ const ButtonStyled = dt.button `
|
|
|
62637
62677
|
}}
|
|
62638
62678
|
`;
|
|
62639
62679
|
|
|
62680
|
+
const circleKeyframe = mt `
|
|
62681
|
+
0% {
|
|
62682
|
+
transform: rotate(0deg);
|
|
62683
|
+
}
|
|
62684
|
+
100% {
|
|
62685
|
+
transform: rotate(360deg);
|
|
62686
|
+
}`;
|
|
62687
|
+
const getSizeProgressCircle = (size) => {
|
|
62688
|
+
switch (size) {
|
|
62689
|
+
case "xs":
|
|
62690
|
+
return lt `
|
|
62691
|
+
width: ${getTheme("com/progress-indicator/circular/size-xs/width")};
|
|
62692
|
+
height: ${getTheme("com/progress-indicator/circular/size-xs/width")};
|
|
62693
|
+
`;
|
|
62694
|
+
case "sm":
|
|
62695
|
+
return lt `
|
|
62696
|
+
width: ${getTheme("com/progress-indicator/circular/size-sm/width")};
|
|
62697
|
+
height: ${getTheme("com/progress-indicator/circular/size-sm/width")};
|
|
62698
|
+
`;
|
|
62699
|
+
case "md":
|
|
62700
|
+
return lt `
|
|
62701
|
+
width: ${getTheme("com/progress-indicator/circular/size-md/width")};
|
|
62702
|
+
height: ${getTheme("com/progress-indicator/circular/size-md/width")};
|
|
62703
|
+
`;
|
|
62704
|
+
default:
|
|
62705
|
+
return lt `
|
|
62706
|
+
width: ${getTheme("com/progress-indicator/circular/size-lg/width")};
|
|
62707
|
+
height: ${getTheme("com/progress-indicator/circular/size-lg/width")};
|
|
62708
|
+
`;
|
|
62709
|
+
}
|
|
62710
|
+
};
|
|
62711
|
+
const circularIndeterminateLeadColor = (invert) => invert
|
|
62712
|
+
? getTheme("com/progress-indicator/invert/indicator/lead-color")
|
|
62713
|
+
: getTheme("com/progress-indicator/default/indicator/lead-color");
|
|
62714
|
+
const circularIndeterminateTrailColor = (invert) => invert
|
|
62715
|
+
? getTheme("com/progress-indicator/invert/indicator/trail-color")
|
|
62716
|
+
: getTheme("com/progress-indicator/default/indicator/trail-color");
|
|
62717
|
+
const DivIndeterminateWrapperSC = dt.svg `
|
|
62718
|
+
${({ $size }) => getSizeProgressCircle($size)}
|
|
62719
|
+
|
|
62720
|
+
.indicator {
|
|
62721
|
+
${({ $invert }) => lt `
|
|
62722
|
+
background: conic-gradient(
|
|
62723
|
+
from 82.72deg at 50% 48.91%,
|
|
62724
|
+
${circularIndeterminateTrailColor($invert)} -3.6deg,
|
|
62725
|
+
${circularIndeterminateLeadColor($invert)} 252deg,
|
|
62726
|
+
${circularIndeterminateTrailColor($invert)} 356.4deg,
|
|
62727
|
+
${circularIndeterminateLeadColor($invert)} 612deg
|
|
62728
|
+
);
|
|
62729
|
+
`}
|
|
62730
|
+
}
|
|
62731
|
+
|
|
62732
|
+
animation: ${circleKeyframe} 0.5s linear infinite;
|
|
62733
|
+
`;
|
|
62734
|
+
const SvgDeterminateSC = dt.svg `
|
|
62735
|
+
transform: rotate(-90deg);
|
|
62736
|
+
`;
|
|
62737
|
+
const SvgDeterminateWrapperSC = dt.div `
|
|
62738
|
+
position: relative;
|
|
62739
|
+
width: ${({ $size }) => $size};
|
|
62740
|
+
height: ${({ $size }) => $size};
|
|
62741
|
+
display: flex;
|
|
62742
|
+
justify-content: center;
|
|
62743
|
+
align-items: center;
|
|
62744
|
+
`;
|
|
62745
|
+
const CircleDeterminateSC = dt.circle `
|
|
62746
|
+
fill: none;
|
|
62747
|
+
stroke-linecap: round;
|
|
62748
|
+
transition: stroke-dashoffset 0.35s ease;
|
|
62749
|
+
`;
|
|
62750
|
+
|
|
62751
|
+
const NUMBER_REGEX = /^\d+/;
|
|
62752
|
+
|
|
62753
|
+
const extractNumberFromThemeValue = (value, defaultValue = 0) => {
|
|
62754
|
+
if (typeof value !== "string") {
|
|
62755
|
+
return defaultValue;
|
|
62756
|
+
}
|
|
62757
|
+
const match = value.match(NUMBER_REGEX);
|
|
62758
|
+
const number = Number(match?.[0]);
|
|
62759
|
+
if (isNaN(number)) {
|
|
62760
|
+
return defaultValue;
|
|
62761
|
+
}
|
|
62762
|
+
return number;
|
|
62763
|
+
};
|
|
62764
|
+
const clamp = (value, min, max) => {
|
|
62765
|
+
return Math.min(Math.max(value, min), max);
|
|
62766
|
+
};
|
|
62767
|
+
|
|
62768
|
+
const ProgressCircularDeterminate = ({ percent: percentProp = 0, size: sizeProp = "md", invert = false, className, }) => {
|
|
62769
|
+
const theme = nt();
|
|
62770
|
+
const percent = useMemo$1(() => clamp(percentProp, 0, 100), [percentProp]);
|
|
62771
|
+
const { size, strokeWidth, radius, circumference } = useMemo$1(() => {
|
|
62772
|
+
const sizeValue = extractNumberFromThemeValue(theme?.[`com/progress-indicator/circular/size-${sizeProp}/indicator/indicator`], 0);
|
|
62773
|
+
const strokeWidthValue = extractNumberFromThemeValue(theme?.[`com/progress-indicator/circular/size-${sizeProp}/indicator/stroke-width`], 0);
|
|
62774
|
+
const validSize = Math.max(0, sizeValue);
|
|
62775
|
+
const validStrokeWidth = Math.max(0, strokeWidthValue);
|
|
62776
|
+
const calculatedRadius = (validSize - validStrokeWidth) / 2;
|
|
62777
|
+
const calculatedCircumference = 2 * Math.PI * Math.max(0, calculatedRadius);
|
|
62778
|
+
return {
|
|
62779
|
+
size: validSize,
|
|
62780
|
+
strokeWidth: validStrokeWidth,
|
|
62781
|
+
radius: Math.max(0, calculatedRadius),
|
|
62782
|
+
circumference: calculatedCircumference,
|
|
62783
|
+
};
|
|
62784
|
+
}, [sizeProp, theme]);
|
|
62785
|
+
const offset = useMemo$1(() => {
|
|
62786
|
+
if (circumference <= 0)
|
|
62787
|
+
return 0;
|
|
62788
|
+
return circumference - (percent / 100) * circumference;
|
|
62789
|
+
}, [percent, circumference]);
|
|
62790
|
+
const wrapperSize = theme[`com/progress-indicator/circular/size-${sizeProp}/width`];
|
|
62791
|
+
const backgroundColor = invert
|
|
62792
|
+
? theme["com/progress-indicator/invert/background-color"]
|
|
62793
|
+
: theme["com/progress-indicator/default/background-color"];
|
|
62794
|
+
const leadColor = invert
|
|
62795
|
+
? theme["com/progress-indicator/invert/indicator/lead-color"]
|
|
62796
|
+
: theme["com/progress-indicator/default/indicator/lead-color"];
|
|
62797
|
+
if (size <= 0 || radius <= 0) {
|
|
62798
|
+
return null;
|
|
62799
|
+
}
|
|
62800
|
+
return (jsx(SvgDeterminateWrapperSC, { "$size": wrapperSize, className: className, children: jsxs(SvgDeterminateSC, { width: size, height: size, viewBox: `0 0 ${size} ${size}`, "aria-valuenow": percent, role: "progressbar", children: [jsx(CircleDeterminateSC, { cx: size / 2, cy: size / 2, r: radius, stroke: backgroundColor, strokeWidth: strokeWidth, fill: "none" }), jsx(CircleDeterminateSC, { cx: size / 2, cy: size / 2, r: radius, stroke: leadColor, strokeWidth: strokeWidth, strokeDasharray: circumference, strokeDashoffset: offset, fill: "none" })] }) }));
|
|
62801
|
+
};
|
|
62802
|
+
|
|
62803
|
+
function ProgressCircularIndeterminate({ size = "md", invert = false, className, }) {
|
|
62804
|
+
return (jsxs(DivIndeterminateWrapperSC, { viewBox: "0 0 44 44", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, "$invert": invert, "$size": size, children: [jsx("g", { clipPath: "url(#paint0_angular_9600_49736_clip_path)", "data-figma-skip-parse": "true", children: jsx("g", { transform: "matrix(0.00190748 0.0149333 -0.0152598 0.00186667 22.3061 22)", children: jsx("foreignObject", { x: -1186.46, y: -1186.46, width: 2372.92, height: 2372.92, children: jsx("div", { className: "indicator", style: {
|
|
62805
|
+
height: "100%",
|
|
62806
|
+
width: "100%",
|
|
62807
|
+
opacity: 1,
|
|
62808
|
+
} }) }) }) }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M34.7639 19.8789C33.8246 20.1776 32.8157 19.6745 32.5105 18.7553C31.899 16.9137 30.7791 15.2734 29.2744 14.0157C27.7697 12.7581 25.939 11.9322 23.9846 11.6293C22.0302 11.3264 20.0282 11.5582 18.2001 12.2993C16.3719 13.0403 14.7888 14.2617 13.6257 15.8283C12.4626 17.3949 11.7649 19.2457 11.6096 21.1762C11.4544 23.1066 11.8476 25.0415 12.746 26.7669C13.6443 28.4923 15.0127 29.9409 16.6999 30.9527C18.3871 31.9645 20.3273 32.5 22.3061 32.5C23.2937 32.5 24.0944 33.2835 24.0944 34.25C24.0944 35.2165 23.2937 36 22.3061 36C19.6677 36 17.0808 35.286 14.8312 33.937C12.5816 32.5879 10.7571 30.6564 9.55928 28.3559C8.36149 26.0554 7.8371 23.4755 8.04411 20.9016C8.25111 18.3276 9.18144 15.8598 10.7322 13.771C12.283 11.6822 14.3939 10.0537 16.8314 9.06569C19.2689 8.07764 21.9382 7.76847 24.5441 8.17237C27.1499 8.57627 29.5909 9.6775 31.5972 11.3543C33.6034 13.0311 35.0967 15.2182 35.912 17.6738C36.2172 18.593 35.7032 19.5802 34.7639 19.8789Z", "data-figma-gradient-fill": "{\"type\":\"GRADIENT_ANGULAR\",\"stops\":[{\"color\":{\"r\":0.18431372940540314,\"g\":0.23529411852359772,\"b\":0.75686275959014893,\"a\":1.0},\"position\":0.750},{\"color\":{\"r\":1.0,\"g\":1.0,\"b\":1.0,\"a\":0.10999999940395355},\"position\":0.89999997615814209}],\"stopsVar\":[{\"color\":{\"r\":0.18431372940540314,\"g\":0.23529411852359772,\"b\":0.75686275959014893,\"a\":1.0},\"position\":0.750},{\"color\":{\"r\":1.0,\"g\":1.0,\"b\":1.0,\"a\":0.10999999940395355},\"position\":0.89999997615814209}],\"transform\":{\"m00\":3.8149569034576416,\"m01\":-30.519655227661133,\"m02\":35.658443450927734,\"m10\":29.866659164428711,\"m11\":3.7333323955535889,\"m12\":5.2000064849853516},\"opacity\":1.0,\"blendMode\":\"NORMAL\",\"visible\":true}" }), jsx("defs", { children: jsx("clipPath", { id: "paint0_angular_9600_49736_clip_path", children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M34.7639 19.8789C33.8246 20.1776 32.8157 19.6745 32.5105 18.7553C31.899 16.9137 30.7791 15.2734 29.2744 14.0157C27.7697 12.7581 25.939 11.9322 23.9846 11.6293C22.0302 11.3264 20.0282 11.5582 18.2001 12.2993C16.3719 13.0403 14.7888 14.2617 13.6257 15.8283C12.4626 17.3949 11.7649 19.2457 11.6096 21.1762C11.4544 23.1066 11.8476 25.0415 12.746 26.7669C13.6443 28.4923 15.0127 29.9409 16.6999 30.9527C18.3871 31.9645 20.3273 32.5 22.3061 32.5C23.2937 32.5 24.0944 33.2835 24.0944 34.25C24.0944 35.2165 23.2937 36 22.3061 36C19.6677 36 17.0808 35.286 14.8312 33.937C12.5816 32.5879 10.7571 30.6564 9.55928 28.3559C8.36149 26.0554 7.8371 23.4755 8.04411 20.9016C8.25111 18.3276 9.18144 15.8598 10.7322 13.771C12.283 11.6822 14.3939 10.0537 16.8314 9.06569C19.2689 8.07764 21.9382 7.76847 24.5441 8.17237C27.1499 8.57627 29.5909 9.6775 31.5972 11.3543C33.6034 13.0311 35.0967 15.2182 35.912 17.6738C36.2172 18.593 35.7032 19.5802 34.7639 19.8789Z" }) }) })] }));
|
|
62809
|
+
}
|
|
62810
|
+
|
|
62811
|
+
function FISProgressCircular({ variant, ...rest }) {
|
|
62812
|
+
if (variant === "determinate") {
|
|
62813
|
+
return jsx(ProgressCircularDeterminate, { ...rest });
|
|
62814
|
+
}
|
|
62815
|
+
return jsx(ProgressCircularIndeterminate, { ...rest });
|
|
62816
|
+
}
|
|
62817
|
+
FISProgressCircular.displayName = "FISProgressCircular";
|
|
62818
|
+
|
|
62640
62819
|
const FISIconButton = forwardRef((props, ref) => {
|
|
62641
|
-
const { type, children, active = false, size = "md", variant = "primary", icon: iconProp, ...rest } = props;
|
|
62642
|
-
return (jsx(ButtonStyled, { ...rest, ref: ref, "$variant": variant, "$size": size, "$active": active, children:
|
|
62820
|
+
const { type, children, active = false, size = "md", variant = "primary", icon: iconProp, loading = false, disabled = false, ...rest } = props;
|
|
62821
|
+
return (jsx(ButtonStyled, { ...rest, ref: ref, "$variant": variant, "$size": size, "$active": active, "$loading": loading, disabled: disabled || loading, children: loading ? (jsx(FISProgressCircular, { size: size, variant: "indeterminate", invert: variant === "primary-white" ||
|
|
62822
|
+
variant === "secondary-white" ||
|
|
62823
|
+
variant === "secondary-invisible-white" })) : (iconProp) }));
|
|
62643
62824
|
});
|
|
62644
62825
|
FISIconButton.displayName = "FISIconButton";
|
|
62645
62826
|
|
|
@@ -62950,145 +63131,6 @@ const ToastWrapper = dt.div `
|
|
|
62950
63131
|
gap: 10px;
|
|
62951
63132
|
`;
|
|
62952
63133
|
|
|
62953
|
-
const circleKeyframe = mt `
|
|
62954
|
-
0% {
|
|
62955
|
-
transform: rotate(0deg);
|
|
62956
|
-
}
|
|
62957
|
-
100% {
|
|
62958
|
-
transform: rotate(360deg);
|
|
62959
|
-
}`;
|
|
62960
|
-
const getSizeProgressCircle = (size) => {
|
|
62961
|
-
switch (size) {
|
|
62962
|
-
case "xs":
|
|
62963
|
-
return lt `
|
|
62964
|
-
width: ${getTheme("com/progress-indicator/circular/size-xs/width")};
|
|
62965
|
-
height: ${getTheme("com/progress-indicator/circular/size-xs/width")};
|
|
62966
|
-
`;
|
|
62967
|
-
case "sm":
|
|
62968
|
-
return lt `
|
|
62969
|
-
width: ${getTheme("com/progress-indicator/circular/size-sm/width")};
|
|
62970
|
-
height: ${getTheme("com/progress-indicator/circular/size-sm/width")};
|
|
62971
|
-
`;
|
|
62972
|
-
case "md":
|
|
62973
|
-
return lt `
|
|
62974
|
-
width: ${getTheme("com/progress-indicator/circular/size-md/width")};
|
|
62975
|
-
height: ${getTheme("com/progress-indicator/circular/size-md/width")};
|
|
62976
|
-
`;
|
|
62977
|
-
default:
|
|
62978
|
-
return lt `
|
|
62979
|
-
width: ${getTheme("com/progress-indicator/circular/size-lg/width")};
|
|
62980
|
-
height: ${getTheme("com/progress-indicator/circular/size-lg/width")};
|
|
62981
|
-
`;
|
|
62982
|
-
}
|
|
62983
|
-
};
|
|
62984
|
-
const circularIndeterminateLeadColor = (invert) => invert
|
|
62985
|
-
? getTheme("com/progress-indicator/invert/indicator/lead-color")
|
|
62986
|
-
: getTheme("com/progress-indicator/default/indicator/lead-color");
|
|
62987
|
-
const circularIndeterminateTrailColor = (invert) => invert
|
|
62988
|
-
? getTheme("com/progress-indicator/invert/indicator/trail-color")
|
|
62989
|
-
: getTheme("com/progress-indicator/default/indicator/trail-color");
|
|
62990
|
-
const DivIndeterminateWrapperSC = dt.svg `
|
|
62991
|
-
${({ $size }) => getSizeProgressCircle($size)}
|
|
62992
|
-
|
|
62993
|
-
.indicator {
|
|
62994
|
-
${({ $invert }) => lt `
|
|
62995
|
-
background: conic-gradient(
|
|
62996
|
-
from 82.72deg at 50% 48.91%,
|
|
62997
|
-
${circularIndeterminateTrailColor($invert)} -3.6deg,
|
|
62998
|
-
${circularIndeterminateLeadColor($invert)} 252deg,
|
|
62999
|
-
${circularIndeterminateTrailColor($invert)} 356.4deg,
|
|
63000
|
-
${circularIndeterminateLeadColor($invert)} 612deg
|
|
63001
|
-
);
|
|
63002
|
-
`}
|
|
63003
|
-
}
|
|
63004
|
-
|
|
63005
|
-
animation: ${circleKeyframe} 0.5s linear infinite;
|
|
63006
|
-
`;
|
|
63007
|
-
const SvgDeterminateSC = dt.svg `
|
|
63008
|
-
transform: rotate(-90deg);
|
|
63009
|
-
`;
|
|
63010
|
-
const SvgDeterminateWrapperSC = dt.div `
|
|
63011
|
-
position: relative;
|
|
63012
|
-
width: ${({ $size }) => $size};
|
|
63013
|
-
height: ${({ $size }) => $size};
|
|
63014
|
-
display: flex;
|
|
63015
|
-
justify-content: center;
|
|
63016
|
-
align-items: center;
|
|
63017
|
-
`;
|
|
63018
|
-
const CircleDeterminateSC = dt.circle `
|
|
63019
|
-
fill: none;
|
|
63020
|
-
stroke-linecap: round;
|
|
63021
|
-
transition: stroke-dashoffset 0.35s ease;
|
|
63022
|
-
`;
|
|
63023
|
-
|
|
63024
|
-
const NUMBER_REGEX = /^\d+/;
|
|
63025
|
-
|
|
63026
|
-
const extractNumberFromThemeValue = (value, defaultValue = 0) => {
|
|
63027
|
-
if (typeof value !== "string") {
|
|
63028
|
-
return defaultValue;
|
|
63029
|
-
}
|
|
63030
|
-
const match = value.match(NUMBER_REGEX);
|
|
63031
|
-
const number = Number(match?.[0]);
|
|
63032
|
-
if (isNaN(number)) {
|
|
63033
|
-
return defaultValue;
|
|
63034
|
-
}
|
|
63035
|
-
return number;
|
|
63036
|
-
};
|
|
63037
|
-
const clamp = (value, min, max) => {
|
|
63038
|
-
return Math.min(Math.max(value, min), max);
|
|
63039
|
-
};
|
|
63040
|
-
|
|
63041
|
-
const ProgressCircularDeterminate = ({ percent: percentProp = 0, size: sizeProp = "md", invert = false, className, }) => {
|
|
63042
|
-
const theme = nt();
|
|
63043
|
-
const percent = useMemo$1(() => clamp(percentProp, 0, 100), [percentProp]);
|
|
63044
|
-
const { size, strokeWidth, radius, circumference } = useMemo$1(() => {
|
|
63045
|
-
const sizeValue = extractNumberFromThemeValue(theme?.[`com/progress-indicator/circular/size-${sizeProp}/indicator/indicator`], 0);
|
|
63046
|
-
const strokeWidthValue = extractNumberFromThemeValue(theme?.[`com/progress-indicator/circular/size-${sizeProp}/indicator/stroke-width`], 0);
|
|
63047
|
-
const validSize = Math.max(0, sizeValue);
|
|
63048
|
-
const validStrokeWidth = Math.max(0, strokeWidthValue);
|
|
63049
|
-
const calculatedRadius = (validSize - validStrokeWidth) / 2;
|
|
63050
|
-
const calculatedCircumference = 2 * Math.PI * Math.max(0, calculatedRadius);
|
|
63051
|
-
return {
|
|
63052
|
-
size: validSize,
|
|
63053
|
-
strokeWidth: validStrokeWidth,
|
|
63054
|
-
radius: Math.max(0, calculatedRadius),
|
|
63055
|
-
circumference: calculatedCircumference,
|
|
63056
|
-
};
|
|
63057
|
-
}, [sizeProp, theme]);
|
|
63058
|
-
const offset = useMemo$1(() => {
|
|
63059
|
-
if (circumference <= 0)
|
|
63060
|
-
return 0;
|
|
63061
|
-
return circumference - (percent / 100) * circumference;
|
|
63062
|
-
}, [percent, circumference]);
|
|
63063
|
-
const wrapperSize = theme[`com/progress-indicator/circular/size-${sizeProp}/width`];
|
|
63064
|
-
const backgroundColor = invert
|
|
63065
|
-
? theme["com/progress-indicator/invert/background-color"]
|
|
63066
|
-
: theme["com/progress-indicator/default/background-color"];
|
|
63067
|
-
const leadColor = invert
|
|
63068
|
-
? theme["com/progress-indicator/invert/indicator/lead-color"]
|
|
63069
|
-
: theme["com/progress-indicator/default/indicator/lead-color"];
|
|
63070
|
-
if (size <= 0 || radius <= 0) {
|
|
63071
|
-
return null;
|
|
63072
|
-
}
|
|
63073
|
-
return (jsx(SvgDeterminateWrapperSC, { "$size": wrapperSize, className: className, children: jsxs(SvgDeterminateSC, { width: size, height: size, viewBox: `0 0 ${size} ${size}`, "aria-valuenow": percent, role: "progressbar", children: [jsx(CircleDeterminateSC, { cx: size / 2, cy: size / 2, r: radius, stroke: backgroundColor, strokeWidth: strokeWidth, fill: "none" }), jsx(CircleDeterminateSC, { cx: size / 2, cy: size / 2, r: radius, stroke: leadColor, strokeWidth: strokeWidth, strokeDasharray: circumference, strokeDashoffset: offset, fill: "none" })] }) }));
|
|
63074
|
-
};
|
|
63075
|
-
|
|
63076
|
-
function ProgressCircularIndeterminate({ size = "md", invert = false, className, }) {
|
|
63077
|
-
return (jsxs(DivIndeterminateWrapperSC, { viewBox: "0 0 44 44", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, "$invert": invert, "$size": size, children: [jsx("g", { clipPath: "url(#paint0_angular_9600_49736_clip_path)", "data-figma-skip-parse": "true", children: jsx("g", { transform: "matrix(0.00190748 0.0149333 -0.0152598 0.00186667 22.3061 22)", children: jsx("foreignObject", { x: -1186.46, y: -1186.46, width: 2372.92, height: 2372.92, children: jsx("div", { className: "indicator", style: {
|
|
63078
|
-
height: "100%",
|
|
63079
|
-
width: "100%",
|
|
63080
|
-
opacity: 1,
|
|
63081
|
-
} }) }) }) }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M34.7639 19.8789C33.8246 20.1776 32.8157 19.6745 32.5105 18.7553C31.899 16.9137 30.7791 15.2734 29.2744 14.0157C27.7697 12.7581 25.939 11.9322 23.9846 11.6293C22.0302 11.3264 20.0282 11.5582 18.2001 12.2993C16.3719 13.0403 14.7888 14.2617 13.6257 15.8283C12.4626 17.3949 11.7649 19.2457 11.6096 21.1762C11.4544 23.1066 11.8476 25.0415 12.746 26.7669C13.6443 28.4923 15.0127 29.9409 16.6999 30.9527C18.3871 31.9645 20.3273 32.5 22.3061 32.5C23.2937 32.5 24.0944 33.2835 24.0944 34.25C24.0944 35.2165 23.2937 36 22.3061 36C19.6677 36 17.0808 35.286 14.8312 33.937C12.5816 32.5879 10.7571 30.6564 9.55928 28.3559C8.36149 26.0554 7.8371 23.4755 8.04411 20.9016C8.25111 18.3276 9.18144 15.8598 10.7322 13.771C12.283 11.6822 14.3939 10.0537 16.8314 9.06569C19.2689 8.07764 21.9382 7.76847 24.5441 8.17237C27.1499 8.57627 29.5909 9.6775 31.5972 11.3543C33.6034 13.0311 35.0967 15.2182 35.912 17.6738C36.2172 18.593 35.7032 19.5802 34.7639 19.8789Z", "data-figma-gradient-fill": "{\"type\":\"GRADIENT_ANGULAR\",\"stops\":[{\"color\":{\"r\":0.18431372940540314,\"g\":0.23529411852359772,\"b\":0.75686275959014893,\"a\":1.0},\"position\":0.750},{\"color\":{\"r\":1.0,\"g\":1.0,\"b\":1.0,\"a\":0.10999999940395355},\"position\":0.89999997615814209}],\"stopsVar\":[{\"color\":{\"r\":0.18431372940540314,\"g\":0.23529411852359772,\"b\":0.75686275959014893,\"a\":1.0},\"position\":0.750},{\"color\":{\"r\":1.0,\"g\":1.0,\"b\":1.0,\"a\":0.10999999940395355},\"position\":0.89999997615814209}],\"transform\":{\"m00\":3.8149569034576416,\"m01\":-30.519655227661133,\"m02\":35.658443450927734,\"m10\":29.866659164428711,\"m11\":3.7333323955535889,\"m12\":5.2000064849853516},\"opacity\":1.0,\"blendMode\":\"NORMAL\",\"visible\":true}" }), jsx("defs", { children: jsx("clipPath", { id: "paint0_angular_9600_49736_clip_path", children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M34.7639 19.8789C33.8246 20.1776 32.8157 19.6745 32.5105 18.7553C31.899 16.9137 30.7791 15.2734 29.2744 14.0157C27.7697 12.7581 25.939 11.9322 23.9846 11.6293C22.0302 11.3264 20.0282 11.5582 18.2001 12.2993C16.3719 13.0403 14.7888 14.2617 13.6257 15.8283C12.4626 17.3949 11.7649 19.2457 11.6096 21.1762C11.4544 23.1066 11.8476 25.0415 12.746 26.7669C13.6443 28.4923 15.0127 29.9409 16.6999 30.9527C18.3871 31.9645 20.3273 32.5 22.3061 32.5C23.2937 32.5 24.0944 33.2835 24.0944 34.25C24.0944 35.2165 23.2937 36 22.3061 36C19.6677 36 17.0808 35.286 14.8312 33.937C12.5816 32.5879 10.7571 30.6564 9.55928 28.3559C8.36149 26.0554 7.8371 23.4755 8.04411 20.9016C8.25111 18.3276 9.18144 15.8598 10.7322 13.771C12.283 11.6822 14.3939 10.0537 16.8314 9.06569C19.2689 8.07764 21.9382 7.76847 24.5441 8.17237C27.1499 8.57627 29.5909 9.6775 31.5972 11.3543C33.6034 13.0311 35.0967 15.2182 35.912 17.6738C36.2172 18.593 35.7032 19.5802 34.7639 19.8789Z" }) }) })] }));
|
|
63082
|
-
}
|
|
63083
|
-
|
|
63084
|
-
function FISProgressCircular({ variant, ...rest }) {
|
|
63085
|
-
if (variant === "determinate") {
|
|
63086
|
-
return jsx(ProgressCircularDeterminate, { ...rest });
|
|
63087
|
-
}
|
|
63088
|
-
return jsx(ProgressCircularIndeterminate, { ...rest });
|
|
63089
|
-
}
|
|
63090
|
-
FISProgressCircular.displayName = "FISProgressCircular";
|
|
63091
|
-
|
|
63092
63134
|
const getPadding = (size, borderPath) => {
|
|
63093
63135
|
const paddingValue = getTheme(`com/button/size-${size}/horizontal-padding`);
|
|
63094
63136
|
const borderValue = getTheme(borderPath);
|
|
@@ -63262,7 +63304,7 @@ const ButtonSC = dt.button `
|
|
|
63262
63304
|
|
|
63263
63305
|
${props.$loading &&
|
|
63264
63306
|
lt `
|
|
63265
|
-
background-color: ${getTheme("com/button/
|
|
63307
|
+
background-color: ${getTheme("com/button/disable/background-color")} !important;
|
|
63266
63308
|
`}
|
|
63267
63309
|
`;
|
|
63268
63310
|
case "secondary":
|
|
@@ -63322,8 +63364,8 @@ const ButtonSC = dt.button `
|
|
|
63322
63364
|
|
|
63323
63365
|
${props.$loading &&
|
|
63324
63366
|
lt `
|
|
63325
|
-
background-color: ${getTheme("com/button/
|
|
63326
|
-
border-color: ${getTheme("com/button/
|
|
63367
|
+
background-color: ${getTheme("com/button/disable/background-color")} !important;
|
|
63368
|
+
border-color: ${getTheme("com/button/disable/stroke-color")} !important;
|
|
63327
63369
|
`}
|
|
63328
63370
|
|
|
63329
63371
|
${() => ["xs", "sm", "md", "lg"].includes(props.$size)
|
|
@@ -63387,8 +63429,8 @@ const ButtonSC = dt.button `
|
|
|
63387
63429
|
|
|
63388
63430
|
${props.$loading &&
|
|
63389
63431
|
lt `
|
|
63390
|
-
background-color: ${getTheme("com/button/
|
|
63391
|
-
border-color: ${getTheme("com/button/
|
|
63432
|
+
background-color: ${getTheme("com/button/disable/background-color")} !important;
|
|
63433
|
+
border-color: ${getTheme("com/button/disable/stroke-color")} !important;
|
|
63392
63434
|
`}
|
|
63393
63435
|
|
|
63394
63436
|
${() => ["xs", "sm", "md", "lg"].includes(props.$size)
|
|
@@ -63446,7 +63488,7 @@ const ButtonSC = dt.button `
|
|
|
63446
63488
|
|
|
63447
63489
|
${props.$loading &&
|
|
63448
63490
|
lt `
|
|
63449
|
-
background-color: ${getTheme("com/button/
|
|
63491
|
+
background-color: ${getTheme("com/button/disable/background-color")} !important;
|
|
63450
63492
|
`}
|
|
63451
63493
|
`;
|
|
63452
63494
|
case "secondary-negative":
|
|
@@ -63507,8 +63549,8 @@ const ButtonSC = dt.button `
|
|
|
63507
63549
|
|
|
63508
63550
|
${props.$loading &&
|
|
63509
63551
|
lt `
|
|
63510
|
-
background-color: ${getTheme("com/button/
|
|
63511
|
-
border-color: ${getTheme("com/button/
|
|
63552
|
+
background-color: ${getTheme("com/button/disable/background-color")} !important;
|
|
63553
|
+
border-color: ${getTheme("com/button/disable/stroke-color")};
|
|
63512
63554
|
`}
|
|
63513
63555
|
|
|
63514
63556
|
${() => ["xs", "sm", "md", "lg"].includes(props.$size)
|
|
@@ -63565,7 +63607,7 @@ const ButtonSC = dt.button `
|
|
|
63565
63607
|
|
|
63566
63608
|
${props.$loading &&
|
|
63567
63609
|
lt `
|
|
63568
|
-
background-color: ${getTheme("com/button/
|
|
63610
|
+
background-color: ${getTheme("com/button/disable-invert/solid-background-color")} !important;
|
|
63569
63611
|
`}
|
|
63570
63612
|
`;
|
|
63571
63613
|
case "secondary-white":
|