@transferwise/components 46.160.7 → 46.161.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/build/Tag/Tag.js +45 -0
  2. package/build/Tag/Tag.js.map +1 -0
  3. package/build/Tag/Tag.mjs +41 -0
  4. package/build/Tag/Tag.mjs.map +1 -0
  5. package/build/index.js +2 -0
  6. package/build/index.js.map +1 -1
  7. package/build/index.mjs +1 -0
  8. package/build/index.mjs.map +1 -1
  9. package/build/main.css +853 -0
  10. package/build/styles/Inputs/Input/Input.css +88 -0
  11. package/build/styles/Inputs/TextArea/TextArea.css +88 -0
  12. package/build/styles/Popover/Popover.css +1 -0
  13. package/build/styles/Tag/Tag.css +30 -0
  14. package/build/styles/_deprecated/Select/Select.css +29 -0
  15. package/build/styles/css/accordion.css +30 -0
  16. package/build/styles/css/button-groups.css +29 -0
  17. package/build/styles/css/buttons.css +29 -0
  18. package/build/styles/css/decision.css +30 -0
  19. package/build/styles/css/dropdowns.css +59 -0
  20. package/build/styles/css/droppable.css +29 -0
  21. package/build/styles/css/footer.css +63 -0
  22. package/build/styles/css/input-groups.css +189 -0
  23. package/build/styles/css/list-group.css +1 -0
  24. package/build/styles/css/navbar.css +59 -0
  25. package/build/styles/css/neptune-addons.css +3 -0
  26. package/build/styles/css/neptune-core.css +185 -0
  27. package/build/styles/css/neptune.css +705 -0
  28. package/build/styles/css/popovers.css +59 -0
  29. package/build/styles/css/tooltip.css +29 -0
  30. package/build/styles/main.css +853 -0
  31. package/build/styles/styles/less/accordion.css +30 -0
  32. package/build/styles/styles/less/button-groups.css +29 -0
  33. package/build/styles/styles/less/buttons.css +29 -0
  34. package/build/styles/styles/less/decision.css +30 -0
  35. package/build/styles/styles/less/dropdowns.css +59 -0
  36. package/build/styles/styles/less/droppable.css +29 -0
  37. package/build/styles/styles/less/footer.css +63 -0
  38. package/build/styles/styles/less/forms/bootstrap-forms.css +116 -0
  39. package/build/styles/styles/less/input-groups.css +189 -0
  40. package/build/styles/styles/less/list-group.css +1 -0
  41. package/build/styles/styles/less/navbar.css +59 -0
  42. package/build/styles/styles/less/neptune-addons.css +3 -0
  43. package/build/styles/styles/less/neptune-core.css +185 -0
  44. package/build/styles/styles/less/neptune.css +705 -0
  45. package/build/styles/styles/less/popovers.css +59 -0
  46. package/build/styles/styles/less/tooltip.css +29 -0
  47. package/build/types/Tag/Tag.d.ts +24 -0
  48. package/build/types/Tag/Tag.d.ts.map +1 -0
  49. package/build/types/Tag/Tag.types.d.ts +39 -0
  50. package/build/types/Tag/Tag.types.d.ts.map +1 -0
  51. package/build/types/Tag/index.d.ts +3 -0
  52. package/build/types/Tag/index.d.ts.map +1 -0
  53. package/build/types/index.d.ts +2 -0
  54. package/build/types/index.d.ts.map +1 -1
  55. package/package.json +1 -1
  56. package/src/Body/_stories/Body.test.story.tsx +81 -0
  57. package/src/Inputs/Input/Input.css +88 -0
  58. package/src/Inputs/TextArea/TextArea.css +88 -0
  59. package/src/Popover/Popover.css +1 -0
  60. package/src/Tag/Tag.css +30 -0
  61. package/src/Tag/Tag.less +31 -0
  62. package/src/Tag/Tag.test.tsx +70 -0
  63. package/src/Tag/Tag.tsx +71 -0
  64. package/src/Tag/Tag.types.ts +46 -0
  65. package/src/Tag/_stories/Tag.story.tsx +245 -0
  66. package/src/Tag/_stories/Tag.test.story.tsx +121 -0
  67. package/src/Tag/index.ts +2 -0
  68. package/src/_deprecated/Card/_stories/Card.test.story.tsx +1 -1
  69. package/src/_deprecated/CriticalBanner/_stories/CriticalCommsBanner.test.story.tsx +1 -1
  70. package/src/_deprecated/InlineAlert/_stories/InlineAlert.test.story.tsx +1 -1
  71. package/src/_deprecated/OverlayHeader/_stories/OverlayHeader.test.story.tsx +1 -1
  72. package/src/_deprecated/Select/Select.css +29 -0
  73. package/src/_deprecated/Select/_stories/Select.rtl.test.story.tsx +1 -1
  74. package/src/_deprecated/Select/_stories/Select.test.story.tsx +1 -1
  75. package/src/index.ts +2 -0
  76. package/src/main.css +853 -0
  77. package/src/main.less +1 -0
  78. package/src/styles/less/accordion.css +30 -0
  79. package/src/styles/less/addons/_spacing-utilities.less +2 -0
  80. package/src/styles/less/button-groups.css +29 -0
  81. package/src/styles/less/buttons.css +29 -0
  82. package/src/styles/less/core/_typography.less +12 -0
  83. package/src/styles/less/decision.css +30 -0
  84. package/src/styles/less/dropdowns.css +59 -0
  85. package/src/styles/less/droppable.css +29 -0
  86. package/src/styles/less/footer.css +63 -0
  87. package/src/styles/less/forms/bootstrap-forms.css +116 -0
  88. package/src/styles/less/input-groups.css +189 -0
  89. package/src/styles/less/list-group.css +1 -0
  90. package/src/styles/less/navbar.css +59 -0
  91. package/src/styles/less/neptune-addons.css +3 -0
  92. package/src/styles/less/neptune-core.css +185 -0
  93. package/src/styles/less/neptune.css +705 -0
  94. package/src/styles/less/popovers.css +59 -0
  95. package/src/styles/less/tooltip.css +29 -0
  96. package/src/test-utils/assets/card-payment-bakery.webp +0 -0
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var clsx = require('clsx');
7
+ var componentsTheming = require('@wise/components-theming');
8
+ var SentimentSurface = require('../SentimentSurface/SentimentSurface.js');
9
+ var jsxRuntime = require('react/jsx-runtime');
10
+
11
+ const Tag = /*#__PURE__*/React.forwardRef(function Tag({
12
+ label,
13
+ sentiment = 'neutral',
14
+ size = 'small',
15
+ emphasis = 'base',
16
+ overMedia = false,
17
+ className,
18
+ id,
19
+ 'data-testid': dataTestId
20
+ }, ref) {
21
+ const {
22
+ theme,
23
+ screenMode
24
+ } = componentsTheming.useTheme();
25
+ return /*#__PURE__*/jsxRuntime.jsx(componentsTheming.ThemeProvider, {
26
+ theme: theme,
27
+ screenMode: overMedia ? 'dark' : screenMode,
28
+ className: "wds-tag-theme",
29
+ children: /*#__PURE__*/jsxRuntime.jsx(SentimentSurface.default
30
+ // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props
31
+ , {
32
+ ref: ref,
33
+ as: "span",
34
+ sentiment: sentiment,
35
+ emphasis: overMedia ? 'elevated' : emphasis,
36
+ id: id,
37
+ "data-testid": dataTestId,
38
+ className: clsx.clsx('wds-tag', `wds-tag--${size}`, `wds-tag--${sentiment}`, 'np-text-body-default-bold', className),
39
+ children: label
40
+ })
41
+ });
42
+ });
43
+
44
+ exports.default = Tag;
45
+ //# sourceMappingURL=Tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tag.js","sources":["../../src/Tag/Tag.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { clsx } from 'clsx';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\n\nimport SentimentSurface from '../SentimentSurface';\nimport { TagProps } from './Tag.types';\n\n/**\n * Tag is a small, non-interactive label that categorises or highlights a piece of content.\n *\n * @param {string} label - The text of the tag, kept to a word or two.\n * @param {Sentiment} [sentiment='neutral'] - Optional prop to set the sentiment type (negative, warning, neutral, success, proposition).\n * @param {TagSize} [size='small'] - Optional prop to set the size of the tag (small or large).\n * @param {Emphasis} [emphasis='base'] - Optional prop to specify the emphasis level (base or elevated).\n * @param {boolean} [overMedia=false] - If true, renders the tag for use over media, keeping the colours it uses in dark screen modes.\n * @param {string} [className] - Additional CSS classes to apply.\n * @param {string} [id] - Unique identifier for the component.\n * @param {string} [data-testid] - A unique string that appears as data attribute `data-testid` in the rendered code.\n *\n * @component\n * @example\n * ```tsx\n * <Tag sentiment=\"success\" label=\"Verified\" />\n * ```\n *\n * @see {@link https://storybook.wise.design/?path=/docs/tag--docs|Storybook Wise Design}\n */\nconst Tag = forwardRef<HTMLSpanElement, TagProps>(function Tag(\n {\n label,\n sentiment = 'neutral',\n size = 'small',\n emphasis = 'base',\n overMedia = false,\n className,\n id,\n 'data-testid': dataTestId,\n },\n ref,\n) {\n const { theme, screenMode } = useTheme();\n\n return (\n <ThemeProvider\n theme={theme}\n screenMode={overMedia ? 'dark' : screenMode}\n className=\"wds-tag-theme\"\n >\n <SentimentSurface\n // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props\n ref={ref}\n as=\"span\"\n sentiment={sentiment}\n emphasis={overMedia ? 'elevated' : emphasis}\n id={id}\n data-testid={dataTestId}\n className={clsx(\n 'wds-tag',\n `wds-tag--${size}`,\n `wds-tag--${sentiment}`,\n 'np-text-body-default-bold',\n className,\n )}\n >\n {label}\n </SentimentSurface>\n </ThemeProvider>\n );\n});\n\nexport default Tag;\n"],"names":["Tag","forwardRef","label","sentiment","size","emphasis","overMedia","className","id","dataTestId","ref","theme","screenMode","useTheme","_jsx","ThemeProvider","children","SentimentSurface","as","clsx"],"mappings":";;;;;;;;;;AA2BA,MAAMA,GAAG,gBAAGC,gBAAU,CAA4B,SAASD,GAAGA,CAC5D;EACEE,KAAK;AACLC,EAAAA,SAAS,GAAG,SAAS;AACrBC,EAAAA,IAAI,GAAG,OAAO;AACdC,EAAAA,QAAQ,GAAG,MAAM;AACjBC,EAAAA,SAAS,GAAG,KAAK;EACjBC,SAAS;EACTC,EAAE;AACF,EAAA,aAAa,EAAEC;AAAU,CAC1B,EACDC,GAAG,EAAA;EAEH,MAAM;IAAEC,KAAK;AAAEC,IAAAA;GAAY,GAAGC,0BAAQ,EAAE;EAExC,oBACEC,cAAA,CAACC,+BAAa,EAAA;AACZJ,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,UAAU,EAAEN,SAAS,GAAG,MAAM,GAAGM,UAAW;AAC5CL,IAAAA,SAAS,EAAC,eAAe;IAAAS,QAAA,eAEzBF,cAAA,CAACG;AACC;AAAA,MAAA;AACAP,MAAAA,GAAG,EAAEA,GAAI;AACTQ,MAAAA,EAAE,EAAC,MAAM;AACTf,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,QAAQ,EAAEC,SAAS,GAAG,UAAU,GAAGD,QAAS;AAC5CG,MAAAA,EAAE,EAAEA,EAAG;AACP,MAAA,aAAA,EAAaC,UAAW;AACxBF,MAAAA,SAAS,EAAEY,SAAI,CACb,SAAS,EACT,YAAYf,IAAI,CAAA,CAAE,EAClB,CAAA,SAAA,EAAYD,SAAS,CAAA,CAAE,EACvB,2BAA2B,EAC3BI,SAAS,CACT;AAAAS,MAAAA,QAAA,EAEDd;KACe;AACpB,GAAe,CAAC;AAEpB,CAAC;;;;"}
@@ -0,0 +1,41 @@
1
+ import { forwardRef } from 'react';
2
+ import { clsx } from 'clsx';
3
+ import { useTheme, ThemeProvider } from '@wise/components-theming';
4
+ import SentimentSurface from '../SentimentSurface/SentimentSurface.mjs';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ const Tag = /*#__PURE__*/forwardRef(function Tag({
8
+ label,
9
+ sentiment = 'neutral',
10
+ size = 'small',
11
+ emphasis = 'base',
12
+ overMedia = false,
13
+ className,
14
+ id,
15
+ 'data-testid': dataTestId
16
+ }, ref) {
17
+ const {
18
+ theme,
19
+ screenMode
20
+ } = useTheme();
21
+ return /*#__PURE__*/jsx(ThemeProvider, {
22
+ theme: theme,
23
+ screenMode: overMedia ? 'dark' : screenMode,
24
+ className: "wds-tag-theme",
25
+ children: /*#__PURE__*/jsx(SentimentSurface
26
+ // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props
27
+ , {
28
+ ref: ref,
29
+ as: "span",
30
+ sentiment: sentiment,
31
+ emphasis: overMedia ? 'elevated' : emphasis,
32
+ id: id,
33
+ "data-testid": dataTestId,
34
+ className: clsx('wds-tag', `wds-tag--${size}`, `wds-tag--${sentiment}`, 'np-text-body-default-bold', className),
35
+ children: label
36
+ })
37
+ });
38
+ });
39
+
40
+ export { Tag as default };
41
+ //# sourceMappingURL=Tag.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tag.mjs","sources":["../../src/Tag/Tag.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { clsx } from 'clsx';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\n\nimport SentimentSurface from '../SentimentSurface';\nimport { TagProps } from './Tag.types';\n\n/**\n * Tag is a small, non-interactive label that categorises or highlights a piece of content.\n *\n * @param {string} label - The text of the tag, kept to a word or two.\n * @param {Sentiment} [sentiment='neutral'] - Optional prop to set the sentiment type (negative, warning, neutral, success, proposition).\n * @param {TagSize} [size='small'] - Optional prop to set the size of the tag (small or large).\n * @param {Emphasis} [emphasis='base'] - Optional prop to specify the emphasis level (base or elevated).\n * @param {boolean} [overMedia=false] - If true, renders the tag for use over media, keeping the colours it uses in dark screen modes.\n * @param {string} [className] - Additional CSS classes to apply.\n * @param {string} [id] - Unique identifier for the component.\n * @param {string} [data-testid] - A unique string that appears as data attribute `data-testid` in the rendered code.\n *\n * @component\n * @example\n * ```tsx\n * <Tag sentiment=\"success\" label=\"Verified\" />\n * ```\n *\n * @see {@link https://storybook.wise.design/?path=/docs/tag--docs|Storybook Wise Design}\n */\nconst Tag = forwardRef<HTMLSpanElement, TagProps>(function Tag(\n {\n label,\n sentiment = 'neutral',\n size = 'small',\n emphasis = 'base',\n overMedia = false,\n className,\n id,\n 'data-testid': dataTestId,\n },\n ref,\n) {\n const { theme, screenMode } = useTheme();\n\n return (\n <ThemeProvider\n theme={theme}\n screenMode={overMedia ? 'dark' : screenMode}\n className=\"wds-tag-theme\"\n >\n <SentimentSurface\n // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props\n ref={ref}\n as=\"span\"\n sentiment={sentiment}\n emphasis={overMedia ? 'elevated' : emphasis}\n id={id}\n data-testid={dataTestId}\n className={clsx(\n 'wds-tag',\n `wds-tag--${size}`,\n `wds-tag--${sentiment}`,\n 'np-text-body-default-bold',\n className,\n )}\n >\n {label}\n </SentimentSurface>\n </ThemeProvider>\n );\n});\n\nexport default Tag;\n"],"names":["Tag","forwardRef","label","sentiment","size","emphasis","overMedia","className","id","dataTestId","ref","theme","screenMode","useTheme","_jsx","ThemeProvider","children","SentimentSurface","as","clsx"],"mappings":";;;;;;AA2BA,MAAMA,GAAG,gBAAGC,UAAU,CAA4B,SAASD,GAAGA,CAC5D;EACEE,KAAK;AACLC,EAAAA,SAAS,GAAG,SAAS;AACrBC,EAAAA,IAAI,GAAG,OAAO;AACdC,EAAAA,QAAQ,GAAG,MAAM;AACjBC,EAAAA,SAAS,GAAG,KAAK;EACjBC,SAAS;EACTC,EAAE;AACF,EAAA,aAAa,EAAEC;AAAU,CAC1B,EACDC,GAAG,EAAA;EAEH,MAAM;IAAEC,KAAK;AAAEC,IAAAA;GAAY,GAAGC,QAAQ,EAAE;EAExC,oBACEC,GAAA,CAACC,aAAa,EAAA;AACZJ,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,UAAU,EAAEN,SAAS,GAAG,MAAM,GAAGM,UAAW;AAC5CL,IAAAA,SAAS,EAAC,eAAe;IAAAS,QAAA,eAEzBF,GAAA,CAACG;AACC;AAAA,MAAA;AACAP,MAAAA,GAAG,EAAEA,GAAI;AACTQ,MAAAA,EAAE,EAAC,MAAM;AACTf,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,QAAQ,EAAEC,SAAS,GAAG,UAAU,GAAGD,QAAS;AAC5CG,MAAAA,EAAE,EAAEA,EAAG;AACP,MAAA,aAAA,EAAaC,UAAW;AACxBF,MAAAA,SAAS,EAAEY,IAAI,CACb,SAAS,EACT,YAAYf,IAAI,CAAA,CAAE,EAClB,CAAA,SAAA,EAAYD,SAAS,CAAA,CAAE,EACvB,2BAA2B,EAC3BI,SAAS,CACT;AAAAS,MAAAA,QAAA,EAEDd;KACe;AACpB,GAAe,CAAC;AAEpB,CAAC;;;;"}
package/build/index.js CHANGED
@@ -114,6 +114,7 @@ var Summary = require('./_deprecated/Summary/Summary.js');
114
114
  var Switch = require('./Switch/Switch.js');
115
115
  var SwitchOption = require('./_deprecated/SwitchOption/SwitchOption.js');
116
116
  var Tabs = require('./Tabs/Tabs.js');
117
+ var Tag = require('./Tag/Tag.js');
117
118
  var TextareaWithDisplayFormat = require('./TextareaWithDisplayFormat/TextareaWithDisplayFormat.js');
118
119
  var Title = require('./Title/Title.js');
119
120
  var Tile = require('./Tile/Tile.js');
@@ -284,6 +285,7 @@ exports.Summary = Summary.default;
284
285
  exports.Switch = Switch.default;
285
286
  exports.SwitchOption = SwitchOption.default;
286
287
  exports.Tabs = Tabs.default;
288
+ exports.Tag = Tag.default;
287
289
  exports.TextareaWithDisplayFormat = TextareaWithDisplayFormat.default;
288
290
  exports.Title = Title.default;
289
291
  exports.Tile = Tile.default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/build/index.mjs CHANGED
@@ -112,6 +112,7 @@ export { default as Summary } from './_deprecated/Summary/Summary.mjs';
112
112
  export { default as Switch } from './Switch/Switch.mjs';
113
113
  export { default as SwitchOption } from './_deprecated/SwitchOption/SwitchOption.mjs';
114
114
  export { default as Tabs } from './Tabs/Tabs.mjs';
115
+ export { default as Tag } from './Tag/Tag.mjs';
115
116
  export { default as TextareaWithDisplayFormat } from './TextareaWithDisplayFormat/TextareaWithDisplayFormat.mjs';
116
117
  export { default as Title } from './Title/Title.mjs';
117
118
  export { default as Tile } from './Tile/Tile.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}