ics-ui-kit 0.1.17 → 0.1.19
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/{CheckboxField-2zNFubvm.js → CheckboxField-limFbMk2.js} +43 -43
- package/dist/CheckboxField-limFbMk2.js.map +1 -0
- package/dist/{Command-D5zgJ7-y.js → Command-B7ZRyW8w.js} +2 -2
- package/dist/Command-B7ZRyW8w.js.map +1 -0
- package/dist/{FormFooterTemplate-Cfn5Nmge.js → FormFooterTemplate-DdNnLu2-.js} +3 -3
- package/dist/{FormFooterTemplate-Cfn5Nmge.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-BvD9Igmt.js → InputGroup-AVAtosX_.js} +21 -23
- package/dist/InputGroup-AVAtosX_.js.map +1 -0
- 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/{Select-MLPTpIl5.js → Select-D9juHX8o.js} +7 -8
- package/dist/{Select-MLPTpIl5.js.map → Select-D9juHX8o.js.map} +1 -1
- package/dist/{TextInput-Cj50ImXi.js → TextInput-5BuZtWV6.js} +2 -2
- package/dist/{TextInput-Cj50ImXi.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.js +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +2 -2
- 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 +9 -9
- package/dist/components/image-uploader.js.map +1 -1
- package/dist/components/input.js +5 -5
- 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/radio-group.js +10 -10
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/search-select.js +41 -41
- package/dist/components/search-select.js.map +1 -1
- package/dist/components/select/Select.d.ts +0 -3
- package/dist/components/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 +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toast.js +2 -2
- package/dist/{inputBaseStyles-DbzD_jvq.js → inputBaseStyles-BfZIWuQ6.js} +5 -5
- package/dist/inputBaseStyles-BfZIWuQ6.js.map +1 -0
- package/dist/styles-scoped.css +77 -154
- package/dist/styles.css +77 -154
- 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
- package/dist/CheckboxField-2zNFubvm.js.map +0 -1
- package/dist/Command-D5zgJ7-y.js.map +0 -1
- package/dist/InputGroup-BvD9Igmt.js.map +0 -1
- package/dist/inputBaseStyles-DbzD_jvq.js.map +0 -1
|
@@ -3,8 +3,8 @@ 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-
|
|
7
|
-
import { a as k } from "./CheckboxField-
|
|
6
|
+
import { B as h } from "./Button-BZ3ON1Tj.js";
|
|
7
|
+
import { a as k } from "./CheckboxField-limFbMk2.js";
|
|
8
8
|
import { e as y } from "./useBreakpoints-DHvp74UL.js";
|
|
9
9
|
const H = F({
|
|
10
10
|
slots: {
|
|
@@ -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,UAAU;AAAA,IACT,WAAW;AAAA,MACV,SAAS;AAAA,QACR,QAAQ;AAAA,MACT;AAAA,MACA,MAAM;AAAA,QACL,QAAQ;AAAA,QACR,gBAAgB;AAAA,MACjB;AAAA,MACA,QAAQ;AAAA,QACP,QAAQ;AAAA,QACR,gBAAgB;AAAA,MAAA;AAAA,IACjB;AAAA,EAEF;AAAA,EACA,iBAAiB;AAAA,IAChB,WAAW;AAAA,EAAA;AAEb,CAAC,GAcYC,IAAqBC,EAAM;AAAA,EACvC,CAAC,EAAE,WAAAC,GAAW,MAAMC,GAAM,OAAAC,GAAO,WAAAC,GAAW,aAAAC,GAAa,YAAAC,GAAY,GAAGC,EAAM,GAAGC,MAAQ;AAClF,UAAA,EAAE,QAAAC,GAAQ,gBAAAC,GAAgB,MAAAC,MAASd,EAAyB,EAAE,WAAAO,GAAW;AAG9E,WAAA,gBAAAQ,EAACC,GAAW,EAAA,KAAAL,GAAU,WAAWC,EAAO,EAAE,OAAOR,EAAW,CAAA,GAAI,GAAGM,GACjE,UAAA;AAAA,MAAQL,KAAA,gBAAAY,EAACC,KAAY,MAAK,MAAK,MAAMb,GAAM,WAAWS,KAAQ;AAAA,MAC9DL,KAAcA;AAAA,MACd,gBAAAM,EAAA,OAAA,EAAI,WAAWF,EAAA,GACd,UAAA;AAAA,QAAAP;AAAA,QACAE;AAAA,MAAA,EACF,CAAA;AAAA,IAAA,GACD;AAAA,EAAA;AAGH,GAMaW,IAAqBhB,EAAM;AAAA,EACvC,CAAC,EAAE,OAAAG,GAAO,aAAAE,GAAa,GAAGE,EAAA,GAASC,MAEjC,gBAAAM;AAAA,IAACf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EA,gBAAAV,EAAA,OAAA,EAAI,WAAWiB,EACd,GAAA,UAAAJ,IACE,CAACK,GAAsBE,CAAsB,IAC7C,CAACA,GAAwBF,CAAoB,EACjD,CAAA;AAAA,IAAA,EAAA,CACD,EACD,CAAA;AAAA,EAAA;AAGH;AAEAZ,EAAmB,cAAc;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
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;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import s, { useRef as d } from "react";
|
|
3
3
|
import { T as u } from "./index-BVqs-uqP.js";
|
|
4
|
-
import { u as l, i as b } from "./inputBaseStyles-
|
|
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: [
|
|
@@ -13,7 +13,7 @@ const h = u({
|
|
|
13
13
|
// Стили для обычных read-only input'ов (исключая file)
|
|
14
14
|
"has-[input:read-only:not([type='file'])]:border-primary-border",
|
|
15
15
|
"has-[input:read-only:not([type='file'])]:bg-secondary-bg-hover",
|
|
16
|
-
"has-[input:read-only:not([type='file'])]:shadow-
|
|
16
|
+
"has-[input:read-only:not([type='file'])]:shadow-none",
|
|
17
17
|
"has-[input:read-only:not([type='file'])]:hover:bg-secondary-bg-hover",
|
|
18
18
|
"has-[input:read-only:not([type='file'])]:has-[input:focus]:!bg-secondary-bg-hover",
|
|
19
19
|
"has-[input:read-only:not([type='file'])]:has-[input:focus]:shadow-focus",
|
|
@@ -23,13 +23,11 @@ const h = u({
|
|
|
23
23
|
"has-[input:invalid]:border-status-error-secondary-border",
|
|
24
24
|
"has-[input:invalid]:shadow-soft-base",
|
|
25
25
|
"has-[input:invalid]:hover:border-status-error-primary-border",
|
|
26
|
-
"has-[input:invalid]:hover:shadow-soft-base",
|
|
27
26
|
"has-[input:invalid]:has-[input:focus]:border-status-error-secondary-border",
|
|
28
27
|
"has-[input:invalid]:has-[input:focus]:shadow-focus-error",
|
|
29
28
|
"has-[input[aria-invalid=true]]:border-status-error-secondary-border",
|
|
30
29
|
"has-[input[aria-invalid=true]]:shadow-soft-base",
|
|
31
30
|
"has-[input[aria-invalid=true]]:hover:border-status-error-primary-border",
|
|
32
|
-
"has-[input[aria-invalid=true]]:hover:shadow-soft-base",
|
|
33
31
|
"has-[input[aria-invalid=true]]:has-[input:focus]:border-status-error-secondary-border",
|
|
34
32
|
"has-[input[aria-invalid=true]]:has-[input:focus]:shadow-focus-error",
|
|
35
33
|
// Стили для автозаполнения - применяем фон ко всей группе
|
|
@@ -37,13 +35,13 @@ const h = u({
|
|
|
37
35
|
"has-[input:-webkit-autofill]:has-[input:focus]:bg-[hsl(var(--autofill-bg))]"
|
|
38
36
|
]
|
|
39
37
|
}), y = s.forwardRef(
|
|
40
|
-
({ className: e, children: t, ...
|
|
38
|
+
({ className: e, children: t, ...r }, a) => {
|
|
41
39
|
const o = h({ className: e });
|
|
42
|
-
return /* @__PURE__ */ n("div", { ref:
|
|
40
|
+
return /* @__PURE__ */ n("div", { ref: a, className: o, ...r, children: t });
|
|
43
41
|
}
|
|
44
42
|
);
|
|
45
43
|
y.displayName = "InputGroup";
|
|
46
|
-
const
|
|
44
|
+
const g = u({
|
|
47
45
|
base: [
|
|
48
46
|
"min-w-5 flex-1 rounded-lg bg-transparent py-2.5 pl-3 lg:py-2",
|
|
49
47
|
"outline-none placeholder:text-muted focus:outline-none",
|
|
@@ -53,9 +51,9 @@ const m = u({
|
|
|
53
51
|
"[-webkit-autofill]:bg-transparent",
|
|
54
52
|
"[-webkit-autofill]:shadow-none"
|
|
55
53
|
]
|
|
56
|
-
}),
|
|
57
|
-
({ className: e, error: t, ...
|
|
58
|
-
const o =
|
|
54
|
+
}), m = s.forwardRef(
|
|
55
|
+
({ className: e, error: t, ...r }, a) => {
|
|
56
|
+
const o = g({ className: e }), i = d(null), p = f(i, a);
|
|
59
57
|
return l(i, t), /* @__PURE__ */ n(
|
|
60
58
|
"input",
|
|
61
59
|
{
|
|
@@ -63,12 +61,12 @@ const m = u({
|
|
|
63
61
|
className: o,
|
|
64
62
|
"aria-invalid": !!t,
|
|
65
63
|
"data-input-group-element": "input",
|
|
66
|
-
...
|
|
64
|
+
...r
|
|
67
65
|
}
|
|
68
66
|
);
|
|
69
67
|
}
|
|
70
68
|
);
|
|
71
|
-
|
|
69
|
+
m.displayName = "InputGroup.Input";
|
|
72
70
|
const v = u({
|
|
73
71
|
base: [
|
|
74
72
|
"flex h-full items-center border-l border-secondary-border px-3 text-secondary-fg first:border-l-0",
|
|
@@ -80,27 +78,27 @@ const v = u({
|
|
|
80
78
|
primary: "rounded-l-lg bg-secondary-bg-hover"
|
|
81
79
|
}
|
|
82
80
|
}
|
|
83
|
-
}), w = s.forwardRef(({ className: e, type: t, ...
|
|
81
|
+
}), w = s.forwardRef(({ className: e, type: t, ...r }, a) => {
|
|
84
82
|
const o = v({ className: e, type: t });
|
|
85
|
-
return /* @__PURE__ */ n("div", { ref:
|
|
83
|
+
return /* @__PURE__ */ n("div", { ref: a, className: o, "data-input-group-element": "text", ...r });
|
|
86
84
|
});
|
|
87
85
|
w.displayName = "InputGroup.Text";
|
|
88
86
|
const x = u({
|
|
89
87
|
base: ["bg-transparent py-2.5 pl-3 lg:py-2", "outline-none focus:outline-none"]
|
|
90
88
|
}), I = s.forwardRef(
|
|
91
|
-
({ className: e, error: t, ...
|
|
89
|
+
({ className: e, error: t, ...r }, a) => {
|
|
92
90
|
const o = x({ className: e });
|
|
93
91
|
return /* @__PURE__ */ n(
|
|
94
92
|
"div",
|
|
95
93
|
{
|
|
96
|
-
ref:
|
|
94
|
+
ref: a,
|
|
97
95
|
className: o,
|
|
98
96
|
contentEditable: !0,
|
|
99
97
|
role: "textbox",
|
|
100
98
|
"aria-invalid": !!t,
|
|
101
99
|
"data-input-group-element": "contenteditable",
|
|
102
100
|
suppressContentEditableWarning: !0,
|
|
103
|
-
...
|
|
101
|
+
...r
|
|
104
102
|
}
|
|
105
103
|
);
|
|
106
104
|
}
|
|
@@ -109,19 +107,19 @@ I.displayName = "InputGroup.ContentEditable";
|
|
|
109
107
|
const G = u({
|
|
110
108
|
base: ["aspect-auto h-full px-1.5 py-2.5 first:pl-2.5 last:pr-2.5 lg:py-2"]
|
|
111
109
|
}), N = s.forwardRef(
|
|
112
|
-
({ icon: e, className: t, ...
|
|
110
|
+
({ icon: e, className: t, ...r }, a) => {
|
|
113
111
|
const o = G({ className: t });
|
|
114
112
|
return /* @__PURE__ */ n(
|
|
115
113
|
c,
|
|
116
114
|
{
|
|
117
|
-
ref:
|
|
115
|
+
ref: a,
|
|
118
116
|
icon: e,
|
|
119
117
|
className: o,
|
|
120
118
|
variant: "text",
|
|
121
119
|
size: "md",
|
|
122
120
|
"data-input-group-element": "button",
|
|
123
121
|
type: "button",
|
|
124
|
-
...
|
|
122
|
+
...r
|
|
125
123
|
}
|
|
126
124
|
);
|
|
127
125
|
}
|
|
@@ -130,8 +128,8 @@ N.displayName = "InputGroup.Button";
|
|
|
130
128
|
export {
|
|
131
129
|
I,
|
|
132
130
|
y as a,
|
|
133
|
-
|
|
131
|
+
m as b,
|
|
134
132
|
w as c,
|
|
135
133
|
N as d
|
|
136
134
|
};
|
|
137
|
-
//# sourceMappingURL=InputGroup-
|
|
135
|
+
//# sourceMappingURL=InputGroup-AVAtosX_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAA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 +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,EA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A,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
|
+
{"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.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ACa,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;"}
|
|
@@ -841,27 +841,26 @@ const vo = ({ onClear: t, ...r }) => /* @__PURE__ */ c(
|
|
|
841
841
|
base: [
|
|
842
842
|
"group flex h-10 w-full items-center whitespace-nowrap rounded-lg border border-secondary-border bg-secondary-bg py-2.5 pl-3 pr-2.5 font-sans shadow-soft-sm outline-none lg:h-9 lg:py-2",
|
|
843
843
|
"text-sm text-primary-fg",
|
|
844
|
-
"hover:border-primary-border
|
|
844
|
+
"hover:border-primary-border",
|
|
845
845
|
"focus-visible:rounded-lg focus-visible:border focus-visible:border-secondary-border focus-visible:bg-secondary-bg focus-visible:shadow-focus",
|
|
846
|
-
"disabled:border-primary-border disabled:bg-secondary-bg-hover disabled:shadow-
|
|
846
|
+
"disabled:border-primary-border disabled:bg-secondary-bg-hover disabled:shadow-none",
|
|
847
847
|
"data-[placeholder]:text-muted [&>span]:line-clamp-1",
|
|
848
848
|
"invalid:border-status-error-secondary-border invalid:shadow-soft-base",
|
|
849
|
-
"invalid:hover:border-status-error-primary-border invalid:
|
|
849
|
+
"invalid:hover:border-status-error-primary-border invalid:focus-visible:border-status-error-secondary-border invalid:focus-visible:shadow-focus-error"
|
|
850
850
|
],
|
|
851
851
|
slots: {
|
|
852
852
|
iconWrapper: "ml-auto flex items-center",
|
|
853
|
-
icon: "pointer-events-none h-4 w-4 text-muted
|
|
853
|
+
icon: "pointer-events-none h-4 w-4 text-muted"
|
|
854
854
|
},
|
|
855
855
|
variants: {
|
|
856
856
|
invalid: {
|
|
857
857
|
true: {
|
|
858
|
-
base: "border-status-error-secondary-border shadow-soft-base hover:border-status-error-primary-border
|
|
858
|
+
base: "border-status-error-secondary-border shadow-soft-base hover:border-status-error-primary-border focus-visible:border-status-error-secondary-border focus-visible:shadow-focus-error"
|
|
859
859
|
}
|
|
860
860
|
},
|
|
861
861
|
disabled: {
|
|
862
862
|
true: {
|
|
863
|
-
base: "border-primary-border bg-secondary-bg-hover shadow-
|
|
864
|
-
icon: "hidden"
|
|
863
|
+
base: "border-primary-border bg-secondary-bg-hover shadow-none"
|
|
865
864
|
}
|
|
866
865
|
}
|
|
867
866
|
}
|
|
@@ -978,4 +977,4 @@ export {
|
|
|
978
977
|
vo as m,
|
|
979
978
|
go as s
|
|
980
979
|
};
|
|
981
|
-
//# sourceMappingURL=Select-
|
|
980
|
+
//# sourceMappingURL=Select-D9juHX8o.js.map
|