@youngonesworks/ui 0.1.20 → 0.1.23

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.d.ts CHANGED
@@ -13,6 +13,7 @@ export { Button } from './components/button';
13
13
  export { buttonVariants } from './components/button/buttonVariants';
14
14
  export { Checkbox } from './components/checkbox';
15
15
  export { Divider } from './components/divider';
16
+ export { FavouriteButton } from './components/favouriteButton';
16
17
  export { Filters } from './components/filters';
17
18
  export { GoogleAppButtonIcon } from './components/googleAppButtonIcon';
18
19
  export { HamburgerMenuButton } from './components/hamburgerMenuButton';
package/dist/index.js CHANGED
@@ -103440,7 +103440,7 @@ function Button({ type = "button", variant = "primary", ariaLabel, block = false
103440
103440
  type,
103441
103441
  "aria-label": ariaLabel,
103442
103442
  "data-testid": dataTestId,
103443
- className: cn(buttonVariants[variant], className, block && "w-full"),
103443
+ className: cn(buttonVariants[variant], className, block && "w-full text-sm"),
103444
103444
  onClick: handleOnClick,
103445
103445
  ...props,
103446
103446
  children: [
@@ -103454,7 +103454,7 @@ Button.displayName = "Button";
103454
103454
 
103455
103455
  //#endregion
103456
103456
  //#region src/components/checkbox/index.tsx
103457
- const Checkbox = forwardRef(({ size: size$3 = "md", className, error: error$1, mediumBoldText, label, indeterminate = false, disabled = false,...props }, ref) => /* @__PURE__ */ jsxs("div", {
103457
+ const CheckboxComponent = ({ size: size$3 = "md", className, error: error$1, mediumBoldText, label, indeterminate = false, disabled = false,...props }, ref) => /* @__PURE__ */ jsxs("div", {
103458
103458
  className: cn("relative grid gap-2", className),
103459
103459
  children: [/* @__PURE__ */ jsxs("label", {
103460
103460
  className: cn("flex cursor-pointer items-center gap-3"),
@@ -103466,8 +103466,8 @@ const Checkbox = forwardRef(({ size: size$3 = "md", className, error: error$1, m
103466
103466
  type: "checkbox",
103467
103467
  "data-testid": "checkbox",
103468
103468
  disabled,
103469
- ref,
103470
- ...props
103469
+ ...props,
103470
+ ref
103471
103471
  }),
103472
103472
  /* @__PURE__ */ jsx("svg", {
103473
103473
  className: cn("pointer-events-none absolute top-1/2 left-1/2 hidden -translate-x-1/2 -translate-y-1/2 stroke-white outline-hidden peer-checked:block", { "stroke-gray-300": disabled }, size$3 === "sm" ? "size-3" : "size-4"),
@@ -103505,17 +103505,35 @@ const Checkbox = forwardRef(({ size: size$3 = "md", className, error: error$1, m
103505
103505
  className: "text-xs font-normal text-red-500",
103506
103506
  children: error$1
103507
103507
  })]
103508
- }));
103509
- Checkbox.displayName = "Checkbox";
103508
+ });
103509
+ const Checkbox = forwardRef(CheckboxComponent);
103510
103510
 
103511
103511
  //#endregion
103512
103512
  //#region src/components/divider/index.tsx
103513
103513
  const Divider = ({ className,...props }) => /* @__PURE__ */ jsx("div", {
103514
103514
  "data-component": "divider",
103515
- className: clsx_default("block h-px w-full bg-[#CCCCCC]", className),
103515
+ className: clsx_default("block h-px w-full bg-gray-200", className),
103516
103516
  ...props
103517
103517
  });
103518
103518
 
103519
+ //#endregion
103520
+ //#region src/components/favouriteButton/index.tsx
103521
+ const FavouriteButton = forwardRef((props, ref) => {
103522
+ const { onClick, favourite, iconFilled, iconOutline, favouriteTitle, iconColorSelected = "text-pink", iconColor = "text-gray-800", iconSize, className = "", styleVariant = "transparent", children,...rest } = props;
103523
+ return /* @__PURE__ */ jsx(ActionIcon, {
103524
+ onClick,
103525
+ "data-component": "favouriteButton",
103526
+ title: favouriteTitle || "Favorite",
103527
+ styleVariant,
103528
+ className: `${favourite ? iconColorSelected : iconColor} ${className}`.trim(),
103529
+ iconSize,
103530
+ ref,
103531
+ icon: favourite ? iconFilled ?? /* @__PURE__ */ jsx(IconHeartFilled, {}) : iconOutline ?? /* @__PURE__ */ jsx(IconHeart, {}),
103532
+ ...rest,
103533
+ children
103534
+ });
103535
+ });
103536
+
103519
103537
  //#endregion
103520
103538
  //#region src/components/filters/FilterButton.tsx
103521
103539
  const FilterButton = ({ onClick, hasFilters, reset, filtersText, resetText }) => /* @__PURE__ */ jsxs("div", {
@@ -137802,37 +137820,8 @@ function isClassComponent(Component$1) {
137802
137820
  * @returns {boolean}
137803
137821
  */
137804
137822
  function isForwardRefComponent(Component$1) {
137805
- return !!(typeof Component$1 === "object" && Component$1.$$typeof && (Component$1.$$typeof.toString() === "Symbol(react.forward_ref)" || Component$1.$$typeof.description === "react.forward_ref"));
137806
- }
137807
- /**
137808
- * Check if a component is a memoized component.
137809
- * @param Component
137810
- * @returns {boolean}
137811
- */
137812
- function isMemoComponent(Component$1) {
137813
- return !!(typeof Component$1 === "object" && Component$1.$$typeof && (Component$1.$$typeof.toString() === "Symbol(react.memo)" || Component$1.$$typeof.description === "react.memo"));
137814
- }
137815
- /**
137816
- * Check if a component can safely receive a ref prop.
137817
- * This includes class components, forwardRef components, and memoized components
137818
- * that wrap forwardRef or class components.
137819
- * @param Component
137820
- * @returns {boolean}
137821
- */
137822
- function canReceiveRef(Component$1) {
137823
- if (isClassComponent(Component$1)) {
137824
- return true;
137825
- }
137826
- if (isForwardRefComponent(Component$1)) {
137827
- return true;
137828
- }
137829
- if (isMemoComponent(Component$1)) {
137830
- const wrappedComponent = Component$1.type;
137831
- if (wrappedComponent) {
137832
- return isClassComponent(wrappedComponent) || isForwardRefComponent(wrappedComponent);
137833
- }
137834
- }
137835
- return false;
137823
+ var _a;
137824
+ return !!(typeof Component$1 === "object" && ((_a = Component$1.$$typeof) === null || _a === void 0 ? void 0 : _a.toString()) === "Symbol(react.forward_ref)");
137836
137825
  }
137837
137826
  /**
137838
137827
  * Check if we're running React 19+ by detecting if function components support ref props
@@ -137890,15 +137879,19 @@ var ReactRenderer = class {
137890
137879
  const props = this.props;
137891
137880
  const editor = this.editor;
137892
137881
  const isReact19 = isReact19Plus();
137893
- const componentCanReceiveRef = canReceiveRef(Component$1);
137882
+ const isClassComp = isClassComponent(Component$1);
137883
+ const isForwardRefComp = isForwardRefComponent(Component$1);
137894
137884
  const elementProps = { ...props };
137895
- if (elementProps.ref && !(isReact19 || componentCanReceiveRef)) {
137896
- delete elementProps.ref;
137897
- }
137898
- if (!elementProps.ref && (isReact19 || componentCanReceiveRef)) {
137899
- elementProps.ref = (ref) => {
137900
- this.ref = ref;
137901
- };
137885
+ if (!elementProps.ref) {
137886
+ if (isReact19) {
137887
+ elementProps.ref = (ref) => {
137888
+ this.ref = ref;
137889
+ };
137890
+ } else if (isClassComp || isForwardRefComp) {
137891
+ elementProps.ref = (ref) => {
137892
+ this.ref = ref;
137893
+ };
137894
+ }
137902
137895
  }
137903
137896
  this.reactElement = React.createElement(Component$1, { ...elementProps });
137904
137897
  (_a = editor === null || editor === void 0 ? void 0 : editor.contentComponent) === null || _a === void 0 ? void 0 : _a.setRenderer(this.id, this);
@@ -140317,5 +140310,5 @@ const WysiwygEditor = forwardRef(({ id, content, className, placeholder, onChang
140317
140310
  });
140318
140311
 
140319
140312
  //#endregion
140320
- export { AccordionItem, AccordionWrapper, ActionIcon, Alert, AppleAppButtonIcon, AutoCompleteInput, Avatar, AvatarIndicator, Badge, BigBadge, BreadCrumb, Button, Checkbox, Divider, Filters, GoogleAppButtonIcon, HR, HamburgerMenuButton, Island, Label, LinkText, Loader, LogoBlack, Modal, NavButtons, NumberField, NumberedStepper, PageUnavailable, PasswordInput, Popover, ProgressBar, RadioButton, Rating, RegionSelector, Reviews, ScrollToTop, SearchInput, Select, SettingsCard, Skeleton, SkillPill, Stepper, StickyMobileButtonWrapper, Table, TableCell, TableHeader, TableHeaderItem, TableHeaderRow, TableRow, TextInput, Textarea, ThemeIcon, Toggle, Tooltip, TruncatedText, UnorderedList, UnorderedListItem, UnstyledButton, WysiwygEditor, buttonVariants };
140313
+ export { AccordionItem, AccordionWrapper, ActionIcon, Alert, AppleAppButtonIcon, AutoCompleteInput, Avatar, AvatarIndicator, Badge, BigBadge, BreadCrumb, Button, Checkbox, Divider, FavouriteButton, Filters, GoogleAppButtonIcon, HR, HamburgerMenuButton, Island, Label, LinkText, Loader, LogoBlack, Modal, NavButtons, NumberField, NumberedStepper, PageUnavailable, PasswordInput, Popover, ProgressBar, RadioButton, Rating, RegionSelector, Reviews, ScrollToTop, SearchInput, Select, SettingsCard, Skeleton, SkillPill, Stepper, StickyMobileButtonWrapper, Table, TableCell, TableHeader, TableHeaderItem, TableHeaderRow, TableRow, TextInput, Textarea, ThemeIcon, Toggle, Tooltip, TruncatedText, UnorderedList, UnorderedListItem, UnstyledButton, WysiwygEditor, buttonVariants };
140321
140314
  //# sourceMappingURL=index.js.map