@toptal/picasso-page 5.1.12 → 5.1.13

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.
@@ -1 +1 @@
1
- {"version":3,"file":"PageSidebar.d.ts","sourceRoot":"","sources":["../../../src/PageSidebar/PageSidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAGjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAuD,MAAM,OAAO,CAAA;AAgB3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,MAAM,WAAW,KAAM,SAAQ,SAAS;IACtC,iDAAiD;IACjD,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,cAAc;IACd,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,2EAA2E;IAC3E,OAAO,CAAC,EAAE;QACR,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAC7B,CAAA;IACD,iCAAiC;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAA;IAC7C,2CAA2C;IAC3C,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAClC,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CACxB;AAMD,eAAO,MAAM,WAAW,8EAsGtB,CAAA;;;;;;AASF,wBAIE"}
1
+ {"version":3,"file":"PageSidebar.d.ts","sourceRoot":"","sources":["../../../src/PageSidebar/PageSidebar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAuD,MAAM,OAAO,CAAA;AAe3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,MAAM,WAAW,KAAM,SAAQ,SAAS;IACtC,iDAAiD;IACjD,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,cAAc;IACd,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,2EAA2E;IAC3E,OAAO,CAAC,EAAE;QACR,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAC7B,CAAA;IACD,iCAAiC;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAA;IAC7C,2CAA2C;IAC3C,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAClC,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CACxB;AAaD,eAAO,MAAM,WAAW,8EA8HtB,CAAA;;;;;;AASF,wBAIE"}
@@ -1,7 +1,5 @@
1
- import { makeStyles } from '@material-ui/core/styles';
2
1
  import { useSidebar } from '@toptal/picasso-provider';
3
- import cx from 'classnames';
4
- import { twMerge } from '@toptal/picasso-tailwind-merge';
2
+ import { twMerge, twJoin } from '@toptal/picasso-tailwind-merge';
5
3
  import React, { forwardRef, useCallback, useEffect, useState } from 'react';
6
4
  import { ButtonCircular } from '@toptal/picasso-button';
7
5
  import { Container } from '@toptal/picasso-container';
@@ -12,13 +10,17 @@ import { SidebarItem } from '../SidebarItem';
12
10
  import { SidebarLogo } from '../SidebarLogo';
13
11
  import { SidebarMenu } from '../SidebarMenu';
14
12
  import { SidebarContextProvider } from './SidebarContextProvider';
15
- import styles from './styles';
16
- const useStyles = makeStyles(styles, {
17
- name: 'PageSidebar',
18
- });
13
+ const classesByVariant = {
14
+ light: 'shadow-gray-200 bg-gray-100',
15
+ dark: 'shadow-graphite-800 bg-graphite-800',
16
+ };
17
+ const classesBySize = {
18
+ small: 'w-[212px]',
19
+ medium: 'w-[236px]',
20
+ large: 'w-[280px]',
21
+ };
19
22
  export const PageSidebar = forwardRef(function Sidebar(props, ref) {
20
23
  const { children, variant = 'light', className, style, collapsible, defaultCollapsed, testIds, size = 'medium', wrapperMaxHeight, disableSticky, onCollapse = noop, } = props;
21
- const classes = useStyles();
22
24
  const { setHasSidebar } = useSidebar();
23
25
  const [isCollapsed, setIsCollapsed] = useState(!!defaultCollapsed);
24
26
  const [isHovered, setIsHovered] = useState(false);
@@ -41,21 +43,23 @@ export const PageSidebar = forwardRef(function Sidebar(props, ref) {
41
43
  setIsCollapsed(previousState => !previousState);
42
44
  onCollapse();
43
45
  }, [setIsCollapsed, onCollapse]);
44
- return (React.createElement(Container, { ref: ref, style: style, className: cx(classes.root, className, classes[variant], classes[size], {
45
- [classes.rootCollapsed]: collapsible && isCollapsed,
46
- [classes.hamburgerNotAvailable]: !hasTopBar,
47
- }), "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.container, onMouseEnter: collapsible ? () => setIsHovered(true) : noop, onMouseLeave: collapsible ? () => setIsHovered(false) : noop },
46
+ return (React.createElement(Container, { ref: ref, style: style, className: twMerge('h-full', 'shadow-[inset_-1px_0_0_0]', 'text-lg/[inherit]', 'relative', 'transition-[width] ease-in-out delay-[225ms]', 'hidden min-[1280px]:block', '[&]:before:absolute', '[&]:before:content-[""]', '[&]:before:left-0', '[&]:before:top-0', '[&]:before:w-[15.5rem]', '[&]:before:h-full', className, classesByVariant[variant], classesBySize[size], 'xs:max-md:overflow-y-scroll', collapsible &&
47
+ isCollapsed && [
48
+ 'w-[5rem]',
49
+ '[&]:before:w-[5.75rem]',
50
+ '[&_.scrollable-content]:[-ms-overflow-style:none]',
51
+ '[&_.scrollable-content]:[scrollbar-width:none]',
52
+ ], !hasTopBar && 'block'), "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.container, onMouseEnter: collapsible ? () => setIsHovered(true) : noop, onMouseLeave: collapsible ? () => setIsHovered(false) : noop },
48
53
  React.createElement(PageHamburgerPortal, null, children),
49
54
  React.createElement("div", { style: {
50
55
  maxHeight: wrapperMaxHeight,
51
- }, className: cx(classes.wrapper, {
52
- [classes.sticky]: !disableSticky,
53
- }) },
54
- React.createElement(Container, { flex: true, direction: 'column', className: classes.scrollableContent, "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.scrollableContainer },
56
+ }, className: twJoin('h-full', !disableSticky &&
57
+ 'max-h-[calc(100vh-var(--header-height,3.5rem))] sticky top-[var(--header-height,3.5rem)]') },
58
+ React.createElement(Container, { flex: true, direction: 'column', className: 'scrollable-content h-full overflow-y-auto pt-4 pb-2 px-0', "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.scrollableContainer },
55
59
  collapsible && (React.createElement(ButtonCircular, { className: twMerge(
56
60
  // TODO: [FX-XXXX] technical debt: button color/background/radius/shadow shouldn't be overwritten
57
61
  'absolute -right-3 top-3 invisible text-graphite-700 bg-white rounded-full shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_0_8px_0_rgba(0,0,0,0.16)] z-[100] hover:text-white hover:bg-blue-500', isHovered && 'visible'), onClick: handleCollapseButtonClick, icon: isCollapsed ? React.createElement(ChevronRight16, null) : React.createElement(BackMinor16, null), "aria-label": 'collapse sidebar', variant: 'primary', "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.collapseButton })),
58
- React.createElement("div", { className: classes.spacer }),
62
+ React.createElement("div", { className: 'order-[50] flex-1 h-full' }),
59
63
  React.createElement(SidebarContextProvider, { isCollapsed: isCollapsed, isHovered: isHovered, variant: variant, expandedItemKey: expandedItemKey, setExpandedItemKey: setExpandedItemKey }, children)))));
60
64
  });
61
65
  PageSidebar.defaultProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"PageSidebar.js","sourceRoot":"","sources":["../../../src/PageSidebar/PageSidebar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAErD,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAExD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAE5C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,GAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,MAAM,MAAM,UAAU,CAAA;AA2B7B,MAAM,SAAS,GAAG,UAAU,CAAQ,MAAM,EAAE;IAC1C,IAAI,EAAE,aAAa;CACpB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAwB,SAAS,OA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aAC5B,EACD,SAAS,EAAE,MAAM,CACf,QAAQ,EACR,CAAC,aAAa;gBACZ,0FAA0F,CAC7F;YAED,oBAAC,SAAS,IACR,IAAI,QACJ,SAAS,EAAC,QAAQ,EAClB,SAAS,EAAC,0DAA0D,iBACvD,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB;gBAExC,WAAW,IAAI,CACd,oBAAC,cAAc,IACb,SAAS,EAAE,OAAO;oBAChB,iGAAiG;oBACjG,qLAAqL,EACrL,SAAS,IAAI,SAAS,CACvB,EACD,OAAO,EAAE,yBAAyB,EAClC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,oBAAC,cAAc,OAAG,CAAC,CAAC,CAAC,oBAAC,WAAW,OAAG,gBAC7C,kBAAkB,EAC7B,OAAO,EAAC,SAAS,iBACJ,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,GACpC,CACH;gBACD,6BAAK,SAAS,EAAC,0BAA0B,GAAG;gBAC5C,oBAAC,sBAAsB,IACrB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,kBAAkB,IAErC,QAAQ,CACc,CACf,CACR,CACI,CACb,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,WAAW,CAAC,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,QAAQ;CACf,CAAA;AAED,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AAEvC,eAAe,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IACxC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;CAClB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/picasso-page",
3
- "version": "5.1.12",
3
+ "version": "5.1.13",
4
4
  "description": "Toptal UI components library - Page",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,22 +22,22 @@
22
22
  },
23
23
  "homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
24
24
  "dependencies": {
25
- "@toptal/picasso-accordion": "3.0.11",
26
- "@toptal/picasso-autocomplete": "5.0.12",
27
- "@toptal/picasso-avatar": "6.1.3",
25
+ "@toptal/picasso-accordion": "3.0.12",
26
+ "@toptal/picasso-autocomplete": "5.0.13",
27
+ "@toptal/picasso-avatar": "6.1.4",
28
28
  "@toptal/picasso-badge": "3.0.2",
29
- "@toptal/picasso-button": "4.0.12",
29
+ "@toptal/picasso-button": "4.0.13",
30
30
  "@toptal/picasso-container": "3.1.0",
31
31
  "@toptal/picasso-dropdown": "4.2.0",
32
- "@toptal/picasso-icons": "1.7.0",
33
- "@toptal/picasso-logo": "2.0.2",
34
- "@toptal/picasso-menu": "3.0.8",
35
- "@toptal/picasso-notification": "4.0.12",
32
+ "@toptal/picasso-icons": "1.8.0",
33
+ "@toptal/picasso-logo": "2.0.3",
34
+ "@toptal/picasso-menu": "3.0.9",
35
+ "@toptal/picasso-notification": "4.0.13",
36
36
  "@toptal/picasso-shared": "15.0.0",
37
- "@toptal/picasso-tag": "4.0.3",
37
+ "@toptal/picasso-tag": "4.0.4",
38
38
  "@toptal/picasso-tooltip": "2.0.0",
39
39
  "@toptal/picasso-typography": "4.0.1",
40
- "@toptal/picasso-user-badge": "5.1.4",
40
+ "@toptal/picasso-user-badge": "5.1.5",
41
41
  "@toptal/picasso-utils": "2.0.0",
42
42
  "classnames": "^2.5.1"
43
43
  },
@@ -1,9 +1,6 @@
1
- import type { Theme } from '@material-ui/core/styles'
2
- import { makeStyles } from '@material-ui/core/styles'
3
1
  import { useSidebar } from '@toptal/picasso-provider'
4
2
  import type { BaseProps, SizeType } from '@toptal/picasso-shared'
5
- import cx from 'classnames'
6
- import { twMerge } from '@toptal/picasso-tailwind-merge'
3
+ import { twMerge, twJoin } from '@toptal/picasso-tailwind-merge'
7
4
  import type { ReactNode } from 'react'
8
5
  import React, { forwardRef, useCallback, useEffect, useState } from 'react'
9
6
  import { ButtonCircular } from '@toptal/picasso-button'
@@ -20,7 +17,6 @@ import { SidebarItem } from '../SidebarItem'
20
17
  import { SidebarLogo } from '../SidebarLogo'
21
18
  import { SidebarMenu } from '../SidebarMenu'
22
19
  import { SidebarContextProvider } from './SidebarContextProvider'
23
- import styles from './styles'
24
20
  import type { VariantType } from './types'
25
21
 
26
22
  export interface Props extends BaseProps {
@@ -47,9 +43,16 @@ export interface Props extends BaseProps {
47
43
  onCollapse?: () => void
48
44
  }
49
45
 
50
- const useStyles = makeStyles<Theme>(styles, {
51
- name: 'PageSidebar',
52
- })
46
+ const classesByVariant = {
47
+ light: 'shadow-gray-200 bg-gray-100',
48
+ dark: 'shadow-graphite-800 bg-graphite-800',
49
+ }
50
+
51
+ const classesBySize = {
52
+ small: 'w-[212px]',
53
+ medium: 'w-[236px]',
54
+ large: 'w-[280px]',
55
+ }
53
56
 
54
57
  export const PageSidebar = forwardRef<HTMLDivElement, Props>(function Sidebar(
55
58
  props,
@@ -68,7 +71,7 @@ export const PageSidebar = forwardRef<HTMLDivElement, Props>(function Sidebar(
68
71
  disableSticky,
69
72
  onCollapse = noop,
70
73
  } = props
71
- const classes = useStyles()
74
+
72
75
  const { setHasSidebar } = useSidebar()
73
76
  const [isCollapsed, setIsCollapsed] = useState(!!defaultCollapsed)
74
77
  const [isHovered, setIsHovered] = useState(false)
@@ -101,10 +104,32 @@ export const PageSidebar = forwardRef<HTMLDivElement, Props>(function Sidebar(
101
104
  <Container
102
105
  ref={ref}
103
106
  style={style}
104
- className={cx(classes.root, className, classes[variant], classes[size], {
105
- [classes.rootCollapsed]: collapsible && isCollapsed,
106
- [classes.hamburgerNotAvailable]: !hasTopBar,
107
- })}
107
+ className={twMerge(
108
+ 'h-full',
109
+ 'shadow-[inset_-1px_0_0_0]',
110
+ 'text-lg/[inherit]',
111
+ 'relative',
112
+ 'transition-[width] ease-in-out delay-[225ms]',
113
+ 'hidden min-[1280px]:block',
114
+ '[&]:before:absolute',
115
+ '[&]:before:content-[""]',
116
+ '[&]:before:left-0',
117
+ '[&]:before:top-0',
118
+ '[&]:before:w-[15.5rem]',
119
+ '[&]:before:h-full',
120
+ className,
121
+ classesByVariant[variant],
122
+ classesBySize[size],
123
+ 'xs:max-md:overflow-y-scroll',
124
+ collapsible &&
125
+ isCollapsed && [
126
+ 'w-[5rem]',
127
+ '[&]:before:w-[5.75rem]',
128
+ '[&_.scrollable-content]:[-ms-overflow-style:none]',
129
+ '[&_.scrollable-content]:[scrollbar-width:none]',
130
+ ],
131
+ !hasTopBar && 'block'
132
+ )}
108
133
  data-testid={testIds?.container}
109
134
  onMouseEnter={collapsible ? () => setIsHovered(true) : noop}
110
135
  onMouseLeave={collapsible ? () => setIsHovered(false) : noop}
@@ -115,14 +140,16 @@ export const PageSidebar = forwardRef<HTMLDivElement, Props>(function Sidebar(
115
140
  style={{
116
141
  maxHeight: wrapperMaxHeight,
117
142
  }}
118
- className={cx(classes.wrapper, {
119
- [classes.sticky]: !disableSticky,
120
- })}
143
+ className={twJoin(
144
+ 'h-full',
145
+ !disableSticky &&
146
+ 'max-h-[calc(100vh-var(--header-height,3.5rem))] sticky top-[var(--header-height,3.5rem)]'
147
+ )}
121
148
  >
122
149
  <Container
123
150
  flex
124
151
  direction='column'
125
- className={classes.scrollableContent}
152
+ className='scrollable-content h-full overflow-y-auto pt-4 pb-2 px-0'
126
153
  data-testid={testIds?.scrollableContainer}
127
154
  >
128
155
  {collapsible && (
@@ -139,7 +166,7 @@ export const PageSidebar = forwardRef<HTMLDivElement, Props>(function Sidebar(
139
166
  data-testid={testIds?.collapseButton}
140
167
  />
141
168
  )}
142
- <div className={classes.spacer} />
169
+ <div className='order-[50] flex-1 h-full' />
143
170
  <SidebarContextProvider
144
171
  isCollapsed={isCollapsed}
145
172
  isHovered={isHovered}
@@ -6,16 +6,16 @@ exports[`PageSidebar renders 1`] = `
6
6
  class="Picasso-root"
7
7
  >
8
8
  <div
9
- class="PageSidebar-root PageSidebar-light PageSidebar-medium PageSidebar-hamburgerNotAvailable"
9
+ class="h-full shadow-[inset_-1px_0_0_0] text-lg/[inherit] relative transition-[width] ease-in delay-[225ms] min-[1280px]:block [&]:before:absolute [&]:before:content-[""] [&]:before:left-0 [&]:before:top-0 [&]:before:w-[15.5rem] [&]:before:h-full shadow-gray bg-gray w-[236px] xs:max-md:overflow-y block"
10
10
  >
11
11
  <div
12
- class="PageSidebar-wrapper PageSidebar-sticky"
12
+ class="h-full max-h-[calc(100vh-var(--header sticky top-[var(--header"
13
13
  >
14
14
  <div
15
- class="flex flex-col PageSidebar-scrollableContent"
15
+ class="flex flex-col scrollable-content h-full overflow-y pt-4 pb-2 px-0"
16
16
  >
17
17
  <div
18
- class="PageSidebar-spacer"
18
+ class="order-[50] flex-1 h-full"
19
19
  />
20
20
  </div>
21
21
  </div>
@@ -30,16 +30,16 @@ exports[`PageSidebar with menu 1`] = `
30
30
  class="Picasso-root"
31
31
  >
32
32
  <div
33
- class="PageSidebar-root PageSidebar-light PageSidebar-medium PageSidebar-hamburgerNotAvailable"
33
+ class="h-full shadow-[inset_-1px_0_0_0] text-lg/[inherit] relative transition-[width] ease-in delay-[225ms] min-[1280px]:block [&]:before:absolute [&]:before:content-[""] [&]:before:left-0 [&]:before:top-0 [&]:before:w-[15.5rem] [&]:before:h-full shadow-gray bg-gray w-[236px] xs:max-md:overflow-y block"
34
34
  >
35
35
  <div
36
- class="PageSidebar-wrapper PageSidebar-sticky"
36
+ class="h-full max-h-[calc(100vh-var(--header sticky top-[var(--header"
37
37
  >
38
38
  <div
39
- class="flex flex-col PageSidebar-scrollableContent"
39
+ class="flex flex-col scrollable-content h-full overflow-y pt-4 pb-2 px-0"
40
40
  >
41
41
  <div
42
- class="PageSidebar-spacer"
42
+ class="order-[50] flex-1 h-full"
43
43
  />
44
44
  <ul
45
45
  class="relative list-none outline-none py-2 px-0 m-0 rounded-sm shadow-0 order-1 [&_&]:flex-1 flex-grow flex-shrink max-w"
@@ -59,16 +59,16 @@ exports[`PageSidebar with one normal and one bottom menu 1`] = `
59
59
  class="Picasso-root"
60
60
  >
61
61
  <div
62
- class="PageSidebar-root PageSidebar-light PageSidebar-medium PageSidebar-hamburgerNotAvailable"
62
+ class="h-full shadow-[inset_-1px_0_0_0] text-lg/[inherit] relative transition-[width] ease-in delay-[225ms] min-[1280px]:block [&]:before:absolute [&]:before:content-[""] [&]:before:left-0 [&]:before:top-0 [&]:before:w-[15.5rem] [&]:before:h-full shadow-gray bg-gray w-[236px] xs:max-md:overflow-y block"
63
63
  >
64
64
  <div
65
- class="PageSidebar-wrapper PageSidebar-sticky"
65
+ class="h-full max-h-[calc(100vh-var(--header sticky top-[var(--header"
66
66
  >
67
67
  <div
68
- class="flex flex-col PageSidebar-scrollableContent"
68
+ class="flex flex-col scrollable-content h-full overflow-y pt-4 pb-2 px-0"
69
69
  >
70
70
  <div
71
- class="PageSidebar-spacer"
71
+ class="order-[50] flex-1 h-full"
72
72
  />
73
73
  <ul
74
74
  class="relative list-none outline-none py-2 px-0 m-0 rounded-sm shadow-0 order-1 [&_&]:flex-1 flex-grow flex-shrink max-w"
@@ -6,16 +6,16 @@ exports[`SidebarItem collapsible menu is expanded when one of the children is se
6
6
  class="Picasso-root"
7
7
  >
8
8
  <div
9
- class="PageSidebar-root PageSidebar-light PageSidebar-medium PageSidebar-hamburgerNotAvailable"
9
+ class="h-full shadow-[inset_-1px_0_0_0] text-lg/[inherit] relative transition-[width] ease-in delay-[225ms] min-[1280px]:block [&]:before:absolute [&]:before:content-[""] [&]:before:left-0 [&]:before:top-0 [&]:before:w-[15.5rem] [&]:before:h-full shadow-gray bg-gray w-[236px] xs:max-md:overflow-y block"
10
10
  >
11
11
  <div
12
- class="PageSidebar-wrapper PageSidebar-sticky"
12
+ class="h-full max-h-[calc(100vh-var(--header sticky top-[var(--header"
13
13
  >
14
14
  <div
15
- class="flex flex-col PageSidebar-scrollableContent"
15
+ class="flex flex-col scrollable-content h-full overflow-y pt-4 pb-2 px-0"
16
16
  >
17
17
  <div
18
- class="PageSidebar-spacer"
18
+ class="order-[50] flex-1 h-full"
19
19
  />
20
20
  <ul
21
21
  class="relative list-none outline-none py-2 px-0 m-0 rounded-sm shadow-0 order-1 [&_&]:flex-1 flex-grow flex-shrink max-w"
@@ -152,16 +152,16 @@ exports[`SidebarItem collapsible menu is expanded when one of the children is se
152
152
  class="Picasso-root"
153
153
  >
154
154
  <div
155
- class="PageSidebar-root PageSidebar-light PageSidebar-medium PageSidebar-hamburgerNotAvailable"
155
+ class="h-full shadow-[inset_-1px_0_0_0] text-lg/[inherit] relative transition-[width] ease-in delay-[225ms] min-[1280px]:block [&]:before:absolute [&]:before:content-[""] [&]:before:left-0 [&]:before:top-0 [&]:before:w-[15.5rem] [&]:before:h-full shadow-gray bg-gray w-[236px] xs:max-md:overflow-y block"
156
156
  >
157
157
  <div
158
- class="PageSidebar-wrapper PageSidebar-sticky"
158
+ class="h-full max-h-[calc(100vh-var(--header sticky top-[var(--header"
159
159
  >
160
160
  <div
161
- class="flex flex-col PageSidebar-scrollableContent"
161
+ class="flex flex-col scrollable-content h-full overflow-y pt-4 pb-2 px-0"
162
162
  >
163
163
  <div
164
- class="PageSidebar-spacer"
164
+ class="order-[50] flex-1 h-full"
165
165
  />
166
166
  <ul
167
167
  class="relative list-none outline-none py-2 px-0 m-0 rounded-sm shadow-0 order-1 [&_&]:flex-1 flex-grow flex-shrink max-w"
@@ -1,4 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles';
2
- declare const _default: ({ palette, screens, transitions }: Theme) => import("@material-ui/styles").StyleRules<{}, "small" | "root" | "large" | "medium" | "dark" | "light" | "sticky" | "wrapper" | "hamburgerNotAvailable" | "scrollableContent" | "spacer" | "rootCollapsed">;
3
- export default _default;
4
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/PageSidebar/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;4DAMF,KAAK;AAAxD,wBAiFI"}
@@ -1,82 +0,0 @@
1
- import { createStyles } from '@material-ui/core/styles';
2
- import { rem } from '@toptal/picasso-shared';
3
- import { headerBreakingPointXL } from '../PageTopBar/constants';
4
- export default ({ palette, screens, transitions }) => createStyles({
5
- root: {
6
- height: '100%',
7
- boxShadow: `inset -1px 0px 0px 0px ${palette.grey.darker}`,
8
- fontSize: '1rem',
9
- position: 'relative',
10
- transition: `width ${transitions.duration.enteringScreen}ms ease-in-out`,
11
- display: 'none',
12
- [headerBreakingPointXL]: {
13
- display: 'block',
14
- },
15
- [screens('xs', 'sm')]: {
16
- width: '100vw',
17
- overflowY: 'scroll',
18
- },
19
- '&::before': {
20
- position: 'absolute',
21
- content: '""',
22
- left: 0,
23
- top: 0,
24
- width: '15.50rem',
25
- height: '100%',
26
- },
27
- },
28
- hamburgerNotAvailable: {
29
- display: 'block',
30
- },
31
- wrapper: {
32
- height: '100%',
33
- '&$sticky': {
34
- maxHeight: `calc(100vh - var(--header-height,3.5rem))`,
35
- position: 'sticky',
36
- top: 'var(--header-height, 3.5rem)',
37
- },
38
- },
39
- scrollableContent: {
40
- height: '100%',
41
- overflowY: 'auto',
42
- padding: '1rem 0 0.5rem',
43
- },
44
- small: {
45
- width: rem('212px'),
46
- },
47
- medium: {
48
- width: rem('236px'),
49
- },
50
- large: {
51
- width: rem('280px'),
52
- },
53
- spacer: {
54
- order: 50,
55
- flex: 1,
56
- height: '100%',
57
- },
58
- light: {
59
- boxShadow: `inset -1px 0px 0px 0px ${palette.grey.lighter2}`,
60
- backgroundColor: palette.grey.lighter,
61
- },
62
- dark: {
63
- boxShadow: `inset -1px 0px 0px 0px ${palette.grey.darker}`,
64
- backgroundColor: palette.grey.darker,
65
- },
66
- rootCollapsed: {
67
- width: '5rem',
68
- transition: `width ${transitions.duration.leavingScreen}ms ease-in-out`,
69
- '&::before': {
70
- width: '5.75rem',
71
- },
72
- '& $scrollableContent': {
73
- '-ms-overflow-style': 'none',
74
- 'scrollbar-width': 'none',
75
- '&::-webkit-scrollbar': {
76
- display: 'none',
77
- },
78
- },
79
- },
80
- sticky: {},
81
- });
82
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/PageSidebar/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE/D,eAAe,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAS,EAAE,EAAE,CAC1D,YAAY,CAAC;IACX,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,0BAA0B,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;QAC1D,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,UAAU;QACpB,UAAU,EAAE,SAAS,WAAW,CAAC,QAAQ,CAAC,cAAc,gBAAgB;QACxE,OAAO,EAAE,MAAM;QACf,CAAC,qBAAqB,CAAC,EAAE;YACvB,OAAO,EAAE,OAAO;SACjB;QAED,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE;YACrB,KAAK,EAAE,OAAO;YACd,SAAS,EAAE,QAAQ;SACpB;QAED,WAAW,EAAE;YACX,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,UAAU;YACjB,MAAM,EAAE,MAAM;SACf;KACF;IACD,qBAAqB,EAAE;QACrB,OAAO,EAAE,OAAO;KACjB;IACD,OAAO,EAAE;QACP,MAAM,EAAE,MAAM;QACd,UAAU,EAAE;YACV,SAAS,EAAE,2CAA2C;YACtD,QAAQ,EAAE,QAAQ;YAClB,GAAG,EAAE,8BAA8B;SACpC;KACF;IACD,iBAAiB,EAAE;QACjB,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,MAAM;QACjB,OAAO,EAAE,eAAe;KACzB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;KACpB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;KACpB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;KACpB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,CAAC;QACP,MAAM,EAAE,MAAM;KACf;IACD,KAAK,EAAE;QACL,SAAS,EAAE,0BAA0B,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;QAC5D,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO;KACtC;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,0BAA0B,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;QAC1D,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;KACrC;IACD,aAAa,EAAE;QACb,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,SAAS,WAAW,CAAC,QAAQ,CAAC,aAAa,gBAAgB;QAEvE,WAAW,EAAE;YACX,KAAK,EAAE,SAAS;SACjB;QACD,sBAAsB,EAAE;YACtB,oBAAoB,EAAE,MAAM;YAC5B,iBAAiB,EAAE,MAAM;YACzB,sBAAsB,EAAE;gBACtB,OAAO,EAAE,MAAM;aAChB;SACF;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC,CAAA"}
@@ -1,88 +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
-
5
- import { headerBreakingPointXL } from '../PageTopBar/constants'
6
-
7
- export default ({ palette, screens, transitions }: Theme) =>
8
- createStyles({
9
- root: {
10
- height: '100%',
11
- boxShadow: `inset -1px 0px 0px 0px ${palette.grey.darker}`,
12
- fontSize: '1rem',
13
- position: 'relative',
14
- transition: `width ${transitions.duration.enteringScreen}ms ease-in-out`,
15
- display: 'none',
16
- [headerBreakingPointXL]: {
17
- display: 'block',
18
- },
19
-
20
- [screens('xs', 'sm')]: {
21
- width: '100vw',
22
- overflowY: 'scroll',
23
- },
24
-
25
- '&::before': {
26
- position: 'absolute',
27
- content: '""',
28
- left: 0,
29
- top: 0,
30
- width: '15.50rem',
31
- height: '100%',
32
- },
33
- },
34
- hamburgerNotAvailable: {
35
- display: 'block',
36
- },
37
- wrapper: {
38
- height: '100%',
39
- '&$sticky': {
40
- maxHeight: `calc(100vh - var(--header-height,3.5rem))`,
41
- position: 'sticky',
42
- top: 'var(--header-height, 3.5rem)',
43
- },
44
- },
45
- scrollableContent: {
46
- height: '100%',
47
- overflowY: 'auto',
48
- padding: '1rem 0 0.5rem',
49
- },
50
- small: {
51
- width: rem('212px'),
52
- },
53
- medium: {
54
- width: rem('236px'),
55
- },
56
- large: {
57
- width: rem('280px'),
58
- },
59
- spacer: {
60
- order: 50,
61
- flex: 1,
62
- height: '100%',
63
- },
64
- light: {
65
- boxShadow: `inset -1px 0px 0px 0px ${palette.grey.lighter2}`,
66
- backgroundColor: palette.grey.lighter,
67
- },
68
- dark: {
69
- boxShadow: `inset -1px 0px 0px 0px ${palette.grey.darker}`,
70
- backgroundColor: palette.grey.darker,
71
- },
72
- rootCollapsed: {
73
- width: '5rem',
74
- transition: `width ${transitions.duration.leavingScreen}ms ease-in-out`,
75
-
76
- '&::before': {
77
- width: '5.75rem',
78
- },
79
- '& $scrollableContent': {
80
- '-ms-overflow-style': 'none',
81
- 'scrollbar-width': 'none',
82
- '&::-webkit-scrollbar': {
83
- display: 'none',
84
- },
85
- },
86
- },
87
- sticky: {},
88
- })