@youngonesworks/ui 0.1.25 → 0.1.27

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.
Files changed (44) hide show
  1. package/README.md +2 -2
  2. package/dist/components/rating/index.d.ts +5 -1
  3. package/dist/components/reviews/index.d.ts +5 -1
  4. package/dist/globals.css +40 -0
  5. package/dist/index.cjs +7 -157
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.js +8 -154
  8. package/dist/index.js.map +1 -1
  9. package/dist/styles/index.d.ts +1 -0
  10. package/dist/theme/index.d.ts +0 -1
  11. package/package.json +4 -2
  12. package/dist/assets/fonts/woff/Gotham-BlackItalic_Web.woff +0 -0
  13. package/dist/assets/fonts/woff/Gotham-Black_Web.woff +0 -0
  14. package/dist/assets/fonts/woff/Gotham-BoldItalic_Web.woff +0 -0
  15. package/dist/assets/fonts/woff/Gotham-Bold_Web.woff +0 -0
  16. package/dist/assets/fonts/woff/Gotham-BookItalic_Web.woff +0 -0
  17. package/dist/assets/fonts/woff/Gotham-Book_Web.woff +0 -0
  18. package/dist/assets/fonts/woff/Gotham-LightItalic_Web.woff +0 -0
  19. package/dist/assets/fonts/woff/Gotham-Light_Web.woff +0 -0
  20. package/dist/assets/fonts/woff/Gotham-MediumItalic_Web.woff +0 -0
  21. package/dist/assets/fonts/woff/Gotham-Medium_Web.woff +0 -0
  22. package/dist/assets/fonts/woff/Gotham-ThinItalic_Web.woff +0 -0
  23. package/dist/assets/fonts/woff/Gotham-Thin_Web.woff +0 -0
  24. package/dist/assets/fonts/woff/Gotham-UltraItalic_Web.woff +0 -0
  25. package/dist/assets/fonts/woff/Gotham-Ultra_Web.woff +0 -0
  26. package/dist/assets/fonts/woff/Gotham-XLightItalic_Web.woff +0 -0
  27. package/dist/assets/fonts/woff/Gotham-XLight_Web.woff +0 -0
  28. package/dist/assets/fonts/woff2/Gotham-BlackItalic_Web.woff2 +0 -0
  29. package/dist/assets/fonts/woff2/Gotham-Black_Web.woff2 +0 -0
  30. package/dist/assets/fonts/woff2/Gotham-BoldItalic_Web.woff2 +0 -0
  31. package/dist/assets/fonts/woff2/Gotham-Bold_Web.woff2 +0 -0
  32. package/dist/assets/fonts/woff2/Gotham-BookItalic_Web.woff2 +0 -0
  33. package/dist/assets/fonts/woff2/Gotham-Book_Web.woff2 +0 -0
  34. package/dist/assets/fonts/woff2/Gotham-LightItalic_Web.woff2 +0 -0
  35. package/dist/assets/fonts/woff2/Gotham-Light_Web.woff2 +0 -0
  36. package/dist/assets/fonts/woff2/Gotham-MediumItalic_Web.woff2 +0 -0
  37. package/dist/assets/fonts/woff2/Gotham-Medium_Web.woff2 +0 -0
  38. package/dist/assets/fonts/woff2/Gotham-ThinItalic_Web.woff2 +0 -0
  39. package/dist/assets/fonts/woff2/Gotham-Thin_Web.woff2 +0 -0
  40. package/dist/assets/fonts/woff2/Gotham-UltraItalic_Web.woff2 +0 -0
  41. package/dist/assets/fonts/woff2/Gotham-Ultra_Web.woff2 +0 -0
  42. package/dist/assets/fonts/woff2/Gotham-XLightItalic_Web.woff2 +0 -0
  43. package/dist/assets/fonts/woff2/Gotham-XLight_Web.woff2 +0 -0
  44. package/dist/theme/fonts.d.ts +0 -29
package/README.md CHANGED
@@ -32,8 +32,8 @@ npm install @youngonesworks/ui
32
32
  ### Tailwind CSS v4 setup
33
33
 
34
34
  ```bash
35
- npm install tailwindcss@4 postcss autoprefixer
36
- npx tailwindcss init -p
35
+ yarn add -D tailwindcss@4 postcss autoprefixer
36
+ yarn tailwindcss init -p
37
37
  ```
38
38
 
39
39
  Update `tailwind.config.js`:
@@ -5,6 +5,10 @@ interface IRating {
5
5
  setReview?: (val: number) => void;
6
6
  setReviewError?: (val: string) => void;
7
7
  error?: string;
8
+ ratings: {
9
+ value: number;
10
+ label: string;
11
+ }[];
8
12
  }
9
- export declare const Rating: ({ rating, size, setReview, className, setReviewError, error }: IRating) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Rating: ({ rating, ratings, size, setReview, className, setReviewError, error }: IRating) => import("react/jsx-runtime").JSX.Element;
10
14
  export {};
@@ -5,9 +5,13 @@ interface AggregatedRating {
5
5
  interface IReviewsProps {
6
6
  totalRatings: number;
7
7
  averageRating: number;
8
+ ratings: {
9
+ value: number;
10
+ label: string;
11
+ }[];
8
12
  aggregatedRating: AggregatedRating[];
9
13
  countStarsText: string[];
10
14
  numberOfReviewsText: string;
11
15
  }
12
- export declare const Reviews: ({ totalRatings, averageRating, aggregatedRating, countStarsText, numberOfReviewsText }: IReviewsProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const Reviews: ({ totalRatings, ratings, averageRating, aggregatedRating, countStarsText, numberOfReviewsText }: IReviewsProps) => import("react/jsx-runtime").JSX.Element;
13
17
  export {};
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Global CSS Styles
3
+ * Main stylesheet for the YoungOnes B2B Dashboard
4
+ */
5
+
6
+ @import "tailwindcss";
7
+
8
+ @import "./styles/fonts.css";
9
+ @import "./styles/variables.css";
10
+ @import "./styles/utilities.css";
11
+
12
+ @keyframes spin {
13
+ from {
14
+ transform: rotate(0deg);
15
+ }
16
+ to {
17
+ transform: rotate(360deg);
18
+ }
19
+ }
20
+
21
+ .tiptap {
22
+ :first-child {
23
+ margin-top: 0;
24
+ }
25
+
26
+ /* List styles */
27
+ ul,
28
+ ol {
29
+ padding: 0 1rem;
30
+ margin: 1.25rem 1rem 1.25rem 0.4rem;
31
+
32
+ li p {
33
+ margin-top: 0.25em;
34
+ margin-bottom: 0.25em;
35
+ }
36
+ }
37
+ }
38
+
39
+ /* Change this path to be relative to where this CSS file ends up after packaging this library. */
40
+ @source "../dist"
package/dist/index.cjs CHANGED
@@ -27,7 +27,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  const react = __toESM(require("react"));
28
28
  const react_jsx_runtime = __toESM(require("react/jsx-runtime"));
29
29
  const react_dom = __toESM(require("react-dom"));
30
- const next_font_local = __toESM(require("next/font/local"));
31
30
 
32
31
  //#region src/jsx-runtime-shim.ts
33
32
  const jsx$2 = react.createElement;
@@ -109785,7 +109784,7 @@ const IconStarHalfFilled = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs
109785
109784
 
109786
109785
  //#endregion
109787
109786
  //#region src/components/rating/index.tsx
109788
- const Rating = ({ rating, size: size$3 = "normal", setReview, className, setReviewError, error: error$1 }) => {
109787
+ const Rating = ({ rating, ratings, size: size$3 = "normal", setReview, className, setReviewError, error: error$1 }) => {
109789
109788
  const [hoveredStars, setHoveredStars] = (0, react.useState)(0);
109790
109789
  const [hoveredSmallStars, setHoveredSmallStars] = (0, react.useState)(0);
109791
109790
  const [reviewIsSet, setReviewIsSet] = (0, react.useState)(false);
@@ -109823,41 +109822,13 @@ const Rating = ({ rating, size: size$3 = "normal", setReview, className, setRevi
109823
109822
  if (index$4 - roundedRating === .5) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarHalfFilled, { className: cn(className$1, "text-yellow") });
109824
109823
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconStarEmpty, { className: cn(className$1, "text-yellow") });
109825
109824
  };
109826
- const ratings = [
109827
- {
109828
- value: 5,
109829
- label: "Excellent"
109830
- },
109831
- {
109832
- value: 4,
109833
- label: "Good"
109834
- },
109835
- {
109836
- value: 3,
109837
- label: "Average"
109838
- },
109839
- {
109840
- value: 2,
109841
- label: "Fair"
109842
- },
109843
- {
109844
- value: 1,
109845
- label: "Poor"
109846
- }
109847
- ];
109848
109825
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
109849
109826
  className: cn("flex flex-col", className),
109850
109827
  children: [
109851
109828
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
109852
109829
  "data-component": "rating",
109853
109830
  className: "flex flex-row gap-[2px]",
109854
- children: [
109855
- 1,
109856
- 2,
109857
- 3,
109858
- 4,
109859
- 5
109860
- ].map((index$4) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
109831
+ children: ratings.map((_$1, index$4) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
109861
109832
  className: cn("relative", setReview && "cursor-pointer"),
109862
109833
  onClick: () => handleStarClick(index$4),
109863
109834
  onMouseEnter: () => handleHover(index$4),
@@ -109935,7 +109906,7 @@ const ReviewsLine = ({ maxValue, amount, countStarsText }) => /* @__PURE__ */ (0
109935
109906
  function formatRating(rating) {
109936
109907
  return rating === 0 ? 0 : rating.toFixed(1);
109937
109908
  }
109938
- const Reviews = ({ totalRatings, averageRating, aggregatedRating, countStarsText, numberOfReviewsText }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
109909
+ const Reviews = ({ totalRatings, ratings, averageRating, aggregatedRating, countStarsText, numberOfReviewsText }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
109939
109910
  className: "bg-ultra-light-gray flex w-full flex-col p-6 md:flex-row",
109940
109911
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
109941
109912
  className: "mb-5 flex flex-1 flex-row items-start justify-start gap-5 md:mb-0 md:flex-col md:justify-center md:gap-0",
@@ -109945,6 +109916,7 @@ const Reviews = ({ totalRatings, averageRating, aggregatedRating, countStarsText
109945
109916
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
109946
109917
  className: "flex flex-col",
109947
109918
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Rating, {
109919
+ ratings,
109948
109920
  rating: averageRating,
109949
109921
  size: "normal",
109950
109922
  className: "mb-4"
@@ -109995,7 +109967,7 @@ const ScrollToTop = ({ scrollToTopTitle }) => {
109995
109967
  };
109996
109968
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActionIcon, {
109997
109969
  title: scrollToTopTitle,
109998
- className: `bg-turquoise-700 hover:bg-turquoise-600 fixed -right-[10px] bottom-[105px] z-40 flex h-[43px] w-[62px] cursor-pointer items-center justify-center rounded-l-3xl border-0 px-2 text-black duration-500 ${isVisible ? "translate-x-0" : "translate-x-[60px]"}`,
109970
+ className: `active:translate-y-[1px] content-center rounded-[4px] border-gray-200 hover:border-black child:p-10 disabled:text-gray-500 bg-turquoise-700 hover:bg-turquoise-600 fixed -right-[10px] bottom-[105px] z-40 flex h-[43px] w-[62px] cursor-pointer items-center justify-center rounded-l-3xl border-0 px-2 text-black duration-500 ${isVisible ? "translate-x-0" : "translate-x-[60px]"}`,
109999
109971
  onClick: scrollToTop,
110000
109972
  icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronUp, {})
110001
109973
  });
@@ -140329,130 +140301,12 @@ const CSS_VARIABLE_KEYS = [
140329
140301
  "--color-warning-dark"
140330
140302
  ];
140331
140303
  const getCSSVariable = (variable) => {
140332
- if (typeof window !== "undefined") {
140333
- return getComputedStyle(document.documentElement).getPropertyValue(variable).trim();
140334
- }
140304
+ if (typeof window !== "undefined") return getComputedStyle(document.documentElement).getPropertyValue(variable).trim();
140335
140305
  return "";
140336
140306
  };
140337
140307
  const setCSSVariable = (variable, value) => {
140338
- if (typeof window !== "undefined") {
140339
- document.documentElement.style.setProperty(variable, value);
140340
- }
140341
- };
140342
-
140343
- //#endregion
140344
- //#region src/theme/fonts.ts
140345
- const gothamFont = (0, next_font_local.default)({
140346
- src: [
140347
- {
140348
- path: "../assets/fonts/woff2/Gotham-Thin_Web.woff2",
140349
- weight: "100",
140350
- style: "normal"
140351
- },
140352
- {
140353
- path: "../assets/fonts/woff2/Gotham-ThinItalic_Web.woff2",
140354
- weight: "100",
140355
- style: "italic"
140356
- },
140357
- {
140358
- path: "../assets/fonts/woff2/Gotham-XLight_Web.woff2",
140359
- weight: "200",
140360
- style: "normal"
140361
- },
140362
- {
140363
- path: "../assets/fonts/woff2/Gotham-XLightItalic_Web.woff2",
140364
- weight: "200",
140365
- style: "italic"
140366
- },
140367
- {
140368
- path: "../assets/fonts/woff2/Gotham-Light_Web.woff2",
140369
- weight: "300",
140370
- style: "normal"
140371
- },
140372
- {
140373
- path: "../assets/fonts/woff2/Gotham-LightItalic_Web.woff2",
140374
- weight: "300",
140375
- style: "italic"
140376
- },
140377
- {
140378
- path: "../assets/fonts/woff2/Gotham-Book_Web.woff2",
140379
- weight: "400",
140380
- style: "normal"
140381
- },
140382
- {
140383
- path: "../assets/fonts/woff2/Gotham-BookItalic_Web.woff2",
140384
- weight: "400",
140385
- style: "italic"
140386
- },
140387
- {
140388
- path: "../assets/fonts/woff2/Gotham-Medium_Web.woff2",
140389
- weight: "500",
140390
- style: "normal"
140391
- },
140392
- {
140393
- path: "../assets/fonts/woff2/Gotham-MediumItalic_Web.woff2",
140394
- weight: "500",
140395
- style: "italic"
140396
- },
140397
- {
140398
- path: "../assets/fonts/woff2/Gotham-Bold_Web.woff2",
140399
- weight: "700",
140400
- style: "normal"
140401
- },
140402
- {
140403
- path: "../assets/fonts/woff2/Gotham-BoldItalic_Web.woff2",
140404
- weight: "700",
140405
- style: "italic"
140406
- },
140407
- {
140408
- path: "../assets/fonts/woff2/Gotham-Black_Web.woff2",
140409
- weight: "800",
140410
- style: "normal"
140411
- },
140412
- {
140413
- path: "../assets/fonts/woff2/Gotham-BlackItalic_Web.woff2",
140414
- weight: "800",
140415
- style: "italic"
140416
- },
140417
- {
140418
- path: "../assets/fonts/woff2/Gotham-Ultra_Web.woff2",
140419
- weight: "900",
140420
- style: "normal"
140421
- },
140422
- {
140423
- path: "../assets/fonts/woff2/Gotham-UltraItalic_Web.woff2",
140424
- weight: "900",
140425
- style: "italic"
140426
- }
140427
- ],
140428
- variable: "--font-gotham",
140429
- display: "swap",
140430
- preload: true
140431
- });
140432
- const FONT_FAMILIES = {
140433
- gotham: "var(--font-gotham), Gotham, ui-sans-serif, system-ui, sans-serif",
140434
- sans: "ui-sans-serif, system-ui, sans-serif",
140435
- serif: "ui-serif, Georgia, serif",
140436
- mono: "ui-monospace, SFMono-Regular, Consolas, monospace"
140437
- };
140438
- const FONT_WEIGHTS = {
140439
- thin: "100",
140440
- extraLight: "200",
140441
- light: "300",
140442
- normal: "400",
140443
- medium: "500",
140444
- semiBold: "600",
140445
- bold: "700",
140446
- extraBold: "800",
140447
- black: "900"
140448
- };
140449
- const FONT_CLASS_NAMES = {
140450
- gotham: gothamFont.className,
140451
- sans: "font-sans",
140452
- serif: "font-serif",
140453
- mono: "font-mono"
140308
+ if (typeof window !== "undefined") document.documentElement.style.setProperty(variable, value);
140454
140309
  };
140455
- var fonts_default = gothamFont;
140456
140310
 
140457
140311
  //#endregion
140458
140312
  exports.AccordionItem = AccordionItem;
@@ -140470,9 +140324,6 @@ exports.Button = Button;
140470
140324
  exports.CSS_VARIABLE_KEYS = CSS_VARIABLE_KEYS;
140471
140325
  exports.Checkbox = Checkbox;
140472
140326
  exports.Divider = Divider;
140473
- exports.FONT_CLASS_NAMES = FONT_CLASS_NAMES;
140474
- exports.FONT_FAMILIES = FONT_FAMILIES;
140475
- exports.FONT_WEIGHTS = FONT_WEIGHTS;
140476
140327
  exports.FavouriteButton = FavouriteButton;
140477
140328
  exports.Filters = Filters;
140478
140329
  exports.GoogleAppButtonIcon = GoogleAppButtonIcon;
@@ -140521,6 +140372,5 @@ exports.UnstyledButton = UnstyledButton;
140521
140372
  exports.WysiwygEditor = WysiwygEditor;
140522
140373
  exports.buttonVariants = buttonVariants;
140523
140374
  exports.getCSSVariable = getCSSVariable;
140524
- exports.gothamFont = gothamFont;
140525
140375
  exports.setCSSVariable = setCSSVariable;
140526
140376
  //# sourceMappingURL=index.cjs.map