@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
|
@@ -5,19 +5,20 @@ import { getToken as token } from 'theming'
|
|
|
5
5
|
import type { SelectEmptyProps } from './Select.types'
|
|
6
6
|
|
|
7
7
|
const Wrapper = styled.div`
|
|
8
|
-
box-sizing: border-box;
|
|
9
8
|
display: flex;
|
|
10
9
|
flex-direction: column;
|
|
11
10
|
align-items: flex-start;
|
|
12
11
|
justify-content: center;
|
|
13
|
-
|
|
12
|
+
|
|
13
|
+
box-sizing: border-box;
|
|
14
14
|
margin: 0 ${token('space-s')};
|
|
15
|
+
padding: ${token('space-s')};
|
|
16
|
+
|
|
17
|
+
color: ${token('color-neutral')};
|
|
15
18
|
|
|
16
19
|
font-size: 1em;
|
|
17
20
|
line-height: ${token('font-height-3')};
|
|
18
21
|
|
|
19
|
-
color: ${token('color-neutral')};
|
|
20
|
-
|
|
21
22
|
background: ${token('color-transparent')};
|
|
22
23
|
`
|
|
23
24
|
|
|
@@ -13,14 +13,19 @@ const GenericSelectTrigger = styled(GenericDropdownTrigger)`
|
|
|
13
13
|
`
|
|
14
14
|
|
|
15
15
|
const SelectTriggerSearchField = styled(TextField)`
|
|
16
|
-
flex: 1;
|
|
17
|
-
height: 100%;
|
|
18
|
-
background-color: transparent;
|
|
19
|
-
border: none;
|
|
20
|
-
border-radius: ${token('border-radius-s')} 0 0 ${token('border-radius-s')};
|
|
21
16
|
${focusable`
|
|
22
17
|
box-shadow: none;
|
|
23
18
|
`}
|
|
19
|
+
|
|
20
|
+
background-color: transparent;
|
|
21
|
+
|
|
22
|
+
border: none;
|
|
23
|
+
border-radius: ${token('border-radius-s')} 0 0 ${token('border-radius-s')};
|
|
24
|
+
|
|
25
|
+
height: 100%;
|
|
26
|
+
|
|
27
|
+
flex: 1;
|
|
28
|
+
|
|
24
29
|
${Trailing} {
|
|
25
30
|
margin: 0 ${token('space-xs')} 0 0;
|
|
26
31
|
}
|
|
@@ -32,8 +37,8 @@ const Separator = styled.span`
|
|
|
32
37
|
margin: 0;
|
|
33
38
|
|
|
34
39
|
border-right-color: ${token('color-neutral-light')};
|
|
35
|
-
border-right-style: solid;
|
|
36
40
|
border-right-width: 1px;
|
|
41
|
+
border-right-style: solid;
|
|
37
42
|
`
|
|
38
43
|
|
|
39
44
|
const SelectTrigger = forwardRef<HTMLInputElement, SelectTriggerProps>(function SelectTrigger(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import { Logo } from './'
|
|
4
|
-
import renderer, { screen } from '
|
|
5
|
-
import generator from '
|
|
4
|
+
import renderer, { screen } from '../../../tests/renderer'
|
|
5
|
+
import generator from '../../../tests/generator'
|
|
6
6
|
import type { LogoProps } from './Logo'
|
|
7
7
|
|
|
8
8
|
const setup = ({ ...overrides }: LogoProps) => renderer(<Logo {...overrides} />).render()
|
|
@@ -2,8 +2,8 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { Menu } from './'
|
|
4
4
|
import type { MenuProps } from './Menu'
|
|
5
|
-
import renderer, { screen } from '
|
|
6
|
-
import generator from '
|
|
5
|
+
import renderer, { screen } from '../../../tests/renderer'
|
|
6
|
+
import generator from '../../../tests/generator'
|
|
7
7
|
import userEvent from '@testing-library/user-event'
|
|
8
8
|
|
|
9
9
|
function setup(props: MenuProps) {
|
|
@@ -13,11 +13,11 @@ import { styledCompounds } from 'utils/toolset/styledCompounds'
|
|
|
13
13
|
const MenuTitle = styled.div`
|
|
14
14
|
padding: ${token('space-s')} 0;
|
|
15
15
|
padding-left: ${token('space-l')};
|
|
16
|
-
font-size: ${token('font-size-5')};
|
|
17
|
-
font-weight: ${token('font-weight-bold')};
|
|
18
|
-
line-height: ${token('font-height-3')};
|
|
19
16
|
|
|
20
17
|
color: ${token('color-neutral')};
|
|
18
|
+
font-weight: ${token('font-weight-bold')};
|
|
19
|
+
font-size: ${token('font-size-5')};
|
|
20
|
+
line-height: ${token('font-height-3')};
|
|
21
21
|
text-transform: uppercase;
|
|
22
22
|
`
|
|
23
23
|
|
|
@@ -17,22 +17,23 @@ export type MenuBaseItemProps = HTMLAttributes<HTMLElement> & {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const StyledMenuItem = styled.button`
|
|
20
|
+
${transition({ duration: '0.25s' })};
|
|
21
|
+
|
|
20
22
|
display: flex;
|
|
23
|
+
width: 100%;
|
|
21
24
|
align-items: center;
|
|
22
25
|
justify-content: space-between;
|
|
23
|
-
width: 100%;
|
|
24
26
|
padding: ${token('space-s')} 0;
|
|
25
27
|
padding-right: ${rem('12px')};
|
|
26
28
|
padding-left: ${token('space-l')};
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
color: ${token('color-neutral-white')};
|
|
29
31
|
font-weight: ${token('font-weight-bold')};
|
|
32
|
+
font-size: ${token('font-size-4')};
|
|
30
33
|
line-height: ${token('font-height-3')};
|
|
31
|
-
color: ${token('color-neutral-white')};
|
|
32
34
|
|
|
33
35
|
cursor: pointer;
|
|
34
36
|
|
|
35
|
-
${transition({ duration: '0.25s' })};
|
|
36
37
|
${focusable`
|
|
37
38
|
color: ${token('color-primary')};
|
|
38
39
|
`}
|
|
@@ -35,10 +35,11 @@ const StyledIcon = styled(Icon)<IExpandable>`
|
|
|
35
35
|
`
|
|
36
36
|
|
|
37
37
|
const ExpandableItems = styled.div<IExpandable>`
|
|
38
|
-
height: ${prop('$height', 0)}px;
|
|
39
38
|
overflow: hidden;
|
|
40
|
-
|
|
41
39
|
${transition({ property: 'height' })}
|
|
40
|
+
|
|
41
|
+
height: ${prop('$height', 0)}px;
|
|
42
|
+
|
|
42
43
|
${MenuLink} {
|
|
43
44
|
padding-left: ${token('space-xl')};
|
|
44
45
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import { SideNavigation } from './'
|
|
4
|
-
import renderer from '
|
|
5
|
-
import generator from '
|
|
4
|
+
import renderer from '../../tests/renderer'
|
|
5
|
+
import generator from '../../tests/generator'
|
|
6
6
|
import type { SideNavigationProps } from './SideNavigation'
|
|
7
7
|
|
|
8
8
|
function setup(props: SideNavigationProps) {
|
|
@@ -60,18 +60,32 @@ const ProgressStepContainer = styled.div`
|
|
|
60
60
|
`
|
|
61
61
|
|
|
62
62
|
const StepIndicator = styled.span<{ current: boolean; complete: boolean }>`
|
|
63
|
+
${transition()}
|
|
64
|
+
|
|
65
|
+
${font({
|
|
66
|
+
weight: 'font-weight-bold',
|
|
67
|
+
height: 'steps-indicator-size',
|
|
68
|
+
})}
|
|
69
|
+
|
|
70
|
+
font-size: ${token('font-size-4')};
|
|
71
|
+
|
|
72
|
+
height: ${token('steps-indicator-size')};
|
|
73
|
+
width: ${token('steps-indicator-size')};
|
|
74
|
+
|
|
63
75
|
display: flex;
|
|
64
|
-
align-items: center;
|
|
65
76
|
justify-content: center;
|
|
66
|
-
|
|
67
|
-
height: ${token('steps-indicator-size')};
|
|
68
|
-
font-size: ${token('font-size-4')};
|
|
77
|
+
align-items: center;
|
|
69
78
|
|
|
70
|
-
|
|
79
|
+
border-width: 2px;
|
|
80
|
+
border-style: solid;
|
|
81
|
+
border-color: ${conditional({
|
|
82
|
+
'color-accent': whenProps([
|
|
83
|
+
{ current: true, complete: [true, false] },
|
|
84
|
+
{ current: false, complete: true },
|
|
85
|
+
]),
|
|
71
86
|
'color-neutral': whenProps({ current: false, complete: false }),
|
|
72
|
-
'color-neutral-white': whenProps({ current: false, complete: true }),
|
|
73
|
-
'color-accent': whenProps({ current: true }),
|
|
74
87
|
})};
|
|
88
|
+
border-radius: ${token('border-radius-circle')};
|
|
75
89
|
|
|
76
90
|
background: ${conditional({
|
|
77
91
|
'color-accent': whenProps([{ current: false, complete: true }]),
|
|
@@ -81,47 +95,41 @@ const StepIndicator = styled.span<{ current: boolean; complete: boolean }>`
|
|
|
81
95
|
]),
|
|
82
96
|
})};
|
|
83
97
|
|
|
84
|
-
|
|
85
|
-
'color-accent': whenProps([
|
|
86
|
-
{ current: true, complete: [true, false] },
|
|
87
|
-
{ current: false, complete: true },
|
|
88
|
-
]),
|
|
98
|
+
color: ${conditional({
|
|
89
99
|
'color-neutral': whenProps({ current: false, complete: false }),
|
|
100
|
+
'color-neutral-white': whenProps({ current: false, complete: true }),
|
|
101
|
+
'color-accent': whenProps({ current: true }),
|
|
90
102
|
})};
|
|
91
|
-
|
|
92
|
-
border-width: 2px;
|
|
93
|
-
border-radius: ${token('border-radius-circle')};
|
|
103
|
+
`
|
|
94
104
|
|
|
95
|
-
|
|
105
|
+
const StepLabel = styled.span<{ current: boolean; complete: boolean }>`
|
|
96
106
|
${font({
|
|
97
|
-
|
|
98
|
-
height: 'steps-indicator-size',
|
|
107
|
+
height: 'font-height-2',
|
|
99
108
|
})}
|
|
100
|
-
`
|
|
101
109
|
|
|
102
|
-
const StepLabel = styled.span<{ current: boolean; complete: boolean }>`
|
|
103
110
|
position: relative;
|
|
104
111
|
|
|
105
|
-
display: flex;
|
|
106
|
-
flex-direction: row;
|
|
107
|
-
|
|
108
|
-
align-items: center;
|
|
109
|
-
justify-content: center;
|
|
110
|
-
|
|
111
|
-
margin: ${token('space-xs')} 0 0 0;
|
|
112
|
-
font-size: ${token('font-size-4')};
|
|
113
112
|
font-weight: ${conditional({
|
|
114
113
|
'font-weight-medium': whenProps({ current: false }),
|
|
115
114
|
'font-weight-bold': whenProps({ current: true }),
|
|
116
115
|
})};
|
|
116
|
+
|
|
117
117
|
color: ${conditional({
|
|
118
118
|
'color-neutral-darker': whenProps([{ current: true }, { current: false, complete: true }]),
|
|
119
119
|
'color-neutral': whenProps({ current: false, complete: false }),
|
|
120
120
|
})};
|
|
121
|
+
|
|
122
|
+
font-size: ${token('font-size-4')};
|
|
123
|
+
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: row;
|
|
126
|
+
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
|
|
121
130
|
text-align: center;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
})}
|
|
131
|
+
|
|
132
|
+
margin: ${token('space-xs')} 0 0 0;
|
|
125
133
|
`
|
|
126
134
|
|
|
127
135
|
function ProgressStep(props: { step: Step; current: boolean; indicator: ReactNode }): JSX.Element {
|
|
@@ -2,9 +2,9 @@ import React from 'react'
|
|
|
2
2
|
import { composeStory } from '@storybook/testing-react'
|
|
3
3
|
|
|
4
4
|
import { STEPS, CONTENTS } from './Steps.fixtures'
|
|
5
|
-
import generator from '
|
|
5
|
+
import generator from '../../tests/generator'
|
|
6
6
|
import Meta, { Playground as PlaygroundStory } from './Steps.stories'
|
|
7
|
-
import renderer, { screen } from '
|
|
7
|
+
import renderer, { screen } from '../../tests/renderer'
|
|
8
8
|
|
|
9
9
|
import type { StepsProps } from './Steps'
|
|
10
10
|
import type { Step } from './Steps.types'
|
|
@@ -3,7 +3,7 @@ import { composeStories } from '@storybook/testing-react'
|
|
|
3
3
|
import userEvent from '@testing-library/user-event'
|
|
4
4
|
|
|
5
5
|
import * as stories from './Switch.stories'
|
|
6
|
-
import renderer, { screen } from '
|
|
6
|
+
import renderer, { screen } from '../../tests/renderer'
|
|
7
7
|
import type { SwitchProps } from './Switch'
|
|
8
8
|
|
|
9
9
|
const { Playground } = composeStories(stories)
|
|
@@ -24,8 +24,19 @@ export interface SwitchProps extends InputHTMLAttributes<HTMLInputElement>, With
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const SwitchWrapper = styled.label<WithAdditionalProps>`
|
|
27
|
+
${transition()}
|
|
28
|
+
|
|
29
|
+
${font({})};
|
|
30
|
+
|
|
31
|
+
user-select: none;
|
|
32
|
+
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
-webkit-tap-highlight-color: transparent;
|
|
35
|
+
|
|
27
36
|
position: relative;
|
|
37
|
+
|
|
28
38
|
display: inline-flex;
|
|
39
|
+
|
|
29
40
|
width: ${conditional({
|
|
30
41
|
'switch-width': whenProps({ scale: 'default' }),
|
|
31
42
|
'switch-large-width': whenProps({ scale: 'large' }),
|
|
@@ -34,28 +45,28 @@ const SwitchWrapper = styled.label<WithAdditionalProps>`
|
|
|
34
45
|
'switch-height': whenProps({ scale: 'default' }),
|
|
35
46
|
'switch-large-height': whenProps({ scale: 'large' }),
|
|
36
47
|
})};
|
|
37
|
-
|
|
38
|
-
user-select: none;
|
|
39
|
-
-webkit-tap-highlight-color: transparent;
|
|
48
|
+
|
|
40
49
|
background-color: ${conditional({
|
|
41
50
|
'switch-inactive-background-color': whenProps({ active: false }),
|
|
42
51
|
'switch-active-background-color': whenProps({ active: true }),
|
|
43
52
|
})};
|
|
53
|
+
|
|
44
54
|
border-radius: ${conditional({
|
|
45
55
|
'switch-border-radius': whenProps({ scale: 'default' }),
|
|
46
56
|
'switch-large-border-radius': whenProps({ scale: 'large' }),
|
|
47
57
|
})};
|
|
48
|
-
|
|
49
|
-
${font({})};
|
|
58
|
+
|
|
50
59
|
${hoverable`
|
|
51
60
|
background: ${conditional({
|
|
52
61
|
'switch-inactive-background-color--hover': whenProps({ active: false }),
|
|
53
62
|
'switch-active-background-color--hover': whenProps({ active: true }),
|
|
54
63
|
})};
|
|
55
64
|
`}
|
|
65
|
+
|
|
56
66
|
${focusable`
|
|
57
67
|
box-shadow: ${token('switch-outline')}
|
|
58
68
|
`}
|
|
69
|
+
|
|
59
70
|
${disableable``}
|
|
60
71
|
`
|
|
61
72
|
|
|
@@ -91,7 +102,6 @@ const Slider = styled.span<WithAdditionalProps>`
|
|
|
91
102
|
'switch-slider-large-size': whenProps({ scale: 'large' }),
|
|
92
103
|
})};
|
|
93
104
|
|
|
94
|
-
content: '';
|
|
95
105
|
background-color: ${token('switch-slider-background-color')};
|
|
96
106
|
border-radius: ${token('switch-slider-border-radius')};
|
|
97
107
|
|
|
@@ -99,6 +109,8 @@ const Slider = styled.span<WithAdditionalProps>`
|
|
|
99
109
|
timingFunction: 'ease-out',
|
|
100
110
|
duration: '150ms',
|
|
101
111
|
})}
|
|
112
|
+
|
|
113
|
+
content: '';
|
|
102
114
|
}
|
|
103
115
|
`
|
|
104
116
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import renderer, { screen, user } from '
|
|
3
|
+
import renderer, { screen, user } from '../../tests/renderer'
|
|
4
4
|
|
|
5
5
|
import Table from './Table'
|
|
6
6
|
import type { TableProps } from './Table.types'
|
|
@@ -152,10 +152,10 @@ const StyledTable = styled.table<{ scale?: string }>`
|
|
|
152
152
|
|
|
153
153
|
white-space: nowrap;
|
|
154
154
|
|
|
155
|
-
border-collapse: collapse;
|
|
156
|
-
|
|
157
155
|
background-color: ${token('color-neutral-white')};
|
|
158
156
|
|
|
157
|
+
border-collapse: collapse;
|
|
158
|
+
|
|
159
159
|
${StyledTableBody} ${StyledTableRow},
|
|
160
160
|
${StyledTableBody} ${StyledExpandableTableRow} {
|
|
161
161
|
height: ${conditional({
|
|
@@ -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 } from '
|
|
4
|
+
import renderer, { screen } from '../../tests/renderer'
|
|
5
5
|
|
|
6
6
|
import TablePagination from './TablePagination'
|
|
7
7
|
import type { TablePaginationProps } from './TablePagination.types'
|
|
@@ -26,8 +26,8 @@ const TabsItemsWrapper = styled.ul`
|
|
|
26
26
|
padding: 0;
|
|
27
27
|
|
|
28
28
|
border-bottom-color: ${token('color-neutral-lighter')};
|
|
29
|
-
border-bottom-style: solid;
|
|
30
29
|
border-bottom-width: 2px;
|
|
30
|
+
border-bottom-style: solid;
|
|
31
31
|
`
|
|
32
32
|
|
|
33
33
|
const StyledSpan = styled.span`
|
|
@@ -48,44 +48,50 @@ const Leading = styled(StyledSpan)`
|
|
|
48
48
|
`
|
|
49
49
|
|
|
50
50
|
const StyledLabel = styled.label<WithActiveProps & WithDirectionProps>`
|
|
51
|
-
position: relative;
|
|
52
|
-
bottom: -2px;
|
|
53
|
-
display: inline-flex;
|
|
54
|
-
flex-direction: ${conditional({
|
|
55
|
-
row: whenProps({ direction: 'horizontal' }),
|
|
56
|
-
column: whenProps({ direction: 'vertical' }),
|
|
57
|
-
})};
|
|
58
|
-
padding: ${token('space-m')} ${token('space-l')};
|
|
59
|
-
font-size: ${token('font-size-4')};
|
|
60
|
-
|
|
61
|
-
color: ${conditional({
|
|
62
|
-
'color-neutral': whenProps({ active: false }),
|
|
63
|
-
'neutral-darker': whenProps({ active: true }),
|
|
64
|
-
})};
|
|
65
|
-
text-transform: uppercase;
|
|
66
|
-
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
|
|
69
|
-
border-color: ${conditional({
|
|
70
|
-
'color-transparent': whenProps({ active: false }),
|
|
71
|
-
'color-primary': whenProps({ active: true }),
|
|
72
|
-
})};
|
|
73
|
-
border-bottom-style: solid;
|
|
74
|
-
border-bottom-width: 2px;
|
|
75
|
-
|
|
76
51
|
${font({
|
|
77
52
|
height: 'font-height-2',
|
|
78
53
|
weight: 'font-weight-bold',
|
|
79
54
|
})}
|
|
80
55
|
${transition()}
|
|
56
|
+
|
|
57
|
+
font-size: ${token('font-size-4')};
|
|
58
|
+
text-transform: uppercase;
|
|
59
|
+
|
|
81
60
|
${hoverable`
|
|
82
61
|
color: ${token('color-neutral-darker')};
|
|
83
62
|
background-color: ${token('color-neutral-light')}33;
|
|
84
63
|
`}
|
|
64
|
+
|
|
85
65
|
${disableable`
|
|
86
66
|
color: ${token('color-neutral-dark')}33;
|
|
87
67
|
background-color: ${token('color-neutral-light')}33;
|
|
88
68
|
`}
|
|
69
|
+
|
|
70
|
+
padding: ${token('space-m')} ${token('space-l')};
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
flex-direction: ${conditional({
|
|
73
|
+
row: whenProps({ direction: 'horizontal' }),
|
|
74
|
+
column: whenProps({ direction: 'vertical' }),
|
|
75
|
+
})};
|
|
76
|
+
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
|
|
79
|
+
position: relative;
|
|
80
|
+
bottom: -2px;
|
|
81
|
+
|
|
82
|
+
border-bottom-width: 2px;
|
|
83
|
+
border-bottom-style: solid;
|
|
84
|
+
|
|
85
|
+
border-color: ${conditional({
|
|
86
|
+
'color-transparent': whenProps({ active: false }),
|
|
87
|
+
'color-primary': whenProps({ active: true }),
|
|
88
|
+
})};
|
|
89
|
+
|
|
90
|
+
color: ${conditional({
|
|
91
|
+
'color-neutral': whenProps({ active: false }),
|
|
92
|
+
'neutral-darker': whenProps({ active: true }),
|
|
93
|
+
})};
|
|
94
|
+
|
|
89
95
|
${Leading} + ${Children} {
|
|
90
96
|
margin: ${conditional({
|
|
91
97
|
'0': whenProps({ direction: 'horizontal' }),
|
|
@@ -3,7 +3,7 @@ import Tag, { TagProps } from './Tag'
|
|
|
3
3
|
import type { Meta } from '@storybook/react/types-6-0'
|
|
4
4
|
|
|
5
5
|
import { Icon as MirandaIcon } from '../Icon'
|
|
6
|
-
import generator from '
|
|
6
|
+
import generator from '../../tests/generator'
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: 'Components/Tag',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import Tag from './Tag'
|
|
4
|
-
import generator from '
|
|
5
|
-
import renderer from '
|
|
4
|
+
import generator from '../../tests/generator'
|
|
5
|
+
import renderer from '../../tests/renderer'
|
|
6
6
|
|
|
7
7
|
const setup = ({ ...overrides }) => renderer(<Tag {...overrides} />).render()
|
|
8
8
|
|