@dnanpm/ui-components 0.5.0 → 0.6.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.
Files changed (66) hide show
  1. package/README.md +3 -1
  2. package/dist/components/Accordion/Accordion.css +4 -4
  3. package/dist/components/Accordion/Accordion.module.css.cjs +3 -3
  4. package/dist/components/Accordion/Accordion.module.css.js +3 -3
  5. package/dist/components/AccordionItem/AccordionItem.css +18 -18
  6. package/dist/components/AccordionItem/AccordionItem.module.css.cjs +11 -11
  7. package/dist/components/AccordionItem/AccordionItem.module.css.js +11 -11
  8. package/dist/components/Breadcrumb/Breadcrumb.css +11 -12
  9. package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs +6 -6
  10. package/dist/components/Breadcrumb/Breadcrumb.module.css.js +6 -6
  11. package/dist/components/Button/Button.cjs +3 -1
  12. package/dist/components/Button/Button.cjs.map +1 -1
  13. package/dist/components/Button/Button.css +33 -33
  14. package/dist/components/Button/Button.d.ts.map +1 -1
  15. package/dist/components/Button/Button.js +3 -1
  16. package/dist/components/Button/Button.js.map +1 -1
  17. package/dist/components/Button/Button.module.css.cjs +11 -11
  18. package/dist/components/Button/Button.module.css.js +11 -11
  19. package/dist/components/Hero/Hero.cjs +29 -38
  20. package/dist/components/Hero/Hero.cjs.map +1 -1
  21. package/dist/components/Hero/Hero.css +64 -60
  22. package/dist/components/Hero/Hero.d.ts.map +1 -1
  23. package/dist/components/Hero/Hero.js +29 -38
  24. package/dist/components/Hero/Hero.js.map +1 -1
  25. package/dist/components/Hero/Hero.module.css.cjs +20 -19
  26. package/dist/components/Hero/Hero.module.css.cjs.map +1 -1
  27. package/dist/components/Hero/Hero.module.css.js +20 -19
  28. package/dist/components/Hero/Hero.module.css.js.map +1 -1
  29. package/dist/components/Hero/Hero.types.d.ts +1 -5
  30. package/dist/components/Hero/Hero.types.d.ts.map +1 -1
  31. package/dist/components/Hero/Hero.utils.cjs +2 -1
  32. package/dist/components/Hero/Hero.utils.cjs.map +1 -1
  33. package/dist/components/Hero/Hero.utils.d.ts.map +1 -1
  34. package/dist/components/Hero/Hero.utils.js +2 -1
  35. package/dist/components/Hero/Hero.utils.js.map +1 -1
  36. package/dist/components/IconButton/IconButton.cjs +21 -5
  37. package/dist/components/IconButton/IconButton.cjs.map +1 -1
  38. package/dist/components/IconButton/IconButton.css +87 -83
  39. package/dist/components/IconButton/IconButton.d.ts +1 -1
  40. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  41. package/dist/components/IconButton/IconButton.js +22 -6
  42. package/dist/components/IconButton/IconButton.js.map +1 -1
  43. package/dist/components/IconButton/IconButton.module.css.cjs +9 -10
  44. package/dist/components/IconButton/IconButton.module.css.cjs.map +1 -1
  45. package/dist/components/IconButton/IconButton.module.css.js +9 -10
  46. package/dist/components/IconButton/IconButton.module.css.js.map +1 -1
  47. package/dist/components/IconButton/IconButton.types.d.ts +15 -10
  48. package/dist/components/IconButton/IconButton.types.d.ts.map +1 -1
  49. package/dist/components/IconButton/index.d.ts +1 -1
  50. package/dist/components/IconButton/index.d.ts.map +1 -1
  51. package/dist/components/Label/Label.css +13 -8
  52. package/dist/components/Label/Label.module.css.cjs +7 -7
  53. package/dist/components/Label/Label.module.css.js +7 -7
  54. package/dist/components/Notification/Notification.css +14 -14
  55. package/dist/components/Notification/Notification.module.css.cjs +9 -9
  56. package/dist/components/Notification/Notification.module.css.js +9 -9
  57. package/dist/index.d.ts +1 -1
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/styles/utils/elevation.css +20 -17
  60. package/dist/styles/utils/elevation.module.css.cjs +4 -4
  61. package/dist/styles/utils/elevation.module.css.js +4 -4
  62. package/dist/styles/utils/focus.css +14 -14
  63. package/dist/styles/utils/focus.module.css.cjs +3 -3
  64. package/dist/styles/utils/focus.module.css.js +3 -3
  65. package/dist/styles.css +117 -85
  66. package/package.json +1 -1
@@ -1,20 +1,20 @@
1
1
  require('./Hero.css');
2
2
  "use strict";
3
3
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
4
- const hero = "_hero_905ff_1";
5
- const hero__background = "_hero__background_905ff_11";
6
- const hero__backgroundImageComponent = "_hero__backgroundImageComponent_905ff_20";
7
- const hero__logoImage = "_hero__logoImage_905ff_42";
8
- const hero__overlay = "_hero__overlay_905ff_63";
9
- const hero__content = "_hero__content_905ff_75";
10
- const hero__card = "_hero__card_905ff_90";
11
- const hero__main = "_hero__main_905ff_101";
12
- const hero__text = "_hero__text_905ff_107";
13
- const hero__header = "_hero__header_905ff_113";
14
- const hero__label = "_hero__label_905ff_119";
15
- const hero__heading = "_hero__heading_905ff_123";
16
- const hero__description = "_hero__description_905ff_149";
17
- const hero__actions = "_hero__actions_905ff_164";
4
+ const hero = "_hero_c98qx_1";
5
+ const hero__background = "_hero__background_c98qx_11";
6
+ const hero__backgroundImageComponent = "_hero__backgroundImageComponent_c98qx_20";
7
+ const hero__logoImage = "_hero__logoImage_c98qx_42";
8
+ const hero__overlay = "_hero__overlay_c98qx_63";
9
+ const hero__content = "_hero__content_c98qx_75";
10
+ const hero__card = "_hero__card_c98qx_90";
11
+ const hero__main = "_hero__main_c98qx_101";
12
+ const hero__text = "_hero__text_c98qx_107";
13
+ const hero__header = "_hero__header_c98qx_113";
14
+ const hero__label = "_hero__label_c98qx_119";
15
+ const hero__heading = "_hero__heading_c98qx_123";
16
+ const hero__description = "_hero__description_c98qx_153";
17
+ const hero__actions = "_hero__actions_c98qx_168";
18
18
  const styles = {
19
19
  hero,
20
20
  hero__background,
@@ -28,11 +28,12 @@ const styles = {
28
28
  hero__header,
29
29
  hero__label,
30
30
  hero__heading,
31
- "hero__heading--xl": "_hero__heading--xl_905ff_129",
32
- "hero__heading--lg": "_hero__heading--lg_905ff_133",
33
- "hero__heading--md": "_hero__heading--md_905ff_137",
34
- "hero__heading--sm": "_hero__heading--sm_905ff_141",
35
- "hero__heading--xs": "_hero__heading--xs_905ff_145",
31
+ "hero__heading--xl": "_hero__heading--xl_c98qx_129",
32
+ "hero__heading--lg": "_hero__heading--lg_c98qx_133",
33
+ "hero__heading--md": "_hero__heading--md_c98qx_137",
34
+ "hero__heading--sm": "_hero__heading--sm_c98qx_141",
35
+ "hero__heading--xs": "_hero__heading--xs_c98qx_145",
36
+ "hero__heading--xxs": "_hero__heading--xxs_c98qx_149",
36
37
  hero__description,
37
38
  hero__actions
38
39
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Hero.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Hero.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,18 +1,18 @@
1
1
  import './Hero.css';
2
- const hero = "_hero_905ff_1";
3
- const hero__background = "_hero__background_905ff_11";
4
- const hero__backgroundImageComponent = "_hero__backgroundImageComponent_905ff_20";
5
- const hero__logoImage = "_hero__logoImage_905ff_42";
6
- const hero__overlay = "_hero__overlay_905ff_63";
7
- const hero__content = "_hero__content_905ff_75";
8
- const hero__card = "_hero__card_905ff_90";
9
- const hero__main = "_hero__main_905ff_101";
10
- const hero__text = "_hero__text_905ff_107";
11
- const hero__header = "_hero__header_905ff_113";
12
- const hero__label = "_hero__label_905ff_119";
13
- const hero__heading = "_hero__heading_905ff_123";
14
- const hero__description = "_hero__description_905ff_149";
15
- const hero__actions = "_hero__actions_905ff_164";
2
+ const hero = "_hero_c98qx_1";
3
+ const hero__background = "_hero__background_c98qx_11";
4
+ const hero__backgroundImageComponent = "_hero__backgroundImageComponent_c98qx_20";
5
+ const hero__logoImage = "_hero__logoImage_c98qx_42";
6
+ const hero__overlay = "_hero__overlay_c98qx_63";
7
+ const hero__content = "_hero__content_c98qx_75";
8
+ const hero__card = "_hero__card_c98qx_90";
9
+ const hero__main = "_hero__main_c98qx_101";
10
+ const hero__text = "_hero__text_c98qx_107";
11
+ const hero__header = "_hero__header_c98qx_113";
12
+ const hero__label = "_hero__label_c98qx_119";
13
+ const hero__heading = "_hero__heading_c98qx_123";
14
+ const hero__description = "_hero__description_c98qx_153";
15
+ const hero__actions = "_hero__actions_c98qx_168";
16
16
  const styles = {
17
17
  hero,
18
18
  hero__background,
@@ -26,11 +26,12 @@ const styles = {
26
26
  hero__header,
27
27
  hero__label,
28
28
  hero__heading,
29
- "hero__heading--xl": "_hero__heading--xl_905ff_129",
30
- "hero__heading--lg": "_hero__heading--lg_905ff_133",
31
- "hero__heading--md": "_hero__heading--md_905ff_137",
32
- "hero__heading--sm": "_hero__heading--sm_905ff_141",
33
- "hero__heading--xs": "_hero__heading--xs_905ff_145",
29
+ "hero__heading--xl": "_hero__heading--xl_c98qx_129",
30
+ "hero__heading--lg": "_hero__heading--lg_c98qx_133",
31
+ "hero__heading--md": "_hero__heading--md_c98qx_137",
32
+ "hero__heading--sm": "_hero__heading--sm_c98qx_141",
33
+ "hero__heading--xs": "_hero__heading--xs_c98qx_145",
34
+ "hero__heading--xxs": "_hero__heading--xxs_c98qx_149",
34
35
  hero__description,
35
36
  hero__actions
36
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Hero.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Hero.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithRef, CSSProperties, ElementType, ReactElement, ReactNode } from 'react';
2
- export type HeroHeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
2
+ export type HeroHeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
3
3
  export type HeroCommonImageProps = Omit<ComponentPropsWithRef<'img'>, 'ref'>;
4
4
  export type HeroImageComponent = ElementType<HeroCommonImageProps>;
5
5
  export interface HeroProps extends Omit<ComponentPropsWithRef<'div'>, 'children'> {
@@ -47,9 +47,5 @@ export interface HeroProps extends Omit<ComponentPropsWithRef<'div'>, 'children'
47
47
  * Secondary call-to-action element.
48
48
  */
49
49
  readonly secondaryCta?: ReactElement;
50
- /**
51
- * Allows passing a `data-testid` string for testing purposes.
52
- */
53
- readonly 'data-testid'?: string;
54
50
  }
55
51
  //# sourceMappingURL=Hero.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Hero.types.d.ts","sourceRoot":"","sources":["../../../src/components/Hero/Hero.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,qBAAqB,EACrB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,SAAS,EACZ,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAChE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;AAC7E,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AAEnE,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC7E;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IACzC;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,kBAAkB,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,oBAAoB,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,CAAC,EAAE,kBAAkB,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAC3C;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,kBAAkB,CAAC;IACxC;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,oBAAoB,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC5D;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC;IACnC;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACxC"}
@@ -6,7 +6,8 @@ const headingClassByLevel = {
6
6
  h2: Hero_module.default["hero__heading--lg"],
7
7
  h3: Hero_module.default["hero__heading--md"],
8
8
  h4: Hero_module.default["hero__heading--sm"],
9
- h5: Hero_module.default["hero__heading--xs"]
9
+ h5: Hero_module.default["hero__heading--xs"],
10
+ h6: Hero_module.default["hero__heading--xxs"]
10
11
  };
11
12
  exports.headingClassByLevel = headingClassByLevel;
12
13
  //# sourceMappingURL=Hero.utils.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Hero.utils.cjs","sources":["../../../src/components/Hero/Hero.utils.ts"],"sourcesContent":["import styles from './Hero.module.css';\nimport type { HeroHeadingLevel } from './Hero.types';\n\nexport const headingClassByLevel: Record<HeroHeadingLevel, string> = {\n h1: styles['hero__heading--xl'],\n h2: styles['hero__heading--lg'],\n h3: styles['hero__heading--md'],\n h4: styles['hero__heading--sm'],\n h5: styles['hero__heading--xs'],\n};\n"],"names":["styles"],"mappings":";;;AAGO,MAAM,sBAAwD;AAAA,EACjE,IAAIA,YAAAA,QAAO,mBAAmB;AAAA,EAC9B,IAAIA,YAAAA,QAAO,mBAAmB;AAAA,EAC9B,IAAIA,YAAAA,QAAO,mBAAmB;AAAA,EAC9B,IAAIA,YAAAA,QAAO,mBAAmB;AAAA,EAC9B,IAAIA,YAAAA,QAAO,mBAAmB;AAClC;;"}
1
+ {"version":3,"file":"Hero.utils.cjs","sources":["../../../src/components/Hero/Hero.utils.ts"],"sourcesContent":["import styles from './Hero.module.css';\nimport type { HeroHeadingLevel } from './Hero.types';\n\nexport const headingClassByLevel: Record<HeroHeadingLevel, string> = {\n h1: styles['hero__heading--xl'],\n h2: styles['hero__heading--lg'],\n h3: styles['hero__heading--md'],\n h4: styles['hero__heading--sm'],\n h5: styles['hero__heading--xs'],\n h6: styles['hero__heading--xxs'],\n};\n"],"names":["styles"],"mappings":";;;AAGO,MAAM,sBAAwD;AAAA,EACjE,IAAIA,YAAAA,QAAO,mBAAmB;AAAA,EAC9B,IAAIA,YAAAA,QAAO,mBAAmB;AAAA,EAC9B,IAAIA,YAAAA,QAAO,mBAAmB;AAAA,EAC9B,IAAIA,YAAAA,QAAO,mBAAmB;AAAA,EAC9B,IAAIA,YAAAA,QAAO,mBAAmB;AAAA,EAC9B,IAAIA,YAAAA,QAAO,oBAAoB;AACnC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Hero.utils.d.ts","sourceRoot":"","sources":["../../../src/components/Hero/Hero.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAMhE,CAAC"}
1
+ {"version":3,"file":"Hero.utils.d.ts","sourceRoot":"","sources":["../../../src/components/Hero/Hero.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAOhE,CAAC"}
@@ -4,7 +4,8 @@ const headingClassByLevel = {
4
4
  h2: styles["hero__heading--lg"],
5
5
  h3: styles["hero__heading--md"],
6
6
  h4: styles["hero__heading--sm"],
7
- h5: styles["hero__heading--xs"]
7
+ h5: styles["hero__heading--xs"],
8
+ h6: styles["hero__heading--xxs"]
8
9
  };
9
10
  export {
10
11
  headingClassByLevel
@@ -1 +1 @@
1
- {"version":3,"file":"Hero.utils.js","sources":["../../../src/components/Hero/Hero.utils.ts"],"sourcesContent":["import styles from './Hero.module.css';\nimport type { HeroHeadingLevel } from './Hero.types';\n\nexport const headingClassByLevel: Record<HeroHeadingLevel, string> = {\n h1: styles['hero__heading--xl'],\n h2: styles['hero__heading--lg'],\n h3: styles['hero__heading--md'],\n h4: styles['hero__heading--sm'],\n h5: styles['hero__heading--xs'],\n};\n"],"names":[],"mappings":";AAGO,MAAM,sBAAwD;AAAA,EACjE,IAAI,OAAO,mBAAmB;AAAA,EAC9B,IAAI,OAAO,mBAAmB;AAAA,EAC9B,IAAI,OAAO,mBAAmB;AAAA,EAC9B,IAAI,OAAO,mBAAmB;AAAA,EAC9B,IAAI,OAAO,mBAAmB;AAClC;"}
1
+ {"version":3,"file":"Hero.utils.js","sources":["../../../src/components/Hero/Hero.utils.ts"],"sourcesContent":["import styles from './Hero.module.css';\nimport type { HeroHeadingLevel } from './Hero.types';\n\nexport const headingClassByLevel: Record<HeroHeadingLevel, string> = {\n h1: styles['hero__heading--xl'],\n h2: styles['hero__heading--lg'],\n h3: styles['hero__heading--md'],\n h4: styles['hero__heading--sm'],\n h5: styles['hero__heading--xs'],\n h6: styles['hero__heading--xxs'],\n};\n"],"names":[],"mappings":";AAGO,MAAM,sBAAwD;AAAA,EACjE,IAAI,OAAO,mBAAmB;AAAA,EAC9B,IAAI,OAAO,mBAAmB;AAAA,EAC9B,IAAI,OAAO,mBAAmB;AAAA,EAC9B,IAAI,OAAO,mBAAmB;AAAA,EAC9B,IAAI,OAAO,mBAAmB;AAAA,EAC9B,IAAI,OAAO,oBAAoB;AACnC;"}
@@ -2,15 +2,17 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const focus_module = require("../../styles/utils/focus.module.css.cjs");
5
+ const textDecoration_module = require("../../styles/utils/text-decoration.module.css.cjs");
5
6
  const IconButton_module = require("./IconButton.module.css.cjs");
6
7
  const cn = require("../../utils/cn/cn.cjs");
7
8
  const Spinner = require("../Spinner/Spinner.cjs");
8
9
  const IconButton = ({
9
- variant = "default",
10
10
  icon,
11
11
  iconPosition = "start",
12
+ labelBehavior = "truncate",
12
13
  size = "normal",
13
14
  loading = false,
15
+ linkColoring = false,
14
16
  className,
15
17
  children,
16
18
  ref,
@@ -20,15 +22,15 @@ const IconButton = ({
20
22
  const isAnchor = "href" in props && props.href != null;
21
23
  const classes = cn.cn(
22
24
  IconButton_module["icon-button"],
23
- IconButton_module[`icon-button--${variant}`],
24
25
  IconButton_module[`icon-button--${size}`],
25
26
  focus_module.default.focusable,
26
27
  { [IconButton_module["icon-button--disabled"]]: isDisabled },
27
28
  { [IconButton_module["icon-button--loading"]]: loading },
29
+ { [IconButton_module["icon-button--link-coloring"]]: linkColoring },
28
30
  className
29
31
  );
30
32
  const Icon = icon;
31
- const iconSlot = loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: IconButton_module["icon-button__spinner"], "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
33
+ const iconSlot = loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: IconButton_module["icon-button__icon"], "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
32
34
  Spinner.Spinner,
33
35
  {
34
36
  size: size === "small" ? "xs" : "s",
@@ -39,7 +41,15 @@ const IconButton = ({
39
41
  ) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: IconButton_module["icon-button__icon"], "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": "true" }) });
40
42
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
41
43
  iconPosition === "start" && iconSlot,
42
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: IconButton_module["icon-button__label"], children }),
44
+ /* @__PURE__ */ jsxRuntime.jsx(
45
+ "span",
46
+ {
47
+ className: cn.cn(IconButton_module["icon-button__label"], textDecoration_module.default.underlineLink, {
48
+ [IconButton_module["icon-button__label--wrap"]]: labelBehavior === "wrap"
49
+ }),
50
+ children
51
+ }
52
+ ),
43
53
  iconPosition === "end" && iconSlot
44
54
  ] });
45
55
  if (isAnchor) {
@@ -69,7 +79,7 @@ const IconButton = ({
69
79
  className: classes,
70
80
  "aria-busy": loading || void 0,
71
81
  "aria-disabled": loading || void 0,
72
- tabIndex: loading ? -1 : void 0,
82
+ tabIndex: loading ? -1 : safeAnchorProps.tabIndex,
73
83
  onClick: loading ? (e) => {
74
84
  e.preventDefault();
75
85
  e.stopPropagation();
@@ -84,6 +94,7 @@ const IconButton = ({
84
94
  const {
85
95
  type = "button",
86
96
  disabled,
97
+ onClick,
87
98
  href: _href,
88
99
  target: _target,
89
100
  rel: _rel,
@@ -97,7 +108,12 @@ const IconButton = ({
97
108
  type,
98
109
  disabled: disabled || loading,
99
110
  className: classes,
111
+ "aria-disabled": loading || void 0,
100
112
  "aria-busy": loading || void 0,
113
+ onClick: loading ? (e) => {
114
+ e.preventDefault();
115
+ e.stopPropagation();
116
+ } : onClick,
101
117
  ...buttonProps,
102
118
  children: content
103
119
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.cjs","sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, MouseEvent, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport focusStyles from '../../styles/utils/focus.module.css';\nimport { Spinner } from '../Spinner';\nimport styles from './IconButton.module.css';\nimport type { IconButtonProps } from './IconButton.types';\n\nexport const IconButton = ({\n variant = 'default',\n icon,\n iconPosition = 'start',\n size = 'normal',\n loading = false,\n className,\n children,\n ref,\n ...props\n}: IconButtonProps) => {\n const isDisabled = 'disabled' in props && props.disabled;\n const isAnchor = 'href' in props && props.href != null;\n\n const classes = cn(\n styles['icon-button'],\n styles[`icon-button--${variant}`],\n styles[`icon-button--${size}`],\n focusStyles.focusable,\n { [styles['icon-button--disabled']]: isDisabled },\n { [styles['icon-button--loading']]: loading },\n className,\n );\n\n const Icon = icon;\n\n const iconSlot = loading ? (\n <span className={styles['icon-button__spinner']} aria-hidden=\"true\">\n <Spinner\n size={size === 'small' ? 'xs' : 's'}\n color=\"inherit\"\n aria-hidden=\"true\"\n role=\"presentation\"\n />\n </span>\n ) : (\n <span className={styles['icon-button__icon']} aria-hidden=\"true\">\n <Icon aria-hidden=\"true\" />\n </span>\n );\n\n const content = (\n <>\n {iconPosition === 'start' && iconSlot}\n <span className={styles['icon-button__label']}>{children}</span>\n {iconPosition === 'end' && iconSlot}\n </>\n );\n\n if (isAnchor) {\n const { href, renderLink, ...anchorProps } = props as Omit<\n typeof props,\n 'variant' | 'icon' | 'iconPosition' | 'size' | 'loading'\n > & {\n href: string;\n renderLink?: (\n props: AnchorHTMLAttributes<HTMLAnchorElement> & {\n href: string;\n children: ReactNode;\n },\n ) => ReactNode;\n };\n\n const {\n disabled: _disabled,\n type: _type,\n name: _name,\n ...safeAnchorProps\n } = anchorProps as typeof anchorProps & {\n disabled?: boolean;\n type?: 'button' | 'submit' | 'reset';\n name?: string;\n };\n\n const target = safeAnchorProps.target;\n const rel = safeAnchorProps.rel;\n const shouldHardenRel = target?.toLowerCase() === '_blank';\n const relTokens = new Set(\n (rel ?? '')\n .split(/\\s+/)\n .filter(Boolean)\n .map((token) => token.toLowerCase()),\n );\n\n if (shouldHardenRel) {\n relTokens.add('noopener');\n relTokens.add('noreferrer');\n }\n\n const hardenedRel = relTokens.size > 0 ? Array.from(relTokens).join(' ') : undefined;\n\n const linkProps = {\n ...safeAnchorProps,\n ref: ref as Ref<HTMLAnchorElement>,\n href,\n rel: hardenedRel,\n className: classes,\n 'aria-busy': loading || undefined,\n 'aria-disabled': loading || undefined,\n tabIndex: loading ? -1 : undefined,\n onClick: loading\n ? (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }\n : safeAnchorProps.onClick,\n children: content,\n };\n\n if (renderLink) {\n return <>{renderLink(linkProps)}</>;\n }\n\n return <a {...linkProps} />;\n }\n\n const {\n type = 'button',\n disabled,\n href: _href,\n target: _target,\n rel: _rel,\n renderLink: _renderLink,\n ...buttonProps\n } = props as Omit<\n typeof props,\n 'variant' | 'icon' | 'iconPosition' | 'size' | 'loading' | 'href'\n > & {\n type?: 'button' | 'submit' | 'reset';\n disabled?: boolean;\n href?: string;\n target?: string;\n rel?: string;\n renderLink?: unknown;\n };\n\n return (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type={type}\n disabled={disabled || loading}\n className={classes}\n aria-busy={loading || undefined}\n {...buttonProps}\n >\n {content}\n </button>\n );\n};\n"],"names":["cn","styles","focusStyles","jsx","Spinner","jsxs","Fragment"],"mappings":";;;;;;;AAOO,MAAM,aAAa,CAAC;AAAA,EACvB,UAAU;AAAA,EACV;AAAA,EACA,eAAe;AAAA,EACf,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACP,MAAuB;AACnB,QAAM,aAAa,cAAc,SAAS,MAAM;AAChD,QAAM,WAAW,UAAU,SAAS,MAAM,QAAQ;AAElD,QAAM,UAAUA,GAAAA;AAAAA,IACZC,kBAAO,aAAa;AAAA,IACpBA,kBAAO,gBAAgB,OAAO,EAAE;AAAA,IAChCA,kBAAO,gBAAgB,IAAI,EAAE;AAAA,IAC7BC,aAAAA,QAAY;AAAA,IACZ,EAAE,CAACD,kBAAO,uBAAuB,CAAC,GAAG,WAAA;AAAA,IACrC,EAAE,CAACA,kBAAO,sBAAsB,CAAC,GAAG,QAAA;AAAA,IACpC;AAAA,EAAA;AAGJ,QAAM,OAAO;AAEb,QAAM,WAAW,UACbE,2BAAAA,IAAC,QAAA,EAAK,WAAWF,kBAAO,sBAAsB,GAAG,eAAY,QAC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H,CAAC,MAAqC;AAClC,UAAE,eAAA;AACF,UAAE,gBAAA;AAAA,MACN,IACA,gBAAgB;AAAA,MACtB,UAAU;AAAA,IAAA;AAGd,QAAI,YAAY;AACZ,aAAOE,2BAAAA,IAAAG,WAAAA,UAAA,EAAG,UAAA,WAAW,SAAS,GAAE;AAAA,IACpC;AAEA,WAAOH,+BAAC,KAAA,EAAG,GAAG,UAAA,CAAW;AAAA,EAC7B;AAEA,QAAM;AAAA,IACF,OAAO;AAAA,IACP;AAAA,IACA,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,IACH;AAYJ,SACIA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACG;AAAA,MACA;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,WAAW;AAAA,MACX,aAAW,WAAW;AAAA,MACrB,GAAG;AAAA,MAEH,UAAA;AAAA,IAAA;AAAA,EAAA;AAGb;;"}
1
+ {"version":3,"file":"IconButton.cjs","sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, MouseEvent, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport focusStyles from '../../styles/utils/focus.module.css';\nimport textDecorationStyles from '../../styles/utils/text-decoration.module.css';\nimport { Spinner } from '../Spinner';\nimport styles from './IconButton.module.css';\nimport type { IconButtonProps } from './IconButton.types';\n\nexport const IconButton = ({\n icon,\n iconPosition = 'start',\n labelBehavior = 'truncate',\n size = 'normal',\n loading = false,\n linkColoring = false,\n className,\n children,\n ref,\n ...props\n}: IconButtonProps) => {\n const isDisabled = 'disabled' in props && props.disabled;\n const isAnchor = 'href' in props && props.href != null;\n\n const classes = cn(\n styles['icon-button'],\n styles[`icon-button--${size}`],\n focusStyles.focusable,\n { [styles['icon-button--disabled']]: isDisabled },\n { [styles['icon-button--loading']]: loading },\n { [styles['icon-button--link-coloring']]: linkColoring },\n className,\n );\n\n const Icon = icon;\n\n const iconSlot = loading ? (\n <span className={styles['icon-button__icon']} aria-hidden=\"true\">\n <Spinner\n size={size === 'small' ? 'xs' : 's'}\n color=\"inherit\"\n aria-hidden=\"true\"\n role=\"presentation\"\n />\n </span>\n ) : (\n <span className={styles['icon-button__icon']} aria-hidden=\"true\">\n <Icon aria-hidden=\"true\" />\n </span>\n );\n\n const content = (\n <>\n {iconPosition === 'start' && iconSlot}\n <span\n className={cn(styles['icon-button__label'], textDecorationStyles.underlineLink, {\n [styles['icon-button__label--wrap']]: labelBehavior === 'wrap',\n })}\n >\n {children}\n </span>\n {iconPosition === 'end' && iconSlot}\n </>\n );\n\n if (isAnchor) {\n const { href, renderLink, ...anchorProps } = props as Omit<\n typeof props,\n 'icon' | 'iconPosition' | 'size' | 'loading' | 'linkColoring'\n > & {\n href: string;\n renderLink?: (\n props: AnchorHTMLAttributes<HTMLAnchorElement> & {\n href: string;\n children: ReactNode;\n },\n ) => ReactNode;\n };\n\n const {\n disabled: _disabled,\n type: _type,\n name: _name,\n ...safeAnchorProps\n } = anchorProps as typeof anchorProps & {\n disabled?: boolean;\n type?: 'button' | 'submit' | 'reset';\n name?: string;\n };\n\n const target = safeAnchorProps.target;\n const rel = safeAnchorProps.rel;\n const shouldHardenRel = target?.toLowerCase() === '_blank';\n const relTokens = new Set(\n (rel ?? '')\n .split(/\\s+/)\n .filter(Boolean)\n .map((token) => token.toLowerCase()),\n );\n\n if (shouldHardenRel) {\n relTokens.add('noopener');\n relTokens.add('noreferrer');\n }\n\n const hardenedRel = relTokens.size > 0 ? Array.from(relTokens).join(' ') : undefined;\n\n const linkProps = {\n ...safeAnchorProps,\n ref: ref as Ref<HTMLAnchorElement>,\n href,\n rel: hardenedRel,\n className: classes,\n 'aria-busy': loading || undefined,\n 'aria-disabled': loading || undefined,\n tabIndex: loading ? -1 : safeAnchorProps.tabIndex,\n onClick: loading\n ? (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }\n : safeAnchorProps.onClick,\n children: content,\n };\n\n if (renderLink) {\n return <>{renderLink(linkProps)}</>;\n }\n\n return <a {...linkProps} />;\n }\n\n const {\n type = 'button',\n disabled,\n onClick,\n href: _href,\n target: _target,\n rel: _rel,\n renderLink: _renderLink,\n ...buttonProps\n } = props as Omit<\n typeof props,\n 'icon' | 'iconPosition' | 'size' | 'loading' | 'href' | 'linkColoring'\n > & {\n type?: 'button' | 'submit' | 'reset';\n disabled?: boolean;\n href?: string;\n target?: string;\n rel?: string;\n renderLink?: unknown;\n };\n\n return (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type={type}\n disabled={disabled || loading}\n className={classes}\n aria-disabled={loading || undefined}\n aria-busy={loading || undefined}\n onClick={\n loading\n ? (e) => {\n e.preventDefault();\n e.stopPropagation();\n }\n : onClick\n }\n {...buttonProps}\n >\n {content}\n </button>\n );\n};\n"],"names":["cn","styles","focusStyles","jsx","Spinner","jsxs","Fragment","textDecorationStyles"],"mappings":";;;;;;;;AAQO,MAAM,aAAa,CAAC;AAAA,EACvB;AAAA,EACA,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACP,MAAuB;AACnB,QAAM,aAAa,cAAc,SAAS,MAAM;AAChD,QAAM,WAAW,UAAU,SAAS,MAAM,QAAQ;AAElD,QAAM,UAAUA,GAAAA;AAAAA,IACZC,kBAAO,aAAa;AAAA,IACpBA,kBAAO,gBAAgB,IAAI,EAAE;AAAA,IAC7BC,aAAAA,QAAY;AAAA,IACZ,EAAE,CAACD,kBAAO,uBAAuB,CAAC,GAAG,WAAA;AAAA,IACrC,EAAE,CAACA,kBAAO,sBAAsB,CAAC,GAAG,QAAA;AAAA,IACpC,EAAE,CAACA,kBAAO,4BAA4B,CAAC,GAAG,aAAA;AAAA,IAC1C;AAAA,EAAA;AAGJ,QAAM,OAAO;AAEb,Q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Ac,UAAU,OAAO,IAAI,MAAM,KAAK,SAAS,EAAE,KAAK,GAAG,IAAI;AAE3E,UAAM,YAAY;AAAA,MACd,GAAG;AAAA,MACH;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL,WAAW;AAAA,MACX,aAAa,WAAW;AAAA,MACxB,iBAAiB,WAAW;AAAA,MAC5B,UAAU,UAAU,KAAK,gBAAgB;AAAA,MACzC,SAAS,UACH,CAAC,MAAqC;AAClC,UAAE,eAAA;AACF,UAAE,gBAAA;AAAA,MACN,IACA,gBAAgB;AAAA,MACtB,UAAU;AAAA,IAAA;AAGd,QAAI,YAAY;AACZ,aAAOE,2BAAAA,IAAAG,WAAAA,UAAA,EAAG,UAAA,WAAW,SAAS,GAAE;AAAA,IACpC;AAEA,WAAOH,+BAAC,KAAA,EAAG,GAAG,UAAA,CAAW;AAAA,EAC7B;AAEA,QAAM;AAAA,IACF,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,IACH;AAYJ,SACIA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACG;AAAA,MACA;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,WAAW;AAAA,MACX,iBAAe,WAAW;AAAA,MAC1B,aAAW,WAAW;AAAA,MACtB,SACI,UACM,CAAC,MAAM;AACH,UAAE,eAAA;AACF,UAAE,gBAAA;AAAA,MACN,IACA;AAAA,MAET,GAAG;AAAA,MAEH,UAAA;AAAA,IAAA;AAAA,EAAA;AAGb;;"}
@@ -1,10 +1,10 @@
1
- @layer dds-components {._icon-button_1dpxf_1 {
1
+ @layer dds-components {._icon-button_1iv9h_1 {
2
2
  --_button-icon-size: 24px;
3
3
 
4
4
  display: inline-flex;
5
5
  align-items: center;
6
6
  justify-content: center;
7
- gap: var(--spacing-ui-xs);
7
+ gap: var(--spacing-space-8);
8
8
  max-width: 100%;
9
9
  min-width: 0;
10
10
  border: none;
@@ -20,26 +20,37 @@
20
20
  text-decoration-color 0.2s ease-in-out;
21
21
  }
22
22
 
23
- ._icon-button--normal_1dpxf_23 {
23
+ ._icon-button--normal_1iv9h_23 {
24
24
  font: var(--typography-label-lg-bold);
25
25
  --_button-icon-size: 24px;
26
26
  }
27
27
 
28
- ._icon-button--small_1dpxf_28 {
28
+ ._icon-button--small_1iv9h_28 {
29
29
  font: var(--typography-label-md-bold);
30
30
  --_button-icon-size: 20px;
31
31
  }
32
32
 
33
- ._icon-button__label_1dpxf_33 {
33
+ ._icon-button__label_1iv9h_33 {
34
34
  flex: 0 1 auto;
35
35
  min-width: 0;
36
36
  overflow: hidden;
37
37
  text-overflow: ellipsis;
38
38
  white-space: nowrap;
39
+ text-decoration-color: transparent;
40
+ transition: text-decoration-color 0.2s ease-in-out;
41
+ /* exception: override line-height from font shorthand to prevent underline/descender clipping */
42
+ line-height: var(--typography-line-height-md);
39
43
  }
40
44
 
41
- ._icon-button__icon_1dpxf_41,
42
- ._icon-button__spinner_1dpxf_42 {
45
+ ._icon-button__label--wrap_1iv9h_45 {
46
+ overflow: visible;
47
+ text-overflow: clip;
48
+ white-space: normal;
49
+ overflow-wrap: anywhere;
50
+ text-align: left;
51
+ }
52
+
53
+ ._icon-button__icon_1iv9h_53 {
43
54
  display: inline-flex;
44
55
  align-items: center;
45
56
  justify-content: center;
@@ -47,129 +58,122 @@
47
58
  width: var(--_button-icon-size);
48
59
  height: var(--_button-icon-size);
49
60
  color: var(--color-semantic-interactive-primary-default);
50
- }
51
61
 
52
- ._icon-button__icon_1dpxf_41 > svg {
53
- width: var(--_button-icon-size);
54
- height: var(--_button-icon-size);
62
+ & > svg {
63
+ width: var(--_button-icon-size);
64
+ height: var(--_button-icon-size);
65
+ }
55
66
  }
56
67
 
57
- ._icon-button_1dpxf_1:hover ._icon-button__label_1dpxf_33,
58
- ._icon-button_1dpxf_1:focus-visible ._icon-button__label_1dpxf_33 {
59
- text-decoration: underline;
60
- }
68
+ /* Shared interaction states */
69
+ ._icon-button_1iv9h_1:hover,
70
+ ._icon-button_1iv9h_1:focus-visible {
71
+ ._icon-button__label_1iv9h_33 {
72
+ text-decoration-color: currentColor;
73
+ }
61
74
 
62
- ._icon-button_1dpxf_1:hover ._icon-button__icon_1dpxf_41,
63
- ._icon-button_1dpxf_1:hover ._icon-button__spinner_1dpxf_42,
64
- ._icon-button_1dpxf_1:focus-visible ._icon-button__icon_1dpxf_41,
65
- ._icon-button_1dpxf_1:focus-visible ._icon-button__spinner_1dpxf_42 {
66
- color: var(--color-semantic-interactive-primary-hover);
75
+ ._icon-button__icon_1iv9h_53 {
76
+ color: var(--color-semantic-interactive-primary-hover);
77
+ }
67
78
  }
68
79
 
69
- ._icon-button_1dpxf_1:active ._icon-button__icon_1dpxf_41,
70
- ._icon-button_1dpxf_1:active ._icon-button__spinner_1dpxf_42 {
80
+ ._icon-button_1iv9h_1:active ._icon-button__icon_1iv9h_53 {
71
81
  color: var(--color-semantic-interactive-primary-active);
72
82
  }
73
83
 
74
- ._icon-button--default_1dpxf_74 {
75
- color: var(--color-semantic-foreground-default);
76
- }
77
-
78
- ._icon-button--link_1dpxf_78 {
84
+ /* Optional link coloring */
85
+ ._icon-button--link-coloring_1iv9h_85 {
79
86
  color: var(--color-semantic-foreground-link);
80
- }
81
87
 
82
- ._icon-button--link_1dpxf_78 ._icon-button__icon_1dpxf_41,
83
- ._icon-button--link_1dpxf_78 ._icon-button__spinner_1dpxf_42 {
84
- color: var(--color-semantic-foreground-link);
85
- }
88
+ ._icon-button__icon_1iv9h_53 {
89
+ color: var(--color-semantic-foreground-link);
90
+ }
86
91
 
87
- ._icon-button--link_1dpxf_78:hover,
88
- ._icon-button--link_1dpxf_78:focus-visible {
89
- color: var(--color-semantic-foreground-link-hover);
90
- }
92
+ &:hover,
93
+ &:focus-visible {
94
+ color: var(--color-semantic-foreground-link-hover);
91
95
 
92
- ._icon-button--link_1dpxf_78:hover ._icon-button__icon_1dpxf_41,
93
- ._icon-button--link_1dpxf_78:hover ._icon-button__spinner_1dpxf_42,
94
- ._icon-button--link_1dpxf_78:focus-visible ._icon-button__icon_1dpxf_41,
95
- ._icon-button--link_1dpxf_78:focus-visible ._icon-button__spinner_1dpxf_42 {
96
- color: var(--color-semantic-foreground-link-hover);
97
- }
96
+ ._icon-button__icon_1iv9h_53 {
97
+ color: var(--color-semantic-foreground-link-hover);
98
+ }
99
+ }
98
100
 
99
- ._icon-button--link_1dpxf_78:active ._icon-button__icon_1dpxf_41,
100
- ._icon-button--link_1dpxf_78:active ._icon-button__spinner_1dpxf_42 {
101
- color: var(--color-semantic-interactive-primary-active);
101
+ &:active {
102
+ color: var(--color-semantic-interactive-primary-active);
103
+
104
+ ._icon-button__icon_1iv9h_53 {
105
+ color: var(--color-semantic-interactive-primary-active);
106
+ }
107
+ }
102
108
  }
103
109
 
104
- ._icon-button--disabled_1dpxf_104,
105
- ._icon-button--loading_1dpxf_105 {
110
+ /* Disabled/loading states */
111
+ ._icon-button--disabled_1iv9h_111,
112
+ ._icon-button--loading_1iv9h_112 {
106
113
  pointer-events: none;
107
114
  }
108
115
 
109
- ._icon-button--disabled_1dpxf_104 {
116
+ ._icon-button--disabled_1iv9h_111 {
110
117
  color: var(--color-semantic-foreground-muted);
111
- }
112
118
 
113
- ._icon-button--disabled_1dpxf_104 ._icon-button__icon_1dpxf_41,
114
- ._icon-button--disabled_1dpxf_104 ._icon-button__spinner_1dpxf_42 {
115
- color: var(--color-semantic-interactive-primary-disabled);
119
+ ._icon-button__icon_1iv9h_53 {
120
+ color: var(--color-semantic-interactive-primary-disabled);
121
+ }
116
122
  }
117
123
 
124
+ /* Dark scheme overrides */
118
125
  @scope ([data-color-scheme='dark']) to ([data-color-scheme='light']) {
119
- ._icon-button_1dpxf_1 {
126
+ ._icon-button_1iv9h_1 {
120
127
  color: var(--color-semantic-foreground-inverse);
121
128
  }
122
129
 
123
- ._icon-button__icon_1dpxf_41,
124
- ._icon-button__spinner_1dpxf_42 {
130
+ ._icon-button_1iv9h_1 ._icon-button__icon_1iv9h_53 {
125
131
  color: var(--color-semantic-interactive-inverse-default);
126
132
  }
127
133
 
128
- ._icon-button_1dpxf_1:hover ._icon-button__icon_1dpxf_41,
129
- ._icon-button_1dpxf_1:hover ._icon-button__spinner_1dpxf_42,
130
- ._icon-button_1dpxf_1:focus-visible ._icon-button__icon_1dpxf_41,
131
- ._icon-button_1dpxf_1:focus-visible ._icon-button__spinner_1dpxf_42 {
134
+ ._icon-button_1iv9h_1:hover ._icon-button__icon_1iv9h_53,
135
+ ._icon-button_1iv9h_1:focus-visible ._icon-button__icon_1iv9h_53 {
132
136
  color: var(--color-semantic-interactive-inverse-hover);
133
137
  }
134
138
 
135
- ._icon-button_1dpxf_1:active ._icon-button__icon_1dpxf_41,
136
- ._icon-button_1dpxf_1:active ._icon-button__spinner_1dpxf_42 {
139
+ ._icon-button_1iv9h_1:active ._icon-button__icon_1iv9h_53 {
137
140
  color: var(--color-semantic-interactive-inverse-active);
138
141
  }
139
142
 
140
- ._icon-button--default_1dpxf_74 {
143
+ ._icon-button--link-coloring_1iv9h_85 {
141
144
  color: var(--color-semantic-foreground-inverse);
142
- }
143
145
 
144
- ._icon-button--link_1dpxf_78 {
145
- color: var(--color-semantic-foreground-inverse);
146
- }
146
+ ._icon-button__icon_1iv9h_53 {
147
+ color: var(--color-semantic-foreground-inverse);
148
+ }
147
149
 
148
- ._icon-button--link_1dpxf_78 ._icon-button__icon_1dpxf_41,
149
- ._icon-button--link_1dpxf_78 ._icon-button__spinner_1dpxf_42 {
150
- color: var(--color-semantic-interactive-inverse-default);
151
- }
150
+ &:hover,
151
+ &:focus-visible {
152
+ color: var(--color-semantic-foreground-inverse);
152
153
 
153
- ._icon-button--link_1dpxf_78:hover,
154
- ._icon-button--link_1dpxf_78:focus-visible {
155
- color: var(--color-semantic-foreground-inverse);
156
- }
154
+ ._icon-button__icon_1iv9h_53 {
155
+ color: var(--color-semantic-foreground-inverse);
156
+ }
157
+ }
157
158
 
158
- ._icon-button--link_1dpxf_78:hover ._icon-button__icon_1dpxf_41,
159
- ._icon-button--link_1dpxf_78:hover ._icon-button__spinner_1dpxf_42,
160
- ._icon-button--link_1dpxf_78:focus-visible ._icon-button__icon_1dpxf_41,
161
- ._icon-button--link_1dpxf_78:focus-visible ._icon-button__spinner_1dpxf_42 {
162
- color: var(--color-semantic-interactive-inverse-hover);
159
+ &:active {
160
+ color: var(--color-semantic-foreground-inverse);
161
+
162
+ ._icon-button__icon_1iv9h_53 {
163
+ color: var(--color-semantic-foreground-inverse);
164
+ }
165
+ }
163
166
  }
164
167
 
165
- ._icon-button--disabled_1dpxf_104 ._icon-button__icon_1dpxf_41,
166
- ._icon-button--disabled_1dpxf_104 ._icon-button__spinner_1dpxf_42 {
167
- color: var(--color-semantic-interactive-inverse-disabled);
168
+ ._icon-button--disabled_1iv9h_111 {
169
+ ._icon-button__icon_1iv9h_53 {
170
+ color: var(--color-semantic-interactive-inverse-disabled);
171
+ }
168
172
  }
169
173
  }
170
174
 
171
175
  @media (forced-colors: active) {
172
- ._icon-button--small_1dpxf_28:focus-visible {
176
+ ._icon-button--small_1iv9h_28:focus-visible {
173
177
  outline-color: Highlight;
174
178
  box-shadow: none;
175
179
  }
@@ -1,3 +1,3 @@
1
1
  import { IconButtonProps } from './IconButton.types';
2
- export declare const IconButton: ({ variant, icon, iconPosition, size, loading, className, children, ref, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const IconButton: ({ icon, iconPosition, labelBehavior, size, loading, linkColoring, className, children, ref, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=IconButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,eAAO,MAAM,UAAU,GAAI,oFAUxB,eAAe,4CA0IjB,CAAC"}
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,eAAO,MAAM,UAAU,GAAI,wGAWxB,eAAe,4CA0JjB,CAAC"}