@caseparts-org/caseblocks 0.0.282 → 0.0.283
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/assets/Select.css +1 -1
- package/dist/atoms/Select/Select.js +62 -59
- package/package.json +1 -1
package/dist/assets/Select.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._select-
|
|
1
|
+
._select-container_4wf31_1{display:flex;position:relative;flex-direction:column;align-items:flex-start;width:100%;box-sizing:border-box}._selectControl_4wf31_10{position:relative;width:100%}._select_4wf31_1{height:32px;min-height:32px;width:100%;box-sizing:border-box;border:1px solid var(--border-border-primary, #dfdfdf);border-radius:var(--radius-radius-sm, .25rem);background:var(--surface-surface-primary);color:var(--text-text-primary, #272727);font-size:var(--font-size-sm, .875rem);padding:0 var(--spacing-spacing-2xl, 32px) 0 var(--spacing-spacing-1xs, 12px);outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}@media (max-width: 767px){._select_4wf31_1{font-size:var(--font-size-md)}}._icon_4wf31_34{position:absolute;top:50%;right:var(--spacing-spacing-default);pointer-events:none;transform:translateY(-50%)}._select_4wf31_1:hover:not(:disabled){border:1px solid var(--border-border-primary-btn, #1380b1)}._select_4wf31_1:focus:not(:disabled){border:1px solid var(--border-border-primary-btn, #1380b1);box-shadow:0 0 2px 1px var(--border-border-primary-btn, #1380b1)}._select_4wf31_1:disabled{border:1px solid var(--border-border-primary, #dfdfdf);background-color:var(--surface-surface-secondary, #f6f6f6);color:var(--text-text-disabled, #b2b2b2);cursor:not-allowed}._select_4wf31_1:disabled:hover,._select_4wf31_1:disabled:focus{border:1px solid var(--border-border-primary, #dfdfdf);box-shadow:none}._selectError_4wf31_64{border-color:var(--text-text-error-warning, #d40000)}._label_4wf31_68{position:absolute;align-self:flex-start;left:8px;top:-8px;z-index:1;padding:0 8px;cursor:text;transition:all .2s ease-in;font-family:var(--font-family-label);font-size:var(--font-size-xxs);color:var(--text-text-quaternary);background-color:var(--surface-surface-primary)}._labelPlaceholder_4wf31_83{position:absolute;align-self:flex-start;box-sizing:border-box;max-width:calc(100% - 24px);z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:italic;font-family:var(--font-family-label);font-size:var(--font-size-sm);background-color:transparent;color:var(--text-text-quaternary);left:12px;top:8px;padding:0 2px;pointer-events:none;transition:all .2s ease-in}._labelDisabled_4wf31_104{color:var(--text-text-disabled, #b2b2b2)}._errorMessage_4wf31_108{width:100%;margin-top:4px;font-size:var(--font-size-xs, .75rem);color:var(--text-text-error-warning, #d40000)}
|
|
@@ -1,81 +1,84 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import F, { useState as V } from "react";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as v } from "../../clsx-OuTLNxxd.js";
|
|
4
4
|
import { getHideAtStyles as j } from "../HideAt.js";
|
|
5
5
|
import { Icon as p } from "../Icon/Icon.js";
|
|
6
|
-
import '../../assets/Select.css';const I = "
|
|
7
|
-
"select-container": "_select-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import '../../assets/Select.css';const I = "_selectControl_4wf31_10", L = "_select_4wf31_1", P = "_icon_4wf31_34", R = "_selectError_4wf31_64", k = "_label_4wf31_68", z = "_labelPlaceholder_4wf31_83", A = "_labelDisabled_4wf31_104", B = "_errorMessage_4wf31_108", l = {
|
|
7
|
+
"select-container": "_select-container_4wf31_1",
|
|
8
|
+
selectControl: I,
|
|
9
|
+
select: L,
|
|
10
|
+
icon: P,
|
|
11
|
+
selectError: R,
|
|
12
|
+
label: k,
|
|
12
13
|
labelPlaceholder: z,
|
|
13
14
|
labelDisabled: A,
|
|
14
15
|
errorMessage: B
|
|
15
|
-
},
|
|
16
|
+
}, H = F.forwardRef(
|
|
16
17
|
({
|
|
17
|
-
label:
|
|
18
|
-
placeholder:
|
|
19
|
-
options:
|
|
20
|
-
groups:
|
|
21
|
-
value:
|
|
22
|
-
defaultValue:
|
|
18
|
+
label: a,
|
|
19
|
+
placeholder: o,
|
|
20
|
+
options: D = [],
|
|
21
|
+
groups: n,
|
|
22
|
+
value: h,
|
|
23
|
+
defaultValue: i,
|
|
23
24
|
hideAt: S,
|
|
24
25
|
className: x,
|
|
25
|
-
error:
|
|
26
|
-
onFocus:
|
|
26
|
+
error: r,
|
|
27
|
+
onFocus: d,
|
|
27
28
|
onBlur: _,
|
|
28
|
-
...
|
|
29
|
+
...c
|
|
29
30
|
}, y) => {
|
|
30
|
-
const [
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
(
|
|
31
|
+
const [C, w] = V(!1), E = !!c.disabled, t = h !== void 0, u = t ? String(h ?? "") : void 0, N = !t && i !== void 0 && i !== null ? String(i) : "", m = !!a && (C || (t ? u !== "" : N !== "")), M = !!o && !m, g = a ? "" : o ?? "";
|
|
32
|
+
return /* @__PURE__ */ f("div", { className: v(l["select-container"], j(S)), children: [
|
|
33
|
+
(a || M) && /* @__PURE__ */ s(
|
|
33
34
|
"label",
|
|
34
35
|
{
|
|
35
|
-
htmlFor:
|
|
36
|
-
className:
|
|
37
|
-
|
|
36
|
+
htmlFor: c.name,
|
|
37
|
+
className: v(
|
|
38
|
+
m ? l.label : l.labelPlaceholder,
|
|
38
39
|
E ? l.labelDisabled : void 0
|
|
39
40
|
),
|
|
40
|
-
children:
|
|
41
|
+
children: m ? a : o ?? a
|
|
41
42
|
}
|
|
42
43
|
),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
44
|
+
/* @__PURE__ */ f("div", { className: l.selectControl, children: [
|
|
45
|
+
/* @__PURE__ */ f(
|
|
46
|
+
"select",
|
|
47
|
+
{
|
|
48
|
+
...c,
|
|
49
|
+
ref: y,
|
|
50
|
+
id: c.name,
|
|
51
|
+
value: u,
|
|
52
|
+
defaultValue: t ? void 0 : N,
|
|
53
|
+
className: v(l.select, r ? l.selectError : void 0, x),
|
|
54
|
+
onFocus: (e) => {
|
|
55
|
+
w(!0), d == null || d(e);
|
|
56
|
+
},
|
|
57
|
+
onBlur: (e) => {
|
|
58
|
+
w(!1), _ == null || _(e);
|
|
59
|
+
},
|
|
60
|
+
children: [
|
|
61
|
+
o ? /* @__PURE__ */ s("option", { value: "", disabled: !0, hidden: !!a, children: g }) : null,
|
|
62
|
+
D.map((e) => /* @__PURE__ */ s("option", { value: e.value, children: e.label }, e.value)),
|
|
63
|
+
n == null ? void 0 : n.map((e) => /* @__PURE__ */ s("optgroup", { label: e.label, children: e.options.map((b) => /* @__PURE__ */ s("option", { value: b.value, children: b.label }, b.value)) }, e.label))
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ s(
|
|
68
|
+
p,
|
|
69
|
+
{
|
|
70
|
+
className: l.icon,
|
|
71
|
+
iconKey: "fa-solid fa-chevron-down",
|
|
72
|
+
size: "3xs",
|
|
73
|
+
colorToken: "secondary"
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }),
|
|
77
|
+
r ? /* @__PURE__ */ s("div", { className: l.errorMessage, children: r }) : null
|
|
75
78
|
] });
|
|
76
79
|
}
|
|
77
80
|
);
|
|
78
|
-
|
|
81
|
+
H.displayName = "Select";
|
|
79
82
|
export {
|
|
80
|
-
|
|
83
|
+
H as Select
|
|
81
84
|
};
|