@redsift/design-system 11.6.0-muiv5-alpha.5 → 11.6.0-muiv5-alpha.7
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/_internal/Alert2.js +182 -39
- package/_internal/AppBar.js +240 -29
- package/_internal/AppContainer.js +132 -86
- package/_internal/AppContent.js +84 -17
- package/_internal/Badge2.js +137 -4
- package/_internal/BreadcrumbItem.js +85 -3
- package/_internal/Breadcrumbs2.js +86 -21
- package/_internal/Button2.js +81 -20
- package/_internal/ButtonGroup.js +165 -25
- package/_internal/ButtonLink.js +74 -18
- package/_internal/Card2.js +151 -29
- package/_internal/CardActions.js +38 -3
- package/_internal/CardBody.js +36 -3
- package/_internal/CardHeader.js +77 -3
- package/_internal/Checkbox2.js +234 -58
- package/_internal/CheckboxGroup.js +182 -4
- package/_internal/ConditionalWrapper.js +11 -12
- package/_internal/DetailedCard.js +6912 -48
- package/_internal/DetailedCardCollapsibleSectionItems.js +58 -3
- package/_internal/DetailedCardHeader.js +61 -3
- package/_internal/DetailedCardSection.js +166 -3
- package/_internal/DetailedCardSectionItem.js +88 -3
- package/_internal/Flexbox2.js +85 -22
- package/_internal/Grid2.js +87 -24
- package/_internal/GridItem.js +34 -3
- package/_internal/Heading2.js +107 -3
- package/_internal/Icon2.js +206 -5
- package/_internal/IconButton.js +71 -3
- package/_internal/IconButtonLink.js +65 -18
- package/_internal/Item2.js +390 -73
- package/_internal/Link2.js +56 -15
- package/_internal/LinkButton.js +56 -13
- package/_internal/Number2.js +103 -61
- package/_internal/NumberField.js +3959 -65
- package/_internal/Pill2.js +400 -4
- package/_internal/ProgressBar.js +61 -18
- package/_internal/Radio2.js +227 -56
- package/_internal/RadioGroup.js +170 -4
- package/_internal/Shield2.js +220 -4
- package/_internal/SideNavigationMenu.js +586 -4
- package/_internal/SideNavigationMenuItem.js +299 -4
- package/_internal/Skeleton2.js +36 -9
- package/_internal/SkeletonCircle.js +52 -3
- package/_internal/SkeletonText.js +71 -3
- package/_internal/Spinner2.js +319 -29
- package/_internal/Switch2.js +310 -56
- package/_internal/SwitchGroup.js +182 -4
- package/_internal/Text2.js +45 -3
- package/_internal/TextArea.js +430 -20
- package/_internal/TextField.js +463 -19
- package/_internal/alert.js +2 -5
- package/_internal/app-bar.js +2 -8
- package/_internal/app-container.js +3 -9
- package/_internal/app-content.js +2 -5
- package/_internal/app-side-panel.js +3 -11
- package/_internal/badge.js +2 -6
- package/_internal/breadcrumb-item.js +1 -4
- package/_internal/breadcrumbs.js +2 -6
- package/_internal/button-group.js +2 -5
- package/_internal/button-link.js +2 -8
- package/_internal/button.js +3 -8
- package/_internal/card-actions.js +1 -4
- package/_internal/card-body.js +1 -4
- package/_internal/card-header.js +1 -8
- package/_internal/card.js +2 -11
- package/_internal/checkbox-group.js +2 -6
- package/_internal/checkbox.js +2 -6
- package/_internal/colors.js +87 -91
- package/_internal/conditional-wrapper.js +2 -2
- package/_internal/detailed-card-collapsible-section-items.js +1 -3
- package/_internal/detailed-card-header.js +1 -7
- package/_internal/detailed-card-section-item.js +1 -10
- package/_internal/detailed-card-section.js +1 -6
- package/_internal/detailed-card.js +2 -16
- package/_internal/flexbox.js +2 -5
- package/_internal/focus-within-group.js +3 -3
- package/_internal/fonts.js +4 -6
- package/_internal/gradient-border.js +35 -16
- package/_internal/grid-item.js +1 -4
- package/_internal/grid.js +2 -6
- package/_internal/heading.js +2 -6
- package/_internal/icon-button-link.js +2 -8
- package/_internal/icon-button.js +2 -6
- package/_internal/icon.js +2 -6
- package/_internal/item.js +2 -8
- package/_internal/link-button.js +2 -8
- package/_internal/link.js +3 -8
- package/_internal/listbox.js +3 -6
- package/_internal/number-field.js +2 -9
- package/_internal/number.js +2 -7
- package/_internal/pill.js +2 -6
- package/_internal/progress-bar.js +2 -5
- package/_internal/radio-group.js +2 -6
- package/_internal/radio.js +2 -6
- package/_internal/shared.js +2 -5
- package/_internal/shield.js +2 -6
- package/_internal/side-navigation-menu-bar.js +3 -9
- package/_internal/side-navigation-menu-item.js +2 -8
- package/_internal/side-navigation-menu.js +2 -8
- package/_internal/skeleton-circle.js +1 -6
- package/_internal/skeleton-text.js +2 -6
- package/_internal/skeleton.js +1 -7
- package/_internal/spinner.js +2 -5
- package/_internal/styles.js +235 -17
- package/_internal/styles2.js +44 -280
- package/_internal/switch-group.js +2 -6
- package/_internal/switch.js +2 -6
- package/_internal/text-area.js +2 -9
- package/_internal/text-field.js +2 -10
- package/_internal/text.js +2 -6
- package/_internal/theme.js +1 -3
- package/_internal/types.js +7 -31
- package/_internal/types2.js +18 -29
- package/_internal/types3.js +15 -18
- package/_internal/useAppSidePanel.js +331 -6
- package/_internal/useFocusOnList.js +502 -44
- package/_internal/useListboxItem.js +120 -23
- package/_internal/useSideNavigationMenuBar.js +371 -7
- package/_internal/useTheme.js +10 -8
- package/index.d.ts +4667 -0
- package/index.js +523 -1674
- package/package.json +2 -2
- package/_internal/SideNavigationMenuBar.js +0 -9
- package/_internal/helpers.js +0 -23
- package/_internal/types10.js +0 -20
- package/_internal/types11.js +0 -27
- package/_internal/types12.js +0 -35
- package/_internal/types13.js +0 -143
- package/_internal/types14.js +0 -11
- package/_internal/types15.js +0 -62
- package/_internal/types16.js +0 -56
- package/_internal/types17.js +0 -57
- package/_internal/types18.js +0 -40
- package/_internal/types19.js +0 -101
- package/_internal/types20.js +0 -47
- package/_internal/types21.js +0 -68
- package/_internal/types22.js +0 -52
- package/_internal/types23.js +0 -174
- package/_internal/types24.js +0 -18
- package/_internal/types25.js +0 -12
- package/_internal/types26.js +0 -36
- package/_internal/types27.js +0 -72
- package/_internal/types28.js +0 -73
- package/_internal/types29.js +0 -99
- package/_internal/types4.js +0 -67
- package/_internal/types5.js +0 -11
- package/_internal/types6.js +0 -11
- package/_internal/types7.js +0 -28
- package/_internal/types8.js +0 -72
- package/_internal/types9.js +0 -16
package/_internal/TextField.js
CHANGED
|
@@ -1,29 +1,473 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { forwardRef, useState, useCallback } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { w as warnIfNoAccessibleLabelFound } from './warnIfNoAccessibleLabelFound.js';
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
|
+
import { i as baseStyling } from './styles4.js';
|
|
7
|
+
import { T as Theme, B as ButtonsColorPalette } from './colors.js';
|
|
8
|
+
import { mdiClose } from '@redsift/icons';
|
|
9
|
+
import { u as useMessageFormatter } from './useMessageFormatter.js';
|
|
10
|
+
import { u as useFocusRing, a as useFocusWithin } from './useFocusRing.js';
|
|
11
|
+
import { u as useTheme } from './useTheme.js';
|
|
12
|
+
import { u as useId } from './useId.js';
|
|
13
|
+
import { a as Icon } from './Icon2.js';
|
|
14
|
+
import { a as Pill } from './Pill2.js';
|
|
15
|
+
import { F as Flexbox } from './Flexbox2.js';
|
|
16
|
+
import { I as IconButton } from './IconButton.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Component variant.
|
|
20
|
+
*/
|
|
21
|
+
const TextFieldVariant = {
|
|
22
|
+
default: 'default',
|
|
23
|
+
underline: 'underline'
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Component color.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Component props.
|
|
32
|
+
*/
|
|
5
33
|
|
|
6
34
|
/**
|
|
7
35
|
* Component style.
|
|
8
36
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
37
|
+
const StyledTextField = styled.div`
|
|
38
|
+
height: fit-content;
|
|
39
|
+
position: relative;
|
|
40
|
+
width: fit-content;
|
|
41
|
+
margin: 0;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
padding: 0;
|
|
44
|
+
${baseStyling}
|
|
45
|
+
|
|
46
|
+
border: 0;
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
vertical-align: top;
|
|
50
|
+
|
|
51
|
+
${_ref => {
|
|
52
|
+
let {
|
|
53
|
+
label,
|
|
54
|
+
$hasLeftIcon,
|
|
55
|
+
$hasContent,
|
|
56
|
+
$isFocused,
|
|
57
|
+
$isDisabled,
|
|
58
|
+
$isInvalid,
|
|
59
|
+
$color,
|
|
60
|
+
$isGradient,
|
|
61
|
+
$theme,
|
|
62
|
+
$variant
|
|
63
|
+
} = _ref;
|
|
64
|
+
return css`
|
|
65
|
+
${$isDisabled ? css`
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
` : ''}
|
|
68
|
+
|
|
69
|
+
.redsift-text-field__label {
|
|
70
|
+
font-family: var(--redsift-typography-input-text-font-family);
|
|
71
|
+
font-size: var(--redsift-typography-input-text-font-size);
|
|
72
|
+
font-weight: var(--redsift-typography-input-text-font-weight);
|
|
73
|
+
line-height: var(--redsift-typography-input-text-line-height);
|
|
74
|
+
left: ${$hasLeftIcon && !$hasContent ? '32px' : '0'};
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
position: absolute;
|
|
78
|
+
text-overflow: ellipsis;
|
|
79
|
+
top: ${$hasContent ? '-8px' : '-7px'};
|
|
80
|
+
transform-origin: top left;
|
|
81
|
+
transition: color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms,
|
|
82
|
+
max-width 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
83
|
+
white-space: nowrap;
|
|
84
|
+
z-index: 1;
|
|
85
|
+
|
|
86
|
+
${!$hasContent ? css`
|
|
87
|
+
max-width: calc(100% - 24px);
|
|
88
|
+
transform: translate(${$variant === TextFieldVariant.underline ? '0px' : '14px'}, 16px) scale(1);
|
|
89
|
+
` : css`
|
|
90
|
+
max-width: calc(133% - 32px);
|
|
91
|
+
transform: translate(${$variant === TextFieldVariant.underline ? '0px' : '14px'}, 1px) scale(0.733);
|
|
92
|
+
`}
|
|
93
|
+
|
|
94
|
+
${!$isGradient ? css`
|
|
95
|
+
color: var(
|
|
96
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid ? 'error' : $isFocused ? $color : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}
|
|
97
|
+
);
|
|
98
|
+
` : css`
|
|
99
|
+
background-color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'});
|
|
100
|
+
${$variant !== TextFieldVariant.underline ? css`
|
|
101
|
+
padding-right: 7px;
|
|
102
|
+
padding-left: 5px;
|
|
103
|
+
` : ''}
|
|
104
|
+
> span {
|
|
105
|
+
background: var(
|
|
106
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid ? 'error' : $isFocused ? $color : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}
|
|
107
|
+
);
|
|
108
|
+
background-clip: text;
|
|
109
|
+
color: transparent;
|
|
110
|
+
}
|
|
111
|
+
`}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.redsift-text-field__input-wrapper {
|
|
115
|
+
align-items: flex-start;
|
|
116
|
+
box-sizing: border-box;
|
|
117
|
+
cursor: text;
|
|
118
|
+
display: inline-flex;
|
|
119
|
+
min-height: 42px;
|
|
120
|
+
position: relative;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.redsift-text-field-input-wrapper__pills-and-input {
|
|
124
|
+
align-items: flex-start;
|
|
125
|
+
box-sizing: border-box;
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column-reverse;
|
|
128
|
+
flex-wrap: wrap;
|
|
129
|
+
flex: 1 1 auto;
|
|
130
|
+
padding-bottom: 7px;
|
|
131
|
+
${$variant !== TextFieldVariant.underline && !$hasLeftIcon ? css`
|
|
132
|
+
padding-left: 16px;
|
|
133
|
+
` : ''}
|
|
134
|
+
padding-top: ${label ? '9px' : '7px'};
|
|
135
|
+
|
|
136
|
+
.redsift-pill {
|
|
137
|
+
margin: 3px 6px 3px 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.redsift-text-field-input-wrapper-pills-and-input__input {
|
|
142
|
+
background: none;
|
|
143
|
+
border: 0;
|
|
144
|
+
box-sizing: content-box;
|
|
145
|
+
display: flex;
|
|
146
|
+
flex: 1 1 auto;
|
|
147
|
+
font-family: var(--redsift-typography-input-text-font-family);
|
|
148
|
+
font-size: var(--redsift-typography-input-text-font-size);
|
|
149
|
+
font-weight: var(--redsift-typography-input-text-font-weight);
|
|
150
|
+
line-height: var(--redsift-typography-input-text-line-height);
|
|
151
|
+
min-width: 0;
|
|
152
|
+
min-width: 100px;
|
|
153
|
+
padding: 2px 0;
|
|
154
|
+
width: 100%;
|
|
155
|
+
|
|
156
|
+
${$isDisabled ? css`
|
|
157
|
+
color: var(--redsift-color-grey-l2);
|
|
158
|
+
` : css`
|
|
159
|
+
color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});
|
|
160
|
+
`}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.redsift-text-field-input-wrapper-pills-and-input__input::placeholder {
|
|
164
|
+
color: var(--redsift-color-neutral-mid-grey);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.redsift-text-field-input-wrapper-pills-and-input__input:focus {
|
|
168
|
+
outline: 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.redsift-text-field-input-wrapper__fieldset {
|
|
172
|
+
border-style: solid;
|
|
173
|
+
bottom: 0;
|
|
174
|
+
left: 1px;
|
|
175
|
+
margin: 0;
|
|
176
|
+
min-width: 0%;
|
|
177
|
+
overflow: hidden;
|
|
178
|
+
padding: 0 8px;
|
|
179
|
+
pointer-events: none;
|
|
180
|
+
position: absolute;
|
|
181
|
+
right: 0;
|
|
182
|
+
text-align: left;
|
|
183
|
+
top: -5px;
|
|
184
|
+
|
|
185
|
+
${!$isGradient || $isDisabled || !$isFocused || $isInvalid ? css`
|
|
186
|
+
${$variant === TextFieldVariant.underline ? css`
|
|
187
|
+
border-bottom-width: 2px;
|
|
188
|
+
` : css`
|
|
189
|
+
border-radius: 4px;
|
|
190
|
+
border-width: 2px;
|
|
191
|
+
`}
|
|
192
|
+
border-color: var(
|
|
193
|
+
--redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid ? 'error' : $isFocused ? $color : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}
|
|
194
|
+
);
|
|
195
|
+
` : css`
|
|
196
|
+
${$variant === TextFieldVariant.underline ? css`
|
|
197
|
+
border-bottom: 2px solid transparent;
|
|
198
|
+
` : css`
|
|
199
|
+
border: 2px solid transparent;
|
|
200
|
+
border-radius: 4px;
|
|
201
|
+
`}
|
|
202
|
+
background: transparent;
|
|
203
|
+
background-clip: padding-box, border-box;
|
|
204
|
+
background-origin: border-box;
|
|
205
|
+
background-image: linear-gradient(
|
|
206
|
+
90deg,
|
|
207
|
+
var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'}),
|
|
208
|
+
var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'})
|
|
209
|
+
),
|
|
210
|
+
var(--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-default);
|
|
211
|
+
`}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.redsift-text-field-input-wrapper-fieldset__legend {
|
|
215
|
+
display: block;
|
|
216
|
+
float: unset;
|
|
217
|
+
font-size: 11px;
|
|
218
|
+
height: 11px;
|
|
219
|
+
overflow: hidden;
|
|
220
|
+
padding: 0;
|
|
221
|
+
visibility: hidden;
|
|
222
|
+
white-space: nowrap;
|
|
223
|
+
width: auto;
|
|
224
|
+
|
|
225
|
+
${!$hasContent ? css`
|
|
226
|
+
max-width: 0.01px;
|
|
227
|
+
transition: max-width 50ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
228
|
+
` : css`
|
|
229
|
+
max-width: 100%;
|
|
230
|
+
transition: max-width 100ms cubic-bezier(0, 0, 0.2, 1) 50ms;
|
|
231
|
+
`}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.redsift-text-field-input-wrapper-fieldset__legend > span {
|
|
235
|
+
display: inline-block;
|
|
236
|
+
opacity: 0;
|
|
237
|
+
padding-left: 5px;
|
|
238
|
+
padding-right: 5px;
|
|
239
|
+
visibility: visible;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.redsift-text-field-input-wrapper__toolbar {
|
|
243
|
+
position: relative;
|
|
244
|
+
top: 9px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.redsift-icon-button:not(.redsift-pill > .redsift-icon-button) {
|
|
248
|
+
padding: 2px;
|
|
249
|
+
position: relative;
|
|
250
|
+
top: -2px;
|
|
251
|
+
height: 28px;
|
|
252
|
+
width: 28px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
${$variant !== TextFieldVariant.underline ? css`
|
|
256
|
+
.redsift-icon.left {
|
|
257
|
+
padding-left: 12px;
|
|
258
|
+
padding-right: 8px;
|
|
259
|
+
line-height: 28px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.redsift-text-field-input-wrapper__toolbar {
|
|
263
|
+
padding-right: 8px;
|
|
264
|
+
}
|
|
265
|
+
` : css`
|
|
266
|
+
.redsift-icon.left {
|
|
267
|
+
padding-right: 8px;
|
|
268
|
+
}
|
|
269
|
+
`}
|
|
270
|
+
|
|
271
|
+
.redsift-icon.left,
|
|
272
|
+
.redsift-icon.right {
|
|
273
|
+
top: 9px;
|
|
274
|
+
}
|
|
275
|
+
`;
|
|
276
|
+
}}
|
|
277
|
+
`;
|
|
278
|
+
|
|
279
|
+
var clear$1 = "Clear field";
|
|
280
|
+
var enUS = {
|
|
281
|
+
clear: clear$1,
|
|
282
|
+
"clear-field": "Clear field {label}"
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
var clear = "Nettoyer le champ";
|
|
286
|
+
var frFR = {
|
|
287
|
+
clear: clear,
|
|
288
|
+
"clear-field": "Nettoyer le champ {label}"
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
var intlMessages = {
|
|
292
|
+
'en-US': enUS,
|
|
293
|
+
'fr-FR': frFR
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
const _excluded = ["aria-label", "aria-labelledby", "after", "autoFocus", "className", "color", "defaultValue", "forceColor", "hasClearButton", "inputProps", "inputRef", "internal", "isColored", "isDisabled", "isInvalid", "isReadOnly", "isRequired", "label", "leftIcon", "name", "onBlur", "onChange", "onClear", "onFocus", "pills", "placeholder", "theme", "type", "value", "variant"];
|
|
297
|
+
const COMPONENT_NAME = 'TextField';
|
|
298
|
+
const CLASSNAME = 'redsift-text-field';
|
|
22
299
|
|
|
23
300
|
/**
|
|
24
301
|
* The TextField component.
|
|
25
302
|
* Can be used as controlled or uncontrolled.
|
|
26
303
|
*/
|
|
27
|
-
|
|
304
|
+
const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
305
|
+
const {
|
|
306
|
+
'aria-label': ariaLabel,
|
|
307
|
+
'aria-labelledby': ariaLabelledby,
|
|
308
|
+
after,
|
|
309
|
+
autoFocus,
|
|
310
|
+
className,
|
|
311
|
+
color: propsColor,
|
|
312
|
+
defaultValue = '',
|
|
313
|
+
forceColor,
|
|
314
|
+
hasClearButton,
|
|
315
|
+
inputProps,
|
|
316
|
+
inputRef,
|
|
317
|
+
internal,
|
|
318
|
+
isColored = true,
|
|
319
|
+
isDisabled,
|
|
320
|
+
isInvalid,
|
|
321
|
+
isReadOnly,
|
|
322
|
+
isRequired,
|
|
323
|
+
label,
|
|
324
|
+
leftIcon,
|
|
325
|
+
name,
|
|
326
|
+
onBlur: onBlurProps,
|
|
327
|
+
onChange,
|
|
328
|
+
onClear,
|
|
329
|
+
onFocus: onFocusProps,
|
|
330
|
+
pills,
|
|
331
|
+
placeholder,
|
|
332
|
+
theme: propsTheme,
|
|
333
|
+
type,
|
|
334
|
+
value: propsValue,
|
|
335
|
+
variant = TextFieldVariant.default
|
|
336
|
+
} = props,
|
|
337
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
338
|
+
const theme = useTheme(propsTheme);
|
|
339
|
+
const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : isColored ? 'primary' : 'grey';
|
|
340
|
+
const isGradient = color === ButtonsColorPalette.radar;
|
|
341
|
+
const format = useMessageFormatter(intlMessages);
|
|
342
|
+
const {
|
|
343
|
+
isFocusVisible,
|
|
344
|
+
isFocused,
|
|
345
|
+
focusProps: {
|
|
346
|
+
onFocus,
|
|
347
|
+
onBlur
|
|
348
|
+
}
|
|
349
|
+
} = useFocusRing({
|
|
350
|
+
autoFocus
|
|
351
|
+
});
|
|
352
|
+
const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));
|
|
353
|
+
const {
|
|
354
|
+
focusWithinProps
|
|
355
|
+
} = useFocusWithin({
|
|
356
|
+
onFocusWithinChange: isFocusWithin => setFocusWithin(isFocusWithin)
|
|
357
|
+
});
|
|
358
|
+
const [value, setValue] = useState(defaultValue);
|
|
359
|
+
const isControlled = propsValue !== null && propsValue !== undefined;
|
|
360
|
+
const [labelId] = useId();
|
|
361
|
+
warnIfNoAccessibleLabelFound(props, [label], 'TextField');
|
|
362
|
+
const handleChange = useCallback(event => {
|
|
363
|
+
if (isDisabled || isReadOnly) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
if (onChange) {
|
|
367
|
+
onChange(event.target.value, name, event);
|
|
368
|
+
} else {
|
|
369
|
+
setValue(event.target.value);
|
|
370
|
+
}
|
|
371
|
+
}, [onChange]);
|
|
372
|
+
const handleClear = useCallback(() => {
|
|
373
|
+
if (isDisabled || isReadOnly) {
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
if (onChange) {
|
|
377
|
+
onChange('');
|
|
378
|
+
}
|
|
379
|
+
if (onClear) {
|
|
380
|
+
onClear();
|
|
381
|
+
}
|
|
382
|
+
if (hasClearButton && hasClearButton !== true && hasClearButton.onClick) {
|
|
383
|
+
hasClearButton.onClick({});
|
|
384
|
+
}
|
|
385
|
+
setValue('');
|
|
386
|
+
}, [onChange]);
|
|
387
|
+
return /*#__PURE__*/React__default.createElement(StyledTextField, _extends({}, focusWithinProps, forwardedProps, {
|
|
388
|
+
$hasContent: isFocusWithin || Boolean(isControlled ? propsValue : value) || Boolean(placeholder) || Boolean(pills && pills.length > 0),
|
|
389
|
+
$hasLeftIcon: Boolean(leftIcon),
|
|
390
|
+
$color: color,
|
|
391
|
+
$isGradient: isGradient,
|
|
392
|
+
$isDisabled: isDisabled,
|
|
393
|
+
$isFocusVisible: isFocusVisible,
|
|
394
|
+
$isInvalid: isInvalid || isRequired && !(isControlled ? propsValue : value),
|
|
395
|
+
$isRequired: isRequired,
|
|
396
|
+
$isFocused: Boolean(isFocused || forceColor),
|
|
397
|
+
$theme: theme,
|
|
398
|
+
$variant: variant,
|
|
399
|
+
className: classNames(TextField.className, className),
|
|
400
|
+
ref: ref
|
|
401
|
+
}), /*#__PURE__*/React__default.createElement("fieldset", {
|
|
402
|
+
"aria-hidden": "true",
|
|
403
|
+
className: `${TextField.className}-input-wrapper__fieldset`
|
|
404
|
+
}, /*#__PURE__*/React__default.createElement("legend", {
|
|
405
|
+
id: labelId,
|
|
406
|
+
className: `${TextField.className}-input-wrapper-fieldset__legend`
|
|
407
|
+
}, label ? /*#__PURE__*/React__default.createElement("span", null, label) : null)), label ? /*#__PURE__*/React__default.createElement("label", {
|
|
408
|
+
className: `${TextField.className}__label`
|
|
409
|
+
}, /*#__PURE__*/React__default.createElement("span", null, label)) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
410
|
+
className: `${TextField.className}__input-wrapper`
|
|
411
|
+
}, leftIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends({
|
|
412
|
+
color: isDisabled ? 'question' : 'black'
|
|
413
|
+
}, leftIcon, {
|
|
414
|
+
"aria-hidden": "true",
|
|
415
|
+
className: "left"
|
|
416
|
+
})) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
417
|
+
className: `${TextField.className}-input-wrapper__pills-and-input`
|
|
418
|
+
}, /*#__PURE__*/React__default.createElement("input", _extends({}, inputProps, {
|
|
419
|
+
onBlur: event => {
|
|
420
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
421
|
+
onBlurProps === null || onBlurProps === void 0 ? void 0 : onBlurProps(event);
|
|
422
|
+
},
|
|
423
|
+
onFocus: event => {
|
|
424
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
425
|
+
onFocusProps === null || onFocusProps === void 0 ? void 0 : onFocusProps(event);
|
|
426
|
+
},
|
|
427
|
+
"aria-disabled": isDisabled,
|
|
428
|
+
"aria-invalid": isInvalid || isRequired && !(isControlled ? propsValue : value),
|
|
429
|
+
"aria-label": ariaLabel,
|
|
430
|
+
"aria-labelledby": ariaLabelledby || (label ? labelId : undefined),
|
|
431
|
+
"aria-readonly": isReadOnly,
|
|
432
|
+
"aria-required": isRequired,
|
|
433
|
+
autoFocus: autoFocus,
|
|
434
|
+
className: `${TextField.className}-input-wrapper-pills-and-input__input`,
|
|
435
|
+
disabled: isDisabled,
|
|
436
|
+
name: name,
|
|
437
|
+
onChange: handleChange,
|
|
438
|
+
placeholder: placeholder,
|
|
439
|
+
ref: inputRef,
|
|
440
|
+
type: type,
|
|
441
|
+
value: isControlled ? propsValue : value
|
|
442
|
+
})), /*#__PURE__*/React__default.createElement("div", null, pills === null || pills === void 0 ? void 0 : pills.map((pill, index) => /*#__PURE__*/React__default.createElement(Pill, _extends({
|
|
443
|
+
theme: theme,
|
|
444
|
+
key: `${labelId}-pill-${index}`,
|
|
445
|
+
color: "blue",
|
|
446
|
+
size: "small"
|
|
447
|
+
}, pill))))), hasClearButton || internal || after ? /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
448
|
+
className: `${TextField.className}-input-wrapper__toolbar`,
|
|
449
|
+
gap: "8px"
|
|
450
|
+
}, hasClearButton ? /*#__PURE__*/React__default.createElement(IconButton, _extends({
|
|
451
|
+
theme: theme,
|
|
452
|
+
"aria-label": label ? format('clear-field', {
|
|
453
|
+
label
|
|
454
|
+
}) : format('clear'),
|
|
455
|
+
color: "grey",
|
|
456
|
+
isDisabled: isDisabled,
|
|
457
|
+
icon: mdiClose
|
|
458
|
+
}, hasClearButton !== true && hasClearButton, {
|
|
459
|
+
onClick: handleClear,
|
|
460
|
+
className: "right clear"
|
|
461
|
+
})) : null, typeof internal === 'function' ? internal(isControlled ? propsValue : value, isDisabled, isInvalid || isRequired && !(isControlled ? propsValue : value), isRequired) : internal, (hasClearButton || internal) && after ? /*#__PURE__*/React__default.createElement("span", {
|
|
462
|
+
style: {
|
|
463
|
+
borderLeft: '1px solid var(--redsift-color-neutral-mid-grey)',
|
|
464
|
+
position: 'relative',
|
|
465
|
+
top: '-2px'
|
|
466
|
+
}
|
|
467
|
+
}) : null, typeof after === 'function' ? after(isControlled ? propsValue : value, isDisabled, isInvalid || isRequired && !(isControlled ? propsValue : value), isRequired) : after) : null));
|
|
468
|
+
});
|
|
469
|
+
TextField.className = CLASSNAME;
|
|
470
|
+
TextField.displayName = COMPONENT_NAME;
|
|
28
471
|
|
|
29
|
-
export { StyledTextField as S,
|
|
472
|
+
export { StyledTextField as S, TextFieldVariant as T, TextField as a };
|
|
473
|
+
//# sourceMappingURL=TextField.js.map
|
package/_internal/alert.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
import './helpers.js';
|
|
4
|
-
import './styles2.js';
|
|
5
|
-
import './colors.js';
|
|
1
|
+
export { b as Alert, a as AlertStyleVariant, A as AlertVariant } from './Alert2.js';
|
|
2
|
+
//# sourceMappingURL=alert.js.map
|
package/_internal/app-bar.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
import './types16.js';
|
|
4
|
-
import './types17.js';
|
|
5
|
-
import './styles2.js';
|
|
6
|
-
import './helpers.js';
|
|
7
|
-
import './colors.js';
|
|
8
|
-
import './types3.js';
|
|
1
|
+
export { A as AppBar } from './AppBar.js';
|
|
2
|
+
//# sourceMappingURL=app-bar.js.map
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import './types16.js';
|
|
5
|
-
import './types17.js';
|
|
6
|
-
import './styles2.js';
|
|
7
|
-
import './helpers.js';
|
|
8
|
-
import './colors.js';
|
|
9
|
-
import './types3.js';
|
|
1
|
+
export { A as AppContainerContext } from './context.js';
|
|
2
|
+
export { A as AppContainer, R as RadarSvgLinearGradient } from './AppContainer.js';
|
|
3
|
+
//# sourceMappingURL=app-container.js.map
|
package/_internal/app-content.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
import './styles2.js';
|
|
4
|
-
import './helpers.js';
|
|
5
|
-
import './colors.js';
|
|
1
|
+
export { A as AppContent } from './AppContent.js';
|
|
2
|
+
//# sourceMappingURL=app-content.js.map
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { A as AppSidePanel,
|
|
3
|
-
|
|
4
|
-
import './types16.js';
|
|
5
|
-
import './types17.js';
|
|
6
|
-
import './styles2.js';
|
|
7
|
-
import './helpers.js';
|
|
8
|
-
import './colors.js';
|
|
9
|
-
import './useSideNavigationMenuBar.js';
|
|
10
|
-
import './types23.js';
|
|
11
|
-
import './types2.js';
|
|
1
|
+
export { A as AppSidePanelVariant } from './types.js';
|
|
2
|
+
export { A as AppSidePanel, a as useAppSidePanel } from './useAppSidePanel.js';
|
|
3
|
+
//# sourceMappingURL=app-side-panel.js.map
|
package/_internal/badge.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
export { a as
|
|
2
|
-
|
|
3
|
-
import 'react';
|
|
4
|
-
import './colors.js';
|
|
5
|
-
import './helpers.js';
|
|
6
|
-
import './styles2.js';
|
|
1
|
+
export { a as Badge, B as BadgeVariant } from './Badge2.js';
|
|
2
|
+
//# sourceMappingURL=badge.js.map
|
package/_internal/breadcrumbs.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
import 'react';
|
|
4
|
-
import './colors.js';
|
|
5
|
-
import './helpers.js';
|
|
6
|
-
import './styles2.js';
|
|
1
|
+
export { B as BaseBreadcrumbs, a as Breadcrumbs } from './Breadcrumbs2.js';
|
|
2
|
+
//# sourceMappingURL=breadcrumbs.js.map
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
import './styles2.js';
|
|
4
|
-
import './helpers.js';
|
|
5
|
-
import './colors.js';
|
|
1
|
+
export { a as ButtonGroup, B as ButtonGroupVariant } from './ButtonGroup.js';
|
|
2
|
+
//# sourceMappingURL=button-group.js.map
|
package/_internal/button-link.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
import 'react';
|
|
4
|
-
import './types17.js';
|
|
5
|
-
import './styles2.js';
|
|
6
|
-
import './helpers.js';
|
|
7
|
-
import './colors.js';
|
|
8
|
-
import './types18.js';
|
|
1
|
+
export { B as ButtonLink } from './ButtonLink.js';
|
|
2
|
+
//# sourceMappingURL=button-link.js.map
|
package/_internal/button.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { B as Button
|
|
3
|
-
|
|
4
|
-
import './types17.js';
|
|
5
|
-
import './styles2.js';
|
|
6
|
-
import './helpers.js';
|
|
7
|
-
import './colors.js';
|
|
8
|
-
import 'styled-components';
|
|
1
|
+
export { B as ButtonVariant, S as StyledButton } from './styles.js';
|
|
2
|
+
export { B as Button } from './Button2.js';
|
|
3
|
+
//# sourceMappingURL=button.js.map
|
package/_internal/card-body.js
CHANGED
package/_internal/card-header.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
export { C as CardHeaderProps, S as StyledCardHeaderProps } from './types7.js';
|
|
2
1
|
export { C as CardHeader } from './CardHeader.js';
|
|
3
|
-
|
|
4
|
-
import './types15.js';
|
|
5
|
-
import './fonts.js';
|
|
6
|
-
import './helpers.js';
|
|
7
|
-
import './styles2.js';
|
|
8
|
-
import './colors.js';
|
|
9
|
-
import './types17.js';
|
|
2
|
+
//# sourceMappingURL=card-header.js.map
|
package/_internal/card.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
import 'react';
|
|
4
|
-
import './styles2.js';
|
|
5
|
-
import './helpers.js';
|
|
6
|
-
import './types6.js';
|
|
7
|
-
import './types7.js';
|
|
8
|
-
import './types15.js';
|
|
9
|
-
import './fonts.js';
|
|
10
|
-
import './colors.js';
|
|
11
|
-
import './types17.js';
|
|
1
|
+
export { C as Card } from './Card2.js';
|
|
2
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
export { a as
|
|
2
|
-
|
|
3
|
-
import 'react';
|
|
4
|
-
import './helpers.js';
|
|
5
|
-
import './styles2.js';
|
|
6
|
-
import './colors.js';
|
|
1
|
+
export { a as CheckboxGroup, C as CheckboxGroupOrientation } from './CheckboxGroup.js';
|
|
2
|
+
//# sourceMappingURL=checkbox-group.js.map
|