@squiz/resource-browser 1.32.1-alpha.12

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 (160) hide show
  1. package/.storybook/main.ts +23 -0
  2. package/.storybook/preview-head.html +15 -0
  3. package/.storybook/preview.ts +16 -0
  4. package/build.js +21 -0
  5. package/jest.config.ts +18 -0
  6. package/lib/Icons/Generics/ArrowDown.d.ts +15 -0
  7. package/lib/Icons/Generics/ArrowDown.js +23 -0
  8. package/lib/Icons/Generics/ArrowRight.d.ts +15 -0
  9. package/lib/Icons/Generics/ArrowRight.js +23 -0
  10. package/lib/Icons/Generics/Close.d.ts +15 -0
  11. package/lib/Icons/Generics/Close.js +23 -0
  12. package/lib/Icons/Generics/GenericIconMap.d.ts +10 -0
  13. package/lib/Icons/Generics/GenericIconMap.js +14 -0
  14. package/lib/Icons/Generics/ResourceSelect.d.ts +15 -0
  15. package/lib/Icons/Generics/ResourceSelect.js +28 -0
  16. package/lib/Icons/Generics/Root.d.ts +15 -0
  17. package/lib/Icons/Generics/Root.js +23 -0
  18. package/lib/Icons/Generics/Selected.d.ts +15 -0
  19. package/lib/Icons/Generics/Selected.js +23 -0
  20. package/lib/Icons/Generics/index.d.ts +6 -0
  21. package/lib/Icons/Generics/index.js +19 -0
  22. package/lib/Icons/Icon.d.ts +47 -0
  23. package/lib/Icons/Icon.js +44 -0
  24. package/lib/Icons/MatrixResources/Audio.d.ts +15 -0
  25. package/lib/Icons/MatrixResources/Audio.js +28 -0
  26. package/lib/Icons/MatrixResources/Excel.d.ts +15 -0
  27. package/lib/Icons/MatrixResources/Excel.js +27 -0
  28. package/lib/Icons/MatrixResources/Folder.d.ts +15 -0
  29. package/lib/Icons/MatrixResources/Folder.js +24 -0
  30. package/lib/Icons/MatrixResources/GenericFile.d.ts +15 -0
  31. package/lib/Icons/MatrixResources/GenericFile.js +28 -0
  32. package/lib/Icons/MatrixResources/Image.d.ts +15 -0
  33. package/lib/Icons/MatrixResources/Image.js +26 -0
  34. package/lib/Icons/MatrixResources/MatrixResourceMap.d.ts +15 -0
  35. package/lib/Icons/MatrixResources/MatrixResourceMap.js +19 -0
  36. package/lib/Icons/MatrixResources/Page.d.ts +15 -0
  37. package/lib/Icons/MatrixResources/Page.js +30 -0
  38. package/lib/Icons/MatrixResources/Pdf.d.ts +15 -0
  39. package/lib/Icons/MatrixResources/Pdf.js +31 -0
  40. package/lib/Icons/MatrixResources/Powerpoint.d.ts +15 -0
  41. package/lib/Icons/MatrixResources/Powerpoint.js +28 -0
  42. package/lib/Icons/MatrixResources/Site.d.ts +15 -0
  43. package/lib/Icons/MatrixResources/Site.js +30 -0
  44. package/lib/Icons/MatrixResources/Video.d.ts +15 -0
  45. package/lib/Icons/MatrixResources/Video.js +24 -0
  46. package/lib/Icons/MatrixResources/Word.d.ts +17 -0
  47. package/lib/Icons/MatrixResources/Word.js +28 -0
  48. package/lib/Icons/MatrixResources/index.d.ts +11 -0
  49. package/lib/Icons/MatrixResources/index.js +29 -0
  50. package/lib/Modal/Modal.d.ts +11 -0
  51. package/lib/Modal/Modal.js +46 -0
  52. package/lib/Modal/ModalOpeningButton.d.ts +10 -0
  53. package/lib/Modal/ModalOpeningButton.js +13 -0
  54. package/lib/Modal/ModalTrigger.d.ts +9 -0
  55. package/lib/Modal/ModalTrigger.js +24 -0
  56. package/lib/PreviewPanel/PreviewModal.d.ts +11 -0
  57. package/lib/PreviewPanel/PreviewModal.js +81 -0
  58. package/lib/PreviewPanel/PreviewPanel.d.ts +16 -0
  59. package/lib/PreviewPanel/PreviewPanel.js +87 -0
  60. package/lib/PreviewPanel/details/MatrixResource.d.ts +12 -0
  61. package/lib/PreviewPanel/details/MatrixResource.js +41 -0
  62. package/lib/ResourceBreadcrumb/ResourceBreadcrumb.d.ts +9 -0
  63. package/lib/ResourceBreadcrumb/ResourceBreadcrumb.js +20 -0
  64. package/lib/ResourceItem/ResourceItem.d.ts +19 -0
  65. package/lib/ResourceItem/ResourceItem.js +26 -0
  66. package/lib/ResourceList/ResourceList.d.ts +14 -0
  67. package/lib/ResourceList/ResourceList.js +51 -0
  68. package/lib/ResourcePickerContainer/ResourcePickerContainer.d.ts +15 -0
  69. package/lib/ResourcePickerContainer/ResourcePickerContainer.js +145 -0
  70. package/lib/Skeleton/List/SkeletonList.d.ts +6 -0
  71. package/lib/Skeleton/List/SkeletonList.js +13 -0
  72. package/lib/Skeleton/ListItem/SkeletonListItem.d.ts +2 -0
  73. package/lib/Skeleton/ListItem/SkeletonListItem.js +15 -0
  74. package/lib/SourceDropdown/SourceDropdown.d.ts +9 -0
  75. package/lib/SourceDropdown/SourceDropdown.js +106 -0
  76. package/lib/SourceList/SourceList.d.ts +14 -0
  77. package/lib/SourceList/SourceList.js +58 -0
  78. package/lib/Spinner/Spinner.d.ts +8 -0
  79. package/lib/Spinner/Spinner.js +12 -0
  80. package/lib/index.css +968 -0
  81. package/lib/index.d.ts +37 -0
  82. package/lib/index.js +15 -0
  83. package/lib/uuid.d.ts +1 -0
  84. package/lib/uuid.js +8 -0
  85. package/package.json +74 -0
  86. package/postcss.config.js +11 -0
  87. package/src/Icons/Generics/ArrowDown.tsx +27 -0
  88. package/src/Icons/Generics/ArrowRight.tsx +27 -0
  89. package/src/Icons/Generics/Close.tsx +26 -0
  90. package/src/Icons/Generics/GenericIconMap.ts +14 -0
  91. package/src/Icons/Generics/ResourceSelect.tsx +40 -0
  92. package/src/Icons/Generics/Root.tsx +24 -0
  93. package/src/Icons/Generics/Selected.tsx +27 -0
  94. package/src/Icons/Generics/index.tsx +7 -0
  95. package/src/Icons/Icon.spec.tsx +62 -0
  96. package/src/Icons/Icon.stories.tsx +105 -0
  97. package/src/Icons/Icon.tsx +61 -0
  98. package/src/Icons/MatrixResources/Audio.tsx +30 -0
  99. package/src/Icons/MatrixResources/Excel.tsx +29 -0
  100. package/src/Icons/MatrixResources/Folder.tsx +29 -0
  101. package/src/Icons/MatrixResources/GenericFile.tsx +34 -0
  102. package/src/Icons/MatrixResources/Image.tsx +36 -0
  103. package/src/Icons/MatrixResources/MatrixResourceMap.ts +19 -0
  104. package/src/Icons/MatrixResources/Page.tsx +33 -0
  105. package/src/Icons/MatrixResources/Pdf.tsx +34 -0
  106. package/src/Icons/MatrixResources/Powerpoint.tsx +34 -0
  107. package/src/Icons/MatrixResources/Site.tsx +37 -0
  108. package/src/Icons/MatrixResources/Video.tsx +27 -0
  109. package/src/Icons/MatrixResources/Word.tsx +30 -0
  110. package/src/Icons/MatrixResources/index.tsx +12 -0
  111. package/src/Modal/Modal.spec.tsx +244 -0
  112. package/src/Modal/Modal.tsx +58 -0
  113. package/src/Modal/ModalContainer.stories.tsx +33 -0
  114. package/src/Modal/ModalOpeningButton.tsx +20 -0
  115. package/src/Modal/ModalTrigger.tsx +45 -0
  116. package/src/PreviewPanel/PreviewModal.spec.tsx +164 -0
  117. package/src/PreviewPanel/PreviewModal.tsx +92 -0
  118. package/src/PreviewPanel/PreviewPanel.spec.tsx +197 -0
  119. package/src/PreviewPanel/PreviewPanel.stories.tsx +61 -0
  120. package/src/PreviewPanel/PreviewPanel.tsx +123 -0
  121. package/src/PreviewPanel/details/MatrixResource.tsx +59 -0
  122. package/src/ResourceBreadcrumb/ResourceBreadcrumb.spec.tsx +76 -0
  123. package/src/ResourceBreadcrumb/ResourceBreadcrumb.stories.tsx +24 -0
  124. package/src/ResourceBreadcrumb/ResourceBreadcrumb.tsx +39 -0
  125. package/src/ResourceBreadcrumb/sample-hierarchy.json +23 -0
  126. package/src/ResourceItem/ResourceItem.spec.tsx +69 -0
  127. package/src/ResourceItem/ResourceItem.tsx +82 -0
  128. package/src/ResourceList/ResourceList.spec.tsx +196 -0
  129. package/src/ResourceList/ResourceList.stories.tsx +40 -0
  130. package/src/ResourceList/ResourceList.tsx +74 -0
  131. package/src/ResourceList/sample-resources.json +75 -0
  132. package/src/ResourcePickerContainer/ResourcePickerContainer.spec.tsx +706 -0
  133. package/src/ResourcePickerContainer/ResourcePickerContainer.stories.tsx +56 -0
  134. package/src/ResourcePickerContainer/ResourcePickerContainer.tsx +224 -0
  135. package/src/Skeleton/List/SkeletonList.spec.tsx +18 -0
  136. package/src/Skeleton/List/SkeletonList.stories.tsx +15 -0
  137. package/src/Skeleton/List/SkeletonList.tsx +16 -0
  138. package/src/Skeleton/ListItem/SkeletonListItem.stories.tsx +15 -0
  139. package/src/Skeleton/ListItem/SkeletonListItem.tsx +14 -0
  140. package/src/SourceDropdown/SourceDropdown.spec.tsx +263 -0
  141. package/src/SourceDropdown/SourceDropdown.stories.tsx +36 -0
  142. package/src/SourceDropdown/SourceDropdown.tsx +175 -0
  143. package/src/SourceDropdown/sample-sources.json +110 -0
  144. package/src/SourceList/SourceList.spec.tsx +224 -0
  145. package/src/SourceList/SourceList.stories.tsx +40 -0
  146. package/src/SourceList/SourceList.tsx +93 -0
  147. package/src/SourceList/sample-sources.json +110 -0
  148. package/src/Spinner/Spinner.spec.tsx +18 -0
  149. package/src/Spinner/Spinner.stories.tsx +26 -0
  150. package/src/Spinner/Spinner.tsx +18 -0
  151. package/src/Spinner/_spinner.scss +11 -0
  152. package/src/__mocks__/JestHelpers.ts +65 -0
  153. package/src/__mocks__/jestHelpers.spec.ts +38 -0
  154. package/src/__mocks__/styleMock.ts +1 -0
  155. package/src/index.scss +7 -0
  156. package/src/index.stories.tsx +70 -0
  157. package/src/index.tsx +71 -0
  158. package/src/uuid.ts +7 -0
  159. package/tailwind.config.cjs +84 -0
  160. package/tsconfig.json +22 -0
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders the GenericFile icon
4
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the GenericFile component
5
+ * @returns {JSX.Element} - The GenericFile component
6
+ * @example
7
+ * <GenericFile />
8
+ * @example
9
+ * <GenericFile height={24} width={24} />
10
+ * @example
11
+ * <GenericFile className="custom-class" />
12
+ */
13
+ export default function GenericFile({ isDecorative, ...props }: {
14
+ isDecorative: boolean;
15
+ } & React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ /**
8
+ * Renders the GenericFile icon
9
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the GenericFile component
10
+ * @returns {JSX.Element} - The GenericFile component
11
+ * @example
12
+ * <GenericFile />
13
+ * @example
14
+ * <GenericFile height={24} width={24} />
15
+ * @example
16
+ * <GenericFile className="custom-class" />
17
+ */
18
+ function GenericFile({ isDecorative, ...props }) {
19
+ return (react_1.default.createElement("svg", { fill: "none", height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props },
20
+ react_1.default.createElement("path", { d: "m15.9393 3.23223-.3515.35154.3515-.35154c-.4688-.46884-1.1047-.73223-1.7677-.73223h-8.1716c-.82843 0-1.5.67157-1.5 1.5v16c0 .8284.67157 1.5 1.5 1.5h12c.8284 0 1.5-.6716 1.5-1.5v-12.17157c0-.66304-.2634-1.29893-.7322-1.76777z", fill: "#fff", stroke: "#74b1e6" }),
21
+ react_1.default.createElement("path", { d: "m14.5 3v3.5c0 .55228.4477 1 1 1h3.5", stroke: "#74b1e6" }),
22
+ react_1.default.createElement("path", { d: "m14.5 7.5v-5l5 5z", fill: "#cce2f6" }),
23
+ react_1.default.createElement("g", { stroke: "#74b1e6" },
24
+ react_1.default.createElement("path", { d: "m15.9393 3.23223-.3515.35154.3515-.35154c-.4688-.46884-1.1047-.73223-1.7677-.73223h-8.1716c-.82843 0-1.5.67157-1.5 1.5v16c0 .8284.67157 1.5 1.5 1.5h12c.8284 0 1.5-.6716 1.5-1.5v-12.17157c0-.66304-.2634-1.29893-.7322-1.76777z" }),
25
+ react_1.default.createElement("path", { d: "m14.5 3v3.5c0 .55228.4477 1 1 1h3.5" })),
26
+ !isDecorative && react_1.default.createElement("title", null, "generic file icon")));
27
+ }
28
+ exports.default = GenericFile;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders the Image icon
4
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Image component
5
+ * @returns {JSX.Element} - The Image component
6
+ * @example
7
+ * <Image />
8
+ * @example
9
+ * <Image height={24} width={24} />
10
+ * @example
11
+ * <Image className="custom-class" />
12
+ */
13
+ export default function Image({ isDecorative, ...props }: {
14
+ isDecorative: boolean;
15
+ } & React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ /**
8
+ * Renders the Image icon
9
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Image component
10
+ * @returns {JSX.Element} - The Image component
11
+ * @example
12
+ * <Image />
13
+ * @example
14
+ * <Image height={24} width={24} />
15
+ * @example
16
+ * <Image className="custom-class" />
17
+ */
18
+ function Image({ isDecorative, ...props }) {
19
+ return (react_1.default.createElement("svg", { fill: "none", height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props },
20
+ react_1.default.createElement("path", { d: "m21 17.5h.5v-.5-13c0-.82843-.6716-1.5-1.5-1.5h-16c-.82843 0-1.5.67157-1.5 1.5v13 .5h.5z", fill: "#cce2f6", stroke: "#74b1e6" }),
21
+ react_1.default.createElement("circle", { cx: "15.5", cy: "8.5", fill: "#fbefd2", r: "3", stroke: "#f0c14f" }),
22
+ react_1.default.createElement("path", { d: "m21.3749 16.0025.1251.1418v.189 3.6667c0 .8284-.6716 1.5-1.5 1.5h-8.5-1.1506l.7851-.8412 6.2481-6.6944c.6044-.6476 1.6353-.6331 2.2214.031z", fill: "#cee9d8", stroke: "#79c292" }),
23
+ react_1.default.createElement("path", { d: "m2.62777 13.6262-.12777.1424v.1914 6.04c0 .8284.67157 1.5 1.5 1.5h13 1.0974l-.7201-.8281-9.25697-10.6455c-.59189-.68068-1.64634-.68877-2.2486-.0173z", fill: "#79c292", stroke: "#098934" }),
24
+ !isDecorative && react_1.default.createElement("title", null, "image icon")));
25
+ }
26
+ exports.default = Image;
@@ -0,0 +1,15 @@
1
+ import { Audio, Excel, Folder, GenericFile, Image, Page, Pdf, Powerpoint, Site, Video, Word } from '.';
2
+ declare const MatrixResourceMap: {
3
+ audio: typeof Audio;
4
+ excel: typeof Excel;
5
+ folder: typeof Folder;
6
+ generic_file: typeof GenericFile;
7
+ image: typeof Image;
8
+ page_standard: typeof Page;
9
+ pdf: typeof Pdf;
10
+ powerpoint: typeof Powerpoint;
11
+ site: typeof Site;
12
+ video: typeof Video;
13
+ word: typeof Word;
14
+ };
15
+ export default MatrixResourceMap;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ // Define our map of matrix types to icons
5
+ const MatrixResourceMap = {
6
+ audio: _1.Audio,
7
+ excel: _1.Excel,
8
+ folder: _1.Folder,
9
+ generic_file: _1.GenericFile,
10
+ image: _1.Image,
11
+ page_standard: _1.Page,
12
+ pdf: _1.Pdf,
13
+ powerpoint: _1.Powerpoint,
14
+ site: _1.Site,
15
+ video: _1.Video,
16
+ word: _1.Word,
17
+ };
18
+ // Export our map
19
+ exports.default = MatrixResourceMap;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders the Page icon
4
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Page component
5
+ * @returns {JSX.Element} - The Page component
6
+ * @example
7
+ * <Page />
8
+ * @example
9
+ * <Page height={24} width={24} />
10
+ * @example
11
+ * <Page className="custom-class" />
12
+ */
13
+ export default function Page({ isDecorative, ...props }: {
14
+ isDecorative: boolean;
15
+ } & React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ /**
8
+ * Renders the Page icon
9
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Page component
10
+ * @returns {JSX.Element} - The Page component
11
+ * @example
12
+ * <Page />
13
+ * @example
14
+ * <Page height={24} width={24} />
15
+ * @example
16
+ * <Page className="custom-class" />
17
+ */
18
+ function Page({ isDecorative, ...props }) {
19
+ return (react_1.default.createElement("svg", { fill: "none", height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props },
20
+ react_1.default.createElement("path", { d: "m4 1.5c-.82843 0-1.5.67157-1.5 1.5v18c0 .8284.67157 1.5 1.5 1.5h16c.8284 0 1.5-.6716 1.5-1.5v-18c0-.82843-.6716-1.5-1.5-1.5z", fill: "#cee9d8", stroke: "#79c292" }),
21
+ react_1.default.createElement("g", { fill: "#098934" },
22
+ react_1.default.createElement("rect", { height: "1", rx: ".5", width: "6", x: "6", y: "8" }),
23
+ react_1.default.createElement("rect", { height: "1", rx: ".5", width: "6", x: "6", y: "10" }),
24
+ react_1.default.createElement("rect", { height: "1", rx: ".5", width: "12", x: "6", y: "12" }),
25
+ react_1.default.createElement("rect", { height: "1", rx: ".5", width: "12", x: "6", y: "14" }),
26
+ react_1.default.createElement("rect", { height: "1", rx: ".5", width: "12", x: "6", y: "16" }),
27
+ react_1.default.createElement("rect", { height: "1", rx: ".5", width: "12", x: "6", y: "18" })),
28
+ !isDecorative && react_1.default.createElement("title", null, "page standard icon")));
29
+ }
30
+ exports.default = Page;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders the Pdf icon
4
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Pdf component
5
+ * @returns {JSX.Element} - The Pdf component
6
+ * @example
7
+ * <Pdf />
8
+ * @example
9
+ * <Pdf height={24} width={24} />
10
+ * @example
11
+ * <Pdf className="custom-class" />
12
+ */
13
+ export default function Pdf({ isDecorative, ...props }: {
14
+ isDecorative: boolean;
15
+ } & React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ /**
8
+ * Renders the Pdf icon
9
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Pdf component
10
+ * @returns {JSX.Element} - The Pdf component
11
+ * @example
12
+ * <Pdf />
13
+ * @example
14
+ * <Pdf height={24} width={24} />
15
+ * @example
16
+ * <Pdf className="custom-class" />
17
+ */
18
+ function Pdf({ isDecorative, ...props }) {
19
+ return (react_1.default.createElement("svg", { fill: "none", height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props },
20
+ react_1.default.createElement("path", { d: "m15.9393 3.23223-.3515.35154.3515-.35154c-.4688-.46884-1.1047-.73223-1.7677-.73223h-8.1716c-.82843 0-1.5.67157-1.5 1.5v16c0 .8284.67157 1.5 1.5 1.5h12c.8284 0 1.5-.6716 1.5-1.5v-12.17157c0-.66304-.2634-1.29893-.7322-1.76777z", fill: "#f6d2d1", stroke: "#e88483" }),
21
+ react_1.default.createElement("path", { d: "m14.5 3v3.5c0 .55228.4477 1 1 1h3.5", stroke: "#e88483" }),
22
+ react_1.default.createElement("rect", { fill: "#d72321", height: "9", rx: "2", width: "17", y: "11" }),
23
+ react_1.default.createElement("rect", { fill: "#d72321", height: "7", rx: "1", width: "13", x: "2", y: "12" }),
24
+ react_1.default.createElement("g", { stroke: "#fff", strokeLinecap: "round" },
25
+ react_1.default.createElement("path", { d: "m3.5 17.5v-2m0 0v-1.8c0-.1105.08954-.2.2-.2h1c.55228 0 1 .4477 1 1 0 .5523-.44772 1-1 1z" }),
26
+ react_1.default.createElement("path", { d: "m7.5 17.3v-3.6c0-.1105.08954-.2.2-.2h.3c.82843 0 1.5.6716 1.5 1.5v1c0 .8284-.67157 1.5-1.5 1.5h-.3c-.11046 0-.2-.0895-.2-.2z" }),
27
+ react_1.default.createElement("path", { d: "m11.5 17.5v-3.8c0-.1105.0895-.2.2-.2h1.8" }),
28
+ react_1.default.createElement("path", { d: "m11.5 15.5h1" })),
29
+ !isDecorative && react_1.default.createElement("title", null, "pdf icon")));
30
+ }
31
+ exports.default = Pdf;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders the Powerpoint icon
4
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Powerpoint component
5
+ * @returns {JSX.Element} - The Powerpoint component
6
+ * @example
7
+ * <Powerpoint />
8
+ * @example
9
+ * <Powerpoint height={24} width={24} />
10
+ * @example
11
+ * <Powerpoint className="custom-class" />
12
+ */
13
+ export default function Powerpoint({ isDecorative, ...props }: {
14
+ isDecorative: boolean;
15
+ } & React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ /**
8
+ * Renders the Powerpoint icon
9
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Powerpoint component
10
+ * @returns {JSX.Element} - The Powerpoint component
11
+ * @example
12
+ * <Powerpoint />
13
+ * @example
14
+ * <Powerpoint height={24} width={24} />
15
+ * @example
16
+ * <Powerpoint className="custom-class" />
17
+ */
18
+ function Powerpoint({ isDecorative, ...props }) {
19
+ return (react_1.default.createElement("svg", { fill: "none", height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props },
20
+ react_1.default.createElement("path", { d: "m15.9393 3.23223-.3515.35154.3515-.35154c-.4688-.46884-1.1047-.73223-1.7677-.73223h-8.1716c-.82843 0-1.5.67157-1.5 1.5v16c0 .8284.67157 1.5 1.5 1.5h12c.8284 0 1.5-.6716 1.5-1.5v-12.17157c0-.66304-.2634-1.29893-.7322-1.76777z", fill: "#e7e7e7", stroke: "#bcbcbc" }),
21
+ react_1.default.createElement("path", { d: "m14.5 3v3.5c0 .55228.4477 1 1 1h3.5", stroke: "#bcbcbc" }),
22
+ react_1.default.createElement("rect", { fill: "#e96900", height: "12", rx: "2", width: "12", y: "8" }),
23
+ react_1.default.createElement("g", { stroke: "#fff", strokeLinecap: "round" },
24
+ react_1.default.createElement("path", { d: "m3.5 11.5v5" }),
25
+ react_1.default.createElement("path", { d: "m3.5 11.5h3.5c.33333 0 1.5 0 1.5 1.5s-1.16667 1.5-1.5 1.5h-3" })),
26
+ !isDecorative && react_1.default.createElement("title", null, "powerpoint icon")));
27
+ }
28
+ exports.default = Powerpoint;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders the Site icon
4
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Site component
5
+ * @returns {JSX.Element} - The Site component
6
+ * @example
7
+ * <Site />
8
+ * @example
9
+ * <Site height={24} width={24} />
10
+ * @example
11
+ * <Site className="custom-class" />
12
+ */
13
+ export default function Site({ isDecorative, ...props }: {
14
+ isDecorative: boolean;
15
+ } & React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ /**
8
+ * Renders the Site icon
9
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Site component
10
+ * @returns {JSX.Element} - The Site component
11
+ * @example
12
+ * <Site />
13
+ * @example
14
+ * <Site height={24} width={24} />
15
+ * @example
16
+ * <Site className="custom-class" />
17
+ */
18
+ function Site({ isDecorative, ...props }) {
19
+ return (react_1.default.createElement("svg", { fill: "none", height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props },
20
+ react_1.default.createElement("circle", { cx: "12", cy: "12", fill: "#cce2f5", r: "10.5", stroke: "#7db4e3" }),
21
+ react_1.default.createElement("path", { d: "m19.5 12c0 2.9434-.8684 5.5878-2.2475 7.4841-1.3795 1.8968-3.2427 3.0159-5.2525 3.0159-2.00976 0-3.87299-1.1191-5.25249-3.0159-1.37913-1.8963-2.24751-4.5407-2.24751-7.4841 0-2.94337.86838-5.58777 2.24751-7.48409 1.3795-1.8968 3.24273-3.01591 5.25249-3.01591 2.0098 0 3.873 1.11911 5.2525 3.01591 1.3791 1.89632 2.2475 4.54072 2.2475 7.48409z", fill: "#cce2f5", stroke: "#7db4e3" }),
22
+ react_1.default.createElement("path", { d: "m14.5 12c0 3.0063-.3329 5.7099-.8611 7.6466-.265.9719-.5718 1.7223-.8914 2.218-.334.5181-.5981.6354-.7475.6354s-.4135-.1173-.7475-.6354c-.3196-.4957-.6264-1.2461-.8914-2.218-.52822-1.9367-.8611-4.6403-.8611-7.6466 0-3.00626.33288-5.70993.8611-7.64662.265-.97192.5718-1.72231.8914-2.21799.334-.51806.5981-.63539.7475-.63539s.4135.11733.7475.63539c.3196.49568.6264 1.24607.8914 2.21799.5282 1.93669.8611 4.64036.8611 7.64662z", fill: "#cce2f5", stroke: "#7db4e3" }),
23
+ react_1.default.createElement("g", { fill: "#7db4e3" },
24
+ react_1.default.createElement("path", { d: "m2 14h20v1h-20z" }),
25
+ react_1.default.createElement("path", { d: "m2 9h20v1h-20z" }),
26
+ react_1.default.createElement("path", { d: "m5 4 2.5-1-.5 1h10l-.5-1 2.5 1 .5 1h-15z" }),
27
+ react_1.default.createElement("path", { d: "m4 19h16l-.5 1-3 1 .5-1h-10l.5 1-3-1z" })),
28
+ !isDecorative && react_1.default.createElement("title", null, "site icon")));
29
+ }
30
+ exports.default = Site;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders the Video icon
4
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Video component
5
+ * @returns {JSX.Element} - The Video component
6
+ * @example
7
+ * <Video />
8
+ * @example
9
+ * <Video height={24} width={24} />
10
+ * @example
11
+ * <Video className="custom-class" />
12
+ */
13
+ export default function Video({ isDecorative, ...props }: {
14
+ isDecorative: boolean;
15
+ } & React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ /**
8
+ * Renders the Video icon
9
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Video component
10
+ * @returns {JSX.Element} - The Video component
11
+ * @example
12
+ * <Video />
13
+ * @example
14
+ * <Video height={24} width={24} />
15
+ * @example
16
+ * <Video className="custom-class" />
17
+ */
18
+ function Video({ isDecorative, ...props }) {
19
+ return (react_1.default.createElement("svg", { fill: "none", height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props },
20
+ react_1.default.createElement("rect", { fill: "#e0d9ef", height: "15", rx: "1.5", stroke: "#ac98d5", width: "21", x: "1.5", y: "4.5" }),
21
+ react_1.default.createElement("path", { d: "m9.5 15.2516v-6.50318c0-.38671.42019-.62704.7535-.43097l5.5277 3.25155c.3287.1934.3287.6686 0 .862l-5.5277 3.2516c-.33331.196-.7535-.0443-.7535-.431z", fill: "#ac98d5", stroke: "#6b47b4", strokeLinecap: "round" }),
22
+ !isDecorative && react_1.default.createElement("title", null, "video icon")));
23
+ }
24
+ exports.default = Video;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders the Word icon
4
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Word component
5
+ * @returns {JSX.Element} - The Word component
6
+ * @example
7
+ * <Word />
8
+ * @example
9
+ * <Word isDecorative={false} />
10
+ * @example
11
+ * <Word height={24} width={24} />
12
+ * @example
13
+ * <Word className="custom-class" />
14
+ */
15
+ export default function Word({ isDecorative, ...props }: {
16
+ isDecorative: boolean;
17
+ } & React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ /**
8
+ * Renders the Word icon
9
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Word component
10
+ * @returns {JSX.Element} - The Word component
11
+ * @example
12
+ * <Word />
13
+ * @example
14
+ * <Word isDecorative={false} />
15
+ * @example
16
+ * <Word height={24} width={24} />
17
+ * @example
18
+ * <Word className="custom-class" />
19
+ */
20
+ function Word({ isDecorative, ...props }) {
21
+ return (react_1.default.createElement("svg", { fill: "none", height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props },
22
+ react_1.default.createElement("path", { d: "m15.9393 3.23223-.3515.35154.3515-.35154c-.4688-.46884-1.1047-.73223-1.7677-.73223h-8.1716c-.82843 0-1.5.67157-1.5 1.5v16c0 .8284.67157 1.5 1.5 1.5h12c.8284 0 1.5-.6716 1.5-1.5v-12.17157c0-.66304-.2634-1.29893-.7322-1.76777z", fill: "#e7e7e7", stroke: "#bcbcbc" }),
23
+ react_1.default.createElement("path", { d: "m14.5 3v3.5c0 .55228.4477 1 1 1h3.5", stroke: "#bcbcbc" }),
24
+ react_1.default.createElement("rect", { fill: "#0774d2", height: "12", rx: "2", width: "12", y: "8" }),
25
+ react_1.default.createElement("path", { d: "m2.5 11.5 1.5 5 2-5 2 5 1.5-5", stroke: "#fff", strokeLinecap: "round", strokeLinejoin: "round" }),
26
+ !isDecorative && react_1.default.createElement("title", null, "word icon")));
27
+ }
28
+ exports.default = Word;
@@ -0,0 +1,11 @@
1
+ export { default as Audio } from './Audio';
2
+ export { default as Excel } from './Excel';
3
+ export { default as Folder } from './Folder';
4
+ export { default as GenericFile } from './GenericFile';
5
+ export { default as Image } from './Image';
6
+ export { default as Page } from './Page';
7
+ export { default as Pdf } from './Pdf';
8
+ export { default as Powerpoint } from './Powerpoint';
9
+ export { default as Site } from './Site';
10
+ export { default as Video } from './Video';
11
+ export { default as Word } from './Word';
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Word = exports.Video = exports.Site = exports.Powerpoint = exports.Pdf = exports.Page = exports.Image = exports.GenericFile = exports.Folder = exports.Excel = exports.Audio = void 0;
7
+ // Export all the icons from the MatrixResources folder
8
+ var Audio_1 = require("./Audio");
9
+ Object.defineProperty(exports, "Audio", { enumerable: true, get: function () { return __importDefault(Audio_1).default; } });
10
+ var Excel_1 = require("./Excel");
11
+ Object.defineProperty(exports, "Excel", { enumerable: true, get: function () { return __importDefault(Excel_1).default; } });
12
+ var Folder_1 = require("./Folder");
13
+ Object.defineProperty(exports, "Folder", { enumerable: true, get: function () { return __importDefault(Folder_1).default; } });
14
+ var GenericFile_1 = require("./GenericFile");
15
+ Object.defineProperty(exports, "GenericFile", { enumerable: true, get: function () { return __importDefault(GenericFile_1).default; } });
16
+ var Image_1 = require("./Image");
17
+ Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return __importDefault(Image_1).default; } });
18
+ var Page_1 = require("./Page");
19
+ Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return __importDefault(Page_1).default; } });
20
+ var Pdf_1 = require("./Pdf");
21
+ Object.defineProperty(exports, "Pdf", { enumerable: true, get: function () { return __importDefault(Pdf_1).default; } });
22
+ var Powerpoint_1 = require("./Powerpoint");
23
+ Object.defineProperty(exports, "Powerpoint", { enumerable: true, get: function () { return __importDefault(Powerpoint_1).default; } });
24
+ var Site_1 = require("./Site");
25
+ Object.defineProperty(exports, "Site", { enumerable: true, get: function () { return __importDefault(Site_1).default; } });
26
+ var Video_1 = require("./Video");
27
+ Object.defineProperty(exports, "Video", { enumerable: true, get: function () { return __importDefault(Video_1).default; } });
28
+ var Word_1 = require("./Word");
29
+ Object.defineProperty(exports, "Word", { enumerable: true, get: function () { return __importDefault(Word_1).default; } });
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { OverlayTriggerState } from 'react-stately';
3
+ import { DOMAttributes, FocusableElement } from '@react-types/shared';
4
+ export type ModalProps = {
5
+ isDismissable?: boolean;
6
+ state: OverlayTriggerState;
7
+ overlayProps: DOMAttributes<FocusableElement>;
8
+ children: (titleProps: DOMAttributes<FocusableElement>) => React.ReactElement;
9
+ };
10
+ declare function Modal({ isDismissable, state, overlayProps, children, ...props }: ModalProps): JSX.Element;
11
+ export default Modal;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const react_1 = __importStar(require("react"));
27
+ const react_aria_1 = require("react-aria");
28
+ /*
29
+ This has to be a separate element otherwise the focus trap fails. Assuming this is because it needs
30
+ to fit inside the 'Overlay' as a form of context.
31
+ */
32
+ function ModalContent({ children, ...props }) {
33
+ const ref = (0, react_1.useRef)(null);
34
+ const { dialogProps, titleProps } = (0, react_aria_1.useDialog)(props, ref);
35
+ return (react_1.default.createElement("div", { ...dialogProps, ref: ref, className: "z-50 relative bg-white rounded-lg h-screen lg:h-[calc(100vh-3.5rem)] w-screen max-w-screen-lg" }, children(titleProps)));
36
+ }
37
+ function Modal({ isDismissable, state, overlayProps, children, ...props }) {
38
+ const ref = (0, react_1.useRef)(null);
39
+ const { modalProps, underlayProps } = (0, react_aria_1.useModalOverlay)({ isDismissable, ...props }, state, ref);
40
+ return (react_1.default.createElement(react_aria_1.Overlay, null,
41
+ react_1.default.createElement("div", { className: "squiz-rb-scope" },
42
+ react_1.default.createElement("div", { ...underlayProps, className: "h-full z-[9999] fixed inset-0 before:z-40 before:fixed before:inset-0 before:bg-black before:bg-opacity-25" },
43
+ react_1.default.createElement("div", { ...modalProps, ref: ref, className: "h-full flex items-center justify-center" },
44
+ react_1.default.createElement(ModalContent, { ...overlayProps }, (titleProps) => children(titleProps)))))));
45
+ }
46
+ exports.default = Modal;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { AriaButtonProps } from 'react-aria';
3
+ interface ModalOpeningButtonProps extends AriaButtonProps<'button'> {
4
+ className?: string;
5
+ children?: React.ReactNode;
6
+ isDisabled?: boolean;
7
+ title?: string;
8
+ }
9
+ export default function ModalOpeningButton({ className, children, title, ...props }: ModalOpeningButtonProps): JSX.Element;
10
+ export {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_aria_1 = require("react-aria");
8
+ function ModalOpeningButton({ className, children, title, ...props }) {
9
+ const ref = react_1.default.useRef(null);
10
+ const { buttonProps } = (0, react_aria_1.useButton)(props, ref);
11
+ return (react_1.default.createElement("button", { ...buttonProps, ref: ref, className: className, title: title }, children));
12
+ }
13
+ exports.default = ModalOpeningButton;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { DOMAttributes, FocusableElement } from '@react-types/shared';
3
+ declare function ModalTrigger({ label, showLabel, icon, children, ...props }: {
4
+ label: string;
5
+ showLabel?: boolean;
6
+ icon?: React.ReactNode;
7
+ children: (onClose: () => void, titleProps: DOMAttributes<FocusableElement>) => React.ReactElement;
8
+ }): JSX.Element;
9
+ export default ModalTrigger;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_aria_1 = require("react-aria");
8
+ const react_stately_1 = require("react-stately");
9
+ const Modal_1 = __importDefault(require("./Modal"));
10
+ const ModalOpeningButton_1 = __importDefault(require("./ModalOpeningButton"));
11
+ function ModalTrigger({ label, showLabel, icon, children, ...props }) {
12
+ const state = (0, react_stately_1.useOverlayTriggerState)(props);
13
+ const { triggerProps, overlayProps } = (0, react_aria_1.useOverlayTrigger)({ type: 'dialog' }, state);
14
+ let ariaAttr = {};
15
+ if (!showLabel) {
16
+ ariaAttr = { ...ariaAttr, 'aria-label': label };
17
+ }
18
+ return (react_1.default.createElement(react_1.default.Fragment, null,
19
+ react_1.default.createElement(ModalOpeningButton_1.default, { type: "button", ...triggerProps, ...ariaAttr },
20
+ showLabel && label,
21
+ icon),
22
+ state.isOpen && (react_1.default.createElement(Modal_1.default, { isDismissable: true, state: state, overlayProps: overlayProps }, (titleProps) => children(state.close, titleProps)))));
23
+ }
24
+ exports.default = ModalTrigger;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ import { OverlayTriggerState } from 'react-stately';
3
+ import { DOMAttributes, FocusableElement } from '@react-types/shared';
4
+ export type PreviewModalProps = {
5
+ state: OverlayTriggerState;
6
+ overlayProps: DOMAttributes<FocusableElement>;
7
+ children?: ReactNode;
8
+ onClose: () => void;
9
+ };
10
+ declare function PreviewModal({ state, overlayProps, children, onClose, ...props }: PreviewModalProps): JSX.Element;
11
+ export default PreviewModal;