@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
@@ -1,17 +1,18 @@
1
- interface IAlert {
1
+ import { HTMLAttributes } from 'react';
2
+ type AlertType = 'success' | 'warning' | 'error';
3
+ interface AlertProps extends HTMLAttributes<HTMLDivElement> {
2
4
  show: boolean;
3
- message: React.ReactNode;
4
- type: 'warning' | 'error' | 'success';
5
- 'data-testid'?: string;
5
+ title: string;
6
+ description?: string;
7
+ type?: AlertType;
8
+ button?: React.ReactNode;
6
9
  plain?: boolean;
7
- /**
8
- * @deprecated Can be removed entirely.
9
- */
10
10
  closable?: boolean;
11
- className?: string;
11
+ icon?: React.ReactNode;
12
+ onClose?: () => void;
12
13
  }
13
14
  export declare const Alert: {
14
- ({ show, message, type, plain, className }: IAlert): import("react/jsx-runtime").JSX.Element | null;
15
+ ({ show, title, description, type, button, plain, closable, className, icon, onClose, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
15
16
  displayName: string;
16
17
  };
17
18
  export {};
@@ -1,27 +1,12 @@
1
1
  interface IBadgeProps {
2
- styleVariant?: 'green-light' | 'red' | 'accent-blue' | 'warning' | 'gray' | 'black' | 'purple' | 'pink' | 'pink-light' | 'gray' | 'white';
2
+ styleVariant?: 'green-light' | 'red' | 'accent-blue' | 'warning' | 'gray' | 'black' | 'dark-gray' | 'purple' | 'pink' | 'pink-light' | 'gray' | 'white';
3
3
  color?: 'dark' | 'gray' | 'red' | 'pink' | 'grape' | 'violet' | 'indigo' | 'blue' | 'cyan' | 'green' | 'lime' | 'yellow' | 'orange' | 'teal';
4
- /** Controls appearance */
5
- variant?: 'light' | 'filled' | 'outline' | 'dot' | 'gradient';
6
- /** Badge height and font size */
7
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
8
- /** Key of theme.radius or any valid CSS value to set border-radius, "xl" by default */
9
- radius?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
10
- /** Sets badge width to 100% of parent element, hides overflow text with text-overflow: ellipsis */
11
- fullWidth?: boolean;
12
- /** Section rendered on the left side of label */
13
- leftSection?: React.ReactNode;
14
- /** Section rendered on the right side of label */
15
- rightSection?: React.ReactNode;
16
4
  favorite?: boolean;
17
- /** Badge label */
18
5
  children?: React.ReactNode;
19
- mobile?: boolean;
20
6
  className?: string;
21
- badgeBorder?: boolean;
22
7
  }
23
8
  export declare const Badge: {
24
- ({ styleVariant, className, favorite, mobile, badgeBorder, fullWidth, leftSection, rightSection, children, ...props }: IBadgeProps): import("react/jsx-runtime").JSX.Element;
9
+ ({ styleVariant, className, favorite, children, ...props }: IBadgeProps): import("react/jsx-runtime").JSX.Element | null;
25
10
  displayName: string;
26
11
  };
27
12
  export {};
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { LinkText } from './index';
3
+ declare const meta: Meta<typeof LinkText>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof LinkText>;
6
+ export declare const Default: Story;
@@ -0,0 +1,11 @@
1
+ import { type ReactElement } from 'react';
2
+ interface ILinkText {
3
+ children: ReactElement | string | ReactElement[];
4
+ classNames?: string;
5
+ }
6
+ /** @deprecated dont use this anymore, instead use the next link */
7
+ export declare const LinkText: {
8
+ ({ children, classNames }: ILinkText): import("react/jsx-runtime").JSX.Element;
9
+ displayName: string;
10
+ };
11
+ export {};
File without changes
package/dist/index.cjs CHANGED
@@ -152,6 +152,7 @@ let COLOR = /* @__PURE__ */ function(COLOR$1) {
152
152
  COLOR$1["ULTRA_LIGHT_GRAY"] = "ultra-light-gray";
153
153
  COLOR$1["TURQUOISE"] = "turquoise";
154
154
  COLOR$1["RED"] = "red";
155
+ COLOR$1["DARK_GRAY"] = "dark-gray";
155
156
  COLOR$1["GRAY"] = "gray";
156
157
  COLOR$1["WHITE"] = "white";
157
158
  COLOR$1["PURPLE"] = "purple";
@@ -223,51 +224,74 @@ ActionIcon.displayName = "ActionIcon";
223
224
 
224
225
  //#endregion
225
226
  //#region src/components/alert/index.tsx
226
- const Alert = ({ show, message, type, plain = false, className }) => {
227
- const [showAlert, setShowAlert] = (0, react.useState)();
228
- const icon = () => {
229
- if (plain) return null;
230
- switch (type) {
231
- case "warning": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tabler_icons_react.IconAlertCircle, {
232
- className: "text-warning hidden md:block",
233
- size: 26,
234
- "data-testid": "alert-circle-icon"
235
- });
236
- case "error": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tabler_icons_react.IconAlertCircle, {
237
- className: "hidden text-red-500 md:block",
238
- size: 26,
239
- "data-testid": "alert-circle-icon"
240
- });
241
- case "success": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tabler_icons_react.IconCircleCheck, {
242
- className: "text-green hidden md:block",
243
- size: 26,
244
- "data-testid": "check-circle-icon"
245
- });
227
+ const Alert = ({ show, title, description, type = "warning", button, plain = false, closable = false, className, icon, onClose,...props }) => {
228
+ if (!show || !title) return null;
229
+ const typeConfig = {
230
+ success: {
231
+ bg: "bg-green-light",
232
+ iconColor: "text-green",
233
+ Icon: __tabler_icons_react.IconCircleCheck
234
+ },
235
+ warning: {
236
+ bg: "bg-warning-light",
237
+ iconColor: "text-warning",
238
+ Icon: __tabler_icons_react.IconAlertTriangle
239
+ },
240
+ error: {
241
+ bg: "bg-red-50",
242
+ iconColor: "text-red-500",
243
+ Icon: __tabler_icons_react.IconAlertCircle
246
244
  }
247
- return null;
248
245
  };
249
- (0, react.useEffect)(() => {
250
- setShowAlert(show);
251
- }, [show]);
252
- if (!showAlert) return null;
253
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
254
- 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" : ""}`, {
255
- "border-warning bg-warning-light text-warning": type === COLOR.WARNING,
256
- "border-red-500 bg-red-50 text-red-500": type === COLOR.ERROR,
257
- "border-green bg-green-light text-green": type === COLOR.SUCCESS
258
- }, className),
246
+ const config = typeConfig[type];
247
+ const { bg, iconColor, Icon } = config;
248
+ const descriptionId = description ? `alert-desc` : undefined;
249
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
250
+ role: "alert",
251
+ "aria-live": "assertive",
252
+ "aria-atomic": "true",
253
+ "aria-describedby": descriptionId,
254
+ className: cn("flex justify-between items-start rounded-md px-5 py-3", bg, plain && "border-none py-4 text-sm font-medium", className),
259
255
  "data-component": "Alert",
260
256
  "data-testid": "alert",
261
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
262
- className: "flex md:items-center",
263
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
264
- className: "flex md:items-center",
265
- children: icon()
266
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
267
- className: `m-0 font-medium text-black ${plain ? "" : "md:ml-5"}`,
268
- children: message
269
- })]
270
- }) })
257
+ ...props,
258
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
259
+ className: "flex flex-col gap-2 flex-1",
260
+ children: [
261
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
262
+ className: "flex items-center gap-2",
263
+ children: [!plain && (icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
264
+ "data-testid": "alert-custom-icon",
265
+ "aria-hidden": "true",
266
+ children: icon
267
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
268
+ size: 20,
269
+ className: cn(iconColor, "shrink-0"),
270
+ "data-testid": "alert-icon",
271
+ "aria-hidden": "true"
272
+ })), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
273
+ className: "text-base font-medium",
274
+ children: title
275
+ })]
276
+ }),
277
+ description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
278
+ id: descriptionId,
279
+ className: "text-sm text-color-gray-900",
280
+ children: description
281
+ }),
282
+ button && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: button })
283
+ ]
284
+ }), closable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
285
+ type: "button",
286
+ className: "ml-4 text-gray-500 hover:text-gray-700",
287
+ onClick: onClose,
288
+ "aria-label": "Dismiss alert",
289
+ "data-testid": "alert-close",
290
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tabler_icons_react.IconX, {
291
+ size: 18,
292
+ "aria-hidden": "true"
293
+ })
294
+ })]
271
295
  });
272
296
  };
273
297
  Alert.displayName = "Alert";
@@ -634,48 +658,32 @@ const AvatarIndicator = ({ indicatorCount, className }) => /* @__PURE__ */ (0, r
634
658
 
635
659
  //#endregion
636
660
  //#region src/components/badge/index.tsx
637
- const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, mobile = false, badgeBorder = false, fullWidth = false, leftSection, rightSection, children,...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
638
- "data-testid": "badge",
639
- "data-component": "Badge",
640
- className: (0, clsx.default)("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 && {
641
- "border-accent-blue": styleVariant === COLOR.ACCENT_BLUE,
642
- "border-green-light": styleVariant === COLOR.GREEN_LIGHT,
643
- "border-red-500": styleVariant === COLOR.RED,
644
- "border-purple": styleVariant === COLOR.PURPLE,
645
- "border-warning": styleVariant === COLOR.WARNING,
646
- "border-black": styleVariant === COLOR.BLACK,
647
- "border-gray-800": styleVariant === COLOR.GRAY,
648
- "border-pink": styleVariant === COLOR.PINK_LIGHT || styleVariant === COLOR.PINK,
649
- "border-gray-200 bg-white text-black": styleVariant === COLOR.WHITE
650
- }, {
651
- "bg-accent-blue-light text-accent-blue": styleVariant === COLOR.ACCENT_BLUE,
652
- "bg-green-light text-green": styleVariant === COLOR.GREEN_LIGHT,
653
- "bg-red-50 text-red-500": styleVariant === COLOR.RED,
654
- "bg-purple-light text-purple": styleVariant === COLOR.PURPLE,
655
- "bg-warning-light text-warning": styleVariant === COLOR.WARNING,
656
- "bg-gray-50 text-black": styleVariant === COLOR.BLACK,
657
- "bg-gray-50 text-gray-800": styleVariant === COLOR.GRAY,
658
- "bg-pink-light text-pink": styleVariant === COLOR.PINK_LIGHT,
659
- "bg-pink text-white": styleVariant === COLOR.PINK,
660
- "bg-white text-black": styleVariant === COLOR.WHITE
661
- }, className),
662
- ...props,
663
- children: [
664
- leftSection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
665
- "data-testid": "left-section",
666
- children: leftSection
667
- }),
668
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
661
+ const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, children,...props }) => {
662
+ if (!children) return null;
663
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
664
+ "data-testid": "badge",
665
+ "data-component": "Badge",
666
+ className: (0, clsx.default)("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", {
667
+ "bg-accent-blue-light text-accent-blue": styleVariant === COLOR.ACCENT_BLUE,
668
+ "bg-green-light text-green": styleVariant === COLOR.GREEN_LIGHT,
669
+ "bg-red-50 text-red-500": styleVariant === COLOR.RED,
670
+ "bg-purple-light text-purple": styleVariant === COLOR.PURPLE,
671
+ "bg-warning-light text-warning": styleVariant === COLOR.WARNING,
672
+ "bg-gray-50 text-black": styleVariant === COLOR.DARK_GRAY,
673
+ "bg-black text-white": styleVariant === COLOR.BLACK,
674
+ "bg-gray-50 text-gray-800": styleVariant === COLOR.GRAY,
675
+ "bg-pink-light text-pink": styleVariant === COLOR.PINK_LIGHT,
676
+ "bg-pink text-white": styleVariant === COLOR.PINK,
677
+ "bg-white text-black": styleVariant === COLOR.WHITE
678
+ }, className),
679
+ ...props,
680
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
669
681
  "data-testid": "badge-content",
670
682
  className: cn("block h-5 overflow-hidden text-ellipsis whitespace-nowrap", { "flex items-center": favorite }),
671
683
  children
672
- }),
673
- rightSection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
674
- "data-testid": "right-section",
675
- children: rightSection
676
684
  })
677
- ]
678
- });
685
+ });
686
+ };
679
687
  Badge.displayName = "Badge";
680
688
 
681
689
  //#endregion