@bitrise/bitkit-v2 0.3.482-beta.3116 → 0.3.482
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +0 -1
- package/dist/main.js +1 -3
- package/dist/theme/recipes/index.d.ts +525 -0
- package/dist/theme/recipes/index.js +1 -3
- package/dist/theme/recipes/index.js.map +1 -1
- package/dist/theme/semantic-tokens/index.d.ts +5 -5
- package/dist/theme/semantic-tokens/semanticColors.d.ts +5 -5
- package/dist/theme/semantic-tokens/semanticColors.js +1 -1
- package/dist/theme/semantic-tokens/semanticColors.js.map +1 -1
- package/dist/theme/slot-recipes/index.d.ts +0 -1
- package/dist/theme/slot-recipes/index.js +0 -2
- package/dist/theme/slot-recipes/index.js.map +1 -1
- package/dist/theme/themeUtils.d.ts +0 -6
- package/dist/theme/themeUtils.js +1 -7
- package/dist/theme/themeUtils.js.map +1 -1
- package/dist/theme/tokens/colors.js +12 -12
- package/dist/theme/tokens/colors.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/BitkitUIHeader/BitkitUIHeader.d.ts +0 -41
- package/dist/components/BitkitUIHeader/BitkitUIHeader.js +0 -114
- package/dist/components/BitkitUIHeader/BitkitUIHeader.js.map +0 -1
- package/dist/components/BitkitUIHeader/BitriseLogo.d.ts +0 -10
- package/dist/components/BitkitUIHeader/BitriseLogo.js +0 -86
- package/dist/components/BitkitUIHeader/BitriseLogo.js.map +0 -1
- package/dist/components/BitkitUIHeader/UIHeaderAccount.d.ts +0 -26
- package/dist/components/BitkitUIHeader/UIHeaderAccount.js +0 -40
- package/dist/components/BitkitUIHeader/UIHeaderAccount.js.map +0 -1
- package/dist/components/BitkitUIHeader/UIHeaderButton.d.ts +0 -34
- package/dist/components/BitkitUIHeader/UIHeaderButton.js +0 -45
- package/dist/components/BitkitUIHeader/UIHeaderButton.js.map +0 -1
- package/dist/components/BitkitUIHeader/UIHeaderContext.d.ts +0 -13
- package/dist/components/BitkitUIHeader/UIHeaderContext.js +0 -11
- package/dist/components/BitkitUIHeader/UIHeaderContext.js.map +0 -1
- package/dist/components/BitkitUIHeader/UIHeaderControl.d.ts +0 -65
- package/dist/components/BitkitUIHeader/UIHeaderControl.js +0 -72
- package/dist/components/BitkitUIHeader/UIHeaderControl.js.map +0 -1
- package/dist/components/BitkitUIHeader/UIHeaderNavButton.d.ts +0 -20
- package/dist/components/BitkitUIHeader/UIHeaderNavButton.js +0 -46
- package/dist/components/BitkitUIHeader/UIHeaderNavButton.js.map +0 -1
- package/dist/components/BitkitUIHeader/UIHeaderSearch.d.ts +0 -32
- package/dist/components/BitkitUIHeader/UIHeaderSearch.js +0 -121
- package/dist/components/BitkitUIHeader/UIHeaderSearch.js.map +0 -1
- package/dist/components/BitkitUIHeader/uiHeaderPart.d.ts +0 -14
- package/dist/components/BitkitUIHeader/uiHeaderPart.js +0 -18
- package/dist/components/BitkitUIHeader/uiHeaderPart.js.map +0 -1
- package/dist/theme/recipes/UIHeaderButton.recipe.js +0 -103
- package/dist/theme/recipes/UIHeaderButton.recipe.js.map +0 -1
- package/dist/theme/slot-recipes/UIHeader.recipe.d.ts +0 -14
- package/dist/theme/slot-recipes/UIHeader.recipe.js +0 -253
- package/dist/theme/slot-recipes/UIHeader.recipe.js.map +0 -1
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
...avatarProps
|
|
33
|
-
}), /* @__PURE__ */ jsx(Box, {
|
|
34
|
-
css: styles.navButtonBadge,
|
|
35
|
-
children: /* @__PURE__ */ jsx(IconMenuHamburger, {
|
|
36
|
-
css: styles.navButtonIcon,
|
|
37
|
-
size: "16"
|
|
38
|
-
})
|
|
39
|
-
})]
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
UIHeaderNavButton.displayName = "BitkitUIHeader.NavButton";
|
|
43
|
-
//#endregion
|
|
44
|
-
export { UIHeaderNavButton as default };
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=UIHeaderNavButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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' | 'disabled'> {\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} {...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,GAAI;EAAc,CAAA,GAC5C,oBAAC,KAAD;GAAK,KAAK,OAAO;GACf,UAAA,oBAAC,mBAAD;IAAmB,KAAK,OAAO;IAAe,MAAK;GAAM,CAAA;EACtD,CAAA,CACc;;AAEzB,CAAC;AAED,kBAAkB,cAAc"}
|
|
@@ -1,32 +0,0 @@
|
|
|
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;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import IconMagnifier from "../../icons/IconMagnifier.js";
|
|
2
|
-
import BitkitCloseButton from "../BitkitCloseButton/BitkitCloseButton.js";
|
|
3
|
-
import { useUIHeaderContext } from "./UIHeaderContext.js";
|
|
4
|
-
import uiHeaderPart from "./uiHeaderPart.js";
|
|
5
|
-
import { UIHeaderControlBase } from "./UIHeaderControl.js";
|
|
6
|
-
import { Box } from "@chakra-ui/react/box";
|
|
7
|
-
import { chakra } from "@chakra-ui/react/styled-system";
|
|
8
|
-
import { forwardRef, useEffect, useMemo, useRef } from "react";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { useCallbackRef } from "@chakra-ui/react/hooks";
|
|
11
|
-
import { mergeRefs } from "@chakra-ui/react";
|
|
12
|
-
//#region lib/components/BitkitUIHeader/UIHeaderSearch.tsx
|
|
13
|
-
/**
|
|
14
|
-
* Search in the header bar: a button that opens a field lying over it, so opening the search moves
|
|
15
|
-
* nothing else in the bar.
|
|
16
|
-
*
|
|
17
|
-
* It is controlled. Hold `open` and `value` yourself, and render the results against `inputRef`.
|
|
18
|
-
*/
|
|
19
|
-
var UIHeaderSearch = forwardRef((props, ref) => {
|
|
20
|
-
const { css, inputRef, label = "Search", onOpenChange, onValueChange, open = false, placeholder, selected, value = "", ...rest } = props;
|
|
21
|
-
const { barRef, styles } = useUIHeaderContext();
|
|
22
|
-
const buttonElementRef = useRef(null);
|
|
23
|
-
const inputElementRef = useRef(null);
|
|
24
|
-
const searchElementRef = useRef(null);
|
|
25
|
-
const restoreFocusRef = useRef(false);
|
|
26
|
-
const setInputRef = useMemo(() => mergeRefs(inputElementRef, inputRef), [inputRef]);
|
|
27
|
-
const setSearchRef = useMemo(() => mergeRefs(searchElementRef, ref), [ref]);
|
|
28
|
-
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (open) {
|
|
31
|
-
inputElementRef.current?.focus();
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (!restoreFocusRef.current) return;
|
|
35
|
-
restoreFocusRef.current = false;
|
|
36
|
-
buttonElementRef.current?.focus();
|
|
37
|
-
}, [open]);
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (!open) return void 0;
|
|
40
|
-
const bar = barRef.current;
|
|
41
|
-
if (!bar) return void 0;
|
|
42
|
-
const dismiss = (event) => {
|
|
43
|
-
const target = event.target instanceof Node ? event.target : null;
|
|
44
|
-
if (!target || searchElementRef.current?.contains(target)) return;
|
|
45
|
-
handleOpenChange?.(false);
|
|
46
|
-
};
|
|
47
|
-
bar.addEventListener("focusin", dismiss);
|
|
48
|
-
bar.addEventListener("pointerdown", dismiss);
|
|
49
|
-
return () => {
|
|
50
|
-
bar.removeEventListener("focusin", dismiss);
|
|
51
|
-
bar.removeEventListener("pointerdown", dismiss);
|
|
52
|
-
};
|
|
53
|
-
}, [
|
|
54
|
-
barRef,
|
|
55
|
-
handleOpenChange,
|
|
56
|
-
open
|
|
57
|
-
]);
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
if (!open) return void 0;
|
|
60
|
-
const close = (event) => {
|
|
61
|
-
if (event.key !== "Escape") return;
|
|
62
|
-
if (event.target === inputElementRef.current) event.preventDefault();
|
|
63
|
-
restoreFocusRef.current = true;
|
|
64
|
-
handleOpenChange?.(false);
|
|
65
|
-
};
|
|
66
|
-
document.addEventListener("keydown", close);
|
|
67
|
-
return () => document.removeEventListener("keydown", close);
|
|
68
|
-
}, [handleOpenChange, open]);
|
|
69
|
-
const handleClear = () => {
|
|
70
|
-
onValueChange?.("");
|
|
71
|
-
inputElementRef.current?.focus();
|
|
72
|
-
};
|
|
73
|
-
return /* @__PURE__ */ jsxs(Box, {
|
|
74
|
-
ref: setSearchRef,
|
|
75
|
-
css: [styles.search, css],
|
|
76
|
-
...uiHeaderPart("search"),
|
|
77
|
-
...rest,
|
|
78
|
-
children: [/* @__PURE__ */ jsx(UIHeaderControlBase, {
|
|
79
|
-
ref: buttonElementRef,
|
|
80
|
-
"aria-expanded": selected ?? open,
|
|
81
|
-
css: styles.searchButton,
|
|
82
|
-
"data-open": open ? "" : void 0,
|
|
83
|
-
footprint: "control",
|
|
84
|
-
label,
|
|
85
|
-
onClick: () => onOpenChange?.(!open),
|
|
86
|
-
selected,
|
|
87
|
-
...uiHeaderPart("search-button"),
|
|
88
|
-
children: /* @__PURE__ */ jsx(IconMagnifier, {})
|
|
89
|
-
}), /* @__PURE__ */ jsxs(Box, {
|
|
90
|
-
css: styles.searchField,
|
|
91
|
-
"data-open": open ? "" : void 0,
|
|
92
|
-
...uiHeaderPart("search-field"),
|
|
93
|
-
children: [
|
|
94
|
-
/* @__PURE__ */ jsx(IconMagnifier, { css: styles.searchIcon }),
|
|
95
|
-
/* @__PURE__ */ jsx(chakra.input, {
|
|
96
|
-
ref: setInputRef,
|
|
97
|
-
"aria-label": label,
|
|
98
|
-
css: styles.searchInput,
|
|
99
|
-
onChange: (event) => onValueChange?.(event.target.value),
|
|
100
|
-
...uiHeaderPart("search-input"),
|
|
101
|
-
placeholder,
|
|
102
|
-
type: "search",
|
|
103
|
-
value
|
|
104
|
-
}),
|
|
105
|
-
!!value && /* @__PURE__ */ jsx(BitkitCloseButton, {
|
|
106
|
-
"aria-label": "Clear search",
|
|
107
|
-
colorVariant: "white",
|
|
108
|
-
css: styles.searchClear,
|
|
109
|
-
onClick: handleClear,
|
|
110
|
-
size: "sm",
|
|
111
|
-
...uiHeaderPart("search-clear")
|
|
112
|
-
})
|
|
113
|
-
]
|
|
114
|
-
})]
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
UIHeaderSearch.displayName = "BitkitUIHeader.Search";
|
|
118
|
-
//#endregion
|
|
119
|
-
export { UIHeaderSearch as default };
|
|
120
|
-
|
|
121
|
-
//# sourceMappingURL=UIHeaderSearch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 { useCallbackRef } from '@chakra-ui/react/hooks';\nimport { chakra } from '@chakra-ui/react/styled-system';\nimport { forwardRef, 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';\nimport uiHeaderPart from './uiHeaderPart';\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 { barRef, styles } = useUIHeaderContext();\n\n const buttonElementRef = useRef<HTMLButtonElement>(null);\n const inputElementRef = useRef<HTMLInputElement>(null);\n const searchElementRef = useRef<HTMLDivElement>(null);\n const restoreFocusRef = useRef(false);\n const setInputRef = useMemo(() => mergeRefs(inputElementRef, inputRef), [inputRef]);\n const setSearchRef = useMemo(() => mergeRefs(searchElementRef, ref), [ref]);\n\n // The field is controlled, so `onOpenChange` is usually a fresh arrow on every keystroke. Held\n // by a ref, the dismiss listener below is subscribed once per opening rather than per character.\n const handleOpenChange = useCallbackRef(onOpenChange);\n\n // Escape hands focus back to the button that opened the field, but only once the field is closed:\n // while it is open the button is `visibility: hidden`, and a hidden element cannot take focus.\n useEffect(() => {\n if (open) {\n inputElementRef.current?.focus();\n return;\n }\n\n if (!restoreFocusRef.current) return;\n restoreFocusRef.current = false;\n buttonElementRef.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 what happens in the bar itself counts: the results are the\n // consumer's to render — in the `banner` slot as readily as anywhere else — and choosing from\n // them must not close the search.\n //\n // Focus is what settles it for the keyboard. The open field lies over the controls beside it\n // without taking them out of the tab order, so Shift+Tab out of the input lands on one of them,\n // covered — and reaching a control with the keyboard never fires a pointer event. Both end with\n // focus inside the bar and outside the search, which is the moment to close.\n //\n // The pointer still needs its own listener: Safari gives a button no focus when it is clicked.\n useEffect(() => {\n if (!open) return undefined;\n\n const bar = barRef.current;\n if (!bar) return undefined;\n\n const dismiss = (event: Event) => {\n const target = event.target instanceof Node ? event.target : null;\n if (!target || searchElementRef.current?.contains(target)) return;\n handleOpenChange?.(false);\n };\n\n bar.addEventListener('focusin', dismiss);\n bar.addEventListener('pointerdown', dismiss);\n return () => {\n bar.removeEventListener('focusin', dismiss);\n bar.removeEventListener('pointerdown', dismiss);\n };\n }, [barRef, handleOpenChange, open]);\n\n useEffect(() => {\n if (!open) return undefined;\n\n const close = (event: globalThis.KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n if (event.target === inputElementRef.current) event.preventDefault();\n restoreFocusRef.current = true;\n handleOpenChange?.(false);\n };\n\n document.addEventListener('keydown', close);\n return () => document.removeEventListener('keydown', close);\n }, [handleOpenChange, open]);\n\n const handleClear = () => {\n onValueChange?.('');\n inputElementRef.current?.focus();\n };\n\n return (\n <Box ref={setSearchRef} css={[styles.search, css]} {...uiHeaderPart('search')} {...rest}>\n <UIHeaderControlBase\n ref={buttonElementRef}\n aria-expanded={selected ?? open}\n css={styles.searchButton}\n data-open={open ? '' : undefined}\n footprint=\"control\"\n label={label}\n onClick={() => onOpenChange?.(!open)}\n selected={selected}\n {...uiHeaderPart('search-button')}\n >\n <IconMagnifier />\n </UIHeaderControlBase>\n <Box css={styles.searchField} data-open={open ? '' : undefined} {...uiHeaderPart('search-field')}>\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 {...uiHeaderPart('search-input')}\n placeholder={placeholder}\n type=\"search\"\n value={value}\n />\n {!!value && (\n <BitkitCloseButton\n aria-label=\"Clear search\"\n colorVariant=\"white\"\n css={styles.searchClear}\n onClick={handleClear}\n size=\"sm\"\n {...uiHeaderPart('search-clear')}\n />\n )}\n </Box>\n </Box>\n );\n});\n\nUIHeaderSearch.displayName = 'BitkitUIHeader.Search';\n\nexport default UIHeaderSearch;\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,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,QAAQ,WAAW,mBAAmB;CAE9C,MAAM,mBAAmB,OAA0B,IAAI;CACvD,MAAM,kBAAkB,OAAyB,IAAI;CACrD,MAAM,mBAAmB,OAAuB,IAAI;CACpD,MAAM,kBAAkB,OAAO,KAAK;CACpC,MAAM,cAAc,cAAc,UAAU,iBAAiB,QAAQ,GAAG,CAAC,QAAQ,CAAC;CAClF,MAAM,eAAe,cAAc,UAAU,kBAAkB,GAAG,GAAG,CAAC,GAAG,CAAC;CAI1E,MAAM,mBAAmB,eAAe,YAAY;CAIpD,gBAAgB;EACd,IAAI,MAAM;GACR,gBAAgB,SAAS,MAAM;GAC/B;EACF;EAEA,IAAI,CAAC,gBAAgB,SAAS;EAC9B,gBAAgB,UAAU;EAC1B,iBAAiB,SAAS,MAAM;CAClC,GAAG,CAAC,IAAI,CAAC;CAaT,gBAAgB;EACd,IAAI,CAAC,MAAM,OAAO,KAAA;EAElB,MAAM,MAAM,OAAO;EACnB,IAAI,CAAC,KAAK,OAAO,KAAA;EAEjB,MAAM,WAAW,UAAiB;GAChC,MAAM,SAAS,MAAM,kBAAkB,OAAO,MAAM,SAAS;GAC7D,IAAI,CAAC,UAAU,iBAAiB,SAAS,SAAS,MAAM,GAAG;GAC3D,mBAAmB,KAAK;EAC1B;EAEA,IAAI,iBAAiB,WAAW,OAAO;EACvC,IAAI,iBAAiB,eAAe,OAAO;EAC3C,aAAa;GACX,IAAI,oBAAoB,WAAW,OAAO;GAC1C,IAAI,oBAAoB,eAAe,OAAO;EAChD;CACF,GAAG;EAAC;EAAQ;EAAkB;CAAI,CAAC;CAEnC,gBAAgB;EACd,IAAI,CAAC,MAAM,OAAO,KAAA;EAElB,MAAM,SAAS,UAAoC;GACjD,IAAI,MAAM,QAAQ,UAAU;GAC5B,IAAI,MAAM,WAAW,gBAAgB,SAAS,MAAM,eAAe;GACnE,gBAAgB,UAAU;GAC1B,mBAAmB,KAAK;EAC1B;EAEA,SAAS,iBAAiB,WAAW,KAAK;EAC1C,aAAa,SAAS,oBAAoB,WAAW,KAAK;CAC5D,GAAG,CAAC,kBAAkB,IAAI,CAAC;CAE3B,MAAM,oBAAoB;EACxB,gBAAgB,EAAE;EAClB,gBAAgB,SAAS,MAAM;CACjC;CAEA,OACE,qBAAC,KAAD;EAAK,KAAK;EAAc,KAAK,CAAC,OAAO,QAAQ,GAAG;EAAG,GAAI,aAAa,QAAQ;EAAG,GAAI;EAAnF,UAAA,CACE,oBAAC,qBAAD;GACE,KAAK;GACL,iBAAe,YAAY;GAC3B,KAAK,OAAO;GACZ,aAAW,OAAO,KAAK,KAAA;GACvB,WAAU;GACH;GACP,eAAe,eAAe,CAAC,IAAI;GACzB;GACV,GAAI,aAAa,eAAe;GAEhC,UAAA,oBAAC,eAAD,CAAgB,CAAA;EACG,CAAA,GACrB,qBAAC,KAAD;GAAK,KAAK,OAAO;GAAa,aAAW,OAAO,KAAK,KAAA;GAAW,GAAI,aAAa,cAAc;GAA/F,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,GAAI,aAAa,cAAc;KAClB;KACb,MAAK;KACE;IACR,CAAA;IACA,CAAC,CAAC,SACD,oBAAC,mBAAD;KACE,cAAW;KACX,cAAa;KACb,KAAK,OAAO;KACZ,SAAS;KACT,MAAK;KACL,GAAI,aAAa,cAAc;IAChC,CAAA;GAEA;EACF,CAAA,CAAA;;AAET,CAAC;AAED,eAAe,cAAc"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `data-scope` / `data-part` pair every element in the header carries, so a consumer's
|
|
3
|
-
* stylesheet or spec can address one without a generated class name. Spread it before `...rest`.
|
|
4
|
-
*
|
|
5
|
-
* It is the marker Chakra and Ark put on their own parts, which is why it is not ours to drop: a
|
|
6
|
-
* product's global styles use `[data-scope]` to tell a design system's internals from its own
|
|
7
|
-
* markup — the platform's focus ring excludes them that way — and a hand-built component without
|
|
8
|
-
* it is the one thing in the bar those rules would reach.
|
|
9
|
-
*/
|
|
10
|
-
declare const uiHeaderPart: (name: string) => {
|
|
11
|
-
'data-part': string;
|
|
12
|
-
'data-scope': string;
|
|
13
|
-
};
|
|
14
|
-
export default uiHeaderPart;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//#region lib/components/BitkitUIHeader/uiHeaderPart.ts
|
|
2
|
-
/**
|
|
3
|
-
* The `data-scope` / `data-part` pair every element in the header carries, so a consumer's
|
|
4
|
-
* stylesheet or spec can address one without a generated class name. Spread it before `...rest`.
|
|
5
|
-
*
|
|
6
|
-
* It is the marker Chakra and Ark put on their own parts, which is why it is not ours to drop: a
|
|
7
|
-
* product's global styles use `[data-scope]` to tell a design system's internals from its own
|
|
8
|
-
* markup — the platform's focus ring excludes them that way — and a hand-built component without
|
|
9
|
-
* it is the one thing in the bar those rules would reach.
|
|
10
|
-
*/
|
|
11
|
-
var uiHeaderPart = (name) => ({
|
|
12
|
-
"data-part": name,
|
|
13
|
-
"data-scope": "ui-header"
|
|
14
|
-
});
|
|
15
|
-
//#endregion
|
|
16
|
-
export { uiHeaderPart as default };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=uiHeaderPart.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uiHeaderPart.js","names":[],"sources":["../../../lib/components/BitkitUIHeader/uiHeaderPart.ts"],"sourcesContent":["/**\n * The `data-scope` / `data-part` pair every element in the header carries, so a consumer's\n * stylesheet or spec can address one without a generated class name. Spread it before `...rest`.\n *\n * It is the marker Chakra and Ark put on their own parts, which is why it is not ours to drop: a\n * product's global styles use `[data-scope]` to tell a design system's internals from its own\n * markup — the platform's focus ring excludes them that way — and a hand-built component without\n * it is the one thing in the bar those rules would reach.\n */\nconst uiHeaderPart = (name: string) => ({ 'data-part': name, 'data-scope': 'ui-header' });\n\nexport default uiHeaderPart;\n"],"mappings":";;;;;;;;;;AASA,IAAM,gBAAgB,UAAkB;CAAE,aAAa;CAAM,cAAc;AAAY"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { rem } from "../themeUtils.js";
|
|
2
|
-
import { defineRecipe } from "@chakra-ui/react/styled-system";
|
|
3
|
-
//#region lib/theme/recipes/UIHeaderButton.recipe.ts
|
|
4
|
-
var borderColors = (variant) => variant === "secondary" ? {
|
|
5
|
-
base: "sys/ui/header/button/secondary/border",
|
|
6
|
-
disabled: "sys/ui/header/button/secondary/border-disabled"
|
|
7
|
-
} : {
|
|
8
|
-
base: "transparent",
|
|
9
|
-
disabled: "transparent"
|
|
10
|
-
};
|
|
11
|
-
var variantStyles = (variant) => {
|
|
12
|
-
const border = borderColors(variant);
|
|
13
|
-
return {
|
|
14
|
-
background: `sys/ui/header/button/${variant}/bg`,
|
|
15
|
-
borderColor: border.base,
|
|
16
|
-
color: `sys/ui/header/button/${variant}/fg`,
|
|
17
|
-
_hover: {
|
|
18
|
-
background: `sys/ui/header/button/${variant}/bg-hover`,
|
|
19
|
-
_active: { background: `sys/ui/header/button/${variant}/bg-active` }
|
|
20
|
-
},
|
|
21
|
-
_active: { background: `sys/ui/header/button/${variant}/bg-active` },
|
|
22
|
-
_selected: {
|
|
23
|
-
background: `sys/ui/header/button/${variant}/bg-active`,
|
|
24
|
-
_hover: { background: `sys/ui/header/button/${variant}/bg-active` }
|
|
25
|
-
},
|
|
26
|
-
_disabled: {
|
|
27
|
-
background: `sys/ui/header/button/${variant}/bg-disabled`,
|
|
28
|
-
borderColor: border.disabled,
|
|
29
|
-
color: `sys/ui/header/button/${variant}/fg-disabled`,
|
|
30
|
-
cursor: "not-allowed"
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
var badgeDot = {
|
|
35
|
-
background: "sys/ui/header/badge/indigo",
|
|
36
|
-
borderRadius: "full",
|
|
37
|
-
content: "\"\"",
|
|
38
|
-
pointerEvents: "none",
|
|
39
|
-
position: "absolute"
|
|
40
|
-
};
|
|
41
|
-
var badgeStyles = {
|
|
42
|
-
_before: {
|
|
43
|
-
...badgeDot,
|
|
44
|
-
height: "8",
|
|
45
|
-
insetBlockStart: "-4",
|
|
46
|
-
insetInlineEnd: "-4",
|
|
47
|
-
width: "8"
|
|
48
|
-
},
|
|
49
|
-
_after: {
|
|
50
|
-
...badgeDot,
|
|
51
|
-
height: rem(10),
|
|
52
|
-
insetBlockStart: rem(-5),
|
|
53
|
-
insetInlineEnd: rem(-5),
|
|
54
|
-
opacity: .5,
|
|
55
|
-
width: rem(10)
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
var uiHeaderButtonRecipe = defineRecipe({
|
|
59
|
-
className: "ui-header-button",
|
|
60
|
-
base: {
|
|
61
|
-
alignItems: "center",
|
|
62
|
-
borderRadius: "4",
|
|
63
|
-
borderStyle: "solid",
|
|
64
|
-
borderWidth: "1",
|
|
65
|
-
cursor: "pointer",
|
|
66
|
-
display: "inline-flex",
|
|
67
|
-
flexShrink: 0,
|
|
68
|
-
gap: "4",
|
|
69
|
-
height: "32",
|
|
70
|
-
justifyContent: "center",
|
|
71
|
-
minWidth: "48",
|
|
72
|
-
paddingInline: "8",
|
|
73
|
-
position: "relative",
|
|
74
|
-
textDecoration: "none",
|
|
75
|
-
textStyle: "comp/button/sm",
|
|
76
|
-
whiteSpace: "nowrap",
|
|
77
|
-
"&:not(:last-child)": { marginInlineEnd: "8" },
|
|
78
|
-
_disabled: { cursor: "not-allowed" }
|
|
79
|
-
},
|
|
80
|
-
variants: {
|
|
81
|
-
variant: {
|
|
82
|
-
primary: variantStyles("primary"),
|
|
83
|
-
secondary: variantStyles("secondary"),
|
|
84
|
-
tertiary: variantStyles("tertiary")
|
|
85
|
-
},
|
|
86
|
-
badge: {
|
|
87
|
-
idle: badgeStyles,
|
|
88
|
-
pulse: {
|
|
89
|
-
...badgeStyles,
|
|
90
|
-
_after: {
|
|
91
|
-
...badgeStyles._after,
|
|
92
|
-
animation: "ping",
|
|
93
|
-
_motionReduce: { animation: "none" }
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
defaultVariants: { variant: "primary" }
|
|
99
|
-
});
|
|
100
|
-
//#endregion
|
|
101
|
-
export { uiHeaderButtonRecipe as default };
|
|
102
|
-
|
|
103
|
-
//# sourceMappingURL=UIHeaderButton.recipe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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\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\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 '&:not(:last-child)': {\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":";;;AAMA,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;AAEA,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;EACZ,sBAAsB,EACpB,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"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** `uiHeaderHeight` as a number, for a layout that needs one rather than a token. */
|
|
2
|
-
export declare const uiHeaderHeightPx = 48;
|
|
3
|
-
/**
|
|
4
|
-
* The height of the header's bar. A page that pins the header reserves this much room for it, and
|
|
5
|
-
* anything anchored under the header starts here: a drawer's backdrop and positioner, a side
|
|
6
|
-
* navigation's `insetBlockStart`.
|
|
7
|
-
*
|
|
8
|
-
* It is the bar alone. A `banner` sits below it inside the header, and its height is the
|
|
9
|
-
* consumer's content, so a pinned header carrying one is taller than this — measure it rather than
|
|
10
|
-
* assume it.
|
|
11
|
-
*/
|
|
12
|
-
export declare const uiHeaderHeight: `${number}rem`;
|
|
13
|
-
declare const uiHeaderSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"search" | "badge" | "banner" | "bar" | "root" | "indicator" | "spacer" | "control" | "searchInput" | "searchClear" | "actions" | "navButton" | "accountAvatar" | "accountIcon" | "navButtonBadge" | "navButtonIcon" | "searchButton" | "searchField" | "searchIcon" | "leading" | "logoBlock" | "logoLink", import('@chakra-ui/react').SlotRecipeVariantRecord<"search" | "badge" | "banner" | "bar" | "root" | "indicator" | "spacer" | "control" | "searchInput" | "searchClear" | "actions" | "navButton" | "accountAvatar" | "accountIcon" | "navButtonBadge" | "navButtonIcon" | "searchButton" | "searchField" | "searchIcon" | "leading" | "logoBlock" | "logoLink">>;
|
|
14
|
-
export default uiHeaderSlotRecipe;
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { colorVar, rem } from "../themeUtils.js";
|
|
2
|
-
import { defineSlotRecipe } from "@chakra-ui/react/styled-system";
|
|
3
|
-
//#region lib/theme/slot-recipes/UIHeader.recipe.ts
|
|
4
|
-
/** `uiHeaderHeight` as a number, for a layout that needs one rather than a token. */
|
|
5
|
-
var uiHeaderHeightPx = 48;
|
|
6
|
-
/**
|
|
7
|
-
* The height of the header's bar. A page that pins the header reserves this much room for it, and
|
|
8
|
-
* anything anchored under the header starts here: a drawer's backdrop and positioner, a side
|
|
9
|
-
* navigation's `insetBlockStart`.
|
|
10
|
-
*
|
|
11
|
-
* It is the bar alone. A `banner` sits below it inside the header, and its height is the
|
|
12
|
-
* consumer's content, so a pinned header carrying one is taller than this — measure it rather than
|
|
13
|
-
* assume it.
|
|
14
|
-
*/
|
|
15
|
-
var uiHeaderHeight = rem(48);
|
|
16
|
-
var SEARCH_FIELD_WIDTH = rem(240);
|
|
17
|
-
var SEARCH_FIELD_TINT = colorVar("color/white/20");
|
|
18
|
-
var controlBase = {
|
|
19
|
-
background: "sys/ui/header/control/bg",
|
|
20
|
-
_hover: {
|
|
21
|
-
background: "sys/ui/header/control/bg-hover",
|
|
22
|
-
_active: { background: "sys/ui/header/control/bg-active" }
|
|
23
|
-
},
|
|
24
|
-
_active: { background: "sys/ui/header/control/bg-active" },
|
|
25
|
-
_selected: {
|
|
26
|
-
background: "sys/ui/header/control/bg-selected",
|
|
27
|
-
_hover: {
|
|
28
|
-
background: "sys/ui/header/control/bg-selected-hover",
|
|
29
|
-
_active: { background: "sys/ui/header/control/bg-selected" }
|
|
30
|
-
},
|
|
31
|
-
_active: { background: "sys/ui/header/control/bg-selected" }
|
|
32
|
-
},
|
|
33
|
-
alignItems: "center",
|
|
34
|
-
borderRadius: 0,
|
|
35
|
-
color: "icon/on-color",
|
|
36
|
-
cursor: "pointer",
|
|
37
|
-
display: "flex",
|
|
38
|
-
flexShrink: 0,
|
|
39
|
-
height: uiHeaderHeight,
|
|
40
|
-
justifyContent: "center",
|
|
41
|
-
position: "relative",
|
|
42
|
-
textDecoration: "none",
|
|
43
|
-
_focusVisible: { outlineOffset: "calc(var(--focus-ring-width) * -1)" }
|
|
44
|
-
};
|
|
45
|
-
var uiHeaderSlotRecipe = defineSlotRecipe({
|
|
46
|
-
className: "ui-header",
|
|
47
|
-
slots: [
|
|
48
|
-
"accountAvatar",
|
|
49
|
-
"accountIcon",
|
|
50
|
-
"actions",
|
|
51
|
-
"badge",
|
|
52
|
-
"banner",
|
|
53
|
-
"bar",
|
|
54
|
-
"control",
|
|
55
|
-
"indicator",
|
|
56
|
-
"leading",
|
|
57
|
-
"logoBlock",
|
|
58
|
-
"logoLink",
|
|
59
|
-
"navButton",
|
|
60
|
-
"navButtonBadge",
|
|
61
|
-
"navButtonIcon",
|
|
62
|
-
"root",
|
|
63
|
-
"search",
|
|
64
|
-
"searchButton",
|
|
65
|
-
"searchClear",
|
|
66
|
-
"searchField",
|
|
67
|
-
"searchIcon",
|
|
68
|
-
"searchInput",
|
|
69
|
-
"spacer"
|
|
70
|
-
],
|
|
71
|
-
base: {
|
|
72
|
-
root: {
|
|
73
|
-
background: "sys/ui/header/bg",
|
|
74
|
-
color: "text/on-color",
|
|
75
|
-
display: "flex",
|
|
76
|
-
flexDirection: "column",
|
|
77
|
-
width: "full"
|
|
78
|
-
},
|
|
79
|
-
bar: {
|
|
80
|
-
alignItems: "center",
|
|
81
|
-
display: "flex",
|
|
82
|
-
flexShrink: 0,
|
|
83
|
-
height: uiHeaderHeight,
|
|
84
|
-
position: "relative",
|
|
85
|
-
tablet: { paddingInlineStart: "20" }
|
|
86
|
-
},
|
|
87
|
-
leading: {
|
|
88
|
-
display: "flex",
|
|
89
|
-
flexShrink: 0,
|
|
90
|
-
tablet: { display: "none" }
|
|
91
|
-
},
|
|
92
|
-
spacer: {
|
|
93
|
-
flexShrink: 1,
|
|
94
|
-
width: "48",
|
|
95
|
-
tablet: { display: "none" }
|
|
96
|
-
},
|
|
97
|
-
logoBlock: {
|
|
98
|
-
alignItems: "center",
|
|
99
|
-
display: "flex",
|
|
100
|
-
flex: 1,
|
|
101
|
-
justifyContent: "center",
|
|
102
|
-
minWidth: 0,
|
|
103
|
-
tablet: { flex: "none" }
|
|
104
|
-
},
|
|
105
|
-
logoLink: {
|
|
106
|
-
borderRadius: "4",
|
|
107
|
-
color: "text/on-color",
|
|
108
|
-
display: "flex",
|
|
109
|
-
marginBlockEnd: rem(3)
|
|
110
|
-
},
|
|
111
|
-
actions: {
|
|
112
|
-
alignItems: "center",
|
|
113
|
-
display: "flex",
|
|
114
|
-
flexShrink: 0,
|
|
115
|
-
marginInlineStart: "auto",
|
|
116
|
-
tablet: { paddingInlineEnd: "32" }
|
|
117
|
-
},
|
|
118
|
-
banner: { width: "full" },
|
|
119
|
-
control: {
|
|
120
|
-
...controlBase,
|
|
121
|
-
width: "48"
|
|
122
|
-
},
|
|
123
|
-
accountAvatar: {
|
|
124
|
-
borderRadius: "full",
|
|
125
|
-
display: "none",
|
|
126
|
-
overflow: "hidden",
|
|
127
|
-
tablet: { display: "inline-flex" }
|
|
128
|
-
},
|
|
129
|
-
accountIcon: {
|
|
130
|
-
display: "block",
|
|
131
|
-
tablet: { display: "none" }
|
|
132
|
-
},
|
|
133
|
-
navButton: {
|
|
134
|
-
...controlBase,
|
|
135
|
-
paddingBlock: "8",
|
|
136
|
-
paddingInlineEnd: "8",
|
|
137
|
-
paddingInlineStart: "12"
|
|
138
|
-
},
|
|
139
|
-
navButtonBadge: {
|
|
140
|
-
alignItems: "flex-start",
|
|
141
|
-
background: "sys/ui/header/bg",
|
|
142
|
-
borderStartStartRadius: "2",
|
|
143
|
-
color: "icon/on-color",
|
|
144
|
-
display: "flex",
|
|
145
|
-
height: "12",
|
|
146
|
-
insetBlockEnd: "8",
|
|
147
|
-
insetInlineEnd: "8",
|
|
148
|
-
overflow: "hidden",
|
|
149
|
-
pointerEvents: "none",
|
|
150
|
-
position: "absolute",
|
|
151
|
-
width: "16"
|
|
152
|
-
},
|
|
153
|
-
navButtonIcon: {
|
|
154
|
-
flexShrink: 0,
|
|
155
|
-
marginBlockStart: rem(-1),
|
|
156
|
-
marginInlineStart: "1"
|
|
157
|
-
},
|
|
158
|
-
badge: {
|
|
159
|
-
background: "sys/ui/header/badge/red",
|
|
160
|
-
borderRadius: "full",
|
|
161
|
-
height: "8",
|
|
162
|
-
insetBlockStart: "12",
|
|
163
|
-
insetInlineStart: rem(28),
|
|
164
|
-
pointerEvents: "none",
|
|
165
|
-
position: "absolute",
|
|
166
|
-
width: "8",
|
|
167
|
-
"&[data-pulse]": { _after: {
|
|
168
|
-
animation: "ping",
|
|
169
|
-
background: "sys/ui/header/badge/red",
|
|
170
|
-
borderRadius: "full",
|
|
171
|
-
content: "\"\"",
|
|
172
|
-
inset: 0,
|
|
173
|
-
opacity: .5,
|
|
174
|
-
position: "absolute",
|
|
175
|
-
_motionReduce: { animation: "none" }
|
|
176
|
-
} }
|
|
177
|
-
},
|
|
178
|
-
indicator: {
|
|
179
|
-
background: "sys/ui/header/control/indicator",
|
|
180
|
-
height: "4",
|
|
181
|
-
insetBlockEnd: 0,
|
|
182
|
-
insetInline: 0,
|
|
183
|
-
pointerEvents: "none",
|
|
184
|
-
position: "absolute"
|
|
185
|
-
},
|
|
186
|
-
search: {
|
|
187
|
-
display: "flex",
|
|
188
|
-
flexShrink: 0,
|
|
189
|
-
position: "relative"
|
|
190
|
-
},
|
|
191
|
-
searchField: {
|
|
192
|
-
alignItems: "center",
|
|
193
|
-
backgroundColor: "sys/ui/header/bg",
|
|
194
|
-
backgroundImage: `linear-gradient(0deg, ${SEARCH_FIELD_TINT} 0%, ${SEARCH_FIELD_TINT} 100%)`,
|
|
195
|
-
borderColor: "border/strong",
|
|
196
|
-
borderRadius: "4",
|
|
197
|
-
borderStyle: "solid",
|
|
198
|
-
borderWidth: "1",
|
|
199
|
-
display: "none",
|
|
200
|
-
gap: "8",
|
|
201
|
-
height: "40",
|
|
202
|
-
insetBlockStart: "4",
|
|
203
|
-
insetInlineEnd: 0,
|
|
204
|
-
opacity: 0,
|
|
205
|
-
paddingInlineEnd: "12",
|
|
206
|
-
paddingInlineStart: "8",
|
|
207
|
-
position: "absolute",
|
|
208
|
-
transitionDuration: "fast",
|
|
209
|
-
transitionProperty: "opacity, visibility",
|
|
210
|
-
transitionTimingFunction: "ease-out",
|
|
211
|
-
visibility: "hidden",
|
|
212
|
-
width: SEARCH_FIELD_WIDTH,
|
|
213
|
-
"&:has(input:focus-visible)": { boxShadow: "0 0 0 var(--focus-ring-width) var(--focus-ring-color) inset" },
|
|
214
|
-
_open: {
|
|
215
|
-
opacity: 1,
|
|
216
|
-
visibility: "visible"
|
|
217
|
-
},
|
|
218
|
-
_motionReduce: { transitionProperty: "none" },
|
|
219
|
-
tablet: { display: "flex" }
|
|
220
|
-
},
|
|
221
|
-
searchButton: { tablet: { _open: { visibility: "hidden" } } },
|
|
222
|
-
searchClear: {
|
|
223
|
-
color: "icon/on-color",
|
|
224
|
-
flexShrink: 0
|
|
225
|
-
},
|
|
226
|
-
searchIcon: {
|
|
227
|
-
color: "icon/on-color",
|
|
228
|
-
flexShrink: 0
|
|
229
|
-
},
|
|
230
|
-
searchInput: {
|
|
231
|
-
background: "transparent",
|
|
232
|
-
borderWidth: 0,
|
|
233
|
-
color: "text/on-color",
|
|
234
|
-
flex: 1,
|
|
235
|
-
minWidth: 0,
|
|
236
|
-
padding: 0,
|
|
237
|
-
textStyle: "body/lg/regular",
|
|
238
|
-
"&::-webkit-search-cancel-button": { display: "none" },
|
|
239
|
-
_focusVisible: {
|
|
240
|
-
outline: "none",
|
|
241
|
-
outlineWidth: 0
|
|
242
|
-
},
|
|
243
|
-
_placeholder: {
|
|
244
|
-
color: "text/on-color",
|
|
245
|
-
opacity: .6
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
//#endregion
|
|
251
|
-
export { uiHeaderSlotRecipe as default, uiHeaderHeight, uiHeaderHeightPx };
|
|
252
|
-
|
|
253
|
-
//# sourceMappingURL=UIHeader.recipe.js.map
|