@bitrise/bitkit-v2 0.3.406 → 0.3.407
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/components/BitkitBreadcrumb/BitkitBreadcrumb.d.ts +11 -3
- package/dist/components/BitkitBreadcrumb/BitkitBreadcrumb.js +5 -22
- package/dist/components/BitkitBreadcrumb/BitkitBreadcrumb.js.map +1 -1
- package/dist/components/BitkitBreadcrumb/components/BreadcrumbCurrentItem.d.ts +5 -2
- package/dist/components/BitkitBreadcrumb/components/BreadcrumbCurrentItem.js +2 -1
- package/dist/components/BitkitBreadcrumb/components/BreadcrumbCurrentItem.js.map +1 -1
- package/dist/components/BitkitBreadcrumb/components/BreadcrumbItem.d.ts +5 -2
- package/dist/components/BitkitBreadcrumb/components/BreadcrumbItem.js +2 -1
- package/dist/components/BitkitBreadcrumb/components/BreadcrumbItem.js.map +1 -1
- package/dist/components/BitkitBreadcrumb/components/OverflowMenuItem.d.ts +4 -2
- package/dist/components/BitkitBreadcrumb/components/OverflowMenuItem.js +4 -2
- package/dist/components/BitkitBreadcrumb/components/OverflowMenuItem.js.map +1 -1
- package/dist/components/BitkitBreadcrumb/types.d.ts +3 -2
- package/package.json +1 -1
|
@@ -10,12 +10,20 @@ export type BitkitBreadcrumbProps = Omit<BreadcrumbRootProps, 'children'> & {
|
|
|
10
10
|
declare const BitkitBreadcrumb: import('react').ForwardRefExoticComponent<Omit<Breadcrumb.RootProps, "children"> & {
|
|
11
11
|
children: BitkitBreadcrumbChild | BitkitBreadcrumbChild[];
|
|
12
12
|
} & import('react').RefAttributes<HTMLElement>> & {
|
|
13
|
-
CurrentItem: import('react').ForwardRefExoticComponent<
|
|
14
|
-
|
|
13
|
+
CurrentItem: import('react').ForwardRefExoticComponent<Omit<Breadcrumb.CurrentLinkProps, "children"> & {
|
|
14
|
+
children: import('react').ReactNode;
|
|
15
|
+
} & import('react').RefAttributes<HTMLElement>>;
|
|
16
|
+
Item: import('react').ForwardRefExoticComponent<Omit<Breadcrumb.LinkProps, "href" | "children"> & {
|
|
17
|
+
children: import('react').ReactNode;
|
|
18
|
+
href: string;
|
|
19
|
+
} & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
15
20
|
OverflowMenu: {
|
|
16
21
|
({ children }: OverflowMenuProps): import("react").JSX.Element;
|
|
17
22
|
displayName: string;
|
|
18
23
|
};
|
|
19
|
-
OverflowMenuItem: import('react').ForwardRefExoticComponent<
|
|
24
|
+
OverflowMenuItem: import('react').ForwardRefExoticComponent<Omit<Breadcrumb.LinkProps, "href" | "children"> & {
|
|
25
|
+
children: import('react').ReactNode;
|
|
26
|
+
href: string;
|
|
27
|
+
} & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
20
28
|
};
|
|
21
29
|
export default BitkitBreadcrumb;
|
|
@@ -16,22 +16,11 @@ import { Show } from "@chakra-ui/react/show";
|
|
|
16
16
|
//#region lib/components/BitkitBreadcrumb/BitkitBreadcrumb.tsx
|
|
17
17
|
var flattenItemProps = (elements) => {
|
|
18
18
|
const props = [];
|
|
19
|
-
for (const child of elements) if (child.type === BreadcrumbItem)
|
|
20
|
-
|
|
21
|
-
props.push({
|
|
22
|
-
href,
|
|
23
|
-
children
|
|
24
|
-
});
|
|
25
|
-
} else if (child.type === OverflowMenu) {
|
|
19
|
+
for (const child of elements) if (child.type === BreadcrumbItem) props.push(child.props);
|
|
20
|
+
else if (child.type === OverflowMenu) {
|
|
26
21
|
const { children: menuChildren } = child.props;
|
|
27
22
|
const menuChildArray = flattenChildren(menuChildren);
|
|
28
|
-
for (const menuChild of menuChildArray) if (menuChild.type === OverflowMenuItem)
|
|
29
|
-
const { href, children } = menuChild.props;
|
|
30
|
-
props.push({
|
|
31
|
-
href,
|
|
32
|
-
children
|
|
33
|
-
});
|
|
34
|
-
}
|
|
23
|
+
for (const menuChild of menuChildArray) if (menuChild.type === OverflowMenuItem) props.push(menuChild.props);
|
|
35
24
|
}
|
|
36
25
|
return props;
|
|
37
26
|
};
|
|
@@ -57,15 +46,9 @@ var BitkitBreadcrumbRoot = forwardRef(({ children, ...rest }, ref) => {
|
|
|
57
46
|
icon: IconMoreHorizontal,
|
|
58
47
|
label: "Open breadcrumbs",
|
|
59
48
|
size: "xs"
|
|
60
|
-
}) }), overflowLinks.map((link) => /* @__PURE__ */ jsx(OverflowMenuItem, {
|
|
61
|
-
href: link.href,
|
|
62
|
-
children: link.children
|
|
63
|
-
}, link.href))] }), /* @__PURE__ */ jsx(Breadcrumb.Separator, { children: /* @__PURE__ */ jsx(IconChevronRight, {}) })]
|
|
64
|
-
}),
|
|
65
|
-
/* @__PURE__ */ jsx(BreadcrumbItem, {
|
|
66
|
-
href: lastLink.href,
|
|
67
|
-
children: lastLink.children
|
|
49
|
+
}) }), overflowLinks.map((link) => /* @__PURE__ */ jsx(OverflowMenuItem, { ...link }, link.href))] }), /* @__PURE__ */ jsx(Breadcrumb.Separator, { children: /* @__PURE__ */ jsx(IconChevronRight, {}) })]
|
|
68
50
|
}),
|
|
51
|
+
/* @__PURE__ */ jsx(BreadcrumbItem, { ...lastLink }),
|
|
69
52
|
/* @__PURE__ */ jsx(Breadcrumb.Separator, { children: /* @__PURE__ */ jsx(IconChevronRight, {}) })
|
|
70
53
|
] })
|
|
71
54
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitBreadcrumb.js","names":[],"sources":["../../../lib/components/BitkitBreadcrumb/BitkitBreadcrumb.tsx"],"sourcesContent":["import { Breadcrumb, type BreadcrumbRootProps } from '@chakra-ui/react/breadcrumb';\nimport { useBreakpointValue } from '@chakra-ui/react/hooks';\nimport { Show } from '@chakra-ui/react/show';\nimport { forwardRef, Fragment, type ReactElement } from 'react';\n\nimport { IconChevronRight, IconMoreHorizontal } from '../../icons';\nimport { flattenChildren } from '../../utilities/flattenChildren';\nimport { withSubComponents } from '../../utilities/withSubComponents.ts';\nimport BitkitControlButton from '../BitkitControlButton/BitkitControlButton.tsx';\nimport BreadcrumbCurrentItem, { type CurrentItemProps } from './components/BreadcrumbCurrentItem.tsx';\nimport BreadcrumbItem from './components/BreadcrumbItem.tsx';\nimport OverflowMenu, { type OverflowMenuProps } from './components/OverflowMenu.tsx';\nimport OverflowMenuItem from './components/OverflowMenuItem.tsx';\nimport OverflowMenuTrigger from './components/OverflowMenuTrigger.tsx';\nimport { type ItemProps } from './types.ts';\n\ntype BitkitBreadcrumbChild = ReactElement<ItemProps> | ReactElement<CurrentItemProps> | ReactElement<OverflowMenuProps>;\n\nexport type BitkitBreadcrumbProps = Omit<BreadcrumbRootProps, 'children'> & {\n children: BitkitBreadcrumbChild | BitkitBreadcrumbChild[];\n};\n\nconst flattenItemProps = (elements: ReactElement[]): ItemProps[] => {\n const props: ItemProps[] = [];\n\n for (const child of elements) {\n if (child.type === BreadcrumbItem) {\n
|
|
1
|
+
{"version":3,"file":"BitkitBreadcrumb.js","names":[],"sources":["../../../lib/components/BitkitBreadcrumb/BitkitBreadcrumb.tsx"],"sourcesContent":["import { Breadcrumb, type BreadcrumbRootProps } from '@chakra-ui/react/breadcrumb';\nimport { useBreakpointValue } from '@chakra-ui/react/hooks';\nimport { Show } from '@chakra-ui/react/show';\nimport { forwardRef, Fragment, type ReactElement } from 'react';\n\nimport { IconChevronRight, IconMoreHorizontal } from '../../icons';\nimport { flattenChildren } from '../../utilities/flattenChildren';\nimport { withSubComponents } from '../../utilities/withSubComponents.ts';\nimport BitkitControlButton from '../BitkitControlButton/BitkitControlButton.tsx';\nimport BreadcrumbCurrentItem, { type CurrentItemProps } from './components/BreadcrumbCurrentItem.tsx';\nimport BreadcrumbItem from './components/BreadcrumbItem.tsx';\nimport OverflowMenu, { type OverflowMenuProps } from './components/OverflowMenu.tsx';\nimport OverflowMenuItem from './components/OverflowMenuItem.tsx';\nimport OverflowMenuTrigger from './components/OverflowMenuTrigger.tsx';\nimport { type ItemProps } from './types.ts';\n\ntype BitkitBreadcrumbChild = ReactElement<ItemProps> | ReactElement<CurrentItemProps> | ReactElement<OverflowMenuProps>;\n\nexport type BitkitBreadcrumbProps = Omit<BreadcrumbRootProps, 'children'> & {\n children: BitkitBreadcrumbChild | BitkitBreadcrumbChild[];\n};\n\n// The whole prop bag travels, not just `href`/`children`: the mobile layout rebuilds its items\n// from these, so picking two keys here would drop everything else a consumer put on a crumb — a\n// `data-*` hook, an `aria-*`, an `onClick` — on mobile only, and silently.\nconst flattenItemProps = (elements: ReactElement[]): ItemProps[] => {\n const props: ItemProps[] = [];\n\n for (const child of elements) {\n if (child.type === BreadcrumbItem) {\n props.push(child.props as ItemProps);\n } else if (child.type === OverflowMenu) {\n const { children: menuChildren } = child.props as OverflowMenuProps;\n const menuChildArray = flattenChildren(menuChildren);\n for (const menuChild of menuChildArray) {\n if (menuChild.type === OverflowMenuItem) {\n props.push(menuChild.props as ItemProps);\n }\n }\n }\n }\n\n return props;\n};\n\nconst BitkitBreadcrumbRoot = forwardRef<HTMLElement, BitkitBreadcrumbProps>(({ children, ...rest }, ref) => {\n const isMobile = useBreakpointValue({ base: true, tablet: false }, { fallback: 'tablet' });\n const childArray = flattenChildren(children);\n\n if (childArray.length === 0) {\n return null;\n }\n\n if (isMobile) {\n const links = flattenItemProps(childArray);\n if (links.length === 0) {\n return null;\n }\n\n const lastLink = links[links.length - 1];\n const overflowLinks = links.slice(0, -1).reverse();\n\n return (\n <Breadcrumb.Root ref={ref} {...rest}>\n <Breadcrumb.List>\n <Show when={overflowLinks.length > 0}>\n <OverflowMenu>\n <OverflowMenuTrigger>\n <BitkitControlButton icon={IconMoreHorizontal} label=\"Open breadcrumbs\" size=\"xs\" />\n </OverflowMenuTrigger>\n {overflowLinks.map((link) => (\n <OverflowMenuItem key={link.href} {...link} />\n ))}\n </OverflowMenu>\n <Breadcrumb.Separator>\n <IconChevronRight />\n </Breadcrumb.Separator>\n </Show>\n <BreadcrumbItem {...lastLink} />\n <Breadcrumb.Separator>\n <IconChevronRight />\n </Breadcrumb.Separator>\n </Breadcrumb.List>\n </Breadcrumb.Root>\n );\n }\n\n return (\n <Breadcrumb.Root ref={ref} {...rest}>\n <Breadcrumb.List>\n {childArray.map((child, index) => (\n <Fragment key={child.key}>\n {child}\n <Show when={index < childArray.length - 1}>\n <Breadcrumb.Separator>\n <IconChevronRight />\n </Breadcrumb.Separator>\n </Show>\n </Fragment>\n ))}\n </Breadcrumb.List>\n </Breadcrumb.Root>\n );\n});\n\nBitkitBreadcrumbRoot.displayName = 'BitkitBreadcrumb';\n\nconst BitkitBreadcrumb = withSubComponents(BitkitBreadcrumbRoot, {\n CurrentItem: BreadcrumbCurrentItem,\n Item: BreadcrumbItem,\n OverflowMenu,\n OverflowMenuItem,\n});\n\nexport default BitkitBreadcrumb;\n"],"mappings":";;;;;;;;;;;;;;;;AAyBA,IAAM,oBAAoB,aAA0C;CAClE,MAAM,QAAqB,CAAC;CAE5B,KAAK,MAAM,SAAS,UAClB,IAAI,MAAM,SAAS,gBACjB,MAAM,KAAK,MAAM,KAAkB;MAC9B,IAAI,MAAM,SAAS,cAAc;EACtC,MAAM,EAAE,UAAU,iBAAiB,MAAM;EACzC,MAAM,iBAAiB,gBAAgB,YAAY;EACnD,KAAK,MAAM,aAAa,gBACtB,IAAI,UAAU,SAAS,kBACrB,MAAM,KAAK,UAAU,KAAkB;CAG7C;CAGF,OAAO;AACT;AAEA,IAAM,uBAAuB,YAAgD,EAAE,UAAU,GAAG,QAAQ,QAAQ;CAC1G,MAAM,WAAW,mBAAmB;EAAE,MAAM;EAAM,QAAQ;CAAM,GAAG,EAAE,UAAU,SAAS,CAAC;CACzF,MAAM,aAAa,gBAAgB,QAAQ;CAE3C,IAAI,WAAW,WAAW,GACxB,OAAO;CAGT,IAAI,UAAU;EACZ,MAAM,QAAQ,iBAAiB,UAAU;EACzC,IAAI,MAAM,WAAW,GACnB,OAAO;EAGT,MAAM,WAAW,MAAM,MAAM,SAAS;EACtC,MAAM,gBAAgB,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,QAAQ;EAEjD,OACE,oBAAC,WAAW,MAAZ;GAAsB;GAAK,GAAI;GAC7B,UAAA,qBAAC,WAAW,MAAZ,EAAA,UAAA;IACE,qBAAC,MAAD;KAAM,MAAM,cAAc,SAAS;KAAnC,UAAA,CACE,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,qBAAD,EAAA,UACE,oBAAC,qBAAD;MAAqB,MAAM;MAAoB,OAAM;MAAmB,MAAK;KAAM,CAAA,EAChE,CAAA,GACpB,cAAc,KAAK,SAClB,oBAAC,kBAAD,EAAkC,GAAI,KAAO,GAAtB,KAAK,IAAiB,CAC9C,CACW,EAAA,CAAA,GACd,oBAAC,WAAW,WAAZ,EAAA,UACE,oBAAC,kBAAD,CAAmB,CAAA,EACC,CAAA,CAClB;;IACN,oBAAC,gBAAD,EAAgB,GAAI,SAAW,CAAA;IAC/B,oBAAC,WAAW,WAAZ,EAAA,UACE,oBAAC,kBAAD,CAAmB,CAAA,EACC,CAAA;GACP,EAAA,CAAA;EACF,CAAA;CAErB;CAEA,OACE,oBAAC,WAAW,MAAZ;EAAsB;EAAK,GAAI;EAC7B,UAAA,oBAAC,WAAW,MAAZ,EAAA,UACG,WAAW,KAAK,OAAO,UACtB,qBAAC,UAAD,EAAA,UAAA,CACG,OACD,oBAAC,MAAD;GAAM,MAAM,QAAQ,WAAW,SAAS;GACtC,UAAA,oBAAC,WAAW,WAAZ,EAAA,UACE,oBAAC,kBAAD,CAAmB,CAAA,EACC,CAAA;EAClB,CAAA,CACE,EAAA,GAPK,MAAM,GAOX,CACX,EACc,CAAA;CACF,CAAA;AAErB,CAAC;AAED,qBAAqB,cAAc;AAEnC,IAAM,mBAAmB,kBAAkB,sBAAsB;CAC/D,aAAa;CACb,MAAM;CACN;CACA;AACF,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { Breadcrumb, BreadcrumbCurrentLinkProps } from '@chakra-ui/react/breadcrumb';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
|
-
export type CurrentItemProps = {
|
|
3
|
+
export type CurrentItemProps = Omit<BreadcrumbCurrentLinkProps, 'children'> & {
|
|
3
4
|
children: ReactNode;
|
|
4
5
|
};
|
|
5
|
-
declare const BreadcrumbCurrentItem: import('react').ForwardRefExoticComponent<
|
|
6
|
+
declare const BreadcrumbCurrentItem: import('react').ForwardRefExoticComponent<Omit<Breadcrumb.CurrentLinkProps, "children"> & {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
} & import('react').RefAttributes<HTMLElement>>;
|
|
6
9
|
export default BreadcrumbCurrentItem;
|
|
@@ -2,9 +2,10 @@ import { forwardRef } from "react";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Breadcrumb } from "@chakra-ui/react/breadcrumb";
|
|
4
4
|
//#region lib/components/BitkitBreadcrumb/components/BreadcrumbCurrentItem.tsx
|
|
5
|
-
var BreadcrumbCurrentItem = forwardRef(({ children }, ref) => {
|
|
5
|
+
var BreadcrumbCurrentItem = forwardRef(({ children, ...rest }, ref) => {
|
|
6
6
|
return /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.CurrentLink, {
|
|
7
7
|
ref,
|
|
8
|
+
...rest,
|
|
8
9
|
children
|
|
9
10
|
}) });
|
|
10
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbCurrentItem.js","names":[],"sources":["../../../../lib/components/BitkitBreadcrumb/components/BreadcrumbCurrentItem.tsx"],"sourcesContent":["import { Breadcrumb } from '@chakra-ui/react/breadcrumb';\nimport { forwardRef, type ReactNode } from 'react';\n\nexport type CurrentItemProps = {\n children: ReactNode;\n};\n\nconst BreadcrumbCurrentItem = forwardRef<HTMLElement, CurrentItemProps>(({ children }, ref) => {\n return (\n <Breadcrumb.Item>\n <Breadcrumb.CurrentLink ref={ref}
|
|
1
|
+
{"version":3,"file":"BreadcrumbCurrentItem.js","names":[],"sources":["../../../../lib/components/BitkitBreadcrumb/components/BreadcrumbCurrentItem.tsx"],"sourcesContent":["import { Breadcrumb, type BreadcrumbCurrentLinkProps } from '@chakra-ui/react/breadcrumb';\nimport { forwardRef, type ReactNode } from 'react';\n\nexport type CurrentItemProps = Omit<BreadcrumbCurrentLinkProps, 'children'> & {\n children: ReactNode;\n};\n\nconst BreadcrumbCurrentItem = forwardRef<HTMLElement, CurrentItemProps>(({ children, ...rest }, ref) => {\n return (\n <Breadcrumb.Item>\n <Breadcrumb.CurrentLink ref={ref} {...rest}>\n {children}\n </Breadcrumb.CurrentLink>\n </Breadcrumb.Item>\n );\n});\n\nBreadcrumbCurrentItem.displayName = 'BitkitBreadcrumb.CurrentItem';\n\nexport default BreadcrumbCurrentItem;\n"],"mappings":";;;;AAOA,IAAM,wBAAwB,YAA2C,EAAE,UAAU,GAAG,QAAQ,QAAQ;CACtG,OACE,oBAAC,WAAW,MAAZ,EAAA,UACE,oBAAC,WAAW,aAAZ;EAA6B;EAAK,GAAI;EACnC;CACqB,CAAA,EACT,CAAA;AAErB,CAAC;AAED,sBAAsB,cAAc"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const BreadcrumbItem: import('react').ForwardRefExoticComponent<
|
|
1
|
+
import { Breadcrumb } from '@chakra-ui/react/breadcrumb';
|
|
2
|
+
declare const BreadcrumbItem: import('react').ForwardRefExoticComponent<Omit<Breadcrumb.LinkProps, "href" | "children"> & {
|
|
3
|
+
children: import('react').ReactNode;
|
|
4
|
+
href: string;
|
|
5
|
+
} & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
3
6
|
export default BreadcrumbItem;
|
|
@@ -2,9 +2,10 @@ import { forwardRef } from "react";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Breadcrumb } from "@chakra-ui/react/breadcrumb";
|
|
4
4
|
//#region lib/components/BitkitBreadcrumb/components/BreadcrumbItem.tsx
|
|
5
|
-
var BreadcrumbItem = forwardRef(({ href,
|
|
5
|
+
var BreadcrumbItem = forwardRef(({ children, href, ...rest }, ref) => {
|
|
6
6
|
return /* @__PURE__ */ jsx(Breadcrumb.Item, { children: /* @__PURE__ */ jsx(Breadcrumb.Link, {
|
|
7
7
|
ref,
|
|
8
|
+
...rest,
|
|
8
9
|
href,
|
|
9
10
|
children
|
|
10
11
|
}) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbItem.js","names":[],"sources":["../../../../lib/components/BitkitBreadcrumb/components/BreadcrumbItem.tsx"],"sourcesContent":["import { Breadcrumb } from '@chakra-ui/react/breadcrumb';\nimport { forwardRef } from 'react';\n\nimport { type ItemProps } from '../types.ts';\n\nconst BreadcrumbItem = forwardRef<HTMLAnchorElement, ItemProps>(({ href,
|
|
1
|
+
{"version":3,"file":"BreadcrumbItem.js","names":[],"sources":["../../../../lib/components/BitkitBreadcrumb/components/BreadcrumbItem.tsx"],"sourcesContent":["import { Breadcrumb } from '@chakra-ui/react/breadcrumb';\nimport { forwardRef } from 'react';\n\nimport { type ItemProps } from '../types.ts';\n\nconst BreadcrumbItem = forwardRef<HTMLAnchorElement, ItemProps>(({ children, href, ...rest }, ref) => {\n return (\n <Breadcrumb.Item>\n {/* `rest` rides the link rather than the wrapping `li`: that is where the ref points, and it\n is the anchor a consumer means when they tag a crumb — `data-*` hooks, `aria-*`,\n `target`/`rel`, an `onClick`. */}\n <Breadcrumb.Link ref={ref} {...rest} href={href}>\n {children}\n </Breadcrumb.Link>\n </Breadcrumb.Item>\n );\n});\n\nBreadcrumbItem.displayName = 'BitkitBreadcrumb.Item';\n\nexport default BreadcrumbItem;\n"],"mappings":";;;;AAKA,IAAM,iBAAiB,YAA0C,EAAE,UAAU,MAAM,GAAG,QAAQ,QAAQ;CACpG,OACE,oBAAC,WAAW,MAAZ,EAAA,UAIE,oBAAC,WAAW,MAAZ;EAAsB;EAAK,GAAI;EAAY;EACxC;CACc,CAAA,EACF,CAAA;AAErB,CAAC;AAED,eAAe,cAAc"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
declare const OverflowMenuItem: import('react').ForwardRefExoticComponent<Omit<import('@chakra-ui/react').BreadcrumbLinkProps, "href" | "children"> & {
|
|
2
|
+
children: import('react').ReactNode;
|
|
3
|
+
href: string;
|
|
4
|
+
} & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
3
5
|
export default OverflowMenuItem;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { chakra } from "@chakra-ui/react/styled-system";
|
|
1
2
|
import { forwardRef, useId } from "react";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { Menu } from "@chakra-ui/react/menu";
|
|
4
5
|
//#region lib/components/BitkitBreadcrumb/components/OverflowMenuItem.tsx
|
|
5
|
-
var OverflowMenuItem = forwardRef(({ href,
|
|
6
|
+
var OverflowMenuItem = forwardRef(({ children, href, ...rest }, ref) => {
|
|
6
7
|
const id = useId();
|
|
7
8
|
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
8
9
|
value: id,
|
|
9
10
|
asChild: true,
|
|
10
|
-
children: /* @__PURE__ */ jsx(
|
|
11
|
+
children: /* @__PURE__ */ jsx(chakra.a, {
|
|
11
12
|
ref,
|
|
13
|
+
...rest,
|
|
12
14
|
href,
|
|
13
15
|
children
|
|
14
16
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowMenuItem.js","names":[],"sources":["../../../../lib/components/BitkitBreadcrumb/components/OverflowMenuItem.tsx"],"sourcesContent":["import { Menu } from '@chakra-ui/react/menu';\nimport { forwardRef, useId } from 'react';\n\nimport { type ItemProps } from '../types.ts';\n\nconst OverflowMenuItem = forwardRef<HTMLAnchorElement, ItemProps>(({ href,
|
|
1
|
+
{"version":3,"file":"OverflowMenuItem.js","names":[],"sources":["../../../../lib/components/BitkitBreadcrumb/components/OverflowMenuItem.tsx"],"sourcesContent":["import { Menu } from '@chakra-ui/react/menu';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { forwardRef, useId } from 'react';\n\nimport { type ItemProps } from '../types.ts';\n\nconst OverflowMenuItem = forwardRef<HTMLAnchorElement, ItemProps>(({ children, href, ...rest }, ref) => {\n const id = useId();\n\n return (\n <Menu.Item value={id} asChild>\n {/* `chakra.a`, not a bare `<a>`: `rest` carries Chakra style props, which a plain anchor would\n spill onto the DOM as unknown attributes. `Link` is not an option either — it would layer\n its own recipe over the menu item's. */}\n <chakra.a ref={ref} {...rest} href={href}>\n {children}\n </chakra.a>\n </Menu.Item>\n );\n});\n\nOverflowMenuItem.displayName = 'BitkitBreadcrumb.OverflowMenuItem';\n\nexport default OverflowMenuItem;\n"],"mappings":";;;;;AAMA,IAAM,mBAAmB,YAA0C,EAAE,UAAU,MAAM,GAAG,QAAQ,QAAQ;CACtG,MAAM,KAAK,MAAM;CAEjB,OACE,oBAAC,KAAK,MAAN;EAAW,OAAO;EAAI,SAAA;EAIpB,UAAA,oBAAC,OAAO,GAAR;GAAe;GAAK,GAAI;GAAY;GACjC;EACO,CAAA;CACD,CAAA;AAEf,CAAC;AAED,iBAAiB,cAAc"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { BreadcrumbLinkProps } from '@chakra-ui/react/breadcrumb';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
|
-
export type ItemProps = {
|
|
3
|
-
href: string;
|
|
3
|
+
export type ItemProps = Omit<BreadcrumbLinkProps, 'children' | 'href'> & {
|
|
4
4
|
children: ReactNode;
|
|
5
|
+
href: string;
|
|
5
6
|
};
|