@transferwise/components 0.0.0-experimental-9956441 → 0.0.0-experimental-47c6fe8
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/dateLookup/dateHeader/DateHeader.js +26 -21
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs +26 -21
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/i18n/nl.json +73 -0
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/index.mjs +0 -1
- package/build/index.mjs.map +1 -1
- package/build/main.css +0 -29
- package/build/styles/dateLookup/DateLookup.css +0 -5
- package/build/styles/main.css +0 -29
- package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +1 -1
- package/build/types/index.d.ts +0 -2
- package/build/types/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/dateLookup/DateLookup.css +0 -5
- package/src/dateLookup/DateLookup.less +0 -4
- package/src/dateLookup/dateHeader/DateHeader.tsx +23 -25
- package/src/i18n/nl.json +73 -0
- package/src/index.ts +0 -2
- package/src/main.css +0 -29
- package/src/main.less +0 -1
- package/build/divider/Divider.js +0 -33
- package/build/divider/Divider.js.map +0 -1
- package/build/divider/Divider.mjs +0 -31
- package/build/divider/Divider.mjs.map +0 -1
- package/build/styles/divider/Divider.css +0 -24
- package/build/types/divider/Divider.d.ts +0 -30
- package/build/types/divider/Divider.d.ts.map +0 -1
- package/build/types/divider/index.d.ts +0 -3
- package/build/types/divider/index.d.ts.map +0 -1
- package/src/divider/Divider.accessibility.docs.mdx +0 -61
- package/src/divider/Divider.css +0 -24
- package/src/divider/Divider.less +0 -31
- package/src/divider/Divider.spec.tsx +0 -68
- package/src/divider/Divider.story.tsx +0 -132
- package/src/divider/Divider.tsx +0 -56
- package/src/divider/index.ts +0 -2
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import Divider from './Divider';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Wraps stories with a container (e.g., centered or padded).
|
|
6
|
-
* Adjust styles to your needs.
|
|
7
|
-
*/
|
|
8
|
-
const withContainer = (Story: any) => (
|
|
9
|
-
<div style={{ padding: '1rem' }}>
|
|
10
|
-
<Story />
|
|
11
|
-
</div>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Not all stories need access to all controls as it causes unnecessary UI noise.
|
|
16
|
-
*/
|
|
17
|
-
const hideControls = (args: string[]) => {
|
|
18
|
-
const hidden = ['variant', 'as', 'className', 'testId', ...args];
|
|
19
|
-
|
|
20
|
-
return Object.fromEntries(hidden.map((item) => [item, { table: { disable: true } }]));
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The stories below document the `<Divider />` component, which can be rendered as either a semantic `<hr>` or a non-semantic `<div>`.
|
|
25
|
-
* Variants allow customization for different visual separation needs.
|
|
26
|
-
*
|
|
27
|
-
* For more details, please refer to the [design documentation](https://wise.design/components/divider).
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
const meta: Meta<typeof Divider> = {
|
|
32
|
-
component: Divider,
|
|
33
|
-
title: 'Layouts/Divider',
|
|
34
|
-
tags: ['autodocs'],
|
|
35
|
-
decorators: [withContainer],
|
|
36
|
-
parameters: {
|
|
37
|
-
actions: { argTypesRegex: null },
|
|
38
|
-
},
|
|
39
|
-
argTypes: {
|
|
40
|
-
variant: {
|
|
41
|
-
control: 'select',
|
|
42
|
-
options: ['section', 'subsection', 'content'],
|
|
43
|
-
description: 'Choose the Divider variant.',
|
|
44
|
-
table: {
|
|
45
|
-
category: 'Appearance',
|
|
46
|
-
type: { summary: 'string' },
|
|
47
|
-
defaultValue: { summary: 'section' },
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
isContent: {
|
|
51
|
-
control: 'boolean',
|
|
52
|
-
description: 'Render as a semantic <hr> (true) or non-semantic <div> (false).',
|
|
53
|
-
table: {
|
|
54
|
-
category: 'Appearance',
|
|
55
|
-
type: { summary: 'boolean' },
|
|
56
|
-
defaultValue: { summary: 'false' },
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
className: {
|
|
60
|
-
description: 'Add custom class names to the Divider.',
|
|
61
|
-
table: {
|
|
62
|
-
category: 'Appearance',
|
|
63
|
-
type: { summary: 'string' },
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
testId: {
|
|
67
|
-
description: 'Add a data-testid attribute for testing.',
|
|
68
|
-
table: {
|
|
69
|
-
category: 'Testing',
|
|
70
|
-
type: { summary: 'string' },
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
args: {
|
|
75
|
-
isContent: false,
|
|
76
|
-
className: '',
|
|
77
|
-
testId: '',
|
|
78
|
-
variant: 'section',
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
export default meta;
|
|
82
|
-
|
|
83
|
-
type Story = StoryObj<typeof Divider>;
|
|
84
|
-
|
|
85
|
-
export const Playground: Story = {
|
|
86
|
-
args: {
|
|
87
|
-
variant: 'section',
|
|
88
|
-
},
|
|
89
|
-
tags: ['!autodocs'],
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* There are three different types of divider – `section`, `subsection`, and `content` –
|
|
94
|
-
* each designed to visually separate or group content. <br />
|
|
95
|
-
* [Design documentation](https://wise.design/components/divider)
|
|
96
|
-
*/
|
|
97
|
-
export const Variant: Story = {
|
|
98
|
-
argTypes: {
|
|
99
|
-
...hideControls(['testId', 'className', 'isContent']),
|
|
100
|
-
},
|
|
101
|
-
args: {
|
|
102
|
-
variant: 'section',
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* The `isContent` prop determines whether the divider is rendered as a semantic `<hr>` or a non-semantic `<div>`.
|
|
108
|
-
*/
|
|
109
|
-
export const ContentDivider: Story = {
|
|
110
|
-
argTypes: {
|
|
111
|
-
...hideControls(['variant', 'testId', 'className']),
|
|
112
|
-
},
|
|
113
|
-
args: {
|
|
114
|
-
isContent: true,
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const AllVariants: Story = {
|
|
119
|
-
render: function Render() {
|
|
120
|
-
return (
|
|
121
|
-
<>
|
|
122
|
-
<Divider variant="section" />
|
|
123
|
-
<Divider variant="subsection" />
|
|
124
|
-
<Divider variant="content" />
|
|
125
|
-
</>
|
|
126
|
-
);
|
|
127
|
-
},
|
|
128
|
-
argTypes: {
|
|
129
|
-
...hideControls(['variant', 'testId', 'className', 'isContent']),
|
|
130
|
-
},
|
|
131
|
-
tags: ['!autodocs'],
|
|
132
|
-
};
|
package/src/divider/Divider.tsx
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import React, { FunctionComponent } from 'react';
|
|
3
|
-
|
|
4
|
-
export interface DividerProps {
|
|
5
|
-
/**
|
|
6
|
-
* If `true`, renders the Divider as a semantic `<hr>`, providing clear separation to assistive technologies.
|
|
7
|
-
* Otherwise, a non-semantic `<div role="presentation">` is used for purely visual separation.
|
|
8
|
-
* @default false
|
|
9
|
-
*/
|
|
10
|
-
isContent?: boolean;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Appends additional class names to style the `Divider`.
|
|
14
|
-
*/
|
|
15
|
-
className?: string;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Provides a `data-testid` attribute for testing.
|
|
19
|
-
*/
|
|
20
|
-
testId?: string;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Alters the visual style of the divider, accommodating different types
|
|
24
|
-
* of separated content. Accepts `'section'`, `'subsection'`, or `'content'`.
|
|
25
|
-
* @default 'section'
|
|
26
|
-
*/
|
|
27
|
-
variant?: 'section' | 'subsection' | 'content';
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @see {@link Divider} for further information.
|
|
32
|
-
* @see {@link https://storybook.wise.design/?path=/docs/layouts-divider--docs|Storybook Wise Design}
|
|
33
|
-
*/
|
|
34
|
-
const Divider: FunctionComponent<DividerProps> = ({
|
|
35
|
-
className,
|
|
36
|
-
isContent = false,
|
|
37
|
-
testId,
|
|
38
|
-
variant = 'section',
|
|
39
|
-
...props
|
|
40
|
-
}) => {
|
|
41
|
-
const variantClass = variant && variant !== 'section' ? `wds-Divider--${variant}` : '';
|
|
42
|
-
|
|
43
|
-
const commonProps = {
|
|
44
|
-
className: clsx('wds-Divider', variantClass, className),
|
|
45
|
-
'data-testid': testId,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const divProps = {
|
|
49
|
-
...commonProps,
|
|
50
|
-
role: 'presentation',
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
return isContent ? <hr {...commonProps} {...props} /> : <div {...divProps} {...props} />;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export default Divider;
|
package/src/divider/index.ts
DELETED