@telepix-lab/telepix-ui 0.4.12 → 0.5.0
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/button/types.d.ts +3 -0
- package/dist/cjs/client.js +293 -230
- package/dist/cjs/index.js +68 -18
- package/dist/cjs/input/index.d.ts +3 -0
- package/dist/cjs/switch/index.d.ts +3 -0
- package/dist/cjs/switch/types.d.ts +1 -0
- package/dist/cjs/tag/index.d.ts +1 -0
- package/dist/client.d.ts +3 -0
- package/dist/color.css +1 -1
- package/dist/esm/button/types.d.ts +3 -0
- package/dist/esm/client.js +294 -231
- package/dist/esm/index.js +68 -18
- package/dist/esm/input/index.d.ts +3 -0
- package/dist/esm/switch/index.d.ts +3 -0
- package/dist/esm/switch/types.d.ts +1 -0
- package/dist/esm/tag/index.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/styles.css +9 -9
- package/package.json +1 -1
|
@@ -8,5 +8,8 @@ export declare const BUTTON_VARIANTS: {
|
|
|
8
8
|
readonly ACCENT: "accent";
|
|
9
9
|
readonly OUTLINE: "outline";
|
|
10
10
|
readonly GHOST: "ghost";
|
|
11
|
+
readonly THUMBNAIL_GHOST: "thumbnail_ghost";
|
|
12
|
+
readonly SUBTLE_FILLED: "subtle_filled";
|
|
13
|
+
readonly ACCENT_GHOST: "accent_ghost";
|
|
11
14
|
};
|
|
12
15
|
export type ButtonVariant = (typeof BUTTON_VARIANTS)[keyof typeof BUTTON_VARIANTS];
|
package/dist/cjs/client.js
CHANGED
|
@@ -12381,7 +12381,7 @@ const DialogTrigger = (props) => {
|
|
|
12381
12381
|
const DialogPortal = Portal$3;
|
|
12382
12382
|
const DialogClose = Close;
|
|
12383
12383
|
const DialogContent = ({ className, overlayClassName, children, ...rest }) => {
|
|
12384
|
-
return (jsxRuntime.jsxs(Portal$3, { children: [jsxRuntime.jsx(Overlay, { className: cn("fixed top-0 bottom-0 left-0 right-0 bg-pure-black-50 inset-0 z-[1000] animate-fade-in", overlayClassName) }), jsxRuntime.jsxs(Content$1, { className: cn("fixed top-1/2 left-1/2 z-[1001]
|
|
12384
|
+
return (jsxRuntime.jsxs(Portal$3, { children: [jsxRuntime.jsx(Overlay, { className: cn("fixed top-0 bottom-0 left-0 right-0 bg-pure-black-50 inset-0 z-[1000] animate-fade-in", overlayClassName) }), jsxRuntime.jsxs(Content$1, { className: cn("fixed top-1/2 left-1/2 z-[1001] animate-content-fade-in", className), ...rest, children: [jsxRuntime.jsx(Title, { "data-slot": "dialog-title", ...rest, children: jsxRuntime.jsx(Root$4, {}) }), jsxRuntime.jsx(Description, {}), jsxRuntime.jsx(Card, { children: children })] })] }));
|
|
12385
12385
|
};
|
|
12386
12386
|
const DialogDescription = (props) => {
|
|
12387
12387
|
return jsxRuntime.jsx(CardBody, { ...props, children: props.children });
|
|
@@ -12624,10 +12624,11 @@ const TooltipFooter = React.forwardRef((props, ref) => {
|
|
|
12624
12624
|
return (jsxRuntime.jsx("div", { className: cn("flex items-center justify-between pt-4", className), ...otherProps, ref: ref, children: props.children }));
|
|
12625
12625
|
});
|
|
12626
12626
|
|
|
12627
|
-
const Tag = React.forwardRef(({ icon, value, variant = "filled", size = "regular", className, onDeleteClick, onClick, ...props }, ref) => {
|
|
12627
|
+
const Tag = React.forwardRef(({ icon, value, variant = "filled", size = "regular", className, onDeleteClick, onClick, useSelectedStyle = false, ...props }, ref) => {
|
|
12628
12628
|
const [isSelected, setIsSelected] = React.useState(false);
|
|
12629
12629
|
const handleClick = (event) => {
|
|
12630
|
-
|
|
12630
|
+
if (useSelectedStyle)
|
|
12631
|
+
setIsSelected((prev) => !prev);
|
|
12631
12632
|
onClick?.(event);
|
|
12632
12633
|
};
|
|
12633
12634
|
const handleDeleteClick = (event) => {
|
|
@@ -12637,13 +12638,15 @@ const Tag = React.forwardRef(({ icon, value, variant = "filled", size = "regular
|
|
|
12637
12638
|
return (jsxRuntime.jsxs("button", { ref: ref, className: cn("flex items-center justify-center rounded-sm bg-transparent", variant === "filled" &&
|
|
12638
12639
|
`bg-fill-mono-subtle-default text-comp-mono-subtle-default border border-fill-mono-subtle-default
|
|
12639
12640
|
hover:bg-fill-mono-subtle-hovered hover:comp-mono-subtle-hovered hover:border-fill-mono-subtle-hovered
|
|
12640
|
-
active:fill-mono-subtle-pressed active:comp-mono-subtle-pressed active:border-fill-mono-subtle-pressed
|
|
12641
12641
|
disabled:bg-fill-disabled disabled:text-comp-disabled disabled:border-fill-disabled`, variant === "filled" &&
|
|
12642
|
+
useSelectedStyle &&
|
|
12643
|
+
"active:fill-mono-subtle-pressed active:comp-mono-subtle-pressed active:border-fill-mono-subtle-pressed", variant === "filled" &&
|
|
12642
12644
|
isSelected &&
|
|
12643
12645
|
`bg-fill-mono-subtle-selected text-comp-mono-subtle-selected border-border-selected`, variant === "accent" &&
|
|
12644
12646
|
`bg-fill-accent-default text-comp-accent-default hover:bg-fill-accent-hovered hover:text-comp-accent-hovered
|
|
12645
|
-
active:bg-fill-accent-pressed active:text-comp-accent-pressed
|
|
12646
12647
|
disabled:bg-fill-disabled disabled:text-comp-disabled`, variant === "accent" &&
|
|
12648
|
+
useSelectedStyle &&
|
|
12649
|
+
"active:bg-fill-accent-pressed active:text-comp-accent-pressed", variant === "accent" &&
|
|
12647
12650
|
isSelected &&
|
|
12648
12651
|
`bg-fill-accent-selected text-comp-accent-selected`, size === "regular" &&
|
|
12649
12652
|
"text-body font-medium leading-body-compact px-1 py-0.5 gap-2", size === "small" &&
|
|
@@ -12656,6 +12659,199 @@ const INPUT_SIZES = {
|
|
|
12656
12659
|
LARGE: "large",
|
|
12657
12660
|
};
|
|
12658
12661
|
|
|
12662
|
+
const TEXT_VARIANTS = {
|
|
12663
|
+
BOLD3XLARGEBOLD: "bold3XLargeBold",
|
|
12664
|
+
BOLD2XLARGEBOLDCOMPACT: "bold2XLargeBoldCompact",
|
|
12665
|
+
BOLD2XLARGEBOLD: "bold2XLargeBold",
|
|
12666
|
+
BOLDXLARGEBOLDCOMPACT: "boldXLargeBoldCompact",
|
|
12667
|
+
BOLDXLARGEBOLD: "boldXLargeBold",
|
|
12668
|
+
BOLDLARGEBOLDCOMPACT: "boldLargeBoldCompact",
|
|
12669
|
+
BOLDLARGEBOLD: "boldLargeBold",
|
|
12670
|
+
BOLDBASEBOLDCOMPACT: "boldBaseBoldCompact",
|
|
12671
|
+
BOLDBASEBOLD: "boldBaseBold",
|
|
12672
|
+
BOLDBODYBOLDCOMPACT: "boldBodyBoldCompact",
|
|
12673
|
+
BOLDBODYBOLD: "boldBodyBold",
|
|
12674
|
+
BOLDLABELBOLDCOMPACT: "boldLabelBoldCompact",
|
|
12675
|
+
BOLDLABELBOLD: "boldLabelBold",
|
|
12676
|
+
BOLDXSMALLBOLD: "boldXSmallBold",
|
|
12677
|
+
SEMIBOLDBASESEMIBOLDCOMPACT: "semiBoldBaseSemiBoldCompact",
|
|
12678
|
+
SEMIBOLDBASESEMIBOLD: "semiBoldBaseSemiBold",
|
|
12679
|
+
SEMIBOLDBODYSEMIBOLDCOMPACT: "semiBoldBodySemiBoldCompact",
|
|
12680
|
+
SEMIBOLDBODYSEMIBOLD: "semiBoldBodySemiBold",
|
|
12681
|
+
SEMIBOLDLABELSEMIBOLDCOMPACT: "semiBoldLabelSemiBoldCompact",
|
|
12682
|
+
MED3XLARGEMED: "med3XLargeMed",
|
|
12683
|
+
MEDXLARGEMED: "medXLargeMed",
|
|
12684
|
+
MEDLARGEMED: "medLargeMed",
|
|
12685
|
+
MEDBASEMEDCOMPACT: "medBaseMedCompact",
|
|
12686
|
+
MEDBASEMED: "medBaseMed",
|
|
12687
|
+
MEDBODYMEDCOMPACT: "medBodyMedCompact",
|
|
12688
|
+
MEDBODYMED: "medBodyMed",
|
|
12689
|
+
MEDLABELMEDCOMPACT: "medLabelMedCompact",
|
|
12690
|
+
MEDLABELMED: "medLabelMed",
|
|
12691
|
+
MEDXSMALLMED: "medXSmallMed",
|
|
12692
|
+
REGULAR3XLARGE: "regular3XLarge",
|
|
12693
|
+
REGULAR2XLARGE: "regular2XLarge",
|
|
12694
|
+
REGULARXLARGE: "regularXLarge",
|
|
12695
|
+
REGULARLARGECOMPACT: "regularLargeCompact",
|
|
12696
|
+
REGULARLARGE: "regularLarge",
|
|
12697
|
+
REGULARBASECOMPACT: "regularBaseCompact",
|
|
12698
|
+
REGULARBASE: "regularBase",
|
|
12699
|
+
REGULARBODYCOMPACT: "regularBodyCompact",
|
|
12700
|
+
REGULARBODY: "regularBody",
|
|
12701
|
+
REGULARLABELCOMPACT: "regularLabelCompact",
|
|
12702
|
+
REGULARLABEL: "regularLabel",
|
|
12703
|
+
REGULARXSMALL: "regularXSmall",
|
|
12704
|
+
};
|
|
12705
|
+
|
|
12706
|
+
const Text = ({ children, className, size, weight, align, variant = "regularBase", color, as: Component = "p", }) => {
|
|
12707
|
+
const getFontWeightClass = (weight) => {
|
|
12708
|
+
switch (weight) {
|
|
12709
|
+
case "bold":
|
|
12710
|
+
return "font-bold";
|
|
12711
|
+
case "semibold":
|
|
12712
|
+
return "font-semibold";
|
|
12713
|
+
case "medium":
|
|
12714
|
+
return "font-medium";
|
|
12715
|
+
case "regular":
|
|
12716
|
+
return "font-normal";
|
|
12717
|
+
case "light":
|
|
12718
|
+
return "font-light";
|
|
12719
|
+
case "extralight":
|
|
12720
|
+
return "font-extralight";
|
|
12721
|
+
case "thin":
|
|
12722
|
+
return "font-thin";
|
|
12723
|
+
default:
|
|
12724
|
+
return "font-normal";
|
|
12725
|
+
}
|
|
12726
|
+
};
|
|
12727
|
+
const getSizeClass = (size) => {
|
|
12728
|
+
switch (size) {
|
|
12729
|
+
case "xxxl":
|
|
12730
|
+
return "text-xxxl";
|
|
12731
|
+
case "xxl":
|
|
12732
|
+
return "text-xxl";
|
|
12733
|
+
case "xl":
|
|
12734
|
+
return "text-xl";
|
|
12735
|
+
case "large":
|
|
12736
|
+
return "text-large";
|
|
12737
|
+
case "base":
|
|
12738
|
+
return "text-base";
|
|
12739
|
+
case "body":
|
|
12740
|
+
return "text-body";
|
|
12741
|
+
case "label":
|
|
12742
|
+
return "text-label";
|
|
12743
|
+
case "xsmall":
|
|
12744
|
+
return "text-xsmall";
|
|
12745
|
+
default:
|
|
12746
|
+
return "text-base";
|
|
12747
|
+
}
|
|
12748
|
+
};
|
|
12749
|
+
const getAlignClass = (align) => {
|
|
12750
|
+
switch (align) {
|
|
12751
|
+
case "left":
|
|
12752
|
+
return "text-left";
|
|
12753
|
+
case "center":
|
|
12754
|
+
return "text-center";
|
|
12755
|
+
case "right":
|
|
12756
|
+
return "text-right";
|
|
12757
|
+
case "justify":
|
|
12758
|
+
return "text-justify";
|
|
12759
|
+
default:
|
|
12760
|
+
return "text-left";
|
|
12761
|
+
}
|
|
12762
|
+
};
|
|
12763
|
+
const getVariantClass = (variant) => {
|
|
12764
|
+
switch (variant) {
|
|
12765
|
+
case TEXT_VARIANTS.BOLD3XLARGEBOLD:
|
|
12766
|
+
return "text-xxxl font-bold leading-xxxl";
|
|
12767
|
+
case TEXT_VARIANTS.BOLD2XLARGEBOLDCOMPACT:
|
|
12768
|
+
return "text-xxl font-bold leading-xxl-compact";
|
|
12769
|
+
case TEXT_VARIANTS.BOLD2XLARGEBOLD:
|
|
12770
|
+
return "text-xxl font-bold leading-xxl";
|
|
12771
|
+
case TEXT_VARIANTS.BOLDXLARGEBOLDCOMPACT:
|
|
12772
|
+
return "text-xl font-bold leading-xl-compact";
|
|
12773
|
+
case TEXT_VARIANTS.BOLDXLARGEBOLD:
|
|
12774
|
+
return "text-xl font-bold leading-xl";
|
|
12775
|
+
case TEXT_VARIANTS.BOLDLARGEBOLDCOMPACT:
|
|
12776
|
+
return "text-large font-bold leading-large-compact";
|
|
12777
|
+
case TEXT_VARIANTS.BOLDLARGEBOLD:
|
|
12778
|
+
return "text-large font-bold leading-large";
|
|
12779
|
+
case TEXT_VARIANTS.BOLDBASEBOLDCOMPACT:
|
|
12780
|
+
return "text-base font-bold leading-base-compact";
|
|
12781
|
+
case TEXT_VARIANTS.BOLDBASEBOLD:
|
|
12782
|
+
return "text-base font-bold leading-base";
|
|
12783
|
+
case TEXT_VARIANTS.BOLDBODYBOLDCOMPACT:
|
|
12784
|
+
return "text-body font-bold leading-body-compact";
|
|
12785
|
+
case TEXT_VARIANTS.BOLDBODYBOLD:
|
|
12786
|
+
return "text-body font-bold leading-body";
|
|
12787
|
+
case TEXT_VARIANTS.BOLDLABELBOLDCOMPACT:
|
|
12788
|
+
return "text-label font-bold leading-label-compact";
|
|
12789
|
+
case TEXT_VARIANTS.BOLDLABELBOLD:
|
|
12790
|
+
return "text-label font-bold leading-label";
|
|
12791
|
+
case TEXT_VARIANTS.BOLDXSMALLBOLD:
|
|
12792
|
+
return "text-xsmall font-bold leading-xsmall";
|
|
12793
|
+
case TEXT_VARIANTS.SEMIBOLDBASESEMIBOLDCOMPACT:
|
|
12794
|
+
return "text-base font-semibold leading-base-compact";
|
|
12795
|
+
case TEXT_VARIANTS.SEMIBOLDBASESEMIBOLD:
|
|
12796
|
+
return "text-base font-semibold leading-base";
|
|
12797
|
+
case TEXT_VARIANTS.SEMIBOLDBODYSEMIBOLDCOMPACT:
|
|
12798
|
+
return "text-body font-semibold leading-body-compact";
|
|
12799
|
+
case TEXT_VARIANTS.SEMIBOLDBODYSEMIBOLD:
|
|
12800
|
+
return "text-body font-semibold leading-body";
|
|
12801
|
+
case TEXT_VARIANTS.SEMIBOLDLABELSEMIBOLDCOMPACT:
|
|
12802
|
+
return "text-label font-semibold leading-label-compact";
|
|
12803
|
+
case TEXT_VARIANTS.MED3XLARGEMED:
|
|
12804
|
+
return "text-xxxl font-medium leading-xxxl";
|
|
12805
|
+
case TEXT_VARIANTS.MEDXLARGEMED:
|
|
12806
|
+
return "text-xl font-medium leading-xl";
|
|
12807
|
+
case TEXT_VARIANTS.MEDLARGEMED:
|
|
12808
|
+
return "text-large font-medium leading-large";
|
|
12809
|
+
case TEXT_VARIANTS.MEDBASEMEDCOMPACT:
|
|
12810
|
+
return "text-base font-medium leading-base-compact";
|
|
12811
|
+
case TEXT_VARIANTS.MEDBASEMED:
|
|
12812
|
+
return "text-base font-medium leading-base";
|
|
12813
|
+
case TEXT_VARIANTS.MEDBODYMEDCOMPACT:
|
|
12814
|
+
return "text-body font-medium leading-body-compact";
|
|
12815
|
+
case TEXT_VARIANTS.MEDBODYMED:
|
|
12816
|
+
return "text-body font-medium leading-body";
|
|
12817
|
+
case TEXT_VARIANTS.MEDLABELMEDCOMPACT:
|
|
12818
|
+
return "text-label font-medium leading-label-compact";
|
|
12819
|
+
case TEXT_VARIANTS.MEDLABELMED:
|
|
12820
|
+
return "text-label font-medium leading-label";
|
|
12821
|
+
case TEXT_VARIANTS.MEDXSMALLMED:
|
|
12822
|
+
return "text-xsmall font-medium leading-xsmall";
|
|
12823
|
+
case TEXT_VARIANTS.REGULAR3XLARGE:
|
|
12824
|
+
return "text-xxxl font-normal leading-xxxl";
|
|
12825
|
+
case TEXT_VARIANTS.REGULAR2XLARGE:
|
|
12826
|
+
return "text-xxl font-normal leading-xxl";
|
|
12827
|
+
case TEXT_VARIANTS.REGULARXLARGE:
|
|
12828
|
+
return "text-xl font-normal leading-xl";
|
|
12829
|
+
case TEXT_VARIANTS.REGULARLARGE:
|
|
12830
|
+
return "text-large font-normal leading-large";
|
|
12831
|
+
case TEXT_VARIANTS.REGULARLARGECOMPACT:
|
|
12832
|
+
return "text-large font-normal leading-large-compact";
|
|
12833
|
+
case TEXT_VARIANTS.REGULARBASE:
|
|
12834
|
+
return "text-base font-normal leading-base";
|
|
12835
|
+
case TEXT_VARIANTS.REGULARBASECOMPACT:
|
|
12836
|
+
return "text-base font-normal leading-base-compact";
|
|
12837
|
+
case TEXT_VARIANTS.REGULARBODY:
|
|
12838
|
+
return "text-body font-normal leading-body";
|
|
12839
|
+
case TEXT_VARIANTS.REGULARBODYCOMPACT:
|
|
12840
|
+
return "text-body font-normal leading-body-compact";
|
|
12841
|
+
case TEXT_VARIANTS.REGULARLABEL:
|
|
12842
|
+
return "text-label font-normal leading-label";
|
|
12843
|
+
case TEXT_VARIANTS.REGULARLABELCOMPACT:
|
|
12844
|
+
return "text-label font-normal leading-label-compact";
|
|
12845
|
+
case TEXT_VARIANTS.REGULARXSMALL:
|
|
12846
|
+
return "text-xsmall font-normal leading-xsmall";
|
|
12847
|
+
default:
|
|
12848
|
+
return "text-base font-normal leading-base";
|
|
12849
|
+
}
|
|
12850
|
+
};
|
|
12851
|
+
return (jsxRuntime.jsx(Component, { style: color ? { color } : undefined, className: cn("m-0 p-0 text-comp-mono-default", getVariantClass(variant), size && getSizeClass(size), weight && getFontWeightClass(weight), align && getAlignClass(align), className), children: children }));
|
|
12852
|
+
};
|
|
12853
|
+
Text.displayName = "Text";
|
|
12854
|
+
|
|
12659
12855
|
/**
|
|
12660
12856
|
* 다양한 크기와 아이콘을 지원하는 입력 필드 컴포넌트입니다.<br/>
|
|
12661
12857
|
* 사용자는 크기(size), 왼쪽 아이콘(leftIcon), 오른쪽 아이콘(rightIcon) 등을 지정할 수 있습니다.<br/>
|
|
@@ -12675,12 +12871,15 @@ const INPUT_SIZES = {
|
|
|
12675
12871
|
* />
|
|
12676
12872
|
* ```
|
|
12677
12873
|
*/
|
|
12678
|
-
const Input = React.forwardRef(({ size = "regular", leftIcon, rightIcon, wrapperClassName, ...rest }, ref) => {
|
|
12679
|
-
return (jsxRuntime.jsxs("div", { "aria-disabled": rest.disabled, className: cn("flex
|
|
12680
|
-
|
|
12681
|
-
|
|
12682
|
-
"
|
|
12683
|
-
|
|
12874
|
+
const Input = React.forwardRef(({ size = "regular", leftIcon, rightIcon, wrapperClassName, isError = false, useHoverStyle = true, errorMessage, ...rest }, ref) => {
|
|
12875
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntime.jsxs("div", { "aria-disabled": rest.disabled, className: cn("flex items-center justify-center rounded-lg bg-fill-mono-default focus-within:bg-fill-mono-default border border-border-bound focus-within:border-border-focused has-[input:disabled]:border-transparent", useHoverStyle && "hover:bg-fill-mono-hovered", size === INPUT_SIZES.REGULAR &&
|
|
12876
|
+
"py-1.5 px-2 text-body leading-body-compact font-medium gap-2", size === INPUT_SIZES.LARGE &&
|
|
12877
|
+
"py-[11px] px-4 text-base leading-base-compact font-medium gap-3", isError &&
|
|
12878
|
+
"border-comp-chroma-error focus-within:border-comp-chroma-error", wrapperClassName), children: [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: ref, className: cn("border-none outline-none p-0 flex-1 bg-transparent 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 &&
|
|
12879
|
+
"hover:placeholder:text-comp-mono-subtle-hovered", size === INPUT_SIZES.REGULAR &&
|
|
12880
|
+
"text-body leading-body-compact font-medium", size === INPUT_SIZES.LARGE &&
|
|
12881
|
+
"text-base leading-base-compact font-medium", isError &&
|
|
12882
|
+
"placeholder:text-comp-chroma-error text-comp-chroma-error hover:placeholder:text-comp-error focus:placeholder:text-comp-error", rest.className), ...rest }), rightIcon && (jsxRuntime.jsx("div", { className: cn("flex items-center justify-center text-comp-mono-default", isError && "text-comp-chroma-error"), children: rightIcon }))] }), errorMessage && (jsxRuntime.jsx(Text, { variant: "medLabelMedCompact", className: "text-comp-chroma-error", children: errorMessage }))] }));
|
|
12684
12883
|
});
|
|
12685
12884
|
Input.displayName = "Input";
|
|
12686
12885
|
|
|
@@ -12865,22 +13064,30 @@ const Calendar = ({ className, classNames, showOutsideDays = true, ...props }) =
|
|
|
12865
13064
|
"--rdp-day-height": "32px",
|
|
12866
13065
|
"--rdp-day_button-height": "32px",
|
|
12867
13066
|
"--rdp-day_button-width": "32px",
|
|
12868
|
-
|
|
12869
|
-
|
|
13067
|
+
"--rdp-nav-height": "36px",
|
|
13068
|
+
}, captionLayout: "dropdown", className: className, classNames: {
|
|
13069
|
+
months: "p-3 bg-page-l1-translucent glass-shadow-medium border border-border-overlay rounded-lg relative flex flex-wrap gap-[var(--rdp-months-gap)] max-w-fit",
|
|
12870
13070
|
month_caption: "flex items-center justify-center mb-4 h-[var(--rdp-nav-height)] font-bold text-lg mx-[var(--rdp-nav_button-width)] relative",
|
|
12871
13071
|
caption_label: "h-7 inline-flex items-center justify-center text-comp-mono-default text-body font-medium leading-body-compact z-[1] relative whitespace-nowrap border-0",
|
|
12872
|
-
month_grid: "border-separate border-spacing-
|
|
12873
|
-
weekday: "text-comp-mono-subtle-default text-body font-normal leading-body size-
|
|
12874
|
-
day: "
|
|
12875
|
-
|
|
12876
|
-
|
|
12877
|
-
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
13072
|
+
month_grid: "border-separate border-spacing-0",
|
|
13073
|
+
weekday: "text-comp-mono-subtle-default text-body font-normal leading-body size-9 p-1",
|
|
13074
|
+
day: "p-1 bg-transparent",
|
|
13075
|
+
day_button: "size-8 rounded-md hover:bg-fill-mono-subtle-hovered focus:outline-none text-body leading-3.5 font-medium text-comp-mono-default cursor-pointer",
|
|
13076
|
+
selected: cn("[&_button]:bg-fill-accent-selected bg-transparent", props.mode === "single" &&
|
|
13077
|
+
"[&_button]:text-comp-accent-default [&_button]:hover:bg-fill-accent-selected"),
|
|
13078
|
+
range_start: "[&_button]:bg-fill-accent-selected bg-transparent [&_button]:text-comp-accent-default [&_button]:hover:bg-fill-accent-selected",
|
|
13079
|
+
range_middle: "[&_button]:bg-fill-mono-subtle-default bg-transparent [&_button]:hover:bg-fill-mono-subtle-default",
|
|
13080
|
+
range_end: "[&_button]:bg-fill-accent-selected bg-transparent [&_button]:text-comp-accent-default [&_button]:hover:bg-fill-accent-selected",
|
|
13081
|
+
button_next: cn(reactDayPicker.getDefaultClassNames().button_next, "h-9 py-0 px-2 text-body leading-body-compact !bg-fill-mono-default hover:!bg-fill-mono-hovered active:!bg-fill-mono-pressed disabled:!bg-fill-disabled disabled:text-comp-disabled rounded-md"),
|
|
13082
|
+
button_previous: cn(reactDayPicker.getDefaultClassNames().button_previous, "h-9 py-0 px-2 text-body leading-body-compact !bg-fill-mono-default hover:!bg-fill-mono-hovered active:!bg-fill-mono-pressed disabled:!bg-fill-disabled disabled:text-comp-disabled rounded-md"),
|
|
12881
13083
|
...classNames,
|
|
12882
13084
|
}, components: {
|
|
12883
|
-
|
|
13085
|
+
Dropdown: (props) => {
|
|
13086
|
+
const { options, className, classNames, components, ...rest } = props;
|
|
13087
|
+
const selectedOption = options?.find(({ value }) => value === rest.value);
|
|
13088
|
+
return (jsxRuntime.jsxs("div", { className: cn("flex px-2 py-1 rounded-lg bg-fill-mono-subtle-default relative", 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", "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 })] })] }));
|
|
13089
|
+
},
|
|
13090
|
+
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" })),
|
|
12884
13091
|
}, ...props }));
|
|
12885
13092
|
};
|
|
12886
13093
|
|
|
@@ -12890,10 +13097,7 @@ const BUTTON_SIZES = {
|
|
|
12890
13097
|
LARGE: "large",
|
|
12891
13098
|
};
|
|
12892
13099
|
const BUTTON_VARIANTS = {
|
|
12893
|
-
|
|
12894
|
-
OUTLINE: "outline",
|
|
12895
|
-
GHOST: "ghost",
|
|
12896
|
-
};
|
|
13100
|
+
THUMBNAIL_GHOST: "thumbnail_ghost"};
|
|
12897
13101
|
|
|
12898
13102
|
/**
|
|
12899
13103
|
* 다양한 스타일과 속성을 지원하는 버튼 컴포넌트입니다.<br/>
|
|
@@ -12910,16 +13114,57 @@ const BUTTON_VARIANTS = {
|
|
|
12910
13114
|
* ```
|
|
12911
13115
|
*/
|
|
12912
13116
|
const Button = React.forwardRef(({ variant = "accent", size = "regular", fullWidth = false, isLoading = false, leftIcon, rightIcon, children, disabled, className, ...rest }, ref) => {
|
|
12913
|
-
|
|
12914
|
-
|
|
12915
|
-
"h-
|
|
12916
|
-
"h-
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
|
|
13117
|
+
const getClassName = (size, variant) => {
|
|
13118
|
+
const sizeClassName = {
|
|
13119
|
+
small: "h-7 py-0 px-1.5 text-label leading-label-compact",
|
|
13120
|
+
regular: "h-9 py-0 px-2 text-body leading-body-compact",
|
|
13121
|
+
large: "h-12 py-0 px-3 text-body leading-body-compact",
|
|
13122
|
+
}[size];
|
|
13123
|
+
const thumbnailGhostSizeClassName = {
|
|
13124
|
+
small: "px-1",
|
|
13125
|
+
regular: "px-1",
|
|
13126
|
+
large: "px-1.5",
|
|
13127
|
+
}[size];
|
|
13128
|
+
const variantClassName = {
|
|
13129
|
+
accent: "bg-fill-accent-default hover:bg-fill-accent-hovered active:bg-fill-accent-pressed disabled:bg-fill-disabled text-comp-accent-default disabled:text-comp-disabled",
|
|
13130
|
+
outline: "bg-fill-mono-default hover:bg-fill-mono-hovered active:bg-fill-mono-pressed disabled:bg-fill-disabled text-comp-mono-default disabled:text-comp-disabled border border-border-bound disabled:border-pure-transparent",
|
|
13131
|
+
ghost: "bg-fill-mono-default hover:bg-fill-mono-hovered active:bg-fill-mono-pressed disabled:bg-fill-disabled text-comp-mono-default disabled:text-comp-disabled",
|
|
13132
|
+
thumbnail_ghost: "bg-transparent hover:bg-fill-mono-hovered active:bg-fill-mono-pressed disabled:bg-fill-disabled text-comp-mono-default disabled:text-comp-disabled",
|
|
13133
|
+
subtle_filled: "bg-fill-mono-subtle-default hover:bg-fill-mono-subtle-hovered active:bg-fill-mono-subtle-pressed disabled:bg-fill-disabled text-comp-mono-subtle-default disabled:text-comp-disabled",
|
|
13134
|
+
accent_ghost: "bg-fill-mono-default hover:bg-fill-accent-hovered active:bg-fill-accent-pressed disabled:bg-fill-disabled text-comp-accent-default disabled:text-comp-disabled",
|
|
13135
|
+
}[variant];
|
|
13136
|
+
return [
|
|
13137
|
+
sizeClassName,
|
|
13138
|
+
variant === "thumbnail_ghost" && thumbnailGhostSizeClassName,
|
|
13139
|
+
variantClassName,
|
|
13140
|
+
];
|
|
13141
|
+
};
|
|
13142
|
+
const getThumbnailSize = (variant, size) => {
|
|
13143
|
+
if (variant !== BUTTON_VARIANTS.THUMBNAIL_GHOST) {
|
|
13144
|
+
if (size === BUTTON_SIZES.LARGE)
|
|
13145
|
+
return "size-6";
|
|
13146
|
+
if (size === BUTTON_SIZES.SMALL)
|
|
13147
|
+
return "size-4";
|
|
13148
|
+
return "size-5"; // 기본값은 regular 크기
|
|
13149
|
+
}
|
|
13150
|
+
if (size === BUTTON_SIZES.LARGE)
|
|
13151
|
+
return "size-9";
|
|
13152
|
+
if (size === BUTTON_SIZES.SMALL)
|
|
13153
|
+
return "size-5";
|
|
13154
|
+
return "size-7"; // 기본값은 regular 크기
|
|
13155
|
+
};
|
|
13156
|
+
const getPaddingOnlyIcon = (size) => {
|
|
13157
|
+
if (size === BUTTON_SIZES.LARGE)
|
|
13158
|
+
return "px-3";
|
|
13159
|
+
if (size === BUTTON_SIZES.SMALL)
|
|
13160
|
+
return "px-1.5";
|
|
13161
|
+
return "px-2"; // 기본값은 regular 크기
|
|
13162
|
+
};
|
|
13163
|
+
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", ...getClassName(size, variant), fullWidth && "w-full", !children && (leftIcon || rightIcon) && getPaddingOnlyIcon(size), className), ...rest, children: [isLoading && (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: cn("lucide lucide-loader-circle-icon lucide-loader-circle absolute animate-spin", size === BUTTON_SIZES.SMALL &&
|
|
12920
13164
|
"size-4 top-[calc(50%-8px)] left-[calc(50%-8px)]", size === BUTTON_SIZES.REGULAR &&
|
|
12921
13165
|
"size-5 top-[calc(50%-10px)] left-[calc(50%-10px)]", size === BUTTON_SIZES.LARGE &&
|
|
12922
|
-
"size-6 top-[calc(50%-12px)] left-[calc(50%-12px)]"), children: jsxRuntime.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) })), leftIcon && (jsxRuntime.jsx("
|
|
13166
|
+
"size-6 top-[calc(50%-12px)] left-[calc(50%-12px)]"), children: jsxRuntime.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) })), leftIcon && (jsxRuntime.jsx("div", { className: cn("flex items-center justify-center relative", variant === BUTTON_VARIANTS.THUMBNAIL_GHOST &&
|
|
13167
|
+
"aspect-square [&_img]:rounded-sm", getThumbnailSize(variant, size)), children: leftIcon })), children && (jsxRuntime.jsx("span", { className: "px-2", style: { visibility: isLoading ? "hidden" : "visible" }, children: children })), rightIcon && (jsxRuntime.jsx("div", { className: cn("flex items-center justify-center relative", getThumbnailSize(variant, size)), children: rightIcon }))] }));
|
|
12923
13168
|
});
|
|
12924
13169
|
Button.displayName = "Button";
|
|
12925
13170
|
|
|
@@ -13119,205 +13364,13 @@ const Autocomplete = ({ placeholder, data, value, displayValue, onSelect, onChan
|
|
|
13119
13364
|
const SWITCH_VARIANTS = {
|
|
13120
13365
|
FILLED: "filled",
|
|
13121
13366
|
OUTLINED: "outlined",
|
|
13367
|
+
SLIDE: "slide",
|
|
13122
13368
|
};
|
|
13123
13369
|
const SWITCH_SIZES = {
|
|
13124
13370
|
SMALL: "small",
|
|
13125
13371
|
REGULAR: "regular",
|
|
13126
13372
|
};
|
|
13127
13373
|
|
|
13128
|
-
const TEXT_VARIANTS = {
|
|
13129
|
-
BOLD3XLARGEBOLD: "bold3XLargeBold",
|
|
13130
|
-
BOLD2XLARGEBOLDCOMPACT: "bold2XLargeBoldCompact",
|
|
13131
|
-
BOLD2XLARGEBOLD: "bold2XLargeBold",
|
|
13132
|
-
BOLDXLARGEBOLDCOMPACT: "boldXLargeBoldCompact",
|
|
13133
|
-
BOLDXLARGEBOLD: "boldXLargeBold",
|
|
13134
|
-
BOLDLARGEBOLDCOMPACT: "boldLargeBoldCompact",
|
|
13135
|
-
BOLDLARGEBOLD: "boldLargeBold",
|
|
13136
|
-
BOLDBASEBOLDCOMPACT: "boldBaseBoldCompact",
|
|
13137
|
-
BOLDBASEBOLD: "boldBaseBold",
|
|
13138
|
-
BOLDBODYBOLDCOMPACT: "boldBodyBoldCompact",
|
|
13139
|
-
BOLDBODYBOLD: "boldBodyBold",
|
|
13140
|
-
BOLDLABELBOLDCOMPACT: "boldLabelBoldCompact",
|
|
13141
|
-
BOLDLABELBOLD: "boldLabelBold",
|
|
13142
|
-
BOLDXSMALLBOLD: "boldXSmallBold",
|
|
13143
|
-
SEMIBOLDBASESEMIBOLDCOMPACT: "semiBoldBaseSemiBoldCompact",
|
|
13144
|
-
SEMIBOLDBASESEMIBOLD: "semiBoldBaseSemiBold",
|
|
13145
|
-
SEMIBOLDBODYSEMIBOLDCOMPACT: "semiBoldBodySemiBoldCompact",
|
|
13146
|
-
SEMIBOLDBODYSEMIBOLD: "semiBoldBodySemiBold",
|
|
13147
|
-
SEMIBOLDLABELSEMIBOLDCOMPACT: "semiBoldLabelSemiBoldCompact",
|
|
13148
|
-
MED3XLARGEMED: "med3XLargeMed",
|
|
13149
|
-
MEDXLARGEMED: "medXLargeMed",
|
|
13150
|
-
MEDLARGEMED: "medLargeMed",
|
|
13151
|
-
MEDBASEMEDCOMPACT: "medBaseMedCompact",
|
|
13152
|
-
MEDBASEMED: "medBaseMed",
|
|
13153
|
-
MEDBODYMEDCOMPACT: "medBodyMedCompact",
|
|
13154
|
-
MEDBODYMED: "medBodyMed",
|
|
13155
|
-
MEDLABELMEDCOMPACT: "medLabelMedCompact",
|
|
13156
|
-
MEDLABELMED: "medLabelMed",
|
|
13157
|
-
MEDXSMALLMED: "medXSmallMed",
|
|
13158
|
-
REGULAR3XLARGE: "regular3XLarge",
|
|
13159
|
-
REGULAR2XLARGE: "regular2XLarge",
|
|
13160
|
-
REGULARXLARGE: "regularXLarge",
|
|
13161
|
-
REGULARLARGECOMPACT: "regularLargeCompact",
|
|
13162
|
-
REGULARLARGE: "regularLarge",
|
|
13163
|
-
REGULARBASECOMPACT: "regularBaseCompact",
|
|
13164
|
-
REGULARBASE: "regularBase",
|
|
13165
|
-
REGULARBODYCOMPACT: "regularBodyCompact",
|
|
13166
|
-
REGULARBODY: "regularBody",
|
|
13167
|
-
REGULARLABELCOMPACT: "regularLabelCompact",
|
|
13168
|
-
REGULARLABEL: "regularLabel",
|
|
13169
|
-
REGULARXSMALL: "regularXSmall",
|
|
13170
|
-
};
|
|
13171
|
-
|
|
13172
|
-
const Text = ({ children, className, size, weight, align, variant = "regularBase", color, as: Component = "p", }) => {
|
|
13173
|
-
const getFontWeightClass = (weight) => {
|
|
13174
|
-
switch (weight) {
|
|
13175
|
-
case "bold":
|
|
13176
|
-
return "font-bold";
|
|
13177
|
-
case "semibold":
|
|
13178
|
-
return "font-semibold";
|
|
13179
|
-
case "medium":
|
|
13180
|
-
return "font-medium";
|
|
13181
|
-
case "regular":
|
|
13182
|
-
return "font-normal";
|
|
13183
|
-
case "light":
|
|
13184
|
-
return "font-light";
|
|
13185
|
-
case "extralight":
|
|
13186
|
-
return "font-extralight";
|
|
13187
|
-
case "thin":
|
|
13188
|
-
return "font-thin";
|
|
13189
|
-
default:
|
|
13190
|
-
return "font-normal";
|
|
13191
|
-
}
|
|
13192
|
-
};
|
|
13193
|
-
const getSizeClass = (size) => {
|
|
13194
|
-
switch (size) {
|
|
13195
|
-
case "xxxl":
|
|
13196
|
-
return "text-xxxl";
|
|
13197
|
-
case "xxl":
|
|
13198
|
-
return "text-xxl";
|
|
13199
|
-
case "xl":
|
|
13200
|
-
return "text-xl";
|
|
13201
|
-
case "large":
|
|
13202
|
-
return "text-large";
|
|
13203
|
-
case "base":
|
|
13204
|
-
return "text-base";
|
|
13205
|
-
case "body":
|
|
13206
|
-
return "text-body";
|
|
13207
|
-
case "label":
|
|
13208
|
-
return "text-label";
|
|
13209
|
-
case "xsmall":
|
|
13210
|
-
return "text-xsmall";
|
|
13211
|
-
default:
|
|
13212
|
-
return "text-base";
|
|
13213
|
-
}
|
|
13214
|
-
};
|
|
13215
|
-
const getAlignClass = (align) => {
|
|
13216
|
-
switch (align) {
|
|
13217
|
-
case "left":
|
|
13218
|
-
return "text-left";
|
|
13219
|
-
case "center":
|
|
13220
|
-
return "text-center";
|
|
13221
|
-
case "right":
|
|
13222
|
-
return "text-right";
|
|
13223
|
-
case "justify":
|
|
13224
|
-
return "text-justify";
|
|
13225
|
-
default:
|
|
13226
|
-
return "text-left";
|
|
13227
|
-
}
|
|
13228
|
-
};
|
|
13229
|
-
const getVariantClass = (variant) => {
|
|
13230
|
-
switch (variant) {
|
|
13231
|
-
case TEXT_VARIANTS.BOLD3XLARGEBOLD:
|
|
13232
|
-
return "text-xxxl font-bold leading-xxxl";
|
|
13233
|
-
case TEXT_VARIANTS.BOLD2XLARGEBOLDCOMPACT:
|
|
13234
|
-
return "text-xxl font-bold leading-xxl-compact";
|
|
13235
|
-
case TEXT_VARIANTS.BOLD2XLARGEBOLD:
|
|
13236
|
-
return "text-xxl font-bold leading-xxl";
|
|
13237
|
-
case TEXT_VARIANTS.BOLDXLARGEBOLDCOMPACT:
|
|
13238
|
-
return "text-xl font-bold leading-xl-compact";
|
|
13239
|
-
case TEXT_VARIANTS.BOLDXLARGEBOLD:
|
|
13240
|
-
return "text-xl font-bold leading-xl";
|
|
13241
|
-
case TEXT_VARIANTS.BOLDLARGEBOLDCOMPACT:
|
|
13242
|
-
return "text-large font-bold leading-large-compact";
|
|
13243
|
-
case TEXT_VARIANTS.BOLDLARGEBOLD:
|
|
13244
|
-
return "text-large font-bold leading-large";
|
|
13245
|
-
case TEXT_VARIANTS.BOLDBASEBOLDCOMPACT:
|
|
13246
|
-
return "text-base font-bold leading-base-compact";
|
|
13247
|
-
case TEXT_VARIANTS.BOLDBASEBOLD:
|
|
13248
|
-
return "text-base font-bold leading-base";
|
|
13249
|
-
case TEXT_VARIANTS.BOLDBODYBOLDCOMPACT:
|
|
13250
|
-
return "text-body font-bold leading-body-compact";
|
|
13251
|
-
case TEXT_VARIANTS.BOLDBODYBOLD:
|
|
13252
|
-
return "text-body font-bold leading-body";
|
|
13253
|
-
case TEXT_VARIANTS.BOLDLABELBOLDCOMPACT:
|
|
13254
|
-
return "text-label font-bold leading-label-compact";
|
|
13255
|
-
case TEXT_VARIANTS.BOLDLABELBOLD:
|
|
13256
|
-
return "text-label font-bold leading-label";
|
|
13257
|
-
case TEXT_VARIANTS.BOLDXSMALLBOLD:
|
|
13258
|
-
return "text-xsmall font-bold leading-xsmall";
|
|
13259
|
-
case TEXT_VARIANTS.SEMIBOLDBASESEMIBOLDCOMPACT:
|
|
13260
|
-
return "text-base font-semibold leading-base-compact";
|
|
13261
|
-
case TEXT_VARIANTS.SEMIBOLDBASESEMIBOLD:
|
|
13262
|
-
return "text-base font-semibold leading-base";
|
|
13263
|
-
case TEXT_VARIANTS.SEMIBOLDBODYSEMIBOLDCOMPACT:
|
|
13264
|
-
return "text-body font-semibold leading-body-compact";
|
|
13265
|
-
case TEXT_VARIANTS.SEMIBOLDBODYSEMIBOLD:
|
|
13266
|
-
return "text-body font-semibold leading-body";
|
|
13267
|
-
case TEXT_VARIANTS.SEMIBOLDLABELSEMIBOLDCOMPACT:
|
|
13268
|
-
return "text-label font-semibold leading-label-compact";
|
|
13269
|
-
case TEXT_VARIANTS.MED3XLARGEMED:
|
|
13270
|
-
return "text-xxxl font-medium leading-xxxl";
|
|
13271
|
-
case TEXT_VARIANTS.MEDXLARGEMED:
|
|
13272
|
-
return "text-xl font-medium leading-xl";
|
|
13273
|
-
case TEXT_VARIANTS.MEDLARGEMED:
|
|
13274
|
-
return "text-large font-medium leading-large";
|
|
13275
|
-
case TEXT_VARIANTS.MEDBASEMEDCOMPACT:
|
|
13276
|
-
return "text-base font-medium leading-base-compact";
|
|
13277
|
-
case TEXT_VARIANTS.MEDBASEMED:
|
|
13278
|
-
return "text-base font-medium leading-base";
|
|
13279
|
-
case TEXT_VARIANTS.MEDBODYMEDCOMPACT:
|
|
13280
|
-
return "text-body font-medium leading-body-compact";
|
|
13281
|
-
case TEXT_VARIANTS.MEDBODYMED:
|
|
13282
|
-
return "text-body font-medium leading-body";
|
|
13283
|
-
case TEXT_VARIANTS.MEDLABELMEDCOMPACT:
|
|
13284
|
-
return "text-label font-medium leading-label-compact";
|
|
13285
|
-
case TEXT_VARIANTS.MEDLABELMED:
|
|
13286
|
-
return "text-label font-medium leading-label";
|
|
13287
|
-
case TEXT_VARIANTS.MEDXSMALLMED:
|
|
13288
|
-
return "text-xsmall font-medium leading-xsmall";
|
|
13289
|
-
case TEXT_VARIANTS.REGULAR3XLARGE:
|
|
13290
|
-
return "text-xxxl font-normal leading-xxxl";
|
|
13291
|
-
case TEXT_VARIANTS.REGULAR2XLARGE:
|
|
13292
|
-
return "text-xxl font-normal leading-xxl";
|
|
13293
|
-
case TEXT_VARIANTS.REGULARXLARGE:
|
|
13294
|
-
return "text-xl font-normal leading-xl";
|
|
13295
|
-
case TEXT_VARIANTS.REGULARLARGE:
|
|
13296
|
-
return "text-large font-normal leading-large";
|
|
13297
|
-
case TEXT_VARIANTS.REGULARLARGECOMPACT:
|
|
13298
|
-
return "text-large font-normal leading-large-compact";
|
|
13299
|
-
case TEXT_VARIANTS.REGULARBASE:
|
|
13300
|
-
return "text-base font-normal leading-base";
|
|
13301
|
-
case TEXT_VARIANTS.REGULARBASECOMPACT:
|
|
13302
|
-
return "text-base font-normal leading-base-compact";
|
|
13303
|
-
case TEXT_VARIANTS.REGULARBODY:
|
|
13304
|
-
return "text-body font-normal leading-body";
|
|
13305
|
-
case TEXT_VARIANTS.REGULARBODYCOMPACT:
|
|
13306
|
-
return "text-body font-normal leading-body-compact";
|
|
13307
|
-
case TEXT_VARIANTS.REGULARLABEL:
|
|
13308
|
-
return "text-label font-normal leading-label";
|
|
13309
|
-
case TEXT_VARIANTS.REGULARLABELCOMPACT:
|
|
13310
|
-
return "text-label font-normal leading-label-compact";
|
|
13311
|
-
case TEXT_VARIANTS.REGULARXSMALL:
|
|
13312
|
-
return "text-xsmall font-normal leading-xsmall";
|
|
13313
|
-
default:
|
|
13314
|
-
return "text-base font-normal leading-base";
|
|
13315
|
-
}
|
|
13316
|
-
};
|
|
13317
|
-
return (jsxRuntime.jsx(Component, { style: color ? { color } : undefined, className: cn("m-0 p-0 text-comp-mono-default", getVariantClass(variant), size && getSizeClass(size), weight && getFontWeightClass(weight), align && getAlignClass(align), className), children: children }));
|
|
13318
|
-
};
|
|
13319
|
-
Text.displayName = "Text";
|
|
13320
|
-
|
|
13321
13374
|
const FilledSwitch = (props) => {
|
|
13322
13375
|
const { size, checked, thumbClassName, ...rest } = props;
|
|
13323
13376
|
return (jsxRuntime.jsxs(Root, { className: cn("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("rounded-sm absolute transition-all duration-100", size === SWITCH_SIZES.REGULAR &&
|
|
@@ -13336,13 +13389,23 @@ const OutlinedSwitch = (props) => {
|
|
|
13336
13389
|
? "medBodyMedCompact"
|
|
13337
13390
|
: "medLabelMedCompact", className: cn("text-comp-mono-subtle-default text-right group-hover:text-comp-mono-subtle-hovered", size === SWITCH_SIZES.REGULAR && "pr-1.5", size === SWITCH_SIZES.SMALL && "pr-[3px]"), as: "div", children: "OFF" }))] }));
|
|
13338
13391
|
};
|
|
13392
|
+
const SlideSwitch = (props) => {
|
|
13393
|
+
const { size, checked, thumbClassName, leftIcon, rightIcon, ...rest } = props;
|
|
13394
|
+
return (jsxRuntime.jsxs(Root, { className: cn("group border shadow-inner p-1 relative rounded-[20px] border-border-bound bg-fill-mono-default hover:bg-fill-mono-hovered", 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-l2 shadow-medium border border-border-bound", size === SWITCH_SIZES.REGULAR &&
|
|
13395
|
+
"size-7 data-[state=checked]:left-[36px]", size === SWITCH_SIZES.SMALL &&
|
|
13396
|
+
"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 }))] }));
|
|
13397
|
+
};
|
|
13339
13398
|
const Switch = (props) => {
|
|
13340
|
-
const
|
|
13399
|
+
const { defaultChecked, checked: isChecked } = props;
|
|
13400
|
+
const [checked, setChecked] = React.useState(isChecked ?? defaultChecked ?? false);
|
|
13401
|
+
React.useEffect(() => {
|
|
13402
|
+
setChecked(isChecked ?? defaultChecked ?? false);
|
|
13403
|
+
}, [isChecked, defaultChecked]);
|
|
13341
13404
|
const handleCheckedChange = (value) => {
|
|
13342
13405
|
setChecked(value);
|
|
13343
13406
|
props.onCheckedChange?.(value);
|
|
13344
13407
|
};
|
|
13345
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [props.variant === SWITCH_VARIANTS.FILLED && (jsxRuntime.jsx(FilledSwitch, { checked: checked, onCheckedChange: handleCheckedChange, ...props })), props.variant === SWITCH_VARIANTS.OUTLINED && (jsxRuntime.jsx(OutlinedSwitch, { checked: checked, onCheckedChange: handleCheckedChange, ...props }))] }));
|
|
13408
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [props.variant === SWITCH_VARIANTS.FILLED && (jsxRuntime.jsx(FilledSwitch, { checked: defaultChecked ? checked : isChecked, onCheckedChange: handleCheckedChange, ...props })), props.variant === SWITCH_VARIANTS.OUTLINED && (jsxRuntime.jsx(OutlinedSwitch, { checked: defaultChecked ? checked : isChecked, onCheckedChange: handleCheckedChange, ...props })), props.variant === SWITCH_VARIANTS.SLIDE && (jsxRuntime.jsx(SlideSwitch, { checked: defaultChecked ? checked : isChecked, onCheckedChange: handleCheckedChange, ...props }))] }));
|
|
13346
13409
|
};
|
|
13347
13410
|
|
|
13348
13411
|
exports.Autocomplete = Autocomplete;
|