@drivy/cobalt 2.9.2 → 2.10.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.
@@ -5,7 +5,7 @@ import { ButtonLinkBase, ButtonBase } from './ButtonComponent.js';
5
5
  import '../../Icon/index.js';
6
6
  import ChevronRightIcon from '../../Icon/__generated__/ChevronRightIcon.js';
7
7
 
8
- const getComputedClassName = ({ className, variant, size, destructive, primary, text, isIconOnly, fullWidth, }) => {
8
+ const getComputedClassName = ({ className, variant, size, destructive, primary, text, isIconOnly, fullWidth, selected, }) => {
9
9
  return cx(className, "cobalt-button", {
10
10
  "cobalt-button--primary": primary,
11
11
  "cobalt-button--destructive": destructive,
@@ -19,11 +19,12 @@ const getComputedClassName = ({ className, variant, size, destructive, primary,
19
19
  "cobalt-button--business": variant === "business",
20
20
  "cobalt-button--success": variant === "success",
21
21
  "cobalt-button--neutral": variant === "neutral",
22
+ "cobalt-button--selected": selected,
22
23
  "c-w-full": fullWidth,
23
24
  });
24
25
  };
25
26
  const Button = forwardRef((props, ref) => {
26
- const { children, className, variant, size, destructive, primary, text, icon, fullWidth, ...restProps } = props;
27
+ const { children, className, variant, size, destructive, primary, text, icon, fullWidth, selected, ...restProps } = props;
27
28
  const computedClassName = getComputedClassName({
28
29
  className,
29
30
  variant,
@@ -32,6 +33,7 @@ const Button = forwardRef((props, ref) => {
32
33
  primary,
33
34
  text,
34
35
  fullWidth,
36
+ selected,
35
37
  isIconOnly: !!icon && !children,
36
38
  });
37
39
  const content = (React.createElement(React.Fragment, null,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Buttons/Button/index.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\"\nimport cx from \"classnames\"\nimport {\n ButtonComponentProps,\n ButtonLinkComponentProps,\n ButtonProps,\n isLinkProps,\n} from \"./type\"\nimport { ButtonLinkBase, ButtonBase } from \"./ButtonComponent\"\nimport { ChevronRightIcon } from \"../../Icon\"\n\nconst getComputedClassName = ({\n className,\n variant,\n size,\n destructive,\n primary,\n text,\n isIconOnly,\n fullWidth,\n}: {\n className?: ButtonProps[\"className\"]\n variant?: ButtonProps[\"variant\"]\n size?: ButtonProps[\"size\"]\n destructive?: ButtonProps[\"destructive\"]\n primary?: ButtonProps[\"primary\"]\n text?: ButtonProps[\"text\"]\n isIconOnly?: boolean\n fullWidth?: ButtonProps[\"fullWidth\"]\n}) => {\n return cx(className, \"cobalt-button\", {\n \"cobalt-button--primary\": primary,\n \"cobalt-button--destructive\": destructive,\n \"cobalt-button--text\": text,\n \"cobalt-button--icon-only\": isIconOnly,\n \"cobalt-button--small\": size === \"small\",\n \"cobalt-button--large\": size === \"large\",\n \"cobalt-button--warning\": variant === \"warning\",\n \"cobalt-button--secondary\": variant === \"secondary\",\n \"cobalt-button--tertiary\": variant === \"tertiary\",\n \"cobalt-button--business\": variant === \"business\",\n \"cobalt-button--success\": variant === \"success\",\n \"cobalt-button--neutral\": variant === \"neutral\",\n \"c-w-full\": fullWidth,\n })\n}\n\ninterface ButtonOverloads {\n (\n props: Exclude<ButtonProps, ButtonComponentProps> &\n React.RefAttributes<HTMLAnchorElement>\n ): React.ReactElement\n (\n props: Exclude<ButtonProps, ButtonLinkComponentProps> &\n React.RefAttributes<HTMLButtonElement>\n ): React.ReactElement\n displayName?: string\n}\n\nconst Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(\n (props, ref) => {\n const {\n children,\n className,\n variant,\n size,\n destructive,\n primary,\n text,\n icon,\n fullWidth,\n ...restProps\n } = props\n\n const computedClassName = getComputedClassName({\n className,\n variant,\n size,\n destructive,\n primary,\n text,\n fullWidth,\n isIconOnly: !!icon && !children,\n })\n\n const content = (\n <>\n {icon}\n {children && <span>{children}</span>}\n {text && children ? <ChevronRightIcon /> : null}\n </>\n )\n\n if (isLinkProps(restProps)) {\n return (\n <ButtonLinkBase\n {...(restProps as ButtonLinkComponentProps)}\n className={computedClassName}\n ref={ref as React.ForwardedRef<HTMLAnchorElement>}\n >\n {content}\n </ButtonLinkBase>\n )\n }\n\n return (\n <ButtonBase\n {...(restProps as ButtonComponentProps)}\n className={computedClassName}\n ref={ref as React.ForwardedRef<HTMLButtonElement>}\n >\n {content}\n </ButtonBase>\n )\n }\n) as ButtonOverloads\n\nButton.displayName = \"Button\"\n\nexport default Button\n"],"names":[],"mappings":";;;;;;;AAWA,MAAM,oBAAoB,GAAG,CAAC,EAC5B,SAAS,EACT,OAAO,EACP,IAAI,EACJ,WAAW,EACX,OAAO,EACP,IAAI,EACJ,UAAU,EACV,SAAS,GAUV,KAAI;AACH,IAAA,OAAO,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE;AACpC,QAAA,wBAAwB,EAAE,OAAO;AACjC,QAAA,4BAA4B,EAAE,WAAW;AACzC,QAAA,qBAAqB,EAAE,IAAI;AAC3B,QAAA,0BAA0B,EAAE,UAAU;QACtC,sBAAsB,EAAE,IAAI,KAAK,OAAO;QACxC,sBAAsB,EAAE,IAAI,KAAK,OAAO;QACxC,wBAAwB,EAAE,OAAO,KAAK,SAAS;QAC/C,0BAA0B,EAAE,OAAO,KAAK,WAAW;QACnD,yBAAyB,EAAE,OAAO,KAAK,UAAU;QACjD,yBAAyB,EAAE,OAAO,KAAK,UAAU;QACjD,wBAAwB,EAAE,OAAO,KAAK,SAAS;QAC/C,wBAAwB,EAAE,OAAO,KAAK,SAAS;AAC/C,QAAA,UAAU,EAAE,SAAS;AACtB,KAAA,CAAC,CAAA;AACJ,CAAC,CAAA;AAcK,MAAA,MAAM,GAAG,UAAU,CACvB,CAAC,KAAK,EAAE,GAAG,KAAI;IACb,MAAM,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,IAAI,EACJ,WAAW,EACX,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,GAAG,SAAS,EACb,GAAG,KAAK,CAAA;IAET,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;QAC7C,SAAS;QACT,OAAO;QACP,IAAI;QACJ,WAAW;QACX,OAAO;QACP,IAAI;QACJ,SAAS;AACT,QAAA,UAAU,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ;AAChC,KAAA,CAAC,CAAA;IAEF,MAAM,OAAO,IACX,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;QACG,IAAI;QACJ,QAAQ,IAAI,KAAO,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAAA,QAAQ,CAAQ;AACnC,QAAA,IAAI,IAAI,QAAQ,GAAG,KAAC,CAAA,aAAA,CAAA,gBAAgB,EAAG,IAAA,CAAA,GAAG,IAAI,CAC9C,CACJ,CAAA;AAED,IAAA,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE;AAC1B,QAAA,QACE,KAAC,CAAA,aAAA,CAAA,cAAc,EACR,EAAA,GAAA,SAAsC,EAC3C,SAAS,EAAE,iBAAiB,EAC5B,GAAG,EAAE,GAA4C,IAEhD,OAAO,CACO,EAClB;KACF;AAED,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,UAAU,EACJ,EAAA,GAAA,SAAkC,EACvC,SAAS,EAAE,iBAAiB,EAC5B,GAAG,EAAE,GAA4C,IAEhD,OAAO,CACG,EACd;AACH,CAAC,EACiB;AAEpB,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Buttons/Button/index.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\"\nimport cx from \"classnames\"\nimport {\n ButtonComponentProps,\n ButtonLinkComponentProps,\n ButtonProps,\n isLinkProps,\n} from \"./type\"\nimport { ButtonLinkBase, ButtonBase } from \"./ButtonComponent\"\nimport { ChevronRightIcon } from \"../../Icon\"\n\nconst getComputedClassName = ({\n className,\n variant,\n size,\n destructive,\n primary,\n text,\n isIconOnly,\n fullWidth,\n selected,\n}: {\n className?: ButtonProps[\"className\"]\n variant?: ButtonProps[\"variant\"]\n size?: ButtonProps[\"size\"]\n destructive?: ButtonProps[\"destructive\"]\n primary?: ButtonProps[\"primary\"]\n text?: ButtonProps[\"text\"]\n isIconOnly?: boolean\n fullWidth?: ButtonProps[\"fullWidth\"]\n selected?: ButtonProps[\"selected\"]\n}) => {\n return cx(className, \"cobalt-button\", {\n \"cobalt-button--primary\": primary,\n \"cobalt-button--destructive\": destructive,\n \"cobalt-button--text\": text,\n \"cobalt-button--icon-only\": isIconOnly,\n \"cobalt-button--small\": size === \"small\",\n \"cobalt-button--large\": size === \"large\",\n \"cobalt-button--warning\": variant === \"warning\",\n \"cobalt-button--secondary\": variant === \"secondary\",\n \"cobalt-button--tertiary\": variant === \"tertiary\",\n \"cobalt-button--business\": variant === \"business\",\n \"cobalt-button--success\": variant === \"success\",\n \"cobalt-button--neutral\": variant === \"neutral\",\n \"cobalt-button--selected\": selected,\n \"c-w-full\": fullWidth,\n })\n}\n\ninterface ButtonOverloads {\n (\n props: Exclude<ButtonProps, ButtonComponentProps> &\n React.RefAttributes<HTMLAnchorElement>\n ): React.ReactElement\n (\n props: Exclude<ButtonProps, ButtonLinkComponentProps> &\n React.RefAttributes<HTMLButtonElement>\n ): React.ReactElement\n displayName?: string\n}\n\nconst Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(\n (props, ref) => {\n const {\n children,\n className,\n variant,\n size,\n destructive,\n primary,\n text,\n icon,\n fullWidth,\n selected,\n ...restProps\n } = props\n\n const computedClassName = getComputedClassName({\n className,\n variant,\n size,\n destructive,\n primary,\n text,\n fullWidth,\n selected,\n isIconOnly: !!icon && !children,\n })\n\n const content = (\n <>\n {icon}\n {children && <span>{children}</span>}\n {text && children ? <ChevronRightIcon /> : null}\n </>\n )\n\n if (isLinkProps(restProps)) {\n return (\n <ButtonLinkBase\n {...(restProps as ButtonLinkComponentProps)}\n className={computedClassName}\n ref={ref as React.ForwardedRef<HTMLAnchorElement>}\n >\n {content}\n </ButtonLinkBase>\n )\n }\n\n return (\n <ButtonBase\n {...(restProps as ButtonComponentProps)}\n className={computedClassName}\n ref={ref as React.ForwardedRef<HTMLButtonElement>}\n >\n {content}\n </ButtonBase>\n )\n }\n) as ButtonOverloads\n\nButton.displayName = \"Button\"\n\nexport default Button\n"],"names":[],"mappings":";;;;;;;AAWA,MAAM,oBAAoB,GAAG,CAAC,EAC5B,SAAS,EACT,OAAO,EACP,IAAI,EACJ,WAAW,EACX,OAAO,EACP,IAAI,EACJ,UAAU,EACV,SAAS,EACT,QAAQ,GAWT,KAAI;AACH,IAAA,OAAO,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE;AACpC,QAAA,wBAAwB,EAAE,OAAO;AACjC,QAAA,4BAA4B,EAAE,WAAW;AACzC,QAAA,qBAAqB,EAAE,IAAI;AAC3B,QAAA,0BAA0B,EAAE,UAAU;QACtC,sBAAsB,EAAE,IAAI,KAAK,OAAO;QACxC,sBAAsB,EAAE,IAAI,KAAK,OAAO;QACxC,wBAAwB,EAAE,OAAO,KAAK,SAAS;QAC/C,0BAA0B,EAAE,OAAO,KAAK,WAAW;QACnD,yBAAyB,EAAE,OAAO,KAAK,UAAU;QACjD,yBAAyB,EAAE,OAAO,KAAK,UAAU;QACjD,wBAAwB,EAAE,OAAO,KAAK,SAAS;QAC/C,wBAAwB,EAAE,OAAO,KAAK,SAAS;AAC/C,QAAA,yBAAyB,EAAE,QAAQ;AACnC,QAAA,UAAU,EAAE,SAAS;AACtB,KAAA,CAAC,CAAA;AACJ,CAAC,CAAA;AAcK,MAAA,MAAM,GAAG,UAAU,CACvB,CAAC,KAAK,EAAE,GAAG,KAAI;IACb,MAAM,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,IAAI,EACJ,WAAW,EACX,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACb,GAAG,KAAK,CAAA;IAET,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;QAC7C,SAAS;QACT,OAAO;QACP,IAAI;QACJ,WAAW;QACX,OAAO;QACP,IAAI;QACJ,SAAS;QACT,QAAQ;AACR,QAAA,UAAU,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ;AAChC,KAAA,CAAC,CAAA;IAEF,MAAM,OAAO,IACX,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;QACG,IAAI;QACJ,QAAQ,IAAI,KAAO,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAAA,QAAQ,CAAQ;AACnC,QAAA,IAAI,IAAI,QAAQ,GAAG,KAAC,CAAA,aAAA,CAAA,gBAAgB,EAAG,IAAA,CAAA,GAAG,IAAI,CAC9C,CACJ,CAAA;AAED,IAAA,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE;AAC1B,QAAA,QACE,KAAC,CAAA,aAAA,CAAA,cAAc,EACR,EAAA,GAAA,SAAsC,EAC3C,SAAS,EAAE,iBAAiB,EAC5B,GAAG,EAAE,GAA4C,IAEhD,OAAO,CACO,EAClB;KACF;AAED,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,UAAU,EACJ,EAAA,GAAA,SAAkC,EACvC,SAAS,EAAE,iBAAiB,EAC5B,GAAG,EAAE,GAA4C,IAEhD,OAAO,CACG,EACd;AACH,CAAC,EACiB;AAEpB,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"type.js","sources":["../../../../src/components/Buttons/Button/type.ts"],"sourcesContent":["type SharedButtonApiProps = {\n loading?: boolean\n disabled?: boolean\n primary?: boolean\n destructive?: boolean\n icon?: React.ReactNode\n text?: boolean\n fullWidth?: boolean\n // React.HTMLAttributes allows color to be passed in, but we don't want to allow it\n color?: never\n}\n\ntype SharedConditionalTextProps =\n | {\n text: true\n icon: React.ReactNode\n children?: never | false | undefined | null\n fullWidth?: never | false\n }\n | {\n text: true\n icon?: never\n fullWidth?: never | false\n }\n | {\n text?: false\n }\n\ntype SharedConditionalVariantProps =\n | {\n size?: \"large\"\n variant?: never\n }\n | {\n size: \"small\"\n destructive?: false\n primary?: false\n // Those variants are only available for small buttons\n variant:\n | \"warning\"\n | \"secondary\"\n | \"tertiary\"\n | \"business\"\n | \"success\"\n | \"neutral\"\n }\n | {\n size: \"small\"\n variant?: never\n }\n\n// Button props\nexport type ButtonComponentProps =\n React.ButtonHTMLAttributes<HTMLButtonElement> & {\n loading?: SharedButtonApiProps[\"loading\"]\n disabled?: SharedButtonApiProps[\"disabled\"]\n href?: never\n }\n\n// Link props\nexport type ButtonLinkComponentProps =\n React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n loading?: SharedButtonApiProps[\"loading\"]\n disabled?: SharedButtonApiProps[\"disabled\"]\n href?: string\n }\n\nexport const isLinkProps = (\n props: ButtonComponentProps | ButtonLinkComponentProps\n): props is ButtonLinkComponentProps => \"href\" in props && !!props.href\n\nexport type ButtonProps = (ButtonComponentProps | ButtonLinkComponentProps) &\n SharedButtonApiProps &\n SharedConditionalVariantProps &\n SharedConditionalTextProps\n"],"names":[],"mappings":"AAmEa,MAAA,WAAW,GAAG,CACzB,KAAsD,KAChB,MAAM,IAAI,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC;;;;"}
1
+ {"version":3,"file":"type.js","sources":["../../../../src/components/Buttons/Button/type.ts"],"sourcesContent":["type SharedButtonApiProps = {\n loading?: boolean\n disabled?: boolean\n primary?: boolean\n destructive?: boolean\n icon?: React.ReactNode\n text?: boolean\n fullWidth?: boolean\n selected?: boolean\n // React.HTMLAttributes allows color to be passed in, but we don't want to allow it\n color?: never\n}\n\ntype SharedConditionalTextProps =\n | {\n text: true\n icon: React.ReactNode\n children?: never | false | undefined | null\n fullWidth?: never | false\n }\n | {\n text: true\n icon?: never\n fullWidth?: never | false\n }\n | {\n text?: false\n }\n\ntype SharedConditionalVariantProps =\n | {\n size?: \"large\"\n variant?: never\n }\n | {\n size: \"small\"\n destructive?: false\n primary?: false\n selected?: false\n // Those variants are only available for small buttons\n variant:\n | \"warning\"\n | \"secondary\"\n | \"tertiary\"\n | \"business\"\n | \"success\"\n | \"neutral\"\n }\n | {\n size: \"small\"\n variant?: never\n }\n\n// Button props\nexport type ButtonComponentProps =\n React.ButtonHTMLAttributes<HTMLButtonElement> & {\n loading?: SharedButtonApiProps[\"loading\"]\n disabled?: SharedButtonApiProps[\"disabled\"]\n href?: never\n }\n\n// Link props\nexport type ButtonLinkComponentProps =\n React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n loading?: SharedButtonApiProps[\"loading\"]\n disabled?: SharedButtonApiProps[\"disabled\"]\n href?: string\n }\n\nexport const isLinkProps = (\n props: ButtonComponentProps | ButtonLinkComponentProps\n): props is ButtonLinkComponentProps => \"href\" in props && !!props.href\n\nexport type ButtonProps = (ButtonComponentProps | ButtonLinkComponentProps) &\n SharedButtonApiProps &\n SharedConditionalVariantProps &\n SharedConditionalTextProps\n"],"names":[],"mappings":"AAqEa,MAAA,WAAW,GAAG,CACzB,KAAsD,KAChB,MAAM,IAAI,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivy/cobalt",
3
- "version": "2.9.2",
3
+ "version": "2.10.0",
4
4
  "description": "Opinionated design system for Drivy's projects.",
5
5
  "main": "src/index.js",
6
6
  "types": "types/src/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "url": "https://github.com/TimPetricola"
20
20
  },
21
21
  "dependencies": {
22
- "@ark-ui/react": "5.26.2",
22
+ "@ark-ui/react": "5.30.0",
23
23
  "@juggle/resize-observer": "3.4.0",
24
24
  "@lottiefiles/react-lottie-player": "3.6.0",
25
25
  "@tippyjs/react": "4.2.6",
@@ -45,14 +45,14 @@
45
45
  "@rollup/plugin-commonjs": "28.0.6",
46
46
  "@rollup/plugin-json": "6.1.0",
47
47
  "@rushstack/eslint-patch": "1.12.0",
48
- "@storybook/addon-essentials": "7.6.20",
48
+ "@storybook/addon-essentials": "7.6.21",
49
49
  "@storybook/addons": "7.6.17",
50
- "@storybook/blocks": "7.6.20",
51
- "@storybook/react": "7.6.20",
52
- "@storybook/react-webpack5": "7.6.20",
50
+ "@storybook/blocks": "7.6.21",
51
+ "@storybook/react": "7.6.21",
52
+ "@storybook/react-webpack5": "7.6.21",
53
53
  "@svgr/cli": "7.0.0",
54
54
  "@testing-library/jest-dom": "6.9.1",
55
- "@testing-library/react": "16.3.0",
55
+ "@testing-library/react": "16.3.1",
56
56
  "@testing-library/react-hooks": "8.0.1",
57
57
  "@types/fs-extra": "11.0.4",
58
58
  "@types/jest": "29.5.14",
@@ -61,13 +61,13 @@
61
61
  "@types/node": "22.14.1",
62
62
  "@types/react": "18.3.24",
63
63
  "@types/react-dom": "18.3.7",
64
- "autoprefixer": "10.4.22",
64
+ "autoprefixer": "10.4.23",
65
65
  "core-js": "3.47.0",
66
66
  "css-loader": "7.1.2",
67
67
  "eslint": "8.57.1",
68
68
  "eslint-plugin-storybook": "^0.12.0",
69
69
  "file-loader": "6.2.0",
70
- "fs-extra": "11.3.2",
70
+ "fs-extra": "11.3.3",
71
71
  "html-entities": "2.6.0",
72
72
  "jest": "29.7.0",
73
73
  "jest-environment-jsdom": "29.7.0",
@@ -88,10 +88,10 @@
88
88
  "rollup-plugin-copy": "3.5.0",
89
89
  "rollup-plugin-svgo": "2.0.0",
90
90
  "rollup-plugin-typescript2": "0.36.0",
91
- "sass": "1.96.0",
91
+ "sass": "1.97.2",
92
92
  "sass-loader": "13.3.3",
93
93
  "sharp-cli": "5.2.0",
94
- "storybook": "7.6.20",
94
+ "storybook": "7.6.21",
95
95
  "style-loader": "4.0.0",
96
96
  "stylelint": "15.11.0",
97
97
  "svg2vectordrawable": "2.9.1",
@@ -17,7 +17,7 @@
17
17
  user-select: none;
18
18
  appearance: none;
19
19
 
20
- &:active {
20
+ &:active:not([disabled]) {
21
21
  transform: scale(0.97);
22
22
  }
23
23
 
@@ -25,6 +25,8 @@
25
25
  width: 24px;
26
26
  height: 24px;
27
27
 
28
+ margin: initial;
29
+
28
30
  flex-shrink: 0;
29
31
  }
30
32
 
@@ -102,9 +104,16 @@
102
104
  @apply c-text-error;
103
105
  }
104
106
 
105
- &[disabled][aria-disabled]:not([aria-disabled="false"]):not(
106
- [aria-busy="true"]
107
- ) {
107
+ &.cobalt-button--selected {
108
+ @apply c-bg-primaryContainer c-text-onPrimaryContainer c-border-onPrimaryContainer;
109
+ }
110
+
111
+ &[href][aria-disabled="true"] {
112
+ pointer-events: none;
113
+ }
114
+
115
+ &[disabled]:not([aria-busy="true"]),
116
+ &[href][aria-disabled="true"]:not([aria-busy="true"]) {
108
117
  @apply c-state-none c-text-onSurfaceDisabled c-drop-shadow-none hover:c-no-underline;
109
118
  opacity: 1;
110
119
  cursor: not-allowed;
@@ -131,10 +140,16 @@
131
140
  .cobalt-button__loading-icon {
132
141
  position: absolute;
133
142
 
143
+ display: none;
144
+
134
145
  margin: auto;
135
146
  }
136
147
 
137
148
  &[aria-busy="true"] > *:not(.cobalt-button__loading-icon) {
138
149
  color: transparent;
139
150
  }
151
+
152
+ &[aria-busy="true"] > .cobalt-button__loading-icon {
153
+ display: inline-block;
154
+ }
140
155
  }
@@ -7,6 +7,7 @@ type SharedButtonApiProps = {
7
7
  icon?: React.ReactNode;
8
8
  text?: boolean;
9
9
  fullWidth?: boolean;
10
+ selected?: boolean;
10
11
  color?: never;
11
12
  };
12
13
  type SharedConditionalTextProps = {
@@ -28,6 +29,7 @@ type SharedConditionalVariantProps = {
28
29
  size: "small";
29
30
  destructive?: false;
30
31
  primary?: false;
32
+ selected?: false;
31
33
  variant: "warning" | "secondary" | "tertiary" | "business" | "success" | "neutral";
32
34
  } | {
33
35
  size: "small";
package/utilities.css CHANGED
@@ -67,4 +67,36 @@
67
67
  inherits: false;
68
68
  initial-value: transparent;
69
69
  }
70
+
71
+ .c-state-interactive-halo {
72
+ position: relative;
73
+ z-index: 1;
74
+
75
+ cursor: pointer;
76
+ }
77
+
78
+ .c-state-interactive-halo:hover::after {
79
+ @apply c--m-xs c-rounded-xl c-state-interactive;
80
+
81
+ position: absolute;
82
+
83
+ top: 0;
84
+ right: 0;
85
+ bottom: 0;
86
+ left: 0;
87
+
88
+ z-index: -1;
89
+
90
+ display: inline-block;
91
+
92
+ content: "";
93
+ }
94
+
95
+ .c-state-interactive-with-images {
96
+ cursor: pointer;
97
+ }
98
+
99
+ .c-state-interactive-with-images:hover .c-state-interactive-image {
100
+ filter: brightness(90%);
101
+ }
70
102
  }