@g4rcez/components 1.2.6 → 1.3.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/floating/modal.d.ts.map +1 -1
- package/dist/components/floating/modal.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7500 -7538
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +88 -88
- package/dist/index.umd.js.map +1 -1
- package/package.json +144 -146
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,YAAY,EASpB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAmB,eAAe,EAAqE,MAAM,cAAc,CAAC;AACnI,OAAO,KAAkH,MAAM,OAAO,CAAC;AAIvI,OAAO,EAAE,KAAK,EAAO,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMnD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAuD9C,MAAM,MAAM,UAAU,GAAG,QAAQ,CAC7B,eAAe,CAAC,KAAK,CAAC,EACtB,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GAAG;IAC5E,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,YAAY,EASpB,MAAM,oBAAoB,CAAC;AA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,GAAG;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAA;CAAE,CAAC;AAI/D,eAAO,MAAM,KAAK;WAlGJ,KAAK;gBAAc,MAAM;;UACzB,OAAO;cACH,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI;;YAE9B,KAAK;UACP,SAAS;cACL,OAAO;aACR,OAAO;cACN,MAAM;aACP,OAAO;eACL,MAAM;cACP,OAAO;eACN,OAAO;mBACH,MAAM;sBACH,MAAM;cACd,cAAc;uBACL,OAAO;UACpB,QAAQ,GAAG,SAAS;kBACZ,YAAY,EAAE;aACnB,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC;;;;eAnBmB,MAAM;YAAU,KAAK;;UAChE,OAAO;cACH,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI;;YAE9B,KAAK;UACP,SAAS;cACL,OAAO;aACR,OAAO;cACN,MAAM;aACP,OAAO;eACL,MAAM;cACP,OAAO;eACN,OAAO;mBACH,MAAM;sBACH,MAAM;cACd,cAAc;uBACL,OAAO;UACpB,QAAQ,GAAG,SAAS;kBACZ,YAAY,EAAE;aACnB,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC;;;2CAuRrC,CAAC"}
|
|
@@ -12,25 +12,25 @@ import { css, mergeRefs } from "../../lib/dom";
|
|
|
12
12
|
const Slot = RadixSlot.Slot;
|
|
13
13
|
const animationDuration = "500ms";
|
|
14
14
|
const drawerLeft = {
|
|
15
|
-
exit: {
|
|
16
|
-
enter: {
|
|
17
|
-
initial: {
|
|
15
|
+
exit: { x: ["0%", "-30%"], opacity: 0, animationDuration },
|
|
16
|
+
enter: { x: ["-30%", "0%"], opacity: 1, animationDuration },
|
|
17
|
+
initial: { x: ["-30%", "0%"], opacity: 0.8, animationDuration },
|
|
18
18
|
};
|
|
19
19
|
const drawerRight = {
|
|
20
|
-
initial: {
|
|
21
|
-
enter: {
|
|
22
|
-
exit: {
|
|
20
|
+
initial: { x: ["30%", "0%"], opacity: 0.8 },
|
|
21
|
+
enter: { x: "0%", opacity: 1, animationDuration },
|
|
22
|
+
exit: { x: ["0%", "30%"], opacity: 0, animationDuration },
|
|
23
23
|
};
|
|
24
24
|
const animations = {
|
|
25
25
|
drawer: (type) => (type === "left" ? drawerLeft : drawerRight),
|
|
26
26
|
sheet: {
|
|
27
|
-
initial: { opacity: 0.5,
|
|
28
|
-
enter: { opacity: 1,
|
|
29
|
-
exit: { opacity: 0.1,
|
|
27
|
+
initial: { opacity: 0.5, y: "25%", animationDuration, transformOrigin: "bottom" },
|
|
28
|
+
enter: { opacity: 1, y: "0%", animationDuration, transformOrigin: "bottom" },
|
|
29
|
+
exit: { opacity: 0.1, y: "50%", animationDuration, transformOrigin: "bottom" },
|
|
30
30
|
},
|
|
31
31
|
dialog: {
|
|
32
32
|
exit: { opacity: 0, scale: 0.95, animationDuration },
|
|
33
|
-
initial: { opacity: 0.5, scale: 0.95, animationDuration,
|
|
33
|
+
initial: { opacity: 0.5, scale: 0.95, animationDuration, transition: { duration: 0.5, ease: 'easeInOut' } },
|
|
34
34
|
enter: { opacity: 1, scale: [1.05, 1], animationDuration },
|
|
35
35
|
},
|
|
36
36
|
};
|
|
@@ -76,7 +76,7 @@ const Draggable = (props) => {
|
|
|
76
76
|
? "top-1 flex h-3 w-full justify-center py-2"
|
|
77
77
|
: props.position === "left"
|
|
78
78
|
? "right-5 top-1/2 h-10 w-2"
|
|
79
|
-
: "left-2 top-1/2 h-10 w-2"), children: props.sheet ? _jsx("div", { className: "
|
|
79
|
+
: "left-2 top-1/2 h-10 w-2"), children: props.sheet ? _jsx("div", { className: "w-1/4 h-2 rounded-lg bg-floating-border" }) : null }));
|
|
80
80
|
};
|
|
81
81
|
const positions = { drawer: "right", sheet: "none", dialog: "none" };
|
|
82
82
|
const fetchPosition = (isDesktop, forceType, propsType, propsPosition) => {
|
|
@@ -164,5 +164,5 @@ export const Modal = forwardRef(({ open, title, footer, asChild, trigger, childr
|
|
|
164
164
|
position,
|
|
165
165
|
type,
|
|
166
166
|
}), className, "overscroll-contain"),
|
|
167
|
-
}), "data-component": "modal", style: type === "drawer" ? { width: floatingSize } : { height: floatingSize }, children: [title ? (_jsx("header", { className: "relative w-full", children: title ? (_jsx("h2", { id: headingId, className: "
|
|
167
|
+
}), "data-component": "modal", style: type === "drawer" ? { width: floatingSize } : { height: floatingSize }, children: [title ? (_jsx("header", { className: "relative w-full", children: title ? (_jsx("h2", { id: headingId, className: "px-8 pb-2 text-3xl font-medium leading-relaxed border-b select-text border-floating-border", children: title })) : null })) : null, _jsx("section", { "data-component": "modal-body", className: css("flex-1 select-text overflow-y-auto px-8 py-1", bodyClassName), children: children }), footer ? (_jsx("footer", { className: "px-8 pt-4 w-full border-t select-text border-floating-border", children: footer })) : null, closable ? (_jsx("nav", { className: "absolute top-1 right-4 z-floating", children: _jsx("button", { type: "button", onClick: onClose, className: "p-1 opacity-70 transition-colors hover:opacity-100 hover:text-danger focus:text-danger", children: _jsx(XIcon, {}) }) })) : null, useResizer && resizer ? (_jsx(Draggable, { onChange: onChange, value: floatingSize, sheet: type === "sheet", position: position, parent: floating.refs.floating })) : null] }) }) })) : null }, headingId) })] }));
|
|
168
168
|
});
|