ics-ui-kit 0.1.18 → 0.1.20
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/{Button-Dg89xRSi.js → Button-BZ3ON1Tj.js} +2 -2
- package/dist/{Button-Dg89xRSi.js.map → Button-BZ3ON1Tj.js.map} +1 -1
- package/dist/ButtonBase-jgu7EolU.js +158 -0
- package/dist/ButtonBase-jgu7EolU.js.map +1 -0
- package/dist/CalendarPreviousMonthButton-qT7qDPbO.js +133 -0
- package/dist/CalendarPreviousMonthButton-qT7qDPbO.js.map +1 -0
- package/dist/{DayPicker-4hE1QEvO.js → DayPicker-Cu2Kn-he.js} +68 -66
- package/dist/{DayPicker-4hE1QEvO.js.map → DayPicker-Cu2Kn-he.js.map} +1 -1
- package/dist/{FormFooterTemplate-BRrgrxAu.js → FormFooterTemplate-DdNnLu2-.js} +2 -2
- package/dist/{FormFooterTemplate-BRrgrxAu.js.map → FormFooterTemplate-DdNnLu2-.js.map} +1 -1
- package/dist/{IconButton-DwkpNgn3.js → IconButton-uGJ3cQtk.js} +2 -2
- package/dist/{IconButton-DwkpNgn3.js.map → IconButton-uGJ3cQtk.js.map} +1 -1
- package/dist/{InputGroup-BcRWP-zL.js → InputGroup-AVAtosX_.js} +2 -2
- package/dist/{InputGroup-BcRWP-zL.js.map → InputGroup-AVAtosX_.js.map} +1 -1
- package/dist/{Popover-CRVD7AtB.js → Popover-KjZXxxl3.js} +2 -2
- package/dist/{Popover-CRVD7AtB.js.map → Popover-KjZXxxl3.js.map} +1 -1
- package/dist/{RichButton-DuPTenmS.js → RichButton-B1wjK7Bk.js} +2 -2
- package/dist/{RichButton-DuPTenmS.js.map → RichButton-B1wjK7Bk.js.map} +1 -1
- package/dist/{TextInput-Db0ylY91.js → TextInput-5BuZtWV6.js} +2 -2
- package/dist/{TextInput-Db0ylY91.js.map → TextInput-5BuZtWV6.js.map} +1 -1
- package/dist/{TriggerButton-CfDObWP9.js → TriggerButton-Bakr8Boi.js} +2 -2
- package/dist/{TriggerButton-CfDObWP9.js.map → TriggerButton-Bakr8Boi.js.map} +1 -1
- package/dist/blocks/auth/otp-form.js +2 -2
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/button.js +5 -5
- package/dist/components/calendar/components/calendar-dropdown/CalendarDropdown.d.ts +24 -0
- package/dist/components/calendar/styles.d.ts +61 -0
- package/dist/components/calendar-scroll/CalendarScroll.d.ts +21 -0
- package/dist/components/calendar-scroll/CalendarScroll.stories.d.ts +16 -0
- package/dist/components/calendar-scroll/index.d.ts +3 -0
- package/dist/components/calendar-scroll.d.ts +2 -0
- package/dist/components/calendar-scroll.js +183 -0
- package/dist/components/calendar-scroll.js.map +1 -0
- package/dist/components/calendar.js +53 -148
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/error-state.js +1 -1
- package/dist/components/file-upload.js +2 -2
- package/dist/components/form.js +2 -2
- package/dist/components/image-preview.js +1 -1
- package/dist/components/image-uploader.js +1 -1
- package/dist/components/input.js +4 -4
- package/dist/components/menu-item.js +3 -3
- package/dist/components/page-state.js +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/progress-circle.js +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/search-select.js +1 -1
- package/dist/components/sidebar.js +2 -2
- package/dist/components/system-state.js +1 -1
- package/dist/components/tag-input.js +1 -1
- package/dist/components/toast.js +2 -2
- package/dist/styles-scoped.css +68 -97
- package/dist/styles.css +68 -97
- package/dist/vendors/react-day-picker.js +2 -2
- package/package.json +1 -1
- package/tailwind.preset.js +5 -5
- package/dist/ButtonBase-e6qyv6mD.js +0 -158
- package/dist/ButtonBase-e6qyv6mD.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { F as w } from "./FeatureIcon-BGE0Orkc.js";
|
|
|
3
3
|
import f from "react";
|
|
4
4
|
import { T as F } from "./index-BVqs-uqP.js";
|
|
5
5
|
import { d as T, e as N, b as v, a as b } from "./FormHeader--F6b2aRk.js";
|
|
6
|
-
import { B as h } from "./Button-
|
|
6
|
+
import { B as h } from "./Button-BZ3ON1Tj.js";
|
|
7
7
|
import { a as k } from "./CheckboxField-limFbMk2.js";
|
|
8
8
|
import { e as y } from "./useBreakpoints-DHvp74UL.js";
|
|
9
9
|
const H = F({
|
|
@@ -85,4 +85,4 @@ export {
|
|
|
85
85
|
z as F,
|
|
86
86
|
R as a
|
|
87
87
|
};
|
|
88
|
-
//# sourceMappingURL=FormFooterTemplate-
|
|
88
|
+
//# sourceMappingURL=FormFooterTemplate-DdNnLu2-.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFooterTemplate-
|
|
1
|
+
{"version":3,"file":"FormFooterTemplate-DdNnLu2-.js","sources":["../src/components/form/templates/header-template/FormHeaderTemplate.tsx","../src/components/form/templates/footer-template/FormFooterTemplate.tsx"],"sourcesContent":["import { FeatureIcon } from \"@/components/icon/feature-icon/FeatureIcon\";\nimport { LucideIcon } from \"lucide-react\";\nimport React, { HTMLAttributes, PropsWithChildren } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport { FormDescription, FormHeader, FormTitle } from \"../../components/form-header/FormHeader\";\nimport { VariantsConfig } from \"@/lib/utils/variants\";\n\nexport interface FormHeaderTemplateVariants {\n\talignment?: \"compact\" | \"left\" | \"center\";\n}\n\nconst formHeaderTemplateStyles = tv({\n\tslots: {\n\t\theader: \"flex items-start gap-4\",\n\t\tcontentWrapper: \"flex flex-col gap-px lg:gap-1.5\",\n\t\ticon: \"flex-shrink-0 rounded-lg ring-0\"\n\t},\n\tvariants: {\n\t\talignment: {\n\t\t\tcompact: {\n\t\t\t\theader: \"flex-row pr-9\"\n\t\t\t},\n\t\t\tleft: {\n\t\t\t\theader: \"flex-col gap-2 lg:gap-4\",\n\t\t\t\tcontentWrapper: \"gap-0.5 lg:gap-1\"\n\t\t\t},\n\t\t\tcenter: {\n\t\t\t\theader: \"flex-col items-center gap-2 text-center lg:gap-4\",\n\t\t\t\tcontentWrapper: \"gap-0.5 lg:gap-1\"\n\t\t\t}\n\t\t}\n\t} satisfies VariantsConfig<FormHeaderTemplateVariants>,\n\tdefaultVariants: {\n\t\talignment: \"compact\"\n\t}\n});\n\nexport type BaseHeaderTemplateProps = Omit<HTMLAttributes<HTMLDivElement>, \"title\"> &\n\tFormHeaderTemplateVariants & {\n\t\t/** Заголовок формы */\n\t\ttitle: React.ReactNode;\n\t\t/** Описание формы */\n\t\tdescription?: React.ReactNode;\n\t\t/** Иконка заголовка */\n\t\ticon?: LucideIcon;\n\t\t/** Кастомная иконка заголовка */\n\t\tcustomIcon?: React.ReactNode;\n\t};\n\nexport const BaseHeaderTemplate = React.forwardRef<HTMLDivElement, PropsWithChildren<BaseHeaderTemplateProps>>(\n\t({ className, icon: Icon, title, alignment, description, customIcon, ...props }, ref) => {\n\t\tconst { header, contentWrapper, icon } = formHeaderTemplateStyles({ alignment });\n\n\t\treturn (\n\t\t\t<FormHeader ref={ref} className={header({ class: className })} {...props}>\n\t\t\t\t{Icon && <FeatureIcon size=\"xl\" icon={Icon} className={icon()} />}\n\t\t\t\t{customIcon && customIcon}\n\t\t\t\t<div className={contentWrapper()}>\n\t\t\t\t\t{title}\n\t\t\t\t\t{description}\n\t\t\t\t</div>\n\t\t\t</FormHeader>\n\t\t);\n\t}\n);\n\n/**\n * Темплейт заголовка формы. Содержит иконку, заголовок и описание.\n * Имеет различные варианты расположения элементов\n */\nexport const FormHeaderTemplate = React.forwardRef<HTMLDivElement, PropsWithChildren<BaseHeaderTemplateProps>>(\n\t({ title, description, ...props }, ref) => {\n\t\treturn (\n\t\t\t<BaseHeaderTemplate\n\t\t\t\ttitle={<FormTitle>{title}</FormTitle>}\n\t\t\t\tdescription={<FormDescription>{description}</FormDescription>}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t}\n);\n\nFormHeaderTemplate.displayName = \"FormHeaderTemplate\";\n","import { Button, ButtonProps } from \"@/components/button/button/Button\";\nimport { CheckboxField, CheckboxFieldProps } from \"@/components/checkbox/checkbox-field/CheckboxField\";\nimport { useIsMobile } from \"@/hooks/useBreakpoints\";\nimport React from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport { FormFooter } from \"../../components/form-footer/FormFooter\";\n\nconst formFooterTemplateStyles = tv({\n\tslots: {\n\t\tcontainer: \"flex w-full flex-col gap-3 lg:flex-row\",\n\t\tstartBlock: \"flex items-center py-1 lg:py-2.5\",\n\t\tendBlock: \"ml-auto flex w-full flex-col gap-3 lg:w-auto lg:flex-row\"\n\t}\n});\n\nexport interface FormFooterTemplateProps {\n\t/** Дополнительные классы */\n\tclassName?: string;\n\t/** Текст для чекбокса */\n\tcheckboxLabel?: string;\n\t/** Пропсы для чекбокса */\n\tcheckboxProps?: CheckboxFieldProps;\n\t/** Основная кнопка */\n\tprimaryButton?: React.ReactNode;\n\t/** Пропсы для основной кнопки */\n\tprimaryButtonProps?: ButtonProps;\n\t/** Вторичная кнопка */\n\tsecondaryButton?: React.ReactNode;\n\t/** Пропсы для вторичной кнопки */\n\tsecondaryButtonProps?: ButtonProps;\n}\n\n/**\n * Темплейт футера формы. Содержит чекбокс и 2 кнопки, которыми можно управлять.\n * Адаптивен к размерам устройств\n */\nexport const FormFooterTemplate = React.forwardRef<HTMLDivElement, FormFooterTemplateProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tprimaryButton,\n\t\t\tsecondaryButton,\n\t\t\tcheckboxLabel,\n\t\t\tcheckboxProps,\n\t\t\tprimaryButtonProps,\n\t\t\tsecondaryButtonProps\n\t\t},\n\t\tref\n\t) => {\n\t\tconst isMobile = useIsMobile();\n\t\tconst { container, startBlock, endBlock } = formFooterTemplateStyles();\n\n\t\tif (isMobile) {\n\t\t\tprimaryButtonProps = { ...primaryButtonProps, size: \"xl\" };\n\t\t\tsecondaryButtonProps = { ...secondaryButtonProps, size: \"xl\" };\n\t\t}\n\t\tconst primaryButtonElement = primaryButton && (\n\t\t\t<Button key=\"primary-button\" variant=\"primary\" {...primaryButtonProps}>\n\t\t\t\t{primaryButton}\n\t\t\t</Button>\n\t\t);\n\n\t\tconst secondaryButtonElement = secondaryButton && (\n\t\t\t<Button key=\"secondary-button\" variant=\"outline\" {...secondaryButtonProps}>\n\t\t\t\t{secondaryButton}\n\t\t\t</Button>\n\t\t);\n\n\t\treturn (\n\t\t\t<FormFooter className={className} ref={ref}>\n\t\t\t\t<div className={container()}>\n\t\t\t\t\t{checkboxLabel && (\n\t\t\t\t\t\t<div className={startBlock()}>\n\t\t\t\t\t\t\t<CheckboxField label={checkboxLabel} {...checkboxProps} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div className={endBlock()}>\n\t\t\t\t\t\t{isMobile\n\t\t\t\t\t\t\t? [primaryButtonElement, secondaryButtonElement]\n\t\t\t\t\t\t\t: [secondaryButtonElement, primaryButtonElement]}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</FormFooter>\n\t\t);\n\t}\n);\n\nFormFooterTemplate.displayName = \"FormFooterTemplate\";\n"],"names":["formHeaderTemplateStyles","tv","BaseHeaderTemplate","React","className","Icon","title","alignment","description","customIcon","props","ref","header","contentWrapper","icon","jsxs","FormHeader","jsx","FeatureIcon","FormHeaderTemplate","FormTitle","FormDescription","formFooterTemplateStyles","FormFooterTemplate","primaryButton","secondaryButton","checkboxLabel","checkboxProps","primaryButtonProps","secondaryButtonProps","isMobile","useIsMobile","container","startBlock","endBlock","primaryButtonElement","Button","secondaryButtonElement","FormFooter","CheckboxField"],"mappings":";;;;;;;;AAWA,MAAMA,IAA2BC,EAAG;AAAA,EACnC,OAAO;AAAA,IACN,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,MAAM;AAAA,EACP;AAAA,EACA,UAA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
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import m from "react";
|
|
3
3
|
import { T as p } from "./index-BVqs-uqP.js";
|
|
4
|
-
import { B as l } from "./ButtonBase-
|
|
4
|
+
import { B as l } from "./ButtonBase-jgu7EolU.js";
|
|
5
5
|
import { I as f } from "./Icon-DH3ev9GK.js";
|
|
6
6
|
const u = p({
|
|
7
7
|
slots: {
|
|
@@ -30,4 +30,4 @@ d.displayName = "IconButton";
|
|
|
30
30
|
export {
|
|
31
31
|
d as I
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=IconButton-
|
|
33
|
+
//# sourceMappingURL=IconButton-uGJ3cQtk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton-
|
|
1
|
+
{"version":3,"file":"IconButton-uGJ3cQtk.js","sources":["../src/components/button/icon-button/IconButton.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport { ButtonBase, ButtonBaseProps, ButtonBaseVariants } from \"../button-base/ButtonBase\";\nimport { Icon } from \"@/components/icon/Icon\";\nimport { LucideIcon } from \"lucide-react\";\nimport { VariantsConfig } from \"@/lib/utils/variants\";\n\ntype IconButtonVariants = Pick<ButtonBaseVariants, \"size\">;\n\nconst iconButtonVariants = tv({\n\tslots: {\n\t\tcontainer: \"aspect-square\",\n\t\ticon: \"h-4 w-4\"\n\t},\n\tvariants: {\n\t\tsize: {\n\t\t\txs: { container: \"p-1.5\", icon: \"h-3 w-3\" },\n\t\t\tsm: { container: \"p-2\", icon: \"h-3.5 w-3.5\" },\n\t\t\tmd: { container: \"p-2.5\" },\n\t\t\tlg: { container: \"p-3\" },\n\t\t\txl: { container: \"p-3\", icon: \"h-5 w-5\" }\n\t\t}\n\t} satisfies VariantsConfig<IconButtonVariants>,\n\tdefaultVariants: {\n\t\tsize: \"md\"\n\t}\n});\n\nexport type IconButtonProps = ButtonBaseProps &\n\tIconButtonVariants & {\n\t\ticon: LucideIcon;\n\t\ticonClassName?: string;\n\t};\n\nexport const IconButton = React.forwardRef<HTMLButtonElement, PropsWithChildren<IconButtonProps>>(\n\t({ icon, size, className, iconClassName, ...props }, ref) => {\n\t\tconst { container, icon: iconClass } = iconButtonVariants({ size });\n\n\t\treturn (\n\t\t\t<ButtonBase className={container({ class: className })} size={size} ref={ref} {...props}>\n\t\t\t\t<Icon className={iconClass({ size, className: iconClassName })} icon={icon} />\n\t\t\t</ButtonBase>\n\t\t);\n\t}\n);\n\nIconButton.displayName = \"IconButton\";\n"],"names":["iconButtonVariants","tv","IconButton","React","icon","size","className","iconClassName","props","ref","container","iconClass","jsx","ButtonBase","Icon"],"mappings":";;;;;AASA,MAAMA,IAAqBC,EAAG;AAAA,EAC7B,OAAO;AAAA,IACN,WAAW;AAAA,IACX,MAAM;AAAA,EACP;AAAA,EACA,UAAU;AAAA,IACT,MAAM;AAAA,MACL,IAAI,EAAE,WAAW,SAAS,MAAM,UAAU;AAAA,MAC1C,IAAI,EAAE,WAAW,OAAO,MAAM,cAAc;AAAA,MAC5C,IAAI,EAAE,WAAW,QAAQ;AAAA,MACzB,IAAI,EAAE,WAAW,MAAM;AAAA,MACvB,IAAI,EAAE,WAAW,OAAO,MAAM,UAAU;AAAA,IAAA;AAAA,EAE1C;AAAA,EACA,iBAAiB;AAAA,IAChB,MAAM;AAAA,EAAA;AAER,CAAC,GAQYC,IAAaC,EAAM;AAAA,EAC/B,CAAC,EAAE,MAAAC,GAAM,MAAAC,GAAM,WAAAC,GAAW,eAAAC,GAAe,GAAGC,EAAM,GAAGC,MAAQ;AACtD,UAAA,EAAE,WAAAC,GAAW,MAAMC,MAAcX,EAAmB,EAAE,MAAAK,GAAM;AAGjE,WAAA,gBAAAO,EAACC,GAAW,EAAA,WAAWH,EAAU,EAAE,OAAOJ,GAAW,GAAG,MAAAD,GAAY,KAAAI,GAAW,GAAGD,GACjF,UAAC,gBAAAI,EAAAE,GAAA,EAAK,WAAWH,EAAU,EAAE,MAAAN,GAAM,WAAWE,EAAe,CAAA,GAAG,MAAAH,EAAA,CAAY,EAC7E,CAAA;AAAA,EAAA;AAGH;AAEAF,EAAW,cAAc;"}
|
|
@@ -3,7 +3,7 @@ import s, { useRef as d } from "react";
|
|
|
3
3
|
import { T as u } from "./index-BVqs-uqP.js";
|
|
4
4
|
import { u as l, i as b } from "./inputBaseStyles-BfZIWuQ6.js";
|
|
5
5
|
import { u as f } from "./useMergeRefs-qoKniYqT.js";
|
|
6
|
-
import { I as c } from "./IconButton-
|
|
6
|
+
import { I as c } from "./IconButton-uGJ3cQtk.js";
|
|
7
7
|
const h = u({
|
|
8
8
|
extend: b,
|
|
9
9
|
base: [
|
|
@@ -132,4 +132,4 @@ export {
|
|
|
132
132
|
w as c,
|
|
133
133
|
N as d
|
|
134
134
|
};
|
|
135
|
-
//# sourceMappingURL=InputGroup-
|
|
135
|
+
//# sourceMappingURL=InputGroup-AVAtosX_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup-BcRWP-zL.js","sources":["../src/components/input/input-group/InputGroup.tsx"],"sourcesContent":["import React, { useRef } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport { inputBaseElementStyles } from \"../styles/inputBaseStyles\";\nimport { useMergeRefs } from \"@/hooks/useMergeRefs\";\nimport { useCustomValidity } from \"@/hooks/useCustomValidity\";\nimport { IconButton } from \"@/components/button\";\nimport { LucideIcon } from \"lucide-react\";\nimport { ButtonBaseProps } from \"@/components/button/button-base/ButtonBase\";\nimport { VariantsConfig } from \"@/lib/utils/variants\";\n\nconst inputGroupStyles = tv({\n\textend: inputBaseElementStyles,\n\tbase: [\n\t\t\"group/input-group flex h-10 px-0 py-0 lg:h-9 lg:py-0\",\n\t\t\"has-[input:focus]:border-secondary-border has-[input:focus]:bg-secondary-bg has-[input:focus]:shadow-focus\",\n\t\t\"has-[div[data-input-group-element='contenteditable']:focus]:border-secondary-border has-[div[data-input-group-element='contenteditable']:focus]:bg-secondary-bg has-[div[data-input-group-element='contenteditable']:focus]:shadow-focus\",\n\n\t\t// Стили для обычных read-only input'ов (исключая file)\n\t\t\"has-[input:read-only:not([type='file'])]:border-primary-border\",\n\t\t\"has-[input:read-only:not([type='file'])]:bg-secondary-bg-hover\",\n\t\t\"has-[input:read-only:not([type='file'])]:shadow-none\",\n\t\t\"has-[input:read-only:not([type='file'])]:hover:bg-secondary-bg-hover\",\n\t\t\"has-[input:read-only:not([type='file'])]:has-[input:focus]:!bg-secondary-bg-hover\",\n\t\t\"has-[input:read-only:not([type='file'])]:has-[input:focus]:shadow-focus\",\n\n\t\t\"has-[input:disabled]:border-primary-border\",\n\t\t\"has-[input:disabled]:bg-secondary-bg-hover\",\n\t\t\"has-[input:disabled]:shadow-soft-sm\",\n\t\t\"has-[input:invalid]:border-status-error-secondary-border\",\n\t\t\"has-[input:invalid]:shadow-soft-base\",\n\t\t\"has-[input:invalid]:hover:border-status-error-primary-border\",\n\t\t\"has-[input:invalid]:has-[input:focus]:border-status-error-secondary-border\",\n\t\t\"has-[input:invalid]:has-[input:focus]:shadow-focus-error\",\n\t\t\"has-[input[aria-invalid=true]]:border-status-error-secondary-border\",\n\t\t\"has-[input[aria-invalid=true]]:shadow-soft-base\",\n\t\t\"has-[input[aria-invalid=true]]:hover:border-status-error-primary-border\",\n\t\t\"has-[input[aria-invalid=true]]:has-[input:focus]:border-status-error-secondary-border\",\n\t\t\"has-[input[aria-invalid=true]]:has-[input:focus]:shadow-focus-error\",\n\n\t\t// Стили для автозаполнения - применяем фон ко всей группе\n\t\t\"has-[input:-webkit-autofill]:bg-[hsl(var(--autofill-bg))]\",\n\t\t\"has-[input:-webkit-autofill]:has-[input:focus]:bg-[hsl(var(--autofill-bg))]\"\n\t]\n});\n\n/**\n * Контейнер для группировки инпутов с дополнительными элементами (текст, кнопки).\n * Позволяет создавать композиции из инпутов, текстовых блоков и кнопок.\n */\nconst InputGroup = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(\n\t({ className, children, ...props }, ref) => {\n\t\tconst styles = inputGroupStyles({ className });\n\n\t\treturn (\n\t\t\t<div ref={ref} className={styles} {...props}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nInputGroup.displayName = \"InputGroup\";\n\nconst inputGroupInputStyles = tv({\n\tbase: [\n\t\t\"min-w-5 flex-1 rounded-lg bg-transparent py-2.5 pl-3 lg:py-2\",\n\t\t\"outline-none placeholder:text-muted focus:outline-none\",\n\t\t// Градиентная маска для плавного обрезания текста слева\n\t\t\"[mask-image:linear-gradient(to_left,rgba(255,255,255,0),#fff_15%)]\",\n\t\t// Стили для автозаполнения - убираем фон у самого input'а\n\t\t\"[-webkit-autofill]:bg-transparent\",\n\t\t\"[-webkit-autofill]:shadow-none\"\n\t]\n});\n\nexport interface InputGroupInputProps extends React.ComponentProps<\"input\"> {\n\terror?: string;\n}\n\n/**\n * Инпут для использования в группе.\n */\nconst InputGroupInput = React.forwardRef<HTMLInputElement, InputGroupInputProps>(\n\t({ className, error, ...props }, ref) => {\n\t\tconst styles = inputGroupInputStyles({ className });\n\t\tconst inputRef = useRef<HTMLInputElement>(null);\n\t\tconst mergedRef = useMergeRefs(inputRef, ref);\n\n\t\tuseCustomValidity(inputRef, error);\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\tref={mergedRef}\n\t\t\t\tclassName={styles}\n\t\t\t\taria-invalid={!!error}\n\t\t\t\tdata-input-group-element=\"input\"\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t}\n);\n\nInputGroupInput.displayName = \"InputGroup.Input\";\n\ntype InputGroupTextVariants = {\n\ttype?: \"primary\";\n};\n\nconst inputGroupTextStyles = tv({\n\tbase: [\n\t\t\"flex h-full items-center border-l border-secondary-border px-3 text-secondary-fg first:border-l-0\",\n\t\t// Правая граница, если следующий элемент НЕ InputGroupText\n\t\t\"[&[data-input-group-element='text']:has(+_:not([data-input-group-element='text']))]:border-r\"\n\t],\n\tvariants: {\n\t\ttype: {\n\t\t\tprimary: \"rounded-l-lg bg-secondary-bg-hover\"\n\t\t}\n\t} satisfies VariantsConfig<InputGroupTextVariants>\n});\n\ntype InputGroupTextProps = React.ComponentProps<\"div\"> & InputGroupTextVariants;\n\n/**\n * Текстовый элемент для отображения префикса или суффикса в группе инпутов.\n */\nconst InputGroupText = React.forwardRef<HTMLDivElement, InputGroupTextProps>(({ className, type, ...props }, ref) => {\n\tconst styles = inputGroupTextStyles({ className, type });\n\treturn <div ref={ref} className={styles} data-input-group-element=\"text\" {...props} />;\n});\n\nInputGroupText.displayName = \"InputGroup.Text\";\n\nconst inputGroupContentEditableStyles = tv({\n\tbase: [\"bg-transparent py-2.5 pl-3 lg:py-2\", \"outline-none focus:outline-none\"]\n});\n\nexport interface InputGroupContentEditableProps extends React.ComponentProps<\"div\"> {\n\terror?: string;\n}\n\n/**\n * Contenteditable элемент для использования в группе.\n */\nconst InputGroupContentEditable = React.forwardRef<HTMLDivElement, InputGroupContentEditableProps>(\n\t({ className, error, ...props }, ref) => {\n\t\tconst styles = inputGroupContentEditableStyles({ className });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={styles}\n\t\t\t\tcontentEditable\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-invalid={!!error}\n\t\t\t\tdata-input-group-element=\"contenteditable\"\n\t\t\t\tsuppressContentEditableWarning={true}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t}\n);\n\nInputGroupContentEditable.displayName = \"InputGroup.ContentEditable\";\n\nconst inputGroupButtonStyles = tv({\n\tbase: [\"aspect-auto h-full px-1.5 py-2.5 first:pl-2.5 last:pr-2.5 lg:py-2\"]\n});\n\ntype InputGroupButtonProps = ButtonBaseProps & {\n\ticon: LucideIcon;\n\ticonClassName?: string;\n};\n\nconst InputGroupButton = React.forwardRef<HTMLButtonElement, InputGroupButtonProps>(\n\t({ icon, className, ...props }, ref) => {\n\t\tconst styles = inputGroupButtonStyles({ className });\n\t\treturn (\n\t\t\t<IconButton\n\t\t\t\tref={ref}\n\t\t\t\ticon={icon}\n\t\t\t\tclassName={styles}\n\t\t\t\tvariant=\"text\"\n\t\t\t\tsize=\"md\"\n\t\t\t\tdata-input-group-element=\"button\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t}\n);\n\nInputGroupButton.displayName = \"InputGroup.Button\";\n\nexport { InputGroupText, InputGroupInput, InputGroup, InputGroupButton, InputGroupContentEditable };\n"],"names":["inputGroupStyles","tv","inputBaseElementStyles","InputGroup","React","className","children","props","ref","styles","inputGroupInputStyles","InputGroupInput","error","inputRef","useRef","mergedRef","useMergeRefs","useCustomValidity","jsx","inputGroupTextStyles","InputGroupText","type","inputGroupContentEditableStyles","InputGroupContentEditable","inputGroupButtonStyles","InputGroupButton","icon","IconButton"],"mappings":";;;;;;AAUA,MAAMA,IAAmBC,EAAG;AAAA,EAC3B,QAAQC;AAAA,EACR,MAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,EAAA;AAEF,CAAC,GAMKC,IAAaC,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAASC,MAAQ;AAC3C,UAAMC,IAAST,EAAiB,EAAE,WAAAK,GAAW;AAE7C,6BACE,OAAI,EAAA,KAAAG,GAAU,WAAWC,GAAS,GAAGF,GACpC,UAAAD,GACF;AAAA,EAAA;AAGH;AAEAH,EAAW,cAAc;AAEzB,MAAMO,IAAwBT,EAAG;AAAA,EAChC,MAAM;AAAA,IAC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AAA,gBAAAa;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,KAAAV;AAAA,QACA,WAAWC;AAAA,QACX,iBAAe;AAAA,QACf,MAAK;AAAA,QACL,gBAAc,CAAC,CAACG;AAAA,QAChB,4BAAyB;AAAA,QACzB,gCAAgC;AAAA,QAC/B,GAAGL;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGH;AAEAgB,EAA0B,cAAc;AAExC,MAAMC,IAAyBvB,EAAG;AAAA,EACjC,MAAM,CAAC,mEAAmE;AAC3E,CAAC,GAOKwB,IAAmBrB,EAAM;AAAA,EAC9B,CAAC,EAAE,MAAAsB,GAAM,WAAArB,GAAW,GAAGE,EAAA,GAASC,MAAQ;AACvC,UAAMC,IAASe,EAAuB,EAAE,WAAAnB,GAAW;AAElD,WAAA,gBAAAa;AAAA,MAACS;AAAA,MAAA;AAAA,QACA,KAAAnB;AAAA,QACA,MAAAkB;AAAA,QACA,WAAWjB;AAAA,QACX,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,4BAAyB;AAAA,QACzB,MAAK;AAAA,QACJ,GAAGF;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGH;AAEAkB,EAAiB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"InputGroup-AVAtosX_.js","sources":["../src/components/input/input-group/InputGroup.tsx"],"sourcesContent":["import React, { useRef } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport { inputBaseElementStyles } from \"../styles/inputBaseStyles\";\nimport { useMergeRefs } from \"@/hooks/useMergeRefs\";\nimport { useCustomValidity } from \"@/hooks/useCustomValidity\";\nimport { IconButton } from \"@/components/button\";\nimport { LucideIcon } from \"lucide-react\";\nimport { ButtonBaseProps } from \"@/components/button/button-base/ButtonBase\";\nimport { VariantsConfig } from \"@/lib/utils/variants\";\n\nconst inputGroupStyles = tv({\n\textend: inputBaseElementStyles,\n\tbase: [\n\t\t\"group/input-group flex h-10 px-0 py-0 lg:h-9 lg:py-0\",\n\t\t\"has-[input:focus]:border-secondary-border has-[input:focus]:bg-secondary-bg has-[input:focus]:shadow-focus\",\n\t\t\"has-[div[data-input-group-element='contenteditable']:focus]:border-secondary-border has-[div[data-input-group-element='contenteditable']:focus]:bg-secondary-bg has-[div[data-input-group-element='contenteditable']:focus]:shadow-focus\",\n\n\t\t// Стили для обычных read-only input'ов (исключая file)\n\t\t\"has-[input:read-only:not([type='file'])]:border-primary-border\",\n\t\t\"has-[input:read-only:not([type='file'])]:bg-secondary-bg-hover\",\n\t\t\"has-[input:read-only:not([type='file'])]:shadow-none\",\n\t\t\"has-[input:read-only:not([type='file'])]:hover:bg-secondary-bg-hover\",\n\t\t\"has-[input:read-only:not([type='file'])]:has-[input:focus]:!bg-secondary-bg-hover\",\n\t\t\"has-[input:read-only:not([type='file'])]:has-[input:focus]:shadow-focus\",\n\n\t\t\"has-[input:disabled]:border-primary-border\",\n\t\t\"has-[input:disabled]:bg-secondary-bg-hover\",\n\t\t\"has-[input:disabled]:shadow-soft-sm\",\n\t\t\"has-[input:invalid]:border-status-error-secondary-border\",\n\t\t\"has-[input:invalid]:shadow-soft-base\",\n\t\t\"has-[input:invalid]:hover:border-status-error-primary-border\",\n\t\t\"has-[input:invalid]:has-[input:focus]:border-status-error-secondary-border\",\n\t\t\"has-[input:invalid]:has-[input:focus]:shadow-focus-error\",\n\t\t\"has-[input[aria-invalid=true]]:border-status-error-secondary-border\",\n\t\t\"has-[input[aria-invalid=true]]:shadow-soft-base\",\n\t\t\"has-[input[aria-invalid=true]]:hover:border-status-error-primary-border\",\n\t\t\"has-[input[aria-invalid=true]]:has-[input:focus]:border-status-error-secondary-border\",\n\t\t\"has-[input[aria-invalid=true]]:has-[input:focus]:shadow-focus-error\",\n\n\t\t// Стили для автозаполнения - применяем фон ко всей группе\n\t\t\"has-[input:-webkit-autofill]:bg-[hsl(var(--autofill-bg))]\",\n\t\t\"has-[input:-webkit-autofill]:has-[input:focus]:bg-[hsl(var(--autofill-bg))]\"\n\t]\n});\n\n/**\n * Контейнер для группировки инпутов с дополнительными элементами (текст, кнопки).\n * Позволяет создавать композиции из инпутов, текстовых блоков и кнопок.\n */\nconst InputGroup = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(\n\t({ className, children, ...props }, ref) => {\n\t\tconst styles = inputGroupStyles({ className });\n\n\t\treturn (\n\t\t\t<div ref={ref} className={styles} {...props}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nInputGroup.displayName = \"InputGroup\";\n\nconst inputGroupInputStyles = tv({\n\tbase: [\n\t\t\"min-w-5 flex-1 rounded-lg bg-transparent py-2.5 pl-3 lg:py-2\",\n\t\t\"outline-none placeholder:text-muted focus:outline-none\",\n\t\t// Градиентная маска для плавного обрезания текста слева\n\t\t\"[mask-image:linear-gradient(to_left,rgba(255,255,255,0),#fff_15%)]\",\n\t\t// Стили для автозаполнения - убираем фон у самого input'а\n\t\t\"[-webkit-autofill]:bg-transparent\",\n\t\t\"[-webkit-autofill]:shadow-none\"\n\t]\n});\n\nexport interface InputGroupInputProps extends React.ComponentProps<\"input\"> {\n\terror?: string;\n}\n\n/**\n * Инпут для использования в группе.\n */\nconst InputGroupInput = React.forwardRef<HTMLInputElement, InputGroupInputProps>(\n\t({ className, error, ...props }, ref) => {\n\t\tconst styles = inputGroupInputStyles({ className });\n\t\tconst inputRef = useRef<HTMLInputElement>(null);\n\t\tconst mergedRef = useMergeRefs(inputRef, ref);\n\n\t\tuseCustomValidity(inputRef, error);\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\tref={mergedRef}\n\t\t\t\tclassName={styles}\n\t\t\t\taria-invalid={!!error}\n\t\t\t\tdata-input-group-element=\"input\"\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t}\n);\n\nInputGroupInput.displayName = \"InputGroup.Input\";\n\ntype InputGroupTextVariants = {\n\ttype?: \"primary\";\n};\n\nconst inputGroupTextStyles = tv({\n\tbase: [\n\t\t\"flex h-full items-center border-l border-secondary-border px-3 text-secondary-fg first:border-l-0\",\n\t\t// Правая граница, если следующий элемент НЕ InputGroupText\n\t\t\"[&[data-input-group-element='text']:has(+_:not([data-input-group-element='text']))]:border-r\"\n\t],\n\tvariants: {\n\t\ttype: {\n\t\t\tprimary: \"rounded-l-lg bg-secondary-bg-hover\"\n\t\t}\n\t} satisfies VariantsConfig<InputGroupTextVariants>\n});\n\ntype InputGroupTextProps = React.ComponentProps<\"div\"> & InputGroupTextVariants;\n\n/**\n * Текстовый элемент для отображения префикса или суффикса в группе инпутов.\n */\nconst InputGroupText = React.forwardRef<HTMLDivElement, InputGroupTextProps>(({ className, type, ...props }, ref) => {\n\tconst styles = inputGroupTextStyles({ className, type });\n\treturn <div ref={ref} className={styles} data-input-group-element=\"text\" {...props} />;\n});\n\nInputGroupText.displayName = \"InputGroup.Text\";\n\nconst inputGroupContentEditableStyles = tv({\n\tbase: [\"bg-transparent py-2.5 pl-3 lg:py-2\", \"outline-none focus:outline-none\"]\n});\n\nexport interface InputGroupContentEditableProps extends React.ComponentProps<\"div\"> {\n\terror?: string;\n}\n\n/**\n * Contenteditable элемент для использования в группе.\n */\nconst InputGroupContentEditable = React.forwardRef<HTMLDivElement, InputGroupContentEditableProps>(\n\t({ className, error, ...props }, ref) => {\n\t\tconst styles = inputGroupContentEditableStyles({ className });\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={styles}\n\t\t\t\tcontentEditable\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-invalid={!!error}\n\t\t\t\tdata-input-group-element=\"contenteditable\"\n\t\t\t\tsuppressContentEditableWarning={true}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t}\n);\n\nInputGroupContentEditable.displayName = \"InputGroup.ContentEditable\";\n\nconst inputGroupButtonStyles = tv({\n\tbase: [\"aspect-auto h-full px-1.5 py-2.5 first:pl-2.5 last:pr-2.5 lg:py-2\"]\n});\n\ntype InputGroupButtonProps = ButtonBaseProps & {\n\ticon: LucideIcon;\n\ticonClassName?: string;\n};\n\nconst InputGroupButton = React.forwardRef<HTMLButtonElement, InputGroupButtonProps>(\n\t({ icon, className, ...props }, ref) => {\n\t\tconst styles = inputGroupButtonStyles({ className });\n\t\treturn (\n\t\t\t<IconButton\n\t\t\t\tref={ref}\n\t\t\t\ticon={icon}\n\t\t\t\tclassName={styles}\n\t\t\t\tvariant=\"text\"\n\t\t\t\tsize=\"md\"\n\t\t\t\tdata-input-group-element=\"button\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t}\n);\n\nInputGroupButton.displayName = \"InputGroup.Button\";\n\nexport { InputGroupText, InputGroupInput, InputGroup, InputGroupButton, InputGroupContentEditable };\n"],"names":["inputGroupStyles","tv","inputBaseElementStyles","InputGroup","React","className","children","props","ref","styles","inputGroupInputStyles","InputGroupInput","error","inputRef","useRef","mergedRef","useMergeRefs","useCustomValidity","jsx","inputGroupTextStyles","InputGroupText","type","inputGroupContentEditableStyles","InputGroupContentEditable","inputGroupButtonStyles","InputGroupButton","icon","IconButton"],"mappings":";;;;;;AAUA,MAAMA,IAAmBC,EAAG;AAAA,EAC3B,QAAQC;AAAA,EACR,MAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,EAAA;AAEF,CAAC,GAMKC,IAAaC,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAASC,MAAQ;AAC3C,UAAMC,IAAST,EAAiB,EAAE,WAAAK,GAAW;AAE7C,6BACE,OAAI,EAAA,KAAAG,GAAU,WA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A,EACvC,CAAC,EAAE,WAAAC,GAAW,OAAAO,GAAO,GAAGL,EAAA,GAASC,MAAQ;AACxC,UAAMC,IAASa,EAAgC,EAAE,WAAAjB,GAAW;AAG3D,WAAA,gBAAAa;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,KAAAV;AAAA,QACA,WAAWC;AAAA,QACX,iBAAe;AAAA,QACf,MAAK;AAAA,QACL,gBAAc,CAAC,CAACG;AAAA,QAChB,4BAAyB;AAAA,QACzB,gCAAgC;AAAA,QAC/B,GAAGL;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGH;AAEAgB,EAA0B,cAAc;AAExC,MAAMC,IAAyBvB,EAAG;AAAA,EACjC,MAAM,CAAC,mEAAmE;AAC3E,CAAC,GAOKwB,IAAmBrB,EAAM;AAAA,EAC9B,CAAC,EAAE,MAAAsB,GAAM,WAAArB,GAAW,GAAGE,EAAA,GAASC,MAAQ;AACvC,UAAMC,IAASe,EAAuB,EAAE,WAAAnB,GAAW;AAElD,WAAA,gBAAAa;AAAA,MAACS;AAAA,MAAA;AAAA,QACA,KAAAnB;AAAA,QACA,MAAAkB;AAAA,QACA,WAAWjB;AAAA,QACX,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,4BAAyB;AAAA,QACzB,MAAK;AAAA,QACJ,GAAGF;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGH;AAEAkB,EAAiB,cAAc;"}
|
|
@@ -13,7 +13,7 @@ import { h as X } from "./index-BjtNfqNq.js";
|
|
|
13
13
|
import { T as y } from "./index-BVqs-uqP.js";
|
|
14
14
|
import { u as oo } from "./ComponentVariantProvider-brk0g-hm.js";
|
|
15
15
|
import { u as eo } from "./usePortalContainer-BAIp0kSF.js";
|
|
16
|
-
import { T as ro } from "./TriggerButton-
|
|
16
|
+
import { T as ro } from "./TriggerButton-Bakr8Boi.js";
|
|
17
17
|
var C = "Popover", [E, $o] = H(C, [
|
|
18
18
|
x
|
|
19
19
|
]), g = x(), [to, u] = E(C), N = (o) => {
|
|
@@ -272,4 +272,4 @@ export {
|
|
|
272
272
|
zo as c,
|
|
273
273
|
Ao as d
|
|
274
274
|
};
|
|
275
|
-
//# sourceMappingURL=Popover-
|
|
275
|
+
//# sourceMappingURL=Popover-KjZXxxl3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover-CRVD7AtB.js","sources":["../node_modules/.pnpm/@radix-ui+react-popover@1.1.15_@types+react-dom@18.3.6_@types+react@18.3.20__@types+rea_3205396e68ca917639ebdf7a5c8fe165/node_modules/@radix-ui/react-popover/dist/index.mjs","../src/components/popover/Popover.tsx"],"sourcesContent":["\"use client\";\n\n// src/popover.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar POPOVER_NAME = \"Popover\";\nvar [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);\nvar Popover = (props) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: POPOVER_NAME\n });\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n PopoverProvider,\n {\n scope: __scopePopover,\n contentId: useId(),\n triggerRef,\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n hasCustomAnchor,\n onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),\n onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),\n modal,\n children\n }\n ) });\n};\nPopover.displayName = POPOVER_NAME;\nvar ANCHOR_NAME = \"PopoverAnchor\";\nvar PopoverAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nPopoverAnchor.displayName = ANCHOR_NAME;\nvar TRIGGER_NAME = \"PopoverTrigger\";\nvar PopoverTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n const trigger = /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger });\n }\n);\nPopoverTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"PopoverPortal\";\nvar [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar PopoverPortal = (props) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nPopoverPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"PopoverContent\";\nvar PopoverContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nPopoverContent.displayName = CONTENT_NAME;\nvar Slot = createSlot(\"PopoverContent.RemoveScroll\");\nvar PopoverContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: false }\n ),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nvar PopoverContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar PopoverContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopover,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n useFocusGuards();\n return /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onInteractOutside,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onDismiss: () => context.onOpenChange(false),\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n \"data-state\": getState(context.open),\n role: \"dialog\",\n id: context.contentId,\n ...popperScope,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-popover-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-popover-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-popover-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-popover-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-popover-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n )\n }\n )\n }\n );\n }\n);\nvar CLOSE_NAME = \"PopoverClose\";\nvar PopoverClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nPopoverClose.displayName = CLOSE_NAME;\nvar ARROW_NAME = \"PopoverArrow\";\nvar PopoverArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nPopoverArrow.displayName = ARROW_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Root2 = Popover;\nvar Anchor2 = PopoverAnchor;\nvar Trigger = PopoverTrigger;\nvar Portal = PopoverPortal;\nvar Content2 = PopoverContent;\nvar Close = PopoverClose;\nvar Arrow2 = PopoverArrow;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n Close,\n Content2 as Content,\n Popover,\n PopoverAnchor,\n PopoverArrow,\n PopoverClose,\n PopoverContent,\n PopoverPortal,\n PopoverTrigger,\n Portal,\n Root2 as Root,\n Trigger,\n createPopoverScope\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { tv } from \"tailwind-variants\";\nimport { useComponentVariant } from \"@/providers/component-variant-context\";\nimport { usePortalContainer } from \"../portal-container\";\nimport { TriggerButton } from \"../button\";\nimport type { TriggerButtonProps } from \"../button/trigger-button/TriggerButton\";\n\nconst POPOVER_ANATOMY = [\n\t\"z-50 w-72 outline-none\",\n\t\"origin-[--radix-popover-content-transform-origin]\",\n\t\"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n\t\"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n\t\"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n\t\"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\",\n\t\"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\"\n];\n\nconst popoverStyles = tv({\n\tbase: [\n\t\t...POPOVER_ANATOMY,\n\t\t\"rounded-lg border border-secondary-border bg-secondary-bg p-4 text-popover-foreground shadow-soft-md\"\n\t]\n});\n\nconst glassPopoverStyles = tv({\n\tbase: [\n\t\t...POPOVER_ANATOMY,\n\t\t\"backdrop-glass-regular rounded-2xl bg-alpha-40 p-2 text-popover-foreground shadow-glass-md\"\n\t]\n});\n\ntype PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n\t/**\n\t * Контейнер для портала. Если не указан, используется хук usePortalContainer\n\t * для поиска PortalContainer\n\t */\n\tportalContainer?: HTMLElement;\n};\n\n/**\n * Корневой компонент Popover, который оборачивает всю функциональность всплывающего окна.\n * Построен на основе Radix UI Popover primitive.\n */\nconst Popover = PopoverPrimitive.Root;\n\n/**\n * Элемент-триггер, который открывает всплывающее окно при клике.\n */\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\n/**\n * Элемент-якорь, относительно которого позиционируется всплывающее окно.\n */\nconst PopoverAnchor = PopoverPrimitive.Anchor;\n\n/**\n * Компонент содержимого всплывающего окна.\n */\nconst PopoverContent = React.forwardRef<React.ElementRef<typeof PopoverPrimitive.Content>, PopoverContentProps>(\n\t({ className, align = \"center\", sideOffset = 4, portalContainer, ...props }, ref) => {\n\t\tconst { variant } = useComponentVariant();\n\t\tconst container = usePortalContainer(portalContainer);\n\t\tconst contentClassName = variant === \"glass\" ? glassPopoverStyles({ className }) : popoverStyles({ className });\n\t\treturn (\n\t\t\t<PopoverPrimitive.Portal container={container}>\n\t\t\t\t<PopoverPrimitive.Content\n\t\t\t\t\t// Фикс скроллинга внутри Popover когда он находится в Dialog\n\t\t\t\t\t// RemoveScroll в Dialog блокирует прокрутку body, но может блокировать и вложенные элементы\n\t\t\t\t\t// stopPropagation предотвращает всплытие событий скроллинга к заблокированному body\n\t\t\t\t\t// https://github.com/radix-ui/primitives/issues/1159\n\t\t\t\t\tonWheel={(e) => {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t}}\n\t\t\t\t\tonTouchMove={(e) => {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t}}\n\t\t\t\t\tref={ref}\n\t\t\t\t\talign={align}\n\t\t\t\t\tsideOffset={sideOffset}\n\t\t\t\t\tclassName={contentClassName}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</PopoverPrimitive.Portal>\n\t\t);\n\t}\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\n/**\n * Компонент-обертка для использования TriggerButton в качестве триггера поповера\n */\nconst PopoverTriggerButton = React.forwardRef<\n\tReact.ElementRef<typeof PopoverTrigger>,\n\tReact.ComponentPropsWithoutRef<typeof PopoverTrigger> & Omit<TriggerButtonProps, \"dataState\">\n>(({ children, ...props }, ref) => {\n\treturn (\n\t\t<PopoverTrigger asChild ref={ref}>\n\t\t\t<TriggerButton {...props}>{children}</TriggerButton>\n\t\t</PopoverTrigger>\n\t);\n});\n\nPopoverTriggerButton.displayName = \"PopoverTriggerButton\";\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverTriggerButton };\n"],"names":["POPOVER_NAME","createPopoverContext","createPopoverScope","createContextScope","createPopperScope","usePopperScope","PopoverProvider","usePopoverContext","Popover","props","__scopePopover","children","openProp","defaultOpen","onOpenChange","modal","popperScope","triggerRef","React","hasCustomAnchor","setHasCustomAnchor","open","setOpen","useControllableState","jsx","PopperPrimitive.Root","useId","prevOpen","ANCHOR_NAME","PopoverAnchor","forwardedRef","anchorProps","context","onCustomAnchorAdd","onCustomAnchorRemove","PopperPrimitive.Anchor","TRIGGER_NAME","PopoverTrigger","triggerProps","composedTriggerRef","useComposedRefs","trigger","Primitive","getState","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","PopoverPortal","forceMount","container","Presence","PortalPrimitive","CONTENT_NAME","PopoverContent","portalContext","contentProps","PopoverContentModal","PopoverContentNonModal","Slot","createSlot","contentRef","composedRefs","isRightClickOutsideRef","content","hideOthers","RemoveScroll","PopoverContentImpl","event","originalEvent","ctrlLeftClick","isRightClick","hasInteractedOutsideRef","hasPointerDownOutsideRef","target","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","useFocusGuards","FocusScope","DismissableLayer","PopperPrimitive.Content","CLOSE_NAME","PopoverClose","closeProps","ARROW_NAME","PopoverArrow","arrowProps","PopperPrimitive.Arrow","Root2","Anchor2","Trigger","Portal","Content2","POPOVER_ANATOMY","popoverStyles","tv","glassPopoverStyles","PopoverPrimitive.Root","PopoverPrimitive.Trigger","PopoverPrimitive.Anchor","className","align","sideOffset","portalContainer","ref","variant","useComponentVariant","usePortalContainer","contentClassName","PopoverPrimitive.Portal","PopoverPrimitive.Content","e","PopoverTriggerButton","TriggerButton"],"mappings":";;;;;;;;;;;;;;;;AAqBA,IAAIA,IAAe,WACf,CAACC,GAAsBC,EAAkB,IAAIC,EAAmBH,GAAc;AAAA,EAChFI;AACF,CAAC,GACGC,IAAiBD,EAAmB,GACpC,CAACE,IAAiBC,CAAiB,IAAIN,EAAqBD,CAAY,GACxEQ,IAAU,CAACC,MAAU;AACvB,QAAM;AAAA,IACJ,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAMC;AAAA,IACN,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,EACZ,IAAMN,GACEO,IAAcX,EAAeK,CAAc,GAC3CO,IAAaC,EAAM,OAAO,IAAI,GAC9B,CAACC,GAAiBC,CAAkB,IAAIF,EAAM,SAAS,EAAK,GAC5D,CAACG,GAAMC,CAAO,IAAIC,EAAqB;AAAA,IAC3C,MAAMX;AAAA,IACN,aAAaC,KAAe;AAAA,IAC5B,UAAUC;AAAA,IACV,QAAQd;AAAA,EACZ,CAAG;AACD,SAAuB,gBAAAwB,EAAIC,GAAsB,EAAE,GAAGT,GAAa,UAA0B,gBAAAQ;AAAA,IAC3FlB;AAAA,IACA;AAA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AAjE,GACxB,UAAA,gBAAA1B;AAAA,MAAC4F;AAAAA,MAAA;AAAA,QAKA,SAAS,CAACC,MAAM;AACf,UAAAA,EAAE,gBAAgB;AAAA,QACnB;AAAA,QACA,aAAa,CAACA,MAAM;AACnB,UAAAA,EAAE,gBAAgB;AAAA,QACnB;AAAA,QACA,KAAAP;AAAA,QACA,OAAAH;AAAA,QACA,YAAAC;AAAA,QACA,WAAWM;AAAA,QACV,GAAGzG;AAAA,MAAA;AAAA,IAAA,GAEN;AAAA,EAAA;AAGH;AACA6C,GAAe,cAAc8D,EAAyB;AAKhD,MAAAE,KAAuBpG,EAAM,WAGjC,CAAC,EAAE,UAAAP,GAAU,GAAGF,EAAM,GAAGqG,MAEzB,gBAAAtF,EAACa,IAAe,EAAA,SAAO,IAAC,KAAAyE,GACvB,4BAACS,IAAe,EAAA,GAAG9G,GAAQ,UAAAE,EAAA,CAAS,EACrC,CAAA,CAED;AAED2G,GAAqB,cAAc;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"Popover-KjZXxxl3.js","sources":["../node_modules/.pnpm/@radix-ui+react-popover@1.1.15_@types+react-dom@18.3.6_@types+react@18.3.20__@types+rea_3205396e68ca917639ebdf7a5c8fe165/node_modules/@radix-ui/react-popover/dist/index.mjs","../src/components/popover/Popover.tsx"],"sourcesContent":["\"use client\";\n\n// src/popover.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar POPOVER_NAME = \"Popover\";\nvar [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);\nvar Popover = (props) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: POPOVER_NAME\n });\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n PopoverProvider,\n {\n scope: __scopePopover,\n contentId: useId(),\n triggerRef,\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n hasCustomAnchor,\n onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),\n onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),\n modal,\n children\n }\n ) });\n};\nPopover.displayName = POPOVER_NAME;\nvar ANCHOR_NAME = \"PopoverAnchor\";\nvar PopoverAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nPopoverAnchor.displayName = ANCHOR_NAME;\nvar TRIGGER_NAME = \"PopoverTrigger\";\nvar PopoverTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n const trigger = /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger });\n }\n);\nPopoverTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"PopoverPortal\";\nvar [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar PopoverPortal = (props) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nPopoverPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"PopoverContent\";\nvar PopoverContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nPopoverContent.displayName = CONTENT_NAME;\nvar Slot = createSlot(\"PopoverContent.RemoveScroll\");\nvar PopoverContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: false }\n ),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nvar PopoverContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar PopoverContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopover,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n useFocusGuards();\n return /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onInteractOutside,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onDismiss: () => context.onOpenChange(false),\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n \"data-state\": getState(context.open),\n role: \"dialog\",\n id: context.contentId,\n ...popperScope,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-popover-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-popover-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-popover-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-popover-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-popover-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n )\n }\n )\n }\n );\n }\n);\nvar CLOSE_NAME = \"PopoverClose\";\nvar PopoverClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nPopoverClose.displayName = CLOSE_NAME;\nvar ARROW_NAME = \"PopoverArrow\";\nvar PopoverArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nPopoverArrow.displayName = ARROW_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Root2 = Popover;\nvar Anchor2 = PopoverAnchor;\nvar Trigger = PopoverTrigger;\nvar Portal = PopoverPortal;\nvar Content2 = PopoverContent;\nvar Close = PopoverClose;\nvar Arrow2 = PopoverArrow;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n Close,\n Content2 as Content,\n Popover,\n PopoverAnchor,\n PopoverArrow,\n PopoverClose,\n PopoverContent,\n PopoverPortal,\n PopoverTrigger,\n Portal,\n Root2 as Root,\n Trigger,\n createPopoverScope\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { tv } from \"tailwind-variants\";\nimport { useComponentVariant } from \"@/providers/component-variant-context\";\nimport { usePortalContainer } from \"../portal-container\";\nimport { TriggerButton } from \"../button\";\nimport type { TriggerButtonProps } from \"../button/trigger-button/TriggerButton\";\n\nconst POPOVER_ANATOMY = [\n\t\"z-50 w-72 outline-none\",\n\t\"origin-[--radix-popover-content-transform-origin]\",\n\t\"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n\t\"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n\t\"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n\t\"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\",\n\t\"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\"\n];\n\nconst popoverStyles = tv({\n\tbase: [\n\t\t...POPOVER_ANATOMY,\n\t\t\"rounded-lg border border-secondary-border bg-secondary-bg p-4 text-popover-foreground shadow-soft-md\"\n\t]\n});\n\nconst glassPopoverStyles = tv({\n\tbase: [\n\t\t...POPOVER_ANATOMY,\n\t\t\"backdrop-glass-regular rounded-2xl bg-alpha-40 p-2 text-popover-foreground shadow-glass-md\"\n\t]\n});\n\ntype PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n\t/**\n\t * Контейнер для портала. Если не указан, используется хук usePortalContainer\n\t * для поиска PortalContainer\n\t */\n\tportalContainer?: HTMLElement;\n};\n\n/**\n * Корневой компонент Popover, который оборачивает всю функциональность всплывающего окна.\n * Построен на основе Radix UI Popover primitive.\n */\nconst Popover = PopoverPrimitive.Root;\n\n/**\n * Элемент-триггер, который открывает всплывающее окно при клике.\n */\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\n/**\n * Элемент-якорь, относительно которого позиционируется всплывающее окно.\n */\nconst PopoverAnchor = PopoverPrimitive.Anchor;\n\n/**\n * Компонент содержимого всплывающего окна.\n */\nconst PopoverContent = React.forwardRef<React.ElementRef<typeof PopoverPrimitive.Content>, PopoverContentProps>(\n\t({ className, align = \"center\", sideOffset = 4, portalContainer, ...props }, ref) => {\n\t\tconst { variant } = useComponentVariant();\n\t\tconst container = usePortalContainer(portalContainer);\n\t\tconst contentClassName = variant === \"glass\" ? glassPopoverStyles({ className }) : popoverStyles({ className });\n\t\treturn (\n\t\t\t<PopoverPrimitive.Portal container={container}>\n\t\t\t\t<PopoverPrimitive.Content\n\t\t\t\t\t// Фикс скроллинга внутри Popover когда он находится в Dialog\n\t\t\t\t\t// RemoveScroll в Dialog блокирует прокрутку body, но может блокировать и вложенные элементы\n\t\t\t\t\t// stopPropagation предотвращает всплытие событий скроллинга к заблокированному body\n\t\t\t\t\t// https://github.com/radix-ui/primitives/issues/1159\n\t\t\t\t\tonWheel={(e) => {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t}}\n\t\t\t\t\tonTouchMove={(e) => {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t}}\n\t\t\t\t\tref={ref}\n\t\t\t\t\talign={align}\n\t\t\t\t\tsideOffset={sideOffset}\n\t\t\t\t\tclassName={contentClassName}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</PopoverPrimitive.Portal>\n\t\t);\n\t}\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\n/**\n * Компонент-обертка для использования TriggerButton в качестве триггера поповера\n */\nconst PopoverTriggerButton = React.forwardRef<\n\tReact.ElementRef<typeof PopoverTrigger>,\n\tReact.ComponentPropsWithoutRef<typeof PopoverTrigger> & Omit<TriggerButtonProps, \"dataState\">\n>(({ children, ...props }, ref) => {\n\treturn (\n\t\t<PopoverTrigger asChild ref={ref}>\n\t\t\t<TriggerButton {...props}>{children}</TriggerButton>\n\t\t</PopoverTrigger>\n\t);\n});\n\nPopoverTriggerButton.displayName = \"PopoverTriggerButton\";\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverTriggerButton };\n"],"names":["POPOVER_NAME","createPopoverContext","createPopoverScope","createContextScope","createPopperScope","usePopperScope","PopoverProvider","usePopoverContext","Popover","props","__scopePopover","children","openProp","defaultOpen","onOpenChange","modal","popperScope","triggerRef","React","hasCustomAnchor","setHasCustomAnchor","open","setOpen","useControllableState","jsx","PopperPrimitive.Root","useId","prevOpen","ANCHOR_NAME","PopoverAnchor","forwardedRef","anchorProps","context","onCustomAnchorAdd","onCustomAnchorRemove","PopperPrimitive.Anchor","TRIGGER_NAME","PopoverTrigger","triggerProps","composedTriggerRef","useComposedRefs","trigger","Primitive","getState","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","PopoverPortal","forceMount","container","Presence","PortalPrimitive","CONTENT_NAME","PopoverContent","portalContext","contentProps","PopoverContentModal","PopoverContentNonModal","Slot","createSlot","contentRef","composedRefs","isRightClickOutsideRef","content","hideOthers","RemoveScroll","PopoverContentImpl","event","originalEvent","ctrlLeftClick","isRightClick","hasInteractedOutsideRef","hasPointerDownOutsideRef","target","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","useFocusGuards","FocusScope","DismissableLayer","PopperPrimitive.Content","CLOSE_NAME","PopoverClose","closeProps","ARROW_NAME","PopoverArrow","arrowProps","PopperPrimitive.Arrow","Root2","Anchor2","Trigger","Portal","Content2","POPOVER_ANATOMY","popoverStyles","tv","glassPopoverStyles","PopoverPrimitive.Root","PopoverPrimitive.Trigger","PopoverPrimitive.Anchor","className","align","sideOffset","portalContainer","ref","variant","useComponentVariant","usePortalContainer","contentClassName","PopoverPrimitive.Portal","PopoverPrimitive.Content","e","PopoverTriggerButton","TriggerButton"],"mappings":";;;;;;;;;;;;;;;;AAqBA,IAAIA,IAAe,WACf,CAACC,GAAsBC,EAAkB,IAAIC,EAAmBH,GAAc;AAAA,EAChFI;AACF,CAAC,GACGC,IAAiBD,EAAmB,GACpC,CAACE,IAAiBC,CAAiB,IAAIN,EAAqBD,CAAY,GACxEQ,IAAU,CAACC,MAAU;AACvB,QAAM;AAAA,IACJ,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAMC;AAAA,IACN,aAA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AcK3F,KAAU+F,IAKVlE,KAAiBmE,IAKjB3E,KAAgB4E,IAKhBnD,KAAiBpC,EAAM;AAAA,EAC5B,CAAC,EAAE,WAAAwF,GAAW,OAAAC,IAAQ,UAAU,YAAAC,IAAa,GAAG,iBAAAC,GAAiB,GAAGpG,EAAM,GAAGqG,MAAQ;AAC9E,UAAA,EAAE,SAAAC,EAAQ,IAAIC,GAAoB,GAClC9D,IAAY+D,GAAmBJ,CAAe,GAC9CK,IAAmBH,MAAY,UAAUT,GAAmB,EAAE,WAAAI,EAAU,CAAC,IAAIN,GAAc,EAAE,WAAAM,GAAW;AAC9G,WACE,gBAAAlF,EAAA2F,IAAA,EAAwB,WAAAjE,GACxB,UAAA,gBAAA1B;AAAA,MAAC4F;AAAAA,MAAA;AAAA,QAKA,SAAS,CAACC,MAAM;AACf,UAAAA,EAAE,gBAAgB;AAAA,QACnB;AAAA,QACA,aAAa,CAACA,MAAM;AACnB,UAAAA,EAAE,gBAAgB;AAAA,QACnB;AAAA,QACA,KAAAP;AAAA,QACA,OAAAH;AAAA,QACA,YAAAC;AAAA,QACA,WAAWM;AAAA,QACV,GAAGzG;AAAA,MAAA;AAAA,IAAA,GAEN;AAAA,EAAA;AAGH;AACA6C,GAAe,cAAc8D,EAAyB;AAKhD,MAAAE,KAAuBpG,EAAM,WAGjC,CAAC,EAAE,UAAAP,GAAU,GAAGF,EAAM,GAAGqG,MAEzB,gBAAAtF,EAACa,IAAe,EAAA,SAAO,IAAC,KAAAyE,GACvB,4BAACS,IAAe,EAAA,GAAG9G,GAAQ,UAAAE,EAAA,CAAS,EACrC,CAAA,CAED;AAED2G,GAAqB,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import p from "react";
|
|
3
|
-
import { B as d } from "./ButtonBase-
|
|
3
|
+
import { B as d } from "./ButtonBase-jgu7EolU.js";
|
|
4
4
|
import { T as x } from "./index-BVqs-uqP.js";
|
|
5
5
|
import { F as f } from "./FeatureIcon-BGE0Orkc.js";
|
|
6
6
|
import { D as u } from "./Description-BTPMlTT-.js";
|
|
@@ -46,4 +46,4 @@ export {
|
|
|
46
46
|
b as R,
|
|
47
47
|
h as r
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=RichButton-
|
|
49
|
+
//# sourceMappingURL=RichButton-B1wjK7Bk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichButton-
|
|
1
|
+
{"version":3,"file":"RichButton-B1wjK7Bk.js","sources":["../src/components/button/rich-button/RichButton.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\nimport { ButtonBase, ButtonBaseProps } from \"../button-base/ButtonBase\";\nimport { tv } from \"tailwind-variants\";\nimport { LucideIcon } from \"lucide-react\";\nimport { FeatureIcon } from \"@/components/icon\";\nimport { Description } from \"@/components/description\";\nimport { VariantsConfig } from \"@/lib/utils/variants\";\n\nexport interface RichButtonVariants {\n\tsize?: \"sm\" | \"lg\";\n}\n\nexport const richButtonStyles = tv({\n\tslots: {\n\t\tbase: \"w-full justify-start\",\n\t\twrapper: \"flex flex-col items-start\",\n\t\tdescription: \"\",\n\t\ttext: \"font-semibold\"\n\t},\n\tvariants: {\n\t\tsize: {\n\t\t\tsm: {\n\t\t\t\tbase: \"h-12 gap-2 rounded-xl px-2 py-1.5\",\n\t\t\t\tdescription: \"text-xs\",\n\t\t\t\ttext: \"text-sm\"\n\t\t\t},\n\t\t\tlg: {\n\t\t\t\tbase: \"h-[4.5rem] gap-3 rounded-2xl p-3\",\n\t\t\t\twrapper: \"gap-1\",\n\t\t\t\tdescription: \"text-sm\",\n\t\t\t\ttext: \"text-base\"\n\t\t\t}\n\t\t}\n\t} satisfies VariantsConfig<RichButtonVariants>,\n\tdefaultVariants: {\n\t\tsize: \"sm\"\n\t}\n});\n\nexport type RichButtonProps = ButtonBaseProps &\n\tRichButtonVariants & {\n\t\ttitle: React.ReactNode;\n\t\tdescription: React.ReactNode;\n\t\ticon: LucideIcon;\n\t};\n\nexport const RichButton = React.forwardRef<HTMLButtonElement, PropsWithChildren<RichButtonProps>>(\n\t({ icon, size, title, description, className, ...props }, ref) => {\n\t\tconst styles = richButtonStyles({ size });\n\t\tconst iconSize = size === \"lg\" ? \"2xl\" : \"md\";\n\n\t\treturn (\n\t\t\t<ButtonBase variant=\"outline\" className={styles.base({ class: className })} ref={ref} {...props}>\n\t\t\t\t<FeatureIcon size={iconSize} icon={icon} className=\"bg-status-neutral-fg\" />\n\n\t\t\t\t<div className={styles.wrapper()}>\n\t\t\t\t\t<span className={styles.text()}>{title}</span>\n\t\t\t\t\t<Description className={styles.description()}>{description}</Description>\n\t\t\t\t</div>\n\t\t\t</ButtonBase>\n\t\t);\n\t}\n);\n\nRichButton.displayName = \"RichButton\";\n"],"names":["richButtonStyles","tv","RichButton","React","icon","size","title","description","className","props","ref","styles","iconSize","jsxs","ButtonBase","jsx","FeatureIcon","Description"],"mappings":";;;;;;AAYO,MAAMA,IAAmBC,EAAG;AAAA,EAClC,OAAO;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACP;AAAA,EACA,UAAU;AAAA,IACT,MAAM;AAAA,MACL,IAAI;AAAA,QACH,MAAM;AAAA,QACN,aAAa;AAAA,QACb,MAAM;AAAA,MACP;AAAA,MACA,IAAI;AAAA,QACH,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,MAAM;AAAA,MAAA;AAAA,IACP;AAAA,EAEF;AAAA,EACA,iBAAiB;AAAA,IAChB,MAAM;AAAA,EAAA;AAER,CAAC,GASYC,IAAaC,EAAM;AAAA,EAC/B,CAAC,EAAE,MAAAC,GAAM,MAAAC,GAAM,OAAAC,GAAO,aAAAC,GAAa,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAAQ;AACjE,UAAMC,IAASX,EAAiB,EAAE,MAAAK,GAAM,GAClCO,IAAWP,MAAS,OAAO,QAAQ;AAEzC,WACE,gBAAAQ,EAAAC,GAAA,EAAW,SAAQ,WAAU,WAAWH,EAAO,KAAK,EAAE,OAAOH,EAAW,CAAA,GAAG,KAAAE,GAAW,GAAGD,GACzF,UAAA;AAAA,MAAA,gBAAAM,EAACC,GAAY,EAAA,MAAMJ,GAAU,MAAAR,GAAY,WAAU,wBAAuB;AAAA,MAEzE,gBAAAS,EAAA,OAAA,EAAI,WAAWF,EAAO,QACtB,GAAA,UAAA;AAAA,QAAA,gBAAAI,EAAC,QAAK,EAAA,WAAWJ,EAAO,QAAS,UAAML,GAAA;AAAA,0BACtCW,GAAY,EAAA,WAAWN,EAAO,eAAgB,UAAYJ,EAAA,CAAA;AAAA,MAAA,EAC5D,CAAA;AAAA,IAAA,GACD;AAAA,EAAA;AAGH;AAEAL,EAAW,cAAc;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as x, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import S, { useState as I, useRef as b, useEffect as y, useCallback as h, useMemo as V } from "react";
|
|
3
3
|
import { u as k } from "./useMergeRefs-qoKniYqT.js";
|
|
4
|
-
import { a as w, c as v, b as A, d as g } from "./InputGroup-
|
|
4
|
+
import { a as w, c as v, b as A, d as g } from "./InputGroup-AVAtosX_.js";
|
|
5
5
|
import { T } from "./index-BVqs-uqP.js";
|
|
6
6
|
import { C as E } from "./circle-x-u75Rx3Tj.js";
|
|
7
7
|
import { C as N } from "./check-CeyaOoZv.js";
|
|
@@ -202,4 +202,4 @@ export {
|
|
|
202
202
|
H as T,
|
|
203
203
|
z as u
|
|
204
204
|
};
|
|
205
|
-
//# sourceMappingURL=TextInput-
|
|
205
|
+
//# sourceMappingURL=TextInput-5BuZtWV6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput-Db0ylY91.js","sources":["../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/copy.js","../src/hooks/useControlledValue.ts","../src/hooks/useCopyAction.ts","../src/hooks/useAutofill.ts","../src/hooks/useInputWithActions.ts","../src/components/input/text-input/TextInput.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.460.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Copy = createLucideIcon(\"Copy\", [\n [\"rect\", { width: \"14\", height: \"14\", x: \"8\", y: \"8\", rx: \"2\", ry: \"2\", key: \"17jyea\" }],\n [\"path\", { d: \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\", key: \"zix9uf\" }]\n]);\n\nexport { Copy as default };\n//# sourceMappingURL=copy.js.map\n","import { useCallback, useEffect, useRef, useState } from \"react\";\n\n/**\n * Хук для управления контролируемым и неконтролируемым состоянием\n */\nexport function useControlledValue(\n\tvalue: string | number | readonly string[] | undefined,\n\tdefaultValue: string | number | readonly string[] | undefined,\n\tonChange?: (value: string | null) => void\n) {\n\tconst [uncontrolledValue, setUncontrolledValue] = useState(\n\t\ttypeof defaultValue === \"string\" ? defaultValue : String(defaultValue ?? \"\")\n\t);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\t// Добавляем обработчик для отслеживания изменений в uncontrolled режиме\n\tuseEffect(() => {\n\t\tif (value !== undefined) return;\n\n\t\tconst input = inputRef.current;\n\t\tif (!input) return;\n\n\t\tconst handleInput = () => {\n\t\t\tsetUncontrolledValue(input.value);\n\t\t};\n\n\t\tinput.addEventListener(\"input\", handleInput);\n\t\treturn () => input.removeEventListener(\"input\", handleInput);\n\t}, [value, inputRef]);\n\n\tconst getCurrentValue = useCallback(() => {\n\t\tif (value !== undefined) return String(value);\n\t\treturn uncontrolledValue;\n\t}, [value, uncontrolledValue]);\n\n\tconst handleChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tonChange?.(e.target.value);\n\t\t},\n\t\t[onChange]\n\t);\n\n\treturn {\n\t\tinputRef,\n\t\tgetCurrentValue,\n\t\thandleChange,\n\t\tcurrentValue: getCurrentValue()\n\t};\n}\n","import { useCallback, useEffect, useState } from \"react\";\n\n/**\n * Хук для копирования содержимого в буфер обмена\n */\nexport function useCopyAction() {\n\tconst [hasCopied, setHasCopied] = useState(false);\n\n\t// Эффект для сброса статуса копирования\n\tuseEffect(() => {\n\t\tif (!hasCopied) return;\n\t\tconst timeout = setTimeout(() => {\n\t\t\tsetHasCopied(false);\n\t\t}, 2000);\n\t\treturn () => clearTimeout(timeout);\n\t}, [hasCopied]);\n\n\tconst handleCopy = useCallback((value: string) => {\n\t\tif (value) {\n\t\t\tnavigator.clipboard.writeText(value);\n\t\t\tsetHasCopied(true);\n\t\t}\n\t}, []);\n\n\treturn {\n\t\thasCopied,\n\t\thandleCopy\n\t};\n}\n","import { useEffect, useRef, useState } from \"react\";\n\n/**\n * Хук для определения состояния автозаполнения input'а\n */\nexport function useAutofill() {\n\tconst [isAutofilled, setIsAutofilled] = useState(false);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\tuseEffect(() => {\n\t\tconst input = inputRef.current;\n\t\tif (!input) return;\n\n\t\tconst checkAutofill = (element: Element): boolean => {\n\t\t\ttry {\n\t\t\t\treturn element.matches(\":-webkit-autofill\");\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\tconst updateAutofillState = () => {\n\t\t\tconst autofilled = checkAutofill(input);\n\t\t\tsetIsAutofilled(autofilled);\n\t\t};\n\n\t\tinput.addEventListener(\"input\", updateAutofillState);\n\n\t\tlet intervalCounter = 0;\n\t\tconst intervalTime = 25;\n\t\t// Максимальное время ожидания появления autofill, в ms\n\t\tconst intervalTimeLimit = 1000;\n\n\t\tconst interval = setInterval(() => {\n\t\t\tintervalCounter += intervalTime;\n\t\t\tif (intervalCounter > intervalTimeLimit) {\n\t\t\t\tclearInterval(interval);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (checkAutofill(input)) {\n\t\t\t\tsetIsAutofilled(true);\n\t\t\t\tclearInterval(interval);\n\t\t\t}\n\t\t}, intervalTime);\n\n\t\tupdateAutofillState();\n\n\t\treturn () => {\n\t\t\tclearInterval(interval);\n\t\t\tinput.removeEventListener(\"input\", updateAutofillState);\n\t\t};\n\t}, []);\n\n\treturn {\n\t\tisAutofilled,\n\t\tinputRef\n\t};\n}\n","import { useCallback, useMemo } from \"react\";\nimport { useControlledValue } from \"./useControlledValue\";\nimport { useCopyAction } from \"./useCopyAction\";\nimport { useAutofill } from \"./useAutofill\";\n\nexport interface UseInputWithActionsOptions {\n\t/** Значение input (для контролируемого режима) */\n\tvalue?: string | number | readonly string[];\n\t/** Значение по умолчанию (для неконтролируемого режима) */\n\tdefaultValue?: string | number | readonly string[];\n\t/** Колбэк на изменение значения */\n\tonChange?: (value: string | null) => void;\n\t/** Флаг только для чтения */\n\treadOnly?: boolean;\n\t/** Флаг отключения */\n\tdisabled?: boolean;\n\t/** Флаг для отображения кнопки очистки */\n\tshowClearIcon?: boolean;\n\t/** Флаг для отображения кнопки копирования */\n\tshowCopyIcon?: boolean;\n}\n\n/**\n * Общий хук для input с полным функционалом копирования и очистки\n */\nexport function useInputWithActions({\n\tvalue,\n\tdefaultValue,\n\tonChange,\n\treadOnly,\n\tdisabled,\n\tshowClearIcon = false,\n\tshowCopyIcon = false\n}: UseInputWithActionsOptions) {\n\tconst controlledValue = useControlledValue(value, defaultValue, onChange);\n\tconst copyAction = useCopyAction();\n\tconst { isAutofilled } = useAutofill();\n\n\tconst isEditable = useMemo(() => {\n\t\treturn !readOnly && !disabled;\n\t}, [readOnly, disabled]);\n\n\tconst handleClear = useCallback(() => {\n\t\tif (value !== undefined) {\n\t\t\t// Controlled mode\n\t\t\tonChange?.(\"\");\n\t\t} else {\n\t\t\t// Uncontrolled mode\n\t\t\tif (controlledValue.inputRef.current) {\n\t\t\t\tcontrolledValue.inputRef.current.value = \"\";\n\t\t\t\tcontrolledValue.inputRef.current.dispatchEvent(new Event(\"input\", { bubbles: true }));\n\t\t\t}\n\t\t}\n\t}, [onChange, value, controlledValue.inputRef]);\n\n\tconst handleCopyValue = useCallback(() => {\n\t\tcopyAction.handleCopy(String(controlledValue.currentValue));\n\t}, [copyAction.handleCopy, controlledValue.currentValue]);\n\n\tconst shouldShowClearIcon = showClearIcon && isEditable && controlledValue.currentValue;\n\tconst shouldShowCopyIcon = showCopyIcon && controlledValue.currentValue;\n\n\treturn {\n\t\t// Значения и состояние\n\t\tcurrentValue: controlledValue.currentValue,\n\t\tinputRef: controlledValue.inputRef,\n\t\tisEditable,\n\n\t\t// Обработчики\n\t\thandleChange: controlledValue.handleChange,\n\t\thandleClear,\n\t\thandleCopy: handleCopyValue,\n\n\t\t// Состояние копирования\n\t\thasCopied: copyAction.hasCopied,\n\n\t\t// Состояние автозаполнения\n\t\tisAutofilled,\n\n\t\t// Флаги видимости кнопок\n\t\tshouldShowClearIcon,\n\t\tshouldShowCopyIcon\n\t};\n}\n","import React, { HTMLAttributes } from \"react\";\nimport { useMergeRefs } from \"@/hooks/useMergeRefs\";\nimport { useInputWithActions } from \"@/hooks/useInputWithActions\";\nimport { InputGroup, InputGroupInput, InputGroupButton, InputGroupText } from \"../input-group/InputGroup\";\nimport { CircleX, Copy, Check } from \"lucide-react\";\nimport { tv } from \"tailwind-variants\";\nimport { InputProps } from \"../input/Input\";\n\nconst textInputStyles = tv({\n\tbase: \"\",\n\tslots: {\n\t\taction: \"hidden group-focus-within/input-group:block group-hover/input-group:block\",\n\t\tstartIcon: \"!border-r-0 pr-0 text-muted\",\n\t\tendIcon: \"border-l-0 pl-0 text-muted\",\n\t\tinput: \"\"\n\t},\n\tvariants: {\n\t\thasStartIcon: { true: { input: \"pl-2\" } }\n\t}\n});\n\nexport interface TextInputProps\n\textends Omit<InputProps, \"onChange\">,\n\t\tOmit<HTMLAttributes<HTMLInputElement>, \"onChange\"> {\n\t/** Иконка, отображаемая в начале текстового поля */\n\tstartIcon?: React.ReactNode;\n\t/** Иконка, отображаемая в конце текстового поля */\n\tendIcon?: React.ReactNode;\n\t/** Флаг для отображения кнопки очистки значения */\n\tshowClearIcon?: boolean;\n\t/** Флаг для отображения кнопки копирования значения */\n\tshowCopyIcon?: boolean;\n\t/** Колбэк на изменение значения */\n\tonChange?: (value: string | null) => void;\n}\n\n/**\n * Компонент текстового поля ввода с поддержкой иконок и дополнительных действий.\n */\nexport const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(\n\t(\n\t\t{\n\t\t\tstartIcon,\n\t\t\tendIcon,\n\t\t\tshowClearIcon,\n\t\t\tshowCopyIcon,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tonChange,\n\t\t\treadOnly,\n\t\t\tdisabled,\n\t\t\terror,\n\t\t\tclassName,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst styles = textInputStyles();\n\n\t\tconst inputActions = useInputWithActions({\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tonChange,\n\t\t\treadOnly,\n\t\t\tdisabled,\n\t\t\tshowClearIcon,\n\t\t\tshowCopyIcon\n\t\t});\n\n\t\tconst mergedRef = useMergeRefs(ref, inputActions.inputRef);\n\n\t\treturn (\n\t\t\t<InputGroup className={styles.base({ className })}>\n\t\t\t\t{startIcon && <InputGroupText className={styles.startIcon()}>{startIcon}</InputGroupText>}\n\n\t\t\t\t<InputGroupInput\n\t\t\t\t\tref={mergedRef}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tonChange={inputActions.handleChange}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\terror={error}\n\t\t\t\t\tclassName={styles.input({ hasStartIcon: !!startIcon })}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\n\t\t\t\t{inputActions.shouldShowClearIcon && (\n\t\t\t\t\t<InputGroupButton\n\t\t\t\t\t\ticon={CircleX}\n\t\t\t\t\t\tonClick={inputActions.handleClear}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={styles.action()}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{inputActions.shouldShowCopyIcon && (\n\t\t\t\t\t<InputGroupButton\n\t\t\t\t\t\ticon={inputActions.hasCopied ? Check : Copy}\n\t\t\t\t\t\tonClick={inputActions.handleCopy}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={styles.action()}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{endIcon && <InputGroupText className={styles.endIcon()}>{endIcon}</InputGroupText>}\n\t\t\t</InputGroup>\n\t\t);\n\t}\n);\n\nTextInput.displayName = \"TextInput\";\n\nexport default TextInput;\n"],"names":["Copy","createLucideIcon","useControlledValue","value","defaultValue","onChange","uncontrolledValue","setUncontrolledValue","useState","inputRef","useRef","useEffect","input","handleInput","getCurrentValue","useCallback","handleChange","e","useCopyAction","hasCopied","setHasCopied","timeout","handleCopy","useAutofill","isAutofilled","setIsAutofilled","checkAutofill","element","updateAutofillState","autofilled","intervalCounter","intervalTime","intervalTimeLimit","interval","useInputWithActions","readOnly","disabled","showClearIcon","showCopyIcon","controlledValue","copyAction","isEditable","useMemo","handleClear","handleCopyValue","shouldShowClearIcon","shouldShowCopyIcon","textInputStyles","tv","TextInput","React","startIcon","endIcon","error","className","props","ref","styles","inputActions","mergedRef","useMergeRefs","jsxs","InputGroup","InputGroupText","jsx","InputGroupInput","InputGroupButton","CircleX","Check"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAACA,IAAOC,EAAiB,QAAQ;AAAA,EACpC,CAAC,QAAQ,EAAE,OAAO,MAAM,QAAQ,MAAM,GAAG,KAAK,GAAG,KAAK,IAAI,KAAK,IAAI,KAAK,KAAK,UAAU;AAAA,EACvF,CAAC,QAAQ,EAAE,GAAG,2DAA2D,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WN,EAAO,QAAA,GAAY,UAAQL,EAAA,CAAA;AAAA,IAAA,GACnE;AAAA,EAAA;AAGH;AAEAH,EAAU,cAAc;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"TextInput-5BuZtWV6.js","sources":["../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/copy.js","../src/hooks/useControlledValue.ts","../src/hooks/useCopyAction.ts","../src/hooks/useAutofill.ts","../src/hooks/useInputWithActions.ts","../src/components/input/text-input/TextInput.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.460.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Copy = createLucideIcon(\"Copy\", [\n [\"rect\", { width: \"14\", height: \"14\", x: \"8\", y: \"8\", rx: \"2\", ry: \"2\", key: \"17jyea\" }],\n [\"path\", { d: \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\", key: \"zix9uf\" }]\n]);\n\nexport { Copy as default };\n//# sourceMappingURL=copy.js.map\n","import { useCallback, useEffect, useRef, useState } from \"react\";\n\n/**\n * Хук для управления контролируемым и неконтролируемым состоянием\n */\nexport function useControlledValue(\n\tvalue: string | number | readonly string[] | undefined,\n\tdefaultValue: string | number | readonly string[] | undefined,\n\tonChange?: (value: string | null) => void\n) {\n\tconst [uncontrolledValue, setUncontrolledValue] = useState(\n\t\ttypeof defaultValue === \"string\" ? defaultValue : String(defaultValue ?? \"\")\n\t);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\t// Добавляем обработчик для отслеживания изменений в uncontrolled режиме\n\tuseEffect(() => {\n\t\tif (value !== undefined) return;\n\n\t\tconst input = inputRef.current;\n\t\tif (!input) return;\n\n\t\tconst handleInput = () => {\n\t\t\tsetUncontrolledValue(input.value);\n\t\t};\n\n\t\tinput.addEventListener(\"input\", handleInput);\n\t\treturn () => input.removeEventListener(\"input\", handleInput);\n\t}, [value, inputRef]);\n\n\tconst getCurrentValue = useCallback(() => {\n\t\tif (value !== undefined) return String(value);\n\t\treturn uncontrolledValue;\n\t}, [value, uncontrolledValue]);\n\n\tconst handleChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tonChange?.(e.target.value);\n\t\t},\n\t\t[onChange]\n\t);\n\n\treturn {\n\t\tinputRef,\n\t\tgetCurrentValue,\n\t\thandleChange,\n\t\tcurrentValue: getCurrentValue()\n\t};\n}\n","import { useCallback, useEffect, useState } from \"react\";\n\n/**\n * Хук для копирования содержимого в буфер обмена\n */\nexport function useCopyAction() {\n\tconst [hasCopied, setHasCopied] = useState(false);\n\n\t// Эффект для сброса статуса копирования\n\tuseEffect(() => {\n\t\tif (!hasCopied) return;\n\t\tconst timeout = setTimeout(() => {\n\t\t\tsetHasCopied(false);\n\t\t}, 2000);\n\t\treturn () => clearTimeout(timeout);\n\t}, [hasCopied]);\n\n\tconst handleCopy = useCallback((value: string) => {\n\t\tif (value) {\n\t\t\tnavigator.clipboard.writeText(value);\n\t\t\tsetHasCopied(true);\n\t\t}\n\t}, []);\n\n\treturn {\n\t\thasCopied,\n\t\thandleCopy\n\t};\n}\n","import { useEffect, useRef, useState } from \"react\";\n\n/**\n * Хук для определения состояния автозаполнения input'а\n */\nexport function useAutofill() {\n\tconst [isAutofilled, setIsAutofilled] = useState(false);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\tuseEffect(() => {\n\t\tconst input = inputRef.current;\n\t\tif (!input) return;\n\n\t\tconst checkAutofill = (element: Element): boolean => {\n\t\t\ttry {\n\t\t\t\treturn element.matches(\":-webkit-autofill\");\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\tconst updateAutofillState = () => {\n\t\t\tconst autofilled = checkAutofill(input);\n\t\t\tsetIsAutofilled(autofilled);\n\t\t};\n\n\t\tinput.addEventListener(\"input\", updateAutofillState);\n\n\t\tlet intervalCounter = 0;\n\t\tconst intervalTime = 25;\n\t\t// Максимальное время ожидания появления autofill, в ms\n\t\tconst intervalTimeLimit = 1000;\n\n\t\tconst interval = setInterval(() => {\n\t\t\tintervalCounter += intervalTime;\n\t\t\tif (intervalCounter > intervalTimeLimit) {\n\t\t\t\tclearInterval(interval);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (checkAutofill(input)) {\n\t\t\t\tsetIsAutofilled(true);\n\t\t\t\tclearInterval(interval);\n\t\t\t}\n\t\t}, intervalTime);\n\n\t\tupdateAutofillState();\n\n\t\treturn () => {\n\t\t\tclearInterval(interval);\n\t\t\tinput.removeEventListener(\"input\", updateAutofillState);\n\t\t};\n\t}, []);\n\n\treturn {\n\t\tisAutofilled,\n\t\tinputRef\n\t};\n}\n","import { useCallback, useMemo } from \"react\";\nimport { useControlledValue } from \"./useControlledValue\";\nimport { useCopyAction } from \"./useCopyAction\";\nimport { useAutofill } from \"./useAutofill\";\n\nexport interface UseInputWithActionsOptions {\n\t/** Значение input (для контролируемого режима) */\n\tvalue?: string | number | readonly string[];\n\t/** Значение по умолчанию (для неконтролируемого режима) */\n\tdefaultValue?: string | number | readonly string[];\n\t/** Колбэк на изменение значения */\n\tonChange?: (value: string | null) => void;\n\t/** Флаг только для чтения */\n\treadOnly?: boolean;\n\t/** Флаг отключения */\n\tdisabled?: boolean;\n\t/** Флаг для отображения кнопки очистки */\n\tshowClearIcon?: boolean;\n\t/** Флаг для отображения кнопки копирования */\n\tshowCopyIcon?: boolean;\n}\n\n/**\n * Общий хук для input с полным функционалом копирования и очистки\n */\nexport function useInputWithActions({\n\tvalue,\n\tdefaultValue,\n\tonChange,\n\treadOnly,\n\tdisabled,\n\tshowClearIcon = false,\n\tshowCopyIcon = false\n}: UseInputWithActionsOptions) {\n\tconst controlledValue = useControlledValue(value, defaultValue, onChange);\n\tconst copyAction = useCopyAction();\n\tconst { isAutofilled } = useAutofill();\n\n\tconst isEditable = useMemo(() => {\n\t\treturn !readOnly && !disabled;\n\t}, [readOnly, disabled]);\n\n\tconst handleClear = useCallback(() => {\n\t\tif (value !== undefined) {\n\t\t\t// Controlled mode\n\t\t\tonChange?.(\"\");\n\t\t} else {\n\t\t\t// Uncontrolled mode\n\t\t\tif (controlledValue.inputRef.current) {\n\t\t\t\tcontrolledValue.inputRef.current.value = \"\";\n\t\t\t\tcontrolledValue.inputRef.current.dispatchEvent(new Event(\"input\", { bubbles: true }));\n\t\t\t}\n\t\t}\n\t}, [onChange, value, controlledValue.inputRef]);\n\n\tconst handleCopyValue = useCallback(() => {\n\t\tcopyAction.handleCopy(String(controlledValue.currentValue));\n\t}, [copyAction.handleCopy, controlledValue.currentValue]);\n\n\tconst shouldShowClearIcon = showClearIcon && isEditable && controlledValue.currentValue;\n\tconst shouldShowCopyIcon = showCopyIcon && controlledValue.currentValue;\n\n\treturn {\n\t\t// Значения и состояние\n\t\tcurrentValue: controlledValue.currentValue,\n\t\tinputRef: controlledValue.inputRef,\n\t\tisEditable,\n\n\t\t// Обработчики\n\t\thandleChange: controlledValue.handleChange,\n\t\thandleClear,\n\t\thandleCopy: handleCopyValue,\n\n\t\t// Состояние копирования\n\t\thasCopied: copyAction.hasCopied,\n\n\t\t// Состояние автозаполнения\n\t\tisAutofilled,\n\n\t\t// Флаги видимости кнопок\n\t\tshouldShowClearIcon,\n\t\tshouldShowCopyIcon\n\t};\n}\n","import React, { HTMLAttributes } from \"react\";\nimport { useMergeRefs } from \"@/hooks/useMergeRefs\";\nimport { useInputWithActions } from \"@/hooks/useInputWithActions\";\nimport { InputGroup, InputGroupInput, InputGroupButton, InputGroupText } from \"../input-group/InputGroup\";\nimport { CircleX, Copy, Check } from \"lucide-react\";\nimport { tv } from \"tailwind-variants\";\nimport { InputProps } from \"../input/Input\";\n\nconst textInputStyles = tv({\n\tbase: \"\",\n\tslots: {\n\t\taction: \"hidden group-focus-within/input-group:block group-hover/input-group:block\",\n\t\tstartIcon: \"!border-r-0 pr-0 text-muted\",\n\t\tendIcon: \"border-l-0 pl-0 text-muted\",\n\t\tinput: \"\"\n\t},\n\tvariants: {\n\t\thasStartIcon: { true: { input: \"pl-2\" } }\n\t}\n});\n\nexport interface TextInputProps\n\textends Omit<InputProps, \"onChange\">,\n\t\tOmit<HTMLAttributes<HTMLInputElement>, \"onChange\"> {\n\t/** Иконка, отображаемая в начале текстового поля */\n\tstartIcon?: React.ReactNode;\n\t/** Иконка, отображаемая в конце текстового поля */\n\tendIcon?: React.ReactNode;\n\t/** Флаг для отображения кнопки очистки значения */\n\tshowClearIcon?: boolean;\n\t/** Флаг для отображения кнопки копирования значения */\n\tshowCopyIcon?: boolean;\n\t/** Колбэк на изменение значения */\n\tonChange?: (value: string | null) => void;\n}\n\n/**\n * Компонент текстового поля ввода с поддержкой иконок и дополнительных действий.\n */\nexport const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(\n\t(\n\t\t{\n\t\t\tstartIcon,\n\t\t\tendIcon,\n\t\t\tshowClearIcon,\n\t\t\tshowCopyIcon,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tonChange,\n\t\t\treadOnly,\n\t\t\tdisabled,\n\t\t\terror,\n\t\t\tclassName,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst styles = textInputStyles();\n\n\t\tconst inputActions = useInputWithActions({\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\tonChange,\n\t\t\treadOnly,\n\t\t\tdisabled,\n\t\t\tshowClearIcon,\n\t\t\tshowCopyIcon\n\t\t});\n\n\t\tconst mergedRef = useMergeRefs(ref, inputActions.inputRef);\n\n\t\treturn (\n\t\t\t<InputGroup className={styles.base({ className })}>\n\t\t\t\t{startIcon && <InputGroupText className={styles.startIcon()}>{startIcon}</InputGroupText>}\n\n\t\t\t\t<InputGroupInput\n\t\t\t\t\tref={mergedRef}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tonChange={inputActions.handleChange}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\terror={error}\n\t\t\t\t\tclassName={styles.input({ hasStartIcon: !!startIcon })}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\n\t\t\t\t{inputActions.shouldShowClearIcon && (\n\t\t\t\t\t<InputGroupButton\n\t\t\t\t\t\ticon={CircleX}\n\t\t\t\t\t\tonClick={inputActions.handleClear}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={styles.action()}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{inputActions.shouldShowCopyIcon && (\n\t\t\t\t\t<InputGroupButton\n\t\t\t\t\t\ticon={inputActions.hasCopied ? Check : Copy}\n\t\t\t\t\t\tonClick={inputActions.handleCopy}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={styles.action()}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{endIcon && <InputGroupText className={styles.endIcon()}>{endIcon}</InputGroupText>}\n\t\t\t</InputGroup>\n\t\t);\n\t}\n);\n\nTextInput.displayName = \"TextInput\";\n\nexport default TextInput;\n"],"names":["Copy","createLucideIcon","useControlledValue","value","defaultValue","onChange","uncontrolledValue","setUncontrolledValue","useState","inputRef","useRef","useEffect","input","handleInput","getCurrentValue","useCallback","handleChange","e","useCopyAction","hasCopied","setHasCopied","timeout","handleCopy","useAutofill","isAutofilled","setIsAutofilled","checkAutofill","element","updateAutofillState","autofilled","intervalCounter","intervalTime","intervalTimeLimit","interval","useInputWithActions","readOnly","disabled","showClearIcon","showCopyIcon","controlledValue","copyAction","isEditable","useMemo","handleClear","handleCopyValue","shouldShowClearIcon","shouldShowCopyIcon","textInputStyles","tv","TextInput","React","startIcon","endIcon","error","className","props","ref","styles","inputActions","mergedRef","useMergeRefs","jsxs","InputGroup","InputGroupText","jsx","InputGroupInput","InputGroupButton","CircleX","Check"],"mappings":";;;;;;;;AAAA;AAAA;A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AM;AAAA,QAACE;AAAA,QAAA;AAAA,UACA,MAAMR,EAAa,YAAYU,IAAQpE;AAAA,UACvC,SAAS0D,EAAa;AAAA,UACtB,MAAK;AAAA,UACL,WAAWD,EAAO,OAAO;AAAA,QAAA;AAAA,MAC1B;AAAA,MAGAL,KAAY,gBAAAY,EAAAD,GAAA,EAAe,WAAWN,EAAO,QAAA,GAAY,UAAQL,EAAA,CAAA;AAAA,IAAA,GACnE;AAAA,EAAA;AAGH;AAEAH,EAAU,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import s from "react";
|
|
3
3
|
import { T as d } from "./index-BVqs-uqP.js";
|
|
4
|
-
import { B as g } from "./Button-
|
|
4
|
+
import { B as g } from "./Button-BZ3ON1Tj.js";
|
|
5
5
|
const i = d({
|
|
6
6
|
base: "",
|
|
7
7
|
variants: {
|
|
@@ -30,4 +30,4 @@ p.displayName = "TriggerButton";
|
|
|
30
30
|
export {
|
|
31
31
|
p as T
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=TriggerButton-
|
|
33
|
+
//# sourceMappingURL=TriggerButton-Bakr8Boi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerButton-
|
|
1
|
+
{"version":3,"file":"TriggerButton-Bakr8Boi.js","sources":["../src/components/button/trigger-button/TriggerButton.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport { VariantsConfig } from \"@/lib/utils/variants\";\nimport { Button, ButtonProps } from \"../button/Button\";\n\nexport interface TriggerButtonVariants {\n\tvariant?: \"outline\" | \"ghost\" | \"text\";\n}\n\nconst triggerButtonVariants = tv({\n\tbase: \"\",\n\tvariants: {\n\t\tvariant: {\n\t\t\toutline:\n\t\t\t\t\"data-[state=open]:bg-secondary-bg-hover data-[state=open]:shadow-none active:data-[state=open]:bg-secondary-bg-hover lg:hover:data-[state=open]:bg-secondary-bg-hover\",\n\t\t\tghost:\n\t\t\t\t\"data-[state=open]:bg-secondary-bg-hover data-[state=open]:shadow-none active:data-[state=open]:bg-secondary-bg-hover lg:hover:data-[state=open]:bg-secondary-bg-hover\",\n\t\t\ttext: \"data-[state=open]:text-secondary-fg\"\n\t\t}\n\t} satisfies VariantsConfig<TriggerButtonVariants>,\n\tdefaultVariants: {\n\t\tvariant: \"outline\"\n\t}\n});\n\nexport type TriggerButtonProps = Omit<ButtonProps, \"variant\" | \"status\"> &\n\tTriggerButtonVariants & {\n\t\t\"data-state\"?: \"open\" | \"closed\";\n\t};\n\nexport const TriggerButton = React.forwardRef<HTMLButtonElement, PropsWithChildren<TriggerButtonProps>>(\n\t({ className, children, variant, ...props }, ref) => {\n\t\treturn (\n\t\t\t<Button\n\t\t\t\tvariant={variant || \"outline\"}\n\t\t\t\tclassName={triggerButtonVariants({ className, variant })}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Button>\n\t\t);\n\t}\n);\n\nTriggerButton.displayName = \"TriggerButton\";\n"],"names":["triggerButtonVariants","tv","TriggerButton","React","className","children","variant","props","ref","jsx","Button"],"mappings":";;;;AASA,MAAMA,IAAwBC,EAAG;AAAA,EAChC,MAAM;AAAA,EACN,UAAU;AAAA,IACT,SAAS;AAAA,MACR,SACC;AAAA,MACD,OACC;AAAA,MACD,MAAM;AAAA,IAAA;AAAA,EAER;AAAA,EACA,iBAAiB;AAAA,IAChB,SAAS;AAAA,EAAA;AAEX,CAAC,GAOYC,IAAgBC,EAAM;AAAA,EAClC,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,SAAAC,GAAS,GAAGC,KAASC,MAE3C,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACA,SAASJ,KAAW;AAAA,MACpB,WAAWN,EAAsB,EAAE,WAAAI,GAAW,SAAAE,GAAS;AAAA,MACvD,KAAAE;AAAA,MACC,GAAGD;AAAA,MAEH,UAAAF;AAAA,IAAA;AAAA,EACF;AAGH;AAEAH,EAAc,cAAc;"}
|
|
@@ -7,8 +7,8 @@ import { a as D, F as L, g as R } from "../../FormStack-Cc_ELdWL.js";
|
|
|
7
7
|
import { s as G } from "../../zod-BMNoK3aM.js";
|
|
8
8
|
import { e as V } from "../../index.esm-CXA6i4d7.js";
|
|
9
9
|
import { z as v } from "../../vendors/zod.js";
|
|
10
|
-
import { B as E } from "../../Button-
|
|
11
|
-
import { T as A } from "../../TextInput-
|
|
10
|
+
import { B as E } from "../../Button-BZ3ON1Tj.js";
|
|
11
|
+
import { T as A } from "../../TextInput-5BuZtWV6.js";
|
|
12
12
|
import { c as j } from "../../cn-dsXlqdJg.js";
|
|
13
13
|
import { T as I } from "../../index-BVqs-uqP.js";
|
|
14
14
|
import { L as k } from "../../loader-circle-D1YXTEGq.js";
|
|
@@ -7,7 +7,7 @@ import { c as X, b as Z } from "../index-CFaU3UXv.js";
|
|
|
7
7
|
import { T as d } from "../index-BVqs-uqP.js";
|
|
8
8
|
import { u as ee } from "../usePortalContainer-BAIp0kSF.js";
|
|
9
9
|
import { o as te } from "../Overlay-CVt011mY.js";
|
|
10
|
-
import { B as N } from "../Button-
|
|
10
|
+
import { B as N } from "../Button-BZ3ON1Tj.js";
|
|
11
11
|
import { A as ae, u as f } from "../AlertContext-CxjW1LVL.js";
|
|
12
12
|
import { I as oe } from "../Icon-DH3ev9GK.js";
|
|
13
13
|
import { e as w } from "../useBreakpoints-DHvp74UL.js";
|
package/dist/components/alert.js
CHANGED
|
@@ -4,7 +4,7 @@ import l from "react";
|
|
|
4
4
|
import { T as n } from "../index-BVqs-uqP.js";
|
|
5
5
|
import { S as c } from "../index-BtQfgaSF.js";
|
|
6
6
|
import { u } from "../AlertContext-CxjW1LVL.js";
|
|
7
|
-
import { B as p } from "../Button-
|
|
7
|
+
import { B as p } from "../Button-BZ3ON1Tj.js";
|
|
8
8
|
const x = n({
|
|
9
9
|
base: "col-start-2 line-clamp-1 min-h-4 text-sm font-medium tracking-tight text-primary-fg",
|
|
10
10
|
variants: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { B as i } from "../Button-
|
|
2
|
-
import { B as R } from "../ButtonBase-
|
|
3
|
-
import { I as s } from "../IconButton-
|
|
1
|
+
import { B as i } from "../Button-BZ3ON1Tj.js";
|
|
2
|
+
import { B as R } from "../ButtonBase-jgu7EolU.js";
|
|
3
|
+
import { I as s } from "../IconButton-uGJ3cQtk.js";
|
|
4
4
|
import { jsx as a } from "react/jsx-runtime";
|
|
5
5
|
import m from "react";
|
|
6
6
|
import { T as c } from "../index-BVqs-uqP.js";
|
|
7
7
|
import { L as e } from "../loader-circle-D1YXTEGq.js";
|
|
8
|
-
import { R as I } from "../RichButton-
|
|
9
|
-
import { T as b } from "../TriggerButton-
|
|
8
|
+
import { R as I } from "../RichButton-B1wjK7Bk.js";
|
|
9
|
+
import { T as b } from "../TriggerButton-Bakr8Boi.js";
|
|
10
10
|
const l = c({
|
|
11
11
|
slots: {
|
|
12
12
|
icon: "animate-spin"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SelectHTMLAttributes } from 'react';
|
|
2
|
+
import { ClassNames, CustomComponents, DropdownOption } from 'react-day-picker';
|
|
3
|
+
export type CalendarDropdownProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, "children"> & {
|
|
4
|
+
options?: DropdownOption[];
|
|
5
|
+
/** Передаёт react-day-picker: переопределения классов потребителя */
|
|
6
|
+
classNames?: Partial<ClassNames>;
|
|
7
|
+
/** Передаёт react-day-picker: переопределения компонентов потребителя */
|
|
8
|
+
components?: Partial<CustomComponents>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Селект месяца/года в шапке календаря: прозрачный нативный select поверх подписи с шевроном.
|
|
12
|
+
*
|
|
13
|
+
* В отличие от штатного Dropdown из react-day-picker, подпись резервирует ширину самой длинной
|
|
14
|
+
* опции: все подписи лежат в одной grid-ячейке, видна только выбранная. Иначе при смене месяца
|
|
15
|
+
* («май» → «сентябрь») меняется ширина и шапка, выровненная по центру, дёргается.
|
|
16
|
+
*
|
|
17
|
+
* @param options - Опции селекта
|
|
18
|
+
* @param className - Дополнительные CSS классы для select
|
|
19
|
+
* @param props - Атрибуты нативного select
|
|
20
|
+
*/
|
|
21
|
+
export declare const CalendarDropdown: {
|
|
22
|
+
({ options, className, classNames, components, ...props }: CalendarDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|