@transferwise/components 0.0.0-experimental-6528439 → 0.0.0-experimental-1ffdc56
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/alert/Alert.js +33 -17
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +30 -14
- package/build/alert/Alert.mjs.map +1 -1
- package/build/avatarLayout/AvatarLayout.js +9 -2
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs +9 -2
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/button/Button.js +86 -79
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +87 -80
- package/build/button/Button.mjs.map +1 -1
- package/build/button/Button.resolver.js +74 -0
- package/build/button/Button.resolver.js.map +1 -0
- package/build/button/Button.resolver.mjs +72 -0
- package/build/button/Button.resolver.mjs.map +1 -0
- package/build/button/LegacyButton.js +114 -0
- package/build/button/LegacyButton.js.map +1 -0
- package/build/button/LegacyButton.mjs +112 -0
- package/build/button/LegacyButton.mjs.map +1 -0
- package/build/common/action/Action.js +26 -15
- package/build/common/action/Action.js.map +1 -1
- package/build/common/action/Action.mjs +26 -15
- package/build/common/action/Action.mjs.map +1 -1
- package/build/common/propsValues/sentiment.js +1 -0
- package/build/common/propsValues/sentiment.js.map +1 -1
- package/build/common/propsValues/sentiment.mjs +1 -0
- package/build/common/propsValues/sentiment.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +10 -73
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +11 -74
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +67 -41
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +69 -43
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/header/Header.js +2 -2
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +1 -1
- package/build/i18n/en.json +1 -0
- package/build/i18n/en.json.js +1 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +1 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/index.js +2 -2
- package/build/index.mjs +1 -1
- package/build/inputs/_BottomSheet.js +8 -1
- package/build/inputs/_BottomSheet.js.map +1 -1
- package/build/inputs/_BottomSheet.mjs +9 -2
- package/build/inputs/_BottomSheet.mjs.map +1 -1
- package/build/inputs/_Popover.js +8 -1
- package/build/inputs/_Popover.js.map +1 -1
- package/build/inputs/_Popover.mjs +9 -2
- package/build/inputs/_Popover.mjs.map +1 -1
- package/build/link/Link.js +8 -3
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +8 -3
- package/build/link/Link.mjs.map +1 -1
- package/build/main.css +250 -72
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js +2 -4
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +1 -1
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs +2 -4
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js +3 -5
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs +3 -5
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +1 -1
- package/build/select/Select.js +2 -2
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +1 -1
- package/build/statusIcon/StatusIcon.js +5 -1
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.js +3 -0
- package/build/statusIcon/StatusIcon.messages.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.mjs +3 -0
- package/build/statusIcon/StatusIcon.messages.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +5 -1
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/avatarLayout/AvatarLayout.css +11 -0
- package/build/styles/button/Button.css +220 -15
- package/build/styles/button/Button.vars.css +46 -0
- package/build/styles/button/LegacyButton.css +23 -0
- package/build/styles/criticalBanner/CriticalCommsBanner.css +7 -72
- package/build/styles/main.css +250 -72
- package/build/styles/statusIcon/StatusIcon.css +4 -0
- package/build/types/alert/Alert.d.ts +2 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
- package/build/types/button/Button.d.ts +2 -23
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/Button.resolver.d.ts +35 -0
- package/build/types/button/Button.resolver.d.ts.map +1 -0
- package/build/types/button/Button.types.d.ts +70 -0
- package/build/types/button/Button.types.d.ts.map +1 -0
- package/build/types/button/LegacyButton.d.ts +44 -0
- package/build/types/button/LegacyButton.d.ts.map +1 -0
- package/build/types/button/index.d.ts +2 -2
- package/build/types/button/index.d.ts.map +1 -1
- package/build/types/common/action/Action.d.ts +4 -1
- package/build/types/common/action/Action.d.ts.map +1 -1
- package/build/types/common/propsValues/sentiment.d.ts +1 -0
- package/build/types/common/propsValues/sentiment.d.ts.map +1 -1
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts.map +1 -1
- package/build/types/link/Link.d.ts +2 -2
- package/build/types/link/Link.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts +6 -2
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.messages.d.ts +5 -0
- package/build/types/statusIcon/StatusIcon.messages.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +2 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts +1 -1
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/build/types/withNextPortal/withNextPortal.d.ts.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +2 -2
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +1 -1
- package/build/upload/steps/processingStep/processingStep.js +2 -2
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -1
- package/build/uploadInput/UploadInput.js +3 -3
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -1
- package/build/withNextPortal/withNextPortal.js +2 -5
- package/build/withNextPortal/withNextPortal.js.map +1 -1
- package/build/withNextPortal/withNextPortal.mjs +2 -5
- package/build/withNextPortal/withNextPortal.mjs.map +1 -1
- package/package.json +5 -5
- package/src/alert/Alert.story.tsx +36 -0
- package/src/alert/Alert.tests.story.tsx +1 -1
- package/src/alert/Alert.tsx +37 -8
- package/src/avatarLayout/AvatarLayout.css +11 -0
- package/src/avatarLayout/AvatarLayout.less +18 -1
- package/src/avatarLayout/AvatarLayout.tsx +10 -2
- package/src/button/Button.accessibility.docs.mdx +103 -0
- package/src/button/Button.css +220 -15
- package/src/button/Button.less +228 -13
- package/src/button/Button.resolver.tsx +73 -0
- package/src/button/Button.spec.tsx +215 -226
- package/src/button/Button.story.tsx +761 -134
- package/src/button/Button.tests.story.tsx +27 -0
- package/src/button/Button.tsx +99 -132
- package/src/button/Button.types.ts +92 -0
- package/src/button/Button.vars.css +46 -0
- package/src/button/Button.vars.less +57 -0
- package/src/button/LegacyButton.css +23 -0
- package/src/button/LegacyButton.less +24 -0
- package/src/button/LegacyButton.spec.tsx +147 -0
- package/src/button/LegacyButton.story.tsx +228 -0
- package/src/button/LegacyButton.tsx +177 -0
- package/src/button/index.ts +2 -3
- package/src/common/action/Action.tsx +39 -21
- package/src/common/bottomSheet/BottomSheet.spec.tsx +3 -6
- package/src/common/bottomSheet/__snapshots__/BottomSheet.spec.tsx.snap +1 -5
- package/src/common/propsValues/sentiment.ts +1 -0
- package/src/criticalBanner/CriticalCommsBanner.css +7 -72
- package/src/criticalBanner/CriticalCommsBanner.less +12 -73
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +13 -9
- package/src/criticalBanner/CriticalCommsBanner.tsx +8 -50
- package/src/dimmer/Dimmer.tsx +72 -44
- package/src/field/Field.story.tsx +1 -1
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +1 -2
- package/src/i18n/en.json +1 -0
- package/src/inputs/SelectInput.story.tsx +1 -1
- package/src/inputs/_BottomSheet.tsx +9 -3
- package/src/inputs/_Popover.tsx +10 -4
- package/src/label/Label.story.tsx +1 -1
- package/src/link/Link.tsx +15 -6
- package/src/main.css +250 -72
- package/src/main.less +1 -0
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.tsx +2 -8
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.ts +7 -2
- package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +1 -3
- package/src/primitives/PrimitiveButton/src/PrimitiveButton.tsx +4 -12
- package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +16 -13
- package/src/statusIcon/StatusIcon.css +4 -0
- package/src/statusIcon/StatusIcon.less +4 -0
- package/src/statusIcon/StatusIcon.messages.ts +6 -0
- package/src/statusIcon/StatusIcon.tsx +8 -1
- package/src/test-utils/Parameters.d.ts +9 -1
- package/src/test-utils/story-config.ts +10 -1
- package/src/withNextPortal/withNextPortal.tsx +1 -10
- package/src/button/__snapshots__/Button.spec.tsx.snap +0 -309
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import LegacyButton from './LegacyButton.mjs';
|
|
3
|
+
import Button$1 from './Button.mjs';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const mapProps = props => {
|
|
7
|
+
const {
|
|
8
|
+
priority,
|
|
9
|
+
size,
|
|
10
|
+
type,
|
|
11
|
+
...newProps
|
|
12
|
+
} = props;
|
|
13
|
+
const priorityMapping = {
|
|
14
|
+
accent: {
|
|
15
|
+
primary: 'primary',
|
|
16
|
+
secondary: 'tertiary',
|
|
17
|
+
tertiary: 'minimal'
|
|
18
|
+
},
|
|
19
|
+
positive: {
|
|
20
|
+
primary: 'primary',
|
|
21
|
+
secondary: 'tertiary',
|
|
22
|
+
tertiary: 'tertiary'
|
|
23
|
+
},
|
|
24
|
+
negative: {
|
|
25
|
+
primary: 'primary',
|
|
26
|
+
secondary: 'secondary',
|
|
27
|
+
tertiary: 'secondary'
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const mappedPriority = type && priority ? priorityMapping[type]?.[priority] || priority : priority || undefined;
|
|
31
|
+
const mappedSentiment = type === 'negative' ? 'negative' : undefined;
|
|
32
|
+
const legacyButtonTypes = ['accent', 'negative', 'positive', 'primary', 'pay', 'secondary', 'danger', 'link'];
|
|
33
|
+
const resolveSize = () => {
|
|
34
|
+
if (size) {
|
|
35
|
+
return {
|
|
36
|
+
xs: 'sm',
|
|
37
|
+
sm: 'sm',
|
|
38
|
+
md: 'md',
|
|
39
|
+
lg: 'lg'
|
|
40
|
+
}[size] || size;
|
|
41
|
+
}
|
|
42
|
+
return size;
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
...newProps,
|
|
46
|
+
size: resolveSize(),
|
|
47
|
+
priority: mappedPriority,
|
|
48
|
+
sentiment: mappedSentiment || ('sentiment' in props ? props.sentiment : null),
|
|
49
|
+
type: type && !legacyButtonTypes.includes(type) ? type : props.htmlType || null,
|
|
50
|
+
v2: true
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
const Button = /*#__PURE__*/forwardRef(({
|
|
54
|
+
v2 = false,
|
|
55
|
+
...props
|
|
56
|
+
}, ref) => {
|
|
57
|
+
if (v2) {
|
|
58
|
+
const mappedProps = mapProps(props);
|
|
59
|
+
return /*#__PURE__*/jsx(Button$1, {
|
|
60
|
+
...mappedProps,
|
|
61
|
+
ref: ref
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return /*#__PURE__*/jsx(LegacyButton, {
|
|
65
|
+
...props,
|
|
66
|
+
ref: ref
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
Button.displayName = 'Button';
|
|
70
|
+
|
|
71
|
+
export { Button as default };
|
|
72
|
+
//# sourceMappingURL=Button.resolver.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.resolver.mjs","sources":["../../src/button/Button.resolver.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport LegacyButton, { LegacyButtonProps } from './LegacyButton';\nimport { ButtonReferenceType, ButtonProps as NewButtonProps } from './Button.types';\nimport NewButton from './Button';\n\nexport type ButtonProps = LegacyButtonProps | NewButtonProps;\n\nconst mapProps = (props: LegacyButtonProps): NewButtonProps => {\n const { priority, size, type, ...newProps } = props;\n\n const priorityMapping: Record<string, Record<string, NewButtonProps['priority']>> = {\n accent: {\n primary: 'primary',\n secondary: 'tertiary',\n tertiary: 'minimal',\n },\n positive: {\n primary: 'primary',\n secondary: 'tertiary',\n tertiary: 'tertiary',\n },\n negative: {\n primary: 'primary',\n secondary: 'secondary',\n tertiary: 'secondary',\n },\n };\n\n const mappedPriority =\n type && priority ? priorityMapping[type]?.[priority] || priority : priority || undefined;\n const mappedSentiment = type === 'negative' ? 'negative' : undefined;\n\n const legacyButtonTypes: LegacyButtonProps['type'][] = [\n 'accent',\n 'negative',\n 'positive',\n 'primary',\n 'pay',\n 'secondary',\n 'danger',\n 'link',\n ];\n\n const resolveSize = () => {\n if (size) {\n return { xs: 'sm', sm: 'sm', md: 'md', lg: 'lg' }[size] || size;\n }\n\n return size;\n };\n\n return {\n ...newProps,\n size: resolveSize(),\n priority: mappedPriority,\n sentiment: mappedSentiment || ('sentiment' in props ? props.sentiment : null),\n type: type && !legacyButtonTypes.includes(type) ? type : props.htmlType || null,\n v2: true,\n } as NewButtonProps;\n};\n\nconst Button = forwardRef<ButtonReferenceType, ButtonProps>(({ v2 = false, ...props }, ref) => {\n if (v2) {\n const mappedProps = mapProps(props as LegacyButtonProps);\n return <NewButton {...mappedProps} ref={ref} />;\n }\n\n return <LegacyButton {...(props as LegacyButtonProps)} ref={ref} />;\n});\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["mapProps","props","priority","size","type","newProps","priorityMapping","accent","primary","secondary","tertiary","positive","negative","mappedPriority","undefined","mappedSentiment","legacyButtonTypes","resolveSize","xs","sm","md","lg","sentiment","includes","htmlType","v2","Button","forwardRef","ref","mappedProps","_jsx","NewButton","LegacyButton","displayName"],"mappings":";;;;;AAOA,MAAMA,QAAQ,GAAIC,KAAwB,IAAoB;EAC5D,MAAM;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,IAAI;IAAE,GAAGC,QAAAA;AAAQ,GAAE,GAAGJ,KAAK,CAAA;AAEnD,EAAA,MAAMK,eAAe,GAA+D;AAClFC,IAAAA,MAAM,EAAE;AACNC,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,SAAS,EAAE,UAAU;AACrBC,MAAAA,QAAQ,EAAE,SAAA;KACX;AACDC,IAAAA,QAAQ,EAAE;AACRH,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,SAAS,EAAE,UAAU;AACrBC,MAAAA,QAAQ,EAAE,UAAA;KACX;AACDE,IAAAA,QAAQ,EAAE;AACRJ,MAAAA,OAAO,EAAE,SAAS;AAClBC,MAAAA,SAAS,EAAE,WAAW;AACtBC,MAAAA,QAAQ,EAAE,WAAA;AACX,KAAA;GACF,CAAA;AAED,EAAA,MAAMG,cAAc,GAClBT,IAAI,IAAIF,QAAQ,GAAGI,eAAe,CAACF,IAAI,CAAC,GAAGF,QAAQ,CAAC,IAAIA,QAAQ,GAAGA,QAAQ,IAAIY,SAAS,CAAA;EAC1F,MAAMC,eAAe,GAAGX,IAAI,KAAK,UAAU,GAAG,UAAU,GAAGU,SAAS,CAAA;AAEpE,EAAA,MAAME,iBAAiB,GAAgC,CACrD,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,CACP,CAAA;EAED,MAAMC,WAAW,GAAGA,MAAK;AACvB,IAAA,IAAId,IAAI,EAAE;MACR,OAAO;AAAEe,QAAAA,EAAE,EAAE,IAAI;AAAEC,QAAAA,EAAE,EAAE,IAAI;AAAEC,QAAAA,EAAE,EAAE,IAAI;AAAEC,QAAAA,EAAE,EAAE,IAAA;AAAI,OAAE,CAAClB,IAAI,CAAC,IAAIA,IAAI,CAAA;AACjE,KAAA;AAEA,IAAA,OAAOA,IAAI,CAAA;GACZ,CAAA;EAED,OAAO;AACL,IAAA,GAAGE,QAAQ;IACXF,IAAI,EAAEc,WAAW,EAAE;AACnBf,IAAAA,QAAQ,EAAEW,cAAc;AACxBS,IAAAA,SAAS,EAAEP,eAAe,KAAK,WAAW,IAAId,KAAK,GAAGA,KAAK,CAACqB,SAAS,GAAG,IAAI,CAAC;AAC7ElB,IAAAA,IAAI,EAAEA,IAAI,IAAI,CAACY,iBAAiB,CAACO,QAAQ,CAACnB,IAAI,CAAC,GAAGA,IAAI,GAAGH,KAAK,CAACuB,QAAQ,IAAI,IAAI;AAC/EC,IAAAA,EAAE,EAAE,IAAA;GACa,CAAA;AACrB,CAAC,CAAA;AAED,MAAMC,MAAM,gBAAGC,UAAU,CAAmC,CAAC;AAAEF,EAAAA,EAAE,GAAG,KAAK;EAAE,GAAGxB,KAAAA;AAAK,CAAE,EAAE2B,GAAG,KAAI;AAC5F,EAAA,IAAIH,EAAE,EAAE;AACN,IAAA,MAAMI,WAAW,GAAG7B,QAAQ,CAACC,KAA0B,CAAC,CAAA;IACxD,oBAAO6B,GAAA,CAACC,QAAS,EAAA;AAAA,MAAA,GAAKF,WAAW;AAAED,MAAAA,GAAG,EAAEA,GAAAA;AAAI,MAAG,CAAA;AACjD,GAAA;EAEA,oBAAOE,GAAA,CAACE,YAAY,EAAA;AAAA,IAAA,GAAM/B,KAA2B;AAAE2B,IAAAA,GAAG,EAAEA,GAAAA;AAAI,IAAG,CAAA;AACrE,CAAC,EAAC;AAEFF,MAAM,CAACO,WAAW,GAAG,QAAQ;;;;"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var clsx = require('clsx');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var reactIntl = require('react-intl');
|
|
6
|
+
require('../common/theme.js');
|
|
7
|
+
require('../common/direction.js');
|
|
8
|
+
var control = require('../common/propsValues/control.js');
|
|
9
|
+
require('../common/propsValues/breakpoint.js');
|
|
10
|
+
var size = require('../common/propsValues/size.js');
|
|
11
|
+
require('../common/propsValues/typography.js');
|
|
12
|
+
require('../common/propsValues/width.js');
|
|
13
|
+
require('../common/propsValues/type.js');
|
|
14
|
+
require('../common/propsValues/dateMode.js');
|
|
15
|
+
require('../common/propsValues/monthFormat.js');
|
|
16
|
+
require('../common/propsValues/position.js');
|
|
17
|
+
require('../common/propsValues/layouts.js');
|
|
18
|
+
require('../common/propsValues/status.js');
|
|
19
|
+
require('../common/propsValues/sentiment.js');
|
|
20
|
+
require('../common/propsValues/profileType.js');
|
|
21
|
+
require('../common/propsValues/variant.js');
|
|
22
|
+
require('../common/propsValues/scroll.js');
|
|
23
|
+
require('../common/propsValues/markdownNodeType.js');
|
|
24
|
+
require('../common/fileType.js');
|
|
25
|
+
require('@transferwise/icons');
|
|
26
|
+
require('../common/closeButton/CloseButton.messages.js');
|
|
27
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
28
|
+
var ProcessIndicator = require('../processIndicator/ProcessIndicator.js');
|
|
29
|
+
var Button_messages = require('../i18n/commonMessages/Button.messages.js');
|
|
30
|
+
var classMap = require('./classMap.js');
|
|
31
|
+
var legacyUtils = require('./legacyUtils/legacyUtils.js');
|
|
32
|
+
|
|
33
|
+
const LegacyButton = /*#__PURE__*/React.forwardRef(({
|
|
34
|
+
as: component = 'button',
|
|
35
|
+
block = false,
|
|
36
|
+
children,
|
|
37
|
+
className,
|
|
38
|
+
disabled,
|
|
39
|
+
loading = false,
|
|
40
|
+
priority = control.Priority.PRIMARY,
|
|
41
|
+
size: size$1 = size.Size.MEDIUM,
|
|
42
|
+
type = control.ControlType.ACCENT,
|
|
43
|
+
onClick,
|
|
44
|
+
...rest
|
|
45
|
+
}, ref) => {
|
|
46
|
+
const intl = reactIntl.useIntl();
|
|
47
|
+
legacyUtils.logDeprecationNotices({
|
|
48
|
+
size: size$1,
|
|
49
|
+
type
|
|
50
|
+
});
|
|
51
|
+
const newType = legacyUtils.establishNewType(type);
|
|
52
|
+
const newPriority = legacyUtils.establishNewPriority(priority, type);
|
|
53
|
+
const classes = clsx.clsx(`btn btn-${size$1}`, `np-btn np-btn-${size$1}`, {
|
|
54
|
+
'btn-loading': loading,
|
|
55
|
+
'btn-block np-btn-block': block,
|
|
56
|
+
disabled
|
|
57
|
+
},
|
|
58
|
+
// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
60
|
+
classMap.typeClassMap[newType],
|
|
61
|
+
// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
63
|
+
classMap.priorityClassMap[newPriority], className);
|
|
64
|
+
function processIndicatorSize() {
|
|
65
|
+
return ['sm', 'xs'].includes(size$1) ? 'xxs' : 'xs';
|
|
66
|
+
}
|
|
67
|
+
const Element = component ?? 'button';
|
|
68
|
+
let props;
|
|
69
|
+
if (Element === 'button') {
|
|
70
|
+
const {
|
|
71
|
+
htmlType = 'button',
|
|
72
|
+
...restProps
|
|
73
|
+
} = rest;
|
|
74
|
+
props = {
|
|
75
|
+
...restProps,
|
|
76
|
+
disabled,
|
|
77
|
+
'aria-disabled': loading,
|
|
78
|
+
type: htmlType
|
|
79
|
+
};
|
|
80
|
+
} else {
|
|
81
|
+
props = {
|
|
82
|
+
...rest,
|
|
83
|
+
'aria-disabled': loading
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Ensures that the button cannot be activated in loading or disabled mode,
|
|
88
|
+
* when `aria-disabled` might be used over the `disabled` HTML attribute
|
|
89
|
+
*/
|
|
90
|
+
const handleClick = handler => event => {
|
|
91
|
+
if (disabled || loading) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
} else if (typeof handler === 'function') {
|
|
94
|
+
handler(event);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Element, {
|
|
98
|
+
ref: ref,
|
|
99
|
+
className: classes,
|
|
100
|
+
onClick: handleClick(onClick),
|
|
101
|
+
...props,
|
|
102
|
+
"aria-live": loading ? 'polite' : 'off',
|
|
103
|
+
"aria-busy": loading,
|
|
104
|
+
"aria-label": loading ? intl.formatMessage(Button_messages.loadingAriaLabel) : rest['aria-label'],
|
|
105
|
+
children: [children, loading && /*#__PURE__*/jsxRuntime.jsx(ProcessIndicator, {
|
|
106
|
+
size: processIndicatorSize(),
|
|
107
|
+
className: "btn-loader",
|
|
108
|
+
"data-testid": "ButtonProgressIndicator"
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
module.exports = LegacyButton;
|
|
114
|
+
//# sourceMappingURL=LegacyButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyButton.js","sources":["../../src/button/LegacyButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ElementType, forwardRef, MouseEvent } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport {\n Size,\n ControlType,\n Priority,\n ControlTypeAccent,\n ControlTypeNegative,\n ControlTypePositive,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n SizeExtraSmall,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n} from '../common';\nimport ProcessIndicator from '../processIndicator';\n\nimport messages from '../i18n/commonMessages/Button.messages';\nimport { typeClassMap, priorityClassMap } from './classMap';\nimport { establishNewPriority, establishNewType, logDeprecationNotices } from './legacyUtils';\nimport { ButtonReferenceType } from './Button.types';\n\n/** @deprecated */\ntype DeprecatedTypes = 'primary' | 'pay' | 'secondary' | 'danger' | 'link';\n\n/** @deprecated */\ntype DeprecatedSizes = SizeExtraSmall;\n\ntype CommonProps = {\n v2?: false;\n\n /** Makes the button take up the full width of its container */\n block?: boolean;\n\n /**\n * The `target` attribute for HTML anchor.\n * If set to `_blank`, `rel=\"noopener noreferrer\"` is automatically added to the rendered node.\n */\n target?: string;\n /**\n * Toggles the disabled state\n * @default false\n */\n\n disabled?: boolean;\n /**\n * Toggles the loading state\n * @default false\n */\n loading?: boolean;\n type?: ControlTypeAccent | ControlTypeNegative | ControlTypePositive | DeprecatedTypes | null;\n priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary | null;\n size?: SizeSmall | SizeMedium | SizeLarge | DeprecatedSizes;\n htmlType?: 'submit' | 'reset' | 'button';\n};\n\ntype ButtonProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'button'>, 'type'> & {\n as?: 'button';\n };\n\ntype AnchorProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'a'>, 'type'> & {\n as?: 'a';\n href?: string;\n };\n\nexport type LegacyButtonProps = ButtonProps | AnchorProps;\n\n/**\n * @deprecated make sure you use new Button component via `<Button v2 .. />` and new props\n */\nconst LegacyButton = forwardRef<ButtonReferenceType, LegacyButtonProps>(\n (\n {\n as: component = 'button',\n block = false,\n children,\n className,\n disabled,\n loading = false,\n priority = Priority.PRIMARY,\n size = Size.MEDIUM,\n type = ControlType.ACCENT,\n onClick,\n ...rest\n }: LegacyButtonProps,\n ref,\n ) => {\n const intl = useIntl();\n\n logDeprecationNotices({ size, type });\n\n const newType = establishNewType(type);\n const newPriority = establishNewPriority(priority, type);\n\n const classes = clsx(\n `btn btn-${size}`,\n `np-btn np-btn-${size}`,\n {\n 'btn-loading': loading,\n 'btn-block np-btn-block': block,\n disabled,\n },\n // @ts-expect-error fix when refactor `typeClassMap` to TypeScript\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n typeClassMap[newType],\n // @ts-expect-error fix when refactor `typeClassMap` to TypeScript\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n priorityClassMap[newPriority],\n className,\n );\n\n function processIndicatorSize() {\n return ['sm', 'xs'].includes(size) ? 'xxs' : 'xs';\n }\n\n const Element = (component as ElementType) ?? 'button';\n let props;\n\n if (Element === 'button') {\n const { htmlType = 'button', ...restProps } = rest as ButtonProps;\n props = {\n ...restProps,\n disabled,\n 'aria-disabled': loading,\n type: htmlType,\n };\n } else {\n props = {\n ...rest,\n 'aria-disabled': loading,\n } as AnchorProps;\n }\n\n /**\n * Ensures that the button cannot be activated in loading or disabled mode,\n * when `aria-disabled` might be used over the `disabled` HTML attribute\n */\n const handleClick =\n (handler: LegacyButtonProps['onClick']) =>\n (event: MouseEvent<HTMLButtonElement> & MouseEvent<HTMLAnchorElement>) => {\n if (disabled || loading) {\n event.preventDefault();\n } else if (typeof handler === 'function') {\n handler(event);\n }\n };\n\n return (\n <Element\n ref={ref as React.Ref<ButtonReferenceType>}\n className={classes}\n onClick={handleClick(onClick)}\n {...props}\n aria-live={loading ? 'polite' : 'off'}\n aria-busy={loading}\n aria-label={loading ? intl.formatMessage(messages.loadingAriaLabel) : rest['aria-label']}\n >\n {children}\n {loading && (\n <ProcessIndicator\n size={processIndicatorSize()}\n className=\"btn-loader\"\n data-testid=\"ButtonProgressIndicator\"\n />\n )}\n </Element>\n );\n },\n);\n\nexport default LegacyButton;\n"],"names":["LegacyButton","forwardRef","as","component","block","children","className","disabled","loading","priority","Priority","PRIMARY","size","Size","MEDIUM","type","ControlType","ACCENT","onClick","rest","ref","intl","useIntl","logDeprecationNotices","newType","establishNewType","newPriority","establishNewPriority","classes","clsx","typeClassMap","priorityClassMap","processIndicatorSize","includes","Element","props","htmlType","restProps","handleClick","handler","event","preventDefault","_jsxs","formatMessage","messages","loadingAriaLabel","_jsx","ProcessIndicator"],"mappings":"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"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import '../common/theme.mjs';
|
|
5
|
+
import '../common/direction.mjs';
|
|
6
|
+
import { Priority, ControlType } from '../common/propsValues/control.mjs';
|
|
7
|
+
import '../common/propsValues/breakpoint.mjs';
|
|
8
|
+
import { Size } from '../common/propsValues/size.mjs';
|
|
9
|
+
import '../common/propsValues/typography.mjs';
|
|
10
|
+
import '../common/propsValues/width.mjs';
|
|
11
|
+
import '../common/propsValues/type.mjs';
|
|
12
|
+
import '../common/propsValues/dateMode.mjs';
|
|
13
|
+
import '../common/propsValues/monthFormat.mjs';
|
|
14
|
+
import '../common/propsValues/position.mjs';
|
|
15
|
+
import '../common/propsValues/layouts.mjs';
|
|
16
|
+
import '../common/propsValues/status.mjs';
|
|
17
|
+
import '../common/propsValues/sentiment.mjs';
|
|
18
|
+
import '../common/propsValues/profileType.mjs';
|
|
19
|
+
import '../common/propsValues/variant.mjs';
|
|
20
|
+
import '../common/propsValues/scroll.mjs';
|
|
21
|
+
import '../common/propsValues/markdownNodeType.mjs';
|
|
22
|
+
import '../common/fileType.mjs';
|
|
23
|
+
import '@transferwise/icons';
|
|
24
|
+
import '../common/closeButton/CloseButton.messages.mjs';
|
|
25
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
26
|
+
import ProcessIndicator from '../processIndicator/ProcessIndicator.mjs';
|
|
27
|
+
import messages from '../i18n/commonMessages/Button.messages.mjs';
|
|
28
|
+
import { typeClassMap, priorityClassMap } from './classMap.mjs';
|
|
29
|
+
import { logDeprecationNotices, establishNewType, establishNewPriority } from './legacyUtils/legacyUtils.mjs';
|
|
30
|
+
|
|
31
|
+
const LegacyButton = /*#__PURE__*/forwardRef(({
|
|
32
|
+
as: component = 'button',
|
|
33
|
+
block = false,
|
|
34
|
+
children,
|
|
35
|
+
className,
|
|
36
|
+
disabled,
|
|
37
|
+
loading = false,
|
|
38
|
+
priority = Priority.PRIMARY,
|
|
39
|
+
size = Size.MEDIUM,
|
|
40
|
+
type = ControlType.ACCENT,
|
|
41
|
+
onClick,
|
|
42
|
+
...rest
|
|
43
|
+
}, ref) => {
|
|
44
|
+
const intl = useIntl();
|
|
45
|
+
logDeprecationNotices({
|
|
46
|
+
size,
|
|
47
|
+
type
|
|
48
|
+
});
|
|
49
|
+
const newType = establishNewType(type);
|
|
50
|
+
const newPriority = establishNewPriority(priority, type);
|
|
51
|
+
const classes = clsx(`btn btn-${size}`, `np-btn np-btn-${size}`, {
|
|
52
|
+
'btn-loading': loading,
|
|
53
|
+
'btn-block np-btn-block': block,
|
|
54
|
+
disabled
|
|
55
|
+
},
|
|
56
|
+
// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
58
|
+
typeClassMap[newType],
|
|
59
|
+
// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
61
|
+
priorityClassMap[newPriority], className);
|
|
62
|
+
function processIndicatorSize() {
|
|
63
|
+
return ['sm', 'xs'].includes(size) ? 'xxs' : 'xs';
|
|
64
|
+
}
|
|
65
|
+
const Element = component ?? 'button';
|
|
66
|
+
let props;
|
|
67
|
+
if (Element === 'button') {
|
|
68
|
+
const {
|
|
69
|
+
htmlType = 'button',
|
|
70
|
+
...restProps
|
|
71
|
+
} = rest;
|
|
72
|
+
props = {
|
|
73
|
+
...restProps,
|
|
74
|
+
disabled,
|
|
75
|
+
'aria-disabled': loading,
|
|
76
|
+
type: htmlType
|
|
77
|
+
};
|
|
78
|
+
} else {
|
|
79
|
+
props = {
|
|
80
|
+
...rest,
|
|
81
|
+
'aria-disabled': loading
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Ensures that the button cannot be activated in loading or disabled mode,
|
|
86
|
+
* when `aria-disabled` might be used over the `disabled` HTML attribute
|
|
87
|
+
*/
|
|
88
|
+
const handleClick = handler => event => {
|
|
89
|
+
if (disabled || loading) {
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
} else if (typeof handler === 'function') {
|
|
92
|
+
handler(event);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return /*#__PURE__*/jsxs(Element, {
|
|
96
|
+
ref: ref,
|
|
97
|
+
className: classes,
|
|
98
|
+
onClick: handleClick(onClick),
|
|
99
|
+
...props,
|
|
100
|
+
"aria-live": loading ? 'polite' : 'off',
|
|
101
|
+
"aria-busy": loading,
|
|
102
|
+
"aria-label": loading ? intl.formatMessage(messages.loadingAriaLabel) : rest['aria-label'],
|
|
103
|
+
children: [children, loading && /*#__PURE__*/jsx(ProcessIndicator, {
|
|
104
|
+
size: processIndicatorSize(),
|
|
105
|
+
className: "btn-loader",
|
|
106
|
+
"data-testid": "ButtonProgressIndicator"
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export { LegacyButton as default };
|
|
112
|
+
//# sourceMappingURL=LegacyButton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyButton.mjs","sources":["../../src/button/LegacyButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ElementType, forwardRef, MouseEvent } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport {\n Size,\n ControlType,\n Priority,\n ControlTypeAccent,\n ControlTypeNegative,\n ControlTypePositive,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n SizeExtraSmall,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n} from '../common';\nimport ProcessIndicator from '../processIndicator';\n\nimport messages from '../i18n/commonMessages/Button.messages';\nimport { typeClassMap, priorityClassMap } from './classMap';\nimport { establishNewPriority, establishNewType, logDeprecationNotices } from './legacyUtils';\nimport { ButtonReferenceType } from './Button.types';\n\n/** @deprecated */\ntype DeprecatedTypes = 'primary' | 'pay' | 'secondary' | 'danger' | 'link';\n\n/** @deprecated */\ntype DeprecatedSizes = SizeExtraSmall;\n\ntype CommonProps = {\n v2?: false;\n\n /** Makes the button take up the full width of its container */\n block?: boolean;\n\n /**\n * The `target` attribute for HTML anchor.\n * If set to `_blank`, `rel=\"noopener noreferrer\"` is automatically added to the rendered node.\n */\n target?: string;\n /**\n * Toggles the disabled state\n * @default false\n */\n\n disabled?: boolean;\n /**\n * Toggles the loading state\n * @default false\n */\n loading?: boolean;\n type?: ControlTypeAccent | ControlTypeNegative | ControlTypePositive | DeprecatedTypes | null;\n priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary | null;\n size?: SizeSmall | SizeMedium | SizeLarge | DeprecatedSizes;\n htmlType?: 'submit' | 'reset' | 'button';\n};\n\ntype ButtonProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'button'>, 'type'> & {\n as?: 'button';\n };\n\ntype AnchorProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'a'>, 'type'> & {\n as?: 'a';\n href?: string;\n };\n\nexport type LegacyButtonProps = ButtonProps | AnchorProps;\n\n/**\n * @deprecated make sure you use new Button component via `<Button v2 .. />` and new props\n */\nconst LegacyButton = forwardRef<ButtonReferenceType, LegacyButtonProps>(\n (\n {\n as: component = 'button',\n block = false,\n children,\n className,\n disabled,\n loading = false,\n priority = Priority.PRIMARY,\n size = Size.MEDIUM,\n type = ControlType.ACCENT,\n onClick,\n ...rest\n }: LegacyButtonProps,\n ref,\n ) => {\n const intl = useIntl();\n\n logDeprecationNotices({ size, type });\n\n const newType = establishNewType(type);\n const newPriority = establishNewPriority(priority, type);\n\n const classes = clsx(\n `btn btn-${size}`,\n `np-btn np-btn-${size}`,\n {\n 'btn-loading': loading,\n 'btn-block np-btn-block': block,\n disabled,\n },\n // @ts-expect-error fix when refactor `typeClassMap` to TypeScript\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n typeClassMap[newType],\n // @ts-expect-error fix when refactor `typeClassMap` to TypeScript\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n priorityClassMap[newPriority],\n className,\n );\n\n function processIndicatorSize() {\n return ['sm', 'xs'].includes(size) ? 'xxs' : 'xs';\n }\n\n const Element = (component as ElementType) ?? 'button';\n let props;\n\n if (Element === 'button') {\n const { htmlType = 'button', ...restProps } = rest as ButtonProps;\n props = {\n ...restProps,\n disabled,\n 'aria-disabled': loading,\n type: htmlType,\n };\n } else {\n props = {\n ...rest,\n 'aria-disabled': loading,\n } as AnchorProps;\n }\n\n /**\n * Ensures that the button cannot be activated in loading or disabled mode,\n * when `aria-disabled` might be used over the `disabled` HTML attribute\n */\n const handleClick =\n (handler: LegacyButtonProps['onClick']) =>\n (event: MouseEvent<HTMLButtonElement> & MouseEvent<HTMLAnchorElement>) => {\n if (disabled || loading) {\n event.preventDefault();\n } else if (typeof handler === 'function') {\n handler(event);\n }\n };\n\n return (\n <Element\n ref={ref as React.Ref<ButtonReferenceType>}\n className={classes}\n onClick={handleClick(onClick)}\n {...props}\n aria-live={loading ? 'polite' : 'off'}\n aria-busy={loading}\n aria-label={loading ? intl.formatMessage(messages.loadingAriaLabel) : rest['aria-label']}\n >\n {children}\n {loading && (\n <ProcessIndicator\n size={processIndicatorSize()}\n className=\"btn-loader\"\n data-testid=\"ButtonProgressIndicator\"\n />\n )}\n </Element>\n );\n },\n);\n\nexport default LegacyButton;\n"],"names":["LegacyButton","forwardRef","as","component","block","children","className","disabled","loading","priority","Priority","PRIMARY","size","Size","MEDIUM","type","ControlType","ACCENT","onClick","rest","ref","intl","useIntl","logDeprecationNotices","newType","establishNewType","newPriority","establishNewPriority","classes","clsx","typeClassMap","priorityClassMap","processIndicatorSize","includes","Element","props","htmlType","restProps","handleClick","handler","event","preventDefault","_jsxs","formatMessage","messages","loadingAriaLabel","_jsx","ProcessIndicator"],"mappings":"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"}
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
var clsx = require('clsx');
|
|
4
4
|
var Link = require('../../link/Link.js');
|
|
5
5
|
var typography = require('../propsValues/typography.js');
|
|
6
|
-
var ActionButton = require('../../actionButton/ActionButton.js');
|
|
7
6
|
var control = require('../propsValues/control.js');
|
|
7
|
+
var Button_resolver = require('../../button/Button.resolver.js');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
|
|
10
10
|
function Action({
|
|
11
11
|
action,
|
|
12
12
|
className,
|
|
13
|
-
variant = 'button'
|
|
13
|
+
variant = 'button',
|
|
14
|
+
priority = control.Priority.SECONDARY,
|
|
15
|
+
sentiment = 'default'
|
|
14
16
|
}) {
|
|
15
17
|
if ('href' in action) {
|
|
16
18
|
return /*#__PURE__*/jsxRuntime.jsx(Link, {
|
|
@@ -23,19 +25,28 @@ function Action({
|
|
|
23
25
|
children: action.text
|
|
24
26
|
});
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
switch (variant) {
|
|
29
|
+
case 'action-button':
|
|
30
|
+
return /*#__PURE__*/jsxRuntime.jsx(Button_resolver, {
|
|
31
|
+
v2: true,
|
|
32
|
+
size: "sm",
|
|
33
|
+
sentiment: sentiment,
|
|
34
|
+
"aria-label": action['aria-label'],
|
|
35
|
+
priority: priority,
|
|
36
|
+
className: clsx.clsx(className),
|
|
37
|
+
onClick: action.onClick,
|
|
38
|
+
children: action.text
|
|
39
|
+
});
|
|
40
|
+
case 'button':
|
|
41
|
+
default:
|
|
42
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
"aria-label": action['aria-label'],
|
|
45
|
+
className: clsx.clsx('btn-unstyled np-text-link-large', className),
|
|
46
|
+
onClick: action.onClick,
|
|
47
|
+
children: action.text
|
|
48
|
+
});
|
|
49
|
+
}
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
exports.Action = Action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.js","sources":["../../../src/common/action/Action.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport Link from '../../link';\nimport { Typography } from '../propsValues/typography';\nimport
|
|
1
|
+
{"version":3,"file":"Action.js","sources":["../../../src/common/action/Action.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport Link from '../../link';\nimport { Typography } from '../propsValues/typography';\nimport { Priority } from '../propsValues/control';\nimport Button from '../../button';\nimport { ButtonPriority, ButtonSentiment } from '../../button/Button.types';\n\nexport type ActionOptions = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\ntype Props = {\n variant?: 'button' | 'action-button';\n sentiment?: ButtonSentiment;\n action: ActionOptions;\n className?: string;\n priority?: ButtonPriority;\n};\n\nexport function Action({\n action,\n className,\n variant = 'button',\n priority = Priority.SECONDARY,\n sentiment = 'default',\n}: Props) {\n if ('href' in action) {\n return (\n <Link\n href={action.href}\n className={className}\n aria-label={action['aria-label']}\n target={action.target}\n type={Typography.LINK_LARGE}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n );\n }\n\n switch (variant) {\n case 'action-button':\n return (\n <Button\n v2\n size=\"sm\"\n sentiment={sentiment}\n aria-label={action['aria-label']}\n priority={priority}\n className={clsx(className)}\n onClick={action.onClick}\n >\n {action.text}\n </Button>\n );\n case 'button':\n default:\n return (\n <button\n type=\"button\"\n aria-label={action['aria-label']}\n className={clsx('btn-unstyled np-text-link-large', className)}\n onClick={action.onClick}\n >\n {action.text}\n </button>\n );\n }\n}\n"],"names":["Action","action","className","variant","priority","Priority","SECONDARY","sentiment","_jsx","Link","href","target","type","Typography","LINK_LARGE","onClick","children","text","Button","v2","size","clsx"],"mappings":";;;;;;;;;AAuBM,SAAUA,MAAMA,CAAC;EACrBC,MAAM;EACNC,SAAS;AACTC,EAAAA,OAAO,GAAG,QAAQ;EAClBC,QAAQ,GAAGC,gBAAQ,CAACC,SAAS;AAC7BC,EAAAA,SAAS,GAAG,SAAA;AACN,CAAA,EAAA;EACN,IAAI,MAAM,IAAIN,MAAM,EAAE;IACpB,oBACEO,cAAA,CAACC,IAAI,EAAA;MACHC,IAAI,EAAET,MAAM,CAACS,IAAK;AAClBR,MAAAA,SAAS,EAAEA,SAAU;MACrB,YAAYD,EAAAA,MAAM,CAAC,YAAY,CAAE;MACjCU,MAAM,EAAEV,MAAM,CAACU,MAAO;MACtBC,IAAI,EAAEC,qBAAU,CAACC,UAAW;MAC5BC,OAAO,EAAEd,MAAM,CAACc,OAAQ;MAAAC,QAAA,EAEvBf,MAAM,CAACgB,IAAAA;AAAI,KACR,CAAC,CAAA;AAEX,GAAA;AAEA,EAAA,QAAQd,OAAO;AACb,IAAA,KAAK,eAAe;MAClB,oBACEK,cAAA,CAACU,eAAM,EAAA;QACLC,EAAE,EAAA,IAAA;AACFC,QAAAA,IAAI,EAAC,IAAI;AACTb,QAAAA,SAAS,EAAEA,SAAU;QACrB,YAAYN,EAAAA,MAAM,CAAC,YAAY,CAAE;AACjCG,QAAAA,QAAQ,EAAEA,QAAS;AACnBF,QAAAA,SAAS,EAAEmB,SAAI,CAACnB,SAAS,CAAE;QAC3Ba,OAAO,EAAEd,MAAM,CAACc,OAAQ;QAAAC,QAAA,EAEvBf,MAAM,CAACgB,IAAAA;AAAI,OACN,CAAC,CAAA;AAEb,IAAA,KAAK,QAAQ,CAAA;AACb,IAAA;AACE,MAAA,oBACET,cAAA,CAAA,QAAA,EAAA;AACEI,QAAAA,IAAI,EAAC,QAAQ;QACb,YAAYX,EAAAA,MAAM,CAAC,YAAY,CAAE;AACjCC,QAAAA,SAAS,EAAEmB,SAAI,CAAC,iCAAiC,EAAEnB,SAAS,CAAE;QAC9Da,OAAO,EAAEd,MAAM,CAACc,OAAQ;QAAAC,QAAA,EAEvBf,MAAM,CAACgB,IAAAA;AAAI,OACN,CAAC,CAAA;AAEf,GAAA;AACF;;;;"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import Link from '../../link/Link.mjs';
|
|
3
3
|
import { Typography } from '../propsValues/typography.mjs';
|
|
4
|
-
import ActionButton from '../../actionButton/ActionButton.mjs';
|
|
5
4
|
import { Priority } from '../propsValues/control.mjs';
|
|
5
|
+
import Button from '../../button/Button.resolver.mjs';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
function Action({
|
|
9
9
|
action,
|
|
10
10
|
className,
|
|
11
|
-
variant = 'button'
|
|
11
|
+
variant = 'button',
|
|
12
|
+
priority = Priority.SECONDARY,
|
|
13
|
+
sentiment = 'default'
|
|
12
14
|
}) {
|
|
13
15
|
if ('href' in action) {
|
|
14
16
|
return /*#__PURE__*/jsx(Link, {
|
|
@@ -21,19 +23,28 @@ function Action({
|
|
|
21
23
|
children: action.text
|
|
22
24
|
});
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
switch (variant) {
|
|
27
|
+
case 'action-button':
|
|
28
|
+
return /*#__PURE__*/jsx(Button, {
|
|
29
|
+
v2: true,
|
|
30
|
+
size: "sm",
|
|
31
|
+
sentiment: sentiment,
|
|
32
|
+
"aria-label": action['aria-label'],
|
|
33
|
+
priority: priority,
|
|
34
|
+
className: clsx(className),
|
|
35
|
+
onClick: action.onClick,
|
|
36
|
+
children: action.text
|
|
37
|
+
});
|
|
38
|
+
case 'button':
|
|
39
|
+
default:
|
|
40
|
+
return /*#__PURE__*/jsx("button", {
|
|
41
|
+
type: "button",
|
|
42
|
+
"aria-label": action['aria-label'],
|
|
43
|
+
className: clsx('btn-unstyled np-text-link-large', className),
|
|
44
|
+
onClick: action.onClick,
|
|
45
|
+
children: action.text
|
|
46
|
+
});
|
|
47
|
+
}
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
export { Action };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.mjs","sources":["../../../src/common/action/Action.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport Link from '../../link';\nimport { Typography } from '../propsValues/typography';\nimport
|
|
1
|
+
{"version":3,"file":"Action.mjs","sources":["../../../src/common/action/Action.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport Link from '../../link';\nimport { Typography } from '../propsValues/typography';\nimport { Priority } from '../propsValues/control';\nimport Button from '../../button';\nimport { ButtonPriority, ButtonSentiment } from '../../button/Button.types';\n\nexport type ActionOptions = {\n 'aria-label'?: string;\n href?: string;\n target?: string;\n text: React.ReactNode;\n onClick?: () => void;\n};\n\ntype Props = {\n variant?: 'button' | 'action-button';\n sentiment?: ButtonSentiment;\n action: ActionOptions;\n className?: string;\n priority?: ButtonPriority;\n};\n\nexport function Action({\n action,\n className,\n variant = 'button',\n priority = Priority.SECONDARY,\n sentiment = 'default',\n}: Props) {\n if ('href' in action) {\n return (\n <Link\n href={action.href}\n className={className}\n aria-label={action['aria-label']}\n target={action.target}\n type={Typography.LINK_LARGE}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n );\n }\n\n switch (variant) {\n case 'action-button':\n return (\n <Button\n v2\n size=\"sm\"\n sentiment={sentiment}\n aria-label={action['aria-label']}\n priority={priority}\n className={clsx(className)}\n onClick={action.onClick}\n >\n {action.text}\n </Button>\n );\n case 'button':\n default:\n return (\n <button\n type=\"button\"\n aria-label={action['aria-label']}\n className={clsx('btn-unstyled np-text-link-large', className)}\n onClick={action.onClick}\n >\n {action.text}\n </button>\n );\n }\n}\n"],"names":["Action","action","className","variant","priority","Priority","SECONDARY","sentiment","_jsx","Link","href","target","type","Typography","LINK_LARGE","onClick","children","text","Button","v2","size","clsx"],"mappings":";;;;;;;AAuBM,SAAUA,MAAMA,CAAC;EACrBC,MAAM;EACNC,SAAS;AACTC,EAAAA,OAAO,GAAG,QAAQ;EAClBC,QAAQ,GAAGC,QAAQ,CAACC,SAAS;AAC7BC,EAAAA,SAAS,GAAG,SAAA;AACN,CAAA,EAAA;EACN,IAAI,MAAM,IAAIN,MAAM,EAAE;IACpB,oBACEO,GAAA,CAACC,IAAI,EAAA;MACHC,IAAI,EAAET,MAAM,CAACS,IAAK;AAClBR,MAAAA,SAAS,EAAEA,SAAU;MACrB,YAAYD,EAAAA,MAAM,CAAC,YAAY,CAAE;MACjCU,MAAM,EAAEV,MAAM,CAACU,MAAO;MACtBC,IAAI,EAAEC,UAAU,CAACC,UAAW;MAC5BC,OAAO,EAAEd,MAAM,CAACc,OAAQ;MAAAC,QAAA,EAEvBf,MAAM,CAACgB,IAAAA;AAAI,KACR,CAAC,CAAA;AAEX,GAAA;AAEA,EAAA,QAAQd,OAAO;AACb,IAAA,KAAK,eAAe;MAClB,oBACEK,GAAA,CAACU,MAAM,EAAA;QACLC,EAAE,EAAA,IAAA;AACFC,QAAAA,IAAI,EAAC,IAAI;AACTb,QAAAA,SAAS,EAAEA,SAAU;QACrB,YAAYN,EAAAA,MAAM,CAAC,YAAY,CAAE;AACjCG,QAAAA,QAAQ,EAAEA,QAAS;AACnBF,QAAAA,SAAS,EAAEmB,IAAI,CAACnB,SAAS,CAAE;QAC3Ba,OAAO,EAAEd,MAAM,CAACc,OAAQ;QAAAC,QAAA,EAEvBf,MAAM,CAACgB,IAAAA;AAAI,OACN,CAAC,CAAA;AAEb,IAAA,KAAK,QAAQ,CAAA;AACb,IAAA;AACE,MAAA,oBACET,GAAA,CAAA,QAAA,EAAA;AACEI,QAAAA,IAAI,EAAC,QAAQ;QACb,YAAYX,EAAAA,MAAM,CAAC,YAAY,CAAE;AACjCC,QAAAA,SAAS,EAAEmB,IAAI,CAAC,iCAAiC,EAAEnB,SAAS,CAAE;QAC9Da,OAAO,EAAEd,MAAM,CAACc,OAAQ;QAAAC,QAAA,EAEvBf,MAAM,CAACgB,IAAAA;AAAI,OACN,CAAC,CAAA;AAEf,GAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentiment.js","sources":["../../../src/common/propsValues/sentiment.ts"],"sourcesContent":["export enum Sentiment {\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n POSITIVE = 'positive',\n WARNING = 'warning',\n PENDING = 'pending',\n\n /**\n * @deprecated\n */\n INFO = 'info',\n /**\n * @deprecated\n */\n ERROR = 'error',\n /**\n * @deprecated\n */\n SUCCESS = 'success',\n}\n"],"names":["Sentiment"],"mappings":";;AAAYA,
|
|
1
|
+
{"version":3,"file":"sentiment.js","sources":["../../../src/common/propsValues/sentiment.ts"],"sourcesContent":["export enum Sentiment {\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n POSITIVE = 'positive',\n WARNING = 'warning',\n PENDING = 'pending',\n CRITICAL = 'critical',\n\n /**\n * @deprecated\n */\n INFO = 'info',\n /**\n * @deprecated\n */\n ERROR = 'error',\n /**\n * @deprecated\n */\n SUCCESS = 'success',\n}\n"],"names":["Sentiment"],"mappings":";;AAAYA,2BAoBX;AApBD,CAAA,UAAYA,SAAS,EAAA;AACnBA,EAAAA,SAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrBA,EAAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnBA,EAAAA,SAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrBA,EAAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnBA,EAAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnBA,EAAAA,SAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AAErB;;AAEG;AACHA,EAAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb;;AAEG;AACHA,EAAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf;;AAEG;AACHA,EAAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACrB,CAAC,EApBWA,iBAAS,KAATA,iBAAS,GAoBpB,EAAA,CAAA,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentiment.mjs","sources":["../../../src/common/propsValues/sentiment.ts"],"sourcesContent":["export enum Sentiment {\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n POSITIVE = 'positive',\n WARNING = 'warning',\n PENDING = 'pending',\n\n /**\n * @deprecated\n */\n INFO = 'info',\n /**\n * @deprecated\n */\n ERROR = 'error',\n /**\n * @deprecated\n */\n SUCCESS = 'success',\n}\n"],"names":["Sentiment"],"mappings":"IAAYA,
|
|
1
|
+
{"version":3,"file":"sentiment.mjs","sources":["../../../src/common/propsValues/sentiment.ts"],"sourcesContent":["export enum Sentiment {\n NEGATIVE = 'negative',\n NEUTRAL = 'neutral',\n POSITIVE = 'positive',\n WARNING = 'warning',\n PENDING = 'pending',\n CRITICAL = 'critical',\n\n /**\n * @deprecated\n */\n INFO = 'info',\n /**\n * @deprecated\n */\n ERROR = 'error',\n /**\n * @deprecated\n */\n SUCCESS = 'success',\n}\n"],"names":["Sentiment"],"mappings":"IAAYA,UAoBX;AApBD,CAAA,UAAYA,SAAS,EAAA;AACnBA,EAAAA,SAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrBA,EAAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnBA,EAAAA,SAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrBA,EAAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnBA,EAAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnBA,EAAAA,SAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AAErB;;AAEG;AACHA,EAAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb;;AAEG;AACHA,EAAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf;;AAEG;AACHA,EAAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACrB,CAAC,EApBWA,SAAS,KAATA,SAAS,GAoBpB,EAAA,CAAA,CAAA;;;;"}
|