@studiolxd/brand 41.0.0 → 42.0.0
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/CHANGELOG.md +119 -0
- package/dist/_shared/tokens.js +3 -0
- package/dist/_types/atoms/AsyncMultiSelect/AsyncMultiSelect.d.ts +28 -5
- package/dist/_types/atoms/AsyncSelect/AsyncSelect.d.ts +26 -6
- package/dist/_types/atoms/Button/Button.d.ts +17 -4
- package/dist/_types/atoms/InputPhone/InputPhone.d.ts +15 -4
- package/dist/_types/atoms/MultiSelect/MultiSelect.d.ts +20 -1
- package/dist/_types/atoms/NumberInput/NumberInput.d.ts +14 -4
- package/dist/_types/atoms/OtpInput/OtpInput.d.ts +15 -4
- package/dist/_types/atoms/Select/Select.d.ts +18 -1
- package/dist/_types/messages/BrandMessages.d.ts +25 -1
- package/dist/_types/messages/index.d.ts +1 -1
- package/dist/_types/molecules/Card/Card.d.ts +13 -4
- package/dist/_types/molecules/DocsSearch/DocsSearch.d.ts +31 -12
- package/dist/_types/molecules/FilterBar/FilterBar.d.ts +10 -1
- package/dist/_types/molecules/InputField/InputField.d.ts +16 -2
- package/dist/_types/molecules/MultiSelectField/MultiSelectField.d.ts +9 -1
- package/dist/_types/molecules/PasswordField/PasswordField.d.ts +22 -2
- package/dist/_types/molecules/SearchForm/SearchForm.d.ts +18 -6
- package/dist/_types/molecules/SelectField/SelectField.d.ts +5 -0
- package/dist/_types/organisms/AnnotationThread/AnnotationThread.d.ts +10 -1
- package/dist/annotation-thread.css +1 -1
- package/dist/async-multi-select.js +50 -49
- package/dist/async-select.js +89 -88
- package/dist/brand.css +4 -1
- package/dist/card.css +1 -1
- package/dist/docs-search.js +38 -37
- package/dist/filter-bar.css +1 -1
- package/dist/filter-bar.js +19 -17
- package/dist/input-field.js +66 -65
- package/dist/input-phone.js +39 -38
- package/dist/multi-select.js +109 -108
- package/dist/number-input.js +61 -60
- package/dist/otp-input.js +86 -85
- package/dist/password-field.js +46 -45
- package/dist/search-form.js +35 -34
- package/dist/select.js +75 -71
- package/dist/tokens.css +4 -1
- package/package.json +1 -1
- package/src/tokens/molecules/annotation-thread.css +1 -0
- package/src/tokens/molecules/filter-bar.css +2 -0
- package/src/tokens/scss/molecules/_annotation-thread.scss +1 -0
- package/src/tokens/scss/molecules/_filter-bar.scss +2 -0
- package/src/tokens/tokens.json +3 -0
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import './InputField.css';
|
|
3
|
+
/**
|
|
4
|
+
* El único texto que el campo emite por su cuenta: el nombre accesible del
|
|
5
|
+
* aspa de borrado. Es cromo —dice la misma cosa en toda la suite—, así que
|
|
6
|
+
* sale del catálogo común y no de quien monta el campo.
|
|
7
|
+
*
|
|
8
|
+
* El `label`, el `placeholder`, el `helperText` y el `errorMessage` NO están
|
|
9
|
+
* aquí: son el contenido de ESTE campo, y ningún catálogo común puede saber
|
|
10
|
+
* qué dicen.
|
|
11
|
+
*/
|
|
12
|
+
export interface InputFieldMessages {
|
|
13
|
+
/** Nombre accesible del botón que vacía un campo de búsqueda. */
|
|
14
|
+
clear: string;
|
|
15
|
+
}
|
|
3
16
|
export interface InputFieldProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size' | 'type' | 'value' | 'defaultValue'> {
|
|
4
17
|
id: string;
|
|
5
18
|
label: string;
|
|
@@ -33,8 +46,9 @@ export interface InputFieldProps extends Omit<ComponentPropsWithoutRef<'input'>,
|
|
|
33
46
|
*/
|
|
34
47
|
clearable?: boolean;
|
|
35
48
|
/**
|
|
36
|
-
* Nombre accesible del botón de borrado.
|
|
37
|
-
*
|
|
49
|
+
* Nombre accesible del botón de borrado. **Sin default**: sale de
|
|
50
|
+
* `inputField.clear` del `BrandMessagesProvider`, y esta prop es la
|
|
51
|
+
* anulación puntual de un uso concreto.
|
|
38
52
|
*/
|
|
39
53
|
clearLabel?: string;
|
|
40
54
|
/** Se llama tras vaciar el campo desde el aspa, ya con el foco devuelto. */
|
|
@@ -15,6 +15,11 @@ export interface MultiSelectFieldProps {
|
|
|
15
15
|
options: MultiSelectOption[];
|
|
16
16
|
value?: string[];
|
|
17
17
|
defaultValue?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Marcador de sitio del control sin valor elegido. Reenvío puro al `MultiSelect`:
|
|
20
|
+
* sin él, el texto sale de `multiSelect.placeholder` del `BrandMessagesProvider`.
|
|
21
|
+
* Se pasa solo cuando el marcador dice algo de ESTE campo.
|
|
22
|
+
*/
|
|
18
23
|
placeholder?: string;
|
|
19
24
|
/** Nombre del campo en el formulario: se monta un input oculto por valor elegido. */
|
|
20
25
|
name?: string;
|
|
@@ -29,7 +34,10 @@ export interface MultiSelectFieldProps {
|
|
|
29
34
|
size?: 'sm' | 'md' | 'lg';
|
|
30
35
|
/** Se añade DESPUÉS de las clases propias (el consumidor añade, no sustituye). */
|
|
31
36
|
className?: string;
|
|
32
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* aria-label del botón que quita un valor. Reenvío puro al `MultiSelect`:
|
|
39
|
+
* sin él, el texto sale de `multiSelect.remove` del `BrandMessagesProvider`.
|
|
40
|
+
*/
|
|
33
41
|
removeLabel?: (label: string) => string;
|
|
34
42
|
onValueChange?: (value: string[]) => void;
|
|
35
43
|
onBlur?: React.FocusEventHandler<HTMLDivElement>;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import './PasswordField.css';
|
|
2
|
+
/**
|
|
3
|
+
* Los dos textos que el campo emite por su cuenta: las dos caras del
|
|
4
|
+
* interruptor de mostrar/ocultar. Son cromo —dicen lo mismo en toda la
|
|
5
|
+
* suite—, y por eso salen del catálogo común.
|
|
6
|
+
*
|
|
7
|
+
* El `label`, el `placeholder`, el `helperText` y el `errorMessage` no están
|
|
8
|
+
* aquí: son el contenido de ESTE campo.
|
|
9
|
+
*/
|
|
10
|
+
export interface PasswordFieldMessages {
|
|
11
|
+
/** Nombre accesible del interruptor con la contraseña oculta. */
|
|
12
|
+
show: string;
|
|
13
|
+
/** Nombre accesible del interruptor con la contraseña a la vista. */
|
|
14
|
+
hide: string;
|
|
15
|
+
}
|
|
2
16
|
export interface PasswordFieldProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'size' | 'type'> {
|
|
3
17
|
/**
|
|
4
18
|
* Etiqueta del campo. **Opcional**: si se omite, el componente renderiza solo
|
|
@@ -18,9 +32,15 @@ export interface PasswordFieldProps extends Omit<React.ComponentPropsWithoutRef<
|
|
|
18
32
|
action?: React.ReactNode;
|
|
19
33
|
/** Tamaño del campo. */
|
|
20
34
|
size?: 'sm' | 'md' | 'lg';
|
|
21
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* aria-label del toggle cuando la contraseña está oculta. **Sin default**:
|
|
37
|
+
* sale de `passwordField.show` del `BrandMessagesProvider`.
|
|
38
|
+
*/
|
|
22
39
|
showPasswordLabel?: string;
|
|
23
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* aria-label del toggle cuando la contraseña es visible. **Sin default**:
|
|
42
|
+
* sale de `passwordField.hide` del `BrandMessagesProvider`.
|
|
43
|
+
*/
|
|
24
44
|
hidePasswordLabel?: string;
|
|
25
45
|
/**
|
|
26
46
|
* Se añade DESPUÉS de las clases propias, sobre el wrapper raíz `.password-field`.
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import './SearchForm.css';
|
|
2
|
+
/**
|
|
3
|
+
* Los tres textos que el buscador emite por su cuenta. Son cromo: el buscador
|
|
4
|
+
* de sitio se llama igual en toda la suite, y ni el rótulo ni la pista dicen
|
|
5
|
+
* nada de lo que se busca en ESTA pantalla.
|
|
6
|
+
*/
|
|
7
|
+
export interface SearchFormMessages {
|
|
8
|
+
/** Etiqueta del campo; nombra también el punto de referencia `search`. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Pista dentro del campo. */
|
|
11
|
+
placeholder: string;
|
|
12
|
+
/** Nombre accesible del botón de envío. */
|
|
13
|
+
submit: string;
|
|
14
|
+
}
|
|
2
15
|
export interface SearchFormProps {
|
|
3
16
|
/** `id` del campo. Si no se pasa, el componente genera uno estable. */
|
|
4
17
|
id?: string;
|
|
@@ -28,8 +41,7 @@ export interface SearchFormProps {
|
|
|
28
41
|
method?: 'get' | 'post';
|
|
29
42
|
/**
|
|
30
43
|
* Etiqueta del campo. Nombra también el punto de referencia `search`.
|
|
31
|
-
*
|
|
32
|
-
* @default 'Buscar'
|
|
44
|
+
* **Sin default**: sale de `searchForm.label` del `BrandMessagesProvider`.
|
|
33
45
|
*/
|
|
34
46
|
label?: string;
|
|
35
47
|
/**
|
|
@@ -38,13 +50,13 @@ export interface SearchFormProps {
|
|
|
38
50
|
*/
|
|
39
51
|
labelHidden?: boolean;
|
|
40
52
|
/**
|
|
41
|
-
* Pista dentro del campo.
|
|
42
|
-
*
|
|
53
|
+
* Pista dentro del campo. **Sin default**: sale de
|
|
54
|
+
* `searchForm.placeholder`.
|
|
43
55
|
*/
|
|
44
56
|
placeholder?: string;
|
|
45
57
|
/**
|
|
46
|
-
* Nombre accesible del botón de envío.
|
|
47
|
-
*
|
|
58
|
+
* Nombre accesible del botón de envío. **Sin default**: sale de
|
|
59
|
+
* `searchForm.submit`.
|
|
48
60
|
*/
|
|
49
61
|
submitLabel?: string;
|
|
50
62
|
/**
|
|
@@ -19,6 +19,11 @@ export interface SelectFieldProps {
|
|
|
19
19
|
options: SelectOptionOrGroup[];
|
|
20
20
|
value?: string;
|
|
21
21
|
defaultValue?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Marcador de sitio del control sin valor elegido. Reenvío puro al `Select`:
|
|
24
|
+
* sin él, el texto sale de `select.placeholder` del `BrandMessagesProvider`.
|
|
25
|
+
* Se pasa solo cuando el marcador dice algo de ESTE campo.
|
|
26
|
+
*/
|
|
22
27
|
placeholder?: string;
|
|
23
28
|
/** Nombre del campo en el formulario: Base UI monta un input oculto con el valor. */
|
|
24
29
|
name?: string;
|
|
@@ -43,7 +43,16 @@ export interface AnnotationThreadProps extends React.ComponentPropsWithoutRef<'a
|
|
|
43
43
|
* `resolved` se retira visualmente sin desaparecer.
|
|
44
44
|
*/
|
|
45
45
|
status?: AnnotationThreadStatus;
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Acciones del hilo entero: resolver, reabrir, seguir. Van al pie, **una por
|
|
48
|
+
* línea y a la línea entera**, siempre: el hilo vive en un panel de revisión
|
|
49
|
+
* —una columna estrecha también en escritorio—, así que el ancho de la
|
|
50
|
+
* ventana no dice nada de lo que mide este hueco.
|
|
51
|
+
*
|
|
52
|
+
* Se pasan sueltas (`<><Button/><Button/></>`), sin envolverlas en un
|
|
53
|
+
* `Inline`: el envoltorio se llevaría la línea y los botones se quedarían a
|
|
54
|
+
* su ancho natural dentro de él.
|
|
55
|
+
*/
|
|
47
56
|
actions?: ReactNode;
|
|
48
57
|
/** Con qué se responde: un `MessageComposer`, un `TextareaField`, un `Button`. */
|
|
49
58
|
reply?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.annotation-thread{gap:var(--annotation-thread-gap);padding-block:var(--annotation-thread-padding-block);padding-inline:var(--annotation-thread-padding-inline);border:var(--annotation-thread-border-width) var(--annotation-thread-border-style) var(--annotation-thread-border-color);flex-direction:column;display:flex}.annotation-thread.annotation-thread--acknowledged{opacity:var(--annotation-thread-acknowledged-opacity)}.annotation-thread.annotation-thread--resolved{opacity:var(--annotation-thread-resolved-opacity)}.annotation-thread__status{display:flex}.annotation-thread__item{gap:var(--annotation-thread-item-gap);flex-direction:column;display:flex}.annotation-thread__header{align-items:center;gap:var(--annotation-thread-header-gap);flex-wrap:wrap;display:flex}.annotation-thread__avatar{flex-shrink:0;display:inline-flex}.annotation-thread__author{font-family:var(--annotation-thread-author-font-family);font-size:var(--annotation-thread-author-font-size);font-weight:var(--annotation-thread-author-font-weight);color:var(--annotation-thread-author-color)}.annotation-thread__date,.annotation-thread__edited{font-size:var(--annotation-thread-meta-font-size);color:var(--annotation-thread-meta-color)}.annotation-thread__meta{align-items:center;gap:var(--annotation-thread-header-gap);overflow-wrap:anywhere;min-inline-size:0;font-size:var(--annotation-thread-meta-font-size);color:var(--annotation-thread-meta-color);flex-wrap:wrap;display:inline-flex}.annotation-thread__body{font-size:var(--annotation-thread-body-font-size);line-height:var(--annotation-thread-body-line-height);color:var(--annotation-thread-body-color)}.annotation-thread__item-actions{gap:var(--annotation-thread-header-gap);flex-wrap:wrap;display:flex}.annotation-thread__replies{gap:var(--annotation-thread-items-gap);border-inline-start:var(--annotation-thread-reply-guide-width) var(--annotation-thread-reply-guide-style) var(--annotation-thread-reply-guide-color);flex-direction:column;padding-inline-start:var(--annotation-thread-reply-indent);display:flex}.annotation-thread__replies-label{font-size:var(--annotation-thread-replies-label-font-size);color:var(--annotation-thread-replies-label-color);margin-block:0}.annotation-thread__actions{gap:var(--annotation-thread-
|
|
1
|
+
.annotation-thread{gap:var(--annotation-thread-gap);padding-block:var(--annotation-thread-padding-block);padding-inline:var(--annotation-thread-padding-inline);border:var(--annotation-thread-border-width) var(--annotation-thread-border-style) var(--annotation-thread-border-color);flex-direction:column;display:flex}.annotation-thread.annotation-thread--acknowledged{opacity:var(--annotation-thread-acknowledged-opacity)}.annotation-thread.annotation-thread--resolved{opacity:var(--annotation-thread-resolved-opacity)}.annotation-thread__status{display:flex}.annotation-thread__item{gap:var(--annotation-thread-item-gap);flex-direction:column;display:flex}.annotation-thread__header{align-items:center;gap:var(--annotation-thread-header-gap);flex-wrap:wrap;display:flex}.annotation-thread__avatar{flex-shrink:0;display:inline-flex}.annotation-thread__author{font-family:var(--annotation-thread-author-font-family);font-size:var(--annotation-thread-author-font-size);font-weight:var(--annotation-thread-author-font-weight);color:var(--annotation-thread-author-color)}.annotation-thread__date,.annotation-thread__edited{font-size:var(--annotation-thread-meta-font-size);color:var(--annotation-thread-meta-color)}.annotation-thread__meta{align-items:center;gap:var(--annotation-thread-header-gap);overflow-wrap:anywhere;min-inline-size:0;font-size:var(--annotation-thread-meta-font-size);color:var(--annotation-thread-meta-color);flex-wrap:wrap;display:inline-flex}.annotation-thread__body{font-size:var(--annotation-thread-body-font-size);line-height:var(--annotation-thread-body-line-height);color:var(--annotation-thread-body-color)}.annotation-thread__item-actions{gap:var(--annotation-thread-header-gap);flex-wrap:wrap;display:flex}.annotation-thread__replies{gap:var(--annotation-thread-items-gap);border-inline-start:var(--annotation-thread-reply-guide-width) var(--annotation-thread-reply-guide-style) var(--annotation-thread-reply-guide-color);flex-direction:column;padding-inline-start:var(--annotation-thread-reply-indent);display:flex}.annotation-thread__replies-label{font-size:var(--annotation-thread-replies-label-font-size);color:var(--annotation-thread-replies-label-color);margin-block:0}.annotation-thread__actions{align-items:stretch;gap:var(--annotation-thread-actions-gap);flex-direction:column;display:flex}.annotation-thread__actions>*{inline-size:100%}
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './async-multi-select.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Icon as t } from "./icon.js";
|
|
5
|
+
import { Spinner as n } from "./spinner.js";
|
|
6
|
+
import { forwardRef as r, useCallback as ee, useEffect as te, useId as i, useRef as a, useState as o } from "react";
|
|
6
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
8
|
import { Popover as l } from "@base-ui/react/popover";
|
|
8
9
|
//#region src/stories/atoms/AsyncMultiSelect/AsyncMultiSelect.tsx
|
|
9
|
-
function
|
|
10
|
+
function u(e, t) {
|
|
10
11
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
11
12
|
}
|
|
12
|
-
var
|
|
13
|
-
let [k, A] = o(!1), [j, M] = o(""), [N, P] = o(!1), [F, I] = o([]), [L, R] = o(!1), [z, B] = o(-1), [V, H] = o(
|
|
13
|
+
var d = r(function({ onSearch: r, value: d, defaultValue: f = [], onValueChange: p, selectedOptions: ne, placeholder: m, disabled: h, readOnly: g, size: _ = "md", debounceMs: v = 300, id: re, name: y, error: b = !1, required: ie, onBlur: ae, className: x, "aria-label": S, "aria-describedby": C, removeLabel: w, emptyMessage: T, loadingLabel: E, container: D }, oe) {
|
|
14
|
+
let O = e("asyncMultiSelect"), [k, A] = o(!1), [j, M] = o(""), [N, P] = o(!1), [F, I] = o([]), [L, R] = o(!1), [z, B] = o(-1), [V, H] = o(f), [U, W] = o([]), G = a(null), K = a(0), q = a(null), J = a(null), Y = i(), se = i(), X = d === void 0 ? V : d, ce = X.map((e) => ne?.find((t) => t.value === e) ?? U.find((t) => t.value === e) ?? {
|
|
14
15
|
value: e,
|
|
15
16
|
label: e
|
|
16
|
-
}), Z = (e) => `${
|
|
17
|
+
}), Z = (e) => `${se}-opt-${e}`, Q = ee(async (e) => {
|
|
17
18
|
let t = ++K.current;
|
|
18
19
|
P(!0), R(!1);
|
|
19
20
|
try {
|
|
20
|
-
let
|
|
21
|
+
let n = await r(e);
|
|
21
22
|
if (t !== K.current) return;
|
|
22
|
-
I(
|
|
23
|
+
I(n), B(-1);
|
|
23
24
|
} catch {
|
|
24
25
|
if (t !== K.current) return;
|
|
25
26
|
I([]), B(-1);
|
|
26
27
|
} finally {
|
|
27
28
|
t === K.current && (P(!1), R(!0));
|
|
28
29
|
}
|
|
29
|
-
}, [
|
|
30
|
-
|
|
30
|
+
}, [r]);
|
|
31
|
+
te(() => () => {
|
|
31
32
|
K.current += 1, G.current && clearTimeout(G.current);
|
|
32
33
|
}, []);
|
|
33
|
-
function
|
|
34
|
+
function le(e) {
|
|
34
35
|
let t = e.target.value;
|
|
35
36
|
M(t), k || A(!0), G.current && clearTimeout(G.current), G.current = setTimeout(() => void Q(t), v);
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function ue(e) {
|
|
38
39
|
h || g || k || (e.preventDefault(), q.current?.focus(), B(-1), M(""), I([]), R(!1), A(!0), Q(""));
|
|
39
40
|
}
|
|
40
41
|
function $(e, t) {
|
|
41
42
|
let n = X.includes(e) ? X.filter((t) => t !== e) : [...X, e];
|
|
42
|
-
t && W((e) => e.some((e) => e.value === t.value) ? e : [...e, t]),
|
|
43
|
+
t && W((e) => e.some((e) => e.value === t.value) ? e : [...e, t]), d === void 0 && H(n), p?.(n);
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function de(e) {
|
|
45
46
|
if (e.key === "ArrowDown") e.preventDefault(), k ? B((e) => Math.min(e + 1, F.length - 1)) : (A(!0), Q(j));
|
|
46
47
|
else if (e.key === "ArrowUp") e.preventDefault(), B((e) => Math.max(e - 1, -1));
|
|
47
48
|
else if (e.key === "Enter" && z >= 0 && F[z]) e.preventDefault(), $(F[z].value, F[z]), q.current?.focus();
|
|
@@ -52,7 +53,7 @@ var u = n(function({ onSearch: n, value: u, defaultValue: d = [], onValueChange:
|
|
|
52
53
|
$(e);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function fe(e, t) {
|
|
56
57
|
if (!e) {
|
|
57
58
|
if (t.reason === "outside-press") {
|
|
58
59
|
let e = t.event?.target;
|
|
@@ -61,61 +62,61 @@ var u = n(function({ onSearch: n, value: u, defaultValue: d = [], onValueChange:
|
|
|
61
62
|
A(!1), M(""), B(-1);
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
let
|
|
65
|
+
let pe = [
|
|
65
66
|
"async-multi-select",
|
|
66
67
|
_ === "md" ? "" : `async-multi-select--${_}`,
|
|
67
68
|
h ? "async-multi-select--disabled" : "",
|
|
68
69
|
k ? "async-multi-select--open" : "",
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
].filter(Boolean).join(" "),
|
|
70
|
+
b ? "async-multi-select--error" : "",
|
|
71
|
+
x ?? ""
|
|
72
|
+
].filter(Boolean).join(" "), me = ["async-multi-select__content", _ === "md" ? "" : `async-multi-select__content--${_}`].filter(Boolean).join(" ");
|
|
72
73
|
return /* @__PURE__ */ c(l.Root, {
|
|
73
74
|
open: k,
|
|
74
|
-
onOpenChange:
|
|
75
|
+
onOpenChange: fe,
|
|
75
76
|
children: [/* @__PURE__ */ c("div", {
|
|
76
77
|
ref: J,
|
|
77
|
-
className:
|
|
78
|
+
className: pe,
|
|
78
79
|
"data-popup-open": k || void 0,
|
|
79
80
|
children: [/* @__PURE__ */ c("div", {
|
|
80
81
|
className: "async-multi-select__input-area",
|
|
81
82
|
children: [
|
|
82
|
-
|
|
83
|
+
ce.map((e) => /* @__PURE__ */ c("span", {
|
|
83
84
|
className: "async-multi-select__pill",
|
|
84
85
|
children: [/* @__PURE__ */ s("span", {
|
|
85
86
|
className: "async-multi-select__pill-label",
|
|
86
|
-
children:
|
|
87
|
+
children: e.label
|
|
87
88
|
}), !h && !g && /* @__PURE__ */ s("button", {
|
|
88
89
|
type: "button",
|
|
89
90
|
className: "async-multi-select__pill-remove",
|
|
90
|
-
"aria-label":
|
|
91
|
+
"aria-label": O("remove", w)(e.label),
|
|
91
92
|
tabIndex: -1,
|
|
92
|
-
onMouseDown: (
|
|
93
|
-
|
|
93
|
+
onMouseDown: (t) => {
|
|
94
|
+
t.preventDefault(), $(e.value);
|
|
94
95
|
},
|
|
95
|
-
children: /* @__PURE__ */ s(
|
|
96
|
+
children: /* @__PURE__ */ s(t, {
|
|
96
97
|
name: "close",
|
|
97
98
|
size: "xs"
|
|
98
99
|
})
|
|
99
100
|
})]
|
|
100
|
-
},
|
|
101
|
+
}, e.value)),
|
|
101
102
|
/* @__PURE__ */ s("input", {
|
|
102
103
|
ref: (e) => {
|
|
103
|
-
q.current = e,
|
|
104
|
+
q.current = e, u(oe, e);
|
|
104
105
|
},
|
|
105
|
-
id:
|
|
106
|
+
id: re,
|
|
106
107
|
type: "text",
|
|
107
108
|
className: "async-multi-select__input",
|
|
108
109
|
value: j,
|
|
109
|
-
onChange:
|
|
110
|
-
onPointerDown:
|
|
111
|
-
onKeyDown:
|
|
112
|
-
placeholder: X.length === 0 ? m : void 0,
|
|
110
|
+
onChange: le,
|
|
111
|
+
onPointerDown: ue,
|
|
112
|
+
onKeyDown: de,
|
|
113
|
+
placeholder: X.length === 0 ? O("placeholder", m) : void 0,
|
|
113
114
|
disabled: h,
|
|
114
115
|
readOnly: g,
|
|
115
|
-
"aria-label":
|
|
116
|
-
"aria-describedby":
|
|
117
|
-
"aria-invalid":
|
|
118
|
-
"aria-required":
|
|
116
|
+
"aria-label": S,
|
|
117
|
+
"aria-describedby": C,
|
|
118
|
+
"aria-invalid": b || void 0,
|
|
119
|
+
"aria-required": ie || void 0,
|
|
119
120
|
"aria-expanded": k,
|
|
120
121
|
"aria-haspopup": "listbox",
|
|
121
122
|
"aria-controls": k ? Y : void 0,
|
|
@@ -123,15 +124,15 @@ var u = n(function({ onSearch: n, value: u, defaultValue: d = [], onValueChange:
|
|
|
123
124
|
autoComplete: "off",
|
|
124
125
|
role: "combobox",
|
|
125
126
|
"aria-autocomplete": "list",
|
|
126
|
-
onBlur:
|
|
127
|
+
onBlur: ae
|
|
127
128
|
}),
|
|
128
|
-
|
|
129
|
+
y && X.map((e) => /* @__PURE__ */ s("input", {
|
|
129
130
|
type: "hidden",
|
|
130
|
-
name:
|
|
131
|
+
name: y,
|
|
131
132
|
value: e
|
|
132
133
|
}, e))
|
|
133
134
|
]
|
|
134
|
-
}), N && /* @__PURE__ */ s(
|
|
135
|
+
}), N && /* @__PURE__ */ s(n, {
|
|
135
136
|
size: "sm",
|
|
136
137
|
"aria-hidden": !0
|
|
137
138
|
})]
|
|
@@ -143,25 +144,25 @@ var u = n(function({ onSearch: n, value: u, defaultValue: d = [], onValueChange:
|
|
|
143
144
|
align: "start",
|
|
144
145
|
sideOffset: -1,
|
|
145
146
|
children: /* @__PURE__ */ s(l.Popup, {
|
|
146
|
-
className:
|
|
147
|
+
className: me,
|
|
147
148
|
initialFocus: !1,
|
|
148
149
|
finalFocus: !1,
|
|
149
150
|
children: /* @__PURE__ */ c("div", {
|
|
150
151
|
role: "listbox",
|
|
151
152
|
"aria-multiselectable": "true",
|
|
152
|
-
"aria-label":
|
|
153
|
+
"aria-label": S ?? O("placeholder", m),
|
|
153
154
|
id: Y,
|
|
154
155
|
children: [
|
|
155
156
|
N && /* @__PURE__ */ s("div", {
|
|
156
157
|
className: "async-multi-select__loading",
|
|
157
|
-
children: /* @__PURE__ */ s(
|
|
158
|
+
children: /* @__PURE__ */ s(n, {
|
|
158
159
|
size: "sm",
|
|
159
|
-
label: E
|
|
160
|
+
label: O("loading", E)
|
|
160
161
|
})
|
|
161
162
|
}),
|
|
162
163
|
!N && L && F.length === 0 && /* @__PURE__ */ s("div", {
|
|
163
164
|
className: "async-multi-select__empty",
|
|
164
|
-
children:
|
|
165
|
+
children: O("empty", T)
|
|
165
166
|
}),
|
|
166
167
|
!N && F.map((e, t) => {
|
|
167
168
|
let n = X.includes(e.value), r = z === t;
|
|
@@ -193,4 +194,4 @@ var u = n(function({ onSearch: n, value: u, defaultValue: d = [], onValueChange:
|
|
|
193
194
|
});
|
|
194
195
|
});
|
|
195
196
|
//#endregion
|
|
196
|
-
export {
|
|
197
|
+
export { d as AsyncMultiSelect };
|