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 @@ import { TextLabel } from "../Common/FormLabel.js";
|
|
|
6
6
|
import Tag from "../Tag/Tag.js";
|
|
7
7
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
8
8
|
import { placeholderInk } from "../../Theme/tokens/builders/placeholderInk.js";
|
|
9
|
+
import { resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
|
|
9
10
|
import ErrorMessage from "../Common/ErrorMessage.js";
|
|
10
11
|
import HelperText from "../Common/HelperText.js";
|
|
11
12
|
import ToolTip from "../ToolTip/ToolTip.js";
|
|
@@ -50,6 +51,9 @@ const SearchSelect = ({ id, label, options, onSelect, onSearch, isOptionLoading
|
|
|
50
51
|
width: 0,
|
|
51
52
|
});
|
|
52
53
|
const theme = useCustomTheme();
|
|
54
|
+
const customSelectActiveTint = useMemo(() => resolveHoverTint(theme.colors.primary[500], theme.colors.background[400]), [theme.colors.primary, theme.colors.background]);
|
|
55
|
+
const dropdownActiveTint = useMemo(() => resolveHoverTint(theme.colors.primary[500], theme.colors.background[50]), [theme.colors.primary, theme.colors.background]);
|
|
56
|
+
const dropdownHoverTint = useMemo(() => resolveHoverTint(theme.colors.gray[50], theme.colors.background[50]), [theme.colors.gray, theme.colors.background]);
|
|
53
57
|
// `searchselect-dropdown-portal` is also the DOM id an existing outside-click check and
|
|
54
58
|
// several tests look up directly — kept as a literal constant, not derived from `baseId`,
|
|
55
59
|
// so those keep working unchanged.
|
|
@@ -451,7 +455,7 @@ const SearchSelect = ({ id, label, options, onSelect, onSearch, isOptionLoading
|
|
|
451
455
|
const insideLabel = (_a = insideSelect.value) === null || _a === void 0 ? void 0 : _a.label;
|
|
452
456
|
const insidePlaceholder = (_b = insideSelect.placeholder) !== null && _b !== void 0 ? _b : "Select";
|
|
453
457
|
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
|
|
454
|
-
?
|
|
458
|
+
? customSelectActiveTint
|
|
455
459
|
: theme.colors.background[400], borderLeftRadius: "md", borderRightRadius: 0, transition: "background 0.15s ease, box-shadow 0.15s ease", boxShadow: customSelectOpen
|
|
456
460
|
? `inset 0 0 0 0.063rem ${theme.colors.primary[500]}`
|
|
457
461
|
: "none", onClick: (e) => {
|
|
@@ -464,11 +468,11 @@ const SearchSelect = ({ id, label, options, onSelect, onSearch, isOptionLoading
|
|
|
464
468
|
return (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, minH: s.optionRowMinH, py: s.optionRowPy, px: "0.75rem", fontSize: s.dropdownTextFontSize, fontWeight: selected ? 600 : 500, color: selected
|
|
465
469
|
? theme.colors.accentText
|
|
466
470
|
: theme.colors.text[700], bg: selected
|
|
467
|
-
?
|
|
471
|
+
? dropdownActiveTint
|
|
468
472
|
: "transparent", _hover: {
|
|
469
473
|
bg: selected
|
|
470
|
-
?
|
|
471
|
-
:
|
|
474
|
+
? dropdownActiveTint
|
|
475
|
+
: dropdownHoverTint,
|
|
472
476
|
}, cursor: "pointer", onClick: (e) => {
|
|
473
477
|
e.stopPropagation();
|
|
474
478
|
handleCustomSelect(item);
|
|
@@ -508,9 +512,9 @@ const SearchSelect = ({ id, label, options, onSelect, onSearch, isOptionLoading
|
|
|
508
512
|
return !prev;
|
|
509
513
|
});
|
|
510
514
|
}, "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
|
|
511
|
-
?
|
|
515
|
+
? dropdownActiveTint
|
|
512
516
|
: isSelected(option.id)
|
|
513
517
|
? theme.colors.gray[100]
|
|
514
|
-
: "transparent", _hover: { bg:
|
|
518
|
+
: "transparent", _hover: { bg: dropdownHoverTint }, 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: dropdownHoverTint }, 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 })] }));
|
|
515
519
|
};
|
|
516
520
|
export default SearchSelect;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import { Box, Flex } from "@chakra-ui/react";
|
|
4
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
+
const SIZES = {
|
|
6
|
+
sm: { h: "1.625rem", px: "0.625rem", fontSize: "0.75rem" },
|
|
7
|
+
md: { h: "2rem", px: "0.875rem", fontSize: "0.8125rem" },
|
|
8
|
+
};
|
|
9
|
+
export default function SegmentedControl({ options, value, onChange, size = "md", isFullWidth = false, "aria-label": ariaLabel, }) {
|
|
10
|
+
const { colors } = useCustomTheme();
|
|
11
|
+
const dims = SIZES[size];
|
|
12
|
+
const refs = useRef([]);
|
|
13
|
+
const selectedIndex = options.findIndex((o) => o.value === value);
|
|
14
|
+
const enabled = options.reduce((acc, o, i) => (o.isDisabled ? acc : [...acc, i]), []);
|
|
15
|
+
// WAI-APG: with nothing selected, the first enabled segment owns the tab stop.
|
|
16
|
+
const tabIndex = selectedIndex >= 0 ? selectedIndex : enabled[0];
|
|
17
|
+
const selectAt = (index) => {
|
|
18
|
+
var _a;
|
|
19
|
+
(_a = refs.current[index]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
20
|
+
onChange(options[index].value);
|
|
21
|
+
};
|
|
22
|
+
const handleKeyDown = (event) => {
|
|
23
|
+
if (enabled.length === 0)
|
|
24
|
+
return;
|
|
25
|
+
const step = (delta) => {
|
|
26
|
+
const position = enabled.indexOf(tabIndex);
|
|
27
|
+
selectAt(enabled[(position + delta + enabled.length) % enabled.length]);
|
|
28
|
+
};
|
|
29
|
+
if (event.key === "ArrowRight" || event.key === "ArrowDown") {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
step(1);
|
|
32
|
+
}
|
|
33
|
+
else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
step(-1);
|
|
36
|
+
}
|
|
37
|
+
else if (event.key === "Home") {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
selectAt(enabled[0]);
|
|
40
|
+
}
|
|
41
|
+
else if (event.key === "End") {
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
selectAt(enabled[enabled.length - 1]);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return (_jsx(Flex, { role: "radiogroup", "aria-label": ariaLabel, onKeyDown: handleKeyDown, display: "inline-flex", align: "center", gap: "0.125rem", p: "0.125rem", borderRadius: "md", bg: colors.background[600], w: isFullWidth ? "100%" : "fit-content", children: options.map((option, index) => {
|
|
47
|
+
const isSelected = option.value === value;
|
|
48
|
+
return (_jsxs(Box, { as: "button", type: "button", ref: (node) => {
|
|
49
|
+
refs.current[index] = node;
|
|
50
|
+
}, role: "radio", "aria-checked": isSelected, disabled: option.isDisabled, tabIndex: index === tabIndex ? 0 : -1, onClick: () => onChange(option.value), display: "inline-flex", alignItems: "center", justifyContent: "center", gap: "0.375rem", flex: isFullWidth ? "1" : undefined, h: dims.h, px: dims.px, borderRadius: "base", borderWidth: "1px", borderStyle: "solid", borderColor: isSelected ? colors.background[400] : "transparent", bg: isSelected ? colors.background[50] : "transparent", boxShadow: isSelected ? "sm" : "none", color: isSelected ? colors.text[900] : colors.text[600], fontSize: dims.fontSize, fontWeight: isSelected ? 600 : 500, whiteSpace: "nowrap", opacity: option.isDisabled ? 0.5 : 1, cursor: option.isDisabled ? "not-allowed" : "pointer", transition: "background-color 0.2s ease, color 0.2s ease", _hover: option.isDisabled || isSelected ? undefined : { color: colors.text[900] }, _focusVisible: {
|
|
51
|
+
outline: "none",
|
|
52
|
+
boxShadow: `0 0 0 2px ${colors.primary[300]}`,
|
|
53
|
+
}, children: [option.icon, option.label] }, option.value));
|
|
54
|
+
}) }));
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
2
|
+
import { useCallback, useId } from "react";
|
|
3
3
|
import { Select as ChakraSelect, FormControl } from "@chakra-ui/react";
|
|
4
4
|
import { getTextInputIconSizePx } from "../Input/textInputIconSize.js";
|
|
5
5
|
import { TextLabel } from "../Common/FormLabel.js";
|
|
6
6
|
import ErrorMessage from "../Common/ErrorMessage.js";
|
|
7
7
|
import HelperText from "../Common/HelperText.js";
|
|
8
|
-
export default function Select({ placeholder = "Select Option", size = "md", variant = "outline", icon, onChange, onBlur, onFocus, errorBorderColor, isDisabled, isReadOnly, isRequired = false, value = "", colorScheme, label, error, errorMessage, helperText, options = [], height, formControlStyle, isInformation = false, informationMessage, selectStyle, }) {
|
|
8
|
+
export default function Select({ placeholder = "Select Option", size = "md", variant = "outline", icon, onChange, onBlur, onFocus, errorBorderColor, isDisabled, isReadOnly, isRequired = false, value = "", colorScheme, label, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, error, errorMessage, helperText, options = [], height, formControlStyle, isInformation = false, informationMessage, selectStyle, }) {
|
|
9
9
|
const sizeKey = typeof size === "string" ? size : "md";
|
|
10
10
|
const iconSizePx = getTextInputIconSizePx(sizeKey);
|
|
11
|
+
const generatedId = useId();
|
|
12
|
+
const selectId = id !== null && id !== void 0 ? id : (label ? generatedId : undefined);
|
|
11
13
|
const getOptionsList = useCallback(() => {
|
|
12
14
|
if (!options.length)
|
|
13
15
|
return _jsx("option", { value: "", children: "No Options" });
|
|
@@ -20,5 +22,5 @@ export default function Select({ placeholder = "Select Option", size = "md", var
|
|
|
20
22
|
onChange(selectedOption);
|
|
21
23
|
}
|
|
22
24
|
};
|
|
23
|
-
return (_jsxs(FormControl, { isInvalid: error, style: formControlStyle, size: size, children: [label && (_jsx(TextLabel, { label: label, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })), _jsx(ChakraSelect, { placeholder: placeholder, size: size, variant: variant, icon: icon, iconSize: `${iconSizePx}px`, isInvalid: error, value: value, onChange: handleOnChange, onBlur: onBlur, onFocus: onFocus, isDisabled: isDisabled, isReadOnly: isReadOnly, colorScheme: colorScheme, errorBorderColor: errorBorderColor, style: selectStyle, ...(height != null && height !== "" ? { minH: height, h: height } : {}), children: getOptionsList() }), error && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
25
|
+
return (_jsxs(FormControl, { isInvalid: error, style: formControlStyle, size: size, children: [label && (_jsx(TextLabel, { label: label, id: selectId, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })), _jsx(ChakraSelect, { id: selectId, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, placeholder: placeholder, size: size, variant: variant, icon: icon, iconSize: `${iconSizePx}px`, isInvalid: error, value: value, onChange: handleOnChange, onBlur: onBlur, onFocus: onFocus, isDisabled: isDisabled, isReadOnly: isReadOnly, colorScheme: colorScheme, errorBorderColor: errorBorderColor, style: selectStyle, ...(height != null && height !== "" ? { minH: height, h: height } : {}), children: getOptionsList() }), error && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
24
26
|
}
|
|
@@ -4,6 +4,7 @@ import { Box, Input, Spinner, VStack, Text, InputGroup, InputRightElement, HStac
|
|
|
4
4
|
import { TextLabel } from "../Common/FormLabel.js";
|
|
5
5
|
import { FIELD_RADIUS, fieldFocusRing } from "../Common/fieldStyles.js";
|
|
6
6
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
7
|
+
import { resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
|
|
7
8
|
import { PlusIcon } from "lucide-react";
|
|
8
9
|
import ErrorMessage from "../Common/ErrorMessage.js";
|
|
9
10
|
const RenderOptions = ({ isOptionLoading, filteredOptions, loadingText, handleOptionClick, isProfile, isColorOptions, isOptionSelected, activeIndex, optionRefs, }) => {
|
|
@@ -14,7 +15,9 @@ const RenderOptions = ({ isOptionLoading, filteredOptions, loadingText, handleOp
|
|
|
14
15
|
if (filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.length) {
|
|
15
16
|
return (_jsx(_Fragment, { children: filteredOptions.map((option, index) => (_jsxs(Box, { as: "button", type: "button", ref: (el) => {
|
|
16
17
|
optionRefs.current[index] = el;
|
|
17
|
-
}, role: "option", "aria-selected": isOptionSelected(option), tabIndex: index === activeIndex ? 0 : -1, w: "100%", textAlign: "left", border: "none", fontFamily: "inherit", bg: "transparent", px: 4, py: 2, cursor: "pointer", _hover: {
|
|
18
|
+
}, role: "option", "aria-selected": isOptionSelected(option), tabIndex: index === activeIndex ? 0 : -1, w: "100%", textAlign: "left", border: "none", fontFamily: "inherit", bg: "transparent", px: 4, py: 2, cursor: "pointer", _hover: {
|
|
19
|
+
backgroundColor: resolveHoverTint(theme.colors.primary[500], theme.colors.background[50]),
|
|
20
|
+
}, onClick: () => handleOptionClick(option), onKeyDown: (e) => {
|
|
18
21
|
if (e.key === "Enter" || e.key === " ") {
|
|
19
22
|
e.preventDefault();
|
|
20
23
|
handleOptionClick(option);
|
|
@@ -4,6 +4,7 @@ import { Box, Checkbox, FormControl, Input, Popover, PopoverAnchor, PopoverConte
|
|
|
4
4
|
import { ChevronDown } from "lucide-react";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
6
|
import { placeholderInk } from "../../Theme/tokens/builders/placeholderInk.js";
|
|
7
|
+
import { resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
|
|
7
8
|
import { scrollbarStyles } from "../../Theme/tokens/builders/scrollbar.js";
|
|
8
9
|
import { getFieldStateStyles } from "../Common/fieldStyles.js";
|
|
9
10
|
import { TextLabel } from "../Common/FormLabel.js";
|
|
@@ -18,10 +19,10 @@ const SIZE_MAP = {
|
|
|
18
19
|
const asIdSet = (values) => new Set((values !== null && values !== void 0 ? values : []).map((v) => v.toString()));
|
|
19
20
|
// Derived from the option's own id (not its index) so it stays stable across filtering/reordering.
|
|
20
21
|
const optionDomId = (listboxId, id) => `${listboxId}-option-${id.toString().replace(/[^a-zA-Z0-9_-]/g, "-")}`;
|
|
21
|
-
const OptionRow = React.memo(function OptionRow({ option, index, listboxId, isSelected, isActive, isMulti, theme, renderOption, onSelect, onActivate, }) {
|
|
22
|
+
const OptionRow = React.memo(function OptionRow({ option, index, listboxId, isSelected, isActive, isMulti, theme, activeBg, renderOption, onSelect, onActivate, }) {
|
|
22
23
|
return (_jsxs(Box, { id: optionDomId(listboxId, option.id), "data-index": index, role: "option", "aria-selected": isSelected, "aria-disabled": option.isDisabled, onMouseEnter: () => onActivate(index), onClick: () => onSelect(option), mx: 1.5, px: 2.5, py: 1.5, borderRadius: "md", cursor: option.isDisabled ? "not-allowed" : "pointer", opacity: option.isDisabled ? 0.4 : 1, display: "flex", alignItems: "center", gap: 2, fontSize: "0.8125rem", fontWeight: isSelected && !isMulti ? 600 : 500, color: isSelected && !isMulti
|
|
23
24
|
? theme.colors.accentText
|
|
24
|
-
: theme.colors.text[700], bg: isActive ?
|
|
25
|
+
: theme.colors.text[700], bg: isActive ? activeBg : "transparent", transition: "background 0.12s ease, color 0.12s ease", children: [isMulti ? (_jsx(Checkbox, { isChecked: isSelected, isDisabled: option.isDisabled, pointerEvents: "none", tabIndex: -1 })) : null, renderOption ? (_jsx(Box, { flex: 1, minW: 0, children: renderOption(option, { isSelected, isActive }) })) : (_jsxs(_Fragment, { children: [option.icon ? (_jsx(Box, { as: "span", display: "inline-flex", flexShrink: 0, children: option.icon })) : null, _jsxs(Box, { flex: 1, minW: 0, isTruncated: true, children: [_jsx(Box, { as: "span", isTruncated: true, children: option.label }), option.description ? (_jsx(Box, { as: "span", display: "block", fontSize: "0.75rem", fontWeight: 400, color: theme.colors.textMuted, isTruncated: true, children: option.description })) : null] })] }))] }));
|
|
25
26
|
});
|
|
26
27
|
export default function SelectV2(props) {
|
|
27
28
|
var _a, _b;
|
|
@@ -195,6 +196,7 @@ export default function SelectV2(props) {
|
|
|
195
196
|
const activeOption = filteredOptions[activeIndex];
|
|
196
197
|
const activeDescendantId = activeOption ? optionDomId(listboxId, activeOption.id) : undefined;
|
|
197
198
|
const listScrollStyles = useMemo(() => scrollbarStyles(theme.colors, "overlay"), [theme]);
|
|
199
|
+
const activeOptionBg = useMemo(() => resolveHoverTint(theme.colors.primary[500], theme.colors.backgroundColor.light), [theme]);
|
|
198
200
|
const defaultTriggerContent = () => {
|
|
199
201
|
var _a;
|
|
200
202
|
if (props.isMulti) {
|
|
@@ -214,6 +216,6 @@ export default function SelectV2(props) {
|
|
|
214
216
|
setActiveIndex(0);
|
|
215
217
|
}, "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) => {
|
|
216
218
|
var _a;
|
|
217
|
-
return (_jsx(OptionRow, { option: option, index: index, listboxId: listboxId, isSelected: selectedIds.has(option.id.toString()), isActive: index === activeIndex, isMulti: (_a = props.isMulti) !== null && _a !== void 0 ? _a : false, theme: theme, renderOption: renderOption, onSelect: handleSelect, onActivate: setActiveIndex }, option.id));
|
|
219
|
+
return (_jsx(OptionRow, { option: option, index: index, listboxId: listboxId, isSelected: selectedIds.has(option.id.toString()), isActive: index === activeIndex, isMulti: (_a = props.isMulti) !== null && _a !== void 0 ? _a : false, theme: theme, activeBg: activeOptionBg, renderOption: renderOption, onSelect: handleSelect, onActivate: setActiveIndex }, option.id));
|
|
218
220
|
})] })] }) })] }), error && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
219
221
|
}
|
|
@@ -75,7 +75,7 @@ const FooterControls = ({ toggle, overlay, mobileNav, onToggleCollapse, onToggle
|
|
|
75
75
|
return null;
|
|
76
76
|
return shell(_jsx(ControlCell, { onClick: onToggleMobileNav, label: "Show", accent: true, children: _jsx(PanelLeft, { size: 14, color: activeAccent.icon }) }));
|
|
77
77
|
}
|
|
78
|
-
return shell(_jsxs(_Fragment, { children: [_jsx(ControlCell, { onClick: onToggleCollapse, ariaLabel: toggle ? "Expand sidebar" : undefined, label: toggle ? undefined : "Collapse", children: toggle ? (_jsx(ArrowRightToLine, { size: 14, color: iconColor })) : (_jsx(ArrowLeftToLine, { size: 14, color: iconColor })) }), onToggleMobileNav && (_jsx(ControlCell, { onClick: onToggleMobileNav, label: toggle ? undefined : "Hide", children: _jsx(Maximize2, { size: 14, color: iconColor }) }))] }));
|
|
78
|
+
return shell(_jsxs(_Fragment, { children: [_jsx(ControlCell, { onClick: onToggleCollapse, ariaLabel: toggle ? "Expand sidebar" : undefined, label: toggle ? undefined : "Collapse", children: toggle ? (_jsx(ArrowRightToLine, { size: 14, color: iconColor })) : (_jsx(ArrowLeftToLine, { size: 14, color: iconColor })) }), onToggleMobileNav && (_jsx(ControlCell, { onClick: onToggleMobileNav, ariaLabel: toggle ? "Show sidebar in overlay mode" : undefined, label: toggle ? undefined : "Hide", children: _jsx(Maximize2, { size: 14, color: iconColor }) }))] }));
|
|
79
79
|
};
|
|
80
80
|
// --- Main Sidebar component ---
|
|
81
81
|
export default function Sidebar({ menus, activeMenu, handleMenuClick, handleSecondaryNavClick, toggle, changeToggle, logo, companyName, companySubtitle, user, isDisableAddNew = false, onAddNewClick, selectedSubMenu, selectedSecondaryItem, isLoading, loadingLines, open = true, otherApps, mobileOpen = false, onMobileClose, mobileNav = false, onToggleMobileNav, peekOpen = false, onPeekEnd, }) {
|
|
@@ -11,7 +11,7 @@ const MenuPopoverContent = ({ menu, handleMenuClick, activeMenu, }) => {
|
|
|
11
11
|
const { title, icon, subMenu, badge, locked } = menu;
|
|
12
12
|
const hasSubMenu = !!(subMenu === null || subMenu === void 0 ? void 0 : subMenu.length);
|
|
13
13
|
const isParentActive = activeMenu === menu.id;
|
|
14
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { as: (hasSubMenu ? "div" : "a"), href: hasSubMenu ? undefined : (_a = menu.url) !== null && _a !== void 0 ? _a : "#", "aria-current": !hasSubMenu && isParentActive ? "page" : undefined, textDecoration: "none", align: "center", gap: "8px", px: "8px", py: hasSubMenu ? "6px" : "8px", mb: hasSubMenu ? "4px" : 0, borderBottom: hasSubMenu ? "1px solid" : undefined, borderColor: hasSubMenu ? "whiteAlpha.100" : undefined, borderRadius: hasSubMenu ? "none" : "md", bg: !hasSubMenu && isParentActive ?
|
|
14
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { as: (hasSubMenu ? "div" : "a"), href: hasSubMenu ? undefined : (_a = menu.url) !== null && _a !== void 0 ? _a : "#", "aria-current": !hasSubMenu && isParentActive ? "page" : undefined, textDecoration: "none", align: "center", gap: "8px", px: "8px", py: hasSubMenu ? "6px" : "8px", mb: hasSubMenu ? "4px" : 0, borderBottom: hasSubMenu ? "1px solid" : undefined, borderColor: hasSubMenu ? "whiteAlpha.100" : undefined, borderRadius: hasSubMenu ? "none" : "md", bg: !hasSubMenu && isParentActive ? "whiteAlpha.300" : "transparent", _hover: !hasSubMenu ? { bg: "whiteAlpha.100" } : undefined, onClick: (e) => {
|
|
15
15
|
if (!hasSubMenu) {
|
|
16
16
|
e.preventDefault();
|
|
17
17
|
handleMenuClick === null || handleMenuClick === void 0 ? void 0 : handleMenuClick(menu);
|
|
@@ -33,7 +33,7 @@ const MenuPopoverContent = ({ menu, handleMenuClick, activeMenu, }) => {
|
|
|
33
33
|
e.preventDefault();
|
|
34
34
|
if (!sub.disabled)
|
|
35
35
|
handleMenuClick === null || handleMenuClick === void 0 ? void 0 : handleMenuClick(sub);
|
|
36
|
-
}, px: "8px", py: "7px", mb: "2px", borderRadius: "md", align: "center", justify: "space-between", gap: "8px", borderLeft: "2px solid", borderLeftColor: isSubActive ? theme.colors.sidebar.activeIcon : "transparent", bg: isSubActive ?
|
|
36
|
+
}, px: "8px", py: "7px", mb: "2px", borderRadius: "md", align: "center", justify: "space-between", gap: "8px", borderLeft: "2px solid", borderLeftColor: isSubActive ? theme.colors.sidebar.activeIcon : "transparent", bg: isSubActive ? "whiteAlpha.300" : "transparent", _hover: {
|
|
37
37
|
bg: !sub.disabled ? "whiteAlpha.100" : "transparent",
|
|
38
38
|
cursor: !sub.disabled ? "pointer" : "not-allowed",
|
|
39
39
|
}, opacity: sub.disabled ? 0.5 : 1, pointerEvents: sub.disabled ? "none" : "auto", transition: "background 0.12s", children: [_jsxs(Flex, { align: "center", gap: "9px", overflow: "hidden", flex: "1", children: [_jsx(Icon, { as: sub.icon, fontSize: "0.95rem", flexShrink: 0, color: isSubActive ? activeAccent.icon : "whiteAlpha.800", _groupHover: isSubActive ? undefined : { color: "white" }, transition: "color 0.12s" }), _jsx(TruncatedTextWithTooltip, { fontSize: "12.5px", fontWeight: isSubActive ? 600 : 500, flex: 1, color: isSubActive ? activeAccent.label : theme.colors.white, _groupHover: isSubActive ? undefined : { color: "white" }, children: sub.title })] }), sub.locked ? (_jsx(Icon, { as: LockKeyhole, fontSize: "1rem", color: theme.colors.sidebar.mutedIcon })) : (() => {
|
|
@@ -3,6 +3,8 @@ import { useEffect, useRef, useState, useCallback } from "react";
|
|
|
3
3
|
import { Box, Flex, IconButton, Image, useBreakpointValue, AspectRatio } from "@chakra-ui/react";
|
|
4
4
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
|
+
import { onFilled } from "../../Theme/tokens/builders/accentText.js";
|
|
7
|
+
import { AA_NON_TEXT, liftToContrast, resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
|
|
6
8
|
const Slider = ({ images, interval = 5000, isArrow = false, mobileImages, }) => {
|
|
7
9
|
var _a, _b;
|
|
8
10
|
const { colors } = useCustomTheme();
|
|
@@ -32,10 +34,15 @@ const Slider = ({ images, interval = 5000, isArrow = false, mobileImages, }) =>
|
|
|
32
34
|
// eslint-disable-next-line
|
|
33
35
|
}, [slides.length]);
|
|
34
36
|
const ratio = (_b = useBreakpointValue({ base: 16 / 9, md: 21 / 9, lg: 21 / 9 })) !== null && _b !== void 0 ? _b : 16 / 9;
|
|
37
|
+
const chipBg = colors.background[50];
|
|
38
|
+
const chipInk = onFilled(chipBg, colors.white, colors.black);
|
|
39
|
+
const chipHoverBg = resolveHoverTint(colors.gray[200], chipBg);
|
|
40
|
+
const chipHoverInk = onFilled(chipHoverBg, colors.white, colors.black);
|
|
41
|
+
const dotInactiveInk = liftToContrast(colors.gray[400], chipBg, AA_NON_TEXT);
|
|
35
42
|
return (_jsxs(Box, { position: "relative", w: "100%", h: "auto", overflow: "hidden", children: [_jsx(Flex, { w: `${slides.length * 100}%`, transform: `translateX(-${(currentIndex * 100) / slides.length}%)`, transition: "transform 0.5s ease", children: [...slides]
|
|
36
43
|
.sort((a, b) => a.order - b.order)
|
|
37
44
|
.map((image, idx) => (_jsx(Box, { w: `${100 / slides.length}%`, h: "auto", flexShrink: 0, display: "flex", justifyContent: "center", alignItems: "center", children: _jsx(AspectRatio, { ratio: ratio, w: "100%", children: _jsx(Image, { src: isMobile && image.mobilePreviewUrl
|
|
38
45
|
? image.mobilePreviewUrl
|
|
39
|
-
: image.previewUrl, alt: `Slide ${idx + 1}`, objectFit: "cover", w: "100%", h: "100%", loading: "lazy" }) }) }, image.id))) }), isArrow && (_jsxs(_Fragment, { children: [_jsx(IconButton, { icon: _jsx(ChevronLeft, {
|
|
46
|
+
: image.previewUrl, alt: `Slide ${idx + 1}`, objectFit: "cover", w: "100%", h: "100%", loading: "lazy" }) }) }, image.id))) }), isArrow && (_jsxs(_Fragment, { children: [_jsx(IconButton, { icon: _jsx(ChevronLeft, {}), "aria-label": "Previous Slide", onClick: prevSlide, position: "absolute", top: "50%", left: "1rem", transform: "translateY(-50%)", zIndex: 2, variant: "ghost", borderRadius: "full", bg: chipBg, color: chipInk, _hover: { bg: chipHoverBg, color: chipHoverInk } }), _jsx(IconButton, { icon: _jsx(ChevronRight, {}), "aria-label": "Next Slide", onClick: nextSlide, position: "absolute", top: "50%", right: "1rem", transform: "translateY(-50%)", zIndex: 2, variant: "ghost", borderRadius: "full", bg: chipBg, color: chipInk, _hover: { bg: chipHoverBg, color: chipHoverInk } })] })), slides.length > 1 && (_jsx(Flex, { position: "absolute", bottom: "1rem", left: "50%", transform: "translateX(-50%)", gap: "0.5rem", zIndex: 2, bg: chipBg, px: "0.6rem", py: "0.4rem", borderRadius: "full", children: slides.map((_, idx) => (_jsx(Box, { as: "button", type: "button", w: { base: "0.5rem", md: "0.8rem" }, h: { base: "0.5rem", md: "0.8rem" }, border: "none", p: 0, bg: idx === currentIndex ? chipInk : dotInactiveInk, borderRadius: "full", cursor: "pointer", onClick: () => setCurrentIndex(idx), "aria-label": `Go to slide ${idx + 1}`, "aria-current": idx === currentIndex, transition: "all 0.3s", _focusVisible: { outline: `2px solid ${chipInk}`, outlineOffset: "2px" } }, idx))) }))] }));
|
|
40
47
|
};
|
|
41
48
|
export default Slider;
|
|
@@ -32,7 +32,7 @@ const StepperStage = ({ label, number, state, size = "md", colorScheme = "primar
|
|
|
32
32
|
return (_jsxs(Flex, { ref: ref, direction: "column", align: "center", flex: "1", minWidth: s.minW, flexShrink: 0, as: (interactive ? "button" : "div"), type: interactive ? "button" : undefined, "data-group": "", border: "none", bg: "transparent", cursor: interactive ? "pointer" : "default", opacity: disabled ? 0.55 : 1, onClick: interactive ? onClick : undefined, children: [_jsxs(Flex, { align: "center", width: "100%", children: [line(leftDone, isFirst), _jsx(Flex, { align: "center", justify: "center", boxSize: s.circle, borderRadius: "full", flexShrink: 0, bg: circleBg, color: circleColor, border: "2px solid", borderColor: circleBorder, fontSize: s.font, fontWeight: 600, transition: "all 0.18s ease", "aria-current": state === "active" ? "step" : undefined, sx: state === "active"
|
|
33
33
|
? { boxShadow: `0 0 0 4px ${palette.soft}` }
|
|
34
34
|
: undefined, _groupHover: interactive
|
|
35
|
-
? { borderColor: palette.strong,
|
|
36
|
-
: undefined, children: showCheck && state === "completed" ? _jsx(Check, { size: s.icon }) : number }), line(rightDone, isLast)] }), _jsx(Text, { mt: 2, px: 1, fontSize: s.label, fontWeight: state === "active" ? 600 : 500, color: state === "upcoming" ? palette.mutedText : palette.softText, textAlign: "center", noOfLines: 2, _groupHover: interactive ? {
|
|
35
|
+
? { borderColor: palette.strong, bg: palette.strong, color: palette.onStrong }
|
|
36
|
+
: undefined, children: showCheck && state === "completed" ? _jsx(Check, { size: s.icon }) : number }), line(rightDone, isLast)] }), _jsx(Text, { mt: 2, px: 1, borderRadius: "sm", fontSize: s.label, fontWeight: state === "active" ? 600 : 500, color: state === "upcoming" ? palette.mutedText : palette.softText, textAlign: "center", noOfLines: 2, transition: "background 0.18s ease, color 0.18s ease", _groupHover: interactive ? { bg: palette.strong, color: palette.onStrong } : undefined, children: label })] }));
|
|
37
37
|
};
|
|
38
38
|
export default StepperStage;
|
|
@@ -14,6 +14,6 @@ const Pagination = React.memo(({ paginationText, handlePageSizeChange, rowsPerPa
|
|
|
14
14
|
// const isRightDisabled = currentPage >= pages - 1;
|
|
15
15
|
const isLeftDisabled = dataLength === 0 || currentPage === 0;
|
|
16
16
|
const isRightDisabled = dataLength === 0 || currentPage >= pages - 1;
|
|
17
|
-
return (_jsxs(Flex, { justify: "flex-end", align: "center", flexWrap: "nowrap", children: [(!isServerPagination || paginationSelectOptions) && (_jsxs(Select, { onChange: handlePageSizeChange, value: rowsPerPage, size: "xs", borderRadius: "base", width: "auto", minW: "4.5rem", isDisabled: dataLength === 0, children: [!paginationSelectOptions && dataLength < 100 ? _jsx("option", { value: 0 }) : null, computedOptions.map((size, index) => (_jsx("option", { value: String(size), children: String(size) }, index)))] })), dataLength > 0 && (_jsxs(Flex, { w: "100%", children: [_jsx(ToolTip, { label: "First", placement: "top", children: _jsx(IconButton, { "aria-label": "first-page", color: isLeftDisabled ? theme.colors.textMuted : theme.colors.text[500], rounded: "full", variant: isLeftDisabled ? "plain" : "ghost", onClick: () => setCurrentPage(0), _hover: !isLeftDisabled ? { color: theme.colors.accentText } : {}, children: _jsx(ChevronsLeft, {}) }) }), _jsx(ToolTip, { label: "Previous", placement: "top", children: _jsx(IconButton, { "aria-label": "previous-page", color: isLeftDisabled ? theme.colors.textMuted : theme.colors.text[500], rounded: "full", variant: isLeftDisabled ? "plain" : "ghost", onClick: () => currentPage > 0 && setCurrentPage(currentPage - 1), _hover: !isLeftDisabled ? { color: theme.colors.accentText } : {}, children: _jsx(ChevronLeft, {}) }) }), _jsx(Text, { mt: 3, fontSize: 12, whiteSpace: "nowrap", color: theme.colors.text[500], children: paginationText }), _jsx(ToolTip, { label: "Next", placement: "top", children: _jsx(IconButton, { "aria-label": "next-page", color: isRightDisabled ? theme.colors.textMuted : theme.colors.text[500], rounded: "full", variant: isRightDisabled ? "plain" : "ghost", onClick: () => currentPage < pages - 1 && setCurrentPage(currentPage + 1), _hover: !isRightDisabled ? { color: theme.colors.accentText } : {}, children: _jsx(ChevronRight, {}) }) }), _jsx(ToolTip, { label: "Last", placement: "top", children: _jsx(IconButton, { "aria-label": "last-page", color: isRightDisabled ? theme.colors.textMuted : theme.colors.text[500], rounded: "full", variant: isRightDisabled ? "plain" : "ghost", onClick: () => setCurrentPage(pages - 1), _hover: !isRightDisabled ? { color: theme.colors.accentText } : {}, children: _jsx(ChevronsRight, {}) }) })] }))] }));
|
|
17
|
+
return (_jsxs(Flex, { justify: "flex-end", align: "center", flexWrap: "nowrap", children: [(!isServerPagination || paginationSelectOptions) && (_jsxs(Select, { "aria-label": "Rows per page", onChange: handlePageSizeChange, value: rowsPerPage, size: "xs", borderRadius: "base", width: "auto", minW: "4.5rem", isDisabled: dataLength === 0, children: [!paginationSelectOptions && dataLength < 100 ? _jsx("option", { value: 0 }) : null, computedOptions.map((size, index) => (_jsx("option", { value: String(size), children: String(size) }, index)))] })), dataLength > 0 && (_jsxs(Flex, { w: "100%", children: [_jsx(ToolTip, { label: "First", placement: "top", children: _jsx(IconButton, { "aria-label": "first-page", color: isLeftDisabled ? theme.colors.textMuted : theme.colors.text[500], rounded: "full", variant: isLeftDisabled ? "plain" : "ghost", onClick: () => setCurrentPage(0), _hover: !isLeftDisabled ? { color: theme.colors.accentText } : {}, children: _jsx(ChevronsLeft, {}) }) }), _jsx(ToolTip, { label: "Previous", placement: "top", children: _jsx(IconButton, { "aria-label": "previous-page", color: isLeftDisabled ? theme.colors.textMuted : theme.colors.text[500], rounded: "full", variant: isLeftDisabled ? "plain" : "ghost", onClick: () => currentPage > 0 && setCurrentPage(currentPage - 1), _hover: !isLeftDisabled ? { color: theme.colors.accentText } : {}, children: _jsx(ChevronLeft, {}) }) }), _jsx(Text, { mt: 3, fontSize: 12, whiteSpace: "nowrap", color: theme.colors.text[500], children: paginationText }), _jsx(ToolTip, { label: "Next", placement: "top", children: _jsx(IconButton, { "aria-label": "next-page", color: isRightDisabled ? theme.colors.textMuted : theme.colors.text[500], rounded: "full", variant: isRightDisabled ? "plain" : "ghost", onClick: () => currentPage < pages - 1 && setCurrentPage(currentPage + 1), _hover: !isRightDisabled ? { color: theme.colors.accentText } : {}, children: _jsx(ChevronRight, {}) }) }), _jsx(ToolTip, { label: "Last", placement: "top", children: _jsx(IconButton, { "aria-label": "last-page", color: isRightDisabled ? theme.colors.textMuted : theme.colors.text[500], rounded: "full", variant: isRightDisabled ? "plain" : "ghost", onClick: () => setCurrentPage(pages - 1), _hover: !isRightDisabled ? { color: theme.colors.accentText } : {}, children: _jsx(ChevronsRight, {}) }) })] }))] }));
|
|
18
18
|
});
|
|
19
19
|
export default Pagination;
|
|
@@ -4,6 +4,7 @@ import { Box, Flex, IconButton, Input, List, ListItem, Text, } from "@chakra-ui/
|
|
|
4
4
|
import Checkbox from "../../Checkbox/Checkbox.js";
|
|
5
5
|
import { useCustomTheme } from "../../../Theme/useCustomTheme.js";
|
|
6
6
|
import { scrollbarStyles } from "../../../Theme/tokens/builders/scrollbar.js";
|
|
7
|
+
import { accentTextOnCanvas } from "../../../Theme/tokens/builders/accentText.js";
|
|
7
8
|
import { ChevronDown, ChevronUp, GripVertical } from "lucide-react";
|
|
8
9
|
const ManageColumns = ({ columns, items, setItems, childInputMethodsRef, }) => {
|
|
9
10
|
const theme = useCustomTheme();
|
|
@@ -70,7 +71,7 @@ const ManageColumns = ({ columns, items, setItems, childInputMethodsRef, }) => {
|
|
|
70
71
|
setError(null);
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
|
-
return (_jsxs(Box, { mt: 2, children: [error && (_jsx(Box, { mb: 2, px: 3, py: 2, bg: theme.colors.red[50], borderRadius: "md", border: "1px solid", borderColor: theme.colors.red[200], children: _jsx(Text, { color: theme.colors.red[
|
|
74
|
+
return (_jsxs(Box, { mt: 2, children: [error && (_jsx(Box, { mb: 2, px: 3, py: 2, bg: theme.colors.red[50], borderRadius: "md", border: "1px solid", borderColor: theme.colors.red[200], children: _jsx(Text, { color: accentTextOnCanvas(theme.colors.red, theme.colors.red[50]), fontSize: "xs", fontWeight: 500, children: error }) })), _jsx(Input, { placeholder: "Search columns...", mb: 2, value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), size: "sm", borderRadius: "md" }), !searchTerm.length && (_jsx(Flex, { align: "center", mb: 1, bg: theme.colors.gray[100], px: 2, py: 1, borderRadius: "md", children: _jsx(Checkbox, { label: "Show all columns", isChecked: allChecked, isIndeterminate: someChecked, onChange: handleSelectAll }) })), _jsx(List, { spacing: 0, maxH: "300px", overflowY: "auto", sx: scrollbarStyles(theme.colors), children: filteredItems.length > 0 ? (filteredItems.map((item, index) => {
|
|
74
75
|
const isDraggingThisItem = draggedItemIndex === index;
|
|
75
76
|
const isDropZone = draggedItemIndex !== null && draggedItemIndex !== index;
|
|
76
77
|
const realIndex = items.findIndex((i) => i.id === item.id);
|
|
@@ -71,13 +71,12 @@ export const Tag = {
|
|
|
71
71
|
outline: ({ theme, colorScheme = "primary" }) => {
|
|
72
72
|
const c = swatch(theme, colorScheme);
|
|
73
73
|
const canvas = theme.colors.backgroundColor.main;
|
|
74
|
+
const ink = accentTextOnCanvas(c, canvas);
|
|
74
75
|
return {
|
|
75
76
|
container: {
|
|
76
77
|
border: "0.094rem solid",
|
|
77
|
-
borderColor:
|
|
78
|
-
|
|
79
|
-
// hues (orange 2.51, green 2.94, red 4.09); use the canvas-text helper instead.
|
|
80
|
-
color: accentTextOnCanvas(c, canvas),
|
|
78
|
+
borderColor: ink,
|
|
79
|
+
color: ink,
|
|
81
80
|
bg: "transparent",
|
|
82
81
|
_hover: { bg: c[50] },
|
|
83
82
|
_active: { bg: c[100] },
|
|
@@ -2,14 +2,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, IconButton } from "@chakra-ui/react";
|
|
3
3
|
import { Columns3, Table2 } from "lucide-react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
+
import { AA_NON_TEXT, liftToContrast } from "../../Theme/tokens/builders/outlineRung.js";
|
|
5
6
|
import ToolTip from "../ToolTip/ToolTip.js";
|
|
6
7
|
const TableToggle = ({ value, onChange }) => {
|
|
7
8
|
const theme = useCustomTheme();
|
|
9
|
+
const { colors } = theme;
|
|
10
|
+
const restInk = liftToContrast(colors.background[800], colors.background[600], AA_NON_TEXT);
|
|
11
|
+
const hoverInk = liftToContrast(colors.background[900], colors.background[400], AA_NON_TEXT);
|
|
8
12
|
const styles = {
|
|
9
13
|
container: {
|
|
10
14
|
display: "flex",
|
|
11
15
|
alignItems: "center",
|
|
12
|
-
bg:
|
|
16
|
+
bg: colors.background[600],
|
|
13
17
|
p: "0.125rem",
|
|
14
18
|
borderRadius: "md",
|
|
15
19
|
height: "2rem",
|
|
@@ -17,19 +21,19 @@ const TableToggle = ({ value, onChange }) => {
|
|
|
17
21
|
width: "6.3rem",
|
|
18
22
|
},
|
|
19
23
|
button: (mode) => ({
|
|
20
|
-
bg: value === mode ?
|
|
24
|
+
bg: value === mode ? colors.background[50] : "transparent",
|
|
21
25
|
boxShadow: value === mode ? "md" : "none",
|
|
22
|
-
color: value === mode ?
|
|
26
|
+
color: value === mode ? colors.text[900] : restInk,
|
|
23
27
|
borderRadius: "base",
|
|
24
28
|
height: "1.75rem",
|
|
25
29
|
border: "0.031rem solid",
|
|
26
|
-
borderColor: value === mode ?
|
|
30
|
+
borderColor: value === mode ? colors.background[400] : "transparent",
|
|
27
31
|
padding: "0.313rem 0.813rem",
|
|
28
32
|
_hover: {
|
|
29
33
|
bg: value === mode
|
|
30
|
-
?
|
|
31
|
-
:
|
|
32
|
-
color: value === mode ?
|
|
34
|
+
? colors.background[50]
|
|
35
|
+
: colors.background[400],
|
|
36
|
+
color: value === mode ? colors.text[900] : hoverInk,
|
|
33
37
|
},
|
|
34
38
|
transition: "all 0.3s ease-in-out",
|
|
35
39
|
}),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "@chakra-ui/react";
|
|
3
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
|
+
const SIZES = {
|
|
5
|
+
sm: { w: "2rem", h: "1.125rem", knob: "0.875rem", travel: "0.75rem" },
|
|
6
|
+
md: { w: "2.375rem", h: "1.375rem", knob: "1.125rem", travel: "0.875rem" },
|
|
7
|
+
};
|
|
8
|
+
export default function ToggleSwitch({ isChecked, onChange, isDisabled = false, size = "md", id, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }) {
|
|
9
|
+
const { colors } = useCustomTheme();
|
|
10
|
+
const dims = SIZES[size];
|
|
11
|
+
return (_jsx(Box, { as: "button", type: "button", id: id, role: "switch", "aria-checked": isChecked, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, disabled: isDisabled, onClick: () => onChange(!isChecked), position: "relative", display: "inline-flex", alignItems: "center", flexShrink: 0, w: dims.w, h: dims.h, p: 0, borderRadius: "full", borderWidth: "1px", borderStyle: "solid", borderColor: isChecked ? colors.primary[500] : colors.boxborder[500], bg: isChecked ? colors.primary[500] : colors.background[600], opacity: isDisabled ? 0.5 : 1, cursor: isDisabled ? "not-allowed" : "pointer", transition: "background-color 0.2s ease, border-color 0.2s ease", _focusVisible: {
|
|
12
|
+
outline: "none",
|
|
13
|
+
boxShadow: `0 0 0 2px ${colors.primary[300]}`,
|
|
14
|
+
}, children: _jsx(Box, { "aria-hidden": "true", position: "absolute", left: "0.125rem", w: dims.knob, h: dims.knob, borderRadius: "full", bg: colors.background[50], boxShadow: "sm", transition: "transform 0.2s ease", transform: isChecked ? `translateX(${dims.travel})` : "translateX(0)" }) }));
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,18 +4,18 @@ import { Tooltip as ChakraTooltip } from "@chakra-ui/react";
|
|
|
4
4
|
import { useIsTruncated } from "../../Hooks/useIsTruncated.js";
|
|
5
5
|
import { mergeRefs } from "../../Utils/mergeRefs.js";
|
|
6
6
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
7
|
-
|
|
7
|
+
import { onFilled } from "../../Theme/tokens/builders/accentText.js";
|
|
8
|
+
export default function ToolTip({ placement = "top", label, children, hasArrow = true, fontSize = "14px", bg, color, isDisabled, overflowOnly = false, isOpen, defaultIsOpen, openDelay = 0, closeDelay = 0, arrowSize = 10, closeOnClick = false, size, width, height, arrowPadding, arrowShadowColor, direction, gutter = 8, onClose, modifiers, closeOnPointerDown, styles, }) {
|
|
8
9
|
// Measure the child for `overflowOnly`. The hook is always called (Rules of
|
|
9
10
|
// Hooks) but is fully inert unless `overflowOnly` is set — no layout reads,
|
|
10
11
|
// no ResizeObserver, no re-renders for ordinary tooltips. Measurement never
|
|
11
12
|
// runs on hover/scroll, so showing the tooltip stays as cheap as before.
|
|
12
13
|
const { ref, isTruncated } = useIsTruncated(label, overflowOnly && isValidElement(children));
|
|
13
|
-
//
|
|
14
|
-
// label. `sidebar.background` is the only ramp `buildDarkPalette` deliberately leaves
|
|
15
|
-
// un-inverted, so it stays near-black in dark mode and the white label stays legible —
|
|
16
|
-
// every other surface ramp flips light and would render the label invisible.
|
|
14
|
+
// `sidebar.background` stays near-black in both modes; ink is computed via `onFilled`.
|
|
17
15
|
const theme = useCustomTheme();
|
|
18
16
|
const surface = theme.colors.sidebar.background[500];
|
|
17
|
+
const resolvedBg = bg !== null && bg !== void 0 ? bg : surface;
|
|
18
|
+
const resolvedColor = color !== null && color !== void 0 ? color : onFilled(resolvedBg, theme.colors.white, theme.colors.black);
|
|
19
19
|
let content = children;
|
|
20
20
|
let effectiveDisabled = isDisabled;
|
|
21
21
|
if (overflowOnly && isValidElement(children)) {
|
|
@@ -26,5 +26,5 @@ export default function ToolTip({ placement = "top", label, children, hasArrow =
|
|
|
26
26
|
});
|
|
27
27
|
effectiveDisabled = Boolean(isDisabled) || !isTruncated;
|
|
28
28
|
}
|
|
29
|
-
return (_jsx(ChakraTooltip, { label: label, placement: placement, hasArrow: hasArrow, fontSize: fontSize, bg:
|
|
29
|
+
return (_jsx(ChakraTooltip, { label: label, placement: placement, hasArrow: hasArrow, fontSize: fontSize, bg: resolvedBg, color: resolvedColor, isDisabled: effectiveDisabled, isOpen: isOpen, defaultIsOpen: defaultIsOpen, openDelay: openDelay, closeDelay: closeDelay, arrowSize: arrowSize, closeOnClick: closeOnClick, size: size, width: width, height: height, arrowPadding: arrowPadding, arrowShadowColor: arrowShadowColor, direction: direction, gutter: gutter, onClose: onClose, modifiers: modifiers, closeOnPointerDown: closeOnPointerDown, style: styles, px: 3, py: 2, borderRadius: "lg", fontWeight: "400", lineHeight: "1.5", maxW: "300px", children: content }));
|
|
30
30
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -45,6 +45,8 @@ import Slider from "./Components/Slider/Slider.js";
|
|
|
45
45
|
import ScrollbarBox from "./Components/ScrollbarBox/ScrollbarBox.js";
|
|
46
46
|
import Skeletons from "./Components/Skeletons/Skeletons.js";
|
|
47
47
|
import Switch from "./Components/Switch/Switch.js";
|
|
48
|
+
import ToggleSwitch from "./Components/ToggleSwitch/ToggleSwitch.js";
|
|
49
|
+
import SegmentedControl from "./Components/SegmentedControl/SegmentedControl.js";
|
|
48
50
|
import Table from "./Components/Table/Table.js";
|
|
49
51
|
import Tag from "./Components/Tag/Tag.js";
|
|
50
52
|
import TextInput from "./Components/Input/TextInput.js";
|
|
@@ -97,7 +99,7 @@ import SignInActivityTable from "./Components/SignInActivityTable/SignInActivity
|
|
|
97
99
|
import OrganizationDetails from "./Components/OrganizationDetails/OrganizationDetails.js";
|
|
98
100
|
export {
|
|
99
101
|
// components
|
|
100
|
-
Accordian, AlertDialog, ApexBarChart, ApexPieChart, ApexPolarChart, ApexLineChart, ApexAreaChart, ApexRadialChart, Breadcrumbs, Button, ButtonGroupIcon, Card, Checkbox, ContactForm, DatePicker, Drawer, DrawerHeader, DrawerBody, DrawerFooter, Dropdown, Editor, EmptyState, WorkspaceWindow, WorkspaceTray, WorkspaceTrayPreview, FieldSelectModal, FilePreview, FilePreviewTrigger, FileUpload, FileUploader, FilterSidebar, FormWrapper, LazyWrapper, MoreItems, PdfViewer, ScrollToTop, CopyButton, StageProgress, StageItem, OrgSwitcher, LimitReachedModal, UpgradeButton, PlanPill, PlanBadge, formatPlanElapsed, formatPlanExpiry, formatPlanRemaining, resolvePlanBadge, splitMonthsAndDays, UserDetails, RolesPermission, CustomModulesTable, SignInActivityTable, OrganizationDetails, Header, HeaderActions, InputTextArea, InputSwitch, KanbanBoard, Loading, Modal, ModalHeader, ModalBody, ModalFooter, NavigationBar, Notification, NoteTextArea, MultiSelect, NumberInput, PaymentCard, PhoneNumberInput, PinInput, ProductCard, ProductDetails, ProfileCard, ProfileCardHeader, ProfileCardBody, ProfileCardFooter, ProfilePhotoViewer, ProgressBar, RadioButton, RadioButtonGroup, Reorder, Search, Select, SelectV2, SearchSelect, SelectSearch, SideBar, Slider, ScrollbarBox, Skeletons, Switch, Table, TableToggle, Tag, TextInput, Timeline, Toaster, ToolTip, OverflowToolTip, useToaster, VerifyEmailOtp,
|
|
102
|
+
Accordian, AlertDialog, ApexBarChart, ApexPieChart, ApexPolarChart, ApexLineChart, ApexAreaChart, ApexRadialChart, Breadcrumbs, Button, ButtonGroupIcon, Card, Checkbox, ContactForm, DatePicker, Drawer, DrawerHeader, DrawerBody, DrawerFooter, Dropdown, Editor, EmptyState, WorkspaceWindow, WorkspaceTray, WorkspaceTrayPreview, FieldSelectModal, FilePreview, FilePreviewTrigger, FileUpload, FileUploader, FilterSidebar, FormWrapper, LazyWrapper, MoreItems, PdfViewer, ScrollToTop, CopyButton, StageProgress, StageItem, OrgSwitcher, LimitReachedModal, UpgradeButton, PlanPill, PlanBadge, formatPlanElapsed, formatPlanExpiry, formatPlanRemaining, resolvePlanBadge, splitMonthsAndDays, UserDetails, RolesPermission, CustomModulesTable, SignInActivityTable, OrganizationDetails, Header, HeaderActions, InputTextArea, InputSwitch, KanbanBoard, Loading, Modal, ModalHeader, ModalBody, ModalFooter, NavigationBar, Notification, NoteTextArea, MultiSelect, NumberInput, PaymentCard, PhoneNumberInput, PinInput, ProductCard, ProductDetails, ProfileCard, ProfileCardHeader, ProfileCardBody, ProfileCardFooter, ProfilePhotoViewer, ProgressBar, RadioButton, RadioButtonGroup, Reorder, Search, Select, SelectV2, SearchSelect, SelectSearch, SideBar, Slider, ScrollbarBox, Skeletons, Switch, ToggleSwitch, SegmentedControl, Table, TableToggle, Tag, TextInput, Timeline, Toaster, ToolTip, OverflowToolTip, useToaster, VerifyEmailOtp,
|
|
101
103
|
// hooks
|
|
102
104
|
useSidebarPrefs, useIsTruncated,
|
|
103
105
|
// themes
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ import Slider from "./Components/Slider/Slider";
|
|
|
43
43
|
import ScrollbarBox from "./Components/ScrollbarBox/ScrollbarBox";
|
|
44
44
|
import Skeletons from "./Components/Skeletons/Skeletons";
|
|
45
45
|
import Switch from "./Components/Switch/Switch";
|
|
46
|
+
import ToggleSwitch from "./Components/ToggleSwitch/ToggleSwitch";
|
|
47
|
+
import SegmentedControl from "./Components/SegmentedControl/SegmentedControl";
|
|
46
48
|
import Table from "./Components/Table/Table";
|
|
47
49
|
import Tag from "./Components/Tag/Tag";
|
|
48
50
|
import TextInput from "./Components/Input/TextInput";
|
|
@@ -92,7 +94,7 @@ import RolesPermission from "./Components/RolesPermission/RolesPermission";
|
|
|
92
94
|
import CustomModulesTable from "./Components/CustomModulesTable/CustomModulesTable";
|
|
93
95
|
import SignInActivityTable from "./Components/SignInActivityTable/SignInActivityTable";
|
|
94
96
|
import OrganizationDetails from "./Components/OrganizationDetails/OrganizationDetails";
|
|
95
|
-
export { Accordian, AlertDialog, ApexBarChart, ApexPieChart, ApexPolarChart, ApexLineChart, ApexAreaChart, ApexRadialChart, Breadcrumbs, Button, ButtonGroupIcon, Card, Checkbox, ContactForm, DatePicker, Drawer, DrawerHeader, DrawerBody, DrawerFooter, Dropdown, Editor, EmptyState, WorkspaceWindow, WorkspaceTray, WorkspaceTrayPreview, FieldSelectModal, FilePreview, FilePreviewTrigger, FileUpload, FileUploader, FilterSidebar, FormWrapper, LazyWrapper, MoreItems, PdfViewer, ScrollToTop, CopyButton, StageProgress, StageItem, OrgSwitcher, LimitReachedModal, UpgradeButton, PlanPill, PlanBadge, formatPlanElapsed, formatPlanExpiry, formatPlanRemaining, resolvePlanBadge, splitMonthsAndDays, UserDetails, RolesPermission, CustomModulesTable, SignInActivityTable, OrganizationDetails, Header, HeaderActions, InputTextArea, InputSwitch, KanbanBoard, Loading, Modal, ModalHeader, ModalBody, ModalFooter, NavigationBar, Notification, NoteTextArea, MultiSelect, NumberInput, PaymentCard, PhoneNumberInput, PinInput, ProductCard, ProductDetails, ProfileCard, ProfileCardHeader, ProfileCardBody, ProfileCardFooter, ProfilePhotoViewer, ProgressBar, RadioButton, RadioButtonGroup, Reorder, Search, Select, SelectV2, SearchSelect, SelectSearch, SideBar, Slider, ScrollbarBox, Skeletons, Switch, Table, TableToggle, Tag, TextInput, Timeline, Toaster, ToolTip, OverflowToolTip, useToaster, VerifyEmailOtp, useSidebarPrefs, useIsTruncated, useCustomTheme, ThemesList, debounce, isAllowedReturnUrl, resolveReturnUrl, createAccountHandoff, };
|
|
97
|
+
export { Accordian, AlertDialog, ApexBarChart, ApexPieChart, ApexPolarChart, ApexLineChart, ApexAreaChart, ApexRadialChart, Breadcrumbs, Button, ButtonGroupIcon, Card, Checkbox, ContactForm, DatePicker, Drawer, DrawerHeader, DrawerBody, DrawerFooter, Dropdown, Editor, EmptyState, WorkspaceWindow, WorkspaceTray, WorkspaceTrayPreview, FieldSelectModal, FilePreview, FilePreviewTrigger, FileUpload, FileUploader, FilterSidebar, FormWrapper, LazyWrapper, MoreItems, PdfViewer, ScrollToTop, CopyButton, StageProgress, StageItem, OrgSwitcher, LimitReachedModal, UpgradeButton, PlanPill, PlanBadge, formatPlanElapsed, formatPlanExpiry, formatPlanRemaining, resolvePlanBadge, splitMonthsAndDays, UserDetails, RolesPermission, CustomModulesTable, SignInActivityTable, OrganizationDetails, Header, HeaderActions, InputTextArea, InputSwitch, KanbanBoard, Loading, Modal, ModalHeader, ModalBody, ModalFooter, NavigationBar, Notification, NoteTextArea, MultiSelect, NumberInput, PaymentCard, PhoneNumberInput, PinInput, ProductCard, ProductDetails, ProfileCard, ProfileCardHeader, ProfileCardBody, ProfileCardFooter, ProfilePhotoViewer, ProgressBar, RadioButton, RadioButtonGroup, Reorder, Search, Select, SelectV2, SearchSelect, SelectSearch, SideBar, Slider, ScrollbarBox, Skeletons, Switch, ToggleSwitch, SegmentedControl, Table, TableToggle, Tag, TextInput, Timeline, Toaster, ToolTip, OverflowToolTip, useToaster, VerifyEmailOtp, useSidebarPrefs, useIsTruncated, useCustomTheme, ThemesList, debounce, isAllowedReturnUrl, resolveReturnUrl, createAccountHandoff, };
|
|
96
98
|
export default withTheme;
|
|
97
99
|
export type { UserDetailsProps, UserDetailsLabels, UserListItem, SelectedUserDetail, UserDetailRow, RoleOption, AddUserFormValues, ChangeRoleSubmitPayload, } from "./Components/UserDetails/UserDetailsProps";
|
|
98
100
|
export type { WorkspaceWindowProps, WorkspaceWindowState, WorkspaceTrayProps, WorkspaceTrayItem, WorkspaceTrayPreviewProps, } from "./Components/WorkspaceWindow/WorkspaceWindowProps";
|
|
@@ -141,6 +143,8 @@ export type { InputTextAreaProps } from "./Components/InputTextArea/InputTextAre
|
|
|
141
143
|
export type { NumberInputProps, ActiveStyle as NumberInputActiveStyle } from "./Components/NumberInput/NumberInputProps";
|
|
142
144
|
export type { CheckboxProps } from "./Components/Checkbox/CheckboxProps";
|
|
143
145
|
export type { SwitchProps } from "./Components/Switch/SwitchProps";
|
|
146
|
+
export type { ToggleSwitchProps, ToggleSwitchSize } from "./Components/ToggleSwitch/ToggleSwitchProps";
|
|
147
|
+
export type { SegmentedControlProps, SegmentedControlOption, SegmentedControlSize, } from "./Components/SegmentedControl/SegmentedControlProps";
|
|
144
148
|
export type { ChakraRadioProps as RadioButtonProps, ChakraRadioGroupProps as RadioButtonGroupProps } from "./Components/RadioButton/RadioButtonProps";
|
|
145
149
|
export type { ChakraPinInputProps as PinInputProps } from "./Components/PinInput/PinInputProps";
|
|
146
150
|
export type { TagProps, TagSize, TagVariant, TagColorScheme } from "./Components/Tag/TagProps";
|
package/dist/index.js
CHANGED
|
@@ -41,9 +41,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
41
|
};
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
43
|
exports.UserDetails = exports.splitMonthsAndDays = exports.resolvePlanBadge = exports.formatPlanRemaining = exports.formatPlanExpiry = exports.formatPlanElapsed = exports.PlanBadge = exports.PlanPill = exports.UpgradeButton = exports.LimitReachedModal = exports.OrgSwitcher = exports.StageItem = exports.StageProgress = exports.CopyButton = exports.ScrollToTop = exports.PdfViewer = exports.MoreItems = exports.LazyWrapper = exports.FormWrapper = exports.FilterSidebar = exports.FileUploader = exports.FileUpload = exports.FilePreviewTrigger = exports.FilePreview = exports.FieldSelectModal = exports.WorkspaceTrayPreview = exports.WorkspaceTray = exports.WorkspaceWindow = exports.EmptyState = exports.Editor = exports.Dropdown = exports.DrawerFooter = exports.DrawerBody = exports.DrawerHeader = exports.Drawer = exports.DatePicker = exports.ContactForm = exports.Checkbox = exports.Card = exports.ButtonGroupIcon = exports.Button = exports.Breadcrumbs = exports.ApexRadialChart = exports.ApexAreaChart = exports.ApexLineChart = exports.ApexPolarChart = exports.ApexPieChart = exports.ApexBarChart = exports.AlertDialog = exports.Accordian = void 0;
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.inkSafeGradientToken = exports.gradientCss = exports.resolveGradient = exports.fieldSurfaces = exports.placeholderInkOn = exports.placeholderInk = exports.SCROLLBAR_WIDTH = exports.globalScrollbarStyles = exports.scrollbarStyles = exports.contrastRatio = exports.relativeLuminance = exports.mix = exports.withLightness = exports.hslToHex = exports.hexToHsl = exports.hslToRgb = exports.rgbToHsl = exports.rgbToHex = void 0;
|
|
44
|
+
exports.Timeline = exports.TextInput = exports.Tag = exports.TableToggle = exports.Table = exports.SegmentedControl = exports.ToggleSwitch = exports.Switch = exports.Skeletons = exports.ScrollbarBox = exports.Slider = exports.SideBar = exports.SelectSearch = exports.SearchSelect = exports.SelectV2 = exports.Select = exports.Search = exports.Reorder = exports.RadioButtonGroup = exports.RadioButton = exports.ProgressBar = exports.ProfilePhotoViewer = exports.ProfileCardFooter = exports.ProfileCardBody = exports.ProfileCardHeader = exports.ProfileCard = exports.ProductDetails = exports.ProductCard = exports.PinInput = exports.PhoneNumberInput = exports.PaymentCard = exports.NumberInput = exports.MultiSelect = exports.NoteTextArea = exports.Notification = exports.NavigationBar = exports.ModalFooter = exports.ModalBody = exports.ModalHeader = exports.Modal = exports.Loading = exports.KanbanBoard = exports.InputSwitch = exports.InputTextArea = exports.HeaderActions = exports.Header = exports.OrganizationDetails = exports.SignInActivityTable = exports.CustomModulesTable = exports.RolesPermission = void 0;
|
|
45
|
+
exports.hexToRgb = exports.DARK_CANVAS_LUMINANCE = exports.AA_NORMAL_TEXT = exports.pickAccentText = exports.accentTextOnCanvas = exports.onGradient = exports.onFilled = exports.isDarkCanvas = exports.STATUS_INK = exports.ACCENT_GRADIENT = exports.chipBorder = exports.chipFill = exports.inkSafeGradient = exports.statusGradient = exports.resolveStatusTone = exports.resolveAvatarFill = exports.meetsBodyText = exports.avatarFillFor = exports.AVATAR_SEEDS = exports.withOutlineRung = exports.liftToContrast = exports.AA_NON_TEXT = exports.buildDarkPalette = exports.themeNames = exports.palettes = exports.darkPalettes = exports.lightPalettes = exports.brandThemes = exports.AppearanceSettings = exports.useFontSizeSync = exports.resolveFontSize = exports.isFontSize = exports.FONT_SIZE_OPTIONS = exports.DEFAULT_FONT_SIZE = exports.ThemeSwitcher = exports.useThemeMode = exports.PixelizeThemeProvider = exports.createAccountHandoff = exports.resolveReturnUrl = exports.isAllowedReturnUrl = exports.debounce = exports.ThemesList = exports.useCustomTheme = exports.useIsTruncated = exports.useSidebarPrefs = exports.VerifyEmailOtp = exports.useToaster = exports.OverflowToolTip = exports.ToolTip = exports.Toaster = void 0;
|
|
46
|
+
exports.inkSafeGradientToken = exports.gradientCss = exports.resolveGradient = exports.fieldSurfaces = exports.placeholderInkOn = exports.placeholderInk = exports.SCROLLBAR_WIDTH = exports.globalScrollbarStyles = exports.scrollbarStyles = exports.contrastRatio = exports.relativeLuminance = exports.mix = exports.withLightness = exports.hslToHex = exports.hexToHsl = exports.hslToRgb = exports.rgbToHsl = exports.rgbToHex = exports.compositeOver = exports.hexToRgba = void 0;
|
|
47
47
|
const Accordion_1 = __importDefault(require("./Components/Accordion/Accordion"));
|
|
48
48
|
exports.Accordian = Accordion_1.default;
|
|
49
49
|
const AlertDialog_1 = __importDefault(require("./Components/AlertDialog/AlertDialog"));
|
|
@@ -145,6 +145,10 @@ const Skeletons_1 = __importDefault(require("./Components/Skeletons/Skeletons"))
|
|
|
145
145
|
exports.Skeletons = Skeletons_1.default;
|
|
146
146
|
const Switch_1 = __importDefault(require("./Components/Switch/Switch"));
|
|
147
147
|
exports.Switch = Switch_1.default;
|
|
148
|
+
const ToggleSwitch_1 = __importDefault(require("./Components/ToggleSwitch/ToggleSwitch"));
|
|
149
|
+
exports.ToggleSwitch = ToggleSwitch_1.default;
|
|
150
|
+
const SegmentedControl_1 = __importDefault(require("./Components/SegmentedControl/SegmentedControl"));
|
|
151
|
+
exports.SegmentedControl = SegmentedControl_1.default;
|
|
148
152
|
const Table_1 = __importDefault(require("./Components/Table/Table"));
|
|
149
153
|
exports.Table = Table_1.default;
|
|
150
154
|
const Tag_1 = __importDefault(require("./Components/Tag/Tag"));
|
package/package.json
CHANGED