@mirohq/design-system-link 2.0.0 → 2.1.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.
- package/dist/main.js.map +1 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +3 -3
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/link.styled.ts","../src/link.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\n\nconst TRANSITION_TIME = '250ms'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst hoverSelector = '&:hover, &[data-hovered]'\n\nexport const StyledLink = styled(Primitive.a, {\n textDecoration: 'none',\n border: 0,\n borderBottom: '1px solid currentColor',\n cursor: 'pointer',\n transition: `border ${TRANSITION_TIME}, color ${TRANSITION_TIME}`,\n paddingX: '2px',\n\n ...focus.css({\n boxShadow: '$focus',\n outline: 'none',\n borderRadius: '2px',\n }),\n\n variants: {\n variant: {\n primary: {\n color: '$text-primary',\n borderColor: '$border-primary',\n [hoverSelector]: {\n color: '$text-primary-hover',\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n },\n [activeSelector]: {\n color: '$text-primary-active',\n backgroundColor: 'transparent',\n borderColor: '$border-primary-active',\n },\n },\n secondary: {\n color: '$text-neutrals-subtle',\n borderColor: '$border-neutrals-text-subtle',\n [hoverSelector]: {\n color: '$text-neutrals-subtle-hover',\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-text-subtle-hover',\n },\n [activeSelector]: {\n color: '$text-neutrals-subtle-active',\n backgroundColor: 'transparent',\n borderColor: '$border-neutrals-text-subtle-active',\n },\n },\n },\n asButton: {\n true: {\n background: 'none',\n paddingY: '$0',\n font: 'inherit',\n },\n },\n },\n})\n\nexport type StyledLinkProps = ComponentPropsWithRef<typeof StyledLink>\n","import React from 'react'\nimport type { ElementRef, ReactNode, DOMAttributes } from 'react'\nimport { mergeProps } from '@react-aria/utils'\nimport { booleanify, removeEventProps } from '@mirohq/design-system-utils'\nimport { useHover } from '@react-aria/interactions'\nimport type { HoverEvents } from '@react-types/shared'\nimport { usePress } from '@mirohq/design-system-use-press'\nimport type { PressProps } from '@mirohq/design-system-use-press'\n\nimport type { StyledLinkProps } from './link.styled'\nimport { StyledLink } from './link.styled'\n\n// DO NOT export it in the index\n// Fix TS2742, option 3.1 in the comment bellow\n// https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189\nexport type { HoverEvents } from '@react-types/shared'\n\nexport interface LinkProps
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/link.styled.ts","../src/link.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\n\nconst TRANSITION_TIME = '250ms'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst hoverSelector = '&:hover, &[data-hovered]'\n\nexport const StyledLink = styled(Primitive.a, {\n textDecoration: 'none',\n border: 0,\n borderBottom: '1px solid currentColor',\n cursor: 'pointer',\n transition: `border ${TRANSITION_TIME}, color ${TRANSITION_TIME}`,\n paddingX: '2px',\n\n ...focus.css({\n boxShadow: '$focus',\n outline: 'none',\n borderRadius: '2px',\n }),\n\n variants: {\n variant: {\n primary: {\n color: '$text-primary',\n borderColor: '$border-primary',\n [hoverSelector]: {\n color: '$text-primary-hover',\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n },\n [activeSelector]: {\n color: '$text-primary-active',\n backgroundColor: 'transparent',\n borderColor: '$border-primary-active',\n },\n },\n secondary: {\n color: '$text-neutrals-subtle',\n borderColor: '$border-neutrals-text-subtle',\n [hoverSelector]: {\n color: '$text-neutrals-subtle-hover',\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-text-subtle-hover',\n },\n [activeSelector]: {\n color: '$text-neutrals-subtle-active',\n backgroundColor: 'transparent',\n borderColor: '$border-neutrals-text-subtle-active',\n },\n },\n },\n asButton: {\n true: {\n background: 'none',\n paddingY: '$0',\n font: 'inherit',\n },\n },\n },\n})\n\nexport type StyledLinkProps = ComponentPropsWithRef<typeof StyledLink>\n","import React from 'react'\nimport type { ElementRef, ReactNode, DOMAttributes } from 'react'\nimport { mergeProps } from '@react-aria/utils'\nimport { booleanify, removeEventProps } from '@mirohq/design-system-utils'\nimport { useHover } from '@react-aria/interactions'\nimport type { HoverEvents } from '@react-types/shared'\nimport { usePress } from '@mirohq/design-system-use-press'\nimport type { PressProps } from '@mirohq/design-system-use-press'\n\nimport type { StyledLinkProps } from './link.styled'\nimport { StyledLink } from './link.styled'\n\n// DO NOT export it in the index\n// Fix TS2742, option 3.1 in the comment bellow\n// https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189\nexport type { HoverEvents } from '@react-types/shared'\n\nexport interface LinkProps\n extends Omit<StyledLinkProps, 'asButton'>,\n PressProps,\n HoverEvents {\n /**\n * The content.\n */\n children: ReactNode\n\n /**\n * Change the link appearance.\n * @default 'primary'\n */\n variant?: StyledLinkProps['variant']\n}\n\nexport const Link = React.forwardRef<ElementRef<'a' | 'button'>, LinkProps>(\n (\n {\n variant = 'primary',\n disabled = false,\n 'aria-disabled': ariaDisabled,\n asChild,\n rel = '',\n target,\n href,\n onClick,\n onPress,\n children,\n tabIndex,\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n ...restProps\n },\n forwardRef\n ) => {\n const asButton = href === undefined && Boolean(onPress ?? onClick)\n let elementProps: DOMAttributes<any> = { ...restProps, onClick }\n\n if (disabled || booleanify(ariaDisabled)) {\n elementProps = removeEventProps(\n elementProps,\n disabled ? [] : ['onBlur', 'onFocus']\n )\n }\n\n const { pressProps } = usePress({\n preventFocusOnPress: true,\n disabled: disabled || booleanify(ariaDisabled),\n onPress,\n ...elementProps,\n })\n\n const { hoverProps, isHovered } = useHover({\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n })\n\n elementProps = mergeProps(pressProps, hoverProps)\n\n let relProp: string | undefined = rel\n\n if (!asButton && target === '_blank') {\n if (!relProp.includes('noreferrer')) {\n relProp = `noreferrer ${relProp}`\n }\n\n if (!relProp.includes('noopener')) {\n relProp = `noopener ${relProp}`\n }\n\n relProp = relProp.trim()\n }\n\n if (relProp === '') {\n relProp = undefined\n }\n\n return (\n <StyledLink\n {...elementProps}\n data-hovered={isHovered ? '' : undefined}\n asChild={asButton || asChild}\n asButton={asButton}\n href={href}\n variant={variant}\n disabled={disabled}\n aria-disabled={\n disabled || booleanify(ariaDisabled) ? 'true' : undefined\n }\n tabIndex={\n tabIndex != null\n ? tabIndex\n : disabled\n ? -1\n : asChild === true || asButton\n ? 0\n : undefined\n }\n rel={relProp}\n target={target}\n // Link can be an <button> but TS will never know because it will only happen in runtime via asChild\n // @ts-expect-error\n ref={forwardRef}\n >\n {/*\n why not use a <button />?\n buttons break the read flow see the link\n https://codepen.io/ivanbanov/pen/WNVXMMx\n */}\n {asButton ? <span role='button'>{children}</span> : children}\n </StyledLink>\n )\n }\n)\n"],"names":["styled","Primitive","focus","React","booleanify","removeEventProps","usePress","useHover","mergeProps","jsx"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,MAAM,eAAkB,GAAA,OAAA,CAAA;AAExB,MAAM,cAAiB,GAAA,2BAAA,CAAA;AACvB,MAAM,aAAgB,GAAA,0BAAA,CAAA;AAET,MAAA,UAAA,GAAaA,2BAAO,CAAAC,+BAAA,CAAU,CAAG,EAAA;AAAA,EAC5C,cAAgB,EAAA,MAAA;AAAA,EAChB,MAAQ,EAAA,CAAA;AAAA,EACR,YAAc,EAAA,wBAAA;AAAA,EACd,MAAQ,EAAA,SAAA;AAAA,EACR,UAAA,EAAY,SAAU,CAAA,MAAA,CAAA,eAA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sx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\n\nconst TRANSITION_TIME = '250ms'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst hoverSelector = '&:hover, &[data-hovered]'\n\nexport const StyledLink = styled(Primitive.a, {\n textDecoration: 'none',\n border: 0,\n borderBottom: '1px solid currentColor',\n cursor: 'pointer',\n transition: `border ${TRANSITION_TIME}, color ${TRANSITION_TIME}`,\n paddingX: '2px',\n\n ...focus.css({\n boxShadow: '$focus',\n outline: 'none',\n borderRadius: '2px',\n }),\n\n variants: {\n variant: {\n primary: {\n color: '$text-primary',\n borderColor: '$border-primary',\n [hoverSelector]: {\n color: '$text-primary-hover',\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n },\n [activeSelector]: {\n color: '$text-primary-active',\n backgroundColor: 'transparent',\n borderColor: '$border-primary-active',\n },\n },\n secondary: {\n color: '$text-neutrals-subtle',\n borderColor: '$border-neutrals-text-subtle',\n [hoverSelector]: {\n color: '$text-neutrals-subtle-hover',\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-text-subtle-hover',\n },\n [activeSelector]: {\n color: '$text-neutrals-subtle-active',\n backgroundColor: 'transparent',\n borderColor: '$border-neutrals-text-subtle-active',\n },\n },\n },\n asButton: {\n true: {\n background: 'none',\n paddingY: '$0',\n font: 'inherit',\n },\n },\n },\n})\n\nexport type StyledLinkProps = ComponentPropsWithRef<typeof StyledLink>\n","import React from 'react'\nimport type { ElementRef, ReactNode, DOMAttributes } from 'react'\nimport { mergeProps } from '@react-aria/utils'\nimport { booleanify, removeEventProps } from '@mirohq/design-system-utils'\nimport { useHover } from '@react-aria/interactions'\nimport type { HoverEvents } from '@react-types/shared'\nimport { usePress } from '@mirohq/design-system-use-press'\nimport type { PressProps } from '@mirohq/design-system-use-press'\n\nimport type { StyledLinkProps } from './link.styled'\nimport { StyledLink } from './link.styled'\n\n// DO NOT export it in the index\n// Fix TS2742, option 3.1 in the comment bellow\n// https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189\nexport type { HoverEvents } from '@react-types/shared'\n\nexport interface LinkProps
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/link.styled.ts","../src/link.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\n\nconst TRANSITION_TIME = '250ms'\n\nconst activeSelector = '&:active, &[data-pressed]'\nconst hoverSelector = '&:hover, &[data-hovered]'\n\nexport const StyledLink = styled(Primitive.a, {\n textDecoration: 'none',\n border: 0,\n borderBottom: '1px solid currentColor',\n cursor: 'pointer',\n transition: `border ${TRANSITION_TIME}, color ${TRANSITION_TIME}`,\n paddingX: '2px',\n\n ...focus.css({\n boxShadow: '$focus',\n outline: 'none',\n borderRadius: '2px',\n }),\n\n variants: {\n variant: {\n primary: {\n color: '$text-primary',\n borderColor: '$border-primary',\n [hoverSelector]: {\n color: '$text-primary-hover',\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n },\n [activeSelector]: {\n color: '$text-primary-active',\n backgroundColor: 'transparent',\n borderColor: '$border-primary-active',\n },\n },\n secondary: {\n color: '$text-neutrals-subtle',\n borderColor: '$border-neutrals-text-subtle',\n [hoverSelector]: {\n color: '$text-neutrals-subtle-hover',\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-text-subtle-hover',\n },\n [activeSelector]: {\n color: '$text-neutrals-subtle-active',\n backgroundColor: 'transparent',\n borderColor: '$border-neutrals-text-subtle-active',\n },\n },\n },\n asButton: {\n true: {\n background: 'none',\n paddingY: '$0',\n font: 'inherit',\n },\n },\n },\n})\n\nexport type StyledLinkProps = ComponentPropsWithRef<typeof StyledLink>\n","import React from 'react'\nimport type { ElementRef, ReactNode, DOMAttributes } from 'react'\nimport { mergeProps } from '@react-aria/utils'\nimport { booleanify, removeEventProps } from '@mirohq/design-system-utils'\nimport { useHover } from '@react-aria/interactions'\nimport type { HoverEvents } from '@react-types/shared'\nimport { usePress } from '@mirohq/design-system-use-press'\nimport type { PressProps } from '@mirohq/design-system-use-press'\n\nimport type { StyledLinkProps } from './link.styled'\nimport { StyledLink } from './link.styled'\n\n// DO NOT export it in the index\n// Fix TS2742, option 3.1 in the comment bellow\n// https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189\nexport type { HoverEvents } from '@react-types/shared'\n\nexport interface LinkProps\n extends Omit<StyledLinkProps, 'asButton'>,\n PressProps,\n HoverEvents {\n /**\n * The content.\n */\n children: ReactNode\n\n /**\n * Change the link appearance.\n * @default 'primary'\n */\n variant?: StyledLinkProps['variant']\n}\n\nexport const Link = React.forwardRef<ElementRef<'a' | 'button'>, LinkProps>(\n (\n {\n variant = 'primary',\n disabled = false,\n 'aria-disabled': ariaDisabled,\n asChild,\n rel = '',\n target,\n href,\n onClick,\n onPress,\n children,\n tabIndex,\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n ...restProps\n },\n forwardRef\n ) => {\n const asButton = href === undefined && Boolean(onPress ?? onClick)\n let elementProps: DOMAttributes<any> = { ...restProps, onClick }\n\n if (disabled || booleanify(ariaDisabled)) {\n elementProps = removeEventProps(\n elementProps,\n disabled ? [] : ['onBlur', 'onFocus']\n )\n }\n\n const { pressProps } = usePress({\n preventFocusOnPress: true,\n disabled: disabled || booleanify(ariaDisabled),\n onPress,\n ...elementProps,\n })\n\n const { hoverProps, isHovered } = useHover({\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n })\n\n elementProps = mergeProps(pressProps, hoverProps)\n\n let relProp: string | undefined = rel\n\n if (!asButton && target === '_blank') {\n if (!relProp.includes('noreferrer')) {\n relProp = `noreferrer ${relProp}`\n }\n\n if (!relProp.includes('noopener')) {\n relProp = `noopener ${relProp}`\n }\n\n relProp = relProp.trim()\n }\n\n if (relProp === '') {\n relProp = undefined\n }\n\n return (\n <StyledLink\n {...elementProps}\n data-hovered={isHovered ? '' : undefined}\n asChild={asButton || asChild}\n asButton={asButton}\n href={href}\n variant={variant}\n disabled={disabled}\n aria-disabled={\n disabled || booleanify(ariaDisabled) ? 'true' : undefined\n }\n tabIndex={\n tabIndex != null\n ? tabIndex\n : disabled\n ? -1\n : asChild === true || asButton\n ? 0\n : undefined\n }\n rel={relProp}\n target={target}\n // Link can be an <button> but TS will never know because it will only happen in runtime via asChild\n // @ts-expect-error\n ref={forwardRef}\n >\n {/*\n why not use a <button />?\n buttons break the read flow see the link\n https://codepen.io/ivanbanov/pen/WNVXMMx\n */}\n {asButton ? <span role='button'>{children}</span> : children}\n </StyledLink>\n )\n }\n)\n"],"names":[],"mappings":";;;;;;;;;;AAKA,MAAM,eAAkB,GAAA,OAAA,CAAA;AAExB,MAAM,cAAiB,GAAA,2BAAA,CAAA;AACvB,MAAM,aAAgB,GAAA,0BAAA,CAAA;AAET,MAAA,UAAA,GAAa,MAAO,CAAA,SAAA,CAAU,CAAG,EAAA;AAAA,EAC5C,cAAgB,EAAA,MAAA;AAAA,EAChB,MAAQ,EAAA,CAAA;AAAA,EACR,YAAc,EAAA,wBAAA;AAAA,EACd,MAAQ,EAAA,SAAA;AAAA,EACR,UAAA,EAAY,SAAU,CAAA,MAAA,CAAA,eAAA,EAAe,UAAW,CAAA,CAAA,MAAA,CAAA,eAAA,CAAA;AAAA,EAChD,QAAU,EAAA,KAAA;AAAA,EAEV,GAAG,MAAM,GAAI,CAAA;AAAA,IACX,SAAW,EAAA,QAAA;AAAA,IACX,OAAS,EAAA,MAAA;AAAA,IACT,YAAc,EAAA,KAAA;AAAA,GACf,CAAA;AAAA,EAED,QAAU,EAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP,OAAS,EAAA;AAAA,QACP,KAAO,EAAA,eAAA;AAAA,QACP,WAAa,EAAA,iBAAA;AAA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,IAAI,YAAY,EAAI,EAAA;AAClB,MAAU,OAAA,GAAA,KAAA,CAAA,CAAA;AAAA,KACZ;AAEA,IACE,uBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACE,GAAG,YAAA;AAAA,QACJ,cAAA,EAAc,YAAY,EAAK,GAAA,KAAA,CAAA;AAAA,QAC/B,SAAS,QAAY,IAAA,OAAA;AAAA,QACrB,QAAA;AAAA,QACA,IAAA;AAAA,QACA,OAAA;AAAA,QACA,QAAA;AAAA,QACA,eACE,EAAA,QAAA,IAAY,UAAW,CAAA,YAAY,IAAI,MAAS,GAAA,KAAA,CAAA;AAAA,QAElD,QAAA,EACE,YAAY,IACR,GAAA,QAAA,GACA,WACA,CACA,CAAA,GAAA,OAAA,KAAY,IAAQ,IAAA,QAAA,GACpB,CACA,GAAA,KAAA,CAAA;AAAA,QAEN,GAAK,EAAA,OAAA;AAAA,QACL,MAAA;AAAA,QAGA,GAAK,EAAA,UAAA;AAAA,QAOJ,qCAAY,GAAA,CAAA,MAAA,EAAA,EAAK,IAAK,EAAA,QAAA,EAAU,UAAS,CAAU,GAAA,QAAA;AAAA,OAAA;AAAA,KACtD,CAAA;AAAA,GAEJ;AACF;;;;"}
|
package/dist/types.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare const StyledLink: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_desi
|
|
|
15
15
|
}, {}>;
|
|
16
16
|
type StyledLinkProps = ComponentPropsWithRef<typeof StyledLink>;
|
|
17
17
|
|
|
18
|
-
interface LinkProps extends StyledLinkProps, PressProps, HoverEvents {
|
|
18
|
+
interface LinkProps extends Omit<StyledLinkProps, 'asButton'>, PressProps, HoverEvents {
|
|
19
19
|
/**
|
|
20
20
|
* The content.
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirohq/design-system-link",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Miro",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@mirohq/design-system-primitive": "^2.0.0",
|
|
33
33
|
"@mirohq/design-system-stitches": "^3.0.0",
|
|
34
34
|
"@mirohq/design-system-styles": "^2.0.0",
|
|
35
|
-
"@mirohq/design-system-use-press": "^1.0.
|
|
36
|
-
"@mirohq/design-system-utils": "^1.
|
|
35
|
+
"@mirohq/design-system-use-press": "^1.0.1",
|
|
36
|
+
"@mirohq/design-system-utils": "^1.1.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "rollup -c ../../../rollup.config.js",
|