@okta/odyssey-react-mui 0.21.4 → 0.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.
- package/CHANGELOG.md +41 -0
- package/dist/Autocomplete.js +62 -0
- package/dist/Autocomplete.js.map +1 -0
- package/dist/Banner.js +3 -3
- package/dist/Banner.js.map +1 -1
- package/dist/Button.js +46 -0
- package/dist/Button.js.map +1 -0
- package/dist/CheckboxGroup.js +23 -35
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/Dialog.js +68 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/Field.js +72 -0
- package/dist/Field.js.map +1 -0
- package/dist/FieldError.js +34 -0
- package/dist/FieldError.js.map +1 -0
- package/dist/FieldHint.js +29 -0
- package/dist/FieldHint.js.map +1 -0
- package/dist/FieldLabel.js +32 -0
- package/dist/FieldLabel.js.map +1 -0
- package/dist/Icon.js +7 -6
- package/dist/Icon.js.map +1 -1
- package/dist/Infobox.js +1 -1
- package/dist/Infobox.js.map +1 -1
- package/dist/Link.js +5 -2
- package/dist/Link.js.map +1 -1
- package/dist/MenuButton.js +5 -4
- package/dist/MenuButton.js.map +1 -1
- package/dist/MenuItem.js +0 -1
- package/dist/MenuItem.js.map +1 -1
- package/dist/MuiPropsChild.js +30 -0
- package/dist/MuiPropsChild.js.map +1 -0
- package/dist/MuiPropsContext.js +14 -0
- package/dist/MuiPropsContext.js.map +1 -0
- package/dist/PasswordField.js +73 -0
- package/dist/PasswordField.js.map +1 -0
- package/dist/RadioGroup.js +25 -26
- package/dist/RadioGroup.js.map +1 -1
- package/dist/SearchField.js +56 -0
- package/dist/SearchField.js.map +1 -0
- package/dist/Status.js.map +1 -1
- package/dist/Tag.js +28 -0
- package/dist/Tag.js.map +1 -0
- package/dist/TagList.js +26 -0
- package/dist/TagList.js.map +1 -0
- package/dist/TagListContext.js +16 -0
- package/dist/TagListContext.js.map +1 -0
- package/dist/TextField.js +36 -62
- package/dist/TextField.js.map +1 -1
- package/dist/Toast.js +72 -0
- package/dist/Toast.js.map +1 -0
- package/dist/ToastStack.js +33 -0
- package/dist/ToastStack.js.map +1 -0
- package/dist/Tooltip.js +20 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/iconDictionary/Add.js +4 -4
- package/dist/iconDictionary/Add.js.map +1 -1
- package/dist/iconDictionary/AddCircle.js +4 -4
- package/dist/iconDictionary/AddCircle.js.map +1 -1
- package/dist/iconDictionary/AlertCircle.js +4 -4
- package/dist/iconDictionary/AlertCircle.js.map +1 -1
- package/dist/iconDictionary/AlertCircleFilled.js +4 -4
- package/dist/iconDictionary/AlertCircleFilled.js.map +1 -1
- package/dist/iconDictionary/AlertTriangleFilled.js +4 -4
- package/dist/iconDictionary/AlertTriangleFilled.js.map +1 -1
- package/dist/iconDictionary/Anchor.js +5 -5
- package/dist/iconDictionary/Anchor.js.map +1 -1
- package/dist/iconDictionary/ArrowDown.js +4 -4
- package/dist/iconDictionary/ArrowDown.js.map +1 -1
- package/dist/iconDictionary/ArrowLeft.js +4 -4
- package/dist/iconDictionary/ArrowLeft.js.map +1 -1
- package/dist/iconDictionary/ArrowRight.js +4 -4
- package/dist/iconDictionary/ArrowRight.js.map +1 -1
- package/dist/iconDictionary/ArrowUp.js +4 -4
- package/dist/iconDictionary/ArrowUp.js.map +1 -1
- package/dist/iconDictionary/ArrowUpDown.js +4 -4
- package/dist/iconDictionary/ArrowUpDown.js.map +1 -1
- package/dist/iconDictionary/Calendar.js +4 -4
- package/dist/iconDictionary/Calendar.js.map +1 -1
- package/dist/iconDictionary/Check.js +4 -4
- package/dist/iconDictionary/Check.js.map +1 -1
- package/dist/iconDictionary/CheckCircleFilled.js +4 -4
- package/dist/iconDictionary/CheckCircleFilled.js.map +1 -1
- package/dist/iconDictionary/ChevronDown.js +4 -4
- package/dist/iconDictionary/ChevronDown.js.map +1 -1
- package/dist/iconDictionary/ChevronUp.js +4 -4
- package/dist/iconDictionary/ChevronUp.js.map +1 -1
- package/dist/iconDictionary/Close.js +4 -4
- package/dist/iconDictionary/Close.js.map +1 -1
- package/dist/iconDictionary/CloseCircleFilled.js +4 -4
- package/dist/iconDictionary/CloseCircleFilled.js.map +1 -1
- package/dist/iconDictionary/Copy.js +4 -4
- package/dist/iconDictionary/Copy.js.map +1 -1
- package/dist/iconDictionary/Delete.js +4 -4
- package/dist/iconDictionary/Delete.js.map +1 -1
- package/dist/iconDictionary/Download.js +4 -4
- package/dist/iconDictionary/Download.js.map +1 -1
- package/dist/iconDictionary/DragHandle.js +4 -4
- package/dist/iconDictionary/DragHandle.js.map +1 -1
- package/dist/iconDictionary/Edit.js +4 -4
- package/dist/iconDictionary/Edit.js.map +1 -1
- package/dist/iconDictionary/ExternalLink.js +4 -4
- package/dist/iconDictionary/ExternalLink.js.map +1 -1
- package/dist/iconDictionary/Eye.js +4 -4
- package/dist/iconDictionary/Eye.js.map +1 -1
- package/dist/iconDictionary/EyeOff.js +4 -4
- package/dist/iconDictionary/EyeOff.js.map +1 -1
- package/dist/iconDictionary/Filter.js +4 -4
- package/dist/iconDictionary/Filter.js.map +1 -1
- package/dist/iconDictionary/Globe.js +4 -4
- package/dist/iconDictionary/Globe.js.map +1 -1
- package/dist/iconDictionary/Home.js +4 -4
- package/dist/iconDictionary/Home.js.map +1 -1
- package/dist/iconDictionary/InformationCircle.js +4 -4
- package/dist/iconDictionary/InformationCircle.js.map +1 -1
- package/dist/iconDictionary/InformationCircleFilled.js +4 -4
- package/dist/iconDictionary/InformationCircleFilled.js.map +1 -1
- package/dist/iconDictionary/Notification.js +4 -4
- package/dist/iconDictionary/Notification.js.map +1 -1
- package/dist/iconDictionary/OverflowVertical.js +4 -4
- package/dist/iconDictionary/OverflowVertical.js.map +1 -1
- package/dist/iconDictionary/QuestionCircle.js +4 -4
- package/dist/iconDictionary/QuestionCircle.js.map +1 -1
- package/dist/iconDictionary/QuestionCircleFilled.js +4 -4
- package/dist/iconDictionary/QuestionCircleFilled.js.map +1 -1
- package/dist/iconDictionary/Search.js +4 -4
- package/dist/iconDictionary/Search.js.map +1 -1
- package/dist/iconDictionary/Settings.js +3 -3
- package/dist/iconDictionary/Settings.js.map +1 -1
- package/dist/iconDictionary/Subtract.js +4 -4
- package/dist/iconDictionary/Subtract.js.map +1 -1
- package/dist/iconDictionary/User.js +4 -4
- package/dist/iconDictionary/User.js.map +1 -1
- package/dist/iconDictionary/UserGroup.js +4 -4
- package/dist/iconDictionary/UserGroup.js.map +1 -1
- package/dist/iconDictionary/index.js.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/src/Autocomplete.d.ts +28 -0
- package/dist/src/Autocomplete.d.ts.map +1 -0
- package/dist/src/Banner.d.ts +19 -19
- package/dist/src/Banner.d.ts.map +1 -1
- package/dist/src/Button.d.ts +32 -0
- package/dist/src/Button.d.ts.map +1 -0
- package/dist/src/CheckboxGroup.d.ts +7 -4
- package/dist/src/CheckboxGroup.d.ts.map +1 -1
- package/dist/src/Dialog.d.ts +25 -0
- package/dist/src/Dialog.d.ts.map +1 -0
- package/dist/src/Field.d.ts +65 -0
- package/dist/src/Field.d.ts.map +1 -0
- package/dist/src/FieldError.d.ts +19 -0
- package/dist/src/FieldError.d.ts.map +1 -0
- package/dist/src/FieldHint.d.ts +19 -0
- package/dist/src/FieldHint.d.ts.map +1 -0
- package/dist/src/FieldLabel.d.ts +23 -0
- package/dist/src/FieldLabel.d.ts.map +1 -0
- package/dist/src/Icon.d.ts +6 -7
- package/dist/src/Icon.d.ts.map +1 -1
- package/dist/src/Infobox.d.ts +7 -7
- package/dist/src/Infobox.d.ts.map +1 -1
- package/dist/src/Link.d.ts +9 -4
- package/dist/src/Link.d.ts.map +1 -1
- package/dist/src/MenuButton.d.ts +7 -3
- package/dist/src/MenuButton.d.ts.map +1 -1
- package/dist/src/MenuItem.d.ts +1 -1
- package/dist/src/MenuItem.d.ts.map +1 -1
- package/dist/src/MuiPropsChild.d.ts +18 -0
- package/dist/src/MuiPropsChild.d.ts.map +1 -0
- package/dist/src/MuiPropsContext.d.ts +15 -0
- package/dist/src/MuiPropsContext.d.ts.map +1 -0
- package/dist/src/PasswordField.d.ts +75 -0
- package/dist/src/PasswordField.d.ts.map +1 -0
- package/dist/src/RadioGroup.d.ts +8 -8
- package/dist/src/RadioGroup.d.ts.map +1 -1
- package/dist/src/SearchField.d.ts +59 -0
- package/dist/src/SearchField.d.ts.map +1 -0
- package/dist/src/Status.d.ts +2 -2
- package/dist/src/Status.d.ts.map +1 -1
- package/dist/src/Tag.d.ts +22 -0
- package/dist/src/Tag.d.ts.map +1 -0
- package/dist/src/TagList.d.ts +19 -0
- package/dist/src/TagList.d.ts.map +1 -0
- package/dist/src/TagListContext.d.ts +18 -0
- package/dist/src/TagListContext.d.ts.map +1 -0
- package/dist/src/TextField.d.ts +16 -20
- package/dist/src/TextField.d.ts.map +1 -1
- package/dist/src/Toast.d.ts +60 -0
- package/dist/src/Toast.d.ts.map +1 -0
- package/dist/src/ToastStack.d.ts +19 -0
- package/dist/src/ToastStack.d.ts.map +1 -0
- package/dist/src/Tooltip.d.ts +21 -0
- package/dist/src/Tooltip.d.ts.map +1 -0
- package/dist/src/iconDictionary/Add.d.ts +2 -2
- package/dist/src/iconDictionary/AddCircle.d.ts +2 -2
- package/dist/src/iconDictionary/AlertCircle.d.ts +2 -2
- package/dist/src/iconDictionary/AlertCircleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/AlertTriangleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/Anchor.d.ts +2 -2
- package/dist/src/iconDictionary/ArrowDown.d.ts +2 -2
- package/dist/src/iconDictionary/ArrowLeft.d.ts +2 -2
- package/dist/src/iconDictionary/ArrowRight.d.ts +2 -2
- package/dist/src/iconDictionary/ArrowUp.d.ts +2 -2
- package/dist/src/iconDictionary/ArrowUpDown.d.ts +2 -2
- package/dist/src/iconDictionary/Calendar.d.ts +2 -2
- package/dist/src/iconDictionary/Check.d.ts +2 -2
- package/dist/src/iconDictionary/CheckCircleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/ChevronDown.d.ts +2 -2
- package/dist/src/iconDictionary/ChevronUp.d.ts +2 -2
- package/dist/src/iconDictionary/Close.d.ts +2 -2
- package/dist/src/iconDictionary/CloseCircleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/Copy.d.ts +2 -2
- package/dist/src/iconDictionary/Delete.d.ts +2 -2
- package/dist/src/iconDictionary/Download.d.ts +2 -2
- package/dist/src/iconDictionary/DragHandle.d.ts +2 -2
- package/dist/src/iconDictionary/Edit.d.ts +2 -2
- package/dist/src/iconDictionary/ExternalLink.d.ts +2 -2
- package/dist/src/iconDictionary/Eye.d.ts +2 -2
- package/dist/src/iconDictionary/EyeOff.d.ts +2 -2
- package/dist/src/iconDictionary/Filter.d.ts +2 -2
- package/dist/src/iconDictionary/Globe.d.ts +2 -2
- package/dist/src/iconDictionary/Home.d.ts +2 -2
- package/dist/src/iconDictionary/InformationCircle.d.ts +2 -2
- package/dist/src/iconDictionary/InformationCircleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/Notification.d.ts +2 -2
- package/dist/src/iconDictionary/OverflowVertical.d.ts +2 -2
- package/dist/src/iconDictionary/QuestionCircle.d.ts +2 -2
- package/dist/src/iconDictionary/QuestionCircleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/Search.d.ts +2 -2
- package/dist/src/iconDictionary/Settings.d.ts +2 -2
- package/dist/src/iconDictionary/Subtract.d.ts +2 -2
- package/dist/src/iconDictionary/User.d.ts +2 -2
- package/dist/src/iconDictionary/UserGroup.d.ts +2 -2
- package/dist/src/iconDictionary/index.d.ts +40 -40
- package/dist/src/index.d.ts +14 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/theme/components.d.ts.map +1 -1
- package/dist/src/theme/components.types.d.ts +0 -8
- package/dist/src/theme/components.types.d.ts.map +1 -1
- package/dist/theme/components.js +249 -136
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/components.types.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Autocomplete.tsx +141 -0
- package/src/Banner.tsx +21 -21
- package/src/Button.tsx +95 -0
- package/src/CheckboxGroup.tsx +27 -34
- package/src/Dialog.tsx +110 -0
- package/src/Field.tsx +135 -0
- package/src/FieldError.tsx +34 -0
- package/src/FieldHint.tsx +28 -0
- package/src/FieldLabel.tsx +57 -0
- package/src/Icon.test.tsx +1 -1
- package/src/Icon.tsx +24 -7
- package/src/Infobox.tsx +7 -7
- package/src/Link.tsx +14 -6
- package/src/MenuButton.tsx +10 -6
- package/src/MenuItem.tsx +0 -1
- package/src/MuiPropsChild.tsx +41 -0
- package/src/MuiPropsContext.ts +17 -0
- package/src/OdysseyCacheProvider.test.tsx +1 -1
- package/src/PasswordField.tsx +180 -0
- package/src/RadioGroup.tsx +31 -46
- package/src/SearchField.tsx +138 -0
- package/src/Status.tsx +2 -2
- package/src/Tag.tsx +41 -0
- package/src/TagList.tsx +43 -0
- package/src/TagListContext.tsx +23 -0
- package/src/TextField.tsx +64 -111
- package/src/Toast.tsx +138 -0
- package/src/ToastStack.tsx +33 -0
- package/src/Tooltip.tsx +39 -0
- package/src/iconDictionary/Add.tsx +3 -3
- package/src/iconDictionary/AddCircle.tsx +3 -3
- package/src/iconDictionary/AlertCircle.tsx +3 -3
- package/src/iconDictionary/AlertCircleFilled.tsx +3 -3
- package/src/iconDictionary/AlertTriangleFilled.tsx +3 -3
- package/src/iconDictionary/Anchor.tsx +3 -3
- package/src/iconDictionary/ArrowDown.tsx +3 -3
- package/src/iconDictionary/ArrowLeft.tsx +3 -3
- package/src/iconDictionary/ArrowRight.tsx +3 -3
- package/src/iconDictionary/ArrowUp.tsx +3 -3
- package/src/iconDictionary/ArrowUpDown.tsx +3 -3
- package/src/iconDictionary/Calendar.tsx +3 -3
- package/src/iconDictionary/Check.tsx +3 -3
- package/src/iconDictionary/CheckCircleFilled.tsx +3 -3
- package/src/iconDictionary/ChevronDown.tsx +3 -3
- package/src/iconDictionary/ChevronUp.tsx +3 -3
- package/src/iconDictionary/Close.tsx +3 -3
- package/src/iconDictionary/CloseCircleFilled.tsx +3 -3
- package/src/iconDictionary/Copy.tsx +3 -3
- package/src/iconDictionary/Delete.tsx +3 -3
- package/src/iconDictionary/Download.tsx +3 -3
- package/src/iconDictionary/DragHandle.tsx +3 -3
- package/src/iconDictionary/Edit.tsx +3 -3
- package/src/iconDictionary/ExternalLink.tsx +3 -3
- package/src/iconDictionary/Eye.tsx +3 -3
- package/src/iconDictionary/EyeOff.tsx +3 -3
- package/src/iconDictionary/Filter.tsx +3 -3
- package/src/iconDictionary/Globe.tsx +3 -3
- package/src/iconDictionary/Home.tsx +3 -3
- package/src/iconDictionary/InformationCircle.tsx +3 -3
- package/src/iconDictionary/InformationCircleFilled.tsx +3 -3
- package/src/iconDictionary/Notification.tsx +3 -3
- package/src/iconDictionary/OverflowVertical.tsx +3 -3
- package/src/iconDictionary/QuestionCircle.tsx +3 -3
- package/src/iconDictionary/QuestionCircleFilled.tsx +3 -3
- package/src/iconDictionary/Search.tsx +3 -3
- package/src/iconDictionary/Settings.tsx +2 -2
- package/src/iconDictionary/Subtract.tsx +3 -3
- package/src/iconDictionary/User.tsx +3 -3
- package/src/iconDictionary/UserGroup.tsx +3 -3
- package/src/iconDictionary/index.ts +1 -1
- package/src/index.ts +10 -14
- package/src/theme/components.tsx +119 -27
- package/src/theme/components.types.ts +0 -8
- package/dist/PasswordInput.js +0 -87
- package/dist/PasswordInput.js.map +0 -1
- package/dist/src/PasswordInput.d.ts +0 -21
- package/dist/src/PasswordInput.d.ts.map +0 -1
- package/src/PasswordInput.test.tsx +0 -51
- package/src/PasswordInput.tsx +0 -111
package/dist/Icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","names":["forwardRef","iconDictionary","Icon","
|
|
1
|
+
{"version":3,"file":"Icon.js","names":["forwardRef","iconDictionary","Icon","ariaLabelledby","label","name","size","NamedIcon","displayName"],"sources":["../src/Icon.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2021-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 { forwardRef } from \"react\";\nimport { iconDictionary } from \"./iconDictionary\";\n\nexport type IconProps = {\n /*\n ** The element whose text describes the icon, if it exists\n */\n ariaLabelledby?: string;\n /*\n ** Text that describes the icon\n */\n label: string;\n /*\n ** Name of the icon to render\n */\n name: keyof typeof iconDictionary;\n /*\n ** The size of the icon\n */\n size: \"small\" | \"medium\" | \"large\";\n};\n\n/**\n * A system of icons which establishes a visual language\n * that can be easily understood regardless of age, language or culture.\n * This component includes all icon data as static imports. Favor individual\n * icon component imports where possible to keep your bundle size smaller.\n */\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(\n ({ ariaLabelledby, label, name, size }) => {\n if (!(name in iconDictionary)) return null;\n\n const NamedIcon = iconDictionary[name];\n\n return (\n <NamedIcon\n aria-labelledby={ariaLabelledby}\n fontSize={size}\n titleAccess={label}\n />\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,UAAT,QAA2B,OAA3B;SACSC,c;;AA2BT,OAAO,MAAMC,IAAI,GAAGF,UAAU,CAC5B,QAA2C;EAAA,IAA1C;IAAEG,cAAF;IAAkBC,KAAlB;IAAyBC,IAAzB;IAA+BC;EAA/B,CAA0C;EACzC,IAAI,EAAED,IAAI,IAAIJ,cAAV,CAAJ,EAA+B,OAAO,IAAP;EAE/B,MAAMM,SAAS,GAAGN,cAAc,CAACI,IAAD,CAAhC;EAEA,OACE,KAAC,SAAD;IACE,mBAAiBF,cADnB;IAEE,QAAQ,EAAEG,IAFZ;IAGE,WAAW,EAAEF;EAHf,EADF;AAOD,CAb2B,CAAvB;AAgBPF,IAAI,CAACM,WAAL,GAAmB,MAAnB"}
|
package/dist/Infobox.js
CHANGED
package/dist/Infobox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Infobox.js","names":["memo","Alert","AlertTitle","ScreenReaderText","Infobox","children","
|
|
1
|
+
{"version":3,"file":"Infobox.js","names":["memo","Alert","AlertTitle","ScreenReaderText","Infobox","children","role","severity","title","MemoizedInfobox"],"sources":["../src/Infobox.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 { AlertColor } from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\nimport { Alert, AlertTitle, ScreenReaderText } from \".\";\n\nexport type InfoboxProps = {\n /**\n * The contents of the alert\n */\n children: ReactNode;\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: \"status\" | \"alert\";\n /**\n * Determine the color and icon of the alert\n */\n severity: AlertColor;\n /**\n * The title of the alert\n */\n title?: string;\n};\n\nconst Infobox = ({ children, role, severity, title }: InfoboxProps) => (\n <Alert role={role} severity={severity} variant=\"infobox\">\n <ScreenReaderText>{severity}: </ScreenReaderText>\n {title && <AlertTitle>{title}</AlertTitle>}\n {children}\n </Alert>\n);\n\nconst MemoizedInfobox = memo(Infobox);\n\nexport { MemoizedInfobox as Infobox };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAT,QAAgC,OAAhC;SACSC,K,EAAOC,U,EAAYC,gB;;;;AAuB5B,MAAMC,OAAO,GAAG;EAAA,IAAC;IAAEC,QAAF;IAAYC,IAAZ;IAAkBC,QAAlB;IAA4BC;EAA5B,CAAD;EAAA,OACd,MAAC,KAAD;IAAO,IAAI,EAAEF,IAAb;IAAmB,QAAQ,EAAEC,QAA7B;IAAuC,OAAO,EAAC,SAA/C;IAAA,WACE,MAAC,gBAAD;MAAA,WAAmBA,QAAnB;IAAA,EADF,EAEGC,KAAK,IAAI,KAAC,UAAD;MAAA,UAAaA;IAAb,EAFZ,EAGGH,QAHH;EAAA,EADc;AAAA,CAAhB;;AAQA,MAAMI,eAAe,GAAGT,IAAI,CAACI,OAAD,CAA5B;AAEA,SAASK,eAAe,IAAIL,OAA5B"}
|
package/dist/Link.js
CHANGED
|
@@ -19,10 +19,13 @@ export const Link = forwardRef((props, ref) => {
|
|
|
19
19
|
const {
|
|
20
20
|
icon,
|
|
21
21
|
children,
|
|
22
|
-
target
|
|
22
|
+
target,
|
|
23
|
+
variant
|
|
23
24
|
} = props;
|
|
24
|
-
return _jsxs(_Link, {
|
|
25
|
+
return _jsxs(_Link, {
|
|
25
26
|
ref: ref,
|
|
27
|
+
variant: variant,
|
|
28
|
+
target: target,
|
|
26
29
|
children: [icon && _jsx("span", {
|
|
27
30
|
className: "Link-icon",
|
|
28
31
|
children: icon
|
package/dist/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","names":["forwardRef","Link","props","ref","icon","children","target"],"sources":["../src/Link.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 { forwardRef, ReactElement } from \"react\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"Link.js","names":["forwardRef","Link","props","ref","icon","children","target","variant"],"sources":["../src/Link.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 { forwardRef, ReactElement } from \"react\";\n\nimport {\n Link as MuiLink,\n LinkProps as MuiLinkProps,\n SvgIcon,\n} from \"@mui/material\";\n\nexport type LinkProps = {\n children: React.ReactNode;\n href: string;\n icon?: ReactElement;\n rel?: string;\n target?: \"_self\" | \"_blank\" | \"_parent\" | \"_top\" | string;\n variant?: MuiLinkProps[\"variant\"];\n};\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {\n const { icon, children, target, variant } = props;\n return (\n <MuiLink ref={ref} variant={variant} target={target}>\n {icon && <span className=\"Link-icon\">{icon}</span>}\n {children}\n {target === \"_blank\" && (\n <span className=\"Link-indicator\" role=\"presentation\">\n <SvgIcon viewBox=\"0 0 16 16\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M13.2929 2H7.99998V1H14.5C14.7761 1 15 1.22386 15 1.5V8H14V2.70711L6.35353 10.3536L5.64642 9.64645L13.2929 2ZM1.5 4H1V4.5V14.5V15H1.5H11.5H12V14.5V8H11V14H2V5H8V4H1.5Z\"\n fill=\"currentColor\"\n />\n </SvgIcon>\n </span>\n )}\n </MuiLink>\n );\n});\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,UAAT,QAAyC,OAAzC;;;AAiBA,OAAO,MAAMC,IAAI,GAAGD,UAAU,CAA+B,CAACE,KAAD,EAAQC,GAAR,KAAgB;EAC3E,MAAM;IAAEC,IAAF;IAAQC,QAAR;IAAkBC,MAAlB;IAA0BC;EAA1B,IAAsCL,KAA5C;EACA,OACE;IAAS,GAAG,EAAEC,GAAd;IAAmB,OAAO,EAAEI,OAA5B;IAAqC,MAAM,EAAED,MAA7C;IAAA,WACGF,IAAI,IAAI;MAAM,SAAS,EAAC,WAAhB;MAAA,UAA6BA;IAA7B,EADX,EAEGC,QAFH,EAGGC,MAAM,KAAK,QAAX,IACC;MAAM,SAAS,EAAC,gBAAhB;MAAiC,IAAI,EAAC,cAAtC;MAAA,UACE;QAAS,OAAO,EAAC,WAAjB;QAAA,UACE;UACE,QAAQ,EAAC,SADX;UAEE,QAAQ,EAAC,SAFX;UAGE,CAAC,EAAC,yKAHJ;UAIE,IAAI,EAAC;QAJP;MADF;IADF,EAJJ;EAAA,EADF;AAkBD,CApB6B,CAAvB"}
|
package/dist/MenuButton.js
CHANGED
|
@@ -19,7 +19,8 @@ const MenuButton = _ref => {
|
|
|
19
19
|
buttonLabel = "",
|
|
20
20
|
children,
|
|
21
21
|
buttonEndIcon = _jsx(ChevronDownIcon, {}),
|
|
22
|
-
buttonVariant = "secondary"
|
|
22
|
+
buttonVariant = "secondary",
|
|
23
|
+
id: idOverride
|
|
23
24
|
} = _ref;
|
|
24
25
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
25
26
|
const open = Boolean(anchorEl);
|
|
@@ -32,7 +33,7 @@ const MenuButton = _ref => {
|
|
|
32
33
|
setAnchorEl(null);
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
const uniqueId = useUniqueId();
|
|
36
|
+
const uniqueId = useUniqueId(idOverride);
|
|
36
37
|
const menuListProps = useMemo(() => ({
|
|
37
38
|
"aria-labelledby": `${uniqueId}-button`
|
|
38
39
|
}), [uniqueId]);
|
|
@@ -44,8 +45,8 @@ const MenuButton = _ref => {
|
|
|
44
45
|
"aria-haspopup": "true",
|
|
45
46
|
"aria-expanded": open ? "true" : undefined,
|
|
46
47
|
onClick: handleClick,
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
text: buttonLabel,
|
|
49
|
+
variant: buttonVariant
|
|
49
50
|
}), _jsx(Menu, {
|
|
50
51
|
id: `${uniqueId}-menu`,
|
|
51
52
|
anchorEl: anchorEl,
|
package/dist/MenuButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.js","names":["Button","ChevronDownIcon","Menu","useUniqueId","memo","useMemo","useState","MenuButton","buttonLabel","children","buttonEndIcon","buttonVariant","anchorEl","setAnchorEl","open","Boolean","handleClick","event","currentTarget","handleClose","uniqueId","menuListProps","undefined","MemoizedMenuButton"],"sources":["../src/MenuButton.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 Button,\n ButtonProps,\n ChevronDownIcon,\n Divider,\n ListSubheader,\n Menu,\n MenuItem,\n useUniqueId,\n} from \"./\";\nimport { memo, MouseEvent, ReactElement, useMemo, useState } from \"react\";\n\nexport
|
|
1
|
+
{"version":3,"file":"MenuButton.js","names":["Button","ChevronDownIcon","Menu","useUniqueId","memo","useMemo","useState","MenuButton","buttonLabel","children","buttonEndIcon","buttonVariant","id","idOverride","anchorEl","setAnchorEl","open","Boolean","handleClick","event","currentTarget","handleClose","uniqueId","menuListProps","undefined","MemoizedMenuButton"],"sources":["../src/MenuButton.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 Button,\n ButtonProps,\n ChevronDownIcon,\n Divider,\n ListSubheader,\n Menu,\n MenuItem,\n useUniqueId,\n} from \"./\";\nimport { memo, MouseEvent, ReactElement, useMemo, useState } from \"react\";\n\nexport type MenuButtonProps = {\n /**\n * The <MenuItem> components within the Menu.\n */\n children: Array<\n ReactElement<typeof MenuItem | typeof Divider | typeof ListSubheader>\n >;\n /**\n * The end Icon on the trigggering Button\n */\n buttonEndIcon?: ReactElement;\n /**\n * The label on the triggering Button\n */\n buttonLabel?: string;\n /**\n * The variant of the triggering Button\n */\n buttonVariant?: ButtonProps[\"variant\"];\n /**\n * The id of the `input` element.\n */\n id?: string;\n};\n\nconst MenuButton = ({\n buttonLabel = \"\",\n children,\n buttonEndIcon = <ChevronDownIcon />,\n buttonVariant = \"secondary\",\n id: idOverride,\n}: MenuButtonProps) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const open = Boolean(anchorEl);\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const uniqueId = useUniqueId(idOverride);\n\n const menuListProps = useMemo(\n () => ({ \"aria-labelledby\": `${uniqueId}-button` }),\n [uniqueId]\n );\n\n return (\n <div>\n <Button\n endIcon={buttonEndIcon}\n id={`${uniqueId}-button`}\n aria-controls={open ? `${uniqueId}-menu` : undefined}\n aria-haspopup=\"true\"\n aria-expanded={open ? \"true\" : undefined}\n onClick={handleClick}\n text={buttonLabel}\n variant={buttonVariant}\n />\n <Menu\n id={`${uniqueId}-menu`}\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n MenuListProps={menuListProps}\n >\n {children}\n </Menu>\n </div>\n );\n};\n\nconst MemoizedMenuButton = memo(MenuButton);\n\nexport { MemoizedMenuButton as MenuButton };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAGEA,M,EAEAC,e,EAGAC,I,EAEAC,W;AAEF,SAASC,IAAT,EAAyCC,OAAzC,EAAkDC,QAAlD,QAAkE,OAAlE;;;;AA2BA,MAAMC,UAAU,GAAG,QAMI;EAAA,IANH;IAClBC,WAAW,GAAG,EADI;IAElBC,QAFkB;IAGlBC,aAAa,GAAG,KAAC,eAAD,KAHE;IAIlBC,aAAa,GAAG,WAJE;IAKlBC,EAAE,EAAEC;EALc,CAMG;EACrB,MAAM,CAACC,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAqB,IAArB,CAAxC;EAEA,MAAMU,IAAI,GAAGC,OAAO,CAACH,QAAD,CAApB;;EAEA,MAAMI,WAAW,GAAIC,KAAD,IAA0C;IAC5DJ,WAAW,CAACI,KAAK,CAACC,aAAP,CAAX;EACD,CAFD;;EAIA,MAAMC,WAAW,GAAG,MAAM;IACxBN,WAAW,CAAC,IAAD,CAAX;EACD,CAFD;;EAIA,MAAMO,QAAQ,GAAGnB,WAAW,CAACU,UAAD,CAA5B;EAEA,MAAMU,aAAa,GAAGlB,OAAO,CAC3B,OAAO;IAAE,mBAAoB,GAAEiB,QAAS;EAAjC,CAAP,CAD2B,EAE3B,CAACA,QAAD,CAF2B,CAA7B;EAKA,OACE;IAAA,WACE,KAAC,MAAD;MACE,OAAO,EAAEZ,aADX;MAEE,EAAE,EAAG,GAAEY,QAAS,SAFlB;MAGE,iBAAeN,IAAI,GAAI,GAAEM,QAAS,OAAf,GAAwBE,SAH7C;MAIE,iBAAc,MAJhB;MAKE,iBAAeR,IAAI,GAAG,MAAH,GAAYQ,SALjC;MAME,OAAO,EAAEN,WANX;MAOE,IAAI,EAAEV,WAPR;MAQE,OAAO,EAAEG;IARX,EADF,EAWE,KAAC,IAAD;MACE,EAAE,EAAG,GAAEW,QAAS,OADlB;MAEE,QAAQ,EAAER,QAFZ;MAGE,IAAI,EAAEE,IAHR;MAIE,OAAO,EAAEK,WAJX;MAKE,aAAa,EAAEE,aALjB;MAAA,UAOGd;IAPH,EAXF;EAAA,EADF;AAuBD,CAjDD;;AAmDA,MAAMgB,kBAAkB,GAAGrB,IAAI,CAACG,UAAD,CAA/B;AAEA,SAASkB,kBAAkB,IAAIlB,UAA/B"}
|
package/dist/MenuItem.js
CHANGED
package/dist/MenuItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","names":["memo","forwardRef","menuItemClasses","MenuItem","ref","isDestructive","props","root","undefined","children","MemoizedMenuItem"
|
|
1
|
+
{"version":3,"file":"MenuItem.js","names":["memo","forwardRef","menuItemClasses","MenuItem","ref","isDestructive","props","root","undefined","children","MemoizedMenuItem"],"sources":["../src/MenuItem.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, forwardRef } from \"react\";\nimport { MenuItem as MuiMenuItem } from \"@mui/material\";\nimport { menuItemClasses } from \"@mui/material/MenuItem\";\nimport type { MenuItemProps as MuiMenuItemProps } from \"@mui/material\";\n\nexport interface MenuItemProps\n extends Omit<\n MuiMenuItemProps,\n | \"component\"\n | \"dense\"\n | \"disableGutters\"\n | \"divider\"\n | \"focusVisibleClassName\"\n > {\n /**\n * Toggles whether or not the MenuItem represents a destructive action.\n */\n isDestructive?: boolean;\n}\n\nconst MenuItem = forwardRef<HTMLLIElement, MenuItemProps>(\n ({ isDestructive, ...props }, ref) => (\n <MuiMenuItem\n {...props}\n ref={ref}\n className={\n isDestructive ? `${menuItemClasses.root}-destructive` : undefined\n }\n >\n {props.children}\n </MuiMenuItem>\n )\n);\n\nconst MemoizedMenuItem = memo(MenuItem);\n\nexport { MemoizedMenuItem as MenuItem };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,IAAT,EAAeC,UAAf,QAAiC,OAAjC;AAEA,SAASC,eAAT,QAAgC,wBAAhC;;AAkBA,MAAMC,QAAQ,GAAGF,UAAU,CACzB,OAA8BG,GAA9B;EAAA,IAAC;IAAEC,aAAF;IAAiB,GAAGC;EAApB,CAAD;EAAA,OACE,qBACMA,KADN;IAEE,GAAG,EAAEF,GAFP;IAGE,SAAS,EACPC,aAAa,GAAI,GAAEH,eAAe,CAACK,IAAK,cAA3B,GAA2CC,SAJ5D;IAAA,UAOGF,KAAK,CAACG;EAPT,EADF;AAAA,CADyB,CAA3B;AAcA,MAAMC,gBAAgB,GAAGV,IAAI,CAACG,QAAD,CAA7B;AAEA,SAASO,gBAAgB,IAAIP,QAA7B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { forwardRef, memo, useMemo } from "react";
|
|
13
|
+
import { MuiPropsContext } from "./MuiPropsContext.js";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
const MuiPropsChild = forwardRef((_ref, ref) => {
|
|
16
|
+
let {
|
|
17
|
+
children,
|
|
18
|
+
...muiProps
|
|
19
|
+
} = _ref;
|
|
20
|
+
const providerValue = useMemo(() => ({ ...muiProps,
|
|
21
|
+
ref
|
|
22
|
+
}), [muiProps, ref]);
|
|
23
|
+
return _jsx(MuiPropsContext.Provider, {
|
|
24
|
+
value: providerValue,
|
|
25
|
+
children: children
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
const MemoizedMuiPropsChild = memo(MuiPropsChild);
|
|
29
|
+
export { MemoizedMuiPropsChild as MuiPropsChild };
|
|
30
|
+
//# sourceMappingURL=MuiPropsChild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MuiPropsChild.js","names":["forwardRef","memo","useMemo","MuiPropsContext","MuiPropsChild","ref","children","muiProps","providerValue","MemoizedMuiPropsChild"],"sources":["../src/MuiPropsChild.tsx"],"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 { forwardRef, memo, ReactNode, useMemo } from \"react\";\n\nimport { MuiPropsContext, MuiPropsContextType } from \"./MuiPropsContext\";\n\nexport type MuiPropsChildProps = {\n children: ReactNode;\n};\n\nconst MuiPropsChild = forwardRef<HTMLElement, MuiPropsChildProps>(\n ({ children, ...muiProps }, ref) => {\n const providerValue = useMemo<MuiPropsContextType>(\n () => ({\n ...muiProps,\n ref,\n }),\n [muiProps, ref]\n );\n\n return (\n <MuiPropsContext.Provider value={providerValue}>\n {children}\n </MuiPropsContext.Provider>\n );\n }\n);\n\nconst MemoizedMuiPropsChild = memo(MuiPropsChild);\n\nexport { MemoizedMuiPropsChild as MuiPropsChild };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,UAAT,EAAqBC,IAArB,EAAsCC,OAAtC,QAAqD,OAArD;SAESC,e;;AAMT,MAAMC,aAAa,GAAGJ,UAAU,CAC9B,OAA4BK,GAA5B,KAAoC;EAAA,IAAnC;IAAEC,QAAF;IAAY,GAAGC;EAAf,CAAmC;EAClC,MAAMC,aAAa,GAAGN,OAAO,CAC3B,OAAO,EACL,GAAGK,QADE;IAELF;EAFK,CAAP,CAD2B,EAK3B,CAACE,QAAD,EAAWF,GAAX,CAL2B,CAA7B;EAQA,OACE,KAAC,eAAD,CAAiB,QAAjB;IAA0B,KAAK,EAAEG,aAAjC;IAAA,UACGF;EADH,EADF;AAKD,CAf6B,CAAhC;AAkBA,MAAMG,qBAAqB,GAAGR,IAAI,CAACG,aAAD,CAAlC;AAEA,SAASK,qBAAqB,IAAIL,aAAlC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { createContext } from "react";
|
|
13
|
+
export const MuiPropsContext = createContext({});
|
|
14
|
+
//# sourceMappingURL=MuiPropsContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MuiPropsContext.js","names":["createContext","MuiPropsContext"],"sources":["../src/MuiPropsContext.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 { createContext } from \"react\";\n\nexport type MuiPropsContextType = Record<string, unknown>;\n\nexport const MuiPropsContext = createContext<MuiPropsContextType>({});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,aAAT,QAA8B,OAA9B;AAIA,OAAO,MAAMC,eAAe,GAAGD,aAAa,CAAsB,EAAtB,CAArC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _InputBase from "@mui/material/InputBase";
|
|
2
|
+
import _InputAdornment from "@mui/material/InputAdornment";
|
|
3
|
+
import { forwardRef, memo, useCallback, useState } from "react";
|
|
4
|
+
import { EyeIcon, EyeOffIcon, IconButton } from "./index.js";
|
|
5
|
+
import { Field } from "./Field.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const PasswordField = forwardRef((_ref, ref) => {
|
|
8
|
+
let {
|
|
9
|
+
autoCompleteType,
|
|
10
|
+
errorMessage,
|
|
11
|
+
hasInitialFocus,
|
|
12
|
+
hint,
|
|
13
|
+
id: idOverride,
|
|
14
|
+
isDisabled = false,
|
|
15
|
+
isOptional = false,
|
|
16
|
+
isReadOnly,
|
|
17
|
+
label,
|
|
18
|
+
onChange,
|
|
19
|
+
onFocus,
|
|
20
|
+
onBlur,
|
|
21
|
+
placeholder,
|
|
22
|
+
value
|
|
23
|
+
} = _ref;
|
|
24
|
+
const [inputType, setInputType] = useState("password");
|
|
25
|
+
const togglePasswordVisibility = useCallback(() => {
|
|
26
|
+
setInputType(inputType => inputType === "password" ? "text" : "password");
|
|
27
|
+
}, []);
|
|
28
|
+
const renderFieldComponent = useCallback(_ref2 => {
|
|
29
|
+
let {
|
|
30
|
+
ariaDescribedBy,
|
|
31
|
+
id
|
|
32
|
+
} = _ref2;
|
|
33
|
+
return _jsx(_InputBase, {
|
|
34
|
+
"aria-describedby": ariaDescribedBy,
|
|
35
|
+
autoComplete: autoCompleteType,
|
|
36
|
+
autoFocus: hasInitialFocus,
|
|
37
|
+
endAdornment: _jsx(_InputAdornment, {
|
|
38
|
+
position: "end",
|
|
39
|
+
children: _jsx(IconButton, {
|
|
40
|
+
"aria-label": "toggle password visibility",
|
|
41
|
+
edge: "end",
|
|
42
|
+
onClick: togglePasswordVisibility,
|
|
43
|
+
children: inputType === "password" ? _jsx(EyeIcon, {}) : _jsx(EyeOffIcon, {})
|
|
44
|
+
})
|
|
45
|
+
}),
|
|
46
|
+
id: id,
|
|
47
|
+
name: id,
|
|
48
|
+
onChange: onChange,
|
|
49
|
+
onFocus: onFocus,
|
|
50
|
+
onBlur: onBlur,
|
|
51
|
+
placeholder: placeholder,
|
|
52
|
+
readOnly: isReadOnly,
|
|
53
|
+
ref: ref,
|
|
54
|
+
required: !isOptional,
|
|
55
|
+
type: inputType,
|
|
56
|
+
value: value
|
|
57
|
+
});
|
|
58
|
+
}, [autoCompleteType, hasInitialFocus, togglePasswordVisibility, inputType, onChange, onFocus, onBlur, placeholder, isOptional, isReadOnly, ref, value]);
|
|
59
|
+
return _jsx(Field, {
|
|
60
|
+
errorMessage: errorMessage,
|
|
61
|
+
fieldType: "single",
|
|
62
|
+
hasVisibleLabel: true,
|
|
63
|
+
hint: hint,
|
|
64
|
+
id: idOverride,
|
|
65
|
+
isDisabled: isDisabled,
|
|
66
|
+
isOptional: isOptional,
|
|
67
|
+
label: label,
|
|
68
|
+
renderFieldComponent: renderFieldComponent
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
const MemoizedPasswordField = memo(PasswordField);
|
|
72
|
+
export { MemoizedPasswordField as PasswordField };
|
|
73
|
+
//# sourceMappingURL=PasswordField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordField.js","names":["forwardRef","memo","useCallback","useState","EyeIcon","EyeOffIcon","IconButton","Field","PasswordField","ref","autoCompleteType","errorMessage","hasInitialFocus","hint","id","idOverride","isDisabled","isOptional","isReadOnly","label","onChange","onFocus","onBlur","placeholder","value","inputType","setInputType","togglePasswordVisibility","renderFieldComponent","ariaDescribedBy","MemoizedPasswordField"],"sources":["../src/PasswordField.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 memo,\n useCallback,\n useState,\n} from \"react\";\n\nimport { EyeIcon, EyeOffIcon, IconButton } from \"./\";\nimport { Field } from \"./Field\";\n\nexport type PasswordFieldProps = {\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?: \"current-password\" | \"new-password\";\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`, 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 * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n};\n\nconst PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n (\n {\n autoCompleteType,\n errorMessage,\n hasInitialFocus,\n hint,\n id: idOverride,\n isDisabled = false,\n isOptional = false,\n isReadOnly,\n label,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n value,\n },\n ref\n ) => {\n const [inputType, setInputType] = useState(\"password\");\n\n const togglePasswordVisibility = useCallback(() => {\n setInputType((inputType) =>\n inputType === \"password\" ? \"text\" : \"password\"\n );\n }, []);\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 <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"toggle password visibility\"\n edge=\"end\"\n onClick={togglePasswordVisibility}\n >\n {inputType === \"password\" ? <EyeIcon /> : <EyeOffIcon />}\n </IconButton>\n </InputAdornment>\n }\n id={id}\n name={id}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n type={inputType}\n value={value}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n togglePasswordVisibility,\n inputType,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\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 MemoizedPasswordField = memo(PasswordField);\n\nexport { MemoizedPasswordField as PasswordField };\n"],"mappings":";;AAaA,SAGEA,UAHF,EAIEC,IAJF,EAKEC,WALF,EAMEC,QANF,QAOO,OAPP;SASSC,O,EAASC,U,EAAYC,U;SACrBC,K;;AA+DT,MAAMC,aAAa,GAAGR,UAAU,CAC9B,OAiBES,GAjBF,KAkBK;EAAA,IAjBH;IACEC,gBADF;IAEEC,YAFF;IAGEC,eAHF;IAIEC,IAJF;IAKEC,EAAE,EAAEC,UALN;IAMEC,UAAU,GAAG,KANf;IAOEC,UAAU,GAAG,KAPf;IAQEC,UARF;IASEC,KATF;IAUEC,QAVF;IAWEC,OAXF;IAYEC,MAZF;IAaEC,WAbF;IAcEC;EAdF,CAiBG;EACH,MAAM,CAACC,SAAD,EAAYC,YAAZ,IAA4BvB,QAAQ,CAAC,UAAD,CAA1C;EAEA,MAAMwB,wBAAwB,GAAGzB,WAAW,CAAC,MAAM;IACjDwB,YAAY,CAAED,SAAD,IACXA,SAAS,KAAK,UAAd,GAA2B,MAA3B,GAAoC,UAD1B,CAAZ;EAGD,CAJ2C,EAIzC,EAJyC,CAA5C;EAMA,MAAMG,oBAAoB,GAAG1B,WAAW,CACtC;IAAA,IAAC;MAAE2B,eAAF;MAAmBf;IAAnB,CAAD;IAAA,OACE;MACE,oBAAkBe,eADpB;MAEE,YAAY,EAAEnB,gBAFhB;MAIE,SAAS,EAAEE,eAJb;MAKE,YAAY,EACV;QAAgB,QAAQ,EAAC,KAAzB;QAAA,UACE,KAAC,UAAD;UACE,cAAW,4BADb;UAEE,IAAI,EAAC,KAFP;UAGE,OAAO,EAAEe,wBAHX;UAAA,UAKGF,SAAS,KAAK,UAAd,GAA2B,KAAC,OAAD,KAA3B,GAAyC,KAAC,UAAD;QAL5C;MADF,EANJ;MAgBE,EAAE,EAAEX,EAhBN;MAiBE,IAAI,EAAEA,EAjBR;MAkBE,QAAQ,EAAEM,QAlBZ;MAmBE,OAAO,EAAEC,OAnBX;MAoBE,MAAM,EAAEC,MApBV;MAqBE,WAAW,EAAEC,WArBf;MAsBE,QAAQ,EAAEL,UAtBZ;MAuBE,GAAG,EAAET,GAvBP;MAwBE,QAAQ,EAAE,CAACQ,UAxBb;MAyBE,IAAI,EAAEQ,SAzBR;MA0BE,KAAK,EAAED;IA1BT,EADF;EAAA,CADsC,EA+BtC,CACEd,gBADF,EAEEE,eAFF,EAGEe,wBAHF,EAIEF,SAJF,EAKEL,QALF,EAMEC,OANF,EAOEC,MAPF,EAQEC,WARF,EASEN,UATF,EAUEC,UAVF,EAWET,GAXF,EAYEe,KAZF,CA/BsC,CAAxC;EA+CA,OACE,KAAC,KAAD;IACE,YAAY,EAAEb,YADhB;IAEE,SAAS,EAAC,QAFZ;IAGE,eAAe,MAHjB;IAIE,IAAI,EAAEE,IAJR;IAKE,EAAE,EAAEE,UALN;IAME,UAAU,EAAEC,UANd;IAOE,UAAU,EAAEC,UAPd;IAQE,KAAK,EAAEE,KART;IASE,oBAAoB,EAAES;EATxB,EADF;AAaD,CAxF6B,CAAhC;AA2FA,MAAME,qBAAqB,GAAG7B,IAAI,CAACO,aAAD,CAAlC;AAEA,SAASsB,qBAAqB,IAAItB,aAAlC"}
|
package/dist/RadioGroup.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _RadioGroup from "@mui/material/RadioGroup";
|
|
2
|
-
import { memo,
|
|
3
|
-
import {
|
|
2
|
+
import { memo, useCallback } from "react";
|
|
3
|
+
import { Field } from "./Field.js";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
5
|
|
|
7
6
|
const RadioGroup = _ref => {
|
|
8
7
|
let {
|
|
@@ -10,36 +9,36 @@ const RadioGroup = _ref => {
|
|
|
10
9
|
defaultValue,
|
|
11
10
|
errorMessage,
|
|
12
11
|
hint,
|
|
12
|
+
id: idOverride,
|
|
13
13
|
isDisabled,
|
|
14
14
|
label,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
onChange,
|
|
16
|
+
value
|
|
17
17
|
} = _ref;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
children: [_jsx(FormLabel, {
|
|
25
|
-
component: "legend",
|
|
26
|
-
children: label
|
|
27
|
-
}), hint && _jsx(FormHelperText, {
|
|
28
|
-
id: `${uniqueName}-hint`,
|
|
29
|
-
children: hint
|
|
30
|
-
}), _jsx(_RadioGroup, {
|
|
18
|
+
const renderFieldComponent = useCallback(_ref2 => {
|
|
19
|
+
let {
|
|
20
|
+
ariaDescribedBy,
|
|
21
|
+
id
|
|
22
|
+
} = _ref2;
|
|
23
|
+
return _jsx(_RadioGroup, {
|
|
31
24
|
"aria-describedby": ariaDescribedBy,
|
|
32
25
|
defaultValue: defaultValue,
|
|
33
|
-
|
|
26
|
+
id: id,
|
|
27
|
+
name: id,
|
|
34
28
|
onChange: onChange,
|
|
29
|
+
value: value,
|
|
35
30
|
children: children
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
});
|
|
32
|
+
}, [children, defaultValue, onChange, value]);
|
|
33
|
+
return _jsx(Field, {
|
|
34
|
+
errorMessage: errorMessage,
|
|
35
|
+
fieldType: "group",
|
|
36
|
+
hasVisibleLabel: false,
|
|
37
|
+
hint: hint,
|
|
38
|
+
id: idOverride,
|
|
39
|
+
isDisabled: isDisabled,
|
|
40
|
+
label: label,
|
|
41
|
+
renderFieldComponent: renderFieldComponent
|
|
43
42
|
});
|
|
44
43
|
};
|
|
45
44
|
|
package/dist/RadioGroup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":["memo","
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":["memo","useCallback","Field","RadioGroup","children","defaultValue","errorMessage","hint","id","idOverride","isDisabled","label","onChange","value","renderFieldComponent","ariaDescribedBy","MemoizedRadioGroup"],"sources":["../src/RadioGroup.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 { RadioGroup as MuiRadioGroup } from \"@mui/material\";\nimport { ChangeEventHandler, memo, ReactElement, useCallback } from \"react\";\n\nimport { Radio, RadioProps } from \"./Radio\";\nimport { Field } from \"./Field\";\n\nexport type RadioGroupProps = {\n /**\n * The <Radio> components within the group. Must include two or more.\n */\n children: Array<ReactElement<typeof Radio>>;\n /**\n * The text value of the radio that should be selected by default\n */\n defaultValue?: string;\n /**\n * The error text for an invalid group\n */\n errorMessage?: string;\n /**\n * Optional hint text\n */\n hint?: string;\n /**\n * The id of the `input` element. This will also be the input's `name` field.\n */\n id?: string;\n /**\n * Disables the whole radio group\n */\n isDisabled?: boolean;\n /**\n * The text label for the radio group\n */\n label: string;\n /**\n * Listen for changes in the browser that change `value`.\n */\n onChange?: ChangeEventHandler<EventTarget>;\n /**\n * The `value` on the selected radio button.\n */\n value?: RadioProps[\"value\"];\n};\n\nconst RadioGroup = ({\n children,\n defaultValue,\n errorMessage,\n hint,\n id: idOverride,\n isDisabled,\n label,\n onChange,\n value,\n}: RadioGroupProps) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <MuiRadioGroup\n aria-describedby={ariaDescribedBy}\n defaultValue={defaultValue}\n id={id}\n name={id}\n onChange={onChange}\n value={value}\n >\n {children}\n </MuiRadioGroup>\n ),\n [children, defaultValue, onChange, value]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"group\"\n hasVisibleLabel={false}\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedRadioGroup = memo(RadioGroup);\n\nexport { MemoizedRadioGroup as RadioGroup };\n"],"mappings":";AAaA,SAA6BA,IAA7B,EAAiDC,WAAjD,QAAoE,OAApE;SAGSC,K;;;AAyCT,MAAMC,UAAU,GAAG,QAUI;EAAA,IAVH;IAClBC,QADkB;IAElBC,YAFkB;IAGlBC,YAHkB;IAIlBC,IAJkB;IAKlBC,EAAE,EAAEC,UALc;IAMlBC,UANkB;IAOlBC,KAPkB;IAQlBC,QARkB;IASlBC;EATkB,CAUG;EACrB,MAAMC,oBAAoB,GAAGb,WAAW,CACtC;IAAA,IAAC;MAAEc,eAAF;MAAmBP;IAAnB,CAAD;IAAA,OACE;MACE,oBAAkBO,eADpB;MAEE,YAAY,EAAEV,YAFhB;MAGE,EAAE,EAAEG,EAHN;MAIE,IAAI,EAAEA,EAJR;MAKE,QAAQ,EAAEI,QALZ;MAME,KAAK,EAAEC,KANT;MAAA,UAQGT;IARH,EADF;EAAA,CADsC,EAatC,CAACA,QAAD,EAAWC,YAAX,EAAyBO,QAAzB,EAAmCC,KAAnC,CAbsC,CAAxC;EAgBA,OACE,KAAC,KAAD;IACE,YAAY,EAAEP,YADhB;IAEE,SAAS,EAAC,OAFZ;IAGE,eAAe,EAAE,KAHnB;IAIE,IAAI,EAAEC,IAJR;IAKE,EAAE,EAAEE,UALN;IAME,UAAU,EAAEC,UANd;IAOE,KAAK,EAAEC,KAPT;IAQE,oBAAoB,EAAEG;EARxB,EADF;AAYD,CAvCD;;AAyCA,MAAME,kBAAkB,GAAGhB,IAAI,CAACG,UAAD,CAA/B;AAEA,SAASa,kBAAkB,IAAIb,UAA/B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import _InputBase from "@mui/material/InputBase";
|
|
2
|
+
import _InputAdornment from "@mui/material/InputAdornment";
|
|
3
|
+
import { forwardRef, memo, useCallback } from "react";
|
|
4
|
+
import { SearchIcon } from "./index.js";
|
|
5
|
+
import { Field } from "./Field.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const SearchField = forwardRef((_ref, ref) => {
|
|
8
|
+
let {
|
|
9
|
+
autoCompleteType,
|
|
10
|
+
hasInitialFocus,
|
|
11
|
+
id: idOverride,
|
|
12
|
+
isDisabled = false,
|
|
13
|
+
label,
|
|
14
|
+
onChange,
|
|
15
|
+
onFocus,
|
|
16
|
+
onBlur,
|
|
17
|
+
placeholder,
|
|
18
|
+
value
|
|
19
|
+
} = _ref;
|
|
20
|
+
const renderFieldComponent = useCallback(_ref2 => {
|
|
21
|
+
let {
|
|
22
|
+
ariaDescribedBy,
|
|
23
|
+
id
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return _jsx(_InputBase, {
|
|
26
|
+
"aria-describedby": ariaDescribedBy,
|
|
27
|
+
autoComplete: autoCompleteType,
|
|
28
|
+
autoFocus: hasInitialFocus,
|
|
29
|
+
id: id,
|
|
30
|
+
name: id,
|
|
31
|
+
onChange: onChange,
|
|
32
|
+
onFocus: onFocus,
|
|
33
|
+
onBlur: onBlur,
|
|
34
|
+
placeholder: placeholder,
|
|
35
|
+
ref: ref,
|
|
36
|
+
startAdornment: _jsx(_InputAdornment, {
|
|
37
|
+
position: "start",
|
|
38
|
+
children: _jsx(SearchIcon, {})
|
|
39
|
+
}),
|
|
40
|
+
type: "search",
|
|
41
|
+
value: value
|
|
42
|
+
});
|
|
43
|
+
}, [autoCompleteType, hasInitialFocus, onChange, onFocus, onBlur, placeholder, ref, value]);
|
|
44
|
+
return _jsx(Field, {
|
|
45
|
+
fieldType: "single",
|
|
46
|
+
hasVisibleLabel: false,
|
|
47
|
+
id: idOverride,
|
|
48
|
+
isDisabled: isDisabled,
|
|
49
|
+
isOptional: true,
|
|
50
|
+
label: label,
|
|
51
|
+
renderFieldComponent: renderFieldComponent
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
const MemoizedSearchField = memo(SearchField);
|
|
55
|
+
export { MemoizedSearchField as SearchField };
|
|
56
|
+
//# sourceMappingURL=SearchField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchField.js","names":["forwardRef","memo","useCallback","SearchIcon","Field","SearchField","ref","autoCompleteType","hasInitialFocus","id","idOverride","isDisabled","label","onChange","onFocus","onBlur","placeholder","value","renderFieldComponent","ariaDescribedBy","MemoizedSearchField"],"sources":["../src/SearchField.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 useCallback,\n} from \"react\";\n\nimport { SearchIcon } from \"./\";\nimport { Field } from \"./Field\";\n\nexport type SearchFieldProps = {\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 * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\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 * This label won't show up visually, but it's required for accessibility.\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 * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n};\n\nconst SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(\n (\n {\n autoCompleteType,\n hasInitialFocus,\n id: idOverride,\n isDisabled = false,\n label,\n onChange,\n onFocus,\n onBlur,\n placeholder,\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 id={id}\n name={id}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n ref={ref}\n startAdornment={\n <InputAdornment position=\"start\">\n <SearchIcon />\n </InputAdornment>\n }\n type=\"search\"\n value={value}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n ref,\n value,\n ]\n );\n\n return (\n <Field\n fieldType=\"single\"\n hasVisibleLabel={false}\n id={idOverride}\n isDisabled={isDisabled}\n isOptional={true}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedSearchField = memo(SearchField);\n\nexport { MemoizedSearchField as SearchField };\n"],"mappings":";;AAaA,SAGEA,UAHF,EAKEC,IALF,EAMEC,WANF,QAOO,OAPP;SASSC,U;SACAC,K;;AA+CT,MAAMC,WAAW,GAAGL,UAAU,CAC5B,OAaEM,GAbF,KAcK;EAAA,IAbH;IACEC,gBADF;IAEEC,eAFF;IAGEC,EAAE,EAAEC,UAHN;IAIEC,UAAU,GAAG,KAJf;IAKEC,KALF;IAMEC,QANF;IAOEC,OAPF;IAQEC,MARF;IASEC,WATF;IAUEC;EAVF,CAaG;EACH,MAAMC,oBAAoB,GAAGhB,WAAW,CACtC;IAAA,IAAC;MAAEiB,eAAF;MAAmBV;IAAnB,CAAD;IAAA,OACE;MACE,oBAAkBU,eADpB;MAEE,YAAY,EAAEZ,gBAFhB;MAIE,SAAS,EAAEC,eAJb;MAKE,EAAE,EAAEC,EALN;MAME,IAAI,EAAEA,EANR;MAOE,QAAQ,EAAEI,QAPZ;MAQE,OAAO,EAAEC,OARX;MASE,MAAM,EAAEC,MATV;MAUE,WAAW,EAAEC,WAVf;MAWE,GAAG,EAAEV,GAXP;MAYE,cAAc,EACZ;QAAgB,QAAQ,EAAC,OAAzB;QAAA,UACE,KAAC,UAAD;MADF,EAbJ;MAiBE,IAAI,EAAC,QAjBP;MAkBE,KAAK,EAAEW;IAlBT,EADF;EAAA,CADsC,EAuBtC,CACEV,gBADF,EAEEC,eAFF,EAGEK,QAHF,EAIEC,OAJF,EAKEC,MALF,EAMEC,WANF,EAOEV,GAPF,EAQEW,KARF,CAvBsC,CAAxC;EAmCA,OACE,KAAC,KAAD;IACE,SAAS,EAAC,QADZ;IAEE,eAAe,EAAE,KAFnB;IAGE,EAAE,EAAEP,UAHN;IAIE,UAAU,EAAEC,UAJd;IAKE,UAAU,EAAE,IALd;IAME,KAAK,EAAEC,KANT;IAOE,oBAAoB,EAAEM;EAPxB,EADF;AAWD,CA9D2B,CAA9B;AAiEA,MAAME,mBAAmB,GAAGnB,IAAI,CAACI,WAAD,CAAhC;AAEA,SAASe,mBAAmB,IAAIf,WAAhC"}
|
package/dist/Status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Status.js","names":["Chip","Status","severity","label"],"sources":["../src/Status.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 } from \"./\";\n\nexport
|
|
1
|
+
{"version":3,"file":"Status.js","names":["Chip","Status","severity","label"],"sources":["../src/Status.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 } from \"./\";\n\nexport type StatusProps = {\n /**\n * Determine the color and icon of the alert\n */\n severity: \"default\" | \"error\" | \"info\" | \"success\" | \"warning\";\n\n /**\n * The text content of the status\n */\n label: string;\n};\n\nexport const Status = ({ severity, label }: StatusProps) => (\n <Chip label={label} color={severity} variant=\"status\" />\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAESA,I;;AAcT,OAAO,MAAMC,MAAM,GAAG;EAAA,IAAC;IAAEC,QAAF;IAAYC;EAAZ,CAAD;EAAA,OACpB,KAAC,IAAD;IAAM,KAAK,EAAEA,KAAb;IAAoB,KAAK,EAAED,QAA3B;IAAqC,OAAO,EAAC;EAA7C,EADoB;AAAA,CAAf"}
|
package/dist/Tag.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _Chip from "@mui/material/Chip";
|
|
2
|
+
import { memo, useContext } from "react";
|
|
3
|
+
import { TagListContext } from "./TagListContext.js";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
const Tag = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
isDisabled,
|
|
9
|
+
label,
|
|
10
|
+
onClick,
|
|
11
|
+
onRemove
|
|
12
|
+
} = _ref;
|
|
13
|
+
const {
|
|
14
|
+
chipElementType
|
|
15
|
+
} = useContext(TagListContext);
|
|
16
|
+
return _jsx(_Chip, {
|
|
17
|
+
label: label,
|
|
18
|
+
clickable: onClick ? true : false,
|
|
19
|
+
component: chipElementType,
|
|
20
|
+
disabled: isDisabled,
|
|
21
|
+
onClick: onClick,
|
|
22
|
+
onDelete: onRemove
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const MemoizedTag = memo(Tag);
|
|
27
|
+
export { MemoizedTag as Tag };
|
|
28
|
+
//# sourceMappingURL=Tag.js.map
|
package/dist/Tag.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.js","names":["memo","useContext","TagListContext","Tag","isDisabled","label","onClick","onRemove","chipElementType","MemoizedTag"],"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, ChipProps } from \"@mui/material\";\nimport { memo, useContext } from \"react\";\nimport { TagListContext } from \"./TagListContext\";\n\nexport type TagProps = {\n isDisabled?: boolean;\n label: string;\n onClick?: ChipProps[\"onClick\"];\n onRemove?: ChipProps[\"onDelete\"];\n};\n\nconst Tag = ({ isDisabled, label, onClick, onRemove }: TagProps) => {\n const { chipElementType } = useContext(TagListContext);\n\n return (\n <Chip\n label={label}\n clickable={onClick ? true : false}\n component={chipElementType}\n disabled={isDisabled}\n onClick={onClick}\n onDelete={onRemove}\n />\n );\n};\n\nconst MemoizedTag = memo(Tag);\n\nexport { MemoizedTag as Tag };\n"],"mappings":";AAaA,SAASA,IAAT,EAAeC,UAAf,QAAiC,OAAjC;SACSC,c;;;AAST,MAAMC,GAAG,GAAG,QAAwD;EAAA,IAAvD;IAAEC,UAAF;IAAcC,KAAd;IAAqBC,OAArB;IAA8BC;EAA9B,CAAuD;EAClE,MAAM;IAAEC;EAAF,IAAsBP,UAAU,CAACC,cAAD,CAAtC;EAEA,OACE;IACE,KAAK,EAAEG,KADT;IAEE,SAAS,EAAEC,OAAO,GAAG,IAAH,GAAU,KAF9B;IAGE,SAAS,EAAEE,eAHb;IAIE,QAAQ,EAAEJ,UAJZ;IAKE,OAAO,EAAEE,OALX;IAME,QAAQ,EAAEC;EANZ,EADF;AAUD,CAbD;;AAeA,MAAME,WAAW,GAAGT,IAAI,CAACG,GAAD,CAAxB;AAEA,SAASM,WAAW,IAAIN,GAAxB"}
|
package/dist/TagList.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _Stack from "@mui/material/Stack";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { TagListContext } from "./TagListContext.js";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
const TagList = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
children
|
|
9
|
+
} = _ref;
|
|
10
|
+
const providerValue = useMemo(() => ({
|
|
11
|
+
chipElementType: "li"
|
|
12
|
+
}), []);
|
|
13
|
+
return _jsx(_Stack, {
|
|
14
|
+
component: "ul",
|
|
15
|
+
direction: "row",
|
|
16
|
+
spacing: 2,
|
|
17
|
+
children: _jsx(TagListContext.Provider, {
|
|
18
|
+
value: providerValue,
|
|
19
|
+
children: children
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const MemoizedTagList = memo(TagList);
|
|
25
|
+
export { MemoizedTagList as TagList };
|
|
26
|
+
//# sourceMappingURL=TagList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagList.js","names":["memo","useMemo","TagListContext","TagList","children","providerValue","chipElementType","MemoizedTagList"],"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 \"./\";\nimport { Stack } from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\nimport { ChipElementType, TagListContext } from \"./TagListContext\";\n\nexport type TagListProps = {\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 component=\"ul\" direction=\"row\" spacing={2}>\n <TagListContext.Provider value={providerValue}>\n {children}\n </TagListContext.Provider>\n </Stack>\n );\n};\n\nconst MemoizedTagList = memo(TagList);\n\nexport { MemoizedTagList as TagList };\n"],"mappings":";AAcA,SAASA,IAAT,EAA6BC,OAA7B,QAA4C,OAA5C;SAC0BC,c;;;AAM1B,MAAMC,OAAO,GAAG,QAAgC;EAAA,IAA/B;IAAEC;EAAF,CAA+B;EAC9C,MAAMC,aAAa,GAAGJ,OAAO,CAG3B,OAAO;IACLK,eAAe,EAAE;EADZ,CAAP,CAH2B,EAM3B,EAN2B,CAA7B;EASA,OACE;IAAO,SAAS,EAAC,IAAjB;IAAsB,SAAS,EAAC,KAAhC;IAAsC,OAAO,EAAE,CAA/C;IAAA,UACE,KAAC,cAAD,CAAgB,QAAhB;MAAyB,KAAK,EAAED,aAAhC;MAAA,UACGD;IADH;EADF,EADF;AAOD,CAjBD;;AAmBA,MAAMG,eAAe,GAAGP,IAAI,CAACG,OAAD,CAA5B;AAEA,SAASI,eAAe,IAAIJ,OAA5B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { createContext } from "react";
|
|
13
|
+
export const TagListContext = createContext({
|
|
14
|
+
chipElementType: "div"
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=TagListContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagListContext.js","names":["createContext","TagListContext","chipElementType"],"sources":["../src/TagListContext.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 { createContext } from \"react\";\n\nexport type ChipElementType = \"li\" | \"div\";\n\nexport type TagListContextType = {\n chipElementType: ChipElementType;\n};\n\nexport const TagListContext = createContext<TagListContextType>({\n chipElementType: \"div\",\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAASA,aAAT,QAA8B,OAA9B;AAQA,OAAO,MAAMC,cAAc,GAAGD,aAAa,CAAqB;EAC9DE,eAAe,EAAE;AAD6C,CAArB,CAApC"}
|