@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
|
@@ -24,19 +24,8 @@ export interface SwitchProps extends InputHTMLAttributes<HTMLInputElement>, With
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const SwitchWrapper = styled.label<WithAdditionalProps>`
|
|
27
|
-
${transition()}
|
|
28
|
-
|
|
29
|
-
${font({})};
|
|
30
|
-
|
|
31
|
-
user-select: none;
|
|
32
|
-
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
-webkit-tap-highlight-color: transparent;
|
|
35
|
-
|
|
36
27
|
position: relative;
|
|
37
|
-
|
|
38
28
|
display: inline-flex;
|
|
39
|
-
|
|
40
29
|
width: ${conditional({
|
|
41
30
|
'switch-width': whenProps({ scale: 'default' }),
|
|
42
31
|
'switch-large-width': whenProps({ scale: 'large' }),
|
|
@@ -45,28 +34,28 @@ const SwitchWrapper = styled.label<WithAdditionalProps>`
|
|
|
45
34
|
'switch-height': whenProps({ scale: 'default' }),
|
|
46
35
|
'switch-large-height': whenProps({ scale: 'large' }),
|
|
47
36
|
})};
|
|
48
|
-
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
user-select: none;
|
|
39
|
+
-webkit-tap-highlight-color: transparent;
|
|
49
40
|
background-color: ${conditional({
|
|
50
41
|
'switch-inactive-background-color': whenProps({ active: false }),
|
|
51
42
|
'switch-active-background-color': whenProps({ active: true }),
|
|
52
43
|
})};
|
|
53
|
-
|
|
54
44
|
border-radius: ${conditional({
|
|
55
45
|
'switch-border-radius': whenProps({ scale: 'default' }),
|
|
56
46
|
'switch-large-border-radius': whenProps({ scale: 'large' }),
|
|
57
47
|
})};
|
|
58
|
-
|
|
48
|
+
${transition()}
|
|
49
|
+
${font({})};
|
|
59
50
|
${hoverable`
|
|
60
51
|
background: ${conditional({
|
|
61
52
|
'switch-inactive-background-color--hover': whenProps({ active: false }),
|
|
62
53
|
'switch-active-background-color--hover': whenProps({ active: true }),
|
|
63
54
|
})};
|
|
64
55
|
`}
|
|
65
|
-
|
|
66
56
|
${focusable`
|
|
67
57
|
box-shadow: ${token('switch-outline')}
|
|
68
58
|
`}
|
|
69
|
-
|
|
70
59
|
${disableable``}
|
|
71
60
|
`
|
|
72
61
|
|
|
@@ -102,6 +91,7 @@ const Slider = styled.span<WithAdditionalProps>`
|
|
|
102
91
|
'switch-slider-large-size': whenProps({ scale: 'large' }),
|
|
103
92
|
})};
|
|
104
93
|
|
|
94
|
+
content: '';
|
|
105
95
|
background-color: ${token('switch-slider-background-color')};
|
|
106
96
|
border-radius: ${token('switch-slider-border-radius')};
|
|
107
97
|
|
|
@@ -109,8 +99,6 @@ const Slider = styled.span<WithAdditionalProps>`
|
|
|
109
99
|
timingFunction: 'ease-out',
|
|
110
100
|
duration: '150ms',
|
|
111
101
|
})}
|
|
112
|
-
|
|
113
|
-
content: '';
|
|
114
102
|
}
|
|
115
103
|
`
|
|
116
104
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
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 Table, { useSelection } from './Table'
|
|
6
6
|
import type { TableColumns, TableProps } from './Table.types'
|
|
@@ -152,10 +152,10 @@ const StyledTable = styled.table<{ scale?: string }>`
|
|
|
152
152
|
|
|
153
153
|
white-space: nowrap;
|
|
154
154
|
|
|
155
|
-
background-color: ${token('color-neutral-white')};
|
|
156
|
-
|
|
157
155
|
border-collapse: collapse;
|
|
158
156
|
|
|
157
|
+
background-color: ${token('color-neutral-white')};
|
|
158
|
+
|
|
159
159
|
${StyledTableBody} ${StyledTableRow},
|
|
160
160
|
${StyledTableBody} ${StyledExpandableTableRow} {
|
|
161
161
|
height: ${conditional({
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { Selectable } from 'hooks/useSelectable'
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import type { Selectable } from 'hooks/useSelectable'
|
|
2
|
+
import type {
|
|
3
|
+
ComponentType,
|
|
4
|
+
HTMLAttributes,
|
|
5
|
+
PropsWithChildren,
|
|
6
|
+
ReactNode,
|
|
7
|
+
ReactElement,
|
|
8
|
+
} from 'react'
|
|
4
9
|
import type { DropdownMenuItemProps, DropdownMenuProps } from 'components/Dropdown'
|
|
5
10
|
import type { DropdownTriggerButtonProps } from 'components/Dropdown/DropdownTrigger'
|
|
6
11
|
|
|
@@ -26,7 +31,7 @@ export interface TableSelectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
26
31
|
export interface SelectionCellProps<T extends Selectable = TableSelectableRow>
|
|
27
32
|
extends HTMLAttributes<HTMLTableCellElement> {
|
|
28
33
|
value?: T
|
|
29
|
-
children?: (props: { selected: boolean; toggle: () => void }) =>
|
|
34
|
+
children?: (props: { selected: boolean; toggle: () => void }) => ReactElement
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
export interface TableSectionProps extends HTMLAttributes<HTMLTableSectionElement> {
|
|
@@ -4,7 +4,7 @@ import styled from 'styled-components'
|
|
|
4
4
|
import { getToken as token } from 'theming'
|
|
5
5
|
import { Icon } from 'components/Icon'
|
|
6
6
|
import { Box as DefaultBox } from 'components/Layout'
|
|
7
|
-
import { SortDirection } from './useSortBy.types'
|
|
7
|
+
import type { SortDirection } from './useSortBy.types'
|
|
8
8
|
|
|
9
9
|
import type { BoxProps } from 'components/Layout/Box'
|
|
10
10
|
|
|
@@ -3,8 +3,8 @@ import { Text } from 'components/Text'
|
|
|
3
3
|
import { Dropdown, DropdownContext } from 'components/Dropdown'
|
|
4
4
|
import { Layout } from 'components/Layout'
|
|
5
5
|
import { Icon } from 'components/Icon'
|
|
6
|
-
import { RowsPerPageProps } from './TablePagination.types'
|
|
7
|
-
import { ButtonProps } from 'components/Button'
|
|
6
|
+
import type { RowsPerPageProps } from './TablePagination.types'
|
|
7
|
+
import type { ButtonProps } from 'components/Button'
|
|
8
8
|
import { NoPaddingButton } from './TablePagination.styles'
|
|
9
9
|
|
|
10
10
|
const TriggerButton = (props: Omit<ButtonProps, 'scale' | 'variant'>) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import TablePagination from './TablePagination'
|
|
3
|
-
import { Meta, Story } from '@storybook/react/types-6-0'
|
|
3
|
+
import type { Meta, Story } from '@storybook/react/types-6-0'
|
|
4
4
|
|
|
5
5
|
import type { TablePaginationProps } from './TablePagination.types'
|
|
6
6
|
import { Layout } from 'components/Layout'
|
|
@@ -4,7 +4,7 @@ import React from 'react'
|
|
|
4
4
|
import renderer, { screen } from '../../../tests/renderer'
|
|
5
5
|
|
|
6
6
|
import TablePagination from './TablePagination'
|
|
7
|
-
import { TablePaginationProps } from './TablePagination.types'
|
|
7
|
+
import type { TablePaginationProps } from './TablePagination.types'
|
|
8
8
|
|
|
9
9
|
describe('TablePagination', () => {
|
|
10
10
|
const setup = ({ ...overrides }: Partial<TablePaginationProps> = {}) => {
|
|
@@ -3,7 +3,7 @@ import React, { ChangeEvent, KeyboardEvent, useEffect, useState } from 'react'
|
|
|
3
3
|
import { Layout } from 'components/Layout'
|
|
4
4
|
import { Text } from 'components/Text'
|
|
5
5
|
import { TextField } from 'components/TextField'
|
|
6
|
-
import { TablePaginationActionsProps } from 'components/TablePagination/TablePagination.types'
|
|
6
|
+
import type { TablePaginationActionsProps } from 'components/TablePagination/TablePagination.types'
|
|
7
7
|
import styled from 'styled-components'
|
|
8
8
|
import { Icon, IconProps } from 'components/Icon'
|
|
9
9
|
import Keyboard from 'utils/toolset/keyboard'
|
|
@@ -26,8 +26,8 @@ const TabsItemsWrapper = styled.ul`
|
|
|
26
26
|
padding: 0;
|
|
27
27
|
|
|
28
28
|
border-bottom-color: ${token('color-neutral-lighter')};
|
|
29
|
-
border-bottom-width: 2px;
|
|
30
29
|
border-bottom-style: solid;
|
|
30
|
+
border-bottom-width: 2px;
|
|
31
31
|
`
|
|
32
32
|
|
|
33
33
|
const StyledSpan = styled.span`
|
|
@@ -48,50 +48,44 @@ const Leading = styled(StyledSpan)`
|
|
|
48
48
|
`
|
|
49
49
|
|
|
50
50
|
const StyledLabel = styled.label<WithActiveProps & WithDirectionProps>`
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
weight: 'font-weight-bold',
|
|
54
|
-
})}
|
|
55
|
-
${transition()}
|
|
56
|
-
|
|
57
|
-
font-size: ${token('font-size-4')};
|
|
58
|
-
text-transform: uppercase;
|
|
59
|
-
|
|
60
|
-
${hoverable`
|
|
61
|
-
color: ${token('color-neutral-darker')};
|
|
62
|
-
background-color: ${token('color-neutral-light')}33;
|
|
63
|
-
`}
|
|
64
|
-
|
|
65
|
-
${disableable`
|
|
66
|
-
color: ${token('color-neutral-dark')}33;
|
|
67
|
-
background-color: ${token('color-neutral-light')}33;
|
|
68
|
-
`}
|
|
69
|
-
|
|
70
|
-
padding: ${token('space-m')} ${token('space-l')};
|
|
51
|
+
position: relative;
|
|
52
|
+
bottom: -2px;
|
|
71
53
|
display: inline-flex;
|
|
72
54
|
flex-direction: ${conditional({
|
|
73
55
|
row: whenProps({ direction: 'horizontal' }),
|
|
74
56
|
column: whenProps({ direction: 'vertical' }),
|
|
75
57
|
})};
|
|
58
|
+
padding: ${token('space-m')} ${token('space-l')};
|
|
59
|
+
font-size: ${token('font-size-4')};
|
|
76
60
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
61
|
+
color: ${conditional({
|
|
62
|
+
'color-neutral': whenProps({ active: false }),
|
|
63
|
+
'neutral-darker': whenProps({ active: true }),
|
|
64
|
+
})};
|
|
65
|
+
text-transform: uppercase;
|
|
81
66
|
|
|
82
|
-
|
|
83
|
-
border-bottom-style: solid;
|
|
67
|
+
cursor: pointer;
|
|
84
68
|
|
|
85
69
|
border-color: ${conditional({
|
|
86
70
|
'color-transparent': whenProps({ active: false }),
|
|
87
71
|
'color-primary': whenProps({ active: true }),
|
|
88
72
|
})};
|
|
73
|
+
border-bottom-style: solid;
|
|
74
|
+
border-bottom-width: 2px;
|
|
89
75
|
|
|
90
|
-
|
|
91
|
-
'
|
|
92
|
-
'
|
|
93
|
-
})}
|
|
94
|
-
|
|
76
|
+
${font({
|
|
77
|
+
height: 'font-height-2',
|
|
78
|
+
weight: 'font-weight-bold',
|
|
79
|
+
})}
|
|
80
|
+
${transition()}
|
|
81
|
+
${hoverable`
|
|
82
|
+
color: ${token('color-neutral-darker')};
|
|
83
|
+
background-color: ${token('color-neutral-light')}33;
|
|
84
|
+
`}
|
|
85
|
+
${disableable`
|
|
86
|
+
color: ${token('color-neutral-dark')}33;
|
|
87
|
+
background-color: ${token('color-neutral-light')}33;
|
|
88
|
+
`}
|
|
95
89
|
${Leading} + ${Children} {
|
|
96
90
|
margin: ${conditional({
|
|
97
91
|
'0': whenProps({ direction: 'horizontal' }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Tag, { TagProps } from './Tag'
|
|
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 as MirandaIcon } from '../Icon'
|
|
6
6
|
import generator from '../../../tests/generator'
|
|
@@ -39,44 +39,28 @@ export interface TagProps extends React.HTMLAttributes<HTMLElement>, WithSizePro
|
|
|
39
39
|
|
|
40
40
|
// styled elements
|
|
41
41
|
const StyledTag = styled.span`
|
|
42
|
-
display: inline-flex;
|
|
43
|
-
|
|
44
42
|
position: relative;
|
|
43
|
+
z-index: 0;
|
|
44
|
+
display: inline-flex;
|
|
45
45
|
|
|
46
46
|
width: auto;
|
|
47
47
|
|
|
48
|
-
z-index: 0;
|
|
49
|
-
|
|
50
48
|
${disableable`
|
|
51
49
|
opacity: ${token('opacity-60')};
|
|
52
50
|
`}
|
|
53
51
|
`
|
|
54
52
|
|
|
55
53
|
const StyledSpan = styled.span<TagProps>`
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
box-sizing: border-box;
|
|
58
55
|
display: inline-flex;
|
|
59
56
|
align-items: center;
|
|
60
57
|
justify-content: center;
|
|
61
58
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
conditional({
|
|
68
|
-
'chips-sm': whenProps({ size: 'small' }),
|
|
69
|
-
'caption-bold': whenProps({ size: 'default' }),
|
|
70
|
-
'body-bold': whenProps({ size: 'large' }),
|
|
71
|
-
})
|
|
72
|
-
)}
|
|
73
|
-
|
|
74
|
-
line-height: initial;
|
|
75
|
-
|
|
76
|
-
text-transform: ${conditional({
|
|
77
|
-
'tag-transform': whenProps({ size: 'default' }),
|
|
78
|
-
'tag-small-transform': whenProps({ size: 'small' }),
|
|
79
|
-
'tag-large-transform': whenProps({ size: 'large' }),
|
|
59
|
+
min-width: ${token('tag-width')};
|
|
60
|
+
height: ${conditional({
|
|
61
|
+
'tag-height': whenProps({ size: 'default' }),
|
|
62
|
+
'tag-small-height': whenProps({ size: 'small' }),
|
|
63
|
+
'tag-large-height': whenProps({ size: 'large' }),
|
|
80
64
|
})};
|
|
81
65
|
|
|
82
66
|
padding: ${conditional({
|
|
@@ -85,13 +69,7 @@ const StyledSpan = styled.span<TagProps>`
|
|
|
85
69
|
'tag-small-spacing-removable': whenProps([{ size: 'small', removable: true }]),
|
|
86
70
|
})};
|
|
87
71
|
|
|
88
|
-
|
|
89
|
-
height: ${conditional({
|
|
90
|
-
'tag-height': whenProps({ size: 'default' }),
|
|
91
|
-
'tag-small-height': whenProps({ size: 'small' }),
|
|
92
|
-
'tag-large-height': whenProps({ size: 'large' }),
|
|
93
|
-
})};
|
|
94
|
-
|
|
72
|
+
line-height: initial;
|
|
95
73
|
color: ${conditional({
|
|
96
74
|
'tag-default-color': whenProps({ variant: 'default' }),
|
|
97
75
|
'tag-outlined-color': whenProps({ variant: 'outlined' }),
|
|
@@ -101,6 +79,14 @@ const StyledSpan = styled.span<TagProps>`
|
|
|
101
79
|
'tag-danger-color': whenProps({ variant: 'danger' }),
|
|
102
80
|
})};
|
|
103
81
|
|
|
82
|
+
text-decoration: none;
|
|
83
|
+
|
|
84
|
+
text-transform: ${conditional({
|
|
85
|
+
'tag-transform': whenProps({ size: 'default' }),
|
|
86
|
+
'tag-small-transform': whenProps({ size: 'small' }),
|
|
87
|
+
'tag-large-transform': whenProps({ size: 'large' }),
|
|
88
|
+
})};
|
|
89
|
+
|
|
104
90
|
background: ${conditional({
|
|
105
91
|
'tag-default-background': whenProps({ variant: 'default' }),
|
|
106
92
|
'tag-outlined-background': whenProps({ variant: 'outlined' }),
|
|
@@ -110,10 +96,6 @@ const StyledSpan = styled.span<TagProps>`
|
|
|
110
96
|
'tag-danger-background': whenProps({ variant: 'danger' }),
|
|
111
97
|
})};
|
|
112
98
|
|
|
113
|
-
border-radius: ${token('tag-border-radius')};
|
|
114
|
-
border-width: ${token('tag-border-width')};
|
|
115
|
-
border-style: solid;
|
|
116
|
-
|
|
117
99
|
border-color: ${conditional({
|
|
118
100
|
'tag-default-border-color': whenProps({ variant: 'default' }),
|
|
119
101
|
'tag-outlined-border-color': whenProps({ variant: 'outlined' }),
|
|
@@ -122,7 +104,18 @@ const StyledSpan = styled.span<TagProps>`
|
|
|
122
104
|
'tag-warning-border-color': whenProps({ variant: 'warning' }),
|
|
123
105
|
'tag-danger-border-color': whenProps({ variant: 'danger' }),
|
|
124
106
|
})};
|
|
107
|
+
border-style: solid;
|
|
108
|
+
border-width: ${token('tag-border-width')};
|
|
109
|
+
border-radius: ${token('tag-border-radius')};
|
|
125
110
|
|
|
111
|
+
${transition()}
|
|
112
|
+
${typography(
|
|
113
|
+
conditional({
|
|
114
|
+
'chips-sm': whenProps({ size: 'small' }),
|
|
115
|
+
'caption-bold': whenProps({ size: 'default' }),
|
|
116
|
+
'body-bold': whenProps({ size: 'large' }),
|
|
117
|
+
})
|
|
118
|
+
)}
|
|
126
119
|
${hoverable`
|
|
127
120
|
background: ${conditional({
|
|
128
121
|
'tag-default-background--hover': whenProps([
|
|
@@ -205,7 +198,6 @@ const StyledSpan = styled.span<TagProps>`
|
|
|
205
198
|
]),
|
|
206
199
|
})};
|
|
207
200
|
`}
|
|
208
|
-
|
|
209
201
|
${focusable`
|
|
210
202
|
color: ${conditional({
|
|
211
203
|
'tag-default-color--focus': whenProps({ variant: 'default' }),
|
|
@@ -225,7 +217,6 @@ const StyledSpan = styled.span<TagProps>`
|
|
|
225
217
|
})};
|
|
226
218
|
box-shadow: ${token('tag-outline')};
|
|
227
219
|
`}
|
|
228
|
-
|
|
229
220
|
${disableable`
|
|
230
221
|
opacity: ${token('opacity-60')};
|
|
231
222
|
`}
|
|
@@ -248,14 +239,8 @@ const StyledCloseButton = styled.button<WithSizeProps & WithVariantProps>`
|
|
|
248
239
|
z-index: 2;
|
|
249
240
|
|
|
250
241
|
display: inline-flex;
|
|
251
|
-
justify-content: center;
|
|
252
242
|
align-items: center;
|
|
253
|
-
|
|
254
|
-
cursor: pointer;
|
|
255
|
-
|
|
256
|
-
background: ${token('tag-remove-button-background')};
|
|
257
|
-
border-radius: ${token('tag-remove-button-border-radius')};
|
|
258
|
-
border: 0;
|
|
243
|
+
justify-content: center;
|
|
259
244
|
|
|
260
245
|
width: ${conditional({
|
|
261
246
|
'tag-remove-button-size': whenProps({ size: 'default' }),
|
|
@@ -271,6 +256,12 @@ const StyledCloseButton = styled.button<WithSizeProps & WithVariantProps>`
|
|
|
271
256
|
|
|
272
257
|
padding: 0;
|
|
273
258
|
|
|
259
|
+
cursor: pointer;
|
|
260
|
+
|
|
261
|
+
background: ${token('tag-remove-button-background')};
|
|
262
|
+
border: 0;
|
|
263
|
+
border-radius: ${token('tag-remove-button-border-radius')};
|
|
264
|
+
|
|
274
265
|
${disableable`
|
|
275
266
|
opacity: ${token('opacity-60')};
|
|
276
267
|
`}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import TextField, { TextFieldProps } from './TextField'
|
|
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 Status from 'utils/types/Status'
|
|
@@ -4,7 +4,7 @@ import clsx from 'clsx'
|
|
|
4
4
|
|
|
5
5
|
import { getToken as token } from 'theming'
|
|
6
6
|
import { useFocusWithin } from 'hooks/useFocusWithin'
|
|
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 focusable from 'styles/focusable'
|
|
@@ -34,12 +34,12 @@ const InputWrapper = styled.div<WithAdditionalProps>`
|
|
|
34
34
|
display: inline-flex;
|
|
35
35
|
flex-flow: row nowrap;
|
|
36
36
|
|
|
37
|
+
min-width: 0;
|
|
37
38
|
height: ${conditional({
|
|
38
39
|
'text-field-height': whenProps({ scale: 'default' }),
|
|
39
40
|
'text-field-small-height': whenProps({ scale: 'small' }),
|
|
40
41
|
'text-field-large-height': whenProps({ scale: 'large' }),
|
|
41
42
|
})};
|
|
42
|
-
min-width: 0;
|
|
43
43
|
|
|
44
44
|
${font({
|
|
45
45
|
height: 'text-field-font-height',
|
|
@@ -51,10 +51,10 @@ const InputWrapper = styled.div<WithAdditionalProps>`
|
|
|
51
51
|
'text-field-large-font-size': whenProps({ scale: 'large' }),
|
|
52
52
|
})};
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
color: ${conditional({
|
|
55
|
+
'text-field-color': whenProps({ scheme: 'light' }),
|
|
56
|
+
'text-field-dark-color': whenProps({ scheme: 'dark' }),
|
|
57
|
+
})};
|
|
58
58
|
background: ${conditional({
|
|
59
59
|
'text-field-background': whenProps({ scheme: 'light' }),
|
|
60
60
|
'text-field-dark-background': whenProps({ scheme: 'dark' }),
|
|
@@ -66,11 +66,9 @@ const InputWrapper = styled.div<WithAdditionalProps>`
|
|
|
66
66
|
'text-field-danger-border-color': whenProps({ status: Status.Danger }),
|
|
67
67
|
'text-field-success-border-color': whenProps({ status: Status.Success }),
|
|
68
68
|
})};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
'text-field-dark-color': whenProps({ scheme: 'dark' }),
|
|
73
|
-
})};
|
|
69
|
+
border-style: solid;
|
|
70
|
+
border-width: 1px;
|
|
71
|
+
border-radius: ${token('text-field-border-radius')};
|
|
74
72
|
|
|
75
73
|
${hoverable`
|
|
76
74
|
background: ${conditional({
|
|
@@ -138,14 +136,8 @@ export const Trailing = styled(StyledSpan)<WithAdditionalProps>`
|
|
|
138
136
|
`
|
|
139
137
|
|
|
140
138
|
const StyledInput = styled.input<WithAdditionalProps>`
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
${font({
|
|
144
|
-
height: 'text-field-font-height',
|
|
145
|
-
})}
|
|
146
|
-
|
|
147
|
-
background: transparent;
|
|
148
|
-
|
|
139
|
+
flex: 1;
|
|
140
|
+
min-width: 0;
|
|
149
141
|
padding: ${conditional({
|
|
150
142
|
'text-field-padding-y': whenProps({ scale: 'default' }),
|
|
151
143
|
'text-field-small-padding-y': whenProps({ scale: 'small' }),
|
|
@@ -159,12 +151,13 @@ const StyledInput = styled.input<WithAdditionalProps>`
|
|
|
159
151
|
'text-field-small-padding-x': whenProps({ scale: 'small' }),
|
|
160
152
|
})};
|
|
161
153
|
|
|
154
|
+
background: transparent;
|
|
162
155
|
border: none;
|
|
163
156
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
157
|
+
${transition()}
|
|
158
|
+
${font({
|
|
159
|
+
height: 'text-field-font-height',
|
|
160
|
+
})}
|
|
168
161
|
${focusable()}
|
|
169
162
|
${disableable()}
|
|
170
163
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, ChangeEvent } from 'react'
|
|
2
2
|
import Textarea, { TextareaProps } from './Textarea'
|
|
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 Status from 'utils/types/Status'
|
|
@@ -4,7 +4,7 @@ import clsx from 'clsx'
|
|
|
4
4
|
|
|
5
5
|
import { getToken as token } from 'theming'
|
|
6
6
|
import { useFocusWithin } from 'hooks/useFocusWithin'
|
|
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 focusable from 'styles/focusable'
|
|
@@ -48,9 +48,10 @@ const TextareaWrapper = styled.div<WithAdditionalProps>`
|
|
|
48
48
|
'textarea-large-font-size': whenProps({ scale: 'large' }),
|
|
49
49
|
})};
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
color: ${conditional({
|
|
52
|
+
'textarea-color': whenProps({ scheme: 'light' }),
|
|
53
|
+
'textarea-dark-color': whenProps({ scheme: 'dark' }),
|
|
54
|
+
})};
|
|
54
55
|
|
|
55
56
|
background: ${conditional({
|
|
56
57
|
'textarea-background': whenProps({ scheme: 'light' }),
|
|
@@ -63,11 +64,9 @@ const TextareaWrapper = styled.div<WithAdditionalProps>`
|
|
|
63
64
|
'textarea-danger-border-color': whenProps({ status: Status.Danger }),
|
|
64
65
|
'textarea-success-border-color': whenProps({ status: Status.Success }),
|
|
65
66
|
})};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'textarea-dark-color': whenProps({ scheme: 'dark' }),
|
|
70
|
-
})};
|
|
67
|
+
border-style: solid;
|
|
68
|
+
border-width: 1px;
|
|
69
|
+
border-radius: ${token('textarea-border-radius')};
|
|
71
70
|
|
|
72
71
|
${hoverable`
|
|
73
72
|
background: ${conditional({
|
|
@@ -120,36 +119,30 @@ const StyledSpan = styled.span<WithAdditionalProps>`
|
|
|
120
119
|
const Leading = styled(StyledSpan)<WithAdditionalProps>`
|
|
121
120
|
align-items: flex-start;
|
|
122
121
|
|
|
122
|
+
padding: ${token('space-s')} 0;
|
|
123
|
+
|
|
123
124
|
margin: 0 0 0
|
|
124
125
|
${conditional({
|
|
125
126
|
'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),
|
|
126
127
|
'text-field-small-padding-x': whenProps({ scale: 'small' }),
|
|
127
128
|
})};
|
|
128
|
-
|
|
129
|
-
padding: ${token('space-s')} 0;
|
|
130
129
|
`
|
|
131
130
|
|
|
132
131
|
const Trailing = styled(StyledSpan)<WithAdditionalProps>`
|
|
133
132
|
align-items: flex-start;
|
|
134
133
|
|
|
134
|
+
padding: ${token('space-s')} 0;
|
|
135
|
+
|
|
135
136
|
margin: 0
|
|
136
137
|
${conditional({
|
|
137
138
|
'text-field-padding-x': whenProps({ scale: ['default', 'large'] }),
|
|
138
139
|
'text-field-small-padding-x': whenProps({ scale: 'small' }),
|
|
139
140
|
})}
|
|
140
141
|
0 0;
|
|
141
|
-
|
|
142
|
-
padding: ${token('space-s')} 0;
|
|
143
142
|
`
|
|
144
143
|
|
|
145
144
|
const StyledTextarea = styled.textarea<WithAdditionalProps>`
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
${font({
|
|
149
|
-
height: 'textarea-font-height',
|
|
150
|
-
})}
|
|
151
|
-
|
|
152
|
-
background: transparent;
|
|
145
|
+
flex: 1 0 auto;
|
|
153
146
|
|
|
154
147
|
padding: ${conditional({
|
|
155
148
|
'textarea-padding-y': whenProps({ scale: 'default' }),
|
|
@@ -157,17 +150,19 @@ const StyledTextarea = styled.textarea<WithAdditionalProps>`
|
|
|
157
150
|
'textarea-large-padding-y': whenProps({ scale: 'large' }),
|
|
158
151
|
})}
|
|
159
152
|
0;
|
|
160
|
-
|
|
161
153
|
margin: 0
|
|
162
154
|
${conditional({
|
|
163
155
|
'textarea-padding-x': whenProps({ scale: ['default', 'large'] }),
|
|
164
156
|
'textarea-small-padding-x': whenProps({ scale: 'small' }),
|
|
165
157
|
})};
|
|
166
158
|
|
|
159
|
+
background: transparent;
|
|
167
160
|
border: none;
|
|
168
161
|
|
|
169
|
-
|
|
170
|
-
|
|
162
|
+
${transition()}
|
|
163
|
+
${font({
|
|
164
|
+
height: 'textarea-font-height',
|
|
165
|
+
})}
|
|
171
166
|
${focusable()}
|
|
172
167
|
${disableable()}
|
|
173
168
|
`
|