@youngonesworks/ui 0.1.95 → 0.1.98

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 (47) hide show
  1. package/dist/assets/fonts/woff/Gotham-BlackItalic_Web.woff +0 -0
  2. package/dist/assets/fonts/woff/Gotham-Black_Web.woff +0 -0
  3. package/dist/assets/fonts/woff/Gotham-BoldItalic_Web.woff +0 -0
  4. package/dist/assets/fonts/woff/Gotham-Bold_Web.woff +0 -0
  5. package/dist/assets/fonts/woff/Gotham-BookItalic_Web.woff +0 -0
  6. package/dist/assets/fonts/woff/Gotham-Book_Web.woff +0 -0
  7. package/dist/assets/fonts/woff/Gotham-LightItalic_Web.woff +0 -0
  8. package/dist/assets/fonts/woff/Gotham-Light_Web.woff +0 -0
  9. package/dist/assets/fonts/woff/Gotham-MediumItalic_Web.woff +0 -0
  10. package/dist/assets/fonts/woff/Gotham-Medium_Web.woff +0 -0
  11. package/dist/assets/fonts/woff/Gotham-ThinItalic_Web.woff +0 -0
  12. package/dist/assets/fonts/woff/Gotham-Thin_Web.woff +0 -0
  13. package/dist/assets/fonts/woff/Gotham-UltraItalic_Web.woff +0 -0
  14. package/dist/assets/fonts/woff/Gotham-Ultra_Web.woff +0 -0
  15. package/dist/assets/fonts/woff/Gotham-XLightItalic_Web.woff +0 -0
  16. package/dist/assets/fonts/woff/Gotham-XLight_Web.woff +0 -0
  17. package/dist/assets/fonts/woff2/Gotham-BlackItalic_Web.woff2 +0 -0
  18. package/dist/assets/fonts/woff2/Gotham-Black_Web.woff2 +0 -0
  19. package/dist/assets/fonts/woff2/Gotham-BoldItalic_Web.woff2 +0 -0
  20. package/dist/assets/fonts/woff2/Gotham-Bold_Web.woff2 +0 -0
  21. package/dist/assets/fonts/woff2/Gotham-BookItalic_Web.woff2 +0 -0
  22. package/dist/assets/fonts/woff2/Gotham-Book_Web.woff2 +0 -0
  23. package/dist/assets/fonts/woff2/Gotham-LightItalic_Web.woff2 +0 -0
  24. package/dist/assets/fonts/woff2/Gotham-Light_Web.woff2 +0 -0
  25. package/dist/assets/fonts/woff2/Gotham-MediumItalic_Web.woff2 +0 -0
  26. package/dist/assets/fonts/woff2/Gotham-Medium_Web.woff2 +0 -0
  27. package/dist/assets/fonts/woff2/Gotham-ThinItalic_Web.woff2 +0 -0
  28. package/dist/assets/fonts/woff2/Gotham-Thin_Web.woff2 +0 -0
  29. package/dist/assets/fonts/woff2/Gotham-UltraItalic_Web.woff2 +0 -0
  30. package/dist/assets/fonts/woff2/Gotham-Ultra_Web.woff2 +0 -0
  31. package/dist/assets/fonts/woff2/Gotham-XLightItalic_Web.woff2 +0 -0
  32. package/dist/assets/fonts/woff2/Gotham-XLight_Web.woff2 +0 -0
  33. package/dist/components/alert/index.d.ts +10 -9
  34. package/dist/components/badge/index.d.ts +2 -17
  35. package/dist/components/linkText/LinkText.stories.d.ts +6 -0
  36. package/dist/components/linkText/index.d.ts +11 -0
  37. package/dist/components/phoneInput/index.d.ts +0 -0
  38. package/dist/index.cjs +87 -79
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.js +88 -80
  41. package/dist/index.js.map +1 -1
  42. package/dist/styles/tailwind.css +44 -0
  43. package/dist/tailwind.plugin.js +33 -0
  44. package/dist/tailwind.preset.js +46 -0
  45. package/dist/theme/fonts.d.ts +29 -0
  46. package/dist/utils/enums.d.ts +1 -0
  47. package/package.json +3 -1
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  import * as React$1 from "react";
5
5
  import React, { Fragment, cloneElement, createRef, forwardRef, isValidElement, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
6
- import { IconAlertCircle, IconArrowNarrowLeft, IconBold, IconCalendar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCircleCheck, IconClearFormatting, IconEyeCheck, IconEyeOff, IconFilter, IconHeart, IconHeartFilled, IconItalic, IconList, IconListNumbers, IconMessageDots, IconSelector, IconUnderline, IconX } from "@tabler/icons-react";
6
+ import { IconAlertCircle, IconAlertTriangle, IconArrowNarrowLeft, IconBold, IconCalendar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCircleCheck, IconClearFormatting, IconEyeCheck, IconEyeOff, IconFilter, IconHeart, IconHeartFilled, IconItalic, IconList, IconListNumbers, IconMessageDots, IconSelector, IconUnderline, IconX } from "@tabler/icons-react";
7
7
  import clsx from "clsx";
8
8
  import { twMerge } from "tailwind-merge";
9
9
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -130,6 +130,7 @@ let COLOR = /* @__PURE__ */ function(COLOR$1) {
130
130
  COLOR$1["ULTRA_LIGHT_GRAY"] = "ultra-light-gray";
131
131
  COLOR$1["TURQUOISE"] = "turquoise";
132
132
  COLOR$1["RED"] = "red";
133
+ COLOR$1["DARK_GRAY"] = "dark-gray";
133
134
  COLOR$1["GRAY"] = "gray";
134
135
  COLOR$1["WHITE"] = "white";
135
136
  COLOR$1["PURPLE"] = "purple";
@@ -201,51 +202,74 @@ ActionIcon.displayName = "ActionIcon";
201
202
 
202
203
  //#endregion
203
204
  //#region src/components/alert/index.tsx
204
- const Alert = ({ show, message, type, plain = false, className }) => {
205
- const [showAlert, setShowAlert] = useState();
206
- const icon = () => {
207
- if (plain) return null;
208
- switch (type) {
209
- case "warning": return /* @__PURE__ */ jsx(IconAlertCircle, {
210
- className: "text-warning hidden md:block",
211
- size: 26,
212
- "data-testid": "alert-circle-icon"
213
- });
214
- case "error": return /* @__PURE__ */ jsx(IconAlertCircle, {
215
- className: "hidden text-red-500 md:block",
216
- size: 26,
217
- "data-testid": "alert-circle-icon"
218
- });
219
- case "success": return /* @__PURE__ */ jsx(IconCircleCheck, {
220
- className: "text-green hidden md:block",
221
- size: 26,
222
- "data-testid": "check-circle-icon"
223
- });
205
+ const Alert = ({ show, title, description, type = "warning", button, plain = false, closable = false, className, icon, onClose,...props }) => {
206
+ if (!show || !title) return null;
207
+ const typeConfig = {
208
+ success: {
209
+ bg: "bg-green-light",
210
+ iconColor: "text-green",
211
+ Icon: IconCircleCheck
212
+ },
213
+ warning: {
214
+ bg: "bg-warning-light",
215
+ iconColor: "text-warning",
216
+ Icon: IconAlertTriangle
217
+ },
218
+ error: {
219
+ bg: "bg-red-50",
220
+ iconColor: "text-red-500",
221
+ Icon: IconAlertCircle
224
222
  }
225
- return null;
226
223
  };
227
- useEffect(() => {
228
- setShowAlert(show);
229
- }, [show]);
230
- if (!showAlert) return null;
231
- return /* @__PURE__ */ jsx("div", {
232
- className: cn(`flex w-full justify-between gap-3 rounded border border-solid p-5 md:items-center md:gap-12 ${plain ? "border-none py-4 text-sm font-medium" : ""}`, {
233
- "border-warning bg-warning-light text-warning": type === COLOR.WARNING,
234
- "border-red-500 bg-red-50 text-red-500": type === COLOR.ERROR,
235
- "border-green bg-green-light text-green": type === COLOR.SUCCESS
236
- }, className),
224
+ const config = typeConfig[type];
225
+ const { bg, iconColor, Icon } = config;
226
+ const descriptionId = description ? `alert-desc` : undefined;
227
+ return /* @__PURE__ */ jsxs("div", {
228
+ role: "alert",
229
+ "aria-live": "assertive",
230
+ "aria-atomic": "true",
231
+ "aria-describedby": descriptionId,
232
+ className: cn("flex justify-between items-start rounded-md px-5 py-3", bg, plain && "border-none py-4 text-sm font-medium", className),
237
233
  "data-component": "Alert",
238
234
  "data-testid": "alert",
239
- children: /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs("div", {
240
- className: "flex md:items-center",
241
- children: [/* @__PURE__ */ jsx("div", {
242
- className: "flex md:items-center",
243
- children: icon()
244
- }), /* @__PURE__ */ jsx("p", {
245
- className: `m-0 font-medium text-black ${plain ? "" : "md:ml-5"}`,
246
- children: message
247
- })]
248
- }) })
235
+ ...props,
236
+ children: [/* @__PURE__ */ jsxs("div", {
237
+ className: "flex flex-col gap-2 flex-1",
238
+ children: [
239
+ /* @__PURE__ */ jsxs("div", {
240
+ className: "flex items-center gap-2",
241
+ children: [!plain && (icon ? /* @__PURE__ */ jsx("span", {
242
+ "data-testid": "alert-custom-icon",
243
+ "aria-hidden": "true",
244
+ children: icon
245
+ }) : /* @__PURE__ */ jsx(Icon, {
246
+ size: 20,
247
+ className: cn(iconColor, "shrink-0"),
248
+ "data-testid": "alert-icon",
249
+ "aria-hidden": "true"
250
+ })), /* @__PURE__ */ jsx("span", {
251
+ className: "text-base font-medium",
252
+ children: title
253
+ })]
254
+ }),
255
+ description && /* @__PURE__ */ jsx("p", {
256
+ id: descriptionId,
257
+ className: "text-sm text-color-gray-900",
258
+ children: description
259
+ }),
260
+ button && /* @__PURE__ */ jsx("div", { children: button })
261
+ ]
262
+ }), closable && /* @__PURE__ */ jsx("button", {
263
+ type: "button",
264
+ className: "ml-4 text-gray-500 hover:text-gray-700",
265
+ onClick: onClose,
266
+ "aria-label": "Dismiss alert",
267
+ "data-testid": "alert-close",
268
+ children: /* @__PURE__ */ jsx(IconX, {
269
+ size: 18,
270
+ "aria-hidden": "true"
271
+ })
272
+ })]
249
273
  });
250
274
  };
251
275
  Alert.displayName = "Alert";
@@ -612,48 +636,32 @@ const AvatarIndicator = ({ indicatorCount, className }) => /* @__PURE__ */ jsx("
612
636
 
613
637
  //#endregion
614
638
  //#region src/components/badge/index.tsx
615
- const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, mobile = false, badgeBorder = false, fullWidth = false, leftSection, rightSection, children,...props }) => /* @__PURE__ */ jsxs("span", {
616
- "data-testid": "badge",
617
- "data-component": "Badge",
618
- className: clsx("inline-flex h-[1.375rem] max-w-full place-content-center items-center p-[10px] align-middle text-xs leading-[20px] font-medium tracking-wide text-wrap whitespace-normal normal-case", mobile ? "rounded-s" : "rounded-[2rem]", fullWidth && "w-full", badgeBorder && {
619
- "border-accent-blue": styleVariant === COLOR.ACCENT_BLUE,
620
- "border-green-light": styleVariant === COLOR.GREEN_LIGHT,
621
- "border-red-500": styleVariant === COLOR.RED,
622
- "border-purple": styleVariant === COLOR.PURPLE,
623
- "border-warning": styleVariant === COLOR.WARNING,
624
- "border-black": styleVariant === COLOR.BLACK,
625
- "border-gray-800": styleVariant === COLOR.GRAY,
626
- "border-pink": styleVariant === COLOR.PINK_LIGHT || styleVariant === COLOR.PINK,
627
- "border-gray-200 bg-white text-black": styleVariant === COLOR.WHITE
628
- }, {
629
- "bg-accent-blue-light text-accent-blue": styleVariant === COLOR.ACCENT_BLUE,
630
- "bg-green-light text-green": styleVariant === COLOR.GREEN_LIGHT,
631
- "bg-red-50 text-red-500": styleVariant === COLOR.RED,
632
- "bg-purple-light text-purple": styleVariant === COLOR.PURPLE,
633
- "bg-warning-light text-warning": styleVariant === COLOR.WARNING,
634
- "bg-gray-50 text-black": styleVariant === COLOR.BLACK,
635
- "bg-gray-50 text-gray-800": styleVariant === COLOR.GRAY,
636
- "bg-pink-light text-pink": styleVariant === COLOR.PINK_LIGHT,
637
- "bg-pink text-white": styleVariant === COLOR.PINK,
638
- "bg-white text-black": styleVariant === COLOR.WHITE
639
- }, className),
640
- ...props,
641
- children: [
642
- leftSection && /* @__PURE__ */ jsx("div", {
643
- "data-testid": "left-section",
644
- children: leftSection
645
- }),
646
- /* @__PURE__ */ jsx("span", {
639
+ const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, children,...props }) => {
640
+ if (!children) return null;
641
+ return /* @__PURE__ */ jsx("span", {
642
+ "data-testid": "badge",
643
+ "data-component": "Badge",
644
+ className: clsx("inline-flex h-[1.375rem] max-w-full place-content-center items-center p-[10px] align-middle text-xs leading-[20px] font-medium tracking-wide text-wrap whitespace-normal normal-case rounded-sm", {
645
+ "bg-accent-blue-light text-accent-blue": styleVariant === COLOR.ACCENT_BLUE,
646
+ "bg-green-light text-green": styleVariant === COLOR.GREEN_LIGHT,
647
+ "bg-red-50 text-red-500": styleVariant === COLOR.RED,
648
+ "bg-purple-light text-purple": styleVariant === COLOR.PURPLE,
649
+ "bg-warning-light text-warning": styleVariant === COLOR.WARNING,
650
+ "bg-gray-50 text-black": styleVariant === COLOR.DARK_GRAY,
651
+ "bg-black text-white": styleVariant === COLOR.BLACK,
652
+ "bg-gray-50 text-gray-800": styleVariant === COLOR.GRAY,
653
+ "bg-pink-light text-pink": styleVariant === COLOR.PINK_LIGHT,
654
+ "bg-pink text-white": styleVariant === COLOR.PINK,
655
+ "bg-white text-black": styleVariant === COLOR.WHITE
656
+ }, className),
657
+ ...props,
658
+ children: /* @__PURE__ */ jsx("span", {
647
659
  "data-testid": "badge-content",
648
660
  className: cn("block h-5 overflow-hidden text-ellipsis whitespace-nowrap", { "flex items-center": favorite }),
649
661
  children
650
- }),
651
- rightSection && /* @__PURE__ */ jsx("div", {
652
- "data-testid": "right-section",
653
- children: rightSection
654
662
  })
655
- ]
656
- });
663
+ });
664
+ };
657
665
  Badge.displayName = "Badge";
658
666
 
659
667
  //#endregion