@mirohq/design-system-scroll-area 0.1.1 → 0.1.3
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/main.js +11 -22
- package/dist/main.js.map +1 -1
- package/dist/module.js +11 -22
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +14 -14
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var reactScrollArea = require('@radix-ui/react-scroll-area');
|
|
7
8
|
var designSystemStitches = require('@mirohq/design-system-stitches');
|
|
@@ -13,31 +14,28 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
13
14
|
const StyledViewport = designSystemStitches.styled(reactScrollArea.Viewport, {
|
|
14
15
|
width: "100%",
|
|
15
16
|
height: "100%",
|
|
16
|
-
padding: "
|
|
17
|
+
padding: "$50"
|
|
17
18
|
});
|
|
18
19
|
|
|
19
|
-
const Viewport = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
20
|
-
...props,
|
|
21
|
-
ref: forwardRef
|
|
22
|
-
}));
|
|
20
|
+
const Viewport = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledViewport, { ...props, ref: forwardRef }));
|
|
23
21
|
|
|
24
22
|
const StyledScrollbar = designSystemStitches.styled(reactScrollArea.Scrollbar, {
|
|
25
23
|
display: "flex",
|
|
24
|
+
// ensures no selection
|
|
26
25
|
userSelect: "none",
|
|
26
|
+
// disable browser handling of all panning and zooming gestures on touch devices
|
|
27
27
|
touchAction: "none",
|
|
28
28
|
background: "transparent",
|
|
29
29
|
transition: "background 160ms ease-out",
|
|
30
30
|
'&[data-orientation="vertical"]': { width: "$1", minHeight: "$2" },
|
|
31
31
|
'&[data-orientation="horizontal"]': {
|
|
32
32
|
flexDirection: "column",
|
|
33
|
-
height: "$1"
|
|
33
|
+
height: "$1",
|
|
34
|
+
padding: "0 2px"
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
|
|
37
|
-
const Scrollbar = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
38
|
-
...props,
|
|
39
|
-
ref: forwardRef
|
|
40
|
-
}));
|
|
38
|
+
const Scrollbar = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledScrollbar, { ...props, ref: forwardRef }));
|
|
41
39
|
|
|
42
40
|
const StyledThumb = designSystemStitches.styled(reactScrollArea.Thumb, {
|
|
43
41
|
flex: 1,
|
|
@@ -60,25 +58,16 @@ const StyledThumb = designSystemStitches.styled(reactScrollArea.Thumb, {
|
|
|
60
58
|
}
|
|
61
59
|
});
|
|
62
60
|
|
|
63
|
-
const Thumb = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
64
|
-
...props,
|
|
65
|
-
ref: forwardRef
|
|
66
|
-
}));
|
|
61
|
+
const Thumb = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledThumb, { ...props, ref: forwardRef }));
|
|
67
62
|
|
|
68
63
|
const StyledCorner = designSystemStitches.styled(reactScrollArea.Corner);
|
|
69
|
-
const Corner = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
70
|
-
...props,
|
|
71
|
-
ref: forwardRef
|
|
72
|
-
}));
|
|
64
|
+
const Corner = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledCorner, { ...props, ref: forwardRef }));
|
|
73
65
|
|
|
74
66
|
const StyledScrollArea = designSystemStitches.styled(reactScrollArea.Root, {
|
|
75
67
|
overflow: "hidden"
|
|
76
68
|
});
|
|
77
69
|
|
|
78
|
-
const ScrollArea = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
79
|
-
...props,
|
|
80
|
-
ref: forwardRef
|
|
81
|
-
}));
|
|
70
|
+
const ScrollArea = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledScrollArea, { ...props, ref: forwardRef }));
|
|
82
71
|
ScrollArea.Viewport = Viewport;
|
|
83
72
|
ScrollArea.Scrollbar = Scrollbar;
|
|
84
73
|
ScrollArea.Thumb = Thumb;
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/partials/viewport.styled.tsx","../src/partials/viewport.tsx","../src/partials/scrollbar.styled.tsx","../src/partials/scrollbar.tsx","../src/partials/thumb.styled.tsx","../src/partials/thumb.tsx","../src/partials/corner.tsx","../src/scroll-area.styled.tsx","../src/scroll-area.tsx"],"sourcesContent":["import { Viewport as RadixViewport } from '@radix-ui/react-scroll-area'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledViewport = styled(RadixViewport, {\n width: '100%',\n height: '100%',\n padding: '
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/partials/viewport.styled.tsx","../src/partials/viewport.tsx","../src/partials/scrollbar.styled.tsx","../src/partials/scrollbar.tsx","../src/partials/thumb.styled.tsx","../src/partials/thumb.tsx","../src/partials/corner.tsx","../src/scroll-area.styled.tsx","../src/scroll-area.tsx"],"sourcesContent":["import { Viewport as RadixViewport } from '@radix-ui/react-scroll-area'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledViewport = styled(RadixViewport, {\n width: '100%',\n height: '100%',\n padding: '$50',\n})\n\nexport type StyledViewportProps = StrictComponentProps<typeof StyledViewport>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledViewport } from './viewport.styled'\nimport type { StyledViewportProps } from './viewport.styled'\n\nexport interface ViewportProps extends StyledViewportProps {}\n\nexport const Viewport = React.forwardRef<\n ElementRef<typeof StyledViewport>,\n ViewportProps\n>((props, forwardRef) => <StyledViewport {...props} ref={forwardRef} />)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Scrollbar as RadixScrollbar } from '@radix-ui/react-scroll-area'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledScrollbar = styled(RadixScrollbar, {\n display: 'flex',\n // ensures no selection\n userSelect: 'none',\n // disable browser handling of all panning and zooming gestures on touch devices\n touchAction: 'none',\n background: 'transparent',\n transition: 'background 160ms ease-out',\n '&[data-orientation=\"vertical\"]': { width: '$1', minHeight: '$2' },\n '&[data-orientation=\"horizontal\"]': {\n flexDirection: 'column',\n height: '$1',\n padding: '0 2px',\n },\n})\n\nexport type StyledScrollbarProps = StrictComponentProps<typeof StyledScrollbar>\n","import type { ElementRef } from 'react'\nimport React from 'react'\n\nimport { StyledScrollbar } from './scrollbar.styled'\nimport type { StyledScrollbarProps } from './scrollbar.styled'\n\nexport interface ScrollbarProps extends StyledScrollbarProps {\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries.\n */\n forceMount?: true\n\n /**\n * The orientation of the scrollbar.\n */\n orientation?: 'horizontal' | 'vertical'\n}\n\nexport const Scrollbar = React.forwardRef<\n ElementRef<typeof StyledScrollbar>,\n ScrollbarProps\n>((props, forwardRef) => <StyledScrollbar {...props} ref={forwardRef} />)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Thumb as RadixThumb } from '@radix-ui/react-scroll-area'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledThumb = styled(RadixThumb, {\n flex: 1,\n background: '$background-neutrals-scrolls',\n borderRadius: '$50',\n position: 'relative',\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: '100%',\n height: '100%',\n minWidth: '$6',\n minHeight: '$6',\n },\n '&:hover': {\n backgroundColor: '$background-neutrals-scrolls-hover',\n },\n})\nexport type StyledThumbProps = StrictComponentProps<typeof StyledThumb>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledThumb } from './thumb.styled'\nimport type { StyledThumbProps } from './thumb.styled'\n\nexport interface ThumbProps extends StyledThumbProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true\n}\n\nexport const Thumb = React.forwardRef<\n ElementRef<typeof StyledThumb>,\n ThumbProps\n>((props, forwardRef) => <StyledThumb {...props} ref={forwardRef} />)\n","import React from 'react'\nimport { Corner as RadixCorner } from '@radix-ui/react-scroll-area'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport type { ElementRef } from 'react'\n\nconst StyledCorner = styled(RadixCorner)\ntype StyledCornerProps = StrictComponentProps<typeof StyledCorner>\n\nexport interface CornerProps extends StyledCornerProps {}\n\nexport const Corner = React.forwardRef<\n ElementRef<typeof StyledCorner>,\n CornerProps\n>((props, forwardRef) => <StyledCorner {...props} ref={forwardRef} />)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Root as RadixScrollArea } from '@radix-ui/react-scroll-area'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledScrollArea = styled(RadixScrollArea, {\n overflow: 'hidden',\n})\nexport type StyledScrollAreaProps = StrictComponentProps<\n typeof StyledScrollArea\n>\n","import React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport { Viewport } from './partials/viewport'\nimport { Scrollbar } from './partials/scrollbar'\nimport { Thumb } from './partials/thumb'\nimport { Corner } from './partials/corner'\nimport { StyledScrollArea } from './scroll-area.styled'\nimport type { StyledScrollAreaProps } from './scroll-area.styled'\n\nexport interface ScrollAreaProps extends StyledScrollAreaProps {\n children: React.ReactNode\n\n /**\n * Describes the nature of scrollbar visibility, similar to how the scrollbar preferences in MacOS control visibility of native scrollbars.\n \"auto\" means that scrollbars are visible when content is overflowing on the corresponding orientation.\n \"always\" means that scrollbars are always visible regardless of whether the content is overflowing.\n \"scroll\" means that scrollbars are visible when the user is scrolling along its corresponding orientation.\n \"hover\" when the user is scrolling along its corresponding orientation and when the user is hovering over the scroll area.\n */\n type?: 'auto' | 'always' | 'scroll' | 'hover'\n\n /**\n * The reading direction of the scroll area. If omitted, inherits globally\n * from DirectionProvider or assumes LTR (left-to-right) reading mode.\n */\n dir?: 'ltr' | 'rtl'\n\n /**\n * If type is set to either \"scroll\" or \"hover\", this prop determines the\n * length of time, in milliseconds, before the scrollbars are hidden after the\n * user stops interacting with scrollbars.\n */\n scrollHideDelay?: number\n}\n\nexport const ScrollArea = React.forwardRef<\n ElementRef<typeof StyledScrollArea>,\n ScrollAreaProps\n>((props, forwardRef) => (\n <StyledScrollArea {...props} ref={forwardRef} />\n)) as ForwardRefExoticComponent<ScrollAreaProps> & Partials\n\ninterface Partials {\n Viewport: typeof Viewport\n Scrollbar: typeof Scrollbar\n Thumb: typeof Thumb\n Corner: typeof Corner\n}\n\nScrollArea.Viewport = Viewport\nScrollArea.Scrollbar = Scrollbar\nScrollArea.Thumb = Thumb\nScrollArea.Corner = Corner\n"],"names":["styled","RadixViewport","React","jsx","RadixScrollbar","RadixThumb","RadixCorner","RadixScrollArea"],"mappings":";;;;;;;;;;;;;AAIa,MAAA,cAAA,GAAiBA,4BAAOC,wBAAe,EAAA;AAAA,EAClD,KAAO,EAAA,MAAA;AAAA,EACP,MAAQ,EAAA,MAAA;AAAA,EACR,OAAS,EAAA,KAAA;AACX,CAAC,CAAA;;ACAM,MAAM,QAAW,GAAAC,yBAAA,CAAM,UAG5B,CAAA,CAAC,KAAO,EAAA,UAAA,qBAAgBC,cAAA,CAAA,cAAA,EAAA,EAAgB,GAAG,KAAA,EAAO,GAAK,EAAA,UAAA,EAAY,CAAE,CAAA;;ACP1D,MAAA,eAAA,GAAkBH,4BAAOI,yBAAgB,EAAA;AAAA,EACpD,OAAS,EAAA,MAAA;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AAE,CAAA;;ACXpE,MAAM,YAAA,GAAeH,4BAAOM,sBAAW,CAAA,CAAA;AAKhC,MAAM,MAAS,GAAAJ,yBAAA,CAAM,UAG1B,CAAA,CAAC,KAAO,EAAA,UAAA,qBAAgBC,cAAA,CAAA,YAAA,EAAA,EAAc,GAAG,KAAA,EAAO,GAAK,EAAA,UAAA,EAAY,CAAE,CAAA;;ACVxD,MAAA,gBAAA,GAAmBH,4BAAOO,oBAAiB,EAAA;AAAA,EACtD,QAAU,EAAA,QAAA;AACZ,CAAC,CAAA;;AC8BM,MAAM,UAAa,GAAAL,yBAAA,CAAM,UAG9B,CAAA,CAAC,KAAO,EAAA,UAAA,qBACPC,cAAA,CAAA,gBAAA,EAAA,EAAkB,GAAG,KAAA,EAAO,GAAK,EAAA,UAAA,EAAY,CAC/C,EAAA;AASD,UAAA,CAAW,QAAW,GAAA,QAAA,CAAA;AACtB,UAAA,CAAW,SAAY,GAAA,SAAA,CAAA;AACvB,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAA;AACnB,UAAA,CAAW,MAAS,GAAA,MAAA;;;;"}
|
package/dist/module.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { Viewport as Viewport$1, Scrollbar as Scrollbar$1, Thumb as Thumb$1, Corner as Corner$1, Root } from '@radix-ui/react-scroll-area';
|
|
3
4
|
import { styled } from '@mirohq/design-system-stitches';
|
|
@@ -5,31 +6,28 @@ import { styled } from '@mirohq/design-system-stitches';
|
|
|
5
6
|
const StyledViewport = styled(Viewport$1, {
|
|
6
7
|
width: "100%",
|
|
7
8
|
height: "100%",
|
|
8
|
-
padding: "
|
|
9
|
+
padding: "$50"
|
|
9
10
|
});
|
|
10
11
|
|
|
11
|
-
const Viewport = React.forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
12
|
-
...props,
|
|
13
|
-
ref: forwardRef
|
|
14
|
-
}));
|
|
12
|
+
const Viewport = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledViewport, { ...props, ref: forwardRef }));
|
|
15
13
|
|
|
16
14
|
const StyledScrollbar = styled(Scrollbar$1, {
|
|
17
15
|
display: "flex",
|
|
16
|
+
// ensures no selection
|
|
18
17
|
userSelect: "none",
|
|
18
|
+
// disable browser handling of all panning and zooming gestures on touch devices
|
|
19
19
|
touchAction: "none",
|
|
20
20
|
background: "transparent",
|
|
21
21
|
transition: "background 160ms ease-out",
|
|
22
22
|
'&[data-orientation="vertical"]': { width: "$1", minHeight: "$2" },
|
|
23
23
|
'&[data-orientation="horizontal"]': {
|
|
24
24
|
flexDirection: "column",
|
|
25
|
-
height: "$1"
|
|
25
|
+
height: "$1",
|
|
26
|
+
padding: "0 2px"
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
29
|
|
|
29
|
-
const Scrollbar = React.forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
30
|
-
...props,
|
|
31
|
-
ref: forwardRef
|
|
32
|
-
}));
|
|
30
|
+
const Scrollbar = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledScrollbar, { ...props, ref: forwardRef }));
|
|
33
31
|
|
|
34
32
|
const StyledThumb = styled(Thumb$1, {
|
|
35
33
|
flex: 1,
|
|
@@ -52,25 +50,16 @@ const StyledThumb = styled(Thumb$1, {
|
|
|
52
50
|
}
|
|
53
51
|
});
|
|
54
52
|
|
|
55
|
-
const Thumb = React.forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
56
|
-
...props,
|
|
57
|
-
ref: forwardRef
|
|
58
|
-
}));
|
|
53
|
+
const Thumb = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledThumb, { ...props, ref: forwardRef }));
|
|
59
54
|
|
|
60
55
|
const StyledCorner = styled(Corner$1);
|
|
61
|
-
const Corner = React.forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
62
|
-
...props,
|
|
63
|
-
ref: forwardRef
|
|
64
|
-
}));
|
|
56
|
+
const Corner = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledCorner, { ...props, ref: forwardRef }));
|
|
65
57
|
|
|
66
58
|
const StyledScrollArea = styled(Root, {
|
|
67
59
|
overflow: "hidden"
|
|
68
60
|
});
|
|
69
61
|
|
|
70
|
-
const ScrollArea = React.forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
71
|
-
...props,
|
|
72
|
-
ref: forwardRef
|
|
73
|
-
}));
|
|
62
|
+
const ScrollArea = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledScrollArea, { ...props, ref: forwardRef }));
|
|
74
63
|
ScrollArea.Viewport = Viewport;
|
|
75
64
|
ScrollArea.Scrollbar = Scrollbar;
|
|
76
65
|
ScrollArea.Thumb = Thumb;
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../src/partials/viewport.styled.tsx","../src/partials/viewport.tsx","../src/partials/scrollbar.styled.tsx","../src/partials/scrollbar.tsx","../src/partials/thumb.styled.tsx","../src/partials/thumb.tsx","../src/partials/corner.tsx","../src/scroll-area.styled.tsx","../src/scroll-area.tsx"],"sourcesContent":["import { Viewport as RadixViewport } from '@radix-ui/react-scroll-area'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledViewport = styled(RadixViewport, {\n width: '100%',\n height: '100%',\n padding: '
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/partials/viewport.styled.tsx","../src/partials/viewport.tsx","../src/partials/scrollbar.styled.tsx","../src/partials/scrollbar.tsx","../src/partials/thumb.styled.tsx","../src/partials/thumb.tsx","../src/partials/corner.tsx","../src/scroll-area.styled.tsx","../src/scroll-area.tsx"],"sourcesContent":["import { Viewport as RadixViewport } from '@radix-ui/react-scroll-area'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledViewport = styled(RadixViewport, {\n width: '100%',\n height: '100%',\n padding: '$50',\n})\n\nexport type StyledViewportProps = StrictComponentProps<typeof StyledViewport>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledViewport } from './viewport.styled'\nimport type { StyledViewportProps } from './viewport.styled'\n\nexport interface ViewportProps extends StyledViewportProps {}\n\nexport const Viewport = React.forwardRef<\n ElementRef<typeof StyledViewport>,\n ViewportProps\n>((props, forwardRef) => <StyledViewport {...props} ref={forwardRef} />)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Scrollbar as RadixScrollbar } from '@radix-ui/react-scroll-area'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledScrollbar = styled(RadixScrollbar, {\n display: 'flex',\n // ensures no selection\n userSelect: 'none',\n // disable browser handling of all panning and zooming gestures on touch devices\n touchAction: 'none',\n background: 'transparent',\n transition: 'background 160ms ease-out',\n '&[data-orientation=\"vertical\"]': { width: '$1', minHeight: '$2' },\n '&[data-orientation=\"horizontal\"]': {\n flexDirection: 'column',\n height: '$1',\n padding: '0 2px',\n },\n})\n\nexport type StyledScrollbarProps = StrictComponentProps<typeof StyledScrollbar>\n","import type { ElementRef } from 'react'\nimport React from 'react'\n\nimport { StyledScrollbar } from './scrollbar.styled'\nimport type { StyledScrollbarProps } from './scrollbar.styled'\n\nexport interface ScrollbarProps extends StyledScrollbarProps {\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries.\n */\n forceMount?: true\n\n /**\n * The orientation of the scrollbar.\n */\n orientation?: 'horizontal' | 'vertical'\n}\n\nexport const Scrollbar = React.forwardRef<\n ElementRef<typeof StyledScrollbar>,\n ScrollbarProps\n>((props, forwardRef) => <StyledScrollbar {...props} ref={forwardRef} />)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Thumb as RadixThumb } from '@radix-ui/react-scroll-area'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledThumb = styled(RadixThumb, {\n flex: 1,\n background: '$background-neutrals-scrolls',\n borderRadius: '$50',\n position: 'relative',\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: '100%',\n height: '100%',\n minWidth: '$6',\n minHeight: '$6',\n },\n '&:hover': {\n backgroundColor: '$background-neutrals-scrolls-hover',\n },\n})\nexport type StyledThumbProps = StrictComponentProps<typeof StyledThumb>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledThumb } from './thumb.styled'\nimport type { StyledThumbProps } from './thumb.styled'\n\nexport interface ThumbProps extends StyledThumbProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true\n}\n\nexport const Thumb = React.forwardRef<\n ElementRef<typeof StyledThumb>,\n ThumbProps\n>((props, forwardRef) => <StyledThumb {...props} ref={forwardRef} />)\n","import React from 'react'\nimport { Corner as RadixCorner } from '@radix-ui/react-scroll-area'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport type { ElementRef } from 'react'\n\nconst StyledCorner = styled(RadixCorner)\ntype StyledCornerProps = StrictComponentProps<typeof StyledCorner>\n\nexport interface CornerProps extends StyledCornerProps {}\n\nexport const Corner = React.forwardRef<\n ElementRef<typeof StyledCorner>,\n CornerProps\n>((props, forwardRef) => <StyledCorner {...props} ref={forwardRef} />)\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Root as RadixScrollArea } from '@radix-ui/react-scroll-area'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledScrollArea = styled(RadixScrollArea, {\n overflow: 'hidden',\n})\nexport type StyledScrollAreaProps = StrictComponentProps<\n typeof StyledScrollArea\n>\n","import React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport { Viewport } from './partials/viewport'\nimport { Scrollbar } from './partials/scrollbar'\nimport { Thumb } from './partials/thumb'\nimport { Corner } from './partials/corner'\nimport { StyledScrollArea } from './scroll-area.styled'\nimport type { StyledScrollAreaProps } from './scroll-area.styled'\n\nexport interface ScrollAreaProps extends StyledScrollAreaProps {\n children: React.ReactNode\n\n /**\n * Describes the nature of scrollbar visibility, similar to how the scrollbar preferences in MacOS control visibility of native scrollbars.\n \"auto\" means that scrollbars are visible when content is overflowing on the corresponding orientation.\n \"always\" means that scrollbars are always visible regardless of whether the content is overflowing.\n \"scroll\" means that scrollbars are visible when the user is scrolling along its corresponding orientation.\n \"hover\" when the user is scrolling along its corresponding orientation and when the user is hovering over the scroll area.\n */\n type?: 'auto' | 'always' | 'scroll' | 'hover'\n\n /**\n * The reading direction of the scroll area. If omitted, inherits globally\n * from DirectionProvider or assumes LTR (left-to-right) reading mode.\n */\n dir?: 'ltr' | 'rtl'\n\n /**\n * If type is set to either \"scroll\" or \"hover\", this prop determines the\n * length of time, in milliseconds, before the scrollbars are hidden after the\n * user stops interacting with scrollbars.\n */\n scrollHideDelay?: number\n}\n\nexport const ScrollArea = React.forwardRef<\n ElementRef<typeof StyledScrollArea>,\n ScrollAreaProps\n>((props, forwardRef) => (\n <StyledScrollArea {...props} ref={forwardRef} />\n)) as ForwardRefExoticComponent<ScrollAreaProps> & Partials\n\ninterface Partials {\n Viewport: typeof Viewport\n Scrollbar: typeof Scrollbar\n Thumb: typeof Thumb\n Corner: typeof Corner\n}\n\nScrollArea.Viewport = Viewport\nScrollArea.Scrollbar = Scrollbar\nScrollArea.Thumb = Thumb\nScrollArea.Corner = Corner\n"],"names":["RadixViewport","RadixScrollbar","RadixThumb","RadixCorner","RadixScrollArea"],"mappings":";;;;;AAIa,MAAA,cAAA,GAAiB,OAAOA,UAAe,EAAA;AAAA,EAClD,KAAO,EAAA,MAAA;AAAA,EACP,MAAQ,EAAA,MAAA;AAAA,EACR,OAAS,EAAA,KAAA;AACX,CAAC,CAAA;;ACAM,MAAM,QAAW,GAAA,KAAA,CAAM,UAG5B,CAAA,CAAC,KAAO,E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F,CAAC,CAAA;;ACTM,MAAM,KAAQ,GAAA,KAAA,CAAM,UAGzB,CAAA,CAAC,KAAO,EAAA,UAAA,qBAAgB,GAAA,CAAA,WAAA,EAAA,EAAa,GAAG,KAAA,EAAO,GAAK,EAAA,UAAA,EAAY,CAAE,CAAA;;ACXpE,MAAM,YAAA,GAAe,OAAOC,QAAW,CAAA,CAAA;AAKhC,MAAM,MAAS,GAAA,KAAA,CAAM,UAG1B,CAAA,CAAC,KAAO,EAAA,UAAA,qBAAgB,GAAA,CAAA,YAAA,EAAA,EAAc,GAAG,KAAA,EAAO,GAAK,EAAA,UAAA,EAAY,CAAE,CAAA;;ACVxD,MAAA,gBAAA,GAAmB,OAAOC,IAAiB,EAAA;AAAA,EACtD,QAAU,EAAA,QAAA;AACZ,CAAC,CAAA;;AC8BM,MAAM,UAAa,GAAA,KAAA,CAAM,UAG9B,CAAA,CAAC,KAAO,EAAA,UAAA,qBACP,GAAA,CAAA,gBAAA,EAAA,EAAkB,GAAG,KAAA,EAAO,GAAK,EAAA,UAAA,EAAY,CAC/C,EAAA;AASD,UAAA,CAAW,QAAW,GAAA,QAAA,CAAA;AACtB,UAAA,CAAW,SAAY,GAAA,SAAA,CAAA;AACvB,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAA;AACnB,UAAA,CAAW,MAAS,GAAA,MAAA;;;;"}
|
package/dist/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import * as _stitches_react_types_css_util from '@stitches/react/types/css-util'
|
|
|
6
6
|
import * as _radix_ui_react_scroll_area from '@radix-ui/react-scroll-area';
|
|
7
7
|
import * as _stitches_react_types_styled_component from '@stitches/react/types/styled-component';
|
|
8
8
|
|
|
9
|
-
declare const StyledViewport: react.ForwardRefExoticComponent<
|
|
9
|
+
declare const StyledViewport: react.ForwardRefExoticComponent<Omit<Omit<{}, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.SafeProps<Omit<_radix_ui_react_scroll_area.ScrollAreaViewportProps & react.RefAttributes<HTMLDivElement>, "css"> & _stitches_react_types_styled_component.TransformProps<{}, {}> & {
|
|
10
10
|
css?: _stitches_react_types_css_util.CSS<{}, {
|
|
11
11
|
'border-widths': {
|
|
12
12
|
readonly none: 0;
|
|
@@ -453,14 +453,14 @@ declare const StyledViewport: react.ForwardRefExoticComponent<Pick<Omit<{}, neve
|
|
|
453
453
|
}> | undefined;
|
|
454
454
|
}> & {
|
|
455
455
|
children?: react.ReactNode;
|
|
456
|
-
} & _mirohq_design_system_stitches.CustomStylesProps, "
|
|
456
|
+
} & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_radix_ui_react_scroll_area.ScrollAreaViewportProps & react.RefAttributes<HTMLDivElement>>, {}, {}>;
|
|
457
457
|
declare type StyledViewportProps = StrictComponentProps<typeof StyledViewport>;
|
|
458
458
|
|
|
459
459
|
interface ViewportProps extends StyledViewportProps {
|
|
460
460
|
}
|
|
461
|
-
declare const Viewport: react__default.ForwardRefExoticComponent<
|
|
461
|
+
declare const Viewport: react__default.ForwardRefExoticComponent<Omit<ViewportProps, "ref"> & react__default.RefAttributes<HTMLDivElement>>;
|
|
462
462
|
|
|
463
|
-
declare const StyledScrollbar: react.ForwardRefExoticComponent<
|
|
463
|
+
declare const StyledScrollbar: react.ForwardRefExoticComponent<Omit<Omit<{}, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.SafeProps<Omit<_radix_ui_react_scroll_area.ScrollAreaScrollbarProps & react.RefAttributes<HTMLDivElement>, "css"> & _stitches_react_types_styled_component.TransformProps<{}, {}> & {
|
|
464
464
|
css?: _stitches_react_types_css_util.CSS<{}, {
|
|
465
465
|
'border-widths': {
|
|
466
466
|
readonly none: 0;
|
|
@@ -907,7 +907,7 @@ declare const StyledScrollbar: react.ForwardRefExoticComponent<Pick<Omit<{}, nev
|
|
|
907
907
|
}> | undefined;
|
|
908
908
|
}> & {
|
|
909
909
|
children?: react.ReactNode;
|
|
910
|
-
} & _mirohq_design_system_stitches.CustomStylesProps, "
|
|
910
|
+
} & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_radix_ui_react_scroll_area.ScrollAreaScrollbarProps & react.RefAttributes<HTMLDivElement>>, {}, {}>;
|
|
911
911
|
declare type StyledScrollbarProps = StrictComponentProps<typeof StyledScrollbar>;
|
|
912
912
|
|
|
913
913
|
interface ScrollbarProps extends StyledScrollbarProps {
|
|
@@ -921,9 +921,9 @@ interface ScrollbarProps extends StyledScrollbarProps {
|
|
|
921
921
|
*/
|
|
922
922
|
orientation?: 'horizontal' | 'vertical';
|
|
923
923
|
}
|
|
924
|
-
declare const Scrollbar: react__default.ForwardRefExoticComponent<
|
|
924
|
+
declare const Scrollbar: react__default.ForwardRefExoticComponent<Omit<ScrollbarProps, "ref"> & react__default.RefAttributes<HTMLDivElement>>;
|
|
925
925
|
|
|
926
|
-
declare const StyledThumb: react.ForwardRefExoticComponent<
|
|
926
|
+
declare const StyledThumb: react.ForwardRefExoticComponent<Omit<Omit<{}, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.SafeProps<Omit<_radix_ui_react_scroll_area.ScrollAreaThumbProps & react.RefAttributes<HTMLDivElement>, "css"> & _stitches_react_types_styled_component.TransformProps<{}, {}> & {
|
|
927
927
|
css?: _stitches_react_types_css_util.CSS<{}, {
|
|
928
928
|
'border-widths': {
|
|
929
929
|
readonly none: 0;
|
|
@@ -1370,7 +1370,7 @@ declare const StyledThumb: react.ForwardRefExoticComponent<Pick<Omit<{}, never>
|
|
|
1370
1370
|
}> | undefined;
|
|
1371
1371
|
}> & {
|
|
1372
1372
|
children?: react.ReactNode;
|
|
1373
|
-
} & _mirohq_design_system_stitches.CustomStylesProps, "
|
|
1373
|
+
} & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_radix_ui_react_scroll_area.ScrollAreaThumbProps & react.RefAttributes<HTMLDivElement>>, {}, {}>;
|
|
1374
1374
|
declare type StyledThumbProps = StrictComponentProps<typeof StyledThumb>;
|
|
1375
1375
|
|
|
1376
1376
|
interface ThumbProps extends StyledThumbProps {
|
|
@@ -1380,9 +1380,9 @@ interface ThumbProps extends StyledThumbProps {
|
|
|
1380
1380
|
*/
|
|
1381
1381
|
forceMount?: true;
|
|
1382
1382
|
}
|
|
1383
|
-
declare const Thumb: react__default.ForwardRefExoticComponent<
|
|
1383
|
+
declare const Thumb: react__default.ForwardRefExoticComponent<Omit<ThumbProps, "ref"> & react__default.RefAttributes<HTMLDivElement>>;
|
|
1384
1384
|
|
|
1385
|
-
declare const StyledCorner: react__default.ForwardRefExoticComponent<
|
|
1385
|
+
declare const StyledCorner: react__default.ForwardRefExoticComponent<Omit<Omit<{}, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.SafeProps<Omit<_radix_ui_react_scroll_area.ScrollAreaCornerProps & react__default.RefAttributes<HTMLDivElement>, "css"> & _stitches_react_types_styled_component.TransformProps<{}, {}> & {
|
|
1386
1386
|
css?: _stitches_react_types_css_util.CSS<{}, {
|
|
1387
1387
|
'border-widths': {
|
|
1388
1388
|
readonly none: 0;
|
|
@@ -1829,13 +1829,13 @@ declare const StyledCorner: react__default.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
1829
1829
|
}> | undefined;
|
|
1830
1830
|
}> & {
|
|
1831
1831
|
children?: react__default.ReactNode;
|
|
1832
|
-
} & _mirohq_design_system_stitches.CustomStylesProps, "
|
|
1832
|
+
} & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react__default.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react__default.ForwardRefExoticComponent<_radix_ui_react_scroll_area.ScrollAreaCornerProps & react__default.RefAttributes<HTMLDivElement>>, {}, {}>;
|
|
1833
1833
|
declare type StyledCornerProps = StrictComponentProps<typeof StyledCorner>;
|
|
1834
1834
|
interface CornerProps extends StyledCornerProps {
|
|
1835
1835
|
}
|
|
1836
|
-
declare const Corner: react__default.ForwardRefExoticComponent<
|
|
1836
|
+
declare const Corner: react__default.ForwardRefExoticComponent<Omit<CornerProps, "ref"> & react__default.RefAttributes<HTMLDivElement>>;
|
|
1837
1837
|
|
|
1838
|
-
declare const StyledScrollArea: react.ForwardRefExoticComponent<
|
|
1838
|
+
declare const StyledScrollArea: react.ForwardRefExoticComponent<Omit<Omit<{}, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.SafeProps<Omit<_radix_ui_react_scroll_area.ScrollAreaProps & react.RefAttributes<HTMLDivElement>, "css"> & _stitches_react_types_styled_component.TransformProps<{}, {}> & {
|
|
1839
1839
|
css?: _stitches_react_types_css_util.CSS<{}, {
|
|
1840
1840
|
'border-widths': {
|
|
1841
1841
|
readonly none: 0;
|
|
@@ -2282,7 +2282,7 @@ declare const StyledScrollArea: react.ForwardRefExoticComponent<Pick<Omit<{}, ne
|
|
|
2282
2282
|
}> | undefined;
|
|
2283
2283
|
}> & {
|
|
2284
2284
|
children?: react.ReactNode;
|
|
2285
|
-
} & _mirohq_design_system_stitches.CustomStylesProps, "
|
|
2285
|
+
} & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_radix_ui_react_scroll_area.ScrollAreaProps & react.RefAttributes<HTMLDivElement>>, {}, {}>;
|
|
2286
2286
|
declare type StyledScrollAreaProps = StrictComponentProps<typeof StyledScrollArea>;
|
|
2287
2287
|
|
|
2288
2288
|
interface ScrollAreaProps extends StyledScrollAreaProps {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirohq/design-system-scroll-area",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Miro",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@radix-ui/react-scroll-area": "^1.0.4",
|
|
30
|
-
"@mirohq/design-system-stitches": "^2.3.
|
|
30
|
+
"@mirohq/design-system-stitches": "^2.3.4"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
|
-
"build": "rollup -c
|
|
33
|
+
"build": "rollup -c ../../../rollup.config.js",
|
|
34
34
|
"clean": "rm -rf dist",
|
|
35
35
|
"prebuild": "pnpm clean"
|
|
36
36
|
}
|