brd-ui-kit 0.1.79 → 0.1.81
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/brd-ui-kit.css +1 -1
- package/dist/calendar-PqChui7l.cjs.map +1 -1
- package/dist/calendar-XWqEaWHP.js.map +1 -1
- package/dist/components/basic-modal/basic-modal.d.ts +4 -2
- package/dist/components/input-field/input-field.d.ts +2 -0
- package/dist/components/transfer-list/index.d.ts +1 -0
- package/dist/components/transfer-list/transfer-list-card.d.ts +22 -0
- package/dist/components/transfer-list/transfer-list.d.ts +12 -0
- package/dist/components/transfer-list.d.ts +2 -0
- package/dist/components/ui/calendar/calendar.d.ts +1 -0
- package/dist/components/ui/calendar/index.d.ts +1 -1
- package/dist/components/ui/dialog/dialog.d.ts +4 -2
- package/dist/components/ui/dialog/dialog.styles.d.ts +6 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +3 -3
- package/dist/components-basic-avatar-basic-avatar.cjs +2 -2
- package/dist/components-basic-avatar-basic-avatar.cjs.map +1 -1
- package/dist/components-basic-avatar-basic-avatar.js +35 -32
- package/dist/components-basic-avatar-basic-avatar.js.map +1 -1
- package/dist/components-basic-modal-basic-modal.cjs +1 -1
- package/dist/components-basic-modal-basic-modal.cjs.map +1 -1
- package/dist/components-basic-modal-basic-modal.js +30 -24
- package/dist/components-basic-modal-basic-modal.js.map +1 -1
- package/dist/components-input-contact-input-contact.cjs +3 -3
- package/dist/components-input-contact-input-contact.cjs.map +1 -1
- package/dist/components-input-contact-input-contact.js +8 -8
- package/dist/components-input-contact-input-contact.js.map +1 -1
- package/dist/components-input-field-input-field.cjs +1 -1
- package/dist/components-input-field-input-field.cjs.map +1 -1
- package/dist/components-input-field-input-field.js +44 -36
- package/dist/components-input-field-input-field.js.map +1 -1
- package/dist/components-transfer-list-transfer-list-card.cjs +5 -0
- package/dist/components-transfer-list-transfer-list-card.cjs.map +1 -0
- package/dist/components-transfer-list-transfer-list-card.js +194 -0
- package/dist/components-transfer-list-transfer-list-card.js.map +1 -0
- package/dist/components-transfer-list-transfer-list.cjs +2 -0
- package/dist/components-transfer-list-transfer-list.cjs.map +1 -0
- package/dist/components-transfer-list-transfer-list.js +123 -0
- package/dist/components-transfer-list-transfer-list.js.map +1 -0
- package/dist/components-transfer-list.cjs +2 -0
- package/dist/components-transfer-list.cjs.map +1 -0
- package/dist/components-transfer-list.js +5 -0
- package/dist/components-transfer-list.js.map +1 -0
- package/dist/components-ui-avatar-avatar.cjs.map +1 -1
- package/dist/components-ui-avatar-avatar.js.map +1 -1
- package/dist/components-ui-dialog-dialog.cjs +1 -1
- package/dist/components-ui-dialog-dialog.cjs.map +1 -1
- package/dist/components-ui-dialog-dialog.js +49 -42
- package/dist/components-ui-dialog-dialog.js.map +1 -1
- package/dist/components-ui-dialog-dialog.styles.cjs +1 -1
- package/dist/components-ui-dialog-dialog.styles.cjs.map +1 -1
- package/dist/components-ui-dialog-dialog.styles.js +34 -17
- package/dist/components-ui-dialog-dialog.styles.js.map +1 -1
- package/dist/components-ui-dropdown-menu-dropdown-menu.cjs.map +1 -1
- package/dist/components-ui-dropdown-menu-dropdown-menu.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/package.json +10 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { dialogContentPositionVariants } from '../ui/dialog/dialog.styles';
|
|
1
3
|
type Props = {
|
|
2
4
|
open: boolean;
|
|
3
5
|
onOpenChange: (value: boolean) => void;
|
|
@@ -16,6 +18,6 @@ type Props = {
|
|
|
16
18
|
footer?: React.ReactNode;
|
|
17
19
|
showCloseButton?: boolean;
|
|
18
20
|
ariaDescribedby?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare const BasicModal: ({ open, onOpenChange, title, cancelLabel, confirmLabel, onConfirm, children, classes, footer, showCloseButton, ariaDescribedby, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
} & VariantProps<typeof dialogContentPositionVariants>;
|
|
22
|
+
export declare const BasicModal: ({ open, onOpenChange, title, cancelLabel, confirmLabel, onConfirm, children, classes, footer, showCloseButton, ariaDescribedby, positionX, positionY, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TransferList, type TransferListItem } from './transfer-list';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TransferListItem } from './transfer-list';
|
|
2
|
+
import { IconTypes } from '../../types/types';
|
|
3
|
+
type Props = {
|
|
4
|
+
items: TransferListItem[];
|
|
5
|
+
selectedSet: Set<string>;
|
|
6
|
+
onSelectItem: (id: string) => void;
|
|
7
|
+
onMoveItem: (itemId: string) => void;
|
|
8
|
+
direction: "left" | "right";
|
|
9
|
+
headerIcon?: {
|
|
10
|
+
type: IconTypes;
|
|
11
|
+
className: string;
|
|
12
|
+
};
|
|
13
|
+
headerButton?: {
|
|
14
|
+
icon: IconTypes;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
};
|
|
18
|
+
showHeaderTooltip?: boolean;
|
|
19
|
+
showFooterIcons?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const TransferListCard: ({ items, selectedSet, onSelectItem, onMoveItem, direction, headerIcon, headerButton, showHeaderTooltip, showFooterIcons, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type TransferListItem = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
inTarget: boolean;
|
|
6
|
+
};
|
|
7
|
+
type Props = {
|
|
8
|
+
list: TransferListItem[];
|
|
9
|
+
onChange: (item: TransferListItem[]) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const TransferList: ({ list, onChange }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { DayPicker, DayButton } from 'react-day-picker';
|
|
3
3
|
import { Button } from '../button';
|
|
4
|
+
export { type DateRange } from 'react-day-picker';
|
|
4
5
|
type CalendarSize = "sm" | "md" | "lg";
|
|
5
6
|
type CalendarPreset = {
|
|
6
7
|
text: string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
1
2
|
import { ComponentPropsWithRef, HTMLAttributes, FC, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
import { dialogContentPositionVariants } from './dialog.styles';
|
|
2
4
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
5
|
type DialogOverlayProps = ComponentPropsWithRef<typeof DialogPrimitive.Overlay>;
|
|
4
6
|
type DialogContentProps = ComponentPropsWithRef<typeof DialogPrimitive.Content> & {
|
|
5
7
|
showCloseButton?: boolean;
|
|
6
|
-
}
|
|
8
|
+
} & VariantProps<typeof dialogContentPositionVariants>;
|
|
7
9
|
type DialogTitleProps = ComponentPropsWithRef<typeof DialogPrimitive.Title>;
|
|
8
10
|
type DialogDescriptionProps = ComponentPropsWithRef<typeof DialogPrimitive.Description>;
|
|
9
11
|
declare const Dialog: FC<DialogPrimitive.DialogProps>;
|
|
@@ -15,7 +17,7 @@ declare const DialogOverlay: {
|
|
|
15
17
|
displayName: string | undefined;
|
|
16
18
|
};
|
|
17
19
|
declare const DialogContent: {
|
|
18
|
-
({ className, children, showCloseButton, ...props }: DialogContentProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
({ className, children, showCloseButton, positionX, positionY, ...props }: DialogContentProps): import("react/jsx-runtime").JSX.Element;
|
|
19
21
|
displayName: string | undefined;
|
|
20
22
|
};
|
|
21
23
|
declare const DialogHeader: {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
1
2
|
export declare const dialogOverlayClassNames: readonly ["data-open:animate-in data-closed:animate-out data-closed:fade-out-0", "data-open:fade-in-0 duration-100", "bg-primary-inverse-bg/20 fixed inset-0 isolate z-30"];
|
|
2
|
-
export declare const dialogContentClassNames: readonly ["fixed
|
|
3
|
+
export declare const dialogContentClassNames: readonly ["fixed z-50 grid gap-8 bg-primary-bg p-6 shadow-[0px_10px_40px_0px_rgba(0,0,0,0.15)] duration-200", "rounded-[8px]", "[&>[data-base-ui-portal]]:absolute [&>[data-base-ui-portal]]:h-0 [&>[data-base-ui-portal]]:w-0 [&>[data-base-ui-portal]]:overflow-visible", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0", "data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"];
|
|
4
|
+
export declare const dialogContentPositionVariants: (props?: ({
|
|
5
|
+
positionX?: "left" | "right" | "center" | null | undefined;
|
|
6
|
+
positionY?: "bottom" | "top" | "center" | null | undefined;
|
|
7
|
+
} & ClassProp) | undefined) => string;
|
|
3
8
|
export declare const dialogCloseClassNames: readonly ["absolute cursor-pointer right-6 top-7 inline-flex size-5 items-center justify-center rounded-sm text-secondary-text", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inp-focus-border", "disabled:pointer-events-none"];
|
|
4
9
|
export declare const dialogHeaderClassNames: readonly ["flex flex-col gap-1.5 pr-10 text-left"];
|
|
5
10
|
export declare const dialogFooterClassNames: readonly ["flex flex-col-reverse sm:flex-row sm:justify-end gap-4 [&>*]:flex-1"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ComponentRef, ReactNode, Ref } from 'react';
|
|
2
1
|
import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
|
|
2
|
+
import { ComponentPropsWithoutRef, ComponentRef, ReactNode, Ref } from 'react';
|
|
3
3
|
import { IconType } from '../icon';
|
|
4
4
|
type DropdownMenuRef = ComponentRef<typeof DropdownMenuPrimitive.Root>;
|
|
5
5
|
type DropdownMenuProps = ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> & {
|
|
@@ -98,5 +98,5 @@ type ConfigurableDropdownMenuProps = {
|
|
|
98
98
|
contentProps?: Omit<DropdownMenuContentProps, "children">;
|
|
99
99
|
};
|
|
100
100
|
declare function ConfigurableDropdownMenu({ trigger, items, onAction, contentProps, }: ConfigurableDropdownMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
101
|
-
export {
|
|
102
|
-
export type { ConfigurableDropdownMenuProps, DropdownMenuConfigItem, DropdownMenuConfigLabel, DropdownMenuConfigNode, DropdownMenuConfigSeparator, DropdownMenuContentProps,
|
|
101
|
+
export { CheckboxDropdownMenu, ConfigurableDropdownMenu, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPrimitive, DropdownMenuSeparator, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|
|
102
|
+
export type { CheckboxDropdownMenuProps, ConfigurableDropdownMenuProps, DropdownMenuCheckboxItemProps, DropdownMenuCheckboxOption, DropdownMenuConfigItem, DropdownMenuConfigLabel, DropdownMenuConfigNode, DropdownMenuConfigSeparator, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuLabelProps, DropdownMenuProps, DropdownMenuSeparatorProps, DropdownMenuSubContentProps, DropdownMenuSubTriggerProps, DropdownMenuTriggerProps, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./brd-ui-kit.css');const e=require("react/jsx-runtime");;/* empty css */const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./brd-ui-kit.css');const e=require("react/jsx-runtime");;/* empty css */const t=require("./lib-utils.cjs");require("class-variance-authority");require("./components-ui-badge-badge.styles.cjs");require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");require("./components-ui-card-card.cjs");require("./components-ui-checkbox-checkbox.cjs");require("phosphor-strokes-icons/icons/CaretDown");require("react");require("./calendar-PqChui7l.cjs");const p=require("./components-ui-icon-icon.cjs");require("phosphor-strokes-icons/icons");require("./components-ui-combobox-combobox.cjs");require("./components-ui-dialog-dialog.cjs");require("./components-ui-label-label.cjs");require("./components-ui-separator-separator.cjs");require("./components-ui-field-field.styles.cjs");require("./components-ui-input-input.styles.cjs");require("./components-ui-textarea-textarea.cjs");require("./components-ui-input-group-input-group.styles.cjs");require("./components-ui-navigation-item-navigation-item.styles.cjs");require("./components-ui-navigation-menu-navigation-menu.styles.cjs");require("./components-ui-pagination-pagination.cjs");require("./components-ui-progress-progress.cjs");require("./components-ui-radio-group-radio-group.cjs");require("./components-ui-switch-switch.cjs");require("./components-ui-toggle-toggle.styles.cjs");require("./components-ui-toggle-group-toggle-group.cjs");require("./components-ui-table-table.cjs");require("./components-ui-tabs-tabs.cjs");require("./components-ui-tooltip-tooltip.cjs");const m=require("./components-ui-typography-typography.cjs");require("./components-ui-typography-typography.styles.cjs");const q=require("./components-ui-avatar-avatar.cjs");require("phosphor-strokes-icons/icons/CaretLeft");require("phosphor-strokes-icons/icons/CaretRight");require("./components-app-pagination-app-pagination.styles.cjs");require("phosphor-strokes-icons/icons/CaretUpDown");require("./components-app-sidebar-app-sidebar.styles.cjs");require("./components-data-table-data-table.styles.cjs");require("./components-ui-dropdown-menu-dropdown-menu.styles.cjs");require("phosphor-strokes-icons/icons/Eye");require("phosphor-strokes-icons/icons/EyeSlash");require("./components-select-field-select-field.cjs");require("./lodash-kqhtUJfz.cjs");require("./chart-9H_9wEfR.cjs");require("phosphor-strokes-icons/icons/CheckCircle");require("phosphor-strokes-icons/icons/Info");require("phosphor-strokes-icons/icons/SpinnerGap");require("phosphor-strokes-icons/icons/Warning");require("phosphor-strokes-icons/icons/X");require("phosphor-strokes-icons/icons/XCircle");require("./index-DGxwh2Ms.cjs");require("./index-fTTv8YY8.cjs");require("phosphor-strokes-icons/icons/Plus");require("phosphor-strokes-icons/icons/CaretUp");require("phosphor-strokes-icons/icons/EnvelopeSimple");require("phosphor-strokes-icons/icons/MaxLogo");require("phosphor-strokes-icons/icons/Phone");require("phosphor-strokes-icons/icons/TelegramLogo");require("phosphor-strokes-icons/icons/WhatsAppLogoFilled");require("./components-input-phone-input-phone.cjs");require("./components-card-info-card-info.styles.cjs");const x=r=>{const[i,u]=r.trim().split(" ");return`${i[0].toUpperCase()}. ${u[0].toUpperCase()}.`},y=({initials:r,avatar:i,fallback:u,image:a,icon:n,showDeleteOnHover:c=!0,onClick:o=()=>{}})=>{const s=e.jsxs(q.Avatar,{...i,className:t.cn("h-18 w-18",i?.className),children:[e.jsx(q.AvatarImage,{...a,alt:"avatar",className:t.cn("h-full w-full border-0",a?.className)}),e.jsx(q.AvatarFallback,{...u,children:e.jsx(m.Typography,{variant:"body-xxl-medium",className:t.cn("text-info-new-text",r?.className),children:x(r?.text??"")})})]});return c?e.jsxs("div",{className:"relative inline-block",children:[s,e.jsx("div",{className:`text-primary-bg bg-primary-inverse-bg/50 absolute inset-0 flex
|
|
2
2
|
cursor-pointer items-center justify-center rounded-full opacity-0
|
|
3
|
-
transition-opacity hover:opacity-100`,onClick:l=>l.stopPropagation(),children:e.jsx(p.Icon,{...n,type:"x",onClick:o})})]}):
|
|
3
|
+
transition-opacity hover:opacity-100`,onClick:l=>l.stopPropagation(),children:e.jsx(p.Icon,{...n,type:"x",onClick:o})})]}):s};exports.BasicAvatar=y;
|
|
4
4
|
//# sourceMappingURL=components-basic-avatar-basic-avatar.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-basic-avatar-basic-avatar.cjs","sources":["../src/components/basic-avatar/basic-avatar.tsx"],"sourcesContent":["import { Icon, Typography, cn } from \"@/index\";\nimport type { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../ui/avatar\";\nimport type { IconProps } from \"../ui/icon\";\n\ntype AvatarProps = React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: \"default\" | \"sm\" | \"lg\";\n};\ntype AvatarFallbackProps = React.ComponentProps<typeof AvatarPrimitive.Fallback>;\ntype AvatarImageProps = React.ComponentProps<typeof AvatarPrimitive.Image>;\n\ntype Props = {\n initials?: {\n text?: string;\n className?: string;\n };\n hasBadge?: boolean;\n avatar?: AvatarProps;\n fallback?: AvatarFallbackProps;\n image?: AvatarImageProps;\n showDeleteOnHover?: boolean;\n icon?: IconProps;\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nexport const BasicAvatar = ({\n initials,\n avatar,\n fallback,\n image,\n icon,\n showDeleteOnHover = true,\n onClick = () => {},\n}: Props) => {\n const content = (\n <Avatar\n {...avatar}\n className={cn(\"h-18 w-18\", avatar?.className)}\n >\n <AvatarImage\n {...image}\n alt=\"avatar\"\n className={cn(\"h-full w-full border-0\", image?.className)}\n />\n <AvatarFallback {...fallback}>\n <Typography\n variant=\"body-xxl-medium\"\n className={cn(\"text-info-new-text\", initials?.className)}\n >\n {initials?.text}\n </Typography>\n </AvatarFallback>\n </Avatar>\n );\n\n if (!showDeleteOnHover) {\n return content;\n }\n\n return (\n <div className=\"relative inline-block\">\n {content}\n <div\n className=\"text-primary-bg bg-primary-inverse-bg/50 absolute inset-0 flex\n cursor-pointer items-center justify-center rounded-full opacity-0\n transition-opacity hover:opacity-100\"\n onClick={(e) => e.stopPropagation()}\n >\n <Icon\n {...icon}\n type=\"x\"\n onClick={onClick}\n />\n </div>\n </div>\n );\n};\n\nexport type {\n AvatarFallbackProps,\n AvatarImageProps,\n AvatarProps,\n Props as BasicAvatarProps,\n};\n"],"names":["BasicAvatar","initials","avatar","fallback","image","icon","showDeleteOnHover","onClick","content","jsxs","Avatar","cn","jsx","AvatarImage","AvatarFallback","Typography","e","Icon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components-basic-avatar-basic-avatar.cjs","sources":["../src/components/basic-avatar/basic-avatar.tsx"],"sourcesContent":["import { Icon, Typography, cn } from \"@/index\";\nimport type { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../ui/avatar\";\nimport type { IconProps } from \"../ui/icon\";\n\ntype AvatarProps = React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: \"default\" | \"sm\" | \"lg\";\n};\ntype AvatarFallbackProps = React.ComponentProps<typeof AvatarPrimitive.Fallback>;\ntype AvatarImageProps = React.ComponentProps<typeof AvatarPrimitive.Image>;\n\ntype Props = {\n initials?: {\n text?: string;\n className?: string;\n };\n hasBadge?: boolean;\n avatar?: AvatarProps;\n fallback?: AvatarFallbackProps;\n image?: AvatarImageProps;\n showDeleteOnHover?: boolean;\n icon?: IconProps;\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst getInitials = (fullName: string): string => {\n const [firstName, lastName] = fullName.trim().split(\" \");\n return `${firstName[0].toUpperCase()}. ${lastName[0].toUpperCase()}.`;\n};\n\nexport const BasicAvatar = ({\n initials,\n avatar,\n fallback,\n image,\n icon,\n showDeleteOnHover = true,\n onClick = () => {},\n}: Props) => {\n const content = (\n <Avatar\n {...avatar}\n className={cn(\"h-18 w-18\", avatar?.className)}\n >\n <AvatarImage\n {...image}\n alt=\"avatar\"\n className={cn(\"h-full w-full border-0\", image?.className)}\n />\n <AvatarFallback {...fallback}>\n <Typography\n variant=\"body-xxl-medium\"\n className={cn(\"text-info-new-text\", initials?.className)}\n >\n {getInitials(initials?.text ?? \"\")}\n </Typography>\n </AvatarFallback>\n </Avatar>\n );\n\n if (!showDeleteOnHover) {\n return content;\n }\n\n return (\n <div className=\"relative inline-block\">\n {content}\n <div\n className=\"text-primary-bg bg-primary-inverse-bg/50 absolute inset-0 flex\n cursor-pointer items-center justify-center rounded-full opacity-0\n transition-opacity hover:opacity-100\"\n onClick={(e) => e.stopPropagation()}\n >\n <Icon\n {...icon}\n type=\"x\"\n onClick={onClick}\n />\n </div>\n </div>\n );\n};\n\nexport type {\n AvatarFallbackProps,\n AvatarImageProps,\n AvatarProps,\n Props as BasicAvatarProps,\n};\n"],"names":["getInitials","fullName","firstName","lastName","BasicAvatar","initials","avatar","fallback","image","icon","showDeleteOnHover","onClick","content","jsxs","Avatar","cn","jsx","AvatarImage","AvatarFallback","Typography","e","Icon"],"mappings":"4pGAyBA,MAAMA,EAAeC,GAA6B,CAChD,KAAM,CAACC,EAAWC,CAAQ,EAAIF,EAAS,KAAA,EAAO,MAAM,GAAG,EACvD,MAAO,GAAGC,EAAU,CAAC,EAAE,YAAA,CAAa,KAAKC,EAAS,CAAC,EAAE,YAAA,CAAa,GACpE,EAEaC,EAAc,CAAC,CAC1B,SAAAC,EACA,OAAAC,EACA,SAAAC,EACA,MAAAC,EACA,KAAAC,EACA,kBAAAC,EAAoB,GACpB,QAAAC,EAAU,IAAM,CAAC,CACnB,IAAa,CACX,MAAMC,EACJC,EAAAA,KAACC,EAAAA,OAAA,CACE,GAAGR,EACJ,UAAWS,EAAAA,GAAG,YAAaT,GAAQ,SAAS,EAE5C,SAAA,CAAAU,EAAAA,IAACC,EAAAA,YAAA,CACE,GAAGT,EACJ,IAAI,SACJ,UAAWO,EAAAA,GAAG,yBAA0BP,GAAO,SAAS,CAAA,CAAA,EAE1DQ,EAAAA,IAACE,EAAAA,eAAA,CAAgB,GAAGX,EAClB,SAAAS,EAAAA,IAACG,EAAAA,WAAA,CACC,QAAQ,kBACR,UAAWJ,EAAAA,GAAG,qBAAsBV,GAAU,SAAS,EAEtD,SAAAL,EAAYK,GAAU,MAAQ,EAAE,CAAA,CAAA,CACnC,CACF,CAAA,CAAA,CAAA,EAIJ,OAAKK,EAKHG,EAAAA,KAAC,MAAA,CAAI,UAAU,wBACZ,SAAA,CAAAD,EACDI,EAAAA,IAAC,MAAA,CACC,UAAU;AAAA;AAAA,gDAGV,QAAUI,GAAMA,EAAE,gBAAA,EAElB,SAAAJ,EAAAA,IAACK,EAAAA,KAAA,CACE,GAAGZ,EACJ,KAAK,IACL,QAAAE,CAAA,CAAA,CACF,CAAA,CACF,EACF,EAlBOC,CAoBX"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import './brd-ui-kit.css';/* empty css */
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as m } from "./lib-utils.js";
|
|
4
4
|
import "class-variance-authority";
|
|
5
5
|
import "./components-ui-badge-badge.styles.js";
|
|
6
6
|
import "./components-ui-button-button.js";
|
|
@@ -10,7 +10,7 @@ import "./components-ui-checkbox-checkbox.js";
|
|
|
10
10
|
import "phosphor-strokes-icons/icons/CaretDown";
|
|
11
11
|
import "react";
|
|
12
12
|
import "./calendar-XWqEaWHP.js";
|
|
13
|
-
import { Icon as
|
|
13
|
+
import { Icon as f } from "./components-ui-icon-icon.js";
|
|
14
14
|
import "phosphor-strokes-icons/icons";
|
|
15
15
|
import "./components-ui-combobox-combobox.js";
|
|
16
16
|
import "./components-ui-dialog-dialog.js";
|
|
@@ -31,7 +31,7 @@ import "./components-ui-toggle-group-toggle-group.js";
|
|
|
31
31
|
import "./components-ui-table-table.js";
|
|
32
32
|
import "./components-ui-tabs-tabs.js";
|
|
33
33
|
import "./components-ui-tooltip-tooltip.js";
|
|
34
|
-
import { Typography as
|
|
34
|
+
import { Typography as d } from "./components-ui-typography-typography.js";
|
|
35
35
|
import "./components-ui-typography-typography.styles.js";
|
|
36
36
|
import { Avatar as u, AvatarImage as x, AvatarFallback as v } from "./components-ui-avatar-avatar.js";
|
|
37
37
|
import "phosphor-strokes-icons/icons/CaretLeft";
|
|
@@ -63,63 +63,66 @@ import "phosphor-strokes-icons/icons/TelegramLogo";
|
|
|
63
63
|
import "phosphor-strokes-icons/icons/WhatsAppLogoFilled";
|
|
64
64
|
import "./components-input-phone-input-phone.js";
|
|
65
65
|
import "./components-card-info-card-info.styles.js";
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
const y = (r) => {
|
|
67
|
+
const [o, i] = r.trim().split(" ");
|
|
68
|
+
return `${o[0].toUpperCase()}. ${i[0].toUpperCase()}.`;
|
|
69
|
+
}, $t = ({
|
|
70
|
+
initials: r,
|
|
71
|
+
avatar: o,
|
|
72
|
+
fallback: i,
|
|
73
|
+
image: p,
|
|
74
|
+
icon: s,
|
|
75
|
+
showDeleteOnHover: n = !0,
|
|
76
|
+
onClick: l = () => {
|
|
74
77
|
}
|
|
75
78
|
}) => {
|
|
76
|
-
const
|
|
79
|
+
const e = /* @__PURE__ */ a(
|
|
77
80
|
u,
|
|
78
81
|
{
|
|
79
|
-
...
|
|
80
|
-
className:
|
|
82
|
+
...o,
|
|
83
|
+
className: m("h-18 w-18", o?.className),
|
|
81
84
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ t(
|
|
83
86
|
x,
|
|
84
87
|
{
|
|
85
|
-
...
|
|
88
|
+
...p,
|
|
86
89
|
alt: "avatar",
|
|
87
|
-
className:
|
|
90
|
+
className: m("h-full w-full border-0", p?.className)
|
|
88
91
|
}
|
|
89
92
|
),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
93
|
+
/* @__PURE__ */ t(v, { ...i, children: /* @__PURE__ */ t(
|
|
94
|
+
d,
|
|
92
95
|
{
|
|
93
96
|
variant: "body-xxl-medium",
|
|
94
|
-
className:
|
|
95
|
-
children:
|
|
97
|
+
className: m("text-info-new-text", r?.className),
|
|
98
|
+
children: y(r?.text ?? "")
|
|
96
99
|
}
|
|
97
100
|
) })
|
|
98
101
|
]
|
|
99
102
|
}
|
|
100
103
|
);
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
+
return n ? /* @__PURE__ */ a("div", { className: "relative inline-block", children: [
|
|
105
|
+
e,
|
|
106
|
+
/* @__PURE__ */ t(
|
|
104
107
|
"div",
|
|
105
108
|
{
|
|
106
109
|
className: `text-primary-bg bg-primary-inverse-bg/50 absolute inset-0 flex
|
|
107
110
|
cursor-pointer items-center justify-center rounded-full opacity-0
|
|
108
111
|
transition-opacity hover:opacity-100`,
|
|
109
|
-
onClick: (
|
|
110
|
-
children: /* @__PURE__ */
|
|
111
|
-
|
|
112
|
+
onClick: (c) => c.stopPropagation(),
|
|
113
|
+
children: /* @__PURE__ */ t(
|
|
114
|
+
f,
|
|
112
115
|
{
|
|
113
|
-
...
|
|
116
|
+
...s,
|
|
114
117
|
type: "x",
|
|
115
|
-
onClick:
|
|
118
|
+
onClick: l
|
|
116
119
|
}
|
|
117
120
|
)
|
|
118
121
|
}
|
|
119
122
|
)
|
|
120
|
-
] }) :
|
|
123
|
+
] }) : e;
|
|
121
124
|
};
|
|
122
125
|
export {
|
|
123
|
-
|
|
126
|
+
$t as BasicAvatar
|
|
124
127
|
};
|
|
125
128
|
//# sourceMappingURL=components-basic-avatar-basic-avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-basic-avatar-basic-avatar.js","sources":["../src/components/basic-avatar/basic-avatar.tsx"],"sourcesContent":["import { Icon, Typography, cn } from \"@/index\";\nimport type { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../ui/avatar\";\nimport type { IconProps } from \"../ui/icon\";\n\ntype AvatarProps = React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: \"default\" | \"sm\" | \"lg\";\n};\ntype AvatarFallbackProps = React.ComponentProps<typeof AvatarPrimitive.Fallback>;\ntype AvatarImageProps = React.ComponentProps<typeof AvatarPrimitive.Image>;\n\ntype Props = {\n initials?: {\n text?: string;\n className?: string;\n };\n hasBadge?: boolean;\n avatar?: AvatarProps;\n fallback?: AvatarFallbackProps;\n image?: AvatarImageProps;\n showDeleteOnHover?: boolean;\n icon?: IconProps;\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nexport const BasicAvatar = ({\n initials,\n avatar,\n fallback,\n image,\n icon,\n showDeleteOnHover = true,\n onClick = () => {},\n}: Props) => {\n const content = (\n <Avatar\n {...avatar}\n className={cn(\"h-18 w-18\", avatar?.className)}\n >\n <AvatarImage\n {...image}\n alt=\"avatar\"\n className={cn(\"h-full w-full border-0\", image?.className)}\n />\n <AvatarFallback {...fallback}>\n <Typography\n variant=\"body-xxl-medium\"\n className={cn(\"text-info-new-text\", initials?.className)}\n >\n {initials?.text}\n </Typography>\n </AvatarFallback>\n </Avatar>\n );\n\n if (!showDeleteOnHover) {\n return content;\n }\n\n return (\n <div className=\"relative inline-block\">\n {content}\n <div\n className=\"text-primary-bg bg-primary-inverse-bg/50 absolute inset-0 flex\n cursor-pointer items-center justify-center rounded-full opacity-0\n transition-opacity hover:opacity-100\"\n onClick={(e) => e.stopPropagation()}\n >\n <Icon\n {...icon}\n type=\"x\"\n onClick={onClick}\n />\n </div>\n </div>\n );\n};\n\nexport type {\n AvatarFallbackProps,\n AvatarImageProps,\n AvatarProps,\n Props as BasicAvatarProps,\n};\n"],"names":["BasicAvatar","initials","avatar","fallback","image","icon","showDeleteOnHover","onClick","content","jsxs","Avatar","cn","jsx","AvatarImage","AvatarFallback","Typography","e","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"components-basic-avatar-basic-avatar.js","sources":["../src/components/basic-avatar/basic-avatar.tsx"],"sourcesContent":["import { Icon, Typography, cn } from \"@/index\";\nimport type { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../ui/avatar\";\nimport type { IconProps } from \"../ui/icon\";\n\ntype AvatarProps = React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: \"default\" | \"sm\" | \"lg\";\n};\ntype AvatarFallbackProps = React.ComponentProps<typeof AvatarPrimitive.Fallback>;\ntype AvatarImageProps = React.ComponentProps<typeof AvatarPrimitive.Image>;\n\ntype Props = {\n initials?: {\n text?: string;\n className?: string;\n };\n hasBadge?: boolean;\n avatar?: AvatarProps;\n fallback?: AvatarFallbackProps;\n image?: AvatarImageProps;\n showDeleteOnHover?: boolean;\n icon?: IconProps;\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst getInitials = (fullName: string): string => {\n const [firstName, lastName] = fullName.trim().split(\" \");\n return `${firstName[0].toUpperCase()}. ${lastName[0].toUpperCase()}.`;\n};\n\nexport const BasicAvatar = ({\n initials,\n avatar,\n fallback,\n image,\n icon,\n showDeleteOnHover = true,\n onClick = () => {},\n}: Props) => {\n const content = (\n <Avatar\n {...avatar}\n className={cn(\"h-18 w-18\", avatar?.className)}\n >\n <AvatarImage\n {...image}\n alt=\"avatar\"\n className={cn(\"h-full w-full border-0\", image?.className)}\n />\n <AvatarFallback {...fallback}>\n <Typography\n variant=\"body-xxl-medium\"\n className={cn(\"text-info-new-text\", initials?.className)}\n >\n {getInitials(initials?.text ?? \"\")}\n </Typography>\n </AvatarFallback>\n </Avatar>\n );\n\n if (!showDeleteOnHover) {\n return content;\n }\n\n return (\n <div className=\"relative inline-block\">\n {content}\n <div\n className=\"text-primary-bg bg-primary-inverse-bg/50 absolute inset-0 flex\n cursor-pointer items-center justify-center rounded-full opacity-0\n transition-opacity hover:opacity-100\"\n onClick={(e) => e.stopPropagation()}\n >\n <Icon\n {...icon}\n type=\"x\"\n onClick={onClick}\n />\n </div>\n </div>\n );\n};\n\nexport type {\n AvatarFallbackProps,\n AvatarImageProps,\n AvatarProps,\n Props as BasicAvatarProps,\n};\n"],"names":["getInitials","fullName","firstName","lastName","BasicAvatar","initials","avatar","fallback","image","icon","showDeleteOnHover","onClick","content","jsxs","Avatar","cn","jsx","AvatarImage","AvatarFallback","Typography","e","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BAAA;AAAA,QAElB,UAAA,gBAAAJ;AAAA,UAACK;AAAA,UAAA;AAAA,YACE,GAAGZ;AAAA,YACJ,MAAK;AAAA,YACL,SAAAE;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF,IAlBOC;AAoBX;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("class-variance-authority");const n=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");const i=require("./components-ui-dialog-dialog.cjs"),_=({open:a,onOpenChange:r,title:t,cancelLabel:c="Отмена",confirmLabel:s="Ок",onConfirm:d,children:u,classes:o,footer:l,showCloseButton:j=!1,ariaDescribedby:m=void 0,positionX:x,positionY:h})=>{const b=()=>{r(!1)},g=()=>{d?.(),r(!1)},v=l===void 0?e.jsxs(i.DialogFooter,{className:o?.footer,children:[e.jsx(n.Button,{variant:"secondary",onClick:b,children:c}),e.jsx(n.Button,{onClick:g,children:s})]}):l;return e.jsx(i.Dialog,{open:a,onOpenChange:r,children:e.jsxs(i.DialogContent,{"aria-describedby":m,showCloseButton:j,positionX:x,positionY:h,className:o?.content,children:[t&&e.jsx(i.DialogHeader,{className:o?.header,children:e.jsx(i.DialogTitle,{className:o?.title,children:t})}),e.jsx("div",{className:o?.body,children:u}),v]})})};exports.BasicModal=_;
|
|
2
2
|
//# sourceMappingURL=components-basic-modal-basic-modal.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-basic-modal-basic-modal.cjs","sources":["../src/components/basic-modal/basic-modal.tsx"],"sourcesContent":["import { Button } from \"../ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../ui/dialog\";\n\ntype Props = {\n open: boolean;\n onOpenChange: (value: boolean) => void;\n title?: React.ReactNode | string;\n cancelLabel?: string;\n confirmLabel?: string;\n onConfirm?: () => void;\n classes?: {\n content?: string;\n header?: string;\n body?: string;\n footer?: string;\n title?: string;\n };\n children: React.ReactNode;\n footer?: React.ReactNode;\n showCloseButton?: boolean;\n ariaDescribedby?: string;\n}
|
|
1
|
+
{"version":3,"file":"components-basic-modal-basic-modal.cjs","sources":["../src/components/basic-modal/basic-modal.tsx"],"sourcesContent":["import { type VariantProps } from \"class-variance-authority\";\nimport { Button } from \"../ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../ui/dialog\";\nimport type { dialogContentPositionVariants } from \"../ui/dialog/dialog.styles\";\n\ntype Props = {\n open: boolean;\n onOpenChange: (value: boolean) => void;\n title?: React.ReactNode | string;\n cancelLabel?: string;\n confirmLabel?: string;\n onConfirm?: () => void;\n classes?: {\n content?: string;\n header?: string;\n body?: string;\n footer?: string;\n title?: string;\n };\n children: React.ReactNode;\n footer?: React.ReactNode;\n showCloseButton?: boolean;\n ariaDescribedby?: string;\n} & VariantProps<typeof dialogContentPositionVariants>;\n\nexport const BasicModal = ({\n open,\n onOpenChange,\n title,\n cancelLabel = \"Отмена\",\n confirmLabel = \"Ок\",\n onConfirm,\n children,\n classes,\n footer,\n showCloseButton = false,\n ariaDescribedby = undefined,\n positionX,\n positionY,\n}: Props) => {\n const handleCancelClick = () => {\n onOpenChange(false);\n };\n\n const handleConfirmClick = () => {\n onConfirm?.();\n onOpenChange(false);\n };\n\n const resolvedFooter =\n footer === undefined ? (\n <DialogFooter className={classes?.footer}>\n <Button\n variant=\"secondary\"\n onClick={handleCancelClick}\n >\n {cancelLabel}\n </Button>\n <Button onClick={handleConfirmClick}>{confirmLabel}</Button>\n </DialogFooter>\n ) : (\n footer\n );\n\n return (\n <Dialog\n open={open}\n onOpenChange={onOpenChange}\n >\n <DialogContent\n aria-describedby={ariaDescribedby}\n showCloseButton={showCloseButton}\n positionX={positionX}\n positionY={positionY}\n className={classes?.content}\n >\n {title && (\n <DialogHeader className={classes?.header}>\n <DialogTitle className={classes?.title}>{title}</DialogTitle>\n </DialogHeader>\n )}\n <div className={classes?.body}>{children}</div>\n {resolvedFooter}\n </DialogContent>\n </Dialog>\n );\n};\n"],"names":["BasicModal","open","onOpenChange","title","cancelLabel","confirmLabel","onConfirm","children","classes","footer","showCloseButton","ariaDescribedby","positionX","positionY","handleCancelClick","handleConfirmClick","resolvedFooter","DialogFooter","jsx","Button","Dialog","jsxs","DialogContent","DialogHeader","DialogTitle"],"mappings":"uTA+BaA,EAAa,CAAC,CACzB,KAAAC,EACA,aAAAC,EACA,MAAAC,EACA,YAAAC,EAAc,SACd,aAAAC,EAAe,KACf,UAAAC,EACA,SAAAC,EACA,QAAAC,EACA,OAAAC,EACA,gBAAAC,EAAkB,GAClB,gBAAAC,EAAkB,OAClB,UAAAC,EACA,UAAAC,CACF,IAAa,CACX,MAAMC,EAAoB,IAAM,CAC9BZ,EAAa,EAAK,CACpB,EAEMa,EAAqB,IAAM,CAC/BT,IAAA,EACAJ,EAAa,EAAK,CACpB,EAEMc,EACJP,IAAW,cACRQ,eAAA,CAAa,UAAWT,GAAS,OAChC,SAAA,CAAAU,EAAAA,IAACC,EAAAA,OAAA,CACC,QAAQ,YACR,QAASL,EAER,SAAAV,CAAA,CAAA,EAEHc,EAAAA,IAACC,EAAAA,OAAA,CAAO,QAASJ,EAAqB,SAAAV,CAAA,CAAa,CAAA,CAAA,CACrD,EAEAI,EAGJ,OACES,EAAAA,IAACE,EAAAA,OAAA,CACC,KAAAnB,EACA,aAAAC,EAEA,SAAAmB,EAAAA,KAACC,EAAAA,cAAA,CACC,mBAAkBX,EAClB,gBAAAD,EACA,UAAAE,EACA,UAAAC,EACA,UAAWL,GAAS,QAEnB,SAAA,CAAAL,GACCe,EAAAA,IAACK,eAAA,CAAa,UAAWf,GAAS,OAChC,SAAAU,EAAAA,IAACM,EAAAA,YAAA,CAAY,UAAWhB,GAAS,MAAQ,SAAAL,CAAA,CAAM,EACjD,EAEFe,EAAAA,IAAC,MAAA,CAAI,UAAWV,GAAS,KAAO,SAAAD,EAAS,EACxCS,CAAA,CAAA,CAAA,CACH,CAAA,CAGN"}
|
|
@@ -1,49 +1,55 @@
|
|
|
1
1
|
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import "class-variance-authority";
|
|
2
3
|
import { Button as c } from "./components-ui-button-button.js";
|
|
3
4
|
import "./components-ui-button-button.styles.js";
|
|
4
|
-
import { DialogFooter as
|
|
5
|
-
const
|
|
6
|
-
open:
|
|
5
|
+
import { DialogFooter as p, Dialog as b, DialogContent as g, DialogHeader as x, DialogTitle as y } from "./components-ui-dialog-dialog.js";
|
|
6
|
+
const M = ({
|
|
7
|
+
open: t,
|
|
7
8
|
onOpenChange: r,
|
|
8
|
-
title:
|
|
9
|
-
cancelLabel:
|
|
9
|
+
title: e,
|
|
10
|
+
cancelLabel: d = "Отмена",
|
|
10
11
|
confirmLabel: n = "Ок",
|
|
11
|
-
onConfirm:
|
|
12
|
-
children:
|
|
12
|
+
onConfirm: m,
|
|
13
|
+
children: s,
|
|
13
14
|
classes: i,
|
|
14
|
-
footer:
|
|
15
|
+
footer: l,
|
|
15
16
|
showCloseButton: h = !1,
|
|
16
|
-
ariaDescribedby: f = void 0
|
|
17
|
+
ariaDescribedby: f = void 0,
|
|
18
|
+
positionX: v,
|
|
19
|
+
positionY: C
|
|
17
20
|
}) => {
|
|
18
|
-
const
|
|
21
|
+
const D = () => {
|
|
19
22
|
r(!1);
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
+
}, N = () => {
|
|
24
|
+
m?.(), r(!1);
|
|
25
|
+
}, k = l === void 0 ? /* @__PURE__ */ a(p, { className: i?.footer, children: [
|
|
23
26
|
/* @__PURE__ */ o(
|
|
24
27
|
c,
|
|
25
28
|
{
|
|
26
29
|
variant: "secondary",
|
|
27
|
-
onClick:
|
|
28
|
-
children:
|
|
30
|
+
onClick: D,
|
|
31
|
+
children: d
|
|
29
32
|
}
|
|
30
33
|
),
|
|
31
|
-
/* @__PURE__ */ o(c, { onClick:
|
|
32
|
-
] }) :
|
|
34
|
+
/* @__PURE__ */ o(c, { onClick: N, children: n })
|
|
35
|
+
] }) : l;
|
|
33
36
|
return /* @__PURE__ */ o(
|
|
34
|
-
|
|
37
|
+
b,
|
|
35
38
|
{
|
|
36
|
-
open:
|
|
39
|
+
open: t,
|
|
37
40
|
onOpenChange: r,
|
|
38
41
|
children: /* @__PURE__ */ a(
|
|
39
|
-
|
|
42
|
+
g,
|
|
40
43
|
{
|
|
41
44
|
"aria-describedby": f,
|
|
42
45
|
showCloseButton: h,
|
|
46
|
+
positionX: v,
|
|
47
|
+
positionY: C,
|
|
48
|
+
className: i?.content,
|
|
43
49
|
children: [
|
|
44
|
-
|
|
45
|
-
/* @__PURE__ */ o("div", { className: i?.body, children:
|
|
46
|
-
|
|
50
|
+
e && /* @__PURE__ */ o(x, { className: i?.header, children: /* @__PURE__ */ o(y, { className: i?.title, children: e }) }),
|
|
51
|
+
/* @__PURE__ */ o("div", { className: i?.body, children: s }),
|
|
52
|
+
k
|
|
47
53
|
]
|
|
48
54
|
}
|
|
49
55
|
)
|
|
@@ -51,6 +57,6 @@ const B = ({
|
|
|
51
57
|
);
|
|
52
58
|
};
|
|
53
59
|
export {
|
|
54
|
-
|
|
60
|
+
M as BasicModal
|
|
55
61
|
};
|
|
56
62
|
//# sourceMappingURL=components-basic-modal-basic-modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-basic-modal-basic-modal.js","sources":["../src/components/basic-modal/basic-modal.tsx"],"sourcesContent":["import { Button } from \"../ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../ui/dialog\";\n\ntype Props = {\n open: boolean;\n onOpenChange: (value: boolean) => void;\n title?: React.ReactNode | string;\n cancelLabel?: string;\n confirmLabel?: string;\n onConfirm?: () => void;\n classes?: {\n content?: string;\n header?: string;\n body?: string;\n footer?: string;\n title?: string;\n };\n children: React.ReactNode;\n footer?: React.ReactNode;\n showCloseButton?: boolean;\n ariaDescribedby?: string;\n}
|
|
1
|
+
{"version":3,"file":"components-basic-modal-basic-modal.js","sources":["../src/components/basic-modal/basic-modal.tsx"],"sourcesContent":["import { type VariantProps } from \"class-variance-authority\";\nimport { Button } from \"../ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../ui/dialog\";\nimport type { dialogContentPositionVariants } from \"../ui/dialog/dialog.styles\";\n\ntype Props = {\n open: boolean;\n onOpenChange: (value: boolean) => void;\n title?: React.ReactNode | string;\n cancelLabel?: string;\n confirmLabel?: string;\n onConfirm?: () => void;\n classes?: {\n content?: string;\n header?: string;\n body?: string;\n footer?: string;\n title?: string;\n };\n children: React.ReactNode;\n footer?: React.ReactNode;\n showCloseButton?: boolean;\n ariaDescribedby?: string;\n} & VariantProps<typeof dialogContentPositionVariants>;\n\nexport const BasicModal = ({\n open,\n onOpenChange,\n title,\n cancelLabel = \"Отмена\",\n confirmLabel = \"Ок\",\n onConfirm,\n children,\n classes,\n footer,\n showCloseButton = false,\n ariaDescribedby = undefined,\n positionX,\n positionY,\n}: Props) => {\n const handleCancelClick = () => {\n onOpenChange(false);\n };\n\n const handleConfirmClick = () => {\n onConfirm?.();\n onOpenChange(false);\n };\n\n const resolvedFooter =\n footer === undefined ? (\n <DialogFooter className={classes?.footer}>\n <Button\n variant=\"secondary\"\n onClick={handleCancelClick}\n >\n {cancelLabel}\n </Button>\n <Button onClick={handleConfirmClick}>{confirmLabel}</Button>\n </DialogFooter>\n ) : (\n footer\n );\n\n return (\n <Dialog\n open={open}\n onOpenChange={onOpenChange}\n >\n <DialogContent\n aria-describedby={ariaDescribedby}\n showCloseButton={showCloseButton}\n positionX={positionX}\n positionY={positionY}\n className={classes?.content}\n >\n {title && (\n <DialogHeader className={classes?.header}>\n <DialogTitle className={classes?.title}>{title}</DialogTitle>\n </DialogHeader>\n )}\n <div className={classes?.body}>{children}</div>\n {resolvedFooter}\n </DialogContent>\n </Dialog>\n );\n};\n"],"names":["BasicModal","open","onOpenChange","title","cancelLabel","confirmLabel","onConfirm","children","classes","footer","showCloseButton","ariaDescribedby","positionX","positionY","handleCancelClick","handleConfirmClick","resolvedFooter","DialogFooter","jsx","Button","Dialog","jsxs","DialogContent","DialogHeader","DialogTitle"],"mappings":";;;;;AA+BO,MAAMA,IAAa,CAAC;AAAA,EACzB,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,cAAAC,IAAe;AAAA,EACf,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,iBAAAC,IAAkB;AAAA,EAClB,WAAAC;AAAA,EACA,WAAAC;AACF,MAAa;AACX,QAAMC,IAAoB,MAAM;AAC9B,IAAAZ,EAAa,EAAK;AAAA,EACpB,GAEMa,IAAqB,MAAM;AAC/B,IAAAT,IAAA,GACAJ,EAAa,EAAK;AAAA,EACpB,GAEMc,IACJP,MAAW,2BACRQ,GAAA,EAAa,WAAWT,GAAS,QAChC,UAAA;AAAA,IAAA,gBAAAU;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAASL;AAAA,QAER,UAAAV;AAAA,MAAA;AAAA,IAAA;AAAA,IAEH,gBAAAc,EAACC,GAAA,EAAO,SAASJ,GAAqB,UAAAV,EAAA,CAAa;AAAA,EAAA,EAAA,CACrD,IAEAI;AAGJ,SACE,gBAAAS;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,MAAAnB;AAAA,MACA,cAAAC;AAAA,MAEA,UAAA,gBAAAmB;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,oBAAkBX;AAAA,UAClB,iBAAAD;AAAA,UACA,WAAAE;AAAA,UACA,WAAAC;AAAA,UACA,WAAWL,GAAS;AAAA,UAEnB,UAAA;AAAA,YAAAL,KACC,gBAAAe,EAACK,GAAA,EAAa,WAAWf,GAAS,QAChC,UAAA,gBAAAU,EAACM,GAAA,EAAY,WAAWhB,GAAS,OAAQ,UAAAL,EAAA,CAAM,GACjD;AAAA,YAEF,gBAAAe,EAAC,OAAA,EAAI,WAAWV,GAAS,MAAO,UAAAD,GAAS;AAAA,YACxCS;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./brd-ui-kit.css');const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./brd-ui-kit.css');const r=require("react/jsx-runtime"),P=require("phosphor-strokes-icons/icons/CaretDown"),j=require("phosphor-strokes-icons/icons/CaretUp"),_=require("phosphor-strokes-icons/icons/EnvelopeSimple"),k=require("phosphor-strokes-icons/icons/MaxLogo"),S=require("phosphor-strokes-icons/icons/Phone"),i=require("./components-icons-stroke-icon.cjs"),T=require("phosphor-strokes-icons/icons/TelegramLogo"),L=require("phosphor-strokes-icons/icons/WhatsAppLogoFilled");;/* empty css */const b=require("./lib-utils.cjs");require("class-variance-authority");require("./components-ui-badge-badge.styles.cjs");const z=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");require("./components-ui-card-card.cjs");require("./components-ui-checkbox-checkbox.cjs");const F=require("./hooks-usePopupControls.cjs");require("./calendar-PqChui7l.cjs");require("phosphor-strokes-icons/icons");require("./components-ui-combobox-combobox.cjs");require("./components-ui-dialog-dialog.cjs");const c=require("react");require("./components-ui-label-label.cjs");require("./components-ui-separator-separator.cjs");require("./components-ui-field-field.styles.cjs");require("./components-ui-input-input.styles.cjs");require("./components-ui-textarea-textarea.cjs");require("./components-ui-input-group-input-group.styles.cjs");require("./components-ui-navigation-item-navigation-item.styles.cjs");require("./components-ui-navigation-menu-navigation-menu.styles.cjs");require("./components-ui-pagination-pagination.cjs");require("./components-ui-progress-progress.cjs");require("./components-ui-radio-group-radio-group.cjs");require("./components-ui-switch-switch.cjs");require("./components-ui-toggle-toggle.styles.cjs");require("./components-ui-toggle-group-toggle-group.cjs");require("./components-ui-table-table.cjs");require("./components-ui-tabs-tabs.cjs");require("./components-ui-tooltip-tooltip.cjs");require("./components-ui-typography-typography.styles.cjs");require("phosphor-strokes-icons/icons/CaretLeft");require("phosphor-strokes-icons/icons/CaretRight");require("./components-app-pagination-app-pagination.styles.cjs");require("phosphor-strokes-icons/icons/CaretUpDown");require("./components-app-sidebar-app-sidebar.styles.cjs");require("./components-data-table-data-table.styles.cjs");require("./components-ui-dropdown-menu-dropdown-menu.styles.cjs");const N=require("./components-input-field-input-field.cjs");require("phosphor-strokes-icons/icons/Eye");require("phosphor-strokes-icons/icons/EyeSlash");require("./components-select-field-select-field.cjs");require("./lodash-kqhtUJfz.cjs");require("./chart-9H_9wEfR.cjs");require("phosphor-strokes-icons/icons/CheckCircle");require("phosphor-strokes-icons/icons/Info");require("phosphor-strokes-icons/icons/SpinnerGap");require("phosphor-strokes-icons/icons/Warning");require("phosphor-strokes-icons/icons/X");require("phosphor-strokes-icons/icons/XCircle");require("./index-DGxwh2Ms.cjs");require("./index-fTTv8YY8.cjs");require("phosphor-strokes-icons/icons/Plus");const D=require("./components-input-phone-input-phone.cjs");require("./components-card-info-card-info.styles.cjs");const E=[{label:"Мобильный",icon:"phone"},{label:"Telegram",icon:"telegram-logo"},{label:"WhatsApp",icon:"whats-app-logo-filled"},{label:"Max",icon:"max-logo"},{label:"E-mail",icon:"envelope-simple"}],h={phone:S.Phone,"telegram-logo":T.TelegramLogo,"whats-app-logo-filled":L.WhatsAppLogoFilled,"max-logo":k.MaxLogo,"envelope-simple":_.EnvelopeSimple},x=o=>{switch(o){case"max-logo":return{bgColor:"bg-[linear-gradient(135deg,#9933DD_0%,#2831B9_50%,#44CCFF_100%)]"};case"telegram-logo":return{bgColor:"bg-[#289AD2]"};case"whats-app-logo-filled":return{bgColor:"bg-[#00C202]",textColor:"text-primary-inverse-text"};default:return{}}},a=o=>({wrapper:b.cn(`flex h-5.5 w-5.5 shrink-0 items-center justify-center rounded-sm
|
|
2
2
|
${x(o).bgColor??"bg-primary-inverse-hover-bg"}
|
|
3
|
-
${x(o).textColor??"text-primary-inverse-text"}`),icon:"size-5 shrink-0"}),O=o=>{const{inputProps:
|
|
4
|
-
flex-col rounded-xl border`,ref:l,children:E.map(({label:e,icon:t})=>{const
|
|
3
|
+
${x(o).textColor??"text-primary-inverse-text"}`),icon:"size-5 shrink-0"}),O=o=>{const{inputProps:C,inputPhoneProps:f,onTypeChange:v,...p}=o,[n,I]=c.useState("phone"),{isOpened:s,openPopup:q,closePopup:u}=F.usePopupControls(),l=c.useRef(null);c.useEffect(()=>{const e=t=>{l.current&&!l.current.contains(t.target)&&u()};return s&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[s,u]);const m=e=>{switch(e){case"phone":return"+7 (999) 999-99-99";case"telegram-logo":return"@username";case"whats-app-logo-filled":return"+7 (999) 999-99-99";case"max-logo":return"ID пользователя Max";case"envelope-simple":return"example@mail.com";default:return"Введите значение"}},w=e=>()=>{I(e),v?.(e),u()},d=h[n],g=s?j.CaretUp:P.CaretDown;return r.jsxs("div",{className:b.cn("relative",o.classes?.container),children:[["telegram-logo","max-logo","envelope-simple"].includes(n)?r.jsx(N.InputField,{...C,...p,date:[{id:"0",position:"inline-start",component:r.jsx(i.StrokeIcon,{icon:d,size:"medium",classes:a(n)})},{id:"1",position:"inline-end",component:r.jsx(i.StrokeIcon,{icon:g,size:"medium",className:"cursor-pointer",onClick:q})}],placeholder:m(n)}):r.jsx(D.InputPhone,{...f,...p,date:[{id:"0",position:"inline-start",component:r.jsx(i.StrokeIcon,{icon:d,size:"medium",classes:a(n)})},{id:"1",position:"inline-end",component:r.jsx(i.StrokeIcon,{icon:g,size:"medium",className:"cursor-pointer",onClick:q})}],placeholder:m(n)}),s&&r.jsx("div",{className:`border-inp-hover-border bg-primary-bg absolute z-100 my-2 flex w-full
|
|
4
|
+
flex-col rounded-xl border`,ref:l,children:E.map(({label:e,icon:t})=>{const y=h[t];return r.jsxs(z.Button,{variant:"ghost",className:"flex w-full justify-start",type:"button",onClick:w(t),children:[r.jsx(i.StrokeIcon,{icon:y,size:"medium",className:"text-primary-inverse-text",classes:a(t)}),e]},e)})})]})};exports.InputContact=O;
|
|
5
5
|
//# sourceMappingURL=components-input-contact-input-contact.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-input-contact-input-contact.cjs","sources":["../src/constants/contact-input.ts","../src/components/input-contact/input-contact.tsx"],"sourcesContent":["import type { TOption } from \"@/components/input-contact/input-contact\";\n\nexport const OPTIONS: TOption[] = [\n {\n label: \"Мобильный\",\n icon: \"phone\",\n },\n {\n label: \"Telegram\",\n icon: \"telegram-logo\",\n },\n {\n label: \"WhatsApp\",\n icon: \"whats-app-logo-filled\",\n },\n {\n label: \"Max\",\n icon: \"max-logo\",\n },\n {\n label: \"E-mail\",\n icon: \"envelope-simple\",\n },\n];\n","import { OPTIONS } from \"@/constants/contact-input\";\nimport { CaretDown } from \"@/components/icons/CaretDown\";\nimport { CaretUp } from \"@/components/icons/CaretUp\";\nimport { EnvelopeSimple } from \"@/components/icons/EnvelopeSimple\";\nimport { MaxLogo } from \"@/components/icons/MaxLogo\";\nimport { Phone } from \"@/components/icons/Phone\";\nimport { StrokeIcon, type StrokeIconComponent } from \"@/components/icons/stroke-icon\";\nimport { TelegramLogo } from \"@/components/icons/TelegramLogo\";\nimport { WhatsAppLogoFilled } from \"@/components/icons/WhatsAppLogoFilled\";\nimport {\n Button,\n InputField,\n InputPhone,\n cn,\n usePopupControls,\n type InputPhoneProps,\n} from \"@/index\";\nimport { useEffect, useRef, useState } from \"react\";\n\nexport type TOption = {\n label: string;\n icon: TypesChange;\n};\n\ntype TypesChange =\n | \"phone\"\n | \"telegram-logo\"\n | \"whats-app-logo-filled\"\n | \"max-logo\"\n | \"envelope-simple\";\n\nconst contactIcons: Record<TypesChange, StrokeIconComponent> = {\n phone: Phone,\n \"telegram-logo\": TelegramLogo,\n \"whats-app-logo-filled\": WhatsAppLogoFilled,\n \"max-logo\": MaxLogo,\n \"envelope-simple\": EnvelopeSimple,\n};\n\ntype Props = {\n isValid?: boolean;\n label?: string;\n description?: string;\n classes?: {\n fieldset?: string;\n fieldgroup?: string;\n field?: string;\n container?: string;\n };\n value?: string;\n name?: string;\n onTypeChange?: (type: TypesChange) => void;\n inputProps: React.ComponentPropsWithRef<\"input\">;\n inputPhoneProps: InputPhoneProps;\n};\n\n// TODO: заменить цвета\nconst iconStyles = (icon: TypesChange) => {\n switch (icon) {\n case \"max-logo\":\n return {\n bgColor: \"bg-[linear-gradient(135deg,#9933DD_0%,#2831B9_50%,#44CCFF_100%)]\",\n };\n\n case \"telegram-logo\":\n return {\n bgColor: \"bg-[#289AD2]\",\n };\n\n case \"whats-app-logo-filled\":\n return {\n bgColor: \"bg-[#00C202]\",\n textColor: \"text-[#00C202]\",\n };\n\n default:\n return {};\n }\n};\n\nconst getContactIconClasses = (icon: TypesChange) => ({\n wrapper: cn(\n `flex h-5.5 w-5.5 shrink-0 items-center justify-center rounded-sm\n ${iconStyles(icon).bgColor ?? \"bg-primary-inverse-hover-bg\"}\n ${iconStyles(icon).textColor ?? \"text-primary-inverse-text\"}`,\n ),\n icon: \"size-5 shrink-0\",\n});\n\nexport const InputContact = (props: Props) => {\n const { inputProps, inputPhoneProps, onTypeChange, ...rest } = props;\n\n const [type, setType] = useState<TypesChange>(\"phone\");\n const { isOpened, openPopup, closePopup } = usePopupControls();\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (wrapperRef.current && !wrapperRef.current.contains(event.target as Node)) {\n closePopup();\n }\n };\n\n if (isOpened) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [isOpened, closePopup]);\n\n const getPlaceholder = (type: TypesChange): string => {\n switch (type) {\n case \"phone\":\n return \"+7 (999) 999-99-99\";\n case \"telegram-logo\":\n return \"@username\";\n case \"whats-app-logo-filled\":\n return \"+7 (999) 999-99-99\";\n case \"max-logo\":\n return \"ID пользователя Max\";\n case \"envelope-simple\":\n return \"example@mail.com\";\n default:\n return \"Введите значение\";\n }\n };\n\n const handleTypeChange = (type: TypesChange) => {\n return () => {\n setType(type);\n onTypeChange?.(type);\n closePopup();\n };\n };\n\n const SelectedIcon = contactIcons[type];\n const ToggleIcon = isOpened ? CaretUp : CaretDown;\n\n return (\n <div className={cn(\"relative\", props.classes?.container)}>\n {[\"telegram-logo\", \"max-logo\", \"envelope-simple\"].includes(type) ? (\n <InputField\n {...inputProps}\n {...rest}\n date={[\n {\n id: \"0\",\n position: \"inline-start\",\n component: (\n <StrokeIcon\n icon={SelectedIcon}\n size=\"medium\"\n classes={getContactIconClasses(type)}\n />\n ),\n },\n {\n id: \"1\",\n position: \"inline-end\",\n component: (\n <StrokeIcon\n icon={ToggleIcon}\n size=\"medium\"\n className=\"cursor-pointer\"\n onClick={openPopup}\n />\n ),\n },\n ]}\n placeholder={getPlaceholder(type)}\n />\n ) : (\n <InputPhone\n {...inputPhoneProps}\n {...rest}\n date={[\n {\n id: \"0\",\n position: \"inline-start\",\n component: (\n <StrokeIcon\n icon={SelectedIcon}\n size=\"medium\"\n classes={getContactIconClasses(type)}\n />\n ),\n },\n {\n id: \"1\",\n position: \"inline-end\",\n component: (\n <StrokeIcon\n icon={ToggleIcon}\n size=\"medium\"\n className=\"cursor-pointer\"\n onClick={openPopup}\n />\n ),\n },\n ]}\n placeholder={getPlaceholder(type)}\n />\n )}\n\n {isOpened && (\n <div\n className=\"border-inp-hover-border bg-primary-bg absolute my-2 flex w-full\n flex-col rounded-xl border\"\n ref={wrapperRef}\n >\n {OPTIONS.map(({ label, icon }) => {\n const OptionIcon = contactIcons[icon];\n\n return (\n <Button\n key={label}\n variant=\"ghost\"\n className=\"flex w-full justify-start\"\n type=\"button\"\n onClick={handleTypeChange(icon)}\n >\n <StrokeIcon\n icon={OptionIcon}\n size=\"medium\"\n className=\"text-primary-inverse-text\"\n classes={getContactIconClasses(icon)}\n />\n\n {label}\n </Button>\n );\n })}\n </div>\n )}\n </div>\n );\n};\n\nexport type { Props as InputContactProps, TypesChange };\n"],"names":["OPTIONS","contactIcons","Phone","TelegramLogo","WhatsAppLogoFilled","MaxLogo","EnvelopeSimple","iconStyles","icon","getContactIconClasses","cn","InputContact","props","inputProps","inputPhoneProps","onTypeChange","rest","type","setType","useState","isOpened","openPopup","closePopup","usePopupControls","wrapperRef","useRef","useEffect","handleClickOutside","event","getPlaceholder","handleTypeChange","SelectedIcon","ToggleIcon","CaretUp","CaretDown","jsxs","jsx","InputField","StrokeIcon","InputPhone","label","OptionIcon","Button"],"mappings":"2rGAEO,MAAMA,EAAqB,CAChC,CACE,MAAO,YACP,KAAM,OAAA,EAER,CACE,MAAO,WACP,KAAM,eAAA,EAER,CACE,MAAO,WACP,KAAM,uBAAA,EAER,CACE,MAAO,MACP,KAAM,UAAA,EAER,CACE,MAAO,SACP,KAAM,iBAAA,CAEV,ECQMC,EAAyD,CAC7D,MAAOC,EAAAA,MACP,gBAAiBC,EAAAA,aACjB,wBAAyBC,EAAAA,mBACzB,WAAYC,EAAAA,QACZ,kBAAmBC,EAAAA,cACrB,EAoBMC,EAAcC,GAAsB,CACxC,OAAQA,EAAA,CACN,IAAK,WACH,MAAO,CACL,QAAS,kEAAA,EAGb,IAAK,gBACH,MAAO,CACL,QAAS,cAAA,EAGb,IAAK,wBACH,MAAO,CACL,QAAS,eACT,UAAW,gBAAA,EAGf,QACE,MAAO,CAAA,CAAC,CAEd,EAE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contact-input-contact.cjs","sources":["../src/constants/contact-input.ts","../src/components/input-contact/input-contact.tsx"],"sourcesContent":["import type { TOption } from \"@/components/input-contact/input-contact\";\n\nexport const OPTIONS: TOption[] = [\n {\n label: \"Мобильный\",\n icon: \"phone\",\n },\n {\n label: \"Telegram\",\n icon: \"telegram-logo\",\n },\n {\n label: \"WhatsApp\",\n icon: \"whats-app-logo-filled\",\n },\n {\n label: \"Max\",\n icon: \"max-logo\",\n },\n {\n label: \"E-mail\",\n icon: \"envelope-simple\",\n },\n];\n","import { OPTIONS } from \"@/constants/contact-input\";\nimport { CaretDown } from \"@/components/icons/CaretDown\";\nimport { CaretUp } from \"@/components/icons/CaretUp\";\nimport { EnvelopeSimple } from \"@/components/icons/EnvelopeSimple\";\nimport { MaxLogo } from \"@/components/icons/MaxLogo\";\nimport { Phone } from \"@/components/icons/Phone\";\nimport { StrokeIcon, type StrokeIconComponent } from \"@/components/icons/stroke-icon\";\nimport { TelegramLogo } from \"@/components/icons/TelegramLogo\";\nimport { WhatsAppLogoFilled } from \"@/components/icons/WhatsAppLogoFilled\";\nimport {\n Button,\n InputField,\n InputPhone,\n cn,\n usePopupControls,\n type InputPhoneProps,\n} from \"@/index\";\nimport { useEffect, useRef, useState } from \"react\";\n\nexport type TOption = {\n label: string;\n icon: TypesChange;\n};\n\ntype TypesChange =\n | \"phone\"\n | \"telegram-logo\"\n | \"whats-app-logo-filled\"\n | \"max-logo\"\n | \"envelope-simple\";\n\nconst contactIcons: Record<TypesChange, StrokeIconComponent> = {\n phone: Phone,\n \"telegram-logo\": TelegramLogo,\n \"whats-app-logo-filled\": WhatsAppLogoFilled,\n \"max-logo\": MaxLogo,\n \"envelope-simple\": EnvelopeSimple,\n};\n\ntype Props = {\n isValid?: boolean;\n label?: string;\n description?: string;\n classes?: {\n fieldset?: string;\n fieldgroup?: string;\n field?: string;\n container?: string;\n };\n value?: string;\n name?: string;\n onTypeChange?: (type: TypesChange) => void;\n inputProps: React.ComponentPropsWithRef<\"input\">;\n inputPhoneProps: InputPhoneProps;\n};\n\n// TODO: заменить цвета\nconst iconStyles = (icon: TypesChange) => {\n switch (icon) {\n case \"max-logo\":\n return {\n bgColor: \"bg-[linear-gradient(135deg,#9933DD_0%,#2831B9_50%,#44CCFF_100%)]\",\n };\n\n case \"telegram-logo\":\n return {\n bgColor: \"bg-[#289AD2]\",\n };\n\n case \"whats-app-logo-filled\":\n return {\n bgColor: \"bg-[#00C202]\",\n textColor: \"text-primary-inverse-text\",\n };\n\n default:\n return {};\n }\n};\n\nconst getContactIconClasses = (icon: TypesChange) => ({\n wrapper: cn(\n `flex h-5.5 w-5.5 shrink-0 items-center justify-center rounded-sm\n ${iconStyles(icon).bgColor ?? \"bg-primary-inverse-hover-bg\"}\n ${iconStyles(icon).textColor ?? \"text-primary-inverse-text\"}`,\n ),\n icon: \"size-5 shrink-0\",\n});\n\nexport const InputContact = (props: Props) => {\n const { inputProps, inputPhoneProps, onTypeChange, ...rest } = props;\n\n const [type, setType] = useState<TypesChange>(\"phone\");\n const { isOpened, openPopup, closePopup } = usePopupControls();\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (wrapperRef.current && !wrapperRef.current.contains(event.target as Node)) {\n closePopup();\n }\n };\n\n if (isOpened) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [isOpened, closePopup]);\n\n const getPlaceholder = (type: TypesChange): string => {\n switch (type) {\n case \"phone\":\n return \"+7 (999) 999-99-99\";\n case \"telegram-logo\":\n return \"@username\";\n case \"whats-app-logo-filled\":\n return \"+7 (999) 999-99-99\";\n case \"max-logo\":\n return \"ID пользователя Max\";\n case \"envelope-simple\":\n return \"example@mail.com\";\n default:\n return \"Введите значение\";\n }\n };\n\n const handleTypeChange = (type: TypesChange) => {\n return () => {\n setType(type);\n onTypeChange?.(type);\n closePopup();\n };\n };\n\n const SelectedIcon = contactIcons[type];\n const ToggleIcon = isOpened ? CaretUp : CaretDown;\n\n return (\n <div className={cn(\"relative\", props.classes?.container)}>\n {[\"telegram-logo\", \"max-logo\", \"envelope-simple\"].includes(type) ? (\n <InputField\n {...inputProps}\n {...rest}\n date={[\n {\n id: \"0\",\n position: \"inline-start\",\n component: (\n <StrokeIcon\n icon={SelectedIcon}\n size=\"medium\"\n classes={getContactIconClasses(type)}\n />\n ),\n },\n {\n id: \"1\",\n position: \"inline-end\",\n component: (\n <StrokeIcon\n icon={ToggleIcon}\n size=\"medium\"\n className=\"cursor-pointer\"\n onClick={openPopup}\n />\n ),\n },\n ]}\n placeholder={getPlaceholder(type)}\n />\n ) : (\n <InputPhone\n {...inputPhoneProps}\n {...rest}\n date={[\n {\n id: \"0\",\n position: \"inline-start\",\n component: (\n <StrokeIcon\n icon={SelectedIcon}\n size=\"medium\"\n classes={getContactIconClasses(type)}\n />\n ),\n },\n {\n id: \"1\",\n position: \"inline-end\",\n component: (\n <StrokeIcon\n icon={ToggleIcon}\n size=\"medium\"\n className=\"cursor-pointer\"\n onClick={openPopup}\n />\n ),\n },\n ]}\n placeholder={getPlaceholder(type)}\n />\n )}\n\n {isOpened && (\n <div\n className=\"border-inp-hover-border bg-primary-bg absolute z-100 my-2 flex w-full\n flex-col rounded-xl border\"\n ref={wrapperRef}\n >\n {OPTIONS.map(({ label, icon }) => {\n const OptionIcon = contactIcons[icon];\n\n return (\n <Button\n key={label}\n variant=\"ghost\"\n className=\"flex w-full justify-start\"\n type=\"button\"\n onClick={handleTypeChange(icon)}\n >\n <StrokeIcon\n icon={OptionIcon}\n size=\"medium\"\n className=\"text-primary-inverse-text\"\n classes={getContactIconClasses(icon)}\n />\n\n {label}\n </Button>\n );\n })}\n </div>\n )}\n </div>\n );\n};\n\nexport type { Props as InputContactProps, TypesChange };\n"],"names":["OPTIONS","contactIcons","Phone","TelegramLogo","WhatsAppLogoFilled","MaxLogo","EnvelopeSimple","iconStyles","icon","getContactIconClasses","cn","InputContact","props","inputProps","inputPhoneProps","onTypeChange","rest","type","setType","useState","isOpened","openPopup","closePopup","usePopupControls","wrapperRef","useRef","useEffect","handleClickOutside","event","getPlaceholder","handleTypeChange","SelectedIcon","ToggleIcon","CaretUp","CaretDown","jsxs","jsx","InputField","StrokeIcon","InputPhone","label","OptionIcon","Button"],"mappings":"2rGAEO,MAAMA,EAAqB,CAChC,CACE,MAAO,YACP,KAAM,OAAA,EAER,CACE,MAAO,WACP,KAAM,eAAA,EAER,CACE,MAAO,WACP,KAAM,uBAAA,EAER,CACE,MAAO,MACP,KAAM,UAAA,EAER,CACE,MAAO,SACP,KAAM,iBAAA,CAEV,ECQMC,EAAyD,CAC7D,MAAOC,EAAAA,MACP,gBAAiBC,EAAAA,aACjB,wBAAyBC,EAAAA,mBACzB,WAAYC,EAAAA,QACZ,kBAAmBC,EAAAA,cACrB,EAoBMC,EAAcC,GAAsB,CACxC,OAAQA,EAAA,CACN,IAAK,WACH,MAAO,CACL,QAAS,kEAAA,EAGb,IAAK,gBACH,MAAO,CACL,QAAS,cAAA,EAGb,IAAK,wBACH,MAAO,CACL,QAAS,eACT,UAAW,2BAAA,EAGf,QACE,MAAO,CAAA,CAAC,CAEd,EAEMC,EAAyBD,IAAuB,CACpD,QAASE,EAAAA,GACP;AAAA,MACEH,EAAWC,CAAI,EAAE,SAAW,6BAA6B;AAAA,MACzDD,EAAWC,CAAI,EAAE,WAAa,2BAA2B,EAAA,EAE7D,KAAM,iBACR,GAEaG,EAAgBC,GAAiB,CAC5C,KAAM,CAAE,WAAAC,EAAY,gBAAAC,EAAiB,aAAAC,EAAc,GAAGC,GAASJ,EAEzD,CAACK,EAAMC,CAAO,EAAIC,EAAAA,SAAsB,OAAO,EAC/C,CAAE,SAAAC,EAAU,UAAAC,EAAW,WAAAC,CAAA,EAAeC,EAAAA,iBAAA,EACtCC,EAAaC,EAAAA,OAAuB,IAAI,EAE9CC,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAsBC,G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