@okta/odyssey-react-mui 0.16.1 → 0.18.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 +121 -0
- package/README.md +7 -19
- package/dist/Banner.d.ts +47 -0
- package/dist/Banner.d.ts.map +1 -0
- package/dist/Banner.js +41 -0
- package/dist/Banner.js.map +1 -0
- package/dist/Link.d.ts +1 -1
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +2 -1
- package/dist/Link.js.map +1 -1
- package/dist/OdysseyCacheProvider.d.ts +23 -0
- package/dist/OdysseyCacheProvider.d.ts.map +1 -0
- package/dist/OdysseyCacheProvider.js +36 -0
- package/dist/OdysseyCacheProvider.js.map +1 -0
- package/dist/OdysseyThemeProvider.d.ts +19 -0
- package/dist/OdysseyThemeProvider.d.ts.map +1 -0
- package/dist/OdysseyThemeProvider.js +32 -0
- package/dist/OdysseyThemeProvider.js.map +1 -0
- package/dist/PasswordInput.d.ts +1 -1
- package/dist/PasswordInput.d.ts.map +1 -1
- package/dist/Radio.d.ts +19 -0
- package/dist/Radio.d.ts.map +1 -0
- package/dist/Radio.js +32 -0
- package/dist/Radio.js.map +1 -0
- package/dist/RadioGroup.d.ts +47 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.js +59 -0
- package/dist/RadioGroup.js.map +1 -0
- package/dist/Status.d.ts +23 -0
- package/dist/Status.d.ts.map +1 -0
- package/dist/Status.js +25 -0
- package/dist/Status.js.map +1 -0
- package/dist/TextField.d.ts +87 -0
- package/dist/TextField.d.ts.map +1 -0
- package/dist/TextField.js +100 -0
- package/dist/TextField.js.map +1 -0
- package/dist/ThemeProvider.d.ts +3 -2
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/ThemeProvider.js +12 -6
- package/dist/ThemeProvider.js.map +1 -1
- package/dist/createUniqueAlphabeticalId.d.ts +14 -0
- package/dist/createUniqueAlphabeticalId.d.ts.map +1 -0
- package/dist/createUniqueAlphabeticalId.js +14 -0
- package/dist/createUniqueAlphabeticalId.js.map +1 -0
- package/dist/createUniqueId.d.ts.map +1 -1
- package/dist/createUniqueId.js.map +1 -1
- package/dist/iconDictionary/Add.d.ts +1 -1
- package/dist/iconDictionary/Add.d.ts.map +1 -1
- package/dist/iconDictionary/AddCircle.d.ts +1 -1
- package/dist/iconDictionary/AddCircle.d.ts.map +1 -1
- package/dist/iconDictionary/AlertCircle.d.ts +1 -1
- package/dist/iconDictionary/AlertCircle.d.ts.map +1 -1
- package/dist/iconDictionary/AlertCircleFilled.d.ts +1 -1
- package/dist/iconDictionary/AlertCircleFilled.d.ts.map +1 -1
- package/dist/iconDictionary/AlertTriangleFilled.d.ts +1 -1
- package/dist/iconDictionary/AlertTriangleFilled.d.ts.map +1 -1
- package/dist/iconDictionary/Anchor.d.ts +1 -1
- package/dist/iconDictionary/Anchor.d.ts.map +1 -1
- package/dist/iconDictionary/ArrowDown.d.ts +1 -1
- package/dist/iconDictionary/ArrowDown.d.ts.map +1 -1
- package/dist/iconDictionary/ArrowLeft.d.ts +1 -1
- package/dist/iconDictionary/ArrowLeft.d.ts.map +1 -1
- package/dist/iconDictionary/ArrowRight.d.ts +1 -1
- package/dist/iconDictionary/ArrowRight.d.ts.map +1 -1
- package/dist/iconDictionary/ArrowUp.d.ts +1 -1
- package/dist/iconDictionary/ArrowUp.d.ts.map +1 -1
- package/dist/iconDictionary/ArrowUpDown.d.ts +1 -1
- package/dist/iconDictionary/ArrowUpDown.d.ts.map +1 -1
- package/dist/iconDictionary/Calendar.d.ts +1 -1
- package/dist/iconDictionary/Calendar.d.ts.map +1 -1
- package/dist/iconDictionary/Check.d.ts +1 -1
- package/dist/iconDictionary/Check.d.ts.map +1 -1
- package/dist/iconDictionary/CheckCircleFilled.d.ts +1 -1
- package/dist/iconDictionary/CheckCircleFilled.d.ts.map +1 -1
- package/dist/iconDictionary/ChevronDown.d.ts +1 -1
- package/dist/iconDictionary/ChevronDown.d.ts.map +1 -1
- package/dist/iconDictionary/ChevronUp.d.ts +1 -1
- package/dist/iconDictionary/ChevronUp.d.ts.map +1 -1
- package/dist/iconDictionary/Close.d.ts +1 -1
- package/dist/iconDictionary/Close.d.ts.map +1 -1
- package/dist/iconDictionary/CloseCircleFilled.d.ts +1 -1
- package/dist/iconDictionary/CloseCircleFilled.d.ts.map +1 -1
- package/dist/iconDictionary/Copy.d.ts +1 -1
- package/dist/iconDictionary/Copy.d.ts.map +1 -1
- package/dist/iconDictionary/Delete.d.ts +1 -1
- package/dist/iconDictionary/Delete.d.ts.map +1 -1
- package/dist/iconDictionary/Download.d.ts +1 -1
- package/dist/iconDictionary/Download.d.ts.map +1 -1
- package/dist/iconDictionary/DragHandle.d.ts +1 -1
- package/dist/iconDictionary/DragHandle.d.ts.map +1 -1
- package/dist/iconDictionary/Edit.d.ts +1 -1
- package/dist/iconDictionary/Edit.d.ts.map +1 -1
- package/dist/iconDictionary/ExternalLink.d.ts +1 -1
- package/dist/iconDictionary/ExternalLink.d.ts.map +1 -1
- package/dist/iconDictionary/Eye.d.ts +1 -1
- package/dist/iconDictionary/Eye.d.ts.map +1 -1
- package/dist/iconDictionary/EyeOff.d.ts +1 -1
- package/dist/iconDictionary/EyeOff.d.ts.map +1 -1
- package/dist/iconDictionary/Filter.d.ts +1 -1
- package/dist/iconDictionary/Filter.d.ts.map +1 -1
- package/dist/iconDictionary/Globe.d.ts +1 -1
- package/dist/iconDictionary/Globe.d.ts.map +1 -1
- package/dist/iconDictionary/Home.d.ts +1 -1
- package/dist/iconDictionary/Home.d.ts.map +1 -1
- package/dist/iconDictionary/InformationCircle.d.ts +1 -1
- package/dist/iconDictionary/InformationCircle.d.ts.map +1 -1
- package/dist/iconDictionary/InformationCircleFilled.d.ts +1 -1
- package/dist/iconDictionary/InformationCircleFilled.d.ts.map +1 -1
- package/dist/iconDictionary/Notification.d.ts +1 -1
- package/dist/iconDictionary/Notification.d.ts.map +1 -1
- package/dist/iconDictionary/OverflowVertical.d.ts +1 -1
- package/dist/iconDictionary/OverflowVertical.d.ts.map +1 -1
- package/dist/iconDictionary/QuestionCircle.d.ts +1 -1
- package/dist/iconDictionary/QuestionCircle.d.ts.map +1 -1
- package/dist/iconDictionary/QuestionCircleFilled.d.ts +1 -1
- package/dist/iconDictionary/QuestionCircleFilled.d.ts.map +1 -1
- package/dist/iconDictionary/Search.d.ts +1 -1
- package/dist/iconDictionary/Search.d.ts.map +1 -1
- package/dist/iconDictionary/Settings.d.ts +1 -1
- package/dist/iconDictionary/Settings.d.ts.map +1 -1
- package/dist/iconDictionary/Subtract.d.ts +1 -1
- package/dist/iconDictionary/Subtract.d.ts.map +1 -1
- package/dist/iconDictionary/User.d.ts +1 -1
- package/dist/iconDictionary/User.d.ts.map +1 -1
- package/dist/iconDictionary/UserGroup.d.ts +1 -1
- package/dist/iconDictionary/UserGroup.d.ts.map +1 -1
- package/dist/index.d.ts +13 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +645 -174
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/components.types.d.ts +5 -0
- package/dist/theme/components.types.d.ts.map +1 -1
- package/dist/theme/components.types.js.map +1 -1
- package/dist/theme/typography.d.ts.map +1 -1
- package/dist/theme/typography.js +6 -0
- package/dist/theme/typography.js.map +1 -1
- package/dist/theme/typography.types.d.ts +3 -3
- package/dist/theme/typography.types.d.ts.map +1 -1
- package/dist/theme/typography.types.js.map +1 -1
- package/dist/useUniqueAlphabeticalId.d.ts +13 -0
- package/dist/useUniqueAlphabeticalId.d.ts.map +1 -0
- package/dist/useUniqueAlphabeticalId.js +18 -0
- package/dist/useUniqueAlphabeticalId.js.map +1 -0
- package/dist/useUniqueId.d.ts.map +1 -1
- package/dist/useUniqueId.js +1 -1
- package/dist/useUniqueId.js.map +1 -1
- package/package.json +8 -7
- package/src/Banner.tsx +69 -0
- package/src/Link.tsx +21 -23
- package/src/OdysseyCacheProvider.test.tsx +38 -0
- package/src/OdysseyCacheProvider.tsx +48 -0
- package/src/OdysseyThemeProvider.tsx +44 -0
- package/src/Radio.tsx +28 -0
- package/src/RadioGroup.tsx +105 -0
- package/src/Status.tsx +29 -0
- package/src/TextField.tsx +220 -0
- package/src/ThemeProvider.tsx +11 -5
- package/src/createUniqueAlphabeticalId.test.ts +22 -0
- package/src/createUniqueAlphabeticalId.ts +19 -0
- package/src/createUniqueId.ts +1 -1
- package/src/index.ts +35 -14
- package/src/theme/components.tsx +585 -85
- package/src/theme/components.types.ts +7 -0
- package/src/theme/typography.ts +6 -0
- package/src/theme/typography.types.ts +3 -3
- package/src/useUniqueAlphabeticalId.ts +21 -0
- package/src/useUniqueId.ts +2 -2
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
ChangeEventHandler,
|
|
15
|
+
FocusEventHandler,
|
|
16
|
+
forwardRef,
|
|
17
|
+
InputHTMLAttributes,
|
|
18
|
+
memo,
|
|
19
|
+
ReactNode,
|
|
20
|
+
useCallback,
|
|
21
|
+
useEffect,
|
|
22
|
+
useMemo,
|
|
23
|
+
useState,
|
|
24
|
+
} from "react";
|
|
25
|
+
import {
|
|
26
|
+
EyeIcon,
|
|
27
|
+
EyeOffIcon,
|
|
28
|
+
FormControl,
|
|
29
|
+
FormHelperText,
|
|
30
|
+
IconButton,
|
|
31
|
+
InputAdornment,
|
|
32
|
+
InputBase,
|
|
33
|
+
InputLabel,
|
|
34
|
+
SearchIcon,
|
|
35
|
+
Typography,
|
|
36
|
+
visuallyHidden,
|
|
37
|
+
useUniqueId,
|
|
38
|
+
} from "./";
|
|
39
|
+
|
|
40
|
+
export type TextFieldProps = {
|
|
41
|
+
/**
|
|
42
|
+
* This prop helps users to fill forms faster, especially on mobile devices.
|
|
43
|
+
* The name can be confusing, as it's more like an autofill.
|
|
44
|
+
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
|
45
|
+
*/
|
|
46
|
+
autoCompleteType?: InputHTMLAttributes<HTMLInputElement>["autoComplete"];
|
|
47
|
+
/**
|
|
48
|
+
* If `true`, the component is disabled.
|
|
49
|
+
*/
|
|
50
|
+
isDisabled?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* End `InputAdornment` for this component.
|
|
53
|
+
*/
|
|
54
|
+
endAdornment?: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* If `error` is not undefined, the `input` will indicate an error.
|
|
57
|
+
*/
|
|
58
|
+
errorMessage?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The helper text content.
|
|
61
|
+
*/
|
|
62
|
+
hint?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The id of the `input` element.
|
|
65
|
+
*/
|
|
66
|
+
id?: string;
|
|
67
|
+
/**
|
|
68
|
+
* The label for the `input` element.
|
|
69
|
+
*/
|
|
70
|
+
label?: string;
|
|
71
|
+
/**
|
|
72
|
+
* If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.
|
|
73
|
+
*/
|
|
74
|
+
isMultiline?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Callback fired when the value is changed.
|
|
77
|
+
*/
|
|
78
|
+
onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
|
|
79
|
+
/**
|
|
80
|
+
* Callback fired when the `input` element get focus.
|
|
81
|
+
*/
|
|
82
|
+
onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
83
|
+
/**
|
|
84
|
+
* The label for the `input` element if the it's not optional
|
|
85
|
+
*/
|
|
86
|
+
optionalLabel?: string;
|
|
87
|
+
/**
|
|
88
|
+
* The short hint displayed in the `input` before the user enters a value.
|
|
89
|
+
*/
|
|
90
|
+
placeholder?: string;
|
|
91
|
+
/**
|
|
92
|
+
* It prevents the user from changing the value of the field
|
|
93
|
+
*/
|
|
94
|
+
isReadOnly?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* If `true`, the `input` element is required.
|
|
97
|
+
*/
|
|
98
|
+
isRequired?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Start `InputAdornment` for this component.
|
|
101
|
+
*/
|
|
102
|
+
startAdornment?: ReactNode;
|
|
103
|
+
/**
|
|
104
|
+
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
|
|
105
|
+
*/
|
|
106
|
+
type?: string;
|
|
107
|
+
/**
|
|
108
|
+
* The value of the `input` element, required for a controlled component.
|
|
109
|
+
*/
|
|
110
|
+
value?: unknown;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const TextField = forwardRef<HTMLInputElement, TextFieldProps>((props, ref) => {
|
|
114
|
+
const {
|
|
115
|
+
autoCompleteType,
|
|
116
|
+
isDisabled = false,
|
|
117
|
+
endAdornment,
|
|
118
|
+
errorMessage,
|
|
119
|
+
hint,
|
|
120
|
+
id: idOverride,
|
|
121
|
+
label,
|
|
122
|
+
isMultiline = false,
|
|
123
|
+
onChange,
|
|
124
|
+
onFocus,
|
|
125
|
+
optionalLabel,
|
|
126
|
+
placeholder,
|
|
127
|
+
isReadOnly,
|
|
128
|
+
isRequired = true,
|
|
129
|
+
startAdornment,
|
|
130
|
+
type = "text",
|
|
131
|
+
value,
|
|
132
|
+
} = props;
|
|
133
|
+
|
|
134
|
+
const [inputType, setInputType] = useState(type);
|
|
135
|
+
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
setInputType(type);
|
|
138
|
+
}, [type]);
|
|
139
|
+
|
|
140
|
+
const togglePasswordVisibility = useCallback(() => {
|
|
141
|
+
setInputType((currentType) =>
|
|
142
|
+
currentType === "password" ? "text" : "password"
|
|
143
|
+
);
|
|
144
|
+
}, []);
|
|
145
|
+
|
|
146
|
+
const id = useUniqueId(idOverride);
|
|
147
|
+
const hintId = hint ? `${id}-hint` : undefined;
|
|
148
|
+
const errorId = errorMessage ? `${id}-error` : undefined;
|
|
149
|
+
const labelId = label ? `${id}-label` : undefined;
|
|
150
|
+
|
|
151
|
+
const inputProps = useMemo(
|
|
152
|
+
() =>
|
|
153
|
+
errorId || hintId
|
|
154
|
+
? {
|
|
155
|
+
"aria-describedby":
|
|
156
|
+
errorId && hintId ? `${hintId} ${errorId}` : errorId || hintId,
|
|
157
|
+
}
|
|
158
|
+
: undefined,
|
|
159
|
+
[errorId, hintId]
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<FormControl disabled={isDisabled} error={Boolean(errorMessage)}>
|
|
164
|
+
<InputLabel htmlFor={id} id={labelId}>
|
|
165
|
+
{label}
|
|
166
|
+
{!isRequired && (
|
|
167
|
+
<Typography variant="subtitle1">{optionalLabel}</Typography>
|
|
168
|
+
)}
|
|
169
|
+
</InputLabel>
|
|
170
|
+
{hint && <FormHelperText id={hintId}>{hint}</FormHelperText>}
|
|
171
|
+
<InputBase
|
|
172
|
+
autoComplete={autoCompleteType}
|
|
173
|
+
endAdornment={
|
|
174
|
+
inputType === "password" ? (
|
|
175
|
+
<InputAdornment position="end">
|
|
176
|
+
<IconButton
|
|
177
|
+
aria-label="toggle password visibility"
|
|
178
|
+
edge="end"
|
|
179
|
+
onClick={togglePasswordVisibility}
|
|
180
|
+
>
|
|
181
|
+
{inputType === "password" ? <EyeIcon /> : <EyeOffIcon />}
|
|
182
|
+
</IconButton>
|
|
183
|
+
</InputAdornment>
|
|
184
|
+
) : (
|
|
185
|
+
endAdornment
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
id={id}
|
|
189
|
+
inputProps={inputProps}
|
|
190
|
+
multiline={isMultiline}
|
|
191
|
+
onChange={onChange}
|
|
192
|
+
onFocus={onFocus}
|
|
193
|
+
placeholder={placeholder}
|
|
194
|
+
readOnly={isReadOnly}
|
|
195
|
+
ref={ref}
|
|
196
|
+
startAdornment={
|
|
197
|
+
inputType === "search" ? (
|
|
198
|
+
<InputAdornment position="start">
|
|
199
|
+
<SearchIcon />
|
|
200
|
+
</InputAdornment>
|
|
201
|
+
) : (
|
|
202
|
+
startAdornment
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
type={inputType}
|
|
206
|
+
value={value}
|
|
207
|
+
/>
|
|
208
|
+
{errorMessage && (
|
|
209
|
+
<FormHelperText error id={errorId}>
|
|
210
|
+
<span style={visuallyHidden}>Error:</span>
|
|
211
|
+
{errorMessage}
|
|
212
|
+
</FormHelperText>
|
|
213
|
+
)}
|
|
214
|
+
</FormControl>
|
|
215
|
+
);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
const MemoizedTextField = memo(TextField);
|
|
219
|
+
|
|
220
|
+
export { MemoizedTextField as TextField };
|
package/src/ThemeProvider.tsx
CHANGED
|
@@ -10,11 +10,17 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
import { ReactElement } from "react";
|
|
13
|
+
import { memo, ReactElement } from "react";
|
|
15
14
|
|
|
16
|
-
import {
|
|
15
|
+
import { OdysseyCacheProvider } from "./OdysseyCacheProvider";
|
|
16
|
+
import { OdysseyThemeProvider } from "./OdysseyThemeProvider";
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
<
|
|
18
|
+
const ThemeProvider = ({ children }: { children: ReactElement }) => (
|
|
19
|
+
<OdysseyCacheProvider>
|
|
20
|
+
<OdysseyThemeProvider>{children}</OdysseyThemeProvider>
|
|
21
|
+
</OdysseyCacheProvider>
|
|
20
22
|
);
|
|
23
|
+
|
|
24
|
+
const MemoizedThemeProvider = memo(ThemeProvider);
|
|
25
|
+
|
|
26
|
+
export { MemoizedThemeProvider as ThemeProvider };
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import { createUniqueAlphabeticalId } from "./createUniqueAlphabeticalId";
|
|
14
|
+
|
|
15
|
+
describe("createUniqueAlphabeticalId", () => {
|
|
16
|
+
it("only has lowercase letters", () => {
|
|
17
|
+
const uniqueAlphabeticalId = createUniqueAlphabeticalId();
|
|
18
|
+
|
|
19
|
+
expect(uniqueAlphabeticalId.match(/[a-z]/)).not.toBeNull();
|
|
20
|
+
expect(uniqueAlphabeticalId.toLowerCase()).toBe(uniqueAlphabeticalId);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
// This is a random number chosen to shrink down the unique ID to an arbitrary length.
|
|
14
|
+
export const uniqueIdLength = 6;
|
|
15
|
+
|
|
16
|
+
export const createUniqueAlphabeticalId = () =>
|
|
17
|
+
Math.random()
|
|
18
|
+
.toString(36)
|
|
19
|
+
.replace(/[\d\.]/g, "");
|
package/src/createUniqueId.ts
CHANGED
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
// This is a random number chosen to shrink down the unique ID to an arbitrary length.
|
|
14
14
|
export const uniqueIdLength = 6;
|
|
15
15
|
|
|
16
|
-
export const createUniqueId = ()
|
|
16
|
+
export const createUniqueId = () =>
|
|
17
17
|
Math.random().toString(36).slice(-uniqueIdLength);
|
package/src/index.ts
CHANGED
|
@@ -10,21 +10,13 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export * from "./createUniqueId";
|
|
14
|
-
export * from "./Icon";
|
|
15
|
-
export * from "./iconDictionary";
|
|
16
|
-
export * from "./Link";
|
|
17
|
-
export * from "./PasswordInput";
|
|
18
|
-
export * from "./theme";
|
|
19
|
-
export * from "./ThemeProvider";
|
|
20
|
-
export * from "./useUniqueId";
|
|
21
|
-
|
|
22
13
|
export {
|
|
23
14
|
Alert,
|
|
24
15
|
AlertTitle,
|
|
25
16
|
Box,
|
|
26
17
|
Button,
|
|
27
18
|
Checkbox,
|
|
19
|
+
Chip,
|
|
28
20
|
CircularProgress,
|
|
29
21
|
CssBaseline,
|
|
30
22
|
Dialog,
|
|
@@ -41,8 +33,13 @@ export {
|
|
|
41
33
|
InputAdornment,
|
|
42
34
|
InputBase,
|
|
43
35
|
InputLabel,
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
List,
|
|
37
|
+
ListItem,
|
|
38
|
+
ListItemIcon,
|
|
39
|
+
ListItemText,
|
|
40
|
+
ListSubheader,
|
|
41
|
+
MenuItem,
|
|
42
|
+
ScopedCssBaseline,
|
|
46
43
|
Select,
|
|
47
44
|
Snackbar,
|
|
48
45
|
Stack,
|
|
@@ -67,6 +64,7 @@ export type {
|
|
|
67
64
|
BoxProps,
|
|
68
65
|
ButtonProps,
|
|
69
66
|
CheckboxProps,
|
|
67
|
+
ChipProps,
|
|
70
68
|
CircularProgressProps,
|
|
71
69
|
CssBaselineProps,
|
|
72
70
|
DialogProps,
|
|
@@ -83,8 +81,14 @@ export type {
|
|
|
83
81
|
InputAdornmentProps,
|
|
84
82
|
InputBaseProps,
|
|
85
83
|
InputLabelProps,
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
ListProps,
|
|
85
|
+
ListItemProps,
|
|
86
|
+
ListItemIconProps,
|
|
87
|
+
ListItemTextProps,
|
|
88
|
+
ListSubheaderProps,
|
|
89
|
+
MenuItemProps,
|
|
90
|
+
ScopedCssBaselineProps,
|
|
91
|
+
SelectChangeEvent,
|
|
88
92
|
SelectProps,
|
|
89
93
|
SnackbarProps,
|
|
90
94
|
StackProps,
|
|
@@ -97,6 +101,7 @@ export type {
|
|
|
97
101
|
TableProps,
|
|
98
102
|
TableRowProps,
|
|
99
103
|
TableSortLabelProps,
|
|
104
|
+
ThemeOptions,
|
|
100
105
|
TooltipProps,
|
|
101
106
|
TypographyProps,
|
|
102
107
|
useThemeProps,
|
|
@@ -106,6 +111,22 @@ export { TabContext, TabList, TabPanel } from "@mui/lab";
|
|
|
106
111
|
|
|
107
112
|
export type { TabContextProps, TabListProps, TabPanelProps } from "@mui/lab";
|
|
108
113
|
|
|
109
|
-
export {
|
|
114
|
+
export { default as FavoriteIcon } from "@mui/icons-material/Favorite";
|
|
110
115
|
|
|
111
116
|
export { visuallyHidden } from "@mui/utils";
|
|
117
|
+
|
|
118
|
+
export * from "./Banner";
|
|
119
|
+
export * from "./createUniqueId";
|
|
120
|
+
export * from "./Icon";
|
|
121
|
+
export * from "./iconDictionary";
|
|
122
|
+
export * from "./Link";
|
|
123
|
+
export * from "./OdysseyCacheProvider";
|
|
124
|
+
export * from "./OdysseyThemeProvider";
|
|
125
|
+
export * from "./PasswordInput";
|
|
126
|
+
export * from "./Radio";
|
|
127
|
+
export * from "./RadioGroup";
|
|
128
|
+
export * from "./Status";
|
|
129
|
+
export * from "./TextField";
|
|
130
|
+
export * from "./theme";
|
|
131
|
+
export * from "./ThemeProvider";
|
|
132
|
+
export * from "./useUniqueId";
|