@vkzstudio/muza-ui 1.0.44 → 1.0.45

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.
Files changed (84) hide show
  1. package/dist/components/DataTable/DataTable.d.ts +14 -5
  2. package/dist/components/DataTable/DataTable.d.ts.map +1 -1
  3. package/dist/components/DataTable/DataTable.js +39 -39
  4. package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -1
  5. package/dist/components/DropdownMenu/DropdownMenu.d.ts +38 -7
  6. package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  7. package/dist/components/DropdownMenu/DropdownMenu.js +165 -163
  8. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +3 -17
  9. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
  10. package/dist/components/ExpandableTable/ExpandableTable.d.ts +30 -11
  11. package/dist/components/ExpandableTable/ExpandableTable.d.ts.map +1 -1
  12. package/dist/components/ExpandableTable/ExpandableTable.js +100 -111
  13. package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts +3 -1
  14. package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts.map +1 -1
  15. package/dist/components/FileUpload/FileItem.d.ts +6 -0
  16. package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
  17. package/dist/components/FileUpload/FileItem.js +38 -41
  18. package/dist/components/FileUpload/FileUpload.d.ts +32 -0
  19. package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
  20. package/dist/components/FileUpload/FileUpload.js +87 -83
  21. package/dist/components/FileUpload/FileUpload.stories.d.ts +1 -0
  22. package/dist/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
  23. package/dist/components/Flex/Flex.d.ts +1 -1
  24. package/dist/components/Icons/CustomBadges.d.ts +14 -0
  25. package/dist/components/Icons/CustomBadges.d.ts.map +1 -0
  26. package/dist/components/Icons/CustomBadges.js +334 -0
  27. package/dist/components/Icons/CustomIcons.d.ts +24 -0
  28. package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
  29. package/dist/components/Icons/CustomIcons.js +88 -42
  30. package/dist/components/Icons/CustomLogos.d.ts +29 -0
  31. package/dist/components/Icons/CustomLogos.d.ts.map +1 -0
  32. package/dist/components/Icons/CustomLogos.js +593 -0
  33. package/dist/components/Icons/LogosAndBadges.stories.d.ts +7 -0
  34. package/dist/components/Icons/LogosAndBadges.stories.d.ts.map +1 -0
  35. package/dist/components/Icons/index.d.ts +2 -0
  36. package/dist/components/Icons/index.d.ts.map +1 -1
  37. package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts +24 -1
  38. package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
  39. package/dist/components/LanguageSwitcher/LanguageSwitcher.js +71 -52
  40. package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts +2 -0
  41. package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts.map +1 -1
  42. package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  43. package/dist/components/MultiSelect/MultiSelect.js +18 -17
  44. package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.d.ts +266 -0
  45. package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.d.ts.map +1 -0
  46. package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.examples.d.ts +39 -0
  47. package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.examples.d.ts.map +1 -0
  48. package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.js +134 -0
  49. package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.stories.d.ts +14 -0
  50. package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.stories.d.ts.map +1 -0
  51. package/dist/components/ResponsiveLayoutTable/index.d.ts +2 -0
  52. package/dist/components/ResponsiveLayoutTable/index.d.ts.map +1 -0
  53. package/dist/components/Select/Select.d.ts +20 -7
  54. package/dist/components/Select/Select.d.ts.map +1 -1
  55. package/dist/components/Select/Select.js +123 -92
  56. package/dist/components/Select/Select.stories.d.ts +1 -0
  57. package/dist/components/Select/Select.stories.d.ts.map +1 -1
  58. package/dist/components/Select/utils.d.ts +1 -0
  59. package/dist/components/Select/utils.d.ts.map +1 -1
  60. package/dist/components/Select/utils.js +5 -2
  61. package/dist/components/Toggle/Toggle.js +1 -1
  62. package/dist/components/ToggleCheckButton/ToggleCheckButton.d.ts +69 -0
  63. package/dist/components/ToggleCheckButton/ToggleCheckButton.d.ts.map +1 -0
  64. package/dist/components/ToggleCheckButton/ToggleCheckButton.js +64 -0
  65. package/dist/components/ToggleCheckButton/ToggleCheckButton.stories.d.ts +8 -0
  66. package/dist/components/ToggleCheckButton/ToggleCheckButton.stories.d.ts.map +1 -0
  67. package/dist/components/ToggleCheckButton/index.d.ts +2 -0
  68. package/dist/components/ToggleCheckButton/index.d.ts.map +1 -0
  69. package/dist/components/WebCheckoutNav/WebCheckoutNav.examples.d.ts +19 -0
  70. package/dist/components/WebCheckoutNav/WebCheckoutNav.examples.d.ts.map +1 -0
  71. package/dist/components/WebCheckoutNav/WebCheckoutNav.stories.d.ts +8 -0
  72. package/dist/components/WebCheckoutNav/WebCheckoutNav.stories.d.ts.map +1 -0
  73. package/dist/components/index.d.ts +2 -0
  74. package/dist/components/index.d.ts.map +1 -1
  75. package/dist/hooks/use-is-breakpoint.d.ts +11 -0
  76. package/dist/hooks/use-is-breakpoint.d.ts.map +1 -1
  77. package/dist/hooks/use-is-breakpoint.js +24 -13
  78. package/dist/index.js +236 -215
  79. package/dist/muza-ui.css +1 -1
  80. package/dist/styles/token-colors.css +64 -3
  81. package/dist/styles/token-sizes.css +86 -54
  82. package/dist/utils/cn.d.ts.map +1 -1
  83. package/dist/utils/cn.js +16 -5
  84. package/package.json +1 -1
@@ -0,0 +1,134 @@
1
+ import { jsx as r, jsxs as T } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useBreakpoints as E } from "../../hooks/use-is-breakpoint.js";
4
+ import { Skeleton as H } from "../Skeleton/Skeleton.js";
5
+ import { cn as l } from "../../utils/cn.js";
6
+ import { typographyVariants as S, Typography as V } from "../Typography/Typography.js";
7
+ const J = ({
8
+ data: y,
9
+ layouts: n,
10
+ onRowClick: f,
11
+ disabled: o = !1,
12
+ isRowNew: h,
13
+ isRowLoading: d,
14
+ overflowingRowBackground: i = !1,
15
+ classNames: c,
16
+ tableLayout: x,
17
+ ...k
18
+ }) => {
19
+ const K = E(), g = (() => {
20
+ for (const e of n) {
21
+ if (e.responsive === void 0) return e;
22
+ if (typeof e.responsive == "boolean") {
23
+ if (e.responsive) return e;
24
+ } else if (K[e.responsive])
25
+ return e;
26
+ }
27
+ return n[n.length - 1];
28
+ })(), {
29
+ columns: u,
30
+ showHeader: m = !0,
31
+ classNames: p
32
+ } = g, j = !!f && !o;
33
+ return /* @__PURE__ */ r(
34
+ "div",
35
+ {
36
+ className: l(
37
+ "w-full",
38
+ i ? "overflow-visible" : "overflow-x-auto overflow-y-hidden",
39
+ c == null ? void 0 : c.root
40
+ ),
41
+ ...k,
42
+ children: /* @__PURE__ */ T(
43
+ "table",
44
+ {
45
+ className: l("w-full border-collapse", {
46
+ "table-fixed": x === "fixed"
47
+ }),
48
+ children: [
49
+ m && /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { className: l(p == null ? void 0 : p.header), children: u.map((e, s) => /* @__PURE__ */ r(
50
+ "th",
51
+ {
52
+ className: l(
53
+ S({
54
+ size: "sm",
55
+ uppercase: !0,
56
+ variant: "body",
57
+ weight: "medium"
58
+ }),
59
+ "h-comp-webcheckout-table-cells-h-first-row",
60
+ "px-comp-webcheckout-table-cells-p-hor py-comp-webcheckout-table-cells-p-ver text-left",
61
+ "text-text-dark-secondary",
62
+ { "text-text-dark-disabled": o },
63
+ e.className
64
+ ),
65
+ children: e.title
66
+ },
67
+ s
68
+ )) }) }),
69
+ /* @__PURE__ */ r("tbody", { children: y.map((e, s) => {
70
+ const a = (d == null ? void 0 : d(e, s)) ?? !1, v = !a && ((h == null ? void 0 : h(e, s)) ?? !1), b = j && !a;
71
+ return /* @__PURE__ */ r(
72
+ "tr",
73
+ {
74
+ className: l(
75
+ "border-t border-stroke-base-secondary",
76
+ !m && "first:border-t-0",
77
+ {
78
+ "relative before:absolute before:inset-0 before:content-['']": i,
79
+ "bg-comp-responsive-layout-table-bg-success": !i && v,
80
+ "before:bg-comp-responsive-layout-table-bg-success": i && v,
81
+ "cursor-pointer": b,
82
+ "outline-0 hover:bg-surface-state-bg-info focus-visible:bg-surface-state-bg-info": b && !i,
83
+ "outline-0 hover:before:bg-surface-state-bg-info focus-visible:before:bg-surface-state-bg-info": b && i
84
+ },
85
+ i && (c == null ? void 0 : c.rowBackgroundInset),
86
+ p == null ? void 0 : p.row
87
+ ),
88
+ onClick: b ? () => f(e, s) : void 0,
89
+ onKeyDown: b ? (t) => {
90
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), f(e, s));
91
+ } : void 0,
92
+ tabIndex: b ? 0 : void 0,
93
+ "aria-busy": a || void 0,
94
+ children: u.map((t, z) => /* @__PURE__ */ r(
95
+ "td",
96
+ {
97
+ className: l(
98
+ "h-comp-webcheckout-table-cells-h w-full",
99
+ "px-comp-webcheckout-table-cells-p-hor py-comp-webcheckout-table-cells-p-ver",
100
+ i && "relative",
101
+ t.className
102
+ ),
103
+ children: a ? t.skeleton ?? /* @__PURE__ */ r(H, { color: "light", className: "h-4 w-full" }) : t.render ? t.render(e, s, o) : /* @__PURE__ */ r(
104
+ V,
105
+ {
106
+ variant: "body",
107
+ size: "base",
108
+ weight: "medium",
109
+ component: "span",
110
+ fixY: !0,
111
+ className: l({
112
+ "line-clamp-1": t.lineClamp === !0 || t.lineClamp === 1,
113
+ "line-clamp-2": t.lineClamp === 2,
114
+ "text-text-dark-disabled": o
115
+ }),
116
+ children: t.dataKey ? e[t.dataKey] : null
117
+ }
118
+ )
119
+ },
120
+ z
121
+ ))
122
+ },
123
+ e.id
124
+ );
125
+ }) })
126
+ ]
127
+ }
128
+ )
129
+ }
130
+ );
131
+ };
132
+ export {
133
+ J as ResponsiveLayoutTable
134
+ };
@@ -0,0 +1,14 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ type Story = StoryObj;
5
+ export declare const Default: Story;
6
+ export declare const WithRowClick: Story;
7
+ export declare const WithNewRow: Story;
8
+ export declare const NewRowWithRowClick: Story;
9
+ export declare const OverflowingRowBackground: Story;
10
+ export declare const Disabled: Story;
11
+ export declare const Loading: Story;
12
+ export declare const LoadingMore: Story;
13
+ export declare const CustomBreakpoint: Story;
14
+ //# sourceMappingURL=ResponsiveLayoutTable.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponsiveLayoutTable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ResponsiveLayoutTable/ResponsiveLayoutTable.stories.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAiB3D,QAAA,MAAM,IAAI,EAAE,IAoDX,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAA;AAErB,eAAO,MAAM,OAAO,EAAE,KAmBrB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAuB1B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAoBxB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAwBhC,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,KA8BtC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAA;AAUD,eAAO,MAAM,OAAO,EAAE,KAoBrB,CAAA;AAeD,eAAO,MAAM,WAAW,EAAE,KAwBzB,CAAA;AAID,eAAO,MAAM,gBAAgB,EAAE,KA6B9B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { ResponsiveLayoutTable, type ResponsiveLayoutTableProps, type ResponsiveLayoutTableLayout, type ResponsiveLayoutTableColumn, type ResponsiveLayoutTableClassNames, type ResponsiveLayoutTableLayoutClassNames, } from './ResponsiveLayoutTable';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ResponsiveLayoutTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,KAAK,qCAAqC,GAC3C,MAAM,yBAAyB,CAAA"}
@@ -6,6 +6,7 @@ import { default as React, ReactNode } from 'react';
6
6
  * const options: ISelectOption[] = [
7
7
  * { value: 'a', label: 'Option A' },
8
8
  * { value: 'b', label: 'Option B', disabled: true, icon: <Icon /> },
9
+ * { value: 'c', label: 'Location C', description: 'Address line' },
9
10
  * ]
10
11
  */
11
12
  export interface ISelectOption {
@@ -13,6 +14,8 @@ export interface ISelectOption {
13
14
  value: string;
14
15
  /** Visible label rendered inside the dropdown item and in the trigger when selected. */
15
16
  label: ReactNode;
17
+ /** Secondary text rendered below the label, producing a two-line layout. */
18
+ description?: ReactNode;
16
19
  /** Prevents the option from being selected and applies disabled styling. @default false */
17
20
  disabled?: boolean;
18
21
  /** Icon rendered before the option label inside the dropdown. */
@@ -20,23 +23,25 @@ export interface ISelectOption {
20
23
  }
21
24
  /**
22
25
  * Props for the Select component.
26
+ *
27
+ * @see ISelectOption
23
28
  */
24
29
  export interface ISelectProps {
25
- /** Label text displayed above the select trigger. */
30
+ /** Label text rendered above the trigger by `FormField`. */
26
31
  label?: string;
27
- /** Helper text displayed below the select. Renders in error color when `error` is true. */
32
+ /** Helper text rendered below the trigger. Switches to the error color when `error` is `true`. */
28
33
  hint?: string;
29
- /** Applies error styling to the trigger border and hint text. @default false */
34
+ /** Applies error styling to the trigger border and `hint` text. @default false */
30
35
  error?: boolean;
31
36
  /** Marks the field as required and shows an asterisk next to the label. @default false */
32
37
  required?: boolean;
33
- /** Hides the required asterisk even when `required` is true. @default false */
38
+ /** Hides the required asterisk even when `required` is `true`. @default false */
34
39
  disableRequiredAsterisk?: boolean;
35
40
  /** Element rendered after the selected value inside the trigger. */
36
41
  suffix?: ReactNode;
37
42
  /** Icon or element rendered before the selected value inside the trigger. */
38
43
  prefix?: ReactNode;
39
- /** Text shown when no option is selected. @default translations.select.placeholder */
44
+ /** Placeholder text shown when no option is selected. @default translations.select.placeholder */
40
45
  placeholder?: string;
41
46
  /** Text shown inside the dropdown when `options` is empty. @default translations.select.noOptions */
42
47
  emptyMessage?: string;
@@ -51,6 +56,7 @@ export interface ISelectProps {
51
56
  * options={[
52
57
  * { value: 'a', label: 'Option A' },
53
58
  * { value: 'b', label: 'Option B', disabled: true, icon: <Icon /> },
59
+ * { value: 'c', label: 'Location C', description: 'Address line' },
54
60
  * ]}
55
61
  * />
56
62
  */
@@ -59,9 +65,16 @@ export interface ISelectProps {
59
65
  disabled?: boolean;
60
66
  /** Controlled selected value. Must match a `value` field in `options`. */
61
67
  value?: string;
62
- /** Fires when the selected value changes. Receives the new value string. */
68
+ /**
69
+ * Fires when the user picks an option. Receives the newly selected `value` string.
70
+ *
71
+ * @example
72
+ * ```tsx
73
+ * <Select onChange={(value) => setSelected(value)} />
74
+ * ```
75
+ */
63
76
  onChange?: (value: string) => void;
64
- /** Scrolls the dropdown to the selected option when opened. @default false */
77
+ /** Scrolls the dropdown to the selected option when it opens. @default false */
65
78
  shouldScrollToSelectedOption?: boolean;
66
79
  /** Distance in pixels from the viewport edge before the dropdown repositions. Passed to Radix collision padding. */
67
80
  collisionPadding?: number;
@@ -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;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/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AOG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,gFAAgF;IAChF,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,oHAAoH;IACpH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,6HAA6H;IAC7H,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,sGAAsG;IACtG,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,MAAM,wFA+OlB,CAAA"}
@@ -1,111 +1,140 @@
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
- value: r,
19
- disabled: a,
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);
32
- return e ? typeof e.label != "function" ? /* @__PURE__ */ t(
33
- p,
1
+ import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
+ import f, { forwardRef as G, useId as L, useMemo as U, useRef as S, useEffect as T } from "react";
3
+ import { triggerWrapperVariants as H } from "./utils.js";
4
+ import { useMuzaTranslations as J } from "../../translations/TranslationContext.js";
5
+ import { FormField as K } from "../FormField/FormField.js";
6
+ import { Typography as o } from "../Typography/Typography.js";
7
+ import { Flex as Q } from "../Flex/Flex.js";
8
+ import { DropdownMenu as X, DropdownMenuTrigger as Y, DropdownMenuContent as Z, DropdownMenuRadioGroup as ee, DropdownMenuRadioItem as te } from "../DropdownMenu/DropdownMenu.js";
9
+ import { cn as D } from "../../utils/cn.js";
10
+ import { AltArrowUpOutline as re } from "@solar-icons/react-perf";
11
+ const ne = G(
12
+ (I, h) => {
13
+ const g = J(), {
14
+ label: x,
15
+ hint: b,
16
+ error: w,
17
+ options: a,
18
+ onChange: d,
19
+ value: n,
20
+ disabled: s,
21
+ prefix: y,
22
+ size: O,
23
+ placeholder: W,
24
+ emptyMessage: A,
25
+ shouldScrollToSelectedOption: v,
26
+ collisionPadding: C,
27
+ required: N,
28
+ disableRequiredAsterisk: F,
29
+ labelExtra: V,
30
+ infoTooltip: q
31
+ } = I, R = W ?? g.select.placeholder, E = A ?? g.select.noOptions, M = L(), P = x ? `${M}-label` : void 0, $ = b ? `${M}-hint` : void 0, r = n ? a.find((e) => e.value === n) : void 0, j = U(() => r ? r.description ? /* @__PURE__ */ u(Q, { flex: 1, direction: "column", className: "min-w-0 text-left", children: [
32
+ /* @__PURE__ */ t(
33
+ o,
34
34
  {
35
- size: "input",
36
- className: "grow-1 fix-y-text truncate text-left text-comp-select-text-primary",
35
+ size: "sm",
36
+ variant: "title",
37
37
  weight: "medium",
38
38
  component: "span",
39
- children: e.label
39
+ className: "truncate text-comp-select-text-primary",
40
+ children: r.label
40
41
  }
41
- ) : e.label : /* @__PURE__ */ t(
42
- p,
42
+ ),
43
+ /* @__PURE__ */ t(
44
+ o,
43
45
  {
44
- size: "input",
45
- className: "grow-1 fix-y-text truncate text-left text-comp-select-text-placeholder",
46
+ size: "sm",
47
+ variant: "body",
46
48
  weight: "regular",
47
49
  component: "span",
48
- children: v
50
+ className: "truncate text-comp-select-text-primary",
51
+ children: r.description
49
52
  }
50
- );
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;
53
+ )
54
+ ] }) : typeof r.label != "function" ? /* @__PURE__ */ t(
55
+ o,
56
+ {
57
+ size: "input",
58
+ className: "grow-1 fix-y-text truncate text-left text-comp-select-text-primary",
59
+ weight: "medium",
60
+ component: "span",
61
+ children: r.label
62
+ }
63
+ ) : r.label : /* @__PURE__ */ t(
64
+ o,
65
+ {
66
+ size: "input",
67
+ className: "grow-1 fix-y-text truncate text-left text-comp-select-text-placeholder",
68
+ weight: "regular",
69
+ component: "span",
70
+ children: R
71
+ }
72
+ ), [r, R]), [l, k] = f.useState(!1), [z, _] = f.useState(0), p = f.useRef(!1), B = S(null), m = S({}), i = (typeof h == "function" ? null : h) ?? B;
52
73
  return T(() => {
53
74
  const e = () => {
54
- n.current && j(n.current.offsetWidth);
75
+ i.current && _(i.current.offsetWidth);
55
76
  };
56
77
  e();
57
- const o = new ResizeObserver(e);
58
- return n.current && o.observe(n.current), () => {
59
- o.disconnect();
78
+ const c = new ResizeObserver(e);
79
+ return i.current && c.observe(i.current), () => {
80
+ c.disconnect();
60
81
  };
61
- }, [n]), T(() => {
82
+ }, [i]), T(() => {
62
83
  var e;
63
- s && r && d.current[r] && w && ((e = d.current[r]) == null || e.scrollIntoView({ block: "nearest" }));
64
- }, [s, w, r]), /* @__PURE__ */ t(
65
- H,
84
+ l && n && m.current[n] && v && ((e = m.current[n]) == null || e.scrollIntoView({ block: "nearest" }));
85
+ }, [l, v, n]), /* @__PURE__ */ t(
86
+ K,
66
87
  {
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,
88
+ label: x,
89
+ hint: b,
90
+ error: w,
91
+ required: N,
92
+ disableRequiredAsterisk: F,
93
+ labelId: P,
94
+ hintId: $,
95
+ labelExtra: V,
96
+ infoTooltip: q,
76
97
  className: "flex-1",
77
- children: /* @__PURE__ */ M(
78
- J,
98
+ children: /* @__PURE__ */ u(
99
+ X,
79
100
  {
80
101
  onOpenChange: (e) => {
81
- $(e);
102
+ k(e);
82
103
  },
83
104
  children: [
84
- /* @__PURE__ */ t(K, { disabled: a, asChild: !0, children: /* @__PURE__ */ t(
105
+ /* @__PURE__ */ t(Y, { disabled: s, asChild: !0, children: /* @__PURE__ */ t(
85
106
  "button",
86
107
  {
87
- ref: n,
108
+ ref: i,
88
109
  type: "button",
89
110
  role: "input",
90
111
  tabIndex: 0,
91
- disabled: a,
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(
112
+ disabled: s,
113
+ "aria-required": N,
114
+ className: D(
115
+ H({
116
+ size: O,
117
+ error: w,
118
+ expanded: l,
119
+ hasDescription: !!(r != null && r.description)
120
+ })
121
+ ),
122
+ children: /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 items-center gap-sm", children: [
123
+ y && /* @__PURE__ */ t(
96
124
  "span",
97
125
  {
98
- className: a ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
99
- children: b
126
+ className: s ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
127
+ children: y
100
128
  }
101
129
  ),
102
- P,
130
+ j,
103
131
  /* @__PURE__ */ t(
104
- Z,
132
+ re,
105
133
  {
106
- className: ee(
134
+ className: D(
107
135
  "transition-transform duration-200",
108
- s ? "rotate-0" : "rotate-180"
136
+ l ? "rotate-0" : "rotate-180",
137
+ s ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def"
109
138
  )
110
139
  }
111
140
  )
@@ -113,40 +142,42 @@ const te = _(
113
142
  }
114
143
  ) }),
115
144
  /* @__PURE__ */ t(
116
- Q,
145
+ Z,
117
146
  {
118
147
  className: "mt-1",
119
148
  style: {
120
- width: N > 0 ? `${N}px` : void 0
149
+ width: z > 0 ? `${z}px` : void 0
121
150
  },
151
+ align: "center",
122
152
  onCloseAutoFocus: (e) => {
123
- c.current || e.preventDefault(), c.current = !1;
153
+ p.current || e.preventDefault(), p.current = !1;
124
154
  },
125
- collisionPadding: W,
126
- children: l.length === 0 ? /* @__PURE__ */ t("div", { className: "px-lg py-md", role: "presentation", children: /* @__PURE__ */ t(
127
- p,
155
+ collisionPadding: C,
156
+ children: a.length === 0 ? /* @__PURE__ */ t("div", { className: "px-lg py-md", role: "presentation", children: /* @__PURE__ */ t(
157
+ o,
128
158
  {
129
159
  component: "span",
130
160
  size: "input",
131
161
  weight: "regular",
132
162
  className: "text-comp-select-text-secondary",
133
- children: q
163
+ children: E
134
164
  }
135
165
  ) }) : /* @__PURE__ */ t(
136
- X,
166
+ ee,
137
167
  {
138
- value: r,
168
+ value: n,
139
169
  onValueChange: (e) => {
140
- c.current = !0, i == null || i(e);
170
+ p.current = !0, d == null || d(e);
141
171
  },
142
- children: l.map((e) => /* @__PURE__ */ t(
143
- Y,
172
+ children: a.map((e) => /* @__PURE__ */ t(
173
+ te,
144
174
  {
145
175
  value: e.value.toString(),
146
176
  disabled: e.disabled,
147
177
  icon: e.icon,
148
- ref: (o) => {
149
- d.current[e.value] = o;
178
+ description: e.description,
179
+ ref: (c) => {
180
+ m.current[e.value] = c;
150
181
  },
151
182
  children: e.label
152
183
  },
@@ -163,7 +194,7 @@ const te = _(
163
194
  );
164
195
  }
165
196
  );
166
- te.displayName = "Select";
197
+ ne.displayName = "Select";
167
198
  export {
168
- te as Select
199
+ ne as Select
169
200
  };
@@ -15,5 +15,6 @@ 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 TwoLine: Story;
18
19
  export declare const NoOptions: Story;
19
20
  //# 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,CAsH7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA;AA6BpC,eAAO,MAAM,OAAO,EAAE,KAwBrB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KA0B9B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KA0BvB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAwB/B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA0BtB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA0BtB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA6DtB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KA0C7B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAgCzB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAyBxB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAqDhC,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAkCjC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAqBvB,CAAA"}
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,CAoI7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA;AA6BpC,eAAO,MAAM,OAAO,EAAE,KAwBrB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KA0B9B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KA0BvB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAwB/B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA0BtB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA0BtB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA6DtB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KA0C7B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAgCzB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAyBxB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAqDhC,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAkCjC,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAoDrB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAqBvB,CAAA"}
@@ -3,5 +3,6 @@ export declare const triggerWrapperVariants: (props?: ({
3
3
  error?: boolean | null | undefined;
4
4
  expanded?: boolean | null | undefined;
5
5
  hasIcon?: boolean | null | undefined;
6
+ hasDescription?: boolean | null | undefined;
6
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
8
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Select/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB;;;;;8EA+BlC,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Select/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB;;;;;;8EAkClC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { cva as e } from "class-variance-authority";
2
- const o = e(
2
+ const r = e(
3
3
  [
4
4
  "flex w-full cursor-pointer items-center gap-sm rounded-full border border-comp-select-stroke-def",
5
5
  "overflow-hidden bg-comp-select-fill-def whitespace-nowrap focus-visible-default transition-colors",
@@ -23,6 +23,9 @@ const o = e(
23
23
  },
24
24
  hasIcon: {
25
25
  false: "pl-comp-select-p-large"
26
+ },
27
+ hasDescription: {
28
+ true: "py-sm"
26
29
  }
27
30
  },
28
31
  defaultVariants: {
@@ -32,5 +35,5 @@ const o = e(
32
35
  }
33
36
  );
34
37
  export {
35
- o as triggerWrapperVariants
38
+ r as triggerWrapperVariants
36
39
  };
@@ -19,7 +19,7 @@ const b = u(
19
19
  // Active/pressed state (on)
20
20
  "data-[state=on]:bg-comp-button-primary-bg-def data-[state=on]:text-comp-button-primary-text-def",
21
21
  // Disabled state
22
- "disabled:pointer-events-none disabled:bg-surface-brand-primary-disabled disabled:text-text-dark-disabled"
22
+ "disabled:pointer-events-none disabled:bg-surface-brand-primary-disabled2 disabled:text-text-dark-disabled"
23
23
  ],
24
24
  {
25
25
  variants: {