@youngonesworks/ui 0.1.18 → 0.1.19

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
@@ -9,6 +9,8 @@ export { AvatarIndicator } from './components/avatarIndicator';
9
9
  export { Badge } from './components/badge';
10
10
  export { BigBadge } from './components/bigBadge';
11
11
  export { BreadCrumb } from './components/breadCrumb';
12
+ export { Button } from './components/button';
13
+ export { buttonVariants } from './components/button/buttonVariants';
12
14
  export { Checkbox } from './components/checkbox';
13
15
  export { Divider } from './components/divider';
14
16
  export { Filters } from './components/filters';
package/dist/index.js CHANGED
@@ -103324,70 +103324,6 @@ const BreadCrumb = ({ children }) => /* @__PURE__ */ jsx(LinkText, {
103324
103324
  });
103325
103325
  BreadCrumb.displayName = "BreadCrumb";
103326
103326
 
103327
- //#endregion
103328
- //#region src/components/checkbox/index.tsx
103329
- const Checkbox = forwardRef(({ size: size$3 = "md", className, error: error$1, mediumBoldText, label, indeterminate = false, disabled = false,...props }, ref) => /* @__PURE__ */ jsxs("div", {
103330
- className: cn("relative grid gap-2", className),
103331
- children: [/* @__PURE__ */ jsxs("label", {
103332
- className: cn("flex cursor-pointer items-center gap-3"),
103333
- children: [/* @__PURE__ */ jsxs("div", {
103334
- className: cn("relative grid shrink-0 place-content-center", size$3 === "sm" ? "size-4" : "size-5"),
103335
- children: [
103336
- /* @__PURE__ */ jsx("input", {
103337
- className: "checked:border-light-blue checked:bg-light-blue [&:not([disabled])]:checked:border-light-blue [&:not([disabled])]:checked:bg-light-blue peer absolute inset-0 shrink-0 appearance-none rounded-xs border border-gray-800 bg-white focus:outline-hidden disabled:border-gray-300 disabled:bg-gray-100 disabled:[&[checked]]:border-gray-100",
103338
- type: "checkbox",
103339
- "data-testid": "checkbox",
103340
- disabled,
103341
- ref,
103342
- ...props
103343
- }),
103344
- /* @__PURE__ */ jsx("svg", {
103345
- 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"),
103346
- xmlns: "http://www.w3.org/2000/svg",
103347
- viewBox: "0 0 24 24",
103348
- fill: "none",
103349
- stroke: "currentColor",
103350
- strokeWidth: "4",
103351
- strokeLinecap: "round",
103352
- strokeLinejoin: "round",
103353
- children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
103354
- }),
103355
- /* @__PURE__ */ jsx("svg", {
103356
- className: cn("pointer-events-none absolute left-1/2 hidden -translate-x-1/2 -translate-y-1/2 stroke-black outline-hidden", { "stroke-gray-300": disabled }, size$3 === "sm" ? "top-[60%] size-3" : "top-1/2 size-4", { block: indeterminate }),
103357
- xmlns: "http://www.w3.org/2000/svg",
103358
- viewBox: "0 0 24 24",
103359
- fill: "none",
103360
- stroke: "currentColor",
103361
- strokeWidth: "4",
103362
- strokeLinecap: "round",
103363
- strokeLinejoin: "round",
103364
- children: /* @__PURE__ */ jsx("line", {
103365
- x1: "4",
103366
- y1: "12",
103367
- x2: "20",
103368
- y2: "12"
103369
- })
103370
- })
103371
- ]
103372
- }), label && /* @__PURE__ */ jsx("span", {
103373
- className: cn("grow text-sm font-normal", { "font-medium": mediumBoldText }),
103374
- children: label
103375
- })]
103376
- }), error$1 && /* @__PURE__ */ jsx("small", {
103377
- className: "text-xs font-normal text-red-500",
103378
- children: error$1
103379
- })]
103380
- }));
103381
- Checkbox.displayName = "Checkbox";
103382
-
103383
- //#endregion
103384
- //#region src/components/divider/index.tsx
103385
- const Divider = ({ className,...props }) => /* @__PURE__ */ jsx("div", {
103386
- "data-component": "divider",
103387
- className: clsx_default("block h-px w-full bg-[#CCCCCC]", className),
103388
- ...props
103389
- });
103390
-
103391
103327
  //#endregion
103392
103328
  //#region src/icons/IconLoading.tsx
103393
103329
  const IconLoading = (props) => /* @__PURE__ */ jsxs("svg", {
@@ -103513,6 +103449,70 @@ const Button = forwardRef(({ type = "button", variant = "primary", ariaLabel, bl
103513
103449
  });
103514
103450
  Button.displayName = "Button";
103515
103451
 
103452
+ //#endregion
103453
+ //#region src/components/checkbox/index.tsx
103454
+ const Checkbox = forwardRef(({ size: size$3 = "md", className, error: error$1, mediumBoldText, label, indeterminate = false, disabled = false,...props }, ref) => /* @__PURE__ */ jsxs("div", {
103455
+ className: cn("relative grid gap-2", className),
103456
+ children: [/* @__PURE__ */ jsxs("label", {
103457
+ className: cn("flex cursor-pointer items-center gap-3"),
103458
+ children: [/* @__PURE__ */ jsxs("div", {
103459
+ className: cn("relative grid shrink-0 place-content-center", size$3 === "sm" ? "size-4" : "size-5"),
103460
+ children: [
103461
+ /* @__PURE__ */ jsx("input", {
103462
+ className: "checked:border-light-blue checked:bg-light-blue [&:not([disabled])]:checked:border-light-blue [&:not([disabled])]:checked:bg-light-blue peer absolute inset-0 shrink-0 appearance-none rounded-xs border border-gray-800 bg-white focus:outline-hidden disabled:border-gray-300 disabled:bg-gray-100 disabled:[&[checked]]:border-gray-100",
103463
+ type: "checkbox",
103464
+ "data-testid": "checkbox",
103465
+ disabled,
103466
+ ref,
103467
+ ...props
103468
+ }),
103469
+ /* @__PURE__ */ jsx("svg", {
103470
+ 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"),
103471
+ xmlns: "http://www.w3.org/2000/svg",
103472
+ viewBox: "0 0 24 24",
103473
+ fill: "none",
103474
+ stroke: "currentColor",
103475
+ strokeWidth: "4",
103476
+ strokeLinecap: "round",
103477
+ strokeLinejoin: "round",
103478
+ children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
103479
+ }),
103480
+ /* @__PURE__ */ jsx("svg", {
103481
+ className: cn("pointer-events-none absolute left-1/2 hidden -translate-x-1/2 -translate-y-1/2 stroke-black outline-hidden", { "stroke-gray-300": disabled }, size$3 === "sm" ? "top-[60%] size-3" : "top-1/2 size-4", { block: indeterminate }),
103482
+ xmlns: "http://www.w3.org/2000/svg",
103483
+ viewBox: "0 0 24 24",
103484
+ fill: "none",
103485
+ stroke: "currentColor",
103486
+ strokeWidth: "4",
103487
+ strokeLinecap: "round",
103488
+ strokeLinejoin: "round",
103489
+ children: /* @__PURE__ */ jsx("line", {
103490
+ x1: "4",
103491
+ y1: "12",
103492
+ x2: "20",
103493
+ y2: "12"
103494
+ })
103495
+ })
103496
+ ]
103497
+ }), label && /* @__PURE__ */ jsx("span", {
103498
+ className: cn("grow text-sm font-normal", { "font-medium": mediumBoldText }),
103499
+ children: label
103500
+ })]
103501
+ }), error$1 && /* @__PURE__ */ jsx("small", {
103502
+ className: "text-xs font-normal text-red-500",
103503
+ children: error$1
103504
+ })]
103505
+ }));
103506
+ Checkbox.displayName = "Checkbox";
103507
+
103508
+ //#endregion
103509
+ //#region src/components/divider/index.tsx
103510
+ const Divider = ({ className,...props }) => /* @__PURE__ */ jsx("div", {
103511
+ "data-component": "divider",
103512
+ className: clsx_default("block h-px w-full bg-[#CCCCCC]", className),
103513
+ ...props
103514
+ });
103515
+
103516
103516
  //#endregion
103517
103517
  //#region src/components/filters/FilterButton.tsx
103518
103518
  const FilterButton = ({ onClick, hasFilters, reset, filtersText, resetText }) => /* @__PURE__ */ jsxs("div", {
@@ -137799,8 +137799,37 @@ function isClassComponent(Component$1) {
137799
137799
  * @returns {boolean}
137800
137800
  */
137801
137801
  function isForwardRefComponent(Component$1) {
137802
- var _a;
137803
- return !!(typeof Component$1 === "object" && ((_a = Component$1.$$typeof) === null || _a === void 0 ? void 0 : _a.toString()) === "Symbol(react.forward_ref)");
137802
+ return !!(typeof Component$1 === "object" && Component$1.$$typeof && (Component$1.$$typeof.toString() === "Symbol(react.forward_ref)" || Component$1.$$typeof.description === "react.forward_ref"));
137803
+ }
137804
+ /**
137805
+ * Check if a component is a memoized component.
137806
+ * @param Component
137807
+ * @returns {boolean}
137808
+ */
137809
+ function isMemoComponent(Component$1) {
137810
+ return !!(typeof Component$1 === "object" && Component$1.$$typeof && (Component$1.$$typeof.toString() === "Symbol(react.memo)" || Component$1.$$typeof.description === "react.memo"));
137811
+ }
137812
+ /**
137813
+ * Check if a component can safely receive a ref prop.
137814
+ * This includes class components, forwardRef components, and memoized components
137815
+ * that wrap forwardRef or class components.
137816
+ * @param Component
137817
+ * @returns {boolean}
137818
+ */
137819
+ function canReceiveRef(Component$1) {
137820
+ if (isClassComponent(Component$1)) {
137821
+ return true;
137822
+ }
137823
+ if (isForwardRefComponent(Component$1)) {
137824
+ return true;
137825
+ }
137826
+ if (isMemoComponent(Component$1)) {
137827
+ const wrappedComponent = Component$1.type;
137828
+ if (wrappedComponent) {
137829
+ return isClassComponent(wrappedComponent) || isForwardRefComponent(wrappedComponent);
137830
+ }
137831
+ }
137832
+ return false;
137804
137833
  }
137805
137834
  /**
137806
137835
  * Check if we're running React 19+ by detecting if function components support ref props
@@ -137858,19 +137887,15 @@ var ReactRenderer = class {
137858
137887
  const props = this.props;
137859
137888
  const editor = this.editor;
137860
137889
  const isReact19 = isReact19Plus();
137861
- const isClassComp = isClassComponent(Component$1);
137862
- const isForwardRefComp = isForwardRefComponent(Component$1);
137890
+ const componentCanReceiveRef = canReceiveRef(Component$1);
137863
137891
  const elementProps = { ...props };
137864
- if (!elementProps.ref) {
137865
- if (isReact19) {
137866
- elementProps.ref = (ref) => {
137867
- this.ref = ref;
137868
- };
137869
- } else if (isClassComp || isForwardRefComp) {
137870
- elementProps.ref = (ref) => {
137871
- this.ref = ref;
137872
- };
137873
- }
137892
+ if (elementProps.ref && !(isReact19 || componentCanReceiveRef)) {
137893
+ delete elementProps.ref;
137894
+ }
137895
+ if (!elementProps.ref && (isReact19 || componentCanReceiveRef)) {
137896
+ elementProps.ref = (ref) => {
137897
+ this.ref = ref;
137898
+ };
137874
137899
  }
137875
137900
  this.reactElement = React.createElement(Component$1, { ...elementProps });
137876
137901
  (_a = editor === null || editor === void 0 ? void 0 : editor.contentComponent) === null || _a === void 0 ? void 0 : _a.setRenderer(this.id, this);
@@ -140289,5 +140314,5 @@ const WysiwygEditor = forwardRef(({ id, content, className, placeholder, onChang
140289
140314
  });
140290
140315
 
140291
140316
  //#endregion
140292
- export { AccordionItem, AccordionWrapper, ActionIcon, Alert, AppleAppButtonIcon, AutoCompleteInput, Avatar, AvatarIndicator, Badge, BigBadge, BreadCrumb, 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 };
140317
+ 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 };
140293
140318
  //# sourceMappingURL=index.js.map