From dfe9e1e058d20569663f640b37e1165d808139dc Mon Sep 17 00:00:00 2001 From: luisd101 Date: Fri, 21 Mar 2025 20:32:15 -0700 Subject: [PATCH 01/12] feat. updated individual project page --- frontend/bitmatch/src/App.jsx | 2 + .../src/components/project/DiscussionCard.jsx | 125 + .../src/components/project/MemberCard.jsx | 63 + .../src/components/project/PositionCard.jsx | 119 + .../bitmatch/src/components/ui/Dialog.jsx | 104 + .../bitmatch/src/views/AddProjectPage.jsx | 224 + .../src/views/IndividualProjectPage.jsx | 566 +- .../bitmatch/src/views/ProjectListPage.jsx | 12 +- node_modules/.package-lock.json | 494 + node_modules/@radix-ui/primitive/README.md | 13 + .../@radix-ui/primitive/dist/index.d.mts | 5 + .../@radix-ui/primitive/dist/index.d.ts | 5 + .../@radix-ui/primitive/dist/index.js | 36 + .../@radix-ui/primitive/dist/index.js.map | 7 + .../@radix-ui/primitive/dist/index.mjs | 13 + .../@radix-ui/primitive/dist/index.mjs.map | 7 + node_modules/@radix-ui/primitive/package.json | 38 + .../@radix-ui/react-compose-refs/README.md | 13 + .../react-compose-refs/dist/index.d.mts | 15 + .../react-compose-refs/dist/index.d.ts | 15 + .../react-compose-refs/dist/index.js | 74 + .../react-compose-refs/dist/index.js.map | 7 + .../react-compose-refs/dist/index.mjs | 41 + .../react-compose-refs/dist/index.mjs.map | 7 + .../@radix-ui/react-compose-refs/package.json | 47 + .../@radix-ui/react-context/README.md | 13 + .../@radix-ui/react-context/dist/index.d.mts | 21 + .../@radix-ui/react-context/dist/index.d.ts | 21 + .../@radix-ui/react-context/dist/index.js | 114 + .../@radix-ui/react-context/dist/index.js.map | 7 + .../@radix-ui/react-context/dist/index.mjs | 81 + .../react-context/dist/index.mjs.map | 7 + .../@radix-ui/react-context/package.json | 47 + node_modules/@radix-ui/react-dialog/README.md | 13 + .../@radix-ui/react-dialog/dist/index.d.mts | 103 + .../@radix-ui/react-dialog/dist/index.d.ts | 103 + .../@radix-ui/react-dialog/dist/index.js | 372 + .../@radix-ui/react-dialog/dist/index.js.map | 7 + .../@radix-ui/react-dialog/dist/index.mjs | 340 + .../@radix-ui/react-dialog/dist/index.mjs.map | 7 + .../@radix-ui/react-dialog/package.json | 79 + .../react-dismissable-layer/README.md | 13 + .../react-dismissable-layer/dist/index.d.mts | 51 + .../react-dismissable-layer/dist/index.d.ts | 51 + .../react-dismissable-layer/dist/index.js | 253 + .../react-dismissable-layer/dist/index.js.map | 7 + .../react-dismissable-layer/dist/index.mjs | 221 + .../dist/index.mjs.map | 7 + .../react-dismissable-layer/package.json | 71 + .../@radix-ui/react-focus-guards/README.md | 13 + .../react-focus-guards/dist/index.d.mts | 9 + .../react-focus-guards/dist/index.d.ts | 9 + .../react-focus-guards/dist/index.js | 72 + .../react-focus-guards/dist/index.js.map | 7 + .../react-focus-guards/dist/index.mjs | 40 + .../react-focus-guards/dist/index.mjs.map | 7 + .../@radix-ui/react-focus-guards/package.json | 47 + .../@radix-ui/react-focus-scope/README.md | 13 + .../react-focus-scope/dist/index.d.mts | 32 + .../react-focus-scope/dist/index.d.ts | 32 + .../@radix-ui/react-focus-scope/dist/index.js | 246 + .../react-focus-scope/dist/index.js.map | 7 + .../react-focus-scope/dist/index.mjs | 214 + .../react-focus-scope/dist/index.mjs.map | 7 + .../@radix-ui/react-focus-scope/package.json | 68 + node_modules/@radix-ui/react-id/README.md | 13 + .../@radix-ui/react-id/dist/index.d.mts | 3 + .../@radix-ui/react-id/dist/index.d.ts | 3 + node_modules/@radix-ui/react-id/dist/index.js | 49 + .../@radix-ui/react-id/dist/index.js.map | 7 + .../@radix-ui/react-id/dist/index.mjs | 16 + .../@radix-ui/react-id/dist/index.mjs.map | 7 + node_modules/@radix-ui/react-id/package.json | 50 + node_modules/@radix-ui/react-portal/README.md | 13 + .../@radix-ui/react-portal/dist/index.d.mts | 14 + .../@radix-ui/react-portal/dist/index.d.ts | 14 + .../@radix-ui/react-portal/dist/index.js | 55 + .../@radix-ui/react-portal/dist/index.js.map | 7 + .../@radix-ui/react-portal/dist/index.mjs | 23 + .../@radix-ui/react-portal/dist/index.mjs.map | 7 + .../@radix-ui/react-portal/package.json | 67 + .../@radix-ui/react-presence/README.md | 13 + .../@radix-ui/react-presence/dist/index.d.mts | 11 + .../@radix-ui/react-presence/dist/index.d.ts | 11 + .../@radix-ui/react-presence/dist/index.js | 169 + .../react-presence/dist/index.js.map | 7 + .../@radix-ui/react-presence/dist/index.mjs | 137 + .../react-presence/dist/index.mjs.map | 7 + .../@radix-ui/react-presence/package.json | 56 + .../@radix-ui/react-primitive/README.md | 13 + .../react-primitive/dist/index.d.mts | 52 + .../@radix-ui/react-primitive/dist/index.d.ts | 52 + .../@radix-ui/react-primitive/dist/index.js | 78 + .../react-primitive/dist/index.js.map | 7 + .../@radix-ui/react-primitive/dist/index.mjs | 45 + .../react-primitive/dist/index.mjs.map | 7 + .../@radix-ui/react-primitive/package.json | 66 + node_modules/@radix-ui/react-slot/README.md | 13 + .../@radix-ui/react-slot/dist/index.d.mts | 13 + .../@radix-ui/react-slot/dist/index.d.ts | 13 + .../@radix-ui/react-slot/dist/index.js | 118 + .../@radix-ui/react-slot/dist/index.js.map | 7 + .../@radix-ui/react-slot/dist/index.mjs | 85 + .../@radix-ui/react-slot/dist/index.mjs.map | 7 + .../@radix-ui/react-slot/package.json | 61 + .../react-use-callback-ref/README.md | 13 + .../react-use-callback-ref/dist/index.d.mts | 7 + .../react-use-callback-ref/dist/index.d.ts | 7 + .../react-use-callback-ref/dist/index.js | 46 + .../react-use-callback-ref/dist/index.js.map | 7 + .../react-use-callback-ref/dist/index.mjs | 13 + .../react-use-callback-ref/dist/index.mjs.map | 7 + .../react-use-callback-ref/package.json | 47 + .../react-use-controllable-state/README.md | 13 + .../dist/index.d.mts | 10 + .../dist/index.d.ts | 10 + .../dist/index.js | 80 + .../dist/index.js.map | 7 + .../dist/index.mjs | 47 + .../dist/index.mjs.map | 7 + .../react-use-controllable-state/package.json | 50 + .../react-use-escape-keydown/README.md | 13 + .../react-use-escape-keydown/dist/index.d.mts | 6 + .../react-use-escape-keydown/dist/index.d.ts | 6 + .../react-use-escape-keydown/dist/index.js | 52 + .../dist/index.js.map | 7 + .../react-use-escape-keydown/dist/index.mjs | 19 + .../dist/index.mjs.map | 7 + .../react-use-escape-keydown/package.json | 50 + .../react-use-layout-effect/README.md | 13 + .../react-use-layout-effect/dist/index.d.mts | 12 + .../react-use-layout-effect/dist/index.d.ts | 12 + .../react-use-layout-effect/dist/index.js | 41 + .../react-use-layout-effect/dist/index.js.map | 7 + .../react-use-layout-effect/dist/index.mjs | 8 + .../dist/index.mjs.map | 7 + .../react-use-layout-effect/package.json | 47 + node_modules/aria-hidden/LICENSE | 21 + node_modules/aria-hidden/README.md | 99 + .../aria-hidden/dist/es2015/index.d.ts | 29 + node_modules/aria-hidden/dist/es2015/index.js | 166 + .../aria-hidden/dist/es2019/index.d.ts | 29 + node_modules/aria-hidden/dist/es2019/index.js | 155 + node_modules/aria-hidden/dist/es5/index.d.ts | 29 + node_modules/aria-hidden/dist/es5/index.js | 173 + node_modules/aria-hidden/package.json | 70 + node_modules/detect-node-es/LICENSE | 21 + node_modules/detect-node-es/Readme.md | 39 + node_modules/detect-node-es/es5/browser.js | 2 + node_modules/detect-node-es/es5/node.d.ts | 4 + node_modules/detect-node-es/es5/node.js | 2 + node_modules/detect-node-es/esm/browser.js | 2 + node_modules/detect-node-es/esm/node.js | 2 + node_modules/detect-node-es/package.json | 29 + node_modules/get-nonce/CHANGELOG.md | 1 + node_modules/get-nonce/LICENSE | 21 + node_modules/get-nonce/README.md | 54 + node_modules/get-nonce/dist/es2015/index.d.ts | 2 + node_modules/get-nonce/dist/es2015/index.js | 13 + node_modules/get-nonce/dist/es5/index.d.ts | 2 + node_modules/get-nonce/dist/es5/index.js | 15 + node_modules/get-nonce/package.json | 68 + node_modules/react-dom/LICENSE | 21 + node_modules/react-dom/README.md | 60 + .../cjs/react-dom-client.development.js | 24716 +++++++++++++++ .../cjs/react-dom-client.production.js | 15181 ++++++++++ .../cjs/react-dom-profiling.development.js | 25103 ++++++++++++++++ .../cjs/react-dom-profiling.profiling.js | 16010 ++++++++++ ...t-dom-server-legacy.browser.development.js | 8574 ++++++ ...ct-dom-server-legacy.browser.production.js | 5626 ++++ ...eact-dom-server-legacy.node.development.js | 8574 ++++++ ...react-dom-server-legacy.node.production.js | 5704 ++++ .../react-dom-server.browser.development.js | 8956 ++++++ .../react-dom-server.browser.production.js | 6111 ++++ .../cjs/react-dom-server.bun.development.js | 8292 +++++ .../cjs/react-dom-server.bun.production.js | 5694 ++++ .../cjs/react-dom-server.edge.development.js | 8975 ++++++ .../cjs/react-dom-server.edge.production.js | 6202 ++++ .../cjs/react-dom-server.node.development.js | 8849 ++++++ .../cjs/react-dom-server.node.production.js | 6097 ++++ .../cjs/react-dom-test-utils.development.js | 24 + .../cjs/react-dom-test-utils.production.js | 21 + .../react-dom/cjs/react-dom.development.js | 424 + .../react-dom/cjs/react-dom.production.js | 210 + .../cjs/react-dom.react-server.development.js | 340 + .../cjs/react-dom.react-server.production.js | 152 + node_modules/react-dom/client.js | 38 + node_modules/react-dom/client.react-server.js | 5 + node_modules/react-dom/index.js | 38 + node_modules/react-dom/package.json | 117 + node_modules/react-dom/profiling.js | 38 + .../react-dom/profiling.react-server.js | 5 + .../react-dom/react-dom.react-server.js | 7 + node_modules/react-dom/server.browser.js | 18 + node_modules/react-dom/server.bun.js | 19 + node_modules/react-dom/server.edge.js | 19 + node_modules/react-dom/server.js | 3 + node_modules/react-dom/server.node.js | 18 + node_modules/react-dom/server.react-server.js | 5 + node_modules/react-dom/static.browser.js | 12 + node_modules/react-dom/static.edge.js | 12 + node_modules/react-dom/static.js | 3 + node_modules/react-dom/static.node.js | 12 + node_modules/react-dom/static.react-server.js | 5 + node_modules/react-dom/test-utils.js | 7 + .../react-remove-scroll-bar/README.md | 52 + .../constants/package.json | 8 + .../dist/es2015/component.d.ts | 13 + .../dist/es2015/component.js | 53 + .../dist/es2015/constants.d.ts | 8 + .../dist/es2015/constants.js | 8 + .../dist/es2015/index.d.ts | 4 + .../dist/es2015/index.js | 4 + .../dist/es2015/utils.d.ts | 14 + .../dist/es2015/utils.js | 29 + .../dist/es2019/component.d.ts | 13 + .../dist/es2019/component.js | 85 + .../dist/es2019/constants.d.ts | 8 + .../dist/es2019/constants.js | 8 + .../dist/es2019/index.d.ts | 4 + .../dist/es2019/index.js | 4 + .../dist/es2019/utils.d.ts | 14 + .../dist/es2019/utils.js | 28 + .../dist/es5/component.d.ts | 13 + .../dist/es5/component.js | 59 + .../dist/es5/constants.d.ts | 8 + .../dist/es5/constants.js | 11 + .../dist/es5/index.d.ts | 4 + .../react-remove-scroll-bar/dist/es5/index.js | 12 + .../dist/es5/utils.d.ts | 14 + .../react-remove-scroll-bar/dist/es5/utils.js | 33 + .../react-remove-scroll-bar/package.json | 85 + node_modules/react-remove-scroll/LICENSE | 21 + node_modules/react-remove-scroll/README.md | 152 + node_modules/react-remove-scroll/UI/UI.d.ts | 1 + .../react-remove-scroll/UI/package.json | 8 + .../dist/es2015/Combination.d.ts | 3 + .../dist/es2015/Combination.js | 7 + .../dist/es2015/SideEffect.d.ts | 5 + .../dist/es2015/SideEffect.js | 157 + .../react-remove-scroll/dist/es2015/UI.d.ts | 7 + .../react-remove-scroll/dist/es2015/UI.js | 36 + .../dist/es2015/aggresiveCapture.d.ts | 3 + .../dist/es2015/aggresiveCapture.js | 19 + .../dist/es2015/handleScroll.d.ts | 3 + .../dist/es2015/handleScroll.js | 107 + .../dist/es2015/index.d.ts | 2 + .../react-remove-scroll/dist/es2015/index.js | 2 + .../dist/es2015/medium.d.ts | 2 + .../react-remove-scroll/dist/es2015/medium.js | 2 + .../dist/es2015/pinchAndZoom.d.ts | 8 + .../dist/es2015/pinchAndZoom.js | 33 + .../dist/es2015/sidecar.d.ts | 2 + .../dist/es2015/sidecar.js | 4 + .../dist/es2015/types.d.ts | 98 + .../react-remove-scroll/dist/es2015/types.js | 1 + .../dist/es2019/Combination.d.ts | 3 + .../dist/es2019/Combination.js | 6 + .../dist/es2019/SideEffect.d.ts | 5 + .../dist/es2019/SideEffect.js | 155 + .../react-remove-scroll/dist/es2019/UI.d.ts | 7 + .../react-remove-scroll/dist/es2019/UI.js | 41 + .../dist/es2019/aggresiveCapture.d.ts | 3 + .../dist/es2019/aggresiveCapture.js | 19 + .../dist/es2019/handleScroll.d.ts | 3 + .../dist/es2019/handleScroll.js | 95 + .../dist/es2019/index.d.ts | 2 + .../react-remove-scroll/dist/es2019/index.js | 2 + .../dist/es2019/medium.d.ts | 2 + .../react-remove-scroll/dist/es2019/medium.js | 2 + .../dist/es2019/pinchAndZoom.d.ts | 8 + .../dist/es2019/pinchAndZoom.js | 33 + .../dist/es2019/sidecar.d.ts | 2 + .../dist/es2019/sidecar.js | 4 + .../dist/es2019/types.d.ts | 98 + .../react-remove-scroll/dist/es2019/types.js | 1 + .../dist/es5/Combination.d.ts | 3 + .../dist/es5/Combination.js | 9 + .../dist/es5/SideEffect.d.ts | 5 + .../dist/es5/SideEffect.js | 163 + .../react-remove-scroll/dist/es5/UI.d.ts | 7 + .../react-remove-scroll/dist/es5/UI.js | 39 + .../dist/es5/aggresiveCapture.d.ts | 3 + .../dist/es5/aggresiveCapture.js | 22 + .../dist/es5/handleScroll.d.ts | 3 + .../dist/es5/handleScroll.js | 112 + .../react-remove-scroll/dist/es5/index.d.ts | 2 + .../react-remove-scroll/dist/es5/index.js | 6 + .../react-remove-scroll/dist/es5/medium.d.ts | 2 + .../react-remove-scroll/dist/es5/medium.js | 5 + .../dist/es5/pinchAndZoom.d.ts | 8 + .../dist/es5/pinchAndZoom.js | 37 + .../react-remove-scroll/dist/es5/sidecar.d.ts | 2 + .../react-remove-scroll/dist/es5/sidecar.js | 6 + .../react-remove-scroll/dist/es5/types.d.ts | 98 + .../react-remove-scroll/dist/es5/types.js | 2 + .../react-remove-scroll/dist/index.js | 93 + node_modules/react-remove-scroll/package.json | 98 + .../react-remove-scroll/sidecar/package.json | 7 + .../react-remove-scroll/sidecar/sidecar.d.ts | 5 + node_modules/react-style-singleton/LICENSE | 21 + node_modules/react-style-singleton/README.md | 45 + .../dist/es2015/component.d.ts | 21 + .../dist/es2015/component.js | 16 + .../dist/es2015/hook.d.ts | 23 + .../react-style-singleton/dist/es2015/hook.js | 22 + .../dist/es2015/index.d.ts | 3 + .../dist/es2015/index.js | 3 + .../dist/es2015/singleton.d.ts | 4 + .../dist/es2015/singleton.js | 48 + .../dist/es2019/component.d.ts | 21 + .../dist/es2019/component.js | 15 + .../dist/es2019/hook.d.ts | 23 + .../react-style-singleton/dist/es2019/hook.js | 22 + .../dist/es2019/index.d.ts | 3 + .../dist/es2019/index.js | 3 + .../dist/es2019/singleton.d.ts | 4 + .../dist/es2019/singleton.js | 48 + .../dist/es5/component.d.ts | 21 + .../dist/es5/component.js | 20 + .../react-style-singleton/dist/es5/hook.d.ts | 23 + .../react-style-singleton/dist/es5/hook.js | 27 + .../react-style-singleton/dist/es5/index.d.ts | 3 + .../react-style-singleton/dist/es5/index.js | 9 + .../dist/es5/singleton.d.ts | 4 + .../dist/es5/singleton.js | 52 + .../react-style-singleton/dist/index.js | 1 + .../react-style-singleton/package.json | 90 + node_modules/react/LICENSE | 21 + node_modules/react/README.md | 37 + .../cjs/react-compiler-runtime.development.js | 24 + .../cjs/react-compiler-runtime.production.js | 16 + .../cjs/react-compiler-runtime.profiling.js | 16 + .../cjs/react-jsx-dev-runtime.development.js | 660 + .../cjs/react-jsx-dev-runtime.production.js | 14 + .../cjs/react-jsx-dev-runtime.profiling.js | 14 + ...sx-dev-runtime.react-server.development.js | 670 + ...jsx-dev-runtime.react-server.production.js | 40 + .../cjs/react-jsx-runtime.development.js | 656 + .../react/cjs/react-jsx-runtime.production.js | 34 + .../react/cjs/react-jsx-runtime.profiling.js | 34 + ...ct-jsx-runtime.react-server.development.js | 670 + ...act-jsx-runtime.react-server.production.js | 40 + node_modules/react/cjs/react.development.js | 1521 + node_modules/react/cjs/react.production.js | 538 + .../cjs/react.react-server.development.js | 1114 + .../cjs/react.react-server.production.js | 426 + node_modules/react/compiler-runtime.js | 14 + node_modules/react/index.js | 7 + node_modules/react/jsx-dev-runtime.js | 7 + .../react/jsx-dev-runtime.react-server.js | 7 + node_modules/react/jsx-runtime.js | 7 + .../react/jsx-runtime.react-server.js | 7 + node_modules/react/package.json | 51 + node_modules/react/react.react-server.js | 7 + node_modules/scheduler/LICENSE | 21 + node_modules/scheduler/README.md | 9 + .../scheduler-unstable_mock.development.js | 423 + .../cjs/scheduler-unstable_mock.production.js | 415 + ...cheduler-unstable_post_task.development.js | 155 + ...scheduler-unstable_post_task.production.js | 145 + .../scheduler/cjs/scheduler.development.js | 364 + .../cjs/scheduler.native.development.js | 345 + .../cjs/scheduler.native.production.js | 329 + .../scheduler/cjs/scheduler.production.js | 341 + node_modules/scheduler/index.js | 7 + node_modules/scheduler/index.native.js | 7 + node_modules/scheduler/package.json | 27 + node_modules/scheduler/unstable_mock.js | 7 + node_modules/scheduler/unstable_post_task.js | 7 + node_modules/tslib/CopyrightNotice.txt | 15 + node_modules/tslib/LICENSE.txt | 12 + node_modules/tslib/README.md | 164 + node_modules/tslib/SECURITY.md | 41 + node_modules/tslib/modules/index.d.ts | 38 + node_modules/tslib/modules/index.js | 70 + node_modules/tslib/modules/package.json | 3 + node_modules/tslib/package.json | 47 + node_modules/tslib/tslib.d.ts | 460 + node_modules/tslib/tslib.es6.html | 1 + node_modules/tslib/tslib.es6.js | 402 + node_modules/tslib/tslib.es6.mjs | 401 + node_modules/tslib/tslib.html | 1 + node_modules/tslib/tslib.js | 484 + node_modules/use-callback-ref/LICENSE | 21 + node_modules/use-callback-ref/README.md | 170 + .../dist/es2015/assignRef.d.ts | 15 + .../use-callback-ref/dist/es2015/assignRef.js | 22 + .../dist/es2015/createRef.d.ts | 10 + .../use-callback-ref/dist/es2015/createRef.js | 23 + .../use-callback-ref/dist/es2015/index.d.ts | 8 + .../use-callback-ref/dist/es2015/index.js | 12 + .../dist/es2015/mergeRef.d.ts | 16 + .../use-callback-ref/dist/es2015/mergeRef.js | 18 + .../dist/es2015/refToCallback.d.ts | 24 + .../dist/es2015/refToCallback.js | 48 + .../dist/es2015/transformRef.d.ts | 11 + .../dist/es2015/transformRef.js | 14 + .../use-callback-ref/dist/es2015/types.d.ts | 5 + .../use-callback-ref/dist/es2015/types.js | 1 + .../dist/es2015/useMergeRef.d.ts | 17 + .../dist/es2015/useMergeRef.js | 45 + .../use-callback-ref/dist/es2015/useRef.d.ts | 16 + .../use-callback-ref/dist/es2015/useRef.js | 39 + .../dist/es2015/useTransformRef.d.ts | 15 + .../dist/es2015/useTransformRef.js | 18 + .../dist/es2019/assignRef.d.ts | 15 + .../use-callback-ref/dist/es2019/assignRef.js | 22 + .../dist/es2019/createRef.d.ts | 10 + .../use-callback-ref/dist/es2019/createRef.js | 23 + .../use-callback-ref/dist/es2019/index.d.ts | 8 + .../use-callback-ref/dist/es2019/index.js | 12 + .../dist/es2019/mergeRef.d.ts | 16 + .../use-callback-ref/dist/es2019/mergeRef.js | 18 + .../dist/es2019/refToCallback.d.ts | 24 + .../dist/es2019/refToCallback.js | 48 + .../dist/es2019/transformRef.d.ts | 11 + .../dist/es2019/transformRef.js | 14 + .../use-callback-ref/dist/es2019/types.d.ts | 5 + .../use-callback-ref/dist/es2019/types.js | 1 + .../dist/es2019/useMergeRef.d.ts | 17 + .../dist/es2019/useMergeRef.js | 43 + .../use-callback-ref/dist/es2019/useRef.d.ts | 16 + .../use-callback-ref/dist/es2019/useRef.js | 39 + .../dist/es2019/useTransformRef.d.ts | 15 + .../dist/es2019/useTransformRef.js | 18 + .../use-callback-ref/dist/es5/assignRef.d.ts | 15 + .../use-callback-ref/dist/es5/assignRef.js | 26 + .../use-callback-ref/dist/es5/createRef.d.ts | 10 + .../use-callback-ref/dist/es5/createRef.js | 27 + .../use-callback-ref/dist/es5/index.d.ts | 8 + .../use-callback-ref/dist/es5/index.js | 24 + .../use-callback-ref/dist/es5/mergeRef.d.ts | 16 + .../use-callback-ref/dist/es5/mergeRef.js | 22 + .../dist/es5/refToCallback.d.ts | 24 + .../dist/es5/refToCallback.js | 53 + .../dist/es5/transformRef.d.ts | 11 + .../use-callback-ref/dist/es5/transformRef.js | 18 + .../use-callback-ref/dist/es5/types.d.ts | 5 + .../use-callback-ref/dist/es5/types.js | 2 + .../dist/es5/useMergeRef.d.ts | 17 + .../use-callback-ref/dist/es5/useMergeRef.js | 50 + .../use-callback-ref/dist/es5/useRef.d.ts | 16 + .../use-callback-ref/dist/es5/useRef.js | 43 + .../dist/es5/useTransformRef.d.ts | 15 + .../dist/es5/useTransformRef.js | 22 + node_modules/use-callback-ref/package.json | 85 + node_modules/use-sidecar/LICENSE | 21 + node_modules/use-sidecar/README.md | 349 + .../use-sidecar/dist/es2015/config.d.ts | 5 + .../use-sidecar/dist/es2015/config.js | 6 + node_modules/use-sidecar/dist/es2015/env.d.ts | 4 + node_modules/use-sidecar/dist/es2015/env.js | 5 + .../use-sidecar/dist/es2015/exports.d.ts | 3 + .../use-sidecar/dist/es2015/exports.js | 18 + node_modules/use-sidecar/dist/es2015/hoc.d.ts | 3 + node_modules/use-sidecar/dist/es2015/hoc.js | 15 + .../use-sidecar/dist/es2015/hook.d.ts | 2 + node_modules/use-sidecar/dist/es2015/hook.js | 41 + .../use-sidecar/dist/es2015/index.d.ts | 7 + node_modules/use-sidecar/dist/es2015/index.js | 6 + .../use-sidecar/dist/es2015/medium.d.ts | 3 + .../use-sidecar/dist/es2015/medium.js | 78 + .../use-sidecar/dist/es2015/renderProp.d.ts | 9 + .../use-sidecar/dist/es2015/renderProp.js | 35 + .../use-sidecar/dist/es2015/types.d.ts | 47 + node_modules/use-sidecar/dist/es2015/types.js | 1 + .../use-sidecar/dist/es2019/config.d.ts | 5 + .../use-sidecar/dist/es2019/config.js | 6 + node_modules/use-sidecar/dist/es2019/env.d.ts | 4 + node_modules/use-sidecar/dist/es2019/env.js | 5 + .../use-sidecar/dist/es2019/exports.d.ts | 3 + .../use-sidecar/dist/es2019/exports.js | 16 + node_modules/use-sidecar/dist/es2019/hoc.d.ts | 3 + node_modules/use-sidecar/dist/es2019/hoc.js | 14 + .../use-sidecar/dist/es2019/hook.d.ts | 2 + node_modules/use-sidecar/dist/es2019/hook.js | 41 + .../use-sidecar/dist/es2019/index.d.ts | 7 + node_modules/use-sidecar/dist/es2019/index.js | 6 + .../use-sidecar/dist/es2019/medium.d.ts | 3 + .../use-sidecar/dist/es2019/medium.js | 78 + .../use-sidecar/dist/es2019/renderProp.d.ts | 9 + .../use-sidecar/dist/es2019/renderProp.js | 28 + .../use-sidecar/dist/es2019/types.d.ts | 47 + node_modules/use-sidecar/dist/es2019/types.js | 1 + node_modules/use-sidecar/dist/es5/config.d.ts | 5 + node_modules/use-sidecar/dist/es5/config.js | 10 + node_modules/use-sidecar/dist/es5/env.d.ts | 4 + node_modules/use-sidecar/dist/es5/env.js | 8 + .../use-sidecar/dist/es5/exports.d.ts | 3 + node_modules/use-sidecar/dist/es5/exports.js | 22 + node_modules/use-sidecar/dist/es5/hoc.d.ts | 3 + node_modules/use-sidecar/dist/es5/hoc.js | 19 + node_modules/use-sidecar/dist/es5/hook.d.ts | 2 + node_modules/use-sidecar/dist/es5/hook.js | 45 + node_modules/use-sidecar/dist/es5/index.d.ts | 7 + node_modules/use-sidecar/dist/es5/index.js | 16 + node_modules/use-sidecar/dist/es5/medium.d.ts | 3 + node_modules/use-sidecar/dist/es5/medium.js | 83 + .../use-sidecar/dist/es5/renderProp.d.ts | 9 + .../use-sidecar/dist/es5/renderProp.js | 39 + node_modules/use-sidecar/dist/es5/types.d.ts | 47 + node_modules/use-sidecar/dist/es5/types.js | 2 + node_modules/use-sidecar/package.json | 93 + package-lock.json | 499 + package.json | 5 + 506 files changed, 196007 insertions(+), 103 deletions(-) create mode 100644 frontend/bitmatch/src/components/project/DiscussionCard.jsx create mode 100644 frontend/bitmatch/src/components/project/MemberCard.jsx create mode 100644 frontend/bitmatch/src/components/project/PositionCard.jsx create mode 100644 frontend/bitmatch/src/components/ui/Dialog.jsx create mode 100644 frontend/bitmatch/src/views/AddProjectPage.jsx create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/@radix-ui/primitive/README.md create mode 100644 node_modules/@radix-ui/primitive/dist/index.d.mts create mode 100644 node_modules/@radix-ui/primitive/dist/index.d.ts create mode 100644 node_modules/@radix-ui/primitive/dist/index.js create mode 100644 node_modules/@radix-ui/primitive/dist/index.js.map create mode 100644 node_modules/@radix-ui/primitive/dist/index.mjs create mode 100644 node_modules/@radix-ui/primitive/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/primitive/package.json create mode 100644 node_modules/@radix-ui/react-compose-refs/README.md create mode 100644 node_modules/@radix-ui/react-compose-refs/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-compose-refs/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-compose-refs/dist/index.js create mode 100644 node_modules/@radix-ui/react-compose-refs/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-compose-refs/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-compose-refs/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-compose-refs/package.json create mode 100644 node_modules/@radix-ui/react-context/README.md create mode 100644 node_modules/@radix-ui/react-context/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-context/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-context/dist/index.js create mode 100644 node_modules/@radix-ui/react-context/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-context/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-context/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-context/package.json create mode 100644 node_modules/@radix-ui/react-dialog/README.md create mode 100644 node_modules/@radix-ui/react-dialog/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-dialog/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-dialog/dist/index.js create mode 100644 node_modules/@radix-ui/react-dialog/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-dialog/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-dialog/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-dialog/package.json create mode 100644 node_modules/@radix-ui/react-dismissable-layer/README.md create mode 100644 node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-dismissable-layer/dist/index.js create mode 100644 node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-dismissable-layer/package.json create mode 100644 node_modules/@radix-ui/react-focus-guards/README.md create mode 100644 node_modules/@radix-ui/react-focus-guards/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-focus-guards/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-focus-guards/dist/index.js create mode 100644 node_modules/@radix-ui/react-focus-guards/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-focus-guards/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-focus-guards/package.json create mode 100644 node_modules/@radix-ui/react-focus-scope/README.md create mode 100644 node_modules/@radix-ui/react-focus-scope/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-focus-scope/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-focus-scope/dist/index.js create mode 100644 node_modules/@radix-ui/react-focus-scope/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-focus-scope/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-focus-scope/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-focus-scope/package.json create mode 100644 node_modules/@radix-ui/react-id/README.md create mode 100644 node_modules/@radix-ui/react-id/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-id/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-id/dist/index.js create mode 100644 node_modules/@radix-ui/react-id/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-id/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-id/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-id/package.json create mode 100644 node_modules/@radix-ui/react-portal/README.md create mode 100644 node_modules/@radix-ui/react-portal/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-portal/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-portal/dist/index.js create mode 100644 node_modules/@radix-ui/react-portal/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-portal/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-portal/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-portal/package.json create mode 100644 node_modules/@radix-ui/react-presence/README.md create mode 100644 node_modules/@radix-ui/react-presence/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-presence/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-presence/dist/index.js create mode 100644 node_modules/@radix-ui/react-presence/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-presence/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-presence/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-presence/package.json create mode 100644 node_modules/@radix-ui/react-primitive/README.md create mode 100644 node_modules/@radix-ui/react-primitive/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-primitive/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-primitive/dist/index.js create mode 100644 node_modules/@radix-ui/react-primitive/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-primitive/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-primitive/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-primitive/package.json create mode 100644 node_modules/@radix-ui/react-slot/README.md create mode 100644 node_modules/@radix-ui/react-slot/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-slot/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-slot/dist/index.js create mode 100644 node_modules/@radix-ui/react-slot/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-slot/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-slot/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-slot/package.json create mode 100644 node_modules/@radix-ui/react-use-callback-ref/README.md create mode 100644 node_modules/@radix-ui/react-use-callback-ref/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-use-callback-ref/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-use-callback-ref/dist/index.js create mode 100644 node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-use-callback-ref/package.json create mode 100644 node_modules/@radix-ui/react-use-controllable-state/README.md create mode 100644 node_modules/@radix-ui/react-use-controllable-state/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-use-controllable-state/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-use-controllable-state/dist/index.js create mode 100644 node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-use-controllable-state/package.json create mode 100644 node_modules/@radix-ui/react-use-escape-keydown/README.md create mode 100644 node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-use-escape-keydown/dist/index.js create mode 100644 node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-use-escape-keydown/package.json create mode 100644 node_modules/@radix-ui/react-use-layout-effect/README.md create mode 100644 node_modules/@radix-ui/react-use-layout-effect/dist/index.d.mts create mode 100644 node_modules/@radix-ui/react-use-layout-effect/dist/index.d.ts create mode 100644 node_modules/@radix-ui/react-use-layout-effect/dist/index.js create mode 100644 node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map create mode 100644 node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs create mode 100644 node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.map create mode 100644 node_modules/@radix-ui/react-use-layout-effect/package.json create mode 100644 node_modules/aria-hidden/LICENSE create mode 100644 node_modules/aria-hidden/README.md create mode 100644 node_modules/aria-hidden/dist/es2015/index.d.ts create mode 100644 node_modules/aria-hidden/dist/es2015/index.js create mode 100644 node_modules/aria-hidden/dist/es2019/index.d.ts create mode 100644 node_modules/aria-hidden/dist/es2019/index.js create mode 100644 node_modules/aria-hidden/dist/es5/index.d.ts create mode 100644 node_modules/aria-hidden/dist/es5/index.js create mode 100644 node_modules/aria-hidden/package.json create mode 100644 node_modules/detect-node-es/LICENSE create mode 100644 node_modules/detect-node-es/Readme.md create mode 100644 node_modules/detect-node-es/es5/browser.js create mode 100644 node_modules/detect-node-es/es5/node.d.ts create mode 100644 node_modules/detect-node-es/es5/node.js create mode 100644 node_modules/detect-node-es/esm/browser.js create mode 100644 node_modules/detect-node-es/esm/node.js create mode 100644 node_modules/detect-node-es/package.json create mode 100644 node_modules/get-nonce/CHANGELOG.md create mode 100644 node_modules/get-nonce/LICENSE create mode 100644 node_modules/get-nonce/README.md create mode 100644 node_modules/get-nonce/dist/es2015/index.d.ts create mode 100644 node_modules/get-nonce/dist/es2015/index.js create mode 100644 node_modules/get-nonce/dist/es5/index.d.ts create mode 100644 node_modules/get-nonce/dist/es5/index.js create mode 100644 node_modules/get-nonce/package.json create mode 100644 node_modules/react-dom/LICENSE create mode 100644 node_modules/react-dom/README.md create mode 100644 node_modules/react-dom/cjs/react-dom-client.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-client.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-profiling.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-profiling.profiling.js create mode 100644 node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.browser.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.browser.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.bun.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.bun.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.edge.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.edge.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.node.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.node.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-test-utils.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-test-utils.production.js create mode 100644 node_modules/react-dom/cjs/react-dom.development.js create mode 100644 node_modules/react-dom/cjs/react-dom.production.js create mode 100644 node_modules/react-dom/cjs/react-dom.react-server.development.js create mode 100644 node_modules/react-dom/cjs/react-dom.react-server.production.js create mode 100644 node_modules/react-dom/client.js create mode 100644 node_modules/react-dom/client.react-server.js create mode 100644 node_modules/react-dom/index.js create mode 100644 node_modules/react-dom/package.json create mode 100644 node_modules/react-dom/profiling.js create mode 100644 node_modules/react-dom/profiling.react-server.js create mode 100644 node_modules/react-dom/react-dom.react-server.js create mode 100644 node_modules/react-dom/server.browser.js create mode 100644 node_modules/react-dom/server.bun.js create mode 100644 node_modules/react-dom/server.edge.js create mode 100644 node_modules/react-dom/server.js create mode 100644 node_modules/react-dom/server.node.js create mode 100644 node_modules/react-dom/server.react-server.js create mode 100644 node_modules/react-dom/static.browser.js create mode 100644 node_modules/react-dom/static.edge.js create mode 100644 node_modules/react-dom/static.js create mode 100644 node_modules/react-dom/static.node.js create mode 100644 node_modules/react-dom/static.react-server.js create mode 100644 node_modules/react-dom/test-utils.js create mode 100644 node_modules/react-remove-scroll-bar/README.md create mode 100644 node_modules/react-remove-scroll-bar/constants/package.json create mode 100644 node_modules/react-remove-scroll-bar/dist/es2015/component.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es2015/component.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es2015/constants.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es2015/constants.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es2015/index.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es2015/index.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es2015/utils.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es2015/utils.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es2019/component.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es2019/component.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es2019/constants.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es2019/constants.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es2019/index.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es2019/index.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es2019/utils.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es2019/utils.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es5/component.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es5/component.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es5/constants.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es5/constants.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es5/index.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es5/index.js create mode 100644 node_modules/react-remove-scroll-bar/dist/es5/utils.d.ts create mode 100644 node_modules/react-remove-scroll-bar/dist/es5/utils.js create mode 100644 node_modules/react-remove-scroll-bar/package.json create mode 100644 node_modules/react-remove-scroll/LICENSE create mode 100644 node_modules/react-remove-scroll/README.md create mode 100644 node_modules/react-remove-scroll/UI/UI.d.ts create mode 100644 node_modules/react-remove-scroll/UI/package.json create mode 100644 node_modules/react-remove-scroll/dist/es2015/Combination.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2015/Combination.js create mode 100644 node_modules/react-remove-scroll/dist/es2015/SideEffect.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2015/SideEffect.js create mode 100644 node_modules/react-remove-scroll/dist/es2015/UI.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2015/UI.js create mode 100644 node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js create mode 100644 node_modules/react-remove-scroll/dist/es2015/handleScroll.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2015/handleScroll.js create mode 100644 node_modules/react-remove-scroll/dist/es2015/index.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2015/index.js create mode 100644 node_modules/react-remove-scroll/dist/es2015/medium.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2015/medium.js create mode 100644 node_modules/react-remove-scroll/dist/es2015/pinchAndZoom.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2015/pinchAndZoom.js create mode 100644 node_modules/react-remove-scroll/dist/es2015/sidecar.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2015/sidecar.js create mode 100644 node_modules/react-remove-scroll/dist/es2015/types.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2015/types.js create mode 100644 node_modules/react-remove-scroll/dist/es2019/Combination.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2019/Combination.js create mode 100644 node_modules/react-remove-scroll/dist/es2019/SideEffect.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2019/SideEffect.js create mode 100644 node_modules/react-remove-scroll/dist/es2019/UI.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2019/UI.js create mode 100644 node_modules/react-remove-scroll/dist/es2019/aggresiveCapture.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2019/aggresiveCapture.js create mode 100644 node_modules/react-remove-scroll/dist/es2019/handleScroll.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2019/handleScroll.js create mode 100644 node_modules/react-remove-scroll/dist/es2019/index.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2019/index.js create mode 100644 node_modules/react-remove-scroll/dist/es2019/medium.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2019/medium.js create mode 100644 node_modules/react-remove-scroll/dist/es2019/pinchAndZoom.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2019/pinchAndZoom.js create mode 100644 node_modules/react-remove-scroll/dist/es2019/sidecar.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2019/sidecar.js create mode 100644 node_modules/react-remove-scroll/dist/es2019/types.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es2019/types.js create mode 100644 node_modules/react-remove-scroll/dist/es5/Combination.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es5/Combination.js create mode 100644 node_modules/react-remove-scroll/dist/es5/SideEffect.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es5/SideEffect.js create mode 100644 node_modules/react-remove-scroll/dist/es5/UI.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es5/UI.js create mode 100644 node_modules/react-remove-scroll/dist/es5/aggresiveCapture.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es5/aggresiveCapture.js create mode 100644 node_modules/react-remove-scroll/dist/es5/handleScroll.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es5/handleScroll.js create mode 100644 node_modules/react-remove-scroll/dist/es5/index.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es5/index.js create mode 100644 node_modules/react-remove-scroll/dist/es5/medium.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es5/medium.js create mode 100644 node_modules/react-remove-scroll/dist/es5/pinchAndZoom.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es5/pinchAndZoom.js create mode 100644 node_modules/react-remove-scroll/dist/es5/sidecar.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es5/sidecar.js create mode 100644 node_modules/react-remove-scroll/dist/es5/types.d.ts create mode 100644 node_modules/react-remove-scroll/dist/es5/types.js create mode 100644 node_modules/react-remove-scroll/dist/index.js create mode 100644 node_modules/react-remove-scroll/package.json create mode 100644 node_modules/react-remove-scroll/sidecar/package.json create mode 100644 node_modules/react-remove-scroll/sidecar/sidecar.d.ts create mode 100644 node_modules/react-style-singleton/LICENSE create mode 100644 node_modules/react-style-singleton/README.md create mode 100644 node_modules/react-style-singleton/dist/es2015/component.d.ts create mode 100644 node_modules/react-style-singleton/dist/es2015/component.js create mode 100644 node_modules/react-style-singleton/dist/es2015/hook.d.ts create mode 100644 node_modules/react-style-singleton/dist/es2015/hook.js create mode 100644 node_modules/react-style-singleton/dist/es2015/index.d.ts create mode 100644 node_modules/react-style-singleton/dist/es2015/index.js create mode 100644 node_modules/react-style-singleton/dist/es2015/singleton.d.ts create mode 100644 node_modules/react-style-singleton/dist/es2015/singleton.js create mode 100644 node_modules/react-style-singleton/dist/es2019/component.d.ts create mode 100644 node_modules/react-style-singleton/dist/es2019/component.js create mode 100644 node_modules/react-style-singleton/dist/es2019/hook.d.ts create mode 100644 node_modules/react-style-singleton/dist/es2019/hook.js create mode 100644 node_modules/react-style-singleton/dist/es2019/index.d.ts create mode 100644 node_modules/react-style-singleton/dist/es2019/index.js create mode 100644 node_modules/react-style-singleton/dist/es2019/singleton.d.ts create mode 100644 node_modules/react-style-singleton/dist/es2019/singleton.js create mode 100644 node_modules/react-style-singleton/dist/es5/component.d.ts create mode 100644 node_modules/react-style-singleton/dist/es5/component.js create mode 100644 node_modules/react-style-singleton/dist/es5/hook.d.ts create mode 100644 node_modules/react-style-singleton/dist/es5/hook.js create mode 100644 node_modules/react-style-singleton/dist/es5/index.d.ts create mode 100644 node_modules/react-style-singleton/dist/es5/index.js create mode 100644 node_modules/react-style-singleton/dist/es5/singleton.d.ts create mode 100644 node_modules/react-style-singleton/dist/es5/singleton.js create mode 100644 node_modules/react-style-singleton/dist/index.js create mode 100644 node_modules/react-style-singleton/package.json create mode 100644 node_modules/react/LICENSE create mode 100644 node_modules/react/README.md create mode 100644 node_modules/react/cjs/react-compiler-runtime.development.js create mode 100644 node_modules/react/cjs/react-compiler-runtime.production.js create mode 100644 node_modules/react/cjs/react-compiler-runtime.profiling.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.development.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.production.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.profiling.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.development.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.production.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.profiling.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.react-server.development.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.react-server.production.js create mode 100644 node_modules/react/cjs/react.development.js create mode 100644 node_modules/react/cjs/react.production.js create mode 100644 node_modules/react/cjs/react.react-server.development.js create mode 100644 node_modules/react/cjs/react.react-server.production.js create mode 100644 node_modules/react/compiler-runtime.js create mode 100644 node_modules/react/index.js create mode 100644 node_modules/react/jsx-dev-runtime.js create mode 100644 node_modules/react/jsx-dev-runtime.react-server.js create mode 100644 node_modules/react/jsx-runtime.js create mode 100644 node_modules/react/jsx-runtime.react-server.js create mode 100644 node_modules/react/package.json create mode 100644 node_modules/react/react.react-server.js create mode 100644 node_modules/scheduler/LICENSE create mode 100644 node_modules/scheduler/README.md create mode 100644 node_modules/scheduler/cjs/scheduler-unstable_mock.development.js create mode 100644 node_modules/scheduler/cjs/scheduler-unstable_mock.production.js create mode 100644 node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js create mode 100644 node_modules/scheduler/cjs/scheduler-unstable_post_task.production.js create mode 100644 node_modules/scheduler/cjs/scheduler.development.js create mode 100644 node_modules/scheduler/cjs/scheduler.native.development.js create mode 100644 node_modules/scheduler/cjs/scheduler.native.production.js create mode 100644 node_modules/scheduler/cjs/scheduler.production.js create mode 100644 node_modules/scheduler/index.js create mode 100644 node_modules/scheduler/index.native.js create mode 100644 node_modules/scheduler/package.json create mode 100644 node_modules/scheduler/unstable_mock.js create mode 100644 node_modules/scheduler/unstable_post_task.js create mode 100644 node_modules/tslib/CopyrightNotice.txt create mode 100644 node_modules/tslib/LICENSE.txt create mode 100644 node_modules/tslib/README.md create mode 100644 node_modules/tslib/SECURITY.md create mode 100644 node_modules/tslib/modules/index.d.ts create mode 100644 node_modules/tslib/modules/index.js create mode 100644 node_modules/tslib/modules/package.json create mode 100644 node_modules/tslib/package.json create mode 100644 node_modules/tslib/tslib.d.ts create mode 100644 node_modules/tslib/tslib.es6.html create mode 100644 node_modules/tslib/tslib.es6.js create mode 100644 node_modules/tslib/tslib.es6.mjs create mode 100644 node_modules/tslib/tslib.html create mode 100644 node_modules/tslib/tslib.js create mode 100644 node_modules/use-callback-ref/LICENSE create mode 100644 node_modules/use-callback-ref/README.md create mode 100644 node_modules/use-callback-ref/dist/es2015/assignRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2015/assignRef.js create mode 100644 node_modules/use-callback-ref/dist/es2015/createRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2015/createRef.js create mode 100644 node_modules/use-callback-ref/dist/es2015/index.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2015/index.js create mode 100644 node_modules/use-callback-ref/dist/es2015/mergeRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2015/mergeRef.js create mode 100644 node_modules/use-callback-ref/dist/es2015/refToCallback.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2015/refToCallback.js create mode 100644 node_modules/use-callback-ref/dist/es2015/transformRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2015/transformRef.js create mode 100644 node_modules/use-callback-ref/dist/es2015/types.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2015/types.js create mode 100644 node_modules/use-callback-ref/dist/es2015/useMergeRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2015/useMergeRef.js create mode 100644 node_modules/use-callback-ref/dist/es2015/useRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2015/useRef.js create mode 100644 node_modules/use-callback-ref/dist/es2015/useTransformRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2015/useTransformRef.js create mode 100644 node_modules/use-callback-ref/dist/es2019/assignRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2019/assignRef.js create mode 100644 node_modules/use-callback-ref/dist/es2019/createRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2019/createRef.js create mode 100644 node_modules/use-callback-ref/dist/es2019/index.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2019/index.js create mode 100644 node_modules/use-callback-ref/dist/es2019/mergeRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2019/mergeRef.js create mode 100644 node_modules/use-callback-ref/dist/es2019/refToCallback.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2019/refToCallback.js create mode 100644 node_modules/use-callback-ref/dist/es2019/transformRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2019/transformRef.js create mode 100644 node_modules/use-callback-ref/dist/es2019/types.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2019/types.js create mode 100644 node_modules/use-callback-ref/dist/es2019/useMergeRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2019/useMergeRef.js create mode 100644 node_modules/use-callback-ref/dist/es2019/useRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2019/useRef.js create mode 100644 node_modules/use-callback-ref/dist/es2019/useTransformRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es2019/useTransformRef.js create mode 100644 node_modules/use-callback-ref/dist/es5/assignRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es5/assignRef.js create mode 100644 node_modules/use-callback-ref/dist/es5/createRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es5/createRef.js create mode 100644 node_modules/use-callback-ref/dist/es5/index.d.ts create mode 100644 node_modules/use-callback-ref/dist/es5/index.js create mode 100644 node_modules/use-callback-ref/dist/es5/mergeRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es5/mergeRef.js create mode 100644 node_modules/use-callback-ref/dist/es5/refToCallback.d.ts create mode 100644 node_modules/use-callback-ref/dist/es5/refToCallback.js create mode 100644 node_modules/use-callback-ref/dist/es5/transformRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es5/transformRef.js create mode 100644 node_modules/use-callback-ref/dist/es5/types.d.ts create mode 100644 node_modules/use-callback-ref/dist/es5/types.js create mode 100644 node_modules/use-callback-ref/dist/es5/useMergeRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es5/useMergeRef.js create mode 100644 node_modules/use-callback-ref/dist/es5/useRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es5/useRef.js create mode 100644 node_modules/use-callback-ref/dist/es5/useTransformRef.d.ts create mode 100644 node_modules/use-callback-ref/dist/es5/useTransformRef.js create mode 100644 node_modules/use-callback-ref/package.json create mode 100644 node_modules/use-sidecar/LICENSE create mode 100644 node_modules/use-sidecar/README.md create mode 100644 node_modules/use-sidecar/dist/es2015/config.d.ts create mode 100644 node_modules/use-sidecar/dist/es2015/config.js create mode 100644 node_modules/use-sidecar/dist/es2015/env.d.ts create mode 100644 node_modules/use-sidecar/dist/es2015/env.js create mode 100644 node_modules/use-sidecar/dist/es2015/exports.d.ts create mode 100644 node_modules/use-sidecar/dist/es2015/exports.js create mode 100644 node_modules/use-sidecar/dist/es2015/hoc.d.ts create mode 100644 node_modules/use-sidecar/dist/es2015/hoc.js create mode 100644 node_modules/use-sidecar/dist/es2015/hook.d.ts create mode 100644 node_modules/use-sidecar/dist/es2015/hook.js create mode 100644 node_modules/use-sidecar/dist/es2015/index.d.ts create mode 100644 node_modules/use-sidecar/dist/es2015/index.js create mode 100644 node_modules/use-sidecar/dist/es2015/medium.d.ts create mode 100644 node_modules/use-sidecar/dist/es2015/medium.js create mode 100644 node_modules/use-sidecar/dist/es2015/renderProp.d.ts create mode 100644 node_modules/use-sidecar/dist/es2015/renderProp.js create mode 100644 node_modules/use-sidecar/dist/es2015/types.d.ts create mode 100644 node_modules/use-sidecar/dist/es2015/types.js create mode 100644 node_modules/use-sidecar/dist/es2019/config.d.ts create mode 100644 node_modules/use-sidecar/dist/es2019/config.js create mode 100644 node_modules/use-sidecar/dist/es2019/env.d.ts create mode 100644 node_modules/use-sidecar/dist/es2019/env.js create mode 100644 node_modules/use-sidecar/dist/es2019/exports.d.ts create mode 100644 node_modules/use-sidecar/dist/es2019/exports.js create mode 100644 node_modules/use-sidecar/dist/es2019/hoc.d.ts create mode 100644 node_modules/use-sidecar/dist/es2019/hoc.js create mode 100644 node_modules/use-sidecar/dist/es2019/hook.d.ts create mode 100644 node_modules/use-sidecar/dist/es2019/hook.js create mode 100644 node_modules/use-sidecar/dist/es2019/index.d.ts create mode 100644 node_modules/use-sidecar/dist/es2019/index.js create mode 100644 node_modules/use-sidecar/dist/es2019/medium.d.ts create mode 100644 node_modules/use-sidecar/dist/es2019/medium.js create mode 100644 node_modules/use-sidecar/dist/es2019/renderProp.d.ts create mode 100644 node_modules/use-sidecar/dist/es2019/renderProp.js create mode 100644 node_modules/use-sidecar/dist/es2019/types.d.ts create mode 100644 node_modules/use-sidecar/dist/es2019/types.js create mode 100644 node_modules/use-sidecar/dist/es5/config.d.ts create mode 100644 node_modules/use-sidecar/dist/es5/config.js create mode 100644 node_modules/use-sidecar/dist/es5/env.d.ts create mode 100644 node_modules/use-sidecar/dist/es5/env.js create mode 100644 node_modules/use-sidecar/dist/es5/exports.d.ts create mode 100644 node_modules/use-sidecar/dist/es5/exports.js create mode 100644 node_modules/use-sidecar/dist/es5/hoc.d.ts create mode 100644 node_modules/use-sidecar/dist/es5/hoc.js create mode 100644 node_modules/use-sidecar/dist/es5/hook.d.ts create mode 100644 node_modules/use-sidecar/dist/es5/hook.js create mode 100644 node_modules/use-sidecar/dist/es5/index.d.ts create mode 100644 node_modules/use-sidecar/dist/es5/index.js create mode 100644 node_modules/use-sidecar/dist/es5/medium.d.ts create mode 100644 node_modules/use-sidecar/dist/es5/medium.js create mode 100644 node_modules/use-sidecar/dist/es5/renderProp.d.ts create mode 100644 node_modules/use-sidecar/dist/es5/renderProp.js create mode 100644 node_modules/use-sidecar/dist/es5/types.d.ts create mode 100644 node_modules/use-sidecar/dist/es5/types.js create mode 100644 node_modules/use-sidecar/package.json create mode 100644 package-lock.json create mode 100644 package.json diff --git a/frontend/bitmatch/src/App.jsx b/frontend/bitmatch/src/App.jsx index ce46024..b38fe75 100644 --- a/frontend/bitmatch/src/App.jsx +++ b/frontend/bitmatch/src/App.jsx @@ -11,6 +11,7 @@ import { Button } from "./components/ui/button"; import HomePage from "./views/HomePage"; import ProjectListPage from "./views/ProjectListPage"; import ProjectDetailPage from "./views/IndividualProjectPage"; +import AddProjectPage from "./views/AddProjectPage"; import "./styles/global.css"; export default function App() { @@ -99,6 +100,7 @@ export default function App() { } /> } /> } /> + } /> diff --git a/frontend/bitmatch/src/components/project/DiscussionCard.jsx b/frontend/bitmatch/src/components/project/DiscussionCard.jsx new file mode 100644 index 0000000..a3e2bd4 --- /dev/null +++ b/frontend/bitmatch/src/components/project/DiscussionCard.jsx @@ -0,0 +1,125 @@ +"use client"; + +import { useState } from "react"; +import { Button } from "@/components/ui/button"; + +export function ReplyForm({ postId, onCancel, onSubmit }) { + const [content, setContent] = useState(""); + + const handleSubmit = () => { + if (content.trim()) { + onSubmit(postId, content); + setContent(""); + } + }; + + return ( +
+
+ +
+ Max Characters: 133 + Current Character Count: {shortDescription.length} +
+
+ + {/* Full Description */} +
+ + +
+ Max Characters: 540 + Current Character Count: {fullDescription.length} +
+
+ + {/* Roles Section */} +
+

What roles or positions do you need to fill...

+ +
+
+ + + ); +} \ No newline at end of file diff --git a/frontend/bitmatch/src/views/IndividualProjectPage.jsx b/frontend/bitmatch/src/views/IndividualProjectPage.jsx index 9648537..ecf9d7c 100644 --- a/frontend/bitmatch/src/views/IndividualProjectPage.jsx +++ b/frontend/bitmatch/src/views/IndividualProjectPage.jsx @@ -1,19 +1,23 @@ -import { ChevronRight, ChevronLeft, Plus, Edit, Icon } from "lucide-react"; +import { ChevronRight, ChevronLeft, Plus, Edit, Icon, ThumbsUp, UserRound } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; +import { MemberCard } from "@/components/project/MemberCard"; +import { PositionCard } from "@/components/project/PositionCard"; +import { Dialog, DialogTitle, DialogDescription, DialogFooter, DialogContent, DialogHeader } from "@/components/ui/Dialog"; import React, { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import { Tab, Tabs, TabList, TabPanel } from "react-tabs"; -import Modal from "@/components/project/Modal"; +import { DiscussionPost, ReplyForm } from "@/components/project/DiscussionCard"; const SERVER_HOST = import.meta.env.VITE_SERVER_HOST; import axios from "axios"; + const formatNumber = (num) => { return num >= 1000000 ? `${(num / 1000000).toFixed(1)}M`.replace(".0M", "M") : num >= 1000 - ? `${(num / 1000).toFixed(1)}K`.replace(".0K", "K") - : num.toString(); + ? `${(num / 1000).toFixed(1)}K`.replace(".0K", "K") + : num.toString(); }; const fetchProjectInfo = async (id) => { @@ -34,14 +38,23 @@ const fetchProjectInfo = async (id) => { } }; +const editProjectInfo = async (id) => { + +} + const ProjectDetailPage = () => { const { id } = useParams(); // Access the dynamic `id` parameter from the URL const [project, setProject] = useState(null); // State to store project details const [loading, setLoading] = useState(true); // State to handle loading state const [error, setError] = useState(null); // State to handle errors const [currentImageIndex, setCurrentImageIndex] = useState(0); - const [isModalOpen, setIsModalOpen] = useState(false); + const [isOpen, setIsOpen] = useState(false); const [activeTab, setActiveTab] = useState("overview"); + const [discussions, setDiscussions] = useState([]); + const [showCommentForm, setShowCommentForm] = useState(false); + const [replyingTo, setReplyingTo] = useState(null); + + useEffect(() => { // Fetch project details when the component mounts or the `id` changes @@ -84,6 +97,95 @@ const ProjectDetailPage = () => { setCurrentImageIndex(index); }; + const handleAddComment = () => { + setShowCommentForm(true) + setReplyingTo(null) + } + + const handleCancelComment = () => { + setShowCommentForm(false) + setReplyingTo(null) + } + + const handleSubmitComment = (postId, content) => { + if (postId) { + // Add reply to existing post + const updatedDiscussions = discussions.map((discussion) => { + if (discussion.id === postId) { + return { + ...discussion, + replies: [ + ...(discussion.replies || []), + { + id: Date.now().toString(), + parentId: postId, + author: { + name: "Current User", + title: "Project Member", + profileImage: "", + }, + content, + datePosted: new Date().toLocaleString(), + }, + ], + } + } + return discussion + }) + setDiscussions(updatedDiscussions) + } else { + // Add new post + const newPost = { + id: Date.now().toString(), + author: { + name: "Current User", + title: "Project Member", + profileImage: "", + }, + content, + datePosted: new Date().toLocaleString(), + replies: [], + } + setDiscussions([...discussions, newPost]) + } + setShowCommentForm(false) + setReplyingTo(null) + } + + const handleReplyToPost = (id) => { + setReplyingTo(id) + } + + const handleDeletePost = (id) => { + // In a real app, this would show a confirmation dialog + if (confirm(`Delete post with ID ${id}?`)) { + // Check if it's a main post or a reply + const isMainPost = discussions.some((discussion) => discussion.id === id) + + if (isMainPost) { + // Delete the main post and all its replies + const updatedDiscussions = discussions.filter((discussion) => discussion.id !== id) + setDiscussions(updatedDiscussions) + } else { + // Delete a reply + const updatedDiscussions = discussions.map((discussion) => { + if (discussion.replies && discussion.replies.some((reply) => reply.id === id)) { + return { + ...discussion, + replies: discussion.replies.filter((reply) => reply.id !== id), + } + } + return discussion + }) + setDiscussions(updatedDiscussions) + } + } + } + + const handleReaction = (id) => { + alert(`Add reaction to post with ID ${id}`) + } + // Loading state if (loading) { return ( @@ -119,19 +221,20 @@ const ProjectDetailPage = () => { onClick={() => window.history.back()} > - Back + Back to Projects {/* Main content */}
-

{project.title}

+

{project.title}

{/* Project showcase */} -
+
+ {/* Image Slider */} -
+
{project.images && project.images.length > 0 ? ( <>
@@ -142,7 +245,7 @@ const ProjectDetailPage = () => { alt="Project image" className="object-cover" /> -
+
-

- Slider -
- Image snapshots are below -

) : ( @@ -175,7 +273,7 @@ const ProjectDetailPage = () => {
{/* Project info */}
-
+
{project.image_url ? ( { Cover Image goes here )}
-
+
From

{project.group}

{project.description}

-
+ {project.likes} Likes
-
+ {project.followers} Followers
@@ -206,22 +308,21 @@ const ProjectDetailPage = () => {
{/* Thumbnails */} -
+
{project.images && project.images.map((image, index) => (
selectImage(index)} > {`Pic
@@ -231,154 +332,421 @@ const ProjectDetailPage = () => { {/* Tabs */} { + const tabNames = ["overview", "updates", "members", "wanted", "discussions", "contact", "edit"]; + const selectedTab = tabNames[index]; + + if (selectedTab === "edit") { + setIsOpen(true); // Open the dialog + setActiveTab("overview"); // Stay on the default tab (e.g., Overview) + } else { + setActiveTab(selectedTab); // Change tab normally + } + }} > - + Overview Updates Members Wanted Discussions Contact + { + e.preventDefault(); // Prevent tab selection + if (!isOpen) setIsOpen(true); // Open the dialog + }} + > + Edit Project + + + + Edit Project + + Make changes to your Project here. + + +
+

Title

+ +

Group

+ +

Description

+ +
+ + + +
+
+
-

Overview

+

Overview

-

+

Background & More Details About the Project -

+
-
- This space will be filled in by the owner -
-

{project.description}

- - setIsModalOpen(false)} - > -

Edit Project

-
-

Title

- -

Description

- -
- -
+

{project.description}

-
-

- Updates content will go here -

+
+
+

+ Updates +

+
+

Title

+ + {showCommentForm ? ( + + ) : ( +
+
+
+

Add your comments here

+
+
+
+ + +
+
+ )} +
+
+ -
-

- Members content will go here -

+
+ {/* Search and Add Member Section */} +
+
+ + +
+
+ + {/* Members List Section */} +
+

Students Working on This Project

+ +
+ {/* Member 1 */} + + {/* Member 2 */} + + {/* Member 3 */} + +
+
-
-

- Wanted content will go here -

+
+ {/* Wanted Header */} +

Wanted

+ {/* Positions Section */} +
+
+

Positions Needed for This Project

+ +
+ +
+ + +
+
- -
-

- Discussions content will go here -

+ +
+ {/* Discussions Header */} +
+
+ Discussions +
+
+ + {/* Comment Form */} +
+ {showCommentForm ? ( + + ) : ( +
+
+
+

Add your comments here

+
+
+
+ + +
+
+ )} + + {/* Discussion Posts */} +
+ {discussions.length > 0 ? ( + discussions.map((discussion) => ( +
+ + + {replyingTo === discussion.id && ( +
+ +
+ )} + + {discussion.replies && + discussion.replies.map((reply) => ( +
+ + + {replyingTo === reply.id && ( +
+ +
+ )} +
+ ))} +
+ )) + ) : ( +

No discussions yet. Start the conversation!

+ )} +
+
-
-

- Contact content will go here -

+
+
+

Contact The Owner of This Project

+

Full Name

+ +

Email Address

+ +

Subject

+ +

Description

+ + +
+ +
{/* Footer */}
-

Footer

+

{/* Action Buttons */} - + ); }; diff --git a/frontend/bitmatch/src/views/ProjectListPage.jsx b/frontend/bitmatch/src/views/ProjectListPage.jsx index da0099f..7e553c2 100644 --- a/frontend/bitmatch/src/views/ProjectListPage.jsx +++ b/frontend/bitmatch/src/views/ProjectListPage.jsx @@ -1,6 +1,7 @@ import { useEffect, useState } from "react"; import { ChevronRight, Plus } from "lucide-react"; import { Button } from "@/components/ui/button"; +import { Link } from "react-router-dom"; import ProjectCardLarge from "@/components/project/ProjectCardLarge"; const SERVER_HOST = import.meta.env.VITE_SERVER_HOST; import axios from "axios"; @@ -51,10 +52,13 @@ export default function ProjectListPage() {

Public Projects List

- + + +
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..341aa96 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,494 @@ +{ + "name": "BitMatch", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@radix-ui/primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.1.tgz", + "integrity": "sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA==", + "license": "MIT" + }, + "node_modules/@radix-ui/react-compose-refs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", + "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-context": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.1.tgz", + "integrity": "sha512-UASk9zi+crv9WteK/NU4PLvOoL3OuE6BWVKNF6hPRBtYBDXQ2u5iu3O59zUlJiTVvkyuycnqrztsHVJwcK9K+Q==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dialog": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.6.tgz", + "integrity": "sha512-/IVhJV5AceX620DUJ4uYVMymzsipdKBzo3edo+omeskCKGm9FRHM0ebIdbPnlQVJqyuHbuBltQUOG2mOTq2IYw==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.1", + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-dismissable-layer": "1.1.5", + "@radix-ui/react-focus-guards": "1.1.1", + "@radix-ui/react-focus-scope": "1.1.2", + "@radix-ui/react-id": "1.1.0", + "@radix-ui/react-portal": "1.1.4", + "@radix-ui/react-presence": "1.1.2", + "@radix-ui/react-primitive": "2.0.2", + "@radix-ui/react-slot": "1.1.2", + "@radix-ui/react-use-controllable-state": "1.1.0", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.6.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.5.tgz", + "integrity": "sha512-E4TywXY6UsXNRhFrECa5HAvE5/4BFcGyfTyK36gP+pAW1ed7UTK4vKwdr53gAJYwqbfCWC6ATvJa3J3R/9+Qrg==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.1", + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-primitive": "2.0.2", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-escape-keydown": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-focus-guards": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.1.tgz", + "integrity": "sha512-pSIwfrT1a6sIoDASCSpFwOasEwKTZWDw/iBdtnqKO7v6FeOzYJ7U53cPzYFVR3geGGXgVHaH+CdngrrAzqUGxg==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-focus-scope": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.2.tgz", + "integrity": "sha512-zxwE80FCU7lcXUGWkdt6XpTTCKPitG1XKOwViTxHVKIJhZl9MvIl2dVHeZENCWD9+EdWv05wlaEkRXUykU27RA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-primitive": "2.0.2", + "@radix-ui/react-use-callback-ref": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-id": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.0.tgz", + "integrity": "sha512-EJUrI8yYh7WOjNOqpoJaf1jlFIH2LvtgAl+YcFqNCa+4hj64ZXmPkAKOFs/ukjz3byN6bdb/AVUqHkI8/uWWMA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-portal": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.4.tgz", + "integrity": "sha512-sn2O9k1rPFYVyKd5LAJfo96JlSGVFpa1fS6UuBJfrZadudiw5tAmru+n1x7aMRQ84qDM71Zh1+SzK5QwU0tJfA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.0.2", + "@radix-ui/react-use-layout-effect": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-presence": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.2.tgz", + "integrity": "sha512-18TFr80t5EVgL9x1SwF/YGtfG+l0BS0PRAlCWBDoBEiDQjeKgnNZRVJp/oVBl24sr3Gbfwc/Qpj4OcWTQMsAEg==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-use-layout-effect": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-primitive": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.2.tgz", + "integrity": "sha512-Ec/0d38EIuvDF+GZjcMU/Ze6MxntVJYO/fRlCPhCaVUyPY9WTalHJw54tp9sXeJo3tlShWpy41vQRgLRGOuz+w==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-slot": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-slot": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.2.tgz", + "integrity": "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-callback-ref": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.0.tgz", + "integrity": "sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-controllable-state": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.1.0.tgz", + "integrity": "sha512-MtfMVJiSr2NjzS0Aa90NPTnvTSg6C/JLCV7ma0W6+OMV78vd8OyRpID+Ng9LxzsPbLeuBnWBA1Nq30AtBIDChw==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-callback-ref": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-escape-keydown": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.0.tgz", + "integrity": "sha512-L7vwWlR1kTTQ3oh7g1O0CBF3YCyyTj8NmhLR+phShpyA50HCfBFKVJTpshm9PzLiKmehsrQzTYTpX9HvmC9rhw==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-callback-ref": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-layout-effect": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.0.tgz", + "integrity": "sha512-+FPE0rOdziWSrH9athwI1R0HDVbWlEhd+FR+aSDk4uWGmSJ9Z54sdZVDQPZAinJhJXwfT+qnj969mCsT2gfm5w==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/aria-hidden": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.4.tgz", + "integrity": "sha512-y+CcFFwelSXpLZk/7fMB2mUbGtX9lKycf1MWJ7CaTIERyitVlyQx6C+sxcROU2BAJ24OiZyK+8wj2i8AlBoS3A==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/detect-node-es": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", + "license": "MIT" + }, + "node_modules/get-nonce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", + "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/react": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz", + "integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.0.0.tgz", + "integrity": "sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "scheduler": "^0.25.0" + }, + "peerDependencies": { + "react": "^19.0.0" + } + }, + "node_modules/react-remove-scroll": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.6.3.tgz", + "integrity": "sha512-pnAi91oOk8g8ABQKGF5/M9qxmmOPxaAnopyTHYfqYEwJhyFrbbBtHuSgtKEoH0jpcxx5o3hXqH1mNd9/Oi+8iQ==", + "license": "MIT", + "dependencies": { + "react-remove-scroll-bar": "^2.3.7", + "react-style-singleton": "^2.2.3", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.3", + "use-sidecar": "^1.1.3" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-remove-scroll-bar": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz", + "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==", + "license": "MIT", + "dependencies": { + "react-style-singleton": "^2.2.2", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-style-singleton": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz", + "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==", + "license": "MIT", + "dependencies": { + "get-nonce": "^1.0.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/scheduler": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.25.0.tgz", + "integrity": "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==", + "license": "MIT", + "peer": true + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/use-callback-ref": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", + "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-sidecar": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", + "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", + "license": "MIT", + "dependencies": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + } + } +} diff --git a/node_modules/@radix-ui/primitive/README.md b/node_modules/@radix-ui/primitive/README.md new file mode 100644 index 0000000..29f34e9 --- /dev/null +++ b/node_modules/@radix-ui/primitive/README.md @@ -0,0 +1,13 @@ +# `primitive` + +## Installation + +```sh +$ yarn add @radix-ui/primitive +# or +$ npm install @radix-ui/primitive +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/primitive/dist/index.d.mts b/node_modules/@radix-ui/primitive/dist/index.d.mts new file mode 100644 index 0000000..ec065f5 --- /dev/null +++ b/node_modules/@radix-ui/primitive/dist/index.d.mts @@ -0,0 +1,5 @@ +declare function composeEventHandlers(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: { + checkForDefaultPrevented?: boolean | undefined; +}): (event: E) => void; + +export { composeEventHandlers }; diff --git a/node_modules/@radix-ui/primitive/dist/index.d.ts b/node_modules/@radix-ui/primitive/dist/index.d.ts new file mode 100644 index 0000000..ec065f5 --- /dev/null +++ b/node_modules/@radix-ui/primitive/dist/index.d.ts @@ -0,0 +1,5 @@ +declare function composeEventHandlers(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: { + checkForDefaultPrevented?: boolean | undefined; +}): (event: E) => void; + +export { composeEventHandlers }; diff --git a/node_modules/@radix-ui/primitive/dist/index.js b/node_modules/@radix-ui/primitive/dist/index.js new file mode 100644 index 0000000..7612b53 --- /dev/null +++ b/node_modules/@radix-ui/primitive/dist/index.js @@ -0,0 +1,36 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/core/primitive/src/index.ts +var src_exports = {}; +__export(src_exports, { + composeEventHandlers: () => composeEventHandlers +}); +module.exports = __toCommonJS(src_exports); + +// packages/core/primitive/src/primitive.tsx +function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { + return function handleEvent(event) { + originalEventHandler?.(event); + if (checkForDefaultPrevented === false || !event.defaultPrevented) { + return ourEventHandler?.(event); + } + }; +} +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/primitive/dist/index.js.map b/node_modules/@radix-ui/primitive/dist/index.js.map new file mode 100644 index 0000000..ca8ab12 --- /dev/null +++ b/node_modules/@radix-ui/primitive/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/primitive.tsx"], + "sourcesContent": ["export { composeEventHandlers } from './primitive';\n", "function composeEventHandlers(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !(event as unknown as Event).defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport { composeEventHandlers };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,SAAS,qBACP,sBACA,iBACA,EAAE,2BAA2B,KAAK,IAAI,CAAC,GACvC;AACA,SAAO,SAAS,YAAY,OAAU;AACpC,2BAAuB,KAAK;AAE5B,QAAI,6BAA6B,SAAS,CAAE,MAA2B,kBAAkB;AACvF,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;", + "names": [] +} diff --git a/node_modules/@radix-ui/primitive/dist/index.mjs b/node_modules/@radix-ui/primitive/dist/index.mjs new file mode 100644 index 0000000..0bc0d71 --- /dev/null +++ b/node_modules/@radix-ui/primitive/dist/index.mjs @@ -0,0 +1,13 @@ +// packages/core/primitive/src/primitive.tsx +function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { + return function handleEvent(event) { + originalEventHandler?.(event); + if (checkForDefaultPrevented === false || !event.defaultPrevented) { + return ourEventHandler?.(event); + } + }; +} +export { + composeEventHandlers +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/primitive/dist/index.mjs.map b/node_modules/@radix-ui/primitive/dist/index.mjs.map new file mode 100644 index 0000000..a6eb4d1 --- /dev/null +++ b/node_modules/@radix-ui/primitive/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/primitive.tsx"], + "sourcesContent": ["function composeEventHandlers(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !(event as unknown as Event).defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport { composeEventHandlers };\n"], + "mappings": ";AAAA,SAAS,qBACP,sBACA,iBACA,EAAE,2BAA2B,KAAK,IAAI,CAAC,GACvC;AACA,SAAO,SAAS,YAAY,OAAU;AACpC,2BAAuB,KAAK;AAE5B,QAAI,6BAA6B,SAAS,CAAE,MAA2B,kBAAkB;AACvF,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;", + "names": [] +} diff --git a/node_modules/@radix-ui/primitive/package.json b/node_modules/@radix-ui/primitive/package.json new file mode 100644 index 0000000..be303bc --- /dev/null +++ b/node_modules/@radix-ui/primitive/package.json @@ -0,0 +1,38 @@ +{ + "name": "@radix-ui/primitive", + "version": "1.1.1", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf dist", + "version": "yarn version" + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-compose-refs/README.md b/node_modules/@radix-ui/react-compose-refs/README.md new file mode 100644 index 0000000..d8a6136 --- /dev/null +++ b/node_modules/@radix-ui/react-compose-refs/README.md @@ -0,0 +1,13 @@ +# `react-compose-refs` + +## Installation + +```sh +$ yarn add @radix-ui/react-compose-refs +# or +$ npm install @radix-ui/react-compose-refs +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-compose-refs/dist/index.d.mts b/node_modules/@radix-ui/react-compose-refs/dist/index.d.mts new file mode 100644 index 0000000..c7a149c --- /dev/null +++ b/node_modules/@radix-ui/react-compose-refs/dist/index.d.mts @@ -0,0 +1,15 @@ +import * as React from 'react'; + +type PossibleRef = React.Ref | undefined; +/** + * A utility to compose multiple refs together + * Accepts callback refs and RefObject(s) + */ +declare function composeRefs(...refs: PossibleRef[]): React.RefCallback; +/** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ +declare function useComposedRefs(...refs: PossibleRef[]): React.RefCallback; + +export { composeRefs, useComposedRefs }; diff --git a/node_modules/@radix-ui/react-compose-refs/dist/index.d.ts b/node_modules/@radix-ui/react-compose-refs/dist/index.d.ts new file mode 100644 index 0000000..c7a149c --- /dev/null +++ b/node_modules/@radix-ui/react-compose-refs/dist/index.d.ts @@ -0,0 +1,15 @@ +import * as React from 'react'; + +type PossibleRef = React.Ref | undefined; +/** + * A utility to compose multiple refs together + * Accepts callback refs and RefObject(s) + */ +declare function composeRefs(...refs: PossibleRef[]): React.RefCallback; +/** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ +declare function useComposedRefs(...refs: PossibleRef[]): React.RefCallback; + +export { composeRefs, useComposedRefs }; diff --git a/node_modules/@radix-ui/react-compose-refs/dist/index.js b/node_modules/@radix-ui/react-compose-refs/dist/index.js new file mode 100644 index 0000000..8e97b29 --- /dev/null +++ b/node_modules/@radix-ui/react-compose-refs/dist/index.js @@ -0,0 +1,74 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/compose-refs/src/index.ts +var src_exports = {}; +__export(src_exports, { + composeRefs: () => composeRefs, + useComposedRefs: () => useComposedRefs +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/compose-refs/src/composeRefs.tsx +var React = __toESM(require("react")); +function setRef(ref, value) { + if (typeof ref === "function") { + return ref(value); + } else if (ref !== null && ref !== void 0) { + ref.current = value; + } +} +function composeRefs(...refs) { + return (node) => { + let hasCleanup = false; + const cleanups = refs.map((ref) => { + const cleanup = setRef(ref, node); + if (!hasCleanup && typeof cleanup == "function") { + hasCleanup = true; + } + return cleanup; + }); + if (hasCleanup) { + return () => { + for (let i = 0; i < cleanups.length; i++) { + const cleanup = cleanups[i]; + if (typeof cleanup == "function") { + cleanup(); + } else { + setRef(refs[i], null); + } + } + }; + } + }; +} +function useComposedRefs(...refs) { + return React.useCallback(composeRefs(...refs), refs); +} +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-compose-refs/dist/index.js.map b/node_modules/@radix-ui/react-compose-refs/dist/index.js.map new file mode 100644 index 0000000..5ba25c4 --- /dev/null +++ b/node_modules/@radix-ui/react-compose-refs/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/composeRefs.tsx"], + "sourcesContent": ["export { composeRefs, useComposedRefs } from './composeRefs';\n", "import * as React from 'react';\n\ntype PossibleRef = React.Ref | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref: PossibleRef, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs: PossibleRef[]): React.RefCallback {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == 'function') {\n hasCleanup = true;\n }\n return cleanup;\n });\n\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs: PossibleRef[]): React.RefCallback {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAQvB,SAAS,OAAU,KAAqB,OAAU;AAChD,MAAI,OAAO,QAAQ,YAAY;AAC7B,WAAO,IAAI,KAAK;AAAA,EAClB,WAAW,QAAQ,QAAQ,QAAQ,QAAW;AAC5C,QAAI,UAAU;AAAA,EAChB;AACF;AAMA,SAAS,eAAkB,MAA8C;AACvE,SAAO,CAAC,SAAS;AACf,QAAI,aAAa;AACjB,UAAM,WAAW,KAAK,IAAI,CAAC,QAAQ;AACjC,YAAM,UAAU,OAAO,KAAK,IAAI;AAChC,UAAI,CAAC,cAAc,OAAO,WAAW,YAAY;AAC/C,qBAAa;AAAA,MACf;AACA,aAAO;AAAA,IACT,CAAC;AAMD,QAAI,YAAY;AACd,aAAO,MAAM;AACX,iBAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,gBAAM,UAAU,SAAS,CAAC;AAC1B,cAAI,OAAO,WAAW,YAAY;AAChC,oBAAQ;AAAA,UACV,OAAO;AACL,mBAAO,KAAK,CAAC,GAAG,IAAI;AAAA,UACtB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMA,SAAS,mBAAsB,MAA8C;AAE3E,SAAa,kBAAY,YAAY,GAAG,IAAI,GAAG,IAAI;AACrD;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-compose-refs/dist/index.mjs b/node_modules/@radix-ui/react-compose-refs/dist/index.mjs new file mode 100644 index 0000000..46b15c2 --- /dev/null +++ b/node_modules/@radix-ui/react-compose-refs/dist/index.mjs @@ -0,0 +1,41 @@ +// packages/react/compose-refs/src/composeRefs.tsx +import * as React from "react"; +function setRef(ref, value) { + if (typeof ref === "function") { + return ref(value); + } else if (ref !== null && ref !== void 0) { + ref.current = value; + } +} +function composeRefs(...refs) { + return (node) => { + let hasCleanup = false; + const cleanups = refs.map((ref) => { + const cleanup = setRef(ref, node); + if (!hasCleanup && typeof cleanup == "function") { + hasCleanup = true; + } + return cleanup; + }); + if (hasCleanup) { + return () => { + for (let i = 0; i < cleanups.length; i++) { + const cleanup = cleanups[i]; + if (typeof cleanup == "function") { + cleanup(); + } else { + setRef(refs[i], null); + } + } + }; + } + }; +} +function useComposedRefs(...refs) { + return React.useCallback(composeRefs(...refs), refs); +} +export { + composeRefs, + useComposedRefs +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.map b/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.map new file mode 100644 index 0000000..042a89a --- /dev/null +++ b/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/composeRefs.tsx"], + "sourcesContent": ["import * as React from 'react';\n\ntype PossibleRef = React.Ref | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref: PossibleRef, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs: PossibleRef[]): React.RefCallback {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == 'function') {\n hasCleanup = true;\n }\n return cleanup;\n });\n\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs: PossibleRef[]): React.RefCallback {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n"], + "mappings": ";AAAA,YAAY,WAAW;AAQvB,SAAS,OAAU,KAAqB,OAAU;AAChD,MAAI,OAAO,QAAQ,YAAY;AAC7B,WAAO,IAAI,KAAK;AAAA,EAClB,WAAW,QAAQ,QAAQ,QAAQ,QAAW;AAC5C,QAAI,UAAU;AAAA,EAChB;AACF;AAMA,SAAS,eAAkB,MAA8C;AACvE,SAAO,CAAC,SAAS;AACf,QAAI,aAAa;AACjB,UAAM,WAAW,KAAK,IAAI,CAAC,QAAQ;AACjC,YAAM,UAAU,OAAO,KAAK,IAAI;AAChC,UAAI,CAAC,cAAc,OAAO,WAAW,YAAY;AAC/C,qBAAa;AAAA,MACf;AACA,aAAO;AAAA,IACT,CAAC;AAMD,QAAI,YAAY;AACd,aAAO,MAAM;AACX,iBAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,gBAAM,UAAU,SAAS,CAAC;AAC1B,cAAI,OAAO,WAAW,YAAY;AAChC,oBAAQ;AAAA,UACV,OAAO;AACL,mBAAO,KAAK,CAAC,GAAG,IAAI;AAAA,UACtB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMA,SAAS,mBAAsB,MAA8C;AAE3E,SAAa,kBAAY,YAAY,GAAG,IAAI,GAAG,IAAI;AACrD;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-compose-refs/package.json b/node_modules/@radix-ui/react-compose-refs/package.json new file mode 100644 index 0000000..3cabaa5 --- /dev/null +++ b/node_modules/@radix-ui/react-compose-refs/package.json @@ -0,0 +1,47 @@ +{ + "name": "@radix-ui/react-compose-refs", + "version": "1.1.1", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf dist", + "version": "yarn version" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-context/README.md b/node_modules/@radix-ui/react-context/README.md new file mode 100644 index 0000000..3302343 --- /dev/null +++ b/node_modules/@radix-ui/react-context/README.md @@ -0,0 +1,13 @@ +# `react-context` + +## Installation + +```sh +$ yarn add @radix-ui/react-context +# or +$ npm install @radix-ui/react-context +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-context/dist/index.d.mts b/node_modules/@radix-ui/react-context/dist/index.d.mts new file mode 100644 index 0000000..37332eb --- /dev/null +++ b/node_modules/@radix-ui/react-context/dist/index.d.mts @@ -0,0 +1,21 @@ +import * as React from 'react'; + +declare function createContext(rootComponentName: string, defaultContext?: ContextValueType): readonly [React.FC, (consumerName: string) => ContextValueType]; +type Scope = { + [scopeName: string]: React.Context[]; +} | undefined; +type ScopeHook = (scope: Scope) => { + [__scopeProp: string]: Scope; +}; +interface CreateScope { + scopeName: string; + (): ScopeHook; +} +declare function createContextScope(scopeName: string, createContextScopeDeps?: CreateScope[]): readonly [(rootComponentName: string, defaultContext?: ContextValueType | undefined) => readonly [React.FC; + children: React.ReactNode; +}>, (consumerName: string, scope: Scope) => ContextValueType], CreateScope]; + +export { type CreateScope, type Scope, createContext, createContextScope }; diff --git a/node_modules/@radix-ui/react-context/dist/index.d.ts b/node_modules/@radix-ui/react-context/dist/index.d.ts new file mode 100644 index 0000000..37332eb --- /dev/null +++ b/node_modules/@radix-ui/react-context/dist/index.d.ts @@ -0,0 +1,21 @@ +import * as React from 'react'; + +declare function createContext(rootComponentName: string, defaultContext?: ContextValueType): readonly [React.FC, (consumerName: string) => ContextValueType]; +type Scope = { + [scopeName: string]: React.Context[]; +} | undefined; +type ScopeHook = (scope: Scope) => { + [__scopeProp: string]: Scope; +}; +interface CreateScope { + scopeName: string; + (): ScopeHook; +} +declare function createContextScope(scopeName: string, createContextScopeDeps?: CreateScope[]): readonly [(rootComponentName: string, defaultContext?: ContextValueType | undefined) => readonly [React.FC; + children: React.ReactNode; +}>, (consumerName: string, scope: Scope) => ContextValueType], CreateScope]; + +export { type CreateScope, type Scope, createContext, createContextScope }; diff --git a/node_modules/@radix-ui/react-context/dist/index.js b/node_modules/@radix-ui/react-context/dist/index.js new file mode 100644 index 0000000..5caf72b --- /dev/null +++ b/node_modules/@radix-ui/react-context/dist/index.js @@ -0,0 +1,114 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/context/src/index.ts +var src_exports = {}; +__export(src_exports, { + createContext: () => createContext2, + createContextScope: () => createContextScope +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/context/src/createContext.tsx +var React = __toESM(require("react")); +var import_jsx_runtime = require("react/jsx-runtime"); +function createContext2(rootComponentName, defaultContext) { + const Context = React.createContext(defaultContext); + const Provider = (props) => { + const { children, ...context } = props; + const value = React.useMemo(() => context, Object.values(context)); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children }); + }; + Provider.displayName = rootComponentName + "Provider"; + function useContext2(consumerName) { + const context = React.useContext(Context); + if (context) return context; + if (defaultContext !== void 0) return defaultContext; + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + return [Provider, useContext2]; +} +function createContextScope(scopeName, createContextScopeDeps = []) { + let defaultContexts = []; + function createContext3(rootComponentName, defaultContext) { + const BaseContext = React.createContext(defaultContext); + const index = defaultContexts.length; + defaultContexts = [...defaultContexts, defaultContext]; + const Provider = (props) => { + const { scope, children, ...context } = props; + const Context = scope?.[scopeName]?.[index] || BaseContext; + const value = React.useMemo(() => context, Object.values(context)); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children }); + }; + Provider.displayName = rootComponentName + "Provider"; + function useContext2(consumerName, scope) { + const Context = scope?.[scopeName]?.[index] || BaseContext; + const context = React.useContext(Context); + if (context) return context; + if (defaultContext !== void 0) return defaultContext; + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + return [Provider, useContext2]; + } + const createScope = () => { + const scopeContexts = defaultContexts.map((defaultContext) => { + return React.createContext(defaultContext); + }); + return function useScope(scope) { + const contexts = scope?.[scopeName] || scopeContexts; + return React.useMemo( + () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), + [scope, contexts] + ); + }; + }; + createScope.scopeName = scopeName; + return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)]; +} +function composeContextScopes(...scopes) { + const baseScope = scopes[0]; + if (scopes.length === 1) return baseScope; + const createScope = () => { + const scopeHooks = scopes.map((createScope2) => ({ + useScope: createScope2(), + scopeName: createScope2.scopeName + })); + return function useComposedScopes(overrideScopes) { + const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => { + const scopeProps = useScope(overrideScopes); + const currentScope = scopeProps[`__scope${scopeName}`]; + return { ...nextScopes2, ...currentScope }; + }, {}); + return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]); + }; + }; + createScope.scopeName = baseScope.scopeName; + return createScope; +} +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-context/dist/index.js.map b/node_modules/@radix-ui/react-context/dist/index.js.map new file mode 100644 index 0000000..22b2e4a --- /dev/null +++ b/node_modules/@radix-ui/react-context/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/createContext.tsx"], + "sourcesContent": ["export { createContext, createContextScope } from './createContext';\nexport type { CreateScope, Scope } from './createContext';\n", "import * as React from 'react';\n\nfunction createContext(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = React.createContext(defaultContext);\n\n const Provider: React.FC = (props) => {\n const { children, ...context } = props;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return {children};\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/\n\ntype Scope = { [scopeName: string]: React.Context[] } | undefined;\ntype ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope };\ninterface CreateScope {\n scopeName: string;\n (): ScopeHook;\n}\n\nfunction createContextScope(scopeName: string, createContextScopeDeps: CreateScope[] = []) {\n let defaultContexts: any[] = [];\n\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/\n\n function createContext(\n rootComponentName: string,\n defaultContext?: ContextValueType\n ) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n\n const Provider: React.FC<\n ContextValueType & { scope: Scope; children: React.ReactNode }\n > = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return {children};\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string, scope: Scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n }\n\n /* -----------------------------------------------------------------------------------------------\n * createScope\n * ---------------------------------------------------------------------------------------------*/\n\n const createScope: CreateScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope: Scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n\n createScope.scopeName = scopeName;\n return [createContext, composeContextScopes(createScope, ...createContextScopeDeps)] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * composeContextScopes\n * -----------------------------------------------------------------------------------------------*/\n\nfunction composeContextScopes(...scopes: CreateScope[]) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n\n const createScope: CreateScope = () => {\n const scopeHooks = scopes.map((createScope) => ({\n useScope: createScope(),\n scopeName: createScope.scopeName,\n }));\n\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {\n // We are calling a hook inside a callback which React warns against to avoid inconsistent\n // renders, however, scoping doesn't have render side effects so we ignore the rule.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes, ...currentScope };\n }, {});\n\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { createContext, createContextScope };\nexport type { CreateScope, Scope };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACAA,YAAuB;AAaZ;AAXX,SAASC,eACP,mBACA,gBACA;AACA,QAAM,UAAgB,oBAA4C,cAAc;AAEhF,QAAM,WAAuE,CAAC,UAAU;AACtF,UAAM,EAAE,UAAU,GAAG,QAAQ,IAAI;AAGjC,UAAM,QAAc,cAAQ,MAAM,SAAS,OAAO,OAAO,OAAO,CAAC;AACjE,WAAO,4CAAC,QAAQ,UAAR,EAAiB,OAAe,UAAS;AAAA,EACnD;AAEA,WAAS,cAAc,oBAAoB;AAE3C,WAASC,YAAW,cAAsB;AACxC,UAAM,UAAgB,iBAAW,OAAO;AACxC,QAAI,QAAS,QAAO;AACpB,QAAI,mBAAmB,OAAW,QAAO;AAEzC,UAAM,IAAI,MAAM,KAAK,YAAY,4BAA4B,iBAAiB,IAAI;AAAA,EACpF;AAEA,SAAO,CAAC,UAAUA,WAAU;AAC9B;AAaA,SAAS,mBAAmB,WAAmB,yBAAwC,CAAC,GAAG;AACzF,MAAI,kBAAyB,CAAC;AAM9B,WAASD,eACP,mBACA,gBACA;AACA,UAAM,cAAoB,oBAA4C,cAAc;AACpF,UAAM,QAAQ,gBAAgB;AAC9B,sBAAkB,CAAC,GAAG,iBAAiB,cAAc;AAErD,UAAM,WAEF,CAAC,UAAU;AACb,YAAM,EA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AAkB,gBAAgB;AAChD,YAAM,aAAa,WAAW,OAAO,CAACC,aAAY,EAAE,UAAU,UAAU,MAAM;AAI5E,cAAM,aAAa,SAAS,cAAc;AAC1C,cAAM,eAAe,WAAW,UAAU,SAAS,EAAE;AACrD,eAAO,EAAE,GAAGA,aAAY,GAAG,aAAa;AAAA,MAC1C,GAAG,CAAC,CAAC;AAEL,aAAa,cAAQ,OAAO,EAAE,CAAC,UAAU,UAAU,SAAS,EAAE,GAAG,WAAW,IAAI,CAAC,UAAU,CAAC;AAAA,IAC9F;AAAA,EACF;AAEA,cAAY,YAAY,UAAU;AAClC,SAAO;AACT;", + "names": ["createContext", "createContext", "useContext", "createScope", "nextScopes"] +} diff --git a/node_modules/@radix-ui/react-context/dist/index.mjs b/node_modules/@radix-ui/react-context/dist/index.mjs new file mode 100644 index 0000000..3ccf716 --- /dev/null +++ b/node_modules/@radix-ui/react-context/dist/index.mjs @@ -0,0 +1,81 @@ +// packages/react/context/src/createContext.tsx +import * as React from "react"; +import { jsx } from "react/jsx-runtime"; +function createContext2(rootComponentName, defaultContext) { + const Context = React.createContext(defaultContext); + const Provider = (props) => { + const { children, ...context } = props; + const value = React.useMemo(() => context, Object.values(context)); + return /* @__PURE__ */ jsx(Context.Provider, { value, children }); + }; + Provider.displayName = rootComponentName + "Provider"; + function useContext2(consumerName) { + const context = React.useContext(Context); + if (context) return context; + if (defaultContext !== void 0) return defaultContext; + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + return [Provider, useContext2]; +} +function createContextScope(scopeName, createContextScopeDeps = []) { + let defaultContexts = []; + function createContext3(rootComponentName, defaultContext) { + const BaseContext = React.createContext(defaultContext); + const index = defaultContexts.length; + defaultContexts = [...defaultContexts, defaultContext]; + const Provider = (props) => { + const { scope, children, ...context } = props; + const Context = scope?.[scopeName]?.[index] || BaseContext; + const value = React.useMemo(() => context, Object.values(context)); + return /* @__PURE__ */ jsx(Context.Provider, { value, children }); + }; + Provider.displayName = rootComponentName + "Provider"; + function useContext2(consumerName, scope) { + const Context = scope?.[scopeName]?.[index] || BaseContext; + const context = React.useContext(Context); + if (context) return context; + if (defaultContext !== void 0) return defaultContext; + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + return [Provider, useContext2]; + } + const createScope = () => { + const scopeContexts = defaultContexts.map((defaultContext) => { + return React.createContext(defaultContext); + }); + return function useScope(scope) { + const contexts = scope?.[scopeName] || scopeContexts; + return React.useMemo( + () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), + [scope, contexts] + ); + }; + }; + createScope.scopeName = scopeName; + return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)]; +} +function composeContextScopes(...scopes) { + const baseScope = scopes[0]; + if (scopes.length === 1) return baseScope; + const createScope = () => { + const scopeHooks = scopes.map((createScope2) => ({ + useScope: createScope2(), + scopeName: createScope2.scopeName + })); + return function useComposedScopes(overrideScopes) { + const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => { + const scopeProps = useScope(overrideScopes); + const currentScope = scopeProps[`__scope${scopeName}`]; + return { ...nextScopes2, ...currentScope }; + }, {}); + return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]); + }; + }; + createScope.scopeName = baseScope.scopeName; + return createScope; +} +export { + createContext2 as createContext, + createContextScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-context/dist/index.mjs.map b/node_modules/@radix-ui/react-context/dist/index.mjs.map new file mode 100644 index 0000000..1d1ef78 --- /dev/null +++ b/node_modules/@radix-ui/react-context/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/createContext.tsx"], + "sourcesContent": ["import * as React from 'react';\n\nfunction createContext(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = React.createContext(defaultContext);\n\n const Provider: React.FC = (props) => {\n const { children, ...context } = props;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return {children};\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/\n\ntype Scope = { [scopeName: string]: React.Context[] } | undefined;\ntype ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope };\ninterface CreateScope {\n scopeName: string;\n (): ScopeHook;\n}\n\nfunction createContextScope(scopeName: string, createContextScopeDeps: CreateScope[] = []) {\n let defaultContexts: any[] = [];\n\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/\n\n function createContext(\n rootComponentName: string,\n defaultContext?: ContextValueType\n ) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n\n const Provider: React.FC<\n ContextValueType & { scope: Scope; children: React.ReactNode }\n > = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return {children};\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string, scope: Scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n }\n\n /* -----------------------------------------------------------------------------------------------\n * createScope\n * ---------------------------------------------------------------------------------------------*/\n\n const createScope: CreateScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope: Scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n\n createScope.scopeName = scopeName;\n return [createContext, composeContextScopes(createScope, ...createContextScopeDeps)] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * composeContextScopes\n * -----------------------------------------------------------------------------------------------*/\n\nfunction composeContextScopes(...scopes: CreateScope[]) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n\n const createScope: CreateScope = () => {\n const scopeHooks = scopes.map((createScope) => ({\n useScope: createScope(),\n scopeName: createScope.scopeName,\n }));\n\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {\n // We are calling a hook inside a callback which React warns against to avoid inconsistent\n // renders, however, scoping doesn't have render side effects so we ignore the rule.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes, ...currentScope };\n }, {});\n\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { createContext, createContextScope };\nexport type { CreateScope, Scope };\n"], + "mappings": ";AAAA,YAAY,WAAW;AAaZ;AAXX,SAASA,eACP,mBACA,gBACA;AACA,QAAM,UAAgB,oBAA4C,cAAc;AAEhF,QAAM,WAAuE,CAAC,UAAU;AACtF,UAAM,EAAE,UAAU,GAAG,QAAQ,IAAI;AAGjC,UAAM,QAAc,cAAQ,MAAM,SAAS,OAAO,OAAO,OAAO,CAAC;AACjE,WAAO,oBAAC,QAAQ,UAAR,EAAiB,OAAe,UAAS;AAAA,EAC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AAAA,QACX,OAAO,EAAE,CAAC,UAAU,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,EAAE;AAAA,QACtE,CAAC,OAAO,QAAQ;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAEA,cAAY,YAAY;AACxB,SAAO,CAACD,gBAAe,qBAAqB,aAAa,GAAG,sBAAsB,CAAC;AACrF;AAMA,SAAS,wBAAwB,QAAuB;AACtD,QAAM,YAAY,OAAO,CAAC;AAC1B,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,cAA2B,MAAM;AACrC,UAAM,aAAa,OAAO,IAAI,CAACE,kBAAiB;AAAA,MAC9C,UAAUA,aAAY;AAAA,MACtB,WAAWA,aAAY;AAAA,IACzB,EAAE;AAEF,WAAO,SAAS,kBAAkB,gBAAgB;AAChD,YAAM,aAAa,WAAW,OAAO,CAACC,aAAY,EAAE,UAAU,UAAU,MAAM;AAI5E,cAAM,aAAa,SAAS,cAAc;AAC1C,cAAM,eAAe,WAAW,UAAU,SAAS,EAAE;AACrD,eAAO,EAAE,GAAGA,aAAY,GAAG,aAAa;AAAA,MAC1C,GAAG,CAAC,CAAC;AAEL,aAAa,cAAQ,OAAO,EAAE,CAAC,UAAU,UAAU,SAAS,EAAE,GAAG,WAAW,IAAI,CAAC,UAAU,CAAC;AAAA,IAC9F;AAAA,EACF;AAEA,cAAY,YAAY,UAAU;AAClC,SAAO;AACT;", + "names": ["createContext", "useContext", "createScope", "nextScopes"] +} diff --git a/node_modules/@radix-ui/react-context/package.json b/node_modules/@radix-ui/react-context/package.json new file mode 100644 index 0000000..cf6aaa7 --- /dev/null +++ b/node_modules/@radix-ui/react-context/package.json @@ -0,0 +1,47 @@ +{ + "name": "@radix-ui/react-context", + "version": "1.1.1", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf dist", + "version": "yarn version" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-dialog/README.md b/node_modules/@radix-ui/react-dialog/README.md new file mode 100644 index 0000000..ab35f41 --- /dev/null +++ b/node_modules/@radix-ui/react-dialog/README.md @@ -0,0 +1,13 @@ +# `react-dialog` + +## Installation + +```sh +$ yarn add @radix-ui/react-dialog +# or +$ npm install @radix-ui/react-dialog +``` + +## Usage + +View docs [here](https://radix-ui.com/primitives/docs/components/dialog). diff --git a/node_modules/@radix-ui/react-dialog/dist/index.d.mts b/node_modules/@radix-ui/react-dialog/dist/index.d.mts new file mode 100644 index 0000000..20204d2 --- /dev/null +++ b/node_modules/@radix-ui/react-dialog/dist/index.d.mts @@ -0,0 +1,103 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import { FocusScope } from '@radix-ui/react-focus-scope'; +import { Portal as Portal$1 } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; + +declare const createDialogScope: _radix_ui_react_context.CreateScope; +interface DialogProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; + modal?: boolean; +} +declare const Dialog: React.FC; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface DialogTriggerProps extends PrimitiveButtonProps { +} +declare const DialogTrigger: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface DialogPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogPortal: React.FC; +interface DialogOverlayProps extends DialogOverlayImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogOverlay: React.ForwardRefExoticComponent>; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface DialogOverlayImplProps extends PrimitiveDivProps { +} +interface DialogContentProps extends DialogContentTypeProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogContent: React.ForwardRefExoticComponent>; +interface DialogContentTypeProps extends Omit { +} +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type FocusScopeProps = React.ComponentPropsWithoutRef; +interface DialogContentImplProps extends Omit { + /** + * When `true`, focus cannot escape the `Content` via keyboard, + * pointer, or a programmatic focus. + * @defaultValue false + */ + trapFocus?: FocusScopeProps['trapped']; + /** + * Event handler called when auto-focusing on open. + * Can be prevented. + */ + onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']; + /** + * Event handler called when auto-focusing on close. + * Can be prevented. + */ + onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; +} +type PrimitiveHeading2Props = React.ComponentPropsWithoutRef; +interface DialogTitleProps extends PrimitiveHeading2Props { +} +declare const DialogTitle: React.ForwardRefExoticComponent>; +type PrimitiveParagraphProps = React.ComponentPropsWithoutRef; +interface DialogDescriptionProps extends PrimitiveParagraphProps { +} +declare const DialogDescription: React.ForwardRefExoticComponent>; +interface DialogCloseProps extends PrimitiveButtonProps { +} +declare const DialogClose: React.ForwardRefExoticComponent>; +declare const WarningProvider: React.FC<{ + contentName: string; + titleName: string; + docsSlug: string; +} & { + children: React.ReactNode; +}>; +declare const Root: React.FC; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Overlay: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; +declare const Title: React.ForwardRefExoticComponent>; +declare const Description: React.ForwardRefExoticComponent>; +declare const Close: React.ForwardRefExoticComponent>; + +export { Close, Content, Description, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, Overlay, Portal, Root, Title, Trigger, WarningProvider, createDialogScope }; diff --git a/node_modules/@radix-ui/react-dialog/dist/index.d.ts b/node_modules/@radix-ui/react-dialog/dist/index.d.ts new file mode 100644 index 0000000..20204d2 --- /dev/null +++ b/node_modules/@radix-ui/react-dialog/dist/index.d.ts @@ -0,0 +1,103 @@ +import * as _radix_ui_react_context from '@radix-ui/react-context'; +import * as React from 'react'; +import { DismissableLayer } from '@radix-ui/react-dismissable-layer'; +import { FocusScope } from '@radix-ui/react-focus-scope'; +import { Portal as Portal$1 } from '@radix-ui/react-portal'; +import { Primitive } from '@radix-ui/react-primitive'; + +declare const createDialogScope: _radix_ui_react_context.CreateScope; +interface DialogProps { + children?: React.ReactNode; + open?: boolean; + defaultOpen?: boolean; + onOpenChange?(open: boolean): void; + modal?: boolean; +} +declare const Dialog: React.FC; +type PrimitiveButtonProps = React.ComponentPropsWithoutRef; +interface DialogTriggerProps extends PrimitiveButtonProps { +} +declare const DialogTrigger: React.ForwardRefExoticComponent>; +type PortalProps = React.ComponentPropsWithoutRef; +interface DialogPortalProps { + children?: React.ReactNode; + /** + * Specify a container element to portal the content into. + */ + container?: PortalProps['container']; + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogPortal: React.FC; +interface DialogOverlayProps extends DialogOverlayImplProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogOverlay: React.ForwardRefExoticComponent>; +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface DialogOverlayImplProps extends PrimitiveDivProps { +} +interface DialogContentProps extends DialogContentTypeProps { + /** + * Used to force mounting when more control is needed. Useful when + * controlling animation with React animation libraries. + */ + forceMount?: true; +} +declare const DialogContent: React.ForwardRefExoticComponent>; +interface DialogContentTypeProps extends Omit { +} +type DismissableLayerProps = React.ComponentPropsWithoutRef; +type FocusScopeProps = React.ComponentPropsWithoutRef; +interface DialogContentImplProps extends Omit { + /** + * When `true`, focus cannot escape the `Content` via keyboard, + * pointer, or a programmatic focus. + * @defaultValue false + */ + trapFocus?: FocusScopeProps['trapped']; + /** + * Event handler called when auto-focusing on open. + * Can be prevented. + */ + onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']; + /** + * Event handler called when auto-focusing on close. + * Can be prevented. + */ + onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; +} +type PrimitiveHeading2Props = React.ComponentPropsWithoutRef; +interface DialogTitleProps extends PrimitiveHeading2Props { +} +declare const DialogTitle: React.ForwardRefExoticComponent>; +type PrimitiveParagraphProps = React.ComponentPropsWithoutRef; +interface DialogDescriptionProps extends PrimitiveParagraphProps { +} +declare const DialogDescription: React.ForwardRefExoticComponent>; +interface DialogCloseProps extends PrimitiveButtonProps { +} +declare const DialogClose: React.ForwardRefExoticComponent>; +declare const WarningProvider: React.FC<{ + contentName: string; + titleName: string; + docsSlug: string; +} & { + children: React.ReactNode; +}>; +declare const Root: React.FC; +declare const Trigger: React.ForwardRefExoticComponent>; +declare const Portal: React.FC; +declare const Overlay: React.ForwardRefExoticComponent>; +declare const Content: React.ForwardRefExoticComponent>; +declare const Title: React.ForwardRefExoticComponent>; +declare const Description: React.ForwardRefExoticComponent>; +declare const Close: React.ForwardRefExoticComponent>; + +export { Close, Content, Description, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, Overlay, Portal, Root, Title, Trigger, WarningProvider, createDialogScope }; diff --git a/node_modules/@radix-ui/react-dialog/dist/index.js b/node_modules/@radix-ui/react-dialog/dist/index.js new file mode 100644 index 0000000..61e4ecc --- /dev/null +++ b/node_modules/@radix-ui/react-dialog/dist/index.js @@ -0,0 +1,372 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/dialog/src/index.ts +var src_exports = {}; +__export(src_exports, { + Close: () => Close, + Content: () => Content, + Description: () => Description, + Dialog: () => Dialog, + DialogClose: () => DialogClose, + DialogContent: () => DialogContent, + DialogDescription: () => DialogDescription, + DialogOverlay: () => DialogOverlay, + DialogPortal: () => DialogPortal, + DialogTitle: () => DialogTitle, + DialogTrigger: () => DialogTrigger, + Overlay: () => Overlay, + Portal: () => Portal, + Root: () => Root, + Title: () => Title, + Trigger: () => Trigger, + WarningProvider: () => WarningProvider, + createDialogScope: () => createDialogScope +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/dialog/src/dialog.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_context = require("@radix-ui/react-context"); +var import_react_id = require("@radix-ui/react-id"); +var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state"); +var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer"); +var import_react_focus_scope = require("@radix-ui/react-focus-scope"); +var import_react_portal = require("@radix-ui/react-portal"); +var import_react_presence = require("@radix-ui/react-presence"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_focus_guards = require("@radix-ui/react-focus-guards"); +var import_react_remove_scroll = require("react-remove-scroll"); +var import_aria_hidden = require("aria-hidden"); +var import_react_slot = require("@radix-ui/react-slot"); +var import_jsx_runtime = require("react/jsx-runtime"); +var DIALOG_NAME = "Dialog"; +var [createDialogContext, createDialogScope] = (0, import_react_context.createContextScope)(DIALOG_NAME); +var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME); +var Dialog = (props) => { + const { + __scopeDialog, + children, + open: openProp, + defaultOpen, + onOpenChange, + modal = true + } = props; + const triggerRef = React.useRef(null); + const contentRef = React.useRef(null); + const [open = false, setOpen] = (0, import_react_use_controllable_state.useControllableState)({ + prop: openProp, + defaultProp: defaultOpen, + onChange: onOpenChange + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + DialogProvider, + { + scope: __scopeDialog, + triggerRef, + contentRef, + contentId: (0, import_react_id.useId)(), + titleId: (0, import_react_id.useId)(), + descriptionId: (0, import_react_id.useId)(), + open, + onOpenChange: setOpen, + onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), + modal, + children + } + ); +}; +Dialog.displayName = DIALOG_NAME; +var TRIGGER_NAME = "DialogTrigger"; +var DialogTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...triggerProps } = props; + const context = useDialogContext(TRIGGER_NAME, __scopeDialog); + const composedTriggerRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + "aria-haspopup": "dialog", + "aria-expanded": context.open, + "aria-controls": context.contentId, + "data-state": getState(context.open), + ...triggerProps, + ref: composedTriggerRef, + onClick: (0, import_primitive.composeEventHandlers)(props.onClick, context.onOpenToggle) + } + ); + } +); +DialogTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "DialogPortal"; +var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { + forceMount: void 0 +}); +var DialogPortal = (props) => { + const { __scopeDialog, forceMount, children, container } = props; + const context = useDialogContext(PORTAL_NAME, __scopeDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, container, children: child }) })) }); +}; +DialogPortal.displayName = PORTAL_NAME; +var OVERLAY_NAME = "DialogOverlay"; +var DialogOverlay = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog); + const { forceMount = portalContext.forceMount, ...overlayProps } = props; + const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog); + return context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null; + } +); +DialogOverlay.displayName = OVERLAY_NAME; +var DialogOverlayImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...overlayProps } = props; + const context = useDialogContext(OVERLAY_NAME, __scopeDialog); + return ( + // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` + // ie. when `Overlay` and `Content` are siblings + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_remove_scroll.RemoveScroll, { as: import_react_slot.Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + "data-state": getState(context.open), + ...overlayProps, + ref: forwardedRef, + style: { pointerEvents: "auto", ...overlayProps.style } + } + ) }) + ); + } +); +var CONTENT_NAME = "DialogContent"; +var DialogContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) }); + } +); +DialogContent.displayName = CONTENT_NAME; +var DialogContentModal = React.forwardRef( + (props, forwardedRef) => { + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + const contentRef = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.contentRef, contentRef); + React.useEffect(() => { + const content = contentRef.current; + if (content) return (0, import_aria_hidden.hideOthers)(content); + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + DialogContentImpl, + { + ...props, + ref: composedRefs, + trapFocus: context.open, + disableOutsidePointerEvents: true, + onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => { + event.preventDefault(); + context.triggerRef.current?.focus(); + }), + onPointerDownOutside: (0, import_primitive.composeEventHandlers)(props.onPointerDownOutside, (event) => { + const originalEvent = event.detail.originalEvent; + const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; + const isRightClick = originalEvent.button === 2 || ctrlLeftClick; + if (isRightClick) event.preventDefault(); + }), + onFocusOutside: (0, import_primitive.composeEventHandlers)( + props.onFocusOutside, + (event) => event.preventDefault() + ) + } + ); + } +); +var DialogContentNonModal = React.forwardRef( + (props, forwardedRef) => { + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + const hasInteractedOutsideRef = React.useRef(false); + const hasPointerDownOutsideRef = React.useRef(false); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + DialogContentImpl, + { + ...props, + ref: forwardedRef, + trapFocus: false, + disableOutsidePointerEvents: false, + onCloseAutoFocus: (event) => { + props.onCloseAutoFocus?.(event); + if (!event.defaultPrevented) { + if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); + event.preventDefault(); + } + hasInteractedOutsideRef.current = false; + hasPointerDownOutsideRef.current = false; + }, + onInteractOutside: (event) => { + props.onInteractOutside?.(event); + if (!event.defaultPrevented) { + hasInteractedOutsideRef.current = true; + if (event.detail.originalEvent.type === "pointerdown") { + hasPointerDownOutsideRef.current = true; + } + } + const target = event.target; + const targetIsTrigger = context.triggerRef.current?.contains(target); + if (targetIsTrigger) event.preventDefault(); + if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { + event.preventDefault(); + } + } + } + ); + } +); +var DialogContentImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props; + const context = useDialogContext(CONTENT_NAME, __scopeDialog); + const contentRef = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, contentRef); + (0, import_react_focus_guards.useFocusGuards)(); + return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_focus_scope.FocusScope, + { + asChild: true, + loop: true, + trapped: trapFocus, + onMountAutoFocus: onOpenAutoFocus, + onUnmountAutoFocus: onCloseAutoFocus, + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_dismissable_layer.DismissableLayer, + { + role: "dialog", + id: context.contentId, + "aria-describedby": context.descriptionId, + "aria-labelledby": context.titleId, + "data-state": getState(context.open), + ...contentProps, + ref: composedRefs, + onDismiss: () => context.onOpenChange(false) + } + ) + } + ), + /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleWarning, { titleId: context.titleId }), + /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef, descriptionId: context.descriptionId }) + ] }) + ] }); + } +); +var TITLE_NAME = "DialogTitle"; +var DialogTitle = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...titleProps } = props; + const context = useDialogContext(TITLE_NAME, __scopeDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef }); + } +); +DialogTitle.displayName = TITLE_NAME; +var DESCRIPTION_NAME = "DialogDescription"; +var DialogDescription = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...descriptionProps } = props; + const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef }); + } +); +DialogDescription.displayName = DESCRIPTION_NAME; +var CLOSE_NAME = "DialogClose"; +var DialogClose = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...closeProps } = props; + const context = useDialogContext(CLOSE_NAME, __scopeDialog); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.button, + { + type: "button", + ...closeProps, + ref: forwardedRef, + onClick: (0, import_primitive.composeEventHandlers)(props.onClick, () => context.onOpenChange(false)) + } + ); + } +); +DialogClose.displayName = CLOSE_NAME; +function getState(open) { + return open ? "open" : "closed"; +} +var TITLE_WARNING_NAME = "DialogTitleWarning"; +var [WarningProvider, useWarningContext] = (0, import_react_context.createContext)(TITLE_WARNING_NAME, { + contentName: CONTENT_NAME, + titleName: TITLE_NAME, + docsSlug: "dialog" +}); +var TitleWarning = ({ titleId }) => { + const titleWarningContext = useWarningContext(TITLE_WARNING_NAME); + const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`; + React.useEffect(() => { + if (titleId) { + const hasTitle = document.getElementById(titleId); + if (!hasTitle) console.error(MESSAGE); + } + }, [MESSAGE, titleId]); + return null; +}; +var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning"; +var DescriptionWarning = ({ contentRef, descriptionId }) => { + const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME); + const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`; + React.useEffect(() => { + const describedById = contentRef.current?.getAttribute("aria-describedby"); + if (descriptionId && describedById) { + const hasDescription = document.getElementById(descriptionId); + if (!hasDescription) console.warn(MESSAGE); + } + }, [MESSAGE, contentRef, descriptionId]); + return null; +}; +var Root = Dialog; +var Trigger = DialogTrigger; +var Portal = DialogPortal; +var Overlay = DialogOverlay; +var Content = DialogContent; +var Title = DialogTitle; +var Description = DialogDescription; +var Close = DialogClose; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-dialog/dist/index.js.map b/node_modules/@radix-ui/react-dialog/dist/index.js.map new file mode 100644 index 0000000..aec17ce --- /dev/null +++ b/node_modules/@radix-ui/react-dialog/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/dialog.tsx"], + "sourcesContent": ["'use client';\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Title,\n Description,\n Close,\n //\n WarningProvider,\n} from './dialog';\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n} from './dialog';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContext, createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport { hideOthers } from 'aria-hidden';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DIALOG_NAME = 'Dialog';\n\ntype ScopedProps

= P & { __scopeDialog?: Scope };\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\n\ntype DialogContextValue = {\n triggerRef: React.RefObject;\n contentRef: React.RefObject;\n contentId: string;\n titleId: string;\n descriptionId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\nconst [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\n\ninterface DialogProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst Dialog: React.FC = (props: ScopedProps) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n >\n {children}\n \n );\n};\n\nDialog.displayName = DIALOG_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger';\n\ntype DialogTriggerElement = React.ElementRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface DialogTriggerProps extends PrimitiveButtonProps {}\n\nconst DialogTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return (\n \n );\n }\n);\n\nDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface DialogPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogPortal: React.FC = (props: ScopedProps) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return (\n \n {React.Children.map(children, (child) => (\n \n \n {child}\n \n \n ))}\n \n );\n};\n\nDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay';\n\ntype DialogOverlayElement = DialogOverlayImplElement;\ninterface DialogOverlayProps extends DialogOverlayImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogOverlay = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? (\n \n \n \n ) : null;\n }\n);\n\nDialogOverlay.displayName = OVERLAY_NAME;\n\ntype DialogOverlayImplElement = React.ElementRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface DialogOverlayImplProps extends PrimitiveDivProps {}\n\nconst DialogOverlayImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n \n \n \n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent';\n\ntype DialogContentElement = DialogContentTypeElement;\ninterface DialogContentProps extends DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return (\n \n {context.modal ? (\n \n ) : (\n \n )}\n \n );\n }\n);\n\nDialogContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentTypeElement = DialogContentImplElement;\ninterface DialogContentTypeProps\n extends Omit {}\n\nconst DialogContentModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n {\n event.preventDefault();\n context.triggerRef.current?.focus();\n })}\n onPointerDownOutside={composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault();\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault()\n )}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplElement = React.ElementRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype FocusScopeProps = React.ComponentPropsWithoutRef;\ninterface DialogContentImplProps extends Omit {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst DialogContentImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n\n // Make sure the whole tree has focus guards as our `Dialog` will be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n return (\n <>\n \n context.onOpenChange(false)}\n />\n \n {process.env.NODE_ENV !== 'production' && (\n <>\n \n \n \n )}\n \n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle';\n\ntype DialogTitleElement = React.ElementRef;\ntype PrimitiveHeading2Props = React.ComponentPropsWithoutRef;\ninterface DialogTitleProps extends PrimitiveHeading2Props {}\n\nconst DialogTitle = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return ;\n }\n);\n\nDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'DialogDescription';\n\ntype DialogDescriptionElement = React.ElementRef;\ntype PrimitiveParagraphProps = React.ComponentPropsWithoutRef;\ninterface DialogDescriptionProps extends PrimitiveParagraphProps {}\n\nconst DialogDescription = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return ;\n }\n);\n\nDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose';\n\ntype DialogCloseElement = React.ElementRef;\ninterface DialogCloseProps extends PrimitiveButtonProps {}\n\nconst DialogClose = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return (\n context.onOpenChange(false))}\n />\n );\n }\n);\n\nDialogClose.displayName = CLOSE_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst TITLE_WARNING_NAME = 'DialogTitleWarning';\n\nconst [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: 'dialog',\n});\n\ntype TitleWarningProps = { titleId?: string };\n\nconst TitleWarning: React.FC = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n\n return null;\n};\n\nconst DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject;\n descriptionId?: string;\n};\n\nconst DescriptionWarning: React.FC = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute('aria-describedby');\n // if we have an id and the user hasn't set aria-describedby={undefined}\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n\n return null;\n};\n\nconst Root = Dialog;\nconst Trigger = DialogTrigger;\nconst Portal = DialogPortal;\nconst Overlay = DialogOverlay;\nconst Content = DialogContent;\nconst Title = DialogTitle;\nconst Description = DialogDescription;\nconst Close = DialogClose;\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Title,\n Description,\n Close,\n //\n WarningProvider,\n};\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,gCAAgC;AAChC,2BAAkD;AAClD,sBAAsB;AACtB,0CAAqC;AACrC,qCAAiC;AACjC,+BAA2B;AAC3B,0BAA0C;AAC1C,4BAAyB;AACzB,6BAA0B;AAC1B,gCAA+B;AAC/B,iCAA6B;AAC7B,yBAA2B;AAC3B,wBAAqB;AAqDjB;AA7CJ,IAAM,cAAc;AAGpB,IAAM,CAAC,qBAAqB,iBAAiB,QAAI,yCAAmB,WAAW;AAc/E,IAAM,CAAC,gBAAgB,gBAAgB,IAAI,oBAAwC,WAAW;AAU9F,IAAM,SAAgC,CAAC,UAAoC;AACzE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV,IAAI;AACJ,QAAM,aAAmB,aAA0B,IAAI;AACvD,QAAM,aAAmB,aAA6B,IAAI;AAC1D,QAAM,CAAC,OAAO,OAAO,OAAO,QAAI,0DAAqB;AAAA,IACnD,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAA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AAC,iBAAiB,iBAAiB,QAAI,oCAAc,oBAAoB;AAAA,EAC7E,aAAa;AAAA,EACb,WAAW;AAAA,EACX,UAAU;AACZ,CAAC;AAID,IAAM,eAA4C,CAAC,EAAE,QAAQ,MAAM;AACjE,QAAM,sBAAsB,kBAAkB,kBAAkB;AAEhE,QAAM,UAAU,KAAK,oBAAoB,WAAW,mBAAmB,oBAAoB,SAAS;AAAA;AAAA,4BAE1E,oBAAoB,SAAS;AAAA;AAAA,4EAEmB,oBAAoB,QAAQ;AAEtG,EAAM,gBAAU,MAAM;AACpB,QAAI,SAAS;AACX,YAAM,WAAW,SAAS,eAAe,OAAO;AAChD,UAAI,CAAC,SAAU,SAAQ,MAAM,OAAO;AAAA,IACtC;AAAA,EACF,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,SAAO;AACT;AAEA,IAAM,2BAA2B;AAOjC,IAAM,qBAAwD,CAAC,EAAE,YAAY,cAAc,MAAM;AAC/F,QAAM,4BAA4B,kBAAkB,wBAAwB;AAC5E,QAAM,UAAU,6EAA6E,0BAA0B,WAAW;AAElI,EAAM,gBAAU,MAAM;AACpB,UAAM,gBAAgB,WAAW,SAAS,aAAa,kBAAkB;AAEzE,QAAI,iBAAiB,eAAe;AAClC,YAAM,iBAAiB,SAAS,eAAe,aAAa;AAC5D,UAAI,CAAC,eAAgB,SAAQ,KAAK,OAAO;AAAA,IAC3C;AAAA,EACF,GAAG,CAAC,SAAS,YAAY,aAAa,CAAC;AAEvC,SAAO;AACT;AAEA,IAAM,OAAO;AACb,IAAM,UAAU;AAChB,IAAM,SAAS;AACf,IAAM,UAAU;AAChB,IAAM,UAAU;AAChB,IAAM,QAAQ;AACd,IAAM,cAAc;AACpB,IAAM,QAAQ;", + "names": ["PortalPrimitive"] +} diff --git a/node_modules/@radix-ui/react-dialog/dist/index.mjs b/node_modules/@radix-ui/react-dialog/dist/index.mjs new file mode 100644 index 0000000..81cd963 --- /dev/null +++ b/node_modules/@radix-ui/react-dialog/dist/index.mjs @@ -0,0 +1,340 @@ +"use client"; + +// packages/react/dialog/src/dialog.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { createContext, createContextScope } from "@radix-ui/react-context"; +import { useId } from "@radix-ui/react-id"; +import { useControllableState } from "@radix-ui/react-use-controllable-state"; +import { DismissableLayer } from "@radix-ui/react-dismissable-layer"; +import { FocusScope } from "@radix-ui/react-focus-scope"; +import { Portal as PortalPrimitive } from "@radix-ui/react-portal"; +import { Presence } from "@radix-ui/react-presence"; +import { Primitive } from "@radix-ui/react-primitive"; +import { useFocusGuards } from "@radix-ui/react-focus-guards"; +import { RemoveScroll } from "react-remove-scroll"; +import { hideOthers } from "aria-hidden"; +import { Slot } from "@radix-ui/react-slot"; +import { Fragment, jsx, jsxs } from "react/jsx-runtime"; +var DIALOG_NAME = "Dialog"; +var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME); +var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME); +var Dialog = (props) => { + const { + __scopeDialog, + children, + open: openProp, + defaultOpen, + onOpenChange, + modal = true + } = props; + const triggerRef = React.useRef(null); + const contentRef = React.useRef(null); + const [open = false, setOpen] = useControllableState({ + prop: openProp, + defaultProp: defaultOpen, + onChange: onOpenChange + }); + return /* @__PURE__ */ jsx( + DialogProvider, + { + scope: __scopeDialog, + triggerRef, + contentRef, + contentId: useId(), + titleId: useId(), + descriptionId: useId(), + open, + onOpenChange: setOpen, + onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), + modal, + children + } + ); +}; +Dialog.displayName = DIALOG_NAME; +var TRIGGER_NAME = "DialogTrigger"; +var DialogTrigger = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...triggerProps } = props; + const context = useDialogContext(TRIGGER_NAME, __scopeDialog); + const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef); + return /* @__PURE__ */ jsx( + Primitive.button, + { + type: "button", + "aria-haspopup": "dialog", + "aria-expanded": context.open, + "aria-controls": context.contentId, + "data-state": getState(context.open), + ...triggerProps, + ref: composedTriggerRef, + onClick: composeEventHandlers(props.onClick, context.onOpenToggle) + } + ); + } +); +DialogTrigger.displayName = TRIGGER_NAME; +var PORTAL_NAME = "DialogPortal"; +var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { + forceMount: void 0 +}); +var DialogPortal = (props) => { + const { __scopeDialog, forceMount, children, container } = props; + const context = useDialogContext(PORTAL_NAME, __scopeDialog); + return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) }); +}; +DialogPortal.displayName = PORTAL_NAME; +var OVERLAY_NAME = "DialogOverlay"; +var DialogOverlay = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog); + const { forceMount = portalContext.forceMount, ...overlayProps } = props; + const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog); + return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null; + } +); +DialogOverlay.displayName = OVERLAY_NAME; +var DialogOverlayImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...overlayProps } = props; + const context = useDialogContext(OVERLAY_NAME, __scopeDialog); + return ( + // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` + // ie. when `Overlay` and `Content` are siblings + /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx( + Primitive.div, + { + "data-state": getState(context.open), + ...overlayProps, + ref: forwardedRef, + style: { pointerEvents: "auto", ...overlayProps.style } + } + ) }) + ); + } +); +var CONTENT_NAME = "DialogContent"; +var DialogContent = React.forwardRef( + (props, forwardedRef) => { + const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog); + const { forceMount = portalContext.forceMount, ...contentProps } = props; + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) }); + } +); +DialogContent.displayName = CONTENT_NAME; +var DialogContentModal = React.forwardRef( + (props, forwardedRef) => { + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + const contentRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef); + React.useEffect(() => { + const content = contentRef.current; + if (content) return hideOthers(content); + }, []); + return /* @__PURE__ */ jsx( + DialogContentImpl, + { + ...props, + ref: composedRefs, + trapFocus: context.open, + disableOutsidePointerEvents: true, + onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => { + event.preventDefault(); + context.triggerRef.current?.focus(); + }), + onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => { + const originalEvent = event.detail.originalEvent; + const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; + const isRightClick = originalEvent.button === 2 || ctrlLeftClick; + if (isRightClick) event.preventDefault(); + }), + onFocusOutside: composeEventHandlers( + props.onFocusOutside, + (event) => event.preventDefault() + ) + } + ); + } +); +var DialogContentNonModal = React.forwardRef( + (props, forwardedRef) => { + const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); + const hasInteractedOutsideRef = React.useRef(false); + const hasPointerDownOutsideRef = React.useRef(false); + return /* @__PURE__ */ jsx( + DialogContentImpl, + { + ...props, + ref: forwardedRef, + trapFocus: false, + disableOutsidePointerEvents: false, + onCloseAutoFocus: (event) => { + props.onCloseAutoFocus?.(event); + if (!event.defaultPrevented) { + if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); + event.preventDefault(); + } + hasInteractedOutsideRef.current = false; + hasPointerDownOutsideRef.current = false; + }, + onInteractOutside: (event) => { + props.onInteractOutside?.(event); + if (!event.defaultPrevented) { + hasInteractedOutsideRef.current = true; + if (event.detail.originalEvent.type === "pointerdown") { + hasPointerDownOutsideRef.current = true; + } + } + const target = event.target; + const targetIsTrigger = context.triggerRef.current?.contains(target); + if (targetIsTrigger) event.preventDefault(); + if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { + event.preventDefault(); + } + } + } + ); + } +); +var DialogContentImpl = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props; + const context = useDialogContext(CONTENT_NAME, __scopeDialog); + const contentRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, contentRef); + useFocusGuards(); + return /* @__PURE__ */ jsxs(Fragment, { children: [ + /* @__PURE__ */ jsx( + FocusScope, + { + asChild: true, + loop: true, + trapped: trapFocus, + onMountAutoFocus: onOpenAutoFocus, + onUnmountAutoFocus: onCloseAutoFocus, + children: /* @__PURE__ */ jsx( + DismissableLayer, + { + role: "dialog", + id: context.contentId, + "aria-describedby": context.descriptionId, + "aria-labelledby": context.titleId, + "data-state": getState(context.open), + ...contentProps, + ref: composedRefs, + onDismiss: () => context.onOpenChange(false) + } + ) + } + ), + /* @__PURE__ */ jsxs(Fragment, { children: [ + /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }), + /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId }) + ] }) + ] }); + } +); +var TITLE_NAME = "DialogTitle"; +var DialogTitle = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...titleProps } = props; + const context = useDialogContext(TITLE_NAME, __scopeDialog); + return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef }); + } +); +DialogTitle.displayName = TITLE_NAME; +var DESCRIPTION_NAME = "DialogDescription"; +var DialogDescription = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...descriptionProps } = props; + const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog); + return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef }); + } +); +DialogDescription.displayName = DESCRIPTION_NAME; +var CLOSE_NAME = "DialogClose"; +var DialogClose = React.forwardRef( + (props, forwardedRef) => { + const { __scopeDialog, ...closeProps } = props; + const context = useDialogContext(CLOSE_NAME, __scopeDialog); + return /* @__PURE__ */ jsx( + Primitive.button, + { + type: "button", + ...closeProps, + ref: forwardedRef, + onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false)) + } + ); + } +); +DialogClose.displayName = CLOSE_NAME; +function getState(open) { + return open ? "open" : "closed"; +} +var TITLE_WARNING_NAME = "DialogTitleWarning"; +var [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, { + contentName: CONTENT_NAME, + titleName: TITLE_NAME, + docsSlug: "dialog" +}); +var TitleWarning = ({ titleId }) => { + const titleWarningContext = useWarningContext(TITLE_WARNING_NAME); + const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`; + React.useEffect(() => { + if (titleId) { + const hasTitle = document.getElementById(titleId); + if (!hasTitle) console.error(MESSAGE); + } + }, [MESSAGE, titleId]); + return null; +}; +var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning"; +var DescriptionWarning = ({ contentRef, descriptionId }) => { + const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME); + const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`; + React.useEffect(() => { + const describedById = contentRef.current?.getAttribute("aria-describedby"); + if (descriptionId && describedById) { + const hasDescription = document.getElementById(descriptionId); + if (!hasDescription) console.warn(MESSAGE); + } + }, [MESSAGE, contentRef, descriptionId]); + return null; +}; +var Root = Dialog; +var Trigger = DialogTrigger; +var Portal = DialogPortal; +var Overlay = DialogOverlay; +var Content = DialogContent; +var Title = DialogTitle; +var Description = DialogDescription; +var Close = DialogClose; +export { + Close, + Content, + Description, + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogOverlay, + DialogPortal, + DialogTitle, + DialogTrigger, + Overlay, + Portal, + Root, + Title, + Trigger, + WarningProvider, + createDialogScope +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-dialog/dist/index.mjs.map b/node_modules/@radix-ui/react-dialog/dist/index.mjs.map new file mode 100644 index 0000000..7803e41 --- /dev/null +++ b/node_modules/@radix-ui/react-dialog/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/dialog.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContext, createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport { hideOthers } from 'aria-hidden';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DIALOG_NAME = 'Dialog';\n\ntype ScopedProps

= P & { __scopeDialog?: Scope };\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\n\ntype DialogContextValue = {\n triggerRef: React.RefObject;\n contentRef: React.RefObject;\n contentId: string;\n titleId: string;\n descriptionId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\nconst [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\n\ninterface DialogProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst Dialog: React.FC = (props: ScopedProps) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n >\n {children}\n \n );\n};\n\nDialog.displayName = DIALOG_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger';\n\ntype DialogTriggerElement = React.ElementRef;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef;\ninterface DialogTriggerProps extends PrimitiveButtonProps {}\n\nconst DialogTrigger = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return (\n \n );\n }\n);\n\nDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef;\ninterface DialogPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogPortal: React.FC = (props: ScopedProps) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return (\n \n {React.Children.map(children, (child) => (\n \n \n {child}\n \n \n ))}\n \n );\n};\n\nDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay';\n\ntype DialogOverlayElement = DialogOverlayImplElement;\ninterface DialogOverlayProps extends DialogOverlayImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogOverlay = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? (\n \n \n \n ) : null;\n }\n);\n\nDialogOverlay.displayName = OVERLAY_NAME;\n\ntype DialogOverlayImplElement = React.ElementRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface DialogOverlayImplProps extends PrimitiveDivProps {}\n\nconst DialogOverlayImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n \n \n \n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent';\n\ntype DialogContentElement = DialogContentTypeElement;\ninterface DialogContentProps extends DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogContent = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return (\n \n {context.modal ? (\n \n ) : (\n \n )}\n \n );\n }\n);\n\nDialogContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentTypeElement = DialogContentImplElement;\ninterface DialogContentTypeProps\n extends Omit {}\n\nconst DialogContentModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n {\n event.preventDefault();\n context.triggerRef.current?.focus();\n })}\n onPointerDownOutside={composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault();\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault()\n )}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplElement = React.ElementRef;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef;\ntype FocusScopeProps = React.ComponentPropsWithoutRef;\ninterface DialogContentImplProps extends Omit {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst DialogContentImpl = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n\n // Make sure the whole tree has focus guards as our `Dialog` will be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n return (\n <>\n \n context.onOpenChange(false)}\n />\n \n {process.env.NODE_ENV !== 'production' && (\n <>\n \n \n \n )}\n \n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle';\n\ntype DialogTitleElement = React.ElementRef;\ntype PrimitiveHeading2Props = React.ComponentPropsWithoutRef;\ninterface DialogTitleProps extends PrimitiveHeading2Props {}\n\nconst DialogTitle = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return ;\n }\n);\n\nDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'DialogDescription';\n\ntype DialogDescriptionElement = React.ElementRef;\ntype PrimitiveParagraphProps = React.ComponentPropsWithoutRef;\ninterface DialogDescriptionProps extends PrimitiveParagraphProps {}\n\nconst DialogDescription = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return ;\n }\n);\n\nDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose';\n\ntype DialogCloseElement = React.ElementRef;\ninterface DialogCloseProps extends PrimitiveButtonProps {}\n\nconst DialogClose = React.forwardRef(\n (props: ScopedProps, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return (\n context.onOpenChange(false))}\n />\n );\n }\n);\n\nDialogClose.displayName = CLOSE_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst TITLE_WARNING_NAME = 'DialogTitleWarning';\n\nconst [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: 'dialog',\n});\n\ntype TitleWarningProps = { titleId?: string };\n\nconst TitleWarning: React.FC = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n\n return null;\n};\n\nconst DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject;\n descriptionId?: string;\n};\n\nconst DescriptionWarning: React.FC = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute('aria-describedby');\n // if we have an id and the user hasn't set aria-describedby={undefined}\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n\n return null;\n};\n\nconst Root = Dialog;\nconst Trigger = DialogTrigger;\nconst Portal = DialogPortal;\nconst Overlay = DialogOverlay;\nconst Content = DialogContent;\nconst Title = DialogTitle;\nconst Description = DialogDescription;\nconst Close = DialogClose;\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Title,\n Description,\n Close,\n //\n WarningProvider,\n};\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,eAAe,0BAA0B;AAClD,SAAS,aAAa;AACtB,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AACjC,SAAS,kBAAkB;AAC3B,SAAS,UAAU,uBAAuB;AAC1C,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AAqDjB,SAyVM,UAzVN,KAyVM,YAzVN;AA7CJ,IAAM,cAAc;AAGpB,IAAM,CAAC,qBAAqB,iBAAiB,IAAI,mBAAmB,WAAW;AAc/E,IAAM,CAAC,gBAAgB,gBAAgB,IAAI,oBAAwC,WAAW;AAU9F,IAAM,SAAgC,CAAC,UAAoC;AACzE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV,IAAI;AACJ,QAAM,aAAmB,aAA0B,IAAI;AACvD,QAAM,aAAmB,aAA6B,IAAI;AAC1D,QAAM,CAAC,OAAO,OAAO,OAAO,IAAI,qBAAqB;AA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100644 index 0000000..413b242 --- /dev/null +++ b/node_modules/@radix-ui/react-dialog/package.json @@ -0,0 +1,79 @@ +{ + "name": "@radix-ui/react-dialog", + "version": "1.1.6", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "lint": "eslint --max-warnings 0 src", + "clean": "rm -rf dist", + "version": "yarn version" + }, + "dependencies": { + "@radix-ui/primitive": "1.1.1", + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-dismissable-layer": "1.1.5", + "@radix-ui/react-focus-guards": "1.1.1", + "@radix-ui/react-focus-scope": "1.1.2", + "@radix-ui/react-id": "1.1.0", + "@radix-ui/react-portal": "1.1.4", + "@radix-ui/react-presence": "1.1.2", + "@radix-ui/react-primitive": "2.0.2", + "@radix-ui/react-slot": "1.1.2", + "@radix-ui/react-use-controllable-state": "1.1.0", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.6.3" + }, + "devDependencies": { + "@repo/eslint-config": "0.0.0", + "@repo/typescript-config": "0.0.0", + "@types/react": "^19.0.7", + "@types/react-dom": "^19.0.3", + "eslint": "^9.18.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "typescript": "^5.7.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-dismissable-layer/README.md b/node_modules/@radix-ui/react-dismissable-layer/README.md new file mode 100644 index 0000000..30aaabe --- /dev/null +++ b/node_modules/@radix-ui/react-dismissable-layer/README.md @@ -0,0 +1,13 @@ +# `react-dismissable-layer` + +## Installation + +```sh +$ yarn add @radix-ui/react-dismissable-layer +# or +$ npm install @radix-ui/react-dismissable-layer +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts b/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts new file mode 100644 index 0000000..dccc025 --- /dev/null +++ b/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts @@ -0,0 +1,51 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface DismissableLayerProps extends PrimitiveDivProps { + /** + * When `true`, hover/focus/click interactions will be disabled on elements outside + * the `DismissableLayer`. Users will need to click twice on outside elements to + * interact with them: once to close the `DismissableLayer`, and again to trigger the element. + */ + disableOutsidePointerEvents?: boolean; + /** + * Event handler called when the escape key is down. + * Can be prevented. + */ + onEscapeKeyDown?: (event: KeyboardEvent) => void; + /** + * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. + * Can be prevented. + */ + onPointerDownOutside?: (event: PointerDownOutsideEvent) => void; + /** + * Event handler called when the focus moves outside of the `DismissableLayer`. + * Can be prevented. + */ + onFocusOutside?: (event: FocusOutsideEvent) => void; + /** + * Event handler called when an interaction happens outside the `DismissableLayer`. + * Specifically, when a `pointerdown` event happens outside or focus moves outside of it. + * Can be prevented. + */ + onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void; + /** + * Handler called when the `DismissableLayer` should be dismissed + */ + onDismiss?: () => void; +} +declare const DismissableLayer: React.ForwardRefExoticComponent>; +interface DismissableLayerBranchProps extends PrimitiveDivProps { +} +declare const DismissableLayerBranch: React.ForwardRefExoticComponent>; +type PointerDownOutsideEvent = CustomEvent<{ + originalEvent: PointerEvent; +}>; +type FocusOutsideEvent = CustomEvent<{ + originalEvent: FocusEvent; +}>; +declare const Root: React.ForwardRefExoticComponent>; +declare const Branch: React.ForwardRefExoticComponent>; + +export { Branch, DismissableLayer, DismissableLayerBranch, type DismissableLayerProps, Root }; diff --git a/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts b/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts new file mode 100644 index 0000000..dccc025 --- /dev/null +++ b/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts @@ -0,0 +1,51 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface DismissableLayerProps extends PrimitiveDivProps { + /** + * When `true`, hover/focus/click interactions will be disabled on elements outside + * the `DismissableLayer`. Users will need to click twice on outside elements to + * interact with them: once to close the `DismissableLayer`, and again to trigger the element. + */ + disableOutsidePointerEvents?: boolean; + /** + * Event handler called when the escape key is down. + * Can be prevented. + */ + onEscapeKeyDown?: (event: KeyboardEvent) => void; + /** + * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. + * Can be prevented. + */ + onPointerDownOutside?: (event: PointerDownOutsideEvent) => void; + /** + * Event handler called when the focus moves outside of the `DismissableLayer`. + * Can be prevented. + */ + onFocusOutside?: (event: FocusOutsideEvent) => void; + /** + * Event handler called when an interaction happens outside the `DismissableLayer`. + * Specifically, when a `pointerdown` event happens outside or focus moves outside of it. + * Can be prevented. + */ + onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void; + /** + * Handler called when the `DismissableLayer` should be dismissed + */ + onDismiss?: () => void; +} +declare const DismissableLayer: React.ForwardRefExoticComponent>; +interface DismissableLayerBranchProps extends PrimitiveDivProps { +} +declare const DismissableLayerBranch: React.ForwardRefExoticComponent>; +type PointerDownOutsideEvent = CustomEvent<{ + originalEvent: PointerEvent; +}>; +type FocusOutsideEvent = CustomEvent<{ + originalEvent: FocusEvent; +}>; +declare const Root: React.ForwardRefExoticComponent>; +declare const Branch: React.ForwardRefExoticComponent>; + +export { Branch, DismissableLayer, DismissableLayerBranch, type DismissableLayerProps, Root }; diff --git a/node_modules/@radix-ui/react-dismissable-layer/dist/index.js b/node_modules/@radix-ui/react-dismissable-layer/dist/index.js new file mode 100644 index 0000000..c0df853 --- /dev/null +++ b/node_modules/@radix-ui/react-dismissable-layer/dist/index.js @@ -0,0 +1,253 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/dismissable-layer/src/index.ts +var src_exports = {}; +__export(src_exports, { + Branch: () => Branch, + DismissableLayer: () => DismissableLayer, + DismissableLayerBranch: () => DismissableLayerBranch, + Root: () => Root +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/dismissable-layer/src/dismissable-layer.tsx +var React = __toESM(require("react")); +var import_primitive = require("@radix-ui/primitive"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var import_react_use_escape_keydown = require("@radix-ui/react-use-escape-keydown"); +var import_jsx_runtime = require("react/jsx-runtime"); +var DISMISSABLE_LAYER_NAME = "DismissableLayer"; +var CONTEXT_UPDATE = "dismissableLayer.update"; +var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside"; +var FOCUS_OUTSIDE = "dismissableLayer.focusOutside"; +var originalBodyPointerEvents; +var DismissableLayerContext = React.createContext({ + layers: /* @__PURE__ */ new Set(), + layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), + branches: /* @__PURE__ */ new Set() +}); +var DismissableLayer = React.forwardRef( + (props, forwardedRef) => { + const { + disableOutsidePointerEvents = false, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + onDismiss, + ...layerProps + } = props; + const context = React.useContext(DismissableLayerContext); + const [node, setNode] = React.useState(null); + const ownerDocument = node?.ownerDocument ?? globalThis?.document; + const [, force] = React.useState({}); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node2) => setNode(node2)); + const layers = Array.from(context.layers); + const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); + const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); + const index = node ? layers.indexOf(node) : -1; + const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; + const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; + const pointerDownOutside = usePointerDownOutside((event) => { + const target = event.target; + const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target)); + if (!isPointerEventsEnabled || isPointerDownOnBranch) return; + onPointerDownOutside?.(event); + onInteractOutside?.(event); + if (!event.defaultPrevented) onDismiss?.(); + }, ownerDocument); + const focusOutside = useFocusOutside((event) => { + const target = event.target; + const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target)); + if (isFocusInBranch) return; + onFocusOutside?.(event); + onInteractOutside?.(event); + if (!event.defaultPrevented) onDismiss?.(); + }, ownerDocument); + (0, import_react_use_escape_keydown.useEscapeKeydown)((event) => { + const isHighestLayer = index === context.layers.size - 1; + if (!isHighestLayer) return; + onEscapeKeyDown?.(event); + if (!event.defaultPrevented && onDismiss) { + event.preventDefault(); + onDismiss(); + } + }, ownerDocument); + React.useEffect(() => { + if (!node) return; + if (disableOutsidePointerEvents) { + if (context.layersWithOutsidePointerEventsDisabled.size === 0) { + originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; + ownerDocument.body.style.pointerEvents = "none"; + } + context.layersWithOutsidePointerEventsDisabled.add(node); + } + context.layers.add(node); + dispatchUpdate(); + return () => { + if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) { + ownerDocument.body.style.pointerEvents = originalBodyPointerEvents; + } + }; + }, [node, ownerDocument, disableOutsidePointerEvents, context]); + React.useEffect(() => { + return () => { + if (!node) return; + context.layers.delete(node); + context.layersWithOutsidePointerEventsDisabled.delete(node); + dispatchUpdate(); + }; + }, [node, context]); + React.useEffect(() => { + const handleUpdate = () => force({}); + document.addEventListener(CONTEXT_UPDATE, handleUpdate); + return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate); + }, []); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_react_primitive.Primitive.div, + { + ...layerProps, + ref: composedRefs, + style: { + pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0, + ...props.style + }, + onFocusCapture: (0, import_primitive.composeEventHandlers)(props.onFocusCapture, focusOutside.onFocusCapture), + onBlurCapture: (0, import_primitive.composeEventHandlers)(props.onBlurCapture, focusOutside.onBlurCapture), + onPointerDownCapture: (0, import_primitive.composeEventHandlers)( + props.onPointerDownCapture, + pointerDownOutside.onPointerDownCapture + ) + } + ); + } +); +DismissableLayer.displayName = DISMISSABLE_LAYER_NAME; +var BRANCH_NAME = "DismissableLayerBranch"; +var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => { + const context = React.useContext(DismissableLayerContext); + const ref = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref); + React.useEffect(() => { + const node = ref.current; + if (node) { + context.branches.add(node); + return () => { + context.branches.delete(node); + }; + } + }, [context.branches]); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...props, ref: composedRefs }); +}); +DismissableLayerBranch.displayName = BRANCH_NAME; +function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) { + const handlePointerDownOutside = (0, import_react_use_callback_ref.useCallbackRef)(onPointerDownOutside); + const isPointerInsideReactTreeRef = React.useRef(false); + const handleClickRef = React.useRef(() => { + }); + React.useEffect(() => { + const handlePointerDown = (event) => { + if (event.target && !isPointerInsideReactTreeRef.current) { + let handleAndDispatchPointerDownOutsideEvent2 = function() { + handleAndDispatchCustomEvent( + POINTER_DOWN_OUTSIDE, + handlePointerDownOutside, + eventDetail, + { discrete: true } + ); + }; + var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2; + const eventDetail = { originalEvent: event }; + if (event.pointerType === "touch") { + ownerDocument.removeEventListener("click", handleClickRef.current); + handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2; + ownerDocument.addEventListener("click", handleClickRef.current, { once: true }); + } else { + handleAndDispatchPointerDownOutsideEvent2(); + } + } else { + ownerDocument.removeEventListener("click", handleClickRef.current); + } + isPointerInsideReactTreeRef.current = false; + }; + const timerId = window.setTimeout(() => { + ownerDocument.addEventListener("pointerdown", handlePointerDown); + }, 0); + return () => { + window.clearTimeout(timerId); + ownerDocument.removeEventListener("pointerdown", handlePointerDown); + ownerDocument.removeEventListener("click", handleClickRef.current); + }; + }, [ownerDocument, handlePointerDownOutside]); + return { + // ensures we check React component tree (not just DOM tree) + onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true + }; +} +function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) { + const handleFocusOutside = (0, import_react_use_callback_ref.useCallbackRef)(onFocusOutside); + const isFocusInsideReactTreeRef = React.useRef(false); + React.useEffect(() => { + const handleFocus = (event) => { + if (event.target && !isFocusInsideReactTreeRef.current) { + const eventDetail = { originalEvent: event }; + handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { + discrete: false + }); + } + }; + ownerDocument.addEventListener("focusin", handleFocus); + return () => ownerDocument.removeEventListener("focusin", handleFocus); + }, [ownerDocument, handleFocusOutside]); + return { + onFocusCapture: () => isFocusInsideReactTreeRef.current = true, + onBlurCapture: () => isFocusInsideReactTreeRef.current = false + }; +} +function dispatchUpdate() { + const event = new CustomEvent(CONTEXT_UPDATE); + document.dispatchEvent(event); +} +function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) { + const target = detail.originalEvent.target; + const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail }); + if (handler) target.addEventListener(name, handler, { once: true }); + if (discrete) { + (0, import_react_primitive.dispatchDiscreteCustomEvent)(target, event); + } else { + target.dispatchEvent(event); + } +} +var Root = DismissableLayer; +var Branch = DismissableLayerBranch; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map b/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map new file mode 100644 index 0000000..0ec9936 --- /dev/null +++ b/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/dismissable-layer.tsx"], + "sourcesContent": ["'use client';\nexport {\n DismissableLayer,\n DismissableLayerBranch,\n //\n Root,\n Branch,\n} from './dismissable-layer';\nexport type { DismissableLayerProps } from './dismissable-layer';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useEscapeKeydown } from '@radix-ui/react-use-escape-keydown';\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayer\n * -----------------------------------------------------------------------------------------------*/\n\nconst DISMISSABLE_LAYER_NAME = 'DismissableLayer';\nconst CONTEXT_UPDATE = 'dismissableLayer.update';\nconst POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';\nconst FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';\n\nlet originalBodyPointerEvents: string;\n\nconst DismissableLayerContext = React.createContext({\n layers: new Set(),\n layersWithOutsidePointerEventsDisabled: new Set(),\n branches: new Set(),\n});\n\ntype DismissableLayerElement = React.ElementRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface DismissableLayerProps extends PrimitiveDivProps {\n /**\n * When `true`, hover/focus/click interactions will be disabled on elements outside\n * the `DismissableLayer`. Users will need to click twice on outside elements to\n * interact with them: once to close the `DismissableLayer`, and again to trigger the element.\n */\n disableOutsidePointerEvents?: boolean;\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;\n /**\n * Event handler called when the focus moves outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onFocusOutside?: (event: FocusOutsideEvent) => void;\n /**\n * Event handler called when an interaction happens outside the `DismissableLayer`.\n * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.\n * Can be prevented.\n */\n onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;\n /**\n * Handler called when the `DismissableLayer` should be dismissed\n */\n onDismiss?: () => void;\n}\n\nconst DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node) => setNode(node));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); // prettier-ignore\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target as HTMLElement;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n\n const focusOutside = useFocusOutside((event) => {\n const target = event.target as HTMLElement;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = 'none';\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (\n disableOutsidePointerEvents &&\n context.layersWithOutsidePointerEventsDisabled.size === 1\n ) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n\n /**\n * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect\n * because a change to `disableOutsidePointerEvents` would remove this layer from the stack\n * and add it to the end again so the layering order wouldn't be _creation order_.\n * We only want them to be removed from context stacks when unmounted.\n */\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n\n return (\n \n );\n }\n);\n\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayerBranch\n * -----------------------------------------------------------------------------------------------*/\n\nconst BRANCH_NAME = 'DismissableLayerBranch';\n\ntype DismissableLayerBranchElement = React.ElementRef;\ninterface DismissableLayerBranchProps extends PrimitiveDivProps {}\n\nconst DismissableLayerBranch = React.forwardRef<\n DismissableLayerBranchElement,\n DismissableLayerBranchProps\n>((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n\n return ;\n});\n\nDismissableLayerBranch.displayName = BRANCH_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PointerDownOutsideEvent = CustomEvent<{ originalEvent: PointerEvent }>;\ntype FocusOutsideEvent = CustomEvent<{ originalEvent: FocusEvent }>;\n\n/**\n * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`\n * to mimic layer dismissing behaviour present in OS.\n * Returns props to pass to the node we want to check for outside events.\n */\nfunction usePointerDownOutside(\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside) as EventListener;\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {});\n\n React.useEffect(() => {\n const handlePointerDown = (event: PointerEvent) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n\n function handleAndDispatchPointerDownOutsideEvent() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n }\n\n /**\n * On touch devices, we need to wait for a click event because browsers implement\n * a ~350ms delay between the time the user stops touching the display and when the\n * browser executres events. We need to ensure we don't reactivate pointer-events within\n * this timeframe otherwise the browser may execute events that should have been prevented.\n *\n * Additionally, this also lets us deal automatically with cancellations when a click event\n * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.\n *\n * This is why we also continuously remove the previous listener, because we cannot be\n * certain that it was raised, and therefore cleaned-up.\n */\n if (event.pointerType === 'touch') {\n ownerDocument.removeEventListener('click', handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;\n ownerDocument.addEventListener('click', handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent();\n }\n } else {\n // We need to remove the event listener in case the outside click has been canceled.\n // See: https://github.com/radix-ui/primitives/issues/2171\n ownerDocument.removeEventListener('click', handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n /**\n * if this hook executes in a component that mounts via a `pointerdown` event, the event\n * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid\n * this by delaying the event listener registration on the document.\n * This is not React specific, but rather how the DOM works, ie:\n * ```\n * button.addEventListener('pointerdown', () => {\n * console.log('I will log');\n * document.addEventListener('pointerdown', () => {\n * console.log('I will also log');\n * })\n * });\n */\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener('pointerdown', handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener('pointerdown', handlePointerDown);\n ownerDocument.removeEventListener('click', handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => (isPointerInsideReactTreeRef.current = true),\n };\n}\n\n/**\n * Listens for when focus happens outside a react subtree.\n * Returns props to pass to the root (node) of the subtree we want to check.\n */\nfunction useFocusOutside(\n onFocusOutside?: (event: FocusOutsideEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const handleFocusOutside = useCallbackRef(onFocusOutside) as EventListener;\n const isFocusInsideReactTreeRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleFocus = (event: FocusEvent) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false,\n });\n }\n };\n ownerDocument.addEventListener('focusin', handleFocus);\n return () => ownerDocument.removeEventListener('focusin', handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n\n return {\n onFocusCapture: () => (isFocusInsideReactTreeRef.current = true),\n onBlurCapture: () => (isFocusInsideReactTreeRef.current = false),\n };\n}\n\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\n\nfunction handleAndDispatchCustomEvent(\n name: string,\n handler: ((event: E) => void) | undefined,\n detail: { originalEvent: OriginalEvent } & (E extends CustomEvent ? D : never),\n { discrete }: { discrete: boolean }\n) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler as EventListener, { once: true });\n\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\n\nconst Root = DismissableLayer;\nconst Branch = DismissableLayerBranch;\n\nexport {\n DismissableLayer,\n DismissableLayerBranch,\n //\n Root,\n Branch,\n};\nexport type { DismissableLayerProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,6BAAuD;AACvD,gCAAgC;AAChC,oCAA+B;AAC/B,sCAAiC;AAqJ3B;AA/IN,IAAM,yBAAyB;AAC/B,IAAM,iBAAiB;AACvB,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB;AAEtB,IAAI;AAEJ,IAAM,0BAAgC,oBAAc;AAAA,EAClD,QAAQ,oBAAI,IAA6B;AAAA,EACzC,wCAAwC,oBAAI,IAA6B;AAAA,EACzE,UAAU,oBAAI,IAAmC;AACnD,CAAC;AAsCD,IAAM,mBAAyB;AAAA,EAC7B,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,8BAA8B;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,IAAI;AACJ,UAAM,UAAgB,iBAAW,uBAAuB;AACxD,UAAM,CAAC,MAAM,OAAO,IAAU,eAAyC,IAAI;AAC3E,UAAM,gBAAgB,MAAM,iBAAiB,YAAY;AACzD,UAAM,CAAC,EAAE,KAAK,IAAU,eAAS,CAAC,CAAC;AACnC,UAAM,mBAAe,2CAAgB,cAAc,CAACA,UAAS,QAAQA,KAAI,CAAC;AAC1E,UAAM,SAAS,MAAM,KAAK,QAAQ,MAAM;AACxC,UAAM,CAAC,4CAA4C,IAA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radix-ui/react-dismissable-layer/dist/index.mjs b/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs new file mode 100644 index 0000000..8706e05 --- /dev/null +++ b/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs @@ -0,0 +1,221 @@ +"use client"; + +// packages/react/dismissable-layer/src/dismissable-layer.tsx +import * as React from "react"; +import { composeEventHandlers } from "@radix-ui/primitive"; +import { Primitive, dispatchDiscreteCustomEvent } from "@radix-ui/react-primitive"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +import { useEscapeKeydown } from "@radix-ui/react-use-escape-keydown"; +import { jsx } from "react/jsx-runtime"; +var DISMISSABLE_LAYER_NAME = "DismissableLayer"; +var CONTEXT_UPDATE = "dismissableLayer.update"; +var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside"; +var FOCUS_OUTSIDE = "dismissableLayer.focusOutside"; +var originalBodyPointerEvents; +var DismissableLayerContext = React.createContext({ + layers: /* @__PURE__ */ new Set(), + layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), + branches: /* @__PURE__ */ new Set() +}); +var DismissableLayer = React.forwardRef( + (props, forwardedRef) => { + const { + disableOutsidePointerEvents = false, + onEscapeKeyDown, + onPointerDownOutside, + onFocusOutside, + onInteractOutside, + onDismiss, + ...layerProps + } = props; + const context = React.useContext(DismissableLayerContext); + const [node, setNode] = React.useState(null); + const ownerDocument = node?.ownerDocument ?? globalThis?.document; + const [, force] = React.useState({}); + const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2)); + const layers = Array.from(context.layers); + const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); + const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); + const index = node ? layers.indexOf(node) : -1; + const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; + const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; + const pointerDownOutside = usePointerDownOutside((event) => { + const target = event.target; + const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target)); + if (!isPointerEventsEnabled || isPointerDownOnBranch) return; + onPointerDownOutside?.(event); + onInteractOutside?.(event); + if (!event.defaultPrevented) onDismiss?.(); + }, ownerDocument); + const focusOutside = useFocusOutside((event) => { + const target = event.target; + const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target)); + if (isFocusInBranch) return; + onFocusOutside?.(event); + onInteractOutside?.(event); + if (!event.defaultPrevented) onDismiss?.(); + }, ownerDocument); + useEscapeKeydown((event) => { + const isHighestLayer = index === context.layers.size - 1; + if (!isHighestLayer) return; + onEscapeKeyDown?.(event); + if (!event.defaultPrevented && onDismiss) { + event.preventDefault(); + onDismiss(); + } + }, ownerDocument); + React.useEffect(() => { + if (!node) return; + if (disableOutsidePointerEvents) { + if (context.layersWithOutsidePointerEventsDisabled.size === 0) { + originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; + ownerDocument.body.style.pointerEvents = "none"; + } + context.layersWithOutsidePointerEventsDisabled.add(node); + } + context.layers.add(node); + dispatchUpdate(); + return () => { + if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) { + ownerDocument.body.style.pointerEvents = originalBodyPointerEvents; + } + }; + }, [node, ownerDocument, disableOutsidePointerEvents, context]); + React.useEffect(() => { + return () => { + if (!node) return; + context.layers.delete(node); + context.layersWithOutsidePointerEventsDisabled.delete(node); + dispatchUpdate(); + }; + }, [node, context]); + React.useEffect(() => { + const handleUpdate = () => force({}); + document.addEventListener(CONTEXT_UPDATE, handleUpdate); + return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate); + }, []); + return /* @__PURE__ */ jsx( + Primitive.div, + { + ...layerProps, + ref: composedRefs, + style: { + pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0, + ...props.style + }, + onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture), + onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture), + onPointerDownCapture: composeEventHandlers( + props.onPointerDownCapture, + pointerDownOutside.onPointerDownCapture + ) + } + ); + } +); +DismissableLayer.displayName = DISMISSABLE_LAYER_NAME; +var BRANCH_NAME = "DismissableLayerBranch"; +var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => { + const context = React.useContext(DismissableLayerContext); + const ref = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref); + React.useEffect(() => { + const node = ref.current; + if (node) { + context.branches.add(node); + return () => { + context.branches.delete(node); + }; + } + }, [context.branches]); + return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs }); +}); +DismissableLayerBranch.displayName = BRANCH_NAME; +function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) { + const handlePointerDownOutside = useCallbackRef(onPointerDownOutside); + const isPointerInsideReactTreeRef = React.useRef(false); + const handleClickRef = React.useRef(() => { + }); + React.useEffect(() => { + const handlePointerDown = (event) => { + if (event.target && !isPointerInsideReactTreeRef.current) { + let handleAndDispatchPointerDownOutsideEvent2 = function() { + handleAndDispatchCustomEvent( + POINTER_DOWN_OUTSIDE, + handlePointerDownOutside, + eventDetail, + { discrete: true } + ); + }; + var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2; + const eventDetail = { originalEvent: event }; + if (event.pointerType === "touch") { + ownerDocument.removeEventListener("click", handleClickRef.current); + handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2; + ownerDocument.addEventListener("click", handleClickRef.current, { once: true }); + } else { + handleAndDispatchPointerDownOutsideEvent2(); + } + } else { + ownerDocument.removeEventListener("click", handleClickRef.current); + } + isPointerInsideReactTreeRef.current = false; + }; + const timerId = window.setTimeout(() => { + ownerDocument.addEventListener("pointerdown", handlePointerDown); + }, 0); + return () => { + window.clearTimeout(timerId); + ownerDocument.removeEventListener("pointerdown", handlePointerDown); + ownerDocument.removeEventListener("click", handleClickRef.current); + }; + }, [ownerDocument, handlePointerDownOutside]); + return { + // ensures we check React component tree (not just DOM tree) + onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true + }; +} +function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) { + const handleFocusOutside = useCallbackRef(onFocusOutside); + const isFocusInsideReactTreeRef = React.useRef(false); + React.useEffect(() => { + const handleFocus = (event) => { + if (event.target && !isFocusInsideReactTreeRef.current) { + const eventDetail = { originalEvent: event }; + handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { + discrete: false + }); + } + }; + ownerDocument.addEventListener("focusin", handleFocus); + return () => ownerDocument.removeEventListener("focusin", handleFocus); + }, [ownerDocument, handleFocusOutside]); + return { + onFocusCapture: () => isFocusInsideReactTreeRef.current = true, + onBlurCapture: () => isFocusInsideReactTreeRef.current = false + }; +} +function dispatchUpdate() { + const event = new CustomEvent(CONTEXT_UPDATE); + document.dispatchEvent(event); +} +function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) { + const target = detail.originalEvent.target; + const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail }); + if (handler) target.addEventListener(name, handler, { once: true }); + if (discrete) { + dispatchDiscreteCustomEvent(target, event); + } else { + target.dispatchEvent(event); + } +} +var Root = DismissableLayer; +var Branch = DismissableLayerBranch; +export { + Branch, + DismissableLayer, + DismissableLayerBranch, + Root +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map b/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map new file mode 100644 index 0000000..e2e5676 --- /dev/null +++ b/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/dismissable-layer.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useEscapeKeydown } from '@radix-ui/react-use-escape-keydown';\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayer\n * -----------------------------------------------------------------------------------------------*/\n\nconst DISMISSABLE_LAYER_NAME = 'DismissableLayer';\nconst CONTEXT_UPDATE = 'dismissableLayer.update';\nconst POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';\nconst FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';\n\nlet originalBodyPointerEvents: string;\n\nconst DismissableLayerContext = React.createContext({\n layers: new Set(),\n layersWithOutsidePointerEventsDisabled: new Set(),\n branches: new Set(),\n});\n\ntype DismissableLayerElement = React.ElementRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface DismissableLayerProps extends PrimitiveDivProps {\n /**\n * When `true`, hover/focus/click interactions will be disabled on elements outside\n * the `DismissableLayer`. Users will need to click twice on outside elements to\n * interact with them: once to close the `DismissableLayer`, and again to trigger the element.\n */\n disableOutsidePointerEvents?: boolean;\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;\n /**\n * Event handler called when the focus moves outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onFocusOutside?: (event: FocusOutsideEvent) => void;\n /**\n * Event handler called when an interaction happens outside the `DismissableLayer`.\n * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.\n * Can be prevented.\n */\n onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;\n /**\n * Handler called when the `DismissableLayer` should be dismissed\n */\n onDismiss?: () => void;\n}\n\nconst DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node) => setNode(node));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); // prettier-ignore\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target as HTMLElement;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n\n const focusOutside = useFocusOutside((event) => {\n const target = event.target as HTMLElement;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = 'none';\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (\n disableOutsidePointerEvents &&\n context.layersWithOutsidePointerEventsDisabled.size === 1\n ) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n\n /**\n * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect\n * because a change to `disableOutsidePointerEvents` would remove this layer from the stack\n * and add it to the end again so the layering order wouldn't be _creation order_.\n * We only want them to be removed from context stacks when unmounted.\n */\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n\n return (\n \n );\n }\n);\n\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayerBranch\n * -----------------------------------------------------------------------------------------------*/\n\nconst BRANCH_NAME = 'DismissableLayerBranch';\n\ntype DismissableLayerBranchElement = React.ElementRef;\ninterface DismissableLayerBranchProps extends PrimitiveDivProps {}\n\nconst DismissableLayerBranch = React.forwardRef<\n DismissableLayerBranchElement,\n DismissableLayerBranchProps\n>((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n\n return ;\n});\n\nDismissableLayerBranch.displayName = BRANCH_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype PointerDownOutsideEvent = CustomEvent<{ originalEvent: PointerEvent }>;\ntype FocusOutsideEvent = CustomEvent<{ originalEvent: FocusEvent }>;\n\n/**\n * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`\n * to mimic layer dismissing behaviour present in OS.\n * Returns props to pass to the node we want to check for outside events.\n */\nfunction usePointerDownOutside(\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside) as EventListener;\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {});\n\n React.useEffect(() => {\n const handlePointerDown = (event: PointerEvent) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n\n function handleAndDispatchPointerDownOutsideEvent() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n }\n\n /**\n * On touch devices, we need to wait for a click event because browsers implement\n * a ~350ms delay between the time the user stops touching the display and when the\n * browser executres events. We need to ensure we don't reactivate pointer-events within\n * this timeframe otherwise the browser may execute events that should have been prevented.\n *\n * Additionally, this also lets us deal automatically with cancellations when a click event\n * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.\n *\n * This is why we also continuously remove the previous listener, because we cannot be\n * certain that it was raised, and therefore cleaned-up.\n */\n if (event.pointerType === 'touch') {\n ownerDocument.removeEventListener('click', handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;\n ownerDocument.addEventListener('click', handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent();\n }\n } else {\n // We need to remove the event listener in case the outside click has been canceled.\n // See: https://github.com/radix-ui/primitives/issues/2171\n ownerDocument.removeEventListener('click', handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n /**\n * if this hook executes in a component that mounts via a `pointerdown` event, the event\n * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid\n * this by delaying the event listener registration on the document.\n * This is not React specific, but rather how the DOM works, ie:\n * ```\n * button.addEventListener('pointerdown', () => {\n * console.log('I will log');\n * document.addEventListener('pointerdown', () => {\n * console.log('I will also log');\n * })\n * });\n */\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener('pointerdown', handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener('pointerdown', handlePointerDown);\n ownerDocument.removeEventListener('click', handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => (isPointerInsideReactTreeRef.current = true),\n };\n}\n\n/**\n * Listens for when focus happens outside a react subtree.\n * Returns props to pass to the root (node) of the subtree we want to check.\n */\nfunction useFocusOutside(\n onFocusOutside?: (event: FocusOutsideEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const handleFocusOutside = useCallbackRef(onFocusOutside) as EventListener;\n const isFocusInsideReactTreeRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleFocus = (event: FocusEvent) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false,\n });\n }\n };\n ownerDocument.addEventListener('focusin', handleFocus);\n return () => ownerDocument.removeEventListener('focusin', handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n\n return {\n onFocusCapture: () => (isFocusInsideReactTreeRef.current = true),\n onBlurCapture: () => (isFocusInsideReactTreeRef.current = false),\n };\n}\n\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\n\nfunction handleAndDispatchCustomEvent(\n name: string,\n handler: ((event: E) => void) | undefined,\n detail: { originalEvent: OriginalEvent } & (E extends CustomEvent ? D : never),\n { discrete }: { discrete: boolean }\n) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler as EventListener, { once: true });\n\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\n\nconst Root = DismissableLayer;\nconst Branch = DismissableLayerBranch;\n\nexport {\n DismissableLayer,\n DismissableLayerBranch,\n //\n Root,\n Branch,\n};\nexport type { DismissableLayerProps };\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,WAAW,mCAAmC;AACvD,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAqJ3B;AA/IN,IAAM,yBAAyB;AAC/B,IAAM,iBAAiB;AACvB,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB;AAEtB,IAAI;AAEJ,IAAM,0BAAgC,oBAAc;AAAA,EAClD,QAAQ,oBAAI,IAA6B;AAAA,EACzC,wCAAwC,oBAAI,IAA6B;AAAA,EACzE,UAAU,oBAAI,IAAmC;AACnD,CAAC;AAsCD,IAAM,mBAAyB;AAAA,EAC7B,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,8BAA8B;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,IAAI;AACJ,UAAM,UAAgB,iBAAW,uBAAuB;AACxD,UAAM,CAAC,MAAM,OAAO,IAAU,eAAyC,IAAI;AAC3E,UAAM,gBAAgB,MAAM,iBAAiB,YAAY;AACzD,UAAM,CAAC,EAAE,KAAK,IAAU,eAAS,CAAC,CAAC;AACnC,UAAM,eAAe,gBAAgB,cAAc,CAACA,UAAS,QAAQA,KAAI,CAAC;AAC1E,UAAM,SAAS,MAAM,KAAK,QAAQ,MAAM;AACxC,UAAM,CAAC,4CAA4C,IAAI,CAAC,GAAG,QAAQ,sCAAsC,EAAE,MAAM,EAAE;AACnH,UAAM,oDAAoD,OAAO,QAAQ,4CAA4C;AACrH,UAAM,QAAQ,OAAO,OAAO,QAAQ,IAAI,IAAI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A,SAAS,gBACP,gBACA,gBAA0B,YAAY,UACtC;AACA,QAAM,qBAAqB,eAAe,cAAc;AACxD,QAAM,4BAAkC,aAAO,KAAK;AAEpD,EAAM,gBAAU,MAAM;AACpB,UAAM,cAAc,CAAC,UAAsB;AACzC,UAAI,MAAM,UAAU,CAAC,0BAA0B,SAAS;AACtD,cAAM,cAAc,EAAE,eAAe,MAAM;AAC3C,qCAA6B,eAAe,oBAAoB,aAAa;AAAA,UAC3E,UAAU;AAAA,QACZ,CAAC;AAAA,MACH;AAAA,IACF;AACA,kBAAc,iBAAiB,WAAW,WAAW;AACrD,WAAO,MAAM,cAAc,oBAAoB,WAAW,WAAW;AAAA,EACvE,GAAG,CAAC,eAAe,kBAAkB,CAAC;AAEtC,SAAO;AAAA,IACL,gBAAgB,MAAO,0BAA0B,UAAU;AAAA,IAC3D,eAAe,MAAO,0BAA0B,UAAU;AAAA,EAC5D;AACF;AAEA,SAAS,iBAAiB;AACxB,QAAM,QAAQ,IAAI,YAAY,cAAc;AAC5C,WAAS,cAAc,KAAK;AAC9B;AAEA,SAAS,6BACP,MACA,SACA,QACA,EAAE,SAAS,GACX;AACA,QAAM,SAAS,OAAO,cAAc;AACpC,QAAM,QAAQ,IAAI,YAAY,MAAM,EAAE,SAAS,OAAO,YAAY,MAAM,OAAO,CAAC;AAChF,MAAI,QAAS,QAAO,iBAAiB,MAAM,SAA0B,EAAE,MAAM,KAAK,CAAC;AAEnF,MAAI,UAAU;AACZ,gCAA4B,QAAQ,KAAK;AAAA,EAC3C,OAAO;AACL,WAAO,cAAc,KAAK;AAAA,EAC5B;AACF;AAEA,IAAM,OAAO;AACb,IAAM,SAAS;", + "names": ["node", "handleAndDispatchPointerDownOutsideEvent"] +} diff --git a/node_modules/@radix-ui/react-dismissable-layer/package.json b/node_modules/@radix-ui/react-dismissable-layer/package.json new file mode 100644 index 0000000..4be2865 --- /dev/null +++ b/node_modules/@radix-ui/react-dismissable-layer/package.json @@ -0,0 +1,71 @@ +{ + "name": "@radix-ui/react-dismissable-layer", + "version": "1.1.5", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "lint": "eslint --max-warnings 0 src", + "clean": "rm -rf dist", + "version": "yarn version" + }, + "dependencies": { + "@radix-ui/primitive": "1.1.1", + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-primitive": "2.0.2", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-escape-keydown": "1.1.0" + }, + "devDependencies": { + "@repo/eslint-config": "0.0.0", + "@repo/typescript-config": "0.0.0", + "@types/react": "^19.0.7", + "@types/react-dom": "^19.0.3", + "eslint": "^9.18.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-remove-scroll": "^2.6.3", + "typescript": "^5.7.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-focus-guards/README.md b/node_modules/@radix-ui/react-focus-guards/README.md new file mode 100644 index 0000000..79155d1 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-guards/README.md @@ -0,0 +1,13 @@ +# `react-focus-guards` + +## Installation + +```sh +$ yarn add @radix-ui/react-focus-guards +# or +$ npm install @radix-ui/react-focus-guards +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-focus-guards/dist/index.d.mts b/node_modules/@radix-ui/react-focus-guards/dist/index.d.mts new file mode 100644 index 0000000..e198268 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-guards/dist/index.d.mts @@ -0,0 +1,9 @@ +declare function FocusGuards(props: any): any; +/** + * Injects a pair of focus guards at the edges of the whole DOM tree + * to ensure `focusin` & `focusout` events can be caught consistently. + */ +declare function useFocusGuards(): void; +declare const Root: typeof FocusGuards; + +export { FocusGuards, Root, useFocusGuards }; diff --git a/node_modules/@radix-ui/react-focus-guards/dist/index.d.ts b/node_modules/@radix-ui/react-focus-guards/dist/index.d.ts new file mode 100644 index 0000000..e198268 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-guards/dist/index.d.ts @@ -0,0 +1,9 @@ +declare function FocusGuards(props: any): any; +/** + * Injects a pair of focus guards at the edges of the whole DOM tree + * to ensure `focusin` & `focusout` events can be caught consistently. + */ +declare function useFocusGuards(): void; +declare const Root: typeof FocusGuards; + +export { FocusGuards, Root, useFocusGuards }; diff --git a/node_modules/@radix-ui/react-focus-guards/dist/index.js b/node_modules/@radix-ui/react-focus-guards/dist/index.js new file mode 100644 index 0000000..7cb1bb2 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-guards/dist/index.js @@ -0,0 +1,72 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/focus-guards/src/index.ts +var src_exports = {}; +__export(src_exports, { + FocusGuards: () => FocusGuards, + Root: () => Root, + useFocusGuards: () => useFocusGuards +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/focus-guards/src/FocusGuards.tsx +var React = __toESM(require("react")); +var count = 0; +function FocusGuards(props) { + useFocusGuards(); + return props.children; +} +function useFocusGuards() { + React.useEffect(() => { + const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]"); + document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard()); + document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard()); + count++; + return () => { + if (count === 1) { + document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove()); + } + count--; + }; + }, []); +} +function createFocusGuard() { + const element = document.createElement("span"); + element.setAttribute("data-radix-focus-guard", ""); + element.tabIndex = 0; + element.style.outline = "none"; + element.style.opacity = "0"; + element.style.position = "fixed"; + element.style.pointerEvents = "none"; + return element; +} +var Root = FocusGuards; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-focus-guards/dist/index.js.map b/node_modules/@radix-ui/react-focus-guards/dist/index.js.map new file mode 100644 index 0000000..f7e525e --- /dev/null +++ b/node_modules/@radix-ui/react-focus-guards/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/FocusGuards.tsx"], + "sourcesContent": ["'use client';\nexport {\n FocusGuards,\n //\n Root,\n //\n useFocusGuards,\n} from './FocusGuards';\n", "import * as React from 'react';\n\n/** Number of components which have requested interest to have focus guards */\nlet count = 0;\n\nfunction FocusGuards(props: any) {\n useFocusGuards();\n return props.children;\n}\n\n/**\n * Injects a pair of focus guards at the edges of the whole DOM tree\n * to ensure `focusin` & `focusout` events can be caught consistently.\n */\nfunction useFocusGuards() {\n React.useEffect(() => {\n const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');\n document.body.insertAdjacentElement('afterbegin', edgeGuards[0] ?? createFocusGuard());\n document.body.insertAdjacentElement('beforeend', edgeGuards[1] ?? createFocusGuard());\n count++;\n\n return () => {\n if (count === 1) {\n document.querySelectorAll('[data-radix-focus-guard]').forEach((node) => node.remove());\n }\n count--;\n };\n }, []);\n}\n\nfunction createFocusGuard() {\n const element = document.createElement('span');\n element.setAttribute('data-radix-focus-guard', '');\n element.tabIndex = 0;\n element.style.outline = 'none';\n element.style.opacity = '0';\n element.style.position = 'fixed';\n element.style.pointerEvents = 'none';\n return element;\n}\n\nconst Root = FocusGuards;\n\nexport {\n FocusGuards,\n //\n Root,\n //\n useFocusGuards,\n};\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAGvB,IAAI,QAAQ;AAEZ,SAAS,YAAY,OAAY;AAC/B,iBAAe;AACf,SAAO,MAAM;AACf;AAMA,SAAS,iBAAiB;AACxB,EAAM,gBAAU,MAAM;AACpB,UAAM,aAAa,SAAS,iBAAiB,0BAA0B;AACvE,aAAS,KAAK,sBAAsB,cAAc,WAAW,CAAC,KAAK,iBAAiB,CAAC;AACrF,aAAS,KAAK,sBAAsB,aAAa,WAAW,CAAC,KAAK,iBAAiB,CAAC;AACpF;AAEA,WAAO,MAAM;AACX,UAAI,UAAU,GAAG;AACf,iBAAS,iBAAiB,0BAA0B,EAAE,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC;AAAA,MACvF;AACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AACP;AAEA,SAAS,mBAAmB;AAC1B,QAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,UAAQ,aAAa,0BAA0B,EAAE;AACjD,UAAQ,WAAW;AACnB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,WAAW;AACzB,UAAQ,MAAM,gBAAgB;AAC9B,SAAO;AACT;AAEA,IAAM,OAAO;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-focus-guards/dist/index.mjs b/node_modules/@radix-ui/react-focus-guards/dist/index.mjs new file mode 100644 index 0000000..5789ce1 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-guards/dist/index.mjs @@ -0,0 +1,40 @@ +"use client"; + +// packages/react/focus-guards/src/FocusGuards.tsx +import * as React from "react"; +var count = 0; +function FocusGuards(props) { + useFocusGuards(); + return props.children; +} +function useFocusGuards() { + React.useEffect(() => { + const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]"); + document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard()); + document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard()); + count++; + return () => { + if (count === 1) { + document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove()); + } + count--; + }; + }, []); +} +function createFocusGuard() { + const element = document.createElement("span"); + element.setAttribute("data-radix-focus-guard", ""); + element.tabIndex = 0; + element.style.outline = "none"; + element.style.opacity = "0"; + element.style.position = "fixed"; + element.style.pointerEvents = "none"; + return element; +} +var Root = FocusGuards; +export { + FocusGuards, + Root, + useFocusGuards +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map b/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map new file mode 100644 index 0000000..e1b50f7 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/FocusGuards.tsx"], + "sourcesContent": ["import * as React from 'react';\n\n/** Number of components which have requested interest to have focus guards */\nlet count = 0;\n\nfunction FocusGuards(props: any) {\n useFocusGuards();\n return props.children;\n}\n\n/**\n * Injects a pair of focus guards at the edges of the whole DOM tree\n * to ensure `focusin` & `focusout` events can be caught consistently.\n */\nfunction useFocusGuards() {\n React.useEffect(() => {\n const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');\n document.body.insertAdjacentElement('afterbegin', edgeGuards[0] ?? createFocusGuard());\n document.body.insertAdjacentElement('beforeend', edgeGuards[1] ?? createFocusGuard());\n count++;\n\n return () => {\n if (count === 1) {\n document.querySelectorAll('[data-radix-focus-guard]').forEach((node) => node.remove());\n }\n count--;\n };\n }, []);\n}\n\nfunction createFocusGuard() {\n const element = document.createElement('span');\n element.setAttribute('data-radix-focus-guard', '');\n element.tabIndex = 0;\n element.style.outline = 'none';\n element.style.opacity = '0';\n element.style.position = 'fixed';\n element.style.pointerEvents = 'none';\n return element;\n}\n\nconst Root = FocusGuards;\n\nexport {\n FocusGuards,\n //\n Root,\n //\n useFocusGuards,\n};\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AAGvB,IAAI,QAAQ;AAEZ,SAAS,YAAY,OAAY;AAC/B,iBAAe;AACf,SAAO,MAAM;AACf;AAMA,SAAS,iBAAiB;AACxB,EAAM,gBAAU,MAAM;AACpB,UAAM,aAAa,SAAS,iBAAiB,0BAA0B;AACvE,aAAS,KAAK,sBAAsB,cAAc,WAAW,CAAC,KAAK,iBAAiB,CAAC;AACrF,aAAS,KAAK,sBAAsB,aAAa,WAAW,CAAC,KAAK,iBAAiB,CAAC;AACpF;AAEA,WAAO,MAAM;AACX,UAAI,UAAU,GAAG;AACf,iBAAS,iBAAiB,0BAA0B,EAAE,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC;AAAA,MACvF;AACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AACP;AAEA,SAAS,mBAAmB;AAC1B,QAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,UAAQ,aAAa,0BAA0B,EAAE;AACjD,UAAQ,WAAW;AACnB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,WAAW;AACzB,UAAQ,MAAM,gBAAgB;AAC9B,SAAO;AACT;AAEA,IAAM,OAAO;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-focus-guards/package.json b/node_modules/@radix-ui/react-focus-guards/package.json new file mode 100644 index 0000000..a75c3b5 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-guards/package.json @@ -0,0 +1,47 @@ +{ + "name": "@radix-ui/react-focus-guards", + "version": "1.1.1", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf dist", + "version": "yarn version" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-focus-scope/README.md b/node_modules/@radix-ui/react-focus-scope/README.md new file mode 100644 index 0000000..df2826a --- /dev/null +++ b/node_modules/@radix-ui/react-focus-scope/README.md @@ -0,0 +1,13 @@ +# `react-focus-scope` + +## Installation + +```sh +$ yarn add @radix-ui/react-focus-scope +# or +$ npm install @radix-ui/react-focus-scope +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-focus-scope/dist/index.d.mts b/node_modules/@radix-ui/react-focus-scope/dist/index.d.mts new file mode 100644 index 0000000..f35f997 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-scope/dist/index.d.mts @@ -0,0 +1,32 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface FocusScopeProps extends PrimitiveDivProps { + /** + * When `true`, tabbing from last item will focus first tabbable + * and shift+tab from first item will focus last tababble. + * @defaultValue false + */ + loop?: boolean; + /** + * When `true`, focus cannot escape the focus scope via keyboard, + * pointer, or a programmatic focus. + * @defaultValue false + */ + trapped?: boolean; + /** + * Event handler called when auto-focusing on mount. + * Can be prevented. + */ + onMountAutoFocus?: (event: Event) => void; + /** + * Event handler called when auto-focusing on unmount. + * Can be prevented. + */ + onUnmountAutoFocus?: (event: Event) => void; +} +declare const FocusScope: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { FocusScope, type FocusScopeProps, Root }; diff --git a/node_modules/@radix-ui/react-focus-scope/dist/index.d.ts b/node_modules/@radix-ui/react-focus-scope/dist/index.d.ts new file mode 100644 index 0000000..f35f997 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-scope/dist/index.d.ts @@ -0,0 +1,32 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface FocusScopeProps extends PrimitiveDivProps { + /** + * When `true`, tabbing from last item will focus first tabbable + * and shift+tab from first item will focus last tababble. + * @defaultValue false + */ + loop?: boolean; + /** + * When `true`, focus cannot escape the focus scope via keyboard, + * pointer, or a programmatic focus. + * @defaultValue false + */ + trapped?: boolean; + /** + * Event handler called when auto-focusing on mount. + * Can be prevented. + */ + onMountAutoFocus?: (event: Event) => void; + /** + * Event handler called when auto-focusing on unmount. + * Can be prevented. + */ + onUnmountAutoFocus?: (event: Event) => void; +} +declare const FocusScope: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { FocusScope, type FocusScopeProps, Root }; diff --git a/node_modules/@radix-ui/react-focus-scope/dist/index.js b/node_modules/@radix-ui/react-focus-scope/dist/index.js new file mode 100644 index 0000000..2a9d991 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-scope/dist/index.js @@ -0,0 +1,246 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/focus-scope/src/index.ts +var src_exports = {}; +__export(src_exports, { + FocusScope: () => FocusScope, + Root: () => Root +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/focus-scope/src/focus-scope.tsx +var React = __toESM(require("react")); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +var import_jsx_runtime = require("react/jsx-runtime"); +var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount"; +var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount"; +var EVENT_OPTIONS = { bubbles: false, cancelable: true }; +var FOCUS_SCOPE_NAME = "FocusScope"; +var FocusScope = React.forwardRef((props, forwardedRef) => { + const { + loop = false, + trapped = false, + onMountAutoFocus: onMountAutoFocusProp, + onUnmountAutoFocus: onUnmountAutoFocusProp, + ...scopeProps + } = props; + const [container, setContainer] = React.useState(null); + const onMountAutoFocus = (0, import_react_use_callback_ref.useCallbackRef)(onMountAutoFocusProp); + const onUnmountAutoFocus = (0, import_react_use_callback_ref.useCallbackRef)(onUnmountAutoFocusProp); + const lastFocusedElementRef = React.useRef(null); + const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node) => setContainer(node)); + const focusScope = React.useRef({ + paused: false, + pause() { + this.paused = true; + }, + resume() { + this.paused = false; + } + }).current; + React.useEffect(() => { + if (trapped) { + let handleFocusIn2 = function(event) { + if (focusScope.paused || !container) return; + const target = event.target; + if (container.contains(target)) { + lastFocusedElementRef.current = target; + } else { + focus(lastFocusedElementRef.current, { select: true }); + } + }, handleFocusOut2 = function(event) { + if (focusScope.paused || !container) return; + const relatedTarget = event.relatedTarget; + if (relatedTarget === null) return; + if (!container.contains(relatedTarget)) { + focus(lastFocusedElementRef.current, { select: true }); + } + }, handleMutations2 = function(mutations) { + const focusedElement = document.activeElement; + if (focusedElement !== document.body) return; + for (const mutation of mutations) { + if (mutation.removedNodes.length > 0) focus(container); + } + }; + var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2; + document.addEventListener("focusin", handleFocusIn2); + document.addEventListener("focusout", handleFocusOut2); + const mutationObserver = new MutationObserver(handleMutations2); + if (container) mutationObserver.observe(container, { childList: true, subtree: true }); + return () => { + document.removeEventListener("focusin", handleFocusIn2); + document.removeEventListener("focusout", handleFocusOut2); + mutationObserver.disconnect(); + }; + } + }, [trapped, container, focusScope.paused]); + React.useEffect(() => { + if (container) { + focusScopesStack.add(focusScope); + const previouslyFocusedElement = document.activeElement; + const hasFocusedCandidate = container.contains(previouslyFocusedElement); + if (!hasFocusedCandidate) { + const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS); + container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); + container.dispatchEvent(mountEvent); + if (!mountEvent.defaultPrevented) { + focusFirst(removeLinks(getTabbableCandidates(container)), { select: true }); + if (document.activeElement === previouslyFocusedElement) { + focus(container); + } + } + } + return () => { + container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); + setTimeout(() => { + const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS); + container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); + container.dispatchEvent(unmountEvent); + if (!unmountEvent.defaultPrevented) { + focus(previouslyFocusedElement ?? document.body, { select: true }); + } + container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); + focusScopesStack.remove(focusScope); + }, 0); + }; + } + }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]); + const handleKeyDown = React.useCallback( + (event) => { + if (!loop && !trapped) return; + if (focusScope.paused) return; + const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey; + const focusedElement = document.activeElement; + if (isTabKey && focusedElement) { + const container2 = event.currentTarget; + const [first, last] = getTabbableEdges(container2); + const hasTabbableElementsInside = first && last; + if (!hasTabbableElementsInside) { + if (focusedElement === container2) event.preventDefault(); + } else { + if (!event.shiftKey && focusedElement === last) { + event.preventDefault(); + if (loop) focus(first, { select: true }); + } else if (event.shiftKey && focusedElement === first) { + event.preventDefault(); + if (loop) focus(last, { select: true }); + } + } + } + }, + [loop, trapped, focusScope.paused] + ); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown }); +}); +FocusScope.displayName = FOCUS_SCOPE_NAME; +function focusFirst(candidates, { select = false } = {}) { + const previouslyFocusedElement = document.activeElement; + for (const candidate of candidates) { + focus(candidate, { select }); + if (document.activeElement !== previouslyFocusedElement) return; + } +} +function getTabbableEdges(container) { + const candidates = getTabbableCandidates(container); + const first = findVisible(candidates, container); + const last = findVisible(candidates.reverse(), container); + return [first, last]; +} +function getTabbableCandidates(container) { + const nodes = []; + const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { + acceptNode: (node) => { + const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden"; + if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; + return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } + }); + while (walker.nextNode()) nodes.push(walker.currentNode); + return nodes; +} +function findVisible(elements, container) { + for (const element of elements) { + if (!isHidden(element, { upTo: container })) return element; + } +} +function isHidden(node, { upTo }) { + if (getComputedStyle(node).visibility === "hidden") return true; + while (node) { + if (upTo !== void 0 && node === upTo) return false; + if (getComputedStyle(node).display === "none") return true; + node = node.parentElement; + } + return false; +} +function isSelectableInput(element) { + return element instanceof HTMLInputElement && "select" in element; +} +function focus(element, { select = false } = {}) { + if (element && element.focus) { + const previouslyFocusedElement = document.activeElement; + element.focus({ preventScroll: true }); + if (element !== previouslyFocusedElement && isSelectableInput(element) && select) + element.select(); + } +} +var focusScopesStack = createFocusScopesStack(); +function createFocusScopesStack() { + let stack = []; + return { + add(focusScope) { + const activeFocusScope = stack[0]; + if (focusScope !== activeFocusScope) { + activeFocusScope?.pause(); + } + stack = arrayRemove(stack, focusScope); + stack.unshift(focusScope); + }, + remove(focusScope) { + stack = arrayRemove(stack, focusScope); + stack[0]?.resume(); + } + }; +} +function arrayRemove(array, item) { + const updatedArray = [...array]; + const index = updatedArray.indexOf(item); + if (index !== -1) { + updatedArray.splice(index, 1); + } + return updatedArray; +} +function removeLinks(items) { + return items.filter((item) => item.tagName !== "A"); +} +var Root = FocusScope; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-focus-scope/dist/index.js.map b/node_modules/@radix-ui/react-focus-scope/dist/index.js.map new file mode 100644 index 0000000..3977152 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-scope/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/focus-scope.tsx"], + "sourcesContent": ["'use client';\nexport {\n FocusScope,\n //\n Root,\n} from './focus-scope';\nexport type { FocusScopeProps } from './focus-scope';\n", "import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\nconst AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';\nconst AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\ntype FocusableTarget = HTMLElement | { focus(): void };\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope\n * -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_SCOPE_NAME = 'FocusScope';\n\ntype FocusScopeElement = React.ElementRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface FocusScopeProps extends PrimitiveDivProps {\n /**\n * When `true`, tabbing from last item will focus first tabbable\n * and shift+tab from first item will focus last tababble.\n * @defaultValue false\n */\n loop?: boolean;\n\n /**\n * When `true`, focus cannot escape the focus scope via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapped?: boolean;\n\n /**\n * Event handler called when auto-focusing on mount.\n * Can be prevented.\n */\n onMountAutoFocus?: (event: Event) => void;\n\n /**\n * Event handler called when auto-focusing on unmount.\n * Can be prevented.\n */\n onUnmountAutoFocus?: (event: Event) => void;\n}\n\nconst FocusScope = React.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n },\n }).current;\n\n // Takes care of trapping focus if focus is moved outside programmatically for example\n React.useEffect(() => {\n if (trapped) {\n function handleFocusIn(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const target = event.target as HTMLElement | null;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n function handleFocusOut(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget as HTMLElement | null;\n\n // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:\n //\n // 1. When the user switches app/tabs/windows/the browser itself loses focus.\n // 2. In Google Chrome, when the focused element is removed from the DOM.\n //\n // We let the browser do its thing here because:\n //\n // 1. The browser already keeps a memory of what's focused for when the page gets refocused.\n // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it\n // throws the CPU to 100%, so we avoid doing anything for this reason here too.\n if (relatedTarget === null) return;\n\n // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)\n // that is outside the container, we move focus to the last valid focused element inside.\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n // When the focused element gets removed from the DOM, browsers move focus\n // back to the document.body. In this case, we move focus to the container\n // to keep focus trapped correctly.\n function handleMutations(mutations: MutationRecord[]) {\n const focusedElement = document.activeElement as HTMLElement | null;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n }\n\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n const mutationObserver = new MutationObserver(handleMutations);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n\n return () => {\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n\n // We hit a react bug (fixed in v17) with focusing in unmount.\n // We need to delay the focus a little to get around it for now.\n // See: https://github.com/facebook/react/issues/17894\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n // we need to remove the listener after we `dispatchEvent`\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n\n // Takes care of looping focus (when tabbing whilst at the edges)\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n\n return (\n \n );\n});\n\nFocusScope.displayName = FOCUS_SCOPE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Attempts focusing the first element in a list of candidates.\n * Stops when focus has actually moved.\n */\nfunction focusFirst(candidates: HTMLElement[], { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\n\n/**\n * Returns the first and last tabbable elements inside a container.\n */\nfunction getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last] as const;\n}\n\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nfunction getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n\n/**\n * Returns the first visible element in a list.\n * NOTE: Only checks visibility up to the `container`.\n */\nfunction findVisible(elements: HTMLElement[], container: HTMLElement) {\n for (const element of elements) {\n // we stop checking if it's hidden at the `container` level (excluding)\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\n\nfunction isHidden(node: HTMLElement, { upTo }: { upTo?: HTMLElement }) {\n if (getComputedStyle(node).visibility === 'hidden') return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (upTo !== undefined && node === upTo) return false;\n if (getComputedStyle(node).display === 'none') return true;\n node = node.parentElement as HTMLElement;\n }\n return false;\n}\n\nfunction isSelectableInput(element: any): element is FocusableTarget & { select: () => void } {\n return element instanceof HTMLInputElement && 'select' in element;\n}\n\nfunction focus(element?: FocusableTarget | null, { select = false } = {}) {\n // only focus if that element is focusable\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users\n element.focus({ preventScroll: true });\n // only select if its not the same element, it supports selection and we need to select\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope stack\n * -----------------------------------------------------------------------------------------------*/\n\ntype FocusScopeAPI = { paused: boolean; pause(): void; resume(): void };\nconst focusScopesStack = createFocusScopesStack();\n\nfunction createFocusScopesStack() {\n /** A stack of focus scopes, with the active one at the top */\n let stack: FocusScopeAPI[] = [];\n\n return {\n add(focusScope: FocusScopeAPI) {\n // pause the currently active focus scope (at the top of the stack)\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n // remove in case it already exists (because we'll re-add it at the top of the stack)\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n\n remove(focusScope: FocusScopeAPI) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n },\n };\n}\n\nfunction arrayRemove(array: T[], item: T) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\n\nfunction removeLinks(items: HTMLElement[]) {\n return items.filter((item) => item.tagName !== 'A');\n}\n\nconst Root = FocusScope;\n\nexport {\n FocusScope,\n //\n Root,\n};\nexport type { FocusScopeProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,gCAAgC;AAChC,6BAA0B;AAC1B,oCAA+B;AAwM3B;AAtMJ,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB,EAAE,SAAS,OAAO,YAAY,KAAK;AAQzD,IAAM,mBAAmB;AAgCzB,IAAM,aAAmB,iBAA+C,CAAC,OAAO,iBAAiB;AAC/F,QAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,CAAC,WAAW,YAAY,IAAU,eAA6B,IAAI;AACzE,QAAM,uBAAmB,8CAAe,oBAAoB;AAC5D,QAAM,yBAAqB,8CAAe,sBAAsB;AAChE,QAAM,wBAA8B,aAA2B,IAAI;AACnE,QAAM,mBAAe,2CAAgB,cAAc,CAAC,SAAS,aAAa,IAAI,C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YAAY,OAAO,UAAU;AACrC,YAAM,CAAC,GAAG,OAAO;AAAA,IACnB;AAAA,EACF;AACF;AAEA,SAAS,YAAe,OAAY,MAAS;AAC3C,QAAM,eAAe,CAAC,GAAG,KAAK;AAC9B,QAAM,QAAQ,aAAa,QAAQ,IAAI;AACvC,MAAI,UAAU,IAAI;AAChB,iBAAa,OAAO,OAAO,CAAC;AAAA,EAC9B;AACA,SAAO;AACT;AAEA,SAAS,YAAY,OAAsB;AACzC,SAAO,MAAM,OAAO,CAAC,SAAS,KAAK,YAAY,GAAG;AACpD;AAEA,IAAM,OAAO;", + "names": ["handleFocusIn", "handleFocusOut", "handleMutations", "container"] +} diff --git a/node_modules/@radix-ui/react-focus-scope/dist/index.mjs b/node_modules/@radix-ui/react-focus-scope/dist/index.mjs new file mode 100644 index 0000000..ff976eb --- /dev/null +++ b/node_modules/@radix-ui/react-focus-scope/dist/index.mjs @@ -0,0 +1,214 @@ +"use client"; + +// packages/react/focus-scope/src/focus-scope.tsx +import * as React from "react"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { Primitive } from "@radix-ui/react-primitive"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +import { jsx } from "react/jsx-runtime"; +var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount"; +var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount"; +var EVENT_OPTIONS = { bubbles: false, cancelable: true }; +var FOCUS_SCOPE_NAME = "FocusScope"; +var FocusScope = React.forwardRef((props, forwardedRef) => { + const { + loop = false, + trapped = false, + onMountAutoFocus: onMountAutoFocusProp, + onUnmountAutoFocus: onUnmountAutoFocusProp, + ...scopeProps + } = props; + const [container, setContainer] = React.useState(null); + const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp); + const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp); + const lastFocusedElementRef = React.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node)); + const focusScope = React.useRef({ + paused: false, + pause() { + this.paused = true; + }, + resume() { + this.paused = false; + } + }).current; + React.useEffect(() => { + if (trapped) { + let handleFocusIn2 = function(event) { + if (focusScope.paused || !container) return; + const target = event.target; + if (container.contains(target)) { + lastFocusedElementRef.current = target; + } else { + focus(lastFocusedElementRef.current, { select: true }); + } + }, handleFocusOut2 = function(event) { + if (focusScope.paused || !container) return; + const relatedTarget = event.relatedTarget; + if (relatedTarget === null) return; + if (!container.contains(relatedTarget)) { + focus(lastFocusedElementRef.current, { select: true }); + } + }, handleMutations2 = function(mutations) { + const focusedElement = document.activeElement; + if (focusedElement !== document.body) return; + for (const mutation of mutations) { + if (mutation.removedNodes.length > 0) focus(container); + } + }; + var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2; + document.addEventListener("focusin", handleFocusIn2); + document.addEventListener("focusout", handleFocusOut2); + const mutationObserver = new MutationObserver(handleMutations2); + if (container) mutationObserver.observe(container, { childList: true, subtree: true }); + return () => { + document.removeEventListener("focusin", handleFocusIn2); + document.removeEventListener("focusout", handleFocusOut2); + mutationObserver.disconnect(); + }; + } + }, [trapped, container, focusScope.paused]); + React.useEffect(() => { + if (container) { + focusScopesStack.add(focusScope); + const previouslyFocusedElement = document.activeElement; + const hasFocusedCandidate = container.contains(previouslyFocusedElement); + if (!hasFocusedCandidate) { + const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS); + container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); + container.dispatchEvent(mountEvent); + if (!mountEvent.defaultPrevented) { + focusFirst(removeLinks(getTabbableCandidates(container)), { select: true }); + if (document.activeElement === previouslyFocusedElement) { + focus(container); + } + } + } + return () => { + container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); + setTimeout(() => { + const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS); + container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); + container.dispatchEvent(unmountEvent); + if (!unmountEvent.defaultPrevented) { + focus(previouslyFocusedElement ?? document.body, { select: true }); + } + container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); + focusScopesStack.remove(focusScope); + }, 0); + }; + } + }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]); + const handleKeyDown = React.useCallback( + (event) => { + if (!loop && !trapped) return; + if (focusScope.paused) return; + const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey; + const focusedElement = document.activeElement; + if (isTabKey && focusedElement) { + const container2 = event.currentTarget; + const [first, last] = getTabbableEdges(container2); + const hasTabbableElementsInside = first && last; + if (!hasTabbableElementsInside) { + if (focusedElement === container2) event.preventDefault(); + } else { + if (!event.shiftKey && focusedElement === last) { + event.preventDefault(); + if (loop) focus(first, { select: true }); + } else if (event.shiftKey && focusedElement === first) { + event.preventDefault(); + if (loop) focus(last, { select: true }); + } + } + } + }, + [loop, trapped, focusScope.paused] + ); + return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown }); +}); +FocusScope.displayName = FOCUS_SCOPE_NAME; +function focusFirst(candidates, { select = false } = {}) { + const previouslyFocusedElement = document.activeElement; + for (const candidate of candidates) { + focus(candidate, { select }); + if (document.activeElement !== previouslyFocusedElement) return; + } +} +function getTabbableEdges(container) { + const candidates = getTabbableCandidates(container); + const first = findVisible(candidates, container); + const last = findVisible(candidates.reverse(), container); + return [first, last]; +} +function getTabbableCandidates(container) { + const nodes = []; + const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { + acceptNode: (node) => { + const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden"; + if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; + return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } + }); + while (walker.nextNode()) nodes.push(walker.currentNode); + return nodes; +} +function findVisible(elements, container) { + for (const element of elements) { + if (!isHidden(element, { upTo: container })) return element; + } +} +function isHidden(node, { upTo }) { + if (getComputedStyle(node).visibility === "hidden") return true; + while (node) { + if (upTo !== void 0 && node === upTo) return false; + if (getComputedStyle(node).display === "none") return true; + node = node.parentElement; + } + return false; +} +function isSelectableInput(element) { + return element instanceof HTMLInputElement && "select" in element; +} +function focus(element, { select = false } = {}) { + if (element && element.focus) { + const previouslyFocusedElement = document.activeElement; + element.focus({ preventScroll: true }); + if (element !== previouslyFocusedElement && isSelectableInput(element) && select) + element.select(); + } +} +var focusScopesStack = createFocusScopesStack(); +function createFocusScopesStack() { + let stack = []; + return { + add(focusScope) { + const activeFocusScope = stack[0]; + if (focusScope !== activeFocusScope) { + activeFocusScope?.pause(); + } + stack = arrayRemove(stack, focusScope); + stack.unshift(focusScope); + }, + remove(focusScope) { + stack = arrayRemove(stack, focusScope); + stack[0]?.resume(); + } + }; +} +function arrayRemove(array, item) { + const updatedArray = [...array]; + const index = updatedArray.indexOf(item); + if (index !== -1) { + updatedArray.splice(index, 1); + } + return updatedArray; +} +function removeLinks(items) { + return items.filter((item) => item.tagName !== "A"); +} +var Root = FocusScope; +export { + FocusScope, + Root +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.map b/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.map new file mode 100644 index 0000000..7d20550 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/focus-scope.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\nconst AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';\nconst AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\ntype FocusableTarget = HTMLElement | { focus(): void };\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope\n * -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_SCOPE_NAME = 'FocusScope';\n\ntype FocusScopeElement = React.ElementRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface FocusScopeProps extends PrimitiveDivProps {\n /**\n * When `true`, tabbing from last item will focus first tabbable\n * and shift+tab from first item will focus last tababble.\n * @defaultValue false\n */\n loop?: boolean;\n\n /**\n * When `true`, focus cannot escape the focus scope via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapped?: boolean;\n\n /**\n * Event handler called when auto-focusing on mount.\n * Can be prevented.\n */\n onMountAutoFocus?: (event: Event) => void;\n\n /**\n * Event handler called when auto-focusing on unmount.\n * Can be prevented.\n */\n onUnmountAutoFocus?: (event: Event) => void;\n}\n\nconst FocusScope = React.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n },\n }).current;\n\n // Takes care of trapping focus if focus is moved outside programmatically for example\n React.useEffect(() => {\n if (trapped) {\n function handleFocusIn(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const target = event.target as HTMLElement | null;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n function handleFocusOut(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget as HTMLElement | null;\n\n // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:\n //\n // 1. When the user switches app/tabs/windows/the browser itself loses focus.\n // 2. In Google Chrome, when the focused element is removed from the DOM.\n //\n // We let the browser do its thing here because:\n //\n // 1. The browser already keeps a memory of what's focused for when the page gets refocused.\n // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it\n // throws the CPU to 100%, so we avoid doing anything for this reason here too.\n if (relatedTarget === null) return;\n\n // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)\n // that is outside the container, we move focus to the last valid focused element inside.\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n // When the focused element gets removed from the DOM, browsers move focus\n // back to the document.body. In this case, we move focus to the container\n // to keep focus trapped correctly.\n function handleMutations(mutations: MutationRecord[]) {\n const focusedElement = document.activeElement as HTMLElement | null;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n }\n\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n const mutationObserver = new MutationObserver(handleMutations);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n\n return () => {\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n\n // We hit a react bug (fixed in v17) with focusing in unmount.\n // We need to delay the focus a little to get around it for now.\n // See: https://github.com/facebook/react/issues/17894\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n // we need to remove the listener after we `dispatchEvent`\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n\n // Takes care of looping focus (when tabbing whilst at the edges)\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n\n return (\n \n );\n});\n\nFocusScope.displayName = FOCUS_SCOPE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Attempts focusing the first element in a list of candidates.\n * Stops when focus has actually moved.\n */\nfunction focusFirst(candidates: HTMLElement[], { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\n\n/**\n * Returns the first and last tabbable elements inside a container.\n */\nfunction getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last] as const;\n}\n\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nfunction getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n\n/**\n * Returns the first visible element in a list.\n * NOTE: Only checks visibility up to the `container`.\n */\nfunction findVisible(elements: HTMLElement[], container: HTMLElement) {\n for (const element of elements) {\n // we stop checking if it's hidden at the `container` level (excluding)\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\n\nfunction isHidden(node: HTMLElement, { upTo }: { upTo?: HTMLElement }) {\n if (getComputedStyle(node).visibility === 'hidden') return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (upTo !== undefined && node === upTo) return false;\n if (getComputedStyle(node).display === 'none') return true;\n node = node.parentElement as HTMLElement;\n }\n return false;\n}\n\nfunction isSelectableInput(element: any): element is FocusableTarget & { select: () => void } {\n return element instanceof HTMLInputElement && 'select' in element;\n}\n\nfunction focus(element?: FocusableTarget | null, { select = false } = {}) {\n // only focus if that element is focusable\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users\n element.focus({ preventScroll: true });\n // only select if its not the same element, it supports selection and we need to select\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope stack\n * -----------------------------------------------------------------------------------------------*/\n\ntype FocusScopeAPI = { paused: boolean; pause(): void; resume(): void };\nconst focusScopesStack = createFocusScopesStack();\n\nfunction createFocusScopesStack() {\n /** A stack of focus scopes, with the active one at the top */\n let stack: FocusScopeAPI[] = [];\n\n return {\n add(focusScope: FocusScopeAPI) {\n // pause the currently active focus scope (at the top of the stack)\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n // remove in case it already exists (because we'll re-add it at the top of the stack)\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n\n remove(focusScope: FocusScopeAPI) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n },\n };\n}\n\nfunction arrayRemove(array: T[], item: T) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\n\nfunction removeLinks(items: HTMLElement[]) {\n return items.filter((item) => item.tagName !== 'A');\n}\n\nconst Root = FocusScope;\n\nexport {\n FocusScope,\n //\n Root,\n};\nexport type { FocusScopeProps };\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,uBAA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AS,MAAM,SAAkC,EAAE,SAAS,MAAM,IAAI,CAAC,GAAG;AAExE,MAAI,WAAW,QAAQ,OAAO;AAC5B,UAAM,2BAA2B,SAAS;AAE1C,YAAQ,MAAM,EAAE,eAAe,KAAK,CAAC;AAErC,QAAI,YAAY,4BAA4B,kBAAkB,OAAO,KAAK;AACxE,cAAQ,OAAO;AAAA,EACnB;AACF;AAOA,IAAM,mBAAmB,uBAAuB;AAEhD,SAAS,yBAAyB;AAEhC,MAAI,QAAyB,CAAC;AAE9B,SAAO;AAAA,IACL,IAAI,YAA2B;AAE7B,YAAM,mBAAmB,MAAM,CAAC;AAChC,UAAI,eAAe,kBAAkB;AACnC,0BAAkB,MAAM;AAAA,MAC1B;AAEA,cAAQ,YAAY,OAAO,UAAU;AACrC,YAAM,QAAQ,UAAU;AAAA,IAC1B;AAAA,IAEA,OAAO,YAA2B;AAChC,cAAQ,YAAY,OAAO,UAAU;AACrC,YAAM,CAAC,GAAG,OAAO;AAAA,IACnB;AAAA,EACF;AACF;AAEA,SAAS,YAAe,OAAY,MAAS;AAC3C,QAAM,eAAe,CAAC,GAAG,KAAK;AAC9B,QAAM,QAAQ,aAAa,QAAQ,IAAI;AACvC,MAAI,UAAU,IAAI;AAChB,iBAAa,OAAO,OAAO,CAAC;AAAA,EAC9B;AACA,SAAO;AACT;AAEA,SAAS,YAAY,OAAsB;AACzC,SAAO,MAAM,OAAO,CAAC,SAAS,KAAK,YAAY,GAAG;AACpD;AAEA,IAAM,OAAO;", + "names": ["handleFocusIn", "handleFocusOut", "handleMutations", "container"] +} diff --git a/node_modules/@radix-ui/react-focus-scope/package.json b/node_modules/@radix-ui/react-focus-scope/package.json new file mode 100644 index 0000000..808ec68 --- /dev/null +++ b/node_modules/@radix-ui/react-focus-scope/package.json @@ -0,0 +1,68 @@ +{ + "name": "@radix-ui/react-focus-scope", + "version": "1.1.2", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "lint": "eslint --max-warnings 0 src", + "clean": "rm -rf dist", + "version": "yarn version" + }, + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-primitive": "2.0.2", + "@radix-ui/react-use-callback-ref": "1.1.0" + }, + "devDependencies": { + "@repo/eslint-config": "0.0.0", + "@repo/typescript-config": "0.0.0", + "@types/react": "^19.0.7", + "@types/react-dom": "^19.0.3", + "eslint": "^9.18.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "typescript": "^5.7.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-id/README.md b/node_modules/@radix-ui/react-id/README.md new file mode 100644 index 0000000..0867a45 --- /dev/null +++ b/node_modules/@radix-ui/react-id/README.md @@ -0,0 +1,13 @@ +# `react-id` + +## Installation + +```sh +$ yarn add @radix-ui/react-id +# or +$ npm install @radix-ui/react-id +``` + +## Usage + +View docs [here](https://radix-ui.com/primitives/docs/utilities/id-provider). diff --git a/node_modules/@radix-ui/react-id/dist/index.d.mts b/node_modules/@radix-ui/react-id/dist/index.d.mts new file mode 100644 index 0000000..411b333 --- /dev/null +++ b/node_modules/@radix-ui/react-id/dist/index.d.mts @@ -0,0 +1,3 @@ +declare function useId(deterministicId?: string): string; + +export { useId }; diff --git a/node_modules/@radix-ui/react-id/dist/index.d.ts b/node_modules/@radix-ui/react-id/dist/index.d.ts new file mode 100644 index 0000000..411b333 --- /dev/null +++ b/node_modules/@radix-ui/react-id/dist/index.d.ts @@ -0,0 +1,3 @@ +declare function useId(deterministicId?: string): string; + +export { useId }; diff --git a/node_modules/@radix-ui/react-id/dist/index.js b/node_modules/@radix-ui/react-id/dist/index.js new file mode 100644 index 0000000..1143703 --- /dev/null +++ b/node_modules/@radix-ui/react-id/dist/index.js @@ -0,0 +1,49 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/id/src/index.ts +var src_exports = {}; +__export(src_exports, { + useId: () => useId +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/id/src/id.tsx +var React = __toESM(require("react")); +var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect"); +var useReactId = React["useId".toString()] || (() => void 0); +var count = 0; +function useId(deterministicId) { + const [id, setId] = React.useState(useReactId()); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + if (!deterministicId) setId((reactId) => reactId ?? String(count++)); + }, [deterministicId]); + return deterministicId || (id ? `radix-${id}` : ""); +} +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-id/dist/index.js.map b/node_modules/@radix-ui/react-id/dist/index.js.map new file mode 100644 index 0000000..c1a9d30 --- /dev/null +++ b/node_modules/@radix-ui/react-id/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/id.tsx"], + "sourcesContent": ["export { useId } from './id';\n", "import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// We `toString()` to prevent bundlers from trying to `import { useId } from 'react';`\nconst useReactId = (React as any)['useId'.toString()] || (() => undefined);\nlet count = 0;\n\nfunction useId(deterministicId?: string): string {\n const [id, setId] = React.useState(useReactId());\n // React versions older than 18 will have client-side ids only.\n useLayoutEffect(() => {\n if (!deterministicId) setId((reactId) => reactId ?? String(count++));\n }, [deterministicId]);\n return deterministicId || (id ? `radix-${id}` : '');\n}\n\nexport { useId };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,qCAAgC;AAGhC,IAAM,aAAc,MAAc,QAAQ,SAAS,CAAC,MAAM,MAAM;AAChE,IAAI,QAAQ;AAEZ,SAAS,MAAM,iBAAkC;AAC/C,QAAM,CAAC,IAAI,KAAK,IAAU,eAA6B,WAAW,CAAC;AAEnE,sDAAgB,MAAM;AACpB,QAAI,CAAC,gBAAiB,OAAM,CAAC,YAAY,WAAW,OAAO,OAAO,CAAC;AAAA,EACrE,GAAG,CAAC,eAAe,CAAC;AACpB,SAAO,oBAAoB,KAAK,SAAS,EAAE,KAAK;AAClD;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-id/dist/index.mjs b/node_modules/@radix-ui/react-id/dist/index.mjs new file mode 100644 index 0000000..51b67e9 --- /dev/null +++ b/node_modules/@radix-ui/react-id/dist/index.mjs @@ -0,0 +1,16 @@ +// packages/react/id/src/id.tsx +import * as React from "react"; +import { useLayoutEffect } from "@radix-ui/react-use-layout-effect"; +var useReactId = React["useId".toString()] || (() => void 0); +var count = 0; +function useId(deterministicId) { + const [id, setId] = React.useState(useReactId()); + useLayoutEffect(() => { + if (!deterministicId) setId((reactId) => reactId ?? String(count++)); + }, [deterministicId]); + return deterministicId || (id ? `radix-${id}` : ""); +} +export { + useId +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-id/dist/index.mjs.map b/node_modules/@radix-ui/react-id/dist/index.mjs.map new file mode 100644 index 0000000..9d8a1e9 --- /dev/null +++ b/node_modules/@radix-ui/react-id/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/id.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// We `toString()` to prevent bundlers from trying to `import { useId } from 'react';`\nconst useReactId = (React as any)['useId'.toString()] || (() => undefined);\nlet count = 0;\n\nfunction useId(deterministicId?: string): string {\n const [id, setId] = React.useState(useReactId());\n // React versions older than 18 will have client-side ids only.\n useLayoutEffect(() => {\n if (!deterministicId) setId((reactId) => reactId ?? String(count++));\n }, [deterministicId]);\n return deterministicId || (id ? `radix-${id}` : '');\n}\n\nexport { useId };\n"], + "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAGhC,IAAM,aAAc,MAAc,QAAQ,SAAS,CAAC,MAAM,MAAM;AAChE,IAAI,QAAQ;AAEZ,SAAS,MAAM,iBAAkC;AAC/C,QAAM,CAAC,IAAI,KAAK,IAAU,eAA6B,WAAW,CAAC;AAEnE,kBAAgB,MAAM;AACpB,QAAI,CAAC,gBAAiB,OAAM,CAAC,YAAY,WAAW,OAAO,OAAO,CAAC;AAAA,EACrE,GAAG,CAAC,eAAe,CAAC;AACpB,SAAO,oBAAoB,KAAK,SAAS,EAAE,KAAK;AAClD;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-id/package.json b/node_modules/@radix-ui/react-id/package.json new file mode 100644 index 0000000..d509491 --- /dev/null +++ b/node_modules/@radix-ui/react-id/package.json @@ -0,0 +1,50 @@ +{ + "name": "@radix-ui/react-id", + "version": "1.1.0", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf dist", + "version": "yarn version" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + }, + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.0" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-portal/README.md b/node_modules/@radix-ui/react-portal/README.md new file mode 100644 index 0000000..fca66d7 --- /dev/null +++ b/node_modules/@radix-ui/react-portal/README.md @@ -0,0 +1,13 @@ +# `react-portal` + +## Installation + +```sh +$ yarn add @radix-ui/react-portal +# or +$ npm install @radix-ui/react-portal +``` + +## Usage + +View docs [here](https://radix-ui.com/primitives/docs/utilities/portal). diff --git a/node_modules/@radix-ui/react-portal/dist/index.d.mts b/node_modules/@radix-ui/react-portal/dist/index.d.mts new file mode 100644 index 0000000..99cc971 --- /dev/null +++ b/node_modules/@radix-ui/react-portal/dist/index.d.mts @@ -0,0 +1,14 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface PortalProps extends PrimitiveDivProps { + /** + * An optional container where the portaled content should be appended. + */ + container?: Element | DocumentFragment | null; +} +declare const Portal: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { Portal, type PortalProps, Root }; diff --git a/node_modules/@radix-ui/react-portal/dist/index.d.ts b/node_modules/@radix-ui/react-portal/dist/index.d.ts new file mode 100644 index 0000000..99cc971 --- /dev/null +++ b/node_modules/@radix-ui/react-portal/dist/index.d.ts @@ -0,0 +1,14 @@ +import * as React from 'react'; +import { Primitive } from '@radix-ui/react-primitive'; + +type PrimitiveDivProps = React.ComponentPropsWithoutRef; +interface PortalProps extends PrimitiveDivProps { + /** + * An optional container where the portaled content should be appended. + */ + container?: Element | DocumentFragment | null; +} +declare const Portal: React.ForwardRefExoticComponent>; +declare const Root: React.ForwardRefExoticComponent>; + +export { Portal, type PortalProps, Root }; diff --git a/node_modules/@radix-ui/react-portal/dist/index.js b/node_modules/@radix-ui/react-portal/dist/index.js new file mode 100644 index 0000000..212c26e --- /dev/null +++ b/node_modules/@radix-ui/react-portal/dist/index.js @@ -0,0 +1,55 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/portal/src/index.ts +var src_exports = {}; +__export(src_exports, { + Portal: () => Portal, + Root: () => Root +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/portal/src/portal.tsx +var React = __toESM(require("react")); +var import_react_dom = __toESM(require("react-dom")); +var import_react_primitive = require("@radix-ui/react-primitive"); +var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect"); +var import_jsx_runtime = require("react/jsx-runtime"); +var PORTAL_NAME = "Portal"; +var Portal = React.forwardRef((props, forwardedRef) => { + const { container: containerProp, ...portalProps } = props; + const [mounted, setMounted] = React.useState(false); + (0, import_react_use_layout_effect.useLayoutEffect)(() => setMounted(true), []); + const container = containerProp || mounted && globalThis?.document?.body; + return container ? import_react_dom.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null; +}); +Portal.displayName = PORTAL_NAME; +var Root = Portal; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-portal/dist/index.js.map b/node_modules/@radix-ui/react-portal/dist/index.js.map new file mode 100644 index 0000000..97619c9 --- /dev/null +++ b/node_modules/@radix-ui/react-portal/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/portal.tsx"], + "sourcesContent": ["'use client';\nexport {\n Portal,\n //\n Root,\n} from './portal';\nexport type { PortalProps } from './portal';\n", "import * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n/* -------------------------------------------------------------------------------------------------\n * Portal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'Portal';\n\ntype PortalElement = React.ElementRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface PortalProps extends PrimitiveDivProps {\n /**\n * An optional container where the portaled content should be appended.\n */\n container?: Element | DocumentFragment | null;\n}\n\nconst Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n return container\n ? ReactDOM.createPortal(, container)\n : null;\n});\n\nPortal.displayName = PORTAL_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Portal;\n\nexport {\n Portal,\n //\n Root,\n};\nexport type { PortalProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqB;AACrB,6BAA0B;AAC1B,qCAAgC;AAuBJ;AAjB5B,IAAM,cAAc;AAWpB,IAAM,SAAe,iBAAuC,CAAC,OAAO,iBAAiB;AACnF,QAAM,EAAE,WAAW,eAAe,GAAG,YAAY,IAAI;AACrD,QAAM,CAAC,SAAS,UAAU,IAAU,eAAS,KAAK;AAClD,sDAAgB,MAAM,WAAW,IAAI,GAAG,CAAC,CAAC;AAC1C,QAAM,YAAY,iBAAkB,WAAW,YAAY,UAAU;AACrE,SAAO,YACH,iBAAAA,QAAS,aAAa,4CAAC,iCAAU,KAAV,EAAe,GAAG,aAAa,KAAK,cAAc,GAAI,SAAS,IACtF;AACN,CAAC;AAED,OAAO,cAAc;AAIrB,IAAM,OAAO;", + "names": ["ReactDOM"] +} diff --git a/node_modules/@radix-ui/react-portal/dist/index.mjs b/node_modules/@radix-ui/react-portal/dist/index.mjs new file mode 100644 index 0000000..7cdefb1 --- /dev/null +++ b/node_modules/@radix-ui/react-portal/dist/index.mjs @@ -0,0 +1,23 @@ +"use client"; + +// packages/react/portal/src/portal.tsx +import * as React from "react"; +import ReactDOM from "react-dom"; +import { Primitive } from "@radix-ui/react-primitive"; +import { useLayoutEffect } from "@radix-ui/react-use-layout-effect"; +import { jsx } from "react/jsx-runtime"; +var PORTAL_NAME = "Portal"; +var Portal = React.forwardRef((props, forwardedRef) => { + const { container: containerProp, ...portalProps } = props; + const [mounted, setMounted] = React.useState(false); + useLayoutEffect(() => setMounted(true), []); + const container = containerProp || mounted && globalThis?.document?.body; + return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null; +}); +Portal.displayName = PORTAL_NAME; +var Root = Portal; +export { + Portal, + Root +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-portal/dist/index.mjs.map b/node_modules/@radix-ui/react-portal/dist/index.mjs.map new file mode 100644 index 0000000..f9ed6b3 --- /dev/null +++ b/node_modules/@radix-ui/react-portal/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/portal.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n/* -------------------------------------------------------------------------------------------------\n * Portal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'Portal';\n\ntype PortalElement = React.ElementRef;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef;\ninterface PortalProps extends PrimitiveDivProps {\n /**\n * An optional container where the portaled content should be appended.\n */\n container?: Element | DocumentFragment | null;\n}\n\nconst Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n return container\n ? ReactDOM.createPortal(, container)\n : null;\n});\n\nPortal.displayName = PORTAL_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Portal;\n\nexport {\n Portal,\n //\n Root,\n};\nexport type { PortalProps };\n"], + "mappings": ";;;AAAA,YAAY,WAAW;AACvB,OAAO,cAAc;AACrB,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAuBJ;AAjB5B,IAAM,cAAc;AAWpB,IAAM,SAAe,iBAAuC,CAAC,OAAO,iBAAiB;AACnF,QAAM,EAAE,WAAW,eAAe,GAAG,YAAY,IAAI;AACrD,QAAM,CAAC,SAAS,UAAU,IAAU,eAAS,KAAK;AAClD,kBAAgB,MAAM,WAAW,IAAI,GAAG,CAAC,CAAC;AAC1C,QAAM,YAAY,iBAAkB,WAAW,YAAY,UAAU;AACrE,SAAO,YACH,SAAS,aAAa,oBAAC,UAAU,KAAV,EAAe,GAAG,aAAa,KAAK,cAAc,GAAI,SAAS,IACtF;AACN,CAAC;AAED,OAAO,cAAc;AAIrB,IAAM,OAAO;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-portal/package.json b/node_modules/@radix-ui/react-portal/package.json new file mode 100644 index 0000000..1f65b70 --- /dev/null +++ b/node_modules/@radix-ui/react-portal/package.json @@ -0,0 +1,67 @@ +{ + "name": "@radix-ui/react-portal", + "version": "1.1.4", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "lint": "eslint --max-warnings 0 src", + "clean": "rm -rf dist", + "version": "yarn version" + }, + "dependencies": { + "@radix-ui/react-primitive": "2.0.2", + "@radix-ui/react-use-layout-effect": "1.1.0" + }, + "devDependencies": { + "@repo/eslint-config": "0.0.0", + "@repo/typescript-config": "0.0.0", + "@types/react": "^19.0.7", + "@types/react-dom": "^19.0.3", + "eslint": "^9.18.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "typescript": "^5.7.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-presence/README.md b/node_modules/@radix-ui/react-presence/README.md new file mode 100644 index 0000000..3927138 --- /dev/null +++ b/node_modules/@radix-ui/react-presence/README.md @@ -0,0 +1,13 @@ +# `react-presence` + +## Installation + +```sh +$ yarn add @radix-ui/react-presence +# or +$ npm install @radix-ui/react-presence +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-presence/dist/index.d.mts b/node_modules/@radix-ui/react-presence/dist/index.d.mts new file mode 100644 index 0000000..4a2321a --- /dev/null +++ b/node_modules/@radix-ui/react-presence/dist/index.d.mts @@ -0,0 +1,11 @@ +import * as React from 'react'; + +interface PresenceProps { + children: React.ReactElement | ((props: { + present: boolean; + }) => React.ReactElement); + present: boolean; +} +declare const Presence: React.FC; + +export { Presence, type PresenceProps }; diff --git a/node_modules/@radix-ui/react-presence/dist/index.d.ts b/node_modules/@radix-ui/react-presence/dist/index.d.ts new file mode 100644 index 0000000..4a2321a --- /dev/null +++ b/node_modules/@radix-ui/react-presence/dist/index.d.ts @@ -0,0 +1,11 @@ +import * as React from 'react'; + +interface PresenceProps { + children: React.ReactElement | ((props: { + present: boolean; + }) => React.ReactElement); + present: boolean; +} +declare const Presence: React.FC; + +export { Presence, type PresenceProps }; diff --git a/node_modules/@radix-ui/react-presence/dist/index.js b/node_modules/@radix-ui/react-presence/dist/index.js new file mode 100644 index 0000000..5d139c0 --- /dev/null +++ b/node_modules/@radix-ui/react-presence/dist/index.js @@ -0,0 +1,169 @@ +"use strict"; +"use client"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/presence/src/index.ts +var src_exports = {}; +__export(src_exports, { + Presence: () => Presence +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/presence/src/Presence.tsx +var React2 = __toESM(require("react")); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect"); + +// packages/react/presence/src/useStateMachine.tsx +var React = __toESM(require("react")); +function useStateMachine(initialState, machine) { + return React.useReducer((state, event) => { + const nextState = machine[state][event]; + return nextState ?? state; + }, initialState); +} + +// packages/react/presence/src/Presence.tsx +var Presence = (props) => { + const { present, children } = props; + const presence = usePresence(present); + const child = typeof children === "function" ? children({ present: presence.isPresent }) : React2.Children.only(children); + const ref = (0, import_react_compose_refs.useComposedRefs)(presence.ref, getElementRef(child)); + const forceMount = typeof children === "function"; + return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null; +}; +Presence.displayName = "Presence"; +function usePresence(present) { + const [node, setNode] = React2.useState(); + const stylesRef = React2.useRef({}); + const prevPresentRef = React2.useRef(present); + const prevAnimationNameRef = React2.useRef("none"); + const initialState = present ? "mounted" : "unmounted"; + const [state, send] = useStateMachine(initialState, { + mounted: { + UNMOUNT: "unmounted", + ANIMATION_OUT: "unmountSuspended" + }, + unmountSuspended: { + MOUNT: "mounted", + ANIMATION_END: "unmounted" + }, + unmounted: { + MOUNT: "mounted" + } + }); + React2.useEffect(() => { + const currentAnimationName = getAnimationName(stylesRef.current); + prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none"; + }, [state]); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + const styles = stylesRef.current; + const wasPresent = prevPresentRef.current; + const hasPresentChanged = wasPresent !== present; + if (hasPresentChanged) { + const prevAnimationName = prevAnimationNameRef.current; + const currentAnimationName = getAnimationName(styles); + if (present) { + send("MOUNT"); + } else if (currentAnimationName === "none" || styles?.display === "none") { + send("UNMOUNT"); + } else { + const isAnimating = prevAnimationName !== currentAnimationName; + if (wasPresent && isAnimating) { + send("ANIMATION_OUT"); + } else { + send("UNMOUNT"); + } + } + prevPresentRef.current = present; + } + }, [present, send]); + (0, import_react_use_layout_effect.useLayoutEffect)(() => { + if (node) { + let timeoutId; + const ownerWindow = node.ownerDocument.defaultView ?? window; + const handleAnimationEnd = (event) => { + const currentAnimationName = getAnimationName(stylesRef.current); + const isCurrentAnimation = currentAnimationName.includes(event.animationName); + if (event.target === node && isCurrentAnimation) { + send("ANIMATION_END"); + if (!prevPresentRef.current) { + const currentFillMode = node.style.animationFillMode; + node.style.animationFillMode = "forwards"; + timeoutId = ownerWindow.setTimeout(() => { + if (node.style.animationFillMode === "forwards") { + node.style.animationFillMode = currentFillMode; + } + }); + } + } + }; + const handleAnimationStart = (event) => { + if (event.target === node) { + prevAnimationNameRef.current = getAnimationName(stylesRef.current); + } + }; + node.addEventListener("animationstart", handleAnimationStart); + node.addEventListener("animationcancel", handleAnimationEnd); + node.addEventListener("animationend", handleAnimationEnd); + return () => { + ownerWindow.clearTimeout(timeoutId); + node.removeEventListener("animationstart", handleAnimationStart); + node.removeEventListener("animationcancel", handleAnimationEnd); + node.removeEventListener("animationend", handleAnimationEnd); + }; + } else { + send("ANIMATION_END"); + } + }, [node, send]); + return { + isPresent: ["mounted", "unmountSuspended"].includes(state), + ref: React2.useCallback((node2) => { + if (node2) stylesRef.current = getComputedStyle(node2); + setNode(node2); + }, []) + }; +} +function getAnimationName(styles) { + return styles?.animationName || "none"; +} +function getElementRef(element) { + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.ref; + } + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.props.ref; + } + return element.props.ref || element.ref; +} +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-presence/dist/index.js.map b/node_modules/@radix-ui/react-presence/dist/index.js.map new file mode 100644 index 0000000..70a7c76 --- /dev/null +++ b/node_modules/@radix-ui/react-presence/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/Presence.tsx", "../src/useStateMachine.tsx"], + "sourcesContent": ["'use client';\nexport { Presence } from './Presence';\nexport type { PresenceProps } from './Presence';\n", "import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './useStateMachine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState();\n const stylesRef = React.useRef({} as any);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = 'forwards';\n // Reset the style after the node had time to unmount (for cases\n // where the component chooses not to unmount). Doing this any\n // sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n // still causes a flash.\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === 'forwards') {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event: AnimationEvent) => {\n if (event.target === node) {\n // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener('animationstart', handleAnimationStart);\n node.addEventListener('animationcancel', handleAnimationEnd);\n node.addEventListener('animationend', handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener('animationstart', handleAnimationStart);\n node.removeEventListener('animationcancel', handleAnimationEnd);\n node.removeEventListener('animationend', handleAnimationEnd);\n };\n } else {\n // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }\n }, [node, send]);\n\n return {\n isPresent: ['mounted', 'unmountSuspended'].includes(state),\n ref: React.useCallback((node: HTMLElement) => {\n if (node) stylesRef.current = getComputedStyle(node);\n setNode(node);\n }, []),\n };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getAnimationName(styles?: CSSStyleDeclaration) {\n return styles?.animationName || 'none';\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement<{ ref?: React.Ref }>) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n\n // Not DEV\n return element.props.ref || (element as any).ref;\n}\n\nexport { Presence };\nexport type { PresenceProps };\n", "import * as React from 'react';\n\ntype Machine = { [k: string]: { [k: string]: S } };\ntype MachineState = keyof T;\ntype MachineEvent = keyof UnionToIntersection;\n\n// \uD83E\uDD2F https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine(\n initialState: MachineState,\n machine: M & Machine>\n) {\n return React.useReducer((state: MachineState, event: MachineEvent): MachineState => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;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,mBAAmB,kBAAkB;AAC3D,WAAK,iBAAiB,gBAAgB,kBAAkB;AACxD,aAAO,MAAM;AACX,oBAAY,aAAa,SAAS;AAClC,aAAK,oBAAoB,kBAAkB,oBAAoB;AAC/D,aAAK,oBAAoB,mBAAmB,kBAAkB;AAC9D,aAAK,oBAAoB,gBAAgB,kBAAkB;AAAA,MAC7D;AAAA,IACF,OAAO;AAGL,WAAK,eAAe;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,MAAM,IAAI,CAAC;AAEf,SAAO;AAAA,IACL,WAAW,CAAC,WAAW,kBAAkB,EAAE,SAAS,KAAK;AAAA,IACzD,KAAW,mBAAY,CAACC,UAAsB;AAC5C,UAAIA,MAAM,WAAU,UAAU,iBAAiBA,KAAI;AACnD,cAAQA,KAAI;AAAA,IACd,GAAG,CAAC,CAAC;AAAA,EACP;AACF;AAIA,SAAS,iBAAiB,QAA8B;AACtD,SAAO,QAAQ,iBAAiB;AAClC;AAOA,SAAS,cAAc,SAA2D;AAEhF,MAAI,SAAS,OAAO,yBAAyB,QAAQ,OAAO,KAAK,GAAG;AACpE,MAAI,UAAU,UAAU,oBAAoB,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAO,QAAQ,MAAM;AAAA,EACvB;AAGA,SAAO,QAAQ,MAAM,OAAQ,QAAgB;AAC/C;", + "names": ["React", "node"] +} diff --git a/node_modules/@radix-ui/react-presence/dist/index.mjs b/node_modules/@radix-ui/react-presence/dist/index.mjs new file mode 100644 index 0000000..5ab5280 --- /dev/null +++ b/node_modules/@radix-ui/react-presence/dist/index.mjs @@ -0,0 +1,137 @@ +"use client"; + +// packages/react/presence/src/Presence.tsx +import * as React2 from "react"; +import { useComposedRefs } from "@radix-ui/react-compose-refs"; +import { useLayoutEffect } from "@radix-ui/react-use-layout-effect"; + +// packages/react/presence/src/useStateMachine.tsx +import * as React from "react"; +function useStateMachine(initialState, machine) { + return React.useReducer((state, event) => { + const nextState = machine[state][event]; + return nextState ?? state; + }, initialState); +} + +// packages/react/presence/src/Presence.tsx +var Presence = (props) => { + const { present, children } = props; + const presence = usePresence(present); + const child = typeof children === "function" ? children({ present: presence.isPresent }) : React2.Children.only(children); + const ref = useComposedRefs(presence.ref, getElementRef(child)); + const forceMount = typeof children === "function"; + return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null; +}; +Presence.displayName = "Presence"; +function usePresence(present) { + const [node, setNode] = React2.useState(); + const stylesRef = React2.useRef({}); + const prevPresentRef = React2.useRef(present); + const prevAnimationNameRef = React2.useRef("none"); + const initialState = present ? "mounted" : "unmounted"; + const [state, send] = useStateMachine(initialState, { + mounted: { + UNMOUNT: "unmounted", + ANIMATION_OUT: "unmountSuspended" + }, + unmountSuspended: { + MOUNT: "mounted", + ANIMATION_END: "unmounted" + }, + unmounted: { + MOUNT: "mounted" + } + }); + React2.useEffect(() => { + const currentAnimationName = getAnimationName(stylesRef.current); + prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none"; + }, [state]); + useLayoutEffect(() => { + const styles = stylesRef.current; + const wasPresent = prevPresentRef.current; + const hasPresentChanged = wasPresent !== present; + if (hasPresentChanged) { + const prevAnimationName = prevAnimationNameRef.current; + const currentAnimationName = getAnimationName(styles); + if (present) { + send("MOUNT"); + } else if (currentAnimationName === "none" || styles?.display === "none") { + send("UNMOUNT"); + } else { + const isAnimating = prevAnimationName !== currentAnimationName; + if (wasPresent && isAnimating) { + send("ANIMATION_OUT"); + } else { + send("UNMOUNT"); + } + } + prevPresentRef.current = present; + } + }, [present, send]); + useLayoutEffect(() => { + if (node) { + let timeoutId; + const ownerWindow = node.ownerDocument.defaultView ?? window; + const handleAnimationEnd = (event) => { + const currentAnimationName = getAnimationName(stylesRef.current); + const isCurrentAnimation = currentAnimationName.includes(event.animationName); + if (event.target === node && isCurrentAnimation) { + send("ANIMATION_END"); + if (!prevPresentRef.current) { + const currentFillMode = node.style.animationFillMode; + node.style.animationFillMode = "forwards"; + timeoutId = ownerWindow.setTimeout(() => { + if (node.style.animationFillMode === "forwards") { + node.style.animationFillMode = currentFillMode; + } + }); + } + } + }; + const handleAnimationStart = (event) => { + if (event.target === node) { + prevAnimationNameRef.current = getAnimationName(stylesRef.current); + } + }; + node.addEventListener("animationstart", handleAnimationStart); + node.addEventListener("animationcancel", handleAnimationEnd); + node.addEventListener("animationend", handleAnimationEnd); + return () => { + ownerWindow.clearTimeout(timeoutId); + node.removeEventListener("animationstart", handleAnimationStart); + node.removeEventListener("animationcancel", handleAnimationEnd); + node.removeEventListener("animationend", handleAnimationEnd); + }; + } else { + send("ANIMATION_END"); + } + }, [node, send]); + return { + isPresent: ["mounted", "unmountSuspended"].includes(state), + ref: React2.useCallback((node2) => { + if (node2) stylesRef.current = getComputedStyle(node2); + setNode(node2); + }, []) + }; +} +function getAnimationName(styles) { + return styles?.animationName || "none"; +} +function getElementRef(element) { + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.ref; + } + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.props.ref; + } + return element.props.ref || element.ref; +} +export { + Presence +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-presence/dist/index.mjs.map b/node_modules/@radix-ui/react-presence/dist/index.mjs.map new file mode 100644 index 0000000..d87c282 --- /dev/null +++ b/node_modules/@radix-ui/react-presence/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/Presence.tsx", "../src/useStateMachine.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './useStateMachine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState();\n const stylesRef = React.useRef({} as any);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = 'forwards';\n // Reset the style after the node had time to unmount (for cases\n // where the component chooses not to unmount). Doing this any\n // sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n // still causes a flash.\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === 'forwards') {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event: AnimationEvent) => {\n if (event.target === node) {\n // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener('animationstart', handleAnimationStart);\n node.addEventListener('animationcancel', handleAnimationEnd);\n node.addEventListener('animationend', handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener('animationstart', handleAnimationStart);\n node.removeEventListener('animationcancel', handleAnimationEnd);\n node.removeEventListener('animationend', handleAnimationEnd);\n };\n } else {\n // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }\n }, [node, send]);\n\n return {\n isPresent: ['mounted', 'unmountSuspended'].includes(state),\n ref: React.useCallback((node: HTMLElement) => {\n if (node) stylesRef.current = getComputedStyle(node);\n setNode(node);\n }, []),\n };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getAnimationName(styles?: CSSStyleDeclaration) {\n return styles?.animationName || 'none';\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement<{ ref?: React.Ref }>) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n\n // Not DEV\n return element.props.ref || (element as any).ref;\n}\n\nexport { Presence };\nexport type { PresenceProps };\n", "import * as React from 'react';\n\ntype Machine = { [k: string]: { [k: string]: S } };\ntype MachineState = keyof T;\ntype MachineEvent = keyof UnionToIntersection;\n\n// \uD83E\uDD2F https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine(\n initialState: MachineState,\n machine: M & Machine>\n) {\n return React.useReducer((state: MachineState, event: MachineEvent): MachineState => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\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AiB,mBAAmB,kBAAkB;AAC3D,WAAK,iBAAiB,gBAAgB,kBAAkB;AACxD,aAAO,MAAM;AACX,oBAAY,aAAa,SAAS;AAClC,aAAK,oBAAoB,kBAAkB,oBAAoB;AAC/D,aAAK,oBAAoB,mBAAmB,kBAAkB;AAC9D,aAAK,oBAAoB,gBAAgB,kBAAkB;AAAA,MAC7D;AAAA,IACF,OAAO;AAGL,WAAK,eAAe;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,MAAM,IAAI,CAAC;AAEf,SAAO;AAAA,IACL,WAAW,CAAC,WAAW,kBAAkB,EAAE,SAAS,KAAK;AAAA,IACzD,KAAW,mBAAY,CAACC,UAAsB;AAC5C,UAAIA,MAAM,WAAU,UAAU,iBAAiBA,KAAI;AACnD,cAAQA,KAAI;AAAA,IACd,GAAG,CAAC,CAAC;AAAA,EACP;AACF;AAIA,SAAS,iBAAiB,QAA8B;AACtD,SAAO,QAAQ,iBAAiB;AAClC;AAOA,SAAS,cAAc,SAA2D;AAEhF,MAAI,SAAS,OAAO,yBAAyB,QAAQ,OAAO,KAAK,GAAG;AACpE,MAAI,UAAU,UAAU,oBAAoB,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAO,QAAQ,MAAM;AAAA,EACvB;AAGA,SAAO,QAAQ,MAAM,OAAQ,QAAgB;AAC/C;", + "names": ["React", "node"] +} diff --git a/node_modules/@radix-ui/react-presence/package.json b/node_modules/@radix-ui/react-presence/package.json new file mode 100644 index 0000000..e46279b --- /dev/null +++ b/node_modules/@radix-ui/react-presence/package.json @@ -0,0 +1,56 @@ +{ + "name": "@radix-ui/react-presence", + "version": "1.1.2", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf dist", + "version": "yarn version" + }, + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-use-layout-effect": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-primitive/README.md b/node_modules/@radix-ui/react-primitive/README.md new file mode 100644 index 0000000..efa8525 --- /dev/null +++ b/node_modules/@radix-ui/react-primitive/README.md @@ -0,0 +1,13 @@ +# `react-primitive` + +## Installation + +```sh +$ yarn add @radix-ui/react-primitive +# or +$ npm install @radix-ui/react-primitive +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-primitive/dist/index.d.mts b/node_modules/@radix-ui/react-primitive/dist/index.d.mts new file mode 100644 index 0000000..a0b85dd --- /dev/null +++ b/node_modules/@radix-ui/react-primitive/dist/index.d.mts @@ -0,0 +1,52 @@ +import * as React from 'react'; + +declare const NODES: readonly ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "span", "svg", "ul"]; +type Primitives = { + [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent; +}; +type PrimitivePropsWithRef = React.ComponentPropsWithRef & { + asChild?: boolean; +}; +interface PrimitiveForwardRefComponent extends React.ForwardRefExoticComponent> { +} +declare const Primitive: Primitives; +/** + * Flush custom event dispatch + * https://github.com/radix-ui/primitives/pull/1378 + * + * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types. + * + * Internally, React prioritises events in the following order: + * - discrete + * - continuous + * - default + * + * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350 + * + * `discrete` is an important distinction as updates within these events are applied immediately. + * React however, is not able to infer the priority of custom event types due to how they are detected internally. + * Because of this, it's possible for updates from custom events to be unexpectedly batched when + * dispatched by another `discrete` event. + * + * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch. + * This utility should be used when dispatching a custom event from within another `discrete` event, this utility + * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event. + * For example: + * + * dispatching a known click 👎 + * target.dispatchEvent(new Event(‘click’)) + * + * dispatching a custom type within a non-discrete event 👎 + * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))} + * + * dispatching a custom type within a `discrete` event 👍 + * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))} + * + * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use + * this utility with them. This is because it's possible for those handlers to be called implicitly during render + * e.g. when focus is within a component as it is unmounted, or when managing focus on mount. + */ +declare function dispatchDiscreteCustomEvent(target: E['target'], event: E): void; +declare const Root: Primitives; + +export { Primitive, type PrimitivePropsWithRef, Root, dispatchDiscreteCustomEvent }; diff --git a/node_modules/@radix-ui/react-primitive/dist/index.d.ts b/node_modules/@radix-ui/react-primitive/dist/index.d.ts new file mode 100644 index 0000000..a0b85dd --- /dev/null +++ b/node_modules/@radix-ui/react-primitive/dist/index.d.ts @@ -0,0 +1,52 @@ +import * as React from 'react'; + +declare const NODES: readonly ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "span", "svg", "ul"]; +type Primitives = { + [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent; +}; +type PrimitivePropsWithRef = React.ComponentPropsWithRef & { + asChild?: boolean; +}; +interface PrimitiveForwardRefComponent extends React.ForwardRefExoticComponent> { +} +declare const Primitive: Primitives; +/** + * Flush custom event dispatch + * https://github.com/radix-ui/primitives/pull/1378 + * + * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types. + * + * Internally, React prioritises events in the following order: + * - discrete + * - continuous + * - default + * + * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350 + * + * `discrete` is an important distinction as updates within these events are applied immediately. + * React however, is not able to infer the priority of custom event types due to how they are detected internally. + * Because of this, it's possible for updates from custom events to be unexpectedly batched when + * dispatched by another `discrete` event. + * + * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch. + * This utility should be used when dispatching a custom event from within another `discrete` event, this utility + * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event. + * For example: + * + * dispatching a known click 👎 + * target.dispatchEvent(new Event(‘click’)) + * + * dispatching a custom type within a non-discrete event 👎 + * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))} + * + * dispatching a custom type within a `discrete` event 👍 + * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))} + * + * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use + * this utility with them. This is because it's possible for those handlers to be called implicitly during render + * e.g. when focus is within a component as it is unmounted, or when managing focus on mount. + */ +declare function dispatchDiscreteCustomEvent(target: E['target'], event: E): void; +declare const Root: Primitives; + +export { Primitive, type PrimitivePropsWithRef, Root, dispatchDiscreteCustomEvent }; diff --git a/node_modules/@radix-ui/react-primitive/dist/index.js b/node_modules/@radix-ui/react-primitive/dist/index.js new file mode 100644 index 0000000..9e19d78 --- /dev/null +++ b/node_modules/@radix-ui/react-primitive/dist/index.js @@ -0,0 +1,78 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/primitive/src/index.ts +var src_exports = {}; +__export(src_exports, { + Primitive: () => Primitive, + Root: () => Root, + dispatchDiscreteCustomEvent: () => dispatchDiscreteCustomEvent +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/primitive/src/primitive.tsx +var React = __toESM(require("react")); +var ReactDOM = __toESM(require("react-dom")); +var import_react_slot = require("@radix-ui/react-slot"); +var import_jsx_runtime = require("react/jsx-runtime"); +var NODES = [ + "a", + "button", + "div", + "form", + "h2", + "h3", + "img", + "input", + "label", + "li", + "nav", + "ol", + "p", + "span", + "svg", + "ul" +]; +var Primitive = NODES.reduce((primitive, node) => { + const Node = React.forwardRef((props, forwardedRef) => { + const { asChild, ...primitiveProps } = props; + const Comp = asChild ? import_react_slot.Slot : node; + if (typeof window !== "undefined") { + window[Symbol.for("radix-ui")] = true; + } + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { ...primitiveProps, ref: forwardedRef }); + }); + Node.displayName = `Primitive.${node}`; + return { ...primitive, [node]: Node }; +}, {}); +function dispatchDiscreteCustomEvent(target, event) { + if (target) ReactDOM.flushSync(() => target.dispatchEvent(event)); +} +var Root = Primitive; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-primitive/dist/index.js.map b/node_modules/@radix-ui/react-primitive/dist/index.js.map new file mode 100644 index 0000000..0d4a1d8 --- /dev/null +++ b/node_modules/@radix-ui/react-primitive/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/primitive.tsx"], + "sourcesContent": ["export {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n} from './primitive';\nexport type { PrimitivePropsWithRef } from './primitive';\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { Slot } from '@radix-ui/react-slot';\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent };\ntype PrimitivePropsWithRef = React.ComponentPropsWithRef & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent\n extends React.ForwardRefExoticComponent> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props: PrimitivePropsWithRef, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return ;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click \uD83D\uDC4E\n * target.dispatchEvent(new Event(\u2018click\u2019))\n *\n * dispatching a custom type within a non-discrete event \uD83D\uDC4E\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(\u2018customType\u2019))}\n *\n * dispatching a custom type within a `discrete` event \uD83D\uDC4D\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(\u2018customType\u2019))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,eAA0B;AAC1B,wBAAqB;AA0CV;AAxCX,IAAM,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAcA,IAAM,YAAY,MAAM,OAAO,CAAC,WAAW,SAAS;AAClD,QAAM,OAAa,iBAAW,CAAC,OAA2C,iBAAsB;AAC9F,UAAM,EAAE,SAAS,GAAG,eAAe,IAAI;AACvC,UAAM,OAAY,UAAU,yBAAO;AAEnC,QAAI,OAAO,WAAW,aAAa;AACjC,MAAC,OAAe,OAAO,IAAI,UAAU,CAAC,IAAI;AAAA,IAC5C;AAEA,WAAO,4CAAC,QAAM,GAAG,gBAAgB,KAAK,cAAc;AAAA,EACtD,CAAC;AAED,OAAK,cAAc,aAAa,IAAI;AAEpC,SAAO,EAAE,GAAG,WAAW,CAAC,IAAI,GAAG,KAAK;AACtC,GAAG,CAAC,CAAe;AA2CnB,SAAS,4BAAmD,QAAqB,OAAU;AACzF,MAAI,OAAQ,CAAS,mBAAU,MAAM,OAAO,cAAc,KAAK,CAAC;AAClE;AAIA,IAAM,OAAO;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-primitive/dist/index.mjs b/node_modules/@radix-ui/react-primitive/dist/index.mjs new file mode 100644 index 0000000..4954f67 --- /dev/null +++ b/node_modules/@radix-ui/react-primitive/dist/index.mjs @@ -0,0 +1,45 @@ +// packages/react/primitive/src/primitive.tsx +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import { Slot } from "@radix-ui/react-slot"; +import { jsx } from "react/jsx-runtime"; +var NODES = [ + "a", + "button", + "div", + "form", + "h2", + "h3", + "img", + "input", + "label", + "li", + "nav", + "ol", + "p", + "span", + "svg", + "ul" +]; +var Primitive = NODES.reduce((primitive, node) => { + const Node = React.forwardRef((props, forwardedRef) => { + const { asChild, ...primitiveProps } = props; + const Comp = asChild ? Slot : node; + if (typeof window !== "undefined") { + window[Symbol.for("radix-ui")] = true; + } + return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef }); + }); + Node.displayName = `Primitive.${node}`; + return { ...primitive, [node]: Node }; +}, {}); +function dispatchDiscreteCustomEvent(target, event) { + if (target) ReactDOM.flushSync(() => target.dispatchEvent(event)); +} +var Root = Primitive; +export { + Primitive, + Root, + dispatchDiscreteCustomEvent +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-primitive/dist/index.mjs.map b/node_modules/@radix-ui/react-primitive/dist/index.mjs.map new file mode 100644 index 0000000..2995077 --- /dev/null +++ b/node_modules/@radix-ui/react-primitive/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/primitive.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { Slot } from '@radix-ui/react-slot';\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent };\ntype PrimitivePropsWithRef = React.ComponentPropsWithRef & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent\n extends React.ForwardRefExoticComponent> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props: PrimitivePropsWithRef, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return ;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click \uD83D\uDC4E\n * target.dispatchEvent(new Event(\u2018click\u2019))\n *\n * dispatching a custom type within a non-discrete event \uD83D\uDC4E\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(\u2018customType\u2019))}\n *\n * dispatching a custom type within a `discrete` event \uD83D\uDC4D\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(\u2018customType\u2019))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n"], + "mappings": ";AAAA,YAAY,WAAW;AACvB,YAAY,cAAc;AAC1B,SAAS,YAAY;AA0CV;AAxCX,IAAM,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAcA,IAAM,YAAY,MAAM,OAAO,CAAC,WAAW,SAAS;AAClD,QAAM,OAAa,iBAAW,CAAC,OAA2C,iBAAsB;AAC9F,UAAM,EAAE,SAAS,GAAG,eAAe,IAAI;AACvC,UAAM,OAAY,UAAU,OAAO;AAEnC,QAAI,OAAO,WAAW,aAAa;AACjC,MAAC,OAAe,OAAO,IAAI,UAAU,CAAC,IAAI;AAAA,IAC5C;AAEA,WAAO,oBAAC,QAAM,GAAG,gBAAgB,KAAK,cAAc;AAAA,EACtD,CAAC;AAED,OAAK,cAAc,aAAa,IAAI;AAEpC,SAAO,EAAE,GAAG,WAAW,CAAC,IAAI,GAAG,KAAK;AACtC,GAAG,CAAC,CAAe;AA2CnB,SAAS,4BAAmD,QAAqB,OAAU;AACzF,MAAI,OAAQ,CAAS,mBAAU,MAAM,OAAO,cAAc,KAAK,CAAC;AAClE;AAIA,IAAM,OAAO;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-primitive/package.json b/node_modules/@radix-ui/react-primitive/package.json new file mode 100644 index 0000000..fea3d91 --- /dev/null +++ b/node_modules/@radix-ui/react-primitive/package.json @@ -0,0 +1,66 @@ +{ + "name": "@radix-ui/react-primitive", + "version": "2.0.2", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "lint": "eslint --max-warnings 0 src", + "clean": "rm -rf dist", + "version": "yarn version" + }, + "dependencies": { + "@radix-ui/react-slot": "1.1.2" + }, + "devDependencies": { + "@repo/eslint-config": "0.0.0", + "@repo/typescript-config": "0.0.0", + "@types/react": "^19.0.7", + "@types/react-dom": "^19.0.3", + "eslint": "^9.18.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "typescript": "^5.7.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-slot/README.md b/node_modules/@radix-ui/react-slot/README.md new file mode 100644 index 0000000..0674da2 --- /dev/null +++ b/node_modules/@radix-ui/react-slot/README.md @@ -0,0 +1,13 @@ +# `react-slot` + +## Installation + +```sh +$ yarn add @radix-ui/react-slot +# or +$ npm install @radix-ui/react-slot +``` + +## Usage + +View docs [here](https://radix-ui.com/primitives/docs/utilities/slot). diff --git a/node_modules/@radix-ui/react-slot/dist/index.d.mts b/node_modules/@radix-ui/react-slot/dist/index.d.mts new file mode 100644 index 0000000..b4db7f6 --- /dev/null +++ b/node_modules/@radix-ui/react-slot/dist/index.d.mts @@ -0,0 +1,13 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as React from 'react'; + +interface SlotProps extends React.HTMLAttributes { + children?: React.ReactNode; +} +declare const Slot: React.ForwardRefExoticComponent>; +declare const Slottable: ({ children }: { + children: React.ReactNode; +}) => react_jsx_runtime.JSX.Element; +declare const Root: React.ForwardRefExoticComponent>; + +export { Root, Slot, type SlotProps, Slottable }; diff --git a/node_modules/@radix-ui/react-slot/dist/index.d.ts b/node_modules/@radix-ui/react-slot/dist/index.d.ts new file mode 100644 index 0000000..b4db7f6 --- /dev/null +++ b/node_modules/@radix-ui/react-slot/dist/index.d.ts @@ -0,0 +1,13 @@ +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as React from 'react'; + +interface SlotProps extends React.HTMLAttributes { + children?: React.ReactNode; +} +declare const Slot: React.ForwardRefExoticComponent>; +declare const Slottable: ({ children }: { + children: React.ReactNode; +}) => react_jsx_runtime.JSX.Element; +declare const Root: React.ForwardRefExoticComponent>; + +export { Root, Slot, type SlotProps, Slottable }; diff --git a/node_modules/@radix-ui/react-slot/dist/index.js b/node_modules/@radix-ui/react-slot/dist/index.js new file mode 100644 index 0000000..ce04194 --- /dev/null +++ b/node_modules/@radix-ui/react-slot/dist/index.js @@ -0,0 +1,118 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/slot/src/index.ts +var src_exports = {}; +__export(src_exports, { + Root: () => Root, + Slot: () => Slot, + Slottable: () => Slottable +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/slot/src/slot.tsx +var React = __toESM(require("react")); +var import_react_compose_refs = require("@radix-ui/react-compose-refs"); +var import_jsx_runtime = require("react/jsx-runtime"); +var Slot = React.forwardRef((props, forwardedRef) => { + const { children, ...slotProps } = props; + const childrenArray = React.Children.toArray(children); + const slottable = childrenArray.find(isSlottable); + if (slottable) { + const newElement = slottable.props.children; + const newChildren = childrenArray.map((child) => { + if (child === slottable) { + if (React.Children.count(newElement) > 1) return React.Children.only(null); + return React.isValidElement(newElement) ? newElement.props.children : null; + } else { + return child; + } + }); + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null }); + } + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children }); +}); +Slot.displayName = "Slot"; +var SlotClone = React.forwardRef((props, forwardedRef) => { + const { children, ...slotProps } = props; + if (React.isValidElement(children)) { + const childrenRef = getElementRef(children); + const props2 = mergeProps(slotProps, children.props); + if (children.type !== React.Fragment) { + props2.ref = forwardedRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, childrenRef) : childrenRef; + } + return React.cloneElement(children, props2); + } + return React.Children.count(children) > 1 ? React.Children.only(null) : null; +}); +SlotClone.displayName = "SlotClone"; +var Slottable = ({ children }) => { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children }); +}; +function isSlottable(child) { + return React.isValidElement(child) && child.type === Slottable; +} +function mergeProps(slotProps, childProps) { + const overrideProps = { ...childProps }; + for (const propName in childProps) { + const slotPropValue = slotProps[propName]; + const childPropValue = childProps[propName]; + const isHandler = /^on[A-Z]/.test(propName); + if (isHandler) { + if (slotPropValue && childPropValue) { + overrideProps[propName] = (...args) => { + childPropValue(...args); + slotPropValue(...args); + }; + } else if (slotPropValue) { + overrideProps[propName] = slotPropValue; + } + } else if (propName === "style") { + overrideProps[propName] = { ...slotPropValue, ...childPropValue }; + } else if (propName === "className") { + overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); + } + } + return { ...slotProps, ...overrideProps }; +} +function getElementRef(element) { + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.ref; + } + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.props.ref; + } + return element.props.ref || element.ref; +} +var Root = Slot; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-slot/dist/index.js.map b/node_modules/@radix-ui/react-slot/dist/index.js.map new file mode 100644 index 0000000..c56bd70 --- /dev/null +++ b/node_modules/@radix-ui/react-slot/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/slot.tsx"], + "sourcesContent": ["export {\n Slot,\n Slottable,\n //\n Root,\n} from './slot';\nexport type { SlotProps } from './slot';\n", "import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotProps extends React.HTMLAttributes {\n children?: React.ReactNode;\n}\n\nconst Slot = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n \n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n \n );\n }\n\n return (\n \n {children}\n \n );\n});\n\nSlot.displayName = 'Slot';\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\nconst SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\n\nSlotClone.displayName = 'SlotClone';\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children};\n};\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record;\n\nfunction isSlottable(\n child: React.ReactNode\n): child is React.ReactElement, typeof Slottable> {\n return React.isValidElement(child) && child.type === Slottable;\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref }).ref || (element as any).ref;\n}\n\nconst Root = Slot;\n\nexport {\n Slot,\n Slottable,\n //\n Root,\n};\nexport type { SlotProps };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,gCAA4B;AAiCtB;AAvBN,IAAM,OAAa,iBAAmC,CAAC,OAAO,iBAAiB;AAC7E,QAAM,EAAE,UAAU,GAAG,UAAU,IAAI;AACnC,QAAM,gBAAsB,eAAS,QAAQ,QAAQ;AACrD,QAAM,YAAY,cAAc,KAAK,WAAW;AAEhD,MAAI,WAAW;AAEb,UAAM,aAAa,UAAU,MAAM;AAEnC,UAAM,cAAc,cAAc,IAAI,CAAC,UAAU;AAC/C,UAAI,UAAU,WAAW;AAGvB,YAAU,eAAS,MAAM,UAAU,IAAI,EAAG,QAAa,eAAS,KAAK,IAAI;AACzE,eAAa,qBAAe,UAAU,IACjC,WAAW,MAAwC,WACpD;AAAA,MAC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sBAAc,QAAQ,IAAI;AAAA,MAC5B;AAAA,IACF,WAES,aAAa,SAAS;AAC7B,oBAAc,QAAQ,IAAI,EAAE,GAAG,eAAe,GAAG,eAAe;AAAA,IAClE,WAAW,aAAa,aAAa;AACnC,oBAAc,QAAQ,IAAI,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,EAAE,GAAG,WAAW,GAAG,cAAc;AAC1C;AAOA,SAAS,cAAc,SAA6B;AAElD,MAAI,SAAS,OAAO,yBAAyB,QAAQ,OAAO,KAAK,GAAG;AACpE,MAAI,UAAU,UAAU,oBAAoB,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAQ,QAAQ,MAAuC;AAAA,EACzD;AAGA,SAAQ,QAAQ,MAAuC,OAAQ,QAAgB;AACjF;AAEA,IAAM,OAAO;", + "names": ["props"] +} diff --git a/node_modules/@radix-ui/react-slot/dist/index.mjs b/node_modules/@radix-ui/react-slot/dist/index.mjs new file mode 100644 index 0000000..8d02f34 --- /dev/null +++ b/node_modules/@radix-ui/react-slot/dist/index.mjs @@ -0,0 +1,85 @@ +// packages/react/slot/src/slot.tsx +import * as React from "react"; +import { composeRefs } from "@radix-ui/react-compose-refs"; +import { Fragment as Fragment2, jsx } from "react/jsx-runtime"; +var Slot = React.forwardRef((props, forwardedRef) => { + const { children, ...slotProps } = props; + const childrenArray = React.Children.toArray(children); + const slottable = childrenArray.find(isSlottable); + if (slottable) { + const newElement = slottable.props.children; + const newChildren = childrenArray.map((child) => { + if (child === slottable) { + if (React.Children.count(newElement) > 1) return React.Children.only(null); + return React.isValidElement(newElement) ? newElement.props.children : null; + } else { + return child; + } + }); + return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null }); + } + return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children }); +}); +Slot.displayName = "Slot"; +var SlotClone = React.forwardRef((props, forwardedRef) => { + const { children, ...slotProps } = props; + if (React.isValidElement(children)) { + const childrenRef = getElementRef(children); + const props2 = mergeProps(slotProps, children.props); + if (children.type !== React.Fragment) { + props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef; + } + return React.cloneElement(children, props2); + } + return React.Children.count(children) > 1 ? React.Children.only(null) : null; +}); +SlotClone.displayName = "SlotClone"; +var Slottable = ({ children }) => { + return /* @__PURE__ */ jsx(Fragment2, { children }); +}; +function isSlottable(child) { + return React.isValidElement(child) && child.type === Slottable; +} +function mergeProps(slotProps, childProps) { + const overrideProps = { ...childProps }; + for (const propName in childProps) { + const slotPropValue = slotProps[propName]; + const childPropValue = childProps[propName]; + const isHandler = /^on[A-Z]/.test(propName); + if (isHandler) { + if (slotPropValue && childPropValue) { + overrideProps[propName] = (...args) => { + childPropValue(...args); + slotPropValue(...args); + }; + } else if (slotPropValue) { + overrideProps[propName] = slotPropValue; + } + } else if (propName === "style") { + overrideProps[propName] = { ...slotPropValue, ...childPropValue }; + } else if (propName === "className") { + overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); + } + } + return { ...slotProps, ...overrideProps }; +} +function getElementRef(element) { + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.ref; + } + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.props.ref; + } + return element.props.ref || element.ref; +} +var Root = Slot; +export { + Root, + Slot, + Slottable +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-slot/dist/index.mjs.map b/node_modules/@radix-ui/react-slot/dist/index.mjs.map new file mode 100644 index 0000000..b0e8f41 --- /dev/null +++ b/node_modules/@radix-ui/react-slot/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/slot.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotProps extends React.HTMLAttributes {\n children?: React.ReactNode;\n}\n\nconst Slot = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n \n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n \n );\n }\n\n return (\n \n {children}\n \n );\n});\n\nSlot.displayName = 'Slot';\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\nconst SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\n\nSlotClone.displayName = 'SlotClone';\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children};\n};\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record;\n\nfunction isSlottable(\n child: React.ReactNode\n): child is React.ReactElement, typeof Slottable> {\n return React.isValidElement(child) && child.type === Slottable;\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref }).ref || (element as any).ref;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,QAAgB;AACjF;AAEA,IAAM,OAAO;", + "names": ["Fragment", "props"] +} diff --git a/node_modules/@radix-ui/react-slot/package.json b/node_modules/@radix-ui/react-slot/package.json new file mode 100644 index 0000000..116b1be --- /dev/null +++ b/node_modules/@radix-ui/react-slot/package.json @@ -0,0 +1,61 @@ +{ + "name": "@radix-ui/react-slot", + "version": "1.1.2", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "lint": "eslint --max-warnings 0 src", + "clean": "rm -rf dist", + "version": "yarn version" + }, + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.1" + }, + "devDependencies": { + "@repo/eslint-config": "0.0.0", + "@repo/typescript-config": "0.0.0", + "@types/react": "^19.0.7", + "@types/react-dom": "^19.0.3", + "eslint": "^9.18.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "typescript": "^5.7.3" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-use-callback-ref/README.md b/node_modules/@radix-ui/react-use-callback-ref/README.md new file mode 100644 index 0000000..fbfdae9 --- /dev/null +++ b/node_modules/@radix-ui/react-use-callback-ref/README.md @@ -0,0 +1,13 @@ +# `react-use-callback-ref` + +## Installation + +```sh +$ yarn add @radix-ui/react-use-callback-ref +# or +$ npm install @radix-ui/react-use-callback-ref +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.mts b/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.mts new file mode 100644 index 0000000..9d20cd6 --- /dev/null +++ b/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.mts @@ -0,0 +1,7 @@ +/** + * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a + * prop or avoid re-executing effects when passed as a dependency + */ +declare function useCallbackRef any>(callback: T | undefined): T; + +export { useCallbackRef }; diff --git a/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.ts b/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.ts new file mode 100644 index 0000000..9d20cd6 --- /dev/null +++ b/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.ts @@ -0,0 +1,7 @@ +/** + * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a + * prop or avoid re-executing effects when passed as a dependency + */ +declare function useCallbackRef any>(callback: T | undefined): T; + +export { useCallbackRef }; diff --git a/node_modules/@radix-ui/react-use-callback-ref/dist/index.js b/node_modules/@radix-ui/react-use-callback-ref/dist/index.js new file mode 100644 index 0000000..17a2a98 --- /dev/null +++ b/node_modules/@radix-ui/react-use-callback-ref/dist/index.js @@ -0,0 +1,46 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/use-callback-ref/src/index.ts +var src_exports = {}; +__export(src_exports, { + useCallbackRef: () => useCallbackRef +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/use-callback-ref/src/useCallbackRef.tsx +var React = __toESM(require("react")); +function useCallbackRef(callback) { + const callbackRef = React.useRef(callback); + React.useEffect(() => { + callbackRef.current = callback; + }); + return React.useMemo(() => (...args) => callbackRef.current?.(...args), []); +} +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map b/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map new file mode 100644 index 0000000..115494d --- /dev/null +++ b/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/useCallbackRef.tsx"], + "sourcesContent": ["export { useCallbackRef } from './useCallbackRef';\n", "import * as React from 'react';\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */\nfunction useCallbackRef any>(callback: T | undefined): T {\n const callbackRef = React.useRef(callback);\n\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n\nexport { useCallbackRef };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAMvB,SAAS,eAAkD,UAA4B;AACrF,QAAM,cAAoB,aAAO,QAAQ;AAEzC,EAAM,gBAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC;AAGD,SAAa,cAAQ,MAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AACnF;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs b/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs new file mode 100644 index 0000000..8c3b777 --- /dev/null +++ b/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs @@ -0,0 +1,13 @@ +// packages/react/use-callback-ref/src/useCallbackRef.tsx +import * as React from "react"; +function useCallbackRef(callback) { + const callbackRef = React.useRef(callback); + React.useEffect(() => { + callbackRef.current = callback; + }); + return React.useMemo(() => (...args) => callbackRef.current?.(...args), []); +} +export { + useCallbackRef +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.map b/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.map new file mode 100644 index 0000000..aaf26db --- /dev/null +++ b/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/useCallbackRef.tsx"], + "sourcesContent": ["import * as React from 'react';\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */\nfunction useCallbackRef any>(callback: T | undefined): T {\n const callbackRef = React.useRef(callback);\n\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n\nexport { useCallbackRef };\n"], + "mappings": ";AAAA,YAAY,WAAW;AAMvB,SAAS,eAAkD,UAA4B;AACrF,QAAM,cAAoB,aAAO,QAAQ;AAEzC,EAAM,gBAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC;AAGD,SAAa,cAAQ,MAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AACnF;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-use-callback-ref/package.json b/node_modules/@radix-ui/react-use-callback-ref/package.json new file mode 100644 index 0000000..093d098 --- /dev/null +++ b/node_modules/@radix-ui/react-use-callback-ref/package.json @@ -0,0 +1,47 @@ +{ + "name": "@radix-ui/react-use-callback-ref", + "version": "1.1.0", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf dist", + "version": "yarn version" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-use-controllable-state/README.md b/node_modules/@radix-ui/react-use-controllable-state/README.md new file mode 100644 index 0000000..c7c5eea --- /dev/null +++ b/node_modules/@radix-ui/react-use-controllable-state/README.md @@ -0,0 +1,13 @@ +# `react-use-controllable-state` + +## Installation + +```sh +$ yarn add @radix-ui/react-use-controllable-state +# or +$ npm install @radix-ui/react-use-controllable-state +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.mts b/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.mts new file mode 100644 index 0000000..7f682c3 --- /dev/null +++ b/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.mts @@ -0,0 +1,10 @@ +import * as React from 'react'; + +type UseControllableStateParams = { + prop?: T | undefined; + defaultProp?: T | undefined; + onChange?: (state: T) => void; +}; +declare function useControllableState({ prop, defaultProp, onChange, }: UseControllableStateParams): readonly [T | undefined, React.Dispatch>]; + +export { useControllableState }; diff --git a/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.ts b/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.ts new file mode 100644 index 0000000..7f682c3 --- /dev/null +++ b/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; + +type UseControllableStateParams = { + prop?: T | undefined; + defaultProp?: T | undefined; + onChange?: (state: T) => void; +}; +declare function useControllableState({ prop, defaultProp, onChange, }: UseControllableStateParams): readonly [T | undefined, React.Dispatch>]; + +export { useControllableState }; diff --git a/node_modules/@radix-ui/react-use-controllable-state/dist/index.js b/node_modules/@radix-ui/react-use-controllable-state/dist/index.js new file mode 100644 index 0000000..8aaf9cc --- /dev/null +++ b/node_modules/@radix-ui/react-use-controllable-state/dist/index.js @@ -0,0 +1,80 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/use-controllable-state/src/index.ts +var src_exports = {}; +__export(src_exports, { + useControllableState: () => useControllableState +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/use-controllable-state/src/useControllableState.tsx +var React = __toESM(require("react")); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +function useControllableState({ + prop, + defaultProp, + onChange = () => { + } +}) { + const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange }); + const isControlled = prop !== void 0; + const value = isControlled ? prop : uncontrolledProp; + const handleChange = (0, import_react_use_callback_ref.useCallbackRef)(onChange); + const setValue = React.useCallback( + (nextValue) => { + if (isControlled) { + const setter = nextValue; + const value2 = typeof nextValue === "function" ? setter(prop) : nextValue; + if (value2 !== prop) handleChange(value2); + } else { + setUncontrolledProp(nextValue); + } + }, + [isControlled, prop, setUncontrolledProp, handleChange] + ); + return [value, setValue]; +} +function useUncontrolledState({ + defaultProp, + onChange +}) { + const uncontrolledState = React.useState(defaultProp); + const [value] = uncontrolledState; + const prevValueRef = React.useRef(value); + const handleChange = (0, import_react_use_callback_ref.useCallbackRef)(onChange); + React.useEffect(() => { + if (prevValueRef.current !== value) { + handleChange(value); + prevValueRef.current = value; + } + }, [value, prevValueRef, handleChange]); + return uncontrolledState; +} +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map b/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map new file mode 100644 index 0000000..d5e8a20 --- /dev/null +++ b/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/useControllableState.tsx"], + "sourcesContent": ["export { useControllableState } from './useControllableState';\n", "import * as React from 'react';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\ntype UseControllableStateParams = {\n prop?: T | undefined;\n defaultProp?: T | undefined;\n onChange?: (state: T) => void;\n};\n\ntype SetStateFn = (prevState?: T) => T;\n\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {},\n}: UseControllableStateParams) {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useCallbackRef(onChange);\n\n const setValue: React.Dispatch> = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const setter = nextValue as SetStateFn;\n const value = typeof nextValue === 'function' ? setter(prop) : nextValue;\n if (value !== prop) handleChange(value as T);\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, handleChange]\n );\n\n return [value, setValue] as const;\n}\n\nfunction useUncontrolledState({\n defaultProp,\n onChange,\n}: Omit, 'prop'>) {\n const uncontrolledState = React.useState(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = React.useRef(value);\n const handleChange = useCallbackRef(onChange);\n\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n handleChange(value as T);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef, handleChange]);\n\n return uncontrolledState;\n}\n\nexport { useControllableState };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,oCAA+B;AAU/B,SAAS,qBAAwB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,WAAW,MAAM;AAAA,EAAC;AACpB,GAAkC;AAChC,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,qBAAqB,EAAE,aAAa,SAAS,CAAC;AAC9F,QAAM,eAAe,SAAS;AAC9B,QAAM,QAAQ,eAAe,OAAO;AACpC,QAAM,mBAAe,8CAAe,QAAQ;AAE5C,QAAM,WAAsE;AAAA,IAC1E,CAAC,cAAc;AACb,UAAI,cAAc;AAChB,cAAM,SAAS;AACf,cAAMA,SAAQ,OAAO,cAAc,aAAa,OAAO,IAAI,IAAI;AAC/D,YAAIA,WAAU,KAAM,cAAaA,MAAU;AAAA,MAC7C,OAAO;AACL,4BAAoB,SAAS;AAAA,MAC/B;AAAA,IACF;AAAA,IACA,CAAC,cAAc,MAAM,qBAAqB,YAAY;AAAA,EACxD;AAEA,SAAO,CAAC,OAAO,QAAQ;AACzB;AAEA,SAAS,qBAAwB;AAAA,EAC/B;AAAA,EACA;AACF,GAAgD;AAC9C,QAAM,oBAA0B,eAAwB,WAAW;AACnE,QAAM,CAAC,KAAK,IAAI;AAChB,QAAM,eAAqB,aAAO,KAAK;AACvC,QAAM,mBAAe,8CAAe,QAAQ;AAE5C,EAAM,gBAAU,MAAM;AACpB,QAAI,aAAa,YAAY,OAAO;AAClC,mBAAa,KAAU;AACvB,mBAAa,UAAU;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,OAAO,cAAc,YAAY,CAAC;AAEtC,SAAO;AACT;", + "names": ["value"] +} diff --git a/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs b/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs new file mode 100644 index 0000000..944fc4c --- /dev/null +++ b/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs @@ -0,0 +1,47 @@ +// packages/react/use-controllable-state/src/useControllableState.tsx +import * as React from "react"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +function useControllableState({ + prop, + defaultProp, + onChange = () => { + } +}) { + const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange }); + const isControlled = prop !== void 0; + const value = isControlled ? prop : uncontrolledProp; + const handleChange = useCallbackRef(onChange); + const setValue = React.useCallback( + (nextValue) => { + if (isControlled) { + const setter = nextValue; + const value2 = typeof nextValue === "function" ? setter(prop) : nextValue; + if (value2 !== prop) handleChange(value2); + } else { + setUncontrolledProp(nextValue); + } + }, + [isControlled, prop, setUncontrolledProp, handleChange] + ); + return [value, setValue]; +} +function useUncontrolledState({ + defaultProp, + onChange +}) { + const uncontrolledState = React.useState(defaultProp); + const [value] = uncontrolledState; + const prevValueRef = React.useRef(value); + const handleChange = useCallbackRef(onChange); + React.useEffect(() => { + if (prevValueRef.current !== value) { + handleChange(value); + prevValueRef.current = value; + } + }, [value, prevValueRef, handleChange]); + return uncontrolledState; +} +export { + useControllableState +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.map b/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.map new file mode 100644 index 0000000..583c040 --- /dev/null +++ b/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/useControllableState.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\ntype UseControllableStateParams = {\n prop?: T | undefined;\n defaultProp?: T | undefined;\n onChange?: (state: T) => void;\n};\n\ntype SetStateFn = (prevState?: T) => T;\n\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {},\n}: UseControllableStateParams) {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useCallbackRef(onChange);\n\n const setValue: React.Dispatch> = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const setter = nextValue as SetStateFn;\n const value = typeof nextValue === 'function' ? setter(prop) : nextValue;\n if (value !== prop) handleChange(value as T);\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, handleChange]\n );\n\n return [value, setValue] as const;\n}\n\nfunction useUncontrolledState({\n defaultProp,\n onChange,\n}: Omit, 'prop'>) {\n const uncontrolledState = React.useState(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = React.useRef(value);\n const handleChange = useCallbackRef(onChange);\n\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n handleChange(value as T);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef, handleChange]);\n\n return uncontrolledState;\n}\n\nexport { useControllableState };\n"], + "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,sBAAsB;AAU/B,SAAS,qBAAwB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,WAAW,MAAM;AAAA,EAAC;AACpB,GAAkC;AAChC,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,qBAAqB,EAAE,aAAa,SAAS,CAAC;AAC9F,QAAM,eAAe,SAAS;AAC9B,QAAM,QAAQ,eAAe,OAAO;AACpC,QAAM,eAAe,eAAe,QAAQ;AAE5C,QAAM,WAAsE;AAAA,IAC1E,CAAC,cAAc;AACb,UAAI,cAAc;AAChB,cAAM,SAAS;AACf,cAAMA,SAAQ,OAAO,cAAc,aAAa,OAAO,IAAI,IAAI;AAC/D,YAAIA,WAAU,KAAM,cAAaA,MAAU;AAAA,MAC7C,OAAO;AACL,4BAAoB,SAAS;AAAA,MAC/B;AAAA,IACF;AAAA,IACA,CAAC,cAAc,MAAM,qBAAqB,YAAY;AAAA,EACxD;AAEA,SAAO,CAAC,OAAO,QAAQ;AACzB;AAEA,SAAS,qBAAwB;AAAA,EAC/B;AAAA,EACA;AACF,GAAgD;AAC9C,QAAM,oBAA0B,eAAwB,WAAW;AACnE,QAAM,CAAC,KAAK,IAAI;AAChB,QAAM,eAAqB,aAAO,KAAK;AACvC,QAAM,eAAe,eAAe,QAAQ;AAE5C,EAAM,gBAAU,MAAM;AACpB,QAAI,aAAa,YAAY,OAAO;AAClC,mBAAa,KAAU;AACvB,mBAAa,UAAU;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,OAAO,cAAc,YAAY,CAAC;AAEtC,SAAO;AACT;", + "names": ["value"] +} diff --git a/node_modules/@radix-ui/react-use-controllable-state/package.json b/node_modules/@radix-ui/react-use-controllable-state/package.json new file mode 100644 index 0000000..1e0225c --- /dev/null +++ b/node_modules/@radix-ui/react-use-controllable-state/package.json @@ -0,0 +1,50 @@ +{ + "name": "@radix-ui/react-use-controllable-state", + "version": "1.1.0", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf dist", + "version": "yarn version" + }, + "dependencies": { + "@radix-ui/react-use-callback-ref": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-use-escape-keydown/README.md b/node_modules/@radix-ui/react-use-escape-keydown/README.md new file mode 100644 index 0000000..fb08ecb --- /dev/null +++ b/node_modules/@radix-ui/react-use-escape-keydown/README.md @@ -0,0 +1,13 @@ +# `react-use-escape-keydown` + +## Installation + +```sh +$ yarn add @radix-ui/react-use-escape-keydown +# or +$ npm install @radix-ui/react-use-escape-keydown +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.mts b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.mts new file mode 100644 index 0000000..1d0324b --- /dev/null +++ b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.mts @@ -0,0 +1,6 @@ +/** + * Listens for when the escape key is down + */ +declare function useEscapeKeydown(onEscapeKeyDownProp?: (event: KeyboardEvent) => void, ownerDocument?: Document): void; + +export { useEscapeKeydown }; diff --git a/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.ts b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.ts new file mode 100644 index 0000000..1d0324b --- /dev/null +++ b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.ts @@ -0,0 +1,6 @@ +/** + * Listens for when the escape key is down + */ +declare function useEscapeKeydown(onEscapeKeyDownProp?: (event: KeyboardEvent) => void, ownerDocument?: Document): void; + +export { useEscapeKeydown }; diff --git a/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js new file mode 100644 index 0000000..2884f59 --- /dev/null +++ b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js @@ -0,0 +1,52 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/use-escape-keydown/src/index.ts +var src_exports = {}; +__export(src_exports, { + useEscapeKeydown: () => useEscapeKeydown +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/use-escape-keydown/src/useEscapeKeydown.tsx +var React = __toESM(require("react")); +var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref"); +function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) { + const onEscapeKeyDown = (0, import_react_use_callback_ref.useCallbackRef)(onEscapeKeyDownProp); + React.useEffect(() => { + const handleKeyDown = (event) => { + if (event.key === "Escape") { + onEscapeKeyDown(event); + } + }; + ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true }); + return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true }); + }, [onEscapeKeyDown, ownerDocument]); +} +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map new file mode 100644 index 0000000..0f6d263 --- /dev/null +++ b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/useEscapeKeydown.tsx"], + "sourcesContent": ["export { useEscapeKeydown } from './useEscapeKeydown';\n", "import * as React from 'react';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\n/**\n * Listens for when the escape key is down\n */\nfunction useEscapeKeydown(\n onEscapeKeyDownProp?: (event: KeyboardEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener('keydown', handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener('keydown', handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\n\nexport { useEscapeKeydown };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,oCAA+B;AAK/B,SAAS,iBACP,qBACA,gBAA0B,YAAY,UACtC;AACA,QAAM,sBAAkB,8CAAe,mBAAmB;AAE1D,EAAM,gBAAU,MAAM;AACpB,UAAM,gBAAgB,CAAC,UAAyB;AAC9C,UAAI,MAAM,QAAQ,UAAU;AAC1B,wBAAgB,KAAK;AAAA,MACvB;AAAA,IACF;AACA,kBAAc,iBAAiB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAC1E,WAAO,MAAM,cAAc,oBAAoB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAAA,EAC5F,GAAG,CAAC,iBAAiB,aAAa,CAAC;AACrC;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs new file mode 100644 index 0000000..0788d1b --- /dev/null +++ b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs @@ -0,0 +1,19 @@ +// packages/react/use-escape-keydown/src/useEscapeKeydown.tsx +import * as React from "react"; +import { useCallbackRef } from "@radix-ui/react-use-callback-ref"; +function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) { + const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp); + React.useEffect(() => { + const handleKeyDown = (event) => { + if (event.key === "Escape") { + onEscapeKeyDown(event); + } + }; + ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true }); + return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true }); + }, [onEscapeKeyDown, ownerDocument]); +} +export { + useEscapeKeydown +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs.map b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs.map new file mode 100644 index 0000000..cf98ca0 --- /dev/null +++ b/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/useEscapeKeydown.tsx"], + "sourcesContent": ["import * as React from 'react';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\n/**\n * Listens for when the escape key is down\n */\nfunction useEscapeKeydown(\n onEscapeKeyDownProp?: (event: KeyboardEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener('keydown', handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener('keydown', handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\n\nexport { useEscapeKeydown };\n"], + "mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,sBAAsB;AAK/B,SAAS,iBACP,qBACA,gBAA0B,YAAY,UACtC;AACA,QAAM,kBAAkB,eAAe,mBAAmB;AAE1D,EAAM,gBAAU,MAAM;AACpB,UAAM,gBAAgB,CAAC,UAAyB;AAC9C,UAAI,MAAM,QAAQ,UAAU;AAC1B,wBAAgB,KAAK;AAAA,MACvB;AAAA,IACF;AACA,kBAAc,iBAAiB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAC1E,WAAO,MAAM,cAAc,oBAAoB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAAA,EAC5F,GAAG,CAAC,iBAAiB,aAAa,CAAC;AACrC;", + "names": [] +} diff --git a/node_modules/@radix-ui/react-use-escape-keydown/package.json b/node_modules/@radix-ui/react-use-escape-keydown/package.json new file mode 100644 index 0000000..98fb731 --- /dev/null +++ b/node_modules/@radix-ui/react-use-escape-keydown/package.json @@ -0,0 +1,50 @@ +{ + "name": "@radix-ui/react-use-escape-keydown", + "version": "1.1.0", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf dist", + "version": "yarn version" + }, + "dependencies": { + "@radix-ui/react-use-callback-ref": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/@radix-ui/react-use-layout-effect/README.md b/node_modules/@radix-ui/react-use-layout-effect/README.md new file mode 100644 index 0000000..6dc82d7 --- /dev/null +++ b/node_modules/@radix-ui/react-use-layout-effect/README.md @@ -0,0 +1,13 @@ +# `react-use-layout-effect` + +## Installation + +```sh +$ yarn add @radix-ui/react-use-layout-effect +# or +$ npm install @radix-ui/react-use-layout-effect +``` + +## Usage + +This is an internal utility, not intended for public usage. diff --git a/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.mts b/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.mts new file mode 100644 index 0000000..11166f1 --- /dev/null +++ b/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.mts @@ -0,0 +1,12 @@ +import * as React from 'react'; + +/** + * On the server, React emits a warning when calling `useLayoutEffect`. + * This is because neither `useLayoutEffect` nor `useEffect` run on the server. + * We use this safe version which suppresses the warning by replacing it with a noop on the server. + * + * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect + */ +declare const useLayoutEffect: typeof React.useLayoutEffect; + +export { useLayoutEffect }; diff --git a/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.ts b/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.ts new file mode 100644 index 0000000..11166f1 --- /dev/null +++ b/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.ts @@ -0,0 +1,12 @@ +import * as React from 'react'; + +/** + * On the server, React emits a warning when calling `useLayoutEffect`. + * This is because neither `useLayoutEffect` nor `useEffect` run on the server. + * We use this safe version which suppresses the warning by replacing it with a noop on the server. + * + * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect + */ +declare const useLayoutEffect: typeof React.useLayoutEffect; + +export { useLayoutEffect }; diff --git a/node_modules/@radix-ui/react-use-layout-effect/dist/index.js b/node_modules/@radix-ui/react-use-layout-effect/dist/index.js new file mode 100644 index 0000000..f556c0b --- /dev/null +++ b/node_modules/@radix-ui/react-use-layout-effect/dist/index.js @@ -0,0 +1,41 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// packages/react/use-layout-effect/src/index.ts +var src_exports = {}; +__export(src_exports, { + useLayoutEffect: () => useLayoutEffect2 +}); +module.exports = __toCommonJS(src_exports); + +// packages/react/use-layout-effect/src/useLayoutEffect.tsx +var React = __toESM(require("react")); +var useLayoutEffect2 = Boolean(globalThis?.document) ? React.useLayoutEffect : () => { +}; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map b/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map new file mode 100644 index 0000000..935b66c --- /dev/null +++ b/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/index.ts", "../src/useLayoutEffect.tsx"], + "sourcesContent": ["export { useLayoutEffect } from './useLayoutEffect';\n", "import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = Boolean(globalThis?.document) ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,yBAAAA;AAAA;AAAA;;;ACAA,YAAuB;AASvB,IAAMC,mBAAkB,QAAQ,YAAY,QAAQ,IAAU,wBAAkB,MAAM;AAAC;", + "names": ["useLayoutEffect", "useLayoutEffect"] +} diff --git a/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs b/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs new file mode 100644 index 0000000..eec80d5 --- /dev/null +++ b/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs @@ -0,0 +1,8 @@ +// packages/react/use-layout-effect/src/useLayoutEffect.tsx +import * as React from "react"; +var useLayoutEffect2 = Boolean(globalThis?.document) ? React.useLayoutEffect : () => { +}; +export { + useLayoutEffect2 as useLayoutEffect +}; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.map b/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.map new file mode 100644 index 0000000..2ec43d8 --- /dev/null +++ b/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/useLayoutEffect.tsx"], + "sourcesContent": ["import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = Boolean(globalThis?.document) ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n"], + "mappings": ";AAAA,YAAY,WAAW;AASvB,IAAMA,mBAAkB,QAAQ,YAAY,QAAQ,IAAU,wBAAkB,MAAM;AAAC;", + "names": ["useLayoutEffect"] +} diff --git a/node_modules/@radix-ui/react-use-layout-effect/package.json b/node_modules/@radix-ui/react-use-layout-effect/package.json new file mode 100644 index 0000000..69d484b --- /dev/null +++ b/node_modules/@radix-ui/react-use-layout-effect/package.json @@ -0,0 +1,47 @@ +{ + "name": "@radix-ui/react-use-layout-effect", + "version": "1.1.0", + "license": "MIT", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "source": "./src/index.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist", + "README.md" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf dist", + "version": "yarn version" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + }, + "homepage": "https://radix-ui.com/primitives", + "repository": { + "type": "git", + "url": "git+https://github.com/radix-ui/primitives.git" + }, + "bugs": { + "url": "https://github.com/radix-ui/primitives/issues" + } +} \ No newline at end of file diff --git a/node_modules/aria-hidden/LICENSE b/node_modules/aria-hidden/LICENSE new file mode 100644 index 0000000..a194c88 --- /dev/null +++ b/node_modules/aria-hidden/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Anton Korzunov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/aria-hidden/README.md b/node_modules/aria-hidden/README.md new file mode 100644 index 0000000..74b34ff --- /dev/null +++ b/node_modules/aria-hidden/README.md @@ -0,0 +1,99 @@ +# aria-hidden + +[![NPM](https://nodei.co/npm/aria-hidden.png?downloads=true&stars=true)](https://nodei.co/npm/aria-hidden/) + +Hides from ARIA everything, except provided node(s). + +Helps to isolate modal dialogs and focused task - the content will be not accessible using +accessible tools. + +Now with [HTML inert](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert) support + +# API + +Just call `hideOthers` with DOM-node you want to keep, and it will _hide_ everything else. +`targetNode` could be placed anywhere - its siblings would be hidden, but it and its parents - not. + +> "hidden" in terms or `aria-hidden` + +```js +import { hideOthers } from 'aria-hidden'; + +const undo = hideOthers(exceptThisDOMnode); +// everything else is "aria-hidden" + +// undo changes +undo(); +``` + +you also may limit the effect spread by providing top level node as a second parameter + +```js +// keep only `anotherNode` node visible in #app +// the rest of document will be untouched +hideOthers(anotherNode, document.getElementById('app')); +``` + +> `parentNode` defaults to document.body + +# Inert + +While `aria-hidden` played important role in the past and will play in the future - the main +use case always was around isolating content and making elements "transparent" not only for aria, but for +user interaction as well. + +This is why you might consider using `inertOthers` + +```tsx +import { hideOthers, inertOthers, supportsInert } from 'aria-hidden'; + +// focus on element mean "hide others". Ideally disable interactions +const focusOnElement = (node) => (supportsInert() ? inertOthers(node) : hideOthers(node)); +``` + +the same function as above is already contructed and exported as + +```tsx +import { suppressOthers } from 'aria-hidden'; + +suppressOthers([keepThisNode, andThis]); +``` + +⚠️ Note - inert **will disable any interactions** with _suppressed_ elements ⚠️ + +### Suppressing interactivity without inert + +One can `marker`, the third argument to a function, to mark hidden elements. +Later one can create a style matching given marker to apply `pointer-events:none` + +```css +[hidden-node] { + pointer-events: none; +} +``` + +```tsx +hideOthers(notThisOne, undefined /*parent = document*/, 'hidden-node'); +``` + +Generally speaking the same can be achieved by addressing `[aria-hidden]` nodes, but +not all `aria-hidden` nodes are expected to be non-interactive. +Hence, it's better to separate concerns. + +# Inspiration + +Based on [smooth-ui](https://github.com/smooth-code/smooth-ui) modal dialogs. + +# See also + +- [inert](https://github.com/WICG/inert) - The HTML attribute/property to mark parts of the DOM tree as "inert". +- [react-focus-lock](https://github.com/theKashey/react-focus-lock) to lock Focus inside modal. +- [react-scroll-lock](https://github.com/theKashey/react-scroll-lock) to disable page scroll while modal is opened. + +# Size + +Code is 30 lines long + +# Licence + +MIT diff --git a/node_modules/aria-hidden/dist/es2015/index.d.ts b/node_modules/aria-hidden/dist/es2015/index.d.ts new file mode 100644 index 0000000..63bc43f --- /dev/null +++ b/node_modules/aria-hidden/dist/es2015/index.d.ts @@ -0,0 +1,29 @@ +export declare type Undo = () => void; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const hideOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const inertOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * @returns if current browser supports inert + */ +export declare const supportsInert: () => boolean; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const suppressOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; diff --git a/node_modules/aria-hidden/dist/es2015/index.js b/node_modules/aria-hidden/dist/es2015/index.js new file mode 100644 index 0000000..0db8f08 --- /dev/null +++ b/node_modules/aria-hidden/dist/es2015/index.js @@ -0,0 +1,166 @@ +var getDefaultParent = function (originalTarget) { + if (typeof document === 'undefined') { + return null; + } + var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; + return sampleTarget.ownerDocument.body; +}; +var counterMap = new WeakMap(); +var uncontrolledNodes = new WeakMap(); +var markerMap = {}; +var lockCount = 0; +var unwrapHost = function (node) { + return node && (node.host || unwrapHost(node.parentNode)); +}; +var correctTargets = function (parent, targets) { + return targets + .map(function (target) { + if (parent.contains(target)) { + return target; + } + var correctedTarget = unwrapHost(target); + if (correctedTarget && parent.contains(correctedTarget)) { + return correctedTarget; + } + console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); + return null; + }) + .filter(function (x) { return Boolean(x); }); +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @param {String} [controlAttribute] - html Attribute to control + * @return {Undo} undo command + */ +var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { + var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + if (!markerMap[markerName]) { + markerMap[markerName] = new WeakMap(); + } + var markerCounter = markerMap[markerName]; + var hiddenNodes = []; + var elementsToKeep = new Set(); + var elementsToStop = new Set(targets); + var keep = function (el) { + if (!el || elementsToKeep.has(el)) { + return; + } + elementsToKeep.add(el); + keep(el.parentNode); + }; + targets.forEach(keep); + var deep = function (parent) { + if (!parent || elementsToStop.has(parent)) { + return; + } + Array.prototype.forEach.call(parent.children, function (node) { + if (elementsToKeep.has(node)) { + deep(node); + } + else { + try { + var attr = node.getAttribute(controlAttribute); + var alreadyHidden = attr !== null && attr !== 'false'; + var counterValue = (counterMap.get(node) || 0) + 1; + var markerValue = (markerCounter.get(node) || 0) + 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + hiddenNodes.push(node); + if (counterValue === 1 && alreadyHidden) { + uncontrolledNodes.set(node, true); + } + if (markerValue === 1) { + node.setAttribute(markerName, 'true'); + } + if (!alreadyHidden) { + node.setAttribute(controlAttribute, 'true'); + } + } + catch (e) { + console.error('aria-hidden: cannot operate on ', node, e); + } + } + }); + }; + deep(parentNode); + elementsToKeep.clear(); + lockCount++; + return function () { + hiddenNodes.forEach(function (node) { + var counterValue = counterMap.get(node) - 1; + var markerValue = markerCounter.get(node) - 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + if (!counterValue) { + if (!uncontrolledNodes.has(node)) { + node.removeAttribute(controlAttribute); + } + uncontrolledNodes.delete(node); + } + if (!markerValue) { + node.removeAttribute(markerName); + } + }); + lockCount--; + if (!lockCount) { + // clear + counterMap = new WeakMap(); + counterMap = new WeakMap(); + uncontrolledNodes = new WeakMap(); + markerMap = {}; + } + }; +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export var hideOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-aria-hidden'; } + var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + var activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return function () { return null; }; + } + // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10 + targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]'))); + return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); +}; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export var inertOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-inert-ed'; } + var activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return function () { return null; }; + } + return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); +}; +/** + * @returns if current browser supports inert + */ +export var supportsInert = function () { + return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); +}; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export var suppressOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-suppressed'; } + return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName); +}; diff --git a/node_modules/aria-hidden/dist/es2019/index.d.ts b/node_modules/aria-hidden/dist/es2019/index.d.ts new file mode 100644 index 0000000..63bc43f --- /dev/null +++ b/node_modules/aria-hidden/dist/es2019/index.d.ts @@ -0,0 +1,29 @@ +export declare type Undo = () => void; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const hideOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const inertOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * @returns if current browser supports inert + */ +export declare const supportsInert: () => boolean; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const suppressOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; diff --git a/node_modules/aria-hidden/dist/es2019/index.js b/node_modules/aria-hidden/dist/es2019/index.js new file mode 100644 index 0000000..2801ff6 --- /dev/null +++ b/node_modules/aria-hidden/dist/es2019/index.js @@ -0,0 +1,155 @@ +const getDefaultParent = (originalTarget) => { + if (typeof document === 'undefined') { + return null; + } + const sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; + return sampleTarget.ownerDocument.body; +}; +let counterMap = new WeakMap(); +let uncontrolledNodes = new WeakMap(); +let markerMap = {}; +let lockCount = 0; +const unwrapHost = (node) => node && (node.host || unwrapHost(node.parentNode)); +const correctTargets = (parent, targets) => targets + .map((target) => { + if (parent.contains(target)) { + return target; + } + const correctedTarget = unwrapHost(target); + if (correctedTarget && parent.contains(correctedTarget)) { + return correctedTarget; + } + console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); + return null; +}) + .filter((x) => Boolean(x)); +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @param {String} [controlAttribute] - html Attribute to control + * @return {Undo} undo command + */ +const applyAttributeToOthers = (originalTarget, parentNode, markerName, controlAttribute) => { + const targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + if (!markerMap[markerName]) { + markerMap[markerName] = new WeakMap(); + } + const markerCounter = markerMap[markerName]; + const hiddenNodes = []; + const elementsToKeep = new Set(); + const elementsToStop = new Set(targets); + const keep = (el) => { + if (!el || elementsToKeep.has(el)) { + return; + } + elementsToKeep.add(el); + keep(el.parentNode); + }; + targets.forEach(keep); + const deep = (parent) => { + if (!parent || elementsToStop.has(parent)) { + return; + } + Array.prototype.forEach.call(parent.children, (node) => { + if (elementsToKeep.has(node)) { + deep(node); + } + else { + try { + const attr = node.getAttribute(controlAttribute); + const alreadyHidden = attr !== null && attr !== 'false'; + const counterValue = (counterMap.get(node) || 0) + 1; + const markerValue = (markerCounter.get(node) || 0) + 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + hiddenNodes.push(node); + if (counterValue === 1 && alreadyHidden) { + uncontrolledNodes.set(node, true); + } + if (markerValue === 1) { + node.setAttribute(markerName, 'true'); + } + if (!alreadyHidden) { + node.setAttribute(controlAttribute, 'true'); + } + } + catch (e) { + console.error('aria-hidden: cannot operate on ', node, e); + } + } + }); + }; + deep(parentNode); + elementsToKeep.clear(); + lockCount++; + return () => { + hiddenNodes.forEach((node) => { + const counterValue = counterMap.get(node) - 1; + const markerValue = markerCounter.get(node) - 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + if (!counterValue) { + if (!uncontrolledNodes.has(node)) { + node.removeAttribute(controlAttribute); + } + uncontrolledNodes.delete(node); + } + if (!markerValue) { + node.removeAttribute(markerName); + } + }); + lockCount--; + if (!lockCount) { + // clear + counterMap = new WeakMap(); + counterMap = new WeakMap(); + uncontrolledNodes = new WeakMap(); + markerMap = {}; + } + }; +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export const hideOthers = (originalTarget, parentNode, markerName = 'data-aria-hidden') => { + const targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + const activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return () => null; + } + // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10 + targets.push(...Array.from(activeParentNode.querySelectorAll('[aria-live]'))); + return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); +}; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export const inertOthers = (originalTarget, parentNode, markerName = 'data-inert-ed') => { + const activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return () => null; + } + return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); +}; +/** + * @returns if current browser supports inert + */ +export const supportsInert = () => typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export const suppressOthers = (originalTarget, parentNode, markerName = 'data-suppressed') => (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName); diff --git a/node_modules/aria-hidden/dist/es5/index.d.ts b/node_modules/aria-hidden/dist/es5/index.d.ts new file mode 100644 index 0000000..63bc43f --- /dev/null +++ b/node_modules/aria-hidden/dist/es5/index.d.ts @@ -0,0 +1,29 @@ +export declare type Undo = () => void; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const hideOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const inertOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; +/** + * @returns if current browser supports inert + */ +export declare const supportsInert: () => boolean; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +export declare const suppressOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo; diff --git a/node_modules/aria-hidden/dist/es5/index.js b/node_modules/aria-hidden/dist/es5/index.js new file mode 100644 index 0000000..03c4ab0 --- /dev/null +++ b/node_modules/aria-hidden/dist/es5/index.js @@ -0,0 +1,173 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.suppressOthers = exports.supportsInert = exports.inertOthers = exports.hideOthers = void 0; +var getDefaultParent = function (originalTarget) { + if (typeof document === 'undefined') { + return null; + } + var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; + return sampleTarget.ownerDocument.body; +}; +var counterMap = new WeakMap(); +var uncontrolledNodes = new WeakMap(); +var markerMap = {}; +var lockCount = 0; +var unwrapHost = function (node) { + return node && (node.host || unwrapHost(node.parentNode)); +}; +var correctTargets = function (parent, targets) { + return targets + .map(function (target) { + if (parent.contains(target)) { + return target; + } + var correctedTarget = unwrapHost(target); + if (correctedTarget && parent.contains(correctedTarget)) { + return correctedTarget; + } + console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); + return null; + }) + .filter(function (x) { return Boolean(x); }); +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @param {String} [controlAttribute] - html Attribute to control + * @return {Undo} undo command + */ +var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { + var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + if (!markerMap[markerName]) { + markerMap[markerName] = new WeakMap(); + } + var markerCounter = markerMap[markerName]; + var hiddenNodes = []; + var elementsToKeep = new Set(); + var elementsToStop = new Set(targets); + var keep = function (el) { + if (!el || elementsToKeep.has(el)) { + return; + } + elementsToKeep.add(el); + keep(el.parentNode); + }; + targets.forEach(keep); + var deep = function (parent) { + if (!parent || elementsToStop.has(parent)) { + return; + } + Array.prototype.forEach.call(parent.children, function (node) { + if (elementsToKeep.has(node)) { + deep(node); + } + else { + try { + var attr = node.getAttribute(controlAttribute); + var alreadyHidden = attr !== null && attr !== 'false'; + var counterValue = (counterMap.get(node) || 0) + 1; + var markerValue = (markerCounter.get(node) || 0) + 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + hiddenNodes.push(node); + if (counterValue === 1 && alreadyHidden) { + uncontrolledNodes.set(node, true); + } + if (markerValue === 1) { + node.setAttribute(markerName, 'true'); + } + if (!alreadyHidden) { + node.setAttribute(controlAttribute, 'true'); + } + } + catch (e) { + console.error('aria-hidden: cannot operate on ', node, e); + } + } + }); + }; + deep(parentNode); + elementsToKeep.clear(); + lockCount++; + return function () { + hiddenNodes.forEach(function (node) { + var counterValue = counterMap.get(node) - 1; + var markerValue = markerCounter.get(node) - 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + if (!counterValue) { + if (!uncontrolledNodes.has(node)) { + node.removeAttribute(controlAttribute); + } + uncontrolledNodes.delete(node); + } + if (!markerValue) { + node.removeAttribute(markerName); + } + }); + lockCount--; + if (!lockCount) { + // clear + counterMap = new WeakMap(); + counterMap = new WeakMap(); + uncontrolledNodes = new WeakMap(); + markerMap = {}; + } + }; +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +var hideOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-aria-hidden'; } + var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + var activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return function () { return null; }; + } + // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10 + targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]'))); + return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); +}; +exports.hideOthers = hideOthers; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +var inertOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-inert-ed'; } + var activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return function () { return null; }; + } + return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); +}; +exports.inertOthers = inertOthers; +/** + * @returns if current browser supports inert + */ +var supportsInert = function () { + return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); +}; +exports.supportsInert = supportsInert; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +var suppressOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { markerName = 'data-suppressed'; } + return ((0, exports.supportsInert)() ? exports.inertOthers : exports.hideOthers)(originalTarget, parentNode, markerName); +}; +exports.suppressOthers = suppressOthers; diff --git a/node_modules/aria-hidden/package.json b/node_modules/aria-hidden/package.json new file mode 100644 index 0000000..83cef88 --- /dev/null +++ b/node_modules/aria-hidden/package.json @@ -0,0 +1,70 @@ +{ + "name": "aria-hidden", + "version": "1.2.4", + "description": "Cast aria-hidden to everything, except...", + "main": "dist/es5/index.js", + "sideEffects": false, + "scripts": { + "test": "jest", + "dev": "lib-builder dev", + "test:ci": "jest --runInBand --coverage", + "build": "lib-builder build && yarn size:report", + "prepublish": "yarn build", + "release": "yarn build && yarn test", + "lint": "lib-builder lint", + "format": "lib-builder format", + "size": "npx size-limit", + "size:report": "npx size-limit --json > .size.json", + "update": "lib-builder update", + "prepublish-only": "yarn build && yarn changelog", + "prepare": "husky install", + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", + "changelog:rewrite": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0" + }, + "author": "Anton Korzunov ", + "license": "MIT", + "devDependencies": { + "@theuiteam/lib-builder": "^0.2.1", + "@size-limit/preset-small-lib": "^2.1.6" + }, + "engines": { + "node": ">=10" + }, + "jsnext:main": "dist/es2015/index.js", + "module": "dist/es2015/index.js", + "types": "dist/es5/index.d.ts", + "files": [ + "dist" + ], + "keywords": [ + "DOM", + "aria", + "hidden", + "inert" + ], + "homepage": "https://github.com/theKashey/aria-hidden#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/theKashey/aria-hidden.git" + }, + "dependencies": { + "tslib": "^2.0.0" + }, + "module:es2019": "dist/es2019/index.js", + "lint-staged": { + "*.{ts,tsx}": [ + "prettier --write", + "eslint --fix" + ], + "*.{js,css,json,md}": [ + "prettier --write" + ] + }, + "prettier": { + "printWidth": 120, + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": true + } +} diff --git a/node_modules/detect-node-es/LICENSE b/node_modules/detect-node-es/LICENSE new file mode 100644 index 0000000..3113356 --- /dev/null +++ b/node_modules/detect-node-es/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Ilya Kantor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/detect-node-es/Readme.md b/node_modules/detect-node-es/Readme.md new file mode 100644 index 0000000..ca47dfd --- /dev/null +++ b/node_modules/detect-node-es/Readme.md @@ -0,0 +1,39 @@ +## detect-node +> This is a fork of `detect-node`. + +Differences: +- uses named export {isNode} +- has d.ts integrated +- supports ESM + +### Install + +```shell +npm install --save detect-node-es +``` + +### Usage: + +```diff +-var isNode = require('detect-node'); ++var {isNode} = require('detect-node-es'); + +if (isNode) { + console.log("Running under Node.JS"); +} else { + alert("Hello from browser (or whatever not-a-node env)"); +} +``` + +The check is performed as: +```js +module.exports = false; + +// Only Node.JS has a process variable that is of [[Class]] process +try { + module.exports = Object.prototype.toString.call(global.process) === '[object process]' +} catch(e) {} + +``` + +Thanks to Ingvar Stepanyan for the initial idea. This check is both **the most reliable I could find** and it does not use `process` env directly, which would cause browserify to include it into the build. diff --git a/node_modules/detect-node-es/es5/browser.js b/node_modules/detect-node-es/es5/browser.js new file mode 100644 index 0000000..b82dc83 --- /dev/null +++ b/node_modules/detect-node-es/es5/browser.js @@ -0,0 +1,2 @@ +module.exports.isNode = false; + diff --git a/node_modules/detect-node-es/es5/node.d.ts b/node_modules/detect-node-es/es5/node.d.ts new file mode 100644 index 0000000..99a0ad7 --- /dev/null +++ b/node_modules/detect-node-es/es5/node.d.ts @@ -0,0 +1,4 @@ +/** + * returns true if the current environment is NodeJS + */ +export declare const isNode: boolean; \ No newline at end of file diff --git a/node_modules/detect-node-es/es5/node.js b/node_modules/detect-node-es/es5/node.js new file mode 100644 index 0000000..13f9217 --- /dev/null +++ b/node_modules/detect-node-es/es5/node.js @@ -0,0 +1,2 @@ +// Only Node.JS has a process variable that is of [[Class]] process +module.exports.isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; diff --git a/node_modules/detect-node-es/esm/browser.js b/node_modules/detect-node-es/esm/browser.js new file mode 100644 index 0000000..10742b6 --- /dev/null +++ b/node_modules/detect-node-es/esm/browser.js @@ -0,0 +1,2 @@ +export const isNode = false; + diff --git a/node_modules/detect-node-es/esm/node.js b/node_modules/detect-node-es/esm/node.js new file mode 100644 index 0000000..8b245b5 --- /dev/null +++ b/node_modules/detect-node-es/esm/node.js @@ -0,0 +1,2 @@ +// Only Node.JS has a process variable that is of [[Class]] process +export const isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; diff --git a/node_modules/detect-node-es/package.json b/node_modules/detect-node-es/package.json new file mode 100644 index 0000000..7fe4441 --- /dev/null +++ b/node_modules/detect-node-es/package.json @@ -0,0 +1,29 @@ +{ + "name": "detect-node-es", + "version": "1.1.0", + "description": "Detect Node.JS (as opposite to browser environment). ESM modification", + "main": "es5/node.js", + "module": "esm/node.js", + "browser": { + "./es5/node.js": "./es5/browser.js", + "./esm/node.js": "./esm/browser.js" + }, + "types": "es5/node.d.ts", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/thekashey/detect-node" + }, + "keywords": [ + "detect", + "node" + ], + "author": "Ilya Kantor", + "license": "MIT", + "bugs": { + "url": "https://github.com/thekashey/detect-node/issues" + }, + "homepage": "https://github.com/thekashey/detect-node" +} diff --git a/node_modules/get-nonce/CHANGELOG.md b/node_modules/get-nonce/CHANGELOG.md new file mode 100644 index 0000000..b7e1275 --- /dev/null +++ b/node_modules/get-nonce/CHANGELOG.md @@ -0,0 +1 @@ +# 1.0.0 (2020-04-16) diff --git a/node_modules/get-nonce/LICENSE b/node_modules/get-nonce/LICENSE new file mode 100644 index 0000000..9455bf5 --- /dev/null +++ b/node_modules/get-nonce/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Anton Korzunov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/get-nonce/README.md b/node_modules/get-nonce/README.md new file mode 100644 index 0000000..ec23bff --- /dev/null +++ b/node_modules/get-nonce/README.md @@ -0,0 +1,54 @@ +# get-nonce + +just returns a **nonce** (number used once). No batteries included in those 46 bytes of this library. + +--- + +- ✅ build in `webpack` support via `__webpack_nonce__` + +# API + +- `getNonce(): string|undefined` - returns the current `nonce` +- `setNonce(newValue)` - set's nonce value + +## Why? + +Why we need a library to access `__webpack_nonce__`? Abstractions! + +"I", as a library author, don't want to "predict" the platform "you" going to use. +"I", as well, want an easier way to test and control `nonce` value. + +Like - `nonce` is supported out of the box only by webpack, what you are going to do? + +This is why this "man-in-the-middle" was created. +Yep, think about `left-pad` :) + +## Webpack + +> https://webpack.js.org/guides/csp/ + +To activate the feature set a **webpack_nonce** variable needs to be included in your entry script. + +``` +__webpack_nonce__ = uuid(); // for example +``` + +Without `webpack` `__webpack_nonce__` is actually just a global variable, +which makes it actually bundler independent, +however "other bundlers" are able to replicate it only setting it as a global variable +(as here in tests) which violates a "secure" nature of `nonce`. + +`get-nonce` is not global. + +## Used in + +- `react-style-singleton` <- `react-remove-scroll` <- `react-focus-on` + +## Inspiration + +- [this issue](https://github.com/theKashey/react-remove-scroll/issues/21) +- [styled-components](https://github.com/styled-components/styled-components/blob/147b0e9a1f10786551b13fd27452fcd5c678d5e0/packages/styled-components/src/utils/nonce.js) + +# Licence + +MIT diff --git a/node_modules/get-nonce/dist/es2015/index.d.ts b/node_modules/get-nonce/dist/es2015/index.d.ts new file mode 100644 index 0000000..c8b67ce --- /dev/null +++ b/node_modules/get-nonce/dist/es2015/index.d.ts @@ -0,0 +1,2 @@ +export declare const setNonce: (nonce: string) => void; +export declare const getNonce: () => string | undefined; diff --git a/node_modules/get-nonce/dist/es2015/index.js b/node_modules/get-nonce/dist/es2015/index.js new file mode 100644 index 0000000..7b6f3c2 --- /dev/null +++ b/node_modules/get-nonce/dist/es2015/index.js @@ -0,0 +1,13 @@ +var currentNonce; +export var setNonce = function (nonce) { + currentNonce = nonce; +}; +export var getNonce = function () { + if (currentNonce) { + return currentNonce; + } + if (typeof __webpack_nonce__ !== 'undefined') { + return __webpack_nonce__; + } + return undefined; +}; diff --git a/node_modules/get-nonce/dist/es5/index.d.ts b/node_modules/get-nonce/dist/es5/index.d.ts new file mode 100644 index 0000000..c8b67ce --- /dev/null +++ b/node_modules/get-nonce/dist/es5/index.d.ts @@ -0,0 +1,2 @@ +export declare const setNonce: (nonce: string) => void; +export declare const getNonce: () => string | undefined; diff --git a/node_modules/get-nonce/dist/es5/index.js b/node_modules/get-nonce/dist/es5/index.js new file mode 100644 index 0000000..bc2ad2e --- /dev/null +++ b/node_modules/get-nonce/dist/es5/index.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var currentNonce; +exports.setNonce = function (nonce) { + currentNonce = nonce; +}; +exports.getNonce = function () { + if (currentNonce) { + return currentNonce; + } + if (typeof __webpack_nonce__ !== 'undefined') { + return __webpack_nonce__; + } + return undefined; +}; diff --git a/node_modules/get-nonce/package.json b/node_modules/get-nonce/package.json new file mode 100644 index 0000000..4086531 --- /dev/null +++ b/node_modules/get-nonce/package.json @@ -0,0 +1,68 @@ +{ + "name": "get-nonce", + "version": "1.0.1", + "description": "returns nonce", + "main": "dist/es5/index.js", + "types": "dist/es5/index.d.ts", + "sideEffects": false, + "repository": "git@github.com:theKashey/get-nonce.git", + "homepage": "https://github.com/theKashey/get-nonce", + "author": "Anton Korzunov ", + "license": "MIT", + "keywords": [ + "webpack", + "nonce", + "__webpack_nonce__" + ], + "devDependencies": { + "@theuiteam/lib-builder": "^0.0.10", + "@size-limit/preset-small-lib": "^2.1.6" + }, + "module": "dist/es2015/index.js", + "engines": { + "node": ">=6" + }, + "scripts": { + "dev": "lib-builder dev", + "test": "jest", + "test:ci": "jest --runInBand --coverage", + "build": "lib-builder build && yarn size:report", + "release": "yarn build && yarn test", + "size": "npx size-limit", + "size:report": "npx size-limit --json > .size.json", + "lint": "lib-builder lint", + "format": "lib-builder format", + "update": "lib-builder update", + "docz:dev": "docz dev", + "docz:build": "docz build", + "prepublish": "yarn build && yarn changelog", + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", + "changelog:rewrite": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0" + }, + "files": [ + "dist" + ], + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{ts,tsx}": [ + "prettier --write", + "tslint --fix", + "git add" + ], + "*.{js,css,json,md}": [ + "prettier --write", + "git add" + ] + }, + "prettier": { + "printWidth": 120, + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": true + } +} diff --git a/node_modules/react-dom/LICENSE b/node_modules/react-dom/LICENSE new file mode 100644 index 0000000..b93be90 --- /dev/null +++ b/node_modules/react-dom/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/react-dom/README.md b/node_modules/react-dom/README.md new file mode 100644 index 0000000..b078f19 --- /dev/null +++ b/node_modules/react-dom/README.md @@ -0,0 +1,60 @@ +# `react-dom` + +This package serves as the entry point to the DOM and server renderers for React. It is intended to be paired with the generic React package, which is shipped as `react` to npm. + +## Installation + +```sh +npm install react react-dom +``` + +## Usage + +### In the browser + +```js +import { createRoot } from 'react-dom/client'; + +function App() { + return

Hello World
; +} + +const root = createRoot(document.getElementById('root')); +root.render(); +``` + +### On the server + +```js +import { renderToPipeableStream } from 'react-dom/server'; + +function App() { + return
Hello World
; +} + +function handleRequest(res) { + // ... in your server handler ... + const stream = renderToPipeableStream(, { + onShellReady() { + res.statusCode = 200; + res.setHeader('Content-type', 'text/html'); + stream.pipe(res); + }, + // ... + }); +} +``` + +## API + +### `react-dom` + +See https://react.dev/reference/react-dom + +### `react-dom/client` + +See https://react.dev/reference/react-dom/client + +### `react-dom/server` + +See https://react.dev/reference/react-dom/server diff --git a/node_modules/react-dom/cjs/react-dom-client.development.js b/node_modules/react-dom/cjs/react-dom-client.development.js new file mode 100644 index 0000000..83ea1c6 --- /dev/null +++ b/node_modules/react-dom/cjs/react-dom-client.development.js @@ -0,0 +1,24716 @@ +/** + * @license React + * react-dom-client.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/* + Modernizr 3.0.0pre (Custom Build) | MIT +*/ +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function findHook(fiber, id) { + for (fiber = fiber.memoizedState; null !== fiber && 0 < id; ) + (fiber = fiber.next), id--; + return fiber; + } + function copyWithSetImpl(obj, path, index, value) { + if (index >= path.length) return value; + var key = path[index], + updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj); + updated[key] = copyWithSetImpl(obj[key], path, index + 1, value); + return updated; + } + function copyWithRename(obj, oldPath, newPath) { + if (oldPath.length !== newPath.length) + console.warn("copyWithRename() expects paths of the same length"); + else { + for (var i = 0; i < newPath.length - 1; i++) + if (oldPath[i] !== newPath[i]) { + console.warn( + "copyWithRename() expects paths to be the same except for the deepest key" + ); + return; + } + return copyWithRenameImpl(obj, oldPath, newPath, 0); + } + } + function copyWithRenameImpl(obj, oldPath, newPath, index) { + var oldKey = oldPath[index], + updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj); + index + 1 === oldPath.length + ? ((updated[newPath[index]] = updated[oldKey]), + isArrayImpl(updated) + ? updated.splice(oldKey, 1) + : delete updated[oldKey]) + : (updated[oldKey] = copyWithRenameImpl( + obj[oldKey], + oldPath, + newPath, + index + 1 + )); + return updated; + } + function copyWithDeleteImpl(obj, path, index) { + var key = path[index], + updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj); + if (index + 1 === path.length) + return ( + isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], + updated + ); + updated[key] = copyWithDeleteImpl(obj[key], path, index + 1); + return updated; + } + function shouldSuspendImpl() { + return !1; + } + function shouldErrorImpl() { + return null; + } + function createFiber(tag, pendingProps, key, mode) { + return new FiberNode(tag, pendingProps, key, mode); + } + function warnInvalidHookAccess() { + console.error( + "Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks" + ); + } + function warnInvalidContextAccess() { + console.error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + } + function noop$2() {} + function warnForMissingKey() {} + function setToSortedString(set) { + var array = []; + set.forEach(function (value) { + array.push(value); + }); + return array.sort().join(", "); + } + function scheduleRoot(root, element) { + root.context === emptyContextObject && + (updateContainerSync(element, root, null, null), flushSyncWork$1()); + } + function scheduleRefresh(root, update) { + if (null !== resolveFamily) { + var staleFamilies = update.staleFamilies; + update = update.updatedFamilies; + flushPassiveEffects(); + scheduleFibersWithFamiliesRecursively( + root.current, + update, + staleFamilies + ); + flushSyncWork$1(); + } + } + function setRefreshHandler(handler) { + resolveFamily = handler; + } + function isValidContainer(node) { + return !( + !node || + (1 !== node.nodeType && 9 !== node.nodeType && 11 !== node.nodeType) + ); + } + function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) + return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; + } + function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + } + if ("object" === typeof type) + switch ( + ("number" === typeof type.tag && + console.error( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." + ), + type.$$typeof) + ) { + case REACT_CONTEXT_TYPE: + return (type.displayName || "Context") + ".Provider"; + case REACT_CONSUMER_TYPE: + return (type._context.displayName || "Context") + ".Consumer"; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; + } + function getComponentNameFromOwner(owner) { + return "number" === typeof owner.tag + ? getComponentNameFromFiber(owner) + : "string" === typeof owner.name + ? owner.name + : null; + } + function getComponentNameFromFiber(fiber) { + var type = fiber.type; + switch (fiber.tag) { + case 24: + return "Cache"; + case 9: + return (type._context.displayName || "Context") + ".Consumer"; + case 10: + return (type.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return ( + (fiber = type.render), + (fiber = fiber.displayName || fiber.name || ""), + type.displayName || + ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef") + ); + case 7: + return "Fragment"; + case 26: + case 27: + case 5: + return type; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return getComponentNameFromType(type); + case 8: + return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 1: + case 0: + case 14: + case 15: + if ("function" === typeof type) + return type.displayName || type.name || null; + if ("string" === typeof type) return type; + break; + case 29: + type = fiber._debugInfo; + if (null != type) + for (var i = type.length - 1; 0 <= i; i--) + if ("string" === typeof type[i].name) return type[i].name; + if (null !== fiber.return) + return getComponentNameFromFiber(fiber.return); + } + return null; + } + function disabledLog() {} + function disableLogs() { + if (0 === disabledDepth) { + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; + var props = { + configurable: !0, + enumerable: !0, + value: disabledLog, + writable: !0 + }; + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + } + disabledDepth++; + } + function reenableLogs() { + disabledDepth--; + if (0 === disabledDepth) { + var props = { configurable: !0, enumerable: !0, writable: !0 }; + Object.defineProperties(console, { + log: assign({}, props, { value: prevLog }), + info: assign({}, props, { value: prevInfo }), + warn: assign({}, props, { value: prevWarn }), + error: assign({}, props, { value: prevError }), + group: assign({}, props, { value: prevGroup }), + groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), + groupEnd: assign({}, props, { value: prevGroupEnd }) + }); + } + 0 > disabledDepth && + console.error( + "disabledDepth fell below zero. This is a bug in React. Please file an issue." + ); + } + function describeBuiltInComponentFrame(name) { + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; + } + return "\n" + prefix + name + suffix; + } + function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) return ""; + var frame = componentFrameCache.get(fn); + if (void 0 !== frame) return frame; + reentry = !0; + frame = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var previousDispatcher = null; + previousDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = null; + disableLogs(); + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { + throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x$1) { + control = x$1; + } + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); + } + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; + } + return [null, null]; + } + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); + var _RunInRootFrame$Deter = + RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + if (sampleStack && controlStack) { + var sampleLines = sampleStack.split("\n"), + controlLines = controlStack.split("\n"); + for ( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( + "DetermineComponentFrameRoot" + ); + + ) + namePropDescriptor++; + for ( + ; + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); + + ) + _RunInRootFrame$Deter++; + if ( + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length + ) + for ( + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; + + ) + _RunInRootFrame$Deter--; + for ( + ; + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- + ) + if ( + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] + ) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { + do + if ( + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) + ) { + var _frame = + "\n" + + sampleLines[namePropDescriptor].replace( + " at new ", + " at " + ); + fn.displayName && + _frame.includes("") && + (_frame = _frame.replace("", fn.displayName)); + "function" === typeof fn && + componentFrameCache.set(fn, _frame); + return _frame; + } + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); + } + break; + } + } + } finally { + (reentry = !1), + (ReactSharedInternals.H = previousDispatcher), + reenableLogs(), + (Error.prepareStackTrace = frame); + } + sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(sampleLines) + : ""; + "function" === typeof fn && componentFrameCache.set(fn, sampleLines); + return sampleLines; + } + function describeFiber(fiber) { + switch (fiber.tag) { + case 26: + case 27: + case 5: + return describeBuiltInComponentFrame(fiber.type); + case 16: + return describeBuiltInComponentFrame("Lazy"); + case 13: + return describeBuiltInComponentFrame("Suspense"); + case 19: + return describeBuiltInComponentFrame("SuspenseList"); + case 0: + case 15: + return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + case 11: + return ( + (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber + ); + case 1: + return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + default: + return ""; + } + } + function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + do { + info += describeFiber(workInProgress); + var debugInfo = workInProgress._debugInfo; + if (debugInfo) + for (var i = debugInfo.length - 1; 0 <= i; i--) { + var entry = debugInfo[i]; + if ("string" === typeof entry.name) { + var JSCompiler_temp_const = info, + env = entry.env; + var JSCompiler_inline_result = describeBuiltInComponentFrame( + entry.name + (env ? " [" + env + "]" : "") + ); + info = JSCompiler_temp_const + JSCompiler_inline_result; + } + } + workInProgress = workInProgress.return; + } while (workInProgress); + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } + function getCurrentFiberOwnerNameInDevOrNull() { + if (null === current) return null; + var owner = current._debugOwner; + return null != owner ? getComponentNameFromOwner(owner) : null; + } + function getCurrentFiberStackInDev() { + return null === current ? "" : getStackByFiberInDevAndProd(current); + } + function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { + var previousFiber = current; + ReactSharedInternals.getCurrentStack = + null === fiber ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = fiber; + try { + return callback(arg0, arg1, arg2, arg3, arg4); + } finally { + current = previousFiber; + } + throw Error( + "runWithFiberInDEV should never be called in production. This is a bug in React." + ); + } + function getNearestMountedFiber(fiber) { + var node = fiber, + nearestMounted = fiber; + if (fiber.alternate) for (; node.return; ) node = node.return; + else { + fiber = node; + do + (node = fiber), + 0 !== (node.flags & 4098) && (nearestMounted = node.return), + (fiber = node.return); + while (fiber); + } + return 3 === node.tag ? nearestMounted : null; + } + function getSuspenseInstanceFromFiber(fiber) { + if (13 === fiber.tag) { + var suspenseState = fiber.memoizedState; + null === suspenseState && + ((fiber = fiber.alternate), + null !== fiber && (suspenseState = fiber.memoizedState)); + if (null !== suspenseState) return suspenseState.dehydrated; + } + return null; + } + function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) + throw Error("Unable to find node on an unmounted component."); + } + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + alternate = getNearestMountedFiber(fiber); + if (null === alternate) + throw Error("Unable to find node on an unmounted component."); + return alternate !== fiber ? null : fiber; + } + for (var a = fiber, b = alternate; ; ) { + var parentA = a.return; + if (null === parentA) break; + var parentB = parentA.alternate; + if (null === parentB) { + b = parentA.return; + if (null !== b) { + a = b; + continue; + } + break; + } + if (parentA.child === parentB.child) { + for (parentB = parentA.child; parentB; ) { + if (parentB === a) return assertIsMounted(parentA), fiber; + if (parentB === b) return assertIsMounted(parentA), alternate; + parentB = parentB.sibling; + } + throw Error("Unable to find node on an unmounted component."); + } + if (a.return !== b.return) (a = parentA), (b = parentB); + else { + for (var didFindChild = !1, _child = parentA.child; _child; ) { + if (_child === a) { + didFindChild = !0; + a = parentA; + b = parentB; + break; + } + if (_child === b) { + didFindChild = !0; + b = parentA; + a = parentB; + break; + } + _child = _child.sibling; + } + if (!didFindChild) { + for (_child = parentB.child; _child; ) { + if (_child === a) { + didFindChild = !0; + a = parentB; + b = parentA; + break; + } + if (_child === b) { + didFindChild = !0; + b = parentB; + a = parentA; + break; + } + _child = _child.sibling; + } + if (!didFindChild) + throw Error( + "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." + ); + } + } + if (a.alternate !== b) + throw Error( + "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." + ); + } + if (3 !== a.tag) + throw Error("Unable to find node on an unmounted component."); + return a.stateNode.current === a ? fiber : alternate; + } + function findCurrentHostFiberImpl(node) { + var tag = node.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; + for (node = node.child; null !== node; ) { + tag = findCurrentHostFiberImpl(node); + if (null !== tag) return tag; + node = node.sibling; + } + return null; + } + function createCursor(defaultValue) { + return { current: defaultValue }; + } + function pop(cursor, fiber) { + 0 > index$jscomp$0 + ? console.error("Unexpected pop.") + : (fiber !== fiberStack[index$jscomp$0] && + console.error("Unexpected Fiber popped."), + (cursor.current = valueStack[index$jscomp$0]), + (valueStack[index$jscomp$0] = null), + (fiberStack[index$jscomp$0] = null), + index$jscomp$0--); + } + function push(cursor, value, fiber) { + index$jscomp$0++; + valueStack[index$jscomp$0] = cursor.current; + fiberStack[index$jscomp$0] = fiber; + cursor.current = value; + } + function requiredContext(c) { + null === c && + console.error( + "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." + ); + return c; + } + function pushHostContainer(fiber, nextRootInstance) { + push(rootInstanceStackCursor, nextRootInstance, fiber); + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, null, fiber); + var nextRootContext = nextRootInstance.nodeType; + switch (nextRootContext) { + case 9: + case 11: + nextRootContext = 9 === nextRootContext ? "#document" : "#fragment"; + nextRootInstance = (nextRootInstance = + nextRootInstance.documentElement) + ? (nextRootInstance = nextRootInstance.namespaceURI) + ? getOwnHostContext(nextRootInstance) + : HostContextNamespaceNone + : HostContextNamespaceNone; + break; + default: + if ( + ((nextRootInstance = + 8 === nextRootContext + ? nextRootInstance.parentNode + : nextRootInstance), + (nextRootContext = nextRootInstance.tagName), + (nextRootInstance = nextRootInstance.namespaceURI)) + ) + (nextRootInstance = getOwnHostContext(nextRootInstance)), + (nextRootInstance = getChildHostContextProd( + nextRootInstance, + nextRootContext + )); + else + switch (nextRootContext) { + case "svg": + nextRootInstance = HostContextNamespaceSvg; + break; + case "math": + nextRootInstance = HostContextNamespaceMath; + break; + default: + nextRootInstance = HostContextNamespaceNone; + } + } + nextRootContext = nextRootContext.toLowerCase(); + nextRootContext = updatedAncestorInfoDev(null, nextRootContext); + nextRootContext = { + context: nextRootInstance, + ancestorInfo: nextRootContext + }; + pop(contextStackCursor, fiber); + push(contextStackCursor, nextRootContext, fiber); + } + function popHostContainer(fiber) { + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); + pop(rootInstanceStackCursor, fiber); + } + function getHostContext() { + return requiredContext(contextStackCursor.current); + } + function pushHostContext(fiber) { + null !== fiber.memoizedState && + push(hostTransitionProviderCursor, fiber, fiber); + var context = requiredContext(contextStackCursor.current); + var type = fiber.type; + var nextContext = getChildHostContextProd(context.context, type); + type = updatedAncestorInfoDev(context.ancestorInfo, type); + nextContext = { context: nextContext, ancestorInfo: type }; + context !== nextContext && + (push(contextFiberStackCursor, fiber, fiber), + push(contextStackCursor, nextContext, fiber)); + } + function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && + (pop(contextStackCursor, fiber), pop(contextFiberStackCursor, fiber)); + hostTransitionProviderCursor.current === fiber && + (pop(hostTransitionProviderCursor, fiber), + (HostTransitionContext._currentValue = NotPendingTransition)); + } + function typeName(value) { + return ( + ("function" === typeof Symbol && + Symbol.toStringTag && + value[Symbol.toStringTag]) || + value.constructor.name || + "Object" + ); + } + function willCoercionThrow(value) { + try { + return testStringCoercion(value), !1; + } catch (e) { + return !0; + } + } + function testStringCoercion(value) { + return "" + value; + } + function checkAttributeStringCoercion(value, attributeName) { + if (willCoercionThrow(value)) + return ( + console.error( + "The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.", + attributeName, + typeName(value) + ), + testStringCoercion(value) + ); + } + function checkCSSPropertyStringCoercion(value, propName) { + if (willCoercionThrow(value)) + return ( + console.error( + "The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.", + propName, + typeName(value) + ), + testStringCoercion(value) + ); + } + function checkFormFieldValueStringCoercion(value) { + if (willCoercionThrow(value)) + return ( + console.error( + "Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.", + typeName(value) + ), + testStringCoercion(value) + ); + } + function injectInternals(internals) { + if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1; + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook.isDisabled) return !0; + if (!hook.supportsFiber) + return ( + console.error( + "The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools" + ), + !0 + ); + try { + (rendererID = hook.inject(internals)), (injectedHook = hook); + } catch (err) { + console.error("React instrumentation encountered an error: %s.", err); + } + return hook.checkDCE ? !0 : !1; + } + function onCommitRoot$1(root, eventPriority) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (root.current.flags & 128); + switch (eventPriority) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %s", + err + )); + } + } + function setIsStrictModeForDevtools(newIsStrictMode) { + "function" === typeof log$1 && + unstable_setDisableYieldValue(newIsStrictMode); + if (injectedHook && "function" === typeof injectedHook.setStrictMode) + try { + injectedHook.setStrictMode(rendererID, newIsStrictMode); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %s", + err + )); + } + } + function injectProfilingHooks(profilingHooks) { + injectedProfilingHooks = profilingHooks; + } + function markCommitStopped() { + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markCommitStopped && + injectedProfilingHooks.markCommitStopped(); + } + function markComponentRenderStarted(fiber) { + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentRenderStarted && + injectedProfilingHooks.markComponentRenderStarted(fiber); + } + function markComponentRenderStopped() { + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentRenderStopped && + injectedProfilingHooks.markComponentRenderStopped(); + } + function markRenderStarted(lanes) { + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markRenderStarted && + injectedProfilingHooks.markRenderStarted(lanes); + } + function markRenderStopped() { + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markRenderStopped && + injectedProfilingHooks.markRenderStopped(); + } + function markStateUpdateScheduled(fiber, lane) { + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markStateUpdateScheduled && + injectedProfilingHooks.markStateUpdateScheduled(fiber, lane); + } + function clz32Fallback(x) { + x >>>= 0; + return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; + } + function getLabelForLane(lane) { + if (lane & 1) return "SyncHydrationLane"; + if (lane & 2) return "Sync"; + if (lane & 4) return "InputContinuousHydration"; + if (lane & 8) return "InputContinuous"; + if (lane & 16) return "DefaultHydration"; + if (lane & 32) return "Default"; + if (lane & 64) return "TransitionHydration"; + if (lane & 4194176) return "Transition"; + if (lane & 62914560) return "Retry"; + if (lane & 67108864) return "SelectiveHydration"; + if (lane & 134217728) return "IdleHydration"; + if (lane & 268435456) return "Idle"; + if (lane & 536870912) return "Offscreen"; + if (lane & 1073741824) return "Deferred"; + } + function getHighestPriorityLanes(lanes) { + var pendingSyncLanes = lanes & 42; + if (0 !== pendingSyncLanes) return pendingSyncLanes; + switch (lanes & -lanes) { + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + return 64; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return lanes & 4194176; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + return lanes & 62914560; + case 67108864: + return 67108864; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 0; + default: + return ( + console.error( + "Should have found matching lanes. This is a bug in React." + ), + lanes + ); + } + } + function getNextLanes(root, wipLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) return 0; + var nextLanes = 0, + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + warmLanes = root.warmLanes; + root = 0 !== root.finishedLanes; + var nonIdlePendingLanes = pendingLanes & 134217727; + 0 !== nonIdlePendingLanes + ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : root || + ((warmLanes = nonIdlePendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : root || + ((warmLanes = pendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes)))); + return 0 === nextLanes + ? 0 + : 0 !== wipLanes && + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + ? wipLanes + : nextLanes; + } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } + function computeExpirationTime(lane, currentTime) { + switch (lane) { + case 1: + case 2: + case 4: + case 8: + return currentTime + 250; + case 16: + case 32: + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return currentTime + 5e3; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + return -1; + case 67108864: + case 134217728: + case 268435456: + case 536870912: + case 1073741824: + return -1; + default: + return ( + console.error( + "Should have found matching lanes. This is a bug in React." + ), + -1 + ); + } + } + function claimNextTransitionLane() { + var lane = nextTransitionLane; + nextTransitionLane <<= 1; + 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); + return lane; + } + function claimNextRetryLane() { + var lane = nextRetryLane; + nextRetryLane <<= 1; + 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304); + return lane; + } + function createLaneMap(initial) { + for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); + return laneMap; + } + function markRootUpdated$1(root, updateLane) { + root.pendingLanes |= updateLane; + 268435456 !== updateLane && + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); + } + function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ) { + var previouslyPendingLanes = root.pendingLanes; + root.pendingLanes = remainingLanes; + root.suspendedLanes = 0; + root.pingedLanes = 0; + root.warmLanes = 0; + root.expiredLanes &= remainingLanes; + root.entangledLanes &= remainingLanes; + root.errorRecoveryDisabledLanes &= remainingLanes; + root.shellSuspendCounter = 0; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; + for ( + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; + + ) { + var index = 31 - clz32(remainingLanes), + lane = 1 << index; + entanglements[index] = 0; + expirationTimes[index] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index]; + if (null !== hiddenUpdatesForLane) + for ( + hiddenUpdates[index] = null, index = 0; + index < hiddenUpdatesForLane.length; + index++ + ) { + var update = hiddenUpdatesForLane[index]; + null !== update && (update.lane &= -536870913); + } + remainingLanes &= ~lane; + } + 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root.tag && + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); + } + function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { + root.pendingLanes |= spawnedLane; + root.suspendedLanes &= ~spawnedLane; + var spawnedLaneIndex = 31 - clz32(spawnedLane); + root.entangledLanes |= spawnedLane; + root.entanglements[spawnedLaneIndex] = + root.entanglements[spawnedLaneIndex] | + 1073741824 | + (entangledLanes & 4194218); + } + function markRootEntangled(root, entangledLanes) { + var rootEntangledLanes = (root.entangledLanes |= entangledLanes); + for (root = root.entanglements; rootEntangledLanes; ) { + var index = 31 - clz32(rootEntangledLanes), + lane = 1 << index; + (lane & entangledLanes) | (root[index] & entangledLanes) && + (root[index] |= entangledLanes); + rootEntangledLanes &= ~lane; + } + } + function addFiberToLanesMap(root, fiber, lanes) { + if (isDevToolsPresent) + for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { + var index = 31 - clz32(lanes), + lane = 1 << index; + root[index].add(fiber); + lanes &= ~lane; + } + } + function movePendingFibersToMemoized(root, lanes) { + if (isDevToolsPresent) + for ( + var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap, + memoizedUpdaters = root.memoizedUpdaters; + 0 < lanes; + + ) { + var index = 31 - clz32(lanes); + root = 1 << index; + index = pendingUpdatersLaneMap[index]; + 0 < index.size && + (index.forEach(function (fiber) { + var alternate = fiber.alternate; + (null !== alternate && memoizedUpdaters.has(alternate)) || + memoizedUpdaters.add(fiber); + }), + index.clear()); + lanes &= ~root; + } + } + function lanesToEventPriority(lanes) { + lanes &= -lanes; + return 0 !== DiscreteEventPriority && DiscreteEventPriority < lanes + ? 0 !== ContinuousEventPriority && ContinuousEventPriority < lanes + ? 0 !== (lanes & 134217727) + ? DefaultEventPriority + : IdleEventPriority + : ContinuousEventPriority + : DiscreteEventPriority; + } + function resolveUpdatePriority() { + var updatePriority = ReactDOMSharedInternals.p; + if (0 !== updatePriority) return updatePriority; + updatePriority = window.event; + return void 0 === updatePriority + ? DefaultEventPriority + : getEventPriority(updatePriority.type); + } + function runWithPriority(priority, fn) { + var previousPriority = ReactDOMSharedInternals.p; + try { + return (ReactDOMSharedInternals.p = priority), fn(); + } finally { + ReactDOMSharedInternals.p = previousPriority; + } + } + function detachDeletedInstance(node) { + delete node[internalInstanceKey]; + delete node[internalPropsKey]; + delete node[internalEventHandlersKey]; + delete node[internalEventHandlerListenersKey]; + delete node[internalEventHandlesSetKey]; + } + function getClosestInstanceFromNode(targetNode) { + var targetInst = targetNode[internalInstanceKey]; + if (targetInst) return targetInst; + for (var parentNode = targetNode.parentNode; parentNode; ) { + if ( + (targetInst = + parentNode[internalContainerInstanceKey] || + parentNode[internalInstanceKey]) + ) { + parentNode = targetInst.alternate; + if ( + null !== targetInst.child || + (null !== parentNode && null !== parentNode.child) + ) + for ( + targetNode = getParentSuspenseInstance(targetNode); + null !== targetNode; + + ) { + if ((parentNode = targetNode[internalInstanceKey])) + return parentNode; + targetNode = getParentSuspenseInstance(targetNode); + } + return targetInst; + } + targetNode = parentNode; + parentNode = targetNode.parentNode; + } + return null; + } + function getInstanceFromNode(node) { + if ( + (node = node[internalInstanceKey] || node[internalContainerInstanceKey]) + ) { + var tag = node.tag; + if ( + 5 === tag || + 6 === tag || + 13 === tag || + 26 === tag || + 27 === tag || + 3 === tag + ) + return node; + } + return null; + } + function getNodeFromInstance(inst) { + var tag = inst.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) + return inst.stateNode; + throw Error("getNodeFromInstance: Invalid argument."); + } + function getResourcesFromRoot(root) { + var resources = root[internalRootNodeResourcesKey]; + resources || + (resources = root[internalRootNodeResourcesKey] = + { hoistableStyles: new Map(), hoistableScripts: new Map() }); + return resources; + } + function markNodeAsHoistable(node) { + node[internalHoistableMarker] = !0; + } + function registerTwoPhaseEvent(registrationName, dependencies) { + registerDirectEvent(registrationName, dependencies); + registerDirectEvent(registrationName + "Capture", dependencies); + } + function registerDirectEvent(registrationName, dependencies) { + registrationNameDependencies[registrationName] && + console.error( + "EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", + registrationName + ); + registrationNameDependencies[registrationName] = dependencies; + var lowerCasedName = registrationName.toLowerCase(); + possibleRegistrationNames[lowerCasedName] = registrationName; + "onDoubleClick" === registrationName && + (possibleRegistrationNames.ondblclick = registrationName); + for ( + registrationName = 0; + registrationName < dependencies.length; + registrationName++ + ) + allNativeEvents.add(dependencies[registrationName]); + } + function checkControlledValueProps(tagName, props) { + hasReadOnlyValue[props.type] || + props.onChange || + props.onInput || + props.readOnly || + props.disabled || + null == props.value || + ("select" === tagName + ? console.error( + "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`." + ) + : console.error( + "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`." + )); + props.onChange || + props.readOnly || + props.disabled || + null == props.checked || + console.error( + "You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`." + ); + } + function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) + return !0; + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) + return !1; + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) + return (validatedAttributeNameCache[attributeName] = !0); + illegalAttributeNameCache[attributeName] = !0; + console.error("Invalid attribute name: `%s`", attributeName); + return !1; + } + function getValueForAttributeOnCustomComponent(node, name, expected) { + if (isAttributeNameSafe(name)) { + if (!node.hasAttribute(name)) { + switch (typeof expected) { + case "symbol": + case "object": + return expected; + case "function": + return expected; + case "boolean": + if (!1 === expected) return expected; + } + return void 0 === expected ? void 0 : null; + } + node = node.getAttribute(name); + if ("" === node && !0 === expected) return !0; + checkAttributeStringCoercion(expected, name); + return node === "" + expected ? expected : node; + } + } + function setValueForAttribute(node, name, value) { + if (isAttributeNameSafe(name)) + if (null === value) node.removeAttribute(name); + else { + switch (typeof value) { + case "undefined": + case "function": + case "symbol": + node.removeAttribute(name); + return; + case "boolean": + var prefix = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix && "aria-" !== prefix) { + node.removeAttribute(name); + return; + } + } + checkAttributeStringCoercion(value, name); + node.setAttribute(name, "" + value); + } + } + function setValueForKnownAttribute(node, name, value) { + if (null === value) node.removeAttribute(name); + else { + switch (typeof value) { + case "undefined": + case "function": + case "symbol": + case "boolean": + node.removeAttribute(name); + return; + } + checkAttributeStringCoercion(value, name); + node.setAttribute(name, "" + value); + } + } + function setValueForNamespacedAttribute(node, namespace, name, value) { + if (null === value) node.removeAttribute(name); + else { + switch (typeof value) { + case "undefined": + case "function": + case "symbol": + case "boolean": + node.removeAttribute(name); + return; + } + checkAttributeStringCoercion(value, name); + node.setAttributeNS(namespace, name, "" + value); + } + } + function getToStringValue(value) { + switch (typeof value) { + case "bigint": + case "boolean": + case "number": + case "string": + case "undefined": + return value; + case "object": + return checkFormFieldValueStringCoercion(value), value; + default: + return ""; + } + } + function isCheckable(elem) { + var type = elem.type; + return ( + (elem = elem.nodeName) && + "input" === elem.toLowerCase() && + ("checkbox" === type || "radio" === type) + ); + } + function trackValueOnNode(node) { + var valueField = isCheckable(node) ? "checked" : "value", + descriptor = Object.getOwnPropertyDescriptor( + node.constructor.prototype, + valueField + ); + checkFormFieldValueStringCoercion(node[valueField]); + var currentValue = "" + node[valueField]; + if ( + !node.hasOwnProperty(valueField) && + "undefined" !== typeof descriptor && + "function" === typeof descriptor.get && + "function" === typeof descriptor.set + ) { + var get = descriptor.get, + set = descriptor.set; + Object.defineProperty(node, valueField, { + configurable: !0, + get: function () { + return get.call(this); + }, + set: function (value) { + checkFormFieldValueStringCoercion(value); + currentValue = "" + value; + set.call(this, value); + } + }); + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable + }); + return { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + checkFormFieldValueStringCoercion(value); + currentValue = "" + value; + }, + stopTracking: function () { + node._valueTracker = null; + delete node[valueField]; + } + }; + } + } + function track(node) { + node._valueTracker || (node._valueTracker = trackValueOnNode(node)); + } + function updateValueIfChanged(node) { + if (!node) return !1; + var tracker = node._valueTracker; + if (!tracker) return !0; + var lastValue = tracker.getValue(); + var value = ""; + node && + (value = isCheckable(node) + ? node.checked + ? "true" + : "false" + : node.value); + node = value; + return node !== lastValue ? (tracker.setValue(node), !0) : !1; + } + function getActiveElement(doc) { + doc = doc || ("undefined" !== typeof document ? document : void 0); + if ("undefined" === typeof doc) return null; + try { + return doc.activeElement || doc.body; + } catch (e) { + return doc.body; + } + } + function escapeSelectorAttributeValueInsideDoubleQuotes(value) { + return value.replace( + escapeSelectorAttributeValueInsideDoubleQuotesRegex, + function (ch) { + return "\\" + ch.charCodeAt(0).toString(16) + " "; + } + ); + } + function validateInputProps(element, props) { + void 0 === props.checked || + void 0 === props.defaultChecked || + didWarnCheckedDefaultChecked || + (console.error( + "%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components", + getCurrentFiberOwnerNameInDevOrNull() || "A component", + props.type + ), + (didWarnCheckedDefaultChecked = !0)); + void 0 === props.value || + void 0 === props.defaultValue || + didWarnValueDefaultValue$1 || + (console.error( + "%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components", + getCurrentFiberOwnerNameInDevOrNull() || "A component", + props.type + ), + (didWarnValueDefaultValue$1 = !0)); + } + function updateInput( + element, + value, + defaultValue, + lastDefaultValue, + checked, + defaultChecked, + type, + name + ) { + element.name = ""; + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type + ? (checkAttributeStringCoercion(type, "type"), (element.type = type)) + : element.removeAttribute("type"); + if (null != value) + if ("number" === type) { + if ((0 === value && "" === element.value) || element.value != value) + element.value = "" + getToStringValue(value); + } else + element.value !== "" + getToStringValue(value) && + (element.value = "" + getToStringValue(value)); + else + ("submit" !== type && "reset" !== type) || + element.removeAttribute("value"); + null != value + ? setDefaultValue(element, type, getToStringValue(value)) + : null != defaultValue + ? setDefaultValue(element, type, getToStringValue(defaultValue)) + : null != lastDefaultValue && element.removeAttribute("value"); + null == checked && + null != defaultChecked && + (element.defaultChecked = !!defaultChecked); + null != checked && + (element.checked = + checked && + "function" !== typeof checked && + "symbol" !== typeof checked); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name + ? (checkAttributeStringCoercion(name, "name"), + (element.name = "" + getToStringValue(name))) + : element.removeAttribute("name"); + } + function initInput( + element, + value, + defaultValue, + checked, + defaultChecked, + type, + name, + isHydrating + ) { + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type && + (checkAttributeStringCoercion(type, "type"), (element.type = type)); + if (null != value || null != defaultValue) { + if ( + !( + ("submit" !== type && "reset" !== type) || + (void 0 !== value && null !== value) + ) + ) + return; + defaultValue = + null != defaultValue ? "" + getToStringValue(defaultValue) : ""; + value = null != value ? "" + getToStringValue(value) : defaultValue; + isHydrating || value === element.value || (element.value = value); + element.defaultValue = value; + } + checked = null != checked ? checked : defaultChecked; + checked = + "function" !== typeof checked && + "symbol" !== typeof checked && + !!checked; + element.checked = isHydrating ? element.checked : !!checked; + element.defaultChecked = !!checked; + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name && + (checkAttributeStringCoercion(name, "name"), (element.name = name)); + } + function setDefaultValue(node, type, value) { + ("number" === type && getActiveElement(node.ownerDocument) === node) || + node.defaultValue === "" + value || + (node.defaultValue = "" + value); + } + function validateOptionProps(element, props) { + null == props.value && + ("object" === typeof props.children && null !== props.children + ? React.Children.forEach(props.children, function (child) { + null == child || + "string" === typeof child || + "number" === typeof child || + "bigint" === typeof child || + didWarnInvalidChild || + ((didWarnInvalidChild = !0), + console.error( + "Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to