@rovula/ui 0.0.12 → 0.0.13

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.
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
- import { Fragment, forwardRef, useCallback, useEffect, useMemo, useState, } from "react";
24
+ import { Fragment, forwardRef, useCallback, useEffect, useMemo, useRef, useState, } from "react";
25
25
  import TextInput from "../TextInput/TextInput";
26
26
  import { customInputVariant, dropdownIconVariant, iconWrapperVariant, } from "./Dropdown.styles";
27
27
  import { ChevronDownIcon } from "@heroicons/react/16/solid";
@@ -31,6 +31,7 @@ var Dropdown = forwardRef(function (_a, ref) {
31
31
  var _k = useState(false), isFocused = _k[0], setIsFocused = _k[1];
32
32
  var _l = useState(null), selectedOption = _l[0], setSelectedOption = _l[1];
33
33
  var _m = useState(""), textValue = _m[0], setTextValue = _m[1];
34
+ var keyCode = useRef("");
34
35
  useEffect(function () {
35
36
  if (value && !selectedOption) {
36
37
  setSelectedOption(value);
@@ -63,6 +64,42 @@ var Dropdown = forwardRef(function (_a, ref) {
63
64
  }
64
65
  return (_jsx("li", { onMouseDown: function () { return handleOptionClick(option); }, className: "px-4 py-2 hover:bg-gray-100 cursor-pointer ".concat((selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value ? " bg-gray-200" : ""), children: option.label }, option.value));
65
66
  }), optionsFiltered.length === 0 && (_jsx("li", { className: "px-4 py-14 text-center text-input-text", children: "Not found" }))] })); };
66
- return (_jsxs("div", { className: "relative ".concat(fullwidth ? "w-full" : ""), children: [_jsx(TextInput, __assign({}, props, { ref: ref, readOnly: !filterMode, value: textValue, onChange: handleOnChangeText, label: label, placeholder: " ", type: "text", rounded: rounded, variant: variant, helperText: helperText, errorMessage: errorMessage, fullwidth: fullwidth, error: error, required: required, id: _id, disabled: disabled, hasClearIcon: false, size: size, className: customInputVariant({ size: size }), onFocus: function () { return setIsFocused(true); }, onBlur: function () { return setIsFocused(false); }, endIcon: _jsx("div", { className: iconWrapperVariant({ size: size }), children: _jsx(ChevronDownIcon, { className: dropdownIconVariant({ size: size, isFocus: isFocused }) }) }) })), isFocused && renderOptions()] }));
67
+ var handleOnFocus = useCallback(function (e) {
68
+ var _a;
69
+ setIsFocused(true);
70
+ (_a = props === null || props === void 0 ? void 0 : props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
71
+ }, [props === null || props === void 0 ? void 0 : props.onFocus]);
72
+ var clearMismatchValue = useCallback(function (e) {
73
+ var matchSelectedValue = optionsFiltered.find(function (opt) { var _a, _b; return opt.value === ((_a = e.target) === null || _a === void 0 ? void 0 : _a.value) || opt.label === ((_b = e.target) === null || _b === void 0 ? void 0 : _b.value); });
74
+ var isMatchSelectedValue = !!matchSelectedValue;
75
+ var option = matchSelectedValue || {
76
+ value: "",
77
+ label: "",
78
+ };
79
+ if (!isMatchSelectedValue && textValue) {
80
+ option = {
81
+ value: "",
82
+ label: "",
83
+ };
84
+ }
85
+ if (keyCode.current === "Enter") {
86
+ return;
87
+ }
88
+ setSelectedOption(option);
89
+ setTextValue(option.label);
90
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(option);
91
+ }, [optionsFiltered, textValue]);
92
+ var handleOnBlur = useCallback(function (e) {
93
+ var _a;
94
+ setIsFocused(false);
95
+ clearMismatchValue(e);
96
+ (_a = props === null || props === void 0 ? void 0 : props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
97
+ }, [props === null || props === void 0 ? void 0 : props.onBlur]);
98
+ var handleOnKeyDown = useCallback(function (e) {
99
+ var _a;
100
+ keyCode.current = e.code;
101
+ (_a = props === null || props === void 0 ? void 0 : props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
102
+ }, [props === null || props === void 0 ? void 0 : props.onKeyDown]);
103
+ return (_jsxs("div", { className: "relative ".concat(fullwidth ? "w-full" : ""), children: [_jsx(TextInput, __assign({}, props, { ref: ref, readOnly: !filterMode, value: textValue, onChange: handleOnChangeText, label: label, placeholder: " ", type: "text", rounded: rounded, variant: variant, helperText: helperText, errorMessage: errorMessage, fullwidth: fullwidth, error: error, required: required, id: _id, disabled: disabled, hasClearIcon: false, size: size, className: customInputVariant({ size: size }), onFocus: handleOnFocus, onBlur: handleOnBlur, onKeyDown: handleOnKeyDown, endIcon: _jsx("div", { className: iconWrapperVariant({ size: size }), children: _jsx(ChevronDownIcon, { className: dropdownIconVariant({ size: size, isFocus: isFocused }) }) }) })), isFocused && renderOptions()] }));
67
104
  });
68
105
  export default Dropdown;
@@ -9,8 +9,17 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
+ if (ar || !(i in from)) {
15
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16
+ ar[i] = from[i];
17
+ }
18
+ }
19
+ return to.concat(ar || Array.prototype.slice.call(from));
20
+ };
12
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { useRef } from "react";
22
+ import { useRef, useState } from "react";
14
23
  import Dropdown from "./Dropdown";
15
24
  import Button from "../Button/Button";
16
25
  import { cn } from "@/utils/cn";
@@ -46,9 +55,25 @@ export var Default = {
46
55
  };
47
56
  var DropdownWithRef = function (props) {
48
57
  var inputRef = useRef(null);
49
- return (_jsx(Dropdown, __assign({ id: "1", size: "lg" }, props, { ref: inputRef, labelClassName: "peer-focus:bg-red-500", onKeyDown: function (e) {
58
+ var _a = useState(customOptions), options = _a[0], setOptions = _a[1];
59
+ var _b = useState({
60
+ label: "",
61
+ value: "",
62
+ }), value = _b[0], setValue = _b[1];
63
+ var _c = useState(""), text = _c[0], setText = _c[1];
64
+ return (_jsx(Dropdown, __assign({ id: "1", size: "lg" }, props, { value: value, options: options, ref: inputRef, labelClassName: "peer-focus:bg-red-500", onSelect: setValue, onChangeText: function (e) { return setText(e.target.value); }, onKeyDown: function (e) {
50
65
  var _a, _b;
51
66
  if (e.code === "Enter") {
67
+ setOptions(function (options) { return __spreadArray(__spreadArray([], options, true), [
68
+ {
69
+ label: text,
70
+ value: text,
71
+ },
72
+ ], false); });
73
+ setValue({
74
+ label: text,
75
+ value: text,
76
+ });
52
77
  (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur) === null || _b === void 0 ? void 0 : _b.call(_a);
53
78
  }
54
79
  } })));
@@ -63,7 +88,7 @@ export var WithRef = {
63
88
  render: function (args) {
64
89
  console.log("args ", args);
65
90
  var props = __assign({}, args);
66
- return (_jsxs("div", { className: "flex flex-row gap-4 w-full", children: [_jsx(DropdownWithRef, __assign({ id: "1", size: "lg", options: options }, args)), "\\"] }));
91
+ return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(DropdownWithRef, __assign({ id: "1", size: "lg", options: options }, args)) }));
67
92
  },
68
93
  };
69
94
  var customOptions = new Array(100).fill("").map(function (__, index) { return ({
@@ -86,6 +111,6 @@ export var CustomOption = {
86
111
  render: function (args) {
87
112
  console.log("args ", args);
88
113
  var props = __assign({}, args);
89
- return (_jsxs("div", { className: "flex flex-row gap-4 w-full", children: [_jsx(DropdownWithRef, __assign({ id: "1", size: "lg", options: options }, args)), "\\"] }));
114
+ return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(DropdownWithRef, __assign({ id: "1", size: "lg", options: options }, args)) }));
90
115
  },
91
116
  };
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{forwardRef as l,useRef as r,useImperativeHandle as a,useState as i,useEffect as s,useCallback as u,useMemo as d,Fragment as c,createContext as g,createElement as f,useContext as p,useLayoutEffect as m,Children as v,cloneElement as h,useReducer as b,isValidElement as w}from"react";import{cva as C}from"class-variance-authority";import{twMerge as y}from"tailwind-merge";import S,{flushSync as R}from"react-dom";var x=function(){return x=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e},x.apply(this,arguments)};function F(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n}"function"==typeof SuppressedError&&SuppressedError;var E=C(["gap-2 font-bold text-white hover:bg-opacity-90 active:scale-[98%]"],{variants:{color:{primary:"bg-primary border-primary text-primary hover:bg-primary-80",secondary:"border-secondary bg-secondary-100 text-secondary-foreground hover:bg-secondary-120",tertiary:"border-tertiary-120 bg-tertiary-120 text-tertiary-120 hover:bg-tertiary-100",success:"border-success bg-success text-success hover:bg-success-120",info:"border-info bg-info text-info hover:bg-info-100",warning:"border-warning bg-warning text-warning hover:bg-warning-100 hover:border-warning-100",error:"border-error bg-error text-error hover:bg-error-120 hover:border-error-120"},size:{sm:"px-3 py-1 text-sm rounded-[--btn-rounded-sm]",md:"px-4 py-2 text-sm rounded-[--btn-rounded-md]",lg:"px-6 py-4 text-base rounded-[--btn-rounded-lg]"},variant:{solid:"border",outline:"border bg-transparent hover:bg-opacity-20",flat:"bg-transparent hover:bg-opacity-20",link:"bg-transparent underline underline-offset-4 hover:bg-transparent hover:text-opacity-80"},disabled:{true:"pointer-events-none border-transparent bg-secondary-110 text-secondary-130"},fullwidth:{true:"w-full"}},compoundVariants:[{variant:["flat","link"],disabled:!0,class:"border-transparent bg-transparent"},{variant:"solid",color:"primary",class:"text-primary-foreground"},{variant:"solid",color:"secondary",class:"text-secondary-foreground"},{variant:"solid",disabled:!0,color:"secondary",class:"text-white"},{variant:"solid",color:"tertiary",class:"text-tertiary-foreground"},{variant:"solid",color:"success",class:"text-success-foreground"},{variant:"solid",color:"info",class:"text-info-foreground"},{variant:"solid",color:"warning",class:"text-warning-foreground"},{variant:"solid",color:"error",class:"text-error-foreground"}],defaultVariants:{size:"md",color:"primary",variant:"solid",fullwidth:!0}});function N(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=N(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function M(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return y(function(){for(var e,t,n=0,o="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=N(e))&&(o&&(o+=" "),o+=t);return o}(e))}var I=l((function(o,l){var r=o.size,a=void 0===r?"md":r,i=o.color,s=void 0===i?"primary":i,u=o.variant,d=void 0===u?"solid":u,c=o.title,g=o.children,f=o.startIcon,p=o.endIcon,m=o.disabled,v=void 0!==m&&m,h=o.fullwidth,b=void 0!==h&&h,w=o.isLoading,C=void 0!==w&&w,y=o.className,S=F(o,["size","color","variant","title","children","startIcon","endIcon","disabled","fullwidth","isLoading","className"]),R=v||C;return e("button",x({type:"button"},S,{ref:l,"aria-disabled":R||void 0,tabIndex:R?-1:0,className:M(E({size:a,color:s,variant:d,disabled:v,fullwidth:b}),y),disabled:R,children:t(n,{children:[f,g||c,p]})}))})),P=C(["border-0 outline-none","p-1 flex w-auto box-border","peer text-black placeholder:text-transparent"],{variants:{size:{sm:"p-2 px-3 typography-small1",md:"py-2 px-3 typography-subtitile4",lg:"p-4 typography-subtitile1"},rounded:{none:"rounded-none",normal:"rounded-xl",full:"rounded-full"},variant:{flat:"",outline:"ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-1 focus:ring-inset focus:ring-input-stroke-active",underline:"border-b-2 border-input-stroke transition-colors hover:border-input-stroke-active focus:border-input-stroke"},fullwidth:{true:"w-full"},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled"},error:{true:"ring-error focus:ring-error"},hasClearIcon:{true:""}},compoundVariants:[{variant:"underline",className:"rounded-none"},{hasClearIcon:!0,size:"sm",class:"focus:pe-6"},{hasClearIcon:!0,size:"md",class:"focus:pe-8"},{hasClearIcon:!0,size:"lg",class:"focus:pe-10"}],defaultVariants:{size:"md",variant:"outline",rounded:"normal",fullwidth:!1,disabled:!1,error:!1,hasClearIcon:!1}}),_=C(["absolute block duration-450 transition-all px-[2px] text-input-text peer-focus:text-input-text-active peer-focus:bg-input-label-background"],{variants:{size:{sm:["left-3 -top-1.5 typography-label2 bg-input-label-background","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label2"],md:["left-3 -top-1.5 typography-label1 bg-input-label-background","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitile4 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"],lg:["left-4 -top-1.5 typography-label1 bg-input-label-background","peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitile1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled"},error:{true:"ring-error"}},defaultVariants:{size:"md",disabled:!1,error:!1}}),V=C(["text-small1 flex flex-row items-center gap-1"],{variants:{size:{sm:"mt-1",md:"mt-[6px]",lg:"mt-[6px]"},disabled:{true:"text-input-text-disabled"},error:{true:"text-error",false:"text-input-text"}},defaultVariants:{size:"md",disabled:!1,error:!1}}),D=C(["absolute inset-y-0 right-0 items-center justify-center hidden peer-focus:flex"],{variants:{size:{sm:"mr-2",md:"mr-3",lg:"mr-4"}},defaultVariants:{size:"md"}}),A=C(["cursor-pointer z-50 fill-input-stroke-active hover:fill-input-text"],{variants:{size:{sm:"size-3",md:"size-4",lg:"size-5"}},defaultVariants:{size:"md"}});const L=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M8 2a.75.75 0 0 1 .75.75v8.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.22 3.22V2.75A.75.75 0 0 1 8 2Z",clipRule:"evenodd"}))}));const O=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z",clipRule:"evenodd"}))}));const z=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M13.78 10.47a.75.75 0 0 1 0 1.06l-2.25 2.25a.75.75 0 0 1-1.06 0l-2.25-2.25a.75.75 0 1 1 1.06-1.06l.97.97V5.75a.75.75 0 0 1 1.5 0v5.69l.97-.97a.75.75 0 0 1 1.06 0ZM2.22 5.53a.75.75 0 0 1 0-1.06l2.25-2.25a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1-1.06 1.06l-.97-.97v5.69a.75.75 0 0 1-1.5 0V4.56l-.97.97a.75.75 0 0 1-1.06 0Z",clipRule:"evenodd"}))}));const T=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}));const k=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}));const H=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M11.986 3H12a2 2 0 0 1 2 2v6a2 2 0 0 1-1.5 1.937V7A2.5 2.5 0 0 0 10 4.5H4.063A2 2 0 0 1 6 3h.014A2.25 2.25 0 0 1 8.25 1h1.5a2.25 2.25 0 0 1 2.236 2ZM10.5 4v-.75a.75.75 0 0 0-.75-.75h-1.5a.75.75 0 0 0-.75.75V4h3Z",clipRule:"evenodd"}),o.createElement("path",{fillRule:"evenodd",d:"M3 6a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H3Zm1.75 2.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5h-3.5ZM4 11.75a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 0 1.5h-3.5a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}));const G=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}));const B=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm2.78-4.22a.75.75 0 0 1-1.06 0L8 9.06l-1.72 1.72a.75.75 0 1 1-1.06-1.06L6.94 8 5.22 6.28a.75.75 0 0 1 1.06-1.06L8 6.94l1.72-1.72a.75.75 0 1 1 1.06 1.06L9.06 8l1.72 1.72a.75.75 0 0 1 0 1.06Z",clipRule:"evenodd"}))}));const j=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{d:"M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z"}))}));var q=l((function(n,o){var l=n.id,i=n.label,s=n.size,u=void 0===s?"md":s,d=n.rounded,c=void 0===d?"normal":d,g=n.variant,f=void 0===g?"outline":g,p=n.type,m=void 0===p?"text":p,v=n.helperText,h=n.errorMessage,b=n.fullwidth,w=void 0===b||b,C=n.disabled,y=void 0!==C&&C,S=n.error,R=void 0!==S&&S,E=n.required,N=void 0===E||E,I=n.hasClearIcon,L=void 0===I||I,O=n.endIcon,z=n.labelClassName,T=F(n,["id","label","size","rounded","variant","type","helperText","errorMessage","fullwidth","disabled","error","required","hasClearIcon","endIcon","labelClassName"]),k=r(null),H=l||"".concat(m,"-").concat(i,"-input"),j=P({size:u,rounded:c,variant:f,fullwidth:w,disabled:y,error:R,hasClearIcon:L}),q=_({size:u,disabled:y,error:R}),U=V({size:u,error:R,disabled:y}),$=D({size:u}),W=A({size:u});a(o,(function(){return null==k?void 0:k.current}));return t("div",{className:"inline-flex flex-col ".concat(w?"w-full":""),children:[t("div",{className:"relative",children:[e("input",x({},T,{placeholder:" ",ref:k,type:m,id:H,disabled:y,className:M(j,T.className)})),L&&e("div",{className:$,children:e(B,{type:"button",className:W,onMouseDown:function(){k.current&&(k.current.value="")}})}),O,t("label",{htmlFor:H,className:M(q,z),children:[i," ",N&&e("span",{className:"text-error",children:"*"})]})]}),(h||v)&&t("span",{className:U,children:[e(G,{width:16,height:16,className:R?"fill-error":""})," ",h||v]})]})})),U=l((function(t){var n=t.variant,o=void 0===n?"body1":n,l=t.tag,r=void 0===l?"p":l,a=t.children,i=t.className,s=t.color,u=t.style;return e(r,{className:"typography-".concat(o," text-").concat(s," ").concat(i),style:u,children:a})})),$=function(n){var o,l=n.tabs,r=void 0===l?[]:l,a=n.initialTab,s=i(void 0===a?0:a),u=s[0],d=s[1];return t("div",{className:"w-full space-y-4",children:[e("div",{className:"flex border-b border-primary-10 gap-6 h-[54px] box-border",role:"tablist",children:r.map((function(e,n){return t("button",{role:"tab","aria-selected":n===u,"aria-controls":"tab-content-".concat(n),id:"tab-".concat(n),className:M("flex flex-row items-center py-4 px-1 cursor-pointer transition-colors duration-300 box-border gap-3",{"typography-body2 text-textcolor-dark border-b-[3px] border-textcolor-dark":n===u,"typography-body1 text-textcolor-grey-light border-b-[3px] border-transparent hover:text-textcolor-dark ":n!==u}),onClick:function(){return d(n)},children:[e.startTabContent,e.label,e.endTabContent]},n)}))}),e("div",{className:"",role:"tabpanel",id:"tab-content-".concat(u),"aria-labelledby":"tab-".concat(u),children:null===(o=r[u])||void 0===o?void 0:o.content})]})},W=C(["absolute inset-y-0 right-0 flex items-center justify-center"],{variants:{size:{sm:"mr-2",md:"mr-3",lg:"mr-4"}},defaultVariants:{size:"md"}}),Z=C(["transition-all"],{variants:{size:{sm:"size-[14px]",md:"size-5",lg:"size-6"},disabled:{true:"fill-input-text-disabled",false:"fill-input-text"},isFocus:{true:"fill-input-text-active rotate-180",false:""}},defaultVariants:{size:"md",disabled:!1,isFocus:!1}}),K=C([],{variants:{size:{sm:"pe-[30px]",md:"pe-[40px]",lg:"pe-[48px]"}},defaultVariants:{size:"md"}}),X=l((function(n,o){var l=n.id,r=n.options,a=n.value,g=n.label,f=n.size,p=void 0===f?"md":f,m=n.rounded,v=void 0===m?"normal":m,h=n.variant,b=void 0===h?"outline":h,w=n.helperText,C=n.errorMessage,y=n.fullwidth,S=void 0===y||y,R=n.disabled,E=void 0!==R&&R,N=n.error,M=void 0!==N&&N,I=n.filterMode,P=void 0!==I&&I,_=n.required,V=void 0===_||_,D=n.onChangeText,A=n.onSelect,L=F(n,["id","options","value","label","size","rounded","variant","helperText","errorMessage","fullwidth","disabled","error","filterMode","required","onChangeText","onSelect"]),O=l||"".concat(g,"-select"),z=i(!1),T=z[0],H=z[1],G=i(null),B=G[0],j=G[1],U=i(""),$=U[0],X=U[1];s((function(){a&&!B&&j(a)}),[a,B]);var Y=u((function(e){null==D||D(e),X(e.target.value)}),[D]),J=u((function(e){j(e),X(e.label),null==A||A(e)}),[A]),Q=d((function(){return r.filter((function(e){var t;return!P||(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(null==$?void 0:$.toLowerCase()))}))}),[r,P,$]);return t("div",{className:"relative ".concat(S?"w-full":""),children:[e(q,x({},L,{ref:o,readOnly:!P,value:$,onChange:Y,label:g,placeholder:" ",type:"text",rounded:v,variant:b,helperText:w,errorMessage:C,fullwidth:S,error:M,required:V,id:O,disabled:E,hasClearIcon:!1,size:p,className:K({size:p}),onFocus:function(){return H(!0)},onBlur:function(){return H(!1)},endIcon:e("div",{className:W({size:p}),children:e(k,{className:Z({size:p,isFocus:T})})})})),T&&t("ul",{className:"absolute mt-1 w-full bg-white border border-gray-300 rounded-md shadow-md z-10 max-h-60 overflow-y-auto",children:[Q.map((function(t){return t.renderLabel?e(c,{children:t.renderLabel({value:t.value,label:t.label,handleOnClick:function(){return J(t)},className:"px-4 py-2 hover:bg-gray-100 cursor-pointer ".concat((null==B?void 0:B.value)===t.value?" bg-gray-200":"")})},t.value):e("li",{onMouseDown:function(){return J(t)},className:"px-4 py-2 hover:bg-gray-100 cursor-pointer ".concat((null==B?void 0:B.value)===t.value?" bg-gray-200":""),children:t.label},t.value)})),0===Q.length&&e("li",{className:"px-4 py-14 text-center text-input-text",children:"Not found"})]})]})}));function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Y.apply(this,arguments)}function J(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function Q(...e){return u(J(...e),e)}function ee(e,t=[]){let n=[];const o=()=>{const t=n.map((e=>g(e)));return function(n){const o=(null==n?void 0:n[e])||t;return d((()=>({[`__scope${e}`]:{...n,[e]:o}})),[n,o])}};return o.scopeName=e,[function(t,o){const l=g(o),r=n.length;function a(t){const{scope:n,children:o,...a}=t,i=(null==n?void 0:n[e][r])||l,s=d((()=>a),Object.values(a));return f(i.Provider,{value:s},o)}return n=[...n,o],a.displayName=t+"Provider",[a,function(n,a){const i=(null==a?void 0:a[e][r])||l,s=p(i);if(s)return s;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},te(o,...t)]}function te(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const o=n.reduce(((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]})),{});return d((()=>({[`__scope${t.scopeName}`]:o})),[o])}};return n.scopeName=t.scopeName,n}function ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(null==e||e(o),!1===n||!o.defaultPrevented)return null==t?void 0:t(o)}}function oe(e){const t=r(e);return s((()=>{t.current=e})),d((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function le({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[o,l]=function({defaultProp:e,onChange:t}){const n=i(e),[o]=n,l=r(o),a=oe(t);return s((()=>{l.current!==o&&(a(o),l.current=o)}),[o,l,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,d=a?e:o,c=oe(n);return[d,u((t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&c(n)}else l(t)}),[a,e,l,c])]}const re=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?m:()=>{};const ae=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=i(),o=r({}),l=r(e),a=r("none"),d=e?"mounted":"unmounted",[c,g]=function(e,t){return b(((e,n)=>{const o=t[e][n];return null!=o?o:e}),e)}(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s((()=>{const e=ie(o.current);a.current="mounted"===c?e:"none"}),[c]),re((()=>{const t=o.current,n=l.current;if(n!==e){const o=a.current,r=ie(t);if(e)g("MOUNT");else if("none"===r||"none"===(null==t?void 0:t.display))g("UNMOUNT");else{g(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}l.current=e}}),[e,g]),re((()=>{if(t){const e=e=>{const n=ie(o.current).includes(e.animationName);e.target===t&&n&&R((()=>g("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=ie(o.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}g("ANIMATION_END")}),[t,g]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:u((e=>{e&&(o.current=getComputedStyle(e)),n(e)}),[])}}(t),l="function"==typeof n?n({present:o.isPresent}):v.only(n),a=Q(o.ref,l.ref);return"function"==typeof n||o.isPresent?h(l,{ref:a}):null};function ie(e){return(null==e?void 0:e.animationName)||"none"}ae.displayName="Presence";const se=l(((e,t)=>{const{children:n,...o}=e,l=v.toArray(n),r=l.find(ce);if(r){const e=r.props.children,n=l.map((t=>t===r?v.count(e)>1?v.only(null):w(e)?e.props.children:null:t));return f(ue,Y({},o,{ref:t}),w(e)?h(e,void 0,n):null)}return f(ue,Y({},o,{ref:t}),n)}));se.displayName="Slot";const ue=l(((e,t)=>{const{children:n,...o}=e;return w(n)?h(n,{...ge(o,n.props),ref:t?J(t,n.ref):n.ref}):v.count(n)>1?v.only(null):null}));ue.displayName="SlotClone";const de=({children:e})=>f(c,null,e);function ce(e){return w(e)&&e.type===de}function ge(e,t){const n={...t};for(const o in t){const l=e[o],r=t[o];/^on[A-Z]/.test(o)?l&&r?n[o]=(...e)=>{r(...e),l(...e)}:l&&(n[o]=l):"style"===o?n[o]={...l,...r}:"className"===o&&(n[o]=[l,r].filter(Boolean).join(" "))}return{...e,...n}}const fe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=l(((e,n)=>{const{asChild:o,...l}=e,r=o?se:t;return s((()=>{window[Symbol.for("radix-ui")]=!0}),[]),f(r,Y({},l,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});const pe="Checkbox",[me,ve]=ee(pe),[he,be]=me(pe),we=l(((e,t)=>{const{__scopeCheckbox:n,name:o,checked:l,defaultChecked:a,required:u,disabled:d,value:c="on",onCheckedChange:g,...p}=e,[m,v]=i(null),h=Q(t,(e=>v(e))),b=r(!1),w=!m||Boolean(m.closest("form")),[C=!1,y]=le({prop:l,defaultProp:a,onChange:g}),S=r(C);return s((()=>{const e=null==m?void 0:m.form;if(e){const t=()=>y(S.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[m,y]),f(he,{scope:n,state:C,disabled:d},f(fe.button,Y({type:"button",role:"checkbox","aria-checked":ye(C)?"mixed":C,"aria-required":u,"data-state":Se(C),"data-disabled":d?"":void 0,disabled:d,value:c},p,{ref:h,onKeyDown:ne(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:ne(e.onClick,(e=>{y((e=>!!ye(e)||!e)),w&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())}))})),w&&f(Ce,{control:m,bubbles:!b.current,name:o,value:c,checked:C,required:u,disabled:d,style:{transform:"translateX(-100%)"}}))})),Ce=e=>{const{control:t,checked:n,bubbles:o=!0,...l}=e,a=r(null),u=function(e){const t=r({value:e,previous:e});return d((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(n),c=function(e){const[t,n]=i(void 0);return re((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let l,r;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,r=t.blockSize}else l=e.offsetWidth,r=e.offsetHeight;n({width:l,height:r})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(t);return s((()=>{const e=a.current,t=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&l){const t=new Event("click",{bubbles:o});e.indeterminate=ye(n),l.call(e,!ye(n)&&n),e.dispatchEvent(t)}}),[u,n,o]),f("input",Y({type:"checkbox","aria-hidden":!0,defaultChecked:!ye(n)&&n},l,{tabIndex:-1,ref:a,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ye(e){return"indeterminate"===e}function Se(e){return ye(e)?"indeterminate":e?"checked":"unchecked"}const Re=we,xe=l(((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...l}=e,r=be("CheckboxIndicator",n);return f(ae,{present:o||ye(r.state)||!0===r.state},f(fe.span,Y({"data-state":Se(r.state),"data-disabled":r.disabled?"":void 0},l,{ref:t,style:{pointerEvents:"none",...e.style}})))}));var Fe=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e(Re,x({ref:n,className:M("peer h-4 w-4 shrink-0 rounded-sm border border-primary-30 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:border-socondary-120 disabled:border-socondary-110",{"data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground":!l.disabled,"bg-grey2-300":l.checked&&l.disabled},o)},l,{children:e(xe,{className:M("flex items-center justify-center text-current"),children:e(T,{className:"h-4 w-4"})})}))}));Fe.displayName=Re.displayName;const Ee=l(((e,t)=>f(fe.label,Y({},e,{ref:t,onMouseDown:t=>{var n;null===(n=e.onMouseDown)||void 0===n||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()}}))));var Ne=C("typography-label1 peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Me=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e(Ee,x({ref:n,className:M(Ne(),o)},l))}));Me.displayName=Ee.displayName;var Ie=o.forwardRef((function(t,n){var o=t.className,l=t.type,r=F(t,["className","type"]);return e("input",x({type:l,className:M("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",o),ref:n},r))}));Ie.displayName="Input";var Pe=o.forwardRef((function(t,n){var o=t.className,l=t.rootRef,r=F(t,["className","rootRef"]);return e("div",{className:"relative h-full w-full overflow-auto",ref:l,children:e("table",x({ref:n,className:M("w-full caption-bottom text-sm border-collapse",o)},r))})}));Pe.displayName="Table";var _e=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("thead",x({ref:n,className:M("[&_tr]:border-b bg-secondary-80",o)},l))}));_e.displayName="TableHeader";var Ve=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("tbody",x({ref:n,className:M("[&_tr:last-child]:border-0",o)},l))}));Ve.displayName="TableBody";var De=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("tfoot",x({ref:n,className:M("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",o)},l))}));De.displayName="TableFooter";var Ae=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("tr",x({ref:n,className:M("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-grey-20",o)},l))}));Ae.displayName="TableRow";var Le=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("th",x({ref:n,className:M(" h-12 py-3 px-6 text-left align-middle typography-body2 text-textcolor-grey-dark [&:has([role=checkbox])]:pr-4 [&:has([role=checkbox])]:w-4",o)},l))}));Le.displayName="TableHead";var Oe=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("td",x({ref:n,className:M(" py-3 px-6 text-left align-middle typography-body3 text-textcolor-grey-dark [&:has([role=checkbox])]:pr-4 [&:has([role=checkbox])]:w-4",o)},l))}));Oe.displayName="TableCell";var ze=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("caption",x({ref:n,className:M("mt-4 text-sm text-muted-foreground",o)},l))}));
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{forwardRef as l,useRef as r,useImperativeHandle as a,useState as i,useEffect as s,useCallback as u,useMemo as d,Fragment as c,createContext as g,createElement as f,useContext as p,useLayoutEffect as m,Children as v,cloneElement as h,useReducer as b,isValidElement as w}from"react";import{cva as C}from"class-variance-authority";import{twMerge as y}from"tailwind-merge";import S,{flushSync as R}from"react-dom";var x=function(){return x=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e},x.apply(this,arguments)};function F(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n}"function"==typeof SuppressedError&&SuppressedError;var E=C(["gap-2 font-bold text-white hover:bg-opacity-90 active:scale-[98%]"],{variants:{color:{primary:"bg-primary border-primary text-primary hover:bg-primary-80",secondary:"border-secondary bg-secondary-100 text-secondary-foreground hover:bg-secondary-120",tertiary:"border-tertiary-120 bg-tertiary-120 text-tertiary-120 hover:bg-tertiary-100",success:"border-success bg-success text-success hover:bg-success-120",info:"border-info bg-info text-info hover:bg-info-100",warning:"border-warning bg-warning text-warning hover:bg-warning-100 hover:border-warning-100",error:"border-error bg-error text-error hover:bg-error-120 hover:border-error-120"},size:{sm:"px-3 py-1 text-sm rounded-[--btn-rounded-sm]",md:"px-4 py-2 text-sm rounded-[--btn-rounded-md]",lg:"px-6 py-4 text-base rounded-[--btn-rounded-lg]"},variant:{solid:"border",outline:"border bg-transparent hover:bg-opacity-20",flat:"bg-transparent hover:bg-opacity-20",link:"bg-transparent underline underline-offset-4 hover:bg-transparent hover:text-opacity-80"},disabled:{true:"pointer-events-none border-transparent bg-secondary-110 text-secondary-130"},fullwidth:{true:"w-full"}},compoundVariants:[{variant:["flat","link"],disabled:!0,class:"border-transparent bg-transparent"},{variant:"solid",color:"primary",class:"text-primary-foreground"},{variant:"solid",color:"secondary",class:"text-secondary-foreground"},{variant:"solid",disabled:!0,color:"secondary",class:"text-white"},{variant:"solid",color:"tertiary",class:"text-tertiary-foreground"},{variant:"solid",color:"success",class:"text-success-foreground"},{variant:"solid",color:"info",class:"text-info-foreground"},{variant:"solid",color:"warning",class:"text-warning-foreground"},{variant:"solid",color:"error",class:"text-error-foreground"}],defaultVariants:{size:"md",color:"primary",variant:"solid",fullwidth:!0}});function N(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=N(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function M(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return y(function(){for(var e,t,n=0,o="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=N(e))&&(o&&(o+=" "),o+=t);return o}(e))}var I=l((function(o,l){var r=o.size,a=void 0===r?"md":r,i=o.color,s=void 0===i?"primary":i,u=o.variant,d=void 0===u?"solid":u,c=o.title,g=o.children,f=o.startIcon,p=o.endIcon,m=o.disabled,v=void 0!==m&&m,h=o.fullwidth,b=void 0!==h&&h,w=o.isLoading,C=void 0!==w&&w,y=o.className,S=F(o,["size","color","variant","title","children","startIcon","endIcon","disabled","fullwidth","isLoading","className"]),R=v||C;return e("button",x({type:"button"},S,{ref:l,"aria-disabled":R||void 0,tabIndex:R?-1:0,className:M(E({size:a,color:s,variant:d,disabled:v,fullwidth:b}),y),disabled:R,children:t(n,{children:[f,g||c,p]})}))})),P=C(["border-0 outline-none","p-1 flex w-auto box-border","peer text-black placeholder:text-transparent"],{variants:{size:{sm:"p-2 px-3 typography-small1",md:"py-2 px-3 typography-subtitile4",lg:"p-4 typography-subtitile1"},rounded:{none:"rounded-none",normal:"rounded-xl",full:"rounded-full"},variant:{flat:"",outline:"ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-1 focus:ring-inset focus:ring-input-stroke-active",underline:"border-b-2 border-input-stroke transition-colors hover:border-input-stroke-active focus:border-input-stroke"},fullwidth:{true:"w-full"},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled"},error:{true:"ring-error focus:ring-error"},hasClearIcon:{true:""}},compoundVariants:[{variant:"underline",className:"rounded-none"},{hasClearIcon:!0,size:"sm",class:"focus:pe-6"},{hasClearIcon:!0,size:"md",class:"focus:pe-8"},{hasClearIcon:!0,size:"lg",class:"focus:pe-10"}],defaultVariants:{size:"md",variant:"outline",rounded:"normal",fullwidth:!1,disabled:!1,error:!1,hasClearIcon:!1}}),_=C(["absolute block duration-450 transition-all px-[2px] text-input-text peer-focus:text-input-text-active peer-focus:bg-input-label-background"],{variants:{size:{sm:["left-3 -top-1.5 typography-label2 bg-input-label-background","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label2"],md:["left-3 -top-1.5 typography-label1 bg-input-label-background","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitile4 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"],lg:["left-4 -top-1.5 typography-label1 bg-input-label-background","peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitile1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled"},error:{true:"ring-error"}},defaultVariants:{size:"md",disabled:!1,error:!1}}),V=C(["text-small1 flex flex-row items-center gap-1"],{variants:{size:{sm:"mt-1",md:"mt-[6px]",lg:"mt-[6px]"},disabled:{true:"text-input-text-disabled"},error:{true:"text-error",false:"text-input-text"}},defaultVariants:{size:"md",disabled:!1,error:!1}}),D=C(["absolute inset-y-0 right-0 items-center justify-center hidden peer-focus:flex"],{variants:{size:{sm:"mr-2",md:"mr-3",lg:"mr-4"}},defaultVariants:{size:"md"}}),A=C(["cursor-pointer z-50 fill-input-stroke-active hover:fill-input-text"],{variants:{size:{sm:"size-3",md:"size-4",lg:"size-5"}},defaultVariants:{size:"md"}});const L=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M8 2a.75.75 0 0 1 .75.75v8.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.22 3.22V2.75A.75.75 0 0 1 8 2Z",clipRule:"evenodd"}))}));const O=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z",clipRule:"evenodd"}))}));const z=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M13.78 10.47a.75.75 0 0 1 0 1.06l-2.25 2.25a.75.75 0 0 1-1.06 0l-2.25-2.25a.75.75 0 1 1 1.06-1.06l.97.97V5.75a.75.75 0 0 1 1.5 0v5.69l.97-.97a.75.75 0 0 1 1.06 0ZM2.22 5.53a.75.75 0 0 1 0-1.06l2.25-2.25a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1-1.06 1.06l-.97-.97v5.69a.75.75 0 0 1-1.5 0V4.56l-.97.97a.75.75 0 0 1-1.06 0Z",clipRule:"evenodd"}))}));const T=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}));const k=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}));const H=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M11.986 3H12a2 2 0 0 1 2 2v6a2 2 0 0 1-1.5 1.937V7A2.5 2.5 0 0 0 10 4.5H4.063A2 2 0 0 1 6 3h.014A2.25 2.25 0 0 1 8.25 1h1.5a2.25 2.25 0 0 1 2.236 2ZM10.5 4v-.75a.75.75 0 0 0-.75-.75h-1.5a.75.75 0 0 0-.75.75V4h3Z",clipRule:"evenodd"}),o.createElement("path",{fillRule:"evenodd",d:"M3 6a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H3Zm1.75 2.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5h-3.5ZM4 11.75a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 0 1.5h-3.5a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}));const G=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}));const B=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{fillRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm2.78-4.22a.75.75 0 0 1-1.06 0L8 9.06l-1.72 1.72a.75.75 0 1 1-1.06-1.06L6.94 8 5.22 6.28a.75.75 0 0 1 1.06-1.06L8 6.94l1.72-1.72a.75.75 0 1 1 1.06 1.06L9.06 8l1.72 1.72a.75.75 0 0 1 0 1.06Z",clipRule:"evenodd"}))}));const j=o.forwardRef((function({title:e,titleId:t,...n},l){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":t},n),e?o.createElement("title",{id:t},e):null,o.createElement("path",{d:"M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z"}))}));var q=l((function(n,o){var l=n.id,i=n.label,s=n.size,u=void 0===s?"md":s,d=n.rounded,c=void 0===d?"normal":d,g=n.variant,f=void 0===g?"outline":g,p=n.type,m=void 0===p?"text":p,v=n.helperText,h=n.errorMessage,b=n.fullwidth,w=void 0===b||b,C=n.disabled,y=void 0!==C&&C,S=n.error,R=void 0!==S&&S,E=n.required,N=void 0===E||E,I=n.hasClearIcon,L=void 0===I||I,O=n.endIcon,z=n.labelClassName,T=F(n,["id","label","size","rounded","variant","type","helperText","errorMessage","fullwidth","disabled","error","required","hasClearIcon","endIcon","labelClassName"]),k=r(null),H=l||"".concat(m,"-").concat(i,"-input"),j=P({size:u,rounded:c,variant:f,fullwidth:w,disabled:y,error:R,hasClearIcon:L}),q=_({size:u,disabled:y,error:R}),U=V({size:u,error:R,disabled:y}),$=D({size:u}),W=A({size:u});a(o,(function(){return null==k?void 0:k.current}));return t("div",{className:"inline-flex flex-col ".concat(w?"w-full":""),children:[t("div",{className:"relative",children:[e("input",x({},T,{placeholder:" ",ref:k,type:m,id:H,disabled:y,className:M(j,T.className)})),L&&e("div",{className:$,children:e(B,{type:"button",className:W,onMouseDown:function(){k.current&&(k.current.value="")}})}),O,t("label",{htmlFor:H,className:M(q,z),children:[i," ",N&&e("span",{className:"text-error",children:"*"})]})]}),(h||v)&&t("span",{className:U,children:[e(G,{width:16,height:16,className:R?"fill-error":""})," ",h||v]})]})})),U=l((function(t){var n=t.variant,o=void 0===n?"body1":n,l=t.tag,r=void 0===l?"p":l,a=t.children,i=t.className,s=t.color,u=t.style;return e(r,{className:"typography-".concat(o," text-").concat(s," ").concat(i),style:u,children:a})})),$=function(n){var o,l=n.tabs,r=void 0===l?[]:l,a=n.initialTab,s=i(void 0===a?0:a),u=s[0],d=s[1];return t("div",{className:"w-full space-y-4",children:[e("div",{className:"flex border-b border-primary-10 gap-6 h-[54px] box-border",role:"tablist",children:r.map((function(e,n){return t("button",{role:"tab","aria-selected":n===u,"aria-controls":"tab-content-".concat(n),id:"tab-".concat(n),className:M("flex flex-row items-center py-4 px-1 cursor-pointer transition-colors duration-300 box-border gap-3",{"typography-body2 text-textcolor-dark border-b-[3px] border-textcolor-dark":n===u,"typography-body1 text-textcolor-grey-light border-b-[3px] border-transparent hover:text-textcolor-dark ":n!==u}),onClick:function(){return d(n)},children:[e.startTabContent,e.label,e.endTabContent]},n)}))}),e("div",{className:"",role:"tabpanel",id:"tab-content-".concat(u),"aria-labelledby":"tab-".concat(u),children:null===(o=r[u])||void 0===o?void 0:o.content})]})},W=C(["absolute inset-y-0 right-0 flex items-center justify-center"],{variants:{size:{sm:"mr-2",md:"mr-3",lg:"mr-4"}},defaultVariants:{size:"md"}}),Z=C(["transition-all"],{variants:{size:{sm:"size-[14px]",md:"size-5",lg:"size-6"},disabled:{true:"fill-input-text-disabled",false:"fill-input-text"},isFocus:{true:"fill-input-text-active rotate-180",false:""}},defaultVariants:{size:"md",disabled:!1,isFocus:!1}}),K=C([],{variants:{size:{sm:"pe-[30px]",md:"pe-[40px]",lg:"pe-[48px]"}},defaultVariants:{size:"md"}}),X=l((function(n,o){var l=n.id,a=n.options,g=n.value,f=n.label,p=n.size,m=void 0===p?"md":p,v=n.rounded,h=void 0===v?"normal":v,b=n.variant,w=void 0===b?"outline":b,C=n.helperText,y=n.errorMessage,S=n.fullwidth,R=void 0===S||S,E=n.disabled,N=void 0!==E&&E,M=n.error,I=void 0!==M&&M,P=n.filterMode,_=void 0!==P&&P,V=n.required,D=void 0===V||V,A=n.onChangeText,L=n.onSelect,O=F(n,["id","options","value","label","size","rounded","variant","helperText","errorMessage","fullwidth","disabled","error","filterMode","required","onChangeText","onSelect"]),z=l||"".concat(f,"-select"),T=i(!1),H=T[0],G=T[1],B=i(null),j=B[0],U=B[1],$=i(""),X=$[0],Y=$[1],J=r("");s((function(){g&&!j&&U(g)}),[g,j]);var Q=u((function(e){null==A||A(e),Y(e.target.value)}),[A]),ee=u((function(e){U(e),Y(e.label),null==L||L(e)}),[L]),te=d((function(){return a.filter((function(e){var t;return!_||(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(null==X?void 0:X.toLowerCase()))}))}),[a,_,X]),ne=u((function(e){var t;G(!0),null===(t=null==O?void 0:O.onFocus)||void 0===t||t.call(O,e)}),[null==O?void 0:O.onFocus]),oe=u((function(e){var t=te.find((function(t){var n,o;return t.value===(null===(n=e.target)||void 0===n?void 0:n.value)||t.label===(null===(o=e.target)||void 0===o?void 0:o.value)})),n=t||{value:"",label:""};!!!t&&X&&(n={value:"",label:""}),"Enter"!==J.current&&(U(n),Y(n.label),null==L||L(n))}),[te,X]),le=u((function(e){var t;G(!1),oe(e),null===(t=null==O?void 0:O.onBlur)||void 0===t||t.call(O,e)}),[null==O?void 0:O.onBlur]),re=u((function(e){var t;J.current=e.code,null===(t=null==O?void 0:O.onKeyDown)||void 0===t||t.call(O,e)}),[null==O?void 0:O.onKeyDown]);return t("div",{className:"relative ".concat(R?"w-full":""),children:[e(q,x({},O,{ref:o,readOnly:!_,value:X,onChange:Q,label:f,placeholder:" ",type:"text",rounded:h,variant:w,helperText:C,errorMessage:y,fullwidth:R,error:I,required:D,id:z,disabled:N,hasClearIcon:!1,size:m,className:K({size:m}),onFocus:ne,onBlur:le,onKeyDown:re,endIcon:e("div",{className:W({size:m}),children:e(k,{className:Z({size:m,isFocus:H})})})})),H&&t("ul",{className:"absolute mt-1 w-full bg-white border border-gray-300 rounded-md shadow-md z-10 max-h-60 overflow-y-auto",children:[te.map((function(t){return t.renderLabel?e(c,{children:t.renderLabel({value:t.value,label:t.label,handleOnClick:function(){return ee(t)},className:"px-4 py-2 hover:bg-gray-100 cursor-pointer ".concat((null==j?void 0:j.value)===t.value?" bg-gray-200":"")})},t.value):e("li",{onMouseDown:function(){return ee(t)},className:"px-4 py-2 hover:bg-gray-100 cursor-pointer ".concat((null==j?void 0:j.value)===t.value?" bg-gray-200":""),children:t.label},t.value)})),0===te.length&&e("li",{className:"px-4 py-14 text-center text-input-text",children:"Not found"})]})]})}));function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Y.apply(this,arguments)}function J(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function Q(...e){return u(J(...e),e)}function ee(e,t=[]){let n=[];const o=()=>{const t=n.map((e=>g(e)));return function(n){const o=(null==n?void 0:n[e])||t;return d((()=>({[`__scope${e}`]:{...n,[e]:o}})),[n,o])}};return o.scopeName=e,[function(t,o){const l=g(o),r=n.length;function a(t){const{scope:n,children:o,...a}=t,i=(null==n?void 0:n[e][r])||l,s=d((()=>a),Object.values(a));return f(i.Provider,{value:s},o)}return n=[...n,o],a.displayName=t+"Provider",[a,function(n,a){const i=(null==a?void 0:a[e][r])||l,s=p(i);if(s)return s;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},te(o,...t)]}function te(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const o=n.reduce(((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]})),{});return d((()=>({[`__scope${t.scopeName}`]:o})),[o])}};return n.scopeName=t.scopeName,n}function ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(null==e||e(o),!1===n||!o.defaultPrevented)return null==t?void 0:t(o)}}function oe(e){const t=r(e);return s((()=>{t.current=e})),d((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function le({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[o,l]=function({defaultProp:e,onChange:t}){const n=i(e),[o]=n,l=r(o),a=oe(t);return s((()=>{l.current!==o&&(a(o),l.current=o)}),[o,l,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,d=a?e:o,c=oe(n);return[d,u((t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&c(n)}else l(t)}),[a,e,l,c])]}const re=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?m:()=>{};const ae=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=i(),o=r({}),l=r(e),a=r("none"),d=e?"mounted":"unmounted",[c,g]=function(e,t){return b(((e,n)=>{const o=t[e][n];return null!=o?o:e}),e)}(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s((()=>{const e=ie(o.current);a.current="mounted"===c?e:"none"}),[c]),re((()=>{const t=o.current,n=l.current;if(n!==e){const o=a.current,r=ie(t);if(e)g("MOUNT");else if("none"===r||"none"===(null==t?void 0:t.display))g("UNMOUNT");else{g(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}l.current=e}}),[e,g]),re((()=>{if(t){const e=e=>{const n=ie(o.current).includes(e.animationName);e.target===t&&n&&R((()=>g("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=ie(o.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}g("ANIMATION_END")}),[t,g]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:u((e=>{e&&(o.current=getComputedStyle(e)),n(e)}),[])}}(t),l="function"==typeof n?n({present:o.isPresent}):v.only(n),a=Q(o.ref,l.ref);return"function"==typeof n||o.isPresent?h(l,{ref:a}):null};function ie(e){return(null==e?void 0:e.animationName)||"none"}ae.displayName="Presence";const se=l(((e,t)=>{const{children:n,...o}=e,l=v.toArray(n),r=l.find(ce);if(r){const e=r.props.children,n=l.map((t=>t===r?v.count(e)>1?v.only(null):w(e)?e.props.children:null:t));return f(ue,Y({},o,{ref:t}),w(e)?h(e,void 0,n):null)}return f(ue,Y({},o,{ref:t}),n)}));se.displayName="Slot";const ue=l(((e,t)=>{const{children:n,...o}=e;return w(n)?h(n,{...ge(o,n.props),ref:t?J(t,n.ref):n.ref}):v.count(n)>1?v.only(null):null}));ue.displayName="SlotClone";const de=({children:e})=>f(c,null,e);function ce(e){return w(e)&&e.type===de}function ge(e,t){const n={...t};for(const o in t){const l=e[o],r=t[o];/^on[A-Z]/.test(o)?l&&r?n[o]=(...e)=>{r(...e),l(...e)}:l&&(n[o]=l):"style"===o?n[o]={...l,...r}:"className"===o&&(n[o]=[l,r].filter(Boolean).join(" "))}return{...e,...n}}const fe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=l(((e,n)=>{const{asChild:o,...l}=e,r=o?se:t;return s((()=>{window[Symbol.for("radix-ui")]=!0}),[]),f(r,Y({},l,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});const pe="Checkbox",[me,ve]=ee(pe),[he,be]=me(pe),we=l(((e,t)=>{const{__scopeCheckbox:n,name:o,checked:l,defaultChecked:a,required:u,disabled:d,value:c="on",onCheckedChange:g,...p}=e,[m,v]=i(null),h=Q(t,(e=>v(e))),b=r(!1),w=!m||Boolean(m.closest("form")),[C=!1,y]=le({prop:l,defaultProp:a,onChange:g}),S=r(C);return s((()=>{const e=null==m?void 0:m.form;if(e){const t=()=>y(S.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[m,y]),f(he,{scope:n,state:C,disabled:d},f(fe.button,Y({type:"button",role:"checkbox","aria-checked":ye(C)?"mixed":C,"aria-required":u,"data-state":Se(C),"data-disabled":d?"":void 0,disabled:d,value:c},p,{ref:h,onKeyDown:ne(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:ne(e.onClick,(e=>{y((e=>!!ye(e)||!e)),w&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())}))})),w&&f(Ce,{control:m,bubbles:!b.current,name:o,value:c,checked:C,required:u,disabled:d,style:{transform:"translateX(-100%)"}}))})),Ce=e=>{const{control:t,checked:n,bubbles:o=!0,...l}=e,a=r(null),u=function(e){const t=r({value:e,previous:e});return d((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(n),c=function(e){const[t,n]=i(void 0);return re((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let l,r;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,r=t.blockSize}else l=e.offsetWidth,r=e.offsetHeight;n({width:l,height:r})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(t);return s((()=>{const e=a.current,t=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&l){const t=new Event("click",{bubbles:o});e.indeterminate=ye(n),l.call(e,!ye(n)&&n),e.dispatchEvent(t)}}),[u,n,o]),f("input",Y({type:"checkbox","aria-hidden":!0,defaultChecked:!ye(n)&&n},l,{tabIndex:-1,ref:a,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ye(e){return"indeterminate"===e}function Se(e){return ye(e)?"indeterminate":e?"checked":"unchecked"}const Re=we,xe=l(((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...l}=e,r=be("CheckboxIndicator",n);return f(ae,{present:o||ye(r.state)||!0===r.state},f(fe.span,Y({"data-state":Se(r.state),"data-disabled":r.disabled?"":void 0},l,{ref:t,style:{pointerEvents:"none",...e.style}})))}));var Fe=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e(Re,x({ref:n,className:M("peer h-4 w-4 shrink-0 rounded-sm border border-primary-30 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:border-socondary-120 disabled:border-socondary-110",{"data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground":!l.disabled,"bg-grey2-300":l.checked&&l.disabled},o)},l,{children:e(xe,{className:M("flex items-center justify-center text-current"),children:e(T,{className:"h-4 w-4"})})}))}));Fe.displayName=Re.displayName;const Ee=l(((e,t)=>f(fe.label,Y({},e,{ref:t,onMouseDown:t=>{var n;null===(n=e.onMouseDown)||void 0===n||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()}}))));var Ne=C("typography-label1 peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Me=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e(Ee,x({ref:n,className:M(Ne(),o)},l))}));Me.displayName=Ee.displayName;var Ie=o.forwardRef((function(t,n){var o=t.className,l=t.type,r=F(t,["className","type"]);return e("input",x({type:l,className:M("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",o),ref:n},r))}));Ie.displayName="Input";var Pe=o.forwardRef((function(t,n){var o=t.className,l=t.rootRef,r=F(t,["className","rootRef"]);return e("div",{className:"relative h-full w-full overflow-auto",ref:l,children:e("table",x({ref:n,className:M("w-full caption-bottom text-sm border-collapse",o)},r))})}));Pe.displayName="Table";var _e=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("thead",x({ref:n,className:M("[&_tr]:border-b bg-secondary-80",o)},l))}));_e.displayName="TableHeader";var Ve=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("tbody",x({ref:n,className:M("[&_tr:last-child]:border-0",o)},l))}));Ve.displayName="TableBody";var De=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("tfoot",x({ref:n,className:M("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",o)},l))}));De.displayName="TableFooter";var Ae=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("tr",x({ref:n,className:M("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-grey-20",o)},l))}));Ae.displayName="TableRow";var Le=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("th",x({ref:n,className:M(" h-12 py-3 px-6 text-left align-middle typography-body2 text-textcolor-grey-dark [&:has([role=checkbox])]:pr-4 [&:has([role=checkbox])]:w-4",o)},l))}));Le.displayName="TableHead";var Oe=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("td",x({ref:n,className:M(" py-3 px-6 text-left align-middle typography-body3 text-textcolor-grey-dark [&:has([role=checkbox])]:pr-4 [&:has([role=checkbox])]:w-4",o)},l))}));Oe.displayName="TableCell";var ze=o.forwardRef((function(t,n){var o=t.className,l=F(t,["className"]);return e("caption",x({ref:n,className:M("mt-4 text-sm text-muted-foreground",o)},l))}));
2
2
  /**
3
3
  * table-core
4
4
  *