@pittorica/select-react 0.23.1 → 0.23.2
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/Select.d.ts +13 -2
- package/dist/Select.d.ts.map +1 -1
- package/dist/index.js +144 -136
- package/package.json +6 -6
package/dist/Select.d.ts
CHANGED
|
@@ -8,17 +8,28 @@ export interface SelectRootProps extends BoxProps {
|
|
|
8
8
|
error?: boolean;
|
|
9
9
|
color?: PittoricaColor;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
name?: string;
|
|
11
12
|
/** @default 'sm' */
|
|
12
13
|
size?: SelectSize;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Root component for the Select system.
|
|
17
|
+
* Manages accessibility IDs and shared state.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SelectRoot: ({ children, label, helperText, error, color, disabled, name, size, className, style, ...props }: SelectRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
20
|
export type SelectContentProps = React.SelectHTMLAttributes<HTMLSelectElement>;
|
|
21
|
+
/**
|
|
22
|
+
* The actual select element. Must be used inside Select.Root.
|
|
23
|
+
*/
|
|
16
24
|
export declare const SelectContent: ({ children, className, ref, ...props }: SelectContentProps & {
|
|
17
25
|
ref?: Ref<HTMLSelectElement>;
|
|
18
26
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* Optional slot for icons or additional content inside the select wrapper.
|
|
29
|
+
*/
|
|
19
30
|
export declare const SelectSlot: ({ children, className, ...props }: BoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
31
|
export declare const Select: {
|
|
21
|
-
Root: ({ children, label, helperText, error, color, disabled, size, className, style, ...props }: SelectRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
Root: ({ children, label, helperText, error, color, disabled, name, size, className, style, ...props }: SelectRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
33
|
Content: ({ children, className, ref, ...props }: SelectContentProps & {
|
|
23
34
|
ref?: Ref<HTMLSelectElement>;
|
|
24
35
|
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/Select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../src/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,GAAG,EAAc,MAAM,OAAO,CAAC;AAM5E,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../src/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,GAAG,EAAc,MAAM,OAAO,CAAC;AAM5E,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAoBnD,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,iGAYxB,eAAe,4CA2DjB,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,wCAK3B,kBAAkB,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,4CAgBvD,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,mCAAmC,QAAQ,4CAIrE,CAAC;AAEF,eAAO,MAAM,MAAM;4GApGhB,eAAe;sDAwEf,kBAAkB,GAAG;QAAE,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;KAAE;8CAsBM,QAAQ;CAUrE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
function
|
|
1
|
+
import { jsx as u, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as z, createElement as j, createContext as G, useId as W, use as H } from "react";
|
|
3
|
+
function I(t) {
|
|
4
4
|
var i, r, e = "";
|
|
5
5
|
if (typeof t == "string" || typeof t == "number") e += t;
|
|
6
6
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
7
7
|
var a = t.length;
|
|
8
|
-
for (i = 0; i < a; i++) t[i] && (r =
|
|
8
|
+
for (i = 0; i < a; i++) t[i] && (r = I(t[i])) && (e && (e += " "), e += r);
|
|
9
9
|
} else for (r in t) t[r] && (e && (e += " "), e += r);
|
|
10
10
|
return e;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i =
|
|
12
|
+
function F() {
|
|
13
|
+
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i = I(t)) && (e && (e += " "), e += i);
|
|
14
14
|
return e;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
@@ -19,7 +19,7 @@ function j() {
|
|
|
19
19
|
* This source code is licensed under the MIT license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
21
|
*/
|
|
22
|
-
var
|
|
22
|
+
var J = {
|
|
23
23
|
outline: {
|
|
24
24
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25
25
|
width: 24,
|
|
@@ -46,24 +46,24 @@ var H = {
|
|
|
46
46
|
* This source code is licensed under the MIT license.
|
|
47
47
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/
|
|
49
|
-
const
|
|
50
|
-
const a =
|
|
51
|
-
({ color:
|
|
49
|
+
const K = (t, i, r, e) => {
|
|
50
|
+
const a = z(
|
|
51
|
+
({ color: o = "currentColor", size: c = 24, stroke: s = 2, title: p, className: h, children: l, ...d }, m) => j(
|
|
52
52
|
"svg",
|
|
53
53
|
{
|
|
54
|
-
ref:
|
|
55
|
-
...
|
|
56
|
-
width:
|
|
57
|
-
height:
|
|
54
|
+
ref: m,
|
|
55
|
+
...J[t],
|
|
56
|
+
width: c,
|
|
57
|
+
height: c,
|
|
58
58
|
className: ["tabler-icon", `tabler-icon-${i}`, h].join(" "),
|
|
59
|
-
strokeWidth:
|
|
60
|
-
stroke:
|
|
61
|
-
...
|
|
59
|
+
strokeWidth: s,
|
|
60
|
+
stroke: o,
|
|
61
|
+
...d
|
|
62
62
|
},
|
|
63
63
|
[
|
|
64
|
-
|
|
65
|
-
...e.map(([
|
|
66
|
-
...Array.isArray(
|
|
64
|
+
p && j("title", { key: "svg-title" }, p),
|
|
65
|
+
...e.map(([f, g]) => j(f, g)),
|
|
66
|
+
...Array.isArray(l) ? l : [l]
|
|
67
67
|
]
|
|
68
68
|
)
|
|
69
69
|
);
|
|
@@ -75,36 +75,36 @@ const J = (t, i, r, e) => {
|
|
|
75
75
|
* This source code is licensed under the MIT license.
|
|
76
76
|
* See the LICENSE file in the root directory of this source tree.
|
|
77
77
|
*/
|
|
78
|
-
const
|
|
79
|
-
function
|
|
78
|
+
const O = [["path", { d: "M6 9l6 6l6 -6", key: "svg-0" }]], P = K("outline", "chevron-down", "ChevronDown", O);
|
|
79
|
+
function T(t) {
|
|
80
80
|
var i, r, e = "";
|
|
81
81
|
if (typeof t == "string" || typeof t == "number") e += t;
|
|
82
82
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
83
83
|
var a = t.length;
|
|
84
|
-
for (i = 0; i < a; i++) t[i] && (r =
|
|
84
|
+
for (i = 0; i < a; i++) t[i] && (r = T(t[i])) && (e && (e += " "), e += r);
|
|
85
85
|
} else for (r in t) t[r] && (e && (e += " "), e += r);
|
|
86
86
|
return e;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i =
|
|
88
|
+
function Q() {
|
|
89
|
+
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i = T(t)) && (e && (e += " "), e += i);
|
|
90
90
|
return e;
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const q = ({
|
|
93
93
|
ref: t,
|
|
94
94
|
as: i = "div",
|
|
95
95
|
children: r,
|
|
96
96
|
display: e,
|
|
97
97
|
m: a,
|
|
98
|
-
mt:
|
|
99
|
-
mr:
|
|
100
|
-
mb:
|
|
101
|
-
ml:
|
|
98
|
+
mt: o,
|
|
99
|
+
mr: c,
|
|
100
|
+
mb: s,
|
|
101
|
+
ml: p,
|
|
102
102
|
p: h,
|
|
103
|
-
pt:
|
|
104
|
-
pr:
|
|
105
|
-
pb:
|
|
106
|
-
pl:
|
|
107
|
-
width:
|
|
103
|
+
pt: l,
|
|
104
|
+
pr: d,
|
|
105
|
+
pb: m,
|
|
106
|
+
pl: f,
|
|
107
|
+
width: g,
|
|
108
108
|
height: v,
|
|
109
109
|
position: y,
|
|
110
110
|
style: b,
|
|
@@ -114,75 +114,77 @@ const T = ({
|
|
|
114
114
|
rel: N,
|
|
115
115
|
htmlFor: S,
|
|
116
116
|
type: C,
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
name: A,
|
|
118
|
+
disabled: k,
|
|
119
|
+
...R
|
|
119
120
|
}) => {
|
|
120
|
-
const
|
|
121
|
-
e && (
|
|
122
|
-
const
|
|
121
|
+
const n = {};
|
|
122
|
+
e && (n.display = e), g && (n.width = g), v && (n.height = v), y && (n.position = y), a && (n.margin = `var(--pittorica-space-${a})`), o && (n.marginTop = `var(--pittorica-space-${o})`), c && (n.marginRight = `var(--pittorica-space-${c})`), s && (n.marginBottom = `var(--pittorica-space-${s})`), p && (n.marginLeft = `var(--pittorica-space-${p})`), h && (n.padding = `var(--pittorica-space-${h})`), l && (n.paddingTop = `var(--pittorica-space-${l})`), d && (n.paddingRight = `var(--pittorica-space-${d})`), m && (n.paddingBottom = `var(--pittorica-space-${m})`), f && (n.paddingLeft = `var(--pittorica-space-${f})`);
|
|
123
|
+
const B = {
|
|
123
124
|
...b,
|
|
124
|
-
...
|
|
125
|
+
...n
|
|
125
126
|
};
|
|
126
|
-
return /* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ u(
|
|
127
128
|
i,
|
|
128
129
|
{
|
|
129
130
|
ref: t,
|
|
130
|
-
className:
|
|
131
|
-
style:
|
|
131
|
+
className: Q("pittorica-box", w),
|
|
132
|
+
style: B,
|
|
132
133
|
href: $,
|
|
133
134
|
target: x,
|
|
134
135
|
rel: N,
|
|
135
136
|
htmlFor: S,
|
|
136
137
|
type: C,
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
name: A,
|
|
139
|
+
disabled: k,
|
|
140
|
+
...R,
|
|
139
141
|
children: r
|
|
140
142
|
}
|
|
141
143
|
);
|
|
142
144
|
};
|
|
143
|
-
|
|
144
|
-
function
|
|
145
|
+
q.displayName = "Box";
|
|
146
|
+
function D(t) {
|
|
145
147
|
var i, r, e = "";
|
|
146
148
|
if (typeof t == "string" || typeof t == "number") e += t;
|
|
147
149
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
148
150
|
var a = t.length;
|
|
149
|
-
for (i = 0; i < a; i++) t[i] && (r =
|
|
151
|
+
for (i = 0; i < a; i++) t[i] && (r = D(t[i])) && (e && (e += " "), e += r);
|
|
150
152
|
} else for (r in t) t[r] && (e && (e += " "), e += r);
|
|
151
153
|
return e;
|
|
152
154
|
}
|
|
153
|
-
function
|
|
154
|
-
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i =
|
|
155
|
+
function U() {
|
|
156
|
+
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i = D(t)) && (e && (e += " "), e += i);
|
|
155
157
|
return e;
|
|
156
158
|
}
|
|
157
|
-
function
|
|
159
|
+
function E(t) {
|
|
158
160
|
var i, r, e = "";
|
|
159
161
|
if (typeof t == "string" || typeof t == "number") e += t;
|
|
160
162
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
161
163
|
var a = t.length;
|
|
162
|
-
for (i = 0; i < a; i++) t[i] && (r =
|
|
164
|
+
for (i = 0; i < a; i++) t[i] && (r = E(t[i])) && (e && (e += " "), e += r);
|
|
163
165
|
} else for (r in t) t[r] && (e && (e += " "), e += r);
|
|
164
166
|
return e;
|
|
165
167
|
}
|
|
166
|
-
function
|
|
167
|
-
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i =
|
|
168
|
+
function V() {
|
|
169
|
+
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i = E(t)) && (e && (e += " "), e += i);
|
|
168
170
|
return e;
|
|
169
171
|
}
|
|
170
|
-
const
|
|
172
|
+
const _ = ({
|
|
171
173
|
ref: t,
|
|
172
174
|
as: i = "div",
|
|
173
175
|
children: r,
|
|
174
176
|
display: e,
|
|
175
177
|
m: a,
|
|
176
|
-
mt:
|
|
177
|
-
mr:
|
|
178
|
-
mb:
|
|
179
|
-
ml:
|
|
178
|
+
mt: o,
|
|
179
|
+
mr: c,
|
|
180
|
+
mb: s,
|
|
181
|
+
ml: p,
|
|
180
182
|
p: h,
|
|
181
|
-
pt:
|
|
182
|
-
pr:
|
|
183
|
-
pb:
|
|
184
|
-
pl:
|
|
185
|
-
width:
|
|
183
|
+
pt: l,
|
|
184
|
+
pr: d,
|
|
185
|
+
pb: m,
|
|
186
|
+
pl: f,
|
|
187
|
+
width: g,
|
|
186
188
|
height: v,
|
|
187
189
|
position: y,
|
|
188
190
|
style: b,
|
|
@@ -192,49 +194,52 @@ const E = ({
|
|
|
192
194
|
rel: N,
|
|
193
195
|
htmlFor: S,
|
|
194
196
|
type: C,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
+
name: A,
|
|
198
|
+
disabled: k,
|
|
199
|
+
...R
|
|
197
200
|
}) => {
|
|
198
|
-
const
|
|
199
|
-
e && (
|
|
200
|
-
const
|
|
201
|
+
const n = {};
|
|
202
|
+
e && (n.display = e), g && (n.width = g), v && (n.height = v), y && (n.position = y), a && (n.margin = `var(--pittorica-space-${a})`), o && (n.marginTop = `var(--pittorica-space-${o})`), c && (n.marginRight = `var(--pittorica-space-${c})`), s && (n.marginBottom = `var(--pittorica-space-${s})`), p && (n.marginLeft = `var(--pittorica-space-${p})`), h && (n.padding = `var(--pittorica-space-${h})`), l && (n.paddingTop = `var(--pittorica-space-${l})`), d && (n.paddingRight = `var(--pittorica-space-${d})`), m && (n.paddingBottom = `var(--pittorica-space-${m})`), f && (n.paddingLeft = `var(--pittorica-space-${f})`);
|
|
203
|
+
const B = {
|
|
201
204
|
...b,
|
|
202
|
-
...
|
|
205
|
+
...n
|
|
203
206
|
};
|
|
204
|
-
return /* @__PURE__ */
|
|
207
|
+
return /* @__PURE__ */ u(
|
|
205
208
|
i,
|
|
206
209
|
{
|
|
207
210
|
ref: t,
|
|
208
|
-
className:
|
|
209
|
-
style:
|
|
211
|
+
className: V("pittorica-box", w),
|
|
212
|
+
style: B,
|
|
210
213
|
href: $,
|
|
211
214
|
target: x,
|
|
212
215
|
rel: N,
|
|
213
216
|
htmlFor: S,
|
|
214
217
|
type: C,
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
name: A,
|
|
219
|
+
disabled: k,
|
|
220
|
+
...R,
|
|
217
221
|
children: r
|
|
218
222
|
}
|
|
219
223
|
);
|
|
220
224
|
};
|
|
221
|
-
|
|
222
|
-
const
|
|
225
|
+
_.displayName = "Box";
|
|
226
|
+
const X = ({
|
|
223
227
|
children: t,
|
|
224
228
|
as: i = "span",
|
|
225
229
|
weight: r = "regular",
|
|
226
230
|
align: e,
|
|
227
231
|
truncate: a = !1,
|
|
228
|
-
color:
|
|
229
|
-
className:
|
|
230
|
-
style:
|
|
231
|
-
href:
|
|
232
|
+
color: o,
|
|
233
|
+
className: c,
|
|
234
|
+
style: s,
|
|
235
|
+
href: p,
|
|
232
236
|
target: h,
|
|
233
|
-
rel:
|
|
234
|
-
htmlFor:
|
|
235
|
-
|
|
237
|
+
rel: l,
|
|
238
|
+
htmlFor: d,
|
|
239
|
+
name: m,
|
|
240
|
+
...f
|
|
236
241
|
}) => {
|
|
237
|
-
const
|
|
242
|
+
const g = (o == null ? void 0 : o.startsWith("#")) || (o == null ? void 0 : o.startsWith("rgb")) || (o == null ? void 0 : o.startsWith("hsl")), v = /* @__PURE__ */ new Set([
|
|
238
243
|
"danger",
|
|
239
244
|
"success",
|
|
240
245
|
"error",
|
|
@@ -246,67 +251,69 @@ const V = ({
|
|
|
246
251
|
"slate",
|
|
247
252
|
"blue",
|
|
248
253
|
"red"
|
|
249
|
-
]),
|
|
250
|
-
if (
|
|
251
|
-
return
|
|
252
|
-
})(),
|
|
253
|
-
...
|
|
254
|
+
]), y = (() => {
|
|
255
|
+
if (o)
|
|
256
|
+
return o === "inherit" ? "inherit" : g ? o : v.has(o) ? `var(--pittorica-${o}-9)` : o;
|
|
257
|
+
})(), b = {
|
|
258
|
+
...s,
|
|
254
259
|
textAlign: e,
|
|
255
|
-
color:
|
|
260
|
+
color: y
|
|
256
261
|
};
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
|
|
262
|
+
return /* @__PURE__ */ u(
|
|
263
|
+
_,
|
|
259
264
|
{
|
|
260
265
|
as: i,
|
|
261
|
-
className:
|
|
266
|
+
className: U(
|
|
262
267
|
"pittorica-text",
|
|
263
268
|
{ "pittorica-text--truncate": a },
|
|
264
|
-
|
|
269
|
+
c
|
|
265
270
|
),
|
|
266
271
|
"data-weight": r,
|
|
267
|
-
style:
|
|
268
|
-
href:
|
|
272
|
+
style: b,
|
|
273
|
+
href: p,
|
|
269
274
|
target: h,
|
|
270
|
-
rel:
|
|
271
|
-
htmlFor:
|
|
272
|
-
|
|
275
|
+
rel: l,
|
|
276
|
+
htmlFor: d,
|
|
277
|
+
name: m,
|
|
278
|
+
...f,
|
|
273
279
|
children: t
|
|
274
280
|
}
|
|
275
281
|
);
|
|
276
|
-
},
|
|
277
|
-
const t =
|
|
282
|
+
}, M = G(null), Y = () => {
|
|
283
|
+
const t = H(M);
|
|
278
284
|
if (!t)
|
|
279
285
|
throw new Error("Select components must be wrapped in <Select.Root />");
|
|
280
286
|
return t;
|
|
281
|
-
},
|
|
287
|
+
}, Z = ({
|
|
282
288
|
children: t,
|
|
283
289
|
label: i,
|
|
284
290
|
helperText: r,
|
|
285
291
|
error: e,
|
|
286
292
|
color: a = "indigo",
|
|
287
|
-
disabled:
|
|
293
|
+
disabled: o,
|
|
294
|
+
name: c,
|
|
288
295
|
size: s = "sm",
|
|
289
|
-
className:
|
|
290
|
-
style:
|
|
291
|
-
...
|
|
296
|
+
className: p,
|
|
297
|
+
style: h,
|
|
298
|
+
...l
|
|
292
299
|
}) => {
|
|
293
|
-
const
|
|
294
|
-
return /* @__PURE__ */
|
|
295
|
-
|
|
300
|
+
const d = W(), m = W(), g = a !== "inherit" && !(a != null && a.startsWith("#")) && !(a != null && a.startsWith("rgb")) ? `var(--pittorica-${a}-9)` : a;
|
|
301
|
+
return /* @__PURE__ */ u(M, { value: { inputId: d, helperId: m, disabled: o, size: s, name: c }, children: /* @__PURE__ */ L(
|
|
302
|
+
q,
|
|
296
303
|
{
|
|
297
|
-
...
|
|
298
|
-
className:
|
|
304
|
+
...l,
|
|
305
|
+
className: F(
|
|
299
306
|
"pittorica-select-root",
|
|
300
307
|
`pittorica-select--${s}`,
|
|
301
|
-
|
|
308
|
+
p
|
|
302
309
|
),
|
|
303
310
|
"data-error": e,
|
|
304
311
|
children: [
|
|
305
|
-
i && /* @__PURE__ */
|
|
306
|
-
|
|
312
|
+
i && /* @__PURE__ */ u(
|
|
313
|
+
X,
|
|
307
314
|
{
|
|
308
315
|
as: "label",
|
|
309
|
-
htmlFor:
|
|
316
|
+
htmlFor: d,
|
|
310
317
|
weight: "medium",
|
|
311
318
|
style: {
|
|
312
319
|
paddingLeft: "4px",
|
|
@@ -321,48 +328,49 @@ const V = ({
|
|
|
321
328
|
"div",
|
|
322
329
|
{
|
|
323
330
|
className: "pittorica-select-wrapper",
|
|
324
|
-
"data-disabled":
|
|
331
|
+
"data-disabled": o,
|
|
325
332
|
style: {
|
|
326
|
-
"--pittorica-source-color":
|
|
327
|
-
...
|
|
333
|
+
"--pittorica-source-color": g,
|
|
334
|
+
...h
|
|
328
335
|
},
|
|
329
336
|
children: [
|
|
330
337
|
t,
|
|
331
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ u("div", { className: "pittorica-select-chevron", children: /* @__PURE__ */ u(P, { size: s === "xs" ? 14 : 18 }) })
|
|
332
339
|
]
|
|
333
340
|
}
|
|
334
341
|
),
|
|
335
|
-
r && /* @__PURE__ */
|
|
342
|
+
r && /* @__PURE__ */ u("div", { id: m, className: "pittorica-select-helper", children: r })
|
|
336
343
|
]
|
|
337
344
|
}
|
|
338
345
|
) });
|
|
339
|
-
},
|
|
346
|
+
}, tt = ({
|
|
340
347
|
children: t,
|
|
341
348
|
className: i,
|
|
342
349
|
ref: r,
|
|
343
350
|
...e
|
|
344
351
|
}) => {
|
|
345
|
-
const { inputId: a, helperId:
|
|
346
|
-
return /* @__PURE__ */
|
|
352
|
+
const { inputId: a, helperId: o, disabled: c, name: s } = Y();
|
|
353
|
+
return /* @__PURE__ */ u(
|
|
347
354
|
"select",
|
|
348
355
|
{
|
|
356
|
+
name: s,
|
|
349
357
|
...e,
|
|
350
358
|
id: a,
|
|
351
359
|
ref: r,
|
|
352
|
-
disabled:
|
|
353
|
-
"aria-describedby":
|
|
354
|
-
className:
|
|
360
|
+
disabled: c,
|
|
361
|
+
"aria-describedby": o,
|
|
362
|
+
className: F("pittorica-select-input", i),
|
|
355
363
|
children: t
|
|
356
364
|
}
|
|
357
365
|
);
|
|
358
|
-
},
|
|
359
|
-
Root:
|
|
360
|
-
Content:
|
|
361
|
-
Slot:
|
|
366
|
+
}, et = ({ children: t, className: i, ...r }) => /* @__PURE__ */ u("div", { className: F("pittorica-select-slot", i), ...r, children: t }), at = {
|
|
367
|
+
Root: Z,
|
|
368
|
+
Content: tt,
|
|
369
|
+
Slot: et
|
|
362
370
|
};
|
|
363
371
|
export {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
372
|
+
at as Select,
|
|
373
|
+
tt as SelectContent,
|
|
374
|
+
Z as SelectRoot,
|
|
375
|
+
et as SelectSlot
|
|
368
376
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pittorica/select-react",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@tabler/icons-react": "^3.36.1",
|
|
13
13
|
"clsx": "^2.1.1",
|
|
14
|
-
"@pittorica/box-react": "0.23.
|
|
15
|
-
"@pittorica/text-react": "0.23.
|
|
14
|
+
"@pittorica/box-react": "0.23.2",
|
|
15
|
+
"@pittorica/text-react": "0.23.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"typescript": "^5.0.0",
|
|
25
25
|
"vite": "^5.0.0",
|
|
26
26
|
"vitest": "^2.1.9",
|
|
27
|
-
"@pittorica/flex-react": "0.23.
|
|
28
|
-
"@pittorica/theme-react": "0.23.
|
|
29
|
-
"pittorica": "0.23.
|
|
27
|
+
"@pittorica/flex-react": "0.23.2",
|
|
28
|
+
"@pittorica/theme-react": "0.23.2",
|
|
29
|
+
"pittorica": "0.23.2"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": ">=19",
|