@sproutsocial/seeds-react-box 1.1.1 → 1.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.
@@ -1,21 +1,21 @@
1
1
  yarn run v1.22.22
2
2
  $ tsup --dts
3
- CLI Building entry: src/index.ts
4
- CLI Using tsconfig: tsconfig.json
5
- CLI tsup v8.0.2
6
- CLI Using tsup config: /home/runner/work/seeds/seeds/seeds-react/seeds-react-box/tsup.config.ts
7
- CLI Target: es2022
8
- CLI Cleaning output folder
9
- CJS Build start
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
15
- CJS dist/index.js.map 1.77 KB
16
- CJS ⚡️ Build success in 23ms
17
- DTS Build start
18
- DTS ⚡️ Build success in 6265ms
19
- DTS dist/index.d.ts 800.00 B
20
- DTS dist/index.d.mts 800.00 B
21
- Done in 7.86s.
3
+ CLI Building entry: src/index.ts
4
+ CLI Using tsconfig: tsconfig.json
5
+ CLI tsup v8.5.0
6
+ CLI Using tsup config: /home/runner/work/seeds/seeds/seeds-react/seeds-react-box/tsup.config.ts
7
+ CLI Target: es2022
8
+ CLI Cleaning output folder
9
+ CJS Build start
10
+ ESM Build start
11
+ CJS dist/index.js 2.68 KB
12
+ CJS dist/index.js.map 1.77 KB
13
+ CJS ⚡️ Build success in 130ms
14
+ ESM dist/esm/index.js 878.00 B
15
+ ESM dist/esm/index.js.map 1.77 KB
16
+ ESM ⚡️ Build success in 121ms
17
+ DTS Build start
18
+ DTS ⚡️ Build success in 36999ms
19
+ DTS dist/index.d.ts 800.00 B
20
+ DTS dist/index.d.mts 800.00 B
21
+ Done in 41.48s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @sproutsocial/seeds-react-box
2
2
 
3
+ ## 1.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [22e1111]
8
+ - @sproutsocial/seeds-react-theme@3.0.1
9
+
10
+ ## 1.1.2
11
+
12
+ ### Patch Changes
13
+
14
+ - 9fd8bac: Update dependencies to use semantic package version instead of wildcards
15
+ - Updated dependencies [9fd8bac]
16
+ - @sproutsocial/seeds-react-system-props@3.0.2
17
+ - @sproutsocial/seeds-react-theme@2.2.1
18
+
3
19
  ## 1.1.1
4
20
 
5
21
  ### 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.3",
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": "^3.0.1",
22
+ "@sproutsocial/seeds-react-system-props": "^3.0.1"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@types/react": "^18.0.0",
@@ -26,7 +27,7 @@
26
27
  "@sproutsocial/eslint-config-seeds": "*",
27
28
  "react": "^18.0.0",
28
29
  "styled-components": "^5.2.3",
29
- "tsup": "^8.0.2",
30
+ "tsup": "^8.3.4",
30
31
  "typescript": "^5.6.2",
31
32
  "@sproutsocial/seeds-tsconfig": "*",
32
33
  "@sproutsocial/seeds-testing": "*",
@@ -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/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "module": "esnext"
6
6
  },
7
7
  "include": ["src/**/*"],
8
- "exclude": ["node_modules", "dist"]
8
+ "exclude": ["node_modules", "dist", "**/*.stories.tsx", "**/*.stories.ts"]
9
9
  }
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
  }));