@transferwise/components 46.147.0 → 46.148.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/container/Container.js.map +1 -1
- package/build/container/Container.mjs.map +1 -1
- package/build/main.css +63 -6
- package/build/prompt/CriticalBanner/CriticalBanner.js +81 -68
- package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.mjs +82 -69
- package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/styles/main.css +63 -6
- package/build/styles/prompt/ActionPrompt/ActionPrompt.css +2 -1
- package/build/styles/prompt/CriticalBanner/CriticalBanner.css +50 -1
- package/build/styles/prompt/InfoPrompt/InfoPrompt.css +2 -1
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +2 -1
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +2 -2
- package/build/types/container/Container.d.ts +2 -2
- package/build/types/container/Container.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +1 -1
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -1
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +1 -1
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/accordion/Accordion.story.tsx +25 -0
- package/src/avatarLayout/AvatarLayout.story.tsx +10 -0
- package/src/avatarView/AvatarView.story.tsx +8 -0
- package/src/body/Body.story.tsx +12 -0
- package/src/button/_stories/Button.story.tsx +7 -1
- package/src/calendar/Calendar.story.tsx +19 -7
- package/src/carousel/Carousel.story.tsx +35 -0
- package/src/checkbox/Checkbox.story.tsx +20 -0
- package/src/checkboxButton/CheckboxButton.story.tsx +16 -0
- package/src/chevron/Chevron.story.tsx +6 -0
- package/src/chips/Chips.story.tsx +23 -0
- package/src/circularButton/CircularButton.story.tsx +13 -0
- package/src/common/baseCard/BaseCard.story.tsx +12 -0
- package/src/common/bottomSheet/BottomSheet.story.tsx +21 -0
- package/src/common/circle/Circle.story.tsx +11 -0
- package/src/container/Container.story.tsx +12 -0
- package/src/container/Container.tsx +2 -2
- package/src/dateInput/DateInput.story.tsx +20 -0
- package/src/dateLookup/DateLookup.story.tsx +23 -0
- package/src/decision/Decision.story.tsx +36 -0
- package/src/definitionList/DefinitionList.story.tsx +16 -0
- package/src/dimmer/Dimmer.story.tsx +24 -0
- package/src/display/Display.story.tsx +11 -0
- package/src/divider/Divider.story.tsx +6 -0
- package/src/drawer/Drawer.story.tsx +25 -0
- package/src/dropFade/DropFade.story.tsx +27 -0
- package/src/emphasis/Emphasis.story.tsx +10 -0
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +37 -0
- package/src/field/Field.story.tsx +16 -0
- package/src/flowNavigation/FlowNavigation.story.tsx +25 -0
- package/src/header/Header.story.tsx +17 -0
- package/src/iconButton/IconButton.story.tsx +14 -0
- package/src/image/Image.story.tsx +11 -0
- package/src/info/Info.story.tsx +10 -0
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +23 -0
- package/src/inputs/InputGroup.story.tsx +37 -0
- package/src/inputs/SearchInput.story.tsx +22 -0
- package/src/inputs/SelectInput/_stories/SelectInput.story.tsx +42 -0
- package/src/inputs/TextArea.story.tsx +22 -0
- package/src/instructionsList/InstructionsList.story.tsx +19 -0
- package/src/label/Label.story.tsx +17 -0
- package/src/link/Link.story.tsx +11 -0
- package/src/list/List.story.tsx +19 -0
- package/src/listItem/_stories/ListItem.story.tsx +20 -0
- package/src/loader/Loader.story.tsx +6 -0
- package/src/logo/Logo.story.tsx +6 -0
- package/src/main.css +63 -6
- package/src/markdown/Markdown.story.tsx +17 -0
- package/src/modal/Modal.story.tsx +23 -0
- package/src/money/Money.story.tsx +7 -0
- package/src/moneyInput/MoneyInput.story.tsx +34 -0
- package/src/nudge/Nudge.story.tsx +17 -0
- package/src/overlayHeader/OverlayHeader.story.tsx +10 -0
- package/src/phoneNumberInput/PhoneNumberInput.story.tsx +23 -0
- package/src/popover/Popover.story.tsx +12 -0
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.story.tsx +11 -0
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.story.tsx +11 -0
- package/src/processIndicator/ProcessIndicator.story.tsx +10 -0
- package/src/progress/Progress.story.tsx +6 -0
- package/src/progressBar/ProgressBar.story.tsx +12 -0
- package/src/promoCard/PromoCard.story.tsx +15 -0
- package/src/promoCard/PromoCardGroup.story.tsx +28 -0
- package/src/prompt/ActionPrompt/ActionPrompt.css +2 -1
- package/src/prompt/ActionPrompt/ActionPrompt.less +2 -1
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +31 -0
- package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +9 -0
- package/src/prompt/CriticalBanner/CriticalBanner.css +50 -1
- package/src/prompt/CriticalBanner/CriticalBanner.less +74 -1
- package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +181 -170
- package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +25 -6
- package/src/prompt/CriticalBanner/CriticalBanner.test.tsx +37 -0
- package/src/prompt/CriticalBanner/CriticalBanner.tsx +96 -84
- package/src/prompt/CriticalBanner/CriticalBanner.vars.less +1 -0
- package/src/prompt/InfoPrompt/InfoPrompt.css +2 -1
- package/src/prompt/InfoPrompt/InfoPrompt.less +2 -1
- package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +30 -0
- package/src/prompt/InlinePrompt/InlinePrompt.css +2 -1
- package/src/prompt/InlinePrompt/InlinePrompt.less +2 -1
- package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +14 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +2 -2
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +1 -1
- package/src/radio/Radio.story.tsx +34 -0
- package/src/radioGroup/RadioGroup.story.tsx +26 -0
- package/src/section/Section.story.tsx +15 -0
- package/src/segmentedControl/SegmentedControl.story.tsx +27 -0
- package/src/sentimentSurface/SentimentSurface.story.tsx +11 -0
- package/src/slidingPanel/SlidingPanel.story.tsx +19 -0
- package/src/snackbar/Snackbar.story.tsx +24 -0
- package/src/statusIcon/StatusIcon.story.tsx +6 -0
- package/src/stepper/Stepper.story.tsx +30 -0
- package/src/sticky/Sticky.story.tsx +22 -1
- package/src/switch/Switch.story.tsx +17 -0
- package/src/table/Table.story.tsx +32 -0
- package/src/tabs/Tabs.story.tsx +31 -0
- package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +23 -0
- package/src/tile/Tile.story.tsx +13 -0
- package/src/title/Title.story.tsx +12 -0
- package/src/tooltip/Tooltip.story.tsx +8 -0
- package/src/typeahead/Typeahead.story.tsx +33 -0
- package/src/upload/Upload.story.tsx +24 -0
- package/src/uploadInput/UploadInput.story.tsx +31 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.mjs","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Emphasis, Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { forwardRef, HTMLAttributes, ReactNode } from 'react';\n\nexport type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The sentiment determines the colour scheme.\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * The emphasis level affecting background and text contrast.\n * @default 'base'\n */\n emphasis?: Emphasis;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Test ID for testing tools\n */\n 'data-testid'?: string;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = forwardRef<HTMLDivElement, PrimitivePromptProps>(\n (\n {\n sentiment = 'success',\n emphasis = 'base',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n },\n ref,\n ) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props\n ref={ref}\n sentiment={sentiment}\n emphasis={emphasis}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n },\n);\n\nPrimitivePrompt.displayName = 'PrimitivePrompt';\n"],"names":["PrimitivePrompt","forwardRef","sentiment","emphasis","media","actions","onDismiss","className","children","restProps","ref","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross","displayName"],"mappings":";;;;;;;;;AAwCO,MAAMA,eAAe,gBAAGC,UAAU,CACvC,CACE;AACEC,EAAAA,SAAS,GAAG,SAAS;AACrBC,EAAAA,QAAQ,GAAG,MAAM;EACjBC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAS,CACb,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;AAEtB,EAAA,oBACEC,GAAA,CAACC;AACC;AAAA,IAAA;AACAJ,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,QAAQ,EAAEA,QAAS;IACnBI,SAAS,EAAEQ,IAAI,CAAC,YAAY,EAAE,eAAeb,SAAS,CAAA,CAAE,EAAEK,SAAS,CAAE;AAAA,IAAA,GACjEE,SAAS;AAAAD,IAAAA,QAAA,eAEbQ,IAAA,CAAA,KAAA,EAAA;AACET,MAAAA,SAAS,EAAEQ,IAAI,CAAC,6BAA6B,EAAE;QAC7C,2CAA2C,EAAE,CAAC,CAACT;AAChD,OAAA,CAAE;AAAAE,MAAAA,QAAA,gBAEHK,GAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,SAAS,EAAEQ,IAAI,CAAC,2BAA2B,CAAE;AAAAP,QAAAA,QAAA,EAAEJ;OAAW,CAC/D,EAACI,QAAQ,EACRF,SAAS,iBACRO,GAAA,CAACI,UAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTC,QAAAA,QAAQ,EAAC,WAAW;AACpB,QAAA,YAAA,EAAYR,IAAI,CAACS,aAAa,CAACC,gBAAgB,CAACC,SAAS,CAAE;AAC3DC,QAAAA,OAAO,EAAEjB,SAAU;AAAAE,QAAAA,QAAA,eAEnBK,GAAA,CAACW,KAAK,EAAA,EAAA;AACR,OAAY,CACb,EACAnB,OAAO,iBAAIQ,GAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,SAAS,EAAC,6BAA6B;AAAAC,QAAAA,QAAA,EAAEH;AAAO,OAAM,CAAC;KACrE;AACP,GAAkB,CAAC;AAEvB,CAAC;AAGHL,eAAe,CAACyB,WAAW,GAAG,iBAAiB;;;;"}
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.mjs","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Emphasis, Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { forwardRef, HTMLAttributes, ReactNode } from 'react';\n\nexport type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {\n /**\n * The sentiment determines the colour scheme.\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * The emphasis level affecting background and text contrast.\n * @default 'base'\n */\n emphasis?: Emphasis;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n /**\n * Test ID for testing tools\n */\n 'data-testid'?: string;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding-x. */\nexport const PrimitivePrompt = forwardRef<HTMLDivElement, PrimitivePromptProps>(\n (\n {\n sentiment = 'success',\n emphasis = 'base',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n },\n ref,\n ) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props\n ref={ref}\n sentiment={sentiment}\n emphasis={emphasis}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n },\n);\n\nPrimitivePrompt.displayName = 'PrimitivePrompt';\n"],"names":["PrimitivePrompt","forwardRef","sentiment","emphasis","media","actions","onDismiss","className","children","restProps","ref","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross","displayName"],"mappings":";;;;;;;;;AAwCO,MAAMA,eAAe,gBAAGC,UAAU,CACvC,CACE;AACEC,EAAAA,SAAS,GAAG,SAAS;AACrBC,EAAAA,QAAQ,GAAG,MAAM;EACjBC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAS,CACb,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;AAEtB,EAAA,oBACEC,GAAA,CAACC;AACC;AAAA,IAAA;AACAJ,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,QAAQ,EAAEA,QAAS;IACnBI,SAAS,EAAEQ,IAAI,CAAC,YAAY,EAAE,eAAeb,SAAS,CAAA,CAAE,EAAEK,SAAS,CAAE;AAAA,IAAA,GACjEE,SAAS;AAAAD,IAAAA,QAAA,eAEbQ,IAAA,CAAA,KAAA,EAAA;AACET,MAAAA,SAAS,EAAEQ,IAAI,CAAC,6BAA6B,EAAE;QAC7C,2CAA2C,EAAE,CAAC,CAACT;AAChD,OAAA,CAAE;AAAAE,MAAAA,QAAA,gBAEHK,GAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,SAAS,EAAEQ,IAAI,CAAC,2BAA2B,CAAE;AAAAP,QAAAA,QAAA,EAAEJ;OAAW,CAC/D,EAACI,QAAQ,EACRF,SAAS,iBACRO,GAAA,CAACI,UAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTC,QAAAA,QAAQ,EAAC,WAAW;AACpB,QAAA,YAAA,EAAYR,IAAI,CAACS,aAAa,CAACC,gBAAgB,CAACC,SAAS,CAAE;AAC3DC,QAAAA,OAAO,EAAEjB,SAAU;AAAAE,QAAAA,QAAA,eAEnBK,GAAA,CAACW,KAAK,EAAA,EAAA;AACR,OAAY,CACb,EACAnB,OAAO,iBAAIQ,GAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,SAAS,EAAC,6BAA6B;AAAAC,QAAAA,QAAA,EAAEH;AAAO,OAAM,CAAC;KACrE;AACP,GAAkB,CAAC;AAEvB,CAAC;AAGHL,eAAe,CAACyB,WAAW,GAAG,iBAAiB;;;;"}
|
package/build/styles/main.css
CHANGED
|
@@ -31706,8 +31706,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31706
31706
|
gap: 16px;
|
|
31707
31707
|
gap: var(--Prompt-gap, var(--size-16));
|
|
31708
31708
|
word-wrap: break-word;
|
|
31709
|
-
padding: 8px;
|
|
31710
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
31709
|
+
padding: 8px 8px;
|
|
31710
|
+
padding: var(--Prompt-padding-y, var(--padding-x-small)) var(--Prompt-padding-x, var(--padding-x-small));
|
|
31711
31711
|
text-align: left;
|
|
31712
31712
|
word-break: break-word;
|
|
31713
31713
|
width: 100%;
|
|
@@ -31759,7 +31759,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31759
31759
|
|
|
31760
31760
|
.wds-inline-prompt {
|
|
31761
31761
|
--Prompt-gap: calc(var(--size-12) / 2);
|
|
31762
|
-
--Prompt-padding
|
|
31762
|
+
--Prompt-padding-x: var(--padding-x-small);
|
|
31763
|
+
--Prompt-padding-y: calc(var(--padding-x-small) / 2);
|
|
31763
31764
|
display: inline-flex;
|
|
31764
31765
|
border-radius: 10px;
|
|
31765
31766
|
border-radius: var(--radius-small);
|
|
@@ -31829,7 +31830,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31829
31830
|
.wds-info-prompt {
|
|
31830
31831
|
--Prompt-border-radius: var(--radius-medium);
|
|
31831
31832
|
--Prompt-gap: var(--size-8);
|
|
31832
|
-
--Prompt-padding: var(--size-12);
|
|
31833
|
+
--Prompt-padding-x: var(--size-12);
|
|
31834
|
+
--Prompt-padding-y: var(--size-12);
|
|
31833
31835
|
}
|
|
31834
31836
|
|
|
31835
31837
|
.wds-info-prompt__content {
|
|
@@ -31895,7 +31897,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31895
31897
|
}
|
|
31896
31898
|
|
|
31897
31899
|
.wds-action-prompt {
|
|
31898
|
-
--Prompt-padding: var(--size-16);
|
|
31900
|
+
--Prompt-padding-x: var(--size-16);
|
|
31901
|
+
--Prompt-padding-y: var(--size-16);
|
|
31899
31902
|
--Prompt-actions-gap: var(--size-8);
|
|
31900
31903
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31901
31904
|
--Prompt-border-radius: var(--radius-large);
|
|
@@ -31930,11 +31933,13 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31930
31933
|
}
|
|
31931
31934
|
|
|
31932
31935
|
.wds-critical-banner {
|
|
31933
|
-
--Prompt-padding: var(--
|
|
31936
|
+
--Prompt-padding-x: var(--wds-container-padding-inline);
|
|
31937
|
+
--Prompt-padding-y: var(--size-16);
|
|
31934
31938
|
--Prompt-actions-gap: var(--size-8);
|
|
31935
31939
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31936
31940
|
--Prompt-border-radius: 0;
|
|
31937
31941
|
container-type: inline-size;
|
|
31942
|
+
position: relative;
|
|
31938
31943
|
--critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
|
|
31939
31944
|
--critical-banner-duration: 150ms;
|
|
31940
31945
|
/* Override PrimitivePrompt's --screen-sm-max actions behaviour:
|
|
@@ -32075,6 +32080,53 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32075
32080
|
}
|
|
32076
32081
|
}
|
|
32077
32082
|
|
|
32083
|
+
.wds-critical-banner-overhang-query {
|
|
32084
|
+
container-name: critical-banner-overhang;
|
|
32085
|
+
container-type: inline-size;
|
|
32086
|
+
inline-size: 100%;
|
|
32087
|
+
}
|
|
32088
|
+
|
|
32089
|
+
.wds-critical-banner__entry-mask {
|
|
32090
|
+
display: grid;
|
|
32091
|
+
grid-template-rows: 0fr;
|
|
32092
|
+
overflow: hidden;
|
|
32093
|
+
animation: wds-critical-banner-reveal-height 400ms cubic-bezier(0.3, 0, 0.1, 1) 500ms both;
|
|
32094
|
+
}
|
|
32095
|
+
|
|
32096
|
+
@container critical-banner-overhang (max-width: 600px) {
|
|
32097
|
+
.wds-critical-banner__entry-mask {
|
|
32098
|
+
--critical-banner-mobile-overhang-size: 32px;
|
|
32099
|
+
}
|
|
32100
|
+
.wds-critical-banner__entry-mask .wds-critical-banner-overhang {
|
|
32101
|
+
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
32102
|
+
}
|
|
32103
|
+
.wds-critical-banner__entry-mask .wds-critical-banner-overhang::after {
|
|
32104
|
+
content: "";
|
|
32105
|
+
position: absolute;
|
|
32106
|
+
right: 0;
|
|
32107
|
+
bottom: calc(-1 * var(--critical-banner-mobile-overhang-size));
|
|
32108
|
+
left: 0;
|
|
32109
|
+
height: var(--critical-banner-mobile-overhang-size);
|
|
32110
|
+
pointer-events: none;
|
|
32111
|
+
background: radial-gradient(circle at 100% 100%, transparent var(--critical-banner-mobile-overhang-size), var(--color-sentiment-background-surface) var(--critical-banner-mobile-overhang-size)) 0 0 / var(--critical-banner-mobile-overhang-size) var(--critical-banner-mobile-overhang-size) no-repeat, radial-gradient(circle at 0% 100%, transparent var(--critical-banner-mobile-overhang-size), var(--color-sentiment-background-surface) var(--critical-banner-mobile-overhang-size)) 100% 0 / var(--critical-banner-mobile-overhang-size) var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
32112
|
+
}
|
|
32113
|
+
}
|
|
32114
|
+
|
|
32115
|
+
.wds-critical-banner__entry-track {
|
|
32116
|
+
min-height: 0;
|
|
32117
|
+
}
|
|
32118
|
+
|
|
32119
|
+
@keyframes wds-critical-banner-reveal-height {
|
|
32120
|
+
from {
|
|
32121
|
+
grid-template-rows: 0fr;
|
|
32122
|
+
overflow: hidden;
|
|
32123
|
+
}
|
|
32124
|
+
to {
|
|
32125
|
+
grid-template-rows: 1fr;
|
|
32126
|
+
overflow: visible;
|
|
32127
|
+
}
|
|
32128
|
+
}
|
|
32129
|
+
|
|
32078
32130
|
@media (prefers-reduced-motion: reduce) {
|
|
32079
32131
|
.wds-critical-banner__description,
|
|
32080
32132
|
.wds-critical-banner__title,
|
|
@@ -32082,6 +32134,11 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32082
32134
|
.wds-critical-banner__toggle {
|
|
32083
32135
|
transition: none !important;
|
|
32084
32136
|
}
|
|
32137
|
+
.wds-critical-banner__entry-mask {
|
|
32138
|
+
animation: none;
|
|
32139
|
+
grid-template-rows: 1fr;
|
|
32140
|
+
overflow: visible;
|
|
32141
|
+
}
|
|
32085
32142
|
}
|
|
32086
32143
|
|
|
32087
32144
|
.wds-expander-toggle {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
.wds-critical-banner {
|
|
2
|
-
--Prompt-padding: var(--
|
|
2
|
+
--Prompt-padding-x: var(--wds-container-padding-inline);
|
|
3
|
+
--Prompt-padding-y: var(--size-16);
|
|
3
4
|
--Prompt-actions-gap: var(--size-8);
|
|
4
5
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
5
6
|
--Prompt-border-radius: 0;
|
|
6
7
|
container-type: inline-size;
|
|
8
|
+
position: relative;
|
|
7
9
|
--critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
|
|
8
10
|
--critical-banner-duration: 150ms;
|
|
9
11
|
/* Override PrimitivePrompt's --screen-sm-max actions behaviour:
|
|
@@ -124,6 +126,48 @@
|
|
|
124
126
|
min-width: fit-content;
|
|
125
127
|
}
|
|
126
128
|
}
|
|
129
|
+
.wds-critical-banner-overhang-query {
|
|
130
|
+
container-name: critical-banner-overhang;
|
|
131
|
+
container-type: inline-size;
|
|
132
|
+
inline-size: 100%;
|
|
133
|
+
}
|
|
134
|
+
.wds-critical-banner__entry-mask {
|
|
135
|
+
display: grid;
|
|
136
|
+
grid-template-rows: 0fr;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
animation: wds-critical-banner-reveal-height 400ms cubic-bezier(0.3, 0, 0.1, 1) 500ms both;
|
|
139
|
+
}
|
|
140
|
+
@container critical-banner-overhang (max-width: 600px) {
|
|
141
|
+
.wds-critical-banner__entry-mask {
|
|
142
|
+
--critical-banner-mobile-overhang-size: 32px;
|
|
143
|
+
}
|
|
144
|
+
.wds-critical-banner__entry-mask .wds-critical-banner-overhang {
|
|
145
|
+
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
146
|
+
}
|
|
147
|
+
.wds-critical-banner__entry-mask .wds-critical-banner-overhang::after {
|
|
148
|
+
content: "";
|
|
149
|
+
position: absolute;
|
|
150
|
+
right: 0;
|
|
151
|
+
bottom: calc(-1 * var(--critical-banner-mobile-overhang-size));
|
|
152
|
+
left: 0;
|
|
153
|
+
height: var(--critical-banner-mobile-overhang-size);
|
|
154
|
+
pointer-events: none;
|
|
155
|
+
background: radial-gradient(circle at 100% 100%, transparent var(--critical-banner-mobile-overhang-size), var(--color-sentiment-background-surface) var(--critical-banner-mobile-overhang-size)) 0 0 / var(--critical-banner-mobile-overhang-size) var(--critical-banner-mobile-overhang-size) no-repeat, radial-gradient(circle at 0% 100%, transparent var(--critical-banner-mobile-overhang-size), var(--color-sentiment-background-surface) var(--critical-banner-mobile-overhang-size)) 100% 0 / var(--critical-banner-mobile-overhang-size) var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
.wds-critical-banner__entry-track {
|
|
159
|
+
min-height: 0;
|
|
160
|
+
}
|
|
161
|
+
@keyframes wds-critical-banner-reveal-height {
|
|
162
|
+
from {
|
|
163
|
+
grid-template-rows: 0fr;
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
}
|
|
166
|
+
to {
|
|
167
|
+
grid-template-rows: 1fr;
|
|
168
|
+
overflow: visible;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
127
171
|
@media (prefers-reduced-motion: reduce) {
|
|
128
172
|
.wds-critical-banner__description,
|
|
129
173
|
.wds-critical-banner__title,
|
|
@@ -131,4 +175,9 @@
|
|
|
131
175
|
.wds-critical-banner__toggle {
|
|
132
176
|
transition: none !important;
|
|
133
177
|
}
|
|
178
|
+
.wds-critical-banner__entry-mask {
|
|
179
|
+
animation: none;
|
|
180
|
+
grid-template-rows: 1fr;
|
|
181
|
+
overflow: visible;
|
|
182
|
+
}
|
|
134
183
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.wds-inline-prompt {
|
|
2
2
|
--Prompt-gap: calc(var(--size-12) / 2);
|
|
3
|
-
--Prompt-padding
|
|
3
|
+
--Prompt-padding-x: var(--padding-x-small);
|
|
4
|
+
--Prompt-padding-y: calc(var(--padding-x-small) / 2);
|
|
4
5
|
display: inline-flex;
|
|
5
6
|
border-radius: 10px;
|
|
6
7
|
border-radius: var(--radius-small);
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
gap: 16px;
|
|
6
6
|
gap: var(--Prompt-gap, var(--size-16));
|
|
7
7
|
word-wrap: break-word;
|
|
8
|
-
padding: 8px;
|
|
9
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
8
|
+
padding: 8px 8px;
|
|
9
|
+
padding: var(--Prompt-padding-y, var(--padding-x-small)) var(--Prompt-padding-x, var(--padding-x-small));
|
|
10
10
|
text-align: left;
|
|
11
11
|
word-break: break-word;
|
|
12
12
|
width: 100%;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType, PropsWithChildren } from 'react';
|
|
2
2
|
import { CommonProps } from '../common';
|
|
3
3
|
type ContainerOwnProps<T extends ElementType> = CommonProps & {
|
|
4
4
|
/** Controls the maximum width: `fluid` (100%), `standard` (1160px), `narrow` (840px), `compact` (600px). @default 'standard' */
|
|
5
5
|
size?: 'fluid' | 'standard' | 'narrow' | 'compact';
|
|
6
6
|
as?: T;
|
|
7
7
|
};
|
|
8
|
-
export type ContainerProps<T extends ElementType = 'div'> = PropsWithChildren<ContainerOwnProps<T>> & Omit<
|
|
8
|
+
export type ContainerProps<T extends ElementType = 'div'> = PropsWithChildren<ContainerOwnProps<T>> & Omit<ComponentPropsWithRef<T>, keyof ContainerOwnProps<T> | 'children'>;
|
|
9
9
|
/**
|
|
10
10
|
* Centers page content within a responsive max-width boundary, with automatic horizontal padding that adapts to the viewport size.
|
|
11
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/container/Container.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/container/Container.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,KAAK,iBAAiB,CAAC,CAAC,SAAS,WAAW,IAAI,WAAW,GAAG;IAC5D,gIAAgI;IAChI,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;IACnD,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,iBAAiB,CAC3E,iBAAiB,CAAC,CAAC,CAAC,CACrB,GACC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,iBAAiB,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;AAE1E;;;;GAIG;AACH,QAAA,MAAM,SAAS,GAAI,CAAC,SAAS,WAAW,GAAG,KAAK,EAAE,kDAM/C,cAAc,CAAC,CAAC,CAAC,gCAOnB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -16,6 +16,6 @@ declare const IconButton: import("react").ForwardRefExoticComponent<{
|
|
|
16
16
|
/** @default 'default' */
|
|
17
17
|
type?: "default" | "negative";
|
|
18
18
|
'data-testid'?: string;
|
|
19
|
-
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "
|
|
19
|
+
} & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "onClick" | "target" | "href"> & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "onClick"> & Pick<HTMLAttributes<HTMLDivElement>, "id" | "className" | "tabIndex" | "role" | "aria-label" | "children"> & import("react").RefAttributes<unknown>>;
|
|
20
20
|
export default IconButton;
|
|
21
21
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CriticalBanner.d.ts","sourceRoot":"","sources":["../../../../src/prompt/CriticalBanner/CriticalBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CriticalBanner.d.ts","sourceRoot":"","sources":["../../../../src/prompt/CriticalBanner/CriticalBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAmB,MAAM,OAAO,CAAC;AAOhE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAmB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAqB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAKxE,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG;QAC1D,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;KAChC,CAAC;IACF,eAAe,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG;QACnE,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;KAChC,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,CAAC;IACtE;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,GAAG,IAAI,CAAC,oBAAoB,EAAE,IAAI,GAAG,WAAW,GAAG,aAAa,CAAC,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,4IAY5B,mBAAmB,gCAgIrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -30,7 +30,7 @@ export type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
32
|
* PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.
|
|
33
|
-
* Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */
|
|
33
|
+
* Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding-x. */
|
|
34
34
|
export declare const PrimitivePrompt: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
35
35
|
/**
|
|
36
36
|
* The sentiment determines the colour scheme.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"names":[],"mappings":"AAEA,OAAyB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAI/E,OAAO,EAAc,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAClE;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"names":[],"mappings":"AAEA,OAAyB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAI/E,OAAO,EAAc,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAClE;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;gHAEgH;AAChH,eAAO,MAAM,eAAe;IA/B1B;;;OAGG;gBACS,SAAS;IACrB;;;OAGG;eACQ,QAAQ;IACnB;;OAEG;WACI,SAAS;IAChB;;OAEG;cACO,SAAS;IACnB;;OAEG;gBACS,MAAM,IAAI;IACtB;;OAEG;oBACa,MAAM;kDAqDvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
3
|
import { FastFlag as FastFlagIcon, CardWise as CardWiseIcon } from '@transferwise/icons';
|
|
4
|
+
import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
4
5
|
|
|
5
6
|
import { Scroll, Size } from '../common';
|
|
6
7
|
import Modal from '../modal';
|
|
@@ -89,6 +90,30 @@ const meta: Meta<typeof Accordion> = {
|
|
|
89
90
|
export default meta;
|
|
90
91
|
type Story = StoryObj<typeof Accordion>;
|
|
91
92
|
|
|
93
|
+
export const Sandbox = createSandboxStory({
|
|
94
|
+
code: `<Accordion
|
|
95
|
+
indexOpen={1}
|
|
96
|
+
items={[
|
|
97
|
+
{
|
|
98
|
+
title: 'Item 1',
|
|
99
|
+
content: 'I can be text',
|
|
100
|
+
icon: <Freeze size={24} />,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
title: 'Item 2 with icon',
|
|
104
|
+
content: <span>I can be a node</span>,
|
|
105
|
+
icon: <HappyEmoji size={24} />,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
title: 'Item 3',
|
|
109
|
+
content: 'I can be text',
|
|
110
|
+
icon: <New size={24} />,
|
|
111
|
+
},
|
|
112
|
+
]}
|
|
113
|
+
/>`,
|
|
114
|
+
scope: globalScope,
|
|
115
|
+
});
|
|
116
|
+
|
|
92
117
|
export const Default: Story = {
|
|
93
118
|
args: {
|
|
94
119
|
indexOpen: 0,
|
|
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
|
3
3
|
import AvatarLayout, { AvatarLayoutProps } from '.';
|
|
4
4
|
import { Freeze } from '@transferwise/icons';
|
|
5
5
|
import { Flag } from '@wise/art';
|
|
6
|
+
import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
6
7
|
import Body from '../body';
|
|
7
8
|
import SentimentSurface from '../sentimentSurface';
|
|
8
9
|
|
|
@@ -13,6 +14,15 @@ export default {
|
|
|
13
14
|
|
|
14
15
|
type Story = StoryObj<typeof AvatarLayout>;
|
|
15
16
|
|
|
17
|
+
export const Sandbox = createSandboxStory({
|
|
18
|
+
code: `<AvatarLayout
|
|
19
|
+
size={48}
|
|
20
|
+
orientation="diagonal"
|
|
21
|
+
avatars={[{ asset: <Flag code="br" /> }, { asset: <Flag code="jp" /> }]}
|
|
22
|
+
/>`,
|
|
23
|
+
scope: globalScope,
|
|
24
|
+
});
|
|
25
|
+
|
|
16
26
|
const sizes: AvatarLayoutProps['size'][] = [16, 24, 32, 40, 48, 56, 72, 88, 96];
|
|
17
27
|
|
|
18
28
|
export const Diagonal: Story = {
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from '@transferwise/icons';
|
|
18
18
|
import AvatarView, { AvatarViewProps } from '.';
|
|
19
19
|
import { Flag } from '@wise/art';
|
|
20
|
+
import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
20
21
|
import { ProfileType } from '../common';
|
|
21
22
|
import Body from '../body';
|
|
22
23
|
import SentimentSurface from '../sentimentSurface';
|
|
@@ -28,6 +29,13 @@ export default {
|
|
|
28
29
|
|
|
29
30
|
type Story = StoryObj<typeof AvatarView>;
|
|
30
31
|
|
|
32
|
+
export const Sandbox = createSandboxStory({
|
|
33
|
+
code: `<AvatarView size={48} badge={{ flagCode: 'GBP' }}>
|
|
34
|
+
<Freeze />
|
|
35
|
+
</AvatarView>`,
|
|
36
|
+
scope: globalScope,
|
|
37
|
+
});
|
|
38
|
+
|
|
31
39
|
const profileName1 = 'Wolter White';
|
|
32
40
|
const profileName2 = 'Tyler Durden';
|
|
33
41
|
const sizes: AvatarViewProps['size'][] = [16, 24, 32, 40, 48, 56, 72, 88, 96];
|
package/src/body/Body.story.tsx
CHANGED
|
@@ -2,12 +2,23 @@ import { Typography } from '../common/propsValues/typography';
|
|
|
2
2
|
import Title from '../title';
|
|
3
3
|
|
|
4
4
|
import Body from './Body';
|
|
5
|
+
import {
|
|
6
|
+
createSandboxStory,
|
|
7
|
+
globalScope,
|
|
8
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
5
9
|
|
|
6
10
|
export default {
|
|
7
11
|
title: 'Typography/Body',
|
|
8
12
|
component: Body,
|
|
9
13
|
};
|
|
10
14
|
|
|
15
|
+
export const Sandbox = createSandboxStory({
|
|
16
|
+
code: `<Body type="body-default">
|
|
17
|
+
We're building the world's most international account.
|
|
18
|
+
</Body>`,
|
|
19
|
+
scope: globalScope,
|
|
20
|
+
});
|
|
21
|
+
|
|
11
22
|
export const Basic = () => {
|
|
12
23
|
return (
|
|
13
24
|
<>
|
|
@@ -126,3 +137,4 @@ export const Basic = () => {
|
|
|
126
137
|
</>
|
|
127
138
|
);
|
|
128
139
|
};
|
|
140
|
+
|
|
@@ -322,7 +322,13 @@ export const Playground: StoryObj<PreviewStoryArgs> = {
|
|
|
322
322
|
};
|
|
323
323
|
|
|
324
324
|
export const Sandbox = createSandboxStory({
|
|
325
|
-
code: `<Button
|
|
325
|
+
code: `<Button
|
|
326
|
+
v2
|
|
327
|
+
priority="primary"
|
|
328
|
+
sentiment="default"
|
|
329
|
+
size="md"
|
|
330
|
+
addonEnd={{ type: 'icon', value: <ArrowRight /> }}
|
|
331
|
+
>
|
|
326
332
|
Click me
|
|
327
333
|
</Button>`,
|
|
328
334
|
scope: globalScope,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { StoryObj } from '@storybook/react-webpack5';
|
|
3
3
|
import { userEvent, within } from 'storybook/test';
|
|
4
|
+
import {
|
|
5
|
+
createSandboxStory,
|
|
6
|
+
globalScope,
|
|
7
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
4
8
|
import Calendar, { type CalendarProps } from './Calendar';
|
|
5
9
|
import Modal from '../modal';
|
|
6
10
|
import Button from '../button';
|
|
@@ -9,13 +13,6 @@ import Button from '../button';
|
|
|
9
13
|
export default {
|
|
10
14
|
component: Calendar,
|
|
11
15
|
title: 'Forms/Calendar',
|
|
12
|
-
decorators: [
|
|
13
|
-
(Story: React.ComponentType) => (
|
|
14
|
-
<div style={{ maxWidth: 500, margin: '0 auto' }}>
|
|
15
|
-
<Story />
|
|
16
|
-
</div>
|
|
17
|
-
),
|
|
18
|
-
],
|
|
19
16
|
argTypes: {
|
|
20
17
|
monthFormat: { control: 'select', options: ['long', 'short'] },
|
|
21
18
|
min: { control: 'date' },
|
|
@@ -31,6 +28,21 @@ theFuture.setUTCDate(epoch.getUTCDate() + 10);
|
|
|
31
28
|
const thePast = new Date(epoch);
|
|
32
29
|
thePast.setUTCDate(epoch.getUTCDate() - 10);
|
|
33
30
|
|
|
31
|
+
export const Sandbox = createSandboxStory({
|
|
32
|
+
code: `const App = () => {
|
|
33
|
+
const [value, setValue] = React.useState(new Date('2024-06-15'));
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Calendar
|
|
37
|
+
monthFormat="long"
|
|
38
|
+
value={value}
|
|
39
|
+
onChange={(date) => setValue(date)}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
};`,
|
|
43
|
+
scope: { ...globalScope, Calendar },
|
|
44
|
+
});
|
|
45
|
+
|
|
34
46
|
export const Basic: Story = {
|
|
35
47
|
render: (args: CalendarProps) => {
|
|
36
48
|
const [value, setValue] = useState<Date | null>(epoch);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Args } from '@storybook/react-webpack5';
|
|
2
2
|
import { Illustration } from '@wise/art';
|
|
3
|
+
import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
3
4
|
|
|
4
5
|
import Display from '../display';
|
|
5
6
|
|
|
@@ -53,6 +54,40 @@ const carouselCards: CarouselCard[] = [
|
|
|
53
54
|
},
|
|
54
55
|
];
|
|
55
56
|
|
|
57
|
+
export const Sandbox = createSandboxStory({
|
|
58
|
+
code: `const App = () => {
|
|
59
|
+
const cards = [
|
|
60
|
+
{
|
|
61
|
+
id: 'card-1',
|
|
62
|
+
type: 'button',
|
|
63
|
+
onClick: console.log,
|
|
64
|
+
content: (
|
|
65
|
+
<div className="d-flex p-a-1 flex-column align-items-center">
|
|
66
|
+
<Illustration disablePadding name="globe" size="small" alt="" />
|
|
67
|
+
</div>
|
|
68
|
+
),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'card-2',
|
|
72
|
+
type: 'promo',
|
|
73
|
+
href: '#',
|
|
74
|
+
title: 'Wise',
|
|
75
|
+
description: 'The best way to move money internationally',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'card-3',
|
|
79
|
+
type: 'anchor',
|
|
80
|
+
href: '#',
|
|
81
|
+
hrefTarget: '_blank',
|
|
82
|
+
content: <Display type="display-small">Get Quick Pay</Display>,
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
return <Carousel header="Carousel heading" cards={cards} />;
|
|
87
|
+
};`,
|
|
88
|
+
scope: globalScope,
|
|
89
|
+
});
|
|
90
|
+
|
|
56
91
|
export const CarouselDefault = {
|
|
57
92
|
render: (args: Args) => {
|
|
58
93
|
return <Carousel header="Pretty nifty stuff" cards={carouselCards} {...args} />;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { fn } from 'storybook/test';
|
|
3
3
|
|
|
4
|
+
import {
|
|
5
|
+
createSandboxStory,
|
|
6
|
+
globalScope,
|
|
7
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
4
8
|
import { Field } from '../field/Field';
|
|
5
9
|
|
|
6
10
|
import Checkbox from './Checkbox';
|
|
@@ -19,6 +23,22 @@ export default meta;
|
|
|
19
23
|
|
|
20
24
|
type Story = StoryObj<typeof Checkbox>;
|
|
21
25
|
|
|
26
|
+
export const Sandbox = createSandboxStory({
|
|
27
|
+
code: `const App = () => {
|
|
28
|
+
const [checked, setChecked] = React.useState(false);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Checkbox
|
|
32
|
+
label="I agree to the terms and conditions"
|
|
33
|
+
secondary="Please read before accepting"
|
|
34
|
+
checked={checked}
|
|
35
|
+
onChange={() => setChecked((prev) => !prev)}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
};`,
|
|
39
|
+
scope: globalScope,
|
|
40
|
+
});
|
|
41
|
+
|
|
22
42
|
export const Basic: Story = {};
|
|
23
43
|
|
|
24
44
|
export const Multiple: Story = {
|
|
@@ -3,6 +3,7 @@ import { fn } from 'storybook/test';
|
|
|
3
3
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
4
4
|
|
|
5
5
|
import { storySourceWithoutNoise } from '../../.storybook/helpers';
|
|
6
|
+
import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
6
7
|
import CheckboxButton, { type CheckboxButtonProps } from './CheckboxButton';
|
|
7
8
|
import { Label } from '../label/Label';
|
|
8
9
|
|
|
@@ -89,6 +90,21 @@ export const Playground: Story = storySourceWithoutNoise({
|
|
|
89
90
|
},
|
|
90
91
|
});
|
|
91
92
|
|
|
93
|
+
export const Sandbox = createSandboxStory({
|
|
94
|
+
code: `const App = () => {
|
|
95
|
+
const [checked, setChecked] = React.useState(true);
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<CheckboxButton
|
|
99
|
+
aria-label="Toggle email updates"
|
|
100
|
+
checked={checked}
|
|
101
|
+
onChange={(event) => setChecked(event.currentTarget.checked)}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
};`,
|
|
105
|
+
scope: globalScope,
|
|
106
|
+
});
|
|
107
|
+
|
|
92
108
|
/** Disabled state — checked and unchecked. */
|
|
93
109
|
export const Disabled: Story = {
|
|
94
110
|
decorators: [withColumnLayout],
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { createSandboxStory } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
2
3
|
|
|
3
4
|
import Chevron from './Chevron';
|
|
4
5
|
|
|
@@ -9,6 +10,11 @@ export default {
|
|
|
9
10
|
|
|
10
11
|
type Story = StoryObj<typeof Chevron>;
|
|
11
12
|
|
|
13
|
+
export const Sandbox = createSandboxStory({
|
|
14
|
+
code: `<Chevron orientation="bottom" size="md" />`,
|
|
15
|
+
scope: {Chevron},
|
|
16
|
+
});
|
|
17
|
+
|
|
12
18
|
export const Basic: Story = {
|
|
13
19
|
args: {
|
|
14
20
|
orientation: 'top',
|