@sproutsocial/seeds-react-drawer 1.2.11 → 2.2.7
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/drawer.css +248 -0
- package/dist/esm/index.js +599 -189
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +109 -19
- package/dist/index.d.ts +109 -19
- package/dist/index.js +607 -191
- package/dist/index.js.map +1 -1
- package/package.json +24 -12
- package/.eslintignore +0 -6
- package/.eslintrc.js +0 -4
- package/.turbo/turbo-build.log +0 -21
- package/CHANGELOG.md +0 -350
- package/jest.config.js +0 -9
- package/src/Drawer.stories.tsx +0 -474
- package/src/Drawer.tsx +0 -291
- package/src/DrawerTypes.ts +0 -88
- package/src/__tests__/Drawer.test.tsx +0 -339
- package/src/__tests__/Drawer.typetest.tsx +0 -39
- package/src/index.ts +0 -5
- package/src/styles.ts +0 -35
- package/tsconfig.json +0 -15
- package/tsup.config.ts +0 -12
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import Drawer from "../Drawer";
|
|
3
|
-
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
-
function DrawerTypes() {
|
|
6
|
-
const componentProps = {
|
|
7
|
-
id: "drawer-1",
|
|
8
|
-
closeButtonLabel: "close",
|
|
9
|
-
isOpen: true,
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
11
|
-
onClose: jest.fn(),
|
|
12
|
-
children: "Drawer Content",
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
<Drawer {...componentProps} />
|
|
18
|
-
<Drawer {...componentProps} direction="left">
|
|
19
|
-
<Drawer.Header title="test1">
|
|
20
|
-
<h1>Drawer Header</h1>
|
|
21
|
-
</Drawer.Header>
|
|
22
|
-
<Drawer.Content>
|
|
23
|
-
<p>Drawer Content</p>
|
|
24
|
-
</Drawer.Content>
|
|
25
|
-
</Drawer>
|
|
26
|
-
{/* @ts-expect-error - test that invalid type is rejected */}
|
|
27
|
-
<Drawer />
|
|
28
|
-
{/* @ts-expect-error - test that invalid type is rejected */}
|
|
29
|
-
<Drawer direction={true}>
|
|
30
|
-
<Drawer.Header>
|
|
31
|
-
<h1>Drawer Header</h1>
|
|
32
|
-
</Drawer.Header>
|
|
33
|
-
<Drawer.Content>
|
|
34
|
-
<p>Drawer Content</p>
|
|
35
|
-
</Drawer.Content>
|
|
36
|
-
</Drawer>
|
|
37
|
-
</>
|
|
38
|
-
);
|
|
39
|
-
}
|
package/src/index.ts
DELETED
package/src/styles.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { TypeDrawerProps } from "./DrawerTypes";
|
|
2
|
-
import styled, { css } from "styled-components";
|
|
3
|
-
import { COMMON } from "@sproutsocial/seeds-react-system-props";
|
|
4
|
-
import type { TypeSystemCommonProps } from "@sproutsocial/seeds-react-system-props";
|
|
5
|
-
|
|
6
|
-
import Box from "@sproutsocial/seeds-react-box";
|
|
7
|
-
|
|
8
|
-
export const Content = styled(Box)`
|
|
9
|
-
overflow-y: auto;
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
interface ContainerType
|
|
13
|
-
extends Pick<TypeDrawerProps, "offset" | "direction">,
|
|
14
|
-
TypeSystemCommonProps {
|
|
15
|
-
width: number;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const Container = styled.div<ContainerType>`
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
position: fixed;
|
|
22
|
-
top: 0;
|
|
23
|
-
height: 100%;
|
|
24
|
-
width: ${(props) => props.width}px;
|
|
25
|
-
background-color: ${(props) => props.theme.colors.container.background.base};
|
|
26
|
-
box-shadow: ${(props) => props.theme.shadows.high};
|
|
27
|
-
filter: blur(0);
|
|
28
|
-
|
|
29
|
-
${(props) => css`
|
|
30
|
-
${props.direction}: ${props.offset}px;
|
|
31
|
-
`}
|
|
32
|
-
|
|
33
|
-
${COMMON}
|
|
34
|
-
`;
|
|
35
|
-
export default Container;
|
package/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@sproutsocial/seeds-tsconfig/bundler/dom/library-monorepo",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"jsx": "react-jsx",
|
|
5
|
-
"module": "esnext"
|
|
6
|
-
},
|
|
7
|
-
"include": ["src/**/*"],
|
|
8
|
-
"exclude": [
|
|
9
|
-
"node_modules",
|
|
10
|
-
"dist",
|
|
11
|
-
"coverage",
|
|
12
|
-
"**/*.stories.tsx",
|
|
13
|
-
"**/*.stories.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
|
|
3
|
-
export default defineConfig((options) => ({
|
|
4
|
-
entry: ["src/index.ts"],
|
|
5
|
-
format: ["cjs", "esm"],
|
|
6
|
-
clean: true,
|
|
7
|
-
legacyOutput: true,
|
|
8
|
-
dts: options.dts,
|
|
9
|
-
external: ["react"],
|
|
10
|
-
sourcemap: true,
|
|
11
|
-
metafile: options.metafile,
|
|
12
|
-
}));
|