@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
|
@@ -23,11 +23,11 @@ const Leading = styled(StyledSpan)`
|
|
|
23
23
|
const Wrapper = styled.div`
|
|
24
24
|
|
|
25
25
|
padding: ${token('card-padding-y')} ${token('card-padding-x')} 0;
|
|
26
|
-
|
|
27
|
-
color: ${token('card-color')};
|
|
28
|
-
font-weight: ${token('card-title-font-weight')};
|
|
29
26
|
font-size: ${token('card-title-font-size')};
|
|
27
|
+
font-weight: ${token('card-title-font-weight')};
|
|
30
28
|
line-height: ${token('card-title-font-height')};
|
|
29
|
+
|
|
30
|
+
color: ${token('card-color')};
|
|
31
31
|
`
|
|
32
32
|
|
|
33
33
|
function CardTitle({ children, leading, ...others }: CardTitleProps): JSX.Element {
|
|
@@ -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({
|
|
@@ -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
|
|
|
@@ -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'
|
|
@@ -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'
|
|
@@ -3,7 +3,7 @@ import { composeStories } from '@storybook/testing-react'
|
|
|
3
3
|
|
|
4
4
|
import * as stories from './HighlightMatch.stories'
|
|
5
5
|
import renderer, { screen } from '../../../tests/renderer'
|
|
6
|
-
import { HighlightMatchProps } from './HighlightMatch'
|
|
6
|
+
import type { HighlightMatchProps } from './HighlightMatch'
|
|
7
7
|
|
|
8
8
|
const { Playground } = composeStories(stories)
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { LabelHTMLAttributes } from 'react'
|
|
2
|
+
import type { LabelHTMLAttributes } from 'react'
|
|
3
3
|
import styled from 'styled-components'
|
|
4
4
|
import clsx from 'clsx'
|
|
5
5
|
import { isNil } from '@loadsmart/utils-object'
|
|
6
6
|
|
|
7
|
-
import ColorScheme from 'utils/types/ColorScheme'
|
|
7
|
+
import type ColorScheme from 'utils/types/ColorScheme'
|
|
8
8
|
import conditional, { whenProps } from 'tools/conditional'
|
|
9
9
|
import disableable from 'styles/disableable'
|
|
10
10
|
import ellipsizable from 'styles/ellipsizable'
|
|
@@ -56,9 +56,9 @@ const StyledChildren = styled.span<WithAdditionalProps>`
|
|
|
56
56
|
|
|
57
57
|
const StyledRequired = styled.sup`
|
|
58
58
|
top: 0;
|
|
59
|
+
font-size: ${token('label-font-size')};
|
|
59
60
|
|
|
60
61
|
color: ${token('label-required-color')};
|
|
61
|
-
font-size: ${token('label-font-size')};
|
|
62
62
|
`
|
|
63
63
|
|
|
64
64
|
const StyledTooltipAnchor = styled.span<WithAdditionalProps>`
|
|
@@ -68,13 +68,13 @@ const StyledTooltipAnchor = styled.span<WithAdditionalProps>`
|
|
|
68
68
|
width: 16px;
|
|
69
69
|
height: 16px;
|
|
70
70
|
margin: 0 0 0 ${token('label-tooltip-margin-left')};
|
|
71
|
+
font-size: ${token('label-tooltip-font-size')};
|
|
72
|
+
font-weight: ${token('label-tooltip-font-weight')};
|
|
71
73
|
|
|
72
74
|
color: ${conditional({
|
|
73
75
|
'label-tooltip-font-color': whenProps({ scheme: 'light' }),
|
|
74
76
|
'label-tooltip-dark-font-color': whenProps({ scheme: 'dark' }),
|
|
75
77
|
})};
|
|
76
|
-
font-weight: ${token('label-tooltip-font-weight')};
|
|
77
|
-
font-size: ${token('label-tooltip-font-size')};
|
|
78
78
|
|
|
79
79
|
background: ${conditional({
|
|
80
80
|
'label-tooltip-background-color': whenProps({ scheme: 'light' }),
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components'
|
|
|
3
3
|
|
|
4
4
|
import { getToken as token } from 'theming'
|
|
5
5
|
import conditional, { whenProps } from 'tools/conditional'
|
|
6
|
-
import { Spacing } from './Layout.types'
|
|
6
|
+
import type { Spacing } from './Layout.types'
|
|
7
7
|
import { getSpace } from './Layout.utils'
|
|
8
8
|
|
|
9
9
|
import type { HTMLAttributes } from 'react'
|
|
@@ -4,7 +4,7 @@ import styled from 'styled-components'
|
|
|
4
4
|
import prop from 'tools/prop'
|
|
5
5
|
|
|
6
6
|
import { getSpace } from 'components/Layout/Layout.utils'
|
|
7
|
-
import { Spacing } from './Layout.types'
|
|
7
|
+
import type { Spacing } from './Layout.types'
|
|
8
8
|
|
|
9
9
|
import type { HTMLAttributes } from 'react'
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import styled from 'styled-components'
|
|
|
4
4
|
import conditional, { whenProps } from 'tools/conditional'
|
|
5
5
|
import prop from 'tools/prop'
|
|
6
6
|
|
|
7
|
-
import { Spacing } from './Layout.types'
|
|
7
|
+
import type { Spacing } from './Layout.types'
|
|
8
8
|
import { getSpace } from './Layout.utils'
|
|
9
9
|
|
|
10
10
|
import type { HTMLAttributes } from 'react'
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import styled from 'styled-components'
|
|
3
3
|
import prop from 'tools/prop'
|
|
4
4
|
|
|
5
|
-
import { Spacing } from './Layout.types'
|
|
5
|
+
import type { Spacing } from './Layout.types'
|
|
6
6
|
import { getSpace } from './Layout.utils'
|
|
7
7
|
|
|
8
8
|
import type { HTMLAttributes } from 'react'
|
|
@@ -17,31 +17,27 @@ export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const StyledBaseAnchor = styled.a`
|
|
20
|
-
${font({
|
|
21
|
-
height: 'link-font-height',
|
|
22
|
-
weight: 'link-font-weight',
|
|
23
|
-
})}
|
|
24
|
-
${transition()}
|
|
25
|
-
|
|
26
|
-
${ellipsizable()}
|
|
27
|
-
|
|
28
20
|
display: inline-flex;
|
|
29
21
|
flex-direction: column;
|
|
30
22
|
align-items: center;
|
|
31
23
|
justify-content: center;
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
min-height: 24px;
|
|
34
26
|
font-size: ${token('link-font-size')};
|
|
35
27
|
color: ${token('color-neutral-darker')};
|
|
28
|
+
text-align: center;
|
|
36
29
|
text-decoration: none;
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
${font({
|
|
32
|
+
height: 'link-font-height',
|
|
33
|
+
weight: 'link-font-weight',
|
|
34
|
+
})}
|
|
35
|
+
${ellipsizable()}
|
|
36
|
+
${transition()}
|
|
40
37
|
${hoverable`
|
|
41
38
|
text-decoration: underline;
|
|
42
39
|
font-weight: ${token('link-font-weight--hover')};
|
|
43
40
|
`}
|
|
44
|
-
|
|
45
41
|
${disableable``}
|
|
46
42
|
|
|
47
43
|
${({ children }) =>
|
|
@@ -53,13 +49,13 @@ const StyledBaseAnchor = styled.a`
|
|
|
53
49
|
overflow: hidden;
|
|
54
50
|
|
|
55
51
|
font-weight: ${token('link-font-weight--hover')};
|
|
52
|
+
pointer-events: none;
|
|
56
53
|
|
|
57
54
|
visibility: hidden;
|
|
58
55
|
|
|
59
56
|
content: attr(data-text);
|
|
60
57
|
content: attr(data-text) / '';
|
|
61
58
|
user-select: none;
|
|
62
|
-
pointer-events: none;
|
|
63
59
|
|
|
64
60
|
@media speech {
|
|
65
61
|
display: none;
|