@bitrise/bitkit-v2 0.3.536 → 0.3.538
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 +1 -0
- package/dist/components/BitkitUIHeader/BitkitUIHeader.d.ts +1 -0
- package/dist/components/BitkitUIHeader/BitkitUIHeader.js +8 -2
- package/dist/components/BitkitUIHeader/BitkitUIHeader.js.map +1 -1
- package/dist/components/BitkitUIHeader/usePublishedBottom.d.ts +17 -0
- package/dist/components/BitkitUIHeader/usePublishedBottom.js +53 -0
- package/dist/components/BitkitUIHeader/usePublishedBottom.js.map +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/main.js +2 -1
- package/dist/theme/slot-recipes/LinkCard.recipe.js +1 -0
- package/dist/theme/slot-recipes/LinkCard.recipe.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -82,6 +82,7 @@ import { BitkitProvider, BitkitButton } from '@bitrise/bitkit-v2';
|
|
|
82
82
|
|
|
83
83
|
- **Don't rebuild what Bitkit has.** Before hand-building a dialog, select, search input, list, table, tabs or empty state from Chakra primitives or HTML, look for the Bitkit component in the MCP. Raw Chakra is for layout and text (`Box`, `Stack`, `Text`) only — never Chakra's own `Button`, `Input`, `Dialog` and the like: the Bitkit theme styles them, so they look right, but they lack Bitkit's API and behaviour.
|
|
84
84
|
- **A whole page starts from the page-level components** — `BitkitPageHeader`, `BitkitPageSubheader`, `BitkitContentWrapper`, `BitkitUISideNav`, `BitkitPageFooter` — not from a hand-built frame. Before building or changing a page layout, read the `Docs/Page Layout` page: content widths, alignment, spacing and heading levels.
|
|
85
|
+
- **Clear a pinned `BitkitUIHeader` with `uiHeaderBottom`** — anything that has to start below it (a sticky row's `insetBlockStart`, a `scrollMarginTop`) uses `uiHeaderBottom`, which the header measures itself, banner and anything pushing it down included. Don't add up the header's and banners' heights by hand.
|
|
85
86
|
- **Handle every state of a data view.** Anything that shows data needs a loading state (see *Skeleton loading*), an empty state (`BitkitEmptyState`) and an error state (`BitkitAlert`, or `createBitkitToast` for a failed action).
|
|
86
87
|
- **Don't override a Bitkit component's styling** — no `border`, `borderRadius`, `background`, `boxShadow` or `color` fighting its design — and don't pass an empty or placeholder value just to satisfy a required prop. Layout props (`width`, `flex`, `margin*`, …) are fine.
|
|
87
88
|
- **When Bitkit doesn't fit, it's a design-system gap, not a styling task.** Stop and tell the user; the gap gets fixed in Bitkit, once. At Bitrise, report it in #engineering-domain-frontend.
|
|
@@ -32,6 +32,7 @@ export { type BitkitUIHeaderBadge, type BitkitUIHeaderControlAsAnchorProps, type
|
|
|
32
32
|
export { type BitkitUIHeaderMode, type BitkitUIHeaderModeSwitchProps } from './UIHeaderModeSwitch';
|
|
33
33
|
export { type BitkitUIHeaderNavButtonProps } from './UIHeaderNavButton';
|
|
34
34
|
export { type BitkitUIHeaderSearchProps } from './UIHeaderSearch';
|
|
35
|
+
export { uiHeaderBottom } from './usePublishedBottom';
|
|
35
36
|
declare const _default: import('react').ForwardRefExoticComponent<BitkitUIHeaderProps & import('react').RefAttributes<HTMLElement>> & {
|
|
36
37
|
Account: import('react').ForwardRefExoticComponent<import('./UIHeaderAccount').BitkitUIHeaderAccountProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
37
38
|
Button: import('react').ForwardRefExoticComponent<import('./UIHeaderButton').BitkitUIHeaderButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -8,6 +8,7 @@ import UIHeaderModeSwitch from "./UIHeaderModeSwitch.js";
|
|
|
8
8
|
import UIHeaderNavButton from "./UIHeaderNavButton.js";
|
|
9
9
|
import uiHeaderPart from "./uiHeaderPart.js";
|
|
10
10
|
import UIHeaderSearch from "./UIHeaderSearch.js";
|
|
11
|
+
import usePublishedBottom, { uiHeaderBottom } from "./usePublishedBottom.js";
|
|
11
12
|
import { uiHeaderHeight, uiHeaderHeightPx } from "../../theme/slot-recipes/UIHeader.recipe.js";
|
|
12
13
|
import { useSlotRecipe } from "@chakra-ui/react/styled-system";
|
|
13
14
|
import { forwardRef, useMemo, useRef } from "react";
|
|
@@ -34,6 +35,10 @@ import { Box } from "@chakra-ui/react/box";
|
|
|
34
35
|
* `uiHeaderHeightPx` where the layout needs a number rather than a token. Those are the bar's
|
|
35
36
|
* height: a header with a `banner` is taller, and a pinned one is measured rather than assumed.
|
|
36
37
|
*
|
|
38
|
+
* It measures itself for you: `uiHeaderBottom` is where the content below a pinned
|
|
39
|
+
* (`position: fixed`) header can start — its bottom edge, the banner and anything pushing it down
|
|
40
|
+
* included, or `0` when it isn't pinned. Use it for whatever has to clear the header (`insetBlockStart={uiHeaderBottom}`).
|
|
41
|
+
*
|
|
37
42
|
* The panels the controls open are the consumer's: a control takes a `selected` flag and paints
|
|
38
43
|
* itself as the open one, and nothing more. That keeps a drawer's content, placement and state
|
|
39
44
|
* where the product can see them. `ModeSwitch` is the one exception — it owns the menu it opens,
|
|
@@ -48,6 +53,7 @@ var BitkitUIHeader = forwardRef((props, ref) => {
|
|
|
48
53
|
const { banner, children, css, leading, logoHref = "/", ...rest } = props;
|
|
49
54
|
const styles = useSlotRecipe({ key: "uiHeader" })();
|
|
50
55
|
const barRef = useRef(null);
|
|
56
|
+
const rootRef = usePublishedBottom(ref);
|
|
51
57
|
const context = useMemo(() => ({
|
|
52
58
|
barRef,
|
|
53
59
|
styles
|
|
@@ -55,7 +61,7 @@ var BitkitUIHeader = forwardRef((props, ref) => {
|
|
|
55
61
|
return /* @__PURE__ */ jsx(UIHeaderContextProvider, {
|
|
56
62
|
value: context,
|
|
57
63
|
children: /* @__PURE__ */ jsx(Box, {
|
|
58
|
-
ref,
|
|
64
|
+
ref: rootRef,
|
|
59
65
|
asChild: true,
|
|
60
66
|
...rest,
|
|
61
67
|
css: [styles.root, css],
|
|
@@ -113,6 +119,6 @@ var BitkitUIHeader_default = withSubComponents(BitkitUIHeader, {
|
|
|
113
119
|
NavButton: UIHeaderNavButton,
|
|
114
120
|
Search: UIHeaderSearch
|
|
115
121
|
});
|
|
116
|
-
export { BitkitUIHeader_default as default, uiHeaderHeight, uiHeaderHeightPx };
|
|
122
|
+
export { BitkitUIHeader_default as default, uiHeaderBottom, uiHeaderHeight, uiHeaderHeightPx };
|
|
117
123
|
|
|
118
124
|
//# 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';\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 * 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\n const context = useMemo(() => ({ barRef, styles }), [styles]);\n\n return (\n <UIHeaderContextProvider value={context}>\n <Box ref={
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAgBD,eAAe,cAAc;AAE7B,IAAA,yBAAe,kBAAkB,gBAAgB;CAC/C,SAAS;CACT,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,WAAW;CACX,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ForwardedRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Where the content below a pinned (`position: fixed`) `BitkitUIHeader` can start: its bottom edge,
|
|
4
|
+
* banner and any offset pushing it down included, or `0` when it isn't pinned. Use it for whatever has
|
|
5
|
+
* to clear the header, such as a sticky row's `insetBlockStart` or a `scrollMarginTop`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const uiHeaderBottom = "var(--bitkit-ui-header-bottom, 0px)";
|
|
8
|
+
/**
|
|
9
|
+
* Publishes a fixed header's bottom edge as `--bitkit-ui-header-bottom` on the document root. It is
|
|
10
|
+
* re-measured when the header resizes (a banner appears) and on every render, since an offset that
|
|
11
|
+
* moves it, such as a `marginBlockStart`, arrives as a prop and resizes nothing. Only `fixed` counts:
|
|
12
|
+
* a `sticky` header's edge moves as the page scrolls, which this doesn't follow.
|
|
13
|
+
*
|
|
14
|
+
* A header that isn't pinned leaves the variable alone, and a header only removes the value it set.
|
|
15
|
+
*/
|
|
16
|
+
declare const usePublishedBottom: <T extends HTMLElement>(forwardedRef: ForwardedRef<T>) => import('react').RefObject<T | null>;
|
|
17
|
+
export default usePublishedBottom;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useCallback, useImperativeHandle, useLayoutEffect, useRef } from "react";
|
|
2
|
+
// lib/components/BitkitUIHeader/usePublishedBottom.ts
|
|
3
|
+
var bottomVarName = "--bitkit-ui-header-bottom";
|
|
4
|
+
/**
|
|
5
|
+
* Where the content below a pinned (`position: fixed`) `BitkitUIHeader` can start: its bottom edge,
|
|
6
|
+
* banner and any offset pushing it down included, or `0` when it isn't pinned. Use it for whatever has
|
|
7
|
+
* to clear the header, such as a sticky row's `insetBlockStart` or a `scrollMarginTop`.
|
|
8
|
+
*/
|
|
9
|
+
var uiHeaderBottom = `var(${bottomVarName}, 0px)`;
|
|
10
|
+
/**
|
|
11
|
+
* Publishes a fixed header's bottom edge as `--bitkit-ui-header-bottom` on the document root. It is
|
|
12
|
+
* re-measured when the header resizes (a banner appears) and on every render, since an offset that
|
|
13
|
+
* moves it, such as a `marginBlockStart`, arrives as a prop and resizes nothing. Only `fixed` counts:
|
|
14
|
+
* a `sticky` header's edge moves as the page scrolls, which this doesn't follow.
|
|
15
|
+
*
|
|
16
|
+
* A header that isn't pinned leaves the variable alone, and a header only removes the value it set.
|
|
17
|
+
*/
|
|
18
|
+
var usePublishedBottom = (forwardedRef) => {
|
|
19
|
+
const nodeRef = useRef(null);
|
|
20
|
+
const isPublishingRef = useRef(false);
|
|
21
|
+
useImperativeHandle(forwardedRef, () => nodeRef.current, []);
|
|
22
|
+
const unpublish = useCallback(() => {
|
|
23
|
+
if (isPublishingRef.current) {
|
|
24
|
+
document.documentElement.style.removeProperty(bottomVarName);
|
|
25
|
+
isPublishingRef.current = false;
|
|
26
|
+
}
|
|
27
|
+
}, []);
|
|
28
|
+
const publish = useCallback(() => {
|
|
29
|
+
const node = nodeRef.current;
|
|
30
|
+
if (!node) return;
|
|
31
|
+
if (window.getComputedStyle(node).position !== "fixed") {
|
|
32
|
+
unpublish();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const bottom = Math.max(node.getBoundingClientRect().bottom, 0);
|
|
36
|
+
document.documentElement.style.setProperty(bottomVarName, `${bottom}px`);
|
|
37
|
+
isPublishingRef.current = true;
|
|
38
|
+
}, [unpublish]);
|
|
39
|
+
useLayoutEffect(publish);
|
|
40
|
+
useLayoutEffect(() => {
|
|
41
|
+
const node = nodeRef.current;
|
|
42
|
+
const observer = node && typeof ResizeObserver !== "undefined" ? new ResizeObserver(publish) : void 0;
|
|
43
|
+
if (node) observer?.observe(node);
|
|
44
|
+
return () => {
|
|
45
|
+
observer?.disconnect();
|
|
46
|
+
unpublish();
|
|
47
|
+
};
|
|
48
|
+
}, [publish, unpublish]);
|
|
49
|
+
return nodeRef;
|
|
50
|
+
};
|
|
51
|
+
export { usePublishedBottom as default, uiHeaderBottom };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=usePublishedBottom.js.map
|
|
@@ -0,0 +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\nconst 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,IAAM,gBAAgB;;;;;;AAOtB,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"}
|
|
@@ -107,6 +107,6 @@ export { default as BitkitToggletip, type BitkitToggletipProps } from './BitkitT
|
|
|
107
107
|
export { default as BitkitTooltip, type BitkitTooltipProps } from './BitkitTooltip/BitkitTooltip';
|
|
108
108
|
export { default as BitkitTour, type BitkitTourInstance, type BitkitTourOptions, type BitkitTourProps, type BitkitTourSecondaryAction, type BitkitTourStep, useBitkitTour, } from './BitkitTour/BitkitTour';
|
|
109
109
|
export { default as BitkitTreeView, type BitkitTreeViewBranchProps, type BitkitTreeViewExpandedChangeDetails, type BitkitTreeViewLeafProps, type BitkitTreeViewNodeRenderProps, type BitkitTreeViewRootProps, type BitkitTreeViewSelectionChangeDetails, createTreeCollection, } from './BitkitTreeView/BitkitTreeView';
|
|
110
|
-
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, uiHeaderHeight, uiHeaderHeightPx, } from './BitkitUIHeader/BitkitUIHeader';
|
|
110
|
+
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
111
|
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';
|
|
112
112
|
export { useUISideNav } from './BitkitUISideNav/UISideNavContext';
|
package/dist/main.js
CHANGED
|
@@ -397,6 +397,7 @@ import createBitkitToast, { dismissBitkitToast } from "./components/BitkitToast/
|
|
|
397
397
|
import BitkitToggleButton from "./components/BitkitToggleButton/BitkitToggleButton.js";
|
|
398
398
|
import BitkitTour, { useBitkitTour } from "./components/BitkitTour/BitkitTour.js";
|
|
399
399
|
import BitkitTreeView, { createTreeCollection } from "./components/BitkitTreeView/BitkitTreeView.js";
|
|
400
|
+
import { uiHeaderBottom } from "./components/BitkitUIHeader/usePublishedBottom.js";
|
|
400
401
|
import { uiHeaderHeight, uiHeaderHeightPx } from "./theme/slot-recipes/UIHeader.recipe.js";
|
|
401
402
|
import BitkitUIHeader_default from "./components/BitkitUIHeader/BitkitUIHeader.js";
|
|
402
403
|
import { useUISideNav } from "./components/BitkitUISideNav/UISideNavContext.js";
|
|
@@ -404,4 +405,4 @@ import { uiSideNavRailWidth } from "./theme/slot-recipes/UISideNav.recipe.js";
|
|
|
404
405
|
import BitkitUISideNav_default from "./components/BitkitUISideNav/BitkitUISideNav.js";
|
|
405
406
|
import Provider from "./providers/BitkitProvider.js";
|
|
406
407
|
import bitkitTheme from "./theme/index.js";
|
|
407
|
-
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, 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, uiHeaderHeight, uiHeaderHeightPx, uiSideNavRailWidth, useBitkitTour, useResponsive, useStepsDialog, useUISideNav };
|
|
408
|
+
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, 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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkCard.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/LinkCard.recipe.ts"],"sourcesContent":["import { cardAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\n// BitkitLinkCard is a `Card` (elevation off, `sm` padding below tablet and `lg` from tablet up):\n// background, border, body padding and the footer's divider come from the card recipe. This recipe\n// only adds what the link card does differently: a larger radius, an inset divider, the hover state\n// and its own content.\n//\n// The whole card is one link, so hover and keyboard focus read the same: the root reacts with\n// `_hover` / `_focusVisible`, and its parts follow through the `group` class on the root.\n//\n// `variant` is a layout variant: the icon and product cards differ in their visual and, from tablet\n// up, in the size of the body text.\nconst linkCardAnatomy = cardAnatomy.extendWith('iconTile', 'textBlock', 'actionLabel', 'actionIcon');\n\nconst rootActive = {\n borderColor: 'border/hover',\n boxShadow: 'elevation/md',\n};\n\nconst textActive = { color: 'text/link-hover' };\n\nconst iconTileActive = {\n backgroundColor: 'background/selected-hover',\n color: 'icon/interactive',\n};\n\nconst linkCardSlotRecipe = defineSlotRecipe({\n className: 'link-card',\n slots: linkCardAnatomy.keys(),\n base: {\n root: {\n borderRadius: '12',\n color: 'text/primary',\n display: 'flex',\n flexDirection: 'column',\n maxWidth: 'layout/maxWidth/480',\n overflow: 'clip',\n textDecoration: 'none',\n _hover: rootActive,\n _focusVisible: rootActive,\n },\n body: {\n display: 'flex',\n flex: '1',\n flexDirection: 'column',\n gap: { base: '12', tablet: '16' },\n minHeight: 0,\n // The design keeps the content 24px off the trailing edge at every size, also where the card's\n // padding is 16. Responsive for the same reason as the footer's padding.\n paddingInlineEnd: { base: '24', tablet: '24' },\n },\n iconTile: {\n alignItems: 'center',\n alignSelf: 'flex-start',\n backgroundColor: 'background/tertiary',\n borderRadius: { base: '8', tablet: '10' },\n color: 'icon/secondary',\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n padding: '8',\n '& > svg': {\n boxSize: { base: '24', tablet: '32' },\n },\n _groupHover: iconTileActive,\n _groupFocusVisible: iconTileActive,\n },\n textBlock: {\n display: 'flex',\n flexDirection: 'column',\n gap: '6',\n overflowWrap: 'anywhere',\n },\n title: {\n color: 'text/primary',\n textStyle: 'body/xl/semibold',\n _groupHover: textActive,\n _groupFocusVisible: textActive,\n },\n description: {\n color: 'text/secondary',\n textStyle: 'body/lg/regular',\n },\n // The card's footer runs its divider edge to edge; the design insets it to the body's padding.\n // The padding is responsive on purpose: the card's own footer padding comes from a responsive\n // `paddingSize`, so a plain value here would lose to its breakpoint rule from tablet up.\n footer: {\n alignItems: 'center',\n display: 'flex',\n gap: '4',\n marginInline: { base: '16', tablet: '24' },\n paddingBlock: { base: '16', tablet: '24' },\n paddingInlineEnd: { base: '8', tablet: '8' },\n paddingInlineStart: { base: '0', tablet: '0' },\n },\n actionLabel: {\n color: 'text/link',\n flex: '1',\n minWidth: 0,\n textStyle: 'body/lg/regular',\n _groupHover: textActive,\n _groupFocusVisible: textActive,\n },\n actionIcon: {\n color: 'icon/interactive',\n flexShrink: 0,\n opacity: 0,\n _groupHover: { opacity: 1 },\n _groupFocusVisible: { opacity: 1 },\n },\n },\n variants: {\n variant: {\n icon: {},\n // The visual is a BitkitProductThumbnail, which brings its own size, radius and background.\n product: {\n description: {\n textStyle: { base: 'body/lg/regular', tablet: 'body/md/regular' },\n },\n },\n },\n },\n defaultVariants: {\n variant: 'icon',\n },\n});\n\nexport default linkCardSlotRecipe;\n"],"mappings":";;;AAaA,IAAM,kBAAkB,YAAY,WAAW,YAAY,aAAa,eAAe,YAAY;AAEnG,IAAM,aAAa;CACjB,aAAa;CACb,WAAW;AACb;AAEA,IAAM,aAAa,EAAE,OAAO,kBAAkB;AAE9C,IAAM,iBAAiB;CACrB,iBAAiB;CACjB,OAAO;AACT;AAEA,IAAM,qBAAqB,iBAAiB;CAC1C,WAAW;CACX,OAAO,gBAAgB,KAAK;CAC5B,MAAM;EACJ,MAAM;GACJ,cAAc;GACd,OAAO;GACP,SAAS;GACT,eAAe;GACf,UAAU;GACV,UAAU;GACV,gBAAgB;GAChB,QAAQ;GACR,eAAe;EACjB;EACA,MAAM;GACJ,SAAS;GACT,MAAM;GACN,eAAe;GACf,KAAK;IAAE,MAAM;IAAM,QAAQ;GAAK;GAChC,WAAW;GAGX,kBAAkB;IAAE,MAAM;IAAM,QAAQ;GAAK;EAC/C;EACA,UAAU;GACR,YAAY;GACZ,WAAW;GACX,iBAAiB;GACjB,cAAc;IAAE,MAAM;IAAK,QAAQ;GAAK;GACxC,OAAO;GACP,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,SAAS;GACT,WAAW,EACT,SAAS;IAAE,MAAM;IAAM,QAAQ;GAAK,EACtC;GACA,aAAa;GACb,oBAAoB;EACtB;EACA,WAAW;GACT,SAAS;GACT,eAAe;GACf,KAAK;GACL,cAAc;EAChB;EACA,OAAO;GACL,OAAO;GACP,WAAW;
|
|
1
|
+
{"version":3,"file":"LinkCard.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/LinkCard.recipe.ts"],"sourcesContent":["import { cardAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\n// BitkitLinkCard is a `Card` (elevation off, `sm` padding below tablet and `lg` from tablet up):\n// background, border, body padding and the footer's divider come from the card recipe. This recipe\n// only adds what the link card does differently: a larger radius, an inset divider, the hover state\n// and its own content.\n//\n// The whole card is one link, so hover and keyboard focus read the same: the root reacts with\n// `_hover` / `_focusVisible`, and its parts follow through the `group` class on the root.\n//\n// `variant` is a layout variant: the icon and product cards differ in their visual and, from tablet\n// up, in the size of the body text.\nconst linkCardAnatomy = cardAnatomy.extendWith('iconTile', 'textBlock', 'actionLabel', 'actionIcon');\n\nconst rootActive = {\n borderColor: 'border/hover',\n boxShadow: 'elevation/md',\n};\n\nconst textActive = { color: 'text/link-hover' };\n\nconst iconTileActive = {\n backgroundColor: 'background/selected-hover',\n color: 'icon/interactive',\n};\n\nconst linkCardSlotRecipe = defineSlotRecipe({\n className: 'link-card',\n slots: linkCardAnatomy.keys(),\n base: {\n root: {\n borderRadius: '12',\n color: 'text/primary',\n display: 'flex',\n flexDirection: 'column',\n maxWidth: 'layout/maxWidth/480',\n overflow: 'clip',\n textDecoration: 'none',\n _hover: rootActive,\n _focusVisible: rootActive,\n },\n body: {\n display: 'flex',\n flex: '1',\n flexDirection: 'column',\n gap: { base: '12', tablet: '16' },\n minHeight: 0,\n // The design keeps the content 24px off the trailing edge at every size, also where the card's\n // padding is 16. Responsive for the same reason as the footer's padding.\n paddingInlineEnd: { base: '24', tablet: '24' },\n },\n iconTile: {\n alignItems: 'center',\n alignSelf: 'flex-start',\n backgroundColor: 'background/tertiary',\n borderRadius: { base: '8', tablet: '10' },\n color: 'icon/secondary',\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n padding: '8',\n '& > svg': {\n boxSize: { base: '24', tablet: '32' },\n },\n _groupHover: iconTileActive,\n _groupFocusVisible: iconTileActive,\n },\n textBlock: {\n display: 'flex',\n flexDirection: 'column',\n gap: '6',\n overflowWrap: 'anywhere',\n },\n title: {\n color: 'text/primary',\n textStyle: 'body/xl/semibold',\n // Keeps the last line from being a lone word, without evening out the other lines.\n textWrap: 'pretty',\n _groupHover: textActive,\n _groupFocusVisible: textActive,\n },\n description: {\n color: 'text/secondary',\n textStyle: 'body/lg/regular',\n },\n // The card's footer runs its divider edge to edge; the design insets it to the body's padding.\n // The padding is responsive on purpose: the card's own footer padding comes from a responsive\n // `paddingSize`, so a plain value here would lose to its breakpoint rule from tablet up.\n footer: {\n alignItems: 'center',\n display: 'flex',\n gap: '4',\n marginInline: { base: '16', tablet: '24' },\n paddingBlock: { base: '16', tablet: '24' },\n paddingInlineEnd: { base: '8', tablet: '8' },\n paddingInlineStart: { base: '0', tablet: '0' },\n },\n actionLabel: {\n color: 'text/link',\n flex: '1',\n minWidth: 0,\n textStyle: 'body/lg/regular',\n _groupHover: textActive,\n _groupFocusVisible: textActive,\n },\n actionIcon: {\n color: 'icon/interactive',\n flexShrink: 0,\n opacity: 0,\n _groupHover: { opacity: 1 },\n _groupFocusVisible: { opacity: 1 },\n },\n },\n variants: {\n variant: {\n icon: {},\n // The visual is a BitkitProductThumbnail, which brings its own size, radius and background.\n product: {\n description: {\n textStyle: { base: 'body/lg/regular', tablet: 'body/md/regular' },\n },\n },\n },\n },\n defaultVariants: {\n variant: 'icon',\n },\n});\n\nexport default linkCardSlotRecipe;\n"],"mappings":";;;AAaA,IAAM,kBAAkB,YAAY,WAAW,YAAY,aAAa,eAAe,YAAY;AAEnG,IAAM,aAAa;CACjB,aAAa;CACb,WAAW;AACb;AAEA,IAAM,aAAa,EAAE,OAAO,kBAAkB;AAE9C,IAAM,iBAAiB;CACrB,iBAAiB;CACjB,OAAO;AACT;AAEA,IAAM,qBAAqB,iBAAiB;CAC1C,WAAW;CACX,OAAO,gBAAgB,KAAK;CAC5B,MAAM;EACJ,MAAM;GACJ,cAAc;GACd,OAAO;GACP,SAAS;GACT,eAAe;GACf,UAAU;GACV,UAAU;GACV,gBAAgB;GAChB,QAAQ;GACR,eAAe;EACjB;EACA,MAAM;GACJ,SAAS;GACT,MAAM;GACN,eAAe;GACf,KAAK;IAAE,MAAM;IAAM,QAAQ;GAAK;GAChC,WAAW;GAGX,kBAAkB;IAAE,MAAM;IAAM,QAAQ;GAAK;EAC/C;EACA,UAAU;GACR,YAAY;GACZ,WAAW;GACX,iBAAiB;GACjB,cAAc;IAAE,MAAM;IAAK,QAAQ;GAAK;GACxC,OAAO;GACP,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,SAAS;GACT,WAAW,EACT,SAAS;IAAE,MAAM;IAAM,QAAQ;GAAK,EACtC;GACA,aAAa;GACb,oBAAoB;EACtB;EACA,WAAW;GACT,SAAS;GACT,eAAe;GACf,KAAK;GACL,cAAc;EAChB;EACA,OAAO;GACL,OAAO;GACP,WAAW;GAEX,UAAU;GACV,aAAa;GACb,oBAAoB;EACtB;EACA,aAAa;GACX,OAAO;GACP,WAAW;EACb;EAIA,QAAQ;GACN,YAAY;GACZ,SAAS;GACT,KAAK;GACL,cAAc;IAAE,MAAM;IAAM,QAAQ;GAAK;GACzC,cAAc;IAAE,MAAM;IAAM,QAAQ;GAAK;GACzC,kBAAkB;IAAE,MAAM;IAAK,QAAQ;GAAI;GAC3C,oBAAoB;IAAE,MAAM;IAAK,QAAQ;GAAI;EAC/C;EACA,aAAa;GACX,OAAO;GACP,MAAM;GACN,UAAU;GACV,WAAW;GACX,aAAa;GACb,oBAAoB;EACtB;EACA,YAAY;GACV,OAAO;GACP,YAAY;GACZ,SAAS;GACT,aAAa,EAAE,SAAS,EAAE;GAC1B,oBAAoB,EAAE,SAAS,EAAE;EACnC;CACF;CACA,UAAU,EACR,SAAS;EACP,MAAM,CAAC;EAEP,SAAS,EACP,aAAa,EACX,WAAW;GAAE,MAAM;GAAmB,QAAQ;EAAkB,EAClE,EACF;CACF,EACF;CACA,iBAAiB,EACf,SAAS,OACX;AACF,CAAC"}
|