@transferwise/components 0.0.0-experimental-da6dbbf → 0.0.0-experimental-4c1cb43
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/index.js +635 -933
- package/build/index.js.map +1 -1
- package/build/index.mjs +625 -922
- package/build/index.mjs.map +1 -1
- package/build/main.css +0 -135
- package/build/styles/main.css +0 -135
- package/build/types/accordion/AccordionItem/AccordionItem.d.ts.map +1 -1
- package/build/types/common/card/Card.d.ts +2 -2
- package/build/types/common/card/Card.d.ts.map +1 -1
- package/build/types/common/hooks/useMedia.d.ts.map +1 -1
- package/build/types/common/panel/Panel.d.ts.map +1 -1
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts.map +1 -1
- package/build/types/dateLookup/DateLookup.d.ts +6 -5
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts +1 -11
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/drawer/Drawer.d.ts +4 -4
- package/build/types/index.d.ts +3 -4
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputWithDisplayFormat/InputWithDisplayFormat.d.ts +2 -1
- package/build/types/inputWithDisplayFormat/InputWithDisplayFormat.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/contexts.d.ts +2 -2
- package/build/types/inputs/contexts.d.ts.map +1 -1
- package/build/types/modal/Modal.d.ts.map +1 -1
- package/build/types/processIndicator/ProcessIndicator.d.ts +36 -19
- package/build/types/processIndicator/ProcessIndicator.d.ts.map +1 -1
- package/build/types/processIndicator/index.d.ts +2 -2
- package/build/types/processIndicator/index.d.ts.map +1 -1
- package/build/types/promoCard/PromoCard.d.ts +5 -16
- package/build/types/promoCard/PromoCard.d.ts.map +1 -1
- package/build/types/select/searchBox/SearchBox.d.ts +1 -1
- package/build/types/textareaWithDisplayFormat/TextareaWithDisplayFormat.d.ts +2 -1
- package/build/types/textareaWithDisplayFormat/TextareaWithDisplayFormat.d.ts.map +1 -1
- package/build/types/tooltip/Tooltip.d.ts +1 -1
- package/build/types/tooltip/Tooltip.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts +14 -14
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/package.json +9 -13
- package/src/accordion/AccordionItem/AccordionItem.tsx +2 -4
- package/src/avatarWrapper/AvatarWrapper.story.tsx +1 -3
- package/src/button/Button.tsx +1 -1
- package/src/common/card/Card.tsx +43 -51
- package/src/common/hooks/useConditionalListener/useConditionalListener.spec.js +1 -1
- package/src/common/hooks/useHasIntersected/useHasIntersected.spec.js +3 -3
- package/src/common/hooks/useMedia.spec.ts +1 -1
- package/src/common/hooks/useMedia.ts +1 -2
- package/src/common/panel/Panel.tsx +90 -92
- package/src/common/responsivePanel/ResponsivePanel.tsx +34 -38
- package/src/dateLookup/DateLookup.rtl.spec.tsx +181 -5
- package/src/dateLookup/DateLookup.testingLibrary.spec.js +171 -124
- package/src/dateLookup/DateLookup.tsx +14 -9
- package/src/drawer/Drawer.js +3 -3
- package/src/field/Field.tsx +3 -3
- package/src/index.ts +3 -4
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.tsx +2 -1
- package/src/inputs/SelectInput.story.tsx +2 -1
- package/src/inputs/SelectInput.tsx +10 -2
- package/src/inputs/contexts.tsx +4 -4
- package/src/main.css +0 -135
- package/src/main.less +0 -1
- package/src/modal/Modal.tsx +1 -2
- package/src/processIndicator/ProcessIndicator.rtl.spec.tsx +45 -0
- package/src/processIndicator/ProcessIndicator.tsx +110 -0
- package/src/promoCard/PromoCard.story.tsx +2 -2
- package/src/promoCard/PromoCard.tsx +9 -31
- package/src/radio/__snapshots__/Radio.rtl.spec.tsx.snap +0 -1
- package/src/snackbar/Snackbar.spec.js +4 -1
- package/src/snackbar/Snackbar.story.tsx +4 -2
- package/src/tabs/Tabs.spec.js +46 -27
- package/src/test-utils/index.js +5 -7
- package/src/test-utils/jest.setup.js +9 -3
- package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.tsx +2 -1
- package/src/tooltip/Tooltip.tsx +44 -46
- package/src/tooltip/__snapshots__/Tooltip.spec.tsx.snap +2 -2
- package/src/upload/Upload.spec.js +34 -13
- package/src/uploadInput/UploadInput.spec.tsx +21 -23
- package/src/uploadInput/uploadItem/UploadItem.tsx +1 -3
- package/src/withDisplayFormat/WithDisplayFormat.spec.js +63 -32
- package/src/withDisplayFormat/WithDisplayFormat.tsx +28 -28
- package/build/styles/carousel/Carousel.css +0 -135
- package/build/types/carousel/Carousel.d.ts +0 -26
- package/build/types/carousel/Carousel.d.ts.map +0 -1
- package/build/types/carousel/index.d.ts +0 -3
- package/build/types/carousel/index.d.ts.map +0 -1
- package/src/carousel/Carousel.css +0 -135
- package/src/carousel/Carousel.less +0 -133
- package/src/carousel/Carousel.spec.tsx +0 -221
- package/src/carousel/Carousel.story.tsx +0 -63
- package/src/carousel/Carousel.tsx +0 -345
- package/src/carousel/index.ts +0 -3
- package/src/dateLookup/DateLookup.keyboardEvents.spec.js +0 -180
- package/src/processIndicator/ProcessIndicator.js +0 -117
- package/src/processIndicator/ProcessIndicator.spec.js +0 -101
- /package/src/processIndicator/{index.js → index.ts} +0 -0
|
@@ -25,12 +25,12 @@ export type EventType =
|
|
|
25
25
|
| 'Delete'
|
|
26
26
|
| 'Initial';
|
|
27
27
|
|
|
28
|
-
interface WithDisplayFormatState {
|
|
28
|
+
interface WithDisplayFormatState<T extends HTMLTextElement> {
|
|
29
29
|
value: string;
|
|
30
30
|
historyNavigator: HistoryNavigator;
|
|
31
31
|
prevDisplayPattern: string;
|
|
32
32
|
triggerType: EventType;
|
|
33
|
-
triggerEvent: React.KeyboardEvent<
|
|
33
|
+
triggerEvent: React.KeyboardEvent<T> | null;
|
|
34
34
|
pastedLength: number;
|
|
35
35
|
selectionStart: number;
|
|
36
36
|
selectionEnd: number;
|
|
@@ -38,7 +38,7 @@ interface WithDisplayFormatState {
|
|
|
38
38
|
|
|
39
39
|
export interface WithDisplayFormatProps<T extends TextElementProps = TextElementProps>
|
|
40
40
|
extends Pick<
|
|
41
|
-
|
|
41
|
+
T,
|
|
42
42
|
| 'className'
|
|
43
43
|
| 'disabled'
|
|
44
44
|
| 'id'
|
|
@@ -64,19 +64,21 @@ export interface WithDisplayFormatProps<T extends TextElementProps = TextElement
|
|
|
64
64
|
render: (renderProps: T) => JSX.Element;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
class WithDisplayFormat<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
> {
|
|
67
|
+
class WithDisplayFormat<
|
|
68
|
+
T extends TextElementProps = TextElementProps,
|
|
69
|
+
U extends HTMLTextElement = HTMLTextElement,
|
|
70
|
+
> extends Component<WithDisplayFormatProps<T>, WithDisplayFormatState<U>> {
|
|
71
71
|
declare props: WithDisplayFormatProps<T> &
|
|
72
|
-
Required<
|
|
72
|
+
Required<
|
|
73
|
+
Pick<WithDisplayFormatProps<T>, keyof (typeof WithDisplayFormat<T, U>)['defaultProps']>
|
|
74
|
+
>;
|
|
73
75
|
static defaultProps = {
|
|
74
76
|
autoComplete: 'off',
|
|
75
77
|
displayPattern: '',
|
|
76
78
|
value: '',
|
|
77
|
-
}
|
|
79
|
+
} satisfies Partial<WithDisplayFormatProps>;
|
|
78
80
|
|
|
79
|
-
constructor(props:
|
|
81
|
+
constructor(props: WithDisplayFormat<T, U>['props']) {
|
|
80
82
|
super(props);
|
|
81
83
|
const unformattedValue = unformatWithPattern(props.value ?? '', props.displayPattern);
|
|
82
84
|
this.state = {
|
|
@@ -92,8 +94,8 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
static getDerivedStateFromProps(
|
|
95
|
-
{ displayPattern }:
|
|
96
|
-
{ prevDisplayPattern = displayPattern, value, historyNavigator }:
|
|
97
|
+
{ displayPattern }: WithDisplayFormat['props'],
|
|
98
|
+
{ prevDisplayPattern = displayPattern, value, historyNavigator }: WithDisplayFormat['state'],
|
|
97
99
|
) {
|
|
98
100
|
if (prevDisplayPattern !== displayPattern) {
|
|
99
101
|
const unFormattedValue = unformatWithPattern(value, prevDisplayPattern);
|
|
@@ -137,10 +139,9 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
137
139
|
return 'Backspace';
|
|
138
140
|
}
|
|
139
141
|
return triggerEvent.key;
|
|
140
|
-
} else {
|
|
141
|
-
// triggerEvent can be null only in case of "autofilling" (via password manager extension or browser build-in one) events
|
|
142
|
-
return 'Paste';
|
|
143
142
|
}
|
|
143
|
+
// triggerEvent can be null only in case of "autofilling" (via password manager extension or browser build-in one) events
|
|
144
|
+
return 'Paste';
|
|
144
145
|
};
|
|
145
146
|
|
|
146
147
|
resetEvent = () => {
|
|
@@ -151,7 +152,7 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
151
152
|
});
|
|
152
153
|
};
|
|
153
154
|
|
|
154
|
-
detectUndoRedo = (event: React.KeyboardEvent<
|
|
155
|
+
detectUndoRedo = (event: React.KeyboardEvent<U>) => {
|
|
155
156
|
const charCode = String.fromCharCode(event.which).toLowerCase();
|
|
156
157
|
if ((event.ctrlKey || event.metaKey) && charCode === 'z') {
|
|
157
158
|
return event.shiftKey ? 'Redo' : 'Undo';
|
|
@@ -159,7 +160,7 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
159
160
|
return null;
|
|
160
161
|
};
|
|
161
162
|
|
|
162
|
-
handleOnKeyDown: React.KeyboardEventHandler<
|
|
163
|
+
handleOnKeyDown: React.KeyboardEventHandler<U> = (event) => {
|
|
163
164
|
event.persist();
|
|
164
165
|
const { selectionStart, selectionEnd } = event.currentTarget;
|
|
165
166
|
const { historyNavigator } = this.state;
|
|
@@ -184,7 +185,7 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
184
185
|
}
|
|
185
186
|
};
|
|
186
187
|
|
|
187
|
-
handleOnPaste: React.ClipboardEventHandler<
|
|
188
|
+
handleOnPaste: React.ClipboardEventHandler<U> = (event) => {
|
|
188
189
|
const { displayPattern } = this.props;
|
|
189
190
|
const pastedLength = unformatWithPattern(
|
|
190
191
|
event.clipboardData.getData('Text'),
|
|
@@ -194,7 +195,7 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
194
195
|
this.setState({ triggerType: 'Paste', pastedLength });
|
|
195
196
|
};
|
|
196
197
|
|
|
197
|
-
handleOnCut: React.ClipboardEventHandler<
|
|
198
|
+
handleOnCut: React.ClipboardEventHandler<U> = () => {
|
|
198
199
|
this.setState({ triggerType: 'Cut' });
|
|
199
200
|
};
|
|
200
201
|
|
|
@@ -205,7 +206,7 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
205
206
|
return !symbolsInPattern.includes(action);
|
|
206
207
|
};
|
|
207
208
|
|
|
208
|
-
handleOnChange: React.ChangeEventHandler<
|
|
209
|
+
handleOnChange: React.ChangeEventHandler<U> = (event) => {
|
|
209
210
|
const { historyNavigator, triggerType } = this.state;
|
|
210
211
|
const { displayPattern, onChange } = this.props;
|
|
211
212
|
const { value } = event.target;
|
|
@@ -233,11 +234,11 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
233
234
|
});
|
|
234
235
|
};
|
|
235
236
|
|
|
236
|
-
handleOnBlur: React.FocusEventHandler<
|
|
237
|
+
handleOnBlur: React.FocusEventHandler<U> = (event) => {
|
|
237
238
|
this.props.onBlur?.(unformatWithPattern(event.target.value, this.props.displayPattern));
|
|
238
239
|
};
|
|
239
240
|
|
|
240
|
-
handleOnFocus: React.FocusEventHandler<
|
|
241
|
+
handleOnFocus: React.FocusEventHandler<U> = (event) => {
|
|
241
242
|
const { displayPattern, onFocus } = this.props;
|
|
242
243
|
if (onFocus) {
|
|
243
244
|
this.handleOnChange(event);
|
|
@@ -273,6 +274,7 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
273
274
|
handleCursorPositioning = (action: string) => {
|
|
274
275
|
const { displayPattern } = this.props;
|
|
275
276
|
const { triggerEvent, selectionStart, selectionEnd, pastedLength } = this.state;
|
|
277
|
+
const target = triggerEvent?.currentTarget;
|
|
276
278
|
|
|
277
279
|
const cursorPosition = getCursorPositionAfterKeystroke(
|
|
278
280
|
action,
|
|
@@ -283,9 +285,7 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
283
285
|
);
|
|
284
286
|
|
|
285
287
|
setTimeout(() => {
|
|
286
|
-
|
|
287
|
-
(triggerEvent.target as HTMLTextElement).setSelectionRange(cursorPosition, cursorPosition);
|
|
288
|
-
}
|
|
288
|
+
target?.setSelectionRange(cursorPosition, cursorPosition);
|
|
289
289
|
this.setState({ selectionStart: cursorPosition, selectionEnd: cursorPosition });
|
|
290
290
|
}, 0);
|
|
291
291
|
};
|
|
@@ -305,7 +305,7 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
305
305
|
autoComplete,
|
|
306
306
|
} = this.props;
|
|
307
307
|
const { value } = this.state;
|
|
308
|
-
const renderProps
|
|
308
|
+
const renderProps = {
|
|
309
309
|
inputMode,
|
|
310
310
|
className,
|
|
311
311
|
id,
|
|
@@ -324,8 +324,8 @@ class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
|
324
324
|
onKeyDown: this.handleOnKeyDown,
|
|
325
325
|
onChange: this.handleOnChange,
|
|
326
326
|
onCut: this.handleOnCut,
|
|
327
|
-
};
|
|
328
|
-
return this.props.render(renderProps
|
|
327
|
+
} as T;
|
|
328
|
+
return this.props.render(renderProps);
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
.carousel-wrapper {
|
|
2
|
-
overflow: hidden;
|
|
3
|
-
}
|
|
4
|
-
.carousel {
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
overflow-x: scroll;
|
|
8
|
-
overflow-y: hidden;
|
|
9
|
-
scroll-snap-type: x mandatory;
|
|
10
|
-
scroll-behavior: smooth;
|
|
11
|
-
gap: 16px;
|
|
12
|
-
gap: var(--size-16);
|
|
13
|
-
padding: 8px;
|
|
14
|
-
padding: var(--size-8);
|
|
15
|
-
margin: 8px;
|
|
16
|
-
margin: var(--size-8);
|
|
17
|
-
}
|
|
18
|
-
@media (max-width: 767px) {
|
|
19
|
-
.carousel {
|
|
20
|
-
gap: 8px;
|
|
21
|
-
gap: var(--size-8);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
.carousel__header {
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
min-height: 32px;
|
|
29
|
-
min-height: var(--size-32);
|
|
30
|
-
padding-bottom: 16px;
|
|
31
|
-
padding-bottom: var(--size-16);
|
|
32
|
-
}
|
|
33
|
-
.carousel__card,
|
|
34
|
-
.carousel__card:hover,
|
|
35
|
-
.carousel__card:focus,
|
|
36
|
-
.carousel__card:focus-within {
|
|
37
|
-
-webkit-text-decoration: none;
|
|
38
|
-
text-decoration: none;
|
|
39
|
-
transition: none !important;
|
|
40
|
-
box-shadow: none !important;
|
|
41
|
-
}
|
|
42
|
-
.carousel__card {
|
|
43
|
-
display: block;
|
|
44
|
-
position: relative;
|
|
45
|
-
text-align: left;
|
|
46
|
-
border: none;
|
|
47
|
-
overflow: hidden;
|
|
48
|
-
background: rgba(134,167,189,0.10196);
|
|
49
|
-
background: var(--color-background-neutral);
|
|
50
|
-
border-radius: 32px;
|
|
51
|
-
border-radius: var(--size-32);
|
|
52
|
-
scroll-snap-align: center;
|
|
53
|
-
-webkit-scroll-snap-align: center;
|
|
54
|
-
transition: all 0.4s !important;
|
|
55
|
-
}
|
|
56
|
-
@media (min-width: 1200px) {
|
|
57
|
-
.carousel__card {
|
|
58
|
-
min-width: 280px;
|
|
59
|
-
width: 280px;
|
|
60
|
-
height: 280px;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
@media (max-width: 1199px) {
|
|
64
|
-
.carousel__card {
|
|
65
|
-
min-width: 242px;
|
|
66
|
-
width: 242px;
|
|
67
|
-
height: 242px;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
@media (max-width: 767px) {
|
|
71
|
-
.carousel__card {
|
|
72
|
-
min-width: 336px;
|
|
73
|
-
width: 336px;
|
|
74
|
-
height: 336px;
|
|
75
|
-
scroll-snap-stop: always;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
.carousel__card:focus,
|
|
79
|
-
.carousel__card:has(:focus-visible) {
|
|
80
|
-
outline: var(--ring-outline-color) solid var(--ring-outline-width) !important;
|
|
81
|
-
outline-offset: var(--ring-outline-offset) !important;
|
|
82
|
-
}
|
|
83
|
-
.carousel__card:hover {
|
|
84
|
-
background-color: var(--color-background-neutral-hover);
|
|
85
|
-
}
|
|
86
|
-
.carousel__card:focus {
|
|
87
|
-
background-color: var(--color-background-neutral-hover);
|
|
88
|
-
}
|
|
89
|
-
.carousel__card-content {
|
|
90
|
-
height: 100%;
|
|
91
|
-
font-weight: normal;
|
|
92
|
-
padding: 24px;
|
|
93
|
-
padding: var(--size-24);
|
|
94
|
-
}
|
|
95
|
-
.carousel__scroll-button {
|
|
96
|
-
width: 32px;
|
|
97
|
-
width: var(--size-32);
|
|
98
|
-
height: 32px;
|
|
99
|
-
height: var(--size-32);
|
|
100
|
-
align-items: center;
|
|
101
|
-
justify-content: center;
|
|
102
|
-
}
|
|
103
|
-
.carousel__indicators {
|
|
104
|
-
display: flex;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
padding-top: 8px;
|
|
107
|
-
padding-top: var(--size-8);
|
|
108
|
-
gap: 8px;
|
|
109
|
-
gap: var(--size-8);
|
|
110
|
-
}
|
|
111
|
-
.carousel__indicator {
|
|
112
|
-
width: 12px;
|
|
113
|
-
width: var(--size-12);
|
|
114
|
-
height: 12px;
|
|
115
|
-
height: var(--size-12);
|
|
116
|
-
border-radius: 8px;
|
|
117
|
-
border-radius: var(--size-8);
|
|
118
|
-
background: #c9cbce;
|
|
119
|
-
background: var(--color-interactive-secondary);
|
|
120
|
-
border: none;
|
|
121
|
-
-webkit-appearance: none;
|
|
122
|
-
-moz-appearance: none;
|
|
123
|
-
appearance: none;
|
|
124
|
-
transition: all 0.1s;
|
|
125
|
-
}
|
|
126
|
-
.carousel__indicator:hover {
|
|
127
|
-
width: 16px;
|
|
128
|
-
width: var(--size-16);
|
|
129
|
-
}
|
|
130
|
-
.carousel__indicator--selected,
|
|
131
|
-
.carousel__indicator--selected:hover {
|
|
132
|
-
background: var(--color-interactive-primary);
|
|
133
|
-
width: 24px;
|
|
134
|
-
width: var(--size-24);
|
|
135
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
-
import type { PromoCardLinkProps } from '../promoCard/PromoCard';
|
|
3
|
-
export type CarouselCardCommon = {
|
|
4
|
-
id: string;
|
|
5
|
-
href?: string;
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
className?: string;
|
|
8
|
-
styles?: CSSProperties;
|
|
9
|
-
};
|
|
10
|
-
export type CarouselDefaultCard = CarouselCardCommon & {
|
|
11
|
-
type: 'anchor' | 'button';
|
|
12
|
-
content: ReactNode;
|
|
13
|
-
};
|
|
14
|
-
export type CarouselPromoCard = CarouselCardCommon & {
|
|
15
|
-
type: 'promo';
|
|
16
|
-
} & Omit<PromoCardLinkProps, 'type'>;
|
|
17
|
-
export type CarouselCard = CarouselDefaultCard | CarouselPromoCard;
|
|
18
|
-
export interface CarouselProps {
|
|
19
|
-
header: string | ReactNode;
|
|
20
|
-
className?: string;
|
|
21
|
-
cards: CarouselCard[];
|
|
22
|
-
onClick?: (cardId: string) => void;
|
|
23
|
-
}
|
|
24
|
-
declare const Carousel: React.FC<CarouselProps>;
|
|
25
|
-
export default Carousel;
|
|
26
|
-
//# sourceMappingURL=Carousel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../src/carousel/Carousel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGjE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG;IACrD,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,OAAO,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG;IACnD,IAAI,EAAE,OAAO,CAAC;CACf,GAAG,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;AACnE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAUD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkSrC,CAAC;AAYF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/carousel/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
.carousel-wrapper {
|
|
2
|
-
overflow: hidden;
|
|
3
|
-
}
|
|
4
|
-
.carousel {
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
overflow-x: scroll;
|
|
8
|
-
overflow-y: hidden;
|
|
9
|
-
scroll-snap-type: x mandatory;
|
|
10
|
-
scroll-behavior: smooth;
|
|
11
|
-
gap: 16px;
|
|
12
|
-
gap: var(--size-16);
|
|
13
|
-
padding: 8px;
|
|
14
|
-
padding: var(--size-8);
|
|
15
|
-
margin: 8px;
|
|
16
|
-
margin: var(--size-8);
|
|
17
|
-
}
|
|
18
|
-
@media (max-width: 767px) {
|
|
19
|
-
.carousel {
|
|
20
|
-
gap: 8px;
|
|
21
|
-
gap: var(--size-8);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
.carousel__header {
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
min-height: 32px;
|
|
29
|
-
min-height: var(--size-32);
|
|
30
|
-
padding-bottom: 16px;
|
|
31
|
-
padding-bottom: var(--size-16);
|
|
32
|
-
}
|
|
33
|
-
.carousel__card,
|
|
34
|
-
.carousel__card:hover,
|
|
35
|
-
.carousel__card:focus,
|
|
36
|
-
.carousel__card:focus-within {
|
|
37
|
-
-webkit-text-decoration: none;
|
|
38
|
-
text-decoration: none;
|
|
39
|
-
transition: none !important;
|
|
40
|
-
box-shadow: none !important;
|
|
41
|
-
}
|
|
42
|
-
.carousel__card {
|
|
43
|
-
display: block;
|
|
44
|
-
position: relative;
|
|
45
|
-
text-align: left;
|
|
46
|
-
border: none;
|
|
47
|
-
overflow: hidden;
|
|
48
|
-
background: rgba(134,167,189,0.10196);
|
|
49
|
-
background: var(--color-background-neutral);
|
|
50
|
-
border-radius: 32px;
|
|
51
|
-
border-radius: var(--size-32);
|
|
52
|
-
scroll-snap-align: center;
|
|
53
|
-
-webkit-scroll-snap-align: center;
|
|
54
|
-
transition: all 0.4s !important;
|
|
55
|
-
}
|
|
56
|
-
@media (min-width: 1200px) {
|
|
57
|
-
.carousel__card {
|
|
58
|
-
min-width: 280px;
|
|
59
|
-
width: 280px;
|
|
60
|
-
height: 280px;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
@media (max-width: 1199px) {
|
|
64
|
-
.carousel__card {
|
|
65
|
-
min-width: 242px;
|
|
66
|
-
width: 242px;
|
|
67
|
-
height: 242px;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
@media (max-width: 767px) {
|
|
71
|
-
.carousel__card {
|
|
72
|
-
min-width: 336px;
|
|
73
|
-
width: 336px;
|
|
74
|
-
height: 336px;
|
|
75
|
-
scroll-snap-stop: always;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
.carousel__card:focus,
|
|
79
|
-
.carousel__card:has(:focus-visible) {
|
|
80
|
-
outline: var(--ring-outline-color) solid var(--ring-outline-width) !important;
|
|
81
|
-
outline-offset: var(--ring-outline-offset) !important;
|
|
82
|
-
}
|
|
83
|
-
.carousel__card:hover {
|
|
84
|
-
background-color: var(--color-background-neutral-hover);
|
|
85
|
-
}
|
|
86
|
-
.carousel__card:focus {
|
|
87
|
-
background-color: var(--color-background-neutral-hover);
|
|
88
|
-
}
|
|
89
|
-
.carousel__card-content {
|
|
90
|
-
height: 100%;
|
|
91
|
-
font-weight: normal;
|
|
92
|
-
padding: 24px;
|
|
93
|
-
padding: var(--size-24);
|
|
94
|
-
}
|
|
95
|
-
.carousel__scroll-button {
|
|
96
|
-
width: 32px;
|
|
97
|
-
width: var(--size-32);
|
|
98
|
-
height: 32px;
|
|
99
|
-
height: var(--size-32);
|
|
100
|
-
align-items: center;
|
|
101
|
-
justify-content: center;
|
|
102
|
-
}
|
|
103
|
-
.carousel__indicators {
|
|
104
|
-
display: flex;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
padding-top: 8px;
|
|
107
|
-
padding-top: var(--size-8);
|
|
108
|
-
gap: 8px;
|
|
109
|
-
gap: var(--size-8);
|
|
110
|
-
}
|
|
111
|
-
.carousel__indicator {
|
|
112
|
-
width: 12px;
|
|
113
|
-
width: var(--size-12);
|
|
114
|
-
height: 12px;
|
|
115
|
-
height: var(--size-12);
|
|
116
|
-
border-radius: 8px;
|
|
117
|
-
border-radius: var(--size-8);
|
|
118
|
-
background: #c9cbce;
|
|
119
|
-
background: var(--color-interactive-secondary);
|
|
120
|
-
border: none;
|
|
121
|
-
-webkit-appearance: none;
|
|
122
|
-
-moz-appearance: none;
|
|
123
|
-
appearance: none;
|
|
124
|
-
transition: all 0.1s;
|
|
125
|
-
}
|
|
126
|
-
.carousel__indicator:hover {
|
|
127
|
-
width: 16px;
|
|
128
|
-
width: var(--size-16);
|
|
129
|
-
}
|
|
130
|
-
.carousel__indicator--selected,
|
|
131
|
-
.carousel__indicator--selected:hover {
|
|
132
|
-
background: var(--color-interactive-primary);
|
|
133
|
-
width: 24px;
|
|
134
|
-
width: var(--size-24);
|
|
135
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
.carousel-wrapper {
|
|
2
|
-
overflow: hidden;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.carousel {
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
overflow-x: scroll;
|
|
9
|
-
overflow-y: hidden;
|
|
10
|
-
scroll-snap-type: x mandatory;
|
|
11
|
-
scroll-behavior: smooth;
|
|
12
|
-
gap: var(--size-16);
|
|
13
|
-
padding: var(--size-8);
|
|
14
|
-
margin: var(--size-8);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@media (--screen-sm-max) {
|
|
18
|
-
.carousel {
|
|
19
|
-
gap: var(--size-8);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
.carousel__header {
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
min-height: var(--size-32);
|
|
29
|
-
padding-bottom: var(--size-16)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// The specificity inside PromoCard is too high for transition / box-shaodw, so we need to use !important below
|
|
33
|
-
.carousel__card,
|
|
34
|
-
.carousel__card:hover,
|
|
35
|
-
.carousel__card:focus,
|
|
36
|
-
.carousel__card:focus-within {
|
|
37
|
-
text-decoration: none;
|
|
38
|
-
transition: none !important;
|
|
39
|
-
box-shadow: none !important;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.carousel__card {
|
|
43
|
-
display: block;
|
|
44
|
-
position: relative;
|
|
45
|
-
text-align: left;
|
|
46
|
-
border: none;
|
|
47
|
-
overflow: hidden;
|
|
48
|
-
background: var(--color-background-neutral);
|
|
49
|
-
border-radius: var(--size-32);
|
|
50
|
-
scroll-snap-align: center;
|
|
51
|
-
-webkit-scroll-snap-align: center;
|
|
52
|
-
transition: all 0.4s !important;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@media (--screen-xl) {
|
|
56
|
-
.carousel__card {
|
|
57
|
-
min-width: 280px;
|
|
58
|
-
width: 280px;
|
|
59
|
-
height: 280px;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
@media (--screen-lg-max) {
|
|
65
|
-
.carousel__card {
|
|
66
|
-
min-width: 242px;
|
|
67
|
-
width: 242px;
|
|
68
|
-
height: 242px;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
@media (--screen-sm-max) {
|
|
74
|
-
.carousel__card {
|
|
75
|
-
min-width: 336px;
|
|
76
|
-
width: 336px;
|
|
77
|
-
height: 336px;
|
|
78
|
-
scroll-snap-stop: always;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.carousel__card:focus, .carousel__card:has(:focus-visible) {
|
|
83
|
-
outline: var(--ring-outline-color) solid var(--ring-outline-width) !important;
|
|
84
|
-
outline-offset: var(--ring-outline-offset) !important;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.carousel__card:hover {
|
|
88
|
-
background-color: var(--color-background-neutral-hover);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.carousel__card:focus {
|
|
92
|
-
background-color: var(--color-background-neutral-hover);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.carousel__card-content {
|
|
96
|
-
height: 100%;
|
|
97
|
-
font-weight: normal;
|
|
98
|
-
padding: var(--size-24);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.carousel__scroll-button {
|
|
102
|
-
width: var(--size-32);
|
|
103
|
-
height: var(--size-32);
|
|
104
|
-
align-items: center;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.carousel__indicators {
|
|
109
|
-
display: flex;
|
|
110
|
-
justify-content: center;
|
|
111
|
-
padding-top: var(--size-8);
|
|
112
|
-
gap: var(--size-8);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.carousel__indicator {
|
|
116
|
-
width: var(--size-12);
|
|
117
|
-
height: var(--size-12);
|
|
118
|
-
border-radius: var(--size-8);
|
|
119
|
-
background: var(--color-interactive-secondary);
|
|
120
|
-
border: none;
|
|
121
|
-
appearance: none;
|
|
122
|
-
transition: all 0.1s;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.carousel__indicator:hover {
|
|
126
|
-
width: var(--size-16)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.carousel__indicator--selected,
|
|
130
|
-
.carousel__indicator--selected:hover {
|
|
131
|
-
background: var(--color-interactive-primary);
|
|
132
|
-
width: var(--size-24);
|
|
133
|
-
}
|