@youngonesworks/ui 0.1.18 → 0.1.20
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/button/index.d.ts +6 -3
- package/dist/icons/IconLoading.d.ts +1 -1
- package/dist/index.cjs +117 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +116 -88
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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,76 +103324,15 @@ 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
|
-
const IconLoading = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
103329
|
+
const IconLoading = ({ className,...props }) => /* @__PURE__ */ jsxs("svg", {
|
|
103394
103330
|
"data-component": "button",
|
|
103395
103331
|
"data-testid": "loading-svg-button",
|
|
103396
103332
|
viewBox: "0 0 256 256",
|
|
103333
|
+
width: "1em",
|
|
103334
|
+
height: "1em",
|
|
103335
|
+
className,
|
|
103397
103336
|
...props,
|
|
103398
103337
|
children: [
|
|
103399
103338
|
/* @__PURE__ */ jsx("line", {
|
|
@@ -103487,22 +103426,22 @@ const buttonVariants = {
|
|
|
103487
103426
|
|
|
103488
103427
|
//#endregion
|
|
103489
103428
|
//#region src/components/button/index.tsx
|
|
103490
|
-
|
|
103491
|
-
const
|
|
103492
|
-
const
|
|
103429
|
+
function Button({ type = "button", variant = "primary", ariaLabel, block = false, isLoading = false, icon: iconFromProps = null, iconRight = false, onClick, className, children, dataTestId,...props }) {
|
|
103430
|
+
const loadingIcon = /* @__PURE__ */ jsx(IconLoading, { className: "animate-spin-slow mr-2 stroke-current" });
|
|
103431
|
+
const icon = isLoading ? loadingIcon : iconFromProps;
|
|
103432
|
+
const formattedIcon = icon ? formatIcon(icon, { className: clsx_default({
|
|
103493
103433
|
"-mr-2": iconRight,
|
|
103494
103434
|
"-ml-2": !iconRight
|
|
103495
|
-
}) });
|
|
103435
|
+
}, icon === loadingIcon ? "text-current" : "size-[1.125rem]") }) : null;
|
|
103496
103436
|
const handleOnClick = (event) => {
|
|
103497
|
-
onClick
|
|
103437
|
+
onClick?.(event);
|
|
103498
103438
|
};
|
|
103499
103439
|
return /* @__PURE__ */ jsxs("button", {
|
|
103500
103440
|
type,
|
|
103501
103441
|
"aria-label": ariaLabel,
|
|
103502
103442
|
"data-testid": dataTestId,
|
|
103503
103443
|
className: cn(buttonVariants[variant], className, block && "w-full"),
|
|
103504
|
-
onClick:
|
|
103505
|
-
ref,
|
|
103444
|
+
onClick: handleOnClick,
|
|
103506
103445
|
...props,
|
|
103507
103446
|
children: [
|
|
103508
103447
|
!iconRight && formattedIcon,
|
|
@@ -103510,9 +103449,73 @@ const Button = forwardRef(({ type = "button", variant = "primary", ariaLabel, bl
|
|
|
103510
103449
|
iconRight && formattedIcon
|
|
103511
103450
|
]
|
|
103512
103451
|
});
|
|
103513
|
-
}
|
|
103452
|
+
}
|
|
103514
103453
|
Button.displayName = "Button";
|
|
103515
103454
|
|
|
103455
|
+
//#endregion
|
|
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", {
|
|
103458
|
+
className: cn("relative grid gap-2", className),
|
|
103459
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
103460
|
+
className: cn("flex cursor-pointer items-center gap-3"),
|
|
103461
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
103462
|
+
className: cn("relative grid shrink-0 place-content-center", size$3 === "sm" ? "size-4" : "size-5"),
|
|
103463
|
+
children: [
|
|
103464
|
+
/* @__PURE__ */ jsx("input", {
|
|
103465
|
+
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",
|
|
103466
|
+
type: "checkbox",
|
|
103467
|
+
"data-testid": "checkbox",
|
|
103468
|
+
disabled,
|
|
103469
|
+
ref,
|
|
103470
|
+
...props
|
|
103471
|
+
}),
|
|
103472
|
+
/* @__PURE__ */ jsx("svg", {
|
|
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"),
|
|
103474
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
103475
|
+
viewBox: "0 0 24 24",
|
|
103476
|
+
fill: "none",
|
|
103477
|
+
stroke: "currentColor",
|
|
103478
|
+
strokeWidth: "4",
|
|
103479
|
+
strokeLinecap: "round",
|
|
103480
|
+
strokeLinejoin: "round",
|
|
103481
|
+
children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
|
|
103482
|
+
}),
|
|
103483
|
+
/* @__PURE__ */ jsx("svg", {
|
|
103484
|
+
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 }),
|
|
103485
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
103486
|
+
viewBox: "0 0 24 24",
|
|
103487
|
+
fill: "none",
|
|
103488
|
+
stroke: "currentColor",
|
|
103489
|
+
strokeWidth: "4",
|
|
103490
|
+
strokeLinecap: "round",
|
|
103491
|
+
strokeLinejoin: "round",
|
|
103492
|
+
children: /* @__PURE__ */ jsx("line", {
|
|
103493
|
+
x1: "4",
|
|
103494
|
+
y1: "12",
|
|
103495
|
+
x2: "20",
|
|
103496
|
+
y2: "12"
|
|
103497
|
+
})
|
|
103498
|
+
})
|
|
103499
|
+
]
|
|
103500
|
+
}), label && /* @__PURE__ */ jsx("span", {
|
|
103501
|
+
className: cn("grow text-sm font-normal", { "font-medium": mediumBoldText }),
|
|
103502
|
+
children: label
|
|
103503
|
+
})]
|
|
103504
|
+
}), error$1 && /* @__PURE__ */ jsx("small", {
|
|
103505
|
+
className: "text-xs font-normal text-red-500",
|
|
103506
|
+
children: error$1
|
|
103507
|
+
})]
|
|
103508
|
+
}));
|
|
103509
|
+
Checkbox.displayName = "Checkbox";
|
|
103510
|
+
|
|
103511
|
+
//#endregion
|
|
103512
|
+
//#region src/components/divider/index.tsx
|
|
103513
|
+
const Divider = ({ className,...props }) => /* @__PURE__ */ jsx("div", {
|
|
103514
|
+
"data-component": "divider",
|
|
103515
|
+
className: clsx_default("block h-px w-full bg-[#CCCCCC]", className),
|
|
103516
|
+
...props
|
|
103517
|
+
});
|
|
103518
|
+
|
|
103516
103519
|
//#endregion
|
|
103517
103520
|
//#region src/components/filters/FilterButton.tsx
|
|
103518
103521
|
const FilterButton = ({ onClick, hasFilters, reset, filtersText, resetText }) => /* @__PURE__ */ jsxs("div", {
|
|
@@ -137799,8 +137802,37 @@ function isClassComponent(Component$1) {
|
|
|
137799
137802
|
* @returns {boolean}
|
|
137800
137803
|
*/
|
|
137801
137804
|
function isForwardRefComponent(Component$1) {
|
|
137802
|
-
|
|
137803
|
-
|
|
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;
|
|
137804
137836
|
}
|
|
137805
137837
|
/**
|
|
137806
137838
|
* Check if we're running React 19+ by detecting if function components support ref props
|
|
@@ -137858,19 +137890,15 @@ var ReactRenderer = class {
|
|
|
137858
137890
|
const props = this.props;
|
|
137859
137891
|
const editor = this.editor;
|
|
137860
137892
|
const isReact19 = isReact19Plus();
|
|
137861
|
-
const
|
|
137862
|
-
const isForwardRefComp = isForwardRefComponent(Component$1);
|
|
137893
|
+
const componentCanReceiveRef = canReceiveRef(Component$1);
|
|
137863
137894
|
const elementProps = { ...props };
|
|
137864
|
-
if (
|
|
137865
|
-
|
|
137866
|
-
|
|
137867
|
-
|
|
137868
|
-
|
|
137869
|
-
|
|
137870
|
-
|
|
137871
|
-
this.ref = ref;
|
|
137872
|
-
};
|
|
137873
|
-
}
|
|
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
|
+
};
|
|
137874
137902
|
}
|
|
137875
137903
|
this.reactElement = React.createElement(Component$1, { ...elementProps });
|
|
137876
137904
|
(_a = editor === null || editor === void 0 ? void 0 : editor.contentComponent) === null || _a === void 0 ? void 0 : _a.setRenderer(this.id, this);
|
|
@@ -140289,5 +140317,5 @@ const WysiwygEditor = forwardRef(({ id, content, className, placeholder, onChang
|
|
|
140289
140317
|
});
|
|
140290
140318
|
|
|
140291
140319
|
//#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 };
|
|
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 };
|
|
140293
140321
|
//# sourceMappingURL=index.js.map
|