@moda/om 16.2.0 → 16.2.1

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 (116) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/index.cjs.js +310 -278
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +309 -277
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/styles.css +1 -1
  7. package/package.json +18 -8
  8. package/src/components/AspectRatioBox/AspectRatioBox.tsx +4 -4
  9. package/src/components/AspectRatioBox/index.ts +1 -1
  10. package/src/components/Badge/Badge.stories.tsx +5 -5
  11. package/src/components/Badge/Badge.test.tsx +1 -1
  12. package/src/components/Breadcrumbs/Breadcrumb/Breadcrumb.tsx +6 -6
  13. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +6 -6
  14. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +2 -2
  15. package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  16. package/src/components/Breakpoint/Breakpoint.stories.tsx +10 -9
  17. package/src/components/Breakpoint/Breakpoint.test.tsx +2 -2
  18. package/src/components/Breakpoint/generateMediaQuery.ts +5 -4
  19. package/src/components/Button/Button.stories.tsx +4 -4
  20. package/src/components/Checkbox/Checkbox.stories.tsx +5 -5
  21. package/src/components/Checkbox/Checkbox.test.tsx +3 -3
  22. package/src/components/Checkbox/Checkbox.tsx +4 -4
  23. package/src/components/Clickable/Clickable.stories.tsx +3 -3
  24. package/src/components/ColorSwatch/ColorSwatch.stories.tsx +11 -11
  25. package/src/components/ColorSwatch/ColorSwatch.test.tsx +1 -1
  26. package/src/components/ColorSwatch/ColorSwatch.tsx +1 -1
  27. package/src/components/Constrain/Constrain.stories.tsx +1 -1
  28. package/src/components/Constrain/ExceedConstrain.stories.tsx +2 -2
  29. package/src/components/ControlLink/ControlLink.stories.tsx +1 -1
  30. package/src/components/ControlLink/index.ts +1 -1
  31. package/src/components/CreditCardNumberInput/CreditCardNumberInput.stories.tsx +1 -1
  32. package/src/components/CreditCardNumberInput/CreditCardNumberInput.test.tsx +4 -4
  33. package/src/components/CreditCardNumberInput/CreditCardNumberInput.tsx +1 -0
  34. package/src/components/DefinitionList/DefinitionList.stories.tsx +3 -3
  35. package/src/components/DefinitionList/DefinitionList.test.tsx +1 -1
  36. package/src/components/Divider/Divider.stories.tsx +4 -4
  37. package/src/components/Divider/Divider.test.tsx +1 -1
  38. package/src/components/Divider/Divider.tsx +1 -1
  39. package/src/components/Divider/NoLineDivider.tsx +1 -1
  40. package/src/components/Divider/TwoLineDivider.tsx +1 -1
  41. package/src/components/Expandable/Expandable.stories.tsx +8 -8
  42. package/src/components/Expandable/Expandable.test.tsx +1 -1
  43. package/src/components/Expandable/Expandable.tsx +3 -2
  44. package/src/components/Field/Field.stories.tsx +4 -4
  45. package/src/components/Field/Field.test.tsx +7 -7
  46. package/src/components/Field/Field.tsx +5 -5
  47. package/src/components/Field/index.ts +1 -0
  48. package/src/components/Loading/Loading.test.tsx +1 -1
  49. package/src/components/Loading/Loading.tsx +2 -1
  50. package/src/components/Modal/Modal.test.tsx +2 -2
  51. package/src/components/ModalOverlay/ModalOverlay.test.tsx +2 -2
  52. package/src/components/ModalOverlay/ModalOverlay.tsx +2 -2
  53. package/src/components/Overlay/Overlay.stories.tsx +1 -1
  54. package/src/components/Paginator/Paginator.tsx +3 -3
  55. package/src/components/PasswordInput/PasswordInput.stories.tsx +1 -1
  56. package/src/components/PasswordInput/PasswordInput.tsx +6 -6
  57. package/src/components/Popover/Popover.stories.tsx +1 -1
  58. package/src/components/Popover/Popover.tsx +10 -7
  59. package/src/components/PromoBanner/PromoBanner.stories.tsx +9 -9
  60. package/src/components/PromoBanner/PromoBanner.tsx +1 -1
  61. package/src/components/RadioButton/RadioButton.stories.tsx +2 -2
  62. package/src/components/RadioButton/RadioButton.tsx +4 -4
  63. package/src/components/SearchInput/SearchInput.stories.tsx +2 -2
  64. package/src/components/SearchInput/SearchInput.test.tsx +1 -1
  65. package/src/components/SearchInput/SearchInput.tsx +3 -3
  66. package/src/components/Select/MultiSelect.tsx +7 -7
  67. package/src/components/Select/Select.stories.tsx +15 -14
  68. package/src/components/Select/Select.test.tsx +13 -13
  69. package/src/components/Select/Select.tsx +7 -7
  70. package/src/components/Select/SelectOption.tsx +1 -1
  71. package/src/components/Select/SelectOptions.tsx +5 -5
  72. package/src/components/SelectableButton/SelectableButton.stories.tsx +1 -1
  73. package/src/components/Shape/ArcWindow.tsx +10 -10
  74. package/src/components/Shape/Bradley.tsx +4 -4
  75. package/src/components/Shape/Brancusi.tsx +4 -4
  76. package/src/components/Shape/Circle.tsx +10 -10
  77. package/src/components/Shape/Diamond.tsx +10 -10
  78. package/src/components/Shape/Keyhole.tsx +4 -4
  79. package/src/components/Shape/Mirror.tsx +4 -4
  80. package/src/components/Shape/Oval.tsx +4 -4
  81. package/src/components/Shape/Triangle.tsx +7 -7
  82. package/src/components/Shape/Window.tsx +4 -4
  83. package/src/components/Stack/Stack.stories.tsx +3 -3
  84. package/src/components/Stack/Stack.test.tsx +1 -1
  85. package/src/components/Tabs/TabList.tsx +1 -1
  86. package/src/components/Tabs/TabPanel.tsx +1 -1
  87. package/src/components/Tabs/TabPanels.tsx +1 -1
  88. package/src/components/Tabs/Tabs.stories.tsx +2 -2
  89. package/src/components/Tabs/Tabs.test.tsx +2 -2
  90. package/src/components/Tabs/Tabs.tsx +7 -1
  91. package/src/components/Tag/Tag.tsx +6 -5
  92. package/src/components/Text/Text.stories.tsx +5 -5
  93. package/src/components/Text/Text.test.tsx +1 -1
  94. package/src/components/TextInput/TextInput.stories.tsx +1 -1
  95. package/src/components/TextInput/TextInput.test.tsx +1 -1
  96. package/src/components/Textarea/Textarea.stories.tsx +1 -1
  97. package/src/components/Textarea/Textarea.test.tsx +3 -3
  98. package/src/components/Toast/Toast.stories.tsx +1 -1
  99. package/src/components/Toast/Toast.test.tsx +1 -1
  100. package/src/components/Toast/Toast.tsx +6 -6
  101. package/src/components/VerticalDivider/VerticalDivider.stories.tsx +3 -3
  102. package/src/components/VerticalDivider/VerticalDivider.test.tsx +2 -2
  103. package/src/hooks/useKeyboardListNavigation.spec.ts +2 -1
  104. package/src/hooks/useKeyboardListNavigation.ts +2 -0
  105. package/src/hooks/useUpdateEffect.ts +1 -0
  106. package/src/index.ts +2 -2
  107. package/src/mixins/font-smoothing/font-smoothing.stories.tsx +8 -8
  108. package/src/mixins/overflow-scroll/overflow-scroll.stories.tsx +2 -2
  109. package/src/mixins/stack/stack.stories.tsx +5 -6
  110. package/src/mixins/thin-underline/thin-underline.stories.tsx +1 -1
  111. package/src/mixins/visually-hidden/visually-hidden.stories.tsx +1 -1
  112. package/src/utilities/States/State.tsx +3 -2
  113. package/src/utilities/States/States.tsx +4 -3
  114. package/src/utilities/States/StatesProps.tsx +5 -2
  115. package/src/utilities/States/isRenderProps.ts +1 -0
  116. package/src/utilities/States/stringifyProps.tsx +1 -0
@@ -15,23 +15,23 @@ export const PasswordInput = forwardRef(
15
15
  };
16
16
 
17
17
  return (
18
- <div className='PasswordInput'>
18
+ <div className="PasswordInput">
19
19
  <Input
20
- className='PasswordInput__editor'
20
+ className="PasswordInput__editor"
21
21
  ref={ref}
22
22
  type={passwordShown ? 'text' : 'password'}
23
23
  {...rest}
24
24
  />
25
25
 
26
26
  <Clickable
27
- className='PasswordInput__password-action'
27
+ className="PasswordInput__password-action"
28
28
  onClick={togglePasswordVisiblity}
29
- type='button'
29
+ type="button"
30
30
  >
31
31
  {passwordShown ? (
32
- <Text treatment='eyebrow'>HIDE</Text>
32
+ <Text treatment="eyebrow">HIDE</Text>
33
33
  ) : (
34
- <Text treatment='eyebrow'>SHOW</Text>
34
+ <Text treatment="eyebrow">SHOW</Text>
35
35
  )}
36
36
  </Clickable>
37
37
  </div>
@@ -33,7 +33,7 @@ export const Default = () => (
33
33
  >
34
34
  <Popover content={Content} style={{ display: 'inline-block' }}>
35
35
  <Text>
36
- <ControlLink href='https://www.modaoperandi.com/women'>Hover on Link</ControlLink>
36
+ <ControlLink href="https://www.modaoperandi.com/women">Hover on Link</ControlLink>
37
37
  </Text>
38
38
  </Popover>
39
39
  </States>
@@ -13,6 +13,9 @@ export type PopoverProps = React.HTMLAttributes<HTMLDivElement> & {
13
13
  };
14
14
 
15
15
  export const POPOVER_MOUSEOUT_DELAY_MS = 200;
16
+ const THREE_QUARTER_SECOND_DELAY = 750;
17
+ const ONE_SECOND_DELAY = 1000;
18
+ const FIVE_SECOND_DELAY = 5000;
16
19
 
17
20
  enum Mode {
18
21
  Opening = 'opening',
@@ -80,7 +83,7 @@ export const Popover: React.FC<PopoverProps> = ({
80
83
  useEffect(() => {
81
84
  if (mode !== Mode.Closing) return;
82
85
 
83
- const closingTimeout = setTimeout(() => setMode(Mode.Closed), 750);
86
+ const closingTimeout = setTimeout(() => setMode(Mode.Closed), THREE_QUARTER_SECOND_DELAY);
84
87
 
85
88
  return () => clearTimeout(closingTimeout);
86
89
  }, [mode]);
@@ -88,7 +91,7 @@ export const Popover: React.FC<PopoverProps> = ({
88
91
  useEffect(() => {
89
92
  if (mode !== Mode.AutoOpening) return;
90
93
 
91
- const openingTimeout = setTimeout(() => setMode(Mode.AutoOpen), 1000);
94
+ const openingTimeout = setTimeout(() => setMode(Mode.AutoOpen), ONE_SECOND_DELAY);
92
95
 
93
96
  return () => clearTimeout(openingTimeout);
94
97
  }, [mode]);
@@ -96,7 +99,7 @@ export const Popover: React.FC<PopoverProps> = ({
96
99
  useEffect(() => {
97
100
  if (mode !== Mode.Opening) return;
98
101
 
99
- const openingTimeout = setTimeout(() => setMode(Mode.Open), 750);
102
+ const openingTimeout = setTimeout(() => setMode(Mode.Open), THREE_QUARTER_SECOND_DELAY);
100
103
 
101
104
  return () => clearTimeout(openingTimeout);
102
105
  }, [mode]);
@@ -104,7 +107,7 @@ export const Popover: React.FC<PopoverProps> = ({
104
107
  useEffect(() => {
105
108
  if (mode !== Mode.AutoOpen) return;
106
109
 
107
- const stayingTimeout = setTimeout(handleClose, 5000);
110
+ const stayingTimeout = setTimeout(handleClose, FIVE_SECOND_DELAY);
108
111
 
109
112
  return () => clearTimeout(stayingTimeout);
110
113
  }, [handleClose, mode, smoothTransitioning]);
@@ -125,7 +128,7 @@ export const Popover: React.FC<PopoverProps> = ({
125
128
  onMouseLeave={handleMouseLeave}
126
129
  {...rest}
127
130
  >
128
- <span className='Popover__trigger'>
131
+ <span className="Popover__trigger">
129
132
  {isOpen && (
130
133
  <div
131
134
  className={classNames('Popover__box', {
@@ -134,11 +137,11 @@ export const Popover: React.FC<PopoverProps> = ({
134
137
  })}
135
138
  >
136
139
  <div
137
- className='Popover__caret'
140
+ className="Popover__caret"
138
141
  style={{ zIndex: zIndex != null ? zIndex + 1 : undefined }}
139
142
  />
140
143
 
141
- <div className='Popover__content' style={{ zIndex }}>
144
+ <div className="Popover__content" style={{ zIndex }}>
142
145
  {content}
143
146
  </div>
144
147
  </div>
@@ -9,22 +9,22 @@ export const Default = () => (
9
9
  states={[
10
10
  { children: <span>Center</span> },
11
11
  {
12
- children: [<span key='left'>Left</span>, <span key='right'>Right</span>]
12
+ children: [<span key="left">Left</span>, <span key="right">Right</span>]
13
13
  },
14
14
  {
15
15
  children: [
16
- <span key='left'>Left</span>,
17
- <span key='center'>Center</span>,
18
- <span key='right'>Right</span>
16
+ <span key="left">Left</span>,
17
+ <span key="center">Center</span>,
18
+ <span key="right">Right</span>
19
19
  ]
20
20
  },
21
21
  {
22
22
  children: [
23
- <span key='left'>Currency: USA (USD $)</span>,
24
- <span key='center' className='FOO'>
25
- Order by Dec. 12 for delivery by Dec. 25 — <a href='#'>LEARN MORE</a>
23
+ <span key="left">Currency: USA (USD $)</span>,
24
+ <span key="center" className="FOO">
25
+ Order by Dec. 12 for delivery by Dec. 25 — <a href="#">LEARN MORE</a>
26
26
  </span>,
27
- <span key='right'>Hi, Friend</span>
27
+ <span key="right">Hi, Friend</span>
28
28
  ]
29
29
  }
30
30
  ]}
@@ -38,7 +38,7 @@ export const Mobile = () => (
38
38
  <PromoBanner>
39
39
  <span>Currency: USA (USD $)</span>
40
40
  <span>
41
- Order by Dec. 12 for delivery by Dec. 25 — <a href='#'>LEARN MORE</a>
41
+ Order by Dec. 12 for delivery by Dec. 25 — <a href="#">LEARN MORE</a>
42
42
  </span>
43
43
  <span>Hi, Friend</span>
44
44
  </PromoBanner>
@@ -11,7 +11,7 @@ export const PromoBanner: React.FC<PromoBannerProps> = ({ className, children, .
11
11
  const length = Children.count(children);
12
12
  return (
13
13
  <div className={classNames('PromoBanner', className)} {...rest}>
14
- <Constrain className='PromoBanner__constrain'>
14
+ <Constrain className="PromoBanner__constrain">
15
15
  {Children.map(children, (child: JSX.Element, index) => {
16
16
  const isCenter = length % 2 !== 0 && Math.floor(length / 2) === index;
17
17
  return cloneElement(child, {
@@ -1,8 +1,8 @@
1
1
  import React, { useState } from 'react';
2
2
  import { States } from 'storybook-states';
3
3
  import { Text } from '../Text';
4
- import { RadioButton, RadioButtonProps } from './RadioButton';
5
4
  import { Stack } from '../Stack';
5
+ import { RadioButton, RadioButtonProps } from './RadioButton';
6
6
 
7
7
  export default { title: 'Components/RadioButton' };
8
8
 
@@ -29,7 +29,7 @@ export const Select = () => {
29
29
  return (
30
30
  <States>
31
31
  <Stack space={3}>
32
- <Text color='burnt-orange'>{selected}</Text>
32
+ <Text color="burnt-orange">{selected}</Text>
33
33
 
34
34
  {EXAMPLES.map(value => (
35
35
  <RadioButton
@@ -36,16 +36,16 @@ export const RadioButton: React.FC<RadioButtonProps> = ({
36
36
  <input
37
37
  ref={inputRef}
38
38
  tabIndex={-1}
39
- className='RadioButton__input'
40
- type='radio'
41
- role='radio'
39
+ className="RadioButton__input"
40
+ type="radio"
41
+ role="radio"
42
42
  checked={checked}
43
43
  value={value}
44
44
  disabled={disabled}
45
45
  {...rest}
46
46
  />
47
47
  {children && (
48
- <span className='RadioButton__label' tabIndex={-1}>
48
+ <span className="RadioButton__label" tabIndex={-1}>
49
49
  {children}
50
50
  </span>
51
51
  )}
@@ -9,7 +9,7 @@ export default { title: 'Components/SearchInput' };
9
9
  export const Default = () => (
10
10
  <States<SearchInputProps> states={[{}, { value: 'prada' }, { autoFocus: true }]}>
11
11
  <SearchInput
12
- placeholder='Search'
12
+ placeholder="Search"
13
13
  onChange={action('onChange')}
14
14
  onChangeValue={action('onChangeValue')}
15
15
  />
@@ -34,7 +34,7 @@ export const DropdownExample = () => {
34
34
 
35
35
  return (
36
36
  <div style={{ display: 'flex', flexDirection: 'column' }}>
37
- <SearchInput placeholder='Search' onChangeValue={setQuery} value={query} autoFocus />
37
+ <SearchInput placeholder="Search" onChangeValue={setQuery} value={query} autoFocus />
38
38
 
39
39
  {query && (
40
40
  <Text style={{ border: '1px solid gray', marginTop: '-1px', padding: '1rem' }}>
@@ -6,7 +6,7 @@ import { SearchInput } from './SearchInput';
6
6
 
7
7
  describe('SearchInput', () => {
8
8
  it('clears the input when the button is clicked', async () => {
9
- render(<SearchInput value='Hello' />);
9
+ render(<SearchInput value="Hello" />);
10
10
 
11
11
  expect(screen.getByRole('textbox')).toHaveValue('Hello');
12
12
 
@@ -50,12 +50,12 @@ export const SearchInput: React.FC<SearchInputProps> = ({
50
50
 
51
51
  return (
52
52
  <div className={classNames('SearchInput', className)}>
53
- <div className='SearchInput__icon'>
53
+ <div className="SearchInput__icon">
54
54
  <SearchIcon />
55
55
  </div>
56
56
 
57
57
  <TextInput
58
- className='SearchInput__input'
58
+ className="SearchInput__input"
59
59
  onChange={handleChange}
60
60
  value={controlledValue}
61
61
  ref={ref}
@@ -63,7 +63,7 @@ export const SearchInput: React.FC<SearchInputProps> = ({
63
63
  />
64
64
 
65
65
  {controlledValue && (
66
- <Clickable className='SearchInput__clear' onClick={handleClick} type='reset'>
66
+ <Clickable className="SearchInput__clear" onClick={handleClick} type="reset">
67
67
  <ExitIcon />
68
68
  </Clickable>
69
69
  )}
@@ -4,11 +4,11 @@ import { uniq } from 'ramda';
4
4
  import ChevronDownIcon from '@moda/icons/chevron-down-12';
5
5
  import ChevronUpIcon from '@moda/icons/chevron-up-12';
6
6
  import ExitIcon from '@moda/icons/exit-16';
7
- import { SelectableOption } from '.';
7
+ import { Clickable } from '../Clickable';
8
8
  import { SelectOptions } from './SelectOptions';
9
9
  import { useSelect } from './useSelect';
10
+ import { SelectableOption } from '.';
10
11
  import './MultiSelect.scss';
11
- import { Clickable } from '../Clickable';
12
12
 
13
13
  type Props = Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'value' | 'onChange'> & {
14
14
  defaultValue?: string[] | undefined;
@@ -85,16 +85,16 @@ export const MultiSelect: React.FC<Props> = ({
85
85
  ref={selectRef}
86
86
  {...rest}
87
87
  >
88
- <Clickable className='MultiSelect__search' disabled={disabled} onClick={handleToggle}>
89
- <div className='MultiSelect__selected-items'>
88
+ <Clickable className="MultiSelect__search" disabled={disabled} onClick={handleToggle}>
89
+ <div className="MultiSelect__selected-items">
90
90
  {values.map((value, index) => (
91
- <span className='MultiSelect__selected-item' key={index}>
92
- <span className='MultiSelect__selected-value'>
91
+ <span className="MultiSelect__selected-item" key={index}>
92
+ <span className="MultiSelect__selected-value">
93
93
  {options.find(option => option.value === value)?.label || value}
94
94
  </span>
95
95
  <ExitIcon
96
96
  style={{ width: '8px', height: '8px', position: 'relative' }}
97
- className='MultiSelect__exit'
97
+ className="MultiSelect__exit"
98
98
  onClick={() => handleRemove(value)}
99
99
  />
100
100
  </span>
@@ -1,10 +1,10 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { action } from '@storybook/addon-actions';
3
3
  import { States } from 'storybook-states';
4
+ import { useCallback } from 'react';
5
+ import { Input } from '../Field';
4
6
  import { Select, SelectProps } from './Select';
5
7
  import { MultiSelect } from './MultiSelect';
6
- import { Input } from '../Field';
7
- import { useCallback } from 'react';
8
8
 
9
9
  export default { title: 'Components/Select' };
10
10
 
@@ -38,7 +38,7 @@ export const Default = () => (
38
38
  { idRef: '7', label: undefined, placeholder: 'Placeholder' }
39
39
  ]}
40
40
  >
41
- <Select label='Sort by' options={OPTIONS} onChange={action('onChange')} />
41
+ <Select label="Sort by" options={OPTIONS} onChange={action('onChange')} />
42
42
  </States>
43
43
  );
44
44
 
@@ -47,15 +47,16 @@ export const ChangingValue = () => {
47
47
 
48
48
  const values = OPTIONS.map(({ value }) => value);
49
49
  const value = values[cursor % values.length];
50
+ const HALF_SECOND_INTERVAL = 500;
50
51
 
51
52
  useEffect(() => {
52
53
  const interval = setInterval(() => {
53
54
  setCursor(prevCursor => prevCursor + 1);
54
- }, 500);
55
+ }, HALF_SECOND_INTERVAL);
55
56
  return () => clearInterval(interval);
56
57
  }, []);
57
58
 
58
- return <Select label='Sort by' options={OPTIONS} onChange={action('onChange')} value={value} />;
59
+ return <Select label="Sort by" options={OPTIONS} onChange={action('onChange')} value={value} />;
59
60
  };
60
61
 
61
62
  const COUNTRIES = [
@@ -259,16 +260,16 @@ const COUNTRIES = [
259
260
 
260
261
  export const Long = () => (
261
262
  <Select
262
- label='Choose country'
263
+ label="Choose country"
263
264
  options={COUNTRIES.map(country => ({ label: country, value: country }))}
264
265
  />
265
266
  );
266
267
 
267
268
  export const AutoFill = () => (
268
269
  <>
269
- <Input label='Address*' name='addressLine1' />
270
- <Input label='City' name='city' />
271
- <Input label='Choose country' name='country'>
270
+ <Input label="Address*" name="addressLine1" />
271
+ <Input label="City" name="city" />
272
+ <Input label="Choose country" name="country">
272
273
  <Select
273
274
  options={COUNTRIES.map(country => ({ label: country, value: country }))}
274
275
  allowAutoFill
@@ -279,7 +280,7 @@ export const AutoFill = () => (
279
280
 
280
281
  export const InsideInputComponent = () => (
281
282
  <Input error>
282
- <Select options={OPTIONS}></Select>
283
+ <Select options={OPTIONS} />
283
284
  </Input>
284
285
  );
285
286
 
@@ -312,7 +313,7 @@ export const MultiSelectWithDefaultsComponent = () => {
312
313
  <MultiSelect
313
314
  onChange={handleSetItems}
314
315
  value={selectedItems}
315
- placeholder='United States'
316
+ placeholder="United States"
316
317
  defaultValue={['Canada', 'Albania', 'Greece']}
317
318
  options={COUNTRIES.map(country => ({ label: country, value: country }))}
318
319
  />
@@ -322,7 +323,7 @@ export const MultiSelectWithDefaultsComponent = () => {
322
323
  export const MultiSelectUncontrolledComponent = () => {
323
324
  return (
324
325
  <MultiSelect
325
- placeholder='United States'
326
+ placeholder="United States"
326
327
  defaultValue={['Canada', 'Albania', 'Greece']}
327
328
  options={COUNTRIES.map(country => ({ label: country, value: country }))}
328
329
  />
@@ -332,8 +333,8 @@ export const MultiSelectUncontrolledComponent = () => {
332
333
  export const MultiSelectUncontrolledSearchComponent = () => {
333
334
  return (
334
335
  <MultiSelect
335
- searchable={true}
336
- placeholder='United States'
336
+ searchable
337
+ placeholder="United States"
337
338
  defaultValue={['Canada', 'Albania', 'Greece']}
338
339
  options={COUNTRIES.map(country => ({ label: country, value: country }))}
339
340
  />
@@ -13,7 +13,7 @@ describe('Select', () => {
13
13
 
14
14
  it('renders correctly', () => {
15
15
  const { container } = render(
16
- <Select idRef='1' name='name-1' label='Sort by' options={options} />
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='1' name='name-1' label='Sort by' options={options} />
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='1'
40
- name='name-1'
41
- label='Sort by'
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='1'
58
- label='Sort by'
59
- name='name-1'
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='1'
77
- label='Sort by'
78
- name='name-1'
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='1' name='name-1' label='Sort by' options={options} />
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='1' name='name-1' options={options} />);
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');
@@ -103,19 +103,19 @@ export const Select: React.FC<SelectProps> = ({
103
103
  {...rest}
104
104
  >
105
105
  {!allowAutoFill && name && (
106
- <input id={idRef} name={name} type='hidden' value={state.value} />
106
+ <input id={idRef} name={name} type="hidden" value={state.value} />
107
107
  )}
108
108
 
109
109
  <Clickable
110
110
  id={`Select__value--${idRef}`}
111
- className='Select__value'
111
+ className="Select__value"
112
112
  disabled={disabled}
113
113
  onClick={handleToggle}
114
- aria-haspopup='listbox'
114
+ aria-haspopup="listbox"
115
115
  aria-expanded={state.mode === Mode.Open}
116
116
  aria-labelledby={`Select__label--${idRef} Select__value--${idRef}`}
117
- type='button'
118
- title='Select'
117
+ type="button"
118
+ title="Select"
119
119
  >
120
120
  <SelectLabel
121
121
  idRef={idRef}
@@ -150,11 +150,11 @@ export const Select: React.FC<SelectProps> = ({
150
150
 
151
151
  {allowAutoFill && (
152
152
  <input
153
- className='Select__hidden-field'
153
+ className="Select__hidden-field"
154
154
  name={name}
155
155
  onChange={({ target }) => handleAutofill(target.value)}
156
156
  value={value}
157
- aria-hidden='true'
157
+ aria-hidden="true"
158
158
  tabIndex={-1}
159
159
  />
160
160
  )}
@@ -45,7 +45,7 @@ export const SelectOption: React.FC<SelectOptionProps> = ({
45
45
  onClick={handleClick}
46
46
  aria-label={option.label}
47
47
  aria-selected={selected}
48
- role='option'
48
+ role="option"
49
49
  >
50
50
  {option.label}
51
51
  </li>
@@ -61,17 +61,17 @@ export const SelectOptions: React.FC<SelectOptionsProps> = ({
61
61
  <div className={classNames('SelectOptions', className)}>
62
62
  {searchable && (
63
63
  <SearchInput
64
- className='SelectOptions__search'
65
- placeholder='Search'
64
+ className="SelectOptions__search"
65
+ placeholder="Search"
66
66
  value={searchPhrase}
67
67
  onChange={setSearchPhrase}
68
68
  onClear={() => setSearchPhrase('')}
69
69
  />
70
70
  )}
71
71
  <ul
72
- className='SelectOptions__list'
72
+ className="SelectOptions__list"
73
73
  tabIndex={-1}
74
- role='listbox'
74
+ role="listbox"
75
75
  ref={ref}
76
76
  aria-labelledby={`Select__label--${idRef}`}
77
77
  aria-activedescendant={`SelectOption--${activeOption?.value}-${idRef}`}
@@ -91,7 +91,7 @@ export const SelectOptions: React.FC<SelectOptionsProps> = ({
91
91
  ))}
92
92
  </ul>
93
93
  {options.length === 0 && (
94
- <Text className='SelectOptions__none' color='cement'>
94
+ <Text className="SelectOptions__none" color="cement">
95
95
  Nothing found
96
96
  </Text>
97
97
  )}
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import { action } from '@storybook/addon-actions';
3
3
 
4
4
  import { States } from 'storybook-states';
5
- import { SelectableButton, SelectableButtonProps } from './SelectableButton';
6
5
  import { Stack } from '../Stack';
6
+ import { SelectableButton, SelectableButtonProps } from './SelectableButton';
7
7
 
8
8
  export default { title: 'Components/SelectableButton' };
9
9
 
@@ -3,18 +3,18 @@ import { ShapeProps } from './Shape';
3
3
 
4
4
  export const ArcWindow: React.FC<ShapeProps> = () => (
5
5
  <svg
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'
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='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'
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
  );
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ShapeProps } from './Shape';
3
3
 
4
- export const Bradley: React.FC<ShapeProps> = (props) => (
4
+ export const Bradley: React.FC<ShapeProps> = props => (
5
5
  <svg
6
6
  style={{ fill: 'currentcolor' }}
7
- xmlns='http://www.w3.org/2000/svg'
8
- viewBox='0 0 110 211'
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 110 211"
9
9
  {...props}
10
10
  >
11
- <path d='M110 .336H0v210h45.11v-52.595h19.78v52.595H110V105.147z' />
11
+ <path d="M110 .336H0v210h45.11v-52.595h19.78v52.595H110V105.147z" />
12
12
  </svg>
13
13
  );
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ShapeProps } from './Shape';
3
3
 
4
- export const Brancusi: React.FC<ShapeProps> = (props) => (
4
+ export const Brancusi: React.FC<ShapeProps> = props => (
5
5
  <svg
6
6
  style={{ fill: 'currentcolor' }}
7
- xmlns='http://www.w3.org/2000/svg'
8
- viewBox='0 0 111 210'
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ viewBox="0 0 111 210"
9
9
  {...props}
10
10
  >
11
- <path d='M110.575 210l-27.5-105 27.5-105h-110l27.501 105L.575 210z' />
11
+ <path d="M110.575 210l-27.5-105 27.5-105h-110l27.501 105L.575 210z" />
12
12
  </svg>
13
13
  );