@moda/om 17.7.0 → 17.9.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.
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs.js +4601 -4557
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +4601 -4557
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/Breakpoint/Breakpoint.d.ts +2 -4
- package/package.json +1 -1
- package/src/components/AspectRatioBox/AspectRatioBox.tsx +2 -2
- package/src/components/Badge/Badge.stories.tsx +6 -6
- package/src/components/Badge/Badge.test.tsx +1 -1
- package/src/components/Breadcrumbs/Breadcrumb/Breadcrumb.tsx +6 -6
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +6 -6
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/components/Breakpoint/Breakpoint.stories.tsx +9 -9
- package/src/components/Breakpoint/Breakpoint.test.tsx +2 -2
- package/src/components/Breakpoint/Breakpoint.tsx +11 -4
- package/src/components/Button/Button.stories.tsx +2 -2
- package/src/components/Checkbox/Checkbox.stories.tsx +4 -4
- package/src/components/Checkbox/Checkbox.test.tsx +3 -3
- package/src/components/Checkbox/Checkbox.tsx +4 -4
- package/src/components/Clickable/Clickable.stories.tsx +2 -2
- package/src/components/ColorSwatch/ColorSwatch.stories.tsx +11 -11
- package/src/components/ColorSwatch/ColorSwatch.test.tsx +1 -1
- package/src/components/ColorSwatch/ColorSwatch.tsx +1 -1
- package/src/components/Constrain/Constrain.stories.tsx +1 -1
- package/src/components/Constrain/ExceedConstrain.stories.tsx +2 -2
- package/src/components/CreditCardNumberInput/CreditCardNumberInput.stories.tsx +1 -1
- package/src/components/CreditCardNumberInput/CreditCardNumberInput.test.tsx +4 -4
- package/src/components/DefinitionList/DefinitionList.stories.tsx +2 -2
- package/src/components/DefinitionList/DefinitionList.test.tsx +1 -1
- package/src/components/Divider/Divider.stories.tsx +3 -3
- package/src/components/Divider/Divider.test.tsx +1 -1
- package/src/components/Divider/Divider.tsx +1 -1
- package/src/components/Divider/NoLineDivider.tsx +1 -1
- package/src/components/Divider/TwoLineDivider.tsx +1 -1
- package/src/components/Expandable/Expandable.stories.tsx +9 -9
- package/src/components/Expandable/Expandable.test.tsx +1 -1
- package/src/components/Expandable/Expandable.tsx +3 -3
- package/src/components/Field/Field.stories.tsx +2 -2
- package/src/components/Field/Field.test.tsx +6 -6
- package/src/components/Field/Field.tsx +5 -5
- package/src/components/Loading/Loading.test.tsx +1 -1
- package/src/components/LoadingBalls/LoadingBalls.tsx +28 -28
- package/src/components/Modal/Modal.test.tsx +2 -2
- package/src/components/ModalOverlay/ModalOverlay.test.tsx +2 -2
- package/src/components/Paginator/Paginator.tsx +3 -3
- package/src/components/PasswordInput/PasswordInput.stories.tsx +1 -1
- package/src/components/PasswordInput/PasswordInput.tsx +6 -6
- package/src/components/Popover/Popover.stories.tsx +1 -1
- package/src/components/Popover/Popover.tsx +3 -3
- package/src/components/PromoBanner/PromoBanner.stories.tsx +9 -9
- package/src/components/PromoBanner/PromoBanner.tsx +1 -1
- package/src/components/RadioButton/RadioButton.stories.tsx +1 -1
- package/src/components/RadioButton/RadioButton.tsx +4 -4
- package/src/components/SearchInput/SearchInput.stories.tsx +2 -2
- package/src/components/SearchInput/SearchInput.test.tsx +1 -1
- package/src/components/SearchInput/SearchInput.tsx +3 -3
- package/src/components/Select/MultiSelect.tsx +5 -5
- package/src/components/Select/Select.stories.tsx +9 -9
- package/src/components/Select/Select.test.tsx +13 -13
- package/src/components/Select/Select.tsx +7 -7
- package/src/components/Select/SelectOption.tsx +1 -1
- package/src/components/Select/SelectOptions.tsx +5 -5
- package/src/components/Shape/ArcWindow.tsx +10 -10
- package/src/components/Shape/Bradley.tsx +3 -3
- package/src/components/Shape/Brancusi.tsx +3 -3
- package/src/components/Shape/Circle.tsx +10 -10
- package/src/components/Shape/Diamond.tsx +10 -10
- package/src/components/Shape/Keyhole.tsx +3 -3
- package/src/components/Shape/Mirror.tsx +3 -3
- package/src/components/Shape/Oval.tsx +3 -3
- package/src/components/Shape/Triangle.tsx +7 -7
- package/src/components/Shape/Window.tsx +3 -3
- package/src/components/SlidingPane/SlidingPane.stories.tsx +3 -3
- package/src/components/SlidingPane/SlidingPane.tsx +26 -24
- package/src/components/Stack/Stack.test.tsx +1 -1
- package/src/components/Tabs/TabList.tsx +1 -1
- package/src/components/Tabs/TabPanel.tsx +1 -1
- package/src/components/Tabs/TabPanels.tsx +1 -1
- package/src/components/Tabs/Tabs.stories.tsx +2 -2
- package/src/components/Tabs/Tabs.test.tsx +2 -2
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/Text/Text.stories.tsx +5 -5
- package/src/components/Text/Text.test.tsx +1 -1
- package/src/components/TextInput/TextInput.stories.tsx +1 -1
- package/src/components/TextInput/TextInput.test.tsx +1 -1
- package/src/components/Textarea/Textarea.stories.tsx +1 -1
- package/src/components/Textarea/Textarea.test.tsx +3 -3
- package/src/components/Toast/Toast.stories.tsx +1 -1
- package/src/components/Toast/Toast.test.tsx +1 -1
- package/src/components/Toast/Toast.tsx +5 -5
- package/src/components/VerticalDivider/VerticalDivider.stories.tsx +2 -2
- package/src/components/VerticalDivider/VerticalDivider.test.tsx +2 -2
- package/src/mixins/font-smoothing/font-smoothing.stories.tsx +8 -8
- package/src/mixins/overflow-scroll/overflow-scroll.stories.tsx +2 -2
- package/src/mixins/stack/stack.stories.tsx +2 -2
- package/src/mixins/thin-underline/thin-underline.stories.tsx +1 -1
- package/src/mixins/visually-hidden/visually-hidden.stories.tsx +1 -1
- package/src/utilities/States/State.tsx +2 -2
- package/src/utilities/States/States.tsx +1 -1
- package/src/utilities/States/StatesProps.tsx +1 -1
|
@@ -38,7 +38,7 @@ export const Default = () => (
|
|
|
38
38
|
{ idRef: '7', label: undefined, placeholder: 'Placeholder' }
|
|
39
39
|
]}
|
|
40
40
|
>
|
|
41
|
-
<Select label=
|
|
41
|
+
<Select label='Sort by' options={OPTIONS} onChange={action('onChange')} />
|
|
42
42
|
</States>
|
|
43
43
|
);
|
|
44
44
|
|
|
@@ -56,7 +56,7 @@ export const ChangingValue = () => {
|
|
|
56
56
|
return () => clearInterval(interval);
|
|
57
57
|
}, []);
|
|
58
58
|
|
|
59
|
-
return <Select label=
|
|
59
|
+
return <Select label='Sort by' options={OPTIONS} onChange={action('onChange')} value={value} />;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
const COUNTRIES = [
|
|
@@ -260,16 +260,16 @@ const COUNTRIES = [
|
|
|
260
260
|
|
|
261
261
|
export const Long = () => (
|
|
262
262
|
<Select
|
|
263
|
-
label=
|
|
263
|
+
label='Choose country'
|
|
264
264
|
options={COUNTRIES.map(country => ({ label: country, value: country }))}
|
|
265
265
|
/>
|
|
266
266
|
);
|
|
267
267
|
|
|
268
268
|
export const AutoFill = () => (
|
|
269
269
|
<>
|
|
270
|
-
<Input label=
|
|
271
|
-
<Input label=
|
|
272
|
-
<Input label=
|
|
270
|
+
<Input label='Address*' name='addressLine1' />
|
|
271
|
+
<Input label='City' name='city' />
|
|
272
|
+
<Input label='Choose country' name='country'>
|
|
273
273
|
<Select
|
|
274
274
|
options={COUNTRIES.map(country => ({ label: country, value: country }))}
|
|
275
275
|
allowAutoFill
|
|
@@ -313,7 +313,7 @@ export const MultiSelectWithDefaultsComponent = () => {
|
|
|
313
313
|
<MultiSelect
|
|
314
314
|
onChange={handleSetItems}
|
|
315
315
|
value={selectedItems}
|
|
316
|
-
placeholder=
|
|
316
|
+
placeholder='United States'
|
|
317
317
|
defaultValue={['Canada', 'Albania', 'Greece']}
|
|
318
318
|
options={COUNTRIES.map(country => ({ label: country, value: country }))}
|
|
319
319
|
/>
|
|
@@ -323,7 +323,7 @@ export const MultiSelectWithDefaultsComponent = () => {
|
|
|
323
323
|
export const MultiSelectUncontrolledComponent = () => {
|
|
324
324
|
return (
|
|
325
325
|
<MultiSelect
|
|
326
|
-
placeholder=
|
|
326
|
+
placeholder='United States'
|
|
327
327
|
defaultValue={['Canada', 'Albania', 'Greece']}
|
|
328
328
|
options={COUNTRIES.map(country => ({ label: country, value: country }))}
|
|
329
329
|
/>
|
|
@@ -334,7 +334,7 @@ export const MultiSelectUncontrolledSearchComponent = () => {
|
|
|
334
334
|
return (
|
|
335
335
|
<MultiSelect
|
|
336
336
|
searchable
|
|
337
|
-
placeholder=
|
|
337
|
+
placeholder='United States'
|
|
338
338
|
defaultValue={['Canada', 'Albania', 'Greece']}
|
|
339
339
|
options={COUNTRIES.map(country => ({ label: country, value: country }))}
|
|
340
340
|
/>
|
|
@@ -13,7 +13,7 @@ describe('Select', () => {
|
|
|
13
13
|
|
|
14
14
|
it('renders correctly', () => {
|
|
15
15
|
const { container } = render(
|
|
16
|
-
<Select idRef=
|
|
16
|
+
<Select idRef='1' name='name-1' label='Sort by' options={options} />
|
|
17
17
|
);
|
|
18
18
|
expect(container.innerHTML).toEqual(
|
|
19
19
|
'<div id="Select--1" class="Select"><input id="1" name="name-1" type="hidden" value=""><button id="Select__value--1" aria-haspopup="listbox" aria-expanded="false" aria-labelledby="Select__label--1 Select__value--1" type="button" title="Select" class="Clickable Select__value"><label id="Select__label--1">Sort by</label><span class="Select__icon"></span></button></div>'
|
|
@@ -22,7 +22,7 @@ describe('Select', () => {
|
|
|
22
22
|
|
|
23
23
|
it('expands when clicked', async () => {
|
|
24
24
|
const { container } = render(
|
|
25
|
-
<Select idRef=
|
|
25
|
+
<Select idRef='1' name='name-1' label='Sort by' options={options} />
|
|
26
26
|
);
|
|
27
27
|
const button = screen.getByRole('button', { name: /Sort by/ });
|
|
28
28
|
await userEvent.click(button);
|
|
@@ -36,9 +36,9 @@ describe('Select', () => {
|
|
|
36
36
|
<Select
|
|
37
37
|
defaultValue={undefined}
|
|
38
38
|
disabled
|
|
39
|
-
idRef=
|
|
40
|
-
name=
|
|
41
|
-
label=
|
|
39
|
+
idRef='1'
|
|
40
|
+
name='name-1'
|
|
41
|
+
label='Sort by'
|
|
42
42
|
options={options}
|
|
43
43
|
/>
|
|
44
44
|
);
|
|
@@ -54,9 +54,9 @@ describe('Select', () => {
|
|
|
54
54
|
render(
|
|
55
55
|
<Select
|
|
56
56
|
defaultValue={undefined}
|
|
57
|
-
idRef=
|
|
58
|
-
label=
|
|
59
|
-
name=
|
|
57
|
+
idRef='1'
|
|
58
|
+
label='Sort by'
|
|
59
|
+
name='name-1'
|
|
60
60
|
options={options}
|
|
61
61
|
onChange={onChange}
|
|
62
62
|
/>
|
|
@@ -73,9 +73,9 @@ describe('Select', () => {
|
|
|
73
73
|
render(
|
|
74
74
|
<Select
|
|
75
75
|
defaultValue={undefined}
|
|
76
|
-
idRef=
|
|
77
|
-
label=
|
|
78
|
-
name=
|
|
76
|
+
idRef='1'
|
|
77
|
+
label='Sort by'
|
|
78
|
+
name='name-1'
|
|
79
79
|
options={options}
|
|
80
80
|
onChange={onChange}
|
|
81
81
|
/>
|
|
@@ -89,7 +89,7 @@ describe('Select', () => {
|
|
|
89
89
|
|
|
90
90
|
it('renders correctly with ":" between label and value if value is not undefined', async () => {
|
|
91
91
|
const { container } = render(
|
|
92
|
-
<Select idRef=
|
|
92
|
+
<Select idRef='1' name='name-1' label='Sort by' options={options} />
|
|
93
93
|
);
|
|
94
94
|
const button = screen.getByRole('button', { name: /Sort by/ });
|
|
95
95
|
await userEvent.click(button);
|
|
@@ -101,7 +101,7 @@ describe('Select', () => {
|
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
it('renders correctly when there is no label', async () => {
|
|
104
|
-
const { container } = render(<Select idRef=
|
|
104
|
+
const { container } = render(<Select idRef='1' name='name-1' options={options} />);
|
|
105
105
|
const button = screen.getByRole('button', { name: 'Select' });
|
|
106
106
|
await userEvent.click(button);
|
|
107
107
|
const option = screen.getByLabelText('Bar');
|
|
@@ -105,20 +105,20 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
105
105
|
{...rest}
|
|
106
106
|
>
|
|
107
107
|
{!allowAutoFill && name && (
|
|
108
|
-
<input id={idRef} name={name} type=
|
|
108
|
+
<input id={idRef} name={name} type='hidden' value={state.value} />
|
|
109
109
|
)}
|
|
110
110
|
|
|
111
111
|
<Clickable
|
|
112
112
|
id={`Select__value--${idRef}`}
|
|
113
|
-
className=
|
|
113
|
+
className='Select__value'
|
|
114
114
|
disabled={disabled}
|
|
115
115
|
onClick={handleToggle}
|
|
116
116
|
data-test-id={dataTestId}
|
|
117
|
-
aria-haspopup=
|
|
117
|
+
aria-haspopup='listbox'
|
|
118
118
|
aria-expanded={state.mode === Mode.Open}
|
|
119
119
|
aria-labelledby={`Select__label--${idRef} Select__value--${idRef}`}
|
|
120
|
-
type=
|
|
121
|
-
title=
|
|
120
|
+
type='button'
|
|
121
|
+
title='Select'
|
|
122
122
|
>
|
|
123
123
|
<SelectLabel
|
|
124
124
|
idRef={idRef}
|
|
@@ -154,11 +154,11 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
154
154
|
|
|
155
155
|
{allowAutoFill && (
|
|
156
156
|
<input
|
|
157
|
-
className=
|
|
157
|
+
className='Select__hidden-field'
|
|
158
158
|
name={name}
|
|
159
159
|
onChange={({ target }) => handleAutofill(target.value)}
|
|
160
160
|
value={value}
|
|
161
|
-
aria-hidden=
|
|
161
|
+
aria-hidden='true'
|
|
162
162
|
tabIndex={-1}
|
|
163
163
|
/>
|
|
164
164
|
)}
|
|
@@ -48,7 +48,7 @@ export const SelectOption: React.FC<SelectOptionProps> = ({
|
|
|
48
48
|
data-test-id={dataTestId ? `${dataTestId}--${option.label.replace(' ', '-')}` : undefined}
|
|
49
49
|
aria-label={option.label}
|
|
50
50
|
aria-selected={selected}
|
|
51
|
-
role=
|
|
51
|
+
role='option'
|
|
52
52
|
>
|
|
53
53
|
{option.label}
|
|
54
54
|
</li>
|
|
@@ -63,17 +63,17 @@ export const SelectOptions: React.FC<SelectOptionsProps> = ({
|
|
|
63
63
|
<div className={classNames('SelectOptions', className)}>
|
|
64
64
|
{searchable && (
|
|
65
65
|
<SearchInput
|
|
66
|
-
className=
|
|
67
|
-
placeholder=
|
|
66
|
+
className='SelectOptions__search'
|
|
67
|
+
placeholder='Search'
|
|
68
68
|
value={searchPhrase}
|
|
69
69
|
onChange={setSearchPhrase}
|
|
70
70
|
onClear={() => setSearchPhrase('')}
|
|
71
71
|
/>
|
|
72
72
|
)}
|
|
73
73
|
<ul
|
|
74
|
-
className=
|
|
74
|
+
className='SelectOptions__list'
|
|
75
75
|
tabIndex={-1}
|
|
76
|
-
role=
|
|
76
|
+
role='listbox'
|
|
77
77
|
ref={ref}
|
|
78
78
|
aria-labelledby={`Select__label--${idRef}`}
|
|
79
79
|
aria-activedescendant={`SelectOption--${activeOption?.value}-${idRef}`}
|
|
@@ -94,7 +94,7 @@ export const SelectOptions: React.FC<SelectOptionsProps> = ({
|
|
|
94
94
|
))}
|
|
95
95
|
</ul>
|
|
96
96
|
{options.length === 0 && (
|
|
97
|
-
<Text className=
|
|
97
|
+
<Text className='SelectOptions__none' color='cement'>
|
|
98
98
|
Nothing found
|
|
99
99
|
</Text>
|
|
100
100
|
)}
|
|
@@ -3,18 +3,18 @@ import { ShapeProps } from './Shape';
|
|
|
3
3
|
|
|
4
4
|
export const ArcWindow: React.FC<ShapeProps> = () => (
|
|
5
5
|
<svg
|
|
6
|
-
className=
|
|
7
|
-
width=
|
|
8
|
-
height=
|
|
9
|
-
viewBox=
|
|
10
|
-
fill=
|
|
11
|
-
xmlns=
|
|
6
|
+
className='ArcWindow'
|
|
7
|
+
width='24'
|
|
8
|
+
height='24'
|
|
9
|
+
viewBox='0 0 24 24'
|
|
10
|
+
fill='none'
|
|
11
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
12
12
|
>
|
|
13
13
|
<path
|
|
14
|
-
fillRule=
|
|
15
|
-
clipRule=
|
|
16
|
-
d=
|
|
17
|
-
fill=
|
|
14
|
+
fillRule='evenodd'
|
|
15
|
+
clipRule='evenodd'
|
|
16
|
+
d='M20.1097 24V11.6273V8.8331V8.81993C20.1018 3.96884 16.4806 0 12.0536 0C7.6291 0 4.00527 3.96884 4 8.81993V8.8331V11.6273V24H20.1097Z'
|
|
17
|
+
fill='#003728'
|
|
18
18
|
/>
|
|
19
19
|
</svg>
|
|
20
20
|
);
|
|
@@ -4,10 +4,10 @@ import { ShapeProps } from './Shape';
|
|
|
4
4
|
export const Bradley: React.FC<ShapeProps> = props => (
|
|
5
5
|
<svg
|
|
6
6
|
style={{ fill: 'currentcolor' }}
|
|
7
|
-
xmlns=
|
|
8
|
-
viewBox=
|
|
7
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
8
|
+
viewBox='0 0 110 211'
|
|
9
9
|
{...props}
|
|
10
10
|
>
|
|
11
|
-
<path d=
|
|
11
|
+
<path d='M110 .336H0v210h45.11v-52.595h19.78v52.595H110V105.147z' />
|
|
12
12
|
</svg>
|
|
13
13
|
);
|
|
@@ -4,10 +4,10 @@ import { ShapeProps } from './Shape';
|
|
|
4
4
|
export const Brancusi: React.FC<ShapeProps> = props => (
|
|
5
5
|
<svg
|
|
6
6
|
style={{ fill: 'currentcolor' }}
|
|
7
|
-
xmlns=
|
|
8
|
-
viewBox=
|
|
7
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
8
|
+
viewBox='0 0 111 210'
|
|
9
9
|
{...props}
|
|
10
10
|
>
|
|
11
|
-
<path d=
|
|
11
|
+
<path d='M110.575 210l-27.5-105 27.5-105h-110l27.501 105L.575 210z' />
|
|
12
12
|
</svg>
|
|
13
13
|
);
|
|
@@ -3,18 +3,18 @@ import { ShapeProps } from './Shape';
|
|
|
3
3
|
|
|
4
4
|
export const Circle: React.FC<ShapeProps> = () => (
|
|
5
5
|
<svg
|
|
6
|
-
className=
|
|
7
|
-
width=
|
|
8
|
-
height=
|
|
9
|
-
viewBox=
|
|
10
|
-
fill=
|
|
11
|
-
xmlns=
|
|
6
|
+
className='Circle'
|
|
7
|
+
width='24'
|
|
8
|
+
height='24'
|
|
9
|
+
viewBox='0 0 24 24'
|
|
10
|
+
fill='none'
|
|
11
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
12
12
|
>
|
|
13
13
|
<path
|
|
14
|
-
fillRule=
|
|
15
|
-
clipRule=
|
|
16
|
-
d=
|
|
17
|
-
fill=
|
|
14
|
+
fillRule='evenodd'
|
|
15
|
+
clipRule='evenodd'
|
|
16
|
+
d='M24 12C24 18.6282 18.6282 24 12 24C5.37184 24 0 18.6282 0 12C0 5.37184 5.37184 0 12 0C18.6282 0 24 5.37184 24 12Z'
|
|
17
|
+
fill='#D7B3D0'
|
|
18
18
|
/>
|
|
19
19
|
</svg>
|
|
20
20
|
);
|
|
@@ -3,18 +3,18 @@ import { ShapeProps } from './Shape';
|
|
|
3
3
|
|
|
4
4
|
export const Diamond: React.FC<ShapeProps> = () => (
|
|
5
5
|
<svg
|
|
6
|
-
className=
|
|
7
|
-
width=
|
|
8
|
-
height=
|
|
9
|
-
viewBox=
|
|
10
|
-
fill=
|
|
11
|
-
xmlns=
|
|
6
|
+
className='Diamond'
|
|
7
|
+
width='24'
|
|
8
|
+
height='24'
|
|
9
|
+
viewBox='0 0 24 24'
|
|
10
|
+
fill='none'
|
|
11
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
12
12
|
>
|
|
13
13
|
<path
|
|
14
|
-
fillRule=
|
|
15
|
-
clipRule=
|
|
16
|
-
d=
|
|
17
|
-
fill=
|
|
14
|
+
fillRule='evenodd'
|
|
15
|
+
clipRule='evenodd'
|
|
16
|
+
d='M12 24.0026L0 12.0026L12 0L24 12.0026L12 24.0026Z'
|
|
17
|
+
fill='#C44CB0'
|
|
18
18
|
/>
|
|
19
19
|
</svg>
|
|
20
20
|
);
|
|
@@ -4,10 +4,10 @@ import { ShapeProps } from './Shape';
|
|
|
4
4
|
export const Keyhole: React.FC<ShapeProps> = props => (
|
|
5
5
|
<svg
|
|
6
6
|
style={{ fill: 'currentcolor' }}
|
|
7
|
-
xmlns=
|
|
8
|
-
viewBox=
|
|
7
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
8
|
+
viewBox='0 0 111 210'
|
|
9
9
|
{...props}
|
|
10
10
|
>
|
|
11
|
-
<path d=
|
|
11
|
+
<path d='M.8 210h110V86.403h-9.317c5.88-8.833 9.317-19.46 9.317-30.902C110.8 24.85 86.175 0 55.8 0S.8 24.85.8 55.501c0 11.441 3.436 22.069 9.315 30.902H.8V210z' />
|
|
12
12
|
</svg>
|
|
13
13
|
);
|
|
@@ -4,10 +4,10 @@ import { ShapeProps } from './Shape';
|
|
|
4
4
|
export const Mirror: React.FC<ShapeProps> = props => (
|
|
5
5
|
<svg
|
|
6
6
|
style={{ fill: 'currentcolor' }}
|
|
7
|
-
xmlns=
|
|
8
|
-
viewBox=
|
|
7
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
8
|
+
viewBox='0 0 111 210'
|
|
9
9
|
{...props}
|
|
10
10
|
>
|
|
11
|
-
<path d=
|
|
11
|
+
<path d='M110.03 105c0-22.7-3.786-43.7-10.2-60.874V15.97H84.176C75.724 5.862 65.739 0 55.03 0 44.323 0 34.336 5.862 25.885 15.969H10.23v28.157C3.817 61.3.03 82.3.03 105c0 22.7 3.787 43.7 10.2 60.874v28.157h15.655C34.336 204.138 44.323 210 55.03 210c10.708 0 20.693-5.862 29.146-15.969h15.652v-28.157C106.244 148.7 110.03 127.7 110.03 105z' />
|
|
12
12
|
</svg>
|
|
13
13
|
);
|
|
@@ -4,10 +4,10 @@ import { ShapeProps } from './Shape';
|
|
|
4
4
|
export const Oval: React.FC<ShapeProps> = props => (
|
|
5
5
|
<svg
|
|
6
6
|
style={{ fill: 'currentcolor' }}
|
|
7
|
-
xmlns=
|
|
8
|
-
viewBox=
|
|
7
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
8
|
+
viewBox='0 0 110 210'
|
|
9
9
|
{...props}
|
|
10
10
|
>
|
|
11
|
-
<path d=
|
|
11
|
+
<path d='M110 105C110 47.01 85.376 0 55 0S0 47.01 0 105s24.624 105 55 105 55-47.01 55-105z' />
|
|
12
12
|
</svg>
|
|
13
13
|
);
|
|
@@ -3,13 +3,13 @@ import { ShapeProps } from './Shape';
|
|
|
3
3
|
|
|
4
4
|
export const Triangle: React.FC<ShapeProps> = () => (
|
|
5
5
|
<svg
|
|
6
|
-
className=
|
|
7
|
-
width=
|
|
8
|
-
height=
|
|
9
|
-
viewBox=
|
|
10
|
-
fill=
|
|
11
|
-
xmlns=
|
|
6
|
+
className='Triangle'
|
|
7
|
+
width='24'
|
|
8
|
+
height='24'
|
|
9
|
+
viewBox='0 0 24 24'
|
|
10
|
+
fill='none'
|
|
11
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
12
12
|
>
|
|
13
|
-
<path fillRule=
|
|
13
|
+
<path fillRule='evenodd' clipRule='evenodd' d='M11.9986 0L0 24H24L11.9986 0Z' fill='#D56B27' />
|
|
14
14
|
</svg>
|
|
15
15
|
);
|
|
@@ -4,10 +4,10 @@ import { ShapeProps } from './Shape';
|
|
|
4
4
|
export const Window: React.FC<ShapeProps> = props => (
|
|
5
5
|
<svg
|
|
6
6
|
style={{ fill: 'currentcolor' }}
|
|
7
|
-
xmlns=
|
|
8
|
-
viewBox=
|
|
7
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
8
|
+
viewBox='0 0 110 210'
|
|
9
9
|
{...props}
|
|
10
10
|
>
|
|
11
|
-
<path d=
|
|
11
|
+
<path d='M110 187.673V21.948H98.87C88.873 8.64 73.08 0 55.247 0 37.412 0 21.619 8.64 11.622 21.948H0v165.725h11.34C21.32 201.198 37.245 210 55.248 210c18 0 33.924-8.802 43.904-22.327H110z' />
|
|
12
12
|
</svg>
|
|
13
13
|
);
|
|
@@ -16,13 +16,13 @@ export const Mobile = () => {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<>
|
|
19
|
-
<Stack space={1} direction=
|
|
19
|
+
<Stack space={1} direction='horizontal' alignItems='center'>
|
|
20
20
|
<RulerIcon />
|
|
21
21
|
<Clickable onClick={handleOpen}>Size Guide</Clickable>
|
|
22
22
|
</Stack>
|
|
23
|
-
<SlidingPane onClose={handleClose} title=
|
|
23
|
+
<SlidingPane onClose={handleClose} title='Size Guide' visible={isOpen}>
|
|
24
24
|
<Stack space={2}>
|
|
25
|
-
<Badge theme=
|
|
25
|
+
<Badge theme='noise'>Runs small we recommend sizing up one size.</Badge>
|
|
26
26
|
<Text>
|
|
27
27
|
Select your region to convert your size. Size and cut may vary between brands. Use this
|
|
28
28
|
chart as a general guide.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import ExitIcon from '@moda/icons/exit-16';
|
|
4
|
+
import { FocusOn } from 'react-focus-on';
|
|
4
5
|
import { Clickable } from '../Clickable';
|
|
5
6
|
import { Text } from '../Text';
|
|
6
|
-
|
|
7
|
-
import './SlidingPane.scss';
|
|
8
7
|
import { Stack } from '../Stack';
|
|
8
|
+
import './SlidingPane.scss';
|
|
9
9
|
|
|
10
10
|
export type SlidingPaneProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
11
11
|
children: React.ReactNode;
|
|
@@ -24,34 +24,36 @@ export const SlidingPane: React.FC<SlidingPaneProps> = ({
|
|
|
24
24
|
}) => {
|
|
25
25
|
return (
|
|
26
26
|
<>
|
|
27
|
-
<div
|
|
28
|
-
className={classNames('SlidingPane', className, {
|
|
29
|
-
'SlidingPane--active': visible
|
|
30
|
-
})}
|
|
31
|
-
{...rest}
|
|
32
|
-
>
|
|
33
|
-
<Stack
|
|
34
|
-
space={0}
|
|
35
|
-
justifyContent="center"
|
|
36
|
-
direction="horizontal"
|
|
37
|
-
className="SlidingPane__top"
|
|
38
|
-
>
|
|
39
|
-
<Text treatment="h5" family="serif">
|
|
40
|
-
{title}
|
|
41
|
-
</Text>
|
|
42
|
-
<Clickable className="SlidingPane__close" onClick={onClose}>
|
|
43
|
-
<ExitIcon />
|
|
44
|
-
</Clickable>
|
|
45
|
-
</Stack>
|
|
46
|
-
<div className="SlidingPane__content">{children}</div>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
27
|
<div
|
|
50
28
|
className={classNames('SlidingPane__overlay', {
|
|
51
29
|
'SlidingPane__overlay--active': visible
|
|
52
30
|
})}
|
|
53
31
|
onClick={onClose}
|
|
54
32
|
></div>
|
|
33
|
+
|
|
34
|
+
<FocusOn enabled={visible} onClickOutside={onClose} onEscapeKey={onClose}>
|
|
35
|
+
<div
|
|
36
|
+
className={classNames('SlidingPane', className, {
|
|
37
|
+
'SlidingPane--active': visible
|
|
38
|
+
})}
|
|
39
|
+
{...rest}
|
|
40
|
+
>
|
|
41
|
+
<Stack
|
|
42
|
+
space={0}
|
|
43
|
+
justifyContent='center'
|
|
44
|
+
direction='horizontal'
|
|
45
|
+
className='SlidingPane__top'
|
|
46
|
+
>
|
|
47
|
+
<Text treatment='h5' family='serif'>
|
|
48
|
+
{title}
|
|
49
|
+
</Text>
|
|
50
|
+
<Clickable className='SlidingPane__close' onClick={onClose}>
|
|
51
|
+
<ExitIcon />
|
|
52
|
+
</Clickable>
|
|
53
|
+
</Stack>
|
|
54
|
+
<div className='SlidingPane__content'>{children}</div>
|
|
55
|
+
</div>
|
|
56
|
+
</FocusOn>
|
|
55
57
|
</>
|
|
56
58
|
);
|
|
57
59
|
};
|
|
@@ -10,7 +10,7 @@ export type TabListProps = {
|
|
|
10
10
|
|
|
11
11
|
export const TabList: React.FC<TabListProps> = ({ tabs, onTabSelected, activePanel }) => {
|
|
12
12
|
return (
|
|
13
|
-
<div className=
|
|
13
|
+
<div className='TabList'>
|
|
14
14
|
{tabs.map(tab => (
|
|
15
15
|
<Tab key={tab.name} tab={tab} onTabChosen={onTabSelected} activeTab={activePanel} />
|
|
16
16
|
))}
|
|
@@ -9,7 +9,7 @@ export type TabPanelsProps = {
|
|
|
9
9
|
|
|
10
10
|
export const TabPanels: React.FC<TabPanelsProps> = ({ panels, activePanel }) => {
|
|
11
11
|
return (
|
|
12
|
-
<div className=
|
|
12
|
+
<div className='TabPanels'>
|
|
13
13
|
{panels
|
|
14
14
|
.filter(tab => tab.name === activePanel)
|
|
15
15
|
.map(tab => (
|
|
@@ -47,9 +47,9 @@ export const WithCallback = () => {
|
|
|
47
47
|
return (
|
|
48
48
|
<States<TabsProps>>
|
|
49
49
|
<>
|
|
50
|
-
<Text treatment=
|
|
50
|
+
<Text treatment='h5'>Selected Tab:</Text>
|
|
51
51
|
<Text> {tabName} </Text>
|
|
52
|
-
<Tabs tabs={TAB_LIST} onTabClicked={handleTabClick} activeTab=
|
|
52
|
+
<Tabs tabs={TAB_LIST} onTabClicked={handleTabClick} activeTab='tab2' />
|
|
53
53
|
</>
|
|
54
54
|
</States>
|
|
55
55
|
);
|
|
@@ -8,12 +8,12 @@ describe('Tabs', () => {
|
|
|
8
8
|
{
|
|
9
9
|
name: 'tab1',
|
|
10
10
|
title: 'Tab 1',
|
|
11
|
-
panel: <div className=
|
|
11
|
+
panel: <div className='test'>I am a panel</div>
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
name: 'tab2',
|
|
15
15
|
title: 'Tab 2',
|
|
16
|
-
panel: <div className=
|
|
16
|
+
panel: <div className='test'>I am also a panel</div>
|
|
17
17
|
}
|
|
18
18
|
];
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ export const Tag: React.FC<TagProps> = ({ className, disabled, onRemove, childre
|
|
|
13
13
|
<div className={classNames('Tag', className, { 'Tag--disabled': disabled })} {...rest}>
|
|
14
14
|
<div>{children}</div>
|
|
15
15
|
{onRemove && (
|
|
16
|
-
<Clickable disabled={disabled} aria-label=
|
|
16
|
+
<Clickable disabled={disabled} aria-label='Remove' onClick={onRemove}>
|
|
17
17
|
<ExitIcon />
|
|
18
18
|
</Clickable>
|
|
19
19
|
)}
|
|
@@ -23,24 +23,24 @@ export const Treatments = () => (
|
|
|
23
23
|
|
|
24
24
|
export const Colors = () => (
|
|
25
25
|
<States<Partial<TextProps>> states={COLORS}>
|
|
26
|
-
<Text treatment=
|
|
26
|
+
<Text treatment='h5'>Moda Operandi</Text>
|
|
27
27
|
</States>
|
|
28
28
|
);
|
|
29
29
|
|
|
30
30
|
export const Families = () => (
|
|
31
31
|
<States<Partial<TextProps>> states={FAMILIES}>
|
|
32
|
-
<Text treatment=
|
|
32
|
+
<Text treatment='h5'>Moda Operandi</Text>
|
|
33
33
|
</States>
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
export const Complex = () => (
|
|
37
37
|
<Text>
|
|
38
|
-
<Text treatment=
|
|
38
|
+
<Text treatment='h6' color='fuchsia' family='serif'>
|
|
39
39
|
Moda Operandi
|
|
40
40
|
</Text>
|
|
41
41
|
{' — '}
|
|
42
|
-
<Text color=
|
|
43
|
-
Happy <Text color=
|
|
42
|
+
<Text color='money-good' treatment='eyebrow'>
|
|
43
|
+
Happy <Text color='code-red'>Holidays</Text>
|
|
44
44
|
</Text>
|
|
45
45
|
</Text>
|
|
46
46
|
);
|