@okta/odyssey-react-mui 1.14.4 → 1.14.6

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 (108) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/Badge.js +1 -1
  3. package/dist/Badge.js.map +1 -1
  4. package/dist/DataTable/DataTable.js +178 -58
  5. package/dist/DataTable/DataTable.js.map +1 -1
  6. package/dist/DataTable/DataTableEmptyState.js +55 -0
  7. package/dist/DataTable/DataTableEmptyState.js.map +1 -0
  8. package/dist/DataTable/DataTablePagination.js +221 -0
  9. package/dist/DataTable/DataTablePagination.js.map +1 -0
  10. package/dist/DataTable/DataTableRowActions.js +34 -24
  11. package/dist/DataTable/DataTableRowActions.js.map +1 -1
  12. package/dist/DataTable/DataTableSettings.js +22 -10
  13. package/dist/DataTable/DataTableSettings.js.map +1 -1
  14. package/dist/DataTable/constants.js +1 -0
  15. package/dist/DataTable/constants.js.map +1 -1
  16. package/dist/DataTable/index.js +1 -0
  17. package/dist/DataTable/index.js.map +1 -1
  18. package/dist/DataTable/useRowReordering.js +3 -3
  19. package/dist/DataTable/useRowReordering.js.map +1 -1
  20. package/dist/DataTable/useScrollIndication.js +70 -0
  21. package/dist/DataTable/useScrollIndication.js.map +1 -0
  22. package/dist/Field.js.map +1 -1
  23. package/dist/Fieldset.js +17 -14
  24. package/dist/Fieldset.js.map +1 -1
  25. package/dist/Form.js +33 -23
  26. package/dist/Form.js.map +1 -1
  27. package/dist/MenuButton.js +1 -1
  28. package/dist/MenuButton.js.map +1 -1
  29. package/dist/SearchField.js +2 -2
  30. package/dist/SearchField.js.map +1 -1
  31. package/dist/labs/DataFilters.js +6 -2
  32. package/dist/labs/DataFilters.js.map +1 -1
  33. package/dist/labs/DataTable.js +3 -3
  34. package/dist/labs/DataTable.js.map +1 -1
  35. package/dist/labs/FileUpload.js +195 -0
  36. package/dist/labs/FileUpload.js.map +1 -0
  37. package/dist/labs/FileUploadIllustration.js +54 -0
  38. package/dist/labs/FileUploadIllustration.js.map +1 -0
  39. package/dist/labs/FileUploadPreview.js +109 -0
  40. package/dist/labs/FileUploadPreview.js.map +1 -0
  41. package/dist/labs/index.js +1 -0
  42. package/dist/labs/index.js.map +1 -1
  43. package/dist/properties/ts/odyssey-react-mui.js +12 -0
  44. package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
  45. package/dist/src/DataTable/DataTable.d.ts +36 -18
  46. package/dist/src/DataTable/DataTable.d.ts.map +1 -1
  47. package/dist/src/DataTable/DataTableEmptyState.d.ts +21 -0
  48. package/dist/src/DataTable/DataTableEmptyState.d.ts.map +1 -0
  49. package/dist/src/DataTable/DataTablePagination.d.ts +33 -0
  50. package/dist/src/DataTable/DataTablePagination.d.ts.map +1 -0
  51. package/dist/src/DataTable/DataTableRowActions.d.ts.map +1 -1
  52. package/dist/src/DataTable/DataTableSettings.d.ts.map +1 -1
  53. package/dist/src/DataTable/constants.d.ts +1 -0
  54. package/dist/src/DataTable/constants.d.ts.map +1 -1
  55. package/dist/src/DataTable/index.d.ts +2 -1
  56. package/dist/src/DataTable/index.d.ts.map +1 -1
  57. package/dist/src/DataTable/useRowReordering.d.ts.map +1 -1
  58. package/dist/src/DataTable/useScrollIndication.d.ts +22 -0
  59. package/dist/src/DataTable/useScrollIndication.d.ts.map +1 -0
  60. package/dist/src/Field.d.ts +8 -7
  61. package/dist/src/Field.d.ts.map +1 -1
  62. package/dist/src/Fieldset.d.ts.map +1 -1
  63. package/dist/src/Form.d.ts.map +1 -1
  64. package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
  65. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
  66. package/dist/src/SearchField.d.ts.map +1 -1
  67. package/dist/src/labs/DataFilters.d.ts +5 -1
  68. package/dist/src/labs/DataFilters.d.ts.map +1 -1
  69. package/dist/src/labs/DataTable.d.ts.map +1 -1
  70. package/dist/src/labs/FileUpload.d.ts +40 -0
  71. package/dist/src/labs/FileUpload.d.ts.map +1 -0
  72. package/dist/src/labs/FileUploadIllustration.d.ts +15 -0
  73. package/dist/src/labs/FileUploadIllustration.d.ts.map +1 -0
  74. package/dist/src/labs/FileUploadPreview.d.ts +21 -0
  75. package/dist/src/labs/FileUploadPreview.d.ts.map +1 -0
  76. package/dist/src/labs/index.d.ts +4 -0
  77. package/dist/src/labs/index.d.ts.map +1 -1
  78. package/dist/src/properties/ts/odyssey-react-mui.d.ts +12 -0
  79. package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  80. package/dist/src/theme/components.d.ts.map +1 -1
  81. package/dist/theme/components.js +10 -1
  82. package/dist/theme/components.js.map +1 -1
  83. package/dist/tsconfig.production.tsbuildinfo +1 -1
  84. package/package.json +3 -3
  85. package/src/Badge.tsx +1 -1
  86. package/src/DataTable/DataTable.tsx +293 -85
  87. package/src/DataTable/DataTableEmptyState.tsx +62 -0
  88. package/src/DataTable/DataTablePagination.tsx +289 -0
  89. package/src/DataTable/DataTableRowActions.tsx +35 -37
  90. package/src/DataTable/DataTableSettings.tsx +43 -17
  91. package/src/DataTable/constants.ts +1 -0
  92. package/src/DataTable/index.tsx +7 -1
  93. package/src/DataTable/useRowReordering.tsx +5 -3
  94. package/src/DataTable/useScrollIndication.tsx +118 -0
  95. package/src/Field.tsx +9 -7
  96. package/src/Fieldset.tsx +24 -18
  97. package/src/Form.tsx +43 -27
  98. package/src/MenuButton.tsx +1 -1
  99. package/src/SearchField.tsx +1 -2
  100. package/src/labs/DataFilters.tsx +9 -0
  101. package/src/labs/DataTable.tsx +5 -9
  102. package/src/labs/FileUpload.tsx +301 -0
  103. package/src/labs/FileUploadIllustration.tsx +66 -0
  104. package/src/labs/FileUploadPreview.tsx +150 -0
  105. package/src/labs/index.ts +4 -2
  106. package/src/properties/odyssey-react-mui.properties +18 -0
  107. package/src/properties/ts/odyssey-react-mui.ts +1 -1
  108. package/src/theme/components.tsx +9 -0
@@ -0,0 +1,195 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { memo, useCallback, useEffect, useRef, useState } from "react";
14
+ import styled from "@emotion/styled";
15
+ import { useTranslation } from "react-i18next";
16
+ import { Button } from "../Button.js";
17
+ import { UploadIcon } from "../icons.generated/index.js";
18
+ import { Field } from "../Field.js";
19
+ import { FileUploadPreview } from "./FileUploadPreview.js";
20
+ import { FileUploadIllustration } from "./FileUploadIllustration.js";
21
+ import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
22
+ import { Support } from "../Typography.js";
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { jsxs as _jsxs } from "react/jsx-runtime";
25
+ import { Fragment as _Fragment } from "react/jsx-runtime";
26
+ export const fileUploadTypes = ["single", "multiple"];
27
+ export const fileUploadVariants = ["button", "dragAndDrop", "dragAndDropWithIcon"];
28
+ const BaseInputWrapper = styled.div({
29
+ position: "relative",
30
+ alignSelf: "flex-start",
31
+ input: {
32
+ position: "absolute",
33
+ width: "100%",
34
+ height: "100%",
35
+ opacity: 0
36
+ }
37
+ });
38
+ const InputContainer = styled(BaseInputWrapper)({
39
+ display: "flex",
40
+ alignSelf: "unset",
41
+ alignItems: "center",
42
+ justifyContent: "center",
43
+ "&:has(input:focus)": {
44
+ borderStyle: "solid"
45
+ }
46
+ }, ({
47
+ odysseyDesignTokens
48
+ }) => ({
49
+ padding: `${odysseyDesignTokens.Spacing6} ${odysseyDesignTokens.Spacing3}`,
50
+ border: `1px dashed ${odysseyDesignTokens.HueNeutral300}`,
51
+ borderRadius: odysseyDesignTokens.BorderRadiusMain,
52
+ transition: `border-color ${odysseyDesignTokens.TransitionTimingMain}, box-shadow ${odysseyDesignTokens.TransitionTimingMain}`,
53
+ "&:hover": {
54
+ borderColor: odysseyDesignTokens.HueNeutral700
55
+ },
56
+ "&:has(input:focus)": {
57
+ borderColor: odysseyDesignTokens.FocusOutlineColorPrimary,
58
+ boxShadow: `0 0 0 1px ${odysseyDesignTokens.FocusOutlineColorPrimary}`,
59
+ outline: `${odysseyDesignTokens.FocusOutlineWidthMain} ${odysseyDesignTokens.FocusOutlineStyle} transparent`,
60
+ outlineOffset: odysseyDesignTokens.FocusOutlineOffsetTight
61
+ },
62
+ "&:has(input:disabled)": {
63
+ backgroundColor: odysseyDesignTokens.HueNeutral50,
64
+ border: `1px solid ${odysseyDesignTokens.BorderColorDisabled}`,
65
+ color: odysseyDesignTokens.TypographyColorDisabled,
66
+ "&:hover": {
67
+ borderColor: odysseyDesignTokens.BorderColorDisabled
68
+ }
69
+ }
70
+ }));
71
+ const ButtonAndInfoContainer = styled.div({
72
+ display: "flex",
73
+ flexDirection: "column",
74
+ alignItems: "center",
75
+ justifyContent: "center"
76
+ });
77
+ const FileUpload = ({
78
+ acceptedFileTypes,
79
+ errorMessage,
80
+ id,
81
+ isDisabled = false,
82
+ isOptional,
83
+ hint,
84
+ HintLinkComponent,
85
+ label,
86
+ onChange,
87
+ type,
88
+ variant
89
+ }) => {
90
+ const odysseyDesignTokens = useOdysseyDesignTokens();
91
+ const {
92
+ t
93
+ } = useTranslation();
94
+ const inputRef = useRef(null);
95
+ const [filesToUpload, setFilesToUpload] = useState([]);
96
+ useEffect(() => {
97
+ onChange(filesToUpload);
98
+ }, [filesToUpload, onChange]);
99
+ const updateFilesToUpload = useCallback(event => {
100
+ const {
101
+ files
102
+ } = event.target;
103
+ if (files && files.length > 0) {
104
+ const mergedFiles = type === "multiple" ? [...filesToUpload, ...files] : [...files];
105
+ setFilesToUpload(mergedFiles);
106
+ }
107
+ event.target.value = "";
108
+ }, [type, filesToUpload]);
109
+ const triggerFileInputClick = useCallback(() => {
110
+ inputRef.current?.focus();
111
+ }, [inputRef]);
112
+ const removeFileFromFilesToUploadList = useCallback(name => {
113
+ const deletedFileFilteredOut = filesToUpload.filter(file => file.name !== name);
114
+ setFilesToUpload(deletedFileFilteredOut);
115
+ }, [filesToUpload]);
116
+ const renderFileInput = useCallback(({
117
+ ariaDescribedBy,
118
+ errorMessageElementId,
119
+ id,
120
+ labelElementId
121
+ }) => {
122
+ const fileNames = filesToUpload.map(file => file.name);
123
+ const acceptedFileTypesAsString = acceptedFileTypes?.join(",");
124
+ const Input = () => _jsx("input", {
125
+ accept: acceptedFileTypesAsString,
126
+ "aria-describedby": ariaDescribedBy,
127
+ "aria-errormessage": errorMessageElementId,
128
+ "aria-labelledby": labelElementId,
129
+ disabled: isDisabled,
130
+ id: id,
131
+ multiple: type === "multiple",
132
+ onChange: updateFilesToUpload,
133
+ ref: inputRef,
134
+ title: "",
135
+ type: "file"
136
+ });
137
+ if (variant === "button") {
138
+ return _jsxs(_Fragment, {
139
+ children: [_jsxs(BaseInputWrapper, {
140
+ children: [_jsx(Input, {}), _jsx(Button, {
141
+ isDisabled: isDisabled,
142
+ label: t("fileupload.button.text"),
143
+ onClick: triggerFileInputClick,
144
+ startIcon: _jsx(UploadIcon, {}),
145
+ variant: "secondary"
146
+ })]
147
+ }), _jsx(FileUploadPreview, {
148
+ fileNames: fileNames,
149
+ onFileRemove: removeFileFromFilesToUploadList,
150
+ isDisabled: isDisabled
151
+ })]
152
+ });
153
+ }
154
+ return _jsxs(_Fragment, {
155
+ children: [_jsxs(InputContainer, {
156
+ odysseyDesignTokens: odysseyDesignTokens,
157
+ children: [_jsx(Input, {}), _jsxs(ButtonAndInfoContainer, {
158
+ children: [variant === "dragAndDropWithIcon" && _jsx(FileUploadIllustration, {}), _jsx(Support, {
159
+ color: "textSecondary",
160
+ children: t("fileupload.prompt.text")
161
+ }), _jsx(Button, {
162
+ isDisabled: isDisabled,
163
+ label: t("fileupload.button.text"),
164
+ onClick: triggerFileInputClick,
165
+ startIcon: _jsx(UploadIcon, {}),
166
+ variant: "secondary"
167
+ })]
168
+ })]
169
+ }), _jsx(FileUploadPreview, {
170
+ fileNames: fileNames,
171
+ onFileRemove: removeFileFromFilesToUploadList,
172
+ isDisabled: isDisabled
173
+ })]
174
+ });
175
+ }, [acceptedFileTypes, filesToUpload, isDisabled, inputRef, odysseyDesignTokens, removeFileFromFilesToUploadList, triggerFileInputClick, t, type, updateFilesToUpload, variant]);
176
+ return _jsx(_Fragment, {
177
+ children: _jsx(Field, {
178
+ errorMessage: errorMessage,
179
+ fieldType: "single",
180
+ hasVisibleLabel: true,
181
+ hint: hint,
182
+ HintLinkComponent: HintLinkComponent,
183
+ id: id,
184
+ isDisabled: isDisabled,
185
+ isFullWidth: true,
186
+ isOptional: isOptional,
187
+ label: label,
188
+ renderFieldComponent: renderFileInput
189
+ })
190
+ });
191
+ };
192
+ const MemoizedFileUpload = memo(FileUpload);
193
+ MemoizedFileUpload.displayName = "FileUpload";
194
+ export { MemoizedFileUpload as FileUpload };
195
+ //# sourceMappingURL=FileUpload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileUpload.js","names":["memo","useCallback","useEffect","useRef","useState","styled","useTranslation","Button","UploadIcon","Field","FileUploadPreview","FileUploadIllustration","useOdysseyDesignTokens","Support","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","fileUploadTypes","fileUploadVariants","BaseInputWrapper","div","position","alignSelf","input","width","height","opacity","InputContainer","display","alignItems","justifyContent","borderStyle","odysseyDesignTokens","padding","Spacing6","Spacing3","border","HueNeutral300","borderRadius","BorderRadiusMain","transition","TransitionTimingMain","borderColor","HueNeutral700","FocusOutlineColorPrimary","boxShadow","outline","FocusOutlineWidthMain","FocusOutlineStyle","outlineOffset","FocusOutlineOffsetTight","backgroundColor","HueNeutral50","BorderColorDisabled","color","TypographyColorDisabled","ButtonAndInfoContainer","flexDirection","FileUpload","acceptedFileTypes","errorMessage","id","isDisabled","isOptional","hint","HintLinkComponent","label","onChange","type","variant","t","inputRef","filesToUpload","setFilesToUpload","updateFilesToUpload","event","files","target","length","mergedFiles","value","triggerFileInputClick","current","focus","removeFileFromFilesToUploadList","name","deletedFileFilteredOut","filter","file","renderFileInput","ariaDescribedBy","errorMessageElementId","labelElementId","fileNames","map","acceptedFileTypesAsString","join","Input","accept","disabled","multiple","ref","title","children","onClick","startIcon","onFileRemove","fieldType","hasVisibleLabel","isFullWidth","renderFieldComponent","MemoizedFileUpload","displayName"],"sources":["../../src/labs/FileUpload.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n memo,\n ChangeEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport styled from \"@emotion/styled\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Button } from \"../Button\";\nimport { UploadIcon } from \"../icons.generated\";\nimport { Field, RenderFieldComponentProps } from \"../Field\";\nimport { FieldComponentProps } from \"../FieldComponentProps\";\nimport { FileUploadPreview } from \"./FileUploadPreview\";\nimport { FileUploadIllustration } from \"./FileUploadIllustration\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"../OdysseyDesignTokensContext\";\nimport { Support } from \"../Typography\";\n\nexport const fileUploadTypes = [\"single\", \"multiple\"] as const;\nexport const fileUploadVariants = [\n \"button\",\n \"dragAndDrop\",\n \"dragAndDropWithIcon\",\n] as const;\n\nconst BaseInputWrapper = styled.div({\n position: \"relative\",\n alignSelf: \"flex-start\",\n\n input: {\n position: \"absolute\",\n width: \"100%\",\n height: \"100%\",\n opacity: 0,\n },\n});\n\nconst InputContainer = styled(BaseInputWrapper)<{\n odysseyDesignTokens: DesignTokens;\n}>(\n {\n display: \"flex\",\n alignSelf: \"unset\",\n alignItems: \"center\",\n justifyContent: \"center\",\n\n \"&:has(input:focus)\": {\n borderStyle: \"solid\",\n },\n },\n ({ odysseyDesignTokens }) => ({\n padding: `${odysseyDesignTokens.Spacing6} ${odysseyDesignTokens.Spacing3}`,\n border: `1px dashed ${odysseyDesignTokens.HueNeutral300}`,\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n transition: `border-color ${odysseyDesignTokens.TransitionTimingMain}, box-shadow ${odysseyDesignTokens.TransitionTimingMain}`,\n\n \"&:hover\": {\n borderColor: odysseyDesignTokens.HueNeutral700,\n },\n\n \"&:has(input:focus)\": {\n borderColor: odysseyDesignTokens.FocusOutlineColorPrimary,\n boxShadow: `0 0 0 1px ${odysseyDesignTokens.FocusOutlineColorPrimary}`,\n outline: `${odysseyDesignTokens.FocusOutlineWidthMain} ${odysseyDesignTokens.FocusOutlineStyle} transparent`,\n outlineOffset: odysseyDesignTokens.FocusOutlineOffsetTight,\n },\n\n \"&:has(input:disabled)\": {\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n border: `1px solid ${odysseyDesignTokens.BorderColorDisabled}`,\n color: odysseyDesignTokens.TypographyColorDisabled,\n\n \"&:hover\": {\n borderColor: odysseyDesignTokens.BorderColorDisabled,\n },\n },\n }),\n);\n\nconst ButtonAndInfoContainer = styled.div({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n});\n\nexport type FileUploadProps = {\n /**\n * an array of file types the user is able to upload. @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers for examples\n */\n acceptedFileTypes?: string[];\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Function that is called when the list of ifles to upload is changed\n */\n onChange: (files: File[]) => void;\n /**\n * Either `single` or `multiple`. If `multiple`, multiple files can be uploaded\n */\n type?: (typeof fileUploadTypes)[number];\n /**\n * Either `button`, `dragAndDrop` or `dragAndDropWithIcon`. Will determine how component appears visually\n */\n variant: (typeof fileUploadVariants)[number];\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isOptional\"\n>;\n\nconst FileUpload = ({\n acceptedFileTypes,\n errorMessage,\n id,\n isDisabled = false,\n isOptional,\n hint,\n HintLinkComponent,\n label,\n onChange,\n type,\n variant,\n}: FileUploadProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const [filesToUpload, setFilesToUpload] = useState<File[]>([]);\n\n useEffect(() => {\n onChange(filesToUpload);\n }, [filesToUpload, onChange]);\n\n const updateFilesToUpload = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const { files } = event.target;\n\n if (files && files.length > 0) {\n const mergedFiles =\n type === \"multiple\"\n ? [...filesToUpload, ...files]\n : ([...files] satisfies File[] as File[]);\n\n setFilesToUpload(mergedFiles);\n }\n\n // reset input value to allow re-upload of a file with the same name\n event.target.value = \"\";\n },\n [type, filesToUpload],\n );\n\n const triggerFileInputClick = useCallback(() => {\n inputRef.current?.focus();\n }, [inputRef]);\n\n const removeFileFromFilesToUploadList = useCallback<(name: string) => void>(\n (name) => {\n const deletedFileFilteredOut = filesToUpload.filter(\n (file) => file.name !== name,\n );\n setFilesToUpload(deletedFileFilteredOut);\n },\n [filesToUpload],\n );\n\n const renderFileInput = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: RenderFieldComponentProps) => {\n const fileNames = filesToUpload.map((file) => file.name);\n const acceptedFileTypesAsString = acceptedFileTypes?.join(\",\");\n\n const Input = () => (\n <input\n accept={acceptedFileTypesAsString}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n aria-labelledby={labelElementId}\n disabled={isDisabled}\n id={id}\n multiple={type === \"multiple\"}\n onChange={updateFilesToUpload}\n ref={inputRef}\n title=\"\"\n type=\"file\"\n />\n );\n\n if (variant === \"button\") {\n return (\n <>\n <BaseInputWrapper>\n <Input />\n <Button\n isDisabled={isDisabled}\n label={t(\"fileupload.button.text\")}\n onClick={triggerFileInputClick}\n startIcon={<UploadIcon />}\n variant=\"secondary\"\n />\n </BaseInputWrapper>\n <FileUploadPreview\n fileNames={fileNames}\n onFileRemove={removeFileFromFilesToUploadList}\n isDisabled={isDisabled}\n />\n </>\n );\n }\n\n return (\n <>\n <InputContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Input />\n <ButtonAndInfoContainer>\n {variant === \"dragAndDropWithIcon\" && <FileUploadIllustration />}\n <Support color=\"textSecondary\">\n {t(\"fileupload.prompt.text\")}\n </Support>\n <Button\n isDisabled={isDisabled}\n label={t(\"fileupload.button.text\")}\n onClick={triggerFileInputClick}\n startIcon={<UploadIcon />}\n variant=\"secondary\"\n />\n </ButtonAndInfoContainer>\n </InputContainer>\n <FileUploadPreview\n fileNames={fileNames}\n onFileRemove={removeFileFromFilesToUploadList}\n isDisabled={isDisabled}\n />\n </>\n );\n },\n [\n acceptedFileTypes,\n filesToUpload,\n isDisabled,\n inputRef,\n odysseyDesignTokens,\n removeFileFromFilesToUploadList,\n triggerFileInputClick,\n t,\n type,\n updateFilesToUpload,\n variant,\n ],\n );\n\n return (\n <>\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={id}\n isDisabled={isDisabled}\n isFullWidth\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFileInput}\n />\n </>\n );\n};\n\nconst MemoizedFileUpload = memo(FileUpload);\nMemoizedFileUpload.displayName = \"FileUpload\";\n\nexport { MemoizedFileUpload as FileUpload };\n"],"mappings":"AAAA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AIrD,UAAU"}
@@ -0,0 +1,54 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { memo } from "react";
14
+ import styled from "@emotion/styled";
15
+ import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { jsxs as _jsxs } from "react/jsx-runtime";
18
+ const UploadIllustrationContainer = styled.div(({
19
+ odysseyDesignTokens
20
+ }) => ({
21
+ marginBlockEnd: odysseyDesignTokens.Spacing2,
22
+ padding: odysseyDesignTokens.Spacing3,
23
+ backgroundColor: odysseyDesignTokens.HueNeutral50,
24
+ borderRadius: "50%",
25
+ svg: {
26
+ display: "flex",
27
+ width: odysseyDesignTokens.Spacing8,
28
+ height: odysseyDesignTokens.Spacing8
29
+ }
30
+ }));
31
+ const FileUploadIllustration = () => {
32
+ const odysseyDesignTokens = useOdysseyDesignTokens();
33
+ return _jsx(UploadIllustrationContainer, {
34
+ "aria-hidden": "true",
35
+ odysseyDesignTokens: odysseyDesignTokens,
36
+ children: _jsxs("svg", {
37
+ "aria-hidden": "true",
38
+ viewBox: "0 0 44 45",
39
+ fill: "none",
40
+ xmlns: "http://www.w3.org/2000/svg",
41
+ children: [_jsx("path", {
42
+ d: "M32.0763 11.001C29.3564 3.7855 21.6595 -0.565827 13.7765 0.726748C5.35441 2.10773 -0.676662 9.50714 0.0603005 17.8612C0.441865 22.1865 2.56458 25.9787 5.71703 28.614L8.28246 25.545C5.90122 23.5544 4.32811 20.7209 4.04483 17.5097C3.50262 11.3633 7.94433 5.73648 14.4238 4.67404C20.9164 3.60944 27.0806 7.52016 28.6895 13.5191C28.9239 14.3932 29.7162 15.001 30.6212 15.001H32.9114C36.8985 15.001 39.9997 18.0938 39.9997 21.7505C39.9997 24.3423 38.4576 26.6352 36.1259 27.7678L37.8736 31.3658C41.4737 29.6171 43.9997 25.9917 43.9997 21.7505C43.9997 15.7428 38.963 11.001 32.9114 11.001H32.0763Z",
43
+ fill: odysseyDesignTokens.HueNeutral200
44
+ }), _jsx("path", {
45
+ d: "M23.9994 29.3277V44.5H19.9994V29.3289L14.4142 34.9141L11.5858 32.0857L19.7373 23.9342C20.9869 22.6845 23.0131 22.6845 24.2627 23.9342L32.4142 32.0857L29.5858 34.9141L23.9994 29.3277Z",
46
+ fill: odysseyDesignTokens.HueNeutral200
47
+ })]
48
+ })
49
+ });
50
+ };
51
+ const MemoizedFileUploadIllustration = memo(FileUploadIllustration);
52
+ MemoizedFileUploadIllustration.displayName = "FileUploadIllustration";
53
+ export { MemoizedFileUploadIllustration as FileUploadIllustration };
54
+ //# sourceMappingURL=FileUploadIllustration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileUploadIllustration.js","names":["memo","styled","useOdysseyDesignTokens","jsx","_jsx","jsxs","_jsxs","UploadIllustrationContainer","div","odysseyDesignTokens","marginBlockEnd","Spacing2","padding","Spacing3","backgroundColor","HueNeutral50","borderRadius","svg","display","width","Spacing8","height","FileUploadIllustration","children","viewBox","fill","xmlns","d","HueNeutral200","MemoizedFileUploadIllustration","displayName"],"sources":["../../src/labs/FileUploadIllustration.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo } from \"react\";\nimport styled from \"@emotion/styled\";\n\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"../OdysseyDesignTokensContext\";\n\nconst UploadIllustrationContainer = styled.div<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n marginBlockEnd: odysseyDesignTokens.Spacing2,\n padding: odysseyDesignTokens.Spacing3,\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n borderRadius: \"50%\",\n\n svg: {\n display: \"flex\",\n width: odysseyDesignTokens.Spacing8,\n height: odysseyDesignTokens.Spacing8,\n },\n}));\n\nconst FileUploadIllustration = () => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <UploadIllustrationContainer\n aria-hidden=\"true\"\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 44 45\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M32.0763 11.001C29.3564 3.7855 21.6595 -0.565827 13.7765 0.726748C5.35441 2.10773 -0.676662 9.50714 0.0603005 17.8612C0.441865 22.1865 2.56458 25.9787 5.71703 28.614L8.28246 25.545C5.90122 23.5544 4.32811 20.7209 4.04483 17.5097C3.50262 11.3633 7.94433 5.73648 14.4238 4.67404C20.9164 3.60944 27.0806 7.52016 28.6895 13.5191C28.9239 14.3932 29.7162 15.001 30.6212 15.001H32.9114C36.8985 15.001 39.9997 18.0938 39.9997 21.7505C39.9997 24.3423 38.4576 26.6352 36.1259 27.7678L37.8736 31.3658C41.4737 29.6171 43.9997 25.9917 43.9997 21.7505C43.9997 15.7428 38.963 11.001 32.9114 11.001H32.0763Z\"\n fill={odysseyDesignTokens.HueNeutral200}\n />\n <path\n d=\"M23.9994 29.3277V44.5H19.9994V29.3289L14.4142 34.9141L11.5858 32.0857L19.7373 23.9342C20.9869 22.6845 23.0131 22.6845 24.2627 23.9342L32.4142 32.0857L29.5858 34.9141L23.9994 29.3277Z\"\n fill={odysseyDesignTokens.HueNeutral200}\n />\n </svg>\n </UploadIllustrationContainer>\n );\n};\n\nconst MemoizedFileUploadIllustration = memo(FileUploadIllustration);\nMemoizedFileUploadIllustration.displayName = \"FileUploadIllustration\";\n\nexport { MemoizedFileUploadIllustration as FileUploadIllustration };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,OAAOC,MAAM,MAAM,iBAAiB;AAAC,SAGnCC,sBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAIxB,MAAMC,2BAA2B,GAAGN,MAAM,CAACO,GAAG,CAE3C,CAAC;EAAEC;AAAoB,CAAC,MAAM;EAC/BC,cAAc,EAAED,mBAAmB,CAACE,QAAQ;EAC5CC,OAAO,EAAEH,mBAAmB,CAACI,QAAQ;EACrCC,eAAe,EAAEL,mBAAmB,CAACM,YAAY;EACjDC,YAAY,EAAE,KAAK;EAEnBC,GAAG,EAAE;IACHC,OAAO,EAAE,MAAM;IACfC,KAAK,EAAEV,mBAAmB,CAACW,QAAQ;IACnCC,MAAM,EAAEZ,mBAAmB,CAACW;EAC9B;AACF,CAAC,CAAC,CAAC;AAEH,MAAME,sBAAsB,GAAGA,CAAA,KAAM;EACnC,MAAMb,mBAAmB,GAAGP,sBAAsB,CAAC,CAAC;EAEpD,OACEE,IAAA,CAACG,2BAA2B;IAC1B,eAAY,MAAM;IAClBE,mBAAmB,EAAEA,mBAAoB;IAAAc,QAAA,EAEzCjB,KAAA;MACE,eAAY,MAAM;MAClBkB,OAAO,EAAC,WAAW;MACnBC,IAAI,EAAC,MAAM;MACXC,KAAK,EAAC,4BAA4B;MAAAH,QAAA,GAElCnB,IAAA;QACEuB,CAAC,EAAC,ilBAAilB;QACnlBF,IAAI,EAAEhB,mBAAmB,CAACmB;MAAc,CACzC,CAAC,EACFxB,IAAA;QACEuB,CAAC,EAAC,wLAAwL;QAC1LF,IAAI,EAAEhB,mBAAmB,CAACmB;MAAc,CACzC,CAAC;IAAA,CACC;EAAC,CACqB,CAAC;AAElC,CAAC;AAED,MAAMC,8BAA8B,GAAG7B,IAAI,CAACsB,sBAAsB,CAAC;AACnEO,8BAA8B,CAACC,WAAW,GAAG,wBAAwB;AAErE,SAASD,8BAA8B,IAAIP,sBAAsB"}
@@ -0,0 +1,109 @@
1
+ import _IconButton from "@mui/material/IconButton";
2
+ /*!
3
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
4
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
5
+ *
6
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
7
+ * Unless required by applicable law or agreed to in writing, software
8
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ *
11
+ * See the License for the specific language governing permissions and limitations under the License.
12
+ */
13
+
14
+ import { memo, useCallback } from "react";
15
+ import styled from "@emotion/styled";
16
+ import { useTranslation } from "react-i18next";
17
+ import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
18
+ import { DeleteIcon } from "../icons.generated/index.js";
19
+ import { MuiPropsContext } from "../MuiPropsContext.js";
20
+ import { Tooltip } from "../Tooltip.js";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ import { jsxs as _jsxs } from "react/jsx-runtime";
23
+ const PreviewContainer = styled.div(({
24
+ isDisabled,
25
+ odysseyDesignTokens
26
+ }) => ({
27
+ color: isDisabled ? odysseyDesignTokens.TypographyColorDisabled : "inherit",
28
+ marginBlockStart: odysseyDesignTokens.Spacing2,
29
+ pointerEvents: isDisabled ? "none" : "auto"
30
+ }));
31
+ const UploadedFileContainer = styled.div({
32
+ display: "flex",
33
+ justifyContent: "space-between",
34
+ alignItems: "center",
35
+ button: {
36
+ transform: "scale(0)"
37
+ },
38
+ "&:hover, &:focus-within, &:focus": {
39
+ button: {
40
+ transform: "scale(1)"
41
+ }
42
+ }
43
+ }, ({
44
+ odysseyDesignTokens
45
+ }) => ({
46
+ padding: `${odysseyDesignTokens.Spacing1} ${odysseyDesignTokens.Spacing2}`,
47
+ borderRadius: odysseyDesignTokens.BorderRadiusMain,
48
+ transition: `background-color ${odysseyDesignTokens.TransitionTimingMain}`,
49
+ "&:hover, &:focus-within": {
50
+ backgroundColor: odysseyDesignTokens.HueNeutral100
51
+ },
52
+ "&:focus": {
53
+ borderColor: odysseyDesignTokens.FocusOutlineColorPrimary,
54
+ boxShadow: `0 0 0 2px ${odysseyDesignTokens.FocusOutlineColorPrimary}`,
55
+ outline: `${odysseyDesignTokens.FocusOutlineWidthMain} ${odysseyDesignTokens.FocusOutlineStyle} transparent`
56
+ }
57
+ }));
58
+ const UploadedFile = ({
59
+ name,
60
+ onFileRemove
61
+ }) => {
62
+ const {
63
+ t
64
+ } = useTranslation();
65
+ const odysseyDesignTokens = useOdysseyDesignTokens();
66
+ const deleteHandler = useCallback(() => {
67
+ onFileRemove?.(name);
68
+ }, [onFileRemove, name]);
69
+ const renderDeleteButton = useCallback(muiProps => {
70
+ return _jsx(_IconButton, {
71
+ ...muiProps,
72
+ "aria-label": t("fileupload.removefile.text"),
73
+ onClick: deleteHandler,
74
+ size: "small",
75
+ children: _jsx(DeleteIcon, {})
76
+ });
77
+ }, [deleteHandler, t]);
78
+ return _jsxs(UploadedFileContainer, {
79
+ tabIndex: 0,
80
+ odysseyDesignTokens: odysseyDesignTokens,
81
+ children: [name, _jsx(Tooltip, {
82
+ ariaType: "description",
83
+ placement: "top",
84
+ text: t("fileupload.removefile.text"),
85
+ children: _jsx(MuiPropsContext.Consumer, {
86
+ children: renderDeleteButton
87
+ })
88
+ })]
89
+ });
90
+ };
91
+ const FileUploadPreview = ({
92
+ fileNames,
93
+ isDisabled,
94
+ onFileRemove
95
+ }) => {
96
+ const odysseyDesignTokens = useOdysseyDesignTokens();
97
+ return _jsx(PreviewContainer, {
98
+ isDisabled: isDisabled,
99
+ odysseyDesignTokens: odysseyDesignTokens,
100
+ children: fileNames?.map((name, index) => _jsx(UploadedFile, {
101
+ onFileRemove: onFileRemove,
102
+ name: name
103
+ }, `${index}-${name}`))
104
+ });
105
+ };
106
+ const MemoizedFileUploadPreview = memo(FileUploadPreview);
107
+ MemoizedFileUploadPreview.displayName = "FileUploadPreview";
108
+ export { MemoizedFileUploadPreview as FileUploadPreview };
109
+ //# sourceMappingURL=FileUploadPreview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileUploadPreview.js","names":["memo","useCallback","styled","useTranslation","useOdysseyDesignTokens","DeleteIcon","MuiPropsContext","Tooltip","jsx","_jsx","jsxs","_jsxs","PreviewContainer","div","isDisabled","odysseyDesignTokens","color","TypographyColorDisabled","marginBlockStart","Spacing2","pointerEvents","UploadedFileContainer","display","justifyContent","alignItems","button","transform","padding","Spacing1","borderRadius","BorderRadiusMain","transition","TransitionTimingMain","backgroundColor","HueNeutral100","borderColor","FocusOutlineColorPrimary","boxShadow","outline","FocusOutlineWidthMain","FocusOutlineStyle","UploadedFile","name","onFileRemove","t","deleteHandler","renderDeleteButton","muiProps","_IconButton","onClick","size","children","tabIndex","ariaType","placement","text","Consumer","FileUploadPreview","fileNames","map","index","MemoizedFileUploadPreview","displayName"],"sources":["../../src/labs/FileUploadPreview.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, useCallback } from \"react\";\nimport styled from \"@emotion/styled\";\nimport { IconButton } from \"@mui/material\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { FileUploadProps } from \"./FileUpload\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"../OdysseyDesignTokensContext\";\nimport { DeleteIcon } from \"../icons.generated\";\nimport { MuiPropsContext, MuiPropsContextType } from \"../MuiPropsContext\";\nimport { Tooltip } from \"../Tooltip\";\n\nconst PreviewContainer = styled.div<{\n isDisabled: FileUploadProps[\"isDisabled\"];\n odysseyDesignTokens: DesignTokens;\n}>(({ isDisabled, odysseyDesignTokens }) => ({\n color: isDisabled ? odysseyDesignTokens.TypographyColorDisabled : \"inherit\",\n marginBlockStart: odysseyDesignTokens.Spacing2,\n pointerEvents: isDisabled ? \"none\" : \"auto\",\n}));\n\nconst UploadedFileContainer = styled.div<{ odysseyDesignTokens: DesignTokens }>(\n {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n\n button: {\n transform: \"scale(0)\",\n },\n\n \"&:hover, &:focus-within, &:focus\": {\n button: {\n transform: \"scale(1)\",\n },\n },\n },\n ({ odysseyDesignTokens }) => ({\n padding: `${odysseyDesignTokens.Spacing1} ${odysseyDesignTokens.Spacing2}`,\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n transition: `background-color ${odysseyDesignTokens.TransitionTimingMain}`,\n\n \"&:hover, &:focus-within\": {\n backgroundColor: odysseyDesignTokens.HueNeutral100,\n },\n\n \"&:focus\": {\n borderColor: odysseyDesignTokens.FocusOutlineColorPrimary,\n boxShadow: `0 0 0 2px ${odysseyDesignTokens.FocusOutlineColorPrimary}`,\n outline: `${odysseyDesignTokens.FocusOutlineWidthMain} ${odysseyDesignTokens.FocusOutlineStyle} transparent`,\n },\n }),\n);\n\ntype UploadedFileProps = {\n name: string;\n onFileRemove?: (name: string) => void;\n};\n\nconst UploadedFile = ({ name, onFileRemove }: UploadedFileProps) => {\n const { t } = useTranslation();\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const deleteHandler = useCallback(() => {\n onFileRemove?.(name);\n }, [onFileRemove, name]);\n\n const renderDeleteButton = useCallback(\n (muiProps: MuiPropsContextType) => {\n return (\n <IconButton\n {...muiProps}\n aria-label={t(\"fileupload.removefile.text\")}\n onClick={deleteHandler}\n size=\"small\"\n >\n <DeleteIcon />\n </IconButton>\n );\n },\n [deleteHandler, t],\n );\n\n return (\n <UploadedFileContainer\n // tabindex added to make this element focusable\n tabIndex={0}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {name}\n <Tooltip\n ariaType=\"description\"\n placement=\"top\"\n text={t(\"fileupload.removefile.text\")}\n >\n <MuiPropsContext.Consumer>\n {renderDeleteButton}\n </MuiPropsContext.Consumer>\n </Tooltip>\n </UploadedFileContainer>\n );\n};\n\ntype FileUploadPreviewProps = {\n fileNames: string[];\n isDisabled: FileUploadProps[\"isDisabled\"];\n onFileRemove?: (name: string) => void;\n};\n\nconst FileUploadPreview = ({\n fileNames,\n isDisabled,\n onFileRemove,\n}: FileUploadPreviewProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <PreviewContainer\n isDisabled={isDisabled}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {fileNames?.map((name, index) => (\n <UploadedFile\n key={`${index}-${name}`}\n onFileRemove={onFileRemove}\n name={name}\n />\n ))}\n </PreviewContainer>\n );\n};\n\nconst MemoizedFileUploadPreview = memo(FileUploadPreview);\nMemoizedFileUploadPreview.displayName = \"FileUploadPreview\";\n\nexport { MemoizedFileUploadPreview as FileUploadPreview };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,WAAW,QAAQ,OAAO;AACzC,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,SAASC,cAAc,QAAQ,eAAe;AAAC,SAI7CC,s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O,SAAS,EAAEC,GAAG,CAAC,CAACjB,IAAI,EAAEkB,KAAK,KAC1BnD,IAAA,CAACgC,YAAY;MAEXE,YAAY,EAAEA,YAAa;MAC3BD,IAAI,EAAEA;IAAK,GAFL,GAAEkB,KAAM,IAAGlB,IAAK,EAGvB,CACF;EAAC,CACc,CAAC;AAEvB,CAAC;AAED,MAAMmB,yBAAyB,GAAG7D,IAAI,CAACyD,iBAAiB,CAAC;AACzDI,yBAAyB,CAACC,WAAW,GAAG,mBAAmB;AAE3D,SAASD,yBAAyB,IAAIJ,iBAAiB"}
@@ -17,6 +17,7 @@ export * from "./datePickerTheme.js";
17
17
  export * from "./DataTablePagination.js";
18
18
  export * from "./DataFilters.js";
19
19
  export * from "./Drawer.js";
20
+ export * from "./FileUpload.js";
20
21
  export * from "./materialReactTableTypes.js";
21
22
  export * from "./StaticTable.js";
22
23
  export * from "./PaginatedTable.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["AdapterDateFns","LocalizationProvider"],"sources":["../../src/labs/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\nexport { LocalizationProvider } from \"@mui/x-date-pickers\";\nexport type { LocalizationProviderProps } from \"@mui/x-date-pickers\";\n\nexport * from \"./DatePicker\";\nexport * from \"./datePickerTheme\";\n\nexport * from \"./DataTablePagination\";\nexport * from \"./DataFilters\";\n\nexport * from \"./Drawer\";\n\nexport * from \"./materialReactTableTypes\";\nexport * from \"./StaticTable\";\nexport * from \"./PaginatedTable\";\n\nexport * from \"./GroupPicker\";\nexport * from \"./VirtualizedAutocomplete\";\n\nexport * from \"./Switch\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,oCAAoC;AACnE,SAASC,oBAAoB,QAAQ,qBAAqB;AAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["AdapterDateFns","LocalizationProvider"],"sources":["../../src/labs/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\nexport { LocalizationProvider } from \"@mui/x-date-pickers\";\nexport type { LocalizationProviderProps } from \"@mui/x-date-pickers\";\n\nexport * from \"./DatePicker\";\nexport * from \"./datePickerTheme\";\n\n/** @deprecated Will be removed in a future Odyssey version in lieu of the one shipping with DataTable */\nexport * from \"./DataTablePagination\";\nexport * from \"./DataFilters\";\nexport * from \"./Drawer\";\nexport * from \"./FileUpload\";\nexport * from \"./materialReactTableTypes\";\n/** @deprecated Will be removed in a future Odyssey version in lieu of DataTable */\nexport * from \"./StaticTable\";\n/** @deprecated Will be removed in a future Odyssey version in lieu of DataTable */\nexport * from \"./PaginatedTable\";\n\nexport * from \"./GroupPicker\";\nexport * from \"./VirtualizedAutocomplete\";\n\nexport * from \"./Switch\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,oCAAoC;AACnE,SAASC,oBAAoB,QAAQ,qBAAqB;AAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
@@ -12,6 +12,9 @@ export const translation = {
12
12
  "filters.menuitem.any": "Any {{label}}",
13
13
  "filters.menuitem.selected": "{{selected}} selected",
14
14
  "filters.search.label": "Search",
15
+ "fileupload.button.text": "Add files",
16
+ "fileupload.prompt.text": "Drag and drop files here or click to add files",
17
+ "fileupload.removefile.text": "Remove file",
15
18
  "passwordfield.icon.label.hide": "Hide password",
16
19
  "passwordfield.icon.label.show": "Show password",
17
20
  "severity.error": "error",
@@ -29,6 +32,15 @@ export const translation = {
29
32
  "table.fetchedrows.text": "Fetched {{totalRows}} row",
30
33
  "table.fetchedrows.text_plural": "Fetched {{totalRows}} total rows",
31
34
  "table.moreactions.arialabel": "More actions",
35
+ "table.noresults.heading": "There are no results.",
36
+ "table.noresults.text": "Try a different query.",
37
+ "table.pagination.loadmore": "Show more",
38
+ "table.pagination.next": "Next page",
39
+ "table.pagination.previous": "Previous page",
40
+ "table.pagination.page": "Page",
41
+ "table.pagination.rowsperpage": "Rows per page",
42
+ "table.pagination.rowswithtotal": "{{firstRow}}-{{lastRow}} of {{totalRows}} rows",
43
+ "table.pagination.rowswithouttotal": "{{firstRow}}-{{lastRow}} rows",
32
44
  "table.reorder.backward": "Send backward",
33
45
  "table.reorder.forward": "Bring forward",
34
46
  "table.reorder.toback": "Send to back",
@@ -1 +1 @@
1
- {"version":3,"file":"odyssey-react-mui.js","names":["translation"],"sources":["../../../src/properties/ts/odyssey-react-mui.ts"],"sourcesContent":["export const translation = {\"breadcrumbs.home.text\":\"Home\",\"breadcrumbs.label.text\":\"Breadcrumbs\",\"close.text\":\"close\",\"fielderror.screenreader.text\":\"Error\",\"fieldlabel.optional.text\":\"Optional\",\"fieldlabel.required.text\":\"Required\",\"filters.clear.label\":\"Clear filters\",\"filters.filter.any\":\"Any\",\"filters.filter.clear\":\"Clear filter\",\"filters.filters.arialabel\":\"Filters\",\"filters.menuitem.any\":\"Any {{label}}\",\"filters.menuitem.selected\":\"{{selected}} selected\",\"filters.search.label\":\"Search\",\"passwordfield.icon.label.hide\":\"Hide password\",\"passwordfield.icon.label.show\":\"Show password\",\"severity.error\":\"error\",\"severity.info\":\"info\",\"severity.success\":\"success\",\"severity.warning\":\"warning\",\"switch.active\":\"Active\",\"switch.inactive\":\"Inactive\",\"table.actions\":\"Actions\",\"table.columnvisibility.arialabel\":\"Show/hide columns\",\"table.density.arialabel\":\"Table density\",\"table.draghandle.arialabel\":\"Drag row to reorder. Or, press space or enter to start and stop reordering and esc to cancel.\",\"table.draghandle.tooltip\":\"Drag row or press space/enter key to start and stop reordering\",\"table.error\":\"Error loading data.\",\"table.fetchedrows.text\":\"Fetched {{totalRows}} row\",\"table.fetchedrows.text_plural\":\"Fetched {{totalRows}} total rows\",\"table.moreactions.arialabel\":\"More actions\",\"table.reorder.backward\":\"Send backward\",\"table.reorder.forward\":\"Bring forward\",\"table.reorder.toback\":\"Send to back\",\"table.reorder.tofront\":\"Bring to front\",\"table.rows.text\":\"{{totalRows}} row\",\"table.rows.text_plural\":\"{{totalRows}} rows\"};"],"mappings":"AAAA,OAAO,MAAMA,WAAW,GAAG;EAAC,uBAAuB,EAAC,MAAM;EAAC,wBAAwB,EAAC,aAAa;EAAC,YAAY,EAAC,OAAO;EAAC,8BAA8B,EAAC,OAAO;EAAC,0BAA0B,EAAC,UAAU;EAAC,0BAA0B,EAAC,UAAU;EAAC,qBAAqB,EAAC,eAAe;EAAC,oBAAoB,EAAC,KAAK;EAAC,sBAAsB,EAAC,cAAc;EAAC,2BAA2B,EAAC,SAAS;EAAC,sBAAsB,EAAC,eAAe;EAAC,2BAA2B,EAAC,uBAAuB;EAAC,sBAAsB,EAAC,QAAQ;EAAC,+BAA+B,EAAC,eAAe;EAAC,+BAA+B,EAAC,eAAe;EAAC,gBAAgB,EAAC,OAAO;EAAC,eAAe,EAAC,MAAM;EAAC,kBAAkB,EAAC,SAAS;EAAC,kBAAkB,EAAC,SAAS;EAAC,eAAe,EAAC,QAAQ;EAAC,iBAAiB,EAAC,UAAU;EAAC,eAAe,EAAC,SAAS;EAAC,kCAAkC,EAAC,mBAAmB;EAAC,yBAAyB,EAAC,eAAe;EAAC,4BAA4B,EAAC,+FAA+F;EAAC,0BAA0B,EAAC,gEAAgE;EAAC,aAAa,EAAC,qBAAqB;EAAC,wBAAwB,EAAC,2BAA2B;EAAC,+BAA+B,EAAC,kCAAkC;EAAC,6BAA6B,EAAC,cAAc;EAAC,wBAAwB,EAAC,eAAe;EAAC,uBAAuB,EAAC,eAAe;EAAC,sBAAsB,EAAC,cAAc;EAAC,uBAAuB,EAAC,gBAAgB;EAAC,iBAAiB,EAAC,mBAAmB;EAAC,wBAAwB,EAAC;AAAoB,CAAC"}
1
+ {"version":3,"file":"odyssey-react-mui.js","names":["translation"],"sources":["../../../src/properties/ts/odyssey-react-mui.ts"],"sourcesContent":["export const translation = {\"breadcrumbs.home.text\":\"Home\",\"breadcrumbs.label.text\":\"Breadcrumbs\",\"close.text\":\"close\",\"fielderror.screenreader.text\":\"Error\",\"fieldlabel.optional.text\":\"Optional\",\"fieldlabel.required.text\":\"Required\",\"filters.clear.label\":\"Clear filters\",\"filters.filter.any\":\"Any\",\"filters.filter.clear\":\"Clear filter\",\"filters.filters.arialabel\":\"Filters\",\"filters.menuitem.any\":\"Any {{label}}\",\"filters.menuitem.selected\":\"{{selected}} selected\",\"filters.search.label\":\"Search\",\"fileupload.button.text\":\"Add files\",\"fileupload.prompt.text\":\"Drag and drop files here or click to add files\",\"fileupload.removefile.text\":\"Remove file\",\"passwordfield.icon.label.hide\":\"Hide password\",\"passwordfield.icon.label.show\":\"Show password\",\"severity.error\":\"error\",\"severity.info\":\"info\",\"severity.success\":\"success\",\"severity.warning\":\"warning\",\"switch.active\":\"Active\",\"switch.inactive\":\"Inactive\",\"table.actions\":\"Actions\",\"table.columnvisibility.arialabel\":\"Show/hide columns\",\"table.density.arialabel\":\"Table density\",\"table.draghandle.arialabel\":\"Drag row to reorder. Or, press space or enter to start and stop reordering and esc to cancel.\",\"table.draghandle.tooltip\":\"Drag row or press space/enter key to start and stop reordering\",\"table.error\":\"Error loading data.\",\"table.fetchedrows.text\":\"Fetched {{totalRows}} row\",\"table.fetchedrows.text_plural\":\"Fetched {{totalRows}} total rows\",\"table.moreactions.arialabel\":\"More actions\",\"table.noresults.heading\":\"There are no results.\",\"table.noresults.text\":\"Try a different query.\",\"table.pagination.loadmore\":\"Show more\",\"table.pagination.next\":\"Next page\",\"table.pagination.previous\":\"Previous page\",\"table.pagination.page\":\"Page\",\"table.pagination.rowsperpage\":\"Rows per page\",\"table.pagination.rowswithtotal\":\"{{firstRow}}-{{lastRow}} of {{totalRows}} rows\",\"table.pagination.rowswithouttotal\":\"{{firstRow}}-{{lastRow}} rows\",\"table.reorder.backward\":\"Send backward\",\"table.reorder.forward\":\"Bring forward\",\"table.reorder.toback\":\"Send to back\",\"table.reorder.tofront\":\"Bring to front\",\"table.rows.text\":\"{{totalRows}} row\",\"table.rows.text_plural\":\"{{totalRows}} rows\"};"],"mappings":"AAAA,OAAO,MAAMA,WAAW,GAAG;EAAC,uBAAuB,EAAC,MAAM;EAAC,wBAAwB,EAAC,aAAa;EAAC,YAAY,EAAC,OAAO;EAAC,8BAA8B,EAAC,OAAO;EAAC,0BAA0B,EAAC,UAAU;EAAC,0BAA0B,EAAC,UAAU;EAAC,qBAAqB,EAAC,eAAe;EAAC,oBAAoB,EAAC,KAAK;EAAC,sBAAsB,EAAC,cAAc;EAAC,2BAA2B,EAAC,SAAS;EAAC,sBAAsB,EAAC,eAAe;EAAC,2BAA2B,EAAC,uBAAuB;EAAC,sBAAsB,EAAC,QAAQ;EAAC,wBAAwB,EAAC,WAAW;EAAC,wBAAwB,EAAC,gDAAgD;EAAC,4BAA4B,EAAC,aAAa;EAAC,+BAA+B,EAAC,eAAe;EAAC,+BAA+B,EAAC,eAAe;EAAC,gBAAgB,EAAC,OAAO;EAAC,eAAe,EAAC,MAAM;EAAC,kBAAkB,EAAC,SAAS;EAAC,kBAAkB,EAAC,SAAS;EAAC,eAAe,EAAC,QAAQ;EAAC,iBAAiB,EAAC,UAAU;EAAC,eAAe,EAAC,SAAS;EAAC,kCAAkC,EAAC,mBAAmB;EAAC,yBAAyB,EAAC,eAAe;EAAC,4BAA4B,EAAC,+FAA+F;EAAC,0BAA0B,EAAC,gEAAgE;EAAC,aAAa,EAAC,qBAAqB;EAAC,wBAAwB,EAAC,2BAA2B;EAAC,+BAA+B,EAAC,kCAAkC;EAAC,6BAA6B,EAAC,cAAc;EAAC,yBAAyB,EAAC,uBAAuB;EAAC,sBAAsB,EAAC,wBAAwB;EAAC,2BAA2B,EAAC,WAAW;EAAC,uBAAuB,EAAC,WAAW;EAAC,2BAA2B,EAAC,eAAe;EAAC,uBAAuB,EAAC,MAAM;EAAC,8BAA8B,EAAC,eAAe;EAAC,gCAAgC,EAAC,gDAAgD;EAAC,mCAAmC,EAAC,+BAA+B;EAAC,wBAAwB,EAAC,eAAe;EAAC,uBAAuB,EAAC,eAAe;EAAC,sBAAsB,EAAC,cAAc;EAAC,uBAAuB,EAAC,gBAAgB;EAAC,iBAAiB,EAAC,mBAAmB;EAAC,wBAAwB,EAAC;AAAoB,CAAC"}
@@ -9,13 +9,24 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
- /// <reference types="react" />
13
- import { MRT_RowData, MRT_SortingState, MRT_TableOptions } from "material-react-table";
14
- import { densityValues } from "./constants";
15
- import { paginationTypeValues } from "../labs/DataTablePagination";
12
+ import { ReactNode } from "react";
13
+ import { MRT_RowData, MRT_SortingState, MRT_TableOptions, MRT_RowSelectionState } from "material-react-table";
14
+ import { densityValues, paginationTypeValues } from "./constants";
16
15
  import { DataFilter } from "../labs/DataFilters";
17
16
  import { DataTableRowActionsProps } from "./DataTableRowActions";
17
+ import { MenuButtonProps } from "../MenuButton";
18
18
  import { DataTableRowSelectionState } from ".";
19
+ export type DataTableGetDataType = {
20
+ page?: number;
21
+ resultsPerPage?: number;
22
+ search?: string;
23
+ filters?: DataFilter[];
24
+ sort?: MRT_SortingState;
25
+ };
26
+ export type DataTableOnReorderRowsType = {
27
+ rowId: string;
28
+ newRowIndex: number;
29
+ };
19
30
  export type DataTableProps = {
20
31
  /**
21
32
  * The columns that make up the table
@@ -31,8 +42,8 @@ export type DataTableProps = {
31
42
  */
32
43
  getRowId?: MRT_TableOptions<MRT_RowData>["getRowId"];
33
44
  /**
34
- * The initial density of the table. This is available even if the table density
35
- * isn't changeable.
45
+ * The initial density (height & padding) of the table rows. This is available even if the
46
+ * table density isn't changeable by the end user via hasChangeableDensity.
36
47
  */
37
48
  initialDensity?: (typeof densityValues)[number];
38
49
  /**
@@ -91,21 +102,12 @@ export type DataTableProps = {
91
102
  * Callback that fires whenever the table needs to fetch new data, due to changes in
92
103
  * page, results per page, search input, filters, or sorting
93
104
  */
94
- getData: ({ page, resultsPerPage, search, filters, sort, }: {
95
- page?: number;
96
- resultsPerPage?: number;
97
- search?: string;
98
- filters?: DataFilter[];
99
- sort?: MRT_SortingState;
100
- }) => MRT_TableOptions<MRT_RowData>["data"] | Promise<MRT_TableOptions<MRT_RowData>["data"]>;
105
+ getData: ({ page, resultsPerPage, search, filters, sort, }: DataTableGetDataType) => MRT_TableOptions<MRT_RowData>["data"] | Promise<MRT_TableOptions<MRT_RowData>["data"]>;
101
106
  /**
102
107
  * Callback that fires when the user reorders rows within the table. Can be used
103
108
  * to propogate order change to the backend.
104
109
  */
105
- onReorderRows?: ({ rowId, newRowIndex, }: {
106
- rowId: string;
107
- newRowIndex: number;
108
- }) => void;
110
+ onReorderRows?: ({ rowId, newRowIndex }: DataTableOnReorderRowsType) => void;
109
111
  /**
110
112
  * The current page number.
111
113
  */
@@ -127,7 +129,23 @@ export type DataTableProps = {
127
129
  * Menu items to include in the optional actions menu on each row.
128
130
  */
129
131
  rowActionMenuItems?: DataTableRowActionsProps["rowActionMenuItems"];
132
+ /**
133
+ * Menu items to include in the bulk actions menu, which appears above the table if a row or rows are selected
134
+ */
135
+ bulkActionMenuItems?: (selectedRows: MRT_RowSelectionState) => MenuButtonProps["children"];
136
+ /**
137
+ * If `error` is not undefined, the DataTable will indicate an error.
138
+ */
139
+ errorMessage?: string;
140
+ /**
141
+ * The component to display when the table is displaying the initial empty state
142
+ */
143
+ emptyPlaceholder?: ReactNode;
144
+ /**
145
+ * The component to display when the query returns no results
146
+ */
147
+ noResultsPlaceholder?: ReactNode;
130
148
  };
131
- declare const MemoizedDataTable: import("react").MemoExoticComponent<({ columns, getRowId: getRowIdProp, currentPage, initialDensity, resultsPerPage, getData, onReorderRows, totalRows, hasSearchSubmitButton, searchDelayTime, paginationType, onChangeRowSelection, rowActionButtons, rowActionMenuItems, hasChangeableDensity, hasColumnResizing, hasColumnVisibility, hasFilters, hasPagination, hasRowReordering, hasRowSelection, hasSearch, hasSorting, }: DataTableProps) => import("react/jsx-runtime").JSX.Element>;
149
+ declare const MemoizedDataTable: import("react").MemoExoticComponent<({ columns, getRowId: getRowIdProp, currentPage, initialDensity, resultsPerPage, getData, onReorderRows, totalRows, hasSearchSubmitButton, searchDelayTime, paginationType, onChangeRowSelection, rowActionButtons, rowActionMenuItems, hasChangeableDensity, hasColumnResizing, hasColumnVisibility, hasFilters, hasPagination, hasRowReordering, hasRowSelection, hasSearch, hasSorting, bulkActionMenuItems, errorMessage: errorMessageProp, emptyPlaceholder, noResultsPlaceholder, }: DataTableProps) => import("react/jsx-runtime").JSX.Element>;
132
150
  export { MemoizedDataTable as DataTable };
133
151
  //# sourceMappingURL=DataTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/DataTable/DataTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAGH,OAAO,EAIL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jC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B;;OAEG;IACH,oBAAoB,CAAC,EAAE,SAAS,CAAC;CAClC,CAAC;AA2hBF,QAAA,MAAM,iBAAiB,igBA5YpB,cAAc,6CA4YwB,CAAC;AAG1C,OAAO,EAAE,iBAAiB,IAAI,SAAS,EAAE,CAAC"}
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+ import { ReactNode } from "react";
13
+ export type DataTableEmptyStateProps = {
14
+ heading: string;
15
+ text: string;
16
+ primaryButton?: ReactNode;
17
+ secondaryButton?: ReactNode;
18
+ };
19
+ declare const MemoizedDataTableEmptyState: import("react").MemoExoticComponent<({ heading, text, primaryButton, secondaryButton, }: DataTableEmptyStateProps) => import("react/jsx-runtime").JSX.Element>;
20
+ export { MemoizedDataTableEmptyState as DataTableEmptyState };
21
+ //# sourceMappingURL=DataTableEmptyState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTableEmptyState.d.ts","sourceRoot":"","sources":["../../../src/DataTable/DataTableEmptyState.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAQ,MAAM,OAAO,CAAC;AAoBxC,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,CAAC;AAuBF,QAAA,MAAM,2BAA2B,2FAhB9B,wBAAwB,6CAgBkC,CAAC;AAC9D,OAAO,EAAE,2BAA2B,IAAI,mBAAmB,EAAE,CAAC"}