@bitrise/bitkit-v2 0.3.492 → 0.3.494

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -8,7 +8,7 @@ If you're contributing to the library itself, see `CLAUDE.md` instead — this f
8
8
 
9
9
  **AI assistants: using the `bitkit-storybook-mcp` MCP server is mandatory before generating Bitkit code.** Memory, naming intuition, and TypeScript types are all secondary sources — hallucinated props are the #1 failure mode of AI-generated Bitkit code. Code generated with the MCP is much more accurate (live prop tables, real variants, real tokens, real examples) and faster (one structured query vs. crawling node_modules) than code generated without it.
10
10
 
11
- If `bitkit-storybook-mcp` isn't in your tools, **mention it once at the start of your turn** and offer the user the option to add it:
11
+ At Bitrise, the `bitrise-engineering-frontend` Claude plugin connects the MCP for you. Everywhere else, if `bitkit-storybook-mcp` isn't in your tools, **mention it once at the start of your turn** and offer the user the option to add it:
12
12
 
13
13
  > Heads up: Bitkit's hosted Storybook MCP isn't configured here. I can still proceed by inferring props and tokens from TypeScript types and the AGENTS.md rules — but with the MCP my output would be substantially more accurate. To enable it, add this to your `.mcp.json` and reload:
14
14
  >
@@ -33,7 +33,7 @@ Once the MCP is available, **query it before using a Bitkit component or token**
33
33
 
34
34
  ## Setup
35
35
 
36
- Wrap your app in `BitkitProvider`:
36
+ Install the latest `@bitrise/bitkit-v2` together with its peer dependencies (`react`, `react-dom`, `@chakra-ui/react`, `@emotion/react`, and `@chakra-ui/cli` as a devDependency — check the package's `peerDependencies` for the pinned versions), then wrap your app in `BitkitProvider`:
37
37
 
38
38
  ```tsx
39
39
  import { BitkitProvider, BitkitButton } from '@bitrise/bitkit-v2';
@@ -43,6 +43,11 @@ import { BitkitProvider, BitkitButton } from '@bitrise/bitkit-v2';
43
43
  </BitkitProvider>
44
44
  ```
45
45
 
46
+ - **Generate the theme types before type-checking.** Bitkit's variant, token and recipe types exist only after Chakra's typegen has run against the Bitkit theme. The package's `postinstall` does it when `@chakra-ui/cli` is installed (a peer dependency; add it as a devDependency); otherwise run `npx chakra typegen node_modules/@bitrise/bitkit-v2/dist/theme/index.js`. If a type error lists Chakra's default variants (`solid`, `outline`, `subtle`, …) instead of Bitkit's, the types weren't generated: fix that, never change the variant to make the error go away.
47
+ - **Check the installed version.** The Storybook MCP documents the latest Bitkit; the version a project actually has is in `node_modules/@bitrise/bitkit-v2/package.json`. If something you need is missing from the installed version, the fix is an upgrade, not a workaround — tell the user rather than bumping it yourself in an existing project.
48
+ - **Never edit `node_modules` or patch Bitkit locally.**
49
+ - **Before you finish, run the checks locally:** generate the theme types, then the project's type-check (or `npx tsc --noEmit`), then its lint if it has one. Fix what fails rather than leaving it for CI.
50
+
46
51
  ## Discovering components
47
52
 
48
53
  - **Hosted Storybook MCP** (required for AI assistants — see "Before you start"): add to your project's `.mcp.json`:
@@ -56,14 +61,19 @@ import { BitkitProvider, BitkitButton } from '@bitrise/bitkit-v2';
56
61
  }
57
62
  }
58
63
  ```
59
- Once configured, agents can call:
60
- - `docs-list` — list all components
61
- - `docs-show` — props and examples for a specific component
62
- - `docs-show-story` — extra detail for a story variant
64
+ Once configured, list all docs once, then read the documentation of each component you use (props, examples, stories). The tool names differ between servers: the local Storybook calls them `docs-list` / `docs-show`, the hosted one `list-all-documentation` / `get-documentation`.
63
65
  - **Hosted Storybook (browser)**: <https://storybook.services.bitrise.dev/projects/bitkit-v2/production/> — every component, props table, examples, and theme reference (colors, shadows, text styles, spacing, radii, icons). Google auth required.
64
66
  - **Never hallucinate component properties.** Verify every prop against the docs before using it. A prop that "sounds right" (e.g. `shadow`, `rightIcon`) often does not exist.
65
67
  - For tokens (colors, shadows, text styles, etc.), query the Storybook docs pages: `Docs/Colors - Components`, `Docs/Colors - System`, `Docs/Colors - Base`, `Docs/Shadows (Box Shadows)`, `Docs/Spacing & Sizes`, `Docs/Radii (Border Radius)`, `Docs/Text Styles`, `Docs/Typography`, `Docs/Icons`.
66
68
 
69
+ ## Building UI
70
+
71
+ - **Don't rebuild what Bitkit has.** Before hand-building a dialog, select, search input, list, table, tabs or empty state from Chakra primitives or HTML, look for the Bitkit component in the MCP. Raw Chakra is for layout and text (`Box`, `Stack`, `Text`) only — never Chakra's own `Button`, `Input`, `Dialog` and the like: the Bitkit theme styles them, so they look right, but they lack Bitkit's API and behaviour.
72
+ - **A whole page starts from the page-level components** — `BitkitPageHeader`, `BitkitUISideNav`, `BitkitPageFooter` — not from a hand-built frame.
73
+ - **Handle every state of a data view.** Anything that shows data needs a loading state (see *Skeleton loading*), an empty state (`BitkitEmptyState`) and an error state (`BitkitAlert`, or `createBitkitToast` for a failed action).
74
+ - **Don't override a Bitkit component's styling** — no `border`, `borderRadius`, `background`, `boxShadow` or `color` fighting its design — and don't pass an empty or placeholder value just to satisfy a required prop. Layout props (`width`, `flex`, `margin*`, …) are fine.
75
+ - **When Bitkit doesn't fit, it's a design-system gap, not a styling task.** Stop and tell the user; the gap gets fixed in Bitkit, once. At Bitrise, report it in #engineering-domain-frontend.
76
+
67
77
  ## Naming conventions
68
78
 
69
79
  Bitkit components use consistent prop names across the library:
@@ -143,9 +153,9 @@ Bitkit components use consistent prop names across the library:
143
153
  - `BitkitStepsDialog` — a multi-step dialog. Pass `BitkitStepsDialog.Step` children (each with `label` for the steps header, `title`/`description` for the step body). It owns the step state and auto-renders the steps header; build the step navigation with the `useStepsDialog()` hook (`{ step, setStep, next, prev, goTo, isFirst, isLast, totalSteps }`) and pass it as `footerButtons`, which the dialog lays out with the leading action opposite the step navigation. A wizard with no leading action just passes the one navigation group and it stays on the right, so never add `marginInlineStart`, `width` or a `justifyContent` at the call site. `footerContent` still renders raw above it. Controlled via `step`/`onStepChange`, or uncontrolled via `defaultStep`.
144
154
  - All three expose `.ActionTrigger` (a thin re-export of Chakra's `Dialog.ActionTrigger`): wrap a footer button in it to close the dialog on click — the default way to dismiss a trigger-based (uncontrolled) dialog without wiring `open` state.
145
155
  ```tsx
146
- <BitkitDialog footerButtons={<><Button variant="secondary">Cancel</Button><Button variant="primary">Save</Button></>} open={open} onOpenChange={…} title="Title">Body</BitkitDialog>
147
- <BitkitFormDialog onSubmit={handleSubmit} open={open} onOpenChange={…} title="Edit" footerButtons={<Button type="submit">Save</Button>}>…fields…</BitkitFormDialog>
148
- <BitkitStepsDialog footerButtons={<StepsNav />} title="Wizard" trigger={<Button>Open</Button>}>
156
+ <BitkitDialog footerButtons={<><BitkitButton variant="secondary">Cancel</BitkitButton><BitkitButton>Save</BitkitButton></>} open={open} onOpenChange={…} title="Title">Body</BitkitDialog>
157
+ <BitkitFormDialog onSubmit={handleSubmit} open={open} onOpenChange={…} title="Edit" footerButtons={<BitkitButton type="submit">Save</BitkitButton>}>…fields…</BitkitFormDialog>
158
+ <BitkitStepsDialog footerButtons={<StepsNav />} title="Wizard" trigger={<BitkitButton>Open</BitkitButton>}>
149
159
  <BitkitStepsDialog.Step label="Account" title="Create account">…</BitkitStepsDialog.Step>
150
160
  <BitkitStepsDialog.Step label="Confirm" title="Confirm">…</BitkitStepsDialog.Step>
151
161
  </BitkitStepsDialog>
@@ -211,7 +221,7 @@ Bitkit components use consistent prop names across the library:
211
221
  - **Always semantic colors** — use semantic tokens (`background/primary`, `text/body`, `border/minimal`, `icon/secondary`). Never palette colors (`purple.50`), system colors (`sys.fg.base`), raw codes (`#fff`), or color names (`white`, `grey`).
212
222
  - **Always use `textStyle`** — never set `fontFamily` or `fontSize` on `<Text>`. Use `textStyle="body/md/regular"`, `textStyle="code/md"`, etc.
213
223
  - **Sizes as strings** — `width="32"`, not `width={32}`. Tokens are strings.
214
- - **Use existing size tokens** — closest existing token (1, 2, 4, 6, 8, 12, 16, 20, 24, 32, 40, 48, 64, 96, 128) representing pixel values (1=1px, 32=32px). Avoid arbitrary px (`width="100px"`).
224
+ - **Use existing size tokens** — closest existing token (1, 2, 4, 6, 8, 12, 16, 20, 24, 32, 40, 48, 64, 96, 128) representing pixel values (1=1px, 32=32px). Avoid arbitrary px (`width="100px"`). Above 128 there is no token: use Bitkit's `rem()` helper (`import { rem } from '@bitrise/bitkit-v2'`, `maxWidth={rem(800)}`), never a bare-number string — `maxWidth="800"` is not a token, reaches the CSS without a unit, and the browser silently drops it.
215
225
  - **Omit default prop values** — `<IconCross />`, not `<IconCross size="24" />` when 24 is the default.
216
226
  - **Never pass `color` to a colored icon** — multi/fixed-color icons (`Icon*Color`, `IconWarningYellow`, `Icon*White`, etc.) have their colors baked in. They omit `color` from their props, so passing it is a type error. Only monochrome icons follow `color` (via `currentColor`).
217
227
  - **No shorthand props** — use full names: `marginInline`, `paddingBlockEnd`, `width`, `background`, `padding`. Never `mx`, `pb`, `w`, `bg`, `p`, `mt`.
@@ -244,7 +254,7 @@ Bitkit components use consistent prop names across the library:
244
254
  - **Avoid the `chakra.*` factory** — `chakra.div`, `chakra.span`, etc. are a last resort. Reach for a named primitive instead: `Box` for layout wrappers (`<Box as="span">` for an inline wrapper), `Text` for text (`<Text as="span">` for inline text), `Stack`/`HStack`/`VStack` for flex layouts. They're typed and forward style props the same way, but keep usage consistent. Only fall back to `chakra.*` when no named primitive fits.
245
255
  - **A sentence with an inline link/icon is one `<Text>`, not a flex `<Box>`** — don't wrap a `<Text>` and a `<BitkitLink>` in a `<Box display="flex" gap="…">`; put the link inline inside the text with a space: `<Text>Visualised using{' '}<BitkitLink suffixIcon={…}>Perfetto UI</BitkitLink></Text>`. Inline Bitkit components (e.g. `BitkitLink` with a `suffixIcon`) already render `inline-flex` and align their own icon, so the flex wrapper is redundant — and inline flow baseline-aligns the text correctly.
246
256
  - **Style a single plain element with `asChild`, not a wrapper `<Box>`** — the "props on the component" rule above only works for elements that forward Chakra style props. A plain DOM element that doesn't (`<iframe>`, `<video>`, `<svg>`, …) can still avoid the extra node: `<Box asChild border="…" width="…" height="…"><iframe …/></Box>` merges the style props onto the child via Slot. Move the child's own inline styles onto the `<Box>`. **Precedence gotcha:** an inline `style={{…}}` on the child beats Chakra's generated classes — a child `style={{ border: 'none' }}` will override `<Box border="…">`, so drop the conflicting inline style when collapsing.
247
- - **Import from Chakra subpaths** — `import { Button } from '@chakra-ui/react/button'`, not `from '@chakra-ui/react'`.
257
+ - **Import from Chakra subpaths** — `import { Box } from '@chakra-ui/react/box'`, not `from '@chakra-ui/react'`.
248
258
 
249
259
  ## Skeleton loading
250
260
 
@@ -232,6 +232,7 @@ var uiHeaderSlotRecipe = defineSlotRecipe({
232
232
  "&:has(input:focus-visible)": { boxShadow: "0 0 0 var(--focus-ring-width) var(--focus-ring-color) inset" },
233
233
  _open: {
234
234
  opacity: 1,
235
+ transitionProperty: "opacity",
235
236
  visibility: "visible"
236
237
  },
237
238
  _motionReduce: { transitionProperty: "none" },
@@ -1 +1 @@
1
- {"version":3,"file":"UIHeader.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/UIHeader.recipe.ts"],"sourcesContent":["import { defineSlotRecipe, type SystemStyleObject } from '@chakra-ui/react/styled-system';\n\nimport { colorVar, rem } from '../themeUtils';\n\n/** `uiHeaderHeight` as a number, for a layout that needs one rather than a token. */\nexport const uiHeaderHeightPx = 48;\n\n/**\n * The height of the header's bar. A page that pins the header reserves this much room for it, and\n * anything anchored under the header starts here: a drawer's backdrop and positioner, a side\n * navigation's `insetBlockStart`.\n *\n * It is the bar alone. A `banner` sits below it inside the header, and its height is the\n * consumer's content, so a pinned header carrying one is taller than this — measure it rather than\n * assume it.\n */\nexport const uiHeaderHeight = rem(uiHeaderHeightPx);\n\nconst SEARCH_FIELD_WIDTH = rem(240);\n\nconst SEARCH_FIELD_TINT = colorVar('color/white/20');\n\nconst controlStates: SystemStyleObject = {\n background: 'sys/ui/header/control/bg',\n _hover: {\n background: 'sys/ui/header/control/bg-hover',\n _active: {\n background: 'sys/ui/header/control/bg-active',\n },\n },\n _active: {\n background: 'sys/ui/header/control/bg-active',\n },\n _selected: {\n background: 'sys/ui/header/control/bg-selected',\n _hover: {\n background: 'sys/ui/header/control/bg-selected-hover',\n _active: {\n background: 'sys/ui/header/control/bg-selected',\n },\n },\n _active: {\n background: 'sys/ui/header/control/bg-selected',\n },\n },\n};\n\nconst controlBase: SystemStyleObject = {\n ...controlStates,\n alignItems: 'center',\n borderRadius: 0,\n color: 'icon/on-color',\n cursor: 'pointer',\n display: 'flex',\n flexShrink: 0,\n height: uiHeaderHeight,\n justifyContent: 'center',\n position: 'relative',\n textDecoration: 'none',\n _focusVisible: {\n outlineOffset: 'calc(var(--focus-ring-width) * -1)',\n },\n};\n\nconst uiHeaderSlotRecipe = defineSlotRecipe({\n className: 'ui-header',\n slots: [\n 'accountAvatar',\n 'accountIcon',\n 'actions',\n 'badge',\n 'banner',\n 'bar',\n 'control',\n 'indicator',\n 'leading',\n 'logoBlock',\n 'logoLink',\n 'modeControl',\n 'modeSwitch',\n 'navButton',\n 'navButtonBadge',\n 'navButtonIcon',\n 'root',\n 'search',\n 'searchButton',\n 'searchClear',\n 'searchField',\n 'searchIcon',\n 'searchInput',\n 'spacer',\n ],\n base: {\n root: {\n background: 'sys/ui/header/bg',\n color: 'text/on-color',\n display: 'flex',\n flexDirection: 'column',\n width: 'full',\n },\n bar: {\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n height: uiHeaderHeight,\n position: 'relative',\n tablet: {\n paddingInlineStart: '20',\n },\n },\n leading: {\n display: 'flex',\n flexShrink: 0,\n tablet: {\n display: 'none',\n },\n },\n spacer: {\n flexShrink: 1,\n width: '48',\n tablet: {\n display: 'none',\n },\n },\n logoBlock: {\n alignItems: 'center',\n display: 'flex',\n flex: 1,\n justifyContent: 'center',\n minWidth: 0,\n tablet: {\n flex: 'none',\n },\n },\n logoLink: {\n borderRadius: '4',\n color: 'text/on-color',\n display: 'flex',\n marginBlockEnd: rem(3),\n },\n actions: {\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n marginInlineStart: 'auto',\n tablet: {\n paddingInlineEnd: '32',\n },\n },\n banner: {\n width: 'full',\n },\n control: {\n ...controlBase,\n width: '48',\n },\n accountAvatar: {\n borderRadius: 'full',\n display: 'none',\n overflow: 'hidden',\n tablet: {\n display: 'inline-flex',\n },\n },\n accountIcon: {\n display: 'block',\n tablet: {\n display: 'none',\n },\n },\n modeSwitch: {\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n _before: {\n background: 'sys/ui/header/separator',\n content: '\"\"',\n height: '20',\n marginInlineEnd: '8',\n marginInlineStart: '12',\n width: '1',\n },\n },\n modeControl: {\n _open: {\n background: 'sys/ui/header/control/bg-active',\n _hover: {\n background: 'sys/ui/header/control/bg-active',\n },\n },\n },\n navButton: {\n ...controlBase,\n paddingBlock: '8',\n paddingInlineEnd: '8',\n paddingInlineStart: '12',\n },\n navButtonBadge: {\n alignItems: 'flex-start',\n background: 'sys/ui/header/bg',\n borderStartStartRadius: '2',\n color: 'icon/on-color',\n display: 'flex',\n height: '12',\n insetBlockEnd: '8',\n insetInlineEnd: '8',\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n width: '16',\n },\n navButtonIcon: {\n flexShrink: 0,\n marginBlockStart: rem(-1),\n marginInlineStart: '1',\n },\n badge: {\n background: 'sys/ui/header/badge/red',\n borderRadius: 'full',\n height: '8',\n insetBlockStart: '12',\n insetInlineStart: rem(28),\n pointerEvents: 'none',\n position: 'absolute',\n width: '8',\n '&[data-pulse]': {\n _after: {\n animation: 'ping',\n background: 'sys/ui/header/badge/red',\n borderRadius: 'full',\n content: '\"\"',\n inset: 0,\n opacity: 0.5,\n position: 'absolute',\n _motionReduce: {\n animation: 'none',\n },\n },\n },\n },\n indicator: {\n background: 'sys/ui/header/control/indicator',\n height: '4',\n insetBlockEnd: 0,\n insetInline: 0,\n pointerEvents: 'none',\n position: 'absolute',\n },\n search: {\n display: 'flex',\n flexShrink: 0,\n position: 'relative',\n },\n searchField: {\n alignItems: 'center',\n backgroundColor: 'sys/ui/header/bg',\n backgroundImage: `linear-gradient(0deg, ${SEARCH_FIELD_TINT} 0%, ${SEARCH_FIELD_TINT} 100%)`,\n borderColor: 'border/strong',\n borderRadius: '4',\n borderStyle: 'solid',\n borderWidth: '1',\n display: 'none',\n gap: '8',\n height: '40',\n insetBlockStart: '4',\n insetInlineEnd: 0,\n opacity: 0,\n paddingInlineEnd: '12',\n paddingInlineStart: '8',\n position: 'absolute',\n transitionDuration: 'fast',\n // `visibility` is what takes the closed field out of hit-testing, the tab order and the\n // accessibility tree in one go. Transitioning it keeps the field visible for the whole fade\n // and flips it at the end, which `opacity` alone could not do.\n transitionProperty: 'opacity, visibility',\n transitionTimingFunction: 'ease-out',\n visibility: 'hidden',\n width: SEARCH_FIELD_WIDTH,\n '&:has(input:focus-visible)': {\n boxShadow: '0 0 0 var(--focus-ring-width) var(--focus-ring-color) inset',\n },\n _open: {\n opacity: 1,\n visibility: 'visible',\n },\n _motionReduce: {\n transitionProperty: 'none',\n },\n tablet: {\n display: 'flex',\n },\n },\n searchButton: {\n tablet: {\n _open: {\n visibility: 'hidden',\n },\n },\n },\n searchClear: {\n color: 'icon/on-color',\n flexShrink: 0,\n },\n searchIcon: {\n color: 'icon/on-color',\n flexShrink: 0,\n },\n searchInput: {\n background: 'transparent',\n borderWidth: 0,\n color: 'text/on-color',\n flex: 1,\n minWidth: 0,\n padding: 0,\n textStyle: 'body/lg/regular',\n '&::-webkit-search-cancel-button': { display: 'none' },\n _focusVisible: {\n outline: 'none',\n outlineWidth: 0,\n },\n _placeholder: {\n color: 'text/on-color',\n opacity: 0.6,\n },\n },\n },\n});\n\nexport default uiHeaderSlotRecipe;\n"],"mappings":";;;;AAKA,IAAa,mBAAmB;;;;;;;;;;AAWhC,IAAa,iBAAiB,IAAA,EAAoB;AAElD,IAAM,qBAAqB,IAAI,GAAG;AAElC,IAAM,oBAAoB,SAAS,gBAAgB;AA2BnD,IAAM,cAAiC;CAxBrC,YAAY;CACZ,QAAQ;EACN,YAAY;EACZ,SAAS,EACP,YAAY,kCACd;CACF;CACA,SAAS,EACP,YAAY,kCACd;CACA,WAAW;EACT,YAAY;EACZ,QAAQ;GACN,YAAY;GACZ,SAAS,EACP,YAAY,oCACd;EACF;EACA,SAAS,EACP,YAAY,oCACd;CACF;CAKA,YAAY;CACZ,cAAc;CACd,OAAO;CACP,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,QAAQ;CACR,gBAAgB;CAChB,UAAU;CACV,gBAAgB;CAChB,eAAe,EACb,eAAe,qCACjB;AACF;AAEA,IAAM,qBAAqB,iBAAiB;CAC1C,WAAW;CACX,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ,MAAM;GACJ,YAAY;GACZ,OAAO;GACP,SAAS;GACT,eAAe;GACf,OAAO;EACT;EACA,KAAK;GACH,YAAY;GACZ,SAAS;GACT,YAAY;GACZ,QAAQ;GACR,UAAU;GACV,QAAQ,EACN,oBAAoB,KACtB;EACF;EACA,SAAS;GACP,SAAS;GACT,YAAY;GACZ,QAAQ,EACN,SAAS,OACX;EACF;EACA,QAAQ;GACN,YAAY;GACZ,OAAO;GACP,QAAQ,EACN,SAAS,OACX;EACF;EACA,WAAW;GACT,YAAY;GACZ,SAAS;GACT,MAAM;GACN,gBAAgB;GAChB,UAAU;GACV,QAAQ,EACN,MAAM,OACR;EACF;EACA,UAAU;GACR,cAAc;GACd,OAAO;GACP,SAAS;GACT,gBAAgB,IAAI,CAAC;EACvB;EACA,SAAS;GACP,YAAY;GACZ,SAAS;GACT,YAAY;GACZ,mBAAmB;GACnB,QAAQ,EACN,kBAAkB,KACpB;EACF;EACA,QAAQ,EACN,OAAO,OACT;EACA,SAAS;GACP,GAAG;GACH,OAAO;EACT;EACA,eAAe;GACb,cAAc;GACd,SAAS;GACT,UAAU;GACV,QAAQ,EACN,SAAS,cACX;EACF;EACA,aAAa;GACX,SAAS;GACT,QAAQ,EACN,SAAS,OACX;EACF;EACA,YAAY;GACV,YAAY;GACZ,SAAS;GACT,YAAY;GACZ,SAAS;IACP,YAAY;IACZ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oB,OACtB;GACA,QAAQ,EACN,SAAS,OACX;EACF;EACA,cAAc,EACZ,QAAQ,EACN,OAAO,EACL,YAAY,SACd,EACF,EACF;EACA,aAAa;GACX,OAAO;GACP,YAAY;EACd;EACA,YAAY;GACV,OAAO;GACP,YAAY;EACd;EACA,aAAa;GACX,YAAY;GACZ,aAAa;GACb,OAAO;GACP,MAAM;GACN,UAAU;GACV,SAAS;GACT,WAAW;GACX,mCAAmC,EAAE,SAAS,OAAO;GACrD,eAAe;IACb,SAAS;IACT,cAAc;GAChB;GACA,cAAc;IACZ,OAAO;IACP,SAAS;GACX;EACF;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"UIHeader.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/UIHeader.recipe.ts"],"sourcesContent":["import { defineSlotRecipe, type SystemStyleObject } from '@chakra-ui/react/styled-system';\n\nimport { colorVar, rem } from '../themeUtils';\n\n/** `uiHeaderHeight` as a number, for a layout that needs one rather than a token. */\nexport const uiHeaderHeightPx = 48;\n\n/**\n * The height of the header's bar. A page that pins the header reserves this much room for it, and\n * anything anchored under the header starts here: a drawer's backdrop and positioner, a side\n * navigation's `insetBlockStart`.\n *\n * It is the bar alone. A `banner` sits below it inside the header, and its height is the\n * consumer's content, so a pinned header carrying one is taller than this — measure it rather than\n * assume it.\n */\nexport const uiHeaderHeight = rem(uiHeaderHeightPx);\n\nconst SEARCH_FIELD_WIDTH = rem(240);\n\nconst SEARCH_FIELD_TINT = colorVar('color/white/20');\n\nconst controlStates: SystemStyleObject = {\n background: 'sys/ui/header/control/bg',\n _hover: {\n background: 'sys/ui/header/control/bg-hover',\n _active: {\n background: 'sys/ui/header/control/bg-active',\n },\n },\n _active: {\n background: 'sys/ui/header/control/bg-active',\n },\n _selected: {\n background: 'sys/ui/header/control/bg-selected',\n _hover: {\n background: 'sys/ui/header/control/bg-selected-hover',\n _active: {\n background: 'sys/ui/header/control/bg-selected',\n },\n },\n _active: {\n background: 'sys/ui/header/control/bg-selected',\n },\n },\n};\n\nconst controlBase: SystemStyleObject = {\n ...controlStates,\n alignItems: 'center',\n borderRadius: 0,\n color: 'icon/on-color',\n cursor: 'pointer',\n display: 'flex',\n flexShrink: 0,\n height: uiHeaderHeight,\n justifyContent: 'center',\n position: 'relative',\n textDecoration: 'none',\n _focusVisible: {\n outlineOffset: 'calc(var(--focus-ring-width) * -1)',\n },\n};\n\nconst uiHeaderSlotRecipe = defineSlotRecipe({\n className: 'ui-header',\n slots: [\n 'accountAvatar',\n 'accountIcon',\n 'actions',\n 'badge',\n 'banner',\n 'bar',\n 'control',\n 'indicator',\n 'leading',\n 'logoBlock',\n 'logoLink',\n 'modeControl',\n 'modeSwitch',\n 'navButton',\n 'navButtonBadge',\n 'navButtonIcon',\n 'root',\n 'search',\n 'searchButton',\n 'searchClear',\n 'searchField',\n 'searchIcon',\n 'searchInput',\n 'spacer',\n ],\n base: {\n root: {\n background: 'sys/ui/header/bg',\n color: 'text/on-color',\n display: 'flex',\n flexDirection: 'column',\n width: 'full',\n },\n bar: {\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n height: uiHeaderHeight,\n position: 'relative',\n tablet: {\n paddingInlineStart: '20',\n },\n },\n leading: {\n display: 'flex',\n flexShrink: 0,\n tablet: {\n display: 'none',\n },\n },\n spacer: {\n flexShrink: 1,\n width: '48',\n tablet: {\n display: 'none',\n },\n },\n logoBlock: {\n alignItems: 'center',\n display: 'flex',\n flex: 1,\n justifyContent: 'center',\n minWidth: 0,\n tablet: {\n flex: 'none',\n },\n },\n logoLink: {\n borderRadius: '4',\n color: 'text/on-color',\n display: 'flex',\n marginBlockEnd: rem(3),\n },\n actions: {\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n marginInlineStart: 'auto',\n tablet: {\n paddingInlineEnd: '32',\n },\n },\n banner: {\n width: 'full',\n },\n control: {\n ...controlBase,\n width: '48',\n },\n accountAvatar: {\n borderRadius: 'full',\n display: 'none',\n overflow: 'hidden',\n tablet: {\n display: 'inline-flex',\n },\n },\n accountIcon: {\n display: 'block',\n tablet: {\n display: 'none',\n },\n },\n modeSwitch: {\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n _before: {\n background: 'sys/ui/header/separator',\n content: '\"\"',\n height: '20',\n marginInlineEnd: '8',\n marginInlineStart: '12',\n width: '1',\n },\n },\n modeControl: {\n _open: {\n background: 'sys/ui/header/control/bg-active',\n _hover: {\n background: 'sys/ui/header/control/bg-active',\n },\n },\n },\n navButton: {\n ...controlBase,\n paddingBlock: '8',\n paddingInlineEnd: '8',\n paddingInlineStart: '12',\n },\n navButtonBadge: {\n alignItems: 'flex-start',\n background: 'sys/ui/header/bg',\n borderStartStartRadius: '2',\n color: 'icon/on-color',\n display: 'flex',\n height: '12',\n insetBlockEnd: '8',\n insetInlineEnd: '8',\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n width: '16',\n },\n navButtonIcon: {\n flexShrink: 0,\n marginBlockStart: rem(-1),\n marginInlineStart: '1',\n },\n badge: {\n background: 'sys/ui/header/badge/red',\n borderRadius: 'full',\n height: '8',\n insetBlockStart: '12',\n insetInlineStart: rem(28),\n pointerEvents: 'none',\n position: 'absolute',\n width: '8',\n '&[data-pulse]': {\n _after: {\n animation: 'ping',\n background: 'sys/ui/header/badge/red',\n borderRadius: 'full',\n content: '\"\"',\n inset: 0,\n opacity: 0.5,\n position: 'absolute',\n _motionReduce: {\n animation: 'none',\n },\n },\n },\n },\n indicator: {\n background: 'sys/ui/header/control/indicator',\n height: '4',\n insetBlockEnd: 0,\n insetInline: 0,\n pointerEvents: 'none',\n position: 'absolute',\n },\n search: {\n display: 'flex',\n flexShrink: 0,\n position: 'relative',\n },\n searchField: {\n alignItems: 'center',\n backgroundColor: 'sys/ui/header/bg',\n backgroundImage: `linear-gradient(0deg, ${SEARCH_FIELD_TINT} 0%, ${SEARCH_FIELD_TINT} 100%)`,\n borderColor: 'border/strong',\n borderRadius: '4',\n borderStyle: 'solid',\n borderWidth: '1',\n display: 'none',\n gap: '8',\n height: '40',\n insetBlockStart: '4',\n insetInlineEnd: 0,\n opacity: 0,\n paddingInlineEnd: '12',\n paddingInlineStart: '8',\n position: 'absolute',\n transitionDuration: 'fast',\n // `visibility` is what takes the closed field out of hit-testing, the tab order and the\n // accessibility tree in one go. Transitioning it keeps the field visible for the whole fade\n // and flips it at the end, which `opacity` alone could not do.\n transitionProperty: 'opacity, visibility',\n transitionTimingFunction: 'ease-out',\n visibility: 'hidden',\n width: SEARCH_FIELD_WIDTH,\n '&:has(input:focus-visible)': {\n boxShadow: '0 0 0 var(--focus-ring-width) var(--focus-ring-color) inset',\n },\n _open: {\n opacity: 1,\n // Opening flips `visibility` at once: mid-transition it still computes as `hidden`, and the\n // input it holds could not take focus on open.\n transitionProperty: 'opacity',\n visibility: 'visible',\n },\n _motionReduce: {\n transitionProperty: 'none',\n },\n tablet: {\n display: 'flex',\n },\n },\n searchButton: {\n tablet: {\n _open: {\n visibility: 'hidden',\n },\n },\n },\n searchClear: {\n color: 'icon/on-color',\n flexShrink: 0,\n },\n searchIcon: {\n color: 'icon/on-color',\n flexShrink: 0,\n },\n searchInput: {\n background: 'transparent',\n borderWidth: 0,\n color: 'text/on-color',\n flex: 1,\n minWidth: 0,\n padding: 0,\n textStyle: 'body/lg/regular',\n '&::-webkit-search-cancel-button': { display: 'none' },\n _focusVisible: {\n outline: 'none',\n outlineWidth: 0,\n },\n _placeholder: {\n color: 'text/on-color',\n opacity: 0.6,\n },\n },\n },\n});\n\nexport default uiHeaderSlotRecipe;\n"],"mappings":";;;;AAKA,IAAa,mBAAmB;;;;;;;;;;AAWhC,IAAa,iBAAiB,IAAA,EAAoB;AAElD,IAAM,qBAAqB,IAAI,GAAG;AAElC,IAAM,oBAAoB,SAAS,gBAAgB;AA2BnD,IAAM,cAAiC;CAxBrC,YAAY;CACZ,QAAQ;EACN,YAAY;EACZ,SAAS,EACP,YAAY,kCACd;CACF;CACA,SAAS,EACP,YAAY,kCACd;CACA,WAAW;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;GACA,OAAO;IACL,SAAS;IAGT,oBAAoB;IACpB,YAAY;GACd;GACA,eAAe,EACb,oBAAoB,OACtB;GACA,QAAQ,EACN,SAAS,OACX;EACF;EACA,cAAc,EACZ,QAAQ,EACN,OAAO,EACL,YAAY,SACd,EACF,EACF;EACA,aAAa;GACX,OAAO;GACP,YAAY;EACd;EACA,YAAY;GACV,OAAO;GACP,YAAY;EACd;EACA,aAAa;GACX,YAAY;GACZ,aAAa;GACb,OAAO;GACP,MAAM;GACN,UAAU;GACV,SAAS;GACT,WAAW;GACX,mCAAmC,EAAE,SAAS,OAAO;GACrD,eAAe;IACb,SAAS;IACT,cAAc;GAChB;GACA,cAAc;IACZ,OAAO;IACP,SAAS;GACX;EACF;CACF;AACF,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit-v2",
3
3
  "private": false,
4
- "version": "0.3.492",
4
+ "version": "0.3.494",
5
5
  "description": "Bitrise Design System Components built with Chakra UI V3",
6
6
  "keywords": [
7
7
  "react",