@caseparts-org/caseblocks 0.0.262 → 0.0.264
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/Disclaimer.css +1 -1
- package/dist/atoms/Select/Select.d.ts +6 -1
- package/dist/atoms/Select/Select.js +50 -48
- package/dist/atoms/Select/Select.stories.d.ts +1 -0
- package/dist/atoms/Select/Select.stories.js +31 -12
- package/dist/main-client.d.ts +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/molecules/Disclaimer/Disclaimer.js +58 -58
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._disclaimer_1kiis_1{display:flex;justify-content:space-between;align-items:flex-start;gap:var(--spacing-spacing-2xs);width:100%;border:1px solid;border-radius:var(--border-radius-sm);padding:var(--spacing-spacing-2xs) var(--spacing-spacing-1xs)}._content_1kiis_12{display:flex;align-items:center;gap:var(--spacing-spacing-2xs);flex:1;min-width:0}._layout-stacked_1kiis_20 ._content_1kiis_12{display:grid;grid-template-columns:auto minmax(0,1fr);row-gap:var(--spacing-spacing-3xs)}._layout-stacked_1kiis_20 ._primary_1kiis_26,._layout-stacked_1kiis_20 ._subtext_1kiis_27{grid-column:2}._layout-stacked_1kiis_20 ._content_1kiis_12:has(._primary_1kiis_26):has(._subtext_1kiis_27) ._icon_1kiis_31{grid-row:span 2}._primary_1kiis_26{font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold)}._subtext_1kiis_27{font-size:var(--font-size-xs);white-space:pre-line}._cta_1kiis_45{flex:none}._background-neutral_1kiis_49{background-color:var(--color-neutrals-neutral-1)}._background-secondary_1kiis_53{background-color:var(--color-brand-secondary-lt-teal-blue)}._background-caution-tips_1kiis_57{background-color:var(--color-brand-secondary-lt-yellow)}._background-warning_1kiis_61{background-color:var(--color-brand-secondary-lt-orange)}._background-success_1kiis_65{background-color:var(--color-brand-secondary-lt-green)}._background-error-warning_1kiis_69{background-color:var(--color-brand-secondary-lt-red)}._border-neutral_1kiis_73{border-color:var(--color-neutrals-neutral-1)}._border-secondary_1kiis_77{border-color:var(--color-brand-secondary-lt-teal-blue)}._border-caution-tips_1kiis_81{border-color:var(--color-brand-secondary-lt-yellow)}._border-warning_1kiis_85{border-color:var(--color-brand-secondary-lt-orange)}._border-success_1kiis_89{border-color:var(--color-brand-secondary-lt-green)}._border-error-warning_1kiis_93{border-color:var(--color-brand-secondary-lt-red)}
|
|
@@ -4,10 +4,15 @@ export interface SelectOption {
|
|
|
4
4
|
value: string;
|
|
5
5
|
label: string;
|
|
6
6
|
}
|
|
7
|
+
export interface SelectOptionGroup {
|
|
8
|
+
label: string;
|
|
9
|
+
options: SelectOption[];
|
|
10
|
+
}
|
|
7
11
|
export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "children">, HideAtProps {
|
|
8
12
|
label: string | null;
|
|
9
13
|
placeholder?: string;
|
|
10
|
-
options
|
|
14
|
+
options?: SelectOption[];
|
|
15
|
+
groups?: SelectOptionGroup[];
|
|
11
16
|
error?: string | null;
|
|
12
17
|
}
|
|
13
18
|
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
@@ -1,79 +1,81 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as D, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import F, { useState as V } from "react";
|
|
3
3
|
import { c as f } from "../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { getHideAtStyles as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import '../../assets/Select.css';const
|
|
4
|
+
import { getHideAtStyles as j } from "../HideAt.js";
|
|
5
|
+
import { Icon as p } from "../Icon/Icon.js";
|
|
6
|
+
import '../../assets/Select.css';const I = "_select_kfi8n_1", L = "_icon_kfi8n_29", P = "_selectError_kfi8n_59", R = "_label_kfi8n_63", z = "_labelPlaceholder_kfi8n_78", A = "_labelDisabled_kfi8n_99", B = "_errorMessage_kfi8n_103", l = {
|
|
7
7
|
"select-container": "_select-container_kfi8n_1",
|
|
8
|
-
select:
|
|
9
|
-
icon:
|
|
10
|
-
selectError:
|
|
11
|
-
label:
|
|
12
|
-
labelPlaceholder:
|
|
13
|
-
labelDisabled:
|
|
14
|
-
errorMessage:
|
|
15
|
-
},
|
|
8
|
+
select: I,
|
|
9
|
+
icon: L,
|
|
10
|
+
selectError: P,
|
|
11
|
+
label: R,
|
|
12
|
+
labelPlaceholder: z,
|
|
13
|
+
labelDisabled: A,
|
|
14
|
+
errorMessage: B
|
|
15
|
+
}, C = F.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
label: s,
|
|
18
|
-
placeholder:
|
|
19
|
-
options:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
placeholder: c,
|
|
19
|
+
options: N = [],
|
|
20
|
+
groups: i,
|
|
21
|
+
value: v,
|
|
22
|
+
defaultValue: t,
|
|
23
|
+
hideAt: S,
|
|
24
|
+
className: x,
|
|
25
|
+
error: d,
|
|
25
26
|
onFocus: r,
|
|
26
|
-
onBlur:
|
|
27
|
-
...
|
|
28
|
-
},
|
|
29
|
-
const [
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
(s ||
|
|
27
|
+
onBlur: _,
|
|
28
|
+
...o
|
|
29
|
+
}, y) => {
|
|
30
|
+
const [w, h] = V(!1), E = !!o.disabled, n = v !== void 0, k = n ? String(v ?? "") : void 0, u = !n && t !== void 0 && t !== null ? String(t) : "", b = !!s && (w || (n ? k !== "" : u !== "")), M = !!c && !b, g = s ? "" : c ?? "";
|
|
31
|
+
return /* @__PURE__ */ D("div", { className: f(l["select-container"], j(S)), children: [
|
|
32
|
+
(s || M) && /* @__PURE__ */ a(
|
|
32
33
|
"label",
|
|
33
34
|
{
|
|
34
|
-
htmlFor:
|
|
35
|
+
htmlFor: o.name,
|
|
35
36
|
className: f(
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
b ? l.label : l.labelPlaceholder,
|
|
38
|
+
E ? l.labelDisabled : void 0
|
|
38
39
|
),
|
|
39
|
-
children:
|
|
40
|
+
children: b ? s : c ?? s
|
|
40
41
|
}
|
|
41
42
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ D(
|
|
43
44
|
"select",
|
|
44
45
|
{
|
|
45
|
-
...
|
|
46
|
-
ref:
|
|
47
|
-
id:
|
|
48
|
-
value:
|
|
49
|
-
defaultValue: n ? void 0 :
|
|
50
|
-
className: f(
|
|
51
|
-
onFocus: (
|
|
52
|
-
|
|
46
|
+
...o,
|
|
47
|
+
ref: y,
|
|
48
|
+
id: o.name,
|
|
49
|
+
value: k,
|
|
50
|
+
defaultValue: n ? void 0 : u,
|
|
51
|
+
className: f(l.select, d ? l.selectError : void 0, x),
|
|
52
|
+
onFocus: (e) => {
|
|
53
|
+
h(!0), r == null || r(e);
|
|
53
54
|
},
|
|
54
|
-
onBlur: (
|
|
55
|
-
|
|
55
|
+
onBlur: (e) => {
|
|
56
|
+
h(!1), _ == null || _(e);
|
|
56
57
|
},
|
|
57
58
|
children: [
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
c ? /* @__PURE__ */ a("option", { value: "", disabled: !0, hidden: !!s, children: g }) : null,
|
|
60
|
+
N.map((e) => /* @__PURE__ */ a("option", { value: e.value, children: e.label }, e.value)),
|
|
61
|
+
i == null ? void 0 : i.map((e) => /* @__PURE__ */ a("optgroup", { label: e.label, children: e.options.map((m) => /* @__PURE__ */ a("option", { value: m.value, children: m.label }, m.value)) }, e.label))
|
|
60
62
|
]
|
|
61
63
|
}
|
|
62
64
|
),
|
|
63
65
|
/* @__PURE__ */ a(
|
|
64
|
-
|
|
66
|
+
p,
|
|
65
67
|
{
|
|
66
|
-
className:
|
|
68
|
+
className: l.icon,
|
|
67
69
|
iconKey: "fa-solid fa-chevron-down",
|
|
68
70
|
size: "3xs",
|
|
69
71
|
colorToken: "secondary"
|
|
70
72
|
}
|
|
71
73
|
),
|
|
72
|
-
|
|
74
|
+
d ? /* @__PURE__ */ a("div", { className: l.errorMessage, children: d }) : null
|
|
73
75
|
] });
|
|
74
76
|
}
|
|
75
77
|
);
|
|
76
|
-
|
|
78
|
+
C.displayName = "Select";
|
|
77
79
|
export {
|
|
78
|
-
|
|
80
|
+
C as Select
|
|
79
81
|
};
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as s } from "react";
|
|
3
3
|
import { Select as n } from "./Select.js";
|
|
4
|
-
const
|
|
4
|
+
const o = [
|
|
5
5
|
{ value: "US", label: "United States" },
|
|
6
6
|
{ value: "CA", label: "Canada" },
|
|
7
7
|
{ value: "MX", label: "Mexico" }
|
|
8
|
+
], c = [
|
|
9
|
+
{
|
|
10
|
+
label: "North America",
|
|
11
|
+
options: o
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: "Europe",
|
|
15
|
+
options: [
|
|
16
|
+
{ value: "DE", label: "Germany" },
|
|
17
|
+
{ value: "GB", label: "United Kingdom" }
|
|
18
|
+
]
|
|
19
|
+
}
|
|
8
20
|
], S = {
|
|
9
21
|
title: "Case Parts/Atoms/Select",
|
|
10
22
|
component: n,
|
|
@@ -12,34 +24,40 @@ const i = [
|
|
|
12
24
|
name: "country",
|
|
13
25
|
label: "Country",
|
|
14
26
|
placeholder: "Select country",
|
|
15
|
-
options:
|
|
27
|
+
options: o
|
|
16
28
|
},
|
|
17
29
|
parameters: {
|
|
18
30
|
layout: "centered"
|
|
19
31
|
}
|
|
20
32
|
};
|
|
21
33
|
function a(e) {
|
|
22
|
-
const [
|
|
34
|
+
const [u, i] = s(String(e.value ?? ""));
|
|
23
35
|
return /* @__PURE__ */ t("div", { style: { width: 320 }, children: /* @__PURE__ */ t(
|
|
24
36
|
n,
|
|
25
37
|
{
|
|
26
38
|
...e,
|
|
27
|
-
value:
|
|
39
|
+
value: u,
|
|
28
40
|
onChange: (r) => {
|
|
29
41
|
var l;
|
|
30
|
-
|
|
42
|
+
i(r.target.value), (l = e.onChange) == null || l.call(e, r);
|
|
31
43
|
}
|
|
32
44
|
}
|
|
33
45
|
) });
|
|
34
46
|
}
|
|
35
|
-
const
|
|
47
|
+
const g = {
|
|
36
48
|
render: (e) => /* @__PURE__ */ t(a, { ...e })
|
|
37
|
-
},
|
|
49
|
+
}, b = {
|
|
38
50
|
args: {
|
|
39
51
|
value: "US"
|
|
40
52
|
},
|
|
41
53
|
render: (e) => /* @__PURE__ */ t(a, { ...e })
|
|
42
|
-
},
|
|
54
|
+
}, h = {
|
|
55
|
+
args: {
|
|
56
|
+
options: void 0,
|
|
57
|
+
groups: c
|
|
58
|
+
},
|
|
59
|
+
render: (e) => /* @__PURE__ */ t(a, { ...e })
|
|
60
|
+
}, y = {
|
|
43
61
|
args: {
|
|
44
62
|
value: "",
|
|
45
63
|
error: "Country is required"
|
|
@@ -47,8 +65,9 @@ const v = {
|
|
|
47
65
|
render: (e) => /* @__PURE__ */ t(a, { ...e })
|
|
48
66
|
};
|
|
49
67
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
68
|
+
g as Default,
|
|
69
|
+
y as ErrorState,
|
|
70
|
+
h as WithOptionGroups,
|
|
71
|
+
b as WithSelectedValue,
|
|
53
72
|
S as default
|
|
54
73
|
};
|
package/dist/main-client.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type { InputProps } from './atoms/Input/Input';
|
|
|
10
10
|
export { InputEndAdornmentButton } from './atoms/InputEndAdornmentButton/InputEndAdornmentButton';
|
|
11
11
|
export type { InputEndAdornmentButtonProps } from './atoms/InputEndAdornmentButton/InputEndAdornmentButton';
|
|
12
12
|
export { Select } from './atoms/Select/Select';
|
|
13
|
-
export type { SelectProps, SelectOption } from './atoms/Select/Select';
|
|
13
|
+
export type { SelectProps, SelectOption, SelectOptionGroup } from './atoms/Select/Select';
|
|
14
14
|
export { Tooltip } from './atoms/Tooltip/Tooltip';
|
|
15
15
|
export { Popover } from './atoms/Popover/Popover';
|
|
16
16
|
export type { PopoverProps } from './atoms/Popover/Popover';
|
package/dist/main.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type { InputProps } from './atoms/Input/Input';
|
|
|
16
16
|
export { InputEndAdornmentButton } from './atoms/InputEndAdornmentButton/InputEndAdornmentButton';
|
|
17
17
|
export type { InputEndAdornmentButtonProps } from './atoms/InputEndAdornmentButton/InputEndAdornmentButton';
|
|
18
18
|
export { Select } from './atoms/Select/Select';
|
|
19
|
-
export type { SelectProps } from './atoms/Select/Select';
|
|
19
|
+
export type { SelectProps, SelectOption, SelectOptionGroup } from './atoms/Select/Select';
|
|
20
20
|
export { Account } from './molecules/Account/Account';
|
|
21
21
|
export type { AccountProps } from './molecules/Account/Account';
|
|
22
22
|
export { Avatar } from './molecules/Avatar/Avatar';
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { getHideAtStyles as
|
|
5
|
-
import '../../assets/Disclaimer.css';const
|
|
6
|
-
disclaimer:
|
|
7
|
-
content:
|
|
8
|
-
"layout-stacked": "_layout-
|
|
9
|
-
primary:
|
|
10
|
-
subtext:
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { Icon as d } from "../../atoms/Icon/Icon.js";
|
|
4
|
+
import { getHideAtStyles as e } from "../../atoms/HideAt.js";
|
|
5
|
+
import '../../assets/Disclaimer.css';const l = "_disclaimer_1kiis_1", k = "_content_1kiis_12", b = "_primary_1kiis_26", m = "_subtext_1kiis_27", g = "_icon_1kiis_31", f = "_cta_1kiis_45", o = {
|
|
6
|
+
disclaimer: l,
|
|
7
|
+
content: k,
|
|
8
|
+
"layout-stacked": "_layout-stacked_1kiis_20",
|
|
9
|
+
primary: b,
|
|
10
|
+
subtext: m,
|
|
11
11
|
icon: g,
|
|
12
12
|
cta: f,
|
|
13
|
-
"background-neutral": "_background-
|
|
14
|
-
"background-secondary": "_background-
|
|
15
|
-
"background-caution-tips": "_background-caution-
|
|
16
|
-
"background-warning": "_background-
|
|
17
|
-
"background-success": "_background-
|
|
18
|
-
"background-error-warning": "_background-error-
|
|
19
|
-
"border-neutral": "_border-
|
|
20
|
-
"border-secondary": "_border-
|
|
21
|
-
"border-caution-tips": "_border-caution-
|
|
22
|
-
"border-warning": "_border-
|
|
23
|
-
"border-success": "_border-
|
|
24
|
-
"border-error-warning": "_border-error-
|
|
25
|
-
},
|
|
13
|
+
"background-neutral": "_background-neutral_1kiis_49",
|
|
14
|
+
"background-secondary": "_background-secondary_1kiis_53",
|
|
15
|
+
"background-caution-tips": "_background-caution-tips_1kiis_57",
|
|
16
|
+
"background-warning": "_background-warning_1kiis_61",
|
|
17
|
+
"background-success": "_background-success_1kiis_65",
|
|
18
|
+
"background-error-warning": "_background-error-warning_1kiis_69",
|
|
19
|
+
"border-neutral": "_border-neutral_1kiis_73",
|
|
20
|
+
"border-secondary": "_border-secondary_1kiis_77",
|
|
21
|
+
"border-caution-tips": "_border-caution-tips_1kiis_81",
|
|
22
|
+
"border-warning": "_border-warning_1kiis_85",
|
|
23
|
+
"border-success": "_border-success_1kiis_89",
|
|
24
|
+
"border-error-warning": "_border-error-warning_1kiis_93"
|
|
25
|
+
}, y = {
|
|
26
26
|
info: "fa-solid fa-circle-info",
|
|
27
27
|
question: "fa-solid fa-circle-question",
|
|
28
28
|
warning: "fa-solid fa-triangle-exclamation",
|
|
29
29
|
security: "fa-solid fa-shield",
|
|
30
30
|
lock: "fa-solid fa-lock"
|
|
31
31
|
};
|
|
32
|
-
function
|
|
33
|
-
backgroundColorToken:
|
|
34
|
-
borderColorToken:
|
|
35
|
-
layout:
|
|
36
|
-
hideAt:
|
|
37
|
-
className:
|
|
38
|
-
children:
|
|
39
|
-
...
|
|
32
|
+
function p({
|
|
33
|
+
backgroundColorToken: i = "neutral",
|
|
34
|
+
borderColorToken: r = "neutral",
|
|
35
|
+
layout: n = "stacked",
|
|
36
|
+
hideAt: s,
|
|
37
|
+
className: t,
|
|
38
|
+
children: _,
|
|
39
|
+
...u
|
|
40
40
|
}) {
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ a(
|
|
42
42
|
"aside",
|
|
43
43
|
{
|
|
44
|
-
...
|
|
45
|
-
className:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
...u,
|
|
45
|
+
className: c(
|
|
46
|
+
o.disclaimer,
|
|
47
|
+
o[`background-${i}`],
|
|
48
|
+
o[`border-${r}`],
|
|
49
|
+
o[`layout-${n}`],
|
|
50
|
+
e(s),
|
|
51
|
+
t
|
|
52
52
|
),
|
|
53
53
|
role: "note",
|
|
54
|
-
children:
|
|
54
|
+
children: _
|
|
55
55
|
}
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return /* @__PURE__ */
|
|
58
|
+
function x({ hideAt: i, className: r, children: n, ...s }) {
|
|
59
|
+
return /* @__PURE__ */ a("div", { ...s, className: c(o.content, e(i), r), children: n });
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return /* @__PURE__ */
|
|
61
|
+
function w({ icon: i = "info", iconKey: r, className: n, ...s }) {
|
|
62
|
+
return /* @__PURE__ */ a(d, { ...s, iconKey: r ?? y[i], className: c(o.icon, n) });
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
return /* @__PURE__ */
|
|
64
|
+
function D({ hideAt: i, className: r, children: n, ...s }) {
|
|
65
|
+
return /* @__PURE__ */ a("span", { ...s, className: c(o.primary, e(i), r), children: n });
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return /* @__PURE__ */
|
|
67
|
+
function N({ hideAt: i, className: r, children: n, ...s }) {
|
|
68
|
+
return /* @__PURE__ */ a("span", { ...s, className: c(o.subtext, e(i), r), children: n });
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return /* @__PURE__ */
|
|
70
|
+
function C({ hideAt: i, className: r, children: n, ...s }) {
|
|
71
|
+
return /* @__PURE__ */ a("div", { ...s, className: c(o.cta, e(i), r), children: n });
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
Content:
|
|
75
|
-
Icon:
|
|
76
|
-
Primary:
|
|
77
|
-
Subtext:
|
|
78
|
-
CTA:
|
|
73
|
+
const j = Object.assign(p, {
|
|
74
|
+
Content: x,
|
|
75
|
+
Icon: w,
|
|
76
|
+
Primary: D,
|
|
77
|
+
Subtext: N,
|
|
78
|
+
CTA: C
|
|
79
79
|
});
|
|
80
80
|
export {
|
|
81
|
-
|
|
81
|
+
j as Disclaimer
|
|
82
82
|
};
|