@loadsmart/loadsmart-ui 5.10.1 → 5.11.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.
- package/dist/components/Calendar/Calendar.stories.d.ts +2 -7
- package/dist/components/Calendar/Date.helper.d.ts +47 -12
- package/dist/components/Dropdown/Dropdown.stories.d.ts +4 -1
- package/dist/components/Loaders/LoadingBar.stories.d.ts +1 -1
- package/dist/index.js +445 -295
- package/dist/index.js.map +1 -1
- package/dist/testing/SelectEvent/SelectEvent.d.ts +2 -0
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/tests/generator.d.ts +35 -0
- package/dist/tests/renderer.d.ts +10 -0
- package/package.json +8 -7
- package/src/common/CloseButton/CloseButton.tsx +11 -7
- package/src/common/SelectionWrapper.tsx +7 -7
- package/src/components/Accordion/Accordion.stories.tsx +1 -1
- package/src/components/Accordion/Accordion.test.tsx +2 -2
- package/src/components/Accordion/Accordion.tsx +28 -22
- package/src/components/Banner/Banner.test.tsx +2 -2
- package/src/components/Banner/Banner.tsx +2 -2
- package/src/components/Breadcrumbs/Breadbrumbs.test.tsx +2 -2
- package/src/components/Breadcrumbs/Breadcrumb.tsx +3 -2
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/components/Button/Button.test.tsx +2 -2
- package/src/components/Button/Button.tsx +20 -17
- package/src/components/Calendar/Calendar.stories.tsx +4 -2
- package/src/components/Calendar/Calendar.test.tsx +3 -3
- package/src/components/Calendar/Calendar.tsx +8 -4
- package/src/components/Calendar/Date.helper.test.ts +463 -15
- package/src/components/Calendar/Date.helper.ts +106 -45
- package/src/components/Calendar/PickerModeToggle.tsx +6 -3
- package/src/components/Calendar/Pickers/DayPicker.test.tsx +2 -2
- package/src/components/Calendar/Pickers/DayPicker.tsx +1 -1
- package/src/components/Calendar/Pickers/MonthPicker.test.tsx +2 -2
- package/src/components/Calendar/Pickers/MonthPicker.tsx +1 -1
- package/src/components/Calendar/Pickers/PickerButton.tsx +39 -29
- package/src/components/Calendar/Pickers/YearPicker.test.tsx +9 -7
- package/src/components/Calendar/Pickers/YearPicker.tsx +1 -1
- package/src/components/Card/Card.stories.tsx +1 -1
- package/src/components/Card/Card.test.tsx +2 -2
- package/src/components/Card/Card.tsx +9 -6
- package/src/components/Card/CardTitle.tsx +3 -4
- package/src/components/Checkbox/Checkbox.test.tsx +2 -2
- package/src/components/Checkbox/Checkbox.tsx +26 -14
- package/src/components/DatePicker/DatePicker.test.tsx +2 -2
- package/src/components/DatePicker/DateRangePicker.stories.tsx +6 -1
- package/src/components/DatePicker/DateRangePicker.test.tsx +2 -2
- package/src/components/Dialog/Dialog.test.tsx +2 -2
- package/src/components/Dialog/Dialog.tsx +5 -5
- package/src/components/DragDropFile/components/DropZone.test.tsx +1 -1
- package/src/components/DragDropFile/styles.tsx +11 -6
- package/src/components/Drawer/Drawer.test.tsx +1 -1
- package/src/components/Drawer/Drawer.tsx +6 -6
- package/src/components/Dropdown/Dropdown.stories.tsx +10 -5
- package/src/components/Dropdown/Dropdown.test.tsx +14 -16
- package/src/components/Dropdown/DropdownMenu.tsx +28 -15
- package/src/components/Dropdown/DropdownTrigger.tsx +34 -24
- package/src/components/EmptyState/EmptyState.test.tsx +1 -1
- package/src/components/ErrorMessage/ErrorMessage.test.tsx +1 -1
- package/src/components/HighlightMatch/HighlightMatch.test.tsx +1 -1
- package/src/components/HighlightMatch/HighlightMatch.tsx +1 -2
- package/src/components/IconFactory/IconFactory.test.tsx +2 -2
- package/src/components/Label/Label.test.tsx +2 -2
- package/src/components/Label/Label.tsx +3 -3
- package/src/components/Link/Link.test.tsx +2 -2
- package/src/components/Link/Link.tsx +13 -9
- package/src/components/Loaders/LoadingBar.stories.tsx +2 -2
- package/src/components/Loaders/LoadingBar.test.tsx +1 -1
- package/src/components/Loaders/LoadingBar.tsx +2 -2
- package/src/components/Loaders/LoadingDots.test.tsx +1 -1
- package/src/components/Loaders/Spinner.test.tsx +2 -2
- package/src/components/Modal/Modal.test.tsx +2 -2
- package/src/components/Modal/Modal.tsx +12 -7
- package/src/components/Pagination/Pagination.test.tsx +1 -1
- package/src/components/Popover/Popover.test.tsx +2 -2
- package/src/components/ProgressBar/ProgressBar.test.tsx +1 -1
- package/src/components/ProgressBar/ProgressBar.tsx +6 -4
- package/src/components/Radio/Radio.test.tsx +2 -2
- package/src/components/Radio/Radio.tsx +19 -11
- package/src/components/Section/Section.test.tsx +2 -2
- package/src/components/Section/Section.tsx +8 -6
- package/src/components/Section/Sections.stories.tsx +1 -1
- package/src/components/Select/Select.fixtures.ts +1 -1
- package/src/components/Select/Select.stories.tsx +2 -2
- package/src/components/Select/Select.test.tsx +162 -155
- package/src/components/Select/SelectEmpty.tsx +5 -4
- package/src/components/Select/SelectTrigger.tsx +11 -6
- package/src/components/Select/useSelect.helpers.test.ts +1 -1
- package/src/components/SideNavigation/Logo/Logo.test.tsx +2 -2
- package/src/components/SideNavigation/Menu/Menu.test.tsx +2 -2
- package/src/components/SideNavigation/Menu/Menu.tsx +3 -3
- package/src/components/SideNavigation/Menu/MenuBaseItem.tsx +5 -4
- package/src/components/SideNavigation/Menu/MenuExpandable.tsx +3 -2
- package/src/components/SideNavigation/Separator/Separator.test.tsx +1 -1
- package/src/components/SideNavigation/SideNavigation.test.tsx +2 -2
- package/src/components/Steps/ProgressSteps/ProgressStep.tsx +39 -31
- package/src/components/Steps/Steps.fixtures.ts +1 -1
- package/src/components/Steps/Steps.test.tsx +2 -2
- package/src/components/Steps/useStep.test.tsx +1 -1
- package/src/components/Switch/Switch.test.tsx +1 -1
- package/src/components/Switch/Switch.tsx +18 -6
- package/src/components/Table/Table.fixtures.ts +1 -1
- package/src/components/Table/Table.test.tsx +1 -1
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/TablePagination/TablePagination.test.tsx +1 -1
- package/src/components/Tabs/Tabs.test.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +32 -26
- package/src/components/Tag/Tag.stories.tsx +1 -1
- package/src/components/Tag/Tag.test.tsx +2 -2
- package/src/components/Tag/Tag.tsx +44 -35
- package/src/components/Text/Text.test.tsx +2 -2
- package/src/components/TextField/TextField.test.tsx +1 -1
- package/src/components/TextField/TextField.tsx +22 -15
- package/src/components/Textarea/Textarea.test.tsx +1 -1
- package/src/components/Textarea/Textarea.tsx +22 -17
- package/src/components/Toast/Toast.test.tsx +2 -2
- package/src/components/Toast/Toast.tsx +3 -3
- package/src/components/ToggleGroup/Toggle.test.tsx +2 -2
- package/src/components/ToggleGroup/Toggle.tsx +7 -7
- package/src/components/ToggleGroup/ToggleGroup.stories.tsx +14 -12
- package/src/components/ToggleGroup/ToggleGroup.test.tsx +2 -2
- package/src/components/Tooltip/Tooltip.test.tsx +2 -2
- package/src/components/Tooltip/Tooltip.tsx +22 -20
- package/src/components/TopNavigation/Logo/Logo.test.tsx +2 -2
- package/src/components/TopNavigation/Menu/Menu.test.tsx +1 -1
- package/src/components/TopNavigation/Menu/MenuItemDropdown.tsx +1 -1
- package/src/components/TopNavigation/OpenSideNavButton/OpenSideNavButton.tsx +1 -1
- package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +1 -1
- package/src/hooks/useClickOutside/useClickOutside.test.tsx +1 -1
- package/src/hooks/useDidMount/useDidMount.test.tsx +1 -1
- package/src/hooks/useFocusTrap/useFocusTrap.test.tsx +1 -1
- package/src/hooks/useFocusWithin/useFocusWithin.test.tsx +1 -1
- package/src/hooks/useHeightExpansionToggler/useHeightExpansionToggler.test.tsx +1 -1
- package/src/hooks/useSelectable/SelectableStrategy.test.ts +1 -1
- package/src/hooks/useSelectable/useSelectable.test.ts +1 -1
- package/src/styles/font.tsx +3 -3
- package/src/testing/SelectEvent/SelectEvent.test.tsx +2 -2
- package/src/testing/SelectEvent/SelectEvent.ts +87 -45
- package/src/tests/generator.ts +127 -0
- package/src/tests/renderer.tsx +39 -0
- package/src/tools/conditional.test.ts +1 -1
- package/src/utils/toolset/interleave.test.ts +1 -1
|
@@ -3,8 +3,8 @@ import { screen } from '@testing-library/react'
|
|
|
3
3
|
import userEvent from '@testing-library/user-event'
|
|
4
4
|
|
|
5
5
|
import Label from './Label'
|
|
6
|
-
import generator from '
|
|
7
|
-
import renderer from '
|
|
6
|
+
import generator from '../../tests/generator'
|
|
7
|
+
import renderer from '../../tests/renderer'
|
|
8
8
|
|
|
9
9
|
const setup = ({ ...overrides }) => renderer(<Label {...overrides} />).render()
|
|
10
10
|
|
|
@@ -56,9 +56,9 @@ const StyledChildren = styled.span<WithAdditionalProps>`
|
|
|
56
56
|
|
|
57
57
|
const StyledRequired = styled.sup`
|
|
58
58
|
top: 0;
|
|
59
|
-
font-size: ${token('label-font-size')};
|
|
60
59
|
|
|
61
60
|
color: ${token('label-required-color')};
|
|
61
|
+
font-size: ${token('label-font-size')};
|
|
62
62
|
`
|
|
63
63
|
|
|
64
64
|
const StyledTooltipAnchor = styled.span<WithAdditionalProps>`
|
|
@@ -68,13 +68,13 @@ const StyledTooltipAnchor = styled.span<WithAdditionalProps>`
|
|
|
68
68
|
width: 16px;
|
|
69
69
|
height: 16px;
|
|
70
70
|
margin: 0 0 0 ${token('label-tooltip-margin-left')};
|
|
71
|
-
font-size: ${token('label-tooltip-font-size')};
|
|
72
|
-
font-weight: ${token('label-tooltip-font-weight')};
|
|
73
71
|
|
|
74
72
|
color: ${conditional({
|
|
75
73
|
'label-tooltip-font-color': whenProps({ scheme: 'light' }),
|
|
76
74
|
'label-tooltip-dark-font-color': whenProps({ scheme: 'dark' }),
|
|
77
75
|
})};
|
|
76
|
+
font-weight: ${token('label-tooltip-font-weight')};
|
|
77
|
+
font-size: ${token('label-tooltip-font-size')};
|
|
78
78
|
|
|
79
79
|
background: ${conditional({
|
|
80
80
|
'label-tooltip-background-color': whenProps({ scheme: 'light' }),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { screen } from '@testing-library/react'
|
|
3
|
-
import renderer from '
|
|
3
|
+
import renderer from '../../tests/renderer'
|
|
4
4
|
import Link from './Link'
|
|
5
|
-
import generator from '
|
|
5
|
+
import generator from '../../tests/generator'
|
|
6
6
|
|
|
7
7
|
describe('<Link />', () => {
|
|
8
8
|
describe('default', () => {
|
|
@@ -17,27 +17,31 @@ export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const StyledBaseAnchor = styled.a`
|
|
20
|
+
${font({
|
|
21
|
+
height: 'link-font-height',
|
|
22
|
+
weight: 'link-font-weight',
|
|
23
|
+
})}
|
|
24
|
+
${transition()}
|
|
25
|
+
|
|
26
|
+
${ellipsizable()}
|
|
27
|
+
|
|
20
28
|
display: inline-flex;
|
|
21
29
|
flex-direction: column;
|
|
22
30
|
align-items: center;
|
|
23
31
|
justify-content: center;
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
text-align: center;
|
|
26
34
|
font-size: ${token('link-font-size')};
|
|
27
35
|
color: ${token('color-neutral-darker')};
|
|
28
|
-
text-align: center;
|
|
29
36
|
text-decoration: none;
|
|
30
37
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
weight: 'link-font-weight',
|
|
34
|
-
})}
|
|
35
|
-
${ellipsizable()}
|
|
36
|
-
${transition()}
|
|
38
|
+
min-height: 24px;
|
|
39
|
+
|
|
37
40
|
${hoverable`
|
|
38
41
|
text-decoration: underline;
|
|
39
42
|
font-weight: ${token('link-font-weight--hover')};
|
|
40
43
|
`}
|
|
44
|
+
|
|
41
45
|
${disableable``}
|
|
42
46
|
|
|
43
47
|
${({ children }) =>
|
|
@@ -49,13 +53,13 @@ const StyledBaseAnchor = styled.a`
|
|
|
49
53
|
overflow: hidden;
|
|
50
54
|
|
|
51
55
|
font-weight: ${token('link-font-weight--hover')};
|
|
52
|
-
pointer-events: none;
|
|
53
56
|
|
|
54
57
|
visibility: hidden;
|
|
55
58
|
|
|
56
59
|
content: attr(data-text);
|
|
57
60
|
content: attr(data-text) / '';
|
|
58
61
|
user-select: none;
|
|
62
|
+
pointer-events: none;
|
|
59
63
|
|
|
60
64
|
@media speech {
|
|
61
65
|
display: none;
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import type { Story, Meta } from '@storybook/react/types-6-0'
|
|
3
3
|
import { Text } from 'components/Text'
|
|
4
4
|
|
|
5
|
-
import { LoadingBarProps } from './LoadingBar'
|
|
5
|
+
import type { LoadingBarProps } from './LoadingBar'
|
|
6
6
|
|
|
7
7
|
import LoadingBar from './LoadingBar'
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
argTypes: {},
|
|
13
13
|
} as Meta
|
|
14
14
|
|
|
15
|
-
export const Playground: Story<LoadingBarProps> = (args
|
|
15
|
+
export const Playground: Story<LoadingBarProps> = (args) => {
|
|
16
16
|
return (
|
|
17
17
|
<div className="flex flex-col space-y-2">
|
|
18
18
|
<div className="flex items-center">
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { composeStories } from '@storybook/testing-react'
|
|
3
3
|
|
|
4
4
|
import * as stories from './LoadingBar.stories'
|
|
5
|
-
import renderer, { screen } from '
|
|
5
|
+
import renderer, { screen } from '../../tests/renderer'
|
|
6
6
|
|
|
7
7
|
import type { LoadingBarProps } from './LoadingBar'
|
|
8
8
|
|
|
@@ -29,12 +29,12 @@ export const Bar = styled.div<{ width?: number; velocity?: number }>`
|
|
|
29
29
|
width: 100%;
|
|
30
30
|
height: ${token('space-s')};
|
|
31
31
|
|
|
32
|
-
content: '';
|
|
33
|
-
|
|
34
32
|
background-color: ${token('color-primary')};
|
|
35
33
|
|
|
36
34
|
animation: ${loading} ${({ velocity }) => (velocity && velocity > 0 ? velocity : 2.5)}s linear
|
|
37
35
|
infinite;
|
|
36
|
+
|
|
37
|
+
content: '';
|
|
38
38
|
}
|
|
39
39
|
`
|
|
40
40
|
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { composeStories } from '@storybook/testing-react'
|
|
3
3
|
|
|
4
4
|
import * as stories from './LoadingDots.stories'
|
|
5
|
-
import renderer, { screen } from '
|
|
5
|
+
import renderer, { screen } from '../../tests/renderer'
|
|
6
6
|
|
|
7
7
|
import type { LoadingDotsProps } from './LoadingDots'
|
|
8
8
|
|
|
@@ -2,8 +2,8 @@ import React from 'react'
|
|
|
2
2
|
import { composeStories } from '@storybook/testing-react'
|
|
3
3
|
|
|
4
4
|
import * as stories from './Spinner.stories'
|
|
5
|
-
import generator from '
|
|
6
|
-
import renderer, { screen } from '
|
|
5
|
+
import generator from '../../tests/generator'
|
|
6
|
+
import renderer, { screen } from '../../tests/renderer'
|
|
7
7
|
|
|
8
8
|
import type { SpinnerProps } from './Spinner'
|
|
9
9
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import Modal from './Modal'
|
|
4
|
-
import generator from '
|
|
5
|
-
import renderer, { screen, user } from '
|
|
4
|
+
import generator from '../../tests/generator'
|
|
5
|
+
import renderer, { screen, user } from '../../tests/renderer'
|
|
6
6
|
|
|
7
7
|
const setup = ({ open = false, ...overrides }) =>
|
|
8
8
|
renderer(<Modal open={open} {...overrides} />).render()
|
|
@@ -52,13 +52,13 @@ const ModalWrapper = styled.div<ModalWrapperProps>`
|
|
|
52
52
|
`
|
|
53
53
|
|
|
54
54
|
const HeaderWrapper = styled.div`
|
|
55
|
-
box-sizing: content-box;
|
|
56
55
|
display: flex;
|
|
57
56
|
align-items: center;
|
|
58
57
|
justify-content: center;
|
|
58
|
+
box-sizing: content-box;
|
|
59
59
|
height: ${token('space-xl')};
|
|
60
|
-
padding-bottom: ${token('space-s')};
|
|
61
60
|
margin-bottom: ${token('space-l')};
|
|
61
|
+
padding-bottom: ${token('space-s')};
|
|
62
62
|
|
|
63
63
|
border-bottom: 1px solid ${token('color-neutral-light')};
|
|
64
64
|
`
|
|
@@ -71,15 +71,20 @@ const Close = styled(CloseButton).attrs({
|
|
|
71
71
|
`
|
|
72
72
|
|
|
73
73
|
const Content = styled.div<ContentProps>`
|
|
74
|
-
position: relative;
|
|
75
|
-
z-index: ${token('z-index-modal')};
|
|
76
|
-
padding: ${token('space-xl')};
|
|
77
|
-
margin: 0 auto;
|
|
78
74
|
background: white;
|
|
79
75
|
border-radius: ${token('border-radius-s')};
|
|
80
|
-
outline: none;
|
|
81
76
|
box-shadow: ${token('shadow-modal')};
|
|
82
77
|
|
|
78
|
+
padding: ${token('space-xl')};
|
|
79
|
+
|
|
80
|
+
margin: 0 auto;
|
|
81
|
+
|
|
82
|
+
position: relative;
|
|
83
|
+
|
|
84
|
+
outline: none;
|
|
85
|
+
|
|
86
|
+
z-index: ${token('z-index-modal')};
|
|
87
|
+
|
|
83
88
|
${({ fullscreen }) =>
|
|
84
89
|
fullscreen &&
|
|
85
90
|
css`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import userEvent from '@testing-library/user-event'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
|
-
import renderer, { screen, fire } from '
|
|
4
|
+
import renderer, { screen, fire } from '../../tests/renderer'
|
|
5
5
|
|
|
6
6
|
import Pagination from './Pagination'
|
|
7
7
|
import type { PaginationProps } from './Pagination.types'
|
|
@@ -2,8 +2,8 @@ import React from 'react'
|
|
|
2
2
|
import { composeStories } from '@storybook/testing-react'
|
|
3
3
|
|
|
4
4
|
import * as stories from './Popover.stories'
|
|
5
|
-
import generator from '
|
|
6
|
-
import renderer, { screen } from '
|
|
5
|
+
import generator from '../../tests/generator'
|
|
6
|
+
import renderer, { screen } from '../../tests/renderer'
|
|
7
7
|
|
|
8
8
|
import type { PopoverProps } from './Popover'
|
|
9
9
|
|
|
@@ -5,16 +5,18 @@ import conditional, { whenProps } from 'tools/conditional'
|
|
|
5
5
|
import Status from 'utils/types/Status'
|
|
6
6
|
|
|
7
7
|
const Bar = styled.div<{ rounded: boolean }>`
|
|
8
|
-
|
|
8
|
+
align-items: center;
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-grow: 0;
|
|
11
11
|
flex-shrink: 1;
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
justify-content: center;
|
|
14
|
+
overflow: hidden;
|
|
14
15
|
width: 100%;
|
|
15
|
-
height: ${token('progressbar-height')};
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
position: relative;
|
|
18
|
+
|
|
19
|
+
height: ${token('progressbar-height')};
|
|
18
20
|
|
|
19
21
|
${({ rounded }) =>
|
|
20
22
|
rounded &&
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import Radio from './Radio'
|
|
4
|
-
import generator from '
|
|
5
|
-
import renderer, { fire } from '
|
|
4
|
+
import generator from '../../tests/generator'
|
|
5
|
+
import renderer, { fire } from '../../tests/renderer'
|
|
6
6
|
|
|
7
7
|
const setup = ({ ...overrides }) => renderer(<Radio {...overrides} />).render()
|
|
8
8
|
|
|
@@ -21,37 +21,45 @@ export interface RadioProps extends InputHTMLAttributes<HTMLInputElement>, Selec
|
|
|
21
21
|
const Check = styled(Icon)<SelectionStyleProps>`
|
|
22
22
|
position: absolute;
|
|
23
23
|
top: 50%;
|
|
24
|
+
|
|
24
25
|
left: 50%;
|
|
25
26
|
|
|
26
27
|
width: 10px;
|
|
27
28
|
height: 10px;
|
|
28
29
|
|
|
30
|
+
transform: translate(-50%, -50%);
|
|
31
|
+
|
|
29
32
|
pointer-events: none;
|
|
30
33
|
|
|
31
34
|
fill: currentColor;
|
|
32
|
-
|
|
33
|
-
transform: translate(-50%, -50%);
|
|
34
35
|
`
|
|
35
36
|
|
|
36
37
|
const Selector = styled.input<SelectionStyleProps>`
|
|
38
|
+
${transition()}
|
|
39
|
+
|
|
37
40
|
display: inline-flex;
|
|
38
41
|
flex-flow: row nowrap;
|
|
39
42
|
align-items: center;
|
|
40
43
|
|
|
41
|
-
width: ${token('radio-small-selector-size')};
|
|
42
|
-
height: ${token('radio-small-selector-size')};
|
|
43
|
-
color: white;
|
|
44
44
|
cursor: pointer;
|
|
45
|
+
|
|
46
|
+
appearance: none;
|
|
47
|
+
|
|
48
|
+
outline: none;
|
|
49
|
+
|
|
50
|
+
color: white;
|
|
51
|
+
|
|
52
|
+
height: ${token('radio-small-selector-size')};
|
|
53
|
+
width: ${token('radio-small-selector-size')};
|
|
54
|
+
|
|
55
|
+
border-radius: ${token('radio-selector-border-radius')};
|
|
56
|
+
border-width: ${token('button-border-width')};
|
|
57
|
+
border-style: solid;
|
|
58
|
+
|
|
45
59
|
background: ${conditional({
|
|
46
60
|
'radio-selector-background': whenProps({ scheme: 'light' }),
|
|
47
61
|
'radio-dark-selector-background': whenProps({ scheme: 'dark' }),
|
|
48
62
|
})};
|
|
49
|
-
appearance: none;
|
|
50
|
-
border-style: solid;
|
|
51
|
-
border-width: ${token('button-border-width')};
|
|
52
|
-
border-radius: ${token('radio-selector-border-radius')};
|
|
53
|
-
outline: none;
|
|
54
|
-
${transition()}
|
|
55
63
|
|
|
56
64
|
&:not(:checked) {
|
|
57
65
|
border-color: ${conditional({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Fragment } from 'react'
|
|
2
2
|
|
|
3
|
-
import generator from '
|
|
4
|
-
import renderer, { screen } from '
|
|
3
|
+
import generator from '../../tests/generator'
|
|
4
|
+
import renderer, { screen } from '../../tests/renderer'
|
|
5
5
|
|
|
6
6
|
import Section from './Section'
|
|
7
7
|
|
|
@@ -12,16 +12,18 @@ const StyledSection = styled.section`
|
|
|
12
12
|
`
|
|
13
13
|
|
|
14
14
|
const StyledSectionTitle = styled.section`
|
|
15
|
-
padding: ${token('space-s')} ${token('space-xs')};
|
|
16
|
-
margin-bottom: ${token('space-l')};
|
|
17
|
-
font-size: ${token('font-size-3')};
|
|
18
|
-
color: ${token('color-neutral-darker')};
|
|
19
|
-
border-bottom: 2px solid ${token('color-neutral-light')};
|
|
20
|
-
|
|
21
15
|
${font({
|
|
22
16
|
weight: 'font-weight-bold',
|
|
23
17
|
height: 'font-height-2',
|
|
24
18
|
})}
|
|
19
|
+
|
|
20
|
+
font-size: ${token('font-size-3')};
|
|
21
|
+
color: ${token('color-neutral-darker')};
|
|
22
|
+
|
|
23
|
+
border-bottom: 2px solid ${token('color-neutral-light')};
|
|
24
|
+
|
|
25
|
+
padding: ${token('space-s')} ${token('space-xs')};
|
|
26
|
+
margin-bottom: ${token('space-l')};
|
|
25
27
|
`
|
|
26
28
|
|
|
27
29
|
const StyledSpan = styled.span`
|
|
@@ -3,7 +3,7 @@ import type { Meta } from '@storybook/react/types-6-0'
|
|
|
3
3
|
import Section from './Section'
|
|
4
4
|
import type { SectionProps } from './Section'
|
|
5
5
|
|
|
6
|
-
import generator from '
|
|
6
|
+
import generator from '../../tests/generator'
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: 'Components/Section',
|
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
SelectProps,
|
|
16
16
|
} from './Select.types'
|
|
17
17
|
import { useSelect } from '.'
|
|
18
|
-
import generators from '
|
|
18
|
+
import generators from '../../tests/generator'
|
|
19
19
|
|
|
20
20
|
export default {
|
|
21
21
|
title: 'Components/Select',
|
|
@@ -32,7 +32,7 @@ export const Playground: Story<SelectProps> = (args: SelectProps) => {
|
|
|
32
32
|
<div className="flex-1">
|
|
33
33
|
<Label htmlFor="select-playground">Select your favorite fruit</Label>
|
|
34
34
|
<Select
|
|
35
|
-
options={FRUITS}
|
|
35
|
+
options={[...FRUITS]}
|
|
36
36
|
placeholder="Select sync"
|
|
37
37
|
{...omit(args, OMITTED_PROPS)}
|
|
38
38
|
id="select-playground"
|