@bitrise/bitkit-v2 0.3.473 → 0.3.475-beta.3009

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/components/BitkitUIHeader/BitkitUIHeader.d.ts +37 -0
  2. package/dist/components/BitkitUIHeader/BitkitUIHeader.js +100 -0
  3. package/dist/components/BitkitUIHeader/BitkitUIHeader.js.map +1 -0
  4. package/dist/components/BitkitUIHeader/BitriseLogo.d.ts +10 -0
  5. package/dist/components/BitkitUIHeader/BitriseLogo.js +86 -0
  6. package/dist/components/BitkitUIHeader/BitriseLogo.js.map +1 -0
  7. package/dist/components/BitkitUIHeader/UIHeaderAccount.d.ts +19 -0
  8. package/dist/components/BitkitUIHeader/UIHeaderAccount.js +38 -0
  9. package/dist/components/BitkitUIHeader/UIHeaderAccount.js.map +1 -0
  10. package/dist/components/BitkitUIHeader/UIHeaderButton.d.ts +33 -0
  11. package/dist/components/BitkitUIHeader/UIHeaderButton.js +41 -0
  12. package/dist/components/BitkitUIHeader/UIHeaderButton.js.map +1 -0
  13. package/dist/components/BitkitUIHeader/UIHeaderContext.d.ts +12 -0
  14. package/dist/components/BitkitUIHeader/UIHeaderContext.js +11 -0
  15. package/dist/components/BitkitUIHeader/UIHeaderContext.js.map +1 -0
  16. package/dist/components/BitkitUIHeader/UIHeaderControl.d.ts +64 -0
  17. package/dist/components/BitkitUIHeader/UIHeaderControl.js +66 -0
  18. package/dist/components/BitkitUIHeader/UIHeaderControl.js.map +1 -0
  19. package/dist/components/BitkitUIHeader/UIHeaderNavButton.d.ts +20 -0
  20. package/dist/components/BitkitUIHeader/UIHeaderNavButton.js +47 -0
  21. package/dist/components/BitkitUIHeader/UIHeaderNavButton.js.map +1 -0
  22. package/dist/components/BitkitUIHeader/UIHeaderSearch.d.ts +32 -0
  23. package/dist/components/BitkitUIHeader/UIHeaderSearch.js +96 -0
  24. package/dist/components/BitkitUIHeader/UIHeaderSearch.js.map +1 -0
  25. package/dist/components/index.d.ts +1 -0
  26. package/dist/main.js +3 -1
  27. package/dist/theme/recipes/UIHeaderButton.recipe.js +111 -0
  28. package/dist/theme/recipes/UIHeaderButton.recipe.js.map +1 -0
  29. package/dist/theme/recipes/index.js +3 -1
  30. package/dist/theme/recipes/index.js.map +1 -1
  31. package/dist/theme/slot-recipes/Drawer.recipe.d.ts +2 -1
  32. package/dist/theme/slot-recipes/Drawer.recipe.js +2 -1
  33. package/dist/theme/slot-recipes/Drawer.recipe.js.map +1 -1
  34. package/dist/theme/slot-recipes/UIHeader.recipe.d.ts +11 -0
  35. package/dist/theme/slot-recipes/UIHeader.recipe.js +237 -0
  36. package/dist/theme/slot-recipes/UIHeader.recipe.js.map +1 -0
  37. package/dist/theme/slot-recipes/index.d.ts +3 -1
  38. package/dist/theme/slot-recipes/index.js +2 -0
  39. package/dist/theme/slot-recipes/index.js.map +1 -1
  40. package/package.json +1 -1
  41. package/dist/theme/recipes/index.d.ts +0 -525
@@ -0,0 +1,47 @@
1
+ import IconMenuHamburger from "../../icons/IconMenuHamburger.js";
2
+ import BitkitAvatar from "../BitkitAvatar/BitkitAvatar.js";
3
+ import { useUIHeaderContext } from "./UIHeaderContext.js";
4
+ import { UIHeaderControlBase } from "./UIHeaderControl.js";
5
+ import { Box } from "@chakra-ui/react/box";
6
+ import { forwardRef } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region lib/components/BitkitUIHeader/UIHeaderNavButton.tsx
9
+ /**
10
+ * Opens `BitkitUISideNav` on mobile, where the navigation is a drawer rather than a rail. It sits
11
+ * in the header's `leading` slot, which is hidden from the `tablet` breakpoint up.
12
+ *
13
+ * The two components do not know about each other: this button's `onClick` sets the navigation's
14
+ * `open`, and the navigation asks to close through its own `onOpenChange`.
15
+ *
16
+ * It shows the current workspace, so switching workspaces is one tap away from anywhere.
17
+ */
18
+ var UIHeaderNavButton = forwardRef((props, ref) => {
19
+ const { label = "Open navigation", name, src, ...rest } = props;
20
+ const { styles } = useUIHeaderContext();
21
+ const avatarProps = src ? {
22
+ src,
23
+ variant: "image"
24
+ } : { variant: "letters" };
25
+ return /* @__PURE__ */ jsxs(UIHeaderControlBase, {
26
+ ref,
27
+ footprint: "navButton",
28
+ label,
29
+ ...rest,
30
+ children: [/* @__PURE__ */ jsx(BitkitAvatar, {
31
+ name,
32
+ size: "32",
33
+ ...avatarProps
34
+ }), /* @__PURE__ */ jsx(Box, {
35
+ css: styles.navButtonBadge,
36
+ children: /* @__PURE__ */ jsx(IconMenuHamburger, {
37
+ css: styles.navButtonIcon,
38
+ size: "16"
39
+ })
40
+ })]
41
+ });
42
+ });
43
+ UIHeaderNavButton.displayName = "BitkitUIHeader.NavButton";
44
+ //#endregion
45
+ export { UIHeaderNavButton as default };
46
+
47
+ //# sourceMappingURL=UIHeaderNavButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UIHeaderNavButton.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/UIHeaderNavButton.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { type HTMLChakraProps } from '@chakra-ui/react/styled-system';\nimport { forwardRef } from 'react';\n\nimport { IconMenuHamburger } from '../../icons';\nimport BitkitAvatar from '../BitkitAvatar/BitkitAvatar';\nimport { useUIHeaderContext } from './UIHeaderContext';\nimport { UIHeaderControlBase } from './UIHeaderControl';\n\nexport interface BitkitUIHeaderNavButtonProps extends Omit<HTMLChakraProps<'button'>, 'children'> {\n /** The accessible name. */\n label?: string;\n /** The current workspace. Shown as the avatar's initials when it has no logo. */\n name: string;\n /** The workspace's logo. Without one the avatar falls back to its initials. */\n src?: string;\n}\n\n/**\n * Opens `BitkitUISideNav` on mobile, where the navigation is a drawer rather than a rail. It sits\n * in the header's `leading` slot, which is hidden from the `tablet` breakpoint up.\n *\n * The two components do not know about each other: this button's `onClick` sets the navigation's\n * `open`, and the navigation asks to close through its own `onOpenChange`.\n *\n * It shows the current workspace, so switching workspaces is one tap away from anywhere.\n */\nconst UIHeaderNavButton = forwardRef<HTMLButtonElement, BitkitUIHeaderNavButtonProps>((props, ref) => {\n const { label = 'Open navigation', name, src, ...rest } = props;\n\n const { styles } = useUIHeaderContext();\n\n const avatarProps = src ? ({ src, variant: 'image' } as const) : ({ variant: 'letters' } as const);\n\n return (\n <UIHeaderControlBase ref={ref} footprint=\"navButton\" label={label} {...rest}>\n <BitkitAvatar name={name} size=\"32\" {...avatarProps} />\n <Box css={styles.navButtonBadge}>\n <IconMenuHamburger css={styles.navButtonIcon} size=\"16\" />\n </Box>\n </UIHeaderControlBase>\n );\n});\n\nUIHeaderNavButton.displayName = 'BitkitUIHeader.NavButton';\n\nexport default UIHeaderNavButton;\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,IAAM,oBAAoB,YAA6D,OAAO,QAAQ;CACpG,MAAM,EAAE,QAAQ,mBAAmB,MAAM,KAAK,GAAG,SAAS;CAE1D,MAAM,EAAE,WAAW,mBAAmB;CAEtC,MAAM,cAAc,MAAO;EAAE;EAAK,SAAS;CAAQ,IAAe,EAAE,SAAS,UAAU;CAEvF,OACE,qBAAC,qBAAD;EAA0B;EAAK,WAAU;EAAmB;EAAO,GAAI;EAAvE,UAAA,CACE,oBAAC,cAAD;GAAoB;GAAM,MAAK;GAAK,GAAI;EAAc,CAAA,GACtD,oBAAC,KAAD;GAAK,KAAK,OAAO;GACf,UAAA,oBAAC,mBAAD;IAAmB,KAAK,OAAO;IAAe,MAAK;GAAM,CAAA;EACtD,CAAA,CACc;;AAEzB,CAAC;AAED,kBAAkB,cAAc"}
@@ -0,0 +1,32 @@
1
+ import { BoxProps } from '@chakra-ui/react/box';
2
+ import { Ref } from 'react';
3
+ export interface BitkitUIHeaderSearchProps extends Omit<BoxProps, 'children' | 'onChange'> {
4
+ /**
5
+ * The search field, for anchoring the results to it. The component owns no results list: what a
6
+ * search turns up differs per product, so the consumer renders its own panel against this.
7
+ */
8
+ inputRef?: Ref<HTMLInputElement>;
9
+ /** The accessible name of both the button and the field. */
10
+ label?: string;
11
+ /**
12
+ * Called when the button is pressed, and when Escape closes the field.
13
+ *
14
+ * From `tablet` up this opens the field in place. Below it there is no inline field — the button
15
+ * is a plain trigger, and what it opens is the consumer's to render.
16
+ */
17
+ onOpenChange?: (open: boolean) => void;
18
+ onValueChange?: (value: string) => void;
19
+ open?: boolean;
20
+ placeholder?: string;
21
+ /** Marks the button as the one whose panel is open. Meant for the mobile trigger. */
22
+ selected?: boolean;
23
+ value?: string;
24
+ }
25
+ /**
26
+ * Search in the header bar: a button that opens a field lying over it, so opening the search moves
27
+ * nothing else in the bar.
28
+ *
29
+ * It is controlled. Hold `open` and `value` yourself, and render the results against `inputRef`.
30
+ */
31
+ declare const UIHeaderSearch: import('react').ForwardRefExoticComponent<BitkitUIHeaderSearchProps & import('react').RefAttributes<HTMLDivElement>>;
32
+ export default UIHeaderSearch;
@@ -0,0 +1,96 @@
1
+ import IconMagnifier from "../../icons/IconMagnifier.js";
2
+ import BitkitCloseButton from "../BitkitCloseButton/BitkitCloseButton.js";
3
+ import { useUIHeaderContext } from "./UIHeaderContext.js";
4
+ import { UIHeaderControlBase } from "./UIHeaderControl.js";
5
+ import { Box } from "@chakra-ui/react/box";
6
+ import { chakra } from "@chakra-ui/react/styled-system";
7
+ import { forwardRef, useEffect, useMemo, useRef } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { mergeRefs } from "@chakra-ui/react";
10
+ //#region lib/components/BitkitUIHeader/UIHeaderSearch.tsx
11
+ /**
12
+ * Search in the header bar: a button that opens a field lying over it, so opening the search moves
13
+ * nothing else in the bar.
14
+ *
15
+ * It is controlled. Hold `open` and `value` yourself, and render the results against `inputRef`.
16
+ */
17
+ var UIHeaderSearch = forwardRef((props, ref) => {
18
+ const { css, inputRef, label = "Search", onOpenChange, onValueChange, open = false, placeholder, selected, value = "", ...rest } = props;
19
+ const { rootRef, styles } = useUIHeaderContext();
20
+ const buttonElementRef = useRef(null);
21
+ const inputElementRef = useRef(null);
22
+ const searchElementRef = useRef(null);
23
+ const setInputRef = useMemo(() => mergeRefs(inputElementRef, inputRef), [inputRef]);
24
+ const setSearchRef = useMemo(() => mergeRefs(searchElementRef, ref), [ref]);
25
+ useEffect(() => {
26
+ if (open) inputElementRef.current?.focus();
27
+ }, [open]);
28
+ useEffect(() => {
29
+ if (!open) return void 0;
30
+ const dismiss = (event) => {
31
+ const target = event.target instanceof Node ? event.target : null;
32
+ if (!target || !rootRef.current?.contains(target)) return;
33
+ if (searchElementRef.current?.contains(target)) return;
34
+ onOpenChange?.(false);
35
+ };
36
+ document.addEventListener("pointerdown", dismiss);
37
+ return () => document.removeEventListener("pointerdown", dismiss);
38
+ }, [
39
+ onOpenChange,
40
+ open,
41
+ rootRef
42
+ ]);
43
+ const handleKeyDown = (event) => {
44
+ if (event.key !== "Escape") return;
45
+ event.stopPropagation();
46
+ buttonElementRef.current?.focus();
47
+ onOpenChange?.(false);
48
+ };
49
+ const handleClear = () => {
50
+ onValueChange?.("");
51
+ inputElementRef.current?.focus();
52
+ };
53
+ return /* @__PURE__ */ jsxs(Box, {
54
+ ref: setSearchRef,
55
+ css: [styles.search, css],
56
+ ...rest,
57
+ children: [/* @__PURE__ */ jsx(UIHeaderControlBase, {
58
+ ref: buttonElementRef,
59
+ css: styles.searchButton,
60
+ "data-open": open ? "" : void 0,
61
+ footprint: "control",
62
+ label,
63
+ onClick: () => onOpenChange?.(!open),
64
+ selected,
65
+ children: /* @__PURE__ */ jsx(IconMagnifier, {})
66
+ }), /* @__PURE__ */ jsxs(Box, {
67
+ css: styles.searchField,
68
+ "data-open": open ? "" : void 0,
69
+ children: [
70
+ /* @__PURE__ */ jsx(IconMagnifier, { css: styles.searchIcon }),
71
+ /* @__PURE__ */ jsx(chakra.input, {
72
+ ref: setInputRef,
73
+ "aria-label": label,
74
+ css: styles.searchInput,
75
+ onChange: (event) => onValueChange?.(event.target.value),
76
+ onKeyDown: handleKeyDown,
77
+ placeholder,
78
+ tabIndex: open ? void 0 : -1,
79
+ type: "search",
80
+ value
81
+ }),
82
+ !!value && /* @__PURE__ */ jsx(BitkitCloseButton, {
83
+ "aria-label": "Clear search",
84
+ colorVariant: "white",
85
+ onClick: handleClear,
86
+ size: "md"
87
+ })
88
+ ]
89
+ })]
90
+ });
91
+ });
92
+ UIHeaderSearch.displayName = "BitkitUIHeader.Search";
93
+ //#endregion
94
+ export { UIHeaderSearch as default };
95
+
96
+ //# sourceMappingURL=UIHeaderSearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UIHeaderSearch.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/UIHeaderSearch.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { mergeRefs } from '@chakra-ui/react';\nimport { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { forwardRef, type KeyboardEvent, type Ref, useEffect, useMemo, useRef } from 'react';\n\nimport { IconMagnifier } from '../../icons';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\nimport { useUIHeaderContext } from './UIHeaderContext';\nimport { UIHeaderControlBase } from './UIHeaderControl';\n\nexport interface BitkitUIHeaderSearchProps extends Omit<BoxProps, 'children' | 'onChange'> {\n /**\n * The search field, for anchoring the results to it. The component owns no results list: what a\n * search turns up differs per product, so the consumer renders its own panel against this.\n */\n inputRef?: Ref<HTMLInputElement>;\n /** The accessible name of both the button and the field. */\n label?: string;\n /**\n * Called when the button is pressed, and when Escape closes the field.\n *\n * From `tablet` up this opens the field in place. Below it there is no inline field — the button\n * is a plain trigger, and what it opens is the consumer's to render.\n */\n onOpenChange?: (open: boolean) => void;\n onValueChange?: (value: string) => void;\n open?: boolean;\n placeholder?: string;\n /** Marks the button as the one whose panel is open. Meant for the mobile trigger. */\n selected?: boolean;\n value?: string;\n}\n\n/**\n * Search in the header bar: a button that opens a field lying over it, so opening the search moves\n * nothing else in the bar.\n *\n * It is controlled. Hold `open` and `value` yourself, and render the results against `inputRef`.\n */\nconst UIHeaderSearch = forwardRef<HTMLDivElement, BitkitUIHeaderSearchProps>((props, ref) => {\n const {\n css,\n inputRef,\n label = 'Search',\n onOpenChange,\n onValueChange,\n open = false,\n placeholder,\n selected,\n value = '',\n ...rest\n } = props;\n\n const { rootRef, styles } = useUIHeaderContext();\n\n const buttonElementRef = useRef<HTMLButtonElement>(null);\n const inputElementRef = useRef<HTMLInputElement>(null);\n const searchElementRef = useRef<HTMLDivElement>(null);\n const setInputRef = useMemo(() => mergeRefs(inputElementRef, inputRef), [inputRef]);\n const setSearchRef = useMemo(() => mergeRefs(searchElementRef, ref), [ref]);\n\n useEffect(() => {\n if (open) inputElementRef.current?.focus();\n }, [open]);\n\n // Reaching for another control in the bar is as much a way out of the search as Escape, so the\n // open field gives way to it. Only presses inside the header count: a results panel is rendered\n // by the consumer, somewhere else entirely, and choosing from it must not close the search.\n useEffect(() => {\n if (!open) return undefined;\n\n const dismiss = (event: PointerEvent) => {\n const target = event.target instanceof Node ? event.target : null;\n if (!target || !rootRef.current?.contains(target)) return;\n if (searchElementRef.current?.contains(target)) return;\n onOpenChange?.(false);\n };\n\n document.addEventListener('pointerdown', dismiss);\n return () => document.removeEventListener('pointerdown', dismiss);\n }, [onOpenChange, open, rootRef]);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Escape') return;\n event.stopPropagation();\n // Escape leaves the field without going anywhere else, so focus belongs back on the button that\n // opened it. A press on another control moves focus by itself and takes no help.\n buttonElementRef.current?.focus();\n onOpenChange?.(false);\n };\n\n const handleClear = () => {\n onValueChange?.('');\n inputElementRef.current?.focus();\n };\n\n return (\n <Box ref={setSearchRef} css={[styles.search, css]} {...rest}>\n <UIHeaderControlBase\n ref={buttonElementRef}\n css={styles.searchButton}\n data-open={open ? '' : undefined}\n footprint=\"control\"\n label={label}\n onClick={() => onOpenChange?.(!open)}\n selected={selected}\n >\n <IconMagnifier />\n </UIHeaderControlBase>\n <Box css={styles.searchField} data-open={open ? '' : undefined}>\n <IconMagnifier css={styles.searchIcon} />\n {/* No named primitive fits: Chakra's `Input` carries its own recipe, and this field is\n styled entirely by the header's own slot. */}\n <chakra.input\n ref={setInputRef}\n aria-label={label}\n css={styles.searchInput}\n onChange={(event) => onValueChange?.(event.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n // A closed field is invisible but still in the DOM, so keep it out of the tab order.\n tabIndex={open ? undefined : -1}\n type=\"search\"\n value={value}\n />\n {!!value && (\n <BitkitCloseButton aria-label=\"Clear search\" colorVariant=\"white\" onClick={handleClear} size=\"md\" />\n )}\n </Box>\n </Box>\n );\n});\n\nUIHeaderSearch.displayName = 'BitkitUIHeader.Search';\n\nexport default UIHeaderSearch;\n"],"mappings":";;;;;;;;;;;;;;;;AAwCA,IAAM,iBAAiB,YAAuD,OAAO,QAAQ;CAC3F,MAAM,EACJ,KACA,UACA,QAAQ,UACR,cACA,eACA,OAAO,OACP,aACA,UACA,QAAQ,IACR,GAAG,SACD;CAEJ,MAAM,EAAE,SAAS,WAAW,mBAAmB;CAE/C,MAAM,mBAAmB,OAA0B,IAAI;CACvD,MAAM,kBAAkB,OAAyB,IAAI;CACrD,MAAM,mBAAmB,OAAuB,IAAI;CACpD,MAAM,cAAc,cAAc,UAAU,iBAAiB,QAAQ,GAAG,CAAC,QAAQ,CAAC;CAClF,MAAM,eAAe,cAAc,UAAU,kBAAkB,GAAG,GAAG,CAAC,GAAG,CAAC;CAE1E,gBAAgB;EACd,IAAI,MAAM,gBAAgB,SAAS,MAAM;CAC3C,GAAG,CAAC,IAAI,CAAC;CAKT,gBAAgB;EACd,IAAI,CAAC,MAAM,OAAO,KAAA;EAElB,MAAM,WAAW,UAAwB;GACvC,MAAM,SAAS,MAAM,kBAAkB,OAAO,MAAM,SAAS;GAC7D,IAAI,CAAC,UAAU,CAAC,QAAQ,SAAS,SAAS,MAAM,GAAG;GACnD,IAAI,iBAAiB,SAAS,SAAS,MAAM,GAAG;GAChD,eAAe,KAAK;EACtB;EAEA,SAAS,iBAAiB,eAAe,OAAO;EAChD,aAAa,SAAS,oBAAoB,eAAe,OAAO;CAClE,GAAG;EAAC;EAAc;EAAM;CAAO,CAAC;CAEhC,MAAM,iBAAiB,UAA2C;EAChE,IAAI,MAAM,QAAQ,UAAU;EAC5B,MAAM,gBAAgB;EAGtB,iBAAiB,SAAS,MAAM;EAChC,eAAe,KAAK;CACtB;CAEA,MAAM,oBAAoB;EACxB,gBAAgB,EAAE;EAClB,gBAAgB,SAAS,MAAM;CACjC;CAEA,OACE,qBAAC,KAAD;EAAK,KAAK;EAAc,KAAK,CAAC,OAAO,QAAQ,GAAG;EAAG,GAAI;EAAvD,UAAA,CACE,oBAAC,qBAAD;GACE,KAAK;GACL,KAAK,OAAO;GACZ,aAAW,OAAO,KAAK,KAAA;GACvB,WAAU;GACH;GACP,eAAe,eAAe,CAAC,IAAI;GACzB;GAEV,UAAA,oBAAC,eAAD,CAAgB,CAAA;EACG,CAAA,GACrB,qBAAC,KAAD;GAAK,KAAK,OAAO;GAAa,aAAW,OAAO,KAAK,KAAA;GAArD,UAAA;IACE,oBAAC,eAAD,EAAe,KAAK,OAAO,WAAa,CAAA;IAGxC,oBAAC,OAAO,OAAR;KACE,KAAK;KACL,cAAY;KACZ,KAAK,OAAO;KACZ,WAAW,UAAU,gBAAgB,MAAM,OAAO,KAAK;KACvD,WAAW;KACE;KAEb,UAAU,OAAO,KAAA,IAAY;KAC7B,MAAK;KACE;IACR,CAAA;IACA,CAAC,CAAC,SACD,oBAAC,mBAAD;KAAmB,cAAW;KAAe,cAAa;KAAQ,SAAS;KAAa,MAAK;IAAM,CAAA;GAElG;EACF,CAAA,CAAA;;AAET,CAAC;AAED,eAAe,cAAc"}
@@ -94,5 +94,6 @@ export { default as BitkitToggletip, type BitkitToggletipProps } from './BitkitT
94
94
  export { default as BitkitTooltip, type BitkitTooltipProps } from './BitkitTooltip/BitkitTooltip';
95
95
  export { default as BitkitTour, type BitkitTourInstance, type BitkitTourOptions, type BitkitTourProps, type BitkitTourSecondaryAction, type BitkitTourStep, useBitkitTour, } from './BitkitTour/BitkitTour';
96
96
  export { default as BitkitTreeView, type BitkitTreeViewBranchProps, type BitkitTreeViewExpandedChangeDetails, type BitkitTreeViewLeafProps, type BitkitTreeViewNodeRenderProps, type BitkitTreeViewRootProps, type BitkitTreeViewSelectionChangeDetails, createTreeCollection, } from './BitkitTreeView/BitkitTreeView';
97
+ export { default as BitkitUIHeader, type BitkitUIHeaderAccountProps, type BitkitUIHeaderButtonProps, type BitkitUIHeaderControlAsAnchorProps, type BitkitUIHeaderControlAsButtonProps, type BitkitUIHeaderControlProps, type BitkitUIHeaderNavButtonProps, type BitkitUIHeaderProps, type BitkitUIHeaderSearchProps, uiHeaderHeight, } from './BitkitUIHeader/BitkitUIHeader';
97
98
  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';
98
99
  export { useUISideNav } from './BitkitUISideNav/UISideNavContext';
package/dist/main.js CHANGED
@@ -383,10 +383,12 @@ import createBitkitToast, { dismissBitkitToast } from "./components/BitkitToast/
383
383
  import BitkitToggleButton from "./components/BitkitToggleButton/BitkitToggleButton.js";
384
384
  import BitkitTour, { useBitkitTour } from "./components/BitkitTour/BitkitTour.js";
385
385
  import BitkitTreeView, { createTreeCollection } from "./components/BitkitTreeView/BitkitTreeView.js";
386
+ import { uiHeaderHeight } from "./theme/slot-recipes/UIHeader.recipe.js";
387
+ import BitkitUIHeader_default from "./components/BitkitUIHeader/BitkitUIHeader.js";
386
388
  import useResponsive, { ResponsiveProvider } from "./hooks/useResponsive.js";
387
389
  import { useUISideNav } from "./components/BitkitUISideNav/UISideNavContext.js";
388
390
  import { uiSideNavRailWidth } from "./theme/slot-recipes/UISideNav.recipe.js";
389
391
  import BitkitUISideNav_default from "./components/BitkitUISideNav/BitkitUISideNav.js";
390
392
  import bitkitTheme from "./theme/index.js";
391
393
  import Provider from "./providers/BitkitProvider.js";
392
- export { 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, BitkitControlButton, BitkitDataWidget, BitkitDatePicker, BitkitDefinitionTooltip, BitkitDialog_default as BitkitDialog, BitkitDraggableCard, BitkitDrawer, BitkitEmptyState, BitkitExpandableCard, BitkitField, BitkitFileInput, BitkitFormDialog_default as BitkitFormDialog, BitkitGroupHeading, BitkitHeading, BitkitIconButton, BitkitInlineLoading, BitkitLabel, BitkitLabelTooltip, BitkitLabeledData, BitkitLightbox, BitkitLink, BitkitLinkButton, 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, BitkitPagination, BitkitPaginationLoadMore, BitkitPopover, 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, 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, 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, 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, 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, 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, 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, uiSideNavRailWidth, useBitkitTour, useResponsive, useStepsDialog, useUISideNav };
394
+ export { 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, BitkitControlButton, BitkitDataWidget, BitkitDatePicker, BitkitDefinitionTooltip, BitkitDialog_default as BitkitDialog, BitkitDraggableCard, BitkitDrawer, BitkitEmptyState, BitkitExpandableCard, BitkitField, BitkitFileInput, BitkitFormDialog_default as BitkitFormDialog, BitkitGroupHeading, BitkitHeading, BitkitIconButton, BitkitInlineLoading, BitkitLabel, BitkitLabelTooltip, BitkitLabeledData, BitkitLightbox, BitkitLink, BitkitLinkButton, 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, BitkitPagination, BitkitPaginationLoadMore, BitkitPopover, 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, 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, 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, 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, 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, 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, uiSideNavRailWidth, useBitkitTour, useResponsive, useStepsDialog, useUISideNav };
@@ -0,0 +1,111 @@
1
+ import { rem } from "../themeUtils.js";
2
+ import { defineRecipe } from "@chakra-ui/react/styled-system";
3
+ //#region lib/theme/recipes/UIHeaderButton.recipe.ts
4
+ /**
5
+ * Only the secondary button is drawn with an outline. The other two keep a transparent border of
6
+ * the same width so every variant is the same size.
7
+ */
8
+ var borderColors = (variant) => variant === "secondary" ? {
9
+ base: "sys/ui/header/button/secondary/border",
10
+ disabled: "sys/ui/header/button/secondary/border-disabled"
11
+ } : {
12
+ base: "transparent",
13
+ disabled: "transparent"
14
+ };
15
+ var variantStyles = (variant) => {
16
+ const border = borderColors(variant);
17
+ return {
18
+ background: `sys/ui/header/button/${variant}/bg`,
19
+ borderColor: border.base,
20
+ color: `sys/ui/header/button/${variant}/fg`,
21
+ _hover: {
22
+ background: `sys/ui/header/button/${variant}/bg-hover`,
23
+ _active: { background: `sys/ui/header/button/${variant}/bg-active` }
24
+ },
25
+ _active: { background: `sys/ui/header/button/${variant}/bg-active` },
26
+ _selected: {
27
+ background: `sys/ui/header/button/${variant}/bg-active`,
28
+ _hover: { background: `sys/ui/header/button/${variant}/bg-active` }
29
+ },
30
+ _disabled: {
31
+ background: `sys/ui/header/button/${variant}/bg-disabled`,
32
+ borderColor: border.disabled,
33
+ color: `sys/ui/header/button/${variant}/fg-disabled`,
34
+ cursor: "not-allowed"
35
+ }
36
+ };
37
+ };
38
+ /**
39
+ * An unread marker centred on the button's trailing top corner: a dot with a ring behind it. The
40
+ * design draws both inside a 12px box, and neither radius lands on the size scale.
41
+ */
42
+ var badgeDot = {
43
+ background: "sys/ui/header/badge/indigo",
44
+ borderRadius: "full",
45
+ content: "\"\"",
46
+ pointerEvents: "none",
47
+ position: "absolute"
48
+ };
49
+ var badgeStyles = {
50
+ _before: {
51
+ ...badgeDot,
52
+ height: "8",
53
+ insetBlockStart: "-4",
54
+ insetInlineEnd: "-4",
55
+ width: "8"
56
+ },
57
+ _after: {
58
+ ...badgeDot,
59
+ height: rem(10),
60
+ insetBlockStart: rem(-5),
61
+ insetInlineEnd: rem(-5),
62
+ opacity: .5,
63
+ width: rem(10)
64
+ }
65
+ };
66
+ var uiHeaderButtonRecipe = defineRecipe({
67
+ className: "ui-header-button",
68
+ base: {
69
+ alignItems: "center",
70
+ borderRadius: "4",
71
+ borderStyle: "solid",
72
+ borderWidth: "1",
73
+ cursor: "pointer",
74
+ display: "inline-flex",
75
+ flexShrink: 0,
76
+ gap: "4",
77
+ height: "32",
78
+ justifyContent: "center",
79
+ minWidth: "48",
80
+ paddingInline: "8",
81
+ position: "relative",
82
+ textDecoration: "none",
83
+ textStyle: "comp/button/sm",
84
+ whiteSpace: "nowrap",
85
+ _notLast: { marginInlineEnd: "8" },
86
+ _disabled: { cursor: "not-allowed" }
87
+ },
88
+ variants: {
89
+ variant: {
90
+ primary: variantStyles("primary"),
91
+ secondary: variantStyles("secondary"),
92
+ tertiary: variantStyles("tertiary")
93
+ },
94
+ badge: {
95
+ idle: badgeStyles,
96
+ pulse: {
97
+ ...badgeStyles,
98
+ _after: {
99
+ ...badgeStyles._after,
100
+ animation: "ping",
101
+ _motionReduce: { animation: "none" }
102
+ }
103
+ }
104
+ }
105
+ },
106
+ defaultVariants: { variant: "primary" }
107
+ });
108
+ //#endregion
109
+ export { uiHeaderButtonRecipe as default };
110
+
111
+ //# sourceMappingURL=UIHeaderButton.recipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UIHeaderButton.recipe.js","names":[],"sources":["../../../lib/theme/recipes/UIHeaderButton.recipe.ts"],"sourcesContent":["import { defineRecipe, type SystemStyleObject } from '@chakra-ui/react/styled-system';\n\nimport { rem } from '../themeUtils';\n\ntype Variant = 'primary' | 'secondary' | 'tertiary';\n\n/**\n * Only the secondary button is drawn with an outline. The other two keep a transparent border of\n * the same width so every variant is the same size.\n */\nconst borderColors = (variant: Variant) =>\n variant === 'secondary'\n ? { base: 'sys/ui/header/button/secondary/border', disabled: 'sys/ui/header/button/secondary/border-disabled' }\n : { base: 'transparent', disabled: 'transparent' };\n\nconst variantStyles = (variant: Variant): SystemStyleObject => {\n const border = borderColors(variant);\n\n return {\n background: `sys/ui/header/button/${variant}/bg`,\n borderColor: border.base,\n color: `sys/ui/header/button/${variant}/fg`,\n // `_hover`/`_active` compile to `:not(:disabled, [data-disabled])`, so they never match a\n // disabled button and `_disabled` wins without `!important`.\n _hover: {\n background: `sys/ui/header/button/${variant}/bg-hover`,\n // Repeat active under hover so clicking while hovering keeps the active styles.\n _active: {\n background: `sys/ui/header/button/${variant}/bg-active`,\n },\n },\n _active: {\n background: `sys/ui/header/button/${variant}/bg-active`,\n },\n // A button that holds a panel open stays pressed while the panel is, hover included — letting\n // hover lighten it would read as the panel having closed.\n _selected: {\n background: `sys/ui/header/button/${variant}/bg-active`,\n _hover: {\n background: `sys/ui/header/button/${variant}/bg-active`,\n },\n },\n _disabled: {\n background: `sys/ui/header/button/${variant}/bg-disabled`,\n borderColor: border.disabled,\n color: `sys/ui/header/button/${variant}/fg-disabled`,\n cursor: 'not-allowed',\n },\n };\n};\n\n/**\n * An unread marker centred on the button's trailing top corner: a dot with a ring behind it. The\n * design draws both inside a 12px box, and neither radius lands on the size scale.\n */\nconst badgeDot: SystemStyleObject = {\n background: 'sys/ui/header/badge/indigo',\n borderRadius: 'full',\n content: '\"\"',\n pointerEvents: 'none',\n position: 'absolute',\n};\n\nconst badgeStyles: SystemStyleObject = {\n _before: {\n ...badgeDot,\n height: '8',\n insetBlockStart: '-4',\n insetInlineEnd: '-4',\n width: '8',\n },\n _after: {\n ...badgeDot,\n height: rem(10),\n insetBlockStart: rem(-5),\n insetInlineEnd: rem(-5),\n opacity: 0.5,\n width: rem(10),\n },\n};\n\nconst uiHeaderButtonRecipe = defineRecipe({\n className: 'ui-header-button',\n base: {\n alignItems: 'center',\n borderRadius: '4',\n borderStyle: 'solid',\n borderWidth: '1',\n cursor: 'pointer',\n display: 'inline-flex',\n flexShrink: 0,\n gap: '4',\n height: '32',\n justifyContent: 'center',\n minWidth: '48',\n paddingInline: '8',\n position: 'relative',\n textDecoration: 'none',\n textStyle: 'comp/button/sm',\n whiteSpace: 'nowrap',\n // The icon controls beside it carry their own padding and sit flush against each other, but a\n // labelled button needs room. A trailing button takes none: the bar's own inset is its room.\n _notLast: {\n marginInlineEnd: '8',\n },\n _disabled: {\n cursor: 'not-allowed',\n },\n },\n variants: {\n variant: {\n primary: variantStyles('primary'),\n secondary: variantStyles('secondary'),\n tertiary: variantStyles('tertiary'),\n },\n badge: {\n idle: badgeStyles,\n pulse: {\n ...badgeStyles,\n _after: {\n ...badgeStyles._after,\n // The system's own ping: the ring expands past the dot and fades out.\n animation: 'ping',\n _motionReduce: {\n animation: 'none',\n },\n },\n },\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n});\n\nexport default uiHeaderButtonRecipe;\n"],"mappings":";;;;;;;AAUA,IAAM,gBAAgB,YACpB,YAAY,cACR;CAAE,MAAM;CAAyC,UAAU;AAAiD,IAC5G;CAAE,MAAM;CAAe,UAAU;AAAc;AAErD,IAAM,iBAAiB,YAAwC;CAC7D,MAAM,SAAS,aAAa,OAAO;CAEnC,OAAO;EACL,YAAY,wBAAwB,QAAQ;EAC5C,aAAa,OAAO;EACpB,OAAO,wBAAwB,QAAQ;EAGvC,QAAQ;GACN,YAAY,wBAAwB,QAAQ;GAE5C,SAAS,EACP,YAAY,wBAAwB,QAAQ,YAC9C;EACF;EACA,SAAS,EACP,YAAY,wBAAwB,QAAQ,YAC9C;EAGA,WAAW;GACT,YAAY,wBAAwB,QAAQ;GAC5C,QAAQ,EACN,YAAY,wBAAwB,QAAQ,YAC9C;EACF;EACA,WAAW;GACT,YAAY,wBAAwB,QAAQ;GAC5C,aAAa,OAAO;GACpB,OAAO,wBAAwB,QAAQ;GACvC,QAAQ;EACV;CACF;AACF;;;;;AAMA,IAAM,WAA8B;CAClC,YAAY;CACZ,cAAc;CACd,SAAS;CACT,eAAe;CACf,UAAU;AACZ;AAEA,IAAM,cAAiC;CACrC,SAAS;EACP,GAAG;EACH,QAAQ;EACR,iBAAiB;EACjB,gBAAgB;EAChB,OAAO;CACT;CACA,QAAQ;EACN,GAAG;EACH,QAAQ,IAAI,EAAE;EACd,iBAAiB,IAAI,EAAE;EACvB,gBAAgB,IAAI,EAAE;EACtB,SAAS;EACT,OAAO,IAAI,EAAE;CACf;AACF;AAEA,IAAM,uBAAuB,aAAa;CACxC,WAAW;CACX,MAAM;EACJ,YAAY;EACZ,cAAc;EACd,aAAa;EACb,aAAa;EACb,QAAQ;EACR,SAAS;EACT,YAAY;EACZ,KAAK;EACL,QAAQ;EACR,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf,UAAU;EACV,gBAAgB;EAChB,WAAW;EACX,YAAY;EAGZ,UAAU,EACR,iBAAiB,IACnB;EACA,WAAW,EACT,QAAQ,cACV;CACF;CACA,UAAU;EACR,SAAS;GACP,SAAS,cAAc,SAAS;GAChC,WAAW,cAAc,WAAW;GACpC,UAAU,cAAc,UAAU;EACpC;EACA,OAAO;GACL,MAAM;GACN,OAAO;IACL,GAAG;IACH,QAAQ;KACN,GAAG,YAAY;KAEf,WAAW;KACX,eAAe,EACb,WAAW,OACb;IACF;GACF;EACF;CACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC"}
@@ -15,6 +15,7 @@ import separatorRecipe from "./Separator.recipe.js";
15
15
  import skeletonRecipe from "./Skeleton.recipe.js";
16
16
  import spinnerRecipe from "./Spinner.recipe.js";
17
17
  import toggleButtonRecipe from "./ToggleButton.recipe.js";
18
+ import uiHeaderButtonRecipe from "./UIHeaderButton.recipe.js";
18
19
  //#region lib/theme/recipes/index.ts
19
20
  var recipes = {
20
21
  badge: badgeRecipe,
@@ -33,7 +34,8 @@ var recipes = {
33
34
  skeleton: skeletonRecipe,
34
35
  spinner: spinnerRecipe,
35
36
  textarea: textareaRecipe,
36
- toggleButton: toggleButtonRecipe
37
+ toggleButton: toggleButtonRecipe,
38
+ uiHeaderButton: uiHeaderButtonRecipe
37
39
  };
38
40
  //#endregion
39
41
  export { recipes as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../lib/theme/recipes/index.ts"],"sourcesContent":["import badgeRecipe from './Badge.recipe';\nimport buttonRecipe from './Button.recipe';\nimport closeButtonRecipe from './CloseButton.recipe';\nimport colorButtonRecipe from './ColorButton.recipe';\nimport controlButtonRecipe from './ControlButton.recipe';\nimport definitionTooltipRecipe from './DefinitionTooltip.recipe';\nimport iconRecipe from './Icon.recipe';\nimport inputRecipe from './Input.recipe';\nimport inputAddonRecipe from './InputAddon.recipe';\nimport linkRecipe from './Link.recipe';\nimport linkButtonRecipe from './LinkButton.recipe';\nimport selectableTagRecipe from './SelectableTag.recipe';\nimport separatorRecipe from './Separator.recipe';\nimport skeletonRecipe from './Skeleton.recipe';\nimport spinnerRecipe from './Spinner.recipe';\nimport textareaRecipe from './Textarea.recipe';\nimport toggleButtonRecipe from './ToggleButton.recipe';\n\nconst recipes = {\n badge: badgeRecipe,\n button: buttonRecipe,\n closeButton: closeButtonRecipe,\n controlButton: controlButtonRecipe,\n colorButton: colorButtonRecipe,\n definitionTooltip: definitionTooltipRecipe,\n icon: iconRecipe,\n input: inputRecipe,\n inputAddon: inputAddonRecipe,\n link: linkRecipe,\n linkButton: linkButtonRecipe,\n selectableTag: selectableTagRecipe,\n separator: separatorRecipe,\n skeleton: skeletonRecipe,\n spinner: spinnerRecipe,\n textarea: textareaRecipe,\n toggleButton: toggleButtonRecipe,\n};\n\nexport default recipes;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAM,UAAU;CACd,OAAO;CACP,QAAQ;CACR,aAAa;CACb,eAAe;CACf,aAAa;CACb,mBAAmB;CACnB,MAAM;CACN,OAAO;CACP,YAAY;CACZ,MAAM;CACN,YAAY;CACZ,eAAe;CACf,WAAW;CACX,UAAU;CACV,SAAS;CACT,UAAU;CACV,cAAc;AAChB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../lib/theme/recipes/index.ts"],"sourcesContent":["import badgeRecipe from './Badge.recipe';\nimport buttonRecipe from './Button.recipe';\nimport closeButtonRecipe from './CloseButton.recipe';\nimport colorButtonRecipe from './ColorButton.recipe';\nimport controlButtonRecipe from './ControlButton.recipe';\nimport definitionTooltipRecipe from './DefinitionTooltip.recipe';\nimport iconRecipe from './Icon.recipe';\nimport inputRecipe from './Input.recipe';\nimport inputAddonRecipe from './InputAddon.recipe';\nimport linkRecipe from './Link.recipe';\nimport linkButtonRecipe from './LinkButton.recipe';\nimport selectableTagRecipe from './SelectableTag.recipe';\nimport separatorRecipe from './Separator.recipe';\nimport skeletonRecipe from './Skeleton.recipe';\nimport spinnerRecipe from './Spinner.recipe';\nimport textareaRecipe from './Textarea.recipe';\nimport toggleButtonRecipe from './ToggleButton.recipe';\nimport uiHeaderButtonRecipe from './UIHeaderButton.recipe';\n\nconst recipes = {\n badge: badgeRecipe,\n button: buttonRecipe,\n closeButton: closeButtonRecipe,\n controlButton: controlButtonRecipe,\n colorButton: colorButtonRecipe,\n definitionTooltip: definitionTooltipRecipe,\n icon: iconRecipe,\n input: inputRecipe,\n inputAddon: inputAddonRecipe,\n link: linkRecipe,\n linkButton: linkButtonRecipe,\n selectableTag: selectableTagRecipe,\n separator: separatorRecipe,\n skeleton: skeletonRecipe,\n spinner: spinnerRecipe,\n textarea: textareaRecipe,\n toggleButton: toggleButtonRecipe,\n uiHeaderButton: uiHeaderButtonRecipe,\n};\n\nexport default recipes;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,IAAM,UAAU;CACd,OAAO;CACP,QAAQ;CACR,aAAa;CACb,eAAe;CACf,aAAa;CACb,mBAAmB;CACnB,MAAM;CACN,OAAO;CACP,YAAY;CACZ,MAAM;CACN,YAAY;CACZ,eAAe;CACf,WAAW;CACX,UAAU;CACV,SAAS;CACT,UAAU;CACV,cAAc;CACd,gBAAgB;AAClB"}
@@ -38,6 +38,7 @@ declare const drawerSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<
38
38
  };
39
39
  floating: {
40
40
  body: {
41
+ paddingBlockEnd: "24";
41
42
  paddingBlockStart: "8";
42
43
  paddingInline: "24";
43
44
  '.chakra-drawer__header:has([role=tablist]) ~ &': {
@@ -71,7 +72,7 @@ declare const drawerSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<
71
72
  borderBlockStartColor: "transparent";
72
73
  borderBlockStartWidth: number;
73
74
  paddingBlockEnd: "24";
74
- paddingBlockStart: "32";
75
+ paddingBlockStart: "8";
75
76
  paddingInline: "24";
76
77
  };
77
78
  title: {
@@ -121,6 +121,7 @@ var drawerSlotRecipe = defineSlotRecipe({
121
121
  },
122
122
  floating: {
123
123
  body: {
124
+ paddingBlockEnd: "24",
124
125
  paddingBlockStart: "8",
125
126
  paddingInline: "24",
126
127
  ".chakra-drawer__header:has([role=tablist]) ~ &": { paddingBlockStart: "24" }
@@ -148,7 +149,7 @@ var drawerSlotRecipe = defineSlotRecipe({
148
149
  borderBlockStartColor: "transparent",
149
150
  borderBlockStartWidth: 0,
150
151
  paddingBlockEnd: "24",
151
- paddingBlockStart: "32",
152
+ paddingBlockStart: "8",
152
153
  paddingInline: "24"
153
154
  },
154
155
  title: {
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/Drawer.recipe.ts"],"sourcesContent":["import { drawerAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nimport { rem } from '../themeUtils';\n\nconst drawerSlotRecipe = defineSlotRecipe({\n className: 'drawer',\n slots: drawerAnatomy.keys(),\n base: {\n backdrop: {\n background: 'utilities/overlay-light',\n inset: 0,\n position: 'fixed',\n zIndex: 'calc({zIndex.dialogOverlay} + var(--layer-index, 0))',\n _open: {\n animationName: 'fade-in',\n animationDuration: 'slow',\n },\n _closed: {\n animationName: 'fade-out',\n animationDuration: 'moderate',\n },\n },\n positioner: {\n alignItems: 'stretch',\n display: 'flex',\n inset: 0,\n justifyContent: 'flex-end',\n overscrollBehaviorY: 'none',\n position: 'fixed',\n zIndex: 'calc({zIndex.dialog} + var(--layer-index, 0))',\n },\n content: {\n background: 'background/primary',\n display: 'flex',\n flexDirection: 'column',\n maxHeight: '100dvh',\n outline: 'none',\n position: 'relative',\n _open: {\n animationDuration: 'slowest',\n animationName: {\n base: 'slide-from-right-full, fade-in',\n _rtl: 'slide-from-left-full, fade-in',\n },\n animationTimingFunction: 'ease-in-smooth',\n },\n _closed: {\n animationDuration: 'slower',\n animationName: {\n base: 'slide-to-right-full, fade-out',\n _rtl: 'slide-to-left-full, fade-out',\n },\n animationTimingFunction: 'ease-in-smooth',\n },\n },\n header: {\n paddingBlockEnd: '8',\n paddingBlockStart: '24',\n paddingInline: '24',\n // A tab list in the header closes it off with its own baseline.\n '&:has([role=tablist])': {\n paddingBlockEnd: 0,\n },\n },\n body: {\n flex: '1',\n overflow: 'auto',\n },\n footer: {\n borderBlockStartColor: 'border/regular',\n borderBlockStartWidth: '1',\n paddingBlock: '12',\n },\n title: {\n color: 'text/tertiary',\n flex: '1',\n // The close button is absolutely positioned, so the title keeps clear of it.\n paddingInlineEnd: '48',\n textStyle: 'heading/h6',\n },\n description: {},\n closeTrigger: {\n alignItems: 'center',\n borderRadius: '4',\n color: 'icon/primary',\n cursor: 'pointer',\n display: 'inline-flex',\n height: '40',\n justifyContent: 'center',\n position: 'absolute',\n width: '40',\n _hover: {\n backgroundColor: 'color/neutral/subtle',\n },\n _active: {\n backgroundColor: 'color/neutral/moderate',\n },\n },\n },\n variants: {\n variant: {\n // One inline padding for header, body and footer, so their content lines up: 16 on mobile, 24 from tablet.\n docked: {\n body: {\n padding: { base: '16', tablet: '24' },\n },\n closeTrigger: {\n insetEnd: rem(18),\n top: '12',\n },\n content: {\n width: { base: '100vw', tablet: rem(320) },\n },\n footer: {\n paddingInline: { base: '16', tablet: '24' },\n },\n header: {\n paddingInline: { base: '16', tablet: '24' },\n // Tabs sit 8px from the edge, so their baseline runs nearly full width.\n '& :has(> [role=tablist])': {\n marginInline: { base: '-8', tablet: '-16' },\n },\n },\n },\n floating: {\n body: {\n paddingBlockStart: '8',\n paddingInline: '24',\n '.chakra-drawer__header:has([role=tablist]) ~ &': {\n paddingBlockStart: '24',\n },\n },\n closeTrigger: {\n height: '32',\n insetEnd: '20',\n top: '20',\n width: '32',\n },\n positioner: {\n padding: '32',\n },\n content: {\n borderRadius: '12',\n boxShadow: 'elevation/lg',\n // A size lifts this cap through the variable, which also reaches a responsive `variant`'s tablet-scoped rule.\n maxWidth: `var(--drawer-floating-max-width, ${rem(700)})`,\n // 480 is the floating drawer's smallest step, so xxs and xs land on it too; on narrow screens it gives way to the viewport.\n minWidth: `min(100%, ${rem(480)})`,\n },\n header: {\n paddingBlockEnd: '16',\n paddingBlockStart: '24',\n paddingInline: '24',\n '& :has(> [role=tablist])': {\n marginInline: '-16',\n },\n },\n footer: {\n borderBlockStartColor: 'transparent',\n borderBlockStartWidth: 0,\n paddingBlockEnd: '24',\n paddingBlockStart: '32',\n paddingInline: '24',\n },\n title: {\n color: 'text/primary',\n textStyle: 'heading/h3',\n },\n },\n },\n // Plain variants rather than compounds, so a size also works with a responsive `variant`, which compound variants\n // never match. Widths apply from tablet up; below that the variant's own width stays (docked: full width,\n // floating: sized to content).\n size: {\n xxs: { content: { '--drawer-floating-max-width': '100%', width: { tablet: rem(320) } } },\n xs: { content: { '--drawer-floating-max-width': '100%', width: { tablet: rem(360) } } },\n sm: { content: { '--drawer-floating-max-width': '100%', width: { tablet: rem(480) } } },\n md: { content: { '--drawer-floating-max-width': '100%', width: { tablet: rem(640) } } },\n lg: { content: { '--drawer-floating-max-width': '100%', width: { tablet: rem(800) } } },\n },\n },\n defaultVariants: {\n variant: 'docked',\n },\n});\n\nexport default drawerSlotRecipe;\n"],"mappings":"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"}
1
+ {"version":3,"file":"Drawer.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/Drawer.recipe.ts"],"sourcesContent":["import { drawerAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nimport { rem } from '../themeUtils';\n\nconst drawerSlotRecipe = defineSlotRecipe({\n className: 'drawer',\n slots: drawerAnatomy.keys(),\n base: {\n backdrop: {\n background: 'utilities/overlay-light',\n inset: 0,\n position: 'fixed',\n zIndex: 'calc({zIndex.dialogOverlay} + var(--layer-index, 0))',\n _open: {\n animationName: 'fade-in',\n animationDuration: 'slow',\n },\n _closed: {\n animationName: 'fade-out',\n animationDuration: 'moderate',\n },\n },\n positioner: {\n alignItems: 'stretch',\n display: 'flex',\n inset: 0,\n justifyContent: 'flex-end',\n overscrollBehaviorY: 'none',\n position: 'fixed',\n zIndex: 'calc({zIndex.dialog} + var(--layer-index, 0))',\n },\n content: {\n background: 'background/primary',\n display: 'flex',\n flexDirection: 'column',\n maxHeight: '100dvh',\n outline: 'none',\n position: 'relative',\n _open: {\n animationDuration: 'slowest',\n animationName: {\n base: 'slide-from-right-full, fade-in',\n _rtl: 'slide-from-left-full, fade-in',\n },\n animationTimingFunction: 'ease-in-smooth',\n },\n _closed: {\n animationDuration: 'slower',\n animationName: {\n base: 'slide-to-right-full, fade-out',\n _rtl: 'slide-to-left-full, fade-out',\n },\n animationTimingFunction: 'ease-in-smooth',\n },\n },\n header: {\n paddingBlockEnd: '8',\n paddingBlockStart: '24',\n paddingInline: '24',\n // A tab list in the header closes it off with its own baseline.\n '&:has([role=tablist])': {\n paddingBlockEnd: 0,\n },\n },\n body: {\n flex: '1',\n overflow: 'auto',\n },\n footer: {\n borderBlockStartColor: 'border/regular',\n borderBlockStartWidth: '1',\n paddingBlock: '12',\n },\n title: {\n color: 'text/tertiary',\n flex: '1',\n // The close button is absolutely positioned, so the title keeps clear of it.\n paddingInlineEnd: '48',\n textStyle: 'heading/h6',\n },\n description: {},\n closeTrigger: {\n alignItems: 'center',\n borderRadius: '4',\n color: 'icon/primary',\n cursor: 'pointer',\n display: 'inline-flex',\n height: '40',\n justifyContent: 'center',\n position: 'absolute',\n width: '40',\n _hover: {\n backgroundColor: 'color/neutral/subtle',\n },\n _active: {\n backgroundColor: 'color/neutral/moderate',\n },\n },\n },\n variants: {\n variant: {\n // One inline padding for header, body and footer, so their content lines up: 16 on mobile, 24 from tablet.\n docked: {\n body: {\n padding: { base: '16', tablet: '24' },\n },\n closeTrigger: {\n insetEnd: rem(18),\n top: '12',\n },\n content: {\n width: { base: '100vw', tablet: rem(320) },\n },\n footer: {\n paddingInline: { base: '16', tablet: '24' },\n },\n header: {\n paddingInline: { base: '16', tablet: '24' },\n // Tabs sit 8px from the edge, so their baseline runs nearly full width.\n '& :has(> [role=tablist])': {\n marginInline: { base: '-8', tablet: '-16' },\n },\n },\n },\n floating: {\n body: {\n // The bottom 24 is the body's, not the footer's, so a drawer without a footer still ends on it.\n paddingBlockEnd: '24',\n paddingBlockStart: '8',\n paddingInline: '24',\n '.chakra-drawer__header:has([role=tablist]) ~ &': {\n paddingBlockStart: '24',\n },\n },\n closeTrigger: {\n height: '32',\n insetEnd: '20',\n top: '20',\n width: '32',\n },\n positioner: {\n padding: '32',\n },\n content: {\n borderRadius: '12',\n boxShadow: 'elevation/lg',\n // A size lifts this cap through the variable, which also reaches a responsive `variant`'s tablet-scoped rule.\n maxWidth: `var(--drawer-floating-max-width, ${rem(700)})`,\n // 480 is the floating drawer's smallest step, so xxs and xs land on it too; on narrow screens it gives way to the viewport.\n minWidth: `min(100%, ${rem(480)})`,\n },\n header: {\n paddingBlockEnd: '16',\n paddingBlockStart: '24',\n paddingInline: '24',\n '& :has(> [role=tablist])': {\n marginInline: '-16',\n },\n },\n footer: {\n borderBlockStartColor: 'transparent',\n borderBlockStartWidth: 0,\n paddingBlockEnd: '24',\n // With the body's bottom 24, the gap above the footer stays 32.\n paddingBlockStart: '8',\n paddingInline: '24',\n },\n title: {\n color: 'text/primary',\n textStyle: 'heading/h3',\n },\n },\n },\n // Plain variants rather than compounds, so a size also works with a responsive `variant`, which compound variants\n // never match. Widths apply from tablet up; below that the variant's own width stays (docked: full width,\n // floating: sized to content).\n size: {\n xxs: { content: { '--drawer-floating-max-width': '100%', width: { tablet: rem(320) } } },\n xs: { content: { '--drawer-floating-max-width': '100%', width: { tablet: rem(360) } } },\n sm: { content: { '--drawer-floating-max-width': '100%', width: { tablet: rem(480) } } },\n md: { content: { '--drawer-floating-max-width': '100%', width: { tablet: rem(640) } } },\n lg: { content: { '--drawer-floating-max-width': '100%', width: { tablet: rem(800) } } },\n },\n },\n defaultVariants: {\n variant: 'docked',\n },\n});\n\nexport default drawerSlotRecipe;\n"],"mappings":";;;;AAKA,IAAM,mBAAmB,iBAAiB;CACxC,WAAW;CACX,OAAO,cAAc,KAAK;CAC1B,MAAM;EACJ,UAAU;GACR,YAAY;GACZ,OAAO;GACP,UAAU;GACV,QAAQ;GACR,OAAO;IACL,eAAe;IACf,mBAAmB;GACrB;GACA,SAAS;IACP,eAAe;IACf,mBAAmB;GACrB;EACF;EACA,YAAY;GACV,YAAY;GACZ,SAAS;GACT,OAAO;GACP,gBAAgB;GAChB,qBAAqB;GACrB,UAAU;GACV,QAAQ;EACV;EACA,SAAS;GACP,YAAY;GACZ,SAAS;GACT,eAAe;GACf,WAAW;GACX,SAAS;GACT,UAAU;GACV,OAAO;IACL,mBAAmB;IACnB,eAAe;KACb,MAAM;KACN,MAAM;IACR;IACA,yBAAyB;GAC3B;GACA,SAAS;IACP,mBAAmB;IACnB,eAAe;KACb,MAAM;KACN,MAAM;IACR;IACA,yBAAyB;GAC3B;EACF;EACA,QAAQ;GACN,iBAAiB;GACjB,mBAAmB;GACnB,eAAe;GAEf,yBAAyB,EACvB,iBAAiB,EACnB;EACF;EACA,MAAM;GACJ,MAAM;GACN,UAAU;EACZ;EACA,QAAQ;GACN,uBAAuB;GACvB,uBAAuB;GACvB,cAAc;EAChB;EACA,OAAO;GACL,OAAO;GACP,MAAM;GAEN,kBAAkB;GAClB,WAAW;EACb;EACA,aAAa,CAAC;EACd,cAAc;GACZ,YAAY;GACZ,cAAc;GACd,OAAO;GACP,QAAQ;GACR,SAAS;GACT,QAAQ;GACR,gBAAgB;GAChB,UAAU;GACV,OAAO;GACP,QAAQ,EACN,iBAAiB,uBACnB;GACA,SAAS,EACP,iBAAiB,yBACnB;EACF;CACF;CACA,UAAU;EACR,SAAS;GAEP,QAAQ;IACN,MAAM,EACJ,SAAS;KAAE,MAAM;KAAM,QAAQ;IAAK,EACtC;IACA,cAAc;KACZ,UAAU,IAAI,EAAE;KAChB,KAAK;IACP;IACA,SAAS,EACP,OAAO;KAAE,MAAM;KAAS,QAAQ,IAAI,GAAG;IAAE,EAC3C;IACA,QAAQ,EACN,eAAe;KAAE,MAAM;KAAM,QAAQ;IAAK,EAC5C;IACA,QAAQ;KACN,eAAe;MAAE,MAAM;MAAM,QAAQ;KAAK;KAE1C,4BAA4B,EAC1B,cAAc;MAAE,MAAM;MAAM,QAAQ;KAAM,EAC5C;IACF;GACF;GACA,UAAU;IACR,MAAM;KAEJ,iBAAiB;KACjB,mBAAmB;KACnB,eAAe;KACf,kDAAkD,EAChD,mBAAmB,KACrB;IACF;IACA,cAAc;KACZ,QAAQ;KACR,UAAU;KACV,KAAK;KACL,OAAO;IACT;IACA,YAAY,EACV,SAAS,KACX;IACA,SAAS;KACP,cAAc;KACd,WAAW;KAEX,UAAU,oCAAoC,IAAI,GAAG,EAAE;KAEvD,UAAU,aAAa,IAAI,GAAG,EAAE;IAClC;IACA,QAAQ;KACN,iBAAiB;KACjB,mBAAmB;KACnB,eAAe;KACf,4BAA4B,EAC1B,cAAc,MAChB;IACF;IACA,QAAQ;KACN,uBAAuB;KACvB,uBAAuB;KACvB,iBAAiB;KAEjB,mBAAmB;KACnB,eAAe;IACjB;IACA,OAAO;KACL,OAAO;KACP,WAAW;IACb;GACF;EACF;EAIA,MAAM;GACJ,KAAK,EAAE,SAAS;IAAE,+BAA+B;IAAQ,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE;GAAE,EAAE;GACvF,IAAI,EAAE,SAAS;IAAE,+BAA+B;IAAQ,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE;GAAE,EAAE;GACtF,IAAI,EAAE,SAAS;IAAE,+BAA+B;IAAQ,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE;GAAE,EAAE;GACtF,IAAI,EAAE,SAAS;IAAE,+BAA+B;IAAQ,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE;GAAE,EAAE;GACtF,IAAI,EAAE,SAAS;IAAE,+BAA+B;IAAQ,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE;GAAE,EAAE;EACxF;CACF;CACA,iBAAiB,EACf,SAAS,SACX;AACF,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The height of the header bar — the banner slot below it is not counted, since its height is the
3
+ * consumer's content.
4
+ *
5
+ * A page that pins the header reserves exactly this much room for it, and anything anchored under
6
+ * the header starts here: a drawer's backdrop and positioner, a side navigation's
7
+ * `insetBlockStart`.
8
+ */
9
+ export declare const uiHeaderHeight: `${number}rem`;
10
+ declare const uiHeaderSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"search" | "badge" | "banner" | "bar" | "root" | "indicator" | "spacer" | "control" | "searchInput" | "actions" | "account" | "navButton" | "accountAvatar" | "accountIcon" | "navButtonBadge" | "navButtonIcon" | "searchButton" | "searchField" | "searchIcon" | "leading" | "logoLink" | "logoBlock", import('@chakra-ui/react').SlotRecipeVariantRecord<"search" | "badge" | "banner" | "bar" | "root" | "indicator" | "spacer" | "control" | "searchInput" | "actions" | "account" | "navButton" | "accountAvatar" | "accountIcon" | "navButtonBadge" | "navButtonIcon" | "searchButton" | "searchField" | "searchIcon" | "leading" | "logoLink" | "logoBlock">>;
11
+ export default uiHeaderSlotRecipe;