@okta/odyssey-react-mui 1.22.0 → 1.23.0

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 (230) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/@types/i18next.d.js.map +1 -1
  3. package/dist/Autocomplete.js +30 -0
  4. package/dist/Autocomplete.js.map +1 -1
  5. package/dist/Callout.js +12 -24
  6. package/dist/Callout.js.map +1 -1
  7. package/dist/DataTable/useScrollIndication.js +7 -3
  8. package/dist/DataTable/useScrollIndication.js.map +1 -1
  9. package/dist/FileUploader/FileUploadIllustration.js.map +1 -0
  10. package/dist/FileUploader/FileUploadPreview.js.map +1 -0
  11. package/dist/{labs/FileUpload.js → FileUploader/FileUploader.js} +6 -5
  12. package/dist/FileUploader/FileUploader.js.map +1 -0
  13. package/dist/FileUploader/index.js +13 -0
  14. package/dist/FileUploader/index.js.map +1 -0
  15. package/dist/OdysseyProvider.js +4 -0
  16. package/dist/OdysseyProvider.js.map +1 -1
  17. package/dist/Radio.js +2 -2
  18. package/dist/Radio.js.map +1 -1
  19. package/dist/Select.js +36 -0
  20. package/dist/Select.js.map +1 -1
  21. package/dist/{labs/Switch.js → Switch.js} +7 -7
  22. package/dist/Switch.js.map +1 -0
  23. package/dist/Tabs.js +7 -9
  24. package/dist/Tabs.js.map +1 -1
  25. package/dist/Tag.js +102 -4
  26. package/dist/Tag.js.map +1 -1
  27. package/dist/TextField.js +16 -39
  28. package/dist/TextField.js.map +1 -1
  29. package/dist/Toast.js +2 -2
  30. package/dist/Toast.js.map +1 -1
  31. package/dist/createShadowDomElements.js +1 -0
  32. package/dist/createShadowDomElements.js.map +1 -1
  33. package/dist/i18n.js +1 -1
  34. package/dist/i18n.js.map +1 -1
  35. package/dist/index.js +2 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.scss +92 -4
  38. package/dist/labs/DataView/DataView.js +64 -25
  39. package/dist/labs/DataView/DataView.js.map +1 -1
  40. package/dist/labs/DataView/TableLayoutContent.js +17 -3
  41. package/dist/labs/DataView/TableLayoutContent.js.map +1 -1
  42. package/dist/labs/DataView/componentTypes.js.map +1 -1
  43. package/dist/labs/DateField.js +2 -0
  44. package/dist/labs/DateField.js.map +1 -1
  45. package/dist/labs/DatePicker.js +5 -1
  46. package/dist/labs/DatePicker.js.map +1 -1
  47. package/dist/labs/SideNav/OktaLogo.js +36 -0
  48. package/dist/labs/SideNav/OktaLogo.js.map +1 -0
  49. package/dist/labs/SideNav/SideNav.js +125 -36
  50. package/dist/labs/SideNav/SideNav.js.map +1 -1
  51. package/dist/labs/SideNav/SideNavHeader.js +33 -10
  52. package/dist/labs/SideNav/SideNavHeader.js.map +1 -1
  53. package/dist/labs/SideNav/types.js.map +1 -1
  54. package/dist/labs/TopNav.js +2 -1
  55. package/dist/labs/TopNav.js.map +1 -1
  56. package/dist/labs/index.js +0 -2
  57. package/dist/labs/index.js.map +1 -1
  58. package/dist/labs/useDateFieldsTranslations.js +1 -1
  59. package/dist/labs/useDateFieldsTranslations.js.map +1 -1
  60. package/dist/properties/ts/odyssey-react-mui.js +3 -1
  61. package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
  62. package/dist/src/Autocomplete.d.ts +30 -0
  63. package/dist/src/Autocomplete.d.ts.map +1 -1
  64. package/dist/src/Callout.d.ts +11 -23
  65. package/dist/src/Callout.d.ts.map +1 -1
  66. package/dist/src/DataTable/useScrollIndication.d.ts.map +1 -1
  67. package/dist/src/FileUploader/FileUploadIllustration.d.ts.map +1 -0
  68. package/dist/src/{labs → FileUploader}/FileUploadPreview.d.ts +2 -2
  69. package/dist/src/FileUploader/FileUploadPreview.d.ts.map +1 -0
  70. package/dist/src/{labs/FileUpload.d.ts → FileUploader/FileUploader.d.ts} +5 -4
  71. package/dist/src/FileUploader/FileUploader.d.ts.map +1 -0
  72. package/dist/src/FileUploader/index.d.ts +13 -0
  73. package/dist/src/FileUploader/index.d.ts.map +1 -0
  74. package/dist/src/NativeSelect.d.ts +1 -1
  75. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  76. package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
  77. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
  78. package/dist/src/PasswordField.d.ts +1 -1
  79. package/dist/src/SearchField.d.ts +1 -1
  80. package/dist/src/Select.d.ts +36 -0
  81. package/dist/src/Select.d.ts.map +1 -1
  82. package/dist/src/{labs/Switch.d.ts → Switch.d.ts} +3 -3
  83. package/dist/src/Switch.d.ts.map +1 -0
  84. package/dist/src/Tabs.d.ts +6 -8
  85. package/dist/src/Tabs.d.ts.map +1 -1
  86. package/dist/src/Tag.d.ts +7 -1
  87. package/dist/src/Tag.d.ts.map +1 -1
  88. package/dist/src/TextField.d.ts +17 -40
  89. package/dist/src/TextField.d.ts.map +1 -1
  90. package/dist/src/createShadowDomElements.d.ts.map +1 -1
  91. package/dist/src/i18n.d.ts +2 -2
  92. package/dist/src/i18n.d.ts.map +1 -1
  93. package/dist/src/index.d.ts +2 -1
  94. package/dist/src/index.d.ts.map +1 -1
  95. package/dist/src/labs/DataView/DataView.d.ts +1 -1
  96. package/dist/src/labs/DataView/DataView.d.ts.map +1 -1
  97. package/dist/src/labs/DataView/TableLayoutContent.d.ts +2 -1
  98. package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -1
  99. package/dist/src/labs/DataView/componentTypes.d.ts +10 -0
  100. package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -1
  101. package/dist/src/labs/DateField.d.ts +2 -2
  102. package/dist/src/labs/DateField.d.ts.map +1 -1
  103. package/dist/src/labs/DatePicker.d.ts +2 -2
  104. package/dist/src/labs/DatePicker.d.ts.map +1 -1
  105. package/dist/{test-selectors/odysseyTestSelectors.js → src/labs/SideNav/OktaLogo.d.ts} +3 -9
  106. package/dist/src/labs/SideNav/OktaLogo.d.ts.map +1 -0
  107. package/dist/src/labs/SideNav/SideNav.d.ts +2 -1
  108. package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -1
  109. package/dist/src/labs/SideNav/SideNavHeader.d.ts +1 -1
  110. package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -1
  111. package/dist/src/labs/SideNav/types.d.ts +28 -5
  112. package/dist/src/labs/SideNav/types.d.ts.map +1 -1
  113. package/dist/src/labs/TopNav.d.ts +1 -0
  114. package/dist/src/labs/TopNav.d.ts.map +1 -1
  115. package/dist/src/labs/index.d.ts +0 -2
  116. package/dist/src/labs/index.d.ts.map +1 -1
  117. package/dist/src/properties/ts/odyssey-react-mui.d.ts +2 -0
  118. package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  119. package/dist/src/test-selectors/getByQuerySelector.d.ts +148 -0
  120. package/dist/src/test-selectors/getByQuerySelector.d.ts.map +1 -0
  121. package/{src/test-selectors/odysseyTestSelectors.ts → dist/src/test-selectors/getComputedAccessibleErrorMessageText.d.ts} +3 -11
  122. package/dist/src/test-selectors/getComputedAccessibleErrorMessageText.d.ts.map +1 -0
  123. package/dist/src/test-selectors/{featureTestSelector.d.ts → getComputedAccessibleText.d.ts} +11 -19
  124. package/dist/src/test-selectors/getComputedAccessibleText.d.ts.map +1 -0
  125. package/dist/src/test-selectors/index.d.ts +2 -2
  126. package/dist/src/test-selectors/index.d.ts.map +1 -1
  127. package/dist/src/test-selectors/interpolateString.d.ts +15 -0
  128. package/dist/src/test-selectors/interpolateString.d.ts.map +1 -0
  129. package/dist/src/test-selectors/linkedHtmlSelectors.d.ts +24 -0
  130. package/dist/src/test-selectors/linkedHtmlSelectors.d.ts.map +1 -0
  131. package/dist/src/test-selectors/queryOdysseySelector.d.ts +5755 -0
  132. package/dist/src/test-selectors/queryOdysseySelector.d.ts.map +1 -0
  133. package/dist/src/test-selectors/querySelector.d.ts +59 -3613
  134. package/dist/src/test-selectors/querySelector.d.ts.map +1 -1
  135. package/dist/src/test-selectors/sanityChecks.d.ts +18 -0
  136. package/dist/src/test-selectors/sanityChecks.d.ts.map +1 -0
  137. package/dist/src/test-selectors/testSelector.d.ts +46 -0
  138. package/dist/src/test-selectors/testSelector.d.ts.map +1 -0
  139. package/dist/src/theme/components.d.ts.map +1 -1
  140. package/dist/test-selectors/getByQuerySelector.js +64 -0
  141. package/dist/test-selectors/getByQuerySelector.js.map +1 -0
  142. package/dist/test-selectors/getComputedAccessibleErrorMessageText.js +25 -0
  143. package/dist/test-selectors/getComputedAccessibleErrorMessageText.js.map +1 -0
  144. package/dist/test-selectors/getComputedAccessibleText.js +24 -0
  145. package/dist/test-selectors/getComputedAccessibleText.js.map +1 -0
  146. package/dist/test-selectors/index.js +2 -2
  147. package/dist/test-selectors/index.js.map +1 -1
  148. package/{src/test-selectors/featureTestSelector.ts → dist/test-selectors/interpolateString.js} +11 -27
  149. package/dist/test-selectors/interpolateString.js.map +1 -0
  150. package/dist/test-selectors/linkedHtmlSelectors.js +34 -0
  151. package/dist/test-selectors/linkedHtmlSelectors.js.map +1 -0
  152. package/dist/test-selectors/queryOdysseySelector.js +26 -0
  153. package/dist/test-selectors/queryOdysseySelector.js.map +1 -0
  154. package/dist/test-selectors/querySelector.js +82 -58
  155. package/dist/test-selectors/querySelector.js.map +1 -1
  156. package/dist/test-selectors/sanityChecks.js +33 -0
  157. package/dist/test-selectors/sanityChecks.js.map +1 -0
  158. package/dist/test-selectors/testSelector.js +2 -0
  159. package/dist/test-selectors/testSelector.js.map +1 -0
  160. package/dist/test-selectors/testSelectors.json +1 -1
  161. package/dist/theme/components.js +0 -1
  162. package/dist/theme/components.js.map +1 -1
  163. package/dist/tsconfig.production.tsbuildinfo +1 -1
  164. package/dist/tsconfig.tsbuildinfo +1 -1
  165. package/jest.setup.js +3 -0
  166. package/package.json +5 -4
  167. package/scripts/generateTestSelectorsJson.ts +1 -1
  168. package/src/@types/i18next.d.ts +1 -1
  169. package/src/Autocomplete.tsx +32 -0
  170. package/src/Callout.tsx +13 -25
  171. package/src/DataTable/useScrollIndication.tsx +9 -2
  172. package/src/{labs → FileUploader}/FileUploadPreview.tsx +3 -3
  173. package/src/{labs/FileUpload.tsx → FileUploader/FileUploader.tsx} +7 -6
  174. package/src/FileUploader/index.ts +13 -0
  175. package/src/OdysseyCacheProvider.test.tsx +1 -0
  176. package/src/OdysseyProvider.tsx +6 -1
  177. package/src/Radio.tsx +2 -2
  178. package/src/Select.tsx +38 -0
  179. package/src/{labs/Switch.tsx → Switch.tsx} +10 -10
  180. package/src/Tabs.tsx +8 -10
  181. package/src/Tag.tsx +134 -3
  182. package/src/TextField.tsx +18 -41
  183. package/src/Toast.tsx +1 -1
  184. package/src/createShadowDomElements.ts +3 -0
  185. package/src/i18n.ts +3 -3
  186. package/src/index.ts +6 -1
  187. package/src/labs/DataView/DataView.test.tsx +158 -0
  188. package/src/labs/DataView/DataView.tsx +98 -50
  189. package/src/labs/DataView/TableLayoutContent.tsx +28 -1
  190. package/src/labs/DataView/componentTypes.ts +13 -0
  191. package/src/labs/DateField.tsx +3 -0
  192. package/src/labs/DatePicker.tsx +12 -1
  193. package/src/labs/SideNav/OktaLogo.tsx +39 -0
  194. package/src/labs/SideNav/SideNav.tsx +187 -51
  195. package/src/labs/SideNav/SideNavHeader.tsx +30 -7
  196. package/src/labs/SideNav/types.ts +32 -5
  197. package/src/labs/TopNav.tsx +3 -1
  198. package/src/labs/index.ts +0 -3
  199. package/src/labs/useDateFieldsTranslations.ts +1 -1
  200. package/src/properties/odyssey-react-mui.properties +2 -1
  201. package/src/properties/ts/odyssey-react-mui.ts +1 -1
  202. package/src/test-selectors/getByQuerySelector.ts +176 -0
  203. package/src/test-selectors/getComputedAccessibleErrorMessageText.ts +52 -0
  204. package/src/test-selectors/getComputedAccessibleText.ts +36 -0
  205. package/src/test-selectors/index.ts +2 -2
  206. package/src/test-selectors/interpolateString.ts +41 -0
  207. package/src/test-selectors/linkedHtmlSelectors.ts +73 -0
  208. package/src/test-selectors/queryOdysseySelector.ts +36 -0
  209. package/src/test-selectors/querySelector.ts +221 -170
  210. package/src/test-selectors/sanityChecks.ts +53 -0
  211. package/src/test-selectors/testSelector.ts +143 -0
  212. package/src/theme/components.tsx +0 -2
  213. package/dist/labs/FileUpload.js.map +0 -1
  214. package/dist/labs/FileUploadIllustration.js.map +0 -1
  215. package/dist/labs/FileUploadPreview.js.map +0 -1
  216. package/dist/labs/Switch.js.map +0 -1
  217. package/dist/src/labs/FileUpload.d.ts.map +0 -1
  218. package/dist/src/labs/FileUploadIllustration.d.ts.map +0 -1
  219. package/dist/src/labs/FileUploadPreview.d.ts.map +0 -1
  220. package/dist/src/labs/Switch.d.ts.map +0 -1
  221. package/dist/src/test-selectors/featureTestSelector.d.ts.map +0 -1
  222. package/dist/src/test-selectors/odysseyTestSelectors.d.ts +0 -120
  223. package/dist/src/test-selectors/odysseyTestSelectors.d.ts.map +0 -1
  224. package/dist/test-selectors/featureTestSelector.js +0 -2
  225. package/dist/test-selectors/featureTestSelector.js.map +0 -1
  226. package/dist/test-selectors/odysseyTestSelectors.js.map +0 -1
  227. /package/dist/{labs → FileUploader}/FileUploadIllustration.js +0 -0
  228. /package/dist/{labs → FileUploader}/FileUploadPreview.js +0 -0
  229. /package/dist/src/{labs → FileUploader}/FileUploadIllustration.d.ts +0 -0
  230. /package/src/{labs → FileUploader}/FileUploadIllustration.tsx +0 -0
package/dist/TextField.js CHANGED
@@ -16,52 +16,29 @@ import { forwardRef, memo, useCallback, useImperativeHandle, useRef } from "reac
16
16
  import { Field } from "./Field.js";
17
17
  import { useInputValues, getControlState } from "./inputUtils.js";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
- export const TextFieldTestSelectors = {
20
- feature: {
21
- description: {
22
- selector: {
23
- method: "ByText",
24
- templateVariableNames: ["hint"],
25
- text: "${hint}"
26
- }
27
- },
28
- errorMessage: {
29
- selector: {
30
- method: "ByText",
31
- templateVariableNames: ["errorMessage"],
32
- text: "${errorMessage}"
33
- }
34
- },
35
- input: {
36
- selector: {
37
- method: "ByRole",
38
- options: {
39
- name: "${label}"
40
- },
41
- role: "textbox",
42
- templateVariableNames: ["label"]
43
- }
44
- },
45
- label: {
46
- selector: {
47
- method: "ByRole",
48
- options: {
49
- name: "${label}"
50
- },
51
- role: "LabelText",
52
- templateVariableNames: ["label"]
53
- }
54
- },
19
+ export const TextFieldTestSelector = {
20
+ accessibleText: {
21
+ errorMessage: "errorMessage",
22
+ hint: "description",
23
+ label: "label"
24
+ },
25
+ children: {
55
26
  link: {
56
- selector: {
27
+ elementSelector: {
57
28
  method: "ByRole",
58
29
  options: {
59
- name: "${label}"
30
+ label: "name"
60
31
  },
61
- templateVariableNames: ["label"],
62
32
  role: "link"
63
33
  }
64
34
  }
35
+ },
36
+ elementSelector: {
37
+ method: "ByRole",
38
+ options: {
39
+ label: "name"
40
+ },
41
+ role: "textbox"
65
42
  }
66
43
  };
67
44
  export const textFieldTypeValues = ["email", "number", "tel", "text", "url"];
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","Field","useInputValues","getControlState","jsx","_jsx","TextFieldTestSelectors","feature","description","selector","method","templateVariableNames","text","errorMessage","input","options","name","role","label","link","textFieldTypeValues","TextField","ariaDescribedBy","autoCompleteType","defaultValue","hasInitialFocus","endAdornment","errorMessageList","hint","HintLinkComponent","id","idOverride","inputRef","inputMode","isDisabled","isFullWidth","isMultiline","isOptional","isReadOnly","nameOverride","onBlur","onChange","onChangeProp","onFocus","placeholder","startAdornment","testId","translate","type","value","ref","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","localInputRef","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","autoComplete","autoFocus","_InputAdornment","position","children","inputProps","multiline","readOnly","required","fieldType","hasVisibleLabel","MemoizedTextField","displayName"],"sources":["../src/TextField.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 ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { InputAdornment, InputBase } from \"@mui/material\";\n\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport { Field } from \"./Field\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle, useInputValues, getControlState } from \"./inputUtils\";\nimport { type FeatureTestSelector } from \"./test-selectors\";\n\nexport const TextFieldTestSelectors = {\n feature: {\n description: {\n selector: {\n method: \"ByText\",\n templateVariableNames: [\"hint\"],\n text: \"${hint}\",\n },\n },\n errorMessage: {\n selector: {\n method: \"ByText\",\n templateVariableNames: [\"errorMessage\"],\n text: \"${errorMessage}\",\n },\n },\n input: {\n selector: {\n method: \"ByRole\",\n options: {\n name: \"${label}\",\n },\n role: \"textbox\",\n templateVariableNames: [\"label\"],\n },\n },\n label: {\n selector: {\n method: \"ByRole\",\n options: {\n name: \"${label}\",\n },\n role: \"LabelText\",\n templateVariableNames: [\"label\"],\n },\n },\n link: {\n selector: {\n method: \"ByRole\",\n options: {\n name: \"${label}\",\n },\n templateVariableNames: [\"label\"],\n role: \"link\",\n },\n },\n },\n} as const satisfies FeatureTestSelector;\n\nexport const textFieldTypeValues = [\n \"email\",\n \"number\",\n \"tel\",\n \"text\",\n \"url\",\n] as const;\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: string;\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The ref forwarded to the TextField\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Hints at the type of data that might be entered by the user while editing the element or its contents\n * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute\n */\n inputMode?: InputHTMLAttributes<HTMLInputElement>[\"inputMode\"];\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: string | ReactElement;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: (typeof textFieldTypeValues)[number];\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n} & FieldComponentProps &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n inputMode,\n isDisabled = false,\n isFullWidth = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n translate,\n type = \"text\",\n value: value,\n },\n ref,\n ) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n [],\n );\n\n const onChange = useCallback<\n NonNullable<ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <InputBase\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\" translate={translate}>\n {endAdornment}\n </InputAdornment>\n )\n }\n id={id}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n inputMode,\n }}\n inputRef={localInputRef}\n multiline={isMultiline}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\" translate={translate}>\n {startAdornment}\n </InputAdornment>\n )\n }\n type={type}\n translate={translate}\n />\n ),\n [\n autoCompleteType,\n inputValues,\n hasInitialFocus,\n endAdornment,\n inputMode,\n isMultiline,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n translate,\n type,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n },\n);\n\nconst MemoizedTextField = memo(TextField);\nMemoizedTextField.displayName = \"TextField\";\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAAC,SAONC,KAAK;AAAA,SAEQC,cAAc,EAAEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGrD,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,OAAO,EAAE;IACPC,WAAW,EAAE;MACXC,QAAQ,EAAE;QACRC,MAAM,EAAE,QAAQ;QAChBC,qBAAqB,EAAE,CAAC,MAAM,CAAC;QAC/BC,IAAI,EAAE;MACR;IACF,CAAC;IACDC,YAAY,EAAE;MACZJ,QAAQ,EAAE;QACRC,MAAM,EAAE,QAAQ;QAChBC,qBAAqB,EAAE,CAAC,cAAc,CAAC;QACvCC,IAAI,EAAE;MACR;IACF,CAAC;IACDE,KAAK,EAAE;MACLL,QAAQ,EAAE;QACRC,MAAM,EAAE,QAAQ;QAChBK,OAAO,EAAE;UACPC,IAAI,EAAE;QACR,CAAC;QACDC,IAAI,EAAE,SAAS;QACfN,qBAAqB,EAAE,CAAC,OAAO;MACjC;IACF,CAAC;IACDO,KAAK,EAAE;MACLT,QAAQ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,IAAA,CAAA6D,eAAA;MAAgBC,QAAQ,EAAC,OAAO;MAACpB,SAAS,EAAEA,SAAU;MAAAqB,QAAA,EACnDvB;IAAc,CACD,CAEnB;IACDG,IAAI,EAAEA,IAAK;IACXD,SAAS,EAAEA;EAAU,CACtB,CACF,EACD,CACExB,gBAAgB,EAChB+B,WAAW,EACX7B,eAAe,EACfC,YAAY,EACZO,SAAS,EACTG,WAAW,EACXG,YAAY,EACZC,MAAM,EACNC,QAAQ,EACRE,OAAO,EACPC,WAAW,EACXP,UAAU,EACVC,UAAU,EACVY,GAAG,EACHL,cAAc,EACdC,MAAM,EACNC,SAAS,EACTC,IAAI,CAER,CAAC;EAED,OACE3C,IAAA,CAACJ,KAAK;IACJqB,eAAe,EAAEA,eAAgB;IACjCT,YAAY,EAAEA,YAAa;IAC3Bc,gBAAgB,EAAEA,gBAAiB;IACnC8C,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACf9C,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfG,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvBnB,KAAK,EAAEA,KAAM;IACb0C,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMe,iBAAiB,GAAG9E,IAAI,CAACwB,SAAS,CAAC;AACzCsD,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAItD,SAAS"}
1
+ {"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","Field","useInputValues","getControlState","jsx","_jsx","TextFieldTestSelector","accessibleText","errorMessage","hint","label","children","link","elementSelector","method","options","role","textFieldTypeValues","TextField","ariaDescribedBy","autoCompleteType","defaultValue","hasInitialFocus","endAdornment","errorMessageList","HintLinkComponent","id","idOverride","inputRef","inputMode","isDisabled","isFullWidth","isMultiline","isOptional","isReadOnly","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","placeholder","startAdornment","testId","translate","type","value","ref","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","localInputRef","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","autoComplete","autoFocus","_InputAdornment","position","inputProps","multiline","readOnly","required","fieldType","hasVisibleLabel","MemoizedTextField","displayName"],"sources":["../src/TextField.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 ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { InputAdornment, InputBase } from \"@mui/material\";\n\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport { Field } from \"./Field\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle, useInputValues, getControlState } from \"./inputUtils\";\nimport { type TestSelector } from \"./test-selectors\";\n\nexport const TextFieldTestSelector = {\n accessibleText: {\n errorMessage: \"errorMessage\",\n hint: \"description\",\n label: \"label\",\n },\n children: {\n link: {\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"link\",\n },\n },\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"textbox\",\n },\n} as const satisfies TestSelector;\n\nexport const textFieldTypeValues = [\n \"email\",\n \"number\",\n \"tel\",\n \"text\",\n \"url\",\n] as const;\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: string;\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The ref forwarded to the TextField\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Hints at the type of data that might be entered by the user while editing the element or its contents\n * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute\n */\n inputMode?: InputHTMLAttributes<HTMLInputElement>[\"inputMode\"];\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: string | ReactElement;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: (typeof textFieldTypeValues)[number];\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n} & FieldComponentProps &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n inputMode,\n isDisabled = false,\n isFullWidth = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n translate,\n type = \"text\",\n value: value,\n },\n ref,\n ) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n [],\n );\n\n const onChange = useCallback<\n NonNullable<ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <InputBase\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\" translate={translate}>\n {endAdornment}\n </InputAdornment>\n )\n }\n id={id}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n inputMode,\n }}\n inputRef={localInputRef}\n multiline={isMultiline}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\" translate={translate}>\n {startAdornment}\n </InputAdornment>\n )\n }\n type={type}\n translate={translate}\n />\n ),\n [\n autoCompleteType,\n inputValues,\n hasInitialFocus,\n endAdornment,\n inputMode,\n isMultiline,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n translate,\n type,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n },\n);\n\nconst MemoizedTextField = memo(TextField);\nMemoizedTextField.displayName = \"TextField\";\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAAC,SAONC,KAAK;AAAA,SAEQC,cAAc,EAAEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGrD,OAAO,MAAMC,qBAAqB,GAAG;EACnCC,cAAc,EAAE;IACdC,YAAY,EAAE,cAAc;IAC5BC,IAAI,EAAE,aAAa;IACnBC,KAAK,EAAE;EACT,CAAC;EACDC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,eAAe,EAAE;QACfC,MAAM,EAAE,QAAQ;QAChBC,OAAO,EAAE;UACPL,KAAK,EAAE;QACT,CAAC;QACDM,IAAI,EAAE;MACR;IACF;EACF,CAAC;EACDH,eAAe,EAAE;IACfC,MAAM,EAAE,QAAQ;IAChBC,OAAO,EAAE;MACPL,KAAK,E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RE,OAAO,EACPC,WAAW,EACXR,UAAU,EACVC,UAAU,EACVa,GAAG,EACHL,cAAc,EACdC,MAAM,EACNC,SAAS,EACTC,IAAI,CAER,CAAC;EAED,OACExC,IAAA,CAACJ,KAAK;IACJkB,eAAe,EAAEA,eAAgB;IACjCX,YAAY,EAAEA,YAAa;IAC3BgB,gBAAgB,EAAEA,gBAAiB;IACnC6C,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACf7D,IAAI,EAAEA,IAAK;IACXgB,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfG,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvBvB,KAAK,EAAEA,KAAM;IACb+C,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMc,iBAAiB,GAAG1E,IAAI,CAACqB,SAAS,CAAC;AACzCqD,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIrD,SAAS"}
package/dist/Toast.js CHANGED
@@ -72,9 +72,9 @@ const Toast = ({
72
72
  variant: "toast",
73
73
  children: [_jsxs(_AlertTitle, {
74
74
  translate: translate,
75
- children: [_jsx(ScreenReaderText, {
75
+ children: [_jsxs(ScreenReaderText, {
76
76
  translate: translate,
77
- children: t(`severity.${severity}:`)
77
+ children: [t(`severity.${severity}`), ":"]
78
78
  }), text]
79
79
  }), linkUrl && _jsx(Link, {
80
80
  href: linkUrl,
package/dist/Toast.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","names":["useEffect","memo","useState","useCallback","useTranslation","Button","CloseIcon","Link","ScreenReaderText","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","toastRoleValues","toastSeverityValues","ClickAwayListenerProps","onClickAway","Toast","autoHideDuration","isDismissable","linkText","linkUrl","isVisible","isVisibleProp","onHide","onHideProp","role","severity","testId","text","translate","t","setIsVisible","children","_Snackbar","open","undefined","onClose","className","_Alert","action","ariaLabel","onClick","size","startIcon","variant","_AlertTitle","href","MemoizedToast","displayName"],"sources":["../src/Toast.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 { useEffect, memo, useState, useCallback } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Alert, AlertTitle, Snackbar } from \"@mui/material\";\n\nimport { Button } from \"./Button\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { CloseIcon } from \"./icons.generated\";\nimport { Link } from \"./Link\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\n\nexport const toastRoleValues = [\"status\", \"alert\"] as const;\nexport const toastSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type ToastProps = {\n /**\n * If set, this determines how long the Toast should appear before automatically disappearing in milliseconds.\n * It will only take effect if the Toast is not dismissible.\n * If left blank, it defaults to 6000.\n */\n autoHideDuration?: number;\n /**\n * If `true`, the Toast will include a close button.\n */\n isDismissable?: boolean;\n /**\n * If true, the Toast is visible\n */\n isVisible?: boolean;\n /**\n * If linkUrl is not undefined, this is the text of the link.\n * If left blank, it defaults to \"Learn more\".\n * Note that linkText does nothing if linkUrl is not defined\n */\n linkText?: string;\n /**\n * If defined, the Toast will include a link to the URL\n */\n linkUrl?: string;\n /**\n * An optional function to run when the Toast is closed.\n */\n onHide?: () => void;\n /**\n * Sets the ARIA role of the Toast\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof toastRoleValues)[number];\n /**\n * Determine the color and icon of the Toast\n */\n severity: (typeof toastSeverityValues)[number];\n /**\n * The text content of the Toast\n */\n text: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst ClickAwayListenerProps = { onClickAway: () => false };\n\nconst Toast = ({\n autoHideDuration = 6000,\n isDismissable,\n linkText,\n linkUrl,\n isVisible: isVisibleProp,\n onHide: onHideProp,\n role,\n severity,\n testId,\n text,\n translate,\n}: ToastProps) => {\n const { t } = useTranslation();\n const [isVisible, setIsVisible] = useState(isVisibleProp);\n\n useEffect(() => {\n setIsVisible(isVisibleProp);\n }, [isVisibleProp]);\n\n const onHide = useCallback(() => {\n setIsVisible(false);\n onHideProp?.();\n }, [onHideProp]);\n\n return (\n <>\n <Snackbar\n open={isVisible}\n autoHideDuration={\n isDismissable || autoHideDuration <= 0 ? undefined : autoHideDuration\n }\n onClose={onHide}\n className=\"Toast\"\n ClickAwayListenerProps={ClickAwayListenerProps}\n >\n <Alert\n action={\n isDismissable === true && (\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={onHide}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n )\n }\n data-se={testId}\n role={role}\n severity={severity}\n variant=\"toast\"\n >\n <AlertTitle translate={translate}>\n <ScreenReaderText translate={translate}>\n {t(`severity.${severity}:`)}\n </ScreenReaderText>\n {text}\n </AlertTitle>\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\" translate={translate}>\n {linkText}\n </Link>\n )}\n </Alert>\n </Snackbar>\n </>\n );\n};\n\nconst MemoizedToast = memo(Toast);\nMemoizedToast.displayName = \"Toast\";\n\nexport { MemoizedToast as Toast };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AAC9D,SAASC,cAAc,QAAQ,eAAe;AAAC,SAGtCC,MAAM;AAA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BAAsB,EAAEA,sBAAuB;MAAAkB,QAAA,EAE/CvB,KAAA,CAAA6B,MAAA;QACEC,MAAM,EACJrB,aAAa,KAAK,IAAI,IACpBX,IAAA,CAACL,MAAM;UACLsC,SAAS,EAAEV,CAAC,CAAC,YAAY,CAAE;UAC3BW,OAAO,EAAElB,MAAO;UAChBmB,IAAI,EAAC,OAAO;UACZC,SAAS,EAAEpC,IAAA,CAACJ,SAAS,IAAE,CAAE;UACzByC,OAAO,EAAC;QAAU,CACnB,CAEJ;QACD,WAASjB,MAAO;QAChBF,IAAI,EAAEA,IAAK;QACXC,QAAQ,EAAEA,QAAS;QACnBkB,OAAO,EAAC,OAAO;QAAAZ,QAAA,GAEfvB,KAAA,CAAAoC,WAAA;UAAYhB,SAAS,EAAEA,SAAU;UAAAG,QAAA,GAC/BzB,IAAA,CAACF,gBAAgB;YAACwB,SAAS,EAAEA,SAAU;YAAAG,QAAA,EACpCF,CAAC,CAAE,YAAWJ,QAAS,GAAE;UAAC,CACX,CAAC,EAClBE,IAAI;QAAA,CACK,CAAC,EACZR,OAAO,IACNb,IAAA,CAACH,IAAI;UAAC0C,IAAI,EAAE1B,OAAQ;UAACwB,OAAO,EAAC,YAAY;UAACf,SAAS,EAAEA,SAAU;UAAAG,QAAA,EAC5Db;QAAQ,CACL,CACP;MAAA,CACI;IAAC,CACA;EAAC,CACX,CAAC;AAEP,CAAC;AAED,MAAM4B,aAAa,GAAGjD,IAAI,CAACkB,KAAK,CAAC;AACjC+B,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAI/B,KAAK"}
1
+ {"version":3,"file":"Toast.js","names":["useEffect","memo","useState","useCallback","useTranslation","Button","CloseIcon","Link","ScreenReaderText","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","toastRoleValues","toastSeverityValues","ClickAwayListenerProps","onClickAway","Toast","autoHideDuration","isDismissable","linkText","linkUrl","isVisible","isVisibleProp","onHide","onHideProp","role","severity","testId","text","translate","t","setIsVisible","children","_Snackbar","open","undefined","onClose","className","_Alert","action","ariaLabel","onClick","size","startIcon","variant","_AlertTitle","href","MemoizedToast","displayName"],"sources":["../src/Toast.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 { useEffect, memo, useState, useCallback } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Alert, AlertTitle, Snackbar } from \"@mui/material\";\n\nimport { Button } from \"./Button\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { CloseIcon } from \"./icons.generated\";\nimport { Link } from \"./Link\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\n\nexport const toastRoleValues = [\"status\", \"alert\"] as const;\nexport const toastSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type ToastProps = {\n /**\n * If set, this determines how long the Toast should appear before automatically disappearing in milliseconds.\n * It will only take effect if the Toast is not dismissible.\n * If left blank, it defaults to 6000.\n */\n autoHideDuration?: number;\n /**\n * If `true`, the Toast will include a close button.\n */\n isDismissable?: boolean;\n /**\n * If true, the Toast is visible\n */\n isVisible?: boolean;\n /**\n * If linkUrl is not undefined, this is the text of the link.\n * If left blank, it defaults to \"Learn more\".\n * Note that linkText does nothing if linkUrl is not defined\n */\n linkText?: string;\n /**\n * If defined, the Toast will include a link to the URL\n */\n linkUrl?: string;\n /**\n * An optional function to run when the Toast is closed.\n */\n onHide?: () => void;\n /**\n * Sets the ARIA role of the Toast\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof toastRoleValues)[number];\n /**\n * Determine the color and icon of the Toast\n */\n severity: (typeof toastSeverityValues)[number];\n /**\n * The text content of the Toast\n */\n text: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst ClickAwayListenerProps = { onClickAway: () => false };\n\nconst Toast = ({\n autoHideDuration = 6000,\n isDismissable,\n linkText,\n linkUrl,\n isVisible: isVisibleProp,\n onHide: onHideProp,\n role,\n severity,\n testId,\n text,\n translate,\n}: ToastProps) => {\n const { t } = useTranslation();\n const [isVisible, setIsVisible] = useState(isVisibleProp);\n\n useEffect(() => {\n setIsVisible(isVisibleProp);\n }, [isVisibleProp]);\n\n const onHide = useCallback(() => {\n setIsVisible(false);\n onHideProp?.();\n }, [onHideProp]);\n\n return (\n <>\n <Snackbar\n open={isVisible}\n autoHideDuration={\n isDismissable || autoHideDuration <= 0 ? undefined : autoHideDuration\n }\n onClose={onHide}\n className=\"Toast\"\n ClickAwayListenerProps={ClickAwayListenerProps}\n >\n <Alert\n action={\n isDismissable === true && (\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={onHide}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n )\n }\n data-se={testId}\n role={role}\n severity={severity}\n variant=\"toast\"\n >\n <AlertTitle translate={translate}>\n <ScreenReaderText translate={translate}>\n {t(`severity.${severity}`)}:\n </ScreenReaderText>\n {text}\n </AlertTitle>\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\" translate={translate}>\n {linkText}\n </Link>\n )}\n </Alert>\n </Snackbar>\n </>\n );\n};\n\nconst MemoizedToast = memo(Toast);\nMemoizedToast.displayName = \"Toast\";\n\nexport { MemoizedToast as Toast };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AAC9D,SAASC,cAAc,QAAQ,eAAe;AAAC,SAGtCC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;MACjBvB,sBAAsB,EAAEA,sBAAuB;MAAAkB,QAAA,EAE/CvB,KAAA,CAAA6B,MAAA;QACEC,MAAM,EACJrB,aAAa,KAAK,IAAI,IACpBX,IAAA,CAACL,MAAM;UACLsC,SAAS,EAAEV,CAAC,CAAC,YAAY,CAAE;UAC3BW,OAAO,EAAElB,MAAO;UAChBmB,IAAI,EAAC,OAAO;UACZC,SAAS,EAAEpC,IAAA,CAACJ,SAAS,IAAE,CAAE;UACzByC,OAAO,EAAC;QAAU,CACnB,CAEJ;QACD,WAASjB,MAAO;QAChBF,IAAI,EAAEA,IAAK;QACXC,QAAQ,EAAEA,QAAS;QACnBkB,OAAO,EAAC,OAAO;QAAAZ,QAAA,GAEfvB,KAAA,CAAAoC,WAAA;UAAYhB,SAAS,EAAEA,SAAU;UAAAG,QAAA,GAC/BvB,KAAA,CAACJ,gBAAgB;YAACwB,SAAS,EAAEA,SAAU;YAAAG,QAAA,GACpCF,CAAC,CAAE,YAAWJ,QAAS,EAAC,CAAC,EAAC,GAC7B;UAAA,CAAkB,CAAC,EAClBE,IAAI;QAAA,CACK,CAAC,EACZR,OAAO,IACNb,IAAA,CAACH,IAAI;UAAC0C,IAAI,EAAE1B,OAAQ;UAACwB,OAAO,EAAC,YAAY;UAACf,SAAS,EAAEA,SAAU;UAAAG,QAAA,EAC5Db;QAAQ,CACL,CACP;MAAA,CACI;IAAC,CACA;EAAC,CACX,CAAC;AAEP,CAAC;AAED,MAAM4B,aAAa,GAAGjD,IAAI,CAACkB,KAAK,CAAC;AACjC+B,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAI/B,KAAK"}
@@ -19,6 +19,7 @@ export const createShadowDomElements = containerElement => {
19
19
  emotionRootElement.setAttribute("nonce", window.cspNonce);
20
20
  const shadowRootElement = document.createElement("div");
21
21
  shadowRootElement.setAttribute("id", "shadow-root");
22
+ shadowRootElement.style.setProperty("height", "inherit");
22
23
  shadowRoot.appendChild(emotionRootElement);
23
24
  shadowRoot.appendChild(shadowRootElement);
24
25
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"createShadowDomElements.js","names":["createShadowDomElements","containerElement","shadowRoot","attachShadow","mode","emotionRootElement","document","createElement","setAttribute","window","cspNonce","shadowRootElement","appendChild","createShadowRootElement"],"sources":["../src/createShadowDomElements.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-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 const createShadowDomElements = (containerElement: HTMLElement) => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // Container for Emotion `<style>` elements.\n const emotionRootElement = document.createElement(\"div\");\n emotionRootElement.setAttribute(\"id\", \"style-root\");\n emotionRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n // React app root component.\n const shadowRootElement = document.createElement(\"div\");\n shadowRootElement.setAttribute(\"id\", \"shadow-root\");\n\n shadowRoot.appendChild(emotionRootElement);\n shadowRoot.appendChild(shadowRootElement);\n\n return { emotionRootElement, shadowRootElement };\n};\n\n/** @deprecated Use `createShadowDomElements` instead. */\nexport const createShadowRootElement = (\n containerElement: HTMLElement,\n): [HTMLStyleElement, HTMLDivElement] => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // the element that styles will be cached into\n const emotionRootElement = document.createElement(\"style\");\n emotionRootElement.setAttribute(\"id\", \"style-root\");\n emotionRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n // the element that emotion renders html into\n const shadowRootElement = document.createElement(\"div\");\n shadowRootElement.setAttribute(\"id\", \"shadow-root\");\n\n shadowRoot.appendChild(emotionRootEl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CAACP,kBAAkB,CAAC;EAC1CH,UAAU,CAACU,WAAW,CAACD,iBAAiB,CAAC;EAEzC,OAAO,CAACN,kBAAkB,EAAEM,iBAAiB,CAAC;AAChD,CAAC"}
1
+ {"version":3,"file":"createShadowDomElements.js","names":["createShadowDomElements","containerElement","shadowRoot","attachShadow","mode","emotionRootElement","document","createElement","setAttribute","window","cspNonce","shadowRootElement","style","setProperty","appendChild","createShadowRootElement"],"sources":["../src/createShadowDomElements.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-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 const createShadowDomElements = (containerElement: HTMLElement) => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // Container for Emotion `<style>` elements.\n const emotionRootElement = document.createElement(\"div\");\n emotionRootElement.setAttribute(\"id\", \"style-root\");\n emotionRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n // React app root component.\n const shadowRootElement = document.createElement(\"div\");\n shadowRootElement.setAttribute(\"id\", \"shadow-root\");\n // This div could cause issues with layout of children.\n // For flexibility, make it inherit its parent's height\n shadowRootElement.style.setProperty(\"height\", \"inherit\");\n\n shadowRoot.appendChild(emotionRootElement);\n shadowRoot.appendChild(shadowRootElement);\n\n return { emotionRootElement, shadowRootElement };\n};\n\n/** @deprecated Use `createShadowDomElements` instead. */\nexport const createShadowRootElement = (\n containerElement: HTMLElement,\n): [HTMLStyleElement, HTMLDivElement] => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // the element that styles will be cached into\n const emotionRootElement = document.createElement(\"style\");\n emotionRootElement.setAttribute(\"id\", \"style-root\");\n emotionRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n // the element that emotion renders html into\n const shadowRootElement = document.createElement(\"div\");\n shadowRootElement.setAttribute(\"id\", \"shadow-root\");\n\n shadowRoot.appendChild(emotionRootElement);\n shadowRoot.appendChild(shadowRootElement);\n\n return [emotionRootElement, shadowRootElement];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,uBAAuB,GAAIC,gBAA6B,IAAK;EACxE,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAMC,kBAAkB,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACxDF,kBAAkB,CAACG,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EACnDH,kBAAkB,CAACG,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAGzD,MAAMC,iBAAiB,GAAGL,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACvDI,iBAAiB,CAACH,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;EAGnDG,iBAAiB,CAACC,KAAK,CAACC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC;EAExDX,UAAU,CAACY,WAAW,CAACT,kBAAkB,CAAC;EAC1CH,UAAU,CAACY,WAAW,CAACH,iBAAiB,CAAC;EAEzC,OAAO;IAAEN,kBAAkB;IAAEM;EAAkB,CAAC;AAClD,CAAC;AAGD,OAAO,MAAMI,uBAAuB,GAClCd,gBAA6B,IACU;EACvC,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAMC,kBAAkB,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EAC1DF,kBAAkB,CAACG,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EACnDH,kBAAkB,CAACG,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAGzD,MAAMC,iBAAiB,GAAGL,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACvDI,iBAAiB,CAACH,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;EAEnDN,UAAU,CAACY,WAAW,CAACT,kBAAkB,CAAC;EAC1CH,UAAU,CAACY,WAAW,CAACH,iBAAiB,CAAC;EAEzC,OAAO,CAACN,kBAAkB,EAAEM,iBAAiB,CAAC;AAChD,CAAC"}
package/dist/i18n.js CHANGED
@@ -42,7 +42,7 @@ import { translation as vi } from "./properties/ts/odyssey-react-mui_vi.js";
42
42
  import { translation as zhCN } from "./properties/ts/odyssey-react-mui_zh_CN.js";
43
43
  import { translation as znTW } from "./properties/ts/odyssey-react-mui_zh_TW.js";
44
44
  export const defaultLNG = "en";
45
- export const defaultNS = "translations";
45
+ export const defaultNS = "odyssey";
46
46
  export const resources = {
47
47
  cs,
48
48
  da,
package/dist/i18n.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","names":["i18n","initReactI18next","translation","cs","da","de","el","en","es","fi","fr","hu","id","it","ja","ko","ms","nb","nlNL","okPL","okSK","pl","ptBR","ro","ru","sv","th","tr","uk","vi","zhCN","znTW","defaultLNG","defaultNS","resources","nl_NL","ok_PL","ok_SK","pt_BR","zh_CN","zh_TW","use","init","ns","fallbackLng","load","keySeparator","interpolation","escapeValue","skipOnVariables","react","useSuspense","bindI18nStore","Object","entries","forEach","locale","property","addResourceBundle","odysseyTranslate","t","bind"],"sources":["../src/i18n.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-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 i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\n\nimport { translation as cs } from \"./properties/ts/odyssey-react-mui_cs\";\nimport { translation as da } from \"./properties/ts/odyssey-react-mui_da\";\nimport { translation as de } from \"./properties/ts/odyssey-react-mui_de\";\nimport { translation as el } from \"./properties/ts/odyssey-react-mui_el\";\nimport { translation as en } from \"./properties/ts/odyssey-react-mui\";\nimport { translation as es } from \"./properties/ts/odyssey-react-mui_es\";\nimport { translation as fi } from \"./properties/ts/odyssey-react-mui_fi\";\nimport { translation as fr } from \"./properties/ts/odyssey-react-mui_fr\";\nimport { translation as hu } from \"./properties/ts/odyssey-react-mui_hu\";\nimport { translation as id } from \"./properties/ts/odyssey-react-mui_id\";\nimport { translation as it } from \"./properties/ts/odyssey-react-mui_it\";\nimport { translation as ja } from \"./properties/ts/odyssey-react-mui_ja\";\nimport { translation as ko } from \"./properties/ts/odyssey-react-mui_ko\";\nimport { translation as ms } from \"./properties/ts/odyssey-react-mui_ms\";\nimport { translation as nb } from \"./properties/ts/odyssey-react-mui_nb\";\nimport { translation as nlNL } from \"./properties/ts/odyssey-react-mui_nl_NL\";\nimport { translation as okPL } from \"./properties/ts/odyssey-react-mui_ok_PL\";\nimport { translation as okSK } from \"./properties/ts/odyssey-react-mui_ok_SK\";\nimport { translation as pl } from \"./properties/ts/odyssey-react-mui_pl\";\nimport { translation as ptBR } from \"./properties/ts/odyssey-react-mui_pt_BR\";\nimport { translation as ro } from \"./properties/ts/odyssey-react-mui_ro\";\nimport { translation as ru } from \"./properties/ts/odyssey-react-mui_ru\";\nimport { translation as sv } from \"./properties/ts/odyssey-react-mui_sv\";\nimport { translation as th } from \"./properties/ts/odyssey-react-mui_th\";\nimport { translation as tr } from \"./properties/ts/odyssey-react-mui_tr\";\nimport { translation as uk } from \"./properties/ts/odyssey-react-mui_uk\";\nimport { translation as vi } from \"./properties/ts/odyssey-react-mui_vi\";\nimport { translation as zhCN } from \"./properties/ts/odyssey-react-mui_zh_CN\";\nimport { translation as znTW } from \"./properties/ts/odyssey-react-mui_zh_TW\";\n\nexport const defaultLNG = \"en\";\nexport const defaultNS = \"translations\";\n\n// Note: This is type \"string\" to allow translation overrides from other languages\nexport type I18nResources = Record<string, Partial<typeof en>>;\nexport const resources: I18nResources = {\n cs,\n da,\n de,\n el,\n en,\n es,\n fi,\n fr,\n hu,\n id,\n it,\n ja,\n ko,\n ms,\n nb,\n nl_NL: nlNL,\n ok_PL: okPL,\n ok_SK: okSK,\n pl,\n pt_BR: ptBR,\n ro,\n ru,\n sv,\n th,\n tr,\n uk,\n vi,\n zh_CN: zhCN,\n zh_TW: znTW,\n};\n\ni18n.use(initReactI18next).init({\n defaultNS,\n ns: [defaultNS],\n fallbackLng: defaultLNG,\n load: \"currentOnly\",\n keySeparator: false,\n interpolation: {\n escapeValue: false, // react already safe from xss\n skipOnVariables: false, // to handle translations that use nesting\n },\n react: {\n useSuspense: false,\n bindI18nStore: \"added\",\n },\n});\n\nObject.entries(resources).forEach(([locale, property]) => {\n i18n.addResourceBundle(locale, defaultNS, property);\n});\n\nexport const odysseyTranslate = i18n.t.bind(i18n);\nexport { i18n };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,SAAS;AAC1B,SAASC,gBAAgB,QAAQ,eAAe;AAAC,SAExCC,WAAW,IAAIC,EAAE;AAAA,SACjBD,WAAW,IAAIE,EAAE;AAAA,SACjBF,WAAW,IAAIG,EAAE;AAAA,SACjBH,WAAW,IAAII,EAAE;AAAA,SACjBJ,WAAW,IAAIK,EAAE;AAAA,SACjBL,WAAW,IAAIM,EAAE;AAAA,SACjBN,WAAW,IAAIO,EAAE;AAAA,SACjBP,WAAW,IAAIQ,EAAE;AAAA,SACjBR,WAAW,IA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AET;AACT,CAAC;AAED/B,IAAI,CAACyC,GAAG,CAACxC,gBAAgB,CAAC,CAACyC,IAAI,CAAC;EAC9BT,SAAS;EACTU,EAAE,EAAE,CAACV,SAAS,CAAC;EACfW,WAAW,EAAEZ,UAAU;EACvBa,IAAI,EAAE,aAAa;EACnBC,YAAY,EAAE,KAAK;EACnBC,aAAa,EAAE;IACbC,WAAW,EAAE,KAAK;IAClBC,eAAe,EAAE;EACnB,CAAC;EACDC,KAAK,EAAE;IACLC,WAAW,EAAE,KAAK;IAClBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAEFC,MAAM,CAACC,OAAO,CAACpB,SAAS,CAAC,CAACqB,OAAO,CAAC,CAAC,CAACC,MAAM,EAAEC,QAAQ,CAAC,KAAK;EACxDzD,IAAI,CAAC0D,iBAAiB,CAACF,MAAM,EAAEvB,SAAS,EAAEwB,QAAQ,CAAC;AACrD,CAAC,CAAC;AAEF,OAAO,MAAME,gBAAgB,GAAG3D,IAAI,CAAC4D,CAAC,CAACC,IAAI,CAAC7D,IAAI,CAAC;AACjD,SAASA,IAAI"}
1
+ {"version":3,"file":"i18n.js","names":["i18n","initReactI18next","translation","cs","da","de","el","en","es","fi","fr","hu","id","it","ja","ko","ms","nb","nlNL","okPL","okSK","pl","ptBR","ro","ru","sv","th","tr","uk","vi","zhCN","znTW","defaultLNG","defaultNS","resources","nl_NL","ok_PL","ok_SK","pt_BR","zh_CN","zh_TW","use","init","ns","fallbackLng","load","keySeparator","interpolation","escapeValue","skipOnVariables","react","useSuspense","bindI18nStore","Object","entries","forEach","locale","property","addResourceBundle","odysseyTranslate","t","bind"],"sources":["../src/i18n.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-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 i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\n\nimport { translation as cs } from \"./properties/ts/odyssey-react-mui_cs\";\nimport { translation as da } from \"./properties/ts/odyssey-react-mui_da\";\nimport { translation as de } from \"./properties/ts/odyssey-react-mui_de\";\nimport { translation as el } from \"./properties/ts/odyssey-react-mui_el\";\nimport { translation as en } from \"./properties/ts/odyssey-react-mui\";\nimport { translation as es } from \"./properties/ts/odyssey-react-mui_es\";\nimport { translation as fi } from \"./properties/ts/odyssey-react-mui_fi\";\nimport { translation as fr } from \"./properties/ts/odyssey-react-mui_fr\";\nimport { translation as hu } from \"./properties/ts/odyssey-react-mui_hu\";\nimport { translation as id } from \"./properties/ts/odyssey-react-mui_id\";\nimport { translation as it } from \"./properties/ts/odyssey-react-mui_it\";\nimport { translation as ja } from \"./properties/ts/odyssey-react-mui_ja\";\nimport { translation as ko } from \"./properties/ts/odyssey-react-mui_ko\";\nimport { translation as ms } from \"./properties/ts/odyssey-react-mui_ms\";\nimport { translation as nb } from \"./properties/ts/odyssey-react-mui_nb\";\nimport { translation as nlNL } from \"./properties/ts/odyssey-react-mui_nl_NL\";\nimport { translation as okPL } from \"./properties/ts/odyssey-react-mui_ok_PL\";\nimport { translation as okSK } from \"./properties/ts/odyssey-react-mui_ok_SK\";\nimport { translation as pl } from \"./properties/ts/odyssey-react-mui_pl\";\nimport { translation as ptBR } from \"./properties/ts/odyssey-react-mui_pt_BR\";\nimport { translation as ro } from \"./properties/ts/odyssey-react-mui_ro\";\nimport { translation as ru } from \"./properties/ts/odyssey-react-mui_ru\";\nimport { translation as sv } from \"./properties/ts/odyssey-react-mui_sv\";\nimport { translation as th } from \"./properties/ts/odyssey-react-mui_th\";\nimport { translation as tr } from \"./properties/ts/odyssey-react-mui_tr\";\nimport { translation as uk } from \"./properties/ts/odyssey-react-mui_uk\";\nimport { translation as vi } from \"./properties/ts/odyssey-react-mui_vi\";\nimport { translation as zhCN } from \"./properties/ts/odyssey-react-mui_zh_CN\";\nimport { translation as znTW } from \"./properties/ts/odyssey-react-mui_zh_TW\";\n\nexport const defaultLNG = \"en\";\nexport const defaultNS = \"odyssey\";\n\n// Note: This is type \"string\" to allow translation overrides from other languages\nexport type I18nResources = Record<string, Partial<typeof en>>;\nexport const resources: I18nResources = {\n cs,\n da,\n de,\n el,\n en,\n es,\n fi,\n fr,\n hu,\n id,\n it,\n ja,\n ko,\n ms,\n nb,\n nl_NL: nlNL,\n ok_PL: okPL,\n ok_SK: okSK,\n pl,\n pt_BR: ptBR,\n ro,\n ru,\n sv,\n th,\n tr,\n uk,\n vi,\n zh_CN: zhCN,\n zh_TW: znTW,\n} as const;\n\ni18n.use(initReactI18next).init({\n defaultNS,\n ns: [defaultNS],\n fallbackLng: defaultLNG,\n load: \"currentOnly\",\n keySeparator: false,\n interpolation: {\n escapeValue: false, // react already safe from xss\n skipOnVariables: false, // to handle translations that use nesting\n },\n react: {\n useSuspense: false,\n bindI18nStore: \"added\",\n },\n} as const);\n\nObject.entries(resources).forEach(([locale, property]) => {\n i18n.addResourceBundle(locale, defaultNS, property);\n});\n\nexport const odysseyTranslate = i18n.t.bind(i18n);\nexport { i18n };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,SAAS;AAC1B,SAASC,gBAAgB,QAAQ,eAAe;AAAC,SAExCC,WAAW,IAAIC,EAAE;AAAA,SACjBD,WAAW,IAAIE,EAAE;AAAA,SACjBF,WAAW,IAAIG,EAAE;AAAA,SACjBH,WAAW,IAAII,EAAE;AAAA,SACjBJ,WAAW,IAAIK,EAAE;AAAA,SACjBL,WAAW,IAAIM,EAAE;AAAA,SACjBN,WAAW,IAAIO,EAAE;AAAA,SACjBP,WAAW,IAAIQ,EAAE;AAAA,SACjB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U,KAAK,EAAET;AACT,CAAU;AAEV/B,IAAI,CAACyC,GAAG,CAACxC,gBAAgB,CAAC,CAACyC,IAAI,CAAC;EAC9BT,SAAS;EACTU,EAAE,EAAE,CAACV,SAAS,CAAC;EACfW,WAAW,EAAEZ,UAAU;EACvBa,IAAI,EAAE,aAAa;EACnBC,YAAY,EAAE,KAAK;EACnBC,aAAa,EAAE;IACbC,WAAW,EAAE,KAAK;IAClBC,eAAe,EAAE;EACnB,CAAC;EACDC,KAAK,EAAE;IACLC,WAAW,EAAE,KAAK;IAClBC,aAAa,EAAE;EACjB;AACF,CAAU,CAAC;AAEXC,MAAM,CAACC,OAAO,CAACpB,SAAS,CAAC,CAACqB,OAAO,CAAC,CAAC,CAACC,MAAM,EAAEC,QAAQ,CAAC,KAAK;EACxDzD,IAAI,CAAC0D,iBAAiB,CAACF,MAAM,EAAEvB,SAAS,EAAEwB,QAAQ,CAAC;AACrD,CAAC,CAAC;AAEF,OAAO,MAAME,gBAAgB,GAAG3D,IAAI,CAAC4D,CAAC,CAACC,IAAI,CAAC7D,IAAI,CAAC;AACjD,SAASA,IAAI"}
package/dist/index.js CHANGED
@@ -35,6 +35,7 @@ export * from "./Drawer.js";
35
35
  export * from "./EmptyState.js";
36
36
  export * from "./Fieldset.js";
37
37
  export * from "./FieldComponentProps.js";
38
+ export { FileUploader, fileUploadTypes, fileUploadVariants } from "./FileUploader/index.js";
38
39
  export * from "./Form.js";
39
40
  export * from "./HintLink.js";
40
41
  export * from "./IconWithTooltip.js";
@@ -62,7 +63,7 @@ export * from "./TextField.js";
62
63
  export * from "./theme/index.js";
63
64
  export * from "./Toast.js";
64
65
  export * from "./ToastStack.js";
65
- export * from "./labs/Switch.js";
66
+ export * from "./Switch.js";
66
67
  export * from "./Tooltip.js";
67
68
  export * from "./Typography.js";
68
69
  export * from "./useUniqueId.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["deepmerge","visuallyHidden","createTheme","DialogContentText","Divider","InputAdornment","InputBase","ListItemIcon","ListItemText","ListSubheader","MenuList","Paper","ScopedCssBaseline","ThemeProvider","odysseyTranslate","useOdysseyDesignTokens","badgeContentMaxValues"],"sources":["../src/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 { deepmerge, visuallyHidden } from \"@mui/utils\";\n\nexport {\n createTheme,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n DialogContentText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Divider,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputAdornment,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputBase,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemIcon,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListSubheader,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n MenuList,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Paper,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ScopedCssBaseline,\n ThemeProvider,\n} from \"@mui/material\";\n\nexport type {\n CssBaselineProps,\n DialogContentTextProps,\n DividerProps,\n InputAdornmentProps,\n InputBaseProps,\n ListItemIconProps,\n ListItemTextProps,\n ListSubheaderProps,\n MenuListProps,\n PaperProps,\n ScopedCssBaselineProps,\n ThemeOptions,\n} from \"@mui/material\";\n\nexport { odysseyTranslate } from \"./i18n\";\nexport type { FocusHandle } from \"./inputUtils\";\nexport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\n\nexport * from \"./Accordion\";\nexport * from \"./Autocomplete\";\nexport { badgeContentMaxValues } from \"./Badge\";\nexport * from \"./Banner\";\nexport * from \"./Box\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./Button\";\nexport * from \"./Card\";\nexport * from \"./Callout\";\nexport * from \"./Checkbox\";\nexport * from \"./CheckboxGroup\";\nexport * from \"./CircularProgress\";\nexport * from \"./CssBaseline\";\nexport * from \"./createShadowDomElements\";\nexport * from \"./createUniqueId\";\nexport * from \"./DataTable\";\nexport * from \"./Dialog\";\nexport * from \"./Drawer\";\nexport * from \"./EmptyState\";\nexport * from \"./Fieldset\";\nexport * from \"./FieldComponentProps\";\nexport * from \"./Form\";\nexport * from \"./HintLink\";\nexport * from \"./IconWithTooltip\";\nexport * from \"./Link\";\nexport * from \"./MenuButton\";\nexport * from \"./MenuItem\";\nexport * from \"./NativeSelect\";\nexport * from \"./NullElement\";\nexport * from \"./OdysseyCacheProvider\";\nexport * from \"./OdysseyProvider\";\nexport * from \"./OdysseyThemeProvider\";\nexport * from \"./OdysseyTranslationProvider\";\nexport * from \"./PasswordField\";\nexport * from \"./Radio\";\nexport * from \"./RadioGroup\";\nexport * from \"./ScreenReaderText\";\nexport * from \"./SearchField\";\nexport * from \"./Select\";\nexport * from \"./Status\";\nexport * from \"./Surface\";\nexport * from \"./Tabs\";\nexport * from \"./Tag\";\nexport * from \"./TagList\";\nexport * from \"./TextField\";\nexport * from \"./theme\";\nexport * from \"./Toast\";\nexport * from \"./ToastStack\";\nexport * from \"./labs/Switch\";\nexport * from \"./Tooltip\";\nexport * from \"./Typography\";\nexport * from \"./useUniqueId\";\nexport * from \"./Pagination\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,cAAc,QAAQ,YAAY;AAEtD,SACEC,WAAW,EAEXC,iBAAiB,EAEjBC,OAAO,EAEPC,cAAc,EAEdC,SAAS,EAETC,YAAY,EAEZC,YAAY,EAEZC,aAAa,EAEbC,QAAQ,EAERC,KAAK,EAELC,iBAAiB,EACjBC,aAAa,QACR,eAAe;AAAC,SAiBdC,gBAAgB;AAAA,SAEhBC,sBAAsB;AAAA;AAAA;AAAA,SAItBC,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["deepmerge","visuallyHidden","createTheme","DialogContentText","Divider","InputAdornment","InputBase","ListItemIcon","ListItemText","ListSubheader","MenuList","Paper","ScopedCssBaseline","ThemeProvider","odysseyTranslate","useOdysseyDesignTokens","badgeContentMaxValues","FileUploader","fileUploadTypes","fileUploadVariants"],"sources":["../src/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 { deepmerge, visuallyHidden } from \"@mui/utils\";\n\nexport {\n createTheme,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n DialogContentText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Divider,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputAdornment,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputBase,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemIcon,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListSubheader,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n MenuList,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Paper,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ScopedCssBaseline,\n ThemeProvider,\n} from \"@mui/material\";\n\nexport type {\n CssBaselineProps,\n DialogContentTextProps,\n DividerProps,\n InputAdornmentProps,\n InputBaseProps,\n ListItemIconProps,\n ListItemTextProps,\n ListSubheaderProps,\n MenuListProps,\n PaperProps,\n ScopedCssBaselineProps,\n ThemeOptions,\n} from \"@mui/material\";\n\nexport { odysseyTranslate } from \"./i18n\";\nexport type { FocusHandle } from \"./inputUtils\";\nexport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\n\nexport * from \"./Accordion\";\nexport * from \"./Autocomplete\";\nexport { badgeContentMaxValues } from \"./Badge\";\nexport * from \"./Banner\";\nexport * from \"./Box\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./Button\";\nexport * from \"./Card\";\nexport * from \"./Callout\";\nexport * from \"./Checkbox\";\nexport * from \"./CheckboxGroup\";\nexport * from \"./CircularProgress\";\nexport * from \"./CssBaseline\";\nexport * from \"./createShadowDomElements\";\nexport * from \"./createUniqueId\";\nexport * from \"./DataTable\";\nexport * from \"./Dialog\";\nexport * from \"./Drawer\";\nexport * from \"./EmptyState\";\nexport * from \"./Fieldset\";\nexport * from \"./FieldComponentProps\";\nexport {\n FileUploader,\n fileUploadTypes,\n fileUploadVariants,\n} from \"./FileUploader\";\nexport * from \"./Form\";\nexport * from \"./HintLink\";\nexport * from \"./IconWithTooltip\";\nexport * from \"./Link\";\nexport * from \"./MenuButton\";\nexport * from \"./MenuItem\";\nexport * from \"./NativeSelect\";\nexport * from \"./NullElement\";\nexport * from \"./OdysseyCacheProvider\";\nexport * from \"./OdysseyProvider\";\nexport * from \"./OdysseyThemeProvider\";\nexport * from \"./OdysseyTranslationProvider\";\nexport * from \"./PasswordField\";\nexport * from \"./Radio\";\nexport * from \"./RadioGroup\";\nexport * from \"./ScreenReaderText\";\nexport * from \"./SearchField\";\nexport * from \"./Select\";\nexport * from \"./Status\";\nexport * from \"./Surface\";\nexport * from \"./Tabs\";\nexport * from \"./Tag\";\nexport * from \"./TagList\";\nexport * from \"./TextField\";\nexport * from \"./theme\";\nexport * from \"./Toast\";\nexport * from \"./ToastStack\";\nexport * from \"./Switch\";\nexport * from \"./Tooltip\";\nexport * from \"./Typography\";\nexport * from \"./useUniqueId\";\nexport * from \"./Pagination\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,cAAc,QAAQ,YAAY;AAEtD,SACEC,WAAW,EAEXC,iBAAiB,EAEjBC,OAAO,EAEPC,cAAc,EAEdC,SAAS,EAETC,YAAY,EAEZC,YAAY,EAEZC,aAAa,EAEbC,QAAQ,EAERC,KAAK,EAELC,iBAAiB,EACjBC,aAAa,QACR,eAAe;AAAC,SAiBdC,gBAAgB;AAAA,SAEhBC,sBAAsB;AAAA;AAAA;AAAA,SAItBC,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAoB5BC,YAAY,EACZC,eAAe,EACfC,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
package/dist/index.scss CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  * Do not edit directly
4
- * Generated on Thu, 05 Sep 2024 19:54:26 GMT
4
+ * Generated on Tue, 24 Sep 2024 20:24:06 GMT
5
5
  */
6
6
 
7
7
  $border-color-control: #8d8d8d !default;
@@ -46,7 +46,7 @@ $hue-blue-200: #c1c9f6 !default;
46
46
  $hue-blue-300: #9daaf1 !default;
47
47
  $hue-blue-400: #7286eb !default;
48
48
  $hue-blue-500: #546be7 !default;
49
- $hue-blue-600: #4c64e1 !default;
49
+ $hue-blue-600: #3f59e4 !default;
50
50
  $hue-blue-700: #2e40a5 !default;
51
51
  $hue-blue-800: #22307c !default;
52
52
  $hue-blue-900: #182257 !default;
@@ -80,12 +80,52 @@ $hue-yellow-600: #966603 !default;
80
80
  $hue-yellow-700: #664402 !default;
81
81
  $hue-yellow-800: #4c3302 !default;
82
82
  $hue-yellow-900: #352401 !default;
83
+ $hue-accent-one-50: #F5F2FD !default;
84
+ $hue-accent-one-100: #E4DFF1 !default;
85
+ $hue-accent-one-200: #D2C2FF !default;
86
+ $hue-accent-one-300: #B89FFE !default;
87
+ $hue-accent-one-400: #9777F9 !default;
88
+ $hue-accent-one-500: #8951FB !default;
89
+ $hue-accent-one-600: #6E47C9 !default;
90
+ $hue-accent-one-700: #5227BE !default;
91
+ $hue-accent-one-800: #401895 !default;
92
+ $hue-accent-one-900: #2B0679 !default;
93
+ $hue-accent-two-50: #FCF2E8 !default;
94
+ $hue-accent-two-100: #F7DCD6 !default;
95
+ $hue-accent-two-200: #F2C299 !default;
96
+ $hue-accent-two-300: #ED9B58 !default;
97
+ $hue-accent-two-400: #E06C07 !default;
98
+ $hue-accent-two-500: #C25608 !default;
99
+ $hue-accent-two-600: #964E1E !default;
100
+ $hue-accent-two-700: #964E1E !default;
101
+ $hue-accent-two-800: #50301B !default;
102
+ $hue-accent-two-900: #3E1F09 !default;
103
+ $hue-accent-three-50: #E1F7F7 !default;
104
+ $hue-accent-three-100: #BCEBEA !default;
105
+ $hue-accent-three-200: #89D9D9 !default;
106
+ $hue-accent-three-300: #5CBDBD !default;
107
+ $hue-accent-three-400: #269C9C !default;
108
+ $hue-accent-three-500: #008585 !default;
109
+ $hue-accent-three-600: #1B6C6C !default;
110
+ $hue-accent-three-700: #255157 !default;
111
+ $hue-accent-three-800: #1C3D3D !default;
112
+ $hue-accent-three-900: #12282B !default;
113
+ $hue-accent-four-50: #FFF2E6 !default;
114
+ $hue-accent-four-100: #EBDFCA !default;
115
+ $hue-accent-four-200: #D6C9AD !default;
116
+ $hue-accent-four-300: #C2AB84 !default;
117
+ $hue-accent-four-400: #A18A60 !default;
118
+ $hue-accent-four-500: #87744D !default;
119
+ $hue-accent-four-600: #696803 !default;
120
+ $hue-accent-four-700: #574931 !default;
121
+ $hue-accent-four-800: #403727 !default;
122
+ $hue-accent-four-900: #2E2618 !default;
83
123
  $palette-primary-lighter: #f2f3fd !default;
84
124
  $palette-primary-light: #9daaf1 !default;
85
125
  $palette-primary-main: #546be7 !default;
86
126
  $palette-primary-dark: #2e40a5 !default;
87
127
  $palette-primary-darker: #22307c !default;
88
- $palette-primary-text: #4c64e1 !default;
128
+ $palette-primary-text: #3f59e4 !default;
89
129
  $palette-primary-heading: #182257 !default;
90
130
  $palette-primary-highlight: #dbe0fa !default;
91
131
  $palette-danger-lighter: #fff0ee !default;
@@ -137,7 +177,7 @@ $typography-color-inverse: #ffffff !default; // Inverse text color typically use
137
177
  $typography-color-support: #4b4b4b !default;
138
178
  $typography-color-subordinate: #6e6e6e !default; // Text color for subordinate text like captions
139
179
  $typography-color-disabled: #aeaeae !default;
140
- $typography-color-action: #4c64e1 !default;
180
+ $typography-color-action: #3f59e4 !default;
141
181
  $typography-color-danger: #d92300 !default;
142
182
  $typography-color-success: #197f48 !default;
143
183
  $typography-color-warning: #966603 !default;
@@ -301,6 +341,54 @@ $ods-tokens: (
301
341
  '700': $hue-yellow-700,
302
342
  '800': $hue-yellow-800,
303
343
  '900': $hue-yellow-900
344
+ ),
345
+ 'accentOne': (
346
+ '50': $hue-accent-one-50,
347
+ '100': $hue-accent-one-100,
348
+ '200': $hue-accent-one-200,
349
+ '300': $hue-accent-one-300,
350
+ '400': $hue-accent-one-400,
351
+ '500': $hue-accent-one-500,
352
+ '600': $hue-accent-one-600,
353
+ '700': $hue-accent-one-700,
354
+ '800': $hue-accent-one-800,
355
+ '900': $hue-accent-one-900
356
+ ),
357
+ 'accentTwo': (
358
+ '50': $hue-accent-two-50,
359
+ '100': $hue-accent-two-100,
360
+ '200': $hue-accent-two-200,
361
+ '300': $hue-accent-two-300,
362
+ '400': $hue-accent-two-400,
363
+ '500': $hue-accent-two-500,
364
+ '600': $hue-accent-two-600,
365
+ '700': $hue-accent-two-700,
366
+ '800': $hue-accent-two-800,
367
+ '900': $hue-accent-two-900
368
+ ),
369
+ 'accentThree': (
370
+ '50': $hue-accent-three-50,
371
+ '100': $hue-accent-three-100,
372
+ '200': $hue-accent-three-200,
373
+ '300': $hue-accent-three-300,
374
+ '400': $hue-accent-three-400,
375
+ '500': $hue-accent-three-500,
376
+ '600': $hue-accent-three-600,
377
+ '700': $hue-accent-three-700,
378
+ '800': $hue-accent-three-800,
379
+ '900': $hue-accent-three-900
380
+ ),
381
+ 'accentFour': (
382
+ '50': $hue-accent-four-50,
383
+ '100': $hue-accent-four-100,
384
+ '200': $hue-accent-four-200,
385
+ '300': $hue-accent-four-300,
386
+ '400': $hue-accent-four-400,
387
+ '500': $hue-accent-four-500,
388
+ '600': $hue-accent-four-600,
389
+ '700': $hue-accent-four-700,
390
+ '800': $hue-accent-four-800,
391
+ '900': $hue-accent-four-900
304
392
  )
305
393
  ),
306
394
  'palette': (
@@ -20,7 +20,7 @@ import { DataFilters } from "../DataFilters.js";
20
20
  import { EmptyState } from "../../EmptyState.js";
21
21
  import { fetchData } from "./fetchData.js";
22
22
  import { LayoutSwitcher } from "./LayoutSwitcher.js";
23
- import { MenuButton } from "../../index.js";
23
+ import { MenuButton } from "../../MenuButton.js";
24
24
  import { MoreIcon } from "../../icons.generated/index.js";
25
25
  import { TableSettings } from "./TableSettings.js";
26
26
  import { Pagination, usePagination } from "../../Pagination/index.js";
@@ -28,10 +28,10 @@ import { TableLayoutContent } from "./TableLayoutContent.js";
28
28
  import { CardLayoutContent } from "./CardLayoutContent.js";
29
29
  import { useFilterConversion } from "./useFilterConversion.js";
30
30
  import { useRowReordering } from "../../DataTable/useRowReordering.js";
31
+ import { Typography } from "../../Typography.js";
31
32
  import { useOdysseyDesignTokens } from "../../OdysseyDesignTokensContext.js";
32
33
  import styled from "@emotion/styled";
33
34
  import { jsx as _jsx } from "react/jsx-runtime";
34
- import { Fragment as _Fragment } from "react/jsx-runtime";
35
35
  import { jsxs as _jsxs } from "react/jsx-runtime";
36
36
  const DataViewContainer = styled("div", {
37
37
  shouldForwardProp: prop => prop !== "odysseyDesignTokens"
@@ -46,9 +46,30 @@ const BulkActionsContainer = styled("div")(() => ({
46
46
  display: "flex",
47
47
  justifyContent: "space-between"
48
48
  }));
49
- const AdditionalActionsContainer = styled("div")(() => ({
49
+ const AdditionalActionsContainer = styled("div", {
50
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens"
51
+ })(({
52
+ odysseyDesignTokens
53
+ }) => ({
50
54
  display: "flex",
51
- justifyContent: "flex-end"
55
+ justifyContent: "flex-end",
56
+ gap: odysseyDesignTokens.Spacing2
57
+ }));
58
+ const AdditionalActionsInner = styled("div", {
59
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens"
60
+ })(({
61
+ odysseyDesignTokens
62
+ }) => ({
63
+ display: "flex",
64
+ alignItems: "center",
65
+ gap: odysseyDesignTokens.Spacing2
66
+ }));
67
+ const MetaTextContainer = styled("div", {
68
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens"
69
+ })(({
70
+ odysseyDesignTokens
71
+ }) => ({
72
+ marginInlineEnd: odysseyDesignTokens.Spacing2
52
73
  }));
53
74
  const DataView = ({
54
75
  additionalActionButton,
@@ -57,6 +78,7 @@ const DataView = ({
57
78
  bulkActionMenuItems,
58
79
  currentPage = 1,
59
80
  emptyPlaceholder,
81
+ enableVirtualization: enableVirtualizationProp,
60
82
  errorMessage: errorMessageProp,
61
83
  filters: filtersProp,
62
84
  getData,
@@ -73,6 +95,7 @@ const DataView = ({
73
95
  isNoResults: isNoResultsProp,
74
96
  isPaginationMoreDisabled,
75
97
  isRowReorderingDisabled,
98
+ metaText,
76
99
  noResultsPlaceholder,
77
100
  onChangeRowSelection,
78
101
  onReorderRows,
@@ -83,7 +106,8 @@ const DataView = ({
83
106
  tableLayoutOptions,
84
107
  totalRows,
85
108
  maxPages,
86
- maxResultsPerPage
109
+ maxResultsPerPage,
110
+ onPaginationChange
87
111
  }) => {
88
112
  const odysseyDesignTokens = useOdysseyDesignTokens();
89
113
  const {
@@ -139,9 +163,12 @@ const DataView = ({
139
163
  useEffect(() => {
140
164
  setPagination(prev => ({
141
165
  pageIndex: 1,
142
- pageSize: prev.pageSize
166
+ pageSize: paginationType == "loadMore" ? resultsPerPage : prev.pageSize
143
167
  }));
144
- }, [filters, search]);
168
+ }, [filters, paginationType, resultsPerPage, search]);
169
+ useEffect(() => {
170
+ onPaginationChange?.(pagination);
171
+ }, [onPaginationChange, pagination]);
145
172
  useEffect(() => {
146
173
  fetchData({
147
174
  dataQueryParams,
@@ -177,23 +204,33 @@ const DataView = ({
177
204
  }
178
205
  return;
179
206
  }, [noResultsPlaceholder, t, isEmpty, isNoResults, emptyPlaceholder]);
180
- const additionalActions = useMemo(() => _jsxs(_Fragment, {
181
- children: [currentLayout === "table" && tableLayoutOptions && _jsx(TableSettings, {
182
- setTableState: setTableState,
183
- tableLayoutOptions: tableLayoutOptions,
184
- tableState: tableState
185
- }), availableLayouts.length > 1 && _jsx(LayoutSwitcher, {
186
- availableLayouts: availableLayouts,
187
- currentLayout: currentLayout,
188
- setCurrentLayout: setCurrentLayout
189
- }), additionalActionButton, additionalActionMenuItems && _jsx(MenuButton, {
190
- endIcon: _jsx(MoreIcon, {}),
191
- ariaLabel: t("table.moreactions.arialabel"),
192
- buttonVariant: "secondary",
193
- menuAlignment: "right",
194
- children: additionalActionMenuItems
195
- })]
196
- }), [currentLayout, tableLayoutOptions, tableState, availableLayouts, additionalActionButton, additionalActionMenuItems, t]);
207
+ const additionalActions = useMemo(() => {
208
+ return (metaText || currentLayout === "table" && tableLayoutOptions || availableLayouts.length > 1 || additionalActionButton || additionalActionMenuItems) && _jsxs(AdditionalActionsInner, {
209
+ odysseyDesignTokens: odysseyDesignTokens,
210
+ children: [metaText && _jsx(MetaTextContainer, {
211
+ odysseyDesignTokens: odysseyDesignTokens,
212
+ children: _jsx(Typography, {
213
+ color: "textSecondary",
214
+ children: metaText
215
+ })
216
+ }), currentLayout === "table" && tableLayoutOptions && _jsx(TableSettings, {
217
+ setTableState: setTableState,
218
+ tableLayoutOptions: tableLayoutOptions,
219
+ tableState: tableState
220
+ }), availableLayouts.length > 1 && _jsx(LayoutSwitcher, {
221
+ availableLayouts: availableLayouts,
222
+ currentLayout: currentLayout,
223
+ setCurrentLayout: setCurrentLayout
224
+ }), additionalActionButton, additionalActionMenuItems && _jsx(MenuButton, {
225
+ endIcon: _jsx(MoreIcon, {}),
226
+ ariaLabel: t("table.moreactions.arialabel"),
227
+ buttonVariant: "secondary",
228
+ menuAlignment: "right",
229
+ children: additionalActionMenuItems
230
+ })]
231
+ });
232
+ }, [additionalActionButton, additionalActionMenuItems, availableLayouts, currentLayout, metaText, odysseyDesignTokens, tableLayoutOptions, tableState, t]);
233
+ const enableVirtualization = useMemo(() => enableVirtualizationProp ?? paginationType === "loadMore", [enableVirtualizationProp, paginationType]);
197
234
  const {
198
235
  lastRow: lastRowOnPage
199
236
  } = usePagination({
@@ -234,13 +271,15 @@ const DataView = ({
234
271
  rowSelection: rowSelection,
235
272
  setRowSelection: setRowSelection
236
273
  }), !shouldShowFilters && additionalActions]
237
- }), !shouldShowFilters && !bulkActionMenuItems && !hasRowSelection && _jsx(AdditionalActionsContainer, {
274
+ }), !shouldShowFilters && !bulkActionMenuItems && !hasRowSelection && additionalActions && _jsx(AdditionalActionsContainer, {
275
+ odysseyDesignTokens: odysseyDesignTokens,
238
276
  children: additionalActions
239
277
  }), currentLayout === "table" && tableLayoutOptions && _jsx(TableLayoutContent, {
240
278
  columns: tableLayoutOptions.columns,
241
279
  data: data,
242
280
  draggingRow: draggingRow,
243
281
  emptyState: emptyState,
282
+ enableVirtualization: enableVirtualization,
244
283
  getRowId: getRowId,
245
284
  hasRowReordering: hasRowReordering,
246
285
  hasRowSelection: hasRowSelection,