@wrdagency/blockout 1.0.19 → 1.0.21
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { SelectProps } from './props';
|
|
3
|
-
export declare const Select: <T extends string = string>({ value, onChangeValue, options: unnormalizedOptions, searchable, combobox, placeholder, prefix, suffix, children, withIcon, ...restControlProps }: SelectProps<T> & PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const Select: <T extends string = string>({ className, value, onChangeValue, options: unnormalizedOptions, searchable, combobox, placeholder, prefix, suffix, children, withIcon, ...restControlProps }: SelectProps<T> & PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,76 +1,79 @@
|
|
|
1
1
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { cn as
|
|
2
|
+
import { cn as L } from "../../../utils/css.js";
|
|
3
3
|
import '../../../assets/style16.css';import '../../../assets/styles.css';import '../../../assets/style6.css';import '../../../assets/style5.css';import '../../../assets/style4.css';import '../../../assets/style3.css';import '../../../assets/style2.css';import '../../../assets/style.css';import '../../../assets/style10.css';import '../../../assets/style7.css';/* empty css */
|
|
4
|
-
import { noop as
|
|
5
|
-
import { useState as _, useMemo as
|
|
4
|
+
import { noop as g } from "../../../utils/noop.js";
|
|
5
|
+
import { useState as _, useMemo as j, startTransition as y } from "react";
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
9
|
import "../../../primitives/popover/index.js";
|
|
10
10
|
/* empty css */
|
|
11
|
-
import { ScrollArea as
|
|
11
|
+
import { ScrollArea as k } from "../../../primitives/scroll-area/index.js";
|
|
12
12
|
import "../../../primitives/symbol/index.js";
|
|
13
13
|
/* empty css */
|
|
14
14
|
/* empty css */
|
|
15
15
|
/* empty css */
|
|
16
16
|
/* empty css */
|
|
17
|
-
import { normalizeOption as
|
|
18
|
-
import { s as
|
|
19
|
-
import { m as
|
|
17
|
+
import { normalizeOption as z } from "../../../types/options.js";
|
|
18
|
+
import { s as A } from "../../../MagnifyingGlass.es-CLstwG_v.js";
|
|
19
|
+
import { m as H } from "../../../match-sorter.esm-MNVE8H_6.js";
|
|
20
20
|
/* empty css */
|
|
21
|
-
import { C as
|
|
22
|
-
import { S as
|
|
23
|
-
const
|
|
21
|
+
import { C as M, a as h, b as T, c as $, d as f } from "../../../combobox-popover-DFcT6u90.js";
|
|
22
|
+
import { S as q, a as B, b as D, c as E, d as F } from "../../../select-popover-BuB2Ioa9.js";
|
|
23
|
+
const ue = ({
|
|
24
|
+
className: u,
|
|
24
25
|
value: r,
|
|
25
|
-
onChangeValue: p =
|
|
26
|
-
options:
|
|
26
|
+
onChangeValue: p = g,
|
|
27
|
+
options: v,
|
|
27
28
|
searchable: i = !1,
|
|
28
29
|
combobox: t = !1,
|
|
29
|
-
placeholder:
|
|
30
|
-
prefix:
|
|
31
|
-
suffix:
|
|
32
|
-
children:
|
|
33
|
-
withIcon:
|
|
34
|
-
...
|
|
30
|
+
placeholder: S = "Choose an option...",
|
|
31
|
+
prefix: G,
|
|
32
|
+
suffix: J,
|
|
33
|
+
children: N,
|
|
34
|
+
withIcon: K,
|
|
35
|
+
...P
|
|
35
36
|
}) => {
|
|
36
37
|
t && (i = !0);
|
|
37
|
-
const [
|
|
38
|
-
baseSort: (e,
|
|
38
|
+
const [n, a] = _(!1), [c, O] = _(""), l = (v || []).map(z), m = j(() => H(l, c, {
|
|
39
|
+
baseSort: (e, x) => e.index < x.index ? -1 : 1,
|
|
39
40
|
keys: ["label", "description"]
|
|
40
|
-
}), [
|
|
41
|
+
}), [c]), w = i || t ? $ : E, C = t ? f : F, I = t ? h : B, V = t ? T : D, d = !!!l.find((e) => e.value === r);
|
|
41
42
|
return /* @__PURE__ */ o(
|
|
42
|
-
|
|
43
|
+
M,
|
|
43
44
|
{
|
|
44
45
|
resetValueOnHide: !t,
|
|
45
|
-
open:
|
|
46
|
-
setOpen:
|
|
47
|
-
value: t ? r :
|
|
46
|
+
open: n,
|
|
47
|
+
setOpen: a,
|
|
48
|
+
value: t ? r : c,
|
|
48
49
|
setValue: (e) => {
|
|
49
|
-
t && p(e),
|
|
50
|
-
|
|
50
|
+
t && p(e), y(() => {
|
|
51
|
+
O(e);
|
|
51
52
|
});
|
|
52
53
|
},
|
|
53
54
|
children: /* @__PURE__ */ s(
|
|
54
|
-
|
|
55
|
+
q,
|
|
55
56
|
{
|
|
56
57
|
value: d ? "" : r,
|
|
57
58
|
setValue: p,
|
|
58
|
-
open:
|
|
59
|
-
setOpen:
|
|
59
|
+
open: n,
|
|
60
|
+
setOpen: a,
|
|
60
61
|
children: [
|
|
61
62
|
/* @__PURE__ */ o(
|
|
62
|
-
|
|
63
|
+
I,
|
|
63
64
|
{
|
|
64
|
-
className:
|
|
65
|
+
className: L(
|
|
66
|
+
u,
|
|
65
67
|
"component-select__input",
|
|
66
68
|
d && "component-select__input--placeholder"
|
|
67
69
|
),
|
|
68
|
-
children: t ? void 0 :
|
|
69
|
-
|
|
70
|
+
children: t ? void 0 : N,
|
|
71
|
+
placeholder: S,
|
|
72
|
+
...P
|
|
70
73
|
}
|
|
71
74
|
),
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
n && m.length > 0 && /* @__PURE__ */ o(
|
|
76
|
+
V,
|
|
74
77
|
{
|
|
75
78
|
className: "component-select__popover",
|
|
76
79
|
"data-colour-scheme": "invert",
|
|
@@ -81,9 +84,9 @@ const fe = ({
|
|
|
81
84
|
gutter: 8,
|
|
82
85
|
overflowPadding: 4,
|
|
83
86
|
shift: -1,
|
|
84
|
-
children: /* @__PURE__ */ s(
|
|
87
|
+
children: /* @__PURE__ */ s(k, { className: "component-select__popover__scroll", axis: "y", children: [
|
|
85
88
|
i && !t && /* @__PURE__ */ s("div", { className: "component-select__popover__search-wrapper", children: [
|
|
86
|
-
/* @__PURE__ */ o(
|
|
89
|
+
/* @__PURE__ */ o(A, { className: "component-select__popover__search-icon" }),
|
|
87
90
|
/* @__PURE__ */ o(
|
|
88
91
|
h,
|
|
89
92
|
{
|
|
@@ -93,8 +96,8 @@ const fe = ({
|
|
|
93
96
|
}
|
|
94
97
|
)
|
|
95
98
|
] }),
|
|
96
|
-
/* @__PURE__ */ o(
|
|
97
|
-
|
|
99
|
+
/* @__PURE__ */ o(w, { className: "component-select__list", children: m.map((e) => /* @__PURE__ */ s(
|
|
100
|
+
C,
|
|
98
101
|
{
|
|
99
102
|
disabled: e.disabled,
|
|
100
103
|
value: e.value,
|
|
@@ -120,5 +123,5 @@ const fe = ({
|
|
|
120
123
|
);
|
|
121
124
|
};
|
|
122
125
|
export {
|
|
123
|
-
|
|
126
|
+
ue as Select
|
|
124
127
|
};
|