@moises.ai/design-system 4.14.2 → 4.14.4
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/index.js
CHANGED
|
@@ -2307,16 +2307,16 @@ const nm = "_Callout_1lwt5_1", rm = "_size1_1lwt5_5", sm = "_onlyButton_1lwt5_5"
|
|
|
2307
2307
|
iconButtonProps: p,
|
|
2308
2308
|
...A
|
|
2309
2309
|
}) => {
|
|
2310
|
-
const g = !!u, v = !!p, C = g || v, m = vm(r), I = km(r), k = r === "3" ? "3" : "2", S = te(null), E = te(null), [R, w] = V("
|
|
2310
|
+
const g = !!u, v = !!p, C = g || v, m = vm(r), I = km(r), k = r === "3" ? "3" : "2", S = te(null), E = te(null), [R, w] = V("start");
|
|
2311
2311
|
go(() => {
|
|
2312
2312
|
if (!C) {
|
|
2313
|
-
w("
|
|
2313
|
+
w("start");
|
|
2314
2314
|
return;
|
|
2315
2315
|
}
|
|
2316
2316
|
if (!S.current || !E.current) return;
|
|
2317
2317
|
const B = () => {
|
|
2318
|
-
const O = S.current.
|
|
2319
|
-
w(O
|
|
2318
|
+
const O = S.current.scrollHeight, x = E.current.scrollHeight;
|
|
2319
|
+
w(O <= x ? "center" : "start");
|
|
2320
2320
|
};
|
|
2321
2321
|
B();
|
|
2322
2322
|
const D = new ResizeObserver(B);
|
|
@@ -2340,13 +2340,12 @@ const nm = "_Callout_1lwt5_1", rm = "_size1_1lwt5_5", sm = "_onlyButton_1lwt5_5"
|
|
|
2340
2340
|
v && !g && tn.onlyIconButton
|
|
2341
2341
|
),
|
|
2342
2342
|
...A,
|
|
2343
|
-
children: /* @__PURE__ */ f(y, { justify: "between", gap: "3", width: "100%", children: [
|
|
2343
|
+
children: /* @__PURE__ */ f(y, { justify: "between", gap: "3", width: "100%", align: R, children: [
|
|
2344
2344
|
/* @__PURE__ */ f(
|
|
2345
2345
|
y,
|
|
2346
2346
|
{
|
|
2347
2347
|
direction: "row",
|
|
2348
2348
|
gap: "2",
|
|
2349
|
-
align: R,
|
|
2350
2349
|
width: "100%",
|
|
2351
2350
|
children: [
|
|
2352
2351
|
N(),
|
|
@@ -2357,7 +2356,7 @@ const nm = "_Callout_1lwt5_1", rm = "_size1_1lwt5_5", sm = "_onlyButton_1lwt5_5"
|
|
|
2357
2356
|
]
|
|
2358
2357
|
}
|
|
2359
2358
|
),
|
|
2360
|
-
C && /* @__PURE__ */ f(y, { ref: E, gap: "2", align: "
|
|
2359
|
+
C && /* @__PURE__ */ f(y, { ref: E, gap: "2", align: "start", shrink: "0", children: [
|
|
2361
2360
|
g && /* @__PURE__ */ a(
|
|
2362
2361
|
Oe,
|
|
2363
2362
|
{
|
package/package.json
CHANGED
|
@@ -37,21 +37,20 @@ export const Callout = ({
|
|
|
37
37
|
|
|
38
38
|
const contentRef = useRef(null)
|
|
39
39
|
const actionsRef = useRef(null)
|
|
40
|
-
const [
|
|
40
|
+
const [outerAlign, setOuterAlign] = useState('start')
|
|
41
41
|
|
|
42
42
|
useLayoutEffect(() => {
|
|
43
|
-
|
|
44
43
|
if (!hasActions) {
|
|
45
|
-
|
|
44
|
+
setOuterAlign('start')
|
|
46
45
|
return
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
if (!contentRef.current || !actionsRef.current) return
|
|
50
49
|
|
|
51
50
|
const updateAlign = () => {
|
|
52
|
-
const contentHeight = contentRef.current.
|
|
53
|
-
const actionsHeight = actionsRef.current.
|
|
54
|
-
|
|
51
|
+
const contentHeight = contentRef.current.scrollHeight
|
|
52
|
+
const actionsHeight = actionsRef.current.scrollHeight
|
|
53
|
+
setOuterAlign(contentHeight <= actionsHeight ? 'center' : 'start')
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
updateAlign()
|
|
@@ -90,11 +89,10 @@ export const Callout = ({
|
|
|
90
89
|
)}
|
|
91
90
|
{...props}
|
|
92
91
|
>
|
|
93
|
-
<Flex justify="between" gap="3" width="100%">
|
|
92
|
+
<Flex justify="between" gap="3" width="100%" align={outerAlign}>
|
|
94
93
|
<Flex
|
|
95
94
|
direction="row"
|
|
96
95
|
gap="2"
|
|
97
|
-
align={contentAlign}
|
|
98
96
|
width="100%"
|
|
99
97
|
>
|
|
100
98
|
{renderIcon()}
|
|
@@ -113,7 +111,7 @@ export const Callout = ({
|
|
|
113
111
|
</Flex>
|
|
114
112
|
|
|
115
113
|
{hasActions && (
|
|
116
|
-
<Flex ref={actionsRef} gap="2" align=
|
|
114
|
+
<Flex ref={actionsRef} gap="2" align='start' shrink="0">
|
|
117
115
|
{hasButton && (
|
|
118
116
|
<Button
|
|
119
117
|
size={buttonSizeForCallout(size)}
|