@sproutsocial/seeds-react-fieldset 1.0.27 → 1.0.28

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/esm/index.js CHANGED
@@ -86,16 +86,22 @@ var FieldsetTailwind = ({
86
86
  children: [
87
87
  typeof label === "string" ? /* @__PURE__ */ jsx2("legend", { className: "seeds-fieldset-legend", children: label }) : label,
88
88
  typeof helperText === "string" ? /* @__PURE__ */ jsx2("p", { className: "seeds-fieldset-helper-text", children: helperText }) : helperText,
89
- /* @__PURE__ */ jsx2("div", { className: cn("seeds-fieldset-list", `seeds-fieldset-list-${layout}`), children: React.Children.map(children, (child) => /* @__PURE__ */ jsx2(
89
+ /* @__PURE__ */ jsx2(
90
90
  "div",
91
91
  {
92
- className: cn(
93
- "seeds-fieldset-item",
94
- `seeds-fieldset-item-${layout}`
95
- ),
96
- children: child
92
+ className: cn("seeds-fieldset-list", `seeds-fieldset-list-${layout}`),
93
+ children: React.Children.map(children, (child) => /* @__PURE__ */ jsx2(
94
+ "div",
95
+ {
96
+ className: cn(
97
+ "seeds-fieldset-item",
98
+ `seeds-fieldset-item-${layout}`
99
+ ),
100
+ children: child
101
+ }
102
+ ))
97
103
  }
98
- )) })
104
+ )
99
105
  ]
100
106
  }
101
107
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/FieldsetHybrid.tsx","../../src/styles.ts","../../src/FieldsetParts.tsx","../../src/FieldsetTailwind.tsx","../../src/Fieldset.tsx","../../src/FieldsetTypes.ts","../../src/index.ts"],"sourcesContent":["/**\n * Hybrid Fieldset Component\n * Automatically chooses between Tailwind and styled-components based on props\n */\n\nimport * as React from \"react\";\nimport Box from \"@sproutsocial/seeds-react-box\";\nimport { hasStyledProps } from \"@sproutsocial/seeds-react-system-props\";\nimport { ChildContainer } from \"./styles\"; // Styled-components version\nimport { FieldsetLegend, FieldsetHelperText } from \"./FieldsetParts\";\nimport { FieldsetTailwind } from \"./FieldsetTailwind\"; // Tailwind version\nimport type { TypeFieldsetProps } from \"./FieldsetTypes\";\n\nconst FieldsetHybrid = ({\n layout = \"vertical\",\n label,\n helperText,\n children,\n ...rest\n}: TypeFieldsetProps) => {\n if (hasStyledProps(rest)) {\n // Legacy styled-components tree — identical to the pre-migration Fieldset body\n return (\n <Box as=\"fieldset\" border=\"none\" p={0} data-qa-fieldset=\"\" {...rest}>\n {typeof label === \"string\" ? (\n <FieldsetLegend>{label}</FieldsetLegend>\n ) : (\n label\n )}\n {typeof helperText === \"string\" ? (\n <FieldsetHelperText>{helperText}</FieldsetHelperText>\n ) : (\n helperText\n )}\n <Box\n display=\"flex\"\n flexDirection={layout === \"vertical\" ? \"column\" : \"row\"}\n >\n {React.Children.map(children, (child) => (\n <ChildContainer layout={layout}>{child}</ChildContainer>\n ))}\n </Box>\n </Box>\n );\n }\n\n // Use Tailwind version (preferred - better performance)\n return (\n <FieldsetTailwind\n layout={layout}\n label={label}\n helperText={helperText}\n {...rest}\n >\n {children}\n </FieldsetTailwind>\n );\n};\n\nFieldsetHybrid.displayName = \"Fieldset\";\nexport default FieldsetHybrid;\n","import styled, { css } from \"styled-components\";\nimport type { TypeFieldsetChildContainerProps } from \"./FieldsetTypes\";\nimport Box from \"@sproutsocial/seeds-react-box\";\n\nexport const ChildContainer = styled(Box)<TypeFieldsetChildContainerProps>`\n ${(props) =>\n props.layout === \"vertical\" &&\n css`\n margin-top: ${props.theme.space[300]};\n\n &:first-child {\n margin-top: 0;\n }\n `}\n\n ${(props) =>\n props.layout === \"horizontal\" &&\n css`\n margin-left: ${props.theme.space[300]};\n\n &:first-child {\n margin-left: 0;\n }\n `}\n`;\n","import Text from \"@sproutsocial/seeds-react-text\";\nimport type {\n TypeFieldsetLegendProps,\n TypeFieldsetHelperText,\n} from \"./FieldsetTypes\";\n\n/**\n * Text-based legend and helper-text parts for Fieldset.\n *\n * These remain styled-components (Text) because they are exposed as the public\n * Fieldset.Legend / Fieldset.HelperText statics and accept arbitrary\n * styled-system props. They are shared by both the styled-components branch of\n * FieldsetHybrid and the compound statics attached in Fieldset.tsx.\n */\nexport const FieldsetLegend = ({\n children,\n ...rest\n}: TypeFieldsetLegendProps) => (\n <Text\n as=\"legend\"\n fontSize={300}\n fontWeight=\"semibold\"\n color=\"text.body\"\n mb={300}\n {...rest}\n >\n {children}\n </Text>\n);\n\nexport const FieldsetHelperText = ({\n children,\n ...rest\n}: TypeFieldsetHelperText) => (\n <Text as=\"p\" fontSize={200} mb={300} {...rest}>\n {children}\n </Text>\n);\n\nFieldsetLegend.displayName = \"Fieldset.Legend\";\nFieldsetHelperText.displayName = \"Fieldset.HelperText\";\n","/**\n * Tailwind CSS implementation of Fieldset component\n * Uses Seeds fieldset CSS classes from fieldset.css\n */\n\nimport * as React from \"react\";\nimport type { TypeFieldsetProps } from \"./FieldsetTypes\";\n\n// Utility for merging class names properly\nfunction cn(\n ...inputs: (string | undefined | null | false | Record<string, boolean>)[]\n): string {\n const classes: string[] = [];\n\n for (const input of inputs) {\n if (!input) continue;\n\n if (typeof input === \"string\") {\n classes.push(input);\n } else if (typeof input === \"object\") {\n for (const [key, value] of Object.entries(input)) {\n if (value) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(\" \");\n}\n\nexport const FieldsetTailwind = ({\n layout = \"vertical\",\n label,\n helperText,\n children,\n className,\n ...rest\n}: TypeFieldsetProps) => {\n // Use a loosely-typed root so DOM attributes in `...rest` (e.g. aria-live) are\n // forwarded without TypeScript flagging styled-system props carried by\n // TypeBoxProps (e.g. `color`) that conflict with the intrinsic <fieldset> attrs.\n // Mirrors ButtonTailwind, which spreads `...rest` onto an `as any` element.\n const Root = \"fieldset\" as any;\n\n return (\n <Root\n className={cn(\"seeds-fieldset\", className)}\n data-qa-fieldset=\"\"\n {...rest}\n >\n {typeof label === \"string\" ? (\n <legend className=\"seeds-fieldset-legend\">{label}</legend>\n ) : (\n label\n )}\n {typeof helperText === \"string\" ? (\n <p className=\"seeds-fieldset-helper-text\">{helperText}</p>\n ) : (\n helperText\n )}\n <div className={cn(\"seeds-fieldset-list\", `seeds-fieldset-list-${layout}`)}>\n {React.Children.map(children, (child) => (\n <div\n className={cn(\n \"seeds-fieldset-item\",\n `seeds-fieldset-item-${layout}`\n )}\n >\n {child}\n </div>\n ))}\n </div>\n </Root>\n );\n};\n\nFieldsetTailwind.displayName = \"FieldsetTailwind\";\n","import FieldsetHybrid from \"./FieldsetHybrid\";\nimport { FieldsetLegend, FieldsetHelperText } from \"./FieldsetParts\";\n\n/**\n * Fieldset Component\n *\n * Thin assembly over the hybrid implementation: FieldsetHybrid routes to the\n * styled-components path when styled-system props are passed and to the Tailwind\n * path otherwise. The public Fieldset.Legend / Fieldset.HelperText statics remain\n * Text-based (see FieldsetParts) so they keep accepting styled-system props.\n */\nconst Fieldset = Object.assign(FieldsetHybrid, {\n Legend: FieldsetLegend,\n HelperText: FieldsetHelperText,\n});\n\nexport default Fieldset;\n","import type { TypeTextProps } from \"@sproutsocial/seeds-react-text\";\nimport React from \"react\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\n\nexport interface TypeFieldsetProps extends TypeBoxProps {\n /** Label text to display above the fieldset */\n label: React.ReactNode;\n helperText?: React.ReactNode;\n layout?: \"vertical\" | \"horizontal\";\n children: React.ReactNode;\n}\n\nexport interface TypeFieldsetChildContainerProps {\n layout: TypeFieldsetProps[\"layout\"];\n}\n\nexport interface TypeFieldsetLegendProps extends TypeTextProps {\n children: React.ReactNode;\n}\n\nexport interface TypeFieldsetHelperText extends TypeTextProps {\n children: React.ReactNode;\n}\n","import Fieldset from \"./Fieldset\";\n\nexport default Fieldset;\nexport { Fieldset };\nexport * from \"./FieldsetTypes\";\n"],"mappings":";AAKA,YAAYA,YAAW;AACvB,OAAOC,UAAS;AAChB,SAAS,sBAAsB;;;ACP/B,OAAO,UAAU,WAAW;AAE5B,OAAO,SAAS;AAET,IAAM,iBAAiB,OAAO,GAAG;AAAA,IACpC,CAAC,UACD,MAAM,WAA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A;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,eAAe,cAAc;AAC7B,IAAO,yBAAQ;;;AIjDf,IAAM,WAAW,OAAO,OAAO,wBAAgB;AAAA,EAC7C,QAAQ;AAAA,EACR,YAAY;AACd,CAAC;AAED,IAAO,mBAAQ;;;ACff,OAAkB;;;ACClB,IAAO,gBAAQ;","names":["React","Box","jsx","jsx","jsxs","Box"]}
1
+ {"version":3,"sources":["../../src/FieldsetHybrid.tsx","../../src/styles.ts","../../src/FieldsetParts.tsx","../../src/FieldsetTailwind.tsx","../../src/Fieldset.tsx","../../src/FieldsetTypes.ts","../../src/index.ts"],"sourcesContent":["/**\n * Hybrid Fieldset Component\n * Automatically chooses between Tailwind and styled-components based on props\n */\n\nimport * as React from \"react\";\nimport Box from \"@sproutsocial/seeds-react-box\";\nimport { hasStyledProps } from \"@sproutsocial/seeds-react-system-props\";\nimport { ChildContainer } from \"./styles\"; // Styled-components version\nimport { FieldsetLegend, FieldsetHelperText } from \"./FieldsetParts\";\nimport { FieldsetTailwind } from \"./FieldsetTailwind\"; // Tailwind version\nimport type { TypeFieldsetProps } from \"./FieldsetTypes\";\n\nconst FieldsetHybrid = ({\n layout = \"vertical\",\n label,\n helperText,\n children,\n ...rest\n}: TypeFieldsetProps) => {\n if (hasStyledProps(rest)) {\n // Legacy styled-components tree — identical to the pre-migration Fieldset body\n return (\n <Box as=\"fieldset\" border=\"none\" p={0} data-qa-fieldset=\"\" {...rest}>\n {typeof label === \"string\" ? (\n <FieldsetLegend>{label}</FieldsetLegend>\n ) : (\n label\n )}\n {typeof helperText === \"string\" ? (\n <FieldsetHelperText>{helperText}</FieldsetHelperText>\n ) : (\n helperText\n )}\n <Box\n display=\"flex\"\n flexDirection={layout === \"vertical\" ? \"column\" : \"row\"}\n >\n {React.Children.map(children, (child) => (\n <ChildContainer layout={layout}>{child}</ChildContainer>\n ))}\n </Box>\n </Box>\n );\n }\n\n // Use Tailwind version (preferred - better performance)\n return (\n <FieldsetTailwind\n layout={layout}\n label={label}\n helperText={helperText}\n {...rest}\n >\n {children}\n </FieldsetTailwind>\n );\n};\n\nFieldsetHybrid.displayName = \"Fieldset\";\nexport default FieldsetHybrid;\n","import styled, { css } from \"styled-components\";\nimport type { TypeFieldsetChildContainerProps } from \"./FieldsetTypes\";\nimport Box from \"@sproutsocial/seeds-react-box\";\n\nexport const ChildContainer = styled(Box)<TypeFieldsetChildContainerProps>`\n ${(props) =>\n props.layout === \"vertical\" &&\n css`\n margin-top: ${props.theme.space[300]};\n\n &:first-child {\n margin-top: 0;\n }\n `}\n\n ${(props) =>\n props.layout === \"horizontal\" &&\n css`\n margin-left: ${props.theme.space[300]};\n\n &:first-child {\n margin-left: 0;\n }\n `}\n`;\n","import Text from \"@sproutsocial/seeds-react-text\";\nimport type {\n TypeFieldsetLegendProps,\n TypeFieldsetHelperText,\n} from \"./FieldsetTypes\";\n\n/**\n * Text-based legend and helper-text parts for Fieldset.\n *\n * These remain styled-components (Text) because they are exposed as the public\n * Fieldset.Legend / Fieldset.HelperText statics and accept arbitrary\n * styled-system props. They are shared by both the styled-components branch of\n * FieldsetHybrid and the compound statics attached in Fieldset.tsx.\n */\nexport const FieldsetLegend = ({\n children,\n ...rest\n}: TypeFieldsetLegendProps) => (\n <Text\n as=\"legend\"\n fontSize={300}\n fontWeight=\"semibold\"\n color=\"text.body\"\n mb={300}\n {...rest}\n >\n {children}\n </Text>\n);\n\nexport const FieldsetHelperText = ({\n children,\n ...rest\n}: TypeFieldsetHelperText) => (\n <Text as=\"p\" fontSize={200} mb={300} {...rest}>\n {children}\n </Text>\n);\n\nFieldsetLegend.displayName = \"Fieldset.Legend\";\nFieldsetHelperText.displayName = \"Fieldset.HelperText\";\n","/**\n * Tailwind CSS implementation of Fieldset component\n * Uses Seeds fieldset CSS classes from fieldset.css\n */\n\nimport * as React from \"react\";\nimport type { TypeFieldsetProps } from \"./FieldsetTypes\";\n\n// Utility for merging class names properly\nfunction cn(\n ...inputs: (string | undefined | null | false | Record<string, boolean>)[]\n): string {\n const classes: string[] = [];\n\n for (const input of inputs) {\n if (!input) continue;\n\n if (typeof input === \"string\") {\n classes.push(input);\n } else if (typeof input === \"object\") {\n for (const [key, value] of Object.entries(input)) {\n if (value) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(\" \");\n}\n\nexport const FieldsetTailwind = ({\n layout = \"vertical\",\n label,\n helperText,\n children,\n className,\n ...rest\n}: TypeFieldsetProps) => {\n // Use a loosely-typed root so DOM attributes in `...rest` (e.g. aria-live) are\n // forwarded without TypeScript flagging styled-system props carried by\n // TypeBoxProps (e.g. `color`) that conflict with the intrinsic <fieldset> attrs.\n // Mirrors ButtonTailwind, which spreads `...rest` onto an `as any` element.\n const Root = \"fieldset\" as any;\n\n return (\n <Root\n className={cn(\"seeds-fieldset\", className)}\n data-qa-fieldset=\"\"\n {...rest}\n >\n {typeof label === \"string\" ? (\n <legend className=\"seeds-fieldset-legend\">{label}</legend>\n ) : (\n label\n )}\n {typeof helperText === \"string\" ? (\n <p className=\"seeds-fieldset-helper-text\">{helperText}</p>\n ) : (\n helperText\n )}\n <div\n className={cn(\"seeds-fieldset-list\", `seeds-fieldset-list-${layout}`)}\n >\n {React.Children.map(children, (child) => (\n <div\n className={cn(\n \"seeds-fieldset-item\",\n `seeds-fieldset-item-${layout}`\n )}\n >\n {child}\n </div>\n ))}\n </div>\n </Root>\n );\n};\n\nFieldsetTailwind.displayName = \"FieldsetTailwind\";\n","import FieldsetHybrid from \"./FieldsetHybrid\";\nimport { FieldsetLegend, FieldsetHelperText } from \"./FieldsetParts\";\n\n/**\n * Fieldset Component\n *\n * Thin assembly over the hybrid implementation: FieldsetHybrid routes to the\n * styled-components path when styled-system props are passed and to the Tailwind\n * path otherwise. The public Fieldset.Legend / Fieldset.HelperText statics remain\n * Text-based (see FieldsetParts) so they keep accepting styled-system props.\n */\nconst Fieldset = Object.assign(FieldsetHybrid, {\n Legend: FieldsetLegend,\n HelperText: FieldsetHelperText,\n});\n\nexport default Fieldset;\n","import type { TypeTextProps } from \"@sproutsocial/seeds-react-text\";\nimport React from \"react\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\n\nexport interface TypeFieldsetProps extends TypeBoxProps {\n /** Label text to display above the fieldset */\n label: React.ReactNode;\n helperText?: React.ReactNode;\n layout?: \"vertical\" | \"horizontal\";\n children: React.ReactNode;\n}\n\nexport interface TypeFieldsetChildContainerProps {\n layout: TypeFieldsetProps[\"layout\"];\n}\n\nexport interface TypeFieldsetLegendProps extends TypeTextProps {\n children: React.ReactNode;\n}\n\nexport interface TypeFieldsetHelperText extends TypeTextProps {\n children: React.ReactNode;\n}\n","import Fieldset from \"./Fieldset\";\n\nexport default Fieldset;\nexport { Fieldset };\nexport * from \"./FieldsetTypes\";\n"],"mappings":";AAKA,YAAYA,YAAW;AACvB,OAAOC,UAAS;AAChB,SAAS,sBAAsB;;;ACP/B,OAAO,UAAU,WAAW;AAE5B,OAAO,SAAS;AAET,IAAM,iBAAiB,OAAO,GAAG;AAAA,IACpC,CAAC,UACD,MAAM,WAAW,cACjB;AAAA,oBACgB,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,KAKrC;AAAA;AAAA,IAED,CAAC,UACD,MAAM,WAAW,gBACjB;AAAA,qBACiB,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,KAKtC;AAAA;;;ACvBL,OAAO,UAAU;AAkBf;AAJK,IAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC,IAAG;AAAA,IACH,UAAU;AAAA,IACV,YAAW;AAAA,IACX,OAAM;AAAA,IACN,IAAI;AAAA,IACH,GAAG;AAAA,IAEH;AAAA;AACH;AAGK,IAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA,GAAG;AACL,MACE,oBAAC,QA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AA;AAAA,EACF;AAEJ;AAEA,iBAAiB,cAAc;;;AHxDzB,SAEI,OAAAC,MAFJ,QAAAC,aAAA;AAVN,IAAM,iBAAiB,CAAC;AAAA,EACtB,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAyB;AACvB,MAAI,eAAe,IAAI,GAAG;AAExB,WACE,gBAAAA,MAACC,MAAA,EAAI,IAAG,YAAW,QAAO,QAAO,GAAG,GAAG,oBAAiB,IAAI,GAAG,MAC5D;AAAA,aAAO,UAAU,WAChB,gBAAAF,KAAC,kBAAgB,iBAAM,IAEvB;AAAA,MAED,OAAO,eAAe,WACrB,gBAAAA,KAAC,sBAAoB,sBAAW,IAEhC;AAAA,MAEF,gBAAAA;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,SAAQ;AAAA,UACR,eAAe,WAAW,aAAa,WAAW;AAAA,UAEjD,UAAM,gBAAS,IAAI,UAAU,CAAC,UAC7B,gBAAAF,KAAC,kBAAe,QAAiB,iBAAM,CACxC;AAAA;AAAA,MACH;AAAA,OACF;AAAA,EAEJ;AAGA,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,eAAe,cAAc;AAC7B,IAAO,yBAAQ;;;AIjDf,IAAM,WAAW,OAAO,OAAO,wBAAgB;AAAA,EAC7C,QAAQ;AAAA,EACR,YAAY;AACd,CAAC;AAED,IAAO,mBAAQ;;;ACff,OAAkB;;;ACClB,IAAO,gBAAQ;","names":["React","Box","jsx","jsx","jsxs","Box"]}
package/dist/index.js CHANGED
@@ -123,16 +123,22 @@ var FieldsetTailwind = ({
123
123
  children: [
124
124
  typeof label === "string" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("legend", { className: "seeds-fieldset-legend", children: label }) : label,
125
125
  typeof helperText === "string" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "seeds-fieldset-helper-text", children: helperText }) : helperText,
126
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn("seeds-fieldset-list", `seeds-fieldset-list-${layout}`), children: React.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
126
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
127
127
  "div",
128
128
  {
129
- className: cn(
130
- "seeds-fieldset-item",
131
- `seeds-fieldset-item-${layout}`
132
- ),
133
- children: child
129
+ className: cn("seeds-fieldset-list", `seeds-fieldset-list-${layout}`),
130
+ children: React.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
131
+ "div",
132
+ {
133
+ className: cn(
134
+ "seeds-fieldset-item",
135
+ `seeds-fieldset-item-${layout}`
136
+ ),
137
+ children: child
138
+ }
139
+ ))
134
140
  }
135
- )) })
141
+ )
136
142
  ]
137
143
  }
138
144
  );
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/FieldsetHybrid.tsx","../src/styles.ts","../src/FieldsetParts.tsx","../src/FieldsetTailwind.tsx","../src/Fieldset.tsx","../src/FieldsetTypes.ts"],"sourcesContent":["import Fieldset from \"./Fieldset\";\n\nexport default Fieldset;\nexport { Fieldset };\nexport * from \"./FieldsetTypes\";\n","/**\n * Hybrid Fieldset Component\n * Automatically chooses between Tailwind and styled-components based on props\n */\n\nimport * as React from \"react\";\nimport Box from \"@sproutsocial/seeds-react-box\";\nimport { hasStyledProps } from \"@sproutsocial/seeds-react-system-props\";\nimport { ChildContainer } from \"./styles\"; // Styled-components version\nimport { FieldsetLegend, FieldsetHelperText } from \"./FieldsetParts\";\nimport { FieldsetTailwind } from \"./FieldsetTailwind\"; // Tailwind version\nimport type { TypeFieldsetProps } from \"./FieldsetTypes\";\n\nconst FieldsetHybrid = ({\n layout = \"vertical\",\n label,\n helperText,\n children,\n ...rest\n}: TypeFieldsetProps) => {\n if (hasStyledProps(rest)) {\n // Legacy styled-components tree — identical to the pre-migration Fieldset body\n return (\n <Box as=\"fieldset\" border=\"none\" p={0} data-qa-fieldset=\"\" {...rest}>\n {typeof label === \"string\" ? (\n <FieldsetLegend>{label}</FieldsetLegend>\n ) : (\n label\n )}\n {typeof helperText === \"string\" ? (\n <FieldsetHelperText>{helperText}</FieldsetHelperText>\n ) : (\n helperText\n )}\n <Box\n display=\"flex\"\n flexDirection={layout === \"vertical\" ? \"column\" : \"row\"}\n >\n {React.Children.map(children, (child) => (\n <ChildContainer layout={layout}>{child}</ChildContainer>\n ))}\n </Box>\n </Box>\n );\n }\n\n // Use Tailwind version (preferred - better performance)\n return (\n <FieldsetTailwind\n layout={layout}\n label={label}\n helperText={helperText}\n {...rest}\n >\n {children}\n </FieldsetTailwind>\n );\n};\n\nFieldsetHybrid.displayName = \"Fieldset\";\nexport default FieldsetHybrid;\n","import styled, { css } from \"styled-components\";\nimport type { TypeFieldsetChildContainerProps } from \"./FieldsetTypes\";\nimport Box from \"@sproutsocial/seeds-react-box\";\n\nexport const ChildContainer = styled(Box)<TypeFieldsetChildContainerProps>`\n ${(props) =>\n props.layout === \"vertical\" &&\n css`\n margin-top: ${props.theme.space[300]};\n\n &:first-child {\n margin-top: 0;\n }\n `}\n\n ${(props) =>\n props.layout === \"horizontal\" &&\n css`\n margin-left: ${props.theme.space[300]};\n\n &:first-child {\n margin-left: 0;\n }\n `}\n`;\n","import Text from \"@sproutsocial/seeds-react-text\";\nimport type {\n TypeFieldsetLegendProps,\n TypeFieldsetHelperText,\n} from \"./FieldsetTypes\";\n\n/**\n * Text-based legend and helper-text parts for Fieldset.\n *\n * These remain styled-components (Text) because they are exposed as the public\n * Fieldset.Legend / Fieldset.HelperText statics and accept arbitrary\n * styled-system props. They are shared by both the styled-components branch of\n * FieldsetHybrid and the compound statics attached in Fieldset.tsx.\n */\nexport const FieldsetLegend = ({\n children,\n ...rest\n}: TypeFieldsetLegendProps) => (\n <Text\n as=\"legend\"\n fontSize={300}\n fontWeight=\"semibold\"\n color=\"text.body\"\n mb={300}\n {...rest}\n >\n {children}\n </Text>\n);\n\nexport const FieldsetHelperText = ({\n children,\n ...rest\n}: TypeFieldsetHelperText) => (\n <Text as=\"p\" fontSize={200} mb={300} {...rest}>\n {children}\n </Text>\n);\n\nFieldsetLegend.displayName = \"Fieldset.Legend\";\nFieldsetHelperText.displayName = \"Fieldset.HelperText\";\n","/**\n * Tailwind CSS implementation of Fieldset component\n * Uses Seeds fieldset CSS classes from fieldset.css\n */\n\nimport * as React from \"react\";\nimport type { TypeFieldsetProps } from \"./FieldsetTypes\";\n\n// Utility for merging class names properly\nfunction cn(\n ...inputs: (string | undefined | null | false | Record<string, boolean>)[]\n): string {\n const classes: string[] = [];\n\n for (const input of inputs) {\n if (!input) continue;\n\n if (typeof input === \"string\") {\n classes.push(input);\n } else if (typeof input === \"object\") {\n for (const [key, value] of Object.entries(input)) {\n if (value) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(\" \");\n}\n\nexport const FieldsetTailwind = ({\n layout = \"vertical\",\n label,\n helperText,\n children,\n className,\n ...rest\n}: TypeFieldsetProps) => {\n // Use a loosely-typed root so DOM attributes in `...rest` (e.g. aria-live) are\n // forwarded without TypeScript flagging styled-system props carried by\n // TypeBoxProps (e.g. `color`) that conflict with the intrinsic <fieldset> attrs.\n // Mirrors ButtonTailwind, which spreads `...rest` onto an `as any` element.\n const Root = \"fieldset\" as any;\n\n return (\n <Root\n className={cn(\"seeds-fieldset\", className)}\n data-qa-fieldset=\"\"\n {...rest}\n >\n {typeof label === \"string\" ? (\n <legend className=\"seeds-fieldset-legend\">{label}</legend>\n ) : (\n label\n )}\n {typeof helperText === \"string\" ? (\n <p className=\"seeds-fieldset-helper-text\">{helperText}</p>\n ) : (\n helperText\n )}\n <div className={cn(\"seeds-fieldset-list\", `seeds-fieldset-list-${layout}`)}>\n {React.Children.map(children, (child) => (\n <div\n className={cn(\n \"seeds-fieldset-item\",\n `seeds-fieldset-item-${layout}`\n )}\n >\n {child}\n </div>\n ))}\n </div>\n </Root>\n );\n};\n\nFieldsetTailwind.displayName = \"FieldsetTailwind\";\n","import FieldsetHybrid from \"./FieldsetHybrid\";\nimport { FieldsetLegend, FieldsetHelperText } from \"./FieldsetParts\";\n\n/**\n * Fieldset Component\n *\n * Thin assembly over the hybrid implementation: FieldsetHybrid routes to the\n * styled-components path when styled-system props are passed and to the Tailwind\n * path otherwise. The public Fieldset.Legend / Fieldset.HelperText statics remain\n * Text-based (see FieldsetParts) so they keep accepting styled-system props.\n */\nconst Fieldset = Object.assign(FieldsetHybrid, {\n Legend: FieldsetLegend,\n HelperText: FieldsetHelperText,\n});\n\nexport default Fieldset;\n","import type { TypeTextProps } from \"@sproutsocial/seeds-react-text\";\nimport React from \"react\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\n\nexport interface TypeFieldsetProps extends TypeBoxProps {\n /** Label text to display above the fieldset */\n label: React.ReactNode;\n helperText?: React.ReactNode;\n layout?: \"vertical\" | \"horizontal\";\n children: React.ReactNode;\n}\n\nexport interface TypeFieldsetChildContainerProps {\n layout: TypeFieldsetProps[\"layout\"];\n}\n\nexport interface TypeFieldsetLegendProps extends TypeTextProps {\n children: React.ReactNode;\n}\n\nexport interface TypeFieldsetHelperText extends TypeTextProps {\n children: React.ReactNode;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAAA,SAAuB;AACvB,IAAAC,0BAAgB;AAChB,sCAA+B;;;ACP/B,+BAA4B;AAE5B,6BAAgB;AAET,IAAM,qBAAiB,yBAAAC,SAAO,uBAAAC,OAAG;AAAA,IACpC,CAAC,UACD,MAAM,WAAW,cACjB;AAAA,oBACgB,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,KAKrC;AAAA;AAAA,IAED,CAAC,UACD,MAAM,WAAW,gBACjB;AAAA,qBAC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mBAAQ;;;ACff,mBAAkB;;;ANClB,IAAO,gBAAQ;","names":["React","import_seeds_react_box","styled","Box","Text","import_jsx_runtime","import_jsx_runtime","Box"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/FieldsetHybrid.tsx","../src/styles.ts","../src/FieldsetParts.tsx","../src/FieldsetTailwind.tsx","../src/Fieldset.tsx","../src/FieldsetTypes.ts"],"sourcesContent":["import Fieldset from \"./Fieldset\";\n\nexport default Fieldset;\nexport { Fieldset };\nexport * from \"./FieldsetTypes\";\n","/**\n * Hybrid Fieldset Component\n * Automatically chooses between Tailwind and styled-components based on props\n */\n\nimport * as React from \"react\";\nimport Box from \"@sproutsocial/seeds-react-box\";\nimport { hasStyledProps } from \"@sproutsocial/seeds-react-system-props\";\nimport { ChildContainer } from \"./styles\"; // Styled-components version\nimport { FieldsetLegend, FieldsetHelperText } from \"./FieldsetParts\";\nimport { FieldsetTailwind } from \"./FieldsetTailwind\"; // Tailwind version\nimport type { TypeFieldsetProps } from \"./FieldsetTypes\";\n\nconst FieldsetHybrid = ({\n layout = \"vertical\",\n label,\n helperText,\n children,\n ...rest\n}: TypeFieldsetProps) => {\n if (hasStyledProps(rest)) {\n // Legacy styled-components tree — identical to the pre-migration Fieldset body\n return (\n <Box as=\"fieldset\" border=\"none\" p={0} data-qa-fieldset=\"\" {...rest}>\n {typeof label === \"string\" ? (\n <FieldsetLegend>{label}</FieldsetLegend>\n ) : (\n label\n )}\n {typeof helperText === \"string\" ? (\n <FieldsetHelperText>{helperText}</FieldsetHelperText>\n ) : (\n helperText\n )}\n <Box\n display=\"flex\"\n flexDirection={layout === \"vertical\" ? \"column\" : \"row\"}\n >\n {React.Children.map(children, (child) => (\n <ChildContainer layout={layout}>{child}</ChildContainer>\n ))}\n </Box>\n </Box>\n );\n }\n\n // Use Tailwind version (preferred - better performance)\n return (\n <FieldsetTailwind\n layout={layout}\n label={label}\n helperText={helperText}\n {...rest}\n >\n {children}\n </FieldsetTailwind>\n );\n};\n\nFieldsetHybrid.displayName = \"Fieldset\";\nexport default FieldsetHybrid;\n","import styled, { css } from \"styled-components\";\nimport type { TypeFieldsetChildContainerProps } from \"./FieldsetTypes\";\nimport Box from \"@sproutsocial/seeds-react-box\";\n\nexport const ChildContainer = styled(Box)<TypeFieldsetChildContainerProps>`\n ${(props) =>\n props.layout === \"vertical\" &&\n css`\n margin-top: ${props.theme.space[300]};\n\n &:first-child {\n margin-top: 0;\n }\n `}\n\n ${(props) =>\n props.layout === \"horizontal\" &&\n css`\n margin-left: ${props.theme.space[300]};\n\n &:first-child {\n margin-left: 0;\n }\n `}\n`;\n","import Text from \"@sproutsocial/seeds-react-text\";\nimport type {\n TypeFieldsetLegendProps,\n TypeFieldsetHelperText,\n} from \"./FieldsetTypes\";\n\n/**\n * Text-based legend and helper-text parts for Fieldset.\n *\n * These remain styled-components (Text) because they are exposed as the public\n * Fieldset.Legend / Fieldset.HelperText statics and accept arbitrary\n * styled-system props. They are shared by both the styled-components branch of\n * FieldsetHybrid and the compound statics attached in Fieldset.tsx.\n */\nexport const FieldsetLegend = ({\n children,\n ...rest\n}: TypeFieldsetLegendProps) => (\n <Text\n as=\"legend\"\n fontSize={300}\n fontWeight=\"semibold\"\n color=\"text.body\"\n mb={300}\n {...rest}\n >\n {children}\n </Text>\n);\n\nexport const FieldsetHelperText = ({\n children,\n ...rest\n}: TypeFieldsetHelperText) => (\n <Text as=\"p\" fontSize={200} mb={300} {...rest}>\n {children}\n </Text>\n);\n\nFieldsetLegend.displayName = \"Fieldset.Legend\";\nFieldsetHelperText.displayName = \"Fieldset.HelperText\";\n","/**\n * Tailwind CSS implementation of Fieldset component\n * Uses Seeds fieldset CSS classes from fieldset.css\n */\n\nimport * as React from \"react\";\nimport type { TypeFieldsetProps } from \"./FieldsetTypes\";\n\n// Utility for merging class names properly\nfunction cn(\n ...inputs: (string | undefined | null | false | Record<string, boolean>)[]\n): string {\n const classes: string[] = [];\n\n for (const input of inputs) {\n if (!input) continue;\n\n if (typeof input === \"string\") {\n classes.push(input);\n } else if (typeof input === \"object\") {\n for (const [key, value] of Object.entries(input)) {\n if (value) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(\" \");\n}\n\nexport const FieldsetTailwind = ({\n layout = \"vertical\",\n label,\n helperText,\n children,\n className,\n ...rest\n}: TypeFieldsetProps) => {\n // Use a loosely-typed root so DOM attributes in `...rest` (e.g. aria-live) are\n // forwarded without TypeScript flagging styled-system props carried by\n // TypeBoxProps (e.g. `color`) that conflict with the intrinsic <fieldset> attrs.\n // Mirrors ButtonTailwind, which spreads `...rest` onto an `as any` element.\n const Root = \"fieldset\" as any;\n\n return (\n <Root\n className={cn(\"seeds-fieldset\", className)}\n data-qa-fieldset=\"\"\n {...rest}\n >\n {typeof label === \"string\" ? (\n <legend className=\"seeds-fieldset-legend\">{label}</legend>\n ) : (\n label\n )}\n {typeof helperText === \"string\" ? (\n <p className=\"seeds-fieldset-helper-text\">{helperText}</p>\n ) : (\n helperText\n )}\n <div\n className={cn(\"seeds-fieldset-list\", `seeds-fieldset-list-${layout}`)}\n >\n {React.Children.map(children, (child) => (\n <div\n className={cn(\n \"seeds-fieldset-item\",\n `seeds-fieldset-item-${layout}`\n )}\n >\n {child}\n </div>\n ))}\n </div>\n </Root>\n );\n};\n\nFieldsetTailwind.displayName = \"FieldsetTailwind\";\n","import FieldsetHybrid from \"./FieldsetHybrid\";\nimport { FieldsetLegend, FieldsetHelperText } from \"./FieldsetParts\";\n\n/**\n * Fieldset Component\n *\n * Thin assembly over the hybrid implementation: FieldsetHybrid routes to the\n * styled-components path when styled-system props are passed and to the Tailwind\n * path otherwise. The public Fieldset.Legend / Fieldset.HelperText statics remain\n * Text-based (see FieldsetParts) so they keep accepting styled-system props.\n */\nconst Fieldset = Object.assign(FieldsetHybrid, {\n Legend: FieldsetLegend,\n HelperText: FieldsetHelperText,\n});\n\nexport default Fieldset;\n","import type { TypeTextProps } from \"@sproutsocial/seeds-react-text\";\nimport React from \"react\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\n\nexport interface TypeFieldsetProps extends TypeBoxProps {\n /** Label text to display above the fieldset */\n label: React.ReactNode;\n helperText?: React.ReactNode;\n layout?: \"vertical\" | \"horizontal\";\n children: React.ReactNode;\n}\n\nexport interface TypeFieldsetChildContainerProps {\n layout: TypeFieldsetProps[\"layout\"];\n}\n\nexport interface TypeFieldsetLegendProps extends TypeTextProps {\n children: React.ReactNode;\n}\n\nexport interface TypeFieldsetHelperText extends TypeTextProps {\n children: React.ReactNode;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAAA,SAAuB;AACvB,IAAAC,0BAAgB;AAChB,sCAA+B;;;ACP/B,+BAA4B;AAE5B,6BAAgB;AAET,IAAM,qBAAiB,yBAAAC,SAAO,uBAAAC,OAAG;AAAA,IACpC,CAAC,UACD,MAAM,WAAW,cACjB;AAAA,oBACgB,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,KAKrC;AAAA;AAAA,IAED,CAAC,UACD,MAAM,WAAW,gBACjB;AAAA,qBACiB,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,KAKtC;AAAA;;;ACvBL,8BAAiB;AAkBf;AAJK,IAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC,wBAAAC;AAAA,EAAA;AAAA,IACC,IAAG;AAAA,IACH,UAAU;AAAA,IACV,YAAW;AAAA,IACX,OAAM;AAAA,IACN,IAAI;AAAA,IACH,GAAG;AAAA,IAEH;AAAA;AACH;AAGK,IAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA,GAAG;AACL,MACE,4CAAC,wBAAAA,SAAA,EAAK,IAAG,KAAI,UAAU,KAAK,IAAI,KAAM,GAAG,MACtC,UACH;AAGF,eAAe,cAAc;AAC7B,mBAA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,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAyB;AACvB,UAAI,gDAAe,IAAI,GAAG;AAExB,WACE,8CAAC,wBAAAC,SAAA,EAAI,IAAG,YAAW,QAAO,QAAO,GAAG,GAAG,oBAAiB,IAAI,GAAG,MAC5D;AAAA,aAAO,UAAU,WAChB,6CAAC,kBAAgB,iBAAM,IAEvB;AAAA,MAED,OAAO,eAAe,WACrB,6CAAC,sBAAoB,sBAAW,IAEhC;AAAA,MAEF;AAAA,QAAC,wBAAAA;AAAA,QAAA;AAAA,UACC,SAAQ;AAAA,UACR,eAAe,WAAW,aAAa,WAAW;AAAA,UAEjD,UAAM,gBAAS,IAAI,UAAU,CAAC,UAC7B,6CAAC,kBAAe,QAAiB,iBAAM,CACxC;AAAA;AAAA,MACH;AAAA,OACF;AAAA,EAEJ;AAGA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,eAAe,cAAc;AAC7B,IAAO,yBAAQ;;;AIjDf,IAAM,WAAW,OAAO,OAAO,wBAAgB;AAAA,EAC7C,QAAQ;AAAA,EACR,YAAY;AACd,CAAC;AAED,IAAO,mBAAQ;;;ACff,mBAAkB;;;ANClB,IAAO,gBAAQ;","names":["React","import_seeds_react_box","styled","Box","Text","import_jsx_runtime","import_jsx_runtime","Box"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/seeds-react-fieldset",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Seeds React Fieldset",
5
5
  "author": "Sprout Social, Inc.",
6
6
  "license": "MIT",
@@ -29,9 +29,9 @@
29
29
  "test:watch": "jest --watch --coverage=false"
30
30
  },
31
31
  "dependencies": {
32
- "@sproutsocial/seeds-react-theme": "^4.2.0",
32
+ "@sproutsocial/seeds-react-theme": "^4.2.1",
33
33
  "@sproutsocial/seeds-react-system-props": "^3.1.2",
34
- "@sproutsocial/seeds-react-box": "^1.1.24",
34
+ "@sproutsocial/seeds-react-box": "^1.1.25",
35
35
  "@sproutsocial/seeds-react-text": "^1.5.1"
36
36
  },
37
37
  "devDependencies": {
@@ -45,7 +45,7 @@
45
45
  "@sproutsocial/seeds-tsconfig": "*",
46
46
  "@sproutsocial/seeds-testing": "*",
47
47
  "@sproutsocial/seeds-react-testing-library": "*",
48
- "@sproutsocial/seeds-react-radio": "^1.3.27"
48
+ "@sproutsocial/seeds-react-radio": "^1.3.28"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "styled-components": "^5.2.3"