brd-ui-kit 0.1.78 → 0.1.80
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/components/card-info/card-info.d.ts +13 -0
- package/dist/components/card-info/card-info.styles.d.ts +10 -0
- package/dist/components/card-info/index.d.ts +1 -0
- package/dist/components/card-info.d.ts +2 -0
- 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/dropdown-menu/dropdown-menu.d.ts +3 -3
- package/dist/components-avatar-uploader-avatar-uploader.cjs +1 -1
- package/dist/components-avatar-uploader-avatar-uploader.cjs.map +1 -1
- package/dist/components-avatar-uploader-avatar-uploader.js +3 -2
- package/dist/components-avatar-uploader-avatar-uploader.js.map +1 -1
- 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 +36 -32
- package/dist/components-basic-avatar-basic-avatar.js.map +1 -1
- package/dist/components-card-info-card-info.cjs +2 -0
- package/dist/components-card-info-card-info.cjs.map +1 -0
- package/dist/components-card-info-card-info.js +43 -0
- package/dist/components-card-info-card-info.js.map +1 -0
- package/dist/components-card-info-card-info.styles.cjs +3 -0
- package/dist/components-card-info-card-info.styles.cjs.map +1 -0
- package/dist/components-card-info-card-info.styles.js +52 -0
- package/dist/components-card-info-card-info.styles.js.map +1 -0
- package/dist/components-card-info.cjs +2 -0
- package/dist/components-card-info.cjs.map +1 -0
- package/dist/components-card-info.js +5 -0
- package/dist/components-card-info.js.map +1 -0
- package/dist/components-checkbox-group-checkbox-group.cjs +1 -1
- package/dist/components-checkbox-group-checkbox-group.cjs.map +1 -1
- package/dist/components-checkbox-group-checkbox-group.js +3 -2
- package/dist/components-checkbox-group-checkbox-group.js.map +1 -1
- package/dist/components-files-uploader-files-uploader.cjs +6 -6
- package/dist/components-files-uploader-files-uploader.cjs.map +1 -1
- package/dist/components-files-uploader-files-uploader.js +73 -67
- package/dist/components-files-uploader-files-uploader.js.map +1 -1
- package/dist/components-input-contact-input-contact.cjs +1 -1
- package/dist/components-input-contact-input-contact.cjs.map +1 -1
- package/dist/components-input-contact-input-contact.js +3 -2
- 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 +2 -0
- package/dist/components-transfer-list-transfer-list-card.cjs.map +1 -0
- package/dist/components-transfer-list-transfer-list-card.js +8 -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 +121 -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-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 -0
- package/dist/index.js +132 -128
- package/dist/index.js.map +1 -1
- package/dist/transfer-list-card-3JPB-sdd.js +525 -0
- package/dist/transfer-list-card-3JPB-sdd.js.map +1 -0
- package/dist/transfer-list-card-D2oGp-Rw.cjs +28 -0
- package/dist/transfer-list-card-D2oGp-Rw.cjs.map +1 -0
- package/package.json +19 -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,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./brd-ui-kit.css');const r=require("react/jsx-runtime");;/* empty css */const x=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");const v=require("react");require("./calendar-PqChui7l.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 A=require("./components-ui-typography-typography.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");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");const y=require("./components-basic-avatar-basic-avatar.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");const f=require("./index-DJD-8LQA.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");const h=1,j=[".jpg",".png"],b=({src:u,fullName:t,maxFiles:n=h,accept:s=j,avatarProps:a,containerClassName:c,onChange:q})=>{const o=v.useMemo(()=>{const[e="",i=""]=t.split(" "),g=e.charAt(0),m=i.charAt(0);return(g+m).toUpperCase()||"?"},[t]),{getRootProps:p,getInputProps:l}=f.useDropzone({accept:{"image/*":s},maxFiles:n,onDrop:e=>{if(e.length===0)return;const i=URL.createObjectURL(e[0]);q?.(i)}}),d=e=>{e.stopPropagation(),q?.(null)};return r.jsxs("div",{...p(),className:x.cn(`bg-info-new-bg flex h-18 w-18 cursor-pointer items-center justify-center
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./brd-ui-kit.css');const r=require("react/jsx-runtime");;/* empty css */const x=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");const v=require("react");require("./calendar-PqChui7l.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 A=require("./components-ui-typography-typography.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");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");const y=require("./components-basic-avatar-basic-avatar.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");const f=require("./index-DJD-8LQA.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 h=1,j=[".jpg",".png"],b=({src:u,fullName:t,maxFiles:n=h,accept:s=j,avatarProps:a,containerClassName:c,onChange:q})=>{const o=v.useMemo(()=>{const[e="",i=""]=t.split(" "),g=e.charAt(0),m=i.charAt(0);return(g+m).toUpperCase()||"?"},[t]),{getRootProps:p,getInputProps:l}=f.useDropzone({accept:{"image/*":s},maxFiles:n,onDrop:e=>{if(e.length===0)return;const i=URL.createObjectURL(e[0]);q?.(i)}}),d=e=>{e.stopPropagation(),q?.(null)};return r.jsxs("div",{...p(),className:x.cn(`bg-info-new-bg flex h-18 w-18 cursor-pointer items-center justify-center
|
|
2
2
|
overflow-hidden rounded-full transition-colors`,c),children:[r.jsx("input",{...l()}),u?r.jsx(y.BasicAvatar,{...a,image:{src:u},initials:{text:o},hasBadge:!0,onClick:d}):r.jsx(A.Typography,{variant:"body-xxl-medium",className:"text-info-new-text flex items-center justify-center",children:o})]})};exports.AvatarUpload=b;
|
|
3
3
|
//# sourceMappingURL=components-avatar-uploader-avatar-uploader.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-avatar-uploader-avatar-uploader.cjs","sources":["../src/components/avatar-uploader/avatar-uploader.tsx"],"sourcesContent":["import { cn } from \"@/index\";\nimport { useMemo } from \"react\";\nimport { useDropzone } from \"react-dropzone\";\nimport { BasicAvatar, type BasicAvatarProps } from \"../basic-avatar\";\nimport { Typography } from \"../ui/typography\";\n\ntype Props = {\n maxFiles?: number;\n src?: string;\n fullName: string;\n accept?: string[];\n avatarProps?: BasicAvatarProps;\n containerClassName?: string;\n onChange?: (src: string | null) => void;\n};\n\nconst DEFAULT_MAX_FILES = 1;\nconst DEFAULT_ACCEPT = [\".jpg\", \".png\"];\n\nexport const AvatarUpload = ({\n src,\n fullName,\n maxFiles = DEFAULT_MAX_FILES,\n accept = DEFAULT_ACCEPT,\n avatarProps,\n containerClassName,\n onChange,\n}: Props) => {\n const initials = useMemo(() => {\n const [firstName = \"\", lastName = \"\"] = fullName.split(\" \");\n const first = firstName.charAt(0);\n const last = lastName.charAt(0);\n\n return (first + last).toUpperCase() || \"?\";\n }, [fullName]);\n\n const { getRootProps, getInputProps } = useDropzone({\n accept: { \"image/*\": accept },\n maxFiles,\n onDrop: (files) => {\n if (files.length === 0) return;\n const previewUrl = URL.createObjectURL(files[0]);\n onChange?.(previewUrl);\n },\n });\n\n const removeAvatar = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n onChange?.(null);\n };\n\n return (\n <div\n {...getRootProps()}\n className={cn(\n `bg-info-new-bg flex h-18 w-18 cursor-pointer items-center justify-center\n overflow-hidden rounded-full transition-colors`,\n containerClassName,\n )}\n >\n <input {...getInputProps()} />\n {src ? (\n <BasicAvatar\n {...avatarProps}\n image={{\n src,\n }}\n initials={{ text: initials }}\n hasBadge\n onClick={removeAvatar}\n />\n ) : (\n <Typography\n variant=\"body-xxl-medium\"\n className=\"text-info-new-text flex items-center justify-center\"\n >\n {initials}\n </Typography>\n )}\n </div>\n );\n};\n\nexport type { Props as AvatarUploadProps };\n"],"names":["DEFAULT_MAX_FILES","DEFAULT_ACCEPT","AvatarUpload","src","fullName","maxFiles","accept","avatarProps","containerClassName","onChange","initials","useMemo","firstName","lastName","first","last","getRootProps","getInputProps","useDropzone","files","previewUrl","removeAvatar","jsxs","cn","jsx","BasicAvatar","Typography"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components-avatar-uploader-avatar-uploader.cjs","sources":["../src/components/avatar-uploader/avatar-uploader.tsx"],"sourcesContent":["import { cn } from \"@/index\";\nimport { useMemo } from \"react\";\nimport { useDropzone } from \"react-dropzone\";\nimport { BasicAvatar, type BasicAvatarProps } from \"../basic-avatar\";\nimport { Typography } from \"../ui/typography\";\n\ntype Props = {\n maxFiles?: number;\n src?: string;\n fullName: string;\n accept?: string[];\n avatarProps?: BasicAvatarProps;\n containerClassName?: string;\n onChange?: (src: string | null) => void;\n};\n\nconst DEFAULT_MAX_FILES = 1;\nconst DEFAULT_ACCEPT = [\".jpg\", \".png\"];\n\nexport const AvatarUpload = ({\n src,\n fullName,\n maxFiles = DEFAULT_MAX_FILES,\n accept = DEFAULT_ACCEPT,\n avatarProps,\n containerClassName,\n onChange,\n}: Props) => {\n const initials = useMemo(() => {\n const [firstName = \"\", lastName = \"\"] = fullName.split(\" \");\n const first = firstName.charAt(0);\n const last = lastName.charAt(0);\n\n return (first + last).toUpperCase() || \"?\";\n }, [fullName]);\n\n const { getRootProps, getInputProps } = useDropzone({\n accept: { \"image/*\": accept },\n maxFiles,\n onDrop: (files) => {\n if (files.length === 0) return;\n const previewUrl = URL.createObjectURL(files[0]);\n onChange?.(previewUrl);\n },\n });\n\n const removeAvatar = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n onChange?.(null);\n };\n\n return (\n <div\n {...getRootProps()}\n className={cn(\n `bg-info-new-bg flex h-18 w-18 cursor-pointer items-center justify-center\n overflow-hidden rounded-full transition-colors`,\n containerClassName,\n )}\n >\n <input {...getInputProps()} />\n {src ? (\n <BasicAvatar\n {...avatarProps}\n image={{\n src,\n }}\n initials={{ text: initials }}\n hasBadge\n onClick={removeAvatar}\n />\n ) : (\n <Typography\n variant=\"body-xxl-medium\"\n className=\"text-info-new-text flex items-center justify-center\"\n >\n {initials}\n </Typography>\n )}\n </div>\n );\n};\n\nexport type { Props as AvatarUploadProps };\n"],"names":["DEFAULT_MAX_FILES","DEFAULT_ACCEPT","AvatarUpload","src","fullName","maxFiles","accept","avatarProps","containerClassName","onChange","initials","useMemo","firstName","lastName","first","last","getRootProps","getInputProps","useDropzone","files","previewUrl","removeAvatar","jsxs","cn","jsx","BasicAvatar","Typography"],"mappings":"oqGAgBA,MAAMA,EAAoB,EACpBC,EAAiB,CAAC,OAAQ,MAAM,EAEzBC,EAAe,CAAC,CAC3B,IAAAC,EACA,SAAAC,EACA,SAAAC,EAAWL,EACX,OAAAM,EAASL,EACT,YAAAM,EACA,mBAAAC,EACA,SAAAC,CACF,IAAa,CACX,MAAMC,EAAWC,EAAAA,QAAQ,IAAM,CAC7B,KAAM,CAACC,EAAY,GAAIC,EAAW,EAAE,EAAIT,EAAS,MAAM,GAAG,EACpDU,EAAQF,EAAU,OAAO,CAAC,EAC1BG,EAAOF,EAAS,OAAO,CAAC,EAE9B,OAAQC,EAAQC,GAAM,YAAA,GAAiB,GACzC,EAAG,CAACX,CAAQ,CAAC,EAEP,CAAE,aAAAY,EAAc,cAAAC,CAAA,EAAkBC,cAAY,CAClD,OAAQ,CAAE,UAAWZ,CAAA,EACrB,SAAAD,EACA,OAASc,GAAU,CACjB,GAAIA,EAAM,SAAW,EAAG,OACxB,MAAMC,EAAa,IAAI,gBAAgBD,EAAM,CAAC,CAAC,EAC/CV,IAAWW,CAAU,CACvB,CAAA,CACD,EAEKC,EAAgB,GAAwC,CAC5D,EAAE,gBAAA,EACFZ,IAAW,IAAI,CACjB,EAEA,OACEa,EAAAA,KAAC,MAAA,CACE,GAAGN,EAAA,EACJ,UAAWO,EAAAA,GACT;AAAA,wDAEAf,CAAA,EAGF,SAAA,CAAAgB,EAAAA,IAAC,QAAA,CAAO,GAAGP,EAAA,CAAc,CAAG,EAC3Bd,EACCqB,EAAAA,IAACC,EAAAA,YAAA,CACE,GAAGlB,EACJ,MAAO,CACL,IAAAJ,CAAA,EAEF,SAAU,CAAE,KAAMO,CAAA,EAClB,SAAQ,GACR,QAASW,CAAA,CAAA,EAGXG,EAAAA,IAACE,EAAAA,WAAA,CACC,QAAQ,kBACR,UAAU,sDAET,SAAAhB,CAAA,CAAA,CACH,CAAA,CAAA,CAIR"}
|
|
@@ -62,7 +62,8 @@ import "phosphor-strokes-icons/icons/Phone";
|
|
|
62
62
|
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 w = 1, y = [".jpg", ".png"], Bt = ({
|
|
66
67
|
src: i,
|
|
67
68
|
fullName: p,
|
|
68
69
|
maxFiles: n = w,
|
|
@@ -120,6 +121,6 @@ const w = 1, y = [".jpg", ".png"], _t = ({
|
|
|
120
121
|
);
|
|
121
122
|
};
|
|
122
123
|
export {
|
|
123
|
-
|
|
124
|
+
Bt as AvatarUpload
|
|
124
125
|
};
|
|
125
126
|
//# sourceMappingURL=components-avatar-uploader-avatar-uploader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-avatar-uploader-avatar-uploader.js","sources":["../src/components/avatar-uploader/avatar-uploader.tsx"],"sourcesContent":["import { cn } from \"@/index\";\nimport { useMemo } from \"react\";\nimport { useDropzone } from \"react-dropzone\";\nimport { BasicAvatar, type BasicAvatarProps } from \"../basic-avatar\";\nimport { Typography } from \"../ui/typography\";\n\ntype Props = {\n maxFiles?: number;\n src?: string;\n fullName: string;\n accept?: string[];\n avatarProps?: BasicAvatarProps;\n containerClassName?: string;\n onChange?: (src: string | null) => void;\n};\n\nconst DEFAULT_MAX_FILES = 1;\nconst DEFAULT_ACCEPT = [\".jpg\", \".png\"];\n\nexport const AvatarUpload = ({\n src,\n fullName,\n maxFiles = DEFAULT_MAX_FILES,\n accept = DEFAULT_ACCEPT,\n avatarProps,\n containerClassName,\n onChange,\n}: Props) => {\n const initials = useMemo(() => {\n const [firstName = \"\", lastName = \"\"] = fullName.split(\" \");\n const first = firstName.charAt(0);\n const last = lastName.charAt(0);\n\n return (first + last).toUpperCase() || \"?\";\n }, [fullName]);\n\n const { getRootProps, getInputProps } = useDropzone({\n accept: { \"image/*\": accept },\n maxFiles,\n onDrop: (files) => {\n if (files.length === 0) return;\n const previewUrl = URL.createObjectURL(files[0]);\n onChange?.(previewUrl);\n },\n });\n\n const removeAvatar = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n onChange?.(null);\n };\n\n return (\n <div\n {...getRootProps()}\n className={cn(\n `bg-info-new-bg flex h-18 w-18 cursor-pointer items-center justify-center\n overflow-hidden rounded-full transition-colors`,\n containerClassName,\n )}\n >\n <input {...getInputProps()} />\n {src ? (\n <BasicAvatar\n {...avatarProps}\n image={{\n src,\n }}\n initials={{ text: initials }}\n hasBadge\n onClick={removeAvatar}\n />\n ) : (\n <Typography\n variant=\"body-xxl-medium\"\n className=\"text-info-new-text flex items-center justify-center\"\n >\n {initials}\n </Typography>\n )}\n </div>\n );\n};\n\nexport type { Props as AvatarUploadProps };\n"],"names":["DEFAULT_MAX_FILES","DEFAULT_ACCEPT","AvatarUpload","src","fullName","maxFiles","accept","avatarProps","containerClassName","onChange","initials","useMemo","firstName","lastName","first","last","getRootProps","getInputProps","useDropzone","files","previewUrl","removeAvatar","e","jsxs","cn","jsx","BasicAvatar","Typography"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components-avatar-uploader-avatar-uploader.js","sources":["../src/components/avatar-uploader/avatar-uploader.tsx"],"sourcesContent":["import { cn } from \"@/index\";\nimport { useMemo } from \"react\";\nimport { useDropzone } from \"react-dropzone\";\nimport { BasicAvatar, type BasicAvatarProps } from \"../basic-avatar\";\nimport { Typography } from \"../ui/typography\";\n\ntype Props = {\n maxFiles?: number;\n src?: string;\n fullName: string;\n accept?: string[];\n avatarProps?: BasicAvatarProps;\n containerClassName?: string;\n onChange?: (src: string | null) => void;\n};\n\nconst DEFAULT_MAX_FILES = 1;\nconst DEFAULT_ACCEPT = [\".jpg\", \".png\"];\n\nexport const AvatarUpload = ({\n src,\n fullName,\n maxFiles = DEFAULT_MAX_FILES,\n accept = DEFAULT_ACCEPT,\n avatarProps,\n containerClassName,\n onChange,\n}: Props) => {\n const initials = useMemo(() => {\n const [firstName = \"\", lastName = \"\"] = fullName.split(\" \");\n const first = firstName.charAt(0);\n const last = lastName.charAt(0);\n\n return (first + last).toUpperCase() || \"?\";\n }, [fullName]);\n\n const { getRootProps, getInputProps } = useDropzone({\n accept: { \"image/*\": accept },\n maxFiles,\n onDrop: (files) => {\n if (files.length === 0) return;\n const previewUrl = URL.createObjectURL(files[0]);\n onChange?.(previewUrl);\n },\n });\n\n const removeAvatar = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n onChange?.(null);\n };\n\n return (\n <div\n {...getRootProps()}\n className={cn(\n `bg-info-new-bg flex h-18 w-18 cursor-pointer items-center justify-center\n overflow-hidden rounded-full transition-colors`,\n containerClassName,\n )}\n >\n <input {...getInputProps()} />\n {src ? (\n <BasicAvatar\n {...avatarProps}\n image={{\n src,\n }}\n initials={{ text: initials }}\n hasBadge\n onClick={removeAvatar}\n />\n ) : (\n <Typography\n variant=\"body-xxl-medium\"\n className=\"text-info-new-text flex items-center justify-center\"\n >\n {initials}\n </Typography>\n )}\n </div>\n );\n};\n\nexport type { Props as AvatarUploadProps };\n"],"names":["DEFAULT_MAX_FILES","DEFAULT_ACCEPT","AvatarUpload","src","fullName","maxFiles","accept","avatarProps","containerClassName","onChange","initials","useMemo","firstName","lastName","first","last","getRootProps","getInputProps","useDropzone","files","previewUrl","removeAvatar","e","jsxs","cn","jsx","BasicAvatar","Typography"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAMA,IAAoB,GACpBC,IAAiB,CAAC,QAAQ,MAAM,GAEzBC,KAAe,CAAC;AAAA,EAC3B,KAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAWL;AAAA,EACX,QAAAM,IAASL;AAAA,EACT,aAAAM;AAAA,EACA,oBAAAC;AAAA,EACA,UAAAC;AACF,MAAa;AACX,QAAMC,IAAWC,EAAQ,MAAM;AAC7B,UAAM,CAACC,IAAY,IAAIC,IAAW,EAAE,IAAIT,EAAS,MAAM,GAAG,GACpDU,IAAQF,EAAU,OAAO,CAAC,GAC1BG,IAAOF,EAAS,OAAO,CAAC;AAE9B,YAAQC,IAAQC,GAAM,YAAA,KAAiB;AAAA,EACzC,GAAG,CAACX,CAAQ,CAAC,GAEP,EAAE,cAAAY,GAAc,eAAAC,EAAA,IAAkBC,EAAY;AAAA,IAClD,QAAQ,EAAE,WAAWZ,EAAA;AAAA,IACrB,UAAAD;AAAA,IACA,QAAQ,CAACc,MAAU;AACjB,UAAIA,EAAM,WAAW,EAAG;AACxB,YAAMC,IAAa,IAAI,gBAAgBD,EAAM,CAAC,CAAC;AAC/C,MAAAV,IAAWW,CAAU;AAAA,IACvB;AAAA,EAAA,CACD,GAEKC,IAAe,CAACC,MAAwC;AAC5D,IAAAA,EAAE,gBAAA,GACFb,IAAW,IAAI;AAAA,EACjB;AAEA,SACE,gBAAAc;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGP,EAAA;AAAA,MACJ,WAAWQ;AAAA,QACT;AAAA;AAAA,QAEAhB;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAA,gBAAAiB,EAAC,SAAA,EAAO,GAAGR,EAAA,EAAc,CAAG;AAAA,QAC3Bd,IACC,gBAAAsB;AAAA,UAACC;AAAA,UAAA;AAAA,YACE,GAAGnB;AAAA,YACJ,OAAO;AAAA,cACL,KAAAJ;AAAA,YAAA;AAAA,YAEF,UAAU,EAAE,MAAMO,EAAA;AAAA,YAClB,UAAQ;AAAA,YACR,SAASW;AAAA,UAAA;AAAA,QAAA,IAGX,gBAAAI;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,WAAU;AAAA,YAET,UAAAjB;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -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";
|
|
@@ -62,63 +62,67 @@ import "phosphor-strokes-icons/icons/Phone";
|
|
|
62
62
|
import "phosphor-strokes-icons/icons/TelegramLogo";
|
|
63
63
|
import "phosphor-strokes-icons/icons/WhatsAppLogoFilled";
|
|
64
64
|
import "./components-input-phone-input-phone.js";
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
import "./components-card-info-card-info.styles.js";
|
|
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 = () => {
|
|
73
77
|
}
|
|
74
78
|
}) => {
|
|
75
|
-
const
|
|
79
|
+
const e = /* @__PURE__ */ a(
|
|
76
80
|
u,
|
|
77
81
|
{
|
|
78
|
-
...
|
|
79
|
-
className:
|
|
82
|
+
...o,
|
|
83
|
+
className: m("h-18 w-18", o?.className),
|
|
80
84
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ t(
|
|
82
86
|
x,
|
|
83
87
|
{
|
|
84
|
-
...
|
|
88
|
+
...p,
|
|
85
89
|
alt: "avatar",
|
|
86
|
-
className:
|
|
90
|
+
className: m("h-full w-full border-0", p?.className)
|
|
87
91
|
}
|
|
88
92
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
93
|
+
/* @__PURE__ */ t(v, { ...i, children: /* @__PURE__ */ t(
|
|
94
|
+
d,
|
|
91
95
|
{
|
|
92
96
|
variant: "body-xxl-medium",
|
|
93
|
-
className:
|
|
94
|
-
children:
|
|
97
|
+
className: m("text-info-new-text", r?.className),
|
|
98
|
+
children: y(r?.text ?? "")
|
|
95
99
|
}
|
|
96
100
|
) })
|
|
97
101
|
]
|
|
98
102
|
}
|
|
99
103
|
);
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
/* @__PURE__ */
|
|
104
|
+
return n ? /* @__PURE__ */ a("div", { className: "relative inline-block", children: [
|
|
105
|
+
e,
|
|
106
|
+
/* @__PURE__ */ t(
|
|
103
107
|
"div",
|
|
104
108
|
{
|
|
105
109
|
className: `text-primary-bg bg-primary-inverse-bg/50 absolute inset-0 flex
|
|
106
110
|
cursor-pointer items-center justify-center rounded-full opacity-0
|
|
107
111
|
transition-opacity hover:opacity-100`,
|
|
108
|
-
onClick: (
|
|
109
|
-
children: /* @__PURE__ */
|
|
110
|
-
|
|
112
|
+
onClick: (c) => c.stopPropagation(),
|
|
113
|
+
children: /* @__PURE__ */ t(
|
|
114
|
+
f,
|
|
111
115
|
{
|
|
112
|
-
...
|
|
116
|
+
...s,
|
|
113
117
|
type: "x",
|
|
114
|
-
onClick:
|
|
118
|
+
onClick: l
|
|
115
119
|
}
|
|
116
120
|
)
|
|
117
121
|
}
|
|
118
122
|
)
|
|
119
|
-
] }) :
|
|
123
|
+
] }) : e;
|
|
120
124
|
};
|
|
121
125
|
export {
|
|
122
|
-
|
|
126
|
+
$t as BasicAvatar
|
|
123
127
|
};
|
|
124
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","Icon"],"mappings":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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;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("./lib-utils.cjs"),i=require("./components-ui-card-card.cjs"),u=require("./components-ui-typography-typography.cjs");require("./components-ui-typography-typography.styles.cjs");const o=require("./components-card-info-card-info.styles.cjs"),l=({className:n,title:t,children:c,accent:a,size:s,...d})=>r.jsxs(i.Card,{className:e.cn(o.cardInfoVariants(),n?.card),...d,children:[r.jsx("div",{className:e.cn(o.cardInfoLeftBorderVariants({accent:a}),n?.borderLeft)}),r.jsx("div",{className:e.cn(o.cardInfoHeaderVariants({accent:a,size:s}),n?.headerBackground),children:r.jsx(u.Typography,{variant:"body-lg-semibold",children:t})}),r.jsx("div",{className:e.cn(o.cardInfoContentVariants(),n?.content),children:c})]});exports.CardInfo=l;
|
|
2
|
+
//# sourceMappingURL=components-card-info-card-info.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-card-info-card-info.cjs","sources":["../src/components/card-info/card-info.tsx"],"sourcesContent":["import type { VariantProps } from \"class-variance-authority\";\nimport { cn } from \"@/lib/utils\";\nimport { Card } from \"../ui/card\";\nimport { Typography } from \"../ui/typography\";\nimport {\n cardInfoContentVariants,\n cardInfoHeaderVariants,\n cardInfoLeftBorderVariants,\n cardInfoVariants,\n} from \"./card-info.styles\";\n\nexport interface CardInfoProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, \"title\" | \"className\">,\n VariantProps<typeof cardInfoHeaderVariants> {\n title: React.ReactNode;\n children: React.ReactNode;\n className?: {\n borderLeft?: string;\n headerBackground?: string;\n card?: string;\n content?: string;\n };\n}\n\nexport const CardInfo = ({\n className,\n title,\n children,\n accent,\n size,\n ...props\n}: CardInfoProps) => {\n return (\n <Card\n className={cn(cardInfoVariants(), className?.card)}\n {...props}\n >\n <div\n className={cn(cardInfoLeftBorderVariants({ accent }), className?.borderLeft)}\n />\n\n <div\n className={cn(\n cardInfoHeaderVariants({ accent, size }),\n className?.headerBackground,\n )}\n >\n <Typography variant=\"body-lg-semibold\">{title}</Typography>\n </div>\n\n <div className={cn(cardInfoContentVariants(), className?.content)}>{children}</div>\n </Card>\n );\n};\n"],"names":["CardInfo","className","title","children","accent","size","props","jsxs","Card","cn","cardInfoVariants","jsx","cardInfoLeftBorderVariants","cardInfoHeaderVariants","Typography","cardInfoContentVariants"],"mappings":"+WAyBaA,EAAW,CAAC,CACvB,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,OAAAC,EACA,KAAAC,EACA,GAAGC,CACL,IAEIC,EAAAA,KAACC,EAAAA,KAAA,CACC,UAAWC,EAAAA,GAAGC,EAAAA,mBAAoBT,GAAW,IAAI,EAChD,GAAGK,EAEJ,SAAA,CAAAK,EAAAA,IAAC,MAAA,CACC,UAAWF,EAAAA,GAAGG,EAAAA,2BAA2B,CAAE,OAAAR,EAAQ,EAAGH,GAAW,UAAU,CAAA,CAAA,EAG7EU,EAAAA,IAAC,MAAA,CACC,UAAWF,EAAAA,GACTI,yBAAuB,CAAE,OAAAT,EAAQ,KAAAC,EAAM,EACvCJ,GAAW,gBAAA,EAGb,SAAAU,EAAAA,IAACG,aAAA,CAAW,QAAQ,mBAAoB,SAAAZ,CAAA,CAAM,CAAA,CAAA,EAGhDS,MAAC,OAAI,UAAWF,EAAAA,GAAGM,EAAAA,0BAA2Bd,GAAW,OAAO,EAAI,SAAAE,CAAA,CAAS,CAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cn as a } from "./lib-utils.js";
|
|
3
|
+
import { Card as f } from "./components-ui-card-card.js";
|
|
4
|
+
import { Typography as c } from "./components-ui-typography-typography.js";
|
|
5
|
+
import "./components-ui-typography-typography.styles.js";
|
|
6
|
+
import { cardInfoLeftBorderVariants as s, cardInfoHeaderVariants as p, cardInfoContentVariants as l, cardInfoVariants as h } from "./components-card-info-card-info.styles.js";
|
|
7
|
+
const y = ({
|
|
8
|
+
className: r,
|
|
9
|
+
title: n,
|
|
10
|
+
children: t,
|
|
11
|
+
accent: d,
|
|
12
|
+
size: i,
|
|
13
|
+
...e
|
|
14
|
+
}) => /* @__PURE__ */ m(
|
|
15
|
+
f,
|
|
16
|
+
{
|
|
17
|
+
className: a(h(), r?.card),
|
|
18
|
+
...e,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ o(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
className: a(s({ accent: d }), r?.borderLeft)
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ o(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: a(
|
|
30
|
+
p({ accent: d, size: i }),
|
|
31
|
+
r?.headerBackground
|
|
32
|
+
),
|
|
33
|
+
children: /* @__PURE__ */ o(c, { variant: "body-lg-semibold", children: n })
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ o("div", { className: a(l(), r?.content), children: t })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
export {
|
|
41
|
+
y as CardInfo
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=components-card-info-card-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-card-info-card-info.js","sources":["../src/components/card-info/card-info.tsx"],"sourcesContent":["import type { VariantProps } from \"class-variance-authority\";\nimport { cn } from \"@/lib/utils\";\nimport { Card } from \"../ui/card\";\nimport { Typography } from \"../ui/typography\";\nimport {\n cardInfoContentVariants,\n cardInfoHeaderVariants,\n cardInfoLeftBorderVariants,\n cardInfoVariants,\n} from \"./card-info.styles\";\n\nexport interface CardInfoProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, \"title\" | \"className\">,\n VariantProps<typeof cardInfoHeaderVariants> {\n title: React.ReactNode;\n children: React.ReactNode;\n className?: {\n borderLeft?: string;\n headerBackground?: string;\n card?: string;\n content?: string;\n };\n}\n\nexport const CardInfo = ({\n className,\n title,\n children,\n accent,\n size,\n ...props\n}: CardInfoProps) => {\n return (\n <Card\n className={cn(cardInfoVariants(), className?.card)}\n {...props}\n >\n <div\n className={cn(cardInfoLeftBorderVariants({ accent }), className?.borderLeft)}\n />\n\n <div\n className={cn(\n cardInfoHeaderVariants({ accent, size }),\n className?.headerBackground,\n )}\n >\n <Typography variant=\"body-lg-semibold\">{title}</Typography>\n </div>\n\n <div className={cn(cardInfoContentVariants(), className?.content)}>{children}</div>\n </Card>\n );\n};\n"],"names":["CardInfo","className","title","children","accent","size","props","jsxs","Card","cn","cardInfoVariants","jsx","cardInfoLeftBorderVariants","cardInfoHeaderVariants","Typography","cardInfoContentVariants"],"mappings":";;;;;;AAyBO,MAAMA,IAAW,CAAC;AAAA,EACvB,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAGC,KAAoBT,GAAW,IAAI;AAAA,IAChD,GAAGK;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAK;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF,EAAGG,EAA2B,EAAE,QAAAR,GAAQ,GAAGH,GAAW,UAAU;AAAA,QAAA;AAAA,MAAA;AAAA,MAG7E,gBAAAU;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF;AAAA,YACTI,EAAuB,EAAE,QAAAT,GAAQ,MAAAC,GAAM;AAAA,YACvCJ,GAAW;AAAA,UAAA;AAAA,UAGb,UAAA,gBAAAU,EAACG,GAAA,EAAW,SAAQ,oBAAoB,UAAAZ,EAAA,CAAM;AAAA,QAAA;AAAA,MAAA;AAAA,MAGhD,gBAAAS,EAAC,SAAI,WAAWF,EAAGM,KAA2Bd,GAAW,OAAO,GAAI,UAAAE,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAAA;"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("class-variance-authority"),n=t.cva(`border-delicate-border bg-primary-bg text-primary-text relative overflow-hidden
|
|
2
|
+
rounded-xl border`),e=t.cva("absolute top-0 left-0 h-full w-1",{variants:{accent:{warning:"bg-warning-text",success:"bg-success-text",error:"bg-error-text",infoNew:"bg-info-new-text",contract:"bg-contract-text",negotiation:"bg-negotiation-text",invalid:"bg-invalid-text",proposal:"bg-proposal-text",followUp:"bg-follow-up-text",confidence:"bg-confidence-text"}},defaultVariants:{accent:"warning"}}),a=t.cva("flex items-center gap-2",{variants:{accent:{warning:"bg-warning-bg",success:"bg-success-bg",error:"bg-error-bg",infoNew:"bg-info-new-bg",contract:"bg-contract-bg",negotiation:"bg-negotiation-bg",invalid:"bg-invalid-bg",proposal:"bg-proposal-bg",followUp:"bg-follow-up-bg",confidence:"bg-confidence-bg"},size:{md:"px-4 py-3 pl-5"}},defaultVariants:{accent:"warning",size:"md"}}),r=t.cva("px-4 py-4 pl-5");exports.cardInfoContentVariants=r;exports.cardInfoHeaderVariants=a;exports.cardInfoLeftBorderVariants=e;exports.cardInfoVariants=n;
|
|
3
|
+
//# sourceMappingURL=components-card-info-card-info.styles.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-card-info-card-info.styles.cjs","sources":["../src/components/card-info/card-info.styles.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\n\nexport const cardInfoVariants = cva(\n `border-delicate-border bg-primary-bg text-primary-text relative overflow-hidden\n rounded-xl border`,\n);\n\nexport const cardInfoLeftBorderVariants = cva(\"absolute top-0 left-0 h-full w-1\", {\n variants: {\n accent: {\n warning: \"bg-warning-text\",\n success: \"bg-success-text\",\n error: \"bg-error-text\",\n infoNew: \"bg-info-new-text\",\n contract: \"bg-contract-text\",\n negotiation: \"bg-negotiation-text\",\n invalid: \"bg-invalid-text\",\n proposal: \"bg-proposal-text\",\n followUp: \"bg-follow-up-text\",\n confidence: \"bg-confidence-text\",\n },\n },\n defaultVariants: {\n accent: \"warning\",\n },\n});\n\nexport const cardInfoHeaderVariants = cva(\"flex items-center gap-2\", {\n variants: {\n accent: {\n warning: \"bg-warning-bg\",\n success: \"bg-success-bg\",\n error: \"bg-error-bg\",\n infoNew: \"bg-info-new-bg\",\n contract: \"bg-contract-bg\",\n negotiation: \"bg-negotiation-bg\",\n invalid: \"bg-invalid-bg\",\n proposal: \"bg-proposal-bg\",\n followUp: \"bg-follow-up-bg\",\n confidence: \"bg-confidence-bg\",\n },\n size: {\n md: \"px-4 py-3 pl-5\",\n },\n },\n defaultVariants: {\n accent: \"warning\",\n size: \"md\",\n },\n});\n\nexport const cardInfoContentVariants = cva(\"px-4 py-4 pl-5\");\n"],"names":["cardInfoVariants","cva","cardInfoLeftBorderVariants","cardInfoHeaderVariants","cardInfoContentVariants"],"mappings":"4HAEaA,EAAmBC,EAAAA,IAC9B;AAAA,oBAEF,EAEaC,EAA6BD,EAAAA,IAAI,mCAAoC,CAChF,SAAU,CACR,OAAQ,CACN,QAAS,kBACT,QAAS,kBACT,MAAO,gBACP,QAAS,mBACT,SAAU,mBACV,YAAa,sBACb,QAAS,kBACT,SAAU,mBACV,SAAU,oBACV,WAAY,oBAAA,CACd,EAEF,gBAAiB,CACf,OAAQ,SAAA,CAEZ,CAAC,EAEYE,EAAyBF,EAAAA,IAAI,0BAA2B,CACnE,SAAU,CACR,OAAQ,CACN,QAAS,gBACT,QAAS,gBACT,MAAO,cACP,QAAS,iBACT,SAAU,iBACV,YAAa,oBACb,QAAS,gBACT,SAAU,iBACV,SAAU,kBACV,WAAY,kBAAA,EAEd,KAAM,CACJ,GAAI,gBAAA,CACN,EAEF,gBAAiB,CACf,OAAQ,UACR,KAAM,IAAA,CAEV,CAAC,EAEYG,EAA0BH,EAAAA,IAAI,gBAAgB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { cva as t } from "class-variance-authority";
|
|
2
|
+
const e = t(
|
|
3
|
+
`border-delicate-border bg-primary-bg text-primary-text relative overflow-hidden
|
|
4
|
+
rounded-xl border`
|
|
5
|
+
), o = t("absolute top-0 left-0 h-full w-1", {
|
|
6
|
+
variants: {
|
|
7
|
+
accent: {
|
|
8
|
+
warning: "bg-warning-text",
|
|
9
|
+
success: "bg-success-text",
|
|
10
|
+
error: "bg-error-text",
|
|
11
|
+
infoNew: "bg-info-new-text",
|
|
12
|
+
contract: "bg-contract-text",
|
|
13
|
+
negotiation: "bg-negotiation-text",
|
|
14
|
+
invalid: "bg-invalid-text",
|
|
15
|
+
proposal: "bg-proposal-text",
|
|
16
|
+
followUp: "bg-follow-up-text",
|
|
17
|
+
confidence: "bg-confidence-text"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
accent: "warning"
|
|
22
|
+
}
|
|
23
|
+
}), r = t("flex items-center gap-2", {
|
|
24
|
+
variants: {
|
|
25
|
+
accent: {
|
|
26
|
+
warning: "bg-warning-bg",
|
|
27
|
+
success: "bg-success-bg",
|
|
28
|
+
error: "bg-error-bg",
|
|
29
|
+
infoNew: "bg-info-new-bg",
|
|
30
|
+
contract: "bg-contract-bg",
|
|
31
|
+
negotiation: "bg-negotiation-bg",
|
|
32
|
+
invalid: "bg-invalid-bg",
|
|
33
|
+
proposal: "bg-proposal-bg",
|
|
34
|
+
followUp: "bg-follow-up-bg",
|
|
35
|
+
confidence: "bg-confidence-bg"
|
|
36
|
+
},
|
|
37
|
+
size: {
|
|
38
|
+
md: "px-4 py-3 pl-5"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
accent: "warning",
|
|
43
|
+
size: "md"
|
|
44
|
+
}
|
|
45
|
+
}), a = t("px-4 py-4 pl-5");
|
|
46
|
+
export {
|
|
47
|
+
a as cardInfoContentVariants,
|
|
48
|
+
r as cardInfoHeaderVariants,
|
|
49
|
+
o as cardInfoLeftBorderVariants,
|
|
50
|
+
e as cardInfoVariants
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=components-card-info-card-info.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-card-info-card-info.styles.js","sources":["../src/components/card-info/card-info.styles.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\n\nexport const cardInfoVariants = cva(\n `border-delicate-border bg-primary-bg text-primary-text relative overflow-hidden\n rounded-xl border`,\n);\n\nexport const cardInfoLeftBorderVariants = cva(\"absolute top-0 left-0 h-full w-1\", {\n variants: {\n accent: {\n warning: \"bg-warning-text\",\n success: \"bg-success-text\",\n error: \"bg-error-text\",\n infoNew: \"bg-info-new-text\",\n contract: \"bg-contract-text\",\n negotiation: \"bg-negotiation-text\",\n invalid: \"bg-invalid-text\",\n proposal: \"bg-proposal-text\",\n followUp: \"bg-follow-up-text\",\n confidence: \"bg-confidence-text\",\n },\n },\n defaultVariants: {\n accent: \"warning\",\n },\n});\n\nexport const cardInfoHeaderVariants = cva(\"flex items-center gap-2\", {\n variants: {\n accent: {\n warning: \"bg-warning-bg\",\n success: \"bg-success-bg\",\n error: \"bg-error-bg\",\n infoNew: \"bg-info-new-bg\",\n contract: \"bg-contract-bg\",\n negotiation: \"bg-negotiation-bg\",\n invalid: \"bg-invalid-bg\",\n proposal: \"bg-proposal-bg\",\n followUp: \"bg-follow-up-bg\",\n confidence: \"bg-confidence-bg\",\n },\n size: {\n md: \"px-4 py-3 pl-5\",\n },\n },\n defaultVariants: {\n accent: \"warning\",\n size: \"md\",\n },\n});\n\nexport const cardInfoContentVariants = cva(\"px-4 py-4 pl-5\");\n"],"names":["cardInfoVariants","cva","cardInfoLeftBorderVariants","cardInfoHeaderVariants","cardInfoContentVariants"],"mappings":";AAEO,MAAMA,IAAmBC;AAAA,EAC9B;AAAA;AAEF,GAEaC,IAA6BD,EAAI,oCAAoC;AAAA,EAChF,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,MACT,OAAO;AAAA,MACP,SAAS;AAAA,MACT,UAAU;AAAA,MACV,aAAa;AAAA,MACb,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,EACd;AAAA,EAEF,iBAAiB;AAAA,IACf,QAAQ;AAAA,EAAA;AAEZ,CAAC,GAEYE,IAAyBF,EAAI,2BAA2B;AAAA,EACnE,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,MACT,OAAO;AAAA,MACP,SAAS;AAAA,MACT,UAAU;AAAA,MACV,aAAa;AAAA,MACb,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,IAEd,MAAM;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAEV,CAAC,GAEYG,IAA0BH,EAAI,gBAAgB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-card-info.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components-card-info.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -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 A=require("./lib-utils.cjs");require("class-variance-authority");require("./components-ui-badge-badge.styles.cjs");const h=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");require("./components-ui-card-card.cjs");const g=require("./components-ui-checkbox-checkbox.cjs");require("phosphor-strokes-icons/icons/CaretDown");const B=require("./hooks-usePopupControls.cjs");require("./calendar-PqChui7l.cjs");const q=require("./components-ui-icon-icon.cjs");require("phosphor-strokes-icons/icons");require("./components-ui-combobox-combobox.cjs");require("./components-ui-dialog-dialog.cjs");const o=require("react"),j=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 d=require("./components-ui-typography-typography.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 L=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");const k=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");const R=50,V=({data:s,errTexts:c,label:v="Нужно проверить для расчета",dataEmpty:_="Нет данных",btnAddText:C="Добавить свой пункт",onChange:u})=>{const p=o.useRef(null),{isOpened:N,openPopup:w}=B.usePopupControls(),[a,x]=o.useState(""),b=o.useMemo(()=>s.flatMap(r=>r.items.map(t=>t.value)),[s]),D=o.useMemo(()=>s.flatMap(r=>r.items.filter(t=>t.checked).map(t=>t.value)),[s]).length===b.length&&b.length>0,y=o.useCallback(()=>{setTimeout(()=>{p.current&&p.current.scrollTo({top:p.current.scrollHeight,behavior:"smooth"})},R)},[]),O=r=>{const t=s.map(n=>({...n,items:n.items.map(i=>({...i,checked:r}))}));u(t)},F=o.useCallback((r,t)=>{const n=s.map(i=>i.id!==r?i:{...i,items:i.items.map(l=>l.value===t?{...l,checked:!l.checked}:l)});u(n)},[s,u]),M=o.useCallback((r,t)=>{const n=s.map(i=>i.id!==r?i:{...i,items:i.items.filter(l=>l.value!==t)});u(n)},[s,u]),f=o.useCallback(()=>{if(a.trim().length===0){k.toast.error(c?.empty?.title,{description:c?.empty?.description});return}if(s[s.length-1].items.some(l=>l.value===a.trim())){k.toast.error(c?.add?.title,{description:c?.add?.description});return}const n={value:a.trim(),label:a.trim(),checked:!1},i=s.map((l,m)=>m===s.length-1?{...l,items:[...l.items,n]}:l);u(i),x(""),y()},[a,s,u,y,c?.empty?.title,c?.empty?.description,c?.add?.title,c?.add?.description]),S=o.useCallback(r=>{const t=r.target.value;x(t)},[]);return e.jsxs("div",{className:"border-delicate-border flex h-full max-w-200 flex-col rounded-xl border",children:[e.jsx("div",{className:"bg-primary-bg rounded-t-xl px-8 py-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(g.Checkbox,{id:"all",checked:D,onCheckedChange:O}),e.jsx(j.Label,{htmlFor:"all",children:e.jsx(d.Typography,{variant:"body-lg-semibold",className:"text-primary-text",children:v})})]})}),e.jsx("div",{ref:p,className:"bg-secondary-bg flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto",children:s.map(({id:r,name:t,items:n})=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`bg-tertiary-bg border-delicate-border border-t border-b px-8
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./brd-ui-kit.css');const e=require("react/jsx-runtime");;/* empty css */const A=require("./lib-utils.cjs");require("class-variance-authority");require("./components-ui-badge-badge.styles.cjs");const h=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");require("./components-ui-card-card.cjs");const g=require("./components-ui-checkbox-checkbox.cjs");require("phosphor-strokes-icons/icons/CaretDown");const B=require("./hooks-usePopupControls.cjs");require("./calendar-PqChui7l.cjs");const q=require("./components-ui-icon-icon.cjs");require("phosphor-strokes-icons/icons");require("./components-ui-combobox-combobox.cjs");require("./components-ui-dialog-dialog.cjs");const o=require("react"),j=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 d=require("./components-ui-typography-typography.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 L=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");const k=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 R=50,V=({data:s,errTexts:c,label:v="Нужно проверить для расчета",dataEmpty:_="Нет данных",btnAddText:C="Добавить свой пункт",onChange:u})=>{const p=o.useRef(null),{isOpened:N,openPopup:w}=B.usePopupControls(),[a,x]=o.useState(""),b=o.useMemo(()=>s.flatMap(r=>r.items.map(t=>t.value)),[s]),D=o.useMemo(()=>s.flatMap(r=>r.items.filter(t=>t.checked).map(t=>t.value)),[s]).length===b.length&&b.length>0,y=o.useCallback(()=>{setTimeout(()=>{p.current&&p.current.scrollTo({top:p.current.scrollHeight,behavior:"smooth"})},R)},[]),O=r=>{const t=s.map(n=>({...n,items:n.items.map(i=>({...i,checked:r}))}));u(t)},F=o.useCallback((r,t)=>{const n=s.map(i=>i.id!==r?i:{...i,items:i.items.map(l=>l.value===t?{...l,checked:!l.checked}:l)});u(n)},[s,u]),M=o.useCallback((r,t)=>{const n=s.map(i=>i.id!==r?i:{...i,items:i.items.filter(l=>l.value!==t)});u(n)},[s,u]),f=o.useCallback(()=>{if(a.trim().length===0){k.toast.error(c?.empty?.title,{description:c?.empty?.description});return}if(s[s.length-1].items.some(l=>l.value===a.trim())){k.toast.error(c?.add?.title,{description:c?.add?.description});return}const n={value:a.trim(),label:a.trim(),checked:!1},i=s.map((l,m)=>m===s.length-1?{...l,items:[...l.items,n]}:l);u(i),x(""),y()},[a,s,u,y,c?.empty?.title,c?.empty?.description,c?.add?.title,c?.add?.description]),S=o.useCallback(r=>{const t=r.target.value;x(t)},[]);return e.jsxs("div",{className:"border-delicate-border flex h-full max-w-200 flex-col rounded-xl border",children:[e.jsx("div",{className:"bg-primary-bg rounded-t-xl px-8 py-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(g.Checkbox,{id:"all",checked:D,onCheckedChange:O}),e.jsx(j.Label,{htmlFor:"all",children:e.jsx(d.Typography,{variant:"body-lg-semibold",className:"text-primary-text",children:v})})]})}),e.jsx("div",{ref:p,className:"bg-secondary-bg flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto",children:s.map(({id:r,name:t,items:n})=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`bg-tertiary-bg border-delicate-border border-t border-b px-8
|
|
2
2
|
py-2`,children:e.jsx(d.Typography,{variant:"body-sm-medium",className:"text-primary-text",children:t})}),n.length>0?n.map(({value:i,label:l,checked:m},I)=>{const T=I===n.length-1;return e.jsx("div",{className:A.cn(`${T&&"mb-2"}`),children:e.jsxs("div",{className:`bg-primary-bg hover:bg-primary-hover-bg flex
|
|
3
3
|
justify-between px-8 py-4`,children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(g.Checkbox,{id:`checkbox-${i}`,checked:m,onCheckedChange:()=>F(r,i)}),e.jsx(j.Label,{htmlFor:`checkbox-${i}`,children:e.jsx(d.Typography,{variant:"body-md-regular",className:"text-primary-text",children:l})})]}),e.jsx(h.Button,{variant:"circleGhost",onClick:()=>M(r,i),children:e.jsx(q.Icon,{type:"x",className:"text-secondary-text cursor-pointer"})})]})},i)}):null,n.length===0&&e.jsx(d.Typography,{className:"px-8 py-4 text-center",children:_})]},r))}),N?e.jsx(L.InputField,{value:a,onChange:S,placeholder:"Написать свой пункт",classes:{fieldset:"flex-none! overflow-hidden"},onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),f())},date:[{id:0,position:"inline-end",component:e.jsx(h.Button,{variant:"circleGhost",onClick:f,children:e.jsx(q.Icon,{type:"x-circle",className:"text-secondary-text rotate-45"})})}]}):e.jsxs(h.Button,{variant:"secondary",className:"border-delicate-border w-full overflow-hidden border-t",onClick:w,children:[e.jsx(d.Typography,{children:C}),e.jsx(q.Icon,{type:"plus",size:"small",className:"text-primary-text"})]})]})};exports.CheckboxGroup=V;
|
|
4
4
|
//# sourceMappingURL=components-checkbox-group-checkbox-group.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-checkbox-group-checkbox-group.cjs","sources":["../src/components/checkbox-group/checkbox-group.tsx"],"sourcesContent":["import {\n Button,\n Checkbox,\n cn,\n Icon,\n InputField,\n Label,\n sonner,\n Typography,\n usePopupControls,\n} from \"@/index\";\nimport { useCallback, useMemo, useRef, useState, type ChangeEvent } from \"react\";\nimport { Fragment } from \"react/jsx-runtime\";\n\ntype CheckboxGroupOptionItem = {\n value: string;\n label: string;\n checked: boolean;\n};\n\ntype CheckboxGroupOption = {\n id: number;\n name: string;\n items: CheckboxGroupOptionItem[];\n};\n\ntype Props = {\n data: CheckboxGroupOption[];\n onChange: (values: CheckboxGroupOption[]) => void;\n errTexts?: {\n add?: {\n title?: string;\n description?: string;\n };\n empty?: {\n title?: string;\n description?: string;\n };\n };\n label?: string;\n dataEmpty?: string;\n btnAddText?: string;\n};\n\nconst DEFAULT_MS_SCROLL_TO_BOTTOM = 50;\n\nexport const CheckboxGroup = ({\n data,\n errTexts,\n label = \"Нужно проверить для расчета\",\n dataEmpty = \"Нет данных\",\n btnAddText = \"Добавить свой пункт\",\n onChange,\n}: Props) => {\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n\n const { isOpened, openPopup: openAdd } = usePopupControls();\n const [value, setValue] = useState(\"\");\n\n const allValues = useMemo(() => {\n return data.flatMap((values) => values.items.map((item) => item.value));\n }, [data]);\n\n const selectedValues = useMemo(() => {\n return data.flatMap((values) =>\n values.items.filter((item) => item.checked).map((item) => item.value),\n );\n }, [data]);\n\n const isAllSelected =\n selectedValues.length === allValues.length && allValues.length > 0;\n\n const scrollToBottom = useCallback(() => {\n setTimeout(() => {\n if (scrollContainerRef.current) {\n scrollContainerRef.current.scrollTo({\n top: scrollContainerRef.current.scrollHeight,\n behavior: \"smooth\",\n });\n }\n }, DEFAULT_MS_SCROLL_TO_BOTTOM);\n }, []);\n\n const handleSelectAll = (checked: boolean) => {\n const newData = data.map((values) => ({\n ...values,\n items: values.items.map((item) => ({\n ...item,\n checked,\n })),\n }));\n onChange(newData);\n };\n\n const handleCheckboxChange = useCallback(\n (categoryId: number, itemValue: string) => {\n const newData = data.map((category) => {\n if (category.id !== categoryId) return category;\n return {\n ...category,\n items: category.items.map((item) =>\n item.value === itemValue ? { ...item, checked: !item.checked } : item,\n ),\n };\n });\n onChange(newData);\n },\n [data, onChange],\n );\n\n const handleOptionDelete = useCallback(\n (categoryId: number, itemValue: string) => {\n const newData = data.map((category) => {\n if (category.id !== categoryId) return category;\n return {\n ...category,\n items: category.items.filter((item) => item.value !== itemValue),\n };\n });\n onChange(newData);\n },\n [data, onChange],\n );\n\n const handleAddOption = useCallback(() => {\n if (value.trim().length === 0) {\n sonner.error(errTexts?.empty?.title, {\n description: errTexts?.empty?.description,\n });\n return;\n }\n\n const lastCategory = data[data.length - 1];\n\n const isExist = lastCategory.items.some((item) => item.value === value.trim());\n\n if (isExist) {\n sonner.error(errTexts?.add?.title, {\n description: errTexts?.add?.description,\n });\n return;\n }\n\n const newItem: CheckboxGroupOptionItem = {\n value: value.trim(),\n label: value.trim(),\n checked: false,\n };\n\n const newData = data.map((values, index) => {\n if (index === data.length - 1) {\n return {\n ...values,\n items: [...values.items, newItem],\n };\n }\n return values;\n });\n\n onChange(newData);\n setValue(\"\");\n scrollToBottom();\n }, [\n value,\n data,\n onChange,\n scrollToBottom,\n errTexts?.empty?.title,\n errTexts?.empty?.description,\n errTexts?.add?.title,\n errTexts?.add?.description,\n ]);\n\n const handleChangeValue = useCallback((e: ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value;\n setValue(value);\n }, []);\n\n return (\n <div\n className=\"border-delicate-border flex h-full max-w-200 flex-col rounded-xl border\"\n >\n <div className=\"bg-primary-bg rounded-t-xl px-8 py-6\">\n <div className=\"flex items-center gap-4\">\n <Checkbox\n id=\"all\"\n checked={isAllSelected}\n onCheckedChange={handleSelectAll}\n />\n <Label htmlFor=\"all\">\n <Typography\n variant=\"body-lg-semibold\"\n className=\"text-primary-text\"\n >\n {label}\n </Typography>\n </Label>\n </div>\n </div>\n\n <div\n ref={scrollContainerRef}\n className=\"bg-secondary-bg flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto\"\n >\n {data.map(({ id, name, items }) => {\n return (\n <Fragment key={id}>\n <div\n className=\"bg-tertiary-bg border-delicate-border border-t border-b px-8\n py-2\"\n >\n <Typography\n variant=\"body-sm-medium\"\n className=\"text-primary-text\"\n >\n {name}\n </Typography>\n </div>\n\n {items.length > 0\n ? items.map(({ value, label, checked }, index) => {\n const lastItem = index === items.length - 1;\n\n return (\n <div\n key={value}\n className={cn(`${lastItem && \"mb-2\"}`)}\n >\n <div\n className=\"bg-primary-bg hover:bg-primary-hover-bg flex\n justify-between px-8 py-4\"\n >\n <div className=\"flex items-center gap-4\">\n <Checkbox\n id={`checkbox-${value}`}\n checked={checked}\n onCheckedChange={() => handleCheckboxChange(id, value)}\n />\n <Label htmlFor={`checkbox-${value}`}>\n <Typography\n variant=\"body-md-regular\"\n className=\"text-primary-text\"\n >\n {label}\n </Typography>\n </Label>\n </div>\n\n <Button\n variant=\"circleGhost\"\n onClick={() => handleOptionDelete(id, value)}\n >\n <Icon\n type=\"x\"\n className=\"text-secondary-text cursor-pointer\"\n />\n </Button>\n </div>\n </div>\n );\n })\n : null}\n {items.length === 0 && (\n <Typography className=\"px-8 py-4 text-center\">{dataEmpty}</Typography>\n )}\n </Fragment>\n );\n })}\n </div>\n\n {isOpened ? (\n <InputField\n value={value}\n onChange={handleChangeValue}\n placeholder=\"Написать свой пункт\"\n classes={{\n fieldset: \"flex-none! overflow-hidden\",\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n handleAddOption();\n }\n }}\n date={[\n {\n id: 0,\n position: \"inline-end\",\n component: (\n <Button\n variant=\"circleGhost\"\n onClick={handleAddOption}\n >\n <Icon\n type=\"x-circle\"\n className=\"text-secondary-text rotate-45\"\n />\n </Button>\n ),\n },\n ]}\n />\n ) : (\n <Button\n variant=\"secondary\"\n className=\"border-delicate-border w-full overflow-hidden border-t\"\n onClick={openAdd}\n >\n <Typography>{btnAddText}</Typography>\n <Icon\n type=\"plus\"\n size=\"small\"\n className=\"text-primary-text\"\n />\n </Button>\n )}\n </div>\n );\n};\n\nexport type { CheckboxGroupOption, CheckboxGroupOptionItem, Props as CheckboxGroupProps };\n"],"names":["DEFAULT_MS_SCROLL_TO_BOTTOM","CheckboxGroup","data","errTexts","label","dataEmpty","btnAddText","onChange","scrollContainerRef","useRef","isOpened","openAdd","usePopupControls","value","setValue","useState","allValues","useMemo","values","item","isAllSelected","scrollToBottom","useCallback","handleSelectAll","checked","newData","handleCheckboxChange","categoryId","itemValue","category","handleOptionDelete","handleAddOption","sonner","newItem","index","handleChangeValue","e","jsxs","jsx","Checkbox","Label","Typography","id","name","items","Fragment","lastItem","cn","Button","Icon","InputField"],"mappings":"8rGA4CA,MAAMA,EAA8B,GAEvBC,EAAgB,CAAC,CAC5B,KAAAC,EACA,SAAAC,EACA,MAAAC,EAAQ,8BACR,UAAAC,EAAY,aACZ,WAAAC,EAAa,sBACb,SAAAC,CACF,IAAa,CACX,MAAMC,EAAqBC,EAAAA,OAAuB,IAAI,EAEhD,CAAE,SAAAC,EAAU,UAAWC,CAAA,EAAYC,EAAAA,iBAAA,EACnC,CAACC,EAAOC,CAAQ,EAAIC,EAAAA,SAAS,EAAE,EAE/BC,EAAYC,EAAAA,QAAQ,IACjBf,EAAK,QAASgB,GAAWA,EAAO,MAAM,IAAKC,GAASA,EAAK,KAAK,CAAC,EACrE,CAACjB,CAAI,CAAC,EAQHkB,EANiBH,EAAAA,QAAQ,IACtBf,EAAK,QAASgB,GACnBA,EAAO,MAAM,OAAQC,GAASA,EAAK,OAAO,EAAE,IAAKA,GAASA,EAAK,KAAK,CAAA,EAErE,CAACjB,CAAI,CAAC,EAGQ,SAAWc,EAAU,QAAUA,EAAU,OAAS,EAE7DK,EAAiBC,EAAAA,YAAY,IAAM,CACvC,WAAW,IAAM,CACXd,EAAmB,SACrBA,EAAmB,QAAQ,SAAS,CAClC,IAAKA,EAAmB,QAAQ,aAChC,SAAU,QAAA,CACX,CAEL,EAAGR,CAA2B,CAChC,EAAG,CAAA,CAAE,EAECuB,EAAmBC,GAAqB,CAC5C,MAAMC,EAAUvB,EAAK,IAAKgB,IAAY,CACpC,GAAGA,EACH,MAAOA,EAAO,MAAM,IAAKC,IAAU,CACjC,GAAGA,EACH,QAAAK,CAAA,EACA,CAAA,EACF,EACFjB,EAASkB,CAAO,CAClB,EAEMC,EAAuBJ,EAAAA,YAC3B,CAACK,EAAoBC,IAAsB,CACzC,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AU,mBAAA,CAAA,CACZ,CAAA,CAAA,CACF,CAAA,CAAA,CAIR"}
|
|
1
|
+
{"version":3,"file":"components-checkbox-group-checkbox-group.cjs","sources":["../src/components/checkbox-group/checkbox-group.tsx"],"sourcesContent":["import {\n Button,\n Checkbox,\n cn,\n Icon,\n InputField,\n Label,\n sonner,\n Typography,\n usePopupControls,\n} from \"@/index\";\nimport { useCallback, useMemo, useRef, useState, type ChangeEvent } from \"react\";\nimport { Fragment } from \"react/jsx-runtime\";\n\ntype CheckboxGroupOptionItem = {\n value: string;\n label: string;\n checked: boolean;\n};\n\ntype CheckboxGroupOption = {\n id: number;\n name: string;\n items: CheckboxGroupOptionItem[];\n};\n\ntype Props = {\n data: CheckboxGroupOption[];\n onChange: (values: CheckboxGroupOption[]) => void;\n errTexts?: {\n add?: {\n title?: string;\n description?: string;\n };\n empty?: {\n title?: string;\n description?: string;\n };\n };\n label?: string;\n dataEmpty?: string;\n btnAddText?: string;\n};\n\nconst DEFAULT_MS_SCROLL_TO_BOTTOM = 50;\n\nexport const CheckboxGroup = ({\n data,\n errTexts,\n label = \"Нужно проверить для расчета\",\n dataEmpty = \"Нет данных\",\n btnAddText = \"Добавить свой пункт\",\n onChange,\n}: Props) => {\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n\n const { isOpened, openPopup: openAdd } = usePopupControls();\n const [value, setValue] = useState(\"\");\n\n const allValues = useMemo(() => {\n return data.flatMap((values) => values.items.map((item) => item.value));\n }, [data]);\n\n const selectedValues = useMemo(() => {\n return data.flatMap((values) =>\n values.items.filter((item) => item.checked).map((item) => item.value),\n );\n }, [data]);\n\n const isAllSelected =\n selectedValues.length === allValues.length && allValues.length > 0;\n\n const scrollToBottom = useCallback(() => {\n setTimeout(() => {\n if (scrollContainerRef.current) {\n scrollContainerRef.current.scrollTo({\n top: scrollContainerRef.current.scrollHeight,\n behavior: \"smooth\",\n });\n }\n }, DEFAULT_MS_SCROLL_TO_BOTTOM);\n }, []);\n\n const handleSelectAll = (checked: boolean) => {\n const newData = data.map((values) => ({\n ...values,\n items: values.items.map((item) => ({\n ...item,\n checked,\n })),\n }));\n onChange(newData);\n };\n\n const handleCheckboxChange = useCallback(\n (categoryId: number, itemValue: string) => {\n const newData = data.map((category) => {\n if (category.id !== categoryId) return category;\n return {\n ...category,\n items: category.items.map((item) =>\n item.value === itemValue ? { ...item, checked: !item.checked } : item,\n ),\n };\n });\n onChange(newData);\n },\n [data, onChange],\n );\n\n const handleOptionDelete = useCallback(\n (categoryId: number, itemValue: string) => {\n const newData = data.map((category) => {\n if (category.id !== categoryId) return category;\n return {\n ...category,\n items: category.items.filter((item) => item.value !== itemValue),\n };\n });\n onChange(newData);\n },\n [data, onChange],\n );\n\n const handleAddOption = useCallback(() => {\n if (value.trim().length === 0) {\n sonner.error(errTexts?.empty?.title, {\n description: errTexts?.empty?.description,\n });\n return;\n }\n\n const lastCategory = data[data.length - 1];\n\n const isExist = lastCategory.items.some((item) => item.value === value.trim());\n\n if (isExist) {\n sonner.error(errTexts?.add?.title, {\n description: errTexts?.add?.description,\n });\n return;\n }\n\n const newItem: CheckboxGroupOptionItem = {\n value: value.trim(),\n label: value.trim(),\n checked: false,\n };\n\n const newData = data.map((values, index) => {\n if (index === data.length - 1) {\n return {\n ...values,\n items: [...values.items, newItem],\n };\n }\n return values;\n });\n\n onChange(newData);\n setValue(\"\");\n scrollToBottom();\n }, [\n value,\n data,\n onChange,\n scrollToBottom,\n errTexts?.empty?.title,\n errTexts?.empty?.description,\n errTexts?.add?.title,\n errTexts?.add?.description,\n ]);\n\n const handleChangeValue = useCallback((e: ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value;\n setValue(value);\n }, []);\n\n return (\n <div\n className=\"border-delicate-border flex h-full max-w-200 flex-col rounded-xl border\"\n >\n <div className=\"bg-primary-bg rounded-t-xl px-8 py-6\">\n <div className=\"flex items-center gap-4\">\n <Checkbox\n id=\"all\"\n checked={isAllSelected}\n onCheckedChange={handleSelectAll}\n />\n <Label htmlFor=\"all\">\n <Typography\n variant=\"body-lg-semibold\"\n className=\"text-primary-text\"\n >\n {label}\n </Typography>\n </Label>\n </div>\n </div>\n\n <div\n ref={scrollContainerRef}\n className=\"bg-secondary-bg flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto\"\n >\n {data.map(({ id, name, items }) => {\n return (\n <Fragment key={id}>\n <div\n className=\"bg-tertiary-bg border-delicate-border border-t border-b px-8\n py-2\"\n >\n <Typography\n variant=\"body-sm-medium\"\n className=\"text-primary-text\"\n >\n {name}\n </Typography>\n </div>\n\n {items.length > 0\n ? items.map(({ value, label, checked }, index) => {\n const lastItem = index === items.length - 1;\n\n return (\n <div\n key={value}\n className={cn(`${lastItem && \"mb-2\"}`)}\n >\n <div\n className=\"bg-primary-bg hover:bg-primary-hover-bg flex\n justify-between px-8 py-4\"\n >\n <div className=\"flex items-center gap-4\">\n <Checkbox\n id={`checkbox-${value}`}\n checked={checked}\n onCheckedChange={() => handleCheckboxChange(id, value)}\n />\n <Label htmlFor={`checkbox-${value}`}>\n <Typography\n variant=\"body-md-regular\"\n className=\"text-primary-text\"\n >\n {label}\n </Typography>\n </Label>\n </div>\n\n <Button\n variant=\"circleGhost\"\n onClick={() => handleOptionDelete(id, value)}\n >\n <Icon\n type=\"x\"\n className=\"text-secondary-text cursor-pointer\"\n />\n </Button>\n </div>\n </div>\n );\n })\n : null}\n {items.length === 0 && (\n <Typography className=\"px-8 py-4 text-center\">{dataEmpty}</Typography>\n )}\n </Fragment>\n );\n })}\n </div>\n\n {isOpened ? (\n <InputField\n value={value}\n onChange={handleChangeValue}\n placeholder=\"Написать свой пункт\"\n classes={{\n fieldset: \"flex-none! overflow-hidden\",\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n handleAddOption();\n }\n }}\n date={[\n {\n id: 0,\n position: \"inline-end\",\n component: (\n <Button\n variant=\"circleGhost\"\n onClick={handleAddOption}\n >\n <Icon\n type=\"x-circle\"\n className=\"text-secondary-text rotate-45\"\n />\n </Button>\n ),\n },\n ]}\n />\n ) : (\n <Button\n variant=\"secondary\"\n className=\"border-delicate-border w-full overflow-hidden border-t\"\n onClick={openAdd}\n >\n <Typography>{btnAddText}</Typography>\n <Icon\n type=\"plus\"\n size=\"small\"\n className=\"text-primary-text\"\n />\n </Button>\n )}\n </div>\n );\n};\n\nexport type { CheckboxGroupOption, CheckboxGroupOptionItem, Props as CheckboxGroupProps };\n"],"names":["DEFAULT_MS_SCROLL_TO_BOTTOM","CheckboxGroup","data","errTexts","label","dataEmpty","btnAddText","onChange","scrollContainerRef","useRef","isOpened","openAdd","usePopupControls","value","setValue","useState","allValues","useMemo","values","item","isAllSelected","scrollToBottom","useCallback","handleSelectAll","checked","newData","handleCheckboxChange","categoryId","itemValue","category","handleOptionDelete","handleAddOption","sonner","newItem","index","handleChangeValue","e","jsxs","jsx","Checkbox","Label","Typography","id","name","items","Fragment","lastItem","cn","Button","Icon","InputField"],"mappings":"qvGA4CA,MAAMA,EAA8B,GAEvBC,EAAgB,CAAC,CAC5B,KAAAC,EACA,SAAAC,EACA,MAAAC,EAAQ,8BACR,UAAAC,EAAY,aACZ,WAAAC,EAAa,sBACb,SAAAC,CACF,IAAa,CACX,MAAMC,EAAqBC,EAAAA,OAAuB,IAAI,EAEhD,CAAE,SAAAC,EAAU,UAAWC,CAAA,EAAYC,EAAAA,iBAAA,EACnC,CAACC,EAAOC,CAAQ,EAAIC,EAAAA,SAAS,EAAE,EAE/BC,EAAYC,EAAAA,QAAQ,IACjBf,EAAK,QAASgB,GAAWA,EAAO,MAAM,IAAKC,GAASA,EAAK,KAAK,CAAC,EACrE,CAACjB,CAAI,CAAC,EAQHkB,EANiBH,EAAAA,QAAQ,IACtBf,EAAK,QAASgB,GACnBA,EAAO,MAAM,OAAQC,GAASA,EAAK,OAAO,EAAE,IAAKA,GAASA,EAAK,KAAK,CAAA,EAErE,CAACjB,CAAI,CAAC,EAGQ,SAAWc,EAAU,QAAUA,EAAU,OAAS,EAE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eAAA,EACFL,EAAA,EAEJ,EACA,KAAM,CACJ,CACE,GAAI,EACJ,SAAU,aACV,UACEO,EAAAA,IAACU,EAAAA,OAAA,CACC,QAAQ,cACR,QAASjB,EAET,SAAAO,EAAAA,IAACW,EAAAA,KAAA,CACC,KAAK,WACL,UAAU,+BAAA,CAAA,CACZ,CAAA,CACF,CAEJ,CACF,CAAA,EAGFZ,EAAAA,KAACW,EAAAA,OAAA,CACC,QAAQ,YACR,UAAU,yDACV,QAASrC,EAET,SAAA,CAAA2B,EAAAA,IAACG,EAAAA,YAAY,SAAAnC,CAAA,CAAW,EACxBgC,EAAAA,IAACW,EAAAA,KAAA,CACC,KAAK,OACL,KAAK,QACL,UAAU,mBAAA,CAAA,CACZ,CAAA,CAAA,CACF,CAAA,CAAA,CAIR"}
|
|
@@ -63,7 +63,8 @@ import "phosphor-strokes-icons/icons/Phone";
|
|
|
63
63
|
import "phosphor-strokes-icons/icons/TelegramLogo";
|
|
64
64
|
import "phosphor-strokes-icons/icons/WhatsAppLogoFilled";
|
|
65
65
|
import "./components-input-phone-input-phone.js";
|
|
66
|
-
|
|
66
|
+
import "./components-card-info-card-info.styles.js";
|
|
67
|
+
const H = 50, ot = ({
|
|
67
68
|
data: i,
|
|
68
69
|
errTexts: n,
|
|
69
70
|
label: D = "Нужно проверить для расчета",
|
|
@@ -300,6 +301,6 @@ const H = 50, rt = ({
|
|
|
300
301
|
);
|
|
301
302
|
};
|
|
302
303
|
export {
|
|
303
|
-
|
|
304
|
+
ot as CheckboxGroup
|
|
304
305
|
};
|
|
305
306
|
//# sourceMappingURL=components-checkbox-group-checkbox-group.js.map
|