@loadsmart/loadsmart-ui 5.10.0 → 5.11.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/dist/common/SelectionWrapper.d.ts +1 -1
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.stories.d.ts +1 -1
- package/dist/components/Banner/Banner.stories.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -1
- package/dist/components/Button/Button.stories.d.ts +1 -1
- package/dist/components/Calendar/Calendar.stories.d.ts +2 -7
- package/dist/components/Calendar/Date.helper.d.ts +47 -12
- package/dist/components/Card/Card.stories.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.stories.d.ts +1 -1
- package/dist/components/Dialog/Dialog.stories.d.ts +1 -1
- package/dist/components/DragDropFile/DragDropFile.stories.d.ts +1 -1
- package/dist/components/Drawer/Drawer.stories.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.stories.d.ts +5 -2
- package/dist/components/EmptyState/EmptyState.stories.d.ts +1 -1
- package/dist/components/ErrorMessage/ErrorMessage.stories.d.ts +1 -1
- package/dist/components/HighlightMatch/HighlightMatch.stories.d.ts +1 -1
- package/dist/components/IconFactory/IconFactory.stories.d.ts +1 -1
- package/dist/components/Label/Label.d.ts +2 -2
- package/dist/components/Label/Label.stories.d.ts +1 -1
- package/dist/components/Layout/Box.d.ts +1 -1
- package/dist/components/Layout/Grid.d.ts +1 -1
- package/dist/components/Layout/Layout.stories.d.ts +1 -1
- package/dist/components/Layout/Sidebar.d.ts +1 -1
- package/dist/components/Layout/Switcher.d.ts +1 -1
- package/dist/components/Link/Link.stories.d.ts +1 -1
- package/dist/components/Link/useSafeLink.d.ts +1 -1
- package/dist/components/Loaders/LoadingBar.stories.d.ts +2 -2
- package/dist/components/Loaders/LoadingDots.stories.d.ts +1 -1
- package/dist/components/Loaders/Spinner.stories.d.ts +1 -1
- package/dist/components/Modal/Modal.stories.d.ts +1 -1
- package/dist/components/Pagination/Pagination.stories.d.ts +1 -1
- package/dist/components/Pagination/Pagination.types.d.ts +2 -2
- package/dist/components/Popover/Popover.stories.d.ts +1 -1
- package/dist/components/ProgressBar/ProgressBar.stories.d.ts +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.stories.d.ts +1 -1
- package/dist/components/Section/Sections.stories.d.ts +1 -1
- package/dist/components/Select/Select.fixtures.d.ts +1 -1
- package/dist/components/Select/Select.stories.d.ts +1 -1
- package/dist/components/Select/Select.types.d.ts +2 -2
- package/dist/components/Select/SelectCreatableOption.d.ts +1 -1
- package/dist/components/Select/SelectEmpty.d.ts +1 -1
- package/dist/components/Select/components.d.ts +1 -1
- package/dist/components/Select/useSelectExternal.d.ts +1 -1
- package/dist/components/SideNavigation/SideNavigation.stories.d.ts +1 -1
- package/dist/components/Steps/Steps.d.ts +1 -1
- package/dist/components/Steps/Steps.stories.d.ts +1 -1
- package/dist/components/Steps/StepsStep.d.ts +1 -1
- package/dist/components/Switch/Switch.stories.d.ts +1 -1
- package/dist/components/Table/Table.stories.d.ts +1 -1
- package/dist/components/Table/Table.types.d.ts +3 -4
- package/dist/components/Table/TableSortHandle.d.ts +1 -1
- package/dist/components/TablePagination/RowsPerPage.d.ts +1 -1
- package/dist/components/TablePagination/TablePagination.stories.d.ts +1 -1
- package/dist/components/TablePagination/TablePagination.types.d.ts +1 -1
- package/dist/components/TablePagination/TablePaginationActions.d.ts +1 -1
- package/dist/components/Tag/Tag.stories.d.ts +1 -1
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/Text/Text.stories.d.ts +1 -1
- package/dist/components/TextField/TextField.d.ts +1 -1
- package/dist/components/TextField/TextField.stories.d.ts +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/Textarea/Textarea.stories.d.ts +1 -1
- package/dist/components/Toast/Toast.stories.d.ts +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +3 -2
- package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -1
- package/dist/hooks/useFocusTrap/useFocusTrap.stories.d.ts +1 -1
- package/dist/hooks/useHeightExpansionToggler/useHeightExpansionToggler.d.ts +1 -1
- package/dist/index.js +339 -491
- package/dist/index.js.map +1 -1
- package/dist/styles/activatable.d.ts +1 -1
- package/dist/styles/disableable.d.ts +1 -1
- package/dist/styles/focusable.d.ts +1 -1
- package/dist/styles/hoverable.d.ts +1 -1
- package/dist/testing/getInterpolatedStyles/getInterpolatedStyles.d.ts +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/dist/theming/index.d.ts +2 -2
- package/dist/theming/index.js.map +1 -1
- package/package.json +9 -10
- package/src/common/CloseButton/CloseButton.tsx +7 -11
- package/src/common/SelectionWrapper.tsx +8 -8
- package/src/components/Accordion/Accordion.stories.tsx +2 -2
- package/src/components/Accordion/Accordion.test.tsx +2 -2
- package/src/components/Accordion/Accordion.tsx +24 -29
- package/src/components/Banner/Banner.stories.tsx +1 -1
- 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 -4
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +1 -1
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/components/Button/Button.stories.tsx +1 -1
- package/src/components/Button/Button.test.tsx +2 -2
- package/src/components/Button/Button.tsx +17 -20
- package/src/components/Calendar/Calendar.stories.tsx +4 -2
- package/src/components/Calendar/Calendar.test.tsx +3 -3
- package/src/components/Calendar/Calendar.tsx +4 -8
- 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 +3 -6
- 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 +29 -39
- 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 +2 -2
- package/src/components/Card/Card.test.tsx +2 -2
- package/src/components/Card/Card.tsx +6 -9
- package/src/components/Card/CardTitle.tsx +3 -3
- package/src/components/Checkbox/Checkbox.stories.tsx +1 -1
- package/src/components/Checkbox/Checkbox.test.tsx +2 -2
- package/src/components/Checkbox/Checkbox.tsx +15 -27
- 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.stories.tsx +1 -1
- package/src/components/Dialog/Dialog.test.tsx +2 -2
- package/src/components/Dialog/Dialog.tsx +5 -5
- package/src/components/DragDropFile/DragDropFile.stories.tsx +1 -1
- package/src/components/DragDropFile/components/DropZone.test.tsx +1 -1
- package/src/components/DragDropFile/styles.tsx +6 -11
- package/src/components/Drawer/Drawer.stories.tsx +1 -1
- package/src/components/Drawer/Drawer.test.tsx +1 -1
- package/src/components/Drawer/Drawer.tsx +6 -6
- package/src/components/Dropdown/Dropdown.stories.tsx +11 -6
- package/src/components/Dropdown/Dropdown.test.tsx +14 -16
- package/src/components/Dropdown/DropdownMenu.tsx +15 -28
- package/src/components/Dropdown/DropdownTrigger.tsx +24 -34
- package/src/components/EmptyState/EmptyState.stories.tsx +1 -1
- package/src/components/EmptyState/EmptyState.test.tsx +1 -1
- package/src/components/ErrorMessage/ErrorMessage.stories.tsx +1 -1
- package/src/components/ErrorMessage/ErrorMessage.test.tsx +1 -1
- package/src/components/HighlightMatch/HighlightMatch.stories.tsx +1 -1
- package/src/components/HighlightMatch/HighlightMatch.test.tsx +2 -2
- package/src/components/HighlightMatch/HighlightMatch.tsx +1 -1
- package/src/components/IconFactory/IconFactory.stories.tsx +1 -1
- package/src/components/IconFactory/IconFactory.test.tsx +2 -2
- package/src/components/Label/Label.stories.tsx +1 -1
- package/src/components/Label/Label.test.tsx +2 -2
- package/src/components/Label/Label.tsx +5 -5
- package/src/components/Layout/Box.tsx +1 -1
- package/src/components/Layout/Grid.tsx +1 -1
- package/src/components/Layout/Layout.stories.tsx +1 -1
- package/src/components/Layout/Sidebar.tsx +1 -1
- package/src/components/Layout/Switcher.tsx +1 -1
- package/src/components/Link/Link.stories.tsx +1 -1
- package/src/components/Link/Link.test.tsx +2 -2
- package/src/components/Link/Link.tsx +9 -13
- package/src/components/Link/useSafeLink.ts +1 -1
- package/src/components/Loaders/LoadingBar.stories.tsx +3 -3
- package/src/components/Loaders/LoadingBar.test.tsx +1 -1
- package/src/components/Loaders/LoadingBar.tsx +2 -2
- package/src/components/Loaders/LoadingDots.stories.tsx +1 -1
- package/src/components/Loaders/LoadingDots.test.tsx +1 -1
- package/src/components/Loaders/Spinner.stories.tsx +1 -1
- package/src/components/Loaders/Spinner.test.tsx +2 -2
- package/src/components/Modal/Modal.stories.tsx +1 -1
- package/src/components/Modal/Modal.test.tsx +2 -2
- package/src/components/Modal/Modal.tsx +7 -12
- package/src/components/Pagination/Pagination.stories.tsx +1 -1
- package/src/components/Pagination/Pagination.test.tsx +2 -2
- package/src/components/Pagination/Pagination.types.ts +2 -2
- package/src/components/Popover/Popover.stories.tsx +1 -1
- package/src/components/Popover/Popover.test.tsx +2 -2
- package/src/components/ProgressBar/ProgressBar.stories.tsx +1 -1
- package/src/components/ProgressBar/ProgressBar.test.tsx +1 -1
- package/src/components/ProgressBar/ProgressBar.tsx +4 -6
- package/src/components/Radio/Radio.stories.tsx +1 -1
- package/src/components/Radio/Radio.test.tsx +2 -2
- package/src/components/Radio/Radio.tsx +12 -20
- package/src/components/Section/Section.test.tsx +2 -2
- package/src/components/Section/Section.tsx +6 -8
- package/src/components/Section/Sections.stories.tsx +2 -2
- package/src/components/Select/Select.fixtures.ts +2 -2
- package/src/components/Select/Select.stories.tsx +3 -3
- package/src/components/Select/Select.test.tsx +12 -5
- package/src/components/Select/Select.types.ts +2 -2
- package/src/components/Select/SelectCreatableOption.tsx +1 -1
- package/src/components/Select/SelectEmpty.tsx +5 -6
- package/src/components/Select/SelectOption.test.tsx +1 -1
- package/src/components/Select/SelectTrigger.tsx +6 -11
- package/src/components/Select/components.tsx +1 -1
- package/src/components/Select/useSelect.helpers.test.ts +1 -1
- package/src/components/Select/useSelect.ts +1 -1
- package/src/components/Select/useSelectExternal.ts +1 -1
- package/src/components/SideNavigation/Logo/Logo.test.tsx +2 -2
- package/src/components/SideNavigation/Menu/Menu.test.tsx +3 -3
- package/src/components/SideNavigation/Menu/Menu.tsx +3 -3
- package/src/components/SideNavigation/Menu/MenuBaseItem.tsx +4 -5
- package/src/components/SideNavigation/Menu/MenuExpandable.tsx +2 -3
- package/src/components/SideNavigation/Separator/Separator.test.tsx +1 -1
- package/src/components/SideNavigation/SideNavigation.stories.tsx +1 -1
- package/src/components/SideNavigation/SideNavigation.test.tsx +2 -2
- package/src/components/Steps/ProgressSteps/ProgressStep.tsx +31 -39
- package/src/components/Steps/Steps.fixtures.ts +1 -1
- package/src/components/Steps/Steps.stories.tsx +1 -1
- package/src/components/Steps/Steps.test.tsx +2 -2
- package/src/components/Steps/Steps.tsx +2 -1
- package/src/components/Steps/StepsStep.tsx +2 -1
- package/src/components/Steps/useStep.test.tsx +1 -1
- package/src/components/Switch/Switch.stories.tsx +1 -1
- package/src/components/Switch/Switch.test.tsx +1 -1
- package/src/components/Switch/Switch.tsx +6 -18
- package/src/components/Table/Table.fixtures.ts +1 -1
- package/src/components/Table/Table.stories.tsx +1 -1
- package/src/components/Table/Table.test.tsx +1 -1
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/Table/Table.types.ts +9 -4
- package/src/components/Table/TableSortHandle.tsx +1 -1
- package/src/components/TablePagination/RowsPerPage.tsx +2 -2
- package/src/components/TablePagination/TablePagination.stories.tsx +1 -1
- package/src/components/TablePagination/TablePagination.test.tsx +2 -2
- package/src/components/TablePagination/TablePagination.types.ts +1 -1
- package/src/components/TablePagination/TablePaginationActions.tsx +1 -1
- package/src/components/Tabs/Tabs.test.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +26 -32
- package/src/components/Tag/Tag.stories.tsx +2 -2
- package/src/components/Tag/Tag.test.tsx +2 -2
- package/src/components/Tag/Tag.tsx +35 -44
- package/src/components/Text/Text.stories.tsx +1 -1
- package/src/components/Text/Text.test.tsx +2 -2
- package/src/components/Text/Text.tsx +1 -1
- package/src/components/TextField/TextField.stories.tsx +1 -1
- package/src/components/TextField/TextField.test.tsx +1 -1
- package/src/components/TextField/TextField.tsx +16 -23
- package/src/components/Textarea/Textarea.stories.tsx +1 -1
- package/src/components/Textarea/Textarea.test.tsx +1 -1
- package/src/components/Textarea/Textarea.tsx +18 -23
- package/src/components/Toast/Toast.stories.tsx +1 -1
- 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 +1 -1
- package/src/components/ToggleGroup/ToggleGroup.test.tsx +2 -2
- package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/components/Tooltip/Tooltip.test.tsx +2 -2
- package/src/components/Tooltip/Tooltip.tsx +23 -24
- 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.stories.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/useHeightExpansionToggler/useHeightExpansionToggler.ts +1 -1
- package/src/hooks/useSelectable/SelectableStrategy.test.ts +1 -1
- package/src/hooks/useSelectable/useSelectable.test.ts +1 -1
- package/src/styles/activatable.tsx +1 -1
- package/src/styles/disableable.tsx +1 -1
- package/src/styles/focusable.tsx +1 -1
- package/src/styles/font.tsx +3 -3
- package/src/styles/hoverable.tsx +1 -1
- package/src/testing/SelectEvent/SelectEvent.test.tsx +2 -2
- package/src/testing/getInterpolatedStyles/getInterpolatedStyles.ts +1 -1
- package/src/tests/generator.ts +127 -0
- package/src/tests/renderer.tsx +39 -0
- package/src/theming/index.ts +3 -2
- package/src/tools/conditional.test.ts +1 -1
- package/src/utils/toolset/interleave.test.ts +1 -1
|
@@ -2,7 +2,7 @@ import React, { Fragment, InputHTMLAttributes, ReactNode } from 'react'
|
|
|
2
2
|
import clsx from 'clsx'
|
|
3
3
|
|
|
4
4
|
import { Icon } from 'components/Icon'
|
|
5
|
-
import ColorScheme from 'utils/types/ColorScheme'
|
|
5
|
+
import type ColorScheme from 'utils/types/ColorScheme'
|
|
6
6
|
import conditional, { whenProps } from 'tools/conditional'
|
|
7
7
|
import disableable from 'styles/disableable'
|
|
8
8
|
import focusable from 'styles/focusable'
|
|
@@ -21,45 +21,32 @@ export interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement>, Se
|
|
|
21
21
|
const Check = styled(Icon)<SelectionStyleProps>`
|
|
22
22
|
position: absolute;
|
|
23
23
|
top: 50%;
|
|
24
|
-
|
|
25
24
|
left: 50%;
|
|
26
|
-
|
|
27
|
-
transform: translate(-50%, -50%);
|
|
28
|
-
|
|
29
25
|
pointer-events: none;
|
|
26
|
+
transform: translate(-50%, -50%);
|
|
30
27
|
`
|
|
31
28
|
|
|
32
29
|
const Selector = styled.input<SelectionStyleProps>`
|
|
33
|
-
${transition()}
|
|
34
|
-
|
|
35
30
|
display: inline-flex;
|
|
36
31
|
flex-flow: row nowrap;
|
|
37
32
|
align-items: center;
|
|
38
|
-
|
|
39
|
-
cursor: pointer;
|
|
40
|
-
|
|
41
|
-
appearance: none;
|
|
42
|
-
|
|
43
|
-
outline: none;
|
|
44
|
-
|
|
45
|
-
color: white;
|
|
46
|
-
|
|
47
|
-
height: ${token('checkbox-selector-size')};
|
|
48
33
|
width: ${token('checkbox-selector-size')};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
border-style: solid;
|
|
53
|
-
|
|
54
|
-
border-color: ${conditional({
|
|
55
|
-
'checkbox-selector-border-color': whenProps({ scheme: 'light' }),
|
|
56
|
-
'checkbox-dark-selector-border-color': whenProps({ scheme: 'dark' }),
|
|
57
|
-
})};
|
|
58
|
-
|
|
34
|
+
height: ${token('checkbox-selector-size')};
|
|
35
|
+
color: white;
|
|
36
|
+
cursor: pointer;
|
|
59
37
|
background: ${conditional({
|
|
60
38
|
'checkbox-selector-background': whenProps({ scheme: 'light' }),
|
|
61
39
|
'checkbox-dark-selector-background': whenProps({ scheme: 'dark' }),
|
|
62
40
|
})};
|
|
41
|
+
border-color: ${conditional({
|
|
42
|
+
'checkbox-selector-border-color': whenProps({ scheme: 'light' }),
|
|
43
|
+
'checkbox-dark-selector-border-color': whenProps({ scheme: 'dark' }),
|
|
44
|
+
})};
|
|
45
|
+
border-style: solid;
|
|
46
|
+
border-width: ${token('button-border-width')};
|
|
47
|
+
border-radius: ${token('checkbox-selector-border-radius')};
|
|
48
|
+
appearance: none;
|
|
49
|
+
outline: none;
|
|
63
50
|
|
|
64
51
|
:checked {
|
|
65
52
|
background-color: ${token('checkbox-selector-checked-background')};
|
|
@@ -129,6 +116,7 @@ const Selector = styled.input<SelectionStyleProps>`
|
|
|
129
116
|
|
|
130
117
|
box-shadow: ${token('checkbox-selector-outline')};
|
|
131
118
|
`}
|
|
119
|
+
${transition()}
|
|
132
120
|
`
|
|
133
121
|
|
|
134
122
|
function Checkbox({
|
|
@@ -7,8 +7,8 @@ import { formatter } from './DatePicker'
|
|
|
7
7
|
import { MonthHelper } from '../Calendar'
|
|
8
8
|
import * as stories from './DatePicker.stories'
|
|
9
9
|
import DateHelper, { TODAY } from '../Calendar/Date.helper'
|
|
10
|
-
import generator from '
|
|
11
|
-
import renderer, { screen, fire } from '
|
|
10
|
+
import generator from '../../tests/generator'
|
|
11
|
+
import renderer, { screen, fire } from '../../tests/renderer'
|
|
12
12
|
|
|
13
13
|
import type { DatePickerProps } from './DatePicker.types'
|
|
14
14
|
import type { CalendarMonthAlias } from '../Calendar'
|
|
@@ -6,6 +6,7 @@ import DateRangePicker from './DateRangePicker'
|
|
|
6
6
|
|
|
7
7
|
import type { Story, Meta } from '@storybook/react/types-6-0'
|
|
8
8
|
import type { DateRangePickerProps } from './DatePicker.types'
|
|
9
|
+
import type { useCalendarProps } from 'components/Calendar'
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
12
|
title: 'Components/Date/DateRangePicker',
|
|
@@ -53,13 +54,15 @@ export const Playground: Story<DateRangePickerProps> = (args: DateRangePickerPro
|
|
|
53
54
|
)
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
Playground.bind({})
|
|
58
|
+
|
|
56
59
|
Playground.args = {
|
|
57
60
|
id: 'playground-date-range-picker',
|
|
58
61
|
name: 'playground-date-range-picker',
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
export const WithValue: Story<DateRangePickerProps> = (args: DateRangePickerProps) => {
|
|
62
|
-
const [value, setValue] = useState([
|
|
65
|
+
const [value, setValue] = useState<useCalendarProps['selected']>([
|
|
63
66
|
DateHelper('December 17, 1995').toString(),
|
|
64
67
|
DateHelper('December 22, 1995').toString(),
|
|
65
68
|
])
|
|
@@ -82,6 +85,8 @@ export const WithValue: Story<DateRangePickerProps> = (args: DateRangePickerProp
|
|
|
82
85
|
)
|
|
83
86
|
}
|
|
84
87
|
|
|
88
|
+
WithValue.bind({})
|
|
89
|
+
|
|
85
90
|
WithValue.args = {
|
|
86
91
|
id: 'with-value-date-range-picker',
|
|
87
92
|
name: 'with-value-date-range-picker',
|
|
@@ -7,8 +7,8 @@ import { DateRangePickerEvent } from '../../testing/DatePickerEvent'
|
|
|
7
7
|
import { formatter } from './DateRangePicker'
|
|
8
8
|
import * as stories from './DateRangePicker.stories'
|
|
9
9
|
import DateHelper, { TODAY } from '../Calendar/Date.helper'
|
|
10
|
-
import generator from '
|
|
11
|
-
import renderer, { screen, fire } from '
|
|
10
|
+
import generator from '../../tests/generator'
|
|
11
|
+
import renderer, { screen, fire } from '../../tests/renderer'
|
|
12
12
|
|
|
13
13
|
import type { DateRangePickerProps } from './DatePicker.types'
|
|
14
14
|
import type { CalendarDate, CalendarMonthAlias } from '../Calendar'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { Fragment } from 'react'
|
|
2
2
|
|
|
3
3
|
import Dialog from './Dialog'
|
|
4
|
-
import generator from '
|
|
5
|
-
import renderer, { screen } from '
|
|
4
|
+
import generator from '../../tests/generator'
|
|
5
|
+
import renderer, { screen } from '../../tests/renderer'
|
|
6
6
|
import type { DialogProps } from './Dialog'
|
|
7
7
|
|
|
8
8
|
const setup = (props: DialogProps) => renderer(<Dialog {...props} />).render()
|
|
@@ -23,11 +23,11 @@ export interface DialogProps extends WithScaleProps {
|
|
|
23
23
|
|
|
24
24
|
const Header = styled.h1`
|
|
25
25
|
padding-bottom: ${token('space-s')};
|
|
26
|
-
|
|
27
|
-
color: ${token('dialog-header-color')};
|
|
28
|
-
font-weight: ${token('font-weight-bold')};
|
|
29
26
|
font-size: ${token('font-size-2')};
|
|
27
|
+
font-weight: ${token('font-weight-bold')};
|
|
30
28
|
line-height: ${token('font-height-2')};
|
|
29
|
+
|
|
30
|
+
color: ${token('dialog-header-color')};
|
|
31
31
|
text-align: center;
|
|
32
32
|
|
|
33
33
|
border-bottom: 1px solid ${token('dialog-header-border-color')};
|
|
@@ -35,10 +35,10 @@ const Header = styled.h1`
|
|
|
35
35
|
const Body = styled.div`
|
|
36
36
|
margin-top: ${token('space-l')};
|
|
37
37
|
margin-bottom: ${token('space-l')};
|
|
38
|
-
|
|
39
|
-
color: ${token('dialog-body-font-color')};
|
|
40
38
|
font-size: ${token('font-size-4')};
|
|
41
39
|
line-height: ${token('font-height-3')};
|
|
40
|
+
|
|
41
|
+
color: ${token('dialog-body-font-color')};
|
|
42
42
|
text-align: center;
|
|
43
43
|
`
|
|
44
44
|
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { screen } from '@testing-library/react'
|
|
3
3
|
import userEvent from '@testing-library/user-event'
|
|
4
4
|
|
|
5
|
-
import generator from '
|
|
5
|
+
import generator from '../../../tests/generator'
|
|
6
6
|
import { renderWithDragDropFileProvider, DragDropFileEvent } from '../../../testing'
|
|
7
7
|
|
|
8
8
|
import type { DropZoneProps } from '../types'
|
|
@@ -29,36 +29,31 @@ export const DragDropFileWrapper = styled(Stack)<{ withFileList: boolean }>`
|
|
|
29
29
|
export const DropZoneWrapper = styled((props: StackProps) => <Stack as="label" {...props} />)<
|
|
30
30
|
Pick<DropZoneProps, 'disabled' | 'error'>
|
|
31
31
|
>`
|
|
32
|
-
${
|
|
33
|
-
|
|
32
|
+
padding: ${getToken('space-l')} ${getToken('space-3xl')};
|
|
33
|
+
text-align: center;
|
|
34
34
|
cursor: pointer;
|
|
35
|
-
|
|
36
35
|
background-color: ${getToken('color-neutral-white')};
|
|
37
|
-
border-radius: ${getToken('border-radius-s')};
|
|
38
|
-
border: 2px dashed;
|
|
39
36
|
border-color: ${conditional({
|
|
40
37
|
'color-neutral-light': whenProps({ error: false }),
|
|
41
38
|
'color-danger': whenProps({ disabled: false, error: true }),
|
|
42
39
|
})};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
text-align: center;
|
|
40
|
+
border-style: dashed;
|
|
41
|
+
border-width: 2px;
|
|
42
|
+
border-radius: ${getToken('border-radius-s')};
|
|
47
43
|
|
|
48
44
|
${hoverable`
|
|
49
45
|
border-color: ${conditional({
|
|
50
46
|
'color-accent': whenProps({ disabled: false, error: false }),
|
|
51
47
|
})};
|
|
52
48
|
`}
|
|
53
|
-
|
|
54
49
|
${focusable`
|
|
55
50
|
border-color: ${conditional({
|
|
56
51
|
'color-accent': whenProps({ disabled: false, error: false }),
|
|
57
52
|
})};
|
|
58
53
|
box-shadow: ${getToken('shadow-glow-primary')};
|
|
59
54
|
`}
|
|
60
|
-
|
|
61
55
|
${disableable()}
|
|
56
|
+
${transition({ property: 'border-color, box-shadow, opacity' })}
|
|
62
57
|
`
|
|
63
58
|
|
|
64
59
|
export const HiddenInput = styled.input`
|
|
@@ -29,12 +29,12 @@ const StyledAside = styled.aside<Pick<DrawerProps, 'open'>>`
|
|
|
29
29
|
width: 100%;
|
|
30
30
|
height: 100%;
|
|
31
31
|
|
|
32
|
-
background: ${token('modal-overlay-background')};
|
|
33
|
-
|
|
34
32
|
visibility: ${conditional({
|
|
35
33
|
visible: whenProps({ open: true }),
|
|
36
34
|
hidden: whenProps({ open: false }),
|
|
37
35
|
})};
|
|
36
|
+
|
|
37
|
+
background: ${token('modal-overlay-background')};
|
|
38
38
|
`
|
|
39
39
|
|
|
40
40
|
const CloseButton = styled(DefaultCloseButton)`
|
|
@@ -81,15 +81,15 @@ const StyledHeader = styled.header`
|
|
|
81
81
|
justify-content: center;
|
|
82
82
|
|
|
83
83
|
padding: ${token('space-xl')};
|
|
84
|
+
font-size: ${token('font-size-2')};
|
|
85
|
+
font-weight: ${token('font-weight-bold')};
|
|
84
86
|
|
|
85
87
|
color: ${token('color-neutral-darker')};
|
|
86
|
-
font-weight: ${token('font-weight-bold')};
|
|
87
|
-
font-size: ${token('font-size-2')};
|
|
88
88
|
text-align: center;
|
|
89
89
|
|
|
90
90
|
border-bottom-color: ${token('color-neutral-light')};
|
|
91
|
-
border-bottom-width: 1px;
|
|
92
91
|
border-bottom-style: solid;
|
|
92
|
+
border-bottom-width: 1px;
|
|
93
93
|
`
|
|
94
94
|
|
|
95
95
|
const StyledBody = styled.div`
|
|
@@ -108,8 +108,8 @@ const StyledFooter = styled.footer`
|
|
|
108
108
|
padding: ${token('space-xl')};
|
|
109
109
|
|
|
110
110
|
border-top-color: ${token('color-neutral-light')};
|
|
111
|
-
border-top-width: 1px;
|
|
112
111
|
border-top-style: solid;
|
|
112
|
+
border-top-width: 1px;
|
|
113
113
|
`
|
|
114
114
|
|
|
115
115
|
export interface DrawerHeaderProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { Story, Meta } from '@storybook/react/types-6-0'
|
|
2
|
+
import type { Story, Meta } from '@storybook/react/types-6-0'
|
|
3
3
|
|
|
4
4
|
import { ACTIONS, PROFILE_ACTIONS, SUBSCRIPTION_ACTIONS } from './Dropdown.fixtures'
|
|
5
5
|
import { Icon } from 'components/Icon'
|
|
@@ -28,9 +28,12 @@ export default {
|
|
|
28
28
|
},
|
|
29
29
|
} as Meta
|
|
30
30
|
|
|
31
|
-
type DropdownStoryProps = DropdownProps &
|
|
31
|
+
export type DropdownStoryProps = DropdownProps & {
|
|
32
|
+
align?: DropdownMenuProps['align']
|
|
33
|
+
outlined?: DropdownTriggerProps['outlined']
|
|
34
|
+
}
|
|
32
35
|
|
|
33
|
-
export const Playground: Story<DropdownStoryProps> = (args
|
|
36
|
+
export const Playground: Story<DropdownStoryProps> = (args) => {
|
|
34
37
|
const [message, setMessage] = useState('')
|
|
35
38
|
|
|
36
39
|
return (
|
|
@@ -58,13 +61,15 @@ export const Playground: Story<DropdownStoryProps> = (args: DropdownStoryProps)
|
|
|
58
61
|
)
|
|
59
62
|
}
|
|
60
63
|
|
|
64
|
+
Playground.bind({})
|
|
65
|
+
|
|
61
66
|
Playground.args = {
|
|
62
67
|
disabled: false,
|
|
63
68
|
align: 'start',
|
|
64
69
|
outlined: true,
|
|
65
70
|
}
|
|
66
71
|
|
|
67
|
-
export const WithSections: Story<DropdownStoryProps> = (args
|
|
72
|
+
export const WithSections: Story<DropdownStoryProps> = (args) => {
|
|
68
73
|
const [message, setMessage] = useState('')
|
|
69
74
|
|
|
70
75
|
return (
|
|
@@ -111,7 +116,7 @@ WithSections.args = {
|
|
|
111
116
|
outlined: true,
|
|
112
117
|
}
|
|
113
118
|
|
|
114
|
-
export const Extended: Story<DropdownStoryProps> = (args
|
|
119
|
+
export const Extended: Story<DropdownStoryProps> = (args) => {
|
|
115
120
|
const [message, setMessage] = useState('')
|
|
116
121
|
|
|
117
122
|
return (
|
|
@@ -185,7 +190,7 @@ function InputTrigger() {
|
|
|
185
190
|
)
|
|
186
191
|
}
|
|
187
192
|
|
|
188
|
-
export const CustomTrigger: Story<DropdownStoryProps> = (args
|
|
193
|
+
export const CustomTrigger: Story<DropdownStoryProps> = (args) => {
|
|
189
194
|
const [message, setMessage] = useState('')
|
|
190
195
|
|
|
191
196
|
function renderMenu() {
|
|
@@ -3,20 +3,18 @@ import { composeStories } from '@storybook/testing-react'
|
|
|
3
3
|
|
|
4
4
|
import { ACTIONS, PROFILE_ACTIONS, SUBSCRIPTION_ACTIONS } from './Dropdown.fixtures'
|
|
5
5
|
import * as stories from './Dropdown.stories'
|
|
6
|
-
import generator from '
|
|
7
|
-
import renderer, { screen, user, waitFor } from '
|
|
8
|
-
|
|
9
|
-
import type { DropdownProps } from './Dropdown.types'
|
|
6
|
+
import generator from '../../tests/generator'
|
|
7
|
+
import renderer, { screen, user, waitFor } from '../../tests/renderer'
|
|
10
8
|
|
|
11
9
|
const { Playground, WithSections, Extended } = composeStories(stories)
|
|
12
10
|
|
|
13
11
|
describe('Dropdown', () => {
|
|
14
12
|
describe('Generic', () => {
|
|
15
|
-
const setup = (overrides
|
|
13
|
+
const setup = (overrides?: stories.DropdownStoryProps) =>
|
|
16
14
|
renderer(<Playground {...overrides} />).render()
|
|
17
15
|
|
|
18
16
|
it('starts collapsed', () => {
|
|
19
|
-
setup(
|
|
17
|
+
setup()
|
|
20
18
|
|
|
21
19
|
screen.getByText('Actions')
|
|
22
20
|
|
|
@@ -26,7 +24,7 @@ describe('Dropdown', () => {
|
|
|
26
24
|
})
|
|
27
25
|
|
|
28
26
|
it('renders all options when expanded', () => {
|
|
29
|
-
setup(
|
|
27
|
+
setup()
|
|
30
28
|
|
|
31
29
|
user.click(screen.getByText('Actions'))
|
|
32
30
|
|
|
@@ -36,7 +34,7 @@ describe('Dropdown', () => {
|
|
|
36
34
|
})
|
|
37
35
|
|
|
38
36
|
it('performs option click and collapses', async () => {
|
|
39
|
-
setup(
|
|
37
|
+
setup()
|
|
40
38
|
|
|
41
39
|
user.click(screen.getByText('Actions'))
|
|
42
40
|
|
|
@@ -64,11 +62,11 @@ describe('Dropdown', () => {
|
|
|
64
62
|
})
|
|
65
63
|
|
|
66
64
|
describe('With Sections', () => {
|
|
67
|
-
const setup = (overrides
|
|
65
|
+
const setup = (overrides?: stories.DropdownStoryProps) =>
|
|
68
66
|
renderer(<WithSections {...overrides} />).render()
|
|
69
67
|
|
|
70
68
|
it('starts collapsed', () => {
|
|
71
|
-
setup(
|
|
69
|
+
setup()
|
|
72
70
|
|
|
73
71
|
screen.getByText('Sections')
|
|
74
72
|
|
|
@@ -78,7 +76,7 @@ describe('Dropdown', () => {
|
|
|
78
76
|
})
|
|
79
77
|
|
|
80
78
|
it('renders all sections and their options when expanded', async () => {
|
|
81
|
-
setup(
|
|
79
|
+
setup()
|
|
82
80
|
|
|
83
81
|
user.click(screen.getByText('Sections'))
|
|
84
82
|
|
|
@@ -100,7 +98,7 @@ describe('Dropdown', () => {
|
|
|
100
98
|
it('performs option click and collapses', async () => {
|
|
101
99
|
const SECTION_ACTIONS = [...PROFILE_ACTIONS, ...SUBSCRIPTION_ACTIONS]
|
|
102
100
|
|
|
103
|
-
setup(
|
|
101
|
+
setup()
|
|
104
102
|
|
|
105
103
|
user.click(screen.getByText('Sections'))
|
|
106
104
|
|
|
@@ -120,11 +118,11 @@ describe('Dropdown', () => {
|
|
|
120
118
|
})
|
|
121
119
|
|
|
122
120
|
describe('With Header and Footer', () => {
|
|
123
|
-
const setup = (overrides
|
|
121
|
+
const setup = (overrides?: stories.DropdownStoryProps) =>
|
|
124
122
|
renderer(<Extended {...overrides} />).render()
|
|
125
123
|
|
|
126
124
|
it('starts collapsed', () => {
|
|
127
|
-
setup(
|
|
125
|
+
setup()
|
|
128
126
|
|
|
129
127
|
screen.getByText('With Header & Footer')
|
|
130
128
|
|
|
@@ -134,7 +132,7 @@ describe('Dropdown', () => {
|
|
|
134
132
|
})
|
|
135
133
|
|
|
136
134
|
it('renders header, footer, and options when expanded', async () => {
|
|
137
|
-
setup(
|
|
135
|
+
setup()
|
|
138
136
|
|
|
139
137
|
user.click(screen.getByText('With Header & Footer'))
|
|
140
138
|
|
|
@@ -150,7 +148,7 @@ describe('Dropdown', () => {
|
|
|
150
148
|
})
|
|
151
149
|
|
|
152
150
|
it('performs option click and collapses', async () => {
|
|
153
|
-
setup(
|
|
151
|
+
setup()
|
|
154
152
|
|
|
155
153
|
user.click(screen.getByText('With Header & Footer'))
|
|
156
154
|
|
|
@@ -66,42 +66,32 @@ const Children = styled.span`
|
|
|
66
66
|
`
|
|
67
67
|
|
|
68
68
|
const DropdownItemWrapper = styled.button`
|
|
69
|
-
${transition()}
|
|
70
|
-
|
|
71
69
|
display: inline-flex;
|
|
72
|
-
|
|
70
|
+
flex: 1 0;
|
|
73
71
|
align-items: center;
|
|
74
|
-
|
|
75
|
-
${font({
|
|
76
|
-
height: 'font-height-3',
|
|
77
|
-
weight: 'font-weight-medium',
|
|
78
|
-
})}
|
|
79
|
-
font-size: ${token('font-size-4')};
|
|
80
|
-
|
|
72
|
+
justify-content: flex-start;
|
|
81
73
|
min-height: 36px;
|
|
82
|
-
flex: 1 0;
|
|
83
|
-
|
|
84
|
-
border: none;
|
|
85
|
-
border-radius: ${token('border-radius-s')};
|
|
86
|
-
background: ${token('color-neutral-white')};
|
|
87
|
-
|
|
88
|
-
color: ${token('color-neutral-darker')};
|
|
89
|
-
|
|
90
74
|
padding: 0 ${token('space-s')};
|
|
91
|
-
|
|
92
75
|
margin: 0 ${token('space-s')};
|
|
93
|
-
|
|
76
|
+
font-size: ${token('font-size-4')};
|
|
77
|
+
color: ${token('color-neutral-darker')};
|
|
94
78
|
cursor: pointer;
|
|
79
|
+
background: ${token('color-neutral-white')};
|
|
80
|
+
border: none;
|
|
81
|
+
border-radius: ${token('border-radius-s')};
|
|
95
82
|
|
|
83
|
+
${font({
|
|
84
|
+
height: 'font-height-3',
|
|
85
|
+
weight: 'font-weight-medium',
|
|
86
|
+
})}
|
|
96
87
|
${hoverable`
|
|
97
88
|
background: ${token('color-neutral-lighter')};
|
|
98
89
|
`}
|
|
99
|
-
|
|
100
90
|
${focusable`
|
|
101
91
|
background: ${token('color-neutral-lighter')};
|
|
102
92
|
`}
|
|
103
|
-
|
|
104
93
|
${disableable()}
|
|
94
|
+
${transition()}
|
|
105
95
|
|
|
106
96
|
${Children} {
|
|
107
97
|
flex: 1 0 auto;
|
|
@@ -124,17 +114,14 @@ const DropdownItemWrapper = styled.button`
|
|
|
124
114
|
|
|
125
115
|
const DropdownSectionHeader = styled.strong`
|
|
126
116
|
display: flex;
|
|
127
|
-
justify-content: flex-start;
|
|
128
117
|
align-items: center;
|
|
129
|
-
|
|
118
|
+
justify-content: flex-start;
|
|
119
|
+
margin: 0 ${token('space-s')};
|
|
120
|
+
font-size: ${token('font-size-4')};
|
|
130
121
|
${font({
|
|
131
122
|
height: 'font-height-3',
|
|
132
123
|
weight: 'font-weight-bold',
|
|
133
124
|
})}
|
|
134
|
-
|
|
135
|
-
font-size: ${token('font-size-4')};
|
|
136
|
-
|
|
137
|
-
margin: 0 ${token('space-s')};
|
|
138
125
|
`
|
|
139
126
|
|
|
140
127
|
const DropdownSectionWrapper = styled.div`
|
|
@@ -57,19 +57,15 @@ const TriggerButton = styled(
|
|
|
57
57
|
SelectorButton as React.ForwardRefExoticComponent<TriggerButtonProps>
|
|
58
58
|
).attrs(triggerButtonAttrs)`
|
|
59
59
|
flex: 1;
|
|
60
|
-
|
|
61
60
|
justify-content: flex-start;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
font-weight: ${conditional({
|
|
62
|
+
'font-weight-regular': whenProps({ outlined: false }),
|
|
63
|
+
})};
|
|
65
64
|
text-transform: ${conditional({
|
|
66
65
|
capitalize: whenProps({ outlined: false, variant: 'tertiary' }),
|
|
67
66
|
uppercase: whenProps({ outlined: true }),
|
|
68
67
|
})};
|
|
69
|
-
|
|
70
|
-
font-weight: ${conditional({
|
|
71
|
-
'font-weight-regular': whenProps({ outlined: false }),
|
|
72
|
-
})};
|
|
68
|
+
border: none;
|
|
73
69
|
|
|
74
70
|
${hoverable`
|
|
75
71
|
border-color: ${conditional({
|
|
@@ -117,17 +113,17 @@ const TriggerButton = styled(
|
|
|
117
113
|
overflow: hidden;
|
|
118
114
|
|
|
119
115
|
font-weight: ${token('font-weight-bold')};
|
|
116
|
+
pointer-events: none;
|
|
120
117
|
|
|
121
118
|
visibility: hidden;
|
|
122
119
|
|
|
123
|
-
/* @REVIEW: since this is a span descendant of a button
|
|
124
|
-
I'm using the direct value of children the solution inside Link
|
|
120
|
+
/* @REVIEW: since this is a span descendant of a button
|
|
121
|
+
I'm using the direct value of children the solution inside Link
|
|
125
122
|
relies on data-text attribute */
|
|
126
123
|
|
|
127
124
|
content: '${children}';
|
|
128
125
|
content: '${children}' / '';
|
|
129
126
|
user-select: none;
|
|
130
|
-
pointer-events: none;
|
|
131
127
|
|
|
132
128
|
@media speech {
|
|
133
129
|
display: none;
|
|
@@ -139,33 +135,29 @@ const TriggerButton = styled(
|
|
|
139
135
|
`
|
|
140
136
|
|
|
141
137
|
const DropdownTriggerWrapper = styled.div<DropdownTriggerWrapperProps>`
|
|
142
|
-
${transition()}
|
|
143
|
-
|
|
144
|
-
${font({
|
|
145
|
-
height: 'font-height-3',
|
|
146
|
-
weight: 'font-weight-medium',
|
|
147
|
-
})}
|
|
148
|
-
|
|
149
138
|
display: flex;
|
|
150
|
-
|
|
139
|
+
flex: 1;
|
|
151
140
|
align-items: center;
|
|
141
|
+
justify-content: flex-start;
|
|
152
142
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
143
|
+
height: 36px;
|
|
144
|
+
font-size: ${token('font-size-4')};
|
|
145
|
+
|
|
146
|
+
color: ${token('color-neutral-darker')};
|
|
156
147
|
border-color: ${conditional({
|
|
157
148
|
'button-secondary-border-color': whenProps({ scheme: 'light', $outlined: true }),
|
|
158
149
|
'button-secondary-dark-border-color': whenProps({ scheme: 'dark', $outlined: true }),
|
|
159
150
|
'color-transparent': whenProps({ $outlined: false }),
|
|
160
151
|
})};
|
|
152
|
+
border-style: solid;
|
|
153
|
+
border-width: ${token('button-border-width')};
|
|
154
|
+
border-radius: ${token('button-border-radius')};
|
|
161
155
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
flex: 1;
|
|
168
|
-
|
|
156
|
+
${transition()}
|
|
157
|
+
${font({
|
|
158
|
+
height: 'font-height-3',
|
|
159
|
+
weight: 'font-weight-medium',
|
|
160
|
+
})}
|
|
169
161
|
${hoverable`
|
|
170
162
|
border-color: ${conditional({
|
|
171
163
|
'button-secondary-border-color--hover': whenProps({ scheme: 'light', $outlined: true }),
|
|
@@ -213,13 +205,11 @@ const DropdownTriggerWrapper = styled.div<DropdownTriggerWrapperProps>`
|
|
|
213
205
|
`
|
|
214
206
|
|
|
215
207
|
const TriggerHandle = styled(BaseButton)`
|
|
216
|
-
|
|
217
|
-
|
|
208
|
+
height: calc(100% - 2px);
|
|
218
209
|
background: ${token('color-transparent')};
|
|
219
|
-
border-radius: 0 ${token('border-radius-s')} ${token('border-radius-s')} 0;
|
|
220
210
|
border: none;
|
|
221
|
-
|
|
222
|
-
|
|
211
|
+
border-radius: 0 ${token('border-radius-s')} ${token('border-radius-s')} 0;
|
|
212
|
+
${focusable()}
|
|
223
213
|
`
|
|
224
214
|
|
|
225
215
|
const RotatableIcon = styled(DefaultIcon)<{ $rotate: boolean }>`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { Meta } from '@storybook/react/types-6-0'
|
|
3
|
+
import type { Meta } from '@storybook/react/types-6-0'
|
|
4
4
|
|
|
5
5
|
import { Icon } from 'components/Icon'
|
|
6
6
|
import { Stack } from 'components/Layout'
|
|
@@ -4,7 +4,7 @@ import { composeStories } from '@storybook/testing-react'
|
|
|
4
4
|
import userEvent from '@testing-library/user-event'
|
|
5
5
|
|
|
6
6
|
import * as stories from './EmptyState.stories'
|
|
7
|
-
import renderer, { screen } from '
|
|
7
|
+
import renderer, { screen } from '../../tests/renderer'
|
|
8
8
|
|
|
9
9
|
import type { EmptyStateProps } from './EmptyState.types'
|
|
10
10
|
import {
|