@vkzstudio/muza-ui 1.5.1 → 1.6.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/dist/components/Accordion/Accordion.js +1 -1
- package/dist/components/Accordion/index.js +16 -0
- package/dist/components/Alert/Alert.js +6 -6
- package/dist/components/Alert/index.js +4 -0
- package/dist/components/ArticleCard/ArticleCard.js +11 -11
- package/dist/components/ArticleCard/index.js +7 -0
- package/dist/components/Avatar/index.js +6 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +4 -4
- package/dist/components/Breadcrumb/index.js +10 -0
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +44 -42
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Button/index.js +6 -0
- package/dist/components/ButtonArrow/index.js +5 -0
- package/dist/components/Calendar/Calendar.js +6 -6
- package/dist/components/Calendar/index.js +10 -0
- package/dist/components/Card/Card.js +7 -7
- package/dist/components/Card/index.js +5 -0
- package/dist/components/CardCheckboxAmount/CardCheckboxAmount.js +8 -8
- package/dist/components/CardCheckboxAmount/index.js +4 -0
- package/dist/components/Carousel/Carousel.d.ts +99 -2
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.js +208 -151
- package/dist/components/Carousel/Carousel.stories.d.ts +2 -0
- package/dist/components/Carousel/Carousel.stories.d.ts.map +1 -1
- package/dist/components/Carousel/index.js +10 -0
- package/dist/components/CategoryCard/CategoryCard.js +2 -2
- package/dist/components/CategoryCard/index.js +6 -0
- package/dist/components/CategoryIcon/index.js +5 -0
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/index.js +4 -0
- package/dist/components/Chip/Chip.js +5 -5
- package/dist/components/Chip/index.js +5 -0
- package/dist/components/DataTable/index.js +5 -0
- package/dist/components/DatePicker/DatePicker.js +18 -18
- package/dist/components/DatePicker/index.js +7 -0
- package/dist/components/DatePickerButton/DatePickerButton.js +5 -5
- package/dist/components/DatePickerButton/index.js +5 -0
- package/dist/components/Dialog/Dialog.js +21 -20
- package/dist/components/Dialog/index.js +13 -0
- package/dist/components/DotDivider/index.js +5 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +22 -3
- package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +131 -105
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +3 -2
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/components/DropdownMenu/index.js +14 -0
- package/dist/components/DropdownSearchMenu/DropdownSearchMenu.js +7 -6
- package/dist/components/DropdownSearchMenu/index.js +7 -0
- package/dist/components/EdgeButton/EdgeButton.js +1 -1
- package/dist/components/EdgeButton/index.js +5 -0
- package/dist/components/EmptyState/index.js +4 -0
- package/dist/components/ExpandableTable/ExpandableTable.js +13 -13
- package/dist/components/ExpandableTable/index.js +4 -0
- package/dist/components/FileUpload/FileItem.js +1 -1
- package/dist/components/FileUpload/FileUpload.js +7 -7
- package/dist/components/FileUpload/index.js +4 -0
- package/dist/components/Flex/Flex.js +5 -5
- package/dist/components/Flex/index.js +7 -0
- package/dist/components/FormField/FormField.js +9 -9
- package/dist/components/FormField/InputHint.js +4 -4
- package/dist/components/FormField/index.js +8 -0
- package/dist/components/HeartButton/index.js +5 -0
- package/dist/components/Icons/index.js +65 -0
- package/dist/components/InfoCard/InfoCard.js +45 -0
- package/dist/components/InfoCard/index.js +5 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/index.js +4 -0
- package/dist/components/InputOTP/InputOTP.js +7 -7
- package/dist/components/InputOTP/index.js +7 -0
- package/dist/components/LanguageSwitcher/LanguageSwitcher.js +9 -9
- package/dist/components/LanguageSwitcher/index.js +6 -0
- package/dist/components/Lightbox/Lightbox.js +1 -1
- package/dist/components/Lightbox/index.js +8 -0
- package/dist/components/Loader/index.js +4 -0
- package/dist/components/LoginScreen/LoginScreen.js +4 -4
- package/dist/components/LoginScreen/index.js +8 -0
- package/dist/components/MarketNav/MarketNav.examples.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +40 -41
- package/dist/components/MultiSelect/index.js +4 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.js +5 -5
- package/dist/components/MuzaUIProvider/index.js +13 -0
- package/dist/components/MuzaUIProvider/theme/ThemeSetterModal.js +17 -17
- package/dist/components/OfferCard/OfferCard.js +11 -11
- package/dist/components/OfferCard/index.js +7 -0
- package/dist/components/PageContainer/index.js +5 -0
- package/dist/components/Pagination/Pagination.js +5 -5
- package/dist/components/Pagination/index.js +4 -0
- package/dist/components/PartnerCard/PartnerCard.js +10 -10
- package/dist/components/PartnerCard/index.js +6 -0
- package/dist/components/PasswordInput/PasswordInput.js +7 -7
- package/dist/components/PasswordInput/index.js +4 -0
- package/dist/components/PhoneInput/CountrySelector.js +5 -5
- package/dist/components/PhoneInput/PhoneInput.js +8 -8
- package/dist/components/PhoneInput/index.js +4 -0
- package/dist/components/PinIndicator/index.js +4 -0
- package/dist/components/Popover/index.js +7 -0
- package/dist/components/Progress/index.js +5 -0
- package/dist/components/Radio/index.js +5 -0
- package/dist/components/Rating/Rating.js +5 -5
- package/dist/components/Rating/index.js +4 -0
- package/dist/components/RatingBlock/RatingBlock.js +2 -2
- package/dist/components/RatingBlock/index.js +4 -0
- package/dist/components/Reorderable/index.js +9 -0
- package/dist/components/ReorderableTable/ReorderableTable.js +7 -6
- package/dist/components/ReorderableTable/index.js +4 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.js +5 -5
- package/dist/components/ResponsiveLayoutTable/index.js +4 -0
- package/dist/components/SearchFilters/SearchFilters.js +11 -11
- package/dist/components/SearchFilters/index.js +5 -0
- package/dist/components/Searchbar/index.js +4 -0
- package/dist/components/SegmentedControl/index.js +5 -0
- package/dist/components/SegmentedIconControl/index.js +5 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +77 -103
- package/dist/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/components/Select/SelectTrigger.d.ts +54 -0
- package/dist/components/Select/SelectTrigger.d.ts.map +1 -0
- package/dist/components/Select/SelectTrigger.js +57 -0
- package/dist/components/Select/SelectTrigger.stories.d.ts +11 -0
- package/dist/components/Select/SelectTrigger.stories.d.ts.map +1 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +8 -0
- package/dist/components/Select/utils.d.ts +10 -1
- package/dist/components/Select/utils.d.ts.map +1 -1
- package/dist/components/Select/utils.js +3 -5
- package/dist/components/Sheet/Sheet.js +13 -12
- package/dist/components/Sheet/index.js +15 -0
- package/dist/components/Skeleton/index.js +4 -0
- package/dist/components/Slider/index.js +7 -0
- package/dist/components/SliderIndicators/index.js +4 -0
- package/dist/components/Stepper/Stepper.js +6 -6
- package/dist/components/Stepper/index.js +4 -0
- package/dist/components/SwipeButton/SwipeButton.js +14 -14
- package/dist/components/SwipeButton/index.js +4 -0
- package/dist/components/Switch/index.js +4 -0
- package/dist/components/Tag/index.js +5 -0
- package/dist/components/TextEditor/EditorToolbar.js +15 -15
- package/dist/components/TextEditor/LinkBubbleMenu.js +9 -9
- package/dist/components/TextEditor/TextEditor.js +12 -12
- package/dist/components/TextEditor/index.js +9 -0
- package/dist/components/Textarea/Textarea.js +1 -1
- package/dist/components/Textarea/index.js +4 -0
- package/dist/components/TimePicker/TimePicker.js +4 -4
- package/dist/components/TimePicker/index.js +4 -0
- package/dist/components/Toast/Toast.js +7 -7
- package/dist/components/Toast/index.js +7 -0
- package/dist/components/Toggle/index.js +5 -0
- package/dist/components/ToggleCheckButton/index.js +5 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +4 -4
- package/dist/components/ToggleGroup/index.js +5 -0
- package/dist/components/Tooltip/Tooltip.js +6 -6
- package/dist/components/Tooltip/index.js +7 -0
- package/dist/components/TransactionsListView/TransactionsListView.js +2 -2
- package/dist/components/TransactionsListView/index.js +5 -0
- package/dist/components/Typography/index.js +5 -0
- package/dist/components/TypographyLink/index.js +5 -0
- package/dist/components/UniversalFooter/UniversalFooter.js +3 -3
- package/dist/components/UniversalFooter/index.js +18 -0
- package/dist/components/VoucherCard/VoucherCard.js +2 -2
- package/dist/components/VoucherCard/index.js +7 -0
- package/dist/components/WebCheckoutNav/WebCheckoutNav.examples.d.ts.map +1 -1
- package/dist/index.js +434 -429
- package/dist/muza-ui.css +1 -1
- package/dist/utils/index.js +13 -0
- package/llms-full.md +133 -2
- package/llms.txt +2 -0
- package/package.json +23 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
3
|
import { useMuzaTranslationContext as _ } from "../../translations/TranslationContext.js";
|
|
4
|
-
import {
|
|
5
|
-
import { resolvePluralTemplate as C } from "../../translations/resolvePluralTemplate.js";
|
|
4
|
+
import { resolvePluralTemplate as z } from "../../translations/resolvePluralTemplate.js";
|
|
6
5
|
import { cn as y } from "../../utils/cn.js";
|
|
7
|
-
import { StarBold as
|
|
6
|
+
import { StarBold as C } from "@solar-icons/react-perf";
|
|
7
|
+
import { HalfStar as F } from "../Icons/CustomIcons.js";
|
|
8
8
|
const T = (l, m, p) => Array.from({ length: m }, (s, n) => {
|
|
9
9
|
const c = n + 1;
|
|
10
10
|
return p ? l >= c - 0.25 ? "full" : l >= c - 0.75 ? "half" : "empty" : l >= c - 0.5 ? "full" : "empty";
|
|
@@ -50,7 +50,7 @@ const T = (l, m, p) => Array.from({ length: m }, (s, n) => {
|
|
|
50
50
|
),
|
|
51
51
|
...R,
|
|
52
52
|
children: H.map((e, t) => {
|
|
53
|
-
const o = t + 1, v = /* @__PURE__ */ f(e === "half" ?
|
|
53
|
+
const o = t + 1, v = /* @__PURE__ */ f(e === "half" ? F : C, { className: y(e === "empty" ? "text-comp-rating-star-empty" : "text-comp-rating-star-default", "transition-colors") });
|
|
54
54
|
return i ? /* @__PURE__ */ f(
|
|
55
55
|
"button",
|
|
56
56
|
{
|
|
@@ -60,7 +60,7 @@ const T = (l, m, p) => Array.from({ length: m }, (s, n) => {
|
|
|
60
60
|
type: "button",
|
|
61
61
|
role: "radio",
|
|
62
62
|
"aria-checked": Math.ceil(r) === o,
|
|
63
|
-
"aria-label": (I ??
|
|
63
|
+
"aria-label": (I ?? z(
|
|
64
64
|
o,
|
|
65
65
|
D,
|
|
66
66
|
M.rating.starLabel
|
|
@@ -2,11 +2,11 @@ import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { useMuzaTranslationContext as b } from "../../translations/TranslationContext.js";
|
|
4
4
|
import { resolvePluralTemplate as M } from "../../translations/resolvePluralTemplate.js";
|
|
5
|
-
import { Card as B } from "../Card/Card.js";
|
|
6
5
|
import { cn as p } from "../../utils/cn.js";
|
|
7
|
-
import {
|
|
6
|
+
import { Card as B } from "../Card/Card.js";
|
|
8
7
|
import { Flex as C } from "../Flex/Flex.js";
|
|
9
8
|
import { Rating as z } from "../Rating/Rating.js";
|
|
9
|
+
import { Typography as u } from "../Typography/Typography.js";
|
|
10
10
|
const T = n.forwardRef(
|
|
11
11
|
({
|
|
12
12
|
value: i,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReorderableGroup as o, ReorderableHandle as a, ReorderableItem as d, ReorderableStaticItem as l, useReorderableGroup as b, useReorderableItem as t } from "./Reorderable.js";
|
|
2
|
+
export {
|
|
3
|
+
o as ReorderableGroup,
|
|
4
|
+
a as ReorderableHandle,
|
|
5
|
+
d as ReorderableItem,
|
|
6
|
+
l as ReorderableStaticItem,
|
|
7
|
+
b as useReorderableGroup,
|
|
8
|
+
t as useReorderableItem
|
|
9
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as S } from "react";
|
|
3
3
|
import { motion as l } from "motion/react";
|
|
4
|
-
import { ReorderableGroup as k, ReorderableItem as w, ReorderableHandle as z } from "../Reorderable/Reorderable.js";
|
|
5
|
-
import { Reorder as G } from "../Icons/CustomIcons.js";
|
|
6
4
|
import { cn as d } from "../../utils/cn.js";
|
|
5
|
+
import "@solar-icons/react-perf";
|
|
6
|
+
import { Reorder as k } from "../Icons/CustomIcons.js";
|
|
7
|
+
import { ReorderableGroup as w, ReorderableItem as z, ReorderableHandle as G } from "../Reorderable/Reorderable.js";
|
|
7
8
|
import { typographyVariants as W, Typography as K } from "../Typography/Typography.js";
|
|
8
9
|
const f = 72, N = 20, R = 24, U = 4, F = ({
|
|
9
10
|
data: g,
|
|
@@ -64,7 +65,7 @@ const f = 72, N = 20, R = 24, U = 4, F = ({
|
|
|
64
65
|
)
|
|
65
66
|
] }) }),
|
|
66
67
|
/* @__PURE__ */ e(
|
|
67
|
-
|
|
68
|
+
w,
|
|
68
69
|
{
|
|
69
70
|
values: g,
|
|
70
71
|
onReorder: x,
|
|
@@ -80,7 +81,7 @@ const f = 72, N = 20, R = 24, U = 4, F = ({
|
|
|
80
81
|
children: (o) => o.map((a, p) => {
|
|
81
82
|
const D = (m == null ? void 0 : m(a, p)) ?? !1, t = u || D, b = !!n && !t;
|
|
82
83
|
return /* @__PURE__ */ h(
|
|
83
|
-
|
|
84
|
+
z,
|
|
84
85
|
{
|
|
85
86
|
value: a,
|
|
86
87
|
as: "tr",
|
|
@@ -169,14 +170,14 @@ const f = 72, N = 20, R = 24, U = 4, F = ({
|
|
|
169
170
|
transition: { duration: 0.3, ease: "easeInOut" },
|
|
170
171
|
className: "flex h-full items-center justify-center overflow-hidden border-l border-stroke-base-secondary",
|
|
171
172
|
children: /* @__PURE__ */ e(
|
|
172
|
-
|
|
173
|
+
G,
|
|
173
174
|
{
|
|
174
175
|
disabled: !i || t,
|
|
175
176
|
className: d(
|
|
176
177
|
"flex h-comp-button-h-sm w-comp-button-w-sm items-center justify-center focus-visible-default",
|
|
177
178
|
t ? "text-text-dark-disabled" : "text-text-brand-def"
|
|
178
179
|
),
|
|
179
|
-
children: /* @__PURE__ */ e(
|
|
180
|
+
children: /* @__PURE__ */ e(k, { className: "size-icon-default" })
|
|
180
181
|
}
|
|
181
182
|
)
|
|
182
183
|
}
|
|
@@ -2,8 +2,8 @@ import { jsx as r, jsxs as T } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { useBreakpoints as E } from "../../hooks/use-is-breakpoint.js";
|
|
4
4
|
import { cn as l } from "../../utils/cn.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Skeleton as H } from "../Skeleton/Skeleton.js";
|
|
6
|
+
import { typographyVariants as S, Typography as V } from "../Typography/Typography.js";
|
|
7
7
|
const J = ({
|
|
8
8
|
data: y,
|
|
9
9
|
layouts: n,
|
|
@@ -50,7 +50,7 @@ const J = ({
|
|
|
50
50
|
"th",
|
|
51
51
|
{
|
|
52
52
|
className: l(
|
|
53
|
-
|
|
53
|
+
S({
|
|
54
54
|
size: "sm",
|
|
55
55
|
uppercase: !0,
|
|
56
56
|
variant: "body",
|
|
@@ -100,8 +100,8 @@ const J = ({
|
|
|
100
100
|
i && "relative",
|
|
101
101
|
t.className
|
|
102
102
|
),
|
|
103
|
-
children: a ? t.skeleton ?? /* @__PURE__ */ r(
|
|
104
|
-
|
|
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
105
|
{
|
|
106
106
|
variant: "body",
|
|
107
107
|
size: "base",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e, Fragment as N } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
+
import { cn as l } from "../../utils/cn.js";
|
|
3
4
|
import { Button as w } from "../Button/Button.js";
|
|
4
|
-
import {
|
|
5
|
-
import { Carousel as y, CarouselContent as v, CarouselItem as S, CarouselPrevious as C, CarouselNext as F } from "../Carousel/Carousel.js";
|
|
5
|
+
import { Carousel as k, CarouselContent as y, CarouselItem as v, CarouselPrevious as S, CarouselNext as C } from "../Carousel/Carousel.js";
|
|
6
6
|
import { Flex as m } from "../Flex/Flex.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { ArrowLeftOutline as F } from "@solar-icons/react-perf";
|
|
8
|
+
import { Searchbar as A } from "../Searchbar/Searchbar.js";
|
|
9
9
|
import { Skeleton as f } from "../Skeleton/Skeleton.js";
|
|
10
10
|
const R = n.forwardRef(
|
|
11
11
|
({
|
|
@@ -55,13 +55,13 @@ const R = n.forwardRef(
|
|
|
55
55
|
{
|
|
56
56
|
variant: "tertiary",
|
|
57
57
|
size: "icon",
|
|
58
|
-
icon: /* @__PURE__ */ e(
|
|
58
|
+
icon: /* @__PURE__ */ e(F, {}),
|
|
59
59
|
...a
|
|
60
60
|
}
|
|
61
61
|
)
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
r && /* @__PURE__ */ e("div", { className: "flex-1 md:w-[280px] md:flex-none", children: /* @__PURE__ */ e(
|
|
64
|
+
r && /* @__PURE__ */ e("div", { className: "flex-1 md:w-[280px] md:flex-none", children: /* @__PURE__ */ e(A, { ...r }) })
|
|
65
65
|
]
|
|
66
66
|
}
|
|
67
67
|
),
|
|
@@ -89,9 +89,9 @@ const R = n.forwardRef(
|
|
|
89
89
|
// bleed to the viewport's right edge (left stays inset by the bar).
|
|
90
90
|
"md:-mr-2xl md:flex-1 md:border-b-0 md:p-0"
|
|
91
91
|
),
|
|
92
|
-
children: /* @__PURE__ */ s(
|
|
93
|
-
/* @__PURE__ */ e(
|
|
94
|
-
|
|
92
|
+
children: /* @__PURE__ */ s(k, { align: "start", options: d, className: "w-full", children: [
|
|
93
|
+
/* @__PURE__ */ e(y, { className: "!ml-0 items-center gap-xs", children: p.map((g, o) => /* @__PURE__ */ e(
|
|
94
|
+
v,
|
|
95
95
|
{
|
|
96
96
|
className: l(
|
|
97
97
|
"!basis-auto !pl-0",
|
|
@@ -108,14 +108,14 @@ const R = n.forwardRef(
|
|
|
108
108
|
)) }),
|
|
109
109
|
u && /* @__PURE__ */ s(N, { children: [
|
|
110
110
|
/* @__PURE__ */ e(
|
|
111
|
-
|
|
111
|
+
S,
|
|
112
112
|
{
|
|
113
113
|
hideWhenDisabled: !0,
|
|
114
114
|
className: "hidden md:left-0 md:flex"
|
|
115
115
|
}
|
|
116
116
|
),
|
|
117
117
|
/* @__PURE__ */ e(
|
|
118
|
-
|
|
118
|
+
C,
|
|
119
119
|
{
|
|
120
120
|
hideWhenDisabled: !0,
|
|
121
121
|
className: "hidden md:right-2xl md:flex"
|
|
@@ -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;
|
|
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;AAcd;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAA;IACb,wFAAwF;IACxF,KAAK,EAAE,SAAS,CAAA;IAChB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iEAAiE;IACjE,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kGAAkG;IAClG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iFAAiF;IACjF,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,oEAAoE;IACpE,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,kGAAkG;IAClG,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;;;;;;;;;;;;OAYG;IACH,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;;;OAOG;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,wFAoNlB,CAAA"}
|
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
options: a,
|
|
18
|
-
onChange: d,
|
|
1
|
+
import { jsx as t, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import u, { forwardRef as B, useId as G, useMemo as L, useRef as z, useEffect as S } from "react";
|
|
3
|
+
import { useMuzaTranslations as H } from "../../translations/TranslationContext.js";
|
|
4
|
+
import { DropdownMenu as J, DropdownMenuTrigger as K, DropdownMenuContent as Q, DropdownMenuRadioGroup as U, DropdownMenuRadioItem as X } from "../DropdownMenu/DropdownMenu.js";
|
|
5
|
+
import { Flex as Y } from "../Flex/Flex.js";
|
|
6
|
+
import { FormField as Z } from "../FormField/FormField.js";
|
|
7
|
+
import { Typography as l } from "../Typography/Typography.js";
|
|
8
|
+
import { SelectTrigger as ee } from "./SelectTrigger.js";
|
|
9
|
+
const te = B(
|
|
10
|
+
(T, p) => {
|
|
11
|
+
const m = H(), {
|
|
12
|
+
label: f,
|
|
13
|
+
hint: h,
|
|
14
|
+
error: g,
|
|
15
|
+
options: s,
|
|
16
|
+
onChange: c,
|
|
19
17
|
value: n,
|
|
20
|
-
disabled:
|
|
21
|
-
prefix:
|
|
22
|
-
size:
|
|
23
|
-
placeholder:
|
|
24
|
-
emptyMessage:
|
|
25
|
-
shouldScrollToSelectedOption:
|
|
26
|
-
collisionPadding:
|
|
27
|
-
required:
|
|
28
|
-
disableRequiredAsterisk:
|
|
29
|
-
labelExtra:
|
|
30
|
-
infoTooltip:
|
|
31
|
-
} =
|
|
18
|
+
disabled: x,
|
|
19
|
+
prefix: D,
|
|
20
|
+
size: I,
|
|
21
|
+
placeholder: C,
|
|
22
|
+
emptyMessage: F,
|
|
23
|
+
shouldScrollToSelectedOption: b,
|
|
24
|
+
collisionPadding: O,
|
|
25
|
+
required: y,
|
|
26
|
+
disableRequiredAsterisk: W,
|
|
27
|
+
labelExtra: q,
|
|
28
|
+
infoTooltip: E
|
|
29
|
+
} = T, v = C ?? m.select.placeholder, P = F ?? m.select.noOptions, w = G(), V = f ? `${w}-label` : void 0, $ = h ? `${w}-hint` : void 0, r = n ? s.find((e) => e.value === n) : void 0, j = L(() => r ? r.description ? /* @__PURE__ */ N(Y, { flex: 1, direction: "column", className: "min-w-0 text-left", children: [
|
|
32
30
|
/* @__PURE__ */ t(
|
|
33
|
-
|
|
31
|
+
l,
|
|
34
32
|
{
|
|
35
33
|
size: "sm",
|
|
36
34
|
variant: "title",
|
|
@@ -41,7 +39,7 @@ const ne = G(
|
|
|
41
39
|
}
|
|
42
40
|
),
|
|
43
41
|
/* @__PURE__ */ t(
|
|
44
|
-
|
|
42
|
+
l,
|
|
45
43
|
{
|
|
46
44
|
size: "sm",
|
|
47
45
|
variant: "body",
|
|
@@ -52,7 +50,7 @@ const ne = G(
|
|
|
52
50
|
}
|
|
53
51
|
)
|
|
54
52
|
] }) : typeof r.label != "function" ? /* @__PURE__ */ t(
|
|
55
|
-
|
|
53
|
+
l,
|
|
56
54
|
{
|
|
57
55
|
size: "input",
|
|
58
56
|
className: "grow-1 fix-y-text truncate text-left text-comp-select-text-primary",
|
|
@@ -61,123 +59,99 @@ const ne = G(
|
|
|
61
59
|
children: r.label
|
|
62
60
|
}
|
|
63
61
|
) : r.label : /* @__PURE__ */ t(
|
|
64
|
-
|
|
62
|
+
l,
|
|
65
63
|
{
|
|
66
64
|
size: "input",
|
|
67
65
|
className: "grow-1 fix-y-text truncate text-left text-comp-select-text-placeholder",
|
|
68
66
|
weight: "regular",
|
|
69
67
|
component: "span",
|
|
70
|
-
children:
|
|
68
|
+
children: v
|
|
71
69
|
}
|
|
72
|
-
), [r,
|
|
73
|
-
return
|
|
70
|
+
), [r, v]), [R, k] = u.useState(!1), [M, A] = u.useState(0), a = u.useRef(!1), _ = z(null), d = z({}), i = (typeof p == "function" ? null : p) ?? _;
|
|
71
|
+
return S(() => {
|
|
74
72
|
const e = () => {
|
|
75
|
-
i.current &&
|
|
73
|
+
i.current && A(i.current.offsetWidth);
|
|
76
74
|
};
|
|
77
75
|
e();
|
|
78
|
-
const
|
|
79
|
-
return i.current &&
|
|
80
|
-
|
|
76
|
+
const o = new ResizeObserver(e);
|
|
77
|
+
return i.current && o.observe(i.current), () => {
|
|
78
|
+
o.disconnect();
|
|
81
79
|
};
|
|
82
|
-
}, [i]),
|
|
80
|
+
}, [i]), S(() => {
|
|
83
81
|
var e;
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
|
|
82
|
+
R && n && d.current[n] && b && ((e = d.current[n]) == null || e.scrollIntoView({ block: "nearest" }));
|
|
83
|
+
}, [R, b, n]), /* @__PURE__ */ t(
|
|
84
|
+
Z,
|
|
87
85
|
{
|
|
88
|
-
label:
|
|
89
|
-
hint:
|
|
90
|
-
error:
|
|
91
|
-
required:
|
|
92
|
-
disableRequiredAsterisk:
|
|
93
|
-
labelId:
|
|
86
|
+
label: f,
|
|
87
|
+
hint: h,
|
|
88
|
+
error: g,
|
|
89
|
+
required: y,
|
|
90
|
+
disableRequiredAsterisk: W,
|
|
91
|
+
labelId: V,
|
|
94
92
|
hintId: $,
|
|
95
|
-
labelExtra:
|
|
96
|
-
infoTooltip:
|
|
93
|
+
labelExtra: q,
|
|
94
|
+
infoTooltip: E,
|
|
97
95
|
className: "flex-1",
|
|
98
|
-
children: /* @__PURE__ */
|
|
99
|
-
|
|
96
|
+
children: /* @__PURE__ */ N(
|
|
97
|
+
J,
|
|
100
98
|
{
|
|
101
99
|
onOpenChange: (e) => {
|
|
102
100
|
k(e);
|
|
103
101
|
},
|
|
104
102
|
children: [
|
|
105
|
-
/* @__PURE__ */ t(
|
|
106
|
-
|
|
103
|
+
/* @__PURE__ */ t(K, { disabled: x, asChild: !0, children: /* @__PURE__ */ t(
|
|
104
|
+
ee,
|
|
107
105
|
{
|
|
108
106
|
ref: i,
|
|
109
|
-
type: "button",
|
|
110
107
|
role: "input",
|
|
111
108
|
tabIndex: 0,
|
|
112
|
-
disabled:
|
|
113
|
-
"aria-required":
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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(
|
|
124
|
-
"span",
|
|
125
|
-
{
|
|
126
|
-
className: s ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
|
|
127
|
-
children: y
|
|
128
|
-
}
|
|
129
|
-
),
|
|
130
|
-
j,
|
|
131
|
-
/* @__PURE__ */ t(
|
|
132
|
-
re,
|
|
133
|
-
{
|
|
134
|
-
className: D(
|
|
135
|
-
"transition-transform duration-200",
|
|
136
|
-
l ? "rotate-0" : "rotate-180",
|
|
137
|
-
s ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def"
|
|
138
|
-
)
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
] })
|
|
109
|
+
disabled: x,
|
|
110
|
+
"aria-required": y,
|
|
111
|
+
size: I,
|
|
112
|
+
error: g,
|
|
113
|
+
prefix: D,
|
|
114
|
+
hasDescription: !!(r != null && r.description),
|
|
115
|
+
children: j
|
|
142
116
|
}
|
|
143
117
|
) }),
|
|
144
118
|
/* @__PURE__ */ t(
|
|
145
|
-
|
|
119
|
+
Q,
|
|
146
120
|
{
|
|
147
121
|
className: "mt-1",
|
|
148
122
|
style: {
|
|
149
|
-
width:
|
|
123
|
+
width: M > 0 ? `${M}px` : void 0
|
|
150
124
|
},
|
|
151
125
|
align: "center",
|
|
152
126
|
onCloseAutoFocus: (e) => {
|
|
153
|
-
|
|
127
|
+
a.current || e.preventDefault(), a.current = !1;
|
|
154
128
|
},
|
|
155
|
-
collisionPadding:
|
|
156
|
-
children:
|
|
157
|
-
|
|
129
|
+
collisionPadding: O,
|
|
130
|
+
children: s.length === 0 ? /* @__PURE__ */ t("div", { className: "px-lg py-md", role: "presentation", children: /* @__PURE__ */ t(
|
|
131
|
+
l,
|
|
158
132
|
{
|
|
159
133
|
component: "span",
|
|
160
134
|
size: "input",
|
|
161
135
|
weight: "regular",
|
|
162
136
|
className: "text-comp-select-text-secondary",
|
|
163
|
-
children:
|
|
137
|
+
children: P
|
|
164
138
|
}
|
|
165
139
|
) }) : /* @__PURE__ */ t(
|
|
166
|
-
|
|
140
|
+
U,
|
|
167
141
|
{
|
|
168
142
|
value: n,
|
|
169
143
|
onValueChange: (e) => {
|
|
170
|
-
|
|
144
|
+
a.current = !0, c == null || c(e);
|
|
171
145
|
},
|
|
172
|
-
children:
|
|
173
|
-
|
|
146
|
+
children: s.map((e) => /* @__PURE__ */ t(
|
|
147
|
+
X,
|
|
174
148
|
{
|
|
175
149
|
value: e.value.toString(),
|
|
176
150
|
disabled: e.disabled,
|
|
177
151
|
icon: e.icon,
|
|
178
152
|
description: e.description,
|
|
179
|
-
ref: (
|
|
180
|
-
|
|
153
|
+
ref: (o) => {
|
|
154
|
+
d.current[e.value] = o;
|
|
181
155
|
},
|
|
182
156
|
children: e.label
|
|
183
157
|
},
|
|
@@ -194,7 +168,7 @@ const ne = G(
|
|
|
194
168
|
);
|
|
195
169
|
}
|
|
196
170
|
);
|
|
197
|
-
|
|
171
|
+
te.displayName = "Select";
|
|
198
172
|
export {
|
|
199
|
-
|
|
173
|
+
te as Select
|
|
200
174
|
};
|
|
@@ -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;AAU3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,
|
|
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;AAU3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAsI7B,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,SAAS,EAAE,KA2BvB,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"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the SelectTrigger component.
|
|
4
|
+
*
|
|
5
|
+
* Extends the native `<button>` attributes — every unrecognised prop is spread onto
|
|
6
|
+
* the root element, so overlay primitives such as `DropdownMenuTrigger asChild` can
|
|
7
|
+
* inject their handlers, `aria-*` attributes and `data-state`.
|
|
8
|
+
*/
|
|
9
|
+
export interface ISelectTriggerProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'> {
|
|
10
|
+
/**
|
|
11
|
+
* Label content. A `string` or `number` is rendered in the standard truncated
|
|
12
|
+
* trigger label style; pass your own node to control the layout (as `Select`
|
|
13
|
+
* does for its two-line options).
|
|
14
|
+
*/
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
/** Controls height and horizontal padding. Matches the `Select` size scale. @default 'base' */
|
|
17
|
+
size?: 'xs' | 'sm' | 'base' | 'lg';
|
|
18
|
+
/** Applies the error border color. @default false */
|
|
19
|
+
error?: boolean;
|
|
20
|
+
/** Icon or element rendered before the label. */
|
|
21
|
+
prefix?: React.ReactNode;
|
|
22
|
+
/** Adds vertical padding for two-line label content. @default false */
|
|
23
|
+
hasDescription?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The presentational trigger used by {@link Select} — a pill-shaped button with an
|
|
27
|
+
* optional prefix, a truncated label and a chevron that flips when the surrounding
|
|
28
|
+
* overlay opens.
|
|
29
|
+
*
|
|
30
|
+
* It is fully stateless: the expanded styling is derived from the `data-state="open"`
|
|
31
|
+
* attribute that Radix sets on a trigger, so the same component works inside
|
|
32
|
+
* `Select`, `DropdownMenu`, `Popover` or any other overlay without an extra prop.
|
|
33
|
+
* Use it directly when a menu needs to *look* like a select but is not a combobox —
|
|
34
|
+
* an account menu, a filter menu, a navigation dropdown.
|
|
35
|
+
*
|
|
36
|
+
* @example Standalone
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <SelectTrigger size="sm">Jan Novák</SelectTrigger>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example As a DropdownMenu trigger
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <DropdownMenu>
|
|
44
|
+
* <DropdownMenuTrigger asChild>
|
|
45
|
+
* <SelectTrigger size="sm" className="max-w-comp-market-nav-select-max-w">
|
|
46
|
+
* {userName}
|
|
47
|
+
* </SelectTrigger>
|
|
48
|
+
* </DropdownMenuTrigger>
|
|
49
|
+
* <DropdownMenuContent align="end">…</DropdownMenuContent>
|
|
50
|
+
* </DropdownMenu>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare const SelectTrigger: React.ForwardRefExoticComponent<ISelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
54
|
+
//# sourceMappingURL=SelectTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B;;;;;;GAMG;AACH,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IACrE;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,+FAA+F;IAC/F,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAClC,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iDAAiD;IACjD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,uEAAuE;IACvE,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,aAAa,+FAuDzB,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import { cn as o } from "../../utils/cn.js";
|
|
4
|
+
import { AltArrowUpOutline as d } from "@solar-icons/react-perf";
|
|
5
|
+
import { Typography as f } from "../Typography/Typography.js";
|
|
6
|
+
import { triggerWrapperVariants as x } from "./utils.js";
|
|
7
|
+
const u = g.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
children: e,
|
|
10
|
+
className: s,
|
|
11
|
+
size: a,
|
|
12
|
+
error: i,
|
|
13
|
+
prefix: r,
|
|
14
|
+
hasDescription: m,
|
|
15
|
+
type: c = "button",
|
|
16
|
+
...p
|
|
17
|
+
}, n) => /* @__PURE__ */ t(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
ref: n,
|
|
21
|
+
type: c,
|
|
22
|
+
className: o(
|
|
23
|
+
x({ size: a, error: i, hasDescription: m }),
|
|
24
|
+
"group/select-trigger",
|
|
25
|
+
s
|
|
26
|
+
),
|
|
27
|
+
...p,
|
|
28
|
+
children: /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-center gap-sm", children: [
|
|
29
|
+
r && /* @__PURE__ */ t("span", { className: "text-comp-select-icon-brand-def group-disabled/select-trigger:text-comp-select-icon-disabled", children: r }),
|
|
30
|
+
typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ t(
|
|
31
|
+
f,
|
|
32
|
+
{
|
|
33
|
+
size: "input",
|
|
34
|
+
className: "grow-1 fix-y-text truncate text-left text-comp-select-text-primary",
|
|
35
|
+
weight: "medium",
|
|
36
|
+
component: "span",
|
|
37
|
+
children: e
|
|
38
|
+
}
|
|
39
|
+
) : e,
|
|
40
|
+
/* @__PURE__ */ t(
|
|
41
|
+
d,
|
|
42
|
+
{
|
|
43
|
+
className: o(
|
|
44
|
+
"shrink-0 rotate-180 transition-transform duration-200",
|
|
45
|
+
"group-data-[state=open]/select-trigger:rotate-0",
|
|
46
|
+
"text-comp-select-icon-brand-def group-disabled/select-trigger:text-comp-select-icon-disabled"
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] })
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
u.displayName = "SelectTrigger";
|
|
55
|
+
export {
|
|
56
|
+
u as SelectTrigger
|
|
57
|
+
};
|