@klu_dev/ui-klu-green 1.2.17 → 1.2.18
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/index.css +32 -0
- package/dist/index.d.ts +42 -3
- package/dist/index.js +371 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -230,6 +230,10 @@ button,
|
|
|
230
230
|
.uiklu-left-0{
|
|
231
231
|
left: 0px;
|
|
232
232
|
|
|
233
|
+
}
|
|
234
|
+
.uiklu-left-2{
|
|
235
|
+
left: 0.5rem;
|
|
236
|
+
|
|
233
237
|
}
|
|
234
238
|
.uiklu-left-3{
|
|
235
239
|
left: 0.75rem;
|
|
@@ -975,6 +979,10 @@ button,
|
|
|
975
979
|
.uiklu-cursor-default{
|
|
976
980
|
cursor: default;
|
|
977
981
|
|
|
982
|
+
}
|
|
983
|
+
.uiklu-cursor-not-allowed{
|
|
984
|
+
cursor: not-allowed;
|
|
985
|
+
|
|
978
986
|
}
|
|
979
987
|
.uiklu-cursor-pointer{
|
|
980
988
|
cursor: pointer;
|
|
@@ -2485,6 +2493,18 @@ input.uiklu-flex:not(:placeholder-shown) {
|
|
|
2485
2493
|
|
|
2486
2494
|
}
|
|
2487
2495
|
|
|
2496
|
+
.placeholder\:uiklu-text-gray800::-moz-placeholder{
|
|
2497
|
+
--tw-text-opacity: 1;
|
|
2498
|
+
color: hsl(var(--uiklu-gray-800) / var(--tw-text-opacity, 1));
|
|
2499
|
+
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
.placeholder\:uiklu-text-gray800::placeholder{
|
|
2503
|
+
--tw-text-opacity: 1;
|
|
2504
|
+
color: hsl(var(--uiklu-gray-800) / var(--tw-text-opacity, 1));
|
|
2505
|
+
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2488
2508
|
.placeholder\:uiklu-text-white\/40::-moz-placeholder{
|
|
2489
2509
|
color: rgb(255 255 255 / 0.4);
|
|
2490
2510
|
|
|
@@ -2540,6 +2560,12 @@ input.uiklu-flex:not(:placeholder-shown) {
|
|
|
2540
2560
|
|
|
2541
2561
|
}
|
|
2542
2562
|
|
|
2563
|
+
.focus-within\:uiklu-bg-white:focus-within{
|
|
2564
|
+
--tw-bg-opacity: 1;
|
|
2565
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
|
2566
|
+
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2543
2569
|
.focus-within\:uiklu-shadow-\[0_0_0_3px_\#AFD8D8\]:focus-within{
|
|
2544
2570
|
--tw-shadow: 0 0 0 3px #AFD8D8;
|
|
2545
2571
|
--tw-shadow-colored: 0 0 0 3px var(--tw-shadow-color);
|
|
@@ -2813,6 +2839,12 @@ input.uiklu-flex:not(:placeholder-shown) {
|
|
|
2813
2839
|
|
|
2814
2840
|
}
|
|
2815
2841
|
|
|
2842
|
+
.data-\[placeholder\]\:uiklu-text-gray800[data-placeholder]{
|
|
2843
|
+
--tw-text-opacity: 1;
|
|
2844
|
+
color: hsl(var(--uiklu-gray-800) / var(--tw-text-opacity, 1));
|
|
2845
|
+
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2816
2848
|
@media (min-width: 640px){
|
|
2817
2849
|
.sm\:uiklu-flex-row{
|
|
2818
2850
|
flex-direction: row;
|
package/dist/index.d.ts
CHANGED
|
@@ -147,6 +147,7 @@ declare const Icons: {
|
|
|
147
147
|
TICKET: react_jsx_runtime.JSX.Element;
|
|
148
148
|
CASH: react_jsx_runtime.JSX.Element;
|
|
149
149
|
CHEVRON_RIGHT: react_jsx_runtime.JSX.Element;
|
|
150
|
+
CHEVRON_DOWN: react_jsx_runtime.JSX.Element;
|
|
150
151
|
SHIELD_CHECK: react_jsx_runtime.JSX.Element;
|
|
151
152
|
CLOSE: react_jsx_runtime.JSX.Element;
|
|
152
153
|
MONEY: react_jsx_runtime.JSX.Element;
|
|
@@ -205,13 +206,13 @@ declare const searchSelectTriggerVariants: (props?: ({
|
|
|
205
206
|
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
206
207
|
error?: boolean | null | undefined;
|
|
207
208
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
208
|
-
interface Option {
|
|
209
|
+
interface Option$1 {
|
|
209
210
|
value: string;
|
|
210
211
|
label: string;
|
|
211
212
|
extra?: React.ReactNode;
|
|
212
213
|
}
|
|
213
214
|
interface SearchSelectProps extends VariantProps<typeof searchSelectTriggerVariants> {
|
|
214
|
-
options: Option[];
|
|
215
|
+
options: Option$1[];
|
|
215
216
|
value: string;
|
|
216
217
|
onChange: (value: string) => void;
|
|
217
218
|
placeholder?: string;
|
|
@@ -302,4 +303,42 @@ interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement
|
|
|
302
303
|
}
|
|
303
304
|
declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
304
305
|
|
|
305
|
-
|
|
306
|
+
type SelectFieldSize = "sm" | "md" | "lg" | "full";
|
|
307
|
+
interface SelectFieldProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root> {
|
|
308
|
+
label: string;
|
|
309
|
+
placeholder?: string;
|
|
310
|
+
size?: SelectFieldSize;
|
|
311
|
+
error?: string;
|
|
312
|
+
required?: boolean;
|
|
313
|
+
disabled?: boolean;
|
|
314
|
+
className?: string;
|
|
315
|
+
labelClassName?: string;
|
|
316
|
+
}
|
|
317
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
318
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
319
|
+
declare const SelectField: React.ForwardRefExoticComponent<SelectFieldProps & React.RefAttributes<HTMLButtonElement>>;
|
|
320
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
321
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
322
|
+
|
|
323
|
+
type SearchSelectFieldSize = "sm" | "md" | "lg" | "full";
|
|
324
|
+
interface Option {
|
|
325
|
+
value: string;
|
|
326
|
+
label: string;
|
|
327
|
+
extra?: React.ReactNode;
|
|
328
|
+
}
|
|
329
|
+
interface SearchSelectFieldProps {
|
|
330
|
+
options: Option[];
|
|
331
|
+
value: string;
|
|
332
|
+
onChange: (value: string) => void;
|
|
333
|
+
label: string;
|
|
334
|
+
placeholder?: string;
|
|
335
|
+
size?: SearchSelectFieldSize;
|
|
336
|
+
error?: string;
|
|
337
|
+
required?: boolean;
|
|
338
|
+
disabled?: boolean;
|
|
339
|
+
className?: string;
|
|
340
|
+
labelClassName?: string;
|
|
341
|
+
}
|
|
342
|
+
declare const SearchSelectField: ({ options, value, onChange, label, placeholder, size, error, required, disabled, className, labelClassName, }: SearchSelectFieldProps) => react_jsx_runtime.JSX.Element;
|
|
343
|
+
|
|
344
|
+
export { BackButton, BalanceInfo, Button, Checkbox, type CheckboxProps, DetailCard, type DetailCardItem, type DetailCardProps, GridCard, IconBadge, type IconBadgeProps, Icons, Input, InputCode, InputPhone, type InputPhoneProps, type LadaOption, LoadingScreen, MobileMenuDrawer, Modal, PromoBanner, SearchSelect, SearchSelectField, type SearchSelectFieldProps, Select, SelectContent, SelectField, type SelectFieldProps, SelectGroup, SelectItem, SelectValue, SidebarTabs, TextField, type TextFieldProps, ToastAction, Toaster, Typography, useToast };
|
package/dist/index.js
CHANGED
|
@@ -82,6 +82,24 @@ var ChevronRightIcon = ({ className }) => /* @__PURE__ */ jsx(
|
|
|
82
82
|
)
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
|
+
var ChevronDownIcon = ({ className }) => /* @__PURE__ */ jsx(
|
|
86
|
+
"svg",
|
|
87
|
+
{
|
|
88
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
89
|
+
width: "20",
|
|
90
|
+
height: "20",
|
|
91
|
+
viewBox: "0 0 20 20",
|
|
92
|
+
fill: "none",
|
|
93
|
+
className,
|
|
94
|
+
children: /* @__PURE__ */ jsx(
|
|
95
|
+
"path",
|
|
96
|
+
{
|
|
97
|
+
d: "M16.6923 7.94217L10.4423 14.1922C10.3842 14.2503 10.3153 14.2964 10.2394 14.3278C10.1636 14.3593 10.0822 14.3755 10.0001 14.3755C9.91797 14.3755 9.83664 14.3593 9.76077 14.3278C9.68489 14.2964 9.61596 14.2503 9.55792 14.1922L3.30792 7.94217C3.19064 7.82489 3.12476 7.66583 3.12476 7.49998C3.12476 7.33413 3.19064 7.17507 3.30792 7.05779C3.42519 6.94052 3.58425 6.87463 3.7501 6.87463C3.91596 6.87463 4.07502 6.94052 4.19229 7.05779L10.0001 12.8664L15.8079 7.05779C15.866 6.99972 15.9349 6.95366 16.0108 6.92224C16.0867 6.89081 16.168 6.87463 16.2501 6.87463C16.3322 6.87463 16.4135 6.89081 16.4894 6.92224C16.5653 6.95366 16.6342 6.99972 16.6923 7.05779C16.7504 7.11586 16.7964 7.1848 16.8278 7.26067C16.8593 7.33654 16.8755 7.41786 16.8755 7.49998C16.8755 7.5821 16.8593 7.66342 16.8278 7.73929C16.7964 7.81516 16.7504 7.8841 16.6923 7.94217Z",
|
|
98
|
+
fill: "currentColor"
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
);
|
|
85
103
|
var ShieldCheckIcon = ({ className }) => /* @__PURE__ */ jsx("div", { className: "uiklu-bg-primary300 uiklu-w-8 uiklu-h-8 uiklu-rounded-full uiklu-flex uiklu-items-center uiklu-justify-center uiklu-shrink-0", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className, children: /* @__PURE__ */ jsx(
|
|
86
104
|
"path",
|
|
87
105
|
{
|
|
@@ -943,6 +961,7 @@ var Icons = {
|
|
|
943
961
|
TICKET: /* @__PURE__ */ jsx(TicketIcon, {}),
|
|
944
962
|
CASH: /* @__PURE__ */ jsx(CashIcon, {}),
|
|
945
963
|
CHEVRON_RIGHT: /* @__PURE__ */ jsx(ChevronRightIcon, {}),
|
|
964
|
+
CHEVRON_DOWN: /* @__PURE__ */ jsx(ChevronDownIcon, {}),
|
|
946
965
|
SHIELD_CHECK: /* @__PURE__ */ jsx(ShieldCheckIcon, {}),
|
|
947
966
|
CLOSE: /* @__PURE__ */ jsx(CloseIcon, {}),
|
|
948
967
|
MONEY: /* @__PURE__ */ jsx(MoneyIcon, {}),
|
|
@@ -1325,7 +1344,10 @@ var SelectContent = React4.forwardRef(({ className, children, position = "popper
|
|
|
1325
1344
|
{
|
|
1326
1345
|
ref,
|
|
1327
1346
|
className: cn(
|
|
1328
|
-
"uiklu-relative uiklu-z-50 uiklu-max-h-96 uiklu-w-[var(--radix-select-trigger-width)]
|
|
1347
|
+
"uiklu-relative uiklu-z-50 uiklu-max-h-96 uiklu-w-[var(--radix-select-trigger-width)]",
|
|
1348
|
+
"uiklu-min-w-[var(--radix-select-trigger-width)] uiklu-overflow-hidden uiklu-rounded-[20px]",
|
|
1349
|
+
"uiklu-border-[1px] uiklu-border-border uiklu-bg-background uiklu-text-inputtext",
|
|
1350
|
+
"uiklu-font-sans uiklu-shadow-md",
|
|
1329
1351
|
position === "popper" && "uiklu-translate-y-1",
|
|
1330
1352
|
className
|
|
1331
1353
|
),
|
|
@@ -2077,8 +2099,8 @@ function SidebarNav({
|
|
|
2077
2099
|
};
|
|
2078
2100
|
return /* @__PURE__ */ jsx16("nav", { className: "uiklu-flex uiklu-flex-col uiklu-gap-1 uiklu-w-full", children: items.map((item) => {
|
|
2079
2101
|
const isActive = activeTab === item.id;
|
|
2080
|
-
const
|
|
2081
|
-
const isReactElement = React9.isValidElement(
|
|
2102
|
+
const Icon3 = item.icon;
|
|
2103
|
+
const isReactElement = React9.isValidElement(Icon3);
|
|
2082
2104
|
return /* @__PURE__ */ jsxs13(React9.Fragment, { children: [
|
|
2083
2105
|
/* @__PURE__ */ jsxs13(
|
|
2084
2106
|
"button",
|
|
@@ -2097,7 +2119,7 @@ function SidebarNav({
|
|
|
2097
2119
|
"uiklu-items-center uiklu-justify-center",
|
|
2098
2120
|
"uiklu-transition-colors uiklu-duration-200",
|
|
2099
2121
|
isActive ? "uiklu-text-primary600" : "uiklu-text-primary300"
|
|
2100
|
-
), children: isReactElement ? React9.cloneElement(
|
|
2122
|
+
), children: isReactElement ? React9.cloneElement(Icon3, { className: "uiklu-h-full uiklu-w-full" }) : /* @__PURE__ */ jsx16(Icon3, { className: "uiklu-h-full uiklu-w-full" }) }),
|
|
2101
2123
|
/* @__PURE__ */ jsx16(
|
|
2102
2124
|
"span",
|
|
2103
2125
|
{
|
|
@@ -2961,7 +2983,8 @@ var TextField = React16.forwardRef(
|
|
|
2961
2983
|
"uiklu-px-[10px] uiklu-py-[4px] uiklu-appearance-none uiklu-outline-none uiklu-transition-all",
|
|
2962
2984
|
"uiklu-rounded-[8px] uiklu-border-[1px] uiklu-border-solid",
|
|
2963
2985
|
"uiklu-overflow-hidden uiklu-text-ellipsis",
|
|
2964
|
-
"uiklu-bg-gray50 uiklu-text-gray800 placeholder:uiklu-text-gray500
|
|
2986
|
+
"uiklu-bg-gray50 uiklu-text-gray800 placeholder:uiklu-text-gray500 uiklu-font-semibold",
|
|
2987
|
+
"placeholder:uiklu-font-semibold",
|
|
2965
2988
|
"disabled:uiklu-cursor-not-allowed disabled:uiklu-opacity-50",
|
|
2966
2989
|
!error ? [
|
|
2967
2990
|
"uiklu-border-gray100",
|
|
@@ -3025,6 +3048,343 @@ var TextField = React16.forwardRef(
|
|
|
3025
3048
|
}
|
|
3026
3049
|
);
|
|
3027
3050
|
TextField.displayName = "TextField";
|
|
3051
|
+
|
|
3052
|
+
// src/components/ui/selectField/selectField.tsx
|
|
3053
|
+
import * as React17 from "react";
|
|
3054
|
+
import * as SelectPrimitive2 from "@radix-ui/react-select";
|
|
3055
|
+
import { Check as Check4 } from "lucide-react";
|
|
3056
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3057
|
+
var inputSizes3 = {
|
|
3058
|
+
sm: "uiklu-w-[150px] uiklu-text-[10px]",
|
|
3059
|
+
md: "uiklu-w-[250px] uiklu-text-[12px]",
|
|
3060
|
+
lg: "uiklu-w-[350px] uiklu-text-[14px]",
|
|
3061
|
+
full: "uiklu-w-full uiklu-text-[14px]"
|
|
3062
|
+
};
|
|
3063
|
+
var containerSizes3 = {
|
|
3064
|
+
sm: "uiklu-w-[150px]",
|
|
3065
|
+
md: "uiklu-w-[250px]",
|
|
3066
|
+
lg: "uiklu-w-[350px]",
|
|
3067
|
+
full: "uiklu-w-full"
|
|
3068
|
+
};
|
|
3069
|
+
var labelStyles2 = {
|
|
3070
|
+
sm: "uiklu-text-[12px] uiklu-mb-[5px]",
|
|
3071
|
+
md: "uiklu-text-[13px] uiklu-mb-[7px]",
|
|
3072
|
+
lg: "uiklu-text-[14px] uiklu-mb-[10px]",
|
|
3073
|
+
full: "uiklu-text-[14px] uiklu-mb-[10px]"
|
|
3074
|
+
};
|
|
3075
|
+
var errorSizes4 = {
|
|
3076
|
+
sm: "uiklu-text-sm",
|
|
3077
|
+
md: "uiklu-text-md",
|
|
3078
|
+
lg: "uiklu-text-lg",
|
|
3079
|
+
full: "uiklu-text-lg"
|
|
3080
|
+
};
|
|
3081
|
+
var Select2 = SelectPrimitive2.Root;
|
|
3082
|
+
var SelectValue = SelectPrimitive2.Value;
|
|
3083
|
+
var SelectGroup = SelectPrimitive2.Group;
|
|
3084
|
+
var SelectField = React17.forwardRef(({ className, size = "full", label, error, required, disabled, placeholder, children, labelClassName, ...props }, ref) => {
|
|
3085
|
+
return /* @__PURE__ */ jsxs23("div", { className: cn(
|
|
3086
|
+
"uiklu-flex uiklu-flex-col uiklu-font-sans",
|
|
3087
|
+
containerSizes3[size]
|
|
3088
|
+
), children: [
|
|
3089
|
+
/* @__PURE__ */ jsxs23(
|
|
3090
|
+
"label",
|
|
3091
|
+
{
|
|
3092
|
+
className: cn(
|
|
3093
|
+
"uiklu-label uiklu-font-sans uiklu-transition-colors uiklu-text-left",
|
|
3094
|
+
"uiklu-font-normal",
|
|
3095
|
+
labelStyles2[size],
|
|
3096
|
+
!error ? "uiklu-text-gray600" : "uiklu-text-destructive",
|
|
3097
|
+
labelClassName
|
|
3098
|
+
),
|
|
3099
|
+
children: [
|
|
3100
|
+
label,
|
|
3101
|
+
required && /* @__PURE__ */ jsx27("span", { className: "uiklu-ml-0.5", children: "*" })
|
|
3102
|
+
]
|
|
3103
|
+
}
|
|
3104
|
+
),
|
|
3105
|
+
/* @__PURE__ */ jsx27("div", { className: cn("uiklu-relative", containerSizes3[size]), children: /* @__PURE__ */ jsxs23(Select2, { disabled, ...props, children: [
|
|
3106
|
+
/* @__PURE__ */ jsxs23(
|
|
3107
|
+
SelectPrimitive2.Trigger,
|
|
3108
|
+
{
|
|
3109
|
+
ref,
|
|
3110
|
+
className: cn(
|
|
3111
|
+
"uiklu-font-sans uiklu-flex uiklu-box-border uiklu-h-[36px] uiklu-w-full",
|
|
3112
|
+
"uiklu-items-center uiklu-justify-between uiklu-gap-2",
|
|
3113
|
+
"uiklu-px-[10px] uiklu-py-[4px] uiklu-appearance-none uiklu-outline-none uiklu-transition-all",
|
|
3114
|
+
"uiklu-rounded-[8px] uiklu-border-[1px] uiklu-border-solid uiklu-leading-normal",
|
|
3115
|
+
"uiklu-bg-basewhite uiklu-text-gray800 data-[placeholder]:uiklu-text-gray800",
|
|
3116
|
+
"uiklu-font-semibold",
|
|
3117
|
+
"disabled:uiklu-cursor-not-allowed disabled:uiklu-opacity-50",
|
|
3118
|
+
!error ? [
|
|
3119
|
+
"uiklu-border-gray100",
|
|
3120
|
+
"focus:uiklu-border-primary900 focus:uiklu-bg-white",
|
|
3121
|
+
"focus:uiklu-shadow-[0_0_0_3px_#AFD8D8]"
|
|
3122
|
+
] : [
|
|
3123
|
+
"uiklu-border-destructive uiklu-bg-white !uiklu-text-destructive",
|
|
3124
|
+
"focus:uiklu-border-destructive",
|
|
3125
|
+
"focus:uiklu-shadow-[0_0_0_3px_rgba(220,38,38,0.20)]"
|
|
3126
|
+
],
|
|
3127
|
+
inputSizes3[size],
|
|
3128
|
+
className
|
|
3129
|
+
),
|
|
3130
|
+
children: [
|
|
3131
|
+
/* @__PURE__ */ jsx27("span", { className: "uiklu-truncate", children: /* @__PURE__ */ jsx27(SelectValue, { placeholder }) }),
|
|
3132
|
+
/* @__PURE__ */ jsx27(SelectPrimitive2.Icon, { asChild: true, children: /* @__PURE__ */ jsx27("div", { className: cn(
|
|
3133
|
+
"uiklu-flex uiklu-items-center uiklu-justify-center uiklu-h-4",
|
|
3134
|
+
"uiklu-w-4 uiklu-shrink-0 ",
|
|
3135
|
+
error ? "uiklu-text-destructive" : "uiklu-text-primary500"
|
|
3136
|
+
), children: Icons.CHEVRON_DOWN }) })
|
|
3137
|
+
]
|
|
3138
|
+
}
|
|
3139
|
+
),
|
|
3140
|
+
children
|
|
3141
|
+
] }) }),
|
|
3142
|
+
/* @__PURE__ */ jsx27("div", { className: cn("uiklu-min-h-[20px] uiklu-mb-[10px] uiklu-flex uiklu-items-center", errorSizes4[size]), children: error && /* @__PURE__ */ jsx27("p", { className: "uiklu-error-message uiklu-leading-tight uiklu-text-destructive uiklu-font-sans uiklu-m-0", children: error }) })
|
|
3143
|
+
] });
|
|
3144
|
+
});
|
|
3145
|
+
SelectField.displayName = "SelectField";
|
|
3146
|
+
var SelectContent2 = React17.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx27(SelectPrimitive2.Portal, { children: /* @__PURE__ */ jsx27(
|
|
3147
|
+
SelectPrimitive2.Content,
|
|
3148
|
+
{
|
|
3149
|
+
ref,
|
|
3150
|
+
className: cn(
|
|
3151
|
+
"uiklu-relative uiklu-z-50 uiklu-max-h-96 uiklu-w-[var(--radix-select-trigger-width)] uiklu-min-w-[var(--radix-select-trigger-width)] uiklu-overflow-hidden uiklu-rounded-[8px] uiklu-border-[1px] uiklu-border-gray100 uiklu-bg-white uiklu-text-gray800 uiklu-font-sans uiklu-shadow-md",
|
|
3152
|
+
position === "popper" && "uiklu-translate-y-1",
|
|
3153
|
+
className
|
|
3154
|
+
),
|
|
3155
|
+
position,
|
|
3156
|
+
...props,
|
|
3157
|
+
children: /* @__PURE__ */ jsx27(SelectPrimitive2.Viewport, { className: "uiklu-p-1", children })
|
|
3158
|
+
}
|
|
3159
|
+
) }));
|
|
3160
|
+
SelectContent2.displayName = SelectPrimitive2.Content.displayName;
|
|
3161
|
+
var SelectItem2 = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs23(
|
|
3162
|
+
SelectPrimitive2.Item,
|
|
3163
|
+
{
|
|
3164
|
+
ref,
|
|
3165
|
+
className: cn(
|
|
3166
|
+
"uiklu-relative uiklu-flex uiklu-w-full uiklu-cursor-pointer uiklu-select-none uiklu-items-center uiklu-py-2.5 uiklu-pl-10 uiklu-pr-4 uiklu-text-md uiklu-font-sans uiklu-outline-none focus:uiklu-bg-primary/10 focus:uiklu-text-primary",
|
|
3167
|
+
"uiklu-rounded-none",
|
|
3168
|
+
className
|
|
3169
|
+
),
|
|
3170
|
+
...props,
|
|
3171
|
+
children: [
|
|
3172
|
+
/* @__PURE__ */ jsx27("span", { className: "uiklu-absolute uiklu-left-2 uiklu-flex uiklu-h-3.5 uiklu-w-3.5 uiklu-items-center uiklu-justify-center", children: /* @__PURE__ */ jsx27(SelectPrimitive2.ItemIndicator, { children: /* @__PURE__ */ jsx27(Check4, { className: "uiklu-h-4 uiklu-w-4 uiklu-text-primary900" }) }) }),
|
|
3173
|
+
/* @__PURE__ */ jsx27(SelectPrimitive2.ItemText, { children })
|
|
3174
|
+
]
|
|
3175
|
+
}
|
|
3176
|
+
));
|
|
3177
|
+
SelectItem2.displayName = SelectPrimitive2.Item.displayName;
|
|
3178
|
+
|
|
3179
|
+
// src/components/ui/searchSelectField/searchSelectField.tsx
|
|
3180
|
+
import * as React18 from "react";
|
|
3181
|
+
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
3182
|
+
import { Check as Check5, X as X3 } from "lucide-react";
|
|
3183
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3184
|
+
var inputSizes4 = {
|
|
3185
|
+
sm: "uiklu-w-[150px] uiklu-text-[10px]",
|
|
3186
|
+
md: "uiklu-w-[250px] uiklu-text-[12px]",
|
|
3187
|
+
lg: "uiklu-w-[350px] uiklu-text-[14px]",
|
|
3188
|
+
full: "uiklu-w-full uiklu-text-[14px]"
|
|
3189
|
+
};
|
|
3190
|
+
var containerSizes4 = {
|
|
3191
|
+
sm: "uiklu-w-[150px]",
|
|
3192
|
+
md: "uiklu-w-[250px]",
|
|
3193
|
+
lg: "uiklu-w-[350px]",
|
|
3194
|
+
full: "uiklu-w-full"
|
|
3195
|
+
};
|
|
3196
|
+
var labelStyles3 = {
|
|
3197
|
+
sm: "uiklu-text-[12px] uiklu-mb-[5px]",
|
|
3198
|
+
md: "uiklu-text-[13px] uiklu-mb-[7px]",
|
|
3199
|
+
lg: "uiklu-text-[14px] uiklu-mb-[10px]",
|
|
3200
|
+
full: "uiklu-text-[14px] uiklu-mb-[10px]"
|
|
3201
|
+
};
|
|
3202
|
+
var errorSizes5 = {
|
|
3203
|
+
sm: "uiklu-text-sm",
|
|
3204
|
+
md: "uiklu-text-md",
|
|
3205
|
+
lg: "uiklu-text-lg",
|
|
3206
|
+
full: "uiklu-text-lg"
|
|
3207
|
+
};
|
|
3208
|
+
var SearchSelectField = ({
|
|
3209
|
+
options,
|
|
3210
|
+
value,
|
|
3211
|
+
onChange,
|
|
3212
|
+
label,
|
|
3213
|
+
placeholder = "Buscar...",
|
|
3214
|
+
size = "full",
|
|
3215
|
+
error,
|
|
3216
|
+
required = false,
|
|
3217
|
+
disabled = false,
|
|
3218
|
+
className,
|
|
3219
|
+
labelClassName
|
|
3220
|
+
}) => {
|
|
3221
|
+
const [open, setOpen] = React18.useState(false);
|
|
3222
|
+
const [search, setSearch] = React18.useState("");
|
|
3223
|
+
const containerRef = React18.useRef(null);
|
|
3224
|
+
const inputRef = React18.useRef(null);
|
|
3225
|
+
const selectedOption = options.find((opt) => opt.value === value);
|
|
3226
|
+
React18.useEffect(() => {
|
|
3227
|
+
if (selectedOption) {
|
|
3228
|
+
setSearch(selectedOption.label);
|
|
3229
|
+
} else {
|
|
3230
|
+
setSearch("");
|
|
3231
|
+
}
|
|
3232
|
+
}, [selectedOption]);
|
|
3233
|
+
const filteredOptions = options.filter(
|
|
3234
|
+
(option) => option.label.toLowerCase().includes(search.toLowerCase())
|
|
3235
|
+
);
|
|
3236
|
+
const handleClear = (e) => {
|
|
3237
|
+
e.stopPropagation();
|
|
3238
|
+
onChange("");
|
|
3239
|
+
setSearch("");
|
|
3240
|
+
setOpen(true);
|
|
3241
|
+
inputRef.current?.focus();
|
|
3242
|
+
};
|
|
3243
|
+
return /* @__PURE__ */ jsxs24("div", { className: cn(
|
|
3244
|
+
"uiklu-flex uiklu-flex-col uiklu-font-sans",
|
|
3245
|
+
containerSizes4[size]
|
|
3246
|
+
), children: [
|
|
3247
|
+
/* @__PURE__ */ jsxs24(
|
|
3248
|
+
"label",
|
|
3249
|
+
{
|
|
3250
|
+
className: cn(
|
|
3251
|
+
"uiklu-label uiklu-font-sans uiklu-transition-colors uiklu-text-left",
|
|
3252
|
+
"uiklu-font-normal",
|
|
3253
|
+
labelStyles3[size],
|
|
3254
|
+
!error ? "uiklu-text-gray600" : "uiklu-text-destructive",
|
|
3255
|
+
labelClassName
|
|
3256
|
+
),
|
|
3257
|
+
children: [
|
|
3258
|
+
label,
|
|
3259
|
+
required && /* @__PURE__ */ jsx28("span", { className: "uiklu-ml-0.5", children: "*" })
|
|
3260
|
+
]
|
|
3261
|
+
}
|
|
3262
|
+
),
|
|
3263
|
+
/* @__PURE__ */ jsxs24(PopoverPrimitive2.Root, { open, onOpenChange: setOpen, children: [
|
|
3264
|
+
/* @__PURE__ */ jsx28(PopoverPrimitive2.Anchor, { asChild: true, children: /* @__PURE__ */ jsxs24(
|
|
3265
|
+
"div",
|
|
3266
|
+
{
|
|
3267
|
+
ref: containerRef,
|
|
3268
|
+
className: cn(
|
|
3269
|
+
"uiklu-font-sans uiklu-flex uiklu-box-border uiklu-h-[36px] uiklu-w-full",
|
|
3270
|
+
"uiklu-items-center uiklu-justify-between uiklu-gap-2",
|
|
3271
|
+
"uiklu-px-[10px] uiklu-py-[4px] uiklu-transition-all",
|
|
3272
|
+
"uiklu-rounded-[8px] uiklu-border-[1px] uiklu-border-solid uiklu-cursor-text uiklu-relative",
|
|
3273
|
+
"uiklu-bg-basewhite uiklu-text-gray800",
|
|
3274
|
+
disabled && "uiklu-opacity-50 uiklu-pointer-events-none",
|
|
3275
|
+
!error ? [
|
|
3276
|
+
"uiklu-border-gray100",
|
|
3277
|
+
"focus-within:uiklu-border-primary900 focus-within:uiklu-bg-white",
|
|
3278
|
+
"focus-within:uiklu-shadow-[0_0_0_3px_#AFD8D8]"
|
|
3279
|
+
] : [
|
|
3280
|
+
"uiklu-border-destructive focus-within:uiklu-border-destructive uiklu-bg-white",
|
|
3281
|
+
"focus-within:uiklu-shadow-[0_0_0_3px_rgba(220,38,38,0.20)]"
|
|
3282
|
+
],
|
|
3283
|
+
inputSizes4[size],
|
|
3284
|
+
className
|
|
3285
|
+
),
|
|
3286
|
+
onClick: () => {
|
|
3287
|
+
inputRef.current?.focus();
|
|
3288
|
+
setOpen(true);
|
|
3289
|
+
},
|
|
3290
|
+
children: [
|
|
3291
|
+
/* @__PURE__ */ jsx28(
|
|
3292
|
+
"input",
|
|
3293
|
+
{
|
|
3294
|
+
ref: inputRef,
|
|
3295
|
+
type: "text",
|
|
3296
|
+
className: cn(
|
|
3297
|
+
"uiklu-w-full uiklu-bg-transparent uiklu-outline-none uiklu-border-none uiklu-p-0",
|
|
3298
|
+
"uiklu-font-sans uiklu-text-gray800 uiklu-leading-normal uiklu-font-semibold",
|
|
3299
|
+
disabled && "uiklu-cursor-not-allowed",
|
|
3300
|
+
!error ? "placeholder:uiklu-text-gray800" : "uiklu-text-destructive placeholder:!uiklu-text-destructive"
|
|
3301
|
+
),
|
|
3302
|
+
placeholder,
|
|
3303
|
+
value: search,
|
|
3304
|
+
disabled,
|
|
3305
|
+
onFocus: () => setOpen(true),
|
|
3306
|
+
onClick: (e) => {
|
|
3307
|
+
e.stopPropagation();
|
|
3308
|
+
setOpen(true);
|
|
3309
|
+
},
|
|
3310
|
+
onChange: (e) => {
|
|
3311
|
+
setSearch(e.target.value);
|
|
3312
|
+
if (!open) setOpen(true);
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
),
|
|
3316
|
+
/* @__PURE__ */ jsxs24("div", { className: "uiklu-flex uiklu-items-center uiklu-ml-2 uiklu-shrink-0", children: [
|
|
3317
|
+
search && /* @__PURE__ */ jsx28(
|
|
3318
|
+
"button",
|
|
3319
|
+
{
|
|
3320
|
+
type: "button",
|
|
3321
|
+
onClick: handleClear,
|
|
3322
|
+
className: "uiklu-mr-1 uiklu-opacity-50 hover:uiklu-opacity-100 uiklu-transition-opacity\n uiklu-bg-transparent uiklu-border-none uiklu-outline-none uiklu-p-0 \n uiklu-cursor-pointer uiklu-flex uiklu-items-center uiklu-justify-center",
|
|
3323
|
+
children: /* @__PURE__ */ jsx28(X3, { className: "uiklu-h-4 uiklu-w-4" })
|
|
3324
|
+
}
|
|
3325
|
+
),
|
|
3326
|
+
/* @__PURE__ */ jsx28(
|
|
3327
|
+
"div",
|
|
3328
|
+
{
|
|
3329
|
+
className: cn(
|
|
3330
|
+
"uiklu-flex uiklu-items-center uiklu-justify-center uiklu-h-4 uiklu-w-4 uiklu-shrink-0 uiklu-cursor-pointer",
|
|
3331
|
+
error ? "uiklu-text-destructive" : "uiklu-text-primary500"
|
|
3332
|
+
),
|
|
3333
|
+
onClick: (e) => {
|
|
3334
|
+
e.stopPropagation();
|
|
3335
|
+
setOpen((prev) => !prev);
|
|
3336
|
+
},
|
|
3337
|
+
children: Icons.CHEVRON_DOWN
|
|
3338
|
+
}
|
|
3339
|
+
)
|
|
3340
|
+
] })
|
|
3341
|
+
]
|
|
3342
|
+
}
|
|
3343
|
+
) }),
|
|
3344
|
+
/* @__PURE__ */ jsx28(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx28(
|
|
3345
|
+
PopoverPrimitive2.Content,
|
|
3346
|
+
{
|
|
3347
|
+
className: cn(
|
|
3348
|
+
"uiklu-relative uiklu-z-50 uiklu-overflow-hidden uiklu-rounded-[8px] uiklu-border-[1px] uiklu-border-gray100 uiklu-bg-white uiklu-text-gray800 uiklu-font-sans uiklu-shadow-md uiklu-translate-y-1"
|
|
3349
|
+
),
|
|
3350
|
+
style: {
|
|
3351
|
+
width: containerRef.current ? containerRef.current.offsetWidth : "var(--radix-popover-trigger-width)"
|
|
3352
|
+
},
|
|
3353
|
+
align: "start",
|
|
3354
|
+
sideOffset: 4,
|
|
3355
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
3356
|
+
children: /* @__PURE__ */ jsx28("div", { className: "uiklu-py-1 uiklu-px-0 uiklu-max-h-96 uiklu-overflow-y-auto uiklu-overflow-x-hidden uiklu-w-full uiklu-box-border", children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx28("div", { className: "uiklu-py-3 uiklu-px-4 uiklu-text-sm uiklu-text-center uiklu-opacity-50 uiklu-font-sans", children: "No se encontraron resultados" }) : filteredOptions.map((option) => {
|
|
3357
|
+
const isSelected = value === option.value;
|
|
3358
|
+
return /* @__PURE__ */ jsxs24(
|
|
3359
|
+
"div",
|
|
3360
|
+
{
|
|
3361
|
+
onClick: () => {
|
|
3362
|
+
onChange(option.value);
|
|
3363
|
+
setSearch(option.label);
|
|
3364
|
+
setOpen(false);
|
|
3365
|
+
},
|
|
3366
|
+
className: cn(
|
|
3367
|
+
"uiklu-relative uiklu-flex uiklu-w-full uiklu-box-border uiklu-cursor-pointer uiklu-select-none uiklu-items-center uiklu-py-2.5 uiklu-pl-10 uiklu-pr-4 uiklu-text-md uiklu-font-sans uiklu-outline-none uiklu-rounded-none focus:uiklu-bg-primary/10 focus:uiklu-text-primary hover:uiklu-bg-primary/10 hover:uiklu-text-primary uiklu-transition-colors",
|
|
3368
|
+
isSelected && "uiklu-bg-primary/5 uiklu-text-primary900 uiklu-font-medium"
|
|
3369
|
+
),
|
|
3370
|
+
children: [
|
|
3371
|
+
/* @__PURE__ */ jsx28("span", { className: "uiklu-absolute uiklu-left-2 uiklu-flex uiklu-h-3.5 uiklu-w-3.5 uiklu-items-center uiklu-justify-center", children: /* @__PURE__ */ jsx28(Check5, { className: cn(
|
|
3372
|
+
"uiklu-h-4 uiklu-w-4 uiklu-transition-opacity",
|
|
3373
|
+
isSelected ? "uiklu-opacity-100 uiklu-text-primary900" : "uiklu-opacity-0"
|
|
3374
|
+
) }) }),
|
|
3375
|
+
/* @__PURE__ */ jsx28("span", { className: "uiklu-flex-1 uiklu-truncate uiklu-min-w-0 uiklu-inline-flex uiklu-items-center uiklu-h-full uiklu-leading-normal", children: option.label }),
|
|
3376
|
+
option.extra && /* @__PURE__ */ jsx28("span", { className: "uiklu-ml-2 uiklu-shrink-0 uiklu-flex uiklu-items-center", children: option.extra })
|
|
3377
|
+
]
|
|
3378
|
+
},
|
|
3379
|
+
option.value
|
|
3380
|
+
);
|
|
3381
|
+
}) })
|
|
3382
|
+
}
|
|
3383
|
+
) })
|
|
3384
|
+
] }),
|
|
3385
|
+
/* @__PURE__ */ jsx28("div", { className: cn("uiklu-min-h-[20px] uiklu-mb-[10px] uiklu-flex uiklu-items-center", errorSizes5[size]), children: error && /* @__PURE__ */ jsx28("p", { className: "uiklu-error-message uiklu-leading-tight uiklu-text-destructive uiklu-font-sans uiklu-m-0", children: error }) })
|
|
3386
|
+
] });
|
|
3387
|
+
};
|
|
3028
3388
|
export {
|
|
3029
3389
|
BackButton,
|
|
3030
3390
|
BalanceInfo,
|
|
@@ -3042,7 +3402,13 @@ export {
|
|
|
3042
3402
|
Modal,
|
|
3043
3403
|
PromoBanner,
|
|
3044
3404
|
SearchSelect,
|
|
3405
|
+
SearchSelectField,
|
|
3045
3406
|
Select,
|
|
3407
|
+
SelectContent2 as SelectContent,
|
|
3408
|
+
SelectField,
|
|
3409
|
+
SelectGroup,
|
|
3410
|
+
SelectItem2 as SelectItem,
|
|
3411
|
+
SelectValue,
|
|
3046
3412
|
SidebarTabs,
|
|
3047
3413
|
TextField,
|
|
3048
3414
|
ToastAction,
|