@equal-experts/kuat-react 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -120
- package/dist/checkbox-field-Bslh9sHw.js +65 -0
- package/dist/checkbox-field.css +1 -0
- package/dist/checkbox.d.ts +3 -0
- package/dist/checkbox.js +10 -0
- package/dist/components/ui/checkbox/checkbox-field.d.ts +23 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox/index.d.ts +4 -0
- package/dist/components/ui/field/field.d.ts +28 -0
- package/dist/components/ui/field/index.d.ts +2 -0
- package/dist/components/ui/input/index.d.ts +2 -0
- package/dist/components/ui/input/input.d.ts +20 -0
- package/dist/components/ui/radio/index.d.ts +4 -0
- package/dist/components/ui/radio/radio-field.d.ts +25 -0
- package/dist/components/ui/radio/radio.d.ts +7 -0
- package/dist/components/ui/select/constants.d.ts +19 -0
- package/dist/components/ui/select/index.d.ts +3 -0
- package/dist/components/ui/select/select.d.ts +53 -0
- package/dist/components/ui/switch/index.d.ts +4 -0
- package/dist/components/ui/switch/switch-field.d.ts +23 -0
- package/dist/components/ui/switch/switch.d.ts +5 -0
- package/dist/components/ui/textarea/index.d.ts +2 -0
- package/dist/components/ui/textarea/textarea.d.ts +9 -0
- package/dist/components/ui/toggle/constants.d.ts +4 -0
- package/dist/components/ui/toggle/index.d.ts +6 -0
- package/dist/components/ui/toggle/toggle-group.d.ts +11 -0
- package/dist/components/ui/toggle/toggle.d.ts +9 -0
- package/dist/constants-DHz0LWRt.js +49 -0
- package/dist/constants.css +1 -0
- package/dist/field-DRLopwY4.js +141 -0
- package/dist/field.css +1 -0
- package/dist/field.d.ts +3 -0
- package/dist/field.js +17 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +785 -731
- package/dist/input-2x92vprz.js +43 -0
- package/dist/input.css +1 -0
- package/dist/input.d.ts +3 -0
- package/dist/input.js +8 -0
- package/dist/radio-field-G8dvdsLE.js +82 -0
- package/dist/radio-field.css +1 -0
- package/dist/radio.d.ts +3 -0
- package/dist/radio.js +11 -0
- package/dist/select-Oz2Zj-L0.js +232 -0
- package/dist/select.css +1 -0
- package/dist/select.d.ts +3 -0
- package/dist/select.js +19 -0
- package/dist/styles.css +1 -1
- package/dist/switch-field-Ce9CiRqk.js +61 -0
- package/dist/switch-field.css +1 -0
- package/dist/switch.d.ts +1 -0
- package/dist/switch.js +7 -0
- package/dist/textarea-DiU8h_H0.js +19 -0
- package/dist/textarea.css +1 -0
- package/dist/textarea.d.ts +3 -0
- package/dist/textarea.js +8 -0
- package/dist/toggle-group.d.ts +3 -0
- package/dist/toggle-group.js +10 -0
- package/dist/toggle.d.ts +3 -0
- package/dist/toggle.js +9 -0
- package/package.json +47 -11
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { c as o } from "./utils-DLUjLwnh.js";
|
|
4
|
+
const _ = ["regular", "large", "small", "mini"], c = u.forwardRef(
|
|
5
|
+
({
|
|
6
|
+
className: s,
|
|
7
|
+
size: e = "regular",
|
|
8
|
+
leftDecoration: t,
|
|
9
|
+
rightDecoration: i,
|
|
10
|
+
type: n = "text",
|
|
11
|
+
...l
|
|
12
|
+
}, r) => /* @__PURE__ */ p(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: o(
|
|
16
|
+
"input",
|
|
17
|
+
`input--size-${e}`,
|
|
18
|
+
n === "file" && "input--type-file",
|
|
19
|
+
s
|
|
20
|
+
),
|
|
21
|
+
"data-slot": "input",
|
|
22
|
+
children: [
|
|
23
|
+
t ? /* @__PURE__ */ a("span", { className: "input__decoration input__decoration--left", children: t }) : null,
|
|
24
|
+
/* @__PURE__ */ a(
|
|
25
|
+
"input",
|
|
26
|
+
{
|
|
27
|
+
ref: r,
|
|
28
|
+
type: n,
|
|
29
|
+
className: "input__field",
|
|
30
|
+
"data-slot": "input-field",
|
|
31
|
+
...l
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
i ? /* @__PURE__ */ a("span", { className: "input__decoration input__decoration--right", children: i }) : null
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
c.displayName = "Input";
|
|
40
|
+
export {
|
|
41
|
+
c as I,
|
|
42
|
+
_ as a
|
|
43
|
+
};
|
package/dist/input.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-duration:initial;--tw-ease:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-leading:initial;--tw-tracking:initial}}}.input{width:100%;min-width:calc(var(--spacing,.25rem)*0);font-family:var(--font-sans,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4,0,.2,1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));--tw-duration:.15s;--tw-ease:var(--ease-in-out,cubic-bezier(.4,0,.2,1));transition-duration:.15s;transition-timing-function:var(--ease-in-out,cubic-bezier(.4,0,.2,1));--tw-outline-style:none;border:1px solid var(--border);border-radius:var(--radius);background:var(--input);box-shadow:var(--shadow-xs);outline-style:none;align-items:center;display:flex}.input:focus-within:not(:has(.input__field:disabled)){border-color:var(--slate-400);box-shadow:0 0 0 3px var(--ring)}.input:has(.input__field[aria-invalid=true]){border-color:var(--destructive)}.input:has(.input__field[aria-invalid=true]):focus-within{border-color:var(--destructive);box-shadow:0 0 0 3px var(--red-300)}.input:has(.input__field:disabled){cursor:not-allowed;opacity:.3}.input__field{min-width:calc(var(--spacing,.25rem)*0);border-style:var(--tw-border-style);--tw-outline-style:none;color:var(--foreground);background-color:#0000;border-width:0;outline-style:none;flex:1}.input__field::placeholder{color:var(--muted-foreground)}.input__field:disabled{cursor:not-allowed}.input--type-file,.input:has(.input__field[type=file]){align-items:center}.input__field[type=file]{min-width:calc(var(--spacing,.25rem)*0);cursor:pointer}.input__field[type=file]::file-selector-button{margin-right:calc(var(--spacing,.25rem)*4);height:calc(var(--spacing,.25rem)*7);cursor:pointer;border-radius:calc(var(--radius) - 4px);border-style:var(--tw-border-style);font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25/.875)));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500);color:var(--foreground);background-color:#0000;border-width:0;flex-shrink:0;align-items:center;display:inline-flex}.input--size-mini .input__field[type=file]::file-selector-button{height:calc(var(--spacing,.25rem)*5);font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1/.75)))}.input__decoration{color:var(--muted-foreground);flex-shrink:0;justify-content:center;align-items:center;display:flex}.input--size-regular{min-height:calc(var(--spacing,.25rem)*9);gap:calc(var(--spacing,.25rem)*2);padding-inline:calc(var(--spacing,.25rem)*3);padding-block:calc(var(--spacing,.25rem)*2)}.input--size-regular .input__field{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25/.875)));--tw-leading:calc(var(--spacing,.25rem)*6);line-height:calc(var(--spacing,.25rem)*6);--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.input--size-large{min-height:calc(var(--spacing,.25rem)*10);gap:calc(var(--spacing,.25rem)*3);padding-inline:calc(var(--spacing,.25rem)*4);padding-block:calc(var(--spacing,.25rem)*2.5)}.input--size-large .input__field{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25/.875)));--tw-leading:calc(var(--spacing,.25rem)*6);line-height:calc(var(--spacing,.25rem)*6);--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.input--size-small{min-height:calc(var(--spacing,.25rem)*8);gap:calc(var(--spacing,.25rem)*1.5);padding-inline:calc(var(--spacing,.25rem)*2);padding-block:calc(var(--spacing,.25rem)*1.5)}.input--size-small .input__field{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25/.875)));--tw-leading:calc(var(--spacing,.25rem)*6);line-height:calc(var(--spacing,.25rem)*6);--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.input--size-mini{min-height:calc(var(--spacing,.25rem)*6);gap:calc(var(--spacing,.25rem)*1);padding-inline:calc(var(--spacing,.25rem)*1.5);padding-block:3px}.input--size-mini .input__field{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1/.75)));--tw-leading:calc(var(--spacing,.25rem)*4);line-height:calc(var(--spacing,.25rem)*4);--tw-tracking:calc(var(--tracking-normal) + .025em);letter-spacing:calc(var(--tracking-normal) + .025em)}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-leading{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}
|
package/dist/input.d.ts
ADDED
package/dist/input.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { c as s } from "./utils-DLUjLwnh.js";
|
|
4
|
+
import { F as I, e as A, a as b, i as v, b as D } from "./field-DRLopwY4.js";
|
|
5
|
+
import * as r from "@radix-ui/react-radio-group";
|
|
6
|
+
const g = l.forwardRef(({ className: d, ...e }, i) => /* @__PURE__ */ a(
|
|
7
|
+
r.Root,
|
|
8
|
+
{
|
|
9
|
+
ref: i,
|
|
10
|
+
className: s("radio-group", d),
|
|
11
|
+
"data-slot": "radio-group",
|
|
12
|
+
...e
|
|
13
|
+
}
|
|
14
|
+
));
|
|
15
|
+
g.displayName = r.Root.displayName;
|
|
16
|
+
const f = l.forwardRef(({ className: d, ...e }, i) => /* @__PURE__ */ a(
|
|
17
|
+
r.Item,
|
|
18
|
+
{
|
|
19
|
+
ref: i,
|
|
20
|
+
className: s("radio", d),
|
|
21
|
+
"data-slot": "radio-group-item",
|
|
22
|
+
...e,
|
|
23
|
+
children: /* @__PURE__ */ a(r.Indicator, { className: "radio__indicator", children: /* @__PURE__ */ a("span", { className: "radio__dot", "aria-hidden": !0 }) })
|
|
24
|
+
}
|
|
25
|
+
));
|
|
26
|
+
f.displayName = r.Item.displayName;
|
|
27
|
+
const G = ["plain", "card"], O = ["inline", "block"], w = l.forwardRef(
|
|
28
|
+
({
|
|
29
|
+
className: d,
|
|
30
|
+
label: e,
|
|
31
|
+
secondaryText: i,
|
|
32
|
+
appearance: p = "plain",
|
|
33
|
+
layout: _ = "inline",
|
|
34
|
+
flipped: N = !1,
|
|
35
|
+
id: R,
|
|
36
|
+
disabled: n,
|
|
37
|
+
value: u,
|
|
38
|
+
...o
|
|
39
|
+
}, h) => {
|
|
40
|
+
const F = l.useId(), t = R ?? F, c = i != null, y = o["aria-invalid"] === !0 || o["aria-invalid"] === "true";
|
|
41
|
+
return /* @__PURE__ */ a(
|
|
42
|
+
I,
|
|
43
|
+
{
|
|
44
|
+
className: s(
|
|
45
|
+
"radio-field",
|
|
46
|
+
`radio-field--appearance-${p}`,
|
|
47
|
+
`radio-field--layout-${_}`,
|
|
48
|
+
c && "radio-field--has-secondary",
|
|
49
|
+
N && "radio-field--flipped",
|
|
50
|
+
n && "radio-field--disabled",
|
|
51
|
+
y && "radio-field--invalid",
|
|
52
|
+
d
|
|
53
|
+
),
|
|
54
|
+
"data-slot": "radio-field",
|
|
55
|
+
children: /* @__PURE__ */ m(A, { className: "radio-field__label", htmlFor: t, children: [
|
|
56
|
+
/* @__PURE__ */ a("span", { className: "radio-field__radio-wrap", children: /* @__PURE__ */ a(
|
|
57
|
+
f,
|
|
58
|
+
{
|
|
59
|
+
ref: h,
|
|
60
|
+
id: t,
|
|
61
|
+
value: u,
|
|
62
|
+
disabled: n,
|
|
63
|
+
...o
|
|
64
|
+
}
|
|
65
|
+
) }),
|
|
66
|
+
/* @__PURE__ */ m(b, { className: "radio-field__text", children: [
|
|
67
|
+
/* @__PURE__ */ a(v, { className: "radio-field__primary", children: e }),
|
|
68
|
+
c ? /* @__PURE__ */ a(D, { className: "radio-field__secondary", children: i }) : null
|
|
69
|
+
] })
|
|
70
|
+
] })
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
w.displayName = "RadioField";
|
|
76
|
+
export {
|
|
77
|
+
g as R,
|
|
78
|
+
f as a,
|
|
79
|
+
w as b,
|
|
80
|
+
G as c,
|
|
81
|
+
O as d
|
|
82
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-duration:initial;--tw-ease:initial}}}.radio{transition-property:border-color,box-shadow,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4,0,.2,1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));--tw-duration:.15s;--tw-ease:var(--ease-in-out,cubic-bezier(.4,0,.2,1));transition-duration:.15s;transition-timing-function:var(--ease-in-out,cubic-bezier(.4,0,.2,1));--tw-outline-style:none;--kuat-radio-size:calc(var(--spacing)*4);width:var(--kuat-radio-size);height:var(--kuat-radio-size);border:1px solid var(--slate-300);background:var(--input);box-shadow:var(--shadow-xs);border-radius:3.40282e38px;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative}.radio:focus-visible{border-color:var(--slate-400);box-shadow:0 0 0 3px var(--ring)}.radio[data-state=checked]{border-color:var(--primary);box-shadow:var(--shadow-xs)}.radio[data-state=checked]:focus-visible{border-color:var(--primary);box-shadow:0 0 0 3px var(--ring)}.radio[aria-invalid=true]{border-color:var(--destructive)}.radio[aria-invalid=true]:focus-visible{border-color:var(--destructive);box-shadow:0 0 0 3px var(--red-300)}.radio[data-state=checked][aria-invalid=true]{border-color:var(--destructive)}.radio[data-state=checked][aria-invalid=true]:focus-visible{box-shadow:0 0 0 3px var(--red-300)}.radio:disabled{cursor:not-allowed;opacity:.3}.radio__indicator{color:currentColor;justify-content:center;align-items:center;display:flex}.radio__dot{width:calc(var(--kuat-radio-size)/2);height:calc(var(--kuat-radio-size)/2);background:var(--primary);border-radius:3.40282e38px;display:block}.radio[data-state=checked][aria-invalid=true] .radio__dot{background:var(--destructive)}.radio-group{width:100%;min-width:calc(var(--spacing,.25rem)*0)}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-tracking:initial}}}.radio-field{width:100%;min-width:calc(var(--spacing,.25rem)*0)}.radio-field__label{cursor:pointer;align-items:flex-start;gap:calc(var(--spacing,.25rem)*2);-webkit-user-select:none;user-select:none;display:flex}.radio-field--appearance-card .radio-field__label{border-style:var(--tw-border-style);--tw-border-style:solid;border-style:solid;border-width:1px;border-color:var(--border);background-color:var(--card);padding-inline:calc(var(--spacing,.25rem)*3);padding-block:calc(var(--spacing,.25rem)*2);border-radius:10px}.radio-field--disabled .radio-field__label{cursor:not-allowed;opacity:.3}.radio-field--invalid .radio-field__primary{color:var(--destructive)}.radio-field--appearance-card.radio-field--invalid .radio-field__label{border-color:var(--destructive)}.radio-field--flipped .radio-field__label{flex-direction:row-reverse}.radio-field__radio-wrap{padding-top:calc(var(--spacing,.25rem)*.5);flex-shrink:0;justify-content:center;align-items:center;display:flex}.radio-field__text{min-height:1px;min-width:calc(var(--spacing,.25rem)*0);text-align:left;align-items:flex-start;row-gap:var(--spacing);flex-direction:column;flex:1;display:flex}.radio-field--layout-inline .radio-field__text{flex:none}.radio-field--layout-inline:not(.radio-field--has-secondary) .radio-field__primary{white-space:nowrap;flex-shrink:0}.radio-field__primary{width:100%;font-family:var(--font-sans,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25/.875)));--tw-leading:1.5;--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal);color:var(--foreground);line-height:1.5}.radio-field__secondary{width:100%;font-family:var(--font-sans,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1/.75)));--tw-leading:calc(var(--spacing,.25rem)*4);line-height:calc(var(--spacing,.25rem)*4);--tw-tracking:calc(var(--tracking-normal) + .025em);letter-spacing:calc(var(--tracking-normal) + .025em);color:var(--muted-foreground)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}
|
package/dist/radio.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { cn } from './lib/utils';
|
|
2
|
+
export { RadioGroup, RadioGroupItem, RadioField, RADIO_FIELD_APPEARANCES, RADIO_FIELD_LAYOUTS, } from './components/ui/radio';
|
|
3
|
+
export type { RadioGroupProps, RadioGroupItemProps, RadioFieldAppearance, RadioFieldLayout, RadioFieldProps, } from './components/ui/radio';
|
package/dist/radio.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { c as R } from "./utils-DLUjLwnh.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { c as A, d, b as i, R as p, a as I } from "./radio-field-G8dvdsLE.js";
|
|
4
|
+
export {
|
|
5
|
+
A as RADIO_FIELD_APPEARANCES,
|
|
6
|
+
d as RADIO_FIELD_LAYOUTS,
|
|
7
|
+
i as RadioField,
|
|
8
|
+
p as RadioGroup,
|
|
9
|
+
I as RadioGroupItem,
|
|
10
|
+
R as cn
|
|
11
|
+
};
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import * as a from "@radix-ui/react-select";
|
|
4
|
+
import { ChevronDown as S, ChevronUp as T, Check as $ } from "lucide-react";
|
|
5
|
+
import { c as m } from "./utils-DLUjLwnh.js";
|
|
6
|
+
const K = ["regular", "large", "small", "mini"], P = ["single", "double"];
|
|
7
|
+
function z(t) {
|
|
8
|
+
return "items" in t;
|
|
9
|
+
}
|
|
10
|
+
const x = a.Root, D = a.Value, U = a.Group, f = o.forwardRef(({ className: t, ...l }, s) => /* @__PURE__ */ e(
|
|
11
|
+
a.Label,
|
|
12
|
+
{
|
|
13
|
+
ref: s,
|
|
14
|
+
className: m("select-label", t),
|
|
15
|
+
"data-slot": "select-label",
|
|
16
|
+
...l
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
f.displayName = a.Label.displayName;
|
|
20
|
+
const _ = o.forwardRef(
|
|
21
|
+
({
|
|
22
|
+
className: t,
|
|
23
|
+
children: l,
|
|
24
|
+
size: s = "regular",
|
|
25
|
+
lines: r = "single",
|
|
26
|
+
label: c,
|
|
27
|
+
prepend: n,
|
|
28
|
+
decoration: i,
|
|
29
|
+
invalid: p,
|
|
30
|
+
...u
|
|
31
|
+
}, N) => /* @__PURE__ */ d(
|
|
32
|
+
a.Trigger,
|
|
33
|
+
{
|
|
34
|
+
ref: N,
|
|
35
|
+
className: m(
|
|
36
|
+
"select-trigger",
|
|
37
|
+
`select-trigger--size-${s}`,
|
|
38
|
+
`select-trigger--lines-${r}`,
|
|
39
|
+
t
|
|
40
|
+
),
|
|
41
|
+
"data-slot": "select-trigger",
|
|
42
|
+
"aria-invalid": p || u["aria-invalid"] ? !0 : void 0,
|
|
43
|
+
...u,
|
|
44
|
+
children: [
|
|
45
|
+
n ? /* @__PURE__ */ e("span", { className: "select-trigger__prepend", children: n }) : null,
|
|
46
|
+
/* @__PURE__ */ d("span", { className: "select-trigger__value-wrap", children: [
|
|
47
|
+
c ? /* @__PURE__ */ e("span", { className: "select-trigger__label", children: c }) : null,
|
|
48
|
+
l
|
|
49
|
+
] }),
|
|
50
|
+
i ? /* @__PURE__ */ e("span", { className: "select-trigger__decoration", children: i }) : null,
|
|
51
|
+
/* @__PURE__ */ e(a.Icon, { asChild: !0, children: /* @__PURE__ */ e(S, { className: "select-trigger__icon size-4", "aria-hidden": !0 }) })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
_.displayName = a.Trigger.displayName;
|
|
57
|
+
const b = o.forwardRef(({ className: t, ...l }, s) => /* @__PURE__ */ e(
|
|
58
|
+
a.ScrollUpButton,
|
|
59
|
+
{
|
|
60
|
+
ref: s,
|
|
61
|
+
className: m("select-scroll-button", t),
|
|
62
|
+
"data-slot": "select-scroll-up-button",
|
|
63
|
+
...l,
|
|
64
|
+
children: /* @__PURE__ */ e(T, { className: "size-4", "aria-hidden": !0 })
|
|
65
|
+
}
|
|
66
|
+
));
|
|
67
|
+
b.displayName = a.ScrollUpButton.displayName;
|
|
68
|
+
const v = o.forwardRef(({ className: t, ...l }, s) => /* @__PURE__ */ e(
|
|
69
|
+
a.ScrollDownButton,
|
|
70
|
+
{
|
|
71
|
+
ref: s,
|
|
72
|
+
className: m("select-scroll-button", t),
|
|
73
|
+
"data-slot": "select-scroll-down-button",
|
|
74
|
+
...l,
|
|
75
|
+
children: /* @__PURE__ */ e(S, { className: "size-4", "aria-hidden": !0 })
|
|
76
|
+
}
|
|
77
|
+
));
|
|
78
|
+
v.displayName = a.ScrollDownButton.displayName;
|
|
79
|
+
const w = o.forwardRef(
|
|
80
|
+
({
|
|
81
|
+
className: t,
|
|
82
|
+
children: l,
|
|
83
|
+
position: s = "item-aligned",
|
|
84
|
+
size: r = "regular",
|
|
85
|
+
maxHeight: c,
|
|
86
|
+
style: n,
|
|
87
|
+
...i
|
|
88
|
+
}, p) => /* @__PURE__ */ e(a.Portal, { children: /* @__PURE__ */ d(
|
|
89
|
+
a.Content,
|
|
90
|
+
{
|
|
91
|
+
ref: p,
|
|
92
|
+
className: m(
|
|
93
|
+
"select-content",
|
|
94
|
+
`select-content--position-${s}`,
|
|
95
|
+
`select-content--size-${r}`,
|
|
96
|
+
t
|
|
97
|
+
),
|
|
98
|
+
"data-slot": "select-content",
|
|
99
|
+
position: s,
|
|
100
|
+
style: {
|
|
101
|
+
...n,
|
|
102
|
+
"--kuat-select-content-max-height": typeof c == "number" ? `${c}px` : c
|
|
103
|
+
},
|
|
104
|
+
...i,
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ e(b, {}),
|
|
107
|
+
/* @__PURE__ */ e(a.Viewport, { className: "select-viewport", "data-slot": "select-viewport", children: l }),
|
|
108
|
+
/* @__PURE__ */ e(v, {})
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
) })
|
|
112
|
+
);
|
|
113
|
+
w.displayName = a.Content.displayName;
|
|
114
|
+
const y = o.forwardRef(({ className: t, ...l }, s) => /* @__PURE__ */ e(
|
|
115
|
+
a.Separator,
|
|
116
|
+
{
|
|
117
|
+
ref: s,
|
|
118
|
+
className: m("select-separator", t),
|
|
119
|
+
"data-slot": "select-separator",
|
|
120
|
+
...l
|
|
121
|
+
}
|
|
122
|
+
));
|
|
123
|
+
y.displayName = a.Separator.displayName;
|
|
124
|
+
const g = o.forwardRef(({ className: t, children: l, prepend: s, description: r, decoration: c, ...n }, i) => /* @__PURE__ */ d(
|
|
125
|
+
a.Item,
|
|
126
|
+
{
|
|
127
|
+
ref: i,
|
|
128
|
+
className: m("select-item", r && "select-item--double", t),
|
|
129
|
+
"data-slot": "select-item",
|
|
130
|
+
...n,
|
|
131
|
+
children: [
|
|
132
|
+
s ? /* @__PURE__ */ e("span", { className: "select-item__prepend", children: s }) : null,
|
|
133
|
+
/* @__PURE__ */ d("span", { className: "select-item__text", children: [
|
|
134
|
+
/* @__PURE__ */ e(a.ItemText, { className: "select-item__label", children: l }),
|
|
135
|
+
r ? /* @__PURE__ */ e("span", { className: "select-item__description", children: r }) : null
|
|
136
|
+
] }),
|
|
137
|
+
c ? /* @__PURE__ */ e("span", { className: "select-item__decoration", children: c }) : null,
|
|
138
|
+
/* @__PURE__ */ e(a.ItemIndicator, { className: "select-item__indicator", children: /* @__PURE__ */ e($, { className: "size-4", "aria-hidden": !0 }) })
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
));
|
|
142
|
+
g.displayName = a.Item.displayName;
|
|
143
|
+
function j(t) {
|
|
144
|
+
return t.map((l, s) => z(l) ? /* @__PURE__ */ d(U, { children: [
|
|
145
|
+
/* @__PURE__ */ e(f, { children: l.label }),
|
|
146
|
+
l.items.map((r) => /* @__PURE__ */ e(
|
|
147
|
+
g,
|
|
148
|
+
{
|
|
149
|
+
value: r.value,
|
|
150
|
+
disabled: r.disabled,
|
|
151
|
+
prepend: r.prepend,
|
|
152
|
+
description: r.description,
|
|
153
|
+
decoration: r.decoration,
|
|
154
|
+
children: r.label
|
|
155
|
+
},
|
|
156
|
+
r.value
|
|
157
|
+
)),
|
|
158
|
+
s < t.length - 1 ? /* @__PURE__ */ e(y, {}) : null
|
|
159
|
+
] }, `group-${s}`) : /* @__PURE__ */ e(
|
|
160
|
+
g,
|
|
161
|
+
{
|
|
162
|
+
value: l.value,
|
|
163
|
+
disabled: l.disabled,
|
|
164
|
+
prepend: l.prepend,
|
|
165
|
+
description: l.description,
|
|
166
|
+
decoration: l.decoration,
|
|
167
|
+
children: l.label
|
|
168
|
+
},
|
|
169
|
+
l.value
|
|
170
|
+
));
|
|
171
|
+
}
|
|
172
|
+
function Z({
|
|
173
|
+
items: t = [],
|
|
174
|
+
placeholder: l = "Select an item",
|
|
175
|
+
size: s = "regular",
|
|
176
|
+
lines: r = "single",
|
|
177
|
+
prepend: c,
|
|
178
|
+
decoration: n,
|
|
179
|
+
label: i,
|
|
180
|
+
invalid: p = !1,
|
|
181
|
+
position: u = "item-aligned",
|
|
182
|
+
maxHeight: N = 320,
|
|
183
|
+
triggerClassName: C,
|
|
184
|
+
contentClassName: I,
|
|
185
|
+
emptyText: R = "No options available",
|
|
186
|
+
children: h,
|
|
187
|
+
triggerProps: B,
|
|
188
|
+
...E
|
|
189
|
+
}) {
|
|
190
|
+
const L = o.Children.count(h) > 0;
|
|
191
|
+
return /* @__PURE__ */ d(x, { ...E, children: [
|
|
192
|
+
/* @__PURE__ */ e(
|
|
193
|
+
_,
|
|
194
|
+
{
|
|
195
|
+
size: s,
|
|
196
|
+
lines: r,
|
|
197
|
+
prepend: c,
|
|
198
|
+
decoration: n,
|
|
199
|
+
label: i,
|
|
200
|
+
invalid: p,
|
|
201
|
+
className: C,
|
|
202
|
+
...B,
|
|
203
|
+
children: /* @__PURE__ */ e(D, { className: "select-trigger__value", placeholder: l })
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ e(
|
|
207
|
+
w,
|
|
208
|
+
{
|
|
209
|
+
size: s,
|
|
210
|
+
position: u,
|
|
211
|
+
maxHeight: N,
|
|
212
|
+
className: I,
|
|
213
|
+
children: L ? h : t.length > 0 ? j(t) : /* @__PURE__ */ e("p", { className: "select-empty", children: R })
|
|
214
|
+
}
|
|
215
|
+
)
|
|
216
|
+
] });
|
|
217
|
+
}
|
|
218
|
+
export {
|
|
219
|
+
Z as K,
|
|
220
|
+
x as S,
|
|
221
|
+
w as a,
|
|
222
|
+
U as b,
|
|
223
|
+
g as c,
|
|
224
|
+
f as d,
|
|
225
|
+
v as e,
|
|
226
|
+
b as f,
|
|
227
|
+
y as g,
|
|
228
|
+
_ as h,
|
|
229
|
+
D as i,
|
|
230
|
+
P as j,
|
|
231
|
+
K as k
|
|
232
|
+
};
|
package/dist/select.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-duration:initial;--tw-ease:initial;--tw-leading:initial;--tw-tracking:initial;--tw-border-style:solid;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}.select-trigger{width:100%;min-width:calc(var(--spacing,.25rem)*0);transition-property:border-color,box-shadow,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4,0,.2,1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));--tw-duration:.15s;--tw-ease:var(--ease-in-out,cubic-bezier(.4,0,.2,1));transition-duration:.15s;transition-timing-function:var(--ease-in-out,cubic-bezier(.4,0,.2,1));--tw-outline-style:none;border:1px solid var(--border);background:var(--input);color:var(--foreground);box-shadow:var(--shadow-xs);border-radius:4px;outline-style:none;align-items:center;display:flex}.select-trigger:focus-visible:not(:disabled){border-color:var(--border);box-shadow:0 0 0 3px var(--ring)}.select-trigger[aria-invalid=true]{border-color:var(--destructive)}.select-trigger[aria-invalid=true]:focus-visible{box-shadow:0 0 0 3px var(--red-300)}.select-trigger:disabled{cursor:not-allowed;opacity:.5}.select-trigger__prepend,.select-trigger__decoration,.select-trigger__icon{color:var(--muted-foreground);flex-shrink:0}.select-trigger__value-wrap{min-width:calc(var(--spacing,.25rem)*0);flex:1}.select-trigger__label{text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1/.75)));--tw-leading:calc(var(--spacing,.25rem)*4);line-height:calc(var(--spacing,.25rem)*4);--tw-tracking:calc(var(--tracking-normal) + .025em);letter-spacing:calc(var(--tracking-normal) + .025em);color:var(--muted-foreground);display:block;overflow:hidden}.select-trigger__value{text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25/.875)));--tw-leading:calc(var(--spacing,.25rem)*6);line-height:calc(var(--spacing,.25rem)*6);--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal);display:block;overflow:hidden}.select-trigger__value[data-placeholder]{color:var(--muted-foreground)}.select-trigger--size-regular{min-height:calc(var(--spacing,.25rem)*9);gap:calc(var(--spacing,.25rem)*2);padding-block:7.5px;padding-right:calc(var(--spacing,.25rem)*2);padding-left:calc(var(--spacing,.25rem)*3)}.select-trigger--size-large{min-height:calc(var(--spacing,.25rem)*10);gap:calc(var(--spacing,.25rem)*3);padding-block:9.5px;padding-right:calc(var(--spacing,.25rem)*2);padding-left:calc(var(--spacing,.25rem)*4)}.select-trigger--size-small{min-height:calc(var(--spacing,.25rem)*8);gap:calc(var(--spacing,.25rem)*1.5);padding-inline:calc(var(--spacing,.25rem)*2);padding-block:5.5px}.select-trigger--size-mini{min-height:calc(var(--spacing,.25rem)*8);gap:calc(var(--spacing,.25rem)*1);padding-inline:calc(var(--spacing,.25rem)*1.5);padding-block:3px}.select-trigger--lines-double{align-items:flex-end}.select-trigger--lines-double .select-trigger__value-wrap{flex-direction:column;align-items:flex-start;display:flex}.select-trigger--lines-double .select-trigger__value{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25/.875)));--tw-leading:calc(var(--spacing,.25rem)*5);line-height:calc(var(--spacing,.25rem)*5)}.select-content{z-index:50;border-style:var(--tw-border-style);min-width:8rem;padding:calc(var(--spacing,.25rem)*.5);border-width:1px;border-color:var(--border);background:var(--card);color:var(--foreground);border-radius:8px;position:relative;overflow:hidden;box-shadow:0 4px 6px #0000001a,0 2px 4px #0000001a}.select-content[data-state=open]{animation:.12s ease-out select-in}.select-content[data-state=closed]{animation:.12s ease-in select-out}.select-content--position-popper{--tw-translate-y:calc(var(--spacing,.25rem)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.select-viewport{padding:calc(var(--spacing,.25rem)*.5);max-height:var(--kuat-select-content-max-height,20rem)}.select-scroll-button{height:calc(var(--spacing,.25rem)*6);cursor:default;color:var(--muted-foreground);justify-content:center;align-items:center;display:flex}.select-label{padding-inline:calc(var(--spacing,.25rem)*2);font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1/.75)));--tw-leading:calc(var(--spacing,.25rem)*4);line-height:calc(var(--spacing,.25rem)*4);--tw-tracking:calc(var(--tracking-normal) + .025em);letter-spacing:calc(var(--tracking-normal) + .025em);color:var(--muted-foreground);padding-block:5.5px}.select-separator{margin-block:calc(var(--spacing,.25rem)*1);background-color:var(--border);height:1px}.select-item{cursor:default;--tw-outline-style:none;-webkit-user-select:none;user-select:none;width:100%;color:var(--foreground);border-radius:6px;outline-style:none;align-items:center;display:flex;position:relative}.select-item[data-highlighted]{background-color:var(--accent);color:var(--accent-foreground)}.select-item[data-disabled]{pointer-events:none;opacity:.5}.select-content--size-regular .select-item{min-height:calc(var(--spacing,.25rem)*9);gap:calc(var(--spacing,.25rem)*2);padding-block:7.5px;padding-right:calc(var(--spacing,.25rem)*2);padding-left:calc(var(--spacing,.25rem)*3)}.select-content--size-large .select-item{min-height:calc(var(--spacing,.25rem)*10);gap:calc(var(--spacing,.25rem)*3);padding-block:9.5px;padding-right:calc(var(--spacing,.25rem)*2);padding-left:calc(var(--spacing,.25rem)*4)}.select-content--size-small .select-item{min-height:calc(var(--spacing,.25rem)*8);gap:calc(var(--spacing,.25rem)*1.5);padding-inline:calc(var(--spacing,.25rem)*2);padding-block:5.5px}.select-content--size-mini .select-item{min-height:calc(var(--spacing,.25rem)*8);gap:calc(var(--spacing,.25rem)*1);padding-inline:calc(var(--spacing,.25rem)*1.5);padding-block:3px}.select-item__prepend,.select-item__decoration,.select-item__indicator{color:var(--muted-foreground);flex-shrink:0}.select-item__text{min-width:calc(var(--spacing,.25rem)*0);flex:1}.select-item__label{text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25/.875)));--tw-leading:calc(var(--spacing,.25rem)*6);line-height:calc(var(--spacing,.25rem)*6);--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal);display:block;overflow:hidden}.select-item__description{text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1/.75)));--tw-leading:calc(var(--spacing,.25rem)*4);line-height:calc(var(--spacing,.25rem)*4);--tw-tracking:calc(var(--tracking-normal) + .025em);letter-spacing:calc(var(--tracking-normal) + .025em);color:var(--muted-foreground);display:block;overflow:hidden}.select-item--double .select-item__text{flex-direction:column;display:flex}.select-empty{padding-inline:calc(var(--spacing,.25rem)*2);padding-block:calc(var(--spacing,.25rem)*1.5);font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25/.875)));color:var(--muted-foreground)}@keyframes select-in{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}@keyframes select-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.98)}}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-leading{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}
|
package/dist/select.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { cn } from './lib/utils';
|
|
2
|
+
export { KuatSelect, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SELECT_LINES, SELECT_SIZES, } from './components/ui/select';
|
|
3
|
+
export type { KuatSelectProps, SelectContentProps, SelectItemGroup, SelectItemOption, SelectItemProps, SelectItems, SelectLabelProps, SelectLines, SelectProps, SelectSeparatorProps, SelectSize, SelectTriggerProps, SelectValueProps, } from './components/ui/select';
|
package/dist/select.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { c as S } from "./utils-DLUjLwnh.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { K as c, j as s, k as o, S as r, a as n, b as p, c as E, d as u, e as m, f as L, g as f, h as g, i } from "./select-Oz2Zj-L0.js";
|
|
4
|
+
export {
|
|
5
|
+
c as KuatSelect,
|
|
6
|
+
s as SELECT_LINES,
|
|
7
|
+
o as SELECT_SIZES,
|
|
8
|
+
r as Select,
|
|
9
|
+
n as SelectContent,
|
|
10
|
+
p as SelectGroup,
|
|
11
|
+
E as SelectItem,
|
|
12
|
+
u as SelectLabel,
|
|
13
|
+
m as SelectScrollDownButton,
|
|
14
|
+
L as SelectScrollUpButton,
|
|
15
|
+
f as SelectSeparator,
|
|
16
|
+
g as SelectTrigger,
|
|
17
|
+
i as SelectValue,
|
|
18
|
+
S as cn
|
|
19
|
+
};
|