@pismo/marola 0.0.1-alpha.15 → 0.0.1-alpha.16
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/SelectButton-DWZ2BRaX.js +44 -0
- package/dist/assets/InputSearch.css +1 -1
- package/dist/assets/SelectButton.css +1 -1
- package/dist/components/InputSearch/InputSearch.js +7 -7
- package/dist/components/Select/Select.d.ts +9 -8
- package/dist/components/Select/Select.js +153 -155
- package/dist/components/Select/Select.stories.d.ts +10 -19
- package/dist/components/Select/Select.stories.js +72 -48
- package/dist/components/Select/SelectButton.d.ts +3 -4
- package/dist/components/Select/SelectButton.js +2 -2
- package/dist/main.js +13 -13
- package/package.json +1 -1
- package/dist/SelectButton-DWtqAiwt.js +0 -45
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import './assets/SelectButton.css';
|
|
2
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import * as o from "react";
|
|
4
|
+
import { forwardRef as d } from "react";
|
|
5
|
+
import { c as m } from "./clsx-DB4S2d7J.js";
|
|
6
|
+
import { Typography as i } from "./components/Typography/Typography.js";
|
|
7
|
+
const u = "_select_193rj_1", h = "_select__listbox_193rj_4", w = "_select__listbox__option_193rj_14", C = "_select__listbox__option__icon_193rj_22", j = "_select__listbox__option__text_193rj_26", v = "_select__list__option__icon_193rj_46", _ = {
|
|
8
|
+
select: u,
|
|
9
|
+
select__listbox: h,
|
|
10
|
+
select__listbox__option: w,
|
|
11
|
+
select__listbox__option__icon: C,
|
|
12
|
+
select__listbox__option__text: j,
|
|
13
|
+
"select__listbox__option--disabled": "_select__listbox__option--disabled_193rj_29",
|
|
14
|
+
"select__listbox__option--selected": "_select__listbox__option--selected_193rj_38",
|
|
15
|
+
select__list__option__icon: v,
|
|
16
|
+
"select-button": "_select-button_193rj_51",
|
|
17
|
+
"select-button__text": "_select-button__text_193rj_66",
|
|
18
|
+
"select-button__icon": "_select-button__icon_193rj_75",
|
|
19
|
+
"select-button--active": "_select-button--active_193rj_81"
|
|
20
|
+
}, f = (t) => /* @__PURE__ */ o.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ o.createElement("path", { d: "M2.11104 4.9999C2.36691 4.9999 2.62291 5.09756 2.81791 5.29287L8.11104 10.5843L13.4048 5.29053C13.7954 4.8999 14.4282 4.8999 14.8188 5.29053C15.2095 5.68115 15.2095 6.31396 14.8188 6.70459L8.81885 12.7046C8.42822 13.0952 7.79541 13.0952 7.40479 12.7046L1.40479 6.70459C1.01416 6.31396 1.01416 5.68115 1.40479 5.29053C1.59854 5.09678 1.85479 4.9999 2.11104 4.9999Z", fill: "currentColor" })), g = (t) => /* @__PURE__ */ o.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ o.createElement("path", { d: "M13.8889 11C13.633 11 13.377 10.9023 13.182 10.707L7.8889 5.41563L2.59515 10.7094C2.20453 11.1 1.57172 11.1 1.18109 10.7094C0.790466 10.3188 0.790466 9.68594 1.18109 9.29532L7.18109 3.29532C7.57172 2.90469 8.20453 2.90469 8.59515 3.29532L14.5952 9.29532C14.9858 9.68594 14.9858 10.3188 14.5952 10.7094C14.4014 10.9031 14.1452 11 13.8889 11Z", fill: "#3F3D4B", fillOpacity: 0.88 })), N = d((t, n) => {
|
|
21
|
+
const { children: r, disabled: a, className: b, "data-testid": p, prefix: s, onClick: x } = t, l = t["aria-expanded"];
|
|
22
|
+
return /* @__PURE__ */ c(
|
|
23
|
+
"button",
|
|
24
|
+
{
|
|
25
|
+
className: m(b, l ? _["select-button--active"] : "", _["select-button"]),
|
|
26
|
+
type: "button",
|
|
27
|
+
onClick: x,
|
|
28
|
+
disabled: a,
|
|
29
|
+
"data-testid": p,
|
|
30
|
+
ref: n,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ c("span", { className: _["select-button__text"], children: [
|
|
33
|
+
s && /* @__PURE__ */ e(i, { element: "span", variant: "body-small", children: s }),
|
|
34
|
+
/* @__PURE__ */ e(i, { element: "span", variant: "body-small", children: r })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ e("span", { className: _["select-button__icon"], children: l ? /* @__PURE__ */ e(g, {}) : /* @__PURE__ */ e(f, {}) })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
N as S,
|
|
43
|
+
_ as s
|
|
44
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._inputSearch_114e1_1 input[type=search]::-webkit-search-cancel-button{width:1rem;height:1rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;pointer-events:none;background:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3694_1860)'%3e%3cpath%20d='M7.97207%206.94064L9.46895%205.46876C9.7627%205.17814%2010.2377%205.17814%2010.5033%205.46876C10.8221%205.76251%2010.8221%206.23751%2010.5033%206.50314L9.05957%207.97189L10.5033%209.46876C10.8221%209.76251%2010.8221%2010.2375%2010.5033%2010.5031C10.2377%2010.8219%209.7627%2010.8219%209.46895%2010.5031L7.97207%209.05939L6.50332%2010.5031C6.2377%2010.8219%205.7627%2010.8219%205.46895%2010.5031C5.17832%2010.2375%205.17832%209.76251%205.46895%209.46876L6.94082%207.97189L5.46895%206.50314C5.17832%206.23751%205.17832%205.76251%205.46895%205.46876C5.7627%205.17814%206.2377%205.17814%206.50332%205.46876L7.97207%206.94064Z'%20fill='%23838192'/%3e%3cpath%20opacity='0.4'%20d='M0%208C0%203.58125%203.58125%200%208%200C12.4187%200%2016%203.58125%2016%208C16%2012.4187%2012.4187%2016%208%2016C3.58125%2016%200%2012.4187%200%208ZM5.46875%206.50313L6.94063%207.97188L5.46875%209.46875C5.17812%209.7625%205.17812%2010.2375%205.46875%2010.5031C5.7625%2010.8219%206.2375%2010.8219%206.50313%2010.5031L7.97188%209.05937L9.46875%2010.5031C9.7625%2010.8219%2010.2375%2010.8219%2010.5031%2010.5031C10.8219%2010.2375%2010.8219%209.7625%2010.5031%209.46875L9.05937%207.97188L10.5031%206.50313C10.8219%206.2375%2010.8219%205.7625%2010.5031%205.46875C10.2375%205.17812%209.7625%205.17812%209.46875%205.46875L7.97188%206.94063L6.50313%205.46875C6.2375%205.17812%205.7625%205.17812%205.46875%205.46875C5.17812%205.7625%205.17812%206.2375%205.46875%206.50313Z'%20fill='%23838192'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3694_1860'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e") no-repeat 50% 50%;background-size:contain;border-radius:50%;opacity:0}._inputSearch_114e1_1 input[type=search]:focus::-webkit-search-cancel-button{margin-left:1rem;pointer-events:all;cursor:pointer;opacity:1}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._select_193rj_1{background-color:red}._select__listbox_193rj_4{min-width:10.75rem;max-height:400px;padding:.5rem;margin-top:.25rem;overflow-y:auto;background-color:#fff;border-radius:var(--border-radius);box-shadow:0 6px 12px rgba(var(--black-100-rgb),20%)}._select__listbox__option_193rj_14{display:flex;padding:.625rem;color:rgba(var(--gray-95-rgb),88%);list-style:none;cursor:pointer;border-radius:var(--border-radius-soft)}._select__listbox__option__icon_193rj_22{display:flex;margin-right:.5rem}._select__listbox__option__text_193rj_26{font-weight:700}._select__listbox__option_193rj_14:hover:not(._select__listbox__option--disabled_193rj_29){padding:.625rem;color:var(--accent);background-color:rgba(var(--black-100-rgb),4%);border-radius:var(--border-radius-soft)}._select__listbox__option_193rj_14:active:not(._select__listbox__option--disabled_193rj_29){color:var(--accent-dark)}._select__listbox__option--selected_193rj_38{background-color:var(--accent-lighter)}._select__listbox__option--disabled_193rj_29{color:rgba(var(--gray-95-rgb),25%);cursor:default;border:transparent}._select__listbox__option--disabled_193rj_29 ._select__list__option__icon_193rj_46{color:rgba(var(--gray-95-rgb),25%);fill:rgba(var(--gray-95-rgb),25%)}._select-button_193rj_51{display:flex;gap:.5rem;align-items:center;justify-content:space-between;width:11.875rem;min-width:fit-content;padding:.625rem 1rem;color:rgba(var(--gray-95-rgb),88%);cursor:pointer;background-color:var(--white-100);border:1px solid rgba(var(--black-100-rgb),6%);border-radius:var(--border-radius);outline:none}._select-button__text_193rj_66{display:flex;gap:.5rem;width:100%;overflow:hidden;text-align:start;text-overflow:ellipsis;text-wrap:nowrap}._select-button__icon_193rj_75{display:flex}._select-button__icon_193rj_75 svg{color:rgba(var(--gray-95-rgb),88%)}._select-button--active_193rj_81{border:1px solid var(--accent)}._select-button_193rj_51:disabled{color:rgba(var(--gray-95-rgb),25%);cursor:default;border:1px solid var(--gray-10)}._select-button_193rj_51:disabled ._select-button__icon_193rj_75 svg{color:rgba(var(--gray-95-rgb),25%)}._select-button_193rj_51:hover:not(._select-button_193rj_51:disabled){border:1px solid var(--gray-25)}._select-button_193rj_51:focus:not(._select-button_193rj_51:disabled),._select-button_193rj_51:active:not(._select-button_193rj_51:disabled){border:1px solid var(--accent)}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import '../../assets/InputSearch.css';
|
|
2
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { c as m } from "../../clsx-DB4S2d7J.js";
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Input as
|
|
6
|
-
const l = "
|
|
4
|
+
import { Icon as p } from "../Icon/Icon.js";
|
|
5
|
+
import { Input as u } from "../Input/Input.js";
|
|
6
|
+
const l = "_inputSearch_114e1_1", h = {
|
|
7
7
|
inputSearch: l
|
|
8
8
|
};
|
|
9
9
|
let n;
|
|
10
|
-
const
|
|
10
|
+
const d = ({
|
|
11
11
|
classNameWrapper: r,
|
|
12
12
|
triggerDelay: o = 500,
|
|
13
13
|
value: c,
|
|
@@ -19,16 +19,16 @@ const x = ({
|
|
|
19
19
|
n && clearTimeout(n), n = setTimeout(() => i(t), o);
|
|
20
20
|
};
|
|
21
21
|
return /* @__PURE__ */ e("div", { className: m(h.inputSearch, r), children: /* @__PURE__ */ e(
|
|
22
|
-
|
|
22
|
+
u,
|
|
23
23
|
{
|
|
24
24
|
type: "search",
|
|
25
25
|
...a,
|
|
26
|
-
leftIcon: /* @__PURE__ */ e(
|
|
26
|
+
leftIcon: /* @__PURE__ */ e(p, { icon: "magnifying-glass" }),
|
|
27
27
|
defaultValue: c,
|
|
28
28
|
onChange: (t) => s(t)
|
|
29
29
|
}
|
|
30
30
|
) });
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
d as InputSearch
|
|
34
34
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
type SelectOptionProps = {
|
|
3
|
+
export type SelectOptionProps = {
|
|
4
4
|
disabled?: boolean;
|
|
5
|
-
value: string
|
|
5
|
+
value: string;
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
icon?: ReactNode;
|
|
8
8
|
className?: string;
|
|
9
9
|
'data-testid'?: string;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export declare const SelectOption: (props: SelectOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export type SelectProps = {
|
|
13
|
+
children?: ReactNode;
|
|
13
14
|
disabled?: boolean;
|
|
14
|
-
placeholder?: string
|
|
15
|
-
|
|
16
|
-
onChange?: (value: number | string | null, event?: React.SyntheticEvent<Element, Event> | null) => void;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
prefix?: string;
|
|
17
17
|
className?: string;
|
|
18
|
+
value?: string;
|
|
18
19
|
'data-testid'?: string;
|
|
20
|
+
onChange?: (value: string | null, event?: React.SyntheticEvent<Element, Event> | null) => void;
|
|
19
21
|
};
|
|
20
|
-
export declare const Option: (props: SelectOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
declare const Select: {
|
|
22
23
|
(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
Option: (props: SelectOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as h, jsxs as Oe } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as Ve } from "../../clsx-DB4S2d7J.js";
|
|
3
3
|
import { Typography as Ke } from "../Typography/Typography.js";
|
|
4
|
-
import { s as
|
|
5
|
-
import { a as g, _ as
|
|
4
|
+
import { s as H, S as ze } from "../../SelectButton-DWZ2BRaX.js";
|
|
5
|
+
import { a as g, _ as _e } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
6
6
|
import * as s from "react";
|
|
7
7
|
import { g as we, a as ke, u as X, e as ne, P as l, b as le, c as Ie, d as Me } from "../../index-CqjC7P5Y.js";
|
|
8
8
|
import { u as Je, c as se, a as ye, L as Q } from "../../combineHooksSlotProps-BHqhiBfc.js";
|
|
@@ -29,7 +29,7 @@ ke(Ae, ["root", "disabled", "selected", "highlighted"]);
|
|
|
29
29
|
function lt(n) {
|
|
30
30
|
const {
|
|
31
31
|
value: o,
|
|
32
|
-
label:
|
|
32
|
+
label: u,
|
|
33
33
|
disabled: a,
|
|
34
34
|
rootRef: r,
|
|
35
35
|
id: c
|
|
@@ -41,27 +41,27 @@ function lt(n) {
|
|
|
41
41
|
item: o
|
|
42
42
|
}), {
|
|
43
43
|
getRootProps: v,
|
|
44
|
-
rootRef:
|
|
44
|
+
rootRef: I
|
|
45
45
|
} = Ne({
|
|
46
46
|
disabled: a,
|
|
47
47
|
focusableWhenDisabled: !0
|
|
48
48
|
}), x = Te(c), y = s.useRef(null), R = s.useMemo(() => ({
|
|
49
49
|
disabled: a,
|
|
50
|
-
label:
|
|
50
|
+
label: u,
|
|
51
51
|
value: o,
|
|
52
52
|
ref: y,
|
|
53
53
|
id: x
|
|
54
|
-
}), [a,
|
|
55
|
-
index:
|
|
56
|
-
} = We(o, R), O = X(r, y,
|
|
54
|
+
}), [a, u, o, x]), {
|
|
55
|
+
index: M
|
|
56
|
+
} = We(o, R), O = X(r, y, I), N = (b) => (C) => {
|
|
57
57
|
var P;
|
|
58
58
|
(P = b.onKeyDown) == null || P.call(b, C), !C.defaultMuiPrevented && [" ", "Enter"].includes(C.key) && (C.defaultMuiPrevented = !0);
|
|
59
|
-
},
|
|
60
|
-
onKeyDown:
|
|
59
|
+
}, L = (b = {}) => ({
|
|
60
|
+
onKeyDown: N(b)
|
|
61
61
|
});
|
|
62
62
|
return {
|
|
63
63
|
getRootProps: (b = {}) => {
|
|
64
|
-
const C = ne(b), P = se(p, se(v,
|
|
64
|
+
const C = ne(b), P = se(p, se(v, L));
|
|
65
65
|
return g({}, b, C, P(C), {
|
|
66
66
|
id: x,
|
|
67
67
|
ref: O,
|
|
@@ -70,7 +70,7 @@ function lt(n) {
|
|
|
70
70
|
});
|
|
71
71
|
},
|
|
72
72
|
highlighted: f,
|
|
73
|
-
index:
|
|
73
|
+
index: M,
|
|
74
74
|
selected: d,
|
|
75
75
|
rootRef: O
|
|
76
76
|
};
|
|
@@ -80,13 +80,13 @@ function st(n) {
|
|
|
80
80
|
if (!o)
|
|
81
81
|
throw new Error("Option: ListContext was not found.");
|
|
82
82
|
const {
|
|
83
|
-
getItemState:
|
|
83
|
+
getItemState: u,
|
|
84
84
|
dispatch: a
|
|
85
85
|
} = o, {
|
|
86
86
|
highlighted: r,
|
|
87
87
|
selected: c,
|
|
88
88
|
focusable: p
|
|
89
|
-
} =
|
|
89
|
+
} = u(n), f = s.useCallback((v) => {
|
|
90
90
|
if (v !== n)
|
|
91
91
|
throw new Error(["Base UI Option: Tried to access the state of another Option.", "This is unsupported when the Option uses the OptionContextStabilizer as a performance optimization."].join("/n"));
|
|
92
92
|
return {
|
|
@@ -106,14 +106,14 @@ const rt = ["children", "disabled", "label", "slotProps", "slots", "value"];
|
|
|
106
106
|
function it(n) {
|
|
107
107
|
const {
|
|
108
108
|
disabled: o,
|
|
109
|
-
highlighted:
|
|
109
|
+
highlighted: u,
|
|
110
110
|
selected: a
|
|
111
111
|
} = n;
|
|
112
112
|
return Ie({
|
|
113
|
-
root: ["root", o && "disabled",
|
|
113
|
+
root: ["root", o && "disabled", u && "highlighted", a && "selected"]
|
|
114
114
|
}, Me(nt));
|
|
115
115
|
}
|
|
116
|
-
const ut = /* @__PURE__ */ s.memo(/* @__PURE__ */ s.forwardRef(function(o,
|
|
116
|
+
const ut = /* @__PURE__ */ s.memo(/* @__PURE__ */ s.forwardRef(function(o, u) {
|
|
117
117
|
var a, r;
|
|
118
118
|
const {
|
|
119
119
|
children: c,
|
|
@@ -121,34 +121,34 @@ const ut = /* @__PURE__ */ s.memo(/* @__PURE__ */ s.forwardRef(function(o, i) {
|
|
|
121
121
|
label: f,
|
|
122
122
|
slotProps: d = {},
|
|
123
123
|
slots: v = {},
|
|
124
|
-
value:
|
|
125
|
-
} = o, x =
|
|
126
|
-
getRootProps:
|
|
127
|
-
selected:
|
|
124
|
+
value: I
|
|
125
|
+
} = o, x = _e(o, rt), y = (a = v.root) != null ? a : "li", R = s.useRef(null), M = X(R, u), O = f ?? (typeof c == "string" ? c : (r = R.current) == null || (r = r.textContent) == null ? void 0 : r.trim()), {
|
|
126
|
+
getRootProps: N,
|
|
127
|
+
selected: L,
|
|
128
128
|
highlighted: b,
|
|
129
129
|
index: C
|
|
130
130
|
} = lt({
|
|
131
131
|
disabled: p,
|
|
132
132
|
label: O,
|
|
133
|
-
rootRef:
|
|
134
|
-
value:
|
|
133
|
+
rootRef: M,
|
|
134
|
+
value: I
|
|
135
135
|
}), P = g({}, o, {
|
|
136
136
|
disabled: p,
|
|
137
137
|
highlighted: b,
|
|
138
138
|
index: C,
|
|
139
|
-
selected:
|
|
140
|
-
}), j = it(P),
|
|
141
|
-
getSlotProps:
|
|
139
|
+
selected: L
|
|
140
|
+
}), j = it(P), V = le({
|
|
141
|
+
getSlotProps: N,
|
|
142
142
|
elementType: y,
|
|
143
143
|
externalSlotProps: d.root,
|
|
144
144
|
externalForwardedProps: x,
|
|
145
145
|
className: j.root,
|
|
146
146
|
ownerState: P
|
|
147
147
|
});
|
|
148
|
-
return /* @__PURE__ */ h(y, g({},
|
|
148
|
+
return /* @__PURE__ */ h(y, g({}, V, {
|
|
149
149
|
children: c
|
|
150
150
|
}));
|
|
151
|
-
})), Le = /* @__PURE__ */ s.forwardRef(function(o,
|
|
151
|
+
})), Le = /* @__PURE__ */ s.forwardRef(function(o, u) {
|
|
152
152
|
const {
|
|
153
153
|
value: a
|
|
154
154
|
} = o, {
|
|
@@ -157,7 +157,7 @@ const ut = /* @__PURE__ */ s.memo(/* @__PURE__ */ s.forwardRef(function(o, i) {
|
|
|
157
157
|
return /* @__PURE__ */ h(ye.Provider, {
|
|
158
158
|
value: r,
|
|
159
159
|
children: /* @__PURE__ */ h(ut, g({}, o, {
|
|
160
|
-
ref:
|
|
160
|
+
ref: u
|
|
161
161
|
}))
|
|
162
162
|
});
|
|
163
163
|
});
|
|
@@ -210,13 +210,13 @@ const re = {
|
|
|
210
210
|
}, Be = (n) => {
|
|
211
211
|
const {
|
|
212
212
|
label: o,
|
|
213
|
-
value:
|
|
213
|
+
value: u
|
|
214
214
|
} = n;
|
|
215
|
-
return typeof o == "string" ? o : typeof
|
|
215
|
+
return typeof o == "string" ? o : typeof u == "string" ? u : String(n);
|
|
216
216
|
};
|
|
217
217
|
function at(n, o) {
|
|
218
218
|
const {
|
|
219
|
-
open:
|
|
219
|
+
open: u
|
|
220
220
|
} = n, {
|
|
221
221
|
context: {
|
|
222
222
|
selectionMode: a
|
|
@@ -226,8 +226,8 @@ function at(n, o) {
|
|
|
226
226
|
var r;
|
|
227
227
|
const d = (r = n.selectedValues[0]) != null ? r : ve(null, "start", o.context);
|
|
228
228
|
return g({}, n, {
|
|
229
|
-
open: !
|
|
230
|
-
highlightedValue:
|
|
229
|
+
open: !u,
|
|
230
|
+
highlightedValue: u ? null : d
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
233
|
if (o.type === re.browserAutoFill)
|
|
@@ -278,7 +278,7 @@ function ct(n) {
|
|
|
278
278
|
function dt(n) {
|
|
279
279
|
const {
|
|
280
280
|
areOptionsEqual: o,
|
|
281
|
-
buttonRef:
|
|
281
|
+
buttonRef: u,
|
|
282
282
|
defaultOpen: a = !1,
|
|
283
283
|
defaultValue: r,
|
|
284
284
|
disabled: c = !1,
|
|
@@ -286,32 +286,32 @@ function dt(n) {
|
|
|
286
286
|
listboxRef: f,
|
|
287
287
|
multiple: d = !1,
|
|
288
288
|
name: v,
|
|
289
|
-
required:
|
|
289
|
+
required: I,
|
|
290
290
|
onChange: x,
|
|
291
291
|
onHighlightChange: y,
|
|
292
292
|
onOpenChange: R,
|
|
293
|
-
open:
|
|
293
|
+
open: M,
|
|
294
294
|
options: O,
|
|
295
|
-
getOptionAsString:
|
|
296
|
-
getSerializedValue:
|
|
295
|
+
getOptionAsString: N = Be,
|
|
296
|
+
getSerializedValue: L = ct,
|
|
297
297
|
value: b,
|
|
298
298
|
componentName: C = "useSelect"
|
|
299
|
-
} = n, P = s.useRef(null), j = X(
|
|
300
|
-
let
|
|
301
|
-
b === void 0 && r === void 0 ?
|
|
299
|
+
} = n, P = s.useRef(null), j = X(u, P), V = s.useRef(null), $ = Te(p);
|
|
300
|
+
let B;
|
|
301
|
+
b === void 0 && r === void 0 ? B = [] : r !== void 0 && (d ? B = r : B = r == null ? [] : [r]);
|
|
302
302
|
const Y = s.useMemo(() => {
|
|
303
303
|
if (b !== void 0)
|
|
304
304
|
return d ? b : b == null ? [] : [b];
|
|
305
305
|
}, [b, d]), {
|
|
306
|
-
subitems:
|
|
306
|
+
subitems: T,
|
|
307
307
|
contextValue: F
|
|
308
|
-
} = Ge(),
|
|
308
|
+
} = Ge(), _ = s.useMemo(() => O != null ? new Map(O.map((e, t) => [e.value, {
|
|
309
309
|
value: e.value,
|
|
310
310
|
label: e.label,
|
|
311
311
|
disabled: e.disabled,
|
|
312
312
|
ref: /* @__PURE__ */ s.createRef(),
|
|
313
313
|
id: `${$}_${t}`
|
|
314
|
-
}])) :
|
|
314
|
+
}])) : T, [O, T, $]), ie = X(f, V), {
|
|
315
315
|
getRootProps: Z,
|
|
316
316
|
active: ue,
|
|
317
317
|
focusVisible: ae,
|
|
@@ -319,48 +319,48 @@ function dt(n) {
|
|
|
319
319
|
} = Ne({
|
|
320
320
|
disabled: c,
|
|
321
321
|
rootRef: j
|
|
322
|
-
}), q = s.useMemo(() => Array.from(
|
|
322
|
+
}), q = s.useMemo(() => Array.from(_.keys()), [_]), S = s.useCallback((e) => {
|
|
323
323
|
if (o !== void 0) {
|
|
324
|
-
const t = q.find((
|
|
325
|
-
return
|
|
324
|
+
const t = q.find((i) => o(i, e));
|
|
325
|
+
return _.get(t);
|
|
326
326
|
}
|
|
327
|
-
return
|
|
328
|
-
}, [
|
|
327
|
+
return _.get(e);
|
|
328
|
+
}, [_, o, q]), ee = s.useCallback((e) => {
|
|
329
329
|
var t;
|
|
330
|
-
const
|
|
331
|
-
return (t =
|
|
332
|
-
}, [
|
|
333
|
-
const t =
|
|
334
|
-
return t ?
|
|
335
|
-
}, [
|
|
330
|
+
const i = S(e);
|
|
331
|
+
return (t = i == null ? void 0 : i.disabled) != null ? t : !1;
|
|
332
|
+
}, [S]), te = s.useCallback((e) => {
|
|
333
|
+
const t = S(e);
|
|
334
|
+
return t ? N(t) : "";
|
|
335
|
+
}, [S, N]), ce = s.useMemo(() => ({
|
|
336
336
|
selectedValues: Y,
|
|
337
|
-
open:
|
|
338
|
-
}), [Y,
|
|
337
|
+
open: M
|
|
338
|
+
}), [Y, M]), de = s.useCallback((e) => {
|
|
339
339
|
var t;
|
|
340
|
-
return (t =
|
|
341
|
-
}, [
|
|
340
|
+
return (t = _.get(e)) == null ? void 0 : t.id;
|
|
341
|
+
}, [_]), pe = s.useCallback((e, t) => {
|
|
342
342
|
if (d)
|
|
343
343
|
x == null || x(e, t);
|
|
344
344
|
else {
|
|
345
|
-
var
|
|
346
|
-
x == null || x(e, (
|
|
345
|
+
var i;
|
|
346
|
+
x == null || x(e, (i = t[0]) != null ? i : null);
|
|
347
347
|
}
|
|
348
348
|
}, [d, x]), fe = s.useCallback((e, t) => {
|
|
349
349
|
y == null || y(e, t ?? null);
|
|
350
|
-
}, [y]), be = s.useCallback((e, t,
|
|
351
|
-
if (t === "open" && (R == null || R(
|
|
350
|
+
}, [y]), be = s.useCallback((e, t, i) => {
|
|
351
|
+
if (t === "open" && (R == null || R(i), i === !1 && (e == null ? void 0 : e.type) !== "blur")) {
|
|
352
352
|
var m;
|
|
353
353
|
(m = P.current) == null || m.focus();
|
|
354
354
|
}
|
|
355
355
|
}, [R]), ge = s.useCallback((e) => {
|
|
356
|
-
var t,
|
|
357
|
-
return e == null ? null : (t = (
|
|
358
|
-
}, [
|
|
356
|
+
var t, i;
|
|
357
|
+
return e == null ? null : (t = (i = T.get(e)) == null ? void 0 : i.ref.current) != null ? t : null;
|
|
358
|
+
}, [T]), me = {
|
|
359
359
|
getInitialState: () => {
|
|
360
360
|
var e;
|
|
361
361
|
return {
|
|
362
362
|
highlightedValue: null,
|
|
363
|
-
selectedValues: (e =
|
|
363
|
+
selectedValues: (e = B) != null ? e : [],
|
|
364
364
|
open: a
|
|
365
365
|
};
|
|
366
366
|
},
|
|
@@ -383,41 +383,41 @@ function dt(n) {
|
|
|
383
383
|
stateReducer: at,
|
|
384
384
|
componentName: C
|
|
385
385
|
}, {
|
|
386
|
-
dispatch:
|
|
386
|
+
dispatch: E,
|
|
387
387
|
getRootProps: he,
|
|
388
388
|
contextValue: K,
|
|
389
389
|
state: {
|
|
390
390
|
open: w,
|
|
391
|
-
highlightedValue:
|
|
391
|
+
highlightedValue: A,
|
|
392
392
|
selectedValues: k
|
|
393
393
|
},
|
|
394
394
|
rootRef: z
|
|
395
395
|
} = et(me), xe = s.useRef(w);
|
|
396
396
|
tt(() => {
|
|
397
|
-
if (w &&
|
|
397
|
+
if (w && A !== null) {
|
|
398
398
|
var e;
|
|
399
|
-
const t = (e =
|
|
400
|
-
if (!
|
|
399
|
+
const t = (e = S(A)) == null ? void 0 : e.ref;
|
|
400
|
+
if (!V.current || !(t != null && t.current))
|
|
401
401
|
return;
|
|
402
402
|
xe.current || t.current.focus({
|
|
403
403
|
preventScroll: !0
|
|
404
404
|
});
|
|
405
|
-
const
|
|
406
|
-
m.top <
|
|
405
|
+
const i = V.current.getBoundingClientRect(), m = t.current.getBoundingClientRect();
|
|
406
|
+
m.top < i.top ? V.current.scrollTop -= i.top - m.top : m.bottom > i.bottom && (V.current.scrollTop += m.bottom - i.bottom);
|
|
407
407
|
}
|
|
408
|
-
}, [w,
|
|
409
|
-
const J = s.useCallback((e) =>
|
|
410
|
-
var
|
|
411
|
-
if (e == null || (
|
|
408
|
+
}, [w, A, S]);
|
|
409
|
+
const J = s.useCallback((e) => S(e), [S]), Ce = (e) => (t) => {
|
|
410
|
+
var i;
|
|
411
|
+
if (e == null || (i = e.onClick) == null || i.call(e, t), !t.defaultMuiPrevented) {
|
|
412
412
|
const m = {
|
|
413
413
|
type: re.buttonClick,
|
|
414
414
|
event: t
|
|
415
415
|
};
|
|
416
|
-
|
|
416
|
+
E(m);
|
|
417
417
|
}
|
|
418
418
|
}, W = (e) => (t) => {
|
|
419
|
-
var
|
|
420
|
-
(
|
|
419
|
+
var i;
|
|
420
|
+
(i = e.onKeyDown) == null || i.call(e, t), !t.defaultMuiPrevented && (t.key === "ArrowDown" || t.key === "ArrowUp") && (t.preventDefault(), E({
|
|
421
421
|
type: Q.keyDown,
|
|
422
422
|
key: t.key,
|
|
423
423
|
event: t
|
|
@@ -425,29 +425,29 @@ function dt(n) {
|
|
|
425
425
|
}, oe = (e = {}) => ({
|
|
426
426
|
onClick: Ce(e),
|
|
427
427
|
onKeyDown: W(e)
|
|
428
|
-
}),
|
|
428
|
+
}), D = (e = {}) => g({}, e, oe(e), {
|
|
429
429
|
role: "combobox",
|
|
430
430
|
"aria-expanded": w,
|
|
431
431
|
"aria-controls": $
|
|
432
432
|
}), He = (e = {}) => {
|
|
433
|
-
const t = ne(e),
|
|
434
|
-
return g({}, e,
|
|
433
|
+
const t = ne(e), i = se(D, Z);
|
|
434
|
+
return g({}, e, i(t));
|
|
435
435
|
}, $e = (e) => (t) => {
|
|
436
|
-
var
|
|
437
|
-
(
|
|
436
|
+
var i, m;
|
|
437
|
+
(i = e.onBlur) == null || i.call(e, t), !t.defaultMuiPrevented && ((m = V.current) != null && m.contains(t.relatedTarget) || t.relatedTarget === P.current) && (t.defaultMuiPrevented = !0);
|
|
438
438
|
}, Fe = (e = {}) => ({
|
|
439
439
|
onBlur: $e(e)
|
|
440
440
|
}), qe = (e = {}) => {
|
|
441
|
-
const t = ne(e),
|
|
441
|
+
const t = ne(e), i = se(Fe, he);
|
|
442
442
|
return g({
|
|
443
443
|
id: $,
|
|
444
444
|
role: "listbox",
|
|
445
445
|
"aria-multiselectable": d ? "true" : void 0
|
|
446
|
-
}, e,
|
|
446
|
+
}, e, i(t));
|
|
447
447
|
};
|
|
448
448
|
s.useDebugValue({
|
|
449
449
|
selectedOptions: k,
|
|
450
|
-
highlightedOption:
|
|
450
|
+
highlightedOption: A,
|
|
451
451
|
open: w
|
|
452
452
|
});
|
|
453
453
|
const je = s.useMemo(() => g({}, K, F), [K, F]);
|
|
@@ -461,13 +461,13 @@ function dt(n) {
|
|
|
461
461
|
Pe = (Re = J(G)) != null ? Re : null;
|
|
462
462
|
}
|
|
463
463
|
const Ue = (e) => (t) => {
|
|
464
|
-
var
|
|
465
|
-
if (e == null || (
|
|
464
|
+
var i;
|
|
465
|
+
if (e == null || (i = e.onChange) == null || i.call(e, t), t.defaultMuiPrevented)
|
|
466
466
|
return;
|
|
467
|
-
const m =
|
|
468
|
-
t.target.value === "" ?
|
|
467
|
+
const m = _.get(t.target.value);
|
|
468
|
+
t.target.value === "" ? E({
|
|
469
469
|
type: Q.clearSelection
|
|
470
|
-
}) : m !== void 0 &&
|
|
470
|
+
}) : m !== void 0 && E({
|
|
471
471
|
type: re.browserAutoFill,
|
|
472
472
|
item: m.value,
|
|
473
473
|
event: t
|
|
@@ -479,7 +479,7 @@ function dt(n) {
|
|
|
479
479
|
buttonRef: U,
|
|
480
480
|
contextValue: je,
|
|
481
481
|
disabled: c,
|
|
482
|
-
dispatch:
|
|
482
|
+
dispatch: E,
|
|
483
483
|
getButtonProps: He,
|
|
484
484
|
getHiddenInputProps: (e = {}) => {
|
|
485
485
|
const t = ne(e);
|
|
@@ -487,8 +487,8 @@ function dt(n) {
|
|
|
487
487
|
name: v,
|
|
488
488
|
tabIndex: -1,
|
|
489
489
|
"aria-hidden": !0,
|
|
490
|
-
required:
|
|
491
|
-
value:
|
|
490
|
+
required: I ? !0 : void 0,
|
|
491
|
+
value: L(Pe),
|
|
492
492
|
style: ot
|
|
493
493
|
}, e, {
|
|
494
494
|
onChange: Ue(t)
|
|
@@ -500,13 +500,13 @@ function dt(n) {
|
|
|
500
500
|
open: w,
|
|
501
501
|
options: q,
|
|
502
502
|
value: G,
|
|
503
|
-
highlightedOption:
|
|
503
|
+
highlightedOption: A
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
506
|
function pt(n) {
|
|
507
507
|
const {
|
|
508
508
|
value: o,
|
|
509
|
-
children:
|
|
509
|
+
children: u
|
|
510
510
|
} = n, {
|
|
511
511
|
dispatch: a,
|
|
512
512
|
getItemIndex: r,
|
|
@@ -526,7 +526,7 @@ function pt(n) {
|
|
|
526
526
|
value: v,
|
|
527
527
|
children: /* @__PURE__ */ h(ye.Provider, {
|
|
528
528
|
value: d,
|
|
529
|
-
children:
|
|
529
|
+
children: u
|
|
530
530
|
})
|
|
531
531
|
});
|
|
532
532
|
}
|
|
@@ -535,68 +535,68 @@ function ft(n) {
|
|
|
535
535
|
return we(Ee, n);
|
|
536
536
|
}
|
|
537
537
|
ke(Ee, ["root", "button", "listbox", "popup", "active", "expanded", "disabled", "focusVisible"]);
|
|
538
|
-
var
|
|
538
|
+
var Se;
|
|
539
539
|
const bt = ["areOptionsEqual", "autoComplete", "autoFocus", "children", "defaultValue", "defaultListboxOpen", "disabled", "getSerializedValue", "listboxId", "listboxOpen", "multiple", "name", "required", "onChange", "onListboxOpenChange", "getOptionAsString", "renderValue", "placeholder", "slotProps", "slots", "value"];
|
|
540
540
|
function gt(n) {
|
|
541
541
|
var o;
|
|
542
542
|
return Array.isArray(n) ? /* @__PURE__ */ h(s.Fragment, {
|
|
543
|
-
children: n.map((
|
|
543
|
+
children: n.map((u) => u.label).join(", ")
|
|
544
544
|
}) : (o = n == null ? void 0 : n.label) != null ? o : null;
|
|
545
545
|
}
|
|
546
546
|
function mt(n) {
|
|
547
547
|
const {
|
|
548
548
|
active: o,
|
|
549
|
-
disabled:
|
|
549
|
+
disabled: u,
|
|
550
550
|
open: a,
|
|
551
551
|
focusVisible: r
|
|
552
552
|
} = n;
|
|
553
553
|
return Ie({
|
|
554
|
-
root: ["root",
|
|
555
|
-
listbox: ["listbox",
|
|
554
|
+
root: ["root", u && "disabled", r && "focusVisible", o && "active", a && "expanded"],
|
|
555
|
+
listbox: ["listbox", u && "disabled"],
|
|
556
556
|
popup: ["popup"]
|
|
557
557
|
}, Me(ft));
|
|
558
558
|
}
|
|
559
|
-
const De = /* @__PURE__ */ s.forwardRef(function(o,
|
|
559
|
+
const De = /* @__PURE__ */ s.forwardRef(function(o, u) {
|
|
560
560
|
var a, r, c, p, f;
|
|
561
561
|
const {
|
|
562
562
|
areOptionsEqual: d,
|
|
563
563
|
autoComplete: v,
|
|
564
|
-
autoFocus:
|
|
564
|
+
autoFocus: I,
|
|
565
565
|
children: x,
|
|
566
566
|
defaultValue: y,
|
|
567
567
|
defaultListboxOpen: R = !1,
|
|
568
|
-
disabled:
|
|
568
|
+
disabled: M,
|
|
569
569
|
getSerializedValue: O,
|
|
570
|
-
listboxId:
|
|
571
|
-
listboxOpen:
|
|
570
|
+
listboxId: N,
|
|
571
|
+
listboxOpen: L,
|
|
572
572
|
multiple: b = !1,
|
|
573
573
|
name: C,
|
|
574
574
|
required: P = !1,
|
|
575
575
|
onChange: j,
|
|
576
|
-
onListboxOpenChange:
|
|
576
|
+
onListboxOpenChange: V,
|
|
577
577
|
getOptionAsString: $ = Be,
|
|
578
|
-
renderValue:
|
|
578
|
+
renderValue: B,
|
|
579
579
|
placeholder: Y,
|
|
580
|
-
slotProps:
|
|
580
|
+
slotProps: T = {},
|
|
581
581
|
slots: F = {},
|
|
582
|
-
value:
|
|
583
|
-
} = o, ie =
|
|
584
|
-
ae(
|
|
585
|
-
}, []), de = X(
|
|
582
|
+
value: _
|
|
583
|
+
} = o, ie = _e(o, bt), Z = B ?? gt, [ue, ae] = s.useState(!1), U = s.useRef(null), q = s.useRef(null), S = (a = F.root) != null ? a : "button", ee = (r = F.listbox) != null ? r : "ul", te = (c = F.popup) != null ? c : "div", ce = s.useCallback((D) => {
|
|
584
|
+
ae(D != null);
|
|
585
|
+
}, []), de = X(u, U, ce);
|
|
586
586
|
s.useEffect(() => {
|
|
587
|
-
|
|
588
|
-
}, [
|
|
587
|
+
I && U.current.focus();
|
|
588
|
+
}, [I]);
|
|
589
589
|
const {
|
|
590
590
|
buttonActive: pe,
|
|
591
591
|
buttonFocusVisible: fe,
|
|
592
592
|
contextValue: be,
|
|
593
593
|
disabled: ge,
|
|
594
594
|
getButtonProps: me,
|
|
595
|
-
getListboxProps:
|
|
595
|
+
getListboxProps: E,
|
|
596
596
|
getHiddenInputProps: he,
|
|
597
597
|
getOptionMetadata: K,
|
|
598
598
|
value: w,
|
|
599
|
-
open:
|
|
599
|
+
open: A
|
|
600
600
|
} = dt({
|
|
601
601
|
name: C,
|
|
602
602
|
required: P,
|
|
@@ -605,35 +605,35 @@ const De = /* @__PURE__ */ s.forwardRef(function(o, i) {
|
|
|
605
605
|
buttonRef: de,
|
|
606
606
|
defaultOpen: R,
|
|
607
607
|
defaultValue: y,
|
|
608
|
-
disabled:
|
|
609
|
-
listboxId:
|
|
608
|
+
disabled: M,
|
|
609
|
+
listboxId: N,
|
|
610
610
|
multiple: b,
|
|
611
|
-
open:
|
|
611
|
+
open: L,
|
|
612
612
|
onChange: j,
|
|
613
|
-
onOpenChange:
|
|
613
|
+
onOpenChange: V,
|
|
614
614
|
getOptionAsString: $,
|
|
615
|
-
value:
|
|
615
|
+
value: _,
|
|
616
616
|
componentName: "Select"
|
|
617
617
|
}), k = g({}, o, {
|
|
618
618
|
active: pe,
|
|
619
619
|
defaultListboxOpen: R,
|
|
620
620
|
disabled: ge,
|
|
621
621
|
focusVisible: fe,
|
|
622
|
-
open:
|
|
622
|
+
open: A,
|
|
623
623
|
multiple: b,
|
|
624
624
|
renderValue: Z,
|
|
625
625
|
value: w
|
|
626
626
|
}), z = mt(k), xe = le({
|
|
627
|
-
elementType:
|
|
627
|
+
elementType: S,
|
|
628
628
|
getSlotProps: me,
|
|
629
|
-
externalSlotProps:
|
|
629
|
+
externalSlotProps: T.root,
|
|
630
630
|
externalForwardedProps: ie,
|
|
631
631
|
ownerState: k,
|
|
632
632
|
className: z.root
|
|
633
633
|
}), J = le({
|
|
634
634
|
elementType: ee,
|
|
635
|
-
getSlotProps:
|
|
636
|
-
externalSlotProps:
|
|
635
|
+
getSlotProps: E,
|
|
636
|
+
externalSlotProps: T.listbox,
|
|
637
637
|
additionalProps: {
|
|
638
638
|
ref: q
|
|
639
639
|
},
|
|
@@ -641,11 +641,11 @@ const De = /* @__PURE__ */ s.forwardRef(function(o, i) {
|
|
|
641
641
|
className: z.listbox
|
|
642
642
|
}), Ce = le({
|
|
643
643
|
elementType: te,
|
|
644
|
-
externalSlotProps:
|
|
644
|
+
externalSlotProps: T.popup,
|
|
645
645
|
additionalProps: {
|
|
646
646
|
anchor: U.current,
|
|
647
647
|
keepMounted: !0,
|
|
648
|
-
open:
|
|
648
|
+
open: A,
|
|
649
649
|
placement: "bottom-start",
|
|
650
650
|
role: void 0
|
|
651
651
|
},
|
|
@@ -654,17 +654,17 @@ const De = /* @__PURE__ */ s.forwardRef(function(o, i) {
|
|
|
654
654
|
});
|
|
655
655
|
let W;
|
|
656
656
|
if (b)
|
|
657
|
-
W = w.map((
|
|
657
|
+
W = w.map((D) => K(D)).filter((D) => D !== void 0);
|
|
658
658
|
else {
|
|
659
659
|
var oe;
|
|
660
660
|
W = (oe = K(w)) != null ? oe : null;
|
|
661
661
|
}
|
|
662
662
|
return /* @__PURE__ */ Oe(s.Fragment, {
|
|
663
|
-
children: [/* @__PURE__ */ h(
|
|
663
|
+
children: [/* @__PURE__ */ h(S, g({}, xe, {
|
|
664
664
|
children: (p = (f = Z(W)) != null ? f : Y) != null ? p : (
|
|
665
665
|
// fall back to a zero-width space to prevent layout shift
|
|
666
666
|
// from https://github.com/mui/material-ui/pull/24563
|
|
667
|
-
|
|
667
|
+
Se || (Se = /* @__PURE__ */ h("span", {
|
|
668
668
|
className: "notranslate",
|
|
669
669
|
children: ""
|
|
670
670
|
}))
|
|
@@ -813,48 +813,46 @@ process.env.NODE_ENV !== "production" && (De.propTypes = {
|
|
|
813
813
|
value: l.any
|
|
814
814
|
});
|
|
815
815
|
const ht = (n) => {
|
|
816
|
-
const { children: o, icon:
|
|
816
|
+
const { children: o, icon: u, className: a, ...r } = n;
|
|
817
817
|
return /* @__PURE__ */ Oe(
|
|
818
818
|
Le,
|
|
819
819
|
{
|
|
820
|
-
...
|
|
820
|
+
...r,
|
|
821
821
|
slotProps: {
|
|
822
|
-
root: (
|
|
823
|
-
className:
|
|
824
|
-
[
|
|
825
|
-
[
|
|
826
|
-
[I["select__listbox__option--highlighted"]]: r.highlighted
|
|
822
|
+
root: (c) => ({
|
|
823
|
+
className: Ve(H.select__listbox__option, a, {
|
|
824
|
+
[H["select__listbox__option--disabled"]]: c.disabled,
|
|
825
|
+
[H["select__listbox__option--selected"]]: c.selected
|
|
827
826
|
})
|
|
828
827
|
})
|
|
829
828
|
},
|
|
830
829
|
children: [
|
|
831
|
-
|
|
832
|
-
/* @__PURE__ */ h(Ke, { element: "span", variant: "body-small", className:
|
|
830
|
+
u ? /* @__PURE__ */ h("span", { className: H.select__listbox__option__icon, children: u }) : "",
|
|
831
|
+
/* @__PURE__ */ h(Ke, { element: "span", variant: "body-small", className: H.select__listbox__option__text, children: o })
|
|
833
832
|
]
|
|
834
833
|
}
|
|
835
834
|
);
|
|
836
835
|
}, xt = (n) => {
|
|
837
|
-
const { children: o,
|
|
836
|
+
const { children: o, className: u, onChange: a, ...r } = n;
|
|
838
837
|
return /* @__PURE__ */ h(
|
|
839
838
|
De,
|
|
840
839
|
{
|
|
841
840
|
...r,
|
|
842
841
|
onChange: (p, f) => {
|
|
843
|
-
|
|
842
|
+
a == null || a(f, p);
|
|
844
843
|
},
|
|
845
|
-
className:
|
|
844
|
+
className: Ve(H.select, u),
|
|
846
845
|
slots: { root: ze },
|
|
847
846
|
slotProps: {
|
|
848
|
-
listbox: { className:
|
|
849
|
-
popup: {
|
|
847
|
+
listbox: { className: H.select__listbox },
|
|
848
|
+
popup: { disablePortal: !0 }
|
|
850
849
|
},
|
|
851
|
-
"aria-labelledby": a,
|
|
852
850
|
children: o
|
|
853
851
|
}
|
|
854
852
|
);
|
|
855
853
|
};
|
|
856
854
|
xt.Option = ht;
|
|
857
855
|
export {
|
|
858
|
-
|
|
859
|
-
|
|
856
|
+
xt as Select,
|
|
857
|
+
ht as SelectOption
|
|
860
858
|
};
|
|
@@ -1,31 +1,22 @@
|
|
|
1
|
+
import { SelectProps } from './Select';
|
|
1
2
|
import { StoryObj } from '@storybook/react';
|
|
2
3
|
|
|
3
4
|
declare const meta: {
|
|
4
5
|
title: string;
|
|
5
6
|
component: {
|
|
6
|
-
(props:
|
|
7
|
-
|
|
8
|
-
disabled?: boolean | undefined;
|
|
9
|
-
placeholder?: string | number | undefined;
|
|
10
|
-
ariaLabelledby?: string | undefined;
|
|
11
|
-
onChange?: ((value: string | number | null, event?: import('react').SyntheticEvent<Element, Event> | null | undefined) => void) | undefined;
|
|
12
|
-
className?: string | undefined;
|
|
13
|
-
'data-testid'?: string | undefined;
|
|
14
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
Option: (props: {
|
|
16
|
-
disabled?: boolean | undefined;
|
|
17
|
-
value: string | number;
|
|
18
|
-
children: import('react').ReactNode;
|
|
19
|
-
icon?: import('react').ReactNode;
|
|
20
|
-
className?: string | undefined;
|
|
21
|
-
'data-testid'?: string | undefined;
|
|
22
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Option: (props: import('./Select').SelectOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
9
|
};
|
|
24
10
|
tags: string[];
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
};
|
|
25
14
|
};
|
|
26
15
|
export default meta;
|
|
27
16
|
type Story = StoryObj<typeof meta>;
|
|
28
17
|
export declare const Simple: Story;
|
|
29
|
-
export declare const
|
|
18
|
+
export declare const WithAllOptionsDisabled: Story;
|
|
19
|
+
export declare const WithSomeOptionsDisabled: Story;
|
|
30
20
|
export declare const WithPrefix: Story;
|
|
31
|
-
export declare const
|
|
21
|
+
export declare const WithIcons: Story;
|
|
22
|
+
export declare const WithManyOptions: Story;
|
|
@@ -1,65 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import "../Typography/Typography.js";
|
|
7
|
-
import "../IconButton/IconButton.js";
|
|
8
|
-
import { Select as i } from "./Select.js";
|
|
9
|
-
import "../Table/Table.js";
|
|
10
|
-
import "../Tabs/Tabs.js";
|
|
11
|
-
const r = (o) => /* @__PURE__ */ n.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...o }, /* @__PURE__ */ n.createElement("path", { d: "M0.512792 11.6594C0.139667 11.2516 0.167167 10.6184 0.574323 10.2447C0.766229 10.0688 1.00839 9.98175 1.24964 9.98175C1.52063 9.98175 1.79026 10.0912 1.98745 10.3064L2.99998 11.4406V2.00094C2.99998 1.44781 3.44779 1 3.99998 1C4.55217 1 4.99998 1.44781 4.99998 2.00094V11.4384L6.01248 10.3325C6.38748 9.92812 7.01873 9.89687 7.42498 10.2719C7.83216 10.6453 7.85935 11.2787 7.48651 11.6866L4.76463 14.6894C4.38588 15.1037 3.66901 15.1037 3.28995 14.6894L0.512792 11.6594Z", fill: "#1897F3" }), /* @__PURE__ */ n.createElement("path", { opacity: 0.4, d: "M9.99998 3H11.5859L9.29279 5.29313C9.00666 5.57925 8.92123 6.00906 9.07598 6.38313C9.23073 6.75719 9.59566 7 9.99973 7H13.9716C14.5531 6.97188 15 6.55313 15 6C15 5.44688 14.5522 5 14 5H12.414L14.7072 2.70688C14.9933 2.42075 15.0787 1.99094 14.924 1.61688C14.7692 1.24281 14.4031 1 13.9719 1H9.99998C9.44685 1 8.99998 1.44719 8.99998 2C8.99998 2.55281 9.44685 3 9.99998 3ZM15.3937 13.5406L12.894 8.5375C12.5553 7.85594 11.444 7.85594 11.1053 8.5375L8.6056 13.5406C8.35854 14.0378 8.55873 14.6419 9.05279 14.8903C9.54873 15.1379 10.1478 14.9365 10.3944 14.4403L10.6179 13.9906H13.3814L13.6049 14.4403C13.7979 14.8288 14.354 15.1863 14.9465 14.8903C15.4406 14.6438 15.6406 14.0375 15.3937 13.5406ZM11.4937 12.2313L12 11.2094L12.5069 12.2291H11.4937V12.2313Z", fill: "#1897F3" })), v = {
|
|
1
|
+
import { jsx as e, Fragment as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { useState as h } from "react";
|
|
4
|
+
import { Select as n } from "./Select.js";
|
|
5
|
+
const o = (t) => /* @__PURE__ */ d.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ d.createElement("path", { d: "M0.512792 11.6594C0.139667 11.2516 0.167167 10.6184 0.574323 10.2447C0.766229 10.0688 1.00839 9.98175 1.24964 9.98175C1.52063 9.98175 1.79026 10.0912 1.98745 10.3064L2.99998 11.4406V2.00094C2.99998 1.44781 3.44779 1 3.99998 1C4.55217 1 4.99998 1.44781 4.99998 2.00094V11.4384L6.01248 10.3325C6.38748 9.92812 7.01873 9.89687 7.42498 10.2719C7.83216 10.6453 7.85935 11.2787 7.48651 11.6866L4.76463 14.6894C4.38588 15.1037 3.66901 15.1037 3.28995 14.6894L0.512792 11.6594Z", fill: "#1897F3" }), /* @__PURE__ */ d.createElement("path", { opacity: 0.4, d: "M9.99998 3H11.5859L9.29279 5.29313C9.00666 5.57925 8.92123 6.00906 9.07598 6.38313C9.23073 6.75719 9.59566 7 9.99973 7H13.9716C14.5531 6.97188 15 6.55313 15 6C15 5.44688 14.5522 5 14 5H12.414L14.7072 2.70688C14.9933 2.42075 15.0787 1.99094 14.924 1.61688C14.7692 1.24281 14.4031 1 13.9719 1H9.99998C9.44685 1 8.99998 1.44719 8.99998 2C8.99998 2.55281 9.44685 3 9.99998 3ZM15.3937 13.5406L12.894 8.5375C12.5553 7.85594 11.444 7.85594 11.1053 8.5375L8.6056 13.5406C8.35854 14.0378 8.55873 14.6419 9.05279 14.8903C9.54873 15.1379 10.1478 14.9365 10.3944 14.4403L10.6179 13.9906H13.3814L13.6049 14.4403C13.7979 14.8288 14.354 15.1863 14.9465 14.8903C15.4406 14.6438 15.6406 14.0375 15.3937 13.5406ZM11.4937 12.2313L12 11.2094L12.5069 12.2291H11.4937V12.2313Z", fill: "#1897F3" })), g = {
|
|
12
6
|
title: "Components/Select",
|
|
13
|
-
component:
|
|
14
|
-
tags: ["autodocs"]
|
|
15
|
-
|
|
7
|
+
component: n,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "padded"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
function c(t) {
|
|
14
|
+
const [l, s] = h(""), p = [
|
|
15
|
+
{ id: "1", name: "Frodo" },
|
|
16
|
+
{ id: "2", name: "Sam" },
|
|
17
|
+
{ id: "3", name: "Merry" },
|
|
18
|
+
{ id: "4", name: "Pippin" }
|
|
19
|
+
];
|
|
20
|
+
return /* @__PURE__ */ a(r, { children: [
|
|
21
|
+
/* @__PURE__ */ e(n, { ...t, value: l, onChange: (i) => s(i), children: p.map((i) => /* @__PURE__ */ e(n.Option, { value: i.id, children: i.name }, i.id)) }),
|
|
22
|
+
l && /* @__PURE__ */ a("pre", { style: { borderRadius: 4, background: "#fafafa", padding: 16, color: "#777777" }, children: [
|
|
23
|
+
"// selected character",
|
|
24
|
+
/* @__PURE__ */ e("br", {}),
|
|
25
|
+
JSON.stringify(
|
|
26
|
+
p.find((i) => i.id === l),
|
|
27
|
+
null,
|
|
28
|
+
4
|
|
29
|
+
)
|
|
30
|
+
] })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
const f = {
|
|
34
|
+
args: {
|
|
35
|
+
placeholder: "Select an option"
|
|
36
|
+
},
|
|
37
|
+
render: c
|
|
38
|
+
}, S = {
|
|
39
|
+
name: "With all options disabled",
|
|
40
|
+
args: {
|
|
41
|
+
placeholder: "Select an option",
|
|
42
|
+
disabled: !0
|
|
43
|
+
},
|
|
44
|
+
render: c
|
|
45
|
+
}, v = {
|
|
46
|
+
name: "With some options disabled",
|
|
16
47
|
args: {
|
|
17
48
|
placeholder: "Select an option",
|
|
18
|
-
children: /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */ e(
|
|
20
|
-
/* @__PURE__ */ e(
|
|
21
|
-
/* @__PURE__ */ e(
|
|
22
|
-
/* @__PURE__ */ e(
|
|
49
|
+
children: /* @__PURE__ */ a(r, { children: [
|
|
50
|
+
/* @__PURE__ */ e(n.Option, { value: "1", disabled: !0, children: "Frodo" }),
|
|
51
|
+
/* @__PURE__ */ e(n.Option, { value: "2", children: "Sam" }),
|
|
52
|
+
/* @__PURE__ */ e(n.Option, { value: "3", disabled: !0, children: "Merry" }),
|
|
53
|
+
/* @__PURE__ */ e(n.Option, { value: "4", children: "Pippin" })
|
|
23
54
|
] })
|
|
24
55
|
}
|
|
25
|
-
},
|
|
56
|
+
}, O = {
|
|
57
|
+
name: "With prefix",
|
|
26
58
|
args: {
|
|
27
59
|
placeholder: "Select an option",
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
] }),
|
|
34
|
-
disabled: !0
|
|
35
|
-
}
|
|
36
|
-
}, S = {
|
|
60
|
+
prefix: "Filter by:"
|
|
61
|
+
},
|
|
62
|
+
render: c
|
|
63
|
+
}, y = {
|
|
64
|
+
name: "With icons",
|
|
37
65
|
args: {
|
|
38
66
|
placeholder: "Select an option",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/* @__PURE__ */ e(
|
|
42
|
-
/* @__PURE__ */ e(
|
|
43
|
-
/* @__PURE__ */ e(
|
|
44
|
-
/* @__PURE__ */ e(i.Option, { value: "4", children: "Pippin" })
|
|
67
|
+
children: /* @__PURE__ */ a(r, { children: [
|
|
68
|
+
/* @__PURE__ */ e(n.Option, { value: "1", icon: /* @__PURE__ */ e(o, {}), children: "Frodo" }),
|
|
69
|
+
/* @__PURE__ */ e(n.Option, { value: "2", icon: /* @__PURE__ */ e(o, {}), children: "Sam" }),
|
|
70
|
+
/* @__PURE__ */ e(n.Option, { value: "3", icon: /* @__PURE__ */ e(o, {}), children: "Merry" }),
|
|
71
|
+
/* @__PURE__ */ e(n.Option, { value: "4", icon: /* @__PURE__ */ e(o, {}), children: "Pippin" })
|
|
45
72
|
] })
|
|
46
73
|
}
|
|
47
|
-
},
|
|
74
|
+
}, L = {
|
|
75
|
+
name: "With many options",
|
|
48
76
|
args: {
|
|
49
77
|
placeholder: "Select an option",
|
|
50
|
-
|
|
51
|
-
children: /* @__PURE__ */ l(t, { children: [
|
|
52
|
-
/* @__PURE__ */ e(i.Option, { value: "1", disabled: !0, children: "Frodo" }),
|
|
53
|
-
/* @__PURE__ */ e(i.Option, { value: "2", icon: /* @__PURE__ */ e(r, {}), children: "Sam" }),
|
|
54
|
-
/* @__PURE__ */ e(i.Option, { value: "3", disabled: !0, children: "Mery" }),
|
|
55
|
-
/* @__PURE__ */ e(i.Option, { value: "4", children: "Pippin" })
|
|
56
|
-
] })
|
|
78
|
+
children: /* @__PURE__ */ e(r, { children: [...Array(20).keys()].map((t) => /* @__PURE__ */ e(n.Option, { value: String(t + 1), children: `Item #${t + 1}` })) })
|
|
57
79
|
}
|
|
58
80
|
};
|
|
59
81
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
f as Simple,
|
|
83
|
+
S as WithAllOptionsDisabled,
|
|
84
|
+
y as WithIcons,
|
|
85
|
+
L as WithManyOptions,
|
|
86
|
+
O as WithPrefix,
|
|
87
|
+
v as WithSomeOptionsDisabled,
|
|
88
|
+
g as default
|
|
65
89
|
};
|
|
@@ -5,9 +5,8 @@ export interface SelectButtonProps {
|
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
'aria-expanded': boolean;
|
|
8
|
-
|
|
9
|
-
type?: HTMLButtonElement['type'];
|
|
10
|
-
onClick: () => void;
|
|
8
|
+
prefix?: string;
|
|
11
9
|
'data-testid'?: string;
|
|
10
|
+
onClick: () => void;
|
|
12
11
|
}
|
|
13
|
-
export declare const
|
|
12
|
+
export declare const SelectButton: import('react').ForwardRefExoticComponent<SelectButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../clsx-DB4S2d7J.js";
|
|
4
4
|
import "../Typography/Typography.js";
|
|
5
|
-
import {
|
|
5
|
+
import { S as e } from "../../SelectButton-DWZ2BRaX.js";
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
e as SelectButton
|
|
8
8
|
};
|
package/dist/main.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Chip as
|
|
1
|
+
import { Chip as e } from "./components/Chip/Chip.js";
|
|
2
2
|
import { Advice as p } from "./components/Advice/Advice.js";
|
|
3
3
|
import { Button as f } from "./components/Button/Button.js";
|
|
4
4
|
import { Checkbox as n } from "./components/Checkbox/Checkbox.js";
|
|
5
5
|
import { Dialog as l } from "./components/Dialog/Dialog.js";
|
|
6
|
-
import { FamilyAndIcons as T, Icon as
|
|
7
|
-
import { IconButton as
|
|
8
|
-
import { Input as
|
|
6
|
+
import { FamilyAndIcons as T, Icon as c } from "./components/Icon/Icon.js";
|
|
7
|
+
import { IconButton as S } from "./components/IconButton/IconButton.js";
|
|
8
|
+
import { Input as u } from "./components/Input/Input.js";
|
|
9
9
|
import { InputSearch as d } from "./components/InputSearch/InputSearch.js";
|
|
10
10
|
import { LoadingSpinner as I } from "./components/LoadingSpinner/LoadingSpinner.js";
|
|
11
11
|
import { PageHeader as C } from "./components/PageHeader/PageHeader.js";
|
|
12
12
|
import { Pagination as y, paginationDefaultTranslations as A } from "./components/Pagination/Pagination.js";
|
|
13
|
-
import {
|
|
13
|
+
import { Select as B, SelectOption as v } from "./components/Select/Select.js";
|
|
14
14
|
import { Skeleton as H, SkeletonCircle as L, SkeletonTable as O } from "./components/Skeleton/Skeleton.js";
|
|
15
15
|
import { Snackbar as q } from "./components/Snackbar/Snackbar.js";
|
|
16
16
|
import { SortTooltip as z, sortTooltipDefaultTranslations as E } from "./components/SortTooltip/SortTooltip.js";
|
|
@@ -22,28 +22,28 @@ import { Tooltip as W } from "./components/Tooltip/Tooltip.js";
|
|
|
22
22
|
import { Typography as Y } from "./components/Typography/Typography.js";
|
|
23
23
|
import { default as _ } from "./components/Dialog/Title.js";
|
|
24
24
|
import { default as oo } from "./components/Dialog/Content.js";
|
|
25
|
-
import { default as
|
|
25
|
+
import { default as eo } from "./components/Dialog/Actions.js";
|
|
26
26
|
import { Tab as po } from "./components/Tabs/Tab.js";
|
|
27
27
|
import { TabPanel as fo } from "./components/Tabs/TabPanel.js";
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
eo as Actions,
|
|
30
30
|
p as Advice,
|
|
31
31
|
f as Button,
|
|
32
32
|
n as Checkbox,
|
|
33
|
-
|
|
33
|
+
e as Chip,
|
|
34
34
|
oo as Content,
|
|
35
35
|
l as Dialog,
|
|
36
36
|
_ as DialogTitle,
|
|
37
37
|
T as FamilyAndIcons,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
c as Icon,
|
|
39
|
+
S as IconButton,
|
|
40
|
+
u as Input,
|
|
41
41
|
d as InputSearch,
|
|
42
42
|
I as LoadingSpinner,
|
|
43
|
-
B as Option,
|
|
44
43
|
C as PageHeader,
|
|
45
44
|
y as Pagination,
|
|
46
|
-
|
|
45
|
+
B as Select,
|
|
46
|
+
v as SelectOption,
|
|
47
47
|
H as Skeleton,
|
|
48
48
|
L as SkeletonCircle,
|
|
49
49
|
O as SkeletonTable,
|
package/package.json
CHANGED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import './assets/SelectButton.css';
|
|
2
|
-
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as o from "react";
|
|
4
|
-
import { forwardRef as x } from "react";
|
|
5
|
-
import { c as p } from "./clsx-DB4S2d7J.js";
|
|
6
|
-
import { Typography as w } from "./components/Typography/Typography.js";
|
|
7
|
-
const d = "_select_yw431_1", m = "_select__listbox_yw431_4", u = "_select__listbox__option_yw431_12", y = "_select__listbox__option__icon_yw431_20", h = "_select__listbox__option__text_yw431_24", C = "_select__list__option__icon_yw431_44", _ = {
|
|
8
|
-
select: d,
|
|
9
|
-
select__listbox: m,
|
|
10
|
-
select__listbox__option: u,
|
|
11
|
-
select__listbox__option__icon: y,
|
|
12
|
-
select__listbox__option__text: h,
|
|
13
|
-
"select__listbox__option--disabled": "_select__listbox__option--disabled_yw431_27",
|
|
14
|
-
"select__listbox__option--selected": "_select__listbox__option--selected_yw431_36",
|
|
15
|
-
select__list__option__icon: C,
|
|
16
|
-
"select-button": "_select-button_yw431_49",
|
|
17
|
-
"select-button__text": "_select-button__text_yw431_62",
|
|
18
|
-
"select-button__text__prefix": "_select-button__text__prefix_yw431_69",
|
|
19
|
-
"select-button__icon": "_select-button__icon_yw431_72",
|
|
20
|
-
"select-button--active": "_select-button--active_yw431_78"
|
|
21
|
-
}, f = (t) => /* @__PURE__ */ o.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ o.createElement("path", { d: "M2.11104 4.9999C2.36691 4.9999 2.62291 5.09756 2.81791 5.29287L8.11104 10.5843L13.4048 5.29053C13.7954 4.8999 14.4282 4.8999 14.8188 5.29053C15.2095 5.68115 15.2095 6.31396 14.8188 6.70459L8.81885 12.7046C8.42822 13.0952 7.79541 13.0952 7.40479 12.7046L1.40479 6.70459C1.01416 6.31396 1.01416 5.68115 1.40479 5.29053C1.59854 5.09678 1.85479 4.9999 2.11104 4.9999Z", fill: "currentColor" })), v = (t) => /* @__PURE__ */ o.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ o.createElement("path", { d: "M13.8889 11C13.633 11 13.377 10.9023 13.182 10.707L7.8889 5.41563L2.59515 10.7094C2.20453 11.1 1.57172 11.1 1.18109 10.7094C0.790466 10.3188 0.790466 9.68594 1.18109 9.29532L7.18109 3.29532C7.57172 2.90469 8.20453 2.90469 8.59515 3.29532L14.5952 9.29532C14.9858 9.68594 14.9858 10.3188 14.5952 10.7094C14.4014 10.9031 14.1452 11 13.8889 11Z", fill: "#3F3D4B", fillOpacity: 0.88 })), E = x((t, c) => {
|
|
22
|
-
const { children: n, type: i = "button", disabled: a, className: b, "data-testid": r } = t, s = t["aria-expanded"];
|
|
23
|
-
return /* @__PURE__ */ l(
|
|
24
|
-
"button",
|
|
25
|
-
{
|
|
26
|
-
className: p(b, s ? _["select-button--active"] : "", _["select-button"]),
|
|
27
|
-
type: i,
|
|
28
|
-
onClick: t.onClick,
|
|
29
|
-
disabled: a,
|
|
30
|
-
"data-testid": r,
|
|
31
|
-
ref: c,
|
|
32
|
-
children: [
|
|
33
|
-
/* @__PURE__ */ l("span", { className: _["select-button__text"], children: [
|
|
34
|
-
/* @__PURE__ */ e("span", { className: _["select-button__text__prefix"], children: t["aria-labelledby"] }),
|
|
35
|
-
/* @__PURE__ */ e(w, { element: "span", variant: "body-small", className: _["select-button__text__content"], children: n })
|
|
36
|
-
] }),
|
|
37
|
-
/* @__PURE__ */ e("span", { className: _["select-button__icon"], children: s ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(f, {}) })
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
});
|
|
42
|
-
export {
|
|
43
|
-
E as B,
|
|
44
|
-
_ as s
|
|
45
|
-
};
|