@bitrise/bitkit-v2 0.3.535 → 0.3.537

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.
@@ -23,6 +23,7 @@ type BitkitSelectMenuActionCommonProps = {
23
23
  export type BitkitSelectMenuActionAsButtonProps = BitkitSelectMenuActionCommonProps & {
24
24
  href?: undefined;
25
25
  isExternal?: undefined;
26
+ /** Runs before the menu closes. Clicking an action always closes the menu. */
26
27
  onClick: () => void;
27
28
  };
28
29
  export type BitkitSelectMenuActionAsAnchorProps = BitkitSelectMenuActionCommonProps & {
@@ -21,6 +21,10 @@ var actionStepKeys = {
21
21
  var BitkitSelectMenuAction = (props) => {
22
22
  const { colorVariant, href, icon: Icon, label, onClick, state, tooltip } = props;
23
23
  const { api, iconSize, styles } = useSelectMenuShellContext();
24
+ const handleClick = () => {
25
+ onClick?.();
26
+ api.setOpen(false);
27
+ };
24
28
  const rowProps = {
25
29
  "data-color-variant": colorVariant,
26
30
  "data-select-menu-action": "",
@@ -69,7 +73,7 @@ var BitkitSelectMenuAction = (props) => {
69
73
  target: effectiveTarget,
70
74
  rel: effectiveRel,
71
75
  css: styles.action,
72
- onClick,
76
+ onClick: handleClick,
73
77
  ...rowProps,
74
78
  children: content
75
79
  }));
@@ -77,7 +81,7 @@ var BitkitSelectMenuAction = (props) => {
77
81
  return asRow(/* @__PURE__ */ jsx(chakra.button, {
78
82
  type: "button",
79
83
  css: styles.action,
80
- onClick,
84
+ onClick: handleClick,
81
85
  ...rowProps,
82
86
  children: content
83
87
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"BitkitSelectMenuAction.js","names":["_Fragment"],"sources":["../../../lib/components/BitkitSelectMenu/BitkitSelectMenuAction.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { type ListCollection } from '@chakra-ui/react/collection';\nimport { chakra, type SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { type KeyboardEvent as ReactKeyboardEvent, type ReactElement } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\ntype BitkitSelectMenuActionCommonProps = {\n /** `ai` colors the icon for an AI action. A disabled action keeps the disabled icon color. */\n colorVariant?: 'ai';\n icon: BitkitIconComponent;\n label: string;\n /**\n * A disabled action stays focusable and keeps taking pointer events (`aria-disabled`, not the\n * native attribute), so the `tooltip` saying why it is unavailable is still reachable. Natively\n * disabled it would be neither hoverable nor tabbable, hiding the explanation in the one state\n * that needs it.\n *\n * This is the only disabled affordance in the menus: an option a user cannot pick is left out\n * of the collection instead, never dimmed.\n */\n state?: 'disabled';\n /** Hover and focus tooltip on the row. On a disabled action, say why it is unavailable. */\n tooltip?: string;\n};\n\nexport type BitkitSelectMenuActionAsButtonProps = BitkitSelectMenuActionCommonProps & {\n href?: undefined;\n isExternal?: undefined;\n onClick: () => void;\n};\n\nexport type BitkitSelectMenuActionAsAnchorProps = BitkitSelectMenuActionCommonProps & {\n href: string;\n isExternal?: boolean;\n onClick?: () => void;\n rel?: string;\n target?: string;\n};\n\nexport type BitkitSelectMenuActionProps = BitkitSelectMenuActionAsButtonProps | BitkitSelectMenuActionAsAnchorProps;\n\nexport type BitkitSelectMenuActionChild = ReactElement<BitkitSelectMenuActionProps> | false | null;\n\nexport type BitkitSelectMenuActionChildren = BitkitSelectMenuActionChild | BitkitSelectMenuActionChild[];\n\nexport type SelectMenuApi = {\n clearHighlightValue: () => void;\n collection: Pick<ListCollection<{ value: string }>, 'firstValue' | 'lastValue'>;\n setHighlightValue: (value: string) => void;\n setOpen: (open: boolean) => void;\n};\n\ntype SelectMenuShellContext = {\n api: SelectMenuApi;\n iconSize: '16' | '24';\n styles: Record<string, SystemStyleObject>;\n};\n\nconst [SelectMenuShellContextProvider, useSelectMenuShellContext] = createContext<SelectMenuShellContext>({\n name: 'SelectMenuShellContext',\n hookName: 'useSelectMenuShellContext',\n providerName:\n '<BitkitSelectMenu />, <BitkitMultiselectMenu />, <BitkitSelect />, <BitkitMultiselect />, or <BitkitCombobox />',\n});\n\nexport { SelectMenuShellContextProvider };\n\nconst listEdgeKeys: Record<string, 'firstValue' | 'lastValue' | undefined> = {\n ArrowDown: 'firstValue',\n ArrowUp: 'lastValue',\n End: 'lastValue',\n Home: 'firstValue',\n};\n\nconst actionStepKeys: Record<string, 1 | -1 | undefined> = {\n ArrowDown: 1,\n ArrowUp: -1,\n};\n\nconst BitkitSelectMenuAction = (props: BitkitSelectMenuActionProps) => {\n const { colorVariant, href, icon: Icon, label, onClick, state, tooltip } = props;\n const { api, iconSize, styles } = useSelectMenuShellContext();\n\n const rowProps = {\n 'data-color-variant': colorVariant,\n 'data-select-menu-action': '',\n onFocus: api.clearHighlightValue,\n onKeyDown: (event: ReactKeyboardEvent) => {\n if (event.key === 'Tab' || event.key === 'Escape') return;\n event.stopPropagation();\n\n // Up and Down step between the actions first, and leave them for the list only past the first\n // or the last one.\n const step = actionStepKeys[event.key];\n if (step) {\n const actions = Array.from(\n event.currentTarget\n .closest('[data-select-menu-actions]')\n ?.querySelectorAll<HTMLElement>('[data-select-menu-action]') ?? [],\n );\n const next = actions[actions.indexOf(event.currentTarget as HTMLElement) + step];\n if (next) {\n event.preventDefault();\n next.focus();\n return;\n }\n }\n\n const edge = listEdgeKeys[event.key];\n const value = edge && api.collection[edge];\n if (!value) return;\n\n event.preventDefault();\n const content = event.currentTarget.closest<HTMLElement>('[data-part=\"content\"]');\n (content?.querySelector<HTMLElement>('input') ?? content)?.focus();\n api.setHighlightValue(value);\n },\n };\n\n const content = (\n <>\n <Icon size={iconSize} />\n {label}\n </>\n );\n\n const asRow = (row: ReactElement) => (tooltip ? <BitkitTooltip text={tooltip}>{row}</BitkitTooltip> : row);\n\n if (state === 'disabled') {\n return asRow(\n // A button even for an `href` action: dropping the attribute is the only thing that stops a\n // middle click or \"open link in new tab\" from navigating anyway, and an anchor without one\n // leaves the tab order, taking the tooltip with it.\n <chakra.button\n type=\"button\"\n aria-disabled=\"true\"\n css={styles.action}\n // `_disabled` matches `[aria-disabled=true]` by itself, but `_hover`/`_active` only\n // exclude `:disabled` and `[data-disabled]`, so without this the row still lights up.\n data-disabled=\"\"\n {...rowProps}\n >\n {content}\n </chakra.button>,\n );\n }\n\n if (href !== undefined) {\n const { isExternal, rel, target } = props;\n const effectiveTarget = isExternal ? '_blank' : target;\n const effectiveRel = isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel;\n\n return asRow(\n <chakra.a\n href={href}\n target={effectiveTarget}\n rel={effectiveRel}\n css={styles.action}\n onClick={onClick}\n {...rowProps}\n >\n {content}\n </chakra.a>,\n );\n }\n\n return asRow(\n <chakra.button type=\"button\" css={styles.action} onClick={onClick} {...rowProps}>\n {content}\n </chakra.button>,\n );\n};\n\nBitkitSelectMenuAction.displayName = 'BitkitSelectMenu.Action';\n\nexport default BitkitSelectMenuAction;\n"],"mappings":";;;;;AA6DA,IAAM,CAAC,gCAAgC,6BAA6B,cAAsC;CACxG,MAAM;CACN,UAAU;CACV,cACE;AACJ,CAAC;AAID,IAAM,eAAuE;CAC3E,WAAW;CACX,SAAS;CACT,KAAK;CACL,MAAM;AACR;AAEA,IAAM,iBAAqD;CACzD,WAAW;CACX,SAAS;AACX;AAEA,IAAM,0BAA0B,UAAuC;CACrE,MAAM,EAAE,cAAc,MAAM,MAAM,MAAM,OAAO,SAAS,OAAO,YAAY;CAC3E,MAAM,EAAE,KAAK,UAAU,WAAW,0BAA0B;CAE5D,MAAM,WAAW;EACf,sBAAsB;EACtB,2BAA2B;EAC3B,SAAS,IAAI;EACb,YAAY,UAA8B;GACxC,IAAI,MAAM,QAAQ,SAAS,MAAM,QAAQ,UAAU;GACnD,MAAM,gBAAgB;GAItB,MAAM,OAAO,eAAe,MAAM;GAClC,IAAI,MAAM;IACR,MAAM,UAAU,MAAM,KACpB,MAAM,cACH,QAAQ,4BAA4B,CAAC,EACpC,iBAA8B,2BAA2B,KAAK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components/BitkitSelectMenu/BitkitSelectMenuAction.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { type ListCollection } from '@chakra-ui/react/collection';\nimport { chakra, type SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { type KeyboardEvent as ReactKeyboardEvent, type ReactElement } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport BitkitTooltip from '../BitkitTooltip/BitkitTooltip';\n\ntype BitkitSelectMenuActionCommonProps = {\n /** `ai` colors the icon for an AI action. A disabled action keeps the disabled icon color. */\n colorVariant?: 'ai';\n icon: BitkitIconComponent;\n label: string;\n /**\n * A disabled action stays focusable and keeps taking pointer events (`aria-disabled`, not the\n * native attribute), so the `tooltip` saying why it is unavailable is still reachable. Natively\n * disabled it would be neither hoverable nor tabbable, hiding the explanation in the one state\n * that needs it.\n *\n * This is the only disabled affordance in the menus: an option a user cannot pick is left out\n * of the collection instead, never dimmed.\n */\n state?: 'disabled';\n /** Hover and focus tooltip on the row. On a disabled action, say why it is unavailable. */\n tooltip?: string;\n};\n\nexport type BitkitSelectMenuActionAsButtonProps = BitkitSelectMenuActionCommonProps & {\n href?: undefined;\n isExternal?: undefined;\n /** Runs before the menu closes. Clicking an action always closes the menu. */\n onClick: () => void;\n};\n\nexport type BitkitSelectMenuActionAsAnchorProps = BitkitSelectMenuActionCommonProps & {\n href: string;\n isExternal?: boolean;\n onClick?: () => void;\n rel?: string;\n target?: string;\n};\n\nexport type BitkitSelectMenuActionProps = BitkitSelectMenuActionAsButtonProps | BitkitSelectMenuActionAsAnchorProps;\n\nexport type BitkitSelectMenuActionChild = ReactElement<BitkitSelectMenuActionProps> | false | null;\n\nexport type BitkitSelectMenuActionChildren = BitkitSelectMenuActionChild | BitkitSelectMenuActionChild[];\n\nexport type SelectMenuApi = {\n clearHighlightValue: () => void;\n collection: Pick<ListCollection<{ value: string }>, 'firstValue' | 'lastValue'>;\n setHighlightValue: (value: string) => void;\n setOpen: (open: boolean) => void;\n};\n\ntype SelectMenuShellContext = {\n api: SelectMenuApi;\n iconSize: '16' | '24';\n styles: Record<string, SystemStyleObject>;\n};\n\nconst [SelectMenuShellContextProvider, useSelectMenuShellContext] = createContext<SelectMenuShellContext>({\n name: 'SelectMenuShellContext',\n hookName: 'useSelectMenuShellContext',\n providerName:\n '<BitkitSelectMenu />, <BitkitMultiselectMenu />, <BitkitSelect />, <BitkitMultiselect />, or <BitkitCombobox />',\n});\n\nexport { SelectMenuShellContextProvider };\n\nconst listEdgeKeys: Record<string, 'firstValue' | 'lastValue' | undefined> = {\n ArrowDown: 'firstValue',\n ArrowUp: 'lastValue',\n End: 'lastValue',\n Home: 'firstValue',\n};\n\nconst actionStepKeys: Record<string, 1 | -1 | undefined> = {\n ArrowDown: 1,\n ArrowUp: -1,\n};\n\nconst BitkitSelectMenuAction = (props: BitkitSelectMenuActionProps) => {\n const { colorVariant, href, icon: Icon, label, onClick, state, tooltip } = props;\n const { api, iconSize, styles } = useSelectMenuShellContext();\n\n const handleClick = () => {\n onClick?.();\n api.setOpen(false);\n };\n\n const rowProps = {\n 'data-color-variant': colorVariant,\n 'data-select-menu-action': '',\n onFocus: api.clearHighlightValue,\n onKeyDown: (event: ReactKeyboardEvent) => {\n if (event.key === 'Tab' || event.key === 'Escape') return;\n event.stopPropagation();\n\n // Up and Down step between the actions first, and leave them for the list only past the first\n // or the last one.\n const step = actionStepKeys[event.key];\n if (step) {\n const actions = Array.from(\n event.currentTarget\n .closest('[data-select-menu-actions]')\n ?.querySelectorAll<HTMLElement>('[data-select-menu-action]') ?? [],\n );\n const next = actions[actions.indexOf(event.currentTarget as HTMLElement) + step];\n if (next) {\n event.preventDefault();\n next.focus();\n return;\n }\n }\n\n const edge = listEdgeKeys[event.key];\n const value = edge && api.collection[edge];\n if (!value) return;\n\n event.preventDefault();\n const content = event.currentTarget.closest<HTMLElement>('[data-part=\"content\"]');\n (content?.querySelector<HTMLElement>('input') ?? content)?.focus();\n api.setHighlightValue(value);\n },\n };\n\n const content = (\n <>\n <Icon size={iconSize} />\n {label}\n </>\n );\n\n const asRow = (row: ReactElement) => (tooltip ? <BitkitTooltip text={tooltip}>{row}</BitkitTooltip> : row);\n\n if (state === 'disabled') {\n return asRow(\n // A button even for an `href` action: dropping the attribute is the only thing that stops a\n // middle click or \"open link in new tab\" from navigating anyway, and an anchor without one\n // leaves the tab order, taking the tooltip with it.\n <chakra.button\n type=\"button\"\n aria-disabled=\"true\"\n css={styles.action}\n // `_disabled` matches `[aria-disabled=true]` by itself, but `_hover`/`_active` only\n // exclude `:disabled` and `[data-disabled]`, so without this the row still lights up.\n data-disabled=\"\"\n {...rowProps}\n >\n {content}\n </chakra.button>,\n );\n }\n\n if (href !== undefined) {\n const { isExternal, rel, target } = props;\n const effectiveTarget = isExternal ? '_blank' : target;\n const effectiveRel = isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel;\n\n return asRow(\n <chakra.a\n href={href}\n target={effectiveTarget}\n rel={effectiveRel}\n css={styles.action}\n onClick={handleClick}\n {...rowProps}\n >\n {content}\n </chakra.a>,\n );\n }\n\n return asRow(\n <chakra.button type=\"button\" css={styles.action} onClick={handleClick} {...rowProps}>\n {content}\n </chakra.button>,\n );\n};\n\nBitkitSelectMenuAction.displayName = 'BitkitSelectMenu.Action';\n\nexport default BitkitSelectMenuAction;\n"],"mappings":";;;;;AA8DA,IAAM,CAAC,gCAAgC,6BAA6B,cAAsC;CACxG,MAAM;CACN,UAAU;CACV,cACE;AACJ,CAAC;AAID,IAAM,eAAuE;CAC3E,WAAW;CACX,SAAS;CACT,KAAK;CACL,MAAM;AACR;AAEA,IAAM,iBAAqD;CACzD,WAAW;CACX,SAAS;AACX;AAEA,IAAM,0BAA0B,UAAuC;CACrE,MAAM,EAAE,cAAc,MAAM,MAAM,MAAM,OAAO,SAAS,OAAO,YAAY;CAC3E,MAAM,EAAE,KAAK,UAAU,WAAW,0BAA0B;CAE5D,MAAM,oBAAoB;EACx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G,OAAO,MACL,oBAAC,OAAO,GAAR;GACQ;GACN,QAAQ;GACR,KAAK;GACL,KAAK,OAAO;GACZ,SAAS;GACT,GAAI;GAEH,UAAA;EACO,CAAA,CACZ;CACF;CAEA,OAAO,MACL,oBAAC,OAAO,QAAR;EAAe,MAAK;EAAS,KAAK,OAAO;EAAQ,SAAS;EAAa,GAAI;EACxE,UAAA;CACY,CAAA,CACjB;AACF;AAEA,uBAAuB,cAAc"}
@@ -69,6 +69,7 @@ var linkCardSlotRecipe = defineSlotRecipe({
69
69
  title: {
70
70
  color: "text/primary",
71
71
  textStyle: "body/xl/semibold",
72
+ textWrap: "pretty",
72
73
  _groupHover: textActive,
73
74
  _groupFocusVisible: textActive
74
75
  },
@@ -1 +1 @@
1
- {"version":3,"file":"LinkCard.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/LinkCard.recipe.ts"],"sourcesContent":["import { cardAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\n// BitkitLinkCard is a `Card` (elevation off, `sm` padding below tablet and `lg` from tablet up):\n// background, border, body padding and the footer's divider come from the card recipe. This recipe\n// only adds what the link card does differently: a larger radius, an inset divider, the hover state\n// and its own content.\n//\n// The whole card is one link, so hover and keyboard focus read the same: the root reacts with\n// `_hover` / `_focusVisible`, and its parts follow through the `group` class on the root.\n//\n// `variant` is a layout variant: the icon and product cards differ in their visual and, from tablet\n// up, in the size of the body text.\nconst linkCardAnatomy = cardAnatomy.extendWith('iconTile', 'textBlock', 'actionLabel', 'actionIcon');\n\nconst rootActive = {\n borderColor: 'border/hover',\n boxShadow: 'elevation/md',\n};\n\nconst textActive = { color: 'text/link-hover' };\n\nconst iconTileActive = {\n backgroundColor: 'background/selected-hover',\n color: 'icon/interactive',\n};\n\nconst linkCardSlotRecipe = defineSlotRecipe({\n className: 'link-card',\n slots: linkCardAnatomy.keys(),\n base: {\n root: {\n borderRadius: '12',\n color: 'text/primary',\n display: 'flex',\n flexDirection: 'column',\n maxWidth: 'layout/maxWidth/480',\n overflow: 'clip',\n textDecoration: 'none',\n _hover: rootActive,\n _focusVisible: rootActive,\n },\n body: {\n display: 'flex',\n flex: '1',\n flexDirection: 'column',\n gap: { base: '12', tablet: '16' },\n minHeight: 0,\n // The design keeps the content 24px off the trailing edge at every size, also where the card's\n // padding is 16. Responsive for the same reason as the footer's padding.\n paddingInlineEnd: { base: '24', tablet: '24' },\n },\n iconTile: {\n alignItems: 'center',\n alignSelf: 'flex-start',\n backgroundColor: 'background/tertiary',\n borderRadius: { base: '8', tablet: '10' },\n color: 'icon/secondary',\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n padding: '8',\n '& > svg': {\n boxSize: { base: '24', tablet: '32' },\n },\n _groupHover: iconTileActive,\n _groupFocusVisible: iconTileActive,\n },\n textBlock: {\n display: 'flex',\n flexDirection: 'column',\n gap: '6',\n overflowWrap: 'anywhere',\n },\n title: {\n color: 'text/primary',\n textStyle: 'body/xl/semibold',\n _groupHover: textActive,\n _groupFocusVisible: textActive,\n },\n description: {\n color: 'text/secondary',\n textStyle: 'body/lg/regular',\n },\n // The card's footer runs its divider edge to edge; the design insets it to the body's padding.\n // The padding is responsive on purpose: the card's own footer padding comes from a responsive\n // `paddingSize`, so a plain value here would lose to its breakpoint rule from tablet up.\n footer: {\n alignItems: 'center',\n display: 'flex',\n gap: '4',\n marginInline: { base: '16', tablet: '24' },\n paddingBlock: { base: '16', tablet: '24' },\n paddingInlineEnd: { base: '8', tablet: '8' },\n paddingInlineStart: { base: '0', tablet: '0' },\n },\n actionLabel: {\n color: 'text/link',\n flex: '1',\n minWidth: 0,\n textStyle: 'body/lg/regular',\n _groupHover: textActive,\n _groupFocusVisible: textActive,\n },\n actionIcon: {\n color: 'icon/interactive',\n flexShrink: 0,\n opacity: 0,\n _groupHover: { opacity: 1 },\n _groupFocusVisible: { opacity: 1 },\n },\n },\n variants: {\n variant: {\n icon: {},\n // The visual is a BitkitProductThumbnail, which brings its own size, radius and background.\n product: {\n description: {\n textStyle: { base: 'body/lg/regular', tablet: 'body/md/regular' },\n },\n },\n },\n },\n defaultVariants: {\n variant: 'icon',\n },\n});\n\nexport default linkCardSlotRecipe;\n"],"mappings":";;;AAaA,IAAM,kBAAkB,YAAY,WAAW,YAAY,aAAa,eAAe,YAAY;AAEnG,IAAM,aAAa;CACjB,aAAa;CACb,WAAW;AACb;AAEA,IAAM,aAAa,EAAE,OAAO,kBAAkB;AAE9C,IAAM,iBAAiB;CACrB,iBAAiB;CACjB,OAAO;AACT;AAEA,IAAM,qBAAqB,iBAAiB;CAC1C,WAAW;CACX,OAAO,gBAAgB,KAAK;CAC5B,MAAM;EACJ,MAAM;GACJ,cAAc;GACd,OAAO;GACP,SAAS;GACT,eAAe;GACf,UAAU;GACV,UAAU;GACV,gBAAgB;GAChB,QAAQ;GACR,eAAe;EACjB;EACA,MAAM;GACJ,SAAS;GACT,MAAM;GACN,eAAe;GACf,KAAK;IAAE,MAAM;IAAM,QAAQ;GAAK;GAChC,WAAW;GAGX,kBAAkB;IAAE,MAAM;IAAM,QAAQ;GAAK;EAC/C;EACA,UAAU;GACR,YAAY;GACZ,WAAW;GACX,iBAAiB;GACjB,cAAc;IAAE,MAAM;IAAK,QAAQ;GAAK;GACxC,OAAO;GACP,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,SAAS;GACT,WAAW,EACT,SAAS;IAAE,MAAM;IAAM,QAAQ;GAAK,EACtC;GACA,aAAa;GACb,oBAAoB;EACtB;EACA,WAAW;GACT,SAAS;GACT,eAAe;GACf,KAAK;GACL,cAAc;EAChB;EACA,OAAO;GACL,OAAO;GACP,WAAW;GACX,aAAa;GACb,oBAAoB;EACtB;EACA,aAAa;GACX,OAAO;GACP,WAAW;EACb;EAIA,QAAQ;GACN,YAAY;GACZ,SAAS;GACT,KAAK;GACL,cAAc;IAAE,MAAM;IAAM,QAAQ;GAAK;GACzC,cAAc;IAAE,MAAM;IAAM,QAAQ;GAAK;GACzC,kBAAkB;IAAE,MAAM;IAAK,QAAQ;GAAI;GAC3C,oBAAoB;IAAE,MAAM;IAAK,QAAQ;GAAI;EAC/C;EACA,aAAa;GACX,OAAO;GACP,MAAM;GACN,UAAU;GACV,WAAW;GACX,aAAa;GACb,oBAAoB;EACtB;EACA,YAAY;GACV,OAAO;GACP,YAAY;GACZ,SAAS;GACT,aAAa,EAAE,SAAS,EAAE;GAC1B,oBAAoB,EAAE,SAAS,EAAE;EACnC;CACF;CACA,UAAU,EACR,SAAS;EACP,MAAM,CAAC;EAEP,SAAS,EACP,aAAa,EACX,WAAW;GAAE,MAAM;GAAmB,QAAQ;EAAkB,EAClE,EACF;CACF,EACF;CACA,iBAAiB,EACf,SAAS,OACX;AACF,CAAC"}
1
+ {"version":3,"file":"LinkCard.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/LinkCard.recipe.ts"],"sourcesContent":["import { cardAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\n// BitkitLinkCard is a `Card` (elevation off, `sm` padding below tablet and `lg` from tablet up):\n// background, border, body padding and the footer's divider come from the card recipe. This recipe\n// only adds what the link card does differently: a larger radius, an inset divider, the hover state\n// and its own content.\n//\n// The whole card is one link, so hover and keyboard focus read the same: the root reacts with\n// `_hover` / `_focusVisible`, and its parts follow through the `group` class on the root.\n//\n// `variant` is a layout variant: the icon and product cards differ in their visual and, from tablet\n// up, in the size of the body text.\nconst linkCardAnatomy = cardAnatomy.extendWith('iconTile', 'textBlock', 'actionLabel', 'actionIcon');\n\nconst rootActive = {\n borderColor: 'border/hover',\n boxShadow: 'elevation/md',\n};\n\nconst textActive = { color: 'text/link-hover' };\n\nconst iconTileActive = {\n backgroundColor: 'background/selected-hover',\n color: 'icon/interactive',\n};\n\nconst linkCardSlotRecipe = defineSlotRecipe({\n className: 'link-card',\n slots: linkCardAnatomy.keys(),\n base: {\n root: {\n borderRadius: '12',\n color: 'text/primary',\n display: 'flex',\n flexDirection: 'column',\n maxWidth: 'layout/maxWidth/480',\n overflow: 'clip',\n textDecoration: 'none',\n _hover: rootActive,\n _focusVisible: rootActive,\n },\n body: {\n display: 'flex',\n flex: '1',\n flexDirection: 'column',\n gap: { base: '12', tablet: '16' },\n minHeight: 0,\n // The design keeps the content 24px off the trailing edge at every size, also where the card's\n // padding is 16. Responsive for the same reason as the footer's padding.\n paddingInlineEnd: { base: '24', tablet: '24' },\n },\n iconTile: {\n alignItems: 'center',\n alignSelf: 'flex-start',\n backgroundColor: 'background/tertiary',\n borderRadius: { base: '8', tablet: '10' },\n color: 'icon/secondary',\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n padding: '8',\n '& > svg': {\n boxSize: { base: '24', tablet: '32' },\n },\n _groupHover: iconTileActive,\n _groupFocusVisible: iconTileActive,\n },\n textBlock: {\n display: 'flex',\n flexDirection: 'column',\n gap: '6',\n overflowWrap: 'anywhere',\n },\n title: {\n color: 'text/primary',\n textStyle: 'body/xl/semibold',\n // Keeps the last line from being a lone word, without evening out the other lines.\n textWrap: 'pretty',\n _groupHover: textActive,\n _groupFocusVisible: textActive,\n },\n description: {\n color: 'text/secondary',\n textStyle: 'body/lg/regular',\n },\n // The card's footer runs its divider edge to edge; the design insets it to the body's padding.\n // The padding is responsive on purpose: the card's own footer padding comes from a responsive\n // `paddingSize`, so a plain value here would lose to its breakpoint rule from tablet up.\n footer: {\n alignItems: 'center',\n display: 'flex',\n gap: '4',\n marginInline: { base: '16', tablet: '24' },\n paddingBlock: { base: '16', tablet: '24' },\n paddingInlineEnd: { base: '8', tablet: '8' },\n paddingInlineStart: { base: '0', tablet: '0' },\n },\n actionLabel: {\n color: 'text/link',\n flex: '1',\n minWidth: 0,\n textStyle: 'body/lg/regular',\n _groupHover: textActive,\n _groupFocusVisible: textActive,\n },\n actionIcon: {\n color: 'icon/interactive',\n flexShrink: 0,\n opacity: 0,\n _groupHover: { opacity: 1 },\n _groupFocusVisible: { opacity: 1 },\n },\n },\n variants: {\n variant: {\n icon: {},\n // The visual is a BitkitProductThumbnail, which brings its own size, radius and background.\n product: {\n description: {\n textStyle: { base: 'body/lg/regular', tablet: 'body/md/regular' },\n },\n },\n },\n },\n defaultVariants: {\n variant: 'icon',\n },\n});\n\nexport default linkCardSlotRecipe;\n"],"mappings":";;;AAaA,IAAM,kBAAkB,YAAY,WAAW,YAAY,aAAa,eAAe,YAAY;AAEnG,IAAM,aAAa;CACjB,aAAa;CACb,WAAW;AACb;AAEA,IAAM,aAAa,EAAE,OAAO,kBAAkB;AAE9C,IAAM,iBAAiB;CACrB,iBAAiB;CACjB,OAAO;AACT;AAEA,IAAM,qBAAqB,iBAAiB;CAC1C,WAAW;CACX,OAAO,gBAAgB,KAAK;CAC5B,MAAM;EACJ,MAAM;GACJ,cAAc;GACd,OAAO;GACP,SAAS;GACT,eAAe;GACf,UAAU;GACV,UAAU;GACV,gBAAgB;GAChB,QAAQ;GACR,eAAe;EACjB;EACA,MAAM;GACJ,SAAS;GACT,MAAM;GACN,eAAe;GACf,KAAK;IAAE,MAAM;IAAM,QAAQ;GAAK;GAChC,WAAW;GAGX,kBAAkB;IAAE,MAAM;IAAM,QAAQ;GAAK;EAC/C;EACA,UAAU;GACR,YAAY;GACZ,WAAW;GACX,iBAAiB;GACjB,cAAc;IAAE,MAAM;IAAK,QAAQ;GAAK;GACxC,OAAO;GACP,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,SAAS;GACT,WAAW,EACT,SAAS;IAAE,MAAM;IAAM,QAAQ;GAAK,EACtC;GACA,aAAa;GACb,oBAAoB;EACtB;EACA,WAAW;GACT,SAAS;GACT,eAAe;GACf,KAAK;GACL,cAAc;EAChB;EACA,OAAO;GACL,OAAO;GACP,WAAW;GAEX,UAAU;GACV,aAAa;GACb,oBAAoB;EACtB;EACA,aAAa;GACX,OAAO;GACP,WAAW;EACb;EAIA,QAAQ;GACN,YAAY;GACZ,SAAS;GACT,KAAK;GACL,cAAc;IAAE,MAAM;IAAM,QAAQ;GAAK;GACzC,cAAc;IAAE,MAAM;IAAM,QAAQ;GAAK;GACzC,kBAAkB;IAAE,MAAM;IAAK,QAAQ;GAAI;GAC3C,oBAAoB;IAAE,MAAM;IAAK,QAAQ;GAAI;EAC/C;EACA,aAAa;GACX,OAAO;GACP,MAAM;GACN,UAAU;GACV,WAAW;GACX,aAAa;GACb,oBAAoB;EACtB;EACA,YAAY;GACV,OAAO;GACP,YAAY;GACZ,SAAS;GACT,aAAa,EAAE,SAAS,EAAE;GAC1B,oBAAoB,EAAE,SAAS,EAAE;EACnC;CACF;CACA,UAAU,EACR,SAAS;EACP,MAAM,CAAC;EAEP,SAAS,EACP,aAAa,EACX,WAAW;GAAE,MAAM;GAAmB,QAAQ;EAAkB,EAClE,EACF;CACF,EACF;CACA,iBAAiB,EACf,SAAS,OACX;AACF,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit-v2",
3
3
  "private": false,
4
- "version": "0.3.535",
4
+ "version": "0.3.537",
5
5
  "description": "Bitrise Design System Components built with Chakra UI V3",
6
6
  "keywords": [
7
7
  "react",