@okta/odyssey-react-mui 0.14.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 (105) hide show
  1. package/.browserslistrc +1 -0
  2. package/.eslintrc.cjs +18 -0
  3. package/CHANGELOG.md +10 -0
  4. package/LICENSE +187 -0
  5. package/README.md +64 -0
  6. package/babel.config.cjs +91 -0
  7. package/dist/components/Link/Link.d.ts +18 -0
  8. package/dist/components/Link/Link.d.ts.map +1 -0
  9. package/dist/components/Link/Link.js +36 -0
  10. package/dist/components/Link/Link.js.map +1 -0
  11. package/dist/components/Link/index.d.ts +13 -0
  12. package/dist/components/Link/index.d.ts.map +1 -0
  13. package/dist/components/Link/index.js +13 -0
  14. package/dist/components/Link/index.js.map +1 -0
  15. package/dist/components/PasswordInput/PasswordInput.d.ts +22 -0
  16. package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -0
  17. package/dist/components/PasswordInput/PasswordInput.js +83 -0
  18. package/dist/components/PasswordInput/PasswordInput.js.map +1 -0
  19. package/dist/components/PasswordInput/index.d.ts +13 -0
  20. package/dist/components/PasswordInput/index.d.ts.map +1 -0
  21. package/dist/components/PasswordInput/index.js +13 -0
  22. package/dist/components/PasswordInput/index.js.map +1 -0
  23. package/dist/components/index.d.ts +14 -0
  24. package/dist/components/index.d.ts.map +1 -0
  25. package/dist/components/index.js +14 -0
  26. package/dist/components/index.js.map +1 -0
  27. package/dist/index.d.ts +14 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +14 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/themes/index.d.ts +13 -0
  32. package/dist/themes/index.d.ts.map +1 -0
  33. package/dist/themes/index.js +13 -0
  34. package/dist/themes/index.js.map +1 -0
  35. package/dist/themes/odyssey/components.d.ts +14 -0
  36. package/dist/themes/odyssey/components.d.ts.map +1 -0
  37. package/dist/themes/odyssey/components.js +303 -0
  38. package/dist/themes/odyssey/components.js.map +1 -0
  39. package/dist/themes/odyssey/components.types.d.ts +75 -0
  40. package/dist/themes/odyssey/components.types.d.ts.map +1 -0
  41. package/dist/themes/odyssey/components.types.js +13 -0
  42. package/dist/themes/odyssey/components.types.js.map +1 -0
  43. package/dist/themes/odyssey/index.d.ts +13 -0
  44. package/dist/themes/odyssey/index.d.ts.map +1 -0
  45. package/dist/themes/odyssey/index.js +13 -0
  46. package/dist/themes/odyssey/index.js.map +1 -0
  47. package/dist/themes/odyssey/palette.d.ts +14 -0
  48. package/dist/themes/odyssey/palette.d.ts.map +1 -0
  49. package/dist/themes/odyssey/palette.js +94 -0
  50. package/dist/themes/odyssey/palette.js.map +1 -0
  51. package/dist/themes/odyssey/shape.d.ts +14 -0
  52. package/dist/themes/odyssey/shape.d.ts.map +1 -0
  53. package/dist/themes/odyssey/shape.js +16 -0
  54. package/dist/themes/odyssey/shape.js.map +1 -0
  55. package/dist/themes/odyssey/spacing.d.ts +14 -0
  56. package/dist/themes/odyssey/spacing.d.ts.map +1 -0
  57. package/dist/themes/odyssey/spacing.js +14 -0
  58. package/dist/themes/odyssey/spacing.js.map +1 -0
  59. package/dist/themes/odyssey/theme.d.ts +15 -0
  60. package/dist/themes/odyssey/theme.d.ts.map +1 -0
  61. package/dist/themes/odyssey/theme.js +27 -0
  62. package/dist/themes/odyssey/theme.js.map +1 -0
  63. package/dist/themes/odyssey/typography.d.ts +14 -0
  64. package/dist/themes/odyssey/typography.d.ts.map +1 -0
  65. package/dist/themes/odyssey/typography.js +90 -0
  66. package/dist/themes/odyssey/typography.js.map +1 -0
  67. package/dist/themes/odyssey/typography.types.d.ts +34 -0
  68. package/dist/themes/odyssey/typography.types.d.ts.map +1 -0
  69. package/dist/themes/odyssey/typography.types.js +2 -0
  70. package/dist/themes/odyssey/typography.types.js.map +1 -0
  71. package/dist/utils/index.d.ts +13 -0
  72. package/dist/utils/index.d.ts.map +1 -0
  73. package/dist/utils/index.js +13 -0
  74. package/dist/utils/index.js.map +1 -0
  75. package/dist/utils/oid.d.ts +15 -0
  76. package/dist/utils/oid.d.ts.map +1 -0
  77. package/dist/utils/oid.js +20 -0
  78. package/dist/utils/oid.js.map +1 -0
  79. package/jest.config.cjs +15 -0
  80. package/jest.setup.js +15 -0
  81. package/package.json +32 -0
  82. package/src/components/Link/Link.tsx +44 -0
  83. package/src/components/Link/index.tsx +13 -0
  84. package/src/components/PasswordInput/PasswordInput.test.tsx +51 -0
  85. package/src/components/PasswordInput/PasswordInput.tsx +111 -0
  86. package/src/components/PasswordInput/index.ts +13 -0
  87. package/src/components/index.ts +14 -0
  88. package/src/index.ts +14 -0
  89. package/src/themes/index.ts +13 -0
  90. package/src/themes/odyssey/components.ts +321 -0
  91. package/src/themes/odyssey/components.types.ts +78 -0
  92. package/src/themes/odyssey/index.ts +13 -0
  93. package/src/themes/odyssey/palette.ts +100 -0
  94. package/src/themes/odyssey/shape.ts +18 -0
  95. package/src/themes/odyssey/spacing.ts +27 -0
  96. package/src/themes/odyssey/theme.ts +29 -0
  97. package/src/themes/odyssey/typography.ts +92 -0
  98. package/src/themes/odyssey/typography.types.ts +36 -0
  99. package/src/utils/index.ts +13 -0
  100. package/src/utils/oid.test.ts +21 -0
  101. package/src/utils/oid.ts +22 -0
  102. package/test/a11yCheck.ts +28 -0
  103. package/test/index.ts +13 -0
  104. package/tsconfig.json +3 -0
  105. package/tsconfig.production.json +7 -0
@@ -0,0 +1 @@
1
+ extends @okta/browserslist-config-odyssey
package/.eslintrc.cjs ADDED
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ module.exports = {
14
+ plugins: ["import"],
15
+ rules: {
16
+ "import/no-default-export": "error",
17
+ },
18
+ };
package/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21)
7
+
8
+ ### Features
9
+
10
+ - **odyssey-react-mui:** add component themes, update palette + type ([c4fd294](https://github.com/okta/odyssey/commit/c4fd29488ba333236ce2ea478b2b407337ea08cc))
package/LICENSE ADDED
@@ -0,0 +1,187 @@
1
+ The Okta software accompanied by this notice is provided pursuant to the
2
+ following terms:
3
+
4
+ Copyright © 2018-Present, Okta, Inc.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
7
+ this file except in compliance with the License. You may obtain a copy of the
8
+ License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by
9
+ applicable law or agreed to in writing, software distributed under the License
10
+ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11
+ KIND, either express or implied. See the License for the specific language
12
+ governing permissions and limitations under the License.
13
+
14
+ The Okta software accompanied by this notice has build dependencies on certain
15
+ third party software licensed under separate terms ("Third Party Components")
16
+ located in THIRD_PARTY_NOTICES.
17
+
18
+
19
+ Apache License
20
+ Version 2.0, January 2004
21
+ http://www.apache.org/licenses/
22
+
23
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
24
+
25
+ 1. Definitions.
26
+
27
+ "License" shall mean the terms and conditions for use, reproduction, and
28
+ distribution as defined by Sections 1 through 9 of this document.
29
+
30
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
31
+ owner that is granting the License.
32
+
33
+ "Legal Entity" shall mean the union of the acting entity and all other entities
34
+ that control, are controlled by, or are under common control with that entity.
35
+ For the purposes of this definition, "control" means (i) the power, direct or
36
+ indirect, to cause the direction or management of such entity, whether by
37
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
38
+ outstanding shares, or (iii) beneficial ownership of such entity.
39
+
40
+ You" (or "Your") shall mean an individual or Legal Entity exercising
41
+ permissions granted by this License.
42
+
43
+ "Source" form shall mean the preferred form for making modifications, including
44
+ but not limited to software source code, documentation source, and
45
+ configuration files.
46
+
47
+ "Object" form shall mean any form resulting from mechanical transformation or
48
+ translation of a Source form, including but not limited to compiled object
49
+ code, generated documentation, and conversions to other media types.
50
+
51
+ "Work" shall mean the work of authorship, whether in Source or Object form,
52
+ made available under the License, as indicated by a copyright notice that is
53
+ included in or attached to the work (an example is provided in the Appendix
54
+ below).
55
+
56
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
57
+ is based on (or derived from) the Work and for which the editorial revisions,
58
+ annotations, elaborations, or other modifications represent, as a whole, an
59
+ original work of authorship. For the purposes of this License, Derivative Works
60
+ shall not include works that remain separable from, or merely link (or bind by
61
+ name) to the interfaces of, the Work and Derivative Works thereof.
62
+
63
+ "Contribution" shall mean any work of authorship, including the original
64
+ version of the Work and any modifications or additions to that Work or
65
+ Derivative Works thereof, that is intentionally submitted to Licensor for
66
+ inclusion in the Work by the copyright owner or by an individual or Legal
67
+ Entity authorized to submit on behalf of the copyright owner. For the purposes
68
+ of this definition, "submitted" means any form of electronic, verbal, or
69
+ written communication sent to the Licensor or its representatives, including
70
+ but not limited to communication on electronic mailing lists, source code
71
+ control systems, and issue tracking systems that are managed by, or on behalf
72
+ of, the Licensor for the purpose of discussing and improving the Work, but
73
+ excluding communication that is conspicuously marked or otherwise designated in
74
+ writing by the copyright owner as "Not a Contribution."
75
+
76
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
77
+ of whom a Contribution has been received by Licensor and subsequently
78
+ incorporated within the Work.
79
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
80
+ License, each Contributor hereby grants to You a perpetual, worldwide,
81
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
82
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
83
+ sublicense, and distribute the Work and such Derivative Works in Source or
84
+ Object form.
85
+
86
+ 3. Grant of Patent License. Subject to the terms and conditions of this
87
+ License, each Contributor hereby grants to You a perpetual, worldwide,
88
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
89
+ section) patent license to make, have made, use, offer to sell, sell, import,
90
+ and otherwise transfer the Work, where such license applies only to those
91
+ patent claims licensable by such Contributor that are necessarily infringed by
92
+ their Contribution(s) alone or by combination of their Contribution(s) with the
93
+ Work to which such Contribution(s) was submitted. If You institute patent
94
+ litigation against any entity (including a cross-claim or counterclaim in a
95
+ lawsuit) alleging that the Work or a Contribution incorporated within the Work
96
+ constitutes direct or contributory patent infringement, then any patent
97
+ licenses granted to You under this License for that Work shall terminate as of
98
+ the date such litigation is filed.
99
+
100
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
101
+ Derivative Works thereof in any medium, with or without modifications, and in
102
+ Source or Object form, provided that You meet the following conditions:
103
+
104
+ (a) You must give any other recipients of the Work or Derivative Works a copy
105
+ of this License; and
106
+
107
+ (b) You must cause any modified files to carry prominent notices stating that
108
+ You changed the files; and
109
+
110
+ (c) You must retain, in the Source form of any Derivative Works that You
111
+ distribute, all copyright, patent, trademark, and attribution notices from the
112
+ Source form of the Work, excluding those notices that do not pertain to any
113
+ part of the Derivative Works; and
114
+
115
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then
116
+ any Derivative Works that You distribute must include a readable copy of the
117
+ attribution notices contained within such NOTICE file, excluding those notices
118
+ that do not pertain to any part of the Derivative Works, in at least one of the
119
+ following places: within a NOTICE text file distributed as part of the
120
+ Derivative Works; within the Source form or documentation, if provided along
121
+ with the Derivative Works; or, within a display generated by the Derivative
122
+ Works, if and wherever such third-party notices normally appear. The contents
123
+ of the NOTICE file are for informational purposes only and do not modify the
124
+ License. You may add Your own attribution notices within Derivative Works that
125
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
126
+ provided that such additional attribution notices cannot be construed as
127
+ modifying the License.
128
+
129
+ You may add Your own copyright statement to Your modifications and may provide
130
+ additional or different license terms and conditions for use, reproduction, or
131
+ distribution of Your modifications, or for any such Derivative Works as a
132
+ whole, provided Your use, reproduction, and distribution of the Work otherwise
133
+ complies with the conditions stated in this License.
134
+
135
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
136
+ Contribution intentionally submitted for inclusion in the Work by You to the
137
+ Licensor shall be under the terms and conditions of this License, without any
138
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
139
+ supersede or modify the terms of any separate license agreement you may have
140
+ executed with Licensor regarding such Contributions.
141
+
142
+ 6. Trademarks. This License does not grant permission to use the trade names,
143
+ trademarks, service marks, or product names of the Licensor, except as required
144
+ for reasonable and customary use in describing the origin of the Work and
145
+ reproducing the content of the NOTICE file.
146
+
147
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
148
+ writing, Licensor provides the Work (and each Contributor provides its
149
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
150
+ KIND, either express or implied, including, without limitation, any warranties
151
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
152
+ PARTICULAR PURPOSE. You are solely responsible for determining the
153
+ appropriateness of using or redistributing the Work and assume any risks
154
+ associated with Your exercise of permissions under this License.
155
+
156
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
157
+ tort (including negligence), contract, or otherwise, unless required by
158
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
159
+ writing, shall any Contributor be liable to You for damages, including any
160
+ direct, indirect, special, incidental, or consequential damages of any
161
+ character arising as a result of this License or out of the use or inability to
162
+ use the Work (including but not limited to damages for loss of goodwill, work
163
+ stoppage, computer failure or malfunction, or any and all other commercial
164
+ damages or losses), even if such Contributor has been advised of the
165
+ possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
168
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
169
+ acceptance of support, warranty, indemnity, or other liability obligations
170
+ and/or rights consistent with this License. However, in accepting such
171
+ obligations, You may act only on Your own behalf and on Your sole
172
+ responsibility, not on behalf of any other Contributor, and only if You agree
173
+ to indemnify, defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason of your
175
+ accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following boilerplate
182
+ notice, with the fields enclosed by brackets "[]" replaced with your own
183
+ identifying information. (Don't include the brackets!) The text should be
184
+ enclosed in the appropriate comment syntax for the file format. We also
185
+ recommend that a file or class name and description of purpose be included on
186
+ the same "printed page" as the copyright notice for easier identification
187
+ within third-party archives.
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # @okta/odyssey-react-mui
2
+
3
+ ## Production Readiness
4
+
5
+ This project has not yet hit version 1.0.0 and is still in active development.
6
+
7
+ That said, it is beyond the early alpha stage in some key areas. For some
8
+ early-adopters that means it is good enough to use for real things. Some
9
+ other people think this means it is not ready yet.
10
+
11
+ Even though the project is in development, effort is still made to keep
12
+ the API stable. Patch versions are intended for backwards-compatible
13
+ changes and minor versions are intended for backwards-incompatible changes.
14
+
15
+ If you plan to use this for something real, you should either pin the
16
+ exact version (maximum safety) or pin the major and minor versions
17
+ (only accept backwards-compatible upgrades).
18
+
19
+ ## Getting Started
20
+
21
+ Install the package and peer dependencies:
22
+
23
+ ```sh
24
+ $ yarn add @okta/odyssey-react-mui @emotion/react @mui/material @mui/icons-material
25
+ ```
26
+
27
+ Include fonts:
28
+
29
+ ```html
30
+ <link rel="preconnect" href="https://fonts.gstatic.com" />
31
+ <link
32
+ rel="stylesheet"
33
+ href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,400;0,600;1,400;1,600&display=swap"
34
+ />
35
+ <link
36
+ rel="stylesheet"
37
+ href="https://fonts.googleapis.com/css2?family=Inconsolata&display=swap"
38
+ />
39
+ ```
40
+
41
+ Import named ESM exports:
42
+
43
+ ```js
44
+ import { PasswordInput } from "@okta/odyssey-react-mui";
45
+ ```
46
+
47
+ ## Components
48
+
49
+ Components are published in an ESM format transpiled for the modern browsers
50
+ within the [Okta supported browser list][1]. These modules can be served
51
+ directly to evergreen browsers for simple applications, or further transpiled,
52
+ bundled, and polyfilled for advanced use cases and browser support targets.
53
+
54
+ [1]: https://help.okta.com/en/prod/Content/Topics/Miscellaneous/Platforms_Browser_OS_Support.htm
55
+
56
+ ## License
57
+
58
+ [Apache Version 2.0](https://github.com/okta/odyssey/blob/master/LICENSE)
59
+
60
+ ## Support Disclaimer
61
+
62
+ This library is community supported and is maintained by members of the Okta team for developers and IT professionals.
63
+ This library is not an official Okta product and does not qualify for any Okta support. Anyone who chooses to use this
64
+ library must ensure that their implementation meets any applicable legal obligations including any Okta terms and conditions.
@@ -0,0 +1,91 @@
1
+ /*!
2
+ * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ module.exports = {
14
+ presets: [
15
+ [
16
+ "@okta/odyssey-babel-preset",
17
+ {
18
+ odyssey: false,
19
+ react: {
20
+ runtime: "classic",
21
+ },
22
+ },
23
+ ],
24
+ ],
25
+
26
+ plugins: [
27
+ [
28
+ "babel-plugin-import",
29
+ {
30
+ libraryName: "@mui/material",
31
+ libraryDirectory: "",
32
+ camel2DashComponentName: false,
33
+ },
34
+ "core",
35
+ ],
36
+ [
37
+ "babel-plugin-import",
38
+ {
39
+ libraryName: "@mui/icons-material",
40
+ libraryDirectory: "",
41
+ camel2DashComponentName: false,
42
+ },
43
+ "icons",
44
+ ],
45
+ ],
46
+
47
+ env: {
48
+ production: {
49
+ plugins: [
50
+ "@okta/fully-specified",
51
+ [
52
+ "babel-plugin-import",
53
+ {
54
+ libraryName: "@mui/material",
55
+ libraryDirectory: "",
56
+ camel2DashComponentName: false,
57
+ },
58
+ "core",
59
+ ],
60
+ [
61
+ "babel-plugin-import",
62
+ {
63
+ libraryName: "@mui/icons-material",
64
+ libraryDirectory: "",
65
+ camel2DashComponentName: false,
66
+ },
67
+ "icons",
68
+ ],
69
+ ],
70
+ presets: [
71
+ [
72
+ "@okta/odyssey-babel-preset",
73
+ {
74
+ odyssey: false,
75
+ env: {
76
+ modules: false,
77
+ },
78
+ react: {
79
+ runtime: "classic",
80
+ },
81
+ },
82
+ ],
83
+ ],
84
+ comments: false,
85
+ shouldPrintComment: (val) => {
86
+ return /Okta, Inc\.|@license|@preserve/.test(val);
87
+ },
88
+ ignore: [/\.test\.|\.stories\./i],
89
+ },
90
+ },
91
+ };
@@ -0,0 +1,18 @@
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 React, { ReactElement } from "react";
13
+ import type { LinkProps as MuiLinkProps } from "@mui/material";
14
+ export interface LinkProps extends MuiLinkProps {
15
+ icon?: ReactElement;
16
+ }
17
+ export declare const Link: React.ForwardRefExoticComponent<Pick<LinkProps, "type" | "defaultValue" | "classes" | "children" | "onChange" | "onKeyUp" | "onKeyDown" | "onBlur" | "onFocus" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "margin" | "sx" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "key" | "media" | "target" | "href" | "download" | "hrefLang" | "ping" | "rel" | "referrerPolicy" | "align" | "noWrap" | "variant" | "gutterBottom" | "paragraph" | "variantMapping" | "TypographyClasses" | "underline" | "icon"> & React.RefAttributes<HTMLAnchorElement | HTMLLinkElement>>;
18
+ //# sourceMappingURL=Link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAc,YAAY,EAAE,MAAM,OAAO,CAAC;AAGxD,OAAO,KAAK,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,igMAsBhB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import _Link from "@mui/material/Link";
2
+ import _SvgIcon from "@mui/material/SvgIcon";
3
+
4
+ /*!
5
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
6
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
7
+ *
8
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ *
13
+ * See the License for the specific language governing permissions and limitations under the License.
14
+ */
15
+ import React, { forwardRef } from "react";
16
+ export const Link = forwardRef(props => {
17
+ const {
18
+ icon,
19
+ children,
20
+ target
21
+ } = props;
22
+ return React.createElement(_Link, props, React.createElement("span", {
23
+ className: "Link-icon"
24
+ }, icon), children, target === "_blank" && React.createElement("span", {
25
+ className: "Link-indicator",
26
+ role: "presentation"
27
+ }, React.createElement(_SvgIcon, {
28
+ viewBox: "0 0 16 16"
29
+ }, React.createElement("path", {
30
+ fillRule: "evenodd",
31
+ clipRule: "evenodd",
32
+ 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",
33
+ fill: "currentColor"
34
+ }))));
35
+ });
36
+ //# sourceMappingURL=Link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Link/Link.tsx"],"names":["React","forwardRef","Link","props","icon","children","target"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAOA,KAAP,IAAgBC,UAAhB,QAAgD,OAAhD;AASA,OAAO,MAAMC,IAAI,GAAGD,UAAU,CAC3BE,KAAD,IAAW;AACT,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA;AAAlB,MAA6BH,KAAnC;AACA,SACE,2BAAaA,KAAb,EACE;AAAM,IAAA,SAAS,EAAC;AAAhB,KAA6BC,IAA7B,CADF,EAEGC,QAFH,EAGGC,MAAM,KAAK,QAAX,IACC;AAAM,IAAA,SAAS,EAAC,gBAAhB;AAAiC,IAAA,IAAI,EAAC;AAAtC,KACE;AAAS,IAAA,OAAO,EAAC;AAAjB,KACE;AACE,IAAA,QAAQ,EAAC,SADX;AAEE,IAAA,QAAQ,EAAC,SAFX;AAGE,IAAA,CAAC,EAAC,yKAHJ;AAIE,IAAA,IAAI,EAAC;AAJP,IADF,CADF,CAJJ,CADF;AAkBD,CArB2B,CAAvB","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, { forwardRef, ReactElement } from \"react\";\n\nimport { Link as MuiLink, SvgIcon } from \"@mui/material\";\nimport type { LinkProps as MuiLinkProps } from \"@mui/material\";\n\nexport interface LinkProps extends MuiLinkProps {\n icon?: ReactElement;\n}\n\nexport const Link = forwardRef<HTMLLinkElement | HTMLAnchorElement, LinkProps>(\n (props) => {\n const { icon, children, target } = props;\n return (\n <MuiLink {...props}>\n <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);\n"],"file":"Link.js"}
@@ -0,0 +1,13 @@
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
+ export * from "./Link";
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Link/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,13 @@
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
+ export * from "./Link.js";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Link/index.tsx"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from \"./Link\";\n"],"file":"index.js"}
@@ -0,0 +1,22 @@
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 React from "react";
13
+ import type { Ref } from "react";
14
+ import type { OutlinedInputProps, TooltipProps } from "@mui/material";
15
+ export interface PasswordInputProps extends Omit<OutlinedInputProps, "type" | "label" | "defaultValue" | "ref"> {
16
+ ref?: Ref<HTMLInputElement>;
17
+ defaultValue?: string;
18
+ label: string;
19
+ tooltipLabel?: TooltipProps["title"] | ((isHidden: boolean) => TooltipProps["title"]);
20
+ }
21
+ export declare const PasswordInput: React.ForwardRefExoticComponent<Pick<PasswordInputProps, "label" | "defaultValue" | "classes" | "onChange" | "onKeyUp" | "onKeyDown" | "onBlur" | "onFocus" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoComplete" | "autoFocus" | "components" | "componentsProps" | "disabled" | "disableInjectingGlobalStyles" | "endAdornment" | "error" | "fullWidth" | "inputComponent" | "inputProps" | "inputRef" | "margin" | "multiline" | "name" | "readOnly" | "required" | "renderSuffix" | "rows" | "maxRows" | "minRows" | "size" | "startAdornment" | "sx" | "value" | "notched" | "tooltipLabel"> & React.RefAttributes<HTMLInputElement>>;
22
+ //# sourceMappingURL=PasswordInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordInput.d.ts","sourceRoot":"","sources":["../../../src/components/PasswordInput/PasswordInput.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAwC,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,GAAG,EAA2B,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAiBtE,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,KAAK,CAAC;IAC3E,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EACT,YAAY,CAAC,OAAO,CAAC,GACrB,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,aAAa,09JAqEzB,CAAC"}
@@ -0,0 +1,83 @@
1
+ import _Box from "@mui/material/Box";
2
+ import _OutlinedInput from "@mui/material/OutlinedInput";
3
+ import _InputAdornment from "@mui/material/InputAdornment";
4
+ import _Tooltip from "@mui/material/Tooltip";
5
+ import _IconButton from "@mui/material/IconButton";
6
+ import _Visibility from "@mui/icons-material/Visibility";
7
+ import _VisibilityOff from "@mui/icons-material/VisibilityOff";
8
+ import _InputLabel from "@mui/material/InputLabel";
9
+
10
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11
+
12
+ /*!
13
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
14
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
15
+ *
16
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
19
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ *
21
+ * See the License for the specific language governing permissions and limitations under the License.
22
+ */
23
+ import React, { forwardRef, useState, useMemo } from "react";
24
+ import { useOid } from "../../utils/index.js";
25
+ export const PasswordInput = forwardRef((props, ref) => {
26
+ const {
27
+ tooltipLabel,
28
+ id,
29
+ label,
30
+ defaultValue: password = "",
31
+ inputProps,
32
+ ...rest
33
+ } = props;
34
+ const [values, setValues] = useState({
35
+ password,
36
+ showPassword: false
37
+ });
38
+
39
+ const handlePasswordChange = event => {
40
+ var _props$onChange;
41
+
42
+ setValues({ ...values,
43
+ password: event.target.value
44
+ });
45
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, event);
46
+ };
47
+
48
+ const handleClickShowPassword = () => {
49
+ setValues({ ...values,
50
+ showPassword: !values.showPassword
51
+ });
52
+ };
53
+
54
+ const handleMouseDownPassword = event => {
55
+ event.preventDefault();
56
+ };
57
+
58
+ const tooltipTitle = useMemo(() => {
59
+ return typeof tooltipLabel === "function" ? tooltipLabel(values.showPassword === false) : tooltipLabel;
60
+ }, [values, tooltipLabel]);
61
+ const oid = useOid(id);
62
+ return React.createElement(_Box, null, React.createElement(_InputLabel, {
63
+ htmlFor: oid
64
+ }, label), React.createElement(_OutlinedInput, _extends({}, rest, {
65
+ id: oid,
66
+ inputProps: inputProps,
67
+ inputRef: ref,
68
+ onChange: handlePasswordChange,
69
+ type: values.showPassword ? "text" : "password",
70
+ value: values.password,
71
+ endAdornment: React.createElement(_InputAdornment, {
72
+ position: "end"
73
+ }, React.createElement(_Tooltip, {
74
+ title: tooltipTitle
75
+ }, React.createElement(_IconButton, {
76
+ "aria-label": "toggle password visibility",
77
+ onClick: handleClickShowPassword,
78
+ onMouseDown: handleMouseDownPassword,
79
+ edge: "end"
80
+ }, values.showPassword ? React.createElement(_VisibilityOff, null) : React.createElement(_Visibility, null))))
81
+ })));
82
+ });
83
+ //# sourceMappingURL=PasswordInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/PasswordInput/PasswordInput.tsx"],"names":["React","forwardRef","useState","useMemo","useOid","PasswordInput","props","ref","tooltipLabel","id","label","defaultValue","password","inputProps","rest","values","setValues","showPassword","handlePasswordChange","event","target","value","onChange","handleClickShowPassword","handleMouseDownPassword","preventDefault","tooltipTitle","oid"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAOA,KAAP,IAAgBC,UAAhB,EAA4BC,QAA5B,EAAsCC,OAAtC,QAAqD,OAArD;SAYSC,M;AAiBT,OAAO,MAAMC,aAAa,GAAGJ,UAAU,CACrC,CAACK,KAAD,EAAQC,GAAR,KAAgB;AACd,QAAM;AACJC,IAAAA,YADI;AAEJC,IAAAA,EAFI;AAGJC,IAAAA,KAHI;AAIJC,IAAAA,YAAY,EAAEC,QAAQ,GAAG,EAJrB;AAKJC,IAAAA,UALI;AAMJ,OAAGC;AANC,MAOFR,KAPJ;AASA,QAAM,CAACS,MAAD,EAASC,SAAT,IAAsBd,QAAQ,CAAQ;AAC1CU,IAAAA,QAD0C;AAE1CK,IAAAA,YAAY,EAAE;AAF4B,GAAR,CAApC;;AAKA,QAAMC,oBAAoB,GAAIC,KAAD,IAA0C;AAAA;;AACrEH,IAAAA,SAAS,CAAC,EAAE,GAAGD,MAAL;AAAaH,MAAAA,QAAQ,EAAEO,KAAK,CAACC,MAAN,CAAaC;AAApC,KAAD,CAAT;AACA,uBAAAf,KAAK,CAACgB,QAAN,yEAAAhB,KAAK,EAAYa,KAAZ,CAAL;AACD,GAHD;;AAKA,QAAMI,uBAAuB,GAAG,MAAM;AACpCP,IAAAA,SAAS,CAAC,EACR,GAAGD,MADK;AAERE,MAAAA,YAAY,EAAE,CAACF,MAAM,CAACE;AAFd,KAAD,CAAT;AAID,GALD;;AAOA,QAAMO,uBAAuB,GAAIL,KAAD,IAA0C;AACxEA,IAAAA,KAAK,CAACM,cAAN;AACD,GAFD;;AAIA,QAAMC,YAAY,GAAGvB,OAAO,CAAC,MAAM;AACjC,WAAO,OAAOK,YAAP,KAAwB,UAAxB,GACHA,YAAY,CAACO,MAAM,CAACE,YAAP,KAAwB,KAAzB,CADT,GAEHT,YAFJ;AAGD,GAJ2B,EAIzB,CAACO,MAAD,EAASP,YAAT,CAJyB,CAA5B;AAMA,QAAMmB,GAAG,GAAGvB,MAAM,CAACK,EAAD,CAAlB;AAEA,SACE,gCACE;AAAY,IAAA,OAAO,EAAEkB;AAArB,KAA2BjB,KAA3B,CADF,EAEE,iDACMI,IADN;AAEE,IAAA,EAAE,EAAEa,GAFN;AAGE,IAAA,UAAU,EAAEd,UAHd;AAIE,IAAA,QAAQ,EAAEN,GAJZ;AAKE,IAAA,QAAQ,EAAEW,oBALZ;AAME,IAAA,IAAI,EAAEH,MAAM,CAACE,YAAP,GAAsB,MAAtB,GAA+B,UANvC;AAOE,IAAA,KAAK,EAAEF,MAAM,CAACH,QAPhB;AAQE,IAAA,YAAY,EACV;AAAgB,MAAA,QAAQ,EAAC;AAAzB,OACE;AAAS,MAAA,KAAK,EAAEc;AAAhB,OACE;AACE,oBAAW,4BADb;AAEE,MAAA,OAAO,EAAEH,uBAFX;AAGE,MAAA,WAAW,EAAEC,uBAHf;AAIE,MAAA,IAAI,EAAC;AAJP,OAMGT,MAAM,CAACE,YAAP,GAAsB,yCAAtB,GAA0C,sCAN7C,CADF,CADF;AATJ,KAFF,CADF;AA4BD,CApEoC,CAAhC","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, { forwardRef, useState, useMemo } from \"react\";\nimport type { Ref, ChangeEvent, MouseEvent } from \"react\";\nimport type { OutlinedInputProps, TooltipProps } from \"@mui/material\";\nimport {\n Tooltip,\n IconButton,\n Box,\n InputLabel,\n OutlinedInput,\n InputAdornment,\n} from \"@mui/material\";\nimport { Visibility, VisibilityOff } from \"@mui/icons-material\";\nimport { useOid } from \"../../utils\";\n\ninterface State {\n password: string;\n showPassword: boolean;\n}\n\nexport interface PasswordInputProps\n extends Omit<OutlinedInputProps, \"type\" | \"label\" | \"defaultValue\" | \"ref\"> {\n ref?: Ref<HTMLInputElement>;\n defaultValue?: string;\n label: string;\n tooltipLabel?:\n | TooltipProps[\"title\"]\n | ((isHidden: boolean) => TooltipProps[\"title\"]);\n}\n\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(\n (props, ref) => {\n const {\n tooltipLabel,\n id,\n label,\n defaultValue: password = \"\",\n inputProps,\n ...rest\n } = props;\n\n const [values, setValues] = useState<State>({\n password,\n showPassword: false,\n });\n\n const handlePasswordChange = (event: ChangeEvent<HTMLInputElement>) => {\n setValues({ ...values, password: event.target.value });\n props.onChange?.(event);\n };\n\n const handleClickShowPassword = () => {\n setValues({\n ...values,\n showPassword: !values.showPassword,\n });\n };\n\n const handleMouseDownPassword = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n };\n\n const tooltipTitle = useMemo(() => {\n return typeof tooltipLabel === \"function\"\n ? tooltipLabel(values.showPassword === false)\n : tooltipLabel;\n }, [values, tooltipLabel]);\n\n const oid = useOid(id);\n\n return (\n <Box>\n <InputLabel htmlFor={oid}>{label}</InputLabel>\n <OutlinedInput\n {...rest}\n id={oid}\n inputProps={inputProps}\n inputRef={ref}\n onChange={handlePasswordChange}\n type={values.showPassword ? \"text\" : \"password\"}\n value={values.password}\n endAdornment={\n <InputAdornment position=\"end\">\n <Tooltip title={tooltipTitle}>\n <IconButton\n aria-label=\"toggle password visibility\"\n onClick={handleClickShowPassword}\n onMouseDown={handleMouseDownPassword}\n edge=\"end\"\n >\n {values.showPassword ? <VisibilityOff /> : <Visibility />}\n </IconButton>\n </Tooltip>\n </InputAdornment>\n }\n />\n </Box>\n );\n }\n);\n"],"file":"PasswordInput.js"}