@sproutsocial/seeds-react-container 0.1.4 → 0.2.0

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/.eslintrc.js CHANGED
@@ -1,4 +1,4 @@
1
1
  module.exports = {
2
- root: true,
2
+ root: "",
3
3
  extends: ["eslint-config-seeds/racine"],
4
4
  };
@@ -8,14 +8,14 @@ $ tsup --dts
8
8
  CLI Cleaning output folder
9
9
  CJS Build start
10
10
  ESM Build start
11
- CJS dist/index.js 4.40 KB
12
- CJS dist/index.js.map 3.99 KB
13
- CJS ⚡️ Build success in 180ms
14
- ESM dist/esm/index.js 2.20 KB
15
- ESM dist/esm/index.js.map 3.94 KB
16
- ESM ⚡️ Build success in 168ms
11
+ CJS dist/index.js 2.51 KB
12
+ CJS dist/index.js.map 1.58 KB
13
+ CJS ⚡️ Build success in 130ms
14
+ ESM dist/esm/index.js 813.00 B
15
+ ESM dist/esm/index.js.map 1.41 KB
16
+ ESM ⚡️ Build success in 130ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 28699ms
19
- DTS dist/index.d.ts 503.00 B
20
- DTS dist/index.d.mts 503.00 B
21
- Done in 35.75s.
18
+ DTS ⚡️ Build success in 25056ms
19
+ DTS dist/index.d.ts 241.00 B
20
+ DTS dist/index.d.mts 241.00 B
21
+ Done in 32.02s.
package/CHANGELOG.md CHANGED
@@ -1,44 +1,23 @@
1
1
  # @sproutsocial/seeds-react-container
2
2
 
3
- ## 0.1.4
3
+ ## 0.2.0
4
4
 
5
- ### Patch Changes
6
-
7
- - @sproutsocial/seeds-react-icon@2.0.2
8
- - @sproutsocial/seeds-react-button@1.3.7
9
-
10
- ## 0.1.3
11
-
12
- ### Patch Changes
13
-
14
- - Updated dependencies [fa7579a]
15
- - @sproutsocial/seeds-react-theme@3.2.1
16
- - @sproutsocial/seeds-react-box@1.1.7
17
- - @sproutsocial/seeds-react-icon@2.0.1
18
- - @sproutsocial/seeds-react-loader@1.0.6
19
- - @sproutsocial/seeds-react-button@1.3.6
20
-
21
- ## 0.1.2
22
-
23
- ### Patch Changes
5
+ ### Minor Changes
24
6
 
25
- - Updated dependencies [40248a0]
26
- - @sproutsocial/seeds-react-icon@2.0.0
27
- - @sproutsocial/seeds-react-button@1.3.5
7
+ - 1de0863: **Breaking Changes**
28
8
 
29
- ## 0.1.1
9
+ `@sproutsocial/seeds-react-container` has been simplified to a basic styled container component. It now only provides border, background, and border-radius styling as a wrapper around Box, accepting all Box props.
30
10
 
31
- ### Patch Changes
11
+ The previous Container component functionality (with title, subtitle, loading states, and header actions) has been moved to a new package: `@sproutsocial/seeds-react-content-block`.
32
12
 
33
- - Updated dependencies [8f6ba8d]
34
- - @sproutsocial/seeds-react-theme@3.2.0
35
- - @sproutsocial/seeds-react-box@1.1.6
36
- - @sproutsocial/seeds-react-icon@1.1.8
37
- - @sproutsocial/seeds-react-loader@1.0.5
38
- - @sproutsocial/seeds-react-button@1.3.4
13
+ **Migration**
39
14
 
40
- ## 0.1.0
15
+ If you were using the old Container component with `title`, `subtitle`, `isLoading`, or `headerActions` props, switch to `@sproutsocial/seeds-react-content-block`:
41
16
 
42
- ### Minor Changes
17
+ ```tsx
18
+ // Before
19
+ import { Container } from "@sproutsocial/seeds-react-container";
43
20
 
44
- - 5f6fee3: Created new component called Container that accepts a title, subtitle, header action, and can display a loading state"
21
+ // After
22
+ import { ContentBlock } from "@sproutsocial/seeds-react-content-block";
23
+ ```
package/dist/esm/index.js CHANGED
@@ -1,70 +1,27 @@
1
1
  // src/Container.tsx
2
- import "react";
3
- import { Box as Box2 } from "@sproutsocial/seeds-react-box";
4
- import { Text } from "@sproutsocial/seeds-react-text";
5
- import { Loader } from "@sproutsocial/seeds-react-loader";
2
+ import * as React from "react";
6
3
 
7
- // src/styles.ts
4
+ // src/styles.tsx
8
5
  import styled from "styled-components";
9
6
  import { Box } from "@sproutsocial/seeds-react-box";
10
- var ContainerStyles = styled.section`
7
+ var StyledContainer = styled(Box)`
11
8
  background: ${({ theme }) => theme.colors.container.background.base};
12
- border: ${({ theme }) => theme.borderWidths[500]} solid
13
- ${({ theme }) => theme.colors.container.border.base};
14
9
  border-radius: ${({ theme }) => theme.radii.outer};
15
- `;
16
- var ContainerHeader = styled(Box)`
17
- display: flex;
18
- justify-content: space-between;
19
- align-items: center;
20
- border-bottom: ${({ theme }) => theme.borderWidths[500]} solid
10
+ border: ${({ theme }) => theme.borders[500]}
21
11
  ${({ theme }) => theme.colors.container.border.base};
22
- color: ${({ theme }) => theme.colors.text.headline};
23
- padding: ${({ theme }) => theme.space[400]};
24
- `;
25
- var ContainerContent = styled(Box)`
26
- padding: ${({ theme }) => theme.space[400]};
27
12
  `;
13
+ var styles_default = StyledContainer;
28
14
 
29
15
  // src/Container.tsx
30
- import { jsx, jsxs } from "react/jsx-runtime";
31
- var Container = ({
32
- title,
33
- subtitle,
34
- titleAs = "h2",
35
- subtitleAs = "h3",
36
- content,
37
- isLoading,
38
- headerActions,
39
- contentProps,
40
- ...boxProps
41
- }) => {
42
- return /* @__PURE__ */ jsxs(ContainerStyles, { as: "section", ...boxProps, children: [
43
- /* @__PURE__ */ jsxs(ContainerHeader, { children: [
44
- /* @__PURE__ */ jsxs(Box2, { children: [
45
- /* @__PURE__ */ jsx(Text.Headline, { as: titleAs, children: title }),
46
- /* @__PURE__ */ jsx(Text.Byline, { as: subtitleAs, fontWeight: "normal", children: subtitle })
47
- ] }),
48
- headerActions && /* @__PURE__ */ jsx(Box2, { children: headerActions })
49
- ] }),
50
- /* @__PURE__ */ jsx(
51
- Box2,
52
- {
53
- p: 400,
54
- ...contentProps,
55
- borderBottomLeftRadius: "outer",
56
- borderBottomRightRadius: "outer",
57
- children: isLoading ? /* @__PURE__ */ jsx(Box2, { my: 400, children: /* @__PURE__ */ jsx(Loader, { delay: false }) }) : content
58
- }
59
- )
60
- ] });
61
- };
16
+ import { jsx } from "react/jsx-runtime";
17
+ var Container = React.forwardRef(
18
+ (props, ref) => {
19
+ return /* @__PURE__ */ jsx(styles_default, { ...props, ref });
20
+ }
21
+ );
22
+ Container.displayName = "Container";
62
23
  var Container_default = Container;
63
-
64
- // src/index.ts
65
- var index_default = Container_default;
66
24
  export {
67
- Container_default as Container,
68
- index_default as default
25
+ Container_default as Container
69
26
  };
70
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Container.tsx","../../src/styles.ts","../../src/index.ts"],"sourcesContent":["import React from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\nimport { Loader } from \"@sproutsocial/seeds-react-loader\";\nimport { ContainerHeader, ContainerStyles } from \"./styles\";\n\nexport interface ContainerProps {\n title: string;\n subtitle: string;\n titleAs: \"h1\" | \"h2\" | \"h3\" | \"h4\";\n subtitleAs: \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"p\";\n isLoading?: boolean;\n content?: React.ReactNode;\n headerActions?: React.ReactNode;\n contentProps?: React.ComponentProps<typeof Box>;\n}\n\nconst Container: React.FC<ContainerProps> = ({\n title,\n subtitle,\n titleAs = \"h2\",\n subtitleAs = \"h3\",\n content,\n isLoading,\n headerActions,\n contentProps,\n ...boxProps\n}) => {\n return (\n <ContainerStyles as=\"section\" {...boxProps}>\n <ContainerHeader>\n <Box>\n <Text.Headline as={titleAs}>{title}</Text.Headline>\n <Text.Byline as={subtitleAs} fontWeight=\"normal\">\n {subtitle}\n </Text.Byline>\n </Box>\n {headerActions && <Box>{headerActions}</Box>}\n </ContainerHeader>\n <Box\n p={400}\n {...contentProps}\n borderBottomLeftRadius=\"outer\"\n borderBottomRightRadius=\"outer\"\n >\n {isLoading ? (\n <Box my={400}>\n <Loader delay={false} />\n </Box>\n ) : (\n content\n )}\n </Box>\n </ContainerStyles>\n );\n};\n\nexport default Container;\n","import styled from \"styled-components\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\nexport const ContainerStyles = styled.section`\n background: ${({ theme }) => theme.colors.container.background.base};\n border: ${({ theme }) => theme.borderWidths[500]} solid\n ${({ theme }) => theme.colors.container.border.base};\n border-radius: ${({ theme }) => theme.radii.outer};\n`;\n\nexport const ContainerHeader = styled(Box)`\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: ${({ theme }) => theme.borderWidths[500]} solid\n ${({ theme }) => theme.colors.container.border.base};\n color: ${({ theme }) => theme.colors.text.headline};\n padding: ${({ theme }) => theme.space[400]};\n`;\n\nexport const ContainerContent = styled(Box)`\n padding: ${({ theme }) => theme.space[400]};\n`;\n","import Container from \"./Container\";\n\nexport type { ContainerProps } from \"./Container\";\n\nexport default Container;\nexport { Container };\n"],"mappings":";AAAA,OAAkB;AAClB,SAAS,OAAAA,YAAW;AACpB,SAAS,YAAY;AACrB,SAAS,cAAc;;;ACHvB,OAAO,YAAY;AACnB,SAAS,WAAW;AAEb,IAAM,kBAAkB,OAAO;AAAA,gBACtB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,UAAU,WAAW,IAAI;AAAA,YACzD,CAAC,EAAE,MAAM,MAAM,MAAM,aAAa,GAAG,CAAC;AAAA,MAC5C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,UAAU,OAAO,IAAI;AAAA,mBACpC,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,KAAK;AAAA;AAG5C,IAAM,kBAAkB,OAAO,GAAG;AAAA;AAAA;AAAA;AAAA,mBAItB,CAAC,EAAE,MAAM,MAAM,MAAM,aAAa,GAAG,CAAC;AAAA,MACnD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,UAAU,OAAO,IAAI;AAAA,WAC5C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,KAAK,QAAQ;AAAA,aACvC,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA;AAGrC,IAAM,mBAAmB,OAAO,GAAG;AAAA,aAC7B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA;;;ADUpC,SACE,KADF;AAdR,IAAM,YAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,SACE,qBAAC,mBAAgB,IAAG,WAAW,GAAG,UAChC;AAAA,yBAAC,mBACC;AAAA,2BAACC,MAAA,EACC;AAAA,4BAAC,KAAK,UAAL,EAAc,IAAI,SAAU,iBAAM;AAAA,QACnC,oBAAC,KAAK,QAAL,EAAY,IAAI,YAAY,YAAW,UACrC,oBACH;AAAA,SACF;AAAA,MACC,iBAAiB,oBAACA,MAAA,EAAK,yBAAc;AAAA,OACxC;AAAA,IACA;AAAA,MAACA;AAAA,MAAA;AAAA,QACC,GAAG;AAAA,QACF,GAAG;AAAA,QACJ,wBAAuB;AAAA,QACvB,yBAAwB;AAAA,QAEvB,sBACC,oBAACA,MAAA,EAAI,IAAI,KACP,8BAAC,UAAO,OAAO,OAAO,GACxB,IAEA;AAAA;AAAA,IAEJ;AAAA,KACF;AAEJ;AAEA,IAAO,oBAAQ;;;AErDf,IAAO,gBAAQ;","names":["Box","Box"]}
1
+ {"version":3,"sources":["../../src/Container.tsx","../../src/styles.tsx"],"sourcesContent":["import * as React from \"react\";\nimport StyledContainer from \"./styles\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\n\nconst Container = React.forwardRef<HTMLDivElement, TypeBoxProps>(\n (props, ref) => {\n return <StyledContainer {...props} ref={ref} />;\n }\n);\n\nContainer.displayName = \"Container\";\n\nexport default Container;\n","import styled from \"styled-components\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\n\nconst StyledContainer = styled(Box)<TypeBoxProps>`\n background: ${({ theme }) => theme.colors.container.background.base};\n border-radius: ${({ theme }) => theme.radii.outer};\n border: ${({ theme }) => theme.borders[500]}\n ${({ theme }) => theme.colors.container.border.base};\n`;\n\nexport default StyledContainer;\n"],"mappings":";AAAA,YAAY,WAAW;;;ACAvB,OAAO,YAAY;AACnB,SAAS,WAAW;AAGpB,IAAM,kBAAkB,OAAO,GAAG;AAAA,gBAClB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,UAAU,WAAW,IAAI;AAAA,mBAClD,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,KAAK;AAAA,YACvC,CAAC,EAAE,MAAM,MAAM,MAAM,QAAQ,GAAG,CAAC;AAAA,MACvC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,UAAU,OAAO,IAAI;AAAA;AAGvD,IAAO,iBAAQ;;;ADLJ;AAFX,IAAM,YAAkB;AAAA,EACtB,CAAC,OAAO,QAAQ;AACd,WAAO,oBAAC,kBAAiB,GAAG,OAAO,KAAU;AAAA,EAC/C;AACF;AAEA,UAAU,cAAc;AAExB,IAAO,oBAAQ;","names":[]}
package/dist/index.d.mts CHANGED
@@ -1,16 +1,6 @@
1
- import React from 'react';
2
- import { Box } from '@sproutsocial/seeds-react-box';
1
+ import * as React from 'react';
2
+ import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
3
3
 
4
- interface ContainerProps {
5
- title: string;
6
- subtitle: string;
7
- titleAs: "h1" | "h2" | "h3" | "h4";
8
- subtitleAs: "h2" | "h3" | "h4" | "h5" | "p";
9
- isLoading?: boolean;
10
- content?: React.ReactNode;
11
- headerActions?: React.ReactNode;
12
- contentProps?: React.ComponentProps<typeof Box>;
13
- }
14
- declare const Container: React.FC<ContainerProps>;
4
+ declare const Container: React.ForwardRefExoticComponent<Omit<TypeBoxProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
5
 
16
- export { Container, type ContainerProps, Container as default };
6
+ export { Container };
package/dist/index.d.ts CHANGED
@@ -1,16 +1,6 @@
1
- import React from 'react';
2
- import { Box } from '@sproutsocial/seeds-react-box';
1
+ import * as React from 'react';
2
+ import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
3
3
 
4
- interface ContainerProps {
5
- title: string;
6
- subtitle: string;
7
- titleAs: "h1" | "h2" | "h3" | "h4";
8
- subtitleAs: "h2" | "h3" | "h4" | "h5" | "p";
9
- isLoading?: boolean;
10
- content?: React.ReactNode;
11
- headerActions?: React.ReactNode;
12
- contentProps?: React.ComponentProps<typeof Box>;
13
- }
14
- declare const Container: React.FC<ContainerProps>;
4
+ declare const Container: React.ForwardRefExoticComponent<Omit<TypeBoxProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
5
 
16
- export { Container, type ContainerProps, Container as default };
6
+ export { Container };
package/dist/index.js CHANGED
@@ -30,76 +30,33 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
- Container: () => Container_default,
34
- default: () => index_default
33
+ Container: () => Container_default
35
34
  });
36
35
  module.exports = __toCommonJS(index_exports);
37
36
 
38
37
  // src/Container.tsx
39
- var import_react = require("react");
40
- var import_seeds_react_box2 = require("@sproutsocial/seeds-react-box");
41
- var import_seeds_react_text = require("@sproutsocial/seeds-react-text");
42
- var import_seeds_react_loader = require("@sproutsocial/seeds-react-loader");
38
+ var React = __toESM(require("react"));
43
39
 
44
- // src/styles.ts
40
+ // src/styles.tsx
45
41
  var import_styled_components = __toESM(require("styled-components"));
46
42
  var import_seeds_react_box = require("@sproutsocial/seeds-react-box");
47
- var ContainerStyles = import_styled_components.default.section`
43
+ var StyledContainer = (0, import_styled_components.default)(import_seeds_react_box.Box)`
48
44
  background: ${({ theme }) => theme.colors.container.background.base};
49
- border: ${({ theme }) => theme.borderWidths[500]} solid
50
- ${({ theme }) => theme.colors.container.border.base};
51
45
  border-radius: ${({ theme }) => theme.radii.outer};
52
- `;
53
- var ContainerHeader = (0, import_styled_components.default)(import_seeds_react_box.Box)`
54
- display: flex;
55
- justify-content: space-between;
56
- align-items: center;
57
- border-bottom: ${({ theme }) => theme.borderWidths[500]} solid
46
+ border: ${({ theme }) => theme.borders[500]}
58
47
  ${({ theme }) => theme.colors.container.border.base};
59
- color: ${({ theme }) => theme.colors.text.headline};
60
- padding: ${({ theme }) => theme.space[400]};
61
- `;
62
- var ContainerContent = (0, import_styled_components.default)(import_seeds_react_box.Box)`
63
- padding: ${({ theme }) => theme.space[400]};
64
48
  `;
49
+ var styles_default = StyledContainer;
65
50
 
66
51
  // src/Container.tsx
67
52
  var import_jsx_runtime = require("react/jsx-runtime");
68
- var Container = ({
69
- title,
70
- subtitle,
71
- titleAs = "h2",
72
- subtitleAs = "h3",
73
- content,
74
- isLoading,
75
- headerActions,
76
- contentProps,
77
- ...boxProps
78
- }) => {
79
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ContainerStyles, { as: "section", ...boxProps, children: [
80
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ContainerHeader, { children: [
81
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_seeds_react_box2.Box, { children: [
82
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_seeds_react_text.Text.Headline, { as: titleAs, children: title }),
83
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_seeds_react_text.Text.Byline, { as: subtitleAs, fontWeight: "normal", children: subtitle })
84
- ] }),
85
- headerActions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_seeds_react_box2.Box, { children: headerActions })
86
- ] }),
87
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
88
- import_seeds_react_box2.Box,
89
- {
90
- p: 400,
91
- ...contentProps,
92
- borderBottomLeftRadius: "outer",
93
- borderBottomRightRadius: "outer",
94
- children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_seeds_react_box2.Box, { my: 400, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_seeds_react_loader.Loader, { delay: false }) }) : content
95
- }
96
- )
97
- ] });
98
- };
53
+ var Container = React.forwardRef(
54
+ (props, ref) => {
55
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(styles_default, { ...props, ref });
56
+ }
57
+ );
58
+ Container.displayName = "Container";
99
59
  var Container_default = Container;
100
-
101
- // src/index.ts
102
- var index_default = Container_default;
103
60
  // Annotate the CommonJS export names for ESM import in node:
104
61
  0 && (module.exports = {
105
62
  Container
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/Container.tsx","../src/styles.ts"],"sourcesContent":["import Container from \"./Container\";\n\nexport type { ContainerProps } from \"./Container\";\n\nexport default Container;\nexport { Container };\n","import React from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\nimport { Loader } from \"@sproutsocial/seeds-react-loader\";\nimport { ContainerHeader, ContainerStyles } from \"./styles\";\n\nexport interface ContainerProps {\n title: string;\n subtitle: string;\n titleAs: \"h1\" | \"h2\" | \"h3\" | \"h4\";\n subtitleAs: \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"p\";\n isLoading?: boolean;\n content?: React.ReactNode;\n headerActions?: React.ReactNode;\n contentProps?: React.ComponentProps<typeof Box>;\n}\n\nconst Container: React.FC<ContainerProps> = ({\n title,\n subtitle,\n titleAs = \"h2\",\n subtitleAs = \"h3\",\n content,\n isLoading,\n headerActions,\n contentProps,\n ...boxProps\n}) => {\n return (\n <ContainerStyles as=\"section\" {...boxProps}>\n <ContainerHeader>\n <Box>\n <Text.Headline as={titleAs}>{title}</Text.Headline>\n <Text.Byline as={subtitleAs} fontWeight=\"normal\">\n {subtitle}\n </Text.Byline>\n </Box>\n {headerActions && <Box>{headerActions}</Box>}\n </ContainerHeader>\n <Box\n p={400}\n {...contentProps}\n borderBottomLeftRadius=\"outer\"\n borderBottomRightRadius=\"outer\"\n >\n {isLoading ? (\n <Box my={400}>\n <Loader delay={false} />\n </Box>\n ) : (\n content\n )}\n </Box>\n </ContainerStyles>\n );\n};\n\nexport default Container;\n","import styled from \"styled-components\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\nexport const ContainerStyles = styled.section`\n background: ${({ theme }) => theme.colors.container.background.base};\n border: ${({ theme }) => theme.borderWidths[500]} solid\n ${({ theme }) => theme.colors.container.border.base};\n border-radius: ${({ theme }) => theme.radii.outer};\n`;\n\nexport const ContainerHeader = styled(Box)`\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: ${({ theme }) => theme.borderWidths[500]} solid\n ${({ theme }) => theme.colors.container.border.base};\n color: ${({ theme }) => theme.colors.text.headline};\n padding: ${({ theme }) => theme.space[400]};\n`;\n\nexport const ContainerContent = styled(Box)`\n padding: ${({ theme }) => theme.space[400]};\n`;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAClB,IAAAA,0BAAoB;AACpB,8BAAqB;AACrB,gCAAuB;;;ACHvB,+BAAmB;AACnB,6BAAoB;AAEb,IAAM,kBAAkB,yBAAAC,QAAO;AAAA,gBACtB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,UAAU,WAAW,IAAI;AAAA,YACzD,CAAC,EAAE,MAAM,MAAM,MAAM,aAAa,GAAG,CAAC;AAAA,MAC5C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,UAAU,OAAO,IAAI;AAAA,mBACpC,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,KAAK;AAAA;AAG5C,IAAM,sBAAkB,yBAAAA,SAAO,0BAAG;AAAA;AAAA;AAAA;AAAA,mBAItB,CAAC,EAAE,MAAM,MAAM,MAAM,aAAa,GAAG,CAAC;AAAA,MACnD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,UAAU,OAAO,IAAI;AAAA,WAC5C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,KAAK,QAAQ;AAAA,aACvC,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA;AAGrC,IAAM,uBAAmB,yBAAAA,SAAO,0BAAG;AAAA,aAC7B,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA;;;ADUpC;AAdR,IAAM,YAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,SACE,6CAAC,mBAAgB,IAAG,WAAW,GAAG,UAChC;AAAA,iDAAC,mBACC;AAAA,mDAAC,+BACC;AAAA,oDAAC,6BAAK,UAAL,EAAc,IAAI,SAAU,iBAAM;AAAA,QACnC,4CAAC,6BAAK,QAAL,EAAY,IAAI,YAAY,YAAW,UACrC,oBACH;AAAA,SACF;AAAA,MACC,iBAAiB,4CAAC,+BAAK,yBAAc;AAAA,OACxC;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,GAAG;AAAA,QACF,GAAG;AAAA,QACJ,wBAAuB;AAAA,QACvB,yBAAwB;AAAA,QAEvB,sBACC,4CAAC,+BAAI,IAAI,KACP,sDAAC,oCAAO,OAAO,OAAO,GACxB,IAEA;AAAA;AAAA,IAEJ;AAAA,KACF;AAEJ;AAEA,IAAO,oBAAQ;;;ADrDf,IAAO,gBAAQ;","names":["import_seeds_react_box","styled"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/Container.tsx","../src/styles.tsx"],"sourcesContent":["import Container from \"./Container\";\n\nexport { Container };\nexport * from \"./ContainerTypes\";\n","import * as React from \"react\";\nimport StyledContainer from \"./styles\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\n\nconst Container = React.forwardRef<HTMLDivElement, TypeBoxProps>(\n (props, ref) => {\n return <StyledContainer {...props} ref={ref} />;\n }\n);\n\nContainer.displayName = \"Container\";\n\nexport default Container;\n","import styled from \"styled-components\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\n\nconst StyledContainer = styled(Box)<TypeBoxProps>`\n background: ${({ theme }) => theme.colors.container.background.base};\n border-radius: ${({ theme }) => theme.radii.outer};\n border: ${({ theme }) => theme.borders[500]}\n ${({ theme }) => theme.colors.container.border.base};\n`;\n\nexport default StyledContainer;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACAvB,+BAAmB;AACnB,6BAAoB;AAGpB,IAAM,sBAAkB,yBAAAA,SAAO,0BAAG;AAAA,gBAClB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,UAAU,WAAW,IAAI;AAAA,mBAClD,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,KAAK;AAAA,YACvC,CAAC,EAAE,MAAM,MAAM,MAAM,QAAQ,GAAG,CAAC;AAAA,MACvC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,UAAU,OAAO,IAAI;AAAA;AAGvD,IAAO,iBAAQ;;;ADLJ;AAFX,IAAM,YAAkB;AAAA,EACtB,CAAC,OAAO,QAAQ;AACd,WAAO,4CAAC,kBAAiB,GAAG,OAAO,KAAU;AAAA,EAC/C;AACF;AAEA,UAAU,cAAc;AAExB,IAAO,oBAAQ;","names":["styled"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/seeds-react-container",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Seeds React Container",
5
5
  "author": "Sprout Social, Inc.",
6
6
  "license": "MIT",
@@ -19,12 +19,8 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@sproutsocial/seeds-react-box": "^1.1.7",
22
- "@sproutsocial/seeds-react-button": "^1.3.7",
23
- "@sproutsocial/seeds-react-icon": "^2.0.2",
24
- "@sproutsocial/seeds-react-loader": "^1.0.6",
25
- "@sproutsocial/seeds-react-system-props": "^3.0.2",
26
- "@sproutsocial/seeds-react-text": "^1.3.2",
27
- "@sproutsocial/seeds-react-theme": "^3.2.1"
22
+ "@sproutsocial/seeds-react-theme": "^3.2.1",
23
+ "@sproutsocial/seeds-react-system-props": "^3.0.1"
28
24
  },
29
25
  "devDependencies": {
30
26
  "@types/react": "^18.0.0",
@@ -1,52 +1,17 @@
1
- import Container from "./Container";
2
1
  import type { Meta, StoryObj } from "@storybook/react";
3
- import { Text } from "@sproutsocial/seeds-react-text";
4
- import { Button } from "@sproutsocial/seeds-react-button";
5
- import { Icon } from "@sproutsocial/seeds-react-icon";
2
+ import Container from "./Container";
6
3
 
7
- const meta: Meta<typeof Container> = {
4
+ const meta = {
8
5
  title: "Components/Container",
9
6
  component: Container,
10
- args: {
11
- title: "Volume Breakdown - Outbound",
12
- subtitle: "View a breakdown of your outbound volume.",
13
- content: (
14
- <Text.SmallBodyCopy>
15
- Here is some content inside the container.
16
- </Text.SmallBodyCopy>
17
- ),
18
- isLoading: false,
19
- headerActions: null,
20
- },
21
- };
7
+ } satisfies Meta<typeof Container>;
22
8
 
23
9
  export default meta;
24
-
25
- type Story = StoryObj<typeof Container>;
10
+ type Story = StoryObj<typeof meta>;
26
11
 
27
12
  export const Default: Story = {
28
- render: (args) => <Container {...args} />,
29
- };
30
-
31
- export const WithHeaderActions: Story = {
32
- render: (args) => (
33
- <Container
34
- {...args}
35
- headerActions={
36
- <Button size="small">
37
- <Icon name="face-frown-open-solid" />
38
- </Button>
39
- }
40
- />
41
- ),
42
- };
43
-
44
- export const LoadingState: Story = {
45
- render: (args) => <Container {...args} isLoading={true} />,
46
- };
47
-
48
- export const WithContentStyles: Story = {
49
- render: (args) => (
50
- <Container {...args} contentProps={{ p: 0, py: 400, bg: "blue.300" }} />
51
- ),
13
+ args: {
14
+ children: "This is a container.",
15
+ },
16
+ render: (args) => <Container p={400} {...args} />,
52
17
  };
package/src/Container.tsx CHANGED
@@ -1,58 +1,13 @@
1
- import React from "react";
2
- import { Box } from "@sproutsocial/seeds-react-box";
3
- import { Text } from "@sproutsocial/seeds-react-text";
4
- import { Loader } from "@sproutsocial/seeds-react-loader";
5
- import { ContainerHeader, ContainerStyles } from "./styles";
1
+ import * as React from "react";
2
+ import StyledContainer from "./styles";
3
+ import type { TypeBoxProps } from "@sproutsocial/seeds-react-box";
6
4
 
7
- export interface ContainerProps {
8
- title: string;
9
- subtitle: string;
10
- titleAs: "h1" | "h2" | "h3" | "h4";
11
- subtitleAs: "h2" | "h3" | "h4" | "h5" | "p";
12
- isLoading?: boolean;
13
- content?: React.ReactNode;
14
- headerActions?: React.ReactNode;
15
- contentProps?: React.ComponentProps<typeof Box>;
16
- }
5
+ const Container = React.forwardRef<HTMLDivElement, TypeBoxProps>(
6
+ (props, ref) => {
7
+ return <StyledContainer {...props} ref={ref} />;
8
+ }
9
+ );
17
10
 
18
- const Container: React.FC<ContainerProps> = ({
19
- title,
20
- subtitle,
21
- titleAs = "h2",
22
- subtitleAs = "h3",
23
- content,
24
- isLoading,
25
- headerActions,
26
- contentProps,
27
- ...boxProps
28
- }) => {
29
- return (
30
- <ContainerStyles as="section" {...boxProps}>
31
- <ContainerHeader>
32
- <Box>
33
- <Text.Headline as={titleAs}>{title}</Text.Headline>
34
- <Text.Byline as={subtitleAs} fontWeight="normal">
35
- {subtitle}
36
- </Text.Byline>
37
- </Box>
38
- {headerActions && <Box>{headerActions}</Box>}
39
- </ContainerHeader>
40
- <Box
41
- p={400}
42
- {...contentProps}
43
- borderBottomLeftRadius="outer"
44
- borderBottomRightRadius="outer"
45
- >
46
- {isLoading ? (
47
- <Box my={400}>
48
- <Loader delay={false} />
49
- </Box>
50
- ) : (
51
- content
52
- )}
53
- </Box>
54
- </ContainerStyles>
55
- );
56
- };
11
+ Container.displayName = "Container";
57
12
 
58
13
  export default Container;
@@ -0,0 +1 @@
1
+ import type { TypeBoxProps } from "@sproutsocial/seeds-react-box";
@@ -1,53 +1,10 @@
1
1
  import { render, screen } from "@sproutsocial/seeds-react-testing-library";
2
2
  import Container from "../Container";
3
3
 
4
- describe("Container Features", () => {
5
- test("renders title and subtitle with correct semantic elements", () => {
6
- render(
7
- <Container
8
- title="Test Title"
9
- subtitle="Test Subtitle"
10
- titleAs="h1"
11
- subtitleAs="h2"
12
- />
13
- );
4
+ describe("Container", () => {
5
+ it("should render properly", () => {
6
+ render(<Container>Test...</Container>);
14
7
 
15
- const titleElement = screen.getByText("Test Title");
16
- const subtitleElement = screen.getByText("Test Subtitle");
17
-
18
- expect(titleElement.tagName).toBe("H1");
19
- expect(subtitleElement.tagName).toBe("H2");
20
- });
21
-
22
- test("renders content when not loading", () => {
23
- render(
24
- <Container
25
- title="Test Title"
26
- subtitle="Test Subtitle"
27
- titleAs="h2"
28
- subtitleAs="h3"
29
- isLoading={false}
30
- content={<div>Loaded Content</div>}
31
- />
32
- );
33
- expect(screen.getByText("Loaded Content")).toBeInTheDocument();
34
- });
35
-
36
- test("renders loader when loading", () => {
37
- render(
38
- <Container
39
- title="Test Title"
40
- subtitle="Test Subtitle"
41
- titleAs="h2"
42
- subtitleAs="h3"
43
- isLoading={true}
44
- />
45
- );
46
-
47
- expect(
48
- screen.getByDataQaLabel({
49
- loader: "",
50
- })
51
- ).toBeInTheDocument();
8
+ expect(screen.getByText("Test...")).toBeInTheDocument();
52
9
  });
53
10
  });
package/src/index.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import Container from "./Container";
2
2
 
3
- export type { ContainerProps } from "./Container";
4
-
5
- export default Container;
6
3
  export { Container };
4
+ export * from "./ContainerTypes";
package/src/styles.tsx ADDED
@@ -0,0 +1,12 @@
1
+ import styled from "styled-components";
2
+ import { Box } from "@sproutsocial/seeds-react-box";
3
+ import type { TypeBoxProps } from "@sproutsocial/seeds-react-box";
4
+
5
+ const StyledContainer = styled(Box)<TypeBoxProps>`
6
+ background: ${({ theme }) => theme.colors.container.background.base};
7
+ border-radius: ${({ theme }) => theme.radii.outer};
8
+ border: ${({ theme }) => theme.borders[500]}
9
+ ${({ theme }) => theme.colors.container.border.base};
10
+ `;
11
+
12
+ export default StyledContainer;
package/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "module": "esnext"
6
6
  },
7
7
  "include": ["src/**/*"],
8
- "exclude": ["node_modules", "dist", "coverage"]
8
+ "exclude": ["node_modules", "dist", "**/*.stories.tsx", "**/*.stories.ts"]
9
9
  }
package/src/styled.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import "styled-components";
2
- import { TypeTheme } from "@sproutsocial/seeds-react-theme";
3
-
4
- declare module "styled-components" {
5
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
6
- export interface DefaultTheme extends TypeTheme {}
7
- }
package/src/styles.ts DELETED
@@ -1,23 +0,0 @@
1
- import styled from "styled-components";
2
- import { Box } from "@sproutsocial/seeds-react-box";
3
-
4
- export const ContainerStyles = styled.section`
5
- background: ${({ theme }) => theme.colors.container.background.base};
6
- border: ${({ theme }) => theme.borderWidths[500]} solid
7
- ${({ theme }) => theme.colors.container.border.base};
8
- border-radius: ${({ theme }) => theme.radii.outer};
9
- `;
10
-
11
- export const ContainerHeader = styled(Box)`
12
- display: flex;
13
- justify-content: space-between;
14
- align-items: center;
15
- border-bottom: ${({ theme }) => theme.borderWidths[500]} solid
16
- ${({ theme }) => theme.colors.container.border.base};
17
- color: ${({ theme }) => theme.colors.text.headline};
18
- padding: ${({ theme }) => theme.space[400]};
19
- `;
20
-
21
- export const ContainerContent = styled(Box)`
22
- padding: ${({ theme }) => theme.space[400]};
23
- `;