@bitrise/bitkit-v2 0.3.485-beta.3137 → 0.3.486

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/AGENTS.md CHANGED
@@ -112,6 +112,7 @@ Bitkit components use consistent prop names across the library:
112
112
  ```
113
113
  `state="loading"` is button-only — not valid in anchor mode.
114
114
  - **`BitkitLink` external convenience** — `BitkitLink` accepts `isExternal` for the same auto target+rel behavior.
115
+ - **Underlined `BitkitLink`** — the link underlines only on hover by default. For a link inside running text, pass `isUnderlined`; don't override `textDecoration="underline"`.
115
116
  - **`BitkitActionMenu.Item` as a link** — pass `href` to make a menu item render as an anchor; `target` and `rel` work the same way as on the button family, and `isExternal` does too except that it also adds the trailing arrow (see below). Without `href` it stays a normal menu item:
116
117
  ```tsx
117
118
  <BitkitActionMenu.Item href="/settings" value="settings">Settings</BitkitActionMenu.Item>
@@ -3,6 +3,11 @@ import { ComponentPropsWithoutRef } from 'react';
3
3
  import { BitkitIconComponent } from '../../icons';
4
4
  export interface BitkitLinkProps extends LinkProps {
5
5
  isExternal?: boolean;
6
+ /**
7
+ * Underlines the link at rest, not only on hover. Use it for a link inside running text, where colour alone
8
+ * wouldn't tell it apart, instead of overriding `textDecoration`.
9
+ */
10
+ isUnderlined?: boolean;
6
11
  suffixIcon?: BitkitIconComponent;
7
12
  suffixIconSize?: ComponentPropsWithoutRef<BitkitIconComponent>['size'];
8
13
  state?: 'disabled';
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitLink.js","names":[],"sources":["../../../lib/components/BitkitLink/BitkitLink.tsx"],"sourcesContent":["import { Link, type LinkProps } from '@chakra-ui/react/link';\nimport { type ComponentPropsWithoutRef, forwardRef, type KeyboardEvent, type MouseEvent } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\n\nexport interface BitkitLinkProps extends LinkProps {\n isExternal?: boolean;\n suffixIcon?: BitkitIconComponent;\n suffixIconSize?: ComponentPropsWithoutRef<BitkitIconComponent>['size'];\n state?: 'disabled';\n}\n\nconst BitkitLink = forwardRef<HTMLAnchorElement, BitkitLinkProps>((props, ref) => {\n const {\n children,\n href,\n isExternal,\n onClick,\n onKeyDown,\n rel,\n suffixIcon: SuffixIcon,\n suffixIconSize,\n state,\n target,\n ...rest\n } = props;\n const isDisabled = state === 'disabled';\n const effectiveTarget = isExternal ? '_blank' : target;\n const effectiveRel = isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel;\n const handleClick = isDisabled\n ? (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }\n : onClick;\n const handleKeyDown = isDisabled\n ? (e: KeyboardEvent<HTMLAnchorElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n : onKeyDown;\n\n return (\n <Link\n aria-disabled={isDisabled || undefined}\n href={isDisabled ? undefined : href}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n ref={ref}\n rel={effectiveRel}\n target={effectiveTarget}\n {...rest}\n >\n {children}\n {SuffixIcon &&\n (suffixIconSize ? <SuffixIcon size={suffixIconSize} /> : <SuffixIcon css={{ height: '1lh', width: '1lh' }} />)}\n </Link>\n );\n});\n\nBitkitLink.displayName = 'BitkitLink';\n\nexport default BitkitLink;\n"],"mappings":";;;;AAYA,IAAM,aAAa,YAAgD,OAAO,QAAQ;CAChF,MAAM,EACJ,UACA,MACA,YACA,SACA,WACA,KACA,YAAY,YACZ,gBACA,OACA,QACA,GAAG,SACD;CACJ,MAAM,aAAa,UAAU;CAC7B,MAAM,kBAAkB,aAAa,WAAW;CAChD,MAAM,eAAe,aAAc,MAAM,GAAG,IAAI,wBAAwB,wBAAyB;CAgBjG,OACE,qBAAC,MAAD;EACE,iBAAe,cAAc,KAAA;EAC7B,MAAM,aAAa,KAAA,IAAY;EAC/B,SAnBgB,cACf,MAAqC;GACpC,EAAE,eAAe;GACjB,EAAE,gBAAgB;EACpB,IACA;EAeA,WAdkB,cACjB,MAAwC;GACvC,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;IACtC,EAAE,eAAe;IACjB,EAAE,gBAAgB;GACpB;EACF,IACA;EAQK;EACL,KAAK;EACL,QAAQ;EACR,GAAI;EARN,UAAA,CAUG,UACA,eACE,iBAAiB,oBAAC,YAAD,EAAY,MAAM,eAAiB,CAAA,IAAI,oBAAC,YAAD,EAAY,KAAK;GAAE,QAAQ;GAAO,OAAO;EAAM,EAAI,CAAA,EAC1G;;AAEV,CAAC;AAED,WAAW,cAAc"}
1
+ {"version":3,"file":"BitkitLink.js","names":[],"sources":["../../../lib/components/BitkitLink/BitkitLink.tsx"],"sourcesContent":["import { Link, type LinkProps } from '@chakra-ui/react/link';\nimport { type ComponentPropsWithoutRef, forwardRef, type KeyboardEvent, type MouseEvent } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\n\nexport interface BitkitLinkProps extends LinkProps {\n isExternal?: boolean;\n /**\n * Underlines the link at rest, not only on hover. Use it for a link inside running text, where colour alone\n * wouldn't tell it apart, instead of overriding `textDecoration`.\n */\n isUnderlined?: boolean;\n suffixIcon?: BitkitIconComponent;\n suffixIconSize?: ComponentPropsWithoutRef<BitkitIconComponent>['size'];\n state?: 'disabled';\n}\n\nconst BitkitLink = forwardRef<HTMLAnchorElement, BitkitLinkProps>((props, ref) => {\n const {\n children,\n href,\n isExternal,\n onClick,\n onKeyDown,\n rel,\n suffixIcon: SuffixIcon,\n suffixIconSize,\n state,\n target,\n ...rest\n } = props;\n const isDisabled = state === 'disabled';\n const effectiveTarget = isExternal ? '_blank' : target;\n const effectiveRel = isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel;\n const handleClick = isDisabled\n ? (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }\n : onClick;\n const handleKeyDown = isDisabled\n ? (e: KeyboardEvent<HTMLAnchorElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n : onKeyDown;\n\n return (\n <Link\n aria-disabled={isDisabled || undefined}\n href={isDisabled ? undefined : href}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n ref={ref}\n rel={effectiveRel}\n target={effectiveTarget}\n {...rest}\n >\n {children}\n {SuffixIcon &&\n (suffixIconSize ? <SuffixIcon size={suffixIconSize} /> : <SuffixIcon css={{ height: '1lh', width: '1lh' }} />)}\n </Link>\n );\n});\n\nBitkitLink.displayName = 'BitkitLink';\n\nexport default BitkitLink;\n"],"mappings":";;;;AAiBA,IAAM,aAAa,YAAgD,OAAO,QAAQ;CAChF,MAAM,EACJ,UACA,MACA,YACA,SACA,WACA,KACA,YAAY,YACZ,gBACA,OACA,QACA,GAAG,SACD;CACJ,MAAM,aAAa,UAAU;CAC7B,MAAM,kBAAkB,aAAa,WAAW;CAChD,MAAM,eAAe,aAAc,MAAM,GAAG,IAAI,wBAAwB,wBAAyB;CAgBjG,OACE,qBAAC,MAAD;EACE,iBAAe,cAAc,KAAA;EAC7B,MAAM,aAAa,KAAA,IAAY;EAC/B,SAnBgB,cACf,MAAqC;GACpC,EAAE,eAAe;GACjB,EAAE,gBAAgB;EACpB,IACA;EAeA,WAdkB,cACjB,MAAwC;GACvC,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;IACtC,EAAE,eAAe;IACjB,EAAE,gBAAgB;GACpB;EACF,IACA;EAQK;EACL,KAAK;EACL,QAAQ;EACR,GAAI;EARN,UAAA,CAUG,UACA,eACE,iBAAiB,oBAAC,YAAD,EAAY,MAAM,eAAiB,CAAA,IAAI,oBAAC,YAAD,EAAY,KAAK;GAAE,QAAQ;GAAO,OAAO;EAAM,EAAI,CAAA,EAC1G;;AAEV,CAAC;AAED,WAAW,cAAc"}
@@ -7,5 +7,10 @@ declare const linkRecipe: import('@chakra-ui/react').RecipeDefinition<{
7
7
  };
8
8
  };
9
9
  };
10
+ isUnderlined: {
11
+ true: {
12
+ textDecoration: "underline";
13
+ };
14
+ };
10
15
  }>;
11
16
  export default linkRecipe;
@@ -16,10 +16,13 @@ var linkRecipe = defineRecipe({
16
16
  alignItems: "center"
17
17
  }
18
18
  },
19
- variants: { colorVariant: { purple: {
20
- color: "text/link",
21
- _hover: { color: "text/link-hover" }
22
- } } }
19
+ variants: {
20
+ colorVariant: { purple: {
21
+ color: "text/link",
22
+ _hover: { color: "text/link-hover" }
23
+ } },
24
+ isUnderlined: { true: { textDecoration: "underline" } }
25
+ }
23
26
  });
24
27
  //#endregion
25
28
  export { linkRecipe as default };
@@ -1 +1 @@
1
- {"version":3,"file":"Link.recipe.js","names":[],"sources":["../../../lib/theme/recipes/Link.recipe.ts"],"sourcesContent":["import { defineRecipe } from '@chakra-ui/react/styled-system';\n\nconst linkRecipe = defineRecipe({\n className: 'link',\n base: {\n color: 'currentcolor',\n _hover: {\n textDecoration: 'underline',\n },\n _disabled: {\n color: 'text/disabled !important',\n cursor: 'not-allowed',\n textDecoration: 'none !important',\n },\n '&:has(svg)': {\n display: 'inline-flex',\n gap: '4',\n alignItems: 'center',\n },\n },\n variants: {\n colorVariant: {\n purple: {\n color: 'text/link',\n _hover: {\n color: 'text/link-hover',\n },\n },\n },\n },\n});\n\nexport default linkRecipe;\n"],"mappings":";;AAEA,IAAM,aAAa,aAAa;CAC9B,WAAW;CACX,MAAM;EACJ,OAAO;EACP,QAAQ,EACN,gBAAgB,YAClB;EACA,WAAW;GACT,OAAO;GACP,QAAQ;GACR,gBAAgB;EAClB;EACA,cAAc;GACZ,SAAS;GACT,KAAK;GACL,YAAY;EACd;CACF;CACA,UAAU,EACR,cAAc,EACZ,QAAQ;EACN,OAAO;EACP,QAAQ,EACN,OAAO,kBACT;CACF,EACF,EACF;AACF,CAAC"}
1
+ {"version":3,"file":"Link.recipe.js","names":[],"sources":["../../../lib/theme/recipes/Link.recipe.ts"],"sourcesContent":["import { defineRecipe } from '@chakra-ui/react/styled-system';\n\nconst linkRecipe = defineRecipe({\n className: 'link',\n base: {\n color: 'currentcolor',\n _hover: {\n textDecoration: 'underline',\n },\n _disabled: {\n color: 'text/disabled !important',\n cursor: 'not-allowed',\n textDecoration: 'none !important',\n },\n '&:has(svg)': {\n display: 'inline-flex',\n gap: '4',\n alignItems: 'center',\n },\n },\n variants: {\n colorVariant: {\n purple: {\n color: 'text/link',\n _hover: {\n color: 'text/link-hover',\n },\n },\n },\n isUnderlined: {\n true: {\n textDecoration: 'underline',\n },\n },\n },\n});\n\nexport default linkRecipe;\n"],"mappings":";;AAEA,IAAM,aAAa,aAAa;CAC9B,WAAW;CACX,MAAM;EACJ,OAAO;EACP,QAAQ,EACN,gBAAgB,YAClB;EACA,WAAW;GACT,OAAO;GACP,QAAQ;GACR,gBAAgB;EAClB;EACA,cAAc;GACZ,SAAS;GACT,KAAK;GACL,YAAY;EACd;CACF;CACA,UAAU;EACR,cAAc,EACZ,QAAQ;GACN,OAAO;GACP,QAAQ,EACN,OAAO,kBACT;EACF,EACF;EACA,cAAc,EACZ,MAAM,EACJ,gBAAgB,YAClB,EACF;CACF;AACF,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit-v2",
3
3
  "private": false,
4
- "version": "0.3.485-beta.3137",
4
+ "version": "0.3.486",
5
5
  "description": "Bitrise Design System Components built with Chakra UI V3",
6
6
  "keywords": [
7
7
  "react",