@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
|
@@ -5,7 +5,7 @@ import { TextInput } from './TextInput';
|
|
|
5
5
|
|
|
6
6
|
describe('TextInput', () => {
|
|
7
7
|
it('renders correctly', () => {
|
|
8
|
-
render(<TextInput placeholder=
|
|
8
|
+
render(<TextInput placeholder='Hello' />);
|
|
9
9
|
expect(screen.getByRole('textbox')).toHaveValue('');
|
|
10
10
|
expect(screen.getByRole('textbox')).toHaveAttribute('placeholder', 'Hello');
|
|
11
11
|
});
|
|
@@ -5,14 +5,14 @@ import { Textarea } from './Textarea';
|
|
|
5
5
|
|
|
6
6
|
describe('Textarea', () => {
|
|
7
7
|
it('renders correctly', () => {
|
|
8
|
-
render(<Textarea placeholder=
|
|
8
|
+
render(<Textarea placeholder='Placeholder' defaultValue='Hello' />);
|
|
9
9
|
|
|
10
10
|
expect(screen.getByRole('textbox')).toHaveValue('Hello');
|
|
11
11
|
expect(screen.getByRole('textbox')).toHaveAttribute('placeholder', 'Placeholder');
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
it('renders with an error', () => {
|
|
15
|
-
render(<Textarea placeholder=
|
|
15
|
+
render(<Textarea placeholder='Placeholder' defaultValue='Hello' label='Label' error='Error' />);
|
|
16
16
|
|
|
17
17
|
expect(screen.getByRole('textbox')).toHaveValue('Hello');
|
|
18
18
|
expect(screen.getByRole('textbox')).toHaveClass('Textarea--error');
|
|
@@ -20,7 +20,7 @@ describe('Textarea', () => {
|
|
|
20
20
|
|
|
21
21
|
it('renders with a className', () => {
|
|
22
22
|
render(
|
|
23
|
-
<Textarea className=
|
|
23
|
+
<Textarea className='Custom' placeholder='Placeholder' defaultValue='Hello' label='Label' />
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
expect(screen.getByRole('textbox')).toHaveValue('Hello');
|
|
@@ -7,7 +7,7 @@ export default { title: 'Components/Toast' };
|
|
|
7
7
|
|
|
8
8
|
export const Default = () => (
|
|
9
9
|
<States<ToastProps> states={[{ theme: 'success' }, { theme: 'warning' }, { theme: 'error' }]}>
|
|
10
|
-
<Toast theme=
|
|
10
|
+
<Toast theme='success' onRemove={() => action('removed')}>
|
|
11
11
|
This is a toast notification.
|
|
12
12
|
</Toast>
|
|
13
13
|
</States>
|
|
@@ -14,17 +14,17 @@ export type ToastProps = {
|
|
|
14
14
|
export const Toast: React.FC<ToastProps> = ({ theme, className, onRemove, children, ...rest }) => (
|
|
15
15
|
<Stack
|
|
16
16
|
className={classNames('Toast', `Toast--${theme}`, className)}
|
|
17
|
-
direction=
|
|
17
|
+
direction='horizontal'
|
|
18
18
|
space={2}
|
|
19
|
-
alignItems=
|
|
20
|
-
justifyContent=
|
|
19
|
+
alignItems='center'
|
|
20
|
+
justifyContent='space-between'
|
|
21
21
|
{...rest}
|
|
22
22
|
>
|
|
23
|
-
<Text treatment=
|
|
23
|
+
<Text treatment='bold1' color='snow'>
|
|
24
24
|
{children}
|
|
25
25
|
</Text>
|
|
26
26
|
{onRemove && (
|
|
27
|
-
<Clickable aria-label=
|
|
27
|
+
<Clickable aria-label='Remove' onClick={onRemove}>
|
|
28
28
|
<ExitIcon />
|
|
29
29
|
</Clickable>
|
|
30
30
|
)}
|
|
@@ -8,7 +8,7 @@ export default { title: 'Components/VerticalDivider' };
|
|
|
8
8
|
|
|
9
9
|
export const Default = () => (
|
|
10
10
|
<States>
|
|
11
|
-
<Stack direction=
|
|
11
|
+
<Stack direction='horizontal' space={4}>
|
|
12
12
|
<div> Lorem ipsum dolor sit amet</div>
|
|
13
13
|
|
|
14
14
|
<VerticalDivider />
|
|
@@ -20,7 +20,7 @@ export const Default = () => (
|
|
|
20
20
|
|
|
21
21
|
export const Double = () => (
|
|
22
22
|
<States>
|
|
23
|
-
<Stack direction=
|
|
23
|
+
<Stack direction='horizontal' space={4}>
|
|
24
24
|
<div> Lorem ipsum dolor sit amet</div>
|
|
25
25
|
|
|
26
26
|
<VerticalDivider double />
|
|
@@ -5,13 +5,13 @@ import { VerticalDivider } from './VerticalDivider';
|
|
|
5
5
|
|
|
6
6
|
describe('VerticalDivider', () => {
|
|
7
7
|
it('renders correctly', () => {
|
|
8
|
-
render(<VerticalDivider aria-label=
|
|
8
|
+
render(<VerticalDivider aria-label='Divider' />);
|
|
9
9
|
|
|
10
10
|
expect(screen.getByLabelText('Divider')).toBeVisible();
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
it('renders correctly - double', () => {
|
|
14
|
-
render(<VerticalDivider aria-label=
|
|
14
|
+
render(<VerticalDivider aria-label='Divider' double />);
|
|
15
15
|
|
|
16
16
|
expect(screen.getByLabelText('Divider')).toBeVisible();
|
|
17
17
|
expect(screen.getByLabelText('Divider')).toHaveClass('VerticalDivider--double');
|
|
@@ -9,22 +9,22 @@ export default { title: 'Mixins/font-smoothing' };
|
|
|
9
9
|
|
|
10
10
|
export const Default = () => (
|
|
11
11
|
<Stack space={3}>
|
|
12
|
-
<div className=
|
|
13
|
-
<Text treatment=
|
|
12
|
+
<div className='Story Mixins font-smoothing--antialiased'>
|
|
13
|
+
<Text treatment='eyebrow'>@include font-smoothing(antialiased);</Text>
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
|
-
<div className=
|
|
17
|
-
<Text treatment=
|
|
16
|
+
<div className='Story Mixins font-smoothing--subpixel'>
|
|
17
|
+
<Text treatment='eyebrow'>@include font-smoothing(subpixel);</Text>
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
<div className=
|
|
21
|
-
<Text color=
|
|
20
|
+
<div className='Story Mixins font-smoothing--antialiased' style={{ backgroundColor: 'black' }}>
|
|
21
|
+
<Text color='snow' treatment='eyebrow'>
|
|
22
22
|
@include font-smoothing(antialiased);
|
|
23
23
|
</Text>
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
|
-
<div className=
|
|
27
|
-
<Text color=
|
|
26
|
+
<div className='Story Mixins font-smoothing--subpixel' style={{ backgroundColor: 'black' }}>
|
|
27
|
+
<Text color='snow' treatment='eyebrow'>
|
|
28
28
|
@include font-smoothing(subpixel);
|
|
29
29
|
</Text>
|
|
30
30
|
</div>
|
|
@@ -5,9 +5,9 @@ import './overflow-scroll.stories.scss';
|
|
|
5
5
|
export default { title: 'Mixins/overflow-scroll' };
|
|
6
6
|
|
|
7
7
|
export const Default = () => (
|
|
8
|
-
<div className=
|
|
8
|
+
<div className='Story Mixins overflow-scroll'>Overflowed on the y axis!</div>
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
export const OverflowX = () => (
|
|
12
|
-
<div className=
|
|
12
|
+
<div className='Story Mixins overflow-scroll-x'>Overflowed on the x axis!</div>
|
|
13
13
|
);
|
|
@@ -7,7 +7,7 @@ import './stack.stories.scss';
|
|
|
7
7
|
export default { title: 'Mixins/stack' };
|
|
8
8
|
|
|
9
9
|
export const Default = () => (
|
|
10
|
-
<div className=
|
|
10
|
+
<div className='Story Mixins stack'>
|
|
11
11
|
<p>Defaults to $space: 4 === {space.scale[4]}</p>
|
|
12
12
|
|
|
13
13
|
<span>Notice the different element tags</span>
|
|
@@ -17,7 +17,7 @@ export const Default = () => (
|
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
export const Horizontal = () => (
|
|
20
|
-
<div className=
|
|
20
|
+
<div className='Story Mixins stack stack--horizontal'>
|
|
21
21
|
<p>Accepts $direction: horizontal</p>
|
|
22
22
|
|
|
23
23
|
<span>Notice the different element tags</span>
|
|
@@ -4,4 +4,4 @@ import './thin-underline.stories.scss';
|
|
|
4
4
|
|
|
5
5
|
export default { title: 'Mixins/thin-underline' };
|
|
6
6
|
|
|
7
|
-
export const Default = () => <div className=
|
|
7
|
+
export const Default = () => <div className='Story Mixins thin-underline'>Hello</div>;
|
|
@@ -4,4 +4,4 @@ import './visually-hidden.stories.scss';
|
|
|
4
4
|
|
|
5
5
|
export default { title: 'Mixins/visually-hidden' };
|
|
6
6
|
|
|
7
|
-
export const Default = () => <div className=
|
|
7
|
+
export const Default = () => <div className='Story Mixins visually-hidden'>Hello</div>;
|
|
@@ -14,10 +14,10 @@ export const State: React.FC<Props> = ({ props, children, ...rest }) => {
|
|
|
14
14
|
const innerChildren = isRenderProps(children) ? children(props) : children;
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
<div className=
|
|
17
|
+
<div className='State' {...rest}>
|
|
18
18
|
{Specimen}
|
|
19
19
|
|
|
20
|
-
<code className=
|
|
20
|
+
<code className='State__props'>
|
|
21
21
|
<StatesProps props={props}>{innerChildren}</StatesProps>
|
|
22
22
|
</code>
|
|
23
23
|
</div>
|
|
@@ -11,7 +11,7 @@ export interface Props {
|
|
|
11
11
|
|
|
12
12
|
export const States: React.FC<Props> = ({ states = [{}], children, ...rest }) => {
|
|
13
13
|
return (
|
|
14
|
-
<div className=
|
|
14
|
+
<div className='States'>
|
|
15
15
|
{states.map((props, index) => (
|
|
16
16
|
<State key={index} props={props} {...rest}>
|
|
17
17
|
{children}
|
|
@@ -19,7 +19,7 @@ export const StatesProps: React.FC<Props> = ({ props, children }) => {
|
|
|
19
19
|
const childrenProps = omit(children.props, ...Object.keys(props || {}));
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
<Stack className=
|
|
22
|
+
<Stack className='StatesProps' space={2} direction='horizontal'>
|
|
23
23
|
<span>{children.type.displayName || children.type.name}</span>
|
|
24
24
|
{!isEmpty(props) && <strong>{stringifyProps(props)}</strong>}
|
|
25
25
|
{!isRenderProps(children) && !isEmpty(childrenProps) && (
|