@okta/odyssey-react-mui 1.0.1 → 1.1.1

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 (205) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +1 -1
  3. package/dist/Autocomplete.js +9 -3
  4. package/dist/Autocomplete.js.map +1 -1
  5. package/dist/Banner.js +3 -1
  6. package/dist/Banner.js.map +1 -1
  7. package/dist/Box.js +8 -4
  8. package/dist/Box.js.map +1 -1
  9. package/dist/Button.js +3 -1
  10. package/dist/Button.js.map +1 -1
  11. package/dist/Callout.js +2 -0
  12. package/dist/Callout.js.map +1 -1
  13. package/dist/Checkbox.js +6 -2
  14. package/dist/Checkbox.js.map +1 -1
  15. package/dist/CheckboxGroup.js +5 -7
  16. package/dist/CheckboxGroup.js.map +1 -1
  17. package/dist/CircularProgress.js +2 -0
  18. package/dist/CircularProgress.js.map +1 -1
  19. package/dist/Dialog.js +2 -0
  20. package/dist/Dialog.js.map +1 -1
  21. package/dist/Field.js.map +1 -1
  22. package/dist/FieldError.js +2 -0
  23. package/dist/FieldError.js.map +1 -1
  24. package/dist/FieldHint.js +2 -0
  25. package/dist/FieldHint.js.map +1 -1
  26. package/dist/FieldLabel.js +3 -1
  27. package/dist/FieldLabel.js.map +1 -1
  28. package/dist/Fieldset.js +3 -1
  29. package/dist/Fieldset.js.map +1 -1
  30. package/dist/Form.js +5 -3
  31. package/dist/Form.js.map +1 -1
  32. package/dist/Link.js +3 -1
  33. package/dist/Link.js.map +1 -1
  34. package/dist/MenuButton.js +8 -2
  35. package/dist/MenuButton.js.map +1 -1
  36. package/dist/MenuItem.js +6 -2
  37. package/dist/MenuItem.js.map +1 -1
  38. package/dist/NativeSelect.js +3 -1
  39. package/dist/NativeSelect.js.map +1 -1
  40. package/dist/OdysseyI18n.js +2 -0
  41. package/dist/OdysseyI18n.js.map +1 -1
  42. package/dist/OdysseyProvider.js +7 -4
  43. package/dist/OdysseyProvider.js.map +1 -1
  44. package/dist/OdysseyThemeProvider.js +3 -6
  45. package/dist/OdysseyThemeProvider.js.map +1 -1
  46. package/dist/OdysseyTranslationProvider.types.js +1 -1
  47. package/dist/OdysseyTranslationProvider.types.js.map +1 -1
  48. package/dist/PasswordField.js +9 -8
  49. package/dist/PasswordField.js.map +1 -1
  50. package/dist/Radio.js +2 -0
  51. package/dist/Radio.js.map +1 -1
  52. package/dist/RadioGroup.js +5 -2
  53. package/dist/RadioGroup.js.map +1 -1
  54. package/dist/SearchField.js +11 -10
  55. package/dist/SearchField.js.map +1 -1
  56. package/dist/Select.js +8 -5
  57. package/dist/Select.js.map +1 -1
  58. package/dist/SeleniumProps.js +2 -0
  59. package/dist/SeleniumProps.js.map +1 -0
  60. package/dist/Status.js +4 -2
  61. package/dist/Status.js.map +1 -1
  62. package/dist/Tabs.js +11 -4
  63. package/dist/Tabs.js.map +1 -1
  64. package/dist/Tag.js +4 -2
  65. package/dist/Tag.js.map +1 -1
  66. package/dist/TagList.js +3 -1
  67. package/dist/TagList.js.map +1 -1
  68. package/dist/TextField.js +6 -2
  69. package/dist/TextField.js.map +1 -1
  70. package/dist/Toast.js +2 -0
  71. package/dist/Toast.js.map +1 -1
  72. package/dist/Tooltip.js +2 -0
  73. package/dist/Tooltip.js.map +1 -1
  74. package/dist/Typography.js +71 -37
  75. package/dist/Typography.js.map +1 -1
  76. package/dist/labs/DatePicker.js +4 -2
  77. package/dist/labs/DatePicker.js.map +1 -1
  78. package/dist/labs/PaginatedTable.js +6 -4
  79. package/dist/labs/PaginatedTable.js.map +1 -1
  80. package/dist/labs/StaticTable.js +9 -4
  81. package/dist/labs/StaticTable.js.map +1 -1
  82. package/dist/src/Autocomplete.d.ts +7 -2
  83. package/dist/src/Autocomplete.d.ts.map +1 -1
  84. package/dist/src/Banner.d.ts +3 -2
  85. package/dist/src/Banner.d.ts.map +1 -1
  86. package/dist/src/Box.d.ts +9 -2
  87. package/dist/src/Box.d.ts.map +1 -1
  88. package/dist/src/Button.d.ts +3 -2
  89. package/dist/src/Button.d.ts.map +1 -1
  90. package/dist/src/Callout.d.ts +3 -2
  91. package/dist/src/Callout.d.ts.map +1 -1
  92. package/dist/src/Checkbox.d.ts +8 -3
  93. package/dist/src/Checkbox.d.ts.map +1 -1
  94. package/dist/src/CheckboxGroup.d.ts +3 -6
  95. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  96. package/dist/src/CircularProgress.d.ts +3 -2
  97. package/dist/src/CircularProgress.d.ts.map +1 -1
  98. package/dist/src/Dialog.d.ts +3 -2
  99. package/dist/src/Dialog.d.ts.map +1 -1
  100. package/dist/src/Field.d.ts +2 -1
  101. package/dist/src/Field.d.ts.map +1 -1
  102. package/dist/src/FieldError.d.ts +3 -2
  103. package/dist/src/FieldError.d.ts.map +1 -1
  104. package/dist/src/FieldHint.d.ts +3 -2
  105. package/dist/src/FieldHint.d.ts.map +1 -1
  106. package/dist/src/FieldLabel.d.ts +3 -2
  107. package/dist/src/FieldLabel.d.ts.map +1 -1
  108. package/dist/src/Fieldset.d.ts +3 -2
  109. package/dist/src/Fieldset.d.ts.map +1 -1
  110. package/dist/src/Form.d.ts +3 -2
  111. package/dist/src/Form.d.ts.map +1 -1
  112. package/dist/src/Link.d.ts +3 -2
  113. package/dist/src/Link.d.ts.map +1 -1
  114. package/dist/src/MenuButton.d.ts +12 -3
  115. package/dist/src/MenuButton.d.ts.map +1 -1
  116. package/dist/src/MenuItem.d.ts +5 -4
  117. package/dist/src/MenuItem.d.ts.map +1 -1
  118. package/dist/src/NativeSelect.d.ts +56 -2
  119. package/dist/src/NativeSelect.d.ts.map +1 -1
  120. package/dist/src/OdysseyI18n.d.ts +15 -0
  121. package/dist/src/OdysseyI18n.d.ts.map +1 -1
  122. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  123. package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
  124. package/dist/src/OdysseyTranslationProvider.types.d.ts +1 -1
  125. package/dist/src/OdysseyTranslationProvider.types.d.ts.map +1 -1
  126. package/dist/src/PasswordField.d.ts +70 -2
  127. package/dist/src/PasswordField.d.ts.map +1 -1
  128. package/dist/src/Radio.d.ts +3 -2
  129. package/dist/src/Radio.d.ts.map +1 -1
  130. package/dist/src/RadioGroup.d.ts +8 -3
  131. package/dist/src/RadioGroup.d.ts.map +1 -1
  132. package/dist/src/SearchField.d.ts +58 -2
  133. package/dist/src/SearchField.d.ts.map +1 -1
  134. package/dist/src/Select.d.ts +60 -2
  135. package/dist/src/Select.d.ts.map +1 -1
  136. package/dist/src/SeleniumProps.d.ts +20 -0
  137. package/dist/src/SeleniumProps.d.ts.map +1 -0
  138. package/dist/src/Status.d.ts +3 -2
  139. package/dist/src/Status.d.ts.map +1 -1
  140. package/dist/src/Tabs.d.ts +9 -3
  141. package/dist/src/Tabs.d.ts.map +1 -1
  142. package/dist/src/Tag.d.ts +3 -2
  143. package/dist/src/Tag.d.ts.map +1 -1
  144. package/dist/src/TagList.d.ts +3 -2
  145. package/dist/src/TagList.d.ts.map +1 -1
  146. package/dist/src/TextField.d.ts +86 -2
  147. package/dist/src/TextField.d.ts.map +1 -1
  148. package/dist/src/Toast.d.ts +3 -2
  149. package/dist/src/Toast.d.ts.map +1 -1
  150. package/dist/src/Tooltip.d.ts +3 -2
  151. package/dist/src/Tooltip.d.ts.map +1 -1
  152. package/dist/src/Typography.d.ts +14 -45
  153. package/dist/src/Typography.d.ts.map +1 -1
  154. package/dist/src/labs/DatePicker.d.ts +5 -1
  155. package/dist/src/labs/DatePicker.d.ts.map +1 -1
  156. package/dist/src/labs/PaginatedTable.d.ts.map +1 -1
  157. package/dist/src/labs/StaticTable.d.ts.map +1 -1
  158. package/dist/src/theme/components.d.ts.map +1 -1
  159. package/dist/theme/components.js +41 -13
  160. package/dist/theme/components.js.map +1 -1
  161. package/dist/tsconfig.production.tsbuildinfo +1 -1
  162. package/package.json +18 -9
  163. package/scripts/properties-to-ts.js +7 -7
  164. package/src/Autocomplete.tsx +13 -2
  165. package/src/Banner.tsx +11 -2
  166. package/src/Box.tsx +11 -5
  167. package/src/Button.tsx +6 -1
  168. package/src/Callout.tsx +5 -3
  169. package/src/Checkbox.tsx +14 -4
  170. package/src/CheckboxGroup.tsx +6 -10
  171. package/src/CircularProgress.tsx +5 -1
  172. package/src/Dialog.tsx +5 -2
  173. package/src/Field.tsx +2 -0
  174. package/src/FieldError.tsx +5 -3
  175. package/src/FieldHint.tsx +9 -3
  176. package/src/FieldLabel.tsx +5 -3
  177. package/src/Fieldset.tsx +4 -1
  178. package/src/Form.tsx +7 -4
  179. package/src/Link.tsx +18 -3
  180. package/src/MenuButton.tsx +33 -4
  181. package/src/MenuItem.tsx +11 -6
  182. package/src/NativeSelect.tsx +7 -2
  183. package/src/OdysseyI18n.ts +2 -0
  184. package/src/OdysseyProvider.tsx +9 -6
  185. package/src/OdysseyThemeProvider.tsx +4 -6
  186. package/src/OdysseyTranslationProvider.types.ts +1 -0
  187. package/src/PasswordField.tsx +18 -10
  188. package/src/Radio.tsx +5 -1
  189. package/src/RadioGroup.tsx +12 -4
  190. package/src/SearchField.tsx +23 -15
  191. package/src/Select.tsx +16 -6
  192. package/src/SeleniumProps.ts +20 -0
  193. package/src/Status.tsx +15 -3
  194. package/src/Tabs.tsx +18 -4
  195. package/src/Tag.tsx +12 -3
  196. package/src/TagList.tsx +4 -2
  197. package/src/TextField.tsx +14 -2
  198. package/src/Toast.tsx +4 -1
  199. package/src/Tooltip.tsx +4 -1
  200. package/src/Typography.tsx +76 -28
  201. package/src/labs/DatePicker.tsx +15 -7
  202. package/src/labs/PaginatedTable.tsx +12 -3
  203. package/src/labs/README.md +2 -2
  204. package/src/labs/StaticTable.tsx +13 -3
  205. package/src/theme/components.tsx +49 -14
package/dist/Tabs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","names":["React","memo","useCallback","useState","TabList","MuiTabList","TabPanel","MuiTabPanel","TabContext","MuiTabContext","jsx","_jsx","jsxs","_jsxs","Tabs","_ref","ariaLabel","initialValue","tabs","tabState","setTabState","onChange","_event","newState","value","children","map","tab","index","_Tab","disabled","isDisabled","icon","startIcon","label","toString","MemoizedTabs","displayName"],"sources":["../src/Tabs.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 React, {\n ReactElement,\n ReactNode,\n memo,\n useCallback,\n useState,\n} from \"react\";\nimport { Tab as MuiTab } from \"@mui/material\";\nimport {\n TabList as MuiTabList,\n TabPanel as MuiTabPanel,\n TabContext as MuiTabContext,\n} from \"@mui/lab\";\n\nexport type TabItemProps = {\n /**\n * The content of the Tab itself\n */\n children: ReactNode;\n /**\n * If `true`, the TabItem is disabled\n */\n isDisabled?: boolean;\n /**\n * The label text for the TabItem\n */\n label: string;\n /**\n * An optional icon to display at the start of the TabItem\n */\n startIcon?: ReactElement;\n /**\n * The value associated with the TabItem\n */\n value?: string;\n};\n\nexport type TabsProps = {\n /**\n * The ARIA label for the full Tabs group\n */\n ariaLabel?: string;\n /**\n * The value of the Tab that should be selected by default\n */\n initialValue?: string;\n /**\n * The TabItems to be included in the Tabs group\n */\n tabs: TabItemProps[];\n};\n\nconst Tabs = ({ ariaLabel, initialValue = \"0\", tabs }: TabsProps) => {\n const [tabState, setTabState] = useState(initialValue);\n\n const onChange = useCallback(\n (_event: React.SyntheticEvent, newState: string) => {\n setTabState(newState);\n },\n []\n );\n\n return (\n <MuiTabContext value={tabState}>\n <MuiTabList onChange={onChange} aria-label={ariaLabel}>\n {tabs.map((tab, index) => (\n <MuiTab\n disabled={tab.isDisabled}\n icon={tab.startIcon}\n label={tab.label}\n value={tab.value ? tab.value : index.toString()}\n key={tab.value ? tab.value : index.toString()}\n />\n ))}\n </MuiTabList>\n {tabs.map((tab, index) => (\n <MuiTabPanel\n value={tab.value ? tab.value : index.toString()}\n key={tab.value ? tab.value : index.toString()}\n >\n {tab.children}\n </MuiTabPanel>\n ))}\n </MuiTabContext>\n );\n};\n\nconst MemoizedTabs = memo(Tabs);\nMemoizedTabs.displayName = \"Tabs\";\n\nexport { MemoizedTabs as Tabs };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAGVC,IAAI,EACJC,WAAW,EACXC,QAAQ,QACH,OAAO;AAEd,SACEC,OAAO,IAAIC,UAAU,EACrBC,QAAQ,IAAIC,WAAW,EACvBC,UAAU,IAAIC,aAAa,QACtB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAwClB,MAAMC,IAAI,GAAGC,IAAA,IAAwD;EAAA,IAAvD;IAAEC,SAAS;IAAEC,YAAY,GAAG,GAAG;IAAEC;EAAgB,CAAC,GAAAH,IAAA;EAC9D,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGjB,QAAQ,CAACc,YAAY,CAAC;EAEtD,MAAMI,QAAQ,GAAGnB,WAAW,CAC1B,CAACoB,MAA4B,EAAEC,QAAgB,KAAK;IAClDH,WAAW,CAACG,QAAQ,CAAC;EACvB,CAAC,EACD,EACF,CAAC;EAED,OACEV,KAAA,CAACJ,aAAa;IAACe,KAAK,EAAEL,QAAS;IAAAM,QAAA,GAC7Bd,IAAA,CAACN,UAAU;MAACgB,QAAQ,EAAEA,QAAS;MAAC,cAAYL,SAAU;MAAAS,QAAA,EACnDP,IAAI,CAACQ,GAAG,CAAC,CAACC,GAAG,EAAEC,KAAK,KACnBjB,IAAA,CAAAkB,IAAA;QACEC,QAAQ,EAAEH,GAAG,CAACI,UAAW;QACzBC,IAAI,EAAEL,GAAG,CAACM,SAAU;QACpBC,KAAK,EAAEP,GAAG,CAACO,KAAM;QACjBV,KAAK,EAAEG,GAAG,CAACH,KAAK,GAAGG,GAAG,CAACH,KAAK,GAAGI,KAAK,CAACO,QAAQ,CAAC;MAAE,GAC3CR,GAAG,CAACH,KAAK,GAAGG,GAAG,CAACH,KAAK,GAAGI,KAAK,CAACO,QAAQ,CAAC,CAC7C,CACF;IAAC,CACQ,CAAC,EACZjB,IAAI,CAACQ,GAAG,CAAC,CAACC,GAAG,EAAEC,KAAK,KACnBjB,IAAA,CAACJ,WAAW;MACViB,KAAK,EAAEG,GAAG,CAACH,KAAK,GAAGG,GAAG,CAACH,KAAK,GAAGI,KAAK,CAACO,QAAQ,CAAC,CAAE;MAAAV,QAAA,EAG/CE,GAAG,CAACF;IAAQ,GAFRE,GAAG,CAACH,KAAK,GAAGG,GAAG,CAACH,KAAK,GAAGI,KAAK,CAACO,QAAQ,CAAC,CAGjC,CACd,CAAC;EAAA,CACW,CAAC;AAEpB,CAAC;AAED,MAAMC,YAAY,GAAGnC,IAAI,CAACa,IAAI,CAAC;AAC/BsB,YAAY,CAACC,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAItB,IAAI"}
1
+ {"version":3,"file":"Tabs.js","names":["React","memo","useCallback","useEffect","useState","TabList","MuiTabList","TabPanel","MuiTabPanel","TabContext","MuiTabContext","jsx","_jsx","jsxs","_jsxs","Tabs","_ref","ariaLabel","initialValue","tabs","value","tabState","setTabState","onChange","_event","newState","undefined","children","map","tab","index","_Tab","testId","disabled","isDisabled","icon","startIcon","label","toString","MemoizedTabs","displayName"],"sources":["../src/Tabs.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 React, {\n ReactElement,\n ReactNode,\n memo,\n useCallback,\n useEffect,\n useState,\n} from \"react\";\nimport { Tab as MuiTab } from \"@mui/material\";\nimport {\n TabList as MuiTabList,\n TabPanel as MuiTabPanel,\n TabContext as MuiTabContext,\n} from \"@mui/lab\";\nimport { SeleniumProps } from \"./SeleniumProps\";\n\nexport type TabItemProps = {\n /**\n * The content of the Tab itself\n */\n children: ReactNode;\n /**\n * If `true`, the TabItem is disabled\n */\n isDisabled?: boolean;\n /**\n * The label text for the TabItem\n */\n label: string;\n /**\n * An optional icon to display at the start of the TabItem\n */\n startIcon?: ReactElement;\n /**\n * The value associated with the TabItem\n */\n value?: string;\n} & SeleniumProps;\n\nexport type TabsProps = {\n /**\n * The ARIA label for the full Tabs group\n */\n ariaLabel?: string;\n /**\n * @deprecated please use the `value` prop instead\n * When `value` is provided, `initialValue` isn't used.\n */\n initialValue?: string;\n /**\n * The TabItems to be included in the Tabs group\n */\n tabs: TabItemProps[];\n /**\n * Identifier for the selected tab.\n */\n value?: string;\n};\n\nconst Tabs = ({ ariaLabel, initialValue, tabs, value }: TabsProps) => {\n const [tabState, setTabState] = useState(initialValue ?? value ?? \"0\");\n\n const onChange = useCallback(\n (_event: React.SyntheticEvent, newState: string) => {\n setTabState(newState);\n },\n []\n );\n\n useEffect(() => {\n if (value !== undefined) {\n setTabState(value);\n }\n }, [value]);\n\n return (\n <MuiTabContext value={tabState}>\n <MuiTabList onChange={onChange} aria-label={ariaLabel}>\n {tabs.map((tab, index) => (\n <MuiTab\n data-se={tab.testId}\n disabled={tab.isDisabled}\n icon={tab.startIcon}\n label={tab.label}\n value={tab.value ? tab.value : index.toString()}\n key={tab.value ? tab.value : index.toString()}\n />\n ))}\n </MuiTabList>\n {tabs.map((tab, index) => (\n <MuiTabPanel\n value={tab.value ? tab.value : index.toString()}\n key={tab.value ? tab.value : index.toString()}\n >\n {tab.children}\n </MuiTabPanel>\n ))}\n </MuiTabContext>\n );\n};\n\nconst MemoizedTabs = memo(Tabs);\nMemoizedTabs.displayName = \"Tabs\";\n\nexport { MemoizedTabs as Tabs };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAGVC,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,QAAQ,QACH,OAAO;AAEd,SACEC,OAAO,IAAIC,UAAU,EACrBC,QAAQ,IAAIC,WAAW,EACvBC,UAAU,IAAIC,aAAa,QACtB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AA8ClB,MAAMC,IAAI,GAAGC,IAAA,IAAyD;EAAA,IAAxD;IAAEC,SAAS;IAAEC,YAAY;IAAEC,IAAI;IAAEC;EAAiB,CAAC,GAAAJ,IAAA;EAC/D,MAAM,CAACK,QAAQ,EAAEC,WAAW,CAAC,GAAGlB,QAAQ,CAACc,YAAY,IAAIE,KAAK,IAAI,GAAG,CAAC;EAEtE,MAAMG,QAAQ,GAAGrB,WAAW,CAC1B,CAACsB,MAA4B,EAAEC,QAAgB,KAAK;IAClDH,WAAW,CAACG,QAAQ,CAAC;EACvB,CAAC,EACD,EACF,CAAC;EAEDtB,SAAS,CAAC,MAAM;IACd,IAAIiB,KAAK,KAAKM,SAAS,EAAE;MACvBJ,WAAW,CAACF,KAAK,CAAC;IACpB;EACF,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEX,OACEN,KAAA,CAACJ,aAAa;IAACU,KAAK,EAAEC,QAAS;IAAAM,QAAA,GAC7Bf,IAAA,CAACN,UAAU;MAACiB,QAAQ,EAAEA,QAAS;MAAC,cAAYN,SAAU;MAAAU,QAAA,EACnDR,IAAI,CAACS,GAAG,CAAC,CAACC,GAAG,EAAEC,KAAK,KACnBlB,IAAA,CAAAmB,IAAA;QACE,WAASF,GAAG,CAACG,MAAO;QACpBC,QAAQ,EAAEJ,GAAG,CAACK,UAAW;QACzBC,IAAI,EAAEN,GAAG,CAACO,SAAU;QACpBC,KAAK,EAAER,GAAG,CAACQ,KAAM;QACjBjB,KAAK,EAAES,GAAG,CAACT,KAAK,GAAGS,GAAG,CAACT,KAAK,GAAGU,KAAK,CAACQ,QAAQ,CAAC;MAAE,GAC3CT,GAAG,CAACT,KAAK,GAAGS,GAAG,CAACT,KAAK,GAAGU,KAAK,CAACQ,QAAQ,CAAC,CAC7C,CACF;IAAC,CACQ,CAAC,EACZnB,IAAI,CAACS,GAAG,CAAC,CAACC,GAAG,EAAEC,KAAK,KACnBlB,IAAA,CAACJ,WAAW;MACVY,KAAK,EAAES,GAAG,CAACT,KAAK,GAAGS,GAAG,CAACT,KAAK,GAAGU,KAAK,CAACQ,QAAQ,CAAC,CAAE;MAAAX,QAAA,EAG/CE,GAAG,CAACF;IAAQ,GAFRE,GAAG,CAACT,KAAK,GAAGS,GAAG,CAACT,KAAK,GAAGU,KAAK,CAACQ,QAAQ,CAAC,CAGjC,CACd,CAAC;EAAA,CACW,CAAC;AAEpB,CAAC;AAED,MAAMC,YAAY,GAAGtC,IAAI,CAACc,IAAI,CAAC;AAC/BwB,YAAY,CAACC,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAIxB,IAAI"}
package/dist/Tag.js CHANGED
@@ -20,7 +20,8 @@ const Tag = _ref => {
20
20
  isDisabled,
21
21
  label,
22
22
  onClick,
23
- onRemove
23
+ onRemove,
24
+ testId
24
25
  } = _ref;
25
26
  const {
26
27
  chipElementType
@@ -30,12 +31,13 @@ const Tag = _ref => {
30
31
  "aria-disabled": isDisabled,
31
32
  clickable: onClick ? true : false,
32
33
  component: chipElementType,
34
+ "data-se": testId,
33
35
  disabled: isDisabled,
34
36
  icon: icon,
35
37
  label: label,
36
38
  onClick: onClick,
37
39
  onDelete: onRemove
38
- }), [chipElementType, icon, isDisabled, label, onClick, onRemove]);
40
+ }), [chipElementType, icon, isDisabled, label, onClick, onRemove, testId]);
39
41
  return _jsx(MuiPropsContext.Consumer, {
40
42
  children: renderTag
41
43
  });
package/dist/Tag.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","names":["memo","useCallback","useContext","TagListContext","MuiPropsContext","jsx","_jsx","Tag","_ref","icon","isDisabled","label","onClick","onRemove","chipElementType","renderTag","muiProps","_Chip","clickable","component","disabled","onDelete","Consumer","children","MemoizedTag","displayName"],"sources":["../src/Tag.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 { Chip as MuiChip, ChipProps as MuiChipProps } from \"@mui/material\";\nimport { memo, ReactElement, useCallback, useContext } from \"react\";\nimport { TagListContext } from \"./TagListContext\";\nimport { MuiPropsContext } from \"./MuiPropsContext\";\n\nexport type TagProps = {\n icon?: ReactElement;\n isDisabled?: boolean;\n /**\n * The label text for the Tag\n */\n label: string;\n /**\n * Callback fired when the Tag is clicked\n */\n onClick?: MuiChipProps[\"onClick\"];\n /**\n * Callback fired when the remove button of the Tag is clicked\n */\n onRemove?: MuiChipProps[\"onDelete\"];\n};\n\nconst Tag = ({ icon, isDisabled, label, onClick, onRemove }: TagProps) => {\n const { chipElementType } = useContext(TagListContext);\n\n const renderTag = useCallback(\n (muiProps) => (\n <MuiChip\n {...muiProps}\n aria-disabled={isDisabled}\n clickable={onClick ? true : false}\n component={chipElementType}\n disabled={isDisabled}\n icon={icon}\n label={label}\n onClick={onClick}\n onDelete={onRemove}\n />\n ),\n [chipElementType, icon, isDisabled, label, onClick, onRemove]\n );\n\n return <MuiPropsContext.Consumer>{renderTag}</MuiPropsContext.Consumer>;\n};\n\nconst MemoizedTag = memo(Tag);\nMemoizedTag.displayName = \"Tag\";\n\nexport { MemoizedTag as Tag };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAgBC,WAAW,EAAEC,UAAU,QAAQ,OAAO;AAAC,SAC3DC,cAAc;AAAA,SACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAmBxB,MAAMC,GAAG,GAAGC,IAAA,IAA8D;EAAA,IAA7D;IAAEC,IAAI;IAAEC,UAAU;IAAEC,KAAK;IAAEC,OAAO;IAAEC;EAAmB,CAAC,GAAAL,IAAA;EACnE,MAAM;IAAEM;EAAgB,CAAC,GAAGZ,UAAU,CAACC,cAAc,CAAC;EAEtD,MAAMY,SAAS,GAAGd,WAAW,CAC1Be,QAAQ,IACPV,IAAA,CAAAW,KAAA;IAAA,GACMD,QAAQ;IACZ,iBAAeN,UAAW;IAC1BQ,SAAS,EAAEN,OAAO,GAAG,IAAI,GAAG,KAAM;IAClCO,SAAS,EAAEL,eAAgB;IAC3BM,QAAQ,EAAEV,UAAW;IACrBD,IAAI,EAAEA,IAAK;IACXE,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBS,QAAQ,EAAER;EAAS,CACpB,CACF,EACD,CAACC,eAAe,EAAEL,IAAI,EAAEC,UAAU,EAAEC,KAAK,EAAEC,OAAO,EAAEC,QAAQ,CAC9D,CAAC;EAED,OAAOP,IAAA,CAACF,eAAe,CAACkB,QAAQ;IAAAC,QAAA,EAAER;EAAS,CAA2B,CAAC;AACzE,CAAC;AAED,MAAMS,WAAW,GAAGxB,IAAI,CAACO,GAAG,CAAC;AAC7BiB,WAAW,CAACC,WAAW,GAAG,KAAK;AAE/B,SAASD,WAAW,IAAIjB,GAAG"}
1
+ {"version":3,"file":"Tag.js","names":["memo","useCallback","useContext","TagListContext","MuiPropsContext","jsx","_jsx","Tag","_ref","icon","isDisabled","label","onClick","onRemove","testId","chipElementType","renderTag","muiProps","_Chip","clickable","component","disabled","onDelete","Consumer","children","MemoizedTag","displayName"],"sources":["../src/Tag.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 { Chip as MuiChip, ChipProps as MuiChipProps } from \"@mui/material\";\nimport { memo, ReactElement, useCallback, useContext } from \"react\";\nimport { TagListContext } from \"./TagListContext\";\nimport { MuiPropsContext } from \"./MuiPropsContext\";\nimport { SeleniumProps } from \"./SeleniumProps\";\n\nexport type TagProps = {\n icon?: ReactElement;\n isDisabled?: boolean;\n /**\n * The label text for the Tag\n */\n label: string;\n /**\n * Callback fired when the Tag is clicked\n */\n onClick?: MuiChipProps[\"onClick\"];\n /**\n * Callback fired when the remove button of the Tag is clicked\n */\n onRemove?: MuiChipProps[\"onDelete\"];\n} & SeleniumProps;\n\nconst Tag = ({\n icon,\n isDisabled,\n label,\n onClick,\n onRemove,\n testId,\n}: TagProps) => {\n const { chipElementType } = useContext(TagListContext);\n\n const renderTag = useCallback(\n (muiProps) => (\n <MuiChip\n {...muiProps}\n aria-disabled={isDisabled}\n clickable={onClick ? true : false}\n component={chipElementType}\n data-se={testId}\n disabled={isDisabled}\n icon={icon}\n label={label}\n onClick={onClick}\n onDelete={onRemove}\n />\n ),\n [chipElementType, icon, isDisabled, label, onClick, onRemove, testId]\n );\n\n return <MuiPropsContext.Consumer>{renderTag}</MuiPropsContext.Consumer>;\n};\n\nconst MemoizedTag = memo(Tag);\nMemoizedTag.displayName = \"Tag\";\n\nexport { MemoizedTag as Tag };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAgBC,WAAW,EAAEC,UAAU,QAAQ,OAAO;AAAC,SAC3DC,cAAc;AAAA,SACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAoBxB,MAAMC,GAAG,GAAGC,IAAA,IAOI;EAAA,IAPH;IACXC,IAAI;IACJC,UAAU;IACVC,KAAK;IACLC,OAAO;IACPC,QAAQ;IACRC;EACQ,CAAC,GAAAN,IAAA;EACT,MAAM;IAAEO;EAAgB,CAAC,GAAGb,UAAU,CAACC,cAAc,CAAC;EAEtD,MAAMa,SAAS,GAAGf,WAAW,CAC1BgB,QAAQ,IACPX,IAAA,CAAAY,KAAA;IAAA,GACMD,QAAQ;IACZ,iBAAeP,UAAW;IAC1BS,SAAS,EAAEP,OAAO,GAAG,IAAI,GAAG,KAAM;IAClCQ,SAAS,EAAEL,eAAgB;IAC3B,WAASD,MAAO;IAChBO,QAAQ,EAAEX,UAAW;IACrBD,IAAI,EAAEA,IAAK;IACXE,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBU,QAAQ,EAAET;EAAS,CACpB,CACF,EACD,CAACE,eAAe,EAAEN,IAAI,EAAEC,UAAU,EAAEC,KAAK,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,CACtE,CAAC;EAED,OAAOR,IAAA,CAACF,eAAe,CAACmB,QAAQ;IAAAC,QAAA,EAAER;EAAS,CAA2B,CAAC;AACzE,CAAC;AAED,MAAMS,WAAW,GAAGzB,IAAI,CAACO,GAAG,CAAC;AAC7BkB,WAAW,CAACC,WAAW,GAAG,KAAK;AAE/B,SAASD,WAAW,IAAIlB,GAAG"}
package/dist/TagList.js CHANGED
@@ -15,13 +15,15 @@ import { TagListContext } from "./TagListContext.js";
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  const TagList = _ref => {
17
17
  let {
18
- children
18
+ children,
19
+ testId
19
20
  } = _ref;
20
21
  const providerValue = useMemo(() => ({
21
22
  chipElementType: "li"
22
23
  }), []);
23
24
  return _jsx(_Stack, {
24
25
  component: "ul",
26
+ "data-se": testId,
25
27
  direction: "row",
26
28
  spacing: 2,
27
29
  useFlexGap: true,
@@ -1 +1 @@
1
- {"version":3,"file":"TagList.js","names":["memo","useMemo","TagListContext","jsx","_jsx","TagList","_ref","children","providerValue","chipElementType","_Stack","component","direction","spacing","useFlexGap","flexWrap","Provider","value","MemoizedTagList","displayName"],"sources":["../src/TagList.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 { Tag } from \"./Tag\";\nimport { Stack } from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\nimport { ChipElementType, TagListContext } from \"./TagListContext\";\n\nexport type TagListProps = {\n /**\n * The Tag or array of Tags within the TagList\n */\n children: ReactElement<typeof Tag> | Array<ReactElement<typeof Tag>>;\n};\n\nconst TagList = ({ children }: TagListProps) => {\n const providerValue = useMemo<{\n chipElementType: ChipElementType;\n }>(\n () => ({\n chipElementType: \"li\",\n }),\n []\n );\n\n return (\n <Stack\n component=\"ul\"\n direction=\"row\"\n spacing={2}\n useFlexGap\n flexWrap=\"wrap\"\n >\n <TagListContext.Provider value={providerValue}>\n {children}\n </TagListContext.Provider>\n </Stack>\n );\n};\n\nconst MemoizedTagList = memo(TagList);\nMemoizedTagList.displayName = \"TagList\";\n\nexport { MemoizedTagList as TagList };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AAAC,SAC1BC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AASxC,MAAMC,OAAO,GAAGC,IAAA,IAAgC;EAAA,IAA/B;IAAEC;EAAuB,CAAC,GAAAD,IAAA;EACzC,MAAME,aAAa,GAAGP,OAAO,CAG3B,OAAO;IACLQ,eAAe,EAAE;EACnB,CAAC,CAAC,EACF,EACF,CAAC;EAED,OACEL,IAAA,CAAAM,MAAA;IACEC,SAAS,EAAC,IAAI;IACdC,SAAS,EAAC,KAAK;IACfC,OAAO,EAAE,CAAE;IACXC,UAAU;IACVC,QAAQ,EAAC,MAAM;IAAAR,QAAA,EAEfH,IAAA,CAACF,cAAc,CAACc,QAAQ;MAACC,KAAK,EAAET,aAAc;MAAAD,QAAA,EAC3CA;IAAQ,CACc;EAAC,CACrB,CAAC;AAEZ,CAAC;AAED,MAAMW,eAAe,GAAGlB,IAAI,CAACK,OAAO,CAAC;AACrCa,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIb,OAAO"}
1
+ {"version":3,"file":"TagList.js","names":["memo","useMemo","TagListContext","jsx","_jsx","TagList","_ref","children","testId","providerValue","chipElementType","_Stack","component","direction","spacing","useFlexGap","flexWrap","Provider","value","MemoizedTagList","displayName"],"sources":["../src/TagList.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 { Tag } from \"./Tag\";\nimport { Stack } from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\nimport { ChipElementType, TagListContext } from \"./TagListContext\";\nimport { SeleniumProps } from \"./SeleniumProps\";\n\nexport type TagListProps = {\n /**\n * The Tag or array of Tags within the TagList\n */\n children: ReactElement<typeof Tag> | Array<ReactElement<typeof Tag>>;\n} & SeleniumProps;\n\nconst TagList = ({ children, testId }: TagListProps) => {\n const providerValue = useMemo<{\n chipElementType: ChipElementType;\n }>(\n () => ({\n chipElementType: \"li\",\n }),\n []\n );\n\n return (\n <Stack\n component=\"ul\"\n data-se={testId}\n direction=\"row\"\n spacing={2}\n useFlexGap\n flexWrap=\"wrap\"\n >\n <TagListContext.Provider value={providerValue}>\n {children}\n </TagListContext.Provider>\n </Stack>\n );\n};\n\nconst MemoizedTagList = memo(TagList);\nMemoizedTagList.displayName = \"TagList\";\n\nexport { MemoizedTagList as TagList };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AAAC,SAC1BC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAUxC,MAAMC,OAAO,GAAGC,IAAA,IAAwC;EAAA,IAAvC;IAAEC,QAAQ;IAAEC;EAAqB,CAAC,GAAAF,IAAA;EACjD,MAAMG,aAAa,GAAGR,OAAO,CAG3B,OAAO;IACLS,eAAe,EAAE;EACnB,CAAC,CAAC,EACF,EACF,CAAC;EAED,OACEN,IAAA,CAAAO,MAAA;IACEC,SAAS,EAAC,IAAI;IACd,WAASJ,MAAO;IAChBK,SAAS,EAAC,KAAK;IACfC,OAAO,EAAE,CAAE;IACXC,UAAU;IACVC,QAAQ,EAAC,MAAM;IAAAT,QAAA,EAEfH,IAAA,CAACF,cAAc,CAACe,QAAQ;MAACC,KAAK,EAAET,aAAc;MAAAF,QAAA,EAC3CA;IAAQ,CACc;EAAC,CACrB,CAAC;AAEZ,CAAC;AAED,MAAMY,eAAe,GAAGnB,IAAI,CAACK,OAAO,CAAC;AACrCc,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAId,OAAO"}
package/dist/TextField.js CHANGED
@@ -28,11 +28,13 @@ const TextField = forwardRef((_ref, ref) => {
28
28
  isOptional = false,
29
29
  isReadOnly,
30
30
  label,
31
+ name: nameOverride,
31
32
  onBlur,
32
33
  onChange,
33
34
  onFocus,
34
35
  placeholder,
35
36
  startAdornment,
37
+ testId,
36
38
  type = "text",
37
39
  value
38
40
  } = _ref;
@@ -45,19 +47,21 @@ const TextField = forwardRef((_ref, ref) => {
45
47
  "aria-describedby": ariaDescribedBy,
46
48
  autoComplete: autoCompleteType,
47
49
  autoFocus: hasInitialFocus,
50
+ "data-se": testId,
48
51
  endAdornment: endAdornment && _jsx(_InputAdornment, {
49
52
  position: "end",
50
53
  children: endAdornment
51
54
  }),
52
55
  id: id,
53
56
  multiline: isMultiline,
54
- name: id,
57
+ name: nameOverride ?? id,
55
58
  onBlur: onBlur,
56
59
  onChange: onChange,
57
60
  onFocus: onFocus,
58
61
  placeholder: placeholder,
59
62
  readOnly: isReadOnly,
60
63
  ref: ref,
64
+ required: !isOptional,
61
65
  startAdornment: startAdornment && _jsx(_InputAdornment, {
62
66
  position: "start",
63
67
  children: startAdornment
@@ -65,7 +69,7 @@ const TextField = forwardRef((_ref, ref) => {
65
69
  type: type,
66
70
  value: value
67
71
  });
68
- }, [autoCompleteType, hasInitialFocus, endAdornment, isMultiline, onChange, onFocus, onBlur, placeholder, isReadOnly, ref, startAdornment, type, value]);
72
+ }, [autoCompleteType, hasInitialFocus, endAdornment, isMultiline, nameOverride, onChange, onFocus, onBlur, placeholder, isOptional, isReadOnly, ref, startAdornment, testId, type, value]);
69
73
  return _jsx(Field, {
70
74
  errorMessage: errorMessage,
71
75
  fieldType: "single",
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","Field","jsx","_jsx","textFieldTypeValues","TextField","_ref","ref","autoCompleteType","hasInitialFocus","endAdornment","errorMessage","hint","id","idOverride","isDisabled","isMultiline","isOptional","isReadOnly","label","onBlur","onChange","onFocus","placeholder","startAdornment","type","value","renderFieldComponent","_ref2","ariaDescribedBy","_InputBase","autoComplete","autoFocus","_InputAdornment","position","children","multiline","name","readOnly","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 { InputAdornment, InputBase } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n} from \"react\";\n\nimport { Field } from \"./Field\";\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 * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessage?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The helper text content.\n */\n hint?: string;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * If `true`, the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * If `true`, the `input` element is not required.\n */\n isOptional?: boolean;\n /**\n * It prevents the user from changing the value of the field\n */\n isReadOnly?: 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};\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n autoCompleteType,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n hint,\n id: idOverride,\n isDisabled = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n startAdornment,\n type = \"text\",\n value,\n },\n ref\n ) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <InputBase\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\">{endAdornment}</InputAdornment>\n )\n }\n id={id}\n multiline={isMultiline}\n name={id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\">{startAdornment}</InputAdornment>\n )\n }\n type={type}\n value={value}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n endAdornment,\n isMultiline,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n isReadOnly,\n ref,\n startAdornment,\n type,\n value,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\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;AAGA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,QACN,OAAO;AAAC,SAENC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEd,OAAO,MAAMC,mBAAmB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,CACG;AA+EV,MAAMC,SAAS,GAAGP,UAAU,CAC1B,CAAAQ,IAAA,EAqBEC,GAAG,KACA;EAAA,IArBH;IACEC,gBAAgB;IAChBC,eAAe;IACfC,YAAY;IACZC,YAAY;IACZC,IAAI;IACJC,EAAE,EAAEC,UAAU;IACdC,UAAU,GAAG,KAAK;IAClBC,WAAW,GAAG,KAAK;IACnBC,UAAU,GAAG,KAAK;IAClBC,UAAU;IACVC,KAAK;IACLC,MAAM;IACNC,QAAQ;IACRC,OAAO;IACPC,WAAW;IACXC,cAAc;IACdC,IAAI,GAAG,MAAM;IACbC;EACF,CAAC,GAAApB,IAAA;EAGD,MAAMqB,oBAAoB,GAAG3B,WAAW,CACtC4B,KAAA;IAAA,IAAC;MAAEC,eAAe;MAAEhB;IAAG,CAAC,GAAAe,KAAA;IAAA,OACtBzB,IAAA,CAAA2B,UAAA;MACE,oBAAkBD,eAAgB;MAClCE,YAAY,EAAEvB,gBAAiB;MAE/BwB,SAAS,EAAEvB,eAAgB;MAC3BC,YAAY,EACVA,YAAY,IACVP,IAAA,CAAA8B,eAAA;QAAgBC,QAAQ,EAAC,KAAK;QAAAC,QAAA,EAAEzB;MAAY,CAAiB,CAEhE;MACDG,EAAE,EAAEA,EAAG;MACPuB,SAAS,EAAEpB,WAAY;MACvBqB,IAAI,EAAExB,EAAG;MACTO,MAAM,EAAEA,MAAO;MACfC,QAAQ,EAAEA,QAAS;MACnBC,OAAO,EAAEA,OAAQ;MACjBC,WAAW,EAAEA,WAAY;MACzBe,QAAQ,EAAEpB,UAAW;MACrBX,GAAG,EAAEA,GAAI;MACTiB,cAAc,EACZA,cAAc,IACZrB,IAAA,CAAA8B,eAAA;QAAgBC,QAAQ,EAAC,OAAO;QAAAC,QAAA,EAAEX;MAAc,CAAiB,CAEpE;MACDC,IAAI,EAAEA,IAAK;MACXC,KAAK,EAAEA;IAAM,CACd,CAAC;EAAA,CACH,EACD,CACElB,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZM,WAAW,EACXK,QAAQ,EACRC,OAAO,EACPF,MAAM,EACNG,WAAW,EACXL,UAAU,EACVX,GAAG,EACHiB,cAAc,EACdC,IAAI,EACJC,KAAK,CAET,CAAC;EAED,OACEvB,IAAA,CAACF,KAAK;IACJU,YAAY,EAAEA,YAAa;IAC3B4B,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACf5B,IAAI,EAAEA,IAAK;IACXC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBE,UAAU,EAAEA,UAAW;IACvBE,KAAK,EAAEA,KAAM;IACbQ,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMc,iBAAiB,GAAG1C,IAAI,CAACM,SAAS,CAAC;AACzCoC,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIpC,SAAS"}
1
+ {"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","Field","jsx","_jsx","textFieldTypeValues","TextField","_ref","ref","autoCompleteType","hasInitialFocus","endAdornment","errorMessage","hint","id","idOverride","isDisabled","isMultiline","isOptional","isReadOnly","label","name","nameOverride","onBlur","onChange","onFocus","placeholder","startAdornment","testId","type","value","renderFieldComponent","_ref2","ariaDescribedBy","_InputBase","autoComplete","autoFocus","_InputAdornment","position","children","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 { InputAdornment, InputBase } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n} from \"react\";\n\nimport { Field } from \"./Field\";\nimport { SeleniumProps } from \"./SeleniumProps\";\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 * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessage?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The helper text content.\n */\n hint?: string;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * If `true`, the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * If `true`, the `input` element is not required.\n */\n isOptional?: boolean;\n /**\n * It prevents the user from changing the value of the field\n */\n isReadOnly?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * The name of the `input` element. Defaults to the `id` if not set.\n */\n name?: 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} & SeleniumProps;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n autoCompleteType,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n hint,\n id: idOverride,\n isDisabled = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n type = \"text\",\n value,\n },\n ref\n ) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <InputBase\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n data-se={testId}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\">{endAdornment}</InputAdornment>\n )\n }\n id={id}\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\">{startAdornment}</InputAdornment>\n )\n }\n type={type}\n value={value}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n endAdornment,\n isMultiline,\n nameOverride,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n type,\n value,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\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;AAGA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,QACN,OAAO;AAAC,SAENC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGd,OAAO,MAAMC,mBAAmB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,CACG;AAmFV,MAAMC,SAAS,GAAGP,UAAU,CAC1B,CAAAQ,IAAA,EAuBEC,GAAG,KACA;EAAA,IAvBH;IACEC,gBAAgB;IAChBC,eAAe;IACfC,YAAY;IACZC,YAAY;IACZC,IAAI;IACJC,EAAE,EAAEC,UAAU;IACdC,UAAU,GAAG,KAAK;IAClBC,WAAW,GAAG,KAAK;IACnBC,UAAU,GAAG,KAAK;IAClBC,UAAU;IACVC,KAAK;IACLC,IAAI,EAAEC,YAAY;IAClBC,MAAM;IACNC,QAAQ;IACRC,OAAO;IACPC,WAAW;IACXC,cAAc;IACdC,MAAM;IACNC,IAAI,GAAG,MAAM;IACbC;EACF,CAAC,GAAAvB,IAAA;EAGD,MAAMwB,oBAAoB,GAAG9B,WAAW,CACtC+B,KAAA;IAAA,IAAC;MAAEC,eAAe;MAAEnB;IAAG,CAAC,GAAAkB,KAAA;IAAA,OACtB5B,IAAA,CAAA8B,UAAA;MACE,oBAAkBD,eAAgB;MAClCE,YAAY,EAAE1B,gBAAiB;MAE/B2B,SAAS,EAAE1B,eAAgB;MAC3B,WAASkB,MAAO;MAChBjB,YAAY,EACVA,YAAY,IACVP,IAAA,CAAAiC,eAAA;QAAgBC,QAAQ,EAAC,KAAK;QAAAC,QAAA,EAAE5B;MAAY,CAAiB,CAEhE;MACDG,EAAE,EAAEA,EAAG;MACP0B,SAAS,EAAEvB,WAAY;MACvBI,IAAI,EAAEC,YAAY,IAAIR,EAAG;MACzBS,MAAM,EAAEA,MAAO;MACfC,QAAQ,EAAEA,QAAS;MACnBC,OAAO,EAAEA,OAAQ;MACjBC,WAAW,EAAEA,WAAY;MACzBe,QAAQ,EAAEtB,UAAW;MACrBX,GAAG,EAAEA,GAAI;MACTkC,QAAQ,EAAE,CAACxB,UAAW;MACtBS,cAAc,EACZA,cAAc,IACZvB,IAAA,CAAAiC,eAAA;QAAgBC,QAAQ,EAAC,OAAO;QAAAC,QAAA,EAAEZ;MAAc,CAAiB,CAEpE;MACDE,IAAI,EAAEA,IAAK;MACXC,KAAK,EAAEA;IAAM,CACd,CAAC;EAAA,CACH,EACD,CACErB,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZM,WAAW,EACXK,YAAY,EACZE,QAAQ,EACRC,OAAO,EACPF,MAAM,EACNG,WAAW,EACXR,UAAU,EACVC,UAAU,EACVX,GAAG,EACHmB,cAAc,EACdC,MAAM,EACNC,IAAI,EACJC,KAAK,CAET,CAAC;EAED,OACE1B,IAAA,CAACF,KAAK;IACJU,YAAY,EAAEA,YAAa;IAC3B+B,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACf/B,IAAI,EAAEA,IAAK;IACXC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBE,UAAU,EAAEA,UAAW;IACvBE,KAAK,EAAEA,KAAM;IACbW,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMc,iBAAiB,GAAG7C,IAAI,CAACM,SAAS,CAAC;AACzCuC,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIvC,SAAS"}
package/dist/Toast.js CHANGED
@@ -36,6 +36,7 @@ const Toast = _ref => {
36
36
  onHide: onHideProp,
37
37
  role,
38
38
  severity,
39
+ testId,
39
40
  text
40
41
  } = _ref;
41
42
  const {
@@ -63,6 +64,7 @@ const Toast = _ref => {
63
64
  startIcon: _jsx(CloseIcon, {}),
64
65
  variant: "floating"
65
66
  }),
67
+ "data-se": testId,
66
68
  role: role,
67
69
  severity: severity,
68
70
  variant: "toast",
package/dist/Toast.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","names":["useEffect","memo","useState","useCallback","visuallyHidden","Link","CloseIcon","Button","useTranslation","jsx","_jsx","jsxs","_jsxs","toastRoleValues","toastSeverityValues","ClickAwayListenerProps","onClickAway","Toast","_ref","autoHideDuration","isDismissable","linkText","linkUrl","isVisible","isVisibleProp","onHide","onHideProp","role","severity","text","t","setIsVisible","_Snackbar","open","undefined","onClose","className","children","_Alert","action","ariaLabel","onClick","size","startIcon","variant","_AlertTitle","style","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 { Alert, AlertTitle, Snackbar } from \"@mui/material\";\nimport { visuallyHidden } from \"@mui/utils\";\nimport { Link } from \"./Link\";\nimport { CloseIcon } from \"./icons.generated\";\nimport { Button } from \"./Button\";\nimport { useTranslation } from \"react-i18next\";\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};\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 text,\n}: ToastProps) => {\n const { t } = useTranslation();\n\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 <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(\"toast.close.text\")}\n onClick={onHide}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n )\n }\n role={role}\n severity={severity}\n variant=\"toast\"\n >\n <AlertTitle>\n <span style={visuallyHidden}>{severity}:</span>\n {text}\n </AlertTitle>\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\">\n {linkText}\n </Link>\n )}\n </Alert>\n </Snackbar>\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;AAE9D,SAASC,cAAc,QAAQ,YAAY;AAAC,SACnCC,IAAI;AAAA,SACJC,SAAS;AAAA,SACTC,MAAM;AACf,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE/C,OAAO,MAAMC,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAC3D,OAAO,MAAMC,mBAAmB,GAAG,CACjC,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACC;AA+CV,MAAMC,sBAAsB,GAAG;EAAEC,WAAW,EAAEA,CAAA,KAAM;AAAM,CAAC;AAE3D,MAAMC,KAAK,GAAGC,IAAA,IAUI;EAAA,IAVH;IACbC,gBAAgB,GAAG,IAAI;IACvBC,aAAa;IACbC,QAAQ;IACRC,OAAO;IACPC,SAAS,EAAEC,aAAa;IACxBC,MAAM,EAAEC,UAAU;IAClBC,IAAI;IACJC,QAAQ;IACRC;EACU,CAAC,GAAAX,IAAA;EACX,MAAM;IAAEY;EAAE,CAAC,GAAGtB,cAAc,CAAC,CAAC;EAE9B,MAAM,CAACe,SAAS,EAAEQ,YAAY,CAAC,GAAG7B,QAAQ,CAACsB,aAAa,CAAC;EAEzDxB,SAAS,CAAC,MAAM;IACd+B,YAAY,CAACP,aAAa,CAAC;EAC7B,CAAC,EAAE,CAACA,aAAa,CAAC,CAAC;EAEnB,MAAMC,MAAM,GAAGtB,WAAW,CAAC,MAAM;IAC/B4B,YAAY,CAAC,KAAK,CAAC;IACnBL,UAAU,GAAG,CAAC;EAChB,CAAC,EAAE,CAACA,UAAU,CAAC,CAAC;EAEhB,OACEhB,IAAA,CAAAsB,SAAA;IACEC,IAAI,EAAEV,SAAU;IAChBJ,gBAAgB,EACdC,aAAa,IAAID,gBAAgB,IAAI,CAAC,GAAGe,SAAS,GAAGf,gBACtD;IACDgB,OAAO,EAAEV,MAAO;IAChBW,SAAS,EAAC,OAAO;IACjBrB,sBAAsB,EAAEA,sBAAuB;IAAAsB,QAAA,EAE/CzB,KAAA,CAAA0B,MAAA;MACEC,MAAM,EACJnB,aAAa,KAAK,IAAI,IACpBV,IAAA,CAACH,MAAM;QACLiC,SAAS,EAAEV,CAAC,CAAC,kBAAkB,CAAE;QACjCW,OAAO,EAAEhB,MAAO;QAChBiB,IAAI,EAAC,OAAO;QACZC,SAAS,EAAEjC,IAAA,CAACJ,SAAS,IAAE,CAAE;QACzBsC,OAAO,EAAC;MAAU,CACnB,CAEJ;MACDjB,IAAI,EAAEA,IAAK;MACXC,QAAQ,EAAEA,QAAS;MACnBgB,OAAO,EAAC,OAAO;MAAAP,QAAA,GAEfzB,KAAA,CAAAiC,WAAA;QAAAR,QAAA,GACEzB,KAAA;UAAMkC,KAAK,EAAE1C,cAAe;UAAAiC,QAAA,GAAET,QAAQ,EAAC,GAAC;QAAA,CAAM,CAAC,EAC9CC,IAAI;MAAA,CACK,CAAC,EACZP,OAAO,IACNZ,IAAA,CAACL,IAAI;QAAC0C,IAAI,EAAEzB,OAAQ;QAACsB,OAAO,EAAC,YAAY;QAAAP,QAAA,EACtChB;MAAQ,CACL,CACP;IAAA,CACI;EAAC,CACA,CAAC;AAEf,CAAC;AAED,MAAM2B,aAAa,GAAG/C,IAAI,CAACgB,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","visuallyHidden","Link","CloseIcon","Button","useTranslation","jsx","_jsx","jsxs","_jsxs","toastRoleValues","toastSeverityValues","ClickAwayListenerProps","onClickAway","Toast","_ref","autoHideDuration","isDismissable","linkText","linkUrl","isVisible","isVisibleProp","onHide","onHideProp","role","severity","testId","text","t","setIsVisible","_Snackbar","open","undefined","onClose","className","children","_Alert","action","ariaLabel","onClick","size","startIcon","variant","_AlertTitle","style","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 { Alert, AlertTitle, Snackbar } from \"@mui/material\";\nimport { visuallyHidden } from \"@mui/utils\";\nimport { Link } from \"./Link\";\nimport { CloseIcon } from \"./icons.generated\";\nimport { Button } from \"./Button\";\nimport { useTranslation } from \"react-i18next\";\nimport { SeleniumProps } from \"./SeleniumProps\";\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} & SeleniumProps;\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}: ToastProps) => {\n const { t } = useTranslation();\n\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 <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(\"toast.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>\n <span style={visuallyHidden}>{severity}:</span>\n {text}\n </AlertTitle>\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\">\n {linkText}\n </Link>\n )}\n </Alert>\n </Snackbar>\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;AAE9D,SAASC,cAAc,QAAQ,YAAY;AAAC,SACnCC,IAAI;AAAA,SACJC,SAAS;AAAA,SACTC,MAAM;AACf,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAG/C,OAAO,MAAMC,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAC3D,OAAO,MAAMC,mBAAmB,GAAG,CACjC,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACC;AA+CV,MAAMC,sBAAsB,GAAG;EAAEC,WAAW,EAAEA,CAAA,KAAM;AAAM,CAAC;AAE3D,MAAMC,KAAK,GAAGC,IAAA,IAWI;EAAA,IAXH;IACbC,gBAAgB,GAAG,IAAI;IACvBC,aAAa;IACbC,QAAQ;IACRC,OAAO;IACPC,SAAS,EAAEC,aAAa;IACxBC,MAAM,EAAEC,UAAU;IAClBC,IAAI;IACJC,QAAQ;IACRC,MAAM;IACNC;EACU,CAAC,GAAAZ,IAAA;EACX,MAAM;IAAEa;EAAE,CAAC,GAAGvB,cAAc,CAAC,CAAC;EAE9B,MAAM,CAACe,SAAS,EAAES,YAAY,CAAC,GAAG9B,QAAQ,CAACsB,aAAa,CAAC;EAEzDxB,SAAS,CAAC,MAAM;IACdgC,YAAY,CAACR,aAAa,CAAC;EAC7B,CAAC,EAAE,CAACA,aAAa,CAAC,CAAC;EAEnB,MAAMC,MAAM,GAAGtB,WAAW,CAAC,MAAM;IAC/B6B,YAAY,CAAC,KAAK,CAAC;IACnBN,UAAU,GAAG,CAAC;EAChB,CAAC,EAAE,CAACA,UAAU,CAAC,CAAC;EAEhB,OACEhB,IAAA,CAAAuB,SAAA;IACEC,IAAI,EAAEX,SAAU;IAChBJ,gBAAgB,EACdC,aAAa,IAAID,gBAAgB,IAAI,CAAC,GAAGgB,SAAS,GAAGhB,gBACtD;IACDiB,OAAO,EAAEX,MAAO;IAChBY,SAAS,EAAC,OAAO;IACjBtB,sBAAsB,EAAEA,sBAAuB;IAAAuB,QAAA,EAE/C1B,KAAA,CAAA2B,MAAA;MACEC,MAAM,EACJpB,aAAa,KAAK,IAAI,IACpBV,IAAA,CAACH,MAAM;QACLkC,SAAS,EAAEV,CAAC,CAAC,kBAAkB,CAAE;QACjCW,OAAO,EAAEjB,MAAO;QAChBkB,IAAI,EAAC,OAAO;QACZC,SAAS,EAAElC,IAAA,CAACJ,SAAS,IAAE,CAAE;QACzBuC,OAAO,EAAC;MAAU,CACnB,CAEJ;MACD,WAAShB,MAAO;MAChBF,IAAI,EAAEA,IAAK;MACXC,QAAQ,EAAEA,QAAS;MACnBiB,OAAO,EAAC,OAAO;MAAAP,QAAA,GAEf1B,KAAA,CAAAkC,WAAA;QAAAR,QAAA,GACE1B,KAAA;UAAMmC,KAAK,EAAE3C,cAAe;UAAAkC,QAAA,GAAEV,QAAQ,EAAC,GAAC;QAAA,CAAM,CAAC,EAC9CE,IAAI;MAAA,CACK,CAAC,EACZR,OAAO,IACNZ,IAAA,CAACL,IAAI;QAAC2C,IAAI,EAAE1B,OAAQ;QAACuB,OAAO,EAAC,YAAY;QAAAP,QAAA,EACtCjB;MAAQ,CACL,CACP;IAAA,CACI;EAAC,CACA,CAAC;AAEf,CAAC;AAED,MAAM4B,aAAa,GAAGhD,IAAI,CAACgB,KAAK,CAAC;AACjCgC,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAIhC,KAAK"}
package/dist/Tooltip.js CHANGED
@@ -17,9 +17,11 @@ export const Tooltip = _ref => {
17
17
  ariaType,
18
18
  children,
19
19
  placement = "top",
20
+ testId,
20
21
  text
21
22
  } = _ref;
22
23
  return _jsx(_Tooltip, {
24
+ "data-se": testId,
23
25
  describeChild: ariaType === "description",
24
26
  placement: placement,
25
27
  title: text,
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","names":["MuiPropsChild","jsx","_jsx","Tooltip","_ref","ariaType","children","placement","text","_Tooltip","describeChild","title"],"sources":["../src/Tooltip.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 { Tooltip as MuiTooltip } from \"@mui/material\";\nimport type { TooltipProps as MuiTooltipProps } from \"@mui/material\";\n\nimport { MuiPropsChild } from \"./MuiPropsChild\";\nimport { ReactElement } from \"react\";\n\nexport type TooltipProps = {\n /**\n * The type of ARIA attribute to use\n */\n ariaType: \"description\" | \"label\";\n /**\n * The content that triggers the Tooltip when hovered\n */\n children: ReactElement;\n /**\n * The placement of the Tooltip\n */\n placement?: MuiTooltipProps[\"placement\"];\n /**\n * The text to display in the Tooltip\n */\n text: string;\n};\n\nexport const Tooltip = ({\n ariaType,\n children,\n placement = \"top\",\n text,\n}: TooltipProps) => (\n <MuiTooltip\n describeChild={ariaType === \"description\"}\n placement={placement}\n title={text}\n >\n <MuiPropsChild>{children}</MuiPropsChild>\n </MuiTooltip>\n);\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAeSA,aAAa;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAsBtB,OAAO,MAAMC,OAAO,GAAGC,IAAA;EAAA,IAAC;IACtBC,QAAQ;IACRC,QAAQ;IACRC,SAAS,GAAG,KAAK;IACjBC;EACY,CAAC,GAAAJ,IAAA;EAAA,OACbF,IAAA,CAAAO,QAAA;IACEC,aAAa,EAAEL,QAAQ,KAAK,aAAc;IAC1CE,SAAS,EAAEA,SAAU;IACrBI,KAAK,EAAEH,IAAK;IAAAF,QAAA,EAEZJ,IAAA,CAACF,aAAa;MAAAM,QAAA,EAAEA;IAAQ,CAAgB;EAAC,CAC/B,CAAC;AAAA,CACd"}
1
+ {"version":3,"file":"Tooltip.js","names":["MuiPropsChild","jsx","_jsx","Tooltip","_ref","ariaType","children","placement","testId","text","_Tooltip","describeChild","title"],"sources":["../src/Tooltip.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 { Tooltip as MuiTooltip } from \"@mui/material\";\nimport type { TooltipProps as MuiTooltipProps } from \"@mui/material\";\n\nimport { MuiPropsChild } from \"./MuiPropsChild\";\nimport { ReactElement } from \"react\";\nimport { SeleniumProps } from \"./SeleniumProps\";\n\nexport type TooltipProps = {\n /**\n * The type of ARIA attribute to use\n */\n ariaType: \"description\" | \"label\";\n /**\n * The content that triggers the Tooltip when hovered\n */\n children: ReactElement;\n /**\n * The placement of the Tooltip\n */\n placement?: MuiTooltipProps[\"placement\"];\n /**\n * The text to display in the Tooltip\n */\n text: string;\n} & SeleniumProps;\n\nexport const Tooltip = ({\n ariaType,\n children,\n placement = \"top\",\n testId,\n text,\n}: TooltipProps) => (\n <MuiTooltip\n data-se={testId}\n describeChild={ariaType === \"description\"}\n placement={placement}\n title={text}\n >\n <MuiPropsChild>{children}</MuiPropsChild>\n </MuiTooltip>\n);\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAeSA,aAAa;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAuBtB,OAAO,MAAMC,OAAO,GAAGC,IAAA;EAAA,IAAC;IACtBC,QAAQ;IACRC,QAAQ;IACRC,SAAS,GAAG,KAAK;IACjBC,MAAM;IACNC;EACY,CAAC,GAAAL,IAAA;EAAA,OACbF,IAAA,CAAAQ,QAAA;IACE,WAASF,MAAO;IAChBG,aAAa,EAAEN,QAAQ,KAAK,aAAc;IAC1CE,SAAS,EAAEA,SAAU;IACrBK,KAAK,EAAEH,IAAK;IAAAH,QAAA,EAEZJ,IAAA,CAACF,aAAa;MAAAM,QAAA,EAAEA;IAAQ,CAAgB;EAAC,CAC/B,CAAC;AAAA,CACd"}
@@ -10,7 +10,7 @@ import _Typography from "@mui/material/Typography";
10
10
  *
11
11
  * See the License for the specific language governing permissions and limitations under the License.
12
12
  */
13
- import { useMemo } from "react";
13
+ import { memo, useMemo } from "react";
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  export const typographyVariantMapping = {
16
16
  h1: "h1",
@@ -25,7 +25,7 @@ export const typographyVariantMapping = {
25
25
  legend: "legend"
26
26
  };
27
27
  export const typographyColorValues = ["primary", "textPrimary", "secondary", "textSecondary", "error"];
28
- export const Typography = _ref => {
28
+ const Typography = _ref => {
29
29
  let {
30
30
  ariaDescribedBy,
31
31
  ariaLabel,
@@ -34,6 +34,7 @@ export const Typography = _ref => {
34
34
  classes,
35
35
  color,
36
36
  component: componentProp,
37
+ testId,
37
38
  variant = "body"
38
39
  } = _ref;
39
40
  const component = useMemo(() => {
@@ -41,7 +42,7 @@ export const Typography = _ref => {
41
42
  if (variant === "body") {
42
43
  return "p";
43
44
  } else if (variant === "subordinate" || variant === "support") {
44
- return "h6";
45
+ return "p";
45
46
  } else {
46
47
  return variant;
47
48
  }
@@ -49,18 +50,20 @@ export const Typography = _ref => {
49
50
  return componentProp;
50
51
  }, [componentProp, variant]);
51
52
  return _jsx(_Typography, {
52
- ariaDescribedBy: ariaDescribedBy,
53
- ariaLabel: ariaLabel,
54
- ariaLabelledBy: ariaLabelledBy,
53
+ "aria-describedby": ariaDescribedBy,
54
+ "aria-label": ariaLabel,
55
+ "aria-labelledby": ariaLabelledBy,
55
56
  children: children,
56
57
  classes: classes,
57
58
  color: color,
58
59
  component: component,
60
+ "data-se": testId,
59
61
  variant: typographyVariantMapping[variant]
60
62
  });
61
63
  };
62
- Typography.displayName = "Typography";
63
- export const Heading1 = _ref2 => {
64
+ const MemoizedTypography = memo(Typography);
65
+ MemoizedTypography.displayName = "Typography";
66
+ const Heading1 = _ref2 => {
64
67
  let {
65
68
  ariaDescribedBy,
66
69
  ariaLabel,
@@ -68,7 +71,8 @@ export const Heading1 = _ref2 => {
68
71
  children,
69
72
  classes,
70
73
  color,
71
- component
74
+ component,
75
+ testId
72
76
  } = _ref2;
73
77
  return _jsx(Typography, {
74
78
  ariaDescribedBy: ariaDescribedBy,
@@ -78,11 +82,13 @@ export const Heading1 = _ref2 => {
78
82
  classes: classes,
79
83
  color: color,
80
84
  component: component,
85
+ "data-se": testId,
81
86
  variant: "h1"
82
87
  });
83
88
  };
84
- Heading1.displayName = "Heading1";
85
- export const Heading2 = _ref3 => {
89
+ const MemoizedHeading1 = memo(Heading1);
90
+ MemoizedHeading1.displayName = "Heading1";
91
+ const Heading2 = _ref3 => {
86
92
  let {
87
93
  ariaDescribedBy,
88
94
  ariaLabel,
@@ -90,7 +96,8 @@ export const Heading2 = _ref3 => {
90
96
  children,
91
97
  classes,
92
98
  color,
93
- component
99
+ component,
100
+ testId
94
101
  } = _ref3;
95
102
  return _jsx(Typography, {
96
103
  ariaDescribedBy: ariaDescribedBy,
@@ -100,11 +107,13 @@ export const Heading2 = _ref3 => {
100
107
  classes: classes,
101
108
  color: color,
102
109
  component: component,
110
+ "data-se": testId,
103
111
  variant: "h2"
104
112
  });
105
113
  };
106
- Heading2.displayName = "Heading2";
107
- export const Heading3 = _ref4 => {
114
+ const MemoizedHeading2 = memo(Heading2);
115
+ MemoizedHeading2.displayName = "Heading2";
116
+ const Heading3 = _ref4 => {
108
117
  let {
109
118
  ariaDescribedBy,
110
119
  ariaLabel,
@@ -112,7 +121,8 @@ export const Heading3 = _ref4 => {
112
121
  children,
113
122
  classes,
114
123
  color,
115
- component
124
+ component,
125
+ testId
116
126
  } = _ref4;
117
127
  return _jsx(Typography, {
118
128
  ariaDescribedBy: ariaDescribedBy,
@@ -122,11 +132,13 @@ export const Heading3 = _ref4 => {
122
132
  classes: classes,
123
133
  color: color,
124
134
  component: component,
135
+ "data-se": testId,
125
136
  variant: "h3"
126
137
  });
127
138
  };
128
- Heading3.displayName = "Heading3";
129
- export const Heading4 = _ref5 => {
139
+ const MemoizedHeading3 = memo(Heading3);
140
+ MemoizedHeading3.displayName = "Heading3";
141
+ const Heading4 = _ref5 => {
130
142
  let {
131
143
  ariaDescribedBy,
132
144
  ariaLabel,
@@ -134,7 +146,8 @@ export const Heading4 = _ref5 => {
134
146
  children,
135
147
  classes,
136
148
  color,
137
- component
149
+ component,
150
+ testId
138
151
  } = _ref5;
139
152
  return _jsx(Typography, {
140
153
  ariaDescribedBy: ariaDescribedBy,
@@ -144,11 +157,13 @@ export const Heading4 = _ref5 => {
144
157
  classes: classes,
145
158
  color: color,
146
159
  component: component,
160
+ "data-se": testId,
147
161
  variant: "h4"
148
162
  });
149
163
  };
150
- Heading4.displayName = "Heading4";
151
- export const Heading5 = _ref6 => {
164
+ const MemoizedHeading4 = memo(Heading4);
165
+ MemoizedHeading4.displayName = "Heading4";
166
+ const Heading5 = _ref6 => {
152
167
  let {
153
168
  ariaDescribedBy,
154
169
  ariaLabel,
@@ -156,7 +171,8 @@ export const Heading5 = _ref6 => {
156
171
  children,
157
172
  classes,
158
173
  color,
159
- component
174
+ component,
175
+ testId
160
176
  } = _ref6;
161
177
  return _jsx(Typography, {
162
178
  ariaDescribedBy: ariaDescribedBy,
@@ -166,11 +182,13 @@ export const Heading5 = _ref6 => {
166
182
  classes: classes,
167
183
  color: color,
168
184
  component: component,
185
+ "data-se": testId,
169
186
  variant: "h5"
170
187
  });
171
188
  };
172
- Heading5.displayName = "Heading5";
173
- export const Heading6 = _ref7 => {
189
+ const MemoizedHeading5 = memo(Heading5);
190
+ MemoizedHeading5.displayName = "Heading5";
191
+ const Heading6 = _ref7 => {
174
192
  let {
175
193
  ariaDescribedBy,
176
194
  ariaLabel,
@@ -178,7 +196,8 @@ export const Heading6 = _ref7 => {
178
196
  children,
179
197
  classes,
180
198
  color,
181
- component
199
+ component,
200
+ testId
182
201
  } = _ref7;
183
202
  return _jsx(Typography, {
184
203
  ariaDescribedBy: ariaDescribedBy,
@@ -188,11 +207,13 @@ export const Heading6 = _ref7 => {
188
207
  classes: classes,
189
208
  color: color,
190
209
  component: component,
210
+ "data-se": testId,
191
211
  variant: "h6"
192
212
  });
193
213
  };
194
- Heading6.displayName = "Heading6";
195
- export const Paragraph = _ref8 => {
214
+ const MemoizedHeading6 = memo(Heading6);
215
+ MemoizedHeading6.displayName = "Heading6";
216
+ const Paragraph = _ref8 => {
196
217
  let {
197
218
  ariaDescribedBy,
198
219
  ariaLabel,
@@ -200,7 +221,8 @@ export const Paragraph = _ref8 => {
200
221
  children,
201
222
  classes,
202
223
  color,
203
- component
224
+ component,
225
+ testId
204
226
  } = _ref8;
205
227
  return _jsx(Typography, {
206
228
  ariaDescribedBy: ariaDescribedBy,
@@ -210,11 +232,13 @@ export const Paragraph = _ref8 => {
210
232
  classes: classes,
211
233
  color: color,
212
234
  component: component,
235
+ "data-se": testId,
213
236
  variant: "body"
214
237
  });
215
238
  };
216
- Paragraph.displayName = "Paragraph";
217
- export const Subordinate = _ref9 => {
239
+ const MemoizedParagraph = memo(Paragraph);
240
+ MemoizedParagraph.displayName = "Paragraph";
241
+ const Subordinate = _ref9 => {
218
242
  let {
219
243
  ariaDescribedBy,
220
244
  ariaLabel,
@@ -222,7 +246,8 @@ export const Subordinate = _ref9 => {
222
246
  children,
223
247
  classes,
224
248
  color,
225
- component
249
+ component,
250
+ testId
226
251
  } = _ref9;
227
252
  return _jsx(Typography, {
228
253
  ariaDescribedBy: ariaDescribedBy,
@@ -232,11 +257,13 @@ export const Subordinate = _ref9 => {
232
257
  classes: classes,
233
258
  color: color,
234
259
  component: component,
260
+ "data-se": testId,
235
261
  variant: "subordinate"
236
262
  });
237
263
  };
238
- Subordinate.displayName = "Subordinate";
239
- export const Support = _ref10 => {
264
+ const MemoizedSubordinate = memo(Subordinate);
265
+ MemoizedSubordinate.displayName = "Subordinate";
266
+ const Support = _ref10 => {
240
267
  let {
241
268
  ariaDescribedBy,
242
269
  ariaLabel,
@@ -244,7 +271,8 @@ export const Support = _ref10 => {
244
271
  children,
245
272
  classes,
246
273
  color,
247
- component
274
+ component,
275
+ testId
248
276
  } = _ref10;
249
277
  return _jsx(Typography, {
250
278
  ariaDescribedBy: ariaDescribedBy,
@@ -254,11 +282,13 @@ export const Support = _ref10 => {
254
282
  classes: classes,
255
283
  color: color,
256
284
  component: component,
285
+ "data-se": testId,
257
286
  variant: "support"
258
287
  });
259
288
  };
260
- Support.displayName = "Support";
261
- export const Legend = _ref11 => {
289
+ const MemoizedSupport = memo(Support);
290
+ MemoizedSupport.displayName = "Support";
291
+ const Legend = _ref11 => {
262
292
  let {
263
293
  ariaDescribedBy,
264
294
  ariaLabel,
@@ -266,7 +296,8 @@ export const Legend = _ref11 => {
266
296
  children,
267
297
  classes,
268
298
  color,
269
- component
299
+ component,
300
+ testId
270
301
  } = _ref11;
271
302
  return _jsx(Typography, {
272
303
  ariaDescribedBy: ariaDescribedBy,
@@ -276,8 +307,11 @@ export const Legend = _ref11 => {
276
307
  classes: classes,
277
308
  color: color,
278
309
  component: component,
310
+ "data-se": testId,
279
311
  variant: "legend"
280
312
  });
281
313
  };
282
- Legend.displayName = "Legend";
314
+ const MemoizedLegend = memo(Legend);
315
+ MemoizedLegend.displayName = "Legend";
316
+ export { MemoizedTypography as Typography, MemoizedHeading1 as Heading1, MemoizedHeading2 as Heading2, MemoizedHeading3 as Heading3, MemoizedHeading4 as Heading4, MemoizedHeading5 as Heading5, MemoizedHeading6 as Heading6, MemoizedLegend as Legend, MemoizedParagraph as Paragraph, MemoizedSubordinate as Subordinate, MemoizedSupport as Support };
283
317
  //# sourceMappingURL=Typography.js.map