@povio/ui 2.2.2 → 2.2.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/components/overlays/BottomSheet/BottomSheet.js +5 -5
- package/dist/tw-ui-plugin.js +21 -0
- package/package.json +59 -20
- package/dist/_virtual/rolldown:runtime.js +0 -31
- package/dist/node_modules/.pnpm/motion@12.23.28_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/motion/dist/es/react.js +0 -10
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { motion, react_exports } from "../../../node_modules/.pnpm/motion@12.23.28_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/motion/dist/es/react.js";
|
|
2
1
|
import { DomUtils } from "../../../utils/dom.utils.js";
|
|
3
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { clsx } from "clsx";
|
|
5
4
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
6
5
|
import { Dialog, DialogTrigger, Modal, ModalOverlay } from "react-aria-components";
|
|
7
6
|
import { useResizeObserver, useViewportSize } from "@react-aria/utils";
|
|
7
|
+
import { AnimatePresence, animate, motion, useMotionValue } from "motion/react";
|
|
8
8
|
var MotionModal = motion.create(Modal);
|
|
9
9
|
var MotionModalOverlay = motion.create(ModalOverlay);
|
|
10
10
|
var inertiaTransition = {
|
|
@@ -30,7 +30,7 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
30
30
|
windowHeight: Math.max(window.innerHeight, viewport.height) - sheetMarginTop
|
|
31
31
|
};
|
|
32
32
|
}, [viewport.height, sheetMarginTop]);
|
|
33
|
-
const y =
|
|
33
|
+
const y = useMotionValue(sheetHeight);
|
|
34
34
|
const closeVelocityRef = useRef(true);
|
|
35
35
|
const overlayRef = useRef(null);
|
|
36
36
|
const containerRef = useRef(null);
|
|
@@ -53,11 +53,11 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
53
53
|
oldHeightRef.current = rect.height;
|
|
54
54
|
if (y.get() < 0) {
|
|
55
55
|
y.stop();
|
|
56
|
-
|
|
56
|
+
animate(y, 0);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
return /* @__PURE__ */ jsx(
|
|
60
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(MotionModalOverlay, {
|
|
61
61
|
isOpen: true,
|
|
62
62
|
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
63
63
|
className: clsx("fixed top-0 left-0 z-10 w-screen", containerClassName),
|
|
@@ -119,7 +119,7 @@ var BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = fa
|
|
|
119
119
|
onDragEnd: (e, { velocity }) => {
|
|
120
120
|
containerRef.current?.style.removeProperty("pointer-events");
|
|
121
121
|
if (y.get() > 0) if (closeVelocityRef.current && velocity.y > 10 || y.get() > 200) onOpenChange?.(false);
|
|
122
|
-
else
|
|
122
|
+
else animate(y, 0, {
|
|
123
123
|
...inertiaTransition,
|
|
124
124
|
min: 0,
|
|
125
125
|
max: 0
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import plugin from "tailwindcss/plugin";
|
|
2
|
+
var tw_ui_plugin_default = plugin(({ addVariant }) => {
|
|
3
|
+
addVariant("input-filled", [
|
|
4
|
+
"&:has(input:not(:placeholder-shown))",
|
|
5
|
+
"&:is(:where(.group\\/input-content):has(:is(input:not(:placeholder-shown))) *)",
|
|
6
|
+
"&:is(:where(.group\\/select-content)[data-has-selection] *)",
|
|
7
|
+
"&:is(:where(.group\\/select-content)[data-has-search] *)",
|
|
8
|
+
"&:is(:where(.group\\/select-content)[data-searchable-focus-within] *)",
|
|
9
|
+
"&:is(:where(.group\\/date-picker-content)[data-has-selection] *)",
|
|
10
|
+
"&:is(:where(.group\\/date-picker-content)[data-focus-within] *)"
|
|
11
|
+
].join(", "));
|
|
12
|
+
addVariant("input-disabled", [
|
|
13
|
+
"&:is(:where(.group\\/input-content):has(*:is(input:disabled)) *)",
|
|
14
|
+
"&:is(:where(.group\\/select-content)[data-disabled] *)",
|
|
15
|
+
"&:is(:where(.group\\/select-content):has(*:is(input:disabled)) *)",
|
|
16
|
+
"&:is(:where(.group\\/text-area):has(*:is(textarea:disabled)) *)",
|
|
17
|
+
"&:is(:where(.group\\/text-editor):where([data-rac])[data-disabled] *)",
|
|
18
|
+
"&:is(:where(.group\\/date-picker-content):where([data-rac])[data-disabled] *)"
|
|
19
|
+
].join(", "));
|
|
20
|
+
});
|
|
21
|
+
export { tw_ui_plugin_default as default };
|
package/package.json
CHANGED
|
@@ -1,37 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@povio/ui",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
9
|
"./text-editor": "./dist/text-editor.js",
|
|
10
|
-
"./text-editor/styles": "./dist/styles/editor.css"
|
|
10
|
+
"./text-editor/styles": "./dist/styles/editor.css",
|
|
11
|
+
"./tw-ui-plugin": "./dist/tw-ui-plugin.js"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"dist"
|
|
14
15
|
],
|
|
15
16
|
"homepage": "https://povio.com",
|
|
16
17
|
"license": "UNLICENSED",
|
|
17
|
-
"peerDependencies": {
|
|
18
|
-
"@casl/ability": "^6.7.3",
|
|
19
|
-
"@casl/react": "^5.0.0",
|
|
20
|
-
"@tiptap/core": "^3.19.0",
|
|
21
|
-
"@tiptap/extension-color": "^3.19.0",
|
|
22
|
-
"@tiptap/extension-heading": "^3.19.0",
|
|
23
|
-
"@tiptap/extension-highlight": "^3.19.0",
|
|
24
|
-
"@tiptap/extension-link": "^3.19.0",
|
|
25
|
-
"@tiptap/extension-placeholder": "^3.19.0",
|
|
26
|
-
"@tiptap/extension-text-align": "^3.19.0",
|
|
27
|
-
"@tiptap/extension-text-style": "^3.19.0",
|
|
28
|
-
"@tiptap/extension-underline": "^3.19.0",
|
|
29
|
-
"@tiptap/pm": "^3.19.0",
|
|
30
|
-
"@tiptap/react": "^3.19.0",
|
|
31
|
-
"@tiptap/starter-kit": "^3.19.0",
|
|
32
|
-
"react": "^19.1.0",
|
|
33
|
-
"react-dom": "^19.1.0"
|
|
34
|
-
},
|
|
35
18
|
"dependencies": {
|
|
36
19
|
"@dnd-kit/core": "^6.3.1",
|
|
37
20
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
@@ -67,5 +50,61 @@
|
|
|
67
50
|
"tailwindcss": "^4.1.18",
|
|
68
51
|
"tailwindcss-react-aria-components": "^2.0.1",
|
|
69
52
|
"zod": "^4.3.5"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@casl/ability": "^6.7.3",
|
|
56
|
+
"@casl/react": "^5.0.0",
|
|
57
|
+
"@tiptap/core": "^3.19.0",
|
|
58
|
+
"@tiptap/extension-color": "^3.19.0",
|
|
59
|
+
"@tiptap/extension-heading": "^3.19.0",
|
|
60
|
+
"@tiptap/extension-highlight": "^3.19.0",
|
|
61
|
+
"@tiptap/extension-link": "^3.19.0",
|
|
62
|
+
"@tiptap/extension-placeholder": "^3.19.0",
|
|
63
|
+
"@tiptap/extension-text-align": "^3.19.0",
|
|
64
|
+
"@tiptap/extension-text-style": "^3.19.0",
|
|
65
|
+
"@tiptap/extension-underline": "^3.19.0",
|
|
66
|
+
"@tiptap/pm": "^3.19.0",
|
|
67
|
+
"@tiptap/react": "^3.19.0",
|
|
68
|
+
"@tiptap/starter-kit": "^3.19.0",
|
|
69
|
+
"react": "^19.1.0",
|
|
70
|
+
"react-dom": "^19.1.0"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"@tiptap/core": {
|
|
74
|
+
"optional": true
|
|
75
|
+
},
|
|
76
|
+
"@tiptap/extension-color": {
|
|
77
|
+
"optional": true
|
|
78
|
+
},
|
|
79
|
+
"@tiptap/extension-heading": {
|
|
80
|
+
"optional": true
|
|
81
|
+
},
|
|
82
|
+
"@tiptap/extension-highlight": {
|
|
83
|
+
"optional": true
|
|
84
|
+
},
|
|
85
|
+
"@tiptap/extension-link": {
|
|
86
|
+
"optional": true
|
|
87
|
+
},
|
|
88
|
+
"@tiptap/extension-placeholder": {
|
|
89
|
+
"optional": true
|
|
90
|
+
},
|
|
91
|
+
"@tiptap/extension-text-align": {
|
|
92
|
+
"optional": true
|
|
93
|
+
},
|
|
94
|
+
"@tiptap/extension-text-style": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"@tiptap/extension-underline": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"@tiptap/pm": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"@tiptap/react": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"@tiptap/starter-kit": {
|
|
107
|
+
"optional": true
|
|
108
|
+
}
|
|
70
109
|
}
|
|
71
110
|
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (all, symbols) => {
|
|
6
|
-
let target = {};
|
|
7
|
-
for (var name in all) __defProp(target, name, {
|
|
8
|
-
get: all[name],
|
|
9
|
-
enumerable: true
|
|
10
|
-
});
|
|
11
|
-
if (symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
12
|
-
return target;
|
|
13
|
-
};
|
|
14
|
-
var __copyProps = (to, from, except, desc) => {
|
|
15
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
16
|
-
key = keys[i];
|
|
17
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
-
get: ((k) => from[k]).bind(null, key),
|
|
19
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __reExport = (target, mod, secondTarget, symbols) => {
|
|
25
|
-
if (symbols) {
|
|
26
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
27
|
-
secondTarget && __defProp(secondTarget, Symbol.toStringTag, { value: "Module" });
|
|
28
|
-
}
|
|
29
|
-
__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default");
|
|
30
|
-
};
|
|
31
|
-
export { __export, __reExport };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { __export, __reExport } from "../../../../../../../_virtual/rolldown:runtime.js";
|
|
2
|
-
import { m, motion } from "framer-motion";
|
|
3
|
-
export * from "framer-motion";
|
|
4
|
-
var react_exports = /* @__PURE__ */ __export({
|
|
5
|
-
m: () => m,
|
|
6
|
-
motion: () => motion
|
|
7
|
-
}, 1);
|
|
8
|
-
import * as import_framer_motion from "framer-motion";
|
|
9
|
-
__reExport(react_exports, import_framer_motion, void 0, 1);
|
|
10
|
-
export { motion, react_exports };
|