@vkzstudio/muza-ui 1.9.1 → 1.9.3
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/Input/Input.js +1 -1
- package/dist/components/PhoneInput/PhoneInput.d.ts.map +1 -1
- package/dist/components/PhoneInput/PhoneInput.js +68 -60
- package/dist/components/RatingBlock/RatingBlock.d.ts.map +1 -1
- package/dist/components/RatingBlock/RatingBlock.js +22 -19
- package/dist/components/Select/Select.d.ts +26 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +81 -73
- package/dist/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +6 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +17 -17
- package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/muza-ui.css +1 -1
- package/dist/stories/AutofillHarness.stories.d.ts +19 -0
- package/dist/stories/AutofillHarness.stories.d.ts.map +1 -0
- package/dist/styles/token-colors.css +4 -0
- package/dist/styles/token-sizes.css +12 -8
- package/dist/styles/utilities.css +28 -0
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +20 -1
- package/llms-full.md +2 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as u, jsxs as N } from "react/jsx-runtime";
|
|
2
2
|
import * as e from "react";
|
|
3
3
|
import * as g from "@radix-ui/react-tooltip";
|
|
4
|
-
import { useMuzaTranslationContext as
|
|
5
|
-
import { cn as
|
|
4
|
+
import { useMuzaTranslationContext as w } from "../../translations/TranslationContext.js";
|
|
5
|
+
import { cn as D } from "../../utils/cn.js";
|
|
6
6
|
import { XClose as C } from "../Icons/CustomIcons.js";
|
|
7
7
|
import { Typography as j } from "../Typography/Typography.js";
|
|
8
8
|
const M = () => {
|
|
@@ -24,13 +24,13 @@ const M = () => {
|
|
|
24
24
|
}) => {
|
|
25
25
|
const [T, p] = e.useState(
|
|
26
26
|
b ?? !1
|
|
27
|
-
), [
|
|
27
|
+
), [i, n] = e.useState(!1), s = a !== void 0, l = s ? a : T, t = r === "touch", f = r === !0 || t && i, m = e.useRef(f);
|
|
28
28
|
m.current = f;
|
|
29
29
|
const h = e.useRef(null), d = e.useCallback(
|
|
30
30
|
(y) => {
|
|
31
|
-
|
|
31
|
+
s || p(y), o == null || o(y);
|
|
32
32
|
},
|
|
33
|
-
[
|
|
33
|
+
[s, o]
|
|
34
34
|
), v = e.useCallback(() => {
|
|
35
35
|
m.current = !0, n(!0);
|
|
36
36
|
}, []), k = e.useCallback(
|
|
@@ -65,14 +65,14 @@ const M = () => {
|
|
|
65
65
|
detectTouch: x,
|
|
66
66
|
clickModeRef: T,
|
|
67
67
|
open: p,
|
|
68
|
-
setOpen:
|
|
68
|
+
setOpen: i,
|
|
69
69
|
onTouchDetected: n,
|
|
70
|
-
triggerRef:
|
|
70
|
+
triggerRef: s
|
|
71
71
|
} = e.useContext(R), l = e.useCallback(
|
|
72
72
|
(t) => {
|
|
73
|
-
|
|
73
|
+
s.current = t, typeof o == "function" ? o(t) : o && (o.current = t);
|
|
74
74
|
},
|
|
75
|
-
[o,
|
|
75
|
+
[o, s]
|
|
76
76
|
);
|
|
77
77
|
return /* @__PURE__ */ u(
|
|
78
78
|
g.Trigger,
|
|
@@ -83,7 +83,7 @@ const M = () => {
|
|
|
83
83
|
a == null || a(t), x && t.pointerType === "touch" && n();
|
|
84
84
|
},
|
|
85
85
|
onClick: (t) => {
|
|
86
|
-
r == null || r(t), T.current &&
|
|
86
|
+
r == null || r(t), T.current && i(!p);
|
|
87
87
|
},
|
|
88
88
|
...b
|
|
89
89
|
}
|
|
@@ -100,31 +100,31 @@ const O = e.forwardRef(
|
|
|
100
100
|
"aria-label": x,
|
|
101
101
|
...T
|
|
102
102
|
}, p) => {
|
|
103
|
-
const { clickMode:
|
|
103
|
+
const { clickMode: i, setOpen: n, triggerRef: s } = e.useContext(R), { translations: l } = w(), t = o ?? l.tooltip.closeAriaLabel, f = x ?? (i && typeof a == "string" ? a : void 0);
|
|
104
104
|
return /* @__PURE__ */ N(
|
|
105
105
|
g.Content,
|
|
106
106
|
{
|
|
107
107
|
ref: p,
|
|
108
108
|
sideOffset: b,
|
|
109
109
|
"aria-label": f,
|
|
110
|
-
className:
|
|
111
|
-
"relative z-50 origin-[--radix-tooltip-content-transform-origin] animate-in overflow-hidden rounded-comp-tooltip-radius bg-surface-brand-brand-tertiary py-comp-tooltip-p-ver text-text-brand-def fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
110
|
+
className: D(
|
|
111
|
+
"relative z-50 max-w-comp-tooltip-w-max origin-[--radix-tooltip-content-transform-origin] animate-in overflow-hidden rounded-comp-tooltip-radius bg-surface-brand-brand-tertiary py-comp-tooltip-p-ver text-text-brand-def fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
112
112
|
// Click mode reserves extra right padding for the close button.
|
|
113
|
-
|
|
113
|
+
i ? "pr-comp-tooltip-p-right pl-comp-tooltip-p-left" : "px-comp-tooltip-p-left",
|
|
114
114
|
r
|
|
115
115
|
),
|
|
116
116
|
...T,
|
|
117
|
-
...
|
|
117
|
+
...i && {
|
|
118
118
|
onEscapeKeyDown: () => n(!1),
|
|
119
119
|
onPointerDownOutside: (m) => {
|
|
120
120
|
var d;
|
|
121
121
|
const h = m.detail.originalEvent.target;
|
|
122
|
-
h && ((d =
|
|
122
|
+
h && ((d = s.current) != null && d.contains(h)) || n(!1);
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
125
|
children: [
|
|
126
126
|
/* @__PURE__ */ u(j, { component: "span", variant: "body", weight: "regular", size: "sm", children: a }),
|
|
127
|
-
|
|
127
|
+
i && /* @__PURE__ */ u(
|
|
128
128
|
"button",
|
|
129
129
|
{
|
|
130
130
|
type: "button",
|
|
@@ -5,6 +5,7 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof Tooltip>;
|
|
6
6
|
export declare const DefaultTooltipComponent: Story;
|
|
7
7
|
export declare const OpenState: Story;
|
|
8
|
+
export declare const AvailableWidth: Story;
|
|
8
9
|
export declare const OpenOnTouch: Story;
|
|
9
10
|
export declare const OpenOnClick: Story;
|
|
10
11
|
export declare const PrefferedSideBottom: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAK3D,OAAO,EACL,OAAO,EAIR,MAAM,WAAW,CAAA;AAElB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,
|
|
1
|
+
{"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAK3D,OAAO,EACL,OAAO,EAIR,MAAM,WAAW,CAAA;AAElB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CA0D9B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAA;AAErC,eAAO,MAAM,uBAAuB,EAAE,KAqBrC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAsBvB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAwB5B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAsBzB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAkCzB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAsBjC,CAAA"}
|