@dnanpm/styleguide 3.9.7 → 3.9.9
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/build/cjs/components/Button/Button.d.ts +13 -1
- package/build/cjs/components/Button/Button.js +5 -5
- package/build/cjs/components/ButtonArrow/ButtonArrow.d.ts +8 -2
- package/build/cjs/components/ButtonArrow/ButtonArrow.js +2 -2
- package/build/cjs/components/ButtonIcon/ButtonIcon.d.ts +11 -1
- package/build/cjs/components/ButtonIcon/ButtonIcon.js +4 -4
- package/build/cjs/components/Carousel/Carousel.d.ts +188 -0
- package/build/cjs/components/Carousel/Carousel.js +23 -10
- package/build/cjs/components/Checkbox/Checkbox.js +65 -4
- package/build/cjs/components/Divider/Divider.d.ts +4 -0
- package/build/cjs/components/Divider/Divider.js +2 -1
- package/build/cjs/components/InfoDialog/InfoDialog.d.ts +4 -0
- package/build/cjs/components/InfoDialog/InfoDialog.js +1 -1
- package/build/cjs/components/Input/Input.d.ts +14 -0
- package/build/cjs/components/Input/Input.js +21 -5
- package/build/cjs/components/Label/Label.d.ts +7 -0
- package/build/cjs/components/Label/Label.js +3 -1
- package/build/cjs/components/LabelText/LabelText.d.ts +5 -3
- package/build/cjs/components/LabelText/LabelText.js +1 -1
- package/build/cjs/components/Modal/Modal.d.ts +51 -27
- package/build/cjs/components/Modal/Modal.js +92 -16
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.d.ts +2 -2
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +13 -6
- package/build/cjs/components/RadioButton/RadioButton.js +61 -4
- package/build/cjs/components/ReadMore/ReadMore.d.ts +4 -0
- package/build/cjs/components/ReadMore/ReadMore.js +30 -3
- package/build/cjs/components/Search/Search.d.ts +12 -0
- package/build/cjs/components/Search/Search.js +9 -3
- package/build/cjs/themes/globalStyles.d.ts +0 -166
- package/build/cjs/themes/globalStyles.js +0 -59
- package/build/es/components/Button/Button.d.ts +13 -1
- package/build/es/components/Button/Button.js +5 -5
- package/build/es/components/ButtonArrow/ButtonArrow.d.ts +8 -2
- package/build/es/components/ButtonArrow/ButtonArrow.js +2 -2
- package/build/es/components/ButtonIcon/ButtonIcon.d.ts +11 -1
- package/build/es/components/ButtonIcon/ButtonIcon.js +5 -5
- package/build/es/components/Carousel/Carousel.d.ts +188 -0
- package/build/es/components/Carousel/Carousel.js +23 -11
- package/build/es/components/Checkbox/Checkbox.js +65 -4
- package/build/es/components/Divider/Divider.d.ts +4 -0
- package/build/es/components/Divider/Divider.js +2 -1
- package/build/es/components/InfoDialog/InfoDialog.d.ts +4 -0
- package/build/es/components/InfoDialog/InfoDialog.js +1 -1
- package/build/es/components/Input/Input.d.ts +14 -0
- package/build/es/components/Input/Input.js +21 -5
- package/build/es/components/Label/Label.d.ts +7 -0
- package/build/es/components/Label/Label.js +3 -1
- package/build/es/components/LabelText/LabelText.d.ts +5 -3
- package/build/es/components/LabelText/LabelText.js +1 -1
- package/build/es/components/Modal/Modal.d.ts +51 -27
- package/build/es/components/Modal/Modal.js +93 -17
- package/build/es/components/ProgressIndicator/ProgressIndicator.d.ts +2 -2
- package/build/es/components/ProgressIndicator/ProgressIndicator.js +13 -6
- package/build/es/components/RadioButton/RadioButton.js +61 -4
- package/build/es/components/ReadMore/ReadMore.d.ts +4 -0
- package/build/es/components/ReadMore/ReadMore.js +31 -4
- package/build/es/components/Search/Search.d.ts +12 -0
- package/build/es/components/Search/Search.js +9 -3
- package/build/es/themes/globalStyles.d.ts +0 -166
- package/build/es/themes/globalStyles.js +3 -61
- package/package.json +10 -9
|
@@ -60,7 +60,7 @@ const Button = styled.default(ButtonIcon.default) `
|
|
|
60
60
|
margin: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
61
61
|
`;
|
|
62
62
|
const Search = (_a) => {
|
|
63
|
-
var _b;
|
|
63
|
+
var _b, _c;
|
|
64
64
|
var { 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ['data-testid']);
|
|
65
65
|
const inputRef = React.useRef(null);
|
|
66
66
|
const handleButtonClick = (e) => {
|
|
@@ -71,9 +71,15 @@ const Search = (_a) => {
|
|
|
71
71
|
props.onButtonClick(e);
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
+
let buttonAriaLabel = '';
|
|
75
|
+
if (props.clearButtonAriaLabel && props.searchButtonAriaLabel) {
|
|
76
|
+
buttonAriaLabel = ((_b = props.value) === null || _b === void 0 ? void 0 : _b.length)
|
|
77
|
+
? props.clearButtonAriaLabel
|
|
78
|
+
: props.searchButtonAriaLabel;
|
|
79
|
+
}
|
|
74
80
|
return (React__default.default.createElement(Container, { className: props.className, "data-testid": dataTestId },
|
|
75
|
-
React__default.default.createElement(Input, { id: props.id, name: props.name, type: "search", ref: inputRef, value: props.value, onChange: props.onChange, onBlur: props.onBlur, onFocus: props.onFocus, onKeyDown: props.onKeyDown, onKeyPress: props.onKeyPress, placeholder: props.placeholder, autoFocus: props.autoFocus }),
|
|
76
|
-
React__default.default.createElement(Button, { icon: ((
|
|
81
|
+
React__default.default.createElement(Input, { id: props.id, name: props.name, type: "search", ref: inputRef, value: props.value, onChange: props.onChange, onBlur: props.onBlur, onFocus: props.onFocus, onKeyDown: props.onKeyDown, onKeyPress: props.onKeyPress, placeholder: props.placeholder, autoFocus: props.autoFocus, "aria-label": props.ariaLabel }),
|
|
82
|
+
React__default.default.createElement(Button, { icon: ((_c = props.value) === null || _c === void 0 ? void 0 : _c.length) ? icons.Close : icons.Search, name: `${props.name}-button`, onClick: handleButtonClick, ariaLabel: buttonAriaLabel || undefined })));
|
|
77
83
|
};
|
|
78
84
|
|
|
79
85
|
exports.default = Search;
|
|
@@ -165,172 +165,6 @@ export declare const globalStyles: import("styled-components").FlattenInterpolat
|
|
|
165
165
|
pill: string;
|
|
166
166
|
};
|
|
167
167
|
}>>;
|
|
168
|
-
export declare const CheckboxAndRadioInputCore: import("styled-components").StyledComponent<"input", {
|
|
169
|
-
base: {
|
|
170
|
-
baseHeight: {
|
|
171
|
-
value: number;
|
|
172
|
-
unit: string;
|
|
173
|
-
};
|
|
174
|
-
baseWidth: {
|
|
175
|
-
value: number;
|
|
176
|
-
unit: string;
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
breakpoints: import("./themeComponents/breakpoints").ViewBreakpoints;
|
|
180
|
-
color: {
|
|
181
|
-
default: {
|
|
182
|
-
pink: string;
|
|
183
|
-
plum: string;
|
|
184
|
-
white: string;
|
|
185
|
-
black: string;
|
|
186
|
-
};
|
|
187
|
-
accent: {
|
|
188
|
-
lemon: string;
|
|
189
|
-
sky: string;
|
|
190
|
-
orange: string;
|
|
191
|
-
};
|
|
192
|
-
active: {
|
|
193
|
-
pink: string;
|
|
194
|
-
};
|
|
195
|
-
hover: {
|
|
196
|
-
pink: string;
|
|
197
|
-
};
|
|
198
|
-
text: {
|
|
199
|
-
gray: string;
|
|
200
|
-
pink: string;
|
|
201
|
-
plum: string;
|
|
202
|
-
white: string;
|
|
203
|
-
black: string;
|
|
204
|
-
};
|
|
205
|
-
line: {
|
|
206
|
-
L01: string;
|
|
207
|
-
L02: string;
|
|
208
|
-
L03: string;
|
|
209
|
-
L04: string;
|
|
210
|
-
};
|
|
211
|
-
notification: {
|
|
212
|
-
info: string;
|
|
213
|
-
success: string;
|
|
214
|
-
warning: string;
|
|
215
|
-
error: string;
|
|
216
|
-
};
|
|
217
|
-
background: {
|
|
218
|
-
sand: {
|
|
219
|
-
default: string;
|
|
220
|
-
E01: string;
|
|
221
|
-
E02: string;
|
|
222
|
-
};
|
|
223
|
-
pink: {
|
|
224
|
-
default: string;
|
|
225
|
-
E01: string;
|
|
226
|
-
E02: string;
|
|
227
|
-
};
|
|
228
|
-
plum: {
|
|
229
|
-
default: string;
|
|
230
|
-
E01: string;
|
|
231
|
-
E02: string;
|
|
232
|
-
};
|
|
233
|
-
lemon: {
|
|
234
|
-
default: string;
|
|
235
|
-
E01: string;
|
|
236
|
-
E02: string;
|
|
237
|
-
};
|
|
238
|
-
sky: {
|
|
239
|
-
default: string;
|
|
240
|
-
E01: string;
|
|
241
|
-
E02: string;
|
|
242
|
-
};
|
|
243
|
-
orange: {
|
|
244
|
-
default: string;
|
|
245
|
-
E01: string;
|
|
246
|
-
E02: string;
|
|
247
|
-
};
|
|
248
|
-
white: {
|
|
249
|
-
default: string;
|
|
250
|
-
};
|
|
251
|
-
};
|
|
252
|
-
focus: {
|
|
253
|
-
dark: string;
|
|
254
|
-
light: string;
|
|
255
|
-
};
|
|
256
|
-
transparency: {
|
|
257
|
-
T0: string;
|
|
258
|
-
T10: string;
|
|
259
|
-
T20: string;
|
|
260
|
-
T30: string;
|
|
261
|
-
T40: string;
|
|
262
|
-
T50: string;
|
|
263
|
-
T60: string;
|
|
264
|
-
T70: string;
|
|
265
|
-
T80: string;
|
|
266
|
-
T90: string;
|
|
267
|
-
T100: string;
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
fontFamily: {
|
|
271
|
-
default: string;
|
|
272
|
-
heading: string;
|
|
273
|
-
numerals: string;
|
|
274
|
-
};
|
|
275
|
-
fontSize: {
|
|
276
|
-
default: string;
|
|
277
|
-
xl: string;
|
|
278
|
-
l: string;
|
|
279
|
-
s: string;
|
|
280
|
-
xs: string;
|
|
281
|
-
h1XL: string;
|
|
282
|
-
h1L: string;
|
|
283
|
-
h1M: string;
|
|
284
|
-
h1S: string;
|
|
285
|
-
h2M: string;
|
|
286
|
-
h2S: string;
|
|
287
|
-
h3: string;
|
|
288
|
-
h4: string;
|
|
289
|
-
h5: string;
|
|
290
|
-
h1: string;
|
|
291
|
-
h2: string;
|
|
292
|
-
};
|
|
293
|
-
fontWeight: {
|
|
294
|
-
book: number;
|
|
295
|
-
medium: number;
|
|
296
|
-
bold: number;
|
|
297
|
-
black: number;
|
|
298
|
-
};
|
|
299
|
-
form: {
|
|
300
|
-
smallSelectWidth: string;
|
|
301
|
-
smallSelectHeight: string;
|
|
302
|
-
};
|
|
303
|
-
grid: {
|
|
304
|
-
gutter: string;
|
|
305
|
-
};
|
|
306
|
-
lineHeight: {
|
|
307
|
-
default: string;
|
|
308
|
-
xl: string;
|
|
309
|
-
s: string;
|
|
310
|
-
xs: string;
|
|
311
|
-
xxs: string;
|
|
312
|
-
auto: string;
|
|
313
|
-
h1XL: string;
|
|
314
|
-
h1L: string;
|
|
315
|
-
h1M: string;
|
|
316
|
-
h1S: string;
|
|
317
|
-
h2M: string;
|
|
318
|
-
h2S: string;
|
|
319
|
-
h3: string;
|
|
320
|
-
h4: string;
|
|
321
|
-
h5: string;
|
|
322
|
-
h1: string;
|
|
323
|
-
h2: string;
|
|
324
|
-
};
|
|
325
|
-
media: Record<string | number, (l: TemplateStringsArray, ...p: (string | number)[]) => string>;
|
|
326
|
-
radius: {
|
|
327
|
-
default: string;
|
|
328
|
-
s: string;
|
|
329
|
-
xs: string;
|
|
330
|
-
circle: string;
|
|
331
|
-
pill: string;
|
|
332
|
-
};
|
|
333
|
-
}, {}, never>;
|
|
334
168
|
declare const _default: import("styled-components").GlobalStyleComponent<{}, {
|
|
335
169
|
base: {
|
|
336
170
|
baseHeight: {
|
|
@@ -187,67 +187,8 @@ const globalStyles = styled.css `
|
|
|
187
187
|
opacity: 0;
|
|
188
188
|
}
|
|
189
189
|
`;
|
|
190
|
-
const CheckboxAndRadioInputCore = styled.default.input `
|
|
191
|
-
display: inline-grid;
|
|
192
|
-
appearance: none;
|
|
193
|
-
place-content: center;
|
|
194
|
-
float: left;
|
|
195
|
-
margin: 0;
|
|
196
|
-
cursor: pointer;
|
|
197
|
-
font-family: ${theme.default.fontFamily.default};
|
|
198
|
-
font-size: ${theme.default.fontSize.default};
|
|
199
|
-
line-height: ${theme.default.lineHeight.default};
|
|
200
|
-
min-width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
|
|
201
|
-
width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
|
|
202
|
-
height: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
|
|
203
|
-
color: ${theme.default.color.line.L01};
|
|
204
|
-
border: 2px solid ${theme.default.color.line.L01};
|
|
205
|
-
border-radius: ${theme.default.radius.s};
|
|
206
|
-
background-color: ${theme.default.color.background.white.default};
|
|
207
|
-
|
|
208
|
-
& + label {
|
|
209
|
-
cursor: pointer;
|
|
210
|
-
color: ${theme.default.color.text.black};
|
|
211
|
-
font-weight: ${theme.default.fontWeight.medium};
|
|
212
|
-
padding-left: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
&::before {
|
|
216
|
-
content: '';
|
|
217
|
-
transform: scale(0);
|
|
218
|
-
background-color: currentColor;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
&:checked {
|
|
222
|
-
color: ${theme.default.color.default.pink};
|
|
223
|
-
border-color: ${theme.default.color.default.pink};
|
|
224
|
-
|
|
225
|
-
&::before {
|
|
226
|
-
transform: scale(1);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
&:disabled {
|
|
231
|
-
cursor: not-allowed;
|
|
232
|
-
color: ${theme.default.color.text.gray};
|
|
233
|
-
background-color: ${theme.default.color.line.L02};
|
|
234
|
-
border-color: ${theme.default.color.line.L01};
|
|
235
|
-
|
|
236
|
-
& + label {
|
|
237
|
-
cursor: not-allowed;
|
|
238
|
-
color: ${theme.default.color.text.gray};
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
&:disabled:checked {
|
|
243
|
-
color: ${theme.default.color.default.pink}${theme.default.color.transparency.T30};
|
|
244
|
-
border-color: ${theme.default.color.default.pink}${theme.default.color.transparency.T30};
|
|
245
|
-
background-color: ${theme.default.color.background.white.default};
|
|
246
|
-
}
|
|
247
|
-
`;
|
|
248
190
|
styled.createGlobalStyle `
|
|
249
191
|
${globalStyles}
|
|
250
192
|
`;
|
|
251
193
|
|
|
252
|
-
exports.CheckboxAndRadioInputCore = CheckboxAndRadioInputCore;
|
|
253
194
|
exports.globalStyles = globalStyles;
|
|
@@ -78,10 +78,22 @@ export interface Props {
|
|
|
78
78
|
* Allows to pass testid string for testing purposes
|
|
79
79
|
*/
|
|
80
80
|
'data-testid'?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Allows to pass a screen reader label for the button
|
|
83
|
+
*/
|
|
84
|
+
'aria-label'?: string;
|
|
81
85
|
/**
|
|
82
86
|
* Allows to pass any data-* attribute
|
|
83
87
|
*/
|
|
84
88
|
dataAttributes?: Record<`data-${string}`, string>;
|
|
89
|
+
/**
|
|
90
|
+
* Allows to pass a screen reader label for the loading indicator
|
|
91
|
+
*/
|
|
92
|
+
loadingLabel?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Ref for the button element
|
|
95
|
+
*/
|
|
96
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
85
97
|
}
|
|
86
98
|
export declare const shade: {
|
|
87
99
|
pink: {
|
|
@@ -100,6 +112,6 @@ export declare const shade: {
|
|
|
100
112
|
};
|
|
101
113
|
};
|
|
102
114
|
/** @visibleName Button */
|
|
103
|
-
declare const Button: ({ type, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue, ...props }: Props) => React.JSX.Element;
|
|
115
|
+
declare const Button: ({ type, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue, "aria-label": ariaLabel, ...props }: Props) => React.JSX.Element;
|
|
104
116
|
/** @component */
|
|
105
117
|
export default Button;
|
|
@@ -43,7 +43,7 @@ const Element = styled__default.button `
|
|
|
43
43
|
display: inline-flex;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
&:focus {
|
|
46
|
+
&:focus-visible {
|
|
47
47
|
color: ${({ darkBg }) => (darkBg ? theme.color.text.plum : theme.color.text.white)};
|
|
48
48
|
background-color: ${({ darkBg }) => darkBg ? theme.color.default.white : shade.plum.darker};
|
|
49
49
|
border: 2px solid
|
|
@@ -57,7 +57,7 @@ const Element = styled__default.button `
|
|
|
57
57
|
color: ${({ darkBg }) => (darkBg ? theme.color.text.plum : theme.color.text.white)};
|
|
58
58
|
background-color: ${({ darkBg }) => darkBg ? theme.color.default.white : shade.plum.darker};
|
|
59
59
|
|
|
60
|
-
&:focus {
|
|
60
|
+
&:focus-visible {
|
|
61
61
|
border: 2px solid
|
|
62
62
|
${({ darkBg }) => (darkBg ? theme.color.focus.dark : theme.color.focus.light)};
|
|
63
63
|
box-shadow: 0px 0px 0px 2px
|
|
@@ -113,11 +113,11 @@ const Element = styled__default.button `
|
|
|
113
113
|
`;
|
|
114
114
|
/** @visibleName Button */
|
|
115
115
|
const Button = (_a) => {
|
|
116
|
-
var { type = 'submit', 'data-testid': dataTestId, 'data-no-close': dataNoClose, 'data-track-value': dataTrackValue } = _a, props = __rest(_a, ["type", 'data-testid', 'data-no-close', 'data-track-value']);
|
|
117
|
-
return (React__default.createElement(Element, Object.assign({ id: props.id, as: props.href ? 'a' : undefined, type: props.href ? undefined : type, href: props.href, onClick: props.onClick, onMouseDown: props.onMouseDown, small: props.small, darkBg: props.darkBg, fullWidth: props.fullWidth, "$loading": props.loading, tabIndex: props.loading ? -1 : 0, "data-loading": props.loading, className: props.className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue }, props.dataAttributes, (!props.href && {
|
|
116
|
+
var { type = 'submit', 'data-testid': dataTestId, 'data-no-close': dataNoClose, 'data-track-value': dataTrackValue, 'aria-label': ariaLabel } = _a, props = __rest(_a, ["type", 'data-testid', 'data-no-close', 'data-track-value', 'aria-label']);
|
|
117
|
+
return (React__default.createElement(Element, Object.assign({ id: props.id, as: props.href ? 'a' : undefined, type: props.href ? undefined : type, href: props.href, onClick: props.onClick, onMouseDown: props.onMouseDown, small: props.small, darkBg: props.darkBg, fullWidth: props.fullWidth, "$loading": props.loading, tabIndex: props.loading ? -1 : 0, "data-loading": props.loading, className: props.className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue, "aria-label": ariaLabel }, props.dataAttributes, (!props.href && {
|
|
118
118
|
name: props.name,
|
|
119
119
|
disabled: props.disabled,
|
|
120
|
-
})), props.loading ? (React__default.createElement(PixelLoader, { color: props.darkBg ? theme.color.default.white : theme.color.default.plum })) : (React__default.createElement("span", { "data-testid": dataTestId && `${dataTestId}-text`, "data-no-close": dataNoClose }, props.children))));
|
|
120
|
+
})), props.loading ? (React__default.createElement(PixelLoader, { color: props.darkBg ? theme.color.default.white : theme.color.default.plum, label: props.loadingLabel })) : (React__default.createElement("span", { "data-testid": dataTestId && `${dataTestId}-text`, "data-no-close": dataNoClose }, props.children))));
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
export { Button as default, shade };
|
|
@@ -24,7 +24,7 @@ type Props = ({
|
|
|
24
24
|
*/
|
|
25
25
|
icon: ReactNode;
|
|
26
26
|
direction?: never;
|
|
27
|
-
}) & Omit<ButtonProps, 'children' | 'small' | 'fullWidth' | 'loading' | 'data-no-close'> & {
|
|
27
|
+
}) & Omit<ButtonProps, 'children' | 'small' | 'fullWidth' | 'loading' | 'data-no-close' | 'href' | 'loadingLabel'> & {
|
|
28
28
|
/**
|
|
29
29
|
* Allows to change the styling of component
|
|
30
30
|
*
|
|
@@ -34,8 +34,14 @@ type Props = ({
|
|
|
34
34
|
* @default 'primary'
|
|
35
35
|
*/
|
|
36
36
|
variant?: ButtonArrowVariant;
|
|
37
|
+
/**
|
|
38
|
+
* Allows to change the type of resulting HTML element from button (`<button></button>`) to anchor (`<a href="..."></a>`)
|
|
39
|
+
*
|
|
40
|
+
* @deprecated Use `Button` component for href support
|
|
41
|
+
*/
|
|
42
|
+
href?: string;
|
|
37
43
|
};
|
|
38
44
|
/** @visibleName Button Arrow */
|
|
39
|
-
declare const ButtonArrow: ({ variant, "data-testid": dataTestId, "data-track-value": dataTrackValue, ...props }: Props) => React.JSX.Element;
|
|
45
|
+
declare const ButtonArrow: ({ variant, "data-testid": dataTestId, "data-track-value": dataTrackValue, "aria-label": ariaLabel, ...props }: Props) => React.JSX.Element;
|
|
40
46
|
/** @component */
|
|
41
47
|
export default ButtonArrow;
|
|
@@ -62,9 +62,9 @@ const buttonsMap = {
|
|
|
62
62
|
};
|
|
63
63
|
/** @visibleName Button Arrow */
|
|
64
64
|
const ButtonArrow = (_a) => {
|
|
65
|
-
var { variant = 'primary', 'data-testid': dataTestId, 'data-track-value': dataTrackValue } = _a, props = __rest(_a, ["variant", 'data-testid', 'data-track-value']);
|
|
65
|
+
var { variant = 'primary', 'data-testid': dataTestId, 'data-track-value': dataTrackValue, 'aria-label': ariaLabel } = _a, props = __rest(_a, ["variant", 'data-testid', 'data-track-value', 'aria-label']);
|
|
66
66
|
const Element = buttonsMap[variant];
|
|
67
|
-
return (React__default.createElement(Element, { id: props.id, href: props.href, name: props.name, type: props.type, onClick: props.onClick, onMouseDown: props.onMouseDown, darkBg: props.darkBg, disabled: props.disabled, className: props.className, "data-testid": dataTestId, "data-track-value": dataTrackValue, dataAttributes: props.dataAttributes }, props.direction ? (React__default.createElement(Icon, { icon: iconsMap[props.direction], size: "1rem" })) : (isValidElement(props.icon) && props.icon.type === Icon && props.icon)));
|
|
67
|
+
return (React__default.createElement(Element, { id: props.id, href: props.href, name: props.name, type: props.type, onClick: props.onClick, onMouseDown: props.onMouseDown, darkBg: props.darkBg, disabled: props.disabled, className: props.className, "data-testid": dataTestId, "data-track-value": dataTrackValue, dataAttributes: props.dataAttributes, "aria-label": ariaLabel }, props.direction ? (React__default.createElement(Icon, { icon: iconsMap[props.direction], size: "1rem", "aria-hidden": true })) : (isValidElement(props.icon) && props.icon.type === Icon && props.icon)));
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
export { ButtonArrow as default };
|
|
@@ -26,8 +26,18 @@ interface Props extends Omit<ButtonProps, 'fullWidth'> {
|
|
|
26
26
|
* @default undefined
|
|
27
27
|
*/
|
|
28
28
|
ariaExpanded?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Allows to pass aria hidden to the icon element for screen readers
|
|
31
|
+
*
|
|
32
|
+
* @default undefined
|
|
33
|
+
*/
|
|
34
|
+
ariaHidden?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Screen reader label describing the purpose of the ButtonIcon,
|
|
37
|
+
*/
|
|
38
|
+
ariaLabel?: string;
|
|
29
39
|
}
|
|
30
40
|
/** @visibleName Button Icon */
|
|
31
|
-
declare const ButtonIcon:
|
|
41
|
+
declare const ButtonIcon: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
32
42
|
/** @component */
|
|
33
43
|
export default ButtonIcon;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import { EditUnderline } from '@dnanpm/icons';
|
|
3
|
-
import React__default from 'react';
|
|
3
|
+
import React__default, { forwardRef } from 'react';
|
|
4
4
|
import styled__default, { css } from 'styled-components';
|
|
5
5
|
import theme from '../../themes/theme.js';
|
|
6
6
|
import { getDividedSize, media } from '../../utils/styledUtils.js';
|
|
@@ -80,12 +80,12 @@ const ButtonElement = styled__default.button `
|
|
|
80
80
|
`}
|
|
81
81
|
`;
|
|
82
82
|
/** @visibleName Button Icon */
|
|
83
|
-
const ButtonIcon = (_a) => {
|
|
83
|
+
const ButtonIcon = forwardRef((_a, ref) => {
|
|
84
84
|
var { icon = EditUnderline, 'data-testid': dataTestId, 'data-no-close': dataNoClose, 'data-track-value': dataTrackValue } = _a, props = __rest(_a, ["icon", 'data-testid', 'data-no-close', 'data-track-value']);
|
|
85
85
|
const position = props.isReversed ? 'right' : 'left';
|
|
86
|
-
return (React__default.createElement(ButtonElement, Object.assign({ id: props.id, name: props.name, type: props.type, onClick: props.onClick, onMouseDown: props.onMouseDown, small: props.small, darkBg: props.darkBg, "$loading": props.loading, tabIndex: props.loading ? -1 : 0, "data-loading": props.loading, disabled: props.disabled, hideChildrenMobile: props.hideChildrenMobile, isReversed: props.isReversed, className: props.className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue, "aria-expanded": props.ariaExpanded }, props.dataAttributes), props.loading ? (React__default.createElement(PixelLoader, { color: props.darkBg ? theme.color.default.white : theme.color.default.black })) : (React__default.createElement(React__default.Fragment, null,
|
|
87
|
-
React__default.createElement(Icon, { icon: icon, color: props.darkBg ? theme.color.default.white : theme.color.default.pink, size: props.small ? '1.25rem' : '1.5rem', position: props.children ? position : undefined }),
|
|
86
|
+
return (React__default.createElement(ButtonElement, Object.assign({ ref: ref, id: props.id, name: props.name, type: props.type, onClick: props.onClick, onMouseDown: props.onMouseDown, small: props.small, darkBg: props.darkBg, "$loading": props.loading, tabIndex: props.loading ? -1 : 0, "data-loading": props.loading, disabled: props.disabled, hideChildrenMobile: props.hideChildrenMobile, isReversed: props.isReversed, className: props.className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue, "aria-expanded": props.ariaExpanded, "aria-label": props.ariaLabel }, props.dataAttributes), props.loading ? (React__default.createElement(PixelLoader, { color: props.darkBg ? theme.color.default.white : theme.color.default.black })) : (React__default.createElement(React__default.Fragment, null,
|
|
87
|
+
React__default.createElement(Icon, { icon: icon, color: props.darkBg ? theme.color.default.white : theme.color.default.pink, size: props.small ? '1.25rem' : '1.5rem', position: props.children ? position : undefined, "aria-hidden": props.ariaHidden }),
|
|
88
88
|
props.children && (React__default.createElement("span", { "data-testid": dataTestId && `${dataTestId}-text`, "data-no-close": dataNoClose }, props.children))))));
|
|
89
|
-
};
|
|
89
|
+
});
|
|
90
90
|
|
|
91
91
|
export { ButtonIcon as default };
|
|
@@ -54,8 +54,196 @@ interface Props {
|
|
|
54
54
|
* If not provided, visibleItems property will be used
|
|
55
55
|
*/
|
|
56
56
|
responsive?: Partial<Responsive>;
|
|
57
|
+
/**
|
|
58
|
+
* Allows to pass a screen reader label for the pagination item next to the current slide number
|
|
59
|
+
*/
|
|
60
|
+
paginationAriaLabel?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Allows to pass a screen reader label for the next arrow button
|
|
63
|
+
*/
|
|
64
|
+
nextAriaLabel?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Allows to pass a screen reader label for the previous arrow button
|
|
67
|
+
*/
|
|
68
|
+
previousAriaLabel?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Number of items to move when navigating the carousel
|
|
71
|
+
*
|
|
72
|
+
* @default 1
|
|
73
|
+
*/
|
|
74
|
+
swipeStep?: number;
|
|
57
75
|
}
|
|
76
|
+
declare const SlideItem: import("styled-components").StyledComponent<"div", {
|
|
77
|
+
base: {
|
|
78
|
+
baseHeight: {
|
|
79
|
+
value: number;
|
|
80
|
+
unit: string;
|
|
81
|
+
};
|
|
82
|
+
baseWidth: {
|
|
83
|
+
value: number;
|
|
84
|
+
unit: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
breakpoints: import("../../themes/themeComponents/breakpoints").ViewBreakpoints;
|
|
88
|
+
color: {
|
|
89
|
+
default: {
|
|
90
|
+
pink: string;
|
|
91
|
+
plum: string;
|
|
92
|
+
white: string;
|
|
93
|
+
black: string;
|
|
94
|
+
};
|
|
95
|
+
accent: {
|
|
96
|
+
lemon: string;
|
|
97
|
+
sky: string;
|
|
98
|
+
orange: string;
|
|
99
|
+
};
|
|
100
|
+
active: {
|
|
101
|
+
pink: string;
|
|
102
|
+
};
|
|
103
|
+
hover: {
|
|
104
|
+
pink: string;
|
|
105
|
+
};
|
|
106
|
+
text: {
|
|
107
|
+
gray: string;
|
|
108
|
+
pink: string;
|
|
109
|
+
plum: string;
|
|
110
|
+
white: string;
|
|
111
|
+
black: string;
|
|
112
|
+
};
|
|
113
|
+
line: {
|
|
114
|
+
L01: string;
|
|
115
|
+
L02: string;
|
|
116
|
+
L03: string;
|
|
117
|
+
L04: string;
|
|
118
|
+
};
|
|
119
|
+
notification: {
|
|
120
|
+
info: string;
|
|
121
|
+
success: string;
|
|
122
|
+
warning: string;
|
|
123
|
+
error: string;
|
|
124
|
+
};
|
|
125
|
+
background: {
|
|
126
|
+
sand: {
|
|
127
|
+
default: string;
|
|
128
|
+
E01: string;
|
|
129
|
+
E02: string;
|
|
130
|
+
};
|
|
131
|
+
pink: {
|
|
132
|
+
default: string;
|
|
133
|
+
E01: string;
|
|
134
|
+
E02: string;
|
|
135
|
+
};
|
|
136
|
+
plum: {
|
|
137
|
+
default: string;
|
|
138
|
+
E01: string;
|
|
139
|
+
E02: string;
|
|
140
|
+
};
|
|
141
|
+
lemon: {
|
|
142
|
+
default: string;
|
|
143
|
+
E01: string;
|
|
144
|
+
E02: string;
|
|
145
|
+
};
|
|
146
|
+
sky: {
|
|
147
|
+
default: string;
|
|
148
|
+
E01: string;
|
|
149
|
+
E02: string;
|
|
150
|
+
};
|
|
151
|
+
orange: {
|
|
152
|
+
default: string;
|
|
153
|
+
E01: string;
|
|
154
|
+
E02: string;
|
|
155
|
+
};
|
|
156
|
+
white: {
|
|
157
|
+
default: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
focus: {
|
|
161
|
+
dark: string;
|
|
162
|
+
light: string;
|
|
163
|
+
};
|
|
164
|
+
transparency: {
|
|
165
|
+
T0: string;
|
|
166
|
+
T10: string;
|
|
167
|
+
T20: string;
|
|
168
|
+
T30: string;
|
|
169
|
+
T40: string;
|
|
170
|
+
T50: string;
|
|
171
|
+
T60: string;
|
|
172
|
+
T70: string;
|
|
173
|
+
T80: string;
|
|
174
|
+
T90: string;
|
|
175
|
+
T100: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
fontFamily: {
|
|
179
|
+
default: string;
|
|
180
|
+
heading: string;
|
|
181
|
+
numerals: string;
|
|
182
|
+
};
|
|
183
|
+
fontSize: {
|
|
184
|
+
default: string;
|
|
185
|
+
xl: string;
|
|
186
|
+
l: string;
|
|
187
|
+
s: string;
|
|
188
|
+
xs: string;
|
|
189
|
+
h1XL: string;
|
|
190
|
+
h1L: string;
|
|
191
|
+
h1M: string;
|
|
192
|
+
h1S: string;
|
|
193
|
+
h2M: string;
|
|
194
|
+
h2S: string;
|
|
195
|
+
h3: string;
|
|
196
|
+
h4: string;
|
|
197
|
+
h5: string;
|
|
198
|
+
h1: string;
|
|
199
|
+
h2: string;
|
|
200
|
+
};
|
|
201
|
+
fontWeight: {
|
|
202
|
+
book: number;
|
|
203
|
+
medium: number;
|
|
204
|
+
bold: number;
|
|
205
|
+
black: number;
|
|
206
|
+
};
|
|
207
|
+
form: {
|
|
208
|
+
smallSelectWidth: string;
|
|
209
|
+
smallSelectHeight: string;
|
|
210
|
+
};
|
|
211
|
+
grid: {
|
|
212
|
+
gutter: string;
|
|
213
|
+
};
|
|
214
|
+
lineHeight: {
|
|
215
|
+
default: string;
|
|
216
|
+
xl: string;
|
|
217
|
+
s: string;
|
|
218
|
+
xs: string;
|
|
219
|
+
xxs: string;
|
|
220
|
+
auto: string;
|
|
221
|
+
h1XL: string;
|
|
222
|
+
h1L: string;
|
|
223
|
+
h1M: string;
|
|
224
|
+
h1S: string;
|
|
225
|
+
h2M: string;
|
|
226
|
+
h2S: string;
|
|
227
|
+
h3: string;
|
|
228
|
+
h4: string;
|
|
229
|
+
h5: string;
|
|
230
|
+
h1: string;
|
|
231
|
+
h2: string;
|
|
232
|
+
};
|
|
233
|
+
media: Record<string | number, (l: TemplateStringsArray, ...p: (string | number)[]) => string>;
|
|
234
|
+
radius: {
|
|
235
|
+
default: string;
|
|
236
|
+
s: string;
|
|
237
|
+
xs: string;
|
|
238
|
+
circle: string;
|
|
239
|
+
pill: string;
|
|
240
|
+
};
|
|
241
|
+
}, Required<Pick<Props, "visibleItems">> & {
|
|
242
|
+
itemWidthCorrection: number;
|
|
243
|
+
isSwiping: boolean;
|
|
244
|
+
}, never>;
|
|
58
245
|
/** @visibleName Carousel */
|
|
59
246
|
declare const Carousel: ({ "data-testid": dataTestId, ...props }: Props) => React.JSX.Element;
|
|
60
247
|
/** @component */
|
|
61
248
|
export default Carousel;
|
|
249
|
+
export { SlideItem };
|