@transferwise/components 0.0.0-experimental-d7a6a12 → 0.0.0-experimental-c4fb7ee
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/divider/Divider.js +2 -1
- package/build/divider/Divider.js.map +1 -1
- package/build/divider/Divider.mjs +2 -1
- package/build/divider/Divider.mjs.map +1 -1
- package/build/types/divider/Divider.d.ts +2 -2
- package/build/types/divider/Divider.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/divider/Divider.tsx +4 -3
package/build/divider/Divider.js
CHANGED
|
@@ -5,12 +5,13 @@ require('react');
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
7
|
const Divider = ({
|
|
8
|
-
as
|
|
8
|
+
as = 'hr',
|
|
9
9
|
className,
|
|
10
10
|
testId,
|
|
11
11
|
variant = 'section',
|
|
12
12
|
...props
|
|
13
13
|
}) => {
|
|
14
|
+
const Element = as;
|
|
14
15
|
const variantClass = variant && variant !== 'section' ? `wds-Divider--${variant}` : '';
|
|
15
16
|
const dividerClasses = clsx.clsx('wds-Divider', variantClass, className);
|
|
16
17
|
const commonProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.js","sources":["../../src/divider/Divider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent } from 'react';\n\nexport interface DividerProps {\n /** Option prop to specify DOM render element */\n as?: 'hr' | 'div';\n\n /** Optional prop to specify classNames onto the Divider */\n className?: string;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n\n /** Optional prop to specify the variant of the Divider */\n variant?: 'content' | 'subsection' | 'section';\n}\n\n/**\n * Divider component\n *\n * The Divider component is used to visually separate different sections of content.\n * It can be rendered as a horizontal line and supports various styles such as\n *
|
|
1
|
+
{"version":3,"file":"Divider.js","sources":["../../src/divider/Divider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent } from 'react';\n\nexport interface DividerProps {\n /** Option prop to specify DOM render element */\n as?: 'hr' | 'div';\n\n /** Optional prop to specify classNames onto the Divider */\n className?: string;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n\n /** Optional prop to specify the variant of the Divider */\n variant?: 'content' | 'subsection' | 'section';\n}\n\n/**\n * Divider component\n *\n * The Divider component is used to visually separate different sections of content.\n * It can be rendered as a horizontal line and supports various styles such as\n * section, subsection, and content. Additionally, the Divider can include custom styles.\n *\n * @component\n * @param {'hr' | 'div'} [as='hr'] - Option prop to specify DOM render element.\n * @param {string} [className] - Optional prop to specify classNames onto the Divider.\n * @param {string} [testId] - Optional prop to specify the ID used for testing.\n * @param {'section' | 'subsection' | 'content'} [variant='section'] - Optional prop to specify the variant of the Divider.\n *\n * @example\n * // Example usage:\n * import Divider from './Divider';\n *\n * function App() {\n * return (\n * <div>\n * <p>Content above the divider</p>\n * <Divider variant=\"content\" />\n * <p>Content below the divider</p>\n * <Divider variant=\"subsection\" />\n * </div>\n * );\n * }\n */\nconst Divider: FunctionComponent<DividerProps> = ({\n as = 'hr',\n className,\n testId,\n variant = 'section',\n ...props\n}) => {\n const Element = as;\n const variantClass = variant && variant !== 'section' ? `wds-Divider--${variant}` : '';\n const dividerClasses = clsx('wds-Divider', variantClass, className);\n\n const commonProps = {\n className: dividerClasses,\n 'data-testid': testId,\n };\n\n const divProps = {\n ...commonProps,\n 'aria-orientation': 'horizontal',\n role: 'separator',\n };\n\n const componentProps = Element === 'div' ? divProps : commonProps;\n\n return <Element {...componentProps} {...props} />;\n};\n\nexport default Divider;\n"],"names":["Divider","as","className","testId","variant","props","Element","variantClass","dividerClasses","clsx","commonProps","divProps","role","componentProps","_jsx"],"mappings":";;;;;;AA6CMA,MAAAA,OAAO,GAAoCA,CAAC;AAChDC,EAAAA,EAAE,GAAG,IAAI;EACTC,SAAS;EACTC,MAAM;AACNC,EAAAA,OAAO,GAAG,SAAS;EACnB,GAAGC,KAAAA;AAAK,CACT,KAAI;EACH,MAAMC,OAAO,GAAGL,EAAE,CAAA;AAClB,EAAA,MAAMM,YAAY,GAAGH,OAAO,IAAIA,OAAO,KAAK,SAAS,GAAG,CAAgBA,aAAAA,EAAAA,OAAO,CAAE,CAAA,GAAG,EAAE,CAAA;EACtF,MAAMI,cAAc,GAAGC,SAAI,CAAC,aAAa,EAAEF,YAAY,EAAEL,SAAS,CAAC,CAAA;AAEnE,EAAA,MAAMQ,WAAW,GAAG;AAClBR,IAAAA,SAAS,EAAEM,cAAc;AACzB,IAAA,aAAa,EAAEL,MAAAA;GAChB,CAAA;AAED,EAAA,MAAMQ,QAAQ,GAAG;AACf,IAAA,GAAGD,WAAW;AACd,IAAA,kBAAkB,EAAE,YAAY;AAChCE,IAAAA,IAAI,EAAE,WAAA;GACP,CAAA;EAED,MAAMC,cAAc,GAAGP,OAAO,KAAK,KAAK,GAAGK,QAAQ,GAAGD,WAAW,CAAA;EAEjE,oBAAOI,cAAA,CAACR,OAAO,EAAA;AAAA,IAAA,GAAKO,cAAc;IAAA,GAAMR,KAAAA;AAAK,GAAC,CAAG,CAAA;AACnD;;;;"}
|
|
@@ -3,12 +3,13 @@ import 'react';
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
const Divider = ({
|
|
6
|
-
as
|
|
6
|
+
as = 'hr',
|
|
7
7
|
className,
|
|
8
8
|
testId,
|
|
9
9
|
variant = 'section',
|
|
10
10
|
...props
|
|
11
11
|
}) => {
|
|
12
|
+
const Element = as;
|
|
12
13
|
const variantClass = variant && variant !== 'section' ? `wds-Divider--${variant}` : '';
|
|
13
14
|
const dividerClasses = clsx('wds-Divider', variantClass, className);
|
|
14
15
|
const commonProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.mjs","sources":["../../src/divider/Divider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent } from 'react';\n\nexport interface DividerProps {\n /** Option prop to specify DOM render element */\n as?: 'hr' | 'div';\n\n /** Optional prop to specify classNames onto the Divider */\n className?: string;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n\n /** Optional prop to specify the variant of the Divider */\n variant?: 'content' | 'subsection' | 'section';\n}\n\n/**\n * Divider component\n *\n * The Divider component is used to visually separate different sections of content.\n * It can be rendered as a horizontal line and supports various styles such as\n *
|
|
1
|
+
{"version":3,"file":"Divider.mjs","sources":["../../src/divider/Divider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent } from 'react';\n\nexport interface DividerProps {\n /** Option prop to specify DOM render element */\n as?: 'hr' | 'div';\n\n /** Optional prop to specify classNames onto the Divider */\n className?: string;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n\n /** Optional prop to specify the variant of the Divider */\n variant?: 'content' | 'subsection' | 'section';\n}\n\n/**\n * Divider component\n *\n * The Divider component is used to visually separate different sections of content.\n * It can be rendered as a horizontal line and supports various styles such as\n * section, subsection, and content. Additionally, the Divider can include custom styles.\n *\n * @component\n * @param {'hr' | 'div'} [as='hr'] - Option prop to specify DOM render element.\n * @param {string} [className] - Optional prop to specify classNames onto the Divider.\n * @param {string} [testId] - Optional prop to specify the ID used for testing.\n * @param {'section' | 'subsection' | 'content'} [variant='section'] - Optional prop to specify the variant of the Divider.\n *\n * @example\n * // Example usage:\n * import Divider from './Divider';\n *\n * function App() {\n * return (\n * <div>\n * <p>Content above the divider</p>\n * <Divider variant=\"content\" />\n * <p>Content below the divider</p>\n * <Divider variant=\"subsection\" />\n * </div>\n * );\n * }\n */\nconst Divider: FunctionComponent<DividerProps> = ({\n as = 'hr',\n className,\n testId,\n variant = 'section',\n ...props\n}) => {\n const Element = as;\n const variantClass = variant && variant !== 'section' ? `wds-Divider--${variant}` : '';\n const dividerClasses = clsx('wds-Divider', variantClass, className);\n\n const commonProps = {\n className: dividerClasses,\n 'data-testid': testId,\n };\n\n const divProps = {\n ...commonProps,\n 'aria-orientation': 'horizontal',\n role: 'separator',\n };\n\n const componentProps = Element === 'div' ? divProps : commonProps;\n\n return <Element {...componentProps} {...props} />;\n};\n\nexport default Divider;\n"],"names":["Divider","as","className","testId","variant","props","Element","variantClass","dividerClasses","clsx","commonProps","divProps","role","componentProps","_jsx"],"mappings":";;;;AA6CMA,MAAAA,OAAO,GAAoCA,CAAC;AAChDC,EAAAA,EAAE,GAAG,IAAI;EACTC,SAAS;EACTC,MAAM;AACNC,EAAAA,OAAO,GAAG,SAAS;EACnB,GAAGC,KAAAA;AAAK,CACT,KAAI;EACH,MAAMC,OAAO,GAAGL,EAAE,CAAA;AAClB,EAAA,MAAMM,YAAY,GAAGH,OAAO,IAAIA,OAAO,KAAK,SAAS,GAAG,CAAgBA,aAAAA,EAAAA,OAAO,CAAE,CAAA,GAAG,EAAE,CAAA;EACtF,MAAMI,cAAc,GAAGC,IAAI,CAAC,aAAa,EAAEF,YAAY,EAAEL,SAAS,CAAC,CAAA;AAEnE,EAAA,MAAMQ,WAAW,GAAG;AAClBR,IAAAA,SAAS,EAAEM,cAAc;AACzB,IAAA,aAAa,EAAEL,MAAAA;GAChB,CAAA;AAED,EAAA,MAAMQ,QAAQ,GAAG;AACf,IAAA,GAAGD,WAAW;AACd,IAAA,kBAAkB,EAAE,YAAY;AAChCE,IAAAA,IAAI,EAAE,WAAA;GACP,CAAA;EAED,MAAMC,cAAc,GAAGP,OAAO,KAAK,KAAK,GAAGK,QAAQ,GAAGD,WAAW,CAAA;EAEjE,oBAAOI,GAAA,CAACR,OAAO,EAAA;AAAA,IAAA,GAAKO,cAAc;IAAA,GAAMR,KAAAA;AAAK,GAAC,CAAG,CAAA;AACnD;;;;"}
|
|
@@ -14,13 +14,13 @@ export interface DividerProps {
|
|
|
14
14
|
*
|
|
15
15
|
* The Divider component is used to visually separate different sections of content.
|
|
16
16
|
* It can be rendered as a horizontal line and supports various styles such as
|
|
17
|
-
*
|
|
17
|
+
* section, subsection, and content. Additionally, the Divider can include custom styles.
|
|
18
18
|
*
|
|
19
19
|
* @component
|
|
20
20
|
* @param {'hr' | 'div'} [as='hr'] - Option prop to specify DOM render element.
|
|
21
21
|
* @param {string} [className] - Optional prop to specify classNames onto the Divider.
|
|
22
22
|
* @param {string} [testId] - Optional prop to specify the ID used for testing.
|
|
23
|
-
* @param {'
|
|
23
|
+
* @param {'section' | 'subsection' | 'content'} [variant='section'] - Optional prop to specify the variant of the Divider.
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* // Example usage:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/divider/Divider.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,gDAAgD;IAChD,EAAE,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;IAElB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/divider/Divider.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,gDAAgD;IAChD,EAAE,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;IAElB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,CAyB5C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-c4fb7ee",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"rollup": "^4.18.1",
|
|
93
93
|
"rollup-preserve-directives": "^1.1.1",
|
|
94
94
|
"storybook": "^8.2.2",
|
|
95
|
+
"@transferwise/less-config": "3.1.0",
|
|
95
96
|
"@transferwise/neptune-css": "14.18.0",
|
|
96
|
-
"@wise/components-theming": "1.6.0"
|
|
97
|
-
"@transferwise/less-config": "3.1.0"
|
|
97
|
+
"@wise/components-theming": "1.6.0"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"@transferwise/icons": "^3.7.0",
|
package/src/divider/Divider.tsx
CHANGED
|
@@ -20,13 +20,13 @@ export interface DividerProps {
|
|
|
20
20
|
*
|
|
21
21
|
* The Divider component is used to visually separate different sections of content.
|
|
22
22
|
* It can be rendered as a horizontal line and supports various styles such as
|
|
23
|
-
*
|
|
23
|
+
* section, subsection, and content. Additionally, the Divider can include custom styles.
|
|
24
24
|
*
|
|
25
25
|
* @component
|
|
26
26
|
* @param {'hr' | 'div'} [as='hr'] - Option prop to specify DOM render element.
|
|
27
27
|
* @param {string} [className] - Optional prop to specify classNames onto the Divider.
|
|
28
28
|
* @param {string} [testId] - Optional prop to specify the ID used for testing.
|
|
29
|
-
* @param {'
|
|
29
|
+
* @param {'section' | 'subsection' | 'content'} [variant='section'] - Optional prop to specify the variant of the Divider.
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* // Example usage:
|
|
@@ -44,12 +44,13 @@ export interface DividerProps {
|
|
|
44
44
|
* }
|
|
45
45
|
*/
|
|
46
46
|
const Divider: FunctionComponent<DividerProps> = ({
|
|
47
|
-
as
|
|
47
|
+
as = 'hr',
|
|
48
48
|
className,
|
|
49
49
|
testId,
|
|
50
50
|
variant = 'section',
|
|
51
51
|
...props
|
|
52
52
|
}) => {
|
|
53
|
+
const Element = as;
|
|
53
54
|
const variantClass = variant && variant !== 'section' ? `wds-Divider--${variant}` : '';
|
|
54
55
|
const dividerClasses = clsx('wds-Divider', variantClass, className);
|
|
55
56
|
|