@telepix-lab/telepix-ui 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/checkbox/index.d.ts +1 -2
- package/dist/cjs/data-table/index.d.ts +8 -8
- package/dist/cjs/index.js +16 -16
- package/dist/cjs/radio-group/index.d.ts +2 -3
- package/dist/client.d.ts +11 -11
- package/dist/esm/checkbox/index.d.ts +1 -2
- package/dist/esm/client.js +59 -59
- package/dist/esm/data-table/index.d.ts +8 -8
- package/dist/esm/index.js +11 -11
- package/dist/esm/radio-group/index.d.ts +2 -3
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Checkbox as CheckboxRadix } from "radix-ui";
|
|
3
2
|
interface CheckboxProps extends CheckboxRadix.CheckboxProps {
|
|
4
3
|
label?: string;
|
|
@@ -20,5 +19,5 @@ interface CheckboxProps extends CheckboxRadix.CheckboxProps {
|
|
|
20
19
|
* />
|
|
21
20
|
* ```
|
|
22
21
|
*/
|
|
23
|
-
export declare const Checkbox:
|
|
22
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
24
23
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, Ref } from "react";
|
|
2
2
|
/** table 기반 config로 테이블 완성 component */
|
|
3
3
|
interface TableInfo<T> {
|
|
4
4
|
header: string;
|
|
5
|
-
renderFn: (item: T) =>
|
|
5
|
+
renderFn: (item: T) => ReactNode;
|
|
6
6
|
minWidth?: number;
|
|
7
7
|
maxWidth?: number;
|
|
8
8
|
showTooltip?: boolean;
|
|
@@ -24,12 +24,12 @@ export interface DataTableProps<T> {
|
|
|
24
24
|
cell?: string;
|
|
25
25
|
};
|
|
26
26
|
refs?: {
|
|
27
|
-
tableRef?:
|
|
28
|
-
headerRef?:
|
|
29
|
-
bodyRef?:
|
|
30
|
-
rowRef?:
|
|
31
|
-
cellRef?:
|
|
32
|
-
headRef?:
|
|
27
|
+
tableRef?: Ref<HTMLTableElement>;
|
|
28
|
+
headerRef?: Ref<HTMLTableRowElement>;
|
|
29
|
+
bodyRef?: Ref<HTMLTableSectionElement>;
|
|
30
|
+
rowRef?: Ref<HTMLTableRowElement>;
|
|
31
|
+
cellRef?: Ref<HTMLTableCellElement>;
|
|
32
|
+
headRef?: Ref<HTMLTableCellElement>;
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
export declare const DataTable: <T extends object>({ config, data, emptyMessage, onRowClick, enableSelection, shouldLastBorderRender, classNames, refs, }: DataTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var
|
|
4
|
+
var react = require('react');
|
|
5
5
|
|
|
6
6
|
const BUTTON_SIZES = {
|
|
7
7
|
REGULAR: "regular",
|
|
@@ -3327,7 +3327,7 @@ function cn(...inputs) {
|
|
|
3327
3327
|
* </Button>
|
|
3328
3328
|
* ```
|
|
3329
3329
|
*/
|
|
3330
|
-
const Button =
|
|
3330
|
+
const Button = react.forwardRef(({ variant = "accent", size = "regular", fullWidth = false, isLoading = false, leftIcon, rightIcon, children, disabled, className, ...rest }, ref) => {
|
|
3331
3331
|
return (jsxRuntime.jsxs("button", { ref: ref, disabled: disabled ?? isLoading, className: cn("flex items-center justify-center relative box-border m-0 border-transparent outline-none cursor-pointer select-none align-middle appearance-none text-center transition-normal font-medium w-auto rounded-md overflow-hidden pointer-events-auto disabled:pointer-events-none disabled:cursor-not-allowed", size === BUTTON_SIZES.SMALL &&
|
|
3332
3332
|
"h-7 py-0 px-1.5 text-label leading-label-compact", size === BUTTON_SIZES.REGULAR &&
|
|
3333
3333
|
"h-9 py-0 px-2 text-body leading-body-compact", size === BUTTON_SIZES.LARGE &&
|
|
@@ -3585,7 +3585,7 @@ const INPUT_SIZES = {
|
|
|
3585
3585
|
* />
|
|
3586
3586
|
* ```
|
|
3587
3587
|
*/
|
|
3588
|
-
const Input =
|
|
3588
|
+
const Input = react.forwardRef(({ size = "regular", leftIcon, rightIcon, wrapperClassName, ...rest }, ref) => {
|
|
3589
3589
|
return (jsxRuntime.jsxs("div", { "aria-disabled": rest.disabled, className: cn("flex itesm-center justify-center rounded-lg bg-fill-mono-default hover:bg-fill-mono-hovered focus-within:bg-fill-mono-default border border-border-bound focus-within:border-border-focused has-[input:disabled]:border-transparent", size === INPUT_SIZES.REGULAR &&
|
|
3590
3590
|
"py-1.5 px-2 text-body leading-body-compact font-medium gap-2", size === INPUT_SIZES.LARGE &&
|
|
3591
3591
|
"py-[11px] px-4 text-base leading-base-compact font-medium gap-3", wrapperClassName), children: [leftIcon && (jsxRuntime.jsx("span", { className: "flex items-center justify-center", children: leftIcon })), jsxRuntime.jsx("input", { ref: ref, className: cn("border-none outline-none p-0 flex-1 bg-transparent text-comp-mono-default placeholder:text-comp-mono-subtle-default hover:placeholder:text-comp-mono-subtle-hovered focus:placeholder:text-comp-mono-subtle-selected disabled:text-comp-disabled disabled:placeholder:text-comp-disabled", size === INPUT_SIZES.REGULAR &&
|
|
@@ -3610,7 +3610,7 @@ Input.displayName = "Input";
|
|
|
3610
3610
|
* />
|
|
3611
3611
|
* ```
|
|
3612
3612
|
*/
|
|
3613
|
-
const TextArea =
|
|
3613
|
+
const TextArea = react.forwardRef((rest, ref) => {
|
|
3614
3614
|
return (jsxRuntime.jsx("div", { className: "py-3 px-4 flex-1 h-full", children: jsxRuntime.jsx("textarea", { ref: ref, className: cn("w-full h-full flex-1 p-0 text-body leading-body font-medium border-none resize-none outline-none text-comp-mono-default disabled:text-comp-disabled disabled:placeholder:text-comp-disabled placeholder:text-comp-mono-subtle-default", rest.className), ...rest }) }));
|
|
3615
3615
|
});
|
|
3616
3616
|
TextArea.displayName = "TextArea";
|
|
@@ -3634,19 +3634,19 @@ TextArea.displayName = "TextArea";
|
|
|
3634
3634
|
* </CardFooter>
|
|
3635
3635
|
* </Card>
|
|
3636
3636
|
*/
|
|
3637
|
-
const Card =
|
|
3637
|
+
const Card = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3638
3638
|
return (jsxRuntime.jsx("div", { ...rest, ref: ref, className: cn("flex flex-col rounded-2xl border border-border-divider bg-page-l0", className), children: rest.children }));
|
|
3639
3639
|
});
|
|
3640
|
-
const CardBody =
|
|
3640
|
+
const CardBody = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3641
3641
|
return (jsxRuntime.jsx("div", { ...rest, ref: ref, className: cn("p-6", className), children: rest.children }));
|
|
3642
3642
|
});
|
|
3643
|
-
const CardHeader =
|
|
3643
|
+
const CardHeader = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3644
3644
|
return (jsxRuntime.jsx("div", { ...rest, ref: ref, className: cn("text-comp-mono-default font-bold text-xl leading-xl-compact mb-2", className), children: rest.children }));
|
|
3645
3645
|
});
|
|
3646
|
-
const CardContent =
|
|
3646
|
+
const CardContent = react.forwardRef((rest, ref) => {
|
|
3647
3647
|
return (jsxRuntime.jsx("div", { ...rest, ref: ref, children: rest.children }));
|
|
3648
3648
|
});
|
|
3649
|
-
const CardFooter =
|
|
3649
|
+
const CardFooter = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3650
3650
|
return (jsxRuntime.jsx("div", { ...rest, ref: ref, className: cn("py-4 px-6", className), children: rest.children }));
|
|
3651
3651
|
});
|
|
3652
3652
|
|
|
@@ -3704,7 +3704,7 @@ var defaultAttributes = {
|
|
|
3704
3704
|
*/
|
|
3705
3705
|
|
|
3706
3706
|
|
|
3707
|
-
const Icon =
|
|
3707
|
+
const Icon = react.forwardRef(
|
|
3708
3708
|
({
|
|
3709
3709
|
color = "currentColor",
|
|
3710
3710
|
size = 24,
|
|
@@ -3714,7 +3714,7 @@ const Icon = React.forwardRef(
|
|
|
3714
3714
|
children,
|
|
3715
3715
|
iconNode,
|
|
3716
3716
|
...rest
|
|
3717
|
-
}, ref) =>
|
|
3717
|
+
}, ref) => react.createElement(
|
|
3718
3718
|
"svg",
|
|
3719
3719
|
{
|
|
3720
3720
|
ref,
|
|
@@ -3728,7 +3728,7 @@ const Icon = React.forwardRef(
|
|
|
3728
3728
|
...rest
|
|
3729
3729
|
},
|
|
3730
3730
|
[
|
|
3731
|
-
...iconNode.map(([tag, attrs]) =>
|
|
3731
|
+
...iconNode.map(([tag, attrs]) => react.createElement(tag, attrs)),
|
|
3732
3732
|
...Array.isArray(children) ? children : [children]
|
|
3733
3733
|
]
|
|
3734
3734
|
)
|
|
@@ -3743,8 +3743,8 @@ const Icon = React.forwardRef(
|
|
|
3743
3743
|
|
|
3744
3744
|
|
|
3745
3745
|
const createLucideIcon = (iconName, iconNode) => {
|
|
3746
|
-
const Component =
|
|
3747
|
-
({ className, ...props }, ref) =>
|
|
3746
|
+
const Component = react.forwardRef(
|
|
3747
|
+
({ className, ...props }, ref) => react.createElement(Icon, {
|
|
3748
3748
|
ref,
|
|
3749
3749
|
iconNode,
|
|
3750
3750
|
className: mergeClasses(
|
|
@@ -3810,8 +3810,8 @@ const __iconNode = [
|
|
|
3810
3810
|
];
|
|
3811
3811
|
const X = createLucideIcon("x", __iconNode);
|
|
3812
3812
|
|
|
3813
|
-
const Tag =
|
|
3814
|
-
const [isSelected, setIsSelected] =
|
|
3813
|
+
const Tag = react.forwardRef(({ icon, value, variant = "filled", size = "regular", className, onDeleteClick, onClick, ...props }, ref) => {
|
|
3814
|
+
const [isSelected, setIsSelected] = react.useState(false);
|
|
3815
3815
|
const handleClick = (event) => {
|
|
3816
3816
|
setIsSelected((prev) => !prev);
|
|
3817
3817
|
onClick?.(event);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { RadioGroup as RadioGroupRadix } from "radix-ui";
|
|
3
2
|
import { RadioGroupOrientation } from "./types";
|
|
4
3
|
interface RadioGroupProps extends RadioGroupRadix.RadioGroupProps {
|
|
@@ -22,12 +21,12 @@ interface RadioGroupProps extends RadioGroupRadix.RadioGroupProps {
|
|
|
22
21
|
* </RadioGroup>
|
|
23
22
|
* ```
|
|
24
23
|
*/
|
|
25
|
-
export declare const RadioGroup:
|
|
24
|
+
export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
25
|
interface RadioItemProps extends RadioGroupRadix.RadioGroupItemProps {
|
|
27
26
|
label?: string;
|
|
28
27
|
labelClassName?: string;
|
|
29
28
|
wrapperClassName?: string;
|
|
30
29
|
className?: string;
|
|
31
30
|
}
|
|
32
|
-
export declare const RadioItem:
|
|
31
|
+
export declare const RadioItem: import("react").ForwardRefExoticComponent<RadioItemProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
33
32
|
export {};
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default from 'react';
|
|
2
|
+
import React__default, { ReactNode, Ref } from 'react';
|
|
3
3
|
import { RadioGroup as RadioGroup$1, Checkbox as Checkbox$1, Dialog as Dialog$1, Select as Select$1, Tooltip as Tooltip$1, Popover, ContextMenu as ContextMenu$1 } from 'radix-ui';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { DayPicker, DateRange } from 'react-day-picker';
|
|
@@ -31,14 +31,14 @@ interface RadioGroupProps extends RadioGroup$1.RadioGroupProps {
|
|
|
31
31
|
* </RadioGroup>
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
declare const RadioGroup:
|
|
34
|
+
declare const RadioGroup: React$1.ForwardRefExoticComponent<RadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
35
35
|
interface RadioItemProps extends RadioGroup$1.RadioGroupItemProps {
|
|
36
36
|
label?: string;
|
|
37
37
|
labelClassName?: string;
|
|
38
38
|
wrapperClassName?: string;
|
|
39
39
|
className?: string;
|
|
40
40
|
}
|
|
41
|
-
declare const RadioItem:
|
|
41
|
+
declare const RadioItem: React$1.ForwardRefExoticComponent<RadioItemProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
42
42
|
|
|
43
43
|
interface CheckboxProps extends Checkbox$1.CheckboxProps {
|
|
44
44
|
label?: string;
|
|
@@ -60,7 +60,7 @@ interface CheckboxProps extends Checkbox$1.CheckboxProps {
|
|
|
60
60
|
* />
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
|
-
declare const Checkbox:
|
|
63
|
+
declare const Checkbox: React$1.ForwardRefExoticComponent<CheckboxProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
64
64
|
|
|
65
65
|
type CardProps = React__default.DetailedHTMLProps<React__default.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
66
66
|
declare const CardBody: React__default.ForwardRefExoticComponent<Omit<CardProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
@@ -305,7 +305,7 @@ declare const TableCell: React__default.ForwardRefExoticComponent<Omit<TableCell
|
|
|
305
305
|
/** table 기반 config로 테이블 완성 component */
|
|
306
306
|
interface TableInfo<T> {
|
|
307
307
|
header: string;
|
|
308
|
-
renderFn: (item: T) =>
|
|
308
|
+
renderFn: (item: T) => ReactNode;
|
|
309
309
|
minWidth?: number;
|
|
310
310
|
maxWidth?: number;
|
|
311
311
|
showTooltip?: boolean;
|
|
@@ -327,12 +327,12 @@ interface DataTableProps<T> {
|
|
|
327
327
|
cell?: string;
|
|
328
328
|
};
|
|
329
329
|
refs?: {
|
|
330
|
-
tableRef?:
|
|
331
|
-
headerRef?:
|
|
332
|
-
bodyRef?:
|
|
333
|
-
rowRef?:
|
|
334
|
-
cellRef?:
|
|
335
|
-
headRef?:
|
|
330
|
+
tableRef?: Ref<HTMLTableElement>;
|
|
331
|
+
headerRef?: Ref<HTMLTableRowElement>;
|
|
332
|
+
bodyRef?: Ref<HTMLTableSectionElement>;
|
|
333
|
+
rowRef?: Ref<HTMLTableRowElement>;
|
|
334
|
+
cellRef?: Ref<HTMLTableCellElement>;
|
|
335
|
+
headRef?: Ref<HTMLTableCellElement>;
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
338
|
declare const DataTable: <T extends object>({ config, data, emptyMessage, onRowClick, enableSelection, shouldLastBorderRender, classNames, refs, }: DataTableProps<T>) => react_jsx_runtime.JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Checkbox as CheckboxRadix } from "radix-ui";
|
|
3
2
|
interface CheckboxProps extends CheckboxRadix.CheckboxProps {
|
|
4
3
|
label?: string;
|
|
@@ -20,5 +19,5 @@ interface CheckboxProps extends CheckboxRadix.CheckboxProps {
|
|
|
20
19
|
* />
|
|
21
20
|
* ```
|
|
22
21
|
*/
|
|
23
|
-
export declare const Checkbox:
|
|
22
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
24
23
|
export {};
|
package/dist/esm/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { useState, useLayoutEffect, forwardRef, createElement, createContext, useContext, useEffect, useRef, useCallback } from 'react';
|
|
3
|
+
import React__default, { useState, useLayoutEffect, forwardRef, createElement, createContext, useId as useId$1, useContext, useEffect, useMemo, useRef, useCallback } from 'react';
|
|
4
4
|
import * as ReactDOM from 'react-dom';
|
|
5
5
|
import ReactDOM__default from 'react-dom';
|
|
6
6
|
import { DayPicker } from 'react-day-picker';
|
|
@@ -11871,13 +11871,13 @@ const RadioGroupContext = createContext({ value: "", disabled: false });
|
|
|
11871
11871
|
* </RadioGroup>
|
|
11872
11872
|
* ```
|
|
11873
11873
|
*/
|
|
11874
|
-
const RadioGroup =
|
|
11874
|
+
const RadioGroup = forwardRef(({ className, orientation = "vertical", ...rest }, ref) => {
|
|
11875
11875
|
const { disabled, children, value, ...restProps } = rest;
|
|
11876
11876
|
return (jsx(RadioGroupContext, { value: { value: value ?? "", disabled: disabled ?? false }, children: jsx(Root2$1, { ...restProps, ref: ref, className: cn("flex flex-col gap-3", orientation === RADIO_GROUP_ORIENTAIONS.HORIZONTAL && "flex-row", className), children: children }) }));
|
|
11877
11877
|
});
|
|
11878
|
-
const RadioItem =
|
|
11878
|
+
const RadioItem = forwardRef(({ label, labelClassName, wrapperClassName, ...rest }, ref) => {
|
|
11879
11879
|
const { id, value, disabled, className, ...restProps } = rest;
|
|
11880
|
-
const randomId = id ??
|
|
11880
|
+
const randomId = id ?? useId$1();
|
|
11881
11881
|
const isSelected = useContext(RadioGroupContext).value === value;
|
|
11882
11882
|
const isDisabled = useContext(RadioGroupContext).disabled || disabled || false;
|
|
11883
11883
|
return (jsxs("div", { className: cn("flex items-center gap-1.5 cursor-pointer bg-transparent border-none", wrapperClassName), children: [jsx(Item2, { ...restProps, id: randomId, ref: ref, value: value, disabled: isDisabled, className: cn("bg-transparent border-none p-0 flex items-center outline-none justify-center cursor-pointer", className), children: isDisabled ? (jsx(CircleBackslashIcon, { className: "stroke-comp-disabled" })) : isSelected ? (jsx(RadiobuttonIcon, { className: "stroke-comp-mono-selected" })) : (jsx(CircleIcon, { className: "stroke-comp-mono-default" })) }), label && (jsx("label", { className: cn("text-body leading-body-compact text-comp-mono-default font-medium cursor-pointer", isDisabled && "text-comp-disabled cursor-default", isSelected && "text-comp-mono-selected", labelClassName), htmlFor: randomId, children: label }))] }));
|
|
@@ -12102,13 +12102,13 @@ const X = createLucideIcon("x", __iconNode);
|
|
|
12102
12102
|
* />
|
|
12103
12103
|
* ```
|
|
12104
12104
|
*/
|
|
12105
|
-
const Checkbox =
|
|
12105
|
+
const Checkbox = forwardRef(({ label, labelClassName, wrapperClassName, ...rest }, ref) => {
|
|
12106
12106
|
const { checked: isChecked, defaultChecked, id, disabled, className, onCheckedChange: onChange, } = rest;
|
|
12107
|
-
const [checked, setChecked] =
|
|
12107
|
+
const [checked, setChecked] = useState(isChecked ?? defaultChecked);
|
|
12108
12108
|
useEffect(() => {
|
|
12109
12109
|
setChecked(isChecked ?? defaultChecked);
|
|
12110
12110
|
}, [isChecked, defaultChecked]);
|
|
12111
|
-
const randomId =
|
|
12111
|
+
const randomId = useId$1();
|
|
12112
12112
|
const checkboxIconClass = cn("size-4 fill-transparent stroke-comp-mono-default", checked && "stroke-comp-mono-selected", disabled && "stroke-comp-disabled cursor-default");
|
|
12113
12113
|
const renderCheckboxIcon = (checked, disabled) => {
|
|
12114
12114
|
if (disabled) {
|
|
@@ -12146,19 +12146,19 @@ Checkbox.displayName = "Checkbox";
|
|
|
12146
12146
|
* </CardFooter>
|
|
12147
12147
|
* </Card>
|
|
12148
12148
|
*/
|
|
12149
|
-
const Card =
|
|
12149
|
+
const Card = forwardRef(({ className, ...rest }, ref) => {
|
|
12150
12150
|
return (jsx("div", { ...rest, ref: ref, className: cn("flex flex-col rounded-2xl border border-border-divider bg-page-l0", className), children: rest.children }));
|
|
12151
12151
|
});
|
|
12152
|
-
const CardBody =
|
|
12152
|
+
const CardBody = forwardRef(({ className, ...rest }, ref) => {
|
|
12153
12153
|
return (jsx("div", { ...rest, ref: ref, className: cn("p-6", className), children: rest.children }));
|
|
12154
12154
|
});
|
|
12155
|
-
const CardHeader =
|
|
12155
|
+
const CardHeader = forwardRef(({ className, ...rest }, ref) => {
|
|
12156
12156
|
return (jsx("div", { ...rest, ref: ref, className: cn("text-comp-mono-default font-bold text-xl leading-xl-compact mb-2", className), children: rest.children }));
|
|
12157
12157
|
});
|
|
12158
|
-
|
|
12158
|
+
forwardRef((rest, ref) => {
|
|
12159
12159
|
return (jsx("div", { ...rest, ref: ref, children: rest.children }));
|
|
12160
12160
|
});
|
|
12161
|
-
const CardFooter =
|
|
12161
|
+
const CardFooter = forwardRef(({ className, ...rest }, ref) => {
|
|
12162
12162
|
return (jsx("div", { ...rest, ref: ref, className: cn("py-4 px-6", className), children: rest.children }));
|
|
12163
12163
|
});
|
|
12164
12164
|
|
|
@@ -12285,8 +12285,8 @@ const VerticalMenusContext = createContext({
|
|
|
12285
12285
|
disabled: false,
|
|
12286
12286
|
setSelectedMenu: () => { },
|
|
12287
12287
|
});
|
|
12288
|
-
const VerticalMenus =
|
|
12289
|
-
const [selectedMenu, setSelectedMenu] =
|
|
12288
|
+
const VerticalMenus = forwardRef(({ disabled, value, onValueChange, className, ...rest }, ref) => {
|
|
12289
|
+
const [selectedMenu, setSelectedMenu] = useState(value || "");
|
|
12290
12290
|
useEffect(() => {
|
|
12291
12291
|
if (!onValueChange)
|
|
12292
12292
|
return;
|
|
@@ -12298,7 +12298,7 @@ const VerticalMenus = React__default.forwardRef(({ disabled, value, onValueChang
|
|
|
12298
12298
|
setSelectedMenu,
|
|
12299
12299
|
}, children: jsx("div", { ref: ref, className: cn("flex flex-col w-full gap-2 p-2", className), ...rest, children: rest.children }) }));
|
|
12300
12300
|
});
|
|
12301
|
-
const VerticalMenu =
|
|
12301
|
+
const VerticalMenu = forwardRef(({ disabled, value, label, icon, variant = "accent", size = "regular", ...rest }, ref) => {
|
|
12302
12302
|
const context = useContext(VerticalMenusContext);
|
|
12303
12303
|
const isSelected = context.value === value;
|
|
12304
12304
|
const isDisabled = context.disabled || disabled || false;
|
|
@@ -12359,14 +12359,14 @@ const HorizontalTab = React__default.forwardRef(({ value, label, className, icon
|
|
|
12359
12359
|
`, isSelected && "text-comp-mono-subtle-selected font-bold", className), onClick: handleClick, disabled: isDisabled, "data-selected": isSelected, ...rest, children: [jsxs("div", { className: cn("flex items-center justify-center gap-2", size === HORIZONTAL_TAB_SIZES.SMALL && "py-1 px-2", size === HORIZONTAL_TAB_SIZES.REGULAR && "py-2.5 px-2"), children: [icon && (jsx("span", { className: cn("flex items-center justify-center size-5", size === HORIZONTAL_TAB_SIZES.SMALL && "size-4"), children: icon })), label] }), jsx("div", { className: cn("bg-comp-mono-subtle-default mt-[3px] h-[1px] w-full", isSelected && "bg-comp-mono-subtle-selected h-0.5 mt-0.5"), "data-selected": isSelected })] }));
|
|
12360
12360
|
});
|
|
12361
12361
|
|
|
12362
|
-
const ModeTabContext =
|
|
12362
|
+
const ModeTabContext = createContext({
|
|
12363
12363
|
value: "",
|
|
12364
12364
|
disabled: false,
|
|
12365
12365
|
setSelectedTab: () => { },
|
|
12366
12366
|
});
|
|
12367
|
-
const ModeTabs =
|
|
12368
|
-
const [selectedTab, setSelectedTab] =
|
|
12369
|
-
|
|
12367
|
+
const ModeTabs = forwardRef(({ disabled, value, onValueChange, className, ...rest }, ref) => {
|
|
12368
|
+
const [selectedTab, setSelectedTab] = useState(value || "");
|
|
12369
|
+
useEffect(() => {
|
|
12370
12370
|
if (!onValueChange)
|
|
12371
12371
|
return;
|
|
12372
12372
|
onValueChange(selectedTab);
|
|
@@ -12377,8 +12377,8 @@ const ModeTabs = React__default.forwardRef(({ disabled, value, onValueChange, cl
|
|
|
12377
12377
|
setSelectedTab,
|
|
12378
12378
|
}, children: jsx("div", { ref: ref, className: cn("flex items-center w-full bg-page-l2 rounded-lg p-1 box-content", className), ...rest, children: rest.children }) }));
|
|
12379
12379
|
});
|
|
12380
|
-
const ModeTab =
|
|
12381
|
-
const { value: selectedTab, disabled, setSelectedTab, } =
|
|
12380
|
+
const ModeTab = forwardRef(({ label, icon, value, className, ...rest }, ref) => {
|
|
12381
|
+
const { value: selectedTab, disabled, setSelectedTab, } = useContext(ModeTabContext);
|
|
12382
12382
|
const isSelected = selectedTab === value;
|
|
12383
12383
|
const isDisabled = disabled || rest.disabled;
|
|
12384
12384
|
const handleClick = () => {
|
|
@@ -12420,21 +12420,21 @@ const TooltipContent = ({ type, ...rest }) => {
|
|
|
12420
12420
|
"py-1.5 px-2 text-label leading-label-compact font-medium", className), ...otherProps, children: rest.children }) }));
|
|
12421
12421
|
};
|
|
12422
12422
|
const TooltipArrow = Arrow2;
|
|
12423
|
-
const TooltipHeader =
|
|
12423
|
+
const TooltipHeader = forwardRef((props, ref) => {
|
|
12424
12424
|
const { className, ...otherProps } = props;
|
|
12425
12425
|
return (jsx("div", { className: cn("text-base leading-base-compact font-medium text-comp-mono-default", className), ...otherProps, ref: ref, children: props.children }));
|
|
12426
12426
|
});
|
|
12427
|
-
const TooltipDescription =
|
|
12427
|
+
const TooltipDescription = forwardRef((props, ref) => {
|
|
12428
12428
|
const { className, ...otherProps } = props;
|
|
12429
12429
|
return (jsx("div", { className: cn("text-body leading-body font-normal text-comp-mono-subtle-default", className), ...otherProps, ref: ref, children: props.children }));
|
|
12430
12430
|
});
|
|
12431
|
-
const TooltipFooter =
|
|
12431
|
+
const TooltipFooter = forwardRef((props, ref) => {
|
|
12432
12432
|
const { className, ...otherProps } = props;
|
|
12433
12433
|
return (jsx("div", { className: cn("flex items-center justify-between pt-4", className), ...otherProps, ref: ref, children: props.children }));
|
|
12434
12434
|
});
|
|
12435
12435
|
|
|
12436
|
-
const Tag =
|
|
12437
|
-
const [isSelected, setIsSelected] =
|
|
12436
|
+
const Tag = forwardRef(({ icon, value, variant = "filled", size = "regular", className, onDeleteClick, onClick, ...props }, ref) => {
|
|
12437
|
+
const [isSelected, setIsSelected] = useState(false);
|
|
12438
12438
|
const handleClick = (event) => {
|
|
12439
12439
|
setIsSelected((prev) => !prev);
|
|
12440
12440
|
onClick?.(event);
|
|
@@ -12484,7 +12484,7 @@ const INPUT_SIZES = {
|
|
|
12484
12484
|
* />
|
|
12485
12485
|
* ```
|
|
12486
12486
|
*/
|
|
12487
|
-
const Input =
|
|
12487
|
+
const Input = forwardRef(({ size = "regular", leftIcon, rightIcon, wrapperClassName, ...rest }, ref) => {
|
|
12488
12488
|
return (jsxs("div", { "aria-disabled": rest.disabled, className: cn("flex itesm-center justify-center rounded-lg bg-fill-mono-default hover:bg-fill-mono-hovered focus-within:bg-fill-mono-default border border-border-bound focus-within:border-border-focused has-[input:disabled]:border-transparent", size === INPUT_SIZES.REGULAR &&
|
|
12489
12489
|
"py-1.5 px-2 text-body leading-body-compact font-medium gap-2", size === INPUT_SIZES.LARGE &&
|
|
12490
12490
|
"py-[11px] px-4 text-base leading-base-compact font-medium gap-3", wrapperClassName), children: [leftIcon && (jsx("span", { className: "flex items-center justify-center", children: leftIcon })), jsx("input", { ref: ref, className: cn("border-none outline-none p-0 flex-1 bg-transparent text-comp-mono-default placeholder:text-comp-mono-subtle-default hover:placeholder:text-comp-mono-subtle-hovered focus:placeholder:text-comp-mono-subtle-selected disabled:text-comp-disabled disabled:placeholder:text-comp-disabled", size === INPUT_SIZES.REGULAR &&
|
|
@@ -12498,16 +12498,16 @@ const MULTIPLE_SELECT_SIZES = {
|
|
|
12498
12498
|
LARGE: "large",
|
|
12499
12499
|
};
|
|
12500
12500
|
|
|
12501
|
-
const MultipleSelectContext =
|
|
12501
|
+
const MultipleSelectContext = createContext({
|
|
12502
12502
|
isOpen: false,
|
|
12503
12503
|
values: [],
|
|
12504
12504
|
disabled: false,
|
|
12505
12505
|
setSelectedValues: () => { },
|
|
12506
12506
|
setIsOpen: () => { },
|
|
12507
12507
|
});
|
|
12508
|
-
const MultipleSelect =
|
|
12509
|
-
const [isOpen, setIsOpen] =
|
|
12510
|
-
const [selectedValues, setSelectedValues] =
|
|
12508
|
+
const MultipleSelect = forwardRef(({ open, onOpenChange, disabled, value, onValueChange, className, children, ...rest }, ref) => {
|
|
12509
|
+
const [isOpen, setIsOpen] = useState(open || false);
|
|
12510
|
+
const [selectedValues, setSelectedValues] = useState([]);
|
|
12511
12511
|
useEffect(() => {
|
|
12512
12512
|
setIsOpen(open || false);
|
|
12513
12513
|
}, [open]);
|
|
@@ -12527,9 +12527,9 @@ const MultipleSelect = React__default.forwardRef(({ open, onOpenChange, disabled
|
|
|
12527
12527
|
setIsOpen: onTriggerOpenChange,
|
|
12528
12528
|
}, children: jsx("div", { ref: ref, className: cn("relative", className), ...rest, children: children }) }));
|
|
12529
12529
|
});
|
|
12530
|
-
const MultipleSelectTrigger =
|
|
12530
|
+
const MultipleSelectTrigger = forwardRef(({ size = "regular", children, ...rest }, ref) => {
|
|
12531
12531
|
const { className, onClick, ...otherProps } = rest;
|
|
12532
|
-
const { disabled, values, isOpen, setIsOpen } =
|
|
12532
|
+
const { disabled, values, isOpen, setIsOpen } = useContext(MultipleSelectContext);
|
|
12533
12533
|
const handleTriggerClick = (e) => {
|
|
12534
12534
|
e.stopPropagation();
|
|
12535
12535
|
if (disabled)
|
|
@@ -12540,9 +12540,9 @@ const MultipleSelectTrigger = React__default.forwardRef(({ size = "regular", chi
|
|
|
12540
12540
|
};
|
|
12541
12541
|
return (jsxs("div", { ref: ref, className: cn("flex items-center justify-between rounded-lg cursor-pointer border border-border-bound bg-fill-mono-default hover:bg-fill-mono-hovered", values.length > 0 && "border-border-focused", disabled && "border-none cursor-not-allowed", size === MULTIPLE_SELECT_SIZES.REGULAR && "py-1.5 px-3 gap-1", size === MULTIPLE_SELECT_SIZES.LARGE && "py-3 pr-4 pl-3 gap-2", className), "data-disabled": disabled, "data-selected": values.length > 0, onClick: handleTriggerClick, ...otherProps, children: [children, jsx("span", { className: "flex items-center justify-center size-4", children: jsx(ChevronDown, { size: 16 }) })] }));
|
|
12542
12542
|
});
|
|
12543
|
-
const MultipleSelectValue =
|
|
12544
|
-
const { values, disabled, setSelectedValues } =
|
|
12545
|
-
const [content, setContent] =
|
|
12543
|
+
const MultipleSelectValue = forwardRef(({ placeholder, className, ...rest }, ref) => {
|
|
12544
|
+
const { values, disabled, setSelectedValues } = useContext(MultipleSelectContext);
|
|
12545
|
+
const [content, setContent] = useState(null);
|
|
12546
12546
|
const composedRefs = useComposedRefs(ref, (node) => setContent(node));
|
|
12547
12547
|
const onDeleteClick = (value, e) => {
|
|
12548
12548
|
e.stopPropagation();
|
|
@@ -12553,9 +12553,9 @@ const MultipleSelectValue = React__default.forwardRef(({ placeholder, className,
|
|
|
12553
12553
|
"--select-content-width": `${content?.offsetWidth}px`,
|
|
12554
12554
|
}, className: cn("flex-1 flex gap-1 flex-wrap", className), ...rest, children: values?.length > 0 ? (values.map((val) => (jsx(Tag, { value: { id: val.value, label: val.label }, disabled: disabled, className: "max-w-[var(--select-content-width)]", onDeleteClick: onDeleteClick }, val.value)))) : (jsx("span", { "data-disabled": disabled, className: "text-comp-mono-subtle-default text-body leading-body-compact font-medium", children: placeholder || "Select options" })) }));
|
|
12555
12555
|
});
|
|
12556
|
-
const MultipleSelectContent =
|
|
12557
|
-
const { isOpen, setIsOpen } =
|
|
12558
|
-
const [content, setContent] =
|
|
12556
|
+
const MultipleSelectContent = forwardRef(({ useSearch, options: optionsProps, indicator, className, ...rest }, ref) => {
|
|
12557
|
+
const { isOpen, setIsOpen } = useContext(MultipleSelectContext);
|
|
12558
|
+
const [content, setContent] = useState(null);
|
|
12559
12559
|
const composedRefs = useComposedRefs(ref, (node) => setContent(node));
|
|
12560
12560
|
const [options, setOptions] = useState(optionsProps);
|
|
12561
12561
|
useEffect(() => {
|
|
@@ -12572,7 +12572,7 @@ const MultipleSelectContent = React__default.forwardRef(({ useSearch, options: o
|
|
|
12572
12572
|
const filteredOptions = options.filter((option) => option.label.toLowerCase().includes(searchValue));
|
|
12573
12573
|
setOptions(filteredOptions);
|
|
12574
12574
|
};
|
|
12575
|
-
|
|
12575
|
+
useEffect(() => {
|
|
12576
12576
|
const handleMouseUp = (event) => {
|
|
12577
12577
|
if (!content?.contains(event.target)) {
|
|
12578
12578
|
setIsOpen(false);
|
|
@@ -12583,7 +12583,7 @@ const MultipleSelectContent = React__default.forwardRef(({ useSearch, options: o
|
|
|
12583
12583
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
12584
12584
|
};
|
|
12585
12585
|
}, [setIsOpen, content]);
|
|
12586
|
-
|
|
12586
|
+
useEffect(() => {
|
|
12587
12587
|
const close = () => setIsOpen(false);
|
|
12588
12588
|
window.addEventListener("blur", close);
|
|
12589
12589
|
window.addEventListener("resize", close);
|
|
@@ -12594,8 +12594,8 @@ const MultipleSelectContent = React__default.forwardRef(({ useSearch, options: o
|
|
|
12594
12594
|
}, [setIsOpen]);
|
|
12595
12595
|
return (isOpen && (jsxs("div", { ref: composedRefs, className: cn("flex-1 absolute top-[calc(100%+4px)] left-0 z-[1000] w-[calc(100%-16px)] bg-page-l1 rounded-xl shadow-medium p-2 border border-border-overlay", className), ...rest, children: [useSearch && (jsx("div", { className: "pb-2 mb-2 border-b border-b-border-divider", children: jsx(Input, { onChange: handleSearchChange, leftIcon: jsx(MagnifyingGlassIcon, { width: 20, height: 20 }), placeholder: "Enter any characters..." }) })), jsx("ul", { className: "p-0 m-0 flex flex-col gap-1 list-none", children: options.map((option) => (jsx(MultipleSelectItem, { option: option, indicator: indicator }, option.value))) })] })));
|
|
12596
12596
|
});
|
|
12597
|
-
const MultipleSelectItem =
|
|
12598
|
-
const { values, setSelectedValues } =
|
|
12597
|
+
const MultipleSelectItem = forwardRef(({ option, indicator, className, ...rest }, ref) => {
|
|
12598
|
+
const { values, setSelectedValues } = useContext(MultipleSelectContext);
|
|
12599
12599
|
const isSelected = values.some((val) => val.value === option.value);
|
|
12600
12600
|
const handleClick = (e) => {
|
|
12601
12601
|
e.stopPropagation();
|
|
@@ -12610,28 +12610,28 @@ const MultipleSelectItem = React__default.forwardRef(({ option, indicator, class
|
|
|
12610
12610
|
"bg-fill-disabled text-comp-disabled cursor-not-allowed", className), onClick: handleClick, ...rest, children: [jsx("span", { className: "flex-1 overflow-ellipsis overflow-x-hidden whitespace-nowrap text-inherit text-size-inherit leading-inherit font-inherit", children: option.label }), indicator && isSelected && (jsx("span", { className: "flex items-center justify-center size-4", children: indicator }))] }));
|
|
12611
12611
|
});
|
|
12612
12612
|
|
|
12613
|
-
const Table =
|
|
12613
|
+
const Table = forwardRef(({ className, ...rest }, ref) => {
|
|
12614
12614
|
return (jsx("table", { ref: ref, className: cn("w-full relative border-collapse", className), ...rest }));
|
|
12615
12615
|
});
|
|
12616
|
-
const TableHeader =
|
|
12616
|
+
const TableHeader = forwardRef(({ className, ...rest }, ref) => {
|
|
12617
12617
|
return (jsx("thead", { children: jsx("tr", { ref: ref, className: cn("border-b border-b-border-divider bg-page-l1", className), ...rest }) }));
|
|
12618
12618
|
});
|
|
12619
|
-
const TableBody =
|
|
12619
|
+
const TableBody = forwardRef(({ ...rest }, ref) => {
|
|
12620
12620
|
return jsx("tbody", { ref: ref, ...rest });
|
|
12621
12621
|
});
|
|
12622
|
-
const TableRow =
|
|
12622
|
+
const TableRow = forwardRef(({ isSelected, shouldLastBorderRender = true, className, ...rest }, ref) => {
|
|
12623
12623
|
return (jsx("tr", { ref: ref, "data-selected": isSelected, "data-last-border": shouldLastBorderRender, className: cn("border-b border-border-divider hover:bg-fill-mono-hovered", isSelected && "bg-fill-mono-selected", !shouldLastBorderRender && "last:border-b-0", className), ...rest }));
|
|
12624
12624
|
});
|
|
12625
|
-
const TableHead =
|
|
12625
|
+
const TableHead = forwardRef(({ className, children, ...rest }, ref) => {
|
|
12626
12626
|
return (jsx("th", { ref: ref, className: cn("text-body leading-body font-medium py-5 pr-0 pl-9 last:pr-9 align-middle text-comp-mono-subtle-default text-left", className), ...rest, children: jsx("div", { className: "overflow-hidden overflow-ellipsis whitespace-nowrap", children: children }) }));
|
|
12627
12627
|
});
|
|
12628
|
-
const TableCell =
|
|
12628
|
+
const TableCell = forwardRef(({ className, children, showTooltip, ...rest }, ref) => {
|
|
12629
12629
|
return (jsx("td", { ref: ref, className: cn("text-body leading-body font-medium py-5 pr-0 pl-9 last:pr-9 align-middle text-comp-mono-default", className), ...rest, children: showTooltip ? (jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { className: "overflow-hidden overflow-ellipsis whitespace-nowrap", children: children }) }), jsx(TooltipContent, { type: "short", side: "bottom", sideOffset: 10, children: children })] })) : (jsx("div", { className: "overflow-hidden overflow-ellipsis whitespace-nowrap", children: children })) }));
|
|
12630
12630
|
});
|
|
12631
12631
|
|
|
12632
12632
|
const DataTable = ({ config, data, emptyMessage, onRowClick, enableSelection = false, shouldLastBorderRender = true, classNames, refs, }) => {
|
|
12633
|
-
const [selectedRow, setSelectedRow] =
|
|
12634
|
-
const rowData =
|
|
12633
|
+
const [selectedRow, setSelectedRow] = useState(undefined);
|
|
12634
|
+
const rowData = useMemo(() => {
|
|
12635
12635
|
return data.map((item) => ({
|
|
12636
12636
|
...item,
|
|
12637
12637
|
randomId: crypto.randomUUID(),
|
|
@@ -12648,20 +12648,20 @@ const DataTable = ({ config, data, emptyMessage, onRowClick, enableSelection = f
|
|
|
12648
12648
|
return (jsxs(Table, { className: classNames?.table, ref: refs?.tableRef, children: [jsx(TableHeader, { className: classNames?.header, ref: refs?.headerRef, children: config.map((col) => (jsx(TableHead, { style: { minWidth: col.minWidth, maxWidth: col.maxWidth }, className: classNames?.head, ref: refs?.headRef, children: col.header }, col.header))) }), jsx(TableBody, { className: classNames?.body, ref: refs?.bodyRef, children: rowData.length > 0 ? (rowData.map((item, index) => (jsx(TableRow, { id: item.randomId, onClick: () => handleRowClick(item, item.randomId), isSelected: selectedRow === item.randomId, shouldLastBorderRender: shouldLastBorderRender, className: classNames?.row, ref: refs?.rowRef, children: config.map((col, colIndex) => (jsx(TableCell, { className: classNames?.cell, ref: refs?.cellRef, showTooltip: col.showTooltip, children: col.renderFn(item) || "-" }, colIndex))) }, index)))) : emptyMessage ? (jsx(TableRow, { ref: refs?.rowRef, className: classNames?.row, children: jsx(TableCell, { colSpan: config.length, className: classNames?.cell, ref: refs?.cellRef, children: emptyMessage }) })) : null })] }));
|
|
12649
12649
|
};
|
|
12650
12650
|
|
|
12651
|
-
const InteractiveListItemContext =
|
|
12651
|
+
const InteractiveListItemContext = createContext({
|
|
12652
12652
|
disabled: false,
|
|
12653
12653
|
});
|
|
12654
|
-
const InteractiveListItem =
|
|
12654
|
+
const InteractiveListItem = forwardRef(({ isSelected, disabled, showHoverActions = true, children, className, ...rest }, ref) => {
|
|
12655
12655
|
return (jsx(InteractiveListItemContext, { value: { disabled: !!disabled }, children: jsx("div", { ref: ref, "data-selected": isSelected, "data-disabled": disabled, "data-hover-actions": showHoverActions, className: cn("flex items-center gap-1 p-1.5 rounded-sm cursor-pointer text-comp-mono-default bg-fill-mono-default border border-transparent hover:bg-fill-mono-hovered active:bg-fill-mono-pressed", isSelected && "bg-fill-mono-selected border-border-selected", disabled &&
|
|
12656
12656
|
"cursor-not-allowed text-comp-disabled bg-fill-disabled", className), ...rest, children: children }) }));
|
|
12657
12657
|
});
|
|
12658
|
-
const InteractiveListItemIcon =
|
|
12658
|
+
const InteractiveListItemIcon = forwardRef(({ children, className, ...props }, ref) => {
|
|
12659
12659
|
return (jsx("span", { className: cn("flex items-center justify-center size-6 p-1", className), ...props, ref: ref, children: children }));
|
|
12660
12660
|
});
|
|
12661
|
-
const InteractiveListItemContent =
|
|
12661
|
+
const InteractiveListItemContent = forwardRef(({ children, className, ...rest }, ref) => {
|
|
12662
12662
|
return (jsx("div", { className: cn("grow text-inherit leading-body-compact font-medium text-body", className), ...rest, ref: ref, children: children }));
|
|
12663
12663
|
});
|
|
12664
|
-
const InteractiveListItemActions =
|
|
12664
|
+
const InteractiveListItemActions = forwardRef(({ children, className, ...props }, ref) => {
|
|
12665
12665
|
return (jsx("div", { className: cn("flex items-center justify-center gap-2", className), ...props, ref: ref, children: children }));
|
|
12666
12666
|
});
|
|
12667
12667
|
|
|
@@ -12715,7 +12715,7 @@ const BUTTON_VARIANTS = {
|
|
|
12715
12715
|
* </Button>
|
|
12716
12716
|
* ```
|
|
12717
12717
|
*/
|
|
12718
|
-
const Button =
|
|
12718
|
+
const Button = forwardRef(({ variant = "accent", size = "regular", fullWidth = false, isLoading = false, leftIcon, rightIcon, children, disabled, className, ...rest }, ref) => {
|
|
12719
12719
|
return (jsxs("button", { ref: ref, disabled: disabled ?? isLoading, className: cn("flex items-center justify-center relative box-border m-0 border-transparent outline-none cursor-pointer select-none align-middle appearance-none text-center transition-normal font-medium w-auto rounded-md overflow-hidden pointer-events-auto disabled:pointer-events-none disabled:cursor-not-allowed", size === BUTTON_SIZES.SMALL &&
|
|
12720
12720
|
"h-7 py-0 px-1.5 text-label leading-label-compact", size === BUTTON_SIZES.REGULAR &&
|
|
12721
12721
|
"h-9 py-0 px-2 text-body leading-body-compact", size === BUTTON_SIZES.LARGE &&
|
|
@@ -12739,8 +12739,8 @@ var dayjs_minExports = dayjs_min.exports;
|
|
|
12739
12739
|
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
12740
12740
|
|
|
12741
12741
|
const DatePicker = ({ size = "regular", placeholder = "Pick a date", format = "YYYY. MM. DD.", value, mode = "single", onChange, isInstantClose = false, open: openProp, onOpenChange: onOpenChangeProp, disabled, ...rest }) => {
|
|
12742
|
-
const [inputValue, setInputValue] =
|
|
12743
|
-
const [open, setOpen] =
|
|
12742
|
+
const [inputValue, setInputValue] = useState(value);
|
|
12743
|
+
const [open, setOpen] = useState(openProp || false);
|
|
12744
12744
|
const handleSelect = (date) => {
|
|
12745
12745
|
if (mode === "single") {
|
|
12746
12746
|
const value = date;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, Ref } from "react";
|
|
2
2
|
/** table 기반 config로 테이블 완성 component */
|
|
3
3
|
interface TableInfo<T> {
|
|
4
4
|
header: string;
|
|
5
|
-
renderFn: (item: T) =>
|
|
5
|
+
renderFn: (item: T) => ReactNode;
|
|
6
6
|
minWidth?: number;
|
|
7
7
|
maxWidth?: number;
|
|
8
8
|
showTooltip?: boolean;
|
|
@@ -24,12 +24,12 @@ export interface DataTableProps<T> {
|
|
|
24
24
|
cell?: string;
|
|
25
25
|
};
|
|
26
26
|
refs?: {
|
|
27
|
-
tableRef?:
|
|
28
|
-
headerRef?:
|
|
29
|
-
bodyRef?:
|
|
30
|
-
rowRef?:
|
|
31
|
-
cellRef?:
|
|
32
|
-
headRef?:
|
|
27
|
+
tableRef?: Ref<HTMLTableElement>;
|
|
28
|
+
headerRef?: Ref<HTMLTableRowElement>;
|
|
29
|
+
bodyRef?: Ref<HTMLTableSectionElement>;
|
|
30
|
+
rowRef?: Ref<HTMLTableRowElement>;
|
|
31
|
+
cellRef?: Ref<HTMLTableCellElement>;
|
|
32
|
+
headRef?: Ref<HTMLTableCellElement>;
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
export declare const DataTable: <T extends object>({ config, data, emptyMessage, onRowClick, enableSelection, shouldLastBorderRender, classNames, refs, }: DataTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import { forwardRef, createElement, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
const BUTTON_SIZES = {
|
|
5
5
|
REGULAR: "regular",
|
|
@@ -3325,7 +3325,7 @@ function cn(...inputs) {
|
|
|
3325
3325
|
* </Button>
|
|
3326
3326
|
* ```
|
|
3327
3327
|
*/
|
|
3328
|
-
const Button =
|
|
3328
|
+
const Button = forwardRef(({ variant = "accent", size = "regular", fullWidth = false, isLoading = false, leftIcon, rightIcon, children, disabled, className, ...rest }, ref) => {
|
|
3329
3329
|
return (jsxs("button", { ref: ref, disabled: disabled ?? isLoading, className: cn("flex items-center justify-center relative box-border m-0 border-transparent outline-none cursor-pointer select-none align-middle appearance-none text-center transition-normal font-medium w-auto rounded-md overflow-hidden pointer-events-auto disabled:pointer-events-none disabled:cursor-not-allowed", size === BUTTON_SIZES.SMALL &&
|
|
3330
3330
|
"h-7 py-0 px-1.5 text-label leading-label-compact", size === BUTTON_SIZES.REGULAR &&
|
|
3331
3331
|
"h-9 py-0 px-2 text-body leading-body-compact", size === BUTTON_SIZES.LARGE &&
|
|
@@ -3583,7 +3583,7 @@ const INPUT_SIZES = {
|
|
|
3583
3583
|
* />
|
|
3584
3584
|
* ```
|
|
3585
3585
|
*/
|
|
3586
|
-
const Input =
|
|
3586
|
+
const Input = forwardRef(({ size = "regular", leftIcon, rightIcon, wrapperClassName, ...rest }, ref) => {
|
|
3587
3587
|
return (jsxs("div", { "aria-disabled": rest.disabled, className: cn("flex itesm-center justify-center rounded-lg bg-fill-mono-default hover:bg-fill-mono-hovered focus-within:bg-fill-mono-default border border-border-bound focus-within:border-border-focused has-[input:disabled]:border-transparent", size === INPUT_SIZES.REGULAR &&
|
|
3588
3588
|
"py-1.5 px-2 text-body leading-body-compact font-medium gap-2", size === INPUT_SIZES.LARGE &&
|
|
3589
3589
|
"py-[11px] px-4 text-base leading-base-compact font-medium gap-3", wrapperClassName), children: [leftIcon && (jsx("span", { className: "flex items-center justify-center", children: leftIcon })), jsx("input", { ref: ref, className: cn("border-none outline-none p-0 flex-1 bg-transparent text-comp-mono-default placeholder:text-comp-mono-subtle-default hover:placeholder:text-comp-mono-subtle-hovered focus:placeholder:text-comp-mono-subtle-selected disabled:text-comp-disabled disabled:placeholder:text-comp-disabled", size === INPUT_SIZES.REGULAR &&
|
|
@@ -3608,7 +3608,7 @@ Input.displayName = "Input";
|
|
|
3608
3608
|
* />
|
|
3609
3609
|
* ```
|
|
3610
3610
|
*/
|
|
3611
|
-
const TextArea =
|
|
3611
|
+
const TextArea = forwardRef((rest, ref) => {
|
|
3612
3612
|
return (jsx("div", { className: "py-3 px-4 flex-1 h-full", children: jsx("textarea", { ref: ref, className: cn("w-full h-full flex-1 p-0 text-body leading-body font-medium border-none resize-none outline-none text-comp-mono-default disabled:text-comp-disabled disabled:placeholder:text-comp-disabled placeholder:text-comp-mono-subtle-default", rest.className), ...rest }) }));
|
|
3613
3613
|
});
|
|
3614
3614
|
TextArea.displayName = "TextArea";
|
|
@@ -3632,19 +3632,19 @@ TextArea.displayName = "TextArea";
|
|
|
3632
3632
|
* </CardFooter>
|
|
3633
3633
|
* </Card>
|
|
3634
3634
|
*/
|
|
3635
|
-
const Card =
|
|
3635
|
+
const Card = forwardRef(({ className, ...rest }, ref) => {
|
|
3636
3636
|
return (jsx("div", { ...rest, ref: ref, className: cn("flex flex-col rounded-2xl border border-border-divider bg-page-l0", className), children: rest.children }));
|
|
3637
3637
|
});
|
|
3638
|
-
const CardBody =
|
|
3638
|
+
const CardBody = forwardRef(({ className, ...rest }, ref) => {
|
|
3639
3639
|
return (jsx("div", { ...rest, ref: ref, className: cn("p-6", className), children: rest.children }));
|
|
3640
3640
|
});
|
|
3641
|
-
const CardHeader =
|
|
3641
|
+
const CardHeader = forwardRef(({ className, ...rest }, ref) => {
|
|
3642
3642
|
return (jsx("div", { ...rest, ref: ref, className: cn("text-comp-mono-default font-bold text-xl leading-xl-compact mb-2", className), children: rest.children }));
|
|
3643
3643
|
});
|
|
3644
|
-
const CardContent =
|
|
3644
|
+
const CardContent = forwardRef((rest, ref) => {
|
|
3645
3645
|
return (jsx("div", { ...rest, ref: ref, children: rest.children }));
|
|
3646
3646
|
});
|
|
3647
|
-
const CardFooter =
|
|
3647
|
+
const CardFooter = forwardRef(({ className, ...rest }, ref) => {
|
|
3648
3648
|
return (jsx("div", { ...rest, ref: ref, className: cn("py-4 px-6", className), children: rest.children }));
|
|
3649
3649
|
});
|
|
3650
3650
|
|
|
@@ -3808,8 +3808,8 @@ const __iconNode = [
|
|
|
3808
3808
|
];
|
|
3809
3809
|
const X = createLucideIcon("x", __iconNode);
|
|
3810
3810
|
|
|
3811
|
-
const Tag =
|
|
3812
|
-
const [isSelected, setIsSelected] =
|
|
3811
|
+
const Tag = forwardRef(({ icon, value, variant = "filled", size = "regular", className, onDeleteClick, onClick, ...props }, ref) => {
|
|
3812
|
+
const [isSelected, setIsSelected] = useState(false);
|
|
3813
3813
|
const handleClick = (event) => {
|
|
3814
3814
|
setIsSelected((prev) => !prev);
|
|
3815
3815
|
onClick?.(event);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { RadioGroup as RadioGroupRadix } from "radix-ui";
|
|
3
2
|
import { RadioGroupOrientation } from "./types";
|
|
4
3
|
interface RadioGroupProps extends RadioGroupRadix.RadioGroupProps {
|
|
@@ -22,12 +21,12 @@ interface RadioGroupProps extends RadioGroupRadix.RadioGroupProps {
|
|
|
22
21
|
* </RadioGroup>
|
|
23
22
|
* ```
|
|
24
23
|
*/
|
|
25
|
-
export declare const RadioGroup:
|
|
24
|
+
export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
25
|
interface RadioItemProps extends RadioGroupRadix.RadioGroupItemProps {
|
|
27
26
|
label?: string;
|
|
28
27
|
labelClassName?: string;
|
|
29
28
|
wrapperClassName?: string;
|
|
30
29
|
className?: string;
|
|
31
30
|
}
|
|
32
|
-
export declare const RadioItem:
|
|
31
|
+
export declare const RadioItem: import("react").ForwardRefExoticComponent<RadioItemProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
33
32
|
export {};
|