@youngonesworks/ui 0.1.20 → 0.1.24
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/README.md +210 -13
- package/dist/components/checkbox/index.d.ts +10 -8
- package/dist/components/favouriteButton/index.d.ts +6 -11
- package/dist/index.cjs +196 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +187 -47
- package/dist/index.js.map +1 -1
- package/dist/styles/index.d.ts +9 -0
- package/dist/styles/utilities.css +200 -0
- package/dist/styles/variables.css +228 -0
- package/dist/theme/fonts.d.ts +29 -0
- package/dist/theme/index.d.ts +5 -0
- package/dist/theme/variables.d.ts +62 -0
- package/package.json +32 -14
- package/dist/components/calendar/index.d.ts +0 -0
- package/dist/components/checkbox/Checkbox.stories.d.ts +0 -9
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';
|
|
@@ -57,3 +58,4 @@ export { UnorderedList } from './components/unorderedList';
|
|
|
57
58
|
export { UnorderedListItem } from './components/unorderedListItem';
|
|
58
59
|
export { UnstyledButton } from './components/unstyledButton';
|
|
59
60
|
export { WysiwygEditor } from './components/wysiwygEditor';
|
|
61
|
+
export * from './theme';
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import React, { Component, Fragment, cloneElement, createContext, createElement,
|
|
|
3
3
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import * as ReactDOM$1 from "react-dom";
|
|
5
5
|
import ReactDOM, { createPortal, flushSync } from "react-dom";
|
|
6
|
+
import localFont from "next/font/local";
|
|
6
7
|
|
|
7
8
|
//#region rolldown:runtime
|
|
8
9
|
var __create = Object.create;
|
|
@@ -103440,7 +103441,7 @@ function Button({ type = "button", variant = "primary", ariaLabel, block = false
|
|
|
103440
103441
|
type,
|
|
103441
103442
|
"aria-label": ariaLabel,
|
|
103442
103443
|
"data-testid": dataTestId,
|
|
103443
|
-
className: cn(buttonVariants[variant], className, block && "w-full"),
|
|
103444
|
+
className: cn(buttonVariants[variant], className, block && "w-full text-sm"),
|
|
103444
103445
|
onClick: handleOnClick,
|
|
103445
103446
|
...props,
|
|
103446
103447
|
children: [
|
|
@@ -103454,7 +103455,7 @@ Button.displayName = "Button";
|
|
|
103454
103455
|
|
|
103455
103456
|
//#endregion
|
|
103456
103457
|
//#region src/components/checkbox/index.tsx
|
|
103457
|
-
const
|
|
103458
|
+
const CheckboxComponent = ({ size: size$3 = "md", className, error: error$1, mediumBoldText, label, indeterminate = false, disabled = false,...props }, ref) => /* @__PURE__ */ jsxs("div", {
|
|
103458
103459
|
className: cn("relative grid gap-2", className),
|
|
103459
103460
|
children: [/* @__PURE__ */ jsxs("label", {
|
|
103460
103461
|
className: cn("flex cursor-pointer items-center gap-3"),
|
|
@@ -103466,8 +103467,8 @@ const Checkbox = forwardRef(({ size: size$3 = "md", className, error: error$1, m
|
|
|
103466
103467
|
type: "checkbox",
|
|
103467
103468
|
"data-testid": "checkbox",
|
|
103468
103469
|
disabled,
|
|
103469
|
-
|
|
103470
|
-
|
|
103470
|
+
...props,
|
|
103471
|
+
ref
|
|
103471
103472
|
}),
|
|
103472
103473
|
/* @__PURE__ */ jsx("svg", {
|
|
103473
103474
|
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 +103506,35 @@ const Checkbox = forwardRef(({ size: size$3 = "md", className, error: error$1, m
|
|
|
103505
103506
|
className: "text-xs font-normal text-red-500",
|
|
103506
103507
|
children: error$1
|
|
103507
103508
|
})]
|
|
103508
|
-
})
|
|
103509
|
-
Checkbox
|
|
103509
|
+
});
|
|
103510
|
+
const Checkbox = forwardRef(CheckboxComponent);
|
|
103510
103511
|
|
|
103511
103512
|
//#endregion
|
|
103512
103513
|
//#region src/components/divider/index.tsx
|
|
103513
103514
|
const Divider = ({ className,...props }) => /* @__PURE__ */ jsx("div", {
|
|
103514
103515
|
"data-component": "divider",
|
|
103515
|
-
className: clsx_default("block h-px w-full bg-
|
|
103516
|
+
className: clsx_default("block h-px w-full bg-gray-200", className),
|
|
103516
103517
|
...props
|
|
103517
103518
|
});
|
|
103518
103519
|
|
|
103520
|
+
//#endregion
|
|
103521
|
+
//#region src/components/favouriteButton/index.tsx
|
|
103522
|
+
const FavouriteButton = forwardRef((props, ref) => {
|
|
103523
|
+
const { onClick, favourite, iconFilled, iconOutline, favouriteTitle, iconColorSelected = "text-pink", iconColor = "text-gray-800", iconSize, className = "", styleVariant = "transparent", children,...rest } = props;
|
|
103524
|
+
return /* @__PURE__ */ jsx(ActionIcon, {
|
|
103525
|
+
onClick,
|
|
103526
|
+
"data-component": "favouriteButton",
|
|
103527
|
+
title: favouriteTitle || "Favorite",
|
|
103528
|
+
styleVariant,
|
|
103529
|
+
className: `${favourite ? iconColorSelected : iconColor} ${className}`.trim(),
|
|
103530
|
+
iconSize,
|
|
103531
|
+
ref,
|
|
103532
|
+
icon: favourite ? iconFilled ?? /* @__PURE__ */ jsx(IconHeartFilled, {}) : iconOutline ?? /* @__PURE__ */ jsx(IconHeart, {}),
|
|
103533
|
+
...rest,
|
|
103534
|
+
children
|
|
103535
|
+
});
|
|
103536
|
+
});
|
|
103537
|
+
|
|
103519
103538
|
//#endregion
|
|
103520
103539
|
//#region src/components/filters/FilterButton.tsx
|
|
103521
103540
|
const FilterButton = ({ onClick, hasFilters, reset, filtersText, resetText }) => /* @__PURE__ */ jsxs("div", {
|
|
@@ -137802,37 +137821,8 @@ function isClassComponent(Component$1) {
|
|
|
137802
137821
|
* @returns {boolean}
|
|
137803
137822
|
*/
|
|
137804
137823
|
function isForwardRefComponent(Component$1) {
|
|
137805
|
-
|
|
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;
|
|
137824
|
+
var _a;
|
|
137825
|
+
return !!(typeof Component$1 === "object" && ((_a = Component$1.$$typeof) === null || _a === void 0 ? void 0 : _a.toString()) === "Symbol(react.forward_ref)");
|
|
137836
137826
|
}
|
|
137837
137827
|
/**
|
|
137838
137828
|
* Check if we're running React 19+ by detecting if function components support ref props
|
|
@@ -137890,15 +137880,19 @@ var ReactRenderer = class {
|
|
|
137890
137880
|
const props = this.props;
|
|
137891
137881
|
const editor = this.editor;
|
|
137892
137882
|
const isReact19 = isReact19Plus();
|
|
137893
|
-
const
|
|
137883
|
+
const isClassComp = isClassComponent(Component$1);
|
|
137884
|
+
const isForwardRefComp = isForwardRefComponent(Component$1);
|
|
137894
137885
|
const elementProps = { ...props };
|
|
137895
|
-
if (elementProps.ref
|
|
137896
|
-
|
|
137897
|
-
|
|
137898
|
-
|
|
137899
|
-
|
|
137900
|
-
|
|
137901
|
-
|
|
137886
|
+
if (!elementProps.ref) {
|
|
137887
|
+
if (isReact19) {
|
|
137888
|
+
elementProps.ref = (ref) => {
|
|
137889
|
+
this.ref = ref;
|
|
137890
|
+
};
|
|
137891
|
+
} else if (isClassComp || isForwardRefComp) {
|
|
137892
|
+
elementProps.ref = (ref) => {
|
|
137893
|
+
this.ref = ref;
|
|
137894
|
+
};
|
|
137895
|
+
}
|
|
137902
137896
|
}
|
|
137903
137897
|
this.reactElement = React.createElement(Component$1, { ...elementProps });
|
|
137904
137898
|
(_a = editor === null || editor === void 0 ? void 0 : editor.contentComponent) === null || _a === void 0 ? void 0 : _a.setRenderer(this.id, this);
|
|
@@ -140317,5 +140311,151 @@ const WysiwygEditor = forwardRef(({ id, content, className, placeholder, onChang
|
|
|
140317
140311
|
});
|
|
140318
140312
|
|
|
140319
140313
|
//#endregion
|
|
140320
|
-
|
|
140314
|
+
//#region src/theme/variables.ts
|
|
140315
|
+
const CSS_VARIABLE_KEYS = [
|
|
140316
|
+
"--color-primary",
|
|
140317
|
+
"--color-primary-light",
|
|
140318
|
+
"--color-primary-dark",
|
|
140319
|
+
"--color-black",
|
|
140320
|
+
"--color-navy-blue",
|
|
140321
|
+
"--color-white",
|
|
140322
|
+
"--color-accent-blue",
|
|
140323
|
+
"--color-ultra-light-blue",
|
|
140324
|
+
"--color-green",
|
|
140325
|
+
"--color-green-light",
|
|
140326
|
+
"--color-pink",
|
|
140327
|
+
"--color-purple",
|
|
140328
|
+
"--color-orange",
|
|
140329
|
+
"--color-warning",
|
|
140330
|
+
"--color-warning-light",
|
|
140331
|
+
"--color-warning-dark"
|
|
140332
|
+
];
|
|
140333
|
+
const getCSSVariable = (variable) => {
|
|
140334
|
+
if (typeof window !== "undefined") {
|
|
140335
|
+
return getComputedStyle(document.documentElement).getPropertyValue(variable).trim();
|
|
140336
|
+
}
|
|
140337
|
+
return "";
|
|
140338
|
+
};
|
|
140339
|
+
const setCSSVariable = (variable, value) => {
|
|
140340
|
+
if (typeof window !== "undefined") {
|
|
140341
|
+
document.documentElement.style.setProperty(variable, value);
|
|
140342
|
+
}
|
|
140343
|
+
};
|
|
140344
|
+
|
|
140345
|
+
//#endregion
|
|
140346
|
+
//#region src/theme/fonts.ts
|
|
140347
|
+
const gothamFont = localFont({
|
|
140348
|
+
src: [
|
|
140349
|
+
{
|
|
140350
|
+
path: "../assets/fonts/woff2/Gotham-Thin_Web.woff2",
|
|
140351
|
+
weight: "100",
|
|
140352
|
+
style: "normal"
|
|
140353
|
+
},
|
|
140354
|
+
{
|
|
140355
|
+
path: "../assets/fonts/woff2/Gotham-ThinItalic_Web.woff2",
|
|
140356
|
+
weight: "100",
|
|
140357
|
+
style: "italic"
|
|
140358
|
+
},
|
|
140359
|
+
{
|
|
140360
|
+
path: "../assets/fonts/woff2/Gotham-XLight_Web.woff2",
|
|
140361
|
+
weight: "200",
|
|
140362
|
+
style: "normal"
|
|
140363
|
+
},
|
|
140364
|
+
{
|
|
140365
|
+
path: "../assets/fonts/woff2/Gotham-XLightItalic_Web.woff2",
|
|
140366
|
+
weight: "200",
|
|
140367
|
+
style: "italic"
|
|
140368
|
+
},
|
|
140369
|
+
{
|
|
140370
|
+
path: "../assets/fonts/woff2/Gotham-Light_Web.woff2",
|
|
140371
|
+
weight: "300",
|
|
140372
|
+
style: "normal"
|
|
140373
|
+
},
|
|
140374
|
+
{
|
|
140375
|
+
path: "../assets/fonts/woff2/Gotham-LightItalic_Web.woff2",
|
|
140376
|
+
weight: "300",
|
|
140377
|
+
style: "italic"
|
|
140378
|
+
},
|
|
140379
|
+
{
|
|
140380
|
+
path: "../assets/fonts/woff2/Gotham-Book_Web.woff2",
|
|
140381
|
+
weight: "400",
|
|
140382
|
+
style: "normal"
|
|
140383
|
+
},
|
|
140384
|
+
{
|
|
140385
|
+
path: "../assets/fonts/woff2/Gotham-BookItalic_Web.woff2",
|
|
140386
|
+
weight: "400",
|
|
140387
|
+
style: "italic"
|
|
140388
|
+
},
|
|
140389
|
+
{
|
|
140390
|
+
path: "../assets/fonts/woff2/Gotham-Medium_Web.woff2",
|
|
140391
|
+
weight: "500",
|
|
140392
|
+
style: "normal"
|
|
140393
|
+
},
|
|
140394
|
+
{
|
|
140395
|
+
path: "../assets/fonts/woff2/Gotham-MediumItalic_Web.woff2",
|
|
140396
|
+
weight: "500",
|
|
140397
|
+
style: "italic"
|
|
140398
|
+
},
|
|
140399
|
+
{
|
|
140400
|
+
path: "../assets/fonts/woff2/Gotham-Bold_Web.woff2",
|
|
140401
|
+
weight: "700",
|
|
140402
|
+
style: "normal"
|
|
140403
|
+
},
|
|
140404
|
+
{
|
|
140405
|
+
path: "../assets/fonts/woff2/Gotham-BoldItalic_Web.woff2",
|
|
140406
|
+
weight: "700",
|
|
140407
|
+
style: "italic"
|
|
140408
|
+
},
|
|
140409
|
+
{
|
|
140410
|
+
path: "../assets/fonts/woff2/Gotham-Black_Web.woff2",
|
|
140411
|
+
weight: "800",
|
|
140412
|
+
style: "normal"
|
|
140413
|
+
},
|
|
140414
|
+
{
|
|
140415
|
+
path: "../assets/fonts/woff2/Gotham-BlackItalic_Web.woff2",
|
|
140416
|
+
weight: "800",
|
|
140417
|
+
style: "italic"
|
|
140418
|
+
},
|
|
140419
|
+
{
|
|
140420
|
+
path: "../assets/fonts/woff2/Gotham-Ultra_Web.woff2",
|
|
140421
|
+
weight: "900",
|
|
140422
|
+
style: "normal"
|
|
140423
|
+
},
|
|
140424
|
+
{
|
|
140425
|
+
path: "../assets/fonts/woff2/Gotham-UltraItalic_Web.woff2",
|
|
140426
|
+
weight: "900",
|
|
140427
|
+
style: "italic"
|
|
140428
|
+
}
|
|
140429
|
+
],
|
|
140430
|
+
variable: "--font-gotham",
|
|
140431
|
+
display: "swap",
|
|
140432
|
+
preload: true
|
|
140433
|
+
});
|
|
140434
|
+
const FONT_FAMILIES = {
|
|
140435
|
+
gotham: "var(--font-gotham), Gotham, ui-sans-serif, system-ui, sans-serif",
|
|
140436
|
+
sans: "ui-sans-serif, system-ui, sans-serif",
|
|
140437
|
+
serif: "ui-serif, Georgia, serif",
|
|
140438
|
+
mono: "ui-monospace, SFMono-Regular, Consolas, monospace"
|
|
140439
|
+
};
|
|
140440
|
+
const FONT_WEIGHTS = {
|
|
140441
|
+
thin: "100",
|
|
140442
|
+
extraLight: "200",
|
|
140443
|
+
light: "300",
|
|
140444
|
+
normal: "400",
|
|
140445
|
+
medium: "500",
|
|
140446
|
+
semiBold: "600",
|
|
140447
|
+
bold: "700",
|
|
140448
|
+
extraBold: "800",
|
|
140449
|
+
black: "900"
|
|
140450
|
+
};
|
|
140451
|
+
const FONT_CLASS_NAMES = {
|
|
140452
|
+
gotham: gothamFont.className,
|
|
140453
|
+
sans: "font-sans",
|
|
140454
|
+
serif: "font-serif",
|
|
140455
|
+
mono: "font-mono"
|
|
140456
|
+
};
|
|
140457
|
+
var fonts_default = gothamFont;
|
|
140458
|
+
|
|
140459
|
+
//#endregion
|
|
140460
|
+
export { AccordionItem, AccordionWrapper, ActionIcon, Alert, AppleAppButtonIcon, AutoCompleteInput, Avatar, AvatarIndicator, Badge, BigBadge, BreadCrumb, Button, CSS_VARIABLE_KEYS, Checkbox, Divider, FONT_CLASS_NAMES, FONT_FAMILIES, FONT_WEIGHTS, 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, getCSSVariable, gothamFont, setCSSVariable };
|
|
140321
140461
|
//# sourceMappingURL=index.js.map
|