@sproutsocial/seeds-react-icon 2.4.0 → 2.4.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.
@@ -3,7 +3,11 @@ import * as React from "react";
3
3
 
4
4
  // src/v2/styles.ts
5
5
  import styled from "styled-components";
6
- import { COMMON, FLEXBOX, LAYOUT } from "@sproutsocial/seeds-react-system-props";
6
+ import {
7
+ COMMON,
8
+ FLEXBOX,
9
+ LAYOUT
10
+ } from "@sproutsocial/seeds-react-system-props";
7
11
  var dimensions = {
8
12
  default: { container: "24px", icon: "18px" },
9
13
  small: { container: "20px", icon: "15px" }
@@ -58,4 +62,4 @@ import "react";
58
62
  export {
59
63
  Icon_default
60
64
  };
61
- //# sourceMappingURL=chunk-G3D4UOOY.js.map
65
+ //# sourceMappingURL=chunk-JZFX5GTP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/v2/Icon.tsx","../../src/v2/styles.ts","../../src/v2/IconTypes.ts"],"sourcesContent":["import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeIconV2Props } from \"./IconTypes\";\n\n/**\n * **Icon (v2)** — a structural wrapper that centers a caller-supplied SVG inside a\n * fixed-size container, slightly larger than the icon to give it breathing room\n * (a buffer against focus rings, hover backgrounds, and button padding).\n *\n * The caller passes the SVG directly via `children` (or the `icon` alias). The SVG\n * should use `viewBox=\"0 0 24 24\"` and `currentColor` fills — the component controls\n * only the rendered width/height and centering, never the viewBox or path-level fills.\n *\n * Sizes:\n * - `default` — 24×24px container, icon renders at 18×18px\n * - `small` — 20×20px container, icon renders at 15×15px\n *\n * Accessibility: decorative by default (`aria-hidden`). Pass `aria-label` to expose a\n * standalone icon — the container then gets `role=\"img\"` and the label.\n *\n * @example\n * <Icon aria-label=\"Settings\"><MySvg /></Icon>\n */\nconst Icon = React.forwardRef<HTMLSpanElement, TypeIconV2Props>(\n (\n { size = \"default\", children, icon, \"aria-label\": ariaLabel, ...rest },\n ref\n ) => {\n const content = children ?? icon;\n const ariaProps = ariaLabel\n ? { role: \"img\" as const, \"aria-label\": ariaLabel }\n : { \"aria-hidden\": true };\n\n return (\n <Container\n ref={ref}\n iconSize={size}\n data-qa-icon-v2={size}\n {...ariaProps}\n {...rest}\n >\n {content}\n </Container>\n );\n }\n);\n\nIcon.displayName = \"IconV2\";\n\nexport default Icon;\n","import styled from \"styled-components\";\nimport {\n COMMON,\n FLEXBOX,\n LAYOUT,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeIconV2Size } from \"./IconTypes\";\n\nconst dimensions: {\n [key in TypeIconV2Size]: { container: string; icon: string };\n} = {\n default: { container: \"24px\", icon: \"18px\" },\n small: { container: \"20px\", icon: \"15px\" },\n};\n\n/**\n * Structural, non-semantic container that centers a caller-supplied SVG inside a\n * fixed-size box (slightly larger than the icon, for breathing room). The child\n * `svg` is sized via CSS to the icon dimensions and inherits color through\n * `currentColor` — no background or border.\n */\nconst Container = styled.span<{\n iconSize: TypeIconV2Size;\n}>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: inherit;\n width: ${(props) => dimensions[props.iconSize].container};\n height: ${(props) => dimensions[props.iconSize].container};\n\n & > svg {\n width: ${(props) => dimensions[props.iconSize].icon};\n height: ${(props) => dimensions[props.iconSize].icon};\n flex-shrink: 0;\n fill: currentColor;\n }\n\n ${COMMON}\n ${FLEXBOX}\n ${LAYOUT}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type {\n TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n} from \"@sproutsocial/seeds-react-system-props\";\n\nexport type TypeIconV2Size =\n | \"default\" // 24x24 container, 18x18 icon\n | \"small\"; // 20x20 container, 15x15 icon\n\nexport interface TypeIconV2Props\n extends TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\"> {\n /** Container/icon size variant. Defaults to `\"default\"` (24px container, 18px icon). */\n size?: TypeIconV2Size;\n /** The SVG element to render inside the container. Should use `viewBox=\"0 0 24 24\"` and `currentColor` fills. */\n children?: React.ReactNode;\n /** Alias for `children`. When both are provided, `children` wins. */\n icon?: React.ReactNode;\n /** When provided, the container gets `role=\"img\"` and this label, making a standalone icon accessible. Omit for decorative icons (the container is `aria-hidden` automatically). */\n \"aria-label\"?: string;\n}\n"],"mappings":";AAAA,YAAY,WAAW;;;ACAvB,OAAO,YAAY;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,aAEF;AAAA,EACF,SAAS,EAAE,WAAW,QAAQ,MAAM,OAAO;AAAA,EAC3C,OAAO,EAAE,WAAW,QAAQ,MAAM,OAAO;AAC3C;AAQA,IAAM,YAAY,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAQd,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,SAAS;AAAA,YAC9C,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,SAAS;AAAA;AAAA;AAAA,aAG9C,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,IAAI;AAAA,cACzC,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpD,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA;AAGV,IAAO,iBAAQ;;;ADVT;AAXN,IAAM,OAAa;AAAA,EACjB,CACE,EAAE,OAAO,WAAW,UAAU,MAAM,cAAc,WAAW,GAAG,KAAK,GACrE,QACG;AACH,UAAM,UAAU,YAAY;AAC5B,UAAM,YAAY,YACd,EAAE,MAAM,OAAgB,cAAc,UAAU,IAChD,EAAE,eAAe,KAAK;AAE1B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,UAAU;AAAA,QACV,mBAAiB;AAAA,QAChB,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,KAAK,cAAc;AAEnB,IAAO,eAAQ;;;AEjDf,OAAuB;","names":[]}
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Icon_default
3
- } from "./chunk-G3D4UOOY.js";
3
+ } from "./chunk-JZFX5GTP.js";
4
4
 
5
5
  // src/Icon.tsx
6
6
  import "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Icon_default
3
- } from "../chunk-G3D4UOOY.js";
3
+ } from "../chunk-JZFX5GTP.js";
4
4
  export {
5
5
  Icon_default as Icon,
6
6
  Icon_default as default
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/Icon.tsx","../src/styles.ts","../src/IconTypes.ts","../src/v2/Icon.tsx","../src/v2/styles.ts","../src/v2/IconTypes.ts"],"sourcesContent":["import Icon from \"./Icon\";\n\nexport default Icon;\nexport { Icon };\nexport { default as IconContainer } from \"./styles\";\nexport * from \"./IconTypes\";\n\n// Icon v2 exports (structural SVG wrapper; distinct API from v1)\nexport { default as IconV2 } from \"./v2\";\nexport type { TypeIconV2Props, TypeIconV2Size } from \"./v2\";\n","import * as React from \"react\";\nimport styled, { css } from \"styled-components\";\nimport Box from \"@sproutsocial/seeds-react-box\";\nimport PartnerLogo from \"@sproutsocial/seeds-react-partner-logo\";\nimport { includes } from \"@sproutsocial/seeds-react-utilities\";\nimport { LogoNamesWithoutVariants as PartnerLogoNames } from \"@sproutsocial/seeds-partner-logos\";\n\nimport type { TypeIconProps, TypeToggleProps } from \"./IconTypes\";\nimport Container from \"./styles\";\nimport {\n AiViewBoxes,\n ExternalViewBoxes,\n GeneralViewBoxes,\n SproutViewBoxes,\n ExternalIconNames,\n type EnumIconSvgNames,\n type EnumIconNamesWithoutVariants,\n} from \"@sproutsocial/seeds-icons\";\n\nconst AllViewboxes = {\n ...AiViewBoxes,\n ...ExternalViewBoxes,\n ...GeneralViewBoxes,\n ...SproutViewBoxes,\n};\n\nconst Icon = ({\n name,\n size = \"small\",\n fixedWidth = false,\n ariaLabel,\n color,\n svgProps,\n ...rest\n}: TypeIconProps) => {\n if (includes(PartnerLogoNames, name)) {\n // Icon's \"default\" size is equivalent to PartnerLogo's \"small\" size\n const logoSize = size === \"default\" ? \"small\" : size;\n const logoProps = {\n partnerName: name,\n size: logoSize,\n logoType: \"symbol\" as const,\n svgProps,\n };\n return (\n <PartnerLogo\n // ariaLabel needs to be overridable by aria-label prop in ...rest\n aria-label={ariaLabel}\n {...rest}\n {...logoProps}\n />\n );\n }\n\n const defaultVariant = size === \"mini\" ? \"solid\" : \"outline\";\n\n const iconName: EnumIconSvgNames =\n // if not external and has no variant\n !name?.endsWith(\"-outline\") &&\n !name?.endsWith(\"-solid\") &&\n !includes(ExternalIconNames, name)\n ? // then add default variant\n `${name as EnumIconNamesWithoutVariants}-${defaultVariant}`\n : // else use name as is\n (name as EnumIconSvgNames);\n\n const iconViewBox = AllViewboxes[iconName];\n\n const { \"aria-label\": ariaLabelFromRest, ...restWithoutAriaLabel } = rest;\n const hasAriaLabel = !!ariaLabel || !!ariaLabelFromRest;\n const containerAriaProps = hasAriaLabel ? {} : { \"aria-hidden\": \"true\" };\n const svgAriaProps = hasAriaLabel\n ? { role: \"img\", \"aria-label\": ariaLabel ?? ariaLabelFromRest }\n : {};\n\n return (\n <Container\n iconSize={size}\n fixedWidth={!!fixedWidth}\n key={iconName}\n data-qa-icon={iconName}\n color={color}\n {...restWithoutAriaLabel}\n {...containerAriaProps}\n >\n <svg\n className=\"Icon-svg\"\n viewBox={iconViewBox}\n focusable={false}\n data-qa-icon-svg={`${iconName}-svg`}\n {...svgProps}\n {...svgAriaProps}\n >\n <use\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n xlinkHref={`#seeds-svgs_${iconName}`}\n />\n </svg>\n </Container>\n );\n};\n\nconst ToggleableIcon = styled(Icon)<{ active: boolean }>`\n transition: all ${(p) => p.theme.duration.fast} linear;\n\n ${(p) =>\n p.active &&\n css`\n opacity: 1;\n transform: scale(1);\n `}\n\n ${(p) =>\n !p.active &&\n css`\n position: absolute;\n opacity: 0;\n transform: scale(0);\n `}\n`;\n\nconst IconToggle = ({\n activeName,\n inactiveName,\n isActive,\n size = \"small\",\n fixedWidth = false,\n ariaLabel,\n ...rest\n}: TypeToggleProps) => {\n return (\n <Box as=\"span\" position=\"relative\" display=\"inline-flex\" {...rest}>\n <ToggleableIcon\n active={isActive}\n name={activeName}\n size={size}\n fixedWidth={fixedWidth}\n aria-hidden={!isActive}\n aria-label={!isActive ? undefined : ariaLabel}\n />\n <ToggleableIcon\n active={!isActive}\n name={inactiveName}\n size={size}\n fixedWidth={fixedWidth}\n aria-hidden={isActive}\n aria-label={isActive ? ariaLabel : undefined}\n />\n </Box>\n );\n};\n\nIconToggle.displayName = \"Icon.Toggle\";\n/**\n * **Accessibility note:** It is best practice to wrap `<Icon.Toggle />` in a button. The button must include `aria-label` and `aria-pressed` in order for a screen reader to properly communicate the icon's state. See example below.\n *\n * @link https://www.w3.org/TR/wai-aria-practices-1.1/#button\n * @example\n * const [toggleState, setToggleState] = useState(false);\n * <Button // Wrap Icon.Toggle with Button\n * appearance='pill'\n * aria-label='like' // required for accessibility\n * aria-pressed={toggleState} // required for accessibility\n * onClick={() => setToggleState(!toggleState)}\n * >\n * <Icon.Toggle\n * activeName=\"heart-solid\"\n * inactiveName=\"heart-outline\"\n * isActive={toggleState}\n * />\n * </Button>\n */\nIcon.Toggle = IconToggle;\n\nexport default Icon;\n","import styled, { css } from \"styled-components\";\nimport { verticalAlign } from \"styled-system\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeIconSize } from \"./IconTypes\";\n\nconst sizes: { [key in TypeIconSize]: string } = {\n mini: \"12px\",\n\n /** TODO: deprecate default in favor of small in future release */\n default: \"16px\",\n small: \"16px\",\n medium: \"24px\",\n large: \"32px\",\n jumbo: \"64px\",\n};\n\nconst stylesForSize = (iconActualSize: string, fixedWidth: boolean) => css`\n line-height: ${iconActualSize};\n\n &,\n .Icon-svg {\n height: ${iconActualSize};\n fill: currentColor;\n }\n\n ${fixedWidth &&\n `\n &,\n & .Icon-svg {\n width: ${iconActualSize}\n }\n `}\n`;\n\nconst Container = styled.span.attrs({\n className: \"Icon\",\n})<{\n iconSize: TypeIconSize;\n fixedWidth: boolean;\n}>`\n display: inline-block;\n color: inherit;\n vertical-align: middle;\n\n ${(props) => stylesForSize(sizes[props.iconSize], props.fixedWidth)}\n\n ${COMMON}\n ${verticalAlign}\n`;\nexport default Container;\n","import * as React from \"react\";\nimport type { EnumIconNames } from \"@sproutsocial/seeds-icons\";\nimport type { EnumLogoNamesWithoutVariants } from \"@sproutsocial/seeds-partner-logos\";\nimport type {\n TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\n\nexport type TypeIconName = EnumIconNames | EnumLogoNamesWithoutVariants;\n\nexport type TypeIconSize =\n | \"mini\" // 12x12\n // TODO: deprecate default in favor of small in future release\n | \"default\" // 16x16\n | \"small\" // 16x16\n | \"medium\" // 24x24\n | \"large\" // 32x32\n | \"jumbo\"; // 64x64\n\nexport interface TypeIconProps\n extends TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\"> {\n /** Name of the icon in the svg sprite */\n name: TypeIconName;\n size?: TypeIconSize;\n /** Whether the icon should have a fixed width or not. Use this when you need to align icons/text vertically in a list. */\n fixedWidth?: boolean;\n /** Label used to describe the icon if not used with an accompanying visual label */\n ariaLabel?: string;\n svgProps?: React.ComponentPropsWithoutRef<\"svg\">;\n}\n\nexport interface TypeToggleProps extends TypeBoxProps {\n /** Name of the icon to be shown in the active state */\n activeName: TypeIconName;\n /** Name of the icon to be shown in the inactive state */\n inactiveName: TypeIconName;\n /** Whether the active icon should be shown or not */\n isActive: boolean;\n /** The size of the icon. `small` is the default */\n size?: TypeIconSize;\n fixedWidth?: boolean;\n ariaLabel?: string;\n}\n","import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeIconV2Props } from \"./IconTypes\";\n\n/**\n * **Icon (v2)** — a structural wrapper that centers a caller-supplied SVG inside a\n * fixed-size container, slightly larger than the icon to give it breathing room\n * (a buffer against focus rings, hover backgrounds, and button padding).\n *\n * The caller passes the SVG directly via `children` (or the `icon` alias). The SVG\n * should use `viewBox=\"0 0 24 24\"` and `currentColor` fills — the component controls\n * only the rendered width/height and centering, never the viewBox or path-level fills.\n *\n * Sizes:\n * - `default` — 24×24px container, icon renders at 18×18px\n * - `small` — 20×20px container, icon renders at 15×15px\n *\n * Accessibility: decorative by default (`aria-hidden`). Pass `aria-label` to expose a\n * standalone icon — the container then gets `role=\"img\"` and the label.\n *\n * @example\n * <Icon aria-label=\"Settings\"><MySvg /></Icon>\n */\nconst Icon = React.forwardRef<HTMLSpanElement, TypeIconV2Props>(\n ({ size = \"default\", children, icon, \"aria-label\": ariaLabel, ...rest }, ref) => {\n const content = children ?? icon;\n const ariaProps = ariaLabel\n ? { role: \"img\" as const, \"aria-label\": ariaLabel }\n : { \"aria-hidden\": true };\n\n return (\n <Container\n ref={ref}\n iconSize={size}\n data-qa-icon-v2={size}\n {...ariaProps}\n {...rest}\n >\n {content}\n </Container>\n );\n }\n);\n\nIcon.displayName = \"IconV2\";\n\nexport default Icon;\n","import styled from \"styled-components\";\nimport { COMMON, FLEXBOX, LAYOUT } from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeIconV2Size } from \"./IconTypes\";\n\nconst dimensions: { [key in TypeIconV2Size]: { container: string; icon: string } } = {\n default: { container: \"24px\", icon: \"18px\" },\n small: { container: \"20px\", icon: \"15px\" },\n};\n\n/**\n * Structural, non-semantic container that centers a caller-supplied SVG inside a\n * fixed-size box (slightly larger than the icon, for breathing room). The child\n * `svg` is sized via CSS to the icon dimensions and inherits color through\n * `currentColor` — no background or border.\n */\nconst Container = styled.span<{\n iconSize: TypeIconV2Size;\n}>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: inherit;\n width: ${(props) => dimensions[props.iconSize].container};\n height: ${(props) => dimensions[props.iconSize].container};\n\n & > svg {\n width: ${(props) => dimensions[props.iconSize].icon};\n height: ${(props) => dimensions[props.iconSize].icon};\n flex-shrink: 0;\n fill: currentColor;\n }\n\n ${COMMON}\n ${FLEXBOX}\n ${LAYOUT}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type {\n TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n} from \"@sproutsocial/seeds-react-system-props\";\n\nexport type TypeIconV2Size =\n | \"default\" // 24x24 container, 18x18 icon\n | \"small\"; // 20x20 container, 15x15 icon\n\nexport interface TypeIconV2Props\n extends TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\"> {\n /** Container/icon size variant. Defaults to `\"default\"` (24px container, 18px icon). */\n size?: TypeIconV2Size;\n /** The SVG element to render inside the container. Should use `viewBox=\"0 0 24 24\"` and `currentColor` fills. */\n children?: React.ReactNode;\n /** Alias for `children`. When both are provided, `children` wins. */\n icon?: React.ReactNode;\n /** When provided, the container gets `role=\"img\"` and this label, making a standalone icon accessible. Omit for decorative icons (the container is `aria-hidden` automatically). */\n \"aria-label\"?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,IAAAC,4BAA4B;AAC5B,6BAAgB;AAChB,sCAAwB;AACxB,mCAAyB;AACzB,iCAA6D;;;ACL7D,+BAA4B;AAC5B,2BAA8B;AAC9B,sCAAuB;AAGvB,IAAM,QAA2C;AAAA,EAC/C,MAAM;AAAA;AAAA,EAGN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AACT;AAEA,IAAM,gBAAgB,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B;AAAA,QAChB,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEAD,MAAK,cAAc;AAEnB,IAAOE,gBAAQF;;;AE9Cf,IAAAG,SAAuB;;;ANEvB,IAAO,cAAQ;","names":["Icon_default","import_styled_components","styled","PartnerLogoNames","PartnerLogo","styled","Box","React","React","import_styled_components","import_seeds_react_system_props","Container","styled","styles_default","import_jsx_runtime","Icon","styles_default","Icon_default","React"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/Icon.tsx","../src/styles.ts","../src/IconTypes.ts","../src/v2/Icon.tsx","../src/v2/styles.ts","../src/v2/IconTypes.ts"],"sourcesContent":["import Icon from \"./Icon\";\n\nexport default Icon;\nexport { Icon };\nexport { default as IconContainer } from \"./styles\";\nexport * from \"./IconTypes\";\n\n// Icon v2 exports (structural SVG wrapper; distinct API from v1)\nexport { default as IconV2 } from \"./v2\";\nexport type { TypeIconV2Props, TypeIconV2Size } from \"./v2\";\n","import * as React from \"react\";\nimport styled, { css } from \"styled-components\";\nimport Box from \"@sproutsocial/seeds-react-box\";\nimport PartnerLogo from \"@sproutsocial/seeds-react-partner-logo\";\nimport { includes } from \"@sproutsocial/seeds-react-utilities\";\nimport { LogoNamesWithoutVariants as PartnerLogoNames } from \"@sproutsocial/seeds-partner-logos\";\n\nimport type { TypeIconProps, TypeToggleProps } from \"./IconTypes\";\nimport Container from \"./styles\";\nimport {\n AiViewBoxes,\n ExternalViewBoxes,\n GeneralViewBoxes,\n SproutViewBoxes,\n ExternalIconNames,\n type EnumIconSvgNames,\n type EnumIconNamesWithoutVariants,\n} from \"@sproutsocial/seeds-icons\";\n\nconst AllViewboxes = {\n ...AiViewBoxes,\n ...ExternalViewBoxes,\n ...GeneralViewBoxes,\n ...SproutViewBoxes,\n};\n\nconst Icon = ({\n name,\n size = \"small\",\n fixedWidth = false,\n ariaLabel,\n color,\n svgProps,\n ...rest\n}: TypeIconProps) => {\n if (includes(PartnerLogoNames, name)) {\n // Icon's \"default\" size is equivalent to PartnerLogo's \"small\" size\n const logoSize = size === \"default\" ? \"small\" : size;\n const logoProps = {\n partnerName: name,\n size: logoSize,\n logoType: \"symbol\" as const,\n svgProps,\n };\n return (\n <PartnerLogo\n // ariaLabel needs to be overridable by aria-label prop in ...rest\n aria-label={ariaLabel}\n {...rest}\n {...logoProps}\n />\n );\n }\n\n const defaultVariant = size === \"mini\" ? \"solid\" : \"outline\";\n\n const iconName: EnumIconSvgNames =\n // if not external and has no variant\n !name?.endsWith(\"-outline\") &&\n !name?.endsWith(\"-solid\") &&\n !includes(ExternalIconNames, name)\n ? // then add default variant\n `${name as EnumIconNamesWithoutVariants}-${defaultVariant}`\n : // else use name as is\n (name as EnumIconSvgNames);\n\n const iconViewBox = AllViewboxes[iconName];\n\n const { \"aria-label\": ariaLabelFromRest, ...restWithoutAriaLabel } = rest;\n const hasAriaLabel = !!ariaLabel || !!ariaLabelFromRest;\n const containerAriaProps = hasAriaLabel ? {} : { \"aria-hidden\": \"true\" };\n const svgAriaProps = hasAriaLabel\n ? { role: \"img\", \"aria-label\": ariaLabel ?? ariaLabelFromRest }\n : {};\n\n return (\n <Container\n iconSize={size}\n fixedWidth={!!fixedWidth}\n key={iconName}\n data-qa-icon={iconName}\n color={color}\n {...restWithoutAriaLabel}\n {...containerAriaProps}\n >\n <svg\n className=\"Icon-svg\"\n viewBox={iconViewBox}\n focusable={false}\n data-qa-icon-svg={`${iconName}-svg`}\n {...svgProps}\n {...svgAriaProps}\n >\n <use\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n xlinkHref={`#seeds-svgs_${iconName}`}\n />\n </svg>\n </Container>\n );\n};\n\nconst ToggleableIcon = styled(Icon)<{ active: boolean }>`\n transition: all ${(p) => p.theme.duration.fast} linear;\n\n ${(p) =>\n p.active &&\n css`\n opacity: 1;\n transform: scale(1);\n `}\n\n ${(p) =>\n !p.active &&\n css`\n position: absolute;\n opacity: 0;\n transform: scale(0);\n `}\n`;\n\nconst IconToggle = ({\n activeName,\n inactiveName,\n isActive,\n size = \"small\",\n fixedWidth = false,\n ariaLabel,\n ...rest\n}: TypeToggleProps) => {\n return (\n <Box as=\"span\" position=\"relative\" display=\"inline-flex\" {...rest}>\n <ToggleableIcon\n active={isActive}\n name={activeName}\n size={size}\n fixedWidth={fixedWidth}\n aria-hidden={!isActive}\n aria-label={!isActive ? undefined : ariaLabel}\n />\n <ToggleableIcon\n active={!isActive}\n name={inactiveName}\n size={size}\n fixedWidth={fixedWidth}\n aria-hidden={isActive}\n aria-label={isActive ? ariaLabel : undefined}\n />\n </Box>\n );\n};\n\nIconToggle.displayName = \"Icon.Toggle\";\n/**\n * **Accessibility note:** It is best practice to wrap `<Icon.Toggle />` in a button. The button must include `aria-label` and `aria-pressed` in order for a screen reader to properly communicate the icon's state. See example below.\n *\n * @link https://www.w3.org/TR/wai-aria-practices-1.1/#button\n * @example\n * const [toggleState, setToggleState] = useState(false);\n * <Button // Wrap Icon.Toggle with Button\n * appearance='pill'\n * aria-label='like' // required for accessibility\n * aria-pressed={toggleState} // required for accessibility\n * onClick={() => setToggleState(!toggleState)}\n * >\n * <Icon.Toggle\n * activeName=\"heart-solid\"\n * inactiveName=\"heart-outline\"\n * isActive={toggleState}\n * />\n * </Button>\n */\nIcon.Toggle = IconToggle;\n\nexport default Icon;\n","import styled, { css } from \"styled-components\";\nimport { verticalAlign } from \"styled-system\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeIconSize } from \"./IconTypes\";\n\nconst sizes: { [key in TypeIconSize]: string } = {\n mini: \"12px\",\n\n /** TODO: deprecate default in favor of small in future release */\n default: \"16px\",\n small: \"16px\",\n medium: \"24px\",\n large: \"32px\",\n jumbo: \"64px\",\n};\n\nconst stylesForSize = (iconActualSize: string, fixedWidth: boolean) => css`\n line-height: ${iconActualSize};\n\n &,\n .Icon-svg {\n height: ${iconActualSize};\n fill: currentColor;\n }\n\n ${fixedWidth &&\n `\n &,\n & .Icon-svg {\n width: ${iconActualSize}\n }\n `}\n`;\n\nconst Container = styled.span.attrs({\n className: \"Icon\",\n})<{\n iconSize: TypeIconSize;\n fixedWidth: boolean;\n}>`\n display: inline-block;\n color: inherit;\n vertical-align: middle;\n\n ${(props) => stylesForSize(sizes[props.iconSize], props.fixedWidth)}\n\n ${COMMON}\n ${verticalAlign}\n`;\nexport default Container;\n","import * as React from \"react\";\nimport type { EnumIconNames } from \"@sproutsocial/seeds-icons\";\nimport type { EnumLogoNamesWithoutVariants } from \"@sproutsocial/seeds-partner-logos\";\nimport type {\n TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\n\nexport type TypeIconName = EnumIconNames | EnumLogoNamesWithoutVariants;\n\nexport type TypeIconSize =\n | \"mini\" // 12x12\n // TODO: deprecate default in favor of small in future release\n | \"default\" // 16x16\n | \"small\" // 16x16\n | \"medium\" // 24x24\n | \"large\" // 32x32\n | \"jumbo\"; // 64x64\n\nexport interface TypeIconProps\n extends TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\"> {\n /** Name of the icon in the svg sprite */\n name: TypeIconName;\n size?: TypeIconSize;\n /** Whether the icon should have a fixed width or not. Use this when you need to align icons/text vertically in a list. */\n fixedWidth?: boolean;\n /** Label used to describe the icon if not used with an accompanying visual label */\n ariaLabel?: string;\n svgProps?: React.ComponentPropsWithoutRef<\"svg\">;\n}\n\nexport interface TypeToggleProps extends TypeBoxProps {\n /** Name of the icon to be shown in the active state */\n activeName: TypeIconName;\n /** Name of the icon to be shown in the inactive state */\n inactiveName: TypeIconName;\n /** Whether the active icon should be shown or not */\n isActive: boolean;\n /** The size of the icon. `small` is the default */\n size?: TypeIconSize;\n fixedWidth?: boolean;\n ariaLabel?: string;\n}\n","import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeIconV2Props } from \"./IconTypes\";\n\n/**\n * **Icon (v2)** — a structural wrapper that centers a caller-supplied SVG inside a\n * fixed-size container, slightly larger than the icon to give it breathing room\n * (a buffer against focus rings, hover backgrounds, and button padding).\n *\n * The caller passes the SVG directly via `children` (or the `icon` alias). The SVG\n * should use `viewBox=\"0 0 24 24\"` and `currentColor` fills — the component controls\n * only the rendered width/height and centering, never the viewBox or path-level fills.\n *\n * Sizes:\n * - `default` — 24×24px container, icon renders at 18×18px\n * - `small` — 20×20px container, icon renders at 15×15px\n *\n * Accessibility: decorative by default (`aria-hidden`). Pass `aria-label` to expose a\n * standalone icon — the container then gets `role=\"img\"` and the label.\n *\n * @example\n * <Icon aria-label=\"Settings\"><MySvg /></Icon>\n */\nconst Icon = React.forwardRef<HTMLSpanElement, TypeIconV2Props>(\n (\n { size = \"default\", children, icon, \"aria-label\": ariaLabel, ...rest },\n ref\n ) => {\n const content = children ?? icon;\n const ariaProps = ariaLabel\n ? { role: \"img\" as const, \"aria-label\": ariaLabel }\n : { \"aria-hidden\": true };\n\n return (\n <Container\n ref={ref}\n iconSize={size}\n data-qa-icon-v2={size}\n {...ariaProps}\n {...rest}\n >\n {content}\n </Container>\n );\n }\n);\n\nIcon.displayName = \"IconV2\";\n\nexport default Icon;\n","import styled from \"styled-components\";\nimport {\n COMMON,\n FLEXBOX,\n LAYOUT,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeIconV2Size } from \"./IconTypes\";\n\nconst dimensions: {\n [key in TypeIconV2Size]: { container: string; icon: string };\n} = {\n default: { container: \"24px\", icon: \"18px\" },\n small: { container: \"20px\", icon: \"15px\" },\n};\n\n/**\n * Structural, non-semantic container that centers a caller-supplied SVG inside a\n * fixed-size box (slightly larger than the icon, for breathing room). The child\n * `svg` is sized via CSS to the icon dimensions and inherits color through\n * `currentColor` — no background or border.\n */\nconst Container = styled.span<{\n iconSize: TypeIconV2Size;\n}>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: inherit;\n width: ${(props) => dimensions[props.iconSize].container};\n height: ${(props) => dimensions[props.iconSize].container};\n\n & > svg {\n width: ${(props) => dimensions[props.iconSize].icon};\n height: ${(props) => dimensions[props.iconSize].icon};\n flex-shrink: 0;\n fill: currentColor;\n }\n\n ${COMMON}\n ${FLEXBOX}\n ${LAYOUT}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type {\n TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n} from \"@sproutsocial/seeds-react-system-props\";\n\nexport type TypeIconV2Size =\n | \"default\" // 24x24 container, 18x18 icon\n | \"small\"; // 20x20 container, 15x15 icon\n\nexport interface TypeIconV2Props\n extends TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\"> {\n /** Container/icon size variant. Defaults to `\"default\"` (24px container, 18px icon). */\n size?: TypeIconV2Size;\n /** The SVG element to render inside the container. Should use `viewBox=\"0 0 24 24\"` and `currentColor` fills. */\n children?: React.ReactNode;\n /** Alias for `children`. When both are provided, `children` wins. */\n icon?: React.ReactNode;\n /** When provided, the container gets `role=\"img\"` and this label, making a standalone icon accessible. Omit for decorative icons (the container is `aria-hidden` automatically). */\n \"aria-label\"?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,IAAAC,4BAA4B;AAC5B,6BAAgB;AAChB,sCAAwB;AACxB,mCAAyB;AACzB,iCAA6D;;;ACL7D,+BAA4B;AAC5B,2BAA8B;AAC9B,sCAAuB;AAGvB,IAAM,QAA2C;AAAA,EAC/C,MAAM;AAAA;AAAA,EAGN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AACT;AAEA,IAAM,gBAAgB,CAAC,gBAAwB,eAAwB;AAAA,iBACtD,cAAc;AAAA;AAA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,IACH;AAAA,EAEJ;AACF;AAEAD,MAAK,cAAc;AAEnB,IAAOE,gBAAQF;;;AEjDf,IAAAG,SAAuB;;;ANEvB,IAAO,cAAQ;","names":["Icon_default","import_styled_components","styled","PartnerLogoNames","PartnerLogo","styled","Box","React","React","import_styled_components","import_seeds_react_system_props","Container","styled","styles_default","import_jsx_runtime","Icon","styles_default","Icon_default","React"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/v2/index.ts","../../src/v2/Icon.tsx","../../src/v2/styles.ts","../../src/v2/IconTypes.ts"],"sourcesContent":["// Icon v2 - Explicit named + default exports for optimal tree shaking\nexport { default, default as Icon } from \"./Icon\";\nexport * from \"./IconTypes\";\n","import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeIconV2Props } from \"./IconTypes\";\n\n/**\n * **Icon (v2)** — a structural wrapper that centers a caller-supplied SVG inside a\n * fixed-size container, slightly larger than the icon to give it breathing room\n * (a buffer against focus rings, hover backgrounds, and button padding).\n *\n * The caller passes the SVG directly via `children` (or the `icon` alias). The SVG\n * should use `viewBox=\"0 0 24 24\"` and `currentColor` fills — the component controls\n * only the rendered width/height and centering, never the viewBox or path-level fills.\n *\n * Sizes:\n * - `default` — 24×24px container, icon renders at 18×18px\n * - `small` — 20×20px container, icon renders at 15×15px\n *\n * Accessibility: decorative by default (`aria-hidden`). Pass `aria-label` to expose a\n * standalone icon — the container then gets `role=\"img\"` and the label.\n *\n * @example\n * <Icon aria-label=\"Settings\"><MySvg /></Icon>\n */\nconst Icon = React.forwardRef<HTMLSpanElement, TypeIconV2Props>(\n ({ size = \"default\", children, icon, \"aria-label\": ariaLabel, ...rest }, ref) => {\n const content = children ?? icon;\n const ariaProps = ariaLabel\n ? { role: \"img\" as const, \"aria-label\": ariaLabel }\n : { \"aria-hidden\": true };\n\n return (\n <Container\n ref={ref}\n iconSize={size}\n data-qa-icon-v2={size}\n {...ariaProps}\n {...rest}\n >\n {content}\n </Container>\n );\n }\n);\n\nIcon.displayName = \"IconV2\";\n\nexport default Icon;\n","import styled from \"styled-components\";\nimport { COMMON, FLEXBOX, LAYOUT } from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeIconV2Size } from \"./IconTypes\";\n\nconst dimensions: { [key in TypeIconV2Size]: { container: string; icon: string } } = {\n default: { container: \"24px\", icon: \"18px\" },\n small: { container: \"20px\", icon: \"15px\" },\n};\n\n/**\n * Structural, non-semantic container that centers a caller-supplied SVG inside a\n * fixed-size box (slightly larger than the icon, for breathing room). The child\n * `svg` is sized via CSS to the icon dimensions and inherits color through\n * `currentColor` — no background or border.\n */\nconst Container = styled.span<{\n iconSize: TypeIconV2Size;\n}>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: inherit;\n width: ${(props) => dimensions[props.iconSize].container};\n height: ${(props) => dimensions[props.iconSize].container};\n\n & > svg {\n width: ${(props) => dimensions[props.iconSize].icon};\n height: ${(props) => dimensions[props.iconSize].icon};\n flex-shrink: 0;\n fill: currentColor;\n }\n\n ${COMMON}\n ${FLEXBOX}\n ${LAYOUT}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type {\n TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n} from \"@sproutsocial/seeds-react-system-props\";\n\nexport type TypeIconV2Size =\n | \"default\" // 24x24 container, 18x18 icon\n | \"small\"; // 20x20 container, 15x15 icon\n\nexport interface TypeIconV2Props\n extends TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\"> {\n /** Container/icon size variant. Defaults to `\"default\"` (24px container, 18px icon). */\n size?: TypeIconV2Size;\n /** The SVG element to render inside the container. Should use `viewBox=\"0 0 24 24\"` and `currentColor` fills. */\n children?: React.ReactNode;\n /** Alias for `children`. When both are provided, `children` wins. */\n icon?: React.ReactNode;\n /** When provided, the container gets `role=\"img\"` and this label, making a standalone icon accessible. Omit for decorative icons (the container is `aria-hidden` automatically). */\n \"aria-label\"?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACAvB,+BAAmB;AACnB,sCAAwC;AAGxC,IAAM,aAA+E;AAAA,EACnF,SAAS,EAAE,WAAW,QAAQ,MAAM,OAAO;AAAA,EAC3C,OAAO,EAAE,WAAW,QAAQ,MAAM,OAAO;AAC3C;AAQA,IAAM,YAAY,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAQd,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,SAAS;AAAA,YAC9C,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,SAAS;AAAA;AAAA;AAAA,aAG9C,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,IAAI;AAAA,cACzC,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpD,sCAAM;AAAA,IACN,uCAAO;AAAA,IACP,sCAAM;AAAA;AAGV,IAAO,iBAAQ;;;ADPT;AARN,IAAM,OAAa;AAAA,EACjB,CAAC,EAAE,OAAO,WAAW,UAAU,MAAM,cAAc,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/E,UAAM,UAAU,YAAY;AAC5B,UAAM,YAAY,YACd,EAAE,MAAM,OAAgB,cAAc,UAAU,IAChD,EAAE,eAAe,KAAK;AAE1B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,UAAU;AAAA,QACV,mBAAiB;AAAA,QAChB,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,KAAK,cAAc;AAEnB,IAAO,eAAQ;;;AE9Cf,IAAAC,SAAuB;","names":["styled","React"]}
1
+ {"version":3,"sources":["../../src/v2/index.ts","../../src/v2/Icon.tsx","../../src/v2/styles.ts","../../src/v2/IconTypes.ts"],"sourcesContent":["// Icon v2 - Explicit named + default exports for optimal tree shaking\nexport { default, default as Icon } from \"./Icon\";\nexport * from \"./IconTypes\";\n","import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeIconV2Props } from \"./IconTypes\";\n\n/**\n * **Icon (v2)** — a structural wrapper that centers a caller-supplied SVG inside a\n * fixed-size container, slightly larger than the icon to give it breathing room\n * (a buffer against focus rings, hover backgrounds, and button padding).\n *\n * The caller passes the SVG directly via `children` (or the `icon` alias). The SVG\n * should use `viewBox=\"0 0 24 24\"` and `currentColor` fills — the component controls\n * only the rendered width/height and centering, never the viewBox or path-level fills.\n *\n * Sizes:\n * - `default` — 24×24px container, icon renders at 18×18px\n * - `small` — 20×20px container, icon renders at 15×15px\n *\n * Accessibility: decorative by default (`aria-hidden`). Pass `aria-label` to expose a\n * standalone icon — the container then gets `role=\"img\"` and the label.\n *\n * @example\n * <Icon aria-label=\"Settings\"><MySvg /></Icon>\n */\nconst Icon = React.forwardRef<HTMLSpanElement, TypeIconV2Props>(\n (\n { size = \"default\", children, icon, \"aria-label\": ariaLabel, ...rest },\n ref\n ) => {\n const content = children ?? icon;\n const ariaProps = ariaLabel\n ? { role: \"img\" as const, \"aria-label\": ariaLabel }\n : { \"aria-hidden\": true };\n\n return (\n <Container\n ref={ref}\n iconSize={size}\n data-qa-icon-v2={size}\n {...ariaProps}\n {...rest}\n >\n {content}\n </Container>\n );\n }\n);\n\nIcon.displayName = \"IconV2\";\n\nexport default Icon;\n","import styled from \"styled-components\";\nimport {\n COMMON,\n FLEXBOX,\n LAYOUT,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeIconV2Size } from \"./IconTypes\";\n\nconst dimensions: {\n [key in TypeIconV2Size]: { container: string; icon: string };\n} = {\n default: { container: \"24px\", icon: \"18px\" },\n small: { container: \"20px\", icon: \"15px\" },\n};\n\n/**\n * Structural, non-semantic container that centers a caller-supplied SVG inside a\n * fixed-size box (slightly larger than the icon, for breathing room). The child\n * `svg` is sized via CSS to the icon dimensions and inherits color through\n * `currentColor` — no background or border.\n */\nconst Container = styled.span<{\n iconSize: TypeIconV2Size;\n}>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: inherit;\n width: ${(props) => dimensions[props.iconSize].container};\n height: ${(props) => dimensions[props.iconSize].container};\n\n & > svg {\n width: ${(props) => dimensions[props.iconSize].icon};\n height: ${(props) => dimensions[props.iconSize].icon};\n flex-shrink: 0;\n fill: currentColor;\n }\n\n ${COMMON}\n ${FLEXBOX}\n ${LAYOUT}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type {\n TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n} from \"@sproutsocial/seeds-react-system-props\";\n\nexport type TypeIconV2Size =\n | \"default\" // 24x24 container, 18x18 icon\n | \"small\"; // 20x20 container, 15x15 icon\n\nexport interface TypeIconV2Props\n extends TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\"> {\n /** Container/icon size variant. Defaults to `\"default\"` (24px container, 18px icon). */\n size?: TypeIconV2Size;\n /** The SVG element to render inside the container. Should use `viewBox=\"0 0 24 24\"` and `currentColor` fills. */\n children?: React.ReactNode;\n /** Alias for `children`. When both are provided, `children` wins. */\n icon?: React.ReactNode;\n /** When provided, the container gets `role=\"img\"` and this label, making a standalone icon accessible. Omit for decorative icons (the container is `aria-hidden` automatically). */\n \"aria-label\"?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACAvB,+BAAmB;AACnB,sCAIO;AAGP,IAAM,aAEF;AAAA,EACF,SAAS,EAAE,WAAW,QAAQ,MAAM,OAAO;AAAA,EAC3C,OAAO,EAAE,WAAW,QAAQ,MAAM,OAAO;AAC3C;AAQA,IAAM,YAAY,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAQd,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,SAAS;AAAA,YAC9C,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,SAAS;AAAA;AAAA;AAAA,aAG9C,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,IAAI;AAAA,cACzC,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpD,sCAAM;AAAA,IACN,uCAAO;AAAA,IACP,sCAAM;AAAA;AAGV,IAAO,iBAAQ;;;ADVT;AAXN,IAAM,OAAa;AAAA,EACjB,CACE,EAAE,OAAO,WAAW,UAAU,MAAM,cAAc,WAAW,GAAG,KAAK,GACrE,QACG;AACH,UAAM,UAAU,YAAY;AAC5B,UAAM,YAAY,YACd,EAAE,MAAM,OAAgB,cAAc,UAAU,IAChD,EAAE,eAAe,KAAK;AAE1B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,UAAU;AAAA,QACV,mBAAiB;AAAA,QAChB,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,KAAK,cAAc;AAEnB,IAAO,eAAQ;;;AEjDf,IAAAC,SAAuB;","names":["styled","React"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/seeds-react-icon",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "Seeds React Icon component",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -33,10 +33,10 @@
33
33
  "test:watch": "jest --watch --coverage=false"
34
34
  },
35
35
  "dependencies": {
36
- "@sproutsocial/seeds-react-box": "^1.1.21",
37
- "@sproutsocial/seeds-react-partner-logo": "^1.7.13",
36
+ "@sproutsocial/seeds-react-box": "^1.1.23",
37
+ "@sproutsocial/seeds-react-partner-logo": "^1.7.15",
38
38
  "@sproutsocial/seeds-react-system-props": "^3.1.1",
39
- "@sproutsocial/seeds-react-theme": "^4.1.0",
39
+ "@sproutsocial/seeds-react-theme": "^4.2.0",
40
40
  "@sproutsocial/seeds-react-utilities": "^4.0.1",
41
41
  "styled-system": "^5.1.5"
42
42
  },
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/v2/Icon.tsx","../../src/v2/styles.ts","../../src/v2/IconTypes.ts"],"sourcesContent":["import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeIconV2Props } from \"./IconTypes\";\n\n/**\n * **Icon (v2)** — a structural wrapper that centers a caller-supplied SVG inside a\n * fixed-size container, slightly larger than the icon to give it breathing room\n * (a buffer against focus rings, hover backgrounds, and button padding).\n *\n * The caller passes the SVG directly via `children` (or the `icon` alias). The SVG\n * should use `viewBox=\"0 0 24 24\"` and `currentColor` fills — the component controls\n * only the rendered width/height and centering, never the viewBox or path-level fills.\n *\n * Sizes:\n * - `default` — 24×24px container, icon renders at 18×18px\n * - `small` — 20×20px container, icon renders at 15×15px\n *\n * Accessibility: decorative by default (`aria-hidden`). Pass `aria-label` to expose a\n * standalone icon — the container then gets `role=\"img\"` and the label.\n *\n * @example\n * <Icon aria-label=\"Settings\"><MySvg /></Icon>\n */\nconst Icon = React.forwardRef<HTMLSpanElement, TypeIconV2Props>(\n ({ size = \"default\", children, icon, \"aria-label\": ariaLabel, ...rest }, ref) => {\n const content = children ?? icon;\n const ariaProps = ariaLabel\n ? { role: \"img\" as const, \"aria-label\": ariaLabel }\n : { \"aria-hidden\": true };\n\n return (\n <Container\n ref={ref}\n iconSize={size}\n data-qa-icon-v2={size}\n {...ariaProps}\n {...rest}\n >\n {content}\n </Container>\n );\n }\n);\n\nIcon.displayName = \"IconV2\";\n\nexport default Icon;\n","import styled from \"styled-components\";\nimport { COMMON, FLEXBOX, LAYOUT } from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeIconV2Size } from \"./IconTypes\";\n\nconst dimensions: { [key in TypeIconV2Size]: { container: string; icon: string } } = {\n default: { container: \"24px\", icon: \"18px\" },\n small: { container: \"20px\", icon: \"15px\" },\n};\n\n/**\n * Structural, non-semantic container that centers a caller-supplied SVG inside a\n * fixed-size box (slightly larger than the icon, for breathing room). The child\n * `svg` is sized via CSS to the icon dimensions and inherits color through\n * `currentColor` — no background or border.\n */\nconst Container = styled.span<{\n iconSize: TypeIconV2Size;\n}>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: inherit;\n width: ${(props) => dimensions[props.iconSize].container};\n height: ${(props) => dimensions[props.iconSize].container};\n\n & > svg {\n width: ${(props) => dimensions[props.iconSize].icon};\n height: ${(props) => dimensions[props.iconSize].icon};\n flex-shrink: 0;\n fill: currentColor;\n }\n\n ${COMMON}\n ${FLEXBOX}\n ${LAYOUT}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type {\n TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n} from \"@sproutsocial/seeds-react-system-props\";\n\nexport type TypeIconV2Size =\n | \"default\" // 24x24 container, 18x18 icon\n | \"small\"; // 20x20 container, 15x15 icon\n\nexport interface TypeIconV2Props\n extends TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\"> {\n /** Container/icon size variant. Defaults to `\"default\"` (24px container, 18px icon). */\n size?: TypeIconV2Size;\n /** The SVG element to render inside the container. Should use `viewBox=\"0 0 24 24\"` and `currentColor` fills. */\n children?: React.ReactNode;\n /** Alias for `children`. When both are provided, `children` wins. */\n icon?: React.ReactNode;\n /** When provided, the container gets `role=\"img\"` and this label, making a standalone icon accessible. Omit for decorative icons (the container is `aria-hidden` automatically). */\n \"aria-label\"?: string;\n}\n"],"mappings":";AAAA,YAAY,WAAW;;;ACAvB,OAAO,YAAY;AACnB,SAAS,QAAQ,SAAS,cAAc;AAGxC,IAAM,aAA+E;AAAA,EACnF,SAAS,EAAE,WAAW,QAAQ,MAAM,OAAO;AAAA,EAC3C,OAAO,EAAE,WAAW,QAAQ,MAAM,OAAO;AAC3C;AAQA,IAAM,YAAY,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAQd,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,SAAS;AAAA,YAC9C,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,SAAS;AAAA;AAAA;AAAA,aAG9C,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,IAAI;AAAA,cACzC,CAAC,UAAU,WAAW,MAAM,QAAQ,EAAE,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpD,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA;AAGV,IAAO,iBAAQ;;;ADPT;AARN,IAAM,OAAa;AAAA,EACjB,CAAC,EAAE,OAAO,WAAW,UAAU,MAAM,cAAc,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/E,UAAM,UAAU,YAAY;AAC5B,UAAM,YAAY,YACd,EAAE,MAAM,OAAgB,cAAc,UAAU,IAChD,EAAE,eAAe,KAAK;AAE1B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,UAAU;AAAA,QACV,mBAAiB;AAAA,QAChB,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,KAAK,cAAc;AAEnB,IAAO,eAAQ;;;AE9Cf,OAAuB;","names":[]}