@cimpress-ui/react 1.33.1 → 1.34.1

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 (43) hide show
  1. package/dist/commonjs/components/button/button.d.ts +12 -1
  2. package/dist/commonjs/components/button/button.d.ts.map +1 -1
  3. package/dist/commonjs/components/button/button.js +6 -2
  4. package/dist/commonjs/components/button/button.js.map +1 -1
  5. package/dist/commonjs/components/button/disabled-with-reason.d.ts +2 -0
  6. package/dist/commonjs/components/button/disabled-with-reason.d.ts.map +1 -0
  7. package/dist/commonjs/components/button/disabled-with-reason.js +43 -0
  8. package/dist/commonjs/components/button/disabled-with-reason.js.map +1 -0
  9. package/dist/commonjs/components/button/icon-button.d.ts +12 -1
  10. package/dist/commonjs/components/button/icon-button.d.ts.map +1 -1
  11. package/dist/commonjs/components/button/icon-button.js +6 -2
  12. package/dist/commonjs/components/button/icon-button.js.map +1 -1
  13. package/dist/commonjs/components/button/icon-link-button.d.ts +12 -1
  14. package/dist/commonjs/components/button/icon-link-button.d.ts.map +1 -1
  15. package/dist/commonjs/components/button/icon-link-button.js +8 -1
  16. package/dist/commonjs/components/button/icon-link-button.js.map +1 -1
  17. package/dist/commonjs/components/button/link-button.d.ts +12 -1
  18. package/dist/commonjs/components/button/link-button.d.ts.map +1 -1
  19. package/dist/commonjs/components/button/link-button.js +8 -1
  20. package/dist/commonjs/components/button/link-button.js.map +1 -1
  21. package/dist/esm/components/button/button.d.ts +12 -1
  22. package/dist/esm/components/button/button.d.ts.map +1 -1
  23. package/dist/esm/components/button/button.js +6 -2
  24. package/dist/esm/components/button/button.js.map +1 -1
  25. package/dist/esm/components/button/disabled-with-reason.d.ts +2 -0
  26. package/dist/esm/components/button/disabled-with-reason.d.ts.map +1 -0
  27. package/dist/esm/components/button/disabled-with-reason.js +39 -0
  28. package/dist/esm/components/button/disabled-with-reason.js.map +1 -0
  29. package/dist/esm/components/button/icon-button.d.ts +12 -1
  30. package/dist/esm/components/button/icon-button.d.ts.map +1 -1
  31. package/dist/esm/components/button/icon-button.js +6 -2
  32. package/dist/esm/components/button/icon-button.js.map +1 -1
  33. package/dist/esm/components/button/icon-link-button.d.ts +12 -1
  34. package/dist/esm/components/button/icon-link-button.d.ts.map +1 -1
  35. package/dist/esm/components/button/icon-link-button.js +8 -1
  36. package/dist/esm/components/button/icon-link-button.js.map +1 -1
  37. package/dist/esm/components/button/link-button.d.ts +12 -1
  38. package/dist/esm/components/button/link-button.d.ts.map +1 -1
  39. package/dist/esm/components/button/link-button.js +8 -1
  40. package/dist/esm/components/button/link-button.js.map +1 -1
  41. package/dist-styles/core.css +1 -1
  42. package/dist-styles/styles.css +1 -1
  43. package/package.json +1 -1
@@ -4,8 +4,15 @@ import clsx from 'clsx';
4
4
  import { Link as RACLink } from 'react-aria-components';
5
5
  import { forwardRef } from '../../forward-ref.js';
6
6
  import { withStyleProps } from '../../with-style-props.js';
7
+ import { IconButton } from './icon-button.js';
7
8
  function IconLinkButton({ icon, variant = 'secondary', tone = 'base', size = 'medium', isDisabled = false, fullWidth = false, UNSAFE_className, UNSAFE_style, ...props }, ref) {
8
- return (_jsx(RACLink, { ...props, ref: ref, className: clsx('cim-icon-button', UNSAFE_className), style: UNSAFE_style, "data-variant": variant, "data-tone": tone, "data-size": size, "data-full-width": fullWidth || undefined, isDisabled: isDisabled, children: icon }));
9
+ const hasDisabledReason = typeof isDisabled === 'object' && isDisabled.reason !== '';
10
+ if (hasDisabledReason) {
11
+ // `RACLink` doesn't support aria-disabled while keeping interactivity, so we render an `IconButton` instead
12
+ const { href, target, hrefLang, download, ping, referrerPolicy, rel, routerOptions, ...buttonProps } = props;
13
+ return (_jsx(IconButton, { ...buttonProps, icon: icon, variant: variant, tone: tone, size: size, isDisabled: isDisabled, fullWidth: fullWidth, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style }));
14
+ }
15
+ return (_jsx(RACLink, { ...props, ref: ref, className: clsx('cim-icon-button', UNSAFE_className), style: UNSAFE_style, "data-variant": variant, "data-tone": tone, "data-size": size, "data-full-width": fullWidth || undefined, isDisabled: !!isDisabled, children: icon }));
9
16
  }
10
17
  /**
11
18
  * Displays an icon-only button that allows users to navigate to another page or resource.
@@ -1 +1 @@
1
- {"version":3,"file":"icon-link-button.js","sourceRoot":"","sources":["../../../../src/components/button/icon-link-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,IAAI,IAAI,OAAO,EAAkC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAW3D,SAAS,cAAc,CACrB,EACE,IAAI,EACJ,OAAO,GAAG,WAAW,EACrB,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,QAAQ,EACf,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACY,EACtB,GAAoC;IAEpC,OAAO,CACL,KAAC,OAAO,OACF,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,EACpD,KAAK,EAAE,YAAY,kBACL,OAAO,eACV,IAAI,eACJ,IAAI,qBACE,SAAS,IAAI,SAAS,EACvC,UAAU,EAAE,UAAU,YAErB,IAAI,GACG,CACX,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,eAAe,GAAG,cAAc,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC,CAAC;AAErF,OAAO,EAAE,eAAe,IAAI,cAAc,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Link as RACLink, type LinkProps as RACLinkProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { NavigationProps, WithRequired } from '../types.js';\nimport type { BaseButtonProps, SingleIconButtonProps } from './types.js';\n\nexport interface IconLinkButtonProps\n extends\n Omit<BaseButtonProps, 'id'>,\n SingleIconButtonProps,\n WithRequired<NavigationProps, 'href'>,\n Pick<RACLinkProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {}\n\nfunction IconLinkButton(\n {\n icon,\n variant = 'secondary',\n tone = 'base',\n size = 'medium',\n isDisabled = false,\n fullWidth = false,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: IconLinkButtonProps,\n ref: ForwardedRef<HTMLAnchorElement>,\n) {\n return (\n <RACLink\n {...props}\n ref={ref}\n className={clsx('cim-icon-button', UNSAFE_className)}\n style={UNSAFE_style}\n data-variant={variant}\n data-tone={tone}\n data-size={size}\n data-full-width={fullWidth || undefined}\n isDisabled={isDisabled}\n >\n {icon}\n </RACLink>\n );\n}\n\n/**\n * Displays an icon-only button that allows users to navigate to another page or resource.\n *\n * See [button usage guidelines](https://ui.cimpress.io/components/button/).\n */\nconst _IconLinkButton = withStyleProps(forwardRef(IconLinkButton), 'IconLinkButton');\n\nexport { _IconLinkButton as IconLinkButton };\n"]}
1
+ {"version":3,"file":"icon-link-button.js","sourceRoot":"","sources":["../../../../src/components/button/icon-link-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,IAAI,IAAI,OAAO,EAAkC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAoB9C,SAAS,cAAc,CACrB,EACE,IAAI,EACJ,OAAO,GAAG,WAAW,EACrB,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,QAAQ,EACf,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACY,EACtB,GAAoC;IAEpC,MAAM,iBAAiB,GAAG,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,MAAM,KAAK,EAAE,CAAC;IAErF,IAAI,iBAAiB,EAAE,CAAC;QACtB,4GAA4G;QAC5G,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;QAE7G,OAAO,CACL,KAAC,UAAU,OACL,WAAW,EACf,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,OAAO,OACF,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,EACpD,KAAK,EAAE,YAAY,kBACL,OAAO,eACV,IAAI,eACJ,IAAI,qBACE,SAAS,IAAI,SAAS,EACvC,UAAU,EAAE,CAAC,CAAC,UAAU,YAEvB,IAAI,GACG,CACX,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,eAAe,GAAG,cAAc,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC,CAAC;AAErF,OAAO,EAAE,eAAe,IAAI,cAAc,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Link as RACLink, type LinkProps as RACLinkProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { NavigationProps, WithRequired } from '../types.js';\nimport { IconButton } from './icon-button.js';\nimport type { BaseButtonProps, SingleIconButtonProps } from './types.js';\n\nexport interface IconLinkButtonProps\n extends\n Omit<BaseButtonProps, 'id'>,\n SingleIconButtonProps,\n WithRequired<NavigationProps, 'href'>,\n Pick<RACLinkProps, 'onHoverStart' | 'onHoverEnd'> {\n /**\n * Whether the button is disabled.\n *\n * Optionally, you can provide an object with the `reason` property explaining why the button is disabled.\n * This information will be shown to the end-users as a tooltip or a popover.\n *\n * @default false\n */\n isDisabled?: boolean | { reason: string };\n}\n\nfunction IconLinkButton(\n {\n icon,\n variant = 'secondary',\n tone = 'base',\n size = 'medium',\n isDisabled = false,\n fullWidth = false,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: IconLinkButtonProps,\n ref: ForwardedRef<HTMLAnchorElement>,\n) {\n const hasDisabledReason = typeof isDisabled === 'object' && isDisabled.reason !== '';\n\n if (hasDisabledReason) {\n // `RACLink` doesn't support aria-disabled while keeping interactivity, so we render an `IconButton` instead\n const { href, target, hrefLang, download, ping, referrerPolicy, rel, routerOptions, ...buttonProps } = props;\n\n return (\n <IconButton\n {...buttonProps}\n icon={icon}\n variant={variant}\n tone={tone}\n size={size}\n isDisabled={isDisabled}\n fullWidth={fullWidth}\n UNSAFE_className={UNSAFE_className}\n UNSAFE_style={UNSAFE_style}\n />\n );\n }\n\n return (\n <RACLink\n {...props}\n ref={ref}\n className={clsx('cim-icon-button', UNSAFE_className)}\n style={UNSAFE_style}\n data-variant={variant}\n data-tone={tone}\n data-size={size}\n data-full-width={fullWidth || undefined}\n isDisabled={!!isDisabled}\n >\n {icon}\n </RACLink>\n );\n}\n\n/**\n * Displays an icon-only button that allows users to navigate to another page or resource.\n *\n * See [button usage guidelines](https://ui.cimpress.io/components/button/).\n */\nconst _IconLinkButton = withStyleProps(forwardRef(IconLinkButton), 'IconLinkButton');\n\nexport { _IconLinkButton as IconLinkButton };\n"]}
@@ -1,7 +1,18 @@
1
1
  import { type LinkProps as RACLinkProps } from 'react-aria-components';
2
2
  import type { NavigationProps, WithRequired } from '../types.js';
3
3
  import type { BaseButtonProps, TextButtonProps } from './types.js';
4
- export interface LinkButtonProps extends Omit<BaseButtonProps, 'id'>, TextButtonProps, WithRequired<NavigationProps, 'href'>, Pick<RACLinkProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
4
+ export interface LinkButtonProps extends Omit<BaseButtonProps, 'id'>, TextButtonProps, WithRequired<NavigationProps, 'href'>, Pick<RACLinkProps, 'onHoverStart' | 'onHoverEnd'> {
5
+ /**
6
+ * Whether the button is disabled.
7
+ *
8
+ * Optionally, you can provide an object with the `reason` property explaining why the button is disabled.
9
+ * This information will be shown to the end-users as a tooltip or a popover.
10
+ *
11
+ * @default false
12
+ */
13
+ isDisabled?: boolean | {
14
+ reason: string;
15
+ };
5
16
  }
6
17
  /**
7
18
  * Displays a labelled button that allows users to navigate to another page or resource.
@@ -1 +1 @@
1
- {"version":3,"file":"link-button.d.ts","sourceRoot":"","sources":["../../../../src/components/button/link-button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,WAAW,eACf,SACE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,EAC3B,eAAe,EACf,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,EACrC,IAAI,CAAC,YAAY,EAAE,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;CAAG;AAqCvE;;;;GAIG;AACH,QAAA,MAAM,WAAW,oKAAuD,CAAC;AAEzE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"link-button.d.ts","sourceRoot":"","sources":["../../../../src/components/button/link-button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,WAAW,eACf,SACE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,EAC3B,eAAe,EACf,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,EACrC,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,YAAY,CAAC;IACnD;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AA6DD;;;;GAIG;AACH,QAAA,MAAM,WAAW,oKAAuD,CAAC;AAEzE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC"}
@@ -4,8 +4,15 @@ import clsx from 'clsx';
4
4
  import { Link as RACLink } from 'react-aria-components';
5
5
  import { forwardRef } from '../../forward-ref.js';
6
6
  import { withStyleProps } from '../../with-style-props.js';
7
+ import { Button } from './button.js';
7
8
  function LinkButton({ children, variant = 'secondary', tone = 'base', size = 'medium', iconStart, iconEnd, isDisabled = false, fullWidth = false, UNSAFE_className, UNSAFE_style, ...props }, ref) {
8
- return (_jsxs(RACLink, { ...props, ref: ref, className: clsx('cim-button', UNSAFE_className), style: UNSAFE_style, "data-variant": variant, "data-tone": tone, "data-size": size, "data-full-width": fullWidth || undefined, isDisabled: isDisabled, children: [iconStart, _jsx("span", { className: "cim-button-text", children: children }), iconEnd] }));
9
+ const hasDisabledReason = typeof isDisabled === 'object' && isDisabled.reason !== '';
10
+ if (hasDisabledReason) {
11
+ // `RACLink` doesn't support aria-disabled while keeping interactivity, so we render a `Button` instead
12
+ const { href, target, hrefLang, download, ping, referrerPolicy, rel, routerOptions, ...buttonProps } = props;
13
+ return (_jsx(Button, { ...buttonProps, variant: variant, tone: tone, size: size, iconStart: iconStart, iconEnd: iconEnd, isDisabled: isDisabled, fullWidth: fullWidth, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style, children: children }));
14
+ }
15
+ return (_jsxs(RACLink, { ...props, ref: ref, className: clsx('cim-button', UNSAFE_className), style: UNSAFE_style, "data-variant": variant, "data-tone": tone, "data-size": size, "data-full-width": fullWidth || undefined, isDisabled: !!isDisabled, children: [iconStart, _jsx("span", { className: "cim-button-text", children: children }), iconEnd] }));
9
16
  }
10
17
  /**
11
18
  * Displays a labelled button that allows users to navigate to another page or resource.
@@ -1 +1 @@
1
- {"version":3,"file":"link-button.js","sourceRoot":"","sources":["../../../../src/components/button/link-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,IAAI,IAAI,OAAO,EAAkC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAW3D,SAAS,UAAU,CACjB,EACE,QAAQ,EACR,OAAO,GAAG,WAAW,EACrB,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,OAAO,EACP,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACQ,EAClB,GAAoC;IAEpC,OAAO,CACL,MAAC,OAAO,OACF,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,EAC/C,KAAK,EAAE,YAAY,kBACL,OAAO,eACV,IAAI,eACJ,IAAI,qBACE,SAAS,IAAI,SAAS,EACvC,UAAU,EAAE,UAAU,aAErB,SAAS,EACV,eAAM,SAAS,EAAC,iBAAiB,YAAE,QAAQ,GAAQ,EAClD,OAAO,IACA,CACX,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,WAAW,GAAG,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC;AAEzE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Link as RACLink, type LinkProps as RACLinkProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { NavigationProps, WithRequired } from '../types.js';\nimport type { BaseButtonProps, TextButtonProps } from './types.js';\n\nexport interface LinkButtonProps\n extends\n Omit<BaseButtonProps, 'id'>,\n TextButtonProps,\n WithRequired<NavigationProps, 'href'>,\n Pick<RACLinkProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {}\n\nfunction LinkButton(\n {\n children,\n variant = 'secondary',\n tone = 'base',\n size = 'medium',\n iconStart,\n iconEnd,\n isDisabled = false,\n fullWidth = false,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: LinkButtonProps,\n ref: ForwardedRef<HTMLAnchorElement>,\n) {\n return (\n <RACLink\n {...props}\n ref={ref}\n className={clsx('cim-button', UNSAFE_className)}\n style={UNSAFE_style}\n data-variant={variant}\n data-tone={tone}\n data-size={size}\n data-full-width={fullWidth || undefined}\n isDisabled={isDisabled}\n >\n {iconStart}\n <span className=\"cim-button-text\">{children}</span>\n {iconEnd}\n </RACLink>\n );\n}\n\n/**\n * Displays a labelled button that allows users to navigate to another page or resource.\n *\n * See [button usage guidelines](https://ui.cimpress.io/components/button/).\n */\nconst _LinkButton = withStyleProps(forwardRef(LinkButton), 'LinkButton');\n\nexport { _LinkButton as LinkButton };\n"]}
1
+ {"version":3,"file":"link-button.js","sourceRoot":"","sources":["../../../../src/components/button/link-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,IAAI,IAAI,OAAO,EAAkC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAoBrC,SAAS,UAAU,CACjB,EACE,QAAQ,EACR,OAAO,GAAG,WAAW,EACrB,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,OAAO,EACP,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACQ,EAClB,GAAoC;IAEpC,MAAM,iBAAiB,GAAG,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,MAAM,KAAK,EAAE,CAAC;IAErF,IAAI,iBAAiB,EAAE,CAAC;QACtB,uGAAuG;QACvG,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;QAE7G,OAAO,CACL,KAAC,MAAM,OACD,WAAW,EACf,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,YAEzB,QAAQ,GACF,CACV,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAC,OAAO,OACF,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,EAC/C,KAAK,EAAE,YAAY,kBACL,OAAO,eACV,IAAI,eACJ,IAAI,qBACE,SAAS,IAAI,SAAS,EACvC,UAAU,EAAE,CAAC,CAAC,UAAU,aAEvB,SAAS,EACV,eAAM,SAAS,EAAC,iBAAiB,YAAE,QAAQ,GAAQ,EAClD,OAAO,IACA,CACX,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,WAAW,GAAG,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC;AAEzE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Link as RACLink, type LinkProps as RACLinkProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { NavigationProps, WithRequired } from '../types.js';\nimport { Button } from './button.js';\nimport type { BaseButtonProps, TextButtonProps } from './types.js';\n\nexport interface LinkButtonProps\n extends\n Omit<BaseButtonProps, 'id'>,\n TextButtonProps,\n WithRequired<NavigationProps, 'href'>,\n Pick<RACLinkProps, 'onHoverStart' | 'onHoverEnd'> {\n /**\n * Whether the button is disabled.\n *\n * Optionally, you can provide an object with the `reason` property explaining why the button is disabled.\n * This information will be shown to the end-users as a tooltip or a popover.\n *\n * @default false\n */\n isDisabled?: boolean | { reason: string };\n}\n\nfunction LinkButton(\n {\n children,\n variant = 'secondary',\n tone = 'base',\n size = 'medium',\n iconStart,\n iconEnd,\n isDisabled = false,\n fullWidth = false,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: LinkButtonProps,\n ref: ForwardedRef<HTMLAnchorElement>,\n) {\n const hasDisabledReason = typeof isDisabled === 'object' && isDisabled.reason !== '';\n\n if (hasDisabledReason) {\n // `RACLink` doesn't support aria-disabled while keeping interactivity, so we render a `Button` instead\n const { href, target, hrefLang, download, ping, referrerPolicy, rel, routerOptions, ...buttonProps } = props;\n\n return (\n <Button\n {...buttonProps}\n variant={variant}\n tone={tone}\n size={size}\n iconStart={iconStart}\n iconEnd={iconEnd}\n isDisabled={isDisabled}\n fullWidth={fullWidth}\n UNSAFE_className={UNSAFE_className}\n UNSAFE_style={UNSAFE_style}\n >\n {children}\n </Button>\n );\n }\n\n return (\n <RACLink\n {...props}\n ref={ref}\n className={clsx('cim-button', UNSAFE_className)}\n style={UNSAFE_style}\n data-variant={variant}\n data-tone={tone}\n data-size={size}\n data-full-width={fullWidth || undefined}\n isDisabled={!!isDisabled}\n >\n {iconStart}\n <span className=\"cim-button-text\">{children}</span>\n {iconEnd}\n </RACLink>\n );\n}\n\n/**\n * Displays a labelled button that allows users to navigate to another page or resource.\n *\n * See [button usage guidelines](https://ui.cimpress.io/components/button/).\n */\nconst _LinkButton = withStyleProps(forwardRef(LinkButton), 'LinkButton');\n\nexport { _LinkButton as LinkButton };\n"]}