@toptal/picasso-menu 1.0.17 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,10 +6,7 @@ import type {
6
6
  ReactElement,
7
7
  } from 'react'
8
8
  import React, { forwardRef, useRef } from 'react'
9
- import cx from 'classnames'
10
- import type { Theme } from '@material-ui/core/styles'
11
- import { makeStyles } from '@material-ui/core/styles'
12
- import { MenuItem as MUIMenuItem } from '@material-ui/core'
9
+ import { twJoin, twMerge } from '@toptal/picasso-tailwind-merge'
13
10
  import type {
14
11
  BaseProps,
15
12
  ButtonOrAnchorProps,
@@ -17,7 +14,6 @@ import type {
17
14
  OverridableComponent,
18
15
  } from '@toptal/picasso-shared'
19
16
  import { useTitleCase } from '@toptal/picasso-shared'
20
- import { Container } from '@toptal/picasso-container'
21
17
  import { ChevronMinor16, CheckMinor16 } from '@toptal/picasso-icons'
22
18
  import { Paper } from '@toptal/picasso-paper'
23
19
  import { Popper } from '@toptal/picasso-popper'
@@ -26,7 +22,6 @@ import { ClickAwayListener, toTitleCase } from '@toptal/picasso-utils'
26
22
  import type { AvatarProps, Avatar } from '@toptal/picasso-avatar'
27
23
 
28
24
  import { useMenuItem } from './hooks'
29
- import styles from './styles'
30
25
 
31
26
  export type VariantType = 'light' | 'dark'
32
27
 
@@ -67,9 +62,51 @@ export interface Props extends BaseProps, TextLabelProps, MenuItemAttributes {
67
62
  onMouseEnter?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void
68
63
  }
69
64
 
70
- const useStyles = makeStyles<Theme>(styles, {
71
- name: 'PicassoMenuItem',
72
- })
65
+ const getFontColor = ({
66
+ variant,
67
+ highlighted,
68
+ }: {
69
+ variant: VariantType
70
+ highlighted?: boolean
71
+ }) => {
72
+ if (variant === 'light') {
73
+ return 'text-black'
74
+ }
75
+ if (variant === 'dark') {
76
+ return ['focus:text-white', highlighted ? 'text-white' : 'text-gray-500']
77
+ }
78
+ }
79
+
80
+ const getBackgroundAndActionStyles = ({
81
+ variant,
82
+ highlighted,
83
+ nonSelectable,
84
+ }: {
85
+ variant: VariantType
86
+ highlighted: boolean
87
+ nonSelectable?: boolean
88
+ }) => {
89
+ let bgColor = 'bg-transparent'
90
+ let actionBgColor
91
+
92
+ if (variant === 'dark') {
93
+ actionBgColor =
94
+ !nonSelectable && 'hover:bg-graphite-700 focus:bg-graphite-700'
95
+ if (highlighted) {
96
+ bgColor = 'bg-graphite-700'
97
+ }
98
+ }
99
+
100
+ if (variant === 'light') {
101
+ actionBgColor = !nonSelectable && 'hover:bg-blue-100 focus:bg-blue-100'
102
+
103
+ if (highlighted) {
104
+ bgColor = 'bg-blue-100'
105
+ }
106
+ }
107
+
108
+ return [bgColor, actionBgColor]
109
+ }
73
110
 
74
111
  export const MenuItem: OverridableComponent<Props> = forwardRef<
75
112
  HTMLElement,
@@ -90,15 +127,16 @@ export const MenuItem: OverridableComponent<Props> = forwardRef<
90
127
  style,
91
128
  value,
92
129
  variant = 'light',
130
+ role = 'menuitem',
93
131
  nonSelectable,
94
132
  onClick,
95
133
  onMouseEnter,
96
134
  icon,
97
135
  avatar,
136
+ tabIndex: tabIndexProp,
98
137
  ...rest
99
138
  } = props
100
139
 
101
- const classes = useStyles()
102
140
  const anchorRef = useRef<HTMLDivElement>(null)
103
141
  const titleCase = useTitleCase(propTitleCase)
104
142
  const { isOpened, onItemClick, onItemMouseEnter, onAwayClick } = useMenuItem({
@@ -106,58 +144,62 @@ export const MenuItem: OverridableComponent<Props> = forwardRef<
106
144
  onClick,
107
145
  onMouseEnter,
108
146
  })
147
+ const highlighted = selected || isOpened
109
148
  const isLink = as === Link && rest.href
149
+ const Component: React.ElementType = isLink ? 'a' : as || 'li'
150
+
110
151
  const isIconWrapperVisible = checkmarked !== undefined || icon
111
152
 
153
+ let tabIndex
154
+
155
+ if (!disabled) {
156
+ tabIndex = tabIndexProp !== undefined ? tabIndexProp : -1
157
+ }
158
+
112
159
  return (
113
160
  <>
114
- <MUIMenuItem
115
- {...rest}
161
+ <Component
116
162
  ref={ref}
163
+ role={role}
164
+ tabIndex={tabIndex}
117
165
  // replace Picasso Link with Anchor to not applying Picasso
118
166
  // Link component styles, this is the only difference between them now
119
- component={isLink ? 'a' : as}
120
- classes={{
121
- gutters: classes.gutters,
122
- selected: classes.selected,
123
- }}
124
- className={cx(classes.root, classes[variant], className, {
125
- [classes.nonSelectable]: nonSelectable,
126
- [classes.disabled]: disabled,
127
- })}
167
+ className={twMerge(
168
+ getFontColor({ variant, highlighted }),
169
+ getBackgroundAndActionStyles({ variant, highlighted, nonSelectable }),
170
+ disableGutters ? 'p-0' : 'px-4 py-[0.375rem]',
171
+ 'min-w-[9rem] w-auto min-h-[unset] sm:min-h-[auto] md:min-h-0 relative cursor-pointer',
172
+ 'transition-colors duration-150 ease-in-out',
173
+ 'overflow-hidden whitespace-normal text-left no-underline',
174
+ 'flex items-center justify-start',
175
+ 'outline-none appearance-none leading-4',
176
+ className,
177
+ disabled && 'text-gray-600 opacity-100 pointer-events-none'
178
+ )}
179
+ aria-disabled={Boolean(disabled)}
128
180
  disabled={disabled}
129
- disableGutters={disableGutters}
130
181
  onClick={onItemClick}
131
182
  onMouseEnter={onItemMouseEnter}
132
183
  style={style}
133
184
  value={value}
134
- selected={selected || isOpened}
185
+ {...rest}
135
186
  >
136
- <Container
137
- ref={anchorRef}
138
- className={classes.itemWrapper}
139
- flex
140
- direction='row'
141
- >
142
- {avatar && <Container right='xsmall'>{avatar}</Container>}
187
+ <div ref={anchorRef} className='flex flex-1 max-w-full'>
188
+ {avatar && <div className='mr-2'>{avatar}</div>}
143
189
 
144
- <Container flex direction='column' className={classes.content}>
145
- <Container flex alignItems='center'>
190
+ <div className='flex flex-col flex-1 min-w-0'>
191
+ <div className='flex items-center'>
146
192
  {isIconWrapperVisible && (
147
- <Container
148
- className={classes.iconContainer}
149
- flex
150
- inline
151
- right='xsmall'
152
- >
193
+ <div className='w-4 inline-flex mr-2'>
153
194
  {checkmarked ? <CheckMinor16 /> : icon}
154
- </Container>
195
+ </div>
155
196
  )}
156
197
  {typeof children === 'string' ? (
157
198
  <span
158
- className={cx(classes.stringContent, {
159
- [classes.stringContentSemibold]: checkmarked,
160
- })}
199
+ className={twJoin(
200
+ 'flex-1 text-md leading-5',
201
+ checkmarked && 'text-semibold'
202
+ )}
161
203
  style={style}
162
204
  >
163
205
  {titleCase ? toTitleCase(children) : children}
@@ -166,25 +208,25 @@ export const MenuItem: OverridableComponent<Props> = forwardRef<
166
208
  children
167
209
  )}
168
210
  {menu && (
169
- <Container flex inline left='xsmall'>
211
+ <div className='inline-flex ml-2'>
170
212
  <ChevronMinor16 color='' />
171
- </Container>
213
+ </div>
172
214
  )}
173
- </Container>
215
+ </div>
174
216
  {description && (
175
- <Container
176
- className={cx(classes.description, {
177
- [classes.descriptionDisabled]: disabled,
178
- })}
179
- left={isIconWrapperVisible ? 'medium' : undefined}
180
- top={0.25}
217
+ <div
218
+ className={twJoin(
219
+ 'text-2xs mt-1',
220
+ !disabled && 'text-graphite-700',
221
+ isIconWrapperVisible && 'ml-6'
222
+ )}
181
223
  >
182
224
  {description}
183
- </Container>
225
+ </div>
184
226
  )}
185
- </Container>
186
- </Container>
187
- </MUIMenuItem>
227
+ </div>
228
+ </div>
229
+ </Component>
188
230
  {menu && isOpened && (
189
231
  <Popper
190
232
  anchorEl={anchorRef.current}
@@ -201,7 +243,7 @@ export const MenuItem: OverridableComponent<Props> = forwardRef<
201
243
  }}
202
244
  >
203
245
  <ClickAwayListener onClickAway={onAwayClick}>
204
- <Paper className={classes.paper}>{menu}</Paper>
246
+ <Paper className='max-h-[14.75rem] overflow-y-auto'>{menu}</Paper>
205
247
  </ClickAwayListener>
206
248
  </Popper>
207
249
  )}
@@ -7,21 +7,21 @@ exports[`MenuItem renders 1`] = `
7
7
  >
8
8
  <li
9
9
  aria-disabled="false"
10
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
10
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
11
11
  role="menuitem"
12
12
  tabindex="-1"
13
13
  >
14
14
  <div
15
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
15
+ class="flex flex-1 max-w"
16
16
  >
17
17
  <div
18
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
18
+ class="flex flex-col flex-1 min-w"
19
19
  >
20
20
  <div
21
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
21
+ class="flex items-center"
22
22
  >
23
23
  <span
24
- class="PicassoMenuItem-stringContent"
24
+ class="flex-1 text-md leading-5"
25
25
  >
26
26
  1
27
27
  </span>
@@ -40,21 +40,21 @@ exports[`MenuItem renders checkmarked 1`] = `
40
40
  >
41
41
  <li
42
42
  aria-disabled="false"
43
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
43
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
44
44
  role="menuitem"
45
45
  tabindex="-1"
46
46
  >
47
47
  <div
48
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
48
+ class="flex flex-1 max-w"
49
49
  >
50
50
  <div
51
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
51
+ class="flex flex-col flex-1 min-w"
52
52
  >
53
53
  <div
54
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
54
+ class="flex items-center"
55
55
  >
56
56
  <div
57
- class="PicassoContainer-rightxsmallMargin PicassoContainer-flex PicassoContainer-inline PicassoMenuItem-iconContainer"
57
+ class="w-4 inline-flex mr-2"
58
58
  >
59
59
  <svg
60
60
  class="PicassoSvgCheckMinor16-root"
@@ -67,7 +67,7 @@ exports[`MenuItem renders checkmarked 1`] = `
67
67
  </svg>
68
68
  </div>
69
69
  <span
70
- class="PicassoMenuItem-stringContent PicassoMenuItem-stringContentSemibold"
70
+ class="flex-1 text-md leading-5 text-semibold"
71
71
  >
72
72
  1
73
73
  </span>
@@ -89,21 +89,21 @@ exports[`MenuItem renders in title case with global prop 1`] = `
89
89
  >
90
90
  <li
91
91
  aria-disabled="false"
92
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
92
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
93
93
  role="menuitem"
94
94
  tabindex="-1"
95
95
  >
96
96
  <div
97
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
97
+ class="flex flex-1 max-w"
98
98
  >
99
99
  <div
100
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
100
+ class="flex flex-col flex-1 min-w"
101
101
  >
102
102
  <div
103
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
103
+ class="flex items-center"
104
104
  >
105
105
  <span
106
- class="PicassoMenuItem-stringContent"
106
+ class="flex-1 text-md leading-5"
107
107
  >
108
108
  Arrow
109
109
  </span>
@@ -123,21 +123,21 @@ exports[`MenuItem renders in title case with local prop 1`] = `
123
123
  >
124
124
  <li
125
125
  aria-disabled="false"
126
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
126
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
127
127
  role="menuitem"
128
128
  tabindex="-1"
129
129
  >
130
130
  <div
131
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
131
+ class="flex flex-1 max-w"
132
132
  >
133
133
  <div
134
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
134
+ class="flex flex-col flex-1 min-w"
135
135
  >
136
136
  <div
137
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
137
+ class="flex items-center"
138
138
  >
139
139
  <span
140
- class="PicassoMenuItem-stringContent"
140
+ class="flex-1 text-md leading-5"
141
141
  >
142
142
  Arrow
143
143
  </span>
@@ -156,26 +156,26 @@ exports[`MenuItem renders with a sub menu arrow 1`] = `
156
156
  >
157
157
  <li
158
158
  aria-disabled="false"
159
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
159
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
160
160
  role="menuitem"
161
161
  tabindex="-1"
162
162
  >
163
163
  <div
164
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
164
+ class="flex flex-1 max-w"
165
165
  >
166
166
  <div
167
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
167
+ class="flex flex-col flex-1 min-w"
168
168
  >
169
169
  <div
170
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
170
+ class="flex items-center"
171
171
  >
172
172
  <span
173
- class="PicassoMenuItem-stringContent"
173
+ class="flex-1 text-md leading-5"
174
174
  >
175
175
  1
176
176
  </span>
177
177
  <div
178
- class="PicassoContainer-leftxsmallMargin PicassoContainer-flex PicassoContainer-inline"
178
+ class="inline-flex ml-2"
179
179
  >
180
180
  <svg
181
181
  class="PicassoSvgChevronMinor16-root"
@@ -202,28 +202,27 @@ exports[`MenuItem renders with description 1`] = `
202
202
  >
203
203
  <li
204
204
  aria-disabled="false"
205
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
205
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
206
206
  role="menuitem"
207
207
  tabindex="-1"
208
208
  >
209
209
  <div
210
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
210
+ class="flex flex-1 max-w"
211
211
  >
212
212
  <div
213
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
213
+ class="flex flex-col flex-1 min-w"
214
214
  >
215
215
  <div
216
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
216
+ class="flex items-center"
217
217
  >
218
218
  <span
219
- class="PicassoMenuItem-stringContent"
219
+ class="flex-1 text-md leading-5"
220
220
  >
221
221
  1
222
222
  </span>
223
223
  </div>
224
224
  <div
225
- class="PicassoMenuItem-description"
226
- style="margin-top: 0.25rem;"
225
+ class="text-2xs mt-1 text-graphite"
227
226
  >
228
227
  details
229
228
  </div>
@@ -1,4 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles';
2
- declare const _default: ({ sizes }: Theme) => import("@material-ui/styles").StyleRules<{}, "root" | "backButtonIcon">;
3
- export default _default;
4
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Menu/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;oCAkB1B,KAAK;AAAhC,wBAaI"}
@@ -1,29 +0,0 @@
1
- import { createStyles } from '@material-ui/core/styles';
2
- import { rem } from '@toptal/picasso-shared';
3
- import { PicassoProvider } from '@toptal/picasso-provider';
4
- PicassoProvider.override(({ shadows }) => ({
5
- MuiMenu: {
6
- paper: {
7
- boxShadow: shadows[2],
8
- },
9
- },
10
- MuiList: {
11
- root: {
12
- boxShadow: shadows[1],
13
- },
14
- },
15
- }));
16
- export default ({ sizes }) => createStyles({
17
- root: {
18
- outline: 0,
19
- padding: '0.5rem 0',
20
- borderRadius: sizes.borderRadius.small,
21
- },
22
- backButtonIcon: {
23
- verticalAlign: 'middle',
24
- marginTop: rem('-1px'),
25
- marginRight: rem('4px'),
26
- marginLeft: rem('-5px'),
27
- },
28
- });
29
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/Menu/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,eAAe,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAS,EAAE,EAAE,CAAC,CAAC;IAChD,OAAO,EAAE;QACP,KAAK,EAAE;YACL,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;SACtB;KACF;IACD,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;SACtB;KACF;CACF,CAAC,CAAC,CAAA;AAEH,eAAe,CAAC,EAAE,KAAK,EAAS,EAAE,EAAE,CAClC,YAAY,CAAC;IACX,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,UAAU;QACnB,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK;KACvC;IACD,cAAc,EAAE;QACd,aAAa,EAAE,QAAQ;QACvB,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC;QACtB,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC;QACvB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC;KACxB;CACF,CAAC,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles';
2
- declare const _default: ({ typography, palette }: Theme) => import("@material-ui/styles").StyleRules<{}, "root" | "gutters" | "selected" | "content" | "dark" | "light" | "disabled" | "nonSelectable" | "stringContent" | "stringContentSemibold" | "iconContainer" | "itemWrapper" | "description" | "descriptionDisabled" | "paper">;
3
- export default _default;
4
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/MenuItem/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;kDA2BZ,KAAK;AAA9C,wBAyGI"}
@@ -1,119 +0,0 @@
1
- import { createStyles } from '@material-ui/core/styles';
2
- import { PicassoProvider } from '@toptal/picasso-provider';
3
- import { rem } from '@toptal/picasso-shared';
4
- PicassoProvider.override(() => ({
5
- MuiMenuItem: {
6
- root: {
7
- boxSizing: 'border-box',
8
- lineHeight: '1rem',
9
- padding: 0,
10
- // to override MUI paddingTop and paddingBottom default values
11
- paddingTop: 0,
12
- paddingBottom: 0,
13
- fontSize: '1rem',
14
- minHeight: 'unset',
15
- whiteSpace: 'normal',
16
- },
17
- gutters: {
18
- padding: '0.625rem',
19
- // to override MUI paddingLeft and paddingRight default values
20
- paddingLeft: '0.625rem',
21
- paddingRight: '0.625rem',
22
- },
23
- },
24
- }));
25
- export default ({ typography, palette }) => createStyles({
26
- root: {
27
- minWidth: rem('144'),
28
- '&$nonSelectable:hover, &$nonSelectable:focus': {
29
- backgroundColor: 'unset',
30
- },
31
- '&$disabled': {
32
- color: palette.grey.main2,
33
- pointerEvents: 'none',
34
- opacity: 1,
35
- },
36
- },
37
- light: {
38
- color: palette.common.black,
39
- '&:hover': {
40
- color: palette.common.black,
41
- backgroundColor: palette.blue.lighter,
42
- '&$selected': {
43
- color: palette.common.black,
44
- backgroundColor: palette.blue.lighter,
45
- },
46
- },
47
- '&$selected': {
48
- color: palette.common.black,
49
- backgroundColor: palette.blue.lighter,
50
- },
51
- '&:focus': {
52
- color: palette.common.black,
53
- backgroundColor: palette.blue.lighter,
54
- '&$selected': {
55
- color: palette.common.black,
56
- backgroundColor: palette.blue.lighter,
57
- },
58
- },
59
- },
60
- dark: {
61
- color: palette.grey.main,
62
- '&:hover': {
63
- backgroundColor: palette.grey.dark,
64
- '&$selected': {
65
- color: palette.common.white,
66
- backgroundColor: palette.grey.dark,
67
- },
68
- },
69
- '&$selected': {
70
- color: palette.common.white,
71
- backgroundColor: palette.grey.dark,
72
- },
73
- '&:focus': {
74
- color: palette.common.white,
75
- backgroundColor: palette.grey.dark,
76
- '&$selected': {
77
- color: palette.common.white,
78
- backgroundColor: palette.grey.dark,
79
- },
80
- },
81
- },
82
- selected: {},
83
- nonSelectable: {},
84
- stringContent: {
85
- flex: 1,
86
- fontSize: '0.875rem',
87
- lineHeight: '1.25rem',
88
- },
89
- stringContentSemibold: {
90
- fontWeight: typography.fontWeights.semibold,
91
- },
92
- gutters: {
93
- padding: '0.375rem 1rem',
94
- },
95
- iconContainer: {
96
- width: '1rem',
97
- },
98
- itemWrapper: {
99
- flex: 1,
100
- maxWidth: '100%',
101
- },
102
- content: {
103
- flex: 1,
104
- minWidth: '0px',
105
- },
106
- description: {
107
- fontSize: '0.6875em',
108
- color: palette.text.primary,
109
- },
110
- descriptionDisabled: {
111
- color: 'inherit',
112
- },
113
- paper: {
114
- maxHeight: '14.75rem',
115
- overflowY: 'auto',
116
- },
117
- disabled: {},
118
- });
119
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/MenuItem/styles.ts"],"names":[],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/styles.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/styles.ts"],"names":[],"mappings":""}
@@ -1,32 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles'
2
- import { createStyles } from '@material-ui/core/styles'
3
- import { rem } from '@toptal/picasso-shared'
4
- import { PicassoProvider } from '@toptal/picasso-provider'
5
-
6
- PicassoProvider.override(({ shadows }: Theme) => ({
7
- MuiMenu: {
8
- paper: {
9
- boxShadow: shadows[2],
10
- },
11
- },
12
- MuiList: {
13
- root: {
14
- boxShadow: shadows[1],
15
- },
16
- },
17
- }))
18
-
19
- export default ({ sizes }: Theme) =>
20
- createStyles({
21
- root: {
22
- outline: 0,
23
- padding: '0.5rem 0',
24
- borderRadius: sizes.borderRadius.small,
25
- },
26
- backButtonIcon: {
27
- verticalAlign: 'middle',
28
- marginTop: rem('-1px'),
29
- marginRight: rem('4px'),
30
- marginLeft: rem('-5px'),
31
- },
32
- })