@oprt/react 0.2.1 → 0.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/README.md +2 -1
- package/dist/Popover/Popover.js +6 -5
- package/dist/Tabs/useTabsIndicator.js +1 -1
- package/dist/_internal/hydration.js +2 -2
- package/dist/_internal/motion.js +2 -2
- package/dist/index.cjs +12 -11
- package/dist/version.js +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -35,7 +35,8 @@ import "@oprt/tokens";
|
|
|
35
35
|
import "./globals.css";
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Load the tokens from
|
|
38
|
+
Load the tokens from
|
|
39
|
+
JavaScript or a `<link>`, not with an `@import` inside the Tailwind
|
|
39
40
|
stylesheet: the Tailwind CLI inlines an imported file without rewriting its font URLs, and the
|
|
40
41
|
bundled fonts would not load. Inside Tailwind Typography's `prose`, wrap components in an element
|
|
41
42
|
with the `not-prose` class.
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -69,11 +69,12 @@ var Popover = forwardRef(
|
|
|
69
69
|
const dialog = useRef(null);
|
|
70
70
|
const lastDialog = useRef(null);
|
|
71
71
|
const wasOpen = useRef(false);
|
|
72
|
-
const focusFrame = useRef();
|
|
72
|
+
const focusFrame = useRef(void 0);
|
|
73
73
|
const focusScrollClose = useRef(false);
|
|
74
74
|
const current = useRef({ isOpen, onCloseAutoFocus, returnFocusRef });
|
|
75
75
|
current.current = { isOpen, onCloseAutoFocus, returnFocusRef };
|
|
76
|
-
const
|
|
76
|
+
const triggerChild = children;
|
|
77
|
+
const childRef = parseInt(version, 10) < 19 ? triggerChild.ref : triggerChild.props.ref;
|
|
77
78
|
const rememberTrigger = useCallback((node) => {
|
|
78
79
|
trigger.current = node;
|
|
79
80
|
if (node) lastTrigger.current = node;
|
|
@@ -209,10 +210,10 @@ var Popover = forwardRef(
|
|
|
209
210
|
document.removeEventListener("pointercancel", cancel, true);
|
|
210
211
|
};
|
|
211
212
|
}, [isOpen, requestOpen]);
|
|
212
|
-
const triggerElement = cloneElement(
|
|
213
|
+
const triggerElement = cloneElement(triggerChild, {
|
|
213
214
|
ref: setTrigger,
|
|
214
|
-
disabled: disabled ||
|
|
215
|
-
"aria-disabled": disabled ||
|
|
215
|
+
disabled: disabled || triggerChild.props.disabled,
|
|
216
|
+
"aria-disabled": disabled || triggerChild.props["aria-disabled"],
|
|
216
217
|
"aria-controls": isOpen ? id : void 0
|
|
217
218
|
});
|
|
218
219
|
const pressable = /* @__PURE__ */ jsx(Pressable, { isDisabled: disabled, children: triggerElement });
|
|
@@ -6,7 +6,7 @@ import { createResizeObserver } from "../_internal/useElementWidth.js";
|
|
|
6
6
|
import { useIsomorphicLayoutEffect } from "../_internal/useIsomorphicLayoutEffect.js";
|
|
7
7
|
function useTabsIndicator(list, vertical) {
|
|
8
8
|
const [geometry, setGeometry] = useState();
|
|
9
|
-
const selectedId = useRef();
|
|
9
|
+
const selectedId = useRef(void 0);
|
|
10
10
|
useIsomorphicLayoutEffect(() => {
|
|
11
11
|
const node = list.current;
|
|
12
12
|
if (!node) return;
|
|
@@ -35,11 +35,11 @@ function warnProbeMissing(origin) {
|
|
|
35
35
|
function useHydrationRoot(...forwardedIds) {
|
|
36
36
|
const probe = useId();
|
|
37
37
|
const hydrated = useSyncExternalStore(subscribeNoop, getClientSnapshot, getServerSnapshot);
|
|
38
|
-
const hydratingMount = useRef();
|
|
38
|
+
const hydratingMount = useRef(void 0);
|
|
39
39
|
if (hydratingMount.current === void 0) hydratingMount.current = !hydrated;
|
|
40
40
|
const [disagrees, setDisagrees] = useState(false);
|
|
41
41
|
const clientOnly = useRef(hydrated);
|
|
42
|
-
const origin = useRef();
|
|
42
|
+
const origin = useRef(void 0);
|
|
43
43
|
if (process.env.NODE_ENV !== "production" && origin.current === void 0) {
|
|
44
44
|
origin.current = callerOfHook();
|
|
45
45
|
}
|
package/dist/_internal/motion.js
CHANGED
|
@@ -25,8 +25,8 @@ function useMotion(mode = "auto", component) {
|
|
|
25
25
|
const [ready, setReady] = useState(false);
|
|
26
26
|
const [keyboard, setKeyboard] = useState(false);
|
|
27
27
|
const pointer = useRef(false);
|
|
28
|
-
const frame = useRef();
|
|
29
|
-
const contactCleanup = useRef();
|
|
28
|
+
const frame = useRef(void 0);
|
|
29
|
+
const contactCleanup = useRef(void 0);
|
|
30
30
|
const clearContact = useCallback(() => {
|
|
31
31
|
contactCleanup.current?.();
|
|
32
32
|
contactCleanup.current = void 0;
|
package/dist/index.cjs
CHANGED
|
@@ -944,8 +944,8 @@ function useMotion(mode = "auto", component) {
|
|
|
944
944
|
const [ready, setReady] = (0, import_react8.useState)(false);
|
|
945
945
|
const [keyboard, setKeyboard] = (0, import_react8.useState)(false);
|
|
946
946
|
const pointer = (0, import_react8.useRef)(false);
|
|
947
|
-
const frame = (0, import_react8.useRef)();
|
|
948
|
-
const contactCleanup = (0, import_react8.useRef)();
|
|
947
|
+
const frame = (0, import_react8.useRef)(void 0);
|
|
948
|
+
const contactCleanup = (0, import_react8.useRef)(void 0);
|
|
949
949
|
const clearContact = (0, import_react8.useCallback)(() => {
|
|
950
950
|
contactCleanup.current?.();
|
|
951
951
|
contactCleanup.current = void 0;
|
|
@@ -1286,11 +1286,11 @@ function warnProbeMissing(origin) {
|
|
|
1286
1286
|
function useHydrationRoot(...forwardedIds) {
|
|
1287
1287
|
const probe = (0, import_react11.useId)();
|
|
1288
1288
|
const hydrated = (0, import_react11.useSyncExternalStore)(subscribeNoop, getClientSnapshot, getServerSnapshot);
|
|
1289
|
-
const hydratingMount = (0, import_react11.useRef)();
|
|
1289
|
+
const hydratingMount = (0, import_react11.useRef)(void 0);
|
|
1290
1290
|
if (hydratingMount.current === void 0) hydratingMount.current = !hydrated;
|
|
1291
1291
|
const [disagrees, setDisagrees] = (0, import_react11.useState)(false);
|
|
1292
1292
|
const clientOnly = (0, import_react11.useRef)(hydrated);
|
|
1293
|
-
const origin = (0, import_react11.useRef)();
|
|
1293
|
+
const origin = (0, import_react11.useRef)(void 0);
|
|
1294
1294
|
if (process.env.NODE_ENV !== "production" && origin.current === void 0) {
|
|
1295
1295
|
origin.current = callerOfHook();
|
|
1296
1296
|
}
|
|
@@ -6464,7 +6464,7 @@ var TabsCompositionRules = {
|
|
|
6464
6464
|
var import_react45 = require("react");
|
|
6465
6465
|
function useTabsIndicator(list, vertical) {
|
|
6466
6466
|
const [geometry, setGeometry] = (0, import_react45.useState)();
|
|
6467
|
-
const selectedId = (0, import_react45.useRef)();
|
|
6467
|
+
const selectedId = (0, import_react45.useRef)(void 0);
|
|
6468
6468
|
useIsomorphicLayoutEffect(() => {
|
|
6469
6469
|
const node = list.current;
|
|
6470
6470
|
if (!node) return;
|
|
@@ -13031,11 +13031,12 @@ var Popover2 = (0, import_react74.forwardRef)(
|
|
|
13031
13031
|
const dialog = (0, import_react74.useRef)(null);
|
|
13032
13032
|
const lastDialog = (0, import_react74.useRef)(null);
|
|
13033
13033
|
const wasOpen = (0, import_react74.useRef)(false);
|
|
13034
|
-
const focusFrame = (0, import_react74.useRef)();
|
|
13034
|
+
const focusFrame = (0, import_react74.useRef)(void 0);
|
|
13035
13035
|
const focusScrollClose = (0, import_react74.useRef)(false);
|
|
13036
13036
|
const current = (0, import_react74.useRef)({ isOpen, onCloseAutoFocus, returnFocusRef });
|
|
13037
13037
|
current.current = { isOpen, onCloseAutoFocus, returnFocusRef };
|
|
13038
|
-
const
|
|
13038
|
+
const triggerChild = children;
|
|
13039
|
+
const childRef = parseInt(import_react74.version, 10) < 19 ? triggerChild.ref : triggerChild.props.ref;
|
|
13039
13040
|
const rememberTrigger = (0, import_react74.useCallback)((node) => {
|
|
13040
13041
|
trigger.current = node;
|
|
13041
13042
|
if (node) lastTrigger.current = node;
|
|
@@ -13171,10 +13172,10 @@ var Popover2 = (0, import_react74.forwardRef)(
|
|
|
13171
13172
|
document.removeEventListener("pointercancel", cancel, true);
|
|
13172
13173
|
};
|
|
13173
13174
|
}, [isOpen, requestOpen]);
|
|
13174
|
-
const triggerElement = (0, import_react74.cloneElement)(
|
|
13175
|
+
const triggerElement = (0, import_react74.cloneElement)(triggerChild, {
|
|
13175
13176
|
ref: setTrigger,
|
|
13176
|
-
disabled: disabled ||
|
|
13177
|
-
"aria-disabled": disabled ||
|
|
13177
|
+
disabled: disabled || triggerChild.props.disabled,
|
|
13178
|
+
"aria-disabled": disabled || triggerChild.props["aria-disabled"],
|
|
13178
13179
|
"aria-controls": isOpen ? id : void 0
|
|
13179
13180
|
});
|
|
13180
13181
|
const pressable = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react_aria_components21.Pressable, { isDisabled: disabled, children: triggerElement });
|
|
@@ -17700,7 +17701,7 @@ var PlaybackControlsManifest = {
|
|
|
17700
17701
|
};
|
|
17701
17702
|
|
|
17702
17703
|
// package.json
|
|
17703
|
-
var version3 = "0.
|
|
17704
|
+
var version3 = "0.3.0";
|
|
17704
17705
|
|
|
17705
17706
|
// src/version.ts
|
|
17706
17707
|
var VERSION = version3;
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oprt/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "React components for operational interfaces: command, control and industrial software. 75 component families with interactive behavior from React Aria, styled with Tailwind CSS 4.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -50,14 +50,16 @@
|
|
|
50
50
|
"react-aria": "^3.51.0",
|
|
51
51
|
"react-aria-components": "^1.20.0",
|
|
52
52
|
"@oprt/icons": "0.1.0",
|
|
53
|
-
"@oprt/tokens": "0.
|
|
53
|
+
"@oprt/tokens": "0.3.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@testing-library/jest-dom": "^6.6.3",
|
|
57
57
|
"@testing-library/react": "^16.0.1",
|
|
58
58
|
"@testing-library/user-event": "^14.5.2",
|
|
59
59
|
"@types/react": "^18.3.12",
|
|
60
|
+
"@types/react-19": "npm:@types/react@19.3.0",
|
|
60
61
|
"@types/react-dom": "^18.3.1",
|
|
62
|
+
"@types/react-dom-19": "npm:@types/react-dom@19.3.0",
|
|
61
63
|
"@vitest/coverage-v8": "^2.1.3",
|
|
62
64
|
"jsdom": "^25.0.1",
|
|
63
65
|
"react": "^18.3.1",
|
|
@@ -66,7 +68,7 @@
|
|
|
66
68
|
"typescript": "^5.6.3",
|
|
67
69
|
"vitest": "^2.1.3",
|
|
68
70
|
"vitest-axe": "^0.1.0",
|
|
69
|
-
"@oprt/manifest": "0.
|
|
71
|
+
"@oprt/manifest": "0.3.0"
|
|
70
72
|
},
|
|
71
73
|
"license": "MIT",
|
|
72
74
|
"publishConfig": {
|