@situaction/traq-ui-ste 1.2.36 → 1.2.40

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.
@@ -38,7 +38,7 @@ export interface AccordionProps {
38
38
  /** If true, clicking anywhere on the header (excluding buttons) toggles the content */
39
39
  toggleOnHeaderClick?: boolean;
40
40
  /** Visual mode for all accordion items */
41
- mode?: "primary" | "secondary";
41
+ mode?: "primary" | "secondary" | "ghost";
42
42
  /** If true, only one item can be open at a time */
43
43
  singleOpen?: boolean;
44
44
  /** Controlled open ids (optional) */
@@ -19,7 +19,7 @@ interface AccordionItemProps {
19
19
  /** If true, clicking anywhere on the header (excluding buttons) toggles the content */
20
20
  toggleOnHeaderClick?: boolean;
21
21
  /** Visual mode for the accordion item */
22
- mode?: "primary" | "secondary";
22
+ mode?: "primary" | "secondary" | "ghost";
23
23
  /** Controlled open state (optional) */
24
24
  open?: boolean;
25
25
  /** Toggle callback used when open is controlled */
@@ -1,67 +1,68 @@
1
1
  import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
- import { useState as k, useEffect as y, useMemo as B } from "react";
2
+ import { useState as y, useEffect as B, useMemo as O } from "react";
3
3
  import { IconButton as w } from "../../icon-button/IconButton.js";
4
- import '../../../styles/AccordionItem.css';const O = "_accordionHeader_bor6q_7", A = "_title_bor6q_31", M = "_fullHeight_bor6q_36", H = "_block_bor6q_40", I = "_tile_bor6q_48", L = "_secondaryOpen_bor6q_56", e = {
5
- accordionHeader: O,
6
- "padding-s": "_padding-s_bor6q_15",
7
- "padding-m": "_padding-m_bor6q_19",
8
- "padding-l": "_padding-l_bor6q_23",
9
- "padding-xl": "_padding-xl_bor6q_27",
10
- title: A,
11
- fullHeight: M,
12
- block: H,
13
- tile: I,
14
- secondaryOpen: L
15
- }, z = ({
16
- header: m,
17
- children: f,
18
- iconPosition: a = "right",
4
+ import '../../../styles/AccordionItem.css';const A = "_accordionHeader_10lt2_7", M = "_title_10lt2_31", H = "_fullHeight_10lt2_36", I = "_block_10lt2_40", L = "_tile_10lt2_48", N = "_secondaryOpen_10lt2_56", Z = "_ghost_10lt2_61", l = {
5
+ accordionHeader: A,
6
+ "padding-s": "_padding-s_10lt2_15",
7
+ "padding-m": "_padding-m_10lt2_19",
8
+ "padding-l": "_padding-l_10lt2_23",
9
+ "padding-xl": "_padding-xl_10lt2_27",
10
+ title: M,
11
+ fullHeight: H,
12
+ block: I,
13
+ tile: L,
14
+ secondaryOpen: N,
15
+ ghost: Z
16
+ }, q = ({
17
+ header: f,
18
+ children: m,
19
+ iconPosition: c = "right",
19
20
  defaultOpen: d = !1,
20
- type: c = "block",
21
- paddingHeader: b = "m",
22
- onClickHeader: s,
21
+ type: h = "block",
22
+ paddingHeader: u = "m",
23
+ onClickHeader: n,
23
24
  toggleOnHeaderClick: v = !1,
24
- mode: h = "primary",
25
+ mode: o = "primary",
25
26
  open: g,
26
- onToggle: r
27
+ onToggle: a
27
28
  }) => {
28
- const l = g !== void 0, [u, _] = k(!1);
29
- y(() => {
30
- l || _(!!d);
31
- }, [d, l]);
32
- const i = l ? !!g : u, n = () => {
33
- if (l) {
34
- r == null || r();
29
+ const i = g !== void 0, [x, _] = y(!1);
30
+ B(() => {
31
+ i || _(!!d);
32
+ }, [d, i]);
33
+ const e = i ? !!g : x, r = () => {
34
+ if (i) {
35
+ a == null || a();
35
36
  return;
36
37
  }
37
- _((o) => !o);
38
- }, x = (o) => {
39
- if (o.target.closest("button")) {
40
- o.stopPropagation();
38
+ _((s) => !s);
39
+ }, b = (s) => {
40
+ if (s.target.closest("button")) {
41
+ s.stopPropagation();
41
42
  return;
42
43
  }
43
- v && n(), s == null || s();
44
- }, q = B(() => [
45
- c === "tile" ? e.tile : e.block,
46
- h === "secondary" && i ? e.secondaryOpen : ""
47
- ].filter(Boolean).join(" "), [c, h, i]);
48
- return /* @__PURE__ */ p("div", { className: q, children: [
44
+ v && r(), n == null || n();
45
+ }, k = O(() => o === "ghost" ? l.ghost : [
46
+ h === "tile" ? l.tile : l.block,
47
+ o === "secondary" && e ? l.secondaryOpen : ""
48
+ ].filter(Boolean).join(" "), [h, o, e]);
49
+ return /* @__PURE__ */ p("div", { className: k, children: [
49
50
  /* @__PURE__ */ p(
50
51
  "div",
51
52
  {
52
- className: `${e.accordionHeader} ${e[`padding-${b}`]}`,
53
- onClick: x,
53
+ className: `${l.accordionHeader} ${l[`padding-${u}`]}`,
54
+ onClick: b,
54
55
  "data-ignore-outside-click": !0,
55
56
  children: [
56
- a === "left" && /* @__PURE__ */ t(w, { mode: "ghost", size: "s", onClick: n, children: i ? /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z" }) }) : /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z" }) }) }),
57
- /* @__PURE__ */ t("div", { className: e.title, children: m }),
58
- a === "right" && /* @__PURE__ */ t(w, { mode: "ghost", size: "s", onClick: n, children: i ? /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z" }) }) : /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z" }) }) })
57
+ c === "left" && /* @__PURE__ */ t(w, { mode: "ghost", size: "s", onClick: r, children: e ? /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z" }) }) : /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z" }) }) }),
58
+ /* @__PURE__ */ t("div", { className: l.title, children: f }),
59
+ c === "right" && /* @__PURE__ */ t(w, { mode: "ghost", size: "s", onClick: r, children: e ? /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z" }) }) : /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z" }) }) })
59
60
  ]
60
61
  }
61
62
  ),
62
- i && f
63
+ e && m
63
64
  ] });
64
65
  };
65
66
  export {
66
- z as AccordionItem
67
+ q as AccordionItem
67
68
  };
@@ -3,7 +3,7 @@ import { Button as p } from "../../button/Button.js";
3
3
  import "react";
4
4
  import "../../icon-button/IconButton.js";
5
5
  import { Checkbox as _ } from "../../checkbox/Checkbox.js";
6
- import "../../../index-CxdrhfJv.mjs";
6
+ import "react-dom";
7
7
  import "../../accordion/Accordion.js";
8
8
  import { Icon as a } from "../../icon/Icon.js";
9
9
  import "../../modal/Modal.js";
@@ -3,7 +3,7 @@ import { NestedListItem as l } from "./item/NestedListItem.js";
3
3
  import { Button as c } from "../../button/Button.js";
4
4
  import "react";
5
5
  import "../../icon-button/IconButton.js";
6
- import "../../../index-CxdrhfJv.mjs";
6
+ import "react-dom";
7
7
  import "../../accordion/Accordion.js";
8
8
  import { Icon as a } from "../../icon/Icon.js";
9
9
  import "../../modal/Modal.js";
@@ -3,7 +3,7 @@ import { useState as g, useRef as u, useLayoutEffect as z } from "react";
3
3
  import "../../../button/Button.js";
4
4
  import "../../../icon-button/IconButton.js";
5
5
  import { TagCounter as B } from "../../../tag-counter/TagCounter.js";
6
- import "../../../../index-CxdrhfJv.mjs";
6
+ import "react-dom";
7
7
  import "../../../accordion/Accordion.js";
8
8
  import { Icon as l } from "../../../icon/Icon.js";
9
9
  import { Modal as L } from "../../../modal/Modal.js";
@@ -2,7 +2,7 @@ import { jsx as l, jsxs as u } from "react/jsx-runtime";
2
2
  import { useState as c, useRef as M, useEffect as B } from "react";
3
3
  import { Button as $ } from "../button/Button.js";
4
4
  import { IconButton as f } from "../icon-button/IconButton.js";
5
- import "../../index-CxdrhfJv.mjs";
5
+ import "react-dom";
6
6
  import "../accordion/Accordion.js";
7
7
  import { Icon as N } from "../icon/Icon.js";
8
8
  import { Modal as W } from "../modal/Modal.js";
@@ -2,7 +2,7 @@ import { jsxs as C, jsx as e } from "react/jsx-runtime";
2
2
  import "../../button/Button.js";
3
3
  import "react";
4
4
  import { IconButton as i } from "../../icon-button/IconButton.js";
5
- import "../../../index-CxdrhfJv.mjs";
5
+ import "react-dom";
6
6
  import "../../accordion/Accordion.js";
7
7
  import { Icon as t } from "../../icon/Icon.js";
8
8
  import "../../modal/Modal.js";
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { Size } from '../interface';
2
3
 
3
4
  import * as PhosphorIcons from "@phosphor-icons/react";
@@ -40,6 +41,14 @@ export interface SelectProps {
40
41
  /** Enable a search input inside the select modal to filter options **/
41
42
  searchable?: boolean;
42
43
  fullWidth?: boolean;
44
+ /** Custom trigger — replaces the default button. Can be anything (Tag, chip, etc.) **/
45
+ children?: ReactNode;
46
+ /** Custom render for each item in the dropdown list **/
47
+ renderItem?: (item: SelectItem) => ReactNode;
48
+ /** Extra icon displayed on the right of the trigger button (before the caret) **/
49
+ triggerIcon?: ReactNode;
50
+ /** Width of the dropdown panel: 'auto' (natural size) or 'full' (fills the container). Default: 'auto' **/
51
+ dropdownWidth?: 'auto' | 'full';
43
52
  iconSize?: number;
44
53
  }
45
54
  /**
@@ -47,4 +56,4 @@ export interface SelectProps {
47
56
  * It supports three display modes: 'all' (icon + text), 'icon' (only icon), and 'text' (only text).
48
57
  * The selected value is displayed in a button, and a modal opens to show the list of options.
49
58
  */
50
- export declare const Select: ({ selected, size, listItem, modeDisplay, onSelect, positionOverride, placeholder, searchPlaceholder, autoCloseCondition, searchable, fullWidth, iconSize }: SelectProps) => import("react/jsx-runtime").JSX.Element;
59
+ export declare const Select: ({ selected, size, listItem, modeDisplay, onSelect, positionOverride, placeholder, searchPlaceholder, autoCloseCondition, searchable, fullWidth, children, renderItem, triggerIcon, dropdownWidth, iconSize }: SelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,214 +1,242 @@
1
- import { jsxs as L, jsx as s } from "react/jsx-runtime";
2
- import { useState as y, useRef as v, useEffect as d } from "react";
3
- import { Button as W } from "../button/Button.js";
4
- import { Input as H } from "../input/Input.js";
5
- import { IconButton as J } from "../icon-button/IconButton.js";
6
- import "../../index-CxdrhfJv.mjs";
1
+ import { jsxs as m, jsx as o, Fragment as G } from "react/jsx-runtime";
2
+ import { useState as _, useRef as b, useEffect as d } from "react";
3
+ import { Button as S } from "../button/Button.js";
4
+ import { Input as I } from "../input/Input.js";
5
+ import { IconButton as ee } from "../icon-button/IconButton.js";
6
+ import "react-dom";
7
7
  import "../accordion/Accordion.js";
8
- import { Icon as _ } from "../icon/Icon.js";
9
- import { Modal as Q } from "../modal/Modal.js";
8
+ import { Icon as T } from "../icon/Icon.js";
9
+ import { Modal as te } from "../modal/Modal.js";
10
10
  import "../carousel/Carousel.js";
11
11
  import "../carousel/FadeCarousel.js";
12
12
  import "../theme/ThemeContext.js";
13
13
  import '../../styles/Size.css';import '../../styles/Select.css';/* empty css */
14
- const X = "_selectContainer_133eb_54", Y = "_children_133eb_61", Z = "_active_133eb_78", O = "_selectList_133eb_82", I = "_modal_133eb_91", ee = "_itemLabel_133eb_98", te = "_searchWrapper_133eb_103", ne = "_noResults_133eb_109", f = {
15
- selectContainer: X,
16
- children: Y,
17
- active: Z,
18
- selectList: O,
19
- modal: I,
20
- itemLabel: ee,
21
- searchWrapper: te,
22
- noResults: ne
23
- }, ve = ({
14
+ const ne = "_selectContainer_133eb_54", re = "_children_133eb_61", oe = "_active_133eb_78", se = "_selectList_133eb_82", ae = "_modal_133eb_91", ce = "_itemLabel_133eb_98", ie = "_searchWrapper_133eb_103", le = "_noResults_133eb_109", f = {
15
+ selectContainer: ne,
16
+ children: re,
17
+ active: oe,
18
+ selectList: se,
19
+ modal: ae,
20
+ itemLabel: ce,
21
+ searchWrapper: ie,
22
+ noResults: le
23
+ }, xe = ({
24
24
  selected: k,
25
- size: g = "m",
25
+ size: w = "m",
26
26
  listItem: h,
27
- modeDisplay: E = "all",
27
+ modeDisplay: N = "all",
28
28
  onSelect: z,
29
- positionOverride: b,
29
+ positionOverride: L,
30
30
  placeholder: x = "Sélectionner",
31
- searchPlaceholder: U,
32
- autoCloseCondition: w,
33
- searchable: V = !1,
34
- fullWidth: S = !1,
35
- iconSize: A = 20
31
+ searchPlaceholder: H,
32
+ autoCloseCondition: y,
33
+ searchable: J = !1,
34
+ fullWidth: g = !1,
35
+ children: P,
36
+ renderItem: F,
37
+ triggerIcon: R,
38
+ dropdownWidth: V = "auto",
39
+ iconSize: Q = 20
36
40
  }) => {
37
- const [t, l] = y(!1), [F, B] = y({
41
+ const [t, l] = _(!1), [X, A] = _({
38
42
  top: "calc(100% + 6px)",
39
43
  left: "0px"
40
- }), [n, T] = y(k ?? null), [K, M] = y(""), u = v(null), $ = v(null), N = v(null), P = v({}), j = v({}), p = v(null);
44
+ }), [r, B] = _(k ?? null), [D, Y] = _(""), u = b(null), M = b(null), K = b(null), $ = b({}), U = b({}), v = b(null);
41
45
  d(() => {
42
- T(k || null);
46
+ B(k || null);
43
47
  }, [k]), d(() => {
44
- b && B(b);
45
- }, [b]);
46
- const q = (e) => {
47
- T(e), l(!1), z && z(e);
48
- }, G = () => {
49
- const e = n == null ? void 0 : n.icon, r = (n == null ? void 0 : n.label) ?? x;
50
- return E === "icon" && e ? /* @__PURE__ */ s(J, { ref: u, mode: "tertiary", size: g, onClick: () => l(!t), children: /* @__PURE__ */ s(_, { size: A, icon: n.icon }) }) : E === "text" ? /* @__PURE__ */ s(
51
- W,
48
+ L && A(L);
49
+ }, [L]);
50
+ const Z = (e) => {
51
+ B(e), l(!1), z && z(e);
52
+ }, W = /* @__PURE__ */ o(T, { icon: t ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }), j = R ? /* @__PURE__ */ m(G, { children: [
53
+ R,
54
+ W
55
+ ] }) : W, O = () => {
56
+ if (P)
57
+ return /* @__PURE__ */ o(
58
+ S,
59
+ {
60
+ ref: u,
61
+ mode: "tertiary",
62
+ label: "",
63
+ size: w,
64
+ fullWidth: g,
65
+ childrenLeft: R ? /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center", gap: "var(--spacing-xs-3)" }, children: [
66
+ R,
67
+ P
68
+ ] }) : P,
69
+ childrenRight: W,
70
+ onClick: () => l(!t),
71
+ "aria-expanded": t,
72
+ "aria-haspopup": "listbox"
73
+ }
74
+ );
75
+ const e = r == null ? void 0 : r.icon, n = (r == null ? void 0 : r.label) ?? x;
76
+ return N === "icon" && e ? /* @__PURE__ */ o(ee, { ref: u, mode: "tertiary", size: w, onClick: () => l(!t), children: /* @__PURE__ */ o(T, { size: Q, icon: r.icon }) }) : N === "text" ? /* @__PURE__ */ o(
77
+ S,
52
78
  {
53
79
  ref: u,
54
80
  mode: "tertiary",
55
- label: n ? r : x,
56
- childrenRight: /* @__PURE__ */ s(_, { icon: t ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
57
- size: g,
58
- fullWidth: S,
81
+ label: r ? n : x,
82
+ childrenRight: j,
83
+ size: w,
84
+ fullWidth: g,
59
85
  onClick: () => l(!t),
60
86
  "aria-expanded": t,
61
87
  "aria-haspopup": "listbox"
62
88
  }
63
- ) : E === "all" ? /* @__PURE__ */ s(
64
- W,
89
+ ) : N === "all" ? /* @__PURE__ */ o(
90
+ S,
65
91
  {
66
92
  ref: u,
67
93
  mode: "tertiary",
68
- label: n ? r : x,
69
- size: g,
70
- fullWidth: S,
71
- childrenLeft: e && /* @__PURE__ */ s(_, { icon: n.icon }),
72
- childrenRight: /* @__PURE__ */ s(_, { icon: t ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
94
+ label: r ? n : x,
95
+ size: w,
96
+ fullWidth: g,
97
+ childrenLeft: e && /* @__PURE__ */ o(T, { icon: r.icon }),
98
+ childrenRight: j,
73
99
  onClick: () => l(!t),
74
100
  "aria-expanded": t,
75
101
  "aria-haspopup": "listbox"
76
102
  }
77
- ) : /* @__PURE__ */ s(
78
- W,
103
+ ) : /* @__PURE__ */ o(
104
+ S,
79
105
  {
80
106
  ref: u,
81
107
  mode: "tertiary",
82
- fullWidth: S,
108
+ fullWidth: g,
83
109
  label: x ?? "Sélectionner",
84
- size: g,
110
+ size: w,
111
+ childrenRight: j,
85
112
  onClick: () => l(!t),
86
113
  "aria-expanded": t,
87
114
  "aria-haspopup": "listbox"
88
115
  }
89
116
  );
90
- }, D = h.filter(
91
- (e) => String(e.label ?? "").toLowerCase().includes(K.toLowerCase())
92
- ), [C, R] = y("");
117
+ }, q = h.filter(
118
+ (e) => String(e.label ?? "").toLowerCase().includes(D.toLowerCase())
119
+ ), [C, E] = _("");
93
120
  return d(() => {
94
121
  if (t) {
95
- const e = (r) => {
96
- const c = r.key.length === 1 ? r.key.toLowerCase() : "";
97
- if (!c) return;
98
- const i = C + c;
99
- R(i);
100
- const o = h.find((a) => {
101
- var m;
102
- return (m = a.label) == null ? void 0 : m.toLowerCase().startsWith(i);
122
+ const e = (n) => {
123
+ const a = n.key.length === 1 ? n.key.toLowerCase() : "";
124
+ if (!a) return;
125
+ const i = C + a;
126
+ E(i);
127
+ const s = h.find((c) => {
128
+ var p;
129
+ return (p = c.label) == null ? void 0 : p.toLowerCase().startsWith(i);
103
130
  });
104
- if (o) {
105
- const a = P.current[o.value];
106
- a == null || a.scrollIntoView({ behavior: "smooth", block: "nearest" });
131
+ if (s) {
132
+ const c = $.current[s.value];
133
+ c == null || c.scrollIntoView({ behavior: "smooth", block: "nearest" });
107
134
  }
108
- p.current && clearTimeout(p.current), p.current = setTimeout(() => R(""), 500);
135
+ v.current && clearTimeout(v.current), v.current = setTimeout(() => E(""), 500);
109
136
  };
110
137
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
111
138
  }
112
139
  }, [t, C, h]), d(() => {
113
- const e = (r) => {
140
+ const e = (n) => {
114
141
  if (!t) return;
115
- const c = r.key.length === 1 ? r.key.toLowerCase() : "";
116
- if (!c) return;
117
- const i = C + c;
118
- R(i);
119
- const o = h.find(
120
- (a) => {
121
- var m;
122
- return (m = a.label) == null ? void 0 : m.toLowerCase().startsWith(i);
142
+ const a = n.key.length === 1 ? n.key.toLowerCase() : "";
143
+ if (!a) return;
144
+ const i = C + a;
145
+ E(i);
146
+ const s = h.find(
147
+ (c) => {
148
+ var p;
149
+ return (p = c.label) == null ? void 0 : p.toLowerCase().startsWith(i);
123
150
  }
124
151
  );
125
- if (o && N.current && P.current[o.value]) {
126
- const a = N.current, m = P.current[o.value];
127
- a.scrollTo({ top: m.offsetTop - a.offsetTop, behavior: "smooth" });
152
+ if (s && K.current && $.current[s.value]) {
153
+ const c = K.current, p = $.current[s.value];
154
+ c.scrollTo({ top: p.offsetTop - c.offsetTop, behavior: "smooth" });
128
155
  }
129
- p.current && clearTimeout(p.current), p.current = setTimeout(() => R(""), 700);
156
+ v.current && clearTimeout(v.current), v.current = setTimeout(() => E(""), 700);
130
157
  };
131
158
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
132
159
  }, [t, h, C]), d(() => {
133
160
  if (!t) return;
134
- const e = (r) => {
135
- const c = r.key.toLowerCase();
136
- if (c.length === 1) {
137
- const i = h.find((o) => {
138
- var a;
139
- return (a = o.label) == null ? void 0 : a.toLowerCase().startsWith(c);
161
+ const e = (n) => {
162
+ const a = n.key.toLowerCase();
163
+ if (a.length === 1) {
164
+ const i = h.find((s) => {
165
+ var c;
166
+ return (c = s.label) == null ? void 0 : c.toLowerCase().startsWith(a);
140
167
  });
141
168
  if (i) {
142
- const o = j.current[i.value];
143
- o && o.scrollIntoView({ block: "start", behavior: "smooth" });
169
+ const s = U.current[i.value];
170
+ s && s.scrollIntoView({ block: "start", behavior: "smooth" });
144
171
  }
145
172
  }
146
173
  };
147
174
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
148
175
  }, [t, h]), d(() => {
149
- if (t && u.current) {
150
- const e = u.current.getBoundingClientRect().height;
151
- B(b || { top: `${e + 6}px`, left: "0px" });
176
+ const e = u.current;
177
+ if (t && e) {
178
+ const { height: n } = e.getBoundingClientRect(), a = { top: `${n + 6}px`, left: "0px" };
179
+ A(L || { ...a, ...V === "full" ? { width: "calc(100% - var(--spacing-xs-6) * 2)" } : {} });
152
180
  }
153
- }, [t, b]), d(() => {
154
- if (!t || !w) return;
155
- const e = (r) => {
156
- const c = r.target, i = u.current, o = $.current;
157
- i && i.contains(c) || o && o.contains(c) || l(!1);
181
+ }, [t, L, V]), d(() => {
182
+ if (!t || !y) return;
183
+ const e = (n) => {
184
+ const a = n.target, i = u.current, s = M.current;
185
+ i && i.contains(a) || s && s.contains(a) || l(!1);
158
186
  };
159
187
  return document.addEventListener("mousedown", e), document.addEventListener("touchstart", e, { passive: !0 }), () => {
160
188
  document.removeEventListener("mousedown", e), document.removeEventListener("touchstart", e);
161
189
  };
162
- }, [t, w]), d(() => {
163
- if (!t || !w) return;
164
- const e = (r) => {
165
- r.key === "Escape" && l(!1);
190
+ }, [t, y]), d(() => {
191
+ if (!t || !y) return;
192
+ const e = (n) => {
193
+ n.key === "Escape" && l(!1);
166
194
  };
167
195
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
168
- }, [t, w]), /* @__PURE__ */ L("div", { className: f.selectContainer, children: [
169
- G(),
170
- /* @__PURE__ */ s(
171
- Q,
196
+ }, [t, y]), /* @__PURE__ */ m("div", { className: f.selectContainer, children: [
197
+ O(),
198
+ /* @__PURE__ */ o(
199
+ te,
172
200
  {
173
201
  anchorRef: u,
174
202
  open: t,
175
203
  onClose: () => l(!1),
176
- position: F,
204
+ position: X,
177
205
  disableOverlay: !0,
178
206
  className: f.modal,
179
- autoCloseCondition: w,
180
- children: /* @__PURE__ */ L("div", { ref: $, children: [
181
- V && /* @__PURE__ */ L("div", { children: [
182
- /* @__PURE__ */ s(
183
- H,
207
+ autoCloseCondition: y,
208
+ children: /* @__PURE__ */ m("div", { ref: M, children: [
209
+ J && /* @__PURE__ */ m("div", { children: [
210
+ /* @__PURE__ */ o(
211
+ I,
184
212
  {
185
213
  type: "text",
186
- placeholder: U,
214
+ placeholder: H,
187
215
  status: "ghost",
188
216
  sizeStyle: "s",
189
- value: K,
190
- onChange: (e) => M(e.target.value)
217
+ value: D,
218
+ onChange: (e) => Y(e.target.value)
191
219
  }
192
220
  ),
193
- /* @__PURE__ */ s("div", { className: f.searchWrapper })
221
+ /* @__PURE__ */ o("div", { className: f.searchWrapper })
194
222
  ] }),
195
- /* @__PURE__ */ L("div", { className: f.selectList, ref: N, children: [
196
- D.map((e) => /* @__PURE__ */ L(
223
+ /* @__PURE__ */ m("div", { className: f.selectList, ref: K, children: [
224
+ q.map((e) => /* @__PURE__ */ o(
197
225
  "div",
198
226
  {
199
- ref: (r) => j.current[e.value] = r,
200
- className: `${f.children} ${(n == null ? void 0 : n.value) === e.value ? f.active : ""}`,
201
- onClick: () => q(e),
227
+ ref: (n) => U.current[e.value] = n,
228
+ className: `${f.children} ${(r == null ? void 0 : r.value) === e.value ? f.active : ""}`,
229
+ onClick: () => Z(e),
202
230
  role: "option",
203
- "aria-selected": (n == null ? void 0 : n.value) === e.value,
204
- children: [
205
- e.icon && /* @__PURE__ */ s(_, { icon: e.icon, size: e.iconSize ? e.iconSize : 16 }),
206
- e.label && /* @__PURE__ */ s("div", { className: f.itemLabel, children: e.label })
207
- ]
231
+ "aria-selected": (r == null ? void 0 : r.value) === e.value,
232
+ children: F ? F(e) : /* @__PURE__ */ m(G, { children: [
233
+ e.icon && /* @__PURE__ */ o(T, { icon: e.icon, size: e.iconSize ? e.iconSize : 16 }),
234
+ e.label && /* @__PURE__ */ o("div", { className: f.itemLabel, children: e.label })
235
+ ] })
208
236
  },
209
237
  e.value
210
238
  )),
211
- D.length === 0 && /* @__PURE__ */ s("div", { className: `${f.noResults} textSmall`, children: "Aucun résultat" })
239
+ q.length === 0 && /* @__PURE__ */ o("div", { className: `${f.noResults} textSmall`, children: "Aucun résultat" })
212
240
  ] })
213
241
  ] })
214
242
  }
@@ -216,5 +244,5 @@ const X = "_selectContainer_133eb_54", Y = "_children_133eb_61", Z = "_active_13
216
244
  ] });
217
245
  };
218
246
  export {
219
- ve as Select
247
+ xe as Select
220
248
  };
@@ -3,7 +3,7 @@ import "../button/Button.js";
3
3
  import "react";
4
4
  import { Input as p } from "../input/Input.js";
5
5
  import "../icon-button/IconButton.js";
6
- import "../../index-CxdrhfJv.mjs";
6
+ import "react-dom";
7
7
  import "../accordion/Accordion.js";
8
8
  import "../modal/Modal.js";
9
9
  import "../carousel/Carousel.js";
@@ -4,7 +4,7 @@ import { n as v, s as C, a as x } from "../../X.es-BEJ-zMPl.mjs";
4
4
  import { Button as M } from "../button/Button.js";
5
5
  import "../icon-button/IconButton.js";
6
6
  import { TagCounter as w } from "../tag-counter/TagCounter.js";
7
- import "../../index-CxdrhfJv.mjs";
7
+ import "react-dom";
8
8
  import "../accordion/Accordion.js";
9
9
  import { Modal as y } from "../modal/Modal.js";
10
10
  import "../carousel/Carousel.js";
@@ -2,7 +2,7 @@ import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
2
  import { useState as $, useEffect as b } from "react";
3
3
  import "../button/Button.js";
4
4
  import { IconButton as k } from "../icon-button/IconButton.js";
5
- import "../../index-CxdrhfJv.mjs";
5
+ import "react-dom";
6
6
  import "../accordion/Accordion.js";
7
7
  import { Icon as g } from "../icon/Icon.js";
8
8
  import "../modal/Modal.js";