@particle-network/ui-react 0.3.0-beta.15 → 0.3.0-beta.16

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.
@@ -4,6 +4,7 @@ import { ToastProvider, addToast, closeAll, closeToast } from "@heroui/toast";
4
4
  import CircleCheckIcon from "@particle-network/icons/web/CircleCheckIcon";
5
5
  import CircleCloseIcon from "@particle-network/icons/web/CircleCloseIcon";
6
6
  import CloseIcon from "@particle-network/icons/web/CloseIcon";
7
+ import { hasLongWord } from "../../utils/index.js";
7
8
  import { UXSpinner } from "../UXSpinner/index.js";
8
9
  const UXToastProvider = ()=>/*#__PURE__*/ jsx(ToastProvider, {
9
10
  disableAnimation: true,
@@ -29,12 +30,6 @@ const getIcon = (type)=>{
29
30
  });
30
31
  return null;
31
32
  };
32
- const hasLongWord = (text)=>{
33
- if ('string' != typeof text) return false;
34
- const englishWords = text.match(/[a-zA-Z0-9_-]+/g);
35
- if (!englishWords) return false;
36
- return englishWords.some((word)=>word.length > 30);
37
- };
38
33
  const show = (props)=>{
39
34
  const { type, hideCloseButton, variant, classNames, description, ...toastProps } = props ?? {};
40
35
  const { base, description: descriptionClassName, icon, loadingComponent, content, closeButton, ...restClassNames } = classNames ?? {};
@@ -1,5 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
+ import { hasLongWord } from "../../utils/index.js";
3
4
  import tooltip_extend from "./tooltip.extend.js";
4
5
  const renderContent = (content)=>{
5
6
  if (!content) return null;
@@ -13,9 +14,17 @@ const renderContent = (content)=>{
13
14
  ]);
14
15
  };
15
16
  const UXTooltip = (props)=>{
16
- const { content, ...restProps } = props;
17
+ const { content, classNames, ...restProps } = props;
18
+ const { content: contentClassName, ...restClassNames } = classNames ?? {};
17
19
  return /*#__PURE__*/ jsx(tooltip_extend, {
18
20
  content: renderContent(content),
21
+ classNames: {
22
+ content: [
23
+ hasLongWord(content) && 'break-all',
24
+ contentClassName
25
+ ],
26
+ ...restClassNames
27
+ },
19
28
  ...restProps
20
29
  });
21
30
  };
@@ -0,0 +1,2 @@
1
+ import type React from 'react';
2
+ export declare const hasLongWord: (text: React.ReactNode) => boolean;
@@ -0,0 +1,7 @@
1
+ const hasLongWord = (text)=>{
2
+ if ('string' != typeof text) return false;
3
+ const englishWords = text.match(/[a-zA-Z0-9_-]+/g);
4
+ if (!englishWords) return false;
5
+ return englishWords.some((word)=>word.length > 30);
6
+ };
7
+ export { hasLongWord };
@@ -1,3 +1,4 @@
1
1
  export { absoluteFullClasses, baseStyles, collapseAdjacentVariantBorders, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses, } from './classes';
2
+ export * from './detect';
2
3
  export * from './input-classes';
3
4
  export { colorVariants } from './variants';
@@ -1,4 +1,5 @@
1
1
  import { absoluteFullClasses, baseStyles, collapseAdjacentVariantBorders, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses } from "./classes.js";
2
2
  import { colorVariants } from "./variants.js";
3
+ export * from "./detect.js";
3
4
  export * from "./input-classes.js";
4
5
  export { absoluteFullClasses, baseStyles, collapseAdjacentVariantBorders, colorVariants, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, hiddenInputClasses, ringClasses, translateCenterClasses };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-react",
3
- "version": "0.3.0-beta.15",
3
+ "version": "0.3.0-beta.16",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {