@dmsi/wedgekit-react 0.0.50 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/{chunk-VC3R5EUH.js → chunk-6R2HCLEL.js} +2 -2
  2. package/dist/{chunk-VKMJ63WV.js → chunk-ATOEGP3V.js} +3 -3
  3. package/dist/{chunk-Z4UCFUF7.js → chunk-B6PDZCU7.js} +7 -3
  4. package/dist/{chunk-T22EH3MG.js → chunk-FOC6LTSX.js} +1 -1
  5. package/dist/chunk-SWA5WVQO.js +49 -0
  6. package/dist/components/DataGrid.cjs +83 -85
  7. package/dist/components/DataGrid.js +5 -5
  8. package/dist/components/DataGridCell.cjs +51 -53
  9. package/dist/components/DataGridCell.js +5 -5
  10. package/dist/components/Menu.cjs +21 -27
  11. package/dist/components/Menu.js +3 -3
  12. package/dist/components/MenuOption.cjs +14 -20
  13. package/dist/components/MenuOption.js +2 -2
  14. package/dist/components/Modal.cjs +22 -28
  15. package/dist/components/Modal.js +1 -1
  16. package/dist/components/NestedMenu.cjs +40 -49
  17. package/dist/components/NestedMenu.js +4 -33
  18. package/dist/components/ProjectBar.cjs +10 -16
  19. package/dist/components/ProjectBar.js +1 -1
  20. package/dist/components/useMenuSystem.cjs +29 -31
  21. package/dist/components/useMenuSystem.js +2 -2
  22. package/dist/hooks/index.cjs +77 -0
  23. package/dist/{components/useMatchesMedia.js → hooks/index.js} +3 -1
  24. package/package.json +6 -1
  25. package/src/components/Menu.tsx +1 -1
  26. package/src/components/MenuOption.tsx +11 -10
  27. package/src/components/Modal.tsx +1 -1
  28. package/src/components/ProjectBar.tsx +1 -1
  29. package/src/components/useMenuSystem.tsx +23 -12
  30. package/src/hooks/index.ts +1 -0
  31. package/src/hooks/useMatchesMedia.ts +18 -0
  32. package/dist/chunk-SEKKGFM6.js +0 -28
  33. package/dist/components/useMatchesMedia.cjs +0 -53
  34. package/src/components/useMatchesMedia.tsx +0 -28
@@ -1,28 +0,0 @@
1
- // src/components/useMatchesMedia.tsx
2
- import { useLayoutEffect, useState } from "react";
3
- var useMatchesMedia = (query) => {
4
- const [matches, setMatches] = useState(
5
- () => typeof window !== "undefined" ? window.matchMedia(query).matches : false
6
- );
7
- useLayoutEffect(() => {
8
- const mediaQueryList = window.matchMedia(query);
9
- const listener = (event) => {
10
- setMatches(event.matches);
11
- };
12
- mediaQueryList.addEventListener("change", listener);
13
- setMatches(mediaQueryList.matches);
14
- return () => {
15
- mediaQueryList.removeEventListener("change", listener);
16
- };
17
- }, [query]);
18
- return matches;
19
- };
20
- var useMatchesMobile = () => {
21
- const isMobile = useMatchesMedia("(width < 48rem)");
22
- return isMobile;
23
- };
24
-
25
- export {
26
- useMatchesMedia,
27
- useMatchesMobile
28
- };
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/components/useMatchesMedia.tsx
21
- var useMatchesMedia_exports = {};
22
- __export(useMatchesMedia_exports, {
23
- useMatchesMedia: () => useMatchesMedia,
24
- useMatchesMobile: () => useMatchesMobile
25
- });
26
- module.exports = __toCommonJS(useMatchesMedia_exports);
27
- var import_react = require("react");
28
- var useMatchesMedia = (query) => {
29
- const [matches, setMatches] = (0, import_react.useState)(
30
- () => typeof window !== "undefined" ? window.matchMedia(query).matches : false
31
- );
32
- (0, import_react.useLayoutEffect)(() => {
33
- const mediaQueryList = window.matchMedia(query);
34
- const listener = (event) => {
35
- setMatches(event.matches);
36
- };
37
- mediaQueryList.addEventListener("change", listener);
38
- setMatches(mediaQueryList.matches);
39
- return () => {
40
- mediaQueryList.removeEventListener("change", listener);
41
- };
42
- }, [query]);
43
- return matches;
44
- };
45
- var useMatchesMobile = () => {
46
- const isMobile = useMatchesMedia("(width < 48rem)");
47
- return isMobile;
48
- };
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
51
- useMatchesMedia,
52
- useMatchesMobile
53
- });
@@ -1,28 +0,0 @@
1
- import { useLayoutEffect, useState } from "react";
2
-
3
- export const useMatchesMedia = (query: string): boolean => {
4
- const [matches, setMatches] = useState(() =>
5
- typeof window !== "undefined" ? window.matchMedia(query).matches : false,
6
- );
7
-
8
- useLayoutEffect(() => {
9
- const mediaQueryList = window.matchMedia(query);
10
- const listener = (event: MediaQueryListEvent) => {
11
- setMatches(event.matches);
12
- };
13
-
14
- mediaQueryList.addEventListener("change", listener);
15
- setMatches(mediaQueryList.matches);
16
- return () => {
17
- mediaQueryList.removeEventListener("change", listener);
18
- };
19
- }, [query]);
20
-
21
- return matches;
22
- };
23
-
24
- export const useMatchesMobile = (): boolean => {
25
- const isMobile = useMatchesMedia("(width < 48rem)");
26
-
27
- return isMobile;
28
- };