@transferwise/components 0.0.0-experimental-db6cf60 → 0.0.0-experimental-4678400
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/Body/Body.js +1 -1
- package/build/Body/Body.js.map +1 -1
- package/build/Body/Body.mjs +1 -1
- package/build/Body/Body.mjs.map +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.js +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.js.map +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs.map +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js.map +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs.map +1 -1
- package/build/Calendar/TableLink/TableLink.js +1 -1
- package/build/Calendar/TableLink/TableLink.js.map +1 -1
- package/build/Calendar/TableLink/TableLink.mjs +1 -1
- package/build/Calendar/TableLink/TableLink.mjs.map +1 -1
- package/build/ExpressiveMoneyInput/AmountInput/AmountInput.js +1 -1
- package/build/ExpressiveMoneyInput/AmountInput/AmountInput.js.map +1 -1
- package/build/ExpressiveMoneyInput/AmountInput/AmountInput.mjs +1 -1
- package/build/ExpressiveMoneyInput/AmountInput/AmountInput.mjs.map +1 -1
- package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js +1 -1
- package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js.map +1 -1
- package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs +1 -1
- package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs.map +1 -1
- package/build/Header/Header.js +8 -57
- package/build/Header/Header.js.map +1 -1
- package/build/Header/Header.mjs +9 -58
- package/build/Header/Header.mjs.map +1 -1
- package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js +2 -2
- package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +1 -1
- package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs +2 -2
- package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +1 -1
- package/build/Inputs/SelectInput/Option/SelectInputOption.js +1 -1
- package/build/Inputs/SelectInput/Option/SelectInputOption.js.map +1 -1
- package/build/Inputs/SelectInput/Option/SelectInputOption.mjs +1 -1
- package/build/Inputs/SelectInput/Option/SelectInputOption.mjs.map +1 -1
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js +3 -3
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +1 -1
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +3 -3
- package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +1 -1
- package/build/Inputs/SelectInput/Popover/SelectInputPopover.js +2 -2
- package/build/Inputs/SelectInput/Popover/SelectInputPopover.js.map +1 -1
- package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs +2 -2
- package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs.map +1 -1
- package/build/Label/Label.js +1 -1
- package/build/Label/Label.js.map +1 -1
- package/build/Label/Label.mjs +1 -1
- package/build/Label/Label.mjs.map +1 -1
- package/build/Stepper/Stepper.js +1 -1
- package/build/Stepper/Stepper.js.map +1 -1
- package/build/Stepper/Stepper.mjs +1 -1
- package/build/Stepper/Stepper.mjs.map +1 -1
- package/build/Table/Header/TableHeader.js +1 -1
- package/build/Table/Header/TableHeader.js.map +1 -1
- package/build/Table/Header/TableHeader.mjs +1 -1
- package/build/Table/Header/TableHeader.mjs.map +1 -1
- package/build/Tabs/Tab/Tab.js +1 -1
- package/build/Tabs/Tab/Tab.js.map +1 -1
- package/build/Tabs/Tab/Tab.mjs +1 -1
- package/build/Tabs/Tab/Tab.mjs.map +1 -1
- package/build/Tag/Tag.js +1 -1
- package/build/Tag/Tag.js.map +1 -1
- package/build/Tag/Tag.mjs +1 -1
- package/build/Tag/Tag.mjs.map +1 -1
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.js +2 -2
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.js.map +1 -1
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs +2 -2
- package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs.map +1 -1
- package/build/Upload/Steps/UploadImageStep/UploadImageStep.js +2 -2
- package/build/Upload/Steps/UploadImageStep/UploadImageStep.js.map +1 -1
- package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs +2 -2
- package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs.map +1 -1
- package/build/_deprecated/ActionButton/ActionButton.js +1 -1
- package/build/_deprecated/ActionButton/ActionButton.js.map +1 -1
- package/build/_deprecated/ActionButton/ActionButton.mjs +1 -1
- package/build/_deprecated/ActionButton/ActionButton.mjs.map +1 -1
- package/build/_deprecated/Avatar/Avatar.js +1 -1
- package/build/_deprecated/Avatar/Avatar.js.map +1 -1
- package/build/_deprecated/Avatar/Avatar.mjs +1 -1
- package/build/_deprecated/Avatar/Avatar.mjs.map +1 -1
- package/build/_deprecated/Select/Select.js +2 -2
- package/build/_deprecated/Select/Select.js.map +1 -1
- package/build/_deprecated/Select/Select.mjs +2 -2
- package/build/_deprecated/Select/Select.mjs.map +1 -1
- package/build/common/PropsValues/typography.js +6 -0
- package/build/common/PropsValues/typography.js.map +1 -1
- package/build/common/PropsValues/typography.mjs +6 -0
- package/build/common/PropsValues/typography.mjs.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/index.mjs +0 -1
- package/build/index.mjs.map +1 -1
- package/build/main.css +8673 -2355
- package/build/styles/Accordion/Accordion.css +7 -6
- package/build/styles/Body/Body.css +1 -1
- package/build/styles/Calendar/Calendar.css +11 -4
- package/build/styles/Calendar/TableLink/TableLink.css +11 -4
- package/build/styles/Chips/Chip/Chip.css +5 -3
- package/build/styles/Decision/Decision.css +4 -3
- package/build/styles/Emphasis/Emphasis.css +1 -1
- package/build/styles/ExpressiveMoneyInput/AmountInput/AmountInput.css +2 -1
- package/build/styles/ExpressiveMoneyInput/ExpressiveMoneyInput.css +2 -1
- package/build/styles/Header/Header.css +0 -46
- package/build/styles/Inputs/Input/Input.css +69 -57
- package/build/styles/Inputs/TextArea/TextArea.css +69 -57
- package/build/styles/Label/Label.css +3 -0
- package/build/styles/Markup/Markup.css +2 -2
- package/build/styles/MoneyInput/MoneyInput.css +9 -6
- package/build/styles/Nudge/Nudge.css +3 -3
- package/build/styles/Popover/Popover.css +4 -43
- package/build/styles/ProgressBar/ProgressBar.css +3 -2
- package/build/styles/Prompt/PrimitivePrompt/PrimitivePrompt.css +2 -1
- package/build/styles/Snackbar/Snackbar.css +1 -1
- package/build/styles/Table/Table.css +18 -8
- package/build/styles/Tabs/Tabs.css +3 -3
- package/build/styles/Tag/Tag.css +1 -1
- package/build/styles/Tile/Tile.css +4 -3
- package/build/styles/Typeahead/Typeahead.css +4 -2
- package/build/styles/UploadInput/UploadInput.css +1 -1
- package/build/styles/_deprecated/ActionButton/ActionButton.css +3 -4
- package/build/styles/_deprecated/Avatar/Avatar.css +2 -2
- package/build/styles/_deprecated/CriticalBanner/CriticalCommsBanner.css +2 -1
- package/build/styles/_deprecated/Select/Select.css +49 -14
- package/build/styles/_deprecated/Summary/Summary.css +2 -2
- package/build/styles/common/Circle/Circle.css +1 -1
- package/build/styles/common/Option/Option.css +4 -4
- package/build/styles/css/accordion.css +22 -44
- package/build/styles/css/badge.css +2 -2
- package/build/styles/css/button-groups.css +29 -6
- package/build/styles/css/buttons.css +35 -11
- package/build/styles/css/decision.css +22 -44
- package/build/styles/css/dropdowns.css +39 -54
- package/build/styles/css/droppable.css +28 -6
- package/build/styles/css/footer.css +41 -10
- package/build/styles/css/input-groups.css +205 -162
- package/build/styles/css/list-group.css +1 -42
- package/build/styles/css/modals.css +1 -1
- package/build/styles/css/navbar.css +66 -81
- package/build/styles/css/navs.css +8 -8
- package/build/styles/css/neptune-addons.css +15 -0
- package/build/styles/css/neptune-core.css +5887 -524
- package/build/styles/css/neptune.css +8348 -1945
- package/build/styles/css/panels.css +2 -2
- package/build/styles/css/popovers.css +39 -56
- package/build/styles/css/progress-bars.css +2 -2
- package/build/styles/css/sequences.css +14 -9
- package/build/styles/css/table.css +7 -7
- package/build/styles/css/tooltip.css +28 -6
- package/build/styles/less/legacy-variables.less +3 -3
- package/build/styles/less/neptune-tokens.less +0 -48
- package/build/styles/main.css +8673 -2355
- package/build/styles/props/neptune-tokens.css +805 -3
- package/build/styles/styles/less/accordion.css +22 -44
- package/build/styles/styles/less/badge.css +2 -2
- package/build/styles/styles/less/button-groups.css +29 -6
- package/build/styles/styles/less/buttons.css +35 -11
- package/build/styles/styles/less/decision.css +22 -44
- package/build/styles/styles/less/dropdowns.css +39 -54
- package/build/styles/styles/less/droppable.css +28 -6
- package/build/styles/styles/less/footer.css +41 -10
- package/build/styles/styles/less/forms/bootstrap-forms.css +153 -100
- package/build/styles/styles/less/forms/checkbox-radio.css +3 -3
- package/build/styles/styles/less/input-groups.css +205 -162
- package/build/styles/styles/less/list-group.css +1 -42
- package/build/styles/styles/less/modals.css +1 -1
- package/build/styles/styles/less/navbar.css +66 -81
- package/build/styles/styles/less/navs.css +8 -8
- package/build/styles/styles/less/neptune-addons.css +15 -0
- package/build/styles/styles/less/neptune-core.css +5887 -524
- package/build/styles/styles/less/neptune.css +8348 -1945
- package/build/styles/styles/less/panels.css +2 -2
- package/build/styles/styles/less/popovers.css +39 -56
- package/build/styles/styles/less/progress-bars.css +2 -2
- package/build/styles/styles/less/sequences.css +14 -9
- package/build/styles/styles/less/table.css +7 -7
- package/build/styles/styles/less/tooltip.css +28 -6
- package/build/types/ExpressiveMoneyInput/AmountInput/AmountInput.d.ts.map +1 -1
- package/build/types/Header/Header.d.ts +4 -31
- package/build/types/Header/Header.d.ts.map +1 -1
- package/build/types/Header/index.d.ts +1 -2
- package/build/types/Header/index.d.ts.map +1 -1
- package/build/types/common/PropsValues/typography.d.ts +13 -1
- package/build/types/common/PropsValues/typography.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -3
- package/build/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/Accordion/Accordion.css +7 -6
- package/src/Accordion/Accordion.less +7 -6
- package/src/Body/Body.css +1 -1
- package/src/Body/Body.less +1 -1
- package/src/Body/Body.test.tsx +4 -4
- package/src/Body/Body.tsx +2 -2
- package/src/Calendar/Calendar.css +11 -4
- package/src/Calendar/DayCalendar/Table/DayCalendarTable.tsx +2 -2
- package/src/Calendar/MonthCalendar/Table/MonthCalendarTable.tsx +1 -1
- package/src/Calendar/TableLink/TableLink.css +11 -4
- package/src/Calendar/TableLink/TableLink.less +14 -4
- package/src/Calendar/TableLink/TableLink.tsx +1 -1
- package/src/Chips/Chip/Chip.css +5 -3
- package/src/Chips/Chip/Chip.less +3 -2
- package/src/CircularButton/_stories/CircularButton.story.tsx +6 -16
- package/src/DateInput/_stories/DateInput.rtl.test.story.tsx +46 -0
- package/src/Decision/Decision.css +4 -3
- package/src/Decision/Decision.less +4 -3
- package/src/DefinitionList/_stories/DefinitionList.story.tsx +1 -1
- package/src/Display/_stories/Display.story.tsx +20 -6
- package/src/Emphasis/Emphasis.css +1 -1
- package/src/Emphasis/Emphasis.less +1 -1
- package/src/ExpressiveMoneyInput/AmountInput/AmountInput.css +2 -1
- package/src/ExpressiveMoneyInput/AmountInput/AmountInput.less +2 -1
- package/src/ExpressiveMoneyInput/AmountInput/AmountInput.tsx +1 -4
- package/src/ExpressiveMoneyInput/ExpressiveMoneyInput.css +2 -1
- package/src/FlowNavigation/AnimatedLabel/AnimatedLabel.tsx +1 -1
- package/src/Header/Header.css +0 -46
- package/src/Header/Header.less +1 -63
- package/src/Header/Header.test.tsx +1 -133
- package/src/Header/Header.tsx +11 -107
- package/src/Header/_stories/Header.story.tsx +2 -97
- package/src/Header/_stories/Header.test.story.tsx +0 -32
- package/src/Header/index.ts +1 -2
- package/src/Inputs/Input/Input.css +69 -57
- package/src/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.tsx +2 -2
- package/src/Inputs/SelectInput/Option/SelectInputOption.tsx +1 -1
- package/src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +3 -3
- package/src/Inputs/SelectInput/Popover/SelectInputPopover.tsx +2 -2
- package/src/Inputs/SelectInput/_stories/SelectInput.story.tsx +1 -1
- package/src/Inputs/TextArea/TextArea.css +69 -57
- package/src/Inputs/_common.less +16 -10
- package/src/Label/Label.css +3 -0
- package/src/Label/Label.less +8 -0
- package/src/Label/Label.tsx +1 -1
- package/src/Markup/Markup.css +2 -2
- package/src/Markup/Markup.less +2 -2
- package/src/MoneyInput/MoneyInput.css +9 -6
- package/src/MoneyInput/MoneyInput.less +10 -7
- package/src/Nudge/Nudge.css +3 -3
- package/src/Nudge/Nudge.less +3 -3
- package/src/PocketSurface/_stories/PocketSurface.story.tsx +2 -2
- package/src/Popover/Popover.css +4 -43
- package/src/Popover/Popover.less +2 -2
- package/src/ProgressBar/ProgressBar.css +3 -2
- package/src/ProgressBar/ProgressBar.less +12 -11
- package/src/Prompt/PrimitivePrompt/PrimitivePrompt.css +2 -1
- package/src/Prompt/PrimitivePrompt/PrimitivePrompt.less +2 -1
- package/src/SentimentSurface/_stories/SentimentSurface.story.tsx +1 -1
- package/src/Snackbar/Snackbar.css +1 -1
- package/src/Snackbar/Snackbar.less +1 -1
- package/src/Stepper/Stepper.tsx +1 -1
- package/src/Table/Header/TableHeader.tsx +1 -1
- package/src/Table/StatusText/TableStatusText.test.tsx +5 -5
- package/src/Table/Table.css +18 -8
- package/src/Table/Table.less +20 -9
- package/src/Tabs/Tab/Tab.tsx +1 -1
- package/src/Tabs/Tabs.css +3 -3
- package/src/Tabs/Tabs.less +3 -3
- package/src/Tag/Tag.css +1 -1
- package/src/Tag/Tag.less +1 -1
- package/src/Tag/Tag.tsx +1 -1
- package/src/Tag/_stories/Tag.story.tsx +1 -1
- package/src/Tile/Tile.css +4 -3
- package/src/Tile/Tile.less +4 -3
- package/src/Typeahead/Typeahead.css +4 -2
- package/src/Typeahead/Typeahead.less +2 -1
- package/src/Typeahead/TypeaheadOption/TypeaheadOption.tsx +2 -2
- package/src/Upload/Steps/UploadImageStep/UploadImageStep.tsx +2 -2
- package/src/UploadInput/UploadInput.css +1 -1
- package/src/UploadInput/UploadInput.less +7 -4
- package/src/_deprecated/ActionButton/ActionButton.css +3 -4
- package/src/_deprecated/ActionButton/ActionButton.less +4 -5
- package/src/_deprecated/ActionButton/ActionButton.tsx +1 -1
- package/src/_deprecated/Avatar/Avatar.css +2 -2
- package/src/_deprecated/Avatar/Avatar.less +2 -2
- package/src/_deprecated/Avatar/Avatar.tsx +1 -1
- package/src/_deprecated/CriticalBanner/CriticalCommsBanner.css +2 -1
- package/src/_deprecated/CriticalBanner/CriticalCommsBanner.less +2 -1
- package/src/_deprecated/NavigationOption/_stories/NavigationOption.story.tsx +6 -6
- package/src/_deprecated/Select/Select.css +49 -14
- package/src/_deprecated/Select/Select.less +14 -10
- package/src/_deprecated/Select/Select.tsx +2 -2
- package/src/_deprecated/Summary/Summary.css +2 -2
- package/src/_deprecated/Summary/Summary.less +2 -2
- package/src/common/Circle/Circle.css +1 -1
- package/src/common/Circle/Circle.less +1 -1
- package/src/common/Option/Option.css +4 -4
- package/src/common/Option/Option.less +4 -4
- package/src/common/PropsValues/typography.ts +20 -1
- package/src/index.ts +1 -3
- package/src/main.css +8673 -2355
- package/src/main.less +3 -3
- package/src/styles/less/accordion.css +22 -44
- package/src/styles/less/addons/_background-utilities.less +5 -0
- package/src/styles/less/badge.css +2 -2
- package/src/styles/less/badge.less +2 -2
- package/src/styles/less/button-groups.css +29 -6
- package/src/styles/less/button-groups.less +3 -2
- package/src/styles/less/buttons.css +35 -11
- package/src/styles/less/buttons.less +7 -7
- package/src/styles/less/core/_fonts.less +7 -75
- package/src/styles/less/core/_scaffolding.less +4 -4
- package/src/styles/less/core/_typography-utilities.less +3 -3
- package/src/styles/less/core/_typography.less +81 -235
- package/src/styles/less/core/fonts/_fonts-ar.less +86 -0
- package/src/styles/less/core/fonts/_fonts-base.less +99 -0
- package/src/styles/less/core/fonts/_fonts-he.less +8 -0
- package/src/styles/less/core/fonts/_fonts-ja.less +4247 -0
- package/src/styles/less/core/fonts/_fonts-ko.less +1079 -0
- package/src/styles/less/core/fonts/_fonts-th.less +8 -0
- package/src/styles/less/core/fonts/_fonts-zh.less +872 -0
- package/src/styles/less/decision.css +22 -44
- package/src/styles/less/decision.less +2 -2
- package/src/styles/less/dropdowns.css +39 -54
- package/src/styles/less/dropdowns.less +8 -7
- package/src/styles/less/droppable.css +28 -6
- package/src/styles/less/droppable.less +4 -4
- package/src/styles/less/footer.css +41 -10
- package/src/styles/less/footer.less +4 -3
- package/src/styles/less/forms/bootstrap-forms.css +153 -100
- package/src/styles/less/forms/bootstrap-forms.less +85 -72
- package/src/styles/less/forms/checkbox-radio.css +3 -3
- package/src/styles/less/forms/checkbox-radio.less +3 -3
- package/src/styles/less/input-groups.css +205 -162
- package/src/styles/less/input-groups.less +23 -9
- package/src/styles/less/list-group.css +1 -42
- package/src/styles/less/list-group.less +8 -5
- package/src/styles/less/mixins/_reset-text.less +1 -1
- package/src/styles/less/mixins/_text-emphasis.less +7 -1
- package/src/styles/less/modals.css +1 -1
- package/src/styles/less/modals.less +1 -1
- package/src/styles/less/navbar.css +66 -81
- package/src/styles/less/navbar.less +19 -19
- package/src/styles/less/navs.css +8 -8
- package/src/styles/less/navs.less +8 -8
- package/src/styles/less/neptune-addons.css +15 -0
- package/src/styles/less/neptune-core.css +5887 -524
- package/src/styles/less/neptune.bundle.less +4 -0
- package/src/styles/less/neptune.css +8348 -1945
- package/src/styles/less/panels.css +2 -2
- package/src/styles/less/panels.less +2 -2
- package/src/styles/less/popovers.css +39 -56
- package/src/styles/less/popovers.less +7 -7
- package/src/styles/less/progress-bars.css +2 -2
- package/src/styles/less/progress-bars.less +2 -2
- package/src/styles/less/sequences.css +14 -9
- package/src/styles/less/sequences.less +15 -10
- package/src/styles/less/table.css +7 -7
- package/src/styles/less/table.less +7 -7
- package/src/styles/less/tooltip.css +28 -6
- package/src/styles/less/tooltip.less +1 -1
- package/src/styles/variables/legacy-variables.less +3 -3
- package/build/CardContainer/CardContainer.js +0 -30
- package/build/CardContainer/CardContainer.js.map +0 -1
- package/build/CardContainer/CardContainer.mjs +0 -26
- package/build/CardContainer/CardContainer.mjs.map +0 -1
- package/build/Header/HeaderActionButton.js +0 -70
- package/build/Header/HeaderActionButton.js.map +0 -1
- package/build/Header/HeaderActionButton.mjs +0 -65
- package/build/Header/HeaderActionButton.mjs.map +0 -1
- package/build/styles/CardContainer/CardContainer.css +0 -78
- package/build/styles/fonts/inter-cyrillic-ext-variable-wghtOnly-normal.woff2 +0 -0
- package/build/styles/fonts/inter-cyrillic-variable-wghtOnly-normal.woff2 +0 -0
- package/build/styles/fonts/inter-greek-ext-variable-wghtOnly-normal.woff2 +0 -0
- package/build/styles/fonts/inter-greek-variable-wghtOnly-normal.woff2 +0 -0
- package/build/styles/fonts/inter-latin-ext-variable-wghtOnly-normal.woff2 +0 -0
- package/build/styles/fonts/inter-latin-variable-wghtOnly-normal.woff2 +0 -0
- package/build/styles/fonts/inter-vietnamese-variable-wghtOnly-normal.woff2 +0 -0
- package/build/styles/fonts/rubik/rubik-body-cyrillic-330-normal.woff2 +0 -0
- package/build/styles/fonts/rubik/rubik-body-cyrillic-600-normal.woff2 +0 -0
- package/build/styles/fonts/rubik/rubik-body-cyrillic-ext-330-normal.woff2 +0 -0
- package/build/styles/fonts/rubik/rubik-body-cyrillic-ext-600-normal.woff2 +0 -0
- package/build/styles/fonts/rubik/rubik-cyrillic-900-normal.woff2 +0 -0
- package/build/styles/fonts/rubik/rubik-cyrillic-ext-900-normal.woff2 +0 -0
- package/build/types/CardContainer/CardContainer.d.ts +0 -8
- package/build/types/CardContainer/CardContainer.d.ts.map +0 -1
- package/build/types/CardContainer/CardContainer.types.d.ts +0 -32
- package/build/types/CardContainer/CardContainer.types.d.ts.map +0 -1
- package/build/types/CardContainer/_stories/helpers.d.ts +0 -3
- package/build/types/CardContainer/_stories/helpers.d.ts.map +0 -1
- package/build/types/CardContainer/index.d.ts +0 -3
- package/build/types/CardContainer/index.d.ts.map +0 -1
- package/build/types/Header/HeaderActionButton.d.ts +0 -53
- package/build/types/Header/HeaderActionButton.d.ts.map +0 -1
- package/src/CardContainer/CardContainer.css +0 -78
- package/src/CardContainer/CardContainer.less +0 -111
- package/src/CardContainer/CardContainer.test.tsx +0 -103
- package/src/CardContainer/CardContainer.tsx +0 -36
- package/src/CardContainer/CardContainer.types.ts +0 -36
- package/src/CardContainer/_stories/CardContainer.story.tsx +0 -99
- package/src/CardContainer/_stories/CardContainer.test.story.tsx +0 -375
- package/src/CardContainer/_stories/CardContainer.withHeader.story.tsx +0 -149
- package/src/CardContainer/_stories/helpers.tsx +0 -50
- package/src/CardContainer/index.ts +0 -2
- package/src/Header/HeaderActionButton.tsx +0 -125
- package/src/styles/fonts/inter-cyrillic-ext-variable-wghtOnly-normal.woff2 +0 -0
- package/src/styles/fonts/inter-cyrillic-variable-wghtOnly-normal.woff2 +0 -0
- package/src/styles/fonts/inter-greek-ext-variable-wghtOnly-normal.woff2 +0 -0
- package/src/styles/fonts/inter-greek-variable-wghtOnly-normal.woff2 +0 -0
- package/src/styles/fonts/inter-latin-ext-variable-wghtOnly-normal.woff2 +0 -0
- package/src/styles/fonts/inter-latin-variable-wghtOnly-normal.woff2 +0 -0
- package/src/styles/fonts/inter-vietnamese-variable-wghtOnly-normal.woff2 +0 -0
- package/src/styles/fonts/rubik/rubik-body-cyrillic-330-normal.woff2 +0 -0
- package/src/styles/fonts/rubik/rubik-body-cyrillic-600-normal.woff2 +0 -0
- package/src/styles/fonts/rubik/rubik-body-cyrillic-ext-330-normal.woff2 +0 -0
- package/src/styles/fonts/rubik/rubik-body-cyrillic-ext-600-normal.woff2 +0 -0
- package/src/styles/fonts/rubik/rubik-cyrillic-900-normal.woff2 +0 -0
- package/src/styles/fonts/rubik/rubik-cyrillic-ext-900-normal.woff2 +0 -0
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import Header from '../Header';
|
|
2
|
-
import { render, screen } from '../test-utils';
|
|
3
|
-
import CardContainer from './CardContainer';
|
|
4
|
-
import type { CardContainerSpotlight } from './CardContainer.types';
|
|
5
|
-
|
|
6
|
-
describe('CardContainer', () => {
|
|
7
|
-
const content = 'Container content';
|
|
8
|
-
|
|
9
|
-
describe('rendering', () => {
|
|
10
|
-
it('renders children', () => {
|
|
11
|
-
render(<CardContainer>{content}</CardContainer>);
|
|
12
|
-
expect(screen.getByText(content)).toBeInTheDocument();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('renders as a section by default', () => {
|
|
16
|
-
render(<CardContainer data-testid="container">{content}</CardContainer>);
|
|
17
|
-
expect(screen.getByTestId('container').tagName).toBe('SECTION');
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it.each(['div', 'article'] as const)('renders as %s when as is provided', (as) => {
|
|
21
|
-
render(
|
|
22
|
-
<CardContainer as={as} data-testid="container">
|
|
23
|
-
{content}
|
|
24
|
-
</CardContainer>,
|
|
25
|
-
);
|
|
26
|
-
expect(screen.getByTestId('container').tagName).toBe(as.toUpperCase());
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('applies className to the root element', () => {
|
|
30
|
-
render(
|
|
31
|
-
<CardContainer className="custom-class" data-testid="container">
|
|
32
|
-
{content}
|
|
33
|
-
</CardContainer>,
|
|
34
|
-
);
|
|
35
|
-
expect(screen.getByTestId('container')).toHaveClass('wds-card-container', 'custom-class');
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('spreads unknown props onto the root element', () => {
|
|
39
|
-
render(
|
|
40
|
-
<CardContainer aria-label="Cards" data-testid="container">
|
|
41
|
-
{content}
|
|
42
|
-
</CardContainer>,
|
|
43
|
-
);
|
|
44
|
-
expect(screen.getByTestId('container')).toHaveAttribute('aria-label', 'Cards');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('renders a composed Header as a direct child', () => {
|
|
48
|
-
render(
|
|
49
|
-
<CardContainer data-testid="container">
|
|
50
|
-
<Header as="h3" title="Cards" />
|
|
51
|
-
{content}
|
|
52
|
-
</CardContainer>,
|
|
53
|
-
);
|
|
54
|
-
const heading = screen.getByRole('heading', { level: 3, name: 'Cards' });
|
|
55
|
-
expect(heading.parentElement).toBe(screen.getByTestId('container'));
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
describe('spotlight', () => {
|
|
60
|
-
it('has no spotlight modifier by default', () => {
|
|
61
|
-
render(<CardContainer data-testid="container">{content}</CardContainer>);
|
|
62
|
-
const root = screen.getByTestId('container');
|
|
63
|
-
expect(root).not.toHaveClass('wds-card-container--active');
|
|
64
|
-
expect(root).not.toHaveClass('wds-card-container--inactive');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it.each<CardContainerSpotlight>(['active', 'inactive'])(
|
|
68
|
-
'renders the %s spotlight modifier',
|
|
69
|
-
(spotlight) => {
|
|
70
|
-
render(
|
|
71
|
-
<CardContainer spotlight={spotlight} data-testid="container">
|
|
72
|
-
{content}
|
|
73
|
-
</CardContainer>,
|
|
74
|
-
);
|
|
75
|
-
expect(screen.getByTestId('container')).toHaveClass(`wds-card-container--${spotlight}`);
|
|
76
|
-
},
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
it('draws a decorative dashed border for the inactive spotlight', () => {
|
|
80
|
-
render(
|
|
81
|
-
<CardContainer spotlight="inactive" data-testid="container">
|
|
82
|
-
{content}
|
|
83
|
-
</CardContainer>,
|
|
84
|
-
);
|
|
85
|
-
expect(
|
|
86
|
-
screen.getByTestId('container').querySelector('.wds-card-container__border'),
|
|
87
|
-
).toHaveAttribute('aria-hidden', 'true');
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it.each<CardContainerSpotlight | undefined>(['active', undefined])(
|
|
91
|
-
'draws no dashed border for spotlight %s',
|
|
92
|
-
(spotlight) => {
|
|
93
|
-
render(
|
|
94
|
-
<CardContainer spotlight={spotlight} data-testid="container">
|
|
95
|
-
{content}
|
|
96
|
-
</CardContainer>,
|
|
97
|
-
);
|
|
98
|
-
const root = screen.getByTestId('container');
|
|
99
|
-
expect(root.querySelector('.wds-card-container__border')).not.toBeInTheDocument();
|
|
100
|
-
},
|
|
101
|
-
);
|
|
102
|
-
});
|
|
103
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
|
|
4
|
-
import type { CardContainerProps } from './CardContainer.types';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A bounded surface that groups related content. It has no slots of its own: compose a `Header`
|
|
8
|
-
* and any other content as children, and the card stacks them with no gap between them.
|
|
9
|
-
*/
|
|
10
|
-
const CardContainer = forwardRef<HTMLElement, CardContainerProps>(
|
|
11
|
-
({ spotlight, children, as: Element = 'section', className, ...props }, ref) => {
|
|
12
|
-
return (
|
|
13
|
-
<Element
|
|
14
|
-
ref={ref as React.Ref<HTMLElement & HTMLDivElement>}
|
|
15
|
-
className={clsx(
|
|
16
|
-
'wds-card-container',
|
|
17
|
-
spotlight && `wds-card-container--${spotlight}`,
|
|
18
|
-
className,
|
|
19
|
-
)}
|
|
20
|
-
{...props}
|
|
21
|
-
>
|
|
22
|
-
{children}
|
|
23
|
-
|
|
24
|
-
{spotlight === 'inactive' && (
|
|
25
|
-
<svg aria-hidden="true" className="wds-card-container__border">
|
|
26
|
-
<rect />
|
|
27
|
-
</svg>
|
|
28
|
-
)}
|
|
29
|
-
</Element>
|
|
30
|
-
);
|
|
31
|
-
},
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
CardContainer.displayName = 'CardContainer';
|
|
35
|
-
|
|
36
|
-
export default CardContainer;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Highlights the card, matching `ListItem`'s `spotlight`.
|
|
5
|
-
*
|
|
6
|
-
* - `active` — live content the user can act on. Raised, with a soft shadow and a hairline border.
|
|
7
|
-
* - `inactive` — a feature the user has not set up yet. Recessed, with a dashed stroke.
|
|
8
|
-
*
|
|
9
|
-
* Without a spotlight the card is flat, with a solid stroke, for content that is present but not
|
|
10
|
-
* actionable.
|
|
11
|
-
*/
|
|
12
|
-
export type CardContainerSpotlight = 'active' | 'inactive';
|
|
13
|
-
|
|
14
|
-
export interface CardContainerProps extends HTMLAttributes<HTMLElement> {
|
|
15
|
-
/**
|
|
16
|
-
* Highlights the card as live content (`active`) or as a feature not set up yet (`inactive`).
|
|
17
|
-
* Leave unset for a flat card.
|
|
18
|
-
* @default undefined
|
|
19
|
-
*/
|
|
20
|
-
spotlight?: CardContainerSpotlight;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Content, stacked with no gap. A `Header` is spaced from the content after it.
|
|
24
|
-
* @default undefined
|
|
25
|
-
*/
|
|
26
|
-
children?: ReactNode;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Element rendered as the root.
|
|
30
|
-
* @default 'section'
|
|
31
|
-
*/
|
|
32
|
-
as?: 'section' | 'div' | 'article';
|
|
33
|
-
|
|
34
|
-
className?: string;
|
|
35
|
-
'data-testid'?: string;
|
|
36
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
createSandboxStory,
|
|
5
|
-
globalScope,
|
|
6
|
-
} from '../../../.storybook/components/sandbox/SandboxEditor';
|
|
7
|
-
import Body from '../../Body';
|
|
8
|
-
import CardContainer from '..';
|
|
9
|
-
import type { CardContainerSpotlight } from '..';
|
|
10
|
-
import { CardsList, SampleContent } from './helpers';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A bounded surface that groups related content. It has no slots of its own: any content passed
|
|
14
|
-
* as children is stacked with no gap, inside the card's padding.
|
|
15
|
-
*
|
|
16
|
-
* To give a card a title, a title link or actions, compose a `Header` as its first child — see the
|
|
17
|
-
* **With Header** stories.
|
|
18
|
-
*/
|
|
19
|
-
const meta: Meta<typeof CardContainer> = {
|
|
20
|
-
component: CardContainer,
|
|
21
|
-
title: 'Layouts/CardContainer',
|
|
22
|
-
tags: ['early-access'],
|
|
23
|
-
argTypes: {
|
|
24
|
-
spotlight: {
|
|
25
|
-
control: 'radio',
|
|
26
|
-
options: [undefined, 'active', 'inactive'],
|
|
27
|
-
table: {
|
|
28
|
-
defaultValue: { summary: 'undefined' },
|
|
29
|
-
type: { summary: 'CardContainerSpotlight' },
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
as: {
|
|
33
|
-
control: 'radio',
|
|
34
|
-
options: ['section', 'div', 'article'],
|
|
35
|
-
table: { defaultValue: { summary: "'section'" }, type: { summary: 'string' } },
|
|
36
|
-
},
|
|
37
|
-
children: {
|
|
38
|
-
control: false,
|
|
39
|
-
table: { type: { summary: 'ReactNode' } },
|
|
40
|
-
},
|
|
41
|
-
className: { control: 'text', table: { type: { summary: 'string' } } },
|
|
42
|
-
'data-testid': { control: 'text', table: { type: { summary: 'string' } } },
|
|
43
|
-
},
|
|
44
|
-
args: {
|
|
45
|
-
spotlight: 'active',
|
|
46
|
-
as: 'section',
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export default meta;
|
|
51
|
-
|
|
52
|
-
type Story = StoryObj<typeof CardContainer>;
|
|
53
|
-
|
|
54
|
-
/** Experiment with the card's props. */
|
|
55
|
-
export const Playground: Story = {
|
|
56
|
-
render: (args) => (
|
|
57
|
-
<CardContainer {...args}>
|
|
58
|
-
<SampleContent />
|
|
59
|
-
</CardContainer>
|
|
60
|
-
),
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const Sandbox = createSandboxStory({
|
|
64
|
-
code: `<CardContainer spotlight="active">
|
|
65
|
-
<Body>Your virtual card is ready to use.</Body>
|
|
66
|
-
<Body>Spend in 40+ currencies with the real exchange rate.</Body>
|
|
67
|
-
</CardContainer>`,
|
|
68
|
-
scope: { ...globalScope, CardContainer },
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* `spotlight` matches `ListItem`'s: `active` is raised, for live content, and `inactive` is
|
|
73
|
-
* recessed with a dashed stroke, for a feature not set up yet. Without a spotlight the card is
|
|
74
|
-
* flat.
|
|
75
|
-
*/
|
|
76
|
-
export const Spotlight: Story = {
|
|
77
|
-
parameters: { controls: { disable: true } },
|
|
78
|
-
render: () => (
|
|
79
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '480px' }}>
|
|
80
|
-
{([undefined, 'active', 'inactive'] as (CardContainerSpotlight | undefined)[]).map(
|
|
81
|
-
(spotlight) => (
|
|
82
|
-
<CardContainer key={spotlight ?? 'none'} spotlight={spotlight}>
|
|
83
|
-
<Body>Spotlight: {spotlight ?? 'not set'}</Body>
|
|
84
|
-
</CardContainer>
|
|
85
|
-
),
|
|
86
|
-
)}
|
|
87
|
-
</div>
|
|
88
|
-
),
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
/** A `List` placed directly in the card is inset by a further 8px on each side. */
|
|
92
|
-
export const WithList: Story = {
|
|
93
|
-
parameters: { controls: { disable: true } },
|
|
94
|
-
render: () => (
|
|
95
|
-
<CardContainer>
|
|
96
|
-
<CardsList />
|
|
97
|
-
</CardContainer>
|
|
98
|
-
),
|
|
99
|
-
};
|
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
import { Card, Jar, Plus, Settings, Travel } from '@transferwise/icons';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
|
-
import { useTheme } from '@wise/components-theming';
|
|
4
|
-
|
|
5
|
-
import { useRtlDiffI18n, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
6
|
-
import { withVariantConfig } from '../../../.storybook/helpers';
|
|
7
|
-
import Body from '../../Body';
|
|
8
|
-
import Header from '../../Header';
|
|
9
|
-
import List from '../../List';
|
|
10
|
-
import ListItem from '../../ListItem';
|
|
11
|
-
import type { ListItemProps } from '../../ListItem';
|
|
12
|
-
import Title from '../../Title';
|
|
13
|
-
import CardContainer from '..';
|
|
14
|
-
import type { CardContainerProps, CardContainerSpotlight } from '..';
|
|
15
|
-
|
|
16
|
-
const meta: Meta<typeof CardContainer> = {
|
|
17
|
-
component: CardContainer,
|
|
18
|
-
tags: ['!autodocs', '!manifest'],
|
|
19
|
-
title: 'Layouts/CardContainer/Tests',
|
|
20
|
-
};
|
|
21
|
-
export default meta;
|
|
22
|
-
type Story = StoryObj<CardContainerProps>;
|
|
23
|
-
|
|
24
|
-
const SPOTLIGHTS: (CardContainerSpotlight | undefined)[] = [undefined, 'active', 'inactive'];
|
|
25
|
-
|
|
26
|
-
const ThemeTitle = () => {
|
|
27
|
-
const { theme, screenMode } = useTheme();
|
|
28
|
-
return (
|
|
29
|
-
<Title type="title-subsection">
|
|
30
|
-
{theme} / {screenMode}
|
|
31
|
-
</Title>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Every spotlight against every theme. The `active` spotlight's resting shadow is only applied in
|
|
37
|
-
* the light `personal`, `business` and `platform` themes; every `dark`, `bright-green` and
|
|
38
|
-
* `forest-green` column should show a flat surface.
|
|
39
|
-
*/
|
|
40
|
-
export const AllVariants: Story = {
|
|
41
|
-
...withVariantConfig([
|
|
42
|
-
'default',
|
|
43
|
-
'dark',
|
|
44
|
-
'bright-green',
|
|
45
|
-
'forest-green',
|
|
46
|
-
'business',
|
|
47
|
-
'business--bright-green',
|
|
48
|
-
'business--forest-green',
|
|
49
|
-
'platform',
|
|
50
|
-
'platform--forest-green',
|
|
51
|
-
]),
|
|
52
|
-
render: () => (
|
|
53
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '420px' }}>
|
|
54
|
-
<ThemeTitle />
|
|
55
|
-
{SPOTLIGHTS.map((spotlight) => (
|
|
56
|
-
<CardContainer key={spotlight ?? 'none'} spotlight={spotlight}>
|
|
57
|
-
<Header
|
|
58
|
-
as="h3"
|
|
59
|
-
title={`Spotlight: ${spotlight ?? 'not set'}`}
|
|
60
|
-
titleAction={{ href: '#target' }}
|
|
61
|
-
action={{ label: 'Order card', icon: <Plus size={16} /> }}
|
|
62
|
-
actionSecondary={{ 'aria-label': 'Settings', icon: <Settings size={16} /> }}
|
|
63
|
-
/>
|
|
64
|
-
<Body>First line of content.</Body>
|
|
65
|
-
<Body>Second line, to show the content stacks flush.</Body>
|
|
66
|
-
</CardContainer>
|
|
67
|
-
))}
|
|
68
|
-
</div>
|
|
69
|
-
),
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
/** A composed `Header` with every combination of title link and the two action slots. */
|
|
73
|
-
export const HeaderCombinations: Story = {
|
|
74
|
-
render: () => (
|
|
75
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '420px' }}>
|
|
76
|
-
<CardContainer>
|
|
77
|
-
<Header as="h3" title="Title only" />
|
|
78
|
-
<Body>Content</Body>
|
|
79
|
-
</CardContainer>
|
|
80
|
-
|
|
81
|
-
<CardContainer>
|
|
82
|
-
<Header as="h3" title="Title as link" titleAction={{ href: '#target' }} />
|
|
83
|
-
<Body>Content</Body>
|
|
84
|
-
</CardContainer>
|
|
85
|
-
|
|
86
|
-
<CardContainer>
|
|
87
|
-
<Header
|
|
88
|
-
as="h3"
|
|
89
|
-
title="A title link long enough to wrap onto a second line, with its chevron after the last word"
|
|
90
|
-
titleAction={{ href: '#target' }}
|
|
91
|
-
/>
|
|
92
|
-
<Body>Content</Body>
|
|
93
|
-
</CardContainer>
|
|
94
|
-
|
|
95
|
-
<CardContainer>
|
|
96
|
-
<Header as="h3" title="Leading action only" action={{ label: 'Order card' }} />
|
|
97
|
-
<Body>Content</Body>
|
|
98
|
-
</CardContainer>
|
|
99
|
-
|
|
100
|
-
<CardContainer>
|
|
101
|
-
<Header as="h3" title="Secondary action only" actionSecondary={{ label: 'Manage' }} />
|
|
102
|
-
<Body>Content</Body>
|
|
103
|
-
</CardContainer>
|
|
104
|
-
|
|
105
|
-
<CardContainer>
|
|
106
|
-
<Header
|
|
107
|
-
as="h3"
|
|
108
|
-
title="Both actions, icon only"
|
|
109
|
-
action={{ 'aria-label': 'Add', icon: <Plus size={16} /> }}
|
|
110
|
-
actionSecondary={{ 'aria-label': 'Settings', icon: <Settings size={16} /> }}
|
|
111
|
-
/>
|
|
112
|
-
<Body>Content</Body>
|
|
113
|
-
</CardContainer>
|
|
114
|
-
|
|
115
|
-
<CardContainer>
|
|
116
|
-
<Header
|
|
117
|
-
as="h3"
|
|
118
|
-
title="A title long enough to wrap onto more than a single line next to its actions"
|
|
119
|
-
titleAction={{ href: '#target' }}
|
|
120
|
-
action={{ label: 'Order card', icon: <Plus size={16} /> }}
|
|
121
|
-
actionSecondary={{ 'aria-label': 'Settings', icon: <Settings size={16} /> }}
|
|
122
|
-
/>
|
|
123
|
-
<Body>Content</Body>
|
|
124
|
-
</CardContainer>
|
|
125
|
-
|
|
126
|
-
<CardContainer>
|
|
127
|
-
<Header as="h3" title="Header only" action={{ label: 'Order card' }} />
|
|
128
|
-
</CardContainer>
|
|
129
|
-
|
|
130
|
-
<CardContainer>
|
|
131
|
-
<Body>No header — the content starts at the card's top padding.</Body>
|
|
132
|
-
</CardContainer>
|
|
133
|
-
</div>
|
|
134
|
-
),
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const LIST_ITEMS = [
|
|
138
|
-
{ title: '•••• 1582', subtitle: 'Current account', icon: <Card /> },
|
|
139
|
-
{ title: '•••• 9982', subtitle: 'Jar', icon: <Jar /> },
|
|
140
|
-
{ title: '•••• 5507', subtitle: 'Travel', icon: <Travel /> },
|
|
141
|
-
];
|
|
142
|
-
|
|
143
|
-
const CardListItem = ({
|
|
144
|
-
index,
|
|
145
|
-
spotlight,
|
|
146
|
-
}: {
|
|
147
|
-
index: number;
|
|
148
|
-
spotlight?: ListItemProps['spotlight'];
|
|
149
|
-
}) => {
|
|
150
|
-
const { title, subtitle, icon } = LIST_ITEMS[index];
|
|
151
|
-
return (
|
|
152
|
-
<ListItem
|
|
153
|
-
title={title}
|
|
154
|
-
subtitle={subtitle}
|
|
155
|
-
spotlight={spotlight}
|
|
156
|
-
media={<ListItem.AvatarView>{icon}</ListItem.AvatarView>}
|
|
157
|
-
control={<ListItem.Navigation href={`#item-${index}`} />}
|
|
158
|
-
/>
|
|
159
|
-
);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* A composed `List` with every mix of spotlight and non-spotlight items. Non-spotlight items draw
|
|
164
|
-
* their hover and focus backgrounds 8px out of bounds, into the card's padding.
|
|
165
|
-
*/
|
|
166
|
-
export const ListCombinations: Story = {
|
|
167
|
-
render: () => (
|
|
168
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '420px' }}>
|
|
169
|
-
<CardContainer>
|
|
170
|
-
<Header as="h3" title="Non-spotlight items" titleAction={{ href: '#target' }} />
|
|
171
|
-
<List>
|
|
172
|
-
<CardListItem index={0} />
|
|
173
|
-
<CardListItem index={1} />
|
|
174
|
-
<CardListItem index={2} />
|
|
175
|
-
</List>
|
|
176
|
-
</CardContainer>
|
|
177
|
-
|
|
178
|
-
<CardContainer>
|
|
179
|
-
<Header as="h3" title="Active spotlight items" />
|
|
180
|
-
<List>
|
|
181
|
-
<CardListItem index={0} spotlight="active" />
|
|
182
|
-
<CardListItem index={1} spotlight="active" />
|
|
183
|
-
</List>
|
|
184
|
-
</CardContainer>
|
|
185
|
-
|
|
186
|
-
<CardContainer>
|
|
187
|
-
<Header as="h3" title="Inactive spotlight items" />
|
|
188
|
-
<List>
|
|
189
|
-
<CardListItem index={0} spotlight="inactive" />
|
|
190
|
-
<CardListItem index={1} spotlight="inactive" />
|
|
191
|
-
</List>
|
|
192
|
-
</CardContainer>
|
|
193
|
-
|
|
194
|
-
<CardContainer>
|
|
195
|
-
<Header as="h3" title="Active and inactive spotlight items" />
|
|
196
|
-
<List>
|
|
197
|
-
<CardListItem index={0} spotlight="active" />
|
|
198
|
-
<CardListItem index={1} spotlight="inactive" />
|
|
199
|
-
</List>
|
|
200
|
-
</CardContainer>
|
|
201
|
-
|
|
202
|
-
<CardContainer>
|
|
203
|
-
<Header
|
|
204
|
-
as="h3"
|
|
205
|
-
title="Spotlight and non-spotlight items"
|
|
206
|
-
action={{ label: 'Order card', icon: <Plus size={16} /> }}
|
|
207
|
-
/>
|
|
208
|
-
<List>
|
|
209
|
-
<CardListItem index={0} spotlight="active" />
|
|
210
|
-
<CardListItem index={1} />
|
|
211
|
-
<CardListItem index={2} />
|
|
212
|
-
</List>
|
|
213
|
-
</CardContainer>
|
|
214
|
-
|
|
215
|
-
<CardContainer spotlight="active">
|
|
216
|
-
<Header as="h3" title="Single non-spotlight item in an active card" />
|
|
217
|
-
<List>
|
|
218
|
-
<CardListItem index={0} />
|
|
219
|
-
</List>
|
|
220
|
-
</CardContainer>
|
|
221
|
-
|
|
222
|
-
<CardContainer spotlight="inactive">
|
|
223
|
-
<Header as="h3" title="Single spotlight item in an inactive card" />
|
|
224
|
-
<List>
|
|
225
|
-
<CardListItem index={0} spotlight="active" />
|
|
226
|
-
</List>
|
|
227
|
-
</CardContainer>
|
|
228
|
-
|
|
229
|
-
<CardContainer>
|
|
230
|
-
<List>
|
|
231
|
-
<CardListItem index={0} />
|
|
232
|
-
<CardListItem index={1} />
|
|
233
|
-
</List>
|
|
234
|
-
</CardContainer>
|
|
235
|
-
</div>
|
|
236
|
-
),
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Two spotlighted cards side by side: one with a title-only `Header` and text, the other with
|
|
241
|
-
* action buttons and a `List`. Each header is at least as tall as the 32px action buttons, so the
|
|
242
|
-
* first line of content starts at the same height in both cards.
|
|
243
|
-
*/
|
|
244
|
-
export const SideBySide: Story = {
|
|
245
|
-
render: () => (
|
|
246
|
-
<div style={{ display: 'flex', gap: '24px', maxWidth: '900px' }}>
|
|
247
|
-
<div style={{ flex: 1 }}>
|
|
248
|
-
<CardContainer spotlight="active">
|
|
249
|
-
<Header as="h3" title="Balance" />
|
|
250
|
-
<Body>Your virtual card is ready to use.</Body>
|
|
251
|
-
<Body>Spend in 40+ currencies with the real exchange rate.</Body>
|
|
252
|
-
</CardContainer>
|
|
253
|
-
</div>
|
|
254
|
-
<div style={{ flex: 1 }}>
|
|
255
|
-
<CardContainer spotlight="active">
|
|
256
|
-
<Header
|
|
257
|
-
as="h3"
|
|
258
|
-
title="Cards"
|
|
259
|
-
titleAction={{ href: '#target' }}
|
|
260
|
-
action={{ label: 'Order card', icon: <Plus size={16} /> }}
|
|
261
|
-
actionSecondary={{ 'aria-label': 'Settings', icon: <Settings size={16} /> }}
|
|
262
|
-
/>
|
|
263
|
-
<List>
|
|
264
|
-
<CardListItem index={0} />
|
|
265
|
-
<CardListItem index={1} />
|
|
266
|
-
<CardListItem index={2} />
|
|
267
|
-
</List>
|
|
268
|
-
</CardContainer>
|
|
269
|
-
</div>
|
|
270
|
-
</div>
|
|
271
|
-
),
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* When the `Header` is 360px wide or narrower, its action corner stays beside a title that fits
|
|
276
|
-
* on one line next to it, and moves under a longer title. Above that width, a long title wraps
|
|
277
|
-
* beside the actions instead.
|
|
278
|
-
*/
|
|
279
|
-
export const NarrowHeader: Story = {
|
|
280
|
-
render: () => (
|
|
281
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px' }}>
|
|
282
|
-
{[320, 394, 420].map((width) => (
|
|
283
|
-
<div key={width} style={{ display: 'flex', flexDirection: 'column', gap: '16px', width }}>
|
|
284
|
-
{['Cards', `A longer title in a card ${width}px wide`].map((title) => (
|
|
285
|
-
<CardContainer key={title} spotlight="active">
|
|
286
|
-
<Header
|
|
287
|
-
as="h3"
|
|
288
|
-
title={title}
|
|
289
|
-
titleAction={{ href: '#target' }}
|
|
290
|
-
action={{ label: 'Order card', icon: <Plus size={16} /> }}
|
|
291
|
-
actionSecondary={{ 'aria-label': 'Settings', icon: <Settings size={16} /> }}
|
|
292
|
-
/>
|
|
293
|
-
<Body>Content</Body>
|
|
294
|
-
</CardContainer>
|
|
295
|
-
))}
|
|
296
|
-
</div>
|
|
297
|
-
))}
|
|
298
|
-
</div>
|
|
299
|
-
),
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* The `Header` is a wrapping flex row, so in RTL the action cluster should move to the left and
|
|
304
|
-
* the title's trailing chevron should point left. The `actionSecondary` slot must stay on the
|
|
305
|
-
* inline-start side of `action` in both directions.
|
|
306
|
-
*
|
|
307
|
-
* Every card is rendered wide (480px, actions beside the title) and narrow (320px). At 320px the
|
|
308
|
-
* short titles keep their actions beside them, and the long title's actions stack under it,
|
|
309
|
-
* aligned to the inline end. The long title wraps, so its chevron should follow the last word on
|
|
310
|
-
* the inline-end side in both directions.
|
|
311
|
-
*/
|
|
312
|
-
export const RTLDiff: Story = {
|
|
313
|
-
render: () => {
|
|
314
|
-
const i18n = useRtlDiffI18n();
|
|
315
|
-
const cards = (
|
|
316
|
-
<>
|
|
317
|
-
<CardContainer>
|
|
318
|
-
<Header as="h3" title={i18n.cards} titleAction={{ href: '#target' }} />
|
|
319
|
-
<Body>{i18n.content}</Body>
|
|
320
|
-
</CardContainer>
|
|
321
|
-
|
|
322
|
-
<CardContainer>
|
|
323
|
-
<Header
|
|
324
|
-
as="h3"
|
|
325
|
-
title={i18n.cards}
|
|
326
|
-
action={{ label: i18n.orderCard, icon: <Plus size={16} /> }}
|
|
327
|
-
actionSecondary={{ 'aria-label': i18n.settings, icon: <Settings size={16} /> }}
|
|
328
|
-
/>
|
|
329
|
-
<Body>{i18n.content}</Body>
|
|
330
|
-
</CardContainer>
|
|
331
|
-
|
|
332
|
-
<CardContainer spotlight="active">
|
|
333
|
-
<Header
|
|
334
|
-
as="h3"
|
|
335
|
-
title={i18n.longTitle}
|
|
336
|
-
titleAction={{ href: '#target' }}
|
|
337
|
-
action={{ label: i18n.orderCard, icon: <Plus size={16} /> }}
|
|
338
|
-
actionSecondary={{ 'aria-label': i18n.settings, icon: <Settings size={16} /> }}
|
|
339
|
-
/>
|
|
340
|
-
<Body>{i18n.content}</Body>
|
|
341
|
-
</CardContainer>
|
|
342
|
-
|
|
343
|
-
<CardContainer spotlight="inactive">
|
|
344
|
-
<Header as="h3" title={i18n.cards} />
|
|
345
|
-
<Body>{i18n.content}</Body>
|
|
346
|
-
</CardContainer>
|
|
347
|
-
</>
|
|
348
|
-
);
|
|
349
|
-
|
|
350
|
-
return (
|
|
351
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '40px' }}>
|
|
352
|
-
{[480, 320].map((width) => (
|
|
353
|
-
<div key={width} style={{ display: 'flex', flexDirection: 'column', gap: '24px', width }}>
|
|
354
|
-
{cards}
|
|
355
|
-
</div>
|
|
356
|
-
))}
|
|
357
|
-
</div>
|
|
358
|
-
);
|
|
359
|
-
},
|
|
360
|
-
...withRTLDiff({
|
|
361
|
-
i18n: {
|
|
362
|
-
cards: { en: 'Cards', ar: 'البطاقات' },
|
|
363
|
-
content: {
|
|
364
|
-
en: 'Your virtual card is ready to use.',
|
|
365
|
-
ar: 'بطاقتك الافتراضية جاهزة للاستخدام.',
|
|
366
|
-
},
|
|
367
|
-
orderCard: { en: 'Order card', ar: 'اطلب بطاقة' },
|
|
368
|
-
settings: { en: 'Card settings', ar: 'إعدادات البطاقة' },
|
|
369
|
-
longTitle: {
|
|
370
|
-
en: 'Cards, accounts and everything else you hold with us',
|
|
371
|
-
ar: 'البطاقات والحسابات وكل ما تحتفظ به لدينا',
|
|
372
|
-
},
|
|
373
|
-
},
|
|
374
|
-
}),
|
|
375
|
-
};
|