@loadsmart/loadsmart-ui 5.10.0 → 5.10.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/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/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 +1 -1
- 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 +1 -1
- 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 +293 -445
- 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/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 +1 -1
- package/src/components/Accordion/Accordion.tsx +24 -29
- package/src/components/Banner/Banner.stories.tsx +1 -1
- package/src/components/Banner/Banner.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.tsx +17 -20
- package/src/components/Calendar/Calendar.tsx +4 -8
- package/src/components/Calendar/PickerModeToggle.tsx +3 -6
- package/src/components/Calendar/Pickers/DayPicker.tsx +1 -1
- package/src/components/Calendar/Pickers/MonthPicker.tsx +1 -1
- package/src/components/Calendar/Pickers/PickerButton.tsx +29 -39
- package/src/components/Calendar/Pickers/YearPicker.tsx +1 -1
- package/src/components/Card/Card.stories.tsx +1 -1
- 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.tsx +15 -27
- package/src/components/Dialog/Dialog.stories.tsx +1 -1
- package/src/components/Dialog/Dialog.tsx +5 -5
- package/src/components/DragDropFile/DragDropFile.stories.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.tsx +6 -6
- package/src/components/Dropdown/Dropdown.stories.tsx +1 -1
- 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/ErrorMessage/ErrorMessage.stories.tsx +1 -1
- package/src/components/HighlightMatch/HighlightMatch.stories.tsx +1 -1
- package/src/components/HighlightMatch/HighlightMatch.test.tsx +1 -1
- package/src/components/HighlightMatch/HighlightMatch.tsx +1 -1
- package/src/components/IconFactory/IconFactory.stories.tsx +1 -1
- package/src/components/Label/Label.stories.tsx +1 -1
- 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.tsx +9 -13
- package/src/components/Link/useSafeLink.ts +1 -1
- package/src/components/Loaders/LoadingBar.stories.tsx +1 -1
- package/src/components/Loaders/LoadingBar.tsx +2 -2
- package/src/components/Loaders/LoadingDots.stories.tsx +1 -1
- package/src/components/Loaders/Spinner.stories.tsx +1 -1
- package/src/components/Modal/Modal.stories.tsx +1 -1
- package/src/components/Modal/Modal.tsx +7 -12
- package/src/components/Pagination/Pagination.stories.tsx +1 -1
- package/src/components/Pagination/Pagination.test.tsx +1 -1
- package/src/components/Pagination/Pagination.types.ts +2 -2
- package/src/components/Popover/Popover.stories.tsx +1 -1
- package/src/components/ProgressBar/ProgressBar.stories.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.tsx +12 -20
- package/src/components/Section/Section.tsx +6 -8
- 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 +1 -1
- 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.ts +1 -1
- package/src/components/Select/useSelectExternal.ts +1 -1
- package/src/components/SideNavigation/Menu/Menu.test.tsx +1 -1
- 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/SideNavigation.stories.tsx +1 -1
- package/src/components/Steps/ProgressSteps/ProgressStep.tsx +31 -39
- package/src/components/Steps/Steps.stories.tsx +1 -1
- package/src/components/Steps/Steps.tsx +2 -1
- package/src/components/Steps/StepsStep.tsx +2 -1
- package/src/components/Switch/Switch.stories.tsx +1 -1
- package/src/components/Switch/Switch.tsx +6 -18
- package/src/components/Table/Table.stories.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 +1 -1
- package/src/components/TablePagination/TablePagination.types.ts +1 -1
- package/src/components/TablePagination/TablePaginationActions.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +26 -32
- package/src/components/Tag/Tag.stories.tsx +1 -1
- package/src/components/Tag/Tag.tsx +35 -44
- package/src/components/Text/Text.stories.tsx +1 -1
- package/src/components/Text/Text.tsx +1 -1
- package/src/components/TextField/TextField.stories.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.tsx +18 -23
- package/src/components/Toast/Toast.stories.tsx +1 -1
- package/src/components/Toast/Toast.tsx +3 -3
- package/src/components/ToggleGroup/Toggle.tsx +7 -7
- package/src/components/ToggleGroup/ToggleGroup.stories.tsx +1 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +23 -24
- package/src/components/TopNavigation/Menu/MenuItemDropdown.tsx +1 -1
- package/src/components/TopNavigation/OpenSideNavButton/OpenSideNavButton.tsx +1 -1
- package/src/hooks/useFocusTrap/useFocusTrap.stories.tsx +1 -1
- package/src/hooks/useHeightExpansionToggler/useHeightExpansionToggler.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/getInterpolatedStyles/getInterpolatedStyles.ts +1 -1
- package/src/theming/index.ts +3 -2
|
@@ -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
|
+
|
|
32
34
|
background-color: ${token('color-primary')};
|
|
33
35
|
|
|
34
36
|
animation: ${loading} ${({ velocity }) => (velocity && velocity > 0 ? velocity : 2.5)}s linear
|
|
35
37
|
infinite;
|
|
36
|
-
|
|
37
|
-
content: '';
|
|
38
38
|
}
|
|
39
39
|
`
|
|
40
40
|
|
|
@@ -52,13 +52,13 @@ const ModalWrapper = styled.div<ModalWrapperProps>`
|
|
|
52
52
|
`
|
|
53
53
|
|
|
54
54
|
const HeaderWrapper = styled.div`
|
|
55
|
+
box-sizing: content-box;
|
|
55
56
|
display: flex;
|
|
56
57
|
align-items: center;
|
|
57
58
|
justify-content: center;
|
|
58
|
-
box-sizing: content-box;
|
|
59
59
|
height: ${token('space-xl')};
|
|
60
|
-
margin-bottom: ${token('space-l')};
|
|
61
60
|
padding-bottom: ${token('space-s')};
|
|
61
|
+
margin-bottom: ${token('space-l')};
|
|
62
62
|
|
|
63
63
|
border-bottom: 1px solid ${token('color-neutral-light')};
|
|
64
64
|
`
|
|
@@ -71,19 +71,14 @@ const Close = styled(CloseButton).attrs({
|
|
|
71
71
|
`
|
|
72
72
|
|
|
73
73
|
const Content = styled.div<ContentProps>`
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
box-shadow: ${token('shadow-modal')};
|
|
77
|
-
|
|
74
|
+
position: relative;
|
|
75
|
+
z-index: ${token('z-index-modal')};
|
|
78
76
|
padding: ${token('space-xl')};
|
|
79
|
-
|
|
80
77
|
margin: 0 auto;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
background: white;
|
|
79
|
+
border-radius: ${token('border-radius-s')};
|
|
84
80
|
outline: none;
|
|
85
|
-
|
|
86
|
-
z-index: ${token('z-index-modal')};
|
|
81
|
+
box-shadow: ${token('shadow-modal')};
|
|
87
82
|
|
|
88
83
|
${({ fullscreen }) =>
|
|
89
84
|
fullscreen &&
|
|
@@ -4,7 +4,7 @@ import React from 'react'
|
|
|
4
4
|
import renderer, { screen, fire } from '../../../tests/renderer'
|
|
5
5
|
|
|
6
6
|
import Pagination from './Pagination'
|
|
7
|
-
import { PaginationProps } from './Pagination.types'
|
|
7
|
+
import type { PaginationProps } from './Pagination.types'
|
|
8
8
|
|
|
9
9
|
describe('Pagination', () => {
|
|
10
10
|
const setup = (overrides: PaginationProps) => renderer(<Pagination {...overrides} />).render()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react'
|
|
1
|
+
import type { HTMLAttributes } from 'react'
|
|
2
2
|
|
|
3
|
-
import { ButtonProps } from 'components/Button'
|
|
3
|
+
import type { ButtonProps } from 'components/Button'
|
|
4
4
|
|
|
5
5
|
export type PaginationProps = Omit<HTMLAttributes<HTMLElement>, 'onChange'> & {
|
|
6
6
|
/**
|
|
@@ -5,19 +5,17 @@ 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
|
+
position: relative;
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-grow: 0;
|
|
11
11
|
flex-shrink: 1;
|
|
12
|
-
|
|
12
|
+
align-items: center;
|
|
13
13
|
justify-content: center;
|
|
14
|
-
overflow: hidden;
|
|
15
14
|
width: 100%;
|
|
16
|
-
|
|
17
|
-
position: relative;
|
|
18
|
-
|
|
19
15
|
height: ${token('progressbar-height')};
|
|
20
16
|
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
|
|
21
19
|
${({ rounded }) =>
|
|
22
20
|
rounded &&
|
|
23
21
|
css`
|
|
@@ -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,37 @@ export interface RadioProps extends InputHTMLAttributes<HTMLInputElement>, Selec
|
|
|
21
21
|
const Check = styled(Icon)<SelectionStyleProps>`
|
|
22
22
|
position: absolute;
|
|
23
23
|
top: 50%;
|
|
24
|
-
|
|
25
24
|
left: 50%;
|
|
26
25
|
|
|
27
26
|
width: 10px;
|
|
28
27
|
height: 10px;
|
|
29
28
|
|
|
30
|
-
transform: translate(-50%, -50%);
|
|
31
|
-
|
|
32
29
|
pointer-events: none;
|
|
33
30
|
|
|
34
31
|
fill: currentColor;
|
|
32
|
+
|
|
33
|
+
transform: translate(-50%, -50%);
|
|
35
34
|
`
|
|
36
35
|
|
|
37
36
|
const Selector = styled.input<SelectionStyleProps>`
|
|
38
|
-
${transition()}
|
|
39
|
-
|
|
40
37
|
display: inline-flex;
|
|
41
38
|
flex-flow: row nowrap;
|
|
42
39
|
align-items: center;
|
|
43
40
|
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
|
|
46
|
-
appearance: none;
|
|
47
|
-
|
|
48
|
-
outline: none;
|
|
49
|
-
|
|
50
|
-
color: white;
|
|
51
|
-
|
|
52
|
-
height: ${token('radio-small-selector-size')};
|
|
53
41
|
width: ${token('radio-small-selector-size')};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
border-style: solid;
|
|
58
|
-
|
|
42
|
+
height: ${token('radio-small-selector-size')};
|
|
43
|
+
color: white;
|
|
44
|
+
cursor: pointer;
|
|
59
45
|
background: ${conditional({
|
|
60
46
|
'radio-selector-background': whenProps({ scheme: 'light' }),
|
|
61
47
|
'radio-dark-selector-background': whenProps({ scheme: 'dark' }),
|
|
62
48
|
})};
|
|
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()}
|
|
63
55
|
|
|
64
56
|
&:not(:checked) {
|
|
65
57
|
border-color: ${conditional({
|
|
@@ -12,18 +12,16 @@ const StyledSection = styled.section`
|
|
|
12
12
|
`
|
|
13
13
|
|
|
14
14
|
const StyledSectionTitle = styled.section`
|
|
15
|
-
${
|
|
16
|
-
|
|
17
|
-
height: 'font-height-2',
|
|
18
|
-
})}
|
|
19
|
-
|
|
15
|
+
padding: ${token('space-s')} ${token('space-xs')};
|
|
16
|
+
margin-bottom: ${token('space-l')};
|
|
20
17
|
font-size: ${token('font-size-3')};
|
|
21
18
|
color: ${token('color-neutral-darker')};
|
|
22
|
-
|
|
23
19
|
border-bottom: 2px solid ${token('color-neutral-light')};
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
${font({
|
|
22
|
+
weight: 'font-weight-bold',
|
|
23
|
+
height: 'font-height-2',
|
|
24
|
+
})}
|
|
27
25
|
`
|
|
28
26
|
|
|
29
27
|
const StyledSpan = styled.span`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import EventLike from 'utils/types/EventLike'
|
|
2
|
+
import type EventLike from 'utils/types/EventLike'
|
|
3
3
|
|
|
4
4
|
import type { DropdownMenuItemProps, DropdownProps } from 'components/Dropdown'
|
|
5
5
|
import type { TextFieldProps } from 'components/TextField'
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
SelectableKeyType,
|
|
10
10
|
SelectableState,
|
|
11
11
|
} from 'hooks/useSelectable'
|
|
12
|
-
import { useSelectableReturn } from 'hooks/useSelectable/useSelectable.types'
|
|
12
|
+
import type { useSelectableReturn } from 'hooks/useSelectable/useSelectable.types'
|
|
13
13
|
import type { ChangeEvent, ComponentType, FocusEvent, HTMLAttributes } from 'react'
|
|
14
14
|
|
|
15
15
|
export type Option = Selectable
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
import { Dropdown } from 'components/Dropdown'
|
|
3
3
|
import { SelectContext } from './Select.context'
|
|
4
|
-
import { SelectCreatableOptionProps } from './Select.types'
|
|
4
|
+
import type { SelectCreatableOptionProps } from './Select.types'
|
|
5
5
|
|
|
6
6
|
function SelectCreatableOption({ children, ...rest }: SelectCreatableOptionProps): JSX.Element {
|
|
7
7
|
const select =
|
|
@@ -2,23 +2,22 @@ import React from 'react'
|
|
|
2
2
|
import styled from 'styled-components'
|
|
3
3
|
|
|
4
4
|
import { getToken as token } from 'theming'
|
|
5
|
-
import { SelectEmptyProps } from './Select.types'
|
|
5
|
+
import type { SelectEmptyProps } from './Select.types'
|
|
6
6
|
|
|
7
7
|
const Wrapper = styled.div`
|
|
8
|
+
box-sizing: border-box;
|
|
8
9
|
display: flex;
|
|
9
10
|
flex-direction: column;
|
|
10
11
|
align-items: flex-start;
|
|
11
12
|
justify-content: center;
|
|
12
|
-
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
margin: 0 ${token('space-s')};
|
|
15
13
|
padding: ${token('space-s')};
|
|
16
|
-
|
|
17
|
-
color: ${token('color-neutral')};
|
|
14
|
+
margin: 0 ${token('space-s')};
|
|
18
15
|
|
|
19
16
|
font-size: 1em;
|
|
20
17
|
line-height: ${token('font-height-3')};
|
|
21
18
|
|
|
19
|
+
color: ${token('color-neutral')};
|
|
20
|
+
|
|
22
21
|
background: ${token('color-transparent')};
|
|
23
22
|
`
|
|
24
23
|
|
|
@@ -3,7 +3,7 @@ import { render, screen, waitFor } from '@testing-library/react'
|
|
|
3
3
|
import SelectOption from './SelectOption'
|
|
4
4
|
import { SelectContext } from './Select.context'
|
|
5
5
|
import useSelect from './useSelect'
|
|
6
|
-
import { Option, SelectOptionProps, SelectProps, useSelectReturn } from './Select.types'
|
|
6
|
+
import type { Option, SelectOptionProps, SelectProps, useSelectReturn } from './Select.types'
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
9
9
|
optionProps: SelectOptionProps
|
|
@@ -13,19 +13,14 @@ const GenericSelectTrigger = styled(GenericDropdownTrigger)`
|
|
|
13
13
|
`
|
|
14
14
|
|
|
15
15
|
const SelectTriggerSearchField = styled(TextField)`
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`}
|
|
19
|
-
|
|
16
|
+
flex: 1;
|
|
17
|
+
height: 100%;
|
|
20
18
|
background-color: transparent;
|
|
21
|
-
|
|
22
19
|
border: none;
|
|
23
20
|
border-radius: ${token('border-radius-s')} 0 0 ${token('border-radius-s')};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
flex: 1;
|
|
28
|
-
|
|
21
|
+
${focusable`
|
|
22
|
+
box-shadow: none;
|
|
23
|
+
`}
|
|
29
24
|
${Trailing} {
|
|
30
25
|
margin: 0 ${token('space-xs')} 0 0;
|
|
31
26
|
}
|
|
@@ -37,8 +32,8 @@ const Separator = styled.span`
|
|
|
37
32
|
margin: 0;
|
|
38
33
|
|
|
39
34
|
border-right-color: ${token('color-neutral-light')};
|
|
40
|
-
border-right-width: 1px;
|
|
41
35
|
border-right-style: solid;
|
|
36
|
+
border-right-width: 1px;
|
|
42
37
|
`
|
|
43
38
|
|
|
44
39
|
const SelectTrigger = forwardRef<HTMLInputElement, SelectTriggerProps>(function SelectTrigger(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Components, CreatableOptionType } from './Select.types'
|
|
1
|
+
import type { Components, CreatableOptionType } from './Select.types'
|
|
2
2
|
import SelectCreatableOption from './SelectCreatableOption'
|
|
3
3
|
import SelectEmpty from './SelectEmpty'
|
|
4
4
|
import SelectOption from './SelectOption'
|
|
@@ -7,7 +7,7 @@ import isEmpty from 'utils/toolset/isEmpty'
|
|
|
7
7
|
import { useDropdown } from 'components/Dropdown'
|
|
8
8
|
import { useDidMount } from 'hooks/useDidMount'
|
|
9
9
|
import { useFocusTrap } from 'hooks/useFocusTrap'
|
|
10
|
-
import { SelectableKeyType } from 'hooks/useSelectable'
|
|
10
|
+
import type { SelectableKeyType } from 'hooks/useSelectable'
|
|
11
11
|
import to from 'utils/toolset/awaitTo'
|
|
12
12
|
import { isThenable } from 'utils/toolset/isThenable'
|
|
13
13
|
import toArray from 'utils/toolset/toArray'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useContext } from 'react'
|
|
2
2
|
|
|
3
3
|
import { SelectContext } from './Select.context'
|
|
4
|
-
import { Option, useSelectExternalReturn } from './Select.types'
|
|
4
|
+
import type { Option, useSelectExternalReturn } from './Select.types'
|
|
5
5
|
|
|
6
6
|
export function useSelectExternal(): useSelectExternalReturn {
|
|
7
7
|
const select =
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import { Menu } from './'
|
|
4
|
-
import { MenuProps } from './Menu'
|
|
4
|
+
import type { MenuProps } from './Menu'
|
|
5
5
|
import renderer, { screen } from '../../../../tests/renderer'
|
|
6
6
|
import generator from '../../../../tests/generator'
|
|
7
7
|
import userEvent from '@testing-library/user-event'
|
|
@@ -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
|
-
|
|
17
|
-
color: ${token('color-neutral')};
|
|
18
|
-
font-weight: ${token('font-weight-bold')};
|
|
19
16
|
font-size: ${token('font-size-5')};
|
|
17
|
+
font-weight: ${token('font-weight-bold')};
|
|
20
18
|
line-height: ${token('font-height-3')};
|
|
19
|
+
|
|
20
|
+
color: ${token('color-neutral')};
|
|
21
21
|
text-transform: uppercase;
|
|
22
22
|
`
|
|
23
23
|
|
|
@@ -17,23 +17,22 @@ export type MenuBaseItemProps = HTMLAttributes<HTMLElement> & {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const StyledMenuItem = styled.button`
|
|
20
|
-
${transition({ duration: '0.25s' })};
|
|
21
|
-
|
|
22
20
|
display: flex;
|
|
23
|
-
width: 100%;
|
|
24
21
|
align-items: center;
|
|
25
22
|
justify-content: space-between;
|
|
23
|
+
width: 100%;
|
|
26
24
|
padding: ${token('space-s')} 0;
|
|
27
25
|
padding-right: ${rem('12px')};
|
|
28
26
|
padding-left: ${token('space-l')};
|
|
29
27
|
|
|
30
|
-
color: ${token('color-neutral-white')};
|
|
31
|
-
font-weight: ${token('font-weight-bold')};
|
|
32
28
|
font-size: ${token('font-size-4')};
|
|
29
|
+
font-weight: ${token('font-weight-bold')};
|
|
33
30
|
line-height: ${token('font-height-3')};
|
|
31
|
+
color: ${token('color-neutral-white')};
|
|
34
32
|
|
|
35
33
|
cursor: pointer;
|
|
36
34
|
|
|
35
|
+
${transition({ duration: '0.25s' })};
|
|
37
36
|
${focusable`
|
|
38
37
|
color: ${token('color-primary')};
|
|
39
38
|
`}
|
|
@@ -35,11 +35,10 @@ const StyledIcon = styled(Icon)<IExpandable>`
|
|
|
35
35
|
`
|
|
36
36
|
|
|
37
37
|
const ExpandableItems = styled.div<IExpandable>`
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
${transition({ property: 'height' })}
|
|
40
|
-
|
|
41
38
|
height: ${prop('$height', 0)}px;
|
|
39
|
+
overflow: hidden;
|
|
42
40
|
|
|
41
|
+
${transition({ property: 'height' })}
|
|
43
42
|
${MenuLink} {
|
|
44
43
|
padding-left: ${token('space-xl')};
|
|
45
44
|
}
|
|
@@ -60,32 +60,18 @@ 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
|
-
|
|
75
63
|
display: flex;
|
|
76
|
-
justify-content: center;
|
|
77
64
|
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
width: ${token('steps-indicator-size')};
|
|
67
|
+
height: ${token('steps-indicator-size')};
|
|
68
|
+
font-size: ${token('font-size-4')};
|
|
78
69
|
|
|
79
|
-
|
|
80
|
-
border-style: solid;
|
|
81
|
-
border-color: ${conditional({
|
|
82
|
-
'color-accent': whenProps([
|
|
83
|
-
{ current: true, complete: [true, false] },
|
|
84
|
-
{ current: false, complete: true },
|
|
85
|
-
]),
|
|
70
|
+
color: ${conditional({
|
|
86
71
|
'color-neutral': whenProps({ current: false, complete: false }),
|
|
72
|
+
'color-neutral-white': whenProps({ current: false, complete: true }),
|
|
73
|
+
'color-accent': whenProps({ current: true }),
|
|
87
74
|
})};
|
|
88
|
-
border-radius: ${token('border-radius-circle')};
|
|
89
75
|
|
|
90
76
|
background: ${conditional({
|
|
91
77
|
'color-accent': whenProps([{ current: false, complete: true }]),
|
|
@@ -95,41 +81,47 @@ const StepIndicator = styled.span<{ current: boolean; complete: boolean }>`
|
|
|
95
81
|
]),
|
|
96
82
|
})};
|
|
97
83
|
|
|
98
|
-
color: ${conditional({
|
|
84
|
+
border-color: ${conditional({
|
|
85
|
+
'color-accent': whenProps([
|
|
86
|
+
{ current: true, complete: [true, false] },
|
|
87
|
+
{ current: false, complete: true },
|
|
88
|
+
]),
|
|
99
89
|
'color-neutral': whenProps({ current: false, complete: false }),
|
|
100
|
-
'color-neutral-white': whenProps({ current: false, complete: true }),
|
|
101
|
-
'color-accent': whenProps({ current: true }),
|
|
102
90
|
})};
|
|
103
|
-
|
|
91
|
+
border-style: solid;
|
|
92
|
+
border-width: 2px;
|
|
93
|
+
border-radius: ${token('border-radius-circle')};
|
|
104
94
|
|
|
105
|
-
|
|
95
|
+
${transition()}
|
|
106
96
|
${font({
|
|
107
|
-
|
|
97
|
+
weight: 'font-weight-bold',
|
|
98
|
+
height: 'steps-indicator-size',
|
|
108
99
|
})}
|
|
100
|
+
`
|
|
109
101
|
|
|
102
|
+
const StepLabel = styled.span<{ current: boolean; complete: boolean }>`
|
|
110
103
|
position: relative;
|
|
111
104
|
|
|
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')};
|
|
112
113
|
font-weight: ${conditional({
|
|
113
114
|
'font-weight-medium': whenProps({ current: false }),
|
|
114
115
|
'font-weight-bold': whenProps({ current: true }),
|
|
115
116
|
})};
|
|
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
|
-
|
|
130
121
|
text-align: center;
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
${font({
|
|
123
|
+
height: 'font-height-2',
|
|
124
|
+
})}
|
|
133
125
|
`
|
|
134
126
|
|
|
135
127
|
function ProgressStep(props: { step: Step; current: boolean; indicator: ReactNode }): JSX.Element {
|