@vkzstudio/muza-ui 1.0.6 → 1.0.8
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/Button/buttonVariants.d.ts +1 -1
- package/dist/components/Calendar/Calendar.d.ts +2 -2
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +158 -150
- package/dist/components/Chip/Chip.d.ts +43 -0
- package/dist/components/Chip/Chip.d.ts.map +1 -0
- package/dist/components/Chip/Chip.js +98 -0
- package/dist/components/Chip/Chip.stories.d.ts +9 -0
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Chip/index.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.d.ts +23 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +101 -0
- package/dist/components/DataTable/DataTable.stories.d.ts +14 -0
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +28 -26
- package/dist/components/ExpandableTable/Table.d.ts +1 -1
- package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.js +81 -77
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.js +98 -94
- package/dist/components/Flex/Flex.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +51 -50
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts +19 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts.map +1 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.js +19 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts +10 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts.map +1 -0
- package/dist/components/MuzaUIProvider/index.d.ts +2 -0
- package/dist/components/MuzaUIProvider/index.d.ts.map +1 -0
- package/dist/components/Reorderable/Reorderable.d.ts +100 -0
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -0
- package/dist/components/Reorderable/Reorderable.js +197 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts +14 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -0
- package/dist/components/Reorderable/index.d.ts +2 -0
- package/dist/components/Reorderable/index.d.ts.map +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +40 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.js +175 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +18 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -0
- package/dist/components/ReorderableTable/index.d.ts +2 -0
- package/dist/components/ReorderableTable/index.d.ts.map +1 -0
- package/dist/components/Searchbar/Searchbar.d.ts +1 -1
- package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
- package/dist/components/Searchbar/Searchbar.js +50 -49
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +43 -42
- package/dist/components/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.js +43 -42
- package/dist/components/SwipeButton/SwipeButton.d.ts +1 -1
- package/dist/components/SwipeButton/SwipeButton.d.ts.map +1 -1
- package/dist/components/SwipeButton/SwipeButton.js +85 -84
- package/dist/components/SwipeButton/SwipeButton.stories.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.js +217 -189
- package/dist/muza-ui.css +1 -1
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
- package/dist/node_modules/date-fns/constants.js +4 -0
- package/dist/node_modules/date-fns/constructFrom.js +8 -0
- package/dist/node_modules/date-fns/isSameWeek.js +14 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatDistance.js +275 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatRelative.js +25 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/localize.js +167 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/match.js +109 -0
- package/dist/node_modules/date-fns/locale/cs.js +21 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatDistance.js +158 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatRelative.js +60 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/localize.js +175 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/match.js +111 -0
- package/dist/node_modules/date-fns/locale/sk.js +21 -0
- package/dist/node_modules/date-fns/startOfWeek.js +11 -0
- package/dist/node_modules/date-fns/toDate.js +8 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +38 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +29 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +5 -0
- package/dist/node_modules/motion-utils/dist/es/array.js +15 -6
- package/dist/translations/TranslationContext.d.ts +61 -0
- package/dist/translations/TranslationContext.d.ts.map +1 -0
- package/dist/translations/TranslationContext.js +74 -0
- package/dist/translations/index.d.ts +6 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/locales/cs.d.ts +3 -0
- package/dist/translations/locales/cs.d.ts.map +1 -0
- package/dist/translations/locales/cs.js +56 -0
- package/dist/translations/locales/en.d.ts +3 -0
- package/dist/translations/locales/en.d.ts.map +1 -0
- package/dist/translations/locales/en.js +56 -0
- package/dist/translations/locales/sk.d.ts +3 -0
- package/dist/translations/locales/sk.d.ts.map +1 -0
- package/dist/translations/locales/sk.js +56 -0
- package/dist/translations/types.d.ts +126 -0
- package/dist/translations/types.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1,81 +1,82 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as R, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useMuzaTranslations as j } from "../../translations/TranslationContext.js";
|
|
4
|
+
import { MagnifyingGlass as w } from "../Icons/CustomIcons.js";
|
|
5
|
+
import { cn as s } from "../../utils/cn.js";
|
|
5
6
|
import { CloseCircleBold as I } from "@solar-icons/react-perf";
|
|
6
|
-
import { Input as
|
|
7
|
-
const
|
|
8
|
-
className:
|
|
9
|
-
error:
|
|
7
|
+
import { Input as M } from "../Input/Input.js";
|
|
8
|
+
const F = ({
|
|
9
|
+
className: p,
|
|
10
|
+
error: h = !1,
|
|
10
11
|
size: x = "sm",
|
|
11
12
|
showButtons: d = !0,
|
|
12
13
|
clearButtonAriaLabel: y,
|
|
13
|
-
searchButtonAriaLabel:
|
|
14
|
-
disabled:
|
|
15
|
-
value:
|
|
14
|
+
searchButtonAriaLabel: b,
|
|
15
|
+
disabled: r = !1,
|
|
16
|
+
value: a,
|
|
16
17
|
defaultValue: k,
|
|
17
18
|
name: v,
|
|
18
19
|
placeholder: g,
|
|
19
|
-
onChange:
|
|
20
|
+
onChange: o,
|
|
20
21
|
onSubmit: i,
|
|
21
|
-
...
|
|
22
|
+
...B
|
|
22
23
|
}) => {
|
|
23
|
-
const f = n.useRef(null), [c, l] = n.useState(
|
|
24
|
-
|
|
24
|
+
const u = j(), A = y ?? u.searchbar.clearButtonAriaLabel, L = b ?? u.searchbar.searchButtonAriaLabel, f = n.useRef(null), [c, l] = n.useState(
|
|
25
|
+
a ?? k ?? ""
|
|
25
26
|
);
|
|
26
27
|
n.useEffect(() => {
|
|
27
|
-
|
|
28
|
-
}, [
|
|
29
|
-
const
|
|
30
|
-
l(t.target.value),
|
|
31
|
-
},
|
|
32
|
-
var t,
|
|
33
|
-
l(""), (
|
|
28
|
+
a !== void 0 && l(a);
|
|
29
|
+
}, [a]);
|
|
30
|
+
const N = (t) => {
|
|
31
|
+
l(t.target.value), o && o(t);
|
|
32
|
+
}, z = () => {
|
|
33
|
+
var t, m;
|
|
34
|
+
l(""), (m = (t = f.current) == null ? void 0 : t.querySelector("input")) == null || m.focus(), o && o({
|
|
34
35
|
target: { value: "" }
|
|
35
36
|
});
|
|
36
|
-
},
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
}, C = d ? /* @__PURE__ */ R("div", { className: "flex gap-sm", children: [
|
|
38
|
+
/* @__PURE__ */ e(
|
|
38
39
|
"button",
|
|
39
40
|
{
|
|
40
|
-
className:
|
|
41
|
+
className: s(
|
|
41
42
|
"flex shrink-0 cursor-pointer items-center focus-visible-default transition-opacity",
|
|
42
43
|
{
|
|
43
44
|
"opacity-0": !c,
|
|
44
|
-
"cursor-not-allowed":
|
|
45
|
+
"cursor-not-allowed": r
|
|
45
46
|
}
|
|
46
47
|
),
|
|
47
|
-
"aria-label":
|
|
48
|
+
"aria-label": A,
|
|
48
49
|
type: "button",
|
|
49
|
-
onClick:
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
onClick: z,
|
|
51
|
+
children: /* @__PURE__ */ e(
|
|
51
52
|
I,
|
|
52
53
|
{
|
|
53
|
-
className:
|
|
54
|
-
"text-text-dark-tertiary":
|
|
54
|
+
className: s("size-icon-small text-icon-dark-secondary-def", {
|
|
55
|
+
"text-text-dark-tertiary": r
|
|
55
56
|
})
|
|
56
57
|
}
|
|
57
58
|
)
|
|
58
59
|
}
|
|
59
60
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ e(
|
|
61
62
|
"button",
|
|
62
63
|
{
|
|
63
|
-
className:
|
|
64
|
+
className: s(
|
|
64
65
|
"flex shrink-0 cursor-pointer items-center focus-visible-default",
|
|
65
66
|
{
|
|
66
|
-
"cursor-not-allowed":
|
|
67
|
+
"cursor-not-allowed": r
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
|
-
"aria-label":
|
|
70
|
+
"aria-label": L,
|
|
70
71
|
type: "submit",
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
-
|
|
72
|
+
children: /* @__PURE__ */ e(
|
|
73
|
+
w,
|
|
73
74
|
{
|
|
74
|
-
className:
|
|
75
|
+
className: s(
|
|
75
76
|
"size-icon-small text-icon-dark-primary-def transition-colors",
|
|
76
77
|
{
|
|
77
|
-
"text-text-dark-tertiary":
|
|
78
|
-
"group-hover:text-icon-dark-primary-hover": !
|
|
78
|
+
"text-text-dark-tertiary": r,
|
|
79
|
+
"group-hover:text-icon-dark-primary-hover": !r
|
|
79
80
|
}
|
|
80
81
|
)
|
|
81
82
|
}
|
|
@@ -83,33 +84,33 @@ const G = ({
|
|
|
83
84
|
}
|
|
84
85
|
)
|
|
85
86
|
] }) : void 0;
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ e(
|
|
87
88
|
"form",
|
|
88
89
|
{
|
|
89
90
|
ref: f,
|
|
90
91
|
onSubmit: (t) => {
|
|
91
92
|
t.preventDefault(), c.length > 0 && (i == null || i(t));
|
|
92
93
|
},
|
|
93
|
-
className:
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
|
|
94
|
+
className: p,
|
|
95
|
+
children: /* @__PURE__ */ e(
|
|
96
|
+
M,
|
|
96
97
|
{
|
|
97
|
-
suffix:
|
|
98
|
+
suffix: C,
|
|
98
99
|
type: "text",
|
|
99
100
|
size: x,
|
|
100
|
-
error:
|
|
101
|
-
disabled:
|
|
101
|
+
error: h,
|
|
102
|
+
disabled: r,
|
|
102
103
|
value: c,
|
|
103
104
|
name: v,
|
|
104
|
-
onChange:
|
|
105
|
+
onChange: N,
|
|
105
106
|
placeholder: g,
|
|
106
107
|
className: "group",
|
|
107
|
-
...
|
|
108
|
+
...B
|
|
108
109
|
}
|
|
109
110
|
)
|
|
110
111
|
}
|
|
111
112
|
);
|
|
112
113
|
};
|
|
113
114
|
export {
|
|
114
|
-
|
|
115
|
+
F as Searchbar
|
|
115
116
|
};
|
|
@@ -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,EAKf,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,EAKf,MAAM,OAAO,CAAA;AAcd,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,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,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,MAAM,wFA8LlB,CAAA"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import m, { forwardRef as
|
|
3
|
-
import { triggerWrapperVariants as
|
|
2
|
+
import m, { forwardRef as A, useMemo as I, useRef as N, useEffect as R } from "react";
|
|
3
|
+
import { triggerWrapperVariants as j } from "./utils.js";
|
|
4
|
+
import { useMuzaTranslations as E } from "../../translations/TranslationContext.js";
|
|
4
5
|
import { Typography as s } from "../Typography/Typography.js";
|
|
5
|
-
import { DropdownMenu as
|
|
6
|
-
import { AltArrowUpOutline as
|
|
7
|
-
import { cn as
|
|
8
|
-
const
|
|
9
|
-
(
|
|
10
|
-
const {
|
|
11
|
-
label:
|
|
12
|
-
hint:
|
|
13
|
-
error:
|
|
6
|
+
import { DropdownMenu as P, DropdownMenuTrigger as _, DropdownMenuContent as k, DropdownMenuRadioGroup as B, DropdownMenuRadioItem as F } from "../DropdownMenu/DropdownMenu.js";
|
|
7
|
+
import { AltArrowUpOutline as G } from "@solar-icons/react-perf";
|
|
8
|
+
import { cn as L } from "../../utils/cn.js";
|
|
9
|
+
const U = A(
|
|
10
|
+
(z, f) => {
|
|
11
|
+
const S = E(), {
|
|
12
|
+
label: h,
|
|
13
|
+
hint: x,
|
|
14
|
+
error: g,
|
|
14
15
|
options: c,
|
|
15
|
-
onChange:
|
|
16
|
+
onChange: a,
|
|
16
17
|
value: r,
|
|
17
|
-
disabled:
|
|
18
|
+
disabled: i,
|
|
18
19
|
prefix: b,
|
|
19
|
-
size:
|
|
20
|
-
placeholder:
|
|
21
|
-
shouldScrollToSelectedOption:
|
|
20
|
+
size: M,
|
|
21
|
+
placeholder: T,
|
|
22
|
+
shouldScrollToSelectedOption: w,
|
|
22
23
|
collisionPadding: D
|
|
23
|
-
} = S,
|
|
24
|
+
} = z, v = T ?? S.select.placeholder, O = I(() => {
|
|
24
25
|
const e = r && c.find((l) => l.value === r);
|
|
25
26
|
return e ? typeof e.label != "function" ? /* @__PURE__ */ t(
|
|
26
27
|
s,
|
|
@@ -38,13 +39,13 @@ const G = C(
|
|
|
38
39
|
className: "grow-1 fix-y-text truncate text-left text-comp-select-text-placeholder",
|
|
39
40
|
weight: "regular",
|
|
40
41
|
component: "span",
|
|
41
|
-
children:
|
|
42
|
+
children: v
|
|
42
43
|
}
|
|
43
44
|
);
|
|
44
|
-
}, [c, r,
|
|
45
|
+
}, [c, r, v]), [o, W] = m.useState(!1), [y, C] = m.useState(0), d = m.useRef(!1), V = N(null), u = N({}), n = (typeof f == "function" ? null : f) ?? V;
|
|
45
46
|
return R(() => {
|
|
46
47
|
const e = () => {
|
|
47
|
-
n.current &&
|
|
48
|
+
n.current && C(n.current.offsetWidth);
|
|
48
49
|
};
|
|
49
50
|
e();
|
|
50
51
|
const l = new ResizeObserver(e);
|
|
@@ -53,47 +54,47 @@ const G = C(
|
|
|
53
54
|
};
|
|
54
55
|
}, [n]), R(() => {
|
|
55
56
|
var e;
|
|
56
|
-
o && r && u.current[r] &&
|
|
57
|
-
}, [o,
|
|
58
|
-
|
|
57
|
+
o && r && u.current[r] && w && ((e = u.current[r]) == null || e.scrollIntoView({ block: "nearest" }));
|
|
58
|
+
}, [o, w, r]), /* @__PURE__ */ p("div", { className: "flex flex-1 flex-col gap-sm", children: [
|
|
59
|
+
h && /* @__PURE__ */ t(
|
|
59
60
|
s,
|
|
60
61
|
{
|
|
61
62
|
component: "label",
|
|
62
63
|
size: "sm",
|
|
63
64
|
weight: "regular",
|
|
64
65
|
className: "text-comp-select-text-primary",
|
|
65
|
-
children:
|
|
66
|
+
children: h
|
|
66
67
|
}
|
|
67
68
|
),
|
|
68
69
|
/* @__PURE__ */ p(
|
|
69
|
-
|
|
70
|
+
P,
|
|
70
71
|
{
|
|
71
72
|
onOpenChange: (e) => {
|
|
72
|
-
|
|
73
|
+
W(e);
|
|
73
74
|
},
|
|
74
75
|
children: [
|
|
75
|
-
/* @__PURE__ */ t(
|
|
76
|
+
/* @__PURE__ */ t(_, { disabled: i, asChild: !0, children: /* @__PURE__ */ t(
|
|
76
77
|
"button",
|
|
77
78
|
{
|
|
78
79
|
ref: n,
|
|
79
80
|
type: "button",
|
|
80
81
|
role: "input",
|
|
81
82
|
tabIndex: 0,
|
|
82
|
-
disabled:
|
|
83
|
-
className:
|
|
83
|
+
disabled: i,
|
|
84
|
+
className: j({ size: M, error: g, expanded: o }),
|
|
84
85
|
children: /* @__PURE__ */ p("div", { className: "flex min-w-0 flex-1 items-center gap-sm", children: [
|
|
85
86
|
b && /* @__PURE__ */ t(
|
|
86
87
|
"span",
|
|
87
88
|
{
|
|
88
|
-
className:
|
|
89
|
+
className: i ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
|
|
89
90
|
children: b
|
|
90
91
|
}
|
|
91
92
|
),
|
|
92
|
-
|
|
93
|
+
O,
|
|
93
94
|
/* @__PURE__ */ t(
|
|
94
|
-
|
|
95
|
+
G,
|
|
95
96
|
{
|
|
96
|
-
className:
|
|
97
|
+
className: L(
|
|
97
98
|
"transition-transform duration-200",
|
|
98
99
|
o ? "rotate-0" : "rotate-180"
|
|
99
100
|
)
|
|
@@ -103,7 +104,7 @@ const G = C(
|
|
|
103
104
|
}
|
|
104
105
|
) }),
|
|
105
106
|
/* @__PURE__ */ t(
|
|
106
|
-
|
|
107
|
+
k,
|
|
107
108
|
{
|
|
108
109
|
className: "mt-1",
|
|
109
110
|
style: {
|
|
@@ -114,14 +115,14 @@ const G = C(
|
|
|
114
115
|
},
|
|
115
116
|
collisionPadding: D,
|
|
116
117
|
children: /* @__PURE__ */ t(
|
|
117
|
-
|
|
118
|
+
B,
|
|
118
119
|
{
|
|
119
120
|
value: r,
|
|
120
121
|
onValueChange: (e) => {
|
|
121
|
-
d.current = !0,
|
|
122
|
+
d.current = !0, a == null || a(e);
|
|
122
123
|
},
|
|
123
124
|
children: c.map((e) => /* @__PURE__ */ t(
|
|
124
|
-
|
|
125
|
+
F,
|
|
125
126
|
{
|
|
126
127
|
value: e.value.toString(),
|
|
127
128
|
disabled: e.disabled,
|
|
@@ -140,20 +141,20 @@ const G = C(
|
|
|
140
141
|
]
|
|
141
142
|
}
|
|
142
143
|
),
|
|
143
|
-
|
|
144
|
+
x && /* @__PURE__ */ t(
|
|
144
145
|
s,
|
|
145
146
|
{
|
|
146
147
|
component: "p",
|
|
147
148
|
size: "sm",
|
|
148
149
|
weight: "regular",
|
|
149
|
-
className:
|
|
150
|
-
children:
|
|
150
|
+
className: g ? "text-comp-select-text-error" : "text-comp-select-text-secondary",
|
|
151
|
+
children: x
|
|
151
152
|
}
|
|
152
153
|
)
|
|
153
154
|
] });
|
|
154
155
|
}
|
|
155
156
|
);
|
|
156
|
-
|
|
157
|
+
U.displayName = "Select";
|
|
157
158
|
export {
|
|
158
|
-
|
|
159
|
+
U as Select
|
|
159
160
|
};
|
|
@@ -13,6 +13,6 @@ export interface StepperProps {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
onLimitReached?: (limit: 'min' | 'max') => void;
|
|
15
15
|
}
|
|
16
|
-
declare const Stepper: ({ value, defaultValue, onChange, min, max, step, disabled, formatValue, incrementAriaLabel, decrementAriaLabel, className, onLimitReached, }: StepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const Stepper: ({ value, defaultValue, onChange, min, max, step, disabled, formatValue, incrementAriaLabel: incrementAriaLabelProp, decrementAriaLabel: decrementAriaLabelProp, className, onLimitReached, }: StepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export { Stepper };
|
|
18
18
|
//# sourceMappingURL=Stepper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Stepper.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Stepper.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,YAAY;IAE3B,KAAK,EAAE,MAAM,CAAA;IAEb,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAElC,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAEvC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,KAAK,IAAI,CAAA;CAChD;AAED,QAAA,MAAM,OAAO,GAAI,8LAad,YAAY,4CAmFd,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -1,84 +1,85 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { StepperButton as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as w, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as I, useEffect as M } from "react";
|
|
3
|
+
import { StepperButton as b } from "./StepperButton.js";
|
|
4
|
+
import { useMuzaTranslations as T } from "../../translations/TranslationContext.js";
|
|
5
|
+
import { Typography as D } from "../Typography/Typography.js";
|
|
6
|
+
import { cn as x } from "../../utils/cn.js";
|
|
7
|
+
import { MinusCircleBold as E, AddCircleBold as Y } from "@solar-icons/react-perf";
|
|
8
|
+
const P = ({
|
|
9
|
+
value: f,
|
|
9
10
|
defaultValue: p,
|
|
10
11
|
onChange: r,
|
|
11
|
-
min:
|
|
12
|
+
min: i,
|
|
12
13
|
max: o,
|
|
13
|
-
step:
|
|
14
|
+
step: z,
|
|
14
15
|
disabled: m,
|
|
15
|
-
formatValue:
|
|
16
|
-
incrementAriaLabel:
|
|
17
|
-
decrementAriaLabel:
|
|
18
|
-
className:
|
|
19
|
-
onLimitReached:
|
|
16
|
+
formatValue: d,
|
|
17
|
+
incrementAriaLabel: v,
|
|
18
|
+
decrementAriaLabel: A,
|
|
19
|
+
className: N,
|
|
20
|
+
onLimitReached: s
|
|
20
21
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
!
|
|
24
|
-
}, [p,
|
|
22
|
+
const n = T(), y = v ?? n.stepper.incrementAriaLabel, k = A ?? n.stepper.decrementAriaLabel, c = f !== void 0, [S, a] = I(p ?? 0), e = c ? f : S, u = z ?? 1;
|
|
23
|
+
M(() => {
|
|
24
|
+
!c && p !== void 0 && a(p);
|
|
25
|
+
}, [p, c]);
|
|
25
26
|
const B = () => {
|
|
26
27
|
if (m) return;
|
|
27
|
-
const t =
|
|
28
|
-
if (
|
|
29
|
-
|
|
28
|
+
const t = e - u;
|
|
29
|
+
if (i !== void 0 && t < i) {
|
|
30
|
+
s == null || s("min");
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
-
},
|
|
33
|
+
c || a(t), r == null || r(t);
|
|
34
|
+
}, j = () => {
|
|
34
35
|
if (m) return;
|
|
35
|
-
const t =
|
|
36
|
+
const t = e + u;
|
|
36
37
|
if (o !== void 0 && t > o) {
|
|
37
|
-
|
|
38
|
+
s == null || s("max");
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
c || a(t), r == null || r(t);
|
|
41
42
|
};
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ w("div", { className: x("flex items-center gap-sm", N), children: [
|
|
43
44
|
/* @__PURE__ */ l(
|
|
44
|
-
|
|
45
|
+
b,
|
|
45
46
|
{
|
|
46
|
-
ariaLabel:
|
|
47
|
+
ariaLabel: k,
|
|
47
48
|
onClick: B,
|
|
48
|
-
disabled: m ||
|
|
49
|
+
disabled: m || i !== void 0 && e <= i,
|
|
49
50
|
className: "size-comp-stepper-btn-size",
|
|
50
|
-
children: /* @__PURE__ */ l(
|
|
51
|
+
children: /* @__PURE__ */ l(E, { className: "size-full transition-colors" })
|
|
51
52
|
}
|
|
52
53
|
),
|
|
53
54
|
/* @__PURE__ */ l(
|
|
54
|
-
|
|
55
|
+
D,
|
|
55
56
|
{
|
|
56
57
|
variant: "body",
|
|
57
58
|
size: "base",
|
|
58
59
|
weight: "medium",
|
|
59
60
|
component: "span",
|
|
60
|
-
className:
|
|
61
|
+
className: x(
|
|
61
62
|
"min-w-[1.75rem] text-center text-text-dark-primary-def",
|
|
62
63
|
{
|
|
63
|
-
"text-text-dark-secondary":
|
|
64
|
+
"text-text-dark-secondary": e === i
|
|
64
65
|
}
|
|
65
66
|
),
|
|
66
67
|
fixY: !0,
|
|
67
|
-
children:
|
|
68
|
+
children: d ? d(e) : e
|
|
68
69
|
}
|
|
69
70
|
),
|
|
70
71
|
/* @__PURE__ */ l(
|
|
71
|
-
|
|
72
|
+
b,
|
|
72
73
|
{
|
|
73
|
-
ariaLabel:
|
|
74
|
-
onClick:
|
|
75
|
-
disabled: m || o !== void 0 &&
|
|
74
|
+
ariaLabel: y,
|
|
75
|
+
onClick: j,
|
|
76
|
+
disabled: m || o !== void 0 && e >= o,
|
|
76
77
|
className: "size-comp-stepper-btn-size",
|
|
77
|
-
children: /* @__PURE__ */ l(
|
|
78
|
+
children: /* @__PURE__ */ l(Y, { className: "size-full transition-colors" })
|
|
78
79
|
}
|
|
79
80
|
)
|
|
80
81
|
] });
|
|
81
82
|
};
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
+
P as Stepper
|
|
84
85
|
};
|
|
@@ -12,6 +12,6 @@ export interface SwipeButtonProps extends React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
12
12
|
onResetComplete?: () => void;
|
|
13
13
|
className?: string;
|
|
14
14
|
}
|
|
15
|
-
declare const SwipeButton: ({ text, successText, loadingText, variant, size, fullWidth, loading, success, disabled, danger, onSwipeComplete, reset, onResetComplete, className, }: SwipeButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const SwipeButton: ({ text, successText: successTextProp, loadingText: loadingTextProp, variant, size, fullWidth, loading, success, disabled, danger, onSwipeComplete, reset, onResetComplete, className, }: SwipeButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export { SwipeButton };
|
|
17
17
|
//# sourceMappingURL=SwipeButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeButton.d.ts","sourceRoot":"","sources":["../../../src/components/SwipeButton/SwipeButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"SwipeButton.d.ts","sourceRoot":"","sources":["../../../src/components/SwipeButton/SwipeButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAgB5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,mBAAmB,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,WAAW,GAAI,yLAelB,gBAAgB,4CAsOlB,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|