@particle-network/ui-react 0.3.0-beta.4 → 0.3.0-beta.6

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.
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type UXTooltipProps } from '..';
3
3
  export type UXHintProps = UXTooltipProps & {
4
+ triggerType?: 'hover' | 'click';
4
5
  buttonClassName?: string;
5
6
  iconClassName?: string;
6
7
  };
@@ -1,20 +1,31 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { cn } from "@heroui/theme";
4
- import { Center, UXTooltip } from "../index.js";
4
+ import { Center, UXPopover, UXPopoverContent, UXPopoverTrigger, UXTooltip } from "../index.js";
5
5
  import { CircleQuestionIcon } from "../../icons/index.js";
6
6
  const UXHint_UXHint = (props)=>{
7
- const { content, children, buttonClassName, iconClassName, ...restProps } = props;
8
- return /*#__PURE__*/ jsx(UXTooltip, {
9
- content: content || children,
10
- ...restProps,
11
- children: /*#__PURE__*/ jsx(Center, {
7
+ const { content, children, buttonClassName, iconClassName, triggerType = 'hover', ...restProps } = props;
8
+ const renderTriggerContent = ()=>/*#__PURE__*/ jsx(Center, {
12
9
  className: cn('size-4 cursor-pointer', buttonClassName),
13
10
  children: /*#__PURE__*/ jsx(CircleQuestionIcon, {
14
11
  size: 14,
15
12
  className: iconClassName
16
13
  })
17
- })
14
+ });
15
+ if ('hover' === triggerType) return /*#__PURE__*/ jsx(UXTooltip, {
16
+ content: content || children,
17
+ ...restProps,
18
+ children: renderTriggerContent()
19
+ });
20
+ return /*#__PURE__*/ jsxs(UXPopover, {
21
+ children: [
22
+ /*#__PURE__*/ jsx(UXPopoverTrigger, {
23
+ children: renderTriggerContent()
24
+ }),
25
+ /*#__PURE__*/ jsx(UXPopoverContent, {
26
+ children: content || children
27
+ })
28
+ ]
18
29
  });
19
30
  };
20
31
  UXHint_UXHint.displayName = 'UX.Hint';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-react",
3
- "version": "0.3.0-beta.4",
3
+ "version": "0.3.0-beta.6",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -39,8 +39,8 @@
39
39
  "@types/react": "^19.1.10",
40
40
  "react": "^19.1.0",
41
41
  "typescript": "^5.8.3",
42
- "@particle-network/eslint-config": "0.3.0",
43
- "@particle-network/lintstaged-config": "0.1.0"
42
+ "@particle-network/lintstaged-config": "0.1.0",
43
+ "@particle-network/eslint-config": "0.3.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": ">=16.9.0",