@caseparts-org/caseblocks 0.0.282 → 0.0.284
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 +79 -64
- package/package.json +1 -1
package/dist/assets/Select.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._select-
|
|
1
|
+
._select-container_1tktj_1{display:flex;position:relative;flex-direction:column;align-items:flex-start;width:100%;box-sizing:border-box}._selectControl_1tktj_10{position:relative;width:100%}._select_1tktj_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_1tktj_1{font-size:var(--font-size-md)}}._icon_1tktj_34{position:absolute;top:50%;right:var(--spacing-spacing-default);pointer-events:none;transform:translateY(-50%)}._select_1tktj_1:hover:not(:disabled){border:1px solid var(--border-border-primary-btn, #1380b1)}._select_1tktj_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_1tktj_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_1tktj_1:disabled:hover,._select_1tktj_1:disabled:focus{border:1px solid var(--border-border-primary, #dfdfdf);box-shadow:none}._selectError_1tktj_64{border-color:var(--text-text-error-warning, #d40000)}._label_1tktj_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_1tktj_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_1tktj_104{color:var(--text-text-disabled, #b2b2b2)}._errorMessage_1tktj_108{display:flex;align-items:center;gap:var(--spacing-spacing-3xs);width:100%;margin-top:4px;font-size:var(--font-size-xs, .75rem);color:var(--text-text-error-warning, #d40000)}
|
|
@@ -1,81 +1,96 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { c as
|
|
4
|
-
import { getHideAtStyles as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import '../../assets/Select.css';const
|
|
7
|
-
"select-container": "_select-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import M, { useState as F } from "react";
|
|
3
|
+
import { c as h } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { getHideAtStyles as P } from "../HideAt.js";
|
|
5
|
+
import { Icon as x } from "../Icon/Icon.js";
|
|
6
|
+
import '../../assets/Select.css';const V = "_selectControl_1tktj_10", p = "_select_1tktj_1", z = "_icon_1tktj_34", I = "_selectError_1tktj_64", K = "_label_1tktj_68", L = "_labelPlaceholder_1tktj_83", R = "_labelDisabled_1tktj_104", T = "_errorMessage_1tktj_108", l = {
|
|
7
|
+
"select-container": "_select-container_1tktj_1",
|
|
8
|
+
selectControl: V,
|
|
9
|
+
select: p,
|
|
10
|
+
icon: z,
|
|
11
|
+
selectError: I,
|
|
12
|
+
label: K,
|
|
13
|
+
labelPlaceholder: L,
|
|
14
|
+
labelDisabled: R,
|
|
15
|
+
errorMessage: T
|
|
16
|
+
}, A = M.forwardRef(
|
|
16
17
|
({
|
|
17
|
-
label:
|
|
18
|
-
placeholder:
|
|
18
|
+
label: a,
|
|
19
|
+
placeholder: s,
|
|
19
20
|
options: N = [],
|
|
20
21
|
groups: i,
|
|
21
|
-
value:
|
|
22
|
-
defaultValue:
|
|
23
|
-
hideAt:
|
|
24
|
-
className:
|
|
22
|
+
value: f,
|
|
23
|
+
defaultValue: r,
|
|
24
|
+
hideAt: y,
|
|
25
|
+
className: D,
|
|
25
26
|
error: d,
|
|
26
|
-
onFocus:
|
|
27
|
-
onBlur:
|
|
27
|
+
onFocus: _,
|
|
28
|
+
onBlur: m,
|
|
28
29
|
...o
|
|
29
|
-
},
|
|
30
|
-
const [
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
(
|
|
30
|
+
}, S) => {
|
|
31
|
+
const [g, j] = F(!1), w = !!o.disabled, c = f !== void 0, k = c ? String(f ?? "") : void 0, u = !c && r !== void 0 && r !== null ? String(r) : "", b = !!a && (g || (c ? k !== "" : u !== "")), C = !!s && !b, E = a ? "" : s ?? "";
|
|
32
|
+
return /* @__PURE__ */ n("div", { className: h(l["select-container"], P(y)), children: [
|
|
33
|
+
(a || C) && /* @__PURE__ */ t(
|
|
33
34
|
"label",
|
|
34
35
|
{
|
|
35
36
|
htmlFor: o.name,
|
|
36
|
-
className:
|
|
37
|
+
className: h(
|
|
37
38
|
b ? l.label : l.labelPlaceholder,
|
|
38
|
-
|
|
39
|
+
w ? l.labelDisabled : void 0
|
|
39
40
|
),
|
|
40
|
-
children: b ?
|
|
41
|
+
children: b ? a : s ?? 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__ */ n("div", { className: l.selectControl, children: [
|
|
45
|
+
/* @__PURE__ */ n(
|
|
46
|
+
"select",
|
|
47
|
+
{
|
|
48
|
+
...o,
|
|
49
|
+
ref: S,
|
|
50
|
+
id: o.name,
|
|
51
|
+
value: k,
|
|
52
|
+
defaultValue: c ? void 0 : u,
|
|
53
|
+
className: h(l.select, d ? l.selectError : void 0, D),
|
|
54
|
+
onFocus: (e) => {
|
|
55
|
+
j(!0), _ == null || _(e);
|
|
56
|
+
},
|
|
57
|
+
onBlur: (e) => {
|
|
58
|
+
j(!1), m == null || m(e);
|
|
59
|
+
},
|
|
60
|
+
children: [
|
|
61
|
+
s ? /* @__PURE__ */ t("option", { value: "", disabled: !0, hidden: !!a, children: E }) : null,
|
|
62
|
+
N.map((e) => /* @__PURE__ */ t("option", { value: e.value, children: e.label }, e.value)),
|
|
63
|
+
i == null ? void 0 : i.map((e) => /* @__PURE__ */ t("optgroup", { label: e.label, children: e.options.map((v) => /* @__PURE__ */ t("option", { value: v.value, children: v.label }, v.value)) }, e.label))
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ t(
|
|
68
|
+
x,
|
|
69
|
+
{
|
|
70
|
+
className: l.icon,
|
|
71
|
+
iconKey: "fa-solid fa-chevron-down",
|
|
72
|
+
size: "3xs",
|
|
73
|
+
colorToken: "secondary"
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }),
|
|
77
|
+
d ? /* @__PURE__ */ n("div", { className: l.errorMessage, children: [
|
|
78
|
+
/* @__PURE__ */ t(
|
|
79
|
+
x,
|
|
80
|
+
{
|
|
81
|
+
"aria-hidden": "true",
|
|
82
|
+
iconKey: "fa-solid fa-circle-exclamation",
|
|
83
|
+
size: "xs",
|
|
84
|
+
colorToken: "error-warning",
|
|
85
|
+
noPadding: !0
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
d
|
|
89
|
+
] }) : null
|
|
75
90
|
] });
|
|
76
91
|
}
|
|
77
92
|
);
|
|
78
|
-
|
|
93
|
+
A.displayName = "Select";
|
|
79
94
|
export {
|
|
80
|
-
|
|
95
|
+
A as Select
|
|
81
96
|
};
|