@bitrise/bitkit-v2 0.3.510 → 0.3.511

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.
@@ -1,4 +1,5 @@
1
1
  import { useUISideNavContext } from "./UISideNavContext.js";
2
+ import uiSideNavPart from "./uiSideNavPart.js";
2
3
  import { chakra } from "@chakra-ui/react/styled-system";
3
4
  import { forwardRef } from "react";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -16,7 +17,10 @@ var UISideNavItem = forwardRef((props, ref) => {
16
17
  ...rest,
17
18
  css: [styles.item, css],
18
19
  children: [
19
- /* @__PURE__ */ jsx(RowIcon, { css: styles.itemIcon }),
20
+ /* @__PURE__ */ jsx(RowIcon, {
21
+ css: styles.itemIcon,
22
+ ...uiSideNavPart("item-icon")
23
+ }),
20
24
  /* @__PURE__ */ jsx(Text, {
21
25
  as: "span",
22
26
  css: styles.itemLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"UISideNavItem.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/UISideNavItem.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { chakra, type HTMLChakraProps } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport { useUISideNavContext } from './UISideNavContext';\n\nexport interface BitkitUISideNavItemProps extends Omit<HTMLChakraProps<'a'>, 'children'> {\n /**\n * The destination. Always an anchor: the platform navigation moves between server-rendered\n * product areas, so every row is a real link rather than a button with a handler.\n */\n href: string;\n /**\n * The row's label. A string rather than `ReactNode` because the collapsed rail clips it and\n * the expanded rail truncates it, neither of which survives arbitrary markup.\n */\n children: string;\n /** Shown at rest. In the collapsed rail this is the only thing visible. */\n icon: BitkitIconComponent;\n /** Marks the row as the current product area. The consumer decides what counts as current. */\n selected?: boolean;\n /**\n * Swapped in for `icon` while selected. The design pairs an outline icon with its filled\n * counterpart, e.g. `IconDashboard` with `IconDashboardFilled`. Without it the outline icon\n * stays and only the row's colour and marker change.\n */\n selectedIcon?: BitkitIconComponent;\n}\n\nconst UISideNavItem = forwardRef<HTMLAnchorElement, BitkitUISideNavItemProps>((props, ref) => {\n const { children, css, icon: Icon, selected, selectedIcon: SelectedIcon, ...rest } = props;\n\n const { styles } = useUISideNavContext();\n\n const RowIcon = selected && SelectedIcon ? SelectedIcon : Icon;\n\n // `chakra.a` rather than `Link`: the row is styled entirely by the nav's own `item` slot, and\n // `Link` would layer its own recipe over it.\n return (\n <chakra.a\n ref={ref}\n aria-current={selected ? 'page' : undefined}\n data-selected={selected ? '' : undefined}\n {...rest}\n css={[styles.item, css]}\n >\n <RowIcon css={styles.itemIcon} />\n <Text as=\"span\" css={styles.itemLabel}>\n {children}\n </Text>\n {selected && <Box css={styles.itemIndicator} />}\n </chakra.a>\n );\n});\n\nUISideNavItem.displayName = 'BitkitUISideNav.Item';\n\nexport default UISideNavItem;\n"],"mappings":";;;;;;;AA+BA,IAAM,gBAAgB,YAAyD,OAAO,QAAQ;CAC5F,MAAM,EAAE,UAAU,KAAK,MAAM,MAAM,UAAU,cAAc,cAAc,GAAG,SAAS;CAErF,MAAM,EAAE,WAAW,oBAAoB;CAEvC,MAAM,UAAU,YAAY,eAAe,eAAe;CAI1D,OACE,qBAAC,OAAO,GAAR;EACO;EACL,gBAAc,WAAW,SAAS,KAAA;EAClC,iBAAe,WAAW,KAAK,KAAA;EAC/B,GAAI;EACJ,KAAK,CAAC,OAAO,MAAM,GAAG;EALxB,UAAA;GAOE,oBAAC,SAAD,EAAS,KAAK,OAAO,SAAW,CAAA;GAChC,oBAAC,MAAD;IAAM,IAAG;IAAO,KAAK,OAAO;IACzB;GACG,CAAA;GACL,YAAY,oBAAC,KAAD,EAAK,KAAK,OAAO,cAAgB,CAAA;EACtC;;AAEd,CAAC;AAED,cAAc,cAAc"}
1
+ {"version":3,"file":"UISideNavItem.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/UISideNavItem.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { chakra, type HTMLChakraProps } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport { useUISideNavContext } from './UISideNavContext';\nimport uiSideNavPart from './uiSideNavPart';\n\nexport interface BitkitUISideNavItemProps extends Omit<HTMLChakraProps<'a'>, 'children'> {\n /**\n * The destination. Always an anchor: the platform navigation moves between server-rendered\n * product areas, so every row is a real link rather than a button with a handler.\n */\n href: string;\n /**\n * The row's label. A string rather than `ReactNode` because the collapsed rail clips it and\n * the expanded rail truncates it, neither of which survives arbitrary markup.\n */\n children: string;\n /** Shown at rest. In the collapsed rail this is the only thing visible. */\n icon: BitkitIconComponent;\n /** Marks the row as the current product area. The consumer decides what counts as current. */\n selected?: boolean;\n /**\n * Swapped in for `icon` while selected. The design pairs an outline icon with its filled\n * counterpart, e.g. `IconDashboard` with `IconDashboardFilled`. Without it the outline icon\n * stays and only the row's colour and marker change.\n */\n selectedIcon?: BitkitIconComponent;\n}\n\nconst UISideNavItem = forwardRef<HTMLAnchorElement, BitkitUISideNavItemProps>((props, ref) => {\n const { children, css, icon: Icon, selected, selectedIcon: SelectedIcon, ...rest } = props;\n\n const { styles } = useUISideNavContext();\n\n const RowIcon = selected && SelectedIcon ? SelectedIcon : Icon;\n\n // `chakra.a` rather than `Link`: the row is styled entirely by the nav's own `item` slot, and\n // `Link` would layer its own recipe over it.\n return (\n <chakra.a\n ref={ref}\n aria-current={selected ? 'page' : undefined}\n data-selected={selected ? '' : undefined}\n {...rest}\n css={[styles.item, css]}\n >\n <RowIcon css={styles.itemIcon} {...uiSideNavPart('item-icon')} />\n <Text as=\"span\" css={styles.itemLabel}>\n {children}\n </Text>\n {selected && <Box css={styles.itemIndicator} />}\n </chakra.a>\n );\n});\n\nUISideNavItem.displayName = 'BitkitUISideNav.Item';\n\nexport default UISideNavItem;\n"],"mappings":";;;;;;;;AAgCA,IAAM,gBAAgB,YAAyD,OAAO,QAAQ;CAC5F,MAAM,EAAE,UAAU,KAAK,MAAM,MAAM,UAAU,cAAc,cAAc,GAAG,SAAS;CAErF,MAAM,EAAE,WAAW,oBAAoB;CAEvC,MAAM,UAAU,YAAY,eAAe,eAAe;CAI1D,OACE,qBAAC,OAAO,GAAR;EACO;EACL,gBAAc,WAAW,SAAS,KAAA;EAClC,iBAAe,WAAW,KAAK,KAAA;EAC/B,GAAI;EACJ,KAAK,CAAC,OAAO,MAAM,GAAG;EALxB,UAAA;GAOE,oBAAC,SAAD;IAAS,KAAK,OAAO;IAAU,GAAI,cAAc,WAAW;GAAI,CAAA;GAChE,oBAAC,MAAD;IAAM,IAAG;IAAO,KAAK,OAAO;IACzB;GACG,CAAA;GACL,YAAY,oBAAC,KAAD,EAAK,KAAK,OAAO,cAAgB,CAAA;EACtC;;AAEd,CAAC;AAED,cAAc,cAAc"}
@@ -1,5 +1,6 @@
1
1
  import IconArrowNortheast from "../../icons/IconArrowNortheast.js";
2
2
  import { useUISideNavContext } from "./UISideNavContext.js";
3
+ import uiSideNavPart from "./uiSideNavPart.js";
3
4
  import { chakra } from "@chakra-ui/react/styled-system";
4
5
  import { forwardRef } from "react";
5
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -12,7 +13,10 @@ var UISideNavLink = forwardRef((props, ref) => {
12
13
  const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
13
14
  /* @__PURE__ */ jsxs(Box, {
14
15
  css: styles.linkIconBlock,
15
- children: [/* @__PURE__ */ jsx(Icon, { css: styles.linkIcon }), status && /* @__PURE__ */ jsx(Box, {
16
+ children: [/* @__PURE__ */ jsx(Icon, {
17
+ css: styles.linkIcon,
18
+ ...uiSideNavPart("link-icon")
19
+ }), status && /* @__PURE__ */ jsx(Box, {
16
20
  css: styles.linkStatusDot,
17
21
  "data-status": status
18
22
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"UISideNavLink.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitUISideNav/UISideNavLink.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { chakra, type HTMLChakraProps } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type Ref } from 'react';\n\nimport { type BitkitIconComponent, IconArrowNortheast } from '../../icons';\nimport { useUISideNavContext } from './UISideNavContext';\n\ninterface UISideNavLinkCommonProps {\n children: string;\n icon: BitkitIconComponent;\n /**\n * A second line under the label, for a row that reports something rather than just naming a\n * destination. It steps the row up to 56px and the label down to the smaller semibold size.\n */\n secondaryText?: string;\n /**\n * A coloured dot on the icon's trailing bottom corner. Use it with `secondaryText`, which is\n * what spells the state out; the dot alone only carries colour.\n */\n status?: 'critical' | 'neutral' | 'success';\n}\n\nexport interface BitkitUISideNavLinkAsAnchorProps\n extends UISideNavLinkCommonProps, Omit<HTMLChakraProps<'a'>, 'children'> {\n href: string;\n /** Adds the north-east arrow and the usual `target`/`rel` pair for a link leaving the app. */\n isExternal?: boolean;\n}\n\nexport interface BitkitUISideNavLinkAsButtonProps\n extends UISideNavLinkCommonProps, Omit<HTMLChakraProps<'button'>, 'children'> {\n href?: undefined;\n isExternal?: undefined;\n /** Makes the row a button instead of a link — for one that opens a dialog rather than navigating. */\n onClick: NonNullable<HTMLChakraProps<'button'>['onClick']>;\n}\n\nexport type BitkitUISideNavLinkProps = BitkitUISideNavLinkAsAnchorProps | BitkitUISideNavLinkAsButtonProps;\n\nconst UISideNavLink = forwardRef<HTMLAnchorElement | HTMLButtonElement, BitkitUISideNavLinkProps>((props, ref) => {\n const {\n children,\n css,\n href,\n icon: Icon,\n isExternal,\n rel,\n secondaryText,\n status,\n target,\n ...rest\n } = props as BitkitUISideNavLinkAsAnchorProps;\n\n const { styles } = useUISideNavContext();\n\n const content = (\n <>\n <Box css={styles.linkIconBlock}>\n <Icon css={styles.linkIcon} />\n {status && <Box css={styles.linkStatusDot} data-status={status} />}\n </Box>\n <Box css={styles.linkTextBlock}>\n <Text as=\"span\" css={styles.linkLabel}>\n {children}\n </Text>\n {secondaryText && (\n <Text as=\"span\" css={styles.linkSecondaryText}>\n {secondaryText}\n </Text>\n )}\n </Box>\n {isExternal && <IconArrowNortheast css={styles.linkIcon} />}\n </>\n );\n\n const rootProps = {\n 'data-with-secondary': secondaryText ? '' : undefined,\n ...rest,\n css: [styles.link, css],\n };\n\n // `chakra.button` / `chakra.a` rather than `Button` / `Link`: the row is styled entirely by the\n // nav's own `link` slot, and either named primitive would layer its own recipe over it.\n if (href === undefined) {\n return (\n <chakra.button ref={ref as Ref<HTMLButtonElement>} type=\"button\" {...(rootProps as HTMLChakraProps<'button'>)}>\n {content}\n </chakra.button>\n );\n }\n\n return (\n <chakra.a\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n rel={isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel}\n target={isExternal ? '_blank' : target}\n {...rootProps}\n >\n {content}\n </chakra.a>\n );\n});\n\nUISideNavLink.displayName = 'BitkitUISideNav.Link';\n\nexport default UISideNavLink;\n"],"mappings":";;;;;;;;AAwCA,IAAM,gBAAgB,YAA6E,OAAO,QAAQ;CAChH,MAAM,EACJ,UACA,KACA,MACA,MAAM,MACN,YACA,KACA,eACA,QACA,QACA,GAAG,SACD;CAEJ,MAAM,EAAE,WAAW,oBAAoB;CAEvC,MAAM,UACJ,qBAAAA,YAAA,EAAA,UAAA;EACE,qBAAC,KAAD;GAAK,KAAK,OAAO;GAAjB,UAAA,CACE,oBAAC,MAAD,EAAM,KAAK,OAAO,SAAW,CAAA,GAC5B,UAAU,oBAAC,KAAD;IAAK,KAAK,OAAO;IAAe,eAAa;GAAS,CAAA,CAC9D;;EACL,qBAAC,KAAD;GAAK,KAAK,OAAO;GAAjB,UAAA,CACE,oBAAC,MAAD;IAAM,IAAG;IAAO,KAAK,OAAO;IACzB;GACG,CAAA,GACL,iBACC,oBAAC,MAAD;IAAM,IAAG;IAAO,KAAK,OAAO;IACzB,UAAA;GACG,CAAA,CAEL;;EACJ,cAAc,oBAAC,oBAAD,EAAoB,KAAK,OAAO,SAAW,CAAA;CAC1D,EAAA,CAAA;CAGJ,MAAM,YAAY;EAChB,uBAAuB,gBAAgB,KAAK,KAAA;EAC5C,GAAG;EACH,KAAK,CAAC,OAAO,MAAM,GAAG;CACxB;CAIA,IAAI,SAAS,KAAA,GACX,OACE,oBAAC,OAAO,QAAR;EAAoB;EAA+B,MAAK;EAAS,GAAK;EACnE,UAAA;CACY,CAAA;CAInB,OACE,oBAAC,OAAO,GAAR;EACO;EACC;EACN,KAAK,aAAc,MAAM,GAAG,IAAI,wBAAwB,wBAAyB;EACjF,QAAQ,aAAa,WAAW;EAChC,GAAI;EAEH,UAAA;CACO,CAAA;AAEd,CAAC;AAED,cAAc,cAAc"}
1
+ {"version":3,"file":"UISideNavLink.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitUISideNav/UISideNavLink.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { chakra, type HTMLChakraProps } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type Ref } from 'react';\n\nimport { type BitkitIconComponent, IconArrowNortheast } from '../../icons';\nimport { useUISideNavContext } from './UISideNavContext';\nimport uiSideNavPart from './uiSideNavPart';\n\ninterface UISideNavLinkCommonProps {\n children: string;\n icon: BitkitIconComponent;\n /**\n * A second line under the label, for a row that reports something rather than just naming a\n * destination. It steps the row up to 56px and the label down to the smaller semibold size.\n */\n secondaryText?: string;\n /**\n * A coloured dot on the icon's trailing bottom corner. Use it with `secondaryText`, which is\n * what spells the state out; the dot alone only carries colour.\n */\n status?: 'critical' | 'neutral' | 'success';\n}\n\nexport interface BitkitUISideNavLinkAsAnchorProps\n extends UISideNavLinkCommonProps, Omit<HTMLChakraProps<'a'>, 'children'> {\n href: string;\n /** Adds the north-east arrow and the usual `target`/`rel` pair for a link leaving the app. */\n isExternal?: boolean;\n}\n\nexport interface BitkitUISideNavLinkAsButtonProps\n extends UISideNavLinkCommonProps, Omit<HTMLChakraProps<'button'>, 'children'> {\n href?: undefined;\n isExternal?: undefined;\n /** Makes the row a button instead of a link — for one that opens a dialog rather than navigating. */\n onClick: NonNullable<HTMLChakraProps<'button'>['onClick']>;\n}\n\nexport type BitkitUISideNavLinkProps = BitkitUISideNavLinkAsAnchorProps | BitkitUISideNavLinkAsButtonProps;\n\nconst UISideNavLink = forwardRef<HTMLAnchorElement | HTMLButtonElement, BitkitUISideNavLinkProps>((props, ref) => {\n const {\n children,\n css,\n href,\n icon: Icon,\n isExternal,\n rel,\n secondaryText,\n status,\n target,\n ...rest\n } = props as BitkitUISideNavLinkAsAnchorProps;\n\n const { styles } = useUISideNavContext();\n\n const content = (\n <>\n <Box css={styles.linkIconBlock}>\n <Icon css={styles.linkIcon} {...uiSideNavPart('link-icon')} />\n {status && <Box css={styles.linkStatusDot} data-status={status} />}\n </Box>\n <Box css={styles.linkTextBlock}>\n <Text as=\"span\" css={styles.linkLabel}>\n {children}\n </Text>\n {secondaryText && (\n <Text as=\"span\" css={styles.linkSecondaryText}>\n {secondaryText}\n </Text>\n )}\n </Box>\n {isExternal && <IconArrowNortheast css={styles.linkIcon} />}\n </>\n );\n\n const rootProps = {\n 'data-with-secondary': secondaryText ? '' : undefined,\n ...rest,\n css: [styles.link, css],\n };\n\n // `chakra.button` / `chakra.a` rather than `Button` / `Link`: the row is styled entirely by the\n // nav's own `link` slot, and either named primitive would layer its own recipe over it.\n if (href === undefined) {\n return (\n <chakra.button ref={ref as Ref<HTMLButtonElement>} type=\"button\" {...(rootProps as HTMLChakraProps<'button'>)}>\n {content}\n </chakra.button>\n );\n }\n\n return (\n <chakra.a\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n rel={isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel}\n target={isExternal ? '_blank' : target}\n {...rootProps}\n >\n {content}\n </chakra.a>\n );\n});\n\nUISideNavLink.displayName = 'BitkitUISideNav.Link';\n\nexport default UISideNavLink;\n"],"mappings":";;;;;;;;;AAyCA,IAAM,gBAAgB,YAA6E,OAAO,QAAQ;CAChH,MAAM,EACJ,UACA,KACA,MACA,MAAM,MACN,YACA,KACA,eACA,QACA,QACA,GAAG,SACD;CAEJ,MAAM,EAAE,WAAW,oBAAoB;CAEvC,MAAM,UACJ,qBAAAA,YAAA,EAAA,UAAA;EACE,qBAAC,KAAD;GAAK,KAAK,OAAO;GAAjB,UAAA,CACE,oBAAC,MAAD;IAAM,KAAK,OAAO;IAAU,GAAI,cAAc,WAAW;GAAI,CAAA,GAC5D,UAAU,oBAAC,KAAD;IAAK,KAAK,OAAO;IAAe,eAAa;GAAS,CAAA,CAC9D;;EACL,qBAAC,KAAD;GAAK,KAAK,OAAO;GAAjB,UAAA,CACE,oBAAC,MAAD;IAAM,IAAG;IAAO,KAAK,OAAO;IACzB;GACG,CAAA,GACL,iBACC,oBAAC,MAAD;IAAM,IAAG;IAAO,KAAK,OAAO;IACzB,UAAA;GACG,CAAA,CAEL;;EACJ,cAAc,oBAAC,oBAAD,EAAoB,KAAK,OAAO,SAAW,CAAA;CAC1D,EAAA,CAAA;CAGJ,MAAM,YAAY;EAChB,uBAAuB,gBAAgB,KAAK,KAAA;EAC5C,GAAG;EACH,KAAK,CAAC,OAAO,MAAM,GAAG;CACxB;CAIA,IAAI,SAAS,KAAA,GACX,OACE,oBAAC,OAAO,QAAR;EAAoB;EAA+B,MAAK;EAAS,GAAK;EACnE,UAAA;CACY,CAAA;CAInB,OACE,oBAAC,OAAO,GAAR;EACO;EACC;EACN,KAAK,aAAc,MAAM,GAAG,IAAI,wBAAwB,wBAAyB;EACjF,QAAQ,aAAa,WAAW;EAChC,GAAI;EAEH,UAAA;CACO,CAAA;AAEd,CAAC;AAED,cAAc,cAAc"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The `data-scope` / `data-part` pair on the parts of the side navigation a consumer has to reach,
3
+ * so a tour step, a stylesheet or a spec can address one without a generated class name or the
4
+ * element it happens to render. The same marker Chakra and Ark put on their own parts, and the
5
+ * one `BitkitUIHeader` uses.
6
+ */
7
+ declare const uiSideNavPart: (name: string) => {
8
+ 'data-part': string;
9
+ 'data-scope': string;
10
+ };
11
+ export default uiSideNavPart;
@@ -0,0 +1,15 @@
1
+ //#region lib/components/BitkitUISideNav/uiSideNavPart.ts
2
+ /**
3
+ * The `data-scope` / `data-part` pair on the parts of the side navigation a consumer has to reach,
4
+ * so a tour step, a stylesheet or a spec can address one without a generated class name or the
5
+ * element it happens to render. The same marker Chakra and Ark put on their own parts, and the
6
+ * one `BitkitUIHeader` uses.
7
+ */
8
+ var uiSideNavPart = (name) => ({
9
+ "data-part": name,
10
+ "data-scope": "ui-side-nav"
11
+ });
12
+ //#endregion
13
+ export { uiSideNavPart as default };
14
+
15
+ //# sourceMappingURL=uiSideNavPart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uiSideNavPart.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/uiSideNavPart.ts"],"sourcesContent":["/**\n * The `data-scope` / `data-part` pair on the parts of the side navigation a consumer has to reach,\n * so a tour step, a stylesheet or a spec can address one without a generated class name or the\n * element it happens to render. The same marker Chakra and Ark put on their own parts, and the\n * one `BitkitUIHeader` uses.\n */\nconst uiSideNavPart = (name: string) => ({ 'data-part': name, 'data-scope': 'ui-side-nav' });\n\nexport default uiSideNavPart;\n"],"mappings":";;;;;;;AAMA,IAAM,iBAAiB,UAAkB;CAAE,aAAa;CAAM,cAAc;AAAc"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit-v2",
3
3
  "private": false,
4
- "version": "0.3.510",
4
+ "version": "0.3.511",
5
5
  "description": "Bitrise Design System Components built with Chakra UI V3",
6
6
  "keywords": [
7
7
  "react",