@lax-wp/design-system 0.14.20 → 0.14.21
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),C=require("antd"),r=require("../../_virtual/index.cjs.js"),g=require("framer-motion"),c=require("react"),B=require("react-i18next"),s=require("../data-display/typography/Typography.cjs.js"),q=require("../buttons/option-button/OptionButton.cjs.js"),D=require("../button/IconButton.cjs.js"),j=require("../tooltip/Tooltip.cjs.js"),F=require("../icon/icons.generated.cjs.js"),R=({size:n=24,fill:o="currentColor",className:x})=>t.jsx("svg",{className:x,width:n,height:n,viewBox:"0 0 20 20",fill:o,xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z"})}),z=({fill:n="#cccccc",className:o})=>t.jsx("svg",{height:"20",width:"20",viewBox:"0 0 20 20",focusable:"false",className:o,children:t.jsx("path",{fill:n,d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})}),k=n=>{const{show:o,isFlowDashboard:x,onClose:N,actionItems:m,selectedItemsCount:I,deleteConfig:p,showActionBg:A}=n,{t:h}=B.useTranslation(),[b,y]=c.useState(!1),[L,f]=c.useState(!0),l=c.useRef(null),v=c.useRef(null);c.useEffect(()=>{const e=new ResizeObserver(()=>{if(l.current&&v.current){const i=l.current.scrollWidth-100;m.length*180+100>i?f(!1):f(!0)}});return l.current&&e.observe(l.current),()=>{l.current&&e.unobserve(l.current)}});const a={label:h("Delete"),icon:t.jsx(F.DeleteIcon,{className:"text-error-700 w-icon h-icon"}),onClick:p?.onClick,...p},d=e=>{const i=e.label?.toLowerCase()??"";return i.includes("delete")||i==="remove"||i==="move to trash"},T=[...m].sort((e,i)=>Number(d(e))-Number(d(i))),u=m.filter(e=>e.visible!==!1).map((e,i)=>({key:i,label:t.jsx(q.OptionButton,{icon:e.dropdownIcon,text:e?.label||"",onClick:e.onClick,className:"font-inter text-base font-medium text-black-900 dark:text-black-200 gap-1.5"}),children:e.dropdownItems,disabled:!1}));return o?t.jsx(g.motion.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},exit:{y:20,opacity:0},transition:{duration:.2,ease:[.4,0,.2,1],opacity:{duration:.15}},ref:l,className:r("h-[36px] mb-4",x?"ml-60 w-1/2":"w-full"),children:t.jsxs("div",{className:r("border-y border-neutral-900 dark:border-[#0d1014 px-[12px] text-white bg-neutral-900 dark:bg-black-900 flex justify-between items-center"),children:[t.jsxs("div",{className:"flex items-center gap-[12px]",children:[t.jsxs("div",{className:"flex items-center gap-[8px]",children:[t.jsx(D,{tooltip:"Close",variant:"ghost",onClick:N,className:"!p-0 text-white hover:opacity-80 hover:rotate-90 transition-all duration-200",children:t.jsx(R,{size:16})}),t.jsx("div",{className:"w-px h-[14px] rounded-[1px] bg-neutral-700 dark:bg-[#1d242c]"})]}),t.jsxs("div",{className:"flex items-center gap-[6px]",children:[t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-[16px] px-[8px] rounded-[9px] border text-[12px] leading-[18px] font-normal text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-[rgba(0,50,95,0.3)] border-primary-200 dark:border-primary-800",children:I||0}),t.jsx(s.Typography,{size:"extra-small",appearance:"custom",className:"text-white dark:text-neutral-50",children:h("Selected")})]})]}),t.jsx("div",{ref:v,className:r("h-[36px] flex items-center font-inter bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]"),children:L?t.jsxs(g.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"flex items-center h-[36px] bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]",children:[T.map((e,i)=>e.visible!==!1&&t.jsx("div",{children:e.type==="dropdown"?t.jsx(C.Dropdown,{menu:{items:e.dropdownItems},trigger:[e.dropdownTrigger||"click"],overlayClassName:"!min-w-[148px]",placement:"bottomRight",getPopupContainer:w=>w.parentElement,open:b,onOpenChange:y,children:t.jsx("button",{id:`btn-floating-bar-${e.label}`,onClick:e.onClick,disabled:e.disabled,className:r(e?.label?"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent":"bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80",e?.hideLabel&&"!p-1.5",d(e)&&"!text-error-700",e.disabled&&"opacity-70"),children:t.jsxs(j,{hideTooltip:!e.tooltip,title:e.tooltip,className:"flex items-center gap-1.5",children:[e.icon,!e?.hideLabel&&e.label&&t.jsx(s.Typography,{size:"small",variant:"medium",className:"text-inherit",appearance:"custom",children:e.label})]})},i)}):t.jsx("button",{id:`btn-floating-bar-${e.label}`,onClick:e.onClick,disabled:e.disabled,className:r(e?.label?"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent":"bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80",e?.hideLabel&&"!p-1.5",d(e)&&"!text-error-700",e.disabled&&"opacity-70"),children:t.jsxs(j,{hideTooltip:!e.tooltip,title:e.tooltip,className:"flex items-center gap-1.5",children:[e.icon,!e?.hideLabel&&e.label&&t.jsx(s.Typography,{size:"small",variant:"medium",className:"text-inherit",appearance:"custom",children:e.label})]})})},i)),p?t.jsxs("button",{id:`btn-floating-bar-${a.label}`,onClick:a.onClick,disabled:a.disabled,className:r("flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200",a.disabled&&"opacity-70"),children:[a.icon,t.jsx(s.Typography,{size:"small",variant:"medium",className:"text-error-700",appearance:"custom",children:a.label})]}):null]}):t.jsxs(g.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"minw-[150px] p-1.5 flex items-center",children:[t.jsx(C.Dropdown,{menu:{items:u},trigger:["click"],overlayClassName:"!min-w-[148px]",placement:"bottomRight",getPopupContainer:e=>e.parentElement,open:b,onOpenChange:y,children:t.jsxs("button",{id:"btn-floating-bar-actions",disabled:u.length===0,className:r("flex items-center gap-1.5 px-2 py-1 w-22 h-7 rounded-full bg-[#34405473]/45 dark:bg-black-700 hover:scale-105 hover:opacity-80 transition-all duration-200",u.length===0&&"opacity-60 hover:scale-100 hover:opacity-60"),type:"button",children:[t.jsx(s.Typography,{size:"small",variant:"medium",className:"text-white",children:h("Actions")}),t.jsx(z,{fill:"#FFFFFF",className:"w-[16px] h-[16px]"})]})}),p?t.jsxs("button",{id:`btn-floating-bar-${a.label}`,onClick:a.onClick,disabled:a.disabled,className:r("flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200",a.disabled&&"opacity-70"),type:"button",children:[a.icon,t.jsx(s.Typography,{size:"small",variant:"medium",className:"text-error-700",appearance:"custom",children:a.label})]}):null]})})]})}):null};k.displayName="FloatingBar";exports.FloatingBar=k;
|
|
2
2
|
//# sourceMappingURL=FloatingBar.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingBar.cjs.js","sources":["../../../src/components/floating-bar/FloatingBar.tsx"],"sourcesContent":["import { Dropdown } from \"antd\";\nimport cn from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport { useEffect, useRef, useState, type FC, type ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Typography } from \"../data-display/typography/Typography\";\nimport { OptionButton } from \"../buttons/option-button/OptionButton\";\nimport IconButton from \"../button/IconButton\";\nimport Tooltip from \"../tooltip/Tooltip\";\nimport { DeleteIcon } from \"../icon\";\n\n/**\n * Close icon component\n */\nconst CloseIcon: FC<{ size?: number; fill?: string; className?: string }> = ({\n size = 24,\n fill = \"currentColor\",\n className,\n}) => (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 20 20\"\n fill={fill}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z\" />\n </svg>\n);\n\n/**\n * Dropdown arrow icon component\n */\nconst DropdownArrowIcon: FC<{ fill?: string; className?: string }> = ({\n fill = \"#cccccc\",\n className,\n}) => (\n <svg\n height=\"20\"\n width=\"20\"\n viewBox=\"0 0 20 20\"\n focusable=\"false\"\n className={className}\n >\n <path\n fill={fill}\n d=\"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\"\n />\n </svg>\n);\n\n/**\n * Configuration for action buttons in the floating bar\n */\nexport type ButtonConfig = {\n /** Button label text */\n label?: string;\n /** Icon element to display */\n icon: ReactNode;\n /** Click handler for the action */\n onClick?: () => void;\n /** Icon for dropdown mode */\n dropdownIcon?: ReactNode;\n /** Whether the action is visible */\n visible?: boolean;\n /** Whether the action is disabled */\n disabled?: boolean;\n /** Tooltip text */\n tooltip?: string;\n /** Whether to hide the label text */\n hideLabel?: boolean;\n /** Action type */\n type?: \"button\" | \"dropdown\";\n /** Dropdown trigger mode */\n dropdownTrigger?: \"click\" | \"hover\";\n /** Dropdown menu items */\n dropdownItems?: Array<{\n label: ReactNode;\n key: string;\n disabled?: boolean;\n }>;\n};\n\n/**\n * Props for the FloatingBar component\n */\nexport type TFloatingBar = {\n /** Whether the floating bar is visible */\n show?: boolean;\n /** Close handler */\n onClose: () => void;\n /** Whether this is used in flow dashboard layout */\n isFlowDashboard?: boolean;\n /** Array of action configurations */\n actionItems: ButtonConfig[];\n /** Number of selected items */\n selectedItemsCount?: number;\n /** Delete action configuration */\n deleteConfig?: {\n label?: string;\n disabled?: boolean;\n onClick?: () => void;\n };\n /** Whether to show action background */\n showActionBg?: boolean;\n};\n\n/**\n * FloatingBar component provides a floating action bar for bulk operations.\n * Drop-in replacement matching the lax-web-portal implementation.\n *\n * @example\n * ```tsx\n * <FloatingBar\n * show={selectedItems.length > 0}\n * onClose={() => setSelectedItems([])}\n * selectedItemsCount={selectedItems.length}\n * actionItems={[\n * {\n * label: \"Edit\",\n * icon: <EditIcon size={16} />,\n * onClick: handleEdit,\n * },\n * {\n * label: \"Archive\",\n * icon: <ArchiveIcon size={16} />,\n * onClick: handleArchive,\n * },\n * ]}\n * deleteConfig={{\n * label: \"Delete\",\n * onClick: handleDelete,\n * }}\n * />\n * ```\n */\nexport const FloatingBar: FC<TFloatingBar> = (props) => {\n const {\n show,\n isFlowDashboard,\n onClose,\n actionItems,\n selectedItemsCount,\n deleteConfig,\n showActionBg,\n } = props;\n\n const { t } = useTranslation();\n const [showDropdown, setShowDropdown] = useState<boolean>(false);\n const [showButtons, setShowButtons] = useState<boolean>(true);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const actionContainerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const observer = new ResizeObserver(() => {\n if (containerRef.current && actionContainerRef.current) {\n const containerWidth = containerRef.current.scrollWidth - 100;\n const totalActionItemsWidth = actionItems.length * 180 + 100;\n if (totalActionItemsWidth > containerWidth) {\n setShowButtons(false);\n } else {\n setShowButtons(true);\n }\n }\n });\n\n if (containerRef.current) {\n observer.observe(containerRef.current);\n }\n\n return () => {\n if (containerRef.current) {\n observer.unobserve(containerRef.current);\n }\n };\n });\n\n const deleteButtonConfig = {\n label: t(\"Delete\"),\n icon: <DeleteIcon className=\"text-error-700 w-icon h-icon\" />,\n color: \"text-error-700 dark:text-error-700\",\n onClick: deleteConfig?.onClick,\n ...deleteConfig,\n };\n\n const dropDownItems = actionItems\n .filter((button) => button.visible !== false)\n .map((button, index) => ({\n key: index,\n label: (\n <OptionButton\n icon={button.dropdownIcon}\n text={button?.label || \"\"}\n onClick={button.onClick}\n className=\"font-inter text-base font-medium text-black-900 dark:text-black-200 gap-1.5\"\n />\n ),\n children: button.dropdownItems,\n disabled: false,\n }));\n\n return !show ? null : (\n <motion.div\n initial={{ y: 20, opacity: 0 }}\n animate={{ y: 0, opacity: 1 }}\n exit={{ y: 20, opacity: 0 }}\n transition={{\n duration: 0.2,\n ease: [0.4, 0, 0.2, 1],\n opacity: { duration: 0.15 },\n }}\n ref={containerRef}\n className={cn(\"h-[36px] mb-4\", isFlowDashboard ? \"ml-60 w-1/2\" : \"w-full\")}\n >\n <div\n className={cn(\n \"border-y border-neutral-900 dark:border-[#0d1014 px-[12px] text-white bg-neutral-900 dark:bg-black-900 flex justify-between items-center\"\n )}\n >\n <div className=\"flex items-center gap-[12px]\">\n <div className=\"flex items-center gap-[8px]\">\n <IconButton\n tooltip=\"Close\"\n variant=\"ghost\"\n onClick={onClose}\n className=\"!p-0 text-white hover:opacity-80 hover:rotate-90 transition-all duration-200\"\n >\n <CloseIcon size={16} />\n </IconButton>\n <div className=\"w-px h-[14px] rounded-[1px] bg-neutral-700 dark:bg-[#1d242c]\" />\n </div>\n <div className=\"flex items-center gap-[6px]\">\n <span className=\"inline-flex items-center justify-center min-w-[20px] h-[16px] px-[8px] rounded-[9px] border text-[12px] leading-[18px] font-normal text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-[rgba(0,50,95,0.3)] border-primary-200 dark:border-primary-800\">\n {selectedItemsCount || 0}\n </span>\n <Typography\n size=\"extra-small\"\n appearance=\"custom\"\n className=\"text-white dark:text-neutral-50\"\n >\n {t(\"Selected\")}\n </Typography>\n </div>\n </div>\n <div\n ref={actionContainerRef}\n className={cn(\n \"h-[36px] flex items-center font-inter bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]\"\n )}\n >\n {showButtons ? (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"flex items-center h-[36px] bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]\"\n >\n {actionItems.map(\n (button, index) =>\n button.visible !== false && (\n <div key={index}>\n {button.type === \"dropdown\" ? (\n <Dropdown\n menu={{\n items: button.dropdownItems,\n }}\n trigger={[button.dropdownTrigger || \"click\"]}\n overlayClassName=\"!min-w-[148px]\"\n placement=\"bottomRight\"\n getPopupContainer={(trigger) =>\n trigger.parentElement as HTMLElement\n }\n open={showDropdown}\n onOpenChange={setShowDropdown}\n >\n <button\n key={index}\n id={`btn-floating-bar-${button.label}`}\n onClick={button.onClick}\n disabled={button.disabled}\n className={cn(\n !button?.label\n ? \"bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80\"\n : \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent\",\n button?.hideLabel && \"!p-1.5\",\n (button.label === \"Delete\" ||\n button.label === \"Remove\" ||\n button.label === \"Delete user\" ||\n button.label === \"Move to trash\" ||\n button.label === \"Delete Permanently\") &&\n \"!text-error-700\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center gap-1.5\"\n >\n {button.icon}\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit\"}\n appearance=\"custom\"\n >\n {button.label}\n </Typography>\n )}\n </Tooltip>\n </button>\n </Dropdown>\n ) : (\n <button\n id={`btn-floating-bar-${button.label}`}\n onClick={button.onClick}\n disabled={button.disabled}\n className={cn(\n !button?.label\n ? \"bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80\"\n : \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent\",\n button?.hideLabel && \"!p-1.5\",\n (button.label === \"Delete\" ||\n button.label === \"Remove\" ||\n button.label === \"Move to trash\" ||\n button.label === \"Delete Permanently\" ||\n button.label?.toLowerCase()?.includes('delete')) &&\n \"!text-error-700\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center gap-1.5\"\n >\n {button.icon}\n\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit\"}\n appearance=\"custom\"\n >\n {button.label}\n </Typography>\n )}\n </Tooltip>\n </button>\n )}\n </div>\n )\n )}\n {deleteConfig ? (\n <button\n id={`btn-floating-bar-${deleteButtonConfig.label}`}\n onClick={deleteButtonConfig.onClick}\n disabled={deleteButtonConfig.disabled}\n className={cn(\n \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200\",\n deleteButtonConfig.disabled && \"opacity-70\"\n )}\n >\n {deleteButtonConfig.icon}\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-error-700\"\n appearance=\"custom\"\n >\n {deleteButtonConfig.label}\n </Typography>\n </button>\n ) : null}\n </motion.div>\n ) : (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"minw-[150px] p-1.5 flex items-center\"\n >\n <Dropdown\n menu={{\n items: dropDownItems,\n }}\n trigger={[\"click\"]}\n overlayClassName=\"!min-w-[148px]\"\n placement=\"bottomRight\"\n getPopupContainer={(trigger) =>\n trigger.parentElement as HTMLElement\n }\n open={showDropdown}\n onOpenChange={setShowDropdown}\n >\n <button\n id={`btn-floating-bar-actions`}\n disabled={dropDownItems.length === 0}\n className={cn(\n \"flex items-center gap-1.5 px-2 py-1 w-22 h-7 rounded-full bg-[#34405473]/45 dark:bg-black-700 hover:scale-105 hover:opacity-80 transition-all duration-200\",\n dropDownItems.length === 0 &&\n \"opacity-60 hover:scale-100 hover:opacity-60\"\n )}\n type=\"button\"\n >\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-white\"\n >\n {t(\"Actions\")}\n </Typography>\n <DropdownArrowIcon\n fill=\"#FFFFFF\"\n className=\"w-[16px] h-[16px]\"\n />\n </button>\n </Dropdown>\n {deleteConfig ? (\n <button\n id={`btn-floating-bar-${deleteButtonConfig.label}`}\n onClick={deleteButtonConfig.onClick}\n disabled={deleteButtonConfig.disabled}\n className={cn(\n \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200\",\n deleteButtonConfig.disabled && \"opacity-70\"\n )}\n type=\"button\"\n >\n {deleteButtonConfig.icon}\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-error-700\"\n appearance=\"custom\"\n >\n {deleteButtonConfig.label}\n </Typography>\n </button>\n ) : null}\n </motion.div>\n )}\n </div>\n </div>\n </motion.div>\n );\n};\n\nFloatingBar.displayName = \"FloatingBar\";\n\n// Re-export types for convenience\nexport type { ButtonConfig as FloatingBarActionConfig };\nexport type FloatingBarDeleteConfig = TFloatingBar[\"deleteConfig\"];\nexport type FloatingBarProps = TFloatingBar;\n\n// Legacy type exports for backwards compatibility\nexport type FloatingBarSize = \"small\" | \"medium\" | \"large\";\nexport type FloatingBarPosition = \"top\" | \"bottom\";\nexport type FloatingBarTheme = \"primary\" | \"dark\" | \"light\";\n"],"names":["CloseIcon","size","fill","className","jsx","DropdownArrowIcon","FloatingBar","props","show","isFlowDashboard","onClose","actionItems","selectedItemsCount","deleteConfig","showActionBg","t","useTranslation","showDropdown","setShowDropdown","useState","showButtons","setShowButtons","containerRef","useRef","actionContainerRef","useEffect","observer","containerWidth","deleteButtonConfig","DeleteIcon","dropDownItems","button","index","OptionButton","motion","cn","jsxs","IconButton","Typography","Dropdown","trigger","Tooltip"],"mappings":"yeAcMA,EAAsE,CAAC,CAC3E,KAAAC,EAAO,GACP,KAAAC,EAAO,eACP,UAAAC,CACF,IACEC,EAAAA,IAAC,MAAA,CACC,UAAAD,EACA,MAAOF,EACP,OAAQA,EACR,QAAQ,YACR,KAAAC,EACA,MAAM,6BAEN,SAAAE,EAAAA,IAAC,OAAA,CAAK,EAAE,g4BAAA,CAAi4B,CAAA,CAC34B,EAMIC,EAA+D,CAAC,CACpE,KAAAH,EAAO,UACP,UAAAC,CACF,IACEC,EAAAA,IAAC,MAAA,CACC,OAAO,KACP,MAAM,KACN,QAAQ,YACR,UAAU,QACV,UAAAD,EAEA,SAAAC,EAAAA,IAAC,OAAA,CACC,KAAAF,EACA,EAAE,uRAAA,CAAA,CACJ,CACF,EAwFWI,EAAiCC,GAAU,CACtD,KAAM,CACJ,KAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,YAAAC,EACA,mBAAAC,EACA,aAAAC,EACA,aAAAC,CAAA,EACEP,EAEE,CAAE,EAAAQ,CAAA,EAAMC,iBAAA,EACR,CAACC,EAAcC,CAAe,EAAIC,EAAAA,SAAkB,EAAK,EACzD,CAACC,EAAaC,CAAc,EAAIF,EAAAA,SAAkB,EAAI,EAEtDG,EAAeC,EAAAA,OAAuB,IAAI,EAC1CC,EAAqBD,EAAAA,OAAuB,IAAI,EAEtDE,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAW,IAAI,eAAe,IAAM,CACxC,GAAIJ,EAAa,SAAWE,EAAmB,QAAS,CACtD,MAAMG,EAAiBL,EAAa,QAAQ,Y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,EAEA,IAAA,CAAA,CAAA,EAGNQ,EAAAA,KAACF,EAAAA,OAAO,IAAP,CACC,QAAS,CAAE,QAAS,CAAA,EACpB,QAAS,CAAE,QAAS,CAAA,EACpB,WAAY,CAAE,SAAU,EAAA,EACxB,UAAU,uCAEV,SAAA,CAAA9B,EAAAA,IAACmC,EAAAA,SAAA,CACC,KAAM,CACJ,MAAOT,CAAA,EAET,QAAS,CAAC,OAAO,EACjB,iBAAiB,iBACjB,UAAU,cACV,kBAAoBU,GAClBA,EAAQ,cAEV,KAAMvB,EACN,aAAcC,EAEd,SAAAkB,EAAAA,KAAC,SAAA,CACC,GAAI,2BACJ,SAAUN,EAAc,SAAW,EACnC,UAAWK,EACT,6JACAL,EAAc,SAAW,GACzB,6CAAA,EAEF,KAAK,SAEL,SAAA,CAAA1B,EAAAA,IAACkC,EAAAA,WAAA,CACC,KAAK,QACL,QAAQ,SACR,UAAU,aAET,WAAE,SAAS,CAAA,CAAA,EAEdlC,EAAAA,IAACC,EAAA,CACC,KAAK,UACL,UAAU,mBAAA,CAAA,CACZ,CAAA,CAAA,CACF,CAAA,EAEDQ,EACCuB,EAAAA,KAAC,SAAA,CACC,GAAI,oBAAoBR,EAAmB,KAAK,GAChD,QAASA,EAAmB,QAC5B,SAAUA,EAAmB,SAC7B,UAAWO,EACT,qIACAP,EAAmB,UAAY,YAAA,EAEjC,KAAK,SAEJ,SAAA,CAAAA,EAAmB,KACpBxB,EAAAA,IAACkC,EAAAA,WAAA,CACC,KAAK,QACL,QAAQ,SACR,UAAU,iBACV,WAAW,SAEV,SAAAV,EAAmB,KAAA,CAAA,CACtB,CAAA,CAAA,EAEA,IAAA,CAAA,CAAA,CACN,CAAA,CAEJ,CAAA,CAAA,CACF,CAAA,EApPW,IAuPjB,EAEAtB,EAAY,YAAc"}
|
|
1
|
+
{"version":3,"file":"FloatingBar.cjs.js","sources":["../../../src/components/floating-bar/FloatingBar.tsx"],"sourcesContent":["import { Dropdown } from \"antd\";\nimport cn from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport { useEffect, useRef, useState, type FC, type ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Typography } from \"../data-display/typography/Typography\";\nimport { OptionButton } from \"../buttons/option-button/OptionButton\";\nimport IconButton from \"../button/IconButton\";\nimport Tooltip from \"../tooltip/Tooltip\";\nimport { DeleteIcon } from \"../icon\";\n\n/**\n * Close icon component\n */\nconst CloseIcon: FC<{ size?: number; fill?: string; className?: string }> = ({\n size = 24,\n fill = \"currentColor\",\n className,\n}) => (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 20 20\"\n fill={fill}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z\" />\n </svg>\n);\n\n/**\n * Dropdown arrow icon component\n */\nconst DropdownArrowIcon: FC<{ fill?: string; className?: string }> = ({\n fill = \"#cccccc\",\n className,\n}) => (\n <svg\n height=\"20\"\n width=\"20\"\n viewBox=\"0 0 20 20\"\n focusable=\"false\"\n className={className}\n >\n <path\n fill={fill}\n d=\"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\"\n />\n </svg>\n);\n\n/**\n * Configuration for action buttons in the floating bar\n */\nexport type ButtonConfig = {\n /** Button label text */\n label?: string;\n /** Icon element to display */\n icon: ReactNode;\n /** Click handler for the action */\n onClick?: () => void;\n /** Icon for dropdown mode */\n dropdownIcon?: ReactNode;\n /** Whether the action is visible */\n visible?: boolean;\n /** Whether the action is disabled */\n disabled?: boolean;\n /** Tooltip text */\n tooltip?: string;\n /** Whether to hide the label text */\n hideLabel?: boolean;\n /** Action type */\n type?: \"button\" | \"dropdown\";\n /** Dropdown trigger mode */\n dropdownTrigger?: \"click\" | \"hover\";\n /** Dropdown menu items */\n dropdownItems?: Array<{\n label: ReactNode;\n key: string;\n disabled?: boolean;\n }>;\n};\n\n/**\n * Props for the FloatingBar component\n */\nexport type TFloatingBar = {\n /** Whether the floating bar is visible */\n show?: boolean;\n /** Close handler */\n onClose: () => void;\n /** Whether this is used in flow dashboard layout */\n isFlowDashboard?: boolean;\n /** Array of action configurations */\n actionItems: ButtonConfig[];\n /** Number of selected items */\n selectedItemsCount?: number;\n /** Delete action configuration */\n deleteConfig?: {\n label?: string;\n disabled?: boolean;\n onClick?: () => void;\n };\n /** Whether to show action background */\n showActionBg?: boolean;\n};\n\n/**\n * FloatingBar component provides a floating action bar for bulk operations.\n * Drop-in replacement matching the lax-web-portal implementation.\n *\n * @example\n * ```tsx\n * <FloatingBar\n * show={selectedItems.length > 0}\n * onClose={() => setSelectedItems([])}\n * selectedItemsCount={selectedItems.length}\n * actionItems={[\n * {\n * label: \"Edit\",\n * icon: <EditIcon size={16} />,\n * onClick: handleEdit,\n * },\n * {\n * label: \"Archive\",\n * icon: <ArchiveIcon size={16} />,\n * onClick: handleArchive,\n * },\n * ]}\n * deleteConfig={{\n * label: \"Delete\",\n * onClick: handleDelete,\n * }}\n * />\n * ```\n */\nexport const FloatingBar: FC<TFloatingBar> = (props) => {\n const {\n show,\n isFlowDashboard,\n onClose,\n actionItems,\n selectedItemsCount,\n deleteConfig,\n showActionBg,\n } = props;\n\n const { t } = useTranslation();\n const [showDropdown, setShowDropdown] = useState<boolean>(false);\n const [showButtons, setShowButtons] = useState<boolean>(true);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const actionContainerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const observer = new ResizeObserver(() => {\n if (containerRef.current && actionContainerRef.current) {\n const containerWidth = containerRef.current.scrollWidth - 100;\n const totalActionItemsWidth = actionItems.length * 180 + 100;\n if (totalActionItemsWidth > containerWidth) {\n setShowButtons(false);\n } else {\n setShowButtons(true);\n }\n }\n });\n\n if (containerRef.current) {\n observer.observe(containerRef.current);\n }\n\n return () => {\n if (containerRef.current) {\n observer.unobserve(containerRef.current);\n }\n };\n });\n\n const deleteButtonConfig = {\n label: t(\"Delete\"),\n icon: <DeleteIcon className=\"text-error-700 w-icon h-icon\" />,\n color: \"text-error-700 dark:text-error-700\",\n onClick: deleteConfig?.onClick,\n ...deleteConfig,\n };\n\n /** Whether a button represents a destructive/delete action */\n const isDeleteAction = (button: ButtonConfig) => {\n const label = button.label?.toLowerCase() ?? \"\";\n return (\n label.includes(\"delete\") ||\n label === \"remove\" ||\n label === \"move to trash\"\n );\n };\n\n /** Delete actions are always displayed last (on the right) */\n const sortedActionItems = [...actionItems].sort(\n (a, b) => Number(isDeleteAction(a)) - Number(isDeleteAction(b))\n );\n\n const dropDownItems = actionItems\n .filter((button) => button.visible !== false)\n .map((button, index) => ({\n key: index,\n label: (\n <OptionButton\n icon={button.dropdownIcon}\n text={button?.label || \"\"}\n onClick={button.onClick}\n className=\"font-inter text-base font-medium text-black-900 dark:text-black-200 gap-1.5\"\n />\n ),\n children: button.dropdownItems,\n disabled: false,\n }));\n\n return !show ? null : (\n <motion.div\n initial={{ y: 20, opacity: 0 }}\n animate={{ y: 0, opacity: 1 }}\n exit={{ y: 20, opacity: 0 }}\n transition={{\n duration: 0.2,\n ease: [0.4, 0, 0.2, 1],\n opacity: { duration: 0.15 },\n }}\n ref={containerRef}\n className={cn(\"h-[36px] mb-4\", isFlowDashboard ? \"ml-60 w-1/2\" : \"w-full\")}\n >\n <div\n className={cn(\n \"border-y border-neutral-900 dark:border-[#0d1014 px-[12px] text-white bg-neutral-900 dark:bg-black-900 flex justify-between items-center\"\n )}\n >\n <div className=\"flex items-center gap-[12px]\">\n <div className=\"flex items-center gap-[8px]\">\n <IconButton\n tooltip=\"Close\"\n variant=\"ghost\"\n onClick={onClose}\n className=\"!p-0 text-white hover:opacity-80 hover:rotate-90 transition-all duration-200\"\n >\n <CloseIcon size={16} />\n </IconButton>\n <div className=\"w-px h-[14px] rounded-[1px] bg-neutral-700 dark:bg-[#1d242c]\" />\n </div>\n <div className=\"flex items-center gap-[6px]\">\n <span className=\"inline-flex items-center justify-center min-w-[20px] h-[16px] px-[8px] rounded-[9px] border text-[12px] leading-[18px] font-normal text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-[rgba(0,50,95,0.3)] border-primary-200 dark:border-primary-800\">\n {selectedItemsCount || 0}\n </span>\n <Typography\n size=\"extra-small\"\n appearance=\"custom\"\n className=\"text-white dark:text-neutral-50\"\n >\n {t(\"Selected\")}\n </Typography>\n </div>\n </div>\n <div\n ref={actionContainerRef}\n className={cn(\n \"h-[36px] flex items-center font-inter bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]\"\n )}\n >\n {showButtons ? (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"flex items-center h-[36px] bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]\"\n >\n {sortedActionItems.map(\n (button, index) =>\n button.visible !== false && (\n <div key={index}>\n {button.type === \"dropdown\" ? (\n <Dropdown\n menu={{\n items: button.dropdownItems,\n }}\n trigger={[button.dropdownTrigger || \"click\"]}\n overlayClassName=\"!min-w-[148px]\"\n placement=\"bottomRight\"\n getPopupContainer={(trigger) =>\n trigger.parentElement as HTMLElement\n }\n open={showDropdown}\n onOpenChange={setShowDropdown}\n >\n <button\n key={index}\n id={`btn-floating-bar-${button.label}`}\n onClick={button.onClick}\n disabled={button.disabled}\n className={cn(\n !button?.label\n ? \"bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80\"\n : \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent\",\n button?.hideLabel && \"!p-1.5\",\n isDeleteAction(button) && \"!text-error-700\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center gap-1.5\"\n >\n {button.icon}\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit\"}\n appearance=\"custom\"\n >\n {button.label}\n </Typography>\n )}\n </Tooltip>\n </button>\n </Dropdown>\n ) : (\n <button\n id={`btn-floating-bar-${button.label}`}\n onClick={button.onClick}\n disabled={button.disabled}\n className={cn(\n !button?.label\n ? \"bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80\"\n : \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent\",\n button?.hideLabel && \"!p-1.5\",\n isDeleteAction(button) && \"!text-error-700\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center gap-1.5\"\n >\n {button.icon}\n\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit\"}\n appearance=\"custom\"\n >\n {button.label}\n </Typography>\n )}\n </Tooltip>\n </button>\n )}\n </div>\n )\n )}\n {deleteConfig ? (\n <button\n id={`btn-floating-bar-${deleteButtonConfig.label}`}\n onClick={deleteButtonConfig.onClick}\n disabled={deleteButtonConfig.disabled}\n className={cn(\n \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200\",\n deleteButtonConfig.disabled && \"opacity-70\"\n )}\n >\n {deleteButtonConfig.icon}\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-error-700\"\n appearance=\"custom\"\n >\n {deleteButtonConfig.label}\n </Typography>\n </button>\n ) : null}\n </motion.div>\n ) : (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"minw-[150px] p-1.5 flex items-center\"\n >\n <Dropdown\n menu={{\n items: dropDownItems,\n }}\n trigger={[\"click\"]}\n overlayClassName=\"!min-w-[148px]\"\n placement=\"bottomRight\"\n getPopupContainer={(trigger) =>\n trigger.parentElement as HTMLElement\n }\n open={showDropdown}\n onOpenChange={setShowDropdown}\n >\n <button\n id={`btn-floating-bar-actions`}\n disabled={dropDownItems.length === 0}\n className={cn(\n \"flex items-center gap-1.5 px-2 py-1 w-22 h-7 rounded-full bg-[#34405473]/45 dark:bg-black-700 hover:scale-105 hover:opacity-80 transition-all duration-200\",\n dropDownItems.length === 0 &&\n \"opacity-60 hover:scale-100 hover:opacity-60\"\n )}\n type=\"button\"\n >\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-white\"\n >\n {t(\"Actions\")}\n </Typography>\n <DropdownArrowIcon\n fill=\"#FFFFFF\"\n className=\"w-[16px] h-[16px]\"\n />\n </button>\n </Dropdown>\n {deleteConfig ? (\n <button\n id={`btn-floating-bar-${deleteButtonConfig.label}`}\n onClick={deleteButtonConfig.onClick}\n disabled={deleteButtonConfig.disabled}\n className={cn(\n \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200\",\n deleteButtonConfig.disabled && \"opacity-70\"\n )}\n type=\"button\"\n >\n {deleteButtonConfig.icon}\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-error-700\"\n appearance=\"custom\"\n >\n {deleteButtonConfig.label}\n </Typography>\n </button>\n ) : null}\n </motion.div>\n )}\n </div>\n </div>\n </motion.div>\n );\n};\n\nFloatingBar.displayName = \"FloatingBar\";\n\n// Re-export types for convenience\nexport type { ButtonConfig as FloatingBarActionConfig };\nexport type FloatingBarDeleteConfig = TFloatingBar[\"deleteConfig\"];\nexport type FloatingBarProps = TFloatingBar;\n\n// Legacy type exports for backwards compatibility\nexport type FloatingBarSize = \"small\" | \"medium\" | \"large\";\nexport type FloatingBarPosition = \"top\" | \"bottom\";\nexport type FloatingBarTheme = \"primary\" | \"dark\" | \"light\";\n"],"names":["CloseIcon","size","fill","className","jsx","DropdownArrowIcon","FloatingBar","props","show","isFlowDashboard","onClose","actionItems","selectedItemsCount","deleteConfig","showActionBg","t","useTranslation","showDropdown","setShowDropdown","useState","showButtons","setShowButtons","containerRef","useRef","actionContainerRef","useEffect","observer","containerWidth","deleteButtonConfig","DeleteIcon","isDeleteAction","button","label","sortedActionItems","a","b","dropDownItems","index","OptionButton","motion","cn","jsxs","IconButton","Typography","Dropdown","trigger","Tooltip"],"mappings":"yeAcMA,EAAsE,CAAC,CAC3E,KAAAC,EAAO,GACP,KAAAC,EAAO,eACP,UAAAC,CACF,IACEC,EAAAA,IAAC,MAAA,CACC,UAAAD,EACA,MAAOF,EACP,OAAQA,EACR,QAAQ,YACR,KAAAC,EACA,MAAM,6BAEN,SAAAE,EAAAA,IAA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AC,SAAA,CACC,GAAI,2BACJ,SAAUL,EAAc,SAAW,EACnC,UAAWI,EACT,6JACAJ,EAAc,SAAW,GACzB,6CAAA,EAEF,KAAK,SAEL,SAAA,CAAAhC,EAAAA,IAACuC,EAAAA,WAAA,CACC,KAAK,QACL,QAAQ,SACR,UAAU,aAET,WAAE,SAAS,CAAA,CAAA,EAEdvC,EAAAA,IAACC,EAAA,CACC,KAAK,UACL,UAAU,mBAAA,CAAA,CACZ,CAAA,CAAA,CACF,CAAA,EAEDQ,EACC4B,EAAAA,KAAC,SAAA,CACC,GAAI,oBAAoBb,EAAmB,KAAK,GAChD,QAASA,EAAmB,QAC5B,SAAUA,EAAmB,SAC7B,UAAWY,EACT,qIACAZ,EAAmB,UAAY,YAAA,EAEjC,KAAK,SAEJ,SAAA,CAAAA,EAAmB,KACpBxB,EAAAA,IAACuC,EAAAA,WAAA,CACC,KAAK,QACL,QAAQ,SACR,UAAU,iBACV,WAAW,SAEV,SAAAf,EAAmB,KAAA,CAAA,CACtB,CAAA,CAAA,EAEA,IAAA,CAAA,CAAA,CACN,CAAA,CAEJ,CAAA,CAAA,CACF,CAAA,EA1OW,IA6OjB,EAEAtB,EAAY,YAAc"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { Dropdown as
|
|
3
|
-
import
|
|
4
|
-
import { motion as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as a, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { Dropdown as C } from "antd";
|
|
3
|
+
import l from "../../_virtual/index.es.js";
|
|
4
|
+
import { motion as g } from "framer-motion";
|
|
5
|
+
import { useState as k, useRef as N, useEffect as z } from "react";
|
|
6
|
+
import { useTranslation as A } from "react-i18next";
|
|
7
7
|
import { Typography as s } from "../data-display/typography/Typography.es.js";
|
|
8
|
-
import { OptionButton as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { DeleteIcon as
|
|
12
|
-
const
|
|
13
|
-
size:
|
|
8
|
+
import { OptionButton as R } from "../buttons/option-button/OptionButton.es.js";
|
|
9
|
+
import T from "../button/IconButton.es.js";
|
|
10
|
+
import I from "../tooltip/Tooltip.es.js";
|
|
11
|
+
import { DeleteIcon as j } from "../icon/icons.generated.es.js";
|
|
12
|
+
const O = ({
|
|
13
|
+
size: o = 24,
|
|
14
14
|
fill: c = "currentColor",
|
|
15
|
-
className:
|
|
15
|
+
className: m
|
|
16
16
|
}) => /* @__PURE__ */ a(
|
|
17
17
|
"svg",
|
|
18
18
|
{
|
|
19
|
-
className:
|
|
20
|
-
width:
|
|
21
|
-
height:
|
|
19
|
+
className: m,
|
|
20
|
+
width: o,
|
|
21
|
+
height: o,
|
|
22
22
|
viewBox: "0 0 20 20",
|
|
23
23
|
fill: c,
|
|
24
24
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25
25
|
children: /* @__PURE__ */ a("path", { d: "M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z" })
|
|
26
26
|
}
|
|
27
|
-
),
|
|
28
|
-
fill:
|
|
27
|
+
), S = ({
|
|
28
|
+
fill: o = "#cccccc",
|
|
29
29
|
className: c
|
|
30
30
|
}) => /* @__PURE__ */ a(
|
|
31
31
|
"svg",
|
|
@@ -38,41 +38,46 @@ const A = ({
|
|
|
38
38
|
children: /* @__PURE__ */ a(
|
|
39
39
|
"path",
|
|
40
40
|
{
|
|
41
|
-
fill:
|
|
41
|
+
fill: o,
|
|
42
42
|
d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
}
|
|
46
|
-
),
|
|
46
|
+
), W = (o) => {
|
|
47
47
|
const {
|
|
48
48
|
show: c,
|
|
49
|
-
isFlowDashboard:
|
|
50
|
-
onClose:
|
|
51
|
-
actionItems:
|
|
52
|
-
selectedItemsCount:
|
|
49
|
+
isFlowDashboard: m,
|
|
50
|
+
onClose: L,
|
|
51
|
+
actionItems: h,
|
|
52
|
+
selectedItemsCount: B,
|
|
53
53
|
deleteConfig: p,
|
|
54
|
-
showActionBg:
|
|
55
|
-
} =
|
|
56
|
-
|
|
54
|
+
showActionBg: $
|
|
55
|
+
} = o, { t: x } = A(), [f, u] = k(!1), [D, v] = k(!0), n = N(null), y = N(null);
|
|
56
|
+
z(() => {
|
|
57
57
|
const e = new ResizeObserver(() => {
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
|
|
58
|
+
if (n.current && y.current) {
|
|
59
|
+
const i = n.current.scrollWidth - 100;
|
|
60
|
+
h.length * 180 + 100 > i ? v(!1) : v(!0);
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
return
|
|
64
|
-
|
|
63
|
+
return n.current && e.observe(n.current), () => {
|
|
64
|
+
n.current && e.unobserve(n.current);
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
|
-
const
|
|
68
|
-
label:
|
|
69
|
-
icon: /* @__PURE__ */ a(
|
|
67
|
+
const t = {
|
|
68
|
+
label: x("Delete"),
|
|
69
|
+
icon: /* @__PURE__ */ a(j, { className: "text-error-700 w-icon h-icon" }),
|
|
70
70
|
onClick: p?.onClick,
|
|
71
71
|
...p
|
|
72
|
-
},
|
|
73
|
-
|
|
72
|
+
}, d = (e) => {
|
|
73
|
+
const i = e.label?.toLowerCase() ?? "";
|
|
74
|
+
return i.includes("delete") || i === "remove" || i === "move to trash";
|
|
75
|
+
}, F = [...h].sort(
|
|
76
|
+
(e, i) => Number(d(e)) - Number(d(i))
|
|
77
|
+
), b = h.filter((e) => e.visible !== !1).map((e, i) => ({
|
|
78
|
+
key: i,
|
|
74
79
|
label: /* @__PURE__ */ a(
|
|
75
|
-
|
|
80
|
+
R,
|
|
76
81
|
{
|
|
77
82
|
icon: e.dropdownIcon,
|
|
78
83
|
text: e?.label || "",
|
|
@@ -84,7 +89,7 @@ const A = ({
|
|
|
84
89
|
disabled: !1
|
|
85
90
|
}));
|
|
86
91
|
return c ? /* @__PURE__ */ a(
|
|
87
|
-
|
|
92
|
+
g.div,
|
|
88
93
|
{
|
|
89
94
|
initial: { y: 20, opacity: 0 },
|
|
90
95
|
animate: { y: 0, opacity: 1 },
|
|
@@ -94,38 +99,38 @@ const A = ({
|
|
|
94
99
|
ease: [0.4, 0, 0.2, 1],
|
|
95
100
|
opacity: { duration: 0.15 }
|
|
96
101
|
},
|
|
97
|
-
ref:
|
|
98
|
-
className:
|
|
99
|
-
children: /* @__PURE__ */
|
|
102
|
+
ref: n,
|
|
103
|
+
className: l("h-[36px] mb-4", m ? "ml-60 w-1/2" : "w-full"),
|
|
104
|
+
children: /* @__PURE__ */ r(
|
|
100
105
|
"div",
|
|
101
106
|
{
|
|
102
|
-
className:
|
|
107
|
+
className: l(
|
|
103
108
|
"border-y border-neutral-900 dark:border-[#0d1014 px-[12px] text-white bg-neutral-900 dark:bg-black-900 flex justify-between items-center"
|
|
104
109
|
),
|
|
105
110
|
children: [
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-[12px]", children: [
|
|
112
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-[8px]", children: [
|
|
108
113
|
/* @__PURE__ */ a(
|
|
109
|
-
|
|
114
|
+
T,
|
|
110
115
|
{
|
|
111
116
|
tooltip: "Close",
|
|
112
117
|
variant: "ghost",
|
|
113
|
-
onClick:
|
|
118
|
+
onClick: L,
|
|
114
119
|
className: "!p-0 text-white hover:opacity-80 hover:rotate-90 transition-all duration-200",
|
|
115
|
-
children: /* @__PURE__ */ a(
|
|
120
|
+
children: /* @__PURE__ */ a(O, { size: 16 })
|
|
116
121
|
}
|
|
117
122
|
),
|
|
118
123
|
/* @__PURE__ */ a("div", { className: "w-px h-[14px] rounded-[1px] bg-neutral-700 dark:bg-[#1d242c]" })
|
|
119
124
|
] }),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */ a("span", { className: "inline-flex items-center justify-center min-w-[20px] h-[16px] px-[8px] rounded-[9px] border text-[12px] leading-[18px] font-normal text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-[rgba(0,50,95,0.3)] border-primary-200 dark:border-primary-800", children:
|
|
125
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-[6px]", children: [
|
|
126
|
+
/* @__PURE__ */ a("span", { className: "inline-flex items-center justify-center min-w-[20px] h-[16px] px-[8px] rounded-[9px] border text-[12px] leading-[18px] font-normal text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-[rgba(0,50,95,0.3)] border-primary-200 dark:border-primary-800", children: B || 0 }),
|
|
122
127
|
/* @__PURE__ */ a(
|
|
123
128
|
s,
|
|
124
129
|
{
|
|
125
130
|
size: "extra-small",
|
|
126
131
|
appearance: "custom",
|
|
127
132
|
className: "text-white dark:text-neutral-50",
|
|
128
|
-
children:
|
|
133
|
+
children: x("Selected")
|
|
129
134
|
}
|
|
130
135
|
)
|
|
131
136
|
] })
|
|
@@ -134,20 +139,20 @@ const A = ({
|
|
|
134
139
|
"div",
|
|
135
140
|
{
|
|
136
141
|
ref: y,
|
|
137
|
-
className:
|
|
142
|
+
className: l(
|
|
138
143
|
"h-[36px] flex items-center font-inter bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]"
|
|
139
144
|
),
|
|
140
|
-
children:
|
|
141
|
-
|
|
145
|
+
children: D ? /* @__PURE__ */ r(
|
|
146
|
+
g.div,
|
|
142
147
|
{
|
|
143
148
|
initial: { opacity: 0 },
|
|
144
149
|
animate: { opacity: 1 },
|
|
145
150
|
transition: { duration: 0.2 },
|
|
146
151
|
className: "flex items-center h-[36px] bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]",
|
|
147
152
|
children: [
|
|
148
|
-
|
|
149
|
-
(e,
|
|
150
|
-
|
|
153
|
+
F.map(
|
|
154
|
+
(e, i) => e.visible !== !1 && /* @__PURE__ */ a("div", { children: e.type === "dropdown" ? /* @__PURE__ */ a(
|
|
155
|
+
C,
|
|
151
156
|
{
|
|
152
157
|
menu: {
|
|
153
158
|
items: e.dropdownItems
|
|
@@ -155,23 +160,23 @@ const A = ({
|
|
|
155
160
|
trigger: [e.dropdownTrigger || "click"],
|
|
156
161
|
overlayClassName: "!min-w-[148px]",
|
|
157
162
|
placement: "bottomRight",
|
|
158
|
-
getPopupContainer: (
|
|
159
|
-
open:
|
|
160
|
-
onOpenChange:
|
|
163
|
+
getPopupContainer: (w) => w.parentElement,
|
|
164
|
+
open: f,
|
|
165
|
+
onOpenChange: u,
|
|
161
166
|
children: /* @__PURE__ */ a(
|
|
162
167
|
"button",
|
|
163
168
|
{
|
|
164
169
|
id: `btn-floating-bar-${e.label}`,
|
|
165
170
|
onClick: e.onClick,
|
|
166
171
|
disabled: e.disabled,
|
|
167
|
-
className:
|
|
172
|
+
className: l(
|
|
168
173
|
e?.label ? "flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent" : "bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80",
|
|
169
174
|
e?.hideLabel && "!p-1.5",
|
|
170
|
-
(e
|
|
175
|
+
d(e) && "!text-error-700",
|
|
171
176
|
e.disabled && "opacity-70"
|
|
172
177
|
),
|
|
173
|
-
children: /* @__PURE__ */
|
|
174
|
-
|
|
178
|
+
children: /* @__PURE__ */ r(
|
|
179
|
+
I,
|
|
175
180
|
{
|
|
176
181
|
hideTooltip: !e.tooltip,
|
|
177
182
|
title: e.tooltip,
|
|
@@ -192,7 +197,7 @@ const A = ({
|
|
|
192
197
|
}
|
|
193
198
|
)
|
|
194
199
|
},
|
|
195
|
-
|
|
200
|
+
i
|
|
196
201
|
)
|
|
197
202
|
}
|
|
198
203
|
) : /* @__PURE__ */ a(
|
|
@@ -201,14 +206,14 @@ const A = ({
|
|
|
201
206
|
id: `btn-floating-bar-${e.label}`,
|
|
202
207
|
onClick: e.onClick,
|
|
203
208
|
disabled: e.disabled,
|
|
204
|
-
className:
|
|
209
|
+
className: l(
|
|
205
210
|
e?.label ? "flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent" : "bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80",
|
|
206
211
|
e?.hideLabel && "!p-1.5",
|
|
207
|
-
(e
|
|
212
|
+
d(e) && "!text-error-700",
|
|
208
213
|
e.disabled && "opacity-70"
|
|
209
214
|
),
|
|
210
|
-
children: /* @__PURE__ */
|
|
211
|
-
|
|
215
|
+
children: /* @__PURE__ */ r(
|
|
216
|
+
I,
|
|
212
217
|
{
|
|
213
218
|
hideTooltip: !e.tooltip,
|
|
214
219
|
title: e.tooltip,
|
|
@@ -229,20 +234,20 @@ const A = ({
|
|
|
229
234
|
}
|
|
230
235
|
)
|
|
231
236
|
}
|
|
232
|
-
) },
|
|
237
|
+
) }, i)
|
|
233
238
|
),
|
|
234
|
-
p ? /* @__PURE__ */
|
|
239
|
+
p ? /* @__PURE__ */ r(
|
|
235
240
|
"button",
|
|
236
241
|
{
|
|
237
|
-
id: `btn-floating-bar-${
|
|
238
|
-
onClick:
|
|
239
|
-
disabled:
|
|
240
|
-
className:
|
|
242
|
+
id: `btn-floating-bar-${t.label}`,
|
|
243
|
+
onClick: t.onClick,
|
|
244
|
+
disabled: t.disabled,
|
|
245
|
+
className: l(
|
|
241
246
|
"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200",
|
|
242
|
-
|
|
247
|
+
t.disabled && "opacity-70"
|
|
243
248
|
),
|
|
244
249
|
children: [
|
|
245
|
-
|
|
250
|
+
t.icon,
|
|
246
251
|
/* @__PURE__ */ a(
|
|
247
252
|
s,
|
|
248
253
|
{
|
|
@@ -250,7 +255,7 @@ const A = ({
|
|
|
250
255
|
variant: "medium",
|
|
251
256
|
className: "text-error-700",
|
|
252
257
|
appearance: "custom",
|
|
253
|
-
children:
|
|
258
|
+
children: t.label
|
|
254
259
|
}
|
|
255
260
|
)
|
|
256
261
|
]
|
|
@@ -258,8 +263,8 @@ const A = ({
|
|
|
258
263
|
) : null
|
|
259
264
|
]
|
|
260
265
|
}
|
|
261
|
-
) : /* @__PURE__ */
|
|
262
|
-
|
|
266
|
+
) : /* @__PURE__ */ r(
|
|
267
|
+
g.div,
|
|
263
268
|
{
|
|
264
269
|
initial: { opacity: 0 },
|
|
265
270
|
animate: { opacity: 1 },
|
|
@@ -267,25 +272,25 @@ const A = ({
|
|
|
267
272
|
className: "minw-[150px] p-1.5 flex items-center",
|
|
268
273
|
children: [
|
|
269
274
|
/* @__PURE__ */ a(
|
|
270
|
-
|
|
275
|
+
C,
|
|
271
276
|
{
|
|
272
277
|
menu: {
|
|
273
|
-
items:
|
|
278
|
+
items: b
|
|
274
279
|
},
|
|
275
280
|
trigger: ["click"],
|
|
276
281
|
overlayClassName: "!min-w-[148px]",
|
|
277
282
|
placement: "bottomRight",
|
|
278
283
|
getPopupContainer: (e) => e.parentElement,
|
|
279
|
-
open:
|
|
280
|
-
onOpenChange:
|
|
281
|
-
children: /* @__PURE__ */
|
|
284
|
+
open: f,
|
|
285
|
+
onOpenChange: u,
|
|
286
|
+
children: /* @__PURE__ */ r(
|
|
282
287
|
"button",
|
|
283
288
|
{
|
|
284
289
|
id: "btn-floating-bar-actions",
|
|
285
|
-
disabled:
|
|
286
|
-
className:
|
|
290
|
+
disabled: b.length === 0,
|
|
291
|
+
className: l(
|
|
287
292
|
"flex items-center gap-1.5 px-2 py-1 w-22 h-7 rounded-full bg-[#34405473]/45 dark:bg-black-700 hover:scale-105 hover:opacity-80 transition-all duration-200",
|
|
288
|
-
|
|
293
|
+
b.length === 0 && "opacity-60 hover:scale-100 hover:opacity-60"
|
|
289
294
|
),
|
|
290
295
|
type: "button",
|
|
291
296
|
children: [
|
|
@@ -295,11 +300,11 @@ const A = ({
|
|
|
295
300
|
size: "small",
|
|
296
301
|
variant: "medium",
|
|
297
302
|
className: "text-white",
|
|
298
|
-
children:
|
|
303
|
+
children: x("Actions")
|
|
299
304
|
}
|
|
300
305
|
),
|
|
301
306
|
/* @__PURE__ */ a(
|
|
302
|
-
|
|
307
|
+
S,
|
|
303
308
|
{
|
|
304
309
|
fill: "#FFFFFF",
|
|
305
310
|
className: "w-[16px] h-[16px]"
|
|
@@ -310,19 +315,19 @@ const A = ({
|
|
|
310
315
|
)
|
|
311
316
|
}
|
|
312
317
|
),
|
|
313
|
-
p ? /* @__PURE__ */
|
|
318
|
+
p ? /* @__PURE__ */ r(
|
|
314
319
|
"button",
|
|
315
320
|
{
|
|
316
|
-
id: `btn-floating-bar-${
|
|
317
|
-
onClick:
|
|
318
|
-
disabled:
|
|
319
|
-
className:
|
|
321
|
+
id: `btn-floating-bar-${t.label}`,
|
|
322
|
+
onClick: t.onClick,
|
|
323
|
+
disabled: t.disabled,
|
|
324
|
+
className: l(
|
|
320
325
|
"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200",
|
|
321
|
-
|
|
326
|
+
t.disabled && "opacity-70"
|
|
322
327
|
),
|
|
323
328
|
type: "button",
|
|
324
329
|
children: [
|
|
325
|
-
|
|
330
|
+
t.icon,
|
|
326
331
|
/* @__PURE__ */ a(
|
|
327
332
|
s,
|
|
328
333
|
{
|
|
@@ -330,7 +335,7 @@ const A = ({
|
|
|
330
335
|
variant: "medium",
|
|
331
336
|
className: "text-error-700",
|
|
332
337
|
appearance: "custom",
|
|
333
|
-
children:
|
|
338
|
+
children: t.label
|
|
334
339
|
}
|
|
335
340
|
)
|
|
336
341
|
]
|
|
@@ -347,8 +352,8 @@ const A = ({
|
|
|
347
352
|
}
|
|
348
353
|
) : null;
|
|
349
354
|
};
|
|
350
|
-
|
|
355
|
+
W.displayName = "FloatingBar";
|
|
351
356
|
export {
|
|
352
|
-
|
|
357
|
+
W as FloatingBar
|
|
353
358
|
};
|
|
354
359
|
//# sourceMappingURL=FloatingBar.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingBar.es.js","sources":["../../../src/components/floating-bar/FloatingBar.tsx"],"sourcesContent":["import { Dropdown } from \"antd\";\nimport cn from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport { useEffect, useRef, useState, type FC, type ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Typography } from \"../data-display/typography/Typography\";\nimport { OptionButton } from \"../buttons/option-button/OptionButton\";\nimport IconButton from \"../button/IconButton\";\nimport Tooltip from \"../tooltip/Tooltip\";\nimport { DeleteIcon } from \"../icon\";\n\n/**\n * Close icon component\n */\nconst CloseIcon: FC<{ size?: number; fill?: string; className?: string }> = ({\n size = 24,\n fill = \"currentColor\",\n className,\n}) => (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 20 20\"\n fill={fill}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z\" />\n </svg>\n);\n\n/**\n * Dropdown arrow icon component\n */\nconst DropdownArrowIcon: FC<{ fill?: string; className?: string }> = ({\n fill = \"#cccccc\",\n className,\n}) => (\n <svg\n height=\"20\"\n width=\"20\"\n viewBox=\"0 0 20 20\"\n focusable=\"false\"\n className={className}\n >\n <path\n fill={fill}\n d=\"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\"\n />\n </svg>\n);\n\n/**\n * Configuration for action buttons in the floating bar\n */\nexport type ButtonConfig = {\n /** Button label text */\n label?: string;\n /** Icon element to display */\n icon: ReactNode;\n /** Click handler for the action */\n onClick?: () => void;\n /** Icon for dropdown mode */\n dropdownIcon?: ReactNode;\n /** Whether the action is visible */\n visible?: boolean;\n /** Whether the action is disabled */\n disabled?: boolean;\n /** Tooltip text */\n tooltip?: string;\n /** Whether to hide the label text */\n hideLabel?: boolean;\n /** Action type */\n type?: \"button\" | \"dropdown\";\n /** Dropdown trigger mode */\n dropdownTrigger?: \"click\" | \"hover\";\n /** Dropdown menu items */\n dropdownItems?: Array<{\n label: ReactNode;\n key: string;\n disabled?: boolean;\n }>;\n};\n\n/**\n * Props for the FloatingBar component\n */\nexport type TFloatingBar = {\n /** Whether the floating bar is visible */\n show?: boolean;\n /** Close handler */\n onClose: () => void;\n /** Whether this is used in flow dashboard layout */\n isFlowDashboard?: boolean;\n /** Array of action configurations */\n actionItems: ButtonConfig[];\n /** Number of selected items */\n selectedItemsCount?: number;\n /** Delete action configuration */\n deleteConfig?: {\n label?: string;\n disabled?: boolean;\n onClick?: () => void;\n };\n /** Whether to show action background */\n showActionBg?: boolean;\n};\n\n/**\n * FloatingBar component provides a floating action bar for bulk operations.\n * Drop-in replacement matching the lax-web-portal implementation.\n *\n * @example\n * ```tsx\n * <FloatingBar\n * show={selectedItems.length > 0}\n * onClose={() => setSelectedItems([])}\n * selectedItemsCount={selectedItems.length}\n * actionItems={[\n * {\n * label: \"Edit\",\n * icon: <EditIcon size={16} />,\n * onClick: handleEdit,\n * },\n * {\n * label: \"Archive\",\n * icon: <ArchiveIcon size={16} />,\n * onClick: handleArchive,\n * },\n * ]}\n * deleteConfig={{\n * label: \"Delete\",\n * onClick: handleDelete,\n * }}\n * />\n * ```\n */\nexport const FloatingBar: FC<TFloatingBar> = (props) => {\n const {\n show,\n isFlowDashboard,\n onClose,\n actionItems,\n selectedItemsCount,\n deleteConfig,\n showActionBg,\n } = props;\n\n const { t } = useTranslation();\n const [showDropdown, setShowDropdown] = useState<boolean>(false);\n const [showButtons, setShowButtons] = useState<boolean>(true);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const actionContainerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const observer = new ResizeObserver(() => {\n if (containerRef.current && actionContainerRef.current) {\n const containerWidth = containerRef.current.scrollWidth - 100;\n const totalActionItemsWidth = actionItems.length * 180 + 100;\n if (totalActionItemsWidth > containerWidth) {\n setShowButtons(false);\n } else {\n setShowButtons(true);\n }\n }\n });\n\n if (containerRef.current) {\n observer.observe(containerRef.current);\n }\n\n return () => {\n if (containerRef.current) {\n observer.unobserve(containerRef.current);\n }\n };\n });\n\n const deleteButtonConfig = {\n label: t(\"Delete\"),\n icon: <DeleteIcon className=\"text-error-700 w-icon h-icon\" />,\n color: \"text-error-700 dark:text-error-700\",\n onClick: deleteConfig?.onClick,\n ...deleteConfig,\n };\n\n const dropDownItems = actionItems\n .filter((button) => button.visible !== false)\n .map((button, index) => ({\n key: index,\n label: (\n <OptionButton\n icon={button.dropdownIcon}\n text={button?.label || \"\"}\n onClick={button.onClick}\n className=\"font-inter text-base font-medium text-black-900 dark:text-black-200 gap-1.5\"\n />\n ),\n children: button.dropdownItems,\n disabled: false,\n }));\n\n return !show ? null : (\n <motion.div\n initial={{ y: 20, opacity: 0 }}\n animate={{ y: 0, opacity: 1 }}\n exit={{ y: 20, opacity: 0 }}\n transition={{\n duration: 0.2,\n ease: [0.4, 0, 0.2, 1],\n opacity: { duration: 0.15 },\n }}\n ref={containerRef}\n className={cn(\"h-[36px] mb-4\", isFlowDashboard ? \"ml-60 w-1/2\" : \"w-full\")}\n >\n <div\n className={cn(\n \"border-y border-neutral-900 dark:border-[#0d1014 px-[12px] text-white bg-neutral-900 dark:bg-black-900 flex justify-between items-center\"\n )}\n >\n <div className=\"flex items-center gap-[12px]\">\n <div className=\"flex items-center gap-[8px]\">\n <IconButton\n tooltip=\"Close\"\n variant=\"ghost\"\n onClick={onClose}\n className=\"!p-0 text-white hover:opacity-80 hover:rotate-90 transition-all duration-200\"\n >\n <CloseIcon size={16} />\n </IconButton>\n <div className=\"w-px h-[14px] rounded-[1px] bg-neutral-700 dark:bg-[#1d242c]\" />\n </div>\n <div className=\"flex items-center gap-[6px]\">\n <span className=\"inline-flex items-center justify-center min-w-[20px] h-[16px] px-[8px] rounded-[9px] border text-[12px] leading-[18px] font-normal text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-[rgba(0,50,95,0.3)] border-primary-200 dark:border-primary-800\">\n {selectedItemsCount || 0}\n </span>\n <Typography\n size=\"extra-small\"\n appearance=\"custom\"\n className=\"text-white dark:text-neutral-50\"\n >\n {t(\"Selected\")}\n </Typography>\n </div>\n </div>\n <div\n ref={actionContainerRef}\n className={cn(\n \"h-[36px] flex items-center font-inter bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]\"\n )}\n >\n {showButtons ? (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"flex items-center h-[36px] bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]\"\n >\n {actionItems.map(\n (button, index) =>\n button.visible !== false && (\n <div key={index}>\n {button.type === \"dropdown\" ? (\n <Dropdown\n menu={{\n items: button.dropdownItems,\n }}\n trigger={[button.dropdownTrigger || \"click\"]}\n overlayClassName=\"!min-w-[148px]\"\n placement=\"bottomRight\"\n getPopupContainer={(trigger) =>\n trigger.parentElement as HTMLElement\n }\n open={showDropdown}\n onOpenChange={setShowDropdown}\n >\n <button\n key={index}\n id={`btn-floating-bar-${button.label}`}\n onClick={button.onClick}\n disabled={button.disabled}\n className={cn(\n !button?.label\n ? \"bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80\"\n : \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent\",\n button?.hideLabel && \"!p-1.5\",\n (button.label === \"Delete\" ||\n button.label === \"Remove\" ||\n button.label === \"Delete user\" ||\n button.label === \"Move to trash\" ||\n button.label === \"Delete Permanently\") &&\n \"!text-error-700\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center gap-1.5\"\n >\n {button.icon}\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit\"}\n appearance=\"custom\"\n >\n {button.label}\n </Typography>\n )}\n </Tooltip>\n </button>\n </Dropdown>\n ) : (\n <button\n id={`btn-floating-bar-${button.label}`}\n onClick={button.onClick}\n disabled={button.disabled}\n className={cn(\n !button?.label\n ? \"bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80\"\n : \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent\",\n button?.hideLabel && \"!p-1.5\",\n (button.label === \"Delete\" ||\n button.label === \"Remove\" ||\n button.label === \"Move to trash\" ||\n button.label === \"Delete Permanently\" ||\n button.label?.toLowerCase()?.includes('delete')) &&\n \"!text-error-700\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center gap-1.5\"\n >\n {button.icon}\n\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit\"}\n appearance=\"custom\"\n >\n {button.label}\n </Typography>\n )}\n </Tooltip>\n </button>\n )}\n </div>\n )\n )}\n {deleteConfig ? (\n <button\n id={`btn-floating-bar-${deleteButtonConfig.label}`}\n onClick={deleteButtonConfig.onClick}\n disabled={deleteButtonConfig.disabled}\n className={cn(\n \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200\",\n deleteButtonConfig.disabled && \"opacity-70\"\n )}\n >\n {deleteButtonConfig.icon}\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-error-700\"\n appearance=\"custom\"\n >\n {deleteButtonConfig.label}\n </Typography>\n </button>\n ) : null}\n </motion.div>\n ) : (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"minw-[150px] p-1.5 flex items-center\"\n >\n <Dropdown\n menu={{\n items: dropDownItems,\n }}\n trigger={[\"click\"]}\n overlayClassName=\"!min-w-[148px]\"\n placement=\"bottomRight\"\n getPopupContainer={(trigger) =>\n trigger.parentElement as HTMLElement\n }\n open={showDropdown}\n onOpenChange={setShowDropdown}\n >\n <button\n id={`btn-floating-bar-actions`}\n disabled={dropDownItems.length === 0}\n className={cn(\n \"flex items-center gap-1.5 px-2 py-1 w-22 h-7 rounded-full bg-[#34405473]/45 dark:bg-black-700 hover:scale-105 hover:opacity-80 transition-all duration-200\",\n dropDownItems.length === 0 &&\n \"opacity-60 hover:scale-100 hover:opacity-60\"\n )}\n type=\"button\"\n >\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-white\"\n >\n {t(\"Actions\")}\n </Typography>\n <DropdownArrowIcon\n fill=\"#FFFFFF\"\n className=\"w-[16px] h-[16px]\"\n />\n </button>\n </Dropdown>\n {deleteConfig ? (\n <button\n id={`btn-floating-bar-${deleteButtonConfig.label}`}\n onClick={deleteButtonConfig.onClick}\n disabled={deleteButtonConfig.disabled}\n className={cn(\n \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200\",\n deleteButtonConfig.disabled && \"opacity-70\"\n )}\n type=\"button\"\n >\n {deleteButtonConfig.icon}\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-error-700\"\n appearance=\"custom\"\n >\n {deleteButtonConfig.label}\n </Typography>\n </button>\n ) : null}\n </motion.div>\n )}\n </div>\n </div>\n </motion.div>\n );\n};\n\nFloatingBar.displayName = \"FloatingBar\";\n\n// Re-export types for convenience\nexport type { ButtonConfig as FloatingBarActionConfig };\nexport type FloatingBarDeleteConfig = TFloatingBar[\"deleteConfig\"];\nexport type FloatingBarProps = TFloatingBar;\n\n// Legacy type exports for backwards compatibility\nexport type FloatingBarSize = \"small\" | \"medium\" | \"large\";\nexport type FloatingBarPosition = \"top\" | \"bottom\";\nexport type FloatingBarTheme = \"primary\" | \"dark\" | \"light\";\n"],"names":["CloseIcon","size","fill","className","jsx","DropdownArrowIcon","FloatingBar","props","show","isFlowDashboard","onClose","actionItems","selectedItemsCount","deleteConfig","showActionBg","t","useTranslation","showDropdown","setShowDropdown","useState","showButtons","setShowButtons","containerRef","useRef","actionContainerRef","useEffect","observer","containerWidth","deleteButtonConfig","DeleteIcon","dropDownItems","button","index","OptionButton","motion","cn","jsxs","IconButton","Typography","Dropdown","trigger","Tooltip"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAAsE,CAAC;AAAA,EAC3E,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,WAAAC;AACF,MACE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAAD;AAAA,IACA,OAAOF;AAAA,IACP,QAAQA;AAAA,IACR,SAAQ;AAAA,IACR,MAAAC;AAAA,IACA,OAAM;AAAA,IAEN,UAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,i4BAAA,CAAi4B;AAAA,EAAA;AAC34B,GAMIC,IAA+D,CAAC;AAAA,EACpE,MAAAH,IAAO;AAAA,EACP,WAAAC;AACF,MACE,gBAAAC;AAAA,EA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AA,IACF;AAAA,EAAA,IApPW;AAuPjB;AAEAtB,EAAY,cAAc;"}
|
|
1
|
+
{"version":3,"file":"FloatingBar.es.js","sources":["../../../src/components/floating-bar/FloatingBar.tsx"],"sourcesContent":["import { Dropdown } from \"antd\";\nimport cn from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport { useEffect, useRef, useState, type FC, type ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Typography } from \"../data-display/typography/Typography\";\nimport { OptionButton } from \"../buttons/option-button/OptionButton\";\nimport IconButton from \"../button/IconButton\";\nimport Tooltip from \"../tooltip/Tooltip\";\nimport { DeleteIcon } from \"../icon\";\n\n/**\n * Close icon component\n */\nconst CloseIcon: FC<{ size?: number; fill?: string; className?: string }> = ({\n size = 24,\n fill = \"currentColor\",\n className,\n}) => (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 20 20\"\n fill={fill}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z\" />\n </svg>\n);\n\n/**\n * Dropdown arrow icon component\n */\nconst DropdownArrowIcon: FC<{ fill?: string; className?: string }> = ({\n fill = \"#cccccc\",\n className,\n}) => (\n <svg\n height=\"20\"\n width=\"20\"\n viewBox=\"0 0 20 20\"\n focusable=\"false\"\n className={className}\n >\n <path\n fill={fill}\n d=\"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\"\n />\n </svg>\n);\n\n/**\n * Configuration for action buttons in the floating bar\n */\nexport type ButtonConfig = {\n /** Button label text */\n label?: string;\n /** Icon element to display */\n icon: ReactNode;\n /** Click handler for the action */\n onClick?: () => void;\n /** Icon for dropdown mode */\n dropdownIcon?: ReactNode;\n /** Whether the action is visible */\n visible?: boolean;\n /** Whether the action is disabled */\n disabled?: boolean;\n /** Tooltip text */\n tooltip?: string;\n /** Whether to hide the label text */\n hideLabel?: boolean;\n /** Action type */\n type?: \"button\" | \"dropdown\";\n /** Dropdown trigger mode */\n dropdownTrigger?: \"click\" | \"hover\";\n /** Dropdown menu items */\n dropdownItems?: Array<{\n label: ReactNode;\n key: string;\n disabled?: boolean;\n }>;\n};\n\n/**\n * Props for the FloatingBar component\n */\nexport type TFloatingBar = {\n /** Whether the floating bar is visible */\n show?: boolean;\n /** Close handler */\n onClose: () => void;\n /** Whether this is used in flow dashboard layout */\n isFlowDashboard?: boolean;\n /** Array of action configurations */\n actionItems: ButtonConfig[];\n /** Number of selected items */\n selectedItemsCount?: number;\n /** Delete action configuration */\n deleteConfig?: {\n label?: string;\n disabled?: boolean;\n onClick?: () => void;\n };\n /** Whether to show action background */\n showActionBg?: boolean;\n};\n\n/**\n * FloatingBar component provides a floating action bar for bulk operations.\n * Drop-in replacement matching the lax-web-portal implementation.\n *\n * @example\n * ```tsx\n * <FloatingBar\n * show={selectedItems.length > 0}\n * onClose={() => setSelectedItems([])}\n * selectedItemsCount={selectedItems.length}\n * actionItems={[\n * {\n * label: \"Edit\",\n * icon: <EditIcon size={16} />,\n * onClick: handleEdit,\n * },\n * {\n * label: \"Archive\",\n * icon: <ArchiveIcon size={16} />,\n * onClick: handleArchive,\n * },\n * ]}\n * deleteConfig={{\n * label: \"Delete\",\n * onClick: handleDelete,\n * }}\n * />\n * ```\n */\nexport const FloatingBar: FC<TFloatingBar> = (props) => {\n const {\n show,\n isFlowDashboard,\n onClose,\n actionItems,\n selectedItemsCount,\n deleteConfig,\n showActionBg,\n } = props;\n\n const { t } = useTranslation();\n const [showDropdown, setShowDropdown] = useState<boolean>(false);\n const [showButtons, setShowButtons] = useState<boolean>(true);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const actionContainerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const observer = new ResizeObserver(() => {\n if (containerRef.current && actionContainerRef.current) {\n const containerWidth = containerRef.current.scrollWidth - 100;\n const totalActionItemsWidth = actionItems.length * 180 + 100;\n if (totalActionItemsWidth > containerWidth) {\n setShowButtons(false);\n } else {\n setShowButtons(true);\n }\n }\n });\n\n if (containerRef.current) {\n observer.observe(containerRef.current);\n }\n\n return () => {\n if (containerRef.current) {\n observer.unobserve(containerRef.current);\n }\n };\n });\n\n const deleteButtonConfig = {\n label: t(\"Delete\"),\n icon: <DeleteIcon className=\"text-error-700 w-icon h-icon\" />,\n color: \"text-error-700 dark:text-error-700\",\n onClick: deleteConfig?.onClick,\n ...deleteConfig,\n };\n\n /** Whether a button represents a destructive/delete action */\n const isDeleteAction = (button: ButtonConfig) => {\n const label = button.label?.toLowerCase() ?? \"\";\n return (\n label.includes(\"delete\") ||\n label === \"remove\" ||\n label === \"move to trash\"\n );\n };\n\n /** Delete actions are always displayed last (on the right) */\n const sortedActionItems = [...actionItems].sort(\n (a, b) => Number(isDeleteAction(a)) - Number(isDeleteAction(b))\n );\n\n const dropDownItems = actionItems\n .filter((button) => button.visible !== false)\n .map((button, index) => ({\n key: index,\n label: (\n <OptionButton\n icon={button.dropdownIcon}\n text={button?.label || \"\"}\n onClick={button.onClick}\n className=\"font-inter text-base font-medium text-black-900 dark:text-black-200 gap-1.5\"\n />\n ),\n children: button.dropdownItems,\n disabled: false,\n }));\n\n return !show ? null : (\n <motion.div\n initial={{ y: 20, opacity: 0 }}\n animate={{ y: 0, opacity: 1 }}\n exit={{ y: 20, opacity: 0 }}\n transition={{\n duration: 0.2,\n ease: [0.4, 0, 0.2, 1],\n opacity: { duration: 0.15 },\n }}\n ref={containerRef}\n className={cn(\"h-[36px] mb-4\", isFlowDashboard ? \"ml-60 w-1/2\" : \"w-full\")}\n >\n <div\n className={cn(\n \"border-y border-neutral-900 dark:border-[#0d1014 px-[12px] text-white bg-neutral-900 dark:bg-black-900 flex justify-between items-center\"\n )}\n >\n <div className=\"flex items-center gap-[12px]\">\n <div className=\"flex items-center gap-[8px]\">\n <IconButton\n tooltip=\"Close\"\n variant=\"ghost\"\n onClick={onClose}\n className=\"!p-0 text-white hover:opacity-80 hover:rotate-90 transition-all duration-200\"\n >\n <CloseIcon size={16} />\n </IconButton>\n <div className=\"w-px h-[14px] rounded-[1px] bg-neutral-700 dark:bg-[#1d242c]\" />\n </div>\n <div className=\"flex items-center gap-[6px]\">\n <span className=\"inline-flex items-center justify-center min-w-[20px] h-[16px] px-[8px] rounded-[9px] border text-[12px] leading-[18px] font-normal text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-[rgba(0,50,95,0.3)] border-primary-200 dark:border-primary-800\">\n {selectedItemsCount || 0}\n </span>\n <Typography\n size=\"extra-small\"\n appearance=\"custom\"\n className=\"text-white dark:text-neutral-50\"\n >\n {t(\"Selected\")}\n </Typography>\n </div>\n </div>\n <div\n ref={actionContainerRef}\n className={cn(\n \"h-[36px] flex items-center font-inter bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]\"\n )}\n >\n {showButtons ? (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"flex items-center h-[36px] bg-neutral-800 dark:bg-black-800 px-[10px] rounded-[43px]\"\n >\n {sortedActionItems.map(\n (button, index) =>\n button.visible !== false && (\n <div key={index}>\n {button.type === \"dropdown\" ? (\n <Dropdown\n menu={{\n items: button.dropdownItems,\n }}\n trigger={[button.dropdownTrigger || \"click\"]}\n overlayClassName=\"!min-w-[148px]\"\n placement=\"bottomRight\"\n getPopupContainer={(trigger) =>\n trigger.parentElement as HTMLElement\n }\n open={showDropdown}\n onOpenChange={setShowDropdown}\n >\n <button\n key={index}\n id={`btn-floating-bar-${button.label}`}\n onClick={button.onClick}\n disabled={button.disabled}\n className={cn(\n !button?.label\n ? \"bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80\"\n : \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent\",\n button?.hideLabel && \"!p-1.5\",\n isDeleteAction(button) && \"!text-error-700\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center gap-1.5\"\n >\n {button.icon}\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit\"}\n appearance=\"custom\"\n >\n {button.label}\n </Typography>\n )}\n </Tooltip>\n </button>\n </Dropdown>\n ) : (\n <button\n id={`btn-floating-bar-${button.label}`}\n onClick={button.onClick}\n disabled={button.disabled}\n className={cn(\n !button?.label\n ? \"bg-transparent p-1.5 rounded-xl transition-all duration-200 hover:scale-105 hover:opacity-80\"\n : \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] text-white dark:text-neutral-50 hover:opacity-80 hover:scale-105 transition-all duration-200 bg-transparent\",\n button?.hideLabel && \"!p-1.5\",\n isDeleteAction(button) && \"!text-error-700\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center gap-1.5\"\n >\n {button.icon}\n\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit\"}\n appearance=\"custom\"\n >\n {button.label}\n </Typography>\n )}\n </Tooltip>\n </button>\n )}\n </div>\n )\n )}\n {deleteConfig ? (\n <button\n id={`btn-floating-bar-${deleteButtonConfig.label}`}\n onClick={deleteButtonConfig.onClick}\n disabled={deleteButtonConfig.disabled}\n className={cn(\n \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200\",\n deleteButtonConfig.disabled && \"opacity-70\"\n )}\n >\n {deleteButtonConfig.icon}\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-error-700\"\n appearance=\"custom\"\n >\n {deleteButtonConfig.label}\n </Typography>\n </button>\n ) : null}\n </motion.div>\n ) : (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"minw-[150px] p-1.5 flex items-center\"\n >\n <Dropdown\n menu={{\n items: dropDownItems,\n }}\n trigger={[\"click\"]}\n overlayClassName=\"!min-w-[148px]\"\n placement=\"bottomRight\"\n getPopupContainer={(trigger) =>\n trigger.parentElement as HTMLElement\n }\n open={showDropdown}\n onOpenChange={setShowDropdown}\n >\n <button\n id={`btn-floating-bar-actions`}\n disabled={dropDownItems.length === 0}\n className={cn(\n \"flex items-center gap-1.5 px-2 py-1 w-22 h-7 rounded-full bg-[#34405473]/45 dark:bg-black-700 hover:scale-105 hover:opacity-80 transition-all duration-200\",\n dropDownItems.length === 0 &&\n \"opacity-60 hover:scale-100 hover:opacity-60\"\n )}\n type=\"button\"\n >\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-white\"\n >\n {t(\"Actions\")}\n </Typography>\n <DropdownArrowIcon\n fill=\"#FFFFFF\"\n className=\"w-[16px] h-[16px]\"\n />\n </button>\n </Dropdown>\n {deleteConfig ? (\n <button\n id={`btn-floating-bar-${deleteButtonConfig.label}`}\n onClick={deleteButtonConfig.onClick}\n disabled={deleteButtonConfig.disabled}\n className={cn(\n \"flex items-center gap-[6px] pl-[8px] pr-[12px] py-[4px] rounded-[6px] hover:scale-105 hover:opacity-80 transition-all duration-200\",\n deleteButtonConfig.disabled && \"opacity-70\"\n )}\n type=\"button\"\n >\n {deleteButtonConfig.icon}\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"text-error-700\"\n appearance=\"custom\"\n >\n {deleteButtonConfig.label}\n </Typography>\n </button>\n ) : null}\n </motion.div>\n )}\n </div>\n </div>\n </motion.div>\n );\n};\n\nFloatingBar.displayName = \"FloatingBar\";\n\n// Re-export types for convenience\nexport type { ButtonConfig as FloatingBarActionConfig };\nexport type FloatingBarDeleteConfig = TFloatingBar[\"deleteConfig\"];\nexport type FloatingBarProps = TFloatingBar;\n\n// Legacy type exports for backwards compatibility\nexport type FloatingBarSize = \"small\" | \"medium\" | \"large\";\nexport type FloatingBarPosition = \"top\" | \"bottom\";\nexport type FloatingBarTheme = \"primary\" | \"dark\" | \"light\";\n"],"names":["CloseIcon","size","fill","className","jsx","DropdownArrowIcon","FloatingBar","props","show","isFlowDashboard","onClose","actionItems","selectedItemsCount","deleteConfig","showActionBg","t","useTranslation","showDropdown","setShowDropdown","useState","showButtons","setShowButtons","containerRef","useRef","actionContainerRef","useEffect","observer","containerWidth","deleteButtonConfig","DeleteIcon","isDeleteAction","button","label","sortedActionItems","a","b","dropDownItems","index","OptionButton","motion","cn","jsxs","IconButton","Typography","Dropdown","trigger","Tooltip"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAA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