brd-ui-kit 0.1.83 → 0.1.85
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/{calendar-Cf3VkgyX.js → calendar-B78l3uF9.js} +2 -2
- package/dist/{calendar-Cf3VkgyX.js.map → calendar-B78l3uF9.js.map} +1 -1
- package/dist/calendar-BClkfQSD.cjs +2 -0
- package/dist/{calendar-DvDG9hIB.cjs.map → calendar-BClkfQSD.cjs.map} +1 -1
- package/dist/{calendar-locale-Br6M-e1P.cjs → calendar-locale-CbU8VmD3.cjs} +2 -2
- package/dist/{calendar-locale-Br6M-e1P.cjs.map → calendar-locale-CbU8VmD3.cjs.map} +1 -1
- package/dist/{calendar-locale-DivjTEYg.js → calendar-locale-CtuBfQOO.js} +2 -2
- package/dist/{calendar-locale-DivjTEYg.js.map → calendar-locale-CtuBfQOO.js.map} +1 -1
- package/dist/components/approval-log/approval-log.d.ts +1 -1
- package/dist/components/approval-log/index.d.ts +1 -1
- package/dist/components/card-info/card-info.d.ts +3 -2
- package/dist/components/icons/ArrowCounterClockwise.d.ts +1 -1
- package/dist/components/icons/BoundingBox.d.ts +1 -1
- package/dist/components/icons/Briefcase.d.ts +1 -1
- package/dist/components/icons/Building.d.ts +1 -1
- package/dist/components/icons/Buildings.d.ts +1 -1
- package/dist/components/icons/CaretDown.d.ts +1 -1
- package/dist/components/icons/CaretLeft.d.ts +1 -1
- package/dist/components/icons/CaretRight.d.ts +1 -1
- package/dist/components/icons/CaretUp.d.ts +1 -1
- package/dist/components/icons/CaretUpDown.d.ts +1 -1
- package/dist/components/icons/ChartLine.d.ts +1 -1
- package/dist/components/icons/Check.d.ts +1 -1
- package/dist/components/icons/CheckCircle.d.ts +1 -1
- package/dist/components/icons/Clock.d.ts +1 -1
- package/dist/components/icons/CreditCard.d.ts +1 -1
- package/dist/components/icons/DotsThree.d.ts +1 -1
- package/dist/components/icons/DownloadSimple.d.ts +1 -1
- package/dist/components/icons/EnvelopeSimple.d.ts +1 -1
- package/dist/components/icons/Eye.d.ts +1 -1
- package/dist/components/icons/EyeSlash.d.ts +1 -1
- package/dist/components/icons/FileText.d.ts +1 -1
- package/dist/components/icons/Folder.d.ts +1 -1
- package/dist/components/icons/Funnel.d.ts +1 -1
- package/dist/components/icons/Gear.d.ts +1 -1
- package/dist/components/icons/Info.d.ts +1 -1
- package/dist/components/icons/LockKey.d.ts +1 -1
- package/dist/components/icons/MagnifyingGlass.d.ts +1 -1
- package/dist/components/icons/MaxLogo.d.ts +1 -1
- package/dist/components/icons/Package.d.ts +1 -1
- package/dist/components/icons/Pencil.d.ts +1 -1
- package/dist/components/icons/Phone.d.ts +1 -1
- package/dist/components/icons/Plus.d.ts +1 -1
- package/dist/components/icons/PresentationChart.d.ts +1 -1
- package/dist/components/icons/SpinnerGap.d.ts +1 -1
- package/dist/components/icons/TelegramLogo.d.ts +1 -1
- package/dist/components/icons/Trash.d.ts +1 -1
- package/dist/components/icons/UserCircleGear.d.ts +1 -1
- package/dist/components/icons/Users.d.ts +1 -1
- package/dist/components/icons/UsersFour.d.ts +1 -1
- package/dist/components/icons/Warning.d.ts +1 -1
- package/dist/components/icons/WarningCircle.d.ts +1 -1
- package/dist/components/icons/WhatsAppLogoFilled.d.ts +1 -1
- package/dist/components/icons/Wrench.d.ts +1 -1
- package/dist/components/icons/X.d.ts +1 -1
- package/dist/components/icons/XCircle.d.ts +1 -1
- package/dist/components/icons/index.d.ts +46 -46
- package/dist/components/icons/stroke-icon.d.ts +1 -1
- package/dist/components/story-drawer/index.d.ts +1 -1
- package/dist/components/story-drawer/story-drawer.d.ts +2 -2
- package/dist/components/ui/icon/icon-map.d.ts +1 -1
- package/dist/components/ui/icon/icon.d.ts +2 -2
- package/dist/components-app-pagination-app-pagination.cjs +1 -1
- package/dist/components-app-pagination-app-pagination.cjs.map +1 -1
- package/dist/components-app-pagination-app-pagination.js +2 -2
- package/dist/components-app-sidebar-app-sidebar.cjs +1 -1
- package/dist/components-app-sidebar-app-sidebar.cjs.map +1 -1
- package/dist/components-app-sidebar-app-sidebar.js +1 -1
- package/dist/components-approval-log-approval-log.cjs +1 -1
- package/dist/components-approval-log-approval-log.cjs.map +1 -1
- package/dist/components-approval-log-approval-log.js +21 -21
- package/dist/components-approval-log-approval-log.js.map +1 -1
- 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 +21 -21
- package/dist/components-basic-avatar-basic-avatar.cjs +1 -1
- package/dist/components-basic-avatar-basic-avatar.cjs.map +1 -1
- package/dist/components-basic-avatar-basic-avatar.js +21 -21
- package/dist/components-card-info-card-info.cjs +1 -1
- package/dist/components-card-info-card-info.cjs.map +1 -1
- package/dist/components-card-info-card-info.js +15 -14
- package/dist/components-card-info-card-info.js.map +1 -1
- 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 +21 -21
- package/dist/components-data-table-data-table-actions-column.cjs +1 -1
- package/dist/components-data-table-data-table-actions-column.cjs.map +1 -1
- package/dist/components-data-table-data-table-actions-column.js +1 -1
- package/dist/components-data-table-data-table-column-visibility.cjs +1 -1
- package/dist/components-data-table-data-table-column-visibility.cjs.map +1 -1
- package/dist/components-data-table-data-table-column-visibility.js +1 -1
- package/dist/components-data-table-data-table-row-actions-column.cjs +1 -1
- package/dist/components-data-table-data-table-row-actions-column.cjs.map +1 -1
- package/dist/components-data-table-data-table-row-actions-column.js +1 -1
- package/dist/components-files-uploader-files-uploader.cjs +1 -1
- package/dist/components-files-uploader-files-uploader.cjs.map +1 -1
- package/dist/components-files-uploader-files-uploader.js +3 -3
- package/dist/components-icons-ArrowCounterClockwise.cjs +1 -1
- package/dist/components-icons-ArrowCounterClockwise.js +1 -1
- package/dist/components-icons-BoundingBox.cjs +1 -1
- package/dist/components-icons-BoundingBox.js +1 -1
- package/dist/components-icons-Briefcase.cjs +1 -1
- package/dist/components-icons-Briefcase.js +1 -1
- package/dist/components-icons-Building.cjs +1 -1
- package/dist/components-icons-Building.js +1 -1
- package/dist/components-icons-Buildings.cjs +1 -1
- package/dist/components-icons-Buildings.js +1 -1
- package/dist/components-icons-CaretDown.cjs +1 -1
- package/dist/components-icons-CaretDown.js +1 -1
- package/dist/components-icons-CaretLeft.cjs +1 -1
- package/dist/components-icons-CaretLeft.js +1 -1
- package/dist/components-icons-CaretRight.cjs +1 -1
- package/dist/components-icons-CaretRight.js +1 -1
- package/dist/components-icons-CaretUp.cjs +1 -1
- package/dist/components-icons-CaretUp.js +1 -1
- package/dist/components-icons-CaretUpDown.cjs +1 -1
- package/dist/components-icons-CaretUpDown.js +1 -1
- package/dist/components-icons-ChartLine.cjs +1 -1
- package/dist/components-icons-ChartLine.js +1 -1
- package/dist/components-icons-Check.cjs +1 -1
- package/dist/components-icons-Check.js +1 -1
- package/dist/components-icons-CheckCircle.cjs +1 -1
- package/dist/components-icons-CheckCircle.js +1 -1
- package/dist/components-icons-Clock.cjs +1 -1
- package/dist/components-icons-Clock.js +1 -1
- package/dist/components-icons-CreditCard.cjs +1 -1
- package/dist/components-icons-CreditCard.js +1 -1
- package/dist/components-icons-DotsThree.cjs +1 -1
- package/dist/components-icons-DotsThree.js +1 -1
- package/dist/components-icons-DownloadSimple.cjs +1 -1
- package/dist/components-icons-DownloadSimple.js +1 -1
- package/dist/components-icons-EnvelopeSimple.cjs +1 -1
- package/dist/components-icons-EnvelopeSimple.js +1 -1
- package/dist/components-icons-Eye.cjs +1 -1
- package/dist/components-icons-Eye.js +1 -1
- package/dist/components-icons-EyeSlash.cjs +1 -1
- package/dist/components-icons-EyeSlash.js +1 -1
- package/dist/components-icons-FileText.cjs +1 -1
- package/dist/components-icons-FileText.js +1 -1
- package/dist/components-icons-Folder.cjs +1 -1
- package/dist/components-icons-Folder.js +1 -1
- package/dist/components-icons-Funnel.cjs +1 -1
- package/dist/components-icons-Funnel.js +1 -1
- package/dist/components-icons-Gear.cjs +1 -1
- package/dist/components-icons-Gear.js +1 -1
- package/dist/components-icons-Info.cjs +1 -1
- package/dist/components-icons-Info.js +1 -1
- package/dist/components-icons-LockKey.cjs +1 -1
- package/dist/components-icons-LockKey.js +1 -1
- package/dist/components-icons-MagnifyingGlass.cjs +1 -1
- package/dist/components-icons-MagnifyingGlass.js +1 -1
- package/dist/components-icons-MaxLogo.cjs +1 -1
- package/dist/components-icons-MaxLogo.js +1 -1
- package/dist/components-icons-Package.cjs +1 -1
- package/dist/components-icons-Package.js +1 -1
- package/dist/components-icons-Pencil.cjs +1 -1
- package/dist/components-icons-Pencil.js +1 -1
- package/dist/components-icons-Phone.cjs +1 -1
- package/dist/components-icons-Phone.js +1 -1
- package/dist/components-icons-Plus.cjs +1 -1
- package/dist/components-icons-Plus.js +1 -1
- package/dist/components-icons-PresentationChart.cjs +1 -1
- package/dist/components-icons-PresentationChart.js +1 -1
- package/dist/components-icons-SpinnerGap.cjs +1 -1
- package/dist/components-icons-SpinnerGap.js +1 -1
- package/dist/components-icons-TelegramLogo.cjs +1 -1
- package/dist/components-icons-TelegramLogo.js +1 -1
- package/dist/components-icons-Trash.cjs +1 -1
- package/dist/components-icons-Trash.js +1 -1
- package/dist/components-icons-UserCircleGear.cjs +1 -1
- package/dist/components-icons-UserCircleGear.js +1 -1
- package/dist/components-icons-Users.cjs +1 -1
- package/dist/components-icons-Users.js +1 -1
- package/dist/components-icons-UsersFour.cjs +1 -1
- package/dist/components-icons-UsersFour.js +1 -1
- package/dist/components-icons-Warning.cjs +1 -1
- package/dist/components-icons-Warning.js +1 -1
- package/dist/components-icons-WarningCircle.cjs +1 -1
- package/dist/components-icons-WarningCircle.js +1 -1
- package/dist/components-icons-WhatsAppLogoFilled.cjs +1 -1
- package/dist/components-icons-WhatsAppLogoFilled.js +1 -1
- package/dist/components-icons-Wrench.cjs +1 -1
- package/dist/components-icons-Wrench.js +1 -1
- package/dist/components-icons-X.cjs +1 -1
- package/dist/components-icons-X.js +1 -1
- package/dist/components-icons-XCircle.cjs +1 -1
- package/dist/components-icons-XCircle.js +1 -1
- package/dist/components-icons-stroke-icon.cjs.map +1 -1
- package/dist/components-icons-stroke-icon.js.map +1 -1
- package/dist/components-icons.cjs +1 -1
- package/dist/components-icons.js +45 -45
- 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 +21 -21
- package/dist/components-input-password-input-password.cjs +1 -1
- package/dist/components-input-password-input-password.cjs.map +1 -1
- package/dist/components-input-password-input-password.js +2 -2
- package/dist/components-story-drawer-story-drawer.cjs +1 -1
- package/dist/components-story-drawer-story-drawer.cjs.map +1 -1
- package/dist/components-story-drawer-story-drawer.js +21 -21
- package/dist/components-story-drawer-story-drawer.js.map +1 -1
- package/dist/components-transfer-list-transfer-list-card.cjs +1 -1
- package/dist/components-transfer-list-transfer-list-card.cjs.map +1 -1
- package/dist/components-transfer-list-transfer-list-card.js +1 -1
- package/dist/components-transfer-list-transfer-list.cjs +1 -1
- package/dist/components-transfer-list-transfer-list.cjs.map +1 -1
- package/dist/components-transfer-list-transfer-list.js +1 -1
- package/dist/components-ui-calendar-calendar.cjs +1 -1
- package/dist/components-ui-calendar-calendar.js +2 -2
- package/dist/components-ui-calendar.cjs +1 -1
- package/dist/components-ui-calendar.js +2 -2
- package/dist/components-ui-checkbox-checkbox.cjs +1 -1
- package/dist/components-ui-checkbox-checkbox.cjs.map +1 -1
- package/dist/components-ui-checkbox-checkbox.js +1 -1
- package/dist/components-ui-combobox-combobox.cjs +1 -1
- package/dist/components-ui-combobox-combobox.cjs.map +1 -1
- package/dist/components-ui-combobox-combobox.js +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 +1 -1
- package/dist/components-ui-dropdown-menu-dropdown-menu.cjs +1 -1
- package/dist/components-ui-dropdown-menu-dropdown-menu.cjs.map +1 -1
- package/dist/components-ui-dropdown-menu-dropdown-menu.js +1 -1
- package/dist/components-ui-icon-icon-map.cjs +1 -1
- package/dist/components-ui-icon-icon-map.cjs.map +1 -1
- package/dist/components-ui-icon-icon-map.js +1 -1
- package/dist/components-ui-icon-icon-map.js.map +1 -1
- package/dist/components-ui-icon-icon.cjs +1 -1
- package/dist/components-ui-icon-icon.cjs.map +1 -1
- package/dist/components-ui-icon-icon.js +23 -23
- package/dist/components-ui-icon-icon.js.map +1 -1
- package/dist/components-ui-pagination-pagination.cjs +1 -1
- package/dist/components-ui-pagination-pagination.cjs.map +1 -1
- package/dist/components-ui-pagination-pagination.js +3 -3
- package/dist/components-ui-select-calendar-menu-select-calendar-menu.cjs +1 -1
- package/dist/components-ui-select-calendar-menu-select-calendar-menu.cjs.map +1 -1
- package/dist/components-ui-select-calendar-menu-select-calendar-menu.js +2 -2
- package/dist/components-ui-select-select.cjs +1 -1
- package/dist/components-ui-select-select.cjs.map +1 -1
- package/dist/components-ui-select-select.js +1 -1
- package/dist/components-ui-sonner-sonner.cjs +1 -1
- package/dist/components-ui-sonner-sonner.cjs.map +1 -1
- package/dist/components-ui-sonner-sonner.js +6 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +26 -25
- package/dist/index.js +17 -15
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/calendar-DvDG9hIB.cjs +0 -2
|
@@ -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","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IR"}
|
|
@@ -7,10 +7,10 @@ import "./components-ui-button-button.js";
|
|
|
7
7
|
import "./components-ui-button-button.styles.js";
|
|
8
8
|
import "./components-ui-card-card.js";
|
|
9
9
|
import "./components-ui-checkbox-checkbox.js";
|
|
10
|
-
import "phosphor-strokes-icons/icons/CaretDown";
|
|
10
|
+
import "brd-phosphor-strokes-icons/icons/CaretDown";
|
|
11
11
|
import { useMemo as h } from "react";
|
|
12
|
-
import "./calendar-
|
|
13
|
-
import "phosphor-strokes-icons/icons";
|
|
12
|
+
import "./calendar-B78l3uF9.js";
|
|
13
|
+
import "brd-phosphor-strokes-icons/icons";
|
|
14
14
|
import "./components-ui-combobox-combobox.js";
|
|
15
15
|
import "./components-ui-dialog-dialog.js";
|
|
16
16
|
import "./components-ui-label-label.js";
|
|
@@ -32,35 +32,35 @@ import "./components-ui-tabs-tabs.js";
|
|
|
32
32
|
import "./components-ui-tooltip-tooltip.js";
|
|
33
33
|
import { Typography as v } from "./components-ui-typography-typography.js";
|
|
34
34
|
import "./components-ui-typography-typography.styles.js";
|
|
35
|
-
import "phosphor-strokes-icons/icons/CaretLeft";
|
|
36
|
-
import "phosphor-strokes-icons/icons/CaretRight";
|
|
35
|
+
import "brd-phosphor-strokes-icons/icons/CaretLeft";
|
|
36
|
+
import "brd-phosphor-strokes-icons/icons/CaretRight";
|
|
37
37
|
import "./components-app-pagination-app-pagination.styles.js";
|
|
38
|
-
import "phosphor-strokes-icons/icons/CaretUpDown";
|
|
38
|
+
import "brd-phosphor-strokes-icons/icons/CaretUpDown";
|
|
39
39
|
import "./components-app-sidebar-app-sidebar.styles.js";
|
|
40
40
|
import "./components-data-table-data-table.styles.js";
|
|
41
41
|
import "./components-ui-dropdown-menu-dropdown-menu.styles.js";
|
|
42
|
-
import "phosphor-strokes-icons/icons/Eye";
|
|
43
|
-
import "phosphor-strokes-icons/icons/EyeSlash";
|
|
42
|
+
import "brd-phosphor-strokes-icons/icons/Eye";
|
|
43
|
+
import "brd-phosphor-strokes-icons/icons/EyeSlash";
|
|
44
44
|
import "./components-select-field-select-field.js";
|
|
45
45
|
import "./lodash-FemA_LCk.js";
|
|
46
46
|
import "./chart-DFbmMKiQ.js";
|
|
47
47
|
import { BasicAvatar as U } from "./components-basic-avatar-basic-avatar.js";
|
|
48
|
-
import "phosphor-strokes-icons/icons/CheckCircle";
|
|
49
|
-
import "phosphor-strokes-icons/icons/Info";
|
|
50
|
-
import "phosphor-strokes-icons/icons/SpinnerGap";
|
|
51
|
-
import "phosphor-strokes-icons/icons/Warning";
|
|
52
|
-
import "phosphor-strokes-icons/icons/X";
|
|
53
|
-
import "phosphor-strokes-icons/icons/XCircle";
|
|
48
|
+
import "brd-phosphor-strokes-icons/icons/CheckCircle";
|
|
49
|
+
import "brd-phosphor-strokes-icons/icons/Info";
|
|
50
|
+
import "brd-phosphor-strokes-icons/icons/SpinnerGap";
|
|
51
|
+
import "brd-phosphor-strokes-icons/icons/Warning";
|
|
52
|
+
import "brd-phosphor-strokes-icons/icons/X";
|
|
53
|
+
import "brd-phosphor-strokes-icons/icons/XCircle";
|
|
54
54
|
import "./index-C4iHL8Gs.js";
|
|
55
55
|
import "./index-C6N9aMq_.js";
|
|
56
56
|
import { u as j } from "./index-CVlBIwtP.js";
|
|
57
|
-
import "phosphor-strokes-icons/icons/Plus";
|
|
58
|
-
import "phosphor-strokes-icons/icons/CaretUp";
|
|
59
|
-
import "phosphor-strokes-icons/icons/EnvelopeSimple";
|
|
60
|
-
import "phosphor-strokes-icons/icons/MaxLogo";
|
|
61
|
-
import "phosphor-strokes-icons/icons/Phone";
|
|
62
|
-
import "phosphor-strokes-icons/icons/TelegramLogo";
|
|
63
|
-
import "phosphor-strokes-icons/icons/WhatsAppLogoFilled";
|
|
57
|
+
import "brd-phosphor-strokes-icons/icons/Plus";
|
|
58
|
+
import "brd-phosphor-strokes-icons/icons/CaretUp";
|
|
59
|
+
import "brd-phosphor-strokes-icons/icons/EnvelopeSimple";
|
|
60
|
+
import "brd-phosphor-strokes-icons/icons/MaxLogo";
|
|
61
|
+
import "brd-phosphor-strokes-icons/icons/Phone";
|
|
62
|
+
import "brd-phosphor-strokes-icons/icons/TelegramLogo";
|
|
63
|
+
import "brd-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
66
|
const w = 1, y = [".jpg", ".png"], Bt = ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./brd-ui-kit.css');const r=require("react/jsx-runtime");;/* empty css */const q=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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./brd-ui-kit.css');const r=require("react/jsx-runtime");;/* empty css */const q=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("brd-phosphor-strokes-icons/icons/CaretDown");require("react");require("./calendar-BClkfQSD.cjs");const p=require("./components-ui-icon-icon.cjs");require("brd-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 a=require("./components-ui-avatar-avatar.cjs");require("brd-phosphor-strokes-icons/icons/CaretLeft");require("brd-phosphor-strokes-icons/icons/CaretRight");require("./components-app-pagination-app-pagination.styles.cjs");require("brd-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("brd-phosphor-strokes-icons/icons/Eye");require("brd-phosphor-strokes-icons/icons/EyeSlash");require("./components-select-field-select-field.cjs");require("./lodash-kqhtUJfz.cjs");require("./chart-9H_9wEfR.cjs");require("brd-phosphor-strokes-icons/icons/CheckCircle");require("brd-phosphor-strokes-icons/icons/Info");require("brd-phosphor-strokes-icons/icons/SpinnerGap");require("brd-phosphor-strokes-icons/icons/Warning");require("brd-phosphor-strokes-icons/icons/X");require("brd-phosphor-strokes-icons/icons/XCircle");require("./index-DGxwh2Ms.cjs");require("./index-fTTv8YY8.cjs");require("brd-phosphor-strokes-icons/icons/Plus");require("brd-phosphor-strokes-icons/icons/CaretUp");require("brd-phosphor-strokes-icons/icons/EnvelopeSimple");require("brd-phosphor-strokes-icons/icons/MaxLogo");require("brd-phosphor-strokes-icons/icons/Phone");require("brd-phosphor-strokes-icons/icons/TelegramLogo");require("brd-phosphor-strokes-icons/icons/WhatsAppLogoFilled");require("./components-input-phone-input-phone.cjs");require("./components-card-info-card-info.styles.cjs");const x=t=>{const e=t.trim();if(!e)return"";const[i="",u=""]=e.split(/\s+/);return i&&u?`${i[0].toUpperCase()}${u[0].toUpperCase()}`:e.length<=2?e.toUpperCase():i[0].toUpperCase()},y=({initials:t,avatar:e,fallback:i,image:u,icon:n,showDeleteOnHover:o=!0,onClick:c=()=>{}})=>{const s=r.jsxs(a.Avatar,{...e,className:q.cn("h-18 w-18",e?.className),children:[r.jsx(a.AvatarImage,{...u,alt:"avatar",className:q.cn("h-full w-full border-0",u?.className)}),r.jsx(a.AvatarFallback,{...i,children:r.jsx(m.Typography,{variant:"body-xxl-medium",className:q.cn("text-info-new-text",t?.className),children:x(t?.text??"")})})]});return o?r.jsxs("div",{className:"relative inline-block",children:[s,r.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
3
|
transition-opacity hover:opacity-100`,onClick:l=>l.stopPropagation(),children:r.jsx(p.Icon,{...n,type:"x",onClick:c})})]}):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\nconst getInitials = (fullName: string): string => {\n const normalizedName = fullName.trim();\n\n if (!normalizedName) {\n return \"\";\n }\n\n const [firstName = \"\", lastName = \"\"] = normalizedName.split(/\\s+/);\n\n if (firstName && lastName) {\n return `${firstName[0].toUpperCase()}${lastName[0].toUpperCase()}`;\n }\n\n if (normalizedName.length <= 2) {\n return normalizedName.toUpperCase();\n }\n\n return firstName[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","normalizedName","firstName","lastName","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 normalizedName = fullName.trim();\n\n if (!normalizedName) {\n return \"\";\n }\n\n const [firstName = \"\", lastName = \"\"] = normalizedName.split(/\\s+/);\n\n if (firstName && lastName) {\n return `${firstName[0].toUpperCase()}${lastName[0].toUpperCase()}`;\n }\n\n if (normalizedName.length <= 2) {\n return normalizedName.toUpperCase();\n }\n\n return firstName[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","normalizedName","firstName","lastName","BasicAvatar","initials","avatar","fallback","image","icon","showDeleteOnHover","onClick","content","jsxs","Avatar","cn","jsx","AvatarImage","AvatarFallback","Typography","e","Icon"],"mappings":"4uGAyBA,MAAMA,EAAeC,GAA6B,CAChD,MAAMC,EAAiBD,EAAS,KAAA,EAEhC,GAAI,CAACC,EACH,MAAO,GAGT,KAAM,CAACC,EAAY,GAAIC,EAAW,EAAE,EAAIF,EAAe,MAAM,KAAK,EAElE,OAAIC,GAAaC,EACR,GAAGD,EAAU,CAAC,EAAE,YAAA,CAAa,GAAGC,EAAS,CAAC,EAAE,YAAA,CAAa,GAG9DF,EAAe,QAAU,EACpBA,EAAe,YAAA,EAGjBC,EAAU,CAAC,EAAE,YAAA,CACtB,EAEaE,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,SAAAN,EAAYM,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"}
|
|
@@ -7,11 +7,11 @@ import "./components-ui-button-button.js";
|
|
|
7
7
|
import "./components-ui-button-button.styles.js";
|
|
8
8
|
import "./components-ui-card-card.js";
|
|
9
9
|
import "./components-ui-checkbox-checkbox.js";
|
|
10
|
-
import "phosphor-strokes-icons/icons/CaretDown";
|
|
10
|
+
import "brd-phosphor-strokes-icons/icons/CaretDown";
|
|
11
11
|
import "react";
|
|
12
|
-
import "./calendar-
|
|
12
|
+
import "./calendar-B78l3uF9.js";
|
|
13
13
|
import { Icon as f } from "./components-ui-icon-icon.js";
|
|
14
|
-
import "phosphor-strokes-icons/icons";
|
|
14
|
+
import "brd-phosphor-strokes-icons/icons";
|
|
15
15
|
import "./components-ui-combobox-combobox.js";
|
|
16
16
|
import "./components-ui-dialog-dialog.js";
|
|
17
17
|
import "./components-ui-label-label.js";
|
|
@@ -34,33 +34,33 @@ import "./components-ui-tooltip-tooltip.js";
|
|
|
34
34
|
import { Typography as u } from "./components-ui-typography-typography.js";
|
|
35
35
|
import "./components-ui-typography-typography.styles.js";
|
|
36
36
|
import { Avatar as d, AvatarImage as x, AvatarFallback as N } from "./components-ui-avatar-avatar.js";
|
|
37
|
-
import "phosphor-strokes-icons/icons/CaretLeft";
|
|
38
|
-
import "phosphor-strokes-icons/icons/CaretRight";
|
|
37
|
+
import "brd-phosphor-strokes-icons/icons/CaretLeft";
|
|
38
|
+
import "brd-phosphor-strokes-icons/icons/CaretRight";
|
|
39
39
|
import "./components-app-pagination-app-pagination.styles.js";
|
|
40
|
-
import "phosphor-strokes-icons/icons/CaretUpDown";
|
|
40
|
+
import "brd-phosphor-strokes-icons/icons/CaretUpDown";
|
|
41
41
|
import "./components-app-sidebar-app-sidebar.styles.js";
|
|
42
42
|
import "./components-data-table-data-table.styles.js";
|
|
43
43
|
import "./components-ui-dropdown-menu-dropdown-menu.styles.js";
|
|
44
|
-
import "phosphor-strokes-icons/icons/Eye";
|
|
45
|
-
import "phosphor-strokes-icons/icons/EyeSlash";
|
|
44
|
+
import "brd-phosphor-strokes-icons/icons/Eye";
|
|
45
|
+
import "brd-phosphor-strokes-icons/icons/EyeSlash";
|
|
46
46
|
import "./components-select-field-select-field.js";
|
|
47
47
|
import "./lodash-FemA_LCk.js";
|
|
48
48
|
import "./chart-DFbmMKiQ.js";
|
|
49
|
-
import "phosphor-strokes-icons/icons/CheckCircle";
|
|
50
|
-
import "phosphor-strokes-icons/icons/Info";
|
|
51
|
-
import "phosphor-strokes-icons/icons/SpinnerGap";
|
|
52
|
-
import "phosphor-strokes-icons/icons/Warning";
|
|
53
|
-
import "phosphor-strokes-icons/icons/X";
|
|
54
|
-
import "phosphor-strokes-icons/icons/XCircle";
|
|
49
|
+
import "brd-phosphor-strokes-icons/icons/CheckCircle";
|
|
50
|
+
import "brd-phosphor-strokes-icons/icons/Info";
|
|
51
|
+
import "brd-phosphor-strokes-icons/icons/SpinnerGap";
|
|
52
|
+
import "brd-phosphor-strokes-icons/icons/Warning";
|
|
53
|
+
import "brd-phosphor-strokes-icons/icons/X";
|
|
54
|
+
import "brd-phosphor-strokes-icons/icons/XCircle";
|
|
55
55
|
import "./index-C4iHL8Gs.js";
|
|
56
56
|
import "./index-C6N9aMq_.js";
|
|
57
|
-
import "phosphor-strokes-icons/icons/Plus";
|
|
58
|
-
import "phosphor-strokes-icons/icons/CaretUp";
|
|
59
|
-
import "phosphor-strokes-icons/icons/EnvelopeSimple";
|
|
60
|
-
import "phosphor-strokes-icons/icons/MaxLogo";
|
|
61
|
-
import "phosphor-strokes-icons/icons/Phone";
|
|
62
|
-
import "phosphor-strokes-icons/icons/TelegramLogo";
|
|
63
|
-
import "phosphor-strokes-icons/icons/WhatsAppLogoFilled";
|
|
57
|
+
import "brd-phosphor-strokes-icons/icons/Plus";
|
|
58
|
+
import "brd-phosphor-strokes-icons/icons/CaretUp";
|
|
59
|
+
import "brd-phosphor-strokes-icons/icons/EnvelopeSimple";
|
|
60
|
+
import "brd-phosphor-strokes-icons/icons/MaxLogo";
|
|
61
|
+
import "brd-phosphor-strokes-icons/icons/Phone";
|
|
62
|
+
import "brd-phosphor-strokes-icons/icons/TelegramLogo";
|
|
63
|
+
import "brd-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
66
|
const h = (m) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("./lib-utils.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("./lib-utils.cjs"),u=require("./components-ui-card-card.cjs"),l=require("./components-ui-typography-typography.cjs");require("./components-ui-typography-typography.styles.cjs");const o=require("./components-card-info-card-info.styles.cjs"),f=({className:n,title:c,headerComponent:a,children:s,accent:t,size:d,...i})=>r.jsxs(u.Card,{className:e.cn(o.cardInfoVariants(),n?.card),...i,children:[r.jsx("div",{className:e.cn(o.cardInfoLeftBorderVariants({accent:t}),n?.borderLeft)}),r.jsx("div",{className:e.cn(o.cardInfoHeaderVariants({accent:t,size:d}),n?.headerBackground),children:a||r.jsx(l.Typography,{variant:"body-lg-semibold",children:c})}),r.jsx("div",{className:e.cn(o.cardInfoContentVariants(),n?.content),children:s})]});exports.CardInfo=f;
|
|
2
2
|
//# sourceMappingURL=components-card-info-card-info.cjs.map
|
|
@@ -1 +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":"+
|
|
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: string;\n headerComponent?: 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 headerComponent,\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 {headerComponent ? (\n headerComponent\n ) : (\n <Typography variant=\"body-lg-semibold\">{title}</Typography>\n )}\n </div>\n\n <div className={cn(cardInfoContentVariants(), className?.content)}>{children}</div>\n </Card>\n );\n};\n"],"names":["CardInfo","className","title","headerComponent","children","accent","size","props","jsxs","Card","cn","cardInfoVariants","jsx","cardInfoLeftBorderVariants","cardInfoHeaderVariants","Typography","cardInfoContentVariants"],"mappings":"+WA0BaA,EAAW,CAAC,CACvB,UAAAC,EACA,MAAAC,EACA,gBAAAC,EACA,SAAAC,EACA,OAAAC,EACA,KAAAC,EACA,GAAGC,CACL,IAEIC,EAAAA,KAACC,EAAAA,KAAA,CACC,UAAWC,EAAAA,GAAGC,EAAAA,mBAAoBV,GAAW,IAAI,EAChD,GAAGM,EAEJ,SAAA,CAAAK,EAAAA,IAAC,MAAA,CACC,UAAWF,EAAAA,GAAGG,EAAAA,2BAA2B,CAAE,OAAAR,EAAQ,EAAGJ,GAAW,UAAU,CAAA,CAAA,EAG7EW,EAAAA,IAAC,MAAA,CACC,UAAWF,EAAAA,GACTI,yBAAuB,CAAE,OAAAT,EAAQ,KAAAC,EAAM,EACvCL,GAAW,gBAAA,EAGZ,YAGCW,MAACG,EAAAA,WAAA,CAAW,QAAQ,mBAAoB,SAAAb,CAAA,CAAM,CAAA,CAAA,EAIlDU,MAAC,OAAI,UAAWF,EAAAA,GAAGM,EAAAA,0BAA2Bf,GAAW,OAAO,EAAI,SAAAG,CAAA,CAAS,CAAA,CAAA,CAAA"}
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { cn as a } from "./lib-utils.js";
|
|
3
|
-
import { Card as
|
|
4
|
-
import { Typography as
|
|
3
|
+
import { Card as c } from "./components-ui-card-card.js";
|
|
4
|
+
import { Typography as s } from "./components-ui-typography-typography.js";
|
|
5
5
|
import "./components-ui-typography-typography.styles.js";
|
|
6
|
-
import { cardInfoLeftBorderVariants as
|
|
7
|
-
const
|
|
6
|
+
import { cardInfoLeftBorderVariants as p, cardInfoHeaderVariants as l, cardInfoContentVariants as I, cardInfoVariants as h } from "./components-card-info-card-info.styles.js";
|
|
7
|
+
const j = ({
|
|
8
8
|
className: r,
|
|
9
9
|
title: n,
|
|
10
|
+
headerComponent: d,
|
|
10
11
|
children: t,
|
|
11
|
-
accent:
|
|
12
|
-
size:
|
|
13
|
-
...
|
|
12
|
+
accent: i,
|
|
13
|
+
size: e,
|
|
14
|
+
...f
|
|
14
15
|
}) => /* @__PURE__ */ m(
|
|
15
|
-
|
|
16
|
+
c,
|
|
16
17
|
{
|
|
17
18
|
className: a(h(), r?.card),
|
|
18
|
-
...
|
|
19
|
+
...f,
|
|
19
20
|
children: [
|
|
20
21
|
/* @__PURE__ */ o(
|
|
21
22
|
"div",
|
|
22
23
|
{
|
|
23
|
-
className: a(
|
|
24
|
+
className: a(p({ accent: i }), r?.borderLeft)
|
|
24
25
|
}
|
|
25
26
|
),
|
|
26
27
|
/* @__PURE__ */ o(
|
|
27
28
|
"div",
|
|
28
29
|
{
|
|
29
30
|
className: a(
|
|
30
|
-
|
|
31
|
+
l({ accent: i, size: e }),
|
|
31
32
|
r?.headerBackground
|
|
32
33
|
),
|
|
33
|
-
children: /* @__PURE__ */ o(
|
|
34
|
+
children: d || /* @__PURE__ */ o(s, { variant: "body-lg-semibold", children: n })
|
|
34
35
|
}
|
|
35
36
|
),
|
|
36
|
-
/* @__PURE__ */ o("div", { className: a(
|
|
37
|
+
/* @__PURE__ */ o("div", { className: a(I(), r?.content), children: t })
|
|
37
38
|
]
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
j as CardInfo
|
|
42
43
|
};
|
|
43
44
|
//# sourceMappingURL=components-card-info-card-info.js.map
|
|
@@ -1 +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":";;;;;;
|
|
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: string;\n headerComponent?: 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 headerComponent,\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 {headerComponent ? (\n headerComponent\n ) : (\n <Typography variant=\"body-lg-semibold\">{title}</Typography>\n )}\n </div>\n\n <div className={cn(cardInfoContentVariants(), className?.content)}>{children}</div>\n </Card>\n );\n};\n"],"names":["CardInfo","className","title","headerComponent","children","accent","size","props","jsxs","Card","cn","cardInfoVariants","jsx","cardInfoLeftBorderVariants","cardInfoHeaderVariants","Typography","cardInfoContentVariants"],"mappings":";;;;;;AA0BO,MAAMA,IAAW,CAAC;AAAA,EACvB,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAGC,KAAoBV,GAAW,IAAI;AAAA,IAChD,GAAGM;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAK;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF,EAAGG,EAA2B,EAAE,QAAAR,GAAQ,GAAGJ,GAAW,UAAU;AAAA,QAAA;AAAA,MAAA;AAAA,MAG7E,gBAAAW;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF;AAAA,YACTI,EAAuB,EAAE,QAAAT,GAAQ,MAAAC,GAAM;AAAA,YACvCL,GAAW;AAAA,UAAA;AAAA,UAGZ,eAGC,gBAAAW,EAACG,GAAA,EAAW,SAAQ,oBAAoB,UAAAb,EAAA,CAAM;AAAA,QAAA;AAAA,MAAA;AAAA,MAIlD,gBAAAU,EAAC,SAAI,WAAWF,EAAGM,KAA2Bf,GAAW,OAAO,GAAI,UAAAG,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAAA;"}
|
|
@@ -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-
|
|
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("brd-phosphor-strokes-icons/icons/CaretDown");const B=require("./hooks-usePopupControls.cjs");require("./calendar-BClkfQSD.cjs");const q=require("./components-ui-icon-icon.cjs");require("brd-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("brd-phosphor-strokes-icons/icons/CaretLeft");require("brd-phosphor-strokes-icons/icons/CaretRight");require("./components-app-pagination-app-pagination.styles.cjs");require("brd-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("brd-phosphor-strokes-icons/icons/Eye");require("brd-phosphor-strokes-icons/icons/EyeSlash");require("./components-select-field-select-field.cjs");require("./lodash-kqhtUJfz.cjs");require("./chart-9H_9wEfR.cjs");require("brd-phosphor-strokes-icons/icons/CheckCircle");require("brd-phosphor-strokes-icons/icons/Info");require("brd-phosphor-strokes-icons/icons/SpinnerGap");require("brd-phosphor-strokes-icons/icons/Warning");require("brd-phosphor-strokes-icons/icons/X");require("brd-phosphor-strokes-icons/icons/XCircle");const k=require("./index-DGxwh2Ms.cjs");require("./index-fTTv8YY8.cjs");require("brd-phosphor-strokes-icons/icons/Plus");require("brd-phosphor-strokes-icons/icons/CaretUp");require("brd-phosphor-strokes-icons/icons/EnvelopeSimple");require("brd-phosphor-strokes-icons/icons/MaxLogo");require("brd-phosphor-strokes-icons/icons/Phone");require("brd-phosphor-strokes-icons/icons/TelegramLogo");require("brd-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":"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,EAE7DK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A,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"}
|
|
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":"q0GA4CA,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,CA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EAE3C,SAAAyB,EAAAA,IAACW,EAAAA,KAAA,CACC,KAAK,IACL,UAAU,oCAAA,CAAA,CACZ,CAAA,CACF,CAAA,CAAA,CACF,EAhCKpC,CAAA,CAmCX,CAAC,EACD,KACH+B,EAAM,SAAW,SACfH,EAAAA,WAAA,CAAW,UAAU,wBAAyB,SAAApC,CAAA,CAAU,CAAA,CAAA,EAzD9CqC,CA2Df,CAEH,CAAA,CAAA,EAGFhC,EACC4B,EAAAA,IAACY,EAAAA,WAAA,CACC,MAAArC,EACA,SAAUsB,EACV,YAAY,sBACZ,QAAS,CACP,SAAU,4BAAA,EAEZ,UAAYC,GAAM,CACZA,EAAE,MAAQ,UACZA,EAAE,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"}
|
|
@@ -7,11 +7,11 @@ import { Button as f } from "./components-ui-button-button.js";
|
|
|
7
7
|
import "./components-ui-button-button.styles.js";
|
|
8
8
|
import "./components-ui-card-card.js";
|
|
9
9
|
import { Checkbox as k } from "./components-ui-checkbox-checkbox.js";
|
|
10
|
-
import "phosphor-strokes-icons/icons/CaretDown";
|
|
10
|
+
import "brd-phosphor-strokes-icons/icons/CaretDown";
|
|
11
11
|
import { usePopupControls as R } from "./hooks-usePopupControls.js";
|
|
12
|
-
import "./calendar-
|
|
12
|
+
import "./calendar-B78l3uF9.js";
|
|
13
13
|
import { Icon as b } from "./components-ui-icon-icon.js";
|
|
14
|
-
import "phosphor-strokes-icons/icons";
|
|
14
|
+
import "brd-phosphor-strokes-icons/icons";
|
|
15
15
|
import "./components-ui-combobox-combobox.js";
|
|
16
16
|
import "./components-ui-dialog-dialog.js";
|
|
17
17
|
import { useRef as $, useState as P, useMemo as N, useCallback as a } from "react";
|
|
@@ -34,34 +34,34 @@ import "./components-ui-tabs-tabs.js";
|
|
|
34
34
|
import "./components-ui-tooltip-tooltip.js";
|
|
35
35
|
import { Typography as d } from "./components-ui-typography-typography.js";
|
|
36
36
|
import "./components-ui-typography-typography.styles.js";
|
|
37
|
-
import "phosphor-strokes-icons/icons/CaretLeft";
|
|
38
|
-
import "phosphor-strokes-icons/icons/CaretRight";
|
|
37
|
+
import "brd-phosphor-strokes-icons/icons/CaretLeft";
|
|
38
|
+
import "brd-phosphor-strokes-icons/icons/CaretRight";
|
|
39
39
|
import "./components-app-pagination-app-pagination.styles.js";
|
|
40
|
-
import "phosphor-strokes-icons/icons/CaretUpDown";
|
|
40
|
+
import "brd-phosphor-strokes-icons/icons/CaretUpDown";
|
|
41
41
|
import "./components-app-sidebar-app-sidebar.styles.js";
|
|
42
42
|
import "./components-data-table-data-table.styles.js";
|
|
43
43
|
import "./components-ui-dropdown-menu-dropdown-menu.styles.js";
|
|
44
44
|
import { InputField as z } from "./components-input-field-input-field.js";
|
|
45
|
-
import "phosphor-strokes-icons/icons/Eye";
|
|
46
|
-
import "phosphor-strokes-icons/icons/EyeSlash";
|
|
45
|
+
import "brd-phosphor-strokes-icons/icons/Eye";
|
|
46
|
+
import "brd-phosphor-strokes-icons/icons/EyeSlash";
|
|
47
47
|
import "./components-select-field-select-field.js";
|
|
48
48
|
import "./lodash-FemA_LCk.js";
|
|
49
49
|
import "./chart-DFbmMKiQ.js";
|
|
50
|
-
import "phosphor-strokes-icons/icons/CheckCircle";
|
|
51
|
-
import "phosphor-strokes-icons/icons/Info";
|
|
52
|
-
import "phosphor-strokes-icons/icons/SpinnerGap";
|
|
53
|
-
import "phosphor-strokes-icons/icons/Warning";
|
|
54
|
-
import "phosphor-strokes-icons/icons/X";
|
|
55
|
-
import "phosphor-strokes-icons/icons/XCircle";
|
|
50
|
+
import "brd-phosphor-strokes-icons/icons/CheckCircle";
|
|
51
|
+
import "brd-phosphor-strokes-icons/icons/Info";
|
|
52
|
+
import "brd-phosphor-strokes-icons/icons/SpinnerGap";
|
|
53
|
+
import "brd-phosphor-strokes-icons/icons/Warning";
|
|
54
|
+
import "brd-phosphor-strokes-icons/icons/X";
|
|
55
|
+
import "brd-phosphor-strokes-icons/icons/XCircle";
|
|
56
56
|
import { t as w } from "./index-C4iHL8Gs.js";
|
|
57
57
|
import "./index-C6N9aMq_.js";
|
|
58
|
-
import "phosphor-strokes-icons/icons/Plus";
|
|
59
|
-
import "phosphor-strokes-icons/icons/CaretUp";
|
|
60
|
-
import "phosphor-strokes-icons/icons/EnvelopeSimple";
|
|
61
|
-
import "phosphor-strokes-icons/icons/MaxLogo";
|
|
62
|
-
import "phosphor-strokes-icons/icons/Phone";
|
|
63
|
-
import "phosphor-strokes-icons/icons/TelegramLogo";
|
|
64
|
-
import "phosphor-strokes-icons/icons/WhatsAppLogoFilled";
|
|
58
|
+
import "brd-phosphor-strokes-icons/icons/Plus";
|
|
59
|
+
import "brd-phosphor-strokes-icons/icons/CaretUp";
|
|
60
|
+
import "brd-phosphor-strokes-icons/icons/EnvelopeSimple";
|
|
61
|
+
import "brd-phosphor-strokes-icons/icons/MaxLogo";
|
|
62
|
+
import "brd-phosphor-strokes-icons/icons/Phone";
|
|
63
|
+
import "brd-phosphor-strokes-icons/icons/TelegramLogo";
|
|
64
|
+
import "brd-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
67
|
const H = 50, ot = ({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");const f=require("./components-ui-dropdown-menu-dropdown-menu.cjs"),y=require("./components-ui-icon-icon.cjs");require("phosphor-strokes-icons/icons");function _(c={}){const{id:i="actions",header:u,renderCell:a,trigger:s,menuItems:t,align:d="end",ariaLabel:m="Открыть действия строки"}=c;return{id:i,header:u,enableSorting:!1,enableHiding:!1,meta:{label:"Действия",headClassName:"w-[4.5625rem]",cellClassName:"w-[4.5625rem]"},cell:({row:l})=>{const n={row:l,data:l.original};if(a)return a(n);const o=typeof t=="function"?t(n):t,p=[{id:`${i}-empty`,type:"item",label:"Нет действий",readOnly:!0}],g=s?s(n):e.jsx(b.Button,{type:"button",variant:"circleGhost",size:"icon-xs","aria-label":m,children:e.jsx(y.Icon,{type:"dots-three","aria-hidden":!0})});return e.jsx("div",{className:"flex justify-end",onClick:r=>r.stopPropagation(),onKeyDown:r=>r.stopPropagation(),role:"presentation",children:e.jsx(f.ConfigurableDropdownMenu,{trigger:g,items:o&&o.length>0?o:p,contentProps:{align:d}})})}}}exports.createDataTableActionsColumn=_;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");const f=require("./components-ui-dropdown-menu-dropdown-menu.cjs"),y=require("./components-ui-icon-icon.cjs");require("brd-phosphor-strokes-icons/icons");function _(c={}){const{id:i="actions",header:u,renderCell:a,trigger:s,menuItems:t,align:d="end",ariaLabel:m="Открыть действия строки"}=c;return{id:i,header:u,enableSorting:!1,enableHiding:!1,meta:{label:"Действия",headClassName:"w-[4.5625rem]",cellClassName:"w-[4.5625rem]"},cell:({row:l})=>{const n={row:l,data:l.original};if(a)return a(n);const o=typeof t=="function"?t(n):t,p=[{id:`${i}-empty`,type:"item",label:"Нет действий",readOnly:!0}],g=s?s(n):e.jsx(b.Button,{type:"button",variant:"circleGhost",size:"icon-xs","aria-label":m,children:e.jsx(y.Icon,{type:"dots-three","aria-hidden":!0})});return e.jsx("div",{className:"flex justify-end",onClick:r=>r.stopPropagation(),onKeyDown:r=>r.stopPropagation(),role:"presentation",children:e.jsx(f.ConfigurableDropdownMenu,{trigger:g,items:o&&o.length>0?o:p,contentProps:{align:d}})})}}}exports.createDataTableActionsColumn=_;
|
|
2
2
|
//# sourceMappingURL=components-data-table-data-table-actions-column.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-data-table-data-table-actions-column.cjs","sources":["../src/components/data-table/data-table-actions-column.tsx"],"sourcesContent":["import type { ColumnDef, Row } from \"@tanstack/react-table\";\nimport type { ReactNode } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n ConfigurableDropdownMenu,\n type DropdownMenuConfigNode,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icon\";\n\ntype DataTableActionsColumnOptions<TData> = {\n id?: string;\n header?: ColumnDef<TData>[\"header\"];\n renderCell?: (ctx: { row: Row<TData>; data: TData }) => ReactNode;\n trigger?: (ctx: { row: Row<TData>; data: TData }) => ReactNode;\n menuItems?:\n | DropdownMenuConfigNode[]\n | ((ctx: { row: Row<TData>; data: TData }) => DropdownMenuConfigNode[]);\n align?: \"start\" | \"center\" | \"end\";\n ariaLabel?: string;\n};\n\nexport function createDataTableActionsColumn<TData>(\n options: DataTableActionsColumnOptions<TData> = {},\n): ColumnDef<TData> {\n const {\n id = \"actions\",\n header,\n renderCell,\n trigger,\n menuItems,\n align = \"end\",\n ariaLabel = \"Открыть действия строки\",\n } = options;\n\n return {\n id,\n header,\n enableSorting: false,\n enableHiding: false,\n meta: {\n label: \"Действия\",\n headClassName: \"w-[4.5625rem]\",\n cellClassName: \"w-[4.5625rem]\",\n },\n cell: ({ row }) => {\n const context = { row, data: row.original };\n\n if (renderCell) {\n return renderCell(context);\n }\n\n const resolvedItems =\n typeof menuItems === \"function\" ? menuItems(context) : menuItems;\n\n const fallbackItems: DropdownMenuConfigNode[] = [\n { id: `${id}-empty`, type: \"item\", label: \"Нет действий\", readOnly: true },\n ];\n\n const resolvedTrigger = trigger ? (\n trigger(context)\n ) : (\n <Button\n type=\"button\"\n variant=\"circleGhost\"\n size=\"icon-xs\"\n aria-label={ariaLabel}\n >\n <Icon\n type=\"dots-three\"\n aria-hidden\n />\n </Button>\n );\n\n return (\n <div\n className=\"flex justify-end\"\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n role=\"presentation\"\n >\n <ConfigurableDropdownMenu\n trigger={resolvedTrigger}\n items={\n resolvedItems && resolvedItems.length > 0 ? resolvedItems : fallbackItems\n }\n contentProps={{ align }}\n />\n </div>\n );\n },\n };\n}\n\nexport type { DataTableActionsColumnOptions };\n"],"names":["createDataTableActionsColumn","options","id","header","renderCell","trigger","menuItems","align","ariaLabel","row","context","resolvedItems","fallbackItems","resolvedTrigger","jsx","Button","Icon","event","ConfigurableDropdownMenu"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components-data-table-data-table-actions-column.cjs","sources":["../src/components/data-table/data-table-actions-column.tsx"],"sourcesContent":["import type { ColumnDef, Row } from \"@tanstack/react-table\";\nimport type { ReactNode } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n ConfigurableDropdownMenu,\n type DropdownMenuConfigNode,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icon\";\n\ntype DataTableActionsColumnOptions<TData> = {\n id?: string;\n header?: ColumnDef<TData>[\"header\"];\n renderCell?: (ctx: { row: Row<TData>; data: TData }) => ReactNode;\n trigger?: (ctx: { row: Row<TData>; data: TData }) => ReactNode;\n menuItems?:\n | DropdownMenuConfigNode[]\n | ((ctx: { row: Row<TData>; data: TData }) => DropdownMenuConfigNode[]);\n align?: \"start\" | \"center\" | \"end\";\n ariaLabel?: string;\n};\n\nexport function createDataTableActionsColumn<TData>(\n options: DataTableActionsColumnOptions<TData> = {},\n): ColumnDef<TData> {\n const {\n id = \"actions\",\n header,\n renderCell,\n trigger,\n menuItems,\n align = \"end\",\n ariaLabel = \"Открыть действия строки\",\n } = options;\n\n return {\n id,\n header,\n enableSorting: false,\n enableHiding: false,\n meta: {\n label: \"Действия\",\n headClassName: \"w-[4.5625rem]\",\n cellClassName: \"w-[4.5625rem]\",\n },\n cell: ({ row }) => {\n const context = { row, data: row.original };\n\n if (renderCell) {\n return renderCell(context);\n }\n\n const resolvedItems =\n typeof menuItems === \"function\" ? menuItems(context) : menuItems;\n\n const fallbackItems: DropdownMenuConfigNode[] = [\n { id: `${id}-empty`, type: \"item\", label: \"Нет действий\", readOnly: true },\n ];\n\n const resolvedTrigger = trigger ? (\n trigger(context)\n ) : (\n <Button\n type=\"button\"\n variant=\"circleGhost\"\n size=\"icon-xs\"\n aria-label={ariaLabel}\n >\n <Icon\n type=\"dots-three\"\n aria-hidden\n />\n </Button>\n );\n\n return (\n <div\n className=\"flex justify-end\"\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n role=\"presentation\"\n >\n <ConfigurableDropdownMenu\n trigger={resolvedTrigger}\n items={\n resolvedItems && resolvedItems.length > 0 ? resolvedItems : fallbackItems\n }\n contentProps={{ align }}\n />\n </div>\n );\n },\n };\n}\n\nexport type { DataTableActionsColumnOptions };\n"],"names":["createDataTableActionsColumn","options","id","header","renderCell","trigger","menuItems","align","ariaLabel","row","context","resolvedItems","fallbackItems","resolvedTrigger","jsx","Button","Icon","event","ConfigurableDropdownMenu"],"mappings":"kXAsBO,SAASA,EACdC,EAAgD,GAC9B,CAClB,KAAM,CACJ,GAAAC,EAAK,UACL,OAAAC,EACA,WAAAC,EACA,QAAAC,EACA,UAAAC,EACA,MAAAC,EAAQ,MACR,UAAAC,EAAY,yBAAA,EACVP,EAEJ,MAAO,CACL,GAAAC,EACA,OAAAC,EACA,cAAe,GACf,aAAc,GACd,KAAM,CACJ,MAAO,WACP,cAAe,gBACf,cAAe,eAAA,EAEjB,KAAM,CAAC,CAAE,IAAAM,KAAU,CACjB,MAAMC,EAAU,CAAE,IAAAD,EAAK,KAAMA,EAAI,QAAA,EAEjC,GAAIL,EACF,OAAOA,EAAWM,CAAO,EAG3B,MAAMC,EACJ,OAAOL,GAAc,WAAaA,EAAUI,CAAO,EAAIJ,EAEnDM,EAA0C,CAC9C,CAAE,GAAI,GAAGV,CAAE,SAAU,KAAM,OAAQ,MAAO,eAAgB,SAAU,EAAA,CAAK,EAGrEW,EAAkBR,EACtBA,EAAQK,CAAO,EAEfI,EAAAA,IAACC,EAAAA,OAAA,CACC,KAAK,SACL,QAAQ,cACR,KAAK,UACL,aAAYP,EAEZ,SAAAM,EAAAA,IAACE,EAAAA,KAAA,CACC,KAAK,aACL,cAAW,EAAA,CAAA,CACb,CAAA,EAIJ,OACEF,EAAAA,IAAC,MAAA,CACC,UAAU,mBACV,QAAUG,GAAUA,EAAM,gBAAA,EAC1B,UAAYA,GAAUA,EAAM,gBAAA,EAC5B,KAAK,eAEL,SAAAH,EAAAA,IAACI,EAAAA,yBAAA,CACC,QAASL,EACT,MACEF,GAAiBA,EAAc,OAAS,EAAIA,EAAgBC,EAE9D,aAAc,CAAE,MAAAL,CAAA,CAAM,CAAA,CACxB,CAAA,CAGN,CAAA,CAEJ"}
|
|
@@ -3,7 +3,7 @@ import { Button as u } from "./components-ui-button-button.js";
|
|
|
3
3
|
import "./components-ui-button-button.styles.js";
|
|
4
4
|
import { ConfigurableDropdownMenu as b } from "./components-ui-dropdown-menu-dropdown-menu.js";
|
|
5
5
|
import { Icon as h } from "./components-ui-icon-icon.js";
|
|
6
|
-
import "phosphor-strokes-icons/icons";
|
|
6
|
+
import "brd-phosphor-strokes-icons/icons";
|
|
7
7
|
function D(m = {}) {
|
|
8
8
|
const {
|
|
9
9
|
id: a = "actions",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),k=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");const j=require("./components-ui-dropdown-menu-dropdown-menu.cjs"),d=require("./components-ui-icon-icon.cjs");require("phosphor-strokes-icons/icons");const s=require("./lib-utils.cjs");require("react");const g=require("./components-ui-typography-typography.styles.cjs");function m(t,n){return t.getColumn(n)?.columnDef.meta?.label??n}function w({table:t,columnVisibility:n,onColumnVisibilityChange:o,triggerLabel:u="Колонки",trigger:p,menuLabel:y="Видимость колонок",includeColumnIds:l,excludeColumnIds:a,align:b="end",dropdownWidthClassName:h="w-56"}){const c=t.getAllColumns().filter(e=>typeof e.accessorFn<"u").filter(e=>e.getCanHide()).filter(e=>!l?.length||l.includes(e.id)).filter(e=>!a?.length||!a.includes(e.id));if(!c.length)return null;const f=e=>n?n[e]??!0:t.getColumn(e)?.getIsVisible()??!0,_=(e,r)=>{if(o){o(q=>({...q,[e]:r}));return}t.getColumn(e)?.toggleVisibility(r)},C=p??i.jsxs(k.Button,{type:"button",variant:"outlined",size:"sm",children:[u,i.jsx(d.Icon,{type:"columns-plus-right","aria-hidden":!0})]}),x=c.map(e=>{const r=f(e.id);return{key:e.id,checked:r,itemIndicator:null,className:s.cn("rounded-none px-4 py-2",g.getTypographyClassName("body-sm-regular")),checkedClassName:s.cn("bg-tertiary-bg text-primary-text data-[highlighted]:bg-tertiary-bg",g.getTypographyClassName("body-sm-medium")),label:m(t,e.id),checkedEndAdornment:i.jsx(d.Icon,{type:"check","aria-hidden":!0,size:"small"}),textValue:m(t,e.id)}});return i.jsx(j.CheckboxDropdownMenu,{trigger:C,items:x,onItemCheckedChange:_,keepOpenOnItemSelect:!0,contentProps:{align:b,"aria-label":y,className:s.cn(h,`border-inp-focus-border bg-primary-bg overflow-hidden rounded-xl border py-2
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),k=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");const j=require("./components-ui-dropdown-menu-dropdown-menu.cjs"),d=require("./components-ui-icon-icon.cjs");require("brd-phosphor-strokes-icons/icons");const s=require("./lib-utils.cjs");require("react");const g=require("./components-ui-typography-typography.styles.cjs");function m(t,n){return t.getColumn(n)?.columnDef.meta?.label??n}function w({table:t,columnVisibility:n,onColumnVisibilityChange:o,triggerLabel:u="Колонки",trigger:p,menuLabel:y="Видимость колонок",includeColumnIds:l,excludeColumnIds:a,align:b="end",dropdownWidthClassName:h="w-56"}){const c=t.getAllColumns().filter(e=>typeof e.accessorFn<"u").filter(e=>e.getCanHide()).filter(e=>!l?.length||l.includes(e.id)).filter(e=>!a?.length||!a.includes(e.id));if(!c.length)return null;const f=e=>n?n[e]??!0:t.getColumn(e)?.getIsVisible()??!0,_=(e,r)=>{if(o){o(q=>({...q,[e]:r}));return}t.getColumn(e)?.toggleVisibility(r)},C=p??i.jsxs(k.Button,{type:"button",variant:"outlined",size:"sm",children:[u,i.jsx(d.Icon,{type:"columns-plus-right","aria-hidden":!0})]}),x=c.map(e=>{const r=f(e.id);return{key:e.id,checked:r,itemIndicator:null,className:s.cn("rounded-none px-4 py-2",g.getTypographyClassName("body-sm-regular")),checkedClassName:s.cn("bg-tertiary-bg text-primary-text data-[highlighted]:bg-tertiary-bg",g.getTypographyClassName("body-sm-medium")),label:m(t,e.id),checkedEndAdornment:i.jsx(d.Icon,{type:"check","aria-hidden":!0,size:"small"}),textValue:m(t,e.id)}});return i.jsx(j.CheckboxDropdownMenu,{trigger:C,items:x,onItemCheckedChange:_,keepOpenOnItemSelect:!0,contentProps:{align:b,"aria-label":y,className:s.cn(h,`border-inp-focus-border bg-primary-bg overflow-hidden rounded-xl border py-2
|
|
2
2
|
shadow-none`)}})}exports.DataTableColumnVisibility=w;
|
|
3
3
|
//# sourceMappingURL=components-data-table-data-table-column-visibility.cjs.map
|