@transferwise/components 46.129.0 → 46.130.1
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/accordion/Accordion.js.map +1 -1
- package/build/accordion/Accordion.mjs.map +1 -1
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +1 -1
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +1 -1
- package/build/alert/Alert.mjs.map +1 -1
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/body/Body.js.map +1 -1
- package/build/body/Body.mjs.map +1 -1
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs.map +1 -1
- package/build/checkboxButton/CheckboxButton.js.map +1 -1
- package/build/checkboxButton/CheckboxButton.mjs.map +1 -1
- package/build/checkboxOption/CheckboxOption.js.map +1 -1
- package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/{card/Card.js → baseCard/BaseCard.js} +4 -4
- package/build/common/baseCard/BaseCard.js.map +1 -0
- package/build/common/{card/Card.mjs → baseCard/BaseCard.mjs} +4 -4
- package/build/common/baseCard/BaseCard.mjs.map +1 -0
- package/build/common/propsValues/type.js +1 -1
- package/build/common/propsValues/type.js.map +1 -1
- package/build/common/propsValues/type.mjs +1 -1
- package/build/common/propsValues/type.mjs.map +1 -1
- package/build/common/propsValues/typography.js +1 -1
- package/build/common/propsValues/typography.js.map +1 -1
- package/build/common/propsValues/typography.mjs +1 -1
- package/build/common/propsValues/typography.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +68 -3
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +69 -4
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs.map +1 -1
- package/build/iconButton/IconButton.js.map +1 -1
- package/build/iconButton/IconButton.mjs.map +1 -1
- package/build/index.js +4 -4
- package/build/index.mjs +1 -1
- package/build/legacylistItem/LegacyListItem.js.map +1 -1
- package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
- package/build/list/List.js.map +1 -1
- package/build/list/List.mjs.map +1 -1
- package/build/listItem/Button/ListItemButton.js.map +1 -1
- package/build/listItem/Button/ListItemButton.mjs.map +1 -1
- package/build/listItem/IconButton/ListItemIconButton.js.map +1 -1
- package/build/listItem/IconButton/ListItemIconButton.mjs.map +1 -1
- package/build/listItem/Image/ListItemImage.js.map +1 -1
- package/build/listItem/Image/ListItemImage.mjs.map +1 -1
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs.map +1 -1
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs.map +1 -1
- package/build/main.css +119 -101
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs.map +1 -1
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -1
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/promoCard/PromoCard.js +2 -2
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCard.mjs +2 -2
- package/build/promoCard/PromoCard.mjs.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/radioOption/RadioOption.js.map +1 -1
- package/build/radioOption/RadioOption.mjs.map +1 -1
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/criticalBanner/CriticalCommsBanner.css +33 -15
- package/build/styles/listItem/ListItem.css +1 -1
- package/build/styles/main.css +119 -101
- package/build/styles/sentimentSurface/SentimentSurface.css +36 -36
- package/build/summary/Summary.js +1 -1
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +1 -1
- package/build/summary/Summary.mjs.map +1 -1
- package/build/switchOption/SwitchOption.js +1 -1
- package/build/switchOption/SwitchOption.js.map +1 -1
- package/build/switchOption/SwitchOption.mjs +1 -1
- package/build/switchOption/SwitchOption.mjs.map +1 -1
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/accordion/Accordion.d.ts +8 -2
- package/build/types/accordion/Accordion.d.ts.map +1 -1
- package/build/types/actionButton/ActionButton.d.ts +6 -4
- package/build/types/actionButton/ActionButton.d.ts.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts +1 -1
- package/build/types/alert/Alert.d.ts +5 -2
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/avatar/Avatar.d.ts +4 -0
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/avatarLayout/AvatarLayout.d.ts +5 -1
- package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
- package/build/types/badge/Badge.d.ts +2 -0
- package/build/types/badge/Badge.d.ts.map +1 -1
- package/build/types/body/Body.d.ts +2 -6
- package/build/types/body/Body.d.ts.map +1 -1
- package/build/types/button/Button.types.d.ts +4 -1
- package/build/types/button/Button.types.d.ts.map +1 -1
- package/build/types/button/LegacyButton.d.ts +4 -4
- package/build/types/card/Card.d.ts +2 -1
- package/build/types/card/Card.d.ts.map +1 -1
- package/build/types/checkboxButton/CheckboxButton.d.ts +2 -0
- package/build/types/checkboxButton/CheckboxButton.d.ts.map +1 -1
- package/build/types/checkboxOption/CheckboxOption.d.ts +1 -1
- package/build/types/circularButton/CircularButton.d.ts +1 -1
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/common/{card/Card.d.ts → baseCard/BaseCard.d.ts} +8 -8
- package/build/types/common/baseCard/BaseCard.d.ts.map +1 -0
- package/build/types/common/baseCard/index.d.ts +3 -0
- package/build/types/common/baseCard/index.d.ts.map +1 -0
- package/build/types/common/propsValues/type.d.ts +1 -1
- package/build/types/common/propsValues/typography.d.ts +2 -2
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts +4 -1
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
- package/build/types/criticalBanner/index.d.ts +1 -0
- package/build/types/criticalBanner/index.d.ts.map +1 -1
- package/build/types/dateInput/DateInput.d.ts +5 -0
- package/build/types/dateInput/DateInput.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts +6 -0
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/drawer/Drawer.d.ts +8 -2
- package/build/types/drawer/Drawer.d.ts.map +1 -1
- package/build/types/field/Field.d.ts +5 -2
- package/build/types/field/Field.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts +3 -0
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/header/Header.d.ts +5 -1
- package/build/types/header/Header.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +6 -0
- package/build/types/iconButton/IconButton.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/legacylistItem/LegacyListItem.d.ts +1 -1
- package/build/types/list/List.d.ts +1 -0
- package/build/types/list/List.d.ts.map +1 -1
- package/build/types/listItem/Button/ListItemButton.d.ts +4 -0
- package/build/types/listItem/Button/ListItemButton.d.ts.map +1 -1
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts +3 -1
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts.map +1 -1
- package/build/types/listItem/Image/ListItemImage.d.ts +2 -0
- package/build/types/listItem/Image/ListItemImage.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts +3 -0
- package/build/types/listItem/ListItem.d.ts.map +1 -1
- package/build/types/loader/Loader.d.ts +5 -1
- package/build/types/loader/Loader.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts +4 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/modal/Modal.d.ts +6 -0
- package/build/types/modal/Modal.d.ts.map +1 -1
- package/build/types/navigationOption/NavigationOption.d.ts +1 -1
- package/build/types/navigationOptionsList/NavigationOptionsList.d.ts +1 -1
- package/build/types/nudge/Nudge.d.ts +1 -1
- package/build/types/nudge/Nudge.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts +7 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/popover/Popover.d.ts +1 -0
- package/build/types/popover/Popover.d.ts.map +1 -1
- package/build/types/processIndicator/ProcessIndicator.d.ts +2 -0
- package/build/types/processIndicator/ProcessIndicator.d.ts.map +1 -1
- package/build/types/promoCard/PromoCard.d.ts +3 -3
- package/build/types/promoCard/PromoCard.d.ts.map +1 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +8 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts +1 -0
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -1
- package/build/types/radioOption/RadioOption.d.ts +1 -1
- package/build/types/select/Select.d.ts +4 -0
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts +3 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/types/summary/Summary.d.ts +7 -4
- package/build/types/summary/Summary.d.ts.map +1 -1
- package/build/types/switchOption/SwitchOption.d.ts +1 -1
- package/build/types/tabs/Tabs.d.ts +2 -0
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts +14 -1
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts +6 -0
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts +10 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts +3 -0
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +2 -2
- package/src/accordion/Accordion.tsx +8 -2
- package/src/actionButton/ActionButton.tsx +4 -3
- package/src/actionOption/ActionOption.tsx +1 -1
- package/src/alert/Alert.tsx +5 -2
- package/src/avatar/Avatar.tsx +4 -0
- package/src/avatarLayout/AvatarLayout.tsx +5 -1
- package/src/badge/Badge.tsx +2 -0
- package/src/body/Body.tsx +2 -6
- package/src/button/Button.types.ts +4 -1
- package/src/button/LegacyButton.tsx +4 -4
- package/src/card/Card.story.tsx +3 -2
- package/src/card/Card.tsx +2 -1
- package/src/checkboxButton/CheckboxButton.tsx +1 -0
- package/src/checkboxOption/CheckboxOption.tsx +1 -1
- package/src/circularButton/CircularButton.tsx +1 -2
- package/src/common/{card/Card.less → baseCard/BaseCard.less} +1 -1
- package/src/common/{card/Card.story.tsx → baseCard/BaseCard.story.tsx} +5 -5
- package/src/common/{card/Card.test.tsx → baseCard/BaseCard.test.tsx} +11 -12
- package/src/common/{card/Card.tsx → baseCard/BaseCard.tsx} +9 -9
- package/src/common/baseCard/index.ts +2 -0
- package/src/common/propsValues/type.ts +1 -1
- package/src/common/propsValues/typography.ts +2 -2
- package/src/criticalBanner/CriticalCommsBanner.css +33 -15
- package/src/criticalBanner/CriticalCommsBanner.less +46 -36
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +9 -15
- package/src/criticalBanner/CriticalCommsBanner.test.story.tsx +70 -0
- package/src/criticalBanner/CriticalCommsBanner.test.tsx +66 -0
- package/src/criticalBanner/CriticalCommsBanner.tsx +54 -5
- package/src/criticalBanner/index.ts +1 -0
- package/src/dateInput/DateInput.tsx +5 -0
- package/src/dimmer/Dimmer.tsx +6 -0
- package/src/drawer/Drawer.tsx +8 -2
- package/src/field/Field.tsx +5 -2
- package/src/flowNavigation/FlowNavigation.tsx +3 -0
- package/src/header/Header.tsx +5 -1
- package/src/iconButton/IconButton.tsx +3 -0
- package/src/index.ts +2 -1
- package/src/legacylistItem/LegacyListItem.tsx +1 -1
- package/src/list/List.tsx +1 -0
- package/src/listItem/Button/ListItemButton.tsx +2 -0
- package/src/listItem/IconButton/ListItemIconButton.tsx +3 -1
- package/src/listItem/Image/ListItemImage.tsx +2 -0
- package/src/listItem/ListItem.css +1 -1
- package/src/listItem/ListItem.less +4 -2
- package/src/listItem/ListItem.tsx +2 -0
- package/src/listItem/_stories/Breakpoints/ListItem.noMedia.test.story.tsx +62 -0
- package/src/listItem/_stories/Breakpoints/ListItem.sideMedia.test.story.tsx +62 -0
- package/src/listItem/_stories/Breakpoints/ListItem.stackedMedia.test.story.tsx +62 -0
- package/src/listItem/_stories/ListItem.story.tsx +3 -2
- package/src/loader/Loader.tsx +6 -2
- package/src/logo/Logo.tsx +4 -1
- package/src/main.css +119 -101
- package/src/main.less +2 -2
- package/src/modal/Modal.tsx +6 -0
- package/src/navigationOption/NavigationOption.tsx +1 -1
- package/src/navigationOptionsList/NavigationOptionsList.tsx +1 -1
- package/src/nudge/Nudge.tsx +1 -1
- package/src/phoneNumberInput/PhoneNumberInput.tsx +7 -1
- package/src/popover/Popover.tsx +1 -0
- package/src/processIndicator/ProcessIndicator.tsx +2 -0
- package/src/promoCard/PromoCard.tsx +6 -5
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +8 -1
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +1 -0
- package/src/radioOption/RadioOption.tsx +1 -1
- package/src/select/Select.tsx +4 -0
- package/src/sentimentSurface/SentimentSurface.css +36 -36
- package/src/sentimentSurface/SentimentSurface.less +12 -12
- package/src/statusIcon/StatusIcon.tsx +3 -1
- package/src/summary/Summary.tsx +7 -4
- package/src/switchOption/SwitchOption.tsx +1 -1
- package/src/tabs/Tabs.tsx +2 -0
- package/src/typeahead/Typeahead.tsx +14 -2
- package/src/upload/Upload.tsx +6 -0
- package/src/uploadInput/UploadInput.tsx +12 -4
- package/src/withDisplayFormat/WithDisplayFormat.tsx +3 -0
- package/build/common/card/Card.js.map +0 -1
- package/build/common/card/Card.mjs.map +0 -1
- package/build/types/common/card/Card.d.ts.map +0 -1
- package/build/types/common/card/index.d.ts +0 -3
- package/build/types/common/card/index.d.ts.map +0 -1
- package/src/common/card/index.ts +0 -2
- /package/build/styles/common/{card/Card.css → baseCard/BaseCard.css} +0 -0
- /package/src/common/{card/Card.css → baseCard/BaseCard.css} +0 -0
|
@@ -4,7 +4,7 @@ import React, { forwardRef, FunctionComponent, useEffect, useId, useState } from
|
|
|
4
4
|
|
|
5
5
|
import Body from '../body';
|
|
6
6
|
import { Typography } from '../common';
|
|
7
|
-
import
|
|
7
|
+
import BaseCard, { type BaseCardProps } from '../common/baseCard';
|
|
8
8
|
import Display from '../display';
|
|
9
9
|
import Image from '../image/Image';
|
|
10
10
|
import Title from '../title';
|
|
@@ -82,7 +82,7 @@ export interface PromoCardCommonProps {
|
|
|
82
82
|
ref?: ReferenceType;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
export interface PromoCardLinkProps extends PromoCardCommonProps, Omit<
|
|
85
|
+
export interface PromoCardLinkProps extends PromoCardCommonProps, Omit<BaseCardProps, 'children'> {
|
|
86
86
|
/**
|
|
87
87
|
* Optional prop to prompts a user to save the linked URL instead of
|
|
88
88
|
* navigating to it
|
|
@@ -121,7 +121,8 @@ export interface PromoCardLinkProps extends PromoCardCommonProps, Omit<CardProps
|
|
|
121
121
|
value?: never;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
export interface PromoCardCheckedProps
|
|
124
|
+
export interface PromoCardCheckedProps
|
|
125
|
+
extends PromoCardCommonProps, Omit<BaseCardProps, 'children'> {
|
|
125
126
|
/** Specify the initial checked attribute of the PromoCard */
|
|
126
127
|
defaultChecked?: boolean;
|
|
127
128
|
|
|
@@ -368,7 +369,7 @@ const PromoCard: FunctionComponent<PromoCardProps> = forwardRef(
|
|
|
368
369
|
}, [defaultChecked, isChecked]);
|
|
369
370
|
|
|
370
371
|
return (
|
|
371
|
-
<
|
|
372
|
+
<BaseCard {...commonProps} {...checkedProps} {...props}>
|
|
372
373
|
{(value === state || checked) && (
|
|
373
374
|
<span className="np-Card-check">
|
|
374
375
|
<Check size={24} aria-hidden="true" />
|
|
@@ -386,7 +387,7 @@ const PromoCard: FunctionComponent<PromoCardProps> = forwardRef(
|
|
|
386
387
|
)}
|
|
387
388
|
|
|
388
389
|
<PromoCardIndicator label={indicatorLabel} icon={getIconType()} isSmall={isSmall} />
|
|
389
|
-
</
|
|
390
|
+
</BaseCard>
|
|
390
391
|
);
|
|
391
392
|
},
|
|
392
393
|
) as PolymorphicPromoCard;
|
|
@@ -16,6 +16,7 @@ import { useScreenSize } from '../../common/hooks/useScreenSize';
|
|
|
16
16
|
export type ActionPromptProps = {
|
|
17
17
|
title: ReactNode;
|
|
18
18
|
description?: ReactNode;
|
|
19
|
+
/** @default {} */
|
|
19
20
|
media?: {
|
|
20
21
|
imgSrc?: string;
|
|
21
22
|
avatar?: Pick<AvatarViewProps, 'imgSrc' | 'profileName' | 'profileType'> & {
|
|
@@ -32,7 +33,13 @@ export type ActionPromptProps = {
|
|
|
32
33
|
label: ButtonProps['children'];
|
|
33
34
|
};
|
|
34
35
|
'aria-label'?: AriaAttributes['aria-label'];
|
|
35
|
-
} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | '
|
|
36
|
+
} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | 'onDismiss'> & {
|
|
37
|
+
/**
|
|
38
|
+
* The sentiment determines the colour scheme
|
|
39
|
+
* @default 'neutral'
|
|
40
|
+
*/
|
|
41
|
+
sentiment?: PrimitivePromptProps['sentiment'];
|
|
42
|
+
};
|
|
36
43
|
|
|
37
44
|
/**
|
|
38
45
|
* Use an action prompt for optional feedback that doesn't require immediate action, such as feature upsells, warnings, or suggestions. These prompts are typically used outside of core product flows (e.g., Launchpad, Recipient, or Transaction screens) and can be addressed at the user's convenience.
|
|
@@ -9,6 +9,7 @@ import { PrimitivePrompt } from '../PrimitivePrompt';
|
|
|
9
9
|
export type InlinePromptProps = {
|
|
10
10
|
/**
|
|
11
11
|
* The sentiment determines the colour scheme
|
|
12
|
+
* @default Sentiment.POSITIVE
|
|
12
13
|
*/
|
|
13
14
|
sentiment?:
|
|
14
15
|
| `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`
|
|
@@ -17,7 +17,7 @@ export interface RadioOptionProps<T extends string | number = string>
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* @deprecated
|
|
20
|
+
* @deprecated Use `<ListItem />` instead.
|
|
21
21
|
* @deprecatedSince 46.104.0
|
|
22
22
|
* @see [Source](../listItem/ListItem.tsx)
|
|
23
23
|
* @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)
|
package/src/select/Select.tsx
CHANGED
|
@@ -106,7 +106,9 @@ export interface SelectProps {
|
|
|
106
106
|
inverse?: boolean;
|
|
107
107
|
dropdownRight?: `${Size.EXTRA_SMALL | Size.SMALL | Size.MEDIUM | Size.LARGE | Size.EXTRA_LARGE}`;
|
|
108
108
|
dropdownWidth?: `${Size.SMALL | Size.MEDIUM | Size.LARGE}`;
|
|
109
|
+
/** @default 'md' */
|
|
109
110
|
size?: `${Size.SMALL | Size.MEDIUM | Size.LARGE}`;
|
|
111
|
+
/** @default true */
|
|
110
112
|
block?: boolean;
|
|
111
113
|
selected?: SelectOptionItem;
|
|
112
114
|
/**
|
|
@@ -116,8 +118,10 @@ export interface SelectProps {
|
|
|
116
118
|
*/
|
|
117
119
|
search?: boolean | ((option: SelectItemWithPlaceholder, searchValue: string) => boolean);
|
|
118
120
|
options: SelectItem[];
|
|
121
|
+
/** @default '' */
|
|
119
122
|
searchValue?: string;
|
|
120
123
|
searchPlaceholder?: string;
|
|
124
|
+
/** @default {} */
|
|
121
125
|
classNames?: Record<string, string>;
|
|
122
126
|
dropdownUp?: boolean;
|
|
123
127
|
buttonProps?: Extract<ButtonProps, { as?: 'button' }>;
|
|
@@ -226,12 +226,12 @@
|
|
|
226
226
|
.np-theme-platform.wds-sentiment-surface-success-elevated,
|
|
227
227
|
.np-theme-personal--bright-green.wds-sentiment-surface-success-elevated,
|
|
228
228
|
.np-theme-business--bright-green.wds-sentiment-surface-success-elevated {
|
|
229
|
-
--color-sentiment-content-primary: #
|
|
230
|
-
--color-sentiment-content-primary-hover: #
|
|
231
|
-
--color-sentiment-content-primary-active: #
|
|
232
|
-
--color-sentiment-interactive-primary: #
|
|
233
|
-
--color-sentiment-interactive-primary-hover: #
|
|
234
|
-
--color-sentiment-interactive-primary-active: #
|
|
229
|
+
--color-sentiment-content-primary: #CEF1B8;
|
|
230
|
+
--color-sentiment-content-primary-hover: #E0FFCC;
|
|
231
|
+
--color-sentiment-content-primary-active: #E1F4D4;
|
|
232
|
+
--color-sentiment-interactive-primary: #CEF1B8;
|
|
233
|
+
--color-sentiment-interactive-primary-hover: #E0FFCC;
|
|
234
|
+
--color-sentiment-interactive-primary-active: #E1F4D4;
|
|
235
235
|
--color-sentiment-interactive-secondary: #054D28;
|
|
236
236
|
--color-sentiment-interactive-secondary-hover: #043A1E;
|
|
237
237
|
--color-sentiment-interactive-secondary-active: #022614;
|
|
@@ -250,24 +250,24 @@
|
|
|
250
250
|
.np-theme-personal--forest-green.wds-sentiment-surface-success-base,
|
|
251
251
|
.np-theme-business--forest-green.wds-sentiment-surface-success-base,
|
|
252
252
|
.np-theme-platform--forest-green.wds-sentiment-surface-success-base {
|
|
253
|
-
--color-sentiment-content-primary: #
|
|
254
|
-
--color-sentiment-content-primary-hover: #
|
|
255
|
-
--color-sentiment-content-primary-active: #
|
|
256
|
-
--color-sentiment-interactive-primary: #
|
|
257
|
-
--color-sentiment-interactive-primary-hover: #
|
|
258
|
-
--color-sentiment-interactive-primary-active: #
|
|
259
|
-
--color-sentiment-interactive-secondary: #
|
|
260
|
-
--color-sentiment-interactive-secondary-hover: #
|
|
261
|
-
--color-sentiment-interactive-secondary-active: #
|
|
262
|
-
--color-sentiment-interactive-secondary-neutral: #
|
|
263
|
-
--color-sentiment-interactive-secondary-neutral-hover: #
|
|
264
|
-
--color-sentiment-interactive-secondary-neutral-active: #
|
|
265
|
-
--color-sentiment-interactive-control: #
|
|
266
|
-
--color-sentiment-interactive-control-hover: #
|
|
267
|
-
--color-sentiment-interactive-control-active: #
|
|
268
|
-
--color-sentiment-background-surface: #
|
|
269
|
-
--color-sentiment-background-surface-hover: #
|
|
270
|
-
--color-sentiment-background-surface-active: #
|
|
253
|
+
--color-sentiment-content-primary: #CEF1B8;
|
|
254
|
+
--color-sentiment-content-primary-hover: #E0FFCC;
|
|
255
|
+
--color-sentiment-content-primary-active: #E1F4D4;
|
|
256
|
+
--color-sentiment-interactive-primary: #CEF1B8;
|
|
257
|
+
--color-sentiment-interactive-primary-hover: #E0FFCC;
|
|
258
|
+
--color-sentiment-interactive-primary-active: #E1F4D4;
|
|
259
|
+
--color-sentiment-interactive-secondary: #054D28;
|
|
260
|
+
--color-sentiment-interactive-secondary-hover: #043A1E;
|
|
261
|
+
--color-sentiment-interactive-secondary-active: #022614;
|
|
262
|
+
--color-sentiment-interactive-secondary-neutral: #256A43;
|
|
263
|
+
--color-sentiment-interactive-secondary-neutral-hover: #2A794C;
|
|
264
|
+
--color-sentiment-interactive-secondary-neutral-active: #329057;
|
|
265
|
+
--color-sentiment-interactive-control: #054D28;
|
|
266
|
+
--color-sentiment-interactive-control-hover: #043A1E;
|
|
267
|
+
--color-sentiment-interactive-control-active: #022614;
|
|
268
|
+
--color-sentiment-background-surface: #054D28;
|
|
269
|
+
--color-sentiment-background-surface-hover: #043A1E;
|
|
270
|
+
--color-sentiment-background-surface-active: #022614;
|
|
271
271
|
}
|
|
272
272
|
.np-theme-personal--dark.wds-sentiment-surface-success-elevated,
|
|
273
273
|
.np-theme-business--dark.wds-sentiment-surface-success-elevated,
|
|
@@ -448,18 +448,18 @@
|
|
|
448
448
|
--color-sentiment-interactive-primary: #E0F7F7;
|
|
449
449
|
--color-sentiment-interactive-primary-hover: #CAF1F1;
|
|
450
450
|
--color-sentiment-interactive-primary-active: #B6ECEC;
|
|
451
|
-
--color-sentiment-interactive-secondary: #
|
|
452
|
-
--color-sentiment-interactive-secondary-hover: #
|
|
453
|
-
--color-sentiment-interactive-secondary-active: #
|
|
454
|
-
--color-sentiment-interactive-secondary-neutral: #
|
|
455
|
-
--color-sentiment-interactive-secondary-neutral-hover: #
|
|
456
|
-
--color-sentiment-interactive-secondary-neutral-active: #
|
|
457
|
-
--color-sentiment-interactive-control: #
|
|
458
|
-
--color-sentiment-interactive-control-hover: #
|
|
459
|
-
--color-sentiment-interactive-control-active: #
|
|
460
|
-
--color-sentiment-background-surface: #
|
|
461
|
-
--color-sentiment-background-surface-hover: #
|
|
462
|
-
--color-sentiment-background-surface-active: #
|
|
451
|
+
--color-sentiment-interactive-secondary: #054D4D;
|
|
452
|
+
--color-sentiment-interactive-secondary-hover: #043A3A;
|
|
453
|
+
--color-sentiment-interactive-secondary-active: #022626;
|
|
454
|
+
--color-sentiment-interactive-secondary-neutral: #1F6161;
|
|
455
|
+
--color-sentiment-interactive-secondary-neutral-hover: #247070;
|
|
456
|
+
--color-sentiment-interactive-secondary-neutral-active: #298080;
|
|
457
|
+
--color-sentiment-interactive-control: #054D4D;
|
|
458
|
+
--color-sentiment-interactive-control-hover: #043A3A;
|
|
459
|
+
--color-sentiment-interactive-control-active: #022626;
|
|
460
|
+
--color-sentiment-background-surface: #054D4D;
|
|
461
|
+
--color-sentiment-background-surface-hover: #043A3A;
|
|
462
|
+
--color-sentiment-background-surface-active: #022626;
|
|
463
463
|
}
|
|
464
464
|
.np-theme-personal--dark.wds-sentiment-surface-proposition-elevated,
|
|
465
465
|
.np-theme-business--dark.wds-sentiment-surface-proposition-elevated,
|
|
@@ -133,8 +133,8 @@
|
|
|
133
133
|
}
|
|
134
134
|
&-elevated {
|
|
135
135
|
.sentiment-surface-tokens(
|
|
136
|
-
#
|
|
137
|
-
#
|
|
136
|
+
#CEF1B8, #E0FFCC, #E1F4D4, // content-primary
|
|
137
|
+
#CEF1B8, #E0FFCC, #E1F4D4, // interactive-primary
|
|
138
138
|
#054D28, #043A1E, #022614, // interactive-secondary
|
|
139
139
|
#256A43, #2A794C, #329057, // interactive-secondary-neutral
|
|
140
140
|
#054D28, #043A1E, #022614, // interactive-control
|
|
@@ -150,12 +150,12 @@
|
|
|
150
150
|
.np-theme-platform--forest-green& {
|
|
151
151
|
&-base {
|
|
152
152
|
.sentiment-surface-tokens(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
#CEF1B8, #E0FFCC, #E1F4D4, // content-primary
|
|
154
|
+
#CEF1B8, #E0FFCC, #E1F4D4, // interactive-primary
|
|
155
|
+
#054D28, #043A1E, #022614, // interactive-secondary
|
|
156
|
+
#256A43, #2A794C, #329057, // interactive-secondary-neutral
|
|
157
|
+
#054D28, #043A1E, #022614, // interactive-control
|
|
158
|
+
#054D28, #043A1E, #022614 // background-surface
|
|
159
159
|
);
|
|
160
160
|
}
|
|
161
161
|
&-elevated {
|
|
@@ -262,10 +262,10 @@
|
|
|
262
262
|
.sentiment-surface-tokens(
|
|
263
263
|
#FFFFFF, #EAF9F9, #D5F4F4, // content-primary
|
|
264
264
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-primary
|
|
265
|
-
#
|
|
266
|
-
#
|
|
267
|
-
#
|
|
268
|
-
#
|
|
265
|
+
#054D4D, #043A3A, #022626, // interactive-secondary
|
|
266
|
+
#1F6161, #247070, #298080, // interactive-secondary-neutral
|
|
267
|
+
#054D4D, #043A3A, #022626, // interactive-control
|
|
268
|
+
#054D4D, #043A3A, #022626 // background-surface
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
271
|
&-elevated {
|
|
@@ -11,7 +11,7 @@ import { useMedia } from '../common/hooks/useMedia';
|
|
|
11
11
|
import messages from './StatusIcon.messages';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @deprecated
|
|
14
|
+
* @deprecated Use `16 | 24 | 32 | 40 | 48 | 56 | 72` instead.
|
|
15
15
|
*/
|
|
16
16
|
type LegacySizes = SizeSmall | SizeMedium | SizeLarge;
|
|
17
17
|
|
|
@@ -19,7 +19,9 @@ export type StatusIconSentiment = Sentiment | Status.PENDING;
|
|
|
19
19
|
|
|
20
20
|
export type StatusIconProps = {
|
|
21
21
|
id?: string;
|
|
22
|
+
/** @default 'neutral' */
|
|
22
23
|
sentiment?: `${StatusIconSentiment}`;
|
|
24
|
+
/** @default 40 */
|
|
23
25
|
size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;
|
|
24
26
|
/**
|
|
25
27
|
* Override for the sentiment's-derived, default, accessible
|
package/src/summary/Summary.tsx
CHANGED
|
@@ -47,6 +47,7 @@ export interface Props {
|
|
|
47
47
|
action?: AlertAction;
|
|
48
48
|
/**
|
|
49
49
|
* Decides which html element should wrap the Summary
|
|
50
|
+
* @default 'div'
|
|
50
51
|
*/
|
|
51
52
|
as?: ElementType;
|
|
52
53
|
/**
|
|
@@ -54,7 +55,8 @@ export interface Props {
|
|
|
54
55
|
*/
|
|
55
56
|
className?: string;
|
|
56
57
|
/**
|
|
57
|
-
* @deprecated
|
|
58
|
+
* @deprecated Use `description` instead.
|
|
59
|
+
* @default null
|
|
58
60
|
*/
|
|
59
61
|
content?: ReactNode;
|
|
60
62
|
/**
|
|
@@ -62,7 +64,7 @@ export interface Props {
|
|
|
62
64
|
*/
|
|
63
65
|
description?: ReactNode;
|
|
64
66
|
/**
|
|
65
|
-
* @deprecated
|
|
67
|
+
* @deprecated Use `info` instead.
|
|
66
68
|
*/
|
|
67
69
|
help?: {
|
|
68
70
|
content: ReactNode;
|
|
@@ -73,7 +75,8 @@ export interface Props {
|
|
|
73
75
|
*/
|
|
74
76
|
info?: Pick<InfoProps, 'aria-label' | 'content' | 'onClick' | 'presentation' | 'title'>;
|
|
75
77
|
/**
|
|
76
|
-
* @deprecated
|
|
78
|
+
* @deprecated Use `icon` instead.
|
|
79
|
+
* @default null
|
|
77
80
|
*/
|
|
78
81
|
illustration?: ReactNode;
|
|
79
82
|
/**
|
|
@@ -91,7 +94,7 @@ export interface Props {
|
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
/**
|
|
94
|
-
* @deprecated
|
|
97
|
+
* @deprecated Use `<ListItem />` instead.
|
|
95
98
|
* @deprecatedSince 46.104.0
|
|
96
99
|
* @see [Source](../listItem/ListItem.tsx)
|
|
97
100
|
* @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)
|
|
@@ -27,7 +27,7 @@ const stopPropagation = (event?: MouseEvent<HTMLSpanElement>) => {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* @deprecated
|
|
30
|
+
* @deprecated Use `<ListItem />` instead.
|
|
31
31
|
* @deprecatedSince 46.104.0
|
|
32
32
|
* @see [Source](../listItem/ListItem.tsx)
|
|
33
33
|
* @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)
|
package/src/tabs/Tabs.tsx
CHANGED
|
@@ -28,8 +28,10 @@ export interface TabsProps {
|
|
|
28
28
|
tabs: TabItem[];
|
|
29
29
|
selected: number;
|
|
30
30
|
name: string;
|
|
31
|
+
/** @default true */
|
|
31
32
|
changeTabOnSwipe?: boolean;
|
|
32
33
|
className?: string;
|
|
34
|
+
/** @default 'block' */
|
|
33
35
|
headerWidth?: `${Width}`;
|
|
34
36
|
onTabSelect: (index: number) => void;
|
|
35
37
|
}
|
|
@@ -40,7 +40,7 @@ export interface TypeaheadProps<T> extends Partial<WrappedComponentProps> {
|
|
|
40
40
|
name: string;
|
|
41
41
|
addon?: ReactNode;
|
|
42
42
|
/**
|
|
43
|
-
* @deprecated
|
|
43
|
+
* @deprecated Use [`Field`](?path=/docs/forms-field--docs) component and its `message` and `sentiment` props instead.
|
|
44
44
|
* @deprecated `error`, `info` and `success` are deprecated as alert types and will be soon removed.
|
|
45
45
|
*/
|
|
46
46
|
alert?: {
|
|
@@ -51,24 +51,36 @@ export interface TypeaheadProps<T> extends Partial<WrappedComponentProps> {
|
|
|
51
51
|
| `${Sentiment.INFO}`
|
|
52
52
|
| `${Sentiment.SUCCESS}`;
|
|
53
53
|
};
|
|
54
|
+
/** @default false */
|
|
54
55
|
allowNew?: boolean;
|
|
56
|
+
/** @default true */
|
|
55
57
|
autoFillOnBlur?: boolean;
|
|
58
|
+
/** @default false */
|
|
56
59
|
autoFocus?: boolean;
|
|
60
|
+
/** @default [] */
|
|
57
61
|
chipSeparators?: readonly string[];
|
|
62
|
+
/** @default true */
|
|
58
63
|
clearable?: boolean;
|
|
59
64
|
footer?: ReactNode;
|
|
65
|
+
/** @default [] */
|
|
60
66
|
initialValue?: readonly TypeaheadOption<T>[];
|
|
67
|
+
/** @default 'new-password' */
|
|
61
68
|
inputAutoComplete?: string;
|
|
62
69
|
maxHeight?: number;
|
|
70
|
+
/** @default 3 */
|
|
63
71
|
minQueryLength?: number;
|
|
64
72
|
placeholder?: string;
|
|
73
|
+
/** @default false */
|
|
65
74
|
multiple?: boolean;
|
|
66
75
|
options: readonly TypeaheadOption<T>[];
|
|
76
|
+
/** @default 200 */
|
|
67
77
|
searchDelay?: number;
|
|
78
|
+
/** @default true */
|
|
68
79
|
showSuggestions?: boolean;
|
|
80
|
+
/** @default true */
|
|
69
81
|
showNewEntry?: boolean;
|
|
82
|
+
/** @default 'md' */
|
|
70
83
|
size?: SizeMedium | SizeLarge;
|
|
71
|
-
|
|
72
84
|
onBlur?: () => void;
|
|
73
85
|
onChange: (options: TypeaheadOption<T>[]) => void;
|
|
74
86
|
onFocus?: () => void;
|
package/src/upload/Upload.tsx
CHANGED
|
@@ -18,6 +18,7 @@ export enum UploadStep {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface UploadProps extends WrappedComponentProps {
|
|
21
|
+
/** @default 300 */
|
|
21
22
|
animationDelay?: number;
|
|
22
23
|
csButtonText?: string;
|
|
23
24
|
csFailureText?: string;
|
|
@@ -39,19 +40,24 @@ export interface UploadProps extends WrappedComponentProps {
|
|
|
39
40
|
*/
|
|
40
41
|
maxSize?: number | null;
|
|
41
42
|
psButtonText?: string;
|
|
43
|
+
/** @default false */
|
|
42
44
|
psButtonDisabled?: boolean;
|
|
43
45
|
psProcessingText?: string;
|
|
46
|
+
/** @default 'md' */
|
|
44
47
|
size?: `${Size.SMALL | Size.MEDIUM | Size.LARGE}`;
|
|
45
48
|
/**
|
|
46
49
|
* You can provide multiple rules separated by comma, e.g.: "application/pdf,image/*".
|
|
47
50
|
* Using "*" will allow every file type to be uploaded.
|
|
51
|
+
* @default 'image/*'
|
|
48
52
|
*/
|
|
49
53
|
usAccept?: string;
|
|
50
54
|
usButtonText?: string;
|
|
51
55
|
usButtonRetryText?: string;
|
|
56
|
+
/** @default false */
|
|
52
57
|
usDisabled?: boolean;
|
|
53
58
|
usDropMessage?: string;
|
|
54
59
|
usHelpImage?: React.ReactNode;
|
|
60
|
+
/** @default '' */
|
|
55
61
|
usLabel?: string;
|
|
56
62
|
usPlaceholder?: string;
|
|
57
63
|
/**
|
|
@@ -18,11 +18,13 @@ import UploadItem, { UploadItemProps } from './uploadItem/UploadItem';
|
|
|
18
18
|
export type UploadInputProps = {
|
|
19
19
|
/**
|
|
20
20
|
* List of already existing, failed or in progress files
|
|
21
|
+
* @default []
|
|
21
22
|
*/
|
|
22
23
|
files?: readonly UploadedFile[];
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* The key of the file in the returned FormData object (default: file)
|
|
27
|
+
* @default 'file'
|
|
26
28
|
*/
|
|
27
29
|
fileInputName?: string;
|
|
28
30
|
|
|
@@ -94,10 +96,16 @@ export type UploadInputProps = {
|
|
|
94
96
|
* Error message to show when files over allowed size limit are uploaded
|
|
95
97
|
*/
|
|
96
98
|
sizeLimitErrorMessage?: string;
|
|
97
|
-
} &
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
} & {
|
|
100
|
+
/** @default false */
|
|
101
|
+
multiple?: UploadButtonProps['multiple'];
|
|
102
|
+
/** @default ['.pdf,application/pdf', '.jpg,.jpeg,image/jpeg', '.png,image/png'] */
|
|
103
|
+
fileTypes?: UploadButtonProps['fileTypes'];
|
|
104
|
+
/** @default 5000 */
|
|
105
|
+
sizeLimit?: UploadButtonProps['sizeLimit'];
|
|
106
|
+
} & Pick<UploadButtonProps, 'disabled' | 'description' | 'id' | 'uploadButtonTitle'> & {
|
|
107
|
+
onDownload?: UploadItemProps['onDownload'];
|
|
108
|
+
} & CommonProps;
|
|
101
109
|
|
|
102
110
|
/**
|
|
103
111
|
* Interface representing a reference to an UploadItem component.
|
|
@@ -49,12 +49,15 @@ export interface WithDisplayFormatProps<T extends TextElementProps = TextElement
|
|
|
49
49
|
| 'required'
|
|
50
50
|
| 'inputMode'
|
|
51
51
|
> {
|
|
52
|
+
/** @default '' */
|
|
52
53
|
value?: string;
|
|
54
|
+
/** @default '' */
|
|
53
55
|
displayPattern: string;
|
|
54
56
|
/**
|
|
55
57
|
* autocomplete hides our form help so we need to disable it when help text
|
|
56
58
|
* is present. Chrome ignores autocomplete=off, the only way to disable it is
|
|
57
59
|
* to provide an 'invalid' value, for which 'disabled' serves.
|
|
60
|
+
* @default 'off'
|
|
58
61
|
*/
|
|
59
62
|
autoComplete?: TextElementProps['autoComplete'] | 'disabled';
|
|
60
63
|
onChange?: (value: string) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../src/common/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { MouseEvent, type ReactNode, forwardRef, useRef } from 'react';\n\nimport { CloseButton } from '../closeButton';\nimport { stopPropagation } from '../domHelpers';\n\nexport interface CardProps {\n /** Content to display inside Card. */\n children: ReactNode;\n\n /** Optional prop to specify classNames onto the Card */\n className?: string;\n\n /** Optional prop to specify the ID on to Card */\n id?: string;\n\n /** Specify whether the Card is disabled, or not */\n isDisabled?: boolean;\n\n /** Specify whether the Card is sized small or not */\n isSmall?: boolean;\n\n /** Optionally specify Card onDismiss function */\n onDismiss?: () => void;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * Card component.\n *\n * A card is a container for content that is used to group related information.\n * It can be used to display information in a structured way, and can be\n * customized with various props to suit different use cases.\n *\n * @param {Object} props - The component props.\n * @param {ReactNode} children - The content to display inside the card.\n * @param {string} className - Optional class name(s) to add to the card container.\n * @param {string} id - Optional ID to add to the card container.\n * @param {boolean} isDisabled - Whether the card is disabled or not.\n * @param {boolean} isSmall - Whether the card is small or not.\n * @param {(event_: MouseEvent<HTMLButtonElement>) => void} onDismiss - Optional function to call when the card is dismissed.\n * @param {string} testId - Optional ID to add to the card container for testing purposes.\n * @returns {React.JSX.Element} - The card component.\n * @example\n * <Card>\n * <p>Hello World!</p>\n * </Card>\n */\nconst Card = forwardRef<HTMLDivElement, CardProps>(\n (\n {\n className,\n children = null,\n id,\n isDisabled = false,\n isSmall = false,\n onDismiss,\n testId,\n ...props\n },\n ref,\n ) => {\n const closeButtonReference = useRef(null);\n\n return (\n <div\n ref={ref}\n className={clsx(\n 'np-Card',\n {\n 'np-Card--small': !!isSmall,\n 'is-disabled': !!isDisabled,\n },\n className,\n )}\n id={id}\n data-testid={testId}\n {...props}\n >\n {onDismiss && (\n <CloseButton\n ref={closeButtonReference}\n className=\"np-Card-closeButton\"\n size={isSmall ? 'sm' : 'md'}\n isDisabled={isDisabled}\n testId=\"close-button\"\n onClick={(e) => {\n stopPropagation(e);\n onDismiss();\n }}\n />\n )}\n {children}\n </div>\n );\n },\n);\n\nCard.displayName = 'Card';\n\nexport default Card;\n"],"names":["Card","forwardRef","className","children","id","isDisabled","isSmall","onDismiss","testId","props","ref","closeButtonReference","useRef","_jsxs","clsx","_jsx","CloseButton","size","onClick","e","stopPropagation","displayName"],"mappings":";;;;;;;;;;AAkDA,MAAMA,IAAI,gBAAGC,gBAAU,CACrB,CACE;EACEC,SAAS;AACTC,EAAAA,QAAQ,GAAG,IAAI;EACfC,EAAE;AACFC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,MAAM;EACN,GAAGC;AAAK,CACT,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,oBAAoB,GAAGC,YAAM,CAAC,IAAI,CAAC;AAEzC,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,SAAS,EAAEY,SAAI,CACb,SAAS,EACT;MACE,gBAAgB,EAAE,CAAC,CAACR,OAAO;MAC3B,aAAa,EAAE,CAAC,CAACD;KAClB,EACDH,SAAS,CACT;AACFE,IAAAA,EAAE,EAAEA,EAAG;AACP,IAAA,aAAA,EAAaI,MAAO;AAAA,IAAA,GAChBC,KAAK;AAAAN,IAAAA,QAAA,EAAA,CAERI,SAAS,iBACRQ,cAAA,CAACC,uBAAW,EAAA;AACVN,MAAAA,GAAG,EAAEC,oBAAqB;AAC1BT,MAAAA,SAAS,EAAC,qBAAqB;AAC/Be,MAAAA,IAAI,EAAEX,OAAO,GAAG,IAAI,GAAG,IAAK;AAC5BD,MAAAA,UAAU,EAAEA,UAAW;AACvBG,MAAAA,MAAM,EAAC,cAAc;MACrBU,OAAO,EAAGC,CAAC,IAAI;QACbC,gCAAe,CAACD,CAAC,CAAC;AAClBZ,QAAAA,SAAS,EAAE;AACb,MAAA;KAAE,CAEL,EACAJ,QAAQ;AAAA,GACN,CAAC;AAEV,CAAC;AAGHH,IAAI,CAACqB,WAAW,GAAG,MAAM;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Card.mjs","sources":["../../../src/common/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { MouseEvent, type ReactNode, forwardRef, useRef } from 'react';\n\nimport { CloseButton } from '../closeButton';\nimport { stopPropagation } from '../domHelpers';\n\nexport interface CardProps {\n /** Content to display inside Card. */\n children: ReactNode;\n\n /** Optional prop to specify classNames onto the Card */\n className?: string;\n\n /** Optional prop to specify the ID on to Card */\n id?: string;\n\n /** Specify whether the Card is disabled, or not */\n isDisabled?: boolean;\n\n /** Specify whether the Card is sized small or not */\n isSmall?: boolean;\n\n /** Optionally specify Card onDismiss function */\n onDismiss?: () => void;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * Card component.\n *\n * A card is a container for content that is used to group related information.\n * It can be used to display information in a structured way, and can be\n * customized with various props to suit different use cases.\n *\n * @param {Object} props - The component props.\n * @param {ReactNode} children - The content to display inside the card.\n * @param {string} className - Optional class name(s) to add to the card container.\n * @param {string} id - Optional ID to add to the card container.\n * @param {boolean} isDisabled - Whether the card is disabled or not.\n * @param {boolean} isSmall - Whether the card is small or not.\n * @param {(event_: MouseEvent<HTMLButtonElement>) => void} onDismiss - Optional function to call when the card is dismissed.\n * @param {string} testId - Optional ID to add to the card container for testing purposes.\n * @returns {React.JSX.Element} - The card component.\n * @example\n * <Card>\n * <p>Hello World!</p>\n * </Card>\n */\nconst Card = forwardRef<HTMLDivElement, CardProps>(\n (\n {\n className,\n children = null,\n id,\n isDisabled = false,\n isSmall = false,\n onDismiss,\n testId,\n ...props\n },\n ref,\n ) => {\n const closeButtonReference = useRef(null);\n\n return (\n <div\n ref={ref}\n className={clsx(\n 'np-Card',\n {\n 'np-Card--small': !!isSmall,\n 'is-disabled': !!isDisabled,\n },\n className,\n )}\n id={id}\n data-testid={testId}\n {...props}\n >\n {onDismiss && (\n <CloseButton\n ref={closeButtonReference}\n className=\"np-Card-closeButton\"\n size={isSmall ? 'sm' : 'md'}\n isDisabled={isDisabled}\n testId=\"close-button\"\n onClick={(e) => {\n stopPropagation(e);\n onDismiss();\n }}\n />\n )}\n {children}\n </div>\n );\n },\n);\n\nCard.displayName = 'Card';\n\nexport default Card;\n"],"names":["Card","forwardRef","className","children","id","isDisabled","isSmall","onDismiss","testId","props","ref","closeButtonReference","useRef","_jsxs","clsx","_jsx","CloseButton","size","onClick","e","stopPropagation","displayName"],"mappings":";;;;;;AAkDA,MAAMA,IAAI,gBAAGC,UAAU,CACrB,CACE;EACEC,SAAS;AACTC,EAAAA,QAAQ,GAAG,IAAI;EACfC,EAAE;AACFC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,MAAM;EACN,GAAGC;AAAK,CACT,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,oBAAoB,GAAGC,MAAM,CAAC,IAAI,CAAC;AAEzC,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,SAAS,EAAEY,IAAI,CACb,SAAS,EACT;MACE,gBAAgB,EAAE,CAAC,CAACR,OAAO;MAC3B,aAAa,EAAE,CAAC,CAACD;KAClB,EACDH,SAAS,CACT;AACFE,IAAAA,EAAE,EAAEA,EAAG;AACP,IAAA,aAAA,EAAaI,MAAO;AAAA,IAAA,GAChBC,KAAK;AAAAN,IAAAA,QAAA,EAAA,CAERI,SAAS,iBACRQ,GAAA,CAACC,WAAW,EAAA;AACVN,MAAAA,GAAG,EAAEC,oBAAqB;AAC1BT,MAAAA,SAAS,EAAC,qBAAqB;AAC/Be,MAAAA,IAAI,EAAEX,OAAO,GAAG,IAAI,GAAG,IAAK;AAC5BD,MAAAA,UAAU,EAAEA,UAAW;AACvBG,MAAAA,MAAM,EAAC,cAAc;MACrBU,OAAO,EAAGC,CAAC,IAAI;QACbC,eAAe,CAACD,CAAC,CAAC;AAClBZ,QAAAA,SAAS,EAAE;AACb,MAAA;KAAE,CAEL,EACAJ,QAAQ;AAAA,GACN,CAAC;AAEV,CAAC;AAGHH,IAAI,CAACqB,WAAW,GAAG,MAAM;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/common/card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAKvE,MAAM,WAAW,SAAS;IACxB,sCAAsC;IACtC,QAAQ,EAAE,SAAS,CAAC;IAEpB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,kDAAkD;IAClD,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,qDAAqD;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAEvB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,IAAI,sGAgDT,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,cAAc,QAAQ,CAAC"}
|
package/src/common/card/index.ts
DELETED
|
File without changes
|
|
File without changes
|