@youngonesworks/ui 0.1.10 → 0.1.11
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.cjs +207 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +199 -84
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { BigBadge } from './components/bigBadge';
|
|
|
11
11
|
export { BreadCrumb } from './components/breadCrumb';
|
|
12
12
|
export { Checkbox } from './components/checkbox';
|
|
13
13
|
export { Divider } from './components/divider';
|
|
14
|
+
export { Filters } from './components/filters';
|
|
14
15
|
export { GoogleAppButtonIcon } from './components/googleAppButtonIcon';
|
|
15
16
|
export { HamburgerMenuButton } from './components/hamburgerMenuButton';
|
|
16
17
|
export { HR } from './components/hr';
|
package/dist/index.js
CHANGED
|
@@ -103387,6 +103387,204 @@ const Divider = ({ className,...props }) => /* @__PURE__ */ jsx("div", {
|
|
|
103387
103387
|
...props
|
|
103388
103388
|
});
|
|
103389
103389
|
|
|
103390
|
+
//#endregion
|
|
103391
|
+
//#region src/icons/IconLoading.tsx
|
|
103392
|
+
const IconLoading = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
103393
|
+
"data-component": "button",
|
|
103394
|
+
"data-testid": "loading-svg-button",
|
|
103395
|
+
viewBox: "0 0 256 256",
|
|
103396
|
+
...props,
|
|
103397
|
+
children: [
|
|
103398
|
+
/* @__PURE__ */ jsx("line", {
|
|
103399
|
+
x1: "128",
|
|
103400
|
+
y1: "32",
|
|
103401
|
+
x2: "128",
|
|
103402
|
+
y2: "64",
|
|
103403
|
+
strokeLinecap: "round",
|
|
103404
|
+
strokeLinejoin: "round",
|
|
103405
|
+
strokeWidth: "24"
|
|
103406
|
+
}),
|
|
103407
|
+
/* @__PURE__ */ jsx("line", {
|
|
103408
|
+
x1: "195.9",
|
|
103409
|
+
y1: "60.1",
|
|
103410
|
+
x2: "173.3",
|
|
103411
|
+
y2: "82.7",
|
|
103412
|
+
strokeLinecap: "round",
|
|
103413
|
+
strokeLinejoin: "round",
|
|
103414
|
+
strokeWidth: "24"
|
|
103415
|
+
}),
|
|
103416
|
+
/* @__PURE__ */ jsx("line", {
|
|
103417
|
+
x1: "224",
|
|
103418
|
+
y1: "128",
|
|
103419
|
+
x2: "192",
|
|
103420
|
+
y2: "128",
|
|
103421
|
+
strokeLinecap: "round",
|
|
103422
|
+
strokeLinejoin: "round",
|
|
103423
|
+
strokeWidth: "24"
|
|
103424
|
+
}),
|
|
103425
|
+
/* @__PURE__ */ jsx("line", {
|
|
103426
|
+
x1: "195.9",
|
|
103427
|
+
y1: "195.9",
|
|
103428
|
+
x2: "173.3",
|
|
103429
|
+
y2: "173.3",
|
|
103430
|
+
strokeLinecap: "round",
|
|
103431
|
+
strokeLinejoin: "round",
|
|
103432
|
+
strokeWidth: "24"
|
|
103433
|
+
}),
|
|
103434
|
+
/* @__PURE__ */ jsx("line", {
|
|
103435
|
+
x1: "128",
|
|
103436
|
+
y1: "224",
|
|
103437
|
+
x2: "128",
|
|
103438
|
+
y2: "192",
|
|
103439
|
+
strokeLinecap: "round",
|
|
103440
|
+
strokeLinejoin: "round",
|
|
103441
|
+
strokeWidth: "24"
|
|
103442
|
+
}),
|
|
103443
|
+
/* @__PURE__ */ jsx("line", {
|
|
103444
|
+
x1: "60.1",
|
|
103445
|
+
y1: "195.9",
|
|
103446
|
+
x2: "82.7",
|
|
103447
|
+
y2: "173.3",
|
|
103448
|
+
strokeLinecap: "round",
|
|
103449
|
+
strokeLinejoin: "round",
|
|
103450
|
+
strokeWidth: "24"
|
|
103451
|
+
}),
|
|
103452
|
+
/* @__PURE__ */ jsx("line", {
|
|
103453
|
+
x1: "32",
|
|
103454
|
+
y1: "128",
|
|
103455
|
+
x2: "64",
|
|
103456
|
+
y2: "128",
|
|
103457
|
+
strokeLinecap: "round",
|
|
103458
|
+
strokeLinejoin: "round",
|
|
103459
|
+
strokeWidth: "24"
|
|
103460
|
+
}),
|
|
103461
|
+
/* @__PURE__ */ jsx("line", {
|
|
103462
|
+
x1: "60.1",
|
|
103463
|
+
y1: "60.1",
|
|
103464
|
+
x2: "82.7",
|
|
103465
|
+
y2: "82.7",
|
|
103466
|
+
strokeLinecap: "round",
|
|
103467
|
+
strokeLinejoin: "round",
|
|
103468
|
+
strokeWidth: "24"
|
|
103469
|
+
})
|
|
103470
|
+
]
|
|
103471
|
+
});
|
|
103472
|
+
|
|
103473
|
+
//#endregion
|
|
103474
|
+
//#region src/components/button/buttonVariants.ts
|
|
103475
|
+
const defaultButtonStyling = "justify-center group relative flex items-center gap-2 cursor-pointer border rounded py-2 px-5 text-sx md:text-sm md:font-medium font-medium hover:outline-hidden focus:outline-hidden disabled:cursor-not-allowed transition-colors duration-100 ease-in-out";
|
|
103476
|
+
const buttonVariants = {
|
|
103477
|
+
primary: clsx_default(defaultButtonStyling, "border-transparent bg-primary text-black hover:bg-turquoise-700 hover:fill-white disabled:bg-turquoise-100 disabled:text-gray-800 disabled:hover:bg-turquoise-100"),
|
|
103478
|
+
secondary: clsx_default(defaultButtonStyling, "border-solid border-gray-200 bg-white text-black hover:border-gray-800 hover:bg-gray-50 hover:fill-white disabled:text-gray-800 disabled:hover:border-gray-200 disabled:hover:bg-white"),
|
|
103479
|
+
danger: clsx_default(defaultButtonStyling, "border-transparent bg-red-500 text-white hover:bg-red-700 disabled:bg-red-100 disabled:hover:bg-red-100"),
|
|
103480
|
+
link: clsx_default(defaultButtonStyling, "border-transparent bg-transparent text-accent-blue hover:bg-gray-50 disabled:bg-transparent disabled:text-gray-800 disabled:hover:bg-transparent"),
|
|
103481
|
+
outline: clsx_default(defaultButtonStyling, "border-solid border-gray-200 bg-transparent text-white hover:border-gray-800 hover:bg-[rgba(255,255,255,0.1)] disabled:text-gray-800 disabled:hover:border-gray-200 disabled:hover:bg-white"),
|
|
103482
|
+
search: clsx_default(defaultButtonStyling, "absolute top-0 right-0 h-full w-[50px] border-0 bg-transparent bg-no-repeat"),
|
|
103483
|
+
icon__primary: clsx_default(defaultButtonStyling, "flex! items-center justify-center"),
|
|
103484
|
+
icon__danger: clsx_default(defaultButtonStyling, "flex! items-center justify-center")
|
|
103485
|
+
};
|
|
103486
|
+
|
|
103487
|
+
//#endregion
|
|
103488
|
+
//#region src/components/button/index.tsx
|
|
103489
|
+
const Button = forwardRef(({ type = "button", variant = "primary", ariaLabel, block = false, isLoading = false, icon: iconFromProps = null, iconRight = false, onClick, className, children, dataTestId,...props }, ref) => {
|
|
103490
|
+
const icon = isLoading ? /* @__PURE__ */ jsx(IconLoading, { className: "animate-spin-slow mr-2 stroke-current" }) : iconFromProps;
|
|
103491
|
+
const formattedIcon = formatIcon(icon, { className: clsx_default("size-[1.125rem]", {
|
|
103492
|
+
"-mr-2": iconRight,
|
|
103493
|
+
"-ml-2": !iconRight
|
|
103494
|
+
}) });
|
|
103495
|
+
const handleOnClick = (event) => {
|
|
103496
|
+
onClick && onClick(event);
|
|
103497
|
+
};
|
|
103498
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
103499
|
+
type,
|
|
103500
|
+
"aria-label": ariaLabel,
|
|
103501
|
+
"data-testid": dataTestId,
|
|
103502
|
+
className: cn(buttonVariants[variant], className, block && "w-full"),
|
|
103503
|
+
onClick: (event) => handleOnClick(event),
|
|
103504
|
+
ref,
|
|
103505
|
+
...props,
|
|
103506
|
+
children: [
|
|
103507
|
+
!iconRight && formattedIcon,
|
|
103508
|
+
children,
|
|
103509
|
+
iconRight && formattedIcon
|
|
103510
|
+
]
|
|
103511
|
+
});
|
|
103512
|
+
});
|
|
103513
|
+
Button.displayName = "Button";
|
|
103514
|
+
|
|
103515
|
+
//#endregion
|
|
103516
|
+
//#region src/components/filters/FilterButton.tsx
|
|
103517
|
+
const FilterButton = ({ onClick, hasFilters, reset, filtersText, resetText }) => /* @__PURE__ */ jsxs("div", {
|
|
103518
|
+
className: "flex gap-3",
|
|
103519
|
+
"data-testid": "filterButton",
|
|
103520
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
103521
|
+
onClick,
|
|
103522
|
+
variant: "secondary",
|
|
103523
|
+
className: "font-normal md:font-normal",
|
|
103524
|
+
icon: /* @__PURE__ */ jsx(IconFilter, { stroke: 1 }),
|
|
103525
|
+
children: filtersText
|
|
103526
|
+
}), /* @__PURE__ */ jsx(UnstyledButton, {
|
|
103527
|
+
className: "text-sm font-normal disabled:text-gray-500",
|
|
103528
|
+
onClick: reset,
|
|
103529
|
+
disabled: !hasFilters,
|
|
103530
|
+
children: resetText
|
|
103531
|
+
})]
|
|
103532
|
+
});
|
|
103533
|
+
|
|
103534
|
+
//#endregion
|
|
103535
|
+
//#region src/components/filters/FilterItem.tsx
|
|
103536
|
+
const FilterItem = ({ title, isActive: isActive$1 = false, onClick }) => /* @__PURE__ */ jsxs("label", {
|
|
103537
|
+
className: cn("has-checked:border-primary has-checked:bg-turquoise-100 flex cursor-pointer items-center gap-3 rounded-full border border-gray-200 px-7 py-1.5 text-sm leading-6 font-normal transition-all duration-300 ease-in-out hover:bg-gray-50"),
|
|
103538
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
103539
|
+
type: "checkbox",
|
|
103540
|
+
className: "hidden",
|
|
103541
|
+
onChange: onClick,
|
|
103542
|
+
checked: isActive$1
|
|
103543
|
+
}), title]
|
|
103544
|
+
});
|
|
103545
|
+
|
|
103546
|
+
//#endregion
|
|
103547
|
+
//#region src/components/filters/index.tsx
|
|
103548
|
+
const Filters = ({ filters, setFilters, selectedFilters, selectedFiltersText, filtersText, resetText }) => {
|
|
103549
|
+
const content = useRef(null);
|
|
103550
|
+
const [showFilters, setShowFilters] = useState(false);
|
|
103551
|
+
const onFilter = (filter) => {
|
|
103552
|
+
if (selectedFilters.includes(filter)) setFilters(selectedFilters.filter((f$1) => f$1 !== filter));
|
|
103553
|
+
else setFilters([...selectedFilters, filter]);
|
|
103554
|
+
};
|
|
103555
|
+
useEffect(() => {
|
|
103556
|
+
setShowFilters(selectedFilters.length > 0);
|
|
103557
|
+
}, [selectedFilters]);
|
|
103558
|
+
const onReset = () => {
|
|
103559
|
+
setFilters([]);
|
|
103560
|
+
};
|
|
103561
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
103562
|
+
className: "grid justify-end gap-3",
|
|
103563
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
103564
|
+
className: "flex items-center justify-end gap-3",
|
|
103565
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
103566
|
+
className: "text-sm font-medium",
|
|
103567
|
+
children: selectedFiltersText
|
|
103568
|
+
}), /* @__PURE__ */ jsx(FilterButton, {
|
|
103569
|
+
onClick: () => setShowFilters(!showFilters),
|
|
103570
|
+
hasFilters: selectedFilters.length > 0,
|
|
103571
|
+
reset: () => onReset(),
|
|
103572
|
+
filtersText,
|
|
103573
|
+
resetText
|
|
103574
|
+
})]
|
|
103575
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
103576
|
+
ref: content,
|
|
103577
|
+
className: cn("flex flex-wrap justify-end gap-2 overflow-hidden opacity-0 ease-in-out [transition:max-height_0.4s,opacity_0.3s]", showFilters && "opacity-100"),
|
|
103578
|
+
style: { maxHeight: showFilters ? `${content?.current?.scrollHeight}px` : "0px" },
|
|
103579
|
+
children: filters.map((filter) => /* @__PURE__ */ jsx(FilterItem, {
|
|
103580
|
+
title: filter,
|
|
103581
|
+
isActive: selectedFilters.includes(filter),
|
|
103582
|
+
onClick: () => onFilter(filter)
|
|
103583
|
+
}, filter))
|
|
103584
|
+
})]
|
|
103585
|
+
});
|
|
103586
|
+
};
|
|
103587
|
+
|
|
103390
103588
|
//#endregion
|
|
103391
103589
|
//#region src/components/googleAppButtonIcon/index.tsx
|
|
103392
103590
|
const GoogleAppButtonIcon = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
@@ -109511,89 +109709,6 @@ const RadioButton = ({ id, name, value, label, onChange, checked, dataTestId, cl
|
|
|
109511
109709
|
});
|
|
109512
109710
|
RadioButton.displayName = "RadioButton";
|
|
109513
109711
|
|
|
109514
|
-
//#endregion
|
|
109515
|
-
//#region src/icons/IconLoading.tsx
|
|
109516
|
-
const IconLoading = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
109517
|
-
"data-component": "button",
|
|
109518
|
-
"data-testid": "loading-svg-button",
|
|
109519
|
-
viewBox: "0 0 256 256",
|
|
109520
|
-
...props,
|
|
109521
|
-
children: [
|
|
109522
|
-
/* @__PURE__ */ jsx("line", {
|
|
109523
|
-
x1: "128",
|
|
109524
|
-
y1: "32",
|
|
109525
|
-
x2: "128",
|
|
109526
|
-
y2: "64",
|
|
109527
|
-
strokeLinecap: "round",
|
|
109528
|
-
strokeLinejoin: "round",
|
|
109529
|
-
strokeWidth: "24"
|
|
109530
|
-
}),
|
|
109531
|
-
/* @__PURE__ */ jsx("line", {
|
|
109532
|
-
x1: "195.9",
|
|
109533
|
-
y1: "60.1",
|
|
109534
|
-
x2: "173.3",
|
|
109535
|
-
y2: "82.7",
|
|
109536
|
-
strokeLinecap: "round",
|
|
109537
|
-
strokeLinejoin: "round",
|
|
109538
|
-
strokeWidth: "24"
|
|
109539
|
-
}),
|
|
109540
|
-
/* @__PURE__ */ jsx("line", {
|
|
109541
|
-
x1: "224",
|
|
109542
|
-
y1: "128",
|
|
109543
|
-
x2: "192",
|
|
109544
|
-
y2: "128",
|
|
109545
|
-
strokeLinecap: "round",
|
|
109546
|
-
strokeLinejoin: "round",
|
|
109547
|
-
strokeWidth: "24"
|
|
109548
|
-
}),
|
|
109549
|
-
/* @__PURE__ */ jsx("line", {
|
|
109550
|
-
x1: "195.9",
|
|
109551
|
-
y1: "195.9",
|
|
109552
|
-
x2: "173.3",
|
|
109553
|
-
y2: "173.3",
|
|
109554
|
-
strokeLinecap: "round",
|
|
109555
|
-
strokeLinejoin: "round",
|
|
109556
|
-
strokeWidth: "24"
|
|
109557
|
-
}),
|
|
109558
|
-
/* @__PURE__ */ jsx("line", {
|
|
109559
|
-
x1: "128",
|
|
109560
|
-
y1: "224",
|
|
109561
|
-
x2: "128",
|
|
109562
|
-
y2: "192",
|
|
109563
|
-
strokeLinecap: "round",
|
|
109564
|
-
strokeLinejoin: "round",
|
|
109565
|
-
strokeWidth: "24"
|
|
109566
|
-
}),
|
|
109567
|
-
/* @__PURE__ */ jsx("line", {
|
|
109568
|
-
x1: "60.1",
|
|
109569
|
-
y1: "195.9",
|
|
109570
|
-
x2: "82.7",
|
|
109571
|
-
y2: "173.3",
|
|
109572
|
-
strokeLinecap: "round",
|
|
109573
|
-
strokeLinejoin: "round",
|
|
109574
|
-
strokeWidth: "24"
|
|
109575
|
-
}),
|
|
109576
|
-
/* @__PURE__ */ jsx("line", {
|
|
109577
|
-
x1: "32",
|
|
109578
|
-
y1: "128",
|
|
109579
|
-
x2: "64",
|
|
109580
|
-
y2: "128",
|
|
109581
|
-
strokeLinecap: "round",
|
|
109582
|
-
strokeLinejoin: "round",
|
|
109583
|
-
strokeWidth: "24"
|
|
109584
|
-
}),
|
|
109585
|
-
/* @__PURE__ */ jsx("line", {
|
|
109586
|
-
x1: "60.1",
|
|
109587
|
-
y1: "60.1",
|
|
109588
|
-
x2: "82.7",
|
|
109589
|
-
y2: "82.7",
|
|
109590
|
-
strokeLinecap: "round",
|
|
109591
|
-
strokeLinejoin: "round",
|
|
109592
|
-
strokeWidth: "24"
|
|
109593
|
-
})
|
|
109594
|
-
]
|
|
109595
|
-
});
|
|
109596
|
-
|
|
109597
109712
|
//#endregion
|
|
109598
109713
|
//#region src/icons/IconStarEmpty.tsx
|
|
109599
109714
|
const IconStarEmpty = (props) => /* @__PURE__ */ jsx("svg", {
|
|
@@ -140174,5 +140289,5 @@ const WysiwygEditor = forwardRef(({ id, content, className, placeholder, onChang
|
|
|
140174
140289
|
});
|
|
140175
140290
|
|
|
140176
140291
|
//#endregion
|
|
140177
|
-
export { AccordionItem, AccordionWrapper, ActionIcon, Alert, AppleAppButtonIcon, AutoCompleteInput, Avatar, AvatarIndicator, Badge, BigBadge, BreadCrumb, Checkbox, Divider, 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 };
|
|
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 };
|
|
140178
140293
|
//# sourceMappingURL=index.js.map
|