pixelize-design-library 2.4.2-beta.9 → 2.4.2
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/Button/Button.d.ts +2 -2
- package/dist/Components/Button/Button.js +3 -3
- package/dist/Components/Button/Button.styles.js +29 -3
- package/dist/Components/Button/ButtonProps.d.ts +6 -1
- package/dist/Components/Card/Card.d.ts +1 -1
- package/dist/Components/Card/Card.js +2 -2
- package/dist/Components/Card/CardProps.d.ts +0 -1
- package/dist/Components/Checkbox/Checkbox.js +1 -1
- package/dist/Components/FileUpload/FileUpload.js +3 -2
- package/dist/Components/FileUpload/FileUploadProps.d.ts +3 -1
- package/dist/Components/FileUpload/constants.js +1 -0
- package/dist/Components/FilterSidebar/FilterSidebar.js +2 -2
- package/dist/Components/Input/TextInput.styles.js +0 -1
- package/dist/Components/InputTextArea/InputTextArea.style.js +0 -1
- package/dist/Components/NoteTextArea/NoteTextArea.js +0 -2
- package/dist/Components/NumberInput/NumberInput.js +3 -1
- package/dist/Components/NumberInput/NumberInput.styles.js +0 -1
- package/dist/Components/Primitives/Primitives.d.ts +6 -0
- package/dist/Components/Primitives/Primitives.js +113 -0
- package/dist/Components/RadioButton/RadioButton.js +1 -1
- package/dist/Components/Search/Search.js +2 -2
- package/dist/Components/Select/Select.d.ts +1 -1
- package/dist/Components/Select/Select.js +4 -2
- package/dist/Components/Select/Select.styles.js +0 -1
- package/dist/Components/Select/SelectProps.d.ts +3 -0
- package/dist/Components/SelectV2/SelectV2.js +1 -1
- package/dist/Components/SideBar/SideBar.js +1 -1
- package/dist/Components/Table/Table.d.ts +1 -1
- package/dist/Components/Table/Table.js +8 -4
- package/dist/Components/Table/TableProps.d.ts +4 -0
- package/dist/Components/Table/components/Pagination.js +1 -1
- package/dist/Components/Table/components/TableBody.js +40 -11
- package/dist/Components/Table/components/TableHeader.js +21 -8
- package/dist/Components/Table/variants/TableVariantContext.d.ts +4 -0
- package/dist/Components/Table/variants/TableVariantContext.js +17 -0
- package/dist/Components/Table/variants/classic.d.ts +6 -0
- package/dist/Components/Table/variants/classic.js +47 -0
- package/dist/Components/Table/variants/index.d.ts +7 -0
- package/dist/Components/Table/variants/index.js +27 -0
- package/dist/Components/Table/variants/pillInk.d.ts +6 -0
- package/dist/Components/Table/variants/pillInk.js +21 -0
- package/dist/Components/Table/variants/studio.d.ts +6 -0
- package/dist/Components/Table/variants/studio.js +50 -0
- package/dist/Components/Table/variants/tokens.d.ts +49 -0
- package/dist/Components/Table/variants/tokens.js +2 -0
- package/dist/Theme/chakra/Menu.styles.d.ts +3 -1
- package/dist/Theme/chakra/Menu.styles.js +5 -3
- package/dist/Theme/chakra/Popover.styles.d.ts +3 -1
- package/dist/Theme/chakra/Popover.styles.js +4 -2
- package/dist/Theme/chakra/componentStyles.d.ts +8 -4
- package/dist/Theme/tokens/builders/outlineRung.d.ts +27 -3
- package/dist/Theme/tokens/builders/outlineRung.js +55 -5
- package/dist/Theme/tokens/builders/placeholderInk.d.ts +5 -5
- package/dist/Theme/tokens/builders/placeholderInk.js +8 -6
- package/dist/Theme/tokens/builders/surfaceRungs.js +12 -1
- package/dist/esm/Components/Button/Button.js +4 -4
- package/dist/esm/Components/Button/Button.styles.js +29 -3
- package/dist/esm/Components/Card/Card.js +2 -2
- package/dist/esm/Components/Checkbox/Checkbox.js +1 -1
- package/dist/esm/Components/FileUpload/FileUpload.js +4 -3
- package/dist/esm/Components/FileUpload/constants.js +1 -0
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +2 -2
- package/dist/esm/Components/Input/TextInput.styles.js +0 -1
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +0 -1
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +0 -2
- package/dist/esm/Components/NumberInput/NumberInput.js +4 -2
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +0 -1
- package/dist/esm/Components/Primitives/Primitives.js +6 -0
- package/dist/esm/Components/RadioButton/RadioButton.js +1 -1
- package/dist/esm/Components/Search/Search.js +2 -2
- package/dist/esm/Components/Select/Select.js +5 -3
- package/dist/esm/Components/Select/Select.styles.js +0 -1
- package/dist/esm/Components/SelectV2/SelectV2.js +1 -1
- package/dist/esm/Components/SideBar/SideBar.js +1 -1
- package/dist/esm/Components/Table/Table.js +8 -4
- package/dist/esm/Components/Table/components/Pagination.js +1 -1
- package/dist/esm/Components/Table/components/TableBody.js +41 -12
- package/dist/esm/Components/Table/components/TableHeader.js +21 -8
- package/dist/esm/Components/Table/variants/TableVariantContext.js +13 -0
- package/dist/esm/Components/Table/variants/classic.js +43 -0
- package/dist/esm/Components/Table/variants/index.js +9 -0
- package/dist/esm/Components/Table/variants/pillInk.js +18 -0
- package/dist/esm/Components/Table/variants/studio.js +46 -0
- package/dist/esm/Components/Table/variants/tokens.js +1 -0
- package/dist/esm/Theme/chakra/Menu.styles.js +5 -3
- package/dist/esm/Theme/chakra/Popover.styles.js +4 -2
- package/dist/esm/Theme/tokens/builders/outlineRung.js +52 -4
- package/dist/esm/Theme/tokens/builders/placeholderInk.js +9 -7
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +13 -2
- package/dist/esm/index.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { type ComponentWithAs } from "@chakra-ui/react";
|
|
1
2
|
import { ButtonProps } from "./ButtonProps";
|
|
2
|
-
declare
|
|
3
|
-
declare const _default: import("react").MemoExoticComponent<typeof Button>;
|
|
3
|
+
declare const _default: ComponentWithAs<"button", ButtonProps>;
|
|
4
4
|
export default _default;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const react_2 = require("@chakra-ui/react");
|
|
6
|
-
function Button({ label, children, onClick, opacity, variant = "solid", leftIcon, rightIcon, size, isDisabled = false, isLoading = false, loadingText = "Loading", type, width, sx, colorScheme,
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)(react_2.Button, { ...aria, type: type, onClick: onClick, width: width || "fit-content", variant: variant, size: size, isLoading: isLoading, isDisabled: isDisabled, loadingText: loadingText, leftIcon: leftIcon, rightIcon: rightIcon, ref: ref, colorScheme: colorScheme, sx: sx, opacity: opacity, border: border, borderRadius: borderRadius, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: children !== null && children !== void 0 ? children : label }));
|
|
8
|
-
}
|
|
6
|
+
const Button = (0, react_1.forwardRef)(function Button({ label, children, onClick, opacity, variant = "solid", leftIcon, rightIcon, size, isDisabled = false, isLoading = false, loadingText = "Loading", type, width, w, sx, colorScheme, border, borderRadius, onMouseEnter, onMouseLeave, ...aria }, ref) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Button, { ...aria, type: type, onClick: onClick, width: width || w || "fit-content", variant: variant, size: size, isLoading: isLoading, isDisabled: isDisabled, loadingText: loadingText, leftIcon: leftIcon, rightIcon: rightIcon, ref: ref, colorScheme: colorScheme, sx: sx, opacity: opacity, border: border, borderRadius: borderRadius, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: children !== null && children !== void 0 ? children : label }));
|
|
8
|
+
});
|
|
9
9
|
exports.default = (0, react_1.memo)(Button);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Button = void 0;
|
|
4
4
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
5
|
+
const color_1 = require("../../Theme/tokens/builders/color");
|
|
5
6
|
const gradientInk_1 = require("../../Theme/tokens/builders/gradientInk");
|
|
6
7
|
/**
|
|
7
8
|
* Outline/ghost/link text sits ON the canvas, so it needs a rung that stays readable there —
|
|
@@ -30,9 +31,34 @@ const onCanvasHoverBg = (theme, colorScheme, step) => {
|
|
|
30
31
|
* ~3.2 contrast.
|
|
31
32
|
*/
|
|
32
33
|
const FILL_STEP_RUNGS = { light: [600, 700], dark: [400, 300] };
|
|
34
|
+
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
35
|
+
const AA_NORMAL_TEXT = 4.5;
|
|
36
|
+
// Semantic scales (red/green) carry no opacity ramp; brand scales do and keep their own [500].
|
|
37
|
+
const solidRung = (theme, colorScheme) => {
|
|
38
|
+
const scale = theme.colors[colorScheme];
|
|
39
|
+
const white = theme.colors.white;
|
|
40
|
+
if ("opacity" in scale)
|
|
41
|
+
return 500;
|
|
42
|
+
if ((0, color_1.contrastRatio)(scale[500], white) >= AA_NORMAL_TEXT)
|
|
43
|
+
return 500;
|
|
44
|
+
const passing = RUNGS.filter((r) => scale[r] && (0, color_1.contrastRatio)(scale[r], white) >= AA_NORMAL_TEXT);
|
|
45
|
+
if (!passing.length)
|
|
46
|
+
return 500;
|
|
47
|
+
return passing.reduce((a, b) => (0, color_1.contrastRatio)(scale[a], white) <= (0, color_1.contrastRatio)(scale[b], white) ? a : b);
|
|
48
|
+
};
|
|
49
|
+
const steppedRung = (theme, base, step) => {
|
|
50
|
+
const dir = (0, accentText_1.isDarkCanvas)(theme.colors.backgroundColor.main) ? -100 : 100;
|
|
51
|
+
return Math.min(900, Math.max(50, base + dir * step));
|
|
52
|
+
};
|
|
33
53
|
const darkerFill = (theme, colorScheme, step) => {
|
|
34
|
-
|
|
35
|
-
|
|
54
|
+
var _a;
|
|
55
|
+
const scale = theme.colors[colorScheme];
|
|
56
|
+
const base = solidRung(theme, colorScheme);
|
|
57
|
+
if (base === 500) {
|
|
58
|
+
const mode = (0, accentText_1.isDarkCanvas)(theme.colors.backgroundColor.main) ? "dark" : "light";
|
|
59
|
+
return scale[FILL_STEP_RUNGS[mode][step]];
|
|
60
|
+
}
|
|
61
|
+
return (_a = scale[steppedRung(theme, base, step === 0 ? 1 : 2)]) !== null && _a !== void 0 ? _a : scale[base];
|
|
36
62
|
};
|
|
37
63
|
/** Label for the solid variant's filled bg — derived from THAT fill, since hover/active swap it. */
|
|
38
64
|
const labelFor = (theme, fill) => (0, accentText_1.onFilled)(fill, theme.colors.white, theme.colors.black);
|
|
@@ -49,7 +75,7 @@ exports.Button = {
|
|
|
49
75
|
}),
|
|
50
76
|
variants: {
|
|
51
77
|
solid: ({ theme, colorScheme = "primary" }) => {
|
|
52
|
-
const fill = theme.colors[colorScheme][
|
|
78
|
+
const fill = theme.colors[colorScheme][solidRung(theme, colorScheme)];
|
|
53
79
|
const hoverFill = darkerFill(theme, colorScheme, 0);
|
|
54
80
|
const activeFill = darkerFill(theme, colorScheme, 1);
|
|
55
81
|
const hoverLabel = labelFor(theme, hoverFill);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ButtonProps as ChakraButtonProps } from "@chakra-ui/react";
|
|
2
|
-
|
|
2
|
+
type LayoutProps = Pick<ChakraButtonProps, "as" | "m" | "mt" | "mb" | "ml" | "mr" | "mx" | "my" | "p" | "pt" | "pb" | "pl" | "pr" | "px" | "py" | "w" | "minW" | "maxW" | "h" | "minH" | "maxH" | "boxSize" | "flex" | "flexShrink" | "flexGrow" | "alignSelf" | "justifyContent" | "cursor" | "fontWeight" | "fontSize" | "textAlign" | "whiteSpace" | "_hover" | "_active" | "_focus" | "_focusVisible" | "_disabled" | "isActive" | "onKeyDown" | "onFocus" | "onBlur" | "onPointerDown" | "tabIndex" | "form" | "name" | "value" | "autoFocus" | "role">;
|
|
3
|
+
type DataAttributes = {
|
|
4
|
+
[key: `data-${string}`]: string | number | boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
export type ButtonProps = LayoutProps & DataAttributes & Pick<ChakraButtonProps, "onClick" | "leftIcon" | "rightIcon" | "isDisabled" | "isLoading" | "loadingText" | "spinner" | "sx" | "border" | "borderRadius" | "onMouseEnter" | "onMouseLeave" | "aria-label" | "aria-labelledby" | "aria-describedby" | "aria-expanded" | "aria-haspopup" | "aria-controls" | "aria-pressed" | "aria-current" | "id" | "title"> & {
|
|
3
7
|
label?: string;
|
|
4
8
|
width?: string | number;
|
|
5
9
|
size?: "lg" | "md" | "sm" | "xs" | "xl";
|
|
@@ -10,3 +14,4 @@ export type ButtonProps = Pick<ChakraButtonProps, "onClick" | "leftIcon" | "righ
|
|
|
10
14
|
children?: React.ReactNode;
|
|
11
15
|
opacity?: number;
|
|
12
16
|
};
|
|
17
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CardProps } from "./CardProps";
|
|
2
|
-
export default function Card({
|
|
2
|
+
export default function Card({ maxW, align, variant, direction, justify, children, size, color, overflow, sx, }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = Card;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@chakra-ui/react");
|
|
6
|
-
function Card({
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Card, { maxW: maxW, align: align, variant: variant, direction: direction, justify: justify, size: size, overflow: overflow, colorScheme: color, p: 4, sx: sx, children: children }
|
|
6
|
+
function Card({ maxW, align, variant, direction, justify, children, size, color, overflow, sx, }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Card, { maxW: maxW, align: align, variant: variant, direction: direction, justify: justify, size: size, overflow: overflow, colorScheme: color, p: 4, sx: sx, children: children }));
|
|
8
8
|
}
|
|
@@ -6,7 +6,6 @@ export type CardProps = Pick<ChakraCardProps, "direction" | "maxW" | "align" | "
|
|
|
6
6
|
variant?: "elevated" | "outline" | "filled" | "unstyled";
|
|
7
7
|
size?: "sm" | "md" | "lg";
|
|
8
8
|
color?: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink";
|
|
9
|
-
key?: string;
|
|
10
9
|
dividercolor?: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink";
|
|
11
10
|
dividersize?: string;
|
|
12
11
|
dividervariant?: "solid" | "dashed";
|
|
@@ -27,7 +27,7 @@ function CheckBox({ label, labelFontSize, showLabelTooltip, labelTooltip, labelC
|
|
|
27
27
|
...labelSx,
|
|
28
28
|
}
|
|
29
29
|
: { ...labelSx };
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Checkbox, { ...aria, onClick: onClick, spacing: spacing !== null && spacing !== void 0 ? spacing : "0.5rem", isInvalid: isInvalid, colorScheme: color, iconColor: iconColor, iconSize: iconSize, isChecked: isChecked, isIndeterminate: isIndeterminate, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Checkbox, { ...aria, onClick: onClick, spacing: spacing !== null && spacing !== void 0 ? spacing : "0.5rem", isInvalid: isInvalid, colorScheme: color, iconColor: iconColor, iconSize: iconSize, isChecked: isChecked, isIndeterminate: isIndeterminate, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.boxborder[500], display: "flex", alignItems: "center", sx: {
|
|
31
31
|
...sx,
|
|
32
32
|
".chakra-checkbox__control": { w: controlSize, h: controlSize },
|
|
33
33
|
}, children: label && (showLabelTooltip ? ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: labelTooltip !== null && labelTooltip !== void 0 ? labelTooltip : label, hasArrow: true, placement: "top", fontSize: "0.75rem", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", sx: clampStyles, fontSize: labelFontSize !== null && labelFontSize !== void 0 ? labelFontSize : "0.8125rem", color: theme.colors.text[700], fontWeight: 500, ml: 0, children: label }) })) : ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", sx: clampStyles, fontSize: labelFontSize !== null && labelFontSize !== void 0 ? labelFontSize : "0.8125rem", color: theme.colors.text[700], fontWeight: 500, ml: 0, children: label }))) }), error && (0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { errorMessage: errorMessage }), helperText && !error && (0, jsx_runtime_1.jsx)(HelperText_1.default, { helperText: helperText })] }));
|
|
@@ -42,7 +42,8 @@ const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
|
42
42
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
43
43
|
const constants_1 = require("./constants");
|
|
44
44
|
const Modal_1 = __importStar(require("../Modal/Modal"));
|
|
45
|
-
const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes = [".jpg", ".png"], maxSizeKB = 5, maxFiles = undefined, progress = {}, }) => {
|
|
45
|
+
const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes = [".jpg", ".png"], maxSizeKB = 5, maxFiles = undefined, progress = {}, size = "md", inputAriaLabel = "Upload files", }) => {
|
|
46
|
+
const compact = size === "sm";
|
|
46
47
|
const { colors, radii } = (0, useCustomTheme_1.useCustomTheme)();
|
|
47
48
|
const { isOpen, onOpen, onClose } = (0, react_2.useDisclosure)();
|
|
48
49
|
const [previewUrl, setPreviewUrl] = react_1.default.useState(null);
|
|
@@ -88,7 +89,7 @@ const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes
|
|
|
88
89
|
setErrors(messages);
|
|
89
90
|
},
|
|
90
91
|
});
|
|
91
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 4, align: "stretch", children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { ...getRootProps(), border: "2px dashed", borderColor: border, borderRadius: "md", p: 10, textAlign: "center", bg: bg, cursor: "pointer", transition: "all 0.2s", _hover: { bg: colors.gray[100] }, position: "relative", children: [(0, jsx_runtime_1.jsx)("input", { ...getInputProps() }), (0, jsx_runtime_1.jsxs)(react_2.
|
|
92
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 4, align: "stretch", children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { ...getRootProps(), border: "2px dashed", borderColor: border, borderRadius: "md", p: compact ? 3 : 10, textAlign: "center", bg: bg, cursor: "pointer", transition: "all 0.2s", _hover: { bg: colors.gray[100] }, position: "relative", children: [(0, jsx_runtime_1.jsx)("input", { ...getInputProps({ "aria-label": inputAriaLabel }) }), (0, jsx_runtime_1.jsxs)(react_2.Stack, { direction: compact ? "row" : "column", spacing: compact ? 3 : 2, align: "center", justify: "center", children: [(0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.Upload, boxSize: compact ? 4 : 6 }), (0, jsx_runtime_1.jsxs)(react_2.Stack, { spacing: 0, align: compact ? "start" : "center", children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontWeight: "medium", fontSize: compact ? "sm" : "md", color: colors.textMuted, children: "Drag and drop files here" }), (0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: compact ? "xs" : "sm", color: colors.textMuted, children: [acceptTypes.join(", "), " up to ", (0, constants_1.toMB)(maxSizeKB), " ", maxFiles ? `- ${maxFiles} file(s) max` : ""] })] })] })] }), errors.length > 0 && ((0, jsx_runtime_1.jsx)(react_2.Box, { children: errors.map((err, idx) => ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: colors.semanticText.error, children: err }, idx))) })), uploadedFiles.length > 0 && ((0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsx)(react_2.Box, { display: "flex", alignItems: "center", gap: 2, children: (0, jsx_runtime_1.jsx)(react_2.Text, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize: 14, lineHeight: "100%", letterSpacing: "4%", textTransform: "uppercase", py: 4, children: "Uploaded Files" }) }), (0, jsx_runtime_1.jsx)(react_2.List, { spacing: 2, children: uploadedFiles.map((file, index) => ((0, jsx_runtime_1.jsxs)(react_2.Box, { borderWidth: "0.063rem", borderRadius: "md", px: 3, py: 2, bg: colors.background[50], children: [(0, jsx_runtime_1.jsxs)(react_2.ListItem, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [(0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 3, flex: "1", children: [file.type.startsWith("image/") ? ((0, jsx_runtime_1.jsxs)(react_2.Box, { boxSize: "2.5rem", cursor: "pointer", position: "relative", _hover: {
|
|
92
93
|
".hover-icon": {
|
|
93
94
|
opacity: 1,
|
|
94
95
|
bg: colors.secondary.opacity[16],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type MimeExtension = '.jpg' | '.jpeg' | '.png' | '.gif' | '.webp' | '.svg' | '.pdf' | '.doc' | '.docx' | '.xls' | '.xlsx' | '.ppt' | '.pptx' | '.txt' | '.mp4' | '.mov' | '.mp3' | '.wav' | '.zip' | '.rar' | '.7z';
|
|
1
|
+
export type MimeExtension = '.jpg' | '.jpeg' | '.png' | '.gif' | '.webp' | '.svg' | '.pdf' | '.doc' | '.docx' | '.xls' | '.xlsx' | '.ppt' | '.pptx' | '.txt' | '.csv' | '.mp4' | '.mov' | '.mp3' | '.wav' | '.zip' | '.rar' | '.7z';
|
|
2
2
|
export type MimeMap = Record<MimeExtension, string>;
|
|
3
3
|
export type FileUploaderProps = {
|
|
4
4
|
onFilesUploaded: (files: File[]) => void;
|
|
@@ -7,5 +7,7 @@ export type FileUploaderProps = {
|
|
|
7
7
|
acceptTypes?: MimeExtension[];
|
|
8
8
|
maxSizeKB?: number;
|
|
9
9
|
maxFiles?: number;
|
|
10
|
+
size?: 'sm' | 'md';
|
|
10
11
|
progress?: Record<string, number>;
|
|
12
|
+
inputAriaLabel?: string;
|
|
11
13
|
};
|
|
@@ -16,6 +16,7 @@ exports.mimeMap = {
|
|
|
16
16
|
'.ppt': 'application/vnd.ms-powerpoint',
|
|
17
17
|
'.pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
18
18
|
'.txt': 'text/plain',
|
|
19
|
+
'.csv': 'text/csv',
|
|
19
20
|
'.mp4': 'video/mp4',
|
|
20
21
|
'.mov': 'video/quicktime',
|
|
21
22
|
'.mp3': 'audio/mpeg',
|
|
@@ -149,13 +149,13 @@ panelPadding = 3, clearAllButton = true, onClearAllHandler,
|
|
|
149
149
|
pointerEvents: 'none', // Allow clicks to pass through track
|
|
150
150
|
zIndex: 3,
|
|
151
151
|
margin: 0,
|
|
152
|
-
} })] }), (0, jsx_runtime_1.jsxs)(react_2.SimpleGrid, { columns: 2, spacing: 2, pt: 2, w: "full", children: [(0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: openPrice.id === section.id && openPrice.target === "min", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsx)(react_2.Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.gray[50], borderColor: theme.colors.
|
|
152
|
+
} })] }), (0, jsx_runtime_1.jsxs)(react_2.SimpleGrid, { columns: 2, spacing: 2, pt: 2, w: "full", children: [(0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: openPrice.id === section.id && openPrice.target === "min", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsx)(react_2.Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.gray[50], borderColor: theme.colors.boxborder[500], cursor: "pointer", onClick: () => setOpenPrice({ id: section.id, target: "min" }), gap: 2, overflow: "hidden", children: (0, jsx_runtime_1.jsx)(react_2.Box, { ml: "auto", children: (0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "12px", color: theme.colors.text[500], whiteSpace: "nowrap", children: [currentMin, range.unit ? ` ${range.unit}` : ""] }) }) }) }), (0, jsx_runtime_1.jsx)(react_2.Portal, { children: (0, jsx_runtime_1.jsx)(react_2.PopoverContent, { width: "6rem", p: 0, zIndex: 1600, bg: theme.colors.background[50], children: (0, jsx_runtime_1.jsx)(react_2.PopoverBody, { p: 0, children: (0, jsx_runtime_1.jsx)(react_2.VStack, { align: "stretch", spacing: 0, maxH: "12rem", overflowY: "auto", children: values.map((v) => ((0, jsx_runtime_1.jsxs)(react_2.Flex, { px: 2, py: 1, align: "center", justify: "space-between", cursor: "pointer", bg: currentMin === v ? theme.colors.red[50] : theme.colors.background[50], borderLeftWidth: currentMin === v ? 3 : 0, borderLeftStyle: "solid", borderLeftColor: currentMin === v ? theme.colors.red[400] : "transparent", _hover: { bg: hoverBg }, onClick: () => {
|
|
153
153
|
const min = v;
|
|
154
154
|
const max = currentMax;
|
|
155
155
|
const nextVal = [Math.min(min, max), Math.max(min, max)];
|
|
156
156
|
setInternalSelected((prev) => { const next = { ...prev, [section.id]: nextVal }; onChange === null || onChange === void 0 ? void 0 : onChange(next); return next; });
|
|
157
157
|
setOpenPrice({});
|
|
158
|
-
}, children: [(0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "sm", color: theme.colors.gray[800], children: [v, range.unit ? ` ${range.unit}` : ""] }), currentMin === v ? ((0, jsx_runtime_1.jsx)(react_2.Box, { bg: theme.colors.red[100], borderRadius: "full", p: 1, display: "flex", alignItems: "center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { size: 9, color: (0, accentText_1.onFilled)(theme.colors.red[100], theme.colors.white, theme.colors.black) }) })) : null] }, `min-${v}`))) }) }) }) })] }), (0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: openPrice.id === section.id && openPrice.target === "max", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsx)(react_2.Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.gray[50], borderColor: theme.colors.
|
|
158
|
+
}, children: [(0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "sm", color: theme.colors.gray[800], children: [v, range.unit ? ` ${range.unit}` : ""] }), currentMin === v ? ((0, jsx_runtime_1.jsx)(react_2.Box, { bg: theme.colors.red[100], borderRadius: "full", p: 1, display: "flex", alignItems: "center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { size: 9, color: (0, accentText_1.onFilled)(theme.colors.red[100], theme.colors.white, theme.colors.black) }) })) : null] }, `min-${v}`))) }) }) }) })] }), (0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: openPrice.id === section.id && openPrice.target === "max", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsx)(react_2.Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.gray[50], borderColor: theme.colors.boxborder[500], cursor: "pointer", onClick: () => setOpenPrice({ id: section.id, target: "max" }), gap: 2, overflow: "hidden", children: (0, jsx_runtime_1.jsx)(react_2.Box, { ml: "auto", children: (0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "12px", color: theme.colors.text[500], whiteSpace: "nowrap", children: [currentMax, range.unit ? ` ${range.unit}` : ""] }) }) }) }), (0, jsx_runtime_1.jsx)(react_2.PopoverContent, { width: "6rem", p: 0, bg: theme.colors.background[50], children: (0, jsx_runtime_1.jsx)(react_2.PopoverBody, { p: 0, children: (0, jsx_runtime_1.jsx)(react_2.VStack, { align: "stretch", spacing: 0, maxH: "12rem", overflowY: "auto", children: values.map((v) => ((0, jsx_runtime_1.jsxs)(react_2.Flex, { px: 2, py: 1, align: "center", justify: "space-between", cursor: "pointer", bg: currentMax === v ? theme.colors.red[50] : theme.colors.background[50], borderLeftWidth: currentMax === v ? 3 : 0, borderLeftStyle: "solid", borderLeftColor: currentMax === v ? theme.colors.red[400] : "transparent", _hover: { bg: hoverBg }, onClick: () => {
|
|
159
159
|
const max = v;
|
|
160
160
|
const min = currentMin;
|
|
161
161
|
const nextVal = [Math.min(min, max), Math.max(min, max)];
|
|
@@ -123,10 +123,8 @@ function NoteTextArea({ width = "100%", handleSubmit, handleCancel, value, title
|
|
|
123
123
|
setTitleShow(false);
|
|
124
124
|
setTitleValue(e.target.value);
|
|
125
125
|
}, placeholder: "Add a title...", variant: "unstyled", px: 3, pt: 2.5, pb: 1.5, fontWeight: 600, fontSize: "0.875rem", color: theme.colors.text[700], _placeholder: {
|
|
126
|
-
fontStyle: "italic",
|
|
127
126
|
color: (0, placeholderInk_1.placeholderInk)(theme.colors),
|
|
128
127
|
} }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] })] })), (0, jsx_runtime_1.jsx)(react_2.Box, { bg: theme.colors.background[50], minH: "76px", px: 3, pt: 2.5, position: "relative", children: (0, jsx_runtime_1.jsx)(react_2.Textarea, { ref: noteAreaRef, value: noteValue, onChange: handleNoteChange, placeholder: customPlaceholder, variant: "unstyled", resize: "none", minH: "76px", fontSize: "0.75rem", color: theme.colors.text[700], _placeholder: {
|
|
129
|
-
fontStyle: "italic",
|
|
130
128
|
color: (0, placeholderInk_1.placeholderInk)(theme.colors),
|
|
131
129
|
}, style: { overflow: "hidden" }, p: 0 }) })] }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] }), (0, jsx_runtime_1.jsxs)(react_2.Box, { px: 3, py: 2.5, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", justify: "space-between", w: "100%", gap: 3, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, minW: 0, children: [(0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: "Attach files", hasArrow: true, placement: "top", children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "label", htmlFor: "file-upload", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", w: "1.75rem", h: "1.75rem", borderRadius: "md", color: theme.colors.textMuted, transition: "background 0.15s", _hover: { bg: theme.colors.gray[100] }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Paperclip, { size: 16 }) }) }), (0, jsx_runtime_1.jsx)(react_2.Box, { h: "1rem", w: "1px", bg: theme.colors.gray[200] }), !titleShow ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", onClick: () => setTitleShow(true), px: 2, py: 1, borderRadius: "md", color: theme.colors.textMuted, fontWeight: 500, fontSize: "sm", transition: "background 0.15s", _hover: { bg: theme.colors.gray[100] }, children: "+ Add a title" })) : ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: titleValue, hasArrow: true, isDisabled: !titleValue, children: (0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.textMuted, fontSize: "sm", fontWeight: 500, isTruncated: true, maxW: "180px", children: titleValue || "Title" }) }))] }), (0, jsx_runtime_1.jsxs)(react_2.Flex, { gap: 2.5, align: "center", ml: "auto", flexShrink: 0, children: [(0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "xs", fontWeight: 500, color: isOverLimit ? theme.colors.semanticText.error : theme.colors.textMuted, whiteSpace: "nowrap", children: [noteWordCount, "/", maxNoteWordCount] }), cancelButtonHide ? null : ((0, jsx_runtime_1.jsx)(react_2.Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleCloseTextArea, children: "Cancel" })), (0, jsx_runtime_1.jsxs)(react_2.Button, { size: "sm", variant: "solid", isLoading: !!saveButtonLoading, isDisabled: !noteValue || isSaveDisabled, onClick: () => handleSubmit(noteValue, titleValue, files), children: [saveButtonLoading ? ((0, jsx_runtime_1.jsx)(react_2.Spinner, { size: "xs", thickness: "2px", mr: 2 })) : null, "Save"] })] })] }), (0, jsx_runtime_1.jsx)("input", { id: "file-upload", type: "file", style: { display: "none" }, onChange: (e) => {
|
|
132
130
|
const newFiles = Array.from(e.target.files || []);
|
|
@@ -5,6 +5,8 @@ const react_1 = require("@chakra-ui/react");
|
|
|
5
5
|
const react_2 = require("react");
|
|
6
6
|
const FormLabel_1 = require("../Common/FormLabel");
|
|
7
7
|
const NumberInput = (0, react_2.forwardRef)(function NumberInput({ defaultValue, min, max, precision, step, clampValueOnBlur, keepWithinRange, value, onChange, onBlur, name, size, maxW, allowMouseWheel, NumberIncrementStepperBg, NumberIncrementStepperActive, NumberIncrementStepperChildren, NumberDecrementStepperBg, NumberDecrementStepperChildren, NumberDecrementStepperActive, label, isInformation, informationMessage, isRequired, id, width = "100%", minW, ...props }, ref) {
|
|
8
|
-
|
|
8
|
+
const generatedId = (0, react_2.useId)();
|
|
9
|
+
const resolvedId = id !== null && id !== void 0 ? id : generatedId;
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.FormControl, { w: width, minW: minW, maxW: maxW, id: resolvedId, isRequired: isRequired, children: [label && ((0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, id: resolvedId, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired })), (0, jsx_runtime_1.jsxs)(react_1.NumberInput, { defaultValue: defaultValue, min: min, max: max, step: step, precision: precision, clampValueOnBlur: clampValueOnBlur, keepWithinRange: keepWithinRange, value: value, onChange: onChange, onBlur: onBlur, name: name, size: size, maxW: maxW, allowMouseWheel: allowMouseWheel, ...props, children: [(0, jsx_runtime_1.jsx)(react_1.NumberInputField, { ref: ref }), (0, jsx_runtime_1.jsxs)(react_1.NumberInputStepper, { children: [(0, jsx_runtime_1.jsx)(react_1.NumberIncrementStepper, { bg: NumberIncrementStepperBg, _active: NumberIncrementStepperActive, children: NumberIncrementStepperChildren }), (0, jsx_runtime_1.jsx)(react_1.NumberDecrementStepper, { bg: NumberDecrementStepperBg, _active: NumberDecrementStepperActive, children: NumberDecrementStepperChildren })] })] })] }));
|
|
9
11
|
});
|
|
10
12
|
exports.default = NumberInput;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Box, Flex, Stack, VStack, HStack, Grid, GridItem, SimpleGrid, Wrap, WrapItem, Center, Spacer, Container, Divider, Text, Heading, Link, Image, Icon, Avatar, AvatarGroup, Badge, Spinner, Alert, AlertIcon, AlertTitle, AlertDescription, Portal, Collapse, Show, Hide, List, ListItem, ListIcon, OrderedList, UnorderedList, Tabs, TabList, Tab, TabPanels, TabPanel, Popover, PopoverTrigger, PopoverContent, PopoverBody, PopoverHeader, PopoverFooter, PopoverArrow, PopoverCloseButton, FormControl, FormLabel, FormErrorMessage, FormHelperText, IconButton, TableContainer, Thead, Tbody, Tfoot, Tr, Th, Td, Menu, MenuButton, MenuList, MenuItem, MenuGroup, MenuDivider, MenuOptionGroup, MenuItemOption, Accordion, AccordionItem, AccordionButton, AccordionPanel, AccordionIcon, SliderTrack, SliderFilledTrack, SliderThumb, SliderMark, ChakraProvider, extendTheme, useDisclosure, useMediaQuery, useToken, useBreakpointValue, } from "@chakra-ui/react";
|
|
2
|
+
export { Table as TableRoot, Slider as RangeSlider } from "@chakra-ui/react";
|
|
3
|
+
export type { BoxProps, FlexProps, StackProps, TextProps, HeadingProps, GridProps, GridItemProps, SimpleGridProps, AvatarProps, BadgeProps, IconProps, LinkProps, ImageProps, SpinnerProps, DividerProps, ContainerProps, IconButtonProps, FormControlProps, FormLabelProps, TabsProps, PopoverProps, ListProps, AlertProps, MenuProps, AccordionProps, } from "@chakra-ui/react";
|
|
4
|
+
export { Input, Textarea, Progress, Radio, RadioGroup, Skeleton, ModalOverlay, ModalContent, ModalCloseButton, CardBody, } from "@chakra-ui/react";
|
|
5
|
+
export { Card as ChakraCard, Select as ChakraSelect, Modal as ChakraModal, ModalBody as ChakraModalBody, ModalHeader as ChakraModalHeader, ModalFooter as ChakraModalFooter, } from "@chakra-ui/react";
|
|
6
|
+
export type { InputProps, TextareaProps, ProgressProps, RadioProps, SkeletonProps as ChakraSkeletonProps, SelectProps as ChakraSelectProps, ModalProps as ChakraModalProps, CardProps as ChakraCardProps, } from "@chakra-ui/react";
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormControl = exports.PopoverCloseButton = exports.PopoverArrow = exports.PopoverFooter = exports.PopoverHeader = exports.PopoverBody = exports.PopoverContent = exports.PopoverTrigger = exports.Popover = exports.TabPanel = exports.TabPanels = exports.Tab = exports.TabList = exports.Tabs = exports.UnorderedList = exports.OrderedList = exports.ListIcon = exports.ListItem = exports.List = exports.Hide = exports.Show = exports.Collapse = exports.Portal = exports.AlertDescription = exports.AlertTitle = exports.AlertIcon = exports.Alert = exports.Spinner = exports.Badge = exports.AvatarGroup = exports.Avatar = exports.Icon = exports.Image = exports.Link = exports.Heading = exports.Text = exports.Divider = exports.Container = exports.Spacer = exports.Center = exports.WrapItem = exports.Wrap = exports.SimpleGrid = exports.GridItem = exports.Grid = exports.HStack = exports.VStack = exports.Stack = exports.Flex = exports.Box = void 0;
|
|
4
|
+
exports.ChakraModalBody = exports.ChakraModal = exports.ChakraSelect = exports.ChakraCard = exports.CardBody = exports.ModalCloseButton = exports.ModalContent = exports.ModalOverlay = exports.Skeleton = exports.RadioGroup = exports.Radio = exports.Progress = exports.Textarea = exports.Input = exports.RangeSlider = exports.TableRoot = exports.useBreakpointValue = exports.useToken = exports.useMediaQuery = exports.useDisclosure = exports.extendTheme = exports.ChakraProvider = exports.SliderMark = exports.SliderThumb = exports.SliderFilledTrack = exports.SliderTrack = exports.AccordionIcon = exports.AccordionPanel = exports.AccordionButton = exports.AccordionItem = exports.Accordion = exports.MenuItemOption = exports.MenuOptionGroup = exports.MenuDivider = exports.MenuGroup = exports.MenuItem = exports.MenuList = exports.MenuButton = exports.Menu = exports.Td = exports.Th = exports.Tr = exports.Tfoot = exports.Tbody = exports.Thead = exports.TableContainer = exports.IconButton = exports.FormHelperText = exports.FormErrorMessage = exports.FormLabel = void 0;
|
|
5
|
+
exports.ChakraModalFooter = exports.ChakraModalHeader = void 0;
|
|
6
|
+
var react_1 = require("@chakra-ui/react");
|
|
7
|
+
Object.defineProperty(exports, "Box", { enumerable: true, get: function () { return react_1.Box; } });
|
|
8
|
+
Object.defineProperty(exports, "Flex", { enumerable: true, get: function () { return react_1.Flex; } });
|
|
9
|
+
Object.defineProperty(exports, "Stack", { enumerable: true, get: function () { return react_1.Stack; } });
|
|
10
|
+
Object.defineProperty(exports, "VStack", { enumerable: true, get: function () { return react_1.VStack; } });
|
|
11
|
+
Object.defineProperty(exports, "HStack", { enumerable: true, get: function () { return react_1.HStack; } });
|
|
12
|
+
Object.defineProperty(exports, "Grid", { enumerable: true, get: function () { return react_1.Grid; } });
|
|
13
|
+
Object.defineProperty(exports, "GridItem", { enumerable: true, get: function () { return react_1.GridItem; } });
|
|
14
|
+
Object.defineProperty(exports, "SimpleGrid", { enumerable: true, get: function () { return react_1.SimpleGrid; } });
|
|
15
|
+
Object.defineProperty(exports, "Wrap", { enumerable: true, get: function () { return react_1.Wrap; } });
|
|
16
|
+
Object.defineProperty(exports, "WrapItem", { enumerable: true, get: function () { return react_1.WrapItem; } });
|
|
17
|
+
Object.defineProperty(exports, "Center", { enumerable: true, get: function () { return react_1.Center; } });
|
|
18
|
+
Object.defineProperty(exports, "Spacer", { enumerable: true, get: function () { return react_1.Spacer; } });
|
|
19
|
+
Object.defineProperty(exports, "Container", { enumerable: true, get: function () { return react_1.Container; } });
|
|
20
|
+
Object.defineProperty(exports, "Divider", { enumerable: true, get: function () { return react_1.Divider; } });
|
|
21
|
+
Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return react_1.Text; } });
|
|
22
|
+
Object.defineProperty(exports, "Heading", { enumerable: true, get: function () { return react_1.Heading; } });
|
|
23
|
+
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return react_1.Link; } });
|
|
24
|
+
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return react_1.Image; } });
|
|
25
|
+
Object.defineProperty(exports, "Icon", { enumerable: true, get: function () { return react_1.Icon; } });
|
|
26
|
+
Object.defineProperty(exports, "Avatar", { enumerable: true, get: function () { return react_1.Avatar; } });
|
|
27
|
+
Object.defineProperty(exports, "AvatarGroup", { enumerable: true, get: function () { return react_1.AvatarGroup; } });
|
|
28
|
+
Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return react_1.Badge; } });
|
|
29
|
+
Object.defineProperty(exports, "Spinner", { enumerable: true, get: function () { return react_1.Spinner; } });
|
|
30
|
+
Object.defineProperty(exports, "Alert", { enumerable: true, get: function () { return react_1.Alert; } });
|
|
31
|
+
Object.defineProperty(exports, "AlertIcon", { enumerable: true, get: function () { return react_1.AlertIcon; } });
|
|
32
|
+
Object.defineProperty(exports, "AlertTitle", { enumerable: true, get: function () { return react_1.AlertTitle; } });
|
|
33
|
+
Object.defineProperty(exports, "AlertDescription", { enumerable: true, get: function () { return react_1.AlertDescription; } });
|
|
34
|
+
Object.defineProperty(exports, "Portal", { enumerable: true, get: function () { return react_1.Portal; } });
|
|
35
|
+
Object.defineProperty(exports, "Collapse", { enumerable: true, get: function () { return react_1.Collapse; } });
|
|
36
|
+
Object.defineProperty(exports, "Show", { enumerable: true, get: function () { return react_1.Show; } });
|
|
37
|
+
Object.defineProperty(exports, "Hide", { enumerable: true, get: function () { return react_1.Hide; } });
|
|
38
|
+
Object.defineProperty(exports, "List", { enumerable: true, get: function () { return react_1.List; } });
|
|
39
|
+
Object.defineProperty(exports, "ListItem", { enumerable: true, get: function () { return react_1.ListItem; } });
|
|
40
|
+
Object.defineProperty(exports, "ListIcon", { enumerable: true, get: function () { return react_1.ListIcon; } });
|
|
41
|
+
Object.defineProperty(exports, "OrderedList", { enumerable: true, get: function () { return react_1.OrderedList; } });
|
|
42
|
+
Object.defineProperty(exports, "UnorderedList", { enumerable: true, get: function () { return react_1.UnorderedList; } });
|
|
43
|
+
Object.defineProperty(exports, "Tabs", { enumerable: true, get: function () { return react_1.Tabs; } });
|
|
44
|
+
Object.defineProperty(exports, "TabList", { enumerable: true, get: function () { return react_1.TabList; } });
|
|
45
|
+
Object.defineProperty(exports, "Tab", { enumerable: true, get: function () { return react_1.Tab; } });
|
|
46
|
+
Object.defineProperty(exports, "TabPanels", { enumerable: true, get: function () { return react_1.TabPanels; } });
|
|
47
|
+
Object.defineProperty(exports, "TabPanel", { enumerable: true, get: function () { return react_1.TabPanel; } });
|
|
48
|
+
Object.defineProperty(exports, "Popover", { enumerable: true, get: function () { return react_1.Popover; } });
|
|
49
|
+
Object.defineProperty(exports, "PopoverTrigger", { enumerable: true, get: function () { return react_1.PopoverTrigger; } });
|
|
50
|
+
Object.defineProperty(exports, "PopoverContent", { enumerable: true, get: function () { return react_1.PopoverContent; } });
|
|
51
|
+
Object.defineProperty(exports, "PopoverBody", { enumerable: true, get: function () { return react_1.PopoverBody; } });
|
|
52
|
+
Object.defineProperty(exports, "PopoverHeader", { enumerable: true, get: function () { return react_1.PopoverHeader; } });
|
|
53
|
+
Object.defineProperty(exports, "PopoverFooter", { enumerable: true, get: function () { return react_1.PopoverFooter; } });
|
|
54
|
+
Object.defineProperty(exports, "PopoverArrow", { enumerable: true, get: function () { return react_1.PopoverArrow; } });
|
|
55
|
+
Object.defineProperty(exports, "PopoverCloseButton", { enumerable: true, get: function () { return react_1.PopoverCloseButton; } });
|
|
56
|
+
Object.defineProperty(exports, "FormControl", { enumerable: true, get: function () { return react_1.FormControl; } });
|
|
57
|
+
Object.defineProperty(exports, "FormLabel", { enumerable: true, get: function () { return react_1.FormLabel; } });
|
|
58
|
+
Object.defineProperty(exports, "FormErrorMessage", { enumerable: true, get: function () { return react_1.FormErrorMessage; } });
|
|
59
|
+
Object.defineProperty(exports, "FormHelperText", { enumerable: true, get: function () { return react_1.FormHelperText; } });
|
|
60
|
+
Object.defineProperty(exports, "IconButton", { enumerable: true, get: function () { return react_1.IconButton; } });
|
|
61
|
+
Object.defineProperty(exports, "TableContainer", { enumerable: true, get: function () { return react_1.TableContainer; } });
|
|
62
|
+
Object.defineProperty(exports, "Thead", { enumerable: true, get: function () { return react_1.Thead; } });
|
|
63
|
+
Object.defineProperty(exports, "Tbody", { enumerable: true, get: function () { return react_1.Tbody; } });
|
|
64
|
+
Object.defineProperty(exports, "Tfoot", { enumerable: true, get: function () { return react_1.Tfoot; } });
|
|
65
|
+
Object.defineProperty(exports, "Tr", { enumerable: true, get: function () { return react_1.Tr; } });
|
|
66
|
+
Object.defineProperty(exports, "Th", { enumerable: true, get: function () { return react_1.Th; } });
|
|
67
|
+
Object.defineProperty(exports, "Td", { enumerable: true, get: function () { return react_1.Td; } });
|
|
68
|
+
Object.defineProperty(exports, "Menu", { enumerable: true, get: function () { return react_1.Menu; } });
|
|
69
|
+
Object.defineProperty(exports, "MenuButton", { enumerable: true, get: function () { return react_1.MenuButton; } });
|
|
70
|
+
Object.defineProperty(exports, "MenuList", { enumerable: true, get: function () { return react_1.MenuList; } });
|
|
71
|
+
Object.defineProperty(exports, "MenuItem", { enumerable: true, get: function () { return react_1.MenuItem; } });
|
|
72
|
+
Object.defineProperty(exports, "MenuGroup", { enumerable: true, get: function () { return react_1.MenuGroup; } });
|
|
73
|
+
Object.defineProperty(exports, "MenuDivider", { enumerable: true, get: function () { return react_1.MenuDivider; } });
|
|
74
|
+
Object.defineProperty(exports, "MenuOptionGroup", { enumerable: true, get: function () { return react_1.MenuOptionGroup; } });
|
|
75
|
+
Object.defineProperty(exports, "MenuItemOption", { enumerable: true, get: function () { return react_1.MenuItemOption; } });
|
|
76
|
+
Object.defineProperty(exports, "Accordion", { enumerable: true, get: function () { return react_1.Accordion; } });
|
|
77
|
+
Object.defineProperty(exports, "AccordionItem", { enumerable: true, get: function () { return react_1.AccordionItem; } });
|
|
78
|
+
Object.defineProperty(exports, "AccordionButton", { enumerable: true, get: function () { return react_1.AccordionButton; } });
|
|
79
|
+
Object.defineProperty(exports, "AccordionPanel", { enumerable: true, get: function () { return react_1.AccordionPanel; } });
|
|
80
|
+
Object.defineProperty(exports, "AccordionIcon", { enumerable: true, get: function () { return react_1.AccordionIcon; } });
|
|
81
|
+
Object.defineProperty(exports, "SliderTrack", { enumerable: true, get: function () { return react_1.SliderTrack; } });
|
|
82
|
+
Object.defineProperty(exports, "SliderFilledTrack", { enumerable: true, get: function () { return react_1.SliderFilledTrack; } });
|
|
83
|
+
Object.defineProperty(exports, "SliderThumb", { enumerable: true, get: function () { return react_1.SliderThumb; } });
|
|
84
|
+
Object.defineProperty(exports, "SliderMark", { enumerable: true, get: function () { return react_1.SliderMark; } });
|
|
85
|
+
Object.defineProperty(exports, "ChakraProvider", { enumerable: true, get: function () { return react_1.ChakraProvider; } });
|
|
86
|
+
Object.defineProperty(exports, "extendTheme", { enumerable: true, get: function () { return react_1.extendTheme; } });
|
|
87
|
+
Object.defineProperty(exports, "useDisclosure", { enumerable: true, get: function () { return react_1.useDisclosure; } });
|
|
88
|
+
Object.defineProperty(exports, "useMediaQuery", { enumerable: true, get: function () { return react_1.useMediaQuery; } });
|
|
89
|
+
Object.defineProperty(exports, "useToken", { enumerable: true, get: function () { return react_1.useToken; } });
|
|
90
|
+
Object.defineProperty(exports, "useBreakpointValue", { enumerable: true, get: function () { return react_1.useBreakpointValue; } });
|
|
91
|
+
// Renamed: the library's own Table and Slider own these names.
|
|
92
|
+
var react_2 = require("@chakra-ui/react");
|
|
93
|
+
Object.defineProperty(exports, "TableRoot", { enumerable: true, get: function () { return react_2.Table; } });
|
|
94
|
+
Object.defineProperty(exports, "RangeSlider", { enumerable: true, get: function () { return react_2.Slider; } });
|
|
95
|
+
var react_3 = require("@chakra-ui/react");
|
|
96
|
+
Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return react_3.Input; } });
|
|
97
|
+
Object.defineProperty(exports, "Textarea", { enumerable: true, get: function () { return react_3.Textarea; } });
|
|
98
|
+
Object.defineProperty(exports, "Progress", { enumerable: true, get: function () { return react_3.Progress; } });
|
|
99
|
+
Object.defineProperty(exports, "Radio", { enumerable: true, get: function () { return react_3.Radio; } });
|
|
100
|
+
Object.defineProperty(exports, "RadioGroup", { enumerable: true, get: function () { return react_3.RadioGroup; } });
|
|
101
|
+
Object.defineProperty(exports, "Skeleton", { enumerable: true, get: function () { return react_3.Skeleton; } });
|
|
102
|
+
Object.defineProperty(exports, "ModalOverlay", { enumerable: true, get: function () { return react_3.ModalOverlay; } });
|
|
103
|
+
Object.defineProperty(exports, "ModalContent", { enumerable: true, get: function () { return react_3.ModalContent; } });
|
|
104
|
+
Object.defineProperty(exports, "ModalCloseButton", { enumerable: true, get: function () { return react_3.ModalCloseButton; } });
|
|
105
|
+
Object.defineProperty(exports, "CardBody", { enumerable: true, get: function () { return react_3.CardBody; } });
|
|
106
|
+
// Prefixed because the library ships its own component under each of these names.
|
|
107
|
+
var react_4 = require("@chakra-ui/react");
|
|
108
|
+
Object.defineProperty(exports, "ChakraCard", { enumerable: true, get: function () { return react_4.Card; } });
|
|
109
|
+
Object.defineProperty(exports, "ChakraSelect", { enumerable: true, get: function () { return react_4.Select; } });
|
|
110
|
+
Object.defineProperty(exports, "ChakraModal", { enumerable: true, get: function () { return react_4.Modal; } });
|
|
111
|
+
Object.defineProperty(exports, "ChakraModalBody", { enumerable: true, get: function () { return react_4.ModalBody; } });
|
|
112
|
+
Object.defineProperty(exports, "ChakraModalHeader", { enumerable: true, get: function () { return react_4.ModalHeader; } });
|
|
113
|
+
Object.defineProperty(exports, "ChakraModalFooter", { enumerable: true, get: function () { return react_4.ModalFooter; } });
|
|
@@ -7,7 +7,7 @@ const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
|
7
7
|
const FormLabel_1 = require("../Common/FormLabel");
|
|
8
8
|
const RadioButton = ({ label, colorScheme, isChecked, onChange, isDisabled, size, value, defaultChecked, labelFontSize = "0.75rem", labelClampLines = 2, showLabelTooltip = (label || "").length > 18, labelTooltip = label, }) => {
|
|
9
9
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Radio, { colorScheme: colorScheme, isChecked: isChecked, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Radio, { colorScheme: colorScheme, isChecked: isChecked, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.boxborder[500], borderWidth: "1.6px", _hover: {
|
|
11
11
|
borderColor: theme.colors.primary[500],
|
|
12
12
|
backgroundColor: theme.colors.background[100],
|
|
13
13
|
}, sx: {
|
|
@@ -30,6 +30,6 @@ function Search({ placeholder = "Search...", onSearch, onclose, shortcut = "Ctrl
|
|
|
30
30
|
window.removeEventListener("keydown", handleKeyDown);
|
|
31
31
|
};
|
|
32
32
|
}, [shortcut]);
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.FormControl, { id: id, isInvalid: !!error, children: [label && ((0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, id: id, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired })), (0, jsx_runtime_1.jsxs)(react_2.InputGroup, { w: "100%", children: [(0, jsx_runtime_1.jsx)(react_2.InputLeftElement, { pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.Search, color: theme.colors.
|
|
34
|
-
, gap: "2", children: [query && ((0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.X, color: theme.colors.
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.FormControl, { id: id, isInvalid: !!error, children: [label && ((0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, id: id, isInformation: isInformation, informationMessage: informationMessage, isRequired: isRequired })), (0, jsx_runtime_1.jsxs)(react_2.InputGroup, { w: "100%", children: [(0, jsx_runtime_1.jsx)(react_2.InputLeftElement, { pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.Search, color: theme.colors.textMuted }) }), (0, jsx_runtime_1.jsx)(react_2.Input, { ref: inputRef, type: "text", value: query, onChange: onSearch, placeholder: placeholder, variant: "outline", isInvalid: error }), (0, jsx_runtime_1.jsxs)(react_2.InputRightElement, { w: "auto", pr: "3", display: "flex", alignItems: "center" // ✅ centers vertically
|
|
34
|
+
, gap: "2", children: [query && ((0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.X, color: theme.colors.textMuted, boxSize: 5, cursor: "pointer", onClick: onclose })), shortcut && ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: theme.colors.textMuted, px: "2", py: "0.5", borderRadius: "md", bg: theme.colors.backgroundColor.subtle, children: shortcut }))] })] }), error && (0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { errorMessage: errorMessage }), helperText && !error && (0, jsx_runtime_1.jsx)(HelperText_1.default, { helperText: helperText })] }));
|
|
35
35
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { chakraSelectProps } from "./SelectProps";
|
|
2
|
-
export default function Select({ placeholder, size, variant, icon, onChange, onBlur, onFocus, errorBorderColor, isDisabled, isReadOnly, isRequired, value, colorScheme, label, error, errorMessage, helperText, options, height, formControlStyle, isInformation, informationMessage, selectStyle, }: chakraSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Select({ placeholder, size, variant, icon, onChange, onBlur, onFocus, errorBorderColor, isDisabled, isReadOnly, isRequired, value, colorScheme, label, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, error, errorMessage, helperText, options, height, formControlStyle, isInformation, informationMessage, selectStyle, }: chakraSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,9 +11,11 @@ const textInputIconSize_1 = require("../Input/textInputIconSize");
|
|
|
11
11
|
const FormLabel_1 = require("../Common/FormLabel");
|
|
12
12
|
const ErrorMessage_1 = __importDefault(require("../Common/ErrorMessage"));
|
|
13
13
|
const HelperText_1 = __importDefault(require("../Common/HelperText"));
|
|
14
|
-
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, }) {
|
|
14
|
+
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, }) {
|
|
15
15
|
const sizeKey = typeof size === "string" ? size : "md";
|
|
16
16
|
const iconSizePx = (0, textInputIconSize_1.getTextInputIconSizePx)(sizeKey);
|
|
17
|
+
const generatedId = (0, react_1.useId)();
|
|
18
|
+
const selectId = id !== null && id !== void 0 ? id : (label ? generatedId : undefined);
|
|
17
19
|
const getOptionsList = (0, react_1.useCallback)(() => {
|
|
18
20
|
if (!options.length)
|
|
19
21
|
return (0, jsx_runtime_1.jsx)("option", { value: "", children: "No Options" });
|
|
@@ -26,5 +28,5 @@ function Select({ placeholder = "Select Option", size = "md", variant = "outline
|
|
|
26
28
|
onChange(selectedOption);
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.FormControl, { isInvalid: error, style: formControlStyle, size: size, children: [label && ((0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })), (0, jsx_runtime_1.jsx)(react_2.Select, { 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 && (0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { errorMessage: errorMessage }), helperText && !error && (0, jsx_runtime_1.jsx)(HelperText_1.default, { helperText: helperText })] }));
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.FormControl, { isInvalid: error, style: formControlStyle, size: size, children: [label && ((0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, id: selectId, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })), (0, jsx_runtime_1.jsx)(react_2.Select, { 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 && (0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { errorMessage: errorMessage }), helperText && !error && (0, jsx_runtime_1.jsx)(HelperText_1.default, { helperText: helperText })] }));
|
|
30
32
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { SelectProps } from "@chakra-ui/react";
|
|
2
2
|
export type chakraSelectProps = Pick<SelectProps, "placeholder" | "size" | "variant" | "icon" | "bg" | "borderColor" | "color" | "onBlur" | "onFocus" | "errorBorderColor" | "isDisabled" | "isReadOnly" | "isRequired" | "value" | "colorScheme"> & {
|
|
3
3
|
label?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
"aria-label"?: string;
|
|
6
|
+
"aria-labelledby"?: string;
|
|
4
7
|
error?: boolean;
|
|
5
8
|
errorMessage?: string;
|
|
6
9
|
helperText?: string;
|
|
@@ -248,7 +248,7 @@ function SelectV2(props) {
|
|
|
248
248
|
return selectedOptions[0] ? selectedOptions[0].label : placeholder;
|
|
249
249
|
};
|
|
250
250
|
const triggerIcon = !props.isMulti && ((_b = selectedOptions[0]) === null || _b === void 0 ? void 0 : _b.icon) ? selectedOptions[0].icon : null;
|
|
251
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.FormControl, { isInvalid: error, isDisabled: isDisabled, style: formControlStyle, width: width, children: [label && ((0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, id: triggerId, isRequired: isRequired })), (0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: isOpen, onClose: () => resetAndClose(), placement: "bottom-start", matchWidth: true, autoFocus: false, returnFocusOnClose: false, gutter: 4, children: [(0, jsx_runtime_1.jsx)(react_2.PopoverAnchor, { children: (0, jsx_runtime_1.jsxs)(react_2.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] : (0, placeholderInk_1.placeholderInk)(theme.colors), "data-testid": dataTestId, ...fieldStyles, children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { as: "span", display: "inline-flex", alignItems: "center", gap: 1.5, minW: 0, isTruncated: true, children: [triggerIcon ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-flex", flexShrink: 0, children: triggerIcon })) : null, (0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", isTruncated: true,
|
|
251
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.FormControl, { isInvalid: error, isDisabled: isDisabled, style: formControlStyle, width: width, children: [label && ((0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, id: triggerId, isRequired: isRequired })), (0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: isOpen, onClose: () => resetAndClose(), placement: "bottom-start", matchWidth: true, autoFocus: false, returnFocusOnClose: false, gutter: 4, children: [(0, jsx_runtime_1.jsx)(react_2.PopoverAnchor, { children: (0, jsx_runtime_1.jsxs)(react_2.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] : (0, placeholderInk_1.placeholderInk)(theme.colors), "data-testid": dataTestId, ...fieldStyles, children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { as: "span", display: "inline-flex", alignItems: "center", gap: 1.5, minW: 0, isTruncated: true, children: [triggerIcon ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-flex", flexShrink: 0, children: triggerIcon })) : null, (0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", isTruncated: true, children: renderValue ? renderValue(selectedOptions) : defaultTriggerContent() })] }), (0, jsx_runtime_1.jsx)(react_2.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: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 16 }) })] }) }), (0, jsx_runtime_1.jsx)(react_2.Portal, { children: (0, jsx_runtime_1.jsxs)(react_2.PopoverContent, { width: "100%", borderRadius: "xl", boxShadow: theme.shadows.lg, overflow: "hidden", onKeyDown: handleListKeyDown, children: [isSearchable && ((0, jsx_runtime_1.jsx)(react_2.Box, { p: 2, borderBottom: `0.063rem solid ${theme.colors.boxborder[200]}`, children: (0, jsx_runtime_1.jsx)(react_2.Input, { ref: filterInputRef, size: "sm", placeholder: "Type to filter...", value: filterText, onChange: (event) => {
|
|
252
252
|
setFilterText(event.target.value);
|
|
253
253
|
setActiveIndex(0);
|
|
254
254
|
}, "aria-activedescendant": activeDescendantId, "aria-label": "Filter options" }) })), (0, jsx_runtime_1.jsxs)(react_2.Box, { id: listboxId, ref: listRef, role: "listbox", "aria-multiselectable": props.isMulti || undefined, maxH: maxMenuHeight, overflowY: "auto", py: 1, sx: listScrollStyles, children: [filteredOptions.length === 0 && ((0, jsx_runtime_1.jsx)(react_2.Box, { px: 3, py: 2, fontSize: "0.8125rem", color: theme.colors.textMuted, children: "No Options" })), filteredOptions.map((option, index) => {
|
|
@@ -81,7 +81,7 @@ const FooterControls = ({ toggle, overlay, mobileNav, onToggleCollapse, onToggle
|
|
|
81
81
|
return null;
|
|
82
82
|
return shell((0, jsx_runtime_1.jsx)(ControlCell, { onClick: onToggleMobileNav, label: "Show", accent: true, children: (0, jsx_runtime_1.jsx)(lucide_react_1.PanelLeft, { size: 14, color: activeAccent.icon }) }));
|
|
83
83
|
}
|
|
84
|
-
return shell((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ControlCell, { onClick: onToggleCollapse, ariaLabel: toggle ? "Expand sidebar" : undefined, label: toggle ? undefined : "Collapse", children: toggle ? ((0, jsx_runtime_1.jsx)(lucide_react_1.ArrowRightToLine, { size: 14, color: iconColor })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.ArrowLeftToLine, { size: 14, color: iconColor })) }), onToggleMobileNav && ((0, jsx_runtime_1.jsx)(ControlCell, { onClick: onToggleMobileNav, label: toggle ? undefined : "Hide", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Maximize2, { size: 14, color: iconColor }) }))] }));
|
|
84
|
+
return shell((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ControlCell, { onClick: onToggleCollapse, ariaLabel: toggle ? "Expand sidebar" : undefined, label: toggle ? undefined : "Collapse", children: toggle ? ((0, jsx_runtime_1.jsx)(lucide_react_1.ArrowRightToLine, { size: 14, color: iconColor })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.ArrowLeftToLine, { size: 14, color: iconColor })) }), onToggleMobileNav && ((0, jsx_runtime_1.jsx)(ControlCell, { onClick: onToggleMobileNav, ariaLabel: toggle ? "Show sidebar in overlay mode" : undefined, label: toggle ? undefined : "Hide", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Maximize2, { size: 14, color: iconColor }) }))] }));
|
|
85
85
|
};
|
|
86
86
|
// --- Main Sidebar component ---
|
|
87
87
|
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, }) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TableProps } from "./TableProps";
|
|
2
|
-
export default function Table({ data, columns, onSelection, isLoading, isCheckbox, headerBgColor, freezedBgColor, freezedTextColor, tableBorderColor, noBorders, isPagination, onRowClick, selections, isActionFreeze, preferences, paginationMode, infiniteScroll, hasMore, isLoadingMore, groupLoadMore, loadMoreText, loadMorePosition, loadMoreChunkSize, noOfRowsPerPage, totalRecords, onPagination, isTableSettings, headerActions, onGlobalSearch, onNoOfRowsPerPageChange, paginationSelectOptions, tableMaxHeight, minVisibleRows, maxVisibleRows, autoFitViewport, tableSettings, filterSidebar, loadingSkeletonRows, defaultVisibleColumns, density, stripe, groupColors, onAddItem, emptyState, onRefresh, }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Table({ data, columns, onSelection, isLoading, isCheckbox, headerBgColor, freezedBgColor, freezedTextColor, tableBorderColor, noBorders, isPagination, onRowClick, selections, isActionFreeze, preferences, paginationMode, infiniteScroll, hasMore, isLoadingMore, groupLoadMore, loadMoreText, loadMorePosition, loadMoreChunkSize, noOfRowsPerPage, totalRecords, onPagination, isTableSettings, headerActions, onGlobalSearch, onNoOfRowsPerPageChange, paginationSelectOptions, tableMaxHeight, minVisibleRows, maxVisibleRows, autoFitViewport, tableSettings, filterSidebar, loadingSkeletonRows, defaultVisibleColumns, density, variant, stripe, groupColors, onAddItem, emptyState, onRefresh, }: TableProps): import("react/jsx-runtime").JSX.Element;
|