pixelize-design-library 2.4.2-beta.2 → 2.4.2-beta.4
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 +2 -2
- package/dist/Components/Button/Button.styles.js +4 -3
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +5 -5
- package/dist/Components/Common/fieldStyles.js +1 -1
- package/dist/Components/CopyButton/CopyButton.js +1 -1
- package/dist/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/Components/DatePicker/CalendarPanel.js +1 -1
- package/dist/Components/DatePicker/RangeDatePicker.js +1 -1
- package/dist/Components/DatePicker/SingleDatePicker.js +1 -1
- package/dist/Components/DatePicker/TimeOnlyPicker.js +1 -1
- package/dist/Components/Dropdown/DropDown.js +3 -13
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
- package/dist/Components/FilePreview/FilePreview.js +1 -1
- package/dist/Components/FilterSidebar/FilterSidebar.js +2 -2
- package/dist/Components/Input/TextInput.styles.js +5 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +5 -45
- package/dist/Components/LimitReachedModal/LimitReachedModal.js +4 -5
- package/dist/Components/MultiSelect/MultiSelect.js +1 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +2 -2
- package/dist/Components/PinInput/PinInput.js +1 -1
- package/dist/Components/PlanPill/PlanPill.js +5 -5
- package/dist/Components/PlanPill/planPillGradient.d.ts +2 -14
- package/dist/Components/PlanPill/planPillGradient.js +3 -15
- package/dist/Components/ProductCard/ProductPrice.js +1 -1
- package/dist/Components/ProfileCard/ProfileCard.js +1 -1
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
- package/dist/Components/Reorder/Reorder.js +1 -1
- package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +13 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.js +11 -0
- package/dist/Components/SearchSelect/SearchSelect.js +3 -3
- package/dist/Components/Select/Select.styles.js +1 -1
- package/dist/Components/SelectSearch/SelectSearch.js +3 -3
- package/dist/Components/SelectV2/SelectV2.js +3 -10
- package/dist/Components/StageProgress/StageProgress.js +2 -9
- package/dist/Components/Table/Table.js +7 -20
- package/dist/Components/Table/components/TableBody.js +1 -1
- package/dist/Components/Table/components/TableHeader.js +1 -1
- package/dist/Components/Table/filters/ActiveFilters.js +2 -18
- package/dist/Components/Table/settings/ManageColumns.js +2 -16
- package/dist/Components/Table/settings/TableSettings.js +4 -10
- package/dist/Components/Timeline/Timeline.js +2 -2
- package/dist/Components/Toaster/Toaster.js +1 -1
- package/dist/Components/UpgradeButton/UpgradeButton.js +3 -3
- package/dist/Constants/Sidebar.js +3 -2
- package/dist/Theme/chakra/Menu.styles.d.ts +7 -6
- package/dist/Theme/chakra/Menu.styles.js +9 -5
- package/dist/Theme/chakra/Popover.styles.d.ts +3 -3
- package/dist/Theme/chakra/Popover.styles.js +7 -6
- package/dist/Theme/chakra/Switch.styles.d.ts +1 -1
- package/dist/Theme/chakra/Switch.styles.js +7 -9
- package/dist/Theme/chakra/componentStyles.d.ts +10 -9
- package/dist/Theme/chakra/createBrandTheme.js +3 -16
- package/dist/Theme/provider/PixelizeThemeProvider.js +18 -20
- package/dist/Theme/provider/ThemeSwitcher.js +10 -20
- package/dist/Theme/tokens/brands/lavender/palette.light.js +2 -6
- package/dist/Theme/tokens/brands/slate/palette.light.js +1 -5
- package/dist/Theme/tokens/builders/gradientInk.d.ts +22 -0
- package/dist/Theme/tokens/builders/gradientInk.js +28 -0
- package/dist/Theme/tokens/builders/index.d.ts +2 -0
- package/dist/Theme/tokens/builders/index.js +2 -0
- package/dist/Theme/tokens/builders/outlineRung.d.ts +5 -0
- package/dist/Theme/tokens/builders/outlineRung.js +19 -0
- package/dist/Theme/tokens/builders/scrollbar.d.ts +12 -0
- package/dist/Theme/tokens/builders/scrollbar.js +57 -0
- package/dist/Theme/tokens/builders/surfaceRungs.d.ts +2 -0
- package/dist/Theme/tokens/builders/surfaceRungs.js +7 -2
- package/dist/esm/Components/Accordion/Accordion.js +2 -2
- package/dist/esm/Components/Button/Button.styles.js +5 -4
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +5 -5
- package/dist/esm/Components/Common/fieldStyles.js +1 -1
- package/dist/esm/Components/CopyButton/CopyButton.js +1 -1
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/esm/Components/DatePicker/CalendarPanel.js +1 -1
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +1 -1
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +1 -1
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +1 -1
- package/dist/esm/Components/Dropdown/DropDown.js +3 -13
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
- package/dist/esm/Components/FilePreview/FilePreview.js +1 -1
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +2 -2
- package/dist/esm/Components/Input/TextInput.styles.js +5 -1
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +5 -45
- package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +4 -5
- package/dist/esm/Components/MultiSelect/MultiSelect.js +1 -1
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +2 -2
- package/dist/esm/Components/PinInput/PinInput.js +1 -1
- package/dist/esm/Components/PlanPill/PlanPill.js +6 -6
- package/dist/esm/Components/PlanPill/planPillGradient.js +3 -15
- package/dist/esm/Components/ProductCard/ProductPrice.js +1 -1
- package/dist/esm/Components/ProfileCard/ProfileCard.js +1 -1
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
- package/dist/esm/Components/Reorder/Reorder.js +1 -1
- package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +9 -0
- package/dist/esm/Components/SearchSelect/SearchSelect.js +3 -3
- package/dist/esm/Components/Select/Select.styles.js +1 -1
- package/dist/esm/Components/SelectSearch/SelectSearch.js +3 -3
- package/dist/esm/Components/SelectV2/SelectV2.js +3 -10
- package/dist/esm/Components/StageProgress/StageProgress.js +2 -9
- package/dist/esm/Components/Table/Table.js +7 -20
- package/dist/esm/Components/Table/components/TableBody.js +1 -1
- package/dist/esm/Components/Table/components/TableHeader.js +1 -1
- package/dist/esm/Components/Table/filters/ActiveFilters.js +2 -18
- package/dist/esm/Components/Table/settings/ManageColumns.js +2 -16
- package/dist/esm/Components/Table/settings/TableSettings.js +4 -10
- package/dist/esm/Components/Timeline/Timeline.js +2 -2
- package/dist/esm/Components/Toaster/Toaster.js +1 -1
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +3 -3
- package/dist/esm/Constants/Sidebar.js +3 -2
- package/dist/esm/Theme/chakra/Menu.styles.js +9 -5
- package/dist/esm/Theme/chakra/Popover.styles.js +7 -6
- package/dist/esm/Theme/chakra/Switch.styles.js +7 -9
- package/dist/esm/Theme/chakra/createBrandTheme.js +3 -16
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +18 -20
- package/dist/esm/Theme/provider/ThemeSwitcher.js +10 -20
- package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +2 -6
- package/dist/esm/Theme/tokens/brands/slate/palette.light.js +1 -5
- package/dist/esm/Theme/tokens/builders/gradientInk.js +22 -0
- package/dist/esm/Theme/tokens/builders/index.js +2 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +18 -0
- package/dist/esm/Theme/tokens/builders/scrollbar.js +52 -0
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +7 -2
- package/dist/esm/index.js +3 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +9 -3
- package/package.json +1 -1
|
@@ -964,7 +964,7 @@ export const SingleDatePicker = (props) => {
|
|
|
964
964
|
setTempDate(updatedDate);
|
|
965
965
|
setInputValue(format(updatedDate, resolvedDateFormat));
|
|
966
966
|
setIsTyping(false);
|
|
967
|
-
}, disabled: disabled })) })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[
|
|
967
|
+
}, disabled: disabled })) })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: () => {
|
|
968
968
|
setTempDate(null);
|
|
969
969
|
requestClose(null);
|
|
970
970
|
}, children: "Clear" }), _jsx(Button, { size: "sm", variant: "gradient", onClick: () => requestClose(), children: "Apply" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
@@ -73,6 +73,6 @@ export const TimeOnlyPicker = (props) => {
|
|
|
73
73
|
onOpen();
|
|
74
74
|
}, error: error, size: sizeKey }) }) }) }), _jsx(PopoverContent, { width: "auto", p: 4, ref: popoverRef, boxShadow: "lg", bg: theme.colors.background[50], children: _jsxs(PopoverBody, { children: [_jsx(TimePicker, { date: resolvedTempDate, dateFormat: dateFormat, onChange: (updatedDate) => {
|
|
75
75
|
handleTimePickerChange(updatedDate);
|
|
76
|
-
} }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 4, pt: 4, borderTop: "1px solid", borderColor: theme.colors.boxborder[
|
|
76
|
+
} }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 4, pt: 4, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(ChakraButton, { size: "sm", variant: "ghost", onClick: handleClear, children: "Clear" }), _jsx(ChakraButton, { size: "sm", colorScheme: "primary", onClick: handleOk, children: "OK" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
77
77
|
};
|
|
78
78
|
export default TimeOnlyPicker;
|
|
@@ -3,6 +3,7 @@ import { forwardRef, useCallback, useEffect, useId, useRef, useState } from "rea
|
|
|
3
3
|
import { Box, Flex, Button, useDisclosure, List, ListItem, Portal, } from "@chakra-ui/react";
|
|
4
4
|
import { motion } from "framer-motion";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
|
+
import { scrollbarStyles } from "../../Theme/tokens/builders/scrollbar.js";
|
|
6
7
|
import { ChevronDown } from "lucide-react";
|
|
7
8
|
import { rafThrottle } from "../../Utils/rafThrottle.js";
|
|
8
9
|
const MotionBox = motion(forwardRef((props, ref) => (_jsx(Box, { ref: ref, ...props }))));
|
|
@@ -211,18 +212,7 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
|
|
|
211
212
|
};
|
|
212
213
|
const DropdownContentRender = () => {
|
|
213
214
|
var _a;
|
|
214
|
-
return (_jsx(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: {
|
|
215
|
-
scrollbarWidth: "thin",
|
|
216
|
-
scrollbarColor: `${theme.colors.gray[300]} transparent`,
|
|
217
|
-
"&::-webkit-scrollbar": { width: "6px" },
|
|
218
|
-
"&::-webkit-scrollbar-thumb": {
|
|
219
|
-
background: theme.colors.gray[300],
|
|
220
|
-
borderRadius: "base",
|
|
221
|
-
},
|
|
222
|
-
"&::-webkit-scrollbar-thumb:hover": {
|
|
223
|
-
background: theme.colors.gray[400],
|
|
224
|
-
},
|
|
225
|
-
}, style: ListStyle, children: options.map((option, index) => (_jsxs(ListItem, { ref: (node) => {
|
|
215
|
+
return (_jsx(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: scrollbarStyles(theme.colors, "overlay"), style: ListStyle, children: options.map((option, index) => (_jsxs(ListItem, { ref: (node) => {
|
|
226
216
|
itemRefs.current[index] = node;
|
|
227
217
|
}, role: "menuitem", tabIndex: index === activeIndex ? 0 : -1, onClick: () => {
|
|
228
218
|
handleListItemClick(option.id, option.label);
|
|
@@ -234,7 +224,7 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
|
|
|
234
224
|
bg: theme.colors.primary.opacity[8],
|
|
235
225
|
color: theme.colors.accentText,
|
|
236
226
|
}, borderBottom: divider
|
|
237
|
-
? `0.063rem solid ${theme.colors.boxborder[
|
|
227
|
+
? `0.063rem solid ${theme.colors.boxborder[200]}`
|
|
238
228
|
: undefined, sx: { "&:last-child": { borderBottom: "none" } }, style: ItemStyle, fontWeight: 500, children: [(option === null || option === void 0 ? void 0 : option.image) && (_jsx(Box, { as: option.image, boxSize: s.img, flexShrink: 0, color: theme.colors.textMuted, style: ImageStyle })), _jsx(Box, { as: "span", fontSize: s.fontSize, isTruncated: true,
|
|
239
229
|
// fontWeight={400}
|
|
240
230
|
style: LabelStyle, children: option.label })] }, option.id))) }));
|
|
@@ -8,7 +8,7 @@ export default function VerifyEmailOtp({ resendMail, onChange, onComplete, place
|
|
|
8
8
|
// [800], not [300]: WCAG 1.4.11 needs >=3.0 for a control boundary against any
|
|
9
9
|
// named surface up to `muted` (lightest); [300] fails there, [800] clears all
|
|
10
10
|
// with margin.
|
|
11
|
-
borderColor: theme.colors.boxborder[
|
|
11
|
+
borderColor: theme.colors.boxborder[500], backgroundColor: theme.colors.background[200], _focus: {
|
|
12
12
|
borderColor: theme.colors.primary[500],
|
|
13
13
|
boxShadow: `0 0 0 0.063rem ${theme.colors.primary[500]}`,
|
|
14
14
|
} }, index))) }) }), _jsx(Flex, { justify: "center", children: _jsxs(Text, { fontSize: "sm", color: theme.colors.gray[600], children: ["Didn\u2019t receive the code?", " ", _jsx(Button, { variant: "link", color: theme.colors.accentText, fontWeight: "semibold", onClick: resendMail, children: "Resend Code" })] }) })] }));
|
|
@@ -64,7 +64,7 @@ export const FilePreview = ({ isOpen, onClose, fileUrl, fileName, fileType, hide
|
|
|
64
64
|
, {
|
|
65
65
|
// Chakra's default Modal drives its bg off `--modal-bg`, which flips to
|
|
66
66
|
// `colors.gray.700` under `_dark` — a light grey in our derived dark palettes.
|
|
67
|
-
bg: theme.colors.background[50], borderRadius: "2xl", overflow: "hidden", initial: { opacity: 0, scale: 0.96, y: 8 }, animate: { opacity: 1, scale: 1, y: 0 }, transition: { duration: 0.2, ease: "easeOut" }, children: [_jsxs(Flex, { align: "center", justify: "space-between", px: 4, py: 3, borderBottom: "1px solid", borderColor: theme.colors.boxborder[
|
|
67
|
+
bg: theme.colors.background[50], borderRadius: "2xl", overflow: "hidden", initial: { opacity: 0, scale: 0.96, y: 8 }, animate: { opacity: 1, scale: 1, y: 0 }, transition: { duration: 0.2, ease: "easeOut" }, children: [_jsxs(Flex, { align: "center", justify: "space-between", px: 4, py: 3, borderBottom: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(ToolTip, { label: fileName || "File", placement: "bottom", children: _jsx(Text, { fontSize: "sm", fontWeight: 600, maxW: "60%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: fileName || "Preview" }) }), _jsxs(Flex, { align: "center", gap: 1, children: [kind === "image" && (_jsxs(_Fragment, { children: [_jsx(ToolTip, { label: "Zoom out", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Zoom out", size: "sm", variant: "ghost", icon: _jsx(Minus, { size: 16 }), onClick: () => setZoom((z) => Math.max(0.25, z - 0.25)) }) }), _jsx(ToolTip, { label: "Zoom in", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Zoom in", size: "sm", variant: "ghost", icon: _jsx(Plus, { size: 16 }), onClick: () => setZoom((z) => Math.min(4, z + 0.25)) }) }), _jsx(ToolTip, { label: "Rotate", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Rotate", size: "sm", variant: "ghost", icon: _jsx(RotateCw, { size: 16 }), onClick: () => setRotation((r) => (r + 90) % 360) }) })] })), !hideDownload && (_jsx(ToolTip, { label: "Download", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Download", size: "sm", variant: "ghost", color: theme.colors.semanticText.success, icon: _jsx(Download, { size: 18 }), onClick: () => downloadFile(fileUrl, fileName) }) })), _jsx(ModalCloseButton, { position: "static" })] })] }), _jsx(ModalBody, { p: 5, children: renderBody() })] })] }));
|
|
68
68
|
};
|
|
69
69
|
/** Thumbnail with a hover "preview" affordance that opens {@link FilePreview}. */
|
|
70
70
|
export const FilePreviewTrigger = ({ fileUrl, fileName, fileType, thumbWidth = "100px", thumbHeight = "60px", hideDownload = false, }) => {
|
|
@@ -170,10 +170,10 @@ panelPadding = 3, clearAllButton = true, onClearAllHandler,
|
|
|
170
170
|
const starColor = accentTextOnCanvas(theme.colors.orange, isRowSelected ? theme.colors.red[50] : theme.colors.background[50]);
|
|
171
171
|
return Array.from({ length: 5 }, (_, i) => (_jsx(Box, { children: _jsx(Star, { size: 16, color: starColor, fill: i < r ? starColor : "none" }) }, `star-${r}-${i}`)));
|
|
172
172
|
})() }), _jsx(Text, { fontSize: "sm", color: theme.colors.text[500], children: "& Up" })] }) }, `rating-${r}`))) })) : null, section.searchable && (_jsx(Input, { size: "xs", h: "26px", fontSize: "xs", placeholder: `Search ${section.label}...`, borderRadius: "md", bg: theme.colors.gray[50], border: "1px solid",
|
|
173
|
-
// boxborder[
|
|
173
|
+
// boxborder[500], not raw gray[200]: WCAG 1.4.11 needs >=3.0 for a control
|
|
174
174
|
// boundary against any named surface up to `muted` (lightest); gray[200] fails
|
|
175
175
|
// there in dark mode.
|
|
176
|
-
borderColor: theme.colors.boxborder[
|
|
176
|
+
borderColor: theme.colors.boxborder[500], _focus: { borderColor: theme.colors.red[400], boxShadow: "none" }, value: searchTerms[section.id] || "", onChange: (e) => {
|
|
177
177
|
const v = e.target.value;
|
|
178
178
|
setSearchTerms((prev) => ({ ...prev, [section.id]: v }));
|
|
179
179
|
if (v)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { softenToContrast } from "../../Theme/tokens/builders/outlineRung.js";
|
|
2
|
+
import { PLACEHOLDER_TEXT } from "../../Theme/tokens/builders/surfaceRungs.js";
|
|
1
3
|
export const Input = {
|
|
2
4
|
baseStyle: {
|
|
3
5
|
field: {
|
|
@@ -48,8 +50,10 @@ export const Input = {
|
|
|
48
50
|
bg: theme.colors.gray[50],
|
|
49
51
|
border: "0.063rem solid",
|
|
50
52
|
borderColor,
|
|
53
|
+
// `textMuted` is body copy, so a hint read as a filled value (6.59:1).
|
|
54
|
+
// Settled against the field's own bg to just clear of AA.
|
|
51
55
|
_placeholder: {
|
|
52
|
-
color: theme.colors.
|
|
56
|
+
color: softenToContrast(theme.colors.placeholder[500], theme.colors.gray[50], PLACEHOLDER_TEXT),
|
|
53
57
|
},
|
|
54
58
|
_hover: {
|
|
55
59
|
borderColor: primary,
|
|
@@ -5,6 +5,7 @@ import { DragDropContext, Droppable, Draggable, } from "@hello-pangea/dnd";
|
|
|
5
5
|
import { Plus, Trash2, GripVertical, ChevronLeft, ChevronRight } from "lucide-react";
|
|
6
6
|
import { VariableSizeList as List, } from "react-window";
|
|
7
7
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
8
|
+
import { scrollbarStyles } from "../../Theme/tokens/builders/scrollbar.js";
|
|
8
9
|
import { useGetPreferences, useSavePreferences, } from "../../Hooks/usePreferences.js";
|
|
9
10
|
import AccountCard from "./AccountCard.js";
|
|
10
11
|
import HeaderActions from "../Header/HeaderActions.js";
|
|
@@ -364,37 +365,15 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
|
|
|
364
365
|
: colors.boxborder[200]}`, transition: "background 0.15s ease, border-color 0.15s ease, width 0.2s ease", display: "flex", flexDirection: "column", flexShrink: 0, overflow: isColCollapsed ? "visible" : "hidden", height: `${containerHeight - 60}px`, onMouseEnter: () => setHoveredColumn(colId), onMouseLeave: () => setHoveredColumn(null), children: [isColCollapsed ? (_jsxs(Flex, { direction: "column", align: "stretch", flex: "1", width: "100%", minH: 0, overflow: "visible", position: "relative", children: [_jsxs(Flex, { as: "header", direction: "column", align: "center", flexShrink: 0, width: "100%", py: 3, px: 1, gap: 3, borderTop: "0.25rem solid", borderTopColor: (_a = column.color) !== null && _a !== void 0 ? _a : colors.primary[500], bg: colors.background[100], position: "relative", zIndex: 1, children: [enableColumnReorder && columnDragHandleProps ? (_jsx(Flex, { align: "center", justify: "center", flexShrink: 0, cursor: "grab", ...columnDragHandleProps, children: _jsx(Box, { as: GripVertical, size: 14, color: colors.textMuted }) })) : null, enableColumnCollapse && (_jsx(Flex, { flexShrink: 0, w: "100%", justify: "center", bg: colors.background[100], position: "relative", zIndex: 3, children: _jsx(IconButton, { "aria-label": "Expand column", icon: _jsx(ChevronRight, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", onClick: () => toggleColumnCollapsed(colId) }) })), _jsx(Text, { as: "span", fontWeight: "700", fontSize: "0.75rem", color: colors.text[700], sx: {
|
|
365
366
|
writingMode: "vertical-rl",
|
|
366
367
|
textOrientation: "mixed",
|
|
367
|
-
}, maxH: `${Math.max(120, containerHeight - 200)}px`, overflow: "hidden", lineHeight: "1.2", title: column.title, children: column.title }), _jsx(Badge, { minW: "1.25rem", h: "1.25rem", borderRadius: "full", border: "1px solid", borderColor: colors.boxborder[200], display: "flex", backgroundColor: colors.background[100], alignItems: "center", justifyContent: "center", color: colors.text[900], fontWeight: 600, fontSize: "10px", children: (_b = column === null || column === void 0 ? void 0 : column.items) === null || _b === void 0 ? void 0 : _b.length })] }), column.customNode ? (_jsx(Box, { flexShrink: 0, minH: COLLAPSED_CUSTOM_NODE_TOP_RESERVE, w: "100%", bg: colors.background[100], "aria-hidden": true })) : null, column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", flex: "1", minH: 0, w: "100%", overflow: "visible", py: 2, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "flex-start", bg: colors.background[100], position: "relative", zIndex: 2, children: _jsx(Box, { position: "relative", transform: "rotate(90deg)", transformOrigin: "center center", marginTop: '1rem', children: _jsx(VStack, { align: "stretch", spacing: 1, minW: "max-content", fontSize: "xs", color: colors.text[600], children: column.customNode() }) }) })) : (_jsx(Box, { flex: "1", minH: 0 }))] })) : (_jsxs(Flex, { width: "100%", h: !isColCollapsed && !!((_c = column.customNode) === null || _c === void 0 ? void 0 : _c.call(column)) ? "auto" : "2.75rem", align: !isColCollapsed && !!((_d = column.customNode) === null || _d === void 0 ? void 0 : _d.call(column)) ? "flex-start" : "center", px: 3, py: 2, flexShrink: 0, justifyContent: "space-between", position: "relative", gap: 2, borderBottom: `0.063rem solid ${colors.boxborder[
|
|
368
|
+
}, maxH: `${Math.max(120, containerHeight - 200)}px`, overflow: "hidden", lineHeight: "1.2", title: column.title, children: column.title }), _jsx(Badge, { minW: "1.25rem", h: "1.25rem", borderRadius: "full", border: "1px solid", borderColor: colors.boxborder[200], display: "flex", backgroundColor: colors.background[100], alignItems: "center", justifyContent: "center", color: colors.text[900], fontWeight: 600, fontSize: "10px", children: (_b = column === null || column === void 0 ? void 0 : column.items) === null || _b === void 0 ? void 0 : _b.length })] }), column.customNode ? (_jsx(Box, { flexShrink: 0, minH: COLLAPSED_CUSTOM_NODE_TOP_RESERVE, w: "100%", bg: colors.background[100], "aria-hidden": true })) : null, column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", flex: "1", minH: 0, w: "100%", overflow: "visible", py: 2, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "flex-start", bg: colors.background[100], position: "relative", zIndex: 2, children: _jsx(Box, { position: "relative", transform: "rotate(90deg)", transformOrigin: "center center", marginTop: '1rem', children: _jsx(VStack, { align: "stretch", spacing: 1, minW: "max-content", fontSize: "xs", color: colors.text[600], children: column.customNode() }) }) })) : (_jsx(Box, { flex: "1", minH: 0 }))] })) : (_jsxs(Flex, { width: "100%", h: !isColCollapsed && !!((_c = column.customNode) === null || _c === void 0 ? void 0 : _c.call(column)) ? "auto" : "2.75rem", align: !isColCollapsed && !!((_d = column.customNode) === null || _d === void 0 ? void 0 : _d.call(column)) ? "flex-start" : "center", px: 3, py: 2, flexShrink: 0, justifyContent: "space-between", position: "relative", gap: 2, borderBottom: `0.063rem solid ${colors.boxborder[200]}`, children: [_jsxs(Flex, { direction: "column", gap: 1, minW: 0, flex: "1", children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(Box, { boxSize: "0.625rem", borderRadius: "full", bg: (_e = column.color) !== null && _e !== void 0 ? _e : colors.primary[500], flexShrink: 0 }), enableColumnReorder && columnDragHandleProps ? (_jsx(Flex, { align: "center", justify: "center", flexShrink: 0, cursor: "grab", ...columnDragHandleProps, children: _jsx(Box, { as: GripVertical, size: 14, color: colors.textMuted }) })) : null, _jsx(Text, { as: "span", fontWeight: "600", fontSize: "0.875rem", color: colors.text[700], noOfLines: 1, minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", children: column.title }) })] }), column.customNode ? (_jsx(Box, { as: "section", "aria-label": "Column summary", width: "100%", flexShrink: 0, fontSize: "xs", color: colors.text[600], children: (_f = column.customNode) === null || _f === void 0 ? void 0 : _f.call(column) })) : null] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(Badge, { minW: "1.5rem", h: "1.5rem", px: 2, borderRadius: "full", backgroundColor: colors.gray[100], display: "flex", alignItems: "center", justifyContent: "center", color: colors.text[700], fontWeight: 600, fontSize: "0.625rem", children: (_g = column === null || column === void 0 ? void 0 : column.items) === null || _g === void 0 ? void 0 : _g.length }), enableColumnCollapse && (_jsx(IconButton, { "aria-label": "Collapse column", icon: _jsx(ChevronLeft, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", flexShrink: 0, onClick: () => toggleColumnCollapsed(colId) })), canDelete &&
|
|
368
369
|
hoveredColumn === colId &&
|
|
369
370
|
column.items.length > 0 && (_jsx(Box, { as: Trash2, size: 16, cursor: "pointer", color: colors.text[600], _hover: { color: colors.semanticText.error }, onClick: () => handleColumnDelete(colId), transition: "color 0.2s ease", flexShrink: 0 })), !(canDelete &&
|
|
370
371
|
hoveredColumn === colId &&
|
|
371
372
|
column.items.length > 0) && _jsx(Box, { width: "16px", height: "16px", flexShrink: 0 })] })] })), !isColCollapsed && (_jsxs(Box, { px: 2, flex: "1", overflowY: "auto", width: "100%", sx: {
|
|
373
|
+
...scrollbarStyles(colors),
|
|
372
374
|
overflowY: "auto",
|
|
373
375
|
overflowX: "hidden",
|
|
374
|
-
|
|
375
|
-
scrollbarColor: `${colors.gray[300]} transparent`,
|
|
376
|
-
"&::-webkit-scrollbar": {
|
|
377
|
-
width: "6px !important",
|
|
378
|
-
height: "6px !important",
|
|
379
|
-
},
|
|
380
|
-
"&::-webkit-scrollbar-track": {
|
|
381
|
-
background: colors.gray[100],
|
|
382
|
-
borderRadius: "base",
|
|
383
|
-
marginTop: "4px",
|
|
384
|
-
marginBottom: "4px",
|
|
385
|
-
},
|
|
386
|
-
"&::-webkit-scrollbar-thumb": {
|
|
387
|
-
background: colors.gray[300],
|
|
388
|
-
borderRadius: "base",
|
|
389
|
-
border: "1px solid",
|
|
390
|
-
borderColor: colors.gray[100],
|
|
391
|
-
},
|
|
392
|
-
"&::-webkit-scrollbar-thumb:hover": {
|
|
393
|
-
background: colors.gray[400],
|
|
394
|
-
},
|
|
395
|
-
"&": {
|
|
396
|
-
scrollbarGutter: "stable both-edges",
|
|
397
|
-
},
|
|
376
|
+
"&": { scrollbarGutter: "stable both-edges" },
|
|
398
377
|
cursor: canDrag ? "grab" : "not-allowed",
|
|
399
378
|
}, children: [(noItems === null || noItems === void 0 ? void 0 : noItems.isVisible) && column.items.length === 0 && (_jsx(NoItemsTemplate, { column: column, noItems: noItems, colors: colors })), virtualization ? (_jsx(List, { ref: (el) => {
|
|
400
379
|
if (el)
|
|
@@ -409,26 +388,7 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
|
|
|
409
388
|
return null;
|
|
410
389
|
const showAddColumn = Boolean(customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.isVisible);
|
|
411
390
|
const hasAnyColumns = Object.keys(columns).length > 0;
|
|
412
|
-
const flexScrollSx =
|
|
413
|
-
"&::-webkit-scrollbar": {
|
|
414
|
-
height: "6px",
|
|
415
|
-
},
|
|
416
|
-
"&::-webkit-scrollbar-track": {
|
|
417
|
-
background: colors.gray[100],
|
|
418
|
-
borderRadius: "base",
|
|
419
|
-
margin: "0 4px",
|
|
420
|
-
},
|
|
421
|
-
"&::-webkit-scrollbar-thumb": {
|
|
422
|
-
background: colors.gray[400],
|
|
423
|
-
borderRadius: "base",
|
|
424
|
-
border: `1px solid ${colors.gray[100]}`,
|
|
425
|
-
},
|
|
426
|
-
"&::-webkit-scrollbar-thumb:hover": {
|
|
427
|
-
background: colors.gray[500],
|
|
428
|
-
},
|
|
429
|
-
scrollbarWidth: "thin",
|
|
430
|
-
scrollbarColor: `${colors.gray[400]} ${colors.gray[100]}`,
|
|
431
|
-
};
|
|
391
|
+
const flexScrollSx = scrollbarStyles(colors);
|
|
432
392
|
const addColumnBox = !isBoardLoading && showAddColumn && hasAnyColumns && (_jsx(Box, { width: columnWidth, borderRadius: "lg", border: `0.125rem dashed ${colors.boxborder[500]}`, bg: colors.background[100], flexShrink: 0, height: `${containerHeight - 60}px`, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", _hover: { borderColor: colors.primary[500] }, onClick: () => { var _a; return (_a = customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.onAddColumn) === null || _a === void 0 ? void 0 : _a.call(customizeColumn); }, children: _jsxs(Flex, { direction: "column", align: "center", gap: 2, children: [_jsx(Box, { as: Plus, size: 20, color: colors.text[700] }), _jsx(Text, { fontSize: "sm", color: colors.text[600], children: (customizeColumn === null || customizeColumn === void 0 ? void 0 : customizeColumn.buttonText) || "Add column" })] }) }));
|
|
433
393
|
const columnsList = Object.entries(columns).map(([colId, column], colIndex) => {
|
|
434
394
|
const isColCollapsed = enableColumnCollapse && Boolean(collapsedColumns[colId]);
|
|
@@ -4,7 +4,7 @@ import { CheckCircle, Crown, Users } from "lucide-react";
|
|
|
4
4
|
import Button from "../Button/Button.js";
|
|
5
5
|
import UpgradeButton from "../UpgradeButton/UpgradeButton.js";
|
|
6
6
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
7
|
-
import {
|
|
7
|
+
import { resolveGradient } from "../../Theme/tokens/builders/gradientInk.js";
|
|
8
8
|
import { formatLimitUsage, resolveLimitCopy } from "./limitReachedCopy.js";
|
|
9
9
|
const KIND_ICON = {
|
|
10
10
|
record: Crown,
|
|
@@ -19,10 +19,9 @@ const LimitReachedModal = ({ isOpen, onClose, kind, limit = null, used = null, c
|
|
|
19
19
|
const copy = resolveLimitCopy(kind, canManageBilling);
|
|
20
20
|
const usage = formatLimitUsage(kind, used, limit);
|
|
21
21
|
const KindIcon = KIND_ICON[kind];
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const ink = onGradient(gradient.from, gradient.to, colors.white, colors.black);
|
|
22
|
+
// Header banner uses the brand gradient so it reads correctly across all 9 brands.
|
|
23
|
+
const gradient = resolveGradient(colors.gradient, colors.white, colors.black);
|
|
24
|
+
const ink = gradient.ink;
|
|
26
25
|
return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, size: "lg", motionPreset: "slideInBottom", children: [_jsx(ModalOverlay, { backdropFilter: "blur(5px)" }), _jsxs(ModalContent, { borderRadius: "xl", overflow: "hidden", boxShadow: "2xl", mx: 4, children: [_jsxs(Box, { bgGradient: `linear(to-r, ${gradient.from}, ${gradient.to})`, color: ink, children: [_jsx(ModalHeader, { pb: 4, children: _jsxs(Flex, { align: "center", children: [_jsx(Icon, { as: KindIcon, boxSize: "24px", mr: "12px" }), _jsx(Text, { fontSize: "xl", fontWeight: "bold", children: title !== null && title !== void 0 ? title : copy.title })] }) }), _jsx(ModalCloseButton, { "aria-label": "Dismiss", color: ink, _hover: { opacity: 0.7 } })] }), _jsxs(ModalBody, { py: 6, children: [_jsx(Text, { textAlign: "center", fontSize: "md", fontWeight: 600, color: colors.text[700], children: message !== null && message !== void 0 ? message : copy.message }), usage && (_jsx(Text, { textAlign: "center", fontSize: "sm", color: colors.textMuted, mt: 2, children: usage })), features && features.length > 0 && (_jsx(List, { spacing: 2, mt: 5, children: features.map((feature) => (_jsxs(ListItem, { display: "flex", alignItems: "center", fontSize: "sm", color: colors.text[600], children: [_jsx(ListIcon, { as: CheckCircle, color: colors.semanticText.success }), feature] }, feature))) }))] }), _jsx(Divider, {}), _jsx(ModalFooter, { children: _jsxs(HStack, { spacing: 3, children: [_jsx(Button, { label: canManageBilling ? "Maybe later" : "Close", variant: "outline", colorScheme: "gray", size: "md", onClick: onClose }), canManageBilling && (_jsx(UpgradeButton, { label: "Upgrade plan", size: "md", onClick: () => onUpgrade === null || onUpgrade === void 0 ? void 0 : onUpgrade() }))] }) })] })] }));
|
|
27
26
|
};
|
|
28
27
|
export default LimitReachedModal;
|
|
@@ -55,7 +55,7 @@ export default function MultiSelect({ value, onValueChange, width = "100%", labe
|
|
|
55
55
|
// surface up to `muted` (lightest); [500] fails there, [800] clears all with margin.
|
|
56
56
|
borderColor: error || localError
|
|
57
57
|
? theme.colors.semanticText.error
|
|
58
|
-
: theme.colors.boxborder[
|
|
58
|
+
: theme.colors.boxborder[500], borderRadius: "lg", bg: theme.colors.gray[50], minH: s.minH, transition: "border-color 0.2s, box-shadow 0.2s", _focusWithin: {
|
|
59
59
|
borderColor: error || localError
|
|
60
60
|
? theme.colors.semanticText.error
|
|
61
61
|
: theme.colors.primary[500],
|
|
@@ -63,11 +63,11 @@ const OrgSwitcher = ({ organizations, value, onChange, isLoading = false, isSear
|
|
|
63
63
|
focusOption(filtered.length - 1);
|
|
64
64
|
}
|
|
65
65
|
}, [activeIndex, filtered.length, focusOption]);
|
|
66
|
-
// boxborder[
|
|
66
|
+
// boxborder[500], not raw gray[200]: this styles a real `<button>` (Flex as="button" below),
|
|
67
67
|
// so its border is a control boundary — WCAG 1.4.11 needs >=3.0 against any named surface up
|
|
68
68
|
// to `muted` (lightest); gray[200] fails there in dark mode.
|
|
69
69
|
const triggerStyles = triggerVariant === "outline"
|
|
70
|
-
? { border: "1px solid", borderColor: theme.colors.boxborder[
|
|
70
|
+
? { border: "1px solid", borderColor: theme.colors.boxborder[500], bg: theme.colors.background[50] }
|
|
71
71
|
: triggerVariant === "subtle"
|
|
72
72
|
? { bg: theme.colors.gray[50] }
|
|
73
73
|
: { bg: "transparent" };
|
|
@@ -8,7 +8,7 @@ export default function PinInputs({ otp, mask, defaultValue, placeholder, manage
|
|
|
8
8
|
// [800], not [300]/[700]: WCAG 1.4.11 needs >=3.0 for a control boundary, measured
|
|
9
9
|
// against the parent surface — up to `muted` (lightest). [700] fails there (2.41-2.72);
|
|
10
10
|
// [800] clears all named surfaces with margin (3.44-3.90).
|
|
11
|
-
borderColor: theme.colors.boxborder[
|
|
11
|
+
borderColor: theme.colors.boxborder[500], _focus: {
|
|
12
12
|
borderColor: theme.colors.primary[500],
|
|
13
13
|
boxShadow: `0 0 0 0.063rem ${theme.colors.primary[500]}`,
|
|
14
14
|
} }, index))) }) })] }));
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Flex, Text } from "@chakra-ui/react";
|
|
3
3
|
import { AlertCircle, Clock, Sparkles } from "lucide-react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
-
import {
|
|
6
|
-
import { chipBorder, chipFill,
|
|
5
|
+
import { resolveGradient, gradientCss } from "../../Theme/tokens/builders/gradientInk.js";
|
|
6
|
+
import { chipBorder, chipFill, statusGradient, } from "./planPillGradient.js";
|
|
7
7
|
const TONE_ICON = {
|
|
8
8
|
normal: Sparkles,
|
|
9
9
|
warning: Clock,
|
|
@@ -13,15 +13,15 @@ const PlanPill = ({ label, mobileLabel, status, tone = "normal", icon, gradient,
|
|
|
13
13
|
const theme = useCustomTheme();
|
|
14
14
|
const c = theme.colors;
|
|
15
15
|
const toneGradient = {
|
|
16
|
-
normal:
|
|
16
|
+
normal: c.gradient,
|
|
17
17
|
warning: statusGradient(c.semantic.warning),
|
|
18
18
|
danger: statusGradient(c.semantic.error),
|
|
19
19
|
};
|
|
20
|
-
const resolved =
|
|
21
|
-
const ink =
|
|
20
|
+
const resolved = resolveGradient(gradient !== null && gradient !== void 0 ? gradient : toneGradient[tone], c.white, c.black);
|
|
21
|
+
const ink = resolved.ink;
|
|
22
22
|
const Icon = icon === undefined ? TONE_ICON[tone] : icon;
|
|
23
23
|
const hasMobile = !!mobileLabel && mobileLabel !== label;
|
|
24
|
-
return (_jsxs(Box, { as: "button", type: "button", "aria-label": ariaLabel || (status ? `${label} — ${status}` : label), onClick: onClick, display: "inline-flex", alignItems: "center", gap: "7px", pl: "12px", pr: status ? "5px" : "12px", py: "3px", bgImage:
|
|
24
|
+
return (_jsxs(Box, { as: "button", type: "button", "aria-label": ariaLabel || (status ? `${label} — ${status}` : label), onClick: onClick, display: "inline-flex", alignItems: "center", gap: "7px", pl: "12px", pr: status ? "5px" : "12px", py: "3px", bgImage: gradientCss(resolved), color: ink, borderRadius: "full", whiteSpace: "nowrap", cursor: "pointer", transition: "transform 0.2s ease, box-shadow 0.2s ease", _hover: {
|
|
25
25
|
transform: "translateY(-1px)",
|
|
26
26
|
boxShadow: `0 6px 18px ${resolved.from}59`,
|
|
27
27
|
}, _focusVisible: {
|
|
@@ -2,22 +2,10 @@ import { resolveAvatarFill } from "../../Theme/tokens/builders/statusTone.js";
|
|
|
2
2
|
import { relativeLuminance } from "../../Theme/tokens/builders/color.js";
|
|
3
3
|
export const STATUS_INK = "#ffffff";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* not
|
|
7
|
-
*
|
|
8
|
-
* Its tone carries meaning (normal / warning / danger), and a brand gradient can
|
|
9
|
-
* collide with that: rosewood's `#c74962 → #ea0727` is red, so a healthy plan
|
|
10
|
-
* rendered as if it had expired. Greyscale brands failed the other way, sinking
|
|
11
|
-
* the badge into the header chrome.
|
|
12
|
-
*
|
|
13
|
-
* One accent for both color modes is deliberate: a lighter dark-mode variant was
|
|
14
|
-
* tried and flipped `onGradient`'s ink to black, which read as a washed-out candy
|
|
15
|
-
* pill on dark chrome. These stops keep white ink in both modes, so the badge looks
|
|
16
|
-
* like the same component everywhere. Verified at AA (>= 4.5:1) on both stops.
|
|
17
|
-
*
|
|
18
|
-
* Consumers who genuinely want another colour still pass `gradient`.
|
|
5
|
+
* Opt-in accent for consumers who want a fixed badge colour instead of the brand `gradient`.
|
|
6
|
+
* One hue, like every brand gradient — a second hue reads as a status change, not a style.
|
|
19
7
|
*/
|
|
20
|
-
export const ACCENT_GRADIENT = { from: "#
|
|
8
|
+
export const ACCENT_GRADIENT = { from: "#8b3fc8", to: "#762d9d" };
|
|
21
9
|
/**
|
|
22
10
|
* Sinks both stops until WHITE ink clears AA, keeping each stop's hue. Any mid-tone gradient —
|
|
23
11
|
* a brand `gradient` token, a status scale — otherwise flips `onGradient` to black ink, so the
|
|
@@ -104,7 +104,7 @@ const ProductPrice = ({ options, size, onSelect, rightSlot }) => {
|
|
|
104
104
|
}, templateColumns: { base: '1fr auto', md: '1fr auto' },
|
|
105
105
|
// columnGap={{ base: 2, md: 3 }}
|
|
106
106
|
// rowGap={{ base: 1.5, md: 2 }}
|
|
107
|
-
alignItems: "center", children: [_jsx(HStack, { gridColumn: 1, gridRow: 1, spacing: 2, align: "center", minW: 0, mb: 0, children: _jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: { base: "xs", md: "sm" }, fontWeight: "medium", whiteSpace: "nowrap", children: option.label }) }) }), _jsx(Box, { gridColumn: 1, gridRow: 2, mt: 0, textAlign: "left", children: _jsxs(HStack, { spacing: 2, align: "center", children: [option.offer > 0 && (_jsx(Badge, { bg: theme.colors.green[100], color: accentTextOnCanvas(theme.colors.green, theme.colors.green[100]), borderRadius: "md", px: { base: 0, md: 0.5 }, py: { base: 0, md: 0.25 }, fontWeight: "bold", fontSize: "10px", flexShrink: 0, children: isMobile ? `${option.offer}%` : `${option.offer}% OFF` })), _jsxs(Text, { fontSize: "sm", fontWeight: "bold", color: accentTextOnCanvas(theme.colors.red, isSelected ? theme.colors.red[50] : theme.colors.background[50]), whiteSpace: "nowrap", children: ["\u20B9", discounted] }), option.offer > 0 && (_jsxs(Text, { fontSize: "xs", color: theme.colors.textMuted, textDecoration: "line-through", whiteSpace: "nowrap", children: ["\u20B9", option.price] }))] }) }), _jsx(Box, { gridColumn: 2, gridRow: 1, ml: { base: 0, md: 0 }, justifySelf: "end", w: { base: "0.625rem", md: "0.75rem" }, h: { base: "0.625rem", md: "0.75rem" }, minW: { base: "0.625rem", md: "0.75rem" }, borderRadius: "full", border: "0.125rem solid", borderColor: isSelected ? theme.colors.red[500] : theme.colors.boxborder[
|
|
107
|
+
alignItems: "center", children: [_jsx(HStack, { gridColumn: 1, gridRow: 1, spacing: 2, align: "center", minW: 0, mb: 0, children: _jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: { base: "xs", md: "sm" }, fontWeight: "medium", whiteSpace: "nowrap", children: option.label }) }) }), _jsx(Box, { gridColumn: 1, gridRow: 2, mt: 0, textAlign: "left", children: _jsxs(HStack, { spacing: 2, align: "center", children: [option.offer > 0 && (_jsx(Badge, { bg: theme.colors.green[100], color: accentTextOnCanvas(theme.colors.green, theme.colors.green[100]), borderRadius: "md", px: { base: 0, md: 0.5 }, py: { base: 0, md: 0.25 }, fontWeight: "bold", fontSize: "10px", flexShrink: 0, children: isMobile ? `${option.offer}%` : `${option.offer}% OFF` })), _jsxs(Text, { fontSize: "sm", fontWeight: "bold", color: accentTextOnCanvas(theme.colors.red, isSelected ? theme.colors.red[50] : theme.colors.background[50]), whiteSpace: "nowrap", children: ["\u20B9", discounted] }), option.offer > 0 && (_jsxs(Text, { fontSize: "xs", color: theme.colors.textMuted, textDecoration: "line-through", whiteSpace: "nowrap", children: ["\u20B9", option.price] }))] }) }), _jsx(Box, { gridColumn: 2, gridRow: 1, ml: { base: 0, md: 0 }, justifySelf: "end", w: { base: "0.625rem", md: "0.75rem" }, h: { base: "0.625rem", md: "0.75rem" }, minW: { base: "0.625rem", md: "0.75rem" }, borderRadius: "full", border: "0.125rem solid", borderColor: isSelected ? theme.colors.red[500] : theme.colors.boxborder[500], bg: theme.colors.background[50], display: "flex", alignItems: "center", justifyContent: "center", boxShadow: "none", children: isSelected && (_jsx(Box, { w: { base: "0.25rem", md: "0.3125rem" }, h: { base: "0.25rem", md: "0.3125rem" }, bg: theme.colors.red[500], borderRadius: "full" })) })] }, option.var_id));
|
|
108
108
|
}) }) })), _jsxs(Flex, { mt: 2, w: "full", gap: 3, direction: { base: "column", md: "row" }, align: { base: "flex-start", md: "center" }, justify: { base: "flex-start", md: rightSlot ? "space-between" : "flex-start" }, children: [_jsxs(Box, { display: "flex", alignItems: "center", fontSize: cfg.price, gap: 2, minW: 0, children: [selected.offer > 0 && (_jsxs(Text, { color: theme.colors.textMuted, textDecoration: "line-through", children: ["\u20B9", selected.price] })), _jsxs(Text, { color: accentTextOnCanvas(theme.colors.red, theme.colors.backgroundColor.main), fontWeight: "semibold", children: ["\u20B9", getDiscountedPrice(selected)] })] }), rightSlot && (_jsx(Box, { flexShrink: 0, mt: { base: 2, md: 0 }, children: rightSlot }))] })] }));
|
|
109
109
|
};
|
|
110
110
|
export default ProductPrice;
|
|
@@ -13,7 +13,7 @@ export const ProfileCardFooter = ({ children, }) => {
|
|
|
13
13
|
};
|
|
14
14
|
export default function ProfileCard({ maxW, align, variant, direction, justify, children, size, color, overflow, dividercolor, dividersize = "0.5px", dividervariant = "solid", CardStyle, CardHeaderStyle, CardBodyStyle, borderTopColor, borderLeftColor, }) {
|
|
15
15
|
const { colors } = useCustomTheme();
|
|
16
|
-
const resolvedDividerColor = dividercolor !== null && dividercolor !== void 0 ? dividercolor : colors.border[
|
|
16
|
+
const resolvedDividerColor = dividercolor !== null && dividercolor !== void 0 ? dividercolor : colors.border[200];
|
|
17
17
|
const accentBorder = `2px solid ${colors.primary[500]}`;
|
|
18
18
|
const isReactElement = (child) => {
|
|
19
19
|
return child !== null && typeof child === "object" && "type" in child;
|
|
@@ -35,7 +35,7 @@ export default function ProfilePhotoViewer({ photoUrl, onPhotoChange, imageWidth
|
|
|
35
35
|
// [800], not [300]: the edit IconButton's border is a control boundary — WCAG 1.4.11 needs
|
|
36
36
|
// >=3.0 against any named surface up to `muted` (lightest); [300] fails there, [800] clears
|
|
37
37
|
// all with margin.
|
|
38
|
-
const border = c.boxborder[
|
|
38
|
+
const border = c.boxborder[500];
|
|
39
39
|
// Shared modern frame for whichever media we render (photo / pdf / fallback).
|
|
40
40
|
const mediaFrame = {
|
|
41
41
|
boxSize: imageWidth,
|
|
@@ -15,7 +15,7 @@ const ReorderList = ({ label = "", items, onReorder, showRemoveIcon = false, onR
|
|
|
15
15
|
};
|
|
16
16
|
return (_jsxs(Box, { borderWidth: "0.063rem", borderRadius: "md", px: 3, py: 2, bg: colors.background[50], children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(BetweenHorizonalStart, {}), _jsx(Text, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize: 14, lineHeight: "100%", letterSpacing: "4%", textTransform: "uppercase", py: 4, children: label })] }), _jsx(Divider, {}), _jsx("br", {}), _jsx(DragDropContext, { onDragEnd: handleDragEnd, children: _jsx(Droppable, { droppableId: "item-list", direction: "horizontal", children: (provided) => (_jsxs(HStack, { ref: provided.innerRef, ...provided.droppableProps, spacing: 4, overflowX: "auto", children: [items.map((item, index) => (_jsx(Draggable, { draggableId: item.id, index: index, children: (provided) => {
|
|
17
17
|
var _a;
|
|
18
|
-
return (_jsxs(Box, { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, position: "relative", border: "0.063rem solid", borderColor: colors.boxborder[
|
|
18
|
+
return (_jsxs(Box, { ref: provided.innerRef, ...provided.draggableProps, ...provided.dragHandleProps, position: "relative", border: "0.063rem solid", borderColor: colors.boxborder[200], borderRadius: "md", overflow: "hidden", children: [_jsx(Image, { src: item.previewUrl, alt: (_a = item.name) !== null && _a !== void 0 ? _a : `item-${index}`, boxSize: "7.5rem", objectFit: "cover" }), _jsx(IconButton, { icon: _jsx(GripVertical, { size: 16, color: colors.textMuted }), "aria-label": "Drag", size: "sm", position: "absolute", top: 1, left: 1, variant: "ghost" }), _jsx(Badge, { position: "absolute", colorScheme: "gray", variant: "solid", bottom: 1, right: 1, children: index + 1 }), showRemoveIcon && (_jsx(IconButton, { icon: _jsx(X, { size: 16, color: colors.semanticText.error }), "aria-label": "Remove", size: "sm", position: "absolute", top: 1, right: 1, variant: "ghost", onClick: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove(item.id) }))] }));
|
|
19
19
|
} }, item.id))), provided.placeholder] })) }) })] }));
|
|
20
20
|
};
|
|
21
21
|
export default ReorderList;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "@chakra-ui/react";
|
|
3
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
|
+
import { scrollbarStyles, } from "../../Theme/tokens/builders/scrollbar.js";
|
|
5
|
+
const ScrollbarBox = ({ children, height, maxHeight, overflowX, overflowY = "auto", variant = "default", scrollContainerRef, }) => {
|
|
6
|
+
const { colors } = useCustomTheme();
|
|
7
|
+
return (_jsx(Box, { ref: scrollContainerRef, height: height, maxHeight: maxHeight, position: "relative", sx: { overflowX, overflowY, ...scrollbarStyles(colors, variant) }, children: children }));
|
|
8
|
+
};
|
|
9
|
+
export default ScrollbarBox;
|
|
@@ -449,7 +449,7 @@ const SearchSelect = ({ id, label, options, onSelect, onSearch, isOptionLoading
|
|
|
449
449
|
var _a, _b, _c, _d, _e;
|
|
450
450
|
const insideLabel = (_a = insideSelect.value) === null || _a === void 0 ? void 0 : _a.label;
|
|
451
451
|
const insidePlaceholder = (_b = insideSelect.placeholder) !== null && _b !== void 0 ? _b : "Select";
|
|
452
|
-
return (_jsxs(Box, { position: "relative", ref: customSelectRef, flexShrink: 0, ml: s.insideSelectMarginLeft, h: "-webkit-fill-available", borderRight: "0.063rem solid", borderColor: theme.colors.boxborder[
|
|
452
|
+
return (_jsxs(Box, { position: "relative", ref: customSelectRef, flexShrink: 0, ml: s.insideSelectMarginLeft, h: "-webkit-fill-available", borderRight: "0.063rem solid", borderColor: theme.colors.boxborder[200], bg: customSelectOpen
|
|
453
453
|
? theme.colors.primary.opacity[8]
|
|
454
454
|
: theme.colors.background[400], borderLeftRadius: "md", borderRightRadius: 0, transition: "background 0.15s ease, box-shadow 0.15s ease", boxShadow: customSelectOpen
|
|
455
455
|
? `inset 0 0 0 0.063rem ${theme.colors.primary[500]}`
|
|
@@ -506,10 +506,10 @@ const SearchSelect = ({ id, label, options, onSelect, onSearch, isOptionLoading
|
|
|
506
506
|
setCustomSelectOpen(false);
|
|
507
507
|
return !prev;
|
|
508
508
|
});
|
|
509
|
-
}, "aria-label": "toggle-dropdown", display: "flex", alignItems: "center", children: isOpen ? (_jsx(ChevronUp, { size: s.chevronSize })) : (_jsx(ChevronDown, { size: s.chevronSize })) }))] })] }) }), isOpen && (_jsx(Portal, { children: _jsxs(Box, { ref: setDropdownMenuRef, id: listboxId, role: "listbox", "aria-multiselectable": isMultiple || undefined, position: "fixed", top: `${dropdownPos.top}px`, left: `${dropdownPos.left}px`, width: `${dropdownPos.width}px`, zIndex: 1500, maxH: "20rem", borderWidth: 1, borderColor: theme.colors.boxborder[200], borderRadius: "sm", bg: theme.colors.background[50], boxShadow: "md", display: "flex", flexDirection: "column", children: [isMultiple && isSelectAll && (_jsxs(Box, { py: s.optionRowPy, px: 3, cursor: "pointer", onClick: handleSelectAll, display: "flex", alignItems: "center", gap: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[
|
|
509
|
+
}, "aria-label": "toggle-dropdown", display: "flex", alignItems: "center", children: isOpen ? (_jsx(ChevronUp, { size: s.chevronSize })) : (_jsx(ChevronDown, { size: s.chevronSize })) }))] })] }) }), isOpen && (_jsx(Portal, { children: _jsxs(Box, { ref: setDropdownMenuRef, id: listboxId, role: "listbox", "aria-multiselectable": isMultiple || undefined, position: "fixed", top: `${dropdownPos.top}px`, left: `${dropdownPos.left}px`, width: `${dropdownPos.width}px`, zIndex: 1500, maxH: "20rem", borderWidth: 1, borderColor: theme.colors.boxborder[200], borderRadius: "sm", bg: theme.colors.background[50], boxShadow: "md", display: "flex", flexDirection: "column", children: [isMultiple && isSelectAll && (_jsxs(Box, { py: s.optionRowPy, px: 3, cursor: "pointer", onClick: handleSelectAll, display: "flex", alignItems: "center", gap: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[200]}`, children: [_jsx(Checkbox, { isChecked: allFilteredSelected, sx: { pointerEvents: "none" }, size: s.checkboxSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: allFilteredSelected ? "Unselect All" : "Select All" })] })), _jsx(Box, { flex: "1", overflowY: "auto", onScroll: handleScroll, maxH: "15rem", borderBottom: "0.063rem solid", borderColor: theme.colors.boxborder[200], children: isOptionLoading && filteredOptions.length === 0 ? (_jsxs(Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH, children: [_jsx(Spinner, { size: s.spinnerSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: loadingText })] })) : !isOptionLoading && filteredOptions.length === 0 ? (_jsx(Text, { p: 3, fontSize: s.dropdownTextFontSize, color: theme.colors.textMuted, children: "No results found" })) : (_jsxs(_Fragment, { children: [filteredOptions.map((option, index) => (_jsxs(Box, { id: getOptionId(index), role: "option", "aria-selected": isSelected(option.id), py: s.optionRowPy, px: 3, minH: s.optionRowMinH, cursor: "pointer", bg: index === activeIndex
|
|
510
510
|
? theme.colors.primary.opacity[8]
|
|
511
511
|
: isSelected(option.id)
|
|
512
512
|
? theme.colors.gray[100]
|
|
513
|
-
: "transparent", _hover: { bg: theme.colors.gray[50] }, onClick: () => handleSelect(option), onMouseEnter: () => setActiveIndex(index), display: "flex", alignItems: "center", gap: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[
|
|
513
|
+
: "transparent", _hover: { bg: theme.colors.gray[50] }, onClick: () => handleSelect(option), onMouseEnter: () => setActiveIndex(index), display: "flex", alignItems: "center", gap: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[200]}`, children: [isMultiple && (_jsx(Checkbox, { isChecked: isSelected(option.id), sx: { pointerEvents: "none" }, size: s.checkboxSize })), option.view ? (_jsx(_Fragment, { children: option.view })) : (_jsx(Text, { fontSize: s.dropdownTextFontSize, children: option.label }))] }, option.id))), ((pagination === null || pagination === void 0 ? void 0 : pagination.scrollLoading) || (isOptionLoading && filteredOptions.length > 0)) && (_jsxs(Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", justifyContent: "center", gap: 2, minH: s.optionRowMinH, children: [_jsx(Spinner, { size: s.spinnerSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: loadingText })] }))] })) }), (addNew === null || addNew === void 0 ? void 0 : addNew.enabled) && (_jsxs(Box, { py: s.optionRowPy, px: 3, borderTop: "0.063rem solid", borderColor: theme.colors.boxborder[200], bg: theme.colors.background[50], display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH, cursor: "pointer", onClick: addNew.onClick, _hover: { bg: theme.colors.gray[50] }, children: [addNew.icon || _jsx(Plus, { size: s.addNewIconSize }), _jsx(Text, { fontSize: s.dropdownTextFontSize, children: addNew.text || "Add New" })] }))] }) })), helperText && !error && _jsx(HelperText, { helperText: helperText }), error && _jsx(ErrorMessage, { errorMessage: errorMessage })] }));
|
|
514
514
|
};
|
|
515
515
|
export default SearchSelect;
|
|
@@ -60,7 +60,7 @@ export const Select = {
|
|
|
60
60
|
// [800], not [500]/[700]: WCAG 1.4.11 needs >=3.0 for a control boundary, measured
|
|
61
61
|
// against the parent surface — up to `muted` (lightest). [700] fails there (2.41-2.72);
|
|
62
62
|
// [800] clears all named surfaces with margin (3.44-3.90).
|
|
63
|
-
const borderColor = theme.colors.boxborder[
|
|
63
|
+
const borderColor = theme.colors.boxborder[500];
|
|
64
64
|
const shadowPrimary = theme.colors.boxShadow.primary;
|
|
65
65
|
const shadowError = theme.colors.boxShadow.error;
|
|
66
66
|
const primary = theme.colors.primary[500];
|
|
@@ -30,7 +30,7 @@ BottomIcon = false, BottomText, handleBottomClick, BottomTextColor, isColorOptio
|
|
|
30
30
|
const errorBorder = `2px solid ${theme.colors.semanticText.error}`;
|
|
31
31
|
// [800], not [500]: WCAG 1.4.11 needs >=3.0 for a control boundary against any named surface
|
|
32
32
|
// up to `muted` (lightest); [500] fails there, [800] clears all with margin.
|
|
33
|
-
const defaultBorderThin = `1px solid ${theme.colors.boxborder[
|
|
33
|
+
const defaultBorderThin = `1px solid ${theme.colors.boxborder[500]}`;
|
|
34
34
|
const [selectedOptions, setSelectedOptions] = useState(initialSelectedOption ? [initialSelectedOption] : []);
|
|
35
35
|
const [inputValue, setInputValue] = useState(searchQuery);
|
|
36
36
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -246,7 +246,7 @@ BottomIcon = false, BottomText, handleBottomClick, BottomTextColor, isColorOptio
|
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
248
|
setIsOpen(true);
|
|
249
|
-
}, onChange: (e) => handleInputChange(e.target.value), placeholder: placeholder, onKeyDown: handleKeyDown, id: id, name: name, role: "combobox", "aria-autocomplete": "list", "aria-haspopup": "listbox", "aria-expanded": isOpen, "aria-controls": listboxId, cursor: "pointer", borderColor: theme.colors.boxborder[
|
|
249
|
+
}, onChange: (e) => handleInputChange(e.target.value), placeholder: placeholder, onKeyDown: handleKeyDown, id: id, name: name, role: "combobox", "aria-autocomplete": "list", "aria-haspopup": "listbox", "aria-expanded": isOpen, "aria-controls": listboxId, cursor: "pointer", borderColor: theme.colors.boxborder[500], transition: "border-color 0.2s, box-shadow 0.2s", _hover: {
|
|
250
250
|
borderColor: error
|
|
251
251
|
? theme.colors.semanticText.error
|
|
252
252
|
: theme.colors.primary[500],
|
|
@@ -264,7 +264,7 @@ BottomIcon = false, BottomText, handleBottomClick, BottomTextColor, isColorOptio
|
|
|
264
264
|
fontSize: 15,
|
|
265
265
|
letterSpacing: 0.7,
|
|
266
266
|
border: error ? errorBorder : defaultBorderThin,
|
|
267
|
-
} }), rightIcon && (_jsx(InputRightElement, { pointerEvents: "none", children: rightIcon, style: { ...rightElementStyle } }))] }), isOpen && (_jsxs(Box, { ref: dropdownRef, marginTop: "5px", position: "absolute", top: position === "below" ? "100%" : "auto", bottom: position === "above" ? "100%" : "auto", left: 0, right: 0, border: "1px solid", borderColor: theme.colors.boxborder[
|
|
267
|
+
} }), rightIcon && (_jsx(InputRightElement, { pointerEvents: "none", children: rightIcon, style: { ...rightElementStyle } }))] }), isOpen && (_jsxs(Box, { ref: dropdownRef, marginTop: "5px", position: "absolute", top: position === "below" ? "100%" : "auto", bottom: position === "above" ? "100%" : "auto", left: 0, right: 0, border: "1px solid", borderColor: theme.colors.boxborder[200], borderRadius: "md", bg: theme.colors.background[50], maxHeight: "150px", overflowY: "auto", zIndex: 10, children: [_jsx(Box, { id: listboxId, role: "listbox", "aria-label": label !== null && label !== void 0 ? label : placeholder, onKeyDown: handleListKeyDown, children: _jsx(RenderOptions, { isOptionLoading: isOptionLoading, filteredOptions: filteredOptions, loadingText: loadingText, handleOptionClick: handleOptionClick, isProfile: isProfile, isColorOptions: isColorOptions, isOptionSelected: isOptionSelected, activeIndex: activeIndex, optionRefs: optionRefs }) }), _jsx("hr", {}), isBottomIcon && (_jsxs(Box, { position: "sticky", bottom: 0, background: theme.colors.background[50], display: "flex", alignItems: "center", pl: "1rem", cursor: "pointer", onClick: handleBottomClick, borderColor: theme.colors.boxborder[200], zIndex: 1, borderTop: `1px solid ${theme.colors.border[500]}`, children: [_jsx(Box, { children: BottomIcon ? BottomIcon : _jsx(PlusIcon, { size: "1rem" }) }), _jsx(Box, { fontSize: "0.875rem", color: BottomTextColor
|
|
268
268
|
? BottomTextColor
|
|
269
269
|
: theme.colors.accentText, padding: "8px 8px", children: BottomText || "Add New" })] }))] })), error && _jsx(ErrorMessage, { errorMessage: errorMessage })] }) }) }));
|
|
270
270
|
}
|
|
@@ -3,6 +3,7 @@ import React, { useCallback, useEffect, useId, useMemo, useRef, useState } from
|
|
|
3
3
|
import { Box, Checkbox, FormControl, Input, Popover, PopoverAnchor, PopoverContent, Portal, useDisclosure, } from "@chakra-ui/react";
|
|
4
4
|
import { ChevronDown } from "lucide-react";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
|
+
import { scrollbarStyles } from "../../Theme/tokens/builders/scrollbar.js";
|
|
6
7
|
import { getFieldStateStyles } from "../Common/fieldStyles.js";
|
|
7
8
|
import { TextLabel } from "../Common/FormLabel.js";
|
|
8
9
|
import ErrorMessage from "../Common/ErrorMessage.js";
|
|
@@ -192,15 +193,7 @@ export default function SelectV2(props) {
|
|
|
192
193
|
const triggerId = `selectv2-trigger-${instanceId}`;
|
|
193
194
|
const activeOption = filteredOptions[activeIndex];
|
|
194
195
|
const activeDescendantId = activeOption ? optionDomId(listboxId, activeOption.id) : undefined;
|
|
195
|
-
const listScrollStyles = useMemo(() => (
|
|
196
|
-
scrollbarWidth: "thin",
|
|
197
|
-
scrollbarColor: `${theme.colors.gray[300]} transparent`,
|
|
198
|
-
"&::-webkit-scrollbar": { width: "6px" },
|
|
199
|
-
"&::-webkit-scrollbar-thumb": {
|
|
200
|
-
background: theme.colors.gray[300],
|
|
201
|
-
borderRadius: "base",
|
|
202
|
-
},
|
|
203
|
-
}), [theme]);
|
|
196
|
+
const listScrollStyles = useMemo(() => scrollbarStyles(theme.colors, "overlay"), [theme]);
|
|
204
197
|
const defaultTriggerContent = () => {
|
|
205
198
|
var _a;
|
|
206
199
|
if (props.isMulti) {
|
|
@@ -215,7 +208,7 @@ export default function SelectV2(props) {
|
|
|
215
208
|
return selectedOptions[0] ? selectedOptions[0].label : placeholder;
|
|
216
209
|
};
|
|
217
210
|
const triggerIcon = !props.isMulti && ((_b = selectedOptions[0]) === null || _b === void 0 ? void 0 : _b.icon) ? selectedOptions[0].icon : null;
|
|
218
|
-
return (_jsxs(FormControl, { isInvalid: error, isDisabled: isDisabled, style: formControlStyle, width: width, children: [label && (_jsx(TextLabel, { label: label, id: triggerId, isRequired: isRequired })), _jsxs(Popover, { isOpen: isOpen, onClose: () => resetAndClose(), placement: "bottom-start", matchWidth: true, autoFocus: false, returnFocusOnClose: false, gutter: 4, children: [_jsx(PopoverAnchor, { children: _jsxs(Box, { as: "button", type: "button", id: triggerId, ref: triggerRef, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": isOpen, "aria-controls": listboxId, "aria-activedescendant": activeDescendantId, "aria-disabled": isDisabled, "aria-label": ariaLabel, disabled: isDisabled, onClick: handleOpen, onKeyDown: handleTriggerKeyDown, display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%", h: s.h, px: s.px, fontSize: s.fontSize, fontWeight: 500, textAlign: "left", cursor: isDisabled ? "not-allowed" : "pointer", opacity: isDisabled ? 0.4 : 1, color: selectedOptions.length ? theme.colors.text[900] : theme.colors.placeholder[500], "data-testid": dataTestId, ...fieldStyles, children: [_jsxs(Box, { as: "span", display: "inline-flex", alignItems: "center", gap: 1.5, minW: 0, isTruncated: true, children: [triggerIcon ? (_jsx(Box, { as: "span", display: "inline-flex", flexShrink: 0, children: triggerIcon })) : null, _jsx(Box, { as: "span", isTruncated: true, fontStyle: selectedOptions.length ? "normal" : "italic", children: renderValue ? renderValue(selectedOptions) : defaultTriggerContent() })] }), _jsx(Box, { as: "span", display: "inline-flex", flexShrink: 0, ml: 2, transition: "transform 0.2s ease", transform: isOpen ? "rotate(180deg)" : "rotate(0deg)", color: theme.colors.textMuted, children: _jsx(ChevronDown, { size: 16 }) })] }) }), _jsx(Portal, { children: _jsxs(PopoverContent, { width: "100%", borderRadius: "xl", border: `0.063rem solid ${theme.colors.boxborder[200]}`, boxShadow: (_c = theme.shadows) === null || _c === void 0 ? void 0 : _c.lg, overflow: "hidden", onKeyDown: handleListKeyDown, children: [isSearchable && (_jsx(Box, { p: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[
|
|
211
|
+
return (_jsxs(FormControl, { isInvalid: error, isDisabled: isDisabled, style: formControlStyle, width: width, children: [label && (_jsx(TextLabel, { label: label, id: triggerId, isRequired: isRequired })), _jsxs(Popover, { isOpen: isOpen, onClose: () => resetAndClose(), placement: "bottom-start", matchWidth: true, autoFocus: false, returnFocusOnClose: false, gutter: 4, children: [_jsx(PopoverAnchor, { children: _jsxs(Box, { as: "button", type: "button", id: triggerId, ref: triggerRef, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": isOpen, "aria-controls": listboxId, "aria-activedescendant": activeDescendantId, "aria-disabled": isDisabled, "aria-label": ariaLabel, disabled: isDisabled, onClick: handleOpen, onKeyDown: handleTriggerKeyDown, display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%", h: s.h, px: s.px, fontSize: s.fontSize, fontWeight: 500, textAlign: "left", cursor: isDisabled ? "not-allowed" : "pointer", opacity: isDisabled ? 0.4 : 1, color: selectedOptions.length ? theme.colors.text[900] : theme.colors.placeholder[500], "data-testid": dataTestId, ...fieldStyles, children: [_jsxs(Box, { as: "span", display: "inline-flex", alignItems: "center", gap: 1.5, minW: 0, isTruncated: true, children: [triggerIcon ? (_jsx(Box, { as: "span", display: "inline-flex", flexShrink: 0, children: triggerIcon })) : null, _jsx(Box, { as: "span", isTruncated: true, fontStyle: selectedOptions.length ? "normal" : "italic", children: renderValue ? renderValue(selectedOptions) : defaultTriggerContent() })] }), _jsx(Box, { as: "span", display: "inline-flex", flexShrink: 0, ml: 2, transition: "transform 0.2s ease", transform: isOpen ? "rotate(180deg)" : "rotate(0deg)", color: theme.colors.textMuted, children: _jsx(ChevronDown, { size: 16 }) })] }) }), _jsx(Portal, { children: _jsxs(PopoverContent, { width: "100%", borderRadius: "xl", border: `0.063rem solid ${theme.colors.boxborder[200]}`, boxShadow: (_c = theme.shadows) === null || _c === void 0 ? void 0 : _c.lg, overflow: "hidden", onKeyDown: handleListKeyDown, children: [isSearchable && (_jsx(Box, { p: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[200]}`, children: _jsx(Input, { ref: filterInputRef, size: "sm", placeholder: "Type to filter...", value: filterText, onChange: (event) => {
|
|
219
212
|
setFilterText(event.target.value);
|
|
220
213
|
setActiveIndex(0);
|
|
221
214
|
}, "aria-activedescendant": activeDescendantId, "aria-label": "Filter options" }) })), _jsxs(Box, { id: listboxId, ref: listRef, role: "listbox", "aria-multiselectable": props.isMulti || undefined, maxH: maxMenuHeight, overflowY: "auto", py: 1, sx: listScrollStyles, children: [filteredOptions.length === 0 && (_jsx(Box, { px: 3, py: 2, fontSize: "0.8125rem", color: theme.colors.textMuted, children: "No Options" })), filteredOptions.map((option, index) => {
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Flex, Skeleton } from "@chakra-ui/react";
|
|
3
3
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
|
+
import { scrollbarStyles } from "../../Theme/tokens/builders/scrollbar.js";
|
|
4
5
|
import StageItem from "./StageItem.js";
|
|
5
6
|
import StepperStage from "./StepperStage.js";
|
|
6
|
-
const scrollSxFor = (thumb) => ({
|
|
7
|
-
"&::-webkit-scrollbar": { height: "4px" },
|
|
8
|
-
"&::-webkit-scrollbar-thumb": {
|
|
9
|
-
borderRadius: "full",
|
|
10
|
-
backgroundColor: thumb,
|
|
11
|
-
},
|
|
12
|
-
"&::-webkit-scrollbar-track": { background: "transparent" },
|
|
13
|
-
});
|
|
14
7
|
// Gap between items per variant (chevron interlocks via negative margin).
|
|
15
8
|
const gapFor = {
|
|
16
9
|
chevron: "0",
|
|
@@ -35,7 +28,7 @@ const StageProgress = ({ stages, variant = "chevron", value, onChange, size = "m
|
|
|
35
28
|
const total = stages.length;
|
|
36
29
|
return (_jsx(Box, { display: "flex", alignItems: variant === "stepper" ? "flex-start" : "stretch", gap: gapFor[variant], overflowX: "hidden", p: "0.1rem", sx: {
|
|
37
30
|
"&:hover": { overflowX: "auto" },
|
|
38
|
-
...
|
|
31
|
+
...scrollbarStyles(theme.colors, "overlay"),
|
|
39
32
|
}, children: stages.map((stage, index) => {
|
|
40
33
|
const state = stateFor(index);
|
|
41
34
|
if (variant === "stepper") {
|