@cerberus-design/react 0.12.0-next-bd594cf → 0.12.0-next-635644c
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/build/legacy/_tsup-dts-rollup.d.cts +31 -0
- package/build/legacy/components/Tooltip.cjs +55 -0
- package/build/legacy/components/Tooltip.cjs.map +1 -0
- package/build/legacy/index.cjs +112 -83
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +31 -0
- package/build/modern/chunk-KML4CTMK.js +33 -0
- package/build/modern/chunk-KML4CTMK.js.map +1 -0
- package/build/modern/components/Tooltip.js +7 -0
- package/build/modern/components/Tooltip.js.map +1 -0
- package/build/modern/index.js +4 -0
- package/build/modern/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Tooltip.tsx +61 -0
- package/src/index.ts +1 -0
|
@@ -130,6 +130,7 @@ import { TdVariantProps } from '@cerberus/styled-system/recipes';
|
|
|
130
130
|
import type { TextareaHTMLAttributes } from 'react';
|
|
131
131
|
import { ThVariantProps } from '@cerberus/styled-system/recipes';
|
|
132
132
|
import { ToggleVariantProps } from '@cerberus/styled-system/recipes';
|
|
133
|
+
import { TooltipContentProps } from '@ark-ui/react/tooltip';
|
|
133
134
|
import { TouchSensor } from '@dnd-kit/core';
|
|
134
135
|
import { TouchSensorOptions } from '@dnd-kit/core';
|
|
135
136
|
import { Translate } from '@dnd-kit/core';
|
|
@@ -2731,6 +2732,36 @@ declare type ToggleProps = ToggleBase & ToggleVariantProps;
|
|
|
2731
2732
|
export { ToggleProps }
|
|
2732
2733
|
export { ToggleProps as ToggleProps_alias_1 }
|
|
2733
2734
|
|
|
2735
|
+
/**
|
|
2736
|
+
* The Tooltip component is used to provide additional information about an element when it is hovered over.
|
|
2737
|
+
* @definition [Tooltip docs](https://cerberus.digitalu.design/react/tooltip)
|
|
2738
|
+
* @example
|
|
2739
|
+
* ```tsx
|
|
2740
|
+
* <Tooltip content="This is a tooltip">
|
|
2741
|
+
* <Information />
|
|
2742
|
+
* </Tooltip>
|
|
2743
|
+
*/
|
|
2744
|
+
declare function Tooltip(props: TooltipProps & TooltipContentProps): JSX_2.Element;
|
|
2745
|
+
export { Tooltip }
|
|
2746
|
+
export { Tooltip as Tooltip_alias_1 }
|
|
2747
|
+
|
|
2748
|
+
/**
|
|
2749
|
+
* This module contains the Tooltip component.
|
|
2750
|
+
* @module Tooltip
|
|
2751
|
+
*/
|
|
2752
|
+
declare interface TooltipProps {
|
|
2753
|
+
/**
|
|
2754
|
+
* The text content to display in the tooltip.
|
|
2755
|
+
*/
|
|
2756
|
+
content: ReactNode;
|
|
2757
|
+
/**
|
|
2758
|
+
* The position of the tooltip relative to the trigger element.
|
|
2759
|
+
*/
|
|
2760
|
+
position?: 'top' | 'right' | 'bottom' | 'left';
|
|
2761
|
+
}
|
|
2762
|
+
export { TooltipProps }
|
|
2763
|
+
export { TooltipProps as TooltipProps_alias_1 }
|
|
2764
|
+
|
|
2734
2765
|
export { TouchSensor }
|
|
2735
2766
|
|
|
2736
2767
|
export { TouchSensorOptions }
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/components/Tooltip.tsx
|
|
2
|
+
import {
|
|
3
|
+
Tooltip as ArkTooltip
|
|
4
|
+
} from "@ark-ui/react/tooltip";
|
|
5
|
+
import { cx } from "@cerberus/styled-system/css";
|
|
6
|
+
import { tooltip } from "@cerberus/styled-system/recipes";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function Tooltip(props) {
|
|
9
|
+
const { content, children, ...nativeProps } = props;
|
|
10
|
+
const styles = tooltip();
|
|
11
|
+
const position = {
|
|
12
|
+
placement: props.position || "top"
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ jsxs(ArkTooltip.Root, { openDelay: 400, positioning: position, children: [
|
|
15
|
+
/* @__PURE__ */ jsx(ArkTooltip.Trigger, { className: styles.trigger, children }),
|
|
16
|
+
/* @__PURE__ */ jsx(ArkTooltip.Positioner, { children: /* @__PURE__ */ jsxs(
|
|
17
|
+
ArkTooltip.Content,
|
|
18
|
+
{
|
|
19
|
+
...nativeProps,
|
|
20
|
+
className: cx(nativeProps.className, styles.content),
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx(ArkTooltip.Arrow, { className: styles.arrow, children: /* @__PURE__ */ jsx(ArkTooltip.ArrowTip, { className: styles.arrowTip }) }),
|
|
23
|
+
content
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
) })
|
|
27
|
+
] });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
Tooltip
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=chunk-KML4CTMK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Tooltip.tsx"],"sourcesContent":["import {\n Tooltip as ArkTooltip,\n type TooltipContentProps,\n} from '@ark-ui/react/tooltip'\nimport { cx } from '@cerberus/styled-system/css'\nimport { tooltip } from '@cerberus/styled-system/recipes'\nimport type { ReactNode } from 'react'\n\n/**\n * This module contains the Tooltip component.\n * @module Tooltip\n */\n\nexport interface TooltipProps {\n /**\n * The text content to display in the tooltip.\n */\n content: ReactNode\n /**\n * The position of the tooltip relative to the trigger element.\n */\n position?: 'top' | 'right' | 'bottom' | 'left'\n}\n\n/**\n * The Tooltip component is used to provide additional information about an element when it is hovered over.\n * @definition [Tooltip docs](https://cerberus.digitalu.design/react/tooltip)\n * @example\n * ```tsx\n * <Tooltip content=\"This is a tooltip\">\n * <Information />\n * </Tooltip>\n */\nexport function Tooltip(props: TooltipProps & TooltipContentProps) {\n const { content, children, ...nativeProps } = props\n const styles = tooltip()\n const position = {\n placement: props.position || 'top',\n }\n\n return (\n <ArkTooltip.Root openDelay={400} positioning={position}>\n <ArkTooltip.Trigger className={styles.trigger}>\n {children}\n </ArkTooltip.Trigger>\n\n <ArkTooltip.Positioner>\n <ArkTooltip.Content\n {...nativeProps}\n className={cx(nativeProps.className, styles.content)}\n >\n <ArkTooltip.Arrow className={styles.arrow}>\n <ArkTooltip.ArrowTip className={styles.arrowTip} />\n </ArkTooltip.Arrow>\n\n {content}\n </ArkTooltip.Content>\n </ArkTooltip.Positioner>\n </ArkTooltip.Root>\n )\n}\n"],"mappings":";AAAA;AAAA,EACE,WAAW;AAAA,OAEN;AACP,SAAS,UAAU;AACnB,SAAS,eAAe;AAqClB,cAKE,YALF;AATC,SAAS,QAAQ,OAA2C;AACjE,QAAM,EAAE,SAAS,UAAU,GAAG,YAAY,IAAI;AAC9C,QAAM,SAAS,QAAQ;AACvB,QAAM,WAAW;AAAA,IACf,WAAW,MAAM,YAAY;AAAA,EAC/B;AAEA,SACE,qBAAC,WAAW,MAAX,EAAgB,WAAW,KAAK,aAAa,UAC5C;AAAA,wBAAC,WAAW,SAAX,EAAmB,WAAW,OAAO,SACnC,UACH;AAAA,IAEA,oBAAC,WAAW,YAAX,EACC;AAAA,MAAC,WAAW;AAAA,MAAX;AAAA,QACE,GAAG;AAAA,QACJ,WAAW,GAAG,YAAY,WAAW,OAAO,OAAO;AAAA,QAEnD;AAAA,8BAAC,WAAW,OAAX,EAAiB,WAAW,OAAO,OAClC,8BAAC,WAAW,UAAX,EAAoB,WAAW,OAAO,UAAU,GACnD;AAAA,UAEC;AAAA;AAAA;AAAA,IACH,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/build/modern/index.js
CHANGED
|
@@ -2,6 +2,9 @@ import {
|
|
|
2
2
|
ThemeProvider,
|
|
3
3
|
useThemeContext
|
|
4
4
|
} from "./chunk-EB37HRCN.js";
|
|
5
|
+
import {
|
|
6
|
+
Tooltip
|
|
7
|
+
} from "./chunk-KML4CTMK.js";
|
|
5
8
|
import {
|
|
6
9
|
ConfirmModal,
|
|
7
10
|
useConfirmModal
|
|
@@ -280,6 +283,7 @@ export {
|
|
|
280
283
|
Thead,
|
|
281
284
|
ThemeProvider,
|
|
282
285
|
Toggle,
|
|
286
|
+
Tooltip,
|
|
283
287
|
Tr,
|
|
284
288
|
createNavTriggerProps,
|
|
285
289
|
defineIcons,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Admonition'\nexport * from './components/Avatar'\nexport * from './components/Button'\nexport * from './components/Checkbox'\nexport * from './components/CircularProgress'\nexport * from './components/Droppable'\nexport * from './components/FieldMessage'\nexport * from './components/FeatureFlag'\nexport * from './components/Fieldset'\nexport * from './components/FieldsetLabel'\nexport * from './components/FileStatus'\nexport * from './components/FileUploader'\nexport * from './components/IconButton'\nexport * from './components/Input'\nexport * from './components/Label'\nexport * from './components/Legend'\nexport * from './components/Menu'\nexport * from './components/Modal'\nexport * from './components/ModalHeader'\nexport * from './components/ModalHeading'\nexport * from './components/ModalDescription'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Notification'\nexport * from './components/NotificationHeading'\nexport * from './components/NotificationDescription'\nexport * from './components/Portal'\nexport * from './components/ProgressBar'\nexport * from './components/Radio'\nexport * from './components/Select'\nexport * from './components/Spinner'\nexport * from './components/Tab'\nexport * from './components/TabList'\nexport * from './components/TabPanel'\nexport * from './components/Table'\nexport * from './components/Thead'\nexport * from './components/Th'\nexport * from './components/Td'\nexport * from './components/Tbody'\nexport * from './components/Tag'\nexport * from './components/Textarea'\nexport * from './components/Toggle'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/confirm-modal'\nexport * from './context/cta-modal'\nexport * from './context/feature-flags'\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/notification-center'\nexport * from './context/prompt-modal'\nexport * from './context/tabs'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useModal'\nexport * from './hooks/useTheme'\nexport * from './hooks/useToggle'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\nexport * from './aria-helpers/tabs.aria'\nexport * from './aria-helpers/trap-focus.aria'\n\n// utils\n\nexport * from './config/defineIcons'\nexport * from './utils/index'\n\n// shared types\n\nexport * from './types'\n\n// 3rd party\n\nexport * from '@dnd-kit/core'\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// components\n\nexport * from './components/Admonition'\nexport * from './components/Avatar'\nexport * from './components/Button'\nexport * from './components/Checkbox'\nexport * from './components/CircularProgress'\nexport * from './components/Droppable'\nexport * from './components/FieldMessage'\nexport * from './components/FeatureFlag'\nexport * from './components/Fieldset'\nexport * from './components/FieldsetLabel'\nexport * from './components/FileStatus'\nexport * from './components/FileUploader'\nexport * from './components/IconButton'\nexport * from './components/Input'\nexport * from './components/Label'\nexport * from './components/Legend'\nexport * from './components/Menu'\nexport * from './components/Modal'\nexport * from './components/ModalHeader'\nexport * from './components/ModalHeading'\nexport * from './components/ModalDescription'\nexport * from './components/NavMenuTrigger'\nexport * from './components/NavMenuList'\nexport * from './components/NavMenuLink'\nexport * from './components/Notification'\nexport * from './components/NotificationHeading'\nexport * from './components/NotificationDescription'\nexport * from './components/Portal'\nexport * from './components/ProgressBar'\nexport * from './components/Radio'\nexport * from './components/Select'\nexport * from './components/Spinner'\nexport * from './components/Tab'\nexport * from './components/TabList'\nexport * from './components/TabPanel'\nexport * from './components/Table'\nexport * from './components/Thead'\nexport * from './components/Th'\nexport * from './components/Td'\nexport * from './components/Tbody'\nexport * from './components/Tag'\nexport * from './components/Textarea'\nexport * from './components/Toggle'\nexport * from './components/Tooltip'\nexport * from './components/Show'\n\n// context\n\nexport * from './context/confirm-modal'\nexport * from './context/cta-modal'\nexport * from './context/feature-flags'\nexport * from './context/field'\nexport * from './context/navMenu'\nexport * from './context/notification-center'\nexport * from './context/prompt-modal'\nexport * from './context/tabs'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useModal'\nexport * from './hooks/useTheme'\nexport * from './hooks/useToggle'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\nexport * from './aria-helpers/tabs.aria'\nexport * from './aria-helpers/trap-focus.aria'\n\n// utils\n\nexport * from './config/defineIcons'\nexport * from './utils/index'\n\n// shared types\n\nexport * from './types'\n\n// 3rd party\n\nexport * from '@dnd-kit/core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerberus-design/react",
|
|
3
|
-
"version": "0.12.0-next-
|
|
3
|
+
"version": "0.12.0-next-635644c",
|
|
4
4
|
"description": "The Cerberus Design React component library.",
|
|
5
5
|
"browserslist": "> 0.25%, not dead",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"react": "^18",
|
|
27
27
|
"react-dom": "^18",
|
|
28
28
|
"tsup": "^8.1.0",
|
|
29
|
-
"@cerberus-design/
|
|
30
|
-
"@cerberus-design/
|
|
29
|
+
"@cerberus-design/styled-system": "0.12.0-next-635644c",
|
|
30
|
+
"@cerberus-design/configs": "0.0.0"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip as ArkTooltip,
|
|
3
|
+
type TooltipContentProps,
|
|
4
|
+
} from '@ark-ui/react/tooltip'
|
|
5
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
6
|
+
import { tooltip } from '@cerberus/styled-system/recipes'
|
|
7
|
+
import type { ReactNode } from 'react'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This module contains the Tooltip component.
|
|
11
|
+
* @module Tooltip
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export interface TooltipProps {
|
|
15
|
+
/**
|
|
16
|
+
* The text content to display in the tooltip.
|
|
17
|
+
*/
|
|
18
|
+
content: ReactNode
|
|
19
|
+
/**
|
|
20
|
+
* The position of the tooltip relative to the trigger element.
|
|
21
|
+
*/
|
|
22
|
+
position?: 'top' | 'right' | 'bottom' | 'left'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The Tooltip component is used to provide additional information about an element when it is hovered over.
|
|
27
|
+
* @definition [Tooltip docs](https://cerberus.digitalu.design/react/tooltip)
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Tooltip content="This is a tooltip">
|
|
31
|
+
* <Information />
|
|
32
|
+
* </Tooltip>
|
|
33
|
+
*/
|
|
34
|
+
export function Tooltip(props: TooltipProps & TooltipContentProps) {
|
|
35
|
+
const { content, children, ...nativeProps } = props
|
|
36
|
+
const styles = tooltip()
|
|
37
|
+
const position = {
|
|
38
|
+
placement: props.position || 'top',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<ArkTooltip.Root openDelay={400} positioning={position}>
|
|
43
|
+
<ArkTooltip.Trigger className={styles.trigger}>
|
|
44
|
+
{children}
|
|
45
|
+
</ArkTooltip.Trigger>
|
|
46
|
+
|
|
47
|
+
<ArkTooltip.Positioner>
|
|
48
|
+
<ArkTooltip.Content
|
|
49
|
+
{...nativeProps}
|
|
50
|
+
className={cx(nativeProps.className, styles.content)}
|
|
51
|
+
>
|
|
52
|
+
<ArkTooltip.Arrow className={styles.arrow}>
|
|
53
|
+
<ArkTooltip.ArrowTip className={styles.arrowTip} />
|
|
54
|
+
</ArkTooltip.Arrow>
|
|
55
|
+
|
|
56
|
+
{content}
|
|
57
|
+
</ArkTooltip.Content>
|
|
58
|
+
</ArkTooltip.Positioner>
|
|
59
|
+
</ArkTooltip.Root>
|
|
60
|
+
)
|
|
61
|
+
}
|
package/src/index.ts
CHANGED