@transferwise/components 0.0.0-experimental-99bbbb3 → 0.0.0-experimental-20085a3
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/i18n/id.json +0 -5
- package/build/i18n/id.json.js +0 -5
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +0 -5
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/types/Body/Body.d.ts +2 -2
- package/build/types/IconButton/IconButton.d.ts +1 -1
- package/build/types/ListItem/_stories/variants/helpers.d.ts.map +1 -1
- package/build/types/MoneyInput/MoneyInput.d.ts +1 -1
- package/build/types/MoneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/Title/Title.d.ts +2 -2
- package/build/types/Upload/Steps/UploadImageStep/UploadImageStep.d.ts +1 -1
- package/build/types/UploadInput/UploadItem/UploadItemLink.d.ts +1 -1
- package/package.json +1 -1
- package/src/Accordion/_stories/Accordion.rtl.test.story.tsx +71 -0
- package/src/AvatarLayout/_stories/AvatarLayout.rtl.test.story.tsx +77 -0
- package/src/AvatarView/_stories/AvatarView.rtl.test.story.tsx +162 -0
- package/src/Button/LegacyButton/_stories/LegacyButton.rtl.test.story.tsx +32 -0
- package/src/Button/_stories/Button.rtl.test.story.tsx +87 -0
- package/src/Calendar/_stories/Calendar.rtl.test.story.tsx +52 -0
- package/src/Calendar/_stories/Calendar.test.story.tsx +28 -24
- package/src/Carousel/_stories/Carousel.rtl.test.story.tsx +61 -0
- package/src/Checkbox/_stories/Checkbox.rtl.test.story.tsx +31 -0
- package/src/CheckboxButton/_stories/CheckboxButton.rtl.test.story.tsx +27 -0
- package/src/CheckboxButton/_stories/CheckboxButton.test.story.tsx +0 -37
- package/src/Chevron/_stories/Chevron.rtl.test.story.tsx +26 -0
- package/src/Chips/_stories/Chips.rtl.test.story.tsx +49 -0
- package/src/Chips/_stories/Chips.test.story.tsx +0 -34
- package/src/CircularButton/_stories/CircularButton.test.story.tsx +0 -68
- package/src/DateInput/_stories/DateInput.rtl.test.story.tsx +25 -0
- package/src/DateLookup/_stories/DateLookup.rtl.test.story.tsx +88 -0
- package/src/Decision/_stories/Decision.rtl.test.story.tsx +79 -0
- package/src/DefinitionList/_stories/DefinitionList.rtl.test.story.tsx +63 -0
- package/src/Drawer/_stories/Drawer.rtl.test.story.tsx +58 -0
- package/src/ExpressiveMoneyInput/_stories/ExpressiveMoneyInput.rtl.test.story.tsx +118 -0
- package/src/Field/_stories/Field.rtl.test.story.tsx +58 -0
- package/src/FlowNavigation/_stories/FlowNavigation.rtl.test.story.tsx +70 -0
- package/src/Header/_stories/Header.rtl.test.story.tsx +37 -0
- package/src/Info/_stories/Info.rtl.test.story.tsx +64 -0
- package/src/Inputs/SelectInput/_stories/SelectInput.rtl.test.story.tsx +135 -0
- package/src/Inputs/_stories/InputGroup.rtl.test.story.tsx +69 -0
- package/src/Inputs/_stories/SearchInput.rtl.test.story.tsx +32 -0
- package/src/Inputs/_stories/TextArea.rtl.test.story.tsx +38 -0
- package/src/InstructionsList/_stories/InstructionsList.rtl.test.story.tsx +30 -0
- package/src/Label/_stories/Label.rtl.test.story.tsx +36 -0
- package/src/Link/_stories/Link.rtl.test.story.tsx +26 -0
- package/src/ListItem/_stories/{variants/ListItem.rtl.test.story.tsx → ListItem.rtl.test.story.tsx} +6 -10
- package/src/ListItem/_stories/variants/helpers.tsx +2 -6
- package/src/Logo/_stories/Logo.rtl.test.story.tsx +56 -0
- package/src/Modal/_stories/Modal.rtl.test.story.tsx +59 -0
- package/src/MoneyInput/_stories/MoneyInput.rtl.test.story.tsx +88 -0
- package/src/Nudge/_stories/Nudge.rtl.test.story.tsx +37 -0
- package/src/PhoneNumberInput/_stories/PhoneNumberInput.rtl.test.story.tsx +44 -0
- package/src/Popover/_stories/Popover.rtl.test.story.tsx +96 -0
- package/src/Progress/_stories/Progress.rtl.test.story.tsx +27 -0
- package/src/ProgressBar/_stories/ProgressBar.rtl.test.story.tsx +33 -0
- package/src/PromoCard/_stories/PromoCard.rtl.test.story.tsx +42 -0
- package/src/PromoCard/_stories/PromoCardGroup.rtl.test.story.tsx +51 -0
- package/src/Prompt/ActionPrompt/_stories/ActionPrompt.rtl.test.story.tsx +53 -0
- package/src/Prompt/CriticalBanner/_stories/CriticalBanner.rtl.test.story.tsx +46 -0
- package/src/Prompt/CriticalBanner/_stories/CriticalBanner.test.story.tsx +0 -30
- package/src/Prompt/InfoPrompt/_stories/InfoPrompt.rtl.test.story.tsx +36 -0
- package/src/Prompt/InlinePrompt/_stories/InlinePrompt.rtl.test.story.tsx +38 -0
- package/src/Radio/_stories/Radio.rtl.test.story.tsx +61 -0
- package/src/RadioGroup/_stories/RadioGroup.rtl.test.story.tsx +66 -0
- package/src/Section/_stories/Section.rtl.test.story.tsx +29 -0
- package/src/SegmentedControl/_stories/SegmentedControl.rtl.test.story.tsx +45 -0
- package/src/SlidingPanel/_stories/SlidingPanel.rtl.test.story.tsx +70 -0
- package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +45 -0
- package/src/Snackbar/_stories/Snackbar.test.story.tsx +0 -31
- package/src/Stepper/_stories/Stepper.rtl.test.story.tsx +24 -0
- package/src/Switch/_stories/Switch.rtl.test.story.tsx +32 -0
- package/src/Switch/_stories/Switch.test.story.tsx +0 -26
- package/src/Table/_stories/Table.rtl.test.story.tsx +104 -0
- package/src/Tabs/_stories/Tabs.rtl.test.story.tsx +72 -0
- package/src/TextareaWithDisplayFormat/_stories/TextareaWithDisplayFormat.rtl.test.story.tsx +48 -0
- package/src/Tooltip/_stories/Tooltip.rtl.test.story.tsx +79 -0
- package/src/Typeahead/_stories/Typeahead.rtl.test.story.tsx +90 -0
- package/src/Upload/_stories/Upload.rtl.test.story.tsx +53 -0
- package/src/UploadInput/_stories/UploadInput.rtl.test.story.tsx +59 -0
- package/src/_deprecated/Alert/_stories/Alert.rtl.test.story.tsx +37 -0
- package/src/_deprecated/Card/_stories/Card.rtl.test.story.tsx +38 -0
- package/src/_deprecated/CriticalBanner/_stories/CriticalCommsBanner.rtl.test.story.tsx +28 -0
- package/src/_deprecated/InlineAlert/_stories/InlineAlert.rtl.test.story.tsx +26 -0
- package/src/_deprecated/OverlayHeader/_stories/OverlayHeader.rtl.test.story.tsx +42 -0
- package/src/_deprecated/Select/_stories/Select.rtl.test.story.tsx +71 -0
- package/src/common/BottomSheet/_stories/BottomSheet.rtl.test.story.tsx +39 -0
- package/src/i18n/id.json +0 -5
package/build/i18n/id.json
CHANGED
|
@@ -12,10 +12,6 @@
|
|
|
12
12
|
"neptune.DateLookup.goTo20YearView": "Lihat tampilan 20 tahun",
|
|
13
13
|
"neptune.DateLookup.month": "bulan",
|
|
14
14
|
"neptune.DateLookup.next": "berikutnya",
|
|
15
|
-
"neptune.DateLookup.notAvailable": "tidak tersedia",
|
|
16
|
-
"neptune.DateLookup.outOfRangeAfter": "Silakan masukkan {min} atau tanggal yang lebih nanti.",
|
|
17
|
-
"neptune.DateLookup.outOfRangeBefore": "Silakan masukkan {max} atau tanggal yang lebih awal.",
|
|
18
|
-
"neptune.DateLookup.outOfRangeBetween": "Silakan pilih tanggal antara {min} dan {max}.",
|
|
19
15
|
"neptune.DateLookup.previous": "sebelumnya",
|
|
20
16
|
"neptune.DateLookup.selected": "terpilih",
|
|
21
17
|
"neptune.DateLookup.twentyYears": "20 tahun",
|
|
@@ -50,7 +46,6 @@
|
|
|
50
46
|
"neptune.Table.loaded": "Data tabel telah dimuat",
|
|
51
47
|
"neptune.Table.loading": "Data tabel sedang dimuat",
|
|
52
48
|
"neptune.Table.refreshPage": "Muat ulang halaman",
|
|
53
|
-
"neptune.Typeahead.suggestionsLabel": "Saran",
|
|
54
49
|
"neptune.Upload.csButtonText": "Unggah file lainnya?",
|
|
55
50
|
"neptune.Upload.csFailureText": "Unggahan gagal. Silakan coba lagi",
|
|
56
51
|
"neptune.Upload.csSuccessText": "Pengunggahan selesai!",
|
package/build/i18n/id.json.js
CHANGED
|
@@ -16,10 +16,6 @@ var id = {
|
|
|
16
16
|
"neptune.DateLookup.goTo20YearView": "Lihat tampilan 20 tahun",
|
|
17
17
|
"neptune.DateLookup.month": "bulan",
|
|
18
18
|
"neptune.DateLookup.next": "berikutnya",
|
|
19
|
-
"neptune.DateLookup.notAvailable": "tidak tersedia",
|
|
20
|
-
"neptune.DateLookup.outOfRangeAfter": "Silakan masukkan {min} atau tanggal yang lebih nanti.",
|
|
21
|
-
"neptune.DateLookup.outOfRangeBefore": "Silakan masukkan {max} atau tanggal yang lebih awal.",
|
|
22
|
-
"neptune.DateLookup.outOfRangeBetween": "Silakan pilih tanggal antara {min} dan {max}.",
|
|
23
19
|
"neptune.DateLookup.previous": "sebelumnya",
|
|
24
20
|
"neptune.DateLookup.selected": "terpilih",
|
|
25
21
|
"neptune.DateLookup.twentyYears": "20 tahun",
|
|
@@ -54,7 +50,6 @@ var id = {
|
|
|
54
50
|
"neptune.Table.loaded": "Data tabel telah dimuat",
|
|
55
51
|
"neptune.Table.loading": "Data tabel sedang dimuat",
|
|
56
52
|
"neptune.Table.refreshPage": "Muat ulang halaman",
|
|
57
|
-
"neptune.Typeahead.suggestionsLabel": "Saran",
|
|
58
53
|
"neptune.Upload.csButtonText": "Unggah file lainnya?",
|
|
59
54
|
"neptune.Upload.csFailureText": "Unggahan gagal. Silakan coba lagi",
|
|
60
55
|
"neptune.Upload.csSuccessText": "Pengunggahan selesai!",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"id.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/i18n/id.json.mjs
CHANGED
|
@@ -12,10 +12,6 @@ var id = {
|
|
|
12
12
|
"neptune.DateLookup.goTo20YearView": "Lihat tampilan 20 tahun",
|
|
13
13
|
"neptune.DateLookup.month": "bulan",
|
|
14
14
|
"neptune.DateLookup.next": "berikutnya",
|
|
15
|
-
"neptune.DateLookup.notAvailable": "tidak tersedia",
|
|
16
|
-
"neptune.DateLookup.outOfRangeAfter": "Silakan masukkan {min} atau tanggal yang lebih nanti.",
|
|
17
|
-
"neptune.DateLookup.outOfRangeBefore": "Silakan masukkan {max} atau tanggal yang lebih awal.",
|
|
18
|
-
"neptune.DateLookup.outOfRangeBetween": "Silakan pilih tanggal antara {min} dan {max}.",
|
|
19
15
|
"neptune.DateLookup.previous": "sebelumnya",
|
|
20
16
|
"neptune.DateLookup.selected": "terpilih",
|
|
21
17
|
"neptune.DateLookup.twentyYears": "20 tahun",
|
|
@@ -50,7 +46,6 @@ var id = {
|
|
|
50
46
|
"neptune.Table.loaded": "Data tabel telah dimuat",
|
|
51
47
|
"neptune.Table.loading": "Data tabel sedang dimuat",
|
|
52
48
|
"neptune.Table.refreshPage": "Muat ulang halaman",
|
|
53
|
-
"neptune.Typeahead.suggestionsLabel": "Saran",
|
|
54
49
|
"neptune.Upload.csButtonText": "Unggah file lainnya?",
|
|
55
50
|
"neptune.Upload.csFailureText": "Unggahan gagal. Silakan coba lagi",
|
|
56
51
|
"neptune.Upload.csSuccessText": "Pengunggahan selesai!",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"id.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -11,7 +11,7 @@ export type BodyProps = HTMLAttributes<HTMLSpanElement | HTMLParagraphElement> &
|
|
|
11
11
|
*/
|
|
12
12
|
preserveNewlines?: boolean;
|
|
13
13
|
};
|
|
14
|
-
declare const Body: import("react").ForwardRefExoticComponent<HTMLAttributes<
|
|
14
|
+
declare const Body: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement | HTMLParagraphElement> & {
|
|
15
15
|
/** @default 'body-default' */
|
|
16
16
|
type?: BodyTypes;
|
|
17
17
|
/** @default 'div' */
|
|
@@ -21,6 +21,6 @@ declare const Body: import("react").ForwardRefExoticComponent<HTMLAttributes<HTM
|
|
|
21
21
|
* @default false
|
|
22
22
|
*/
|
|
23
23
|
preserveNewlines?: boolean;
|
|
24
|
-
} & import("react").RefAttributes<HTMLDivElement |
|
|
24
|
+
} & import("react").RefAttributes<HTMLDivElement | HTMLSpanElement | HTMLParagraphElement | null>>;
|
|
25
25
|
export default Body;
|
|
26
26
|
//# sourceMappingURL=Body.d.ts.map
|
|
@@ -16,6 +16,6 @@ declare const IconButton: import("react").ForwardRefExoticComponent<{
|
|
|
16
16
|
/** @default 'default' */
|
|
17
17
|
type?: "default" | "negative";
|
|
18
18
|
'data-testid'?: string;
|
|
19
|
-
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "target" | "href"> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "onClick"> & Pick<HTMLAttributes<HTMLDivElement>, "
|
|
19
|
+
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "target" | "href"> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "onClick"> & Pick<HTMLAttributes<HTMLDivElement>, "children" | "className" | "id" | "tabIndex" | "role" | "aria-label"> & import("react").RefAttributes<unknown>>;
|
|
20
20
|
export default IconButton;
|
|
21
21
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/ListItem/_stories/variants/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAML,uBAAuB,IAAI,WAAW,EACvC,MAAM,kBAAkB,CAAC;AAG1B,KAAK,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,cAAc,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAOhG,KAAK,iBAAiB,GAAG;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,YAAY,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAEhD,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/ListItem/_stories/variants/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAML,uBAAuB,IAAI,WAAW,EACvC,MAAM,kBAAkB,CAAC;AAG1B,KAAK,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,cAAc,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAOhG,KAAK,iBAAiB,GAAG;IACvB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,YAAY,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAEhD,eAAO,MAAM,YAAY,EAAE,YA6H1B,CAAC"}
|
|
@@ -55,7 +55,6 @@ declare const _default: import("react").FC<{
|
|
|
55
55
|
selectProps?: Partial<SelectInputProps<CurrencyOptionItem>> | undefined;
|
|
56
56
|
amount: number | null;
|
|
57
57
|
searchPlaceholder?: string | undefined;
|
|
58
|
-
decimals?: number | undefined;
|
|
59
58
|
currencies: readonly CurrencyItem[];
|
|
60
59
|
selectedCurrency: CurrencyOptionItem;
|
|
61
60
|
onCurrencyChange?: ((value: CurrencyOptionItem) => void) | undefined;
|
|
@@ -67,6 +66,7 @@ declare const _default: import("react").FC<{
|
|
|
67
66
|
}) => void) | undefined;
|
|
68
67
|
customActionLabel?: import("react").ReactNode;
|
|
69
68
|
onCustomAction?: (() => void) | undefined;
|
|
69
|
+
decimals?: number | undefined;
|
|
70
70
|
}>;
|
|
71
71
|
export default _default;
|
|
72
72
|
//# sourceMappingURL=MoneyInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/MoneyInput/MoneyInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAGL,SAAS,EACT,UAAU,EACV,SAAS,EAEV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAuB,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnF,OAAO,EAKL,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAO/B,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAoDnE,MAAM,WAAW,eAAgB,SAAQ,qBAAqB;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,SAAS,YAAY,EAAE,CAAC;IACpC,gBAAgB,EAAE,kBAAkB,CAAC;IACrC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAC1C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,YAAY,EAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3F,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC5D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,kCAAkC,GAAG,eAAe,GAC9D,OAAO,CAAC,wBAAwB,CAAC,CAAC;;SA5B7B,MAAM;wBACS,MAAM;YAMnB,SAAS,GAAG,UAAU,GAAG,SAAS;kBAF3B,MAAM;iBAYP,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;kBACrB,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;YAZnD,MAAM,GAAG,IAAI;wBAID,MAAM;
|
|
1
|
+
{"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/MoneyInput/MoneyInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAGL,SAAS,EACT,UAAU,EACV,SAAS,EAEV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAuB,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnF,OAAO,EAKL,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAO/B,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAoDnE,MAAM,WAAW,eAAgB,SAAQ,qBAAqB;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,SAAS,YAAY,EAAE,CAAC;IACpC,gBAAgB,EAAE,kBAAkB,CAAC;IACrC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAC1C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,YAAY,EAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3F,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC5D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,kCAAkC,GAAG,eAAe,GAC9D,OAAO,CAAC,wBAAwB,CAAC,CAAC;;SA5B7B,MAAM;wBACS,MAAM;YAMnB,SAAS,GAAG,UAAU,GAAG,SAAS;kBAF3B,MAAM;iBAYP,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;kBACrB,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;YAZnD,MAAM,GAAG,IAAI;wBAID,MAAM;gBARd,SAAS,YAAY,EAAE;sBACjB,kBAAkB;wBACjB,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI;sBAIrC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI;;sBAM9B,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,YAAY,EAAE,CAAA;KAAE,KAAK,IAAI;;sBAEzE,MAAM,IAAI;eAQhB,MAAM;;AAyanB,wBAA2F"}
|
|
@@ -10,7 +10,7 @@ export type TitleProps = LabelHTMLAttributes<HTMLHeadingElement | HTMLSpanElemen
|
|
|
10
10
|
*/
|
|
11
11
|
type?: TitleTypes;
|
|
12
12
|
};
|
|
13
|
-
declare const Title: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<
|
|
13
|
+
declare const Title: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLSpanElement | HTMLHeadingElement | HTMLLabelElement> & React.LiHTMLAttributes<HTMLLIElement> & {
|
|
14
14
|
/**
|
|
15
15
|
* Default value will based one `type` prop
|
|
16
16
|
*/
|
|
@@ -19,6 +19,6 @@ declare const Title: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<H
|
|
|
19
19
|
* Default value: {@link DEFAULT_TYPE}
|
|
20
20
|
*/
|
|
21
21
|
type?: TitleTypes;
|
|
22
|
-
} & React.RefAttributes<HTMLHeadingElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement
|
|
22
|
+
} & React.RefAttributes<HTMLSpanElement | HTMLHeadingElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement>>;
|
|
23
23
|
export default Title;
|
|
24
24
|
//# sourceMappingURL=Title.d.ts.map
|
|
@@ -15,7 +15,7 @@ export default class UploadImageStep extends PureComponent<UploadImageStepProps>
|
|
|
15
15
|
uploadInputRef: import("react").RefObject<HTMLInputElement>;
|
|
16
16
|
onManualUpload: () => void;
|
|
17
17
|
onKeyDown: (event: React.KeyboardEvent<HTMLLabelElement>) => void;
|
|
18
|
-
getImage: () => number | true |
|
|
18
|
+
getImage: () => number | true | import("react").JSX.Element | Iterable<import("react").ReactNode>;
|
|
19
19
|
render(): import("react").JSX.Element;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=UploadImageStep.d.ts.map
|
|
@@ -5,5 +5,5 @@ export declare const UploadItemLink: import("react").ForwardRefExoticComponent<{
|
|
|
5
5
|
singleFileUpload: boolean;
|
|
6
6
|
} & {
|
|
7
7
|
children?: import("react").ReactNode | undefined;
|
|
8
|
-
} & import("react").RefAttributes<
|
|
8
|
+
} & import("react").RefAttributes<HTMLDivElement | HTMLAnchorElement>>;
|
|
9
9
|
//# sourceMappingURL=UploadItemLink.d.ts.map
|
package/package.json
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { userEvent, within } from 'storybook/test';
|
|
3
|
+
import { FastFlag as FastFlagIcon } from '@transferwise/icons';
|
|
4
|
+
|
|
5
|
+
import { forEachColumn, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
6
|
+
import Accordion from '../Accordion';
|
|
7
|
+
|
|
8
|
+
const items = [
|
|
9
|
+
{
|
|
10
|
+
title: 'Item with icon',
|
|
11
|
+
subtitle: 'Subtitle text',
|
|
12
|
+
content: 'Content for item with icon.',
|
|
13
|
+
id: 'icon',
|
|
14
|
+
icon: <FastFlagIcon size={24} />,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: 'Plain item without icon',
|
|
18
|
+
content: 'Content for item without icon.',
|
|
19
|
+
id: 'no-icon',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: 'Media with circle',
|
|
23
|
+
subtitle: 'Shows media in a circle',
|
|
24
|
+
content: 'Expanded content with media circle.',
|
|
25
|
+
id: 'media-circle',
|
|
26
|
+
media: (
|
|
27
|
+
<img
|
|
28
|
+
src="https://wise.com/public-resources/assets/spend/card/asset//digital_card_2023.png"
|
|
29
|
+
alt=""
|
|
30
|
+
/>
|
|
31
|
+
),
|
|
32
|
+
showMediaCircle: true,
|
|
33
|
+
showMediaAtAllSizes: true,
|
|
34
|
+
isContainerAligned: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: 'Media without circle',
|
|
38
|
+
subtitle: 'Not container aligned',
|
|
39
|
+
content: 'Expanded content with plain media.',
|
|
40
|
+
id: 'media-no-circle',
|
|
41
|
+
media: (
|
|
42
|
+
<img
|
|
43
|
+
src="https://wise.com/public-resources/assets/spend/card/asset//digital_card_2023.png"
|
|
44
|
+
alt=""
|
|
45
|
+
/>
|
|
46
|
+
),
|
|
47
|
+
showMediaCircle: false,
|
|
48
|
+
showMediaAtAllSizes: false,
|
|
49
|
+
isContainerAligned: false,
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
component: Accordion,
|
|
55
|
+
title: 'Content/Accordion/Tests',
|
|
56
|
+
tags: ['!autodocs', '!manifest'],
|
|
57
|
+
} satisfies Meta<typeof Accordion>;
|
|
58
|
+
|
|
59
|
+
type Story = StoryObj<typeof Accordion>;
|
|
60
|
+
|
|
61
|
+
export const RTLDiff: Story = {
|
|
62
|
+
render: () => <Accordion items={items} indexOpen={0} />,
|
|
63
|
+
play: async ({ canvasElement }) => {
|
|
64
|
+
await forEachColumn(canvasElement, async (column) => {
|
|
65
|
+
const scope = within(column);
|
|
66
|
+
const buttons = scope.getAllByRole('button');
|
|
67
|
+
await userEvent.click(buttons[1]);
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
...withRTLDiff(),
|
|
71
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { Freeze } from '@transferwise/icons';
|
|
3
|
+
import { Flag } from '@wise/art';
|
|
4
|
+
|
|
5
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
6
|
+
import AvatarLayout from '..';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
component: AvatarLayout,
|
|
10
|
+
title: 'Content/AvatarLayout/Tests',
|
|
11
|
+
tags: ['!autodocs', '!manifest'],
|
|
12
|
+
} satisfies Meta<typeof AvatarLayout>;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof AvatarLayout>;
|
|
15
|
+
|
|
16
|
+
export const RTLDiff: Story = {
|
|
17
|
+
render: () => (
|
|
18
|
+
<>
|
|
19
|
+
<AvatarLayout
|
|
20
|
+
orientation="horizontal"
|
|
21
|
+
size={48}
|
|
22
|
+
avatars={[{ asset: <Flag code="br" /> }, { asset: <Flag code="jp" /> }]}
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<AvatarLayout
|
|
26
|
+
orientation="horizontal"
|
|
27
|
+
size={48}
|
|
28
|
+
interactive
|
|
29
|
+
avatars={[{ asset: <Freeze /> }, { asset: <Freeze /> }]}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<AvatarLayout
|
|
33
|
+
orientation="horizontal"
|
|
34
|
+
size={48}
|
|
35
|
+
avatars={[{ profileName: 'Jay Jay' }, { profileName: 'Amy Amy' }]}
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<AvatarLayout
|
|
39
|
+
orientation="horizontal"
|
|
40
|
+
size={48}
|
|
41
|
+
interactive
|
|
42
|
+
avatars={[{ asset: <Flag code="gb" /> }, { asset: <Flag code="br" /> }, { asset: '3+' }]}
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<AvatarLayout
|
|
46
|
+
orientation="horizontal"
|
|
47
|
+
size={32}
|
|
48
|
+
avatars={[{ asset: <Flag code="eu" /> }, { asset: <Flag code="gb" /> }]}
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
<AvatarLayout
|
|
52
|
+
orientation="horizontal"
|
|
53
|
+
size={72}
|
|
54
|
+
avatars={[{ asset: <Freeze /> }, { asset: <Freeze /> }, { asset: <Freeze /> }]}
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
<AvatarLayout
|
|
58
|
+
orientation="diagonal"
|
|
59
|
+
size={48}
|
|
60
|
+
avatars={[{ asset: <Flag code="br" /> }, { asset: <Flag code="jp" /> }]}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
<AvatarLayout
|
|
64
|
+
orientation="diagonal"
|
|
65
|
+
size={48}
|
|
66
|
+
avatars={[{ profileName: 'Jay Jay' }, { profileName: 'Amy Amy' }]}
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
<AvatarLayout
|
|
70
|
+
orientation="diagonal"
|
|
71
|
+
size={72}
|
|
72
|
+
avatars={[{ asset: <Freeze /> }, { asset: <Freeze /> }]}
|
|
73
|
+
/>
|
|
74
|
+
</>
|
|
75
|
+
),
|
|
76
|
+
...withRTLDiff(),
|
|
77
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { Freeze, FastFlag, Camera, Convert } from '@transferwise/icons';
|
|
3
|
+
|
|
4
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
|
+
import AvatarView from '..';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: AvatarView,
|
|
9
|
+
title: 'Content/AvatarView/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
} satisfies Meta<typeof AvatarView>;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof AvatarView>;
|
|
14
|
+
|
|
15
|
+
const sizes = [24, 32, 40, 48, 56, 72] as const;
|
|
16
|
+
|
|
17
|
+
export const RTLDiff: Story = {
|
|
18
|
+
render: () => (
|
|
19
|
+
<>
|
|
20
|
+
{/* Badge positioning: bottom-right dot (notification/online) — key RTL indicator */}
|
|
21
|
+
<div
|
|
22
|
+
style={{
|
|
23
|
+
display: 'grid',
|
|
24
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
25
|
+
gap: '1rem',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{sizes.map((size) => (
|
|
30
|
+
<AvatarView key={`notif-${size}`} size={size} badge={{ type: 'notification' }}>
|
|
31
|
+
<Freeze />
|
|
32
|
+
</AvatarView>
|
|
33
|
+
))}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
{/* Online dot */}
|
|
37
|
+
<div
|
|
38
|
+
style={{
|
|
39
|
+
display: 'grid',
|
|
40
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
41
|
+
gap: '1rem',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{sizes.map((size) => (
|
|
46
|
+
<AvatarView key={`online-${size}`} size={size} badge={{ type: 'online' }}>
|
|
47
|
+
<Freeze />
|
|
48
|
+
</AvatarView>
|
|
49
|
+
))}
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
{/* Badge with flag (bottom-right corner badge) */}
|
|
53
|
+
<div
|
|
54
|
+
style={{
|
|
55
|
+
display: 'grid',
|
|
56
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
57
|
+
gap: '1rem',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
{sizes.map((size) => (
|
|
62
|
+
<AvatarView key={`flag-${size}`} size={size} badge={{ flagCode: 'GBP' }}>
|
|
63
|
+
<Freeze />
|
|
64
|
+
</AvatarView>
|
|
65
|
+
))}
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
{/* Badge with icon */}
|
|
69
|
+
<div
|
|
70
|
+
style={{
|
|
71
|
+
display: 'grid',
|
|
72
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
73
|
+
gap: '1rem',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
77
|
+
{sizes.map((size) => (
|
|
78
|
+
<AvatarView key={`icon-badge-${size}`} size={size} badge={{ icon: <FastFlag /> }}>
|
|
79
|
+
<Freeze />
|
|
80
|
+
</AvatarView>
|
|
81
|
+
))}
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
{/* Badge type action with icon (camera) */}
|
|
85
|
+
<div
|
|
86
|
+
style={{
|
|
87
|
+
display: 'grid',
|
|
88
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
89
|
+
gap: '1rem',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
{sizes.map((size) => (
|
|
94
|
+
<AvatarView
|
|
95
|
+
key={`action-${size}`}
|
|
96
|
+
size={size}
|
|
97
|
+
imgSrc="../avatar-square-dude.webp"
|
|
98
|
+
badge={{ type: 'action', icon: <Camera /> }}
|
|
99
|
+
/>
|
|
100
|
+
))}
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
{/* Badge type reference with icon */}
|
|
104
|
+
<div
|
|
105
|
+
style={{
|
|
106
|
+
display: 'grid',
|
|
107
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
108
|
+
gap: '1rem',
|
|
109
|
+
alignItems: 'center',
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
{sizes.map((size) => (
|
|
113
|
+
<AvatarView
|
|
114
|
+
key={`ref-${size}`}
|
|
115
|
+
size={size}
|
|
116
|
+
imgSrc="../avatar-square-dude.webp"
|
|
117
|
+
badge={{ type: 'reference', icon: <Convert /> }}
|
|
118
|
+
/>
|
|
119
|
+
))}
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
{/* Selected state (border highlight) */}
|
|
123
|
+
<div
|
|
124
|
+
style={{
|
|
125
|
+
display: 'grid',
|
|
126
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
127
|
+
gap: '1rem',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
{sizes.map((size) => (
|
|
132
|
+
<AvatarView key={`selected-${size}`} size={size} selected interactive>
|
|
133
|
+
<Freeze />
|
|
134
|
+
</AvatarView>
|
|
135
|
+
))}
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
{/* Selected + badge combined */}
|
|
139
|
+
<div
|
|
140
|
+
style={{
|
|
141
|
+
display: 'grid',
|
|
142
|
+
gridTemplateColumns: `repeat(${sizes.length}, min-content)`,
|
|
143
|
+
gap: '1rem',
|
|
144
|
+
alignItems: 'center',
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
{sizes.map((size) => (
|
|
148
|
+
<AvatarView
|
|
149
|
+
key={`selected-badge-${size}`}
|
|
150
|
+
size={size}
|
|
151
|
+
selected
|
|
152
|
+
interactive
|
|
153
|
+
badge={{ flagCode: 'USD' }}
|
|
154
|
+
>
|
|
155
|
+
<Freeze />
|
|
156
|
+
</AvatarView>
|
|
157
|
+
))}
|
|
158
|
+
</div>
|
|
159
|
+
</>
|
|
160
|
+
),
|
|
161
|
+
...withRTLDiff(),
|
|
162
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
|
+
import LegacyButton from '../LegacyButton';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: LegacyButton,
|
|
7
|
+
title: 'Actions/Button/Legacy Button/Tests',
|
|
8
|
+
tags: ['!autodocs', '!manifest'],
|
|
9
|
+
} satisfies Meta<typeof LegacyButton>;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof LegacyButton>;
|
|
12
|
+
|
|
13
|
+
export const RTLDiff: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<>
|
|
16
|
+
{/* default (inline) layout */}
|
|
17
|
+
<LegacyButton>Default button</LegacyButton>
|
|
18
|
+
|
|
19
|
+
{/* block layout — full width */}
|
|
20
|
+
<LegacyButton block>Block button</LegacyButton>
|
|
21
|
+
|
|
22
|
+
{/* loading state — appends ProcessIndicator inside button */}
|
|
23
|
+
<LegacyButton loading>Loading button</LegacyButton>
|
|
24
|
+
|
|
25
|
+
{/* loading + block combined */}
|
|
26
|
+
<LegacyButton loading block>
|
|
27
|
+
Loading block button
|
|
28
|
+
</LegacyButton>
|
|
29
|
+
</>
|
|
30
|
+
),
|
|
31
|
+
...withRTLDiff(),
|
|
32
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { ArrowRight, Freeze } from '@transferwise/icons';
|
|
3
|
+
import { Flag } from '@wise/art';
|
|
4
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
|
+
import Button from '../Button';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: Button,
|
|
9
|
+
title: 'Actions/Button/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
} satisfies Meta<typeof Button>;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Button>;
|
|
14
|
+
|
|
15
|
+
export const RTLDiff: Story = {
|
|
16
|
+
render: () => (
|
|
17
|
+
<>
|
|
18
|
+
{/* md size: addonStart icon only */}
|
|
19
|
+
<Button v2 size="md" addonStart={{ type: 'icon', value: <Freeze /> }}>
|
|
20
|
+
Start icon
|
|
21
|
+
</Button>
|
|
22
|
+
|
|
23
|
+
{/* md size: addonEnd icon only */}
|
|
24
|
+
<Button v2 size="md" addonEnd={{ type: 'icon', value: <ArrowRight /> }}>
|
|
25
|
+
End icon
|
|
26
|
+
</Button>
|
|
27
|
+
|
|
28
|
+
{/* md size: both addonStart and addonEnd */}
|
|
29
|
+
<Button
|
|
30
|
+
v2
|
|
31
|
+
size="md"
|
|
32
|
+
addonStart={{ type: 'icon', value: <Freeze /> }}
|
|
33
|
+
addonEnd={{ type: 'icon', value: <ArrowRight /> }}
|
|
34
|
+
>
|
|
35
|
+
Both icons
|
|
36
|
+
</Button>
|
|
37
|
+
|
|
38
|
+
{/* md size: addonStart avatar */}
|
|
39
|
+
<Button v2 size="md" addonStart={{ type: 'avatar', value: [{ asset: <Flag code="pl" /> }] }}>
|
|
40
|
+
Avatar start
|
|
41
|
+
</Button>
|
|
42
|
+
|
|
43
|
+
{/* md size: addonStart double avatar */}
|
|
44
|
+
<Button
|
|
45
|
+
v2
|
|
46
|
+
size="md"
|
|
47
|
+
addonStart={{
|
|
48
|
+
type: 'avatar',
|
|
49
|
+
value: [{ asset: <Flag code="gb" /> }, { asset: <Flag code="br" /> }],
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
Double avatar
|
|
53
|
+
</Button>
|
|
54
|
+
|
|
55
|
+
{/* sm size: addonStart icon */}
|
|
56
|
+
<Button v2 size="sm" addonStart={{ type: 'icon', value: <Freeze /> }}>
|
|
57
|
+
Sm start icon
|
|
58
|
+
</Button>
|
|
59
|
+
|
|
60
|
+
{/* sm size: addonEnd icon */}
|
|
61
|
+
<Button v2 size="sm" addonEnd={{ type: 'icon', value: <ArrowRight /> }}>
|
|
62
|
+
Sm end icon
|
|
63
|
+
</Button>
|
|
64
|
+
|
|
65
|
+
{/* sm size: both addonStart and addonEnd */}
|
|
66
|
+
<Button
|
|
67
|
+
v2
|
|
68
|
+
size="sm"
|
|
69
|
+
addonStart={{ type: 'icon', value: <Freeze /> }}
|
|
70
|
+
addonEnd={{ type: 'icon', value: <ArrowRight /> }}
|
|
71
|
+
>
|
|
72
|
+
Sm both icons
|
|
73
|
+
</Button>
|
|
74
|
+
|
|
75
|
+
{/* loading state with spinner — changes internal layout */}
|
|
76
|
+
<Button v2 size="md" loading addonEnd={{ type: 'icon', value: <ArrowRight /> }}>
|
|
77
|
+
Loading
|
|
78
|
+
</Button>
|
|
79
|
+
|
|
80
|
+
{/* block layout */}
|
|
81
|
+
<Button v2 size="md" block addonStart={{ type: 'icon', value: <Freeze /> }}>
|
|
82
|
+
Block with start icon
|
|
83
|
+
</Button>
|
|
84
|
+
</>
|
|
85
|
+
),
|
|
86
|
+
...withRTLDiff(),
|
|
87
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { userEvent, within } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { forEachColumn, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
|
+
import Calendar from '../Calendar';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: Calendar,
|
|
9
|
+
title: 'Forms/Calendar/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
} satisfies Meta<typeof Calendar>;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Calendar>;
|
|
14
|
+
|
|
15
|
+
const selectedDate = new Date(2024, 5, 15);
|
|
16
|
+
const minDate = new Date(2024, 2, 1);
|
|
17
|
+
const maxDate = new Date(2024, 9, 31);
|
|
18
|
+
|
|
19
|
+
const disabledRules = {
|
|
20
|
+
weekdays: ['sat', 'sun'] as ('sat' | 'sun')[],
|
|
21
|
+
dates: [new Date(2024, 5, 10)],
|
|
22
|
+
reason: 'Weekends and specific dates are unavailable.',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const RTLDiff: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<>
|
|
28
|
+
<div data-testid="day-view">
|
|
29
|
+
<Calendar value={selectedDate} min={minDate} max={maxDate} disabledRules={disabledRules} />
|
|
30
|
+
</div>
|
|
31
|
+
<div data-testid="month-view">
|
|
32
|
+
<Calendar value={selectedDate} min={minDate} max={maxDate} />
|
|
33
|
+
</div>
|
|
34
|
+
<div data-testid="year-view">
|
|
35
|
+
<Calendar value={selectedDate} min={minDate} max={maxDate} />
|
|
36
|
+
</div>
|
|
37
|
+
</>
|
|
38
|
+
),
|
|
39
|
+
play: async ({ canvasElement }) => {
|
|
40
|
+
await forEachColumn(canvasElement, async (column) => {
|
|
41
|
+
const monthContainer = column.querySelector('[data-testid="month-view"]')!;
|
|
42
|
+
const monthScope = within(monthContainer as HTMLElement);
|
|
43
|
+
await userEvent.click(monthScope.getByRole('button', { name: /year view/iu }));
|
|
44
|
+
await userEvent.click(monthScope.getByRole('button', { name: /2024.*selected year/iu }));
|
|
45
|
+
|
|
46
|
+
const yearContainer = column.querySelector('[data-testid="year-view"]')!;
|
|
47
|
+
const yearScope = within(yearContainer as HTMLElement);
|
|
48
|
+
await userEvent.click(yearScope.getByRole('button', { name: /year view/iu }));
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
...withRTLDiff(),
|
|
52
|
+
};
|