@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.
- package/dist/assets/fonts/woff/Gotham-BlackItalic_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-Black_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-BoldItalic_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-Bold_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-BookItalic_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-Book_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-LightItalic_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-Light_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-MediumItalic_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-Medium_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-ThinItalic_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-Thin_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-UltraItalic_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-Ultra_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-XLightItalic_Web.woff +0 -0
- package/dist/assets/fonts/woff/Gotham-XLight_Web.woff +0 -0
- package/dist/assets/fonts/woff2/Gotham-BlackItalic_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-Black_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-BoldItalic_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-Bold_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-BookItalic_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-Book_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-LightItalic_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-Light_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-MediumItalic_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-Medium_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-ThinItalic_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-Thin_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-UltraItalic_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-Ultra_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-XLightItalic_Web.woff2 +0 -0
- package/dist/assets/fonts/woff2/Gotham-XLight_Web.woff2 +0 -0
- package/dist/components/alert/index.d.ts +10 -9
- package/dist/components/badge/index.d.ts +2 -17
- package/dist/components/linkText/LinkText.stories.d.ts +6 -0
- package/dist/components/linkText/index.d.ts +11 -0
- package/dist/components/phoneInput/index.d.ts +0 -0
- package/dist/index.cjs +87 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +88 -80
- package/dist/index.js.map +1 -1
- package/dist/styles/tailwind.css +44 -0
- package/dist/tailwind.plugin.js +33 -0
- package/dist/tailwind.preset.js +46 -0
- package/dist/theme/fonts.d.ts +29 -0
- package/dist/utils/enums.d.ts +1 -0
- 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,
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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,
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
"
|
|
620
|
-
"
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
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
|