@transferwise/components 46.165.5 → 46.167.0
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 +2 -2
- package/build/Body/Body.js.map +1 -1
- package/build/Body/Body.mjs +2 -2
- 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/CardContainer/CardContainer.js +34 -0
- package/build/CardContainer/CardContainer.js.map +1 -0
- package/build/CardContainer/CardContainer.mjs +30 -0
- package/build/CardContainer/CardContainer.mjs.map +1 -0
- package/build/CardWidget/CardWidget.js +98 -0
- package/build/CardWidget/CardWidget.js.map +1 -0
- package/build/CardWidget/CardWidget.mjs +94 -0
- package/build/CardWidget/CardWidget.mjs.map +1 -0
- package/build/CardWidget/CardWidgetAction.js +73 -0
- package/build/CardWidget/CardWidgetAction.js.map +1 -0
- package/build/CardWidget/CardWidgetAction.mjs +68 -0
- package/build/CardWidget/CardWidgetAction.mjs.map +1 -0
- package/build/Display/Display.js +3 -1
- package/build/Display/Display.js.map +1 -1
- package/build/Display/Display.mjs +3 -1
- package/build/Display/Display.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/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/ListItem/ListItem.js +2 -0
- package/build/ListItem/ListItem.js.map +1 -1
- package/build/ListItem/ListItem.mjs +2 -0
- package/build/ListItem/ListItem.mjs.map +1 -1
- package/build/Stepper/Stepper.js +3 -2
- package/build/Stepper/Stepper.js.map +1 -1
- package/build/Stepper/Stepper.mjs +3 -2
- 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/Title/Title.js +2 -2
- package/build/Title/Title.js.map +1 -1
- package/build/Title/Title.mjs +2 -2
- package/build/Title/Title.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 +4 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +2 -0
- package/build/index.mjs.map +1 -1
- package/build/main.css +9245 -1899
- package/build/styles/Accordion/Accordion.css +7 -6
- package/build/styles/Body/Body.css +2 -1
- package/build/styles/Calendar/Calendar.css +5 -4
- package/build/styles/Calendar/TableLink/TableLink.css +5 -4
- package/build/styles/CardContainer/CardContainer.css +108 -0
- package/build/styles/CardWidget/CardWidget.css +78 -0
- 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/Inputs/Input/Input.css +98 -24
- package/build/styles/Inputs/TextArea/TextArea.css +98 -24
- package/build/styles/Label/Label.css +3 -0
- package/build/styles/ListItem/ListItem.css +8 -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 +30 -7
- 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 +53 -11
- 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 +53 -11
- package/build/styles/css/dropdowns.css +65 -18
- package/build/styles/css/droppable.css +28 -6
- package/build/styles/css/footer.css +41 -10
- package/build/styles/css/input-groups.css +249 -117
- package/build/styles/css/list-group.css +28 -8
- package/build/styles/css/modals.css +1 -1
- package/build/styles/css/navbar.css +92 -45
- package/build/styles/css/navs.css +8 -8
- package/build/styles/css/neptune-addons.css +15 -0
- package/build/styles/css/neptune-core.css +6230 -525
- package/build/styles/css/neptune.css +8790 -1768
- package/build/styles/css/panels.css +2 -2
- package/build/styles/css/popovers.css +64 -20
- 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 +9245 -1899
- package/build/styles/props/neptune-tokens.css +805 -3
- package/build/styles/styles/less/accordion.css +53 -11
- 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 +53 -11
- package/build/styles/styles/less/dropdowns.css +65 -18
- 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 +249 -117
- package/build/styles/styles/less/list-group.css +28 -8
- package/build/styles/styles/less/modals.css +1 -1
- package/build/styles/styles/less/navbar.css +92 -45
- 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 +6230 -525
- package/build/styles/styles/less/neptune.css +8790 -1768
- package/build/styles/styles/less/panels.css +2 -2
- package/build/styles/styles/less/popovers.css +64 -20
- 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/Body/Body.d.ts +2 -2
- package/build/types/Body/Body.d.ts.map +1 -1
- package/build/types/CardContainer/CardContainer.d.ts +8 -0
- package/build/types/CardContainer/CardContainer.d.ts.map +1 -0
- package/build/types/CardContainer/CardContainer.types.d.ts +55 -0
- package/build/types/CardContainer/CardContainer.types.d.ts.map +1 -0
- package/build/types/CardContainer/_stories/helpers.d.ts +3 -0
- package/build/types/CardContainer/_stories/helpers.d.ts.map +1 -0
- package/build/types/CardContainer/index.d.ts +3 -0
- package/build/types/CardContainer/index.d.ts.map +1 -0
- package/build/types/CardWidget/CardWidget.d.ts +10 -0
- package/build/types/CardWidget/CardWidget.d.ts.map +1 -0
- package/build/types/CardWidget/CardWidget.types.d.ts +55 -0
- package/build/types/CardWidget/CardWidget.types.d.ts.map +1 -0
- package/build/types/CardWidget/CardWidgetAction.d.ts +54 -0
- package/build/types/CardWidget/CardWidgetAction.d.ts.map +1 -0
- package/build/types/CardWidget/index.d.ts +4 -0
- package/build/types/CardWidget/index.d.ts.map +1 -0
- package/build/types/Display/Display.d.ts.map +1 -1
- package/build/types/ExpressiveMoneyInput/AmountInput/AmountInput.d.ts.map +1 -1
- package/build/types/IconButton/IconButton.d.ts +1 -1
- package/build/types/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.d.ts.map +1 -1
- package/build/types/Inputs/SelectInput/Popover/SelectInputPopover.d.ts.map +1 -1
- package/build/types/ListItem/ListItem.d.ts +1 -1
- package/build/types/ListItem/ListItem.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/Stepper/Stepper.d.ts.map +1 -1
- package/build/types/Tabs/Tab/Tab.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/Upload/Steps/UploadImageStep/UploadImageStep.d.ts.map +1 -1
- package/build/types/UploadInput/UploadItem/UploadItemLink.d.ts +1 -1
- package/build/types/_deprecated/Select/Select.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 +4 -0
- package/build/types/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/Accordion/Accordion.css +7 -6
- package/src/Accordion/Accordion.less +7 -6
- package/src/Body/Body.css +2 -1
- package/src/Body/Body.less +2 -1
- package/src/Body/Body.test.tsx +13 -4
- package/src/Body/Body.tsx +4 -3
- package/src/Body/_stories/Body.test.story.tsx +42 -0
- package/src/Calendar/Calendar.css +5 -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 +5 -4
- package/src/Calendar/TableLink/TableLink.less +5 -4
- package/src/Calendar/TableLink/TableLink.tsx +1 -1
- package/src/Calendar/_stories/Calendar.test.story.tsx +33 -0
- package/src/CardContainer/CardContainer.css +108 -0
- package/src/CardContainer/CardContainer.less +171 -0
- package/src/CardContainer/CardContainer.test.tsx +150 -0
- package/src/CardContainer/CardContainer.tsx +51 -0
- package/src/CardContainer/CardContainer.types.ts +62 -0
- package/src/CardContainer/_stories/CardContainer.story.tsx +167 -0
- package/src/CardContainer/_stories/CardContainer.test.story.tsx +103 -0
- package/src/CardContainer/_stories/helpers.tsx +50 -0
- package/src/CardContainer/index.ts +6 -0
- package/src/CardWidget/CardWidget.css +78 -0
- package/src/CardWidget/CardWidget.less +107 -0
- package/src/CardWidget/CardWidget.test.tsx +221 -0
- package/src/CardWidget/CardWidget.tsx +78 -0
- package/src/CardWidget/CardWidget.types.ts +63 -0
- package/src/CardWidget/CardWidgetAction.tsx +128 -0
- package/src/CardWidget/_stories/CardWidget.story.tsx +238 -0
- package/src/CardWidget/_stories/CardWidget.test.story.tsx +350 -0
- package/src/CardWidget/index.ts +3 -0
- 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 +45 -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/Display.test.tsx +43 -0
- package/src/Display/Display.tsx +11 -1
- package/src/Display/_stories/Display.story.tsx +36 -21
- package/src/Display/_stories/Display.test.story.tsx +108 -0
- 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/Inputs/Input/Input.css +98 -24
- package/src/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.tsx +4 -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 +6 -2
- package/src/Inputs/SelectInput/_stories/SelectInput.story.tsx +1 -1
- package/src/Inputs/TextArea/TextArea.css +98 -24
- 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/ListItem/ListItem.css +8 -0
- package/src/ListItem/ListItem.less +8 -0
- package/src/ListItem/ListItem.test.tsx +20 -0
- package/src/ListItem/ListItem.tsx +3 -1
- package/src/ListItem/_stories/ListItem.layout.test.story.tsx +1 -1
- package/src/ListItem/_stories/ListItem.story.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 +30 -7
- package/src/Popover/Popover.less +2 -2
- package/src/ProgressBar/ProgressBar.css +3 -2
- package/src/ProgressBar/ProgressBar.less +12 -11
- package/src/Prompt/CriticalBanner/_stories/CriticalBanner.docs.mdx +122 -0
- package/src/Prompt/CriticalBanner/_stories/CriticalBanner.story.tsx +0 -2
- 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 +4 -2
- package/src/Table/Header/TableHeader.tsx +1 -1
- package/src/Table/StatusText/TableStatusText.test.tsx +20 -5
- package/src/Table/Table.css +18 -8
- package/src/Table/Table.less +20 -9
- package/src/Tabs/Tab/Tab.tsx +11 -5
- 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/Title/Title.test.tsx +22 -3
- package/src/Title/Title.tsx +2 -2
- 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 +4 -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.test.tsx +16 -0
- package/src/_deprecated/Select/Select.tsx +6 -1
- 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 +13 -0
- package/src/main.css +9245 -1899
- package/src/main.less +5 -2
- package/src/styles/less/accordion.css +53 -11
- 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 +91 -236
- 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 +53 -11
- package/src/styles/less/decision.less +2 -2
- package/src/styles/less/dropdowns.css +65 -18
- 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 +249 -117
- package/src/styles/less/input-groups.less +23 -9
- package/src/styles/less/list-group.css +28 -8
- 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 +92 -45
- 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 +6230 -525
- package/src/styles/less/neptune.bundle.less +4 -0
- package/src/styles/less/neptune.css +8790 -1768
- package/src/styles/less/panels.css +2 -2
- package/src/styles/less/panels.less +2 -2
- package/src/styles/less/popovers.css +64 -20
- 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/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/src/FlowNavigation/_stories/FlowNavigation.CriticalBanner.docs.mdx +0 -66
- 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
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
.wds-card-container {
|
|
2
|
+
--CardContainer-shadow: var(--CardContainer-theme-shadow, none);
|
|
3
|
+
--CardContainer-background-color: var(--color-background-screen);
|
|
4
|
+
--CardContainer-border-color: var(--color-border-neutral);
|
|
5
|
+
--CardContainer-border-radius: var(--radius-large);
|
|
6
|
+
--CardContainer-padding-block: var(--size-8);
|
|
7
|
+
--CardContainer-padding-inline: var(--size-8);
|
|
8
|
+
background-color: var(--CardContainer-background-color);
|
|
9
|
+
border: 1px solid var(--CardContainer-border-color);
|
|
10
|
+
border-radius: var(--CardContainer-border-radius);
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
padding-block: var(--CardContainer-padding-block);
|
|
15
|
+
padding-inline: var(--CardContainer-padding-inline);
|
|
16
|
+
inline-size: 100%;
|
|
17
|
+
}
|
|
18
|
+
@media (min-width: 840px) {
|
|
19
|
+
.wds-card-container {
|
|
20
|
+
--CardContainer-padding-block: var(--size-16);
|
|
21
|
+
--CardContainer-padding-inline: var(--size-16);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
.wds-card-container--padding-none {
|
|
25
|
+
--CardContainer-padding-block: 0px;
|
|
26
|
+
--CardContainer-padding-inline: 0px;
|
|
27
|
+
overflow: clip;
|
|
28
|
+
}
|
|
29
|
+
.wds-card-container--active {
|
|
30
|
+
--CardContainer-background-color: var(--color-background-elevated);
|
|
31
|
+
--CardContainer-border-color: color-mix(in srgb, var(--color-border-neutral) 25%, transparent);
|
|
32
|
+
box-shadow: var(--CardContainer-shadow);
|
|
33
|
+
}
|
|
34
|
+
.wds-card-container--inactive {
|
|
35
|
+
--CardContainer-background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
|
|
36
|
+
border-width: 0;
|
|
37
|
+
padding-block: calc(var(--CardContainer-padding-block) + 1px);
|
|
38
|
+
padding-inline: calc(var(--CardContainer-padding-inline) + 1px);
|
|
39
|
+
position: relative;
|
|
40
|
+
}
|
|
41
|
+
.wds-card-container--interactive:has(
|
|
42
|
+
> a[href]:hover,
|
|
43
|
+
> button:enabled:hover,
|
|
44
|
+
> a[href]:focus-visible,
|
|
45
|
+
> button:enabled:focus-visible
|
|
46
|
+
).wds-card-container--active {
|
|
47
|
+
--CardContainer-border-color: color-mix(in srgb, var(--color-border-neutral) 75%, transparent);
|
|
48
|
+
}
|
|
49
|
+
.wds-card-container--interactive:has(
|
|
50
|
+
> a[href]:hover,
|
|
51
|
+
> button:enabled:hover,
|
|
52
|
+
> a[href]:focus-visible,
|
|
53
|
+
> button:enabled:focus-visible
|
|
54
|
+
).wds-card-container--inactive {
|
|
55
|
+
--CardContainer-background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
|
|
56
|
+
}
|
|
57
|
+
.wds-card-container--interactive:has(> a[href]:active, > button:enabled:active).wds-card-container--active {
|
|
58
|
+
--CardContainer-border-color: var(--color-border-neutral);
|
|
59
|
+
}
|
|
60
|
+
.wds-card-container--interactive:has(> a[href]:active, > button:enabled:active).wds-card-container--inactive {
|
|
61
|
+
--CardContainer-background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
|
|
62
|
+
}
|
|
63
|
+
.wds-card-container__border {
|
|
64
|
+
container-type: size;
|
|
65
|
+
inset: 0;
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
position: absolute;
|
|
68
|
+
}
|
|
69
|
+
.wds-card-container__border svg {
|
|
70
|
+
display: block;
|
|
71
|
+
block-size: 100%;
|
|
72
|
+
inline-size: 100%;
|
|
73
|
+
}
|
|
74
|
+
.wds-card-container__border rect {
|
|
75
|
+
--CardContainer-border-dash-size: calc(var(--size-12) * 0.5);
|
|
76
|
+
--CardContainer-border-stroke-radius: calc(min(var(--CardContainer-border-radius), 50cqh, 50cqw) - 0.5px);
|
|
77
|
+
fill: none;
|
|
78
|
+
block-size: calc(100% - 1px);
|
|
79
|
+
rx: var(--CardContainer-border-stroke-radius);
|
|
80
|
+
ry: var(--CardContainer-border-stroke-radius);
|
|
81
|
+
stroke: var(--color-border-neutral);
|
|
82
|
+
stroke-dasharray: var(--CardContainer-border-dash-size) var(--CardContainer-border-dash-size);
|
|
83
|
+
inline-size: calc(100% - 1px);
|
|
84
|
+
x: 0.5px;
|
|
85
|
+
y: 0.5px;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The active spotlight's resting shadow, only designed for the light themes. Set on every theme
|
|
89
|
+
* root, as a nested ThemeProvider renders its own, so a card follows its nearest theme: a dark or
|
|
90
|
+
* green provider inside a light one turns the shadow off.
|
|
91
|
+
*
|
|
92
|
+
* There is no shadow or elevation token in @transferwise/neptune-tokens, so the value is
|
|
93
|
+
* component-scoped for now, the way PromoCard scopes `--Card-box-shadow`. It is the "Card Active
|
|
94
|
+
* shadow" effect style from Figma: `#0e0f0c` at 4%, kept literal so it doesn't drift with a
|
|
95
|
+
* theme's tokens. Collapses to a token reference once one is minted.
|
|
96
|
+
*/
|
|
97
|
+
.np-theme-personal {
|
|
98
|
+
--CardContainer-theme-shadow: 0 2px 12px rgba(14, 15, 12, 0.04), 0 2px 32px rgba(14, 15, 12, 0.04);
|
|
99
|
+
}
|
|
100
|
+
.np-theme-personal.np-theme-personal--dark,
|
|
101
|
+
.np-theme-personal.np-theme-personal--bright-green,
|
|
102
|
+
.np-theme-personal.np-theme-personal--forest-green,
|
|
103
|
+
.np-theme-personal.np-theme-business--dark,
|
|
104
|
+
.np-theme-personal.np-theme-business--bright-green,
|
|
105
|
+
.np-theme-personal.np-theme-business--forest-green,
|
|
106
|
+
.np-theme-personal.np-theme-platform--forest-green {
|
|
107
|
+
--CardContainer-theme-shadow: none;
|
|
108
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// The hover and pressed states, as mixins so CardWidget can apply them to the card when only its
|
|
2
|
+
// title is hovered or pressed. Applied to the card's root.
|
|
3
|
+
.wds-card-container-hover-state() {
|
|
4
|
+
// The active spotlight keeps its resting shadow, and its hairline border strengthens.
|
|
5
|
+
&.wds-card-container--active {
|
|
6
|
+
--CardContainer-border-color: color-mix(in srgb, var(--color-border-neutral) 75%, transparent);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// The inactive spotlight's fill takes its hover value, at the same 25% strength as at rest.
|
|
10
|
+
&.wds-card-container--inactive {
|
|
11
|
+
--CardContainer-background-color: color-mix(
|
|
12
|
+
in srgb,
|
|
13
|
+
var(--color-background-neutral-hover) 25%,
|
|
14
|
+
transparent
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.wds-card-container-pressed-state() {
|
|
20
|
+
// The active spotlight keeps its resting shadow, and its border is at full strength.
|
|
21
|
+
&.wds-card-container--active {
|
|
22
|
+
--CardContainer-border-color: var(--color-border-neutral);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// The inactive spotlight's fill takes its pressed value, at the same 25% strength as at rest.
|
|
26
|
+
&.wds-card-container--inactive {
|
|
27
|
+
--CardContainer-background-color: color-mix(
|
|
28
|
+
in srgb,
|
|
29
|
+
var(--color-background-neutral-active) 25%,
|
|
30
|
+
transparent
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.wds-card-container {
|
|
36
|
+
// Resolved at the nearest theme root, below.
|
|
37
|
+
--CardContainer-shadow: var(--CardContainer-theme-shadow, none);
|
|
38
|
+
--CardContainer-background-color: var(--color-background-screen);
|
|
39
|
+
--CardContainer-border-color: var(--color-border-neutral);
|
|
40
|
+
--CardContainer-border-radius: var(--radius-large);
|
|
41
|
+
--CardContainer-padding-block: var(--size-8);
|
|
42
|
+
--CardContainer-padding-inline: var(--size-8);
|
|
43
|
+
|
|
44
|
+
background-color: var(--CardContainer-background-color);
|
|
45
|
+
border: 1px solid var(--CardContainer-border-color);
|
|
46
|
+
border-radius: var(--CardContainer-border-radius);
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
padding: var(--CardContainer-padding-block) var(--CardContainer-padding-inline);
|
|
51
|
+
width: 100%;
|
|
52
|
+
|
|
53
|
+
@media (--screen-md) {
|
|
54
|
+
--CardContainer-padding-block: var(--size-16);
|
|
55
|
+
--CardContainer-padding-inline: var(--size-16);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Set through the padding variables, so the `inactive` spotlight's padding still composes.
|
|
59
|
+
// Length zeroes, as the inactive spotlight adds `1px` to these in `calc()`, which a unitless `0`
|
|
60
|
+
// would invalidate.
|
|
61
|
+
&--padding-none {
|
|
62
|
+
--CardContainer-padding-block: 0px;
|
|
63
|
+
--CardContainer-padding-inline: 0px;
|
|
64
|
+
|
|
65
|
+
// Full-bleed content has to follow the card's rounded corners. `overflow` leaves the card's
|
|
66
|
+
// own shadow alone, which `clip-path` would cut off.
|
|
67
|
+
overflow: clip;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&--active {
|
|
71
|
+
--CardContainer-background-color: var(--color-background-elevated);
|
|
72
|
+
// The raised surface's shadow already separates it, so its border is a softer hairline.
|
|
73
|
+
--CardContainer-border-color: color-mix(in srgb, var(--color-border-neutral) 25%, transparent);
|
|
74
|
+
|
|
75
|
+
box-shadow: var(--CardContainer-shadow);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&--inactive {
|
|
79
|
+
--CardContainer-background-color: color-mix(
|
|
80
|
+
in srgb,
|
|
81
|
+
var(--color-background-neutral) 25%,
|
|
82
|
+
transparent
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
// The dashed stroke is drawn inside the card instead of on a border, so the stroke isn't
|
|
86
|
+
// clipped with `padding="none"`. The padding takes the border's 1px, so content stays put.
|
|
87
|
+
border-width: 0;
|
|
88
|
+
padding: calc(var(--CardContainer-padding-block) + 1px)
|
|
89
|
+
calc(var(--CardContainer-padding-inline) + 1px);
|
|
90
|
+
position: relative;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// An `interactive` card follows its direct child link or button, such as a link that fills the
|
|
94
|
+
// card, so it only looks clickable where it can be clicked. Keyboard focus on the child shows the
|
|
95
|
+
// hover state too. A card without a spotlight has no hover or pressed state.
|
|
96
|
+
&--interactive:has(
|
|
97
|
+
> a[href]:hover,
|
|
98
|
+
> button:enabled:hover,
|
|
99
|
+
> a[href]:focus-visible,
|
|
100
|
+
> button:enabled:focus-visible
|
|
101
|
+
) {
|
|
102
|
+
.wds-card-container-hover-state();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Pressed state, while the same direct child is pressed. After the hover rule, so pressed wins
|
|
106
|
+
// while the pointer is down.
|
|
107
|
+
&--interactive:has(> a[href]:active, > button:enabled:active) {
|
|
108
|
+
.wds-card-container-pressed-state();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Same treatment as ListItem's inactive spotlight: CSS `dashed` borders have a browser-chosen
|
|
112
|
+
// dash length, so the 6px/6px dashes are an SVG stroke along the card's edge.
|
|
113
|
+
&__border {
|
|
114
|
+
// A size container, so the stroke's corner radius can be capped by the card's height. An SVG
|
|
115
|
+
// `rect` clamps `rx` and `ry` separately, which turns the corners of a card shorter than twice
|
|
116
|
+
// the radius into ellipses, where `border-radius` keeps them round.
|
|
117
|
+
container-type: size;
|
|
118
|
+
inset: 0;
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
position: absolute;
|
|
121
|
+
|
|
122
|
+
svg {
|
|
123
|
+
display: block;
|
|
124
|
+
height: 100%;
|
|
125
|
+
width: 100%;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
rect {
|
|
129
|
+
--CardContainer-border-dash-size: calc(var(--size-12) * 0.5);
|
|
130
|
+
--CardContainer-border-stroke-radius: calc(
|
|
131
|
+
min(var(--CardContainer-border-radius), 50cqh, 50cqw) - 0.5px
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
fill: none;
|
|
135
|
+
height: calc(100% - 1px);
|
|
136
|
+
rx: var(--CardContainer-border-stroke-radius);
|
|
137
|
+
ry: var(--CardContainer-border-stroke-radius);
|
|
138
|
+
stroke: var(--color-border-neutral);
|
|
139
|
+
stroke-dasharray: var(--CardContainer-border-dash-size) var(--CardContainer-border-dash-size);
|
|
140
|
+
width: calc(100% - 1px);
|
|
141
|
+
x: 0.5px;
|
|
142
|
+
y: 0.5px;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The active spotlight's resting shadow, only designed for the light themes. Set on every theme
|
|
149
|
+
* root, as a nested ThemeProvider renders its own, so a card follows its nearest theme: a dark or
|
|
150
|
+
* green provider inside a light one turns the shadow off.
|
|
151
|
+
*
|
|
152
|
+
* There is no shadow or elevation token in @transferwise/neptune-tokens, so the value is
|
|
153
|
+
* component-scoped for now, the way PromoCard scopes `--Card-box-shadow`. It is the "Card Active
|
|
154
|
+
* shadow" effect style from Figma: `#0e0f0c` at 4%, kept literal so it doesn't drift with a
|
|
155
|
+
* theme's tokens. Collapses to a token reference once one is minted.
|
|
156
|
+
*/
|
|
157
|
+
.np-theme-personal {
|
|
158
|
+
--CardContainer-theme-shadow: 0 2px 12px rgb(14 15 12 / 4%), 0 2px 32px rgb(14 15 12 / 4%);
|
|
159
|
+
|
|
160
|
+
&:is(
|
|
161
|
+
.np-theme-personal--dark,
|
|
162
|
+
.np-theme-personal--bright-green,
|
|
163
|
+
.np-theme-personal--forest-green,
|
|
164
|
+
.np-theme-business--dark,
|
|
165
|
+
.np-theme-business--bright-green,
|
|
166
|
+
.np-theme-business--forest-green,
|
|
167
|
+
.np-theme-platform--forest-green
|
|
168
|
+
) {
|
|
169
|
+
--CardContainer-theme-shadow: none;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { render, screen, userEvent } from '../test-utils';
|
|
2
|
+
import CardContainer from './CardContainer';
|
|
3
|
+
import type { CardContainerSpotlight } from './CardContainer.types';
|
|
4
|
+
|
|
5
|
+
describe('CardContainer', () => {
|
|
6
|
+
const content = 'Container content';
|
|
7
|
+
|
|
8
|
+
describe('rendering', () => {
|
|
9
|
+
it('renders children', () => {
|
|
10
|
+
render(<CardContainer>{content}</CardContainer>);
|
|
11
|
+
expect(screen.getByText(content)).toBeInTheDocument();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('renders as a div by default', () => {
|
|
15
|
+
render(<CardContainer data-testid="container">{content}</CardContainer>);
|
|
16
|
+
expect(screen.getByTestId('container').tagName).toBe('DIV');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it.each(['section', 'article'] as const)('renders as %s when as is provided', (as) => {
|
|
20
|
+
render(
|
|
21
|
+
<CardContainer as={as} data-testid="container">
|
|
22
|
+
{content}
|
|
23
|
+
</CardContainer>,
|
|
24
|
+
);
|
|
25
|
+
expect(screen.getByTestId('container').tagName).toBe(as.toUpperCase());
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('applies className to the root element', () => {
|
|
29
|
+
render(
|
|
30
|
+
<CardContainer className="custom-class" data-testid="container">
|
|
31
|
+
{content}
|
|
32
|
+
</CardContainer>,
|
|
33
|
+
);
|
|
34
|
+
expect(screen.getByTestId('container')).toHaveClass('wds-card-container', 'custom-class');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('spreads unknown props onto the root element', () => {
|
|
38
|
+
render(
|
|
39
|
+
<CardContainer aria-label="Cards" data-testid="container">
|
|
40
|
+
{content}
|
|
41
|
+
</CardContainer>,
|
|
42
|
+
);
|
|
43
|
+
expect(screen.getByTestId('container')).toHaveAttribute('aria-label', 'Cards');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('padding', () => {
|
|
48
|
+
it('has no padding modifier by default', () => {
|
|
49
|
+
render(<CardContainer data-testid="container">{content}</CardContainer>);
|
|
50
|
+
expect(screen.getByTestId('container')).not.toHaveClass('wds-card-container--padding-none');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('renders the padding-none modifier', () => {
|
|
54
|
+
render(
|
|
55
|
+
<CardContainer padding="none" data-testid="container">
|
|
56
|
+
{content}
|
|
57
|
+
</CardContainer>,
|
|
58
|
+
);
|
|
59
|
+
expect(screen.getByTestId('container')).toHaveClass('wds-card-container--padding-none');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('keeps the dashed border for the inactive spotlight without padding', () => {
|
|
63
|
+
render(
|
|
64
|
+
<CardContainer padding="none" spotlight="inactive" data-testid="container">
|
|
65
|
+
{content}
|
|
66
|
+
</CardContainer>,
|
|
67
|
+
);
|
|
68
|
+
expect(
|
|
69
|
+
screen.getByTestId('container').querySelector('.wds-card-container__border'),
|
|
70
|
+
).toBeInTheDocument();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe('spotlight', () => {
|
|
75
|
+
it('has no spotlight modifier by default', () => {
|
|
76
|
+
render(<CardContainer data-testid="container">{content}</CardContainer>);
|
|
77
|
+
const root = screen.getByTestId('container');
|
|
78
|
+
expect(root).not.toHaveClass('wds-card-container--active');
|
|
79
|
+
expect(root).not.toHaveClass('wds-card-container--inactive');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it.each<CardContainerSpotlight>(['active', 'inactive'])(
|
|
83
|
+
'renders the %s spotlight modifier',
|
|
84
|
+
(spotlight) => {
|
|
85
|
+
render(
|
|
86
|
+
<CardContainer spotlight={spotlight} data-testid="container">
|
|
87
|
+
{content}
|
|
88
|
+
</CardContainer>,
|
|
89
|
+
);
|
|
90
|
+
expect(screen.getByTestId('container')).toHaveClass(`wds-card-container--${spotlight}`);
|
|
91
|
+
},
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
it('draws a decorative dashed border for the inactive spotlight', () => {
|
|
95
|
+
render(
|
|
96
|
+
<CardContainer spotlight="inactive" data-testid="container">
|
|
97
|
+
{content}
|
|
98
|
+
</CardContainer>,
|
|
99
|
+
);
|
|
100
|
+
expect(
|
|
101
|
+
screen.getByTestId('container').querySelector('.wds-card-container__border'),
|
|
102
|
+
).toHaveAttribute('aria-hidden', 'true');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it.each<CardContainerSpotlight | undefined>(['active', undefined])(
|
|
106
|
+
'draws no dashed border for spotlight %s',
|
|
107
|
+
(spotlight) => {
|
|
108
|
+
render(
|
|
109
|
+
<CardContainer spotlight={spotlight} data-testid="container">
|
|
110
|
+
{content}
|
|
111
|
+
</CardContainer>,
|
|
112
|
+
);
|
|
113
|
+
const root = screen.getByTestId('container');
|
|
114
|
+
expect(root.querySelector('.wds-card-container__border')).not.toBeInTheDocument();
|
|
115
|
+
},
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe('interactive', () => {
|
|
120
|
+
it('is not interactive by default', () => {
|
|
121
|
+
render(<CardContainer data-testid="container">{content}</CardContainer>);
|
|
122
|
+
expect(screen.getByTestId('container')).not.toHaveClass('wds-card-container--interactive');
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('adds the interactive modifier without changing the element', () => {
|
|
126
|
+
render(
|
|
127
|
+
<CardContainer interactive data-testid="container">
|
|
128
|
+
<a href="/cards">{content}</a>
|
|
129
|
+
</CardContainer>,
|
|
130
|
+
);
|
|
131
|
+
const root = screen.getByTestId('container');
|
|
132
|
+
expect(root.tagName).toBe('DIV');
|
|
133
|
+
expect(root).toHaveClass('wds-card-container--interactive');
|
|
134
|
+
expect(root).not.toHaveAttribute('interactive');
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('spreads onClick onto the root element as a plain handler', async () => {
|
|
138
|
+
const onClick = jest.fn();
|
|
139
|
+
render(
|
|
140
|
+
<CardContainer data-testid="container" onClick={onClick}>
|
|
141
|
+
{content}
|
|
142
|
+
</CardContainer>,
|
|
143
|
+
);
|
|
144
|
+
const root = screen.getByTestId('container');
|
|
145
|
+
expect(root.tagName).toBe('DIV');
|
|
146
|
+
await userEvent.click(root);
|
|
147
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
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: children are stacked
|
|
8
|
+
* with no gap between them. For a card with a title and actions, use `CardWidget`.
|
|
9
|
+
*/
|
|
10
|
+
const CardContainer = forwardRef<HTMLElement, CardContainerProps>(
|
|
11
|
+
(
|
|
12
|
+
{
|
|
13
|
+
spotlight,
|
|
14
|
+
padding = 'md',
|
|
15
|
+
interactive = false,
|
|
16
|
+
children,
|
|
17
|
+
as: Element = 'div',
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
},
|
|
21
|
+
ref,
|
|
22
|
+
) => {
|
|
23
|
+
return (
|
|
24
|
+
<Element
|
|
25
|
+
ref={ref as React.Ref<HTMLElement & HTMLDivElement>}
|
|
26
|
+
className={clsx(
|
|
27
|
+
'wds-card-container',
|
|
28
|
+
spotlight && `wds-card-container--${spotlight}`,
|
|
29
|
+
padding === 'none' && 'wds-card-container--padding-none',
|
|
30
|
+
interactive && 'wds-card-container--interactive',
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
|
|
37
|
+
{spotlight === 'inactive' && (
|
|
38
|
+
<span aria-hidden="true" className="wds-card-container__border">
|
|
39
|
+
<svg>
|
|
40
|
+
<rect />
|
|
41
|
+
</svg>
|
|
42
|
+
</span>
|
|
43
|
+
)}
|
|
44
|
+
</Element>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
CardContainer.displayName = 'CardContainer';
|
|
50
|
+
|
|
51
|
+
export default CardContainer;
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
/**
|
|
15
|
+
* - `md` — 8px, and 16px from the `md` breakpoint up.
|
|
16
|
+
* - `none` — content runs to the card's edges.
|
|
17
|
+
*/
|
|
18
|
+
export type CardContainerPadding = 'md' | 'none';
|
|
19
|
+
|
|
20
|
+
export interface CardContainerProps extends HTMLAttributes<HTMLElement> {
|
|
21
|
+
/**
|
|
22
|
+
* Highlights the card as live content (`active`) or as a feature not set up yet (`inactive`).
|
|
23
|
+
* Leave unset for a flat card.
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
spotlight?: CardContainerSpotlight;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Space between the card's edge and its content. `none` lets content such as images or charts
|
|
30
|
+
* run to the card's edges, clipped to its rounded corners. Anything clipped at the edges
|
|
31
|
+
* includes focus rings, so use `none` for non-interactive content, and keep lists on `md`.
|
|
32
|
+
* @default 'md'
|
|
33
|
+
*/
|
|
34
|
+
padding?: CardContainerPadding;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Content, stacked with no gap.
|
|
38
|
+
* @default undefined
|
|
39
|
+
*/
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Element rendered as the root. Use `section` when the card is a standalone, major part of the
|
|
44
|
+
* page, or `article` for self-contained content such as a feed item. Leave most cards as a `div`,
|
|
45
|
+
* so a page of cards doesn't fill the landmark list with a region per card.
|
|
46
|
+
* @default 'div'
|
|
47
|
+
*/
|
|
48
|
+
as?: 'div' | 'section' | 'article';
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Shows the card as hovered or pressed while a direct child link (with an `href`) or enabled
|
|
52
|
+
* button is, such as a link that fills the card, and as hovered while that child has keyboard
|
|
53
|
+
* focus. The rest of the card,
|
|
54
|
+
* and controls nested deeper, don't trigger the states, so the card is only shown as something
|
|
55
|
+
* to act on where it can be clicked.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
interactive?: boolean;
|
|
59
|
+
|
|
60
|
+
className?: string;
|
|
61
|
+
'data-testid'?: string;
|
|
62
|
+
}
|