@mirohq/design-system-patterns 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/main.js ADDED
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
7
+ var designSystemStitches = require('@mirohq/design-system-stitches');
8
+ var designSystemBox = require('@mirohq/design-system-box');
9
+ var designSystemButton = require('@mirohq/design-system-button');
10
+ var designSystemTypography = require('@mirohq/design-system-typography');
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
+
16
+ const Container = designSystemStitches.styled(designSystemBox.Box, {
17
+ background: "$background-neutrals",
18
+ padding: "$500",
19
+ display: "flex",
20
+ flexDirection: "column",
21
+ gap: "$50",
22
+ minWidth: "290px",
23
+ maxWidth: "480px"
24
+ });
25
+ const Illustration = designSystemStitches.styled("img", {
26
+ width: "112px",
27
+ display: "block"
28
+ });
29
+ const Description = designSystemStitches.styled(designSystemBox.Box, {
30
+ color: "$text-neutrals-subtle"
31
+ });
32
+ const Actions = designSystemStitches.styled(designSystemBox.Box, {
33
+ paddingY: "$200",
34
+ display: "flex",
35
+ flexWrap: "wrap",
36
+ gap: "$100"
37
+ });
38
+ const EmptyState = React__default["default"].forwardRef(
39
+ ({
40
+ heading,
41
+ description,
42
+ illustration,
43
+ actions: { primary, secondary },
44
+ ...restProps
45
+ }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(Container, { ref, ...restProps, children: [
46
+ illustration != null && /* @__PURE__ */ jsxRuntime.jsx(Illustration, { src: illustration, "aria-hidden": true, alt: "" }),
47
+ /* @__PURE__ */ jsxRuntime.jsx(designSystemTypography.Heading, { ref, level: 2, styledAs: "h3", children: heading }),
48
+ description != null && /* @__PURE__ */ jsxRuntime.jsx(Description, { css: { color: "$text-neutrals-subtle" }, children: description }),
49
+ /* @__PURE__ */ jsxRuntime.jsxs(Actions, { children: [
50
+ /* @__PURE__ */ jsxRuntime.jsx(designSystemButton.Button, { ...primary, variant: "primary", children: primary.label }),
51
+ secondary != null && /* @__PURE__ */ jsxRuntime.jsx(designSystemButton.Button, { ...secondary, variant: "ghost", children: secondary.label })
52
+ ] })
53
+ ] })
54
+ );
55
+
56
+ exports.EmptyState = EmptyState;
57
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sources":["../src/empty-state.tsx"],"sourcesContent":["import React from 'react'\nimport type { ReactNode, ElementRef } from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Box } from '@mirohq/design-system-box'\nimport { Button } from '@mirohq/design-system-button'\nimport type { ButtonProps } from '@mirohq/design-system-button'\nimport type { BoxProps } from '@mirohq/design-system-box'\nimport { Heading } from '@mirohq/design-system-typography'\n\n// Types\n// -----------------------------------------------------------------------------\nexport interface EmptyStateProps extends Omit<BoxProps, 'children'> {\n heading: ReactNode\n description?: ReactNode\n illustration?: string\n actions: {\n primary: ActionButton\n secondary?: ActionButton\n }\n}\n\ntype ActionButton = Omit<ButtonProps, 'variant' | 'children'> & {\n label: ReactNode\n}\n\n// Styled\n// -----------------------------------------------------------------------------\nconst Container = styled(Box, {\n background: '$background-neutrals',\n padding: '$500',\n display: 'flex',\n flexDirection: 'column',\n gap: '$50',\n minWidth: '290px',\n maxWidth: '480px',\n})\n\nconst Illustration = styled('img', {\n width: '112px',\n display: 'block',\n})\n\nconst Description = styled(Box, {\n color: '$text-neutrals-subtle',\n})\n\nconst Actions = styled(Box, {\n paddingY: '$200',\n display: 'flex',\n flexWrap: 'wrap',\n gap: '$100',\n})\n\n// Component\n// -----------------------------------------------------------------------------\nexport const EmptyState = React.forwardRef<\n ElementRef<typeof Box>,\n EmptyStateProps\n>(\n (\n {\n heading,\n description,\n illustration,\n actions: { primary, secondary },\n ...restProps\n },\n ref\n ) => (\n <Container ref={ref} {...restProps}>\n {illustration != null && (\n <Illustration src={illustration} aria-hidden alt='' />\n )}\n <Heading ref={ref} level={2} styledAs='h3'>\n {heading}\n </Heading>\n {description != null && (\n <Description css={{ color: '$text-neutrals-subtle' }}>\n {description}\n </Description>\n )}\n <Actions>\n <Button {...primary} variant='primary'>\n {primary.label}\n </Button>\n\n {secondary != null && (\n <Button {...secondary} variant='ghost'>\n {secondary.label}\n </Button>\n )}\n </Actions>\n </Container>\n )\n)\n"],"names":["styled","Box","React","jsxs","Heading","jsx","Button"],"mappings":";;;;;;;;;;;;;;;AA2BA,MAAM,SAAA,GAAYA,4BAAOC,mBAAK,EAAA;AAAA,EAC5B,UAAY,EAAA,sBAAA;AAAA,EACZ,OAAS,EAAA,MAAA;AAAA,EACT,OAAS,EAAA,MAAA;AAAA,EACT,aAAe,EAAA,QAAA;AAAA,EACf,GAAK,EAAA,KAAA;AAAA,EACL,QAAU,EAAA,OAAA;AAAA,EACV,QAAU,EAAA,OAAA;AACZ,CAAC,CAAA,CAAA;AAED,MAAM,YAAA,GAAeD,4BAAO,KAAO,EAAA;AAAA,EACjC,KAAO,EAAA,OAAA;AAAA,EACP,OAAS,EAAA,OAAA;AACX,CAAC,CAAA,CAAA;AAED,MAAM,WAAA,GAAcA,4BAAOC,mBAAK,EAAA;AAAA,EAC9B,KAAO,EAAA,uBAAA;AACT,CAAC,CAAA,CAAA;AAED,MAAM,OAAA,GAAUD,4BAAOC,mBAAK,EAAA;AAAA,EAC1B,QAAU,EAAA,MAAA;AAAA,EACV,OAAS,EAAA,MAAA;AAAA,EACT,QAAU,EAAA,MAAA;AAAA,EACV,GAAK,EAAA,MAAA;AACP,CAAC,CAAA,CAAA;AAIM,MAAM,aAAaC,yBAAM,CAAA,UAAA;AAAA,EAI9B,CACE;AAAA,IACE,OAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,OAAA,EAAS,EAAE,OAAA,EAAS,SAAU,EAAA;AAAA,IAC9B,GAAG,SAAA;AAAA,KAEL,GAEA,qBAAAC,eAAA,CAAC,SAAU,EAAA,EAAA,GAAA,EAAW,GAAG,SACtB,EAAA,QAAA,EAAA;AAAA,IAAgB,YAAA,IAAA,IAAA,mCACd,YAAa,EAAA,EAAA,GAAA,EAAK,cAAc,aAAW,EAAA,IAAA,EAAC,KAAI,EAAG,EAAA,CAAA;AAAA,mCAErDC,8BAAQ,EAAA,EAAA,GAAA,EAAU,OAAO,CAAG,EAAA,QAAA,EAAS,MACnC,QACH,EAAA,OAAA,EAAA,CAAA;AAAA,IACC,WAAA,IAAe,wBACbC,cAAA,CAAA,WAAA,EAAA,EAAY,KAAK,EAAE,KAAA,EAAO,uBAAwB,EAAA,EAChD,QACH,EAAA,WAAA,EAAA,CAAA;AAAA,oCAED,OACC,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAAA,cAAA,CAACC,6BAAQ,GAAG,OAAA,EAAS,OAAQ,EAAA,SAAA,EAC1B,kBAAQ,KACX,EAAA,CAAA;AAAA,MAEC,SAAA,IAAa,wBACXD,cAAA,CAAAC,yBAAA,EAAA,EAAQ,GAAG,SAAW,EAAA,OAAA,EAAQ,OAC5B,EAAA,QAAA,EAAA,SAAA,CAAU,KACb,EAAA,CAAA;AAAA,KAEJ,EAAA,CAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
package/dist/module.js ADDED
@@ -0,0 +1,49 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { styled } from '@mirohq/design-system-stitches';
4
+ import { Box } from '@mirohq/design-system-box';
5
+ import { Button } from '@mirohq/design-system-button';
6
+ import { Heading } from '@mirohq/design-system-typography';
7
+
8
+ const Container = styled(Box, {
9
+ background: "$background-neutrals",
10
+ padding: "$500",
11
+ display: "flex",
12
+ flexDirection: "column",
13
+ gap: "$50",
14
+ minWidth: "290px",
15
+ maxWidth: "480px"
16
+ });
17
+ const Illustration = styled("img", {
18
+ width: "112px",
19
+ display: "block"
20
+ });
21
+ const Description = styled(Box, {
22
+ color: "$text-neutrals-subtle"
23
+ });
24
+ const Actions = styled(Box, {
25
+ paddingY: "$200",
26
+ display: "flex",
27
+ flexWrap: "wrap",
28
+ gap: "$100"
29
+ });
30
+ const EmptyState = React.forwardRef(
31
+ ({
32
+ heading,
33
+ description,
34
+ illustration,
35
+ actions: { primary, secondary },
36
+ ...restProps
37
+ }, ref) => /* @__PURE__ */ jsxs(Container, { ref, ...restProps, children: [
38
+ illustration != null && /* @__PURE__ */ jsx(Illustration, { src: illustration, "aria-hidden": true, alt: "" }),
39
+ /* @__PURE__ */ jsx(Heading, { ref, level: 2, styledAs: "h3", children: heading }),
40
+ description != null && /* @__PURE__ */ jsx(Description, { css: { color: "$text-neutrals-subtle" }, children: description }),
41
+ /* @__PURE__ */ jsxs(Actions, { children: [
42
+ /* @__PURE__ */ jsx(Button, { ...primary, variant: "primary", children: primary.label }),
43
+ secondary != null && /* @__PURE__ */ jsx(Button, { ...secondary, variant: "ghost", children: secondary.label })
44
+ ] })
45
+ ] })
46
+ );
47
+
48
+ export { EmptyState };
49
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sources":["../src/empty-state.tsx"],"sourcesContent":["import React from 'react'\nimport type { ReactNode, ElementRef } from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Box } from '@mirohq/design-system-box'\nimport { Button } from '@mirohq/design-system-button'\nimport type { ButtonProps } from '@mirohq/design-system-button'\nimport type { BoxProps } from '@mirohq/design-system-box'\nimport { Heading } from '@mirohq/design-system-typography'\n\n// Types\n// -----------------------------------------------------------------------------\nexport interface EmptyStateProps extends Omit<BoxProps, 'children'> {\n heading: ReactNode\n description?: ReactNode\n illustration?: string\n actions: {\n primary: ActionButton\n secondary?: ActionButton\n }\n}\n\ntype ActionButton = Omit<ButtonProps, 'variant' | 'children'> & {\n label: ReactNode\n}\n\n// Styled\n// -----------------------------------------------------------------------------\nconst Container = styled(Box, {\n background: '$background-neutrals',\n padding: '$500',\n display: 'flex',\n flexDirection: 'column',\n gap: '$50',\n minWidth: '290px',\n maxWidth: '480px',\n})\n\nconst Illustration = styled('img', {\n width: '112px',\n display: 'block',\n})\n\nconst Description = styled(Box, {\n color: '$text-neutrals-subtle',\n})\n\nconst Actions = styled(Box, {\n paddingY: '$200',\n display: 'flex',\n flexWrap: 'wrap',\n gap: '$100',\n})\n\n// Component\n// -----------------------------------------------------------------------------\nexport const EmptyState = React.forwardRef<\n ElementRef<typeof Box>,\n EmptyStateProps\n>(\n (\n {\n heading,\n description,\n illustration,\n actions: { primary, secondary },\n ...restProps\n },\n ref\n ) => (\n <Container ref={ref} {...restProps}>\n {illustration != null && (\n <Illustration src={illustration} aria-hidden alt='' />\n )}\n <Heading ref={ref} level={2} styledAs='h3'>\n {heading}\n </Heading>\n {description != null && (\n <Description css={{ color: '$text-neutrals-subtle' }}>\n {description}\n </Description>\n )}\n <Actions>\n <Button {...primary} variant='primary'>\n {primary.label}\n </Button>\n\n {secondary != null && (\n <Button {...secondary} variant='ghost'>\n {secondary.label}\n </Button>\n )}\n </Actions>\n </Container>\n )\n)\n"],"names":[],"mappings":";;;;;;;AA2BA,MAAM,SAAA,GAAY,OAAO,GAAK,EAAA;AAAA,EAC5B,UAAY,EAAA,sBAAA;AAAA,EACZ,OAAS,EAAA,MAAA;AAAA,EACT,OAAS,EAAA,MAAA;AAAA,EACT,aAAe,EAAA,QAAA;AAAA,EACf,GAAK,EAAA,KAAA;AAAA,EACL,QAAU,EAAA,OAAA;AAAA,EACV,QAAU,EAAA,OAAA;AACZ,CAAC,CAAA,CAAA;AAED,MAAM,YAAA,GAAe,OAAO,KAAO,EAAA;AAAA,EACjC,KAAO,EAAA,OAAA;AAAA,EACP,OAAS,EAAA,OAAA;AACX,CAAC,CAAA,CAAA;AAED,MAAM,WAAA,GAAc,OAAO,GAAK,EAAA;AAAA,EAC9B,KAAO,EAAA,uBAAA;AACT,CAAC,CAAA,CAAA;AAED,MAAM,OAAA,GAAU,OAAO,GA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oxProps } from '@mirohq/design-system-box';
4
+
5
+ interface EmptyStateProps extends Omit<BoxProps, 'children'> {
6
+ heading: ReactNode;
7
+ description?: ReactNode;
8
+ illustration?: string;
9
+ actions: {
10
+ primary: ActionButton;
11
+ secondary?: ActionButton;
12
+ };
13
+ }
14
+ declare type ActionButton = Omit<ButtonProps, 'variant' | 'children'> & {
15
+ label: ReactNode;
16
+ };
17
+ declare const EmptyState: React.ForwardRefExoticComponent<Omit<EmptyStateProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+
19
+ export { EmptyState, EmptyStateProps };
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@mirohq/design-system-patterns",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "author": "Miro",
6
+ "source": "src/index.ts",
7
+ "main": "dist/main.js",
8
+ "module": "dist/module.js",
9
+ "types": "dist/types.d.ts",
10
+ "sideEffects": false,
11
+ "exports": {
12
+ ".": {
13
+ "require": "./dist/main.js",
14
+ "import": "./dist/module.js",
15
+ "types": "./dist/types.d.ts"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "peerDependencies": {
25
+ "@stitches/react": "^1.2.8",
26
+ "react": "^16.14 || ^17 || ^18"
27
+ },
28
+ "dependencies": {
29
+ "@mirohq/design-system-box": "^2.1.59",
30
+ "@mirohq/design-system-button": "^4.2.3",
31
+ "@mirohq/design-system-stitches": "^2.6.28",
32
+ "@mirohq/design-system-typography": "^0.6.6"
33
+ },
34
+ "devDependencies": {
35
+ "@mirohq/brand-assets": "^0.2.1"
36
+ },
37
+ "scripts": {
38
+ "build": "rollup -c ../../rollup.config.js",
39
+ "clean": "rm -rf dist",
40
+ "prebuild": "pnpm clean"
41
+ }
42
+ }