@squiz/generic-browser-lib 1.35.1-alpha.34

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 (153) 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/README.md +10 -0
  5. package/build.js +21 -0
  6. package/jest.config.ts +29 -0
  7. package/lib/Hooks/useAsync.d.ts +21 -0
  8. package/lib/Hooks/useAsync.js +53 -0
  9. package/lib/Icons/Generics/ArrowDown.d.ts +15 -0
  10. package/lib/Icons/Generics/ArrowDown.js +23 -0
  11. package/lib/Icons/Generics/ArrowRight.d.ts +15 -0
  12. package/lib/Icons/Generics/ArrowRight.js +23 -0
  13. package/lib/Icons/Generics/Back.d.ts +4 -0
  14. package/lib/Icons/Generics/Back.js +12 -0
  15. package/lib/Icons/Generics/Close.d.ts +15 -0
  16. package/lib/Icons/Generics/Close.js +23 -0
  17. package/lib/Icons/Generics/Empty.d.ts +4 -0
  18. package/lib/Icons/Generics/Empty.js +12 -0
  19. package/lib/Icons/Generics/Error.d.ts +4 -0
  20. package/lib/Icons/Generics/Error.js +12 -0
  21. package/lib/Icons/Generics/GenericIconMap.d.ts +14 -0
  22. package/lib/Icons/Generics/GenericIconMap.js +18 -0
  23. package/lib/Icons/Generics/ResourceSelect.d.ts +15 -0
  24. package/lib/Icons/Generics/ResourceSelect.js +28 -0
  25. package/lib/Icons/Generics/Retry.d.ts +4 -0
  26. package/lib/Icons/Generics/Retry.js +12 -0
  27. package/lib/Icons/Generics/Root.d.ts +15 -0
  28. package/lib/Icons/Generics/Root.js +23 -0
  29. package/lib/Icons/Generics/Selected.d.ts +15 -0
  30. package/lib/Icons/Generics/Selected.js +23 -0
  31. package/lib/Icons/Generics/index.d.ts +10 -0
  32. package/lib/Icons/Generics/index.js +27 -0
  33. package/lib/Icons/Icon.d.ts +50 -0
  34. package/lib/Icons/Icon.js +42 -0
  35. package/lib/Icons/MatrixResources/Audio.d.ts +15 -0
  36. package/lib/Icons/MatrixResources/Audio.js +28 -0
  37. package/lib/Icons/MatrixResources/Excel.d.ts +15 -0
  38. package/lib/Icons/MatrixResources/Excel.js +27 -0
  39. package/lib/Icons/MatrixResources/Folder.d.ts +15 -0
  40. package/lib/Icons/MatrixResources/Folder.js +24 -0
  41. package/lib/Icons/MatrixResources/GenericFile.d.ts +15 -0
  42. package/lib/Icons/MatrixResources/GenericFile.js +28 -0
  43. package/lib/Icons/MatrixResources/Image.d.ts +15 -0
  44. package/lib/Icons/MatrixResources/Image.js +26 -0
  45. package/lib/Icons/MatrixResources/MatrixResourceMap.d.ts +15 -0
  46. package/lib/Icons/MatrixResources/MatrixResourceMap.js +19 -0
  47. package/lib/Icons/MatrixResources/Page.d.ts +15 -0
  48. package/lib/Icons/MatrixResources/Page.js +30 -0
  49. package/lib/Icons/MatrixResources/Pdf.d.ts +15 -0
  50. package/lib/Icons/MatrixResources/Pdf.js +31 -0
  51. package/lib/Icons/MatrixResources/Powerpoint.d.ts +15 -0
  52. package/lib/Icons/MatrixResources/Powerpoint.js +28 -0
  53. package/lib/Icons/MatrixResources/Site.d.ts +15 -0
  54. package/lib/Icons/MatrixResources/Site.js +30 -0
  55. package/lib/Icons/MatrixResources/Video.d.ts +15 -0
  56. package/lib/Icons/MatrixResources/Video.js +24 -0
  57. package/lib/Icons/MatrixResources/Word.d.ts +17 -0
  58. package/lib/Icons/MatrixResources/Word.js +28 -0
  59. package/lib/Icons/MatrixResources/index.d.ts +11 -0
  60. package/lib/Icons/MatrixResources/index.js +29 -0
  61. package/lib/Modal/Modal.d.ts +10 -0
  62. package/lib/Modal/Modal.js +47 -0
  63. package/lib/Modal/ModalOpeningButton.d.ts +10 -0
  64. package/lib/Modal/ModalOpeningButton.js +14 -0
  65. package/lib/Modal/ModalTrigger.d.ts +9 -0
  66. package/lib/Modal/ModalTrigger.js +26 -0
  67. package/lib/PreviewPanel/PreviewModal.d.ts +11 -0
  68. package/lib/PreviewPanel/PreviewModal.js +79 -0
  69. package/lib/PreviewPanel/PreviewPanel.d.ts +13 -0
  70. package/lib/PreviewPanel/PreviewPanel.js +58 -0
  71. package/lib/PreviewPanel/PreviewPanelHOC.d.ts +6 -0
  72. package/lib/PreviewPanel/PreviewPanelHOC.js +16 -0
  73. package/lib/ResetButton/ResetButton.d.ts +5 -0
  74. package/lib/ResetButton/ResetButton.js +12 -0
  75. package/lib/ResourceItem/ResourceItem.d.ts +19 -0
  76. package/lib/ResourceItem/ResourceItem.js +29 -0
  77. package/lib/ResourceState/ResourceState.d.ts +7 -0
  78. package/lib/ResourceState/ResourceState.js +17 -0
  79. package/lib/Skeleton/List/SkeletonList.d.ts +6 -0
  80. package/lib/Skeleton/List/SkeletonList.js +13 -0
  81. package/lib/Skeleton/ListItem/SkeletonListItem.d.ts +1 -0
  82. package/lib/Skeleton/ListItem/SkeletonListItem.js +15 -0
  83. package/lib/Spinner/Spinner.d.ts +7 -0
  84. package/lib/Spinner/Spinner.js +13 -0
  85. package/lib/index.css +885 -0
  86. package/lib/index.d.ts +12 -0
  87. package/lib/index.js +28 -0
  88. package/package.json +76 -0
  89. package/postcss.config.js +11 -0
  90. package/src/Hooks/useAsync.spec.ts +106 -0
  91. package/src/Hooks/useAsync.ts +62 -0
  92. package/src/Icons/Generics/ArrowDown.tsx +27 -0
  93. package/src/Icons/Generics/ArrowRight.tsx +27 -0
  94. package/src/Icons/Generics/Back.tsx +13 -0
  95. package/src/Icons/Generics/Close.tsx +26 -0
  96. package/src/Icons/Generics/Empty.tsx +13 -0
  97. package/src/Icons/Generics/Error.tsx +13 -0
  98. package/src/Icons/Generics/GenericIconMap.ts +18 -0
  99. package/src/Icons/Generics/ResourceSelect.tsx +40 -0
  100. package/src/Icons/Generics/Retry.tsx +13 -0
  101. package/src/Icons/Generics/Root.tsx +24 -0
  102. package/src/Icons/Generics/Selected.tsx +27 -0
  103. package/src/Icons/Generics/index.tsx +11 -0
  104. package/src/Icons/Icon.spec.tsx +62 -0
  105. package/src/Icons/Icon.stories.tsx +110 -0
  106. package/src/Icons/Icon.tsx +54 -0
  107. package/src/Icons/MatrixResources/Audio.tsx +30 -0
  108. package/src/Icons/MatrixResources/Excel.tsx +29 -0
  109. package/src/Icons/MatrixResources/Folder.tsx +29 -0
  110. package/src/Icons/MatrixResources/GenericFile.tsx +34 -0
  111. package/src/Icons/MatrixResources/Image.tsx +36 -0
  112. package/src/Icons/MatrixResources/MatrixResourceMap.ts +19 -0
  113. package/src/Icons/MatrixResources/Page.tsx +33 -0
  114. package/src/Icons/MatrixResources/Pdf.tsx +34 -0
  115. package/src/Icons/MatrixResources/Powerpoint.tsx +34 -0
  116. package/src/Icons/MatrixResources/Site.tsx +37 -0
  117. package/src/Icons/MatrixResources/Video.tsx +27 -0
  118. package/src/Icons/MatrixResources/Word.tsx +30 -0
  119. package/src/Icons/MatrixResources/index.tsx +12 -0
  120. package/src/Modal/Modal.spec.tsx +269 -0
  121. package/src/Modal/Modal.tsx +55 -0
  122. package/src/Modal/ModalContainer.stories.tsx +33 -0
  123. package/src/Modal/ModalOpeningButton.tsx +20 -0
  124. package/src/Modal/ModalTrigger.tsx +54 -0
  125. package/src/PreviewPanel/PreviewModal.spec.tsx +164 -0
  126. package/src/PreviewPanel/PreviewModal.tsx +94 -0
  127. package/src/PreviewPanel/PreviewPanel.spec.tsx +162 -0
  128. package/src/PreviewPanel/PreviewPanel.stories.tsx +66 -0
  129. package/src/PreviewPanel/PreviewPanel.tsx +83 -0
  130. package/src/PreviewPanel/PreviewPanelHOC.spec.tsx +45 -0
  131. package/src/PreviewPanel/PreviewPanelHOC.tsx +17 -0
  132. package/src/ResetButton/ResetButton.spec.tsx +42 -0
  133. package/src/ResetButton/ResetButton.tsx +22 -0
  134. package/src/ResourceItem/ResourceItem.spec.tsx +65 -0
  135. package/src/ResourceItem/ResourceItem.tsx +90 -0
  136. package/src/ResourceState/ResourceState.spec.tsx +26 -0
  137. package/src/ResourceState/ResourceState.stories.tsx +24 -0
  138. package/src/ResourceState/ResourceState.tsx +31 -0
  139. package/src/Skeleton/List/SkeletonList.spec.tsx +18 -0
  140. package/src/Skeleton/List/SkeletonList.stories.tsx +15 -0
  141. package/src/Skeleton/List/SkeletonList.tsx +20 -0
  142. package/src/Skeleton/ListItem/SkeletonListItem.stories.tsx +15 -0
  143. package/src/Skeleton/ListItem/SkeletonListItem.tsx +14 -0
  144. package/src/Skeleton/_skeleton.scss +15 -0
  145. package/src/Spinner/Spinner.spec.tsx +18 -0
  146. package/src/Spinner/Spinner.stories.tsx +26 -0
  147. package/src/Spinner/Spinner.tsx +16 -0
  148. package/src/Spinner/_spinner.scss +14 -0
  149. package/src/index.scss +22 -0
  150. package/src/index.stories.tsx +26 -0
  151. package/src/index.ts +20 -0
  152. package/tailwind.config.cjs +89 -0
  153. package/tsconfig.json +22 -0
@@ -0,0 +1,110 @@
1
+ import React from 'react';
2
+ import { StoryFn, Meta } from '@storybook/react';
3
+
4
+ import { Icon } from './Icon';
5
+
6
+ export default {
7
+ title: 'Icons/Icon',
8
+ component: Icon,
9
+ } as Meta<typeof Icon>;
10
+
11
+ const Template: StoryFn<typeof Icon> = (props) => <Icon {...props} />;
12
+
13
+ export const Error = Template.bind({});
14
+ Error.args = {
15
+ icon: 'error',
16
+ };
17
+
18
+ export const ArrowRight = Template.bind({});
19
+ ArrowRight.args = {
20
+ icon: 'arrow-right',
21
+ };
22
+
23
+ export const Selected = Template.bind({});
24
+ Selected.args = {
25
+ icon: 'selected',
26
+ };
27
+
28
+ export const Root = Template.bind({});
29
+ Root.args = {
30
+ icon: 'root',
31
+ };
32
+
33
+ export const Audio = Template.bind({});
34
+ Audio.args = {
35
+ icon: 'audio_file',
36
+ resourceSource: 'matrix',
37
+ };
38
+
39
+ export const Excel = Template.bind({});
40
+ Excel.args = {
41
+ icon: 'excel_doc',
42
+ resourceSource: 'matrix',
43
+ };
44
+
45
+ export const Folder = Template.bind({});
46
+ Folder.args = {
47
+ icon: 'folder',
48
+ resourceSource: 'matrix',
49
+ };
50
+
51
+ export const GenericFile = Template.bind({});
52
+ GenericFile.args = {
53
+ icon: 'generic_file',
54
+ resourceSource: 'matrix',
55
+ };
56
+
57
+ export const Image = Template.bind({});
58
+ Image.args = {
59
+ icon: 'image',
60
+ resourceSource: 'matrix',
61
+ };
62
+
63
+ export const Page = Template.bind({});
64
+ Page.args = {
65
+ icon: 'page_standard',
66
+ resourceSource: 'matrix',
67
+ };
68
+
69
+ export const Pdf = Template.bind({});
70
+ Pdf.args = {
71
+ icon: 'pdf_file',
72
+ resourceSource: 'matrix',
73
+ };
74
+
75
+ export const Powerpoint = Template.bind({});
76
+ Powerpoint.args = {
77
+ icon: 'powerpoint_doc',
78
+ resourceSource: 'matrix',
79
+ };
80
+
81
+ export const Site = Template.bind({});
82
+ Site.args = {
83
+ icon: 'site',
84
+ resourceSource: 'matrix',
85
+ };
86
+
87
+ export const Video = Template.bind({});
88
+ Video.args = {
89
+ icon: 'video_file',
90
+ resourceSource: 'matrix',
91
+ };
92
+
93
+ export const Word = Template.bind({});
94
+ Word.args = {
95
+ icon: 'word_doc',
96
+ resourceSource: 'matrix',
97
+ };
98
+
99
+ export const LargeIcon = Template.bind({});
100
+ LargeIcon.args = {
101
+ className: 'w-36 h-36',
102
+ };
103
+
104
+ export const SmallIcon = Template.bind({});
105
+ SmallIcon.args = {
106
+ className: 'w-4 h-4',
107
+ };
108
+
109
+ export const Default = Template.bind({});
110
+ Default.args = {};
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import GenericIconMap from './Generics/GenericIconMap';
3
+ import MatrixResourceMap from './MatrixResources/MatrixResourceMap';
4
+
5
+ export const iconSources = {
6
+ generic: GenericIconMap,
7
+ matrix: MatrixResourceMap,
8
+ };
9
+
10
+ // The resource sources options
11
+ export type ResourceSources = keyof typeof iconSources;
12
+ export type IconOptions = string;
13
+
14
+ /**
15
+ * Renders an icon based on the resource source and the icon name
16
+ * @param {{resourceSource?: ResourceSources; icon?: IconOptions; props: React.HTMLAttributes<HTMLOrSVGElement>}} props - The props for the Icon component
17
+ * @returns {React.FunctionComponent} - The icon component
18
+ * @example
19
+ * <Icon />
20
+ * @example
21
+ * <Icon resourceSource="generic" icon="generic_file" />
22
+ * @example
23
+ * <Icon resourceSource="matrix" icon="page" />
24
+ * @example
25
+ * <Icon resourceSource="matrix" icon="page" height={24} width={24} />
26
+ * @example
27
+ * <Icon resourceSource="matrix" icon="page" className="custom-class" />
28
+ */
29
+ export function Icon({
30
+ resourceSource = 'generic',
31
+ icon,
32
+ isDecorative = true,
33
+ ...props
34
+ }: {
35
+ icon?: IconOptions;
36
+ resourceSource?: ResourceSources;
37
+ isDecorative?: boolean;
38
+ } & React.HTMLAttributes<HTMLElement> &
39
+ React.SVGAttributes<SVGElement>) {
40
+ const icons = (iconSources[resourceSource] as any) || null;
41
+
42
+ // If the resource source is the current source and the icon is in the current source map, render the icon
43
+ if (icons && icon && icon in icons) {
44
+ // Get the icon from the current source map
45
+ const Icon = icons[icon] as React.FunctionComponent<{ isDecorative: boolean } & React.SVGProps<SVGSVGElement>>;
46
+
47
+ // Render the icon
48
+ return <Icon isDecorative={isDecorative} {...props} />;
49
+ }
50
+
51
+ // If the icon is not defined, render the default icon
52
+ const DefaultIcon = MatrixResourceMap['generic_file'];
53
+ return <DefaultIcon isDecorative={isDecorative} {...props} />;
54
+ }
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the Audio icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Audio component
6
+ * @returns {JSX.Element} - The Audio component
7
+ * @example
8
+ * <Audio />
9
+ * @example
10
+ * <Audio height={24} width={24} />
11
+ * @example
12
+ * <Audio className="custom-class" />
13
+ */
14
+ export default function Audio({ isDecorative, ...props }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
15
+ return (
16
+ <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props}>
17
+ <rect fill="#cce9ed" height="19" rx="1.5" stroke="#73c0cb" width="19" x="2.5" y="2.5" />
18
+ <path
19
+ d="m9.5 7.4798c0-.23683.16616-.44118.39802-.48949l5.99998-1.25c.3105-.06468.602.17234.602.48949v1.2904c0 .23683-.1662.44118-.398.48949l-6 1.25c-.31051.06468-.602-.17234-.602-.48949z"
20
+ fill="#73c0cb"
21
+ stroke="#057e91"
22
+ />
23
+ <path d="m9 8c0-.55228.44772-1 1-1v9.5c0 .2761-.22386.5-.5.5s-.5-.2239-.5-.5z" fill="#057e91" />
24
+ <circle cx="7.5" cy="16.5" fill="#73c0cb" r="2" stroke="#057e91" />
25
+ <path d="m16 7 1 .32v7.18c0 .2761-.2239.5-.5.5s-.5-.2239-.5-.5z" fill="#057e91" />
26
+ <circle cx="14.5" cy="14.5" fill="#73c0cb" r="2" stroke="#057e91" />
27
+ {!isDecorative && <title>audio file icon</title>}
28
+ </svg>
29
+ );
30
+ }
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the Excel icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Excel component
6
+ * @returns {JSX.Element} - The Excel component
7
+ * @example
8
+ * <Excel />
9
+ * @example
10
+ * <Excel height={24} width={24} />
11
+ * @example
12
+ * <Excel className="custom-class" />
13
+ */
14
+ export default function Excel({ isDecorative, ...props }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
15
+ return (
16
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
17
+ <path
18
+ d="M14.1716 2.5H6C5.17157 2.5 4.5 3.17157 4.5 4V20C4.5 20.8284 5.17157 21.5 6 21.5H18C18.8284 21.5 19.5 20.8284 19.5 20V7.82843C19.5 7.16539 19.2366 6.5295 18.7678 6.06066L15.9393 3.23223C15.4705 2.76339 14.8346 2.5 14.1716 2.5Z"
19
+ fill="#E7E7E7"
20
+ stroke="#BCBCBC"
21
+ />
22
+ <path d="M14.5 3V6.5C14.5 7.05228 14.9477 7.5 15.5 7.5H19" stroke="#BCBCBC" />
23
+ <rect y="8" width="12" height="12" rx="2" fill="#4FAD6F" />
24
+ <path d="M3.5 11.5L8.5 16.5" stroke="white" strokeLinecap="round" />
25
+ <path d="M8.5 11.5L3.5 16.5" stroke="white" strokeLinecap="round" />
26
+ {!isDecorative && <title>excel doc icon</title>}
27
+ </svg>
28
+ );
29
+ }
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the Folder icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Folder component
6
+ * @returns {JSX.Element} - The Folder component
7
+ * @example
8
+ * <Folder />
9
+ * @example
10
+ * <Folder height={24} width={24} />
11
+ * @example
12
+ * <Folder className="custom-class" />
13
+ */
14
+ export default function Folder({ isDecorative, ...props }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
15
+ return (
16
+ <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props}>
17
+ <path
18
+ d="m1 5c0-1.10457.89543-2 2-2h8.1177c.6752 0 1.3049.34077 1.6743.9061l2.208 3.37961-14 3.71429z"
19
+ fill="#efb324"
20
+ />
21
+ <path
22
+ d="m3 6.5c-.82843 0-1.5.67157-1.5 1.5v11.5c0 .5523.44771 1 1 1h18.5c.8284 0 1.5-.6716 1.5-1.5v-11c0-.82843-.6716-1.5-1.5-1.5h-7.5106-2.8369z"
23
+ fill="#fbefd2"
24
+ stroke="#f5d584"
25
+ />
26
+ {!isDecorative && <title>folder icon</title>}
27
+ </svg>
28
+ );
29
+ }
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the GenericFile icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the GenericFile component
6
+ * @returns {JSX.Element} - The GenericFile component
7
+ * @example
8
+ * <GenericFile />
9
+ * @example
10
+ * <GenericFile height={24} width={24} />
11
+ * @example
12
+ * <GenericFile className="custom-class" />
13
+ */
14
+ export default function GenericFile({
15
+ isDecorative,
16
+ ...props
17
+ }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
18
+ return (
19
+ <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props}>
20
+ <path
21
+ 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"
22
+ fill="#fff"
23
+ stroke="#74b1e6"
24
+ />
25
+ <path d="m14.5 3v3.5c0 .55228.4477 1 1 1h3.5" stroke="#74b1e6" />
26
+ <path d="m14.5 7.5v-5l5 5z" fill="#cce2f6" />
27
+ <g stroke="#74b1e6">
28
+ <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" />
29
+ <path d="m14.5 3v3.5c0 .55228.4477 1 1 1h3.5" />
30
+ </g>
31
+ {!isDecorative && <title>generic file icon</title>}
32
+ </svg>
33
+ );
34
+ }
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the Image icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Image component
6
+ * @returns {JSX.Element} - The Image component
7
+ * @example
8
+ * <Image />
9
+ * @example
10
+ * <Image height={24} width={24} />
11
+ * @example
12
+ * <Image className="custom-class" />
13
+ */
14
+ export default function Image({ isDecorative, ...props }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
15
+ return (
16
+ <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props}>
17
+ <path
18
+ 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"
19
+ fill="#cce2f6"
20
+ stroke="#74b1e6"
21
+ />
22
+ <circle cx="15.5" cy="8.5" fill="#fbefd2" r="3" stroke="#f0c14f" />
23
+ <path
24
+ 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"
25
+ fill="#cee9d8"
26
+ stroke="#79c292"
27
+ />
28
+ <path
29
+ 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"
30
+ fill="#79c292"
31
+ stroke="#098934"
32
+ />
33
+ {!isDecorative && <title>image icon</title>}
34
+ </svg>
35
+ );
36
+ }
@@ -0,0 +1,19 @@
1
+ import { Audio, Excel, Folder, GenericFile, Image, Page, Pdf, Powerpoint, Site, Video, Word } from '.';
2
+
3
+ // Define our map of matrix types to icons
4
+ const MatrixResourceMap = {
5
+ audio_file: Audio,
6
+ excel_doc: Excel,
7
+ folder: Folder,
8
+ generic_file: GenericFile, // fallback when a type doesn't match.
9
+ image: Image,
10
+ page_standard: Page,
11
+ pdf_file: Pdf,
12
+ powerpoint_doc: Powerpoint,
13
+ site: Site,
14
+ video_file: Video,
15
+ word_doc: Word,
16
+ };
17
+
18
+ // Export our map
19
+ export default MatrixResourceMap;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the Page icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Page component
6
+ * @returns {JSX.Element} - The Page component
7
+ * @example
8
+ * <Page />
9
+ * @example
10
+ * <Page height={24} width={24} />
11
+ * @example
12
+ * <Page className="custom-class" />
13
+ */
14
+ export default function Page({ isDecorative, ...props }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
15
+ return (
16
+ <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props}>
17
+ <path
18
+ 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"
19
+ fill="#cee9d8"
20
+ stroke="#79c292"
21
+ />
22
+ <g fill="#098934">
23
+ <rect height="1" rx=".5" width="6" x="6" y="8" />
24
+ <rect height="1" rx=".5" width="6" x="6" y="10" />
25
+ <rect height="1" rx=".5" width="12" x="6" y="12" />
26
+ <rect height="1" rx=".5" width="12" x="6" y="14" />
27
+ <rect height="1" rx=".5" width="12" x="6" y="16" />
28
+ <rect height="1" rx=".5" width="12" x="6" y="18" />
29
+ </g>
30
+ {!isDecorative && <title>page standard icon</title>}
31
+ </svg>
32
+ );
33
+ }
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the Pdf icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Pdf component
6
+ * @returns {JSX.Element} - The Pdf component
7
+ * @example
8
+ * <Pdf />
9
+ * @example
10
+ * <Pdf height={24} width={24} />
11
+ * @example
12
+ * <Pdf className="custom-class" />
13
+ */
14
+ export default function Pdf({ isDecorative, ...props }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
15
+ return (
16
+ <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props}>
17
+ <path
18
+ 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"
19
+ fill="#f6d2d1"
20
+ stroke="#e88483"
21
+ />
22
+ <path d="m14.5 3v3.5c0 .55228.4477 1 1 1h3.5" stroke="#e88483" />
23
+ <rect fill="#d72321" height="9" rx="2" width="17" y="11" />
24
+ <rect fill="#d72321" height="7" rx="1" width="13" x="2" y="12" />
25
+ <g stroke="#fff" strokeLinecap="round">
26
+ <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" />
27
+ <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" />
28
+ <path d="m11.5 17.5v-3.8c0-.1105.0895-.2.2-.2h1.8" />
29
+ <path d="m11.5 15.5h1" />
30
+ </g>
31
+ {!isDecorative && <title>pdf file icon</title>}
32
+ </svg>
33
+ );
34
+ }
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the Powerpoint icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Powerpoint component
6
+ * @returns {JSX.Element} - The Powerpoint component
7
+ * @example
8
+ * <Powerpoint />
9
+ * @example
10
+ * <Powerpoint height={24} width={24} />
11
+ * @example
12
+ * <Powerpoint className="custom-class" />
13
+ */
14
+ export default function Powerpoint({
15
+ isDecorative,
16
+ ...props
17
+ }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
18
+ return (
19
+ <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props}>
20
+ <path
21
+ 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"
22
+ fill="#e7e7e7"
23
+ stroke="#bcbcbc"
24
+ />
25
+ <path d="m14.5 3v3.5c0 .55228.4477 1 1 1h3.5" stroke="#bcbcbc" />
26
+ <rect fill="#e96900" height="12" rx="2" width="12" y="8" />
27
+ <g stroke="#fff" strokeLinecap="round">
28
+ <path d="m3.5 11.5v5" />
29
+ <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" />
30
+ </g>
31
+ {!isDecorative && <title>powerpoint doc icon</title>}
32
+ </svg>
33
+ );
34
+ }
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the Site icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Site component
6
+ * @returns {JSX.Element} - The Site component
7
+ * @example
8
+ * <Site />
9
+ * @example
10
+ * <Site height={24} width={24} />
11
+ * @example
12
+ * <Site className="custom-class" />
13
+ */
14
+ export default function Site({ isDecorative, ...props }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
15
+ return (
16
+ <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props}>
17
+ <circle cx="12" cy="12" fill="#cce2f5" r="10.5" stroke="#7db4e3" />
18
+ <path
19
+ 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"
20
+ fill="#cce2f5"
21
+ stroke="#7db4e3"
22
+ />
23
+ <path
24
+ 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"
25
+ fill="#cce2f5"
26
+ stroke="#7db4e3"
27
+ />
28
+ <g fill="#7db4e3">
29
+ <path d="m2 14h20v1h-20z" />
30
+ <path d="m2 9h20v1h-20z" />
31
+ <path d="m5 4 2.5-1-.5 1h10l-.5-1 2.5 1 .5 1h-15z" />
32
+ <path d="m4 19h16l-.5 1-3 1 .5-1h-10l.5 1-3-1z" />
33
+ </g>
34
+ {!isDecorative && <title>site icon</title>}
35
+ </svg>
36
+ );
37
+ }
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the Video icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Video component
6
+ * @returns {JSX.Element} - The Video component
7
+ * @example
8
+ * <Video />
9
+ * @example
10
+ * <Video height={24} width={24} />
11
+ * @example
12
+ * <Video className="custom-class" />
13
+ */
14
+ export default function Video({ isDecorative, ...props }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
15
+ return (
16
+ <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props}>
17
+ <rect fill="#e0d9ef" height="15" rx="1.5" stroke="#ac98d5" width="21" x="1.5" y="4.5" />
18
+ <path
19
+ 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"
20
+ fill="#ac98d5"
21
+ stroke="#6b47b4"
22
+ strokeLinecap="round"
23
+ />
24
+ {!isDecorative && <title>video file icon</title>}
25
+ </svg>
26
+ );
27
+ }
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Renders the Word icon
5
+ * @param {React.SVGProps<SVGSVGElement>} props - The props for the Word component
6
+ * @returns {JSX.Element} - The Word component
7
+ * @example
8
+ * <Word />
9
+ * @example
10
+ * <Word isDecorative={false} />
11
+ * @example
12
+ * <Word height={24} width={24} />
13
+ * @example
14
+ * <Word className="custom-class" />
15
+ */
16
+ export default function Word({ isDecorative, ...props }: { isDecorative: boolean } & React.SVGProps<SVGSVGElement>) {
17
+ return (
18
+ <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props}>
19
+ <path
20
+ 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"
21
+ fill="#e7e7e7"
22
+ stroke="#bcbcbc"
23
+ />
24
+ <path d="m14.5 3v3.5c0 .55228.4477 1 1 1h3.5" stroke="#bcbcbc" />
25
+ <rect fill="#0774d2" height="12" rx="2" width="12" y="8" />
26
+ <path d="m2.5 11.5 1.5 5 2-5 2 5 1.5-5" stroke="#fff" strokeLinecap="round" strokeLinejoin="round" />
27
+ {!isDecorative && <title>word doc icon</title>}
28
+ </svg>
29
+ );
30
+ }
@@ -0,0 +1,12 @@
1
+ // Export all the icons from the MatrixResources folder
2
+ export { default as Audio } from './Audio';
3
+ export { default as Excel } from './Excel';
4
+ export { default as Folder } from './Folder';
5
+ export { default as GenericFile } from './GenericFile';
6
+ export { default as Image } from './Image';
7
+ export { default as Page } from './Page';
8
+ export { default as Pdf } from './Pdf';
9
+ export { default as Powerpoint } from './Powerpoint';
10
+ export { default as Site } from './Site';
11
+ export { default as Video } from './Video';
12
+ export { default as Word } from './Word';