@bitrise/bitkit-v2 0.3.462 → 0.3.463
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/dist/components/BitkitDefinitionTooltip/BitkitDefinitionTooltip.d.ts +12 -12
- package/dist/components/BitkitDefinitionTooltip/BitkitDefinitionTooltip.js +20 -22
- package/dist/components/BitkitDefinitionTooltip/BitkitDefinitionTooltip.js.map +1 -1
- package/dist/components/BitkitLabeledData/BitkitLabeledData.d.ts +3 -3
- package/dist/components/BitkitLabeledData/BitkitLabeledData.js +11 -2
- package/dist/components/BitkitLabeledData/BitkitLabeledData.js.map +1 -1
- package/dist/components/BitkitTable/BitkitDefinitionColumnHeader.d.ts +1 -1
- package/dist/components/BitkitTable/BitkitDefinitionColumnHeader.js +16 -19
- package/dist/components/BitkitTable/BitkitDefinitionColumnHeader.js.map +1 -1
- package/dist/components/BitkitToggletip/BitkitToggletip.d.ts +59 -0
- package/dist/components/BitkitToggletip/BitkitToggletip.js +107 -0
- package/dist/components/BitkitToggletip/BitkitToggletip.js.map +1 -0
- package/dist/components/BitkitTooltip/BitkitTooltip.d.ts +7 -23
- package/dist/components/BitkitTooltip/BitkitTooltip.js +14 -45
- package/dist/components/BitkitTooltip/BitkitTooltip.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/main.js +2 -1
- package/dist/theme/common/TooltipAndToggletip.common.d.ts +90 -0
- package/dist/theme/common/TooltipAndToggletip.common.js +72 -0
- package/dist/theme/common/TooltipAndToggletip.common.js.map +1 -0
- package/dist/theme/slot-recipes/Toggletip.recipe.d.ts +60 -0
- package/dist/theme/slot-recipes/Toggletip.recipe.js +31 -0
- package/dist/theme/slot-recipes/Toggletip.recipe.js.map +1 -0
- package/dist/theme/slot-recipes/Tooltip.recipe.d.ts +34 -34
- package/dist/theme/slot-recipes/Tooltip.recipe.js +4 -61
- package/dist/theme/slot-recipes/Tooltip.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/index.d.ts +89 -34
- package/dist/theme/slot-recipes/index.js +2 -0
- package/dist/theme/slot-recipes/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,37 +1,29 @@
|
|
|
1
1
|
import BitkitPortalContext from "../../utilities/BitkitPortalContext.js";
|
|
2
|
-
import { rem } from "../../theme/themeUtils.js";
|
|
3
|
-
import BitkitColorButton from "../BitkitColorButton/BitkitColorButton.js";
|
|
4
2
|
import { Box } from "@chakra-ui/react/box";
|
|
5
3
|
import { isValidElement, useContext, useRef } from "react";
|
|
6
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
5
|
import { Portal } from "@chakra-ui/react/portal";
|
|
8
6
|
import { Tooltip } from "@chakra-ui/react/tooltip";
|
|
9
|
-
import { Link } from "@chakra-ui/react/link";
|
|
10
7
|
//#region lib/components/BitkitTooltip/BitkitTooltip.tsx
|
|
11
8
|
/**
|
|
12
|
-
* A hover/focus tooltip anchored to its child
|
|
13
|
-
* after it
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* open while the pointer travels into it, so the link and the button can actually be reached.
|
|
9
|
+
* A hover/focus tooltip anchored to its child: `text` carries the message and `icon` appends a
|
|
10
|
+
* glyph after it. Text only — a tooltip closes when focus leaves its trigger and ignores touch, so a
|
|
11
|
+
* link or a button inside one couldn't be reached. For those use `BitkitToggletip`, which looks the
|
|
12
|
+
* same and opens on click.
|
|
17
13
|
*
|
|
18
14
|
* The content renders in a portal, so it escapes any ancestor that traps stacking (`isolation`,
|
|
19
15
|
* `transform`, a `z-index`ed positioned box) or clips overflow. Dialogs turn that off through
|
|
20
|
-
* `BitkitPortalContext`
|
|
21
|
-
* the manual override.
|
|
16
|
+
* `BitkitPortalContext`; `disablePortal` is the manual override.
|
|
22
17
|
*/
|
|
23
|
-
var BitkitTooltip = ({
|
|
18
|
+
var BitkitTooltip = ({ children, closeOnClick, disablePortal, disabled, icon: Icon, onOpenChange, open, openDelay, placement = "top", text, wrapTrigger }) => {
|
|
24
19
|
const { disablePortal: disablePortalFromContext } = useContext(BitkitPortalContext);
|
|
25
|
-
const isInteractive = !!learnMoreUrl || !!button;
|
|
26
20
|
const triggerRef = useRef(null);
|
|
27
21
|
return /* @__PURE__ */ jsxs(Tooltip.Root, {
|
|
28
22
|
closeOnClick,
|
|
29
23
|
disabled,
|
|
30
|
-
interactive: isInteractive || void 0,
|
|
31
24
|
onOpenChange,
|
|
32
25
|
open,
|
|
33
26
|
openDelay,
|
|
34
|
-
paddingSize: isInteractive ? "lg" : void 0,
|
|
35
27
|
positioning: {
|
|
36
28
|
getAnchorElement: () => triggerRef.current,
|
|
37
29
|
placement,
|
|
@@ -60,37 +52,14 @@ var BitkitTooltip = ({ button, children, closeOnClick, disablePortal, disabled,
|
|
|
60
52
|
}) : children
|
|
61
53
|
}), /* @__PURE__ */ jsx(Portal, {
|
|
62
54
|
disabled: disablePortal || disablePortalFromContext,
|
|
63
|
-
children: /* @__PURE__ */ jsx(Tooltip.Positioner, { children: /* @__PURE__ */ jsxs(Tooltip.Content, {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
flexShrink: "0",
|
|
72
|
-
size: "16"
|
|
73
|
-
})]
|
|
74
|
-
}),
|
|
75
|
-
isInteractive && /* @__PURE__ */ jsxs(Box, {
|
|
76
|
-
alignItems: "center",
|
|
77
|
-
display: "flex",
|
|
78
|
-
gap: "16",
|
|
79
|
-
marginBlockStart: "16",
|
|
80
|
-
children: [learnMoreUrl && /* @__PURE__ */ jsx(Link, {
|
|
81
|
-
color: "color/purple/highlight",
|
|
82
|
-
href: learnMoreUrl,
|
|
83
|
-
rel: learnMoreTarget === "_blank" ? "noopener noreferrer" : void 0,
|
|
84
|
-
target: learnMoreTarget,
|
|
85
|
-
children: "Learn more"
|
|
86
|
-
}), button && /* @__PURE__ */ jsx(BitkitColorButton, {
|
|
87
|
-
colorVariant: "white",
|
|
88
|
-
marginInlineStart: "auto",
|
|
89
|
-
...button
|
|
90
|
-
})]
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
}) })
|
|
55
|
+
children: /* @__PURE__ */ jsx(Tooltip.Positioner, { children: /* @__PURE__ */ jsxs(Tooltip.Content, { children: [/* @__PURE__ */ jsx(Tooltip.Arrow, { children: /* @__PURE__ */ jsx(Tooltip.ArrowTip, {}) }), /* @__PURE__ */ jsxs(Box, {
|
|
56
|
+
display: "flex",
|
|
57
|
+
gap: "8",
|
|
58
|
+
children: [text, Icon && /* @__PURE__ */ jsx(Icon, {
|
|
59
|
+
flexShrink: "0",
|
|
60
|
+
size: "16"
|
|
61
|
+
})]
|
|
62
|
+
})] }) })
|
|
94
63
|
})]
|
|
95
64
|
});
|
|
96
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitTooltip.js","names":[],"sources":["../../../lib/components/BitkitTooltip/BitkitTooltip.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Link } from '@chakra-ui/react/link';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { Tooltip, type TooltipRootProps } from '@chakra-ui/react/tooltip';\nimport { isValidElement, type ReactNode, type Ref, useContext, useRef } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport { rem } from '../../theme/themeUtils';\nimport BitkitPortalContext from '../../utilities/BitkitPortalContext';\nimport BitkitColorButton, { type BitkitColorButtonProps } from '../BitkitColorButton/BitkitColorButton';\n\nexport type BitkitTooltipProps = {\n /**\n * Action button rendered at the end of the tooltip. Setting it makes the tooltip interactive, so\n * the pointer can move into the tooltip without dismissing it. Defaults to the `white` colour\n * variant, the one that reads on the tooltip's dark background.\n */\n button?: BitkitColorButtonProps;\n /**\n * The trigger the tooltip is anchored to. Rendered via `asChild`, so it must accept a ref —\n * unless `wrapTrigger` puts a wrapper in between.\n */\n children: ReactNode;\n /** Dismiss the tooltip when the trigger is clicked. */\n closeOnClick?: TooltipRootProps['closeOnClick'];\n /**\n * Render the tooltip inline instead of in a portal. Only needed when it must stay inside its\n * parent's DOM subtree — a dialog already sets this for you.\n */\n disablePortal?: boolean;\n /** Render the trigger without a tooltip — for hints that only apply in some states. */\n disabled?: TooltipRootProps['disabled'];\n /**\n * Icon rendered after `text`, at size 16. Use it for the affordance the tooltip describes — an\n * `IconArrowNortheast` when the trigger opens something in a new tab, for instance.\n */\n icon?: BitkitIconComponent;\n /** Target for the \"Learn more\" link. `_blank` also sets `rel=\"noopener noreferrer\"`. */\n learnMoreTarget?: HTMLAnchorElement['target'];\n /**\n * Adds a \"Learn more\" link pointing here. Setting it makes the tooltip interactive, so the\n * pointer can move into the tooltip to reach the link.\n */\n learnMoreUrl?: string;\n /** Called when the tooltip opens or closes, including from hover and focus. */\n onOpenChange?: TooltipRootProps['onOpenChange'];\n /** Controlled open state. Leave unset to let hover and focus drive it. */\n open?: TooltipRootProps['open'];\n /** Delay in ms before an uncontrolled tooltip opens on hover. */\n openDelay?: TooltipRootProps['openDelay'];\n /** Where the tooltip sits relative to the trigger (default `top`). It flips if space is short. */\n placement?: NonNullable<TooltipRootProps['positioning']>['placement'];\n /** The tooltip's text. Plain string only — use `icon`, `learnMoreUrl` and `button` for the rest. */\n text: string;\n /**\n * Render the trigger inside a focusable wrapper instead of on the trigger itself. Only for triggers\n * that cannot take focus — on a focusable one this adds a second, redundant tab stop for the same\n * control. A disabled `<button>` dispatches no pointer events and is out of the tab order, so\n * without a wrapper the tooltip never opens — in the one state whose explanation the user actually\n * needs.\n *\n * Chakra v2's `Tooltip` had this built in as `shouldWrapChildren`, rendering a\n * `<span display=\"inline-block\" tabIndex={0}>` that carried the trigger props. Ark's tooltip has no\n * equivalent, and Chakra's own v2->v3 codemod replaces it with a bare `<span>` — which restores\n * hover but silently drops the tab stop, so the tooltip stays unreachable by keyboard. This prop is\n * that escape hatch, `tabIndex` included.\n *\n * The wrapper is a plain focusable span, so focusing it announces the trigger's label and the\n * tooltip text, not the trigger's own state — a disabled button inside is not re-announced as\n * disabled. Conveying that would mean keeping the trigger focusable with `aria-disabled` instead\n * of the native attribute, which is a change to what `disabled` means, not a tooltip concern.\n */\n wrapTrigger?: boolean;\n};\n\n/**\n * A hover/focus tooltip anchored to its child. `text` carries the message, `icon` appends a glyph\n * after it, and `learnMoreUrl`/`button` add a link and an action.\n *\n * Setting either of those two makes the tooltip *interactive*: it gains roomier padding and stays\n * open while the pointer travels into it, so the link and the button can actually be reached.\n *\n * The content renders in a portal, so it escapes any ancestor that traps stacking (`isolation`,\n * `transform`, a `z-index`ed positioned box) or clips overflow. Dialogs turn that off through\n * `BitkitPortalContext` so an interactive tooltip stays inside the focus trap; `disablePortal` is\n * the manual override.\n */\nconst BitkitTooltip = ({\n button,\n children,\n closeOnClick,\n disablePortal,\n disabled,\n icon: Icon,\n learnMoreTarget,\n learnMoreUrl,\n onOpenChange,\n open,\n openDelay,\n placement = 'top',\n text,\n wrapTrigger,\n}: BitkitTooltipProps) => {\n const { disablePortal: disablePortalFromContext } = useContext(BitkitPortalContext);\n const isInteractive = !!learnMoreUrl || !!button;\n\n // Anchor positioning to the trigger node by ref rather than relying on Zag's\n // id/data-scope lookup. When the trigger is also wrapped by another `asChild`\n // trigger (e.g. Menu.Trigger), the outer trigger's id and data-scope/data-part\n // overwrite ours on the shared node, so `getTriggerEl()` can't find it and the\n // tooltip loses its anchor. `getAnchorElement` takes precedence over the id\n // lookup, so this is safe in the standalone case too.\n const triggerRef = useRef<HTMLElement>(null);\n\n return (\n <Tooltip.Root\n closeOnClick={closeOnClick}\n disabled={disabled}\n interactive={isInteractive || undefined}\n onOpenChange={onOpenChange}\n open={open}\n openDelay={openDelay}\n paddingSize={isInteractive ? 'lg' : undefined}\n positioning={{ getAnchorElement: () => triggerRef.current, placement, offset: { mainAxis: 4, crossAxis: 0 } }}\n >\n <Tooltip.Trigger ref={triggerRef as Ref<HTMLButtonElement>} asChild>\n {wrapTrigger || !isValidElement(children) ? (\n // inline-flex so the wrapper shrink-wraps the trigger: a plain inline span adds descender\n // space below it and shifts the alignment of whatever sits next to it.\n <Box\n as=\"span\"\n display=\"inline-flex\"\n tabIndex={0}\n css={{\n // The wrapper owns the tab stop, but the focus ring belongs on the trigger: an outline\n // follows the border-radius of the element it is drawn on, and the wrapper has none —\n // so leaving it here squares off a pill or a round trigger.\n _focusVisible: {\n outline: 'none',\n '& > *': {\n outlineColor: 'var(--focus-ring-color)',\n outlineOffset: 'var(--focus-ring-offset, 2px)',\n outlineStyle: 'var(--focus-ring-style, solid)',\n outlineWidth: 'var(--focus-ring-width, 2px)',\n },\n },\n }}\n >\n {children}\n </Box>\n ) : (\n children\n )}\n </Tooltip.Trigger>\n <Portal disabled={disablePortal || disablePortalFromContext}>\n <Tooltip.Positioner>\n <Tooltip.Content css={isInteractive && { minWidth: rem(240) }}>\n <Tooltip.Arrow>\n <Tooltip.ArrowTip />\n </Tooltip.Arrow>\n <Box display=\"flex\" gap=\"8\">\n {text}\n {Icon && <Icon flexShrink=\"0\" size=\"16\" />}\n </Box>\n {isInteractive && (\n <Box alignItems=\"center\" display=\"flex\" gap=\"16\" marginBlockStart=\"16\">\n {learnMoreUrl && (\n <Link\n color=\"color/purple/highlight\"\n href={learnMoreUrl}\n rel={learnMoreTarget === '_blank' ? 'noopener noreferrer' : undefined}\n target={learnMoreTarget}\n >\n Learn more\n </Link>\n )}\n {button && <BitkitColorButton colorVariant=\"white\" marginInlineStart=\"auto\" {...button} />}\n </Box>\n )}\n </Tooltip.Content>\n </Tooltip.Positioner>\n </Portal>\n </Tooltip.Root>\n );\n};\n\nBitkitTooltip.displayName = 'BitkitTooltip';\n\nexport default BitkitTooltip;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuFA,IAAM,iBAAiB,EACrB,QACA,UACA,cACA,eACA,UACA,MAAM,MACN,iBACA,cACA,cACA,MACA,WACA,YAAY,OACZ,MACA,kBACwB;CACxB,MAAM,EAAE,eAAe,6BAA6B,WAAW,mBAAmB;CAClF,MAAM,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CAAC;CAQ1C,MAAM,aAAa,OAAoB,IAAI;CAE3C,OACE,qBAAC,QAAQ,MAAT;EACgB;EACJ;EACV,aAAa,iBAAiB,KAAA;EAChB;EACR;EACK;EACX,aAAa,gBAAgB,OAAO,KAAA;EACpC,aAAa;GAAE,wBAAwB,WAAW;GAAS;GAAW,QAAQ;IAAE,UAAU;IAAG,WAAW;GAAE;EAAE;EAR9G,UAAA,CAUE,oBAAC,QAAQ,SAAT;GAAiB,KAAK;GAAsC,SAAA;GACzD,UAAA,eAAe,CAAC,eAAe,QAAQ,IAGtC,oBAAC,KAAD;IACE,IAAG;IACH,SAAQ;IACR,UAAU;IACV,KAAK,EAIH,eAAe;KACb,SAAS;KACT,SAAS;MACP,cAAc;MACd,eAAe;MACf,cAAc;MACd,cAAc;KAChB;IACF,EACF;IAEC;GACE,CAAA,IAEL;EAEa,CAAA,GACjB,oBAAC,QAAD;GAAQ,UAAU,iBAAiB;GACjC,UAAA,oBAAC,QAAQ,YAAT,EAAA,UACE,qBAAC,QAAQ,SAAT;IAAiB,KAAK,iBAAiB,EAAE,UAAU,IAAI,GAAG,EAAE;IAA5D,UAAA;KACE,oBAAC,QAAQ,OAAT,EAAA,UACE,oBAAC,QAAQ,UAAT,CAAmB,CAAA,EACN,CAAA;KACf,qBAAC,KAAD;MAAK,SAAQ;MAAO,KAAI;MAAxB,UAAA,CACG,MACA,QAAQ,oBAAC,MAAD;OAAM,YAAW;OAAI,MAAK;MAAM,CAAA,CACtC;;KACJ,iBACC,qBAAC,KAAD;MAAK,YAAW;MAAS,SAAQ;MAAO,KAAI;MAAK,kBAAiB;MAAlE,UAAA,CACG,gBACC,oBAAC,MAAD;OACE,OAAM;OACN,MAAM;OACN,KAAK,oBAAoB,WAAW,wBAAwB,KAAA;OAC5D,QAAQ;OACT,UAAA;MAEK,CAAA,GAEP,UAAU,oBAAC,mBAAD;OAAmB,cAAa;OAAQ,mBAAkB;OAAO,GAAI;MAAS,CAAA,CACtF;;IAEQ;GACC,CAAA,EAAA,CAAA;EACd,CAAA,CACI;;AAElB;AAEA,cAAc,cAAc"}
|
|
1
|
+
{"version":3,"file":"BitkitTooltip.js","names":[],"sources":["../../../lib/components/BitkitTooltip/BitkitTooltip.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { Tooltip, type TooltipRootProps } from '@chakra-ui/react/tooltip';\nimport { isValidElement, type ReactNode, type Ref, useContext, useRef } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport BitkitPortalContext from '../../utilities/BitkitPortalContext';\n\nexport type BitkitTooltipProps = {\n /**\n * The trigger the tooltip is anchored to. Rendered via `asChild`, so it must accept a ref —\n * unless `wrapTrigger` puts a wrapper in between.\n */\n children: ReactNode;\n /** Dismiss the tooltip when the trigger is clicked. */\n closeOnClick?: TooltipRootProps['closeOnClick'];\n /**\n * Render the tooltip inline instead of in a portal. Only needed when it must stay inside its\n * parent's DOM subtree — a dialog already sets this for you.\n */\n disablePortal?: boolean;\n /** Render the trigger without a tooltip — for hints that only apply in some states. */\n disabled?: TooltipRootProps['disabled'];\n /**\n * Icon rendered after `text`, at size 16. Use it for the affordance the tooltip describes — an\n * `IconArrowNortheast` when the trigger opens something in a new tab, for instance.\n */\n icon?: BitkitIconComponent;\n /** Called when the tooltip opens or closes, including from hover and focus. */\n onOpenChange?: TooltipRootProps['onOpenChange'];\n /** Controlled open state. Leave unset to let hover and focus drive it. */\n open?: TooltipRootProps['open'];\n /** Delay in ms before an uncontrolled tooltip opens on hover. */\n openDelay?: TooltipRootProps['openDelay'];\n /** Where the tooltip sits relative to the trigger (default `top`). It flips if space is short. */\n placement?: NonNullable<TooltipRootProps['positioning']>['placement'];\n /** The tooltip's text. Plain string only — use `icon` for a glyph after it. */\n text: string;\n /**\n * Render the trigger inside a focusable wrapper instead of on the trigger itself. Only for triggers\n * that cannot take focus — on a focusable one this adds a second, redundant tab stop for the same\n * control. A disabled `<button>` dispatches no pointer events and is out of the tab order, so\n * without a wrapper the tooltip never opens — in the one state whose explanation the user actually\n * needs.\n *\n * Chakra v2's `Tooltip` had this built in as `shouldWrapChildren`, rendering a\n * `<span display=\"inline-block\" tabIndex={0}>` that carried the trigger props. Ark's tooltip has no\n * equivalent, and Chakra's own v2->v3 codemod replaces it with a bare `<span>` — which restores\n * hover but silently drops the tab stop, so the tooltip stays unreachable by keyboard. This prop is\n * that escape hatch, `tabIndex` included.\n *\n * The wrapper is a plain focusable span, so focusing it announces the trigger's label and the\n * tooltip text, not the trigger's own state — a disabled button inside is not re-announced as\n * disabled. Conveying that would mean keeping the trigger focusable with `aria-disabled` instead\n * of the native attribute, which is a change to what `disabled` means, not a tooltip concern.\n */\n wrapTrigger?: boolean;\n};\n\n/**\n * A hover/focus tooltip anchored to its child: `text` carries the message and `icon` appends a\n * glyph after it. Text only — a tooltip closes when focus leaves its trigger and ignores touch, so a\n * link or a button inside one couldn't be reached. For those use `BitkitToggletip`, which looks the\n * same and opens on click.\n *\n * The content renders in a portal, so it escapes any ancestor that traps stacking (`isolation`,\n * `transform`, a `z-index`ed positioned box) or clips overflow. Dialogs turn that off through\n * `BitkitPortalContext`; `disablePortal` is the manual override.\n */\nconst BitkitTooltip = ({\n children,\n closeOnClick,\n disablePortal,\n disabled,\n icon: Icon,\n onOpenChange,\n open,\n openDelay,\n placement = 'top',\n text,\n wrapTrigger,\n}: BitkitTooltipProps) => {\n const { disablePortal: disablePortalFromContext } = useContext(BitkitPortalContext);\n\n // Anchor positioning to the trigger node by ref rather than relying on Zag's\n // id/data-scope lookup. When the trigger is also wrapped by another `asChild`\n // trigger (e.g. Menu.Trigger), the outer trigger's id and data-scope/data-part\n // overwrite ours on the shared node, so `getTriggerEl()` can't find it and the\n // tooltip loses its anchor. `getAnchorElement` takes precedence over the id\n // lookup, so this is safe in the standalone case too.\n const triggerRef = useRef<HTMLElement>(null);\n\n return (\n <Tooltip.Root\n closeOnClick={closeOnClick}\n disabled={disabled}\n onOpenChange={onOpenChange}\n open={open}\n openDelay={openDelay}\n positioning={{ getAnchorElement: () => triggerRef.current, placement, offset: { mainAxis: 4, crossAxis: 0 } }}\n >\n <Tooltip.Trigger ref={triggerRef as Ref<HTMLButtonElement>} asChild>\n {wrapTrigger || !isValidElement(children) ? (\n // inline-flex so the wrapper shrink-wraps the trigger: a plain inline span adds descender\n // space below it and shifts the alignment of whatever sits next to it.\n <Box\n as=\"span\"\n display=\"inline-flex\"\n tabIndex={0}\n css={{\n // The wrapper owns the tab stop, but the focus ring belongs on the trigger: an outline\n // follows the border-radius of the element it is drawn on, and the wrapper has none —\n // so leaving it here squares off a pill or a round trigger.\n _focusVisible: {\n outline: 'none',\n '& > *': {\n outlineColor: 'var(--focus-ring-color)',\n outlineOffset: 'var(--focus-ring-offset, 2px)',\n outlineStyle: 'var(--focus-ring-style, solid)',\n outlineWidth: 'var(--focus-ring-width, 2px)',\n },\n },\n }}\n >\n {children}\n </Box>\n ) : (\n children\n )}\n </Tooltip.Trigger>\n <Portal disabled={disablePortal || disablePortalFromContext}>\n <Tooltip.Positioner>\n <Tooltip.Content>\n <Tooltip.Arrow>\n <Tooltip.ArrowTip />\n </Tooltip.Arrow>\n <Box display=\"flex\" gap=\"8\">\n {text}\n {Icon && <Icon flexShrink=\"0\" size=\"16\" />}\n </Box>\n </Tooltip.Content>\n </Tooltip.Positioner>\n </Portal>\n </Tooltip.Root>\n );\n};\n\nBitkitTooltip.displayName = 'BitkitTooltip';\n\nexport default BitkitTooltip;\n"],"mappings":";;;;;;;;;;;;;;;;;AAqEA,IAAM,iBAAiB,EACrB,UACA,cACA,eACA,UACA,MAAM,MACN,cACA,MACA,WACA,YAAY,OACZ,MACA,kBACwB;CACxB,MAAM,EAAE,eAAe,6BAA6B,WAAW,mBAAmB;CAQlF,MAAM,aAAa,OAAoB,IAAI;CAE3C,OACE,qBAAC,QAAQ,MAAT;EACgB;EACJ;EACI;EACR;EACK;EACX,aAAa;GAAE,wBAAwB,WAAW;GAAS;GAAW,QAAQ;IAAE,UAAU;IAAG,WAAW;GAAE;EAAE;EAN9G,UAAA,CAQE,oBAAC,QAAQ,SAAT;GAAiB,KAAK;GAAsC,SAAA;GACzD,UAAA,eAAe,CAAC,eAAe,QAAQ,IAGtC,oBAAC,KAAD;IACE,IAAG;IACH,SAAQ;IACR,UAAU;IACV,KAAK,EAIH,eAAe;KACb,SAAS;KACT,SAAS;MACP,cAAc;MACd,eAAe;MACf,cAAc;MACd,cAAc;KAChB;IACF,EACF;IAEC;GACE,CAAA,IAEL;EAEa,CAAA,GACjB,oBAAC,QAAD;GAAQ,UAAU,iBAAiB;GACjC,UAAA,oBAAC,QAAQ,YAAT,EAAA,UACE,qBAAC,QAAQ,SAAT,EAAA,UAAA,CACE,oBAAC,QAAQ,OAAT,EAAA,UACE,oBAAC,QAAQ,UAAT,CAAmB,CAAA,EACN,CAAA,GACf,qBAAC,KAAD;IAAK,SAAQ;IAAO,KAAI;IAAxB,UAAA,CACG,MACA,QAAQ,oBAAC,MAAD;KAAM,YAAW;KAAI,MAAK;IAAM,CAAA,CACtC;GACU,CAAA,CAAA,EAAA,CAAA,EACC,CAAA;EACd,CAAA,CACI;;AAElB;AAEA,cAAc,cAAc"}
|
|
@@ -90,6 +90,7 @@ export { default as BitkitTextArea, type BitkitTextAreaProps } from './BitkitTex
|
|
|
90
90
|
export { default as BitkitTextInput, type BitkitTextInputProps } from './BitkitTextInput/BitkitTextInput';
|
|
91
91
|
export { type BitkitToastProps, default as createBitkitToast, dismissBitkitToast } from './BitkitToast/BitkitToast';
|
|
92
92
|
export { default as BitkitToggleButton, type BitkitToggleButtonProps } from './BitkitToggleButton/BitkitToggleButton';
|
|
93
|
+
export { default as BitkitToggletip, type BitkitToggletipProps } from './BitkitToggletip/BitkitToggletip';
|
|
93
94
|
export { default as BitkitTooltip, type BitkitTooltipProps } from './BitkitTooltip/BitkitTooltip';
|
|
94
95
|
export { default as BitkitTour, type BitkitTourInstance, type BitkitTourOptions, type BitkitTourProps, type BitkitTourSecondaryAction, type BitkitTourStep, useBitkitTour, } from './BitkitTour/BitkitTour';
|
|
95
96
|
export { default as BitkitTreeView, type BitkitTreeViewBranchProps, type BitkitTreeViewExpandedChangeDetails, type BitkitTreeViewLeafProps, type BitkitTreeViewNodeRenderProps, type BitkitTreeViewRootProps, type BitkitTreeViewSelectionChangeDetails, createTreeCollection, } from './BitkitTreeView/BitkitTreeView';
|
package/dist/main.js
CHANGED
|
@@ -320,6 +320,7 @@ import BitkitField from "./components/BitkitField/BitkitField.js";
|
|
|
320
320
|
import BitkitCombobox_default from "./components/BitkitCombobox/BitkitCombobox.js";
|
|
321
321
|
import BitkitDataWidget from "./components/BitkitDataWidget/BitkitDataWidget.js";
|
|
322
322
|
import BitkitDatePicker from "./components/BitkitDatePicker/BitkitDatePicker.js";
|
|
323
|
+
import BitkitToggletip from "./components/BitkitToggletip/BitkitToggletip.js";
|
|
323
324
|
import BitkitDefinitionTooltip from "./components/BitkitDefinitionTooltip/BitkitDefinitionTooltip.js";
|
|
324
325
|
import BitkitDialog_default from "./components/BitkitDialog/BitkitDialog.js";
|
|
325
326
|
import BitkitFormDialog_default from "./components/BitkitDialog/BitkitFormDialog.js";
|
|
@@ -385,4 +386,4 @@ import BitkitTreeView, { createTreeCollection } from "./components/BitkitTreeVie
|
|
|
385
386
|
import useResponsive, { ResponsiveProvider } from "./hooks/useResponsive.js";
|
|
386
387
|
import bitkitTheme from "./theme/index.js";
|
|
387
388
|
import Provider from "./providers/BitkitProvider.js";
|
|
388
|
-
export { BitkitAccordion_default as BitkitAccordion, BitkitActionBar, BitkitActionMenu_default as BitkitActionMenu, BitkitAlert, BitkitAvatar, BitkitBadge, BitkitBreadcrumb, BitkitButton, BitkitCalendar, BitkitCheckbox, BitkitCheckboxGroup, BitkitCloseButton, BitkitCodeSnippet, BitkitCollapsible, BitkitColorButton, BitkitCombobox_default as BitkitCombobox, BitkitControlButton, BitkitDataWidget, BitkitDatePicker, BitkitDefinitionTooltip, BitkitDialog_default as BitkitDialog, BitkitDraggableCard, BitkitDrawer, BitkitEmptyState, BitkitExpandableCard, BitkitField, BitkitFileInput, BitkitFormDialog_default as BitkitFormDialog, BitkitGroupHeading, BitkitHeading, BitkitIconButton, BitkitInlineLoading, BitkitLabel, BitkitLabelTooltip, BitkitLabeledData, BitkitLightbox, BitkitLink, BitkitLinkButton, BitkitList_default as BitkitList, BitkitMarkdown, BitkitMarkdownCard, BitkitMultiselect_default as BitkitMultiselect, BitkitMultiselectMenu, BitkitNativeSelect, BitkitNoteCard, BitkitNumberInput, BitkitOverflowContent, BitkitOverflowTooltip, BitkitPageFooter_default as BitkitPageFooter, BitkitPageHeader, BitkitPageSidebar_default as BitkitPageSidebar, BitkitPagination, BitkitPaginationLoadMore, BitkitPopover, BitkitProgressBar, BitkitPromoBanner, Provider as BitkitProvider, BitkitRadio, BitkitRadioGroup, BitkitRibbon, BitkitSearchInput, BitkitSectionHeading, BitkitSegmentedControl_default as BitkitSegmentedControl, BitkitSelect_default as BitkitSelect, BitkitSelectMenu, BitkitSelectMenuAction, BitkitSelectableTag_default as BitkitSelectableTag, BitkitSettingsCard_default as BitkitSettingsCard, BitkitSkeletonGroup, BitkitSpinner, BitkitSplitButton_default as BitkitSplitButton, BitkitStat, BitkitSteps_default as BitkitSteps, BitkitStepsCard_default as BitkitStepsCard, BitkitStepsDialog_default as BitkitStepsDialog, BitkitSwitch, BitkitTable, BitkitTableCard, BitkitTabs, BitkitTag, BitkitTagsInput, BitkitTextArea, BitkitTextInput, BitkitToggleButton, BitkitTooltip, BitkitTour, BitkitTreeView, IconAbortCircle, IconAbortCircleFilled, IconAddons, IconAgent, IconAnchor, IconAndroid, IconApp, IconAppSettings, IconAppStore, IconAppStoreColor, IconApple, IconArchive, IconArchiveDelete, IconArchiveRestore, IconArrowBackAndDown, IconArrowBackAndUp, IconArrowDown, IconArrowForwardAndDown, IconArrowForwardAndUp, IconArrowLeft, IconArrowNortheast, IconArrowNorthwest, IconArrowRight, IconArrowUp, IconArrowsHorizontal, IconArrowsVertical, IconAutomation, IconAws, IconAwsColor, IconBadge3RdParty, IconBadgeBitrise, IconBadgeUpgrade, IconBadgeVersionOk, IconBazel, IconBell, IconBitbot, IconBitbotError, IconBitbucket, IconBitbucketColor, IconBitbucketNeutral, IconBitbucketWhite, IconBlockCircle, IconBook, IconBoxArrowDown, IconBoxDot, IconBoxLinesOverflow, IconBoxLinesWrap, IconBranch, IconBrowserstackColor, IconBug, IconBuild, IconBuildCache, IconBuildCacheFilled, IconBuildEnvSetup, IconBuildHub, IconBuildHubFilled, IconCalendar, IconChangePlan, IconChat, IconCheck, IconCheckCircle, IconCheckCircleFilled, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCi, IconCiFilled, IconCircle, IconCircleDashed, IconCircleHalfFilled, IconClaude, IconClaudeColor, IconClock, IconCode, IconCodePush, IconCodeSigning, IconCoffee, IconCommit, IconConfigure, IconConnectedAccounts, IconContainer, IconCopilot, IconCopy, IconCordova, IconCpu, IconCreditcard, IconCredits, IconCross, IconCrossCircle, IconCrossCircleFilled, IconCrown, IconCursor, IconCycle, IconDashboard, IconDashboardFilled, IconDeployment, IconDetails, IconDoc, IconDollar, IconDot, IconDotnet, IconDotnetColor, IconDotnetText, IconDotnetTextColor, IconDoubleCircle, IconDownload, IconDragHandle, IconEc2Ami, IconEnterprise, IconErrorCircle, IconErrorCircleFilled, IconExpand, IconExtraBuildCapacity, IconEye, IconEyeSlash, IconFastlane, IconFile, IconFileDoc, IconFilePdf, IconFilePlist, IconFileYml, IconFileZip, IconFilter, IconFlag, IconFlutter, IconFolder, IconFullscreen, IconFullscreenExit, IconGauge, IconGit, IconGithub, IconGitlab, IconGitlabColor, IconGitlabWhite, IconGlobe, IconGo, IconGoogleColor, IconGooglePlay, IconGooglePlayColor, IconGradle, IconGroup, IconHashtag, IconHeadset, IconHeart, IconHistory, IconHourglass, IconImage, IconInfoCircle, IconInfoCircleFilled, IconInsights, IconInsightsFilled, IconInstall, IconInteraction, IconInvoice, IconIonic, IconJapanese, IconJava, IconJavaColor, IconJavaDuke, IconJavaDukeColor, IconKey, IconKiroColor, IconKotlin, IconKotlinColor, IconKotlinWhite, IconLaptop, IconLaunchdarkly, IconLegacyApp, IconLightbulb, IconLink, IconLinux, IconLock, IconLockOpen, IconLogin, IconLogout, IconMacos, IconMagicWand, IconMagnifier, IconMail, IconMcp, IconMedal, IconMemory, IconMenuGrid, IconMenuHamburger, IconMessage, IconMessageAlert, IconMessageQuestion, IconMicrophone, IconMinus, IconMinusCircle, IconMinusCircleFilled, IconMobile, IconMobileLandscape, IconMonitorChart, IconMoreHorizontal, IconMoreVertical, IconNews, IconNextjs, IconNodejs, IconOpenInNew, IconOther, IconOutsideContributor, IconOverview, IconPause, IconPencil, IconPeople, IconPercent, IconPerson, IconPersonWithDesk, IconPin, IconPlay, IconPlus, IconPlusCircle, IconPlusCircleFilled, IconPower, IconProject, IconProjectSettings, IconPull, IconPush, IconPuzzle, IconPython, IconPythonColor, IconQuestionCircle, IconQuestionCircleFilled, IconReact, IconRefresh, IconRegex, IconRelease, IconReleaseFilled, IconRemoteAccess, IconReplace, IconResponsiveness, IconReviewerApproved, IconReviewerAssigned, IconReviewerRejected, IconRuby, IconRubyColor, IconSave, IconSecurityShield, IconSettings, IconSettingsFilled, IconShuffle, IconSiren, IconSkip, IconSkipCircle, IconSkipCircleFilled, IconSlack, IconSlackColor, IconSparkle, IconSparkleFilled, IconSpinnerOnDisabled, IconSpinnerPurple, IconSpinnerPurpleDouble, IconSpinnerWhite, IconStability, IconStack, IconStar, IconStep, IconStop, IconStopwatch, IconTabPlus, IconTag, IconTasks, IconTeams, IconTeamsColor, IconTemplateCode, IconTerminal, IconTerminalFilled, IconTestQuarantine, IconThemeDarkToggle, IconThumbDown, IconThumbUp, IconTools, IconTrash, IconTrigger, IconUbuntu, IconUbuntuColor, IconUnity3D, IconUnpin, IconUpload, IconValidateShield, IconVideo, IconVsCode, IconWarning, IconWarningYellow, IconWebUi, IconWebhooks, IconWindsurf, IconWorkflow, IconWorkflowFlow, IconXTwitter, IconXamarin, IconXcode, ResponsiveProvider, bitkitIcon, bitkitTheme as bitriseTheme, createBitkitToast, createTreeCollection, dismissBitkitToast, rem, useBitkitTour, useResponsive, useStepsDialog };
|
|
389
|
+
export { BitkitAccordion_default as BitkitAccordion, BitkitActionBar, BitkitActionMenu_default as BitkitActionMenu, BitkitAlert, BitkitAvatar, BitkitBadge, BitkitBreadcrumb, BitkitButton, BitkitCalendar, BitkitCheckbox, BitkitCheckboxGroup, BitkitCloseButton, BitkitCodeSnippet, BitkitCollapsible, BitkitColorButton, BitkitCombobox_default as BitkitCombobox, BitkitControlButton, BitkitDataWidget, BitkitDatePicker, BitkitDefinitionTooltip, BitkitDialog_default as BitkitDialog, BitkitDraggableCard, BitkitDrawer, BitkitEmptyState, BitkitExpandableCard, BitkitField, BitkitFileInput, BitkitFormDialog_default as BitkitFormDialog, BitkitGroupHeading, BitkitHeading, BitkitIconButton, BitkitInlineLoading, BitkitLabel, BitkitLabelTooltip, BitkitLabeledData, BitkitLightbox, BitkitLink, BitkitLinkButton, BitkitList_default as BitkitList, BitkitMarkdown, BitkitMarkdownCard, BitkitMultiselect_default as BitkitMultiselect, BitkitMultiselectMenu, BitkitNativeSelect, BitkitNoteCard, BitkitNumberInput, BitkitOverflowContent, BitkitOverflowTooltip, BitkitPageFooter_default as BitkitPageFooter, BitkitPageHeader, BitkitPageSidebar_default as BitkitPageSidebar, BitkitPagination, BitkitPaginationLoadMore, BitkitPopover, BitkitProgressBar, BitkitPromoBanner, Provider as BitkitProvider, BitkitRadio, BitkitRadioGroup, BitkitRibbon, BitkitSearchInput, BitkitSectionHeading, BitkitSegmentedControl_default as BitkitSegmentedControl, BitkitSelect_default as BitkitSelect, BitkitSelectMenu, BitkitSelectMenuAction, BitkitSelectableTag_default as BitkitSelectableTag, BitkitSettingsCard_default as BitkitSettingsCard, BitkitSkeletonGroup, BitkitSpinner, BitkitSplitButton_default as BitkitSplitButton, BitkitStat, BitkitSteps_default as BitkitSteps, BitkitStepsCard_default as BitkitStepsCard, BitkitStepsDialog_default as BitkitStepsDialog, BitkitSwitch, BitkitTable, BitkitTableCard, BitkitTabs, BitkitTag, BitkitTagsInput, BitkitTextArea, BitkitTextInput, BitkitToggleButton, BitkitToggletip, BitkitTooltip, BitkitTour, BitkitTreeView, IconAbortCircle, IconAbortCircleFilled, IconAddons, IconAgent, IconAnchor, IconAndroid, IconApp, IconAppSettings, IconAppStore, IconAppStoreColor, IconApple, IconArchive, IconArchiveDelete, IconArchiveRestore, IconArrowBackAndDown, IconArrowBackAndUp, IconArrowDown, IconArrowForwardAndDown, IconArrowForwardAndUp, IconArrowLeft, IconArrowNortheast, IconArrowNorthwest, IconArrowRight, IconArrowUp, IconArrowsHorizontal, IconArrowsVertical, IconAutomation, IconAws, IconAwsColor, IconBadge3RdParty, IconBadgeBitrise, IconBadgeUpgrade, IconBadgeVersionOk, IconBazel, IconBell, IconBitbot, IconBitbotError, IconBitbucket, IconBitbucketColor, IconBitbucketNeutral, IconBitbucketWhite, IconBlockCircle, IconBook, IconBoxArrowDown, IconBoxDot, IconBoxLinesOverflow, IconBoxLinesWrap, IconBranch, IconBrowserstackColor, IconBug, IconBuild, IconBuildCache, IconBuildCacheFilled, IconBuildEnvSetup, IconBuildHub, IconBuildHubFilled, IconCalendar, IconChangePlan, IconChat, IconCheck, IconCheckCircle, IconCheckCircleFilled, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCi, IconCiFilled, IconCircle, IconCircleDashed, IconCircleHalfFilled, IconClaude, IconClaudeColor, IconClock, IconCode, IconCodePush, IconCodeSigning, IconCoffee, IconCommit, IconConfigure, IconConnectedAccounts, IconContainer, IconCopilot, IconCopy, IconCordova, IconCpu, IconCreditcard, IconCredits, IconCross, IconCrossCircle, IconCrossCircleFilled, IconCrown, IconCursor, IconCycle, IconDashboard, IconDashboardFilled, IconDeployment, IconDetails, IconDoc, IconDollar, IconDot, IconDotnet, IconDotnetColor, IconDotnetText, IconDotnetTextColor, IconDoubleCircle, IconDownload, IconDragHandle, IconEc2Ami, IconEnterprise, IconErrorCircle, IconErrorCircleFilled, IconExpand, IconExtraBuildCapacity, IconEye, IconEyeSlash, IconFastlane, IconFile, IconFileDoc, IconFilePdf, IconFilePlist, IconFileYml, IconFileZip, IconFilter, IconFlag, IconFlutter, IconFolder, IconFullscreen, IconFullscreenExit, IconGauge, IconGit, IconGithub, IconGitlab, IconGitlabColor, IconGitlabWhite, IconGlobe, IconGo, IconGoogleColor, IconGooglePlay, IconGooglePlayColor, IconGradle, IconGroup, IconHashtag, IconHeadset, IconHeart, IconHistory, IconHourglass, IconImage, IconInfoCircle, IconInfoCircleFilled, IconInsights, IconInsightsFilled, IconInstall, IconInteraction, IconInvoice, IconIonic, IconJapanese, IconJava, IconJavaColor, IconJavaDuke, IconJavaDukeColor, IconKey, IconKiroColor, IconKotlin, IconKotlinColor, IconKotlinWhite, IconLaptop, IconLaunchdarkly, IconLegacyApp, IconLightbulb, IconLink, IconLinux, IconLock, IconLockOpen, IconLogin, IconLogout, IconMacos, IconMagicWand, IconMagnifier, IconMail, IconMcp, IconMedal, IconMemory, IconMenuGrid, IconMenuHamburger, IconMessage, IconMessageAlert, IconMessageQuestion, IconMicrophone, IconMinus, IconMinusCircle, IconMinusCircleFilled, IconMobile, IconMobileLandscape, IconMonitorChart, IconMoreHorizontal, IconMoreVertical, IconNews, IconNextjs, IconNodejs, IconOpenInNew, IconOther, IconOutsideContributor, IconOverview, IconPause, IconPencil, IconPeople, IconPercent, IconPerson, IconPersonWithDesk, IconPin, IconPlay, IconPlus, IconPlusCircle, IconPlusCircleFilled, IconPower, IconProject, IconProjectSettings, IconPull, IconPush, IconPuzzle, IconPython, IconPythonColor, IconQuestionCircle, IconQuestionCircleFilled, IconReact, IconRefresh, IconRegex, IconRelease, IconReleaseFilled, IconRemoteAccess, IconReplace, IconResponsiveness, IconReviewerApproved, IconReviewerAssigned, IconReviewerRejected, IconRuby, IconRubyColor, IconSave, IconSecurityShield, IconSettings, IconSettingsFilled, IconShuffle, IconSiren, IconSkip, IconSkipCircle, IconSkipCircleFilled, IconSlack, IconSlackColor, IconSparkle, IconSparkleFilled, IconSpinnerOnDisabled, IconSpinnerPurple, IconSpinnerPurpleDouble, IconSpinnerWhite, IconStability, IconStack, IconStar, IconStep, IconStop, IconStopwatch, IconTabPlus, IconTag, IconTasks, IconTeams, IconTeamsColor, IconTemplateCode, IconTerminal, IconTerminalFilled, IconTestQuarantine, IconThemeDarkToggle, IconThumbDown, IconThumbUp, IconTools, IconTrash, IconTrigger, IconUbuntu, IconUbuntuColor, IconUnity3D, IconUnpin, IconUpload, IconValidateShield, IconVideo, IconVsCode, IconWarning, IconWarningYellow, IconWebUi, IconWebhooks, IconWindsurf, IconWorkflow, IconWorkflowFlow, IconXTwitter, IconXamarin, IconXcode, ResponsiveProvider, bitkitIcon, bitkitTheme as bitriseTheme, createBitkitToast, createTreeCollection, dismissBitkitToast, rem, useBitkitTour, useResponsive, useStepsDialog };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dark bubble BitkitTooltip and BitkitToggletip share, so a hint looks the same whether it opens
|
|
3
|
+
* on hover (a tooltip, text only) or on click (a toggletip, which can hold a link or a button).
|
|
4
|
+
*/
|
|
5
|
+
export declare const base: {
|
|
6
|
+
readonly positioner: {
|
|
7
|
+
readonly fontFamily: "body";
|
|
8
|
+
};
|
|
9
|
+
readonly content: {
|
|
10
|
+
readonly '--tooltip-bg': "colors.background/contrast";
|
|
11
|
+
readonly backgroundColor: "var(--tooltip-bg)";
|
|
12
|
+
readonly maxWidth: `${number}rem`;
|
|
13
|
+
readonly color: "text/on-contrast";
|
|
14
|
+
readonly boxShadow: "elevation/tooltip";
|
|
15
|
+
readonly zIndex: "tooltip";
|
|
16
|
+
readonly transformOrigin: "var(--transform-origin)";
|
|
17
|
+
readonly _open: {
|
|
18
|
+
readonly animationStyle: "scale-fade-in";
|
|
19
|
+
readonly animationDuration: "fast";
|
|
20
|
+
};
|
|
21
|
+
readonly _closed: {
|
|
22
|
+
readonly animationStyle: "scale-fade-out";
|
|
23
|
+
readonly animationDuration: "fast";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly arrow: {
|
|
27
|
+
readonly '--arrow-size': `${number}rem`;
|
|
28
|
+
readonly '--arrow-background': "var(--tooltip-bg)";
|
|
29
|
+
};
|
|
30
|
+
readonly arrowTip: {
|
|
31
|
+
readonly borderTopWidth: "1";
|
|
32
|
+
readonly borderInlineStartWidth: "1";
|
|
33
|
+
readonly borderColor: "var(--tooltip-bg)";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const variants: {
|
|
37
|
+
readonly variant: {
|
|
38
|
+
readonly dark: {
|
|
39
|
+
readonly content: {
|
|
40
|
+
readonly '--tooltip-bg': "colors.background/contrast";
|
|
41
|
+
readonly color: "text/on-contrast";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly light: {
|
|
45
|
+
readonly content: {
|
|
46
|
+
readonly '--tooltip-bg': "colors.background/tertiary";
|
|
47
|
+
readonly color: "text/primary";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly paddingSize: {
|
|
52
|
+
readonly sm: {
|
|
53
|
+
readonly content: {
|
|
54
|
+
readonly paddingInline: "8";
|
|
55
|
+
readonly paddingBlock: "4";
|
|
56
|
+
readonly borderRadius: "4";
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
readonly md: {
|
|
60
|
+
readonly content: {
|
|
61
|
+
readonly paddingInline: "12";
|
|
62
|
+
readonly paddingBlock: "8";
|
|
63
|
+
readonly borderRadius: "8";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly lg: {
|
|
67
|
+
readonly content: {
|
|
68
|
+
readonly padding: "16";
|
|
69
|
+
readonly borderRadius: "8";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
readonly textStyle: {
|
|
74
|
+
readonly 'sm/regular': {
|
|
75
|
+
readonly content: {
|
|
76
|
+
readonly textStyle: "body/sm/regular";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
readonly 'sm/semibold': {
|
|
80
|
+
readonly content: {
|
|
81
|
+
readonly textStyle: "body/sm/semibold";
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
readonly 'md/regular': {
|
|
85
|
+
readonly content: {
|
|
86
|
+
readonly textStyle: "body/md/regular";
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { rem } from "../themeUtils.js";
|
|
2
|
+
//#region lib/theme/common/TooltipAndToggletip.common.ts
|
|
3
|
+
/**
|
|
4
|
+
* The dark bubble BitkitTooltip and BitkitToggletip share, so a hint looks the same whether it opens
|
|
5
|
+
* on hover (a tooltip, text only) or on click (a toggletip, which can hold a link or a button).
|
|
6
|
+
*/
|
|
7
|
+
var base = {
|
|
8
|
+
positioner: { fontFamily: "body" },
|
|
9
|
+
content: {
|
|
10
|
+
"--tooltip-bg": "colors.background/contrast",
|
|
11
|
+
backgroundColor: "var(--tooltip-bg)",
|
|
12
|
+
maxWidth: rem(320),
|
|
13
|
+
color: "text/on-contrast",
|
|
14
|
+
boxShadow: "elevation/tooltip",
|
|
15
|
+
zIndex: "tooltip",
|
|
16
|
+
transformOrigin: "var(--transform-origin)",
|
|
17
|
+
_open: {
|
|
18
|
+
animationStyle: "scale-fade-in",
|
|
19
|
+
animationDuration: "fast"
|
|
20
|
+
},
|
|
21
|
+
_closed: {
|
|
22
|
+
animationStyle: "scale-fade-out",
|
|
23
|
+
animationDuration: "fast"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
arrow: {
|
|
27
|
+
"--arrow-size": rem(8),
|
|
28
|
+
"--arrow-background": "var(--tooltip-bg)"
|
|
29
|
+
},
|
|
30
|
+
arrowTip: {
|
|
31
|
+
borderTopWidth: "1",
|
|
32
|
+
borderInlineStartWidth: "1",
|
|
33
|
+
borderColor: "var(--tooltip-bg)"
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var variants = {
|
|
37
|
+
variant: {
|
|
38
|
+
dark: { content: {
|
|
39
|
+
"--tooltip-bg": "colors.background/contrast",
|
|
40
|
+
color: "text/on-contrast"
|
|
41
|
+
} },
|
|
42
|
+
light: { content: {
|
|
43
|
+
"--tooltip-bg": "colors.background/tertiary",
|
|
44
|
+
color: "text/primary"
|
|
45
|
+
} }
|
|
46
|
+
},
|
|
47
|
+
paddingSize: {
|
|
48
|
+
sm: { content: {
|
|
49
|
+
paddingInline: "8",
|
|
50
|
+
paddingBlock: "4",
|
|
51
|
+
borderRadius: "4"
|
|
52
|
+
} },
|
|
53
|
+
md: { content: {
|
|
54
|
+
paddingInline: "12",
|
|
55
|
+
paddingBlock: "8",
|
|
56
|
+
borderRadius: "8"
|
|
57
|
+
} },
|
|
58
|
+
lg: { content: {
|
|
59
|
+
padding: "16",
|
|
60
|
+
borderRadius: "8"
|
|
61
|
+
} }
|
|
62
|
+
},
|
|
63
|
+
textStyle: {
|
|
64
|
+
"sm/regular": { content: { textStyle: "body/sm/regular" } },
|
|
65
|
+
"sm/semibold": { content: { textStyle: "body/sm/semibold" } },
|
|
66
|
+
"md/regular": { content: { textStyle: "body/md/regular" } }
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { base, variants };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=TooltipAndToggletip.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipAndToggletip.common.js","names":[],"sources":["../../../lib/theme/common/TooltipAndToggletip.common.ts"],"sourcesContent":["import { rem } from '../themeUtils';\n\n/**\n * The dark bubble BitkitTooltip and BitkitToggletip share, so a hint looks the same whether it opens\n * on hover (a tooltip, text only) or on click (a toggletip, which can hold a link or a button).\n */\nexport const base = {\n positioner: {\n fontFamily: 'body',\n },\n content: {\n '--tooltip-bg': 'colors.background/contrast',\n backgroundColor: 'var(--tooltip-bg)',\n // Without a cap a tooltip grows to the width of its text, so a long one runs to the edge of\n // the viewport. Every component that renders a tooltip therefore has to set this, and the one\n // that forgot -- BitkitLabelTooltip -- had no cap at all. It belongs to the tooltip, not to\n // each caller. BitkitOverflowTooltip overrides it: it exists to show text that was truncated,\n // so it is allowed to be wider.\n maxWidth: rem(320),\n color: 'text/on-contrast',\n boxShadow: 'elevation/tooltip',\n zIndex: 'tooltip',\n transformOrigin: 'var(--transform-origin)',\n _open: {\n animationStyle: 'scale-fade-in',\n animationDuration: 'fast',\n },\n _closed: {\n animationStyle: 'scale-fade-out',\n animationDuration: 'fast',\n },\n },\n arrow: {\n '--arrow-size': rem(8),\n '--arrow-background': 'var(--tooltip-bg)',\n },\n arrowTip: {\n borderTopWidth: '1',\n borderInlineStartWidth: '1',\n borderColor: 'var(--tooltip-bg)',\n },\n} as const;\n\nexport const variants = {\n variant: {\n dark: {\n content: {\n '--tooltip-bg': 'colors.background/contrast',\n color: 'text/on-contrast',\n },\n },\n light: {\n content: {\n '--tooltip-bg': 'colors.background/tertiary',\n color: 'text/primary',\n },\n },\n },\n paddingSize: {\n sm: {\n content: {\n paddingInline: '8',\n paddingBlock: '4',\n borderRadius: '4',\n },\n },\n md: {\n content: {\n paddingInline: '12',\n paddingBlock: '8',\n borderRadius: '8',\n },\n },\n lg: {\n content: {\n padding: '16',\n borderRadius: '8',\n },\n },\n },\n textStyle: {\n 'sm/regular': {\n content: {\n textStyle: 'body/sm/regular',\n },\n },\n 'sm/semibold': {\n content: {\n textStyle: 'body/sm/semibold',\n },\n },\n 'md/regular': {\n content: {\n textStyle: 'body/md/regular',\n },\n },\n },\n} as const;\n"],"mappings":";;;;;;AAMA,IAAa,OAAO;CAClB,YAAY,EACV,YAAY,OACd;CACA,SAAS;EACP,gBAAgB;EAChB,iBAAiB;EAMjB,UAAU,IAAI,GAAG;EACjB,OAAO;EACP,WAAW;EACX,QAAQ;EACR,iBAAiB;EACjB,OAAO;GACL,gBAAgB;GAChB,mBAAmB;EACrB;EACA,SAAS;GACP,gBAAgB;GAChB,mBAAmB;EACrB;CACF;CACA,OAAO;EACL,gBAAgB,IAAI,CAAC;EACrB,sBAAsB;CACxB;CACA,UAAU;EACR,gBAAgB;EAChB,wBAAwB;EACxB,aAAa;CACf;AACF;AAEA,IAAa,WAAW;CACtB,SAAS;EACP,MAAM,EACJ,SAAS;GACP,gBAAgB;GAChB,OAAO;EACT,EACF;EACA,OAAO,EACL,SAAS;GACP,gBAAgB;GAChB,OAAO;EACT,EACF;CACF;CACA,aAAa;EACX,IAAI,EACF,SAAS;GACP,eAAe;GACf,cAAc;GACd,cAAc;EAChB,EACF;EACA,IAAI,EACF,SAAS;GACP,eAAe;GACf,cAAc;GACd,cAAc;EAChB,EACF;EACA,IAAI,EACF,SAAS;GACP,SAAS;GACT,cAAc;EAChB,EACF;CACF;CACA,WAAW;EACT,cAAc,EACZ,SAAS,EACP,WAAW,kBACb,EACF;EACA,eAAe,EACb,SAAS,EACP,WAAW,mBACb,EACF;EACA,cAAc,EACZ,SAAS,EACP,WAAW,kBACb,EACF;CACF;AACF"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BitkitToggletip: the tooltip's bubble on a popover, so it opens on click and tap and its link and
|
|
3
|
+
* button take focus. Wider and roomier than a tooltip, since it carries an action row.
|
|
4
|
+
*/
|
|
5
|
+
declare const toggletipSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"anchor" | "content" | "body" | "footer" | "header" | "title" | "trigger" | "arrow" | "arrowTip" | "positioner" | "closeTrigger" | "indicator" | "description", {
|
|
6
|
+
readonly variant: {
|
|
7
|
+
readonly dark: {
|
|
8
|
+
readonly content: {
|
|
9
|
+
readonly '--tooltip-bg': "colors.background/contrast";
|
|
10
|
+
readonly color: "text/on-contrast";
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
readonly light: {
|
|
14
|
+
readonly content: {
|
|
15
|
+
readonly '--tooltip-bg': "colors.background/tertiary";
|
|
16
|
+
readonly color: "text/primary";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly paddingSize: {
|
|
21
|
+
readonly sm: {
|
|
22
|
+
readonly content: {
|
|
23
|
+
readonly paddingInline: "8";
|
|
24
|
+
readonly paddingBlock: "4";
|
|
25
|
+
readonly borderRadius: "4";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
readonly md: {
|
|
29
|
+
readonly content: {
|
|
30
|
+
readonly paddingInline: "12";
|
|
31
|
+
readonly paddingBlock: "8";
|
|
32
|
+
readonly borderRadius: "8";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
readonly lg: {
|
|
36
|
+
readonly content: {
|
|
37
|
+
readonly padding: "16";
|
|
38
|
+
readonly borderRadius: "8";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly textStyle: {
|
|
43
|
+
readonly 'sm/regular': {
|
|
44
|
+
readonly content: {
|
|
45
|
+
readonly textStyle: "body/sm/regular";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
readonly 'sm/semibold': {
|
|
49
|
+
readonly content: {
|
|
50
|
+
readonly textStyle: "body/sm/semibold";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly 'md/regular': {
|
|
54
|
+
readonly content: {
|
|
55
|
+
readonly textStyle: "body/md/regular";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
60
|
+
export default toggletipSlotRecipe;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { rem } from "../themeUtils.js";
|
|
2
|
+
import { base, variants } from "../common/TooltipAndToggletip.common.js";
|
|
3
|
+
import { defineSlotRecipe } from "@chakra-ui/react/styled-system";
|
|
4
|
+
import { popoverAnatomy } from "@chakra-ui/react/anatomy";
|
|
5
|
+
//#region lib/theme/slot-recipes/Toggletip.recipe.ts
|
|
6
|
+
/**
|
|
7
|
+
* BitkitToggletip: the tooltip's bubble on a popover, so it opens on click and tap and its link and
|
|
8
|
+
* button take focus. Wider and roomier than a tooltip, since it carries an action row.
|
|
9
|
+
*/
|
|
10
|
+
var toggletipSlotRecipe = defineSlotRecipe({
|
|
11
|
+
className: "toggletip",
|
|
12
|
+
slots: popoverAnatomy.keys(),
|
|
13
|
+
base: {
|
|
14
|
+
...base,
|
|
15
|
+
content: {
|
|
16
|
+
...base.content,
|
|
17
|
+
minWidth: rem(240),
|
|
18
|
+
focusVisibleRing: "outside"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
variants,
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "dark",
|
|
24
|
+
paddingSize: "lg",
|
|
25
|
+
textStyle: "md/regular"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { toggletipSlotRecipe as default };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=Toggletip.recipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toggletip.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/Toggletip.recipe.ts"],"sourcesContent":["import { popoverAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nimport { base, variants } from '../common/TooltipAndToggletip.common';\nimport { rem } from '../themeUtils';\n\n/**\n * BitkitToggletip: the tooltip's bubble on a popover, so it opens on click and tap and its link and\n * button take focus. Wider and roomier than a tooltip, since it carries an action row.\n */\nconst toggletipSlotRecipe = defineSlotRecipe({\n className: 'toggletip',\n slots: popoverAnatomy.keys(),\n base: {\n ...base,\n content: {\n ...base.content,\n minWidth: rem(240),\n // Without a link or a button the content itself takes focus; the global ring skips tabindex=\"-1\".\n focusVisibleRing: 'outside',\n },\n },\n variants,\n defaultVariants: {\n variant: 'dark',\n paddingSize: 'lg',\n textStyle: 'md/regular',\n },\n});\n\nexport default toggletipSlotRecipe;\n"],"mappings":";;;;;;;;;AAUA,IAAM,sBAAsB,iBAAiB;CAC3C,WAAW;CACX,OAAO,eAAe,KAAK;CAC3B,MAAM;EACJ,GAAG;EACH,SAAS;GACP,GAAG,KAAK;GACR,UAAU,IAAI,GAAG;GAEjB,kBAAkB;EACpB;CACF;CACA;CACA,iBAAiB;EACf,SAAS;EACT,aAAa;EACb,WAAW;CACb;AACF,CAAC"}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
declare const tooltipSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "trigger" | "arrow" | "arrowTip" | "positioner", {
|
|
2
|
-
variant: {
|
|
3
|
-
dark: {
|
|
4
|
-
content: {
|
|
5
|
-
'--tooltip-bg': "colors.background/contrast";
|
|
6
|
-
color: "text/on-contrast";
|
|
2
|
+
readonly variant: {
|
|
3
|
+
readonly dark: {
|
|
4
|
+
readonly content: {
|
|
5
|
+
readonly '--tooltip-bg': "colors.background/contrast";
|
|
6
|
+
readonly color: "text/on-contrast";
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
light: {
|
|
10
|
-
content: {
|
|
11
|
-
'--tooltip-bg': "colors.background/tertiary";
|
|
12
|
-
color: "text/primary";
|
|
9
|
+
readonly light: {
|
|
10
|
+
readonly content: {
|
|
11
|
+
readonly '--tooltip-bg': "colors.background/tertiary";
|
|
12
|
+
readonly color: "text/primary";
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
paddingSize: {
|
|
17
|
-
sm: {
|
|
18
|
-
content: {
|
|
19
|
-
paddingInline: "8";
|
|
20
|
-
paddingBlock: "4";
|
|
21
|
-
borderRadius: "4";
|
|
16
|
+
readonly paddingSize: {
|
|
17
|
+
readonly sm: {
|
|
18
|
+
readonly content: {
|
|
19
|
+
readonly paddingInline: "8";
|
|
20
|
+
readonly paddingBlock: "4";
|
|
21
|
+
readonly borderRadius: "4";
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
md: {
|
|
25
|
-
content: {
|
|
26
|
-
paddingInline: "12";
|
|
27
|
-
paddingBlock: "8";
|
|
28
|
-
borderRadius: "8";
|
|
24
|
+
readonly md: {
|
|
25
|
+
readonly content: {
|
|
26
|
+
readonly paddingInline: "12";
|
|
27
|
+
readonly paddingBlock: "8";
|
|
28
|
+
readonly borderRadius: "8";
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
lg: {
|
|
32
|
-
content: {
|
|
33
|
-
padding: "16";
|
|
34
|
-
borderRadius: "8";
|
|
31
|
+
readonly lg: {
|
|
32
|
+
readonly content: {
|
|
33
|
+
readonly padding: "16";
|
|
34
|
+
readonly borderRadius: "8";
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
textStyle: {
|
|
39
|
-
'sm/regular': {
|
|
40
|
-
content: {
|
|
41
|
-
textStyle: "body/sm/regular";
|
|
38
|
+
readonly textStyle: {
|
|
39
|
+
readonly 'sm/regular': {
|
|
40
|
+
readonly content: {
|
|
41
|
+
readonly textStyle: "body/sm/regular";
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
'sm/semibold': {
|
|
45
|
-
content: {
|
|
46
|
-
textStyle: "body/sm/semibold";
|
|
44
|
+
readonly 'sm/semibold': {
|
|
45
|
+
readonly content: {
|
|
46
|
+
readonly textStyle: "body/sm/semibold";
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
'md/regular': {
|
|
50
|
-
content: {
|
|
51
|
-
textStyle: "body/md/regular";
|
|
49
|
+
readonly 'md/regular': {
|
|
50
|
+
readonly content: {
|
|
51
|
+
readonly textStyle: "body/md/regular";
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { base, variants } from "../common/TooltipAndToggletip.common.js";
|
|
2
2
|
import { defineSlotRecipe } from "@chakra-ui/react/styled-system";
|
|
3
3
|
import { tooltipAnatomy } from "@chakra-ui/react/anatomy";
|
|
4
4
|
//#region lib/theme/slot-recipes/Tooltip.recipe.ts
|
|
@@ -6,70 +6,13 @@ var tooltipSlotRecipe = defineSlotRecipe({
|
|
|
6
6
|
className: "tooltip",
|
|
7
7
|
slots: tooltipAnatomy.keys(),
|
|
8
8
|
base: {
|
|
9
|
+
...base,
|
|
9
10
|
positioner: {
|
|
10
|
-
|
|
11
|
+
...base.positioner,
|
|
11
12
|
pointerEvents: "none"
|
|
12
|
-
},
|
|
13
|
-
content: {
|
|
14
|
-
"--tooltip-bg": "colors.background/contrast",
|
|
15
|
-
backgroundColor: "var(--tooltip-bg)",
|
|
16
|
-
maxWidth: rem(320),
|
|
17
|
-
color: "text/on-contrast",
|
|
18
|
-
boxShadow: "elevation/tooltip",
|
|
19
|
-
zIndex: "tooltip",
|
|
20
|
-
transformOrigin: "var(--transform-origin)",
|
|
21
|
-
_open: {
|
|
22
|
-
animationStyle: "scale-fade-in",
|
|
23
|
-
animationDuration: "fast"
|
|
24
|
-
},
|
|
25
|
-
_closed: {
|
|
26
|
-
animationStyle: "scale-fade-out",
|
|
27
|
-
animationDuration: "fast"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
arrow: {
|
|
31
|
-
"--arrow-size": rem(8),
|
|
32
|
-
"--arrow-background": "var(--tooltip-bg)"
|
|
33
|
-
},
|
|
34
|
-
arrowTip: {
|
|
35
|
-
borderTopWidth: "1",
|
|
36
|
-
borderInlineStartWidth: "1",
|
|
37
|
-
borderColor: "var(--tooltip-bg)"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
variants: {
|
|
41
|
-
variant: {
|
|
42
|
-
dark: { content: {
|
|
43
|
-
"--tooltip-bg": "colors.background/contrast",
|
|
44
|
-
color: "text/on-contrast"
|
|
45
|
-
} },
|
|
46
|
-
light: { content: {
|
|
47
|
-
"--tooltip-bg": "colors.background/tertiary",
|
|
48
|
-
color: "text/primary"
|
|
49
|
-
} }
|
|
50
|
-
},
|
|
51
|
-
paddingSize: {
|
|
52
|
-
sm: { content: {
|
|
53
|
-
paddingInline: "8",
|
|
54
|
-
paddingBlock: "4",
|
|
55
|
-
borderRadius: "4"
|
|
56
|
-
} },
|
|
57
|
-
md: { content: {
|
|
58
|
-
paddingInline: "12",
|
|
59
|
-
paddingBlock: "8",
|
|
60
|
-
borderRadius: "8"
|
|
61
|
-
} },
|
|
62
|
-
lg: { content: {
|
|
63
|
-
padding: "16",
|
|
64
|
-
borderRadius: "8"
|
|
65
|
-
} }
|
|
66
|
-
},
|
|
67
|
-
textStyle: {
|
|
68
|
-
"sm/regular": { content: { textStyle: "body/sm/regular" } },
|
|
69
|
-
"sm/semibold": { content: { textStyle: "body/sm/semibold" } },
|
|
70
|
-
"md/regular": { content: { textStyle: "body/md/regular" } }
|
|
71
13
|
}
|
|
72
14
|
},
|
|
15
|
+
variants,
|
|
73
16
|
defaultVariants: {
|
|
74
17
|
variant: "dark",
|
|
75
18
|
paddingSize: "md",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/Tooltip.recipe.ts"],"sourcesContent":["import { tooltipAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nimport {
|
|
1
|
+
{"version":3,"file":"Tooltip.recipe.js","names":[],"sources":["../../../lib/theme/slot-recipes/Tooltip.recipe.ts"],"sourcesContent":["import { tooltipAnatomy } from '@chakra-ui/react/anatomy';\nimport { defineSlotRecipe } from '@chakra-ui/react/styled-system';\n\nimport { base, variants } from '../common/TooltipAndToggletip.common';\n\nconst tooltipSlotRecipe = defineSlotRecipe({\n className: 'tooltip',\n slots: tooltipAnatomy.keys(),\n base: {\n ...base,\n positioner: {\n ...base.positioner,\n // A tooltip holds only text, so it never takes the pointer.\n pointerEvents: 'none',\n },\n },\n variants,\n defaultVariants: {\n variant: 'dark',\n paddingSize: 'md',\n textStyle: 'md/regular',\n },\n});\n\nexport default tooltipSlotRecipe;\n"],"mappings":";;;;AAKA,IAAM,oBAAoB,iBAAiB;CACzC,WAAW;CACX,OAAO,eAAe,KAAK;CAC3B,MAAM;EACJ,GAAG;EACH,YAAY;GACV,GAAG,KAAK;GAER,eAAe;EACjB;CACF;CACA;CACA,iBAAiB;EACf,SAAS;EACT,aAAa;EACb,WAAW;CACb;AACF,CAAC"}
|