@telepix-lab/telepix-ui 0.6.8 → 0.6.9
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/client.js +36 -25
- package/dist/cjs/index.d.ts +10 -10
- package/dist/cjs/index.js +95 -83
- package/dist/cjs/input/index.d.ts +5 -2
- package/dist/cjs/input/types.d.ts +6 -0
- package/dist/esm/client.js +36 -25
- package/dist/esm/index.d.ts +10 -10
- package/dist/esm/index.js +95 -84
- package/dist/esm/input/index.d.ts +5 -2
- package/dist/esm/input/types.d.ts +6 -0
- package/dist/index.d.ts +121 -112
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/cjs/client.js
CHANGED
|
@@ -12099,7 +12099,7 @@ const StateColorContainer = ({ groupName = "state", isInverted, className, }) =>
|
|
|
12099
12099
|
const group = groupName || "state";
|
|
12100
12100
|
const mode = isInverted ? "invert" : "normal";
|
|
12101
12101
|
const actionClass = fillClassMap[group]?.[mode] ?? fillClassMap.state[mode];
|
|
12102
|
-
return (jsxRuntime.jsx("div", { className: cn("absolute left-0 top-0 right-0 bottom-0 inset-0 pointer-events-none z-0", actionClass, className) }));
|
|
12102
|
+
return (jsxRuntime.jsx("div", { className: cn("absolute left-0 top-0 right-0 bottom-0 inset-0 pointer-events-none z-0 rounded-[inherit]", actionClass, className) }));
|
|
12103
12103
|
};
|
|
12104
12104
|
|
|
12105
12105
|
const RadioGroupContext = React.createContext({ value: "", disabled: false });
|
|
@@ -12129,7 +12129,7 @@ const RadioItem = React.forwardRef(({ label, labelClassName, wrapperClassName, .
|
|
|
12129
12129
|
const randomId = id ?? React.useId();
|
|
12130
12130
|
const isSelected = React.useContext(RadioGroupContext).value === value;
|
|
12131
12131
|
const isDisabled = React.useContext(RadioGroupContext).disabled || disabled || false;
|
|
12132
|
-
return (jsxRuntime.jsxs("div", { className: cn("flex items-center gap-1.5 cursor-pointer bg-transparent border-none py-1 pr-2 group/state relative", wrapperClassName), children: [jsxRuntime.jsx(Item2, { ...restProps, id: randomId, ref: ref, value: value, disabled: isDisabled, className: cn("bg-transparent border-none p-1.5 flex items-center outline-none justify-center cursor-pointer", className), children: isDisabled ? (jsxRuntime.jsx(CircleBackslashIcon, { className: "text-comp-disabled" })) : isSelected ? (jsxRuntime.jsx(RadiobuttonIcon, { className: "text-comp-mono-default" })) : (jsxRuntime.jsx(CircleIcon, { className: "text-comp-mono-default" })) }), label && (jsxRuntime.jsx("label", { className: cn("text-body leading-body-compact text-comp-mono-default font-medium cursor-pointer", isDisabled && "text-comp-disabled cursor-default", labelClassName), htmlFor: randomId, children: label })), jsxRuntime.jsx(StateColorContainer, { className: cn(
|
|
12132
|
+
return (jsxRuntime.jsxs("div", { className: cn("flex items-center gap-1.5 cursor-pointer bg-transparent border-none py-1 pr-2 group/state relative", wrapperClassName), children: [jsxRuntime.jsx(Item2, { ...restProps, id: randomId, ref: ref, value: value, disabled: isDisabled, className: cn("bg-transparent border-none p-1.5 flex items-center outline-none justify-center cursor-pointer", className), children: isDisabled ? (jsxRuntime.jsx(CircleBackslashIcon, { className: "text-comp-disabled" })) : isSelected ? (jsxRuntime.jsx(RadiobuttonIcon, { className: "text-comp-mono-default" })) : (jsxRuntime.jsx(CircleIcon, { className: "text-comp-mono-default" })) }), label && (jsxRuntime.jsx("label", { className: cn("text-body leading-body-compact text-comp-mono-default font-medium cursor-pointer", isDisabled && "text-comp-disabled cursor-default", labelClassName), htmlFor: randomId, children: label })), jsxRuntime.jsx(StateColorContainer, { className: cn(isDisabled &&
|
|
12133
12133
|
"bg-fill-disabled group-hover/state:bg-fill-disabled group-active/state:bg-fill-disabled") })] }));
|
|
12134
12134
|
});
|
|
12135
12135
|
RadioGroup.displayName = "RadioGroup";
|
|
@@ -12345,7 +12345,7 @@ const Checkbox = React.forwardRef(({ label, labelClassName, wrapperClassName, ..
|
|
|
12345
12345
|
setChecked(value);
|
|
12346
12346
|
onChange?.(value);
|
|
12347
12347
|
};
|
|
12348
|
-
return (jsxRuntime.jsxs("div", { className: cn("flex items-center gap-2.5 pl-1.5 py-1 relative group/state", !label ? "pr-1.5 rounded-sm" : "pr-3 rounded-lg", wrapperClassName), children: [jsxRuntime.jsx(Checkbox$1, { ref: ref, id: id ?? randomId, ...rest, checked: defaultChecked ? checked : isChecked, className: cn("size-4 p-0 cursor-pointer border-transparent bg-transparent", className), onCheckedChange: onCheckedChange, children: renderCheckboxIcon(defaultChecked ? checked : isChecked, disabled) }), label && (jsxRuntime.jsx("label", { className: cn("text-body leading-body-compact text-comp-mono-default font-medium cursor-pointer", disabled && "text-comp-disabled cursor-default", labelClassName), htmlFor: id ?? randomId, "aria-disabled": disabled, children: label })), jsxRuntime.jsx(StateColorContainer, { className: cn(
|
|
12348
|
+
return (jsxRuntime.jsxs("div", { className: cn("flex items-center gap-2.5 pl-1.5 py-1 relative group/state", !label ? "pr-1.5 rounded-sm" : "pr-3 rounded-lg", wrapperClassName), children: [jsxRuntime.jsx(Checkbox$1, { ref: ref, id: id ?? randomId, ...rest, checked: defaultChecked ? checked : isChecked, className: cn("size-4 p-0 cursor-pointer border-transparent bg-transparent", className), onCheckedChange: onCheckedChange, children: renderCheckboxIcon(defaultChecked ? checked : isChecked, disabled) }), label && (jsxRuntime.jsx("label", { className: cn("text-body leading-body-compact text-comp-mono-default font-medium cursor-pointer", disabled && "text-comp-disabled cursor-default", labelClassName), htmlFor: id ?? randomId, "aria-disabled": disabled, children: label })), jsxRuntime.jsx(StateColorContainer, { className: cn(disabled
|
|
12349
12349
|
? "bg-fill-default group-hover/state:bg-fill-default group-active/state:bg-fill-default"
|
|
12350
12350
|
: "") })] }));
|
|
12351
12351
|
});
|
|
@@ -12469,7 +12469,7 @@ const SelectTrigger = ({ placeholder, textValue, variant = "outline", size = "re
|
|
|
12469
12469
|
"border border-transparent py-0 px-2 bg-page-l3 [&:not(:is([data-placeholder]))]:border-border-focused [&:not(:is([data-placeholder]))]:bg-page-l2 data-disabled:border-transparent data-disabled:bg-page-l-null", size === SELECT_TRIGGER_SIZES.COMPACT &&
|
|
12470
12470
|
"py-1.5 px-1 text-label font-medium leading-label-compact gap-1", size === SELECT_TRIGGER_SIZES.REGULAR &&
|
|
12471
12471
|
"py-1.5 px-2 text-body font-medium leading-body-compact gap-2", size === SELECT_TRIGGER_SIZES.LARGE &&
|
|
12472
|
-
"py-3 px-4 text-base leading-base-compact font-medium gap-3", className), ...otherProps, children: [icon && jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: icon }), jsxRuntime.jsx(Value, { placeholder: placeholder, asChild: !!textValue, children: textValue && jsxRuntime.jsx("span", { children: textValue }) }), jsxRuntime.jsx(Icon$1, { className: "flex items-center justify-center text-comp-mono-default group-disabled/state:text-comp-disabled", children: jsxRuntime.jsx(CaretDownIcon, {}) }), jsxRuntime.jsx(StateColorContainer, { className: "
|
|
12472
|
+
"py-3 px-4 text-base leading-base-compact font-medium gap-3", className), ...otherProps, children: [icon && jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: icon }), jsxRuntime.jsx(Value, { placeholder: placeholder, asChild: !!textValue, children: textValue && jsxRuntime.jsx("span", { children: textValue }) }), jsxRuntime.jsx(Icon$1, { className: "flex items-center justify-center text-comp-mono-default group-disabled/state:text-comp-disabled", children: jsxRuntime.jsx(CaretDownIcon, {}) }), jsxRuntime.jsx(StateColorContainer, { className: "group-data-disabled/state:bg-fill-default" })] }));
|
|
12473
12473
|
};
|
|
12474
12474
|
const SelectContent = ({ children, viewportClassName, viewportWrapperClassName, ...rest }) => {
|
|
12475
12475
|
const { className, position, sideOffset, ...otherProps } = rest;
|
|
@@ -12486,7 +12486,7 @@ const SelectItem = ({ indicator, ...rest }) => {
|
|
|
12486
12486
|
const { className, textValue, ...otherProps } = rest;
|
|
12487
12487
|
return (jsxRuntime.jsxs(Item, { className: cn(`relative group/state flex items-center justify-between gap-2 py-1.5 px-2 cursor-pointer text-comp-mono-default text-body font-medium leading-body-compact outline-none rounded-sm
|
|
12488
12488
|
[&:is([data-disabled])]:text-comp-disabled [&:is([data-disabled])]:cursor-not-allowed
|
|
12489
|
-
`, className), ...otherProps, children: [jsxRuntime.jsx(ItemText, { children: textValue ?? otherProps.value }), indicator && (jsxRuntime.jsx(ItemIndicator, { className: "w-4 flex items-center justify-center", children: indicator })), jsxRuntime.jsx(StateColorContainer, { className: "
|
|
12489
|
+
`, className), ...otherProps, children: [jsxRuntime.jsx(ItemText, { children: textValue ?? otherProps.value }), indicator && (jsxRuntime.jsx(ItemIndicator, { className: "w-4 flex items-center justify-center", children: indicator })), jsxRuntime.jsx(StateColorContainer, { className: "group-data-disabled/state:bg-fill-default" })] }));
|
|
12490
12490
|
};
|
|
12491
12491
|
Select.displayName = "Select";
|
|
12492
12492
|
SelectTrigger.displayName = "SelectTrigger";
|
|
@@ -12536,7 +12536,7 @@ const VerticalMenu = React.forwardRef(({ disabled, value, label, icon, variant =
|
|
|
12536
12536
|
rest.onClick?.(e);
|
|
12537
12537
|
};
|
|
12538
12538
|
return (jsxRuntime.jsxs("button", { ref: ref, className: cn("group/state relative w-full flex items-center rounded-md text-body leading-body-compact font-medium bg-transparent border-none cursor-pointer data-[selected=true]:font-semibold data-disabled:text-comp-disabled text-comp-mono-default", size === VERTICAL_MENU_SIZES.SMALL && "gap-3 p-1", size === VERTICAL_MENU_SIZES.REGULAR && "gap-[18px] p-2.5", variant === VERTICAL_MENU_VARIANTS.ACCENT &&
|
|
12539
|
-
`bg-page-l-null data-[selected=true]:bg-page-accent-l0 data-[selected=true]:text-comp-accent-default`, rest.className), ...rest, disabled: isDisabled, value: value, "data-selected": isSelected, "aria-selected": isSelected, onClick: onClick, children: [icon && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-5", children: icon })), label, jsxRuntime.jsx(StateColorContainer, { className: cn("
|
|
12539
|
+
`bg-page-l-null data-[selected=true]:bg-page-accent-l0 data-[selected=true]:text-comp-accent-default`, rest.className), ...rest, disabled: isDisabled, value: value, "data-selected": isSelected, "aria-selected": isSelected, onClick: onClick, children: [icon && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-5", children: icon })), label, jsxRuntime.jsx(StateColorContainer, { className: cn("group-disabled/state:bg-fill-default", variant === VERTICAL_MENU_VARIANTS.ACCENT &&
|
|
12540
12540
|
"group-aria-selected:bg-fill-default") })] }));
|
|
12541
12541
|
});
|
|
12542
12542
|
VerticalMenu.displayName = "VerticalMenu";
|
|
@@ -12573,7 +12573,7 @@ const HorizontalTab = React.forwardRef(({ value, label, className, icon, size =
|
|
|
12573
12573
|
return;
|
|
12574
12574
|
setSelectedTab(value);
|
|
12575
12575
|
};
|
|
12576
|
-
return (jsxRuntime.jsxs("button", { ref: ref, className: cn("relative group/state p-0 flex flex-col items-center justify-center flex-nowrap text-comp-mono-subtle-default text-body font-medium leading-body-compact bg-transparent border-none cursor-pointer disabled:cursor-not-allowed", isSelected && "font-bold", className), onClick: handleClick, disabled: isDisabled, "data-selected": isSelected, "aria-selected": isSelected, ...rest, children: [jsxRuntime.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 && (jsxRuntime.jsx("span", { className: cn("flex items-center justify-center size-5", size === HORIZONTAL_TAB_SIZES.SMALL && "size-4"), children: icon })), label] }), jsxRuntime.jsx("div", { className: cn("bg-comp-mono-subtle-default mt-[3px] h-[1px] w-full", isSelected && "h-0.5 mt-0.5"), "data-selected": isSelected }), jsxRuntime.jsx(StateColorContainer, { className: "group-aria-selected/state:bg-fill-default
|
|
12576
|
+
return (jsxRuntime.jsxs("button", { ref: ref, className: cn("relative group/state p-0 flex flex-col items-center justify-center flex-nowrap text-comp-mono-subtle-default text-body font-medium leading-body-compact bg-transparent border-none cursor-pointer disabled:cursor-not-allowed", isSelected && "font-bold", className), onClick: handleClick, disabled: isDisabled, "data-selected": isSelected, "aria-selected": isSelected, ...rest, children: [jsxRuntime.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 && (jsxRuntime.jsx("span", { className: cn("flex items-center justify-center size-5", size === HORIZONTAL_TAB_SIZES.SMALL && "size-4"), children: icon })), label] }), jsxRuntime.jsx("div", { className: cn("bg-comp-mono-subtle-default mt-[3px] h-[1px] w-full", isSelected && "h-0.5 mt-0.5"), "data-selected": isSelected }), jsxRuntime.jsx(StateColorContainer, { className: "group-aria-selected/state:bg-fill-default" })] }));
|
|
12577
12577
|
});
|
|
12578
12578
|
|
|
12579
12579
|
const ModeTabContext = React.createContext({
|
|
@@ -12603,7 +12603,7 @@ const ModeTab = React.forwardRef(({ label, icon, value, className, ...rest }, re
|
|
|
12603
12603
|
return;
|
|
12604
12604
|
setSelectedTab(value);
|
|
12605
12605
|
};
|
|
12606
|
-
return (jsxRuntime.jsxs("button", { ref: ref, className: cn("relative group/state shadow-basic px-2 py-1 flex items-center justify-center gap-2.5 flex-1 text-comp-mono-subtle-default aria-selected:text-comp-mono-default text-body leading-body-compact font-medium cursor-pointer bg-transparent border-none rounded-sm hover:text-comp-mono-subtle-hovered active:text-comp-mono-subtle-pressed", isSelected && "bg-page-l0", isDisabled && "text-comp-disabled cursor-not-allowed", className), "data-selected": isSelected, "aria-selected": isSelected, disabled: isDisabled, onClick: handleClick, ...rest, children: [icon && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-5", children: icon })), label, jsxRuntime.jsx(StateColorContainer, {
|
|
12606
|
+
return (jsxRuntime.jsxs("button", { ref: ref, className: cn("relative group/state shadow-basic px-2 py-1 flex items-center justify-center gap-2.5 flex-1 text-comp-mono-subtle-default aria-selected:text-comp-mono-default text-body leading-body-compact font-medium cursor-pointer bg-transparent border-none rounded-sm hover:text-comp-mono-subtle-hovered active:text-comp-mono-subtle-pressed", isSelected && "bg-page-l0", isDisabled && "text-comp-disabled cursor-not-allowed", className), "data-selected": isSelected, "aria-selected": isSelected, disabled: isDisabled, onClick: handleClick, ...rest, children: [icon && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-5", children: icon })), label, jsxRuntime.jsx(StateColorContainer, {})] }));
|
|
12607
12607
|
});
|
|
12608
12608
|
|
|
12609
12609
|
const TOOLTIP_SHORT_VARIANTS = {
|
|
@@ -12665,17 +12665,12 @@ const Tag = React.forwardRef(({ icon, value, variant = "filled", size = "regular
|
|
|
12665
12665
|
`bg-page-l4 text-comp-mono-subtle-default data-disabled:text-comp-disabled data-disabled:bg-page-l-null`, variant === "accent" &&
|
|
12666
12666
|
`bg-page-accent-l0 text-comp-accent-default data-disabled:text-comp-disabled data-disabled:bg-page-l-null`, size === "regular" &&
|
|
12667
12667
|
"text-body font-medium leading-body-compact px-2 py-1 gap-2", size === "small" &&
|
|
12668
|
-
"text-label font-medium leading-label-compact px-1.5 py-0.5 gap-1.5", className), onClick: handleClick, "data-selected": isSelected, "aria-selected": isSelected, ...props, children: [icon && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-4 border-none bg-transparent outline-none p-0", children: icon })), jsxRuntime.jsx("span", { className: "flex-1 text-nowrap overflow-hidden text-ellipsis text-inherit text-size-inherit leading-inherit font-inherit", children: value.label }), onDeleteClick && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-4 border-none bg-transparent outline-none p-0 cursor-pointer text-comp-mono-default group-disabled/state:text-comp-disabled", onClick: handleDeleteClick, children: jsxRuntime.jsx(X, {}) })), jsxRuntime.jsx(StateColorContainer, { className: cn(
|
|
12668
|
+
"text-label font-medium leading-label-compact px-1.5 py-0.5 gap-1.5", className), onClick: handleClick, "data-selected": isSelected, "aria-selected": isSelected, ...props, children: [icon && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-4 border-none bg-transparent outline-none p-0", children: icon })), jsxRuntime.jsx("span", { className: "flex-1 text-nowrap overflow-hidden text-ellipsis text-inherit text-size-inherit leading-inherit font-inherit", children: value.label }), onDeleteClick && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-4 border-none bg-transparent outline-none p-0 cursor-pointer text-comp-mono-default group-disabled/state:text-comp-disabled", onClick: handleDeleteClick, children: jsxRuntime.jsx(X, {}) })), jsxRuntime.jsx(StateColorContainer, { className: cn(useSelectedStyle
|
|
12669
12669
|
? ""
|
|
12670
12670
|
: "group-active/state:bg-fill-default group-active/state:border-transparent group-disabled/state:bg-fill-default"), isInverted: variant === "accent" })] }));
|
|
12671
12671
|
});
|
|
12672
12672
|
Tag.displayName = "Tag";
|
|
12673
12673
|
|
|
12674
|
-
const INPUT_SIZES = {
|
|
12675
|
-
REGULAR: "regular",
|
|
12676
|
-
LARGE: "large",
|
|
12677
|
-
};
|
|
12678
|
-
|
|
12679
12674
|
const TEXT_VARIANTS = {
|
|
12680
12675
|
BOLD3XLARGEBOLD: "bold3XLargeBold",
|
|
12681
12676
|
BOLD2XLARGEBOLDCOMPACT: "bold2XLargeBoldCompact",
|
|
@@ -12884,10 +12879,21 @@ const Text = ({ children, className, size, weight, align, variant = "regularBase
|
|
|
12884
12879
|
};
|
|
12885
12880
|
Text.displayName = "Text";
|
|
12886
12881
|
|
|
12882
|
+
const INPUT_SIZES = {
|
|
12883
|
+
SMALL: "small",
|
|
12884
|
+
REGULAR: "regular",
|
|
12885
|
+
LARGE: "large",
|
|
12886
|
+
};
|
|
12887
|
+
const INPUT_VARIANTS = {
|
|
12888
|
+
OUTLINED: "outlined",
|
|
12889
|
+
FILLED: "filled",
|
|
12890
|
+
};
|
|
12891
|
+
|
|
12887
12892
|
/**
|
|
12888
12893
|
* 다양한 크기와 아이콘을 지원하는 입력 필드 컴포넌트입니다.<br/>
|
|
12889
|
-
* 사용자는 크기(size), 왼쪽 아이콘(leftIcon), 오른쪽 아이콘(rightIcon) 등을 지정할 수 있습니다.<br/>
|
|
12894
|
+
* 사용자는 크기(size), 변형(variant), 왼쪽 아이콘(leftIcon), 오른쪽 아이콘(rightIcon) 등을 지정할 수 있습니다.<br/>
|
|
12890
12895
|
* 기본적으로 regular 크기를 가지며, large 크기도 선택할 수 있습니다.<br/>
|
|
12896
|
+
* 기본적으로 outlined 변형을 가지며, filled 변형도 선택할 수 있습니다.<br/>
|
|
12891
12897
|
* input의 너비는 부모 요소에 따라 결정됩니다.<br/>
|
|
12892
12898
|
* input 자체의 클래스는 `className` 속성을 통해 추가할 수 있습니다.<br/>
|
|
12893
12899
|
* wrapperClassName을 통해 input을 감싸는 div의 클래스도 추가할 수 있습니다.<br/>
|
|
@@ -12896,6 +12902,7 @@ Text.displayName = "Text";
|
|
|
12896
12902
|
* ```tsx
|
|
12897
12903
|
* <Input
|
|
12898
12904
|
* size="large"
|
|
12905
|
+
* variant="outlined"
|
|
12899
12906
|
* leftIcon={<SearchIcon />}
|
|
12900
12907
|
* rightIcon={<ClearIcon />}
|
|
12901
12908
|
* placeholder="Search..."
|
|
@@ -12903,7 +12910,7 @@ Text.displayName = "Text";
|
|
|
12903
12910
|
* />
|
|
12904
12911
|
* ```
|
|
12905
12912
|
*/
|
|
12906
|
-
const Input = React.forwardRef(({ size = "regular", leftIcon, rightIcon, wrapperClassName, isError = false, useHoverStyle = true, errorMessage, useIndicator = false, ...rest }, ref) => {
|
|
12913
|
+
const Input = React.forwardRef(({ size = "regular", variant = "outlined", leftIcon, rightIcon, wrapperClassName, isError = false, useHoverStyle = true, errorMessage, useIndicator = false, ...rest }, ref) => {
|
|
12907
12914
|
const innerRef = React.useRef(null);
|
|
12908
12915
|
const mergedRef = (node) => {
|
|
12909
12916
|
if (typeof ref === "function")
|
|
@@ -12912,13 +12919,17 @@ const Input = React.forwardRef(({ size = "regular", leftIcon, rightIcon, wrapper
|
|
|
12912
12919
|
ref.current = node;
|
|
12913
12920
|
innerRef.current = node;
|
|
12914
12921
|
};
|
|
12915
|
-
return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("div", { "aria-disabled": rest.disabled, className: cn("relative group/state flex items-center justify-center rounded-lg bg-Page-l-null border
|
|
12922
|
+
return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("div", { "aria-disabled": rest.disabled, className: cn("relative group/state flex items-center justify-center rounded-lg border bg-Page-l-null border-border-bound focus-within:border-border-focused has-[input:disabled]:border-transparent", variant === INPUT_VARIANTS.OUTLINED &&
|
|
12923
|
+
"border border-border-bound focus-within:border-border-focused", variant === INPUT_VARIANTS.FILLED &&
|
|
12924
|
+
"bg-page-l3 border-transparent focus-within:border-transparent", size === INPUT_SIZES.SMALL &&
|
|
12925
|
+
"py-1.5 px-2 text-label leading-label-compact font-medium gap-1", size === INPUT_SIZES.REGULAR &&
|
|
12916
12926
|
"py-1.5 px-2 text-body leading-body-compact font-medium gap-2", size === INPUT_SIZES.LARGE &&
|
|
12917
12927
|
"py-[11px] px-4 text-base leading-base-compact font-medium gap-3", isError &&
|
|
12918
12928
|
"border-comp-chroma-error focus-within:border-comp-chroma-error", wrapperClassName), onClick: () => {
|
|
12919
12929
|
innerRef.current?.focus();
|
|
12920
12930
|
}, children: [jsxRuntime.jsx(StateColorContainer, { className: cn("group-focus-within/state:bg-page-l-null", (!useHoverStyle || rest.disabled) && "hover:bg-fill-default") }), leftIcon && (jsxRuntime.jsx("div", { className: cn("flex items-center justify-center text-comp-mono-default", isError && "text-comp-chroma-error"), children: leftIcon })), jsxRuntime.jsx("input", { ref: mergedRef, className: cn("border-none outline-none p-0 flex-1 bg-transparent min-w-0 text-comp-mono-default placeholder:text-comp-mono-subtle-default focus:placeholder:text-comp-mono-subtle-selected disabled:text-comp-disabled disabled:placeholder:text-comp-disabled", useHoverStyle &&
|
|
12921
|
-
"hover:placeholder:text-comp-mono-subtle-hovered", size === INPUT_SIZES.
|
|
12931
|
+
"hover:placeholder:text-comp-mono-subtle-hovered", size === INPUT_SIZES.SMALL &&
|
|
12932
|
+
"text-label leading-label-compact font-medium", size === INPUT_SIZES.REGULAR &&
|
|
12922
12933
|
"text-body leading-body-compact font-medium", size === INPUT_SIZES.LARGE &&
|
|
12923
12934
|
"text-base leading-base-compact font-medium", isError &&
|
|
12924
12935
|
"placeholder:text-comp-chroma-error text-comp-chroma-error hover:placeholder:text-comp-error focus:placeholder:text-comp-error", rest.type === "number" &&
|
|
@@ -13041,7 +13052,7 @@ const MultipleSelectItem = React.forwardRef(({ option, indicator, className, ...
|
|
|
13041
13052
|
setSelectedValues(newValues);
|
|
13042
13053
|
};
|
|
13043
13054
|
return (jsxRuntime.jsxs("li", { ref: ref, "data-selected": isSelected, "aria-selected": isSelected, "data-disabled": option.disabled, className: cn("group/state relative py-2 px-3 cursor-pointer flex items-center justify-between gap-2 text-body text-comp-mono-default leading-body-compact font-medium rounded-sm", isSelected && "bg-fill-mono-selected text-comp-mono-default", option.disabled &&
|
|
13044
|
-
"bg-fill-disabled text-comp-disabled cursor-not-allowed", className), onClick: handleClick, ...rest, children: [jsxRuntime.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 && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-4", children: indicator })), jsxRuntime.jsx(StateColorContainer, {
|
|
13055
|
+
"bg-fill-disabled text-comp-disabled cursor-not-allowed", className), onClick: handleClick, ...rest, children: [jsxRuntime.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 && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-4", children: indicator })), jsxRuntime.jsx(StateColorContainer, {})] }));
|
|
13045
13056
|
});
|
|
13046
13057
|
|
|
13047
13058
|
const Table = React.forwardRef(({ className, ...rest }, ref) => {
|
|
@@ -13090,7 +13101,7 @@ const InteractiveListItemContext = React.createContext({
|
|
|
13090
13101
|
});
|
|
13091
13102
|
const InteractiveListItem = React.forwardRef(({ isSelected, disabled, showHoverActions = true, children, className, ...rest }, ref) => {
|
|
13092
13103
|
return (jsxRuntime.jsx(InteractiveListItemContext, { value: { disabled: !!disabled }, children: jsxRuntime.jsxs("div", { ref: ref, "aria-selected": isSelected, "data-selected": isSelected, "data-disabled": disabled, "data-hover-actions": showHoverActions, className: cn("relative group/wrapper flex items-center gap-1 p-1.5 rounded-sm cursor-pointer text-comp-mono-default bg-page-l-null order border-transparent", isSelected && "bg-fill-mono-selected border-border-selected", disabled &&
|
|
13093
|
-
"cursor-not-allowed text-comp-disabled bg-fill-disabled", className), ...rest, children: [children, jsxRuntime.jsx(StateColorContainer, {
|
|
13104
|
+
"cursor-not-allowed text-comp-disabled bg-fill-disabled", className), ...rest, children: [children, jsxRuntime.jsx(StateColorContainer, { groupName: "wrapper" })] }) }));
|
|
13094
13105
|
});
|
|
13095
13106
|
const InteractiveListItemIcon = React.forwardRef(({ children, className, ...props }, ref) => {
|
|
13096
13107
|
return (jsxRuntime.jsx("span", { className: cn("flex items-center justify-center size-6 p-1", className), ...props, ref: ref, children: children }));
|
|
@@ -13130,7 +13141,7 @@ const Calendar = ({ className, classNames, showOutsideDays = true, ...props }) =
|
|
|
13130
13141
|
Dropdown: (props) => {
|
|
13131
13142
|
const { options, className, classNames, components, ...rest } = props;
|
|
13132
13143
|
const selectedOption = options?.find(({ value }) => value === rest.value);
|
|
13133
|
-
return (jsxRuntime.jsxs("div", { className: cn("group/state flex px-2 py-1 rounded-lg relative cursor-pointer", props["aria-label"]?.includes("Month") ? "w-28" : "w-20"), children: [jsxRuntime.jsx("select", { ...rest, className: cn("text-body leading-body-compact font-medium text-comp-mono-default focus:outline-none z-[1] opacity-0 appearance-none absolute inset-0 w-full", className), name: props["aria-label"], children: options?.map((option) => (jsxRuntime.jsx("option", { value: option.value, children: option.label }, option.value))) }), jsxRuntime.jsxs(Text, { variant: "medBodyMedCompact", className: "flex gap-0.5 items-center justify-end w-full text-comp-mono-default leading-3.5 cursor-pointer", "aria-hidden": true, children: [jsxRuntime.jsx("span", { className: "inline-block px-1 py-1.5 flex-1 text-right", children: selectedOption?.label }), jsxRuntime.jsx(ChevronDown, { size: 16 })] }), jsxRuntime.jsx(StateColorContainer, {
|
|
13144
|
+
return (jsxRuntime.jsxs("div", { className: cn("group/state flex px-2 py-1 rounded-lg relative cursor-pointer", props["aria-label"]?.includes("Month") ? "w-28" : "w-20"), children: [jsxRuntime.jsx("select", { ...rest, className: cn("text-body leading-body-compact font-medium text-comp-mono-default focus:outline-none z-[1] opacity-0 appearance-none absolute inset-0 w-full", className), name: props["aria-label"], children: options?.map((option) => (jsxRuntime.jsx("option", { value: option.value, children: option.label }, option.value))) }), jsxRuntime.jsxs(Text, { variant: "medBodyMedCompact", className: "flex gap-0.5 items-center justify-end w-full text-comp-mono-default leading-3.5 cursor-pointer", "aria-hidden": true, children: [jsxRuntime.jsx("span", { className: "inline-block px-1 py-1.5 flex-1 text-right", children: selectedOption?.label }), jsxRuntime.jsx(ChevronDown, { size: 16 })] }), jsxRuntime.jsx(StateColorContainer, {})] }));
|
|
13134
13145
|
},
|
|
13135
13146
|
Chevron: (args) => (jsxRuntime.jsx(ChevronLeft, { ...args, size: 20, "data-orientation": args.orientation, className: "text-comp-mono-default [&:is([data-orientation='right'])]:rotate-180 [&:is([data-orientation='up'])]:rotate-90 [&:is([data-orientation='down'])]:-rotate-90" })),
|
|
13136
13147
|
}, ...props }));
|
|
@@ -13265,7 +13276,7 @@ const ContextMenuLabel = (props) => {
|
|
|
13265
13276
|
};
|
|
13266
13277
|
const ContextMenuItem = ({ leftIcon, rightSlot, textValue, ...rest }) => {
|
|
13267
13278
|
return (jsxRuntime.jsxs(Item2$1, { ...rest, className: cn(`relative group/state outline-none p-2 flex items-center justify-between gap-2 text-body leading-body-compact font-medium text-comp-mono-default bg-page-l-null rounded-sm
|
|
13268
|
-
[&:is([data-disabled])]:bg-fill-disabled [&:is([data-disabled])]:text-comp-disabled [&:is([data-disabled])]:cursor-not-allowed`, rest.className), children: [jsxRuntime.jsxs("div", { className: "flex-1 flex items-center gap-2 text-size-inherit font-inherit leading-inherit overflow-hidden", children: [jsxRuntime.jsx("div", { className: "size-4 flex items-center justify-center text-size-inherit leading-inherit font-inherit bg-transparent text-comp-mono-subtle-default group-aria-disabled/state:text-comp-disabled", children: leftIcon }), jsxRuntime.jsx("span", { className: "overflow-ellipsis overflow-hidden whitespace-nowrap", children: textValue })] }), rightSlot && (jsxRuntime.jsx("div", { className: `flex items-center justify-center text-size-inherit leading-inherit font-inherit text-comp-mono-subtle-default group-aria-disabled/state:text-comp-disabled`, children: rightSlot })), jsxRuntime.jsx(StateColorContainer, { className: "
|
|
13279
|
+
[&:is([data-disabled])]:bg-fill-disabled [&:is([data-disabled])]:text-comp-disabled [&:is([data-disabled])]:cursor-not-allowed`, rest.className), children: [jsxRuntime.jsxs("div", { className: "flex-1 flex items-center gap-2 text-size-inherit font-inherit leading-inherit overflow-hidden", children: [jsxRuntime.jsx("div", { className: "size-4 flex items-center justify-center text-size-inherit leading-inherit font-inherit bg-transparent text-comp-mono-subtle-default group-aria-disabled/state:text-comp-disabled", children: leftIcon }), jsxRuntime.jsx("span", { className: "overflow-ellipsis overflow-hidden whitespace-nowrap", children: textValue })] }), rightSlot && (jsxRuntime.jsx("div", { className: `flex items-center justify-center text-size-inherit leading-inherit font-inherit text-comp-mono-subtle-default group-aria-disabled/state:text-comp-disabled`, children: rightSlot })), jsxRuntime.jsx(StateColorContainer, { className: "group-aria-disabled/state:bg-fill-default group-[data-state='open']/state:bg-fill-selected" })] }));
|
|
13269
13280
|
};
|
|
13270
13281
|
const ContextMenuGroup = Group2;
|
|
13271
13282
|
const ContextMenuSub = Sub2;
|
|
@@ -13405,7 +13416,7 @@ const FilledSwitch = (props) => {
|
|
|
13405
13416
|
const { size, checked, thumbClassName, ...rest } = props;
|
|
13406
13417
|
return (jsxRuntime.jsxs(Root, { className: cn("group/state flex items-center gap-1 bg-page-l2 rounded-lg relative", size === SWITCH_SIZES.REGULAR && "p-1.5 w-[68px] h-9", size === SWITCH_SIZES.SMALL && "p-1 w-[59px] h-7"), checked: checked, ...rest, children: [jsxRuntime.jsx(Thumb, { className: cn("absolute transition-all duration-100 rounded-sm border border-border-divider", size === SWITCH_SIZES.REGULAR &&
|
|
13407
13418
|
"size-6 left-1.5 data-[state=checked]:left-[37px]", size === SWITCH_SIZES.SMALL &&
|
|
13408
|
-
"size-5 left-1 data-[state=checked]:left-[35px]", checked ? "bg-page-accent-l0" : "bg-page-l3", thumbClassName) }), checked ? (jsxRuntime.jsx(Text, { variant: "medLabelMedCompact", className: "text-comp-mono-default py-1 px-[5px] text-left w-full", as: "div", children: "ON" })) : (jsxRuntime.jsx(Text, { variant: "medLabelMedCompact", className: "text-comp-mono-subtle-default py-1 px-0.5 text-right w-full", as: "div", children: "OFF" })), jsxRuntime.jsx(StateColorContainer, {
|
|
13419
|
+
"size-5 left-1 data-[state=checked]:left-[35px]", checked ? "bg-page-accent-l0" : "bg-page-l3", thumbClassName) }), checked ? (jsxRuntime.jsx(Text, { variant: "medLabelMedCompact", className: "text-comp-mono-default py-1 px-[5px] text-left w-full", as: "div", children: "ON" })) : (jsxRuntime.jsx(Text, { variant: "medLabelMedCompact", className: "text-comp-mono-subtle-default py-1 px-0.5 text-right w-full", as: "div", children: "OFF" })), jsxRuntime.jsx(StateColorContainer, {})] }));
|
|
13409
13420
|
};
|
|
13410
13421
|
const OutlinedSwitch = (props) => {
|
|
13411
13422
|
const { size, checked, thumbClassName, ...rest } = props;
|
|
@@ -13417,13 +13428,13 @@ const OutlinedSwitch = (props) => {
|
|
|
13417
13428
|
? "boldBodyBoldCompact"
|
|
13418
13429
|
: "boldLabelBoldCompact", className: "text-comp-accent-default pl-2 text-left", as: "div", children: "ON" })) : (jsxRuntime.jsx(Text, { variant: size === SWITCH_SIZES.REGULAR
|
|
13419
13430
|
? "medBodyMedCompact"
|
|
13420
|
-
: "medLabelMedCompact", className: cn("text-comp-mono-subtle-default text-right", size === SWITCH_SIZES.REGULAR && "pr-1.5", size === SWITCH_SIZES.SMALL && "pr-[3px]"), as: "div", children: "OFF" })), jsxRuntime.jsx(StateColorContainer, {
|
|
13431
|
+
: "medLabelMedCompact", className: cn("text-comp-mono-subtle-default text-right", size === SWITCH_SIZES.REGULAR && "pr-1.5", size === SWITCH_SIZES.SMALL && "pr-[3px]"), as: "div", children: "OFF" })), jsxRuntime.jsx(StateColorContainer, {})] }));
|
|
13421
13432
|
};
|
|
13422
13433
|
const SlideSwitch = (props) => {
|
|
13423
13434
|
const { size, checked, thumbClassName, leftIcon, rightIcon, ...rest } = props;
|
|
13424
13435
|
return (jsxRuntime.jsxs(Root, { className: cn("group/state border shadow-inner p-1 relative rounded-[20px] border-border-bound bg-page-l-null", size === SWITCH_SIZES.REGULAR && "w-[70px] h-9", size === SWITCH_SIZES.SMALL && "w-[54px] h-7"), checked: checked, ...rest, children: [jsxRuntime.jsx(Thumb, { className: cn("absolute transition-all duration-100 top-[3px] rounded-full left-1 bg-page-l3 shadow-basic border border-border-bound", size === SWITCH_SIZES.REGULAR &&
|
|
13425
13436
|
"size-7 data-[state=checked]:left-[36px]", size === SWITCH_SIZES.SMALL &&
|
|
13426
|
-
"size-5 data-[state=checked]:left-[28px]", thumbClassName) }), leftIcon && (jsxRuntime.jsx("div", { className: cn("absolute top-1/2 -translate-y-1/2 transition-opacity text-comp-mono-subtle-default", size === SWITCH_SIZES.SMALL && "left-[8px] size-4", size === SWITCH_SIZES.REGULAR && "left-[10px] size-5", checked ? "opacity-100" : "opacity-0"), children: leftIcon })), rightIcon && (jsxRuntime.jsx("div", { className: cn("absolute top-1/2 -translate-y-1/2 transition-opacity text-comp-mono-subtle-default", size === SWITCH_SIZES.SMALL && "right-[8px] size-4", size === SWITCH_SIZES.REGULAR && "right-[10px] size-5", !checked ? "opacity-100" : "opacity-0"), children: rightIcon })), jsxRuntime.jsx(StateColorContainer, {
|
|
13437
|
+
"size-5 data-[state=checked]:left-[28px]", thumbClassName) }), leftIcon && (jsxRuntime.jsx("div", { className: cn("absolute top-1/2 -translate-y-1/2 transition-opacity text-comp-mono-subtle-default", size === SWITCH_SIZES.SMALL && "left-[8px] size-4", size === SWITCH_SIZES.REGULAR && "left-[10px] size-5", checked ? "opacity-100" : "opacity-0"), children: leftIcon })), rightIcon && (jsxRuntime.jsx("div", { className: cn("absolute top-1/2 -translate-y-1/2 transition-opacity text-comp-mono-subtle-default", size === SWITCH_SIZES.SMALL && "right-[8px] size-4", size === SWITCH_SIZES.REGULAR && "right-[10px] size-5", !checked ? "opacity-100" : "opacity-0"), children: rightIcon })), jsxRuntime.jsx(StateColorContainer, {})] }));
|
|
13427
13438
|
};
|
|
13428
13439
|
const Switch = (props) => {
|
|
13429
13440
|
const { defaultChecked, checked: isChecked } = props;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export { Button } from "./button";
|
|
2
2
|
export { BUTTON_SIZES, BUTTON_VARIANTS } from "./button/types";
|
|
3
3
|
export type { ButtonSize, ButtonVariant } from "./button/types";
|
|
4
|
-
export { Text } from "./text";
|
|
5
|
-
export { TEXT_SIZES, TEXT_VARIANTS, TEXT_ALIGNMENTS, FONT_WEIGHTS, } from "./text/types";
|
|
6
|
-
export type { TextSize, FontWeight, TextAlignment, TextVariant, } from "./text/types";
|
|
7
|
-
export { Input } from "./input";
|
|
8
|
-
export { INPUT_SIZES } from "./input/types";
|
|
9
|
-
export type { InputSize } from "./input/types";
|
|
10
|
-
export { TextArea } from "./textarea";
|
|
11
4
|
export { Card, CardBody, CardContent, CardFooter, CardHeader } from "./card";
|
|
5
|
+
export { Input } from "./input";
|
|
6
|
+
export { INPUT_SIZES, INPUT_VARIANTS } from "./input/types";
|
|
7
|
+
export type { InputSize, InputVariant } from "./input/types";
|
|
8
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from "./pagination";
|
|
9
|
+
export { StateColorContainer } from "./state-color-container";
|
|
10
|
+
export type { StateGroupName } from "./state-color-container/types";
|
|
12
11
|
export { Tag } from "./tag";
|
|
13
12
|
export { TAG_SIZES, TAG_VARIANTS } from "./tag/types";
|
|
14
13
|
export type { TagSize, TagVariant } from "./tag/types";
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export type {
|
|
14
|
+
export { Text } from "./text";
|
|
15
|
+
export { FONT_WEIGHTS, TEXT_ALIGNMENTS, TEXT_SIZES, TEXT_VARIANTS, } from "./text/types";
|
|
16
|
+
export type { FontWeight, TextAlignment, TextSize, TextVariant, } from "./text/types";
|
|
17
|
+
export { TextArea } from "./textarea";
|
package/dist/cjs/index.js
CHANGED
|
@@ -3350,7 +3350,7 @@ const StateColorContainer = ({ groupName = "state", isInverted, className, }) =>
|
|
|
3350
3350
|
const group = groupName || "state";
|
|
3351
3351
|
const mode = isInverted ? "invert" : "normal";
|
|
3352
3352
|
const actionClass = fillClassMap[group]?.[mode] ?? fillClassMap.state[mode];
|
|
3353
|
-
return (jsxRuntime.jsx("div", { className: cn("absolute left-0 top-0 right-0 bottom-0 inset-0 pointer-events-none z-0", actionClass, className) }));
|
|
3353
|
+
return (jsxRuntime.jsx("div", { className: cn("absolute left-0 top-0 right-0 bottom-0 inset-0 pointer-events-none z-0 rounded-[inherit]", actionClass, className) }));
|
|
3354
3354
|
};
|
|
3355
3355
|
|
|
3356
3356
|
/**
|
|
@@ -3410,6 +3410,41 @@ const Button = react.forwardRef(({ variant = "accent", size = "regular", fullWid
|
|
|
3410
3410
|
});
|
|
3411
3411
|
Button.displayName = "Button";
|
|
3412
3412
|
|
|
3413
|
+
/**
|
|
3414
|
+
* 카드 컴포넌트는 콘텐츠를 그룹화하고 시각적으로 구분하는 데 사용됩니다.<br/>
|
|
3415
|
+
* 카드 내부에는 헤더, 본문, 푸터 등의 섹션을 포함할 수 있습니다.<br/>
|
|
3416
|
+
* content 내의 padding을 적용하기 위해서는 `CardBody` 컴포넌트를 사용해야 합니다.<br/>
|
|
3417
|
+
* 기본적으로 카드 container의 스타일은 배경색, 테두리 등을 포함합니다.<br/>
|
|
3418
|
+
* <br/>
|
|
3419
|
+
* ### 사용 예시
|
|
3420
|
+
* ```tsx
|
|
3421
|
+
* <Card>
|
|
3422
|
+
* <CardBody>
|
|
3423
|
+
* <CardHeader>카드 제목</CardHeader>
|
|
3424
|
+
* <CardContent>
|
|
3425
|
+
* 카드 내용
|
|
3426
|
+
* </CardContent>
|
|
3427
|
+
* <CardFooter>
|
|
3428
|
+
* 카드 푸터
|
|
3429
|
+
* </CardFooter>
|
|
3430
|
+
* </Card>
|
|
3431
|
+
*/
|
|
3432
|
+
const Card = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3433
|
+
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 }));
|
|
3434
|
+
});
|
|
3435
|
+
const CardBody = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3436
|
+
return (jsxRuntime.jsx("div", { ...rest, ref: ref, className: cn("p-6", className), children: rest.children }));
|
|
3437
|
+
});
|
|
3438
|
+
const CardHeader = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3439
|
+
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 }));
|
|
3440
|
+
});
|
|
3441
|
+
const CardContent = react.forwardRef((rest, ref) => {
|
|
3442
|
+
return (jsxRuntime.jsx("div", { ...rest, ref: ref, children: rest.children }));
|
|
3443
|
+
});
|
|
3444
|
+
const CardFooter = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3445
|
+
return (jsxRuntime.jsx("div", { ...rest, ref: ref, className: cn("py-4 px-6", className), children: rest.children }));
|
|
3446
|
+
});
|
|
3447
|
+
|
|
3413
3448
|
const TEXT_SIZES = {
|
|
3414
3449
|
XSMALL: "xsmall",
|
|
3415
3450
|
LABEL: "label",
|
|
@@ -3646,14 +3681,20 @@ const Text = ({ children, className, size, weight, align, variant = "regularBase
|
|
|
3646
3681
|
Text.displayName = "Text";
|
|
3647
3682
|
|
|
3648
3683
|
const INPUT_SIZES = {
|
|
3684
|
+
SMALL: "small",
|
|
3649
3685
|
REGULAR: "regular",
|
|
3650
3686
|
LARGE: "large",
|
|
3651
3687
|
};
|
|
3688
|
+
const INPUT_VARIANTS = {
|
|
3689
|
+
OUTLINED: "outlined",
|
|
3690
|
+
FILLED: "filled",
|
|
3691
|
+
};
|
|
3652
3692
|
|
|
3653
3693
|
/**
|
|
3654
3694
|
* 다양한 크기와 아이콘을 지원하는 입력 필드 컴포넌트입니다.<br/>
|
|
3655
|
-
* 사용자는 크기(size), 왼쪽 아이콘(leftIcon), 오른쪽 아이콘(rightIcon) 등을 지정할 수 있습니다.<br/>
|
|
3695
|
+
* 사용자는 크기(size), 변형(variant), 왼쪽 아이콘(leftIcon), 오른쪽 아이콘(rightIcon) 등을 지정할 수 있습니다.<br/>
|
|
3656
3696
|
* 기본적으로 regular 크기를 가지며, large 크기도 선택할 수 있습니다.<br/>
|
|
3697
|
+
* 기본적으로 outlined 변형을 가지며, filled 변형도 선택할 수 있습니다.<br/>
|
|
3657
3698
|
* input의 너비는 부모 요소에 따라 결정됩니다.<br/>
|
|
3658
3699
|
* input 자체의 클래스는 `className` 속성을 통해 추가할 수 있습니다.<br/>
|
|
3659
3700
|
* wrapperClassName을 통해 input을 감싸는 div의 클래스도 추가할 수 있습니다.<br/>
|
|
@@ -3662,6 +3703,7 @@ const INPUT_SIZES = {
|
|
|
3662
3703
|
* ```tsx
|
|
3663
3704
|
* <Input
|
|
3664
3705
|
* size="large"
|
|
3706
|
+
* variant="outlined"
|
|
3665
3707
|
* leftIcon={<SearchIcon />}
|
|
3666
3708
|
* rightIcon={<ClearIcon />}
|
|
3667
3709
|
* placeholder="Search..."
|
|
@@ -3669,7 +3711,7 @@ const INPUT_SIZES = {
|
|
|
3669
3711
|
* />
|
|
3670
3712
|
* ```
|
|
3671
3713
|
*/
|
|
3672
|
-
const Input = react.forwardRef(({ size = "regular", leftIcon, rightIcon, wrapperClassName, isError = false, useHoverStyle = true, errorMessage, useIndicator = false, ...rest }, ref) => {
|
|
3714
|
+
const Input = react.forwardRef(({ size = "regular", variant = "outlined", leftIcon, rightIcon, wrapperClassName, isError = false, useHoverStyle = true, errorMessage, useIndicator = false, ...rest }, ref) => {
|
|
3673
3715
|
const innerRef = react.useRef(null);
|
|
3674
3716
|
const mergedRef = (node) => {
|
|
3675
3717
|
if (typeof ref === "function")
|
|
@@ -3678,13 +3720,17 @@ const Input = react.forwardRef(({ size = "regular", leftIcon, rightIcon, wrapper
|
|
|
3678
3720
|
ref.current = node;
|
|
3679
3721
|
innerRef.current = node;
|
|
3680
3722
|
};
|
|
3681
|
-
return (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsxs("div", { "aria-disabled": rest.disabled, className: cn("relative group/state flex items-center justify-center rounded-lg bg-Page-l-null border
|
|
3723
|
+
return (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsxs("div", { "aria-disabled": rest.disabled, className: cn("relative group/state flex items-center justify-center rounded-lg border bg-Page-l-null border-border-bound focus-within:border-border-focused has-[input:disabled]:border-transparent", variant === INPUT_VARIANTS.OUTLINED &&
|
|
3724
|
+
"border border-border-bound focus-within:border-border-focused", variant === INPUT_VARIANTS.FILLED &&
|
|
3725
|
+
"bg-page-l3 border-transparent focus-within:border-transparent", size === INPUT_SIZES.SMALL &&
|
|
3726
|
+
"py-1.5 px-2 text-label leading-label-compact font-medium gap-1", size === INPUT_SIZES.REGULAR &&
|
|
3682
3727
|
"py-1.5 px-2 text-body leading-body-compact font-medium gap-2", size === INPUT_SIZES.LARGE &&
|
|
3683
3728
|
"py-[11px] px-4 text-base leading-base-compact font-medium gap-3", isError &&
|
|
3684
3729
|
"border-comp-chroma-error focus-within:border-comp-chroma-error", wrapperClassName), onClick: () => {
|
|
3685
3730
|
innerRef.current?.focus();
|
|
3686
3731
|
}, children: [jsxRuntime.jsx(StateColorContainer, { className: cn("group-focus-within/state:bg-page-l-null", (!useHoverStyle || rest.disabled) && "hover:bg-fill-default") }), leftIcon && (jsxRuntime.jsx("div", { className: cn("flex items-center justify-center text-comp-mono-default", isError && "text-comp-chroma-error"), children: leftIcon })), jsxRuntime.jsx("input", { ref: mergedRef, className: cn("border-none outline-none p-0 flex-1 bg-transparent min-w-0 text-comp-mono-default placeholder:text-comp-mono-subtle-default focus:placeholder:text-comp-mono-subtle-selected disabled:text-comp-disabled disabled:placeholder:text-comp-disabled", useHoverStyle &&
|
|
3687
|
-
"hover:placeholder:text-comp-mono-subtle-hovered", size === INPUT_SIZES.
|
|
3732
|
+
"hover:placeholder:text-comp-mono-subtle-hovered", size === INPUT_SIZES.SMALL &&
|
|
3733
|
+
"text-label leading-label-compact font-medium", size === INPUT_SIZES.REGULAR &&
|
|
3688
3734
|
"text-body leading-body-compact font-medium", size === INPUT_SIZES.LARGE &&
|
|
3689
3735
|
"text-base leading-base-compact font-medium", isError &&
|
|
3690
3736
|
"placeholder:text-comp-chroma-error text-comp-chroma-error hover:placeholder:text-comp-error focus:placeholder:text-comp-error", rest.type === "number" &&
|
|
@@ -3693,62 +3739,6 @@ const Input = react.forwardRef(({ size = "regular", leftIcon, rightIcon, wrapper
|
|
|
3693
3739
|
});
|
|
3694
3740
|
Input.displayName = "Input";
|
|
3695
3741
|
|
|
3696
|
-
/**
|
|
3697
|
-
* 텍스트 영역 컴포넌트입니다.<br/>
|
|
3698
|
-
* 사용자는 크기, disabled 상태 등을 지정할 수 있습니다.<br/>
|
|
3699
|
-
* 기본적으로 regular 크기를 가지며, disabled 상태에서는 스타일이 변경됩니다.<br/>
|
|
3700
|
-
* 텍스트 영역의 너비는 부모 요소에 따라 결정됩니다.<br/>
|
|
3701
|
-
* className 속성을 통해 추가적인 스타일을 적용할 수 있습니다.<br/>
|
|
3702
|
-
* <br/>
|
|
3703
|
-
* ### 사용 예시
|
|
3704
|
-
* ```tsx
|
|
3705
|
-
* <TextArea
|
|
3706
|
-
* placeholder="Enter your text here..."
|
|
3707
|
-
* className="custom-textarea"
|
|
3708
|
-
* disabled={false}
|
|
3709
|
-
* />
|
|
3710
|
-
* ```
|
|
3711
|
-
*/
|
|
3712
|
-
const TextArea = react.forwardRef((rest, ref) => {
|
|
3713
|
-
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 }) }));
|
|
3714
|
-
});
|
|
3715
|
-
TextArea.displayName = "TextArea";
|
|
3716
|
-
|
|
3717
|
-
/**
|
|
3718
|
-
* 카드 컴포넌트는 콘텐츠를 그룹화하고 시각적으로 구분하는 데 사용됩니다.<br/>
|
|
3719
|
-
* 카드 내부에는 헤더, 본문, 푸터 등의 섹션을 포함할 수 있습니다.<br/>
|
|
3720
|
-
* content 내의 padding을 적용하기 위해서는 `CardBody` 컴포넌트를 사용해야 합니다.<br/>
|
|
3721
|
-
* 기본적으로 카드 container의 스타일은 배경색, 테두리 등을 포함합니다.<br/>
|
|
3722
|
-
* <br/>
|
|
3723
|
-
* ### 사용 예시
|
|
3724
|
-
* ```tsx
|
|
3725
|
-
* <Card>
|
|
3726
|
-
* <CardBody>
|
|
3727
|
-
* <CardHeader>카드 제목</CardHeader>
|
|
3728
|
-
* <CardContent>
|
|
3729
|
-
* 카드 내용
|
|
3730
|
-
* </CardContent>
|
|
3731
|
-
* <CardFooter>
|
|
3732
|
-
* 카드 푸터
|
|
3733
|
-
* </CardFooter>
|
|
3734
|
-
* </Card>
|
|
3735
|
-
*/
|
|
3736
|
-
const Card = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3737
|
-
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 }));
|
|
3738
|
-
});
|
|
3739
|
-
const CardBody = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3740
|
-
return (jsxRuntime.jsx("div", { ...rest, ref: ref, className: cn("p-6", className), children: rest.children }));
|
|
3741
|
-
});
|
|
3742
|
-
const CardHeader = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3743
|
-
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 }));
|
|
3744
|
-
});
|
|
3745
|
-
const CardContent = react.forwardRef((rest, ref) => {
|
|
3746
|
-
return (jsxRuntime.jsx("div", { ...rest, ref: ref, children: rest.children }));
|
|
3747
|
-
});
|
|
3748
|
-
const CardFooter = react.forwardRef(({ className, ...rest }, ref) => {
|
|
3749
|
-
return (jsxRuntime.jsx("div", { ...rest, ref: ref, className: cn("py-4 px-6", className), children: rest.children }));
|
|
3750
|
-
});
|
|
3751
|
-
|
|
3752
3742
|
/**
|
|
3753
3743
|
* @license lucide-react v0.513.0 - ISC
|
|
3754
3744
|
*
|
|
@@ -3909,6 +3899,28 @@ const __iconNode = [
|
|
|
3909
3899
|
];
|
|
3910
3900
|
const X = createLucideIcon("x", __iconNode);
|
|
3911
3901
|
|
|
3902
|
+
const Pagination = ({ className, ...rest }) => {
|
|
3903
|
+
return (jsxRuntime.jsx("nav", { role: "navigation", "aria-label": "pagination", "data-slot": "pagination", className: cn("mx-auto my-0 flex justify-center w-full", className), ...rest }));
|
|
3904
|
+
};
|
|
3905
|
+
const PaginationContent = ({ className, ...rest }) => {
|
|
3906
|
+
return (jsxRuntime.jsx("ul", { "data-slot": "pagination-content", className: cn("flex flex-row items-center gap-1", className), ...rest }));
|
|
3907
|
+
};
|
|
3908
|
+
const PaginationItem = (props) => {
|
|
3909
|
+
return jsxRuntime.jsx("li", { "data-slot": "pagination-item", ...props });
|
|
3910
|
+
};
|
|
3911
|
+
const PaginationLink = ({ className, isActive, size = "regular", variant = "ghost", ...rest }) => {
|
|
3912
|
+
return (jsxRuntime.jsx(Button, { "aria-current": isActive ? "page" : undefined, "data-slot": "pagination-link", "data-active": isActive, size: size, variant: variant, className: cn("h-9 min-h-9", isActive && "bg-fill-selected text-comp-mono-default", className), ...rest }));
|
|
3913
|
+
};
|
|
3914
|
+
const PaginationPrevious = ({ className, ...rest }) => {
|
|
3915
|
+
return (jsxRuntime.jsx(PaginationLink, { "aria-label": "Go to previous page", className: cn("flex items-center justify-center mr-4", className), leftIcon: jsxRuntime.jsx(ChevronLeft, { size: 20 }), ...rest }));
|
|
3916
|
+
};
|
|
3917
|
+
const PaginationNext = ({ className, ...rest }) => {
|
|
3918
|
+
return (jsxRuntime.jsx(PaginationLink, { "aria-label": "Go to next page", className: cn("ml-4", className), leftIcon: jsxRuntime.jsx(ChevronRight, { size: 20 }), ...rest }));
|
|
3919
|
+
};
|
|
3920
|
+
const PaginationEllipsis = ({ className, ...rest }) => {
|
|
3921
|
+
return (jsxRuntime.jsx("span", { "aria-hidden": true, "data-slot": "pagination-ellipsis", className: cn("flex items-center justify-center size-9 rounded-md hover:bg-fill-mono-hovered", className), ...rest, children: jsxRuntime.jsx(Ellipsis, { className: "size-4 stroke-comp-mono-subtle-default" }) }));
|
|
3922
|
+
};
|
|
3923
|
+
|
|
3912
3924
|
const Tag = react.forwardRef(({ icon, value, variant = "filled", size = "regular", className, onDeleteClick, onClick, useSelectedStyle = false, ...props }, ref) => {
|
|
3913
3925
|
const [isSelected, setIsSelected] = react.useState(false);
|
|
3914
3926
|
const handleClick = (event) => {
|
|
@@ -3924,7 +3936,7 @@ const Tag = react.forwardRef(({ icon, value, variant = "filled", size = "regular
|
|
|
3924
3936
|
`bg-page-l4 text-comp-mono-subtle-default data-disabled:text-comp-disabled data-disabled:bg-page-l-null`, variant === "accent" &&
|
|
3925
3937
|
`bg-page-accent-l0 text-comp-accent-default data-disabled:text-comp-disabled data-disabled:bg-page-l-null`, size === "regular" &&
|
|
3926
3938
|
"text-body font-medium leading-body-compact px-2 py-1 gap-2", size === "small" &&
|
|
3927
|
-
"text-label font-medium leading-label-compact px-1.5 py-0.5 gap-1.5", className), onClick: handleClick, "data-selected": isSelected, "aria-selected": isSelected, ...props, children: [icon && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-4 border-none bg-transparent outline-none p-0", children: icon })), jsxRuntime.jsx("span", { className: "flex-1 text-nowrap overflow-hidden text-ellipsis text-inherit text-size-inherit leading-inherit font-inherit", children: value.label }), onDeleteClick && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-4 border-none bg-transparent outline-none p-0 cursor-pointer text-comp-mono-default group-disabled/state:text-comp-disabled", onClick: handleDeleteClick, children: jsxRuntime.jsx(X, {}) })), jsxRuntime.jsx(StateColorContainer, { className: cn(
|
|
3939
|
+
"text-label font-medium leading-label-compact px-1.5 py-0.5 gap-1.5", className), onClick: handleClick, "data-selected": isSelected, "aria-selected": isSelected, ...props, children: [icon && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-4 border-none bg-transparent outline-none p-0", children: icon })), jsxRuntime.jsx("span", { className: "flex-1 text-nowrap overflow-hidden text-ellipsis text-inherit text-size-inherit leading-inherit font-inherit", children: value.label }), onDeleteClick && (jsxRuntime.jsx("span", { className: "flex items-center justify-center size-4 border-none bg-transparent outline-none p-0 cursor-pointer text-comp-mono-default group-disabled/state:text-comp-disabled", onClick: handleDeleteClick, children: jsxRuntime.jsx(X, {}) })), jsxRuntime.jsx(StateColorContainer, { className: cn(useSelectedStyle
|
|
3928
3940
|
? ""
|
|
3929
3941
|
: "group-active/state:bg-fill-default group-active/state:border-transparent group-disabled/state:bg-fill-default"), isInverted: variant === "accent" })] }));
|
|
3930
3942
|
});
|
|
@@ -3939,27 +3951,26 @@ const TAG_SIZES = {
|
|
|
3939
3951
|
SMALL: "small",
|
|
3940
3952
|
};
|
|
3941
3953
|
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
};
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
};
|
|
3954
|
+
/**
|
|
3955
|
+
* 텍스트 영역 컴포넌트입니다.<br/>
|
|
3956
|
+
* 사용자는 크기, disabled 상태 등을 지정할 수 있습니다.<br/>
|
|
3957
|
+
* 기본적으로 regular 크기를 가지며, disabled 상태에서는 스타일이 변경됩니다.<br/>
|
|
3958
|
+
* 텍스트 영역의 너비는 부모 요소에 따라 결정됩니다.<br/>
|
|
3959
|
+
* className 속성을 통해 추가적인 스타일을 적용할 수 있습니다.<br/>
|
|
3960
|
+
* <br/>
|
|
3961
|
+
* ### 사용 예시
|
|
3962
|
+
* ```tsx
|
|
3963
|
+
* <TextArea
|
|
3964
|
+
* placeholder="Enter your text here..."
|
|
3965
|
+
* className="custom-textarea"
|
|
3966
|
+
* disabled={false}
|
|
3967
|
+
* />
|
|
3968
|
+
* ```
|
|
3969
|
+
*/
|
|
3970
|
+
const TextArea = react.forwardRef((rest, ref) => {
|
|
3971
|
+
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 }) }));
|
|
3972
|
+
});
|
|
3973
|
+
TextArea.displayName = "TextArea";
|
|
3963
3974
|
|
|
3964
3975
|
exports.BUTTON_SIZES = BUTTON_SIZES;
|
|
3965
3976
|
exports.BUTTON_VARIANTS = BUTTON_VARIANTS;
|
|
@@ -3971,6 +3982,7 @@ exports.CardFooter = CardFooter;
|
|
|
3971
3982
|
exports.CardHeader = CardHeader;
|
|
3972
3983
|
exports.FONT_WEIGHTS = FONT_WEIGHTS;
|
|
3973
3984
|
exports.INPUT_SIZES = INPUT_SIZES;
|
|
3985
|
+
exports.INPUT_VARIANTS = INPUT_VARIANTS;
|
|
3974
3986
|
exports.Input = Input;
|
|
3975
3987
|
exports.Pagination = Pagination;
|
|
3976
3988
|
exports.PaginationContent = PaginationContent;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
import { InputSize } from "./types";
|
|
2
|
+
import { InputSize, InputVariant } from "./types";
|
|
3
3
|
export interface InputProps extends React.DetailedHTMLProps<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, HTMLInputElement> {
|
|
4
4
|
size?: InputSize;
|
|
5
|
+
variant?: InputVariant;
|
|
5
6
|
leftIcon?: ReactNode;
|
|
6
7
|
rightIcon?: ReactNode;
|
|
7
8
|
wrapperClassName?: string;
|
|
@@ -12,8 +13,9 @@ export interface InputProps extends React.DetailedHTMLProps<Omit<React.InputHTML
|
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* 다양한 크기와 아이콘을 지원하는 입력 필드 컴포넌트입니다.<br/>
|
|
15
|
-
* 사용자는 크기(size), 왼쪽 아이콘(leftIcon), 오른쪽 아이콘(rightIcon) 등을 지정할 수 있습니다.<br/>
|
|
16
|
+
* 사용자는 크기(size), 변형(variant), 왼쪽 아이콘(leftIcon), 오른쪽 아이콘(rightIcon) 등을 지정할 수 있습니다.<br/>
|
|
16
17
|
* 기본적으로 regular 크기를 가지며, large 크기도 선택할 수 있습니다.<br/>
|
|
18
|
+
* 기본적으로 outlined 변형을 가지며, filled 변형도 선택할 수 있습니다.<br/>
|
|
17
19
|
* input의 너비는 부모 요소에 따라 결정됩니다.<br/>
|
|
18
20
|
* input 자체의 클래스는 `className` 속성을 통해 추가할 수 있습니다.<br/>
|
|
19
21
|
* wrapperClassName을 통해 input을 감싸는 div의 클래스도 추가할 수 있습니다.<br/>
|
|
@@ -22,6 +24,7 @@ export interface InputProps extends React.DetailedHTMLProps<Omit<React.InputHTML
|
|
|
22
24
|
* ```tsx
|
|
23
25
|
* <Input
|
|
24
26
|
* size="large"
|
|
27
|
+
* variant="outlined"
|
|
25
28
|
* leftIcon={<SearchIcon />}
|
|
26
29
|
* rightIcon={<ClearIcon />}
|
|
27
30
|
* placeholder="Search..."
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export declare const INPUT_SIZES: {
|
|
2
|
+
readonly SMALL: "small";
|
|
2
3
|
readonly REGULAR: "regular";
|
|
3
4
|
readonly LARGE: "large";
|
|
4
5
|
};
|
|
5
6
|
export type InputSize = (typeof INPUT_SIZES)[keyof typeof INPUT_SIZES];
|
|
7
|
+
export declare const INPUT_VARIANTS: {
|
|
8
|
+
readonly OUTLINED: "outlined";
|
|
9
|
+
readonly FILLED: "filled";
|
|
10
|
+
};
|
|
11
|
+
export type InputVariant = (typeof INPUT_VARIANTS)[keyof typeof INPUT_VARIANTS];
|