@superdispatch/ui 0.21.13 → 0.21.14
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/LICENSE +21 -0
- package/{pkg/dist-node → dist-node}/index.js +62 -14
- package/dist-node/index.js.map +1 -0
- package/{pkg/dist-src → dist-src}/index.js +1 -0
- package/dist-src/info-tooltip/InfoTooltip.js +54 -0
- package/{pkg/dist-types → dist-types}/index.d.ts +14 -2
- package/{pkg/dist-web → dist-web}/index.js +64 -17
- package/dist-web/index.js.map +1 -0
- package/package.json +12 -38
- package/.babelrc.js +0 -5
- package/.turbo/turbo-version.log +0 -28
- package/pkg/README.md +0 -30
- package/pkg/dist-node/index.js.map +0 -1
- package/pkg/dist-web/index.js.map +0 -1
- package/pkg/package.json +0 -39
- package/playroom.ts +0 -31
- package/src/__tests__/index.spec.ts +0 -134
- package/src/adaptive-toolbar/AdaptiveToolbar.stories.tsx +0 -50
- package/src/adaptive-toolbar/AdaptiveToolbar.tsx +0 -199
- package/src/adaptive-toolbar/__tests__/AdaptiveToolbar.spec.tsx +0 -11
- package/src/adaptive-vertical-toolbar/AdaptiveVerticalToolbar.stories.tsx +0 -49
- package/src/adaptive-vertical-toolbar/AdaptiveVerticalToolbar.tsx +0 -171
- package/src/app-bar/AppBar.stories.tsx +0 -62
- package/src/app-bar/AppBarOverrides.ts +0 -9
- package/src/app-bar/__tests__/AppBar.spec.tsx +0 -86
- package/src/autocomplete/Autocomplete.stories.tsx +0 -76
- package/src/autocomplete/AutocompleteOverrides.tsx +0 -58
- package/src/autocomplete/__tests__/Autocomplete.spec.tsx +0 -323
- package/src/avatar/Avatar.stories.tsx +0 -17
- package/src/avatar/AvatarOverrides.ts +0 -24
- package/src/avatar/__tests__/Avatar.spec.tsx +0 -71
- package/src/avatar-button/AvatarButton.stories.tsx +0 -153
- package/src/avatar-button/AvatarButton.tsx +0 -223
- package/src/avatar-button/__tests__/AvatarButton.spec.tsx +0 -126
- package/src/button/Button.tsx +0 -51
- package/src/button/ButtonOverrides.ts +0 -375
- package/src/button/__tests__/Button.spec.tsx +0 -599
- package/src/card/Card.stories.tsx +0 -39
- package/src/card/CardOverrides.ts +0 -9
- package/src/card/__tests__/Card.spec.tsx +0 -68
- package/src/card-button/CardButton.stories.tsx +0 -36
- package/src/card-button/CardButton.tsx +0 -202
- package/src/card-button/__tests__/CardButton.spec.tsx +0 -95
- package/src/checkbox/CheckboxField.stories.tsx +0 -61
- package/src/checkbox/CheckboxField.tsx +0 -56
- package/src/checkbox/CheckboxGroudField.tsx +0 -53
- package/src/checkbox/CheckboxOverrides.tsx +0 -55
- package/src/checkbox/__tests__/Checkbox.spec.tsx +0 -105
- package/src/chip/Chip.stories.tsx +0 -26
- package/src/chip/ChipOverrides.tsx +0 -111
- package/src/chip/__tests__/Chip.spec.tsx +0 -308
- package/src/columns/Column.tsx +0 -124
- package/src/columns/Columns.stories.tsx +0 -426
- package/src/columns/Columns.tsx +0 -76
- package/src/description-list/DescriptionList.spec.tsx +0 -137
- package/src/description-list/DescriptionList.stories.tsx +0 -148
- package/src/description-list/DescriptionList.tsx +0 -170
- package/src/dialog/Dialog.playroom.tsx +0 -24
- package/src/dialog/Dialog.stories.tsx +0 -60
- package/src/dialog/DialogOverrides.ts +0 -39
- package/src/dialog/__tests__/Dialog.spec.tsx +0 -219
- package/src/drawer/Drawer.playroom.tsx +0 -22
- package/src/drawer/Drawer.stories.tsx +0 -194
- package/src/drawer/DrawerActions.tsx +0 -69
- package/src/drawer/DrawerContent.tsx +0 -30
- package/src/drawer/DrawerList.tsx +0 -60
- package/src/drawer/DrawerOverrides.ts +0 -19
- package/src/drawer/DrawerTitle.tsx +0 -143
- package/src/drawer/__tests__/Drawer.spec.tsx +0 -227
- package/src/dropdown-button/DropdownButton.stories.tsx +0 -15
- package/src/dropdown-button/DropdownButton.tsx +0 -131
- package/src/grid/GridStack.tsx +0 -45
- package/src/grid/InlineGrid.tsx +0 -56
- package/src/icon-button/IconButton.stories.tsx +0 -53
- package/src/icon-button/IconButtonOverrides.ts +0 -32
- package/src/icon-button/__tests__/IconButton.spec.tsx +0 -124
- package/src/index.ts +0 -47
- package/src/info-card/InfoCard.stories.tsx +0 -29
- package/src/info-card/InfoCard.tsx +0 -95
- package/src/info-card/__tests__/InfoCard.spec.tsx +0 -22
- package/src/info-tooltip/InfoTooltip.stories.tsx +0 -77
- package/src/info-tooltip/InfoTooltip.tsx +0 -72
- package/src/info-tooltip/__tests__/InfoTooltip.spec.tsx +0 -166
- package/src/inline/Inline.stories.tsx +0 -135
- package/src/inline/Inline.tsx +0 -144
- package/src/link/Link.stories.tsx +0 -41
- package/src/link/LinkOverrides.ts +0 -43
- package/src/link/__tests__/Link.spec.tsx +0 -98
- package/src/list/ListOverrides.ts +0 -11
- package/src/list/__tests__/List.spec.tsx +0 -182
- package/src/menu/Menu.stories.tsx +0 -35
- package/src/menu/MenuOverrides.ts +0 -17
- package/src/menu/__tests__/Menu.spec.tsx +0 -99
- package/src/number-field/NumberField.stories.tsx +0 -123
- package/src/number-field/NumberField.tsx +0 -98
- package/src/overflow-text/OverflowText.stories.tsx +0 -32
- package/src/overflow-text/OverflowText.tsx +0 -114
- package/src/overflow-text/__tests__/OverflowText.spec.tsx +0 -24
- package/src/pagination/Pagination.stories.tsx +0 -36
- package/src/pagination/PaginationOverrides.ts +0 -47
- package/src/pagination/__tests__/Pagination.spec.tsx +0 -228
- package/src/paper/PaperOverrides.ts +0 -10
- package/src/paper/__tests__/Paper.spec.tsx +0 -155
- package/src/props/AlignProps.ts +0 -22
- package/src/props/CollapseProp.ts +0 -13
- package/src/props/ResponsiveProp.ts +0 -65
- package/src/props/SpaceProp.ts +0 -40
- package/src/radio/RadioField.stories.tsx +0 -42
- package/src/radio/RadioField.tsx +0 -55
- package/src/radio/RadioGroupField.tsx +0 -64
- package/src/radio/RadioOverrides.tsx +0 -51
- package/src/radio/__tests__/Radio.spec.tsx +0 -90
- package/src/responsive/CollapseBreakpoint.ts +0 -21
- package/src/responsive/MinBreakpoint.ts +0 -21
- package/src/responsive/ResponsiveContext.tsx +0 -57
- package/src/snackbar/Snackbar.stories.tsx +0 -196
- package/src/snackbar/Snackbar.tsx +0 -83
- package/src/snackbar/SnackbarContent.tsx +0 -147
- package/src/snackbar/SnackbarOverrides.ts +0 -23
- package/src/snackbar/SnackbarStack.tsx +0 -160
- package/src/snackbar/__tests__/Snackbar.spec.tsx +0 -196
- package/src/stack/Stack.stories.tsx +0 -113
- package/src/stack/Stack.tsx +0 -86
- package/src/svg-icon/SvgIcon.stories.tsx +0 -29
- package/src/svg-icon/SvgIconOverrides.ts +0 -32
- package/src/svg-icon/__tests__/SvgIcon.spec.tsx +0 -67
- package/src/switch/Switch.stories.tsx +0 -60
- package/src/switch/SwitchOverrides.ts +0 -88
- package/src/switch/__tests__/Switch.spec.tsx +0 -204
- package/src/tabs/Tabs.stories.tsx +0 -40
- package/src/tabs/TabsOverrides.ts +0 -45
- package/src/tabs/__tests__/Tabs.spec.tsx +0 -226
- package/src/tag/Tag.stories.tsx +0 -53
- package/src/tag/Tag.tsx +0 -130
- package/src/tag/__tests__/Tag.spec.tsx +0 -82
- package/src/text-field/TextField.stories.tsx +0 -50
- package/src/text-field/TextFieldOverrides.tsx +0 -149
- package/src/text-field/__tests__/TextField.spec.tsx +0 -662
- package/src/theme/Color.ts +0 -117
- package/src/theme/SuperDispatchTheme.ts +0 -3
- package/src/theme/ThemeProvider.tsx +0 -179
- package/src/theme/__tests__/CssBaseline.spec.tsx +0 -49
- package/src/theme/__tests__/ThemeProvider.spec.ts +0 -40
- package/src/theme/__tests__/__snapshots__/ThemeProvider.spec.ts.snap +0 -204
- package/src/tiles/Tiles.stories.tsx +0 -69
- package/src/tiles/Tiles.tsx +0 -163
- package/src/tiles/__tests__/Tiles.spec.tsx +0 -221
- package/src/toolbar/ToolbarOverrides.ts +0 -14
- package/src/toolbar/__tests__/Toolbar.spec.tsx +0 -50
- package/src/tooltip/Tooltip.stories.tsx +0 -32
- package/src/tooltip/TooltipOverrides.ts +0 -34
- package/src/tooltip/__tests__/Tooltip.spec.tsx +0 -182
- package/src/typography/Typography.stories.tsx +0 -132
- package/src/typography/TypographyOverrides.ts +0 -125
- package/src/typography/__tests__/Typography.spec.tsx +0 -253
- package/src/utils/ExitTransitionPlaceholder.tsx +0 -22
- package/src/utils/ResizeObserver.tsx +0 -28
- package/src/utils/VisibilityObserver.tsx +0 -75
- package/src/utils/__tests__/ExitTransitionPlaceholder.spec.tsx +0 -34
- package/src/utils/isEmptyReactNode.ts +0 -11
- package/src/utils/mergeRefs.ts +0 -21
- package/src/utils/renderChildren.ts +0 -10
- package/src/utils/useUID.ts +0 -9
- package/tsconfig.json +0 -19
- /package/{pkg/dist-src → dist-src}/adaptive-toolbar/AdaptiveToolbar.js +0 -0
- /package/{pkg/dist-src → dist-src}/adaptive-vertical-toolbar/AdaptiveVerticalToolbar.js +0 -0
- /package/{pkg/dist-src → dist-src}/app-bar/AppBarOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/autocomplete/AutocompleteOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/avatar/AvatarOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/avatar-button/AvatarButton.js +0 -0
- /package/{pkg/dist-src → dist-src}/button/Button.js +0 -0
- /package/{pkg/dist-src → dist-src}/button/ButtonOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/card/CardOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/card-button/CardButton.js +0 -0
- /package/{pkg/dist-src → dist-src}/checkbox/CheckboxField.js +0 -0
- /package/{pkg/dist-src → dist-src}/checkbox/CheckboxGroudField.js +0 -0
- /package/{pkg/dist-src → dist-src}/checkbox/CheckboxOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/chip/ChipOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/columns/Column.js +0 -0
- /package/{pkg/dist-src → dist-src}/columns/Columns.js +0 -0
- /package/{pkg/dist-src → dist-src}/description-list/DescriptionList.js +0 -0
- /package/{pkg/dist-src → dist-src}/dialog/DialogOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/drawer/DrawerActions.js +0 -0
- /package/{pkg/dist-src → dist-src}/drawer/DrawerContent.js +0 -0
- /package/{pkg/dist-src → dist-src}/drawer/DrawerList.js +0 -0
- /package/{pkg/dist-src → dist-src}/drawer/DrawerOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/drawer/DrawerTitle.js +0 -0
- /package/{pkg/dist-src → dist-src}/dropdown-button/DropdownButton.js +0 -0
- /package/{pkg/dist-src → dist-src}/grid/GridStack.js +0 -0
- /package/{pkg/dist-src → dist-src}/grid/InlineGrid.js +0 -0
- /package/{pkg/dist-src → dist-src}/icon-button/IconButtonOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/info-card/InfoCard.js +0 -0
- /package/{pkg/dist-src → dist-src}/inline/Inline.js +0 -0
- /package/{pkg/dist-src → dist-src}/link/LinkOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/list/ListOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/menu/MenuOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/number-field/NumberField.js +0 -0
- /package/{pkg/dist-src → dist-src}/overflow-text/OverflowText.js +0 -0
- /package/{pkg/dist-src → dist-src}/pagination/PaginationOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/paper/PaperOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/props/AlignProps.js +0 -0
- /package/{pkg/dist-src → dist-src}/props/CollapseProp.js +0 -0
- /package/{pkg/dist-src → dist-src}/props/ResponsiveProp.js +0 -0
- /package/{pkg/dist-src → dist-src}/props/SpaceProp.js +0 -0
- /package/{pkg/dist-src → dist-src}/radio/RadioField.js +0 -0
- /package/{pkg/dist-src → dist-src}/radio/RadioGroupField.js +0 -0
- /package/{pkg/dist-src → dist-src}/radio/RadioOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/responsive/CollapseBreakpoint.js +0 -0
- /package/{pkg/dist-src → dist-src}/responsive/MinBreakpoint.js +0 -0
- /package/{pkg/dist-src → dist-src}/responsive/ResponsiveContext.js +0 -0
- /package/{pkg/dist-src → dist-src}/snackbar/Snackbar.js +0 -0
- /package/{pkg/dist-src → dist-src}/snackbar/SnackbarContent.js +0 -0
- /package/{pkg/dist-src → dist-src}/snackbar/SnackbarOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/snackbar/SnackbarStack.js +0 -0
- /package/{pkg/dist-src → dist-src}/stack/Stack.js +0 -0
- /package/{pkg/dist-src → dist-src}/svg-icon/SvgIconOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/switch/SwitchOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/tabs/TabsOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/tag/Tag.js +0 -0
- /package/{pkg/dist-src → dist-src}/text-field/TextFieldOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/theme/Color.js +0 -0
- /package/{pkg/dist-src → dist-src}/theme/SuperDispatchTheme.js +0 -0
- /package/{pkg/dist-src → dist-src}/theme/ThemeProvider.js +0 -0
- /package/{pkg/dist-src → dist-src}/tiles/Tiles.js +0 -0
- /package/{pkg/dist-src → dist-src}/toolbar/ToolbarOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/tooltip/TooltipOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/typography/TypographyOverrides.js +0 -0
- /package/{pkg/dist-src → dist-src}/utils/ExitTransitionPlaceholder.js +0 -0
- /package/{pkg/dist-src → dist-src}/utils/ResizeObserver.js +0 -0
- /package/{pkg/dist-src → dist-src}/utils/VisibilityObserver.js +0 -0
- /package/{pkg/dist-src → dist-src}/utils/isEmptyReactNode.js +0 -0
- /package/{pkg/dist-src → dist-src}/utils/mergeRefs.js +0 -0
- /package/{pkg/dist-src → dist-src}/utils/renderChildren.js +0 -0
- /package/{pkg/dist-src → dist-src}/utils/useUID.js +0 -0
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { Link } from '@material-ui/core';
|
|
2
|
-
import CalendarTodayIcon from '@material-ui/icons/CalendarToday';
|
|
3
|
-
import ChatIcon from '@material-ui/icons/Chat';
|
|
4
|
-
import NotesIcon from '@material-ui/icons/Notes';
|
|
5
|
-
import PersonIcon from '@material-ui/icons/Person';
|
|
6
|
-
import PhoneIcon from '@material-ui/icons/Phone';
|
|
7
|
-
import RoomIcon from '@material-ui/icons/Room';
|
|
8
|
-
import { Meta } from '@storybook/react';
|
|
9
|
-
import { PhoneLink, PhoneText } from '@superdispatch/phones';
|
|
10
|
-
import { Box } from '@superdispatch/ui-lab';
|
|
11
|
-
import { DescriptionList, DescriptionListItem } from './DescriptionList';
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
title: 'Data Display/DescriptionList',
|
|
15
|
-
component: DescriptionList,
|
|
16
|
-
subcomponents: { DescriptionListItem },
|
|
17
|
-
decorators: [
|
|
18
|
-
(Story) => (
|
|
19
|
-
<Box maxWidth="200px">
|
|
20
|
-
<Story />
|
|
21
|
-
</Box>
|
|
22
|
-
),
|
|
23
|
-
],
|
|
24
|
-
} as Meta;
|
|
25
|
-
|
|
26
|
-
export const small = () => (
|
|
27
|
-
<DescriptionList size="small">
|
|
28
|
-
<DescriptionListItem
|
|
29
|
-
icon={<CalendarTodayIcon />}
|
|
30
|
-
label="Posted on"
|
|
31
|
-
content="Feb 03, 2020"
|
|
32
|
-
/>
|
|
33
|
-
<DescriptionListItem
|
|
34
|
-
icon={<RoomIcon />}
|
|
35
|
-
content="167 Zosh Rd, Dallas, PA 18612"
|
|
36
|
-
/>
|
|
37
|
-
<DescriptionListItem icon={<NotesIcon />} label="Notes" />
|
|
38
|
-
</DescriptionList>
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
export const medium = () => (
|
|
42
|
-
<DescriptionList size="medium">
|
|
43
|
-
<DescriptionListItem
|
|
44
|
-
icon={<CalendarTodayIcon />}
|
|
45
|
-
label="Posted on"
|
|
46
|
-
content="Feb 03, 2020"
|
|
47
|
-
/>
|
|
48
|
-
<DescriptionListItem
|
|
49
|
-
icon={<RoomIcon />}
|
|
50
|
-
content="167 Zosh Rd, Dallas, PA 18612"
|
|
51
|
-
/>
|
|
52
|
-
<DescriptionListItem icon={<NotesIcon />} label="Notes" />
|
|
53
|
-
</DescriptionList>
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
export const large = () => (
|
|
57
|
-
<DescriptionList size="large">
|
|
58
|
-
<DescriptionListItem
|
|
59
|
-
icon={<CalendarTodayIcon />}
|
|
60
|
-
label="Posted on"
|
|
61
|
-
content="Feb 03, 2020"
|
|
62
|
-
/>
|
|
63
|
-
<DescriptionListItem
|
|
64
|
-
icon={<RoomIcon />}
|
|
65
|
-
content="167 Zosh Rd, Dallas, PA 18612"
|
|
66
|
-
/>
|
|
67
|
-
<DescriptionListItem icon={<NotesIcon />} label="Notes" />
|
|
68
|
-
</DescriptionList>
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
export const fallback = () => (
|
|
72
|
-
<DescriptionList>
|
|
73
|
-
<DescriptionListItem
|
|
74
|
-
icon={<CalendarTodayIcon />}
|
|
75
|
-
label="Posted on"
|
|
76
|
-
content={null}
|
|
77
|
-
fallback="N/A"
|
|
78
|
-
/>
|
|
79
|
-
<DescriptionListItem
|
|
80
|
-
icon={<RoomIcon />}
|
|
81
|
-
content=""
|
|
82
|
-
fallback="No address available"
|
|
83
|
-
/>
|
|
84
|
-
<DescriptionListItem
|
|
85
|
-
icon={<NotesIcon />}
|
|
86
|
-
content={false}
|
|
87
|
-
fallback="No delivery notes"
|
|
88
|
-
/>
|
|
89
|
-
</DescriptionList>
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
export const inset = () => (
|
|
93
|
-
<DescriptionList size="small">
|
|
94
|
-
<DescriptionListItem
|
|
95
|
-
icon={<PersonIcon />}
|
|
96
|
-
content={<b>Antony Hoffman</b>}
|
|
97
|
-
/>
|
|
98
|
-
|
|
99
|
-
<DescriptionListItem
|
|
100
|
-
inset={true}
|
|
101
|
-
content={<PhoneLink phone="303 555 0105" format="national" />}
|
|
102
|
-
/>
|
|
103
|
-
|
|
104
|
-
<DescriptionListItem
|
|
105
|
-
inset={true}
|
|
106
|
-
content={
|
|
107
|
-
<Link href="mailto:dustin.russel@example.com">
|
|
108
|
-
dustin.russel@example.com
|
|
109
|
-
</Link>
|
|
110
|
-
}
|
|
111
|
-
contentTypographyProps={{
|
|
112
|
-
disableUnderline: true,
|
|
113
|
-
TooltipProps: {
|
|
114
|
-
interactive: true,
|
|
115
|
-
title: 'dustin.russel@example.com',
|
|
116
|
-
},
|
|
117
|
-
}}
|
|
118
|
-
/>
|
|
119
|
-
</DescriptionList>
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
export const nested = () => (
|
|
123
|
-
<DescriptionList>
|
|
124
|
-
<DescriptionListItem
|
|
125
|
-
icon={<RoomIcon />}
|
|
126
|
-
content="NISSAN WAY, CANTON, MS 39046"
|
|
127
|
-
/>
|
|
128
|
-
<DescriptionListItem
|
|
129
|
-
icon={<PhoneIcon />}
|
|
130
|
-
content=""
|
|
131
|
-
fallback="No pickup date"
|
|
132
|
-
/>
|
|
133
|
-
|
|
134
|
-
<DescriptionList size="small">
|
|
135
|
-
<DescriptionListItem icon={<PersonIcon />} content="MGR MGR" />
|
|
136
|
-
<DescriptionListItem
|
|
137
|
-
inset={true}
|
|
138
|
-
content={<PhoneText phone="6018550402" format="national" />}
|
|
139
|
-
/>
|
|
140
|
-
</DescriptionList>
|
|
141
|
-
|
|
142
|
-
<DescriptionListItem
|
|
143
|
-
icon={<ChatIcon />}
|
|
144
|
-
content=""
|
|
145
|
-
fallback="No pickup notes"
|
|
146
|
-
/>
|
|
147
|
-
</DescriptionList>
|
|
148
|
-
);
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { SvgIcon, Typography, TypographyProps } from '@material-ui/core';
|
|
2
|
-
import { CSSProperties, makeStyles } from '@material-ui/styles';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { forwardRef, ReactNode } from 'react';
|
|
5
|
-
import { OverflowText, OverflowTextProps } from '../overflow-text/OverflowText';
|
|
6
|
-
import { Color } from '../theme/Color';
|
|
7
|
-
import { SuperDispatchTheme } from '../theme/SuperDispatchTheme';
|
|
8
|
-
import { isEmptyReactNode } from '../utils/isEmptyReactNode';
|
|
9
|
-
import { useUID } from '../utils/useUID';
|
|
10
|
-
|
|
11
|
-
function sizeVariant(
|
|
12
|
-
theme: SuperDispatchTheme,
|
|
13
|
-
mobileSpacing: number,
|
|
14
|
-
desktopSpacing: number,
|
|
15
|
-
): CSSProperties {
|
|
16
|
-
return {
|
|
17
|
-
'& > $list, & > $item': {
|
|
18
|
-
'&:not(:last-child)': {
|
|
19
|
-
paddingBottom: theme.spacing(mobileSpacing),
|
|
20
|
-
|
|
21
|
-
[theme.breakpoints.up('sm')]: {
|
|
22
|
-
paddingBottom: theme.spacing(desktopSpacing),
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const useStyles = makeStyles(
|
|
30
|
-
(theme: SuperDispatchTheme) => ({
|
|
31
|
-
list: sizeVariant(theme, 2, 1),
|
|
32
|
-
listSmall: sizeVariant(theme, 1, 0.5),
|
|
33
|
-
listLarge: sizeVariant(theme, 3, 2),
|
|
34
|
-
|
|
35
|
-
item: {
|
|
36
|
-
display: 'flex',
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
icon: {
|
|
41
|
-
display: 'inline-flex',
|
|
42
|
-
marginRight: theme.spacing(1),
|
|
43
|
-
|
|
44
|
-
'& > .MuiSvgIcon-root': {
|
|
45
|
-
color: Color.Dark100,
|
|
46
|
-
fontSize: theme.spacing(3),
|
|
47
|
-
|
|
48
|
-
[theme.breakpoints.up('sm')]: {
|
|
49
|
-
fontSize: theme.spacing(2),
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
}),
|
|
54
|
-
{ name: 'SD-DescriptionList' },
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
//
|
|
58
|
-
// DescriptionList
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
export interface DescriptionListProps {
|
|
62
|
-
children?: ReactNode;
|
|
63
|
-
size?: 'small' | 'medium' | 'large';
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const DescriptionList = forwardRef<HTMLDivElement, DescriptionListProps>(
|
|
67
|
-
({ size, ...props }, ref) => {
|
|
68
|
-
const styles = useStyles();
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<div
|
|
72
|
-
{...props}
|
|
73
|
-
ref={ref}
|
|
74
|
-
data-size={size}
|
|
75
|
-
className={clsx(styles.list, {
|
|
76
|
-
[styles.listSmall]: size === 'small',
|
|
77
|
-
[styles.listLarge]: size === 'large',
|
|
78
|
-
})}
|
|
79
|
-
/>
|
|
80
|
-
);
|
|
81
|
-
},
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
// DescriptionListItem
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
export interface DescriptionListItemProps {
|
|
89
|
-
icon?: ReactNode;
|
|
90
|
-
inset?: boolean;
|
|
91
|
-
|
|
92
|
-
label?: ReactNode;
|
|
93
|
-
labelTypographyProps?: Omit<
|
|
94
|
-
TypographyProps,
|
|
95
|
-
'noWrap' | 'variant' | 'component' | 'color'
|
|
96
|
-
>;
|
|
97
|
-
|
|
98
|
-
content?: ReactNode;
|
|
99
|
-
contentTypographyProps?: Omit<OverflowTextProps, 'component' | 'color'>;
|
|
100
|
-
|
|
101
|
-
fallback?: ReactNode;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export const DescriptionListItem = forwardRef<
|
|
105
|
-
HTMLDivElement,
|
|
106
|
-
DescriptionListItemProps
|
|
107
|
-
>(
|
|
108
|
-
(
|
|
109
|
-
{
|
|
110
|
-
inset,
|
|
111
|
-
icon = inset ? <SvgIcon /> : null,
|
|
112
|
-
|
|
113
|
-
label,
|
|
114
|
-
labelTypographyProps,
|
|
115
|
-
|
|
116
|
-
content,
|
|
117
|
-
contentTypographyProps,
|
|
118
|
-
|
|
119
|
-
fallback,
|
|
120
|
-
},
|
|
121
|
-
ref,
|
|
122
|
-
) => {
|
|
123
|
-
const styles = useStyles();
|
|
124
|
-
const labelID = useUID(labelTypographyProps?.id);
|
|
125
|
-
|
|
126
|
-
const shouldRenderFallback = isEmptyReactNode(content);
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<div
|
|
130
|
-
ref={ref}
|
|
131
|
-
className={styles.item}
|
|
132
|
-
aria-labelledby={label != null ? labelID : undefined}
|
|
133
|
-
>
|
|
134
|
-
{!!icon && <div className={styles.icon}>{icon}</div>}
|
|
135
|
-
|
|
136
|
-
<OverflowText
|
|
137
|
-
{...contentTypographyProps}
|
|
138
|
-
component="span"
|
|
139
|
-
color={
|
|
140
|
-
shouldRenderFallback && label == null
|
|
141
|
-
? 'textSecondary'
|
|
142
|
-
: 'textPrimary'
|
|
143
|
-
}
|
|
144
|
-
TooltipProps={{
|
|
145
|
-
...contentTypographyProps?.TooltipProps,
|
|
146
|
-
title:
|
|
147
|
-
contentTypographyProps?.TooltipProps?.title ??
|
|
148
|
-
content ??
|
|
149
|
-
undefined,
|
|
150
|
-
}}
|
|
151
|
-
>
|
|
152
|
-
{label != null && (
|
|
153
|
-
<Typography
|
|
154
|
-
{...labelTypographyProps}
|
|
155
|
-
id={labelID}
|
|
156
|
-
variant="body2"
|
|
157
|
-
component="span"
|
|
158
|
-
color="textSecondary"
|
|
159
|
-
>
|
|
160
|
-
{label}
|
|
161
|
-
</Typography>
|
|
162
|
-
)}
|
|
163
|
-
|
|
164
|
-
{label != null && ' '}
|
|
165
|
-
{!shouldRenderFallback ? content : fallback}
|
|
166
|
-
</OverflowText>
|
|
167
|
-
</div>
|
|
168
|
-
);
|
|
169
|
-
},
|
|
170
|
-
);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Dialog as MuiDialog, DialogProps } from '@material-ui/core';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
|
|
4
|
-
export const Dialog = forwardRef<HTMLDivElement, DialogProps>(
|
|
5
|
-
(
|
|
6
|
-
{
|
|
7
|
-
open = true,
|
|
8
|
-
disableAutoFocus = true,
|
|
9
|
-
disableEnforceFocus = true,
|
|
10
|
-
disableRestoreFocus = true,
|
|
11
|
-
...props
|
|
12
|
-
},
|
|
13
|
-
ref,
|
|
14
|
-
) => (
|
|
15
|
-
<MuiDialog
|
|
16
|
-
{...props}
|
|
17
|
-
ref={ref}
|
|
18
|
-
open={open}
|
|
19
|
-
disableAutoFocus={disableAutoFocus}
|
|
20
|
-
disableEnforceFocus={disableEnforceFocus}
|
|
21
|
-
disableRestoreFocus={disableRestoreFocus}
|
|
22
|
-
/>
|
|
23
|
-
),
|
|
24
|
-
);
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { DialogActions, DialogContent, DialogTitle } from '@material-ui/core';
|
|
2
|
-
import { PropsLink, UseState } from '@superdispatch/ui-docs';
|
|
3
|
-
import { Button } from '..';
|
|
4
|
-
import { Dialog } from './Dialog.playroom';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Feedback/Dialog',
|
|
8
|
-
parameters: {
|
|
9
|
-
componentSubtitle: (
|
|
10
|
-
<PropsLink url="https://material-ui.com/api/dialog/#props" />
|
|
11
|
-
),
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const basic = () => (
|
|
16
|
-
<UseState initialState={false}>
|
|
17
|
-
{(open, setOpen) => (
|
|
18
|
-
<>
|
|
19
|
-
<Button
|
|
20
|
-
onClick={() => {
|
|
21
|
-
setOpen(true);
|
|
22
|
-
}}
|
|
23
|
-
>
|
|
24
|
-
Open Dialog
|
|
25
|
-
</Button>
|
|
26
|
-
|
|
27
|
-
<Dialog
|
|
28
|
-
open={open}
|
|
29
|
-
disablePortal={true}
|
|
30
|
-
onClose={() => {
|
|
31
|
-
setOpen(false);
|
|
32
|
-
}}
|
|
33
|
-
>
|
|
34
|
-
<DialogTitle>Use Google’s location service?</DialogTitle>
|
|
35
|
-
<DialogContent>
|
|
36
|
-
Let Google help apps determine location. This means sending
|
|
37
|
-
anonymous location data to Google, even when no apps are running.
|
|
38
|
-
</DialogContent>
|
|
39
|
-
<DialogActions>
|
|
40
|
-
<Button
|
|
41
|
-
onClick={() => {
|
|
42
|
-
setOpen(false);
|
|
43
|
-
}}
|
|
44
|
-
>
|
|
45
|
-
Disagree
|
|
46
|
-
</Button>
|
|
47
|
-
<Button
|
|
48
|
-
onClick={() => {
|
|
49
|
-
setOpen(false);
|
|
50
|
-
}}
|
|
51
|
-
variant="contained"
|
|
52
|
-
>
|
|
53
|
-
Agree
|
|
54
|
-
</Button>
|
|
55
|
-
</DialogActions>
|
|
56
|
-
</Dialog>
|
|
57
|
-
</>
|
|
58
|
-
)}
|
|
59
|
-
</UseState>
|
|
60
|
-
);
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { SuperDispatchTheme } from '../theme/SuperDispatchTheme';
|
|
2
|
-
|
|
3
|
-
export function overrideDialog(theme: SuperDispatchTheme): void {
|
|
4
|
-
theme.props.MuiDialogTitle = { disableTypography: true };
|
|
5
|
-
|
|
6
|
-
theme.overrides.MuiDialog = {
|
|
7
|
-
paper: {
|
|
8
|
-
margin: theme.spacing(3),
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
paperWidthXs: {
|
|
12
|
-
maxWidth: Math.max(theme.breakpoints.values.xs, 360),
|
|
13
|
-
|
|
14
|
-
'&$paperScrollBody': {
|
|
15
|
-
[theme.breakpoints.down(
|
|
16
|
-
Math.max(theme.breakpoints.values.xs, 360) + 32 * 2,
|
|
17
|
-
)]: {
|
|
18
|
-
maxWidth: 'calc(100% - 64px)',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
theme.overrides.MuiDialogTitle = {
|
|
25
|
-
root: { ...theme.typography.h3 },
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
theme.overrides.MuiDialogContent = {
|
|
29
|
-
root: { padding: theme.spacing(0, 3) },
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
theme.overrides.MuiDialogActions = {
|
|
33
|
-
root: { padding: theme.spacing(3) },
|
|
34
|
-
|
|
35
|
-
spacing: {
|
|
36
|
-
'& > :not(:first-child)': { marginLeft: theme.spacing(2) },
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
}
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Dialog,
|
|
3
|
-
DialogActions,
|
|
4
|
-
DialogContent,
|
|
5
|
-
DialogTitle,
|
|
6
|
-
} from '@material-ui/core';
|
|
7
|
-
import { renderCSS, renderTheme } from '@superdispatch/ui-testutils';
|
|
8
|
-
|
|
9
|
-
it('checks default props', () => {
|
|
10
|
-
const { props } = renderTheme();
|
|
11
|
-
|
|
12
|
-
expect(props.MuiDialog).toMatchInlineSnapshot(`undefined`);
|
|
13
|
-
expect(props.MuiDialogTitle).toMatchInlineSnapshot(`
|
|
14
|
-
Object {
|
|
15
|
-
"disableTypography": true,
|
|
16
|
-
}
|
|
17
|
-
`);
|
|
18
|
-
expect(props.MuiDialogContent).toMatchInlineSnapshot(`undefined`);
|
|
19
|
-
expect(props.MuiDialogActions).toMatchInlineSnapshot(`undefined`);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('checks component css', () => {
|
|
23
|
-
expect(
|
|
24
|
-
renderCSS(
|
|
25
|
-
<Dialog open={true}>
|
|
26
|
-
<DialogTitle>Text</DialogTitle>
|
|
27
|
-
<DialogContent />
|
|
28
|
-
<DialogActions />
|
|
29
|
-
</Dialog>,
|
|
30
|
-
['MuiDialog', 'MuiDialogTitle', 'MuiDialogContent', 'MuiDialogActions'],
|
|
31
|
-
),
|
|
32
|
-
).toMatchInlineSnapshot(`
|
|
33
|
-
@media print {
|
|
34
|
-
.MuiDialog-root {
|
|
35
|
-
position: absolute !important;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.MuiDialog-scrollPaper {
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.MuiDialog-scrollBody {
|
|
46
|
-
overflow-x: hidden;
|
|
47
|
-
overflow-y: auto;
|
|
48
|
-
text-align: center;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.MuiDialog-scrollBody:after {
|
|
52
|
-
width: 0;
|
|
53
|
-
height: 100%;
|
|
54
|
-
content: '';
|
|
55
|
-
display: inline-block;
|
|
56
|
-
vertical-align: middle;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.MuiDialog-container {
|
|
60
|
-
height: 100%;
|
|
61
|
-
outline: 0;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@media print {
|
|
65
|
-
.MuiDialog-container {
|
|
66
|
-
height: auto;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.MuiDialog-paper {
|
|
71
|
-
margin: 24px;
|
|
72
|
-
position: relative;
|
|
73
|
-
overflow-y: auto;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@media print {
|
|
77
|
-
.MuiDialog-paper {
|
|
78
|
-
box-shadow: none;
|
|
79
|
-
overflow-y: visible;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.MuiDialog-paperScrollPaper {
|
|
84
|
-
display: flex;
|
|
85
|
-
max-height: calc(100% - 64px);
|
|
86
|
-
flex-direction: column;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.MuiDialog-paperScrollBody {
|
|
90
|
-
display: inline-block;
|
|
91
|
-
text-align: left;
|
|
92
|
-
vertical-align: middle;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.MuiDialog-paperWidthFalse {
|
|
96
|
-
max-width: calc(100% - 64px);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.MuiDialog-paperWidthXs {
|
|
100
|
-
max-width: 360px;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@media (max-width: 507.95px) {
|
|
104
|
-
.MuiDialog-paperWidthXs.MuiDialog-paperScrollBody {
|
|
105
|
-
max-width: calc(100% - 64px);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@media (max-width: 423.95px) {
|
|
110
|
-
.MuiDialog-paperWidthXs.MuiDialog-paperScrollBody {
|
|
111
|
-
max-width: calc(100% - 64px);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.MuiDialog-paperWidthSm {
|
|
116
|
-
max-width: 600px;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
@media (max-width: 663.95px) {
|
|
120
|
-
.MuiDialog-paperWidthSm.MuiDialog-paperScrollBody {
|
|
121
|
-
max-width: calc(100% - 64px);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.MuiDialog-paperWidthMd {
|
|
126
|
-
max-width: 960px;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
@media (max-width: 1023.95px) {
|
|
130
|
-
.MuiDialog-paperWidthMd.MuiDialog-paperScrollBody {
|
|
131
|
-
max-width: calc(100% - 64px);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.MuiDialog-paperWidthLg {
|
|
136
|
-
max-width: 1280px;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@media (max-width: 1343.95px) {
|
|
140
|
-
.MuiDialog-paperWidthLg.MuiDialog-paperScrollBody {
|
|
141
|
-
max-width: calc(100% - 64px);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.MuiDialog-paperWidthXl {
|
|
146
|
-
max-width: 1920px;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
@media (max-width: 1983.95px) {
|
|
150
|
-
.MuiDialog-paperWidthXl.MuiDialog-paperScrollBody {
|
|
151
|
-
max-width: calc(100% - 64px);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.MuiDialog-paperFullWidth {
|
|
156
|
-
width: calc(100% - 64px);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.MuiDialog-paperFullScreen {
|
|
160
|
-
width: 100%;
|
|
161
|
-
height: 100%;
|
|
162
|
-
margin: 0;
|
|
163
|
-
max-width: 100%;
|
|
164
|
-
max-height: none;
|
|
165
|
-
border-radius: 0;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.MuiDialog-paperFullScreen.MuiDialog-paperScrollBody {
|
|
169
|
-
margin: 0;
|
|
170
|
-
max-width: 100%;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.MuiDialogActions-root {
|
|
174
|
-
flex: 0 0 auto;
|
|
175
|
-
display: flex;
|
|
176
|
-
padding: 24px;
|
|
177
|
-
align-items: center;
|
|
178
|
-
justify-content: flex-end;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.MuiDialogActions-spacing > :not(:first-child) {
|
|
182
|
-
margin-left: 16px;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.MuiDialogContent-root {
|
|
186
|
-
flex: 1 1 auto;
|
|
187
|
-
padding: 0px 24px;
|
|
188
|
-
overflow-y: auto;
|
|
189
|
-
-webkit-overflow-scrolling: touch;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.MuiDialogContent-root:first-child {
|
|
193
|
-
padding-top: 20px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.MuiDialogContent-dividers {
|
|
197
|
-
padding: 16px 24px;
|
|
198
|
-
border-top: 1px solid Color.Silver400;
|
|
199
|
-
border-bottom: 1px solid Color.Silver400;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.MuiDialogTitle-root {
|
|
203
|
-
flex: 0 0 auto;
|
|
204
|
-
margin: 0;
|
|
205
|
-
padding: 16px 24px;
|
|
206
|
-
font-size: 20px;
|
|
207
|
-
font-family: 'Inter', sans-serif;
|
|
208
|
-
font-weight: 500;
|
|
209
|
-
line-height: 28px;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
@media (min-width: 0px) and (max-width: 599.95px) {
|
|
213
|
-
.MuiDialogTitle-root {
|
|
214
|
-
font-size: 20px;
|
|
215
|
-
line-height: 26px;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
`);
|
|
219
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Drawer as MuiDrawer, DrawerProps } from '@material-ui/core';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
|
|
4
|
-
export const Drawer = forwardRef<HTMLDivElement, DrawerProps>(
|
|
5
|
-
(
|
|
6
|
-
{
|
|
7
|
-
disableAutoFocus = true,
|
|
8
|
-
disableEnforceFocus = true,
|
|
9
|
-
disableRestoreFocus = true,
|
|
10
|
-
...props
|
|
11
|
-
},
|
|
12
|
-
ref,
|
|
13
|
-
) => (
|
|
14
|
-
<MuiDrawer
|
|
15
|
-
{...props}
|
|
16
|
-
ref={ref}
|
|
17
|
-
disableAutoFocus={disableAutoFocus}
|
|
18
|
-
disableEnforceFocus={disableEnforceFocus}
|
|
19
|
-
disableRestoreFocus={disableRestoreFocus}
|
|
20
|
-
/>
|
|
21
|
-
),
|
|
22
|
-
);
|