welcome-ui 10.3.3 → 10.3.4
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/Search.css +1 -1
- package/dist/Search.js +102 -100
- package/package.json +1 -1
package/dist/Search.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.
|
|
1
|
+
@charset "UTF-8";@layer components{._wrapper_5psb0_3{position:relative}._indicators_5psb0_6{position:absolute;padding:0;top:0;height:var(--searchHeight, 100%);right:var(--indicatorsRight, var(--searchPaddingInline));display:flex;gap:var(--border-radius-sm)}._dropdown-indicator_5psb0_15{position:relative;height:100%;width:var(--searchClearSize);padding:0;outline:none!important;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;background:transparent;display:flex;align-items:center;justify-content:center}._input-wrapper_5psb0_28{position:relative}._input-wrapper_5psb0_28:has(>._icon-placement-right_5psb0_31) ._indicators_5psb0_6{--indicatorsRight: calc(var(--searchPaddingInline) + var(--searchIconSize, var(--size-icon-md)))}._root_5psb0_34{border-radius:var(--input-border-radius);border-style:solid;border-width:var(--input-border-width-default);font-size:var(--font-size-sm);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-md);outline:none;width:100%;transition:var(--duration-medium);-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:default;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background-color:var(--searchBackgroundColor, var(--input-color-background-default));color:var(--searchColor, var(--input-color-text-default));border-color:var(--searchBorderColor, var(--input-color-border-default));box-shadow:var(--searchBoxShadow, var(--inset-10)) inset;height:var(--searchHeight);padding-inline:var(--searchPaddingInline);padding-block:var(--searchPaddingBlock)}._root_5psb0_34._icon-placement-left_5psb0_61{padding-left:calc(var(--searchPaddingInline) * 2 + var(--searchIconSize, var(--size-icon-md)))}._root_5psb0_34._icon-placement-right_5psb0_31{padding-right:calc(var(--searchPaddingInline) * 2 + var(--searchIconSize, var(--size-icon-md)) + var(--button-size-icon-sm))}._root_5psb0_34:not(._icon-placement-right_5psb0_31):not(:placeholder-shown){padding-right:calc(var(--searchPaddingInline) * 2 + var(--button-size-icon-sm))}._root_5psb0_34:disabled,._root_5psb0_34[aria-disabled]{--searchBackgroundColor: var( --searchBackgroundColorDisabled, var(--input-color-background-disabled) );--searchColor: var(--input-color-text-disabled);cursor:not-allowed}._root_5psb0_34:hover:not(:disabled):not([aria-disabled]){--borderColor: var(--borderColorHover, var(--color-border-neutral-subtlest));--searchBoxShadow: var(--inset-20)}._root_5psb0_34:active,._root_5psb0_34:focus{--searchBorderColor: var(--input-color-border-focused)}._root_5psb0_34::placeholder{color:var(--input-color-text-placeholder)}._root_5psb0_34 br{display:none}._variant-danger_5psb0_91{--searchBorderColor: var(--input-color-border-error)}._variant-warning_5psb0_94{--searchBorderColor: var(--input-color-border-warning)}._variant-success_5psb0_97{--searchBorderColor: var(--input-color-border-success)}._transparent_5psb0_100{--borderColor: transparent;--searchBackgroundColor: var(--input-color-background-transparent);--borderColorHover: var(--input-color-border-hover-transparent)}._size-lg_5psb0_105{--searchHeight: var(--input-max-height-lg);--searchPaddingBlock: var(--input-padding-block-lg);--searchPaddingInline: var(--input-padding-inline-lg);--searchIconSize: var(--size-icon-lg)}._size-md_5psb0_111{--searchHeight: var(--input-max-height-md);--searchPaddingBlock: var(--input-padding-block-md);--searchPaddingInline: var(--input-padding-inline-md);--searchIconSize: var(--size-icon-md)}._size-sm_5psb0_117{--searchHeight: var(--input-max-height-sm);--searchPaddingBlock: var(--input-padding-block-sm);--searchPaddingInline: var(--input-padding-inline-sm);--searchIconSize: var(--size-icon-sm)}._icon-wrapper_5psb0_123{position:absolute;top:0;bottom:0;left:var(--searchIconLeft);right:var(--searchIconRight);display:flex;justify-content:center;align-items:center;pointer-events:none;transition:var(--duration-medium);transition-timing-function:var(--timing-primary);color:var(--searchIconColor, var(--input-color-icon-placeholder));gap:var(--input-padding-block-sm);--searchIconLeft: auto;--searchIconRight: auto}._icon-wrapper_5psb0_123>button{pointer-events:auto}._icon-wrapper_5psb0_123._disabled_5psb0_144{--searchIconColor: var(--input-color-icon-disabled)}._icon-placement-left-sm_5psb0_147{--searchIconLeft: var(--input-padding-inline-sm)}._icon-placement-left-md_5psb0_150{--searchIconLeft: var(--input-padding-inline-md)}._icon-placement-left-lg_5psb0_153{--searchIconLeft: var(--input-padding-inline-lg)}._icon-placement-right-sm_5psb0_156{--searchIconRight: var(--input-padding-inline-sm)}._icon-placement-right-md_5psb0_159{--searchIconRight: var(--input-padding-inline-md)}._icon-placement-right-lg_5psb0_162{--searchIconRight: var(--input-padding-inline-lg)}._menu_5psb0_165{max-height:9.6875rem;background-color:var(--color-background-neutral-inverse-fixed);border-color:var(--color-background-neutral-subtlest);border-radius:var(--border-radius-md);border-style:solid;border-width:var(--border-width-xs);box-shadow:var(--elevation-20);color:var(--color-background-neutral-primary-fixed);font-size:var(--font-size-14);font-weight:var(--font-weight-regular);line-height:var(--border-radius-xl);outline:none;position:absolute;z-index:2;right:0;left:0;margin-top:var(--border-radius-lg);transition-property:all;transition-timing-function:var(--timing-primary);transition-duration:var(--duration-medium);overflow:hidden}._menu_5psb0_165:hover>*{cursor:pointer}._menu-scroller_5psb0_191{max-height:inherit;overflow-y:auto;-webkit-overflow-scrolling:touch;margin:0;padding:0}._item_5psb0_198{color:var(--itemTextColor, var(--color-icon-warm-tertiary));cursor:var(--itemCursor, default);padding:var(--border-radius-lg);list-style:none;text-decoration:none;font-size:var(--font-size-14);transition-property:background;transition-duration:var(--duration-medium);transition-timing-function:var(--timing-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._item_5psb0_198._highlighted_5psb0_212{background-color:var(--color-background-warm-primary)}._item_5psb0_198._selected_5psb0_215{--itemTextColor: var(--color-background-neutral-primary-fixed);font-weight:var(--font-weight-semi-bold)}._item_5psb0_198._selected_5psb0_215._highlighted_5psb0_212{background-image:linear-gradient(0deg,#00000014,#00000014)}}
|
package/dist/Search.js
CHANGED
|
@@ -1,101 +1,103 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Search.css';
|
|
3
|
-
import { jsx as t, jsxs as
|
|
3
|
+
import { jsx as t, jsxs as v } from "react/jsx-runtime";
|
|
4
4
|
import { D as M } from "./downshift.esm-xtYanIDi.js";
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import { CloseButton as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { c as
|
|
9
|
-
import { c as
|
|
5
|
+
import { forwardRef as oe, useState as pe, useCallback as _e, useMemo as de, Fragment as me } from "react";
|
|
6
|
+
import { CloseButton as he } from "./CloseButton.js";
|
|
7
|
+
import { Icon as ue } from "./Icon.js";
|
|
8
|
+
import { c as be } from "./index-PAaZGbyz.js";
|
|
9
|
+
import { c as fe } from "./create-event-rXDe5aCQ.js";
|
|
10
10
|
import { t as ge } from "./throttle-BDBzFeFj.js";
|
|
11
|
-
const we = "
|
|
11
|
+
const we = "_wrapper_5psb0_3", Ne = "_indicators_5psb0_6", ve = "_root_5psb0_34", Re = "_transparent_5psb0_100", Se = "_disabled_5psb0_144", Ie = "_menu_5psb0_165", xe = "_item_5psb0_198", Ce = "_highlighted_5psb0_212", $e = "_selected_5psb0_215", ke = {
|
|
12
12
|
wrapper: we,
|
|
13
13
|
indicators: Ne,
|
|
14
|
-
"dropdown-indicator": "_dropdown-
|
|
15
|
-
"input-wrapper": "_input-
|
|
16
|
-
"icon-placement-right": "_icon-placement-
|
|
14
|
+
"dropdown-indicator": "_dropdown-indicator_5psb0_15",
|
|
15
|
+
"input-wrapper": "_input-wrapper_5psb0_28",
|
|
16
|
+
"icon-placement-right": "_icon-placement-right_5psb0_31",
|
|
17
17
|
root: ve,
|
|
18
|
-
"icon-placement-left": "_icon-placement-
|
|
19
|
-
"variant-danger": "_variant-
|
|
20
|
-
"variant-warning": "_variant-
|
|
21
|
-
"variant-success": "_variant-
|
|
18
|
+
"icon-placement-left": "_icon-placement-left_5psb0_61",
|
|
19
|
+
"variant-danger": "_variant-danger_5psb0_91",
|
|
20
|
+
"variant-warning": "_variant-warning_5psb0_94",
|
|
21
|
+
"variant-success": "_variant-success_5psb0_97",
|
|
22
22
|
transparent: Re,
|
|
23
|
-
"size-lg": "_size-
|
|
24
|
-
"size-md": "_size-
|
|
25
|
-
"size-sm": "_size-
|
|
26
|
-
"icon-wrapper": "_icon-
|
|
23
|
+
"size-lg": "_size-lg_5psb0_105",
|
|
24
|
+
"size-md": "_size-md_5psb0_111",
|
|
25
|
+
"size-sm": "_size-sm_5psb0_117",
|
|
26
|
+
"icon-wrapper": "_icon-wrapper_5psb0_123",
|
|
27
27
|
disabled: Se,
|
|
28
|
-
"icon-placement-left-sm": "_icon-placement-left-
|
|
29
|
-
"icon-placement-left-md": "_icon-placement-left-
|
|
30
|
-
"icon-placement-
|
|
31
|
-
"icon-placement-right-
|
|
28
|
+
"icon-placement-left-sm": "_icon-placement-left-sm_5psb0_147",
|
|
29
|
+
"icon-placement-left-md": "_icon-placement-left-md_5psb0_150",
|
|
30
|
+
"icon-placement-left-lg": "_icon-placement-left-lg_5psb0_153",
|
|
31
|
+
"icon-placement-right-sm": "_icon-placement-right-sm_5psb0_156",
|
|
32
|
+
"icon-placement-right-md": "_icon-placement-right-md_5psb0_159",
|
|
33
|
+
"icon-placement-right-lg": "_icon-placement-right-lg_5psb0_162",
|
|
32
34
|
menu: Ie,
|
|
33
|
-
"menu-scroller": "_menu-
|
|
35
|
+
"menu-scroller": "_menu-scroller_5psb0_191",
|
|
34
36
|
item: xe,
|
|
35
37
|
highlighted: Ce,
|
|
36
|
-
selected:
|
|
37
|
-
}, j = "", n =
|
|
38
|
+
selected: $e
|
|
39
|
+
}, j = "", n = be(ke), ze = M.default || M, De = oe(
|
|
38
40
|
({
|
|
39
41
|
autoComplete: O = "off",
|
|
40
|
-
autoFocus:
|
|
41
|
-
className:
|
|
42
|
-
dataTestId:
|
|
43
|
-
disabled:
|
|
44
|
-
groupsEnabled:
|
|
45
|
-
icon:
|
|
46
|
-
iconPlacement:
|
|
42
|
+
autoFocus: V,
|
|
43
|
+
className: B,
|
|
44
|
+
dataTestId: G,
|
|
45
|
+
disabled: H,
|
|
46
|
+
groupsEnabled: P,
|
|
47
|
+
icon: d,
|
|
48
|
+
iconPlacement: m = "left",
|
|
47
49
|
id: Y,
|
|
48
50
|
itemToString: s,
|
|
49
|
-
minChars:
|
|
51
|
+
minChars: h = 3,
|
|
50
52
|
name: R,
|
|
51
53
|
onBlur: q,
|
|
52
|
-
onChange:
|
|
54
|
+
onChange: u,
|
|
53
55
|
onClick: A,
|
|
54
|
-
onFocus:
|
|
56
|
+
onFocus: b,
|
|
55
57
|
placeholder: J = "Search…",
|
|
56
58
|
renderGroupHeader: K,
|
|
57
59
|
renderItem: S,
|
|
58
60
|
search: I,
|
|
59
|
-
size:
|
|
61
|
+
size: a = "lg",
|
|
60
62
|
throttle: x = 500,
|
|
61
63
|
transparent: L,
|
|
62
|
-
value:
|
|
63
|
-
variant:
|
|
64
|
-
...
|
|
64
|
+
value: p = j,
|
|
65
|
+
variant: f,
|
|
66
|
+
...g
|
|
65
67
|
}, Q) => {
|
|
66
|
-
const U =
|
|
68
|
+
const U = p ? s(p) : j, [C, r] = pe([]), $ = _e(
|
|
67
69
|
async (e) => {
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
|
|
70
|
+
if (h === 0 || (e == null ? void 0 : e.length) >= h) {
|
|
71
|
+
const l = await I(e);
|
|
72
|
+
r(l || []);
|
|
71
73
|
} else
|
|
72
|
-
|
|
74
|
+
r([]);
|
|
73
75
|
},
|
|
74
|
-
[
|
|
75
|
-
),
|
|
76
|
-
() => ge(
|
|
77
|
-
[
|
|
78
|
-
),
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
e ?
|
|
76
|
+
[h, I]
|
|
77
|
+
), k = de(
|
|
78
|
+
() => ge($, x, !1),
|
|
79
|
+
[$, x]
|
|
80
|
+
), w = (e) => {
|
|
81
|
+
const l = fe({ name: R, value: e });
|
|
82
|
+
u == null || u(e, l);
|
|
83
|
+
}, z = (e) => {
|
|
84
|
+
e ? w(e) : (w(), r([]));
|
|
83
85
|
};
|
|
84
86
|
return /* @__PURE__ */ t(
|
|
85
|
-
|
|
87
|
+
ze,
|
|
86
88
|
{
|
|
87
89
|
initialInputValue: U,
|
|
88
90
|
itemToString: (e) => s(e) || "",
|
|
89
|
-
onInputValueChange:
|
|
91
|
+
onInputValueChange: k,
|
|
90
92
|
onOuterClick: () => {
|
|
91
|
-
|
|
93
|
+
p || z(), r([]);
|
|
92
94
|
},
|
|
93
|
-
onSelect:
|
|
94
|
-
selectedItem:
|
|
95
|
-
...
|
|
95
|
+
onSelect: z,
|
|
96
|
+
selectedItem: p,
|
|
97
|
+
...g,
|
|
96
98
|
children: ({
|
|
97
99
|
clearSelection: e,
|
|
98
|
-
getInputProps:
|
|
100
|
+
getInputProps: l,
|
|
99
101
|
getItemProps: D,
|
|
100
102
|
getMenuProps: W,
|
|
101
103
|
getRootProps: X,
|
|
@@ -106,14 +108,14 @@ const we = "_wrapper_f46oz_2", Ne = "_indicators_f46oz_5", ve = "_root_f46oz_33"
|
|
|
106
108
|
toggleMenu: ee
|
|
107
109
|
}) => {
|
|
108
110
|
const te = () => {
|
|
109
|
-
|
|
110
|
-
}, ne = T && C.length > 0, se = /* @__PURE__ */ t("div", { className: n("dropdown-indicator"), children: /* @__PURE__ */ t(
|
|
111
|
-
|
|
112
|
-
},
|
|
111
|
+
r([]), w(), e();
|
|
112
|
+
}, ne = T && C.length > 0, se = /* @__PURE__ */ t("div", { className: n("dropdown-indicator"), children: /* @__PURE__ */ t(he, { animatePresence: !0, onClick: te, title: "Clear" }) }), ie = (i) => {
|
|
113
|
+
b == null || b(i), k(""), ee();
|
|
114
|
+
}, ce = X(g, { suppressRefError: !0 }), ae = l({
|
|
113
115
|
autoComplete: O,
|
|
114
|
-
autoFocus:
|
|
115
|
-
"data-testid":
|
|
116
|
-
disabled:
|
|
116
|
+
autoFocus: V,
|
|
117
|
+
"data-testid": G,
|
|
118
|
+
disabled: H,
|
|
117
119
|
id: Y,
|
|
118
120
|
name: R,
|
|
119
121
|
onBlur: q,
|
|
@@ -121,72 +123,72 @@ const we = "_wrapper_f46oz_2", Ne = "_indicators_f46oz_5", ve = "_root_f46oz_33"
|
|
|
121
123
|
onFocus: ie,
|
|
122
124
|
placeholder: J,
|
|
123
125
|
ref: Q,
|
|
124
|
-
size:
|
|
126
|
+
size: a,
|
|
125
127
|
tabIndex: 0,
|
|
126
|
-
variant: T ? "focused" :
|
|
127
|
-
...
|
|
128
|
+
variant: T ? "focused" : f,
|
|
129
|
+
...g
|
|
128
130
|
});
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
+
return /* @__PURE__ */ v("div", { ...ce, className: n("wrapper", "field-input"), children: [
|
|
132
|
+
/* @__PURE__ */ v("div", { className: n("input-wrapper"), children: [
|
|
131
133
|
/* @__PURE__ */ t(
|
|
132
134
|
"input",
|
|
133
135
|
{
|
|
134
136
|
className: n(
|
|
135
137
|
"root",
|
|
136
|
-
`size-${
|
|
137
|
-
|
|
138
|
+
`size-${a}`,
|
|
139
|
+
f && `variant-${f}`,
|
|
138
140
|
L && "transparent",
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
d && `icon-placement-${m}`,
|
|
142
|
+
B
|
|
141
143
|
),
|
|
142
|
-
...
|
|
144
|
+
...ae
|
|
143
145
|
}
|
|
144
146
|
),
|
|
145
|
-
|
|
147
|
+
d ? /* @__PURE__ */ t(
|
|
146
148
|
"div",
|
|
147
149
|
{
|
|
148
150
|
className: n(
|
|
149
151
|
"icon-wrapper",
|
|
150
|
-
`icon-placement-${
|
|
151
|
-
`
|
|
152
|
+
`icon-placement-${m}`,
|
|
153
|
+
`icon-placement-${m}-${a}`
|
|
152
154
|
),
|
|
153
|
-
children: /* @__PURE__ */ t(
|
|
155
|
+
children: /* @__PURE__ */ t(ue, { ...d.props, size: a })
|
|
154
156
|
}
|
|
155
157
|
) : null,
|
|
156
|
-
/* @__PURE__ */ t("div", { className: n("indicators", `size-${
|
|
158
|
+
/* @__PURE__ */ t("div", { className: n("indicators", `size-${a}`), children: F ? se : null })
|
|
157
159
|
] }),
|
|
158
160
|
ne ? /* @__PURE__ */ t("div", { className: n("menu"), children: /* @__PURE__ */ t("ul", { className: n("menu-scroller"), ...W(), children: C.reduce(
|
|
159
|
-
(i,
|
|
161
|
+
(i, c, N) => {
|
|
160
162
|
const y = i.itemIndex++, E = Z === y;
|
|
161
|
-
if (
|
|
163
|
+
if (P)
|
|
162
164
|
i.itemsToRender.push(
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
K(
|
|
165
|
-
|
|
166
|
-
(
|
|
167
|
-
const
|
|
165
|
+
/* @__PURE__ */ v(me, { children: [
|
|
166
|
+
K(c),
|
|
167
|
+
c.options ? c.options.map(
|
|
168
|
+
(o, re) => {
|
|
169
|
+
const le = _ && s(_) === s(o);
|
|
168
170
|
return /* @__PURE__ */ t(
|
|
169
171
|
"li",
|
|
170
172
|
{
|
|
171
173
|
className: n(
|
|
172
174
|
"item",
|
|
173
175
|
E && "highlighted",
|
|
174
|
-
|
|
176
|
+
le && "selected"
|
|
175
177
|
),
|
|
176
178
|
...D({
|
|
177
179
|
index: y,
|
|
178
|
-
item:
|
|
180
|
+
item: o
|
|
179
181
|
}),
|
|
180
|
-
children: S(
|
|
182
|
+
children: S(o)
|
|
181
183
|
},
|
|
182
184
|
re
|
|
183
185
|
);
|
|
184
186
|
}
|
|
185
187
|
) : null
|
|
186
|
-
] },
|
|
188
|
+
] }, N)
|
|
187
189
|
);
|
|
188
190
|
else {
|
|
189
|
-
const
|
|
191
|
+
const o = _ && s(_) === s(c);
|
|
190
192
|
i.itemsToRender.push(
|
|
191
193
|
/* @__PURE__ */ t(
|
|
192
194
|
"li",
|
|
@@ -194,15 +196,15 @@ const we = "_wrapper_f46oz_2", Ne = "_indicators_f46oz_5", ve = "_root_f46oz_33"
|
|
|
194
196
|
className: n(
|
|
195
197
|
"item",
|
|
196
198
|
E && "highlighted",
|
|
197
|
-
|
|
199
|
+
o && "selected"
|
|
198
200
|
),
|
|
199
201
|
...D({
|
|
200
|
-
index:
|
|
201
|
-
item:
|
|
202
|
+
index: N,
|
|
203
|
+
item: c
|
|
202
204
|
}),
|
|
203
|
-
children: S(
|
|
205
|
+
children: S(c)
|
|
204
206
|
},
|
|
205
|
-
|
|
207
|
+
N
|
|
206
208
|
)
|
|
207
209
|
);
|
|
208
210
|
}
|
|
@@ -219,5 +221,5 @@ const we = "_wrapper_f46oz_2", Ne = "_indicators_f46oz_5", ve = "_root_f46oz_33"
|
|
|
219
221
|
De.displayName = "Search";
|
|
220
222
|
export {
|
|
221
223
|
De as Search,
|
|
222
|
-
|
|
224
|
+
ke as searchClasses
|
|
223
225
|
};
|