@lax-wp/design-system 0.13.41 → 0.13.43

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.
Files changed (45) hide show
  1. package/dist/components/data-display/code-editor/CodeEditor.cjs.js +1 -1
  2. package/dist/components/data-display/code-editor/CodeEditor.cjs.js.map +1 -1
  3. package/dist/components/data-display/code-editor/CodeEditor.es.js +38 -38
  4. package/dist/components/data-display/code-editor/CodeEditor.es.js.map +1 -1
  5. package/dist/components/data-display/infinite-table/context.cjs.js +1 -1
  6. package/dist/components/data-display/infinite-table/context.cjs.js.map +1 -1
  7. package/dist/components/data-display/infinite-table/context.d.ts +1 -0
  8. package/dist/components/data-display/infinite-table/context.es.js +1 -0
  9. package/dist/components/data-display/infinite-table/context.es.js.map +1 -1
  10. package/dist/components/data-display/infinite-table/head/cell/Options.cjs.js +1 -1
  11. package/dist/components/data-display/infinite-table/head/cell/Options.cjs.js.map +1 -1
  12. package/dist/components/data-display/infinite-table/head/cell/Options.d.ts +2 -1
  13. package/dist/components/data-display/infinite-table/head/cell/Options.es.js +79 -70
  14. package/dist/components/data-display/infinite-table/head/cell/Options.es.js.map +1 -1
  15. package/dist/components/data-display/infinite-table/head/cell/Resizer.cjs.js +1 -1
  16. package/dist/components/data-display/infinite-table/head/cell/Resizer.cjs.js.map +1 -1
  17. package/dist/components/data-display/infinite-table/head/cell/Resizer.d.ts +2 -1
  18. package/dist/components/data-display/infinite-table/head/cell/Resizer.es.js +23 -19
  19. package/dist/components/data-display/infinite-table/head/cell/Resizer.es.js.map +1 -1
  20. package/dist/components/data-display/infinite-table/head/cell/index.cjs.js +1 -1
  21. package/dist/components/data-display/infinite-table/head/cell/index.cjs.js.map +1 -1
  22. package/dist/components/data-display/infinite-table/head/cell/index.es.js +46 -44
  23. package/dist/components/data-display/infinite-table/head/cell/index.es.js.map +1 -1
  24. package/dist/components/data-display/infinite-table/index.cjs.js +1 -1
  25. package/dist/components/data-display/infinite-table/index.cjs.js.map +1 -1
  26. package/dist/components/data-display/infinite-table/index.es.js +474 -470
  27. package/dist/components/data-display/infinite-table/index.es.js.map +1 -1
  28. package/dist/components/data-display/tag/Tag.cjs.js +1 -1
  29. package/dist/components/data-display/tag/Tag.cjs.js.map +1 -1
  30. package/dist/components/data-display/tag/Tag.es.js +9 -9
  31. package/dist/components/data-display/tag/Tag.es.js.map +1 -1
  32. package/dist/components/floating-bar/FloatingBar.cjs.js +1 -1
  33. package/dist/components/floating-bar/FloatingBar.cjs.js.map +1 -1
  34. package/dist/components/floating-bar/FloatingBar.es.js +1 -1
  35. package/dist/components/floating-bar/FloatingBar.es.js.map +1 -1
  36. package/dist/components/forms/search-bar/SearchBar.cjs.js +1 -1
  37. package/dist/components/forms/search-bar/SearchBar.cjs.js.map +1 -1
  38. package/dist/components/forms/search-bar/SearchBar.es.js +1 -1
  39. package/dist/components/forms/search-bar/SearchBar.es.js.map +1 -1
  40. package/dist/utils/table.cjs.js +1 -1
  41. package/dist/utils/table.cjs.js.map +1 -1
  42. package/dist/utils/table.d.ts +2 -1
  43. package/dist/utils/table.es.js +19 -18
  44. package/dist/utils/table.es.js.map +1 -1
  45. package/package.json +1 -1
@@ -56,7 +56,7 @@ const k = {
56
56
  "aria-label": b,
57
57
  role: p
58
58
  }, x) => {
59
- const d = typeof l == "string" && ($ || C.test(l)) ? P(l) : void 0, H = !!d, c = {
59
+ const d = typeof l == "string" && ($ || C.test(l)) ? P(l) : void 0, H = !!d, y = {
60
60
  maxWidth: "100%",
61
61
  ...d ? {
62
62
  backgroundColor: `${d}26`,
@@ -66,8 +66,8 @@ const k = {
66
66
  }, o = !!(n || h || e), S = !!(e && X(e)), _ = (a) => {
67
67
  const N = a.target.files?.[0];
68
68
  N && f && f(N), a.target.value = "";
69
- }, y = T(
70
- "inline-flex items-center font-medium",
69
+ }, c = T(
70
+ "inline-flex items-center font-medium py-0.5",
71
71
  j(l, H),
72
72
  G(v),
73
73
  o && "cursor-pointer hover:opacity-80",
@@ -111,8 +111,8 @@ const k = {
111
111
  {
112
112
  ref: x,
113
113
  href: e,
114
- className: y,
115
- style: c,
114
+ className: c,
115
+ style: y,
116
116
  onMouseDown: s,
117
117
  onClick: n,
118
118
  "aria-label": b || `Tag: ${r}`,
@@ -125,8 +125,8 @@ const k = {
125
125
  {
126
126
  ref: x,
127
127
  to: e,
128
- className: y,
129
- style: c,
128
+ className: c,
129
+ style: y,
130
130
  onMouseDown: s,
131
131
  onClick: n,
132
132
  "aria-label": b || `Tag: ${r}`,
@@ -138,8 +138,8 @@ const k = {
138
138
  "div",
139
139
  {
140
140
  ref: x,
141
- className: y,
142
- style: c,
141
+ className: c,
142
+ style: y,
143
143
  onMouseDown: s,
144
144
  onClick: n,
145
145
  onKeyDown: o ? (a) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.es.js","sources":["../../../../src/components/data-display/tag/Tag.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { forwardRef, type CSSProperties, type Ref } from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { CloseIcon } from \"../../icons/CloseIcon\";\nimport Tooltip from \"../../tooltip/Tooltip\";\n\n/**\n * Available tag size options\n */\nexport type TagSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\n/**\n * Available color names for tags\n */\nexport type TagColor =\n | \"primary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"neutral\"\n | \"red\"\n | \"green\"\n | \"blue\"\n | \"teal\"\n | \"yellow\"\n | \"orange\"\n | \"peach\"\n | \"purple\"\n | \"navy\"\n | \"gray\"\n | \"grey\";\n\nexport type ThemeMode = \"light\" | \"dark\";\n\n/**\n * Upload handler function type\n */\nexport type UploadHandler = (file: File) => void | Promise<void>;\n\n/**\n * Props for the Tag component\n */\nexport interface TagProps {\n /** The text content to display */\n label: string;\n /** Router path or external URL */\n href?: string;\n /** Color name or hex color value (example: #3B82F6 or red) */\n color?: string;\n /** Size variant */\n size?: TagSize;\n /** Additional CSS classes */\n className?: string;\n /** Click handler for the tag */\n onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Mouse down handler */\n onMouseDown?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Maximum character length before truncation */\n truncate?: number;\n /** Treat `color` as a hex color string (e.g. `#3B82F6` or `3b82f6`). When true, the value is applied as a hex regardless of named-color matches. */\n isHashColor?: boolean;\n /** Theme mode */\n theme?: ThemeMode;\n /** Icon to display before the label */\n icon?: React.ReactNode;\n /** Whether the tag is removable (shows close button) */\n removable?: boolean;\n /** Handler for remove button click */\n onRemove?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** Upload handler function */\n onUpload?: UploadHandler;\n /** Whether the tag accepts file uploads */\n acceptsUpload?: boolean;\n /** Whether to show a tooltip with the label on hover */\n tooltip?: boolean;\n /** Custom aria-label for accessibility */\n \"aria-label\"?: string;\n /** ARIA role override */\n role?: React.AriaRole;\n}\n\n/**\n * Tag component displays labels with customizable colors and styling\n *\n * @example\n * ```tsx\n * <Tag label=\"React\" color=\"blue\" size=\"md\" />\n * <Tag label=\"TypeScript\" color=\"#3178c6\" isHashColor />\n * <Tag label=\"Removable\" removable onRemove={handleRemove} />\n * <Tag label=\"Upload\" acceptsUpload onUpload={handleUpload} />\n * ```\n */\nconst TAG_COLOR_CLASSES: Record<TagColor, string> = {\n primary: \"bg-primary-50 border-primary-100 text-primary-600 dark:bg-primary-900 dark:border-primary-800 dark:text-primary-400\",\n success: \"bg-green-50 border-green-200 text-green-700 dark:bg-green-950 dark:border-green-900 dark:text-green-300\",\n warning: \"bg-yellow-50 border-yellow-200 text-yellow-700 dark:bg-yellow-950 dark:border-yellow-900 dark:text-yellow-300\",\n error: \"bg-red-50 border-red-200 text-red-700 dark:bg-red-950 dark:border-red-900 dark:text-red-300\",\n neutral: \"bg-gray-50 border-gray-200 text-gray-700 dark:bg-gray-900 dark:border-gray-700 dark:text-gray-300\",\n red: \"bg-red-50 border-red-200 text-red-700 dark:bg-red-950 dark:border-red-900 dark:text-red-300\",\n green: \"bg-green-50 border-green-200 text-green-700 dark:bg-green-950 dark:border-green-900 dark:text-green-300\",\n blue: \"bg-blue-50 border-blue-200 text-blue-700 dark:bg-blue-950 dark:border-blue-900 dark:text-blue-300\",\n teal: \"bg-teal-50 border-teal-200 text-teal-700 dark:bg-teal-950 dark:border-teal-900 dark:text-teal-300\",\n orange: \"bg-orange-50 border-orange-200 text-orange-700 dark:bg-orange-950 dark:border-orange-900 dark:text-orange-300\",\n peach: \"bg-peach-50 border-peach-200 text-peach-700 dark:bg-peach-950 dark:border-peach-900 dark:text-peach-300\",\n navy: \"bg-slate-50 border-slate-200 text-slate-700 dark:bg-slate-900 dark:border-slate-700 dark:text-slate-300\",\n gray: \"bg-gray-50 border-gray-200 text-gray-700 dark:bg-gray-900 dark:border-gray-700 dark:text-gray-300\",\n grey: \"bg-gray-50 border-gray-200 text-gray-700 dark:bg-gray-900 dark:border-gray-700 dark:text-gray-300\",\n yellow: \"bg-yellow-50 border-yellow-200 text-yellow-700 dark:bg-yellow-950 dark:border-yellow-900 dark:text-yellow-300\",\n purple: \"bg-purple-50 border-purple-200 text-purple-700 dark:bg-purple-950 dark:border-purple-900 dark:text-purple-300\",\n};\n\nconst HEX_COLOR_PATTERN = /^#[0-9a-fA-F]{6}$/;\nconst EXTERNAL_HREF_PATTERN = /^(?:[a-z][a-z\\d+\\-.]*:|\\/\\/)/i;\n\nconst getColorClasses = (color?: string, isHexColor?: boolean): string => {\n if (isHexColor) return \"\";\n if (!color) return TAG_COLOR_CLASSES.primary;\n return TAG_COLOR_CLASSES[color.toLowerCase() as TagColor] ?? TAG_COLOR_CLASSES.primary;\n};\n\n/**\n * Normalize a 6-digit hex color string to lowercase `#rrggbb`.\n * Returns `undefined` if the value isn't a valid 6-digit hex.\n */\nconst normalizeHex = (value: string): string | undefined => {\n const trimmed = value.trim().toLowerCase();\n return HEX_COLOR_PATTERN.test(trimmed) ? trimmed : undefined;\n};\n\nconst isExternalHref = (href: string): boolean => EXTERNAL_HREF_PATTERN.test(href);\n\n/**\n * Get size-based styling classes\n */\nconst getSizeClasses = (size: TagSize): string => {\n switch (size) {\n case \"xs\":\n return \"text-3xs leading-3 px-1 border-[0.5px] rounded\";\n case \"lg\":\n return \"text-sm leading-5 px-1.5 border rounded-md\";\n case \"sm\":\n return \"text-2xs leading-4 px-1 border-[0.5px] rounded\";\n default: // md\n return \"text-xs leading-4 px-1.5 border rounded-md\";\n }\n};\n\nexport const Tag = forwardRef<HTMLElement, TagProps>(\n (\n {\n label,\n href,\n color,\n size = 'md',\n className,\n onClick,\n onMouseDown,\n truncate,\n isHashColor = false,\n theme,\n icon,\n removable = false,\n onRemove,\n onUpload,\n acceptsUpload = false,\n tooltip = false,\n \"aria-label\": ariaLabel,\n role,\n },\n ref\n ) => {\n const normalizedHex =\n typeof color === \"string\" && (isHashColor || HEX_COLOR_PATTERN.test(color))\n ? normalizeHex(color)\n : undefined;\n const isHexColor = Boolean(normalizedHex);\n const tagStyle: CSSProperties = {\n maxWidth: \"100%\",\n ...(normalizedHex\n ? {\n backgroundColor: `${normalizedHex}26`,\n borderColor: `${normalizedHex}59`,\n color: normalizedHex,\n }\n : {}),\n };\n const isInteractive = Boolean(onClick || acceptsUpload || href);\n const shouldRenderAnchor = Boolean(href && isExternalHref(href));\n\n /**\n * Handle file upload\n */\n const handleFileUpload = (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file && onUpload) {\n onUpload(file);\n }\n // Reset input value to allow same file selection\n event.target.value = '';\n };\n\n const tagClassName = cn(\n \"inline-flex items-center font-medium\",\n getColorClasses(color, isHexColor),\n getSizeClasses(size),\n isInteractive && \"cursor-pointer hover:opacity-80\",\n className\n );\n\n const inner = (\n <div className=\"flex items-center gap-0.5 min-w-0 overflow-hidden\" style={{ maxWidth: \"100%\" }}>\n {icon}\n\n {truncate ? (\n <p\n title={label}\n className={cn(\n \"overflow-hidden whitespace-nowrap text-ellipsis\",\n isInteractive && \"cursor-pointer\"\n )}\n style={{ maxWidth: \"100%\" }}\n >\n {label.length > truncate ? `${label.slice(0, truncate)}...` : label}\n </p>\n ) : (\n <p className=\"overflow-hidden whitespace-nowrap text-ellipsis\" style={{ maxWidth: \"100%\" }}>\n {label}\n </p>\n )}\n\n {acceptsUpload && (\n <input\n type=\"file\"\n onChange={handleFileUpload}\n className=\"absolute inset-0 h-full w-full cursor-pointer opacity-0\"\n aria-label={`Upload file for ${label}`}\n />\n )}\n\n {removable && onRemove && (\n <button\n onClick={onRemove}\n className=\"ml-1 flex-shrink-0\"\n aria-label={`Remove ${label}`}\n type=\"button\"\n >\n <CloseIcon size={12} className=\"cursor-pointer\" />\n </button>\n )}\n </div>\n );\n\n const content = tooltip ? <Tooltip title={label} delayShow>{inner}</Tooltip> : inner;\n\n if (href) {\n if (shouldRenderAnchor) {\n return (\n <a\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n className={tagClassName}\n style={tagStyle}\n onMouseDown={onMouseDown}\n onClick={onClick}\n aria-label={ariaLabel || `Tag: ${label}`}\n role={role}\n data-theme={theme}\n >\n {content}\n </a>\n );\n }\n\n return (\n <Link\n ref={ref as Ref<HTMLAnchorElement>}\n to={href}\n className={tagClassName}\n style={tagStyle}\n onMouseDown={onMouseDown}\n onClick={onClick}\n aria-label={ariaLabel || `Tag: ${label}`}\n role={role}\n data-theme={theme}\n >\n {content}\n </Link>\n );\n }\n\n return (\n <div\n ref={ref as Ref<HTMLDivElement>}\n className={tagClassName}\n style={tagStyle}\n onMouseDown={onMouseDown}\n onClick={onClick}\n onKeyDown={\n isInteractive\n ? (event) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n event.currentTarget.click();\n }\n }\n : undefined\n }\n aria-label={ariaLabel || `Tag: ${label}`}\n role={role ?? (isInteractive ? \"button\" : undefined)}\n tabIndex={isInteractive ? 0 : undefined}\n data-theme={theme}\n >\n {content}\n </div>\n );\n }\n);\n\nTag.displayName = \"Tag\";\n"],"names":["TAG_COLOR_CLASSES","HEX_COLOR_PATTERN","EXTERNAL_HREF_PATTERN","getColorClasses","color","isHexColor","normalizeHex","value","trimmed","isExternalHref","href","getSizeClasses","size","Tag","forwardRef","label","className","onClick","onMouseDown","truncate","isHashColor","theme","icon","removable","onRemove","onUpload","acceptsUpload","tooltip","ariaLabel","role","ref","normalizedHex","tagStyle","isInteractive","shouldRenderAnchor","handleFileUpload","event","file","tagClassName","cn","inner","jsx","CloseIcon","content","Tooltip","Link"],"mappings":";;;;;;AA4FA,MAAMA,IAA8C;AAAA,EAClD,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AACV,GAEMC,IAAoB,qBACpBC,IAAwB,iCAExBC,IAAkB,CAACC,GAAgBC,MACnCA,IAAmB,KAClBD,IACEJ,EAAkBI,EAAM,YAAA,CAAyB,KAAKJ,EAAkB,UAD5DA,EAAkB,SAQjCM,IAAe,CAACC,MAAsC;AAC1D,QAAMC,IAAUD,EAAM,KAAA,EAAO,YAAA;AAC7B,SAAON,EAAkB,KAAKO,CAAO,IAAIA,IAAU;AACrD,GAEMC,IAAiB,CAACC,MAA0BR,EAAsB,KAAKQ,CAAI,GAK3EC,IAAiB,CAACC,MAA0B;AAChD,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb,GAEaC,IAAMC;AAAA,EACjB,CACE;AAAA,IACE,OAAAC;AAAA,IACA,MAAAL;AAAA,IACA,OAAAN;AAAA,IACA,MAAAQ,IAAO;AAAA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A,QACA,cAAYR;AAAA,QAEX,UAAAsB;AAAA,MAAA;AAAA,IAAA,IAML,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAX;AAAA,QACA,WAAWQ;AAAA,QACX,OAAON;AAAA,QACP,aAAAd;AAAA,QACA,SAAAD;AAAA,QACA,WACEgB,IACI,CAACG,MAAU;AACX,WAAIA,EAAM,QAAQ,WAAWA,EAAM,QAAQ,SACzCA,EAAM,eAAA,GACNA,EAAM,cAAc,MAAA;AAAA,QAExB,IACE;AAAA,QAEN,cAAYR,KAAa,QAAQb,CAAK;AAAA,QACtC,MAAMc,MAASI,IAAgB,WAAW;AAAA,QAC1C,UAAUA,IAAgB,IAAI;AAAA,QAC9B,cAAYZ;AAAA,QAEX,UAAAsB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA9B,EAAI,cAAc;"}
1
+ {"version":3,"file":"Tag.es.js","sources":["../../../../src/components/data-display/tag/Tag.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { forwardRef, type CSSProperties, type Ref } from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { CloseIcon } from \"../../icons/CloseIcon\";\nimport Tooltip from \"../../tooltip/Tooltip\";\n\n/**\n * Available tag size options\n */\nexport type TagSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\n/**\n * Available color names for tags\n */\nexport type TagColor =\n | \"primary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"neutral\"\n | \"red\"\n | \"green\"\n | \"blue\"\n | \"teal\"\n | \"yellow\"\n | \"orange\"\n | \"peach\"\n | \"purple\"\n | \"navy\"\n | \"gray\"\n | \"grey\";\n\nexport type ThemeMode = \"light\" | \"dark\";\n\n/**\n * Upload handler function type\n */\nexport type UploadHandler = (file: File) => void | Promise<void>;\n\n/**\n * Props for the Tag component\n */\nexport interface TagProps {\n /** The text content to display */\n label: string;\n /** Router path or external URL */\n href?: string;\n /** Color name or hex color value (example: #3B82F6 or red) */\n color?: string;\n /** Size variant */\n size?: TagSize;\n /** Additional CSS classes */\n className?: string;\n /** Click handler for the tag */\n onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Mouse down handler */\n onMouseDown?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Maximum character length before truncation */\n truncate?: number;\n /** Treat `color` as a hex color string (e.g. `#3B82F6` or `3b82f6`). When true, the value is applied as a hex regardless of named-color matches. */\n isHashColor?: boolean;\n /** Theme mode */\n theme?: ThemeMode;\n /** Icon to display before the label */\n icon?: React.ReactNode;\n /** Whether the tag is removable (shows close button) */\n removable?: boolean;\n /** Handler for remove button click */\n onRemove?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** Upload handler function */\n onUpload?: UploadHandler;\n /** Whether the tag accepts file uploads */\n acceptsUpload?: boolean;\n /** Whether to show a tooltip with the label on hover */\n tooltip?: boolean;\n /** Custom aria-label for accessibility */\n \"aria-label\"?: string;\n /** ARIA role override */\n role?: React.AriaRole;\n}\n\n/**\n * Tag component displays labels with customizable colors and styling\n *\n * @example\n * ```tsx\n * <Tag label=\"React\" color=\"blue\" size=\"md\" />\n * <Tag label=\"TypeScript\" color=\"#3178c6\" isHashColor />\n * <Tag label=\"Removable\" removable onRemove={handleRemove} />\n * <Tag label=\"Upload\" acceptsUpload onUpload={handleUpload} />\n * ```\n */\nconst TAG_COLOR_CLASSES: Record<TagColor, string> = {\n primary: \"bg-primary-50 border-primary-100 text-primary-600 dark:bg-primary-900 dark:border-primary-800 dark:text-primary-400\",\n success: \"bg-green-50 border-green-200 text-green-700 dark:bg-green-950 dark:border-green-900 dark:text-green-300\",\n warning: \"bg-yellow-50 border-yellow-200 text-yellow-700 dark:bg-yellow-950 dark:border-yellow-900 dark:text-yellow-300\",\n error: \"bg-red-50 border-red-200 text-red-700 dark:bg-red-950 dark:border-red-900 dark:text-red-300\",\n neutral: \"bg-gray-50 border-gray-200 text-gray-700 dark:bg-gray-900 dark:border-gray-700 dark:text-gray-300\",\n red: \"bg-red-50 border-red-200 text-red-700 dark:bg-red-950 dark:border-red-900 dark:text-red-300\",\n green: \"bg-green-50 border-green-200 text-green-700 dark:bg-green-950 dark:border-green-900 dark:text-green-300\",\n blue: \"bg-blue-50 border-blue-200 text-blue-700 dark:bg-blue-950 dark:border-blue-900 dark:text-blue-300\",\n teal: \"bg-teal-50 border-teal-200 text-teal-700 dark:bg-teal-950 dark:border-teal-900 dark:text-teal-300\",\n orange: \"bg-orange-50 border-orange-200 text-orange-700 dark:bg-orange-950 dark:border-orange-900 dark:text-orange-300\",\n peach: \"bg-peach-50 border-peach-200 text-peach-700 dark:bg-peach-950 dark:border-peach-900 dark:text-peach-300\",\n navy: \"bg-slate-50 border-slate-200 text-slate-700 dark:bg-slate-900 dark:border-slate-700 dark:text-slate-300\",\n gray: \"bg-gray-50 border-gray-200 text-gray-700 dark:bg-gray-900 dark:border-gray-700 dark:text-gray-300\",\n grey: \"bg-gray-50 border-gray-200 text-gray-700 dark:bg-gray-900 dark:border-gray-700 dark:text-gray-300\",\n yellow: \"bg-yellow-50 border-yellow-200 text-yellow-700 dark:bg-yellow-950 dark:border-yellow-900 dark:text-yellow-300\",\n purple: \"bg-purple-50 border-purple-200 text-purple-700 dark:bg-purple-950 dark:border-purple-900 dark:text-purple-300\",\n};\n\nconst HEX_COLOR_PATTERN = /^#[0-9a-fA-F]{6}$/;\nconst EXTERNAL_HREF_PATTERN = /^(?:[a-z][a-z\\d+\\-.]*:|\\/\\/)/i;\n\nconst getColorClasses = (color?: string, isHexColor?: boolean): string => {\n if (isHexColor) return \"\";\n if (!color) return TAG_COLOR_CLASSES.primary;\n return TAG_COLOR_CLASSES[color.toLowerCase() as TagColor] ?? TAG_COLOR_CLASSES.primary;\n};\n\n/**\n * Normalize a 6-digit hex color string to lowercase `#rrggbb`.\n * Returns `undefined` if the value isn't a valid 6-digit hex.\n */\nconst normalizeHex = (value: string): string | undefined => {\n const trimmed = value.trim().toLowerCase();\n return HEX_COLOR_PATTERN.test(trimmed) ? trimmed : undefined;\n};\n\nconst isExternalHref = (href: string): boolean => EXTERNAL_HREF_PATTERN.test(href);\n\n/**\n * Get size-based styling classes\n */\nconst getSizeClasses = (size: TagSize): string => {\n switch (size) {\n case \"xs\":\n return \"text-3xs leading-3 px-1 border-[0.5px] rounded\";\n case \"lg\":\n return \"text-sm leading-5 px-1.5 border rounded-md\";\n case \"sm\":\n return \"text-2xs leading-4 px-1 border-[0.5px] rounded\";\n default: // md\n return \"text-xs leading-4 px-1.5 border rounded-md\";\n }\n};\n\nexport const Tag = forwardRef<HTMLElement, TagProps>(\n (\n {\n label,\n href,\n color,\n size = 'md',\n className,\n onClick,\n onMouseDown,\n truncate,\n isHashColor = false,\n theme,\n icon,\n removable = false,\n onRemove,\n onUpload,\n acceptsUpload = false,\n tooltip = false,\n \"aria-label\": ariaLabel,\n role,\n },\n ref\n ) => {\n const normalizedHex =\n typeof color === \"string\" && (isHashColor || HEX_COLOR_PATTERN.test(color))\n ? normalizeHex(color)\n : undefined;\n const isHexColor = Boolean(normalizedHex);\n const tagStyle: CSSProperties = {\n maxWidth: \"100%\",\n ...(normalizedHex\n ? {\n backgroundColor: `${normalizedHex}26`,\n borderColor: `${normalizedHex}59`,\n color: normalizedHex,\n }\n : {}),\n };\n const isInteractive = Boolean(onClick || acceptsUpload || href);\n const shouldRenderAnchor = Boolean(href && isExternalHref(href));\n\n /**\n * Handle file upload\n */\n const handleFileUpload = (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file && onUpload) {\n onUpload(file);\n }\n // Reset input value to allow same file selection\n event.target.value = '';\n };\n\n const tagClassName = cn(\n \"inline-flex items-center font-medium py-0.5\",\n getColorClasses(color, isHexColor),\n getSizeClasses(size),\n isInteractive && \"cursor-pointer hover:opacity-80\",\n className\n );\n\n const inner = (\n <div className=\"flex items-center gap-0.5 min-w-0 overflow-hidden\" style={{ maxWidth: \"100%\" }}>\n {icon}\n\n {truncate ? (\n <p\n title={label}\n className={cn(\n \"overflow-hidden whitespace-nowrap text-ellipsis\",\n isInteractive && \"cursor-pointer\"\n )}\n style={{ maxWidth: \"100%\" }}\n >\n {label.length > truncate ? `${label.slice(0, truncate)}...` : label}\n </p>\n ) : (\n <p className=\"overflow-hidden whitespace-nowrap text-ellipsis\" style={{ maxWidth: \"100%\" }}>\n {label}\n </p>\n )}\n\n {acceptsUpload && (\n <input\n type=\"file\"\n onChange={handleFileUpload}\n className=\"absolute inset-0 h-full w-full cursor-pointer opacity-0\"\n aria-label={`Upload file for ${label}`}\n />\n )}\n\n {removable && onRemove && (\n <button\n onClick={onRemove}\n className=\"ml-1 flex-shrink-0\"\n aria-label={`Remove ${label}`}\n type=\"button\"\n >\n <CloseIcon size={12} className=\"cursor-pointer\" />\n </button>\n )}\n </div>\n );\n\n const content = tooltip ? <Tooltip title={label} delayShow>{inner}</Tooltip> : inner;\n\n if (href) {\n if (shouldRenderAnchor) {\n return (\n <a\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n className={tagClassName}\n style={tagStyle}\n onMouseDown={onMouseDown}\n onClick={onClick}\n aria-label={ariaLabel || `Tag: ${label}`}\n role={role}\n data-theme={theme}\n >\n {content}\n </a>\n );\n }\n\n return (\n <Link\n ref={ref as Ref<HTMLAnchorElement>}\n to={href}\n className={tagClassName}\n style={tagStyle}\n onMouseDown={onMouseDown}\n onClick={onClick}\n aria-label={ariaLabel || `Tag: ${label}`}\n role={role}\n data-theme={theme}\n >\n {content}\n </Link>\n );\n }\n\n return (\n <div\n ref={ref as Ref<HTMLDivElement>}\n className={tagClassName}\n style={tagStyle}\n onMouseDown={onMouseDown}\n onClick={onClick}\n onKeyDown={\n isInteractive\n ? (event) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n event.currentTarget.click();\n }\n }\n : undefined\n }\n aria-label={ariaLabel || `Tag: ${label}`}\n role={role ?? (isInteractive ? \"button\" : undefined)}\n tabIndex={isInteractive ? 0 : undefined}\n data-theme={theme}\n >\n {content}\n </div>\n );\n }\n);\n\nTag.displayName = \"Tag\";\n"],"names":["TAG_COLOR_CLASSES","HEX_COLOR_PATTERN","EXTERNAL_HREF_PATTERN","getColorClasses","color","isHexColor","normalizeHex","value","trimmed","isExternalHref","href","getSizeClasses","size","Tag","forwardRef","label","className","onClick","onMouseDown","truncate","isHashColor","theme","icon","removable","onRemove","onUpload","acceptsUpload","tooltip","ariaLabel","role","ref","normalizedHex","tagStyle","isInteractive","shouldRenderAnchor","handleFileUpload","event","file","tagClassName","cn","inner","jsx","CloseIcon","content","Tooltip","Link"],"mappings":";;;;;;AA4FA,MAAMA,IAA8C;AAAA,EAClD,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AACV,GAEMC,IAAoB,qBACpBC,IAAwB,iCAExBC,IAAkB,CAACC,GAAgBC,MACnCA,IAAmB,KAClBD,IACEJ,EAAkBI,EAAM,YAAA,CAAyB,KAAKJ,EAAkB,UAD5DA,EAAkB,SAQjCM,IAAe,CAACC,MAAsC;AAC1D,QAAMC,IAAUD,EAAM,KAAA,EAAO,YAAA;AAC7B,SAAON,EAAkB,KAAKO,CAAO,IAAIA,IAAU;AACrD,GAEMC,IAAiB,CAACC,MAA0BR,EAAsB,KAAKQ,CAAI,GAK3EC,IAAiB,CAACC,MAA0B;AAChD,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb,GAEaC,IAAMC;AAAA,EACjB,CACE;AAAA,IACE,OAAAC;AAAA,I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AAA,QACA,cAAYW,KAAa,QAAQb,CAAK;AAAA,QACtC,MAAAc;AAAA,QACA,cAAYR;AAAA,QAEX,UAAAsB;AAAA,MAAA;AAAA,IAAA,IAML,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAX;AAAA,QACA,WAAWQ;AAAA,QACX,OAAON;AAAA,QACP,aAAAd;AAAA,QACA,SAAAD;AAAA,QACA,WACEgB,IACI,CAACG,MAAU;AACX,WAAIA,EAAM,QAAQ,WAAWA,EAAM,QAAQ,SACzCA,EAAM,eAAA,GACNA,EAAM,cAAc,MAAA;AAAA,QAExB,IACE;AAAA,QAEN,cAAYR,KAAa,QAAQb,CAAK;AAAA,QACtC,MAAMc,MAASI,IAAgB,WAAW;AAAA,QAC1C,UAAUA,IAAgB,IAAI;AAAA,QAC9B,cAAYZ;AAAA,QAEX,UAAAsB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA9B,EAAI,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),C=require("antd"),i=require("../../_virtual/index.cjs.js"),g=require("framer-motion"),c=require("react"),T=require("react-i18next"),n=require("../data-display/typography/Typography.cjs.js"),B=require("../buttons/option-button/OptionButton.cjs.js"),L=require("../button/IconButton.cjs.js"),w=require("../tooltip/Tooltip.cjs.js"),q=require("../icon/icons.generated.cjs.js"),R=({size:r=24,fill:o="currentColor",className:p})=>a.jsx("svg",{className:p,width:r,height:r,viewBox:"0 0 20 20",fill:o,xmlns:"http://www.w3.org/2000/svg",children:a.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"})}),F=({fill:r="#cccccc",className:o})=>a.jsx("svg",{height:"20",width:"20",viewBox:"0 0 20 20",focusable:"false",className:o,children:a.jsx("path",{fill:r,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"})}),j=r=>{const{show:o,isFlowDashboard:p,onClose:k,actionItems:m,selectedItemsCount:N,deleteConfig:d,showActionBg:D}=r,{t:h}=T.useTranslation(),[y,u]=c.useState(!1),[I,b]=c.useState(!0),t=c.useRef(null),f=c.useRef(null);c.useEffect(()=>{const e=new ResizeObserver(()=>{if(t.current&&f.current){const s=t.current.scrollWidth-100;m.length*180+100>s?b(!1):b(!0)}});return t.current&&e.observe(t.current),()=>{t.current&&e.unobserve(t.current)}});const l={label:h("Delete"),icon:a.jsx(q.DeleteIcon,{size:16,className:"text-error-500"}),onClick:d?.onClick,...d},x=m.filter(e=>e.visible!==!1).map((e,s)=>({key:s,label:a.jsx(B.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?a.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:t,className:i("h-[40px]",p?"ml-60 w-1/2":"w-full"),children:a.jsxs("div",{className:i("h-[40px] border py-1.5 px-2 text-white bg-primary-800 dark:bg-black-700 flex justify-between items-center"),children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(L,{tooltip:"Close",variant:"ghost",onClick:k,className:"!p-0 text-white hover:opacity-80 hover:rotate-90 transition-all duration-200",children:a.jsx(R,{size:20})}),a.jsxs("div",{className:"flex items-center gap-1.5 ml-2",children:[a.jsx("span",{className:"text-primary-600 dark:text-black-100 bg-primary-50 dark:bg-black-800 border-primary-200 dark:border-black-800 text-xs leading-4 font-normal border rounded-full pr-2 pl-2",children:N||0}),a.jsx(n.Typography,{size:"extra-small",appearance:"custom",className:"text-white",children:h("Selected")})]})]}),a.jsx("div",{ref:f,className:i("h-[36px] flex items-center rounded-full font-inter",D?"bg-primary-900 dark:bg-black-800 px-[10px] rounded-[43px]":""),children:I?a.jsxs(g.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"flex bg-primary-800 dark:bg-black-800 px-4 rounded-full",children:[m.map((e,s)=>e.visible!==!1&&a.jsx("div",{children:e.type==="dropdown"?a.jsx(C.Dropdown,{menu:{items:e.dropdownItems},trigger:[e.dropdownTrigger||"click"],overlayClassName:"!min-w-[148px]",placement:"bottomRight",getPopupContainer:v=>v.parentElement,open:y,onOpenChange:u,children:a.jsx("button",{id:`btn-floating-bar-${e.label}`,onClick:e.onClick,disabled:e.disabled,className:i(e?.label?"flex items-center mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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",(e.label==="Delete"||e.label==="Remove"||e.label==="Delete user"||e.label==="Delete Permanently")&&"!text-error-500",e.disabled&&"opacity-70"),children:a.jsxs(w,{hideTooltip:!e.tooltip,title:e.tooltip,className:"flex items-center",children:[e.icon,!e?.hideLabel&&e.label&&a.jsx(n.Typography,{size:"small",variant:"medium",className:"text-inherit ml-1.5",appearance:"custom",children:e.label})]})},s)}):a.jsx("button",{id:`btn-floating-bar-${e.label}`,onClick:e.onClick,disabled:e.disabled,className:i(e?.label?"flex items-center mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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",(e.label==="Delete"||e.label==="Remove"||e.label==="Delete Permanently")&&"!text-error-500",e.disabled&&"opacity-70"),children:a.jsxs(w,{hideTooltip:!e.tooltip,title:e.tooltip,className:"flex items-center",children:[e.icon,!e?.hideLabel&&e.label&&a.jsx(n.Typography,{size:"small",variant:"medium",className:"text-inherit ml-1.5",appearance:"custom",children:e.label})]})})},s)),d?a.jsxs("button",{id:`btn-floating-bar-${l.label}`,onClick:l.onClick,disabled:l.disabled,className:i("flex items-center gap-1.5 py-1 pr-3 pl-2 rounded-md hover:scale-105 hover:opacity-80 transition-all duration-200",l.disabled&&"opacity-70"),children:[l.icon,a.jsx(n.Typography,{size:"small",variant:"medium",className:"text-error-500",appearance:"custom",children:l.label})]}):null]}):a.jsxs(g.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"minw-[150px] p-1.5 flex items-center",children:[a.jsx(C.Dropdown,{menu:{items:x},trigger:["click"],overlayClassName:"!min-w-[148px]",placement:"bottomRight",getPopupContainer:e=>e.parentElement,open:y,onOpenChange:u,children:a.jsxs("button",{id:"btn-floating-bar-actions",disabled:x.length===0,className:i("flex items-center gap-1.5 px-2 py-1 w-22 h-7 rounded-full bg-primary-700 hover:scale-105 hover:opacity-80 transition-all duration-200",x.length===0&&"opacity-60 hover:scale-100 hover:opacity-60"),type:"button",children:[a.jsx(n.Typography,{size:"small",variant:"medium",className:"text-white",children:h("Actions")}),a.jsx(F,{fill:"#FFFFFF",className:"w-[16px] h-[16px]"})]})}),d?a.jsxs("button",{id:`btn-floating-bar-${l.label}`,onClick:l.onClick,disabled:l.disabled,className:i("flex items-center gap-1.5 py-1 pr-3 pl-2 rounded-md hover:scale-105 hover:opacity-80 transition-all duration-200",l.disabled&&"opacity-70"),type:"button",children:[l.icon,a.jsx(n.Typography,{size:"small",variant:"medium",className:"text-error-500",appearance:"custom",children:l.label})]}):null]})})]})}):null};j.displayName="FloatingBar";exports.FloatingBar=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),C=require("antd"),i=require("../../_virtual/index.cjs.js"),g=require("framer-motion"),c=require("react"),T=require("react-i18next"),n=require("../data-display/typography/Typography.cjs.js"),B=require("../buttons/option-button/OptionButton.cjs.js"),L=require("../button/IconButton.cjs.js"),w=require("../tooltip/Tooltip.cjs.js"),q=require("../icon/icons.generated.cjs.js"),R=({size:r=24,fill:o="currentColor",className:p})=>a.jsx("svg",{className:p,width:r,height:r,viewBox:"0 0 20 20",fill:o,xmlns:"http://www.w3.org/2000/svg",children:a.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"})}),F=({fill:r="#cccccc",className:o})=>a.jsx("svg",{height:"20",width:"20",viewBox:"0 0 20 20",focusable:"false",className:o,children:a.jsx("path",{fill:r,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"})}),j=r=>{const{show:o,isFlowDashboard:p,onClose:k,actionItems:m,selectedItemsCount:N,deleteConfig:d,showActionBg:D}=r,{t:h}=T.useTranslation(),[y,u]=c.useState(!1),[I,b]=c.useState(!0),t=c.useRef(null),f=c.useRef(null);c.useEffect(()=>{const e=new ResizeObserver(()=>{if(t.current&&f.current){const s=t.current.scrollWidth-100;m.length*180+100>s?b(!1):b(!0)}});return t.current&&e.observe(t.current),()=>{t.current&&e.unobserve(t.current)}});const l={label:h("Delete"),icon:a.jsx(q.DeleteIcon,{size:16,className:"text-error-500"}),onClick:d?.onClick,...d},x=m.filter(e=>e.visible!==!1).map((e,s)=>({key:s,label:a.jsx(B.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?a.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:t,className:i("h-[40px]",p?"ml-60 w-1/2":"w-full"),children:a.jsxs("div",{className:i("h-[40px] border py-1.5 px-2 text-white bg-primary-800 dark:bg-black-700 flex justify-between items-center"),children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(L,{tooltip:"Close",variant:"ghost",onClick:k,className:"!p-0 text-white hover:opacity-80 hover:rotate-90 transition-all duration-200",children:a.jsx(R,{size:20})}),a.jsxs("div",{className:"flex items-center gap-1.5 ml-2",children:[a.jsx("span",{className:"text-primary-600 dark:text-black-100 bg-primary-50 dark:bg-black-800 border-primary-200 dark:border-black-800 text-xs leading-4 font-normal border rounded-full pr-2 pl-2",children:N||0}),a.jsx(n.Typography,{size:"extra-small",appearance:"custom",className:"text-white",children:h("Selected")})]})]}),a.jsx("div",{ref:f,className:i("h-[36px] flex items-center rounded-full font-inter",D?"bg-primary-900 dark:bg-black-800 px-[10px] rounded-[43px]":""),children:I?a.jsxs(g.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"flex bg-primary-800 dark:bg-black-800 px-4 rounded-full",children:[m.map((e,s)=>e.visible!==!1&&a.jsx("div",{children:e.type==="dropdown"?a.jsx(C.Dropdown,{menu:{items:e.dropdownItems},trigger:[e.dropdownTrigger||"click"],overlayClassName:"!min-w-[148px]",placement:"bottomRight",getPopupContainer:v=>v.parentElement,open:y,onOpenChange:u,children:a.jsx("button",{id:`btn-floating-bar-${e.label}`,onClick:e.onClick,disabled:e.disabled,className:i(e?.label?"flex items-center mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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",(e.label==="Delete"||e.label==="Remove"||e.label==="Delete user"||e.label==="Move to trash"||e.label==="Delete Permanently")&&"!text-error-500",e.disabled&&"opacity-70"),children:a.jsxs(w,{hideTooltip:!e.tooltip,title:e.tooltip,className:"flex items-center",children:[e.icon,!e?.hideLabel&&e.label&&a.jsx(n.Typography,{size:"small",variant:"medium",className:"text-inherit ml-1.5",appearance:"custom",children:e.label})]})},s)}):a.jsx("button",{id:`btn-floating-bar-${e.label}`,onClick:e.onClick,disabled:e.disabled,className:i(e?.label?"flex items-center mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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",(e.label==="Delete"||e.label==="Remove"||e.label==="Delete Permanently")&&"!text-error-500",e.disabled&&"opacity-70"),children:a.jsxs(w,{hideTooltip:!e.tooltip,title:e.tooltip,className:"flex items-center",children:[e.icon,!e?.hideLabel&&e.label&&a.jsx(n.Typography,{size:"small",variant:"medium",className:"text-inherit ml-1.5",appearance:"custom",children:e.label})]})})},s)),d?a.jsxs("button",{id:`btn-floating-bar-${l.label}`,onClick:l.onClick,disabled:l.disabled,className:i("flex items-center gap-1.5 py-1 pr-3 pl-2 rounded-md hover:scale-105 hover:opacity-80 transition-all duration-200",l.disabled&&"opacity-70"),children:[l.icon,a.jsx(n.Typography,{size:"small",variant:"medium",className:"text-error-500",appearance:"custom",children:l.label})]}):null]}):a.jsxs(g.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"minw-[150px] p-1.5 flex items-center",children:[a.jsx(C.Dropdown,{menu:{items:x},trigger:["click"],overlayClassName:"!min-w-[148px]",placement:"bottomRight",getPopupContainer:e=>e.parentElement,open:y,onOpenChange:u,children:a.jsxs("button",{id:"btn-floating-bar-actions",disabled:x.length===0,className:i("flex items-center gap-1.5 px-2 py-1 w-22 h-7 rounded-full bg-primary-700 hover:scale-105 hover:opacity-80 transition-all duration-200",x.length===0&&"opacity-60 hover:scale-100 hover:opacity-60"),type:"button",children:[a.jsx(n.Typography,{size:"small",variant:"medium",className:"text-white",children:h("Actions")}),a.jsx(F,{fill:"#FFFFFF",className:"w-[16px] h-[16px]"})]})}),d?a.jsxs("button",{id:`btn-floating-bar-${l.label}`,onClick:l.onClick,disabled:l.disabled,className:i("flex items-center gap-1.5 py-1 pr-3 pl-2 rounded-md hover:scale-105 hover:opacity-80 transition-all duration-200",l.disabled&&"opacity-70"),type:"button",children:[l.icon,a.jsx(n.Typography,{size:"small",variant:"medium",className:"text-error-500",appearance:"custom",children:l.label})]}):null]})})]})}):null};j.displayName="FloatingBar";exports.FloatingBar=j;
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 size={16} className=\"text-error-500\" />,\n color: \"text-error-500 dark:text-error-500\",\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-[40px]\", isFlowDashboard ? \"ml-60 w-1/2\" : \"w-full\")}\n >\n <div\n className={cn(\n \"h-[40px] border py-1.5 px-2 text-white bg-primary-800 dark:bg-black-700 flex justify-between items-center\"\n )}\n >\n <div className=\"flex items-center\">\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={20} />\n </IconButton>\n <div className=\"flex items-center gap-1.5 ml-2\">\n <span className=\"text-primary-600 dark:text-black-100 bg-primary-50 dark:bg-black-800 border-primary-200 dark:border-black-800 text-xs leading-4 font-normal border rounded-full pr-2 pl-2\">\n {selectedItemsCount || 0}\n </span>\n <Typography\n size=\"extra-small\"\n appearance=\"custom\"\n className=\"text-white\"\n >\n {t(\"Selected\")}\n </Typography>\n </div>\n </div>\n <div\n ref={actionContainerRef}\n className={cn(\n \"h-[36px] flex items-center rounded-full font-inter\",\n showActionBg\n ? \"bg-primary-900 dark:bg-black-800 px-[10px] rounded-[43px]\"\n : \"\"\n )}\n >\n {showButtons ? (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"flex bg-primary-800 dark:bg-black-800 px-4 rounded-full\"\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 mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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 === \"Delete Permanently\") &&\n \"!text-error-500\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center\"\n >\n {button.icon}\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit ml-1.5\"}\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 mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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 Permanently\") &&\n \"!text-error-500\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center\"\n >\n {button.icon}\n\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit ml-1.5\"}\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-1.5 py-1 pr-3 pl-2 rounded-md 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-500\"\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-primary-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-1.5 py-1 pr-3 pl-2 rounded-md 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-500\"\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,K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,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,mHACAP,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,EAjPW,IAoPjB,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 size={16} className=\"text-error-500\" />,\n color: \"text-error-500 dark:text-error-500\",\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-[40px]\", isFlowDashboard ? \"ml-60 w-1/2\" : \"w-full\")}\n >\n <div\n className={cn(\n \"h-[40px] border py-1.5 px-2 text-white bg-primary-800 dark:bg-black-700 flex justify-between items-center\"\n )}\n >\n <div className=\"flex items-center\">\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={20} />\n </IconButton>\n <div className=\"flex items-center gap-1.5 ml-2\">\n <span className=\"text-primary-600 dark:text-black-100 bg-primary-50 dark:bg-black-800 border-primary-200 dark:border-black-800 text-xs leading-4 font-normal border rounded-full pr-2 pl-2\">\n {selectedItemsCount || 0}\n </span>\n <Typography\n size=\"extra-small\"\n appearance=\"custom\"\n className=\"text-white\"\n >\n {t(\"Selected\")}\n </Typography>\n </div>\n </div>\n <div\n ref={actionContainerRef}\n className={cn(\n \"h-[36px] flex items-center rounded-full font-inter\",\n showActionBg\n ? \"bg-primary-900 dark:bg-black-800 px-[10px] rounded-[43px]\"\n : \"\"\n )}\n >\n {showButtons ? (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"flex bg-primary-800 dark:bg-black-800 px-4 rounded-full\"\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 mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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-500\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center\"\n >\n {button.icon}\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit ml-1.5\"}\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 mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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 Permanently\") &&\n \"!text-error-500\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center\"\n >\n {button.icon}\n\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit ml-1.5\"}\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-1.5 py-1 pr-3 pl-2 rounded-md 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-500\"\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-primary-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-1.5 py-1 pr-3 pl-2 rounded-md 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-500\"\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,YAAc,IAC5BX,EAAY,OAAS,IAAM,IAC7BgB,EAC1BN,EAAe,EAAK,EAEpBA,EAAe,EAAI,CAEvB,CACF,CAAC,EAED,OA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AO,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,wIACAL,EAAc,SAAW,GACvB,6CAAA,EAEJ,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,mHACAP,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,EAlPW,IAqPjB,EAEAtB,EAAY,YAAc"}
@@ -165,7 +165,7 @@ const O = ({
165
165
  className: r(
166
166
  e?.label ? "flex items-center mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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",
167
167
  e?.hideLabel && "!p-1.5",
168
- (e.label === "Delete" || e.label === "Remove" || e.label === "Delete user" || e.label === "Delete Permanently") && "!text-error-500",
168
+ (e.label === "Delete" || e.label === "Remove" || e.label === "Delete user" || e.label === "Move to trash" || e.label === "Delete Permanently") && "!text-error-500",
169
169
  e.disabled && "opacity-70"
170
170
  ),
171
171
  children: /* @__PURE__ */ i(
@@ -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 size={16} className=\"text-error-500\" />,\n color: \"text-error-500 dark:text-error-500\",\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-[40px]\", isFlowDashboard ? \"ml-60 w-1/2\" : \"w-full\")}\n >\n <div\n className={cn(\n \"h-[40px] border py-1.5 px-2 text-white bg-primary-800 dark:bg-black-700 flex justify-between items-center\"\n )}\n >\n <div className=\"flex items-center\">\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={20} />\n </IconButton>\n <div className=\"flex items-center gap-1.5 ml-2\">\n <span className=\"text-primary-600 dark:text-black-100 bg-primary-50 dark:bg-black-800 border-primary-200 dark:border-black-800 text-xs leading-4 font-normal border rounded-full pr-2 pl-2\">\n {selectedItemsCount || 0}\n </span>\n <Typography\n size=\"extra-small\"\n appearance=\"custom\"\n className=\"text-white\"\n >\n {t(\"Selected\")}\n </Typography>\n </div>\n </div>\n <div\n ref={actionContainerRef}\n className={cn(\n \"h-[36px] flex items-center rounded-full font-inter\",\n showActionBg\n ? \"bg-primary-900 dark:bg-black-800 px-[10px] rounded-[43px]\"\n : \"\"\n )}\n >\n {showButtons ? (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"flex bg-primary-800 dark:bg-black-800 px-4 rounded-full\"\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 mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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 === \"Delete Permanently\") &&\n \"!text-error-500\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center\"\n >\n {button.icon}\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit ml-1.5\"}\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 mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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 Permanently\") &&\n \"!text-error-500\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center\"\n >\n {button.icon}\n\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit ml-1.5\"}\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-1.5 py-1 pr-3 pl-2 rounded-md 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-500\"\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-primary-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-1.5 py-1 pr-3 pl-2 rounded-md 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-500\"\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;A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,WAAWK;AAAA,gCACT;AAAA,gCACAL,EAAc,WAAW,KACvB;AAAA,8BAAA;AAAA,8BAEJ,MAAK;AAAA,8BAEL,UAAA;AAAA,gCAAA,gBAAA1B;AAAA,kCAACkC;AAAA,kCAAA;AAAA,oCACC,MAAK;AAAA,oCACL,SAAQ;AAAA,oCACR,WAAU;AAAA,oCAET,YAAE,SAAS;AAAA,kCAAA;AAAA,gCAAA;AAAA,gCAEd,gBAAAlC;AAAA,kCAACC;AAAA,kCAAA;AAAA,oCACC,MAAK;AAAA,oCACL,WAAU;AAAA,kCAAA;AAAA,gCAAA;AAAA,8BACZ;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACF;AAAA,sBAAA;AAAA,sBAEDQ,IACC,gBAAAuB;AAAA,wBAAC;AAAA,wBAAA;AAAA,0BACC,IAAI,oBAAoBR,EAAmB,KAAK;AAAA,0BAChD,SAASA,EAAmB;AAAA,0BAC5B,UAAUA,EAAmB;AAAA,0BAC7B,WAAWO;AAAA,4BACT;AAAA,4BACAP,EAAmB,YAAY;AAAA,0BAAA;AAAA,0BAEjC,MAAK;AAAA,0BAEJ,UAAA;AAAA,4BAAAA,EAAmB;AAAA,4BACpB,gBAAAxB;AAAA,8BAACkC;AAAA,8BAAA;AAAA,gCACC,MAAK;AAAA,gCACL,SAAQ;AAAA,gCACR,WAAU;AAAA,gCACV,YAAW;AAAA,gCAEV,UAAAV,EAAmB;AAAA,8BAAA;AAAA,4BAAA;AAAA,0BACtB;AAAA,wBAAA;AAAA,sBAAA,IAEA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACN;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA,IAjPW;AAoPjB;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 size={16} className=\"text-error-500\" />,\n color: \"text-error-500 dark:text-error-500\",\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-[40px]\", isFlowDashboard ? \"ml-60 w-1/2\" : \"w-full\")}\n >\n <div\n className={cn(\n \"h-[40px] border py-1.5 px-2 text-white bg-primary-800 dark:bg-black-700 flex justify-between items-center\"\n )}\n >\n <div className=\"flex items-center\">\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={20} />\n </IconButton>\n <div className=\"flex items-center gap-1.5 ml-2\">\n <span className=\"text-primary-600 dark:text-black-100 bg-primary-50 dark:bg-black-800 border-primary-200 dark:border-black-800 text-xs leading-4 font-normal border rounded-full pr-2 pl-2\">\n {selectedItemsCount || 0}\n </span>\n <Typography\n size=\"extra-small\"\n appearance=\"custom\"\n className=\"text-white\"\n >\n {t(\"Selected\")}\n </Typography>\n </div>\n </div>\n <div\n ref={actionContainerRef}\n className={cn(\n \"h-[36px] flex items-center rounded-full font-inter\",\n showActionBg\n ? \"bg-primary-900 dark:bg-black-800 px-[10px] rounded-[43px]\"\n : \"\"\n )}\n >\n {showButtons ? (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className=\"flex bg-primary-800 dark:bg-black-800 px-4 rounded-full\"\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 mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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-500\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center\"\n >\n {button.icon}\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit ml-1.5\"}\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 mx-1 gap-1.5 py-1 pr-3 pl-2 rounded-md text-white hover:text-primary-50 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 Permanently\") &&\n \"!text-error-500\",\n button.disabled && \"opacity-70\"\n )}\n >\n <Tooltip\n hideTooltip={!button.tooltip}\n title={button.tooltip}\n className=\"flex items-center\"\n >\n {button.icon}\n\n {!button?.hideLabel && button.label && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={\"text-inherit ml-1.5\"}\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-1.5 py-1 pr-3 pl-2 rounded-md 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-500\"\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-primary-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-1.5 py-1 pr-3 pl-2 rounded-md 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-500\"\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,EAAC;AAAA,EAAA;AAAA,IACC,QAAO;AAAA,IACP,OAAM;AAAA,IACN,SAAQ;AAAA,IACR,WAAU;AAAA,IACV,WAAAD;AAAA,IAEA,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MA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A;AAAA,oCACC,MAAK;AAAA,oCACL,SAAQ;AAAA,oCACR,WAAU;AAAA,oCAET,YAAE,SAAS;AAAA,kCAAA;AAAA,gCAAA;AAAA,gCAEd,gBAAAlC;AAAA,kCAACC;AAAA,kCAAA;AAAA,oCACC,MAAK;AAAA,oCACL,WAAU;AAAA,kCAAA;AAAA,gCAAA;AAAA,8BACZ;AAAA,4BAAA;AAAA,0BAAA;AAAA,wBACF;AAAA,sBAAA;AAAA,sBAEDQ,IACC,gBAAAuB;AAAA,wBAAC;AAAA,wBAAA;AAAA,0BACC,IAAI,oBAAoBR,EAAmB,KAAK;AAAA,0BAChD,SAASA,EAAmB;AAAA,0BAC5B,UAAUA,EAAmB;AAAA,0BAC7B,WAAWO;AAAA,4BACT;AAAA,4BACAP,EAAmB,YAAY;AAAA,0BAAA;AAAA,0BAEjC,MAAK;AAAA,0BAEJ,UAAA;AAAA,4BAAAA,EAAmB;AAAA,4BACpB,gBAAAxB;AAAA,8BAACkC;AAAA,8BAAA;AAAA,gCACC,MAAK;AAAA,gCACL,SAAQ;AAAA,gCACR,WAAU;AAAA,gCACV,YAAW;AAAA,gCAEV,UAAAV,EAAmB;AAAA,8BAAA;AAAA,4BAAA;AAAA,0BACtB;AAAA,wBAAA;AAAA,sBAAA,IAEA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACN;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA,IAlPW;AAqPjB;AAEAtB,EAAY,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),D=require("react-debounce-input"),E=require("react-i18next"),L=require("antd"),u=require("../../../_virtual/index.cjs.js"),t=require("../../data-display/typography/Typography.cjs.js"),M=require("../../icons/CloseRounded.cjs.js"),O=require("../../icons/SearchIcon.cjs.js"),W=r=>{const{value:s,placeholder:w,onChange:m,id:T,debounceTimeout:S=0,classValues:h,handleKeyDown:p,isClearable:c,onFocusText:C,autoComplete:B="false",searchRef:f,hasNavigation:g=!1,autoFocus:R=!1,searchConfig:F,hideSearchIcon:y,allowAStarSearch:j=!1,...q}=r,{t:n}=E.useTranslation(),[b,l]=x.useState(!1),[A,k]=x.useState("search"),N=x.useRef(null),{searchCount:i,searchPointer:d,setSearchPointer:o}=F||{},I=()=>{const a=c&&!!s,v=g&&!!s;return a&&v?"pr-28":v?"pr-12":a?"pr-8":"pr-7"},P=()=>{l(!0),k(C||w||n("Search"));const a=f||N;a.current&&a.current.focus()},z=()=>{l(!1),k("")};return e.jsxs("label",{className:u("relative flex items-center justify-start px-4 py-[9px] w-full bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8",h),children:[!y&&e.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:e.jsx(O.SearchIcon,{width:"16",height:"16"})}),e.jsx(D.DebounceInput,{...q,spellCheck:"false",debounceTimeout:S,id:T,inputRef:f||N,type:"text",className:u(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${y?"pl-2":"pl-10"} pl-10 ${I()} w-full text-sm dark:text-white bg-transparent rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500`,"border border-solid","dark:border-neutral-800 border-neutral-200","dark:caret-white",h),onKeyDown:a=>{a.key==="Enter"&&a.preventDefault(),p&&p(a)},value:s||"",placeholder:b?A:j?"":`${n("Search")}`,onChange:a=>m?.(a.target.value),autoComplete:B,onFocus:a=>{l(!0),P(),r.onFocus&&r.onFocus(a)},onBlur:a=>{l(!1),z(),r.onBlur&&r.onBlur(a)},autoFocus:R}),g&&s&&e.jsxs("div",{className:u("absolute mr-2 focus:outline-none flex gap-1",c?"right-6":"right-0"),children:[!!i&&(i||0)>0&&e.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(d||0)+1,"/",i]}),e.jsxs("div",{className:"flex gap-1 items-center",children:[e.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{o&&o(a=>(a||0)-1)},disabled:d===0,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{o&&o(a=>(a||0)+1)},disabled:d===(i||0)-1,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),j&&!(c&&s)&&!b&&!s?e.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[e.jsxs(t.Typography,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[n("Search")," (use"]}),e.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:e.jsx(L.Tooltip,{placement:"bottomRight",color:"#141414",classNames:{root:"custom-tooltip dark:!bg-black-800"},title:e.jsxs("div",{className:"flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800 min-w-80 min-h-fit",children:[e.jsx(t.Typography,{variant:"semibold",size:"extra-small",className:"text-white",children:n("Normal Search")}),e.jsx(t.Typography,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",appearance:"custom",children:n("Examples")}),e.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter",appearance:"custom",children:"data"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "data", "Data".'})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter",appearance:"custom",children:"text"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "text", "context", "plaintext".'})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter",appearance:"custom",children:"base"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "database", "baseball", "basename".'})]})]}),e.jsx("div",{className:"h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2"}),e.jsx(t.Typography,{variant:"semibold",size:"extra-small",className:"text-white",children:"Wildcard Search"}),e.jsx(t.Typography,{variant:"medium",size:"extra-small",className:"text-white dark:text-black-200",appearance:"custom",children:"Use * as a wildcard to refine your search."}),e.jsx(t.Typography,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",appearance:"custom",children:"Examples:"}),e.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter ",appearance:"custom",children:"contract*"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ "contracts", "contractor", "CONTRACTOR".'})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter ",appearance:"custom",children:"*agreement"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "service agreement", "legal agreement".'})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter",appearance:"custom",children:"*clause*"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "clause", "subclause", "clauses".'})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter",appearance:"custom",children:"*l*s*"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "clause", "clauses".'})]})]})]}),children:e.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})})}),e.jsx(t.Typography,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):c&&s&&e.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>m?.(""),children:e.jsx(M.CloseRounded,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};exports.SearchBar=W;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),D=require("react-debounce-input"),E=require("react-i18next"),L=require("antd"),u=require("../../../_virtual/index.cjs.js"),t=require("../../data-display/typography/Typography.cjs.js"),M=require("../../icons/CloseRounded.cjs.js"),O=require("../../icons/SearchIcon.cjs.js"),W=r=>{const{value:s,placeholder:w,onChange:m,id:T,debounceTimeout:S=0,classValues:h,handleKeyDown:p,isClearable:c,onFocusText:C,autoComplete:B="false",searchRef:f,hasNavigation:g=!1,autoFocus:R=!1,searchConfig:F,hideSearchIcon:y,allowAStarSearch:j=!1,...q}=r,{t:n}=E.useTranslation(),[b,l]=x.useState(!1),[A,k]=x.useState("search"),N=x.useRef(null),{searchCount:i,searchPointer:d,setSearchPointer:o}=F||{},I=()=>{const a=c&&!!s,v=g&&!!s;return a&&v?"pr-28":v?"pr-12":a?"pr-8":"pr-7"},P=()=>{l(!0),k(C||w||n("Search"));const a=f||N;a.current&&a.current.focus()},z=()=>{l(!1),k("")};return e.jsxs("label",{className:u("relative flex items-center justify-start px-4 py-[9px] w-full bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8",h),children:[!y&&e.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:e.jsx(O.SearchIcon,{width:"16",height:"16"})}),e.jsx(D.DebounceInput,{...q,spellCheck:"false",debounceTimeout:S,id:T,inputRef:f||N,type:"text",className:u(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${y?"pl-2":"pl-10"} pl-10 ${I()} w-full text-sm dark:text-white bg-transparent rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500`,"border border-solid","dark:border-neutral-800 border-neutral-200","dark:caret-white",h),onKeyDown:a=>{a.key==="Enter"&&a.preventDefault(),p&&p(a)},value:s||"",placeholder:b?A:j?"":`${n("Search")}`,onChange:a=>m?.(a.target.value),autoComplete:B,onFocus:a=>{l(!0),P(),r.onFocus&&r.onFocus(a)},onBlur:a=>{l(!1),z(),r.onBlur&&r.onBlur(a)},autoFocus:R}),g&&s&&e.jsxs("div",{className:u("absolute mr-2 focus:outline-none flex items-center gap-1",c?"right-6":"right-0"),children:[!!i&&(i||0)>0&&e.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(d||0)+1,"/",i]}),e.jsxs("div",{className:"flex gap-1 items-center",children:[e.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{o&&o(a=>(a||0)-1)},disabled:d===0,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{o&&o(a=>(a||0)+1)},disabled:d===(i||0)-1,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),j&&!(c&&s)&&!b&&!s?e.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[e.jsxs(t.Typography,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[n("Search")," (use"]}),e.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:e.jsx(L.Tooltip,{placement:"bottomRight",color:"#141414",classNames:{root:"custom-tooltip dark:!bg-black-800"},title:e.jsxs("div",{className:"flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800 min-w-80 min-h-fit",children:[e.jsx(t.Typography,{variant:"semibold",size:"extra-small",className:"text-white",children:n("Normal Search")}),e.jsx(t.Typography,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",appearance:"custom",children:n("Examples")}),e.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter",appearance:"custom",children:"data"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "data", "Data".'})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter",appearance:"custom",children:"text"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "text", "context", "plaintext".'})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter",appearance:"custom",children:"base"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "database", "baseball", "basename".'})]})]}),e.jsx("div",{className:"h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2"}),e.jsx(t.Typography,{variant:"semibold",size:"extra-small",className:"text-white",children:"Wildcard Search"}),e.jsx(t.Typography,{variant:"medium",size:"extra-small",className:"text-white dark:text-black-200",appearance:"custom",children:"Use * as a wildcard to refine your search."}),e.jsx(t.Typography,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",appearance:"custom",children:"Examples:"}),e.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter ",appearance:"custom",children:"contract*"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ "contracts", "contractor", "CONTRACTOR".'})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter ",appearance:"custom",children:"*agreement"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "service agreement", "legal agreement".'})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter",appearance:"custom",children:"*clause*"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "clause", "subclause", "clauses".'})]}),e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[e.jsx(t.Typography,{className:"flex-shrink-0",appearance:"custom",children:"•"}),e.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:e.jsx(t.Typography,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-4 font-inter",appearance:"custom",children:"*l*s*"})}),e.jsx(t.Typography,{className:"text-white dark:text-black-100 text-xs font-medium leading-4 font-inter",appearance:"custom",children:'→ finds "clause", "clauses".'})]})]})]}),children:e.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})})}),e.jsx(t.Typography,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):c&&s&&e.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>m?.(""),children:e.jsx(M.CloseRounded,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};exports.SearchBar=W;
2
2
  //# sourceMappingURL=SearchBar.cjs.js.map