@youngonesworks/ui 0.1.43 → 0.1.46
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/dist/components/badge/index.d.ts +1 -1
- package/dist/index.cjs +26 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -17
- package/dist/index.js.map +1 -1
- package/dist/utils/ssr.d.ts +1 -0
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@ interface IBadgeProps {
|
|
|
21
21
|
badgeBorder?: boolean;
|
|
22
22
|
}
|
|
23
23
|
export declare const Badge: {
|
|
24
|
-
({ styleVariant, className, favorite, mobile, badgeBorder, fullWidth, ...props }: IBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
({ styleVariant, className, favorite, mobile, badgeBorder, fullWidth, leftSection, rightSection, children, ...props }: IBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
displayName: string;
|
|
26
26
|
};
|
|
27
27
|
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -103268,7 +103268,7 @@ const AvatarIndicator = ({ indicatorCount, className }) => /* @__PURE__ */ (0, r
|
|
|
103268
103268
|
|
|
103269
103269
|
//#endregion
|
|
103270
103270
|
//#region src/components/badge/index.tsx
|
|
103271
|
-
const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, mobile = false, badgeBorder = false, fullWidth = false,...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
103271
|
+
const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, mobile = false, badgeBorder = false, fullWidth = false, leftSection, rightSection, children,...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
103272
103272
|
"data-testid": "badge",
|
|
103273
103273
|
"data-component": "Badge",
|
|
103274
103274
|
className: clsx_default("inline-flex h-[1.375rem] max-w-full place-content-center items-center p-[10px] align-middle text-xs leading-[20px] font-medium tracking-wide text-wrap whitespace-normal normal-case", mobile ? "rounded-s" : "rounded-[2rem]", fullWidth && "w-full", badgeBorder && {
|
|
@@ -103295,18 +103295,18 @@ const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, mobile =
|
|
|
103295
103295
|
}, className),
|
|
103296
103296
|
...props,
|
|
103297
103297
|
children: [
|
|
103298
|
-
|
|
103298
|
+
leftSection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
103299
103299
|
"data-testid": "left-section",
|
|
103300
|
-
children:
|
|
103300
|
+
children: leftSection
|
|
103301
103301
|
}),
|
|
103302
103302
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
103303
103303
|
"data-testid": "badge-content",
|
|
103304
103304
|
className: cn("block h-5 overflow-hidden text-ellipsis whitespace-nowrap", { "flex items-center": favorite }),
|
|
103305
|
-
children
|
|
103305
|
+
children
|
|
103306
103306
|
}),
|
|
103307
|
-
|
|
103307
|
+
rightSection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
103308
103308
|
"data-testid": "right-section",
|
|
103309
|
-
children:
|
|
103309
|
+
children: rightSection
|
|
103310
103310
|
})
|
|
103311
103311
|
]
|
|
103312
103312
|
});
|
|
@@ -109915,8 +109915,10 @@ const Rating = ({ rating, ratings, size: size$3 = "normal", setReview, className
|
|
|
109915
109915
|
}, index$4))
|
|
109916
109916
|
}),
|
|
109917
109917
|
setReview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
109918
|
-
|
|
109918
|
+
"data-testid": "small-stars-container",
|
|
109919
|
+
className: "mt-4 flex flex-col gap-2",
|
|
109919
109920
|
children: ratings.map(({ value, label }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
109921
|
+
"data-testid": `small-star-item-${value}`,
|
|
109920
109922
|
className: "flex w-auto cursor-pointer items-center gap-1",
|
|
109921
109923
|
onMouseEnter: () => setHoveredSmallStars(value),
|
|
109922
109924
|
onMouseLeave: () => setHoveredSmallStars(0),
|
|
@@ -115691,6 +115693,7 @@ const Select = (0, react.forwardRef)(({ options: options$1, placeholder, default
|
|
|
115691
115693
|
const DropdownIndicator$1 = (props$1) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(components.DropdownIndicator, {
|
|
115692
115694
|
...props$1,
|
|
115693
115695
|
children: props$1.hasValue && isClearable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconX, {
|
|
115696
|
+
"data-testid": "icon-x",
|
|
115694
115697
|
className: "cursor-pointer",
|
|
115695
115698
|
size: 16,
|
|
115696
115699
|
color: "black",
|
|
@@ -116027,9 +116030,9 @@ const TabsBadge = ({ children }) => {
|
|
|
116027
116030
|
const isCircular = typeof children === "number" && children <= 9 || typeof children === "string" && children.length === 1 || false;
|
|
116028
116031
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
116029
116032
|
"data-testid": "tabs-badge",
|
|
116030
|
-
className: clsx_default("bg-pink h-5 text-xs leading-5 font-medium text-white", {
|
|
116031
|
-
"
|
|
116032
|
-
"
|
|
116033
|
+
className: clsx_default("bg-pink h-5 rounded-full text-xs leading-5 font-medium text-white", {
|
|
116034
|
+
"w-5 text-center": isCircular,
|
|
116035
|
+
"px-2": !isCircular
|
|
116033
116036
|
}),
|
|
116034
116037
|
children
|
|
116035
116038
|
});
|
|
@@ -116279,7 +116282,8 @@ const Tooltip = ({ content, children, passedOpen = false, size: size$3 = "md", v
|
|
|
116279
116282
|
height: 17,
|
|
116280
116283
|
tipRadius: 1,
|
|
116281
116284
|
fill: "white",
|
|
116282
|
-
className: "drop-shadow-xl"
|
|
116285
|
+
className: "drop-shadow-xl",
|
|
116286
|
+
"data-testid": "tooltip-arrow"
|
|
116283
116287
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingArrow, {
|
|
116284
116288
|
ref: arrowRef,
|
|
116285
116289
|
context,
|
|
@@ -116287,7 +116291,8 @@ const Tooltip = ({ content, children, passedOpen = false, size: size$3 = "md", v
|
|
|
116287
116291
|
height: 6,
|
|
116288
116292
|
tipRadius: 1,
|
|
116289
116293
|
fill: "white",
|
|
116290
|
-
className: "drop-shadow-xl"
|
|
116294
|
+
className: "drop-shadow-xl",
|
|
116295
|
+
"data-testid": "tooltip-arrow"
|
|
116291
116296
|
})]
|
|
116292
116297
|
})
|
|
116293
116298
|
})] });
|
|
@@ -137626,8 +137631,8 @@ function useEditorState(options$1) {
|
|
|
137626
137631
|
return selectedState;
|
|
137627
137632
|
}
|
|
137628
137633
|
const isDev = "development" !== "production";
|
|
137629
|
-
const isSSR = typeof window === "undefined";
|
|
137630
|
-
const isNext = isSSR || Boolean(typeof window !== "undefined" && window.next);
|
|
137634
|
+
const isSSR$1 = typeof window === "undefined";
|
|
137635
|
+
const isNext = isSSR$1 || Boolean(typeof window !== "undefined" && window.next);
|
|
137631
137636
|
/**
|
|
137632
137637
|
* This class handles the creation, destruction, and re-creation of the editor instance.
|
|
137633
137638
|
*/
|
|
@@ -137673,7 +137678,7 @@ var EditorInstanceManager = class EditorInstanceManager {
|
|
|
137673
137678
|
}
|
|
137674
137679
|
getInitialEditor() {
|
|
137675
137680
|
if (this.options.current.immediatelyRender === undefined) {
|
|
137676
|
-
if (isSSR || isNext) {
|
|
137681
|
+
if (isSSR$1 || isNext) {
|
|
137677
137682
|
if (isDev) {
|
|
137678
137683
|
/**
|
|
137679
137684
|
* Throw an error in development, to make sure the developer is aware that tiptap cannot be SSR'd
|
|
@@ -137685,7 +137690,7 @@ var EditorInstanceManager = class EditorInstanceManager {
|
|
|
137685
137690
|
}
|
|
137686
137691
|
return this.createEditor();
|
|
137687
137692
|
}
|
|
137688
|
-
if (this.options.current.immediatelyRender && isSSR && isDev) {
|
|
137693
|
+
if (this.options.current.immediatelyRender && isSSR$1 && isDev) {
|
|
137689
137694
|
throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");
|
|
137690
137695
|
}
|
|
137691
137696
|
if (this.options.current.immediatelyRender) {
|
|
@@ -140413,6 +140418,10 @@ const StarterKit = Extension.create({
|
|
|
140413
140418
|
}
|
|
140414
140419
|
});
|
|
140415
140420
|
|
|
140421
|
+
//#endregion
|
|
140422
|
+
//#region src/utils/ssr.ts
|
|
140423
|
+
const isSSR = () => typeof window === "undefined" || typeof document === "undefined";
|
|
140424
|
+
|
|
140416
140425
|
//#endregion
|
|
140417
140426
|
//#region src/components/wysiwygEditor/index.tsx
|
|
140418
140427
|
const BoldIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconBold, {
|
|
@@ -140465,7 +140474,7 @@ const WysiwygEditor = (0, react.forwardRef)(({ id, content, className, placehold
|
|
|
140465
140474
|
(0, react.useImperativeHandle)(ref, () => ({ resetContent(newContent) {
|
|
140466
140475
|
editor?.commands?.setContent(newContent);
|
|
140467
140476
|
} }), [editor]);
|
|
140468
|
-
if (
|
|
140477
|
+
if (isSSR()) return null;
|
|
140469
140478
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
140470
140479
|
"data-testid": `${id}-container`,
|
|
140471
140480
|
className: cn("rounded-md border border-gray-200", className, error$1 && "border-red-600"),
|