pixelize-design-library 2.4.2-beta.24 → 2.4.2-beta.26
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/Components/Accordion/Accordion.js +3 -1
- package/dist/Components/Button/Button.js +2 -1
- package/dist/Components/Button/Button.styles.js +7 -7
- package/dist/Components/Card/PaymentCard/PaymentCard.js +7 -7
- package/dist/Components/Checkbox/Checkbox.styles.js +10 -7
- package/dist/Components/CopyButton/CopyButton.js +5 -1
- package/dist/Components/Dropdown/DropDown.js +4 -2
- package/dist/Components/EmptyState/EmptyState.js +2 -1
- package/dist/Components/FileUpload/FileUpload.js +4 -4
- package/dist/Components/FileUpload/FileUploadProps.d.ts +1 -0
- package/dist/Components/FilterSidebar/filterHoverStyle.d.ts +0 -9
- package/dist/Components/FilterSidebar/filterHoverStyle.js +4 -10
- package/dist/Components/Header/components/mobileMenu.js +12 -3
- package/dist/Components/Loading/Loading.js +15 -14
- package/dist/Components/NoteTextArea/NoteTextArea.js +5 -2
- package/dist/Components/NumberInput/NumberInput.js +3 -1
- package/dist/Components/PdfViewer/PdfViewer.js +6 -1
- package/dist/Components/ProductCard/ProductReview.js +6 -1
- package/dist/Components/ProductCard/ProductTags.js +1 -1
- package/dist/Components/RadioButton/RadioButton.js +2 -1
- package/dist/Components/ScrollToTop/ScrollToTop.js +2 -0
- package/dist/Components/Search/Search.js +2 -2
- package/dist/Components/SearchSelect/SearchSelect.js +10 -6
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +2 -0
- package/dist/Components/SegmentedControl/SegmentedControl.js +58 -0
- package/dist/Components/SegmentedControl/SegmentedControlProps.d.ts +16 -0
- package/dist/Components/SegmentedControl/SegmentedControlProps.js +2 -0
- package/dist/Components/Select/Select.d.ts +1 -1
- package/dist/Components/Select/Select.js +4 -2
- package/dist/Components/Select/SelectProps.d.ts +3 -0
- package/dist/Components/SelectSearch/SelectSearch.js +4 -1
- package/dist/Components/SelectV2/SelectV2.js +5 -3
- package/dist/Components/SideBar/SideBar.js +1 -1
- package/dist/Components/SideBar/components/MenuPopoverContent.js +2 -2
- package/dist/Components/Slider/Slider.js +8 -1
- package/dist/Components/StageProgress/StepperStage.js +2 -2
- package/dist/Components/Table/components/Pagination.js +1 -1
- package/dist/Components/Table/settings/ManageColumns.js +2 -1
- package/dist/Components/Tag/Tag.styles.js +3 -4
- package/dist/Components/Toggle/TableToggle.js +11 -7
- package/dist/Components/ToggleSwitch/ToggleSwitch.d.ts +2 -0
- package/dist/Components/ToggleSwitch/ToggleSwitch.js +18 -0
- package/dist/Components/ToggleSwitch/ToggleSwitchProps.d.ts +11 -0
- package/dist/Components/ToggleSwitch/ToggleSwitchProps.js +2 -0
- package/dist/Components/ToolTip/ToolTip.js +6 -6
- package/dist/Components/ToolTip/ToolTipProps.d.ts +3 -1
- package/dist/esm/Components/Accordion/Accordion.js +3 -1
- package/dist/esm/Components/Button/Button.js +2 -1
- package/dist/esm/Components/Button/Button.styles.js +7 -7
- package/dist/esm/Components/Card/PaymentCard/PaymentCard.js +7 -7
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +11 -8
- package/dist/esm/Components/CopyButton/CopyButton.js +6 -2
- package/dist/esm/Components/Dropdown/DropDown.js +4 -2
- package/dist/esm/Components/EmptyState/EmptyState.js +2 -1
- package/dist/esm/Components/FileUpload/FileUpload.js +4 -4
- package/dist/esm/Components/FilterSidebar/filterHoverStyle.js +4 -10
- package/dist/esm/Components/Header/components/mobileMenu.js +12 -3
- package/dist/esm/Components/Loading/Loading.js +12 -11
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +5 -2
- package/dist/esm/Components/NumberInput/NumberInput.js +4 -2
- package/dist/esm/Components/PdfViewer/PdfViewer.js +6 -1
- package/dist/esm/Components/ProductCard/ProductReview.js +6 -1
- package/dist/esm/Components/ProductCard/ProductTags.js +1 -1
- package/dist/esm/Components/RadioButton/RadioButton.js +2 -1
- package/dist/esm/Components/ScrollToTop/ScrollToTop.js +2 -0
- package/dist/esm/Components/Search/Search.js +2 -2
- package/dist/esm/Components/SearchSelect/SearchSelect.js +10 -6
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +55 -0
- package/dist/esm/Components/SegmentedControl/SegmentedControlProps.js +1 -0
- package/dist/esm/Components/Select/Select.js +5 -3
- package/dist/esm/Components/SelectSearch/SelectSearch.js +4 -1
- package/dist/esm/Components/SelectV2/SelectV2.js +5 -3
- package/dist/esm/Components/SideBar/SideBar.js +1 -1
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +2 -2
- package/dist/esm/Components/Slider/Slider.js +8 -1
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -2
- package/dist/esm/Components/Table/components/Pagination.js +1 -1
- package/dist/esm/Components/Table/settings/ManageColumns.js +2 -1
- package/dist/esm/Components/Tag/Tag.styles.js +3 -4
- package/dist/esm/Components/Toggle/TableToggle.js +11 -7
- package/dist/esm/Components/ToggleSwitch/ToggleSwitch.js +15 -0
- package/dist/esm/Components/ToggleSwitch/ToggleSwitchProps.js +1 -0
- package/dist/esm/Components/ToolTip/ToolTip.js +6 -6
- package/dist/esm/index.js +3 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +7 -3
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ const react_2 = require("@chakra-ui/react");
|
|
|
6
6
|
const lucide_react_1 = require("lucide-react");
|
|
7
7
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
8
8
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
9
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
9
10
|
const accordionColors_1 = require("./accordionColors");
|
|
10
11
|
const Accordion = ({ allowMultiple, allowToggle, index, onChange, reduceMotion, items, ...rest }) => {
|
|
11
12
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
@@ -14,13 +15,14 @@ const Accordion = ({ allowMultiple, allowToggle, index, onChange, reduceMotion,
|
|
|
14
15
|
const headingColor = colors.text[800];
|
|
15
16
|
const bodyColor = colors.text[600];
|
|
16
17
|
const { expandedBg, softHover } = (0, react_1.useMemo)(() => (0, accordionColors_1.getAccordionHoverColors)(colors, isDark), [colors, isDark]);
|
|
18
|
+
const focusRing = (0, react_1.useMemo)(() => (0, outlineRung_1.liftToContrast)(colors.primary[300], colors.background[50], outlineRung_1.AA_NON_TEXT), [colors]);
|
|
17
19
|
return ((0, jsx_runtime_1.jsx)(react_2.Accordion, { allowMultiple: allowMultiple, allowToggle: allowToggle, index: index, onChange: onChange, reduceMotion: reduceMotion, ...rest, children: items.map((item, idx) => {
|
|
18
20
|
var _a;
|
|
19
21
|
return ((0, jsx_runtime_1.jsx)(react_2.AccordionItem, { border: `0.063rem solid ${border}`, borderRadius: "xl", bg: colors.background[50], mb: 3, overflow: "hidden", transition: "border-color 0.15s ease, box-shadow 0.15s ease", _last: { mb: 0 }, _hover: { borderColor: colors.boxborder[200] }, ...item.itemProps, sx: (_a = item.customStyles) === null || _a === void 0 ? void 0 : _a.itemStyle, children: ({ isExpanded }) => {
|
|
20
22
|
var _a, _b, _c;
|
|
21
23
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h2", { children: (0, jsx_runtime_1.jsxs)(react_2.AccordionButton, { px: 4, py: 3, gap: 3, fontSize: "0.875rem", fontWeight: 600, color: headingColor, bg: isExpanded ? expandedBg : "transparent", transition: "background 0.15s ease", _hover: { bg: isExpanded ? expandedBg : softHover }, _focusVisible: {
|
|
22
24
|
boxShadow: "none",
|
|
23
|
-
outline: `0.125rem solid ${
|
|
25
|
+
outline: `0.125rem solid ${focusRing}`,
|
|
24
26
|
outlineOffset: "-0.125rem",
|
|
25
27
|
}, ...item.buttonProps, sx: {
|
|
26
28
|
...(_a = item.customStyles) === null || _a === void 0 ? void 0 : _a.buttonStyle,
|
|
@@ -4,6 +4,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const react_2 = require("@chakra-ui/react");
|
|
6
6
|
const Button = (0, react_1.forwardRef)(function Button({ label, children, onClick, opacity, variant = "solid", leftIcon, rightIcon, size, isDisabled = false, isLoading = false, loadingText = "Loading", type, width, w, sx, colorScheme, border, borderRadius, onMouseEnter, onMouseLeave, ...aria }, ref) {
|
|
7
|
-
|
|
7
|
+
const isIconOnly = !children && !label && !!(leftIcon || rightIcon);
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Button, { ...aria, type: type, onClick: onClick, width: width || w || "fit-content", variant: variant, size: size, isLoading: isLoading, isDisabled: isDisabled, loadingText: loadingText, leftIcon: leftIcon, rightIcon: rightIcon, iconSpacing: isIconOnly ? 0 : undefined, ref: ref, colorScheme: colorScheme, sx: sx, opacity: opacity, border: border, borderRadius: borderRadius, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: children !== null && children !== void 0 ? children : label }));
|
|
8
9
|
});
|
|
9
10
|
exports.default = (0, react_1.memo)(Button);
|
|
@@ -107,22 +107,22 @@ exports.Button = {
|
|
|
107
107
|
};
|
|
108
108
|
},
|
|
109
109
|
outline: ({ theme, colorScheme = "primary" }) => {
|
|
110
|
-
|
|
110
|
+
// Same rung as `solid`'s fill, not raw [500] — keeps hover bg AA-safe for white text.
|
|
111
|
+
const hoverFill = theme.colors[colorScheme][solidRung(theme, colorScheme)];
|
|
111
112
|
const activeFill = darkerFill(theme, colorScheme, 0);
|
|
113
|
+
const ink = onCanvasText(theme, colorScheme);
|
|
112
114
|
return {
|
|
113
115
|
border: "0.1rem solid",
|
|
114
|
-
borderColor:
|
|
115
|
-
color:
|
|
116
|
+
borderColor: ink,
|
|
117
|
+
color: ink,
|
|
116
118
|
bg: "transparent",
|
|
117
119
|
_hover: {
|
|
118
120
|
bg: hoverFill,
|
|
119
121
|
borderColor: activeFill,
|
|
120
|
-
// Was a hardcoded `theme.colors.white` — fails AA for any colorScheme whose [500]
|
|
121
|
-
// doesn't clear white contrast (e.g. emerald/rosewood primary in dark, 3.38/3.46).
|
|
122
122
|
color: labelFor(theme, hoverFill),
|
|
123
123
|
_disabled: {
|
|
124
124
|
// bg: theme.colors[colorScheme][500],
|
|
125
|
-
color:
|
|
125
|
+
color: ink,
|
|
126
126
|
},
|
|
127
127
|
},
|
|
128
128
|
_active: {
|
|
@@ -131,7 +131,7 @@ exports.Button = {
|
|
|
131
131
|
},
|
|
132
132
|
_loading: {
|
|
133
133
|
// bg: theme.colors[colorScheme][500],
|
|
134
|
-
color:
|
|
134
|
+
color: ink,
|
|
135
135
|
},
|
|
136
136
|
};
|
|
137
137
|
},
|
|
@@ -20,6 +20,7 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
20
20
|
badgeColor: `0.125rem solid ${theme.colors.green[500]}`,
|
|
21
21
|
buttonColor: theme.colors.green[500],
|
|
22
22
|
buttonColor50: theme.colors.green[50],
|
|
23
|
+
colorScheme: "green",
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
if (isNextUpgrade) {
|
|
@@ -28,6 +29,7 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
28
29
|
badgeColor: `0.125rem solid ${theme.colors.primary[500]}`,
|
|
29
30
|
buttonColor: theme.colors.primary[500],
|
|
30
31
|
buttonColor50: theme.colors.primary[50],
|
|
32
|
+
colorScheme: "primary",
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
35
|
if (popular) {
|
|
@@ -36,6 +38,7 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
36
38
|
badgeColor: `0.125rem solid ${theme.colors.primary[500]}`,
|
|
37
39
|
buttonColor: theme.colors.primary[500],
|
|
38
40
|
buttonColor50: theme.colors.primary[50],
|
|
41
|
+
colorScheme: "primary",
|
|
39
42
|
});
|
|
40
43
|
}
|
|
41
44
|
return withOnButtonColor({
|
|
@@ -43,17 +46,14 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
43
46
|
badgeColor: "",
|
|
44
47
|
buttonColor: theme.colors.primary[500],
|
|
45
48
|
buttonColor50: theme.colors.primary[50],
|
|
49
|
+
colorScheme: "primary",
|
|
46
50
|
});
|
|
47
51
|
};
|
|
48
52
|
const PaymentCard = ({ plan, isActive = false, isNextUpgrade = false, billingCycle, onSelect, onHover, buttonLoading, isLoading = false, isRenewal = false, }) => {
|
|
49
53
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
50
|
-
const { badgeText, badgeColor, buttonColor, buttonColor50, onButtonColor } = getCardStyles(isActive, isNextUpgrade, !!plan.popular, theme);
|
|
54
|
+
const { badgeText, badgeColor, buttonColor, buttonColor50, onButtonColor, colorScheme } = getCardStyles(isActive, isNextUpgrade, !!plan.popular, theme);
|
|
51
55
|
const variantStyles = plan.buttonVariant === "outline"
|
|
52
|
-
? {
|
|
53
|
-
borderColor: buttonColor,
|
|
54
|
-
color: buttonColor,
|
|
55
|
-
_hover: { bg: buttonColor50 },
|
|
56
|
-
}
|
|
56
|
+
? {}
|
|
57
57
|
: {
|
|
58
58
|
bg: buttonColor,
|
|
59
59
|
color: onButtonColor,
|
|
@@ -65,6 +65,6 @@ const PaymentCard = ({ plan, isActive = false, isNextUpgrade = false, billingCyc
|
|
|
65
65
|
// 🔹 Actual Card Content
|
|
66
66
|
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [badgeText && ((0, jsx_runtime_1.jsx)(react_1.Badge, { position: "absolute", top: "-0.75rem", left: "50%", transform: "translateX(-50%)", bg: buttonColor, color: onButtonColor, fontSize: "sm", px: 4, py: 1, borderRadius: "full", children: badgeText })), (0, jsx_runtime_1.jsxs)(react_1.Box, { textAlign: "center", mb: 6, children: [(0, jsx_runtime_1.jsx)(react_1.Flex, { justify: "center", align: "center", w: "3.125rem", h: "3.125rem", borderRadius: "lg", bg: buttonColor50, color: buttonColor, mx: "auto", mb: 4, children: plan.icon }), (0, jsx_runtime_1.jsx)(react_1.Heading, { as: "h3", size: "lg", mb: 4, color: theme.colors.gray[800], children: plan.name }), (plan.yearlyPrice !== 0 || plan.monthlyPrice !== 0) && ((0, jsx_runtime_1.jsxs)(react_1.Heading, { as: "h4", size: "2xl", mb: 1, color: theme.colors.gray[800], display: "flex", justifyContent: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Box, { fontSize: "1.5rem", children: "\u20B9" }), billingCycle === "yearly"
|
|
67
67
|
? plan.yearlyPrice
|
|
68
|
-
: plan.monthlyPrice, (0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", flexDirection: "column", justifyContent: "end", ml: 1, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "0.9rem", fontWeight: "normal", color: theme.colors.gray[600], children: plan.billing }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "0.7rem", fontWeight: "normal", color: theme.colors.gray[600], children: plan.tax })] })] })), plan.priceDescription && ((0, jsx_runtime_1.jsx)(react_1.Text, { color: theme.colors.green[800], mt: 2, children: plan === null || plan === void 0 ? void 0 : plan.priceDescription })), (0, jsx_runtime_1.jsx)(react_1.Text, { color: theme.colors.gray[600], mt: 2, children: plan.description })] }), ((!isActive && plan.buttonText) || isRenewal) && ((0, jsx_runtime_1.jsx)(Button_1.default, { isLoading: plan.plan_id === buttonLoading, loadingText: plan.buttonLoadingText, width: "full", variant: plan.buttonVariant, size: "lg", onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(plan.plan_id), onMouseEnter: () => onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", true), onMouseLeave: () => onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", false), ...variantStyles, children: plan.buttonText })), (0, jsx_runtime_1.jsx)(react_1.VStack, { align: "start", spacing: 3, mt: 6, children: plan.features.map((feature, i) => ((0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Icon, { as: lucide_react_1.Check, color: theme.colors.green[500], mr: 2 }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", children: feature })] }, i))) })] })) }) }));
|
|
68
|
+
: plan.monthlyPrice, (0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", flexDirection: "column", justifyContent: "end", ml: 1, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "0.9rem", fontWeight: "normal", color: theme.colors.gray[600], children: plan.billing }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "0.7rem", fontWeight: "normal", color: theme.colors.gray[600], children: plan.tax })] })] })), plan.priceDescription && ((0, jsx_runtime_1.jsx)(react_1.Text, { color: theme.colors.green[800], mt: 2, children: plan === null || plan === void 0 ? void 0 : plan.priceDescription })), (0, jsx_runtime_1.jsx)(react_1.Text, { color: theme.colors.gray[600], mt: 2, children: plan.description })] }), ((!isActive && plan.buttonText) || isRenewal) && ((0, jsx_runtime_1.jsx)(Button_1.default, { isLoading: plan.plan_id === buttonLoading, loadingText: plan.buttonLoadingText, width: "full", variant: plan.buttonVariant, colorScheme: colorScheme, size: "lg", onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(plan.plan_id), onMouseEnter: () => onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", true), onMouseLeave: () => onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", false), ...variantStyles, children: plan.buttonText })), (0, jsx_runtime_1.jsx)(react_1.VStack, { align: "start", spacing: 3, mt: 6, children: plan.features.map((feature, i) => ((0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Icon, { as: lucide_react_1.Check, color: theme.colors.green[500], mr: 2 }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", children: feature })] }, i))) })] })) }) }));
|
|
69
69
|
};
|
|
70
70
|
exports.default = PaymentCard;
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Checkbox = void 0;
|
|
4
4
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
5
|
+
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
5
6
|
exports.Checkbox = {
|
|
6
7
|
baseStyle: ({ theme, colorScheme = "primary" }) => {
|
|
7
8
|
var _a;
|
|
8
9
|
const palette = (_a = theme.colors[colorScheme]) !== null && _a !== void 0 ? _a : theme.colors.primary;
|
|
9
|
-
//
|
|
10
|
-
// Chakra's stock control also carries a checked-hover at `_checked._hover` (this override
|
|
11
|
-
// nests the other way, `_hover._checked`) — two different key paths landing on the same
|
|
12
|
-
// selector, so whichever one the cascade picks must still differ from resting. Setting both
|
|
13
|
-
// paths to the same lifted value removes that ambiguity outright.
|
|
10
|
+
// Both `_checked._hover` and `_hover._checked` paths get the same lifted value.
|
|
14
11
|
const hoverChecked = (0, outlineRung_1.resolveHoverTint)(palette[600], palette[600]);
|
|
12
|
+
const checkedIcon = (0, accentText_1.onFilled)(palette[600], theme.colors.white, theme.colors.black);
|
|
13
|
+
const hoverCheckedIcon = (0, accentText_1.onFilled)(hoverChecked, theme.colors.white, theme.colors.black);
|
|
14
|
+
const focusRing = (0, outlineRung_1.liftToContrast)(palette[300], theme.colors.backgroundColor.main, outlineRung_1.AA_NON_TEXT);
|
|
15
15
|
return {
|
|
16
16
|
control: {
|
|
17
17
|
width: "1.25rem",
|
|
@@ -54,7 +54,7 @@ exports.Checkbox = {
|
|
|
54
54
|
},
|
|
55
55
|
},
|
|
56
56
|
_focus: {
|
|
57
|
-
boxShadow: `0 0 0 2px ${
|
|
57
|
+
boxShadow: `0 0 0 2px ${focusRing}`,
|
|
58
58
|
borderColor: palette[500],
|
|
59
59
|
},
|
|
60
60
|
_active: {
|
|
@@ -63,7 +63,10 @@ exports.Checkbox = {
|
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
65
|
icon: {
|
|
66
|
-
color:
|
|
66
|
+
color: checkedIcon,
|
|
67
|
+
_hover: {
|
|
68
|
+
color: hoverCheckedIcon,
|
|
69
|
+
},
|
|
67
70
|
},
|
|
68
71
|
};
|
|
69
72
|
},
|
|
@@ -9,6 +9,7 @@ const react_2 = require("@chakra-ui/react");
|
|
|
9
9
|
const lucide_react_1 = require("lucide-react");
|
|
10
10
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
11
11
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
12
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
12
13
|
const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
13
14
|
const CopyButton = ({ value, variant = "icon", label = "Copy", copiedLabel = "Copied!", tooltip = "Copy", feedbackDuration = 1500, iconSize = 16, size = "sm", onCopy, }) => {
|
|
14
15
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
@@ -34,7 +35,10 @@ const CopyButton = ({ value, variant = "icon", label = "Copy", copiedLabel = "Co
|
|
|
34
35
|
const accent = (0, accentText_1.accentTextOnCanvas)(theme.colors.primary, theme.colors.backgroundColor.main);
|
|
35
36
|
const success = theme.colors.semanticText.success;
|
|
36
37
|
if (variant === "menu-item") {
|
|
37
|
-
|
|
38
|
+
// Ink also sits on the row's own hover fill (gray[100]), not just the canvas — resolve against it.
|
|
39
|
+
const hoverAccent = (0, accentText_1.accentTextOnCanvas)(theme.colors.primary, theme.colors.gray[100]);
|
|
40
|
+
const hoverSuccess = (0, outlineRung_1.liftToContrast)(theme.colors.semantic.success[500], theme.colors.gray[100], accentText_1.AA_NORMAL_TEXT);
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: "0.5rem", px: "12px", py: "8px", width: "100%", cursor: "pointer", borderRadius: "md", transition: "background 0.15s ease", _hover: { bg: theme.colors.gray[100] }, onClick: handleCopy, children: [copied ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Check, { size: iconSize, color: hoverSuccess })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { size: iconSize, color: hoverAccent })), (0, jsx_runtime_1.jsx)(react_2.Box, { fontSize: "14px", fontWeight: 500, color: copied ? hoverSuccess : hoverAccent, children: copied ? copiedLabel : label })] }));
|
|
38
42
|
}
|
|
39
43
|
if (variant === "button") {
|
|
40
44
|
return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { as: "button", align: "center", gap: "6px", px: "12px", py: "6px", borderRadius: "lg", border: "1px solid",
|
|
@@ -6,6 +6,7 @@ const react_2 = require("@chakra-ui/react");
|
|
|
6
6
|
const framer_motion_1 = require("framer-motion");
|
|
7
7
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
8
8
|
const scrollbar_1 = require("../../Theme/tokens/builders/scrollbar");
|
|
9
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
9
10
|
const lucide_react_1 = require("lucide-react");
|
|
10
11
|
const rafThrottle_1 = require("../../Utils/rafThrottle");
|
|
11
12
|
const MotionBox = (0, framer_motion_1.motion)((0, react_1.forwardRef)((props, ref) => ((0, jsx_runtime_1.jsx)(react_2.Box, { ref: ref, ...props }))));
|
|
@@ -214,16 +215,17 @@ const Dropdown = (0, react_1.forwardRef)(({ dropDownButtonStyle, ButtonText, opt
|
|
|
214
215
|
};
|
|
215
216
|
const DropdownContentRender = () => {
|
|
216
217
|
var _a;
|
|
218
|
+
const hoverTint = (0, outlineRung_1.resolveHoverTint)(theme.colors.primary[500], theme.colors.background[50]);
|
|
217
219
|
return ((0, jsx_runtime_1.jsx)(react_2.List, { id: menuId, role: "menu", onKeyDown: handleMenuKeyDown, bg: theme.colors.background[50], border: `0.063rem solid ${theme.colors.boxborder[200]}`, borderRadius: "xl", boxShadow: (_a = theme.shadows) === null || _a === void 0 ? void 0 : _a.lg, py: 1.5, mt: "0.375rem", minWidth: s.minW, maxH: "18rem", overflowY: "auto", overflowX: "hidden", sx: (0, scrollbar_1.scrollbarStyles)(theme.colors, "overlay"), style: ListStyle, children: options.map((option, index) => ((0, jsx_runtime_1.jsxs)(react_2.ListItem, { ref: (node) => {
|
|
218
220
|
itemRefs.current[index] = node;
|
|
219
221
|
}, role: "menuitem", tabIndex: index === activeIndex ? 0 : -1, onClick: () => {
|
|
220
222
|
handleListItemClick(option.id, option.label);
|
|
221
223
|
focusTrigger();
|
|
222
224
|
}, onKeyDown: (e) => handleItemKeyDown(e, option.id, option.label), mx: 1.5, px: s.px, py: s.py, borderRadius: "md", display: "flex", alignItems: "center", gap: 2, cursor: "pointer", color: theme.colors.text[700], transition: "background 0.12s ease, color 0.12s ease", _hover: {
|
|
223
|
-
bg:
|
|
225
|
+
bg: hoverTint,
|
|
224
226
|
color: theme.colors.accentText,
|
|
225
227
|
}, _focus: {
|
|
226
|
-
bg:
|
|
228
|
+
bg: hoverTint,
|
|
227
229
|
color: theme.colors.accentText,
|
|
228
230
|
}, borderBottom: divider
|
|
229
231
|
? `0.063rem solid ${theme.colors.boxborder[200]}`
|
|
@@ -5,6 +5,7 @@ const react_1 = require("@chakra-ui/react");
|
|
|
5
5
|
const lucide_react_1 = require("lucide-react");
|
|
6
6
|
const react_2 = require("@emotion/react");
|
|
7
7
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
8
|
+
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
8
9
|
const float = (0, react_2.keyframes) `
|
|
9
10
|
0%, 100% { transform: translateY(0); }
|
|
10
11
|
50% { transform: translateY(-8px); }
|
|
@@ -23,8 +24,8 @@ const EmptyState = ({ title = "No data found", description, icon: IconComp = luc
|
|
|
23
24
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
24
25
|
const s = sizeMap[size];
|
|
25
26
|
const palette = scaleFor(theme.colors, colorScheme);
|
|
26
|
-
const accent = palette[500];
|
|
27
27
|
const accentSoft = palette[50];
|
|
28
|
+
const accent = (0, accentText_1.accentTextOnCanvas)(palette, accentSoft);
|
|
28
29
|
const containerStyles = variant === "subtle"
|
|
29
30
|
? { bg: theme.colors.gray[50], borderRadius: "2xl" }
|
|
30
31
|
: variant === "dashed"
|
|
@@ -42,7 +42,7 @@ const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
|
42
42
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
43
43
|
const constants_1 = require("./constants");
|
|
44
44
|
const Modal_1 = __importStar(require("../Modal/Modal"));
|
|
45
|
-
const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes = [".jpg", ".png"], maxSizeKB = 5, maxFiles = undefined, progress = {}, size = "md", }) => {
|
|
45
|
+
const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes = [".jpg", ".png"], maxSizeKB = 5, maxFiles = undefined, progress = {}, size = "md", inputAriaLabel = "Upload files", }) => {
|
|
46
46
|
const compact = size === "sm";
|
|
47
47
|
const { colors, radii } = (0, useCustomTheme_1.useCustomTheme)();
|
|
48
48
|
const { isOpen, onOpen, onClose } = (0, react_2.useDisclosure)();
|
|
@@ -89,10 +89,10 @@ const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes
|
|
|
89
89
|
setErrors(messages);
|
|
90
90
|
},
|
|
91
91
|
});
|
|
92
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 4, align: "stretch", children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { ...getRootProps(), border: "2px dashed", borderColor: border, borderRadius: "md", p: compact ? 3 : 10, textAlign: "center", bg: bg, cursor: "pointer", transition: "all 0.2s", _hover: { bg: colors.gray[100] }, position: "relative", children: [(0, jsx_runtime_1.jsx)("input", { ...getInputProps() }), (0, jsx_runtime_1.jsxs)(react_2.Stack, { direction: compact ? "row" : "column", spacing: compact ? 3 : 2, align: "center", justify: "center", children: [(0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.Upload, boxSize: compact ? 4 : 6 }), (0, jsx_runtime_1.jsxs)(react_2.Stack, { spacing: 0, align: compact ? "start" : "center", children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontWeight: "medium", fontSize: compact ? "sm" : "md", children: "Drag and drop files here" }), (0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: compact ? "xs" : "sm", color: colors.textMuted, children: [acceptTypes.join(", "), " up to ", (0, constants_1.toMB)(maxSizeKB), " ", maxFiles ? `- ${maxFiles} file(s) max` : ""] })] })] })] }), errors.length > 0 && ((0, jsx_runtime_1.jsx)(react_2.Box, { children: errors.map((err, idx) => ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: colors.semanticText.error, children: err }, idx))) })), uploadedFiles.length > 0 && ((0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsx)(react_2.Box, { display: "flex", alignItems: "center", gap: 2, children: (0, jsx_runtime_1.jsx)(react_2.Text, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize: 14, lineHeight: "100%", letterSpacing: "4%", textTransform: "uppercase", py: 4, children: "Uploaded Files" }) }), (0, jsx_runtime_1.jsx)(react_2.List, { spacing: 2, children: uploadedFiles.map((file, index) => ((0, jsx_runtime_1.jsxs)(react_2.Box, { borderWidth: "0.063rem", borderRadius: "md", px: 3, py: 2, bg: colors.background[50], children: [(0, jsx_runtime_1.jsxs)(react_2.ListItem, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [(0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 3, flex: "1", children: [file.type.startsWith("image/") ? ((0, jsx_runtime_1.jsxs)(react_2.Box, { boxSize: "2.5rem", cursor: "pointer", position: "relative", _hover: {
|
|
92
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 4, align: "stretch", children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { ...getRootProps(), border: "2px dashed", borderColor: border, borderRadius: "md", p: compact ? 3 : 10, textAlign: "center", bg: bg, cursor: "pointer", transition: "all 0.2s", _hover: { bg: colors.gray[100] }, position: "relative", children: [(0, jsx_runtime_1.jsx)("input", { ...getInputProps({ "aria-label": inputAriaLabel }) }), (0, jsx_runtime_1.jsxs)(react_2.Stack, { direction: compact ? "row" : "column", spacing: compact ? 3 : 2, align: "center", justify: "center", children: [(0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.Upload, boxSize: compact ? 4 : 6 }), (0, jsx_runtime_1.jsxs)(react_2.Stack, { spacing: 0, align: compact ? "start" : "center", children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontWeight: "medium", fontSize: compact ? "sm" : "md", color: colors.textMuted, children: "Drag and drop files here" }), (0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: compact ? "xs" : "sm", color: colors.textMuted, children: [acceptTypes.join(", "), " up to ", (0, constants_1.toMB)(maxSizeKB), " ", maxFiles ? `- ${maxFiles} file(s) max` : ""] })] })] })] }), errors.length > 0 && ((0, jsx_runtime_1.jsx)(react_2.Box, { children: errors.map((err, idx) => ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: colors.semanticText.error, children: err }, idx))) })), uploadedFiles.length > 0 && ((0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsx)(react_2.Box, { display: "flex", alignItems: "center", gap: 2, children: (0, jsx_runtime_1.jsx)(react_2.Text, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize: 14, lineHeight: "100%", letterSpacing: "4%", textTransform: "uppercase", py: 4, children: "Uploaded Files" }) }), (0, jsx_runtime_1.jsx)(react_2.List, { spacing: 2, children: uploadedFiles.map((file, index) => ((0, jsx_runtime_1.jsxs)(react_2.Box, { borderWidth: "0.063rem", borderRadius: "md", px: 3, py: 2, bg: colors.background[50], children: [(0, jsx_runtime_1.jsxs)(react_2.ListItem, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [(0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 3, flex: "1", children: [file.type.startsWith("image/") ? ((0, jsx_runtime_1.jsxs)(react_2.Box, { boxSize: "2.5rem", cursor: "pointer", position: "relative", _hover: {
|
|
93
93
|
".hover-icon": {
|
|
94
94
|
opacity: 1,
|
|
95
|
-
bg:
|
|
95
|
+
bg: "blackAlpha.500",
|
|
96
96
|
},
|
|
97
97
|
}, onClick: () => {
|
|
98
98
|
setPreviewUrl(URL.createObjectURL(file));
|
|
@@ -103,7 +103,7 @@ const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes
|
|
|
103
103
|
height: "100%",
|
|
104
104
|
objectFit: "cover",
|
|
105
105
|
borderRadius: radii.base,
|
|
106
|
-
} }), (0, jsx_runtime_1.jsx)(react_2.Box, { className: "hover-icon", position: "absolute", top: "0.5rem", left: "0.5rem", opacity: 0, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, { color:
|
|
106
|
+
} }), (0, jsx_runtime_1.jsx)(react_2.Box, { className: "hover-icon", position: "absolute", top: "0.5rem", left: "0.5rem", opacity: 0, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, { color: "white" }) })] })) : ((0, jsx_runtime_1.jsx)(react_2.ListIcon, { as: lucide_react_1.FileText, color: (0, accentText_1.accentTextOnCanvas)(colors.blue, colors.background[50]), boxSize: 8 })), (0, jsx_runtime_1.jsxs)(react_2.VStack, { align: "start", spacing: 0, flex: "1", children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", noOfLines: 1, children: file.name }), (0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "xs", color: colors.textMuted, children: [(0, constants_1.toMB)(file.size / 1024), " \u2022", " ", file.type || "Unknown type"] })] })] }), onRemoveFile && ((0, jsx_runtime_1.jsx)(react_2.CloseButton, { onClick: () => onRemoveFile(file), size: "sm", color: colors.semanticText.error }))] }), (progress === null || progress === void 0 ? void 0 : progress[file.name]) !== undefined && ((0, jsx_runtime_1.jsx)(react_2.Progress, { value: progress === null || progress === void 0 ? void 0 : progress[file.name], size: "xs", mt: 1, hasStripe: (progress === null || progress === void 0 ? void 0 : progress[file.name]) < 100, isAnimated: (progress === null || progress === void 0 ? void 0 : progress[file.name]) < 100, colorScheme: (progress === null || progress === void 0 ? void 0 : progress[file.name]) >= 100 ? "green" : "blue", borderRadius: "md" }))] }, index))) })] }))] }), (0, jsx_runtime_1.jsxs)(Modal_1.default, { isOpen: isOpen, onClose: () => {
|
|
107
107
|
onClose();
|
|
108
108
|
setPreviewUrl(null);
|
|
109
109
|
setPreviewTitle(null);
|
|
@@ -1,11 +1,2 @@
|
|
|
1
1
|
import type { PaletteProps } from "../../Theme/tokens/types";
|
|
2
|
-
/**
|
|
3
|
-
* FilterSidebar's hover fill for option rows, popover list items, and the accordion trigger.
|
|
4
|
-
* `gray[50]` (a pale near-white tint in light mode) sits within ~1 lightness point of the
|
|
5
|
-
* dark-mode canvas once the whole scale flips (~1.08:1 contrast) — invisible, the QA-reported
|
|
6
|
-
* "checkbox hover invisible" bug. `gray[300]` clears the resting canvas (~2.3:1, a clear visible
|
|
7
|
-
* cue) while staying dark enough that the existing `gray[700]`/`gray[800]` row text (tuned for a
|
|
8
|
-
* near-black canvas) still reads at/above AA (~4.9:1+) on top of it — no text-color flip needed
|
|
9
|
-
* here, unlike the Table row hover fix.
|
|
10
|
-
*/
|
|
11
2
|
export declare const getFilterHoverBg: (colors: PaletteProps, isDark: boolean) => string;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFilterHoverBg = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* "checkbox hover invisible" bug. `gray[300]` clears the resting canvas (~2.3:1, a clear visible
|
|
9
|
-
* cue) while staying dark enough that the existing `gray[700]`/`gray[800]` row text (tuned for a
|
|
10
|
-
* near-black canvas) still reads at/above AA (~4.9:1+) on top of it — no text-color flip needed
|
|
11
|
-
* here, unlike the Table row hover fix.
|
|
12
|
-
*/
|
|
13
|
-
const getFilterHoverBg = (colors, isDark) => isDark ? colors.gray[300] : colors.gray[50];
|
|
4
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
5
|
+
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
6
|
+
// The fill itself must clear AA against `text[500]`, the only ink these rows ever use.
|
|
7
|
+
const getFilterHoverBg = (colors, isDark) => isDark ? (0, outlineRung_1.liftToContrast)(colors.gray[300], colors.text[500], accentText_1.AA_NORMAL_TEXT) : colors.gray[50];
|
|
14
8
|
exports.getFilterHoverBg = getFilterHoverBg;
|
|
@@ -7,7 +7,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("@chakra-ui/react");
|
|
8
8
|
const react_2 = __importDefault(require("react"));
|
|
9
9
|
const lucide_react_1 = require("lucide-react");
|
|
10
|
+
const useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
11
|
+
const accentText_1 = require("../../../Theme/tokens/builders/accentText");
|
|
10
12
|
const MobileMenu = ({ menuItems, isOpen, isActive, hoverBg, activeBg, color, rightSlot, onClose, }) => {
|
|
13
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
11
14
|
const [openMenuLabel, setOpenMenuLabel] = react_2.default.useState(null);
|
|
12
15
|
react_2.default.useEffect(() => {
|
|
13
16
|
if (!isOpen)
|
|
@@ -15,7 +18,9 @@ const MobileMenu = ({ menuItems, isOpen, isActive, hoverBg, activeBg, color, rig
|
|
|
15
18
|
}, [isOpen]);
|
|
16
19
|
return ((0, jsx_runtime_1.jsx)(react_1.Collapse, { in: isOpen, animateOpacity: true, children: (0, jsx_runtime_1.jsx)(react_1.Box, { pb: 4, display: { md: "none" }, children: (0, jsx_runtime_1.jsxs)(react_1.Stack, { spacing: 4, children: [menuItems.map((item) => {
|
|
17
20
|
var _a, _b, _c, _d, _e;
|
|
18
|
-
return item.children ? ((0, jsx_runtime_1.jsxs)(react_1.Box, { px: 2, children: [(0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => setOpenMenuLabel((prev) => (prev === item.label ? null : item.label)), variant: "ghost", w: "full", justifyContent: "flex-start", color:
|
|
21
|
+
return item.children ? ((0, jsx_runtime_1.jsxs)(react_1.Box, { px: 2, children: [(0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => setOpenMenuLabel((prev) => (prev === item.label ? null : item.label)), variant: "ghost", w: "full", justifyContent: "flex-start", color: item.children.some((subItem) => isActive(subItem.href))
|
|
22
|
+
? (0, accentText_1.onFilled)(activeBg, colors.white, colors.black)
|
|
23
|
+
: color, bg: item.children.some((subItem) => isActive(subItem.href))
|
|
19
24
|
? activeBg
|
|
20
25
|
: "transparent", _hover: { bg: hoverBg }, rightIcon: openMenuLabel === item.label ? ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 16 })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })), px: 2, children: (0, jsx_runtime_1.jsx)(react_1.HStack, { w: "full", justify: "space-between", align: "center", children: (0, jsx_runtime_1.jsxs)(react_1.VStack, { spacing: 0, align: "start", children: [item.badge && ((0, jsx_runtime_1.jsx)(react_1.Badge, { colorScheme: (_b = (_a = item === null || item === void 0 ? void 0 : item.badge) === null || _a === void 0 ? void 0 : _a.colorScheme) !== null && _b !== void 0 ? _b : "blue", variant: "subtle", fontSize: "0.65em", borderRadius: "md", boxShadow: "sm", px: 2, py: 0.5, children: item.badge.label })), (0, jsx_runtime_1.jsx)(react_1.Text, { fontWeight: "bold", children: item.label })] }) }) }), (0, jsx_runtime_1.jsx)(react_1.Collapse, { in: openMenuLabel === item.label, animateOpacity: true, children: (0, jsx_runtime_1.jsx)(react_1.Stack, { pl: 4, mt: 1, spacing: 1, children: item.children.map((subItem) => {
|
|
21
26
|
var _a, _b, _c;
|
|
@@ -23,8 +28,12 @@ const MobileMenu = ({ menuItems, isOpen, isActive, hoverBg, activeBg, color, rig
|
|
|
23
28
|
var _a;
|
|
24
29
|
(_a = subItem.onClick) === null || _a === void 0 ? void 0 : _a.call(subItem);
|
|
25
30
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
26
|
-
}, variant: "ghost", w: "full", justifyContent: "flex-start", color:
|
|
27
|
-
|
|
31
|
+
}, variant: "ghost", w: "full", justifyContent: "flex-start", color: isActive(subItem.href)
|
|
32
|
+
? (0, accentText_1.onFilled)(activeBg, colors.white, colors.black)
|
|
33
|
+
: color, bg: isActive(subItem.href) ? activeBg : "transparent", _hover: { bg: hoverBg }, children: (0, jsx_runtime_1.jsxs)(react_1.VStack, { spacing: 0, align: "start", children: [subItem.badge && ((0, jsx_runtime_1.jsx)(react_1.Badge, { colorScheme: (_b = (_a = subItem === null || subItem === void 0 ? void 0 : subItem.badge) === null || _a === void 0 ? void 0 : _a.colorScheme) !== null && _b !== void 0 ? _b : "blue", variant: "subtle", fontSize: "0.65em", borderRadius: "md", boxShadow: "sm", px: 2, py: 0.5, children: (_c = subItem.badge) === null || _c === void 0 ? void 0 : _c.label })), (0, jsx_runtime_1.jsxs)(react_1.HStack, { spacing: 2, align: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Box, { boxSize: "0.4rem", borderRadius: "full", bg: "currentColor" }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", children: subItem.label })] })] }) }, subItem.label));
|
|
34
|
+
}) }) })] }, item.label)) : ((0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => { var _a; (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item); onClose === null || onClose === void 0 ? void 0 : onClose(); }, variant: "ghost", w: "full", justifyContent: "flex-start", color: isActive(item.href)
|
|
35
|
+
? (0, accentText_1.onFilled)(activeBg, colors.white, colors.black)
|
|
36
|
+
: color, bg: isActive(item.href) ? activeBg : "transparent", _hover: { bg: hoverBg }, children: (0, jsx_runtime_1.jsxs)(react_1.VStack, { spacing: 0, align: "start", children: [item.badge && ((0, jsx_runtime_1.jsx)(react_1.Badge, { colorScheme: (_d = (_c = item === null || item === void 0 ? void 0 : item.badge) === null || _c === void 0 ? void 0 : _c.colorScheme) !== null && _d !== void 0 ? _d : "blue", variant: "subtle", fontSize: "0.65em", borderRadius: "md", boxShadow: "sm", px: 2, py: 0.5, children: (_e = item.badge) === null || _e === void 0 ? void 0 : _e.label })), (0, jsx_runtime_1.jsx)(react_1.Text, { children: item.label })] }) }, item.label));
|
|
28
37
|
}), rightSlot && (0, jsx_runtime_1.jsx)(react_1.Box, { mt: 4, children: rightSlot })] }) }) }));
|
|
29
38
|
};
|
|
30
39
|
exports.default = MobileMenu;
|
|
@@ -2,26 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = Loading;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("
|
|
6
|
-
const react_2 = require("@
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_2 = require("@chakra-ui/react");
|
|
7
|
+
const react_3 = require("@emotion/react");
|
|
7
8
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
8
|
-
const colorTransition = (0, react_2.keyframes) `
|
|
9
|
-
0% {
|
|
10
|
-
color: black;
|
|
11
|
-
}
|
|
12
|
-
50% {
|
|
13
|
-
color: gray;
|
|
14
|
-
}
|
|
15
|
-
100% {
|
|
16
|
-
color: black;
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
19
9
|
function Loading({ text, isLoading, onlytext, container }) {
|
|
20
10
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
11
|
+
const colorTransition = (0, react_1.useMemo)(() => (0, react_3.keyframes) `
|
|
12
|
+
0% {
|
|
13
|
+
color: ${theme.colors.text[900]};
|
|
14
|
+
}
|
|
15
|
+
50% {
|
|
16
|
+
color: ${theme.colors.textMuted};
|
|
17
|
+
}
|
|
18
|
+
100% {
|
|
19
|
+
color: ${theme.colors.text[900]};
|
|
20
|
+
}
|
|
21
|
+
`, [theme.colors.text, theme.colors.textMuted]);
|
|
21
22
|
if (!isLoading) {
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Box, { position: container ? "absolute" : "fixed", top: "0", right: "0", bottom: "0", left: "0", backgroundColor: container ? "blackAlpha.500" : "blackAlpha.600", backdropFilter: container ? undefined : "blur(60px)", display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", zIndex: container ? "10" : "9999", children: (0, jsx_runtime_1.jsx)(react_2.Center, { height: container ? "100%" : "100vh", children: !onlytext ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.Spinner, { thickness: "4px", speed: "0.65s", emptyColor: "gray.200", color: theme.colors.accentText, size: "xl" }), (0, jsx_runtime_1.jsx)(react_2.Text, { mt: "2", ml: "5", children: text })] })) : ((0, jsx_runtime_1.jsx)(react_2.Text, { mt: "2", ml: "5", fontSize: "50px", textTransform: "uppercase", fontWeight: 500, css: (0, react_3.css) `
|
|
25
26
|
animation: ${colorTransition} 2s infinite;
|
|
26
27
|
`, children: text })) }) }));
|
|
27
28
|
}
|
|
@@ -7,6 +7,7 @@ const react_2 = require("@chakra-ui/react");
|
|
|
7
7
|
const lucide_react_1 = require("lucide-react");
|
|
8
8
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
9
9
|
const placeholderInk_1 = require("../../Theme/tokens/builders/placeholderInk");
|
|
10
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
10
11
|
const fieldStyles_1 = require("../Common/fieldStyles");
|
|
11
12
|
const countWords = (text = "") => {
|
|
12
13
|
const t = text.trim();
|
|
@@ -118,7 +119,9 @@ function NoteTextArea({ width = "100%", handleSubmit, handleCancel, value, title
|
|
|
118
119
|
};
|
|
119
120
|
const noteWordCount = countWords(noteValue);
|
|
120
121
|
const isOverLimit = noteWordCount > maxNoteWordCount;
|
|
121
|
-
|
|
122
|
+
const collapsedHoverBg = (0, outlineRung_1.resolveHoverTint)(theme.colors.gray[50], theme.colors.background[50]);
|
|
123
|
+
const activeControlHoverBg = (0, outlineRung_1.resolveHoverTint)(theme.colors.gray[100], theme.colors.gray[50]);
|
|
124
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { w: width, borderRadius: fieldStyles_1.FIELD_RADIUS, overflow: "hidden", border: "1px solid", borderColor: isActive ? theme.colors.primary[500] : theme.colors.boxborder[500], bg: isActive ? theme.colors.gray[50] : theme.colors.background[50], transition: "border-color 0.2s", children: [!isActive && ((0, jsx_runtime_1.jsxs)(react_2.Flex, { px: 3, gap: 2, align: "center", cursor: "text", onClick: handleTextArea, bg: theme.colors.background[50], borderRadius: fieldStyles_1.FIELD_RADIUS, minH: "2.5rem", transition: "background 0.15s", _hover: { bg: collapsedHoverBg }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.SquarePen, { size: 16, color: theme.colors.textMuted }), (0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.textMuted, fontSize: "sm", children: customPlaceholder })] })), isActive && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { bg: theme.colors.background[50], children: [titleShow && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.Input, { ref: inputRef, value: titleValue, onChange: (e) => {
|
|
122
125
|
if (e.target.value.length === 0)
|
|
123
126
|
setTitleShow(false);
|
|
124
127
|
setTitleValue(e.target.value);
|
|
@@ -126,7 +129,7 @@ function NoteTextArea({ width = "100%", handleSubmit, handleCancel, value, title
|
|
|
126
129
|
color: (0, placeholderInk_1.placeholderInk)(theme.colors),
|
|
127
130
|
} }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] })] })), (0, jsx_runtime_1.jsx)(react_2.Box, { bg: theme.colors.background[50], minH: "76px", px: 3, pt: 2.5, position: "relative", children: (0, jsx_runtime_1.jsx)(react_2.Textarea, { ref: noteAreaRef, value: noteValue, onChange: handleNoteChange, placeholder: customPlaceholder, variant: "unstyled", resize: "none", minH: "76px", fontSize: "0.75rem", color: theme.colors.text[700], _placeholder: {
|
|
128
131
|
color: (0, placeholderInk_1.placeholderInk)(theme.colors),
|
|
129
|
-
}, style: { overflow: "hidden" }, p: 0 }) })] }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] }), (0, jsx_runtime_1.jsxs)(react_2.Box, { px: 3, py: 2.5, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", justify: "space-between", w: "100%", gap: 3, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, minW: 0, children: [(0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: "Attach files", hasArrow: true, placement: "top", children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "label", htmlFor: "file-upload", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", w: "1.75rem", h: "1.75rem", borderRadius: "md", color: theme.colors.textMuted, transition: "background 0.15s", _hover: { bg:
|
|
132
|
+
}, style: { overflow: "hidden" }, p: 0 }) })] }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] }), (0, jsx_runtime_1.jsxs)(react_2.Box, { px: 3, py: 2.5, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", justify: "space-between", w: "100%", gap: 3, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, minW: 0, children: [(0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: "Attach files", hasArrow: true, placement: "top", children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "label", htmlFor: "file-upload", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", w: "1.75rem", h: "1.75rem", borderRadius: "md", color: theme.colors.textMuted, transition: "background 0.15s", _hover: { bg: activeControlHoverBg }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Paperclip, { size: 16 }) }) }), (0, jsx_runtime_1.jsx)(react_2.Box, { h: "1rem", w: "1px", bg: theme.colors.gray[200] }), !titleShow ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", onClick: () => setTitleShow(true), px: 2, py: 1, borderRadius: "md", color: theme.colors.textMuted, fontWeight: 500, fontSize: "sm", transition: "background 0.15s", _hover: { bg: activeControlHoverBg }, children: "+ Add a title" })) : ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: titleValue, hasArrow: true, isDisabled: !titleValue, children: (0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.textMuted, fontSize: "sm", fontWeight: 500, isTruncated: true, maxW: "180px", children: titleValue || "Title" }) }))] }), (0, jsx_runtime_1.jsxs)(react_2.Flex, { gap: 2.5, align: "center", ml: "auto", flexShrink: 0, children: [(0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "xs", fontWeight: 500, color: isOverLimit ? theme.colors.semanticText.error : theme.colors.textMuted, whiteSpace: "nowrap", children: [noteWordCount, "/", maxNoteWordCount] }), cancelButtonHide ? null : ((0, jsx_runtime_1.jsx)(react_2.Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleCloseTextArea, children: "Cancel" })), (0, jsx_runtime_1.jsxs)(react_2.Button, { size: "sm", variant: "solid", isLoading: !!saveButtonLoading, isDisabled: !noteValue || isSaveDisabled, onClick: () => handleSubmit(noteValue, titleValue, files), children: [saveButtonLoading ? ((0, jsx_runtime_1.jsx)(react_2.Spinner, { size: "xs", thickness: "2px", mr: 2 })) : null, "Save"] })] })] }), (0, jsx_runtime_1.jsx)("input", { id: "file-upload", type: "file", style: { display: "none" }, onChange: (e) => {
|
|
130
133
|
const newFiles = Array.from(e.target.files || []);
|
|
131
134
|
const validFiles = newFiles.filter((f) => f.size <= maxFileSize);
|
|
132
135
|
const invalidFiles = newFiles.filter((f) => f.size > maxFileSize);
|
|
@@ -5,6 +5,8 @@ const react_1 = require("@chakra-ui/react");
|
|
|
5
5
|
const react_2 = require("react");
|
|
6
6
|
const FormLabel_1 = require("../Common/FormLabel");
|
|
7
7
|
const NumberInput = (0, react_2.forwardRef)(function NumberInput({ defaultValue, min, max, precision, step, clampValueOnBlur, keepWithinRange, value, onChange, onBlur, name, size, maxW, allowMouseWheel, NumberIncrementStepperBg, NumberIncrementStepperActive, NumberIncrementStepperChildren, NumberDecrementStepperBg, NumberDecrementStepperChildren, NumberDecrementStepperActive, label, isInformation, informationMessage, isRequired, id, width = "100%", minW, ...props }, ref) {
|
|
8
|
-
|
|
8
|
+
const generatedId = (0, react_2.useId)();
|
|
9
|
+
const resolvedId = id !== null && id !== void 0 ? id : generatedId;
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.FormControl, { w: width, minW: minW, maxW: maxW, id: resolvedId, isRequired: isRequired, children: [label && ((0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, id: resolvedId, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired })), (0, jsx_runtime_1.jsxs)(react_1.NumberInput, { defaultValue: defaultValue, min: min, max: max, step: step, precision: precision, clampValueOnBlur: clampValueOnBlur, keepWithinRange: keepWithinRange, value: value, onChange: onChange, onBlur: onBlur, name: name, size: size, maxW: maxW, allowMouseWheel: allowMouseWheel, ...props, children: [(0, jsx_runtime_1.jsx)(react_1.NumberInputField, { ref: ref }), (0, jsx_runtime_1.jsxs)(react_1.NumberInputStepper, { children: [(0, jsx_runtime_1.jsx)(react_1.NumberIncrementStepper, { bg: NumberIncrementStepperBg, _active: NumberIncrementStepperActive, children: NumberIncrementStepperChildren }), (0, jsx_runtime_1.jsx)(react_1.NumberDecrementStepper, { bg: NumberDecrementStepperBg, _active: NumberDecrementStepperActive, children: NumberDecrementStepperChildren })] })] })] }));
|
|
9
11
|
});
|
|
10
12
|
exports.default = NumberInput;
|
|
@@ -7,9 +7,14 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("@chakra-ui/react");
|
|
8
8
|
const lucide_react_1 = require("lucide-react");
|
|
9
9
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
10
|
+
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
11
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
10
12
|
const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
11
13
|
const PdfViewer = ({ pdfUrl, fileName = "Document.pdf", height = "480px", showToolbar = true, borderRadius = "xl", }) => {
|
|
12
14
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
13
|
-
|
|
15
|
+
const toolbarSurface = theme.colors.gray[50];
|
|
16
|
+
const iconHoverInk = (0, accentText_1.accentTextOnCanvas)(theme.colors.primary, toolbarSurface);
|
|
17
|
+
const iconHoverBg = (0, outlineRung_1.resolveHoverTint)(theme.colors.primary[50], toolbarSurface);
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { border: "1px solid", borderColor: theme.colors.gray[200], borderRadius: borderRadius, overflow: "hidden", bg: theme.colors.background[50], children: [showToolbar && ((0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", justify: "space-between", px: 4, py: 2.5, borderBottom: "1px solid", borderColor: theme.colors.gray[100], bg: theme.colors.gray[50], children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: 2, minW: 0, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.FileText, { size: 18, color: theme.colors.accentText }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", fontWeight: 500, color: theme.colors.gray[700], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: fileName })] }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: 1, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: "Open in new tab", placement: "top", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: "a", href: pdfUrl, target: "_blank", rel: "noopener noreferrer", p: 2, borderRadius: "lg", color: theme.colors.gray[600], _hover: { bg: iconHoverBg, color: iconHoverInk }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { size: 16 }) }) }), (0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: "Download", placement: "top", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: "a", href: pdfUrl, download: fileName, p: 2, borderRadius: "lg", color: theme.colors.gray[600], _hover: { bg: iconHoverBg, color: iconHoverInk }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Download, { size: 16 }) }) })] })] })), (0, jsx_runtime_1.jsx)(react_1.Box, { as: "embed", src: pdfUrl, type: "application/pdf", width: "100%", height: height, display: "block" })] }));
|
|
14
19
|
};
|
|
15
20
|
exports.default = PdfViewer;
|
|
@@ -5,6 +5,8 @@ const react_1 = require("@chakra-ui/react");
|
|
|
5
5
|
const lucide_react_1 = require("lucide-react");
|
|
6
6
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
7
7
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
8
|
+
const color_1 = require("../../Theme/tokens/builders/color");
|
|
9
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
8
10
|
// The theme's `yellow` scale reverses index roles in dark mode (like every utility hue), so
|
|
9
11
|
// pulling it through the theme would silently flip this decorative "filled star" from gold to
|
|
10
12
|
// pale. A rating star is a universal, brand-independent gold — not something that should follow
|
|
@@ -19,6 +21,9 @@ const ProductReview = ({ rating, reviewCount, mb = 0 }) => {
|
|
|
19
21
|
// Calculate fill percentage: (rating / 5) * 100%
|
|
20
22
|
const numericRating = hasRating ? Math.min(Math.max(Number(rating), 0), 5) : 0;
|
|
21
23
|
const fillPercentage = (numericRating / 6) * 100;
|
|
22
|
-
|
|
24
|
+
const chipBg = colors.teal[50];
|
|
25
|
+
const chipInk = (0, accentText_1.accentTextOnCanvas)(colors.teal, chipBg);
|
|
26
|
+
const starFill = (0, color_1.contrastRatio)(RATING_STAR_FILL, chipBg) >= outlineRung_1.AA_NON_TEXT ? RATING_STAR_FILL : chipInk;
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: 2, mb: mb, children: [hasRating && ((0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: 1, bg: chipBg, color: chipInk, px: 2, borderRadius: "md", children: [(0, jsx_runtime_1.jsxs)(react_1.Box, { position: "relative", flexShrink: 0, display: "inline-block", width: "14px", height: "14px", lineHeight: 0, children: [(0, jsx_runtime_1.jsx)(react_1.Box, { position: "absolute", top: 0, left: 0, width: "14px", height: "14px", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Star, { size: 14, fill: "none", strokeWidth: 1.5 }) }), fillPercentage > 0 && ((0, jsx_runtime_1.jsx)(react_1.Box, { position: "absolute", top: 0, left: 0, width: `${fillPercentage}%`, height: "100%", overflow: "hidden", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Star, { size: 14, color: starFill, fill: starFill }) }))] }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", fontWeight: "bold", children: numericRating })] })), hasRating && hasReviewCount && (0, jsx_runtime_1.jsx)(react_1.Box, { h: "4", w: "0.063rem", bg: colors.boxborder[500] }), hasReviewCount && ((0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: "1", children: [(0, jsx_runtime_1.jsx)(react_1.Icon, { as: lucide_react_1.BookCheck, boxSize: 3.5 }), (0, jsx_runtime_1.jsxs)(react_1.Text, { fontSize: "sm", color: colors.textMuted, children: ["(", reviewCount, ")"] })] }))] }));
|
|
23
28
|
};
|
|
24
29
|
exports.default = ProductReview;
|
|
@@ -25,8 +25,8 @@ const ProductTags = ({ tags, className, size = 'sm' }) => {
|
|
|
25
25
|
};
|
|
26
26
|
const Tag = ({ children, fullWidth = false, size = 'sm', }) => {
|
|
27
27
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
28
|
-
const tagBorder = colors.semanticText.error;
|
|
29
28
|
const tagText = colors.text[900];
|
|
29
|
+
const tagBorder = colors.boxborder[500];
|
|
30
30
|
// Size map for tags
|
|
31
31
|
const tagSizes = {
|
|
32
32
|
xs: { fontSize: '0.625rem', px: '0.5rem', py: '0.125rem' },
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("@chakra-ui/react");
|
|
6
6
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
7
7
|
const FormLabel_1 = require("../Common/FormLabel");
|
|
8
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
8
9
|
const RadioButton = ({ label, colorScheme, isChecked, onChange, isDisabled, size, value, defaultChecked, labelFontSize = "0.75rem", labelClampLines = 2, showLabelTooltip = (label || "").length > 18, labelTooltip = label, }) => {
|
|
9
10
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
10
11
|
return ((0, jsx_runtime_1.jsx)(react_1.Radio, { colorScheme: colorScheme, isChecked: isChecked, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.boxborder[500], borderWidth: "1.6px", _hover: {
|
|
@@ -18,7 +19,7 @@ const RadioButton = ({ label, colorScheme, isChecked, onChange, isDisabled, size
|
|
|
18
19
|
"&[data-checked]:hover": {
|
|
19
20
|
backgroundColor: theme.colors.primary[500],
|
|
20
21
|
borderColor: theme.colors.primary[500],
|
|
21
|
-
boxShadow: `0 0 0 2px ${theme.colors.primary[200]}`,
|
|
22
|
+
boxShadow: `0 0 0 2px ${(0, outlineRung_1.liftToContrast)(theme.colors.primary[200], theme.colors.backgroundColor.main, outlineRung_1.AA_NON_TEXT)}`,
|
|
22
23
|
},
|
|
23
24
|
}, children: (0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, fontSize: labelFontSize, showTooltip: showLabelTooltip, tooltipLabel: labelTooltip, clampLines: labelClampLines, inline: true }) }));
|
|
24
25
|
};
|