@sproutsocial/seeds-react-box 1.1.1 → 1.1.2

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.
@@ -8,14 +8,14 @@ CLI Target: es2022
8
8
  CLI Cleaning output folder
9
9
  CJS Build start
10
10
  ESM Build start
11
- ESM dist/esm/index.js 874.00 B
12
- ESM dist/esm/index.js.map 1.77 KB
13
- ESM ⚡️ Build success in 19ms
14
- CJS dist/index.js 2.67 KB
11
+ CJS dist/index.js 2.68 KB
15
12
  CJS dist/index.js.map 1.77 KB
16
- CJS ⚡️ Build success in 23ms
13
+ CJS ⚡️ Build success in 112ms
14
+ ESM dist/esm/index.js 878.00 B
15
+ ESM dist/esm/index.js.map 1.77 KB
16
+ ESM ⚡️ Build success in 115ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 6265ms
18
+ DTS ⚡️ Build success in 32753ms
19
19
  DTS dist/index.d.ts 800.00 B
20
20
  DTS dist/index.d.mts 800.00 B
21
- Done in 7.86s.
21
+ Done in 37.60s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @sproutsocial/seeds-react-box
2
2
 
3
+ ## 1.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 9fd8bac: Update dependencies to use semantic package version instead of wildcards
8
+ - Updated dependencies [9fd8bac]
9
+ - @sproutsocial/seeds-react-system-props@3.0.2
10
+ - @sproutsocial/seeds-react-theme@2.2.1
11
+
3
12
  ## 1.1.1
4
13
 
5
14
  ### Patch Changes
package/dist/esm/index.js CHANGED
@@ -42,9 +42,9 @@ Box.displayName = "Box";
42
42
  var Box_default = Box;
43
43
 
44
44
  // src/index.ts
45
- var src_default = Box_default;
45
+ var index_default = Box_default;
46
46
  export {
47
47
  Box_default as Box,
48
- src_default as default
48
+ index_default as default
49
49
  };
50
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Box.tsx","../../src/styles.tsx","../../src/index.ts"],"sourcesContent":["import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeBoxProps } from \"./BoxTypes\";\n\nconst Box = React.forwardRef<HTMLDivElement, TypeBoxProps>(\n ({ color, ...props }, ref) => {\n return (\n <Container\n {...props}\n ref={ref}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n />\n );\n }\n);\n\nBox.displayName = \"Box\";\n\nexport default Box;\n","import styled from \"styled-components\";\nimport {\n COMMON,\n BORDER,\n LAYOUT,\n POSITION,\n FLEXBOX,\n GRID,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeContainerProps } from \"./BoxTypes\";\n\nconst Container = styled.div<TypeContainerProps>`\n box-sizing: border-box;\n font-family: ${({ theme }) => theme.fontFamily};\n\n ${COMMON}\n ${BORDER}\n ${LAYOUT}\n ${POSITION}\n ${FLEXBOX}\n ${GRID}\n`;\n\nexport default Container;\n","import Box from \"./Box\";\n\nexport default Box;\nexport { Box };\nexport * from \"./BoxTypes\";\n"],"mappings":";AAAA,YAAY,WAAW;;;ACAvB,OAAO,YAAY;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,YAAY,OAAO;AAAA;AAAA,iBAER,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU;AAAA;AAAA,IAE5C,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,IAAI;AAAA;AAGR,IAAO,iBAAQ;;;ADhBT;AAHN,IAAM,MAAY;AAAA,EAChB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ;AAC5B,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QAIA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,IAAI,cAAc;AAElB,IAAO,cAAQ;;;AEnBf,IAAO,cAAQ;","names":[]}
1
+ {"version":3,"sources":["../../src/Box.tsx","../../src/styles.tsx","../../src/index.ts"],"sourcesContent":["import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeBoxProps } from \"./BoxTypes\";\n\nconst Box = React.forwardRef<HTMLDivElement, TypeBoxProps>(\n ({ color, ...props }, ref) => {\n return (\n <Container\n {...props}\n ref={ref}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n />\n );\n }\n);\n\nBox.displayName = \"Box\";\n\nexport default Box;\n","import styled from \"styled-components\";\nimport {\n COMMON,\n BORDER,\n LAYOUT,\n POSITION,\n FLEXBOX,\n GRID,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeContainerProps } from \"./BoxTypes\";\n\nconst Container = styled.div<TypeContainerProps>`\n box-sizing: border-box;\n font-family: ${({ theme }) => theme.fontFamily};\n\n ${COMMON}\n ${BORDER}\n ${LAYOUT}\n ${POSITION}\n ${FLEXBOX}\n ${GRID}\n`;\n\nexport default Container;\n","import Box from \"./Box\";\n\nexport default Box;\nexport { Box };\nexport * from \"./BoxTypes\";\n"],"mappings":";AAAA,YAAY,WAAW;;;ACAvB,OAAO,YAAY;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,YAAY,OAAO;AAAA;AAAA,iBAER,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU;AAAA;AAAA,IAE5C,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,IAAI;AAAA;AAGR,IAAO,iBAAQ;;;ADhBT;AAHN,IAAM,MAAY;AAAA,EAChB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ;AAC5B,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QAIA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,IAAI,cAAc;AAElB,IAAO,cAAQ;;;AEnBf,IAAO,gBAAQ;","names":[]}
package/dist/index.js CHANGED
@@ -28,12 +28,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  Box: () => Box_default,
34
- default: () => src_default
34
+ default: () => index_default
35
35
  });
36
- module.exports = __toCommonJS(src_exports);
36
+ module.exports = __toCommonJS(index_exports);
37
37
 
38
38
  // src/Box.tsx
39
39
  var React = __toESM(require("react"));
@@ -72,7 +72,7 @@ Box.displayName = "Box";
72
72
  var Box_default = Box;
73
73
 
74
74
  // src/index.ts
75
- var src_default = Box_default;
75
+ var index_default = Box_default;
76
76
  // Annotate the CommonJS export names for ESM import in node:
77
77
  0 && (module.exports = {
78
78
  Box
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/Box.tsx","../src/styles.tsx"],"sourcesContent":["import Box from \"./Box\";\n\nexport default Box;\nexport { Box };\nexport * from \"./BoxTypes\";\n","import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeBoxProps } from \"./BoxTypes\";\n\nconst Box = React.forwardRef<HTMLDivElement, TypeBoxProps>(\n ({ color, ...props }, ref) => {\n return (\n <Container\n {...props}\n ref={ref}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n />\n );\n }\n);\n\nBox.displayName = \"Box\";\n\nexport default Box;\n","import styled from \"styled-components\";\nimport {\n COMMON,\n BORDER,\n LAYOUT,\n POSITION,\n FLEXBOX,\n GRID,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeContainerProps } from \"./BoxTypes\";\n\nconst Container = styled.div<TypeContainerProps>`\n box-sizing: border-box;\n font-family: ${({ theme }) => theme.fontFamily};\n\n ${COMMON}\n ${BORDER}\n ${LAYOUT}\n ${POSITION}\n ${FLEXBOX}\n ${GRID}\n`;\n\nexport default Container;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACAvB,+BAAmB;AACnB,sCAOO;AAGP,IAAM,YAAY,yBAAAA,QAAO;AAAA;AAAA,iBAER,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU;AAAA;AAAA,IAE5C,sCAAM;AAAA,IACN,sCAAM;AAAA,IACN,sCAAM;AAAA,IACN,wCAAQ;AAAA,IACR,uCAAO;AAAA,IACP,oCAAI;AAAA;AAGR,IAAO,iBAAQ;;;ADhBT;AAHN,IAAM,MAAY;AAAA,EAChB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ;AAC5B,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QAIA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,IAAI,cAAc;AAElB,IAAO,cAAQ;;;ADnBf,IAAO,cAAQ;","names":["styled"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/Box.tsx","../src/styles.tsx"],"sourcesContent":["import Box from \"./Box\";\n\nexport default Box;\nexport { Box };\nexport * from \"./BoxTypes\";\n","import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeBoxProps } from \"./BoxTypes\";\n\nconst Box = React.forwardRef<HTMLDivElement, TypeBoxProps>(\n ({ color, ...props }, ref) => {\n return (\n <Container\n {...props}\n ref={ref}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n />\n );\n }\n);\n\nBox.displayName = \"Box\";\n\nexport default Box;\n","import styled from \"styled-components\";\nimport {\n COMMON,\n BORDER,\n LAYOUT,\n POSITION,\n FLEXBOX,\n GRID,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeContainerProps } from \"./BoxTypes\";\n\nconst Container = styled.div<TypeContainerProps>`\n box-sizing: border-box;\n font-family: ${({ theme }) => theme.fontFamily};\n\n ${COMMON}\n ${BORDER}\n ${LAYOUT}\n ${POSITION}\n ${FLEXBOX}\n ${GRID}\n`;\n\nexport default Container;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACAvB,+BAAmB;AACnB,sCAOO;AAGP,IAAM,YAAY,yBAAAA,QAAO;AAAA;AAAA,iBAER,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU;AAAA;AAAA,IAE5C,sCAAM;AAAA,IACN,sCAAM;AAAA,IACN,sCAAM;AAAA,IACN,wCAAQ;AAAA,IACR,uCAAO;AAAA,IACP,oCAAI;AAAA;AAGR,IAAO,iBAAQ;;;ADhBT;AAHN,IAAM,MAAY;AAAA,EAChB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ;AAC5B,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QAIA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,IAAI,cAAc;AAElB,IAAO,cAAQ;;;ADnBf,IAAO,gBAAQ;","names":["styled"]}
package/jest.config.js CHANGED
@@ -1,13 +1,9 @@
1
- /**
2
- * @type {import('jest').Config}
3
- */
4
-
5
1
  const baseConfig = require("@sproutsocial/seeds-testing");
6
2
 
3
+ /** * @type {import('jest').Config} */
7
4
  const config = {
8
5
  ...baseConfig,
9
6
  displayName: "seeds-react-box",
10
- setupFilesAfterEnv: ["@sproutsocial/seeds-testing/setupAfterEnv"],
11
7
  };
12
8
 
13
9
  module.exports = config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/seeds-react-box",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Seeds React Box",
5
5
  "author": "Sprout Social, Inc.",
6
6
  "license": "MIT",
@@ -9,6 +9,7 @@
9
9
  "types": "dist/index.d.ts",
10
10
  "scripts": {
11
11
  "build": "tsup --dts",
12
+ "build:debug": "tsup --dts --metafile",
12
13
  "dev": "tsup --watch --dts",
13
14
  "clean": "rm -rf .turbo dist",
14
15
  "clean:modules": "rm -rf node_modules",
@@ -17,8 +18,8 @@
17
18
  "test:watch": "jest --watch --coverage=false"
18
19
  },
19
20
  "dependencies": {
20
- "@sproutsocial/seeds-react-theme": "^*",
21
- "@sproutsocial/seeds-react-system-props": "^*"
21
+ "@sproutsocial/seeds-react-theme": "^2.2.0",
22
+ "@sproutsocial/seeds-react-system-props": "^3.0.1"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@types/react": "^18.0.0",
@@ -0,0 +1,154 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { css } from "styled-components";
4
+ import Box from "./Box";
5
+ import { theme } from "@sproutsocial/seeds-react-theme";
6
+ import { useMeasure } from "@sproutsocial/seeds-react-hooks";
7
+
8
+ const meta = {
9
+ title: "Components/Box",
10
+ component: Box,
11
+ } satisfies Meta<typeof Box>;
12
+
13
+ export default meta;
14
+ type Story = StoryObj<typeof meta>;
15
+
16
+ export const Example: Story = {
17
+ name: "Example",
18
+ args: {
19
+ children: "This is a box.",
20
+ flexGrow: "1",
21
+ height: "200px",
22
+ bg: "neutral.100",
23
+ display: "flex",
24
+ alignItems: "center",
25
+ justifyContent: "center",
26
+ },
27
+ };
28
+
29
+ export const Responsive: Story = {
30
+ name: "Responsive example",
31
+ args: {
32
+ height: "200px",
33
+ display: "flex",
34
+ alignItems: "center",
35
+ justifyContent: "center",
36
+ },
37
+ render: (args) => {
38
+ const ref = React.useRef<HTMLDivElement>(null);
39
+ const { width } = useMeasure(ref);
40
+ return (
41
+ <>
42
+ <Box {...args} flexGrow="1">
43
+ This is a box.
44
+ </Box>
45
+ <Box
46
+ {...args}
47
+ mb={400}
48
+ bg={[
49
+ "neutral.100",
50
+ "blue.200",
51
+ "green.200",
52
+ "yellow.200",
53
+ "orange.200",
54
+ ]}
55
+ >
56
+ {width + "px"}
57
+ </Box>
58
+ {theme.breakpoints.map((width) => (
59
+ <Box
60
+ bg="neutral.200"
61
+ p={400}
62
+ width={width}
63
+ mb={400}
64
+ display="flex"
65
+ justifyContent="center"
66
+ position="relative"
67
+ css={css`
68
+ &:before {
69
+ content: "";
70
+ }
71
+ `}
72
+ >
73
+ {width}
74
+ </Box>
75
+ ))}
76
+ </>
77
+ );
78
+ },
79
+ };
80
+
81
+ export const FlexboxGap: Story = {
82
+ name: "Flexbox gap example",
83
+ args: {
84
+ display: "flex",
85
+ flexWrap: "wrap",
86
+ gap: 200,
87
+ rowGap: 200,
88
+ columnGap: 200,
89
+ },
90
+ render: (args) => (
91
+ <Box {...args}>
92
+ {new Array(25).fill(null).map((_, i) => (
93
+ <Box
94
+ key={i}
95
+ display="flex"
96
+ alignItems="center"
97
+ justifyContent="center"
98
+ height="200px"
99
+ width="200px"
100
+ bg="green.400"
101
+ >
102
+ {i + 1}
103
+ </Box>
104
+ ))}
105
+ </Box>
106
+ ),
107
+ };
108
+
109
+ export const Grid: Story = {
110
+ name: "Grid example",
111
+ argTypes: {
112
+ gridArea: { control: "text" },
113
+ gridAutoColumns: { control: "text" },
114
+ gridAutoFlow: { control: "text" },
115
+ gridAutoRows: { control: "text" },
116
+ gridColumn: { control: "text" },
117
+ gridColumnGap: { control: "text" },
118
+ gridRow: { control: "text" },
119
+ gridRowGap: { control: "text" },
120
+ gridTemplateAreas: { control: "text" },
121
+ gridTemplateRows: { control: "text" },
122
+ },
123
+ args: {
124
+ display: "grid",
125
+ gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))",
126
+ gap: 400,
127
+ gridArea: undefined,
128
+ gridAutoColumns: undefined,
129
+ gridAutoFlow: undefined,
130
+ gridAutoRows: undefined,
131
+ gridColumn: undefined,
132
+ gridColumnGap: undefined,
133
+ gridRow: undefined,
134
+ gridRowGap: undefined,
135
+ gridTemplateAreas: undefined,
136
+ gridTemplateRows: undefined,
137
+ },
138
+ render: (args) => (
139
+ <Box {...args}>
140
+ {new Array(25).fill(null).map((_, i) => (
141
+ <Box
142
+ key={i}
143
+ display="flex"
144
+ alignItems="center"
145
+ justifyContent="center"
146
+ height="200px"
147
+ bg="green.400"
148
+ >
149
+ {i + 1}
150
+ </Box>
151
+ ))}
152
+ </Box>
153
+ ),
154
+ };
package/tsup.config.ts CHANGED
@@ -8,4 +8,5 @@ export default defineConfig((options) => ({
8
8
  dts: options.dts,
9
9
  external: ["react"],
10
10
  sourcemap: true,
11
+ metafile: options.metafile,
11
12
  }));