@bitrise/bitkit-v2 0.3.546 → 0.3.547
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 +2 -1
- package/dist/components/BitkitActionBar/BitkitActionBar.js +2 -1
- package/dist/components/BitkitActionBar/BitkitActionBar.js.map +1 -1
- package/dist/components/BitkitButton/BitkitButton.js +7 -2
- package/dist/components/BitkitButton/BitkitButton.js.map +1 -1
- package/dist/components/BitkitCalendar/BitkitCalendar.js +3 -2
- package/dist/components/BitkitCalendar/BitkitCalendar.js.map +1 -1
- package/dist/components/BitkitContentWrapper/BitkitContentWrapperStickyBar.d.ts +1 -1
- package/dist/components/BitkitContentWrapper/BitkitContentWrapperStickyBar.js.map +1 -1
- package/dist/components/BitkitDialog/DialogShell.js +2 -1
- package/dist/components/BitkitDialog/DialogShell.js.map +1 -1
- package/dist/components/BitkitDrawer/BitkitDrawer.js +5 -1
- package/dist/components/BitkitDrawer/BitkitDrawer.js.map +1 -1
- package/dist/components/BitkitIconButton/BitkitIconButton.js +7 -2
- package/dist/components/BitkitIconButton/BitkitIconButton.js.map +1 -1
- package/dist/components/BitkitLightbox/BitkitLightbox.js +2 -1
- package/dist/components/BitkitLightbox/BitkitLightbox.js.map +1 -1
- package/dist/components/BitkitPageHeader/BitkitPageHeader.d.ts +26 -23
- package/dist/components/BitkitPageHeader/BitkitPageHeader.js +41 -9
- package/dist/components/BitkitPageHeader/BitkitPageHeader.js.map +1 -1
- package/dist/components/BitkitPageHeader/pageHeaderBottom.d.ts +18 -0
- package/dist/components/BitkitPageHeader/pageHeaderBottom.js +21 -0
- package/dist/components/BitkitPageHeader/pageHeaderBottom.js.map +1 -0
- package/dist/components/BitkitPageHeader/useSelfSticky.d.ts +16 -0
- package/dist/components/BitkitPageHeader/useSelfSticky.js +76 -0
- package/dist/components/BitkitPageHeader/useSelfSticky.js.map +1 -0
- package/dist/components/BitkitPageSidebar/BitkitPageSidebar.d.ts +6 -0
- package/dist/components/BitkitPageSidebar/BitkitPageSidebar.js +5 -2
- package/dist/components/BitkitPageSidebar/BitkitPageSidebar.js.map +1 -1
- package/dist/components/BitkitPopover/BitkitPopover.js +3 -2
- package/dist/components/BitkitPopover/BitkitPopover.js.map +1 -1
- package/dist/components/BitkitSplitButton/BitkitSplitButton.js +4 -1
- package/dist/components/BitkitSplitButton/BitkitSplitButton.js.map +1 -1
- package/dist/components/BitkitToggleButton/BitkitToggleButton.js +4 -1
- package/dist/components/BitkitToggleButton/BitkitToggleButton.js.map +1 -1
- package/dist/components/BitkitUIHeader/BitkitUIHeader.d.ts +1 -0
- package/dist/components/BitkitUIHeader/BitkitUIHeader.js +2 -1
- package/dist/components/BitkitUIHeader/BitkitUIHeader.js.map +1 -1
- package/dist/components/BitkitUIHeader/usePublishedBottom.d.ts +1 -0
- package/dist/components/BitkitUIHeader/usePublishedBottom.js +1 -1
- package/dist/components/BitkitUIHeader/usePublishedBottom.js.map +1 -1
- package/dist/components/BitkitUIHeader/useUiHeaderBottom.d.ts +6 -0
- package/dist/components/BitkitUIHeader/useUiHeaderBottom.js +29 -0
- package/dist/components/BitkitUIHeader/useUiHeaderBottom.js.map +1 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/main.js +4 -2
- package/dist/theme/global-css.js +6 -0
- package/dist/theme/global-css.js.map +1 -1
- package/dist/theme/slot-recipes/Breadcrumb.recipe.js +5 -1
- package/dist/theme/slot-recipes/Breadcrumb.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/PageHeader.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/PageSidebar.recipe.d.ts +32 -0
- package/dist/theme/slot-recipes/PageSidebar.recipe.js +30 -0
- package/dist/theme/slot-recipes/PageSidebar.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/index.d.ts +25 -0
- package/dist/theme/tokens/index.d.ts +3 -0
- package/dist/theme/tokens/keyframes.js +5 -0
- package/dist/theme/tokens/keyframes.js.map +1 -1
- package/dist/theme/tokens/zIndex.d.ts +3 -0
- package/dist/theme/tokens/zIndex.js +1 -0
- package/dist/theme/tokens/zIndex.js.map +1 -1
- package/dist/utilities/ControlSizeContext.d.ts +15 -0
- package/dist/utilities/ControlSizeContext.js +20 -0
- package/dist/utilities/ControlSizeContext.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import IconArrowDown from "../../icons/IconArrowDown.js";
|
|
2
|
+
import { ResetControlSize } from "../../utilities/ControlSizeContext.js";
|
|
2
3
|
import BitkitCloseButton from "../BitkitCloseButton/BitkitCloseButton.js";
|
|
3
4
|
import { chakra } from "@chakra-ui/react/styled-system";
|
|
4
5
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
@@ -89,7 +90,7 @@ var BitkitPopover = ({ children, title, footer, trigger, autoFocus, open, defaul
|
|
|
89
90
|
children: trigger
|
|
90
91
|
}) : null, /* @__PURE__ */ jsx(Portal, {
|
|
91
92
|
disabled: disablePortal,
|
|
92
|
-
children: /* @__PURE__ */ jsx(Popover.Positioner, { children: /* @__PURE__ */ jsxs(Popover.Content, {
|
|
93
|
+
children: /* @__PURE__ */ jsx(ResetControlSize, { children: /* @__PURE__ */ jsx(Popover.Positioner, { children: /* @__PURE__ */ jsxs(Popover.Content, {
|
|
93
94
|
"aria-labelledby": titleId,
|
|
94
95
|
children: [
|
|
95
96
|
/* @__PURE__ */ jsxs(Popover.Header, { children: [/* @__PURE__ */ jsx(Popover.Title, { children: title }), /* @__PURE__ */ jsx(Popover.CloseTrigger, {
|
|
@@ -99,7 +100,7 @@ var BitkitPopover = ({ children, title, footer, trigger, autoFocus, open, defaul
|
|
|
99
100
|
/* @__PURE__ */ jsx(ScrollablePopoverBody, { children }),
|
|
100
101
|
footer ? /* @__PURE__ */ jsx(Popover.Footer, { children: footer }) : null
|
|
101
102
|
]
|
|
102
|
-
}) })
|
|
103
|
+
}) }) })
|
|
103
104
|
})]
|
|
104
105
|
});
|
|
105
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitPopover.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitPopover/BitkitPopover.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Popover, type PopoverRootProps, usePopoverContext, usePopoverStyles } from '@chakra-ui/react/popover';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { type ReactNode, useCallback, useEffect, useId, useRef, useState } from 'react';\n\nimport { IconArrowDown } from '../../icons';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\n\nexport interface BitkitPopoverProps {\n /** Body content of the panel. Scrolls within the panel when it overflows. */\n children: ReactNode;\n /** Header title, shown next to the close button. */\n title: ReactNode;\n /** Optional footer content (e.g. actions). Laid out with space between for a secondary/primary pair. */\n footer?: ReactNode;\n /**\n * Element that toggles and anchors the popover. Omit when anchoring via\n * `positioning.getAnchorElement` (e.g. a trigger that can't be wrapped) and controlling `open`.\n */\n trigger?: ReactNode;\n /**\n * Move focus into the panel when it opens (default `true`). Turn it off for a panel that opens\n * while the user is typing elsewhere, such as hints beside a focused input.\n */\n autoFocus?: PopoverRootProps['autoFocus'];\n open?: PopoverRootProps['open'];\n defaultOpen?: PopoverRootProps['defaultOpen'];\n /**\n * Render the panel inline instead of in a portal. Only needed when it must stay inside its\n * parent's DOM subtree.\n */\n disablePortal?: boolean;\n onOpenChange?: (open: boolean) => void;\n positioning?: PopoverRootProps['positioning'];\n persistentElements?: PopoverRootProps['persistentElements'];\n}\n\n/**\n * Scrolls the body and shows a scroll-to-bottom button with a fade gradient while the content\n * isn't scrolled to the bottom — mirrors the BitkitDialog scrollable-body behaviour.\n */\nconst ScrollablePopoverBody = ({ children }: { children: ReactNode }) => {\n const styles = usePopoverStyles();\n const { open } = usePopoverContext();\n const contentRef = useRef<HTMLDivElement>(null);\n const [isScrollButtonVisible, setIsScrollButtonVisible] = useState(false);\n\n const updateScrollButtonVisibility = useCallback(() => {\n const content = contentRef.current;\n if (!content) {\n setIsScrollButtonVisible(false);\n return;\n }\n const didScrollToBottom = content.scrollTop >= content.scrollHeight - content.offsetHeight - 1;\n setIsScrollButtonVisible(!didScrollToBottom);\n }, []);\n\n useEffect(() => {\n const content = contentRef.current;\n if (!open || !content) return undefined;\n\n content.addEventListener('scroll', updateScrollButtonVisibility);\n const resizeObserver = new ResizeObserver(updateScrollButtonVisibility);\n resizeObserver.observe(content);\n\n return () => {\n content.removeEventListener('scroll', updateScrollButtonVisibility);\n resizeObserver.disconnect();\n };\n }, [open, updateScrollButtonVisibility]);\n\n return (\n <Box css={styles.scrollBody}>\n <Popover.Body ref={contentRef}>{children}</Popover.Body>\n {isScrollButtonVisible && (\n <>\n <Box css={styles.scrollGradient} />\n <chakra.button\n aria-label=\"Scroll to bottom\"\n css={styles.scrollButton}\n type=\"button\"\n onClick={() => {\n contentRef.current?.scrollTo({ top: contentRef.current.scrollHeight, behavior: 'smooth' });\n }}\n >\n <IconArrowDown color=\"icon/tertiary\" size=\"16\" />\n </chakra.button>\n </>\n )}\n </Box>\n );\n};\n\n/**\n * An anchored, non-modal floating panel built on Chakra Popover, styled as a compact dialog:\n * a header (title + close button), a scrollable body, and an optional footer. Anchor it with a\n * `trigger`, or — when the trigger can't be wrapped — control `open` and pass\n * `positioning.getAnchorElement`.\n *\n * The panel is mounted only while open, and renders in a portal so it escapes any ancestor that\n * traps stacking or clips overflow. Unlike the smaller floating components, it stays in the portal\n * inside a dialog too, like `BitkitCalendar`: a dialog's body would clip a panel this size.\n */\nconst BitkitPopover = ({\n children,\n title,\n footer,\n trigger,\n autoFocus,\n open,\n defaultOpen,\n disablePortal,\n onOpenChange,\n positioning,\n persistentElements,\n}: BitkitPopoverProps) => {\n const titleId = useId();\n\n return (\n <Popover.Root\n autoFocus={autoFocus}\n ids={{ title: titleId }}\n open={open}\n defaultOpen={defaultOpen}\n lazyMount\n onOpenChange={onOpenChange ? ({ open: isOpen }) => onOpenChange(isOpen) : undefined}\n positioning={{ placement: 'bottom-start', gutter: 4, ...positioning }}\n persistentElements={persistentElements}\n unmountOnExit\n >\n {trigger ? <Popover.Trigger asChild>{trigger}</Popover.Trigger> : null}\n <Portal disabled={disablePortal}>\n {/* z-index belongs on Content, not Positioner: Zag derives the positioner's inline z-index\n from Content's computed z-index, so a value set on Positioner is ignored. */}\n <Popover.Positioner>\n
|
|
1
|
+
{"version":3,"file":"BitkitPopover.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitPopover/BitkitPopover.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Popover, type PopoverRootProps, usePopoverContext, usePopoverStyles } from '@chakra-ui/react/popover';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { type ReactNode, useCallback, useEffect, useId, useRef, useState } from 'react';\n\nimport { IconArrowDown } from '../../icons';\nimport { ResetControlSize } from '../../utilities/ControlSizeContext';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\n\nexport interface BitkitPopoverProps {\n /** Body content of the panel. Scrolls within the panel when it overflows. */\n children: ReactNode;\n /** Header title, shown next to the close button. */\n title: ReactNode;\n /** Optional footer content (e.g. actions). Laid out with space between for a secondary/primary pair. */\n footer?: ReactNode;\n /**\n * Element that toggles and anchors the popover. Omit when anchoring via\n * `positioning.getAnchorElement` (e.g. a trigger that can't be wrapped) and controlling `open`.\n */\n trigger?: ReactNode;\n /**\n * Move focus into the panel when it opens (default `true`). Turn it off for a panel that opens\n * while the user is typing elsewhere, such as hints beside a focused input.\n */\n autoFocus?: PopoverRootProps['autoFocus'];\n open?: PopoverRootProps['open'];\n defaultOpen?: PopoverRootProps['defaultOpen'];\n /**\n * Render the panel inline instead of in a portal. Only needed when it must stay inside its\n * parent's DOM subtree.\n */\n disablePortal?: boolean;\n onOpenChange?: (open: boolean) => void;\n positioning?: PopoverRootProps['positioning'];\n persistentElements?: PopoverRootProps['persistentElements'];\n}\n\n/**\n * Scrolls the body and shows a scroll-to-bottom button with a fade gradient while the content\n * isn't scrolled to the bottom — mirrors the BitkitDialog scrollable-body behaviour.\n */\nconst ScrollablePopoverBody = ({ children }: { children: ReactNode }) => {\n const styles = usePopoverStyles();\n const { open } = usePopoverContext();\n const contentRef = useRef<HTMLDivElement>(null);\n const [isScrollButtonVisible, setIsScrollButtonVisible] = useState(false);\n\n const updateScrollButtonVisibility = useCallback(() => {\n const content = contentRef.current;\n if (!content) {\n setIsScrollButtonVisible(false);\n return;\n }\n const didScrollToBottom = content.scrollTop >= content.scrollHeight - content.offsetHeight - 1;\n setIsScrollButtonVisible(!didScrollToBottom);\n }, []);\n\n useEffect(() => {\n const content = contentRef.current;\n if (!open || !content) return undefined;\n\n content.addEventListener('scroll', updateScrollButtonVisibility);\n const resizeObserver = new ResizeObserver(updateScrollButtonVisibility);\n resizeObserver.observe(content);\n\n return () => {\n content.removeEventListener('scroll', updateScrollButtonVisibility);\n resizeObserver.disconnect();\n };\n }, [open, updateScrollButtonVisibility]);\n\n return (\n <Box css={styles.scrollBody}>\n <Popover.Body ref={contentRef}>{children}</Popover.Body>\n {isScrollButtonVisible && (\n <>\n <Box css={styles.scrollGradient} />\n <chakra.button\n aria-label=\"Scroll to bottom\"\n css={styles.scrollButton}\n type=\"button\"\n onClick={() => {\n contentRef.current?.scrollTo({ top: contentRef.current.scrollHeight, behavior: 'smooth' });\n }}\n >\n <IconArrowDown color=\"icon/tertiary\" size=\"16\" />\n </chakra.button>\n </>\n )}\n </Box>\n );\n};\n\n/**\n * An anchored, non-modal floating panel built on Chakra Popover, styled as a compact dialog:\n * a header (title + close button), a scrollable body, and an optional footer. Anchor it with a\n * `trigger`, or — when the trigger can't be wrapped — control `open` and pass\n * `positioning.getAnchorElement`.\n *\n * The panel is mounted only while open, and renders in a portal so it escapes any ancestor that\n * traps stacking or clips overflow. Unlike the smaller floating components, it stays in the portal\n * inside a dialog too, like `BitkitCalendar`: a dialog's body would clip a panel this size.\n */\nconst BitkitPopover = ({\n children,\n title,\n footer,\n trigger,\n autoFocus,\n open,\n defaultOpen,\n disablePortal,\n onOpenChange,\n positioning,\n persistentElements,\n}: BitkitPopoverProps) => {\n const titleId = useId();\n\n return (\n <Popover.Root\n autoFocus={autoFocus}\n ids={{ title: titleId }}\n open={open}\n defaultOpen={defaultOpen}\n lazyMount\n onOpenChange={onOpenChange ? ({ open: isOpen }) => onOpenChange(isOpen) : undefined}\n positioning={{ placement: 'bottom-start', gutter: 4, ...positioning }}\n persistentElements={persistentElements}\n unmountOnExit\n >\n {trigger ? <Popover.Trigger asChild>{trigger}</Popover.Trigger> : null}\n <Portal disabled={disablePortal}>\n {/* z-index belongs on Content, not Positioner: Zag derives the positioner's inline z-index\n from Content's computed z-index, so a value set on Positioner is ignored. */}\n <ResetControlSize>\n <Popover.Positioner>\n <Popover.Content aria-labelledby={titleId}>\n <Popover.Header>\n <Popover.Title>{title}</Popover.Title>\n <Popover.CloseTrigger asChild>\n <BitkitCloseButton aria-label=\"Close\" />\n </Popover.CloseTrigger>\n </Popover.Header>\n <ScrollablePopoverBody>{children}</ScrollablePopoverBody>\n {footer ? <Popover.Footer>{footer}</Popover.Footer> : null}\n </Popover.Content>\n </Popover.Positioner>\n </ResetControlSize>\n </Portal>\n </Popover.Root>\n );\n};\n\nBitkitPopover.displayName = 'BitkitPopover';\n\nexport default BitkitPopover;\n"],"mappings":";;;;;;;;;;;;;;AA2CA,IAAM,yBAAyB,EAAE,eAAwC;CACvE,MAAM,SAAS,iBAAiB;CAChC,MAAM,EAAE,SAAS,kBAAkB;CACnC,MAAM,aAAa,OAAuB,IAAI;CAC9C,MAAM,CAAC,uBAAuB,4BAA4B,SAAS,KAAK;CAExE,MAAM,+BAA+B,kBAAkB;EACrD,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,SAAS;GACZ,yBAAyB,KAAK;GAC9B;EACF;EACA,MAAM,oBAAoB,QAAQ,aAAa,QAAQ,eAAe,QAAQ,eAAe;EAC7F,yBAAyB,CAAC,iBAAiB;CAC7C,GAAG,CAAC,CAAC;CAEL,gBAAgB;EACd,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,QAAQ,CAAC,SAAS,OAAO,KAAA;EAE9B,QAAQ,iBAAiB,UAAU,4BAA4B;EAC/D,MAAM,iBAAiB,IAAI,eAAe,4BAA4B;EACtE,eAAe,QAAQ,OAAO;EAE9B,aAAa;GACX,QAAQ,oBAAoB,UAAU,4BAA4B;GAClE,eAAe,WAAW;EAC5B;CACF,GAAG,CAAC,MAAM,4BAA4B,CAAC;CAEvC,OACE,qBAAC,KAAD;EAAK,KAAK,OAAO;EAAjB,UAAA,CACE,oBAAC,QAAQ,MAAT;GAAc,KAAK;GAAa;EAAuB,CAAA,GACtD,yBACC,qBAAAA,YAAA,EAAA,UAAA,CACE,oBAAC,KAAD,EAAK,KAAK,OAAO,eAAiB,CAAA,GAClC,oBAAC,OAAO,QAAR;GACE,cAAW;GACX,KAAK,OAAO;GACZ,MAAK;GACL,eAAe;IACb,WAAW,SAAS,SAAS;KAAE,KAAK,WAAW,QAAQ;KAAc,UAAU;IAAS,CAAC;GAC3F;GAEA,UAAA,oBAAC,eAAD;IAAe,OAAM;IAAgB,MAAK;GAAM,CAAA;EACnC,CAAA,CACf,EAAA,CAAA,CAED;;AAET;;;;;;;;;;;AAYA,IAAM,iBAAiB,EACrB,UACA,OACA,QACA,SACA,WACA,MACA,aACA,eACA,cACA,aACA,yBACwB;CACxB,MAAM,UAAU,MAAM;CAEtB,OACE,qBAAC,QAAQ,MAAT;EACa;EACX,KAAK,EAAE,OAAO,QAAQ;EAChB;EACO;EACb,WAAA;EACA,cAAc,gBAAgB,EAAE,MAAM,aAAa,aAAa,MAAM,IAAI,KAAA;EAC1E,aAAa;GAAE,WAAW;GAAgB,QAAQ;GAAG,GAAG;EAAY;EAChD;EACpB,eAAA;EATF,UAAA,CAWG,UAAU,oBAAC,QAAQ,SAAT;GAAiB,SAAA;GAAS,UAAA;EAAyB,CAAA,IAAI,MAClE,oBAAC,QAAD;GAAQ,UAAU;GAGhB,UAAA,oBAAC,kBAAD,EAAA,UACE,oBAAC,QAAQ,YAAT,EAAA,UACE,qBAAC,QAAQ,SAAT;IAAiB,mBAAiB;IAAlC,UAAA;KACE,qBAAC,QAAQ,QAAT,EAAA,UAAA,CACE,oBAAC,QAAQ,OAAT,EAAA,UAAgB,MAAqB,CAAA,GACrC,oBAAC,QAAQ,cAAT;MAAsB,SAAA;MACpB,UAAA,oBAAC,mBAAD,EAAmB,cAAW,QAAS,CAAA;KACnB,CAAA,CACR,EAAA,CAAA;KAChB,oBAAC,uBAAD,EAAwB,SAAgC,CAAA;KACvD,SAAS,oBAAC,QAAQ,QAAT,EAAA,UAAiB,OAAuB,CAAA,IAAI;IACvC;GACC,CAAA,EAAA,CAAA,EACJ,CAAA;EACZ,CAAA,CACI;;AAElB;AAEA,cAAc,cAAc"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import IconChevronDown from "../../icons/IconChevronDown.js";
|
|
2
|
+
import { useControlSizeFromContext } from "../../utilities/ControlSizeContext.js";
|
|
2
3
|
import { flattenChildren } from "../../utilities/flattenChildren.js";
|
|
3
4
|
import { withSubComponents } from "../../utilities/withSubComponents.js";
|
|
4
5
|
import BitkitActionMenu_default from "../BitkitActionMenu/BitkitActionMenu.js";
|
|
@@ -43,7 +44,9 @@ var BitkitSplitButtonAction = forwardRef((props, ref) => {
|
|
|
43
44
|
});
|
|
44
45
|
BitkitSplitButtonAction.displayName = "BitkitSplitButtonAction";
|
|
45
46
|
var BitkitSplitButton = forwardRef((props, ref) => {
|
|
46
|
-
const { children, size
|
|
47
|
+
const { children, size: sizeProp, state, variant = "primary", ...rest } = props;
|
|
48
|
+
const contextSize = useControlSizeFromContext();
|
|
49
|
+
const size = sizeProp ?? contextSize ?? "lg";
|
|
47
50
|
const childArray = flattenChildren(children);
|
|
48
51
|
const actionChild = childArray.find(isValidActionItem);
|
|
49
52
|
const menuItems = childArray.filter(isValidMenuItem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitSplitButton.js","names":["BitkitActionMenu","createContext"],"sources":["../../../lib/components/BitkitSplitButton/BitkitSplitButton.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Group, type GroupProps } from '@chakra-ui/react/group';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { type SystemStyleObject, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, isValidElement, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';\n\nimport { IconChevronDown } from '../../icons';\nimport { flattenChildren } from '../../utilities/flattenChildren';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitkitActionMenu from '../BitkitActionMenu/BitkitActionMenu';\nimport BitkitButton, {\n type BitkitButtonAsAnchorProps,\n type BitkitButtonAsButtonProps,\n} from '../BitkitButton/BitkitButton';\nimport BitkitIconButton from '../BitkitIconButton/BitkitIconButton';\n\ntype Size = 'lg' | 'md' | 'sm';\ntype Variant = 'primary' | 'secondary';\ntype State = 'disabled' | 'loading' | 'skeleton';\n\nconst isValidActionItem = (child: ReactNode): child is ReactElement => {\n return isValidElement(child) && child.type === BitkitSplitButtonAction;\n};\n\nconst isValidMenuItem = (child: ReactNode): child is ReactElement => {\n return (\n isValidElement(child) &&\n (child.type === BitkitActionMenu.Group ||\n child.type === BitkitActionMenu.Item ||\n child.type === BitkitActionMenu.Separator)\n );\n};\n\n// --- Context ---\ninterface SplitButtonContext {\n size: Size;\n variant: Variant;\n state: State | undefined;\n styles: Record<string, SystemStyleObject>;\n}\n\nconst [SplitButtonProvider, useSplitButtonContext] = createContext<SplitButtonContext>({\n name: 'SplitButtonContext',\n hookName: 'useSplitButtonContext',\n providerName: '<BitkitSplitButton />',\n});\n\n// --- Action ---\n// Split-button action can be a button (default) or anchor (when href is set). asChild is intentionally\n// not part of the API — routing-library elements don't fit cleanly into the Group attached layout.\n// The forwarded ref is HTMLElement so it covers both <button> and <a>.\ntype BitkitSplitButtonActionProps = Omit<\n BitkitButtonAsButtonProps | BitkitButtonAsAnchorProps,\n 'size' | 'variant' | 'state'\n>;\n\nconst BitkitSplitButtonAction = forwardRef<HTMLElement, BitkitSplitButtonActionProps>((props, ref) => {\n const { size, state, styles, variant } = useSplitButtonContext();\n\n if (props.href !== undefined) {\n // Anchor branch: BitkitButton's anchor variant doesn't allow state=\"loading\". Coerce to \"disabled\"\n // so a SplitButton-wide loading state still surfaces visually on a link-mode action.\n return (\n <BitkitButton\n {...(props as BitkitButtonAsAnchorProps)}\n css={styles.action}\n ref={ref}\n size={size}\n state={state === 'loading' ? 'disabled' : state}\n variant={variant}\n />\n );\n }\n\n return (\n <BitkitButton\n {...(props as BitkitButtonAsButtonProps)}\n css={styles.action}\n ref={ref}\n size={size}\n state={state}\n variant={variant}\n />\n );\n});\n\nBitkitSplitButtonAction.displayName = 'BitkitSplitButtonAction';\n\n// --- Root ---\nexport type BitkitSplitButtonProps = PropsWithChildren<\n Omit<GroupProps, 'attached' | 'children' | 'display'> & {\n size?: Size;\n variant?: Variant;\n state?: State;\n }\n>;\n\nconst BitkitSplitButton = forwardRef<HTMLDivElement, BitkitSplitButtonProps>((props, ref) => {\n const { children, size
|
|
1
|
+
{"version":3,"file":"BitkitSplitButton.js","names":["BitkitActionMenu","createContext"],"sources":["../../../lib/components/BitkitSplitButton/BitkitSplitButton.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { Group, type GroupProps } from '@chakra-ui/react/group';\nimport { Skeleton } from '@chakra-ui/react/skeleton';\nimport { type SystemStyleObject, useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, isValidElement, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';\n\nimport { IconChevronDown } from '../../icons';\nimport { useControlSizeFromContext } from '../../utilities/ControlSizeContext';\nimport { flattenChildren } from '../../utilities/flattenChildren';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitkitActionMenu from '../BitkitActionMenu/BitkitActionMenu';\nimport BitkitButton, {\n type BitkitButtonAsAnchorProps,\n type BitkitButtonAsButtonProps,\n} from '../BitkitButton/BitkitButton';\nimport BitkitIconButton from '../BitkitIconButton/BitkitIconButton';\n\ntype Size = 'lg' | 'md' | 'sm';\ntype Variant = 'primary' | 'secondary';\ntype State = 'disabled' | 'loading' | 'skeleton';\n\nconst isValidActionItem = (child: ReactNode): child is ReactElement => {\n return isValidElement(child) && child.type === BitkitSplitButtonAction;\n};\n\nconst isValidMenuItem = (child: ReactNode): child is ReactElement => {\n return (\n isValidElement(child) &&\n (child.type === BitkitActionMenu.Group ||\n child.type === BitkitActionMenu.Item ||\n child.type === BitkitActionMenu.Separator)\n );\n};\n\n// --- Context ---\ninterface SplitButtonContext {\n size: Size;\n variant: Variant;\n state: State | undefined;\n styles: Record<string, SystemStyleObject>;\n}\n\nconst [SplitButtonProvider, useSplitButtonContext] = createContext<SplitButtonContext>({\n name: 'SplitButtonContext',\n hookName: 'useSplitButtonContext',\n providerName: '<BitkitSplitButton />',\n});\n\n// --- Action ---\n// Split-button action can be a button (default) or anchor (when href is set). asChild is intentionally\n// not part of the API — routing-library elements don't fit cleanly into the Group attached layout.\n// The forwarded ref is HTMLElement so it covers both <button> and <a>.\ntype BitkitSplitButtonActionProps = Omit<\n BitkitButtonAsButtonProps | BitkitButtonAsAnchorProps,\n 'size' | 'variant' | 'state'\n>;\n\nconst BitkitSplitButtonAction = forwardRef<HTMLElement, BitkitSplitButtonActionProps>((props, ref) => {\n const { size, state, styles, variant } = useSplitButtonContext();\n\n if (props.href !== undefined) {\n // Anchor branch: BitkitButton's anchor variant doesn't allow state=\"loading\". Coerce to \"disabled\"\n // so a SplitButton-wide loading state still surfaces visually on a link-mode action.\n return (\n <BitkitButton\n {...(props as BitkitButtonAsAnchorProps)}\n css={styles.action}\n ref={ref}\n size={size}\n state={state === 'loading' ? 'disabled' : state}\n variant={variant}\n />\n );\n }\n\n return (\n <BitkitButton\n {...(props as BitkitButtonAsButtonProps)}\n css={styles.action}\n ref={ref}\n size={size}\n state={state}\n variant={variant}\n />\n );\n});\n\nBitkitSplitButtonAction.displayName = 'BitkitSplitButtonAction';\n\n// --- Root ---\nexport type BitkitSplitButtonProps = PropsWithChildren<\n Omit<GroupProps, 'attached' | 'children' | 'display'> & {\n size?: Size;\n variant?: Variant;\n state?: State;\n }\n>;\n\nconst BitkitSplitButton = forwardRef<HTMLDivElement, BitkitSplitButtonProps>((props, ref) => {\n const { children, size: sizeProp, state, variant = 'primary', ...rest } = props;\n const contextSize = useControlSizeFromContext();\n const size = sizeProp ?? contextSize ?? 'lg';\n\n const childArray = flattenChildren(children);\n const actionChild = childArray.find(isValidActionItem);\n const menuItems = childArray.filter(isValidMenuItem);\n\n const menuSize = size === 'lg' ? 'lg' : 'md';\n const recipe = useSlotRecipe({ key: 'splitButton' });\n const styles = recipe({ variant });\n\n return (\n <SplitButtonProvider value={{ size, state, styles, variant }}>\n <Skeleton asChild loading={state === 'skeleton'}>\n <Group ref={ref} {...rest} attached display=\"inline-flex\">\n {actionChild}\n <BitkitActionMenu\n size={menuSize}\n trigger={\n <BitkitIconButton\n css={styles.trigger}\n icon={IconChevronDown}\n label=\"Toggle menu\"\n size={size}\n state={state === 'loading' ? 'disabled' : state}\n variant={variant}\n />\n }\n positioning={{ placement: 'bottom-end' }}\n >\n {menuItems}\n </BitkitActionMenu>\n </Group>\n </Skeleton>\n </SplitButtonProvider>\n );\n});\nBitkitSplitButton.displayName = 'BitkitSplitButton';\n\nexport default withSubComponents(BitkitSplitButton, {\n Action: BitkitSplitButtonAction,\n Group: BitkitActionMenu.Group,\n Item: BitkitActionMenu.Item,\n Separator: BitkitActionMenu.Separator,\n});\n"],"mappings":";;;;;;;;;;;;;;AAsBA,IAAM,qBAAqB,UAA4C;CACrE,OAAO,eAAe,KAAK,KAAK,MAAM,SAAS;AACjD;AAEA,IAAM,mBAAmB,UAA4C;CACnE,OACE,eAAe,KAAK,MACnB,MAAM,SAASA,yBAAiB,SAC/B,MAAM,SAASA,yBAAiB,QAChC,MAAM,SAASA,yBAAiB;AAEtC;AAUA,IAAM,CAAC,qBAAqB,yBAAyBC,gBAAkC;CACrF,MAAM;CACN,UAAU;CACV,cAAc;AAChB,CAAC;AAWD,IAAM,0BAA0B,YAAuD,OAAO,QAAQ;CACpG,MAAM,EAAE,MAAM,OAAO,QAAQ,YAAY,sBAAsB;CAE/D,IAAI,MAAM,SAAS,KAAA,GAGjB,OACE,oBAAC,cAAD;EACE,GAAK;EACL,KAAK,OAAO;EACP;EACC;EACN,OAAO,UAAU,YAAY,aAAa;EACjC;CACV,CAAA;CAIL,OACE,oBAAC,cAAD;EACE,GAAK;EACL,KAAK,OAAO;EACP;EACC;EACC;EACE;CACV,CAAA;AAEL,CAAC;AAED,wBAAwB,cAAc;AAWtC,IAAM,oBAAoB,YAAoD,OAAO,QAAQ;CAC3F,MAAM,EAAE,UAAU,MAAM,UAAU,OAAO,UAAU,WAAW,GAAG,SAAS;CAC1E,MAAM,cAAc,0BAA0B;CAC9C,MAAM,OAAO,YAAY,eAAe;CAExC,MAAM,aAAa,gBAAgB,QAAQ;CAC3C,MAAM,cAAc,WAAW,KAAK,iBAAiB;CACrD,MAAM,YAAY,WAAW,OAAO,eAAe;CAEnD,MAAM,WAAW,SAAS,OAAO,OAAO;CAExC,MAAM,SADS,cAAc,EAAE,KAAK,cAAc,CACnC,CAAA,CAAO,EAAE,QAAQ,CAAC;CAEjC,OACE,oBAAC,qBAAD;EAAqB,OAAO;GAAE;GAAM;GAAO;GAAQ;EAAQ;EACzD,UAAA,oBAAC,UAAD;GAAU,SAAA;GAAQ,SAAS,UAAU;GACnC,UAAA,qBAAC,OAAD;IAAY;IAAK,GAAI;IAAM,UAAA;IAAS,SAAQ;IAA5C,UAAA,CACG,aACD,oBAACD,0BAAD;KACE,MAAM;KACN,SACE,oBAAC,kBAAD;MACE,KAAK,OAAO;MACZ,MAAM;MACN,OAAM;MACA;MACN,OAAO,UAAU,YAAY,aAAa;MACjC;KACV,CAAA;KAEH,aAAa,EAAE,WAAW,aAAa;KAEtC,UAAA;IACe,CAAA,CACb;;EACC,CAAA;CACS,CAAA;AAEzB,CAAC;AACD,kBAAkB,cAAc;AAEhC,IAAA,4BAAe,kBAAkB,mBAAmB;CAClD,QAAQ;CACR,OAAOA,yBAAiB;CACxB,MAAMA,yBAAiB;CACvB,WAAWA,yBAAiB;AAC9B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useControlSizeFromContext } from "../../utilities/ControlSizeContext.js";
|
|
1
2
|
import opensPopup from "../../utilities/opensPopup.js";
|
|
2
3
|
import BitkitLabelTooltip from "../BitkitLabelTooltip/BitkitLabelTooltip.js";
|
|
3
4
|
import { chakra, useRecipe } from "@chakra-ui/react/styled-system";
|
|
@@ -7,7 +8,9 @@ import { Skeleton } from "@chakra-ui/react/skeleton";
|
|
|
7
8
|
import { Toggle } from "@chakra-ui/react/toggle";
|
|
8
9
|
// lib/components/BitkitToggleButton/BitkitToggleButton.tsx
|
|
9
10
|
var BitkitToggleButton = forwardRef((props, ref) => {
|
|
10
|
-
const { icon: Icon, label,
|
|
11
|
+
const { icon: Icon, label, state, isSelected, tooltipProps, defaultSelected, onSelectedChange, css, size: sizeProp, ...rest } = props;
|
|
12
|
+
const contextSize = useControlSizeFromContext();
|
|
13
|
+
const size = sizeProp ?? contextSize ?? "md";
|
|
11
14
|
const recipe = useRecipe({ key: "toggleButton" });
|
|
12
15
|
const iconSize = size === "lg" ? "24" : "16";
|
|
13
16
|
const isPopupTrigger = opensPopup(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitToggleButton.js","names":[],"sources":["../../../lib/components/BitkitToggleButton/BitkitToggleButton.tsx"],"sourcesContent":["import { Skeleton } from '@chakra-ui/react/skeleton';\nimport { chakra, type HTMLChakraProps, useRecipe } from '@chakra-ui/react/styled-system';\nimport { Toggle } from '@chakra-ui/react/toggle';\nimport { forwardRef } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport opensPopup from '../../utilities/opensPopup';\nimport BitkitLabelTooltip, { type BitkitLabelTooltipProps } from '../BitkitLabelTooltip/BitkitLabelTooltip';\n\nexport interface BitkitToggleButtonProps extends Omit<HTMLChakraProps<'button'>, 'children' | 'disabled' | 'size'> {\n icon: BitkitIconComponent;\n label: string;\n size?: 'sm' | 'md' | 'lg';\n state?: 'disabled' | 'skeleton';\n isSelected?: boolean;\n /**\n * Overrides for the label tooltip. It is off by default when this control opens a popup — a menu,\n * select or popover trigger — where the panel is the affordance and a tooltip would hover over it.\n * Pass `{ disabled: false }` to bring it back. The accessible name comes from `label` either way.\n */\n tooltipProps?: Partial<Omit<BitkitLabelTooltipProps, 'children' | 'text'>>;\n defaultSelected?: boolean;\n onSelectedChange?: (selected: boolean) => void;\n}\n\nconst BitkitToggleButton = forwardRef<HTMLButtonElement, BitkitToggleButtonProps>((props, ref) => {\n const {\n icon: Icon,\n label,\n
|
|
1
|
+
{"version":3,"file":"BitkitToggleButton.js","names":[],"sources":["../../../lib/components/BitkitToggleButton/BitkitToggleButton.tsx"],"sourcesContent":["import { Skeleton } from '@chakra-ui/react/skeleton';\nimport { chakra, type HTMLChakraProps, useRecipe } from '@chakra-ui/react/styled-system';\nimport { Toggle } from '@chakra-ui/react/toggle';\nimport { forwardRef } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport { useControlSizeFromContext } from '../../utilities/ControlSizeContext';\nimport opensPopup from '../../utilities/opensPopup';\nimport BitkitLabelTooltip, { type BitkitLabelTooltipProps } from '../BitkitLabelTooltip/BitkitLabelTooltip';\n\nexport interface BitkitToggleButtonProps extends Omit<HTMLChakraProps<'button'>, 'children' | 'disabled' | 'size'> {\n icon: BitkitIconComponent;\n label: string;\n size?: 'sm' | 'md' | 'lg';\n state?: 'disabled' | 'skeleton';\n isSelected?: boolean;\n /**\n * Overrides for the label tooltip. It is off by default when this control opens a popup — a menu,\n * select or popover trigger — where the panel is the affordance and a tooltip would hover over it.\n * Pass `{ disabled: false }` to bring it back. The accessible name comes from `label` either way.\n */\n tooltipProps?: Partial<Omit<BitkitLabelTooltipProps, 'children' | 'text'>>;\n defaultSelected?: boolean;\n onSelectedChange?: (selected: boolean) => void;\n}\n\nconst BitkitToggleButton = forwardRef<HTMLButtonElement, BitkitToggleButtonProps>((props, ref) => {\n const {\n icon: Icon,\n label,\n state,\n isSelected,\n tooltipProps,\n defaultSelected,\n onSelectedChange,\n css,\n size: sizeProp,\n ...rest\n } = props;\n const contextSize = useControlSizeFromContext();\n const size = sizeProp ?? contextSize ?? 'md';\n\n const recipe = useRecipe({ key: 'toggleButton' });\n const iconSize = size === 'lg' ? '24' : '16';\n const isPopupTrigger = opensPopup(props);\n\n return (\n <BitkitLabelTooltip text={label} disabled={isPopupTrigger} {...tooltipProps}>\n <Skeleton loading={state === 'skeleton'} borderRadius=\"4\" display=\"flex\" width=\"fit-content\">\n <Toggle.Root\n asChild\n disabled={state === 'disabled'}\n defaultPressed={defaultSelected}\n onPressedChange={onSelectedChange}\n pressed={isSelected}\n >\n <chakra.button ref={ref} aria-label={label} {...rest} css={[recipe({ size }), css]}>\n <Icon size={iconSize} />\n </chakra.button>\n </Toggle.Root>\n </Skeleton>\n </BitkitLabelTooltip>\n );\n});\n\nBitkitToggleButton.displayName = 'BitkitToggleButton';\n\nexport default BitkitToggleButton;\n"],"mappings":";;;;;;;;;AA0BA,IAAM,qBAAqB,YAAwD,OAAO,QAAQ;CAChG,MAAM,EACJ,MAAM,MACN,OACA,OACA,YACA,cACA,iBACA,kBACA,KACA,MAAM,UACN,GAAG,SACD;CACJ,MAAM,cAAc,0BAA0B;CAC9C,MAAM,OAAO,YAAY,eAAe;CAExC,MAAM,SAAS,UAAU,EAAE,KAAK,eAAe,CAAC;CAChD,MAAM,WAAW,SAAS,OAAO,OAAO;CACxC,MAAM,iBAAiB,WAAW,KAAK;CAEvC,OACE,oBAAC,oBAAD;EAAoB,MAAM;EAAO,UAAU;EAAgB,GAAI;EAC7D,UAAA,oBAAC,UAAD;GAAU,SAAS,UAAU;GAAY,cAAa;GAAI,SAAQ;GAAO,OAAM;GAC7E,UAAA,oBAAC,OAAO,MAAR;IACE,SAAA;IACA,UAAU,UAAU;IACpB,gBAAgB;IAChB,iBAAiB;IACjB,SAAS;IAET,UAAA,oBAAC,OAAO,QAAR;KAAoB;KAAK,cAAY;KAAO,GAAI;KAAM,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,GAAG;KAC/E,UAAA,oBAAC,MAAD,EAAM,MAAM,SAAW,CAAA;IACV,CAAA;GACJ,CAAA;EACL,CAAA;CACQ,CAAA;AAExB,CAAC;AAED,mBAAmB,cAAc"}
|
|
@@ -33,6 +33,7 @@ export { type BitkitUIHeaderMode, type BitkitUIHeaderModeSwitchProps } from './U
|
|
|
33
33
|
export { type BitkitUIHeaderNavButtonProps } from './UIHeaderNavButton';
|
|
34
34
|
export { type BitkitUIHeaderSearchProps } from './UIHeaderSearch';
|
|
35
35
|
export { uiHeaderBottom } from './usePublishedBottom';
|
|
36
|
+
export { default as useUiHeaderBottom } from './useUiHeaderBottom';
|
|
36
37
|
declare const _default: import('react').ForwardRefExoticComponent<BitkitUIHeaderProps & import('react').RefAttributes<HTMLElement>> & {
|
|
37
38
|
Account: import('react').ForwardRefExoticComponent<import('./UIHeaderAccount').BitkitUIHeaderAccountProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
38
39
|
Button: import('react').ForwardRefExoticComponent<import('./UIHeaderButton').BitkitUIHeaderButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { withSubComponents } from "../../utilities/withSubComponents.js";
|
|
2
2
|
import BitbotLogoWithText from "../BitbotLogoWithText/BitbotLogoWithText.js";
|
|
3
3
|
import UIHeaderAccount from "./UIHeaderAccount.js";
|
|
4
|
+
import useUiHeaderBottom from "./useUiHeaderBottom.js";
|
|
4
5
|
import UIHeaderButton from "./UIHeaderButton.js";
|
|
5
6
|
import { UIHeaderContextProvider } from "./UIHeaderContext.js";
|
|
6
7
|
import UIHeaderControl from "./UIHeaderControl.js";
|
|
@@ -119,6 +120,6 @@ var BitkitUIHeader_default = withSubComponents(BitkitUIHeader, {
|
|
|
119
120
|
NavButton: UIHeaderNavButton,
|
|
120
121
|
Search: UIHeaderSearch
|
|
121
122
|
});
|
|
122
|
-
export { BitkitUIHeader_default as default, uiHeaderBottom, uiHeaderHeight, uiHeaderHeightPx };
|
|
123
|
+
export { BitkitUIHeader_default as default, uiHeaderBottom, uiHeaderHeight, uiHeaderHeightPx, useUiHeaderBottom };
|
|
123
124
|
|
|
124
125
|
//# sourceMappingURL=BitkitUIHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitUIHeader.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/BitkitUIHeader.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type ReactNode, useMemo, useRef } from 'react';\n\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitbotLogoWithText from '../BitbotLogoWithText/BitbotLogoWithText';\nimport UIHeaderAccount from './UIHeaderAccount';\nimport UIHeaderButton from './UIHeaderButton';\nimport { UIHeaderContextProvider } from './UIHeaderContext';\nimport UIHeaderControl from './UIHeaderControl';\nimport UIHeaderModeSwitch from './UIHeaderModeSwitch';\nimport UIHeaderNavButton from './UIHeaderNavButton';\nimport uiHeaderPart from './uiHeaderPart';\nimport UIHeaderSearch from './UIHeaderSearch';\nimport usePublishedBottom from './usePublishedBottom';\n\nexport interface BitkitUIHeaderProps extends Omit<BoxProps, 'children'> {\n /**\n * Content below the bar, inside the header itself — account-wide notices and the like. It is\n * part of the header rather than the page, so a pinned header keeps it pinned too, and a page\n * reserving room for the header has one element to measure rather than two to add up.\n *\n * Measure it is the word: the banner's height is your content, so a header carrying one is\n * taller than `uiHeaderHeight`. A pinned header needs the measurement, and a header that scrolls\n * with the page needs neither.\n */\n banner?: ReactNode;\n /** The trailing controls, in the order they should appear. */\n children?: ReactNode;\n /**\n * The slot before the logo, shown only below the `tablet` breakpoint. It takes a\n * `BitkitUIHeader.NavButton`, which opens the navigation drawer, or a `BitkitUIHeader.Control`\n * for an account with no workspace to navigate yet.\n *\n * It is a slot rather than a child because the design fixes where it goes: children all land in\n * the trailing cluster, on the far side of the logo.\n */\n leading?: ReactNode;\n /** Where the logo links to. */\n logoHref?: string;\n}\n\n/**\n * The platform's top bar: the Bitrise logo, and the controls for everything that is not navigation\n * — search, changelog, help, notifications, the account.\n *\n * ```tsx\n * <BitkitUIHeader leading={<BitkitUIHeader.NavButton name={workspace} onClick={openNav} />}>\n * <BitkitUIHeader.Button icon={IconSparkle} onClick={askAI} variant=\"secondary\">Ask AI</BitkitUIHeader.Button>\n * <BitkitUIHeader.Search onOpenChange={setSearchOpen} onValueChange={setQuery} open={searchOpen} value={query} />\n * <BitkitUIHeader.Control icon={IconBell} label=\"Notifications\" onClick={toggleNotifications} selected={isOpen} />\n * <BitkitUIHeader.Account name={user.name} onClick={toggleAccount} src={user.avatar} />\n * <BitkitUIHeader.ModeSwitch onValueChange={setMode} value={mode} />\n * </BitkitUIHeader>\n * ```\n *\n * It does not position itself. The consumer decides whether it scrolls with the page or is pinned\n * to the top of it, which is what lets a page put its own chrome above the header. Pin it with the\n * style props the root forwards, and reserve `uiHeaderHeight` for it in the page below, or\n * `uiHeaderHeightPx` where the layout needs a number rather than a token. Those are the bar's\n * height: a header with a `banner` is taller, and a pinned one is measured rather than assumed.\n *\n * It measures itself for you: `uiHeaderBottom` is where the content below a pinned\n * (`position: fixed`) header can start — its bottom edge, the banner and anything pushing it down\n * included, or `0` when it isn't pinned. Use it for whatever has to clear the header (`insetBlockStart={uiHeaderBottom}`).\n *\n * The panels the controls open are the consumer's: a control takes a `selected` flag and paints\n * itself as the open one, and nothing more. That keeps a drawer's content, placement and state\n * where the product can see them. `ModeSwitch` is the one exception — it owns the menu it opens,\n * because the three appearance options are the same everywhere; the consumer holds the chosen mode\n * and applies it.\n *\n * It carries its own responsive behaviour and needs no breakpoint hook. Below `tablet` the\n * `leading` slot appears, the logo centres, the account button becomes an icon, and search stops\n * opening a field in the bar.\n */\nconst BitkitUIHeader = forwardRef<HTMLElement, BitkitUIHeaderProps>((props, ref) => {\n const { banner, children, css, leading, logoHref = '/', ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'uiHeader' });\n const styles = recipe();\n\n const barRef = useRef<HTMLDivElement>(null);\n const rootRef = usePublishedBottom(ref);\n\n const context = useMemo(() => ({ barRef, styles }), [styles]);\n\n return (\n <UIHeaderContextProvider value={context}>\n <Box ref={rootRef} asChild {...rest} css={[styles.root, css]}>\n <header {...uiHeaderPart('root')}>\n <Box ref={barRef} css={styles.bar} {...uiHeaderPart('bar')}>\n <Box css={styles.leading} {...uiHeaderPart('leading')}>\n {leading}\n </Box>\n <Box css={styles.spacer} {...uiHeaderPart('spacer')} />\n <Box css={styles.logoBlock} {...uiHeaderPart('logo-block')}>\n <Box asChild css={styles.logoLink}>\n <a aria-label=\"Bitrise Dashboard\" href={logoHref} {...uiHeaderPart('logo-link')}>\n <BitbotLogoWithText />\n </a>\n </Box>\n </Box>\n <Box css={styles.actions} {...uiHeaderPart('actions')}>\n {children}\n </Box>\n </Box>\n {!!banner && (\n <Box css={styles.banner} {...uiHeaderPart('banner')}>\n {banner}\n </Box>\n )}\n </header>\n </Box>\n </UIHeaderContextProvider>\n );\n});\n\nexport { uiHeaderHeight, uiHeaderHeightPx } from '../../theme/slot-recipes/UIHeader.recipe';\nexport { type BitkitUIHeaderAccountProps } from './UIHeaderAccount';\nexport { type BitkitUIHeaderButtonProps } from './UIHeaderButton';\nexport {\n type BitkitUIHeaderBadge,\n type BitkitUIHeaderControlAsAnchorProps,\n type BitkitUIHeaderControlAsButtonProps,\n type BitkitUIHeaderControlProps,\n} from './UIHeaderControl';\nexport { type BitkitUIHeaderMode, type BitkitUIHeaderModeSwitchProps } from './UIHeaderModeSwitch';\nexport { type BitkitUIHeaderNavButtonProps } from './UIHeaderNavButton';\nexport { type BitkitUIHeaderSearchProps } from './UIHeaderSearch';\nexport { uiHeaderBottom } from './usePublishedBottom';\n\nBitkitUIHeader.displayName = 'BitkitUIHeader';\n\nexport default withSubComponents(BitkitUIHeader, {\n Account: UIHeaderAccount,\n Button: UIHeaderButton,\n Control: UIHeaderControl,\n ModeSwitch: UIHeaderModeSwitch,\n NavButton: UIHeaderNavButton,\n Search: UIHeaderSearch,\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"BitkitUIHeader.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/BitkitUIHeader.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type ReactNode, useMemo, useRef } from 'react';\n\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitbotLogoWithText from '../BitbotLogoWithText/BitbotLogoWithText';\nimport UIHeaderAccount from './UIHeaderAccount';\nimport UIHeaderButton from './UIHeaderButton';\nimport { UIHeaderContextProvider } from './UIHeaderContext';\nimport UIHeaderControl from './UIHeaderControl';\nimport UIHeaderModeSwitch from './UIHeaderModeSwitch';\nimport UIHeaderNavButton from './UIHeaderNavButton';\nimport uiHeaderPart from './uiHeaderPart';\nimport UIHeaderSearch from './UIHeaderSearch';\nimport usePublishedBottom from './usePublishedBottom';\n\nexport interface BitkitUIHeaderProps extends Omit<BoxProps, 'children'> {\n /**\n * Content below the bar, inside the header itself — account-wide notices and the like. It is\n * part of the header rather than the page, so a pinned header keeps it pinned too, and a page\n * reserving room for the header has one element to measure rather than two to add up.\n *\n * Measure it is the word: the banner's height is your content, so a header carrying one is\n * taller than `uiHeaderHeight`. A pinned header needs the measurement, and a header that scrolls\n * with the page needs neither.\n */\n banner?: ReactNode;\n /** The trailing controls, in the order they should appear. */\n children?: ReactNode;\n /**\n * The slot before the logo, shown only below the `tablet` breakpoint. It takes a\n * `BitkitUIHeader.NavButton`, which opens the navigation drawer, or a `BitkitUIHeader.Control`\n * for an account with no workspace to navigate yet.\n *\n * It is a slot rather than a child because the design fixes where it goes: children all land in\n * the trailing cluster, on the far side of the logo.\n */\n leading?: ReactNode;\n /** Where the logo links to. */\n logoHref?: string;\n}\n\n/**\n * The platform's top bar: the Bitrise logo, and the controls for everything that is not navigation\n * — search, changelog, help, notifications, the account.\n *\n * ```tsx\n * <BitkitUIHeader leading={<BitkitUIHeader.NavButton name={workspace} onClick={openNav} />}>\n * <BitkitUIHeader.Button icon={IconSparkle} onClick={askAI} variant=\"secondary\">Ask AI</BitkitUIHeader.Button>\n * <BitkitUIHeader.Search onOpenChange={setSearchOpen} onValueChange={setQuery} open={searchOpen} value={query} />\n * <BitkitUIHeader.Control icon={IconBell} label=\"Notifications\" onClick={toggleNotifications} selected={isOpen} />\n * <BitkitUIHeader.Account name={user.name} onClick={toggleAccount} src={user.avatar} />\n * <BitkitUIHeader.ModeSwitch onValueChange={setMode} value={mode} />\n * </BitkitUIHeader>\n * ```\n *\n * It does not position itself. The consumer decides whether it scrolls with the page or is pinned\n * to the top of it, which is what lets a page put its own chrome above the header. Pin it with the\n * style props the root forwards, and reserve `uiHeaderHeight` for it in the page below, or\n * `uiHeaderHeightPx` where the layout needs a number rather than a token. Those are the bar's\n * height: a header with a `banner` is taller, and a pinned one is measured rather than assumed.\n *\n * It measures itself for you: `uiHeaderBottom` is where the content below a pinned\n * (`position: fixed`) header can start — its bottom edge, the banner and anything pushing it down\n * included, or `0` when it isn't pinned. Use it for whatever has to clear the header (`insetBlockStart={uiHeaderBottom}`).\n *\n * The panels the controls open are the consumer's: a control takes a `selected` flag and paints\n * itself as the open one, and nothing more. That keeps a drawer's content, placement and state\n * where the product can see them. `ModeSwitch` is the one exception — it owns the menu it opens,\n * because the three appearance options are the same everywhere; the consumer holds the chosen mode\n * and applies it.\n *\n * It carries its own responsive behaviour and needs no breakpoint hook. Below `tablet` the\n * `leading` slot appears, the logo centres, the account button becomes an icon, and search stops\n * opening a field in the bar.\n */\nconst BitkitUIHeader = forwardRef<HTMLElement, BitkitUIHeaderProps>((props, ref) => {\n const { banner, children, css, leading, logoHref = '/', ...rest } = props;\n\n const recipe = useSlotRecipe({ key: 'uiHeader' });\n const styles = recipe();\n\n const barRef = useRef<HTMLDivElement>(null);\n const rootRef = usePublishedBottom(ref);\n\n const context = useMemo(() => ({ barRef, styles }), [styles]);\n\n return (\n <UIHeaderContextProvider value={context}>\n <Box ref={rootRef} asChild {...rest} css={[styles.root, css]}>\n <header {...uiHeaderPart('root')}>\n <Box ref={barRef} css={styles.bar} {...uiHeaderPart('bar')}>\n <Box css={styles.leading} {...uiHeaderPart('leading')}>\n {leading}\n </Box>\n <Box css={styles.spacer} {...uiHeaderPart('spacer')} />\n <Box css={styles.logoBlock} {...uiHeaderPart('logo-block')}>\n <Box asChild css={styles.logoLink}>\n <a aria-label=\"Bitrise Dashboard\" href={logoHref} {...uiHeaderPart('logo-link')}>\n <BitbotLogoWithText />\n </a>\n </Box>\n </Box>\n <Box css={styles.actions} {...uiHeaderPart('actions')}>\n {children}\n </Box>\n </Box>\n {!!banner && (\n <Box css={styles.banner} {...uiHeaderPart('banner')}>\n {banner}\n </Box>\n )}\n </header>\n </Box>\n </UIHeaderContextProvider>\n );\n});\n\nexport { uiHeaderHeight, uiHeaderHeightPx } from '../../theme/slot-recipes/UIHeader.recipe';\nexport { type BitkitUIHeaderAccountProps } from './UIHeaderAccount';\nexport { type BitkitUIHeaderButtonProps } from './UIHeaderButton';\nexport {\n type BitkitUIHeaderBadge,\n type BitkitUIHeaderControlAsAnchorProps,\n type BitkitUIHeaderControlAsButtonProps,\n type BitkitUIHeaderControlProps,\n} from './UIHeaderControl';\nexport { type BitkitUIHeaderMode, type BitkitUIHeaderModeSwitchProps } from './UIHeaderModeSwitch';\nexport { type BitkitUIHeaderNavButtonProps } from './UIHeaderNavButton';\nexport { type BitkitUIHeaderSearchProps } from './UIHeaderSearch';\nexport { uiHeaderBottom } from './usePublishedBottom';\nexport { default as useUiHeaderBottom } from './useUiHeaderBottom';\n\nBitkitUIHeader.displayName = 'BitkitUIHeader';\n\nexport default withSubComponents(BitkitUIHeader, {\n Account: UIHeaderAccount,\n Button: UIHeaderButton,\n Control: UIHeaderControl,\n ModeSwitch: UIHeaderModeSwitch,\n NavButton: UIHeaderNavButton,\n Search: UIHeaderSearch,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,IAAM,iBAAiB,YAA8C,OAAO,QAAQ;CAClF,MAAM,EAAE,QAAQ,UAAU,KAAK,SAAS,WAAW,KAAK,GAAG,SAAS;CAGpE,MAAM,SADS,cAAc,EAAE,KAAK,WAAW,CAChC,CAAA,CAAO;CAEtB,MAAM,SAAS,OAAuB,IAAI;CAC1C,MAAM,UAAU,mBAAmB,GAAG;CAEtC,MAAM,UAAU,eAAe;EAAE;EAAQ;CAAO,IAAI,CAAC,MAAM,CAAC;CAE5D,OACE,oBAAC,yBAAD;EAAyB,OAAO;EAC9B,UAAA,oBAAC,KAAD;GAAK,KAAK;GAAS,SAAA;GAAQ,GAAI;GAAM,KAAK,CAAC,OAAO,MAAM,GAAG;GACzD,UAAA,qBAAC,UAAD;IAAQ,GAAI,aAAa,MAAM;IAA/B,UAAA,CACE,qBAAC,KAAD;KAAK,KAAK;KAAQ,KAAK,OAAO;KAAK,GAAI,aAAa,KAAK;KAAzD,UAAA;MACE,oBAAC,KAAD;OAAK,KAAK,OAAO;OAAS,GAAI,aAAa,SAAS;OACjD,UAAA;MACE,CAAA;MACL,oBAAC,KAAD;OAAK,KAAK,OAAO;OAAQ,GAAI,aAAa,QAAQ;MAAI,CAAA;MACtD,oBAAC,KAAD;OAAK,KAAK,OAAO;OAAW,GAAI,aAAa,YAAY;OACvD,UAAA,oBAAC,KAAD;QAAK,SAAA;QAAQ,KAAK,OAAO;QACvB,UAAA,oBAAC,KAAD;SAAG,cAAW;SAAoB,MAAM;SAAU,GAAI,aAAa,WAAW;SAC5E,UAAA,oBAAC,oBAAD,CAAqB,CAAA;QACpB,CAAA;OACA,CAAA;MACF,CAAA;MACL,oBAAC,KAAD;OAAK,KAAK,OAAO;OAAS,GAAI,aAAa,SAAS;OACjD;MACE,CAAA;KACF;IACJ,CAAA,GAAA,CAAC,CAAC,UACD,oBAAC,KAAD;KAAK,KAAK,OAAO;KAAQ,GAAI,aAAa,QAAQ;KAC/C,UAAA;IACE,CAAA,CAED;;EACL,CAAA;CACkB,CAAA;AAE7B,CAAC;AAiBD,eAAe,cAAc;AAE7B,IAAA,yBAAe,kBAAkB,gBAAgB;CAC/C,SAAS;CACT,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,WAAW;CACX,QAAQ;AACV,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ForwardedRef } from 'react';
|
|
2
|
+
export declare const bottomVarName = "--bitkit-ui-header-bottom";
|
|
2
3
|
/**
|
|
3
4
|
* Where the content below a pinned (`position: fixed`) `BitkitUIHeader` can start: its bottom edge,
|
|
4
5
|
* banner and any offset pushing it down included, or `0` when it isn't pinned. Use it for whatever has
|
|
@@ -48,6 +48,6 @@ var usePublishedBottom = (forwardedRef) => {
|
|
|
48
48
|
}, [publish, unpublish]);
|
|
49
49
|
return nodeRef;
|
|
50
50
|
};
|
|
51
|
-
export { usePublishedBottom as default, uiHeaderBottom };
|
|
51
|
+
export { bottomVarName, usePublishedBottom as default, uiHeaderBottom };
|
|
52
52
|
|
|
53
53
|
//# sourceMappingURL=usePublishedBottom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePublishedBottom.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/usePublishedBottom.ts"],"sourcesContent":["import { type ForwardedRef, useCallback, useImperativeHandle, useLayoutEffect, useRef } from 'react';\n\
|
|
1
|
+
{"version":3,"file":"usePublishedBottom.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/usePublishedBottom.ts"],"sourcesContent":["import { type ForwardedRef, useCallback, useImperativeHandle, useLayoutEffect, useRef } from 'react';\n\nexport const bottomVarName = '--bitkit-ui-header-bottom';\n\n/**\n * Where the content below a pinned (`position: fixed`) `BitkitUIHeader` can start: its bottom edge,\n * banner and any offset pushing it down included, or `0` when it isn't pinned. Use it for whatever has\n * to clear the header, such as a sticky row's `insetBlockStart` or a `scrollMarginTop`.\n */\nexport const uiHeaderBottom = `var(${bottomVarName}, 0px)`;\n\n/**\n * Publishes a fixed header's bottom edge as `--bitkit-ui-header-bottom` on the document root. It is\n * re-measured when the header resizes (a banner appears) and on every render, since an offset that\n * moves it, such as a `marginBlockStart`, arrives as a prop and resizes nothing. Only `fixed` counts:\n * a `sticky` header's edge moves as the page scrolls, which this doesn't follow.\n *\n * A header that isn't pinned leaves the variable alone, and a header only removes the value it set.\n */\nconst usePublishedBottom = <T extends HTMLElement>(forwardedRef: ForwardedRef<T>) => {\n const nodeRef = useRef<T>(null);\n const isPublishingRef = useRef(false);\n\n useImperativeHandle(forwardedRef, () => nodeRef.current as T, []);\n\n const unpublish = useCallback(() => {\n if (isPublishingRef.current) {\n document.documentElement.style.removeProperty(bottomVarName);\n isPublishingRef.current = false;\n }\n }, []);\n\n const publish = useCallback(() => {\n const node = nodeRef.current;\n if (!node) {\n return;\n }\n if (window.getComputedStyle(node).position !== 'fixed') {\n unpublish();\n return;\n }\n const bottom = Math.max(node.getBoundingClientRect().bottom, 0);\n document.documentElement.style.setProperty(bottomVarName, `${bottom}px`);\n isPublishingRef.current = true;\n }, [unpublish]);\n\n useLayoutEffect(publish);\n\n useLayoutEffect(() => {\n const node = nodeRef.current;\n const observer = node && typeof ResizeObserver !== 'undefined' ? new ResizeObserver(publish) : undefined;\n if (node) {\n observer?.observe(node);\n }\n return () => {\n observer?.disconnect();\n unpublish();\n };\n }, [publish, unpublish]);\n\n return nodeRef;\n};\n\nexport default usePublishedBottom;\n"],"mappings":";;AAEA,IAAa,gBAAgB;;;;;;AAO7B,IAAa,iBAAiB,OAAO,cAAc;;;;;;;;;AAUnD,IAAM,sBAA6C,iBAAkC;CACnF,MAAM,UAAU,OAAU,IAAI;CAC9B,MAAM,kBAAkB,OAAO,KAAK;CAEpC,oBAAoB,oBAAoB,QAAQ,SAAc,CAAC,CAAC;CAEhE,MAAM,YAAY,kBAAkB;EAClC,IAAI,gBAAgB,SAAS;GAC3B,SAAS,gBAAgB,MAAM,eAAe,aAAa;GAC3D,gBAAgB,UAAU;EAC5B;CACF,GAAG,CAAC,CAAC;CAEL,MAAM,UAAU,kBAAkB;EAChC,MAAM,OAAO,QAAQ;EACrB,IAAI,CAAC,MACH;EAEF,IAAI,OAAO,iBAAiB,IAAI,CAAC,CAAC,aAAa,SAAS;GACtD,UAAU;GACV;EACF;EACA,MAAM,SAAS,KAAK,IAAI,KAAK,sBAAsB,CAAC,CAAC,QAAQ,CAAC;EAC9D,SAAS,gBAAgB,MAAM,YAAY,eAAe,GAAG,OAAO,GAAG;EACvE,gBAAgB,UAAU;CAC5B,GAAG,CAAC,SAAS,CAAC;CAEd,gBAAgB,OAAO;CAEvB,sBAAsB;EACpB,MAAM,OAAO,QAAQ;EACrB,MAAM,WAAW,QAAQ,OAAO,mBAAmB,cAAc,IAAI,eAAe,OAAO,IAAI,KAAA;EAC/F,IAAI,MACF,UAAU,QAAQ,IAAI;EAExB,aAAa;GACX,UAAU,WAAW;GACrB,UAAU;EACZ;CACF,GAAG,CAAC,SAAS,SAAS,CAAC;CAEvB,OAAO;AACT"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `uiHeaderBottom` as a number of px, for JS that needs one, such as an `IntersectionObserver`
|
|
3
|
+
* margin. It updates when the value changes (a banner comes or goes). CSS takes `uiHeaderBottom`.
|
|
4
|
+
*/
|
|
5
|
+
declare const useUiHeaderBottom: () => number;
|
|
6
|
+
export default useUiHeaderBottom;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "./usePublishedBottom.js";
|
|
2
|
+
import { useSyncExternalStore } from "react";
|
|
3
|
+
// lib/components/BitkitUIHeader/useUiHeaderBottom.ts
|
|
4
|
+
var read = () => parseFloat(document.documentElement.style.getPropertyValue("--bitkit-ui-header-bottom")) || 0;
|
|
5
|
+
var readOnServer = () => 0;
|
|
6
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
7
|
+
var observer;
|
|
8
|
+
var subscribe = (listener) => {
|
|
9
|
+
listeners.add(listener);
|
|
10
|
+
if (!observer) {
|
|
11
|
+
observer = new MutationObserver(() => listeners.forEach((notify) => notify()));
|
|
12
|
+
observer.observe(document.documentElement, { attributeFilter: ["style"] });
|
|
13
|
+
}
|
|
14
|
+
return () => {
|
|
15
|
+
listeners.delete(listener);
|
|
16
|
+
if (listeners.size === 0) {
|
|
17
|
+
observer?.disconnect();
|
|
18
|
+
observer = void 0;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* `uiHeaderBottom` as a number of px, for JS that needs one, such as an `IntersectionObserver`
|
|
24
|
+
* margin. It updates when the value changes (a banner comes or goes). CSS takes `uiHeaderBottom`.
|
|
25
|
+
*/
|
|
26
|
+
var useUiHeaderBottom = () => useSyncExternalStore(subscribe, read, readOnServer);
|
|
27
|
+
export { useUiHeaderBottom as default };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=useUiHeaderBottom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUiHeaderBottom.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/useUiHeaderBottom.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react';\n\nimport { bottomVarName } from './usePublishedBottom';\n\n// Set as an inline style on <html>, so reading it needs no layout.\nconst read = () => parseFloat(document.documentElement.style.getPropertyValue(bottomVarName)) || 0;\nconst readOnServer = () => 0;\n\n// One observer for every caller, connected while anyone listens.\nconst listeners = new Set<() => void>();\nlet observer: MutationObserver | undefined;\n\nconst subscribe = (listener: () => void) => {\n listeners.add(listener);\n if (!observer) {\n observer = new MutationObserver(() => listeners.forEach((notify) => notify()));\n observer.observe(document.documentElement, { attributeFilter: ['style'] });\n }\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0) {\n observer?.disconnect();\n observer = undefined;\n }\n };\n};\n\n/**\n * `uiHeaderBottom` as a number of px, for JS that needs one, such as an `IntersectionObserver`\n * margin. It updates when the value changes (a banner comes or goes). CSS takes `uiHeaderBottom`.\n */\nconst useUiHeaderBottom = () => useSyncExternalStore(subscribe, read, readOnServer);\n\nexport default useUiHeaderBottom;\n"],"mappings":";;;AAKA,IAAM,aAAa,WAAW,SAAS,gBAAgB,MAAM,iBAAA,2BAA8B,CAAC,KAAK;AACjG,IAAM,qBAAqB;AAG3B,IAAM,4BAAY,IAAI,IAAgB;AACtC,IAAI;AAEJ,IAAM,aAAa,aAAyB;CAC1C,UAAU,IAAI,QAAQ;CACtB,IAAI,CAAC,UAAU;EACb,WAAW,IAAI,uBAAuB,UAAU,SAAS,WAAW,OAAO,CAAC,CAAC;EAC7E,SAAS,QAAQ,SAAS,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,EAAE,CAAC;CAC3E;CACA,aAAa;EACX,UAAU,OAAO,QAAQ;EACzB,IAAI,UAAU,SAAS,GAAG;GACxB,UAAU,WAAW;GACrB,WAAW,KAAA;EACb;CACF;AACF;;;;;AAMA,IAAM,0BAA0B,qBAAqB,WAAW,MAAM,YAAY"}
|
|
@@ -59,7 +59,7 @@ export { default as BitkitNumberInput, type BitkitNumberInputProps } from './Bit
|
|
|
59
59
|
export { default as BitkitOverflowContent, type BitkitOverflowContentProps, } from './BitkitOverflowContent/BitkitOverflowContent';
|
|
60
60
|
export { default as BitkitOverflowTooltip, type BitkitOverflowTooltipProps, } from './BitkitOverflowTooltip/BitkitOverflowTooltip';
|
|
61
61
|
export { default as BitkitPageFooter, type BitkitPageFooterItemProps, type BitkitPageFooterProps, } from './BitkitPageFooter/BitkitPageFooter';
|
|
62
|
-
export { default as BitkitPageHeader, type BitkitPageHeaderProps } from './BitkitPageHeader/BitkitPageHeader';
|
|
62
|
+
export { default as BitkitPageHeader, type BitkitPageHeaderProps, pageHeaderBottom, } from './BitkitPageHeader/BitkitPageHeader';
|
|
63
63
|
export { default as BitkitPageSidebar, type BitkitPageSidebarBodyProps, type BitkitPageSidebarDividerProps, type BitkitPageSidebarDrawerHeaderProps, type BitkitPageSidebarFooterProps, type BitkitPageSidebarGroupHeadingProps, type BitkitPageSidebarItemProps, type BitkitPageSidebarProgressItemProps, type BitkitPageSidebarProjectProps, type BitkitPageSidebarProps, type BitkitPageSidebarSectionProps, type BitkitPageSidebarTitleProps, } from './BitkitPageSidebar/BitkitPageSidebar';
|
|
64
64
|
export { default as BitkitPageSubheader, type BitkitPageSubheaderProps, } from './BitkitPageSubheader/BitkitPageSubheader';
|
|
65
65
|
export { default as BitkitPagination, type BitkitPaginationLabels, type BitkitPaginationProps, } from './BitkitPagination/BitkitPagination';
|
|
@@ -108,6 +108,6 @@ export { default as BitkitToggletip, type BitkitToggletipProps } from './BitkitT
|
|
|
108
108
|
export { default as BitkitTooltip, type BitkitTooltipProps } from './BitkitTooltip/BitkitTooltip';
|
|
109
109
|
export { default as BitkitTour, type BitkitTourInstance, type BitkitTourOptions, type BitkitTourProps, type BitkitTourSecondaryAction, type BitkitTourStep, useBitkitTour, } from './BitkitTour/BitkitTour';
|
|
110
110
|
export { default as BitkitTreeView, type BitkitTreeViewBranchProps, type BitkitTreeViewExpandedChangeDetails, type BitkitTreeViewLeafProps, type BitkitTreeViewNodeRenderProps, type BitkitTreeViewRootProps, type BitkitTreeViewSelectionChangeDetails, createTreeCollection, } from './BitkitTreeView/BitkitTreeView';
|
|
111
|
-
export { default as BitkitUIHeader, type BitkitUIHeaderAccountProps, type BitkitUIHeaderBadge, type BitkitUIHeaderButtonProps, type BitkitUIHeaderControlAsAnchorProps, type BitkitUIHeaderControlAsButtonProps, type BitkitUIHeaderControlProps, type BitkitUIHeaderMode, type BitkitUIHeaderModeSwitchProps, type BitkitUIHeaderNavButtonProps, type BitkitUIHeaderProps, type BitkitUIHeaderSearchProps, uiHeaderBottom, uiHeaderHeight, uiHeaderHeightPx, } from './BitkitUIHeader/BitkitUIHeader';
|
|
111
|
+
export { default as BitkitUIHeader, type BitkitUIHeaderAccountProps, type BitkitUIHeaderBadge, type BitkitUIHeaderButtonProps, type BitkitUIHeaderControlAsAnchorProps, type BitkitUIHeaderControlAsButtonProps, type BitkitUIHeaderControlProps, type BitkitUIHeaderMode, type BitkitUIHeaderModeSwitchProps, type BitkitUIHeaderNavButtonProps, type BitkitUIHeaderProps, type BitkitUIHeaderSearchProps, uiHeaderBottom, uiHeaderHeight, uiHeaderHeightPx, useUiHeaderBottom, } from './BitkitUIHeader/BitkitUIHeader';
|
|
112
112
|
export { default as BitkitUISideNav, type BitkitUISideNavBodyProps, type BitkitUISideNavFooterHeadingProps, type BitkitUISideNavFooterProps, type BitkitUISideNavItemProps, type BitkitUISideNavLinkAsAnchorProps, type BitkitUISideNavLinkAsButtonProps, type BitkitUISideNavLinkProps, type BitkitUISideNavProps, type BitkitUISideNavWorkspaceProps, type BitkitUISideNavWorkspaceSelectorProps, uiSideNavRailWidth, } from './BitkitUISideNav/BitkitUISideNav';
|
|
113
113
|
export { useUISideNav } from './BitkitUISideNav/UISideNavContext';
|
package/dist/main.js
CHANGED
|
@@ -366,6 +366,9 @@ import BitkitNumberInput from "./components/BitkitNumberInput/BitkitNumberInput.
|
|
|
366
366
|
import BitkitOverflowContent from "./components/BitkitOverflowContent/BitkitOverflowContent.js";
|
|
367
367
|
import BitkitOverflowTooltip from "./components/BitkitOverflowTooltip/BitkitOverflowTooltip.js";
|
|
368
368
|
import BitkitPageFooter_default from "./components/BitkitPageFooter/BitkitPageFooter.js";
|
|
369
|
+
import { uiHeaderBottom } from "./components/BitkitUIHeader/usePublishedBottom.js";
|
|
370
|
+
import useUiHeaderBottom from "./components/BitkitUIHeader/useUiHeaderBottom.js";
|
|
371
|
+
import { pageHeaderBottom } from "./components/BitkitPageHeader/pageHeaderBottom.js";
|
|
369
372
|
import BitkitPageHeader from "./components/BitkitPageHeader/BitkitPageHeader.js";
|
|
370
373
|
import BitkitPageSidebar_default from "./components/BitkitPageSidebar/BitkitPageSidebar.js";
|
|
371
374
|
import BitkitPageSubheader from "./components/BitkitPageSubheader/BitkitPageSubheader.js";
|
|
@@ -398,7 +401,6 @@ import createBitkitToast, { dismissBitkitToast } from "./components/BitkitToast/
|
|
|
398
401
|
import BitkitToggleButton from "./components/BitkitToggleButton/BitkitToggleButton.js";
|
|
399
402
|
import BitkitTour, { useBitkitTour } from "./components/BitkitTour/BitkitTour.js";
|
|
400
403
|
import BitkitTreeView, { createTreeCollection } from "./components/BitkitTreeView/BitkitTreeView.js";
|
|
401
|
-
import { uiHeaderBottom } from "./components/BitkitUIHeader/usePublishedBottom.js";
|
|
402
404
|
import { uiHeaderHeight, uiHeaderHeightPx } from "./theme/slot-recipes/UIHeader.recipe.js";
|
|
403
405
|
import BitkitUIHeader_default from "./components/BitkitUIHeader/BitkitUIHeader.js";
|
|
404
406
|
import { useUISideNav } from "./components/BitkitUISideNav/UISideNavContext.js";
|
|
@@ -406,4 +408,4 @@ import { uiSideNavRailWidth } from "./theme/slot-recipes/UISideNav.recipe.js";
|
|
|
406
408
|
import BitkitUISideNav_default from "./components/BitkitUISideNav/BitkitUISideNav.js";
|
|
407
409
|
import Provider from "./providers/BitkitProvider.js";
|
|
408
410
|
import bitkitTheme from "./theme/index.js";
|
|
409
|
-
export { BitbotLogoWithText, BitkitAccordion_default as BitkitAccordion, BitkitActionBar, BitkitActionMenu_default as BitkitActionMenu, BitkitAlert, BitkitAvatar, BitkitBadge, BitkitBreadcrumb, BitkitButton, BitkitCalendar, BitkitCheckbox, BitkitCheckboxGroup, BitkitCloseButton, BitkitCodeSnippet, BitkitCollapsible, BitkitColorButton, BitkitCombobox_default as BitkitCombobox, BitkitContentWrapper_default as BitkitContentWrapper, BitkitControlButton, BitkitDataWidget, BitkitDatePicker, BitkitDefinitionTooltip, BitkitDialog_default as BitkitDialog, BitkitDraggableCard, BitkitDrawer, BitkitEmptyState, BitkitExpandableCard, BitkitField, BitkitFileInput, BitkitFilter_default as BitkitFilter, BitkitFormDialog_default as BitkitFormDialog, BitkitGroupHeading, BitkitHeading, BitkitIconButton, BitkitInlineLoading, BitkitLabel, BitkitLabelTooltip, BitkitLabeledData, BitkitLightbox, BitkitLink, BitkitLinkButton, BitkitLinkCard, BitkitList_default as BitkitList, BitkitMarkdown, BitkitMarkdownCard, BitkitMultiselect_default as BitkitMultiselect, BitkitMultiselectMenu, BitkitNativeSelect, BitkitNoteCard, BitkitNumberInput, BitkitOverflowContent, BitkitOverflowTooltip, BitkitPageFooter_default as BitkitPageFooter, BitkitPageHeader, BitkitPageSidebar_default as BitkitPageSidebar, BitkitPageSubheader, BitkitPagination, BitkitPaginationLoadMore, BitkitPinInput, BitkitPopover, BitkitProductThumbnail, BitkitProgressBar, BitkitPromoBanner, Provider as BitkitProvider, BitkitRadio, BitkitRadioGroup, BitkitRibbon, BitkitSearchInput, BitkitSectionHeading, BitkitSegmentedControl_default as BitkitSegmentedControl, BitkitSelect_default as BitkitSelect, BitkitSelectMenu, BitkitSelectMenuAction, BitkitSelectableTag_default as BitkitSelectableTag, BitkitSettingsCard_default as BitkitSettingsCard, BitkitSkeletonGroup, BitkitSpinner, BitkitSplitButton_default as BitkitSplitButton, BitkitStat, BitkitSteps_default as BitkitSteps, BitkitStepsCard_default as BitkitStepsCard, BitkitStepsDialog_default as BitkitStepsDialog, BitkitSwitch, BitkitTable, BitkitTableCard, BitkitTabs, BitkitTag, BitkitTagsInput, BitkitTextArea, BitkitTextInput, BitkitToggleButton, BitkitToggletip, BitkitTooltip, BitkitTour, BitkitTreeView, BitkitUIHeader_default as BitkitUIHeader, BitkitUISideNav_default as BitkitUISideNav, IconAbortCircle, IconAbortCircleFilled, IconAddons, IconAgent, IconAnchor, IconAndroid, IconApp, IconAppSettings, IconAppStore, IconAppStoreColor, IconApple, IconArchive, IconArchiveDelete, IconArchiveRestore, IconArrowBackAndDown, IconArrowBackAndUp, IconArrowDown, IconArrowForwardAndDown, IconArrowForwardAndUp, IconArrowLeft, IconArrowNortheast, IconArrowNorthwest, IconArrowRight, IconArrowUp, IconArrowsHorizontal, IconArrowsVertical, IconAutomation, IconAws, IconAwsColor, IconBadge3RdParty, IconBadgeBitrise, IconBadgeUpgrade, IconBadgeVersionOk, IconBazel, IconBell, IconBitbot, IconBitbotError, IconBitbotIntercomWhite, IconBitbucket, IconBitbucketColor, IconBitbucketNeutral, IconBitbucketWhite, IconBlockCircle, IconBook, IconBoxArrowDown, IconBoxDot, IconBoxLinesOverflow, IconBoxLinesWrap, IconBranch, IconBrowserstackColor, IconBug, IconBuild, IconBuildCache, IconBuildCacheFilled, IconBuildEnvSetup, IconBuildHub, IconBuildHubFilled, IconCalendar, IconChangePlan, IconChat, IconCheck, IconCheckCircle, IconCheckCircleFilled, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCi, IconCiFilled, IconCircle, IconCircleDashed, IconCircleHalfFilled, IconClaude, IconClaudeColor, IconClock, IconCode, IconCodePush, IconCodeSigning, IconCoffee, IconCommit, IconConfigure, IconConnectedAccounts, IconContainer, IconCopilot, IconCopy, IconCordova, IconCpu, IconCreditcard, IconCredits, IconCross, IconCrossCircle, IconCrossCircleFilled, IconCrown, IconCursor, IconCycle, IconDashboard, IconDashboardFilled, IconDeployment, IconDetails, IconDoc, IconDollar, IconDot, IconDotnet, IconDotnetColor, IconDotnetText, IconDotnetTextColor, IconDoubleCircle, IconDownload, IconDragHandle, IconEc2Ami, IconEnterprise, IconErrorCircle, IconErrorCircleFilled, IconExpand, IconExtraBuildCapacity, IconEye, IconEyeSlash, IconFastlane, IconFile, IconFileDoc, IconFilePdf, IconFilePlist, IconFileYml, IconFileZip, IconFilter, IconFlag, IconFlutter, IconFolder, IconFullscreen, IconFullscreenExit, IconGauge, IconGit, IconGithub, IconGitlab, IconGitlabColor, IconGitlabWhite, IconGlobe, IconGo, IconGoogleColor, IconGooglePlay, IconGooglePlayColor, IconGradle, IconGraph, IconGroup, IconHashtag, IconHeadset, IconHeart, IconHistory, IconHourglass, IconImage, IconInfoCircle, IconInfoCircleFilled, IconInsights, IconInsightsFilled, IconInstall, IconInteraction, IconInvoice, IconIonic, IconJapanese, IconJava, IconJavaColor, IconJavaDuke, IconJavaDukeColor, IconKey, IconKiroColor, IconKotlin, IconKotlinColor, IconKotlinWhite, IconLaptop, IconLaunchdarkly, IconLegacyApp, IconLightbulb, IconLink, IconLinux, IconLock, IconLockOpen, IconLogin, IconLogout, IconMacos, IconMagicWand, IconMagnifier, IconMail, IconMcp, IconMedal, IconMemory, IconMenuGrid, IconMenuHamburger, IconMessage, IconMessageAlert, IconMessageQuestion, IconMicrophone, IconMinus, IconMinusCircle, IconMinusCircleFilled, IconMobile, IconMobileLandscape, IconModeDark, IconModeLight, IconModeSystem, IconMonitorChart, IconMoreHorizontal, IconMoreVertical, IconNews, IconNextjs, IconNodejs, IconOpenInNew, IconOther, IconOutsideContributor, IconOverview, IconPause, IconPencil, IconPeople, IconPercent, IconPerson, IconPersonWithDesk, IconPin, IconPlay, IconPlus, IconPlusCircle, IconPlusCircleFilled, IconPower, IconProject, IconProjectSettings, IconPull, IconPush, IconPuzzle, IconPython, IconPythonColor, IconQuestionCircle, IconQuestionCircleFilled, IconReact, IconRefresh, IconRegex, IconRelease, IconReleaseFilled, IconRemoteAccess, IconRename, IconReplace, IconResponsiveness, IconReviewerApproved, IconReviewerAssigned, IconReviewerRejected, IconRuby, IconRubyColor, IconSave, IconSecurityShield, IconSettings, IconSettingsFilled, IconShuffle, IconSiren, IconSkip, IconSkipCircle, IconSkipCircleFilled, IconSlack, IconSlackColor, IconSparkle, IconSparkleFilled, IconSpinnerOnDisabled, IconSpinnerPurple, IconSpinnerPurpleDouble, IconSpinnerWhite, IconStability, IconStack, IconStar, IconStep, IconStop, IconStopwatch, IconTabPlus, IconTag, IconTasks, IconTeams, IconTeamsColor, IconTemplateCode, IconTerminal, IconTerminalFilled, IconTestQuarantine, IconThemeDarkToggle, IconThumbDown, IconThumbUp, IconTimeline, IconTools, IconTrash, IconTrigger, IconUbuntu, IconUbuntuColor, IconUnity3D, IconUnpin, IconUpload, IconValidateShield, IconVideo, IconVsCode, IconWarning, IconWarningYellow, IconWebUi, IconWebhooks, IconWindsurf, IconWorkflow, IconWorkflowFlow, IconXTwitter, IconXamarin, IconXcode, ResponsiveProvider, bitkitIcon, bitkitTheme as bitriseTheme, createBitkitToast, createTreeCollection, dismissBitkitToast, rem, uiHeaderBottom, uiHeaderHeight, uiHeaderHeightPx, uiSideNavRailWidth, useBitkitTour, useResponsive, useStepsDialog, useUISideNav };
|
|
411
|
+
export { BitbotLogoWithText, BitkitAccordion_default as BitkitAccordion, BitkitActionBar, BitkitActionMenu_default as BitkitActionMenu, BitkitAlert, BitkitAvatar, BitkitBadge, BitkitBreadcrumb, BitkitButton, BitkitCalendar, BitkitCheckbox, BitkitCheckboxGroup, BitkitCloseButton, BitkitCodeSnippet, BitkitCollapsible, BitkitColorButton, BitkitCombobox_default as BitkitCombobox, BitkitContentWrapper_default as BitkitContentWrapper, BitkitControlButton, BitkitDataWidget, BitkitDatePicker, BitkitDefinitionTooltip, BitkitDialog_default as BitkitDialog, BitkitDraggableCard, BitkitDrawer, BitkitEmptyState, BitkitExpandableCard, BitkitField, BitkitFileInput, BitkitFilter_default as BitkitFilter, BitkitFormDialog_default as BitkitFormDialog, BitkitGroupHeading, BitkitHeading, BitkitIconButton, BitkitInlineLoading, BitkitLabel, BitkitLabelTooltip, BitkitLabeledData, BitkitLightbox, BitkitLink, BitkitLinkButton, BitkitLinkCard, BitkitList_default as BitkitList, BitkitMarkdown, BitkitMarkdownCard, BitkitMultiselect_default as BitkitMultiselect, BitkitMultiselectMenu, BitkitNativeSelect, BitkitNoteCard, BitkitNumberInput, BitkitOverflowContent, BitkitOverflowTooltip, BitkitPageFooter_default as BitkitPageFooter, BitkitPageHeader, BitkitPageSidebar_default as BitkitPageSidebar, BitkitPageSubheader, BitkitPagination, BitkitPaginationLoadMore, BitkitPinInput, BitkitPopover, BitkitProductThumbnail, BitkitProgressBar, BitkitPromoBanner, Provider as BitkitProvider, BitkitRadio, BitkitRadioGroup, BitkitRibbon, BitkitSearchInput, BitkitSectionHeading, BitkitSegmentedControl_default as BitkitSegmentedControl, BitkitSelect_default as BitkitSelect, BitkitSelectMenu, BitkitSelectMenuAction, BitkitSelectableTag_default as BitkitSelectableTag, BitkitSettingsCard_default as BitkitSettingsCard, BitkitSkeletonGroup, BitkitSpinner, BitkitSplitButton_default as BitkitSplitButton, BitkitStat, BitkitSteps_default as BitkitSteps, BitkitStepsCard_default as BitkitStepsCard, BitkitStepsDialog_default as BitkitStepsDialog, BitkitSwitch, BitkitTable, BitkitTableCard, BitkitTabs, BitkitTag, BitkitTagsInput, BitkitTextArea, BitkitTextInput, BitkitToggleButton, BitkitToggletip, BitkitTooltip, BitkitTour, BitkitTreeView, BitkitUIHeader_default as BitkitUIHeader, BitkitUISideNav_default as BitkitUISideNav, IconAbortCircle, IconAbortCircleFilled, IconAddons, IconAgent, IconAnchor, IconAndroid, IconApp, IconAppSettings, IconAppStore, IconAppStoreColor, IconApple, IconArchive, IconArchiveDelete, IconArchiveRestore, IconArrowBackAndDown, IconArrowBackAndUp, IconArrowDown, IconArrowForwardAndDown, IconArrowForwardAndUp, IconArrowLeft, IconArrowNortheast, IconArrowNorthwest, IconArrowRight, IconArrowUp, IconArrowsHorizontal, IconArrowsVertical, IconAutomation, IconAws, IconAwsColor, IconBadge3RdParty, IconBadgeBitrise, IconBadgeUpgrade, IconBadgeVersionOk, IconBazel, IconBell, IconBitbot, IconBitbotError, IconBitbotIntercomWhite, IconBitbucket, IconBitbucketColor, IconBitbucketNeutral, IconBitbucketWhite, IconBlockCircle, IconBook, IconBoxArrowDown, IconBoxDot, IconBoxLinesOverflow, IconBoxLinesWrap, IconBranch, IconBrowserstackColor, IconBug, IconBuild, IconBuildCache, IconBuildCacheFilled, IconBuildEnvSetup, IconBuildHub, IconBuildHubFilled, IconCalendar, IconChangePlan, IconChat, IconCheck, IconCheckCircle, IconCheckCircleFilled, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCi, IconCiFilled, IconCircle, IconCircleDashed, IconCircleHalfFilled, IconClaude, IconClaudeColor, IconClock, IconCode, IconCodePush, IconCodeSigning, IconCoffee, IconCommit, IconConfigure, IconConnectedAccounts, IconContainer, IconCopilot, IconCopy, IconCordova, IconCpu, IconCreditcard, IconCredits, IconCross, IconCrossCircle, IconCrossCircleFilled, IconCrown, IconCursor, IconCycle, IconDashboard, IconDashboardFilled, IconDeployment, IconDetails, IconDoc, IconDollar, IconDot, IconDotnet, IconDotnetColor, IconDotnetText, IconDotnetTextColor, IconDoubleCircle, IconDownload, IconDragHandle, IconEc2Ami, IconEnterprise, IconErrorCircle, IconErrorCircleFilled, IconExpand, IconExtraBuildCapacity, IconEye, IconEyeSlash, IconFastlane, IconFile, IconFileDoc, IconFilePdf, IconFilePlist, IconFileYml, IconFileZip, IconFilter, IconFlag, IconFlutter, IconFolder, IconFullscreen, IconFullscreenExit, IconGauge, IconGit, IconGithub, IconGitlab, IconGitlabColor, IconGitlabWhite, IconGlobe, IconGo, IconGoogleColor, IconGooglePlay, IconGooglePlayColor, IconGradle, IconGraph, IconGroup, IconHashtag, IconHeadset, IconHeart, IconHistory, IconHourglass, IconImage, IconInfoCircle, IconInfoCircleFilled, IconInsights, IconInsightsFilled, IconInstall, IconInteraction, IconInvoice, IconIonic, IconJapanese, IconJava, IconJavaColor, IconJavaDuke, IconJavaDukeColor, IconKey, IconKiroColor, IconKotlin, IconKotlinColor, IconKotlinWhite, IconLaptop, IconLaunchdarkly, IconLegacyApp, IconLightbulb, IconLink, IconLinux, IconLock, IconLockOpen, IconLogin, IconLogout, IconMacos, IconMagicWand, IconMagnifier, IconMail, IconMcp, IconMedal, IconMemory, IconMenuGrid, IconMenuHamburger, IconMessage, IconMessageAlert, IconMessageQuestion, IconMicrophone, IconMinus, IconMinusCircle, IconMinusCircleFilled, IconMobile, IconMobileLandscape, IconModeDark, IconModeLight, IconModeSystem, IconMonitorChart, IconMoreHorizontal, IconMoreVertical, IconNews, IconNextjs, IconNodejs, IconOpenInNew, IconOther, IconOutsideContributor, IconOverview, IconPause, IconPencil, IconPeople, IconPercent, IconPerson, IconPersonWithDesk, IconPin, IconPlay, IconPlus, IconPlusCircle, IconPlusCircleFilled, IconPower, IconProject, IconProjectSettings, IconPull, IconPush, IconPuzzle, IconPython, IconPythonColor, IconQuestionCircle, IconQuestionCircleFilled, IconReact, IconRefresh, IconRegex, IconRelease, IconReleaseFilled, IconRemoteAccess, IconRename, IconReplace, IconResponsiveness, IconReviewerApproved, IconReviewerAssigned, IconReviewerRejected, IconRuby, IconRubyColor, IconSave, IconSecurityShield, IconSettings, IconSettingsFilled, IconShuffle, IconSiren, IconSkip, IconSkipCircle, IconSkipCircleFilled, IconSlack, IconSlackColor, IconSparkle, IconSparkleFilled, IconSpinnerOnDisabled, IconSpinnerPurple, IconSpinnerPurpleDouble, IconSpinnerWhite, IconStability, IconStack, IconStar, IconStep, IconStop, IconStopwatch, IconTabPlus, IconTag, IconTasks, IconTeams, IconTeamsColor, IconTemplateCode, IconTerminal, IconTerminalFilled, IconTestQuarantine, IconThemeDarkToggle, IconThumbDown, IconThumbUp, IconTimeline, IconTools, IconTrash, IconTrigger, IconUbuntu, IconUbuntuColor, IconUnity3D, IconUnpin, IconUpload, IconValidateShield, IconVideo, IconVsCode, IconWarning, IconWarningYellow, IconWebUi, IconWebhooks, IconWindsurf, IconWorkflow, IconWorkflowFlow, IconXTwitter, IconXamarin, IconXcode, ResponsiveProvider, bitkitIcon, bitkitTheme as bitriseTheme, createBitkitToast, createTreeCollection, dismissBitkitToast, pageHeaderBottom, rem, uiHeaderBottom, uiHeaderHeight, uiHeaderHeightPx, uiSideNavRailWidth, useBitkitTour, useResponsive, useStepsDialog, useUISideNav, useUiHeaderBottom };
|
package/dist/theme/global-css.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { pageHeaderBottomVar, pageHeaderCollapsedHeight, stickyPageHeaderMarker } from "../components/BitkitPageHeader/pageHeaderBottom.js";
|
|
2
|
+
import { uiHeaderBottom } from "../components/BitkitUIHeader/usePublishedBottom.js";
|
|
1
3
|
import { rem } from "./themeUtils.js";
|
|
2
4
|
import { defineGlobalStyles } from "@chakra-ui/react/styled-system";
|
|
3
5
|
// lib/theme/global-css.ts
|
|
@@ -10,6 +12,10 @@ var globalCss = defineGlobalStyles({
|
|
|
10
12
|
"--focus-ring-style": "solid",
|
|
11
13
|
"--focus-ring-color": "colors.border/focus"
|
|
12
14
|
},
|
|
15
|
+
[`:root[${stickyPageHeaderMarker}]`]: {
|
|
16
|
+
[pageHeaderBottomVar]: uiHeaderBottom,
|
|
17
|
+
tablet: { [pageHeaderBottomVar]: `calc(${uiHeaderBottom} + ${pageHeaderCollapsedHeight})` }
|
|
18
|
+
},
|
|
13
19
|
body: {
|
|
14
20
|
background: "background/primary",
|
|
15
21
|
color: "text/body",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-css.js","names":[],"sources":["../../lib/theme/global-css.ts"],"sourcesContent":["import { defineGlobalStyles } from '@chakra-ui/react/styled-system';\n\nimport { rem } from './themeUtils';\n\nconst globalCss = defineGlobalStyles({\n '*': {\n '--global-font-mono': 'fonts.mono',\n '--global-font-body': 'fonts.body',\n '--focus-ring-width': rem(3),\n '--focus-ring-offset': '0',\n '--focus-ring-style': 'solid',\n '--focus-ring-color': 'colors.border/focus',\n },\n body: {\n background: 'background/primary',\n color: 'text/body',\n textStyle: 'body/lg/regular',\n },\n \"a, summary, button, input, textarea, select, [tabindex]:not([tabindex='-1'])\": {\n outline: 'none',\n focusVisibleRing: 'outside',\n },\n // Anything you can activate shows it, and nothing disabled does -- `:disabled` only covers native\n // controls, so the ARIA and Zag disabled markers are excluded too. Recipes that style a disabled\n // state (`not-allowed`) still win: they sit in a later cascade layer than these global styles.\n \"button, [role='button'], summary\": {\n '&:not(:disabled, [aria-disabled=true], [data-disabled])': {\n cursor: 'pointer',\n },\n },\n});\n\nexport default globalCss;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"global-css.js","names":[],"sources":["../../lib/theme/global-css.ts"],"sourcesContent":["import { defineGlobalStyles } from '@chakra-ui/react/styled-system';\n\nimport {\n pageHeaderBottomVar,\n pageHeaderCollapsedHeight,\n stickyPageHeaderMarker,\n} from '../components/BitkitPageHeader/pageHeaderBottom';\nimport { uiHeaderBottom } from '../components/BitkitUIHeader/usePublishedBottom';\nimport { rem } from './themeUtils';\n\nconst globalCss = defineGlobalStyles({\n '*': {\n '--global-font-mono': 'fonts.mono',\n '--global-font-body': 'fonts.body',\n '--focus-ring-width': rem(3),\n '--focus-ring-offset': '0',\n '--focus-ring-style': 'solid',\n '--focus-ring-color': 'colors.border/focus',\n },\n // A `sticky` page header's bottom edge once stuck. Below `tablet` it doesn't stick, so there it is\n // the UI header's. Defined here rather than set from JS so the breakpoint stays in CSS.\n [`:root[${stickyPageHeaderMarker}]`]: {\n [pageHeaderBottomVar]: uiHeaderBottom,\n tablet: {\n [pageHeaderBottomVar]: `calc(${uiHeaderBottom} + ${pageHeaderCollapsedHeight})`,\n },\n },\n body: {\n background: 'background/primary',\n color: 'text/body',\n textStyle: 'body/lg/regular',\n },\n \"a, summary, button, input, textarea, select, [tabindex]:not([tabindex='-1'])\": {\n outline: 'none',\n focusVisibleRing: 'outside',\n },\n // Anything you can activate shows it, and nothing disabled does -- `:disabled` only covers native\n // controls, so the ARIA and Zag disabled markers are excluded too. Recipes that style a disabled\n // state (`not-allowed`) still win: they sit in a later cascade layer than these global styles.\n \"button, [role='button'], summary\": {\n '&:not(:disabled, [aria-disabled=true], [data-disabled])': {\n cursor: 'pointer',\n },\n },\n});\n\nexport default globalCss;\n"],"mappings":";;;;;AAUA,IAAM,YAAY,mBAAmB;CACnC,KAAK;EACH,sBAAsB;EACtB,sBAAsB;EACtB,sBAAsB,IAAI,CAAC;EAC3B,uBAAuB;EACvB,sBAAsB;EACtB,sBAAsB;CACxB;EAGC,SAAS,uBAAuB,KAAK;GACnC,sBAAsB;EACvB,QAAQ,GACL,sBAAsB,QAAQ,eAAe,KAAK,0BAA0B,GAC/E;CACF;CACA,MAAM;EACJ,YAAY;EACZ,OAAO;EACP,WAAW;CACb;CACA,gFAAgF;EAC9E,SAAS;EACT,kBAAkB;CACpB;CAIA,oCAAoC,EAClC,2DAA2D,EACzD,QAAQ,UACV,EACF;AACF,CAAC"}
|
|
@@ -39,6 +39,7 @@ var breadcrumbSlotRecipe = defineSlotRecipe({
|
|
|
39
39
|
list: {
|
|
40
40
|
display: "flex",
|
|
41
41
|
alignItems: "center",
|
|
42
|
+
minHeight: "24",
|
|
42
43
|
whiteSpace: "nowrap",
|
|
43
44
|
color: "text/tertiary",
|
|
44
45
|
gap: "4"
|
|
@@ -53,7 +54,10 @@ var breadcrumbSlotRecipe = defineSlotRecipe({
|
|
|
53
54
|
textStyle: "body/md/semibold",
|
|
54
55
|
...truncateStyle
|
|
55
56
|
},
|
|
56
|
-
separator: {
|
|
57
|
+
separator: {
|
|
58
|
+
color: "icon/disabled",
|
|
59
|
+
display: "flex"
|
|
60
|
+
},
|
|
57
61
|
ellipsis: { ...linkStyle }
|
|
58
62
|
}
|
|
59
63
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/Breadcrumb.recipe.ts"],"sourcesContent":["import { breadcrumbAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe, type SystemStyleObject } from '@chakra-ui/react/styled-system';\n\nconst linkStyle: SystemStyleObject = {\n cursor: 'pointer',\n color: 'text/link',\n textStyle: 'comp/link/md',\n _hover: {\n color: 'text/link-hover',\n textStyle: 'comp/link/md-hover',\n _active: {\n color: 'text/primary',\n textStyle: 'comp/link/md-hover',\n },\n },\n _active: {\n color: 'text/primary',\n textStyle: 'comp/link/md-hover',\n },\n _focusVisible: {\n borderRadius: '2',\n background: 'background/primary',\n backgroundBlendMode: 'multiply',\n },\n _disabled: {\n color: 'text/disabled',\n outline: 'none',\n pointerEvents: 'none',\n },\n};\n\n// A crumb that outgrows the trail is cut off by whatever is above it, with nothing to say it was cut.\n// `truncate` is Chakra's own utility for the three properties v1 carried, but it is not enough on its\n// own here: an anchor is inline by default, where overflow does not clip at all, and bitkit builds its\n// system from `defaultBaseConfig`, which ships no component recipes -- so Chakra's own\n// `display: inline-flex` for this slot never arrives. Measured against the alternatives, the\n// shrink-to-fit displays (inline-block, inline-flex) size to the text and never give way; only block\n// takes the width its item was shrunk to.\nconst truncateStyle: SystemStyleObject = {\n display: 'block',\n truncate: true,\n};\n\nconst breadcrumbSlotRecipe = defineSlotRecipe({\n className: 'breadcrumb',\n slots: breadcrumbAnatomy.keys(),\n base: {\n list: {\n display: 'flex',\n alignItems: 'center',\n whiteSpace: 'nowrap',\n color: 'text/tertiary',\n gap: '4',\n },\n // A flex item refuses to shrink below its content, so without this the trail pushes its\n // container instead of truncating. Only the last crumb gives way: the ancestors above it are\n // short and stay readable, and the deepest one is the name that actually runs long.\n //\n // \"The item with no item after it\" rather than `_last`: a separator is an `<li>` of its own, and\n // the mobile trail ends with one, so the last child there is a separator and `:last-of-type`\n // picks nothing. The slot class is the only thing that tells the two apart -- Chakra emits\n // `breadcrumb__item` from this recipe's own `className`, and no `data-part`.\n item: {\n '&:not(:has(~ .breadcrumb__item))': {\n minWidth: 0,\n },\n },\n link: {\n ...linkStyle,\n ...truncateStyle,\n },\n currentLink: {\n color: 'text/body',\n textStyle: 'body/md/semibold',\n ...truncateStyle,\n },\n separator: {\n color: 'icon/disabled',\n },\n ellipsis: {\n ...linkStyle,\n },\n },\n});\n\nexport default breadcrumbSlotRecipe;\n"],"mappings":";;;AAGA,IAAM,YAA+B;CACnC,QAAQ;CACR,OAAO;CACP,WAAW;CACX,QAAQ;EACN,OAAO;EACP,WAAW;EACX,SAAS;GACP,OAAO;GACP,WAAW;EACb;CACF;CACA,SAAS;EACP,OAAO;EACP,WAAW;CACb;CACA,eAAe;EACb,cAAc;EACd,YAAY;EACZ,qBAAqB;CACvB;CACA,WAAW;EACT,OAAO;EACP,SAAS;EACT,eAAe;CACjB;AACF;AASA,IAAM,gBAAmC;CACvC,SAAS;CACT,UAAU;AACZ;AAEA,IAAM,uBAAuB,iBAAiB;CAC5C,WAAW;CACX,OAAO,kBAAkB,KAAK;CAC9B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,YAAY;
|
|
1
|
+
{"version":3,"file":"Breadcrumb.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/Breadcrumb.recipe.ts"],"sourcesContent":["import { breadcrumbAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe, type SystemStyleObject } from '@chakra-ui/react/styled-system';\n\nconst linkStyle: SystemStyleObject = {\n cursor: 'pointer',\n color: 'text/link',\n textStyle: 'comp/link/md',\n _hover: {\n color: 'text/link-hover',\n textStyle: 'comp/link/md-hover',\n _active: {\n color: 'text/primary',\n textStyle: 'comp/link/md-hover',\n },\n },\n _active: {\n color: 'text/primary',\n textStyle: 'comp/link/md-hover',\n },\n _focusVisible: {\n borderRadius: '2',\n background: 'background/primary',\n backgroundBlendMode: 'multiply',\n },\n _disabled: {\n color: 'text/disabled',\n outline: 'none',\n pointerEvents: 'none',\n },\n};\n\n// A crumb that outgrows the trail is cut off by whatever is above it, with nothing to say it was cut.\n// `truncate` is Chakra's own utility for the three properties v1 carried, but it is not enough on its\n// own here: an anchor is inline by default, where overflow does not clip at all, and bitkit builds its\n// system from `defaultBaseConfig`, which ships no component recipes -- so Chakra's own\n// `display: inline-flex` for this slot never arrives. Measured against the alternatives, the\n// shrink-to-fit displays (inline-block, inline-flex) size to the text and never give way; only block\n// takes the width its item was shrunk to.\nconst truncateStyle: SystemStyleObject = {\n display: 'block',\n truncate: true,\n};\n\nconst breadcrumbSlotRecipe = defineSlotRecipe({\n className: 'breadcrumb',\n slots: breadcrumbAnatomy.keys(),\n base: {\n list: {\n display: 'flex',\n alignItems: 'center',\n // The design's 24-high trail, so a page header's breadcrumb sits in the same place expanded and collapsed.\n minHeight: '24',\n whiteSpace: 'nowrap',\n color: 'text/tertiary',\n gap: '4',\n },\n // A flex item refuses to shrink below its content, so without this the trail pushes its\n // container instead of truncating. Only the last crumb gives way: the ancestors above it are\n // short and stay readable, and the deepest one is the name that actually runs long.\n //\n // \"The item with no item after it\" rather than `_last`: a separator is an `<li>` of its own, and\n // the mobile trail ends with one, so the last child there is a separator and `:last-of-type`\n // picks nothing. The slot class is the only thing that tells the two apart -- Chakra emits\n // `breadcrumb__item` from this recipe's own `className`, and no `data-part`.\n item: {\n '&:not(:has(~ .breadcrumb__item))': {\n minWidth: 0,\n },\n },\n link: {\n ...linkStyle,\n ...truncateStyle,\n },\n currentLink: {\n color: 'text/body',\n textStyle: 'body/md/semibold',\n ...truncateStyle,\n },\n separator: {\n color: 'icon/disabled',\n // The chevron's own box, not a text line: inline it took the page's 25.5px body line height.\n display: 'flex',\n },\n ellipsis: {\n ...linkStyle,\n },\n },\n});\n\nexport default breadcrumbSlotRecipe;\n"],"mappings":";;;AAGA,IAAM,YAA+B;CACnC,QAAQ;CACR,OAAO;CACP,WAAW;CACX,QAAQ;EACN,OAAO;EACP,WAAW;EACX,SAAS;GACP,OAAO;GACP,WAAW;EACb;CACF;CACA,SAAS;EACP,OAAO;EACP,WAAW;CACb;CACA,eAAe;EACb,cAAc;EACd,YAAY;EACZ,qBAAqB;CACvB;CACA,WAAW;EACT,OAAO;EACP,SAAS;EACT,eAAe;CACjB;AACF;AASA,IAAM,gBAAmC;CACvC,SAAS;CACT,UAAU;AACZ;AAEA,IAAM,uBAAuB,iBAAiB;CAC5C,WAAW;CACX,OAAO,kBAAkB,KAAK;CAC9B,MAAM;EACJ,MAAM;GACJ,SAAS;GACT,YAAY;GAEZ,WAAW;GACX,YAAY;GACZ,OAAO;GACP,KAAK;EACP;EASA,MAAM,EACJ,oCAAoC,EAClC,UAAU,EACZ,EACF;EACA,MAAM;GACJ,GAAG;GACH,GAAG;EACL;EACA,aAAa;GACX,OAAO;GACP,WAAW;GACX,GAAG;EACL;EACA,WAAW;GACT,OAAO;GAEP,SAAS;EACX;EACA,UAAU,EACR,GAAG,UACL;CACF;AACF,CAAC"}
|