@bitrise/bitkit-v2 0.3.412-beta.2661 → 0.3.413

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 (60) hide show
  1. package/dist/components/BitkitCalendar/components/CalendarSelect.js +14 -14
  2. package/dist/components/BitkitCalendar/components/CalendarSelect.js.map +1 -1
  3. package/dist/components/BitkitCombobox/BitkitCombobox.d.ts +5 -5
  4. package/dist/components/BitkitCombobox/BitkitCombobox.js +7 -3
  5. package/dist/components/BitkitCombobox/BitkitCombobox.js.map +1 -1
  6. package/dist/components/BitkitControlButton/BitkitControlButton.js +0 -1
  7. package/dist/components/BitkitControlButton/BitkitControlButton.js.map +1 -1
  8. package/dist/components/BitkitGroupHeading/BitkitGroupHeading.d.ts +0 -2
  9. package/dist/components/BitkitGroupHeading/BitkitGroupHeading.js +11 -15
  10. package/dist/components/BitkitGroupHeading/BitkitGroupHeading.js.map +1 -1
  11. package/dist/components/BitkitMultiselect/BitkitMultiselect.d.ts +9 -5
  12. package/dist/components/BitkitMultiselect/BitkitMultiselect.js +71 -62
  13. package/dist/components/BitkitMultiselect/BitkitMultiselect.js.map +1 -1
  14. package/dist/components/BitkitMultiselectMenu/BitkitMultiselectMenu.d.ts +3 -3
  15. package/dist/components/BitkitMultiselectMenu/BitkitMultiselectMenu.js.map +1 -1
  16. package/dist/components/BitkitSelect/BitkitSelect.d.ts +5 -5
  17. package/dist/components/BitkitSelect/BitkitSelect.js +24 -23
  18. package/dist/components/BitkitSelect/BitkitSelect.js.map +1 -1
  19. package/dist/components/BitkitSelectMenu/BitkitSelectMenu.d.ts +10 -3
  20. package/dist/components/BitkitSelectMenu/BitkitSelectMenu.js +5 -1
  21. package/dist/components/BitkitSelectMenu/BitkitSelectMenu.js.map +1 -1
  22. package/dist/components/BitkitSelectMenu/SelectMenuShell.d.ts +3 -3
  23. package/dist/components/BitkitSelectMenu/SelectMenuShell.js +10 -2
  24. package/dist/components/BitkitSelectMenu/SelectMenuShell.js.map +1 -1
  25. package/dist/components/BitkitSidebar/BitkitSidebar.d.ts +45 -0
  26. package/dist/components/BitkitSidebar/BitkitSidebar.js +147 -0
  27. package/dist/components/BitkitSidebar/BitkitSidebar.js.map +1 -0
  28. package/dist/components/BitkitTagsInput/BitkitTagsInput.js +10 -8
  29. package/dist/components/BitkitTagsInput/BitkitTagsInput.js.map +1 -1
  30. package/dist/components/index.d.ts +1 -2
  31. package/dist/main.js +2 -3
  32. package/dist/theme/slot-recipes/GroupHeading.recipe.js +1 -4
  33. package/dist/theme/slot-recipes/GroupHeading.recipe.js.map +1 -1
  34. package/dist/theme/slot-recipes/Select.recipe.d.ts +1 -1
  35. package/dist/theme/slot-recipes/Select.recipe.js +5 -0
  36. package/dist/theme/slot-recipes/Select.recipe.js.map +1 -1
  37. package/dist/theme/slot-recipes/Sidebar.recipe.d.ts +22 -0
  38. package/dist/theme/slot-recipes/Sidebar.recipe.js +143 -0
  39. package/dist/theme/slot-recipes/Sidebar.recipe.js.map +1 -0
  40. package/dist/theme/slot-recipes/Tour.recipe.d.ts +1 -1
  41. package/dist/theme/slot-recipes/index.d.ts +23 -287
  42. package/dist/theme/slot-recipes/index.js +2 -4
  43. package/dist/theme/slot-recipes/index.js.map +1 -1
  44. package/docs/v1-to-v2-migration-guide.md +6 -9
  45. package/package.json +1 -1
  46. package/dist/components/BitkitPageHeader/BitkitPageHeader.d.ts +0 -120
  47. package/dist/components/BitkitPageHeader/BitkitPageHeader.js +0 -103
  48. package/dist/components/BitkitPageHeader/BitkitPageHeader.js.map +0 -1
  49. package/dist/components/BitkitPageSidebar/BitkitPageSidebar.d.ts +0 -74
  50. package/dist/components/BitkitPageSidebar/BitkitPageSidebar.js +0 -263
  51. package/dist/components/BitkitPageSidebar/BitkitPageSidebar.js.map +0 -1
  52. package/dist/theme/slot-recipes/PageHeader.recipe.d.ts +0 -202
  53. package/dist/theme/slot-recipes/PageHeader.recipe.js +0 -354
  54. package/dist/theme/slot-recipes/PageHeader.recipe.js.map +0 -1
  55. package/dist/theme/slot-recipes/PageSidebar.recipe.d.ts +0 -85
  56. package/dist/theme/slot-recipes/PageSidebar.recipe.js +0 -276
  57. package/dist/theme/slot-recipes/PageSidebar.recipe.js.map +0 -1
  58. package/dist/utilities/useIsTruncated.d.ts +0 -27
  59. package/dist/utilities/useIsTruncated.js +0 -54
  60. package/dist/utilities/useIsTruncated.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"BitkitPageHeader.js","names":[],"sources":["../../../lib/components/BitkitPageHeader/BitkitPageHeader.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { isEmptyNode } from '../../utilities/isEmptyNode';\nimport useIsTruncated from '../../utilities/useIsTruncated';\nimport BitkitOverflowTooltip from '../BitkitOverflowTooltip/BitkitOverflowTooltip';\n\nexport interface BitkitPageHeaderProps extends Omit<BoxProps, 'title'> {\n /**\n * Avatar, app icon or thumbnail rendered before the title. Hidden in the collapsed layout.\n *\n * Belongs to the sub-page layouts: the design's main-page header is a title and its subtitle with\n * no avatar, so pass this alongside a `breadcrumb`.\n *\n * Size it to match the design's two sub-page cards, since the node is yours to build: `size=\"40\"`\n * (8px radius) against a bare title, and `size=\"48\"` (10px radius) once `secondaryText` is\n * present — the same avatar the `app` and `user` content shapes use.\n */\n avatar?: ReactNode;\n /** Badge rendered next to the title. Hidden in the collapsed layout. */\n badge?: ReactNode;\n /**\n * Breadcrumb trail above the title — pass a `BitkitBreadcrumb`. Its presence is what switches the\n * header from the design's main-page layout to a sub-page one, so there is no separate page-type\n * prop: the recipe's own `hasBreadcrumb` variant is derived from it.\n *\n * The two layouts carry more than the trail. A main-page header is a title and its subtitle —\n * top-level pages and product overviews — with no avatar and no `app`/`user` content shape. Those\n * belong to sub-pages, so pass them together with a trail.\n */\n breadcrumb?: ReactNode;\n /**\n * Trailing action buttons. Stacked full-width below the title on mobile, primary action on top.\n *\n * The collapsed row is built for `size=\"sm\"` buttons and the expanded header for `size=\"md\"`.\n * Actions arrive as children, so the component cannot set that for you — pass a flat `size=\"sm\"`\n * whenever `minimal` or `isSticky` is in play.\n *\n * Flat, not responsive: Bitkit icons render a different SVG asset per size, so `BitkitButton`\n * resolves `size` in JS and a `{ base, tablet }` object matches no key, falling through to a 24px\n * icon in a 32px button. Since the header collapses in CSS from `tablet` up, a `sm` action is a\n * little small in the expanded mobile layout — but the design draws no mobile frame for the\n * collapsed variants, so `sm` is the closer of the two.\n */\n children?: ReactNode;\n /**\n * Shape of the title block, mirroring the design's `content` property. `title` is a page title\n * with an optional subtitle; `app` and `user` are the tighter entity layouts — a larger avatar\n * centred against a smaller title and 14px secondary text. They differ only in the gap between\n * the avatar and the text, 16 and 12 respectively.\n */\n contentVariant?: 'title' | 'app' | 'user';\n /**\n * Inline controls between the trail and the actions — a view switcher, filters, a settings menu.\n * Their presence spreads the row into three groups instead of the usual trail-and-actions pair,\n * which is the shape the design file calls `PageHeader-WFE`.\n *\n * Belongs to the collapsed row, so it is honoured by `variant=\"minimal\"` *and* by `isSticky` —\n * the two produce the same row — and ignored in the expanded layouts, which the design draws no\n * controls in.\n */\n controls?: ReactNode;\n /**\n * Renders the compact single-row layout used while the header is stuck to the top of the viewport.\n * Appearance only — the consumer owns scroll detection and any portalling, since the sticky offset\n * and header container are application concerns.\n *\n * Ignored below the `tablet` breakpoint, where the header always stays expanded.\n *\n * Pair it with `size=\"sm\"` actions — see `children`.\n */\n isSticky?: boolean;\n /**\n * Descriptive text below the title. Hidden in the collapsed layout.\n *\n * A string, like `title`, so it can be truncated to one line and carried in full by the tooltip\n * that appears when it does not fit.\n */\n secondaryText?: string;\n /**\n * Tab bar along the bottom edge — pass a `BitkitTabs.List`. Hidden in the collapsed layout.\n *\n * The node is rendered inside the header, so tab panels cannot be siblings of the row. To drive\n * page content from it, put `BitkitTabs.Root` around the header *and* the content, and pass only\n * the list here — `BitkitTabs.List` reads its Root from context and throws without an ancestor:\n *\n * ```tsx\n * <BitkitTabs.Root defaultValue=\"overview\">\n * <BitkitPageHeader tabs={<BitkitTabs.List>…</BitkitTabs.List>} title=\"Build Hub\" />\n * <BitkitTabs.ContentGroup>\n * <BitkitTabs.Content padding=\"32\" value=\"overview\">…</BitkitTabs.Content>\n * </BitkitTabs.ContentGroup>\n * </BitkitTabs.Root>\n * ```\n *\n * Only the row is hidden when the header collapses — the panels live outside it and keep\n * rendering, so the page never blanks.\n */\n tabs?: ReactNode;\n /**\n * The page title, as a string. Everything passed here lands inside the `h1`, so it is the\n * heading's accessible name and nothing else belongs in it — the avatar, badge and secondary\n * text each have their own slot. Required: it is what gives the header a page heading at every\n * breakpoint.\n *\n * Truncated to a single line with an ellipsis. When it does not fit, hovering or focusing it\n * shows the full string in a tooltip — so a long title never grows the header.\n *\n * In the collapsed layout (`minimal` or `isSticky`) *with* a `breadcrumb`, the design shows the\n * title in the trail rather than as a heading, so end the breadcrumb with a\n * `BitkitBreadcrumb.CurrentItem` carrying it — the title is then rendered as a visually hidden\n * `h1`, since `Breadcrumb.CurrentLink` is a link and not a heading. Below `tablet` the header\n * never collapses and the visible heading is used instead (`BitkitBreadcrumb` drops its\n * `CurrentItem` on mobile).\n */\n title: string;\n /**\n * `minimal` collapses the header to the single breadcrumb row used by sub-pages that don't repeat\n * their title as a heading. Like `isSticky`, it only collapses from `tablet` up, and expects\n * `size=\"sm\"` actions — see `children`.\n */\n variant?: 'default' | 'minimal';\n}\n\nconst BitkitPageHeader = forwardRef<HTMLElement, BitkitPageHeaderProps>((props, ref) => {\n const {\n avatar,\n badge,\n breadcrumb,\n children,\n contentVariant,\n controls,\n isSticky,\n secondaryText,\n tabs,\n title,\n variant,\n ...rest\n } = props;\n\n // Which slots the collapsed row drops, and whether it collapses at all, is decided entirely by\n // the recipe's `tablet`-scoped styles. Nothing here branches on the viewport: a breakpoint hook\n // would render the wrong layout on first paint, since Chakra's `useMediaQuery` returns its\n // fallback until after mount.\n\n // A slot's presence is its own toggle, so all of them share one emptiness test rather than plain\n // truthiness: an array whose entries all render nothing — `items.map()` where every branch is\n // `null` — is still truthy, and would otherwise render a wrapper that only contributes gap. For\n // `controls` it would also spread the row into three groups around an empty middle one.\n const hasAvatar = !isEmptyNode(avatar);\n const hasBadge = !isEmptyNode(badge);\n const hasBreadcrumb = !isEmptyNode(breadcrumb);\n const hasActions = !isEmptyNode(children);\n const hasSecondaryText = !isEmptyNode(secondaryText);\n const hasTabs = !isEmptyNode(tabs);\n\n // `BitkitOverflowTooltip` does no measuring of its own — it shows the tooltip unless told not to,\n // so each truncating text reports whether it is actually clipped and suppresses its own tooltip\n // when it is not. Keyed on the text so a change re-measures without waiting for a resize.\n const { isTruncated: isTitleTruncated, ref: titleRef } = useIsTruncated<HTMLHeadingElement>(title);\n const { isTruncated: isSecondaryTruncated, ref: secondaryRef } = useIsTruncated<HTMLParagraphElement>(secondaryText);\n\n // The design only draws inline controls in the collapsed row, so they are ignored in the\n // expanded layouts rather than left to land somewhere undesigned. `minimal` and `isSticky`\n // produce that row through the same `collapsedSlots`, so both have to honour them — gating on\n // `minimal` alone left `isSticky` rendering the identical row with the middle group missing.\n const isCollapsed = variant === 'minimal' || Boolean(isSticky);\n const showControls = !isEmptyNode(controls) && isCollapsed;\n\n // The collapsed row with a trail makes the title block `srOnly`, which is a 1px box — so the\n // measurement reports \"truncated\" for a heading nobody can see. Left alone that puts a tab stop\n // on an invisible element and opens a tooltip against it. The trail already carries the title as\n // its current item in exactly that layout, so there is nothing to surface anyway.\n const canShowTitleTooltip = isTitleTruncated && !(isCollapsed && hasBreadcrumb);\n\n const recipe = useSlotRecipe({ key: 'pageHeader' });\n const styles = recipe({\n contentVariant,\n hasBreadcrumb,\n hasControls: showControls,\n isSticky,\n variant,\n });\n\n // The controls are the middle of three groups, so they follow whichever element holds the left\n // slot: the trail when there is one, otherwise the title — which lives inside `contentBlock`, so\n // they have to go in there with it rather than beside it.\n const controlsNode = showControls ? <Box css={styles.controls}>{controls}</Box> : null;\n\n return (\n <Box as=\"header\" css={styles.root} ref={ref} {...rest}>\n <Box css={styles.headerBlock}>\n {hasBreadcrumb && <Box css={styles.breadcrumb}>{breadcrumb}</Box>}\n\n {hasBreadcrumb && controlsNode}\n\n <Box css={styles.contentBlock}>\n <Box css={styles.titleBlock}>\n {hasAvatar && <Box css={styles.avatar}>{avatar}</Box>}\n\n <Box css={styles.textBlock}>\n <Box css={styles.titleRow}>\n <BitkitOverflowTooltip disabled={!canShowTitleTooltip} text={title}>\n {/*\n `tabIndex` only while truncated: the tooltip trigger is rendered `asChild`, so an\n `h1` stays unfocusable and the full title would be mouse-only. Adding the tab\n stop unconditionally would put one in every header for no benefit.\n */}\n <Text as=\"h1\" css={styles.title} ref={titleRef} tabIndex={canShowTitleTooltip ? 0 : undefined}>\n {title}\n </Text>\n </BitkitOverflowTooltip>\n {hasBadge && <Box css={styles.badge}>{badge}</Box>}\n </Box>\n\n {hasSecondaryText && secondaryText !== undefined && (\n <BitkitOverflowTooltip disabled={!isSecondaryTruncated} text={secondaryText}>\n <Text css={styles.secondaryText} ref={secondaryRef} tabIndex={isSecondaryTruncated ? 0 : undefined}>\n {secondaryText}\n </Text>\n </BitkitOverflowTooltip>\n )}\n </Box>\n </Box>\n\n {!hasBreadcrumb && controlsNode}\n\n {hasActions && <Box css={styles.actionBlock}>{children}</Box>}\n </Box>\n </Box>\n\n {hasTabs && <Box css={styles.tabs}>{tabs}</Box>}\n </Box>\n );\n});\n\nBitkitPageHeader.displayName = 'BitkitPageHeader';\n\nexport default BitkitPageHeader;\n"],"mappings":";;;;;;;;;AA8HA,IAAM,mBAAmB,YAAgD,OAAO,QAAQ;CACtF,MAAM,EACJ,QACA,OACA,YACA,UACA,gBACA,UACA,UACA,eACA,MACA,OACA,SACA,GAAG,SACD;CAWJ,MAAM,YAAY,CAAC,YAAY,MAAM;CACrC,MAAM,WAAW,CAAC,YAAY,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AAA;WACjF,UAAA;UACG,CAAA;SACe,CAAA,GACtB,YAAY,oBAAC,KAAD;UAAK,KAAK,OAAO;UAAQ,UAAA;SAAW,CAAA,CAC9C;QAEJ,CAAA,GAAA,oBAAoB,kBAAkB,KAAA,KACrC,oBAAC,uBAAD;SAAuB,UAAU,CAAC;SAAsB,MAAM;SAC5D,UAAA,oBAAC,MAAD;UAAM,KAAK,OAAO;UAAe,KAAK;UAAc,UAAU,uBAAuB,IAAI,KAAA;UACtF,UAAA;SACG,CAAA;QACe,CAAA,CAEtB;OACF,CAAA,CAAA;;MAEJ,CAAC,iBAAiB;MAElB,cAAc,oBAAC,KAAD;OAAK,KAAK,OAAO;OAAc;MAAc,CAAA;KACzD;;GACF;EAEJ,CAAA,GAAA,WAAW,oBAAC,KAAD;GAAK,KAAK,OAAO;GAAO,UAAA;EAAU,CAAA,CAC3C;;AAET,CAAC;AAED,iBAAiB,cAAc"}
@@ -1,74 +0,0 @@
1
- import { BoxProps } from '@chakra-ui/react/box';
2
- import { SeparatorProps } from '@chakra-ui/react/separator';
3
- import { HTMLChakraProps } from '@chakra-ui/react/styled-system';
4
- import { ReactNode } from 'react';
5
- import { BitkitIconComponent } from '../../icons';
6
- import { BitkitGroupHeadingProps } from '../BitkitGroupHeading/BitkitGroupHeading';
7
- export interface BitkitPageSidebarProps extends BoxProps {
8
- children: ReactNode;
9
- }
10
- interface BitkitPageSidebarItemCommonProps {
11
- badge?: ReactNode;
12
- /**
13
- * The item's label. Typed as a string rather than `ReactNode` because the row truncates it with
14
- * an ellipsis, and the overflow tooltip needs the full text to reveal.
15
- */
16
- children: string;
17
- icon?: BitkitIconComponent;
18
- /**
19
- * Marks the item as the current page. Mutually exclusive with `state="disabled"` — you cannot be
20
- * on a page whose nav item is unavailable — but the two are not type-checked against each other:
21
- * the combination only ever arrives from a computed `selected`, which no union can catch, and
22
- * checking it would break the ordinary `selected={item.id === currentId}` mapping. If both do
23
- * turn up, disabled wins, since that is the one of the two the design actually defines.
24
- */
25
- selected?: boolean;
26
- state?: 'disabled';
27
- suffixIcon?: BitkitIconComponent;
28
- }
29
- interface BitkitPageSidebarItemLinkProps extends Omit<HTMLChakraProps<'a'>, 'children'>, BitkitPageSidebarItemCommonProps {
30
- href: string;
31
- }
32
- interface BitkitPageSidebarItemButtonProps extends Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'>, BitkitPageSidebarItemCommonProps {
33
- href?: never;
34
- }
35
- export type BitkitPageSidebarItemProps = BitkitPageSidebarItemButtonProps | BitkitPageSidebarItemLinkProps;
36
- interface BitkitPageSidebarTitleCommonProps extends BoxProps {
37
- backLabel?: string;
38
- children: ReactNode;
39
- }
40
- interface BitkitPageSidebarTitleLinkProps extends BitkitPageSidebarTitleCommonProps {
41
- backHref: string;
42
- onBackClick?: never;
43
- }
44
- interface BitkitPageSidebarTitleButtonProps extends BitkitPageSidebarTitleCommonProps {
45
- backHref?: never;
46
- onBackClick: () => void;
47
- }
48
- interface BitkitPageSidebarTitlePlainProps extends BitkitPageSidebarTitleCommonProps {
49
- backHref?: never;
50
- onBackClick?: never;
51
- }
52
- export type BitkitPageSidebarTitleProps = BitkitPageSidebarTitleButtonProps | BitkitPageSidebarTitleLinkProps | BitkitPageSidebarTitlePlainProps;
53
- export interface BitkitPageSidebarBodyProps extends BoxProps {
54
- children: ReactNode;
55
- }
56
- export interface BitkitPageSidebarFooterProps extends BoxProps {
57
- children: ReactNode;
58
- }
59
- export interface BitkitPageSidebarProjectProps extends BoxProps {
60
- label: string;
61
- value: string;
62
- }
63
- export type BitkitPageSidebarGroupHeadingProps = BitkitGroupHeadingProps;
64
- export type BitkitPageSidebarDividerProps = SeparatorProps;
65
- declare const _default: import('react').ForwardRefExoticComponent<BitkitPageSidebarProps & import('react').RefAttributes<HTMLElement>> & {
66
- Body: import('react').ForwardRefExoticComponent<BitkitPageSidebarBodyProps & import('react').RefAttributes<HTMLDivElement>>;
67
- Divider: import('react').ForwardRefExoticComponent<SeparatorProps & import('react').RefAttributes<HTMLDivElement>>;
68
- Footer: import('react').ForwardRefExoticComponent<BitkitPageSidebarFooterProps & import('react').RefAttributes<HTMLDivElement>>;
69
- GroupHeading: import('react').ForwardRefExoticComponent<BitkitGroupHeadingProps & import('react').RefAttributes<HTMLDivElement>>;
70
- Item: import('react').ForwardRefExoticComponent<BitkitPageSidebarItemProps & import('react').RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
71
- Project: import('react').ForwardRefExoticComponent<BitkitPageSidebarProjectProps & import('react').RefAttributes<HTMLDivElement>>;
72
- Title: import('react').ForwardRefExoticComponent<BitkitPageSidebarTitleProps & import('react').RefAttributes<HTMLDivElement>>;
73
- };
74
- export default _default;
@@ -1,263 +0,0 @@
1
- import { withSubComponents } from "../../utilities/withSubComponents.js";
2
- import IconChevronLeft from "../../icons/IconChevronLeft.js";
3
- import BitkitControlButton from "../BitkitControlButton/BitkitControlButton.js";
4
- import BitkitGroupHeading from "../BitkitGroupHeading/BitkitGroupHeading.js";
5
- import BitkitOverflowTooltip from "../BitkitOverflowTooltip/BitkitOverflowTooltip.js";
6
- import useIsTruncated from "../../utilities/useIsTruncated.js";
7
- import { Box } from "@chakra-ui/react/box";
8
- import { chakra, useSlotRecipe } from "@chakra-ui/react/styled-system";
9
- import { forwardRef } from "react";
10
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
- import { Separator } from "@chakra-ui/react/separator";
12
- import { Text } from "@chakra-ui/react/text";
13
- //#region lib/components/BitkitPageSidebar/BitkitPageSidebar.tsx
14
- var showAtDesktop = { display: {
15
- base: "none",
16
- tablet: "block"
17
- } };
18
- var showAtMobile = { display: {
19
- base: "block",
20
- tablet: "none"
21
- } };
22
- /**
23
- * Page-level navigation sidebar. It expects three children, in this order:
24
- *
25
- * ```tsx
26
- * <BitkitPageSidebar>
27
- * <BitkitPageSidebar.Title>Title</BitkitPageSidebar.Title>
28
- * <BitkitPageSidebar.Body>
29
- * <BitkitPageSidebar.Item icon={IconWorkflow}>Workflows</BitkitPageSidebar.Item>
30
- * </BitkitPageSidebar.Body>
31
- * <BitkitPageSidebar.Footer>…</BitkitPageSidebar.Footer>
32
- * </BitkitPageSidebar>
33
- * ```
34
- *
35
- * `Title` and `Footer` are optional. The sidebar scrolls as a single block: when the navigation is
36
- * taller than the viewport the whole thing — footer included — grows and scrolls with the page,
37
- * which is why `Body` keeps a minimum gap above the footer so the two blocks never touch.
38
- *
39
- * The `<nav>` carries a default `aria-label` so it is not announced as an unnamed landmark. A page
40
- * with more than one sidebar should name each one — pass your own `aria-label` (or
41
- * `aria-labelledby`), which overrides the default.
42
- *
43
- * It stands at least viewport-tall by default. An embedded panel that should size to its content
44
- * opts out with `minHeight="auto"`.
45
- *
46
- * Below the `tablet` breakpoint it switches to the mobile design on its own — full width, 48px
47
- * rows, larger icons and labels, a squared-off selection edge. There is no prop for it: a sidebar
48
- * that narrow is a sidebar filling a phone.
49
- */
50
- var BitkitPageSidebar = forwardRef((props, ref) => {
51
- const { children, ...rest } = props;
52
- const styles = useSlotRecipe({ key: "pageSidebar" })();
53
- return /* @__PURE__ */ jsx(Box, {
54
- ref,
55
- "aria-label": "Page navigation",
56
- asChild: true,
57
- css: styles.root,
58
- ...rest,
59
- children: /* @__PURE__ */ jsx("nav", { children })
60
- });
61
- });
62
- BitkitPageSidebar.displayName = "BitkitPageSidebar";
63
- var BitkitPageSidebarItem = forwardRef((props, ref) => {
64
- const { badge, children, icon: Icon, selected, state, suffixIcon: SuffixIcon, ...rest } = props;
65
- const isDisabled = state === "disabled";
66
- const isSelected = selected === true && !isDisabled;
67
- const styles = useSlotRecipe({ key: "pageSidebar" })({
68
- isDisabled,
69
- selected: isSelected
70
- });
71
- const VisibleSuffixIcon = isSelected || isDisabled ? void 0 : SuffixIcon;
72
- const { isTruncated, ref: labelRef } = useIsTruncated(children);
73
- const itemContent = /* @__PURE__ */ jsxs(Fragment$1, { children: [
74
- /* @__PURE__ */ jsxs(Box, {
75
- as: "span",
76
- css: styles.contentBlock,
77
- children: [Icon && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, {
78
- css: [styles.itemIcon, showAtDesktop],
79
- size: "16"
80
- }), /* @__PURE__ */ jsx(Icon, {
81
- css: [styles.itemIcon, showAtMobile],
82
- size: "24"
83
- })] }), /* @__PURE__ */ jsx(Text, {
84
- as: "span",
85
- css: styles.itemLabel,
86
- ref: labelRef,
87
- children
88
- })]
89
- }),
90
- badge,
91
- VisibleSuffixIcon && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(VisibleSuffixIcon, {
92
- css: [styles.suffixIcon, showAtDesktop],
93
- size: "16"
94
- }), /* @__PURE__ */ jsx(VisibleSuffixIcon, {
95
- css: [styles.suffixIcon, showAtMobile],
96
- size: "24"
97
- })] }),
98
- isSelected && /* @__PURE__ */ jsx(Box, {
99
- as: "span",
100
- css: styles.selectionMarker
101
- })
102
- ] });
103
- const withTooltip = (row) => /* @__PURE__ */ jsx(BitkitOverflowTooltip, {
104
- disabled: !isTruncated,
105
- text: children,
106
- children: row
107
- });
108
- if (rest.href !== void 0) {
109
- const { className, href, onClick, onKeyDown, ...linkRest } = rest;
110
- const handleClick = isDisabled ? (event) => {
111
- event.preventDefault();
112
- event.stopPropagation();
113
- } : onClick;
114
- const handleKeyDown = isDisabled ? (event) => {
115
- if (event.key === "Enter" || event.key === " ") {
116
- event.preventDefault();
117
- event.stopPropagation();
118
- }
119
- } : onKeyDown;
120
- return withTooltip(/* @__PURE__ */ jsx(chakra.a, {
121
- ref,
122
- ...linkRest,
123
- "aria-current": isSelected ? "page" : void 0,
124
- "aria-disabled": isDisabled || void 0,
125
- className: className ? `group ${className}` : "group",
126
- css: styles.item,
127
- href: isDisabled ? void 0 : href,
128
- onClick: handleClick,
129
- onKeyDown: handleKeyDown,
130
- children: itemContent
131
- }));
132
- }
133
- const { className, href: _href, ...buttonRest } = rest;
134
- return withTooltip(/* @__PURE__ */ jsx(chakra.button, {
135
- ref,
136
- ...buttonRest,
137
- "aria-current": isSelected ? "page" : void 0,
138
- className: className ? `group ${className}` : "group",
139
- css: styles.item,
140
- disabled: isDisabled,
141
- type: "button",
142
- children: itemContent
143
- }));
144
- });
145
- BitkitPageSidebarItem.displayName = "BitkitPageSidebarItem";
146
- var BitkitPageSidebarTitle = forwardRef((props, ref) => {
147
- const { backHref, backLabel = "Back", children, onBackClick, ...rest } = props;
148
- const hasBack = backHref !== void 0 || onBackClick !== void 0;
149
- const styles = useSlotRecipe({ key: "pageSidebar" })({ hasBack });
150
- return /* @__PURE__ */ jsx(Box, {
151
- ref,
152
- css: styles.title,
153
- ...rest,
154
- children: /* @__PURE__ */ jsxs(Box, {
155
- css: styles.titleBlock,
156
- children: [hasBack && (backHref !== void 0 ? /* @__PURE__ */ jsx(BitkitControlButton, {
157
- href: backHref,
158
- icon: IconChevronLeft,
159
- label: backLabel,
160
- size: "xs",
161
- tooltipProps: { placement: "right" }
162
- }) : /* @__PURE__ */ jsx(BitkitControlButton, {
163
- icon: IconChevronLeft,
164
- label: backLabel,
165
- onClick: onBackClick,
166
- size: "xs",
167
- tooltipProps: { placement: "right" }
168
- })), /* @__PURE__ */ jsx(Text, {
169
- as: "span",
170
- css: styles.titleText,
171
- children
172
- })]
173
- })
174
- });
175
- });
176
- BitkitPageSidebarTitle.displayName = "BitkitPageSidebarTitle";
177
- /**
178
- * Holds the navigation items. It absorbs the space left between `Title` and `Footer`, so the footer
179
- * sits at the bottom of the viewport on a short navigation, and keeps a minimum gap above the
180
- * footer so the two blocks stay visually separate however long the list gets.
181
- */
182
- var BitkitPageSidebarBody = forwardRef((props, ref) => {
183
- const { children, ...rest } = props;
184
- const styles = useSlotRecipe({ key: "pageSidebar" })();
185
- return /* @__PURE__ */ jsx(Box, {
186
- ref,
187
- css: styles.body,
188
- ...rest,
189
- children
190
- });
191
- });
192
- BitkitPageSidebarBody.displayName = "BitkitPageSidebarBody";
193
- var BitkitPageSidebarFooter = forwardRef((props, ref) => {
194
- const { children, ...rest } = props;
195
- const styles = useSlotRecipe({ key: "pageSidebar" })();
196
- return /* @__PURE__ */ jsx(Box, {
197
- ref,
198
- css: styles.footer,
199
- ...rest,
200
- children
201
- });
202
- });
203
- BitkitPageSidebarFooter.displayName = "BitkitPageSidebarFooter";
204
- var BitkitPageSidebarProject = forwardRef((props, ref) => {
205
- const { label, value, ...rest } = props;
206
- const styles = useSlotRecipe({ key: "pageSidebar" })();
207
- const { isTruncated, ref: valueRef } = useIsTruncated(value);
208
- return /* @__PURE__ */ jsxs(Box, {
209
- ref,
210
- css: styles.project,
211
- ...rest,
212
- children: [/* @__PURE__ */ jsx(Text, {
213
- as: "span",
214
- css: styles.projectLabel,
215
- children: label
216
- }), /* @__PURE__ */ jsx(BitkitOverflowTooltip, {
217
- disabled: !isTruncated,
218
- text: value,
219
- children: /* @__PURE__ */ jsx(Box, {
220
- css: styles.projectValueWrapper,
221
- children: /* @__PURE__ */ jsx(Text, {
222
- as: "span",
223
- css: styles.projectValue,
224
- ref: valueRef,
225
- children: value
226
- })
227
- })
228
- })]
229
- });
230
- });
231
- BitkitPageSidebarProject.displayName = "BitkitPageSidebarProject";
232
- var BitkitPageSidebarGroupHeading = forwardRef((props, ref) => {
233
- return /* @__PURE__ */ jsx(BitkitGroupHeading, {
234
- ref,
235
- paddingBlockEnd: "8",
236
- paddingBlockStart: "16",
237
- paddingInline: "24",
238
- ...props
239
- });
240
- });
241
- BitkitPageSidebarGroupHeading.displayName = "BitkitPageSidebarGroupHeading";
242
- var BitkitPageSidebarDivider = forwardRef((props, ref) => {
243
- const styles = useSlotRecipe({ key: "pageSidebar" })();
244
- return /* @__PURE__ */ jsx(Separator, {
245
- ref,
246
- css: styles.divider,
247
- ...props
248
- });
249
- });
250
- BitkitPageSidebarDivider.displayName = "BitkitPageSidebarDivider";
251
- var BitkitPageSidebar_default = withSubComponents(BitkitPageSidebar, {
252
- Body: BitkitPageSidebarBody,
253
- Divider: BitkitPageSidebarDivider,
254
- Footer: BitkitPageSidebarFooter,
255
- GroupHeading: BitkitPageSidebarGroupHeading,
256
- Item: BitkitPageSidebarItem,
257
- Project: BitkitPageSidebarProject,
258
- Title: BitkitPageSidebarTitle
259
- });
260
- //#endregion
261
- export { BitkitPageSidebar_default as default };
262
-
263
- //# sourceMappingURL=BitkitPageSidebar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BitkitPageSidebar.js","names":[],"sources":["../../../lib/components/BitkitPageSidebar/BitkitPageSidebar.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { Separator, type SeparatorProps } from '@chakra-ui/react/separator';\nimport { chakra, type HTMLChakraProps, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type KeyboardEvent, type MouseEvent, type ReactNode, type Ref } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport IconChevronLeft from '../../icons/IconChevronLeft';\nimport useIsTruncated from '../../utilities/useIsTruncated';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitkitControlButton from '../BitkitControlButton/BitkitControlButton';\nimport BitkitGroupHeading, { type BitkitGroupHeadingProps } from '../BitkitGroupHeading/BitkitGroupHeading';\nimport BitkitOverflowTooltip from '../BitkitOverflowTooltip/BitkitOverflowTooltip';\n\n// The 16 and 24 icons are separate drawings, not one scaled to two sizes, so the breakpoint swap\n// cannot live in the recipe — both are rendered and one is hidden. A `useBreakpointValue` would\n// render a single icon, but it only re-reads on mount: resize a live page across `tablet` and the\n// row resizes underneath an icon that keeps its old size.\nconst showAtDesktop = { display: { base: 'none', tablet: 'block' } };\nconst showAtMobile = { display: { base: 'block', tablet: 'none' } };\n\n// ----- BitkitPageSidebar (Root) -----\n\nexport interface BitkitPageSidebarProps extends BoxProps {\n children: ReactNode;\n}\n\n/**\n * Page-level navigation sidebar. It expects three children, in this order:\n *\n * ```tsx\n * <BitkitPageSidebar>\n * <BitkitPageSidebar.Title>Title</BitkitPageSidebar.Title>\n * <BitkitPageSidebar.Body>\n * <BitkitPageSidebar.Item icon={IconWorkflow}>Workflows</BitkitPageSidebar.Item>\n * </BitkitPageSidebar.Body>\n * <BitkitPageSidebar.Footer>…</BitkitPageSidebar.Footer>\n * </BitkitPageSidebar>\n * ```\n *\n * `Title` and `Footer` are optional. The sidebar scrolls as a single block: when the navigation is\n * taller than the viewport the whole thing — footer included — grows and scrolls with the page,\n * which is why `Body` keeps a minimum gap above the footer so the two blocks never touch.\n *\n * The `<nav>` carries a default `aria-label` so it is not announced as an unnamed landmark. A page\n * with more than one sidebar should name each one — pass your own `aria-label` (or\n * `aria-labelledby`), which overrides the default.\n *\n * It stands at least viewport-tall by default. An embedded panel that should size to its content\n * opts out with `minHeight=\"auto\"`.\n *\n * Below the `tablet` breakpoint it switches to the mobile design on its own — full width, 48px\n * rows, larger icons and labels, a squared-off selection edge. There is no prop for it: a sidebar\n * that narrow is a sidebar filling a phone.\n */\nconst BitkitPageSidebar = forwardRef<HTMLElement, BitkitPageSidebarProps>((props, ref) => {\n const { children, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'pageSidebar' });\n const styles = recipe();\n\n return (\n <Box ref={ref} aria-label=\"Page navigation\" asChild css={styles.root} {...rest}>\n <nav>{children}</nav>\n </Box>\n );\n});\n\nBitkitPageSidebar.displayName = 'BitkitPageSidebar';\n\n// ----- BitkitPageSidebar.Item -----\n\ninterface BitkitPageSidebarItemCommonProps {\n badge?: ReactNode;\n /**\n * The item's label. Typed as a string rather than `ReactNode` because the row truncates it with\n * an ellipsis, and the overflow tooltip needs the full text to reveal.\n */\n children: string;\n icon?: BitkitIconComponent;\n /**\n * Marks the item as the current page. Mutually exclusive with `state=\"disabled\"` — you cannot be\n * on a page whose nav item is unavailable — but the two are not type-checked against each other:\n * the combination only ever arrives from a computed `selected`, which no union can catch, and\n * checking it would break the ordinary `selected={item.id === currentId}` mapping. If both do\n * turn up, disabled wins, since that is the one of the two the design actually defines.\n */\n selected?: boolean;\n state?: 'disabled';\n suffixIcon?: BitkitIconComponent;\n}\n\ninterface BitkitPageSidebarItemLinkProps\n extends Omit<HTMLChakraProps<'a'>, 'children'>, BitkitPageSidebarItemCommonProps {\n href: string;\n}\n\ninterface BitkitPageSidebarItemButtonProps\n extends Omit<HTMLChakraProps<'button'>, 'children' | 'disabled'>, BitkitPageSidebarItemCommonProps {\n href?: never;\n}\n\nexport type BitkitPageSidebarItemProps = BitkitPageSidebarItemButtonProps | BitkitPageSidebarItemLinkProps;\n\nconst BitkitPageSidebarItem = forwardRef<HTMLButtonElement | HTMLAnchorElement, BitkitPageSidebarItemProps>(\n (props, ref) => {\n const { badge, children, icon: Icon, selected, state, suffixIcon: SuffixIcon, ...rest } = props;\n\n const isDisabled = state === 'disabled';\n // `selected` and `state=\"disabled\"` are not checked against each other in the types, so this is\n // the single place the overlap is resolved: disabled wins, and the two recipe variants can never\n // both claim the same slot.\n const isSelected = selected === true && !isDisabled;\n\n const recipe = useSlotRecipe({ key: 'pageSidebar' });\n const styles = recipe({ isDisabled, selected: isSelected });\n\n // The design gives neither a selected row nor a disabled one a trailing icon — the desktop\n // (`20014:6498`, `20014:6494`) and mobile (`9221:4417`) items drop it in those states.\n const VisibleSuffixIcon = isSelected || isDisabled ? undefined : SuffixIcon;\n\n const { isTruncated, ref: labelRef } = useIsTruncated<HTMLSpanElement>(children);\n\n const itemContent = (\n <>\n {/* `span`, not the default `div`: in button mode these sit inside a `<button>`, whose\n content model allows phrasing content only. */}\n <Box as=\"span\" css={styles.contentBlock}>\n {Icon && (\n <>\n <Icon css={[styles.itemIcon, showAtDesktop]} size=\"16\" />\n <Icon css={[styles.itemIcon, showAtMobile]} size=\"24\" />\n </>\n )}\n <Text as=\"span\" css={styles.itemLabel} ref={labelRef}>\n {children}\n </Text>\n </Box>\n {badge}\n {VisibleSuffixIcon && (\n <>\n <VisibleSuffixIcon css={[styles.suffixIcon, showAtDesktop]} size=\"16\" />\n <VisibleSuffixIcon css={[styles.suffixIcon, showAtMobile]} size=\"24\" />\n </>\n )}\n {isSelected && <Box as=\"span\" css={styles.selectionMarker} />}\n </>\n );\n\n // The overflow tooltip anchors to the row itself, which is the focusable element: anchored to an\n // inner node it would only ever open on hover, leaving keyboard users unable to read a truncated\n // label. `Tooltip.Trigger` renders `asChild` and composes refs, so the consumer's forwarded ref\n // survives, and the ref measuring the truncation sits on the label further in.\n const withTooltip = (row: ReactNode) => (\n <BitkitOverflowTooltip disabled={!isTruncated} text={children}>\n {row}\n </BitkitOverflowTooltip>\n );\n\n // `chakra.a` / `chakra.button` rather than a named primitive: the item carries its own slot recipe,\n // and Chakra's `Button`/`Link` would layer their own recipe styles on top of it.\n if (rest.href !== undefined) {\n const { className, href, onClick, onKeyDown, ...linkRest } = rest;\n const handleClick = isDisabled\n ? (event: MouseEvent<HTMLAnchorElement>) => {\n event.preventDefault();\n event.stopPropagation();\n }\n : onClick;\n const handleKeyDown = isDisabled\n ? (event: KeyboardEvent<HTMLAnchorElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n : onKeyDown;\n\n return withTooltip(\n <chakra.a\n ref={ref as Ref<HTMLAnchorElement>}\n {...linkRest}\n aria-current={isSelected ? 'page' : undefined}\n aria-disabled={isDisabled || undefined}\n className={className ? `group ${className}` : 'group'}\n css={styles.item}\n // Dropping the attribute is what actually disables the link, the way `BitkitLink` and\n // `BitkitControlButton` do it. The handlers below only block `click` and `Enter`/`Space`;\n // a middle click fires `auxclick`, and \"Open link in new tab\" never reaches the page at\n // all, so both would still navigate while an `href` is there to follow.\n href={isDisabled ? undefined : href}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n {itemContent}\n </chakra.a>,\n );\n }\n\n const { className, href: _href, ...buttonRest } = rest;\n\n return withTooltip(\n <chakra.button\n ref={ref as Ref<HTMLButtonElement>}\n {...buttonRest}\n aria-current={isSelected ? 'page' : undefined}\n className={className ? `group ${className}` : 'group'}\n css={styles.item}\n disabled={isDisabled}\n type=\"button\"\n >\n {itemContent}\n </chakra.button>,\n );\n },\n);\n\nBitkitPageSidebarItem.displayName = 'BitkitPageSidebarItem';\n\n// ----- BitkitPageSidebar.Title -----\n\ninterface BitkitPageSidebarTitleCommonProps extends BoxProps {\n backLabel?: string;\n children: ReactNode;\n}\n\ninterface BitkitPageSidebarTitleLinkProps extends BitkitPageSidebarTitleCommonProps {\n backHref: string;\n onBackClick?: never;\n}\n\ninterface BitkitPageSidebarTitleButtonProps extends BitkitPageSidebarTitleCommonProps {\n backHref?: never;\n onBackClick: () => void;\n}\n\ninterface BitkitPageSidebarTitlePlainProps extends BitkitPageSidebarTitleCommonProps {\n backHref?: never;\n onBackClick?: never;\n}\n\nexport type BitkitPageSidebarTitleProps =\n | BitkitPageSidebarTitleButtonProps\n | BitkitPageSidebarTitleLinkProps\n | BitkitPageSidebarTitlePlainProps;\n\nconst BitkitPageSidebarTitle = forwardRef<HTMLDivElement, BitkitPageSidebarTitleProps>((props, ref) => {\n const { backHref, backLabel = 'Back', children, onBackClick, ...rest } = props;\n\n const hasBack = backHref !== undefined || onBackClick !== undefined;\n\n const recipe = useSlotRecipe({ key: 'pageSidebar' });\n const styles = recipe({ hasBack });\n\n return (\n <Box ref={ref} css={styles.title} {...rest}>\n <Box css={styles.titleBlock}>\n {/* The label tooltip opens to the right. Its default `top` has nowhere to go here — the\n button sits at the very top of the sidebar, so the tooltip jams against the viewport\n edge and covers the header instead of flipping. */}\n {hasBack &&\n (backHref !== undefined ? (\n <BitkitControlButton\n href={backHref}\n icon={IconChevronLeft}\n label={backLabel}\n size=\"xs\"\n tooltipProps={{ placement: 'right' }}\n />\n ) : (\n <BitkitControlButton\n icon={IconChevronLeft}\n label={backLabel}\n onClick={onBackClick}\n size=\"xs\"\n tooltipProps={{ placement: 'right' }}\n />\n ))}\n <Text as=\"span\" css={styles.titleText}>\n {children}\n </Text>\n </Box>\n </Box>\n );\n});\n\nBitkitPageSidebarTitle.displayName = 'BitkitPageSidebarTitle';\n\n// ----- BitkitPageSidebar.Body -----\n\nexport interface BitkitPageSidebarBodyProps extends BoxProps {\n children: ReactNode;\n}\n\n/**\n * Holds the navigation items. It absorbs the space left between `Title` and `Footer`, so the footer\n * sits at the bottom of the viewport on a short navigation, and keeps a minimum gap above the\n * footer so the two blocks stay visually separate however long the list gets.\n */\nconst BitkitPageSidebarBody = forwardRef<HTMLDivElement, BitkitPageSidebarBodyProps>((props, ref) => {\n const { children, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'pageSidebar' });\n const styles = recipe();\n\n return (\n <Box ref={ref} css={styles.body} {...rest}>\n {children}\n </Box>\n );\n});\n\nBitkitPageSidebarBody.displayName = 'BitkitPageSidebarBody';\n\n// ----- BitkitPageSidebar.Footer -----\n\nexport interface BitkitPageSidebarFooterProps extends BoxProps {\n children: ReactNode;\n}\n\nconst BitkitPageSidebarFooter = forwardRef<HTMLDivElement, BitkitPageSidebarFooterProps>((props, ref) => {\n const { children, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'pageSidebar' });\n const styles = recipe();\n\n return (\n <Box ref={ref} css={styles.footer} {...rest}>\n {children}\n </Box>\n );\n});\n\nBitkitPageSidebarFooter.displayName = 'BitkitPageSidebarFooter';\n\n// ----- BitkitPageSidebar.Project -----\n\nexport interface BitkitPageSidebarProjectProps extends BoxProps {\n label: string;\n value: string;\n}\n\nconst BitkitPageSidebarProject = forwardRef<HTMLDivElement, BitkitPageSidebarProjectProps>((props, ref) => {\n const { label, value, ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'pageSidebar' });\n const styles = recipe();\n\n const { isTruncated, ref: valueRef } = useIsTruncated<HTMLSpanElement>(value);\n\n return (\n <Box ref={ref} css={styles.project} {...rest}>\n <Text as=\"span\" css={styles.projectLabel}>\n {label}\n </Text>\n {/* Wrapper for the same reason as in Item: the trigger cannot be the element being measured. */}\n <BitkitOverflowTooltip disabled={!isTruncated} text={value}>\n <Box css={styles.projectValueWrapper}>\n <Text as=\"span\" css={styles.projectValue} ref={valueRef}>\n {value}\n </Text>\n </Box>\n </BitkitOverflowTooltip>\n </Box>\n );\n});\n\nBitkitPageSidebarProject.displayName = 'BitkitPageSidebarProject';\n\n// ----- BitkitPageSidebar.GroupHeading -----\n\nexport type BitkitPageSidebarGroupHeadingProps = BitkitGroupHeadingProps;\n\nconst BitkitPageSidebarGroupHeading = forwardRef<HTMLDivElement, BitkitPageSidebarGroupHeadingProps>((props, ref) => {\n return <BitkitGroupHeading ref={ref} paddingBlockEnd=\"8\" paddingBlockStart=\"16\" paddingInline=\"24\" {...props} />;\n});\n\nBitkitPageSidebarGroupHeading.displayName = 'BitkitPageSidebarGroupHeading';\n\n// ----- BitkitPageSidebar.Divider -----\n\nexport type BitkitPageSidebarDividerProps = SeparatorProps;\n\nconst BitkitPageSidebarDivider = forwardRef<HTMLDivElement, BitkitPageSidebarDividerProps>((props, ref) => {\n const recipe = useSlotRecipe({ key: 'pageSidebar' });\n const styles = recipe();\n\n return <Separator ref={ref} css={styles.divider} {...props} />;\n});\n\nBitkitPageSidebarDivider.displayName = 'BitkitPageSidebarDivider';\n\nexport default withSubComponents(BitkitPageSidebar, {\n Body: BitkitPageSidebarBody,\n Divider: BitkitPageSidebarDivider,\n Footer: BitkitPageSidebarFooter,\n GroupHeading: BitkitPageSidebarGroupHeading,\n Item: BitkitPageSidebarItem,\n Project: BitkitPageSidebarProject,\n Title: BitkitPageSidebarTitle,\n});\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAM,gBAAgB,EAAE,SAAS;CAAE,MAAM;CAAQ,QAAQ;AAAQ,EAAE;AACnE,IAAM,eAAe,EAAE,SAAS;CAAE,MAAM;CAAS,QAAQ;AAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoClE,IAAM,oBAAoB,YAAiD,OAAO,QAAQ;CACxF,MAAM,EAAE,UAAU,GAAG,SAAS;CAG9B,MAAM,SADS,cAAc,EAAE,KAAK,cAAc,CACnC,CAAA,CAAO;CAEtB,OAC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;EACG,CAAA,GAEN,oBAAC,uBAAD;GAAuB,UAAU,CAAC;GAAa,MAAM;GACnD,UAAA,oBAAC,KAAD;IAAK,KAAK,OAAO;IACf,UAAA,oBAAC,MAAD;KAAM,IAAG;KAAO,KAAK,OAAO;KAAc,KAAK;KAC5C,UAAA;IACG,CAAA;GACH,CAAA;EACgB,CAAA,CACpB;;AAET,CAAC;AAED,yBAAyB,cAAc;AAMvC,IAAM,gCAAgC,YAAgE,OAAO,QAAQ;CACnH,OAAO,oBAAC,oBAAD;EAAyB;EAAK,iBAAgB;EAAI,mBAAkB;EAAK,eAAc;EAAK,GAAI;CAAQ,CAAA;AACjH,CAAC;AAED,8BAA8B,cAAc;AAM5C,IAAM,2BAA2B,YAA2D,OAAO,QAAQ;CAEzG,MAAM,SADS,cAAc,EAAE,KAAK,cAAc,CACnC,CAAA,CAAO;CAEtB,OAAO,oBAAC,WAAD;EAAgB;EAAK,KAAK,OAAO;EAAS,GAAI;CAAQ,CAAA;AAC/D,CAAC;AAED,yBAAyB,cAAc;AAEvC,IAAA,4BAAe,kBAAkB,mBAAmB;CAClD,MAAM;CACN,SAAS;CACT,QAAQ;CACR,cAAc;CACd,MAAM;CACN,SAAS;CACT,OAAO;AACT,CAAC"}
@@ -1,202 +0,0 @@
1
- declare const pageHeaderSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"title" | "badge" | "avatar" | "breadcrumb" | "tabs" | "root" | "secondaryText" | "controls" | "titleBlock" | "headerBlock" | "contentBlock" | "textBlock" | "titleRow" | "actionBlock", {
2
- contentVariant: {
3
- title: {
4
- titleBlock: {
5
- alignItems: "center";
6
- gap: "12";
7
- };
8
- textBlock: {
9
- gap: "4";
10
- };
11
- };
12
- app: {
13
- titleBlock: {
14
- gap: "16";
15
- alignItems: "center";
16
- };
17
- title: {
18
- readonly textStyle: {
19
- readonly base: "heading/mobile/h2";
20
- readonly tablet: "heading/h2";
21
- };
22
- };
23
- secondaryText: {
24
- readonly textStyle: "body/md/regular";
25
- };
26
- };
27
- user: {
28
- titleBlock: {
29
- gap: "12";
30
- alignItems: "center";
31
- };
32
- title: {
33
- readonly textStyle: {
34
- readonly base: "heading/mobile/h2";
35
- readonly tablet: "heading/h2";
36
- };
37
- };
38
- secondaryText: {
39
- readonly textStyle: "body/md/regular";
40
- };
41
- };
42
- };
43
- hasBreadcrumb: {
44
- true: {
45
- headerBlock: {
46
- paddingBlockStart: "24";
47
- };
48
- };
49
- false: {};
50
- };
51
- hasControls: {
52
- true: {};
53
- false: {};
54
- };
55
- isSticky: {
56
- true: {
57
- headerBlock: {
58
- readonly tablet: {
59
- readonly alignItems: "center";
60
- readonly flexDirection: "row";
61
- readonly gap: "24";
62
- readonly minHeight: string;
63
- readonly paddingBlockEnd: "12";
64
- readonly paddingBlockStart: "12";
65
- readonly paddingInlineEnd: "32";
66
- readonly paddingInlineStart: "24";
67
- };
68
- };
69
- breadcrumb: {
70
- readonly tablet: {
71
- readonly flex: "0 1 auto";
72
- readonly minWidth: 0;
73
- };
74
- };
75
- contentBlock: {
76
- readonly tablet: {
77
- readonly alignItems: "center";
78
- readonly flex: "1 0 0";
79
- readonly gap: "24";
80
- readonly justifyContent: "flex-end";
81
- readonly minWidth: 0;
82
- };
83
- };
84
- titleBlock: {
85
- readonly tablet: {
86
- readonly alignItems: "center";
87
- };
88
- };
89
- title: {
90
- readonly tablet: {
91
- readonly textStyle: "heading/h3";
92
- };
93
- };
94
- actionBlock: {
95
- readonly tablet: {
96
- readonly alignItems: "center";
97
- readonly flexDirection: "row";
98
- readonly gap: "8";
99
- readonly width: "auto";
100
- };
101
- };
102
- avatar: {
103
- readonly tablet: {
104
- readonly display: "none";
105
- };
106
- };
107
- badge: {
108
- readonly tablet: {
109
- readonly display: "none";
110
- };
111
- };
112
- secondaryText: {
113
- readonly tablet: {
114
- readonly display: "none";
115
- };
116
- };
117
- tabs: {
118
- readonly tablet: {
119
- readonly display: "none";
120
- };
121
- };
122
- root: {
123
- tablet: {
124
- borderColor: "border/minimal";
125
- boxShadow: "elevation/sm";
126
- };
127
- };
128
- };
129
- false: {};
130
- };
131
- variant: {
132
- default: {};
133
- minimal: {
134
- readonly headerBlock: {
135
- readonly tablet: {
136
- readonly alignItems: "center";
137
- readonly flexDirection: "row";
138
- readonly gap: "24";
139
- readonly minHeight: string;
140
- readonly paddingBlockEnd: "12";
141
- readonly paddingBlockStart: "12";
142
- readonly paddingInlineEnd: "32";
143
- readonly paddingInlineStart: "24";
144
- };
145
- };
146
- readonly breadcrumb: {
147
- readonly tablet: {
148
- readonly flex: "0 1 auto";
149
- readonly minWidth: 0;
150
- };
151
- };
152
- readonly contentBlock: {
153
- readonly tablet: {
154
- readonly alignItems: "center";
155
- readonly flex: "1 0 0";
156
- readonly gap: "24";
157
- readonly justifyContent: "flex-end";
158
- readonly minWidth: 0;
159
- };
160
- };
161
- readonly titleBlock: {
162
- readonly tablet: {
163
- readonly alignItems: "center";
164
- };
165
- };
166
- readonly title: {
167
- readonly tablet: {
168
- readonly textStyle: "heading/h3";
169
- };
170
- };
171
- readonly actionBlock: {
172
- readonly tablet: {
173
- readonly alignItems: "center";
174
- readonly flexDirection: "row";
175
- readonly gap: "8";
176
- readonly width: "auto";
177
- };
178
- };
179
- readonly avatar: {
180
- readonly tablet: {
181
- readonly display: "none";
182
- };
183
- };
184
- readonly badge: {
185
- readonly tablet: {
186
- readonly display: "none";
187
- };
188
- };
189
- readonly secondaryText: {
190
- readonly tablet: {
191
- readonly display: "none";
192
- };
193
- };
194
- readonly tabs: {
195
- readonly tablet: {
196
- readonly display: "none";
197
- };
198
- };
199
- };
200
- };
201
- }>;
202
- export default pageHeaderSlotRecipe;