@namuna-nur/ui-kit 1.3.4 → 1.4.1
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/lib/index.js +112 -108
- package/lib/molecules/index.js +87 -83
- package/lib/shared/Avatar.tokens.js +2119 -2117
- package/lib/shared/{TabList.tokens.js → FloorItem.tokens.js} +14931 -3711
- package/lib/shared/TabDots.tokens.js +26 -26
- package/lib/src/{atoms/Notification → _shared}/Notification.utils.d.ts +3 -1
- package/lib/src/_shared/index.d.ts +1 -0
- package/lib/src/atoms/Notification/index.d.ts +0 -1
- package/lib/src/hooks/use-toast.types.d.ts +1 -1
- package/lib/src/molecules/ChatSidebar/ChatSidebar.data.d.ts +1 -1
- package/lib/src/molecules/ChatSidebar/ChatSidebar.stories.d.ts +1 -1
- package/lib/src/molecules/ChatSidebar/ChatSidebar.types.d.ts +1 -1
- package/lib/src/molecules/DatePicker/DatePicker.tokens.d.ts +1 -1
- package/lib/src/molecules/DatePicker/DatePicker.utils.d.ts +15 -0
- package/lib/src/molecules/FloorItem/FloorItem.d.ts +2 -0
- package/lib/src/molecules/FloorItem/FloorItem.stories.d.ts +5 -0
- package/lib/src/molecules/FloorItem/FloorItem.tests.d.ts +1 -0
- package/lib/src/molecules/FloorItem/FloorItem.tokens.d.ts +4 -0
- package/lib/src/molecules/FloorItem/FloorItem.types.d.ts +13 -0
- package/lib/src/molecules/FloorItem/index.d.ts +3 -0
- package/lib/src/molecules/FloorSelect/FloorSelect.d.ts +2 -0
- package/lib/src/molecules/FloorSelect/FloorSelect.stories.d.ts +5 -0
- package/lib/src/molecules/FloorSelect/FloorSelect.tests.d.ts +1 -0
- package/lib/src/molecules/FloorSelect/FloorSelect.tokens.d.ts +7 -0
- package/lib/src/molecules/FloorSelect/FloorSelect.types.d.ts +24 -0
- package/lib/src/molecules/FloorSelect/index.d.ts +3 -0
- package/lib/src/molecules/SelectGroup/SelectGroup.types.d.ts +1 -1
- package/lib/src/molecules/index.d.ts +2 -0
- package/lib/style.css +1 -1
- package/package.json +1 -1
- /package/lib/src/{_shared/types.d.ts → types/index.d.ts} +0 -0
|
@@ -92,8 +92,8 @@ var Rt = G, Nt = "ToastProvider", [je, jt, At] = et("Toast"), [Ae, jr] = Ce("Toa
|
|
|
92
92
|
(C = i.current) == null || C.focus();
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
const _ = f({ tabbingDirection: O ? "backwards" : "forwards" }),
|
|
96
|
-
te(_.slice(
|
|
95
|
+
const _ = f({ tabbingDirection: O ? "backwards" : "forwards" }), H = _.findIndex((v) => v === F);
|
|
96
|
+
te(_.slice(H + 1)) ? h.preventDefault() : O ? (N = i.current) == null || N.focus() : (A = p.current) == null || A.focus();
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
return d.addEventListener("keydown", b), () => d.removeEventListener("keydown", b);
|
|
@@ -238,16 +238,16 @@ var [Lt, It] = Ae(Y, {
|
|
|
238
238
|
}, [f.viewport, C, u, i, _]), n.useEffect(() => {
|
|
239
239
|
c && !f.isClosePausedRef.current && _(C);
|
|
240
240
|
}, [c, C, f.isClosePausedRef, _]), n.useEffect(() => (O(), () => Z()), [O, Z]);
|
|
241
|
-
const
|
|
241
|
+
const H = n.useMemo(() => d ? $e(d) : null, [d]);
|
|
242
242
|
return f.viewport ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
243
|
-
|
|
243
|
+
H && /* @__PURE__ */ s.jsx(
|
|
244
244
|
Mt,
|
|
245
245
|
{
|
|
246
246
|
__scopeToast: t,
|
|
247
247
|
role: "status",
|
|
248
248
|
"aria-live": o === "foreground" ? "assertive" : "polite",
|
|
249
249
|
"aria-atomic": !0,
|
|
250
|
-
children:
|
|
250
|
+
children: H
|
|
251
251
|
}
|
|
252
252
|
),
|
|
253
253
|
/* @__PURE__ */ s.jsx(Lt, { scope: t, onClose: L, children: ht.createPortal(
|
|
@@ -313,7 +313,7 @@ var [Lt, It] = Ae(Y, {
|
|
|
313
313
|
}
|
|
314
314
|
), Mt = (e) => {
|
|
315
315
|
const { __scopeToast: r, children: t, ...o } = e, a = X(Y, r), [c, l] = n.useState(!1), [m, u] = n.useState(!1);
|
|
316
|
-
return
|
|
316
|
+
return Ht(() => l(!0)), n.useEffect(() => {
|
|
317
317
|
const i = window.setTimeout(() => u(!0), 1e3);
|
|
318
318
|
return () => window.clearTimeout(i);
|
|
319
319
|
}, []), m ? null : /* @__PURE__ */ s.jsx(Re, { asChild: !0, children: /* @__PURE__ */ s.jsx(G, { ...o, children: c && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
@@ -328,13 +328,13 @@ var [Lt, It] = Ae(Y, {
|
|
|
328
328
|
}
|
|
329
329
|
);
|
|
330
330
|
Oe.displayName = Vt;
|
|
331
|
-
var
|
|
331
|
+
var $t = "ToastDescription", Le = n.forwardRef(
|
|
332
332
|
(e, r) => {
|
|
333
333
|
const { __scopeToast: t, ...o } = e;
|
|
334
334
|
return /* @__PURE__ */ s.jsx(S.div, { ...o, ref: r });
|
|
335
335
|
}
|
|
336
336
|
);
|
|
337
|
-
Le.displayName =
|
|
337
|
+
Le.displayName = $t;
|
|
338
338
|
var Ie = "ToastAction", Fe = n.forwardRef(
|
|
339
339
|
(e, r) => {
|
|
340
340
|
const { altText: t, ...o } = e;
|
|
@@ -371,7 +371,7 @@ var Ve = n.forwardRef((e, r) => {
|
|
|
371
371
|
}
|
|
372
372
|
);
|
|
373
373
|
});
|
|
374
|
-
function
|
|
374
|
+
function $e(e) {
|
|
375
375
|
const r = [];
|
|
376
376
|
return Array.from(e.childNodes).forEach((o) => {
|
|
377
377
|
if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent), Kt(o)) {
|
|
@@ -381,7 +381,7 @@ function He(e) {
|
|
|
381
381
|
const l = o.dataset.radixToastAnnounceAlt;
|
|
382
382
|
l && r.push(l);
|
|
383
383
|
} else
|
|
384
|
-
r.push(
|
|
384
|
+
r.push(...$e(o));
|
|
385
385
|
}
|
|
386
386
|
}), r;
|
|
387
387
|
}
|
|
@@ -393,7 +393,7 @@ var ge = (e, r, t = 0) => {
|
|
|
393
393
|
const o = Math.abs(e.x), a = Math.abs(e.y), c = o > a;
|
|
394
394
|
return r === "left" || r === "right" ? c && o > t : !c && a > t;
|
|
395
395
|
};
|
|
396
|
-
function
|
|
396
|
+
function Ht(e = () => {
|
|
397
397
|
}) {
|
|
398
398
|
const r = q(e);
|
|
399
399
|
nt(() => {
|
|
@@ -420,7 +420,7 @@ function te(e) {
|
|
|
420
420
|
const r = document.activeElement;
|
|
421
421
|
return e.some((t) => t === r ? !0 : (t.focus(), document.activeElement !== r));
|
|
422
422
|
}
|
|
423
|
-
var
|
|
423
|
+
var He = Se, Ke = De, We = Oe, ze = Le, qe = Fe, Ue = le;
|
|
424
424
|
const ye = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, be = wt, zt = (e, r) => (t) => {
|
|
425
425
|
var o;
|
|
426
426
|
if ((r == null ? void 0 : r.variants) == null) return be(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
|
|
@@ -451,19 +451,19 @@ const ye = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, be = wt, z
|
|
|
451
451
|
}, []);
|
|
452
452
|
return be(e, l, u, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
|
|
453
453
|
}, qt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
454
|
-
|
|
454
|
+
He,
|
|
455
455
|
{
|
|
456
456
|
ref: t,
|
|
457
457
|
className: P(
|
|
458
|
-
"fixed top-0 z-[100] flex
|
|
458
|
+
"fixed top-0 z-[100] flex flex-col-reverse sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col m-5 max-h-screen min-w-[250px]",
|
|
459
459
|
e
|
|
460
460
|
),
|
|
461
461
|
...r
|
|
462
462
|
}
|
|
463
463
|
));
|
|
464
|
-
qt.displayName =
|
|
464
|
+
qt.displayName = He.displayName;
|
|
465
465
|
const Ut = zt(
|
|
466
|
-
"group pointer-events-auto rounded-[10px] relative border-l-2 flex w-full items-center justify-between space-x-2 overflow-hidden
|
|
466
|
+
"group pointer-events-auto rounded-[10px] relative border-l-2 flex w-full items-center justify-between space-x-2 overflow-hidden py-3 px-[15px] transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full dark:border-neutral-800",
|
|
467
467
|
{
|
|
468
468
|
variants: {
|
|
469
469
|
variant: {
|
|
@@ -499,17 +499,17 @@ const Xt = n.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
|
|
|
499
499
|
}
|
|
500
500
|
));
|
|
501
501
|
Xt.displayName = qe.displayName;
|
|
502
|
-
const Yt = n.forwardRef(({ className: e,
|
|
502
|
+
const Yt = n.forwardRef(({ className: e, variant: r, ...t }, o) => /* @__PURE__ */ s.jsx(
|
|
503
503
|
Ue,
|
|
504
504
|
{
|
|
505
|
-
ref:
|
|
505
|
+
ref: o,
|
|
506
506
|
className: P(
|
|
507
507
|
"absolute right-3 top-2 rounded-md p-1 text-neutral-950/50 opacity-0 transition-opacity hover:text-neutral-950 focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 dark:text-neutral-50/50 dark:hover:text-neutral-50",
|
|
508
508
|
e
|
|
509
509
|
),
|
|
510
510
|
"toast-close": "",
|
|
511
|
-
...
|
|
512
|
-
children: /* @__PURE__ */ s.jsx(st, { className:
|
|
511
|
+
...t,
|
|
512
|
+
children: /* @__PURE__ */ s.jsx(st, { className: P(`size-4 text-${r}-10`) })
|
|
513
513
|
}
|
|
514
514
|
));
|
|
515
515
|
Yt.displayName = Ue.displayName;
|
|
@@ -638,7 +638,7 @@ var [B, Qt] = Ce("Tooltip", [
|
|
|
638
638
|
);
|
|
639
639
|
};
|
|
640
640
|
ue.displayName = Ye;
|
|
641
|
-
var Q = "Tooltip", [tr,
|
|
641
|
+
var Q = "Tooltip", [tr, $] = B(Q), pe = (e) => {
|
|
642
642
|
const {
|
|
643
643
|
__scopeTooltip: r,
|
|
644
644
|
children: t,
|
|
@@ -689,7 +689,7 @@ var Q = "Tooltip", [tr, H] = B(Q), pe = (e) => {
|
|
|
689
689
|
pe.displayName = Q;
|
|
690
690
|
var ie = "TooltipTrigger", fe = n.forwardRef(
|
|
691
691
|
(e, r) => {
|
|
692
|
-
const { __scopeTooltip: t, ...o } = e, a =
|
|
692
|
+
const { __scopeTooltip: t, ...o } = e, a = $(ie, t), c = de(ie, t), l = J(t), m = n.useRef(null), u = U(r, m, a.onTriggerChange), i = n.useRef(!1), p = n.useRef(!1), x = n.useCallback(() => i.current = !1, []);
|
|
693
693
|
return n.useEffect(() => () => document.removeEventListener("pointerup", x), [x]), /* @__PURE__ */ s.jsx(dt, { asChild: !0, ...l, children: /* @__PURE__ */ s.jsx(
|
|
694
694
|
S.button,
|
|
695
695
|
{
|
|
@@ -719,17 +719,17 @@ fe.displayName = ie;
|
|
|
719
719
|
var ve = "TooltipPortal", [rr, or] = B(ve, {
|
|
720
720
|
forceMount: void 0
|
|
721
721
|
}), me = (e) => {
|
|
722
|
-
const { __scopeTooltip: r, forceMount: t, children: o, container: a } = e, c =
|
|
722
|
+
const { __scopeTooltip: r, forceMount: t, children: o, container: a } = e, c = $(ve, r);
|
|
723
723
|
return /* @__PURE__ */ s.jsx(rr, { scope: r, forceMount: t, children: /* @__PURE__ */ s.jsx(ce, { present: t || c.open, children: /* @__PURE__ */ s.jsx(Re, { asChild: !0, container: a, children: o }) }) });
|
|
724
724
|
};
|
|
725
725
|
me.displayName = ve;
|
|
726
726
|
var I = "TooltipContent", xe = n.forwardRef(
|
|
727
727
|
(e, r) => {
|
|
728
|
-
const t = or(I, e.__scopeTooltip), { forceMount: o = t.forceMount, side: a = "top", ...c } = e, l =
|
|
728
|
+
const t = or(I, e.__scopeTooltip), { forceMount: o = t.forceMount, side: a = "top", ...c } = e, l = $(I, e.__scopeTooltip);
|
|
729
729
|
return /* @__PURE__ */ s.jsx(ce, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ s.jsx(Be, { side: a, ...c, ref: r }) : /* @__PURE__ */ s.jsx(nr, { side: a, ...c, ref: r }) });
|
|
730
730
|
}
|
|
731
731
|
), nr = n.forwardRef((e, r) => {
|
|
732
|
-
const t =
|
|
732
|
+
const t = $(I, e.__scopeTooltip), o = de(I, e.__scopeTooltip), a = n.useRef(null), c = U(r, a), [l, m] = n.useState(null), { trigger: u, onClose: i } = t, p = a.current, { onPointerInTransitChange: x } = o, g = n.useCallback(() => {
|
|
733
733
|
m(null), x(!1);
|
|
734
734
|
}, [x]), w = n.useCallback(
|
|
735
735
|
(y, f) => {
|
|
@@ -763,7 +763,7 @@ var I = "TooltipContent", xe = n.forwardRef(
|
|
|
763
763
|
onEscapeKeyDown: c,
|
|
764
764
|
onPointerDownOutside: l,
|
|
765
765
|
...m
|
|
766
|
-
} = e, u =
|
|
766
|
+
} = e, u = $(I, t), i = J(t), { onClose: p } = u;
|
|
767
767
|
return n.useEffect(() => (document.addEventListener(ae, p), () => document.removeEventListener(ae, p)), [p]), n.useEffect(() => {
|
|
768
768
|
if (u.trigger) {
|
|
769
769
|
const x = (g) => {
|
|
@@ -9,7 +9,9 @@ declare const Toast: React.ForwardRefExoticComponent<Omit<Omit<ToastPrimitives.T
|
|
|
9
9
|
withIcon?: boolean;
|
|
10
10
|
} & React.RefAttributes<HTMLLIElement>>;
|
|
11
11
|
declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
-
declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> &
|
|
12
|
+
declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
13
|
+
variant?: "success" | "danger" | "info" | "default" | "warning" | null | undefined;
|
|
14
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
13
15
|
declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
16
|
declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
17
|
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToastActionElement, ToastProps } from '../
|
|
1
|
+
import { ToastActionElement, ToastProps } from '../_shared';
|
|
2
2
|
export declare const TOAST_LIMIT = 1;
|
|
3
3
|
export declare const TOAST_REMOVE_DELAY = 1000000;
|
|
4
4
|
export type ToastNotification = ToastProps & {
|
|
@@ -5,7 +5,7 @@ export declare const Default: {
|
|
|
5
5
|
render: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ChatSidebarProps>;
|
|
6
6
|
args: {
|
|
7
7
|
tabs: import('..').SidebarTabItem[];
|
|
8
|
-
popoverOptions: import('../../
|
|
8
|
+
popoverOptions: import('../../types').OptionsProps[];
|
|
9
9
|
actions: ({
|
|
10
10
|
id: string;
|
|
11
11
|
icon: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const formatDate: (date: Date) => string;
|
|
2
|
+
declare const getDaysInMonth: (date: Date) => {
|
|
3
|
+
date: Date;
|
|
4
|
+
isCurrentMonth: boolean;
|
|
5
|
+
}[];
|
|
6
|
+
declare const isToday: (date: Date) => boolean;
|
|
7
|
+
declare const isWeekend: (date: Date) => boolean;
|
|
8
|
+
declare const isSelected: (date: Date, value: Date | undefined) => boolean | undefined;
|
|
9
|
+
declare const yearOptions: {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}[];
|
|
13
|
+
declare const weekDays: string[];
|
|
14
|
+
declare const monthNames: string[];
|
|
15
|
+
export { formatDate, getDaysInMonth, isToday, isWeekend, isSelected, yearOptions, weekDays, monthNames, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { FloorItem, LangValue } from '..';
|
|
3
|
+
export type FloorItemStory = StoryObj<typeof FloorItem>;
|
|
4
|
+
export type FloorItemProps = {
|
|
5
|
+
floorId: string;
|
|
6
|
+
floorName: LangValue;
|
|
7
|
+
selectedFloorId: string;
|
|
8
|
+
onSelect: (e: React.MouseEvent, floorId: string) => void;
|
|
9
|
+
onEdit: () => React.ReactNode;
|
|
10
|
+
onDelete: () => React.ReactNode;
|
|
11
|
+
setOpenEditModal: (value: boolean) => void;
|
|
12
|
+
setOpenStatusModal: (value: boolean) => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { FloorSelect } from '..';
|
|
3
|
+
export type FloorSelectStory = StoryObj<typeof FloorSelect>;
|
|
4
|
+
export type LangValue = {
|
|
5
|
+
uz: string;
|
|
6
|
+
ru: string;
|
|
7
|
+
en: string;
|
|
8
|
+
};
|
|
9
|
+
export type FloorOptions = {
|
|
10
|
+
id: string;
|
|
11
|
+
section_id?: string;
|
|
12
|
+
name: LangValue;
|
|
13
|
+
created_at?: Date;
|
|
14
|
+
updated_at?: Date;
|
|
15
|
+
};
|
|
16
|
+
export type FloorSelectProps = {
|
|
17
|
+
options: FloorOptions[] | undefined;
|
|
18
|
+
onChange: (value: string) => void;
|
|
19
|
+
value: string;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
onFloorDelete: (floorId: string) => void;
|
|
22
|
+
floorModal: (isOpen: boolean, onClose: () => void, mode: string, id?: string, name?: LangValue) => React.ReactNode;
|
|
23
|
+
statusModal: (isOpen: boolean, onClose: () => void, onSubmit: () => void) => React.ReactNode;
|
|
24
|
+
};
|