@vkzstudio/muza-ui 1.0.40 → 1.0.42

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,47 +1,48 @@
1
- import { jsx as r, jsxs as u } from "react/jsx-runtime";
2
- import f, { forwardRef as P, useId as _, useMemo as T, useRef as B, useEffect as L } from "react";
3
- import { triggerWrapperVariants as U } from "../Select/utils.js";
4
- import { useMuzaTranslations as G } from "../../translations/TranslationContext.js";
5
- import { Tag as p } from "../Tag/Tag.js";
6
- import { FormField as H } from "../FormField/FormField.js";
7
- import { DropdownMenu as J, DropdownMenuTrigger as K, DropdownMenuContent as Q, DropdownMenuCheckboxItem as X } from "../DropdownMenu/DropdownMenu.js";
8
- import { Typography as Y } from "../Typography/Typography.js";
9
- import { Flex as k } from "../Flex/Flex.js";
10
- import { AltArrowUpOutline as Z } from "@solar-icons/react-perf";
11
- import { cn as ee } from "../../utils/cn.js";
12
- const re = P(
13
- (I, h) => {
14
- const z = G(), {
15
- label: g,
16
- hint: x,
17
- error: b,
18
- options: o,
19
- onChange: i,
20
- value: t,
1
+ import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
+ import u, { forwardRef as L, useId as U, useMemo as k, useRef as G, useEffect as H } from "react";
3
+ import { triggerWrapperVariants as J } from "../Select/utils.js";
4
+ import { useMuzaTranslations as K } from "../../translations/TranslationContext.js";
5
+ import { Tag as f } from "../Tag/Tag.js";
6
+ import { FormField as Q } from "../FormField/FormField.js";
7
+ import { DropdownMenu as X, DropdownMenuTrigger as Y, DropdownMenuContent as Z, DropdownMenuCheckboxItem as ee } from "../DropdownMenu/DropdownMenu.js";
8
+ import { Typography as I } from "../Typography/Typography.js";
9
+ import { Flex as z } from "../Flex/Flex.js";
10
+ import { AltArrowUpOutline as te } from "@solar-icons/react-perf";
11
+ import { cn as re } from "../../utils/cn.js";
12
+ const ne = L(
13
+ (D, h) => {
14
+ const g = K(), {
15
+ label: x,
16
+ hint: b,
17
+ error: w,
18
+ options: i,
19
+ onChange: s,
20
+ value: r,
21
21
  disabled: c,
22
22
  prefix: d,
23
- maxNumberOfVisibleTags: a = 2,
24
- size: D,
23
+ maxNumberOfVisibleTags: o = 2,
24
+ size: O,
25
25
  placeholder: S,
26
- required: w,
27
- disableRequiredAsterisk: W,
28
- labelExtra: j,
29
- infoTooltip: A,
30
- collisionPadding: C
31
- } = I, v = S ?? z.select.placeholder, N = _(), F = g ? `${N}-label` : void 0, O = x ? `${N}-hint` : void 0, y = T(() => new Map(o.map((e) => [e.value, e.label])), [o]), q = T(() => {
32
- const e = t && t.map((n) => y.get(n));
33
- return e != null && e.length ? e.length <= a ? /* @__PURE__ */ r(
34
- k,
26
+ emptyMessage: W,
27
+ required: v,
28
+ disableRequiredAsterisk: j,
29
+ labelExtra: A,
30
+ infoTooltip: C,
31
+ collisionPadding: F
32
+ } = D, y = S ?? g.select.placeholder, q = W ?? g.select.noOptions, N = U(), E = x ? `${N}-label` : void 0, P = b ? `${N}-hint` : void 0, M = k(() => new Map(i.map((e) => [e.value, e.label])), [i]), V = k(() => {
33
+ const e = r && r.map((n) => M.get(n));
34
+ return e != null && e.length ? e.length <= o ? /* @__PURE__ */ t(
35
+ z,
35
36
  {
36
37
  gap: "xs",
37
38
  justify: "start",
38
39
  align: "start",
39
40
  flex: 1,
40
41
  className: "min-w-0",
41
- children: e.map((n, s) => /* @__PURE__ */ r(p, { variant: "info", className: "min-w-[50px] shrink-1", children: n }, s))
42
+ children: e.map((n, a) => /* @__PURE__ */ t(f, { variant: "info", className: "min-w-[50px] shrink-1", children: n }, a))
42
43
  }
43
- ) : /* @__PURE__ */ r(
44
- k,
44
+ ) : /* @__PURE__ */ t(
45
+ z,
45
46
  {
46
47
  gap: "xs",
47
48
  justify: "start",
@@ -49,61 +50,61 @@ const re = P(
49
50
  flex: 1,
50
51
  className: "min-w-0",
51
52
  children: [
52
- ...e.slice(0, a).map((n, s) => /* @__PURE__ */ r(
53
- p,
53
+ ...e.slice(0, o).map((n, a) => /* @__PURE__ */ t(
54
+ f,
54
55
  {
55
56
  variant: "info",
56
57
  className: "min-w-[50px] shrink-1 overflow-hidden",
57
- children: /* @__PURE__ */ r("span", { className: "truncate", children: n })
58
+ children: /* @__PURE__ */ t("span", { className: "truncate", children: n })
58
59
  },
59
- s
60
+ a
60
61
  )),
61
- /* @__PURE__ */ u(p, { variant: "info", children: [
62
- e.length - a,
62
+ /* @__PURE__ */ p(f, { variant: "info", children: [
63
+ e.length - o,
63
64
  "+"
64
65
  ] }, "more")
65
66
  ]
66
67
  }
67
- ) : /* @__PURE__ */ r(
68
- Y,
68
+ ) : /* @__PURE__ */ t(
69
+ I,
69
70
  {
70
71
  size: "input",
71
72
  className: "grow-1 fix-y-text truncate text-left text-comp-select-text-placeholder",
72
73
  weight: "regular",
73
74
  component: "span",
74
- children: v
75
+ children: y
75
76
  }
76
77
  );
77
- }, [t, v, a, y]), [M, E] = f.useState(!1), [R, V] = f.useState(0), m = f.useRef(!1), $ = B(null), l = (typeof h == "function" ? null : h) ?? $;
78
- return L(() => {
78
+ }, [r, y, o, M]), [R, $] = u.useState(!1), [T, _] = u.useState(0), m = u.useRef(!1), B = G(null), l = (typeof h == "function" ? null : h) ?? B;
79
+ return H(() => {
79
80
  const e = () => {
80
- l.current && V(l.current.offsetWidth);
81
+ l.current && _(l.current.offsetWidth);
81
82
  };
82
83
  e();
83
84
  const n = new ResizeObserver(e);
84
85
  return l.current && n.observe(l.current), () => {
85
86
  n.disconnect();
86
87
  };
87
- }, [l]), /* @__PURE__ */ r(
88
- H,
88
+ }, [l]), /* @__PURE__ */ t(
89
+ Q,
89
90
  {
90
- label: g,
91
- hint: x,
92
- error: b,
93
- required: w,
94
- disableRequiredAsterisk: W,
95
- labelId: F,
96
- hintId: O,
97
- labelExtra: j,
98
- infoTooltip: A,
99
- children: /* @__PURE__ */ u(
100
- J,
91
+ label: x,
92
+ hint: b,
93
+ error: w,
94
+ required: v,
95
+ disableRequiredAsterisk: j,
96
+ labelId: E,
97
+ hintId: P,
98
+ labelExtra: A,
99
+ infoTooltip: C,
100
+ children: /* @__PURE__ */ p(
101
+ X,
101
102
  {
102
103
  onOpenChange: (e) => {
103
- E(e);
104
+ $(e);
104
105
  },
105
106
  children: [
106
- /* @__PURE__ */ r(K, { disabled: c, asChild: !0, children: /* @__PURE__ */ r(
107
+ /* @__PURE__ */ t(Y, { disabled: c, asChild: !0, children: /* @__PURE__ */ t(
107
108
  "button",
108
109
  {
109
110
  ref: l,
@@ -111,53 +112,64 @@ const re = P(
111
112
  role: "input",
112
113
  tabIndex: 0,
113
114
  disabled: c,
114
- "aria-required": w,
115
- className: U({
116
- size: D,
117
- error: b,
118
- expanded: M,
119
- hasIcon: !!d || (t == null ? void 0 : t.length) === 0
115
+ "aria-required": v,
116
+ className: J({
117
+ size: O,
118
+ error: w,
119
+ expanded: R,
120
+ hasIcon: !!d || (r == null ? void 0 : r.length) === 0
120
121
  }),
121
- children: /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 items-center gap-sm", children: [
122
- d && /* @__PURE__ */ r(
122
+ children: /* @__PURE__ */ p("div", { className: "flex min-w-0 flex-1 items-center gap-sm", children: [
123
+ d && /* @__PURE__ */ t(
123
124
  "span",
124
125
  {
125
126
  className: c ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
126
127
  children: d
127
128
  }
128
129
  ),
129
- q,
130
- /* @__PURE__ */ r(
131
- Z,
130
+ V,
131
+ /* @__PURE__ */ t(
132
+ te,
132
133
  {
133
- className: ee(
134
+ className: re(
134
135
  "shrink-0 transition-transform duration-200",
135
- M ? "rotate-0" : "rotate-180"
136
+ R ? "rotate-0" : "rotate-180"
136
137
  )
137
138
  }
138
139
  )
139
140
  ] })
140
141
  }
141
142
  ) }),
142
- /* @__PURE__ */ r(
143
- Q,
143
+ /* @__PURE__ */ t(
144
+ Z,
144
145
  {
145
146
  className: "mt-1",
146
147
  style: {
147
- width: R > 0 ? `${R}px` : void 0
148
+ width: T > 0 ? `${T}px` : void 0
148
149
  },
149
150
  onCloseAutoFocus: (e) => {
150
151
  m.current || e.preventDefault(), m.current = !1;
151
152
  },
152
- collisionPadding: C,
153
- children: o.map((e) => /* @__PURE__ */ r(
154
- X,
153
+ collisionPadding: F,
154
+ children: i.length === 0 ? /* @__PURE__ */ t("div", { className: "px-lg py-md", role: "presentation", children: /* @__PURE__ */ t(
155
+ I,
155
156
  {
156
- checked: t == null ? void 0 : t.includes(e.value),
157
+ component: "span",
158
+ size: "input",
159
+ weight: "regular",
160
+ className: "text-comp-select-text-secondary",
161
+ children: q
162
+ }
163
+ ) }) : i.map((e) => /* @__PURE__ */ t(
164
+ ee,
165
+ {
166
+ checked: r == null ? void 0 : r.includes(e.value),
157
167
  disabled: e.disabled,
158
168
  icon: e.icon,
159
169
  onCheckedChange: (n) => {
160
- n ? i == null || i([...t || [], e.value]) : i == null || i((t || []).filter((s) => s !== e.value)), m.current = !0;
170
+ n ? s == null || s([...r || [], e.value]) : s == null || s(
171
+ (r || []).filter((a) => a !== e.value)
172
+ ), m.current = !0;
161
173
  },
162
174
  children: e.label
163
175
  },
@@ -172,7 +184,7 @@ const re = P(
172
184
  );
173
185
  }
174
186
  );
175
- re.displayName = "MultiSelect";
187
+ ne.displayName = "MultiSelect";
176
188
  export {
177
- re as MultiSelect
189
+ ne as MultiSelect
178
190
  };
@@ -15,4 +15,5 @@ export declare const ManyOptions: Story;
15
15
  export declare const WithLongLabels: Story;
16
16
  export declare const WithIconsInOptions: Story;
17
17
  export declare const WithDisabledOptions: Story;
18
+ export declare const NoOptions: Story;
18
19
  //# sourceMappingURL=MultiSelect.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect.stories.d.ts","sourceRoot":"","sources":["../../../src/components/MultiSelect/MultiSelect.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAQ3D,OAAO,EAAE,WAAW,EAAE,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AQ,EAAE,KAgBtB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA4DtB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAoBzB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAqB5B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAgBxB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAuBzB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KA2C5B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAoDhC,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAkCjC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAqBvB,CAAA"}
@@ -17,6 +17,8 @@ export interface ISelectProps {
17
17
  prefix?: ReactNode;
18
18
  /** Text shown when no option is selected. @default translations.select.placeholder */
19
19
  placeholder?: string;
20
+ /** Text shown inside the dropdown when `options` is empty. @default translations.select.noOptions */
21
+ emptyMessage?: string;
20
22
  /** Controls trigger height and padding. @default 'base' */
21
23
  size?: 'xs' | 'sm' | 'base' | 'lg';
22
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AAed,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gFAAgF;IAChF,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+EAA+E;IAC/E,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,kDAAkD;IAClD,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,s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AM,CAAC,EAAE,SAAS,CAAA;IAClB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qGAAqG;IACrG,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAClC;;;;;;;;;;OAUG;IACH,OAAO,EAAE,KAAK,CAAC;QACb,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,SAAS,CAAA;QAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,IAAI,CAAC,EAAE,SAAS,CAAA;KACjB,CAAC,CAAA;IACF,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,8EAA8E;IAC9E,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,gHAAgH;IAChH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,gHAAgH;IAChH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,MAAM,wFAyMlB,CAAA"}
@@ -1,35 +1,36 @@
1
- import { jsx as t, jsxs as y } from "react/jsx-runtime";
2
- import u, { forwardRef as k, useId as P, useMemo as _, useRef as N, useEffect as S } from "react";
3
- import { triggerWrapperVariants as B } from "./utils.js";
4
- import { useMuzaTranslations as G } from "../../translations/TranslationContext.js";
5
- import { FormField as L } from "../FormField/FormField.js";
6
- import { Typography as T } from "../Typography/Typography.js";
7
- import { DropdownMenu as U, DropdownMenuTrigger as H, DropdownMenuContent as J, DropdownMenuRadioGroup as K, DropdownMenuRadioItem as Q } from "../DropdownMenu/DropdownMenu.js";
8
- import { AltArrowUpOutline as X } from "@solar-icons/react-perf";
9
- import { cn as Y } from "../../utils/cn.js";
10
- const Z = k(
11
- (I, p) => {
12
- const M = G(), {
13
- label: f,
14
- hint: m,
15
- error: h,
16
- options: i,
17
- onChange: s,
1
+ import { jsx as t, jsxs as M } from "react/jsx-runtime";
2
+ import u, { forwardRef as _, useId as B, useMemo as G, useRef as S, useEffect as T } from "react";
3
+ import { triggerWrapperVariants as L } from "./utils.js";
4
+ import { useMuzaTranslations as U } from "../../translations/TranslationContext.js";
5
+ import { FormField as H } from "../FormField/FormField.js";
6
+ import { Typography as p } from "../Typography/Typography.js";
7
+ import { DropdownMenu as J, DropdownMenuTrigger as K, DropdownMenuContent as Q, DropdownMenuRadioGroup as X, DropdownMenuRadioItem as Y } from "../DropdownMenu/DropdownMenu.js";
8
+ import { AltArrowUpOutline as Z } from "@solar-icons/react-perf";
9
+ import { cn as ee } from "../../utils/cn.js";
10
+ const te = _(
11
+ (z, m) => {
12
+ const f = U(), {
13
+ label: h,
14
+ hint: g,
15
+ error: x,
16
+ options: l,
17
+ onChange: i,
18
18
  value: r,
19
19
  disabled: a,
20
- prefix: g,
21
- size: z,
22
- placeholder: D,
23
- shouldScrollToSelectedOption: x,
24
- collisionPadding: O,
25
- required: b,
26
- disableRequiredAsterisk: W,
27
- labelExtra: A,
28
- infoTooltip: C
29
- } = I, w = D ?? M.select.placeholder, v = P(), V = f ? `${v}-label` : void 0, q = m ? `${v}-hint` : void 0, E = _(() => {
30
- const e = r && i.find((o) => o.value === r);
20
+ prefix: b,
21
+ size: I,
22
+ placeholder: O,
23
+ emptyMessage: D,
24
+ shouldScrollToSelectedOption: w,
25
+ collisionPadding: W,
26
+ required: y,
27
+ disableRequiredAsterisk: A,
28
+ labelExtra: C,
29
+ infoTooltip: V
30
+ } = z, v = O ?? f.select.placeholder, q = D ?? f.select.noOptions, R = B(), E = h ? `${R}-label` : void 0, F = g ? `${R}-hint` : void 0, P = G(() => {
31
+ const e = r && l.find((o) => o.value === r);
31
32
  return e ? typeof e.label != "function" ? /* @__PURE__ */ t(
32
- T,
33
+ p,
33
34
  {
34
35
  size: "input",
35
36
  className: "grow-1 fix-y-text truncate text-left text-comp-select-text-primary",
@@ -38,49 +39,49 @@ const Z = k(
38
39
  children: e.label
39
40
  }
40
41
  ) : e.label : /* @__PURE__ */ t(
41
- T,
42
+ p,
42
43
  {
43
44
  size: "input",
44
45
  className: "grow-1 fix-y-text truncate text-left text-comp-select-text-placeholder",
45
46
  weight: "regular",
46
47
  component: "span",
47
- children: w
48
+ children: v
48
49
  }
49
50
  );
50
- }, [i, r, w]), [l, F] = u.useState(!1), [R, $] = u.useState(0), c = u.useRef(!1), j = N(null), d = N({}), n = (typeof p == "function" ? null : p) ?? j;
51
- return S(() => {
51
+ }, [l, r, v]), [s, $] = u.useState(!1), [N, j] = u.useState(0), c = u.useRef(!1), k = S(null), d = S({}), n = (typeof m == "function" ? null : m) ?? k;
52
+ return T(() => {
52
53
  const e = () => {
53
- n.current && $(n.current.offsetWidth);
54
+ n.current && j(n.current.offsetWidth);
54
55
  };
55
56
  e();
56
57
  const o = new ResizeObserver(e);
57
58
  return n.current && o.observe(n.current), () => {
58
59
  o.disconnect();
59
60
  };
60
- }, [n]), S(() => {
61
+ }, [n]), T(() => {
61
62
  var e;
62
- l && r && d.current[r] && x && ((e = d.current[r]) == null || e.scrollIntoView({ block: "nearest" }));
63
- }, [l, x, r]), /* @__PURE__ */ t(
64
- L,
63
+ s && r && d.current[r] && w && ((e = d.current[r]) == null || e.scrollIntoView({ block: "nearest" }));
64
+ }, [s, w, r]), /* @__PURE__ */ t(
65
+ H,
65
66
  {
66
- label: f,
67
- hint: m,
68
- error: h,
69
- required: b,
70
- disableRequiredAsterisk: W,
71
- labelId: V,
72
- hintId: q,
73
- labelExtra: A,
74
- infoTooltip: C,
67
+ label: h,
68
+ hint: g,
69
+ error: x,
70
+ required: y,
71
+ disableRequiredAsterisk: A,
72
+ labelId: E,
73
+ hintId: F,
74
+ labelExtra: C,
75
+ infoTooltip: V,
75
76
  className: "flex-1",
76
- children: /* @__PURE__ */ y(
77
- U,
77
+ children: /* @__PURE__ */ M(
78
+ J,
78
79
  {
79
80
  onOpenChange: (e) => {
80
- F(e);
81
+ $(e);
81
82
  },
82
83
  children: [
83
- /* @__PURE__ */ t(H, { disabled: a, asChild: !0, children: /* @__PURE__ */ t(
84
+ /* @__PURE__ */ t(K, { disabled: a, asChild: !0, children: /* @__PURE__ */ t(
84
85
  "button",
85
86
  {
86
87
  ref: n,
@@ -88,23 +89,23 @@ const Z = k(
88
89
  role: "input",
89
90
  tabIndex: 0,
90
91
  disabled: a,
91
- "aria-required": b,
92
- className: B({ size: z, error: h, expanded: l }),
93
- children: /* @__PURE__ */ y("div", { className: "flex min-w-0 flex-1 items-center gap-sm", children: [
94
- g && /* @__PURE__ */ t(
92
+ "aria-required": y,
93
+ className: L({ size: I, error: x, expanded: s }),
94
+ children: /* @__PURE__ */ M("div", { className: "flex min-w-0 flex-1 items-center gap-sm", children: [
95
+ b && /* @__PURE__ */ t(
95
96
  "span",
96
97
  {
97
98
  className: a ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
98
- children: g
99
+ children: b
99
100
  }
100
101
  ),
101
- E,
102
+ P,
102
103
  /* @__PURE__ */ t(
103
- X,
104
+ Z,
104
105
  {
105
- className: Y(
106
+ className: ee(
106
107
  "transition-transform duration-200",
107
- l ? "rotate-0" : "rotate-180"
108
+ s ? "rotate-0" : "rotate-180"
108
109
  )
109
110
  }
110
111
  )
@@ -112,25 +113,34 @@ const Z = k(
112
113
  }
113
114
  ) }),
114
115
  /* @__PURE__ */ t(
115
- J,
116
+ Q,
116
117
  {
117
118
  className: "mt-1",
118
119
  style: {
119
- width: R > 0 ? `${R}px` : void 0
120
+ width: N > 0 ? `${N}px` : void 0
120
121
  },
121
122
  onCloseAutoFocus: (e) => {
122
123
  c.current || e.preventDefault(), c.current = !1;
123
124
  },
124
- collisionPadding: O,
125
- children: /* @__PURE__ */ t(
126
- K,
125
+ collisionPadding: W,
126
+ children: l.length === 0 ? /* @__PURE__ */ t("div", { className: "px-lg py-md", role: "presentation", children: /* @__PURE__ */ t(
127
+ p,
128
+ {
129
+ component: "span",
130
+ size: "input",
131
+ weight: "regular",
132
+ className: "text-comp-select-text-secondary",
133
+ children: q
134
+ }
135
+ ) }) : /* @__PURE__ */ t(
136
+ X,
127
137
  {
128
138
  value: r,
129
139
  onValueChange: (e) => {
130
- c.current = !0, s == null || s(e);
140
+ c.current = !0, i == null || i(e);
131
141
  },
132
- children: i.map((e) => /* @__PURE__ */ t(
133
- Q,
142
+ children: l.map((e) => /* @__PURE__ */ t(
143
+ Y,
134
144
  {
135
145
  value: e.value.toString(),
136
146
  disabled: e.disabled,
@@ -153,7 +163,7 @@ const Z = k(
153
163
  );
154
164
  }
155
165
  );
156
- Z.displayName = "Select";
166
+ te.displayName = "Select";
157
167
  export {
158
- Z as Select
168
+ te as Select
159
169
  };
@@ -15,4 +15,5 @@ export declare const Interactive: Story;
15
15
  export declare const WithPrefix: Story;
16
16
  export declare const WithIconsInOptions: Story;
17
17
  export declare const WithDisabledOptions: Story;
18
+ export declare const NoOptions: Story;
18
19
  //# sourceMappingURL=Select.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAS3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAgH7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA;AA6BpC,eAAO,MAAM,OAAO,EAAE,KAwBrB,CAAA;AAED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