@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/index.js CHANGED
@@ -103270,7 +103270,7 @@ const AvatarIndicator = ({ indicatorCount, className }) => /* @__PURE__ */ jsx("
103270
103270
 
103271
103271
  //#endregion
103272
103272
  //#region src/components/badge/index.tsx
103273
- const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, mobile = false, badgeBorder = false, fullWidth = false,...props }) => /* @__PURE__ */ jsxs("span", {
103273
+ const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, mobile = false, badgeBorder = false, fullWidth = false, leftSection, rightSection, children,...props }) => /* @__PURE__ */ jsxs("span", {
103274
103274
  "data-testid": "badge",
103275
103275
  "data-component": "Badge",
103276
103276
  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 && {
@@ -103297,18 +103297,18 @@ const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, mobile =
103297
103297
  }, className),
103298
103298
  ...props,
103299
103299
  children: [
103300
- props.leftSection && /* @__PURE__ */ jsx("div", {
103300
+ leftSection && /* @__PURE__ */ jsx("div", {
103301
103301
  "data-testid": "left-section",
103302
- children: props.leftSection
103302
+ children: leftSection
103303
103303
  }),
103304
103304
  /* @__PURE__ */ jsx("span", {
103305
103305
  "data-testid": "badge-content",
103306
103306
  className: cn("block h-5 overflow-hidden text-ellipsis whitespace-nowrap", { "flex items-center": favorite }),
103307
- children: props.children
103307
+ children
103308
103308
  }),
103309
- props.rightSection && /* @__PURE__ */ jsx("div", {
103309
+ rightSection && /* @__PURE__ */ jsx("div", {
103310
103310
  "data-testid": "right-section",
103311
- children: props.rightSection
103311
+ children: rightSection
103312
103312
  })
103313
103313
  ]
103314
103314
  });
@@ -109917,8 +109917,10 @@ const Rating = ({ rating, ratings, size: size$3 = "normal", setReview, className
109917
109917
  }, index$4))
109918
109918
  }),
109919
109919
  setReview && /* @__PURE__ */ jsx("div", {
109920
- className: "mt-4 inline-flex flex-col items-start",
109920
+ "data-testid": "small-stars-container",
109921
+ className: "mt-4 flex flex-col gap-2",
109921
109922
  children: ratings.map(({ value, label }) => /* @__PURE__ */ jsxs("span", {
109923
+ "data-testid": `small-star-item-${value}`,
109922
109924
  className: "flex w-auto cursor-pointer items-center gap-1",
109923
109925
  onMouseEnter: () => setHoveredSmallStars(value),
109924
109926
  onMouseLeave: () => setHoveredSmallStars(0),
@@ -115693,6 +115695,7 @@ const Select = forwardRef(({ options: options$1, placeholder, defaultValue, labe
115693
115695
  const DropdownIndicator$1 = (props$1) => /* @__PURE__ */ jsx(components.DropdownIndicator, {
115694
115696
  ...props$1,
115695
115697
  children: props$1.hasValue && isClearable ? /* @__PURE__ */ jsx(IconX, {
115698
+ "data-testid": "icon-x",
115696
115699
  className: "cursor-pointer",
115697
115700
  size: 16,
115698
115701
  color: "black",
@@ -116029,9 +116032,9 @@ const TabsBadge = ({ children }) => {
116029
116032
  const isCircular = typeof children === "number" && children <= 9 || typeof children === "string" && children.length === 1 || false;
116030
116033
  return /* @__PURE__ */ jsx("div", {
116031
116034
  "data-testid": "tabs-badge",
116032
- className: clsx_default("bg-pink h-5 text-xs leading-5 font-medium text-white", {
116033
- "rounded-full w-5 text-center": isCircular,
116034
- "rounded px-2": !isCircular
116035
+ className: clsx_default("bg-pink h-5 rounded-full text-xs leading-5 font-medium text-white", {
116036
+ "w-5 text-center": isCircular,
116037
+ "px-2": !isCircular
116035
116038
  }),
116036
116039
  children
116037
116040
  });
@@ -116281,7 +116284,8 @@ const Tooltip = ({ content, children, passedOpen = false, size: size$3 = "md", v
116281
116284
  height: 17,
116282
116285
  tipRadius: 1,
116283
116286
  fill: "white",
116284
- className: "drop-shadow-xl"
116287
+ className: "drop-shadow-xl",
116288
+ "data-testid": "tooltip-arrow"
116285
116289
  }) : /* @__PURE__ */ jsx(FloatingArrow, {
116286
116290
  ref: arrowRef,
116287
116291
  context,
@@ -116289,7 +116293,8 @@ const Tooltip = ({ content, children, passedOpen = false, size: size$3 = "md", v
116289
116293
  height: 6,
116290
116294
  tipRadius: 1,
116291
116295
  fill: "white",
116292
- className: "drop-shadow-xl"
116296
+ className: "drop-shadow-xl",
116297
+ "data-testid": "tooltip-arrow"
116293
116298
  })]
116294
116299
  })
116295
116300
  })] });
@@ -137628,8 +137633,8 @@ function useEditorState(options$1) {
137628
137633
  return selectedState;
137629
137634
  }
137630
137635
  const isDev = "development" !== "production";
137631
- const isSSR = typeof window === "undefined";
137632
- const isNext = isSSR || Boolean(typeof window !== "undefined" && window.next);
137636
+ const isSSR$1 = typeof window === "undefined";
137637
+ const isNext = isSSR$1 || Boolean(typeof window !== "undefined" && window.next);
137633
137638
  /**
137634
137639
  * This class handles the creation, destruction, and re-creation of the editor instance.
137635
137640
  */
@@ -137675,7 +137680,7 @@ var EditorInstanceManager = class EditorInstanceManager {
137675
137680
  }
137676
137681
  getInitialEditor() {
137677
137682
  if (this.options.current.immediatelyRender === undefined) {
137678
- if (isSSR || isNext) {
137683
+ if (isSSR$1 || isNext) {
137679
137684
  if (isDev) {
137680
137685
  /**
137681
137686
  * Throw an error in development, to make sure the developer is aware that tiptap cannot be SSR'd
@@ -137687,7 +137692,7 @@ var EditorInstanceManager = class EditorInstanceManager {
137687
137692
  }
137688
137693
  return this.createEditor();
137689
137694
  }
137690
- if (this.options.current.immediatelyRender && isSSR && isDev) {
137695
+ if (this.options.current.immediatelyRender && isSSR$1 && isDev) {
137691
137696
  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.");
137692
137697
  }
137693
137698
  if (this.options.current.immediatelyRender) {
@@ -140415,6 +140420,10 @@ const StarterKit = Extension.create({
140415
140420
  }
140416
140421
  });
140417
140422
 
140423
+ //#endregion
140424
+ //#region src/utils/ssr.ts
140425
+ const isSSR = () => typeof window === "undefined" || typeof document === "undefined";
140426
+
140418
140427
  //#endregion
140419
140428
  //#region src/components/wysiwygEditor/index.tsx
140420
140429
  const BoldIcon = () => /* @__PURE__ */ jsx(IconBold, {
@@ -140467,7 +140476,7 @@ const WysiwygEditor = forwardRef(({ id, content, className, placeholder, onChang
140467
140476
  useImperativeHandle(ref, () => ({ resetContent(newContent) {
140468
140477
  editor?.commands?.setContent(newContent);
140469
140478
  } }), [editor]);
140470
- if (typeof window === "undefined" || typeof document === "undefined") return null;
140479
+ if (isSSR()) return null;
140471
140480
  return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
140472
140481
  "data-testid": `${id}-container`,
140473
140482
  className: cn("rounded-md border border-gray-200", className, error$1 && "border-red-600"),