@cloudwick/astral-ui-cli 2.0.1 → 2.2.0

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 (44) hide show
  1. package/README.md +17 -5
  2. package/dist/index.js +1235 -139
  3. package/dist/index.js.map +1 -1
  4. package/dist/templates/constants/index.ts +1 -0
  5. package/dist/templates/constants/keyboardKey.ts +1 -0
  6. package/dist/templates/css/fonts.min.css +1 -1
  7. package/dist/templates/fonts/NotoSans-Bold.woff2 +0 -0
  8. package/dist/templates/fonts/NotoSans-BoldItalic.woff2 +0 -0
  9. package/dist/templates/fonts/NotoSans-Italic.woff2 +0 -0
  10. package/dist/templates/fonts/NotoSans-Medium.woff2 +0 -0
  11. package/dist/templates/fonts/NotoSans-MediumItalic.woff2 +0 -0
  12. package/dist/templates/fonts/NotoSans-Regular.woff2 +0 -0
  13. package/dist/templates/fonts/NotoSans-SemiBold.woff2 +0 -0
  14. package/dist/templates/fonts/NotoSans-SemiBoldItalic.woff2 +0 -0
  15. package/dist/templates/hooks/index.ts +20 -1
  16. package/dist/templates/hooks/useAsyncOptions.ts +346 -0
  17. package/dist/templates/hooks/useAsyncOptionsReducer.ts +182 -0
  18. package/dist/templates/hooks/useAvailableProjection.ts +77 -0
  19. package/dist/templates/hooks/useDebouncedCallback.ts +42 -0
  20. package/dist/templates/hooks/useFilterQuery.ts +145 -0
  21. package/dist/templates/hooks/useIgnoredPropWarning.ts +17 -0
  22. package/dist/templates/hooks/useInfiniteScroll.ts +63 -0
  23. package/dist/templates/hooks/useIsTruncated.ts +63 -0
  24. package/dist/templates/hooks/useListboxKeyboardNav.ts +120 -0
  25. package/dist/templates/hooks/useOnValueChange.ts +17 -0
  26. package/dist/templates/hooks/usePrefetchBaseline.ts +38 -0
  27. package/dist/templates/schema/components-config.schema.json +3 -0
  28. package/dist/templates/tailwind/tailwind.config.js +8 -8
  29. package/dist/templates/utils/devWarn.ts +9 -0
  30. package/dist/templates/utils/elementUtils.ts +26 -0
  31. package/dist/templates/utils/index.ts +7 -1
  32. package/dist/templates/utils/matchesQuery.ts +23 -0
  33. package/dist/templates/utils/mergeUnique.ts +24 -0
  34. package/dist/templates/utils/resolveLoadErrors.ts +40 -0
  35. package/dist/templates/utils/resolveReloadControls.ts +31 -0
  36. package/package.json +2 -2
  37. package/dist/templates/fonts/Inter_18pt-Bold.ttf +0 -0
  38. package/dist/templates/fonts/Inter_18pt-BoldItalic.ttf +0 -0
  39. package/dist/templates/fonts/Inter_18pt-Italic.ttf +0 -0
  40. package/dist/templates/fonts/Inter_18pt-Medium.ttf +0 -0
  41. package/dist/templates/fonts/Inter_18pt-MediumItalic.ttf +0 -0
  42. package/dist/templates/fonts/Inter_18pt-Regular.ttf +0 -0
  43. package/dist/templates/fonts/Inter_18pt-SemiBold.ttf +0 -0
  44. package/dist/templates/fonts/Inter_18pt-SemiBoldItalic.ttf +0 -0
package/dist/index.js CHANGED
@@ -150,6 +150,67 @@ var init_project_info = __esm({
150
150
  }
151
151
  });
152
152
 
153
+ // src/utils/components-config.ts
154
+ var components_config_exports = {};
155
+ __export(components_config_exports, {
156
+ generateComponentsConfig: () => generateComponentsConfig,
157
+ getDefaultConfig: () => getDefaultConfig
158
+ });
159
+ function normalizePath(path12) {
160
+ return path12.replace(/^\/+|\/+$/g, "");
161
+ }
162
+ function getDefaultConfig(projectInfo) {
163
+ const componentPath = projectInfo.isNextJs ? "components/ui" : "src/components/ui";
164
+ const utilsPath = projectInfo.isNextJs ? "lib/utils" : projectInfo.isVite ? "src/utils" : "src/utils";
165
+ const cleanUtilsPath = utilsPath.replace(/\.(ts|js)$/, "");
166
+ const constantsPath = projectInfo.isNextJs ? "lib/constants" : "src/constants";
167
+ const hooksPath = projectInfo.isNextJs ? "lib/hooks" : "src/hooks";
168
+ let tailwindConfig = "tailwind.config.js";
169
+ if (projectInfo.typescript) {
170
+ tailwindConfig = "tailwind.config.ts";
171
+ }
172
+ const cssPath = projectInfo.isNextJs ? "app/globals.css" : "src/assets/css/index.css";
173
+ return {
174
+ tailwindConfig,
175
+ cssPath,
176
+ componentsPath: componentPath,
177
+ utilsPath: cleanUtilsPath,
178
+ constantsPath,
179
+ hooksPath
180
+ };
181
+ }
182
+ function generateComponentsConfig({
183
+ projectInfo,
184
+ userInputs
185
+ }) {
186
+ const defaults = getDefaultConfig(projectInfo);
187
+ const tailwindConfig = normalizePath(userInputs?.tailwindConfig ?? defaults.tailwindConfig);
188
+ const cssPath = normalizePath(userInputs?.cssPath ?? defaults.cssPath);
189
+ const componentsPath = normalizePath(userInputs?.componentsPath ?? defaults.componentsPath);
190
+ const utilsPath = normalizePath(userInputs?.utilsPath ?? defaults.utilsPath);
191
+ const constantsPath = normalizePath(userInputs?.constantsPath ?? defaults.constantsPath);
192
+ const hooksPath = normalizePath(userInputs?.hooksPath ?? defaults.hooksPath);
193
+ return {
194
+ $schema: "./schema/components-config.schema.json",
195
+ tailwind: {
196
+ config: tailwindConfig,
197
+ css: cssPath
198
+ },
199
+ aliases: {
200
+ components: componentsPath,
201
+ utils: utilsPath,
202
+ constants: constantsPath,
203
+ hooks: hooksPath
204
+ }
205
+ };
206
+ }
207
+ var init_components_config = __esm({
208
+ "src/utils/components-config.ts"() {
209
+ "use strict";
210
+ init_cjs_shims();
211
+ }
212
+ });
213
+
153
214
  // src/index.ts
154
215
  init_cjs_shims();
155
216
  var import_commander4 = require("commander");
@@ -536,11 +597,13 @@ async function copyTemplateFiles({
536
597
  console.info(import_chalk2.default.gray(` Directory: ${cwd}`));
537
598
  const { getProjectInfo: getProjectInfo2 } = await Promise.resolve().then(() => (init_project_info(), project_info_exports));
538
599
  const projectInfo = await getProjectInfo2(cwd);
539
- let utilsPath = projectInfo.isNextJs ? "lib/utils" : "src/utils";
600
+ const { getDefaultConfig: getDefaultConfig2 } = await Promise.resolve().then(() => (init_components_config(), components_config_exports));
601
+ const defaults = getDefaultConfig2(projectInfo);
602
+ let utilsPath = defaults.utilsPath;
540
603
  let cssPath = "src/assets/css/index.css";
541
604
  let componentsPath = "src/components/ui";
542
- let constantsPath = projectInfo.isNextJs ? "lib/constants" : "src/constants";
543
- let hooksPath = projectInfo.isNextJs ? "lib/hooks" : "src/hooks";
605
+ let constantsPath = defaults.constantsPath;
606
+ let hooksPath = defaults.hooksPath;
544
607
  let tailwindConfigFilename;
545
608
  try {
546
609
  const configPath = import_path4.default.join(cwd, "components.json");
@@ -720,58 +783,15 @@ async function copyTemplateFiles({
720
783
  }
721
784
  }
722
785
 
723
- // src/utils/components-config.ts
724
- init_cjs_shims();
725
- function normalizePath(path12) {
726
- return path12.replace(/^\/+|\/+$/g, "");
727
- }
728
- function getDefaultConfig(projectInfo) {
729
- const componentPath = projectInfo.isNextJs ? "components/ui" : "src/components/ui";
730
- const utilsPath = projectInfo.isNextJs ? "lib/utils" : projectInfo.isVite ? "src/utils" : "src/utils";
731
- const cleanUtilsPath = utilsPath.replace(/\.(ts|js)$/, "");
732
- const constantsPath = projectInfo.isNextJs ? "lib/constants" : "src/constants";
733
- let tailwindConfig = "tailwind.config.js";
734
- if (projectInfo.typescript) {
735
- tailwindConfig = "tailwind.config.ts";
736
- }
737
- const cssPath = projectInfo.isNextJs ? "app/globals.css" : "src/assets/css/index.css";
738
- return {
739
- tailwindConfig,
740
- cssPath,
741
- componentsPath: componentPath,
742
- utilsPath: cleanUtilsPath,
743
- constantsPath
744
- };
745
- }
746
- function generateComponentsConfig({
747
- projectInfo,
748
- userInputs
749
- }) {
750
- const defaults = getDefaultConfig(projectInfo);
751
- const tailwindConfig = normalizePath(userInputs?.tailwindConfig ?? defaults.tailwindConfig);
752
- const cssPath = normalizePath(userInputs?.cssPath ?? defaults.cssPath);
753
- const componentsPath = normalizePath(userInputs?.componentsPath ?? defaults.componentsPath);
754
- const utilsPath = normalizePath(userInputs?.utilsPath ?? defaults.utilsPath);
755
- const constantsPath = normalizePath(userInputs?.constantsPath ?? defaults.constantsPath);
756
- return {
757
- $schema: "./schema/components-config.schema.json",
758
- tailwind: {
759
- config: tailwindConfig,
760
- css: cssPath
761
- },
762
- aliases: {
763
- components: componentsPath,
764
- utils: utilsPath,
765
- constants: constantsPath
766
- }
767
- };
768
- }
786
+ // src/commands/init.ts
787
+ init_components_config();
769
788
 
770
789
  // src/utils/display-alias-instructions.ts
771
790
  init_cjs_shims();
772
791
  var import_chalk3 = __toESM(require("chalk"));
773
792
  var import_fs_extra5 = __toESM(require("fs-extra"));
774
793
  var import_path5 = __toESM(require("path"));
794
+ init_components_config();
775
795
  init_project_info();
776
796
  async function displayAliasInstructions({
777
797
  cwd,
@@ -808,10 +828,16 @@ async function displayAliasInstructions({
808
828
  const utilsPath = import_path5.default.relative(".", config.aliases.utils);
809
829
  const constantsPath = import_path5.default.relative(".", config.aliases.constants);
810
830
  const projectInfo = await getProjectInfo(cwd);
831
+ const hooksPath = import_path5.default.relative(
832
+ ".",
833
+ config.aliases.hooks ?? getDefaultConfig(projectInfo).hooksPath
834
+ );
811
835
  const extension = projectInfo.typescript ? ".ts" : ".js";
812
836
  console.info(import_chalk3.default.cyan("Detected paths:\n"));
813
837
  console.info(import_chalk3.default.gray(` \u2022 Components: ${componentsPath}`));
814
838
  console.info(import_chalk3.default.gray(` \u2022 Utils: ${utilsPath}`));
839
+ console.info(import_chalk3.default.gray(` \u2022 Constants: ${constantsPath}`));
840
+ console.info(import_chalk3.default.gray(` \u2022 Hooks: ${hooksPath}`));
815
841
  console.info(import_chalk3.default.gray(" \u2022 The utils alias points to the utils directory\n"));
816
842
  if (hasTsConfig || hasJsConfig || projectType === "next.js") {
817
843
  const configFile = hasTsConfig ? "tsconfig.json" : "jsconfig.json";
@@ -826,7 +852,8 @@ async function displayAliasInstructions({
826
852
  "@components/*": ["${componentsPath}/*"],
827
853
  "@utils": ["${utilsPath}"],
828
854
  "@constants": ["${constantsPath}"],
829
- "@constants/*": ["${constantsPath}/*"]
855
+ "@constants/*": ["${constantsPath}/*"],
856
+ "@hooks": ["${hooksPath}"]
830
857
  }
831
858
  }
832
859
  }
@@ -862,7 +889,8 @@ async function displayAliasInstructions({
862
889
  "@components/*": ["${componentsPath}/*"],
863
890
  "@utils": ["${utilsPath}"],
864
891
  "@constants": ["${constantsPath}"],
865
- "@constants/*": ["${constantsPath}/*"]
892
+ "@constants/*": ["${constantsPath}/*"],
893
+ "@hooks": ["${hooksPath}"]
866
894
  }
867
895
  }
868
896
  }
@@ -880,7 +908,8 @@ resolve: {
880
908
  alias: {
881
909
  '@components': path.resolve(__dirname, '${componentsPath}'),
882
910
  '@utils': path.resolve(__dirname, '${utilsPath}'),
883
- '@constants': path.resolve(__dirname, '${constantsPath}')
911
+ '@constants': path.resolve(__dirname, '${constantsPath}'),
912
+ '@hooks': path.resolve(__dirname, '${hooksPath}')
884
913
  }
885
914
  }
886
915
 
@@ -915,7 +944,8 @@ resolve: {
915
944
  alias: {
916
945
  '@components': path.resolve(__dirname, '${componentsPath}'),
917
946
  '@utils': path.resolve(__dirname, '${utilsPath}'),
918
- '@constants': path.resolve(__dirname, '${constantsPath}')
947
+ '@constants': path.resolve(__dirname, '${constantsPath}'),
948
+ '@hooks': path.resolve(__dirname, '${hooksPath}')
919
949
  }
920
950
  }
921
951
  `));
@@ -954,7 +984,8 @@ Option 1: Use CRACO (Create React App Configuration Override)
954
984
  alias: {
955
985
  '@components': path.resolve(__dirname, '${componentsPath}'),
956
986
  '@utils': path.resolve(__dirname, '${utilsPath}'),
957
- '@constants': path.resolve(__dirname, '${constantsPath}')
987
+ '@constants': path.resolve(__dirname, '${constantsPath}'),
988
+ '@hooks': path.resolve(__dirname, '${hooksPath}')
958
989
  }
959
990
  }
960
991
  };
@@ -985,13 +1016,21 @@ Option 1: Use CRACO (Create React App Configuration Override)
985
1016
  console.info(import_chalk3.default.white(`
986
1017
  import { Button } from '@components/button';
987
1018
  import { cn } from '@utils';
1019
+ import { keyboardKeys } from '@constants';
1020
+ import { useWindowSize } from '@hooks';
988
1021
  `));
1022
+ console.info(
1023
+ import_chalk3.default.gray(
1024
+ "\n Note: Components such as Select, TransferList and MultiSelectTransfer import\n shared hooks from '@hooks', so this alias is required for them to resolve.\n"
1025
+ )
1026
+ );
989
1027
  }
990
1028
 
991
1029
  // src/utils/prompt-config.ts
992
1030
  init_cjs_shims();
993
1031
  var import_prompts = __toESM(require("prompts"));
994
1032
  var import_chalk4 = __toESM(require("chalk"));
1033
+ init_components_config();
995
1034
  async function promptForConfig({
996
1035
  projectInfo,
997
1036
  skipPrompts = false
@@ -1041,6 +1080,13 @@ async function promptForConfig({
1041
1080
  message: "Constants directory:",
1042
1081
  initial: defaults.constantsPath,
1043
1082
  validate: (value) => value.trim().length > 0 || "Path cannot be empty"
1083
+ },
1084
+ {
1085
+ type: "text",
1086
+ name: "hooksPath",
1087
+ message: "Hooks directory:",
1088
+ initial: defaults.hooksPath,
1089
+ validate: (value) => value.trim().length > 0 || "Path cannot be empty"
1044
1090
  }
1045
1091
  ], {
1046
1092
  onCancel: () => {
@@ -1055,7 +1101,7 @@ async function promptForConfig({
1055
1101
  `));
1056
1102
  return void 0;
1057
1103
  }
1058
- if (!responses || !responses.tailwindConfig || !responses.cssPath || !responses.componentsPath || !responses.utilsPath || !responses.constantsPath) {
1104
+ if (!responses || !responses.tailwindConfig || !responses.cssPath || !responses.componentsPath || !responses.utilsPath || !responses.constantsPath || !responses.hooksPath) {
1059
1105
  console.info(import_chalk4.default.yellow("\n\u26A0\uFE0F Configuration incomplete. Using defaults.\n"));
1060
1106
  return void 0;
1061
1107
  }
@@ -1064,14 +1110,15 @@ async function promptForConfig({
1064
1110
  cssPath: responses.cssPath,
1065
1111
  componentsPath: responses.componentsPath,
1066
1112
  utilsPath: responses.utilsPath,
1067
- constantsPath: responses.constantsPath
1113
+ constantsPath: responses.constantsPath,
1114
+ hooksPath: responses.hooksPath
1068
1115
  };
1069
1116
  }
1070
1117
 
1071
1118
  // package.json
1072
1119
  var package_default = {
1073
1120
  name: "@cloudwick/astral-ui-cli",
1074
- version: "2.0.1",
1121
+ version: "2.2.0",
1075
1122
  description: "CLI for installing Astral UI components in any codebase",
1076
1123
  main: "dist/index.js",
1077
1124
  bin: {
@@ -1361,7 +1408,7 @@ var REGISTRY = {
1361
1408
  },
1362
1409
  {
1363
1410
  "name": "accordion.tsx",
1364
- "content": 'import * as React from "react";\nimport { useEffect, useState, useMemo, Children, type ReactElement } from "react";\nimport { cn } from "tailwind-variants";\n\nimport { ADPIcon, iconList } from "../adpIcon";\nimport { Button } from "../button";\nimport { accordionVariants } from "./accordionVariants";\n\nexport type TAccordionSize = "xs" | "sm" | "md" | "lg" | "xl";\n\nexport interface IAccordionHeaderProps {\n children: React.ReactNode;\n /**\n * Overwrite the styles for AccordionHeader by passing space separated class names\n */\n className?: string;\n}\n\nconst AccordionHeader = React.forwardRef<\n HTMLSpanElement,\n IAccordionHeaderProps\n>(({ children, className }, ref ) => (\n <span ref={ref} className={className}>{children}</span>\n));\n\nAccordionHeader.displayName = "AccordionHeader";\n\nexport interface IAccordionBodyProps {\n children: React.ReactNode | React.ReactElement;\n /**\n * Overwrite the styles for AccordionBody by passing space separated class names\n */\n className?: string;\n}\n\nconst AccordionBody = React.forwardRef<\n HTMLDivElement,\n IAccordionBodyProps\n>(({ children, className }, ref ) => (\n <div ref={ref} className={className}>{children}</div>\n));\n\nAccordionBody.displayName = "AccordionBody";\n\nexport interface IAccordionProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: Array<ReactElement<IAccordionBodyProps | IAccordionHeaderProps>>;\n /**\n * Expand or collapse the Accordion\n */\n expand?: boolean;\n /**\n * Set it to false if you want the Accordion to Expand or Collapse only on click of the arrow\n */\n clickableHeader?: boolean;\n /**\n * Size of the Accordion Header (Text and Spacing)\n * @default sm\n */\n size?: TAccordionSize;\n /**\n * Overwrite the styles for Accordion by passing space separated class names\n */\n className?: string;\n}\n\nconst arrowSizeMapping: Record<TAccordionSize, "xs" | "sm"> = {\n xs: "xs",\n sm: "xs",\n md: "xs",\n lg: "sm",\n xl: "sm"\n};\n\nconst AccordionComponent = React.forwardRef<HTMLDivElement, IAccordionProps>(\n ({\n children,\n expand,\n clickableHeader = true,\n className,\n size = "sm",\n ...props\n }, ref ) => {\n const [ expanded, setExpanded ] = useState<boolean>( false );\n const [ bodyProps, setBodyProps ] = useState<IAccordionBodyProps>();\n const [ headerProps, setHeaderProps ] = useState<IAccordionBodyProps>();\n\n const clickHandler = () => setExpanded(( isExpanded ) => !isExpanded );\n\n useEffect(() => setExpanded( Boolean( expand )), [expand]);\n\n useEffect(() => {\n if ( children ) {\n Children.forEach( children, ( child: ReactElement<IAccordionBodyProps | IAccordionHeaderProps> ) => {\n if ( child.type === AccordionHeader || child.type === ( Accordion as any ).Header ) {\n setHeaderProps( child.props );\n } else if ( child.type === AccordionBody || child.type === ( Accordion as any ).Body ) {\n setBodyProps( child.props );\n }\n });\n }\n }, [children]);\n\n const { base, header, content } = useMemo(\n () => accordionVariants({ size, expanded }),\n [ size, expanded ]\n );\n\n if ( !children ) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={base({ class: className })}\n {...props}\n >\n {clickableHeader ? (\n <button\n onClick={clickHandler}\n type="button"\n className={header({ class: [ "w-full justify-start", headerProps?.className ] })}\n aria-expanded={expanded ? "true" : "false"}\n aria-controls="bodySection"\n data-testid="accordionHeader"\n >\n <ADPIcon\n className={cn(\n "text-gray-500 dark:text-gray-800 transition-all duration-700 rtl:rotate-180",\n expanded && "rotate-90"\n )}\n size={arrowSizeMapping[size]}\n icon={iconList.rightArrow}\n fixedWidth\n />\n {headerProps?.children}\n </button>\n ) : (\n <div\n aria-expanded={expanded ? "true" : "false"}\n aria-controls="bodySection"\n className={header({ class: headerProps?.className })}\n data-testid="accordionHeader"\n >\n <Button variant="text" onClick={clickHandler} color="secondary">\n <ADPIcon\n className={cn(\n "text-gray-500 dark:text-gray-800 transition-all duration-700 rtl:rotate-180",\n expanded && "rotate-90"\n )}\n size={arrowSizeMapping[size]}\n icon={iconList.rightArrow}\n fixedWidth\n />\n </Button>\n {headerProps?.children}\n </div>\n )}\n\n <div\n data-testid="accordionBody"\n className={content({ class: bodyProps?.className })}\n >\n {expanded && bodyProps?.children}\n </div>\n </div>\n );\n }\n);\n\nAccordionComponent.displayName = "Accordion";\n\n// Define the type that includes subcomponents\nexport interface IAccordionType extends React.ForwardRefExoticComponent<IAccordionProps & React.RefAttributes<HTMLDivElement>> {\n Header: typeof AccordionHeader;\n Body: typeof AccordionBody;\n}\n\n// Add subcomponents with type assertion\n( AccordionComponent as any ).Header = AccordionHeader;\n( AccordionComponent as any ).Body = AccordionBody;\n\n// Export with proper type\nexport const Accordion = AccordionComponent as IAccordionType;\n'
1411
+ "content": 'import * as React from "react";\nimport { useEffect, useState, useMemo, Children, type ReactElement } from "react";\nimport { cn } from "tailwind-variants";\n\nimport { ADPIcon, iconList } from "../adpIcon";\nimport { Button } from "../button";\nimport { accordionVariants } from "./accordionVariants";\n\nexport type TAccordionSize = "xs" | "sm" | "md" | "lg" | "xl";\n\nexport interface IAccordionHeaderProps {\n children: React.ReactNode;\n /**\n * Overwrite the styles for AccordionHeader by passing space separated class names\n */\n className?: string;\n}\n\nconst AccordionHeader = React.forwardRef<\n HTMLSpanElement,\n IAccordionHeaderProps\n>(({ children, className }, ref ) => (\n <span ref={ref} className={className}>{children}</span>\n));\n\nAccordionHeader.displayName = "AccordionHeader";\n\nexport interface IAccordionBodyProps {\n children: React.ReactNode | React.ReactElement;\n /**\n * Overwrite the styles for AccordionBody by passing space separated class names\n */\n className?: string;\n /**\n * Optional aria label for the accordion body\n */\n "aria-label"?: string;\n}\n\nconst AccordionBody = React.forwardRef<\n HTMLDivElement,\n IAccordionBodyProps\n>(({ children, className }, ref ) => (\n <div ref={ref} className={className}>{children}</div>\n));\n\nAccordionBody.displayName = "AccordionBody";\n\nexport interface IAccordionProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: Array<ReactElement<IAccordionBodyProps | IAccordionHeaderProps>>;\n /**\n * Expand or collapse the Accordion\n */\n expand?: boolean;\n /**\n * Set it to false if you want the Accordion to Expand or Collapse only on click of the arrow\n */\n clickableHeader?: boolean;\n /**\n * Size of the Accordion Header (Text and Spacing)\n * @default sm\n */\n size?: TAccordionSize;\n /**\n * Overwrite the styles for Accordion by passing space separated class names\n */\n className?: string;\n}\n\nconst arrowSizeMapping: Record<TAccordionSize, "xs" | "sm"> = {\n xs: "xs",\n sm: "xs",\n md: "xs",\n lg: "sm",\n xl: "sm"\n};\n\nexport interface IAccordionType extends React.ForwardRefExoticComponent<\n React.PropsWithoutRef<IAccordionProps> & React.RefAttributes<HTMLDivElement>\n> {\n Header: typeof AccordionHeader;\n Body: typeof AccordionBody;\n}\n\nexport const Accordion = React.forwardRef<HTMLDivElement, IAccordionProps>(\n ({\n children,\n expand,\n clickableHeader = true,\n className,\n size = "sm",\n ...props\n }, ref ) => {\n const [ expanded, setExpanded ] = useState<boolean>( false );\n const [ bodyProps, setBodyProps ] = useState<IAccordionBodyProps>();\n const [ headerProps, setHeaderProps ] = useState<IAccordionBodyProps>();\n\n // Stable ids to wire the header control and the body region together\n const bodyId = React.useId();\n const headerId = React.useId();\n\n const clickHandler = () => setExpanded(( isExpanded ) => !isExpanded );\n\n useEffect(() => setExpanded( Boolean( expand )), [expand]);\n\n useEffect(() => {\n if ( children ) {\n Children.forEach( children, ( child: ReactElement<IAccordionBodyProps | IAccordionHeaderProps> ) => {\n if ( child.type === AccordionHeader || child.type === Accordion.Header ) {\n setHeaderProps( child.props );\n } else if ( child.type === AccordionBody || child.type === Accordion.Body ) {\n setBodyProps( child.props );\n }\n });\n }\n }, [children]);\n\n const { base, header, content } = useMemo(\n () => accordionVariants({ size, expanded }),\n [ size, expanded ]\n );\n\n if ( !children ) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={base({ class: className })}\n {...props}\n >\n {clickableHeader ? (\n <button\n id={headerId}\n onClick={clickHandler}\n type="button"\n className={header({ class: [ "w-full justify-start", headerProps?.className ] })}\n aria-expanded={expanded ? "true" : "false"}\n aria-controls={bodyId}\n data-testid="accordionHeader"\n >\n <ADPIcon\n className={cn(\n "text-gray-500 dark:text-gray-800 transition-all duration-700 rtl:rotate-180",\n expanded && "rotate-90"\n )}\n size={arrowSizeMapping[size]}\n icon={iconList.rightArrow}\n fixedWidth\n />\n {headerProps?.children}\n </button>\n ) : (\n <div\n className={header({ class: headerProps?.className })}\n data-testid="accordionHeader"\n >\n <Button\n variant="text"\n aria-expanded={expanded ? "true" : "false"}\n aria-controls={bodyId}\n aria-labelledby={headerId}\n onClick={clickHandler}\n color="secondary"\n >\n <ADPIcon\n className={cn(\n "text-gray-500 dark:text-gray-800 transition-all duration-700 rtl:rotate-180",\n expanded && "rotate-90"\n )}\n size={arrowSizeMapping[size]}\n icon={iconList.rightArrow}\n fixedWidth\n />\n </Button>\n <span id={headerId}>{headerProps?.children}</span>\n </div>\n )}\n\n <div\n id={bodyId}\n data-testid="accordionBody"\n className={content({ class: bodyProps?.className })}\n {...( expanded\n ? {\n tabIndex: 0,\n role: "region",\n // Prefer a consumer-supplied label; otherwise name the region from\n // the header so it reads meaningfully instead of a generic fallback\n ...( bodyProps?.["aria-label"]\n ? { "aria-label": bodyProps["aria-label"] }\n : { "aria-labelledby": headerId })\n }\n : {})}\n >\n {expanded && bodyProps?.children}\n </div>\n </div>\n );\n }\n) as IAccordionType;\n\nAccordion.displayName = "Accordion";\nAccordion.Header = AccordionHeader;\nAccordion.Body = AccordionBody;\n'
1365
1412
  },
1366
1413
  {
1367
1414
  "name": "README.md",
@@ -1419,7 +1466,7 @@ var REGISTRY = {
1419
1466
  },
1420
1467
  {
1421
1468
  "name": "avatarVariants.ts",
1422
- "content": 'import { tv } from "tailwind-variants";\n\nexport const avatarVariants = tv({\n slots: {\n base: [\n "relative flex shrink-0 overflow-hidden rounded-full border-1.5 border-white",\n "bg-primary-100 text-primary-500 dark:border-secondary-500 dark:bg-secondary-600 dark:text-primary-400"\n ],\n image: "aspect-square h-full w-full",\n fallback: "flex h-full w-full items-center justify-center rounded-full font-medium"\n },\n variants: {\n size: {\n sm: { base: "h-7 w-7 text-xxs" },\n md: { base: "h-8 w-8 text-xs" },\n lg: { base: "h-9 w-9 text-md" },\n xl: { base: "h-11 w-11 text-lg" }\n }\n },\n defaultVariants: {\n size: "md"\n }\n});\n'
1469
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const avatarVariants = tv({\n slots: {\n base: [\n "relative flex shrink-0 overflow-hidden rounded-full border-1.5 border-white",\n "bg-primary-100 text-primary-700 dark:border-secondary-500 dark:bg-secondary-600 dark:text-primary-400"\n ],\n image: "aspect-square h-full w-full",\n fallback: "flex h-full w-full items-center justify-center rounded-full font-medium"\n },\n variants: {\n size: {\n sm: { base: "h-7 w-7 text-xxs" },\n md: { base: "h-8 w-8 text-xs" },\n lg: { base: "h-9 w-9 text-md" },\n xl: { base: "h-11 w-11 text-lg" }\n }\n },\n defaultVariants: {\n size: "md"\n }\n});\n'
1423
1470
  },
1424
1471
  {
1425
1472
  "name": "avatar.tsx",
@@ -1479,7 +1526,7 @@ var REGISTRY = {
1479
1526
  },
1480
1527
  {
1481
1528
  "name": "badgeVariants.ts",
1482
- "content": 'import { tv } from "tailwind-variants";\n\nexport const badgeVariants = tv({\n base: "inline-flex justify-center items-center gap-1 rounded-full font-medium ease-in-out duration-300 bg-transparent",\n variants: {\n variant: {\n filled: "",\n ghost: "",\n outline: "",\n text: "p-0"\n },\n size: {\n sm: "text-xs py-1 px-1.5",\n md: "text-base py-1 px-2",\n lg: "text-md py-1 px-2"\n },\n color: {\n primary: "text-primary-500 dark:text-primary-400",\n secondary: "text-secondary-500 dark:text-secondary-200",\n success: "text-success-500 dark:text-success-400",\n warning: "text-warning-500 dark:text-warning-400",\n error: "text-error-500 dark:text-error-400"\n }\n },\n compoundVariants: [\n // Primary variants\n {\n variant: "filled",\n color: "primary",\n class: "text-white bg-primary-500 dark:text-iridium dark:bg-primary-400"\n },\n {\n variant: "ghost",\n color: "primary",\n class: "text-primary-500 bg-primary-50 dark:text-primary-200 dark:bg-primary-900"\n },\n {\n variant: "outline",\n color: "primary",\n class: "border border-primary-100 dark:text-primary-400 dark:bg-iridium dark:border-primary-400"\n },\n {\n variant: "text",\n color: "primary",\n class: "dark:text-primary-400"\n },\n\n // Secondary variants\n {\n variant: "filled",\n color: "secondary",\n class: "bg-gray-100 dark:text-secondary-200 dark:bg-secondary-600"\n },\n {\n variant: "ghost",\n color: "secondary",\n class: "bg-gray-100 dark:text-secondary-200 dark:bg-secondary-600"\n },\n {\n variant: "outline",\n color: "secondary",\n class: "border border-gray-100 dark:text-secondary-200 dark:bg-iridium dark:border-secondary-500"\n },\n {\n variant: "text",\n color: "secondary",\n class: "dark:text-secondary-200"\n },\n\n // Success variants\n {\n variant: "filled",\n color: "success",\n class: "text-white bg-success-500 dark:text-iridium dark:bg-success-400"\n },\n {\n variant: "ghost",\n color: "success",\n class: "text-success-700 bg-success-50 dark:text-success-200 dark:bg-success-900"\n },\n {\n variant: "outline",\n color: "success",\n class: "border border-success-100 dark:text-success-400 dark:bg-iridium dark:border-success-400"\n },\n {\n variant: "text",\n color: "success",\n class: "dark:text-success-200"\n },\n\n // Warning variants\n {\n variant: "filled",\n color: "warning",\n class: "text-white bg-warning-500 dark:text-iridium dark:bg-warning-400"\n },\n {\n variant: "ghost",\n color: "warning",\n class: "text-warning-700 bg-warning-50 dark:text-warning-200 dark:bg-warning-900"\n },\n {\n variant: "outline",\n color: "warning",\n class: "border border-warning-100 dark:text-warning-400"\n },\n {\n variant: "text",\n color: "warning",\n class: "dark:text-warning-200"\n },\n\n // Error variants\n {\n variant: "filled",\n color: "error",\n class: "text-white bg-error-500 dark:text-iridium dark:bg-error-400"\n },\n {\n variant: "ghost",\n color: "error",\n class: "text-error-700 bg-error-50 dark:text-error-200 dark:bg-error-900"\n },\n {\n variant: "outline",\n color: "error",\n class: "border border-error-100 dark:text-error-400 dark:border-error-400"\n },\n {\n variant: "text",\n color: "error",\n class: "dark:text-error-200"\n }\n ],\n defaultVariants: {\n variant: "filled",\n size: "md",\n color: "primary"\n }\n});\n'
1529
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const badgeVariants = tv({\n base: "inline-flex justify-center items-center gap-1 rounded-full font-medium ease-in-out duration-300 bg-transparent",\n variants: {\n variant: {\n filled: "",\n ghost: "",\n outline: "",\n text: "p-0"\n },\n size: {\n sm: "text-xs py-1 px-1.5",\n md: "text-base py-1 px-2",\n lg: "text-md py-1 px-2"\n },\n color: {\n primary: "text-primary-700 dark:text-primary-400",\n secondary: "text-secondary-500 dark:text-secondary-200",\n success: "text-success-700 dark:text-success-400",\n warning: "text-warning-700 dark:text-warning-400",\n error: "text-error-700 dark:text-error-400"\n }\n },\n compoundVariants: [\n // Primary variants\n {\n variant: "filled",\n color: "primary",\n class: "text-white bg-primary-500 dark:text-iridium dark:bg-primary-400"\n },\n {\n variant: "ghost",\n color: "primary",\n class: "text-primary-700 bg-primary-100 dark:text-primary-200 dark:bg-primary-900"\n },\n {\n variant: "outline",\n color: "primary",\n class: "border border-primary-100 dark:text-primary-400 dark:bg-iridium dark:border-primary-400"\n },\n {\n variant: "text",\n color: "primary",\n class: "dark:text-primary-400"\n },\n\n // Secondary variants\n {\n variant: "filled",\n color: "secondary",\n class: "bg-gray-100 dark:text-secondary-200 dark:bg-secondary-600"\n },\n {\n variant: "ghost",\n color: "secondary",\n class: "bg-gray-100 dark:text-secondary-200 dark:bg-secondary-600"\n },\n {\n variant: "outline",\n color: "secondary",\n class: "border border-gray-100 dark:text-secondary-200 dark:bg-iridium dark:border-secondary-500"\n },\n {\n variant: "text",\n color: "secondary",\n class: "dark:text-secondary-200"\n },\n\n // Success variants\n {\n variant: "filled",\n color: "success",\n class: "text-white bg-success-700 dark:text-iridium dark:bg-success-400"\n },\n {\n variant: "ghost",\n color: "success",\n class: "text-success-700 bg-success-100 dark:text-success-200 dark:bg-success-900"\n },\n {\n variant: "outline",\n color: "success",\n class: "border border-success-100 dark:text-success-400 dark:bg-iridium dark:border-success-400"\n },\n {\n variant: "text",\n color: "success",\n class: "dark:text-success-200"\n },\n\n // Warning variants\n {\n variant: "filled",\n color: "warning",\n class: "text-white bg-warning-700 dark:text-iridium dark:bg-warning-400"\n },\n {\n variant: "ghost",\n color: "warning",\n class: "text-warning-800 bg-warning-100 dark:text-warning-200 dark:bg-warning-900"\n },\n {\n variant: "outline",\n color: "warning",\n class: "border border-warning-100 dark:text-warning-400"\n },\n {\n variant: "text",\n color: "warning",\n class: "dark:text-warning-200"\n },\n\n // Error variants\n {\n variant: "filled",\n color: "error",\n class: "text-white bg-error-700 dark:text-iridium dark:bg-error-400"\n },\n {\n variant: "ghost",\n color: "error",\n class: "text-error-700 bg-error-100 dark:text-error-200 dark:bg-error-900"\n },\n {\n variant: "outline",\n color: "error",\n class: "border border-error-100 dark:text-error-400 dark:border-error-400"\n },\n {\n variant: "text",\n color: "error",\n class: "dark:text-error-200"\n }\n ],\n defaultVariants: {\n variant: "filled",\n size: "md",\n color: "primary"\n }\n});\n'
1483
1530
  },
1484
1531
  {
1485
1532
  "name": "badge.tsx",
@@ -1510,11 +1557,11 @@ var REGISTRY = {
1510
1557
  },
1511
1558
  {
1512
1559
  "name": "breadcrumbsVariants.ts",
1513
- "content": 'import { tv } from "tailwind-variants";\n\nexport const breadcrumbsVariants = tv({\n slots: {\n root: "hidden md:block",\n list: "list-none inline-flex flex-wrap items-center gap-2",\n separator: "select-none text-secondary-300 dark:text-secondary-200",\n svgIcon: "h-3",\n dotSeparator: "text-lg leading-none",\n item: "text-base text-secondary-300 dark:text-secondary-300"\n },\n variants: {\n separatorType: {\n arrow: {},\n dot: {}\n },\n active: {\n true: { item: "font-semibold text-primary-500 dark:text-primary-400 cursor-default" },\n false: {}\n }\n },\n defaultVariants: {\n separatorType: "arrow",\n active: false\n }\n});\n'
1560
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const breadcrumbsVariants = tv({\n slots: {\n root: "hidden md:block",\n list: "list-none inline-flex flex-wrap items-center gap-2",\n separator: "select-none text-secondary-400 dark:text-secondary-200",\n svgIcon: "h-3",\n dotSeparator: "text-lg leading-none",\n item: "text-base text-secondary-400 dark:text-secondary-300"\n },\n variants: {\n separatorType: {\n arrow: {},\n dot: {}\n },\n active: {\n true: { item: "font-semibold text-primary-700 dark:text-primary-400 cursor-default" },\n false: {}\n }\n },\n defaultVariants: {\n separatorType: "arrow",\n active: false\n }\n});\n'
1514
1561
  },
1515
1562
  {
1516
1563
  "name": "breadcrumbs.tsx",
1517
- "content": 'import * as React from "react";\nimport { breadcrumbsVariants } from "./breadcrumbsVariants";\nimport { BreadcrumbItem, type IBreadcrumbItemProps } from "./breadcrumbItem";\nimport { ADPIcon, iconList } from "../adpIcon";\n\n/**\n * Props for the Breadcrumbs component\n */\nexport interface IBreadcrumbsProps extends React.HTMLAttributes<HTMLElement> {\n /**\n * The maximum number of items to display in the breadcrumbs\n * @default 10\n * @range 2 - maxItems\n */\n maxItems?: number;\n /**\n * Accepts Breadcrumbs.Item[]\n */\n children?: React.ReactElement<IBreadcrumbItemProps> | Array<React.ReactElement<IBreadcrumbItemProps>>;\n /**\n * Determines the separator type: "arrow" for ">", "dot" for "."\n * @default "arrow"\n */\n separatorType?: "arrow" | "dot";\n}\n\n/**\n * Separator component for breadcrumb items\n */\nconst BreadcrumbSeparator = ({\n separatorType = "arrow"\n}: {\n separatorType?: "arrow" | "dot"\n}): React.ReactElement => {\n const { separator, svgIcon, dotSeparator } = breadcrumbsVariants({ separatorType });\n return (\n <li\n className={separator()}\n aria-hidden="true"\n >\n {separatorType === "arrow" ? (\n <ADPIcon\n size="xs"\n className={svgIcon({ class: "rtl:rotate-180" })}\n icon={iconList.rightArrow}\n />\n ) : (\n // Using Unicode character {"\\u2022"} for the dot separator\n <span className={dotSeparator()}>{"\\u2022"}</span>\n )}\n </li>\n );\n};\n\n/**\n * Breadcrumbs component for navigation\n */\nconst BreadcrumbsComponent = React.forwardRef<HTMLElement, IBreadcrumbsProps>(\n ({\n maxItems = 10,\n className,\n children,\n separatorType = "arrow",\n ...props\n }, ref ) => {\n const [ showAll, toggleShowAll ] = React.useReducer(( state ) => !state, false );\n const [ crumbsList, setCrumbsList ] = React.useState<Array<React.ReactElement<IBreadcrumbItemProps>>>([]);\n const maxDisplayItems = Math.max( maxItems, 2 );\n\n React.useEffect(() => {\n const crumbs = [];\n if ( Array.isArray( children )) {\n const totalItems = children.length - 1;\n if (( totalItems < maxDisplayItems ) || showAll ) {\n for ( let i = 0; i < totalItems; i++ ) {\n if ( !React.isValidElement( children[i])) {\n return;\n }\n crumbs.push(\n React.cloneElement( children[i], { active: false, key: i }),\n <BreadcrumbSeparator key={`separator${i}`} separatorType={separatorType} />\n );\n }\n } else {\n if ( React.isValidElement( children[0])) {\n crumbs.push(\n React.cloneElement( children[0], { active: false, key: "first-item" }),\n <BreadcrumbSeparator key="first-item-separator" separatorType={separatorType} />\n );\n }\n crumbs.push(\n React.cloneElement( <BreadcrumbItem>\n <button onClick={toggleShowAll} title={`${totalItems - maxDisplayItems + 1} more item(s)`}>\n <span className="text-base">...</span>\n </button>\n </BreadcrumbItem>, { active: false, key: "more-items" }),\n <BreadcrumbSeparator key="more-items-separator" separatorType={separatorType} />\n );\n for ( let j = totalItems - maxDisplayItems + 2; j < totalItems; j++ ) {\n if ( !React.isValidElement( children[j])) {\n return;\n }\n crumbs.push(\n React.cloneElement( children[j], { active: false, key: j }),\n <BreadcrumbSeparator key={`${j}-separator`} separatorType={separatorType} />\n );\n }\n }\n crumbs.push( React.cloneElement( children[totalItems], { active: true, key: "lastItem" }));\n } else if ( React.isValidElement( children )) {\n const clone = React.cloneElement( children, { active: true });\n crumbs.push( clone );\n }\n setCrumbsList( crumbs );\n }, [ children, maxDisplayItems, showAll, separatorType ]);\n\n const { root, list } = breadcrumbsVariants();\n\n return crumbsList?.length > 0\n ? <nav\n ref={ref as React.RefObject<HTMLElement>}\n aria-label="Breadcrumb"\n className={root({ class: className })}\n {...props}\n >\n <ol className={list()}>\n {crumbsList}\n </ol>\n </nav>\n : null;\n }\n);\n\nBreadcrumbsComponent.displayName = "Breadcrumbs";\n\n// Define the compound component type\ntype TBreadcrumbsCompoundComponent = typeof BreadcrumbsComponent & {\n Item: typeof BreadcrumbItem;\n};\n\n// Create the compound component by casting and attaching subcomponents\nconst Breadcrumbs = BreadcrumbsComponent as TBreadcrumbsCompoundComponent;\nBreadcrumbs.Item = BreadcrumbItem;\n\n// Export the compound component and individual components\nexport { Breadcrumbs, BreadcrumbItem };\n'
1564
+ "content": 'import * as React from "react";\nimport { breadcrumbsVariants } from "./breadcrumbsVariants";\nimport { BreadcrumbItem, type IBreadcrumbItemProps } from "./breadcrumbItem";\nimport { ADPIcon, iconList } from "../adpIcon";\n\n/**\n * Props for the Breadcrumbs component\n */\nexport interface IBreadcrumbsProps extends React.HTMLAttributes<HTMLElement> {\n /**\n * The maximum number of items to display in the breadcrumbs\n * @default 10\n * @range 2 - maxItems\n */\n maxItems?: number;\n /**\n * Accepts Breadcrumbs.Item[]\n */\n children?: React.ReactElement<IBreadcrumbItemProps> | Array<React.ReactElement<IBreadcrumbItemProps>>;\n /**\n * Determines the separator type: "arrow" for ">", "dot" for "."\n * @default "arrow"\n */\n separatorType?: "arrow" | "dot";\n}\n\n/**\n * Separator component for breadcrumb items\n */\nconst BreadcrumbSeparator = ({\n separatorType = "arrow"\n}: {\n separatorType?: "arrow" | "dot"\n}): React.ReactElement => {\n const { separator, svgIcon, dotSeparator } = breadcrumbsVariants({ separatorType });\n return (\n <li\n className={separator()}\n aria-hidden="true"\n >\n {separatorType === "arrow" ? (\n <ADPIcon\n size="xs"\n className={svgIcon({ class: "rtl:rotate-180" })}\n icon={iconList.rightArrow}\n />\n ) : (\n // Using Unicode character {"\\u2022"} for the dot separator\n <span className={dotSeparator()}>{"\\u2022"}</span>\n )}\n </li>\n );\n};\n\n// Compound component type with subcomponents attached\ntype TBreadcrumbsCompoundComponent = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<IBreadcrumbsProps> & React.RefAttributes<HTMLElement>\n> & {\n Item: typeof BreadcrumbItem;\n};\n\n/**\n * Breadcrumbs component for navigation\n */\nexport const Breadcrumbs = React.forwardRef<HTMLElement, IBreadcrumbsProps>(\n ({\n maxItems = 10,\n className,\n children,\n separatorType = "arrow",\n ...props\n }, ref ) => {\n const [ showAll, toggleShowAll ] = React.useReducer(( state ) => !state, false );\n const [ crumbsList, setCrumbsList ] = React.useState<Array<React.ReactElement<IBreadcrumbItemProps>>>([]);\n const maxDisplayItems = Math.max( maxItems, 2 );\n\n React.useEffect(() => {\n const crumbs = [];\n if ( Array.isArray( children )) {\n const totalItems = children.length - 1;\n if (( totalItems < maxDisplayItems ) || showAll ) {\n for ( let i = 0; i < totalItems; i++ ) {\n if ( !React.isValidElement( children[i])) {\n return;\n }\n crumbs.push(\n React.cloneElement( children[i], { active: false, key: i }),\n <BreadcrumbSeparator key={`separator${i}`} separatorType={separatorType} />\n );\n }\n } else {\n if ( React.isValidElement( children[0])) {\n crumbs.push(\n React.cloneElement( children[0], { active: false, key: "first-item" }),\n <BreadcrumbSeparator key="first-item-separator" separatorType={separatorType} />\n );\n }\n crumbs.push(\n React.cloneElement( <BreadcrumbItem>\n <button onClick={toggleShowAll} title={`${totalItems - maxDisplayItems + 1} more item(s)`}>\n <span className="text-base">...</span>\n </button>\n </BreadcrumbItem>, { active: false, key: "more-items" }),\n <BreadcrumbSeparator key="more-items-separator" separatorType={separatorType} />\n );\n for ( let j = totalItems - maxDisplayItems + 2; j < totalItems; j++ ) {\n if ( !React.isValidElement( children[j])) {\n return;\n }\n crumbs.push(\n React.cloneElement( children[j], { active: false, key: j }),\n <BreadcrumbSeparator key={`${j}-separator`} separatorType={separatorType} />\n );\n }\n }\n crumbs.push( React.cloneElement( children[totalItems], { active: true, key: "lastItem" }));\n } else if ( React.isValidElement( children )) {\n const clone = React.cloneElement( children, { active: true });\n crumbs.push( clone );\n }\n setCrumbsList( crumbs );\n }, [ children, maxDisplayItems, showAll, separatorType ]);\n\n const { root, list } = breadcrumbsVariants();\n\n return crumbsList?.length > 0\n ? <nav\n ref={ref as React.RefObject<HTMLElement>}\n aria-label="Breadcrumb"\n className={root({ class: className })}\n {...props}\n >\n <ol className={list()}>\n {crumbsList}\n </ol>\n </nav>\n : null;\n }\n) as TBreadcrumbsCompoundComponent;\n\nBreadcrumbs.displayName = "Breadcrumbs";\nBreadcrumbs.Item = BreadcrumbItem;\n\n// Export the individual subcomponent\nexport { BreadcrumbItem };\n'
1518
1565
  },
1519
1566
  {
1520
1567
  "name": "breadcrumbItem.tsx",
@@ -1531,27 +1578,31 @@ var REGISTRY = {
1531
1578
  "name": "button",
1532
1579
  "description": "The Button component is a versatile interactive element used to trigger actions, submit forms, or navigate between pages. It provides multiple visual styles, sizes, colors, and states including loading and disabled states. **When to use:** - Primary and secondary actions in forms and dialogs - Call-to-action elements on pages - Navigation triggers - Form submissions - Destructive actions (with error color) **Component Architecture:** - Built with React forwardRef for ref forwarding - Styled with Tailwind CSS and class-variance-authority (cva) - Integrates with Tooltip component for hover tooltips - Supports icon integration via ADPIcon or custom React nodes",
1533
1580
  "dependencies": [
1534
- "tailwind-variants",
1535
1581
  "react",
1582
+ "tailwind-variants",
1536
1583
  "@floating-ui/react",
1537
1584
  "tailwind-merge"
1538
1585
  ],
1539
1586
  "internalDependencies": [
1540
- "tooltip",
1541
- "adpIcon"
1587
+ "adpIcon",
1588
+ "tooltip"
1542
1589
  ],
1543
1590
  "files": [
1591
+ {
1592
+ "name": "reloadButton.tsx",
1593
+ "content": 'import * as React from "react";\n\nimport { Button } from "./button";\nimport { ADPIcon, iconList } from "../adpIcon";\n\nexport interface IReloadButtonProps {\n /** Absent means the surface has no reload affordance, and nothing renders. */\n onReload?: () => void;\n /** Spins the icon and blocks a second click while the refetch is in flight. */\n isReloading?: boolean;\n /** OR-ed with `isReloading` \u2014 a disabled surface has nothing to reload. */\n disabled?: boolean;\n /** Doubles as the accessible name; the button is icon-only. */\n tooltip?: string;\n className?: string;\n}\n\n/**\n * The icon-only refetch affordance for any surface backed by an async option source. One component\n * so the icon, the in-flight disable and the tooltip/aria-label pairing cannot drift between them.\n */\nexport function ReloadButton({\n onReload,\n isReloading,\n disabled,\n tooltip,\n className = "p-1"\n}: IReloadButtonProps ): React.ReactElement | null {\n if ( typeof onReload !== "function" ) {\n return null;\n }\n return (\n <Button\n variant="shade"\n color="secondary"\n className={className}\n size="sm"\n onClick={onReload}\n disabled={disabled === true || isReloading === true}\n tooltip={tooltip}\n aria-label={tooltip}\n >\n <ADPIcon icon={iconList.reload} size="xs" spin={isReloading} />\n </Button>\n );\n}\n\nReloadButton.displayName = "ReloadButton";\n'
1594
+ },
1544
1595
  {
1545
1596
  "name": "index.ts",
1546
1597
  "content": 'export {\n Button,\n ESizes,\n colors,\n variants,\n ButtonSizeToSpinnerMap,\n type IButtonProps,\n type TColor,\n type TVariant,\n type TSize\n} from "./button";\nexport { buttonVariants } from "./buttonVariants";'
1547
1598
  },
1548
1599
  {
1549
1600
  "name": "buttonVariants.ts",
1550
- "content": 'import { tv } from "tailwind-variants";\n\nexport const buttonVariants = tv({\n base: "flex items-center justify-center rounded ease-in-out duration-300 w-fit disabled:cursor-not-allowed outline-none focus:transition-none",\n variants: {\n variant: {\n filled: "",\n outline: "bg-transparent",\n shade: "bg-transparent",\n text: "p-0"\n },\n color: {\n primary: "",\n secondary: "",\n success: "",\n warning: "",\n error: ""\n },\n size: {\n xs: "p-2 text-xs gap-2",\n sm: "p-2.5 text-base gap-2",\n md: "p-2.5 text-md gap-2",\n lg: "p-3.5 text-md gap-2",\n xl: "p-[18px] text-lg gap-3"\n },\n hasChildren: {\n true: ""\n }\n },\n compoundVariants: [\n // PRIMARY COLOR VARIANTS\n {\n variant: "filled",\n color: "primary",\n class: `text-white bg-primary-500 hover:bg-primary-700 hover:text-white \n focus-visible:text-white focus-visible:bg-primary-400 active:bg-primary-500 \n disabled:bg-primary-200 disabled:text-white focus-visible:ring \n focus-visible:ring-[#99CBFA] focus-visible:active:bg-primary-500\n dark:text-iridium dark:bg-primary-400 dark:hover:bg-primary-300 dark:active:bg-primary-400\n dark:focus-visible:ring dark:focus-visible:ring-[#99CBFA] dark:focus-visible:active:bg-primary-300\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "outline",\n color: "primary",\n class: `text-primary-500 hover:text-primary-700 focus-visible:text-primary-400 disabled:text-primary-200\n border border-primary-500 hover:bg-primary-100 hover:border-primary-700\n focus-visible:bg-primary-50 focus-visible:border-primary-500 active:bg-transparent\n disabled:border-primary-200 disabled:hover:bg-secondary-50\n focus-visible:ring focus-visible:ring-[#99CBFA] focus-visible:active:bg-transparent\n dark:text-primary-400 dark:border-primary-400 dark:hover:border-primary-300 dark:hover:text-primary-300 \n dark:active:text-primary-400 dark:active:border-primary-400\n dark:focus-visible:ring dark:focus-visible:ring-[#99CBFA] dark:focus-visible:border-primary-300 \n dark:focus-visible:text-primary-300 dark:focus-visible:active:text-primary-400 dark:focus-visible:active:border-primary-400\n dark:disabled:border-none dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "shade",\n color: "primary",\n class: `text-primary-500 hover:text-primary-700 focus-visible:text-primary-400 disabled:text-primary-200\n hover:bg-primary-100 focus-visible:bg-primary-50 active:bg-transparent disabled:bg-transparent\n dark:text-primary-400 dark:hover:bg-primary-300 dark:hover:text-iridium dark:active:bg-transparent dark:active:text-primary-400\n dark:focus-visible:bg-primary-200 dark:focus-visible:text-iridium dark:focus-visible:active:bg-transparent dark:focus-visible:active:text-primary-400\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n color: "primary",\n class: `text-primary-500 hover:text-primary-700 focus-visible:text-primary-400 disabled:text-primary-200\n active:text-primary-500\n dark:text-primary-400 dark:hover:text-primary-300 dark:active:text-primary-500 dark:focus-visible:text-primary-200\n dark:disabled:text-secondary-400`\n },\n\n // SECONDARY COLOR VARIANTS\n {\n variant: "filled",\n color: "secondary",\n class: `text-secondary-500 focus-visible:text-secondary-400\n bg-gray-100 hover:bg-gray-300 focus-visible:bg-gray-200 active:bg-gray-100\n focus-visible:ring focus-visible:ring-gray-100 focus-visible:active:bg-gray-100\n dark:text-secondary-50 dark:bg-secondary-800 dark:hover:bg-secondary-700 dark:active:bg-secondary-800\n dark:focus-visible:ring dark:focus-visible:ring-secondary-600 dark:focus-visible:active:bg-secondary-700`\n },\n {\n variant: "outline",\n color: "secondary",\n class: `text-secondary-500 focus-visible:text-secondary-400\n border border-gray-300 hover:bg-gray-100 focus-visible:bg-gray-50 active:bg-transparent\n focus-visible:ring focus-visible:ring-gray-200 focus-visible:active:bg-transparent\n dark:text-secondary-50 dark:border-secondary-50 dark:hover:text-secondary-100 dark:active:text-secondary-50 dark:active:border-secondary-800\n dark:focus-visible:ring dark:focus-visible:ring-secondary-50 dark:focus-visible:border-secondary-600 dark:focus-visible:text-secondary-200 \n dark:focus-visible:active:text-secondary-50 dark:focus-visible:active:border-secondary-800`\n },\n {\n variant: "shade",\n color: "secondary",\n class: `text-secondary-500 focus-visible:text-secondary-400\n hover:bg-gray-100 focus-visible:bg-gray-50 active:bg-transparent\n dark:text-secondary-50 dark:hover:bg-secondary-700 dark:hover:text-secondary-100 \n dark:active:bg-transparent dark:active:text-secondary-50\n dark:focus-visible:bg-secondary-600 dark:focus-visible:text-secondary-200 \n dark:focus-visible:active:bg-transparent dark:focus-visible:active:text-secondary-50`\n },\n {\n variant: "text",\n color: "secondary",\n class: `text-secondary-500 focus-visible:text-secondary-400 active:text-secondary-500\n dark:text-secondary-50 dark:hover:text-secondary-100 dark:active:text-secondary-50 dark:focus-visible:text-secondary-200`\n },\n\n // SUCCESS COLOR VARIANTS\n {\n variant: "filled",\n color: "success",\n class: `text-white bg-success-500 hover:bg-success-700 hover:text-white \n focus-visible:text-white focus-visible:bg-success-400 active:bg-success-500 \n disabled:bg-success-200 disabled:text-white focus-visible:ring \n focus-visible:ring-[#A3D6C9] focus-visible:active:bg-success-500\n dark:text-iridium dark:bg-success-400 dark:hover:bg-success-300 dark:active:bg-success-400\n dark:focus-visible:ring dark:focus-visible:ring-[#A3D6C9] dark:focus-visible:active:bg-success-300\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "outline",\n color: "success",\n class: `text-success-500 hover:text-success-700 focus-visible:text-success-400 disabled:text-success-200\n border border-success-500 hover:bg-success-100 hover:border-success-700 active:bg-transparent\n focus-visible:bg-success-50 focus-visible:border-success-500 disabled:border-success-200\n focus-visible:ring focus-visible:ring-[#A3D6C9] focus-visible:active:bg-transparent\n dark:text-success-400 dark:border-success-400 dark:hover:border-success-300 dark:hover:text-success-300 \n dark:active:text-success-400 dark:active:border-success-400\n dark:focus-visible:ring dark:focus-visible:ring-[#A3D6C9] dark:focus-visible:border-success-200 \n dark:focus-visible:text-success-200 dark:focus-visible:active:text-success-400 dark:focus-visible:active:border-success-400\n dark:disabled:border-none dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "shade",\n color: "success",\n class: `text-success-500 hover:text-success-700 focus-visible:text-success-400 disabled:text-success-200\n hover:bg-success-100 focus-visible:bg-success-50 active:bg-transparent disabled:bg-transparent\n dark:text-success-400 dark:hover:bg-success-300 dark:hover:text-iridium dark:active:bg-transparent dark:active:text-success-400\n dark:focus-visible:bg-success-200 dark:focus-visible:text-iridium dark:focus-visible:active:bg-transparent dark:focus-visible:active:text-success-400\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n color: "success",\n class: `text-success-500 hover:text-success-700 focus-visible:text-success-400 disabled:text-success-200\n active:text-success-500\n dark:text-success-400 dark:hover:text-success-300 dark:active:text-success-400 dark:focus-visible:text-success-200\n dark:disabled:text-secondary-400`\n },\n\n // WARNING COLOR VARIANTS\n {\n variant: "filled",\n color: "warning",\n class: `text-white bg-warning-500 hover:bg-warning-700 hover:text-white \n focus-visible:text-white focus-visible:bg-warning-400 active:bg-warning-500 \n disabled:bg-warning-200 disabled:text-white focus-visible:ring \n focus-visible:ring-[#FBD29C] focus-visible:active:bg-warning-500\n dark:text-iridium dark:bg-warning-400 dark:hover:bg-warning-300 dark:active:bg-warning-400\n dark:focus-visible:ring dark:focus-visible:ring-[#FBD29C] dark:focus-visible:active:bg-warning-300\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "outline",\n color: "warning",\n class: `text-warning-500 hover:text-warning-700 focus-visible:text-warning-400 disabled:text-warning-200\n border border-warning-500 hover:bg-warning-100 hover:border-warning-700\n focus-visible:bg-warning-50 focus-visible:border-warning-50 active:bg-transparent disabled:border-warning-200\n focus-visible:ring focus-visible:ring-[#FBD29C] focus-visible:active:bg-transparent\n dark:text-warning-400 dark:border-warning-400 dark:hover:border-warning-300 dark:hover:text-warning-300 \n dark:active:text-warning-400 dark:active:border-warning-400\n dark:focus-visible:ring dark:focus-visible:ring-[#FBD29C] dark:focus-visible:border-warning-300 \n dark:focus-visible:text-warning-300 dark:focus-visible:active:text-warning-400 dark:focus-visible:active:border-warning-400\n dark:disabled:border-none dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "shade",\n color: "warning",\n class: `text-warning-500 hover:text-warning-700 focus-visible:text-warning-400 disabled:text-warning-200\n hover:bg-warning-100 focus-visible:bg-warning-100 active:bg-transparent disabled:bg-transparent\n dark:text-warning-400 dark:hover:bg-warning-300 dark:hover:text-iridium dark:active:bg-transparent dark:active:text-warning-400\n dark:focus-visible:bg-warning-200 dark:focus-visible:text-iridium dark:focus-visible:active:bg-transparent dark:focus-visible:active:text-warning-400\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n color: "warning",\n class: `text-warning-500 hover:text-warning-700 focus-visible:text-warning-400 disabled:text-warning-200\n active:text-warning-500\n dark:text-warning-400 dark:hover:text-warning-300 dark:active:text-warning-400 dark:focus-visible:text-warning-200\n dark:disabled:text-secondary-400`\n },\n\n // ERROR COLOR VARIANTS\n {\n variant: "filled",\n color: "error",\n class: `text-white bg-error-500 hover:bg-error-700 hover:text-white \n focus-visible:text-white focus-visible:bg-error-400 active:bg-error-500 \n disabled:bg-error-200 disabled:text-white focus-visible:ring \n focus-visible:ring-[#F1AE9D] focus-visible:active:bg-error-500\n dark:text-iridium dark:bg-error-400 dark:hover:bg-error-300 dark:active:bg-error-400\n dark:focus-visible:ring dark:focus-visible:ring-[#F1AE9D] dark:focus-visible:active:bg-error-300\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "outline",\n color: "error",\n class: `text-error-500 hover:text-error-700 focus-visible:text-error-400 disabled:text-error-200\n border border-error-500 hover:bg-error-100 hover:border-error-700\n focus-visible:bg-error-50 focus-visible:border-error-500 active:bg-transparent disabled:border-error-200\n focus-visible:ring focus-visible:ring-[#F1AE9D] focus-visible:active:bg-transparent\n dark:text-error-400 dark:border-error-400 dark:hover:border-error-300 dark:hover:text-error-300 \n dark:active:text-error-400 dark:active:border-error-400\n dark:focus-visible:ring dark:focus-visible:ring-[#F1AE9D] dark:focus-visible:border-error-300 \n dark:focus-visible:text-error-300 dark:focus-visible:active:text-error-400 dark:focus-visible:active:border-error-400\n dark:disabled:border-none dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "shade",\n color: "error",\n class: `text-error-500 hover:text-error-700 focus-visible:text-error-400 disabled:text-error-200\n hover:bg-error-100 focus-visible:bg-error-50 active:bg-transparent disabled:bg-transparent\n dark:text-error-400 dark:hover:bg-error-300 dark:hover:text-iridium dark:active:bg-transparent dark:active:text-error-400\n dark:focus-visible:bg-error-200 dark:focus-visible:text-iridium dark:focus-visible:active:bg-transparent dark:focus-visible:active:text-error-400\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n color: "error",\n class: `text-error-500 hover:text-error-700 focus-visible:text-error-400 disabled:text-error-200\n active:text-error-500\n dark:text-error-400 dark:hover:text-error-300 dark:active:text-error-400 dark:focus-visible:text-error-200\n dark:disabled:text-secondary-400`\n },\n\n // GLOBAL DISABLED STATES\n {\n variant: "filled",\n class: `disabled:text-secondary-300 disabled:bg-gray-100\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "outline",\n class: `disabled:text-secondary-300 disabled:border-gray-200\n dark:disabled:border-none dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "shade",\n class: `disabled:text-secondary-300\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n class: `disabled:text-secondary-200\n dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n class: "p-0"\n },\n\n // PADDED VARIANTS FOR EACH SIZE WHEN THERE ARE CHILDREN\n {\n variant: [ "filled", "outline", "shade" ],\n size: "xs",\n hasChildren: true,\n class: "px-3 py-2"\n },\n {\n variant: [ "filled", "outline", "shade" ],\n size: "sm",\n hasChildren: true,\n class: "px-5 py-2"\n },\n {\n variant: [ "filled", "outline", "shade" ],\n size: "md",\n hasChildren: true,\n class: "px-6 py-2"\n },\n {\n variant: [ "filled", "outline", "shade" ],\n size: "lg",\n hasChildren: true,\n class: "px-[28px] py-3"\n },\n {\n variant: [ "filled", "outline", "shade" ],\n size: "xl",\n hasChildren: true,\n class: "px-7 py-4"\n }\n ],\n defaultVariants: {\n variant: "filled",\n color: "primary",\n size: "md"\n }\n});\n'
1601
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const buttonVariants = tv({\n base: "flex items-center justify-center rounded ease-in-out duration-300 w-fit disabled:cursor-not-allowed outline-none focus:transition-none",\n variants: {\n variant: {\n filled: "",\n outline: "bg-transparent",\n shade: "bg-transparent",\n text: "p-0"\n },\n color: {\n primary: "",\n secondary: "",\n success: "",\n warning: "",\n error: ""\n },\n size: {\n xs: "p-2 text-xs gap-2",\n sm: "p-2.5 text-base gap-2",\n md: "p-2.5 text-md gap-2",\n lg: "p-3.5 text-md gap-2",\n xl: "p-[18px] text-lg gap-3"\n },\n hasChildren: {\n true: ""\n }\n },\n compoundVariants: [\n // PRIMARY COLOR VARIANTS\n {\n variant: "filled",\n color: "primary",\n class: `text-white bg-primary-500 hover:bg-primary-700 hover:text-white \n focus-visible:text-white focus-visible:bg-primary-400 active:bg-primary-500 \n disabled:bg-primary-200 disabled:text-white focus-visible:ring \n focus-visible:ring-[#99CBFA] focus-visible:active:bg-primary-500\n dark:text-iridium dark:bg-primary-400 dark:hover:bg-primary-300 dark:active:bg-primary-400\n dark:focus-visible:ring dark:focus-visible:ring-[#99CBFA] dark:focus-visible:active:bg-primary-300\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "outline",\n color: "primary",\n class: `text-primary-700 hover:text-primary-700 focus-visible:text-primary-700 disabled:text-primary-200\n border border-primary-700 hover:bg-primary-100 hover:border-primary-700\n focus-visible:bg-primary-100 focus-visible:border-primary-700 active:bg-transparent\n disabled:border-primary-200 disabled:hover:bg-secondary-50\n focus-visible:ring focus-visible:ring-[#99CBFA] focus-visible:active:bg-transparent\n dark:text-primary-400 dark:border-primary-400 dark:hover:border-primary-300 dark:hover:text-primary-300 \n dark:active:text-primary-400 dark:active:border-primary-400\n dark:focus-visible:ring dark:focus-visible:ring-[#99CBFA] dark:focus-visible:border-primary-300 \n dark:focus-visible:text-primary-300 dark:focus-visible:active:text-primary-400 dark:focus-visible:active:border-primary-400\n dark:disabled:border-none dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "shade",\n color: "primary",\n class: `text-primary-700 hover:text-primary-700 focus-visible:text-primary-700 disabled:text-primary-200\n hover:bg-primary-100 focus-visible:bg-primary-100 active:bg-transparent disabled:bg-transparent\n dark:text-primary-400 dark:hover:bg-primary-300 dark:hover:text-iridium dark:active:bg-transparent dark:active:text-primary-400\n dark:focus-visible:bg-primary-200 dark:focus-visible:text-iridium dark:focus-visible:active:bg-transparent dark:focus-visible:active:text-primary-400\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n color: "primary",\n class: `text-primary-700 hover:text-primary-700 focus-visible:text-primary-400 disabled:text-primary-200\n active:text-primary-700\n dark:text-primary-400 dark:hover:text-primary-300 dark:active:text-primary-700 dark:focus-visible:text-primary-200\n dark:disabled:text-secondary-400`\n },\n\n // SECONDARY COLOR VARIANTS\n {\n variant: "filled",\n color: "secondary",\n class: `text-secondary-500 focus-visible:text-secondary-400\n bg-gray-100 hover:bg-gray-300 focus-visible:bg-gray-200 active:bg-gray-100\n focus-visible:ring focus-visible:ring-gray-100 focus-visible:active:bg-gray-100\n dark:text-secondary-50 dark:bg-secondary-800 dark:hover:bg-secondary-700 dark:active:bg-secondary-800\n dark:focus-visible:ring dark:focus-visible:ring-secondary-600 dark:focus-visible:active:bg-secondary-700`\n },\n {\n variant: "outline",\n color: "secondary",\n class: `text-secondary-500 focus-visible:text-secondary-400\n border border-gray-300 hover:bg-gray-100 focus-visible:bg-gray-50 active:bg-transparent\n focus-visible:ring focus-visible:ring-gray-200 focus-visible:active:bg-transparent\n dark:text-secondary-50 dark:border-secondary-50 dark:hover:text-secondary-100 dark:active:text-secondary-50 dark:active:border-secondary-800\n dark:focus-visible:ring dark:focus-visible:ring-secondary-50 dark:focus-visible:border-secondary-600 dark:focus-visible:text-secondary-200 \n dark:focus-visible:active:text-secondary-50 dark:focus-visible:active:border-secondary-800`\n },\n {\n variant: "shade",\n color: "secondary",\n class: `text-secondary-500 focus-visible:text-secondary-400\n hover:bg-gray-100 focus-visible:bg-gray-50 active:bg-transparent\n dark:text-secondary-50 dark:hover:bg-secondary-700 dark:hover:text-secondary-100 \n dark:active:bg-transparent dark:active:text-secondary-50\n dark:focus-visible:bg-secondary-600 dark:focus-visible:text-secondary-200 \n dark:focus-visible:active:bg-transparent dark:focus-visible:active:text-secondary-50`\n },\n {\n variant: "text",\n color: "secondary",\n class: `text-secondary-500 focus-visible:text-secondary-400 active:text-secondary-500\n dark:text-secondary-50 dark:hover:text-secondary-100 dark:active:text-secondary-50 dark:focus-visible:text-secondary-200`\n },\n\n // SUCCESS COLOR VARIANTS\n {\n variant: "filled",\n color: "success",\n class: `text-white bg-success-500 hover:bg-success-700 hover:text-white \n focus-visible:text-white focus-visible:bg-success-400 active:bg-success-500 \n disabled:bg-success-200 disabled:text-white focus-visible:ring \n focus-visible:ring-[#A3D6C9] focus-visible:active:bg-success-500\n dark:text-iridium dark:bg-success-400 dark:hover:bg-success-300 dark:active:bg-success-400\n dark:focus-visible:ring dark:focus-visible:ring-[#A3D6C9] dark:focus-visible:active:bg-success-300\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "outline",\n color: "success",\n class: `text-success-700 hover:text-success-700 focus-visible:text-success-700 disabled:text-success-200\n border border-success-700 hover:bg-success-100 hover:border-success-700 active:bg-transparent\n focus-visible:bg-success-50 focus-visible:border-success-700 disabled:border-success-200\n focus-visible:ring focus-visible:ring-[#A3D6C9] focus-visible:active:bg-transparent\n dark:text-success-400 dark:border-success-400 dark:hover:border-success-300 dark:hover:text-success-300 \n dark:active:text-success-400 dark:active:border-success-400\n dark:focus-visible:ring dark:focus-visible:ring-[#A3D6C9] dark:focus-visible:border-success-200 \n dark:focus-visible:text-success-200 dark:focus-visible:active:text-success-400 dark:focus-visible:active:border-success-400\n dark:disabled:border-none dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "shade",\n color: "success",\n class: `text-success-700 hover:text-success-700 focus-visible:text-success-700 disabled:text-success-200\n hover:bg-success-100 focus-visible:bg-success-50 active:bg-transparent disabled:bg-transparent\n dark:text-success-400 dark:hover:bg-success-300 dark:hover:text-iridium dark:active:bg-transparent dark:active:text-success-400\n dark:focus-visible:bg-success-200 dark:focus-visible:text-iridium dark:focus-visible:active:bg-transparent dark:focus-visible:active:text-success-400\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n color: "success",\n class: `text-success-700 hover:text-success-700 focus-visible:text-success-700 disabled:text-success-200\n active:text-success-700\n dark:text-success-400 dark:hover:text-success-300 dark:active:text-success-400 dark:focus-visible:text-success-200\n dark:disabled:text-secondary-400`\n },\n\n // WARNING COLOR VARIANTS\n {\n variant: "filled",\n color: "warning",\n class: `text-white bg-warning-500 hover:bg-warning-700 hover:text-white \n focus-visible:text-white focus-visible:bg-warning-400 active:bg-warning-500 \n disabled:bg-warning-200 disabled:text-white focus-visible:ring \n focus-visible:ring-[#FBD29C] focus-visible:active:bg-warning-500\n dark:text-iridium dark:bg-warning-400 dark:hover:bg-warning-300 dark:active:bg-warning-400\n dark:focus-visible:ring dark:focus-visible:ring-[#FBD29C] dark:focus-visible:active:bg-warning-300\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "outline",\n color: "warning",\n class: `text-warning-700 hover:text-warning-700 focus-visible:text-warning-700 disabled:text-warning-200\n border border-warning-700 hover:bg-warning-50 hover:border-warning-700\n focus-visible:bg-warning-50 focus-visible:border-warning-700 active:bg-transparent disabled:border-warning-200\n focus-visible:ring focus-visible:ring-[#FBD29C] focus-visible:active:bg-transparent\n dark:text-warning-400 dark:border-warning-400 dark:hover:border-warning-300 dark:hover:text-warning-300 \n dark:active:text-warning-400 dark:active:border-warning-400\n dark:focus-visible:ring dark:focus-visible:ring-[#FBD29C] dark:focus-visible:border-warning-300 \n dark:focus-visible:text-warning-300 dark:focus-visible:active:text-warning-400 dark:focus-visible:active:border-warning-400\n dark:disabled:border-none dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "shade",\n color: "warning",\n class: `text-warning-700 hover:text-warning-700 focus-visible:text-warning-700 disabled:text-warning-200\n hover:bg-warning-50 focus-visible:bg-warning-50 active:bg-transparent disabled:bg-transparent\n dark:text-warning-400 dark:hover:bg-warning-300 dark:hover:text-iridium dark:active:bg-transparent dark:active:text-warning-400\n dark:focus-visible:bg-warning-200 dark:focus-visible:text-iridium dark:focus-visible:active:bg-transparent dark:focus-visible:active:text-warning-400\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n color: "warning",\n class: `text-warning-700 hover:text-warning-700 focus-visible:text-warning-700 disabled:text-warning-200\n active:text-warning-700\n dark:text-warning-400 dark:hover:text-warning-300 dark:active:text-warning-400 dark:focus-visible:text-warning-200\n dark:disabled:text-secondary-400`\n },\n\n // ERROR COLOR VARIANTS\n {\n variant: "filled",\n color: "error",\n class: `text-white bg-error-700 hover:bg-error-700 hover:text-white\n focus-visible:text-white focus-visible:bg-error-700 active:bg-error-700\n disabled:bg-error-200 disabled:text-white focus-visible:ring \n focus-visible:ring-[#F1AE9D] focus-visible:active:bg-error-700\n dark:text-iridium dark:bg-error-400 dark:hover:bg-error-300 dark:active:bg-error-400\n dark:focus-visible:ring dark:focus-visible:ring-[#F1AE9D] dark:focus-visible:active:bg-error-300\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "outline",\n color: "error",\n class: `text-error-700 hover:text-error-700 focus-visible:text-error-700 disabled:text-error-200\n border border-error-700 hover:bg-error-100 hover:border-error-700\n focus-visible:bg-error-50 focus-visible:border-error-700 active:bg-transparent disabled:border-error-200\n focus-visible:ring focus-visible:ring-[#F1AE9D] focus-visible:active:bg-transparent\n dark:text-error-400 dark:border-error-400 dark:hover:border-error-300 dark:hover:text-error-300 \n dark:active:text-error-400 dark:active:border-error-400\n dark:focus-visible:ring dark:focus-visible:ring-[#F1AE9D] dark:focus-visible:border-error-300 \n dark:focus-visible:text-error-300 dark:focus-visible:active:text-error-400 dark:focus-visible:active:border-error-400\n dark:disabled:border-none dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "shade",\n color: "error",\n class: `text-error-700 hover:text-error-700 focus-visible:text-error-700 disabled:text-error-200\n hover:bg-error-100 focus-visible:bg-error-50 active:bg-transparent disabled:bg-transparent\n dark:text-error-400 dark:hover:bg-error-300 dark:hover:text-iridium dark:active:bg-transparent dark:active:text-error-400\n dark:focus-visible:bg-error-200 dark:focus-visible:text-iridium dark:focus-visible:active:bg-transparent dark:focus-visible:active:text-error-400\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n color: "error",\n class: `text-error-700 hover:text-error-700 focus-visible:text-error-700 disabled:text-error-200\n active:text-error-700\n dark:text-error-400 dark:hover:text-error-300 dark:active:text-error-400 dark:focus-visible:text-error-200\n dark:disabled:text-secondary-400`\n },\n\n // GLOBAL DISABLED STATES\n {\n variant: "filled",\n class: `disabled:text-secondary-300 disabled:bg-gray-100\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "outline",\n class: `disabled:text-secondary-300 disabled:border-gray-200\n dark:disabled:border-none dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "shade",\n class: `disabled:text-secondary-300\n dark:disabled:bg-secondary-600 dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n class: `disabled:text-secondary-200\n dark:disabled:text-secondary-400`\n },\n {\n variant: "text",\n class: "p-0"\n },\n\n // PADDED VARIANTS FOR EACH SIZE WHEN THERE ARE CHILDREN\n {\n variant: [ "filled", "outline", "shade" ],\n size: "xs",\n hasChildren: true,\n class: "px-3 py-2"\n },\n {\n variant: [ "filled", "outline", "shade" ],\n size: "sm",\n hasChildren: true,\n class: "px-5 py-2"\n },\n {\n variant: [ "filled", "outline", "shade" ],\n size: "md",\n hasChildren: true,\n class: "px-6 py-2"\n },\n {\n variant: [ "filled", "outline", "shade" ],\n size: "lg",\n hasChildren: true,\n class: "px-[28px] py-3"\n },\n {\n variant: [ "filled", "outline", "shade" ],\n size: "xl",\n hasChildren: true,\n class: "px-7 py-4"\n }\n ],\n defaultVariants: {\n variant: "filled",\n color: "primary",\n size: "md"\n }\n});\n'
1551
1602
  },
1552
1603
  {
1553
1604
  "name": "button.tsx",
1554
- "content": 'import * as React from "react";\nimport type { Placement } from "@floating-ui/react";\n\nimport { Tooltip } from "../tooltip";\nimport { ADPIcon, type TIconType } from "../adpIcon";\nimport { buttonVariants } from "./buttonVariants";\n\nexport const colors = [ "primary", "secondary", "success", "warning", "error" ] as const;\nexport const variants = [ "filled", "outline", "shade", "text" ] as const;\nexport enum ESizes {\n XS = "xs",\n SM = "sm",\n MD = "md",\n LG = "lg",\n XL = "xl"\n}\n\nexport type TColor = ( typeof colors )[number];\nexport type TVariant = ( typeof variants )[number];\nexport type TSize = `${ESizes}`;\n\n/**\n * Button component from Astral UI\n */\nexport interface IButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "css"> {\n /**\n * Size of the button.\n * @default md\n */\n size?: TSize;\n /**\n * Color of the button.\n * @default primary\n */\n color?: TColor;\n /**\n * Variant of the button.\n * @default filled\n */\n variant?: TVariant;\n /**\n * Shows loading animation instead of the button content\n */\n loading?: boolean;\n /**\n * Icon to be displayed before the button\'s content.\n * @description\n * This prop accepts either an IconType (string) or a ReactNode.\n * - If an IconType is provided, it will render an ADPIcon component.\n * - If a ReactNode is provided, it will be rendered as-is.\n */\n prefixIcon?: TIconType | React.ReactNode;\n /**\n * Icon to be displayed after the button\'s content.\n * @description\n * This prop accepts either an IconType (string) or a ReactNode.\n * - If an IconType is provided, it will render an ADPIcon component.\n * - If a ReactNode is provided, it will be rendered as-is.\n */\n suffixIcon?: TIconType | React.ReactNode;\n /**\n * Tooltip to be displayed on hover of the button.\n * @description\n * This prop accepts a ReactNode, if this is passed then the button will render\n * tooltip on hover of the button.\n * This tooltip is only on hover and not on click.\n */\n tooltip?: React.ReactNode;\n /**\n * Placement of the tooltip\n * @default "bottom-end"\n */\n tooltipPlacement?: Placement;\n}\n\n// Map of button size to spinner size\nexport const ButtonSizeToSpinnerMap: Record<\n TSize,\n "xxs" | "xs" | "sm" | "md" | "lg" | "xl"\n> = {\n xs: "xs",\n sm: "xs",\n md: "sm",\n lg: "sm",\n xl: "md"\n};\n\n/**\n * Button component with multiple variants, colors, and sizes.\n *\n * @example\n * ```tsx\n * <Button variant="filled" color="primary" size="md">\n * Click me\n * </Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, IButtonProps>(\n (\n {\n className,\n variant = "filled",\n color = "primary",\n size = "md",\n children,\n disabled,\n loading = false,\n type = "button",\n prefixIcon,\n suffixIcon,\n tooltip,\n tooltipPlacement,\n ...props\n },\n ref\n ) => {\n // Determine if we should show padded styles based on whether children exist\n const hasChildren = Boolean( children );\n\n const buttonClasses = buttonVariants({\n variant,\n color,\n size,\n hasChildren: hasChildren ? true : undefined,\n class: className\n });\n\n // Create the button element\n const buttonElement = (\n <button\n type={type}\n className={buttonClasses}\n disabled={disabled || loading}\n ref={ref}\n {...props}\n >\n {loading ? (\n <ADPIcon icon="spinner" spin size={ButtonSizeToSpinnerMap[size]} />\n ) : (\n prefixIcon && (\n typeof prefixIcon === "string"\n ? <ADPIcon icon={prefixIcon as TIconType} fixedWidth size={ButtonSizeToSpinnerMap[size]} />\n : prefixIcon\n )\n )}\n {children}\n {suffixIcon && (\n typeof suffixIcon === "string"\n ? <ADPIcon icon={suffixIcon as TIconType} fixedWidth size={ButtonSizeToSpinnerMap[size]} />\n : suffixIcon\n )}\n </button>\n );\n\n // If tooltip is present and not null or empty, wrap the button with Tooltip.\n if ( tooltip !== null && tooltip !== undefined && tooltip !== false && tooltip !== "" ) {\n return (\n <Tooltip\n clickable={false}\n trigger={buttonElement}\n triggerAriaLabel={typeof tooltip === "string" ? tooltip : undefined}\n disabled={disabled}\n placement={tooltipPlacement}\n >\n {tooltip}\n </Tooltip>\n );\n }\n\n // Otherwise, return just the button\n return buttonElement;\n }\n);\n\nButton.displayName = "Button";\n'
1605
+ "content": 'import * as React from "react";\nimport type { Placement } from "@floating-ui/react";\n\nimport { Tooltip } from "../tooltip";\nimport { ADPIcon, type TIconType } from "../adpIcon";\nimport { buttonVariants } from "./buttonVariants";\n\nexport const colors = [ "primary", "secondary", "success", "warning", "error" ] as const;\nexport const variants = [ "filled", "outline", "shade", "text" ] as const;\nexport enum ESizes {\n XS = "xs",\n SM = "sm",\n MD = "md",\n LG = "lg",\n XL = "xl"\n}\n\nexport type TColor = ( typeof colors )[number];\nexport type TVariant = ( typeof variants )[number];\nexport type TSize = `${ESizes}`;\n\n/**\n * Button component from Astral UI\n */\nexport interface IButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "css"> {\n /**\n * Size of the button.\n * @default md\n */\n size?: TSize;\n /**\n * Color of the button.\n * @default primary\n */\n color?: TColor;\n /**\n * Variant of the button.\n * @default filled\n */\n variant?: TVariant;\n /**\n * Shows loading animation instead of the button content\n */\n loading?: boolean;\n /**\n * Icon to be displayed before the button\'s content.\n * @description\n * This prop accepts either an IconType (string) or a ReactNode.\n * - If an IconType is provided, it will render an ADPIcon component.\n * - If a ReactNode is provided, it will be rendered as-is.\n */\n prefixIcon?: TIconType | React.ReactNode;\n /**\n * Icon to be displayed after the button\'s content.\n * @description\n * This prop accepts either an IconType (string) or a ReactNode.\n * - If an IconType is provided, it will render an ADPIcon component.\n * - If a ReactNode is provided, it will be rendered as-is.\n */\n suffixIcon?: TIconType | React.ReactNode;\n /**\n * Tooltip to be displayed on hover of the button.\n * @description\n * This prop accepts a ReactNode, if this is passed then the button will render\n * tooltip on hover of the button.\n * This tooltip is only on hover and not on click.\n */\n tooltip?: React.ReactNode;\n /**\n * Placement of the tooltip\n * @default "bottom-end"\n */\n tooltipPlacement?: Placement;\n}\n\n// Map of button size to spinner size\nexport const ButtonSizeToSpinnerMap: Record<\n TSize,\n "xxs" | "xs" | "sm" | "md" | "lg" | "xl"\n> = {\n xs: "xs",\n sm: "xs",\n md: "sm",\n lg: "sm",\n xl: "md"\n};\n\n/**\n * Button component with multiple variants, colors, and sizes.\n *\n * @example\n * ```tsx\n * <Button variant="filled" color="primary" size="md">\n * Click me\n * </Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, IButtonProps>(\n (\n {\n className,\n variant = "filled",\n color = "primary",\n size = "md",\n children,\n disabled,\n loading = false,\n type = "button",\n prefixIcon,\n suffixIcon,\n tooltip,\n tooltipPlacement,\n ...props\n },\n ref\n ) => {\n // Determine if we should show padded styles based on whether children exist\n const hasChildren = Boolean( children );\n\n const buttonClasses = buttonVariants({\n variant,\n color,\n size,\n hasChildren: hasChildren ? true : undefined,\n class: className\n });\n\n // Create the button element\n const buttonElement = (\n <button\n type={type}\n className={buttonClasses}\n disabled={disabled || loading}\n ref={ref}\n {...props}\n >\n {loading ? (\n <ADPIcon icon="spinner" spin size={ButtonSizeToSpinnerMap[size]} />\n ) : (\n prefixIcon && (\n typeof prefixIcon === "string"\n ? <ADPIcon icon={prefixIcon as TIconType} fixedWidth size={ButtonSizeToSpinnerMap[size]} />\n : prefixIcon\n )\n )}\n {children}\n {suffixIcon && (\n typeof suffixIcon === "string"\n ? <ADPIcon icon={suffixIcon as TIconType} fixedWidth size={ButtonSizeToSpinnerMap[size]} />\n : suffixIcon\n )}\n </button>\n );\n\n // If tooltip is present and not null or empty, wrap the button with Tooltip.\n if ( tooltip !== null && tooltip !== undefined && tooltip !== false && tooltip !== "" ) {\n return (\n <Tooltip\n clickable={false}\n trigger={buttonElement}\n placement={tooltipPlacement}\n >\n {tooltip}\n </Tooltip>\n );\n }\n\n // Otherwise, return just the button\n return buttonElement;\n }\n);\n\nButton.displayName = "Button";\n'
1555
1606
  },
1556
1607
  {
1557
1608
  "name": "README.md",
@@ -1584,7 +1635,7 @@ var REGISTRY = {
1584
1635
  },
1585
1636
  {
1586
1637
  "name": "card.tsx",
1587
- "content": 'import * as React from "react";\n\nimport { cardVariants } from "./cardVariants";\nimport { CTAGroup, type ICTAGroupProps } from "../ctaGroup";\n\nconst { base, header, body, footer } = cardVariants();\n\n/**\n * Card component for displaying content in a container with optional header and footer\n */\nexport type TCardProps = React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Card component with optional header, body, and footer\n *\n * @example\n * ```tsx\n * <Card>\n * <Card.Header title="Card Title" />\n * <Card.Body>Card content goes here</Card.Body>\n * <Card.Footer>Footer content</Card.Footer>\n * </Card>\n * ```\n */\nconst CardComponent = React.forwardRef<HTMLDivElement, TCardProps>(\n ({ className, children, ...props }, ref ) => {\n return (\n <div\n ref={ref}\n className={base({ class: className })}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nCardComponent.displayName = "Card";\n\n/**\n * Card header props\n */\nexport interface ICardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {\n /**\n * Title of the card\n */\n title?: React.ReactNode;\n /**\n * Props for the CTAGroup component. Pass an object with the props for the CTAGroup.\n */\n ctaGroupProps?: ICTAGroupProps;\n}\n\n/**\n * Card header component\n *\n * @example\n * ```tsx\n * <Card.Header title="Card Title" />\n * ```\n */\nconst CardHeader = React.forwardRef<HTMLDivElement, ICardHeaderProps>(\n ({ className, title, children, ctaGroupProps, ...props }, ref ) => {\n return (\n <header\n ref={ref}\n className={header({ class: className })}\n data-testid="cardHeader"\n {...props}\n >\n {title && <div className="font-medium">{title}</div>}\n {children}\n {ctaGroupProps && <CTAGroup {...ctaGroupProps} />}\n </header>\n );\n }\n);\n\nCardHeader.displayName = "CardHeader";\n\n/**\n * Card body props\n */\nexport type TCardBodyProps = React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Card body component\n *\n * @example\n * ```tsx\n * <Card.Body>Card content goes here</Card.Body>\n * ```\n */\nconst CardBody = React.forwardRef<HTMLDivElement, TCardBodyProps>(\n ({ className, children, ...props }, ref ) => {\n if ( !children ) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={body({ class: className })}\n data-testid="cardBody"\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nCardBody.displayName = "CardBody";\n\n/**\n * Card footer props\n */\nexport type TCardFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Card footer component\n *\n * @example\n * ```tsx\n * <Card.Footer>Footer content</Card.Footer>\n * ```\n */\nconst CardFooter = React.forwardRef<HTMLDivElement, TCardFooterProps>(\n ({ className, children, ...props }, ref ) => {\n if ( !children ) {\n return null;\n }\n\n return (\n <footer\n ref={ref}\n className={footer({ class: className })}\n data-testid="cardFooter"\n {...props}\n >\n {children}\n </footer>\n );\n }\n);\n\nCardFooter.displayName = "CardFooter";\n\n// Define the compound component type\ntype TCardCompoundComponent = typeof CardComponent & {\n Header: typeof CardHeader;\n Body: typeof CardBody;\n Footer: typeof CardFooter;\n};\n\n// Create the compound component by casting and attaching subcomponents\nconst Card = CardComponent as TCardCompoundComponent;\nCard.Header = CardHeader;\nCard.Body = CardBody;\nCard.Footer = CardFooter;\n\n// Export the compound component and individual components\nexport { Card, CardHeader, CardBody, CardFooter };\n'
1638
+ "content": 'import * as React from "react";\n\nimport { cardVariants } from "./cardVariants";\nimport { CTAGroup, type ICTAGroupProps } from "../ctaGroup";\n\nconst { base, header, body, footer } = cardVariants();\n\n/**\n * Card component for displaying content in a container with optional header and footer\n */\nexport type TCardProps = React.HTMLAttributes<HTMLDivElement>;\n\n// Compound component type with subcomponents attached\ntype TCardCompoundComponent = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<TCardProps> & React.RefAttributes<HTMLDivElement>\n> & {\n Header: typeof CardHeader;\n Body: typeof CardBody;\n Footer: typeof CardFooter;\n};\n\n/**\n * Card component with optional header, body, and footer\n *\n * @example\n * ```tsx\n * <Card>\n * <Card.Header title="Card Title" />\n * <Card.Body>Card content goes here</Card.Body>\n * <Card.Footer>Footer content</Card.Footer>\n * </Card>\n * ```\n */\nexport const Card = React.forwardRef<HTMLDivElement, TCardProps>(\n ({ className, children, ...props }, ref ) => {\n return (\n <div\n ref={ref}\n className={base({ class: className })}\n {...props}\n >\n {children}\n </div>\n );\n }\n) as TCardCompoundComponent;\n\nCard.displayName = "Card";\n\n/**\n * Card header props\n */\nexport interface ICardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {\n /**\n * Title of the card\n */\n title?: React.ReactNode;\n /**\n * Props for the CTAGroup component. Pass an object with the props for the CTAGroup.\n */\n ctaGroupProps?: ICTAGroupProps;\n}\n\n/**\n * Card header component\n *\n * @example\n * ```tsx\n * <Card.Header title="Card Title" />\n * ```\n */\nconst CardHeader = React.forwardRef<HTMLDivElement, ICardHeaderProps>(\n ({ className, title, children, ctaGroupProps, ...props }, ref ) => {\n return (\n <header\n ref={ref}\n className={header({ class: className })}\n data-testid="cardHeader"\n {...props}\n >\n {title && <div className="font-medium">{title}</div>}\n {children}\n {ctaGroupProps && <CTAGroup {...ctaGroupProps} />}\n </header>\n );\n }\n);\n\nCardHeader.displayName = "CardHeader";\n\n/**\n * Card body props\n */\nexport type TCardBodyProps = React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Card body component\n *\n * @example\n * ```tsx\n * <Card.Body>Card content goes here</Card.Body>\n * ```\n */\nconst CardBody = React.forwardRef<HTMLDivElement, TCardBodyProps>(\n ({ className, children, ...props }, ref ) => {\n if ( !children ) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={body({ class: className })}\n data-testid="cardBody"\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nCardBody.displayName = "CardBody";\n\n/**\n * Card footer props\n */\nexport type TCardFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Card footer component\n *\n * @example\n * ```tsx\n * <Card.Footer>Footer content</Card.Footer>\n * ```\n */\nconst CardFooter = React.forwardRef<HTMLDivElement, TCardFooterProps>(\n ({ className, children, ...props }, ref ) => {\n if ( !children ) {\n return null;\n }\n\n return (\n <footer\n ref={ref}\n className={footer({ class: className })}\n data-testid="cardFooter"\n {...props}\n >\n {children}\n </footer>\n );\n }\n);\n\nCardFooter.displayName = "CardFooter";\n\n// Attach the subcomponents\nCard.Header = CardHeader;\nCard.Body = CardBody;\nCard.Footer = CardFooter;\n\n// Export the individual subcomponents\nexport { CardHeader, CardBody, CardFooter };\n'
1588
1639
  },
1589
1640
  {
1590
1641
  "name": "README.md",
@@ -1738,11 +1789,11 @@ export const checkboxVariants = tv({
1738
1789
  },
1739
1790
  {
1740
1791
  "name": "ctaGroupVariants.ts",
1741
- "content": 'import { tv } from "tailwind-variants";\n\nexport const ctaGroupVariants = tv({\n slots: {\n root: "flex gap-1.5 items-center",\n cta: "flex justify-center items-center gap-1 rounded text-gray-800 disabled:text-gray-500 disabled:cursor-not-allowed",\n dropdownItem: "flex items-center justify-start gap-2"\n },\n variants: {\n variant: {\n icon: {\n cta: [\n "p-1",\n "outline-none p-1 bg-transparent font-regular text-base hover:bg-gray-100 focus-visible:bg-gray-50 ",\n "dark:text-secondary-50 dark:hover:bg-secondary-700 dark:hover:text-secondary-100 ",\n "dark:active:text-secondary-50 dark:focus-visible:bg-secondary-600 dark:focus-visible:text-secondary-200 ",\n "dark:focus-visible:active:text-secondary-50"\n ]\n },\n button: {\n cta: [\n "px-2 py-2",\n "border border-gray-400 dark:border-secondary-100",\n "text-base hover:bg-gray-100 focus-visible:bg-gray-50 ",\n "dark:text-secondary-50 dark:hover:bg-secondary-700 dark:hover:text-secondary-100",\n "dark:active:text-secondary-50 dark:focus-visible:bg-secondary-600 dark:focus-visible:text-secondary-200 ",\n "dark:focus-visible:active:text-secondary-50",\n "rounded"\n ]\n }\n }\n }\n});\n'
1792
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const ctaGroupVariants = tv({\n slots: {\n root: "flex gap-1.5 items-center",\n cta: "flex justify-center items-center gap-1 rounded text-gray-900 disabled:text-gray-500 disabled:cursor-not-allowed",\n dropdownItem: "flex items-center justify-start gap-2"\n },\n variants: {\n variant: {\n icon: {\n cta: [\n "p-1",\n "outline-none p-1 bg-transparent font-regular text-base hover:bg-gray-100 focus-visible:bg-gray-50 ",\n "dark:text-secondary-50 dark:hover:bg-secondary-700 dark:hover:text-secondary-100 ",\n "dark:active:text-secondary-50 dark:focus-visible:bg-secondary-600 dark:focus-visible:text-secondary-200 ",\n "dark:focus-visible:active:text-secondary-50"\n ]\n },\n button: {\n cta: [\n "px-2 py-2",\n "border border-gray-400 dark:border-secondary-100",\n "text-base hover:bg-gray-100 focus-visible:bg-gray-50 ",\n "dark:text-secondary-50 dark:hover:bg-secondary-700 dark:hover:text-secondary-100",\n "dark:active:text-secondary-50 dark:focus-visible:bg-secondary-600 dark:focus-visible:text-secondary-200 ",\n "dark:focus-visible:active:text-secondary-50",\n "rounded"\n ]\n }\n }\n }\n});\n'
1742
1793
  },
1743
1794
  {
1744
1795
  "name": "ctaGroup.tsx",
1745
- "content": 'import * as React from "react";\n\nimport { useWindowSize } from "@hooks";\nimport { ADPIcon } from "../adpIcon";\nimport { Dropdown } from "../dropdown";\nimport { Tooltip } from "../tooltip";\nimport { ctaGroupVariants } from "./ctaGroupVariants";\nimport { mobileBreakPoint } from "@constants";\nexport interface ICTAGroupProps {\n /**\n * List of CTAs which render as icons or as dropdown items in case of mobile view\n */\n ctaList: {\n /** Callback to execute when the CTA is clicked */\n callback: () => void;\n /** Icon to render inside the CTA */\n icon: React.ReactNode;\n /** Label for the CTA. Also shown as tooltip when shrink is false. */\n label: React.ReactNode;\n /** Determines whether the CTA should be disabled */\n disabled?: boolean;\n }[];\n /** Determines whether to show the CTAGroup as a dropdown */\n shrink?: boolean;\n /** Overwrite CTAGroup container styles */\n className?: string;\n /** Reference element for rendering dropdown */\n dropdownPortalTarget?: Element;\n /** Threshold for moving extra CTAs into dropdown */\n threshold?: number;\n /** If true, labels are always shown next to icons */\n showLabels?: boolean;\n /**\n * Variant of the CTAGroup.\n * @default icon\n */\n variant?: "icon" | "button";\n}\n\nexport const CTAGroup = React.forwardRef<HTMLDivElement, ICTAGroupProps>(\n (\n {\n ctaList,\n shrink,\n className,\n dropdownPortalTarget,\n threshold,\n showLabels = false,\n variant = "icon"\n },\n ref\n ) => {\n const [ ctaShrinked, setCtaShrinked ] = React.useState( shrink ?? false );\n const { width } = useWindowSize();\n\n React.useEffect(() => {\n if ( shrink !== undefined ) {\n setCtaShrinked( shrink );\n } else {\n if ( width <= mobileBreakPoint && ctaList.length > 2 ) {\n setCtaShrinked( true );\n } else {\n setCtaShrinked( false );\n }\n }\n }, [ width, shrink, ctaList ]);\n\n const numberOfCTAs = ctaList.length;\n const showExtraDropdown = ( ctaShrinked || numberOfCTAs < 3 )\n ? false\n : threshold\n ? numberOfCTAs > threshold\n : false;\n\n const { root, cta: ctaClass, dropdownItem: dropdownItemClass } = ctaGroupVariants({ variant });\n\n const dropDownJSX = (\n <Dropdown\n portalTarget={dropdownPortalTarget}\n ctaClassName={ctaClass()}\n ctaContent={<ADPIcon size="sm" icon="v-menu-filled" />}\n >\n {( showExtraDropdown\n ? [...ctaList].slice( threshold!, numberOfCTAs )\n : ctaList\n ).map(({ icon, callback, label, disabled }, index ) => (\n <Dropdown.Item\n disabled={disabled}\n key={index}\n onClickHandler={callback}\n className={dropdownItemClass()}\n >\n {icon}\n {label}\n </Dropdown.Item>\n ))}\n </Dropdown>\n );\n\n if ( showExtraDropdown ) {\n return (\n <div\n ref={ref}\n data-testid="crossedThreshold"\n className={root({ class: className })}\n >\n {!ctaShrinked &&\n [...ctaList]\n .slice( 0, threshold! )\n .map(({ icon, callback, disabled, label }, index ) =>\n showLabels ? (\n <button\n key={index}\n className={ctaClass()}\n onClick={callback}\n disabled={disabled}\n >\n {icon}\n {label}\n </button>\n ) : (\n <Tooltip\n key={index}\n clickable={false}\n placement="bottom"\n onTriggerClick={() => {\n if ( !disabled ) {\n callback();\n }\n }}\n trigger={icon}\n triggerAriaLabel={label as string}\n triggerElementClassName={ctaClass()}\n disabled={disabled}\n >\n {label}\n </Tooltip>\n )\n )}\n {dropDownJSX}\n </div>\n );\n }\n\n return ctaShrinked ? (\n dropDownJSX\n ) : (\n <div\n ref={ref}\n data-testid="ctaGroup"\n className={root({ class: className })}\n >\n {ctaList.map(({ icon, callback, disabled, label }, index ) =>\n showLabels ? (\n <button\n key={index}\n className={ctaClass()}\n onClick={callback}\n disabled={disabled}\n >\n {icon}\n {label}\n </button>\n ) : (\n <Tooltip\n key={index}\n clickable={false}\n placement="bottom"\n onTriggerClick={() => {\n if ( !disabled ) {\n callback();\n }\n }}\n trigger={icon}\n triggerAriaLabel={label as string}\n triggerElementClassName={ctaClass()}\n disabled={disabled}\n >\n {label}\n </Tooltip>\n )\n )}\n </div>\n );\n }\n);\n\nCTAGroup.displayName = "CTAGroup";\n'
1796
+ "content": 'import * as React from "react";\n\nimport { useWindowSize } from "@hooks";\nimport { ADPIcon } from "../adpIcon";\nimport { Dropdown } from "../dropdown";\nimport { Tooltip } from "../tooltip";\nimport { ctaGroupVariants } from "./ctaGroupVariants";\nimport { mobileBreakPoint } from "@constants";\nexport interface ICTAGroupProps {\n /**\n * List of CTAs which render as icons or as dropdown items in case of mobile view\n */\n ctaList: {\n /** Callback to execute when the CTA is clicked */\n callback: () => void;\n /** Icon to render inside the CTA */\n icon: React.ReactNode;\n /** Label for the CTA. Also shown as tooltip when shrink is false. */\n label: React.ReactNode;\n /** Determines whether the CTA should be disabled */\n disabled?: boolean;\n }[];\n /** Determines whether to show the CTAGroup as a dropdown */\n shrink?: boolean;\n /** Overwrite CTAGroup container styles */\n className?: string;\n /** Reference element for rendering dropdown */\n dropdownPortalTarget?: Element;\n /** Threshold for moving extra CTAs into dropdown */\n threshold?: number;\n /** If true, labels are always shown next to icons */\n showLabels?: boolean;\n /**\n * Variant of the CTAGroup.\n * @default icon\n */\n variant?: "icon" | "button";\n}\n\nexport const CTAGroup = React.forwardRef<HTMLDivElement, ICTAGroupProps>(\n (\n {\n ctaList,\n shrink,\n className,\n dropdownPortalTarget,\n threshold,\n showLabels = false,\n variant = "icon"\n },\n ref\n ) => {\n const [ ctaShrinked, setCtaShrinked ] = React.useState( shrink ?? false );\n const { width } = useWindowSize();\n\n React.useEffect(() => {\n if ( shrink !== undefined ) {\n setCtaShrinked( shrink );\n } else {\n if ( width <= mobileBreakPoint && ctaList.length > 2 ) {\n setCtaShrinked( true );\n } else {\n setCtaShrinked( false );\n }\n }\n }, [ width, shrink, ctaList ]);\n\n const numberOfCTAs = ctaList.length;\n const showExtraDropdown = ( ctaShrinked || numberOfCTAs < 3 )\n ? false\n : threshold\n ? numberOfCTAs > threshold\n : false;\n\n const { root, cta: ctaClass, dropdownItem: dropdownItemClass } = ctaGroupVariants({ variant });\n\n const dropDownJSX = (\n <Dropdown\n portalTarget={dropdownPortalTarget}\n ctaClassName={ctaClass()}\n ctaAriaLabel="More actions"\n ctaContent={<ADPIcon size="sm" icon="v-menu-filled" />}\n >\n {( showExtraDropdown\n ? [...ctaList].slice( threshold!, numberOfCTAs )\n : ctaList\n ).map(({ icon, callback, label, disabled }, index ) => (\n <Dropdown.Item\n disabled={disabled}\n key={index}\n onClickHandler={callback}\n className={dropdownItemClass()}\n >\n {icon}\n {label}\n </Dropdown.Item>\n ))}\n </Dropdown>\n );\n\n if ( showExtraDropdown ) {\n return (\n <div\n ref={ref}\n data-testid="crossedThreshold"\n className={root({ class: className })}\n >\n {!ctaShrinked &&\n [...ctaList]\n .slice( 0, threshold! )\n .map(({ icon, callback, disabled, label }, index ) =>\n showLabels ? (\n <button\n key={index}\n className={ctaClass()}\n onClick={callback}\n disabled={disabled}\n >\n {icon}\n {label}\n </button>\n ) : (\n <Tooltip\n key={index}\n clickable={false}\n placement="bottom"\n trigger={\n <button\n className={ctaClass()}\n onClick={callback}\n disabled={disabled}\n aria-label={label as string}\n >\n {icon}\n </button>\n }\n >\n {label}\n </Tooltip>\n )\n )}\n {dropDownJSX}\n </div>\n );\n }\n\n return ctaShrinked ? (\n dropDownJSX\n ) : (\n <div\n ref={ref}\n data-testid="ctaGroup"\n className={root({ class: className })}\n >\n {ctaList.map(({ icon, callback, disabled, label }, index ) =>\n showLabels ? (\n <button\n key={index}\n className={ctaClass()}\n onClick={callback}\n disabled={disabled}\n >\n {icon}\n {label}\n </button>\n ) : (\n <Tooltip\n key={index}\n clickable={false}\n placement="bottom"\n trigger={\n <button\n className={ctaClass()}\n onClick={callback}\n disabled={disabled}\n aria-label={label as string}\n >\n {icon}\n </button>\n }\n >\n {label}\n </Tooltip>\n )\n )}\n </div>\n );\n }\n);\n\nCTAGroup.displayName = "CTAGroup";\n'
1746
1797
  },
1747
1798
  {
1748
1799
  "name": "README.md",
@@ -1793,7 +1844,7 @@ export const checkboxVariants = tv({
1793
1844
  },
1794
1845
  {
1795
1846
  "name": "pageSizeModal.tsx",
1796
- "content": 'import * as React from "react";\nimport { useMemo, useState } from "react";\n\nimport { ADPIcon, iconList } from "../adpIcon/adpIcon";\nimport { Button } from "../button/button";\nimport { Modal, ModalHeader, ModalBody } from "../modal/modal";\nimport { Radio } from "../radio/radio";\n\nexport interface IPageSizeModalProps {\n show: boolean;\n toggleVisibility: () => void;\n onPageSizeChange?: ( args: number ) => void;\n onPageChange?: ( args: number ) => void;\n pageSize: number;\n pageSizeOptions?: number[];\n}\n\nexport const PageSizeModal = ({\n show,\n pageSize,\n pageSizeOptions,\n toggleVisibility,\n onPageSizeChange: setPageSize,\n onPageChange\n}: IPageSizeModalProps ) => {\n const [ selectedPageSize, setSelectedPageSize ] = useState<number>( pageSize );\n\n const handlePageSizeChange = ( e: React.ChangeEvent<HTMLInputElement> ) => {\n setSelectedPageSize( Number( e.target.value ));\n };\n\n const onPageLimitChangeHandler = () => {\n // Reset to first page\n onPageChange?.( 1 );\n // Update page size\n setPageSize?.( selectedPageSize );\n toggleVisibility();\n };\n\n const sortedPageSizeOptions = useMemo(() => {\n const unique = pageSizeOptions?.filter(\n ( value, index ) => pageSizeOptions?.indexOf( value ) === index\n );\n return unique?.sort(( a, b ) => a - b );\n }, [pageSizeOptions]);\n\n return (\n <Modal showModal={show} closeButton={false} onHide={toggleVisibility}>\n <ModalHeader className="font-medium flex-col">\n <div className="mb-5 w-9 h-9 rounded-full bg-primary-50 flex justify-center items-center dark:bg-secondary-500">\n <ADPIcon\n icon={iconList.editFilled}\n size="md"\n className="text-primary-500 dark:text-primary-400"\n />\n </div>\n <div className="flex flex-col gap-2">\n <h3 className="text-lg font-semibold text-secondary-800 dark:text-secondary-50">Records per page</h3>\n <p className="text-sm font-normal text-secondary-600 dark:text-secondary-300">\n Set the number records to be displayed per page\n </p>\n </div>\n </ModalHeader>\n <ModalBody className="mt-5">\n <div className="pb-7 flex flex-wrap gap-4">\n {sortedPageSizeOptions?.map(( el ) => (\n <Radio\n key={el}\n name="pageSize"\n size="sm"\n value={el.toString()}\n label={el.toString()}\n checked={el === selectedPageSize}\n onChange={handlePageSizeChange}\n />\n ))}\n </div>\n <div className="flex items-center gap-4 justify-end mt-4">\n <Button variant="outline" onClick={toggleVisibility}>\n Cancel\n </Button>\n <Button onClick={onPageLimitChangeHandler}>Confirm</Button>\n </div>\n </ModalBody>\n </Modal>\n );\n};\n'
1847
+ "content": 'import * as React from "react";\nimport { useMemo, useState } from "react";\n\nimport { ADPIcon, iconList } from "../adpIcon/adpIcon";\nimport { Button } from "../button/button";\nimport { Modal, ModalHeader, ModalBody } from "../modal/modal";\nimport { Radio } from "../radio/radio";\n\nexport interface IPageSizeModalProps {\n show: boolean;\n toggleVisibility: () => void;\n onPageSizeChange?: ( args: number ) => void;\n onPageChange?: ( args: number ) => void;\n pageSize: number;\n pageSizeOptions?: number[];\n}\n\nexport const PageSizeModal = ({\n show,\n pageSize,\n pageSizeOptions,\n toggleVisibility,\n onPageSizeChange: setPageSize,\n onPageChange\n}: IPageSizeModalProps ) => {\n const [ selectedPageSize, setSelectedPageSize ] = useState<number>( pageSize );\n\n const handlePageSizeChange = ( e: React.ChangeEvent<HTMLInputElement> ) => {\n setSelectedPageSize( Number( e.target.value ));\n };\n\n const onPageLimitChangeHandler = () => {\n // Reset to first page\n onPageChange?.( 1 );\n // Update page size\n setPageSize?.( selectedPageSize );\n toggleVisibility();\n };\n\n const sortedPageSizeOptions = useMemo(() => {\n const unique = pageSizeOptions?.filter(\n ( value, index ) => pageSizeOptions?.indexOf( value ) === index\n );\n return unique?.sort(( a, b ) => a - b );\n }, [pageSizeOptions]);\n\n return (\n <Modal showModal={show} closeButton={false} onHide={toggleVisibility}>\n <ModalHeader className="font-medium flex-col">\n <div className="mb-5 w-9 h-9 rounded-full bg-primary-100 flex justify-center items-center dark:bg-secondary-500">\n <ADPIcon\n icon={iconList.editFilled}\n size="md"\n className="text-primary-700 dark:text-primary-400"\n />\n </div>\n <div className="flex flex-col gap-2">\n <h3 className="text-lg font-semibold text-secondary-800 dark:text-secondary-50">Records per page</h3>\n <p className="text-sm font-normal text-secondary-600 dark:text-secondary-300">\n Set the number records to be displayed per page\n </p>\n </div>\n </ModalHeader>\n <ModalBody className="mt-5">\n <div className="pb-7 flex flex-wrap gap-4">\n {sortedPageSizeOptions?.map(( el ) => (\n <Radio\n key={el}\n name="pageSize"\n size="sm"\n value={el.toString()}\n label={el.toString()}\n checked={el === selectedPageSize}\n onChange={handlePageSizeChange}\n />\n ))}\n </div>\n <div className="flex items-center gap-4 justify-end mt-4">\n <Button variant="outline" onClick={toggleVisibility}>\n Cancel\n </Button>\n <Button onClick={onPageLimitChangeHandler}>Confirm</Button>\n </div>\n </ModalBody>\n </Modal>\n );\n};\n'
1797
1848
  },
1798
1849
  {
1799
1850
  "name": "index.ts",
@@ -1801,7 +1852,7 @@ export const checkboxVariants = tv({
1801
1852
  },
1802
1853
  {
1803
1854
  "name": "dataTableVariants.ts",
1804
- "content": 'import { tv } from "tailwind-variants";\n\nexport const dataTableVariants = tv({\n slots: {\n container: "relative overflow-hidden p-1 w-full",\n table: "w-full h-full table-auto overflow-scroll border-collapse",\n cell: [\n "text-sm text-secondary-500 min-h-12 px-6 py-4 min-w-40 border-b border-gray-100 first:bg-white",\n "dark:bg-transparent dark:text-secondary-50 dark:first:bg-iridium dark:border-secondary-500"\n ],\n headerCell: [\n "text-xs font-medium text-secondary-500 text-start h-8 px-6 py-2.5 min-w-40 border-b border-gray-100",\n "capitalize bg-gray-100 sticky top-0 dark:!bg-secondary-500 dark:text-secondary-50 dark:border-secondary-500"\n ],\n head: "sticky top-0 z-10",\n selectable: "first:w-[56px] first:pr-3 first:min-w-[44px] first:pl-6",\n pagination: "px-6 py-3.5 border border-secondary-100 border-t-0 rounded-b dark:border-secondary-500",\n filters: "flex flex-wrap items-center gap-4 mb-4",\n filterSearch: "w-full md:max-w-[22rem]",\n filterSelect: "max-w-96 min-w-52",\n advancedFilterButton: "min-w-fit font-medium text-primary-500 dark:text-primary-400 h-9",\n resizer: [\n "opacity-0 absolute top-1/2 rounded-sm -translate-y-1/2 h-3/5 w-0.5",\n "bg-secondary-300 cursor-col-resize select-none touch-none hover:opacity-100"\n ],\n containerInner: "overflow-auto relative rounded-t border border-gray-100 z-0 dark:border-secondary-500",\n emptyState: "h-screen w-full inline-flex gap-4 flex-col items-center justify-center",\n selectedFilter: "text-gray-800 dark:bg-secondary-600 dark:border dark:border-secondary-500",\n selectedFilterContainer: "flex gap-3 mb-4 flex-wrap",\n selectedFilterLabel: "text-secondary-400 text-xs dark:text-secondary-200",\n recordsInfo: "text-secondary-400 text-sm mb-4 dark:text-secondary-200",\n columnSettings: [\n "relative py-1 px-1 rounded hover:bg-gray-100 text-gray-700 cursor-pointer overflow-hidden",\n "dark:text-secondary-200 dark:hover:bg-secondary-700"\n ]\n },\n variants: {\n direction: {\n ltr: { resizer: "right-0" },\n rtl: { resizer: "left-0" }\n },\n isResizing: {\n true: { resizer: "bg-secondary-500 opacity-100" }\n }\n },\n defaultVariants: {\n direction: "ltr"\n }\n});\n'
1855
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const dataTableVariants = tv({\n slots: {\n container: "relative overflow-hidden p-1 w-full",\n table: "w-full h-full table-auto overflow-scroll border-collapse",\n cell: [\n "text-sm text-secondary-500 min-h-12 px-6 py-4 min-w-40 border-b border-gray-100 first:bg-white",\n "dark:bg-transparent dark:text-secondary-50 dark:first:bg-iridium dark:border-secondary-500"\n ],\n headerCell: [\n "text-xs font-medium text-secondary-500 text-start h-8 px-6 py-2.5 min-w-40 border-b border-gray-100",\n "capitalize bg-gray-100 sticky top-0 dark:!bg-secondary-500 dark:text-secondary-50 dark:border-secondary-500"\n ],\n head: "sticky top-0 z-10",\n selectable: "first:w-[56px] first:pr-3 first:min-w-[44px] first:pl-6",\n pagination: "px-6 py-3.5 border border-secondary-100 border-t-0 rounded-b dark:border-secondary-500",\n filters: "flex flex-wrap items-center gap-4 mb-4",\n filterSearch: "w-full md:max-w-[22rem]",\n filterSelect: "max-w-96 min-w-52",\n advancedFilterButton: "min-w-fit font-medium text-primary-700 dark:text-primary-400 h-9",\n resizer: [\n "opacity-0 absolute top-1/2 rounded-sm -translate-y-1/2 h-3/5 w-0.5",\n "bg-secondary-300 cursor-col-resize select-none touch-none hover:opacity-100"\n ],\n containerInner: "overflow-auto relative rounded-t border border-gray-100 z-0 dark:border-secondary-500",\n emptyState: "h-screen w-full inline-flex gap-4 flex-col items-center justify-center",\n selectedFilter: "text-gray-800 dark:bg-secondary-600 dark:border dark:border-secondary-500",\n selectedFilterContainer: "flex gap-3 mb-4 flex-wrap",\n selectedFilterLabel: "text-secondary-400 text-xs dark:text-secondary-200",\n recordsInfo: "text-secondary-400 text-sm mb-4 dark:text-secondary-200",\n columnSettings: [\n "relative py-1 px-1 rounded hover:bg-gray-100 text-gray-700 cursor-pointer overflow-hidden",\n "dark:text-secondary-200 dark:hover:bg-secondary-700"\n ]\n },\n variants: {\n direction: {\n ltr: { resizer: "right-0" },\n rtl: { resizer: "left-0" }\n },\n isResizing: {\n true: { resizer: "bg-secondary-500 opacity-100" }\n }\n },\n defaultVariants: {\n direction: "ltr"\n }\n});\n'
1805
1856
  },
1806
1857
  {
1807
1858
  "name": "dataTable.tsx",
@@ -1809,7 +1860,7 @@ export const checkboxVariants = tv({
1809
1860
  },
1810
1861
  {
1811
1862
  "name": "advancedFilters.tsx",
1812
- "content": 'import { useEffect, useMemo, useState } from "react";\n\nimport { ADPIcon, iconList } from "../adpIcon/adpIcon";\nimport { Button } from "../button/button";\nimport { Checkbox } from "../checkbox/checkbox";\nimport { Radio } from "../radio/radio";\nimport { Panel } from "../panel/panel";\nimport { Accordion } from "../accordion/accordion";\nimport { dataTableVariants } from "./dataTableVariants";\n\nimport type { TAdvancedFilterItem, TFilterItem } from "./types";\n\ninterface IAdvancedFilterProps {\n advancedFilters?: TAdvancedFilterItem[];\n basicFilters?: TFilterItem[];\n selectedFilters: Record<string, any>;\n setSelectedFilters: ( filters: Record<string, any> ) => void;\n handleClearFilter: () => void;\n}\n\nexport const AdvancedFilters = ({\n advancedFilters,\n basicFilters,\n selectedFilters,\n setSelectedFilters,\n handleClearFilter\n}: IAdvancedFilterProps ) => {\n const [ selectedAdvancedFilters, setSelectedAdvancedFilters ] = useState( selectedFilters );\n const [ showPanel, setShowPanel ] = useState<boolean>( false );\n\n // For handling advance filter-\n const handleAdvanceFilterChange = ( e: any, id: any ) => {\n if ( e.target.type === "checkbox" ) {\n const newFilterValue = { value: e.target.value, label: e.target.name };\n setSelectedAdvancedFilters(( prev:any ) => {\n const updatedVal = { ...prev };\n const currentSelectedValues = updatedVal[id] || [];\n\n if ( e.target.checked ) {\n updatedVal[id] = [ ...currentSelectedValues, newFilterValue ];\n } else {\n updatedVal[id] = currentSelectedValues.filter(\n ( item: any ) => item.label !== e.target.name\n );\n if ( updatedVal[id].length === 0 ) {\n delete updatedVal[id];\n }\n }\n return updatedVal;\n });\n } else if ( e.target.type === "radio" ) {\n setSelectedAdvancedFilters(( prev:any ) => ({\n ...prev,\n [id]: { value: e.target.value, label: e.target.name }\n }));\n }\n advancedFilters?.find(( el: any ) => el.id === id )?.onChange?.();\n };\n\n const customSelectedFilter = useMemo(() => {\n return advancedFilters?.filter(( filter ) => "selectedValue" in filter );\n }, [advancedFilters]);\n\n const handleApplyFilter = () => {\n let updatedFilters = {\n ...selectedFilters,\n ...selectedAdvancedFilters\n };\n advancedFilters?.forEach(( filter ) => {\n if ( filter?.selectedValue ) {\n updatedFilters = {\n ...updatedFilters,\n ...filter.selectedValue\n };\n }\n });\n setSelectedFilters( updatedFilters );\n setShowPanel( false );\n };\n\n const basicFilterIds = basicFilters?.map(( filter: any ) => filter.id );\n const advanceFilterSelectedLength = useMemo(() => {\n return Object.keys( selectedAdvancedFilters ).filter(( key ) => !basicFilterIds?.includes( key )).length;\n }, [ basicFilterIds, selectedAdvancedFilters ]);\n\n useEffect(() => {\n setSelectedAdvancedFilters( selectedFilters );\n }, [selectedFilters]);\n\n useEffect(() => {\n let updatedFilters = {\n ...selectedAdvancedFilters\n };\n customSelectedFilter?.forEach(( filter ) => {\n if ( filter?.selectedValue ) {\n updatedFilters = {\n ...updatedFilters,\n ...filter.selectedValue\n };\n } else {\n Object.keys( updatedFilters ).forEach(( key ) => {\n if ( key === filter.id ) {\n delete updatedFilters[key];\n }\n });\n }\n });\n setSelectedAdvancedFilters( updatedFilters );\n // Adding selectedAdvancedFilters to the dependency array causes an infinite re-render\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [customSelectedFilter]);\n\n if ( !advancedFilters?.length ) {\n return null;\n }\n\n const { advancedFilterButton } = dataTableVariants();\n\n return (\n <>\n <Button\n onClick={() => setShowPanel( true )}\n prefixIcon={iconList.filter}\n size="xs"\n variant="text"\n color="primary"\n data-testid="advanced-filter-btn"\n className={advancedFilterButton({ class: "min-w-fit" })}\n >\n Advanced Filters\n </Button>\n <Panel showPanel={showPanel} className="table-filter" data-testid={"table-filter-panel"}>\n <Panel.Header\n showCloseButton\n header="Filters"\n subHeader="Apply filters to narrow down your search results"\n onCloseHandler={() => setShowPanel( false )}\n />\n <Panel.Body className="bg-frostBlue dark:bg-iridium">\n {advancedFilters?.map(( props: any ) => {\n const selectedCount = selectedAdvancedFilters[props.id]?.length;\n return <Accordion key={props.id} className="mb-6" expand data-testid={`table-filter-${props.id}`}>\n <Accordion.Header className="">\n <div className="text-left">\n <p className="flex items-center text-sm leading-5 font-semibold text-secondary-500">\n <ADPIcon icon={props.icon} size="xs" className="!inline-block text-gray-800 me-1" />\n {props.title} {(( props.isMulti || props.selectedValue ) && ( selectedCount !== undefined && selectedCount > 0 )) &&\n <span className="text-success-700 dark:text-success-400 font-medium ms-4">{`${selectedCount} selected`}</span>}\n </p>\n <span className="text-xs leading-[130%] text-secondary-300">{props.subTitle}</span>\n </div>\n </Accordion.Header>\n <Accordion.Body className={props.render ? "!bg-transparent !p-0.5" : undefined}>\n <div className="flex flex-col gap-4">\n {props.isMulti && props?.options?.length > 0\n ? props.options.map(( option: any ) => (\n <Checkbox\n key={option.value}\n label={option.label}\n name={option.label}\n value={option.value}\n size="sm"\n onChange={( e ) => handleAdvanceFilterChange( e, props.id )}\n checked={selectedAdvancedFilters[props.id]?.findIndex(\n ( item: any ) => item.value === option.value\n ) > -1}\n />\n ))\n : !props.isMulti && props?.options?.length > 0\n ? props.options.map(( option: any ) => (\n <Radio\n key={option.value}\n label={option.label}\n name={option.label}\n value={option.value}\n onChange={( e ) => handleAdvanceFilterChange( e, props.id )}\n checked={selectedAdvancedFilters[props.id]?.value === option.value}\n />\n )) : typeof ( props?.render ) === "function" ? props?.render() : props?.render}\n </div>\n </Accordion.Body>\n </Accordion>;\n })}\n </Panel.Body>\n <Panel.Footer className="min-h-0 py-4">\n <div className="flex justify-end gap-4">\n <Button variant="outline" color="secondary" onClick ={() => {\n handleClearFilter();\n setShowPanel( false );\n }}>Clear Filters</Button>\n <Button\n onClick ={() => {\n handleApplyFilter();\n setShowPanel( false );\n }}\n disabled={advanceFilterSelectedLength === 0}\n >\n Apply {\n advanceFilterSelectedLength !== 0 && advanceFilterSelectedLength\n } Filters\n </Button>\n </div>\n </Panel.Footer>\n </Panel>\n </>\n );\n};\n'
1863
+ "content": 'import { useEffect, useMemo, useState } from "react";\n\nimport { ADPIcon, iconList } from "../adpIcon/adpIcon";\nimport { Button } from "../button/button";\nimport { Checkbox } from "../checkbox/checkbox";\nimport { Radio } from "../radio/radio";\nimport { Panel } from "../panel/panel";\nimport { Accordion } from "../accordion/accordion";\nimport { dataTableVariants } from "./dataTableVariants";\n\nimport type { TAdvancedFilterItem, TFilterItem } from "./types";\n\ninterface IAdvancedFilterProps {\n advancedFilters?: TAdvancedFilterItem[];\n basicFilters?: TFilterItem[];\n selectedFilters: Record<string, any>;\n setSelectedFilters: ( filters: Record<string, any> ) => void;\n handleClearFilter: () => void;\n}\n\nexport const AdvancedFilters = ({\n advancedFilters,\n basicFilters,\n selectedFilters,\n setSelectedFilters,\n handleClearFilter\n}: IAdvancedFilterProps ) => {\n const [ selectedAdvancedFilters, setSelectedAdvancedFilters ] = useState( selectedFilters );\n const [ showPanel, setShowPanel ] = useState<boolean>( false );\n\n // For handling advance filter-\n const handleAdvanceFilterChange = ( e: any, id: any ) => {\n if ( e.target.type === "checkbox" ) {\n const newFilterValue = { value: e.target.value, label: e.target.name };\n setSelectedAdvancedFilters(( prev:any ) => {\n const updatedVal = { ...prev };\n const currentSelectedValues = updatedVal[id] || [];\n\n if ( e.target.checked ) {\n updatedVal[id] = [ ...currentSelectedValues, newFilterValue ];\n } else {\n updatedVal[id] = currentSelectedValues.filter(\n ( item: any ) => item.label !== e.target.name\n );\n if ( updatedVal[id].length === 0 ) {\n delete updatedVal[id];\n }\n }\n return updatedVal;\n });\n } else if ( e.target.type === "radio" ) {\n setSelectedAdvancedFilters(( prev:any ) => ({\n ...prev,\n [id]: { value: e.target.value, label: e.target.name }\n }));\n }\n advancedFilters?.find(( el: any ) => el.id === id )?.onChange?.();\n };\n\n const customSelectedFilter = useMemo(() => {\n return advancedFilters?.filter(( filter ) => "selectedValue" in filter );\n }, [advancedFilters]);\n\n const handleApplyFilter = () => {\n let updatedFilters = {\n ...selectedFilters,\n ...selectedAdvancedFilters\n };\n advancedFilters?.forEach(( filter ) => {\n if ( filter?.selectedValue ) {\n updatedFilters = {\n ...updatedFilters,\n ...filter.selectedValue\n };\n }\n });\n setSelectedFilters( updatedFilters );\n setShowPanel( false );\n };\n\n const basicFilterIds = basicFilters?.map(( filter: any ) => filter.id );\n const advanceFilterSelectedLength = useMemo(() => {\n return Object.keys( selectedAdvancedFilters ).filter(( key ) => !basicFilterIds?.includes( key )).length;\n }, [ basicFilterIds, selectedAdvancedFilters ]);\n\n useEffect(() => {\n setSelectedAdvancedFilters( selectedFilters );\n }, [selectedFilters]);\n\n useEffect(() => {\n let updatedFilters = {\n ...selectedAdvancedFilters\n };\n customSelectedFilter?.forEach(( filter ) => {\n if ( filter?.selectedValue ) {\n updatedFilters = {\n ...updatedFilters,\n ...filter.selectedValue\n };\n } else {\n Object.keys( updatedFilters ).forEach(( key ) => {\n if ( key === filter.id ) {\n delete updatedFilters[key];\n }\n });\n }\n });\n setSelectedAdvancedFilters( updatedFilters );\n // Adding selectedAdvancedFilters to the dependency array causes an infinite re-render\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [customSelectedFilter]);\n\n if ( !advancedFilters?.length ) {\n return null;\n }\n\n const { advancedFilterButton } = dataTableVariants();\n\n return (\n <>\n <Button\n onClick={() => setShowPanel( true )}\n prefixIcon={iconList.filter}\n size="xs"\n variant="text"\n color="primary"\n data-testid="advanced-filter-btn"\n className={advancedFilterButton({ class: "min-w-fit" })}\n >\n Advanced Filters\n </Button>\n <Panel showPanel={showPanel} className="table-filter" data-testid={"table-filter-panel"}>\n <Panel.Header\n showCloseButton\n header="Filters"\n subHeader="Apply filters to narrow down your search results"\n onCloseHandler={() => setShowPanel( false )}\n />\n <Panel.Body className="bg-frostBlue dark:bg-iridium">\n {advancedFilters?.map(( props: any ) => {\n const selectedCount = selectedAdvancedFilters[props.id]?.length;\n return <Accordion key={props.id} className="mb-6" expand data-testid={`table-filter-${props.id}`}>\n <Accordion.Header className="">\n <div className="text-left">\n <p className="flex items-center text-sm leading-5 font-semibold text-secondary-500">\n <ADPIcon icon={props.icon} size="xs" className="!inline-block text-gray-900 me-1" />\n {props.title} {(( props.isMulti || props.selectedValue ) && ( selectedCount !== undefined && selectedCount > 0 )) &&\n <span className="text-success-700 dark:text-success-400 font-medium ms-4">{`${selectedCount} selected`}</span>}\n </p>\n <span className="text-xs leading-[130%] text-secondary-300">{props.subTitle}</span>\n </div>\n </Accordion.Header>\n <Accordion.Body className={props.render ? "!bg-transparent !p-0.5" : undefined}>\n <div className="flex flex-col gap-4">\n {props.isMulti && props?.options?.length > 0\n ? props.options.map(( option: any ) => (\n <Checkbox\n key={option.value}\n label={option.label}\n name={option.label}\n value={option.value}\n size="sm"\n onChange={( e ) => handleAdvanceFilterChange( e, props.id )}\n checked={selectedAdvancedFilters[props.id]?.findIndex(\n ( item: any ) => item.value === option.value\n ) > -1}\n />\n ))\n : !props.isMulti && props?.options?.length > 0\n ? props.options.map(( option: any ) => (\n <Radio\n key={option.value}\n label={option.label}\n name={option.label}\n value={option.value}\n onChange={( e ) => handleAdvanceFilterChange( e, props.id )}\n checked={selectedAdvancedFilters[props.id]?.value === option.value}\n />\n )) : typeof ( props?.render ) === "function" ? props?.render() : props?.render}\n </div>\n </Accordion.Body>\n </Accordion>;\n })}\n </Panel.Body>\n <Panel.Footer className="min-h-0 py-4">\n <div className="flex justify-end gap-4">\n <Button variant="outline" color="secondary" onClick ={() => {\n handleClearFilter();\n setShowPanel( false );\n }}>Clear Filters</Button>\n <Button\n onClick ={() => {\n handleApplyFilter();\n setShowPanel( false );\n }}\n disabled={advanceFilterSelectedLength === 0}\n >\n Apply {\n advanceFilterSelectedLength !== 0 && advanceFilterSelectedLength\n } Filters\n </Button>\n </div>\n </Panel.Footer>\n </Panel>\n </>\n );\n};\n'
1813
1864
  },
1814
1865
  {
1815
1866
  "name": "README.md",
@@ -1870,7 +1921,7 @@ export const checkboxVariants = tv({
1870
1921
  },
1871
1922
  {
1872
1923
  "name": "distributionSliderVariants.ts",
1873
- "content": 'import { tv } from "tailwind-variants";\n\nexport const distributionSliderVariants = tv({\n slots: {\n container: "flex flex-col gap-3",\n label: "text-base font-medium text-secondary-400 dark:text-secondary-300",\n sliderWrapper: "flex flex-col gap-2",\n segmentLabels: "flex justify-between gap-2 max-md:flex-col max-md:gap-1",\n segmentLabel: "flex flex-col items-center gap-1 text-xs max-md:flex-row max-md:justify-between max-md:items-center",\n segmentName: "text-secondary-400 font-medium dark:text-secondary-300",\n segmentValue: "text-secondary-500 font-semibold dark:text-secondary-200",\n sliderTrack: [\n "relative bg-secondary-100 rounded-md cursor-pointer overflow-hidden",\n "select-none transition-all duration-150 ease-out",\n "dark:bg-secondary-800"\n ],\n segmentBackground: "absolute top-0 h-full transition-all duration-150 ease-out opacity-80 hover:opacity-90",\n segmentDivider: [\n "absolute top-0 w-2 h-full bg-white cursor-col-resize shadow-md",\n "border border-secondary-300 rounded-sm transition-all duration-150 ease-in-out",\n "-translate-x-1/2 z-10 hover:bg-secondary-50 hover:border-secondary-400 hover:shadow-lg",\n "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2"\n ],\n helperText: "text-xs font-normal"\n },\n variants: {\n size: {\n md: {\n segmentLabel: "text-xs",\n segmentName: "text-xs",\n segmentValue: "text-sm",\n sliderTrack: "h-6"\n },\n lg: {\n segmentLabel: "text-sm",\n segmentName: "text-sm",\n segmentValue: "text-base",\n sliderTrack: "h-7 rounded-xl"\n }\n },\n disabled: {\n true: {\n sliderTrack: "cursor-not-allowed opacity-50 dark:bg-secondary-800 dark:opacity-50",\n segmentDivider: "cursor-not-allowed"\n },\n false: {}\n },\n error: {\n true: {\n sliderTrack: "ring-2 ring-error-500 dark:ring-error-400",\n helperText: "text-error-500 dark:text-error-400"\n },\n false: {\n helperText: "text-secondary-400 dark:text-secondary-200"\n }\n },\n dragging: {\n true: {\n segmentDivider: "bg-primary-50 border-primary-400 shadow-xl dark:bg-primary-300 dark:border-primary-400"\n },\n false: {}\n },\n focused: {\n true: {\n segmentDivider: "bg-primary-100 border-primary-500 shadow-lg dark:bg-primary-200 dark:border-primary-400"\n },\n false: {}\n }\n },\n defaultVariants: {\n size: "md",\n disabled: false,\n error: false,\n dragging: false,\n focused: false\n }\n});\n'
1924
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const distributionSliderVariants = tv({\n slots: {\n container: "flex flex-col gap-3",\n label: "text-base font-medium text-secondary-400 dark:text-secondary-300",\n sliderWrapper: "flex flex-col gap-2",\n segmentLabels: "flex justify-between gap-2 max-md:flex-col max-md:gap-1",\n segmentLabel: "flex flex-col items-center gap-1 text-xs max-md:flex-row max-md:justify-between max-md:items-center",\n segmentName: "text-secondary-400 font-medium dark:text-secondary-300",\n segmentValue: "text-secondary-500 font-semibold dark:text-secondary-200",\n sliderTrack: [\n "relative bg-secondary-100 rounded-md cursor-pointer overflow-hidden",\n "select-none transition-all duration-150 ease-out",\n "dark:bg-secondary-800"\n ],\n segmentBackground: "absolute top-0 h-full transition-all duration-150 ease-out opacity-80 hover:opacity-90",\n segmentDivider: [\n "absolute top-0 w-2 h-full bg-white cursor-col-resize shadow-md",\n "border border-secondary-300 rounded-sm transition-all duration-150 ease-in-out",\n "-translate-x-1/2 z-10 hover:bg-secondary-50 hover:border-secondary-400 hover:shadow-lg",\n "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2"\n ],\n helperText: "text-xs font-normal"\n },\n variants: {\n size: {\n md: {\n segmentLabel: "text-xs",\n segmentName: "text-xs",\n segmentValue: "text-sm",\n sliderTrack: "h-6"\n },\n lg: {\n segmentLabel: "text-sm",\n segmentName: "text-sm",\n segmentValue: "text-base",\n sliderTrack: "h-7 rounded-xl"\n }\n },\n disabled: {\n true: {\n sliderTrack: "cursor-not-allowed opacity-50 dark:bg-secondary-800 dark:opacity-50",\n segmentDivider: "cursor-not-allowed"\n },\n false: {}\n },\n error: {\n true: {\n sliderTrack: "ring-2 ring-error-700 dark:ring-error-400",\n helperText: "text-error-700 dark:text-error-400"\n },\n false: {\n helperText: "text-secondary-400 dark:text-secondary-200"\n }\n },\n dragging: {\n true: {\n segmentDivider: "bg-primary-50 border-primary-400 shadow-xl dark:bg-primary-300 dark:border-primary-400"\n },\n false: {}\n },\n focused: {\n true: {\n segmentDivider: "bg-primary-100 border-primary-500 shadow-lg dark:bg-primary-200 dark:border-primary-400"\n },\n false: {}\n }\n },\n defaultVariants: {\n size: "md",\n disabled: false,\n error: false,\n dragging: false,\n focused: false\n }\n});\n'
1874
1925
  },
1875
1926
  {
1876
1927
  "name": "distributionSlider.tsx",
@@ -1893,7 +1944,9 @@ export const checkboxVariants = tv({
1893
1944
  "@floating-ui/react",
1894
1945
  "tailwind-merge"
1895
1946
  ],
1896
- "internalDependencies": [],
1947
+ "internalDependencies": [
1948
+ "button"
1949
+ ],
1897
1950
  "files": [
1898
1951
  {
1899
1952
  "name": "index.ts",
@@ -2036,11 +2089,11 @@ DropdownItem.displayName = "DropdownItem";
2036
2089
  },
2037
2090
  {
2038
2091
  "name": "dropdown.tsx",
2039
- "content": 'import React, { useState, useCallback, useEffect, forwardRef } from "react";\nimport ReactDOM from "react-dom";\nimport { useFloating, offset, flip, shift, autoUpdate } from "@floating-ui/react";\nimport { cn } from "tailwind-variants";\n\nimport { dropdownVariants } from "./dropdownVariants";\nimport { DropdownToggle } from "./dropdownToggle";\nimport { type IDropdownItemProps } from "./dropdownItem";\n\nimport { keyboardKeys } from "@constants";\n\nexport interface IDropdownProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Size of the dropdown.\n * @default md\n */\n size?: "md" | "lg";\n /**\n * Use to show the title or header\n */\n header?: React.ReactNode | string;\n /**\n * Child elements of the dropdown (typically DropdownItem components)\n */\n children?: React.ReactNode;\n /**\n * JSX to be rendered inside of dropdown button\n */\n ctaContent?: React.ReactNode;\n /**\n * Pass a reference to the element where the dropdown needs to be rendered\n */\n portalTarget?: Element;\n /**\n * Pass space separated class names to style the CTA\n */\n ctaClassName?: string;\n /**\n * Determines whether the CTA should be disabled or not\n */\n disabled?: boolean;\n /**\n * Controls whether the dropdown should close when an item is clicked\n * @default true\n */\n shouldCloseOnItemClick?: boolean;\n /**\n * Controls the open state of the dropdown (controlled component)\n */\n open?: boolean;\n /**\n * Callback function called when the dropdown should be closed\n */\n onClose?: () => void;\n /**\n * Callback function called when the dropdown toggle (CTA) is clicked (used in controlled mode)\n */\n onToggle?: () => void;\n}\n\nexport const Dropdown = forwardRef<HTMLDivElement, IDropdownProps>(\n ({\n size = "md",\n children,\n header,\n ctaContent,\n portalTarget = typeof document !== "undefined" ? document.body : undefined,\n disabled = false,\n ctaClassName,\n className,\n shouldCloseOnItemClick = true,\n open,\n onClose,\n onToggle,\n ...props\n }, ref ) => {\n const [ itemList, setItem ] = useState<React.ReactNode[] | React.ReactPortal[]>([]);\n const [ internalOpen, setInternalOpen ] = useState( false );\n\n // Determine if component is controlled or uncontrolled\n const isControlled = open !== undefined;\n const dropdownShow = isControlled ? open : internalOpen;\n\n // Floating UI hook\n const { x, y, refs, strategy, update } = useFloating({\n placement: "bottom-start",\n middleware: [ offset( 8 ), flip(), shift() ],\n whileElementsMounted: autoUpdate\n });\n\n // Function to open/toggle the dropdown\n const openDropdown = () => {\n if ( isControlled ) {\n // In controlled mode, notify parent via onToggle\n onToggle?.();\n } else {\n setInternalOpen( true );\n }\n setTimeout(() => update?.(), 0 );\n };\n\n // Function to close the dropdown\n const closeDropdown = useCallback(() => {\n if ( isControlled ) {\n onClose?.();\n } else {\n setInternalOpen( false );\n }\n }, [ isControlled, onClose ]);\n\n // Listener to close the dropdown when focus moves away from it\n const handleBlur = ( event: React.FocusEvent ) => {\n if ( !event.currentTarget.contains( event.relatedTarget as Node )) {\n closeDropdown();\n }\n };\n\n // Listener to add func to esc, up, down arrows for nav\n const dropdownKeyPress = ( event: React.KeyboardEvent ) => {\n if ( event.key === keyboardKeys.escape ) {\n closeDropdown();\n } else if ( event.key === keyboardKeys.arrowUp ) {\n if ( document.activeElement?.previousElementSibling ) {\n ( document.activeElement.previousElementSibling as HTMLDivElement ).focus();\n }\n } else if ( event.key === keyboardKeys.arrowDown ) {\n if ( document.activeElement?.nextElementSibling ) {\n ( document.activeElement.nextElementSibling as HTMLDivElement ).focus();\n }\n }\n };\n\n // Effect to calibrate children and button content\n useEffect(() => {\n if ( !children ) {\n return;\n }\n\n const itemArray: React.ReactElement<IDropdownItemProps>[] = [];\n\n React.Children.forEach( children, ( child, index: number ) => {\n // Skip null, undefined, or non-React elements\n if ( !React.isValidElement( child )) {\n return;\n }\n\n const childElement = child as React.ReactElement<IDropdownItemProps>;\n const position = index === 0\n ? "first"\n : index === React.Children.count( children ) - 1\n ? "last"\n : "middle";\n\n const clone = React.cloneElement( childElement, {\n dropdownShow,\n setShowDropdown: shouldCloseOnItemClick ? closeDropdown : undefined,\n index,\n key: index,\n size,\n position,\n shouldCloseOnItemClick\n });\n\n itemArray.push( clone );\n });\n\n setItem( itemArray );\n }, [ children, ctaContent, dropdownShow, size, shouldCloseOnItemClick, closeDropdown ]);\n\n const { menu } = dropdownVariants({ size });\n const { header: headerClass } = dropdownVariants({\n headerType: typeof header === "string" ? "text" : "custom"\n });\n\n return children ? (\n <>\n <DropdownToggle\n ref={refs.setReference}\n onClick={openDropdown}\n ctaClassName={ctaClassName}\n disabled={disabled}\n >\n {ctaContent}\n </DropdownToggle>\n {portalTarget && ReactDOM.createPortal(\n <div\n className={cn( className )}\n {...props}\n ref={ref}\n >\n <div\n ref={refs.setFloating}\n onKeyUp={dropdownKeyPress}\n style={{\n position: strategy,\n top: y ?? 0,\n left: x ?? 0,\n width: "max-content"\n }}\n onBlur={handleBlur}\n className={menu({ class: dropdownShow ? "block" : "hidden" })}\n >\n {header && (\n <div className={headerClass()}>\n {header}\n </div>\n )}\n {itemList.map(( item ) => item )}\n </div>\n </div>,\n portalTarget\n )}\n </>\n ) : null;\n }\n);\n\nDropdown.displayName = "Dropdown";\n'
2092
+ "content": 'import React, { useState, useCallback, useEffect, forwardRef } from "react";\nimport ReactDOM from "react-dom";\nimport { useFloating, offset, flip, shift, autoUpdate } from "@floating-ui/react";\nimport { cn } from "tailwind-variants";\n\nimport { dropdownVariants } from "./dropdownVariants";\nimport { DropdownToggle } from "./dropdownToggle";\nimport { type IDropdownItemProps } from "./dropdownItem";\n\nimport { keyboardKeys } from "@constants";\nimport { isSemanticTrigger } from "@utils";\n\nexport interface IDropdownProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Size of the dropdown.\n * @default md\n */\n size?: "md" | "lg";\n /**\n * Use to show the title or header\n */\n header?: React.ReactNode | string;\n /**\n * Child elements of the dropdown (typically DropdownItem components)\n */\n children?: React.ReactNode;\n /**\n * JSX to be rendered inside of dropdown button\n */\n ctaContent?: React.ReactNode;\n /**\n * Pass a reference to the element where the dropdown needs to be rendered\n */\n portalTarget?: Element;\n /**\n * Pass space separated class names to style the CTA\n */\n ctaClassName?: string;\n /**\n * Accessible name for the dropdown toggle button. Required when the CTA is\n * icon-only (no visible text); omit it when the CTA already has a visible\n * text label so the toggle isn\'t given a conflicting accessible name.\n */\n ctaAriaLabel?: string;\n /**\n * Opt a custom CTA into the "interactive" path. Native interactive elements\n * (`button`, `a`, `summary`, `input`, `select`, `textarea`) are detected\n * automatically, but a custom component (e.g. this library\'s `Button`) cannot\n * be introspected. Set this when the CTA is a custom component that renders a\n * real interactive element and forwards its `ref` and DOM props (`onClick`,\n * `aria-*`, `className`, `disabled`) to it. When true the toggle props are\n * merged directly onto the CTA instead of wrapping it in a `DropdownToggle`\n * button. @default false\n */\n interactiveTrigger?: boolean;\n /**\n * Determines whether the CTA should be disabled or not\n */\n disabled?: boolean;\n /**\n * Controls whether the dropdown should close when an item is clicked\n * @default true\n */\n shouldCloseOnItemClick?: boolean;\n /**\n * Controls the open state of the dropdown (controlled component)\n */\n open?: boolean;\n /**\n * Callback function called when the dropdown should be closed\n */\n onClose?: () => void;\n /**\n * Callback function called when the dropdown toggle (CTA) is clicked (used in controlled mode)\n */\n onToggle?: () => void;\n}\n\nexport const Dropdown = forwardRef<HTMLDivElement, IDropdownProps>(\n ({\n size = "md",\n children,\n header,\n ctaContent,\n portalTarget = typeof document !== "undefined" ? document.body : undefined,\n disabled = false,\n ctaClassName,\n ctaAriaLabel,\n interactiveTrigger = false,\n className,\n shouldCloseOnItemClick = true,\n open,\n onClose,\n onToggle,\n ...props\n }, ref ) => {\n const [ itemList, setItem ] = useState<React.ReactNode[] | React.ReactPortal[]>([]);\n const [ internalOpen, setInternalOpen ] = useState( false );\n\n // Determine if component is controlled or uncontrolled\n const isControlled = open !== undefined;\n const dropdownShow = isControlled ? open : internalOpen;\n\n // Floating UI hook\n const { x, y, refs, strategy, update } = useFloating({\n placement: "bottom-start",\n middleware: [ offset( 8 ), flip(), shift() ],\n whileElementsMounted: autoUpdate\n });\n\n // Function to open/toggle the dropdown\n const openDropdown = () => {\n if ( isControlled ) {\n // In controlled mode, notify parent via onToggle\n onToggle?.();\n } else {\n setInternalOpen( true );\n }\n setTimeout(() => update?.(), 0 );\n };\n\n // Function to close the dropdown\n const closeDropdown = useCallback(() => {\n if ( isControlled ) {\n onClose?.();\n } else {\n setInternalOpen( false );\n }\n }, [ isControlled, onClose ]);\n\n // Listener to close the dropdown when focus moves away from it\n const handleBlur = ( event: React.FocusEvent ) => {\n if ( !event.currentTarget.contains( event.relatedTarget as Node )) {\n closeDropdown();\n }\n };\n\n // Listener to add func to esc, up, down arrows for nav\n const dropdownKeyPress = ( event: React.KeyboardEvent ) => {\n if ( event.key === keyboardKeys.escape ) {\n closeDropdown();\n } else if ( event.key === keyboardKeys.arrowUp ) {\n if ( document.activeElement?.previousElementSibling ) {\n ( document.activeElement.previousElementSibling as HTMLDivElement ).focus();\n }\n } else if ( event.key === keyboardKeys.arrowDown ) {\n if ( document.activeElement?.nextElementSibling ) {\n ( document.activeElement.nextElementSibling as HTMLDivElement ).focus();\n }\n }\n };\n\n // Effect to calibrate children and button content\n useEffect(() => {\n if ( !children ) {\n return;\n }\n\n const itemArray: React.ReactElement<IDropdownItemProps>[] = [];\n\n React.Children.forEach( children, ( child, index: number ) => {\n // Skip null, undefined, or non-React elements\n if ( !React.isValidElement( child )) {\n return;\n }\n\n const childElement = child as React.ReactElement<IDropdownItemProps>;\n const position = index === 0\n ? "first"\n : index === React.Children.count( children ) - 1\n ? "last"\n : "middle";\n\n const clone = React.cloneElement( childElement, {\n dropdownShow,\n setShowDropdown: shouldCloseOnItemClick ? closeDropdown : undefined,\n index,\n key: index,\n size,\n position,\n shouldCloseOnItemClick\n });\n\n itemArray.push( clone );\n });\n\n setItem( itemArray );\n }, [ children, ctaContent, dropdownShow, size, shouldCloseOnItemClick, closeDropdown ]);\n\n const { menu } = dropdownVariants({ size });\n const { header: headerClass } = dropdownVariants({\n headerType: typeof header === "string" ? "text" : "custom"\n });\n\n // Native interactive elements are auto-detected; a custom component can opt\n // in via `interactiveTrigger` since its rendered output can\'t be introspected.\n const isSemanticInteractiveElement = isSemanticTrigger( ctaContent ) || interactiveTrigger;\n\n return children ? (\n <>\n {isSemanticInteractiveElement ? React.cloneElement( ctaContent as React.ReactElement, {\n ref: refs.setReference,\n onClick: ( e: React.MouseEvent ) => {\n openDropdown();\n // If the original button had an onClick, call it too\n ( ctaContent as any ).props.onClick?.( e );\n },\n disabled: disabled || ( ctaContent as any ).props.disabled,\n className: cn( ctaClassName, ( ctaContent as any ).props.className ),\n "aria-haspopup": "menu",\n "aria-expanded": dropdownShow,\n // Only supply a label when the trigger doesn\'t already provide one,\n // so we never override an element\'s own accessible name\n "aria-label": ( ctaContent as React.ReactElement ).props[ "aria-label" ] ?? ctaAriaLabel,\n "data-testid": "dropdown-button"\n }) :\n <DropdownToggle\n ref={refs.setReference}\n onClick={openDropdown}\n ctaClassName={ctaClassName}\n disabled={disabled}\n aria-expanded={dropdownShow}\n aria-label={ctaAriaLabel}\n >\n {ctaContent}\n </DropdownToggle>\n }\n {portalTarget && ReactDOM.createPortal(\n <div\n className={cn( className )}\n {...props}\n ref={ref}\n >\n <div\n ref={refs.setFloating}\n onKeyUp={dropdownKeyPress}\n style={{\n position: strategy,\n top: y ?? 0,\n left: x ?? 0,\n width: "max-content"\n }}\n onBlur={handleBlur}\n className={menu({ class: dropdownShow ? "block" : "hidden" })}\n >\n {header && (\n <div className={headerClass()}>\n {header}\n </div>\n )}\n {itemList.map(( item ) => item )}\n </div>\n </div>,\n portalTarget\n )}\n </>\n ) : null;\n }\n);\n\nDropdown.displayName = "Dropdown";\n'
2040
2093
  },
2041
2094
  {
2042
2095
  "name": "README.md",
2043
- "content": '# Dropdown Component\n\n## Component Overview\n\nThe Dropdown component provides a toggleable menu that displays a list of actions or options. It uses compound component pattern with Dropdown.Item subcomponent and @floating-ui for intelligent positioning.\n\n**When to use:**\n- Action menus and context menus\n- User profile menus\n- Settings and preferences menus\n- Navigation submenus\n- List of options or commands\n\n**Component Architecture:**\n- Built with React compound component pattern (Dropdown.Item)\n- Positioned using @floating-ui for automatic placement\n- Styled with Tailwind CSS and class-variance-authority (cva)\n- Keyboard navigation support (Arrow keys, ESC, Enter)\n- Automatic focus management\n\n## Basic Usage\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\n\nexport function Example() {\n return (\n <Dropdown ctaContent={<Button>Open Menu</Button>}>\n <Dropdown.Item onClick={() => console.log(\'Edit\')}>\n Edit\n </Dropdown.Item>\n <Dropdown.Item onClick={() => console.log(\'Delete\')}>\n Delete\n </Dropdown.Item>\n <Dropdown.Item onClick={() => console.log(\'Share\')}>\n Share\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/dropdown` or `@components/dropdown`.\n\n## Component Props\n\n### Dropdown (Root Component)\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `ctaContent` | `React.ReactNode` | - | No | Content for the dropdown toggle button |\n| `children` | `React.ReactNode` | `undefined` | No | Dropdown items (typically Dropdown.Item components) |\n| `header` | `React.ReactNode \\| string` | `undefined` | No | Optional header text displayed above items |\n| `size` | `\'md\' \\| \'lg\'` | `\'md\'` | No | Size of the dropdown menu |\n| `disabled` | `boolean` | `false` | No | Whether the dropdown trigger is disabled |\n| `ctaClassName` | `string` | `undefined` | No | Additional CSS classes for the toggle button |\n| `className` | `string` | `undefined` | No | Additional CSS classes for the dropdown menu |\n| `portalTarget` | `Element` | `document.body` | No | DOM element where dropdown will be rendered |\n| `shouldCloseOnItemClick` | `boolean` | `true` | No | Controls whether the dropdown closes when an item is clicked |\n| `open` | `boolean` | `undefined` | No | Controls the open state of the dropdown (controlled component) |\n| `onClose` | `() => void` | `undefined` | No | Callback function called when the dropdown should be closed |\n| `onToggle` | `() => void` | `undefined` | No | Callback function called when the dropdown CTA button is clicked (required for controlled mode) |\n\n### Dropdown.Item\n\nRenders an individual item in the dropdown menu.\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `children` | `React.ReactNode` | `undefined` | No | Content of the dropdown item |\n| `onClick` | `(event: React.MouseEvent) => void` | `undefined` | No | Handler for item click |\n| `className` | `string` | `undefined` | No | Additional CSS classes for customization |\n\n**Note:** This component forwards refs to the container div element (`HTMLDivElement`).\n\n## Practical Examples\n\n### User Profile Menu\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Avatar } from "@components";\n\nfunction UserProfileMenu({ user }) {\n return (\n <Dropdown \n ctaContent={\n <div className="flex items-center gap-2 cursor-pointer">\n <Avatar src={user.avatar} alt={user.name} size="sm" />\n <span>{user.name}</span>\n </div>\n }\n header="Account"\n >\n <Dropdown.Item onClick={() => navigate(\'/profile\')}>\n View Profile\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/settings\')}>\n Settings\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/billing\')}>\n Billing\n </Dropdown.Item>\n <Dropdown.Item onClick={handleLogout} className="text-error-500">\n Logout\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n### Action Menu with Icons\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\n\nfunction ActionMenu({ item }) {\n return (\n <Dropdown \n ctaContent={\n <Button variant="text" size="sm" prefixIcon="ellipsisV">\n Actions\n </Button>\n }\n size="md"\n >\n <Dropdown.Item onClick={() => handleEdit(item)}>\n <span className="flex items-center gap-2">\n <EditIcon /> Edit\n </span>\n </Dropdown.Item>\n <Dropdown.Item onClick={() => handleDuplicate(item)}>\n <span className="flex items-center gap-2">\n <CopyIcon /> Duplicate\n </span>\n </Dropdown.Item>\n <Dropdown.Item onClick={() => handleArchive(item)}>\n <span className="flex items-center gap-2">\n <ArchiveIcon /> Archive\n </span>\n </Dropdown.Item>\n <Dropdown.Item \n onClick={() => handleDelete(item)}\n className="text-error-500 hover:bg-error-50"\n >\n <span className="flex items-center gap-2">\n <TrashIcon /> Delete\n </span>\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n### Settings Menu with Sections\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\n\nfunction SettingsMenu() {\n return (\n <Dropdown \n ctaContent={\n <Button variant="outline" prefixIcon="settings">\n Settings\n </Button>\n }\n size="lg"\n >\n <Dropdown.Item onClick={() => navigate(\'/preferences\')}>\n Preferences\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/appearance\')}>\n Appearance\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/notifications\')}>\n Notifications\n </Dropdown.Item>\n <div className="border-t my-1" />\n <Dropdown.Item onClick={() => navigate(\'/privacy\')}>\n Privacy & Security\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/data\')}>\n Data & Storage\n </Dropdown.Item>\n <div className="border-t my-1" />\n <Dropdown.Item onClick={() => navigate(\'/help\')}>\n Help & Support\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/about\')}>\n About\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n## Styling and Customization\n\n```tsx\n<Dropdown \n ctaContent={<Button>Menu</Button>}\n className="min-w-48 shadow-xl"\n ctaClassName="custom-trigger-styles"\n>\n <Dropdown.Item className="font-semibold text-primary-600">\n Custom Styled Item\n </Dropdown.Item>\n</Dropdown>\n```\n\n## Advanced Features\n\n### Controlled Component Mode\n\nThe Dropdown can be used as a controlled component by providing the `open`, `onClose`, and `onToggle` props:\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\nimport { useState } from "react";\n\nfunction ControlledDropdown() {\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <div>\n <Button \n onMouseDown={(e) => e.preventDefault()} \n onClick={() => setIsOpen((prev) => !prev)}\n >\n Toggle Dropdown Externally\n </Button>\n \n <Dropdown \n ctaContent={<Button>Controlled Menu</Button>}\n open={isOpen}\n onClose={() => setIsOpen(false)}\n onToggle={() => setIsOpen((prev) => !prev)}\n >\n <Dropdown.Item onClick={() => console.log(\'Item 1\')}>\n Item 1\n </Dropdown.Item>\n <Dropdown.Item onClick={() => console.log(\'Item 2\')}>\n Item 2\n </Dropdown.Item>\n </Dropdown>\n </div>\n );\n}\n```\n\n**Note:** \n- `onToggle` is called when the dropdown\'s CTA button is clicked (required for controlled mode)\n- `onClose` is called when clicking outside, pressing ESC, or selecting an item\n- Use the callback form `setIsOpen((prev) => !prev)` to ensure state updates are based on the latest value\n- For external toggle buttons, use `onMouseDown={(e) => e.preventDefault()}` to prevent the dropdown\'s blur event from interfering\n\n### Keep Dropdown Open on Item Click\n\nBy default, the dropdown closes when any item is clicked. You can prevent this behavior using the `shouldCloseOnItemClick` prop:\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\nimport { useState } from "react";\n\nfunction ChecklistDropdown() {\n const [checkedItems, setCheckedItems] = useState<string[]>([]);\n\n const toggleItem = (item: string) => {\n setCheckedItems(prev => \n prev.includes(item) \n ? prev.filter(i => i !== item)\n : [...prev, item]\n );\n };\n\n return (\n <Dropdown \n ctaContent={<Button>Select Options</Button>}\n shouldCloseOnItemClick={false}\n >\n <Dropdown.Item onClick={() => toggleItem(\'option1\')}>\n <input \n type="checkbox" \n checked={checkedItems.includes(\'option1\')}\n readOnly\n />\n <span className="ml-2">Option 1</span>\n </Dropdown.Item>\n <Dropdown.Item onClick={() => toggleItem(\'option2\')}>\n <input \n type="checkbox" \n checked={checkedItems.includes(\'option2\')}\n readOnly\n />\n <span className="ml-2">Option 2</span>\n </Dropdown.Item>\n <Dropdown.Item onClick={() => toggleItem(\'option3\')}>\n <input \n type="checkbox" \n checked={checkedItems.includes(\'option3\')}\n readOnly\n />\n <span className="ml-2">Option 3</span>\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n### Combining Controlled Mode with shouldCloseOnItemClick\n\nYou can combine both features for complete control over the dropdown behavior:\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\nimport { useState } from "react";\n\nfunction AdvancedDropdown() {\n const [isOpen, setIsOpen] = useState(false);\n const [selectedFilters, setSelectedFilters] = useState<string[]>([]);\n\n const applyFilters = () => {\n console.log(\'Applying filters:\', selectedFilters);\n setIsOpen(false);\n };\n\n return (\n <Dropdown \n ctaContent={<Button>Filter Options</Button>}\n open={isOpen}\n onClose={() => setIsOpen(false)}\n onToggle={() => setIsOpen((prev) => !prev)}\n shouldCloseOnItemClick={false}\n >\n <Dropdown.Item onClick={() => toggleFilter(\'active\')}>\n Active Items\n </Dropdown.Item>\n <Dropdown.Item onClick={() => toggleFilter(\'inactive\')}>\n Inactive Items\n </Dropdown.Item>\n <div className="border-t my-1" />\n <Dropdown.Item onClick={applyFilters} className="font-semibold text-primary-600">\n Apply Filters\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n## Technical Details\n\n### Positioning\n\n- Uses @floating-ui for automatic positioning\n- Flips to stay within viewport\n- Shifts to avoid overflow\n- Updates position on scroll/resize\n\n### Keyboard Navigation\n\n- Arrow Down: Move focus to next item\n- Arrow Up: Move focus to previous item\n- Enter/Space: Activate focused item\n- ESC: Close dropdown\n- Tab: Close dropdown and move focus\n\n## Accessibility\n\nThe component includes built-in accessibility features:\n\n**Implemented:**\n- Keyboard navigation (Arrow keys, Enter, ESC)\n- Focus management for dropdown items\n- Automatic focus trap within dropdown\n- Close on blur (clicking outside)\n- Proper ARIA attributes\n\n**Best Practices:**\n- Use descriptive text for dropdown items\n- Group related items visually (separators)\n- Provide icon + text for clarity\n- Use contrasting colors for destructive actions\n- Ensure sufficient touch target size (min 44x44px)\n'
2096
+ "content": '# Dropdown Component\n\n## Component Overview\n\nThe Dropdown component provides a toggleable menu that displays a list of actions or options. It uses compound component pattern with Dropdown.Item subcomponent and @floating-ui for intelligent positioning.\n\n**When to use:**\n- Action menus and context menus\n- User profile menus\n- Settings and preferences menus\n- Navigation submenus\n- List of options or commands\n\n**Component Architecture:**\n- Built with React compound component pattern (Dropdown.Item)\n- Positioned using @floating-ui for automatic placement\n- Styled with Tailwind CSS and class-variance-authority (cva)\n- Keyboard navigation support (Arrow keys, ESC, Enter)\n- Automatic focus management\n\n## Basic Usage\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\n\nexport function Example() {\n return (\n <Dropdown interactiveTrigger ctaContent={<Button>Open Menu</Button>}>\n <Dropdown.Item onClick={() => console.log(\'Edit\')}>\n Edit\n </Dropdown.Item>\n <Dropdown.Item onClick={() => console.log(\'Delete\')}>\n Delete\n </Dropdown.Item>\n <Dropdown.Item onClick={() => console.log(\'Share\')}>\n Share\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/dropdown` or `@components/dropdown`.\n\n## Component Props\n\n### Dropdown (Root Component)\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `ctaContent` | `React.ReactNode` | - | No | Content for the dropdown toggle button |\n| `interactiveTrigger` | `boolean` | `false` | No | Opt a custom component CTA (e.g. this library\'s `Button`) into the interactive path so toggle props are merged onto it instead of wrapping it in another `<button>`. See [Interactive CTAs](#interactive-ctas) |\n| `children` | `React.ReactNode` | `undefined` | No | Dropdown items (typically Dropdown.Item components) |\n| `header` | `React.ReactNode \\| string` | `undefined` | No | Optional header text displayed above items |\n| `size` | `\'md\' \\| \'lg\'` | `\'md\'` | No | Size of the dropdown menu |\n| `disabled` | `boolean` | `false` | No | Whether the dropdown trigger is disabled |\n| `ctaClassName` | `string` | `undefined` | No | Additional CSS classes for the toggle button |\n| `className` | `string` | `undefined` | No | Additional CSS classes for the dropdown menu |\n| `portalTarget` | `Element` | `document.body` | No | DOM element where dropdown will be rendered |\n| `shouldCloseOnItemClick` | `boolean` | `true` | No | Controls whether the dropdown closes when an item is clicked |\n| `open` | `boolean` | `undefined` | No | Controls the open state of the dropdown (controlled component) |\n| `onClose` | `() => void` | `undefined` | No | Callback function called when the dropdown should be closed |\n| `onToggle` | `() => void` | `undefined` | No | Callback function called when the dropdown CTA button is clicked (required for controlled mode) |\n\n### Dropdown.Item\n\nRenders an individual item in the dropdown menu.\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `children` | `React.ReactNode` | `undefined` | No | Content of the dropdown item |\n| `onClick` | `(event: React.MouseEvent) => void` | `undefined` | No | Handler for item click |\n| `className` | `string` | `undefined` | No | Additional CSS classes for customization |\n\n**Note:** This component forwards refs to the container div element (`HTMLDivElement`).\n\n## Interactive CTAs\n\nThe `ctaContent` is the element that opens the dropdown. How the toggle behaviour\nis attached depends on the CTA type:\n\n- **Native interactive elements** (`button`, `a`, `summary`, `input`, `select`,\n `textarea`) are auto-detected: the toggle props (`onClick`, `aria-haspopup`,\n `aria-expanded`, `ref`) are merged directly onto that element.\n- **Everything else** (icons, text, a `span`, or a custom component) is wrapped\n in a `DropdownToggle` `<button>` that becomes the trigger.\n\nA custom component such as this library\'s `Button` renders a real `<button>` but\n**cannot be introspected**, so by default it falls into the wrapped path \u2014 which\nwould place a `<button>` inside another `<button>` (invalid, nested interactive\ncontrols). Set `interactiveTrigger` to opt it into the merge path instead:\n\n```tsx\n// Button forwards its ref + props, so merge the toggle onto it directly\n<Dropdown interactiveTrigger ctaContent={<Button>Open Menu</Button>}>\n <Dropdown.Item onClick={handleEdit}>Edit</Dropdown.Item>\n</Dropdown>\n```\n\nOnly use `interactiveTrigger` when the CTA renders a real interactive element and\nforwards its `ref` and DOM props to it. For an icon-only/text CTA, leave it off\nso the CTA gets a proper wrapping button (and supply `ctaAriaLabel` for the\naccessible name).\n\n## Practical Examples\n\n### User Profile Menu\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Avatar } from "@components";\n\nfunction UserProfileMenu({ user }) {\n return (\n <Dropdown \n ctaContent={\n <div className="flex items-center gap-2 cursor-pointer">\n <Avatar src={user.avatar} alt={user.name} size="sm" />\n <span>{user.name}</span>\n </div>\n }\n header="Account"\n >\n <Dropdown.Item onClick={() => navigate(\'/profile\')}>\n View Profile\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/settings\')}>\n Settings\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/billing\')}>\n Billing\n </Dropdown.Item>\n <Dropdown.Item onClick={handleLogout} className="text-error-700">\n Logout\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n### Action Menu with Icons\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\n\nfunction ActionMenu({ item }) {\n return (\n <Dropdown \n interactiveTrigger\n ctaContent={\n <Button variant="text" size="sm" prefixIcon="ellipsisV">\n Actions\n </Button>\n }\n size="md"\n >\n <Dropdown.Item onClick={() => handleEdit(item)}>\n <span className="flex items-center gap-2">\n <EditIcon /> Edit\n </span>\n </Dropdown.Item>\n <Dropdown.Item onClick={() => handleDuplicate(item)}>\n <span className="flex items-center gap-2">\n <CopyIcon /> Duplicate\n </span>\n </Dropdown.Item>\n <Dropdown.Item onClick={() => handleArchive(item)}>\n <span className="flex items-center gap-2">\n <ArchiveIcon /> Archive\n </span>\n </Dropdown.Item>\n <Dropdown.Item \n onClick={() => handleDelete(item)}\n className="text-error-700 hover:bg-error-50"\n >\n <span className="flex items-center gap-2">\n <TrashIcon /> Delete\n </span>\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n### Settings Menu with Sections\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\n\nfunction SettingsMenu() {\n return (\n <Dropdown \n interactiveTrigger\n ctaContent={\n <Button variant="outline" prefixIcon="settings">\n Settings\n </Button>\n }\n size="lg"\n >\n <Dropdown.Item onClick={() => navigate(\'/preferences\')}>\n Preferences\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/appearance\')}>\n Appearance\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/notifications\')}>\n Notifications\n </Dropdown.Item>\n <div className="border-t my-1" />\n <Dropdown.Item onClick={() => navigate(\'/privacy\')}>\n Privacy & Security\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/data\')}>\n Data & Storage\n </Dropdown.Item>\n <div className="border-t my-1" />\n <Dropdown.Item onClick={() => navigate(\'/help\')}>\n Help & Support\n </Dropdown.Item>\n <Dropdown.Item onClick={() => navigate(\'/about\')}>\n About\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n## Styling and Customization\n\n```tsx\n<Dropdown \n interactiveTrigger\n ctaContent={<Button>Menu</Button>}\n className="min-w-48 shadow-xl"\n ctaClassName="custom-trigger-styles"\n>\n <Dropdown.Item className="font-semibold text-primary-600">\n Custom Styled Item\n </Dropdown.Item>\n</Dropdown>\n```\n\n## Advanced Features\n\n### Controlled Component Mode\n\nThe Dropdown can be used as a controlled component by providing the `open`, `onClose`, and `onToggle` props:\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\nimport { useState } from "react";\n\nfunction ControlledDropdown() {\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <div>\n <Button \n onMouseDown={(e) => e.preventDefault()} \n onClick={() => setIsOpen((prev) => !prev)}\n >\n Toggle Dropdown Externally\n </Button>\n \n <Dropdown \n interactiveTrigger\n ctaContent={<Button>Controlled Menu</Button>}\n open={isOpen}\n onClose={() => setIsOpen(false)}\n onToggle={() => setIsOpen((prev) => !prev)}\n >\n <Dropdown.Item onClick={() => console.log(\'Item 1\')}>\n Item 1\n </Dropdown.Item>\n <Dropdown.Item onClick={() => console.log(\'Item 2\')}>\n Item 2\n </Dropdown.Item>\n </Dropdown>\n </div>\n );\n}\n```\n\n**Note:** \n- `onToggle` is called when the dropdown\'s CTA button is clicked (required for controlled mode)\n- `onClose` is called when clicking outside, pressing ESC, or selecting an item\n- Use the callback form `setIsOpen((prev) => !prev)` to ensure state updates are based on the latest value\n- For external toggle buttons, use `onMouseDown={(e) => e.preventDefault()}` to prevent the dropdown\'s blur event from interfering\n\n### Keep Dropdown Open on Item Click\n\nBy default, the dropdown closes when any item is clicked. You can prevent this behavior using the `shouldCloseOnItemClick` prop:\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\nimport { useState } from "react";\n\nfunction ChecklistDropdown() {\n const [checkedItems, setCheckedItems] = useState<string[]>([]);\n\n const toggleItem = (item: string) => {\n setCheckedItems(prev => \n prev.includes(item) \n ? prev.filter(i => i !== item)\n : [...prev, item]\n );\n };\n\n return (\n <Dropdown \n interactiveTrigger\n ctaContent={<Button>Select Options</Button>}\n shouldCloseOnItemClick={false}\n >\n <Dropdown.Item onClick={() => toggleItem(\'option1\')}>\n <input \n type="checkbox" \n checked={checkedItems.includes(\'option1\')}\n readOnly\n />\n <span className="ml-2">Option 1</span>\n </Dropdown.Item>\n <Dropdown.Item onClick={() => toggleItem(\'option2\')}>\n <input \n type="checkbox" \n checked={checkedItems.includes(\'option2\')}\n readOnly\n />\n <span className="ml-2">Option 2</span>\n </Dropdown.Item>\n <Dropdown.Item onClick={() => toggleItem(\'option3\')}>\n <input \n type="checkbox" \n checked={checkedItems.includes(\'option3\')}\n readOnly\n />\n <span className="ml-2">Option 3</span>\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n### Combining Controlled Mode with shouldCloseOnItemClick\n\nYou can combine both features for complete control over the dropdown behavior:\n\n```tsx\nimport { Dropdown } from "@components";\nimport { Button } from "@components";\nimport { useState } from "react";\n\nfunction AdvancedDropdown() {\n const [isOpen, setIsOpen] = useState(false);\n const [selectedFilters, setSelectedFilters] = useState<string[]>([]);\n\n const applyFilters = () => {\n console.log(\'Applying filters:\', selectedFilters);\n setIsOpen(false);\n };\n\n return (\n <Dropdown \n interactiveTrigger\n ctaContent={<Button>Filter Options</Button>}\n open={isOpen}\n onClose={() => setIsOpen(false)}\n onToggle={() => setIsOpen((prev) => !prev)}\n shouldCloseOnItemClick={false}\n >\n <Dropdown.Item onClick={() => toggleFilter(\'active\')}>\n Active Items\n </Dropdown.Item>\n <Dropdown.Item onClick={() => toggleFilter(\'inactive\')}>\n Inactive Items\n </Dropdown.Item>\n <div className="border-t my-1" />\n <Dropdown.Item onClick={applyFilters} className="font-semibold text-primary-600">\n Apply Filters\n </Dropdown.Item>\n </Dropdown>\n );\n}\n```\n\n## Technical Details\n\n### Positioning\n\n- Uses @floating-ui for automatic positioning\n- Flips to stay within viewport\n- Shifts to avoid overflow\n- Updates position on scroll/resize\n\n### Keyboard Navigation\n\n- Arrow Down: Move focus to next item\n- Arrow Up: Move focus to previous item\n- Enter/Space: Activate focused item\n- ESC: Close dropdown\n- Tab: Close dropdown and move focus\n\n## Accessibility\n\nThe component includes built-in accessibility features:\n\n**Implemented:**\n- Keyboard navigation (Arrow keys, Enter, ESC)\n- Focus management for dropdown items\n- Automatic focus trap within dropdown\n- Close on blur (clicking outside)\n- Proper ARIA attributes\n\n**Best Practices:**\n- Use descriptive text for dropdown items\n- Group related items visually (separators)\n- Provide icon + text for clarity\n- Use contrasting colors for destructive actions\n- Ensure sufficient touch target size (min 44x44px)\n'
2044
2097
  }
2045
2098
  ],
2046
2099
  "directories": []
@@ -2075,7 +2128,7 @@ DropdownItem.displayName = "DropdownItem";
2075
2128
  },
2076
2129
  {
2077
2130
  "name": "emptyState.tsx",
2078
- "content": 'import * as React from "react";\nimport {\n EmptyStateContent,\n type IEmptyStateContentProps\n} from "./emptyStateContent";\nimport {\n EmptyStateCTA,\n type IEmptyStateCTAProps\n} from "./emptyStateCta";\nimport { emptyStateVariants } from "./emptyStateVariants";\n\nconst { base, contentWrapper } = emptyStateVariants();\n\n// Import all SVGs for light mode\nimport analyticsLight from "./svgs/analytics.svg";\nimport dashboardLight from "./svgs/dashboard.svg";\nimport dataUploadLight from "./svgs/dataUpload.svg";\nimport workspacesLight from "./svgs/workspaces.svg";\nimport waitingLight from "./svgs/waiting.svg";\nimport otpLight from "./svgs/otp.svg";\nimport searchingLight from "./svgs/searching.svg";\nimport notificationLight from "./svgs/notification.svg";\nimport noFilesLight from "./svgs/noFiles.svg";\nimport noAccessLight from "./svgs/noAccess.svg";\nimport noConnectionsLight from "./svgs/noConnections.svg";\nimport forgotPasswordLight from "./svgs/forgotPassword.svg";\nimport favoriteLight from "./svgs/favorite.svg";\nimport loginLight from "./svgs/login.svg";\nimport fileUploadLight from "./svgs/fileUpload.svg";\nimport emptyDataLight from "./svgs/emptyData.svg";\nimport emptyData2Light from "./svgs/emptyData2.svg";\nimport emptyData3Light from "./svgs/emptyData3.svg";\nimport emptyData4Light from "./svgs/emptyData4.svg";\nimport datapipelineLight from "./svgs/datapipeline.svg";\n\n// Import all SVGs for dark mode\nimport analyticsDark from "./darkModeSvgs/analytics_dark.svg";\nimport dashboardDark from "./darkModeSvgs/dashboard_dark.svg";\nimport dataUploadDark from "./darkModeSvgs/dataupload_dark.svg";\nimport workspacesDark from "./darkModeSvgs/workspace_dark.svg";\nimport searchingDark from "./darkModeSvgs/searching_dark.svg";\nimport notificationDark from "./darkModeSvgs/notification_dark.svg";\nimport noAccessDark from "./darkModeSvgs/noaccess_dark.svg";\nimport noConnectionsDark from "./darkModeSvgs/noConnection_dark.svg";\nimport forgotPasswordDark from "./darkModeSvgs/forgotPassword_dark.svg";\nimport loginDark from "./darkModeSvgs/login_dark.svg";\nimport favoriteDark from "./darkModeSvgs/favorite_dark.svg";\nimport fileUploadDark from "./darkModeSvgs/fileUpload_dark.svg";\nimport emptyDark from "./darkModeSvgs/empty_dark.svg";\nimport otpDark from "./darkModeSvgs/OTP_dark.svg";\n\nconst lightSvgs = {\n analytics: analyticsLight,\n dashboard: dashboardLight,\n "data-upload": dataUploadLight,\n workspaces: workspacesLight,\n waiting: waitingLight,\n otp: otpLight,\n searching: searchingLight,\n notification: notificationLight,\n "no-files": noFilesLight,\n "no-access": noAccessLight,\n "no-connections": noConnectionsLight,\n "forgot-password": forgotPasswordLight,\n favorite: favoriteLight,\n login: loginLight,\n "file-upload": fileUploadLight,\n "empty-data": emptyDataLight,\n "empty-data-2": emptyData2Light,\n "empty-data-3": emptyData3Light,\n "empty-data-4": emptyData4Light,\n datapipeline: datapipelineLight\n};\n\nconst darkSvgs = {\n analytics: analyticsDark,\n dashboard: dashboardDark,\n "data-upload": dataUploadDark,\n workspaces: workspacesDark,\n searching: searchingDark,\n notification: notificationDark,\n "no-access": noAccessDark,\n "no-connections": noConnectionsDark,\n "forgot-password": forgotPasswordDark,\n login: loginDark,\n favorite: favoriteDark,\n "file-upload": fileUploadDark,\n "empty-data": emptyDark,\n otp: otpDark\n};\n\nexport interface IEmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Set a supported Empty State image variant */\n imageVariant?: keyof typeof lightSvgs;\n /** Alt text for the image (used only when there is no content) */\n imageAltText?: string;\n /** Custom image element, if provided it will override the variant images */\n customImage?: React.ReactElement<HTMLImageElement>;\n /** Override container styles */\n className?: string;\n /** Provide content and/or CTA children */\n children?:\n | React.ReactElement<IEmptyStateContentProps>\n | React.ReactElement<IEmptyStateCTAProps>\n | [React.ReactElement<IEmptyStateContentProps>, React.ReactElement<IEmptyStateCTAProps>];\n}\n\n// Compound component type to allow static subcomponents\ntype TEmptyStateComponent = React.ForwardRefExoticComponent<IEmptyStateProps & React.RefAttributes<HTMLDivElement>> & {\n Content: typeof EmptyStateContent;\n CTA: typeof EmptyStateCTA;\n};\n\n// Main EmptyState component\nexport const EmptyState = React.forwardRef<HTMLDivElement, IEmptyStateProps>(\n (\n {\n className,\n imageVariant = "analytics",\n imageAltText = "",\n customImage,\n children,\n ...props\n },\n ref\n ) => {\n const [ content, setContent ] = React.useState<React.ReactElement<IEmptyStateContentProps> | null>( null );\n const [ cta, setCta ] = React.useState<React.ReactElement<IEmptyStateCTAProps> | null>( null );\n\n React.useEffect(() => {\n setContent( null );\n setCta( null );\n React.Children.forEach( children, ( child ) => {\n if ( React.isValidElement<IEmptyStateContentProps>( child ) && child.type === EmptyStateContent ) {\n setContent( child );\n } else if ( React.isValidElement<IEmptyStateCTAProps>( child ) && child.type === EmptyStateCTA ) {\n setCta( child );\n }\n });\n }, [children]);\n\n // Resolve SVG srcs for given variant, fallback to analytics\n const key = imageVariant in lightSvgs ? imageVariant : "analytics";\n const srcLight = lightSvgs[key as keyof typeof lightSvgs];\n const srcDark = darkSvgs[key as keyof typeof darkSvgs] ?? srcLight;\n\n return (\n <div ref={ref} className={base({ class: className })} {...props}>\n {customImage ? (\n customImage\n ) : (\n <picture>\n <source srcSet={srcDark} media="(prefers-color-scheme: dark)" />\n <img\n className="empty-state-image"\n src={srcLight}\n alt={content ? "" : imageAltText}\n />\n </picture>\n )}\n <section className={contentWrapper()}>\n {content}\n {cta}\n </section>\n </div>\n );\n }\n) as TEmptyStateComponent;\n\nEmptyState.displayName = "EmptyState";\nEmptyState.Content = EmptyStateContent;\nEmptyState.CTA = EmptyStateCTA;\n'
2131
+ "content": 'import * as React from "react";\nimport {\n EmptyStateContent,\n type IEmptyStateContentProps\n} from "./emptyStateContent";\nimport {\n EmptyStateCTA,\n type IEmptyStateCTAProps\n} from "./emptyStateCta";\nimport { emptyStateVariants } from "./emptyStateVariants";\n\nconst { base, contentWrapper } = emptyStateVariants();\n\n// Import all SVGs for light mode\nimport analyticsLight from "./svgs/analytics.svg";\nimport dashboardLight from "./svgs/dashboard.svg";\nimport dataUploadLight from "./svgs/dataUpload.svg";\nimport workspacesLight from "./svgs/workspaces.svg";\nimport waitingLight from "./svgs/waiting.svg";\nimport otpLight from "./svgs/otp.svg";\nimport searchingLight from "./svgs/searching.svg";\nimport notificationLight from "./svgs/notification.svg";\nimport noFilesLight from "./svgs/noFiles.svg";\nimport noAccessLight from "./svgs/noAccess.svg";\nimport noConnectionsLight from "./svgs/noConnections.svg";\nimport forgotPasswordLight from "./svgs/forgotPassword.svg";\nimport favoriteLight from "./svgs/favorite.svg";\nimport loginLight from "./svgs/login.svg";\nimport fileUploadLight from "./svgs/fileUpload.svg";\nimport noDataLight from "./svgs/noData.svg";\nimport datapipelineLight from "./svgs/datapipeline.svg";\n\n// Import all SVGs for dark mode\nimport analyticsDark from "./darkModeSvgs/analytics_dark.svg";\nimport dashboardDark from "./darkModeSvgs/dashboard_dark.svg";\nimport dataUploadDark from "./darkModeSvgs/dataupload_dark.svg";\nimport workspacesDark from "./darkModeSvgs/workspace_dark.svg";\nimport searchingDark from "./darkModeSvgs/searching_dark.svg";\nimport notificationDark from "./darkModeSvgs/notification_dark.svg";\nimport noAccessDark from "./darkModeSvgs/noaccess_dark.svg";\nimport noConnectionsDark from "./darkModeSvgs/noConnection_dark.svg";\nimport forgotPasswordDark from "./darkModeSvgs/forgotPassword_dark.svg";\nimport loginDark from "./darkModeSvgs/login_dark.svg";\nimport favoriteDark from "./darkModeSvgs/favorite_dark.svg";\nimport fileUploadDark from "./darkModeSvgs/fileUpload_dark.svg";\nimport otpDark from "./darkModeSvgs/OTP_dark.svg";\n\nconst lightSvgs = {\n analytics: analyticsLight,\n dashboard: dashboardLight,\n "data-upload": dataUploadLight,\n workspaces: workspacesLight,\n waiting: waitingLight,\n otp: otpLight,\n searching: searchingLight,\n notification: notificationLight,\n "no-files": noFilesLight,\n "no-access": noAccessLight,\n "no-connections": noConnectionsLight,\n "forgot-password": forgotPasswordLight,\n favorite: favoriteLight,\n login: loginLight,\n "file-upload": fileUploadLight,\n "no-data": noDataLight,\n datapipeline: datapipelineLight\n};\n\nconst darkSvgs = {\n analytics: analyticsDark,\n dashboard: dashboardDark,\n "data-upload": dataUploadDark,\n workspaces: workspacesDark,\n searching: searchingDark,\n notification: notificationDark,\n "no-access": noAccessDark,\n "no-connections": noConnectionsDark,\n "forgot-password": forgotPasswordDark,\n login: loginDark,\n favorite: favoriteDark,\n "file-upload": fileUploadDark,\n otp: otpDark\n};\n\nexport interface IEmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Set a supported Empty State image variant */\n imageVariant?: keyof typeof lightSvgs;\n /** Alt text for the image (used only when there is no content) */\n imageAltText?: string;\n /** Custom image element, if provided it will override the variant images */\n customImage?: React.ReactElement<HTMLImageElement>;\n /** Override container styles */\n className?: string;\n /** Provide content and/or CTA children */\n children?:\n | React.ReactElement<IEmptyStateContentProps>\n | React.ReactElement<IEmptyStateCTAProps>\n | [React.ReactElement<IEmptyStateContentProps>, React.ReactElement<IEmptyStateCTAProps>];\n}\n\n// Compound component type to allow static subcomponents\ntype TEmptyStateComponent = React.ForwardRefExoticComponent<IEmptyStateProps & React.RefAttributes<HTMLDivElement>> & {\n Content: typeof EmptyStateContent;\n CTA: typeof EmptyStateCTA;\n};\n\n// Main EmptyState component\nexport const EmptyState = React.forwardRef<HTMLDivElement, IEmptyStateProps>(\n (\n {\n className,\n imageVariant = "analytics",\n imageAltText = "",\n customImage,\n children,\n ...props\n },\n ref\n ) => {\n const [ content, setContent ] = React.useState<React.ReactElement<IEmptyStateContentProps> | null>( null );\n const [ cta, setCta ] = React.useState<React.ReactElement<IEmptyStateCTAProps> | null>( null );\n\n React.useEffect(() => {\n setContent( null );\n setCta( null );\n React.Children.forEach( children, ( child ) => {\n if ( React.isValidElement<IEmptyStateContentProps>( child ) && child.type === EmptyStateContent ) {\n setContent( child );\n } else if ( React.isValidElement<IEmptyStateCTAProps>( child ) && child.type === EmptyStateCTA ) {\n setCta( child );\n }\n });\n }, [children]);\n\n // Resolve SVG srcs for given variant, fallback to analytics\n const key = imageVariant in lightSvgs ? imageVariant : "analytics";\n const srcLight = lightSvgs[key as keyof typeof lightSvgs];\n const srcDark = darkSvgs[key as keyof typeof darkSvgs] ?? srcLight;\n\n return (\n <div ref={ref} className={base({ class: className })} {...props}>\n {customImage ? (\n customImage\n ) : (\n <div>\n <img\n className="empty-state-image block dark:hidden"\n src={srcLight}\n alt={content ? "" : imageAltText}\n />\n <img\n className="empty-state-image hidden dark:block"\n src={srcDark}\n alt={content ? "" : imageAltText}\n />\n </div>\n )}\n {content || cta ? <section className={contentWrapper()}>\n {content}\n {cta}\n </section> : null}\n </div>\n );\n }\n) as TEmptyStateComponent;\n\nEmptyState.displayName = "EmptyState";\nEmptyState.Content = EmptyStateContent;\nEmptyState.CTA = EmptyStateCTA;\n'
2079
2132
  },
2080
2133
  {
2081
2134
  "name": "README.md",
@@ -2111,6 +2164,11 @@ DropdownItem.displayName = "DropdownItem";
2111
2164
  "content": '<svg width="300" height="241" viewBox="0 0 300 241" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_4825_1253)">\n<path opacity="0.1" d="M149.188 160.812C149.896 161.024 150.606 161.198 151.316 161.352C150.503 162.708 149.842 164.185 149.366 165.768C146.273 176.06 152.126 186.906 162.439 189.993C165.901 191.029 169.424 191.055 172.696 190.248C174.757 194.317 178.407 197.574 183.129 198.987C188.951 200.73 194.964 199.248 199.273 195.59C201.77 199.71 205.747 202.955 210.733 204.448C221.402 207.641 232.644 201.599 235.844 190.952C237.246 186.286 236.871 181.51 235.109 177.348C235.709 177.572 236.315 177.785 236.938 177.971C251.874 182.442 267.614 173.982 272.094 159.076C276.573 144.171 268.097 128.463 253.16 123.992C249.225 122.815 245.235 122.542 241.408 123.041C240.211 113.744 233.696 105.559 224.119 102.693C216.407 100.384 208.449 102.043 202.442 106.486C200.499 105.144 198.318 104.076 195.932 103.362C187.146 100.732 178.02 103.569 172.22 109.902C170.143 108.613 167.866 107.569 165.411 106.834C150.475 102.363 134.735 110.823 130.255 125.729C125.775 140.634 134.252 156.342 149.188 160.812Z" fill="#0676D7"/>\n<path opacity="0.1" d="M151.243 28.8489C150.504 28.8489 149.774 28.8861 149.049 28.9416C149.438 27.4096 149.646 25.8052 149.646 24.1526C149.646 13.4078 140.918 4.69687 130.151 4.69687C126.536 4.69687 123.154 5.68238 120.252 7.39282C117.107 4.0862 112.673 2.01331 107.744 2.01331C101.666 2.01331 96.3323 5.15659 93.2585 9.89607C89.6807 6.66515 84.937 4.69687 79.7318 4.69687C68.5935 4.69687 59.5645 13.7078 59.5645 24.8234C59.5645 29.6945 61.2987 34.1614 64.1849 37.6429C63.5459 37.5997 62.9032 37.5699 62.2535 37.5699C46.6594 37.5699 34.0186 50.1853 34.0186 65.7471C34.0186 81.3089 46.6594 93.9243 62.2535 93.9243C66.3623 93.9243 70.2623 93.0411 73.784 91.466C77.6073 100.028 86.2027 106 96.2022 106C104.254 106 111.399 102.13 115.873 96.1527C118.121 96.8804 120.517 97.2786 123.008 97.2786C132.181 97.2786 140.105 91.9454 143.838 84.2168C146.198 84.8559 148.68 85.2028 151.243 85.2028C166.837 85.2028 179.478 72.5874 179.478 57.0256C179.478 41.4638 166.837 28.8485 151.243 28.8485L151.243 28.8489Z" fill="#0676D7"/>\n<path d="M169.374 171.949C169.374 184.575 159.117 194.811 146.464 194.811C133.812 194.811 123.555 184.575 123.555 171.949H169.374Z" fill="white" stroke="#39404D" stroke-width="4.04566" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M169.371 171.949C169.371 184.574 159.115 194.809 146.463 194.809C133.812 194.809 123.556 184.574 123.556 171.949" fill="white"/>\n<path d="M169.371 171.949C169.371 184.574 159.115 194.809 146.463 194.809C133.812 194.809 123.556 184.574 123.556 171.949" stroke="#39404D" stroke-width="4.04566" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M248.407 171.952V228.987C248.407 233.974 244.352 238.021 239.35 238.021H53.5753C48.5733 238.021 44.5183 233.974 44.5183 228.987V171.952H123.554C123.554 184.579 133.811 194.815 146.463 194.815C159.115 194.815 169.372 184.579 169.372 171.952H248.407Z" fill="white"/>\n<path d="M239.35 238.468H53.5756C48.3281 238.468 44.0588 234.209 44.0588 228.975V171.94C44.0588 171.687 44.2643 171.482 44.5186 171.482H123.554C123.808 171.482 124.014 171.687 124.014 171.94C124.014 184.294 134.084 194.344 146.463 194.344C158.842 194.344 168.912 184.294 168.912 171.94C168.912 171.687 169.118 171.482 169.372 171.482H248.407C248.661 171.482 248.867 171.687 248.867 171.94V228.975C248.867 234.209 244.597 238.468 239.35 238.468ZM44.9779 172.399V228.975C44.9779 233.703 48.8347 237.55 53.5751 237.55H239.35C244.09 237.55 247.947 233.703 247.947 228.975V172.399H169.827C169.581 185.048 159.195 195.262 146.463 195.262C133.73 195.262 123.344 185.048 123.098 172.399H44.9779Z" fill="#39404D"/>\n<path d="M248.407 171.96H169.372C169.372 184.587 159.115 194.823 146.462 194.823C133.81 194.823 123.553 184.587 123.553 171.96H44.5178L102.299 135.687H192.938L248.407 171.96Z" fill="#0676D7"/>\n<path opacity="0.7" d="M248.407 171.96H169.372C169.372 184.587 159.115 194.823 146.462 194.823C133.81 194.823 123.553 184.587 123.553 171.96H44.5178L102.299 135.687H192.938L248.407 171.96Z" fill="white"/>\n<path d="M146.463 195.271C133.731 195.271 123.345 185.057 123.099 172.409H44.5186C44.314 172.409 44.1338 172.273 44.0768 172.077C44.0202 171.88 44.1007 171.67 44.274 171.561L102.055 135.287C102.128 135.241 102.213 135.217 102.3 135.217H192.939C193.028 135.217 193.116 135.243 193.191 135.292L248.659 171.566C248.829 171.677 248.906 171.886 248.847 172.081C248.789 172.275 248.61 172.409 248.407 172.409H169.827C169.582 185.057 159.195 195.271 146.463 195.271H146.463ZM46.1134 171.491H123.554C123.808 171.491 124.014 171.696 124.014 171.95C124.014 184.303 134.085 194.353 146.463 194.353C158.842 194.353 168.913 184.303 168.913 171.95C168.913 171.696 169.118 171.491 169.373 171.491H246.867L192.802 136.135H102.433L46.1134 171.491Z" fill="#39404D"/>\n<path d="M73.1666 138.619C73.0751 138.619 72.9823 138.591 72.9013 138.534C72.6945 138.388 72.6453 138.101 72.7924 137.895C72.8774 137.774 81.1865 125.787 71.9106 114.858C68.1048 110.374 62.9561 108.657 58.5338 108.657C58.4929 108.657 58.4515 108.657 58.411 108.657C59.2919 111.71 59.1347 114.426 57.8874 116.509C56.7086 118.478 54.6048 119.635 52.5171 119.454C50.6767 119.295 49.2225 118.166 48.5269 116.356C47.5067 113.701 48.5747 111.125 51.3829 109.466C52.8867 108.578 54.9073 107.978 57.1706 107.805C56.5946 106.227 55.739 104.558 54.6121 102.841C51.2629 97.7361 45.1588 94.2023 37.864 93.1457C31.6827 92.2501 25.7584 93.3049 22.7696 95.8311C22.5746 95.9953 22.2845 95.9701 22.1218 95.7774C21.9577 95.5843 21.9816 95.2943 22.1751 95.1305C25.3561 92.4419 31.5659 91.3059 37.9959 92.2377C45.5514 93.332 51.8877 97.0134 55.3813 102.338C56.6074 104.207 57.5251 106.03 58.1251 107.759C62.8816 107.648 68.5006 109.422 72.6112 114.265C82.3547 125.744 73.631 138.3 73.5413 138.425C73.4517 138.551 73.3101 138.618 73.1662 138.618L73.1666 138.619ZM57.4676 108.691C55.2677 108.831 53.3023 109.4 51.8518 110.257C49.4262 111.69 48.5278 113.794 49.3862 116.029C49.9508 117.498 51.1208 118.414 52.5971 118.542C54.3262 118.691 56.0985 117.709 57.0985 116.039C58.2441 114.126 58.3494 111.583 57.4676 108.691Z" fill="#39404D"/>\n<path d="M14.8346 103.237C14.1523 103.442 13.4259 103.408 12.757 103.135C11.9846 102.82 11.3809 102.223 11.0582 101.455C10.7355 100.686 10.7313 99.8385 11.0472 99.0672C11.3635 98.2964 11.9611 97.694 12.7312 97.3715C14.3178 96.708 16.1563 97.455 16.8225 99.0411C17.4891 100.628 16.7384 102.459 15.149 103.124C15.0456 103.168 14.9408 103.205 14.8346 103.237ZM13.3059 98.1391C13.2319 98.1611 13.1588 98.1872 13.0861 98.218C12.5427 98.4455 12.1207 98.8704 11.8977 99.4145C11.6747 99.9591 11.6775 100.557 11.905 101.1C12.1331 101.642 12.5593 102.063 13.1045 102.286C13.6498 102.508 14.2488 102.506 14.7927 102.278C15.9145 101.809 16.4446 100.516 15.9743 99.3957C15.5338 98.3487 14.3716 97.8188 13.3054 98.1386L13.3059 98.1391Z" fill="#39404D"/>\n<path d="M14.83 96.043C14.1473 96.2481 13.4209 96.2141 12.7519 95.9411C11.9791 95.6259 11.3754 95.029 11.0532 94.2605C10.73 93.492 10.7258 92.6446 11.0421 91.8733C11.3584 91.1021 11.9561 90.4997 12.7266 90.1771C13.4953 89.8564 14.3463 89.8514 15.1187 90.1666C15.8916 90.4818 16.4952 91.0787 16.8175 91.8472C17.1407 92.6152 17.1448 93.4631 16.8285 94.2344C16.5127 95.0056 15.9145 95.608 15.144 95.9306C15.0406 95.9737 14.9357 96.0113 14.83 96.043ZM13.3032 90.9438C13.2282 90.9663 13.1547 90.9924 13.0816 91.0232C12.5382 91.2507 12.1161 91.6756 11.8927 92.2197C11.6701 92.7639 11.6724 93.3626 11.9005 93.9049C12.1285 94.4472 12.5542 94.8689 13.1 95.0909C13.6452 95.3135 14.2415 95.3116 14.7886 95.0836C15.332 94.856 15.7541 94.4312 15.9775 93.887C16.2 93.3429 16.1977 92.7442 15.9697 92.2018C15.7417 91.6595 15.3159 91.2379 14.7702 91.0158C14.2981 90.8231 13.7854 90.7993 13.3036 90.9438H13.3032Z" fill="#39404D"/>\n<path d="M13.9326 99.2832C16.1903 99.2832 18.0206 98.0633 18.0206 96.5584C18.0206 95.0535 16.1903 93.8335 13.9326 93.8335C11.6748 93.8335 9.84448 95.0535 9.84448 96.5584C9.84448 98.0633 11.6748 99.2832 13.9326 99.2832Z" fill="white"/>\n<path d="M15.7429 99.4859C15.1806 99.6548 14.5683 99.7438 13.9375 99.7442C11.3873 99.7465 9.38828 98.3495 9.3869 96.5643C9.38552 94.7786 11.3817 93.3792 13.9315 93.3765C15.1135 93.3755 16.2312 93.6852 17.0785 94.2491C17.9828 94.8506 18.4812 95.67 18.4821 96.556C18.483 97.442 17.986 98.2623 17.0826 98.8656C16.6882 99.129 16.2344 99.3377 15.7429 99.485V99.4859ZM12.4051 94.5143C11.1767 94.8832 10.3059 95.6737 10.3064 96.5633C10.3073 97.7916 11.9693 98.828 13.9361 98.8266C14.9388 98.8257 15.8749 98.5688 16.5709 98.1036C17.2104 97.6764 17.5626 97.1272 17.5621 96.5578C17.5617 95.988 17.2086 95.4397 16.5682 95.0135C15.8703 94.5492 14.9342 94.2941 13.9324 94.295C13.3904 94.295 12.8718 94.3744 12.4051 94.5148V94.5143Z" fill="#39404D"/>\n<path d="M14.9382 99.1938L14.8416 93.895L13.5212 93.8413L13.4288 99.2561L14.9382 99.1938Z" fill="#39404D"/>\n<path d="M8.51085 97.7191C8.74395 97.7191 8.9329 97.5304 8.9329 97.2975C8.9329 97.0647 8.74395 96.876 8.51085 96.876C8.27776 96.876 8.08881 97.0647 8.08881 97.2975C8.08881 97.5304 8.27776 97.7191 8.51085 97.7191Z" fill="#39404D"/>\n<path d="M8.83928 95.4563C9.07238 95.4563 9.26133 95.2675 9.26133 95.0347C9.26133 94.8019 9.07238 94.6132 8.83928 94.6132C8.60619 94.6132 8.41724 94.8019 8.41724 95.0347C8.41724 95.2675 8.60619 95.4563 8.83928 95.4563Z" fill="#39404D"/>\n<path d="M154.622 156.089L95.3206 122.308L141.212 41.7485L182.217 65.1074L190.09 93.8258L154.622 156.089Z" fill="white"/>\n<path opacity="0.3" d="M164.241 115.963C166.192 115.963 167.774 114.381 167.774 112.43C167.774 110.479 166.192 108.898 164.241 108.898C162.29 108.898 160.709 110.479 160.709 112.43C160.709 114.381 162.29 115.963 164.241 115.963Z" fill="#0676D7"/>\n<path opacity="0.3" d="M126.964 97.358C128.915 97.358 130.496 95.7766 130.496 93.8257C130.496 91.8749 128.915 90.2935 126.964 90.2935C125.013 90.2935 123.432 91.8749 123.432 93.8257C123.432 95.7766 125.013 97.358 126.964 97.358Z" fill="#0676D7"/>\n<path d="M154.794 156.72L94.6896 122.481L141.038 41.1178L182.612 64.8006L190.587 93.888L154.794 156.72ZM95.9513 122.135L154.449 155.459L189.594 93.763L181.821 65.4145L141.384 42.3795L95.9509 122.135H95.9513Z" fill="#39404D"/>\n<path d="M182.217 65.1075L171.795 83.4036L190.091 93.826L182.217 65.1075Z" fill="#39404D"/>\n<path d="M190.09 94.2879C190.012 94.2879 189.933 94.2679 189.862 94.2272L171.566 83.8049C171.344 83.6787 171.267 83.3963 171.393 83.1742L181.815 64.8785C181.908 64.716 182.09 64.6253 182.275 64.6485C182.46 64.6716 182.613 64.8046 182.663 64.9852L190.537 93.7032C190.586 93.8837 190.522 94.0758 190.374 94.1905C190.291 94.2548 190.191 94.2875 190.09 94.2875V94.2879ZM172.425 83.2301L189.349 92.8708L182.066 66.306L172.425 83.2301Z" fill="#39404D"/>\n<path d="M138.837 89.1784C140.376 89.1784 141.624 87.9303 141.624 86.3906C141.624 84.8509 140.376 83.6028 138.837 83.6028C137.297 83.6028 136.049 84.8509 136.049 86.3906C136.049 87.9303 137.297 89.1784 138.837 89.1784Z" fill="#39404D"/>\n<path d="M164.985 101.068C166.525 101.068 167.773 99.8198 167.773 98.2801C167.773 96.7404 166.525 95.4923 164.985 95.4923C163.446 95.4923 162.198 96.7404 162.198 98.2801C162.198 99.8198 163.446 101.068 164.985 101.068Z" fill="#39404D"/>\n<path d="M153.137 118.167C152.887 118.167 152.682 117.968 152.675 117.717C152.548 113.016 149.895 108.72 145.753 106.506C141.908 104.451 137.307 104.442 133.447 106.482C133.221 106.601 132.941 106.515 132.822 106.289C132.702 106.063 132.789 105.783 133.015 105.664C137.147 103.48 142.072 103.49 146.189 105.69C150.624 108.061 153.463 112.659 153.599 117.691C153.606 117.946 153.405 118.159 153.15 118.166C153.145 118.166 153.141 118.166 153.137 118.166V118.167Z" fill="#39404D"/>\n<path d="M141.262 83.5378C138.889 83.5378 137.134 82.3197 137.038 82.2518C136.829 82.104 136.78 81.8156 136.928 81.6071C137.075 81.399 137.363 81.3491 137.572 81.4969C137.609 81.5225 140.322 83.3849 143.353 82.227C143.592 82.1355 143.859 82.2558 143.95 82.4942C144.041 82.7326 143.922 83.0002 143.683 83.0913C142.836 83.4148 142.017 83.5382 141.262 83.5382L141.262 83.5378Z" fill="#39404D"/>\n<path d="M169.817 96.8285C169.767 96.8285 169.715 96.8201 169.665 96.8025C165.766 95.443 165.323 92.4379 165.306 92.3105C165.272 92.0573 165.45 91.8248 165.703 91.7913C165.955 91.7585 166.188 91.9347 166.222 92.1867C166.238 92.2961 166.633 94.7664 169.969 95.9295C170.21 96.0137 170.338 96.2773 170.254 96.5182C170.187 96.7091 170.008 96.8285 169.817 96.8285Z" fill="#39404D"/>\n<path d="M213.236 125.144C213.039 125.144 212.857 125.017 212.797 124.82C212.771 124.738 210.316 116.578 211.599 107.375C212.787 98.8424 217.503 87.6415 233.22 82.7369C235.778 81.939 238.025 81.4458 240.001 81.1856C240.741 76.5696 243.559 71.5622 249.859 68.1073C264.83 59.8984 274.942 67.2636 275.042 67.3388C275.244 67.4912 275.285 67.7784 275.133 67.9807C274.981 68.1835 274.693 68.2239 274.489 68.0725C274.394 68.0009 264.73 60.9991 250.302 68.9116C244.414 72.1403 241.719 76.7742 240.953 81.076C247.885 80.3947 251.206 82.7025 252.695 84.4459C254.59 86.6633 255.008 89.7135 253.76 92.2172C252.702 94.3396 250.665 95.5293 248.319 95.3871C244.447 95.1604 241.243 91.9103 240.157 87.1065C239.819 85.6104 239.697 83.9197 239.875 82.1496C237.901 82.418 235.764 82.9053 233.495 83.6132C221.245 87.436 214.184 95.4734 212.509 107.502C211.255 116.506 213.651 124.472 213.676 124.551C213.75 124.793 213.613 125.05 213.371 125.124C213.326 125.138 213.281 125.144 213.236 125.144V125.144ZM240.812 82.0367C240.613 83.7765 240.724 85.4397 241.054 86.9042C242.048 91.2987 244.92 94.2685 248.372 94.4709C250.337 94.5828 252.048 93.5909 252.937 91.8079C254.02 89.6341 253.651 86.9781 251.995 85.0405C249.845 82.5249 245.922 81.5082 240.812 82.0363V82.0367Z" fill="#39404D"/>\n<path d="M285.753 71.9786C285.131 71.9786 284.52 71.801 283.984 71.4569C283.247 70.9834 282.738 70.2521 282.551 69.3968C282.167 67.6318 283.294 65.8833 285.063 65.4997C286.833 65.1162 288.583 66.2407 288.968 68.0057C289.352 69.7712 288.226 71.5193 286.456 71.9029C286.222 71.9538 285.987 71.9786 285.753 71.9786ZM285.76 66.3421C285.594 66.3421 285.426 66.36 285.258 66.3963C283.984 66.6725 283.174 67.931 283.45 69.2019C283.584 69.8176 283.95 70.3443 284.481 70.6852C285.012 71.0261 285.645 71.1408 286.261 71.0063C287.535 70.7301 288.346 69.4716 288.069 68.2007C287.829 67.0978 286.847 66.3421 285.76 66.3421Z" fill="#39404D"/>\n<path d="M284.37 79.4693C283.748 79.4693 283.137 79.2917 282.6 78.9476C281.863 78.4742 281.355 77.7428 281.168 76.8876C280.983 76.0324 281.141 75.1561 281.616 74.4201C282.09 73.6842 282.823 73.1768 283.68 72.991C284.536 72.8047 285.415 72.9634 286.152 73.4369C286.89 73.9104 287.398 74.6417 287.585 75.497C287.77 76.3522 287.612 77.2285 287.137 77.9644C286.663 78.7003 285.93 79.2078 285.073 79.3936C284.839 79.4445 284.604 79.4693 284.37 79.4693ZM284.381 73.8329C284.213 73.8329 284.044 73.8508 283.874 73.8875C283.257 74.0214 282.73 74.3866 282.389 74.9166C282.047 75.4465 281.933 76.0773 282.067 76.6931C282.201 77.3088 282.567 77.8355 283.098 78.1764C283.629 78.5177 284.262 78.6315 284.878 78.4975C285.495 78.3636 286.022 77.9984 286.364 77.4684C286.705 76.9385 286.82 76.3077 286.685 75.6919C286.551 75.0762 286.185 74.5495 285.655 74.2086C285.268 73.9609 284.829 73.8333 284.381 73.8333L284.381 73.8329Z" fill="#39404D"/>\n<path d="M289.306 73.3157C289.596 71.7486 287.925 70.1272 285.574 69.6942C283.222 69.2613 281.082 70.1807 280.792 71.7478C280.502 73.3149 282.173 74.9363 284.524 75.3693C286.875 75.8022 289.016 74.8828 289.306 73.3157Z" fill="white"/>\n<path d="M285.684 75.9504C285.277 75.9504 284.861 75.9123 284.443 75.8357C283.217 75.61 282.118 75.0746 281.349 74.3281C280.53 73.5339 280.172 72.5933 280.342 71.6798C280.511 70.7664 281.181 70.0153 282.23 69.5647C283.215 69.1413 284.432 69.033 285.659 69.2583C286.885 69.484 287.983 70.0194 288.752 70.7659C289.571 71.5601 289.929 72.5006 289.76 73.4141C289.591 74.3276 288.92 75.0787 287.872 75.5292C287.222 75.8082 286.471 75.9504 285.684 75.9504ZM284.414 70.0603C283.753 70.0603 283.129 70.1777 282.593 70.4076C281.836 70.7329 281.357 71.244 281.246 71.8464C281.134 72.4488 281.398 73.0966 281.99 73.6701C282.63 74.2914 283.561 74.7405 284.609 74.9332C285.657 75.1255 286.687 75.0383 287.508 74.6864C288.265 74.3611 288.744 73.85 288.855 73.2476C288.967 72.6452 288.703 71.9973 288.112 71.4234C287.471 70.8021 286.541 70.3534 285.492 70.1603C285.128 70.0933 284.766 70.0603 284.414 70.0603Z" fill="#39404D"/>\n<path d="M284.519 69.585L283.594 75.1209L284.959 75.4311L286.102 69.8112L284.519 69.585Z" fill="#39404D"/>\n<path d="M290.064 75.5551C290.311 75.5551 290.511 75.3552 290.511 75.1087C290.511 74.8622 290.311 74.6624 290.064 74.6624C289.817 74.6624 289.617 74.8622 289.617 75.1087C289.617 75.3552 289.817 75.5551 290.064 75.5551Z" fill="#39404D"/>\n<path d="M290.839 73.2639C291.086 73.2639 291.286 73.0641 291.286 72.8176C291.286 72.5711 291.086 72.3712 290.839 72.3712C290.592 72.3712 290.392 72.5711 290.392 72.8176C290.392 73.0641 290.592 73.2639 290.839 73.2639Z" fill="#39404D"/>\n</g>\n<defs>\n<clipPath id="clip0_4825_1253">\n<rect width="285.219" height="236.459" fill="white" transform="translate(6.07141 2.01624)"/>\n</clipPath>\n</defs>\n</svg>\n',
2112
2165
  "dir": "svgs"
2113
2166
  },
2167
+ {
2168
+ "name": "noData.svg",
2169
+ "content": '<svg width="250" height="189" viewBox="0 0 250 189" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M177.659 109.899C179.273 109.899 180.582 108.591 180.582 106.976C180.582 105.362 179.273 104.053 177.659 104.053C176.045 104.053 174.736 105.362 174.736 106.976C174.736 108.591 176.045 109.899 177.659 109.899Z" fill="#6AC8FB"/>\n<path opacity="0.05" d="M39.7463 74.4078C22.3117 53.8623 25.5348 14.6262 47.8964 2.87581C67.0304 -7.18807 84.0201 12.0413 101.609 16.5331C138.107 25.8475 229.867 -18.6019 225.439 37.4815C219.618 111.203 87.5302 130.718 39.7463 74.4078Z" fill="#0676D7"/>\n<path opacity="0.1" d="M133.232 188.92C170.682 188.92 201.042 185.779 201.042 181.905C201.042 178.031 170.682 174.89 133.232 174.89C95.7812 174.89 65.4216 178.031 65.4216 181.905C65.4216 185.779 95.7812 188.92 133.232 188.92Z" fill="#0676D7"/>\n<path d="M156.617 97.5654H143.756V180.567C143.756 187.582 156.617 187.582 156.617 180.567V97.5654Z" fill="#A6DDFD"/>\n<path d="M143.894 97.5654H156.48V110.151L143.894 105.522V97.5654Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M143.894 97.5654H156.48V110.151L143.894 105.522V97.5654Z" fill="#CDEBFE"/>\n<path d="M130.309 56.7033C130.383 52.7185 129.647 48.8518 128.167 45.1489C126.688 41.446 124.483 38.0739 121.68 35.2299C118.878 32.3858 115.535 30.1267 111.846 28.5845C108.157 27.0423 104.197 26.248 100.197 26.248C96.1966 26.248 92.2365 27.0423 88.5478 28.5845C84.8592 30.1267 81.516 32.3858 78.7136 35.2299C75.9112 38.0739 73.7058 41.446 72.2263 45.1489C70.7468 48.8518 70.0228 52.8113 70.0967 56.7961V97.5656L130.309 97.6232V56.7033Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M130.309 56.7033C130.383 52.7185 129.647 48.8518 128.167 45.1489C126.688 41.446 124.483 38.0739 121.68 35.2299C118.878 32.3858 115.535 30.1267 111.846 28.5845C108.157 27.0423 104.197 26.248 100.197 26.248C96.1966 26.248 92.2365 27.0423 88.5478 28.5845C84.8592 30.1267 81.516 32.3858 78.7136 35.2299C75.9112 38.0739 73.7058 41.446 72.2263 45.1489C70.7468 48.8518 70.0228 52.8113 70.0967 56.7961V97.5656L130.309 97.6232V56.7033Z" fill="#2E343F"/>\n<path d="M112.464 40.7101C111.497 39.8795 110.311 39.6029 108.908 39.8835C107.505 40.164 106.518 40.8704 105.946 42.0029C105.373 43.1353 105.268 44.6041 105.629 46.4094L106.117 48.8497C106.475 50.6425 107.138 51.9553 108.107 52.7854C109.074 53.616 110.263 53.8897 111.67 53.6082C113.078 53.3268 114.052 52.623 114.625 51.4903C115.197 50.3579 115.303 48.8902 114.942 47.0838L114.456 44.6525C114.096 42.8541 113.433 41.5402 112.464 40.7101ZM112.104 48.1389C112.29 49.1009 112.31 49.8308 112.163 50.3278C112.016 50.8249 111.693 51.1238 111.194 51.2236C110.694 51.3235 110.254 51.1711 109.926 50.7551C109.596 50.3404 109.33 49.6359 109.131 48.6388L108.449 45.2264C108.286 44.3296 108.277 43.6378 108.418 43.1514C108.559 42.6652 108.882 42.3722 109.387 42.2713C109.891 42.1703 110.326 42.3296 110.658 42.7557C110.99 43.1829 111.253 43.876 111.445 44.8367L112.106 48.1399L112.104 48.1389Z" fill="#CDEBFE"/>\n<path d="M87.6596 84.9381C87.0496 84.4141 86.3015 84.2396 85.4163 84.4166C84.5311 84.5936 83.9084 85.0392 83.5475 85.7536C83.1866 86.4681 83.12 87.3947 83.3477 88.5335L83.6556 90.0731C83.8817 91.204 84.2999 92.0322 84.9113 92.5559C85.5213 93.0799 86.2712 93.2525 87.1591 93.075C88.0469 92.8974 88.6615 92.4534 89.0231 91.7389C89.384 91.0245 89.4508 90.0986 89.2229 88.959L88.9162 87.4252C88.6893 86.2907 88.271 85.4618 87.6596 84.9381ZM87.4328 89.6246C87.5499 90.2315 87.5627 90.6919 87.4698 91.0055C87.3768 91.3191 87.1732 91.5076 86.8582 91.5706C86.5432 91.6336 86.2657 91.5375 86.0583 91.2751C85.8503 91.0135 85.6829 90.569 85.5571 89.94L85.1266 87.7872C85.0241 87.2215 85.0182 86.7851 85.1075 86.4782C85.1962 86.1715 85.3998 85.9866 85.7182 85.923C86.0367 85.8593 86.3108 85.9598 86.5202 86.2286C86.7298 86.4981 86.8957 86.9354 87.0169 87.5414L87.4336 89.6252L87.4328 89.6246Z" fill="#CDEBFE"/>\n<path d="M66.128 115.13C62.1038 131.761 72.2876 145.24 88.9594 145.24C105.631 145.24 122.334 131.761 126.358 115.13L130.547 97.8119C130.604 97.5785 130.608 97.3351 130.558 97.1001C130.507 96.865 130.404 96.6446 130.255 96.4556C130.107 96.2665 129.917 96.1138 129.701 96.0091C129.485 95.9043 129.247 95.8503 129.007 95.8511H72.0412C71.6848 95.8528 71.3393 95.9742 71.0601 96.1957C70.7808 96.4172 70.5841 96.7261 70.5013 97.0727L66.128 115.13Z" fill="#A6DDFD"/>\n<path opacity="0.4" d="M66.128 115.13C62.1038 131.761 72.2876 145.24 88.9594 145.24C105.631 145.24 122.334 131.761 126.358 115.13L130.547 97.8119C130.604 97.5785 130.608 97.3351 130.558 97.1001C130.507 96.865 130.404 96.6446 130.255 96.4556C130.107 96.2665 129.917 96.1138 129.701 96.0091C129.485 95.9043 129.247 95.8503 129.007 95.8511H72.0412C71.6848 95.8528 71.3393 95.9742 71.0601 96.1957C70.7808 96.4172 70.5841 96.7261 70.5013 97.0727L66.128 115.13Z" fill="white"/>\n<path d="M63.7051 115.13C59.6809 131.761 69.8647 145.24 86.5365 145.24C103.208 145.24 119.911 131.761 123.935 115.13L128.165 97.8119C128.223 97.5785 128.226 97.3351 128.176 97.1001C128.125 96.865 128.022 96.6446 127.874 96.4556C127.725 96.2665 127.535 96.1138 127.319 96.0091C127.103 95.9043 126.865 95.8503 126.625 95.8511H69.6491C69.2927 95.8528 68.9472 95.9742 68.6679 96.1957C68.3887 96.4172 68.192 96.7261 68.1092 97.0727L63.7051 115.13Z" fill="#A6DDFD"/>\n<path d="M201.188 56.5949V97.6937L130.309 97.6232V56.7033C130.306 48.6896 127.079 40.8966 121.425 35.2301C115.772 29.5635 107.907 26.3084 99.9112 26.3057L171.09 26.3762C179.085 26.3789 186.752 29.5635 192.406 35.2301C198.06 40.8966 201.237 48.5813 201.24 56.5949H201.188Z" fill="#A6DDFD"/>\n<path d="M201.188 56.6146V67.5684H130.353V56.6146C130.367 49.9185 128.133 43.4115 124.009 38.136H194.895C199.001 43.4182 201.217 49.9246 201.188 56.6146Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M201.188 56.6146V67.5684H130.353L130.309 56.7032C130.322 50.0071 128.133 43.4115 124.009 38.136H194.895C199.001 43.4182 201.217 49.9246 201.188 56.6146Z" fill="#CDEBFE"/>\n<path d="M140.178 72.8451V12.2762C140.176 11.7362 140.293 11.2024 140.519 10.712C140.745 10.2215 141.075 9.78628 141.487 9.43646C141.898 9.08665 142.381 8.83069 142.901 8.6864C143.421 8.5421 143.967 8.51295 144.5 8.60096L159.016 11.0032C159.536 11.0886 160.009 11.3567 160.349 11.7593C160.69 12.162 160.876 12.6728 160.874 13.2001V16.9574C160.874 17.5482 160.639 18.1149 160.221 18.5326C159.804 18.9504 159.237 19.1851 158.646 19.1851H144.797V72.8246C144.797 73.4372 144.554 74.0247 144.121 74.4579C143.688 74.8911 143.1 75.1344 142.488 75.1344C141.878 75.1344 141.294 74.8939 140.861 74.4652C140.429 74.0364 140.183 73.4541 140.178 72.8451Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M140.178 72.8451V12.2762C140.176 11.7362 140.293 11.2024 140.519 10.712C140.745 10.2215 141.075 9.78628 141.487 9.43646C141.898 9.08665 142.381 8.83069 142.901 8.6864C143.421 8.5421 143.967 8.51295 144.5 8.60096L159.016 11.0032C159.536 11.0886 160.009 11.3567 160.349 11.7593C160.69 12.162 160.876 12.6728 160.874 13.2001V16.9574C160.874 17.5482 160.639 18.1149 160.221 18.5326C159.804 18.9504 159.237 19.1851 158.646 19.1851H144.797V72.8246C144.797 73.4372 144.554 74.0247 144.121 74.4579C143.688 74.8911 143.1 75.1344 142.488 75.1344C141.878 75.1344 141.294 74.8939 140.861 74.4652C140.429 74.0364 140.183 73.4541 140.178 72.8451Z" fill="#39404D"/>\n<path d="M132.534 137.833C135.235 137.833 137.425 135.643 137.425 132.942C137.425 130.24 135.235 128.051 132.534 128.051C129.832 128.051 127.642 130.24 127.642 132.942C127.642 135.643 129.832 137.833 132.534 137.833Z" fill="#6AC8FB"/>\n<path d="M136.939 147.341C138.069 147.341 138.985 146.425 138.985 145.295C138.985 144.165 138.069 143.249 136.939 143.249C135.809 143.249 134.893 144.165 134.893 145.295C134.893 146.425 135.809 147.341 136.939 147.341Z" fill="#A6DDFD"/>\n<path d="M120.933 140.244C122.586 140.244 123.926 138.904 123.926 137.252C123.926 135.599 122.586 134.259 120.933 134.259C119.281 134.259 117.941 135.599 117.941 137.252C117.941 138.904 119.281 140.244 120.933 140.244Z" fill="#A6DDFD"/>\n<path d="M131.594 19C132.974 19 134.094 17.8807 134.094 16.5C134.094 15.1193 132.974 14 131.594 14C130.213 14 129.094 15.1193 129.094 16.5C129.094 17.8807 130.213 19 131.594 19Z" fill="#6AC8FB"/>\n<path d="M77.5001 60C84.0866 63.3453 95.5372 68.7063 106.098 71.4033" stroke="white" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2 4"/>\n<path d="M75.8355 59.6317L80.5719 48.3798L46.2247 40L75.8355 59.6317Z" fill="white" stroke="#39404D" stroke-width="0.2" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M78.1445 49.7425L75.8355 59.6317L46.2247 40L78.1445 49.7425Z" fill="#6AC8FB" stroke="#39404D" stroke-width="0.2" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M78.1445 49.7425L72.7552 54.3606L46.2247 40L78.1445 49.7425Z" fill="white" stroke="#39404D" stroke-width="0.2" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M80.5719 48.3798L85.3698 46.4303L46.2247 40L80.5719 48.3798Z" fill="white" stroke="#39404D" stroke-width="0.2" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M69.1636 57.8811L70.2755 58.5625" stroke="#39404D" stroke-width="0.4" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M63.0979 54.1621L66.8217 56.4428" stroke="#39404D" stroke-width="0.4" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M58.9148 81.171V68.968L93.825 74.5798L58.9148 81.171Z" fill="white" stroke="#39404D" stroke-width="0.2" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M60.6229 71.1628L58.9148 81.1703L93.825 74.5791L60.6229 71.1628Z" fill="#6AC8FB" stroke="#39404D" stroke-width="0.2" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M60.6231 71.1628L63.798 77.508L93.8252 74.5791L60.6231 71.1628Z" fill="white" stroke="#39404D" stroke-width="0.2" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M58.915 68.967L55.2527 65.3047L93.8252 74.5788L58.915 68.967Z" fill="white" stroke="#39404D" stroke-width="0.2" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M71.4159 80.9437L74.4442 80.3286" stroke="#39404D" stroke-width="0.4" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M60.7791 83.1054L68.3923 81.5581" stroke="#39404D" stroke-width="0.4" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M57.5001 81.5C57.5001 81.5 29.722 85.7553 24.9995 110.483C20.2769 135.21 45.1775 136.636 49.4708 124.748C53.764 112.86 34.8738 108.105 30.5806 119.518C26.2874 130.93 44.6874 142.507 71.0001 141" stroke="#39404D" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2 4"/>\n</svg>\n',
2170
+ "dir": "svgs"
2171
+ },
2114
2172
  {
2115
2173
  "name": "noConnections.svg",
2116
2174
  "content": '<svg width="320" height="97" viewBox="0 0 320 97" fill="none" xmlns="http://www.w3.org/2000/svg">\n<ellipse opacity="0.19" cx="121" cy="65.9004" rx="31" ry="4.5" fill="#39404D"/>\n<ellipse opacity="0.19" cx="188.5" cy="65.9004" rx="31.5" ry="4.5" fill="#39404D"/>\n<path d="M201 39.6727C200.89 29.6604 196.866 21.1145 191.517 17.4231V15.4004L176.775 15.5521C168.478 15.6431 161.834 26.6769 162.003 40.1278C162.172 53.5787 168.976 64.4708 177.283 64.4L192.025 64.2484V62.2257C197.204 58.3118 201.049 49.685 201 39.6727Z" fill="#39404D" stroke="#39404D" stroke-width="1.04742" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M207.684 39.6264C207.574 29.2449 203.558 20.3807 197.909 16.5276V14.4014L191.559 14.4712C182.785 14.5611 175.805 25.9708 175.955 39.9558C176.105 53.9409 183.326 65.2009 192.1 65.111L198.45 65.0411V62.9249C203.968 58.952 207.794 49.968 207.684 39.6264Z" fill="#F2F3F6" stroke="#39404D" stroke-width="1.04742" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M213.998 39.7346C214.149 53.8088 207.104 65.3094 198.272 65.3999C189.44 65.4903 182.123 54.1506 182.002 40.0764C181.88 26.0022 188.895 14.5016 197.727 14.4011C206.559 14.3005 213.826 25.6504 213.998 39.7346Z" fill="#758195" stroke="#39404D" stroke-width="1.04742" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M210.409 39.1275C210.479 45.7457 207.164 51.156 203.007 51.2059C198.851 51.2558 195.426 45.9054 195.356 39.2273C195.285 32.5492 198.601 27.2486 202.757 27.1488C206.914 27.049 210.339 32.4993 210.409 39.1275Z" fill="#39404D" stroke="#596479" stroke-width="1.04742" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M204.318 39.5771C204.318 39.5771 219.833 38.8569 227.845 48.3403C235.008 56.8177 244.371 66.8074 254.386 63.8132C267.204 59.9814 271.51 47.7397 284.933 48.3408C297.153 48.888 297.954 65.8092 315 64.1433" stroke="#39404D" stroke-width="3.14226" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M130.415 40.505C129.604 31.7905 125.408 24.6332 120.4 21.7883L120.24 20.0115L107.159 21.2193C99.7979 21.8981 94.7201 31.9702 95.8118 43.7092C96.9034 55.4483 103.754 64.4024 111.115 63.6737L124.196 62.4658L124.025 60.689C128.432 57.0155 131.227 49.2194 130.415 40.505Z" fill="#39404D" stroke="#39404D" stroke-width="1.04742" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M136.334 39.9862C135.483 30.8325 131.326 23.2959 126.028 20.3012L125.848 18.4346L120.249 18.9536C112.517 19.6724 107.179 30.2435 108.321 42.5815C109.463 54.9196 116.674 64.3328 124.406 63.6141L130.004 63.095L129.834 61.2283C134.461 57.2953 137.186 49.1099 136.334 39.9862Z" fill="#C3C8D3" stroke="#39404D" stroke-width="1.04742" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M141.846 39.5925C142.983 52.0043 137.712 62.6386 130.069 63.3616C122.425 64.0846 115.316 54.6051 114.159 42.2034C113.002 29.8017 118.292 19.1071 125.926 18.4343C133.559 17.7615 140.699 27.1908 141.846 39.5925Z" fill="#F2F3F6" stroke="#39404D" stroke-width="1.04742" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M147.952 32.2297L126.228 34.2261C125.923 34.255 125.616 34.2236 125.324 34.1337C125.031 34.0439 124.76 33.8974 124.524 33.7026C124.289 33.5078 124.094 33.2686 123.952 32.9988C123.809 32.7289 123.722 32.4336 123.694 32.1299C123.665 31.8263 123.697 31.52 123.787 31.2285C123.877 30.9371 124.024 30.6663 124.219 30.4316C124.415 30.197 124.655 30.0031 124.925 29.8611C125.196 29.7192 125.493 29.6319 125.797 29.6044L147.521 27.6079C147.826 27.5791 148.133 27.6105 148.425 27.7003C148.718 27.7901 148.989 27.9366 149.225 28.1314C149.46 28.3262 149.655 28.5654 149.797 28.8353C149.94 29.1052 150.027 29.4005 150.055 29.7042C150.084 30.0078 150.052 30.3141 149.962 30.6055C149.872 30.8969 149.725 31.1677 149.53 31.4024C149.334 31.6371 149.094 31.8309 148.823 31.9729C148.553 32.1149 148.256 32.2021 147.952 32.2297Z" fill="#758195" stroke="#39404D" stroke-width="1.04742" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M149.564 49.3893L127.84 51.3857C127.536 51.4145 127.228 51.3831 126.936 51.2933C126.644 51.2035 126.372 51.057 126.136 50.8622C125.901 50.6674 125.706 50.4282 125.564 50.1583C125.422 49.8884 125.334 49.5931 125.306 49.2894C125.277 48.9858 125.309 48.6795 125.399 48.3881C125.489 48.0967 125.636 47.8258 125.832 47.5912C126.027 47.3565 126.267 47.1627 126.538 47.0207C126.809 46.8787 127.105 46.7915 127.41 46.7639L149.133 44.7675C149.747 44.7146 150.358 44.9049 150.832 45.2973C151.306 45.6897 151.606 46.2524 151.667 46.8638C151.696 47.1673 151.665 47.4736 151.574 47.7651C151.484 48.0565 151.337 48.3273 151.142 48.562C150.946 48.7966 150.706 48.9905 150.436 49.1324C150.165 49.2744 149.869 49.3617 149.564 49.3893Z" fill="#758195" stroke="#39404D" stroke-width="1.04742" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M101.52 40.0948C101.52 40.0948 87.1818 41.0705 79.6156 47.7414C66.5954 59.2209 66.0946 66.7076 51.0714 65.2102C36.5791 63.7658 29.0372 43.7485 5 47.7414" stroke="#39404D" stroke-width="3.14226" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n',
@@ -2141,26 +2199,6 @@ DropdownItem.displayName = "DropdownItem";
2141
2199
  "content": '<svg width="448" height="416" viewBox="0 0 448 416" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_d_3558_1208)">\n<rect width="170" height="176" rx="8" transform="matrix(-1 0 0 1 267 45)" fill="white"/>\n<rect x="-0.25" y="0.25" width="169.5" height="175.5" rx="7.75" transform="matrix(-1 0 0 1 266.5 45)" stroke="#2E343F" stroke-width="0.5"/>\n</g>\n<rect x="-0.25" y="0.25" width="137.5" height="31.5" rx="2.75" transform="matrix(-1 0 0 1 250.5 77)" stroke="#2E343F" stroke-width="0.5"/>\n<rect x="121" y="89" width="98" height="2" rx="1" fill="#8F9AAD"/>\n<rect x="121" y="97" width="57" height="2" rx="1" fill="#C3C8D3"/>\n<g clip-path="url(#clip0_3558_1208)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M241 91.4928C242.664 89.782 246.825 92.7756 241 96.625C235.175 92.776 239.336 89.782 241 91.4928Z" fill="#F38176"/>\n</g>\n<rect x="-0.25" y="0.25" width="137.5" height="31.5" rx="2.75" transform="matrix(-1 0 0 1 250.5 117)" stroke="#2E343F" stroke-width="0.5"/>\n<rect x="121" y="129" width="98" height="2" rx="1" fill="#8F9AAD"/>\n<rect x="121" y="137" width="57" height="2" rx="1" fill="#C3C8D3"/>\n<g clip-path="url(#clip1_3558_1208)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M241 131.493C242.664 129.782 246.825 132.776 241 136.625C235.175 132.776 239.336 129.782 241 131.493Z" fill="#F38176"/>\n</g>\n<rect x="-0.25" y="0.25" width="137.5" height="31.5" rx="2.75" transform="matrix(-1 0 0 1 250.5 157)" stroke="#2E343F" stroke-width="0.5"/>\n<rect x="121" y="169" width="98" height="2" rx="1" fill="#8F9AAD"/>\n<rect x="121" y="177" width="57" height="2" rx="1" fill="#C3C8D3"/>\n<g clip-path="url(#clip2_3558_1208)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M241 171.493C242.664 169.782 246.825 172.776 241 176.625C235.175 172.776 239.336 169.782 241 171.493Z" fill="#F38176"/>\n</g>\n<path d="M96 74C109.255 74 120 63.2548 120 50C120 36.7452 109.255 26 96 26C82.7452 26 72 36.7452 72 50C72 63.2548 82.7452 74 96 74Z" fill="#2E343F"/>\n<g clip-path="url(#clip3_3558_1208)">\n<g clip-path="url(#clip4_3558_1208)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M95.9997 41.6426C101.547 35.9401 115.417 45.9188 95.9997 58.7501C76.5822 45.9201 90.4522 35.9401 95.9997 41.6426Z" fill="#F38176"/>\n</g>\n</g>\n<path d="M289.247 24.8291C289.247 24.8291 283.967 19.577 283.909 9.14526C283.865 1.06821 290.469 7.20151 290.469 7.20151C290.469 7.20151 290.493 1.38534 294.576 2.52171C298.658 3.65863 300.168 9.97907 300.168 9.97907" fill="#181818"/>\n<path d="M315.994 6.13684C315.994 6.13684 336.339 11.1796 325.043 38.1398L323.199 38.012L319.456 37.7526" fill="#181818"/>\n<path d="M289.881 66.1603C289.973 66.1485 290.99 83.0221 310.59 81.5513C324.159 80.5347 328.997 66.1366 329.308 66.1366C327.845 65.8254 326.037 65.3535 325.318 65.1917C322.931 64.6534 319.951 62.6838 319.262 58.5336C318.865 56.1417 319.539 43.9058 319.331 41.4858L298.503 46.1354C298.794 51.2462 300.831 63.0948 293.692 65.1917C292.504 65.5385 291.224 65.8572 289.881 66.1603Z" fill="#FF9E85"/>\n<path opacity="0.22" d="M298.211 60.3491C298.506 59.4074 298.682 58.5882 298.838 57.1158C299.117 54.4827 298.968 52.0622 298.702 49.5958C302.91 49.0355 306.95 47.2659 310.214 44.552C310.6 45.9807 312.727 52.2224 312.138 53.5799C311.025 56.146 305.794 60.3485 298.212 60.3485L298.211 60.3491Z" fill="#0C0C0C"/>\n<path d="M301.326 55.4276C309.567 55.8127 320.016 52.0029 321.67 40.9703L323.163 31.0153C324.817 19.9821 320.364 10.1695 309.977 8.61189C299.59 7.0543 290.486 14.8336 288.831 25.8668L288.171 30.2742C288.035 31.1814 287.886 32.8236 287.88 34.851C287.87 38.8955 287.87 45.0476 290.006 49.502C292.023 53.7072 296.061 55.1822 301.326 55.4287V55.4276Z" fill="#FF9E85"/>\n<path d="M292.596 34.6624C293.229 34.6624 293.742 34.1493 293.742 33.5164C293.742 32.8835 293.229 32.3705 292.596 32.3705C291.963 32.3705 291.451 32.8835 291.451 33.5164C291.451 34.1493 291.963 34.6624 292.596 34.6624Z" fill="#181818"/>\n<path d="M299.716 40.8066C299.948 40.8066 300.146 40.6313 300.171 40.3962C300.197 40.1443 300.014 39.9188 299.763 39.893L297.336 39.6395L298.83 34.793C298.904 34.5514 298.768 34.2947 298.526 34.2202C298.285 34.1458 298.029 34.2812 297.954 34.5234L296.296 39.9027C296.256 40.0337 296.276 40.1756 296.352 40.2899C296.428 40.4042 296.551 40.4787 296.687 40.4932L299.668 40.805C299.684 40.8066 299.701 40.8077 299.716 40.8077L299.716 40.8066Z" fill="#181818"/>\n<path d="M300.254 45.9951C304.407 45.9951 305.643 43.4856 305.698 43.368C305.806 43.1394 305.708 42.8664 305.479 42.758C305.252 42.6502 304.98 42.7473 304.871 42.9743C304.819 43.0811 303.551 45.5459 298.981 44.9995C298.725 44.9677 298.501 45.1489 298.471 45.4002C298.441 45.6516 298.621 45.8792 298.871 45.9094C299.364 45.9682 299.825 45.9951 300.254 45.9951H300.254Z" fill="#181818"/>\n<path d="M303.72 27.7481C303.61 28.0896 304.851 28.6 306.597 29.0678C308.343 29.5355 309.923 29.8733 310.042 29.4427C310.192 28.8989 308.891 27.6186 307.145 27.1508C305.399 26.6831 303.893 27.2113 303.72 27.7481Z" fill="#181818"/>\n<path d="M304.08 35.3927C304.713 35.3927 305.226 34.8797 305.226 34.2468C305.226 33.6139 304.713 33.1008 304.08 33.1008C303.448 33.1008 302.935 33.6139 302.935 34.2468C302.935 34.8797 303.448 35.3927 304.08 35.3927Z" fill="#181818"/>\n<path d="M289.81 27.9882C289.848 28.3448 291.19 28.3076 292.975 28.0265C294.76 27.7454 296.342 27.4125 296.275 26.9712C296.192 26.4133 294.669 25.7313 292.884 26.0124C291.099 26.2935 289.751 27.4271 289.81 27.9882Z" fill="#181818"/>\n<path d="M320.521 44.2347C323.677 44.7083 326.742 41.7144 327.216 38.5577C327.689 35.401 325.392 33.276 322.235 32.8025L320.291 34.674L317.807 43.8275L320.521 44.2347Z" fill="#FF9E85"/>\n<path d="M319.047 38.7677C318.513 38.7428 318.099 38.2936 318.121 37.7596C318.265 34.3095 318.454 22.695 314.536 21.3218C311.465 20.2459 303.194 23.6771 296.286 21.352C293.264 20.3349 290.213 20.6995 289.712 22.1244C289.514 22.6885 288.723 14.0824 294.45 8.41722C299.009 3.90677 311.866 4.21851 317.4 6.66007C332.724 13.4217 322.792 33.5803 322.792 33.5803L321.548 38.1242C321.428 38.5627 321.02 38.8599 320.566 38.8383L319.047 38.7677Z" fill="#181818"/>\n<path d="M305.411 9.99226C306.603 6.64545 305.725 3.27587 303.452 2.46611C301.178 1.65634 298.369 3.71302 297.177 7.05984C295.986 10.4067 296.863 13.7762 299.136 14.586C301.41 15.3957 304.219 13.3391 305.411 9.99226Z" fill="#181818"/>\n<path d="M326.795 391.556C326.795 391.556 324.361 404.178 312.544 404.882C300.726 405.585 303.289 415 303.289 415H348.447V392.436L326.795 391.556Z" fill="#A6DDFD"/>\n<path d="M276.124 391.556C276.124 391.556 273.69 404.178 261.873 404.882C250.056 405.585 252.618 415 252.618 415H297.776V392.436L276.124 391.556Z" fill="#A6DDFD"/>\n<path d="M270.385 163.792C270.385 163.792 266.678 273.522 267.063 278.885L270.549 398.781L299.733 399.32L304.438 274.549C304.438 274.549 307.523 240.131 315.838 208.172C320.105 191.773 322.64 174.972 323.478 158.047L270.385 163.792Z" fill="#181818"/>\n<g style="mix-blend-mode:plus-darker">\n<path d="M308.886 241.59L306.452 204.371C306.452 204.371 303.952 219.844 303.952 233.181C303.952 239.7 305.295 265.51 305.295 265.51L308.886 241.59Z" fill="#181818"/>\n</g>\n<path d="M351.51 161.298C351.51 161.298 351.368 157.504 351.398 166.111C351.51 198.217 350.44 399.612 350.44 399.612L320.766 399.363L302.791 159.994L351.51 161.299V161.298Z" fill="#181818"/>\n<path d="M266.086 102.884C266.698 110.074 269.675 154.935 270.263 163.791H351.354C351.812 155.803 353.869 120.874 355.606 105.252C357.265 90.3462 360.518 82.8834 358.133 78.4766C354.237 71.2743 343.588 67.1123 336.327 66.1291C331.894 65.5288 325.226 65.0984 325.226 65.0984C325.226 65.0984 324.661 76.522 311.197 77.1573C292.87 78.0219 294.094 65.0984 294.003 65.0984C291.034 65.0984 274.073 66.978 269.923 69.4379C258.616 76.1348 264.787 87.6452 266.086 102.883V102.884Z" fill="#A6DDFD"/>\n<path d="M248.286 157.671C246.003 157.671 243.691 157.102 241.559 155.904C234.939 152.181 232.589 143.796 236.312 137.175L269.089 78.868C272.811 72.2472 281.195 69.8973 287.815 73.6198C294.436 77.3423 296.785 85.7273 293.062 92.3481L260.285 150.655C257.761 155.145 253.093 157.671 248.286 157.671Z" fill="#A6DDFD"/>\n<path d="M308.161 109.838L299.679 99.9092C298.914 99.0139 297.549 98.9335 296.684 99.7549C295.872 100.525 295.887 101.832 296.614 102.682L298.426 104.804L307.493 111.692L308.161 109.838Z" fill="#FF9E85"/>\n<path d="M294.856 112.455L268.077 114.124C265.85 114.262 263.879 112.696 263.51 110.496L256.896 70.9717C256.469 68.4234 258.342 66.066 260.92 65.9052L287.7 64.2366C289.926 64.0979 291.898 65.6642 292.266 67.8647L298.881 107.389C299.308 109.937 297.435 112.294 294.856 112.455Z" fill="#2E343F"/>\n<path d="M298.426 104.804L289.634 100.735C288.665 100.265 287.175 100.309 286.719 101.432C286.292 102.315 286.553 103.349 287.286 103.938C287.28 103.948 287.271 103.956 287.267 103.966C287.263 103.974 287.264 103.982 287.261 103.99L285.766 103.266C284.618 102.71 283.211 103.312 282.864 104.61C282.605 105.576 283.135 106.583 284.034 107.019L284.671 107.327C284.671 107.35 284.673 107.373 284.682 107.394C283.731 107.178 282.72 107.658 282.321 108.607C281.887 109.639 282.424 110.829 283.431 111.317L284.995 112.074C284.937 112.085 284.883 112.12 284.855 112.178C284.838 112.215 284.837 112.253 284.843 112.289C283.989 112.332 283.19 112.896 282.941 113.83C282.682 114.795 283.213 115.803 284.112 116.238L297.446 122.694C301.261 124.542 305.817 123.889 308.961 121.044L313.908 116.566L298.426 104.804Z" fill="#FF9E85"/>\n<g opacity="0.2">\n<path d="M295.968 108.011C295.922 108.104 295.811 108.143 295.717 108.1L287.36 104.219C287.265 104.175 287.223 104.062 287.267 103.966C287.302 103.873 287.425 103.829 287.521 103.873L295.878 107.753C295.973 107.798 296.015 107.911 295.971 108.007L295.968 108.011Z" fill="#0C0C0C"/>\n</g>\n<g opacity="0.2">\n<path d="M294.358 111.744C294.312 111.837 294.2 111.876 294.106 111.833L284.781 107.502C284.686 107.458 284.644 107.344 284.689 107.248C284.729 107.161 284.847 107.111 284.942 107.156L294.267 111.486C294.362 111.531 294.404 111.644 294.36 111.74L294.358 111.744V111.744Z" fill="#0C0C0C"/>\n</g>\n<g opacity="0.2">\n<path d="M292.639 115.797C292.593 115.89 292.481 115.929 292.388 115.886L284.948 112.431C284.853 112.387 284.811 112.274 284.855 112.178C284.902 112.082 285.013 112.041 285.109 112.085L292.548 115.539C292.644 115.583 292.685 115.697 292.641 115.793L292.639 115.797V115.797Z" fill="#0C0C0C"/>\n</g>\n<path d="M297.886 126.523L355.727 154.898C356.869 155.424 358.056 155.789 359.26 155.998C363.323 156.703 367.566 155.624 370.832 152.914C375.066 149.401 376.909 143.769 375.57 138.433L360.125 82.898C358.204 75.239 350.437 70.5872 342.78 72.5089C335.122 74.43 331.011 82.1964 332.932 89.8549L345.049 119.882L307.986 104.341L297.885 126.523H297.886Z" fill="#A6DDFD"/>\n<path d="M351.921 153.341C351.904 153.338 351.886 153.333 351.87 153.325L297.803 126.695C297.71 126.65 297.67 126.539 297.712 126.445L307.813 104.262C307.856 104.168 307.966 104.124 308.061 104.165L344.219 119.013L337.063 97.4577C337.034 97.3563 337.093 97.2512 337.195 97.222C337.297 97.1934 337.401 97.2528 337.43 97.3536L344.694 119.291C344.714 119.362 344.692 119.437 344.637 119.486C344.582 119.534 344.504 119.547 344.436 119.519L308.084 104.589L298.136 126.433L352.036 152.982C352.131 153.027 352.171 153.142 352.125 153.237C352.087 153.315 352.002 153.355 351.921 153.341V153.341Z" fill="#181818"/>\n<path d="M350.996 122.443C350.98 122.441 350.965 122.436 350.951 122.429L344.433 119.517C344.337 119.474 344.294 119.361 344.337 119.265C344.38 119.168 344.492 119.124 344.589 119.169L351.106 122.082C351.202 122.124 351.245 122.237 351.202 122.333C351.166 122.415 351.08 122.458 350.996 122.443Z" fill="#0C0C0C"/>\n<path d="M277.323 83.5339C276.707 82.7739 275.735 82.5879 274.933 82.9104C274.923 82.8748 274.913 82.8376 274.883 82.8117C274.828 82.7669 274.763 82.7675 274.702 82.788L275.826 81.4288C276.521 80.5891 276.533 79.326 275.757 78.5612C274.999 77.8142 273.845 77.7819 273.052 78.3881C273.05 78.3676 273.032 78.3525 273.024 78.3336L273.485 77.777C274.117 77.0122 274.186 75.8861 273.561 75.1154C272.707 74.0626 271.166 74.0966 270.35 75.0836L269.287 76.3677C269.281 76.3613 269.283 76.351 269.276 76.3451C269.268 76.337 269.254 76.3402 269.245 76.3343C269.671 75.4919 269.479 74.4391 268.721 73.8118C267.841 72.9802 266.468 73.5594 265.781 74.3895L259.289 82.0938L259.476 81.7454L260.245 79.0531C260.545 78.0052 260.049 76.8434 259.032 76.454C257.884 76.0156 256.632 76.6584 256.302 77.8142L252.714 90.3699L251.843 93.4188C250.974 96.459 252.682 99.6389 255.696 100.594L256.644 100.894C260.686 102.175 265.1 100.875 267.803 97.6083L277.247 86.1928C277.88 85.428 277.949 84.3024 277.324 83.5312L277.323 83.5339Z" fill="#FF9E85"/>\n<g opacity="0.2">\n<path d="M263.044 83.642C263.125 83.7072 263.242 83.697 263.31 83.6182L269.297 76.615C269.366 76.5352 269.356 76.4149 269.276 76.3464C269.206 76.2763 269.076 76.2876 269.008 76.3674L263.02 83.3707C262.952 83.4505 262.961 83.5708 263.041 83.6393L263.044 83.642Z" fill="#0C0C0C"/>\n</g>\n<g opacity="0.2">\n<path d="M266.06 86.3677C266.14 86.4329 266.258 86.4227 266.325 86.3439L273.008 78.5285C273.076 78.4486 273.066 78.3284 272.987 78.2599C272.913 78.1978 272.786 78.2011 272.718 78.2809L266.036 86.0964C265.967 86.1762 265.977 86.2965 266.057 86.365L266.06 86.3677Z" fill="#0C0C0C"/>\n</g>\n<g opacity="0.2">\n<path d="M269.309 89.3388C269.389 89.4041 269.507 89.3938 269.574 89.3151L274.904 83.0809C274.973 83.0011 274.963 82.8808 274.883 82.8123C274.801 82.7449 274.683 82.7536 274.615 82.8334L269.285 89.0675C269.216 89.1474 269.226 89.2676 269.306 89.3361L269.309 89.3388Z" fill="#0C0C0C"/>\n</g>\n<path d="M273.053 97.2144L262.411 145.077C261.276 152.1 255.206 157.095 248.316 157.095C247.558 157.095 246.79 157.035 246.017 156.91C238.223 155.651 232.926 148.31 234.185 140.515L248.797 89.3811" fill="#A6DDFD"/>\n<path d="M263.239 136.457C263.216 136.457 263.192 136.454 263.168 136.447C263.024 136.408 262.94 136.26 262.979 136.116L268.979 114.07C269.018 113.927 269.166 113.84 269.31 113.881C269.454 113.92 269.538 114.068 269.5 114.212L263.499 136.258C263.466 136.378 263.358 136.457 263.239 136.457Z" fill="#181818"/>\n<path d="M0.447449 416H447.552C447.8 416 448 415.776 448 415.5C448 415.224 447.8 415 447.552 415H0.44812C0.200439 415 -3.05176e-05 415.224 -3.05176e-05 415.5C-3.05176e-05 415.776 0.200439 416 0.44812 416H0.447449Z" fill="#2E343F"/>\n<defs>\n<filter id="filter0_d_3558_1208" x="91" y="45" width="176" height="182" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-6" dy="6"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.180392 0 0 0 0 0.203922 0 0 0 0 0.247059 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_3558_1208"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_3558_1208" result="shape"/>\n</filter>\n<clipPath id="clip0_3558_1208">\n<rect width="6" height="6" fill="white" transform="translate(238 91)"/>\n</clipPath>\n<clipPath id="clip1_3558_1208">\n<rect width="6" height="6" fill="white" transform="translate(238 131)"/>\n</clipPath>\n<clipPath id="clip2_3558_1208">\n<rect width="6" height="6" fill="white" transform="translate(238 171)"/>\n</clipPath>\n<clipPath id="clip3_3558_1208">\n<rect width="24" height="24" fill="white" transform="translate(84 38)"/>\n</clipPath>\n<clipPath id="clip4_3558_1208">\n<rect width="20" height="20" fill="white" transform="translate(86 40)"/>\n</clipPath>\n</defs>\n</svg>\n',
2142
2200
  "dir": "svgs"
2143
2201
  },
2144
- {
2145
- "name": "emptyData4.svg",
2146
- "content": '<svg width="224" height="240" viewBox="0 0 224 240" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path opacity="0.1" d="M112 240C173.856 240 224 189.856 224 128C224 66.1441 173.856 16 112 16C50.1441 16 0 66.1441 0 128C0 189.856 50.1441 240 112 240Z" fill="#0676D7"/>\n<path d="M182.206 5.75369C176.613 3.38081 163.901 1.6859 157.799 13.8893C151.698 26.0927 165.746 31.525 167.271 24.9148C170.49 10.966 131.359 10.8384 137.969 46.9401" stroke="#39404D" stroke-width="0.508475"/>\n<path d="M42.6948 28.1263C48.2881 25.7534 60.9999 24.0585 67.1016 36.2618C73.2033 48.4652 59.1551 53.8976 57.6296 47.2874C54.4106 33.3385 93.5423 33.211 86.9321 69.3127" stroke="#39404D" stroke-width="0.508475"/>\n<path d="M39.5297 36.3746C38.9092 36.7508 38.1843 36.9045 37.4548 36.8082C36.6124 36.6966 35.8645 36.2659 35.3497 35.5941C34.8348 34.9223 34.6138 34.0907 34.728 33.2521C34.8428 32.4139 35.2781 31.6688 35.955 31.1542C37.3499 30.0952 39.3541 30.3565 40.4167 31.743C41.48 33.1298 41.2081 35.1214 39.8109 36.183C39.72 36.2519 39.6262 36.3158 39.5297 36.3746ZM36.7181 31.7604C36.6507 31.8011 36.5853 31.8455 36.5215 31.8944C36.0439 32.2575 35.7363 32.7831 35.6556 33.3748C35.575 33.9669 35.7308 34.5537 36.094 35.0278C36.4576 35.5019 36.9856 35.806 37.5802 35.8845C38.1748 35.9629 38.765 35.8068 39.243 35.4432C40.2292 34.6941 40.4213 33.2882 39.671 32.3092C38.9688 31.3941 37.6871 31.1722 36.7175 31.7601L36.7181 31.7604Z" fill="#39404D"/>\n<path d="M37.6851 29.3114C37.0643 29.6881 36.3393 29.8414 35.6098 29.7451C34.767 29.6341 34.019 29.2029 33.5046 28.531C32.9893 27.8593 32.7685 27.0281 32.8831 26.1895C32.9977 25.3508 33.433 24.6057 34.1104 24.091C34.7864 23.5786 35.6243 23.355 36.4666 23.4662C37.3094 23.5772 38.0574 24.0084 38.5718 24.6803C39.087 25.3516 39.308 26.1832 39.1933 27.0218C39.0791 27.8604 38.6434 28.6056 37.966 29.1203C37.875 29.1892 37.7813 29.2531 37.6851 29.3114ZM34.8751 24.6958C34.8069 24.7372 34.7411 24.7817 34.6768 24.8307C34.1991 25.1938 33.8916 25.7194 33.8105 26.3112C33.7302 26.9027 33.8856 27.4902 34.2492 27.9642C34.6128 28.4382 35.1405 28.7429 35.7355 28.8208C36.3301 28.8993 36.9177 28.7443 37.3989 28.3798C37.8766 28.0168 38.1841 27.4911 38.2653 26.8993C38.3455 26.3078 38.1901 25.7204 37.8265 25.2464C37.4629 24.7724 36.9352 24.4676 36.3402 24.3897C35.8253 24.3218 35.3137 24.43 34.8755 24.6957L34.8751 24.6958Z" fill="#39404D"/>\n<path d="M37.6288 32.7245C39.8553 32.1445 41.3482 30.4763 40.9632 28.9984C40.5783 27.5205 38.4612 26.7926 36.2347 27.3725C34.0082 27.9525 32.5153 29.6207 32.9003 31.0986C33.2852 32.5765 35.4022 33.3044 37.6288 32.7245Z" fill="#39404D"/>\n<path d="M39.4662 32.4583C38.9549 32.7686 38.3738 33.0133 37.7518 33.1757C35.2375 33.8331 32.9088 32.9745 32.4508 31.2217C31.9927 29.4684 33.6033 27.5814 36.1171 26.9237C37.2825 26.6192 38.4639 26.6363 39.4437 26.9724C40.4894 27.3308 41.1904 28.0075 41.418 28.8773C41.6455 29.7472 41.3652 30.6805 40.6287 31.505C40.307 31.865 39.9129 32.1865 39.466 32.4574L39.4662 32.4583ZM34.9029 28.4332C33.7858 29.111 33.1293 30.111 33.3573 30.9846C33.6724 32.1905 35.5765 32.7815 37.5157 32.2749C38.5043 32.0165 39.3617 31.5237 39.9291 30.888C40.4505 30.3043 40.6573 29.6745 40.5112 29.1154C40.365 28.5559 39.8765 28.1082 39.136 27.8541C38.329 27.5774 37.3406 27.5673 36.3529 27.8255C35.8184 27.9648 35.3273 28.1759 34.903 28.4337L34.9029 28.4332Z" fill="#39404D"/>\n<path d="M38.5976 32.3773L37.147 27.1984L35.8311 27.4848L37.1251 32.8263L38.5976 32.3773Z" fill="#39404D"/>\n<path d="M31.882 32.5804C32.1119 32.5206 32.2499 32.2867 32.1904 32.058C32.1308 31.8294 31.8962 31.6926 31.6663 31.7524C31.4365 31.8123 31.2984 32.0462 31.358 32.2748C31.4175 32.5035 31.6521 32.6403 31.882 32.5804Z" fill="#39404D"/>\n<path d="M31.6271 30.2735C31.857 30.2137 31.995 29.9798 31.9355 29.7511C31.8759 29.5225 31.6413 29.3857 31.4114 29.4455C31.1816 29.5054 31.0435 29.7393 31.1031 29.968C31.1626 30.1966 31.3973 30.3334 31.6271 30.2735Z" fill="#39404D"/>\n<path d="M189.641 6.65107C189.007 6.65107 188.385 6.47088 187.839 6.12167C187.087 5.64116 186.568 4.89897 186.379 4.03107C185.988 2.23987 187.135 0.465419 188.938 0.0761681C190.742 -0.313083 192.526 0.828133 192.918 2.61934C193.309 4.41101 192.161 6.18499 190.358 6.57424C190.12 6.62593 189.879 6.65107 189.641 6.65107ZM189.648 0.93103C189.48 0.93103 189.308 0.949194 189.137 0.985977C187.839 1.26628 187.013 2.54344 187.295 3.83319C187.431 4.45804 187.804 4.99256 188.345 5.33851C188.886 5.68446 189.531 5.80086 190.159 5.66443C191.457 5.38414 192.283 4.10697 192.002 2.81723C191.757 1.6979 190.757 0.93103 189.648 0.93103Z" fill="#39404D"/>\n<path d="M188.232 14.2527C187.598 14.2527 186.975 14.0725 186.429 13.7233C185.677 13.2428 185.159 12.5006 184.969 11.6327C184.78 10.7648 184.941 9.87546 185.425 9.12862C185.908 8.38178 186.655 7.86681 187.529 7.67824C188.401 7.4892 189.296 7.6503 190.048 8.13081C190.8 8.61132 191.318 9.35351 191.508 10.2214C191.697 11.0893 191.536 11.9786 191.052 12.7255C190.569 13.4723 189.822 13.9873 188.948 14.1758C188.71 14.2275 188.47 14.2527 188.232 14.2527ZM188.244 8.53263C188.072 8.53263 187.899 8.55079 187.727 8.58804C187.098 8.724 186.561 9.09463 186.213 9.63241C185.865 10.1702 185.748 10.8104 185.885 11.4353C186.022 12.0601 186.395 12.5946 186.936 12.9406C187.477 13.287 188.121 13.4025 188.75 13.2665C189.378 13.1305 189.916 12.7599 190.264 12.2221C190.612 11.6844 190.728 11.0441 190.591 10.4193C190.455 9.79444 190.082 9.25992 189.541 8.91397C189.148 8.66254 188.7 8.5331 188.243 8.5331L188.244 8.53263Z" fill="#39404D"/>\n<path d="M193.262 8.00794C193.557 6.41757 191.854 4.77214 189.458 4.33276C187.062 3.89337 184.881 4.82643 184.585 6.4168C184.29 8.00717 185.993 9.65258 188.389 10.092C190.785 10.5313 192.967 9.59831 193.262 8.00794Z" fill="#39404D"/>\n<path d="M189.571 10.6816C189.157 10.6816 188.732 10.643 188.306 10.5652C187.057 10.3361 185.937 9.79277 185.154 9.03522C184.319 8.22924 183.954 7.27474 184.127 6.34771C184.299 5.42067 184.983 4.65847 186.051 4.20124C187.055 3.77148 188.296 3.6616 189.545 3.89021C190.795 4.11929 191.914 4.66266 192.698 5.42021C193.532 6.22619 193.897 7.18068 193.725 8.10772C193.553 9.03475 192.869 9.79695 191.8 10.2542C191.138 10.5373 190.373 10.6816 189.571 10.6816ZM188.277 4.7041C187.603 4.7041 186.967 4.8233 186.421 5.05657C185.65 5.38669 185.162 5.90538 185.048 6.51673C184.935 7.12807 185.204 7.78551 185.806 8.36753C186.459 8.99796 187.407 9.4538 188.476 9.64936C189.544 9.84445 190.594 9.75598 191.43 9.39886C192.201 9.06874 192.689 8.55005 192.803 7.9387C192.916 7.32736 192.647 6.66991 192.045 6.08743C191.392 5.457 190.444 5.00163 189.375 4.8056C189.004 4.73762 188.636 4.7041 188.277 4.7041Z" fill="#39404D"/>\n<path d="M188.383 4.22144L187.441 9.8395L188.832 10.1543L189.997 4.45098L188.383 4.22144Z" fill="#39404D"/>\n<path d="M194.035 10.2812C194.286 10.2812 194.49 10.0784 194.49 9.82822C194.49 9.57805 194.286 9.37524 194.035 9.37524C193.783 9.37524 193.579 9.57805 193.579 9.82822C193.579 10.0784 193.783 10.2812 194.035 10.2812Z" fill="#39404D"/>\n<path d="M194.824 7.95503C195.076 7.95503 195.28 7.75223 195.28 7.50205C195.28 7.25188 195.076 7.04907 194.824 7.04907C194.573 7.04907 194.369 7.25188 194.369 7.50205C194.369 7.75223 194.573 7.95503 194.824 7.95503Z" fill="#39404D"/>\n<path d="M193.749 64.8145V191.361C193.749 194.368 191.309 196.805 188.299 196.805H28.1453C25.135 196.805 22.6949 194.368 22.6949 191.361V89.52C22.6949 86.513 25.135 84.0755 28.1453 84.0755H124.208C127.219 84.0755 129.659 81.6381 129.659 78.6311V64.8145C129.659 61.8076 132.099 59.3701 135.109 59.3701H188.299C191.309 59.3701 193.749 61.8076 193.749 64.8145Z" fill="#0676D7"/>\n<path d="M188.298 197.144H28.1455C24.9531 197.144 22.356 194.55 22.356 191.361V89.5204C22.356 86.3315 24.9531 83.7372 28.1455 83.7372H124.208C127.027 83.7372 129.32 81.4468 129.32 78.6315V64.815C129.32 61.626 131.917 59.0317 135.109 59.0317H188.298C191.491 59.0317 194.088 61.626 194.088 64.815V191.361C194.088 194.55 191.491 197.144 188.298 197.144H188.298ZM28.1455 84.4151C25.3269 84.4151 23.0343 86.7055 23.0343 89.5207V191.362C23.0343 194.177 25.3272 196.467 28.1455 196.467H188.298C191.117 196.467 193.41 194.177 193.41 191.362V64.815C193.41 61.9998 191.117 59.7094 188.298 59.7094H135.109C132.291 59.7094 129.998 61.9998 129.998 64.815V78.6315C129.998 81.8205 127.401 84.4148 124.209 84.4148H28.1455V84.4151Z" fill="#39404D"/>\n<path d="M203.857 64.4271V190.973C203.857 193.98 201.417 196.418 198.407 196.418H38.2537C35.2434 196.418 32.8033 193.98 32.8033 190.973V89.1325C32.8033 86.1255 35.2434 83.6881 38.2537 83.6881H134.317C137.327 83.6881 139.767 81.2506 139.767 78.2437V64.4271C139.767 61.4201 142.207 58.9827 145.217 58.9827H198.407C201.417 58.9827 203.857 61.4201 203.857 64.4271Z" fill="white"/>\n<path d="M198.474 197.144H38.321C35.1286 197.144 32.5315 194.55 32.5315 191.361V89.5201C32.5315 86.3312 35.1286 83.7369 38.321 83.7369H134.384C137.203 83.7369 139.495 81.4465 139.495 78.6313V64.8147C139.495 61.6258 142.092 59.0315 145.284 59.0315H198.474C201.666 59.0315 204.263 61.6258 204.263 64.8147V191.361C204.263 194.55 201.666 197.144 198.474 197.144H198.474ZM38.321 84.4149C35.5024 84.4149 33.2099 86.7053 33.2099 89.5205V191.361C33.2099 194.177 35.5028 196.467 38.321 196.467H198.474C201.293 196.467 203.585 194.177 203.585 191.361V64.8147C203.585 61.9995 201.292 59.7091 198.474 59.7091H145.285C142.466 59.7091 140.174 61.9995 140.174 64.8147V78.6313C140.174 81.8202 137.577 84.4145 134.384 84.4145H38.321V84.4149Z" fill="#39404D"/>\n</svg>\n',
2147
- "dir": "svgs"
2148
- },
2149
- {
2150
- "name": "emptyData3.svg",
2151
- "content": '<svg width="300" height="189" viewBox="0 0 300 189" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M200.565 109.899C202.18 109.899 203.488 108.591 203.488 106.976C203.488 105.362 202.18 104.053 200.565 104.053C198.951 104.053 197.642 105.362 197.642 106.976C197.642 108.591 198.951 109.899 200.565 109.899Z" fill="#6AC8FB"/>\n<path opacity="0.05" d="M62.6527 74.4078C45.2181 53.8623 48.4412 14.6262 70.8027 2.87581C89.9368 -7.18807 106.927 12.0413 124.516 16.5331C161.013 25.8475 252.773 -18.6019 248.345 37.4815C242.525 111.203 110.437 130.718 62.6527 74.4078Z" fill="#0676D7"/>\n<path opacity="0.1" d="M156.138 188.92C193.588 188.92 223.948 185.779 223.948 181.905C223.948 178.031 193.588 174.89 156.138 174.89C118.687 174.89 88.3279 178.031 88.3279 181.905C88.3279 185.779 118.687 188.92 156.138 188.92Z" fill="#0676D7"/>\n<path d="M179.523 97.5654H166.663V180.567C166.663 187.582 179.523 187.582 179.523 180.567V97.5654Z" fill="#A6DDFD"/>\n<path d="M166.8 97.5654H179.386V110.151L166.8 105.522V97.5654Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M166.8 97.5654H179.386V110.151L166.8 105.522V97.5654Z" fill="#CDEBFE"/>\n<path d="M153.215 56.7033C153.289 52.7185 152.553 48.8518 151.074 45.1489C149.594 41.446 147.389 38.0739 144.586 35.2299C141.784 32.3858 138.441 30.1267 134.752 28.5845C131.064 27.0423 127.103 26.248 123.103 26.248C119.103 26.248 115.143 27.0423 111.454 28.5845C107.765 30.1267 104.422 32.3858 101.62 35.2299C98.8175 38.0739 96.6122 41.446 95.1326 45.1489C93.6531 48.8518 92.9291 52.8113 93.003 56.7961V97.5656L153.215 97.6232V56.7033Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M153.215 56.7033C153.289 52.7185 152.553 48.8518 151.074 45.1489C149.594 41.446 147.389 38.0739 144.586 35.2299C141.784 32.3858 138.441 30.1267 134.752 28.5845C131.064 27.0423 127.103 26.248 123.103 26.248C119.103 26.248 115.143 27.0423 111.454 28.5845C107.765 30.1267 104.422 32.3858 101.62 35.2299C98.8175 38.0739 96.6122 41.446 95.1326 45.1489C93.6531 48.8518 92.9291 52.8113 93.003 56.7961V97.5656L153.215 97.6232V56.7033Z" fill="#2E343F"/>\n<path d="M89.0343 115.13C85.0101 131.761 95.1939 145.24 111.866 145.24C128.538 145.24 145.24 131.761 149.264 115.13L153.453 97.8119C153.511 97.5785 153.515 97.3351 153.464 97.1001C153.414 96.865 153.31 96.6446 153.162 96.4556C153.013 96.2665 152.824 96.1138 152.607 96.0091C152.391 95.9043 152.154 95.8503 151.913 95.8511H94.9475C94.5911 95.8528 94.2456 95.9742 93.9664 96.1957C93.6872 96.4172 93.4904 96.7261 93.4076 97.0727L89.0343 115.13Z" fill="#A6DDFD"/>\n<path opacity="0.4" d="M89.0343 115.13C85.0101 131.761 95.1939 145.24 111.866 145.24C128.538 145.24 145.24 131.761 149.264 115.13L153.453 97.8119C153.511 97.5785 153.515 97.3351 153.464 97.1001C153.414 96.865 153.31 96.6446 153.162 96.4556C153.013 96.2665 152.824 96.1138 152.607 96.0091C152.391 95.9043 152.154 95.8503 151.913 95.8511H94.9475C94.5911 95.8528 94.2456 95.9742 93.9664 96.1957C93.6872 96.4172 93.4904 96.7261 93.4076 97.0727L89.0343 115.13Z" fill="white"/>\n<path d="M86.6114 115.13C82.5872 131.761 92.771 145.24 109.443 145.24C126.115 145.24 142.817 131.761 146.842 115.13L151.071 97.8119C151.129 97.5785 151.133 97.3351 151.082 97.1001C151.032 96.865 150.928 96.6446 150.78 96.4556C150.631 96.2665 150.442 96.1138 150.225 96.0091C150.009 95.9043 149.772 95.8503 149.531 95.8511H92.5554C92.199 95.8528 91.8535 95.9742 91.5743 96.1957C91.295 96.4172 91.0983 96.7261 91.0155 97.0727L86.6114 115.13Z" fill="#A6DDFD"/>\n<path d="M224.095 56.5949V97.6937L153.215 97.6232V56.7033C153.212 48.6896 149.985 40.8966 144.332 35.2301C138.678 29.5635 130.813 26.3084 122.818 26.3057L193.996 26.3762C201.991 26.3789 209.659 29.5635 215.312 35.2301C220.966 40.8966 224.143 48.5813 224.146 56.5949H224.095Z" fill="#A6DDFD"/>\n<path d="M224.094 56.6146V67.5684H153.26V56.6146C153.273 49.9185 151.039 43.4115 146.915 38.136H217.801C221.907 43.4182 224.123 49.9246 224.094 56.6146Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M224.094 56.6146V67.5684H153.26L153.215 56.7032C153.229 50.0071 151.039 43.4115 146.915 38.136H217.801C221.907 43.4182 224.123 49.9246 224.094 56.6146Z" fill="#CDEBFE"/>\n<path d="M163.084 72.8451V12.2762C163.083 11.7362 163.199 11.2024 163.425 10.712C163.651 10.2215 163.982 9.78628 164.393 9.43646C164.804 9.08665 165.287 8.83069 165.807 8.6864C166.328 8.5421 166.873 8.51295 167.406 8.60096L181.922 11.0032C182.442 11.0886 182.915 11.3567 183.256 11.7593C183.596 12.162 183.782 12.6728 183.78 13.2001V16.9574C183.78 17.5482 183.545 18.1149 183.128 18.5326C182.71 18.9504 182.143 19.1851 181.552 19.1851H167.704V72.8246C167.704 73.4372 167.46 74.0247 167.027 74.4579C166.594 74.8911 166.006 75.1344 165.394 75.1344C164.785 75.1344 164.2 74.8939 163.768 74.4652C163.335 74.0364 163.089 73.4541 163.084 72.8451Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M163.084 72.8451V12.2762C163.083 11.7362 163.199 11.2024 163.425 10.712C163.651 10.2215 163.982 9.78628 164.393 9.43646C164.804 9.08665 165.287 8.83069 165.807 8.6864C166.328 8.5421 166.873 8.51295 167.406 8.60096L181.922 11.0032C182.442 11.0886 182.915 11.3567 183.256 11.7593C183.596 12.162 183.782 12.6728 183.78 13.2001V16.9574C183.78 17.5482 183.545 18.1149 183.128 18.5326C182.71 18.9504 182.143 19.1851 181.552 19.1851H167.704V72.8246C167.704 73.4372 167.46 74.0247 167.027 74.4579C166.594 74.8911 166.006 75.1344 165.394 75.1344C164.785 75.1344 164.2 74.8939 163.768 74.4652C163.335 74.0364 163.089 73.4541 163.084 72.8451Z" fill="#39404D"/>\n<path opacity="0.3" d="M153.181 84.4947V95.9862H94.8307L96.6989 93.3583C96.907 93.0672 96.8106 92.6611 96.4941 92.4936L94.8307 91.612L93.3196 90.8099C92.8594 90.5662 92.9152 89.891 93.4093 89.7269L94.8307 89.2531L97.083 88.5018C97.501 88.3613 97.6245 87.8283 97.3114 87.5203L94.8307 85.0768L93.9559 84.2155C93.5887 83.8551 93.8256 83.2341 94.3349 83.2053L94.8307 83.1765L98.7802 82.943C99.1288 82.9227 99.3843 82.6029 99.3285 82.256L98.6483 78.1255C98.5687 77.6398 99.0814 77.2743 99.5146 77.5095L107.209 81.7078C107.3 81.7568 107.398 81.7805 107.495 81.7805C107.649 81.7788 107.799 81.7179 107.913 81.6028L112.113 77.3437C112.411 77.0408 112.922 77.1423 113.081 77.5349L114.546 81.124C114.658 81.3947 114.93 81.5233 115.186 81.4844C115.326 81.4675 115.462 81.393 115.561 81.2644L115.732 81.0427L117.255 79.0764L119.088 76.7108C119.343 76.3825 119.853 76.413 120.066 76.7734L123.54 82.6418C123.758 83.0124 124.288 83.031 124.533 82.6774L125.53 81.2356L127.625 78.2134C127.855 77.8801 128.344 77.8716 128.584 78.1965L132.114 82.9244L132.398 83.3035C132.605 83.5793 133.001 83.6216 133.26 83.3965L140.763 76.902C141.152 76.567 141.753 76.8513 141.739 77.3657L141.673 79.7618L141.578 83.1613C141.567 83.6165 142.052 83.9143 142.453 83.696L149.839 79.6721C150.32 79.4098 150.865 79.8836 150.674 80.3963L148.621 85.9043C148.43 86.4238 148.99 86.8993 149.469 86.6235L153.148 84.5117L153.183 84.4914L153.181 84.4947Z" fill="#8F9AAD"/>\n<path d="M118.027 75.9035C118.027 77.0474 117.749 78.127 117.257 79.078L115.734 81.0443C115.561 81.2017 115.377 81.3506 115.187 81.486C114.932 81.5266 114.659 81.398 114.548 81.1255L113.082 77.5365C112.922 77.1439 112.412 77.044 112.114 77.3452L107.915 81.6044C107.801 81.7195 107.651 81.7804 107.497 81.7821C106.204 80.9851 105.195 79.7718 104.654 78.3335C105.337 78.2979 106.283 78.1321 107.175 77.885C107.429 77.814 107.679 77.7378 107.92 77.6566C107.977 77.6363 108.038 77.616 108.096 77.594C108.211 77.5517 108.324 77.5094 108.434 77.4654C108.542 77.4214 108.647 77.374 108.745 77.33C109.19 77.1219 109.529 76.8968 109.678 76.6684C110.409 75.5448 109.358 74.5921 109.358 74.5921C109.28 74.5413 109.202 74.4923 109.124 74.4483C109.047 74.4043 108.97 74.3637 108.893 74.3264C108.855 74.3095 108.816 74.2909 108.779 74.274C108.703 74.2401 108.63 74.2097 108.558 74.1826C107.749 73.8865 107.023 73.9897 106.395 74.3044C106.312 74.3467 106.231 74.3907 106.153 74.4398C106.033 74.5126 105.919 74.5938 105.809 74.6801C105.733 74.7376 105.662 74.7985 105.591 74.8595C105.028 75.3587 104.576 76.0051 104.253 76.5956C104.231 76.3689 104.217 76.1387 104.217 75.9052C104.217 72.0911 107.31 68.9995 111.125 68.9995C114.939 68.9995 118.032 72.0911 118.032 75.9052L118.027 75.9035Z" fill="#39404D"/>\n<path d="M106.514 73.152C106.092 73.152 105.75 72.8102 105.75 72.3889C105.75 71.9675 106.092 71.624 106.514 71.624C106.935 71.624 107.278 71.9675 107.278 72.3889C107.278 72.8102 106.935 73.152 106.514 73.152ZM112.94 74.0066C112.362 74.0066 111.895 73.5379 111.895 72.9591C111.895 72.3804 112.362 71.9117 112.94 71.9117C113.519 71.9117 113.988 72.3804 113.988 72.9591C113.988 73.5379 113.519 74.0066 112.94 74.0066Z" fill="#8F9AAD"/>\n<path d="M109.673 76.6684C109.524 76.8968 109.184 77.1219 108.74 77.33C108.642 77.374 108.539 77.4214 108.429 77.4654C108.321 77.5094 108.207 77.5517 108.091 77.594C108.033 77.616 107.972 77.6363 107.915 77.6566C107.674 77.7395 107.424 77.8157 107.17 77.8851C106.28 78.1321 105.334 78.2979 104.649 78.3335C104.046 78.3639 103.647 78.2962 103.661 78.0847C103.674 77.8597 103.876 77.2657 104.244 76.5973C104.569 76.0051 105.019 75.3587 105.583 74.8578C105.654 74.7952 105.725 74.7359 105.801 74.6784C105.913 74.5921 106.026 74.5126 106.145 74.4381C106.223 74.3891 106.304 74.3451 106.387 74.3028C107.014 73.988 107.742 73.8848 108.549 74.1809C108.622 74.2097 108.696 74.2384 108.771 74.2723C108.808 74.2909 108.847 74.3078 108.884 74.3247C108.962 74.362 109.038 74.4026 109.116 74.4466C109.194 74.4906 109.272 74.5397 109.35 74.5904C109.35 74.5904 110.4 75.5431 109.669 76.6667L109.673 76.6684Z" fill="#8F9AAD"/>\n<path d="M153.182 82.9667V84.0514C153.173 84.2071 153.161 84.3627 153.146 84.515L149.467 86.6268C148.988 86.9027 148.428 86.4272 148.619 85.9077L150.672 80.3997C150.863 79.887 150.317 79.4132 149.838 79.6754L142.452 83.6994C142.049 83.9177 141.565 83.6199 141.577 83.1647L141.671 79.7651L141.737 77.369C141.751 76.8546 141.149 76.5703 140.761 76.9054L133.258 83.3999C132.997 83.6249 132.603 83.5826 132.397 83.3068L132.112 82.9278C132.417 77.3707 137.016 72.9626 142.646 72.9626C142.981 72.9626 143.315 72.9779 143.643 73.01C148.824 73.494 152.918 77.7278 153.182 82.9718V82.9667Z" fill="#2E343F"/>\n<path d="M143.643 73.0066C143.314 72.9762 142.981 72.9593 142.646 72.9593C137.016 72.9593 132.417 77.3673 132.112 82.9244L128.583 78.1965C128.342 77.8716 127.853 77.8818 127.623 78.2134L125.528 81.2356C124.405 80.1476 123.518 78.8124 122.956 77.3183C125.378 77.1947 129.907 75.9967 130.726 74.7394C131.859 72.9999 130.234 71.526 130.234 71.526C126.481 69.0504 123.682 72.1606 122.33 74.6294C122.294 74.2792 122.278 73.9204 122.278 73.5583C122.278 67.6543 127.063 62.8706 132.967 62.8706C138.871 62.8706 143.355 67.3599 143.643 73.005V73.0066Z" fill="#39404D"/>\n<path d="M125.839 69.2975C125.186 69.2975 124.658 68.7696 124.658 68.1164C124.658 67.4632 125.186 66.9319 125.839 66.9319C126.493 66.9319 127.024 67.4632 127.024 68.1164C127.024 68.7696 126.493 69.2975 125.839 69.2975ZM135.788 70.6208C134.893 70.6208 134.168 69.8949 134.168 68.9997C134.168 68.1046 134.893 67.3786 135.788 67.3786C136.683 67.3786 137.409 68.1046 137.409 68.9997C137.409 69.8949 136.683 70.6208 135.788 70.6208Z" fill="#8F9AAD"/>\n<path d="M130.728 74.7412C129.909 75.9984 125.378 77.1948 122.958 77.32C122.027 77.3691 121.408 77.2608 121.428 76.9342C121.45 76.5873 121.763 75.6668 122.332 74.6312C123.684 72.164 126.483 69.0521 130.236 71.5278C130.236 71.5278 131.862 73.0033 130.728 74.7412Z" fill="#8F9AAD"/>\n<path d="M155.44 137.833C158.141 137.833 160.331 135.643 160.331 132.942C160.331 130.24 158.141 128.051 155.44 128.051C152.738 128.051 150.549 130.24 150.549 132.942C150.549 135.643 152.738 137.833 155.44 137.833Z" fill="#6AC8FB"/>\n<path d="M159.846 147.341C160.976 147.341 161.892 146.425 161.892 145.295C161.892 144.165 160.976 143.249 159.846 143.249C158.716 143.249 157.8 144.165 157.8 145.295C157.8 146.425 158.716 147.341 159.846 147.341Z" fill="#A6DDFD"/>\n<path d="M143.84 140.244C145.492 140.244 146.832 138.904 146.832 137.252C146.832 135.599 145.492 134.259 143.84 134.259C142.187 134.259 140.847 135.599 140.847 137.252C140.847 138.904 142.187 140.244 143.84 140.244Z" fill="#A6DDFD"/>\n<path d="M154.5 19C155.881 19 157 17.8807 157 16.5C157 15.1193 155.881 14 154.5 14C153.119 14 152 15.1193 152 16.5C152 17.8807 153.119 19 154.5 19Z" fill="#6AC8FB"/>\n</svg>\n',
2152
- "dir": "svgs"
2153
- },
2154
- {
2155
- "name": "emptyData2.svg",
2156
- "content": '<svg width="300" height="142" viewBox="0 0 300 142" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path opacity="0.1" d="M149 130C216.931 130 272 119.479 272 106.5C272 93.5213 216.931 83 149 83C81.069 83 26 93.5213 26 106.5C26 119.479 81.069 130 149 130Z" fill="#0676D7"/>\n<path d="M172.044 48.6428C172.044 61.2386 161.727 71.4497 149.001 71.4497C136.276 71.4497 125.959 61.2386 125.959 48.6428H172.044Z" fill="white" stroke="#39404D" stroke-width="4.04566" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M172.041 48.6428C172.041 61.2377 161.726 71.4479 149.001 71.4479C136.276 71.4479 125.96 61.2377 125.96 48.6428" fill="white"/>\n<path d="M172.041 48.6428C172.041 61.2377 161.726 71.4479 149.001 71.4479C136.276 71.4479 125.96 61.2377 125.96 48.6428" stroke="#39404D" stroke-width="4.04566" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M251.537 48.6462V105.542C251.537 110.517 247.459 114.554 242.428 114.554H55.5719C50.5407 114.554 46.4621 110.517 46.4621 105.542V48.6462H125.957C125.957 61.242 136.274 71.4531 149 71.4531C161.726 71.4531 172.043 61.242 172.043 48.6462H251.537Z" fill="white"/>\n<path d="M242.428 115H55.5722C50.2941 115 46 110.752 46 105.53V48.6342C46 48.3811 46.2067 48.1765 46.4624 48.1765H125.958C126.213 48.1765 126.42 48.3811 126.42 48.6342C126.42 60.9576 136.549 70.9834 149 70.9834C161.451 70.9834 171.58 60.9576 171.58 48.6342C171.58 48.3811 171.787 48.1765 172.043 48.1765H251.538C251.793 48.1765 252 48.3811 252 48.6342V105.53C252 110.752 247.706 115 242.428 115ZM46.9244 49.0919V105.53C46.9244 110.247 50.8037 114.084 55.5717 114.084H242.428C247.196 114.084 251.075 110.247 251.075 105.53V49.0919H172.5C172.253 61.7101 161.806 71.8988 149 71.8988C136.193 71.8988 125.746 61.7101 125.499 49.0919H46.9244Z" fill="#39404D"/>\n<path d="M251.537 48.6541H172.042C172.042 61.2498 161.725 71.461 149 71.461C136.274 71.461 125.957 61.2498 125.957 48.6541H46.4617L104.579 12.4688H195.746L251.537 48.6541Z" fill="#0676D7"/>\n<path opacity="0.7" d="M251.537 48.6541H172.042C172.042 61.2498 161.725 71.461 149 71.461C136.274 71.461 125.957 61.2498 125.957 48.6541H46.4617L104.579 12.4688H195.746L251.537 48.6541Z" fill="white"/>\n<path d="M149.001 71.9081C136.194 71.9081 125.747 61.7193 125.5 49.1012H46.4624C46.2566 49.1012 46.0754 48.9661 46.018 48.7702C45.9611 48.5739 46.0421 48.3643 46.2164 48.2558L104.334 12.07C104.407 12.0243 104.493 12 104.58 12H195.747C195.836 12 195.925 12.0261 196 12.0751L251.791 48.2608C251.962 48.3716 252.039 48.5803 251.981 48.7744C251.922 48.9684 251.742 49.1012 251.538 49.1012H172.501C172.254 61.7193 161.807 71.9081 149 71.9081H149.001ZM48.0666 48.1858H125.958C126.214 48.1858 126.421 48.3904 126.421 48.6435C126.421 60.9669 136.55 70.9927 149.001 70.9927C161.451 70.9927 171.581 60.9669 171.581 48.6435C171.581 48.3904 171.788 48.1858 172.043 48.1858H249.989L195.609 12.9154H104.713L48.0666 48.1858Z" fill="#39404D"/>\n</svg>\n',
2157
- "dir": "svgs"
2158
- },
2159
- {
2160
- "name": "emptyData.svg",
2161
- "content": '<svg width="210" height="189" viewBox="0 0 210 189" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M155.565 109.899C157.18 109.899 158.488 108.59 158.488 106.976C158.488 105.362 157.18 104.053 155.565 104.053C153.951 104.053 152.642 105.362 152.642 106.976C152.642 108.59 153.951 109.899 155.565 109.899Z" fill="#6AC8FB"/>\n<path opacity="0.05" d="M17.6527 74.4078C0.218111 53.8623 3.44116 14.6262 25.8027 2.87581C44.9368 -7.18807 61.9265 12.0413 79.5156 16.5331C116.013 25.8475 207.773 -18.6019 203.345 37.4815C197.525 111.203 65.4365 130.718 17.6527 74.4078Z" fill="#0676D7"/>\n<path opacity="0.1" d="M111.138 188.92C148.588 188.92 178.948 185.779 178.948 181.905C178.948 178.031 148.588 174.89 111.138 174.89C73.6875 174.89 43.3279 178.031 43.3279 181.905C43.3279 185.779 73.6875 188.92 111.138 188.92Z" fill="#0676D7"/>\n<path d="M134.523 97.5654H121.663V180.567C121.663 187.582 134.523 187.582 134.523 180.567V97.5654Z" fill="#A6DDFD"/>\n<path d="M121.8 97.5654H134.386V110.151L121.8 105.522V97.5654Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M121.8 97.5654H134.386V110.151L121.8 105.522V97.5654Z" fill="#CDEBFE"/>\n<path d="M108.215 56.7033C108.289 52.7185 107.553 48.8518 106.074 45.1489C104.594 41.446 102.389 38.0739 99.5864 35.2299C96.7841 32.3858 93.4409 30.1267 89.7522 28.5845C86.0636 27.0423 82.1034 26.248 78.1031 26.248C74.1029 26.248 70.1427 27.0423 66.4541 28.5845C62.7654 30.1267 59.4222 32.3858 56.6199 35.2299C53.8175 38.0739 51.6121 41.446 50.1326 45.1489C48.6531 48.8518 47.9291 52.8113 48.0029 56.7961V97.5656L108.215 97.6232V56.7033Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M108.215 56.7033C108.289 52.7185 107.553 48.8518 106.074 45.1489C104.594 41.446 102.389 38.0739 99.5864 35.2299C96.7841 32.3858 93.4409 30.1267 89.7522 28.5845C86.0636 27.0423 82.1034 26.248 78.1031 26.248C74.1029 26.248 70.1427 27.0423 66.4541 28.5845C62.7654 30.1267 59.4222 32.3858 56.6199 35.2299C53.8175 38.0739 51.6121 41.446 50.1326 45.1489C48.6531 48.8518 47.9291 52.8113 48.0029 56.7961V97.5656L108.215 97.6232V56.7033Z" fill="#2E343F"/>\n<path d="M112.924 61.1709V91.1709H95.358C94.7132 91.1686 94.0955 90.9077 93.6396 90.4449C93.1837 89.9822 92.9265 89.3552 92.9243 88.7008V63.641C92.9287 62.9873 93.1866 62.3616 93.642 61.8993C94.0975 61.4371 94.7139 61.1754 95.358 61.1709H112.924Z" fill="#0676D7"/>\n<path opacity="0.8" d="M112.924 61.1709V91.1709H95.358C94.7132 91.1686 94.0955 90.9077 93.6396 90.4449C93.1837 89.9822 92.9265 89.3552 92.9243 88.7008V63.641C92.9287 62.9873 93.1866 62.3616 93.642 61.8993C94.0975 61.4371 94.7139 61.1754 95.358 61.1709H112.924Z" fill="white"/>\n<path d="M112.924 61.1711V77.1709C112.835 77.1114 112.749 77.0471 112.666 76.9782L93.9243 61.8245C94.3739 61.3967 94.9719 61.1623 95.591 61.1711H112.924Z" fill="#0676D7"/>\n<path opacity="0.6" d="M112.924 61.1711V77.1709C112.835 77.1114 112.749 77.0471 112.666 76.9782L93.9243 61.8245C94.3739 61.3967 94.9719 61.1623 95.591 61.1711H112.924Z" fill="white"/>\n<path d="M44.0344 115.13C40.0102 131.761 50.194 145.24 66.8658 145.24C83.5377 145.24 100.24 131.761 104.265 115.13L108.453 97.8119C108.511 97.5785 108.515 97.3351 108.464 97.1001C108.414 96.865 108.31 96.6446 108.162 96.4556C108.013 96.2665 107.824 96.1138 107.607 96.0091C107.391 95.9043 107.154 95.8503 106.913 95.8511H49.9476C49.5912 95.8528 49.2457 95.9742 48.9664 96.1957C48.6872 96.4172 48.4905 96.7261 48.4077 97.0727L44.0344 115.13Z" fill="#A6DDFD"/>\n<path opacity="0.4" d="M44.0344 115.13C40.0102 131.761 50.194 145.24 66.8658 145.24C83.5377 145.24 100.24 131.761 104.265 115.13L108.453 97.8119C108.511 97.5785 108.515 97.3351 108.464 97.1001C108.414 96.865 108.31 96.6446 108.162 96.4556C108.013 96.2665 107.824 96.1138 107.607 96.0091C107.391 95.9043 107.154 95.8503 106.913 95.8511H49.9476C49.5912 95.8528 49.2457 95.9742 48.9664 96.1957C48.6872 96.4172 48.4905 96.7261 48.4077 97.0727L44.0344 115.13Z" fill="white"/>\n<path d="M41.6114 115.13C37.5872 131.761 47.771 145.24 64.4429 145.24C81.1147 145.24 97.8174 131.761 101.842 115.13L106.071 97.8119C106.129 97.5785 106.133 97.3351 106.082 97.1001C106.032 96.865 105.928 96.6446 105.78 96.4556C105.631 96.2665 105.442 96.1138 105.225 96.0091C105.009 95.9043 104.772 95.8503 104.531 95.8511H47.5554C47.199 95.8528 46.8535 95.9742 46.5743 96.1957C46.295 96.4172 46.0983 96.7261 46.0155 97.0727L41.6114 115.13Z" fill="#A6DDFD"/>\n<path d="M179.095 56.5949V97.6937L108.215 97.6232V56.7033C108.212 48.6896 104.985 40.8966 99.3317 35.2301C93.6781 29.5635 85.813 26.3084 77.8175 26.3057L148.996 26.3762C156.991 26.3789 164.659 29.5635 170.312 35.2301C175.966 40.8966 179.143 48.5813 179.146 56.5949H179.095Z" fill="#A6DDFD"/>\n<path d="M179.094 56.6149V67.5686H108.26V56.6149C108.273 49.9188 106.039 43.4118 101.915 38.1362H172.801C176.907 43.4185 179.123 49.9248 179.094 56.6149Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M179.094 56.6149V67.5686H108.26L108.215 56.7035C108.229 50.0073 106.039 43.4118 101.915 38.1362H172.801C176.907 43.4185 179.123 49.9248 179.094 56.6149Z" fill="#CDEBFE"/>\n<path d="M118.084 72.8451V12.2762C118.083 11.7362 118.199 11.2024 118.425 10.712C118.651 10.2215 118.981 9.78628 119.393 9.43646C119.804 9.08665 120.287 8.83069 120.807 8.6864C121.328 8.5421 121.873 8.51295 122.406 8.60096L136.922 11.0032C137.442 11.0886 137.915 11.3567 138.256 11.7593C138.596 12.162 138.782 12.6728 138.78 13.2001V16.9574C138.78 17.5482 138.545 18.1149 138.128 18.5326C137.71 18.9504 137.143 19.1851 136.552 19.1851H122.704V72.8246C122.704 73.4372 122.46 74.0247 122.027 74.4579C121.594 74.8911 121.006 75.1344 120.394 75.1344C119.785 75.1344 119.2 74.8939 118.768 74.4652C118.335 74.0364 118.089 73.4541 118.084 72.8451Z" fill="#A6DDFD"/>\n<path opacity="0.7" d="M118.084 72.8451V12.2762C118.083 11.7362 118.199 11.2024 118.425 10.712C118.651 10.2215 118.981 9.78628 119.393 9.43646C119.804 9.08665 120.287 8.83069 120.807 8.6864C121.328 8.5421 121.873 8.51295 122.406 8.60096L136.922 11.0032C137.442 11.0886 137.915 11.3567 138.256 11.7593C138.596 12.162 138.782 12.6728 138.78 13.2001V16.9574C138.78 17.5482 138.545 18.1149 138.128 18.5326C137.71 18.9504 137.143 19.1851 136.552 19.1851H122.704V72.8246C122.704 73.4372 122.46 74.0247 122.027 74.4579C121.594 74.8911 121.006 75.1344 120.394 75.1344C119.785 75.1344 119.2 74.8939 118.768 74.4652C118.335 74.0364 118.089 73.4541 118.084 72.8451Z" fill="#39404D"/>\n<path d="M110.44 137.833C113.141 137.833 115.331 135.643 115.331 132.942C115.331 130.24 113.141 128.05 110.44 128.05C107.739 128.05 105.549 130.24 105.549 132.942C105.549 135.643 107.739 137.833 110.44 137.833Z" fill="#6AC8FB"/>\n<path d="M114.846 147.341C115.976 147.341 116.892 146.425 116.892 145.295C116.892 144.165 115.976 143.249 114.846 143.249C113.716 143.249 112.8 144.165 112.8 145.295C112.8 146.425 113.716 147.341 114.846 147.341Z" fill="#A6DDFD"/>\n<path d="M98.8395 140.244C100.492 140.244 101.832 138.904 101.832 137.252C101.832 135.599 100.492 134.259 98.8395 134.259C97.1869 134.259 95.8472 135.599 95.8472 137.252C95.8472 138.904 97.1869 140.244 98.8395 140.244Z" fill="#A6DDFD"/>\n<path d="M109.5 19C110.881 19 112 17.8807 112 16.5C112 15.1193 110.881 14 109.5 14C108.119 14 107 15.1193 107 16.5C107 17.8807 108.119 19 109.5 19Z" fill="#6AC8FB"/>\n</svg>\n',
2162
- "dir": "svgs"
2163
- },
2164
2202
  {
2165
2203
  "name": "datapipeline.svg",
2166
2204
  "content": '<svg width="335" height="210" viewBox="0 0 335 210" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path opacity="0.1" d="M167 209.067C225.542 209.067 273 162.265 273 104.533C273 46.8012 225.542 0 167 0C108.458 0 61 46.8012 61 104.533C61 162.265 108.458 209.067 167 209.067Z" fill="#0676D7"/>\n<g clip-path="url(#clip0_8952_12144)">\n<path d="M0 79C0 74.5817 3.58172 71 8 71H133C137.418 71 141 74.5817 141 79V129C141 133.418 137.418 137 133 137H8C3.58172 137 0 133.418 0 129V79Z" fill="white"/>\n<circle cx="24" cy="95" r="8" fill="#D9D9D9"/>\n<rect x="16" y="109" width="109" height="3" rx="1.5" fill="#D9D9D9"/>\n<rect x="16" y="118" width="83" height="3" rx="1.5" fill="#D9D9D9"/>\n</g>\n<path d="M0.5 79C0.5 74.8579 3.85786 71.5 8 71.5H133C137.142 71.5 140.5 74.8579 140.5 79V129C140.5 133.142 137.142 136.5 133 136.5H8C3.85787 136.5 0.5 133.142 0.5 129V79Z" stroke="#0676D7"/>\n<g clip-path="url(#clip1_8952_12144)">\n<path d="M232 28C232 23.5817 235.582 20 240 20H327C331.418 20 335 23.5817 335 28V56C335 60.4183 331.418 64 327 64H240C235.582 64 232 60.4183 232 56V28Z" fill="white"/>\n<rect x="248" y="36" width="71" height="3" rx="1.5" fill="#D9D9D9"/>\n<rect x="248" y="45" width="48" height="3" rx="1.5" fill="#D9D9D9"/>\n</g>\n<path d="M232.5 28C232.5 23.8579 235.858 20.5 240 20.5H327C331.142 20.5 334.5 23.8579 334.5 28V56C334.5 60.1421 331.142 63.5 327 63.5H240C235.858 63.5 232.5 60.1421 232.5 56V28Z" stroke="#0676D7"/>\n<g clip-path="url(#clip2_8952_12144)">\n<path d="M232 153C232 148.582 235.582 145 240 145H327C331.418 145 335 148.582 335 153V181C335 185.418 331.418 189 327 189H240C235.582 189 232 185.418 232 181V153Z" fill="white"/>\n<rect x="248" y="161" width="71" height="3" rx="1.5" fill="#D9D9D9"/>\n<rect x="248" y="170" width="48" height="3" rx="1.5" fill="#D9D9D9"/>\n</g>\n<path d="M232.5 153C232.5 148.858 235.858 145.5 240 145.5H327C331.142 145.5 334.5 148.858 334.5 153V181C334.5 185.142 331.142 188.5 327 188.5H240C235.858 188.5 232.5 185.142 232.5 181V153Z" stroke="#0676D7"/>\n<path d="M137 104.132C137 106.342 138.791 108.132 141 108.132C143.209 108.132 145 106.342 145 104.132C145 101.923 143.209 100.132 141 100.132C138.791 100.132 137 101.923 137 104.132ZM226 42.1322L218.539 37.7344L218.461 46.3943L226 42.1322ZM141 104.132C140.894 104.875 140.894 104.875 140.895 104.875C140.895 104.875 140.896 104.875 140.897 104.875C140.899 104.876 140.901 104.876 140.904 104.876C140.91 104.877 140.918 104.878 140.929 104.88C140.951 104.883 140.983 104.887 141.025 104.892C141.107 104.903 141.229 104.918 141.387 104.936C141.702 104.972 142.161 105.02 142.744 105.067C143.909 105.163 145.57 105.257 147.562 105.257C151.542 105.257 156.867 104.879 162.206 103.354C167.545 101.828 172.94 99.1432 177.002 94.5013C181.075 89.8469 183.75 83.2891 183.75 74.1324H182.25C182.25 82.9758 179.675 89.168 175.873 93.5135C172.06 97.8716 166.955 100.437 161.794 101.911C156.633 103.386 151.458 103.757 147.563 103.757C145.617 103.757 143.997 103.665 142.866 103.572C142.3 103.526 141.857 103.48 141.557 103.446C141.407 103.429 141.292 103.414 141.216 103.405C141.178 103.4 141.15 103.396 141.132 103.393C141.122 103.392 141.116 103.391 141.111 103.391C141.109 103.39 141.108 103.39 141.107 103.39C141.106 103.39 141.106 103.39 141.106 103.39C141.106 103.39 141.106 103.39 141 104.132ZM183.75 74.1324C183.75 60.9207 189.637 53.284 196.975 48.8402C204.366 44.3638 213.281 43.1025 219.286 42.8204L219.215 41.322C213.116 41.6086 203.905 42.8893 196.198 47.5571C188.436 52.2574 182.25 60.367 182.25 74.1324H183.75Z" fill="#ADB5C2"/>\n<path d="M226 166.265L218.885 171.203L218.166 162.572L226 166.265ZM145 104.265C145 106.474 143.209 108.265 141 108.265C138.791 108.265 137 106.474 137 104.265C137 102.055 138.791 100.265 141 100.265C143.209 100.265 145 102.055 145 104.265ZM222.332 167.322C221.918 167.342 221.567 167.022 221.548 166.608C221.528 166.195 221.848 165.843 222.262 165.824L222.332 167.322ZM214.902 165.72C215.315 165.751 215.625 166.111 215.593 166.524C215.562 166.937 215.202 167.247 214.789 167.215L214.902 165.72ZM207.31 166.124C206.906 166.034 206.651 165.633 206.741 165.229C206.832 164.825 207.233 164.57 207.637 164.66L207.31 166.124ZM200.682 162.434C201.062 162.599 201.236 163.041 201.071 163.421C200.906 163.801 200.464 163.975 200.084 163.81L200.682 162.434ZM193.509 159.948C193.183 159.693 193.125 159.221 193.38 158.895C193.636 158.569 194.107 158.511 194.433 158.766L193.509 159.948ZM189.487 153.54C189.722 153.881 189.637 154.348 189.296 154.583C188.955 154.818 188.488 154.733 188.253 154.392L189.487 153.54ZM184.892 147.531C184.764 147.137 184.979 146.714 185.373 146.586C185.767 146.458 186.19 146.673 186.319 147.067L184.892 147.531ZM184.907 139.935C184.944 140.348 184.639 140.712 184.226 140.748C183.814 140.785 183.45 140.48 183.413 140.067L184.907 139.935ZM183.081 132.499C183.043 132.086 183.346 131.721 183.758 131.683C184.171 131.644 184.536 131.948 184.574 132.36L183.081 132.499ZM183.002 124.718C183.134 125.11 182.922 125.536 182.53 125.668C182.137 125.8 181.712 125.588 181.58 125.195L183.002 124.718ZM178.267 118.57C178.03 118.23 178.114 117.763 178.453 117.526C178.793 117.289 179.261 117.372 179.497 117.712L178.267 118.57ZM174.126 112.004C174.449 112.263 174.501 112.735 174.243 113.058C173.984 113.382 173.512 113.434 173.188 113.175L174.126 112.004ZM166.836 109.272C166.461 109.096 166.299 108.65 166.475 108.275C166.65 107.9 167.097 107.738 167.472 107.913L166.836 109.272ZM160.15 105.292C160.551 105.398 160.79 105.808 160.684 106.209C160.578 106.609 160.168 106.848 159.767 106.742L160.15 105.292ZM152.356 105.341C151.945 105.291 151.652 104.917 151.702 104.506C151.751 104.095 152.125 103.802 152.536 103.852L152.356 105.341ZM144.813 103.382C145.227 103.383 145.563 103.719 145.562 104.133C145.562 104.547 145.226 104.883 144.812 104.882L144.813 103.382ZM214.789 167.215C212.455 167.038 209.91 166.704 207.31 166.124L207.637 164.66C210.154 165.222 212.627 165.547 214.902 165.72L214.789 167.215ZM200.084 163.81C197.787 162.813 195.556 161.548 193.509 159.948L194.433 158.766C196.366 160.276 198.483 161.48 200.682 162.434L200.084 163.81ZM188.253 154.392C186.883 152.407 185.739 150.133 184.892 147.531L186.319 147.067C187.121 149.533 188.201 151.676 189.487 153.54L188.253 154.392ZM183.413 140.067C183.306 138.852 183.25 137.585 183.25 136.265H184.75C184.75 137.543 184.804 138.766 184.907 139.935L183.413 140.067ZM183.25 136.265C183.25 134.954 183.192 133.7 183.081 132.499L184.574 132.36C184.69 133.609 184.75 134.91 184.75 136.265H183.25ZM181.58 125.195C180.738 122.689 179.609 120.494 178.267 118.57L179.497 117.712C180.921 119.753 182.115 122.076 183.002 124.718L181.58 125.195ZM173.188 113.175C171.219 111.6 169.068 110.316 166.836 109.272L167.472 107.913C169.795 109 172.051 110.344 174.126 112.004L173.188 113.175ZM159.767 106.742C157.199 106.063 154.678 105.622 152.356 105.341L152.536 103.852C154.914 104.14 157.505 104.593 160.15 105.292L159.767 106.742ZM144.812 104.882C143.644 104.881 142.704 104.914 142.058 104.947C141.735 104.963 141.485 104.979 141.318 104.992C141.234 104.998 141.171 105.003 141.129 105.006C141.108 105.008 141.093 105.009 141.083 105.01C141.078 105.011 141.074 105.011 141.072 105.011C141.071 105.011 141.07 105.011 141.07 105.011C141.069 105.011 141.069 105.011 141.069 105.011C141.069 105.011 141.069 105.011 141.069 105.011C141.069 105.011 141.069 105.011 141.069 105.011C141.069 105.011 141.069 105.011 141 104.265C140.931 103.518 140.931 103.518 140.931 103.518C140.931 103.518 140.931 103.518 140.931 103.518C140.931 103.518 140.931 103.518 140.931 103.518C140.932 103.518 140.932 103.518 140.932 103.518C140.933 103.517 140.935 103.517 140.937 103.517C140.94 103.517 140.945 103.516 140.951 103.516C140.963 103.515 140.981 103.513 141.005 103.511C141.051 103.507 141.12 103.502 141.209 103.496C141.387 103.483 141.647 103.465 141.982 103.448C142.651 103.415 143.617 103.381 144.813 103.382L144.812 104.882Z" fill="#0676D7"/>\n<defs>\n<clipPath id="clip0_8952_12144">\n<path d="M0 79C0 74.5817 3.58172 71 8 71H133C137.418 71 141 74.5817 141 79V129C141 133.418 137.418 137 133 137H8C3.58172 137 0 133.418 0 129V79Z" fill="white"/>\n</clipPath>\n<clipPath id="clip1_8952_12144">\n<path d="M232 28C232 23.5817 235.582 20 240 20H327C331.418 20 335 23.5817 335 28V56C335 60.4183 331.418 64 327 64H240C235.582 64 232 60.4183 232 56V28Z" fill="white"/>\n</clipPath>\n<clipPath id="clip2_8952_12144">\n<path d="M232 153C232 148.582 235.582 145 240 145H327C331.418 145 335 148.582 335 153V181C335 185.418 331.418 189 327 189H240C235.582 189 232 185.418 232 181V153Z" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',
@@ -2231,11 +2269,6 @@ DropdownItem.displayName = "DropdownItem";
2231
2269
  "content": '<svg width="448" height="416" viewBox="0 0 448 416" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_d_5227_2010)">\n<rect width="170" height="176" rx="8" transform="matrix(-1 0 0 1 267 45)" fill="white"/>\n<rect x="-0.25" y="0.25" width="169.5" height="175.5" rx="7.75" transform="matrix(-1 0 0 1 266.5 45)" stroke="#2E343F" stroke-width="0.5"/>\n</g>\n<rect x="-0.25" y="0.25" width="137.5" height="31.5" rx="2.75" transform="matrix(-1 0 0 1 250.5 77)" stroke="#2E343F" stroke-width="0.5"/>\n<rect x="121" y="89" width="98" height="2" rx="1" fill="#8F9AAD"/>\n<rect x="121" y="97" width="57" height="2" rx="1" fill="#C3C8D3"/>\n<g clip-path="url(#clip0_5227_2010)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M241 91.4928C242.664 89.782 246.825 92.7756 241 96.625C235.175 92.776 239.336 89.782 241 91.4928Z" fill="#F38176"/>\n</g>\n<rect x="-0.25" y="0.25" width="137.5" height="31.5" rx="2.75" transform="matrix(-1 0 0 1 250.5 117)" stroke="#2E343F" stroke-width="0.5"/>\n<rect x="121" y="129" width="98" height="2" rx="1" fill="#8F9AAD"/>\n<rect x="121" y="137" width="57" height="2" rx="1" fill="#C3C8D3"/>\n<g clip-path="url(#clip1_5227_2010)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M241 131.493C242.664 129.782 246.825 132.776 241 136.625C235.175 132.776 239.336 129.782 241 131.493Z" fill="#F38176"/>\n</g>\n<rect x="-0.25" y="0.25" width="137.5" height="31.5" rx="2.75" transform="matrix(-1 0 0 1 250.5 157)" stroke="#2E343F" stroke-width="0.5"/>\n<rect x="121" y="169" width="98" height="2" rx="1" fill="#8F9AAD"/>\n<rect x="121" y="177" width="57" height="2" rx="1" fill="#C3C8D3"/>\n<g clip-path="url(#clip2_5227_2010)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M241 171.493C242.664 169.782 246.825 172.776 241 176.625C235.175 172.776 239.336 169.782 241 171.493Z" fill="#F38176"/>\n</g>\n<path d="M96 74C109.255 74 120 63.2548 120 50C120 36.7452 109.255 26 96 26C82.7452 26 72 36.7452 72 50C72 63.2548 82.7452 74 96 74Z" fill="#2E343F"/>\n<g clip-path="url(#clip3_5227_2010)">\n<g clip-path="url(#clip4_5227_2010)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M95.9997 41.6426C101.547 35.9401 115.417 45.9188 95.9997 58.7501C76.5822 45.9201 90.4522 35.9401 95.9997 41.6426Z" fill="#F38176"/>\n</g>\n</g>\n<path d="M289.247 24.8291C289.247 24.8291 283.967 19.577 283.909 9.14526C283.865 1.06821 290.469 7.20151 290.469 7.20151C290.469 7.20151 290.493 1.38534 294.576 2.52171C298.658 3.65863 300.168 9.97907 300.168 9.97907" fill="#181818"/>\n<path d="M315.994 6.13684C315.994 6.13684 336.339 11.1796 325.043 38.1398L323.199 38.012L319.456 37.7526" fill="#181818"/>\n<path d="M289.881 66.1603C289.973 66.1485 290.99 83.0221 310.59 81.5513C324.159 80.5347 328.997 66.1366 329.308 66.1366C327.845 65.8254 326.037 65.3535 325.318 65.1917C322.931 64.6534 319.951 62.6838 319.262 58.5336C318.866 56.1417 319.539 43.9058 319.332 41.4858L298.503 46.1354C298.794 51.2462 300.831 63.0948 293.692 65.1917C292.504 65.5385 291.225 65.8572 289.881 66.1603Z" fill="#FF9E85"/>\n<path opacity="0.22" d="M298.211 60.3491C298.506 59.4074 298.682 58.5882 298.838 57.1158C299.117 54.4827 298.969 52.0622 298.702 49.5958C302.91 49.0355 306.95 47.2659 310.214 44.552C310.601 45.9807 312.728 52.2224 312.139 53.5799C311.026 56.146 305.795 60.3485 298.212 60.3485L298.211 60.3491Z" fill="#181818"/>\n<path d="M301.326 55.4276C309.567 55.8127 320.016 52.0029 321.67 40.9703L323.163 31.0153C324.817 19.9821 320.364 10.1695 309.977 8.61189C299.59 7.0543 290.486 14.8336 288.831 25.8668L288.171 30.2742C288.035 31.1814 287.886 32.8236 287.88 34.851C287.87 38.8955 287.87 45.0476 290.006 49.502C292.023 53.7072 296.061 55.1822 301.326 55.4287V55.4276Z" fill="#FF9E85"/>\n<path d="M292.596 34.6624C293.229 34.6624 293.742 34.1493 293.742 33.5164C293.742 32.8835 293.229 32.3705 292.596 32.3705C291.964 32.3705 291.451 32.8835 291.451 33.5164C291.451 34.1493 291.964 34.6624 292.596 34.6624Z" fill="#181818"/>\n<path d="M299.716 40.8066C299.948 40.8066 300.146 40.6313 300.171 40.3962C300.197 40.1443 300.015 39.9188 299.763 39.893L297.336 39.6395L298.83 34.793C298.904 34.5514 298.768 34.2947 298.527 34.2202C298.285 34.1458 298.029 34.2812 297.954 34.5234L296.296 39.9027C296.256 40.0337 296.277 40.1756 296.353 40.2899C296.429 40.4042 296.551 40.4787 296.687 40.4932L299.668 40.805C299.685 40.8066 299.701 40.8077 299.716 40.8077L299.716 40.8066Z" fill="#181818"/>\n<path d="M300.254 45.9951C304.407 45.9951 305.643 43.4856 305.698 43.368C305.806 43.1394 305.708 42.8664 305.479 42.758C305.252 42.6502 304.98 42.7473 304.871 42.9743C304.819 43.0811 303.551 45.5459 298.981 44.9995C298.725 44.9677 298.502 45.1489 298.471 45.4002C298.441 45.6516 298.621 45.8792 298.872 45.9094C299.364 45.9682 299.825 45.9951 300.254 45.9951H300.254Z" fill="#181818"/>\n<path d="M303.72 27.7481C303.61 28.0896 304.851 28.6 306.597 29.0678C308.343 29.5355 309.923 29.8733 310.042 29.4427C310.192 28.8989 308.891 27.6186 307.145 27.1508C305.399 26.6831 303.893 27.2113 303.72 27.7481Z" fill="#181818"/>\n<path d="M304.08 35.3927C304.713 35.3927 305.226 34.8797 305.226 34.2468C305.226 33.6139 304.713 33.1008 304.08 33.1008C303.448 33.1008 302.935 33.6139 302.935 34.2468C302.935 34.8797 303.448 35.3927 304.08 35.3927Z" fill="#181818"/>\n<path d="M289.81 27.9882C289.848 28.3448 291.19 28.3076 292.975 28.0265C294.76 27.7454 296.342 27.4125 296.275 26.9712C296.192 26.4133 294.669 25.7313 292.884 26.0124C291.099 26.2935 289.751 27.4271 289.81 27.9882Z" fill="#181818"/>\n<path d="M320.521 44.2347C323.677 44.7083 326.743 41.7144 327.216 38.5577C327.69 35.401 325.392 33.276 322.235 32.8025L320.291 34.674L317.807 43.8275L320.521 44.2347Z" fill="#FF9E85"/>\n<path d="M319.047 38.7677C318.513 38.7428 318.099 38.2936 318.121 37.7596C318.265 34.3095 318.455 22.695 314.536 21.3218C311.466 20.2459 303.194 23.6771 296.286 21.352C293.264 20.3349 290.213 20.6995 289.713 22.1244C289.514 22.6885 288.724 14.0824 294.45 8.41722C299.01 3.90677 311.866 4.21851 317.4 6.66007C332.724 13.4217 322.792 33.5803 322.792 33.5803L321.548 38.1242C321.428 38.5627 321.02 38.8599 320.566 38.8383L319.047 38.7677Z" fill="#181818"/>\n<path d="M305.411 9.99226C306.603 6.64545 305.726 3.27587 303.452 2.46611C301.178 1.65634 298.369 3.71302 297.177 7.05984C295.986 10.4067 296.863 13.7762 299.136 14.586C301.41 15.3957 304.219 13.3391 305.411 9.99226Z" fill="#181818"/>\n<path d="M326.795 391.556C326.795 391.556 324.361 404.178 312.544 404.882C300.727 405.585 303.289 415 303.289 415H348.447V392.436L326.795 391.556Z" fill="#A6DDFD"/>\n<path d="M276.124 391.556C276.124 391.556 273.69 404.178 261.872 404.882C250.055 405.585 252.618 415 252.618 415H297.776V392.436L276.124 391.556Z" fill="#A6DDFD"/>\n<path d="M270.385 163.792C270.385 163.792 266.678 273.522 267.063 278.885L270.549 398.781L299.733 399.32L304.438 274.549C304.438 274.549 307.523 240.131 315.838 208.172C320.105 191.773 322.64 174.972 323.478 158.047L270.385 163.792Z" fill="#181818"/>\n<g style="mix-blend-mode:plus-darker">\n<path d="M308.886 241.59L306.452 204.371C306.452 204.371 303.952 219.844 303.952 233.181C303.952 239.7 305.295 265.51 305.295 265.51L308.886 241.59Z" fill="#181818"/>\n</g>\n<path d="M351.51 161.298C351.51 161.298 351.368 157.504 351.398 166.111C351.51 198.217 350.44 399.612 350.44 399.612L320.766 399.363L302.791 159.994L351.51 161.299V161.298Z" fill="#181818"/>\n<path d="M266.086 102.884C266.698 110.074 269.675 154.935 270.263 163.791H351.354C351.812 155.803 353.869 120.874 355.606 105.252C357.265 90.3462 360.518 82.8834 358.133 78.4766C354.237 71.2743 343.588 67.1123 336.327 66.1291C331.893 65.5288 325.225 65.0984 325.225 65.0984C325.225 65.0984 324.661 76.522 311.197 77.1573C292.87 78.0219 294.094 65.0984 294.003 65.0984C291.034 65.0984 274.073 66.978 269.923 69.4379C258.616 76.1348 264.787 87.6452 266.086 102.883V102.884Z" fill="#A6DDFD"/>\n<path d="M248.286 157.671C246.004 157.671 243.691 157.102 241.559 155.904C234.939 152.181 232.589 143.796 236.312 137.175L269.089 78.868C272.811 72.2472 281.195 69.8973 287.815 73.6198C294.436 77.3423 296.785 85.7273 293.063 92.3481L260.285 150.655C257.761 155.145 253.093 157.671 248.286 157.671Z" fill="#A6DDFD"/>\n<path d="M308.161 109.838L299.679 99.9092C298.914 99.0139 297.549 98.9335 296.684 99.7549C295.872 100.525 295.887 101.832 296.614 102.682L298.426 104.804L307.493 111.692L308.161 109.838Z" fill="#FF9E85"/>\n<path d="M294.856 112.455L268.077 114.124C265.85 114.262 263.878 112.696 263.51 110.496L256.895 70.9717C256.469 68.4234 258.342 66.066 260.92 65.9052L287.7 64.2366C289.926 64.0979 291.898 65.6642 292.266 67.8647L298.881 107.389C299.307 109.937 297.435 112.294 294.856 112.455Z" fill="#2E343F"/>\n<path d="M298.426 104.804L289.634 100.735C288.665 100.265 287.175 100.309 286.719 101.432C286.292 102.315 286.553 103.349 287.286 103.938C287.28 103.948 287.271 103.956 287.267 103.966C287.263 103.974 287.264 103.982 287.261 103.99L285.766 103.266C284.618 102.71 283.211 103.312 282.864 104.61C282.605 105.576 283.135 106.583 284.034 107.019L284.671 107.327C284.671 107.35 284.673 107.373 284.682 107.394C283.731 107.178 282.72 107.658 282.321 108.607C281.887 109.639 282.424 110.829 283.431 111.317L284.995 112.074C284.937 112.085 284.883 112.12 284.855 112.178C284.838 112.215 284.837 112.253 284.843 112.289C283.989 112.332 283.19 112.896 282.941 113.83C282.682 114.795 283.213 115.803 284.112 116.238L297.446 122.694C301.261 124.542 305.817 123.889 308.961 121.044L313.908 116.566L298.426 104.804Z" fill="#FF9E85"/>\n<g opacity="0.2">\n<path d="M295.968 108.011C295.922 108.104 295.811 108.143 295.717 108.1L287.36 104.219C287.265 104.175 287.223 104.062 287.267 103.966C287.302 103.873 287.425 103.829 287.521 103.873L295.878 107.753C295.973 107.798 296.015 107.911 295.97 108.007L295.968 108.011Z" fill="#181818"/>\n</g>\n<g opacity="0.2">\n<path d="M294.358 111.744C294.312 111.837 294.2 111.876 294.106 111.833L284.781 107.502C284.686 107.458 284.644 107.344 284.689 107.248C284.73 107.161 284.847 107.111 284.942 107.156L294.267 111.486C294.363 111.531 294.404 111.644 294.36 111.74L294.358 111.744V111.744Z" fill="#181818"/>\n</g>\n<g opacity="0.2">\n<path d="M292.639 115.797C292.593 115.89 292.481 115.929 292.388 115.886L284.948 112.431C284.853 112.387 284.811 112.274 284.855 112.178C284.902 112.082 285.013 112.041 285.109 112.085L292.548 115.539C292.644 115.583 292.685 115.697 292.641 115.793L292.639 115.797V115.797Z" fill="#181818"/>\n</g>\n<path d="M297.886 126.523L355.727 154.898C356.869 155.424 358.056 155.789 359.26 155.998C363.323 156.703 367.566 155.624 370.832 152.914C375.066 149.401 376.909 143.769 375.57 138.433L360.125 82.898C358.204 75.239 350.437 70.5872 342.78 72.5089C335.122 74.43 331.011 82.1964 332.932 89.8549L345.049 119.882L307.986 104.341L297.885 126.523H297.886Z" fill="#A6DDFD"/>\n<path d="M351.921 153.341C351.904 153.338 351.886 153.333 351.87 153.325L297.803 126.695C297.71 126.65 297.67 126.539 297.712 126.445L307.813 104.262C307.856 104.168 307.966 104.124 308.061 104.165L344.219 119.013L337.063 97.4577C337.034 97.3563 337.093 97.2512 337.195 97.222C337.296 97.1934 337.401 97.2528 337.43 97.3536L344.694 119.291C344.714 119.362 344.691 119.437 344.636 119.486C344.581 119.534 344.504 119.547 344.436 119.519L308.084 104.589L298.136 126.433L352.036 152.982C352.131 153.027 352.171 153.142 352.125 153.237C352.087 153.315 352.002 153.355 351.921 153.341V153.341Z" fill="#181818"/>\n<path d="M350.996 122.443C350.98 122.441 350.965 122.436 350.951 122.429L344.433 119.517C344.337 119.474 344.294 119.361 344.337 119.265C344.38 119.168 344.492 119.124 344.589 119.169L351.106 122.082C351.202 122.124 351.245 122.237 351.202 122.333C351.166 122.415 351.08 122.458 350.996 122.443Z" fill="#181818"/>\n<path d="M277.323 83.5339C276.707 82.7739 275.735 82.5879 274.933 82.9104C274.923 82.8748 274.913 82.8376 274.883 82.8117C274.829 82.7669 274.763 82.7675 274.702 82.788L275.826 81.4288C276.521 80.5891 276.533 79.326 275.757 78.5612C274.999 77.8142 273.845 77.7819 273.052 78.3881C273.05 78.3676 273.032 78.3525 273.024 78.3336L273.485 77.777C274.117 77.0122 274.186 75.8861 273.561 75.1154C272.708 74.0626 271.166 74.0966 270.35 75.0836L269.288 76.3677C269.282 76.3613 269.283 76.351 269.276 76.3451C269.268 76.337 269.254 76.3402 269.245 76.3343C269.671 75.4919 269.479 74.4391 268.721 73.8118C267.841 72.9802 266.468 73.5594 265.781 74.3895L259.289 82.0938L259.476 81.7454L260.246 79.0531C260.545 78.0052 260.049 76.8434 259.032 76.454C257.884 76.0156 256.632 76.6584 256.302 77.8142L252.714 90.3699L251.843 93.4188C250.974 96.459 252.682 99.6389 255.696 100.594L256.644 100.894C260.686 102.175 265.1 100.875 267.803 97.6083L277.247 86.1928C277.88 85.428 277.949 84.3024 277.324 83.5312L277.323 83.5339Z" fill="#FF9E85"/>\n<g opacity="0.2">\n<path d="M263.044 83.642C263.125 83.7072 263.242 83.697 263.31 83.6182L269.297 76.615C269.366 76.5352 269.356 76.4149 269.276 76.3464C269.206 76.2763 269.076 76.2876 269.008 76.3674L263.02 83.3707C262.952 83.4505 262.961 83.5708 263.041 83.6393L263.044 83.642Z" fill="#181818"/>\n</g>\n<g opacity="0.2">\n<path d="M266.06 86.3677C266.14 86.4329 266.258 86.4227 266.325 86.3439L273.008 78.5285C273.076 78.4486 273.066 78.3284 272.987 78.2599C272.913 78.1978 272.786 78.2011 272.718 78.2809L266.036 86.0964C265.967 86.1762 265.977 86.2965 266.057 86.365L266.06 86.3677Z" fill="#181818"/>\n</g>\n<g opacity="0.2">\n<path d="M269.309 89.3388C269.389 89.4041 269.507 89.3938 269.574 89.3151L274.905 83.0809C274.973 83.0011 274.963 82.8808 274.883 82.8123C274.802 82.7449 274.683 82.7536 274.615 82.8334L269.285 89.0675C269.216 89.1474 269.226 89.2676 269.306 89.3361L269.309 89.3388Z" fill="#181818"/>\n</g>\n<path d="M273.053 97.2144L262.411 145.077C261.276 152.1 255.206 157.095 248.316 157.095C247.558 157.095 246.79 157.035 246.017 156.91C238.223 155.651 232.926 148.31 234.185 140.515L248.797 89.3811" fill="#A6DDFD"/>\n<path d="M263.239 136.457C263.216 136.457 263.192 136.454 263.168 136.447C263.024 136.408 262.94 136.26 262.978 136.116L268.979 114.07C269.018 113.927 269.166 113.84 269.31 113.881C269.454 113.92 269.538 114.068 269.499 114.212L263.499 136.258C263.466 136.378 263.358 136.457 263.239 136.457Z" fill="#181818"/>\n<path d="M0.447449 416H447.552C447.8 416 448 415.776 448 415.5C448 415.224 447.8 415 447.552 415H0.44812C0.200439 415 -3.05176e-05 415.224 -3.05176e-05 415.5C-3.05176e-05 415.776 0.200439 416 0.44812 416H0.447449Z" fill="#2E343F"/>\n<defs>\n<filter id="filter0_d_5227_2010" x="91" y="45" width="176" height="182" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-6" dy="6"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.180392 0 0 0 0 0.203922 0 0 0 0 0.247059 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5227_2010"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5227_2010" result="shape"/>\n</filter>\n<clipPath id="clip0_5227_2010">\n<rect width="6" height="6" fill="white" transform="translate(238 91)"/>\n</clipPath>\n<clipPath id="clip1_5227_2010">\n<rect width="6" height="6" fill="white" transform="translate(238 131)"/>\n</clipPath>\n<clipPath id="clip2_5227_2010">\n<rect width="6" height="6" fill="white" transform="translate(238 171)"/>\n</clipPath>\n<clipPath id="clip3_5227_2010">\n<rect width="24" height="24" fill="white" transform="translate(84 38)"/>\n</clipPath>\n<clipPath id="clip4_5227_2010">\n<rect width="20" height="20" fill="white" transform="translate(86 40)"/>\n</clipPath>\n</defs>\n</svg>\n',
2232
2270
  "dir": "darkModeSvgs"
2233
2271
  },
2234
- {
2235
- "name": "empty_dark.svg",
2236
- "content": '<svg width="300" height="241" viewBox="0 0 300 241" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_5223_27673)">\n<path opacity="0.1" d="M149.188 160.812C149.896 161.024 150.606 161.197 151.316 161.352C150.503 162.708 149.841 164.185 149.366 165.768C146.272 176.06 152.125 186.906 162.438 189.992C165.901 191.029 169.424 191.055 172.696 190.248C174.757 194.317 178.407 197.574 183.129 198.987C188.951 200.729 194.964 199.248 199.273 195.589C201.77 199.71 205.747 202.955 210.733 204.448C221.402 207.641 232.644 201.598 235.844 190.951C237.246 186.285 236.871 181.51 235.109 177.347C235.708 177.572 236.315 177.785 236.937 177.971C251.874 182.441 267.614 173.982 272.093 159.076C276.573 144.17 268.097 128.463 253.16 123.992C249.225 122.814 245.234 122.542 241.408 123.041C240.211 113.744 233.696 105.559 224.119 102.692C216.407 100.384 208.449 102.043 202.442 106.485C200.499 105.144 198.318 104.076 195.932 103.361C187.146 100.732 178.02 103.568 172.22 109.901C170.142 108.612 167.866 107.569 165.411 106.834C150.474 102.363 134.735 110.823 130.255 125.728C125.775 140.634 134.252 156.342 149.188 160.812Z" fill="#6AC8FB"/>\n<path opacity="0.1" d="M151.243 28.8489C150.504 28.8489 149.774 28.8861 149.049 28.9416C149.438 27.4096 149.646 25.8052 149.646 24.1526C149.646 13.4078 140.918 4.69687 130.151 4.69687C126.536 4.69687 123.154 5.68238 120.252 7.39282C117.107 4.0862 112.673 2.01331 107.744 2.01331C101.666 2.01331 96.3323 5.15659 93.2584 9.89607C89.6806 6.66515 84.937 4.69687 79.7317 4.69687C68.5934 4.69687 59.5644 13.7078 59.5644 24.8234C59.5644 29.6945 61.2986 34.1614 64.1849 37.6429C63.5458 37.5997 62.9031 37.5699 62.2535 37.5699C46.6593 37.5699 34.0186 50.1853 34.0186 65.7471C34.0186 81.3089 46.6593 93.9243 62.2535 93.9243C66.3623 93.9243 70.2623 93.0411 73.7839 91.466C77.6072 100.028 86.2027 106 96.2022 106C104.254 106 111.399 102.13 115.873 96.1527C118.121 96.8804 120.517 97.2786 123.008 97.2786C132.181 97.2786 140.105 91.9454 143.838 84.2168C146.198 84.8559 148.68 85.2028 151.243 85.2028C166.837 85.2028 179.478 72.5874 179.478 57.0256C179.478 41.4638 166.837 28.8485 151.243 28.8485L151.243 28.8489Z" fill="#6AC8FB"/>\n<path d="M248.189 172.651V229.126C248.189 233.83 244.358 237.651 239.627 237.651H53.7514C49.0209 237.651 45.1895 233.83 45.1895 229.126V172.651H47.1895H123.273C123.54 185.311 133.924 195.49 146.69 195.49C159.453 195.49 169.915 185.313 170.184 172.651H248.189Z" fill="white" stroke="#596479"/>\n<path d="M123.689 171.651H46.4303L102.333 136.651H192.798L246.994 171.651H169.689H169.189V172.151C169.189 184.621 159.552 194.651 147.189 194.651C134.455 194.651 124.189 184.597 124.189 172.151V171.651H123.689Z" fill="#CDEBFE" stroke="#596479"/>\n<path d="M73.1666 138.619C73.0751 138.619 72.9822 138.591 72.9013 138.534C72.6944 138.388 72.6452 138.101 72.7923 137.895C72.8774 137.774 81.1864 125.787 71.9105 114.858C68.1047 110.374 62.956 108.657 58.5337 108.657C58.4928 108.657 58.4514 108.657 58.411 108.657C59.2918 111.71 59.1346 114.426 57.8873 116.509C56.7085 118.478 54.6047 119.635 52.517 119.454C50.6766 119.295 49.2225 118.166 48.5269 116.356C47.5067 113.701 48.5747 111.125 51.3828 109.466C52.8866 108.578 54.9072 107.978 57.1706 107.805C56.5945 106.227 55.7389 104.558 54.6121 102.841C51.2628 97.7361 45.1587 94.2023 37.8639 93.1457C31.6826 92.2501 25.7583 93.3049 22.7695 95.8311C22.5746 95.9953 22.2845 95.9701 22.1217 95.7774C21.9576 95.5843 21.9815 95.2943 22.1751 95.1305C25.356 92.4419 31.5659 91.3059 37.9959 92.2377C45.5514 93.332 51.8876 97.0134 55.3812 102.338C56.6074 104.207 57.525 106.03 58.125 107.759C62.8816 107.648 68.5006 109.422 72.6112 114.265C82.3546 125.744 73.6309 138.3 73.5413 138.425C73.4516 138.551 73.31 138.618 73.1661 138.618L73.1666 138.619ZM57.4676 108.691C55.2677 108.831 53.3023 109.4 51.8518 110.257C49.4261 111.69 48.5278 113.794 49.3861 116.029C49.9507 117.498 51.1208 118.414 52.597 118.542C54.3261 118.691 56.0984 117.709 57.0984 116.039C58.2441 114.126 58.3494 111.583 57.4676 108.691Z" fill="#596479"/>\n<path d="M14.8344 103.237C14.1521 103.442 13.4257 103.408 12.7568 103.135C11.9844 102.82 11.3808 102.223 11.058 101.455C10.7353 100.686 10.7311 99.8382 11.047 99.067C11.3633 98.2962 11.961 97.6938 12.731 97.3712C14.3176 96.7078 16.1562 97.4547 16.8223 99.0408C17.489 100.627 16.7382 102.459 15.1488 103.124C15.0454 103.167 14.9406 103.205 14.8344 103.237ZM13.3057 98.1388C13.2317 98.1608 13.1586 98.187 13.086 98.2177C12.5425 98.4453 12.1205 98.8702 11.8975 99.4143C11.6745 99.9589 11.6773 100.557 11.9049 101.099C12.1329 101.642 12.5591 102.063 13.1043 102.286C13.6496 102.508 14.2487 102.506 14.7925 102.278C15.9143 101.808 16.4444 100.515 15.9741 99.3955C15.5337 98.3485 14.3714 97.8186 13.3053 98.1384L13.3057 98.1388Z" fill="#596479"/>\n<path d="M14.8298 96.0427C14.1471 96.2478 13.4207 96.2139 12.7518 95.9409C11.9789 95.6257 11.3753 95.0288 11.053 94.2603C10.7298 93.4918 10.7256 92.6443 11.0419 91.8731C11.3583 91.1018 11.9559 90.4994 12.7265 90.1769C13.4952 89.8562 14.3462 89.8511 15.1185 90.1663C15.8914 90.4815 16.495 91.0784 16.8173 91.8469C17.1405 92.615 17.1446 93.4629 16.8283 94.2341C16.5125 95.0054 15.9144 95.6078 15.1438 95.9303C15.0404 95.9734 14.9356 96.0111 14.8298 96.0427ZM13.303 90.9435C13.228 90.966 13.1545 90.9922 13.0814 91.0229C12.538 91.2505 12.1159 91.6753 11.8925 92.2195C11.67 92.7636 11.6723 93.3624 11.9003 93.9047C12.1283 94.447 12.5541 94.8686 13.0998 95.0907C13.645 95.3132 14.2413 95.3114 14.7884 95.0834C15.3319 94.8558 15.7539 94.4309 15.9773 93.8868C16.1999 93.3427 16.1976 92.7439 15.9695 92.2016C15.7415 91.6593 15.3158 91.2376 14.77 91.0156C14.2979 90.8229 13.7853 90.799 13.3034 90.9435H13.303Z" fill="#596479"/>\n<path d="M13.9323 99.283C16.1901 99.283 18.0204 98.063 18.0204 96.5581C18.0204 95.0532 16.1901 93.8333 13.9323 93.8333C11.6745 93.8333 9.84424 95.0532 9.84424 96.5581C9.84424 98.063 11.6745 99.283 13.9323 99.283Z" fill="#596479"/>\n<path d="M15.7427 99.4857C15.1805 99.6545 14.5681 99.7435 13.9373 99.744C11.3871 99.7463 9.3881 98.3492 9.38672 96.564C9.38534 94.7783 11.3816 93.379 13.9313 93.3762C15.1133 93.3753 16.231 93.685 17.0783 94.2489C17.9826 94.8504 18.481 95.6698 18.4819 96.5558C18.4828 97.4417 17.9858 98.2621 17.0824 98.8654C16.688 99.1287 16.2342 99.3375 15.7427 99.4848V99.4857ZM12.405 94.5141C11.1765 94.8829 10.3058 95.6735 10.3062 96.5631C10.3071 97.7913 11.9691 98.8278 13.9359 98.8264C14.9386 98.8255 15.8747 98.5685 16.5707 98.1033C17.2102 97.6762 17.5624 97.127 17.5619 96.5576C17.5615 95.9877 17.2084 95.4395 16.568 95.0132C15.8701 94.5489 14.934 94.2938 13.9322 94.2948C13.3902 94.2948 12.8716 94.3741 12.405 94.5145V94.5141Z" fill="#596479"/>\n<path d="M14.6896 99.1174V93.8411H13.6895L13.6897 99.1174H14.6896Z" fill="#596479"/>\n<path d="M8.51067 97.7189C8.74376 97.7189 8.93272 97.5301 8.93272 97.2973C8.93272 97.0645 8.74376 96.8757 8.51067 96.8757C8.27758 96.8757 8.08862 97.0645 8.08862 97.2973C8.08862 97.5301 8.27758 97.7189 8.51067 97.7189Z" fill="#596479"/>\n<path d="M8.83928 95.456C9.07238 95.456 9.26133 95.2673 9.26133 95.0345C9.26133 94.8017 9.07238 94.6129 8.83928 94.6129C8.60619 94.6129 8.41724 94.8017 8.41724 95.0345C8.41724 95.2673 8.60619 95.456 8.83928 95.456Z" fill="#596479"/>\n<path d="M156.167 152.366C155.21 154.046 153.073 154.632 151.393 153.675L99.0434 123.854C97.3638 122.897 96.7779 120.76 97.7347 119.08L139.666 45.4718C140.623 43.7922 142.76 43.2062 144.439 44.163L180.53 64.7219C181.336 65.1813 181.927 65.9424 182.173 66.8376L189.17 92.3603C189.415 93.2555 189.295 94.2115 188.836 95.0181L156.167 152.366Z" fill="white" stroke="#596479"/>\n<path opacity="0.3" d="M164.241 115.963C166.192 115.963 167.773 114.381 167.773 112.43C167.773 110.48 166.192 108.898 164.241 108.898C162.29 108.898 160.709 110.48 160.709 112.43C160.709 114.381 162.29 115.963 164.241 115.963Z" fill="#24A7F9"/>\n<path opacity="0.3" d="M126.964 97.3582C128.915 97.3582 130.496 95.7767 130.496 93.8259C130.496 91.875 128.915 90.2936 126.964 90.2936C125.013 90.2936 123.432 91.875 123.432 93.8259C123.432 95.7767 125.013 97.3582 126.964 97.3582Z" fill="#24A7F9"/>\n<path d="M182.112 65.1179L171.689 83.414L189.985 93.8363L182.112 65.1179Z" fill="#596479"/>\n<path d="M138.836 89.1785C140.376 89.1785 141.624 87.9304 141.624 86.3907C141.624 84.8511 140.376 83.6029 138.836 83.6029C137.296 83.6029 136.048 84.8511 136.048 86.3907C136.048 87.9304 137.296 89.1785 138.836 89.1785Z" fill="#596479"/>\n<path d="M164.985 101.068C166.525 101.068 167.773 99.8199 167.773 98.2802C167.773 96.7406 166.525 95.4924 164.985 95.4924C163.445 95.4924 162.197 96.7406 162.197 98.2802C162.197 99.8199 163.445 101.068 164.985 101.068Z" fill="#596479"/>\n<path d="M153.137 118.167C152.887 118.167 152.681 117.968 152.675 117.717C152.547 113.016 149.895 108.721 145.753 106.506C141.907 104.451 137.307 104.442 133.447 106.482C133.221 106.601 132.941 106.515 132.822 106.289C132.702 106.063 132.788 105.783 133.014 105.664C137.147 103.48 142.072 103.49 146.189 105.69C150.624 108.061 153.463 112.659 153.599 117.691C153.606 117.946 153.405 118.159 153.149 118.166C153.145 118.166 153.141 118.166 153.137 118.166V118.167Z" fill="#596479"/>\n<path d="M141.262 83.5381C138.889 83.5381 137.134 82.3199 137.038 82.252C136.829 82.1042 136.78 81.8159 136.928 81.6074C137.075 81.3993 137.363 81.3494 137.572 81.4971C137.608 81.5227 140.322 83.3851 143.353 82.2272C143.592 82.1358 143.858 82.256 143.95 82.4944C144.041 82.7329 143.921 83.0005 143.683 83.0915C142.835 83.4151 142.017 83.5385 141.261 83.5385L141.262 83.5381Z" fill="#596479"/>\n<path d="M169.817 96.8286C169.766 96.8286 169.715 96.8202 169.665 96.8027C165.765 95.4431 165.323 92.438 165.306 92.3106C165.272 92.0574 165.45 91.8249 165.703 91.7914C165.955 91.7586 166.187 91.9348 166.222 92.1868C166.238 92.2962 166.632 94.7665 169.969 95.9296C170.21 96.0139 170.338 96.2775 170.253 96.5183C170.187 96.7092 170.008 96.8286 169.817 96.8286Z" fill="#596479"/>\n<path d="M213.236 125.144C213.039 125.144 212.857 125.017 212.797 124.82C212.771 124.738 210.316 116.578 211.599 107.375C212.787 98.8425 217.503 87.6416 233.22 82.737C235.778 81.9391 238.025 81.4459 240.001 81.1858C240.741 76.5697 243.559 71.5623 249.859 68.1075C264.83 59.8985 274.942 67.2637 275.042 67.339C275.244 67.4913 275.285 67.7785 275.133 67.9808C274.981 68.1836 274.693 68.224 274.489 68.0726C274.394 68.001 264.73 60.9992 250.302 68.9118C244.414 72.1404 241.719 76.7743 240.953 81.0761C247.885 80.3948 251.206 82.7026 252.695 84.446C254.59 86.6635 255.008 89.7136 253.76 92.2173C252.702 94.3398 250.665 95.5294 248.319 95.3872C244.447 95.1606 241.243 91.9104 240.157 87.1067C239.819 85.6105 239.697 83.9198 239.875 82.1497C237.901 82.4181 235.764 82.9054 233.495 83.6133C221.245 87.4361 214.184 95.4735 212.509 107.502C211.255 116.506 213.651 124.472 213.676 124.551C213.75 124.794 213.613 125.05 213.371 125.124C213.326 125.138 213.281 125.145 213.236 125.145V125.144ZM240.812 82.0368C240.613 83.7766 240.724 85.4398 241.054 86.9043C242.048 91.2988 244.92 94.2686 248.372 94.471C250.337 94.5829 252.048 93.591 252.937 91.8081C254.02 89.6342 253.651 86.9782 251.995 85.0407C249.845 82.525 245.922 81.5083 240.812 82.0364V82.0368Z" fill="#596479"/>\n<path d="M285.753 71.9783C285.131 71.9783 284.52 71.8008 283.984 71.4566C283.247 70.9832 282.738 70.2518 282.552 69.3966C282.168 67.6316 283.294 65.8831 285.063 65.4995C286.833 65.1159 288.584 66.2405 288.968 68.0055C289.352 69.771 288.226 71.519 286.456 71.9026C286.223 71.9535 285.987 71.9783 285.753 71.9783ZM285.76 66.3419C285.595 66.3419 285.426 66.3598 285.258 66.396C283.985 66.6722 283.174 67.9307 283.45 69.2016C283.584 69.8173 283.951 70.344 284.481 70.6849C285.012 71.0258 285.645 71.1405 286.261 71.0061C287.535 70.7299 288.346 69.4714 288.07 68.2005C287.83 67.0975 286.848 66.3419 285.76 66.3419Z" fill="#596479"/>\n<path d="M284.37 79.4691C283.748 79.4691 283.137 79.2915 282.6 78.9474C281.863 78.4739 281.355 77.7426 281.168 76.8874C280.983 76.0321 281.141 75.1558 281.616 74.4199C282.09 73.684 282.823 73.1765 283.68 72.9907C284.536 72.8044 285.415 72.9632 286.152 73.4367C286.89 73.9102 287.398 74.6415 287.585 75.4967C287.77 76.3519 287.612 77.2283 287.137 77.9642C286.663 78.7001 285.93 79.2075 285.073 79.3934C284.839 79.4443 284.604 79.4691 284.37 79.4691ZM284.381 73.8326C284.213 73.8326 284.044 73.8505 283.874 73.8872C283.257 74.0212 282.73 74.3864 282.389 74.9163C282.047 75.4462 281.933 76.0771 282.067 76.6928C282.201 77.3085 282.567 77.8352 283.098 78.1761C283.629 78.5175 284.262 78.6313 284.878 78.4973C285.495 78.3633 286.022 77.9981 286.364 77.4682C286.705 76.9383 286.82 76.3074 286.685 75.6917C286.551 75.076 286.185 74.5493 285.655 74.2084C285.268 73.9606 284.829 73.8331 284.381 73.8331L284.381 73.8326Z" fill="#596479"/>\n<path d="M289.306 73.3155C289.596 71.7483 287.925 70.127 285.574 69.694C283.222 69.261 281.082 70.1805 280.792 71.7476C280.502 73.3147 282.173 74.9361 284.524 75.369C286.875 75.802 289.016 74.8826 289.306 73.3155Z" fill="#596479"/>\n<path d="M285.684 75.9502C285.277 75.9502 284.861 75.9121 284.443 75.8355C283.217 75.6097 282.118 75.0743 281.349 74.3278C280.53 73.5336 280.172 72.5931 280.342 71.6796C280.511 70.7661 281.181 70.015 282.23 69.5645C283.215 69.141 284.432 69.0327 285.659 69.258C286.885 69.4837 287.983 70.0192 288.753 70.7657C289.571 71.5599 289.93 72.5004 289.76 73.4139C289.591 74.3274 288.92 75.0784 287.872 75.529C287.222 75.8079 286.471 75.9502 285.684 75.9502ZM284.414 70.06C283.753 70.06 283.129 70.1775 282.593 70.4073C281.836 70.7326 281.358 71.2437 281.246 71.8461C281.135 72.4486 281.398 73.0964 281.99 73.6699C282.631 74.2911 283.561 74.7403 284.609 74.933C285.658 75.1252 286.687 75.0381 287.508 74.6862C288.265 74.3609 288.744 73.8498 288.856 73.2473C288.967 72.6449 288.703 71.9971 288.112 71.4231C287.471 70.8019 286.541 70.3532 285.492 70.16C285.128 70.093 284.766 70.06 284.414 70.06Z" fill="#596479"/>\n<path d="M285.282 75.1631L286.085 69.9481L285.096 69.796L284.294 75.011L285.282 75.1631Z" fill="#596479"/>\n<path d="M290.064 75.5548C290.311 75.5548 290.511 75.355 290.511 75.1085C290.511 74.862 290.311 74.6621 290.064 74.6621C289.818 74.6621 289.617 74.862 289.617 75.1085C289.617 75.355 289.818 75.5548 290.064 75.5548Z" fill="#596479"/>\n<path d="M290.839 73.2637C291.086 73.2637 291.286 73.0639 291.286 72.8173C291.286 72.5708 291.086 72.371 290.839 72.371C290.592 72.371 290.392 72.5708 290.392 72.8173C290.392 73.0639 290.592 73.2637 290.839 73.2637Z" fill="#596479"/>\n</g>\n<defs>\n<clipPath id="clip0_5223_27673">\n<rect width="285.219" height="236.459" fill="white" transform="translate(6.07129 2.01624)"/>\n</clipPath>\n</defs>\n</svg>\n',
2237
- "dir": "darkModeSvgs"
2238
- },
2239
2272
  {
2240
2273
  "name": "dataupload_dark.svg",
2241
2274
  "content": '<svg width="448" height="416" viewBox="0 0 448 416" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_5227_2009)">\n<path d="M426.762 75.9041C428.364 66.0893 426.456 56.0038 421.374 47.458C415.649 37.8181 406.558 31.0064 395.775 28.2758C393.04 27.5902 390.246 27.1807 387.466 27.0569V27.0162H373.174V28.9578C362.904 32.224 354.425 39.2435 349.228 48.779C345.812 46.5243 341.844 45.3352 337.719 45.3352C337.075 45.3352 336.404 45.3673 335.765 45.4283H326.109L322.953 51.4084L322.884 51.4762C322.791 51.5662 322.698 51.6561 322.609 51.7483C319.357 55.0931 317.267 59.4815 316.7 64.1401C300.078 65.3359 286.802 79.366 286.403 96.2424C286.201 105.031 289.397 113.389 295.403 119.777C301.433 126.151 309.545 129.772 318.254 129.975L420.942 129.988C435.862 129.988 447.999 117.714 447.999 102.626C447.999 89.5582 439.288 78.6303 426.761 75.9037L426.762 75.9041Z" fill="#39404D"/>\n<path d="M410.36 129.553C425.037 129.553 436.983 117.477 436.983 102.627C436.983 89.5953 428.032 78.7401 415.681 76.2454C417.39 66.3908 415.572 56.3473 410.418 47.6813C404.75 38.1385 395.76 31.4019 385.086 28.6993C381.796 27.874 378.435 27.4519 375.081 27.4519C359.806 27.4519 345.932 35.9683 338.799 49.409C335.381 47.0377 331.352 45.7714 327.136 45.7714C321.526 45.7714 316.263 47.9931 312.337 52.0534C309.053 55.4316 306.997 59.8683 306.508 64.5523C290.058 65.5461 276.653 79.3832 276.254 96.2537C276.055 104.939 279.217 113.183 285.135 119.478C291.073 125.753 299.067 129.339 307.671 129.54L410.36 129.553Z" fill="white"/>\n<path d="M410.36 130.005L307.672 129.992C298.959 129.788 290.842 126.165 284.809 119.789C278.8 113.398 275.603 105.036 275.805 96.2429C276.204 79.362 289.48 65.3283 306.104 64.1266C306.674 59.4689 308.764 55.0823 312.015 51.7379C316.017 47.5995 321.388 45.3199 327.136 45.3199C331.258 45.3199 335.225 46.5067 338.64 48.7565C345.972 35.3225 359.888 27 375.081 27C378.456 27 381.859 27.4239 385.196 28.2605C395.983 30.992 405.078 37.8064 410.805 47.4495C415.887 55.9943 417.795 66.0776 416.197 75.892C428.724 78.6258 437.434 89.5564 437.434 102.627C437.434 117.723 425.288 130.005 410.36 130.005ZM327.136 46.2233C321.633 46.2233 316.492 48.4053 312.66 52.3679C309.461 55.6594 307.436 60.0031 306.956 64.5993L306.917 64.9803L306.536 65.0033C290.198 65.9908 277.095 79.7217 276.705 96.2642C276.508 104.818 279.619 112.952 285.463 119.168C291.329 125.367 299.22 128.891 307.682 129.088L410.36 129.101C424.792 129.101 436.533 117.225 436.533 102.627C436.533 89.8448 427.922 79.1785 415.592 76.6883L415.162 76.6015L415.237 76.1677C416.926 66.4315 415.078 56.397 410.032 47.9127C404.428 38.4771 395.529 31.8091 384.977 29.1372C381.712 28.3188 378.383 27.9039 375.081 27.9039C360.056 27.9039 346.306 36.2259 339.198 49.6224L338.96 50.0698L338.545 49.7815C335.188 47.454 331.243 46.2233 327.136 46.2233Z" fill="#2E343F"/>\n<path d="M347.402 99.0396H302.183V388.405H347.402V99.0396Z" fill="#2E343F"/>\n<path d="M347.852 388.857H301.732V98.5876H347.852V388.857ZM302.633 387.953H346.952V99.4915H302.633V387.953Z" fill="#2E343F"/>\n<path d="M160.933 388.405H302.182L302.182 99.04H160.933L160.933 388.405Z" fill="white"/>\n<path d="M302.632 388.857H160.483V98.5876H302.632V388.857ZM161.384 387.953H301.732V99.4915H161.384V387.953Z" fill="#2E343F"/>\n<path d="M291.704 110.678H171.413V137.781H291.704V110.678Z" fill="#A6DDFD"/>\n<g opacity="0.5">\n<path d="M291.704 110.678H171.413V137.781H291.704V110.678Z" fill="white"/>\n</g>\n<path d="M291.704 138.233H171.413C171.164 138.233 170.963 138.031 170.963 137.781V110.678C170.963 110.428 171.164 110.226 171.413 110.226H291.704C291.953 110.226 292.154 110.428 292.154 110.678V137.781C292.154 138.031 291.953 138.233 291.704 138.233ZM171.863 137.329H291.254V111.13H171.863V137.329Z" fill="#2E343F"/>\n<path d="M185.047 129.79C188.105 129.79 190.584 127.3 190.584 124.229C190.584 121.159 188.105 118.669 185.047 118.669C181.989 118.669 179.51 121.159 179.51 124.229C179.51 127.3 181.989 129.79 185.047 129.79Z" fill="white"/>\n<path d="M185.047 130.242C181.746 130.242 179.06 127.544 179.06 124.229C179.06 120.914 181.746 118.217 185.047 118.217C188.349 118.217 191.035 120.914 191.035 124.229C191.035 127.544 188.349 130.242 185.047 130.242ZM185.047 119.122C182.242 119.122 179.96 121.413 179.96 124.23C179.96 127.047 182.242 129.338 185.047 129.338C187.853 129.338 190.134 127.047 190.134 124.23C190.134 121.413 187.853 119.122 185.047 119.122Z" fill="#2E343F"/>\n<path d="M266.579 124.123H197.728C197.48 124.123 197.278 123.921 197.278 123.671C197.278 123.421 197.48 123.219 197.728 123.219H266.579C266.828 123.219 267.029 123.421 267.029 123.671C267.029 123.921 266.828 124.123 266.579 124.123Z" fill="#2E343F"/>\n<path d="M276.7 124.123H275.271C275.022 124.123 274.821 123.921 274.821 123.671C274.821 123.421 275.022 123.219 275.271 123.219H276.7C276.949 123.219 277.15 123.421 277.15 123.671C277.15 123.921 276.949 124.123 276.7 124.123Z" fill="#2E343F"/>\n<path d="M271.686 124.123H270.257C270.008 124.123 269.807 123.921 269.807 123.671C269.807 123.421 270.008 123.219 270.257 123.219H271.686C271.935 123.219 272.136 123.421 272.136 123.671C272.136 123.921 271.935 124.123 271.686 124.123Z" fill="#2E343F"/>\n<path d="M282.059 124.123H280.63C280.381 124.123 280.18 123.921 280.18 123.671C280.18 123.421 280.381 123.219 280.63 123.219H282.059C282.308 123.219 282.509 123.421 282.509 123.671C282.509 123.921 282.308 124.123 282.059 124.123Z" fill="#2E343F"/>\n<path d="M291.704 148.303H171.413V175.406H291.704V148.303Z" fill="#A6DDFD"/>\n<g opacity="0.5">\n<path d="M291.704 148.303H171.413V175.406H291.704V148.303Z" fill="white"/>\n</g>\n<path d="M291.704 175.858H171.413C171.164 175.858 170.963 175.656 170.963 175.406V148.304C170.963 148.054 171.164 147.852 171.413 147.852H291.704C291.953 147.852 292.154 148.054 292.154 148.304V175.406C292.154 175.656 291.953 175.858 291.704 175.858ZM171.863 174.955H291.254V148.755H171.863V174.955Z" fill="#2E343F"/>\n<path d="M185.047 167.415C188.105 167.415 190.584 164.926 190.584 161.855C190.584 158.784 188.105 156.295 185.047 156.295C181.989 156.295 179.51 158.784 179.51 161.855C179.51 164.926 181.989 167.415 185.047 167.415Z" fill="white"/>\n<path d="M185.047 167.867C181.746 167.867 179.06 165.17 179.06 161.855C179.06 158.54 181.746 155.843 185.047 155.843C188.349 155.843 191.035 158.54 191.035 161.855C191.035 165.17 188.349 167.867 185.047 167.867ZM185.047 156.747C182.242 156.747 179.96 159.038 179.96 161.855C179.96 164.672 182.242 166.964 185.047 166.964C187.853 166.964 190.134 164.672 190.134 161.855C190.134 159.038 187.853 156.747 185.047 156.747Z" fill="#2E343F"/>\n<path d="M266.579 161.749H197.728C197.48 161.749 197.278 161.547 197.278 161.297C197.278 161.047 197.48 160.845 197.728 160.845H266.579C266.828 160.845 267.029 161.047 267.029 161.297C267.029 161.547 266.828 161.749 266.579 161.749Z" fill="#2E343F"/>\n<path d="M276.7 161.749H275.271C275.022 161.749 274.821 161.547 274.821 161.297C274.821 161.047 275.022 160.845 275.271 160.845H276.7C276.949 160.845 277.15 161.047 277.15 161.297C277.15 161.547 276.949 161.749 276.7 161.749Z" fill="#2E343F"/>\n<path d="M271.686 161.749H270.257C270.008 161.749 269.807 161.547 269.807 161.297C269.807 161.047 270.008 160.845 270.257 160.845H271.686C271.935 160.845 272.136 161.047 272.136 161.297C272.136 161.547 271.935 161.749 271.686 161.749Z" fill="#2E343F"/>\n<path d="M282.059 161.749H280.63C280.381 161.749 280.18 161.547 280.18 161.297C280.18 161.047 280.381 160.845 280.63 160.845H282.059C282.308 160.845 282.509 161.047 282.509 161.297C282.509 161.547 282.308 161.749 282.059 161.749Z" fill="#2E343F"/>\n<path d="M291.704 185.929H171.413V213.032H291.704V185.929Z" fill="#A6DDFD"/>\n<g opacity="0.5">\n<path d="M291.704 185.929H171.413V213.032H291.704V185.929Z" fill="white"/>\n</g>\n<path d="M291.704 213.484H171.413C171.164 213.484 170.963 213.282 170.963 213.032V185.929C170.963 185.679 171.164 185.477 171.413 185.477H291.704C291.953 185.477 292.154 185.679 292.154 185.929V213.032C292.154 213.282 291.953 213.484 291.704 213.484ZM171.863 212.58H291.254V186.381H171.863V212.58Z" fill="#2E343F"/>\n<path d="M185.047 205.041C188.105 205.041 190.584 202.551 190.584 199.48C190.584 196.41 188.105 193.92 185.047 193.92C181.989 193.92 179.51 196.41 179.51 199.48C179.51 202.551 181.989 205.041 185.047 205.041Z" fill="white"/>\n<path d="M185.047 205.493C181.746 205.493 179.06 202.795 179.06 199.48C179.06 196.165 181.746 193.468 185.047 193.468C188.349 193.468 191.035 196.165 191.035 199.48C191.035 202.795 188.349 205.493 185.047 205.493ZM185.047 194.373C182.242 194.373 179.96 196.664 179.96 199.481C179.96 202.298 182.242 204.589 185.047 204.589C187.853 204.589 190.134 202.298 190.134 199.481C190.134 196.664 187.853 194.373 185.047 194.373Z" fill="#2E343F"/>\n<path d="M266.579 199.374H197.728C197.48 199.374 197.278 199.172 197.278 198.922C197.278 198.672 197.48 198.47 197.728 198.47H266.579C266.828 198.47 267.029 198.672 267.029 198.922C267.029 199.172 266.828 199.374 266.579 199.374Z" fill="#2E343F"/>\n<path d="M276.7 199.374H275.271C275.022 199.374 274.821 199.172 274.821 198.922C274.821 198.672 275.022 198.47 275.271 198.47H276.7C276.949 198.47 277.15 198.672 277.15 198.922C277.15 199.172 276.949 199.374 276.7 199.374Z" fill="#2E343F"/>\n<path d="M271.686 199.374H270.257C270.008 199.374 269.807 199.172 269.807 198.922C269.807 198.672 270.008 198.47 270.257 198.47H271.686C271.935 198.47 272.136 198.672 272.136 198.922C272.136 199.172 271.935 199.374 271.686 199.374Z" fill="#2E343F"/>\n<path d="M282.059 199.374H280.63C280.381 199.374 280.18 199.172 280.18 198.922C280.18 198.672 280.381 198.47 280.63 198.47H282.059C282.308 198.47 282.509 198.672 282.509 198.922C282.509 199.172 282.308 199.374 282.059 199.374Z" fill="#2E343F"/>\n<path d="M291.704 251.109H171.413C171.164 251.109 170.963 250.907 170.963 250.657V223.554C170.963 223.305 171.164 223.103 171.413 223.103H291.704C291.953 223.103 292.154 223.305 292.154 223.554V250.657C292.154 250.907 291.953 251.109 291.704 251.109ZM171.863 250.205H291.254V224.006H171.863V250.205Z" fill="#2E343F"/>\n<path d="M245.557 223.554H120.765V250.657H245.557V223.554Z" fill="#A6DDFD"/>\n<g opacity="0.5">\n<path d="M245.557 223.554H120.765V250.657H245.557V223.554Z" fill="white"/>\n</g>\n<path d="M245.557 251.109H120.765C120.517 251.109 120.315 250.907 120.315 250.657V223.554C120.315 223.305 120.517 223.103 120.765 223.103H245.557C245.806 223.103 246.007 223.305 246.007 223.554V250.657C246.007 250.907 245.806 251.109 245.557 251.109ZM121.216 250.205H245.107V224.006H121.216V250.205Z" fill="#2E343F"/>\n<path d="M134.4 242.666C137.458 242.666 139.937 240.177 139.937 237.106C139.937 234.035 137.458 231.546 134.4 231.546C131.342 231.546 128.863 234.035 128.863 237.106C128.863 240.177 131.342 242.666 134.4 242.666Z" fill="white"/>\n<path d="M134.4 243.118C131.099 243.118 128.413 240.42 128.413 237.105C128.413 233.79 131.099 231.093 134.4 231.093C137.701 231.093 140.387 233.79 140.387 237.105C140.387 240.42 137.701 243.118 134.4 243.118ZM134.4 231.998C131.595 231.998 129.313 234.289 129.313 237.106C129.313 239.923 131.595 242.214 134.4 242.214C137.205 242.214 139.487 239.923 139.487 237.106C139.487 234.289 137.205 231.998 134.4 231.998Z" fill="#2E343F"/>\n<path d="M220.432 237H147.081C146.833 237 146.631 236.798 146.631 236.548C146.631 236.298 146.833 236.096 147.081 236.096H220.432C220.681 236.096 220.882 236.298 220.882 236.548C220.882 236.798 220.681 237 220.432 237Z" fill="#2E343F"/>\n<path d="M230.554 237H229.125C228.876 237 228.675 236.798 228.675 236.548C228.675 236.298 228.876 236.096 229.125 236.096H230.554C230.803 236.096 231.004 236.298 231.004 236.548C231.004 236.798 230.803 237 230.554 237Z" fill="#2E343F"/>\n<path d="M225.539 237H224.11C223.861 237 223.66 236.798 223.66 236.548C223.66 236.298 223.861 236.096 224.11 236.096H225.539C225.788 236.096 225.989 236.298 225.989 236.548C225.989 236.798 225.788 237 225.539 237Z" fill="#2E343F"/>\n<path d="M235.912 237H234.483C234.234 237 234.033 236.798 234.033 236.548C234.033 236.298 234.234 236.096 234.483 236.096H235.912C236.161 236.096 236.363 236.298 236.363 236.548C236.363 236.798 236.161 237 235.912 237Z" fill="#2E343F"/>\n<path d="M291.704 261.18H171.413V288.283H291.704V261.18Z" fill="#A6DDFD"/>\n<g opacity="0.5">\n<path d="M291.704 261.18H171.413V288.283H291.704V261.18Z" fill="white"/>\n</g>\n<path d="M291.704 288.735H171.413C171.164 288.735 170.963 288.533 170.963 288.283V261.18C170.963 260.93 171.164 260.728 171.413 260.728H291.704C291.953 260.728 292.154 260.93 292.154 261.18V288.283C292.154 288.533 291.953 288.735 291.704 288.735ZM171.863 287.831H291.254V261.632H171.863V287.831Z" fill="#2E343F"/>\n<path d="M185.047 280.292C188.105 280.292 190.584 277.802 190.584 274.731C190.584 271.661 188.105 269.171 185.047 269.171C181.989 269.171 179.51 271.661 179.51 274.731C179.51 277.802 181.989 280.292 185.047 280.292Z" fill="white"/>\n<path d="M185.047 280.743C181.746 280.743 179.06 278.046 179.06 274.731C179.06 271.416 181.746 268.719 185.047 268.719C188.349 268.719 191.035 271.416 191.035 274.731C191.035 278.046 188.349 280.743 185.047 280.743ZM185.047 269.623C182.242 269.623 179.96 271.914 179.96 274.731C179.96 277.548 182.242 279.84 185.047 279.84C187.853 279.84 190.134 277.548 190.134 274.731C190.134 271.914 187.853 269.623 185.047 269.623Z" fill="#2E343F"/>\n<path d="M266.579 274.625H197.728C197.48 274.625 197.278 274.423 197.278 274.173C197.278 273.923 197.48 273.721 197.728 273.721H266.579C266.828 273.721 267.029 273.923 267.029 274.173C267.029 274.423 266.828 274.625 266.579 274.625Z" fill="#2E343F"/>\n<path d="M276.7 274.625H275.271C275.022 274.625 274.821 274.423 274.821 274.173C274.821 273.923 275.022 273.721 275.271 273.721H276.7C276.949 273.721 277.15 273.923 277.15 274.173C277.15 274.423 276.949 274.625 276.7 274.625Z" fill="#2E343F"/>\n<path d="M271.686 274.625H270.257C270.008 274.625 269.807 274.423 269.807 274.173C269.807 273.923 270.008 273.721 270.257 273.721H271.686C271.935 273.721 272.136 273.923 272.136 274.173C272.136 274.423 271.935 274.625 271.686 274.625Z" fill="#2E343F"/>\n<path d="M282.059 274.625H280.63C280.381 274.625 280.18 274.423 280.18 274.173C280.18 273.923 280.381 273.721 280.63 273.721H282.059C282.308 273.721 282.509 273.923 282.509 274.173C282.509 274.423 282.308 274.625 282.059 274.625Z" fill="#2E343F"/>\n<path d="M291.704 298.805H171.413V325.908H291.704V298.805Z" fill="#A6DDFD"/>\n<g opacity="0.5">\n<path d="M291.704 298.805H171.413V325.908H291.704V298.805Z" fill="white"/>\n</g>\n<path d="M291.704 326.36H171.413C171.164 326.36 170.963 326.158 170.963 325.908V298.805C170.963 298.556 171.164 298.354 171.413 298.354H291.704C291.953 298.354 292.154 298.556 292.154 298.805V325.908C292.154 326.158 291.953 326.36 291.704 326.36ZM171.863 325.456H291.254V299.257H171.863V325.456Z" fill="#2E343F"/>\n<path d="M185.047 317.917C188.105 317.917 190.584 315.428 190.584 312.357C190.584 309.286 188.105 306.797 185.047 306.797C181.989 306.797 179.51 309.286 179.51 312.357C179.51 315.428 181.989 317.917 185.047 317.917Z" fill="white"/>\n<path d="M185.047 318.369C181.746 318.369 179.06 315.671 179.06 312.356C179.06 309.041 181.746 306.344 185.047 306.344C188.349 306.344 191.035 309.041 191.035 312.356C191.035 315.671 188.349 318.369 185.047 318.369ZM185.047 307.249C182.242 307.249 179.96 309.54 179.96 312.357C179.96 315.174 182.242 317.465 185.047 317.465C187.853 317.465 190.134 315.174 190.134 312.357C190.134 309.54 187.853 307.249 185.047 307.249Z" fill="#2E343F"/>\n<path d="M266.579 312.251H197.728C197.48 312.251 197.278 312.049 197.278 311.799C197.278 311.549 197.48 311.347 197.728 311.347H266.579C266.828 311.347 267.029 311.549 267.029 311.799C267.029 312.049 266.828 312.251 266.579 312.251Z" fill="#2E343F"/>\n<path d="M276.7 312.251H275.271C275.022 312.251 274.821 312.049 274.821 311.799C274.821 311.549 275.022 311.347 275.271 311.347H276.7C276.949 311.347 277.15 311.549 277.15 311.799C277.15 312.049 276.949 312.251 276.7 312.251Z" fill="#2E343F"/>\n<path d="M271.686 312.251H270.257C270.008 312.251 269.807 312.049 269.807 311.799C269.807 311.549 270.008 311.347 270.257 311.347H271.686C271.935 311.347 272.136 311.549 272.136 311.799C272.136 312.049 271.935 312.251 271.686 312.251Z" fill="#2E343F"/>\n<path d="M282.059 312.251H280.63C280.381 312.251 280.18 312.049 280.18 311.799C280.18 311.549 280.381 311.347 280.63 311.347H282.059C282.308 311.347 282.509 311.549 282.509 311.799C282.509 312.049 282.308 312.251 282.059 312.251Z" fill="#2E343F"/>\n<path d="M291.704 336.431H171.413V363.534H291.704V336.431Z" fill="#A6DDFD"/>\n<g opacity="0.5">\n<path d="M291.704 336.431H171.413V363.534H291.704V336.431Z" fill="white"/>\n</g>\n<path d="M291.704 363.986H171.413C171.164 363.986 170.963 363.784 170.963 363.534V336.431C170.963 336.181 171.164 335.979 171.413 335.979H291.704C291.953 335.979 292.154 336.181 292.154 336.431V363.534C292.154 363.784 291.953 363.986 291.704 363.986ZM171.863 363.082H291.254V336.883H171.863V363.082Z" fill="#2E343F"/>\n<path d="M185.047 355.543C188.105 355.543 190.584 353.053 190.584 349.983C190.584 346.912 188.105 344.422 185.047 344.422C181.989 344.422 179.51 346.912 179.51 349.983C179.51 353.053 181.989 355.543 185.047 355.543Z" fill="white"/>\n<path d="M185.047 355.994C181.746 355.994 179.06 353.297 179.06 349.982C179.06 346.667 181.746 343.97 185.047 343.97C188.349 343.97 191.035 346.667 191.035 349.982C191.035 353.297 188.349 355.994 185.047 355.994ZM185.047 344.874C182.242 344.874 179.96 347.166 179.96 349.983C179.96 352.8 182.242 355.091 185.047 355.091C187.853 355.091 190.134 352.8 190.134 349.983C190.134 347.166 187.853 344.874 185.047 344.874Z" fill="#2E343F"/>\n<path d="M266.579 349.877H197.728C197.48 349.877 197.278 349.675 197.278 349.425C197.278 349.175 197.48 348.973 197.728 348.973H266.579C266.828 348.973 267.029 349.175 267.029 349.425C267.029 349.675 266.828 349.877 266.579 349.877Z" fill="#2E343F"/>\n<path d="M276.7 349.877H275.271C275.022 349.877 274.821 349.675 274.821 349.425C274.821 349.175 275.022 348.973 275.271 348.973H276.7C276.949 348.973 277.15 349.175 277.15 349.425C277.15 349.675 276.949 349.877 276.7 349.877Z" fill="#2E343F"/>\n<path d="M271.686 349.877H270.257C270.008 349.877 269.807 349.675 269.807 349.425C269.807 349.175 270.008 348.973 270.257 348.973H271.686C271.935 348.973 272.136 349.175 272.136 349.425C272.136 349.675 271.935 349.877 271.686 349.877Z" fill="#2E343F"/>\n<path d="M282.059 349.877H280.63C280.381 349.877 280.18 349.675 280.18 349.425C280.18 349.175 280.381 348.973 280.63 348.973H282.059C282.308 348.973 282.509 349.175 282.509 349.425C282.509 349.675 282.308 349.877 282.059 349.877Z" fill="#2E343F"/>\n<path d="M48.5643 114.544C48.5643 114.544 46.5534 125.518 44.0865 128.555C36.9845 137.298 34.2818 144.527 39.4392 150.882C44.5969 157.238 82.0947 162.207 86.5985 149.723C90.3903 139.213 85.4072 137.38 85.3126 128.289C85.2699 124.176 84.8108 115.503 84.8108 115.503" fill="#181818"/>\n<path d="M79.1716 144.338C79.1063 144.329 78.3817 156.401 64.4161 155.348C54.7478 154.621 51.3007 144.321 51.0789 144.321C52.1212 144.098 53.8765 143.775 54.3396 143.526C55.8622 142.705 57.7457 141.85 58.2363 138.881C58.5189 137.17 58.0391 128.416 58.1868 126.685L73.0277 130.012C72.8202 133.668 71.3692 142.144 76.4559 143.645C77.3024 143.893 78.2138 144.121 79.1711 144.338L79.1716 144.338Z" fill="#FF9E85"/>\n<path opacity="0.22" d="M73.2361 140.18C73.0259 139.506 72.9008 138.921 72.7896 137.867C72.5907 135.983 72.6965 134.252 72.8868 132.488C69.8889 132.087 67.0103 130.82 64.6844 128.879C64.4089 129.901 62.8931 134.367 63.313 135.338C64.106 137.174 67.8335 140.181 73.2361 140.181V140.18Z" fill="#181818"/>\n<path d="M70.3606 137.704C64.4855 137.513 58.5338 134.347 57.982 126.385L56.2299 119.055C55.6781 111.093 59.3957 104.348 66.8609 103.826C74.3266 103.304 79.907 106.424 80.4583 114.386C80.4583 114.386 80.84 118.949 80.8026 120.473C80.6604 126.219 79.2756 137.994 70.3606 137.704Z" fill="#FF9E85"/>\n<path d="M80.9907 119.249C80.934 119.499 79.9902 119.36 78.7534 119.012C77.5166 118.663 76.4284 118.295 76.5121 117.988C76.6174 117.599 77.7106 117.569 78.9474 117.917C80.1842 118.266 81.0794 118.857 80.9907 119.249Z" fill="#181818"/>\n<path d="M50.0998 120.811L58.0538 124.064C63.2485 122.638 64.4952 110.516 64.4952 110.516C64.4952 110.516 69.824 117.124 84.8112 115.502C84.8112 115.502 84.2126 95.3684 61.9546 98.7534C54.7774 99.8449 48.8842 106.937 48.3999 116.413C48.0606 123.053 50.0998 120.811 50.0998 120.811Z" fill="#181818"/>\n<path d="M57.3595 128.633C55.0907 128.791 52.8989 127.728 52.6707 124.298C52.519 122.019 54.5191 120.541 56.7879 120.382L58.0629 121.827L59.3105 128.496L57.3595 128.633Z" fill="#FF9E85"/>\n<path d="M79.4509 121.855C79.5036 121.406 79.1844 121 78.7378 120.947C78.2913 120.894 77.8865 121.215 77.8338 121.663C77.781 122.111 78.1003 122.518 78.5468 122.571C78.9934 122.624 79.3981 122.303 79.4509 121.855Z" fill="#181818"/>\n<path d="M72.8441 127.151C72.6807 127.132 72.5547 126.991 72.5569 126.822C72.5592 126.641 72.7068 126.497 72.8868 126.5L74.6205 126.523L73.9706 122.963C73.9382 122.785 74.0552 122.615 74.2325 122.583C74.4094 122.55 74.5791 122.668 74.6115 122.845L75.3325 126.796C75.35 126.893 75.3235 126.992 75.2609 127.066C75.1984 127.141 75.1052 127.183 75.008 127.182L72.8783 127.154C72.8666 127.154 72.8553 127.153 72.8441 127.151Z" fill="#181818"/>\n<path d="M71.7995 130.734C68.8551 130.94 67.8546 129.215 67.8096 129.134C67.7219 128.977 67.7777 128.778 67.9343 128.689C68.09 128.601 68.2876 128.657 68.3763 128.813C68.4186 128.886 69.4393 130.578 72.6523 129.961C72.8324 129.926 72.9998 130.044 73.0335 130.221C73.0673 130.398 72.9512 130.57 72.7748 130.604C72.4282 130.67 72.1033 130.712 71.799 130.733L71.7995 130.734Z" fill="#181818"/>\n<path d="M71.1924 117.915C71.2414 118.166 70.3228 118.424 69.0519 118.609C67.7809 118.794 66.6372 118.901 66.5895 118.586C66.5292 118.188 67.5158 117.715 68.7868 117.529C70.0578 117.344 71.115 117.52 71.1924 117.915Z" fill="#181818"/>\n<path d="M70.9262 121.295C70.979 120.846 70.6597 120.44 70.2132 120.387C69.7666 120.334 69.3619 120.655 69.3091 121.103C69.2564 121.552 69.5756 121.958 70.0222 122.011C70.4687 122.064 70.8735 121.743 70.9262 121.295Z" fill="#181818"/>\n<path d="M53.9736 118.486L53.5078 121.571C54.1766 120.933 55.0803 120.542 56.0763 120.541C56.3243 120.538 56.566 120.57 56.8005 120.617C58.1372 121.966 56.8374 123.984 58.0539 124.064C58.7448 124.109 60.5018 122.668 60.9956 121.702C61.3088 121.09 59.8821 118.431 59.9712 117.749" fill="#181818"/>\n<path d="M34.8076 364.656C34.8076 364.656 29.7736 372.127 35.2658 378.34C40.7579 384.553 34.8395 387.953 34.8395 387.953L12.5234 365.544L23.6729 354.348L34.8076 364.655V364.656Z" fill="#A6DDFD"/>\n<path d="M35.994 210.978C35.994 210.978 36.093 208.315 36.0723 214.355C36.0376 224.385 36.9877 250.89 36.3203 285.05C35.7865 312.357 16.8567 359.215 16.8567 359.215L33.93 371.521C33.93 371.521 59.6121 329.692 63.6879 288.283C65.7744 267.086 70.0424 210.062 70.0424 210.062L35.9944 210.977L35.994 210.978Z" fill="#181818"/>\n<path d="M88.6778 372.549C88.6778 372.549 90.3795 381.406 98.6378 381.9C106.896 382.393 105.105 389 105.105 389H73.5457V373.167L88.6773 372.549L88.6778 372.549Z" fill="#A6DDFD"/>\n<path d="M92.6894 212.727C92.6894 212.727 95.2799 289.725 95.0108 293.488L92.575 377.619L72.1798 377.997L68.8912 290.446C68.8912 290.446 66.7354 266.295 60.9246 243.868C57.9429 232.361 56.1709 220.572 55.585 208.696L92.6903 212.727L92.6894 212.727Z" fill="#181818"/>\n<g style="mix-blend-mode:plus-darker">\n<path d="M65.783 267.318L67.4838 241.202C67.4838 241.202 69.2305 252.059 69.2305 261.418C69.2305 265.992 68.2921 284.102 68.2921 284.102L65.783 267.318Z" fill="#181818"/>\n</g>\n<path d="M35.7682 210.976L35.7004 210.979C35.7004 210.979 35.7494 209.666 35.7682 210.976Z" fill="#39404D"/>\n<path d="M35.8539 210.976L35.7861 210.979C35.7861 210.979 35.8351 209.666 35.8539 210.976Z" fill="#39404D"/>\n<path d="M95.6935 169.989C95.2659 175.034 93.1852 206.513 92.7743 212.727H36.1019C35.7819 207.122 34.3444 182.612 33.1302 171.651C31.9712 161.191 29.6975 155.955 31.3641 152.863C34.0874 147.809 41.5293 144.889 46.6033 144.198C49.7021 143.777 54.3625 143.475 54.3625 143.475C54.3625 143.475 54.7572 151.491 64.1663 151.937C76.9747 152.544 76.1192 143.475 76.1826 143.475C78.2574 143.475 90.1113 144.794 93.0111 146.521C100.913 151.22 96.6008 159.296 95.693 169.989L95.6935 169.989Z" fill="#A6DDFD"/>\n<path d="M138.769 179.213C139.043 178.455 139.895 178.076 140.644 178.394C141.346 178.693 141.65 179.533 141.39 180.253L140.741 182.048L144.816 177.876C145.322 177.342 146.283 177.012 146.842 177.622C147.326 178.085 148.446 178.228 148.628 179.096C148.634 179.1 148.623 187.043 148.153 187.538C146.16 189.64 141.343 190.046 138.656 188.979L134.426 187.299L138.769 179.213Z" fill="#FF9E85"/>\n<g opacity="0.1">\n<path d="M138.769 179.213C139.043 178.455 139.895 178.076 140.644 178.394C141.346 178.693 141.65 179.533 141.39 180.253L140.741 182.048L144.816 177.876C145.322 177.342 146.283 177.012 146.842 177.622C147.326 178.085 148.446 178.228 148.628 179.096C148.634 179.1 148.623 187.043 148.153 187.538C146.16 189.64 141.343 190.046 138.656 188.979L134.426 187.299L138.769 179.213Z" fill="#181818"/>\n</g>\n<path d="M115.525 160.953L115.581 163.796C115.606 165.083 114.553 165.944 113.228 165.72L84.0357 160.774C82.7107 160.549 81.6571 161.41 81.6827 162.697L78.9868 200.228C79.0125 201.515 80.107 202.74 81.4325 202.965L138.187 212.997C139.512 213.221 140.565 212.36 140.54 211.073L141.705 165.613C141.679 164.326 140.585 163.101 139.259 162.876L117.878 159.03C116.553 158.805 115.499 159.666 115.525 160.953Z" fill="#181818"/>\n<path d="M138.594 213.483C138.435 213.483 138.274 213.47 138.112 213.442L81.3543 203.409C79.8317 203.152 78.5666 201.728 78.5369 200.236L81.2341 162.664C81.2184 161.967 81.4979 161.311 82.0199 160.859C82.5641 160.388 83.3265 160.195 84.1109 160.327L113.303 165.273C113.832 165.364 114.312 165.248 114.657 164.949C114.972 164.676 115.141 164.269 115.131 163.805L115.075 160.962C115.061 160.223 115.34 159.567 115.862 159.115C116.406 158.644 117.169 158.452 117.953 158.583L139.34 162.431C140.887 162.693 142.125 164.088 142.156 165.604L140.99 211.084C141.005 211.802 140.726 212.458 140.204 212.91C139.773 213.284 139.204 213.483 138.595 213.483H138.594ZM83.619 161.19C83.2275 161.19 82.8769 161.311 82.6082 161.544C82.2927 161.817 82.1239 162.223 82.1329 162.688L79.4356 200.26C79.4581 201.297 80.3866 202.329 81.5073 202.518L138.265 212.552C138.79 212.641 139.271 212.524 139.615 212.226C139.93 211.953 140.099 211.546 140.09 211.082L141.255 165.602C141.234 164.544 140.305 163.512 139.185 163.322L117.798 159.474C117.277 159.386 116.795 159.501 116.45 159.8C116.135 160.073 115.966 160.479 115.975 160.944L116.031 163.787C116.046 164.525 115.766 165.181 115.244 165.634C114.701 166.105 113.939 166.298 113.153 166.165L83.9611 161.219C83.844 161.199 83.7302 161.19 83.619 161.19Z" fill="#39404D"/>\n<path d="M132.968 203.543L86.7026 197.628L94.3799 137.08L131.796 141.864L139.467 152.291L132.968 203.543Z" fill="white"/>\n<path d="M132.968 203.995C132.949 203.995 132.93 203.994 132.911 203.992L86.6459 198.076C86.3992 198.045 86.2246 197.819 86.2561 197.571L93.9334 137.023C93.9487 136.904 94.0099 136.796 94.1044 136.722C94.1993 136.65 94.3182 136.618 94.4365 136.632L131.853 141.416C131.975 141.432 132.085 141.497 132.158 141.596L139.829 152.022C139.898 152.115 139.928 152.232 139.914 152.347L133.415 203.6C133.401 203.719 133.339 203.827 133.244 203.9C133.165 203.962 133.068 203.995 132.969 203.995L132.968 203.995ZM87.2058 197.237L132.578 203.038L138.997 152.413L131.548 142.289L94.7687 137.586L87.2058 197.237Z" fill="#39404D"/>\n<path d="M131.796 141.864L130.635 151.021L139.467 152.291L131.796 141.864Z" fill="white"/>\n<path d="M139.467 152.742C139.446 152.742 139.424 152.741 139.403 152.738L130.571 151.468C130.327 151.433 130.157 151.209 130.188 150.964L131.349 141.807C131.372 141.624 131.504 141.474 131.682 141.427C131.858 141.38 132.048 141.447 132.158 141.596L139.829 152.022C139.936 152.168 139.946 152.366 139.853 152.521C139.771 152.659 139.623 152.742 139.467 152.742V152.742ZM131.137 150.637L138.465 151.69L132.1 143.039L131.136 150.637H131.137Z" fill="#39404D"/>\n<path d="M131.135 203.948L87.4419 187.568L108.701 130.387L144.036 143.633L149.131 155.545L131.135 203.948Z" fill="#A6DDFD"/>\n<g opacity="0.43">\n<path d="M131.135 203.948L87.4419 187.568L108.701 130.387L144.036 143.633L149.131 155.545L131.135 203.948Z" fill="white"/>\n</g>\n<path d="M131.136 204.4C131.084 204.4 131.03 204.39 130.978 204.371L87.2844 187.992C87.1723 187.95 87.0819 187.865 87.0319 187.756C86.9829 187.647 86.9784 187.523 87.0202 187.41L108.279 130.229C108.366 129.995 108.625 129.877 108.858 129.964L144.194 143.211C144.309 143.253 144.402 143.342 144.45 143.455L149.544 155.366C149.59 155.473 149.593 155.594 149.552 155.703L131.557 204.107C131.49 204.288 131.318 204.4 131.135 204.4L131.136 204.4ZM88.0207 187.303L130.872 203.367L148.646 155.556L143.699 143.989L108.965 130.967L88.0207 187.302V187.303Z" fill="#39404D"/>\n<path d="M144.036 143.633L140.822 152.281L149.131 155.545L144.036 143.633Z" fill="white"/>\n<path d="M149.131 155.996C149.076 155.996 149.02 155.987 148.967 155.966L140.658 152.702C140.429 152.612 140.314 152.354 140.4 152.123L143.616 143.475C143.68 143.302 143.842 143.186 144.026 143.182H144.037C144.216 143.182 144.379 143.289 144.451 143.455L149.544 155.366C149.616 155.533 149.58 155.728 149.454 155.859C149.368 155.948 149.25 155.996 149.131 155.996ZM141.398 152.023L148.292 154.73L144.065 144.847L141.398 152.023H141.398Z" fill="#39404D"/>\n<path d="M140.796 160.541C140.744 160.541 140.691 160.532 140.639 160.513L108.303 148.381C108.07 148.294 107.952 148.033 108.039 147.8C108.126 147.566 108.385 147.448 108.618 147.535L140.953 159.666C141.186 159.753 141.304 160.014 141.217 160.247C141.15 160.429 140.978 160.541 140.796 160.541H140.796Z" fill="#39404D"/>\n<path d="M138.401 166.527C138.349 166.527 138.295 166.517 138.243 166.498L105.908 154.367C105.675 154.28 105.557 154.019 105.644 153.786C105.731 153.551 105.99 153.434 106.222 153.52L138.558 165.652C138.791 165.739 138.909 166 138.822 166.233C138.755 166.415 138.583 166.527 138.4 166.527H138.401Z" fill="#39404D"/>\n<path d="M136.154 172.537C136.102 172.537 136.049 172.528 135.997 172.509L103.661 160.378C103.428 160.29 103.31 160.03 103.397 159.796C103.484 159.562 103.744 159.444 103.976 159.531L136.311 171.663C136.545 171.75 136.663 172.011 136.576 172.244C136.508 172.425 136.337 172.537 136.154 172.537H136.154Z" fill="#39404D"/>\n<path d="M122.242 160.953L121.748 163.796C121.524 165.083 120.304 165.944 119.022 165.719L90.7873 160.773C89.5055 160.549 88.2854 161.41 88.0617 162.697L81.4673 200.654C81.2437 201.941 82.1015 203.166 83.3833 203.391L138.218 212.997C139.5 213.221 140.72 212.36 140.944 211.073L142.585 201.624L147.943 170.786L148.841 165.613C149.065 164.326 148.207 163.101 146.925 162.876L124.967 159.029C123.685 158.805 122.465 159.666 122.241 160.953H122.242Z" fill="white"/>\n<path d="M138.624 213.484C138.465 213.484 138.303 213.47 138.141 213.442L83.3059 203.836C81.7819 203.568 80.7585 202.106 81.0245 200.576L87.6184 162.62C87.7471 161.878 88.1553 161.232 88.7692 160.799C89.3822 160.366 90.1262 160.2 90.8647 160.328L119.099 165.274C119.6 165.362 120.106 165.249 120.523 164.955C120.939 164.661 121.216 164.222 121.304 163.718L121.798 160.876C121.927 160.134 122.335 159.488 122.949 159.055C123.562 158.622 124.306 158.457 125.044 158.585L147.003 162.432C147.741 162.561 148.385 162.971 148.816 163.587C149.247 164.203 149.413 164.95 149.284 165.691L141.387 211.151C141.149 212.518 139.961 213.484 138.624 213.484L138.624 213.484ZM90.3782 161.19C89.9898 161.19 89.6113 161.309 89.2864 161.538C88.87 161.832 88.5928 162.271 88.5055 162.775L81.9116 200.731C81.7311 201.77 82.426 202.763 83.4607 202.945L138.296 212.551C139.332 212.732 140.32 212.033 140.5 210.995L148.398 165.535C148.578 164.496 147.883 163.503 146.849 163.322L124.89 159.475C123.851 159.292 122.865 159.992 122.685 161.031L122.191 163.873C122.062 164.615 121.654 165.261 121.04 165.694C120.427 166.126 119.683 166.292 118.945 166.164L90.7104 161.218C90.5997 161.199 90.4889 161.189 90.3787 161.189L90.3782 161.19Z" fill="#39404D"/>\n<path d="M142.76 184.18C142.925 183.597 143.415 183.357 143.87 183.337C143.867 183.316 143.845 183.27 143.88 183.266L143.015 182.844C142.492 182.589 142.193 181.985 142.381 181.432C142.576 180.859 143.158 180.564 143.704 180.689C143.7 180.678 143.706 180.667 143.705 180.655L143.35 180.482C142.858 180.242 142.568 179.688 142.71 179.157C142.901 178.443 143.672 178.114 144.3 178.42L145.121 178.82C145.123 178.816 145.12 178.811 145.122 178.806C145.124 178.801 145.132 178.799 145.135 178.794C144.731 178.47 144.588 177.899 144.824 177.413C145.073 176.796 145.889 176.773 146.42 177.031L148.029 177.977C148.533 178.273 148.855 178.803 148.889 179.389C149.032 181.884 149.251 188.411 147.558 187.585L143.388 185.552C142.907 185.317 142.614 184.697 142.76 184.18Z" fill="#FF9E85"/>\n<path d="M96.1462 194.76C96.1053 194.156 95.6926 193.701 95.1732 193.552C95.1826 193.53 95.1921 193.507 95.1867 193.481C95.1768 193.436 95.1426 193.41 95.1034 193.397L96.2174 193.148C96.8907 192.998 97.401 192.384 97.3349 191.695C97.2665 190.98 96.6755 190.479 96.0117 190.472C96.0189 190.461 96.0157 190.446 96.0193 190.433L96.477 190.331C97.1103 190.19 97.5959 189.63 97.577 188.979C97.5518 188.103 96.752 187.51 95.9442 187.69L94.8879 187.926C94.8879 187.92 94.8924 187.915 94.891 187.91C94.8901 187.902 94.8816 187.898 94.8793 187.891C95.4333 187.629 95.7547 187.01 95.6165 186.384C95.4972 185.603 94.562 185.352 93.8793 185.504L87.716 186.765L89.1783 185.691C89.7648 185.261 89.9691 184.434 89.5717 183.823C89.1477 183.172 88.2732 183.018 87.6562 183.471L79.672 189.333C77.7246 190.763 77.2632 193.489 78.631 195.484C80.1918 197.761 82.9723 198.86 85.6597 198.261L95.0472 196.169C95.6665 196.031 96.1903 195.395 96.1471 194.76H96.1462Z" fill="#FF9E85"/>\n<g opacity="0.25">\n<path d="M88.789 189.169C88.8039 189.235 88.8687 189.277 88.9344 189.263L94.7943 188.056C94.8613 188.042 94.9041 187.977 94.8906 187.91C94.8829 187.845 94.8114 187.799 94.7443 187.813L88.8844 189.019C88.8174 189.034 88.7746 189.099 88.7881 189.166V189.169H88.789Z" fill="#181818"/>\n</g>\n<g opacity="0.25">\n<path d="M89.2475 191.779C89.2624 191.844 89.3272 191.886 89.3929 191.873L95.9324 190.526C95.9994 190.512 96.0422 190.446 96.0287 190.379C96.0156 190.318 95.9495 190.269 95.8824 190.282L89.3429 191.629C89.2759 191.643 89.2331 191.709 89.2466 191.776V191.779H89.2475Z" fill="#181818"/>\n</g>\n<g opacity="0.25">\n<path d="M89.7282 194.608C89.7431 194.674 89.8079 194.716 89.8736 194.702L95.0903 193.628C95.1574 193.614 95.2001 193.548 95.1866 193.481C95.1713 193.413 95.1074 193.371 95.0404 193.384L89.8237 194.459C89.7566 194.473 89.7138 194.538 89.7273 194.605V194.608H89.7282Z" fill="#181818"/>\n</g>\n<path d="M85.0782 201.992L34.1451 211.235C33.7706 211.275 33.3966 211.296 33.0249 211.296C30.193 211.296 27.4647 210.127 25.4993 208.035C23.2751 205.668 22.2845 202.391 22.8219 199.181L29.9523 156.622C30.9006 150.963 36.2365 147.149 41.8727 148.1C47.508 149.052 51.3079 154.411 50.3596 160.07L45.4976 189.367L82.8392 184.658L85.0782 201.992Z" fill="#A6DDFD"/>\n<path d="M34.1445 211.424C34.055 211.424 33.9758 211.36 33.9596 211.268C33.9411 211.166 34.0091 211.067 34.1117 211.048L84.8684 201.838L82.6761 184.87L45.5209 189.555C45.4592 189.563 45.4025 189.542 45.3616 189.499C45.3206 189.455 45.3017 189.396 45.3116 189.337L48.4027 170.612C48.4198 170.509 48.5156 170.436 48.6196 170.456C48.7222 170.473 48.7915 170.571 48.7744 170.674L45.7248 189.148L82.8157 184.471C82.9165 184.458 83.0128 184.53 83.0263 184.634L85.2654 201.967C85.2784 202.068 85.2109 202.16 85.1119 202.178L34.1787 211.421C34.1675 211.423 34.1558 211.424 34.1445 211.424Z" fill="#181818"/>\n<path d="M45.469 189.181L42.1929 189.708L42.2525 190.082L45.5287 189.555L45.469 189.181Z" fill="#181818"/>\n<path d="M365.914 312.703H341.214V311.799H365.914C378.557 311.799 388.843 301.47 388.843 288.774V129.537H389.743V288.774C389.743 301.968 379.053 312.703 365.914 312.703Z" fill="#39404D"/>\n<path d="M389.293 160.59C390.89 160.59 392.185 159.29 392.185 157.687C392.185 156.083 390.89 154.783 389.293 154.783C387.696 154.783 386.401 156.083 386.401 157.687C386.401 159.29 387.696 160.59 389.293 160.59Z" fill="white"/>\n<path d="M389.293 161.042C387.451 161.042 385.951 159.537 385.951 157.687C385.951 155.836 387.451 154.331 389.293 154.331C391.136 154.331 392.635 155.836 392.635 157.687C392.635 159.537 391.136 161.042 389.293 161.042ZM389.293 155.234C387.947 155.234 386.852 156.334 386.852 157.687C386.852 159.039 387.947 160.138 389.293 160.138C390.639 160.138 391.735 159.038 391.735 157.687C391.735 156.335 390.64 155.234 389.293 155.234Z" fill="#2E343F"/>\n<path d="M389.293 201.459C390.89 201.459 392.185 200.159 392.185 198.555C392.185 196.951 390.89 195.651 389.293 195.651C387.696 195.651 386.401 196.951 386.401 198.555C386.401 200.159 387.696 201.459 389.293 201.459Z" fill="#2E343F"/>\n<path d="M389.293 201.911C387.451 201.911 385.951 200.406 385.951 198.555C385.951 196.704 387.451 195.199 389.293 195.199C391.136 195.199 392.635 196.705 392.635 198.555C392.635 200.405 391.136 201.911 389.293 201.911ZM389.293 196.103C387.947 196.103 386.852 197.203 386.852 198.555C386.852 199.907 387.947 201.007 389.293 201.007C390.639 201.007 391.735 199.907 391.735 198.555C391.735 197.203 390.64 196.103 389.293 196.103Z" fill="white"/>\n<path d="M389.293 242.327C390.89 242.327 392.185 241.027 392.185 239.423C392.185 237.819 390.89 236.519 389.293 236.519C387.696 236.519 386.401 237.819 386.401 239.423C386.401 241.027 387.696 242.327 389.293 242.327Z" fill="white"/>\n<path d="M389.293 242.779C387.451 242.779 385.951 241.274 385.951 239.423C385.951 237.572 387.451 236.067 389.293 236.067C391.136 236.067 392.635 237.572 392.635 239.423C392.635 241.274 391.136 242.779 389.293 242.779ZM389.293 236.971C387.947 236.971 386.852 238.071 386.852 239.423C386.852 240.775 387.947 241.875 389.293 241.875C390.639 241.875 391.735 240.775 391.735 239.423C391.735 238.071 390.64 236.971 389.293 236.971Z" fill="#2E343F"/>\n<path d="M389.293 283.195C390.89 283.195 392.185 281.895 392.185 280.292C392.185 278.688 390.89 277.388 389.293 277.388C387.696 277.388 386.401 278.688 386.401 280.292C386.401 281.895 387.696 283.195 389.293 283.195Z" fill="white"/>\n<path d="M389.293 283.647C387.451 283.647 385.951 282.142 385.951 280.291C385.951 278.441 387.451 276.936 389.293 276.936C391.136 276.936 392.635 278.441 392.635 280.291C392.635 282.141 391.136 283.647 389.293 283.647ZM389.293 277.839C387.947 277.839 386.852 278.939 386.852 280.291C386.852 281.643 387.947 282.743 389.293 282.743C390.639 282.743 391.735 281.643 391.735 280.291C391.735 278.939 390.64 277.839 389.293 277.839Z" fill="#2E343F"/>\n<path d="M367.197 315.261C368.794 315.261 370.089 313.961 370.089 312.357C370.089 310.753 368.794 309.453 367.197 309.453C365.6 309.453 364.305 310.753 364.305 312.357C364.305 313.961 365.6 315.261 367.197 315.261Z" fill="#2E343F"/>\n<path d="M367.198 315.713C365.355 315.713 363.855 314.207 363.855 312.357C363.855 310.506 365.355 309.001 367.198 309.001C369.041 309.001 370.539 310.506 370.539 312.357C370.539 314.207 369.04 315.713 367.198 315.713ZM367.198 309.905C365.851 309.905 364.756 311.005 364.756 312.357C364.756 313.708 365.851 314.809 367.198 314.809C368.544 314.809 369.639 313.709 369.639 312.357C369.639 311.004 368.544 309.905 367.198 309.905Z" fill="white"/>\n<path d="M0.450067 388.857H418.174C418.423 388.857 418.625 388.654 418.625 388.405C418.625 388.155 418.423 387.953 418.174 387.953H0.450067C0.20163 387.953 0 388.155 0 388.405C0 388.654 0.20163 388.857 0.450067 388.857Z" fill="#2E343F"/>\n</g>\n<defs>\n<clipPath id="clip0_5227_2009">\n<rect width="448" height="362" fill="white" transform="translate(0 27)"/>\n</clipPath>\n</defs>\n</svg>\n',
@@ -2289,11 +2322,11 @@ DropdownItem.displayName = "DropdownItem";
2289
2322
  },
2290
2323
  {
2291
2324
  "name": "statusCardVariants.ts",
2292
- "content": 'import { tv } from "tailwind-variants";\n\nexport const statusCardVariants = tv({\n slots: {\n card: [\n "px-4 py-2 rounded-md transition-colors duration-200 border bg-white",\n "flex items-center justify-between gap-4 w-full",\n "dark:bg-iridium dark:border-secondary-500"\n ],\n iconWrapper: "w-8 h-8 flex items-center justify-center rounded-full shrink-0 dark:bg-secondary-600",\n icon: "cursor-pointer"\n },\n variants: {\n state: {\n default: { card: "border-secondary-100 dark:border-secondary-100" },\n success: { card: "border-success-500 dark:border-success-400" },\n error: { card: "border-error-500 dark:border-error-400" },\n warning: { card: "border-warning-500 dark:border-warning-400" }\n },\n fileState: {\n primary: {\n iconWrapper: "bg-primary-50",\n icon: "text-primary-500 dark:text-primary-400"\n },\n success: {\n iconWrapper: "bg-success-50",\n icon: "text-success-500 dark:text-success-400"\n },\n error: {\n iconWrapper: "bg-error-50",\n icon: "text-error-500 dark:text-error-400"\n },\n warning: {\n iconWrapper: "bg-warning-50",\n icon: "text-warning-500 dark:text-warning-400"\n }\n },\n disabled: {\n true: {\n icon: "text-secondary-300 cursor-not-allowed hover:text-secondary-300 dark:text-secondary-400"\n }\n }\n },\n defaultVariants: {\n state: "default",\n disabled: false\n }\n});\n'
2325
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const statusCardVariants = tv({\n slots: {\n card: [\n "px-4 py-2 rounded-md transition-colors duration-200 border bg-white",\n "flex items-center justify-between gap-4 w-full",\n "dark:bg-iridium dark:border-secondary-500"\n ],\n iconWrapper: "w-8 h-8 flex items-center justify-center rounded-full shrink-0 dark:bg-secondary-600",\n icon: "cursor-pointer"\n },\n variants: {\n state: {\n default: { card: "border-secondary-100 dark:border-secondary-100" },\n success: { card: "border-success-500 dark:border-success-400" },\n error: { card: "border-error-500 dark:border-error-400" },\n warning: { card: "border-warning-500 dark:border-warning-400" }\n },\n fileState: {\n primary: {\n iconWrapper: "bg-primary-100",\n icon: "text-primary-700 dark:text-primary-400"\n },\n success: {\n iconWrapper: "bg-success-100",\n icon: "text-success-700 dark:text-success-400"\n },\n error: {\n iconWrapper: "bg-error-100",\n icon: "text-error-700 dark:text-error-400"\n },\n warning: {\n iconWrapper: "bg-warning-100",\n icon: "text-warning-700 dark:text-warning-400"\n }\n },\n disabled: {\n true: {\n icon: "text-secondary-300 cursor-not-allowed hover:text-secondary-300 dark:text-secondary-400"\n }\n }\n },\n defaultVariants: {\n state: "default",\n disabled: false\n }\n});\n'
2293
2326
  },
2294
2327
  {
2295
2328
  "name": "statusCard.tsx",
2296
- "content": 'import * as React from "react";\nimport { readableFileSize } from "@utils";\nimport { ADPIcon, type TIconType } from "../adpIcon";\nimport { Progress } from "../progress";\nimport { Tooltip } from "../tooltip";\nimport { Button } from "../button";\nimport { statusCardVariants } from "./statusCardVariants";\n\nexport interface IStatusCardProps {\n fileEntry: { file: File; state: string };\n uploadState: Record<\n string,\n { error: boolean; helperText?: React.ReactNode; progress: number; uploading: boolean }\n > | null;\n maxFileSize?: number;\n disabled: boolean;\n acceptedExtensions: string[];\n removeFile: ( fileName: string ) => void;\n}\n\nexport const StatusCard = React.forwardRef<\n HTMLDivElement,\n IStatusCardProps\n>((\n {\n fileEntry,\n uploadState,\n maxFileSize,\n disabled,\n acceptedExtensions,\n removeFile\n },\n ref\n) => {\n const { file, state } = fileEntry;\n const { progress = null, helperText = "", error = false, uploading = false } =\n uploadState?.[file.name] ?? {};\n\n // Determine file state for icon and progress\n const fileState = React.useMemo<"primary" | "warning" | "error" | "success">(\n () => {\n const statusObj = uploadState?.[file.name];\n if ( !statusObj ) {\n return state as "primary" | "warning";\n }\n if ( statusObj.error ) {\n return "error";\n }\n if ( statusObj.progress === 100 ) {\n return "success";\n }\n return state as "primary" | "warning";\n },\n [ file.name, state, uploadState ]\n );\n\n // Map primary to default variant\n const cardState =\n fileState === "primary"\n ? "default"\n : ( fileState as "default" | "warning" | "error" | "success" );\n\n const iconTypes: Record<string, TIconType> = {\n default: "document-upload",\n primary: "document-upload",\n success: "check-circle-filled",\n error: "times-circle-filled",\n warning: "danger"\n };\n\n const helperIcon = !acceptedExtensions.includes(\n `.${file.name.split( "." ).pop()?.toLowerCase()}`\n ) || ( maxFileSize && file.size > maxFileSize )\n ? "alert-filled"\n : error\n ? "times-circle-filled"\n : progress === 100\n ? "check-circle-filled"\n : uploading\n ? "spinner"\n : null;\n\n const helperMessage = (\n <>\n {!helperText && helperIcon && (\n <ADPIcon\n icon={helperIcon}\n className={\n !acceptedExtensions.includes(\n `.${file.name.split( "." ).pop()?.toLowerCase()}`\n ) || ( maxFileSize && file.size > maxFileSize )\n ? "text-warning-500 dark:text-warning-400"\n : progress === 100\n ? "text-success-400 dark:text-success-400"\n : error\n ? "text-error-400 dark:text-error-400"\n : undefined\n }\n size="xs"\n spin={\n !acceptedExtensions.includes(\n `.${file.name.split( "." ).pop()?.toLowerCase()}`\n ) || ( maxFileSize && file.size > maxFileSize )\n ? false\n : uploading\n }\n />\n )}\n <span>\n {!acceptedExtensions.includes(\n `.${file.name.split( "." ).pop()?.toLowerCase()}`\n )\n ? "The file type is not accepted"\n : maxFileSize && file.size > maxFileSize\n ? `The size of the file is more than ${readableFileSize(\n maxFileSize\n )}`\n : progress === 100\n ? "File uploaded successfully"\n : error\n ? helperText\n : ( progress ?? 0 ) < 100 && uploading\n ? "Uploading file..."\n : helperText}\n </span>\n </>\n );\n\n const { card, iconWrapper, icon } = statusCardVariants({ state: cardState, fileState, disabled });\n\n return (\n <div ref={ref}>\n <div className={card()}>\n <div className={iconWrapper()}>\n <ADPIcon\n className={icon()}\n size="xs"\n icon={iconTypes[fileState] as TIconType}\n />\n </div>\n <div className="flex flex-col w-full me-4 md:me-8">\n <div className="flex gap-1 text-sm mb-1">\n <Tooltip\n title="File Name"\n trigger={\n <span className="text-sm font-medium text-secondary-500 dark:text-secondary-50">\n {file.name.length > 30\n ? `${file.name.substring( 0, 30 )}...`\n : file.name}\n </span>\n }\n >\n {file.name}\n </Tooltip>\n </div>\n {fileState !== "error" && ( !maxFileSize || file.size <= maxFileSize ) && fileState !== "warning" && (\n <Progress\n variant="linear"\n value={progress ?? 0}\n color={\n error\n ? "error"\n : state === "warning"\n ? "primary"\n : progress === 100\n ? "success"\n : "primary"\n }\n showPercentage\n />\n )}\n </div>\n <Button\n variant="text"\n prefixIcon="cross"\n size="xs"\n disabled={disabled}\n className="text-gray-800 dark:text-gray-300"\n title={`Remove ${file.name}`}\n onClick={() => removeFile( file.name )}\n />\n </div>\n <p className="text-secondary-400 text-sm mt-2 flex items-center gap-2 dark:text-secondary-50">\n {helperMessage}\n </p>\n </div>\n );\n});\n\nStatusCard.displayName = "StatusCard";\n'
2329
+ "content": 'import * as React from "react";\nimport { readableFileSize } from "@utils";\nimport { ADPIcon, type TIconType } from "../adpIcon";\nimport { Progress } from "../progress";\nimport { Tooltip } from "../tooltip";\nimport { Button } from "../button";\nimport { statusCardVariants } from "./statusCardVariants";\n\nexport interface IStatusCardProps {\n fileEntry: { file: File; state: string };\n uploadState: Record<\n string,\n { error: boolean; helperText?: React.ReactNode; progress: number; uploading: boolean }\n > | null;\n maxFileSize?: number;\n disabled: boolean;\n acceptedExtensions: string[];\n removeFile: ( fileName: string ) => void;\n}\n\nexport const StatusCard = React.forwardRef<\n HTMLDivElement,\n IStatusCardProps\n>((\n {\n fileEntry,\n uploadState,\n maxFileSize,\n disabled,\n acceptedExtensions,\n removeFile\n },\n ref\n) => {\n const { file, state } = fileEntry;\n const { progress = null, helperText = "", error = false, uploading = false } =\n uploadState?.[file.name] ?? {};\n\n // Determine file state for icon and progress\n const fileState = React.useMemo<"primary" | "warning" | "error" | "success">(\n () => {\n const statusObj = uploadState?.[file.name];\n if ( !statusObj ) {\n return state as "primary" | "warning";\n }\n if ( statusObj.error ) {\n return "error";\n }\n if ( statusObj.progress === 100 ) {\n return "success";\n }\n return state as "primary" | "warning";\n },\n [ file.name, state, uploadState ]\n );\n\n // Map primary to default variant\n const cardState =\n fileState === "primary"\n ? "default"\n : ( fileState as "default" | "warning" | "error" | "success" );\n\n const iconTypes: Record<string, TIconType> = {\n default: "document-upload",\n primary: "document-upload",\n success: "check-circle-filled",\n error: "times-circle-filled",\n warning: "danger"\n };\n\n const helperIcon = !acceptedExtensions.includes(\n `.${file.name.split( "." ).pop()?.toLowerCase()}`\n ) || ( maxFileSize && file.size > maxFileSize )\n ? "alert-filled"\n : error\n ? "times-circle-filled"\n : progress === 100\n ? "check-circle-filled"\n : uploading\n ? "spinner"\n : null;\n\n const helperMessage = (\n <>\n {!helperText && helperIcon && (\n <ADPIcon\n icon={helperIcon}\n className={\n !acceptedExtensions.includes(\n `.${file.name.split( "." ).pop()?.toLowerCase()}`\n ) || ( maxFileSize && file.size > maxFileSize )\n ? "text-warning-700 dark:text-warning-400"\n : progress === 100\n ? "text-success-700 dark:text-success-400"\n : error\n ? "text-error-700 dark:text-error-400"\n : undefined\n }\n size="xs"\n spin={\n !acceptedExtensions.includes(\n `.${file.name.split( "." ).pop()?.toLowerCase()}`\n ) || ( maxFileSize && file.size > maxFileSize )\n ? false\n : uploading\n }\n />\n )}\n <span>\n {!acceptedExtensions.includes(\n `.${file.name.split( "." ).pop()?.toLowerCase()}`\n )\n ? "The file type is not accepted"\n : maxFileSize && file.size > maxFileSize\n ? `The size of the file is more than ${readableFileSize(\n maxFileSize\n )}`\n : progress === 100\n ? "File uploaded successfully"\n : error\n ? helperText\n : ( progress ?? 0 ) < 100 && uploading\n ? "Uploading file..."\n : helperText}\n </span>\n </>\n );\n\n const { card, iconWrapper, icon } = statusCardVariants({ state: cardState, fileState, disabled });\n\n return (\n <div ref={ref}>\n <div className={card()}>\n <div className={iconWrapper()}>\n <ADPIcon\n className={icon()}\n size="xs"\n icon={iconTypes[fileState] as TIconType}\n />\n </div>\n <div className="flex flex-col w-full me-4 md:me-8">\n <div className="flex gap-1 text-sm mb-1">\n <Tooltip\n title="File Name"\n trigger={\n <span className="text-sm font-medium text-secondary-500 dark:text-secondary-50">\n {file.name.length > 30\n ? `${file.name.substring( 0, 30 )}...`\n : file.name}\n </span>\n }\n >\n {file.name}\n </Tooltip>\n </div>\n {fileState !== "error" && ( !maxFileSize || file.size <= maxFileSize ) && fileState !== "warning" && (\n <Progress\n variant="linear"\n value={progress ?? 0}\n color={\n error\n ? "error"\n : state === "warning"\n ? "primary"\n : progress === 100\n ? "success"\n : "primary"\n }\n showPercentage\n />\n )}\n </div>\n <Button\n variant="text"\n prefixIcon="cross"\n size="xs"\n disabled={disabled}\n className="text-gray-900 dark:text-gray-300"\n title={`Remove ${file.name}`}\n onClick={() => removeFile( file.name )}\n />\n </div>\n <p className="text-secondary-400 text-sm mt-2 flex items-center gap-2 dark:text-secondary-50">\n {helperMessage}\n </p>\n </div>\n );\n});\n\nStatusCard.displayName = "StatusCard";\n'
2297
2330
  },
2298
2331
  {
2299
2332
  "name": "index.ts",
@@ -2301,7 +2334,7 @@ DropdownItem.displayName = "DropdownItem";
2301
2334
  },
2302
2335
  {
2303
2336
  "name": "fileUploadVariants.ts",
2304
- "content": 'import { tv } from "tailwind-variants";\n\nexport const fileUploadVariants = tv({\n slots: {\n dropArea: [\n "bg-white overflow-auto border-dashed",\n "h-60 border border-gray-300 rounded-md",\n "p-0 flex flex-col items-center justify-center gap-4 w-full",\n "cursor-pointer dark:text-secondary-200 dark:border-secondary-500 dark:bg-iridium"\n ],\n iconWrapper: "w-13 h-13 flex items-center justify-center rounded-full dark:bg-secondary-600",\n icon: "cursor-pointer"\n },\n variants: {\n state: {\n default: {\n iconWrapper: "bg-primary-50",\n icon: "text-primary-500 dark:text-primary-400"\n },\n success: {\n iconWrapper: "bg-success-50",\n icon: "text-success-500 bg-success-50 dark:text-success-400 dark:bg-secondary-600"\n },\n warning: {\n iconWrapper: "bg-warning-50",\n icon: "text-warning-500 bg-warning-50 dark:text-warning-400 dark:bg-secondary-600"\n },\n error: {\n iconWrapper: "bg-error-50",\n icon: "text-error-500 bg-error-50 dark:text-error-400 dark:bg-secondary-600"\n }\n },\n dragging: {\n true: {\n dropArea: "bg-primary-50 dark:bg-secondary-700"\n }\n },\n disabled: {\n true: {\n dropArea: "bg-secondary-50",\n iconWrapper: "bg-secondary-100",\n icon: "text-secondary-300 cursor-not-allowed hover:text-secondary-300 dark:text-secondary-400 dark:bg-secondary-600"\n }\n }\n },\n defaultVariants: {\n state: "default",\n dragging: false,\n disabled: false\n }\n});\n'
2337
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const fileUploadVariants = tv({\n slots: {\n dropArea: [\n "bg-white overflow-auto border-dashed",\n "h-60 border border-gray-300 rounded-md",\n "p-0 flex flex-col items-center justify-center gap-4 w-full",\n "cursor-pointer dark:text-secondary-200 dark:border-secondary-500 dark:bg-iridium"\n ],\n iconWrapper: "w-13 h-13 flex items-center justify-center rounded-full dark:bg-secondary-600",\n icon: "cursor-pointer"\n },\n variants: {\n state: {\n default: {\n iconWrapper: "bg-primary-100",\n icon: "text-primary-700 dark:text-primary-400"\n },\n success: {\n iconWrapper: "bg-success-100",\n icon: "text-success-700 bg-success-100 dark:text-success-400 dark:bg-secondary-600"\n },\n warning: {\n iconWrapper: "bg-warning-100",\n icon: "text-warning-700 bg-warning-100 dark:text-warning-400 dark:bg-secondary-600"\n },\n error: {\n iconWrapper: "bg-error-100",\n icon: "text-error-700 bg-error-100 dark:text-error-400 dark:bg-secondary-600"\n }\n },\n dragging: {\n true: {\n dropArea: "bg-primary-50 dark:bg-secondary-700"\n }\n },\n disabled: {\n true: {\n dropArea: "bg-secondary-50",\n iconWrapper: "bg-secondary-100",\n icon: "text-secondary-300 cursor-not-allowed hover:text-secondary-300 dark:text-secondary-400 dark:bg-secondary-600"\n }\n }\n },\n defaultVariants: {\n state: "default",\n dragging: false,\n disabled: false\n }\n});\n'
2305
2338
  },
2306
2339
  {
2307
2340
  "name": "fileUpload.tsx",
@@ -2326,11 +2359,11 @@ DropdownItem.displayName = "DropdownItem";
2326
2359
  "files": [
2327
2360
  {
2328
2361
  "name": "loaderVariants.ts",
2329
- "content": 'import { tv } from "tailwind-variants";\n\nexport const loaderVariants = tv({\n slots: {\n base: "inline-flex gap-4 flex-col justify-center items-center min-w-min text-primary-500 dark:text-primary-400",\n label: "font-medium text-secondary-500 dark:text-secondary-50"\n },\n variants: {\n variant: {\n filled: {},\n stroked: {}\n },\n size: {\n sm: { base: "text-base", label: "text-sm" },\n md: { base: "text-md", label: "text-base" },\n lg: { base: "text-lg", label: "text-lg" }\n }\n },\n defaultVariants: {\n variant: "filled",\n size: "md"\n }\n});\n'
2362
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const loaderVariants = tv({\n slots: {\n base: "inline-flex gap-4 flex-col justify-center items-center min-w-min text-primary-700 dark:text-primary-400",\n label: "font-medium text-secondary-500 dark:text-secondary-50"\n },\n variants: {\n variant: {\n filled: {},\n stroked: {}\n },\n size: {\n sm: { base: "text-base", label: "text-sm" },\n md: { base: "text-md", label: "text-base" },\n lg: { base: "text-lg", label: "text-lg" }\n }\n },\n defaultVariants: {\n variant: "filled",\n size: "md"\n }\n});\n'
2330
2363
  },
2331
2364
  {
2332
2365
  "name": "loader.tsx",
2333
- "content": 'import * as React from "react";\n\nimport { loaderVariants } from "./loaderVariants";\n\n/**\n * Loader component for showing loading states.\n */\nexport interface ILoaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Variant of the Loader.\n * @default filled\n */\n variant?: "filled" | "stroked";\n /**\n * Size of the Loader.\n * @default md\n */\n size?: "sm" | "md" | "lg";\n /**\n * Regular static label.\n */\n label?: React.ReactNode;\n}\n\n// Define IconSizeMapping as an object\nconst IconSizeMapping: Record<ILoaderProps["size"] & string, 32 | 48 | 56> = {\n sm: 32,\n md: 48,\n lg: 56\n};\n\n/**\n * Loader component for showing loading states.\n */\nexport const Loader = React.forwardRef<HTMLDivElement, ILoaderProps>(\n ({\n className,\n variant = "filled",\n size = "md",\n label,\n ...props\n }, ref ) => {\n const { base, label: labelClass } = loaderVariants({ variant, size });\n\n return (\n <div\n ref={ref}\n className={base({ class: className })}\n {...props}\n >\n <svg\n width={IconSizeMapping[size]}\n height={IconSizeMapping[size]}\n viewBox="0 0 24 24"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n className="animate-[spin_0.9s_linear_infinite] text-primary-500 dark:text-primary-400"\n >\n {variant === "filled" ? (\n <path\n d={`M12 1.5C13.8404 1.5 15.6484 1.9837 17.2429 2.90264C18.8374 3.82157 20.1624 5.14345 21.0851 6.73581C22.0077 \n 8.32816 22.4957 10.1351 22.5 11.9754C22.5043 13.8158 22.0248 15.6249 21.1096 17.2216C20.1944 18.8182 18.8756 \n 20.1463 17.2855 21.0727C15.6953 21.9991 13.8895 22.4913 12.0492 22.4999C10.2089 22.5085 8.39858 22.0333 \n 6.79978 21.1218C5.20098 20.2104 3.86982 18.8947 2.9397 17.3067`}\n stroke="currentColor"\n strokeWidth="3"\n strokeLinecap="round"\n />\n ) : (\n <path\n d={`M12 1.75C13.346 1.75 14.6789 2.01512 15.9225 2.53023C17.1661 3.04535 18.296 3.80036 19.2478 4.75216C20.1996 \n 5.70396 20.9547 6.83391 21.4698 8.0775C21.9849 9.32108 22.25 10.654 22.25 12C22.25 13.3461 21.9849 14.6789 \n 21.4698 15.9225C20.9547 17.1661 20.1996 18.296 19.2478 19.2478C18.296 20.1996 17.1661 20.9547 15.9225 \n 21.4698C14.6789 21.9849 13.346 22.25 12 22.25C10.6539 22.25 9.32108 21.9849 8.07749 21.4698C6.8339 20.9547 \n 5.70395 20.1996 4.75215 19.2478C3.80035 18.296 3.04534 17.1661 2.53023 15.9225C2.01512 14.6789 1.75 13.346 \n 1.75 12C1.75 10.6539 2.01513 9.32108 2.53024 8.07749C3.04535 6.8339 3.80036 5.70395 4.75216 4.75215C5.70396 \n 3.80035 6.83391 3.04534 8.0775 2.53023C9.32109 2.01512 10.654 1.75 12 1.75L12 1.75Z`}\n stroke="currentColor"\n strokeWidth={size === "sm" ? "1.4" : "2.5"}\n strokeDasharray="1 3"\n />\n )}\n </svg>\n {label && (\n <span className={labelClass()}>\n {label}\n </span>\n )}\n </div>\n );\n }\n);\n\nLoader.displayName = "Loader";\n'
2366
+ "content": 'import * as React from "react";\n\nimport { loaderVariants } from "./loaderVariants";\n\n/**\n * Loader component for showing loading states.\n */\nexport interface ILoaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Variant of the Loader.\n * @default filled\n */\n variant?: "filled" | "stroked";\n /**\n * Size of the Loader.\n * @default md\n */\n size?: "sm" | "md" | "lg";\n /**\n * Regular static label.\n */\n label?: React.ReactNode;\n}\n\n// Define IconSizeMapping as an object\nconst IconSizeMapping: Record<ILoaderProps["size"] & string, 32 | 48 | 56> = {\n sm: 32,\n md: 48,\n lg: 56\n};\n\n/**\n * Loader component for showing loading states.\n */\nexport const Loader = React.forwardRef<HTMLDivElement, ILoaderProps>(\n ({\n className,\n variant = "filled",\n size = "md",\n label,\n ...props\n }, ref ) => {\n const { base, label: labelClass } = loaderVariants({ variant, size });\n\n return (\n <div\n ref={ref}\n className={base({ class: className })}\n {...props}\n >\n <svg\n width={IconSizeMapping[size]}\n height={IconSizeMapping[size]}\n viewBox="0 0 24 24"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n className="animate-[spin_0.9s_linear_infinite] text-primary-700 dark:text-primary-400"\n >\n {variant === "filled" ? (\n <path\n d={`M12 1.5C13.8404 1.5 15.6484 1.9837 17.2429 2.90264C18.8374 3.82157 20.1624 5.14345 21.0851 6.73581C22.0077 \n 8.32816 22.4957 10.1351 22.5 11.9754C22.5043 13.8158 22.0248 15.6249 21.1096 17.2216C20.1944 18.8182 18.8756 \n 20.1463 17.2855 21.0727C15.6953 21.9991 13.8895 22.4913 12.0492 22.4999C10.2089 22.5085 8.39858 22.0333 \n 6.79978 21.1218C5.20098 20.2104 3.86982 18.8947 2.9397 17.3067`}\n stroke="currentColor"\n strokeWidth="3"\n strokeLinecap="round"\n />\n ) : (\n <path\n d={`M12 1.75C13.346 1.75 14.6789 2.01512 15.9225 2.53023C17.1661 3.04535 18.296 3.80036 19.2478 4.75216C20.1996 \n 5.70396 20.9547 6.83391 21.4698 8.0775C21.9849 9.32108 22.25 10.654 22.25 12C22.25 13.3461 21.9849 14.6789 \n 21.4698 15.9225C20.9547 17.1661 20.1996 18.296 19.2478 19.2478C18.296 20.1996 17.1661 20.9547 15.9225 \n 21.4698C14.6789 21.9849 13.346 22.25 12 22.25C10.6539 22.25 9.32108 21.9849 8.07749 21.4698C6.8339 20.9547 \n 5.70395 20.1996 4.75215 19.2478C3.80035 18.296 3.04534 17.1661 2.53023 15.9225C2.01512 14.6789 1.75 13.346 \n 1.75 12C1.75 10.6539 2.01513 9.32108 2.53024 8.07749C3.04535 6.8339 3.80036 5.70395 4.75216 4.75215C5.70396 \n 3.80035 6.83391 3.04534 8.0775 2.53023C9.32109 2.01512 10.654 1.75 12 1.75L12 1.75Z`}\n stroke="currentColor"\n strokeWidth={size === "sm" ? "1.4" : "2.5"}\n strokeDasharray="1 3"\n />\n )}\n </svg>\n {label && (\n <span className={labelClass()}>\n {label}\n </span>\n )}\n </div>\n );\n }\n);\n\nLoader.displayName = "Loader";\n'
2334
2367
  },
2335
2368
  {
2336
2369
  "name": "index.ts",
@@ -2363,7 +2396,7 @@ DropdownItem.displayName = "DropdownItem";
2363
2396
  },
2364
2397
  {
2365
2398
  "name": "modal.tsx",
2366
- "content": 'import * as React from "react";\nimport ReactDOM from "react-dom";\nimport { FocusOn } from "react-focus-on";\nimport { cn } from "tailwind-variants";\nimport { Button } from "../button";\nimport { modalVariants } from "./modalVariants";\n\nexport interface IModalProps {\n /**\n * Control modal\'s visibility\n */\n showModal: boolean;\n /**\n * Modal content\n */\n children:\n | React.ReactElement<IModalHeaderProps>\n | [React.ReactElement<IModalHeaderProps>, React.ReactElement<IModalBodyProps>];\n /**\n * Overwrite the Modal styles by passing space separated class names\n */\n className?: string;\n /**\n * Sets the modal content to right-to-left\n */\n rtl?: boolean;\n /**\n * Hide the modal on esc key press\n * @default true\n */\n escKeyClose?: boolean;\n /**\n * Show/hide the close button within the modal\n * @default true\n */\n closeButton?: boolean;\n /**\n * Pass a reference to the element where the Modal needs to be rendered\n * @default document.body\n */\n portalTarget?: HTMLElement;\n /**\n * A list of Refs to be considered as a part of the Lock. The html elements in the list will be accessible while the Modal is open.\n */\n shards?: ( HTMLElement | React.RefObject<any> )[];\n /**\n * Callback function for onHide\n */\n onHide?: () => void;\n}\n\nexport interface IModalHeaderProps {\n /**\n * Header of the Modal\n */\n children?: React.ReactNode;\n /**\n * Dynamically updates the classes applied to the component\n */\n className?: string;\n}\n\nexport interface IModalBodyProps {\n /**\n * Modal Body\n */\n children?: React.ReactNode;\n /**\n * Dynamically updates the classes applied to the component\n */\n className?: string;\n}\n\n/**\n * Modal component for displaying content in an overlay with optional header and close button.\n *\n * @example\n * ```tsx\n * <Modal showModal={modalVisible} onHide={() => setModalVisible(false)}>\n * <Modal.Header>Modal Title</Modal.Header>\n * <Modal.Body>Modal content goes here</Modal.Body>\n * </Modal>\n * ```\n */\nconst ModalComponent = React.forwardRef<HTMLDivElement, IModalProps>(\n (\n {\n showModal,\n onHide,\n closeButton = true,\n escKeyClose = true,\n rtl = false,\n portalTarget = typeof document !== "undefined" ? document.body : undefined,\n shards,\n className,\n children\n },\n ref\n ) => {\n const modalRef = React.useRef<HTMLDivElement | null>( null );\n\n let headerPresent = false;\n React.Children.forEach( children, ( child ) => {\n if ( React.isValidElement( child ) && child.type === ModalHeader ) {\n headerPresent = true;\n }\n });\n\n const { container, modal } = modalVariants({ headerless: !headerPresent });\n\n const closeModal = React.useCallback(() => {\n if ( onHide ) {\n onHide();\n }\n }, [onHide]);\n\n React.useEffect(() => {\n const handleEsc = ( e: KeyboardEvent ) => {\n if ( e.code === "Escape" && escKeyClose ) {\n closeModal();\n }\n };\n\n if ( showModal ) {\n document.addEventListener( "keydown", handleEsc );\n }\n\n return () => {\n document.removeEventListener( "keydown", handleEsc );\n };\n }, [ showModal, escKeyClose, closeModal ]);\n\n if ( !showModal || !portalTarget ) {\n return null;\n }\n\n return ReactDOM.createPortal(\n <FocusOn\n enabled={showModal}\n shards={shards}\n {...( rtl ? { dir: "rtl" } : {})}\n className={container()}\n >\n <div\n ref={( instance ) => {\n modalRef.current = instance;\n if ( typeof ref === "function" ) {\n ref( instance );\n } else if ( ref ) {\n ( ref as React.MutableRefObject<HTMLDivElement | null> ).current = instance;\n }\n }}\n data-testid="modal"\n className={modal({ class: className })}\n aria-labelledby="dialog-label"\n aria-describedby="dialog-desc"\n >\n {closeButton && (\n <Button\n prefixIcon="cross"\n onClick={closeModal}\n data-testid="close-button"\n variant="text"\n color="secondary"\n aria-label="close modal"\n className="absolute top-6 end-6 text-gray-800 dark:text-gray-800 dark:hover:text-gray-800"\n autoFocus\n />\n )}\n {children}\n </div>\n </FocusOn>,\n portalTarget\n );\n }\n);\n\nModalComponent.displayName = "Modal";\n\n/**\n * Modal header component for rendering the title in the Modal.\n *\n * @example\n * ```tsx\n * <Modal.Header>Modal Title</Modal.Header>\n * ```\n */\nconst ModalHeader = React.forwardRef<\n HTMLDivElement,\n IModalHeaderProps\n>(({ children, className }, ref ) => {\n if ( !children ) {\n return null;\n }\n return (\n <div\n ref={ref}\n id="dialog-label"\n data-testid="modal-header"\n className={cn(\n "flex flex-row flex-nowrap justify-between text-lg font-semibold me-7 text-secondary-500 dark:text-secondary-50",\n className\n )}\n >\n {children}\n </div>\n );\n});\n\nModalHeader.displayName = "ModalHeader";\n\n/**\n * Modal body component for rendering content inside the Modal.\n *\n * @example\n * ```tsx\n * <Modal.Body>Modal content goes here</Modal.Body>\n * ```\n */\nconst ModalBody = React.forwardRef<HTMLDivElement, IModalBodyProps>(\n ({ children, className }, ref ) => {\n if ( !children ) {\n return null;\n }\n return (\n <div\n ref={ref}\n id="dialog-desc"\n data-testid="modal-content"\n className={cn(\n "text-base overflow-y-auto overflow-x-hidden text-wrap mt-2 max-h-[84vh] dark:text-secondary-200",\n className\n )}\n >\n {children}\n </div>\n );\n }\n);\n\nModalBody.displayName = "ModalBody";\n\n// Define the compound component type\ntype TModalCompoundComponent = typeof ModalComponent & {\n Header: typeof ModalHeader;\n Body: typeof ModalBody;\n};\n\n// Create the compound component by casting and attaching subcomponents\nconst Modal = ModalComponent as TModalCompoundComponent;\nModal.Header = ModalHeader;\nModal.Body = ModalBody;\n\n// Export the compound component and individual components\nexport { Modal, ModalHeader, ModalBody };\n'
2399
+ "content": 'import * as React from "react";\nimport ReactDOM from "react-dom";\nimport { FocusOn } from "react-focus-on";\nimport { cn } from "tailwind-variants";\nimport { Button } from "../button";\nimport { modalVariants } from "./modalVariants";\n\nexport interface IModalProps {\n /**\n * Control modal\'s visibility\n */\n showModal: boolean;\n /**\n * Modal content\n */\n children:\n | React.ReactElement<IModalHeaderProps>\n | [React.ReactElement<IModalHeaderProps>, React.ReactElement<IModalBodyProps>];\n /**\n * Overwrite the Modal styles by passing space separated class names\n */\n className?: string;\n /**\n * Sets the modal content to right-to-left\n */\n rtl?: boolean;\n /**\n * Hide the modal on esc key press\n * @default true\n */\n escKeyClose?: boolean;\n /**\n * Show/hide the close button within the modal\n * @default true\n */\n closeButton?: boolean;\n /**\n * Pass a reference to the element where the Modal needs to be rendered\n * @default document.body\n */\n portalTarget?: HTMLElement;\n /**\n * A list of Refs to be considered as a part of the Lock. The html elements in the list will be accessible while the Modal is open.\n */\n shards?: ( HTMLElement | React.RefObject<any> )[];\n /**\n * Callback function for onHide\n */\n onHide?: () => void;\n}\n\nexport interface IModalHeaderProps {\n /**\n * Header of the Modal\n */\n children?: React.ReactNode;\n /**\n * Dynamically updates the classes applied to the component\n */\n className?: string;\n}\n\nexport interface IModalBodyProps {\n /**\n * Modal Body\n */\n children?: React.ReactNode;\n /**\n * Dynamically updates the classes applied to the component\n */\n className?: string;\n}\n\n// Compound component type with subcomponents attached\ntype TModalCompoundComponent = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<IModalProps> & React.RefAttributes<HTMLDivElement>\n> & {\n Header: typeof ModalHeader;\n Body: typeof ModalBody;\n};\n\n/**\n * Modal component for displaying content in an overlay with optional header and close button.\n *\n * @example\n * ```tsx\n * <Modal showModal={modalVisible} onHide={() => setModalVisible(false)}>\n * <Modal.Header>Modal Title</Modal.Header>\n * <Modal.Body>Modal content goes here</Modal.Body>\n * </Modal>\n * ```\n */\nexport const Modal = React.forwardRef<HTMLDivElement, IModalProps>(\n (\n {\n showModal,\n onHide,\n closeButton = true,\n escKeyClose = true,\n rtl = false,\n portalTarget = typeof document !== "undefined" ? document.body : undefined,\n shards,\n className,\n children\n },\n ref\n ) => {\n const modalRef = React.useRef<HTMLDivElement | null>( null );\n\n let headerPresent = false;\n React.Children.forEach( children, ( child ) => {\n if ( React.isValidElement( child ) && child.type === ModalHeader ) {\n headerPresent = true;\n }\n });\n\n const { container, modal } = modalVariants({ headerless: !headerPresent });\n\n const closeModal = React.useCallback(() => {\n if ( onHide ) {\n onHide();\n }\n }, [onHide]);\n\n React.useEffect(() => {\n const handleEsc = ( e: KeyboardEvent ) => {\n if ( e.code === "Escape" && escKeyClose ) {\n closeModal();\n }\n };\n\n if ( showModal ) {\n document.addEventListener( "keydown", handleEsc );\n }\n\n return () => {\n document.removeEventListener( "keydown", handleEsc );\n };\n }, [ showModal, escKeyClose, closeModal ]);\n\n if ( !showModal || !portalTarget ) {\n return null;\n }\n\n return ReactDOM.createPortal(\n <FocusOn\n enabled={showModal}\n shards={shards}\n {...( rtl ? { dir: "rtl" } : {})}\n className={container()}\n >\n <div\n ref={( instance ) => {\n modalRef.current = instance;\n if ( typeof ref === "function" ) {\n ref( instance );\n } else if ( ref ) {\n ( ref as React.MutableRefObject<HTMLDivElement | null> ).current = instance;\n }\n }}\n data-testid="modal"\n className={modal({ class: className })}\n aria-labelledby="dialog-label"\n aria-describedby="dialog-desc"\n >\n {closeButton && (\n <Button\n prefixIcon="cross"\n onClick={closeModal}\n data-testid="close-button"\n variant="shade"\n color="secondary"\n aria-label="close modal"\n className="absolute top-2 end-2 text-gray-900 dark:text-gray-800 dark:hover:text-gray-800"\n autoFocus\n />\n )}\n {children}\n </div>\n </FocusOn>,\n portalTarget\n );\n }\n) as TModalCompoundComponent;\n\nModal.displayName = "Modal";\n\n/**\n * Modal header component for rendering the title in the Modal.\n *\n * @example\n * ```tsx\n * <Modal.Header>Modal Title</Modal.Header>\n * ```\n */\nconst ModalHeader = React.forwardRef<\n HTMLDivElement,\n IModalHeaderProps\n>(({ children, className }, ref ) => {\n if ( !children ) {\n return null;\n }\n return (\n <div\n ref={ref}\n id="dialog-label"\n data-testid="modal-header"\n className={cn(\n "flex flex-row flex-nowrap justify-between text-lg font-semibold me-7 text-secondary-500 dark:text-secondary-50",\n className\n )}\n >\n {children}\n </div>\n );\n});\n\nModalHeader.displayName = "ModalHeader";\n\n/**\n * Modal body component for rendering content inside the Modal.\n *\n * @example\n * ```tsx\n * <Modal.Body>Modal content goes here</Modal.Body>\n * ```\n */\nconst ModalBody = React.forwardRef<HTMLDivElement, IModalBodyProps>(\n ({ children, className }, ref ) => {\n if ( !children ) {\n return null;\n }\n return (\n <div\n ref={ref}\n id="dialog-desc"\n data-testid="modal-content"\n className={cn(\n "text-base overflow-y-auto overflow-x-hidden text-wrap mt-2 max-h-[84vh] dark:text-secondary-200",\n className\n )}\n >\n {children}\n </div>\n );\n }\n);\n\nModalBody.displayName = "ModalBody";\n\n// Attach the subcomponents\nModal.Header = ModalHeader;\nModal.Body = ModalBody;\n\n// Export the individual subcomponents\nexport { ModalHeader, ModalBody };\n'
2367
2400
  },
2368
2401
  {
2369
2402
  "name": "index.ts",
@@ -2376,6 +2409,330 @@ DropdownItem.displayName = "DropdownItem";
2376
2409
  ],
2377
2410
  "directories": []
2378
2411
  },
2412
+ "multiselecttransfer": {
2413
+ "name": "multiSelectTransfer",
2414
+ "description": 'The MultiSelectTransfer is a multi-select form control that pairs a compact, pill-based trigger with two ways to pick options: a lightweight **dropdown** for quick selection and a full-screen **transfer-list modal** for managing large or ordered selections across an **Available** and a **Selected** panel. Committed selections render as removable pills in the trigger, collapsing to a "+N More" badge past a configurable limit. It supports both controlled and uncontrolled usage, client- and server-side filtering, infinite scroll, and optional reordering. **When to use:** - Selecting multiple items (permissions, columns, tags, members) from a pool that can be browsed quickly or curated in depth - Form fields where the current selection should stay visible as pills - Workflows that need a "confirm before commit" step (Cancel/Done in the modal) - Large, possibly paginated option sets that benefit from windowing and infinite scroll - Ordered selections where the position of chosen items matters (`reorderable`) **Component Architecture:** - Styled with `tailwind-variants` (`tv()`) slots \u2014 see `multiSelectTransferVariants.ts` - Composes the standalone `TransferList` inside a `Modal` for the full-management view - Dropdown and transfer-list panels window (virtualize) large option sets - Infinite scroll via the shared `useInfiniteScroll` (`IntersectionObserver`) hook - Debounced server-side filtering via the shared `useFilterQuery` hook (also used by `Select`) - Client-side filtering via the shared `matchesQuery` util when no filter handler is given - Reuses `ADPIcon`, `Tooltip` (for clipped pill labels), and `TransferList` - Dark-mode aware and RTL-safe (logical spacing properties throughout)',
2415
+ "dependencies": [
2416
+ "react",
2417
+ "tailwind-variants",
2418
+ "react-merge-refs",
2419
+ "tailwind-merge"
2420
+ ],
2421
+ "internalDependencies": [
2422
+ "transferList",
2423
+ "adpIcon",
2424
+ "tooltip",
2425
+ "modal",
2426
+ "button",
2427
+ "checkbox",
2428
+ "loader",
2429
+ "card"
2430
+ ],
2431
+ "files": [
2432
+ {
2433
+ "name": "useMultiSelectTransferOptionSource.ts",
2434
+ "content": 'import { useCallback, useState, type ReactNode } from "react";\n\nimport { useAsyncOptions, useIgnoredPropWarning, type TPrefetch } from "@hooks";\nimport { resolveLoadErrors, resolveReloadControls } from "@utils";\nimport type { TMultiSelectTransferLoadOptions, TMultiSelectTransferOption } from "./types";\n\nconst EMPTY_OPTIONS: readonly TMultiSelectTransferOption[] = [];\n\ninterface IUseMultiSelectTransferOptionSourceArgs {\n options?: TMultiSelectTransferOption[];\n loadOptions?: TMultiSelectTransferLoadOptions;\n initialOptions?: readonly TMultiSelectTransferOption[];\n prefetch?: TPrefetch;\n refetchOnClear?: boolean;\n optionsKey?: string | number;\n loadErrorMessage?: ReactNode;\n loadMoreErrorMessage?: ReactNode;\n showReloadButton?: boolean;\n onLoadError?: ( error: unknown ) => void;\n /** Legacy (consumer-driven) paging and loading. Ignored in async mode. */\n hasMore?: boolean;\n onLoadMore?: () => void;\n isLoading?: boolean;\n onReload?: () => void;\n isReloading?: boolean;\n onFilterChange?: ( query: string ) => void;\n}\n\ninterface IMultiSelectTransferOptionSource {\n options: readonly TMultiSelectTransferOption[];\n /** The mode decision, made once here \u2014 the component must never re-test `loadOptions` itself. */\n isAsync: boolean;\n isServerFiltered: boolean;\n /** Any load in flight \u2014 feeds aria-busy on the option list. */\n isLoading: boolean;\n /** Loader INSTEAD of rows: a search/reload fetch, not a page append. */\n isSearchFetch: boolean;\n /** Loader BELOW the rows, and the infinite-scroll observer\'s in-flight gate. */\n isLoadingMore: boolean;\n hasMore: boolean;\n total: number | undefined;\n onLoadMore?: () => void;\n onRetryLoadMore?: () => void;\n isReloading?: boolean;\n onReload?: () => void;\n onFilterQueryChange: ( query: string ) => void;\n ensureDefaults: () => void;\n /** Set when the whole list failed. Mutually exclusive with `loadMoreError`. */\n loadError?: ReactNode;\n /** Set when a page append failed. The rows the user was reading stay on screen. */\n loadMoreError?: ReactNode;\n /** Ends legacy load-more mode: typing or clearing means the next fetch replaces rows, not appends. */\n clearLoadMoreMode: () => void;\n}\n\n/**\n * MultiSelectTransfer\'s option-source policy: async vs legacy `options` / `isLoading` / `hasMore` /\n * `onLoadMore`, the replace-vs-append loader question, and the paging trio. In async mode the hook\n * knows the request *kind* directly; the legacy path still needs a ref latch, since `isLoading` is a\n * bare boolean there and the kind has to be inferred from its edges.\n */\nexport function useMultiSelectTransferOptionSource({\n options,\n loadOptions,\n initialOptions,\n prefetch,\n refetchOnClear = false,\n optionsKey,\n loadErrorMessage,\n loadMoreErrorMessage,\n showReloadButton = false,\n onLoadError,\n hasMore = false,\n onLoadMore,\n isLoading = false,\n onReload,\n isReloading,\n onFilterChange\n}: IUseMultiSelectTransferOptionSourceArgs ): IMultiSelectTransferOptionSource {\n const isAsync = typeof loadOptions === "function";\n\n const asyncOptions = useAsyncOptions<TMultiSelectTransferOption>({\n loadOptions,\n initialOptions,\n prefetchDefaults: prefetch !== "never",\n refetchOnClear,\n optionsKey,\n onLoadError,\n getOptionKey: ( option ) => option.value\n });\n\n // \u2500\u2500 Legacy replace-vs-append detection \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // State, not a pair of refs: `isLoadingMore` decides whether the loader replaces the rows or appends\n // below them, so it IS render output, and a ref read during render neither schedules a re-render nor\n // rolls back with a discarded one. `wasLoading` rides along so the true\u2192false edge is detected\n // against committed state. Cleared only once `isLoading` finishes, so it survives the consumer\'s\n // setPage-before-fetch gap.\n const [ legacyLoad, setLegacyLoad ] = useState({ isLoadingMore: false, wasLoading: isLoading });\n if ( legacyLoad.wasLoading !== isLoading ) {\n setLegacyLoad({\n // A finished load ends load-more mode; a starting one leaves it as `onLoadMore` set it.\n isLoadingMore: isLoading ? legacyLoad.isLoadingMore : false,\n wasLoading: isLoading\n });\n }\n\n useIgnoredPropWarning(\n isAsync && options !== undefined,\n "MultiSelectTransfer: `options` is ignored when `loadOptions` is set \u2014 use `initialOptions` to seed the list."\n );\n // The mirror of the above: seed rows only mean anything to the async source, so without a loader they\n // vanish silently \u2014 the same mistake, and just as quiet.\n useIgnoredPropWarning(\n !isAsync && initialOptions !== undefined,\n "MultiSelectTransfer: `initialOptions` is ignored without `loadOptions` \u2014 pass those rows as `options` instead."\n );\n // Same class of mistake: `prefetch` only ever schedules the baseline fetch, so with the rows already\n // in `options` there is nothing for it to trigger and it silently does nothing.\n useIgnoredPropWarning(\n !isAsync && prefetch !== undefined,\n "MultiSelectTransfer: `prefetch` is ignored without `loadOptions` \u2014 `options` are already on screen, so there is nothing to fetch."\n );\n\n const onFilterQueryChange = ( query: string ): void => {\n onFilterChange?.( query );\n asyncOptions.onFilterChange( query );\n };\n\n const handleLegacyLoadMore = (): void => {\n // Batched with whatever `onLoadMore` sets, so one render sees both this and the consumer\'s\n // `isLoading` \u2014 an append loader never renders as a replacing one.\n setLegacyLoad(( previous ) => ({ ...previous, isLoadingMore: true }));\n onLoadMore?.();\n };\n\n // Stable, and it propagates through the component\'s resetFilter \u2192 commitSelection \u2192 the\n // outside-click listener, which would otherwise re-subscribe every render. The bail-out keeps a\n // close that was never in load-more mode from scheduling a render.\n const clearLoadMoreMode = useCallback(() => {\n setLegacyLoad(( previous ) => ( previous.isLoadingMore ? { ...previous, isLoadingMore: false } : previous ));\n }, []);\n\n return {\n options: isAsync ? asyncOptions.options : options ?? EMPTY_OPTIONS,\n isAsync,\n isServerFiltered: isAsync || typeof onFilterChange === "function",\n isLoading: isLoading === true || ( isAsync && asyncOptions.isBusy ),\n isSearchFetch: isAsync\n ? asyncOptions.isReplacing\n : isLoading === true && !legacyLoad.isLoadingMore,\n isLoadingMore: isAsync ? asyncOptions.isLoadingMore : legacyLoad.isLoadingMore,\n hasMore: isAsync ? asyncOptions.hasMore : hasMore,\n total: isAsync ? asyncOptions.total : undefined,\n onLoadMore: isAsync ? asyncOptions.loadMore : handleLegacyLoadMore,\n onRetryLoadMore: isAsync ? asyncOptions.retryMore : undefined,\n ...resolveReloadControls({ isAsync, source: asyncOptions, onReload, isReloading, showReloadButton }),\n onFilterQueryChange,\n ensureDefaults: asyncOptions.ensureDefaults,\n ...resolveLoadErrors({\n errorKind: asyncOptions.errorKind,\n loadErrorMessage,\n loadMoreErrorMessage\n }),\n clearLoadMoreMode\n };\n}\n'
2435
+ },
2436
+ {
2437
+ "name": "useMultiSelectTransferDraft.ts",
2438
+ "content": 'import { useCallback, useState } from "react";\n\nimport { useAvailableProjection } from "@hooks";\nimport type { TMultiSelectTransferOption } from "./types";\n\ninterface IMultiSelectTransferDraft {\n /** Derived: the loaded pool plus the opening snapshot, minus whatever is in the draft selection. */\n draftAvailable: TMultiSelectTransferOption[];\n /** Owned: the ordered draft selection. Order matters when `reorderable`. */\n draftSelected: TMultiSelectTransferOption[];\n /** Wire to `TransferList`\'s onChange; only its second argument is needed. */\n onDraftChange: (\n nextAvailable: TMultiSelectTransferOption[],\n nextSelected: TMultiSelectTransferOption[]\n ) => void;\n /** Seed the draft from the committed selection. Call when opening the modal. */\n seedDraft: ( committed: TMultiSelectTransferOption[]) => void;\n}\n\n/**\n * The transfer-list modal\'s draft, as a **projection** of the loaded option pool rather than a second\n * array kept in sync with it. A paged-in option appears in Available automatically; an option the\n * user moved right is never re-offered; and an `optionsKey` change re-seeds by construction. An\n * option that left Selected but is not in the pool is covered by the opening snapshot, since the\n * only way into the draft is the pool or the committed value.\n *\n * `searchQuery` is the panel\'s active server query (empty when the search is client-side, where\n * TransferList filters for us); it keeps the snapshot from surfacing an option the server\'s answer\n * for that query would not have returned.\n */\nexport function useMultiSelectTransferDraft(\n pool: readonly TMultiSelectTransferOption[],\n isOpen: boolean,\n searchQuery = ""\n): IMultiSelectTransferDraft {\n const [ draftSelected, setDraftSelected ] = useState<TMultiSelectTransferOption[]>([]);\n // Options that belong in Available but the loaded pool may not contain \u2014 committed values that were\n // never fetched. Snapshotted at open (state, not a live prop read) so a parent re-render mid-draft\n // cannot disturb the panels.\n const [ openingSnapshot, setOpeningSnapshot ] = useState<TMultiSelectTransferOption[]>([]);\n\n // Gated on `isOpen`: the modal renders nothing while closed, so re-projecting the whole pool on\n // every landed page and every dropdown search would be work no one can see.\n const draftAvailable = useAvailableProjection( isOpen, pool, openingSnapshot, draftSelected, searchQuery );\n\n const seedDraft = useCallback(( committed: TMultiSelectTransferOption[]) => {\n setDraftSelected( committed );\n setOpeningSnapshot( committed );\n }, []);\n\n const onDraftChange = useCallback(\n ( _nextAvailable: TMultiSelectTransferOption[], nextSelected: TMultiSelectTransferOption[]) => {\n setDraftSelected( nextSelected );\n },\n []\n );\n\n return { draftAvailable, draftSelected, onDraftChange, seedDraft };\n}\n'
2439
+ },
2440
+ {
2441
+ "name": "types.ts",
2442
+ "content": 'import type { ReactNode } from "react";\n\nimport type { TLoadOptions, TPrefetch } from "@hooks";\nimport type { ITransferListItem } from "../transferList/types";\n\nexport enum EMultiSelectTransferSizes {\n MD = "md",\n LG = "lg"\n}\n\nexport type TMultiSelectTransferSize = `${EMultiSelectTransferSizes}`;\n\n// Options feed straight into the composed TransferList, so an option IS a transfer-list item.\n// Aliased to ITransferListItem (not redeclared) so the shared shape lives in one place.\nexport type TMultiSelectTransferOption = ITransferListItem;\n\n/**\n * Async option source. Paged: `cursor`, `hasMore` and `total` on the resolved page are all honoured.\n */\nexport type TMultiSelectTransferLoadOptions = TLoadOptions<TMultiSelectTransferOption>;\n\nexport interface IMultiSelectTransferProps {\n /** Unique id for the trigger. A generated id is used when omitted. */\n id?: string;\n /** Custom className for the wrapper. */\n className?: string;\n /** Label displayed above the trigger. */\n label?: ReactNode;\n /** Text shown in the trigger while nothing is selected. @default "Select..." */\n placeholder?: string;\n /** Helper text displayed below the trigger. */\n helperText?: ReactNode;\n /** Display error styling. @default false */\n error?: boolean;\n /** Disable all interaction. @default false */\n disabled?: boolean;\n /** Trigger size variant. @default "md" */\n size?: TMultiSelectTransferSize;\n\n /**\n * Options to choose from; treated as the result for the current query in server mode. Ignored (with\n * a dev warning) when `loadOptions` is set \u2014 pass `initialOptions` to seed the list instead.\n */\n options?: TMultiSelectTransferOption[];\n /** Selected options. Passing this makes the component controlled. */\n value?: TMultiSelectTransferOption[];\n /** Fired with the next selection when the dropdown or modal commits. */\n onChange?: ( selected: TMultiSelectTransferOption[]) => void;\n\n /** Seeds/re-syncs dropdown search; semi-controlled \u2014 pair with onFilterChange. */\n filterValue?: string;\n /**\n * Debounced search-query callback; also called with "" when the component clears search (dropdown\n * commit/cancel, or opening the transfer list modal).\n *\n * Without `loadOptions`: switches off local filtering \u2014 `options` is treated as already filtered\n * for the query \u2014 and the fetch, loading state, paging, and response ordering are the consumer\'s\n * responsibility.\n *\n * With `loadOptions`: notification-only, for analytics or `filterValue` syncing.\n */\n onFilterChange?: ( query: string ) => void;\n /** Placeholder for the dropdown filter input and the transfer list modal\'s panel search inputs. @default "Search..." */\n searchPlaceholder?: string;\n /** Debounce for the search query, in both sync and `loadOptions` mode. Set to 0 to disable. @default 300 */\n filterDebounceMs?: number;\n\n // Consumer-owned paging, the escape-hatch counterpart to `onFilterChange` above. Both are ignored\n // when `loadOptions` is set, which derives them from the cursor the loader returns.\n /** Whether more options can be loaded; arms the dropdown\'s infinite-scroll sentinel. Ignored when `loadOptions` is set. @default false */\n hasMore?: boolean;\n /** Fired when the infinite-scroll sentinel at the bottom of the option list scrolls into view. Ignored when `loadOptions` is set. */\n onLoadMore?: () => void;\n /** Loader replaces rows on search fetch, appends on load-more. OR-ed with the loader\'s own state, so it still applies in async mode. @default false */\n isLoading?: boolean;\n\n /** Max pills shown in the trigger before showing "+N More". @default 3 */\n maxVisiblePills?: number;\n\n /** Title rendered in the transfer list modal header. */\n transferListTitle?: ReactNode;\n /** Subtitle rendered under the modal title. */\n transferListSubtitle?: ReactNode;\n /** Fully custom modal header node; overrides title/subtitle when provided. */\n transferListHeader?: ReactNode;\n /** Called when the transfer list CTA is clicked (before the modal opens). */\n onOpenTransferList?: () => void;\n\n /** Enable reordering (drag + arrows) of selected items in the transfer list. */\n reorderable?: boolean;\n /** The reload button is shown when this is provided. Fired when the reload button is clicked. */\n onReload?: () => void;\n /** Spins the transfer list reload icon. */\n isReloading?: boolean;\n /** Tooltip for the transfer list reload button. */\n reloadTooltip?: string;\n /** Custom content rendered under the transfer list available panel search. */\n availablePanelHeaderSlot?: ReactNode;\n /** Custom content rendered under the transfer list selected panel search. */\n selectedPanelHeaderSlot?: ReactNode;\n /** Label for the modal cancel button. @default "Cancel" */\n cancelLabel?: ReactNode;\n /** Label for the modal commit button. @default "Done" */\n doneLabel?: ReactNode;\n\n /**\n * Server-side option source. When provided, the component owns the option list, paging, the request\n * lifecycle and the loading state; `options` / `hasMore` / `onLoadMore` / `isLoading` are ignored and\n * `onFilterChange` becomes notification-only. Responsible for mapping the payload to\n * `TMultiSelectTransferOption` \u2014 envelopes and domain filtering are the consumer\'s business. Options\n * are stored exactly as returned, so extra fields survive. A fresh inline arrow is fine: the loader\n * is read through a ref.\n */\n loadOptions?: TMultiSelectTransferLoadOptions;\n /**\n * Seed rows for a list you already have \u2014 an SSR payload, a route loader, a warm cache. They paint on the\n * first frame of both surfaces instead of a loader, and stay put while the baseline fetch revalidates over\n * them (the dropdown\'s spinner appends below the rows, as it does for any load in flight). They do not\n * suppress that fetch: pair with `prefetch="never"` if the seed is the whole list until the user types.\n * Seed rows carry no cursor, so nothing pages until a real page lands.\n * A *search* replaces them, since seed rows are not results for a query; clearing it brings them back until\n * a fetched baseline does. Async mode only \u2014 ignored (dev warning) without `loadOptions`, where the rows\n * belong in `options`.\n */\n initialOptions?: readonly TMultiSelectTransferOption[];\n /**\n * When to fetch the unfiltered first page.\n * - `"open"` \u2014 when the dropdown or the transfer-list modal first opens, whichever comes first.\n * - `"mount"` \u2014 at render, so the first open shows rows instead of a loader. The trigger renders its\n * committed chips either way, so this buys latency rather than fixing an empty-looking control.\n * - `"never"` \u2014 no baseline at all; fetch only once the user types. For heavy lists.\n *\n * Async mode only \u2014 ignored (dev warning) without `loadOptions`, where `options` are already on screen\n * and there is nothing to fetch.\n * @default "open"\n */\n prefetch?: TPrefetch;\n /** Clearing the search revalidates the cached baseline instead of just restoring it. @default false */\n refetchOnClear?: boolean;\n /**\n * Identity of the option set, for dependent pickers. When it changes, cached pages are dropped and the\n * list is repopulated. Compose several parents into one scalar. Does NOT clear the selection.\n */\n optionsKey?: string | number;\n /** Shown in place of the rows when `loadOptions` rejects. @default "Couldn\'t load options." */\n loadErrorMessage?: ReactNode;\n /** Shown under the loaded rows when a page append rejects; a failed page never blanks the list. @default "Couldn\'t load more." */\n loadMoreErrorMessage?: ReactNode;\n /** Label for the retry button beside `loadMoreErrorMessage`. @default "Retry" */\n retryLabel?: string;\n /** Shows the reload button in async mode, wired to re-run the current query from page one. @default false */\n showReloadButton?: boolean;\n /** Notified when a load rejects (the component renders the message and swallows it). */\n onLoadError?: ( error: unknown ) => void;\n}\n'
2443
+ },
2444
+ {
2445
+ "name": "multiSelectTransferVariants.ts",
2446
+ "content": `import { tv } from "tailwind-variants";
2447
+
2448
+ export const multiSelectTransferVariants = tv({
2449
+ slots: {
2450
+ base: "flex flex-col gap-2",
2451
+ label: "text-base text-secondary-400 font-medium dark:text-secondary-300",
2452
+ helperText: "text-xs font-normal",
2453
+ trigger: "flex items-center gap-2 min-h-[38px] rounded border bg-white dark:bg-iridium cursor-pointer outline-none transition-shadow",
2454
+ dropdownContainer: "absolute z-[2020] w-full mt-2 rounded border border-secondary-50 dark:border-secondary-500" +
2455
+ " bg-white dark:bg-iridium shadow-xs overflow-hidden",
2456
+ dropdownHeader: "border-b border-secondary-100 dark:border-secondary-500 py-3 px-4 flex items-center gap-4",
2457
+ filterInput: "w-full outline-none bg-transparent text-secondary-500 dark:text-secondary-200" +
2458
+ " placeholder:text-secondary-200 dark:placeholder:text-secondary-400 rounded border border-secondary-100 dark:border-secondary-500 p-2",
2459
+ optionsList: "max-h-60 overflow-y-auto",
2460
+ // "No options" when empty and not mid search-fetch.
2461
+ noOptionsMessage: "px-4 py-2.5 text-center text-secondary-400 dark:text-secondary-300",
2462
+ // Loader row (replaces on search fetch, appends on load-more \u2014 see dropdown).
2463
+ loaderRow: "flex justify-center py-3",
2464
+ // "Error instead of rows", and the recoverable "that page failed" row below the loaded rows.
2465
+ errorMessage: "px-4 py-3 text-center text-sm text-error-700 dark:text-error-400",
2466
+ loadMoreErrorRow: "flex items-center justify-center gap-2 py-3 text-sm text-error-700 dark:text-error-400",
2467
+ optionItem: "group relative flex items-center gap-2 px-4 py-2.5 cursor-pointer outline-none" +
2468
+ " hover:bg-frostBlue focus-visible:bg-frostBlue dark:hover:bg-secondary-800 dark:focus-visible:bg-secondary-800",
2469
+ // self-stretch pins the wrapper's height to the row's cross-size (driven by the checkbox)
2470
+ // instead of its own content, so it never collapses when the label goes absolute - that
2471
+ // collapse was what caused the label to jump down on hover. The expand itself is gated on
2472
+ // data-truncated (set by useIsTruncated on the row), so labels that already fit get no
2473
+ // hover treatment or background at all.
2474
+ optionLabelWrap: "relative flex flex-1 min-w-0 items-center self-stretch",
2475
+ optionLabel: "block w-full min-w-0 truncate text-secondary-500 dark:text-secondary-200" +
2476
+ " group-data-[truncated=true]:group-hover:absolute group-data-[truncated=true]:group-hover:inset-x-0" +
2477
+ " group-data-[truncated=true]:group-hover:top-1/2 group-data-[truncated=true]:group-hover:-translate-y-1/2" +
2478
+ " group-data-[truncated=true]:group-hover:z-20 group-data-[truncated=true]:group-hover:whitespace-normal" +
2479
+ " group-data-[truncated=true]:group-hover:overflow-visible group-data-[truncated=true]:group-hover:break-words" +
2480
+ " group-data-[truncated=true]:group-hover:rounded group-data-[truncated=true]:group-hover:border" +
2481
+ " group-data-[truncated=true]:group-hover:border-secondary-200 group-data-[truncated=true]:group-hover:bg-white" +
2482
+ " group-data-[truncated=true]:group-hover:shadow-md group-data-[truncated=true]:group-hover:p-2" +
2483
+ " group-data-[truncated=true]:group-focus-visible:absolute group-data-[truncated=true]:group-focus-visible:inset-x-0" +
2484
+ " group-data-[truncated=true]:group-focus-visible:top-1/2 group-data-[truncated=true]:group-focus-visible:-translate-y-1/2" +
2485
+ " group-data-[truncated=true]:group-focus-visible:z-20 group-data-[truncated=true]:group-focus-visible:whitespace-normal" +
2486
+ " group-data-[truncated=true]:group-focus-visible:overflow-visible group-data-[truncated=true]:group-focus-visible:break-words" +
2487
+ " group-data-[truncated=true]:group-focus-visible:rounded group-data-[truncated=true]:group-focus-visible:border" +
2488
+ " group-data-[truncated=true]:group-focus-visible:border-secondary-200 group-data-[truncated=true]:group-focus-visible:bg-white" +
2489
+ " group-data-[truncated=true]:group-focus-visible:shadow-md" +
2490
+ " dark:group-data-[truncated=true]:group-hover:border-primary-400 dark:group-data-[truncated=true]:group-hover:bg-iridium" +
2491
+ " dark:group-data-[truncated=true]:group-focus-visible:border-primary-400" +
2492
+ " dark:group-data-[truncated=true]:group-focus-visible:bg-iridium",
2493
+ pillsArea: "flex flex-wrap items-center gap-1 flex-1 min-w-0",
2494
+ pill: "inline-flex items-center gap-1 max-w-[12rem] min-w-0 rounded-sm bg-gray-50 dark:bg-secondary-600" +
2495
+ " text-secondary-500 dark:text-secondary-200 py-0.5 ps-2 pe-1 shrink-0",
2496
+ // truncate + min-w-0 keeps a single long label inside the pill's max-width instead of
2497
+ // stretching the pill past the control. The full text is surfaced via a Tooltip, but only when
2498
+ // this label is actually clipped (see MultiSelectTransferPill / useIsTruncated); max-w-full +
2499
+ // explicit colors let it truncate and stay themed inside the Tooltip's flex trigger span.
2500
+ pillLabel: "block min-w-0 max-w-full truncate text-secondary-500 dark:text-secondary-200",
2501
+ pillDismiss: "flex items-center shrink-0 text-secondary-400 hover:text-secondary-600 dark:text-secondary-300 dark:hover:text-secondary-100",
2502
+ pillMore: "whitespace-nowrap shrink-0 text-secondary-400 dark:text-secondary-300",
2503
+ ctaArea: "flex items-center gap-3 shrink-0",
2504
+ ctaButton: "flex items-center text-secondary-400 hover:text-secondary-600 dark:text-secondary-300 dark:hover:text-secondary-100",
2505
+ placeholder: "text-secondary-200 dark:text-secondary-400"
2506
+ },
2507
+ variants: {
2508
+ error: {
2509
+ true: {
2510
+ helperText: "text-error-500 dark:text-error-400",
2511
+ trigger: "border-error-500 dark:border-error-400 focus-within:border-error-500 focus-within:shadow-error-2px"
2512
+ },
2513
+ false: {
2514
+ helperText: "text-secondary-400 dark:text-secondary-200",
2515
+ trigger: "border-gray-200 dark:border-secondary-500 focus-within:border-primary-500 focus-within:shadow-primary-2px"
2516
+ }
2517
+ },
2518
+ size: {
2519
+ md: {
2520
+ trigger: "py-[0.2rem] px-3",
2521
+ filterInput: "text-base",
2522
+ pill: "text-base",
2523
+ pillMore: "text-base",
2524
+ placeholder: "text-base",
2525
+ optionLabel: "text-base",
2526
+ noOptionsMessage: "text-base"
2527
+ },
2528
+ lg: {
2529
+ trigger: "py-[0.2rem] px-4",
2530
+ filterInput: "text-md",
2531
+ pill: "text-md",
2532
+ pillMore: "text-md",
2533
+ placeholder: "text-md",
2534
+ optionLabel: "text-md",
2535
+ noOptionsMessage: "text-md"
2536
+ }
2537
+ },
2538
+ disabled: {
2539
+ true: {
2540
+ trigger: "cursor-not-allowed opacity-50 bg-gray-50 dark:bg-secondary-800"
2541
+ },
2542
+ false: {}
2543
+ },
2544
+ checked: {
2545
+ true: { optionItem: "bg-frostBlue dark:bg-secondary-700" },
2546
+ false: {}
2547
+ }
2548
+ },
2549
+ defaultVariants: {
2550
+ error: false,
2551
+ size: "md",
2552
+ disabled: false,
2553
+ checked: false
2554
+ }
2555
+ });
2556
+ `
2557
+ },
2558
+ {
2559
+ "name": "multiSelectTransferTrigger.tsx",
2560
+ "content": 'import * as React from "react";\n\nimport { ADPIcon, iconList } from "../adpIcon";\nimport { MultiSelectTransferPill } from "./multiSelectTransferPill";\nimport { multiSelectTransferVariants } from "./multiSelectTransferVariants";\nimport type { TMultiSelectTransferOption, TMultiSelectTransferSize } from "./types";\n\ninterface IMultiSelectTransferTriggerProps {\n id: string;\n error?: boolean;\n size: TMultiSelectTransferSize;\n disabled: boolean;\n isOpen: boolean;\n /** The committed selection \u2014 the trigger shows pills for this, never for the in-progress draft. */\n value: TMultiSelectTransferOption[];\n placeholder: string;\n maxVisiblePills: number;\n onClick: () => void;\n onKeyDown: ( e: React.KeyboardEvent<HTMLDivElement> ) => void;\n onRemovePill: ( option: TMultiSelectTransferOption, e: React.MouseEvent ) => void;\n onOpenTransferList: ( e: React.MouseEvent ) => void;\n}\n\n/**\n * The read-only control for MultiSelectTransfer: committed pills (capped by `maxVisiblePills` with a\n * "+N More" overflow), the transfer-list CTA and the open/close chevron. It owns no state.\n *\n * The trigger comes back through `forwardRef`, not a `triggerRef` prop: a ref taken as an ordinary\n * prop cannot be merged with a caller\'s own, and is invisible to anything composing over `ref`.\n */\nexport const MultiSelectTransferTrigger = React.forwardRef<\n HTMLDivElement,\n IMultiSelectTransferTriggerProps\n>( function MultiSelectTransferTrigger({\n id,\n error,\n size,\n disabled,\n isOpen,\n value,\n placeholder,\n maxVisiblePills,\n onClick,\n onKeyDown,\n onRemovePill,\n onOpenTransferList\n}, triggerRef ) {\n const {\n trigger,\n pillsArea,\n pill: pillClass,\n pillLabel,\n pillDismiss,\n pillMore,\n ctaArea,\n ctaButton,\n placeholder: placeholderClass\n } = multiSelectTransferVariants({ error, size, disabled });\n\n const visiblePills = value.slice( 0, maxVisiblePills );\n const overflowCount = value.length - visiblePills.length;\n\n return (\n <div\n id={id}\n ref={triggerRef}\n role="button"\n aria-expanded={isOpen}\n aria-haspopup="listbox"\n tabIndex={disabled ? -1 : 0}\n className={trigger()}\n onClick={onClick}\n onKeyDown={onKeyDown}\n >\n <div className={pillsArea()}>\n {value.length === 0 ? (\n <span className={placeholderClass()}>{placeholder}</span>\n ) : (\n <>\n {visiblePills.map(( opt ) => (\n <MultiSelectTransferPill\n key={opt.value}\n option={opt}\n pillClass={pillClass()}\n pillLabelClass={pillLabel()}\n pillDismissClass={pillDismiss()}\n onRemove={onRemovePill}\n />\n ))}\n {overflowCount > 0 && <span className={pillMore()}>+{overflowCount} More</span>}\n </>\n )}\n </div>\n <div className={ctaArea()}>\n <button\n type="button"\n aria-label="Open transfer list"\n title="Open transfer list"\n className={ctaButton()}\n onClick={onOpenTransferList}\n disabled={disabled}\n >\n <ADPIcon icon={iconList.expand} size="xs" />\n </button>\n <ADPIcon icon={isOpen ? iconList.upArrow : iconList.downArrow} className={ctaButton()} size="xs" />\n </div>\n </div>\n );\n});\n\nMultiSelectTransferTrigger.displayName = "MultiSelectTransferTrigger";\n'
2561
+ },
2562
+ {
2563
+ "name": "multiSelectTransferPill.tsx",
2564
+ "content": 'import * as React from "react";\n\nimport { useIsTruncated } from "@hooks";\nimport { ADPIcon, iconList } from "../adpIcon";\nimport { Tooltip } from "../tooltip";\nimport { type TMultiSelectTransferOption } from "./types";\n\ninterface IMultiSelectTransferPillProps {\n option: TMultiSelectTransferOption;\n /** tv() class for the pill container (doubles as the truncation observer root). */\n pillClass: string;\n /** tv() class for the (truncating) label. */\n pillLabelClass: string;\n /** tv() class for the dismiss button. */\n pillDismissClass: string;\n onRemove: ( option: TMultiSelectTransferOption, e: React.MouseEvent ) => void;\n}\n\n/**\n * A single selected pill in the trigger. Its own component (not inlined in the map) so it can run\n * {@link useIsTruncated} per pill: the full label is surfaced in a Tooltip only when the label is\n * actually clipped, instead of on every pill hover.\n *\n * The Tooltip always wraps the label (gated via its `canOpen` prop) rather than being swapped in\n * and out - that keeps the measured label element mounted so the truncation observer never loses\n * its target. `triggerElementClassName` makes the Tooltip\'s trigger span a shrinkable flex box so\n * the nested label still truncates against the pill\'s max-width. Non-string (ReactNode) labels\n * have no text to show, so they render plainly.\n */\nexport function MultiSelectTransferPill({\n option,\n pillClass,\n pillLabelClass,\n pillDismissClass,\n onRemove\n}: IMultiSelectTransferPillProps ): React.ReactElement {\n const { ref: labelRef, containerRef: pillRef, isTruncated } = useIsTruncated<HTMLSpanElement, HTMLSpanElement>();\n const isStringLabel = typeof option.label === "string";\n\n return (\n <span ref={pillRef} className={pillClass}>\n {isStringLabel ? (\n <Tooltip\n placement="top"\n canOpen={isTruncated}\n title={option.label as string}\n triggerElementClassName="flex min-w-0 max-w-full"\n trigger={\n <span ref={labelRef} className={pillLabelClass}>\n {option.label}\n </span>\n }\n />\n ) : (\n <span className={pillLabelClass}>{option.label}</span>\n )}\n <button\n type="button"\n aria-label={`Remove ${option.value}`}\n className={pillDismissClass}\n onClick={( e ) => onRemove( option, e )}\n >\n <ADPIcon icon={iconList.cross} size="xs" />\n </button>\n </span>\n );\n}\n\nMultiSelectTransferPill.displayName = "MultiSelectTransferPill";\n'
2565
+ },
2566
+ {
2567
+ "name": "multiSelectTransferModal.tsx",
2568
+ "content": `import * as React from "react";
2569
+ import { cn } from "tailwind-variants";
2570
+
2571
+ import { Modal } from "../modal";
2572
+ import { Button } from "../button";
2573
+ import { TransferList } from "../transferList";
2574
+ import type { TMultiSelectTransferOption } from "./types";
2575
+
2576
+ interface IMultiSelectTransferModalProps {
2577
+ showModal: boolean;
2578
+ availableItems: TMultiSelectTransferOption[];
2579
+ selectedItems: TMultiSelectTransferOption[];
2580
+ onChange: ( availableItems: TMultiSelectTransferOption[], selectedItems: TMultiSelectTransferOption[]) => void;
2581
+ onCancel: () => void;
2582
+ onDone: () => void;
2583
+
2584
+ header?: React.ReactNode;
2585
+ title?: React.ReactNode;
2586
+ subtitle?: React.ReactNode;
2587
+
2588
+ reorderable?: boolean;
2589
+ reloadTooltip?: string;
2590
+ onReload?: () => void;
2591
+ isReloading?: boolean;
2592
+ searchPlaceholder?: string;
2593
+ availablePanelHeaderSlot?: React.ReactNode;
2594
+ selectedPanelHeaderSlot?: React.ReactNode;
2595
+
2596
+ hasMoreAvailable?: boolean;
2597
+ onLoadMoreAvailable?: () => void;
2598
+ /** Loader (or error) REPLACES the available rows rather than appending below them. */
2599
+ isLoadingAvailable?: boolean;
2600
+ /** Loader appends below the available rows (a page fetch). */
2601
+ isLoadingMoreAvailable: boolean;
2602
+ availableLoadError?: React.ReactNode;
2603
+ availableLoadMoreError?: React.ReactNode;
2604
+ onRetryLoadMoreAvailable?: () => void;
2605
+ retryLabel?: string;
2606
+ /** Server-side total for the available panel. */
2607
+ availableTotalCount?: number;
2608
+ /** Set (async mode only) to drive the available panel's search server-side. */
2609
+ availableSearchTerm?: string;
2610
+ onAvailableSearchChange?: ( query: string ) => void;
2611
+
2612
+ cancelLabel: React.ReactNode;
2613
+ doneLabel: React.ReactNode;
2614
+ }
2615
+
2616
+ /**
2617
+ * The transfer-list modal surface for MultiSelectTransfer: full-screen on mobile, a widened
2618
+ * centered dialog from sm up. Hosts the two-panel TransferList plus a pinned footer bar.
2619
+ */
2620
+ export function MultiSelectTransferModal({
2621
+ showModal,
2622
+ availableItems,
2623
+ selectedItems,
2624
+ onChange,
2625
+ onCancel,
2626
+ onDone,
2627
+ header,
2628
+ title,
2629
+ subtitle,
2630
+ reorderable,
2631
+ reloadTooltip,
2632
+ onReload,
2633
+ isReloading,
2634
+ searchPlaceholder,
2635
+ availablePanelHeaderSlot,
2636
+ selectedPanelHeaderSlot,
2637
+ hasMoreAvailable,
2638
+ onLoadMoreAvailable,
2639
+ isLoadingAvailable,
2640
+ isLoadingMoreAvailable,
2641
+ availableLoadError,
2642
+ availableLoadMoreError,
2643
+ onRetryLoadMoreAvailable,
2644
+ retryLabel,
2645
+ availableTotalCount,
2646
+ availableSearchTerm,
2647
+ onAvailableSearchChange,
2648
+ cancelLabel,
2649
+ doneLabel
2650
+ }: IMultiSelectTransferModalProps ): React.ReactElement {
2651
+ return (
2652
+ <Modal
2653
+ showModal={showModal}
2654
+ onHide={onCancel}
2655
+ className={cn(
2656
+ "flex flex-col w-screen h-screen max-w-none max-h-none rounded-none dark:bg-secondary-800",
2657
+ "sm:w-[56rem] sm:h-auto sm:max-w-[calc(100vw-2.5rem)] sm:max-h-[calc(100vh-2.5rem)] sm:rounded"
2658
+ )}
2659
+ >
2660
+ <Modal.Header>
2661
+ {header ?? (
2662
+ <div className="flex flex-col gap-1">
2663
+ <span className="text-secondary-500 dark:text-secondary-50 text-md">{title ?? "Select Items"}</span>
2664
+ {subtitle !== undefined && (
2665
+ <span className="text-base font-normal text-secondary-400 dark:text-secondary-400">
2666
+ {subtitle}
2667
+ </span>
2668
+ )}
2669
+ </div>
2670
+ )}
2671
+ </Modal.Header>
2672
+ {/* Full-bleed frostBlue body (offsets the modal's p-6) with the panels on top,
2673
+ and a pinned white footer bar matching the design. overflow-y-hidden overrides
2674
+ Modal.Body's own scroll so the footer can't be dragged into the scroll region;
2675
+ the panel wrapper below is the actual scrollable area on mobile where the two
2676
+ stacked panels can exceed the viewport height. */}
2677
+ <Modal.Body className="flex flex-col flex-1 min-h-0 mt-4 -mx-6 -mb-6 max-h-none overflow-y-hidden bg-frostBlue dark:bg-iridium">
2678
+ <div className="flex-1 min-h-0 px-6 py-5 overflow-y-auto">
2679
+ <TransferList
2680
+ availableItems={availableItems}
2681
+ selectedItems={selectedItems}
2682
+ onChange={onChange}
2683
+ reorderable={reorderable}
2684
+ reloadTooltip={reloadTooltip}
2685
+ onReload={onReload}
2686
+ isReloading={isReloading}
2687
+ searchPlaceholder={searchPlaceholder}
2688
+ availablePanelHeaderSlot={availablePanelHeaderSlot}
2689
+ selectedPanelHeaderSlot={selectedPanelHeaderSlot}
2690
+ hasMoreAvailable={hasMoreAvailable}
2691
+ onLoadMoreAvailable={onLoadMoreAvailable}
2692
+ isLoadingMoreAvailable={isLoadingMoreAvailable}
2693
+ isLoadingAvailable={isLoadingAvailable}
2694
+ availableLoadError={availableLoadError}
2695
+ availableLoadMoreError={availableLoadMoreError}
2696
+ onRetryLoadMoreAvailable={onRetryLoadMoreAvailable}
2697
+ retryLabel={retryLabel}
2698
+ availableTotalCount={availableTotalCount}
2699
+ availableSearchTerm={availableSearchTerm}
2700
+ onAvailableSearchChange={onAvailableSearchChange}
2701
+ />
2702
+ </div>
2703
+ <div className="flex justify-end gap-3 px-6 py-4 bg-white border-t z-10 border-secondary-100 dark:bg-secondary-800 dark:border-secondary-500">
2704
+ <Button size="sm" variant="outline" color="secondary" onClick={onCancel}>
2705
+ {cancelLabel}
2706
+ </Button>
2707
+ <Button size="sm" onClick={onDone}>{doneLabel}</Button>
2708
+ </div>
2709
+ </Modal.Body>
2710
+ </Modal>
2711
+ );
2712
+ }
2713
+
2714
+ MultiSelectTransferModal.displayName = "MultiSelectTransferModal";
2715
+ `
2716
+ },
2717
+ {
2718
+ "name": "multiSelectTransferDropdown.tsx",
2719
+ "content": 'import * as React from "react";\nimport { useId, useMemo, useRef } from "react";\nimport { cn } from "tailwind-variants";\n\nimport { Checkbox } from "../checkbox";\nimport { Loader } from "../loader";\nimport { Button } from "../button";\nimport { ReloadButton } from "../button/reloadButton";\n\nimport { useIsTruncated, useListboxKeyboardNav, type TSentinelRef } from "@hooks";\nimport { keyboardKeys } from "@constants";\nimport type { TTransferListValue } from "../transferList/types";\nimport { multiSelectTransferVariants } from "./multiSelectTransferVariants";\nimport type { TMultiSelectTransferOption, TMultiSelectTransferSize } from "./types";\n\n// Past this many rows the options list is windowed (virtualized) instead of fully rendered, so a\n// very large option set doesn\'t mount thousands of rows (each with its own ResizeObserver).\nconst VIRTUALIZE_THRESHOLD = 100;\n// Approximate row height (px) used before rows are measured; measureElement corrects it.\nconst ESTIMATED_OPTION_HEIGHT = 40;\n// Keys blocked during search fetch (see handleKeyDown).\nconst navigationKeys = new Set([\n keyboardKeys.arrowDown,\n keyboardKeys.arrowUp,\n keyboardKeys.home,\n keyboardKeys.end,\n keyboardKeys.enter\n]);\n\ninterface IOptionRowProps {\n id: string;\n label: React.ReactNode;\n checked: boolean;\n active: boolean;\n disabled?: boolean;\n onToggle: () => void;\n onActivate: () => void;\n optionItemClass: string | undefined;\n optionLabelWrapClass: string;\n optionLabelClass: string;\n}\n\n/**\n * A single dropdown row (both "Select All" and regular options): checkbox + label. Measures\n * its own label via `useIsTruncated` so the hover/focus expand affordance (see\n * multiSelectTransferVariants\' optionLabel) only ever shows up on rows whose text is actually\n * clipped.\n *\n * Rows are not individually tabbable: focus stays on the filter input (a combobox) and keyboard\n * navigation is driven by `aria-activedescendant` / arrow keys from there. `active` marks the row\n * the arrow keys have landed on so it can be highlighted and scrolled into view; the pointer path\n * still toggles on click / activates on hover.\n */\nfunction OptionRow({\n id,\n label,\n checked,\n active,\n disabled,\n onToggle,\n onActivate,\n optionItemClass,\n optionLabelWrapClass,\n optionLabelClass\n}: IOptionRowProps ): React.ReactElement {\n const { ref: labelRef, containerRef: labelWrapRef, isTruncated: isLabelTruncated } = useIsTruncated<HTMLSpanElement>();\n\n return (\n <div\n id={id}\n role="option"\n aria-selected={checked}\n aria-disabled={disabled}\n data-active={active || undefined}\n data-truncated={isLabelTruncated || undefined}\n className={optionItemClass}\n onClick={() => {\n if ( !disabled ) {\n onToggle();\n }\n }}\n onMouseMove={() => {\n if ( !disabled && !active ) {\n onActivate();\n }\n }}\n >\n {/* The row div owns the toggle; the checkbox is presentational (readOnly). */}\n <Checkbox checked={checked} disabled={disabled} readOnly tabIndex={-1} />\n <span ref={labelWrapRef} className={optionLabelWrapClass}>\n <span ref={labelRef} className={optionLabelClass}>{label}</span>\n </span>\n </div>\n );\n}\n\n/** A navigable row in the dropdown: the optional "Select All" pseudo-row or a real option. */\ntype TDropdownRow =\n | { kind: "select-all" }\n | { kind: "option"; option: TMultiSelectTransferOption };\n\ninterface IMultiSelectTransferDropdownProps {\n error?: boolean;\n size: TMultiSelectTransferSize;\n disabled?: boolean;\n\n filterQuery: string;\n onFilterInput: ( e: React.ChangeEvent<HTMLInputElement> ) => void;\n onFilterKeyDown: ( e: React.KeyboardEvent<HTMLInputElement> ) => void;\n onFilterKeyUp: ( e: React.KeyboardEvent<HTMLInputElement> ) => void;\n onFilterBlur: ( e: React.FocusEvent<HTMLInputElement> ) => void;\n searchPlaceholder: string;\n\n /** Readonly so the option source\'s pool can be passed through without a defensive copy. */\n options: readonly TMultiSelectTransferOption[];\n selectedValues: Set<TTransferListValue>;\n onOptionToggle: ( option: TMultiSelectTransferOption ) => void;\n\n hasSelectAll: boolean;\n areAllSelected: boolean;\n onSelectAll: () => void;\n\n /** Any load in flight; renders the loader row below the list. */\n isLoading?: boolean;\n /**\n * Loader (or error) takes the rows\' place rather than appending below them. Required, and supplied\n * by the option source rather than re-derived here, so the hook is the single source of this\n * predicate \u2014 two components deriving it differently is how they drifted.\n */\n isSearchFetch: boolean;\n sentinelRef: TSentinelRef;\n\n /** Replaces the rows when set: the whole list failed to load. */\n loadError?: React.ReactNode;\n /** Shown below the loaded rows when a page append failed. */\n loadMoreError?: React.ReactNode;\n /** Fired by the retry button beside `loadMoreError`. */\n onRetryLoadMore?: () => void;\n retryLabel?: string;\n\n reloadTooltip?: string;\n onReload?: () => void;\n isReloading?: boolean;\n}\n\n/**\n * The open-state dropdown for MultiSelectTransfer: a search input, an optional "Select All"\n * row, the (draft-checked) option list, and the infinite-scroll sentinel.\n */\nexport function MultiSelectTransferDropdown({\n error,\n size,\n disabled,\n filterQuery,\n onFilterInput,\n onFilterKeyDown,\n onFilterKeyUp,\n onFilterBlur,\n searchPlaceholder,\n options,\n selectedValues,\n onOptionToggle,\n hasSelectAll,\n areAllSelected,\n onSelectAll,\n isLoading,\n isSearchFetch,\n sentinelRef,\n loadError,\n loadMoreError,\n onRetryLoadMore,\n retryLabel = "Retry",\n reloadTooltip,\n onReload,\n isReloading\n}: IMultiSelectTransferDropdownProps ): React.ReactElement {\n const {\n dropdownContainer,\n dropdownHeader,\n filterInput,\n optionsList,\n noOptionsMessage,\n loaderRow,\n errorMessage,\n loadMoreErrorRow,\n optionItem,\n optionLabelWrap,\n optionLabel\n } = multiSelectTransferVariants({ error, size, disabled });\n\n const listboxId = useId();\n const listRef = useRef<HTMLDivElement>( null );\n\n // The error occupies the loader\'s slot, so it inherits the same nav-key and activedescendant gate.\n const areRowsReplaced = isSearchFetch === true || loadError !== undefined;\n\n // Flat list of navigable rows in render order: the "Select All" pseudo-row (if shown) followed\n // by the options. Drives arrow-key navigation and aria-activedescendant.\n const rows = useMemo<TDropdownRow[]>(\n () => [\n ...( hasSelectAll ? [{ kind: "select-all" as const }] : []),\n ...options.map(( option ) => ({ kind: "option" as const, option }))\n ],\n [ hasSelectAll, options ]\n );\n\n const isRowDisabled = ( row: TDropdownRow ): boolean =>\n row.kind === "option" && Boolean( row.option.isDisabled );\n\n const rowId = ( index: number ): string => `${listboxId}-row-${index}`;\n\n // A stable key for the current option set, so the active row resets to the first selectable\n // row only when the list actually changes (e.g. after filtering) - not on every re-render,\n // which would fight the user\'s arrow-key position. Memoized so it recomputes only with `rows`.\n const rowsKey = useMemo(\n () => rows.map(( r ) => ( r.kind === "option" ? r.option.value : "select-all" )).join( "\\n" ),\n [rows]\n );\n\n // Windowing kicks in only past the threshold; below it every row renders directly (no\n // virtualization). The virtualizer scroll element is the options list itself (max-h-60 overflow-y-auto).\n const {\n activeIndex,\n setActiveIndex,\n moveActive,\n firstEnabledIndex,\n virtualizer: rowVirtualizer,\n shouldVirtualize\n } = useListboxKeyboardNav({\n itemCount: rows.length,\n isItemDisabled: ( index ) => isRowDisabled( rows[index]),\n resetKey: rowsKey,\n scrollElementRef: listRef,\n optionId: rowId,\n estimateSize: ESTIMATED_OPTION_HEIGHT,\n virtualizeThreshold: VIRTUALIZE_THRESHOLD\n });\n\n const activateRow = ( index: number ) => {\n const row = rows[index];\n if ( !row ) {\n return;\n }\n if ( row.kind === "select-all" ) {\n onSelectAll();\n } else if ( !row.option.isDisabled ) {\n onOptionToggle( row.option );\n }\n };\n\n // Nav keys handled here; Escape/Tab/delete-hold delegated to parent.\n const handleKeyDown = ( e: React.KeyboardEvent<HTMLInputElement> ) => {\n // Ignore nav keys during search fetch \u2014 stale rows still in memory.\n if ( areRowsReplaced && navigationKeys.has( e.key )) {\n e.preventDefault();\n return;\n }\n switch ( e.key ) {\n case keyboardKeys.arrowDown:\n e.preventDefault();\n moveActive( 1 );\n break;\n case keyboardKeys.arrowUp:\n e.preventDefault();\n moveActive( -1 );\n break;\n case keyboardKeys.home:\n e.preventDefault();\n setActiveIndex( firstEnabledIndex( 0, 1 ));\n break;\n case keyboardKeys.end:\n e.preventDefault();\n setActiveIndex( firstEnabledIndex( rows.length - 1, -1 ));\n break;\n case keyboardKeys.enter:\n e.preventDefault();\n activateRow( activeIndex );\n break;\n default:\n onFilterKeyDown( e );\n }\n };\n\n // Dropped while the rows are unmounted, so it never points at an id that has left the DOM.\n const activeDescendant =\n !areRowsReplaced && activeIndex >= 0 && rows.length > 0 ? rowId( activeIndex ) : undefined;\n\n const rowKey = ( row: TDropdownRow ): string | number => ( row.kind === "option" ? row.option.value : "select-all" );\n\n // Shared row renderer so the windowed and full-render paths produce identical rows.\n const renderRow = ( row: TDropdownRow, index: number ): React.ReactElement => {\n const isActive = index === activeIndex;\n const activeClass = isActive && "bg-frostBlue dark:bg-secondary-800";\n if ( row.kind === "select-all" ) {\n return (\n <OptionRow\n key="select-all"\n id={rowId( index )}\n label="Select All"\n checked={areAllSelected}\n active={isActive}\n onToggle={onSelectAll}\n onActivate={() => setActiveIndex( index )}\n optionItemClass={cn( optionItem({ checked: areAllSelected }), activeClass )}\n optionLabelWrapClass={optionLabelWrap()}\n optionLabelClass={optionLabel()}\n />\n );\n }\n const opt = row.option;\n const isChecked = selectedValues.has( opt.value );\n return (\n <OptionRow\n key={opt.value}\n id={rowId( index )}\n label={opt.label}\n checked={isChecked}\n active={isActive}\n disabled={opt.isDisabled}\n onToggle={() => onOptionToggle( opt )}\n onActivate={() => setActiveIndex( index )}\n optionItemClass={cn(\n optionItem({ checked: isChecked }),\n !opt.isDisabled && activeClass,\n opt.isDisabled && "opacity-50 cursor-not-allowed"\n )}\n optionLabelWrapClass={optionLabelWrap()}\n optionLabelClass={optionLabel()}\n />\n );\n };\n\n // Lazy fn avoids virtualizer/measure work on loader-only renders.\n const renderOptionRows = (): React.ReactNode => ( shouldVirtualize ? (\n <div className="relative w-full" style={{ height: rowVirtualizer.getTotalSize() }}>\n {rowVirtualizer.getVirtualItems().map(( virtualRow ) => (\n <div\n key={rowKey( rows[virtualRow.index])}\n data-index={virtualRow.index}\n ref={rowVirtualizer.measureElement}\n className="absolute inset-x-0 top-0"\n style={{ transform: `translateY(${virtualRow.start}px)` }}\n >\n {renderRow( rows[virtualRow.index], virtualRow.index )}\n </div>\n ))}\n {/* Sentinel pinned to the bottom of the full scroll height. */}\n <div ref={sentinelRef} className="absolute bottom-0 h-px w-px" aria-hidden="true" />\n </div>\n ) : (\n <>\n {rows.map(( row, index ) => renderRow( row, index ))}\n {/* Infinite scroll sentinel */}\n <div ref={sentinelRef} className="h-px" aria-hidden="true" />\n </>\n ));\n\n return (\n <div className={dropdownContainer()}>\n <div className={dropdownHeader()}>\n <input\n type="text"\n value={filterQuery}\n onChange={onFilterInput}\n onKeyDown={handleKeyDown}\n onKeyUp={onFilterKeyUp}\n onBlur={onFilterBlur}\n placeholder={searchPlaceholder}\n className={filterInput()}\n role="combobox"\n aria-expanded="true"\n aria-controls={listboxId}\n aria-activedescendant={activeDescendant}\n aria-autocomplete="list"\n aria-label="Search options"\n autoFocus\n />\n\n <ReloadButton onReload={onReload} isReloading={isReloading} tooltip={reloadTooltip} />\n </div>\n\n {/* Outer scroll: loader/error/empty sit outside listbox (not valid listbox children). */}\n <div ref={listRef} className={optionsList()}>\n <div id={listboxId} role="listbox" aria-multiselectable="true" aria-busy={isLoading}>\n {!areRowsReplaced && options.length > 0 && renderOptionRows()}\n </div>\n {/* role="alert" is assertive: the user\'s action did not do what they asked. */}\n {loadError !== undefined && (\n <div className={errorMessage()} role="alert">{loadError}</div>\n )}\n {!areRowsReplaced && options.length === 0 && (\n <div className={noOptionsMessage()}>No options</div>\n )}\n {/* A failed page append keeps the rows and offers Retry. Only this button retries, so a\n sentinel that never left the viewport cannot hammer a failing endpoint. */}\n {loadMoreError !== undefined && (\n <div className={loadMoreErrorRow()} role="alert">\n <span>{loadMoreError}</span>\n {typeof onRetryLoadMore === "function" && (\n <Button size="xs" variant="outline" color="secondary" onClick={onRetryLoadMore}>\n {retryLabel}\n </Button>\n )}\n </div>\n )}\n {isLoading && (\n <div className={loaderRow()} role="status" aria-label="Loading">\n <Loader size="sm" />\n </div>\n )}\n </div>\n </div>\n );\n}\n\nMultiSelectTransferDropdown.displayName = "MultiSelectTransferDropdown";\n'
2720
+ },
2721
+ {
2722
+ "name": "multiSelectTransfer.tsx",
2723
+ "content": 'import * as React from "react";\nimport { useState, useRef, useEffect, useId, useCallback, useMemo } from "react";\nimport mergeRefs from "react-merge-refs";\n\nimport { keyboardKeys } from "@constants";\nimport { useFilterQuery, useInfiniteScroll, useOnValueChange, usePrefetchBaseline } from "@hooks";\nimport { matchesQuery } from "@utils";\nimport { MultiSelectTransferDropdown } from "./multiSelectTransferDropdown";\nimport { MultiSelectTransferTrigger } from "./multiSelectTransferTrigger";\nimport { MultiSelectTransferModal } from "./multiSelectTransferModal";\nimport { useMultiSelectTransferOptionSource } from "./useMultiSelectTransferOptionSource";\nimport { useMultiSelectTransferDraft } from "./useMultiSelectTransferDraft";\nimport { multiSelectTransferVariants } from "./multiSelectTransferVariants";\nimport {\n EMultiSelectTransferSizes,\n type TMultiSelectTransferOption,\n type IMultiSelectTransferProps\n} from "./types";\n\n/**\n * A pill trigger over a dropdown option list, with a two-panel transfer-list modal as its second\n * surface. The forwarded ref lands on the wrapper `<div>`.\n */\nexport const MultiSelectTransfer = React.forwardRef<\n HTMLDivElement,\n IMultiSelectTransferProps\n>( function MultiSelectTransfer({\n id,\n className,\n label,\n placeholder = "Select options...",\n helperText,\n error = false,\n disabled = false,\n size = EMultiSelectTransferSizes.MD,\n options,\n value,\n onChange,\n filterValue,\n onFilterChange,\n searchPlaceholder = "Search...",\n filterDebounceMs = 300,\n hasMore = false,\n onLoadMore,\n isLoading = false,\n maxVisiblePills = 3,\n transferListTitle,\n transferListSubtitle,\n transferListHeader,\n onOpenTransferList,\n reorderable = false,\n reloadTooltip = "Reload",\n onReload,\n isReloading,\n availablePanelHeaderSlot,\n selectedPanelHeaderSlot,\n cancelLabel = "Cancel",\n doneLabel = "Done",\n loadOptions,\n initialOptions,\n // Left undefined here, not defaulted: sync mode warns on a `prefetch` the consumer actually passed,\n // which an eager default would erase. Resolved at the one place that reads it as a trigger.\n prefetch,\n refetchOnClear = false,\n optionsKey,\n loadErrorMessage,\n loadMoreErrorMessage,\n retryLabel = "Retry",\n showReloadButton = false,\n onLoadError\n}, forwardedRef ) {\n const [ isOpen, setIsOpen ] = useState( false );\n const [ pendingSelected, setPendingSelected ] = useState<TMultiSelectTransferOption[]>([]);\n const [ isModalOpen, setIsModalOpen ] = useState( false );\n\n // Committed selection shown as pills in the trigger. When the consumer passes `value` the\n // component is controlled and this tracks it; otherwise (uncontrolled) we own it internally\n // and update it on commit so chips still render without a parent wiring up onChange.\n const isControlled = value !== undefined;\n const [ internalValue, setInternalValue ] = useState<TMultiSelectTransferOption[]>( value ?? []);\n const currentValue = isControlled ? value : internalValue;\n\n const containerRef = useRef<HTMLDivElement>( null );\n // The wrapper is both the consumer\'s ref target and ours (the outside-click check tests against it).\n // Memoised so React does not re-attach it every render.\n const rootRef = useMemo(() => mergeRefs([ forwardedRef, containerRef ]), [forwardedRef]);\n const triggerRef = useRef<HTMLDivElement>( null );\n const generatedId = useId();\n const triggerId = id ?? generatedId;\n\n // Owns the async/legacy mode decision, the option pool, the paging trio, and the replace-vs-append\n // loader question. Declared before useFilterQuery because it supplies that hook\'s handler.\n const optionSource = useMultiSelectTransferOptionSource({\n options,\n loadOptions,\n initialOptions,\n prefetch,\n refetchOnClear,\n optionsKey,\n loadErrorMessage,\n loadMoreErrorMessage,\n showReloadButton,\n onLoadError,\n hasMore,\n onLoadMore,\n isLoading,\n onReload,\n isReloading,\n onFilterChange\n });\n const { clearLoadMoreMode, ensureDefaults } = optionSource;\n\n // Filter query (useFilterQuery); resetFilter notifies server-side consumers on clear.\n const {\n filterQuery,\n handleFilterInput: onQueryInput,\n setFilterQuery: setQuery,\n handleFilterKeyDown,\n handleFilterKeyUp,\n handleFilterBlur,\n resetFilter: resetQuery\n } = useFilterQuery({ filterValue, onFilterChange: optionSource.onFilterQueryChange, filterDebounceMs });\n\n const resetFilter = useCallback(() => {\n clearLoadMoreMode();\n resetQuery();\n }, [ clearLoadMoreMode, resetQuery ]);\n\n // Keep the pending (draft) selection in sync when the parent changes `value` while the\n // dropdown is open. Keyed on the values\' contents (not the array reference) so an unrelated\n // parent re-render passing a new array can\'t wipe the user\'s in-progress draft; it fires\n // only on a real external change or when the dropdown (re)opens.\n const valueRef = useRef( currentValue );\n valueRef.current = currentValue;\n const valueKey = useMemo(() => currentValue.map(( o ) => o.value ).join( "\\n" ), [currentValue]);\n useEffect(() => {\n if ( isOpen ) {\n setPendingSelected( valueRef.current );\n }\n }, [ valueKey, isOpen ]);\n\n // Keep the latest draft in a ref so the outside-click listener can commit it without\n // re-subscribing on every toggle.\n const pendingSelectedRef = useRef( pendingSelected );\n pendingSelectedRef.current = pendingSelected;\n\n // Commit the pending (draft) selection and close the dropdown. Used by outside-click and\n // by toggling the trigger closed.\n const commitSelection = useCallback(() => {\n if ( !isControlled ) {\n setInternalValue( pendingSelectedRef.current );\n }\n onChange?.( pendingSelectedRef.current );\n setIsOpen( false );\n setPendingSelected([]);\n resetFilter();\n }, [ onChange, isControlled, resetFilter ]);\n\n // Infinite-scroll sentinel for the dropdown options list (gated on the open state). The in-flight\n // gate is `isLoadingMore`, not the blanket `isLoading`: a search fetch tearing the observer down and\n // re-arming it is a spurious extra page request.\n const sentinelRef = useInfiniteScroll({\n hasMore: optionSource.hasMore,\n isLoading: optionSource.isLoadingMore,\n onLoadMore: optionSource.onLoadMore,\n enabled: isOpen\n });\n\n // Prefetch the baseline on the first OPEN of either surface by default \u2014 the trigger\'s CTA can open\n // the modal without the dropdown ever being opened, and that path needs a populated pool just as\n // much. `prefetch="mount"` instead fills the pool at render, so the first open of either surface\n // shows rows rather than a loader.\n usePrefetchBaseline({ prefetch: prefetch ?? "open", isOpen: isOpen || isModalOpen, optionsKey, ensureDefaults });\n\n // Route an optionsKey CHANGE into the clear path, which drops the search view and lets\n // ensureDefaults lazily repopulate. Skipped on mount so a seeded `filterValue` isn\'t reset on paint.\n useOnValueChange( optionsKey, resetFilter );\n\n // Close dropdown on outside click and commit the pending selection. Disabled while the\n // transfer-list modal is open: the modal renders in a body portal (outside containerRef),\n // so a click inside it would otherwise be treated as an outside click and close the dropdown.\n useEffect(() => {\n const handleOutsideClick = ( e: MouseEvent ) => {\n if ( containerRef.current && !containerRef.current.contains( e.target as Node )) {\n commitSelection();\n }\n };\n if ( isOpen && !isModalOpen ) {\n document.addEventListener( "mousedown", handleOutsideClick );\n }\n return () => document.removeEventListener( "mousedown", handleOutsideClick );\n }, [ isOpen, isModalOpen, commitSelection ]);\n\n // The modal draft is a projection of the loaded pool, so a newly-paged option shows up in Available\n // with no synchronising effect and an item the user already moved is never yanked back. The query is\n // passed only in async mode: there the pool is a server answer the draft\'s snapshot must be matched\n // against, whereas in legacy mode the panel owns its own local search and filters the draft itself.\n const { draftAvailable, draftSelected, onDraftChange, seedDraft } = useMultiSelectTransferDraft(\n optionSource.options,\n isModalOpen,\n optionSource.isAsync ? filterQuery : ""\n );\n\n // Typing ends load-more mode \u2014 the keystroke\'s fetch is a search, so the loader must replace rows.\n const handleFilterInput = useCallback(\n ( e: React.ChangeEvent<HTMLInputElement> ) => {\n clearLoadMoreMode();\n onQueryInput( e );\n },\n [ onQueryInput, clearLoadMoreMode ]\n );\n\n // TransferList reports its panel search as a plain string rather than a change event.\n const handleAvailableSearchChange = useCallback(\n ( query: string ) => {\n clearLoadMoreMode();\n setQuery( query );\n },\n [ setQuery, clearLoadMoreMode ]\n );\n\n const handleTriggerClick = () => {\n if ( disabled ) {\n return;\n }\n if ( isOpen ) {\n commitSelection();\n } else {\n setPendingSelected( currentValue );\n setIsOpen( true );\n }\n };\n\n // Discard the in-progress draft, close the dropdown, and return focus to the trigger so a\n // keyboard user is never stranded on <body>.\n const cancelDropdown = () => {\n setIsOpen( false );\n setPendingSelected([]);\n resetFilter();\n triggerRef.current?.focus();\n };\n\n const handleTriggerKeyDown = ( e: React.KeyboardEvent<HTMLDivElement> ) => {\n // Ignore keys bubbling up from the nested CTA button (Open transfer list); it handles its\n // own activation. Only act when the trigger itself is the focused target.\n if ( e.target !== e.currentTarget ) {\n return;\n }\n if ( e.key === keyboardKeys.enter || e.key === keyboardKeys.space ) {\n e.preventDefault();\n handleTriggerClick();\n }\n if ( e.key === keyboardKeys.escape ) {\n cancelDropdown();\n }\n };\n\n const handleDropdownKeyDown = ( e: React.KeyboardEvent<HTMLInputElement> ) => {\n handleFilterKeyDown( e );\n if ( e.key === keyboardKeys.escape ) {\n e.preventDefault();\n cancelDropdown();\n return;\n }\n // Tab is the keyboard analog of clicking away: commit the draft and let focus move on\n // naturally (no preventDefault). Escape above still cancels/discards.\n if ( e.key === keyboardKeys.tab ) {\n commitSelection();\n }\n };\n\n // When no server-side filter is in play, filter options client-side. Memoized so a stable\n // array identity flows into the (virtualized) dropdown\'s row memo.\n const displayedOptions = useMemo(\n () => ( optionSource.isServerFiltered\n ? optionSource.options\n : optionSource.options.filter(( opt ) => matchesQuery( opt, filterQuery ))),\n [ optionSource.isServerFiltered, optionSource.options, filterQuery ]\n );\n\n // Set of the draft-selected values for O(1) membership checks in the options list and Select All.\n const pendingValues = useMemo(\n () => new Set( pendingSelected.map(( p ) => p.value )),\n [pendingSelected]\n );\n\n const selectableOptions = useMemo(\n () => displayedOptions.filter(( o ) => !o.isDisabled ),\n [displayedOptions]\n );\n const areAllSelected = useMemo(\n () => selectableOptions.length > 0 && selectableOptions.every(( o ) => pendingValues.has( o.value )),\n [ selectableOptions, pendingValues ]\n );\n\n const handleOptionToggle = ( option: TMultiSelectTransferOption ) => {\n setPendingSelected(( prev ) => {\n const exists = prev.some(( o ) => o.value === option.value );\n return exists ? prev.filter(( o ) => o.value !== option.value ) : [ ...prev, option ];\n });\n };\n\n const handleSelectAll = () => {\n setPendingSelected(( prev ) => {\n const prevValues = new Set( prev.map(( p ) => p.value ));\n if ( areAllSelected ) {\n const selectableValues = new Set( selectableOptions.map(( o ) => o.value ));\n return prev.filter(( p ) => !selectableValues.has( p.value ));\n }\n return [ ...prev, ...selectableOptions.filter(( o ) => !prevValues.has( o.value )) ];\n });\n };\n\n const handleRemovePill = ( option: TMultiSelectTransferOption, e: React.MouseEvent ) => {\n e.stopPropagation();\n if ( disabled ) {\n return;\n }\n const next = currentValue.filter(( o ) => o.value !== option.value );\n if ( !isControlled ) {\n setInternalValue( next );\n }\n onChange?.( next );\n };\n\n const handleOpenTransferList = ( e: React.MouseEvent ) => {\n e.stopPropagation();\n // Every other route out of the dropdown commits its draft, and the CTA is no exception: options\n // ticked in the menu carry into the modal instead of being dropped. Available is derived from\n // the pool minus the seed, so only the selection is seeded.\n if ( isOpen ) {\n // Seed from the draft rather than waiting for the committed value to come back round through\n // `value`; commitSelection then closes the dropdown and clears the draft/filter.\n seedDraft( pendingSelectedRef.current );\n commitSelection();\n } else {\n resetFilter();\n seedDraft( currentValue );\n }\n setIsModalOpen( true );\n onOpenTransferList?.();\n };\n\n // Both close paths reset the filter, like every other close in this component: the modal\'s Available\n // panel shares one useFilterQuery instance with the dropdown, so a query left behind here would be\n // the dropdown\'s query the next time it opens.\n const handleTransferDone = () => {\n if ( !isControlled ) {\n setInternalValue( draftSelected );\n }\n onChange?.( draftSelected );\n setIsModalOpen( false );\n resetFilter();\n };\n\n const handleTransferCancel = () => {\n setIsModalOpen( false );\n resetFilter();\n };\n\n const { base, label: labelClass, helperText: helperTextClass } =\n multiSelectTransferVariants({ error, size, disabled });\n\n return (\n <div ref={rootRef} className={base({ class: className })}>\n {label !== undefined && (\n <label htmlFor={triggerId} className={labelClass()}>\n {label}\n </label>\n )}\n\n <div className="relative">\n <MultiSelectTransferTrigger\n id={triggerId}\n ref={triggerRef}\n error={error}\n size={size}\n disabled={disabled}\n isOpen={isOpen}\n value={currentValue}\n placeholder={placeholder}\n maxVisiblePills={maxVisiblePills}\n onClick={handleTriggerClick}\n onKeyDown={handleTriggerKeyDown}\n onRemovePill={handleRemovePill}\n onOpenTransferList={handleOpenTransferList}\n />\n\n {isOpen && (\n <MultiSelectTransferDropdown\n error={error}\n size={size}\n disabled={disabled}\n filterQuery={filterQuery}\n onFilterInput={handleFilterInput}\n onFilterKeyDown={handleDropdownKeyDown}\n onFilterKeyUp={handleFilterKeyUp}\n onFilterBlur={handleFilterBlur}\n searchPlaceholder={searchPlaceholder}\n options={displayedOptions}\n selectedValues={pendingValues}\n onOptionToggle={handleOptionToggle}\n hasSelectAll={selectableOptions.length >= 2}\n areAllSelected={areAllSelected}\n onSelectAll={handleSelectAll}\n isLoading={optionSource.isLoading}\n isSearchFetch={optionSource.isSearchFetch}\n sentinelRef={sentinelRef}\n loadError={optionSource.loadError}\n loadMoreError={optionSource.loadMoreError}\n onRetryLoadMore={optionSource.onRetryLoadMore}\n retryLabel={retryLabel}\n reloadTooltip={reloadTooltip}\n onReload={optionSource.onReload}\n isReloading={optionSource.isReloading}\n />\n )}\n </div>\n\n {helperText && <div className={helperTextClass()}>{helperText}</div>}\n\n <MultiSelectTransferModal\n showModal={isModalOpen}\n availableItems={draftAvailable}\n selectedItems={draftSelected}\n onChange={onDraftChange}\n onCancel={handleTransferCancel}\n onDone={handleTransferDone}\n header={transferListHeader}\n title={transferListTitle}\n subtitle={transferListSubtitle}\n reorderable={reorderable}\n reloadTooltip={reloadTooltip}\n onReload={optionSource.onReload}\n isReloading={optionSource.isReloading}\n searchPlaceholder={searchPlaceholder}\n availablePanelHeaderSlot={availablePanelHeaderSlot}\n selectedPanelHeaderSlot={selectedPanelHeaderSlot}\n hasMoreAvailable={optionSource.hasMore}\n onLoadMoreAvailable={optionSource.onLoadMore}\n // Replace-loader semantics apply only in async mode. In legacy mode, `isLoading` drives an\n // APPEND loader (via `isLoadingMore`) with the rows kept, so this stays undefined.\n isLoadingAvailable={optionSource.isAsync ? optionSource.isSearchFetch : undefined}\n isLoadingMoreAvailable={optionSource.isLoadingMore}\n availableLoadError={optionSource.loadError}\n availableLoadMoreError={optionSource.loadMoreError}\n onRetryLoadMoreAvailable={optionSource.onRetryLoadMore}\n retryLabel={retryLabel}\n availableTotalCount={optionSource.total}\n {...( optionSource.isAsync\n // Over a paged pool a client-side panel search would only search the pages that happen to be\n // loaded. One query, one useFilterQuery instance: the dropdown is always closed while the\n // modal is open, so the two can never contend. The SELECTED panel\'s search stays local \u2014 it\n // is a plain array and there is no server to ask.\n ? { availableSearchTerm: filterQuery, onAvailableSearchChange: handleAvailableSearchChange }\n : {})}\n cancelLabel={cancelLabel}\n doneLabel={doneLabel}\n />\n </div>\n );\n});\n\nMultiSelectTransfer.displayName = "MultiSelectTransfer";\n'
2724
+ },
2725
+ {
2726
+ "name": "index.ts",
2727
+ "content": 'export { MultiSelectTransfer } from "./multiSelectTransfer";\nexport { multiSelectTransferVariants } from "./multiSelectTransferVariants";\nexport type {\n IMultiSelectTransferProps,\n TMultiSelectTransferOption,\n TMultiSelectTransferSize,\n TMultiSelectTransferLoadOptions\n} from "./types";\n'
2728
+ },
2729
+ {
2730
+ "name": "README.md",
2731
+ "content": '# MultiSelectTransfer Component\n\n## Component Overview\n\nThe MultiSelectTransfer is a multi-select form control that pairs a compact, pill-based\ntrigger with two ways to pick options: a lightweight **dropdown** for quick selection and\na full-screen **transfer-list modal** for managing large or ordered selections across an\n**Available** and a **Selected** panel. Committed selections render as removable pills in\nthe trigger, collapsing to a "+N More" badge past a configurable limit. It supports both\ncontrolled and uncontrolled usage, client- and server-side filtering, infinite scroll, and\noptional reordering.\n\n**When to use:**\n- Selecting multiple items (permissions, columns, tags, members) from a pool that can be\n browsed quickly or curated in depth\n- Form fields where the current selection should stay visible as pills\n- Workflows that need a "confirm before commit" step (Cancel/Done in the modal)\n- Large, possibly paginated option sets that benefit from windowing and infinite scroll\n- Ordered selections where the position of chosen items matters (`reorderable`)\n\n**Component Architecture:**\n- Styled with `tailwind-variants` (`tv()`) slots \u2014 see `multiSelectTransferVariants.ts`\n- Composes the standalone `TransferList` inside a `Modal` for the full-management view\n- Dropdown and transfer-list panels window (virtualize) large option sets\n- Infinite scroll via the shared `useInfiniteScroll` (`IntersectionObserver`) hook\n- Debounced server-side filtering via the shared `useFilterQuery` hook (also used by `Select`)\n- Client-side filtering via the shared `matchesQuery` util when no filter handler is given\n- Reuses `ADPIcon`, `Tooltip` (for clipped pill labels), and `TransferList`\n- Dark-mode aware and RTL-safe (logical spacing properties throughout)\n\n## Basic Usage\n\n```tsx\nimport { useState } from "react";\nimport {\n MultiSelectTransfer,\n type TMultiSelectTransferOption\n} from "@cloudwick/astral-ui";\n\nexport function Example() {\n const options: TMultiSelectTransferOption[] = [\n { value: "chocolate", label: "Chocolate" },\n { value: "vanilla", label: "Vanilla" },\n { value: "strawberry", label: "Strawberry" }\n ];\n\n const [selected, setSelected] = useState<TMultiSelectTransferOption[]>([]);\n\n return (\n <MultiSelectTransfer\n label="Favorite Flavors"\n placeholder="Select flavors..."\n options={options}\n value={selected}\n onChange={setSelected}\n />\n );\n}\n```\n\n> **Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/multiSelectTransfer` or `@components/multiSelectTransfer`.\n\n## Component Props\n\n`MultiSelectTransfer` is a function component and does **not** forward a ref.\n\n| Prop | Type | Default | Required | Description |\n|---|---|---|---|---|\n| `options` | `TMultiSelectTransferOption[]` | \u2014 | No | Options shown in the dropdown and projected into the transfer-list Available panel. Ignored (dev warning) when `loadOptions` is set. |\n| `value` | `TMultiSelectTransferOption[]` | `undefined` | No | Controlled selection. Omit to run uncontrolled (the component owns selection internally). |\n| `onChange` | `(selected: TMultiSelectTransferOption[]) => void` | \u2014 | No | Fired when a selection is committed (dropdown close, modal Done, or pill removal). |\n| `id` | `string` | auto (`useId`) | No | Id for the trigger, wired to the `label` via `htmlFor`. |\n| `className` | `string` | \u2014 | No | Extra classes on the root container. |\n| `ref` | `Ref<HTMLDivElement>` | \u2014 | No | Forwarded to the root container \u2014 for programmatic focus/scroll and form libraries that bind by ref. |\n| `label` | `ReactNode` | `undefined` | No | Label rendered above the trigger. |\n| `placeholder` | `string` | `"Select options..."` | No | Text shown in the trigger when nothing is selected. |\n| `helperText` | `ReactNode` | `undefined` | No | Helper text rendered below the trigger. |\n| `error` | `boolean` | `false` | No | Apply error styling to the trigger and helper text. |\n| `disabled` | `boolean` | `false` | No | Disable all interaction. |\n| `size` | `\'md\' \\| \'lg\'` | `\'md\'` | No | Control size variant. |\n| `maxVisiblePills` | `number` | `3` | No | Max pills shown in the trigger before collapsing to "+N More". |\n| `filterValue` | `string` | `undefined` | No | Seeds the dropdown search input and re-syncs it whenever this value changes (not fully controlled \u2014 see Technical Details). |\n| `onFilterChange` | `(query: string) => void` | \u2014 | No | Server-side filter handler. When provided, client-side filtering is skipped. |\n| `searchPlaceholder` | `string` | `"Search..."` | No | Placeholder for the dropdown filter input and the transfer-list modal\'s panel search inputs. |\n| `filterDebounceMs` | `number` | `300` | No | Debounce delay (ms) for `onFilterChange`. Set to `0` to fire synchronously. |\n| `hasMore` | `boolean` | `false` | No | Whether more options can be loaded (drives infinite scroll). |\n| `onLoadMore` | `() => void` | \u2014 | No | Called when the infinite-scroll sentinel becomes visible. |\n| `isLoading` | `boolean` | `false` | No | A load is in flight. Replaces the option rows for a search fetch; appends a loader below them for a load-more. |\n| `transferListTitle` | `ReactNode` | `undefined` | No | Title in the transfer-list modal header. |\n| `transferListSubtitle` | `ReactNode` | `undefined` | No | Subtitle under the modal title. |\n| `transferListHeader` | `ReactNode` | `undefined` | No | Fully custom modal header; overrides `transferListTitle`/`transferListSubtitle`. |\n| `onOpenTransferList` | `() => void` | \u2014 | No | Called when the transfer-list CTA is clicked, before the modal opens. |\n| `reorderable` | `boolean` | `false` | No | Enable drag + arrow reordering of the Selected panel in the modal. |\n| `onReload` | `() => void` | \u2014 | No | Shows a reload button (dropdown and modal) and is fired on click. |\n| `isReloading` | `boolean` | `false` | No | Spins the reload icon. |\n| `reloadTooltip` | `string` | `"Reload"` | No | Tooltip for the reload button. |\n| `availablePanelHeaderSlot` | `ReactNode` | `undefined` | No | Custom content under the modal Available panel search. |\n| `selectedPanelHeaderSlot` | `ReactNode` | `undefined` | No | Custom content under the modal Selected panel search. |\n| `cancelLabel` | `ReactNode` | `"Cancel"` | No | Label for the modal cancel button. |\n| `doneLabel` | `ReactNode` | `"Done"` | No | Label for the modal commit button. |\n| `loadOptions` | `(query, meta) => Promise<TMultiSelectTransferOption[] \\| IOptionPage<...>>` | \u2014 | No | Async, paged option source. Switches the component into [async mode](#async-mode-loadoptions). |\n| `initialOptions` | `readonly TMultiSelectTransferOption[]` | `undefined` | No | Seed rows for a list you already have (SSR payload, route loader, warm cache). Painted on the first frame and kept on screen while the baseline fetch revalidates over them \u2014 see [Seeding with `initialOptions`](#seeding-with-initialoptions). Async mode only. |\n| `prefetch` | `"mount" \\| "open" \\| "never"` | `"open"` | No | When to fetch the unfiltered first page. `"open"` when the dropdown \u2014 or the transfer-list modal, whichever comes first \u2014 opens; `"mount"` at render, so the first open shows rows instead of a loader; `"never"` only once the user types. Async mode only. |\n| `refetchOnClear` | `boolean` | `false` | No | Clearing the search revalidates the cached baseline instead of only restoring it. |\n| `optionsKey` | `string \\| number` | `undefined` | No | Identity of the option set. A change drops cached pages and repopulates. Does **not** clear the selection. |\n| `loadErrorMessage` | `ReactNode` | `"Couldn\'t load options."` | No | Shown in place of the rows when a load rejects. |\n| `loadMoreErrorMessage` | `ReactNode` | `"Couldn\'t load more."` | No | Shown under the loaded rows when a page append rejects. |\n| `retryLabel` | `string` | `"Retry"` | No | Label for the retry button beside `loadMoreErrorMessage`. |\n| `showReloadButton` | `boolean` | `false` | No | Shows the reload button in async mode, wired to re-run the current query from page one. |\n| `onLoadError` | `(error: unknown) => void` | \u2014 | No | Notified when a load rejects (the component renders the message and swallows it). |\n\n### `TMultiSelectTransferOption`\n\n| Field | Type | Required | Description |\n|---|---|---|---|\n| `value` | `string \\| number` | Yes | Stable unique identifier for the option. |\n| `label` | `ReactNode` | Yes | Display content for the option, pill, and transfer-list row. |\n| `searchValue` | `string` | No | Plain text used for client-side search matching. Set this when `label` is custom JSX so the option stays findable by its visible text. Takes precedence over `label`/`value`. |\n| `isDisabled` | `boolean` | No | Prevents the option from being selected or moved; excluded from "Select all". |\n\n## Sizes\n\nTwo sizes are available via the `size` prop:\n\n- **`md`** (default) \u2014 standard density, `text-base` labels; use in typical forms.\n- **`lg`** \u2014 roomier padding and `text-md` labels; use in prominent or touch-oriented UIs.\n\n```tsx\n<MultiSelectTransfer label="Medium" options={options} size="md" />\n<MultiSelectTransfer label="Large" options={options} size="lg" />\n```\n\n## Usage Patterns\n\n### Controlled vs. Uncontrolled\n\n- **Controlled** \u2014 pass `value` and `onChange`. The parent owns the selection; pills reflect\n `value` exactly. Required if you need to read or reset the selection externally.\n- **Uncontrolled** \u2014 omit `value` (optionally still pass `onChange` to observe changes). The\n component tracks the committed selection internally, so pills still render without any\n parent wiring.\n\n### Two ways to select\n\n1. **Dropdown** \u2014 clicking the trigger opens a searchable list with per-option checkboxes and\n a "Select all". Selection is a **draft**: it commits when the dropdown closes (outside\n click, toggling the trigger, the transfer-list CTA, or `Tab`) and discards on `Escape`.\n2. **Transfer-list modal** \u2014 clicking the expand CTA opens a two-panel modal seeded from the\n current selection. Opening it from an open dropdown commits that dropdown\'s draft first, so\n options ticked in the menu arrive on the Selected side rather than being dropped. Moves are a\n **draft** committed on **Done** and discarded on **Cancel**.\n\n### Filtering\n\n- **Client-side (default)** \u2014 options are filtered locally against the query. No handler needed.\n- **Server-side** \u2014 pass `onFilterChange`; the component stops filtering locally and hands you\n the (debounced) query so you can fetch and update `options` yourself. While Backspace/Delete is\n held the debounce waits for keyup (or blur), so a long-press cannot fire a search mid-hold.\n- **Async (`loadOptions`)** \u2014 the component owns the option list, paging, the request lifecycle and\n the loading state. See [Async mode](#async-mode-loadoptions).\n- When the (client- or server-filtered) list has no matches, the dropdown shows a **"No options"**\n notice \u2014 the same copy as `Select`. While a search fetch is in flight (`isLoading`), the loader\n replaces that notice so an empty-and-loading menu never flashes "No options" mid-request.\n- Wherever the component clears the query itself \u2014 committing or cancelling the dropdown, or opening\n the transfer list modal \u2014 `onFilterChange("")` fires too (only if the query was non-empty), so your\n `options` never stay filtered by a query the user can no longer see. On modal open that also means\n the modal\'s Available panel gets the full list back.\n\n## Async mode (`loadOptions`)\n\nServer-side filtering above leaves three things at every call site: the results state, a\nmonotonic-ticket guard against out-of-order responses (debouncing limits how often a request *starts*,\nnot how many are in flight), and \u2014 for a paged source \u2014 page accumulation plus the\n"is this loader replacing rows or appending them?" distinction. `loadOptions` moves all of it inside:\n\n```tsx\n<MultiSelectTransfer\n label="Rows"\n loadOptions={async (query, { cursor, signal }) => {\n const res = await fetchRows({ query, cursor, signal });\n return {\n options: res.rows.map((r) => ({ value: r.id, label: r.name })),\n cursor: res.nextToken, // absent/null \u21D2 no further pages\n total: res.totalCount // renders as "(loaded of total)" in the modal panel header\n };\n }}\n/>\n```\n\n`meta` carries `{ signal, cursor, page, reason }`; `reason` is `"defaults" | "search" | "more" | "reload"`.\nReturn a bare array for an unpaged source. Honouring `meta.signal` is optional \u2014 ordering is guaranteed\nby an internal per-slot ticket either way. A fresh inline arrow is fine: the loader is read through a ref.\n\nBehaviour worth knowing:\n\n- **Paging acts on the *active* bucket.** The empty-query baseline and the current search each carry\n their own cursor and page count, so paging a search and paging the baseline never interfere \u2014 and\n clearing the search back to the baseline resumes *its* paging from *its* cursor.\n- **Clearing the search restores the cached baseline with no request.** Pass `refetchOnClear` to also\n revalidate; stale rows stay on screen while it runs.\n- **A failed page keeps the rows** and offers **Retry** below them, and the infinite-scroll sentinel\n disarms until you press it \u2014 a sentinel still sitting in the viewport must not hammer a failing\n endpoint. Retry re-requests the *same* page; the cursor never advanced. A whole-list failure (the\n first page, a search, a reload) shows `loadErrorMessage` in place of the rows instead.\n- **Pages are appended with dedupe on `value`.** Server paging over an unstable sort returns\n duplicates, and both surfaces key their rows by `value`.\n- **The modal\'s Available search is server-side in async mode**, sharing the dropdown\'s single\n debounced query \u2014 over a paged pool, filtering only the pages that happen to be loaded would be a\n lie. Closing the modal (**Done** or **Cancel**) clears that query, so it never leaks into the\n dropdown. The **Selected** panel\'s search is always local: that side is a plain array with no server\n to ask, and there is nothing to page.\n- **The modal\'s Available panel is a projection** of the loaded pool minus the draft selection. A page\n that lands while the modal is open simply appears; an item the user already moved right is never\n yanked back. A committed option the pool never returned is supplied from a snapshot taken at open \u2014\n matched locally against the active query, so it cannot surface as a result for a search it does not\n match.\n\n This replaced an append-only fold effect, and it changes two things on the **non-async path too**\n (see [Migration notes](#migration-notes)).\n- **"Select All"** covers the loaded rows the active search leaves visible \u2014 never every server-side\n match. Toggling it off removes only those visible rows from the draft, so a selection made under an\n earlier query survives. The row is shown only when at least two selectable options are on screen.\n- **`optionsKey` does not clear the committed selection** \u2014 same reasoning as `Select`: that is a\n domain rule, and clearing a controlled `value` from inside means firing an `onChange` nobody asked for.\n- Options are stored exactly as returned, so extra fields you hang on an option survive and reach\n `onChange` as the same object.\n\n### Seeding with `initialOptions`\n\n`initialOptions` is for the case where **you already have the rows** \u2014 an SSR payload, a route loader, a\nwarm query cache. They are painted on the first frame of both surfaces instead of a loader, and stay on\nscreen while the baseline fetch revalidates over them \u2014 the dropdown\'s spinner appends *below* the rows,\nas it does for any load in flight, so the revalidation is visible without hiding anything. This is the\none thing `prefetch` cannot do: `prefetch="mount"` still costs a round trip before anything appears.\n\n```tsx\n<MultiSelectTransfer\n label="Rows"\n initialOptions={ssrRows} // painted immediately, in the dropdown and the modal\n loadOptions={fetchRows} // still runs, and replaces them when page one lands\n/>\n```\n\nIt does **not** suppress the baseline fetch. If the seed *is* the whole list until the user types \u2014 a\nheavy source you do not want to hit on open \u2014 pair it with `prefetch="never"`:\n\n```tsx\n<MultiSelectTransfer initialOptions={recentlyUsed} prefetch="never" loadOptions={searchEverything} />\n```\n\nWithout `initialOptions`, that combination opens to an empty list on both surfaces.\n\nSeed rows carry no cursor, so the infinite-scroll sentinel stays disarmed until a real page lands \u2014 a\nseed is not page one. A *search* replaces them, because they are not results for a query; clearing it\nbrings them back until a fetched baseline does. And seed rows only mean something to the async source \u2014\npassing `initialOptions` without `loadOptions` is ignored with a dev warning, because those rows belong\nin `options`.\n\n`prefetch` is async-only for the same reason: it schedules the baseline fetch and nothing else, so\nwithout `loadOptions` there is no fetch to schedule. Passing it there is ignored with a dev warning.\n\n## Migration notes\n\nAdding `loadOptions` is opt-in and every new prop is optional, so no call site has to change. Two\n**runtime** behaviours of the transfer-list modal did change for existing (non-async) consumers,\nbecause the modal\'s Available panel is now derived from `options` rather than folded into owned state:\n\n| Situation | Before | Now |\n|---|---|---|\n| An item is moved back from Selected to Available | It was **appended to the end** of Available | It returns to its position in `options` |\n| The parent **shrinks** `options` while the modal is open | Previously-shown rows **lingered** in Available | They disappear, matching the new `options` |\n\nNeither loses a selection or changes what `onChange` reports \u2014 the committed value is unaffected in\nboth cases. The first is a visible row-ordering difference; the second makes the panel honest about\nwhat the parent is actually offering. If you depended on either, own the pool yourself and drive the\n`TransferList` directly instead of through `MultiSelectTransfer`.\n\nEverything else on the legacy path is unchanged, including the `hasMore` / `onLoadMore` / `isLoading`\ntrio and the append-vs-replace loader behaviour in both the dropdown and the modal.\n\n## Practical Examples\n\n### 1. Controlled selection with a live count\n\n```tsx\nimport { useState } from "react";\nimport {\n MultiSelectTransfer,\n type TMultiSelectTransferOption\n} from "@cloudwick/astral-ui";\n\nconst options: TMultiSelectTransferOption[] = [\n { value: "chocolate", label: "Chocolate" },\n { value: "vanilla", label: "Vanilla" },\n { value: "strawberry", label: "Strawberry" },\n { value: "mint", label: "Mint" }\n];\n\nfunction FlavorPicker() {\n const [selected, setSelected] = useState<TMultiSelectTransferOption[]>([]);\n\n return (\n <MultiSelectTransfer\n label="Flavors"\n placeholder="Select flavors..."\n options={options}\n value={selected}\n onChange={setSelected}\n helperText={`${selected.length} selected`}\n />\n );\n}\n```\n\n### 2. Validation and error state in a form\n\n```tsx\nimport { useState } from "react";\nimport {\n MultiSelectTransfer,\n Button,\n type TMultiSelectTransferOption\n} from "@cloudwick/astral-ui";\n\nfunction PermissionsField({ options }: { options: TMultiSelectTransferOption[] }) {\n const [selected, setSelected] = useState<TMultiSelectTransferOption[]>([]);\n const [touched, setTouched] = useState(false);\n const hasError = touched && selected.length === 0;\n\n const handleSubmit = () => {\n setTouched(true);\n if (selected.length === 0) return;\n // submit selected...\n };\n\n return (\n <form onSubmit={(e) => { e.preventDefault(); handleSubmit(); }}>\n <MultiSelectTransfer\n label="Permissions"\n placeholder="Assign permissions..."\n options={options}\n value={selected}\n onChange={setSelected}\n error={hasError}\n helperText={hasError ? "Select at least one permission." : undefined}\n />\n <Button type="submit">Save</Button>\n </form>\n );\n}\n```\n\n### 3. Server-side filtering with debounce\n\n```tsx\nimport { useEffect, useState } from "react";\nimport {\n MultiSelectTransfer,\n type TMultiSelectTransferOption\n} from "@cloudwick/astral-ui";\n\nfunction RemoteUserPicker() {\n const [query, setQuery] = useState("");\n const [options, setOptions] = useState<TMultiSelectTransferOption[]>([]);\n const [selected, setSelected] = useState<TMultiSelectTransferOption[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n\n useEffect(() => {\n let active = true;\n setIsLoading(true);\n fetchUsers(query)\n .then((users) => {\n if (active) setOptions(users.map((u) => ({ value: u.id, label: u.name })));\n })\n .finally(() => active && setIsLoading(false));\n return () => { active = false; };\n }, [query]);\n\n return (\n <MultiSelectTransfer\n label="Assignees"\n placeholder="Select users..."\n options={options}\n value={selected}\n onChange={setSelected}\n onFilterChange={setQuery}\n filterDebounceMs={300}\n isLoading={isLoading}\n />\n );\n}\n```\n\n### 4. Paginated options with infinite scroll and reload\n\n```tsx\nimport { useState } from "react";\nimport {\n MultiSelectTransfer,\n type TMultiSelectTransferOption\n} from "@cloudwick/astral-ui";\n\nconst PAGE_SIZE = 20;\n\nfunction PaginatedPicker() {\n const [loaded, setLoaded] = useState<TMultiSelectTransferOption[]>([]);\n const [selected, setSelected] = useState<TMultiSelectTransferOption[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [isReloading, setIsReloading] = useState(false);\n const [hasMore, setHasMore] = useState(true);\n\n const loadMore = async () => {\n if (isLoading) return;\n setIsLoading(true);\n const page = await fetchPage(loaded.length, PAGE_SIZE);\n setLoaded((prev) => [...prev, ...page.items]);\n setHasMore(page.hasMore);\n setIsLoading(false);\n };\n\n const reload = async () => {\n setIsReloading(true);\n const page = await fetchPage(0, PAGE_SIZE);\n setLoaded(page.items);\n setHasMore(page.hasMore);\n setIsReloading(false);\n };\n\n return (\n <MultiSelectTransfer\n label="Items"\n placeholder="Select items..."\n options={loaded}\n value={selected}\n onChange={setSelected}\n hasMore={hasMore}\n onLoadMore={loadMore}\n isLoading={isLoading}\n onReload={reload}\n isReloading={isReloading}\n />\n );\n}\n```\n\n### 5. Ordered selection via the transfer-list modal\n\n```tsx\nimport { useState } from "react";\nimport {\n MultiSelectTransfer,\n type TMultiSelectTransferOption\n} from "@cloudwick/astral-ui";\n\nfunction ColumnManager({ columns }: { columns: TMultiSelectTransferOption[] }) {\n const [visible, setVisible] = useState<TMultiSelectTransferOption[]>([]);\n\n return (\n <MultiSelectTransfer\n label="Visible columns"\n placeholder="No columns selected..."\n options={columns}\n value={visible}\n onChange={setVisible}\n reorderable\n maxVisiblePills={2}\n transferListTitle="Manage columns"\n transferListSubtitle="Choose which columns appear and in what order."\n doneLabel="Apply"\n />\n );\n}\n```\n\n## Styling and Customization\n\n- Use `className` to add classes to the root container.\n- The `size` and `error` props cover the common visual states.\n- For deeper theming, import the exported variants and compose them directly:\n\n```tsx\nimport { multiSelectTransferVariants } from "@components/multiSelectTransfer";\n\nconst { trigger, pill } = multiSelectTransferVariants({ size: "lg", error: false });\n```\n\nDark mode follows the library convention (a `.dark` class on a root ancestor); all slots\nship dark-mode styles. Spacing uses logical properties (`ps-`, `pe-`, `ms-`, `me-`) so the\ncontrol mirrors correctly in RTL layouts.\n\n## Technical Details\n\n- **State management:** The trigger shows a **committed** selection while the dropdown and\n modal each maintain their own **draft**. Drafts commit on close/Done and discard on\n Escape/Cancel, giving a clear "confirm before apply" model. In uncontrolled mode the\n committed value is held internally; in controlled mode it tracks `value`.\n- **Draft preservation:** The dropdown draft is keyed on the option values\' contents, not the\n array reference, so an unrelated parent re-render that passes a new `value` array cannot wipe\n an in-progress draft \u2014 it re-syncs only on a genuine external change or on (re)open.\n- **Filtering:** Without `onFilterChange`, options are filtered client-side via `matchesQuery`\n and memoized for stable identity. `matchesQuery` matches an option\'s `searchValue` first, then a\n string `label`, then its `value` \u2014 set `searchValue` on options whose `label` is custom JSX so\n they stay findable by their visible text. With `onFilterChange`, filtering is delegated to the parent\n and the query is debounced (`filterDebounceMs`); a pending debounce is cancelled on unmount, on an\n external `filterValue` reset, and whenever the component clears the query itself \u2014 where\n `onFilterChange("")` fires immediately instead, so a stale query can never overtake the reset.\n While Backspace/Delete is held the debounce is deferred until keyup (or blur), so a long-press\n cannot fire mid-hold. `filterValue` is a seed plus an external sync rather than a fully controlled\n value: the input owns its own text, a *new* `filterValue` overwrites it, and re-passing the same\n one does not pull it back \u2014 feed `onFilterChange` into the state you pass as `filterValue` to keep\n them in step. All of that lives in the shared `useFilterQuery` hook, which `Select` also uses, so\n the identically-named props on both components behave identically by construction.\n- **Virtualization:** Both the dropdown options list and the modal panels window large option\n sets (past ~100 items) so multi-thousand-item lists open and filter without mounting every row.\n- **Infinite scroll:** An `IntersectionObserver` sentinel (via `useInfiniteScroll`) calls\n `onLoadMore` when scrolled into view, gated on the open state. While the modal is open, newly\n loaded options are folded into the Available draft without duplicating or reclaiming items the\n user has already moved to Selected.\n- **Loading UI:** `isLoading` covers two situations with opposite needs, and the component tells them\n apart by whether the sentinel above asked for the load. A **search fetch** replaces the option rows\n with the loader \u2014 they belong to the previous query, so leaving them clickable would let the user\n pick an option the incoming results no longer contain (`Select` does the same). An empty-and-loading\n menu therefore shows the loader alone rather than "No options". Arrow/Enter are ignored while those\n rows are gone, so the keyboard cannot reach one either, and the listbox is marked `aria-busy`. A\n **load-more** is adding to those rows, so the loader is appended below them and the scroll position\n survives \u2014 a load-more stays a load-more until it finishes, even if the consumer flips `isLoading`\n a render or two after `onLoadMore`.\n- **Modal portal:** The transfer-list modal renders in a body portal. The dropdown\'s\n outside-click listener is suspended while the modal is open so a click inside the portal is not\n misread as an outside click.\n- **Pill overflow:** The trigger shows up to `maxVisiblePills` pills, then a "+N More" badge.\n Long pill labels truncate to a max width and surface the full text via a `Tooltip` only when\n actually clipped.\n\n## Accessibility\n\n**Implemented:**\n- The trigger is a keyboard-operable control: `role="button"`, `aria-haspopup="listbox"`, and\n `aria-expanded` reflecting the open state.\n- The trigger is focusable (`tabIndex={0}`) when enabled and removed from the tab order\n (`tabIndex={-1}`) when `disabled`.\n- Keyboard support on the trigger: `Enter`/`Space` toggle the dropdown; `Escape` closes and\n discards the draft.\n- Keyboard support in the dropdown: `Escape` cancels/discards and returns focus to the trigger\n so a keyboard user is never stranded on `<body>`; `Tab` commits the draft and lets focus move\n on naturally.\n- The `label` is associated with the trigger via `htmlFor`/`id` (auto-generated when `id` is\n omitted).\n- The transfer-list CTA and reload buttons carry descriptive `aria-label`/tooltip text.\n- Disabled options are excluded from selection and from "Select all".\n\n**Best Practices:**\n- Always provide a `label` (or an external `aria-label`) so the control is announced.\n- Use `error` together with `helperText` to communicate validation state visibly rather than by\n color alone.\n- Keep option `label`s meaningful as text \u2014 pills, tooltips, and screen readers all render them.\n- Provide stable, unique `value`s; reusing a value across options breaks selection tracking and\n keys.\n- When filtering server-side, keep `isLoading` accurate so assistive tech and users get correct\n loading feedback.\n'
2732
+ }
2733
+ ],
2734
+ "directories": []
2735
+ },
2379
2736
  "otp": {
2380
2737
  "name": "otp",
2381
2738
  "description": "The OTP (One-Time Password) component provides an input interface for entering verification codes. **When to use:** - Two-factor authentication - Email/SMS verification - Security code entry - PIN entry **Component Architecture:** - Styled with Tailwind CSS and cva - Auto-focus next input - Paste support - Customizable length",
@@ -2388,7 +2745,7 @@ DropdownItem.displayName = "DropdownItem";
2388
2745
  "files": [
2389
2746
  {
2390
2747
  "name": "otpVariants.ts",
2391
- "content": 'import { tv } from "tailwind-variants";\n\nexport const otpTextVariants = tv({\n base: "text-xs font-normal",\n variants: {\n error: {\n true: "text-error-500 dark:text-error-400",\n false: "text-secondary-400 dark:text-secondary-200"\n }\n },\n defaultVariants: {\n error: false\n }\n});\n'
2748
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const otpTextVariants = tv({\n base: "text-xs font-normal",\n variants: {\n error: {\n true: "text-error-700 dark:text-error-400",\n false: "text-secondary-400 dark:text-secondary-200"\n }\n },\n defaultVariants: {\n error: false\n }\n});\n'
2392
2749
  },
2393
2750
  {
2394
2751
  "name": "otp.tsx",
@@ -2396,7 +2753,7 @@ DropdownItem.displayName = "DropdownItem";
2396
2753
  },
2397
2754
  {
2398
2755
  "name": "input.tsx",
2399
- "content": 'import * as React from "react";\nimport { cn } from "tailwind-variants";\n\ninterface IInputProps {\n /**\n * The value of the input\n */\n value: string;\n /**\n * Handler for input changes\n */\n handleChange: React.ChangeEventHandler<HTMLInputElement>;\n /**\n * Handler for keyboard events\n */\n handleKeyDown: React.KeyboardEventHandler<HTMLInputElement>;\n /**\n * Whether the input is focused\n */\n focused: boolean;\n /**\n * The index of the input\n */\n index: number;\n /**\n * The ID of the input\n */\n id: string;\n /**\n * Whether the input is in an error state\n */\n error: boolean;\n}\n\n/**\n * Input component for OTP field\n */\nexport const Input: React.FC<IInputProps> = ({\n value,\n handleChange,\n handleKeyDown,\n focused,\n index,\n id,\n error\n}: IInputProps ) => {\n const inputRef = React.useRef<HTMLInputElement | null>( null );\n const handleFocus = ( event: React.FocusEvent<HTMLInputElement> ) => event.target.select();\n\n React.useEffect(() => {\n if ( focused ) {\n setTimeout(() => inputRef.current?.focus(), 0 );\n }\n }, [focused]);\n\n return (\n <input\n id={id}\n type="text"\n inputMode="numeric"\n autoComplete="one-time-code"\n value={value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n aria-label={`Enter character ${index + 1}`}\n maxLength={1}\n ref={inputRef}\n className={cn(\n "w-[2.625rem] px-2 py-[0.625rem] text-center",\n "border border-gray-200 rounded text-base focus:outline-none focus:ring-1 focus:ring-primary-500",\n "disabled:bg-gray-50 disabled:text-secondary-200",\n "dark:border-secondary-500",\n "dark:bg-iridium",\n "dark:disabled:bg-secondary-800",\n "dark:disabled:text-secondary-500",\n "dark:focus:ring-primary-400",\n "dark:text-secondary-200",\n error && "border-error-500 text-error-500 dark:border-error-400 dark:text-error-400"\n )}\n />\n );\n};\n\nInput.displayName = "OtpInput.Input";\n'
2756
+ "content": 'import * as React from "react";\nimport { cn } from "tailwind-variants";\n\ninterface IInputProps {\n /**\n * The value of the input\n */\n value: string;\n /**\n * Handler for input changes\n */\n handleChange: React.ChangeEventHandler<HTMLInputElement>;\n /**\n * Handler for keyboard events\n */\n handleKeyDown: React.KeyboardEventHandler<HTMLInputElement>;\n /**\n * Whether the input is focused\n */\n focused: boolean;\n /**\n * The index of the input\n */\n index: number;\n /**\n * The ID of the input\n */\n id: string;\n /**\n * Whether the input is in an error state\n */\n error: boolean;\n}\n\n/**\n * Input component for OTP field\n */\nexport const Input: React.FC<IInputProps> = ({\n value,\n handleChange,\n handleKeyDown,\n focused,\n index,\n id,\n error\n}: IInputProps ) => {\n const inputRef = React.useRef<HTMLInputElement | null>( null );\n const handleFocus = ( event: React.FocusEvent<HTMLInputElement> ) => event.target.select();\n\n React.useEffect(() => {\n if ( focused ) {\n setTimeout(() => inputRef.current?.focus(), 0 );\n }\n }, [focused]);\n\n return (\n <input\n id={id}\n type="text"\n inputMode="numeric"\n autoComplete="one-time-code"\n value={value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n aria-label={`Enter character ${index + 1}`}\n maxLength={1}\n ref={inputRef}\n className={cn(\n "w-[2.625rem] px-2 py-[0.625rem] text-center",\n "border border-gray-200 rounded text-base focus:outline-none focus:ring-1 focus:ring-primary-500",\n "disabled:bg-gray-50 disabled:text-secondary-200",\n "dark:border-secondary-500",\n "dark:bg-iridium",\n "dark:disabled:bg-secondary-800",\n "dark:disabled:text-secondary-500",\n "dark:focus:ring-primary-400",\n "dark:text-secondary-200",\n error && "border-error-700 text-error-700 dark:border-error-400 dark:text-error-400"\n )}\n />\n );\n};\n\nInput.displayName = "OtpInput.Input";\n'
2400
2757
  },
2401
2758
  {
2402
2759
  "name": "index.ts",
@@ -2404,7 +2761,7 @@ DropdownItem.displayName = "DropdownItem";
2404
2761
  },
2405
2762
  {
2406
2763
  "name": "README.md",
2407
- "content": '# OTP Component\n\n## Component Overview\n\nThe OTP (One-Time Password) component provides an input interface for entering verification codes.\n\n**When to use:**\n- Two-factor authentication\n- Email/SMS verification\n- Security code entry\n- PIN entry\n\n**Component Architecture:**\n- Styled with Tailwind CSS and cva\n- Auto-focus next input\n- Paste support\n- Customizable length\n\n## Basic Usage\n\n```tsx\nimport { OTP } from "@components";\nimport { useState } from "react";\n\nexport function Example() {\n const [otp, setOtp] = useState("");\n \n return (\n <OTP \n length={6}\n value={otp}\n onChange={setOtp}\n />\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/otp` or `@components/otp`.\n\n## Component Props\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `otpLength` | `number` | `6` | No | Number of OTP input fields |\n| `initialValue` | `string` | `undefined` | No | Initial value of the OTP input |\n| `label` | `React.ReactNode` | `undefined` | No | Label displayed above the OTP input |\n| `helperText` | `React.ReactNode` | `undefined` | No | Additional information or guidance displayed below the OTP input |\n| `error` | `boolean` | `false` | No | Whether the OTP input is in an error state |\n| `disabled` | `boolean` | `false` | No | Whether the OTP input is disabled |\n| `regexValidation` | `string` | `undefined` | No | Regex pattern to restrict what can be entered in the OTP input |\n| `onChange` | `(val: string) => void` | `undefined` | No | Callback triggered when the OTP input value changes |\n| `onFocus` | `React.FocusEventHandler<HTMLDivElement>` | `undefined` | No | Callback triggered when the OTP input gains focus |\n| `onBlur` | `React.FocusEventHandler<HTMLDivElement>` | `undefined` | No | Callback triggered when the OTP input loses focus |\n| `className` | `string` | `undefined` | No | Additional CSS classes for the container |\n\n**Note:** This component forwards refs to the fieldset element (`HTMLFieldSetElement`).\n\n## Practical Examples\n\n### Verification Form\n\n```tsx\nimport { OTP } from "@components";\nimport { Button } from "@components";\nimport { useState } from "react";\n\nfunction VerificationForm() {\n const [otp, setOtp] = useState("");\n const [error, setError] = useState(false);\n \n const handleVerify = async () => {\n try {\n await verifyOTP(otp);\n // Success\n } catch (err) {\n setError(true);\n }\n };\n \n return (\n <div className="space-y-4">\n <h2>Enter Verification Code</h2>\n <p className="text-gray-500">\n Enter the 6-digit code sent to your phone\n </p>\n <OTP\n length={6}\n value={otp}\n onChange={(value) => {\n setOtp(value);\n setError(false);\n }}\n error={error}\n />\n {error && (\n <p className="text-error-500">Invalid code. Please try again.</p>\n )}\n <Button \n onClick={handleVerify}\n disabled={otp.length !== 6}\n >\n Verify\n </Button>\n </div>\n );\n}\n```\n\n### PIN Entry\n\n```tsx\nimport { OTP } from "@components";\nimport { useState } from "react";\n\nfunction PINEntry() {\n const [pin, setPin] = useState("");\n \n return (\n <div>\n <label>Enter PIN</label>\n <OTP\n length={4}\n value={pin}\n onChange={setPin}\n />\n </div>\n );\n}\n```\n\n## Accessibility\n\n- Auto-focus management\n- Keyboard navigation\n- Paste support\n'
2764
+ "content": '# OTP Component\n\n## Component Overview\n\nThe OTP (One-Time Password) component provides an input interface for entering verification codes.\n\n**When to use:**\n- Two-factor authentication\n- Email/SMS verification\n- Security code entry\n- PIN entry\n\n**Component Architecture:**\n- Styled with Tailwind CSS and cva\n- Auto-focus next input\n- Paste support\n- Customizable length\n\n## Basic Usage\n\n```tsx\nimport { OTP } from "@components";\nimport { useState } from "react";\n\nexport function Example() {\n const [otp, setOtp] = useState("");\n \n return (\n <OTP \n length={6}\n value={otp}\n onChange={setOtp}\n />\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/otp` or `@components/otp`.\n\n## Component Props\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `otpLength` | `number` | `6` | No | Number of OTP input fields |\n| `initialValue` | `string` | `undefined` | No | Initial value of the OTP input |\n| `label` | `React.ReactNode` | `undefined` | No | Label displayed above the OTP input |\n| `helperText` | `React.ReactNode` | `undefined` | No | Additional information or guidance displayed below the OTP input |\n| `error` | `boolean` | `false` | No | Whether the OTP input is in an error state |\n| `disabled` | `boolean` | `false` | No | Whether the OTP input is disabled |\n| `regexValidation` | `string` | `undefined` | No | Regex pattern to restrict what can be entered in the OTP input |\n| `onChange` | `(val: string) => void` | `undefined` | No | Callback triggered when the OTP input value changes |\n| `onFocus` | `React.FocusEventHandler<HTMLDivElement>` | `undefined` | No | Callback triggered when the OTP input gains focus |\n| `onBlur` | `React.FocusEventHandler<HTMLDivElement>` | `undefined` | No | Callback triggered when the OTP input loses focus |\n| `className` | `string` | `undefined` | No | Additional CSS classes for the container |\n\n**Note:** This component forwards refs to the fieldset element (`HTMLFieldSetElement`).\n\n## Practical Examples\n\n### Verification Form\n\n```tsx\nimport { OTP } from "@components";\nimport { Button } from "@components";\nimport { useState } from "react";\n\nfunction VerificationForm() {\n const [otp, setOtp] = useState("");\n const [error, setError] = useState(false);\n \n const handleVerify = async () => {\n try {\n await verifyOTP(otp);\n // Success\n } catch (err) {\n setError(true);\n }\n };\n \n return (\n <div className="space-y-4">\n <h2>Enter Verification Code</h2>\n <p className="text-gray-500">\n Enter the 6-digit code sent to your phone\n </p>\n <OTP\n length={6}\n value={otp}\n onChange={(value) => {\n setOtp(value);\n setError(false);\n }}\n error={error}\n />\n {error && (\n <p className="text-error-700">Invalid code. Please try again.</p>\n )}\n <Button \n onClick={handleVerify}\n disabled={otp.length !== 6}\n >\n Verify\n </Button>\n </div>\n );\n}\n```\n\n### PIN Entry\n\n```tsx\nimport { OTP } from "@components";\nimport { useState } from "react";\n\nfunction PINEntry() {\n const [pin, setPin] = useState("");\n \n return (\n <div>\n <label>Enter PIN</label>\n <OTP\n length={4}\n value={pin}\n onChange={setPin}\n />\n </div>\n );\n}\n```\n\n## Accessibility\n\n- Auto-focus management\n- Keyboard navigation\n- Paste support\n'
2408
2765
  }
2409
2766
  ],
2410
2767
  "directories": []
@@ -2538,6 +2895,7 @@ export const PanelHeader = React.forwardRef<HTMLDivElement, IPanelHeaderProps>(
2538
2895
  onClick={onBackHandler}
2539
2896
  variant="text"
2540
2897
  color="secondary"
2898
+ aria-label="Go back"
2541
2899
  />
2542
2900
  )}
2543
2901
  {( header || subHeader ) && (
@@ -2556,6 +2914,7 @@ export const PanelHeader = React.forwardRef<HTMLDivElement, IPanelHeaderProps>(
2556
2914
  variant="text"
2557
2915
  color="secondary"
2558
2916
  autoFocus
2917
+ aria-label="Close panel"
2559
2918
  />
2560
2919
  )}
2561
2920
  </div>
@@ -2576,7 +2935,7 @@ PanelHeader.displayName = "PanelHeader";
2576
2935
  },
2577
2936
  {
2578
2937
  "name": "panel.tsx",
2579
- "content": 'import * as React from "react";\nimport ReactDOM from "react-dom";\nimport { FocusOn } from "react-focus-on";\n\nimport { panelVariants, cssVisibilityVariants } from "./panelVariants";\nimport { PanelHeader } from "./panelHeader";\nimport { PanelBody } from "./panelBody";\nimport { PanelFooter } from "./panelFooter";\n\nexport interface IPanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "dir"> {\n /**\n * Variant of the Panel\n * @default compact\n */\n variant?: "extended" | "compact";\n /**\n * Prop to control the panel display\n * @default false\n */\n showPanel?: boolean;\n /**\n * Toggle the visibility of the Panel without unmounting it\n * @default false\n */\n toggleVisibilityUsingCss?: boolean;\n /**\n * Overwrite the Panel styles by passing space separated class names\n */\n className?: string;\n /**\n * Accepts children of ReactNode type\n */\n children: React.ReactNode;\n /**\n * Direction from which the panel slides in\n * @default "right"\n */\n slideDirection?: "left" | "right";\n /**\n * If true, indicates that the app is in RTL (right-to-left) mode\n * When true in RTL mode, slideDirection="left" will make panel open from right\n * @default false\n */\n rtl?: boolean;\n /**\n * Pass a reference to the element where the Panel needs to be rendered\n * @default document.body\n */\n portalTarget?: HTMLElement;\n /**\n * A list of Refs to be considered as a part of the Lock. The html elements in the list will be accessible while the Panel is open.\n */\n shards?: ( HTMLElement | React.RefObject<HTMLElement> )[];\n /**\n * Optional callback function to call when panel is closed\n */\n onClose?: ( e: React.MouseEvent<HTMLDivElement> | KeyboardEvent ) => void;\n}\n\n// Create the base Panel component\nconst PanelComponent = React.forwardRef<HTMLDivElement, IPanelProps>(\n ({\n variant = "compact",\n showPanel = false,\n toggleVisibilityUsingCss = false,\n className,\n children,\n rtl,\n slideDirection = "right",\n portalTarget = typeof document !== "undefined" ? document.body : undefined,\n shards,\n onClose,\n ...props\n }, ref ) => {\n // In RTL mode, we invert the slide direction\n const effectiveSlideDirection = rtl\n ? ( slideDirection === "left" ? "right" : "left" )\n : slideDirection;\n const panelRef = React.useRef<HTMLDivElement>( null );\n const [ shouldRender, setShouldRender ] = React.useState( false );\n\n // Handle showing/hiding the panel\n React.useEffect(() => {\n if ( showPanel ) {\n setShouldRender( true );\n }\n\n // When toggleVisibilityUsingCss = false, this timeout hides the panel before the slide out animation ends.\n if ( shouldRender && !showPanel ) {\n setTimeout(() => setShouldRender( false ), 490 );\n }\n }, [ showPanel, shouldRender ]);\n\n // Handle escape key for closing\n React.useEffect(() => {\n // Esc key handling\n const handleEscClick = ( event: KeyboardEvent ) => event.code === "Escape" && onClose?.( event );\n\n const removeListener = () => {\n document.removeEventListener( "keydown", handleEscClick, false );\n };\n\n // Event Listener added for the keypress and click when component mounts\n if ( showPanel ) {\n document.addEventListener( "keydown", handleEscClick, false );\n } else {\n removeListener();\n }\n\n return () => {\n // Event Listener removed for the keypress and click when component unmounts\n removeListener();\n };\n }, [ showPanel, onClose ]);\n\n // Using CSS to control visibility\n if ( toggleVisibilityUsingCss ) {\n const { container, overlay, panel } = cssVisibilityVariants({\n direction: effectiveSlideDirection,\n variant,\n showPanel\n });\n\n return portalTarget ? ReactDOM.createPortal(\n <FocusOn\n as="div"\n enabled={showPanel}\n shards={shards}\n className={container()}\n >\n <div\n className={overlay()}\n onClick={onClose}\n id="panel-overlay"\n />\n\n {children && (\n <div\n id="panel"\n aria-modal="true"\n role="dialog"\n {...rtl ? { dir: "rtl" } : {}}\n ref={ref || panelRef}\n className={panel({ class: className })}\n {...props}\n >\n {children}\n </div>\n )}\n </FocusOn>,\n portalTarget\n ) : null;\n } else {\n const panelAnimation = (\n showPanel\n ? `slideIn${effectiveSlideDirection === "right" ? "Right" : "Left"}`\n : `slideOut${effectiveSlideDirection === "right" ? "Right" : "Left"}`\n ) as "slideInRight" | "slideOutRight" | "slideInLeft" | "slideOutLeft";\n\n const { container } = panelVariants();\n const { overlay } = panelVariants({\n animation: showPanel ? "appear" : "disappear",\n visibility: showPanel ? "visible" : "hidden"\n });\n const { panel } = panelVariants({\n variant,\n animation: panelAnimation,\n visibility: "visible",\n direction: effectiveSlideDirection\n });\n\n return shouldRender && portalTarget ? ReactDOM.createPortal(\n <FocusOn\n as="div"\n enabled={showPanel}\n shards={shards}\n className={container()}\n >\n <div\n className={overlay()}\n onClick={onClose}\n id="panel-overlay"\n />\n\n {children && (\n <div\n id="panel"\n aria-modal="true"\n role="dialog"\n {...rtl ? { dir: "rtl" } : {}}\n ref={ref || panelRef}\n className={panel({ class: className })}\n {...props}\n >\n {children}\n </div>\n )}\n </FocusOn>,\n portalTarget\n ) : null;\n }\n }\n);\n\nPanelComponent.displayName = "Panel";\n\n// Define the compound component type\ntype TPanelCompoundComponent = typeof PanelComponent & {\n Header: typeof PanelHeader;\n Body: typeof PanelBody;\n Footer: typeof PanelFooter;\n};\n\n// Create the compound component by casting\nexport const Panel = PanelComponent as TPanelCompoundComponent;\n\n// Attach the subcomponents\nPanel.Header = PanelHeader;\nPanel.Body = PanelBody;\nPanel.Footer = PanelFooter;\n'
2938
+ "content": 'import * as React from "react";\nimport ReactDOM from "react-dom";\nimport { FocusOn } from "react-focus-on";\n\nimport { panelVariants, cssVisibilityVariants } from "./panelVariants";\nimport { PanelHeader } from "./panelHeader";\nimport { PanelBody } from "./panelBody";\nimport { PanelFooter } from "./panelFooter";\n\nexport interface IPanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "dir"> {\n /**\n * Variant of the Panel\n * @default compact\n */\n variant?: "extended" | "compact";\n /**\n * Prop to control the panel display\n * @default false\n */\n showPanel?: boolean;\n /**\n * Toggle the visibility of the Panel without unmounting it\n * @default false\n */\n toggleVisibilityUsingCss?: boolean;\n /**\n * Overwrite the Panel styles by passing space separated class names\n */\n className?: string;\n /**\n * Accepts children of ReactNode type\n */\n children: React.ReactNode;\n /**\n * Direction from which the panel slides in\n * @default "right"\n */\n slideDirection?: "left" | "right";\n /**\n * If true, indicates that the app is in RTL (right-to-left) mode\n * When true in RTL mode, slideDirection="left" will make panel open from right\n * @default false\n */\n rtl?: boolean;\n /**\n * Pass a reference to the element where the Panel needs to be rendered\n * @default document.body\n */\n portalTarget?: HTMLElement;\n /**\n * A list of Refs to be considered as a part of the Lock. The html elements in the list will be accessible while the Panel is open.\n */\n shards?: ( HTMLElement | React.RefObject<HTMLElement> )[];\n /**\n * Optional callback function to call when panel is closed\n */\n onClose?: ( e: React.MouseEvent<HTMLDivElement> | KeyboardEvent ) => void;\n}\n\n// Compound component type with subcomponents attached\ntype TPanelCompoundComponent = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<IPanelProps> & React.RefAttributes<HTMLDivElement>\n> & {\n Header: typeof PanelHeader;\n Body: typeof PanelBody;\n Footer: typeof PanelFooter;\n};\n\n// Create the base Panel component\nexport const Panel = React.forwardRef<HTMLDivElement, IPanelProps>(\n ({\n variant = "compact",\n showPanel = false,\n toggleVisibilityUsingCss = false,\n className,\n children,\n rtl,\n slideDirection = "right",\n portalTarget = typeof document !== "undefined" ? document.body : undefined,\n shards,\n onClose,\n ...props\n }, ref ) => {\n // In RTL mode, we invert the slide direction\n const effectiveSlideDirection = rtl\n ? ( slideDirection === "left" ? "right" : "left" )\n : slideDirection;\n const panelRef = React.useRef<HTMLDivElement>( null );\n const [ shouldRender, setShouldRender ] = React.useState( false );\n\n // Handle showing/hiding the panel\n React.useEffect(() => {\n if ( showPanel ) {\n setShouldRender( true );\n }\n\n // When toggleVisibilityUsingCss = false, this timeout hides the panel before the slide out animation ends.\n if ( shouldRender && !showPanel ) {\n setTimeout(() => setShouldRender( false ), 490 );\n }\n }, [ showPanel, shouldRender ]);\n\n // Handle escape key for closing\n React.useEffect(() => {\n // Esc key handling\n const handleEscClick = ( event: KeyboardEvent ) => event.code === "Escape" && onClose?.( event );\n\n const removeListener = () => {\n document.removeEventListener( "keydown", handleEscClick, false );\n };\n\n // Event Listener added for the keypress and click when component mounts\n if ( showPanel ) {\n document.addEventListener( "keydown", handleEscClick, false );\n } else {\n removeListener();\n }\n\n return () => {\n // Event Listener removed for the keypress and click when component unmounts\n removeListener();\n };\n }, [ showPanel, onClose ]);\n\n // Using CSS to control visibility\n if ( toggleVisibilityUsingCss ) {\n const { container, overlay, panel } = cssVisibilityVariants({\n direction: effectiveSlideDirection,\n variant,\n showPanel\n });\n\n return portalTarget ? ReactDOM.createPortal(\n <FocusOn\n as="div"\n enabled={showPanel}\n shards={shards}\n className={container()}\n >\n <div\n className={overlay()}\n onClick={onClose}\n id="panel-overlay"\n />\n\n {children && (\n <div\n id="panel"\n aria-modal="true"\n role="dialog"\n {...rtl ? { dir: "rtl" } : {}}\n ref={ref || panelRef}\n className={panel({ class: className })}\n {...props}\n >\n {children}\n </div>\n )}\n </FocusOn>,\n portalTarget\n ) : null;\n } else {\n const panelAnimation = (\n showPanel\n ? `slideIn${effectiveSlideDirection === "right" ? "Right" : "Left"}`\n : `slideOut${effectiveSlideDirection === "right" ? "Right" : "Left"}`\n ) as "slideInRight" | "slideOutRight" | "slideInLeft" | "slideOutLeft";\n\n const { container } = panelVariants();\n const { overlay } = panelVariants({\n animation: showPanel ? "appear" : "disappear",\n visibility: showPanel ? "visible" : "hidden"\n });\n const { panel } = panelVariants({\n variant,\n animation: panelAnimation,\n visibility: "visible",\n direction: effectiveSlideDirection\n });\n\n return shouldRender && portalTarget ? ReactDOM.createPortal(\n <FocusOn\n as="div"\n enabled={showPanel}\n shards={shards}\n className={container()}\n >\n <div\n className={overlay()}\n onClick={onClose}\n id="panel-overlay"\n />\n\n {children && (\n <div\n id="panel"\n aria-modal="true"\n role="dialog"\n {...rtl ? { dir: "rtl" } : {}}\n ref={ref || panelRef}\n className={panel({ class: className })}\n {...props}\n >\n {children}\n </div>\n )}\n </FocusOn>,\n portalTarget\n ) : null;\n }\n }\n) as TPanelCompoundComponent;\n\nPanel.displayName = "Panel";\n\n// Attach the subcomponents\nPanel.Header = PanelHeader;\nPanel.Body = PanelBody;\nPanel.Footer = PanelFooter;\n'
2580
2939
  },
2581
2940
  {
2582
2941
  "name": "index.ts",
@@ -2725,7 +3084,7 @@ PanelGroup.displayName = "PanelGroup";
2725
3084
  "files": [
2726
3085
  {
2727
3086
  "name": "progressVariants.ts",
2728
- "content": 'import { tv } from "tailwind-variants";\n\nexport const progressVariants = tv({\n slots: {\n container: "flex items-center gap-2 w-full",\n track: "bg-gray-200 h-2 rounded-2xl w-full dark:bg-secondary-600",\n bar: "flex justify-center items-center outline rounded-sm text-xs font-medium transition-all duration-100 h-full py-1 relative group",\n text: [\n "flex items-center justify-center text-xs-fit text-white dark:text-secondary-800",\n "h-8 w-8 border rounded-full dark:border-secondary-800 opacity-0 group-hover:opacity-100",\n "transition-opacity duration-300 ease-in-out z-10 absolute -end-4"\n ],\n valueText: "text-base text-center text-secondary-500 font-medium min-w-8 dark:text-secondary-50",\n circular: "",\n circularTrack: "dark:stroke-secondary-600",\n circularProgress: "",\n circularText: "fill-secondary-500 font-semibold dark:fill-secondary-50"\n },\n variants: {\n color: {\n primary: {\n bar: "!bg-primary-500 outline-primary-400 dark:bg-primary-400 dark:outline-primary-500",\n text: "bg-primary-500 dark:bg-primary-400",\n circularTrack: "stroke-primary-50",\n circularProgress: "stroke-primary-500 dark:stroke-primary-400"\n },\n secondary: {\n bar: "bg-gray-500 outline-gray-400 dark:bg-secondary-400 dark:outline-gray-500",\n text: "bg-gray-500 dark:bg-secondary-400",\n circularTrack: "stroke-gray-50",\n circularProgress: "stroke-gray-500 dark:stroke-secondary-400"\n },\n success: {\n bar: "bg-success-500 outline-success-400 dark:bg-success-400 dark:outline-success-500",\n text: "bg-success-500 dark:bg-success-400",\n circularTrack: "stroke-success-50",\n circularProgress: "stroke-success-500 dark:stroke-success-400"\n },\n warning: {\n bar: "bg-warning-500 outline-warning-400 dark:bg-warning-400 dark:outline-warning-500",\n text: "bg-warning-500 dark:bg-warning-400",\n circularTrack: "stroke-warning-50",\n circularProgress: "stroke-warning-500 dark:stroke-warning-400"\n },\n error: {\n bar: "bg-error-500 outline-error-400 dark:bg-error-400 dark:outline-error-500",\n text: "bg-error-500 dark:bg-error-400",\n circularTrack: "stroke-error-50",\n circularProgress: "stroke-error-500 dark:stroke-error-400"\n }\n },\n size: {\n md: { circularText: "text-xxs" },\n lg: { circularText: "text-xs-fit" }\n },\n striped: {\n true: {\n bar: [\n "bg-[size:0.5rem_0.5rem]",\n "bg-[image:repeating-linear-gradient(45deg,rgba(255,255,255,0.15)_0_0.25rem,transparent_0.25rem_0.5rem)]"\n ]\n }\n },\n animate: {\n true: { bar: "animate-stripes" }\n },\n position: {\n top: { text: "bottom-3" },\n right: {},\n bottom: { text: "top-3" },\n inline: { text: "-end-4" }\n }\n },\n defaultVariants: {\n color: "primary",\n size: "md",\n position: "right"\n }\n});\n'
3087
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const progressVariants = tv({\n slots: {\n container: "flex items-center gap-2 w-full",\n track: "bg-gray-200 h-2 rounded-2xl w-full dark:bg-secondary-600",\n bar: "flex justify-center items-center outline rounded-sm text-xs font-medium transition-all duration-100 h-full py-1 relative group",\n text: [\n "flex items-center justify-center text-xs-fit text-white dark:text-secondary-800",\n "h-8 w-8 border rounded-full dark:border-secondary-800 opacity-0 group-hover:opacity-100",\n "transition-opacity duration-300 ease-in-out z-10 absolute -end-4"\n ],\n valueText: "text-base text-center text-secondary-500 font-medium min-w-8 dark:text-secondary-50",\n circular: "",\n circularTrack: "dark:stroke-secondary-600",\n circularProgress: "",\n circularText: "fill-secondary-500 font-semibold dark:fill-secondary-50"\n },\n variants: {\n color: {\n primary: {\n bar: "!bg-primary-700 outline-primary-400 dark:bg-primary-400 dark:outline-primary-500",\n text: "bg-primary-700 dark:bg-primary-400",\n circularTrack: "stroke-primary-100",\n circularProgress: "stroke-primary-700 dark:stroke-primary-400"\n },\n secondary: {\n bar: "bg-gray-500 outline-gray-400 dark:bg-secondary-400 dark:outline-gray-500",\n text: "bg-gray-500 dark:bg-secondary-400",\n circularTrack: "stroke-gray-50",\n circularProgress: "stroke-gray-500 dark:stroke-secondary-400"\n },\n success: {\n bar: "bg-success-700 outline-success-400 dark:bg-success-400 dark:outline-success-500",\n text: "bg-success-700 dark:bg-success-400",\n circularTrack: "stroke-success-100",\n circularProgress: "stroke-success-700 dark:stroke-success-400"\n },\n warning: {\n bar: "bg-warning-700 outline-warning-400 dark:bg-warning-400 dark:outline-warning-500",\n text: "bg-warning-700 dark:bg-warning-400",\n circularTrack: "stroke-warning-100",\n circularProgress: "stroke-warning-700 dark:stroke-warning-400"\n },\n error: {\n bar: "bg-error-700 outline-error-400 dark:bg-error-400 dark:outline-error-500",\n text: "bg-error-700 dark:bg-error-400",\n circularTrack: "stroke-error-100",\n circularProgress: "stroke-error-700 dark:stroke-error-400"\n }\n },\n size: {\n md: { circularText: "text-xxs" },\n lg: { circularText: "text-xs-fit" }\n },\n striped: {\n true: {\n bar: [\n "bg-[size:0.5rem_0.5rem]",\n "bg-[image:repeating-linear-gradient(45deg,rgba(255,255,255,0.15)_0_0.25rem,transparent_0.25rem_0.5rem)]"\n ]\n }\n },\n animate: {\n true: { bar: "animate-stripes" }\n },\n position: {\n top: { text: "bottom-3" },\n right: {},\n bottom: { text: "top-3" },\n inline: { text: "-end-4" }\n }\n },\n defaultVariants: {\n color: "primary",\n size: "md",\n position: "right"\n }\n});\n'
2729
3088
  },
2730
3089
  {
2731
3090
  "name": "progress.tsx",
@@ -2811,7 +3170,7 @@ export const radioVariants = tv({
2811
3170
  },
2812
3171
  "radiogroup": {
2813
3172
  "name": "radioGroup",
2814
- "description": "The RadioGroup component manages a collection of radio buttons for single-choice selection. **When to use:** - Single choice from multiple options - Settings with mutually exclusive options - Quiz or survey questions - Configuration options **Component Architecture:** - Manages single selected value - Styled with Tailwind CSS and cva - Built on Radio component - Supports controlled and uncontrolled modes",
3173
+ "description": "The RadioGroup component manages a collection of radio buttons for single-choice selection. **When to use:** - Single choice from multiple options - Settings with mutually exclusive options - Quiz or survey questions - Configuration options **Component Architecture:** - Manages single selected value - Styled with Tailwind CSS and `tailwind-variants` - Built on Radio component - Supports controlled and uncontrolled modes",
2815
3174
  "dependencies": [
2816
3175
  "tailwind-variants",
2817
3176
  "react",
@@ -2823,19 +3182,19 @@ export const radioVariants = tv({
2823
3182
  "files": [
2824
3183
  {
2825
3184
  "name": "radioGroupVariants.ts",
2826
- "content": 'import { tv } from "tailwind-variants";\n\nexport const radioGroupVariants = tv({\n slots: {\n root: "inline-flex flex-col",\n item: "inline-flex gap-2 items-start outline-none cursor-pointer pl-0",\n label: "text-secondary-500 dark:text-secondary-50"\n },\n variants: {\n variant: {\n outline: {\n root: "gap-4",\n item: [\n "rounded border border-secondary-100",\n "hover:border hover:border-primary-500",\n "focus-within:border-primary-500 focus-within:shadow-primary-2px",\n "dark:border-secondary-500",\n "dark:hover:border-primary-400",\n "dark:focus-within:border-primary-400 dark:focus-within:shadow-primary-2px"\n ]\n },\n text: {\n root: "border border-gray-100 rounded dark:border-secondary-500",\n item: ""\n }\n },\n size: {\n sm: { item: "p-3 text-base" },\n md: { item: "p-4 text-base" },\n lg: { item: "p-4 text-md" }\n },\n checked: {\n true: { item: "bg-primary-50 dark:bg-secondary-600" }\n },\n disabled: {\n true: {\n item: "bg-secondary-50 cursor-not-allowed dark:bg-secondary-700 dark:text-secondary-400",\n label: "text-secondary-200 dark:text-secondary-400"\n }\n }\n },\n defaultVariants: {\n variant: "outline",\n size: "md"\n }\n});\n'
3185
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const radioGroupVariants = tv({\n slots: {\n root: "inline-flex flex-col",\n item: "inline-flex gap-2 items-start outline-none cursor-pointer pl-0",\n label: "text-secondary-500 dark:text-secondary-50"\n },\n variants: {\n variant: {\n outline: {\n root: "gap-4",\n item: [\n "rounded border border-secondary-100",\n "hover:border hover:border-primary-500",\n "focus-within:border-primary-500 focus-within:shadow-primary-2px",\n "dark:border-secondary-500",\n "dark:hover:border-primary-400",\n "dark:focus-within:border-primary-400 dark:focus-within:shadow-primary-2px"\n ]\n },\n text: {\n root: "border border-gray-100 rounded dark:border-secondary-500",\n item: ""\n },\n segmented: {\n root: [\n // `max-w-full` bounds the track to its container so `overflow-x-auto`\n // actually engages; `w-fit` still keeps it snug when options fit.\n "flex flex-row w-fit max-w-full items-center overflow-x-auto gap-1 rounded border p-1",\n // Thin scrollbar as the overflow affordance (mirrors the Tabs strip).\n "scrollbar-width-thin",\n "[&::-webkit-scrollbar]:h-1",\n "[&::-webkit-scrollbar-thumb]:rounded-full",\n "[&::-webkit-scrollbar-thumb]:bg-secondary-200 dark:[&::-webkit-scrollbar-thumb]:bg-secondary-500"\n ],\n item: [\n "flex gap-0 items-center justify-center whitespace-nowrap",\n "h-8 px-3 py-1.5 rounded-sm text-sm font-medium transition-colors",\n "text-secondary-400 dark:text-secondary-300",\n "hover:bg-frostBlue dark:hover:bg-secondary-600",\n "has-[:focus-visible]:border-[0.5px] has-[:focus-visible]:border-primary-500 has-[:focus-visible]:bg-primary-50",\n "dark:has-[:focus-visible]:border-primary-400 dark:has-[:focus-visible]:bg-primary-900"\n ],\n label: "inline-flex items-center gap-2 text-inherit dark:text-inherit"\n }\n },\n color: {\n neutral: {},\n primary: {}\n },\n size: {\n sm: { item: "p-3 text-base" },\n md: { item: "p-4 text-base" },\n lg: { item: "p-4 text-md" }\n },\n checked: {\n true: {}\n },\n disabled: {\n true: {\n item: "bg-secondary-50 cursor-not-allowed dark:bg-secondary-700 dark:text-secondary-400",\n label: "text-secondary-200 dark:text-secondary-400"\n }\n }\n },\n compoundVariants: [\n // Outline active fill (kept scoped to outline so it never leaks onto segmented pills)\n {\n variant: "outline",\n checked: true,\n class: { item: "bg-primary-50 dark:bg-secondary-600" }\n },\n // Segmented has a single fixed size \u2014 neutralize the size padding/text overrides\n {\n variant: "segmented",\n size: [ "sm", "md", "lg" ],\n class: { item: "h-8 px-3 py-1.5 text-sm" }\n },\n // Segmented track colors\n {\n variant: "segmented",\n color: "neutral",\n class: { root: "bg-gray-100 border-gray-200 dark:bg-secondary-700 dark:border-secondary-500" }\n },\n {\n variant: "segmented",\n color: "primary",\n class: { root: "bg-white border-gray-200 dark:bg-secondary-800 dark:border-secondary-500" }\n },\n {\n variant: "segmented",\n disabled: true,\n class: {\n item: [\n "opacity-40 cursor-not-allowed",\n "bg-transparent hover:bg-transparent dark:bg-transparent dark:hover:bg-transparent",\n "text-secondary-400 dark:text-secondary-300"\n ],\n label: "text-inherit dark:text-inherit"\n }\n },\n // Segmented active pill fill\n {\n variant: "segmented",\n color: "neutral",\n checked: true,\n class: { item: "bg-white text-secondary-500 hover:bg-white dark:bg-secondary-500 dark:text-white dark:hover:bg-secondary-500" }\n },\n {\n variant: "segmented",\n color: "primary",\n checked: true,\n class: { item: "bg-primary-500 text-white hover:bg-primary-500 dark:bg-primary-400 dark:text-secondary-800 dark:hover:bg-primary-400" }\n }\n ],\n defaultVariants: {\n variant: "outline",\n color: "neutral",\n size: "md"\n }\n});\n'
2827
3186
  },
2828
3187
  {
2829
3188
  "name": "radioGroup.tsx",
2830
- "content": 'import * as React from "react";\nimport { type ReactElement, type ChangeEvent, useState, useEffect, useRef, useId } from "react";\n\nimport { Radio, type IRadioProps } from "../radio";\nimport { radioGroupVariants } from "./radioGroupVariants";\n\nexport type TRadioGroupSize = "sm" | "md" | "lg";\n\n/**\n * RadioGroup component props\n */\nexport interface IRadioGroupProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange"> {\n /**\n * Size of the Radio group.\n * @default md\n */\n size?: TRadioGroupSize;\n /**\n * Pass space separated class names to override the RadioGroup styling\n */\n className?: string;\n /**\n * Pass boolean value to disable the component.\n * @default false\n */\n disabled?: boolean;\n /**\n * Selected value\n */\n selectedValue?: string;\n /**\n * An array of objects of radio props type\n */\n options: IRadioProps[];\n /**\n * Callback function that is called when the radio group selection changes.\n * A selected value is passed as an argument to the function.\n */\n onChange?: ( arg: string ) => void;\n /**\n * Placement of the radio\n * @default "start"\n */\n radioPlacement?: "start" | "end";\n /**\n * Variant of the RadioGroup\n * @default outline\n */\n variant?: "outline" | "text";\n}\n\n/**\n * RadioGroup component for grouping radio button options\n */\nexport const RadioGroup = ({\n size = "md",\n options,\n onChange,\n className,\n selectedValue,\n disabled,\n radioPlacement = "start",\n variant = "outline"\n}: IRadioGroupProps ): ReactElement => {\n const [ selected, setSelected ] = useState<string>( selectedValue ?? "" );\n const inputId = useRef( useId());\n\n const onChangeHandler = ( event: ChangeEvent<HTMLInputElement> ): void => {\n const newSelected = event.currentTarget.checked ? event.target.value : "";\n\n setSelected( newSelected );\n onChange?.( newSelected );\n };\n\n useEffect(() => {\n if ( selectedValue ) {\n setSelected( selectedValue );\n }\n }, [selectedValue]);\n\n const { root } = radioGroupVariants({ variant });\n\n return (\n <div\n data-testid="radio-group"\n className={root({ class: [\n disabled && variant === "text" ? "bg-secondary-50 dark:bg-secondary-700 dark:text-secondary-400" : "",\n className\n ] })}>\n {options?.map(( option, index ) => {\n const { id, name, value, label, className: optionClassName, disabled: optionDisabled, ...restOptionProps } = option;\n const isChecked = selected === value;\n const isDisabled = disabled || optionDisabled;\n\n const { item, label: labelClass } = radioGroupVariants({\n variant,\n size,\n checked: isChecked && variant === "outline",\n disabled: isDisabled && variant === "outline"\n });\n\n const renderRadio = (\n <Radio\n size={size}\n name={name}\n id={id || inputId.current}\n value={value}\n onChange={onChangeHandler}\n disabled={isDisabled}\n checked={isChecked}\n className={size === "sm" ? "mt-[2px]" : undefined}\n {...restOptionProps}\n />\n );\n\n return (\n <label\n key={index}\n htmlFor={id || inputId.current}\n className={item({ class: [\n index !== 0 && variant === "text" ? "pt-0" : "",\n optionClassName\n ] })}\n >\n {radioPlacement === "start" && renderRadio}\n {label && (\n <div className={labelClass()}>\n {label}\n </div>\n )}\n {radioPlacement === "end" && renderRadio}\n </label>\n );\n })}\n </div>\n );\n};\n\nRadioGroup.displayName = "RadioGroup";\n'
3189
+ "content": 'import * as React from "react";\nimport { type ReactElement, type ChangeEvent, useState, useEffect, useRef, useId } from "react";\n\nimport { Radio, type IRadioProps } from "../radio";\nimport { radioGroupVariants } from "./radioGroupVariants";\n\nexport type TRadioGroupSize = "sm" | "md" | "lg";\n\n/**\n * Marks a prop as unsupported for the current variant.\n *\n * We encode the reason as the property\'s *type* (a descriptive string literal)\n * rather than using `never`. With `never`, the compiler can\'t narrow the\n * discriminated union to the branch you\'re actually using, so it reports the\n * mismatch against the wrong branch (e.g. `Type \'string\' is not assignable to\n * type \'"neutral" | "primary"\'`) \u2014 which never mentions the real problem.\n * A string-literal type keeps the branch narrowable, so the error reads\n * `Type \'"primary"\' is not assignable to type \'<this message>\'` instead.\n */\ntype TUnsupportedProp<TReason extends string> = TReason;\n\n/**\n * Props common to every RadioGroup variant.\n *\n * `color` is stripped from the inherited HTML attributes so each variant can\n * re-declare it (or forbid it) \u2014 see the variant-specific prop types below.\n */\ninterface IRadioGroupBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "color"> {\n /**\n * Pass space separated class names to override the RadioGroup styling\n */\n className?: string;\n /**\n * Pass boolean value to disable the component.\n * @default false\n */\n disabled?: boolean;\n /**\n * Selected value\n */\n selectedValue?: string;\n /**\n * An array of objects of radio props type\n */\n options: IRadioProps[];\n /**\n * Callback function that is called when the radio group selection changes.\n * A selected value is passed as an argument to the function.\n */\n onChange?: ( arg: string ) => void;\n}\n\n/**\n * Props for the `outline` and `text` variants: a vertical list of radio\n * options. These support `size` and `radioPlacement`; they do **not** support\n * `color` (setting it is a type error \u2014 `color` is `segmented`-only).\n */\nexport interface IRadioGroupListProps extends IRadioGroupBaseProps {\n /**\n * Variant of the RadioGroup.\n * - `outline`: each option sits in its own bordered box.\n * - `text`: all options share one bordered container.\n * @default outline\n */\n variant?: "outline" | "text";\n /**\n * Size of the Radio group.\n * @default md\n */\n size?: TRadioGroupSize;\n /**\n * Placement of the radio relative to its label.\n * @default "start"\n */\n radioPlacement?: "start" | "end";\n /**\n * Not supported by the `outline`/`text` variants \u2014 `color` only applies to\n * the `segmented` variant.\n */\n color?: TUnsupportedProp<"`color` is only supported when `variant` is \\"segmented\\"">;\n}\n\n/**\n * Props for the `segmented` variant: a bordered, equal-width pill selector\n * (segmented control) that visually hides the radio dot. It supports `color`;\n * it does **not** support `size` or `radioPlacement` (the pills are a fixed\n * height and the radio dot is hidden, so both are type errors here).\n */\nexport interface IRadioGroupSegmentedProps extends IRadioGroupBaseProps {\n variant: "segmented";\n /**\n * Active-pill color. `neutral` gives the active pill a white/dark card;\n * `primary` fills it with the brand color.\n * @default neutral\n */\n color?: "neutral" | "primary";\n /**\n * Not supported by the `segmented` variant \u2014 pills have a fixed height.\n */\n size?: TUnsupportedProp<"`size` is not supported by the \\"segmented\\" variant (pills have a fixed height)">;\n /**\n * Not supported by the `segmented` variant \u2014 the radio dot is hidden.\n */\n radioPlacement?: TUnsupportedProp<"`radioPlacement` is not supported by the \\"segmented\\" variant (the radio dot is hidden)">;\n}\n\n/**\n * RadioGroup component props. This is a discriminated union on `variant`, so\n * the compiler only allows the props that apply to the chosen variant:\n *\n * | variant | `size` | `radioPlacement` | `color` |\n * | ------------------- | :----: | :--------------: | :-----: |\n * | `outline` (default) | yes | yes | no |\n * | `text` | yes | yes | no |\n * | `segmented` | no | no | yes |\n */\nexport type TRadioGroupProps = IRadioGroupListProps | IRadioGroupSegmentedProps;\n\n/**\n * RadioGroup component for grouping radio button options\n */\nexport const RadioGroup = ({\n size = "md",\n options,\n onChange,\n className,\n selectedValue,\n disabled,\n radioPlacement = "start",\n variant = "outline",\n color = "neutral",\n name\n}: TRadioGroupProps ): ReactElement => {\n const [ selected, setSelected ] = useState<string>( selectedValue ?? "" );\n const inputId = useRef( useId());\n const isSegmented = variant === "segmented";\n // `color` only applies to the segmented variant, and `size` only to the list\n // variants; the other variant types each prop as an "unsupported" marker, so\n // narrow both back to valid values here.\n const variantColor: "neutral" | "primary" = color === "primary" ? "primary" : "neutral";\n const variantSize: TRadioGroupSize = size === "sm" || size === "lg" ? size : "md";\n\n const onChangeHandler = ( event: ChangeEvent<HTMLInputElement> ): void => {\n const newSelected = event.currentTarget.checked ? event.target.value : "";\n\n setSelected( newSelected );\n onChange?.( newSelected );\n };\n\n useEffect(() => {\n if ( selectedValue ) {\n setSelected( selectedValue );\n }\n }, [selectedValue]);\n\n const { root } = radioGroupVariants({ variant, color: variantColor });\n\n return (\n <div\n data-testid="radio-group"\n className={root({ class: [\n disabled && variant === "text" ? "bg-secondary-50 dark:bg-secondary-700 dark:text-secondary-400" : "",\n className\n ] })}>\n {options?.map(( option, index ) => {\n const { id, name: optionName, value, label, className: optionClassName, disabled: optionDisabled, ...restOptionProps } = option;\n const isChecked = selected === value;\n const isDisabled = disabled || optionDisabled;\n // Unique per-option id so `htmlFor`/`id` never collide when options omit an id.\n const optionId = id || `${inputId.current}-${index}`;\n // A shared name is what makes native radios a single group (arrow-key nav + roving tabindex).\n const groupName = optionName || name || inputId.current;\n\n const { item, label: labelClass } = radioGroupVariants({\n variant,\n color: variantColor,\n size: variantSize,\n checked: isChecked && variant !== "text",\n disabled: isDisabled && variant !== "text"\n });\n\n const renderRadio = (\n <Radio\n size={variantSize}\n name={groupName}\n id={optionId}\n value={value}\n onChange={onChangeHandler}\n disabled={isDisabled}\n checked={isChecked}\n className={isSegmented ? "sr-only" : ( variantSize === "sm" ? "mt-[2px]" : undefined )}\n {...restOptionProps}\n />\n );\n\n return (\n <label\n key={index}\n htmlFor={optionId}\n className={item({ class: [\n index !== 0 && variant === "text" ? "pt-0" : "",\n optionClassName\n ] })}\n >\n {radioPlacement === "start" && renderRadio}\n {label && (\n <div className={labelClass()}>\n {label}\n </div>\n )}\n {radioPlacement === "end" && renderRadio}\n </label>\n );\n })}\n </div>\n );\n};\n\nRadioGroup.displayName = "RadioGroup";\n'
2831
3190
  },
2832
3191
  {
2833
3192
  "name": "index.ts",
2834
- "content": 'export { RadioGroup, type IRadioGroupProps, type TRadioGroupSize } from "./radioGroup";\nexport { radioGroupVariants } from "./radioGroupVariants";'
3193
+ "content": 'export { RadioGroup, type TRadioGroupProps, type TRadioGroupSize } from "./radioGroup";\nexport { radioGroupVariants } from "./radioGroupVariants";'
2835
3194
  },
2836
3195
  {
2837
3196
  "name": "README.md",
2838
- "content": '# RadioGroup Component\n\n## Component Overview\n\nThe RadioGroup component manages a collection of radio buttons for single-choice selection.\n\n**When to use:**\n- Single choice from multiple options\n- Settings with mutually exclusive options\n- Quiz or survey questions\n- Configuration options\n\n**Component Architecture:**\n- Manages single selected value\n- Styled with Tailwind CSS and cva\n- Built on Radio component\n- Supports controlled and uncontrolled modes\n\n## Basic Usage\n\n```tsx\nimport { RadioGroup } from "@components";\nimport { useState } from "react";\n\nexport function Example() {\n const [selected, setSelected] = useState("");\n \n const options = [\n { label: "Option 1", value: "1" },\n { label: "Option 2", value: "2" },\n { label: "Option 3", value: "3" }\n ];\n \n return (\n <RadioGroup\n label="Choose One"\n options={options}\n value={selected}\n onChange={setSelected}\n />\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/radioGroup` or `@components/radioGroup`.\n\n## Component Props\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `options` | `IRadioProps[]` | - | Yes | An array of radio option objects |\n| `selectedValue` | `string` | `undefined` | No | Selected value (controlled) |\n| `onChange` | `(value: string) => void` | `undefined` | No | Callback when selection changes (receives selected value) |\n| `size` | `TRadioGroupSize` | `\'md\'` | No | Size of the radio group |\n| `radioPlacement` | `\'start\' \\| \'end\'` | `\'start\'` | No | Placement of the radio button relative to label |\n| `variant` | `\'outline\' \\| \'text\'` | `\'outline\'` | No | Variant of the RadioGroup |\n| `disabled` | `boolean` | `false` | No | Disable all radio buttons in the group |\n| `className` | `string` | `undefined` | No | Additional CSS classes |\n\n## Practical Examples\n\n### Payment Method Selection\n\n```tsx\nimport { RadioGroup } from "@components";\nimport { useState } from "react";\n\nfunction PaymentMethod() {\n const [method, setMethod] = useState("card");\n \n const options = [\n { label: "Credit Card", value: "card" },\n { label: "PayPal", value: "paypal" },\n { label: "Bank Transfer", value: "bank" }\n ];\n \n return (\n <RadioGroup\n label="Payment Method"\n options={options}\n value={method}\n onChange={setMethod}\n />\n );\n}\n```\n\n### Survey Question\n\n```tsx\nimport { RadioGroup } from "@components";\nimport { useState } from "react";\n\nfunction SurveyQuestion() {\n const [answer, setAnswer] = useState("");\n \n const options = [\n { label: "Very Satisfied", value: "5" },\n { label: "Satisfied", value: "4" },\n { label: "Neutral", value: "3" },\n { label: "Dissatisfied", value: "2" },\n { label: "Very Dissatisfied", value: "1" }\n ];\n \n return (\n <RadioGroup\n label="How satisfied are you with our service?"\n options={options}\n value={answer}\n onChange={setAnswer}\n />\n );\n}\n```\n'
3197
+ "content": '# RadioGroup Component\n\n## Component Overview\n\nThe RadioGroup component manages a collection of radio buttons for single-choice selection.\n\n**When to use:**\n- Single choice from multiple options\n- Settings with mutually exclusive options\n- Quiz or survey questions\n- Configuration options\n\n**Component Architecture:**\n- Manages single selected value\n- Styled with Tailwind CSS and `tailwind-variants`\n- Built on Radio component\n- Supports controlled and uncontrolled modes\n\n## Basic Usage\n\n```tsx\nimport { RadioGroup } from "@components";\nimport { useState } from "react";\n\nexport function Example() {\n const [selected, setSelected] = useState("");\n\n const options = [\n { label: "Option 1", value: "1" },\n { label: "Option 2", value: "2" },\n { label: "Option 3", value: "3" }\n ];\n\n return (\n <RadioGroup\n options={options}\n selectedValue={selected}\n onChange={setSelected}\n />\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/radioGroup` or `@components/radioGroup`.\n\n## Component Props\n\nThe props type is a **discriminated union on `variant`**, so the compiler only allows the props that apply to the chosen variant (see the "Variants" column).\n\n| Prop | Type | Default | Required | Variants | Description |\n|------|------|---------|----------|----------|-------------|\n| `options` | `IRadioProps[]` | - | Yes | all | An array of radio option objects |\n| `variant` | `\'outline\' \\| \'text\' \\| \'segmented\'` | `\'outline\'` | No | all | Variant of the RadioGroup. `segmented` renders a bordered, equal-width pill selector (segmented control) |\n| `selectedValue` | `string` | `undefined` | No | all | Selected value (controlled) |\n| `onChange` | `(value: string) => void` | `undefined` | No | all | Callback when selection changes (receives selected value) |\n| `disabled` | `boolean` | `false` | No | all | Disable all radio buttons in the group |\n| `className` | `string` | `undefined` | No | all | Additional CSS classes |\n| `size` | `TRadioGroupSize` | `\'md\'` | No | `outline`, `text` | Size of the radio group. Type error on `segmented` (fixed pill height) |\n| `radioPlacement` | `\'start\' \\| \'end\'` | `\'start\'` | No | `outline`, `text` | Placement of the radio button relative to label. Type error on `segmented` (radio dot is hidden) |\n| `color` | `\'neutral\' \\| \'primary\'` | `\'neutral\'` | No | `segmented` | Active-pill color. Type error on `outline`/`text` |\n\n## Practical Examples\n\n### Payment Method Selection\n\n```tsx\nimport { RadioGroup } from "@components";\nimport { useState } from "react";\n\nfunction PaymentMethod() {\n const [method, setMethod] = useState("card");\n\n const options = [\n { label: "Credit Card", value: "card" },\n { label: "PayPal", value: "paypal" },\n { label: "Bank Transfer", value: "bank" }\n ];\n\n return (\n <RadioGroup\n options={options}\n selectedValue={method}\n onChange={setMethod}\n />\n );\n}\n```\n\n### Survey Question\n\n```tsx\nimport { RadioGroup } from "@components";\nimport { useState } from "react";\n\nfunction SurveyQuestion() {\n const [answer, setAnswer] = useState("");\n\n const options = [\n { label: "Very Satisfied", value: "5" },\n { label: "Satisfied", value: "4" },\n { label: "Neutral", value: "3" },\n { label: "Dissatisfied", value: "2" },\n { label: "Very Dissatisfied", value: "1" }\n ];\n\n return (\n <RadioGroup\n options={options}\n selectedValue={answer}\n onChange={setAnswer}\n />\n );\n}\n```\n\n### Segmented Control\n\nThe `segmented` variant is a bordered, equal-width pill selector \u2014 an N-way single-select control. It replaces the former `SelectorTabs` component. Because it is built on native radio inputs, it gets radiogroup semantics, arrow-key navigation, and roving tabindex for free; the app owns and renders the content for the selected value.\n\n```tsx\nimport { RadioGroup } from "@components";\nimport { useState } from "react";\n\nfunction ViewSwitcher() {\n const [view, setView] = useState("details");\n\n const options = [\n { id: "details", value: "details", label: "Details" },\n { id: "files", value: "files", label: "Files" },\n { id: "resources", value: "resources", label: "Resources" }\n ];\n\n return (\n <>\n <RadioGroup\n variant="segmented"\n color="neutral" // or "primary"\n options={options}\n selectedValue={view}\n onChange={setView}\n />\n {view === "details" && <div>Details content</div>}\n {view === "files" && <div>Files content</div>}\n {view === "resources" && <div>Resources content</div>}\n </>\n );\n}\n```\n\n**Icons:** each option\'s `label` is a `ReactNode`, so compose icons directly into it (e.g. `label: <><Icon />Details</>`); there are no separate prefix/suffix icon props.\n\n**Overflow:** the track is capped at `max-w-full`, so when it sits in a width-constrained container and has more options than fit, it scrolls horizontally (with a thin scrollbar) instead of overflowing the layout. For selections with more than ~6\u20137 options, prefer a `Select`/dropdown \u2014 a segmented control reads poorly past that many pills.\n'
2839
3198
  }
2840
3199
  ],
2841
3200
  "directories": []
@@ -2910,7 +3269,7 @@ export const scrollbarVariants = tv({
2910
3269
  },
2911
3270
  {
2912
3271
  "name": "scrollbar.tsx",
2913
- "content": 'import * as React from "react";\nimport { useRef, useEffect, useCallback, type ElementType, useState, forwardRef } from "react";\nimport { findParentAttribute } from "@utils";\nimport { useWindowSize } from "@hooks";\nimport mergeRefs from "react-merge-refs";\nimport { keyboardKeys, mobileBreakPoint } from "@constants";\nimport { updateCursor, resetCursor, handleScrollToHelper } from "./utils";\nimport { scrollbarVariants } from "./scrollbarVariants";\n\n// Avoid void elements that can\'t have children\ntype TVoidElements = "area" | "base" | "br" | "col" | "embed" | "hr" | "img" | "input" | "link" |\n "meta" | "param" | "source" | "track" | "wbr" | "audio" | "video" | "canvas" | "iframe" |\n "embed" | "object" | "param" | "picture" | "portal" | "svg" | "math" | "svg";\n\n/**\n * Props for the Scrollbar component\n */\nexport interface IScrollbarProps extends Omit<React.HTMLAttributes<HTMLElement>, "as"> {\n /**\n * children to render inside the scroll container\n */\n children: React.ReactNode;\n\n /**\n * The type of tag to render for the scroll container, the default value is "div".\n * @default div\n */\n as?: keyof Omit<JSX.IntrinsicElements, TVoidElements>;\n\n /**\n * Overwrite the children container styles by passing space separated class names.\n * @optional\n */\n className?: string;\n\n /**\n * Pass a boolean value to set the visibility of the scroller, by default the scrollbar will be visible on content hover.\n * @optional\n * @default false\n */\n alwaysVisible?: boolean;\n\n /**\n * Set it to true if you want to directly scroll to the click position,\n * by default the scroller will move in the direction of the click\n * @default false\n */\n scrollToClickPosition?: boolean;\n\n /**\n * Optional ID for the scrollbar container\n */\n id?: string;\n}\n\n/**\n * Scrollbar component provides a custom scrollbar with support for both vertical and horizontal scrolling.\n * It includes features like custom styling, touch support, RTL support, and keyboard navigation.\n */\nexport const Scrollbar = forwardRef<HTMLElement, IScrollbarProps>(\n ({\n children,\n as = "div",\n className,\n alwaysVisible = false,\n scrollToClickPosition = false,\n id,\n ...rest\n }, ref ) => {\n // Set up the element tag\n const Tag = as as ElementType;\n\n // Refs for DOM elements\n const scrollbarContainerRef = useRef<HTMLDivElement>( null );\n const contentRef = useRef<HTMLDivElement>( null );\n\n const trackRefY = useRef<HTMLDivElement>( null );\n const thumbRefY = useRef<HTMLDivElement>( null );\n const scrollerContainerRefY = useRef<HTMLDivElement>( null );\n\n const trackRefX = useRef<HTMLDivElement>( null );\n const thumbRefX = useRef<HTMLDivElement>( null );\n const scrollerContainerRefX = useRef<HTMLDivElement>( null );\n\n // State for RTL and mobile detection\n const [ isRtl, setIsRtl ] = useState<boolean>( false );\n const { width } = useWindowSize();\n const isMobile = width <= mobileBreakPoint;\n const scrollThumbTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>( null );\n\n // Handle the scrolling event\n const handleScrollContent = useCallback(() => {\n const contentElement = contentRef.current;\n const thumbY = thumbRefY.current;\n const thumbX = thumbRefX.current;\n\n const trackY = trackRefY.current;\n const trackX = trackRefX.current;\n\n if ( !thumbY || !contentElement || !thumbX || !trackY || !trackX ) {\n return;\n }\n\n // Calculate the scroll percentage\n const scrollPercentageY = ( contentElement.scrollTop * 100 ) / contentElement.scrollHeight;\n const scrollPercentageX = ( contentElement.scrollLeft * 100 ) / contentElement.scrollWidth;\n\n // Set the Y scrollbar thumb position\n thumbY.style.top = `${scrollPercentageY}%`;\n\n // if in case of rtl, behaviour of scrolling on X-Axis would be inversed\n if ( isRtl ) {\n const maxScrollX = contentElement.scrollWidth - contentElement.clientWidth;\n const thumbPositionX = ( maxScrollX * 100 ) / contentElement.scrollWidth;\n thumbX.style.left = `${thumbPositionX + scrollPercentageX}%`;\n } else {\n thumbX.style.left = `${scrollPercentageX}%`;\n }\n\n if ( isMobile ) {\n // For mobile browsers, show the scroll thumb immediately\n thumbY.style.opacity = "1";\n thumbX.style.opacity = "1";\n trackY.style.opacity = "1";\n trackX.style.opacity = "1";\n\n // Clear any existing timeout\n if ( scrollThumbTimeoutRef.current ) {\n clearTimeout( scrollThumbTimeoutRef.current );\n }\n\n // Set a new timeout to hide the scroll thumb after 1 second of inactivity\n scrollThumbTimeoutRef.current = setTimeout(() => {\n thumbY.style.opacity = "0";\n thumbX.style.opacity = "0";\n trackY.style.opacity = "0";\n trackX.style.opacity = "0";\n }, 1000 );\n }\n }, [ isMobile, isRtl ]);\n\n /**\n * Handle the scrollbar track click\n * When the scrollbar track is clicked, it captures the click\'s position and scrolls toward it.\n */\n const handleClickTrack = useCallback(\n ( event: React.MouseEvent<HTMLDivElement>, scrollDirection: "X" | "Y" ) => {\n const contentElement = contentRef.current;\n const trackY = trackRefY.current;\n const thumbY = thumbRefY.current;\n const trackX = trackRefX.current;\n const thumbX = thumbRefX.current;\n\n if ( !trackY || !thumbY || !contentElement || !trackX || !thumbX ) {\n return;\n }\n\n if ( scrollToClickPosition ) {\n if ( scrollDirection === "Y" ) {\n const boundY = trackY.getBoundingClientRect();\n const percentageY = ( event.clientY - boundY.top ) / boundY.height;\n const scrollHeight = contentElement.scrollHeight - contentElement.clientHeight;\n const scrollToOffsetY = percentageY * scrollHeight;\n\n handleScrollToHelper( contentElement, scrollToOffsetY, "top" );\n } else if ( scrollDirection === "X" ) {\n const boundX = trackX.getBoundingClientRect();\n let percentageX = ( event.clientX - boundX.left ) / boundX.width;\n\n if ( isRtl ) {\n percentageX = ( event.clientX - boundX.right ) / boundX.width;\n }\n\n const scrollWidth = contentElement.scrollWidth - contentElement.clientWidth;\n const scrollToOffsetX = percentageX * scrollWidth;\n\n handleScrollToHelper( contentElement, scrollToOffsetX, "left" );\n }\n } else {\n if ( scrollDirection === "Y" ) {\n const boundY = trackY.getBoundingClientRect();\n const thumbBoundY = thumbY.getBoundingClientRect();\n const clickPositionY = event.clientY - boundY.top;\n const thumbMidY = thumbBoundY.top + ( thumbBoundY.bottom - thumbBoundY.top ) / 2;\n const scrollAmount = contentElement.clientHeight * 0.5;\n const scrollDirectionUnits = clickPositionY > thumbMidY ? scrollAmount : -scrollAmount;\n\n handleScrollToHelper( contentElement, contentElement.scrollTop + scrollDirectionUnits, "top" );\n } else if ( scrollDirection === "X" ) {\n const boundX = trackX.getBoundingClientRect();\n const thumbBoundX = thumbX.getBoundingClientRect();\n const clickPositionX = event.clientX - boundX.left;\n const thumbMidX = thumbBoundX.left + ( thumbBoundX.right - thumbBoundX.left ) / 2;\n const scrollAmount = contentElement.clientWidth * 0.5;\n const scrollDirectionUnits = clickPositionX > thumbMidX ? scrollAmount : -scrollAmount;\n\n handleScrollToHelper( contentElement, contentElement.scrollLeft + scrollDirectionUnits, "left" );\n }\n }\n },\n [ isRtl, scrollToClickPosition ]\n );\n\n /**\n * Handles the mouse down event on the scrollbar thumb to enable scrolling by dragging the thumb.\n */\n const handleMouseDown = useCallback(\n ( parentEvent: React.MouseEvent<HTMLDivElement>, scrollDirection: "X" | "Y" ) => {\n const contentElement = contentRef.current;\n const thumbY = thumbRefY.current;\n const thumbX = thumbRefX.current;\n\n if ( !thumbY || !contentElement || !thumbX ) {\n return;\n }\n\n const startPos = {\n top: contentElement.scrollTop,\n left: contentElement.scrollLeft,\n x: parentEvent.clientX,\n y: parentEvent.clientY\n };\n\n const handleMouseMove = ( childEvent: MouseEvent ) => {\n const scrollRatioY = contentElement.clientHeight / contentElement.scrollHeight;\n const scrollRatioX = contentElement.clientWidth / contentElement.scrollWidth;\n\n if ( scrollDirection === "Y" ) {\n const differenceY = childEvent.clientY - startPos.y;\n contentElement.scrollTop = startPos.top + differenceY / scrollRatioY;\n } else if ( scrollDirection === "X" ) {\n let differenceX = childEvent.clientX - startPos.x;\n if ( isRtl ) {\n differenceX = startPos.x - childEvent.clientX;\n }\n\n if ( isRtl ) {\n contentElement.scrollLeft = startPos.left - differenceX / scrollRatioX;\n } else {\n contentElement.scrollLeft = startPos.left + differenceX / scrollRatioX;\n }\n }\n updateCursor();\n };\n\n const preventSelection = ( event: Event ) => {\n event.preventDefault(); // Prevent text selection\n };\n\n // Helper function to remove and reset the events and cursor style\n const handleMouseUp = () => {\n document.body.removeEventListener( "mousemove", handleMouseMove );\n document.body.removeEventListener( "mouseup", handleMouseUp );\n document.body.removeEventListener( "selectstart", preventSelection );\n resetCursor();\n };\n\n // Attach the events to the body on mouseMove event and when mouse is released remove\n document.body.addEventListener( "mousemove", handleMouseMove );\n document.body.addEventListener( "mouseup", handleMouseUp );\n document.body.addEventListener( "selectstart", preventSelection );\n },\n [isRtl]\n );\n\n /**\n * To handle the thumb drag for screen touch devices\n */\n const handleTouchStart = useCallback(\n ( parentEvent: React.TouchEvent<HTMLDivElement>, scrollDirection: "X" | "Y" ) => {\n const contentElement = contentRef.current;\n const thumbY = thumbRefY.current;\n const thumbX = thumbRefX.current;\n\n if ( !thumbY || !contentElement || !thumbX ) {\n return;\n }\n\n const parentTouchArray = Array.from( parentEvent.targetTouches );\n const [parentTouch] = parentTouchArray;\n\n const startPos = {\n top: contentElement.scrollTop,\n left: contentElement.scrollLeft,\n x: parentTouch.clientX,\n y: parentTouch.clientY\n };\n\n const handleTouchMove = ( childEvent: TouchEvent ) => {\n const childTouchArray = Array.from( childEvent.targetTouches );\n const [childTouch] = childTouchArray;\n\n const scrollRatioY = contentElement.clientHeight / contentElement.scrollHeight;\n const scrollRatioX = contentElement.clientWidth / contentElement.scrollWidth;\n\n if ( scrollDirection === "Y" ) {\n const differenceY = childTouch?.clientY - startPos.y;\n contentElement.scrollTop = startPos.top + differenceY / scrollRatioY;\n } else if ( scrollDirection === "X" ) {\n let differenceX = childTouch?.clientX - startPos.x;\n if ( isRtl ) {\n differenceX = startPos.x - childTouch?.clientX;\n }\n\n // The scroll behaviour is reversed if the rtl value is true/enabled\n if ( isRtl ) {\n contentElement.scrollLeft = startPos.left - differenceX / scrollRatioX;\n } else {\n contentElement.scrollLeft = startPos.left + differenceX / scrollRatioX;\n }\n }\n\n updateCursor();\n };\n\n // Helper function to remove and reset the events and cursor style\n const handleTouchEnd = () => {\n if ( scrollDirection === "Y" ) {\n thumbY.removeEventListener( "touchmove", handleTouchMove );\n thumbY.removeEventListener( "touchend", handleTouchEnd );\n } else {\n thumbX.removeEventListener( "touchmove", handleTouchMove );\n thumbX.removeEventListener( "touchend", handleTouchEnd );\n }\n resetCursor();\n };\n\n // Attach the events to the Thumb Element on touchMove event and when touch is released remove\n if ( scrollDirection === "Y" ) {\n thumbY.addEventListener( "touchmove", handleTouchMove );\n thumbY.addEventListener( "touchend", handleTouchEnd );\n } else {\n thumbX.addEventListener( "touchmove", handleTouchMove );\n thumbX.addEventListener( "touchend", handleTouchEnd );\n }\n },\n [isRtl]\n );\n\n /**\n * Calculates the dimensions of the scrollbar thumb elements based on the content size and visibility.\n */\n const calculateThumbDimensions = useCallback(() => {\n const contentElement = contentRef.current;\n const thumbY = thumbRefY.current;\n const scrollbarContainerY = scrollerContainerRefY.current;\n const thumbX = thumbRefX.current;\n const scrollbarContainerX = scrollerContainerRefX.current;\n\n if ( !thumbY || !contentElement || !thumbX ) {\n return;\n }\n\n const scrollRatioY = contentElement.clientHeight / contentElement.scrollHeight;\n if ( scrollRatioY >= 1 ) {\n scrollbarContainerY?.classList.add( "invisible" );\n } else {\n scrollbarContainerY?.classList.remove( "invisible" );\n thumbY.style.height = `${scrollRatioY * 100}%`;\n }\n\n const scrollRatioX = contentElement.clientWidth / contentElement.scrollWidth;\n if ( scrollRatioX >= 1 ) {\n scrollbarContainerX?.classList.add( "invisible" );\n } else {\n scrollbarContainerX?.classList.remove( "invisible" );\n thumbX.style.width = `${scrollRatioX * 100}%`;\n }\n }, []);\n\n // Check for RTL direction\n useEffect(() => {\n const scrollbarContainerElement = scrollbarContainerRef.current;\n if ( scrollbarContainerElement ) {\n const dir = findParentAttribute( scrollbarContainerElement, "dir" );\n setIsRtl( dir === "rtl" );\n }\n }, [scrollbarContainerRef]);\n\n // Calculate initial dimensions and handle RTL positioning\n useEffect(() => {\n calculateThumbDimensions();\n\n const contentElement = contentRef.current;\n const thumbX = thumbRefX.current;\n\n if ( !contentElement || !thumbX ) {\n return;\n }\n\n if ( isRtl ) {\n const maxScrollX = contentElement.scrollWidth - contentElement.clientWidth;\n const thumbPositionX = ( maxScrollX * 100 ) / contentElement.scrollWidth;\n thumbX.style.left = `${thumbPositionX}%`;\n }\n }, [ calculateThumbDimensions, isRtl ]);\n\n // Set up observers and keyboard event handling\n useEffect(() => {\n const mutationObserver = new MutationObserver( calculateThumbDimensions );\n const resizeObserver = new ResizeObserver( calculateThumbDimensions );\n\n if ( contentRef.current ) {\n mutationObserver.observe( contentRef.current, { childList: true, subtree: true });\n resizeObserver.observe( contentRef.current );\n }\n\n const scrollbarContainerElement = scrollbarContainerRef.current;\n\n const handleKeyDown = ( event: KeyboardEvent ) => {\n const { key } = event;\n const contentElement = contentRef.current;\n\n if ( !contentElement ) {\n return;\n }\n\n const scrollStep = 50;\n\n switch ( key ) {\n case keyboardKeys.arrowUp: {\n handleScrollToHelper( contentElement, contentElement.scrollTop - scrollStep, "top" );\n break;\n }\n case keyboardKeys.arrowDown: {\n handleScrollToHelper( contentElement, contentElement.scrollTop + scrollStep, "top" );\n break;\n }\n case keyboardKeys.arrowLeft: {\n handleScrollToHelper( contentElement, contentElement.scrollLeft - scrollStep, "left" );\n break;\n }\n case keyboardKeys.arrowRight: {\n handleScrollToHelper( contentElement, contentElement.scrollLeft + scrollStep, "left" );\n break;\n }\n case keyboardKeys.pageUp: {\n handleScrollToHelper( contentElement, contentElement.scrollTop - contentElement.clientHeight, "top" );\n break;\n }\n case keyboardKeys.pageDown: {\n handleScrollToHelper( contentElement, contentElement.scrollTop + contentElement.clientHeight, "top" );\n break;\n }\n case keyboardKeys.home: {\n handleScrollToHelper( contentElement, 0, "top" );\n break;\n }\n case keyboardKeys.end: {\n handleScrollToHelper( contentElement, contentElement.scrollHeight, "top" );\n break;\n }\n default:\n break;\n }\n };\n\n if ( scrollbarContainerElement ) {\n scrollbarContainerElement.addEventListener( "keydown", handleKeyDown );\n }\n\n return () => {\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n\n if ( scrollbarContainerElement ) {\n scrollbarContainerElement.removeEventListener( "keydown", handleKeyDown );\n }\n };\n }, [calculateThumbDimensions]);\n\n const visibility = alwaysVisible ? "alwaysVisible" : "default";\n const {\n root,\n content,\n yContainer,\n trackY,\n thumbY,\n xContainer,\n trackX,\n thumbX\n } = scrollbarVariants({ visibility });\n\n return (\n <Tag\n id={id}\n data-testid="scrollbar"\n className={root()}\n ref={mergeRefs([ ref, scrollbarContainerRef ])}\n {...rest}\n >\n <div\n className={content({ class: className })}\n ref={contentRef}\n onScroll={handleScrollContent}\n >\n {children}\n </div>\n\n {/* y-axis scrollbar */}\n <div\n ref={scrollerContainerRefY}\n data-testid="scrollbar-y"\n className={yContainer()}\n >\n <div\n data-testid="scrollbar-track-y"\n className={trackY()}\n ref={trackRefY}\n onMouseDown={( event ) => handleClickTrack( event, "Y" )}\n />\n <div\n data-testid="scrollbar-thumb-y"\n className={thumbY()}\n ref={thumbRefY}\n onMouseDown={( event ) => handleMouseDown( event, "Y" )}\n onTouchStart={( event ) => handleTouchStart( event, "Y" )}\n />\n </div>\n\n {/* x-axis scrollbar */}\n <div\n data-testid="scrollbar-x"\n ref={scrollerContainerRefX}\n className={xContainer()}\n >\n <div\n className={trackX()}\n ref={trackRefX}\n onMouseDown={( event ) => handleClickTrack( event, "X" )}\n />\n <div\n data-testid="scrollbar-thumb-x"\n className={thumbX()}\n ref={thumbRefX}\n onMouseDown={( event ) => handleMouseDown( event, "X" )}\n onTouchStart={( event ) => handleTouchStart( event, "X" )}\n />\n </div>\n </Tag>\n );\n }\n);\n\nScrollbar.displayName = "Scrollbar";'
3272
+ "content": 'import * as React from "react";\nimport { useRef, useEffect, useCallback, type ElementType, useState, forwardRef } from "react";\nimport { findParentAttribute } from "@utils";\nimport { useWindowSize } from "@hooks";\nimport mergeRefs from "react-merge-refs";\nimport { keyboardKeys, mobileBreakPoint } from "@constants";\nimport { updateCursor, resetCursor, handleScrollToHelper } from "./utils";\nimport { scrollbarVariants } from "./scrollbarVariants";\n\n// Avoid void elements that can\'t have children\ntype TVoidElements = "area" | "base" | "br" | "col" | "embed" | "hr" | "img" | "input" | "link" |\n "meta" | "param" | "source" | "track" | "wbr" | "audio" | "video" | "canvas" | "iframe" |\n "embed" | "object" | "param" | "picture" | "portal" | "svg" | "math" | "svg";\n\n/**\n * Props for the Scrollbar component\n */\nexport interface IScrollbarProps extends Omit<React.HTMLAttributes<HTMLElement>, "as"> {\n /**\n * children to render inside the scroll container\n */\n children: React.ReactNode;\n\n /**\n * The type of tag to render for the scroll container, the default value is "div".\n * @default div\n */\n as?: keyof Omit<JSX.IntrinsicElements, TVoidElements>;\n\n /**\n * Overwrite the children container styles by passing space separated class names.\n * @optional\n */\n className?: string;\n\n /**\n * Pass a boolean value to set the visibility of the scroller, by default the scrollbar will be visible on content hover.\n * @optional\n * @default false\n */\n alwaysVisible?: boolean;\n\n /**\n * Set it to true if you want to directly scroll to the click position,\n * by default the scroller will move in the direction of the click\n * @default false\n */\n scrollToClickPosition?: boolean;\n\n /**\n * Optional ID for the scrollbar container\n */\n id?: string;\n\n /**\n * Optional accessible name for the scroll area. When the content overflows the\n * container becomes keyboard-scrollable; providing this label also promotes it\n * to a discoverable `region` landmark. Leave it unset for incidental scroll\n * areas so they don\'t clutter landmark navigation.\n */\n "aria-label"?: string;\n}\n\n/**\n * Scrollbar component provides a custom scrollbar with support for both vertical and horizontal scrolling.\n * It includes features like custom styling, touch support, RTL support, and keyboard navigation.\n */\nexport const Scrollbar = forwardRef<HTMLElement, IScrollbarProps>(\n ({\n children,\n as = "div",\n className,\n alwaysVisible = false,\n scrollToClickPosition = false,\n id,\n "aria-label": ariaLabel,\n ...rest\n }, ref ) => {\n // Set up the element tag\n const Tag = as as ElementType;\n\n // Refs for DOM elements\n const scrollbarContainerRef = useRef<HTMLDivElement>( null );\n const contentRef = useRef<HTMLDivElement>( null );\n\n const trackRefY = useRef<HTMLDivElement>( null );\n const thumbRefY = useRef<HTMLDivElement>( null );\n const scrollerContainerRefY = useRef<HTMLDivElement>( null );\n\n const trackRefX = useRef<HTMLDivElement>( null );\n const thumbRefX = useRef<HTMLDivElement>( null );\n const scrollerContainerRefX = useRef<HTMLDivElement>( null );\n\n // State for RTL and mobile detection\n const [ isRtl, setIsRtl ] = useState<boolean>( false );\n // Whether the content actually overflows; drives keyboard focusability of the region\n const [ isScrollable, setIsScrollable ] = useState<boolean>( false );\n const { width } = useWindowSize();\n const isMobile = width <= mobileBreakPoint;\n const scrollThumbTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>( null );\n\n // Handle the scrolling event\n const handleScrollContent = useCallback(() => {\n const contentElement = contentRef.current;\n const thumbY = thumbRefY.current;\n const thumbX = thumbRefX.current;\n\n const trackY = trackRefY.current;\n const trackX = trackRefX.current;\n\n if ( !thumbY || !contentElement || !thumbX || !trackY || !trackX ) {\n return;\n }\n\n // Calculate the scroll percentage\n const scrollPercentageY = ( contentElement.scrollTop * 100 ) / contentElement.scrollHeight;\n const scrollPercentageX = ( contentElement.scrollLeft * 100 ) / contentElement.scrollWidth;\n\n // Set the Y scrollbar thumb position\n thumbY.style.top = `${scrollPercentageY}%`;\n\n // if in case of rtl, behaviour of scrolling on X-Axis would be inversed\n if ( isRtl ) {\n const maxScrollX = contentElement.scrollWidth - contentElement.clientWidth;\n const thumbPositionX = ( maxScrollX * 100 ) / contentElement.scrollWidth;\n thumbX.style.left = `${thumbPositionX + scrollPercentageX}%`;\n } else {\n thumbX.style.left = `${scrollPercentageX}%`;\n }\n\n if ( isMobile ) {\n // For mobile browsers, show the scroll thumb immediately\n thumbY.style.opacity = "1";\n thumbX.style.opacity = "1";\n trackY.style.opacity = "1";\n trackX.style.opacity = "1";\n\n // Clear any existing timeout\n if ( scrollThumbTimeoutRef.current ) {\n clearTimeout( scrollThumbTimeoutRef.current );\n }\n\n // Set a new timeout to hide the scroll thumb after 1 second of inactivity\n scrollThumbTimeoutRef.current = setTimeout(() => {\n thumbY.style.opacity = "0";\n thumbX.style.opacity = "0";\n trackY.style.opacity = "0";\n trackX.style.opacity = "0";\n }, 1000 );\n }\n }, [ isMobile, isRtl ]);\n\n /**\n * Handle the scrollbar track click\n * When the scrollbar track is clicked, it captures the click\'s position and scrolls toward it.\n */\n const handleClickTrack = useCallback(\n ( event: React.MouseEvent<HTMLDivElement>, scrollDirection: "X" | "Y" ) => {\n const contentElement = contentRef.current;\n const trackY = trackRefY.current;\n const thumbY = thumbRefY.current;\n const trackX = trackRefX.current;\n const thumbX = thumbRefX.current;\n\n if ( !trackY || !thumbY || !contentElement || !trackX || !thumbX ) {\n return;\n }\n\n if ( scrollToClickPosition ) {\n if ( scrollDirection === "Y" ) {\n const boundY = trackY.getBoundingClientRect();\n const percentageY = ( event.clientY - boundY.top ) / boundY.height;\n const scrollHeight = contentElement.scrollHeight - contentElement.clientHeight;\n const scrollToOffsetY = percentageY * scrollHeight;\n\n handleScrollToHelper( contentElement, scrollToOffsetY, "top" );\n } else if ( scrollDirection === "X" ) {\n const boundX = trackX.getBoundingClientRect();\n let percentageX = ( event.clientX - boundX.left ) / boundX.width;\n\n if ( isRtl ) {\n percentageX = ( event.clientX - boundX.right ) / boundX.width;\n }\n\n const scrollWidth = contentElement.scrollWidth - contentElement.clientWidth;\n const scrollToOffsetX = percentageX * scrollWidth;\n\n handleScrollToHelper( contentElement, scrollToOffsetX, "left" );\n }\n } else {\n if ( scrollDirection === "Y" ) {\n const boundY = trackY.getBoundingClientRect();\n const thumbBoundY = thumbY.getBoundingClientRect();\n const clickPositionY = event.clientY - boundY.top;\n const thumbMidY = thumbBoundY.top + ( thumbBoundY.bottom - thumbBoundY.top ) / 2;\n const scrollAmount = contentElement.clientHeight * 0.5;\n const scrollDirectionUnits = clickPositionY > thumbMidY ? scrollAmount : -scrollAmount;\n\n handleScrollToHelper( contentElement, contentElement.scrollTop + scrollDirectionUnits, "top" );\n } else if ( scrollDirection === "X" ) {\n const boundX = trackX.getBoundingClientRect();\n const thumbBoundX = thumbX.getBoundingClientRect();\n const clickPositionX = event.clientX - boundX.left;\n const thumbMidX = thumbBoundX.left + ( thumbBoundX.right - thumbBoundX.left ) / 2;\n const scrollAmount = contentElement.clientWidth * 0.5;\n const scrollDirectionUnits = clickPositionX > thumbMidX ? scrollAmount : -scrollAmount;\n\n handleScrollToHelper( contentElement, contentElement.scrollLeft + scrollDirectionUnits, "left" );\n }\n }\n },\n [ isRtl, scrollToClickPosition ]\n );\n\n /**\n * Handles the mouse down event on the scrollbar thumb to enable scrolling by dragging the thumb.\n */\n const handleMouseDown = useCallback(\n ( parentEvent: React.MouseEvent<HTMLDivElement>, scrollDirection: "X" | "Y" ) => {\n const contentElement = contentRef.current;\n const thumbY = thumbRefY.current;\n const thumbX = thumbRefX.current;\n\n if ( !thumbY || !contentElement || !thumbX ) {\n return;\n }\n\n const startPos = {\n top: contentElement.scrollTop,\n left: contentElement.scrollLeft,\n x: parentEvent.clientX,\n y: parentEvent.clientY\n };\n\n const handleMouseMove = ( childEvent: MouseEvent ) => {\n const scrollRatioY = contentElement.clientHeight / contentElement.scrollHeight;\n const scrollRatioX = contentElement.clientWidth / contentElement.scrollWidth;\n\n if ( scrollDirection === "Y" ) {\n const differenceY = childEvent.clientY - startPos.y;\n contentElement.scrollTop = startPos.top + differenceY / scrollRatioY;\n } else if ( scrollDirection === "X" ) {\n let differenceX = childEvent.clientX - startPos.x;\n if ( isRtl ) {\n differenceX = startPos.x - childEvent.clientX;\n }\n\n if ( isRtl ) {\n contentElement.scrollLeft = startPos.left - differenceX / scrollRatioX;\n } else {\n contentElement.scrollLeft = startPos.left + differenceX / scrollRatioX;\n }\n }\n updateCursor();\n };\n\n const preventSelection = ( event: Event ) => {\n event.preventDefault(); // Prevent text selection\n };\n\n // Helper function to remove and reset the events and cursor style\n const handleMouseUp = () => {\n document.body.removeEventListener( "mousemove", handleMouseMove );\n document.body.removeEventListener( "mouseup", handleMouseUp );\n document.body.removeEventListener( "selectstart", preventSelection );\n resetCursor();\n };\n\n // Attach the events to the body on mouseMove event and when mouse is released remove\n document.body.addEventListener( "mousemove", handleMouseMove );\n document.body.addEventListener( "mouseup", handleMouseUp );\n document.body.addEventListener( "selectstart", preventSelection );\n },\n [isRtl]\n );\n\n /**\n * To handle the thumb drag for screen touch devices\n */\n const handleTouchStart = useCallback(\n ( parentEvent: React.TouchEvent<HTMLDivElement>, scrollDirection: "X" | "Y" ) => {\n const contentElement = contentRef.current;\n const thumbY = thumbRefY.current;\n const thumbX = thumbRefX.current;\n\n if ( !thumbY || !contentElement || !thumbX ) {\n return;\n }\n\n const parentTouchArray = Array.from( parentEvent.targetTouches );\n const [parentTouch] = parentTouchArray;\n\n const startPos = {\n top: contentElement.scrollTop,\n left: contentElement.scrollLeft,\n x: parentTouch.clientX,\n y: parentTouch.clientY\n };\n\n const handleTouchMove = ( childEvent: TouchEvent ) => {\n const childTouchArray = Array.from( childEvent.targetTouches );\n const [childTouch] = childTouchArray;\n\n const scrollRatioY = contentElement.clientHeight / contentElement.scrollHeight;\n const scrollRatioX = contentElement.clientWidth / contentElement.scrollWidth;\n\n if ( scrollDirection === "Y" ) {\n const differenceY = childTouch?.clientY - startPos.y;\n contentElement.scrollTop = startPos.top + differenceY / scrollRatioY;\n } else if ( scrollDirection === "X" ) {\n let differenceX = childTouch?.clientX - startPos.x;\n if ( isRtl ) {\n differenceX = startPos.x - childTouch?.clientX;\n }\n\n // The scroll behaviour is reversed if the rtl value is true/enabled\n if ( isRtl ) {\n contentElement.scrollLeft = startPos.left - differenceX / scrollRatioX;\n } else {\n contentElement.scrollLeft = startPos.left + differenceX / scrollRatioX;\n }\n }\n\n updateCursor();\n };\n\n // Helper function to remove and reset the events and cursor style\n const handleTouchEnd = () => {\n if ( scrollDirection === "Y" ) {\n thumbY.removeEventListener( "touchmove", handleTouchMove );\n thumbY.removeEventListener( "touchend", handleTouchEnd );\n } else {\n thumbX.removeEventListener( "touchmove", handleTouchMove );\n thumbX.removeEventListener( "touchend", handleTouchEnd );\n }\n resetCursor();\n };\n\n // Attach the events to the Thumb Element on touchMove event and when touch is released remove\n if ( scrollDirection === "Y" ) {\n thumbY.addEventListener( "touchmove", handleTouchMove );\n thumbY.addEventListener( "touchend", handleTouchEnd );\n } else {\n thumbX.addEventListener( "touchmove", handleTouchMove );\n thumbX.addEventListener( "touchend", handleTouchEnd );\n }\n },\n [isRtl]\n );\n\n /**\n * Calculates the dimensions of the scrollbar thumb elements based on the content size and visibility.\n */\n const calculateThumbDimensions = useCallback(() => {\n const contentElement = contentRef.current;\n const thumbY = thumbRefY.current;\n const scrollbarContainerY = scrollerContainerRefY.current;\n const thumbX = thumbRefX.current;\n const scrollbarContainerX = scrollerContainerRefX.current;\n\n if ( !thumbY || !contentElement || !thumbX ) {\n return;\n }\n\n const scrollRatioY = contentElement.clientHeight / contentElement.scrollHeight;\n if ( scrollRatioY >= 1 ) {\n scrollbarContainerY?.classList.add( "invisible" );\n } else {\n scrollbarContainerY?.classList.remove( "invisible" );\n thumbY.style.height = `${scrollRatioY * 100}%`;\n }\n\n const scrollRatioX = contentElement.clientWidth / contentElement.scrollWidth;\n if ( scrollRatioX >= 1 ) {\n scrollbarContainerX?.classList.add( "invisible" );\n } else {\n scrollbarContainerX?.classList.remove( "invisible" );\n thumbX.style.width = `${scrollRatioX * 100}%`;\n }\n\n setIsScrollable( scrollRatioY < 1 || scrollRatioX < 1 );\n }, []);\n\n // Check for RTL direction\n useEffect(() => {\n const scrollbarContainerElement = scrollbarContainerRef.current;\n if ( scrollbarContainerElement ) {\n const dir = findParentAttribute( scrollbarContainerElement, "dir" );\n setIsRtl( dir === "rtl" );\n }\n }, [scrollbarContainerRef]);\n\n // Calculate initial dimensions and handle RTL positioning\n useEffect(() => {\n calculateThumbDimensions();\n\n const contentElement = contentRef.current;\n const thumbX = thumbRefX.current;\n\n if ( !contentElement || !thumbX ) {\n return;\n }\n\n if ( isRtl ) {\n const maxScrollX = contentElement.scrollWidth - contentElement.clientWidth;\n const thumbPositionX = ( maxScrollX * 100 ) / contentElement.scrollWidth;\n thumbX.style.left = `${thumbPositionX}%`;\n }\n }, [ calculateThumbDimensions, isRtl ]);\n\n // Set up observers and keyboard event handling\n useEffect(() => {\n const mutationObserver = new MutationObserver( calculateThumbDimensions );\n const resizeObserver = new ResizeObserver( calculateThumbDimensions );\n\n if ( contentRef.current ) {\n mutationObserver.observe( contentRef.current, { childList: true, subtree: true });\n resizeObserver.observe( contentRef.current );\n }\n\n const scrollbarContainerElement = scrollbarContainerRef.current;\n\n const handleKeyDown = ( event: KeyboardEvent ) => {\n const { key } = event;\n const contentElement = contentRef.current;\n\n if ( !contentElement ) {\n return;\n }\n\n const scrollStep = 50;\n\n switch ( key ) {\n case keyboardKeys.arrowUp: {\n handleScrollToHelper( contentElement, contentElement.scrollTop - scrollStep, "top" );\n break;\n }\n case keyboardKeys.arrowDown: {\n handleScrollToHelper( contentElement, contentElement.scrollTop + scrollStep, "top" );\n break;\n }\n case keyboardKeys.arrowLeft: {\n handleScrollToHelper( contentElement, contentElement.scrollLeft - scrollStep, "left" );\n break;\n }\n case keyboardKeys.arrowRight: {\n handleScrollToHelper( contentElement, contentElement.scrollLeft + scrollStep, "left" );\n break;\n }\n case keyboardKeys.pageUp: {\n handleScrollToHelper( contentElement, contentElement.scrollTop - contentElement.clientHeight, "top" );\n break;\n }\n case keyboardKeys.pageDown: {\n handleScrollToHelper( contentElement, contentElement.scrollTop + contentElement.clientHeight, "top" );\n break;\n }\n case keyboardKeys.home: {\n handleScrollToHelper( contentElement, 0, "top" );\n break;\n }\n case keyboardKeys.end: {\n handleScrollToHelper( contentElement, contentElement.scrollHeight, "top" );\n break;\n }\n default:\n break;\n }\n };\n\n if ( scrollbarContainerElement ) {\n scrollbarContainerElement.addEventListener( "keydown", handleKeyDown );\n }\n\n return () => {\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n\n if ( scrollbarContainerElement ) {\n scrollbarContainerElement.removeEventListener( "keydown", handleKeyDown );\n }\n };\n }, [calculateThumbDimensions]);\n\n const visibility = alwaysVisible ? "alwaysVisible" : "default";\n const {\n root,\n content,\n yContainer,\n trackY,\n thumbY,\n xContainer,\n trackX,\n thumbX\n } = scrollbarVariants({ visibility });\n\n return (\n <Tag\n id={id}\n data-testid="scrollbar"\n className={root()}\n ref={mergeRefs([ ref, scrollbarContainerRef ])}\n {...rest}\n >\n <div\n className={content({ class: className })}\n ref={contentRef}\n onScroll={handleScrollContent}\n {...( isScrollable\n ? {\n tabIndex: 0,\n // Expose a discoverable `region` landmark only when the consumer\n // names it; otherwise stay keyboard-scrollable as a non-landmark\n // `group` so generic scroll areas don\'t clutter landmark navigation\n role: ariaLabel ? "region" : "group",\n "aria-label": ariaLabel || "Scrollable content"\n }\n : {})}\n >\n {children}\n </div>\n\n {/* y-axis scrollbar */}\n <div\n ref={scrollerContainerRefY}\n data-testid="scrollbar-y"\n className={yContainer()}\n >\n <div\n data-testid="scrollbar-track-y"\n className={trackY()}\n ref={trackRefY}\n onMouseDown={( event ) => handleClickTrack( event, "Y" )}\n />\n <div\n data-testid="scrollbar-thumb-y"\n className={thumbY()}\n ref={thumbRefY}\n onMouseDown={( event ) => handleMouseDown( event, "Y" )}\n onTouchStart={( event ) => handleTouchStart( event, "Y" )}\n />\n </div>\n\n {/* x-axis scrollbar */}\n <div\n data-testid="scrollbar-x"\n ref={scrollerContainerRefX}\n className={xContainer()}\n >\n <div\n className={trackX()}\n ref={trackRefX}\n onMouseDown={( event ) => handleClickTrack( event, "X" )}\n />\n <div\n data-testid="scrollbar-thumb-x"\n className={thumbX()}\n ref={thumbRefX}\n onMouseDown={( event ) => handleMouseDown( event, "X" )}\n onTouchStart={( event ) => handleTouchStart( event, "X" )}\n />\n </div>\n </Tag>\n );\n }\n);\n\nScrollbar.displayName = "Scrollbar";'
2914
3273
  },
2915
3274
  {
2916
3275
  "name": "index.ts",
@@ -2925,42 +3284,333 @@ export const scrollbarVariants = tv({
2925
3284
  },
2926
3285
  "select": {
2927
3286
  "name": "select",
2928
- "description": "The Select component provides a dropdown selection interface for choosing one option from a list. It includes search functionality, custom rendering, and keyboard navigation. **When to use:** - Form fields requiring single selection from options - Filtering interfaces - Settings and preferences selection - Any scenario requiring choice from predefined list **Component Architecture:** - Built with @floating-ui for positioning - Styled with Tailwind CSS and class-variance-authority (cva) - Supports search/filtering - Keyboard navigation support - Accessible with proper ARIA attributes",
3287
+ "description": 'The Select component provides a dropdown selection interface for choosing one option from a list. It includes search functionality, custom rendering, and keyboard navigation. **When to use:** - Form fields requiring single selection from options - Filtering interfaces - Settings and preferences selection - Any scenario requiring choice from predefined list **Component Architecture:** - Built on `react-select`, which handles positioning (`menuPlacement="auto"`) and keyboard navigation - Styled with Tailwind CSS and `tailwind-variants` (`tv()`) - Search input lives inside the dropdown; filtering is client-side by default, or delegated to the parent via `onFilterChange` (see [Filtering](#filtering)) - Accessible with proper ARIA attributes',
2929
3288
  "dependencies": [
2930
3289
  "react-select",
2931
3290
  "react",
2932
3291
  "tailwind-variants",
3292
+ "react-merge-refs",
2933
3293
  "tailwind-merge"
2934
3294
  ],
2935
3295
  "internalDependencies": [
2936
- "checkbox",
2937
3296
  "adpIcon",
2938
- "button"
3297
+ "button",
3298
+ "loader",
3299
+ "checkbox",
3300
+ "tooltip",
3301
+ "card"
2939
3302
  ],
2940
3303
  "files": [
2941
3304
  {
2942
3305
  "name": "utils.ts",
2943
- "content": 'import { type StylesConfig, type GroupBase } from "react-select";\nimport { type TSelectSize, type IOption } from "./types";\n\nexport const reactSelectCustomStyles = <\n IsMulti extends boolean,\n Group extends GroupBase<IOption>\n>(\n error: boolean,\n size: TSelectSize,\n multiSelect: boolean\n): StylesConfig<IOption, IsMulti, Group> => {\n return {\n container: ( base ) => ({\n ...base,\n display: "flex",\n flexDirection: "column",\n gap: "0.5rem"\n }),\n control: ( base, state ) => ({\n ...base,\n display: "flex",\n alignItems: "center",\n gap: "0.5rem",\n borderRadius: "0.5rem",\n padding: size === "md" ? "0.2rem 0.75rem" : "0.2rem 1rem",\n "&:hover": {\n borderColor: "inherit"\n },\n boxShadow: state.isFocused\n ? error\n ? "0px 0px 2px 2px #F1AE9D"\n : "0px 0px 2px 2px #99CBFA"\n : base.boxShadow,\n borderColor: error\n ? "rgb(var(--error-500))"\n : state.isFocused\n ? "rgb(var(--primary-500))"\n : "rgb(var(--gray-200))",\n backgroundColor: state.isDisabled\n ? "rgb(var(--gray-50))"\n : base.backgroundColor,\n "&:disabled": {\n color: "rgb(var(--secondary-200))"\n },\n // Dark mode styles\n ".dark &": {\n backgroundColor: state.isDisabled\n ? "rgb(var(--secondary-800))"\n : "rgb(var(--iridium))",\n boxShadow: state.isFocused\n ? error\n ? "0px 0px 2px 2px #F38176"\n : "0px 0px 2px 2px #99CBFA"\n : base.boxShadow,\n borderColor: error\n ? "rgb(var(--error-400))"\n : "rgb(var(--secondary-500))",\n "&:disabled": {\n color: "rgb(var(--secondary-300))"\n },\n color: "rgb(var(--secondary-400))"\n }\n }),\n menu: ( base ) => ({\n ...base,\n boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)",\n borderRadius: "0.5rem",\n overflow: "hidden",\n border: "1px solid rgb(var(--secondary-50))",\n // Dark mode styles\n ".dark &": {\n borderColor: "rgb(var(--secondary-500))"\n }\n }),\n menuList: ( base ) => ({\n ...base,\n padding: 0\n }),\n menuPortal: ( base ) => ({\n ...base,\n zIndex: 2020\n }),\n option: ( base, state ) => ({\n ...base,\n ...( multiSelect ? { display: "flex", alignItems: "center" } : {}),\n color: "rgb(var(--secondary-500))",\n fontWeight: "normal",\n padding: "0.625rem 1rem",\n transition: "200ms ease-in-out",\n position: "relative",\n backgroundColor:\n state.isSelected || state.isFocused\n ? "rgb(var(--secondary-50))"\n : base.backgroundColor,\n "&:active": {\n backgroundColor: "rgb(var(--secondary-50))"\n },\n "&:after":\n state.isSelected && !multiSelect\n ? {\n content: "\\"\\"",\n position: "absolute",\n height: "8px",\n width: "16px",\n transform: "rotate(-45deg)",\n border: "2px solid rgb(var(--secondary-500))",\n right: "1rem",\n top: "35%",\n borderTop: 0,\n borderRight: 0\n }\n : {},\n // Dark mode styles\n ".dark &": {\n color: "rgb(var(--secondary-200))",\n backgroundColor:\n state.isSelected || state.isFocused\n ? "rgb(var(--secondary-800))"\n : "rgb(var(--iridium))",\n "&:after":\n state.isSelected && !multiSelect\n ? {\n content: "\\"\\"",\n position: "absolute",\n height: "8px",\n width: "16px",\n transform: "rotate(-45deg)",\n border: "2px solid rgb(var(--gray-800))",\n right: "1rem",\n top: "35%",\n borderTop: 0,\n borderRight: 0\n }\n : {}\n }\n }),\n valueContainer: ( base ) => ({ ...base, padding: 0 }),\n multiValue: ( base, state ) => ({\n ...base,\n margin: "0 0.5rem 0 0",\n backgroundColor: state.isDisabled\n ? "rgb(var(--gray-100))"\n : "rgb(var(--gray-50))",\n color: state.isDisabled\n ? "rgb(var(--secondary-300))"\n : "rgb(var(--secondary-500))",\n ".dark &": {\n backgroundColor: "rgb(var(--secondary-600))",\n color: state.isDisabled\n ? "rgb(var(--secondary-400))"\n : "rgb(var(--secondary-200))"\n }\n }),\n multiValueLabel: ( base, state ) => ({\n ...base,\n padding: "0.25rem",\n fontSize: size === "md" ? "0.875rem" : "1rem",\n color: state.isDisabled\n ? "rgb(var(--secondary-300))"\n : "rgb(var(--secondary-500))",\n ".dark &": {\n color: state.isDisabled\n ? "rgb(var(--secondary-400))"\n : "rgb(var(--secondary-200))"\n }\n }),\n multiValueRemove: ( base, state ) => ({\n ...base,\n padding: "0.25rem",\n paddingLeft: 0,\n display: state.data.isFixed ? "none" : "flex",\n alignItems: "center",\n justifyContent: "center",\n marginStart: "-0.5rem",\n "&:hover": {\n backgroundColor: "transparent",\n color: "inherit"\n }\n }),\n input: ( base ) => ({\n ...base,\n margin: 0,\n padding: 0,\n fontSize: size === "md" ? "0.875rem" : "1rem",\n color: "rgb(var(--secondary-500))",\n ".dark &": { color: "rgb(var(--secondary-200))" }\n }),\n singleValue: ( base, state ) => ({\n ...base,\n margin: 0,\n fontSize: size === "md" ? "0.875rem" : "1rem",\n color: state.isDisabled\n ? "rgb(var(--secondary-300))"\n : "rgb(var(--secondary-500))",\n ".dark &": {\n color: state.isDisabled\n ? "rgb(var(--secondary-400))"\n : "rgb(var(--secondary-200))"\n }\n }),\n placeholder: ( base ) => ({\n ...base,\n fontSize: size === "md" ? "0.875rem" : "1rem",\n color: "rgb(var(--secondary-200))",\n ".dark &": { color: "rgb(var(--secondary-400))" }\n })\n };\n};'
3306
+ "content": 'import { type StylesConfig, type GroupBase } from "react-select";\nimport { type TSelectSize, type IOption } from "./types";\n\n// Synthetic Select-All row value, injected in select.tsx. Never query-matched \u2014 it is an affordance\n// over the result set, not a member of it.\nexport const SELECT_ALL_VALUE = "select-all";\n\nconst isSelectable = ( option: IOption ): boolean =>\n option.value !== SELECT_ALL_VALUE && !option.isDisabled;\n\n// An entry is a group only when its `options` field is actually a list. Options are stored exactly as\n// returned by the consumer, so one may legitimately carry an unrelated `options` data field; keying the\n// branch on the key alone would send it down the group path and throw on `.filter`.\nconst isGroup = ( entry: IOption | GroupBase<IOption> ): entry is GroupBase<IOption> =>\n "options" in entry && Array.isArray(( entry as GroupBase<IOption> ).options );\n\n// The real, enabled options, with groups flattened so the Select-All affordance reaches their\n// children \u2014 a group has no `value` of its own, so a list of nothing but groups would otherwise\n// resolve to nothing selectable. Sync mode may mix loose options and groups freely; both shapes go\n// through one pass and the result stays in render order. Narrowing the result by the active query\n// gives what "all" refers to: the enabled options currently on screen.\nexport const getSelectableOptions = (\n options: readonly ( IOption | GroupBase<IOption> )[]\n): IOption[] => {\n const selectable: IOption[] = [];\n options.forEach(( entry ) => {\n if ( isGroup( entry )) {\n selectable.push( ...entry.options.filter( isSelectable ));\n } else if ( isSelectable( entry )) {\n selectable.push( entry );\n }\n });\n return selectable;\n};\n\n// True when every selectable option is already in the draft. An empty selectable set is never\n// "all selected". Shared by the Select-All toggle and the row\'s checked state (both resolved in\n// select.tsx) so the two agree on one definition. Takes an already-narrowed option list rather than\n// the raw one, and the draft as a value Set, which is what keeps the check off a linear scan.\nexport const areAllSelectableSelected = (\n selectable: readonly IOption[],\n draftValues: ReadonlySet<IOption["value"]>\n): boolean => selectable.length > 0 && selectable.every(( o ) => draftValues.has( o.value ));\n\nexport const reactSelectCustomStyles = <\n IsMulti extends boolean,\n Group extends GroupBase<IOption>\n>(\n error: boolean,\n size: TSelectSize,\n multiSelect: boolean\n): StylesConfig<IOption, IsMulti, Group> => {\n return {\n container: ( base ) => ({\n ...base,\n display: "flex",\n flexDirection: "column",\n gap: "0.5rem"\n }),\n control: ( base, state ) => ({\n ...base,\n display: "flex",\n alignItems: "center",\n gap: "0.5rem",\n borderRadius: "0.5rem",\n padding: size === "md" ? "0.2rem 0.75rem" : "0.2rem 1rem",\n "&:hover": {\n borderColor: "inherit"\n },\n boxShadow: state.isFocused\n ? error\n ? "0px 0px 2px 2px #F1AE9D"\n : "0px 0px 2px 2px #99CBFA"\n : base.boxShadow,\n borderColor: error\n ? "rgb(var(--error-700))"\n : state.isFocused\n ? "rgb(var(--primary-500))"\n : "rgb(var(--gray-200))",\n backgroundColor: state.isDisabled\n ? "rgb(var(--gray-50))"\n : base.backgroundColor,\n "&:disabled": {\n color: "rgb(var(--secondary-200))"\n },\n // Dark mode styles\n ".dark &": {\n backgroundColor: state.isDisabled\n ? "rgb(var(--secondary-800))"\n : "rgb(var(--iridium))",\n boxShadow: state.isFocused\n ? error\n ? "0px 0px 2px 2px #F38176"\n : "0px 0px 2px 2px #99CBFA"\n : base.boxShadow,\n borderColor: error\n ? "rgb(var(--error-400))"\n : "rgb(var(--secondary-500))",\n "&:disabled": {\n color: "rgb(var(--secondary-300))"\n },\n color: "rgb(var(--secondary-400))"\n }\n }),\n menu: ( base ) => ({\n ...base,\n boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)",\n borderRadius: "0.5rem",\n overflow: "hidden",\n border: "1px solid rgb(var(--secondary-50))",\n // Dark mode styles\n ".dark &": {\n backgroundColor: "rgb(var(--iridium))",\n borderColor: "rgb(var(--secondary-500))"\n }\n }),\n menuList: ( base ) => ({\n ...base,\n padding: 0\n }),\n // Loose options and groups may be mixed in one list, and react-select renders a loose option as a\n // SIBLING of the group before it with nothing marking where the group ended \u2014 so it reads as one of\n // that group\'s members. The rule closes each group off. Scoped to groups that are followed by\n // something, so a trailing group never draws a line against the menu\'s own edge.\n group: ( base ) => ({\n ...base,\n "&:not(:last-child)": {\n borderBottom: "1px solid rgb(var(--gray-200))",\n marginBottom: "0.5rem",\n ".dark &": { borderBottomColor: "rgb(var(--secondary-500))" }\n }\n }),\n // react-select\'s default heading is a hardcoded grey that ignores dark mode, and its 12px inset\n // leaves the label out of line with the option rows it heads.\n groupHeading: ( base ) => ({\n ...base,\n padding: "0 1rem",\n fontWeight: 600,\n color: "rgb(var(--secondary-400))",\n ".dark &": { color: "rgb(var(--secondary-300))" }\n }),\n menuPortal: ( base ) => ({\n ...base,\n zIndex: 2020\n }),\n option: ( base, state ) => ({\n ...base,\n ...( multiSelect ? { display: "flex", alignItems: "center" } : {}),\n color: "rgb(var(--secondary-500))",\n fontWeight: "normal",\n padding: "0.625rem 1rem",\n transition: "200ms ease-in-out",\n position: "relative",\n backgroundColor: "transparent",\n "&:after":\n state.isSelected && !multiSelect\n ? {\n content: "\\"\\"",\n position: "absolute",\n height: "8px",\n width: "16px",\n transform: "rotate(-45deg)",\n border: "2px solid rgb(var(--secondary-500))",\n right: "0.4rem",\n top: "35%",\n borderTop: 0,\n borderRight: 0\n }\n : {},\n // Dark mode styles\n ".dark &": {\n color: "rgb(var(--secondary-200))",\n "&:after":\n state.isSelected && !multiSelect\n ? {\n content: "\\"\\"",\n position: "absolute",\n height: "8px",\n width: "16px",\n transform: "rotate(-45deg)",\n border: "2px solid rgb(var(--gray-800))",\n right: "0.4rem",\n top: "35%",\n borderTop: 0,\n borderRight: 0\n }\n : {}\n }\n }),\n indicatorsContainer: ( base ) => ({ ...base, display: "flex", alignItems: "center", gap: "8px" }),\n valueContainer: ( base ) => ({ ...base, padding: 0, ...multiSelect ? { gap: "0.25rem" } : {} }),\n clearIndicator: ( base ) => ({ ...base, padding: 0 }),\n multiValue: ( base, state ) => ({\n ...base,\n margin: "0 0.5rem 0 0",\n borderRadius: "0.25rem",\n // Cap each chip and let its label truncate (react-select\'s multiValueLabel already sets\n // overflow:hidden + text-overflow:ellipsis) so one long value can\'t stretch the control.\n maxWidth: size === "md" ? "12rem" : "14rem",\n minWidth: 0,\n backgroundColor: state.isDisabled\n ? "rgb(var(--gray-100))"\n : "rgb(var(--gray-50))",\n color: state.isDisabled\n ? "rgb(var(--secondary-300))"\n : "rgb(var(--secondary-500))",\n ".dark &": {\n backgroundColor: "rgb(var(--secondary-600))",\n color: state.isDisabled\n ? "rgb(var(--secondary-400))"\n : "rgb(var(--secondary-200))"\n }\n }),\n multiValueLabel: ( base, state ) => ({\n ...base,\n padding: "0.25rem",\n fontSize: size === "md" ? "0.875rem" : "1rem",\n color: state.isDisabled\n ? "rgb(var(--secondary-300))"\n : "rgb(var(--secondary-500))",\n ".dark &": {\n color: state.isDisabled\n ? "rgb(var(--secondary-400))"\n : "rgb(var(--secondary-200))"\n }\n }),\n multiValueRemove: ( base, state ) => ({\n ...base,\n padding: "0.25rem",\n paddingLeft: "0!important",\n display: state.data.isFixed ? "none" : "flex",\n alignItems: "center",\n justifyContent: "center",\n marginStart: "-0.5rem",\n "&:hover": {\n backgroundColor: "transparent",\n color: "inherit"\n }\n }),\n input: ( base ) => ({\n ...base,\n margin: 0,\n padding: 0,\n fontSize: size === "md" ? "0.875rem" : "1rem",\n color: "rgb(var(--secondary-500))",\n ".dark &": { color: "rgb(var(--secondary-200))" }\n }),\n singleValue: ( base, state ) => ({\n ...base,\n margin: 0,\n fontSize: size === "md" ? "0.875rem" : "1rem",\n color: state.isDisabled\n ? "rgb(var(--secondary-300))"\n : "rgb(var(--secondary-500))",\n ".dark &": {\n color: state.isDisabled\n ? "rgb(var(--secondary-400))"\n : "rgb(var(--secondary-200))"\n }\n }),\n placeholder: ( base ) => ({\n ...base,\n fontSize: size === "md" ? "0.875rem" : "1rem",\n color: "rgb(var(--secondary-200))",\n ".dark &": { color: "rgb(var(--secondary-400))" }\n })\n };\n};'
3307
+ },
3308
+ {
3309
+ "name": "useSelectOutsideClose.ts",
3310
+ "content": `import { useEffect, type MutableRefObject } from "react";
3311
+
3312
+ interface IUseSelectOutsideCloseArgs {
3313
+ /** Only while the menu is open is a listener attached. */
3314
+ menuOpen: boolean;
3315
+ /** The menu's (possibly portaled) DOM node, so clicks inside it are not "outside". */
3316
+ menuNodeRef: MutableRefObject<HTMLDivElement | null>;
3317
+ /** Commits the multi-select draft, then closes. */
3318
+ commitAndClose: () => void;
3319
+ }
3320
+
3321
+ /**
3322
+ * Closes the dropdown on interaction outside the component. react-select's own outside-click
3323
+ * handling relies on its input being focused (it is not \u2014 focus lives in the dropdown search input),
3324
+ * so Select handles it here instead.
3325
+ */
3326
+ export function useSelectOutsideClose({
3327
+ menuOpen,
3328
+ menuNodeRef,
3329
+ commitAndClose
3330
+ }: IUseSelectOutsideCloseArgs ): void {
3331
+ useEffect(() => {
3332
+ if ( !menuOpen ) {
3333
+ return undefined;
3334
+ }
3335
+ const handlePointerDown = ( e: MouseEvent ) => {
3336
+ const target = e.target as HTMLElement | null;
3337
+ // Ignore events whose target detached during a re-render \u2014 react-select swaps its
3338
+ // control input when the menu opens, so the opening mousedown's target leaves the
3339
+ // DOM and would otherwise be mistaken for an outside click.
3340
+ if ( !target || !target.isConnected ) {
3341
+ return;
3342
+ }
3343
+ // Clicks inside the (possibly portaled) menu keep it open.
3344
+ const insideMenu = menuNodeRef.current?.contains( target );
3345
+ if ( insideMenu ) {
3346
+ return;
3347
+ }
3348
+ // The per-chip remove "\xD7" and the clear-all control have their own react-select handlers;
3349
+ // don't hijack those into a menu close.
3350
+ if ( target.closest( ".select__multi-value__remove, .select__clear-indicator" )) {
3351
+ return;
3352
+ }
3353
+ // Everything else \u2014 the control body/chevron (toggle-closed) or a truly outside click \u2014
3354
+ // commits the draft and closes.
3355
+ commitAndClose();
3356
+ };
3357
+ // Defer attaching the listener so the click that opened the menu cannot immediately
3358
+ // close it.
3359
+ const raf = requestAnimationFrame(() => {
3360
+ document.addEventListener( "mousedown", handlePointerDown );
3361
+ });
3362
+ return () => {
3363
+ cancelAnimationFrame( raf );
3364
+ document.removeEventListener( "mousedown", handlePointerDown );
3365
+ };
3366
+ }, [ menuOpen, commitAndClose, menuNodeRef ]);
3367
+ }
3368
+ `
3369
+ },
3370
+ {
3371
+ "name": "useSelectOptionSource.ts",
3372
+ "content": 'import { type ReactNode } from "react";\nimport type { GroupBase } from "react-select";\n\nimport { useAsyncOptions, useIgnoredPropWarning, type TPrefetch } from "@hooks";\nimport { resolveLoadErrors, resolveReloadControls } from "@utils";\nimport type { IOption, TSelectLoadOptions, TSelectOptions } from "./types";\n\n// Module-level so the identity is stable across renders when `options` is absent \u2014 a fresh `[]`\n// per render would invalidate handleSelectAllDraft\'s useCallback and the whole option context.\nconst EMPTY_OPTIONS: readonly never[] = [];\n\ninterface IUseSelectOptionSourceArgs<Group extends GroupBase<IOption>> {\n options?: TSelectOptions<Group>;\n loadOptions?: TSelectLoadOptions;\n initialOptions?: readonly IOption[];\n prefetch?: TPrefetch;\n refetchOnClear?: boolean;\n optionsKey?: string | number;\n loadErrorMessage?: ReactNode;\n showReloadButton?: boolean;\n onLoadError?: ( error: unknown ) => void;\n /** Consumer-owned loading flag; OR-ed with the async loader rather than replaced by it. */\n isLoading?: boolean;\n onReload?: () => void;\n isReloading?: boolean;\n onFilterChange?: ( query: string ) => void;\n}\n\ninterface ISelectOptionSource<Group extends GroupBase<IOption>> {\n options: TSelectOptions<Group>;\n isServerFiltered: boolean;\n /** Loader instead of rows (SelectMenu\'s `isLoading`). */\n isLoading: boolean;\n isReloading?: boolean;\n onReload?: () => void;\n /** Hand to `useFilterQuery`; notifies the consumer AND drives the async source. */\n onFilterQueryChange: ( query: string ) => void;\n ensureDefaults: () => void;\n loadError?: ReactNode;\n}\n\n/**\n * All of `Select`\'s option-source policy: async vs sync mode detection, value precedence between the\n * consumer\'s own flags and the loader\'s derived ones, default messages, and the dev warnings for the\n * two footguns a type-level XOR cannot express against react-select\'s generics.\n */\nexport function useSelectOptionSource<Group extends GroupBase<IOption>>({\n options,\n loadOptions,\n initialOptions,\n prefetch,\n refetchOnClear = false,\n optionsKey,\n loadErrorMessage,\n showReloadButton = false,\n onLoadError,\n isLoading,\n onReload,\n isReloading,\n onFilterChange\n}: IUseSelectOptionSourceArgs<Group> ): ISelectOptionSource<Group> {\n const isAsync = typeof loadOptions === "function";\n\n const asyncOptions = useAsyncOptions<IOption>({\n loadOptions,\n initialOptions,\n prefetchDefaults: prefetch !== "never",\n refetchOnClear,\n optionsKey,\n onLoadError,\n getOptionKey: ( option ) => option.value\n });\n\n // The two footguns a type-level XOR cannot express against react-select\'s generics.\n useIgnoredPropWarning(\n isAsync && options !== undefined,\n "Select: `options` is ignored when `loadOptions` is set \u2014 use `initialOptions` to seed the list."\n );\n useIgnoredPropWarning(\n asyncOptions.hasMore,\n "Select: `loadOptions` reported `hasMore` \u2014 Select does not page. Use MultiSelectTransfer."\n );\n // The mirror of the first: seed rows only mean anything to the async source, so without a loader they\n // vanish silently \u2014 the same mistake as passing `options` in async mode, and just as quiet.\n useIgnoredPropWarning(\n !isAsync && initialOptions !== undefined,\n "Select: `initialOptions` is ignored without `loadOptions` \u2014 pass those rows as `options` instead."\n );\n // Same class of mistake: `prefetch` only ever schedules the baseline fetch, so with the rows already\n // in `options` there is nothing for it to trigger and it silently does nothing.\n useIgnoredPropWarning(\n !isAsync && prefetch !== undefined,\n "Select: `prefetch` is ignored without `loadOptions` \u2014 `options` are already on screen, so there is nothing to fetch."\n );\n\n // Notifies the consumer AND drives the async source, so onFilterChange keeps working for analytics\n // and filterValue syncing in async mode. Not memoised: useFilterQuery reads its handler through a ref.\n const onFilterQueryChange = ( query: string ): void => {\n onFilterChange?.( query );\n asyncOptions.onFilterChange( query );\n };\n\n return {\n options: isAsync ? asyncOptions.options : options ?? EMPTY_OPTIONS,\n isServerFiltered: isAsync || typeof onFilterChange === "function",\n // OR-ed, not switched: a consumer raising isLoading in async mode for their own reason wants a loader.\n isLoading: isLoading === true || ( isAsync && asyncOptions.isReplacing ),\n ...resolveReloadControls({ isAsync, source: asyncOptions, onReload, isReloading, showReloadButton }),\n onFilterQueryChange,\n ensureDefaults: asyncOptions.ensureDefaults,\n // Select never pages, so `loadMoreError` is unreachable here and deliberately dropped.\n loadError: resolveLoadErrors({\n errorKind: asyncOptions.errorKind,\n loadErrorMessage\n }).loadError\n };\n}\n'
2944
3373
  },
2945
3374
  {
2946
3375
  "name": "types.ts",
2947
- "content": 'import type { ReactNode } from "react";\n\n/**\n * Available sizes for the Select component\n */\nexport enum ESelectSizes {\n MD = "md",\n LG = "lg"\n}\n\n/**\n * Size type derived from available sizes\n */\nexport type TSelectSize = `${ESelectSizes}`;\n\n/**\n * Option type for Select component\n */\nexport interface IOption {\n label: ReactNode;\n value: any;\n isFixed?: boolean;\n}'
3376
+ "content": 'import type {\n ChangeEvent,\n FocusEvent,\n KeyboardEvent,\n ReactNode,\n ReactElement,\n MutableRefObject,\n RefObject\n} from "react";\nimport type { Props as ReactSelectProps, GroupBase } from "react-select";\n\nimport type { TLoadOptions, TPrefetch } from "@hooks";\nimport { type TIconType } from "../adpIcon";\n\n/**\n * Available sizes for the Select component\n */\nexport enum ESelectSizes {\n MD = "md",\n LG = "lg"\n}\n\n/**\n * Size type derived from available sizes\n */\nexport type TSelectSize = `${ESelectSizes}`;\n\n/**\n * Option type for Select component\n */\nexport interface IOption {\n label: ReactNode;\n value: any;\n /** Plain-text used for searching when `label` is a ReactNode. Takes precedence over label/value. */\n searchValue?: string;\n isFixed?: boolean;\n isDisabled?: boolean;\n}\n\n/**\n * Async option source. Page one only: a resolved page that reports `hasMore` is dev-warned, and no\n * further page is ever requested.\n */\nexport type TSelectLoadOptions = TLoadOptions<IOption>;\n\n/** Latest input modality. Drives which signal shows an option\'s full-text overlay. */\nexport type TSelectInteractionMode = "pointer" | "keyboard";\n\n/** Options as react-select accepts them \u2014 sync mode may carry groups; async mode never does. */\nexport type TSelectOptions<Group extends GroupBase<IOption> = GroupBase<IOption>> =\n readonly ( IOption | Group )[];\n\n/**\n * Props for the Select component\n */\nexport interface ISelectProps<\n IsMulti extends boolean = false,\n Group extends GroupBase<IOption> = GroupBase<IOption>\n> extends Omit<\n ReactSelectProps<IOption, IsMulti, Group>,\n // `inputValue`, `onInputChange` and `isSearchable` are intentionally omitted: this component\n // owns an internal search box (see `searchPlaceholder`) and controls react-select\'s inputValue\n // itself, so these react-select props would silently no-op if forwarded.\n // `isLoading` and `filterOption` are omitted and re-declared below (not forwarded to react-select).\n "options" | "value" | "className" | "inputValue" | "onInputChange" | "isSearchable" | "isLoading"\n | "filterOption"\n > {\n /** Unique id for the select input */\n id?: string;\n /** Custom className for wrapper */\n className?: string;\n /** Label displayed above select */\n label?: ReactNode;\n /** Select size variant */\n size?: TSelectSize;\n /** Options or groups to render. Ignored (dev warning) when `loadOptions` is set \u2014 seed with `initialOptions` instead. */\n options?: ReactSelectProps<IOption, IsMulti, Group>["options"];\n /** Current value of the select */\n value?: ReactSelectProps<IOption, IsMulti, Group>["value"];\n /** Helper text displayed below */\n helperText?: ReactNode;\n /** Display error styling */\n error?: boolean;\n /** Disable the select */\n disabled?: boolean;\n /** Enable creatable select */\n creatable?: boolean;\n /** Field touched state */\n touched?: boolean;\n /** Max number of visible values in multi */\n maxVisibleValues?: number;\n /** Label for truncated values */\n maxVisibleValuesMsg?: string;\n /** Custom footer in menu */\n menuFooter?: ReactNode;\n /** Prefix icon for the control */\n prefixIcon?: TIconType | ReactNode;\n /** Suffix icon for the control */\n suffixIcon?: TIconType | ReactNode;\n /** Placeholder text for the search input inside the dropdown */\n searchPlaceholder?: string;\n /** Tooltip for the select reload button. */\n reloadTooltip?: string;\n /** The reload button is shown when this is provided. Fired when the reload button is clicked. */\n onReload?: () => void;\n /** Spins the select reload button. */\n isReloading?: boolean;\n /** Seeds/re-syncs dropdown search; semi-controlled \u2014 pair with onFilterChange. Applies in both modes. */\n filterValue?: string;\n /**\n * Debounced search-query callback; also called with "" when the component clears search.\n *\n * Without `loadOptions`: switches off local filtering \u2014 `options` is treated as already filtered\n * for the query \u2014 and the fetch, loading state, and response ordering are the consumer\'s\n * responsibility.\n *\n * With `loadOptions`: notification-only, for analytics or `filterValue` syncing.\n */\n onFilterChange?: ( query: string ) => void;\n /** Debounce for the search query, in both sync and `loadOptions` mode. Set to 0 to disable. @default 300 */\n filterDebounceMs?: number;\n /** Replaces option list with loader. OR-ed with the loader\'s own state, so it still applies in async mode. @default false */\n isLoading?: boolean;\n /**\n * Custom client-side match, replacing the shared `matchesQuery` default.\n *\n * @deprecated Use `onFilterChange` instead, which does the same job without a second filtering axis:\n * it hands you the query and treats `options` as already filtered, so your predicate lives in your own\n * `useMemo` rather than in a react-select callback. Pair with `filterDebounceMs={0}` to keep filtering\n * synchronous. Ignored entirely when filtering is already delegated (`onFilterChange`/`loadOptions`),\n * and scheduled for removal in the next major.\n *\n * ```tsx\n * const visible = useMemo(() => all.filter(( o ) => myMatch( o, query )), [ all, query ]);\n * <Select options={visible} onFilterChange={setQuery} filterDebounceMs={0} />\n * ```\n */\n filterOption?: ReactSelectProps<IOption, IsMulti, Group>["filterOption"];\n\n /**\n * Server-side option source. When provided, `Select` owns the option list, the request lifecycle and\n * the loading state; `options` is ignored (dev warning) and `onFilterChange` becomes\n * notification-only. Responsible for mapping the payload to `IOption` \u2014 envelopes and domain\n * filtering are the consumer\'s business. Options are stored exactly as returned, so extra fields\n * survive. A fresh inline arrow is fine: the loader is read through a ref.\n *\n * Page one only: `cursor` / `hasMore` / `total` in the result are ignored.\n */\n loadOptions?: TSelectLoadOptions;\n /**\n * Seed rows for a list you already have \u2014 an SSR payload, a route loader, a warm cache. They paint on the\n * first frame, so there is no loader to sit through, and they stay put while the baseline fetch revalidates\n * over them. They do not suppress that fetch: pair with `prefetch="never"` if the seed is the whole list\n * until the user types. A *search* replaces them, since seed rows are not results for a query; clearing it\n * brings them back until a fetched baseline lands. Async mode only \u2014 ignored (dev warning) without\n * `loadOptions`, where the rows belong in `options`.\n */\n initialOptions?: readonly IOption[];\n /**\n * When to fetch the unfiltered baseline.\n * - `"open"` \u2014 on first menu open. Right for forms with several server-filtered Selects, where paying\n * for menus the user may never open is the worse trade.\n * - `"mount"` \u2014 at render, before any interaction. Use when the list is near-certain to be needed and\n * a visible-but-empty Select would read as broken.\n * - `"never"` \u2014 no baseline at all; fetch only once the user types. For heavy lists.\n *\n * Async mode only \u2014 ignored (dev warning) without `loadOptions`, where `options` are already on screen\n * and there is nothing to fetch.\n * @default "open"\n */\n prefetch?: TPrefetch;\n /** Clearing the search revalidates the cached baseline instead of just restoring it. Costs one request per menu close. @default false */\n refetchOnClear?: boolean;\n /**\n * Identity of the option set, for dependent selects. When it changes, cached results are dropped and\n * the list is repopulated \u2014 immediately if the menu is open, otherwise on next open. Compose several\n * parents into one scalar: ``optionsKey={`${domainId}|${accessType}`}``. Does NOT clear the selection.\n */\n optionsKey?: string | number;\n /** Shown in the menu when `loadOptions` rejects. @default "Couldn\'t load options." */\n loadErrorMessage?: ReactNode;\n /** Shows the menu\'s reload button in async mode, wired to re-run the current query. @default false */\n showReloadButton?: boolean;\n /** Notified when a load rejects (the component renders `loadErrorMessage` and swallows it). */\n onLoadError?: ( error: unknown ) => void;\n}\n\n/**\n * Per-render option config for the SelectOption component. react-select keys custom components by\n * reference and remounts them whenever that reference changes; the `customComponents` object in\n * select.tsx is rebuilt every render. Feeding these live values through context (rather than a\n * closure inside a freshly-created Option) lets SelectOption keep a stable module-level identity,\n * so react-select re-renders it in place instead of remounting - which is what keeps the\n * `useIsTruncated` measurement (and the hover-expand affordance) from flickering.\n */\nexport interface ISelectOptionContext {\n /**\n * In-progress multi-select draft, as a value Set. Drives checkboxes / Select All while the\n * committed value drives the control. A Set rather than the array: every option row tests its own\n * membership, so an array would make one menu render O(options x draft).\n */\n draftValues?: ReadonlySet<IOption["value"]>;\n /**\n * Checked state of the Select All row: every option the query currently leaves VISIBLE is in the\n * draft. Resolved on the Select, which is the only place that knows the visible set \u2014 react-select\n * hands each option its unfiltered `options` array, so deriving it here would report unchecked\n * even with every visible row ticked.\n */\n areAllSelected?: boolean;\n /** Toggle a single option in the multi-select draft. */\n onToggleDraftOption?: ( option: IOption ) => void;\n /** Toggle Select All / Deselect All on the multi-select draft (shared with the keyboard path). */\n onSelectAll?: () => void;\n /** tv() class for the label wrapper. */\n optionLabelWrapClass: string;\n /** tv() class for the (truncating) label. */\n optionLabelClass: string;\n /** tv() class for the hover/focus full-text overlay. */\n optionOverlayClass: string;\n /**\n * Latest input modality, shared across every option. The full-text overlay follows the pointer\n * (local `isHovered`) while the user is using the mouse, and react-select\'s `isFocused` while\n * they\'re navigating by keyboard. Without this, react-select\'s `isFocused` - which lingers on the\n * last-focused option after the pointer leaves, and is also set by mouse hover - keeps an\n * overlay visible after the mouse has moved away (and shows two at once mid-transition).\n *\n * State on the Select, not a shared ref: this decides what an option renders, and writing a ref\n * schedules no re-render. Setting the mode it already holds is a no-op React bails out of, so\n * hovering along a list costs a render only at a genuine modality switch.\n */\n interactionMode: TSelectInteractionMode;\n /** Records the modality the user just used. See {@link ISelectOptionContext.interactionMode}. */\n onInteractionMode: ( mode: TSelectInteractionMode ) => void;\n}\n\n/**\n * Per-instance menu config via context (keeps SelectMenu\'s stable identity).\n */\nexport interface ISelectMenuContext {\n /** Current search text (controls react-select\'s inputValue). */\n filterQuery: string;\n /** Updates the query and (debounced) notifies `onFilterChange`. */\n onFilterInput: ( e: ChangeEvent<HTMLInputElement> ) => void;\n /** Marks Backspace/Delete held; defer debounce until keyup. */\n onFilterKeyDown: ( e: KeyboardEvent<HTMLInputElement> ) => void;\n /** On Backspace/Delete release, starts the deferred debounce. */\n onFilterKeyUp: ( e: KeyboardEvent<HTMLInputElement> ) => void;\n /** On blur during hold, flush deferred debounce. */\n onFilterBlur: ( e: FocusEvent<HTMLInputElement> ) => void;\n /** Placeholder for the search input. */\n searchPlaceholder: string;\n /** Optional custom footer rendered below the option list. */\n menuFooter?: ReactNode;\n /** Close the menu, discarding the multi-select draft. */\n closeMenu: () => void;\n /** Commit the multi-select draft, then close. */\n commitAndClose: () => void;\n /** tv() class for the search container. */\n searchContainerClass: string;\n /** tv() class for the search input. */\n searchInputClass: string;\n /** tv() class for the loader shown in place of the option list. */\n loaderClass: string;\n /** Replaces the option list with the loader. */\n isLoading?: boolean;\n /** Replaces the option list when set (async load failure). */\n loadError?: ReactNode;\n /** tv() class for the error container. */\n errorClass: string;\n /** Ref to the search input; focused when the menu opens. */\n searchInputRef: RefObject<HTMLInputElement>;\n /** Captures the menu\'s (possibly portaled) DOM node for the outside-click check. */\n menuNodeRef: MutableRefObject<HTMLDivElement | null>;\n /** Ref to the component wrapper, used to reach react-select\'s hidden control input. */\n containerRef: RefObject<HTMLDivElement>;\n /** Shown when provided; fired on reload-button click. */\n onReload?: () => void;\n /** Spins/disables the reload button. */\n isReloading?: boolean;\n /** Reload-button tooltip / aria-label. */\n reloadTooltip?: string;\n /** Records the input modality (see {@link ISelectOptionContext.interactionMode}); set to "keyboard" here. */\n onInteractionMode: ( mode: TSelectInteractionMode ) => void;\n}\n\nexport interface IOptionLabelOverlayProps {\n anchorRef: RefObject<HTMLElement>;\n className: string;\n children: ReactNode;\n}\n\nexport interface ITruncatedMultiValueProps {\n /** The plain-text label, used as the Tooltip title. */\n label: string;\n /** react-select\'s rendered chip (MultiValueContainer + label + remove). */\n chip: ReactElement;\n}\n\nexport interface ISelectComponentsConfig {\n prefixIcon?: TIconType | ReactNode;\n suffixIcon?: TIconType | ReactNode;\n maxVisibleValues: number;\n maxVisibleValuesMsg?: string;\n disabled: boolean;\n}\n'
2948
3377
  },
2949
3378
  {
2950
3379
  "name": "selectVariants.ts",
2951
- "content": 'import { tv } from "tailwind-variants";\n\nexport const selectVariants = tv({\n slots: {\n base: "flex flex-col gap-2",\n label: "text-base text-secondary-400 font-medium dark:text-secondary-300",\n helperText: "text-xs font-normal"\n },\n variants: {\n error: {\n true: { helperText: "text-error-500 dark:text-error-400" },\n false: { helperText: "text-secondary-400 dark:text-secondary-200" }\n }\n },\n defaultVariants: {\n error: false\n }\n});\n'
3380
+ "content": `import { tv } from "tailwind-variants";
3381
+
3382
+ export const selectVariants = tv({
3383
+ slots: {
3384
+ base: "flex flex-col gap-2",
3385
+ label: "text-base text-secondary-400 font-medium dark:text-secondary-300",
3386
+ helperText: "text-xs font-normal",
3387
+ menuSearchContainer: "flex items-center justify-between gap-4 px-4 py-3 border-b dark:border-b-0 border-secondary-100",
3388
+ menuSearchInput: "w-full outline-none bg-transparent text-sm text-secondary-500 placeholder:text-secondary-200" +
3389
+ " dark:text-secondary-200 dark:placeholder:text-secondary-400 rounded border border-secondary-100 dark:border-secondary-500 p-2",
3390
+ menuLoader: "flex justify-center py-3",
3391
+ // The async load-failure notice. It occupies the loader's slot, so no variant is needed \u2014 this is
3392
+ // the only state that uses it.
3393
+ menuError: "px-4 py-3 text-sm text-error-700 dark:text-error-400",
3394
+ // The label stays in flow and simply truncates; the full text is shown on hover/focus by a
3395
+ // separate position:fixed overlay (see OptionLabelOverlay in selectComponents) rather than by
3396
+ // expanding this element. That keeps the option row height stable (no layout shift) and lets
3397
+ // the overlay escape the scrollable menu's overflow clipping.
3398
+ optionLabelWrap: "relative flex flex-1 min-w-0 w-full items-center",
3399
+ optionLabel: "block w-full min-w-0 truncate me-6 text-secondary-500 dark:text-secondary-200",
3400
+ // The hover/focus full-text overlay. Positioned (fixed) and sized in JS; these are only its
3401
+ // looks. pointer-events-none so it never steals the hover from the option beneath it.
3402
+ optionOverlay: "z-[9999] rounded border border-secondary-200 bg-white p-2 shadow-md" +
3403
+ " whitespace-normal break-words pointer-events-none text-secondary-500" +
3404
+ " dark:border-primary-400 dark:bg-iridium dark:text-secondary-200"
3405
+ },
3406
+ variants: {
3407
+ error: {
3408
+ true: { helperText: "text-error-700 dark:text-error-400" },
3409
+ false: { helperText: "text-secondary-400 dark:text-secondary-200" }
3410
+ }
3411
+ },
3412
+ defaultVariants: {
3413
+ error: false
3414
+ }
3415
+ });
3416
+ `
3417
+ },
3418
+ {
3419
+ "name": "selectMenu.tsx",
3420
+ "content": `import {
3421
+ createContext,
3422
+ useCallback,
3423
+ useContext,
3424
+ useEffect,
3425
+ type KeyboardEvent,
3426
+ type MouseEvent,
3427
+ type MutableRefObject,
3428
+ type ReactElement
3429
+ } from "react";
3430
+ import {
3431
+ components,
3432
+ type GroupBase,
3433
+ type MenuProps
3434
+ } from "react-select";
3435
+
3436
+ import { keyboardKeys } from "@constants";
3437
+ import { ReloadButton } from "../button/reloadButton";
3438
+ import { Loader } from "../loader";
3439
+ import { type IOption, type ISelectMenuContext } from "./types";
3440
+
3441
+ // Forwarded to react-select's hidden input so option nav works while focus is in the search box.
3442
+ const forwardedKeys = new Set([
3443
+ keyboardKeys.arrowDown,
3444
+ keyboardKeys.arrowUp,
3445
+ keyboardKeys.enter,
3446
+ keyboardKeys.pageDown,
3447
+ keyboardKeys.pageUp
3448
+ ]);
3449
+
3450
+ export const SelectMenuContext = createContext<ISelectMenuContext | null>( null );
3451
+
3452
+ /**
3453
+ * Menu with in-dropdown search. Stable module identity (keeps focus/caret/scroll); search sits
3454
+ * outside MenuList to avoid react-select's focus war. Live values via {@link SelectMenuContext}.
3455
+ */
3456
+ export function SelectMenu<
3457
+ IsMulti extends boolean = boolean,
3458
+ Group extends GroupBase<IOption> = GroupBase<IOption>
3459
+ >( props: MenuProps<IOption, IsMulti, Group> ): ReactElement {
3460
+ const { children, innerProps, innerRef } = props;
3461
+ const ctx = useContext( SelectMenuContext );
3462
+ const searchInputRef = ctx?.searchInputRef ?? null;
3463
+ const menuNodeRef = ctx?.menuNodeRef ?? null;
3464
+
3465
+ useEffect(() => {
3466
+ searchInputRef?.current?.focus();
3467
+ }, [searchInputRef]);
3468
+
3469
+ // Captures the menu DOM for the outside-click check while still handing the node to react-select.
3470
+ // MenuPlacer passes a ref OBJECT, not a callback; dropping it strands its layout effect on
3471
+ // \`if (!menuEl) return\`, killing auto placement and the maxHeight clamp. Memoised: this re-renders
3472
+ // on every keystroke, and React re-attaches a callback ref whose identity changed.
3473
+ const setMenuRef = useCallback(( node: HTMLDivElement | null ) => {
3474
+ if ( menuNodeRef ) {
3475
+ menuNodeRef.current = node;
3476
+ }
3477
+ if ( typeof innerRef === "function" ) {
3478
+ innerRef( node );
3479
+ } else if ( innerRef ) {
3480
+ ( innerRef as MutableRefObject<HTMLDivElement | null> ).current = node;
3481
+ }
3482
+ }, [ menuNodeRef, innerRef ]);
3483
+
3484
+ // Fall back to the plain menu if used without the provider.
3485
+ if ( !ctx ) {
3486
+ return <components.Menu {...props}>{children}</components.Menu>;
3487
+ }
3488
+
3489
+ const {
3490
+ filterQuery,
3491
+ onFilterInput,
3492
+ onFilterKeyDown,
3493
+ onFilterKeyUp,
3494
+ onFilterBlur,
3495
+ searchPlaceholder,
3496
+ menuFooter,
3497
+ closeMenu,
3498
+ commitAndClose,
3499
+ searchContainerClass,
3500
+ searchInputClass,
3501
+ loaderClass,
3502
+ isLoading,
3503
+ loadError,
3504
+ errorClass,
3505
+ containerRef,
3506
+ onReload,
3507
+ isReloading,
3508
+ reloadTooltip,
3509
+ onInteractionMode
3510
+ } = ctx;
3511
+
3512
+ const handleSearchKeyDown = ( e: KeyboardEvent<HTMLInputElement> ) => {
3513
+ onFilterKeyDown( e );
3514
+ // Stop bubbling to SelectContainer so Backspace doesn't remove multi-select values.
3515
+ e.stopPropagation();
3516
+ if ( e.key === keyboardKeys.escape ) {
3517
+ e.preventDefault();
3518
+ closeMenu();
3519
+ // Refocus control after close (search input unmounts).
3520
+ containerRef.current?.querySelector<HTMLInputElement>( ".select__control input" )?.focus();
3521
+ return;
3522
+ }
3523
+ // Tab commits like an outside click; Escape above still cancels.
3524
+ if ( e.key === keyboardKeys.tab ) {
3525
+ commitAndClose();
3526
+ return;
3527
+ }
3528
+ if ( forwardedKeys.has( e.key )) {
3529
+ // Block nav while loading OR while the error has taken the list's place \u2014 react-select still
3530
+ // tracks the previous focusedOption, so Enter would select a row that has left the screen.
3531
+ if ( isLoading || loadError ) {
3532
+ e.preventDefault();
3533
+ return;
3534
+ }
3535
+ onInteractionMode( "keyboard" );
3536
+ const rsInput = containerRef.current?.querySelector<HTMLInputElement>( ".select__control input" );
3537
+ if ( rsInput ) {
3538
+ rsInput.dispatchEvent(
3539
+ new KeyboardEvent( "keydown", { key: e.key, code: e.code, bubbles: true, cancelable: true })
3540
+ );
3541
+ e.preventDefault();
3542
+ }
3543
+ }
3544
+ };
3545
+
3546
+ // Override react-select's onMenuMouseDown so the search field can keep focus.
3547
+ const handleMenuMouseDown = ( e: MouseEvent<HTMLDivElement> ) => {
3548
+ if ( e.button !== 0 ) {
3549
+ return;
3550
+ }
3551
+ const target = e.target as Node;
3552
+ if ( searchInputRef?.current && searchInputRef.current.contains( target )) {
3553
+ return;
3554
+ }
3555
+ e.preventDefault();
3556
+ searchInputRef?.current?.focus();
3557
+ };
3558
+
3559
+ return (
3560
+ <components.Menu
3561
+ {...props}
3562
+ innerRef={setMenuRef}
3563
+ innerProps={{ ...innerProps, onMouseDown: handleMenuMouseDown }}
3564
+ >
3565
+ <div className={searchContainerClass}>
3566
+ <input
3567
+ ref={searchInputRef}
3568
+ type="text"
3569
+ value={filterQuery}
3570
+ onChange={onFilterInput}
3571
+ onKeyDown={handleSearchKeyDown}
3572
+ onKeyUp={onFilterKeyUp}
3573
+ onBlur={onFilterBlur}
3574
+ placeholder={searchPlaceholder}
3575
+ className={searchInputClass}
3576
+ aria-label="Search options"
3577
+ />
3578
+ <ReloadButton onReload={onReload} isReloading={isReloading} tooltip={reloadTooltip} />
3579
+ </div>
3580
+ {/* Loader, then error, then rows. All three are mutually exclusive by construction, so no two
3581
+ live regions ever coexist. The first two replace the list so stale rows can't be clicked;
3582
+ that also hides "No options". role="alert" on the error is deliberately assertive \u2014 the
3583
+ user's action did not do what they asked. */}
3584
+ {isLoading ? (
3585
+ <div className={loaderClass} role="status" aria-label="Loading">
3586
+ <Loader size="sm" />
3587
+ </div>
3588
+ ) : loadError ? (
3589
+ <div className={errorClass} role="alert">{loadError}</div>
3590
+ ) : children}
3591
+ {menuFooter}
3592
+ </components.Menu>
3593
+ );
3594
+ }
3595
+
3596
+ SelectMenu.displayName = "SelectMenu";
3597
+ `
3598
+ },
3599
+ {
3600
+ "name": "selectComponents.tsx",
3601
+ "content": 'import * as React from "react";\nimport { type ReactElement } from "react";\nimport {\n components,\n type GroupBase,\n type OptionProps,\n type MultiValueProps,\n type MultiValueRemoveProps,\n type DropdownIndicatorProps,\n type ValueContainerProps,\n type InputProps\n} from "react-select";\nimport { cx } from "tailwind-variants";\n\nimport { keyboardKeys } from "@constants";\nimport { useIsTruncated } from "@hooks";\nimport { Checkbox } from "../checkbox";\nimport { Tooltip } from "../tooltip";\nimport { ADPIcon, iconList, type TIconType } from "../adpIcon";\nimport { SELECT_ALL_VALUE } from "./utils";\nimport {\n type IOption,\n type ISelectOptionContext,\n type IOptionLabelOverlayProps,\n type ITruncatedMultiValueProps,\n type ISelectComponentsConfig\n} from "./types";\n\n// One shared identity for "no draft", so a single-select option never allocates one per render.\nconst EMPTY_DRAFT: ReadonlySet<IOption["value"]> = new Set();\n\nexport const SelectOptionContext = React.createContext<ISelectOptionContext>({\n optionLabelWrapClass: "",\n optionLabelClass: "",\n optionOverlayClass: "",\n interactionMode: "pointer",\n onInteractionMode: () => {}\n});\n\n/**\n * The full-text overlay shown for a truncated option on hover/focus. Rendered `position:fixed`\n * and positioned from the label wrapper\'s viewport rect, so it escapes the scrollable menu\'s\n * overflow clipping (no ancestor establishes a containing block via transform/filter/etc.) - a\n * plain absolute overlay stays trapped inside the menu and gets clipped at whichever edge it\n * grows toward. It stays in the option\'s DOM subtree (not portaled) so it still inherits the\n * theme (`.dark`) and RTL context. The height is measured at the final width, then the top is\n * clamped so the box never spills past the viewport bottom (it shifts up for the last options).\n * pointer-events:none keeps the hover on the row beneath it, so it can\'t cause a hover flicker.\n */\nfunction OptionLabelOverlay({ anchorRef, className, children }: IOptionLabelOverlayProps ): ReactElement {\n const overlayRef = React.useRef<HTMLDivElement>( null );\n const [ style, setStyle ] = React.useState<React.CSSProperties | null>( null );\n\n React.useLayoutEffect(() => {\n const anchor = anchorRef.current;\n const overlay = overlayRef.current;\n if ( !anchor || !overlay ) {\n return undefined;\n }\n const position = () => {\n const rect = anchor.getBoundingClientRect();\n // Size the overlay to the label width first, so its wrapped height is measured correctly.\n overlay.style.position = "fixed";\n overlay.style.left = `${rect.left}px`;\n overlay.style.width = `${rect.width}px`;\n overlay.style.top = `${rect.top}px`;\n overlay.style.visibility = "hidden";\n const margin = 8;\n const maxTop = window.innerHeight - margin - overlay.offsetHeight;\n const top = rect.top > maxTop ? Math.max( margin, maxTop ) : rect.top;\n setStyle({ position: "fixed", left: rect.left, top, width: rect.width, zIndex: 9999 });\n };\n position();\n // A position:fixed box doesn\'t follow its anchor, so re-pin it whenever the anchor moves:\n // scrolling the menu (capture=true catches the scrollable ancestor, whose scroll doesn\'t\n // bubble) or a viewport resize. Without this the overlay floats away from its option row.\n window.addEventListener( "scroll", position, true );\n window.addEventListener( "resize", position );\n return () => {\n window.removeEventListener( "scroll", position, true );\n window.removeEventListener( "resize", position );\n };\n }, [ anchorRef, children ]);\n\n return (\n <div\n ref={overlayRef}\n className={className}\n style={style ?? { position: "fixed", top: 0, left: 0, visibility: "hidden" }}\n >\n {children}\n </div>\n );\n}\n\n/**\n * A single dropdown option (handles Select All, multi-select checkboxes, and the selected\n * checkmark). Defined at module level with a stable identity so react-select never remounts it;\n * live selection state arrives via {@link SelectOptionContext}. The label truncates to one line\n * and, only when genuinely clipped (`useIsTruncated`), shows its full text on hover/focus in a\n * `position:fixed` overlay - see {@link OptionLabelOverlay}.\n */\nexport function SelectOption<\n IsMulti extends boolean = boolean,\n Group extends GroupBase<IOption> = GroupBase<IOption>\n>( props: OptionProps<IOption, IsMulti, Group> ): ReactElement {\n const {\n draftValues,\n areAllSelected,\n onToggleDraftOption,\n onSelectAll,\n optionLabelWrapClass,\n optionLabelClass,\n optionOverlayClass,\n interactionMode,\n onInteractionMode\n } = React.useContext( SelectOptionContext );\n const { ref: labelRef, containerRef: labelWrapRef, isTruncated: isLabelTruncated } = useIsTruncated<HTMLSpanElement>();\n const [ isHovered, setIsHovered ] = React.useState( false );\n\n const optionStyles = props.getStyles( "option", props );\n const isSelectAllRow = props.data.value === SELECT_ALL_VALUE;\n // Multi-select selection is driven by the in-progress draft (not react-select\'s value, which is\n // the committed selection feeding the control). Single-select keeps react-select\'s own state.\n const draft = draftValues ?? EMPTY_DRAFT;\n const optionSelected = props.isMulti\n ? ( isSelectAllRow ? Boolean( areAllSelected ) : draft.has( props.data.value ))\n : props.isSelected;\n\n const baseClassName = props.cx(\n {\n option: true,\n "option--is-disabled": props.isDisabled,\n "option--is-focused": props.isFocused,\n "option--is-selected": optionSelected\n },\n props.className\n );\n\n // Toggle the draft for multi-select (mouse path). stopPropagation keeps react-select from also\n // firing its own onChange against the committed value.\n const handleToggle = ( e: React.SyntheticEvent ) => {\n e.stopPropagation();\n if ( props.isDisabled || props.data.isFixed ) {\n return;\n }\n if ( isSelectAllRow ) {\n onSelectAll?.();\n } else {\n onToggleDraftOption?.( props.data );\n }\n };\n\n // react-select\'s own `state.isSelected` reflects the *committed* value, not the in-progress\n // multi-select draft - so it never lights up a checked-but-uncommitted row, and the inline\n // `style` from `optionStyles` can\'t respond to that anyway (nested selectors like `.dark &`\n // are dropped when applied as a plain `style` attribute). Drive the background entirely from\n // our own `optionSelected` (checked-aware for multi, same as isSelected for single) via\n // classes instead, so it\'s consistent for both select modes and both themes.\n const bgClass = optionSelected\n ? "!bg-frostBlue dark:!bg-secondary-700"\n : props.isFocused\n ? "!bg-frostBlue dark:!bg-secondary-800"\n : "!bg-transparent dark:!bg-iridium";\n\n // Show the full-text overlay only for genuinely-clipped labels. Which signal drives it depends on\n // the current input modality: the pointer path uses local `isHovered` (which clears on\n // mouseleave, so only the row actually under the cursor shows, never a stale one); the keyboard\n // path uses react-select\'s `isFocused`. Honoring `isFocused` unconditionally would leave the\n // overlay stuck on the last-focused row after the mouse moved off it (react-select keeps that\n // focus, and sets it on hover too), which is the "both overlays stay visible" bug.\n const showOverlay = isLabelTruncated &&\n ( interactionMode === "keyboard" ? props.isFocused : isHovered );\n\n return (\n <div\n style={optionStyles as React.CSSProperties}\n onMouseEnter={() => {\n onInteractionMode( "pointer" );\n setIsHovered( true );\n }}\n onMouseLeave={() => setIsHovered( false )}\n className={cx(\n baseClassName,\n "select__custom-option",\n bgClass,\n props.isMulti && "select__custom-option--is-multi"\n )}\n >\n {props.isMulti && (\n <Checkbox\n className="me-2"\n onChange={handleToggle}\n checked={optionSelected}\n disabled={props.isDisabled || props.data.isFixed}\n />\n )}\n <components.Option\n {...props}\n className={cx( "!p-0 !bg-transparent", props.isMulti && "flex-1 min-w-0" )}\n innerProps={{\n ...props.innerProps,\n ...( props.isMulti ? { onClick: handleToggle } : {})\n }}\n >\n <span ref={labelWrapRef} className={optionLabelWrapClass}>\n <span ref={labelRef} className={optionLabelClass}>{props.children}</span>\n </span>\n {showOverlay && (\n <OptionLabelOverlay anchorRef={labelWrapRef} className={optionOverlayClass}>\n {props.children}\n </OptionLabelOverlay>\n )}\n </components.Option>\n </div>\n );\n}\n\nSelectOption.displayName = "SelectOption";\n\n/**\n * Wraps a multi-select chip so its full label is surfaced in a Tooltip, but only when the chip\'s\n * label is actually clipped by react-select\'s `maxWidth` (measured against the rendered\n * `.select__multi-value__label`, whose class comes from `classNamePrefix="select"`). The Tooltip\n * always wraps the chip and is gated via its `canOpen` prop rather than being swapped in and out,\n * so the measured label node stays mounted and the ResizeObserver never loses its target. The\n * `contents` wrapper carries no box of its own, so the chip lays out exactly as it would\n * unwrapped; it exists only to scope the label lookup to this chip.\n */\nfunction TruncatedMultiValue({ label, chip }: ITruncatedMultiValueProps ): ReactElement {\n const wrapRef = React.useRef<HTMLSpanElement>( null );\n const [ isTruncated, setIsTruncated ] = React.useState( false );\n\n React.useLayoutEffect(() => {\n const labelEl = wrapRef.current?.querySelector<HTMLElement>( ".select__multi-value__label" ) ?? null;\n if ( !labelEl ) {\n return undefined;\n }\n const measure = () => setIsTruncated( labelEl.scrollWidth > labelEl.clientWidth );\n measure();\n const observer = new ResizeObserver( measure );\n observer.observe( labelEl );\n return () => observer.disconnect();\n }, [label]);\n\n return (\n <Tooltip\n placement="top"\n canOpen={isTruncated}\n title={label}\n trigger={<span ref={wrapRef} className="contents">{chip}</span>}\n />\n );\n}\n\nTruncatedMultiValue.displayName = "TruncatedMultiValue";\n\n/**\n * Builds the react-select custom components that are independent of the in-dropdown\n * search/focus machinery (kept in select.tsx) and of per-option selection state (the Option is\n * the stable {@link SelectOption} above). These are stateless, so recreating them per render is\n * harmless - react-select only remounts the focus-sensitive Menu component.\n */\nexport function createSelectComponents<\n IsMulti extends boolean = false,\n Group extends GroupBase<IOption> = GroupBase<IOption>\n>( config: ISelectComponentsConfig ) {\n const {\n prefixIcon,\n suffixIcon,\n maxVisibleValues,\n maxVisibleValuesMsg,\n disabled\n } = config;\n\n // Dropdown indicator icon\n const DropdownIndicator = ( props: DropdownIndicatorProps<IOption, IsMulti, Group> ) => {\n const {\n selectProps: { menuIsOpen }\n } = props;\n return (\n <ADPIcon size="xs" icon={menuIsOpen ? iconList.upArrow : iconList.downArrow} />\n );\n };\n\n // Custom value container to handle prefix/suffix icons and truncation\n const ValueContainer = (\n { children, ...props }: ValueContainerProps<IOption, IsMulti, Group>\n ) => {\n const values = props.getValue();\n // Split the chips (which carry `props.data`) from the search input in a single pass.\n const withData: React.ReactNode[] = [];\n const inputChild: React.ReactNode[] = [];\n React.Children.toArray( children ).forEach(( c ) => {\n const target = ( c as ReactElement ).props.data ? withData : inputChild;\n target.push( c );\n });\n return (\n <>\n {prefixIcon &&\n ( typeof prefixIcon === "string" ? (\n <ADPIcon icon={prefixIcon as TIconType} size="xs" />\n ) : (\n prefixIcon\n ))}\n <components.ValueContainer {...props}>\n {withData}\n {values.length > maxVisibleValues && (\n <div\n className={cx(\n "text-secondary-400 dark:text-secondary-300",\n "select__truncated-multi-value",\n disabled && "select__truncated-multi-value--is-disabled"\n )}\n >\n +{values.length - maxVisibleValues}{" "}\n {maxVisibleValuesMsg ?? "More"}\n </div>\n )}\n {inputChild}\n </components.ValueContainer>\n {suffixIcon &&\n ( typeof suffixIcon === "string" ? (\n <ADPIcon icon={suffixIcon as TIconType} size="xs" />\n ) : (\n suffixIcon\n ))}\n </>\n );\n };\n\n // Hide extra MultiValue components\n const MultiValue = ( props: MultiValueProps<IOption> ) => {\n if ( props.index !== undefined && props.index >= maxVisibleValues ) {\n return null;\n }\n const chip = <components.MultiValue {...props} />;\n // Surface the full label in a Tooltip, but only when the chip\'s label is actually truncated\n // (see TruncatedMultiValue). Non-string labels have no text to show, so render the chip as-is.\n if ( typeof props.data.label !== "string" ) {\n return chip;\n }\n return <TruncatedMultiValue label={props.data.label} chip={chip} />;\n };\n\n // react-select\'s default remove control is a mouse-only `<div role="button">` with no tabIndex,\n // so a pill\'s "x" can never be reached or activated by keyboard. Make it a real tab stop\n // (per chip, regardless of truncation) that removes on Enter/Space. stopPropagation keeps the\n // key from bubbling to the control, which would otherwise treat Enter/Space as open/select.\n const MultiValueRemove = ( props: MultiValueRemoveProps<IOption, IsMulti, Group> ) => {\n const { onClick } = props.innerProps;\n return (\n <components.MultiValueRemove\n {...props}\n innerProps={{\n ...props.innerProps,\n tabIndex: disabled ? -1 : 0,\n onKeyDown: ( e: React.KeyboardEvent ) => {\n if ( e.key === keyboardKeys.enter || e.key === keyboardKeys.space ) {\n e.preventDefault();\n e.stopPropagation();\n onClick?.( e as unknown as React.MouseEvent<HTMLDivElement> );\n }\n }\n }}\n />\n );\n };\n\n /*\n * The control input must remain present and focusable so react-select\'s click-to-open\n * flow works (onControlMouseDown \u2192 focusInput \u2192 onInputFocus \u2192 openMenu). We make it\n * read-only and visually hidden so all actual typing happens in the dropdown search input.\n */\n const Input = ( props: InputProps<IOption, IsMulti, Group> ) => {\n const handleKeyDown = ( e: React.KeyboardEvent<HTMLInputElement> ) => {\n if ( e.key === keyboardKeys.backspace ) {\n const vals = props.getValue();\n if ( vals.length > maxVisibleValues ) {\n e.stopPropagation();\n e.preventDefault();\n }\n }\n };\n return (\n <components.Input\n {...props}\n readOnly\n onKeyDown={handleKeyDown}\n style={{ ...( props.style as React.CSSProperties ), opacity: 0, width: 0, position: "absolute" }}\n />\n );\n };\n\n return { DropdownIndicator, ValueContainer, MultiValue, MultiValueRemove, Input };\n}\n'
2952
3602
  },
2953
3603
  {
2954
3604
  "name": "select.tsx",
2955
- "content": 'import * as React from "react";\nimport { type ReactNode, type ReactElement, useId, useRef, type ComponentType } from "react";\nimport ReactSelect, {\n type Props as ReactSelectProps,\n components,\n type GroupBase,\n type OptionProps,\n type MultiValueProps,\n type DropdownIndicatorProps,\n type MenuProps,\n type ValueContainerProps,\n type InputProps\n} from "react-select";\nimport CreatableSelect from "react-select/creatable";\nimport { cx } from "tailwind-variants";\n// Disable exhaustive-deps: customComponents only needs to update when menuFooter changes\n\nimport { Checkbox } from "../checkbox";\nimport { ADPIcon, iconList, type TIconType } from "../adpIcon";\nimport { reactSelectCustomStyles } from "./utils";\nimport { selectVariants } from "./selectVariants";\n\nimport { ESelectSizes, type TSelectSize, type IOption } from "./types";\n\n/**\n * Props for the Select component\n */\nexport interface ISelectProps<\n IsMulti extends boolean = false,\n Group extends GroupBase<IOption> = GroupBase<IOption>\n> extends Omit<ReactSelectProps<IOption, IsMulti, Group>, "options" | "value" | "className"> {\n /** Unique id for the select input */\n id?: string;\n /** Custom className for wrapper */\n className?: string;\n /** Label displayed above select */\n label?: ReactNode;\n /** Select size variant */\n size?: TSelectSize;\n /** Options or groups to render */\n options?: ReactSelectProps<IOption, IsMulti, Group>["options"];\n /** Current value of the select */\n value?: ReactSelectProps<IOption, IsMulti, Group>["value"];\n /** Helper text displayed below */\n helperText?: ReactNode;\n /** Display error styling */\n error?: boolean;\n /** Disable the select */\n disabled?: boolean;\n /** Enable creatable select */\n creatable?: boolean;\n /** Field touched state */\n touched?: boolean;\n /** Max number of visible values in multi */\n maxVisibleValues?: number;\n /** Label for truncated values */\n maxVisibleValuesMsg?: string;\n /** Custom footer in menu */\n menuFooter?: ReactNode;\n /** Prefix icon for the control */\n prefixIcon?: TIconType | ReactNode;\n /** Suffix icon for the control */\n suffixIcon?: TIconType | ReactNode;\n}\n\n/**\n * Select component for single or multi selection\n */\nexport function Select<\n IsMulti extends boolean = false,\n Group extends GroupBase<IOption> = GroupBase<IOption>\n>(\n selectProps: ISelectProps<IsMulti, Group>\n): ReactElement {\n const {\n id,\n className,\n label,\n size = ESelectSizes.MD,\n options = [],\n value,\n helperText,\n error = false,\n disabled = false,\n creatable = false,\n maxVisibleValues = 3,\n maxVisibleValuesMsg,\n menuFooter,\n prefixIcon,\n suffixIcon,\n ...restProps\n } = selectProps;\n\n // Dropdown indicator icon\n const DropdownIndicator = (\n props: DropdownIndicatorProps<IOption, IsMulti, Group>\n ) => {\n const {\n selectProps: { menuIsOpen }\n } = props;\n return (\n <ADPIcon\n size="xs"\n icon={menuIsOpen ? iconList.upArrow : iconList.downArrow}\n />\n );\n };\n\n // Custom option rendering (handles select-all and checkboxes)\n const OptionComponent = ( props: OptionProps<IOption, IsMulti, Group> ) => {\n const optionStyles = props.getStyles( "option", props );\n const baseClassName = props.cx(\n {\n option: true,\n "option--is-disabled": props.isDisabled,\n "option--is-focused": props.isFocused,\n "option--is-selected": props.isSelected\n },\n props.className\n );\n const selectedValues = props.getValue();\n const areAllSelected =\n selectedValues.filter(( o ) => o.value !== "select-all" ).length ===\n props.options.length - 1;\n\n const handleClick: React.MouseEventHandler<HTMLDivElement> = ( e ) => {\n e.stopPropagation();\n if ( props.isDisabled || props.data.isFixed ) {\n return;\n }\n if ( props.data.value === "select-all" ) {\n const others = props.options.filter(\n ( o ) => "value" in o && o.value !== "select-all"\n ) as IOption[];\n if ( areAllSelected ) {\n props.clearValue();\n } else {\n props.setValue( others as any, "select-option" );\n }\n } else {\n props.selectOption( props.data );\n }\n };\n\n const handleChange: React.ChangeEventHandler<HTMLInputElement> = ( e ) => {\n e.stopPropagation();\n if ( props.isDisabled || props.data.isFixed ) {\n return;\n }\n if ( props.data.value === "select-all" ) {\n const others = props.options.filter(\n ( o ) => "value" in o && o.value !== "select-all"\n ) as IOption[];\n if ( areAllSelected ) {\n const fixed = props.options.filter(\n ( o ) => "value" in o && o.isFixed\n ) as IOption[];\n props.setValue( fixed as any, "select-option" );\n } else {\n props.setValue( others as any, "select-option" );\n }\n } else {\n props.selectOption( props.data );\n }\n };\n\n return (\n <div\n style={optionStyles as React.CSSProperties}\n className={cx(\n baseClassName,\n "select__custom-option",\n ( props.isSelected || props.isFocused ) &&\n "dark:!bg-secondary-800",\n props.isMulti && "select__custom-option--is-multi"\n )}\n >\n {restProps.isMulti && (\n <Checkbox\n className="me-2"\n onChange={handleChange}\n checked={areAllSelected || props.isSelected}\n disabled={props.isDisabled || props.data.isFixed}\n />\n )}\n <components.Option\n {...props}\n className="!p-0"\n innerProps={{\n ...props.innerProps,\n ...( restProps.isMulti ? { onClick: handleClick } : {})\n }}\n />\n </div>\n );\n };\n\n // Custom value container to handle prefix/suffix icons and truncation\n const ValueContainer = (\n { children, ...props }: ValueContainerProps<IOption, IsMulti, Group>\n ) => {\n const values = props.getValue();\n const withData = React.Children.toArray( children ).filter(\n ( c ) => ( c as ReactElement ).props.data\n );\n const inputChild = React.Children.toArray( children ).filter(\n ( c ) => !( c as ReactElement ).props.data\n );\n return (\n <>\n {prefixIcon &&\n ( typeof prefixIcon === "string" ? (\n <ADPIcon icon={prefixIcon as TIconType} size="xs" />\n ) : (\n prefixIcon\n ))}\n <components.ValueContainer {...props}>\n {withData}\n {values.length > maxVisibleValues && (\n <div\n className={cx(\n "select__truncated-multi-value",\n disabled && "select__truncated-multi-value--is-disabled"\n )}\n >\n +{values.length - maxVisibleValues}{" "}\n {maxVisibleValuesMsg ?? "More"}\n </div>\n )}\n {inputChild}\n </components.ValueContainer>\n {suffixIcon &&\n ( typeof suffixIcon === "string" ? (\n <ADPIcon icon={suffixIcon as TIconType} size="xs" />\n ) : (\n suffixIcon\n ))}\n </>\n );\n };\n\n // Hide extra MultiValue components\n const MultiValue = ( props: MultiValueProps<IOption> ) => {\n if ( props.index !== undefined && props.index >= maxVisibleValues ) {\n return null;\n }\n return <components.MultiValue {...props} />;\n };\n\n // Custom input to prevent backspace removing truncated values\n const Input = ( props: InputProps<IOption, IsMulti, Group> ) => {\n const handleKeyDown = ( e: React.KeyboardEvent<HTMLInputElement> ) => {\n if ( e.key === "Backspace" ) {\n const vals = props.getValue();\n if ( vals.length > maxVisibleValues ) {\n e.stopPropagation();\n e.preventDefault();\n }\n }\n };\n return <components.Input {...props} onKeyDown={handleKeyDown} />;\n };\n\n // Footer for menu if provided\n const Footer = ( props: MenuProps<IOption, IsMulti, Group> ) => {\n const { children, innerProps, innerRef } = props;\n return (\n <components.Menu {...props} innerProps={innerProps} innerRef={innerRef}>\n {children}\n {menuFooter}\n </components.Menu>\n );\n };\n\n const customComponents = {\n IndicatorSeparator: () => null,\n DropdownIndicator,\n Option: OptionComponent,\n ValueContainer,\n MultiValue,\n Input,\n ...( menuFooter ? { Menu: Footer } : {})\n };\n\n const inputId = useRef( useId());\n // unify component type for creatable and default select\n type TRSComponent = ComponentType<ReactSelectProps<IOption, IsMulti, Group>>;\n const SelectType: TRSComponent = creatable\n ? ( CreatableSelect as TRSComponent )\n : ( ReactSelect as TRSComponent );\n\n const { base, label: labelClass, helperText: helperTextClass } = selectVariants({ error });\n\n return (\n <div className={base({ class: className })}>\n {label !== undefined && (\n <label\n htmlFor={id || inputId.current}\n className={labelClass()}\n >\n {label}\n </label>\n )}\n <SelectType\n classNamePrefix="select"\n inputId={id || inputId.current}\n options={\n restProps.isMulti && ( options as IOption[]).length\n ? ([{ value: "select-all", label: "Select All" }] as IOption[]).concat(\n options as IOption[]\n )\n : options\n }\n value={value}\n hideSelectedOptions={false}\n menuPlacement="auto"\n components={customComponents}\n className={cx( "select", `select-${size}` )}\n styles={\n reactSelectCustomStyles<IsMulti, Group>(\n error,\n size,\n restProps.isMulti as boolean\n )\n }\n isDisabled={disabled}\n closeMenuOnSelect={!restProps.isMulti}\n {...restProps}\n />\n {helperText && (\n <div className={helperTextClass()}>\n {helperText}\n </div>\n )}\n </div>\n );\n}\n\nSelect.displayName = "Select";\n// Exported types SelectProps and Option are declared above and can be re-exported via index.ts\n'
3605
+ "content": 'import * as React from "react";\nimport {\n type ComponentType,\n type ForwardedRef,\n type ReactElement,\n type RefAttributes,\n useId,\n useMemo,\n useRef,\n useState\n} from "react";\nimport ReactSelect, {\n type Props as ReactSelectProps,\n type GroupBase,\n type FilterOptionOption\n} from "react-select";\nimport CreatableSelect from "react-select/creatable";\nimport mergeRefs from "react-merge-refs";\nimport { cx } from "tailwind-variants";\n\nimport { useFilterQuery, useIgnoredPropWarning, useOnValueChange, usePrefetchBaseline } from "@hooks";\nimport { matchesQuery } from "@utils";\nimport {\n reactSelectCustomStyles,\n getSelectableOptions,\n areAllSelectableSelected,\n SELECT_ALL_VALUE\n} from "./utils";\nimport { selectVariants } from "./selectVariants";\nimport {\n createSelectComponents,\n SelectOption,\n SelectOptionContext\n} from "./selectComponents";\nimport { SelectMenu, SelectMenuContext } from "./selectMenu";\nimport { useSelectOptionSource } from "./useSelectOptionSource";\nimport { useSelectOutsideClose } from "./useSelectOutsideClose";\n\nimport {\n ESelectSizes,\n type IOption,\n type ISelectProps,\n type ISelectMenuContext,\n type TSelectInteractionMode\n} from "./types";\n\n// The synthetic Select-All row, hoisted so `selectOptions` keeps a stable array identity while the\n// row is shown.\nconst SELECT_ALL_OPTION: IOption = { value: SELECT_ALL_VALUE, label: "Select All" };\n\n// `filterOption` deprecation notices, hoisted so the warning hook\'s message dependency stays stable.\nconst FILTER_OPTION_DEPRECATED =\n "Select: `filterOption` is deprecated and will be removed in the next major. Use `onFilterChange` " +\n "instead: hold the options in state, filter them with your own predicate, and pass the result as " +\n "`options` (with `filterDebounceMs={0}` to stay synchronous).";\nconst FILTER_OPTION_IGNORED =\n "Select: `filterOption` is deprecated and is ignored while filtering is server-side \u2014 the options " +\n "you return for the query already are the result set.";\n\nfunction SelectComponent<\n IsMulti extends boolean = false,\n Group extends GroupBase<IOption> = GroupBase<IOption>\n>(\n selectProps: ISelectProps<IsMulti, Group>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n): ReactElement {\n const {\n id,\n className,\n label,\n size = ESelectSizes.MD,\n options,\n value,\n helperText,\n error = false,\n disabled = false,\n creatable = false,\n maxVisibleValues = 3,\n maxVisibleValuesMsg,\n menuFooter,\n prefixIcon,\n suffixIcon,\n searchPlaceholder = "Search...",\n reloadTooltip = "Reload",\n onReload,\n isReloading,\n filterValue,\n onFilterChange,\n filterDebounceMs = 300,\n // Intercepted \u2014 not forwarded (avoids react-select\'s own loading UI).\n isLoading = false,\n loadOptions,\n initialOptions,\n // Left undefined here, not defaulted: sync mode warns on a `prefetch` the consumer actually passed,\n // which an eager default would erase. Resolved at the one place that reads it as a trigger.\n prefetch,\n refetchOnClear = false,\n optionsKey,\n loadErrorMessage,\n showReloadButton = false,\n onLoadError,\n ...restProps\n } = selectProps;\n\n // Owns the async/sync mode decision and every derived option/loading/error value. Declared before\n // useFilterQuery because it supplies that hook\'s handler.\n const optionSource = useSelectOptionSource<Group>({\n options,\n loadOptions,\n initialOptions,\n prefetch,\n refetchOnClear,\n optionsKey,\n loadErrorMessage,\n showReloadButton,\n onLoadError,\n isLoading,\n onReload,\n isReloading,\n onFilterChange\n });\n\n // Filter query state: the raw input value plus the debounced query the option source sees.\n const {\n filterQuery,\n handleFilterInput,\n handleFilterKeyDown,\n handleFilterKeyUp,\n handleFilterBlur,\n resetFilter\n } = useFilterQuery({\n filterValue,\n onFilterChange: optionSource.onFilterQueryChange,\n filterDebounceMs\n });\n // We control menuIsOpen ourselves. react-select\'s built-in menu management closes\n // the menu whenever its internal input blurs, and focusing our in-dropdown search\n // input always blurs that input. Owning the open state decouples the menu lifecycle\n // from react-select\'s focus/blur logic.\n const [ menuOpen, setMenuOpen ] = useState( false );\n const containerRef = useRef<HTMLDivElement>( null );\n const searchInputRef = useRef<HTMLInputElement>( null );\n // The wrapper is both the consumer\'s ref target and ours (the search box reaches react-select\'s\n // hidden control input through it). Memoised so React does not re-attach it every render.\n const rootRef = useMemo(() => mergeRefs([ forwardedRef, containerRef ]), [forwardedRef]);\n // The menu can render in a portal (menuPortalTarget), so it is not always a descendant\n // of containerRef. Track its DOM node separately for the outside-click check below.\n const menuNodeRef = useRef<HTMLDivElement | null>( null );\n // Latest input modality, shared by every option\'s full-text overlay (see SelectOptionContext).\n // State, not a ref: it decides what an option renders. Re-setting the current mode is a no-op React\n // bails out of, so this only re-renders on a genuine pointer\u2194keyboard switch.\n const [ interactionMode, setInteractionMode ] = useState<TSelectInteractionMode>( "pointer" );\n\n // Extract props we compose ourselves so the spread doesn\'t override them\n const {\n onMenuClose: externalOnMenuClose,\n onMenuOpen: externalOnMenuOpen,\n onChange: externalOnChange,\n filterOption: externalFilterOption,\n ...otherRestProps\n } = restProps;\n\n const { isMulti } = otherRestProps;\n\n // Committed multi-select value shown as chips in the control. When the consumer passes `value`\n // the component is controlled and this tracks it; otherwise (uncontrolled) we own it internally\n // and update it on commit so chips still render.\n const isControlled = value !== undefined;\n // Seed committed/draft state from defaultValue when uncontrolled, so an uncontrolled multi-select\n // starts in sync with what react-select renders rather than an empty draft that would wipe the\n // defaults on the first commit. Only read on the initial render.\n const initialMultiValue = value !== undefined ? value : ( otherRestProps.defaultValue as typeof value );\n const [ committedValue, setCommittedValue ] = useState( initialMultiValue );\n // When controlled, `multiControlValue` reads `value` directly, so `committedValue` is only ever\n // consumed in the uncontrolled path \u2014 no effect mirroring `value` into it is needed.\n const multiControlValue = isControlled ? value : committedValue;\n\n // Draft selection for multi-select. While the menu is open, option toggles update this draft\n // instead of calling onChange; the draft is committed only when the menu closes via an outside\n // click. Pressing Escape discards it. Single-select keeps its live onChange behavior.\n const [ pendingValue, setPendingValue ] = useState( initialMultiValue );\n const pendingValueRef = useRef( pendingValue );\n pendingValueRef.current = pendingValue;\n\n // Keep the draft synced with the committed value while the menu is closed, so external updates\n // are reflected on next open.\n React.useEffect(() => {\n if ( isMulti && !menuOpen ) {\n setPendingValue( multiControlValue );\n }\n }, [ isMulti, menuOpen, multiControlValue ]);\n\n const closeMenu = React.useCallback(() => {\n setMenuOpen( false );\n resetFilter();\n externalOnMenuClose?.();\n }, [ externalOnMenuClose, resetFilter ]);\n\n // Commit the multi-select draft, then close. Used by the outside-click handler. Updates the\n // internal committed value (so uncontrolled chips render) and notifies the consumer.\n const commitAndClose = React.useCallback(() => {\n if ( isMulti ) {\n setCommittedValue( pendingValueRef.current );\n ( externalOnChange as ( ...args: unknown[]) => void )?.(\n pendingValueRef.current,\n { action: "set-value" }\n );\n }\n closeMenu();\n }, [ isMulti, externalOnChange, closeMenu ]);\n\n const openMenu = React.useCallback(() => {\n // No need to seed the draft here: the effect above keeps pendingValue synced to the committed\n // value the whole time the menu is closed, so it is already current at open.\n setMenuOpen( true );\n externalOnMenuOpen?.();\n }, [externalOnMenuOpen]);\n\n // Multi-select draft mutators. The control is fed the committed `value` (so chips only appear\n // once the selection is committed), while these update the in-progress draft that drives the\n // menu\'s checkboxes and Select All. Selection is committed to onChange on outside-click close.\n const toggleDraftOption = React.useCallback(( option: IOption ) => {\n setPendingValue(( prev ) => {\n const arr = ( prev as IOption[] | undefined ) ?? [];\n const exists = arr.some(( o ) => o.value === option.value );\n const next = exists ? arr.filter(( o ) => o.value !== option.value ) : [ ...arr, option ];\n return next as typeof pendingValue;\n });\n requestAnimationFrame(() => searchInputRef.current?.focus());\n }, []);\n\n const setDraft = React.useCallback(( vals: IOption[]) => {\n setPendingValue( vals as typeof pendingValue );\n requestAnimationFrame(() => searchInputRef.current?.focus());\n }, []);\n\n // Async mode, or the presence of onFilterChange, is the client/server mode switch.\n const { isServerFiltered } = optionSource;\n\n // react-select derives the candidate it hands `filterOption` from `getOptionLabel`/`getOptionValue`,\n // so mirror that construction for the Select-All path, where there is no react-select candidate to\n // pass through. Reading them off the spread rather than destructuring keeps them flowing to\n // react-select untouched.\n const { getOptionLabel: externalGetOptionLabel, getOptionValue: externalGetOptionValue } = otherRestProps;\n const toCandidate = React.useCallback(\n ( option: IOption ): FilterOptionOption<IOption> => ({\n // react-select types the candidate label as a string but passes whatever getOptionLabel returns,\n // so an unresolved ReactNode label reaches a consumer predicate here exactly as it does there.\n label: externalGetOptionLabel ? externalGetOptionLabel( option ) : ( option.label as string ),\n value: externalGetOptionValue ? externalGetOptionValue( option ) : option.value,\n data: option\n }),\n [ externalGetOptionLabel, externalGetOptionValue ]\n );\n\n // Deprecated: a second filtering axis alongside `onFilterChange`, which already covers it \u2014 that hands\n // the consumer the query and treats `options` as the answer, so a custom predicate belongs in their own\n // memo rather than in a react-select callback. Still honoured client-side until the next major, since\n // it reached react-select through the prop spread before filtering was owned here. Server-filtered mode\n // ignores it outright: a local predicate there could only hide rows the server deliberately returned,\n // and it cannot see the fields the server matched on.\n useIgnoredPropWarning(\n externalFilterOption !== undefined,\n isServerFiltered ? FILTER_OPTION_IGNORED : FILTER_OPTION_DEPRECATED\n );\n\n // The predicate react-select filters rows with, resolved once so the menu and Select All can never\n // disagree about what is visible. Precedence, highest first: server-filtered mode and\n // `filterOption={null}` (react-select\'s documented opt-out) both do no local pass at all; a consumer\n // `filterOption` then decides; otherwise the library default applies. Keyed on the prop\'s identity, so\n // a predicate that changes behaviour re-narrows the visible set instead of leaving Select All acting on\n // a stale one. The candidate argument is react-select\'s own on the path that has one, so the consumer\n // sees exactly what react-select built there and the Select-All path constructs one only when a\n // predicate is actually going to read it.\n const isOptionVisible = React.useCallback(\n ( option: IOption, input: string, candidate?: FilterOptionOption<IOption> ): boolean => {\n if ( isServerFiltered || externalFilterOption === null ) {\n return true;\n }\n return typeof externalFilterOption === "function"\n ? externalFilterOption( candidate ?? toCandidate( option ), input )\n : matchesQuery( option, input );\n },\n [ externalFilterOption, isServerFiltered, toCandidate ]\n );\n\n // The enabled options in the pool, groups flattened. Kept apart from the narrowing below so a\n // keystroke re-runs only the query pass, not the flatten.\n const selectableOptions = React.useMemo(\n () => getSelectableOptions( optionSource.options ),\n [optionSource.options]\n );\n\n // What Select All acts on: the enabled options currently ON SCREEN, so it can never reach an option\n // the query has hidden. Both no-op modes (server-filtered, `filterOption={null}`) are folded into the\n // predicate itself, so there is one pass here regardless of mode.\n const visibleSelectable = React.useMemo(\n () => selectableOptions.filter(( o ) => isOptionVisible( o, filterQuery )),\n [ selectableOptions, isOptionVisible, filterQuery ]\n );\n\n // Read through a ref so handleSelectAllDraft survives every keystroke with its identity intact \u2014\n // see useSelectOptionSource\'s note on what a churning callback costs the whole option context.\n const visibleSelectableRef = useRef( visibleSelectable );\n visibleSelectableRef.current = visibleSelectable;\n\n // Single source of truth for the "Select All" toggle, shared by the mouse path (Option\n // component) and the keyboard path (react-select onChange). If every visible option is already\n // in the draft it deselects down to the fixed ones; otherwise it selects them all. Both\n // directions leave options hidden by the query untouched, so a selection made under one query\n // survives the next.\n const handleSelectAllDraft = React.useCallback(() => {\n const selectable = visibleSelectableRef.current;\n const selectableValues = new Set( selectable.map(( o ) => o.value ));\n const draft = ( pendingValueRef.current as IOption[] | undefined ) ?? [];\n const draftKeys = new Set( draft.map(( o ) => o.value ));\n const next = areAllSelectableSelected( selectable, draftKeys )\n // Deselect: drop selectable, non-fixed options; keep fixed and disabled ones untouched.\n ? draft.filter(( o ) => o.isFixed || !selectableValues.has( o.value ))\n // Select: add every selectable (enabled) option not already present.\n : [ ...draft, ...selectable.filter(( o ) => !draftKeys.has( o.value )) ];\n setDraft( next );\n }, [setDraft]);\n\n useSelectOutsideClose({ menuOpen, menuNodeRef, commitAndClose });\n\n // Prefetch the baseline on first OPEN by default, not on mount: a form with six server-filtered\n // Selects would otherwise fire six requests on paint for menus the user may never open.\n // `prefetch="mount"` opts into the baseline at render, for a Select that would otherwise sit\n // visibly empty.\n usePrefetchBaseline({\n prefetch: prefetch ?? "open",\n isOpen: menuOpen,\n optionsKey,\n ensureDefaults: optionSource.ensureDefaults\n });\n\n // Route an optionsKey CHANGE into the clear path (resetFilter \u2192 onFilterChange("")), which drops the\n // search view and lets ensureDefaults lazily repopulate. Skipped on mount: resetFilter notifies the\n // consumer whenever the query is non-empty, and a seeded `filterValue` must not fire that on paint.\n useOnValueChange( optionsKey, resetFilter );\n\n const {\n DropdownIndicator,\n ValueContainer,\n MultiValue,\n MultiValueRemove,\n Input\n } = createSelectComponents<IsMulti, Group>({\n prefixIcon,\n suffixIcon,\n maxVisibleValues,\n maxVisibleValuesMsg,\n disabled\n });\n\n const {\n base,\n label: labelClass,\n helperText: helperTextClass,\n menuSearchContainer,\n menuSearchInput,\n menuLoader,\n menuError,\n optionLabelWrap,\n optionLabel,\n optionOverlay\n } = selectVariants({ error });\n\n const searchContainerClass = menuSearchContainer();\n const searchInputClass = menuSearchInput();\n const loaderClass = menuLoader();\n const errorClass = menuError();\n const optionLabelWrapClass = optionLabelWrap();\n const optionLabelClass = optionLabel();\n const optionOverlayClass = optionOverlay();\n\n // Live option config for the stable SelectOption (see selectComponents.tsx). Rebuilt whenever the\n // draft changes so checkbox / Select-All state tracks it; the component identity stays stable.\n const draftValues = React.useMemo(\n () => ( isMulti ? new Set((( pendingValue as IOption[] | undefined ) ?? []).map(( o ) => o.value )) : undefined ),\n [ isMulti, pendingValue ]\n );\n // Computed here, where the visible set lives, rather than in SelectOption from react-select\'s\n // unfiltered `props.options` \u2014 which would leave the row unchecked even with every visible option\n // ticked. A boolean in the context also keeps its identity stable across keystrokes.\n const areAllSelected = React.useMemo(\n () => draftValues !== undefined && areAllSelectableSelected( visibleSelectable, draftValues ),\n [ visibleSelectable, draftValues ]\n );\n const optionContextValue = React.useMemo(\n () => ({\n draftValues,\n areAllSelected,\n onToggleDraftOption: toggleDraftOption,\n onSelectAll: handleSelectAllDraft,\n optionLabelWrapClass,\n optionLabelClass,\n optionOverlayClass,\n interactionMode,\n onInteractionMode: setInteractionMode\n }),\n [ draftValues, areAllSelected, toggleDraftOption, handleSelectAllDraft, optionLabelWrapClass,\n optionLabelClass, optionOverlayClass, interactionMode ]\n );\n\n // Live values the stable, module-level SelectMenu reads via context. SelectMenu must keep a\n // stable identity (react-select remounts custom components on reference change, which would\n // destroy the search input\'s focus/caret and the MenuList scroll on every keystroke), so it\n // cannot close over these directly \u2014 context lets it re-render with current values instead.\n const menuContextValue = React.useMemo<ISelectMenuContext>(\n () => ({\n filterQuery,\n onFilterInput: handleFilterInput,\n onFilterKeyDown: handleFilterKeyDown,\n onFilterKeyUp: handleFilterKeyUp,\n onFilterBlur: handleFilterBlur,\n searchPlaceholder,\n menuFooter,\n closeMenu,\n commitAndClose,\n searchContainerClass,\n searchInputClass,\n loaderClass,\n isLoading: optionSource.isLoading,\n loadError: optionSource.loadError,\n errorClass,\n searchInputRef,\n menuNodeRef,\n containerRef,\n onReload: optionSource.onReload,\n isReloading: optionSource.isReloading,\n reloadTooltip,\n onInteractionMode: setInteractionMode\n }),\n [ filterQuery, handleFilterInput, handleFilterKeyDown, handleFilterKeyUp, handleFilterBlur,\n searchPlaceholder, menuFooter, closeMenu, commitAndClose, searchContainerClass, searchInputClass,\n loaderClass, errorClass, optionSource.isLoading, optionSource.loadError, optionSource.onReload,\n optionSource.isReloading, reloadTooltip ]\n );\n\n // The synthetic Select-All row is prepended to the option set so it keyboard-navigates like any\n // other row. Keyed on the boolean rather than on `visibleSelectable` itself: react-select rebuilds\n // its whole focusable-option index whenever this array\'s identity changes, so it must churn only\n // when the row genuinely appears or disappears \u2014 not on every keystroke.\n const showSelectAll = Boolean( isMulti ) && visibleSelectable.length >= 2;\n const selectOptions = React.useMemo(\n () => ( showSelectAll\n ? [SELECT_ALL_OPTION].concat( optionSource.options as IOption[])\n : optionSource.options ),\n [ showSelectAll, optionSource.options ]\n );\n\n const customComponents = {\n IndicatorSeparator: () => null,\n DropdownIndicator,\n Option: SelectOption,\n ValueContainer,\n MultiValue,\n MultiValueRemove,\n Input,\n Menu: SelectMenu\n };\n\n // The Select-All row is an affordance over the result set, not a member of it, so it is never\n // query-matched \u2014 whether it renders at all is decided by `showSelectAll` above. Every other row goes\n // through the resolved predicate, handed react-select\'s own candidate so a consumer predicate sees the\n // label react-select built rather than a second-hand reconstruction of it.\n const filterOption = ( candidate: FilterOptionOption<IOption>, input: string ): boolean =>\n ( candidate.data.value === SELECT_ALL_VALUE || isOptionVisible( candidate.data, input, candidate ));\n\n const inputId = useId();\n // unify component type for creatable and default select\n type TRSComponent = ComponentType<ReactSelectProps<IOption, IsMulti, Group>>;\n const SelectType: TRSComponent = creatable\n ? ( CreatableSelect as TRSComponent )\n : ( ReactSelect as TRSComponent );\n\n return (\n <div className={base({ class: className })} ref={rootRef}>\n {label !== undefined && (\n <label\n htmlFor={id || inputId}\n className={labelClass()}\n >\n {label}\n </label>\n )}\n <SelectMenuContext.Provider value={menuContextValue}>\n <SelectOptionContext.Provider value={optionContextValue}>\n <SelectType\n classNamePrefix="select"\n inputId={id || inputId}\n options={selectOptions}\n value={isMulti ? multiControlValue : value}\n hideSelectedOptions={false}\n menuPlacement="auto"\n components={customComponents}\n className={cx( "select", `select-${size}` )}\n styles={\n reactSelectCustomStyles<IsMulti, Group>(\n error,\n size,\n otherRestProps.isMulti as boolean\n )\n }\n isDisabled={disabled}\n {...otherRestProps}\n // Controlled props are applied AFTER the spread so a consumer cannot accidentally\n // override the menu/search mechanism this component owns.\n // A consumer `filterOption` is resolved into this wrapper (see `isOptionVisible`) rather\n // than forwarded, so their predicate still decides every real row while the Select-All row\n // stays exempt from it.\n filterOption={filterOption}\n // Empty when closed \u2014 react-select blanks placeholder/value for a non-empty inputValue.\n inputValue={menuOpen ? filterQuery : ""}\n menuIsOpen={menuOpen}\n onMenuOpen={openMenu}\n /*\n * No-op: react-select calls onMenuClose from its input-blur handler, which\n * fires every time focus moves to the dropdown search input. Honoring it\n * would close the menu immediately. We close explicitly instead \u2014 via\n * outside-click, Escape, and single-select onChange.\n */\n onMenuClose={() => {}}\n onChange={( newValue: unknown, actionMeta: unknown ) => {\n if ( isMulti ) {\n // The control is fed the committed value, so option toggles must route into the draft\n // rather than onChange. Mouse clicks are handled directly in SelectOption; this path\n // only fires for keyboard selection (Enter forwarded to react-select\'s input), which we\n // translate into a draft toggle. The draft is committed when the menu closes via an\n // outside click.\n const meta = actionMeta as { action: string; option?: IOption; removedValue?: IOption };\n // Control-level actions act on the committed value (chips), not the in-menu draft:\n // clearing all, removing a single pill via its X, or popping the last value with\n // Backspace. These commit immediately and notify the consumer; otherwise the change\n // would only land on the next outside-click close (and never reach a controlled\n // `value`). Keyboard option toggles (Enter forwarded to react-select\'s input) are the\n // only path that should buffer into the draft.\n if ( meta.action === "clear" || meta.action === "remove-value" || meta.action === "pop-value" ) {\n setPendingValue( newValue as typeof pendingValue );\n setCommittedValue( newValue as typeof committedValue );\n ( externalOnChange as ( ...args: unknown[]) => void )?.( newValue, actionMeta );\n } else if ( meta.option ) {\n // The injected Select-All row has no dedicated onChange semantics in react-select,\n // so keyboard selection reports it like any option. Route it through the shared\n // handler instead of buffering the synthetic row into the draft.\n if ( meta.option.value === SELECT_ALL_VALUE ) {\n handleSelectAllDraft();\n } else {\n toggleDraftOption( meta.option );\n }\n }\n } else {\n // Close the menu and commit immediately after a single-value selection.\n closeMenu();\n ( externalOnChange as ( ...args: unknown[]) => void )?.( newValue, actionMeta );\n }\n }}\n closeMenuOnSelect={!isMulti}\n />\n </SelectOptionContext.Provider>\n </SelectMenuContext.Provider>\n {helperText && (\n <div className={helperTextClass()}>\n {helperText}\n </div>\n )}\n </div>\n );\n}\n\nconst SelectWithRef = React.forwardRef( SelectComponent );\nSelectWithRef.displayName = "Select";\n\n/**\n * Select component for single or multi selection. The forwarded ref lands on the wrapper `<div>`; the\n * cast is what stops `forwardRef` \u2014 whose own signature is not generic \u2014 from collapsing `IsMulti` /\n * `Group` to their defaults.\n */\nexport const Select = SelectWithRef as unknown as <\n IsMulti extends boolean = false,\n Group extends GroupBase<IOption> = GroupBase<IOption>\n>(\n props: ISelectProps<IsMulti, Group> & RefAttributes<HTMLDivElement>\n) => ReactElement;\n'
2956
3606
  },
2957
3607
  {
2958
3608
  "name": "index.ts",
2959
- "content": 'export { Select, type ISelectProps } from "./select";\nexport { selectVariants } from "./selectVariants";\nexport type { IOption } from "./types";'
3609
+ "content": 'export { Select } from "./select";\nexport { selectVariants } from "./selectVariants";\nexport type { IOption, ISelectProps, TSelectLoadOptions } from "./types";'
2960
3610
  },
2961
3611
  {
2962
3612
  "name": "README.md",
2963
- "content": '# Select Component\n\n## Component Overview\n\nThe Select component provides a dropdown selection interface for choosing one option from a list. It includes search functionality, custom rendering, and keyboard navigation.\n\n**When to use:**\n- Form fields requiring single selection from options\n- Filtering interfaces\n- Settings and preferences selection\n- Any scenario requiring choice from predefined list\n\n**Component Architecture:**\n- Built with @floating-ui for positioning\n- Styled with Tailwind CSS and class-variance-authority (cva)\n- Supports search/filtering\n- Keyboard navigation support\n- Accessible with proper ARIA attributes\n\n## Basic Usage\n\n```tsx\nimport { Select } from "@components";\n\nexport function Example() {\n const options = [\n { label: "Option 1", value: "1" },\n { label: "Option 2", value: "2" },\n { label: "Option 3", value: "3" }\n ];\n \n return (\n <Select \n label="Choose Option"\n options={options}\n onChange={(value) => console.log(value)}\n />\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/select` or `@components/select`.\n\n## Component Props\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `options` | `IOption[] \\| GroupBase<IOption>[]` | `[]` | No | Array of selectable options or option groups |\n| `value` | `IOption \\| IOption[] \\| null` | `undefined` | No | Controlled value (single option or array for multi-select) |\n| `onChange` | `(value: any) => void` | - | No | Callback when selection changes |\n| `label` | `React.ReactNode` | `undefined` | No | Label displayed above the select |\n| `size` | `\'md\' \\| \'lg\'` | `\'md\'` | No | Select size variant |\n| `helperText` | `React.ReactNode` | `undefined` | No | Helper text displayed below the select |\n| `error` | `boolean` | `false` | No | Display error styling |\n| `disabled` | `boolean` | `false` | No | Disable the select |\n| `creatable` | `boolean` | `false` | No | Enable creatable select (allows creating new options) |\n| `touched` | `boolean` | `undefined` | No | Field touched state (useful for form validation) |\n| `maxVisibleValues` | `number` | `3` | No | Max number of visible values in multi-select before truncating |\n| `maxVisibleValuesMsg` | `string` | `undefined` | No | Label for truncated values (e.g., "+2 more") |\n| `menuFooter` | `React.ReactNode` | `undefined` | No | Custom footer content in the dropdown menu |\n| `prefixIcon` | `IconType \\| React.ReactNode` | `undefined` | No | Icon displayed at the start of the select control |\n| `suffixIcon` | `IconType \\| React.ReactNode` | `undefined` | No | Icon displayed at the end of the select control |\n| `id` | `string` | `undefined` | No | Unique id for the select input |\n| `placeholder` | `string` | `"Select..."` | No | Placeholder text |\n| `isSearchable` | `boolean` | `true` | No | Enable search/filter functionality |\n| `isClearable` | `boolean` | `false` | No | Show clear button |\n| `isMulti` | `boolean` | `false` | No | Enable multi-select mode |\n| `className` | `string` | `undefined` | No | Additional CSS classes for wrapper |\n\n### Option Object (IOption)\n\n| Property | Type | Required | Description |\n|----------|------|----------|-------------|\n| `label` | `string` | Yes | Display text for option |\n| `value` | `any` | Yes | Value of the option |\n| `disabled` | `boolean` | No | Whether option is disabled |\n\n## Practical Examples\n\n### Form Field\n\n```tsx\nimport { Select } from "@components";\nimport { useState } from "react";\n\nfunction FormWithSelect() {\n const [country, setCountry] = useState("");\n \n const countries = [\n { label: "United States", value: "us" },\n { label: "Canada", value: "ca" },\n { label: "United Kingdom", value: "uk" },\n { label: "Germany", value: "de" }\n ];\n \n return (\n <form>\n <Select\n label="Country"\n options={countries}\n value={country}\n onChange={setCountry}\n required\n searchable\n />\n </form>\n );\n}\n```\n\n### Filter with Clear\n\n```tsx\nimport { Select } from "@components";\nimport { useState } from "react";\n\nfunction FilterSelect() {\n const [status, setStatus] = useState("");\n \n const statusOptions = [\n { label: "Active", value: "active" },\n { label: "Inactive", value: "inactive" },\n { label: "Pending", value: "pending" }\n ];\n \n return (\n <Select\n label="Filter by Status"\n options={statusOptions}\n value={status}\n onChange={setStatus}\n clearable\n placeholder="All statuses"\n />\n );\n}\n```\n\n### Disabled State\n\n```tsx\n<Select\n label="Disabled Select"\n options={options}\n disabled\n value="option1"\n/>\n```\n\n## Technical Details\n\n### State Management\n\n- Supports both controlled and uncontrolled modes\n- Use `value` + `onChange` for controlled\n- Use `defaultValue` for uncontrolled\n\n## Accessibility\n\n**Implemented:**\n- ARIA attributes for screen readers\n- Keyboard navigation (Arrow keys, Enter, ESC)\n- Focus management\n- Proper labeling\n\n**Best Practices:**\n- Always provide a label\n- Use descriptive option labels\n- Mark required fields\n- Provide error messages\n'
3613
+ "content": '# Select Component\n\n## Component Overview\n\nThe Select component provides a dropdown selection interface for choosing one option from a list. It includes search functionality, custom rendering, and keyboard navigation.\n\n**When to use:**\n- Form fields requiring single selection from options\n- Filtering interfaces\n- Settings and preferences selection\n- Any scenario requiring choice from predefined list\n\n**Component Architecture:**\n- Built on `react-select`, which handles positioning (`menuPlacement="auto"`) and keyboard navigation\n- Styled with Tailwind CSS and `tailwind-variants` (`tv()`)\n- Search input lives inside the dropdown; filtering is client-side by default, or delegated to the\n parent via `onFilterChange` (see [Filtering](#filtering))\n- Accessible with proper ARIA attributes\n\n## Basic Usage\n\n```tsx\nimport { Select } from "@components";\n\nexport function Example() {\n const options = [\n { label: "Option 1", value: "1" },\n { label: "Option 2", value: "2" },\n { label: "Option 3", value: "3" }\n ];\n \n return (\n <Select \n label="Choose Option"\n options={options}\n onChange={(value) => console.log(value)}\n />\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/select` or `@components/select`.\n\n## Component Props\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `options` | `IOption[] \\| GroupBase<IOption>[]` | `[]` | No | Array of selectable options or option groups |\n| `value` | `IOption \\| IOption[] \\| null` | `undefined` | No | Controlled value (single option or array for multi-select) |\n| `onChange` | `(value: any) => void` | - | No | Callback when selection changes |\n| `label` | `React.ReactNode` | `undefined` | No | Label displayed above the select |\n| `size` | `\'md\' \\| \'lg\'` | `\'md\'` | No | Select size variant |\n| `helperText` | `React.ReactNode` | `undefined` | No | Helper text displayed below the select |\n| `error` | `boolean` | `false` | No | Display error styling |\n| `disabled` | `boolean` | `false` | No | Disable the select |\n| `creatable` | `boolean` | `false` | No | Enable creatable select (allows creating new options) |\n| `touched` | `boolean` | `undefined` | No | Field touched state (useful for form validation) |\n| `maxVisibleValues` | `number` | `3` | No | Max number of visible values in multi-select before truncating |\n| `maxVisibleValuesMsg` | `string` | `undefined` | No | Label for truncated values (e.g., "+2 more") |\n| `menuFooter` | `React.ReactNode` | `undefined` | No | Custom footer content in the dropdown menu |\n| `searchPlaceholder` | `string` | `"Search..."` | No | Placeholder for the search input inside the dropdown |\n| `filterValue` | `string` | `undefined` | No | Seeds the dropdown\'s search input and re-syncs it whenever this value changes (not fully controlled \u2014 see [Filtering](#filtering)) |\n| `onFilterChange` | `(query: string) => void` | - | No | Server-side filter handler. When provided, client-side filtering is skipped |\n| `filterDebounceMs` | `number` | `300` | No | Debounce delay (ms) for `onFilterChange`. Set to `0` to fire synchronously |\n| `isLoading` | `boolean` | `false` | No | Replaces the option list with a loader while a fetch is in flight |\n| `loadOptions` | `(query: string, meta: ILoadOptionsMeta) => Promise<IOption[] \\| IOptionPage<IOption>>` | - | No | Async option source. Switches the component into [async mode](#filtering--async-loading): it owns the option list, the request lifecycle and the loading state |\n| `initialOptions` | `readonly IOption[]` | `undefined` | No | Seed rows for a list you already have (SSR payload, route loader, warm cache). Painted on the first frame and kept on screen while the baseline fetch revalidates over them \u2014 see [Seeding with `initialOptions`](#seeding-with-initialoptions). Async mode only |\n| `prefetch` | `"mount" \\| "open" \\| "never"` | `"open"` | No | When to fetch the unfiltered baseline. `"open"` on first menu open; `"mount"` at render, before any interaction; `"never"` only once the user types. Async mode only |\n| `refetchOnClear` | `boolean` | `false` | No | Clearing the search revalidates the cached baseline instead of only restoring it. Costs one request per menu close |\n| `optionsKey` | `string \\| number` | `undefined` | No | Identity of the option set, for dependent selects. A change drops cached results and repopulates. Does **not** clear the selection |\n| `loadErrorMessage` | `React.ReactNode` | `"Couldn\'t load options."` | No | Shown in the menu when `loadOptions` rejects |\n| `showReloadButton` | `boolean` | `false` | No | Shows the menu\'s reload button in async mode, wired to re-run the current query |\n| `onLoadError` | `(error: unknown) => void` | - | No | Notified when a load rejects (the component renders `loadErrorMessage` and swallows it) |\n| `onReload` | `() => void` | - | No | Shows a reload button in the dropdown header; fired on click |\n| `isReloading` | `boolean` | `undefined` | No | Spins and disables the reload button |\n| `reloadTooltip` | `string` | `"Reload"` | No | Tooltip / aria-label for the reload button |\n| `prefixIcon` | `IconType \\| React.ReactNode` | `undefined` | No | Icon displayed at the start of the select control |\n| `suffixIcon` | `IconType \\| React.ReactNode` | `undefined` | No | Icon displayed at the end of the select control |\n| `id` | `string` | `undefined` | No | Unique id for the select input |\n| `placeholder` | `string` | `"Select..."` | No | Placeholder text |\n| `isClearable` | `boolean` | `false` | No | Show clear button |\n| `isMulti` | `boolean` | `false` | No | Enable multi-select mode |\n| `className` | `string` | `undefined` | No | Additional CSS classes for wrapper |\n| `ref` | `Ref<HTMLDivElement>` | `undefined` | No | Forwarded to the wrapper `<div>` \u2014 for programmatic focus/scroll and form libraries that bind by ref |\n\n### Option Object (IOption)\n\n| Property | Type | Required | Description |\n|----------|------|----------|-------------|\n| `label` | `ReactNode` | Yes | Display content for the option (plain text or custom JSX) |\n| `value` | `any` | Yes | Value of the option |\n| `searchValue` | `string` | No | Plain text used for search matching. Set this when `label` is custom JSX, otherwise the option can\'t be found by typing its visible text. Takes precedence over `label`/`value`. |\n| `isDisabled` | `boolean` | No | Whether option is disabled |\n\n## Filtering & async loading\n\nThree modes, picked by which props you pass:\n\n| Mode | Pass | Who filters | Who fetches |\n|---|---|---|---|\n| **Client-side** (default) | nothing | Select, via `matchesQuery` | \u2014 |\n| **You own the list** | `onFilterChange` + `options` | you | you (if any) |\n| **Async** | `loadOptions` | your server | Select |\n\n- **Client-side** \u2014 the search box filters `options` locally. Matching checks an option\'s `searchValue`\n first, then a string `label`, then its `value` \u2014 set `searchValue` on options whose `label` is custom\n JSX so they stay findable by their visible text.\n- **`onFilterChange`** \u2014 Select stops filtering and hands you the (debounced) query; whatever you pass\n as `options` is taken as the answer for it. Use it to fetch from a server, **and equally for a\n local list whose matching rules are your own** (fuzzy, scoped to a field, ranked) \u2014 pair it with\n `filterDebounceMs={0}` and no fetch. Pass `isLoading` while a fetch is in flight.\n- **`loadOptions`** \u2014 for a server-backed list you don\'t want to hold in state: Select owns the option\n list, the request lifecycle and the loading state. `options` is ignored (dev warning) and\n `onFilterChange`, if still passed, becomes notification-only. See [Async mode](#async-mode-loadoptions).\n\n```tsx\nfunction ServerSideSelect() {\n const [options, setOptions] = useState<IOption[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n\n const handleFilterChange = async (query: string) => {\n setIsLoading(true);\n setOptions(await fetchOptions(query));\n setIsLoading(false);\n };\n\n return (\n <Select\n label="User"\n placeholder="Select a user..."\n options={options}\n onFilterChange={handleFilterChange}\n filterDebounceMs={300}\n isLoading={isLoading}\n />\n );\n}\n```\n\nBehaviour worth knowing:\n\n- **The query is cleared when the dropdown closes, and `onFilterChange("")` fires** (only if the\n query was non-empty), so your `options` never stay filtered by a query the user can no longer see.\n Any pending debounced query is dropped first, so the reset always wins.\n- A pending debounce is also cancelled on unmount and whenever `filterValue` changes.\n- **Backspace/Delete holds defer the debounce.** The OS key-repeat gap (~500ms) is longer than the\n default `filterDebounceMs` (300), so debouncing each mid-hold change would fire `onFilterChange`\n with a half-cleared query before the key is released. While either key is held the input still\n updates live, but the debounce only starts on keyup (or blur if focus leaves mid-hold).\n- **`filterValue` is a seed plus an external sync, not a fully controlled value.** The search box\n owns its own text: it updates as the user types and when the component clears it on close. Passing\n a *new* `filterValue` overwrites it; re-passing the same one does not pull it back. Wiring\n `onFilterChange` back into the state you pass as `filterValue` keeps the two in step.\n- **`isLoading` replaces the option list with a loader**, keeping the search input and `menuFooter` in\n place. The rows underneath belong to the previous query, so leaving them clickable would let the\n user pick an option the incoming result set no longer contains. It also means an empty-and-loading\n dropdown shows the loader alone rather than "No options". Arrow/Enter are ignored for the same\n reason while the loader is up \u2014 otherwise the keyboard could still reach a row that is off screen.\n- `isLoading` is **not forwarded to react-select**, so its own control indicator and "Loading..."\n message never appear and `loadingMessage` has no effect.\n- **"Select All"** (multi-select) covers the options the active search leaves **visible** \u2014 in server\n mode, every option the server returned for the current query. It is not "all server-side matches".\n The row itself is never query-matched, so it stays put while you type; it is hidden only when\n fewer than two selectable options are on screen, where it would duplicate a single row\'s own\n checkbox or have nothing to act on. Toggling it off removes only those visible options, so a\n selection made under an earlier query survives. **Grouped options are included**: groups are\n flattened, so a list that mixes loose options and groups is covered in render order.\n- With `creatable`, the Create row is no longer auto-suppressed while loading (react-select gates\n that on the `isLoading` it never receives). Gate it with `isValidNewOption` if you need that. In\n server mode the Create row is also matched against the *loaded* options, which lag the query by\n `filterDebounceMs`, so it can flash mid-typing.\n- Never pass `noOptionsMessage={() => null}` \u2014 react-select bails out of rendering the menu entirely\n and the dropdown, search input included, disappears.\n\n## Async mode (`loadOptions`)\n\nServer-side filtering above is a two-part contract: the component debounces the query, you own the\nresults. But **debouncing limits how often a request starts, not how many are in flight** \u2014 type\n`sal`, pause past the debounce, type `es`, and if the first response arrives last it overwrites the\nsecond. Every server-filtered call site therefore has to hand-write the same monotonic-ticket guard,\nand the one that forgets ships a bug that is invisible on a fast connection.\n\n`loadOptions` moves that, the results state and the `isLoading` bookkeeping into the component:\n\n```tsx\n<Select\n label="Dataset"\n isMulti\n loadOptions={async (query, { signal }) => {\n const res = await fetchDatasets({ filterExpression: `DatasetName:*${query}*`, signal });\n return res.datasets\n .filter(isWriteAccessible) // domain rules stay yours\n .map((d) => ({ value: d.DatasetId, label: `${d.Domain} : ${d.DisplayName}`, name: d.DatasetName }));\n }}\n/>\n```\n\n`loadOptions` **fetches and maps**. Response envelopes, pagination shapes and domain filtering are all\nthe consumer\'s business \u2014 the component never sees the raw payload. A fresh inline arrow costs nothing:\nthe loader is read through a ref, so it never re-triggers a fetch or invalidates a memo.\n\n`meta` carries `{ signal, cursor, page, reason }`. Return either a bare `IOption[]` or a page envelope\n`{ options, cursor?, hasMore?, total? }`.\n\nBehaviour worth knowing:\n\n1. **Ordering is guaranteed.** A response is accepted only if it is still the newest request for its\n slot. Honouring `meta.signal` is **optional** \u2014 it only saves you paying for a response nobody\n wants; correctness comes from the internal guard either way.\n2. **Clearing the search restores the cached baseline, with no request.** The empty-query result and\n the current-query result live in separate buckets, so a menu close (which fires\n `onFilterChange("")`) restores rather than destroys. Pass `refetchOnClear` to *also* revalidate;\n the stale rows stay on screen while that request runs, so the list never blanks.\n3. **`filterValue` does not trigger fetches in async mode.** The shared filter hook deliberately\n cancels the debounce *without* notifying when `filterValue` changes, so a programmatic query change\n updates the search box only. Changing that would alter `MultiSelectTransfer`\'s behaviour too. If you\n need to force a reload, use `optionsKey`.\n4. **`optionsKey` does not clear the committed selection.** Whether a stale child value is invalid is a\n domain rule, and clearing a controlled `value` from inside the component means firing an `onChange`\n the consumer never asked for \u2014 unblockable in Formik or React Hook Form. **Watch for this:** options\n pass through opaquely, so a stale selection renders its own label perfectly and fails silently at\n submit. Clear it yourself in the parent when your domain says it is invalid.\n5. **Page one only.** `cursor` / `hasMore` / `total` in the resolved page are ignored, and a page\n reporting `hasMore: true` raises a one-time dev warning \u2014 there is no infinite-scroll surface in\n react-select\'s menu. Use `MultiSelectTransfer` for a paged source.\n6. **Option groups are unsupported in async mode.** The loader returns `readonly IOption[]`; groups are\n a sync-mode-only shape.\n7. **"Select All"** (multi-select) still covers only what is currently loaded and visible \u2014 every\n option the server returned for the current query, not "all server-side matches".\n8. A rejection replaces the rows with `loadErrorMessage` in `role="alert"`, blocks Arrow/Enter for the\n same reason the loader does, and auto-shows the reload button as the retry affordance. `onLoadError`\n receives the raw cause for logging.\n\n### Seeding with `initialOptions`\n\n`initialOptions` is for the case where **you already have the rows** \u2014 an SSR payload, a route loader, a\nwarm query cache. They are painted on the first frame, so there is no loader to sit through, and they stay\non screen while the baseline fetch revalidates over them. This is the one thing `prefetch` cannot do:\n`prefetch="mount"` still costs a round trip before anything appears.\n\n```tsx\n<Select\n label="Dataset"\n initialOptions={ssrDatasets} // painted immediately\n loadOptions={fetchDatasets} // still runs, and replaces them when it lands\n/>\n```\n\nIt does **not** suppress the baseline fetch. If the seed *is* the whole list until the user types \u2014 a heavy\nsource you do not want to hit on open \u2014 pair it with `prefetch="never"`:\n\n```tsx\n<Select initialOptions={recentlyUsed} prefetch="never" loadOptions={searchEverything} />\n```\n\nWithout `initialOptions`, that combination opens to an empty menu.\n\nA *search* replaces seed rows, because they are not results for a query; clearing the search brings them\nback until a fetched baseline lands. And seed rows only mean something to the async source \u2014 passing\n`initialOptions` without `loadOptions` is ignored with a dev warning, because those rows belong in\n`options`.\n\n`prefetch` is async-only for the same reason: it schedules the baseline fetch and nothing else, so\nwithout `loadOptions` there is no fetch to schedule. Passing it there is ignored with a dev warning.\n\n## Practical Examples\n\n### Form Field\n\n```tsx\nimport { Select } from "@components";\nimport { useState } from "react";\n\nfunction FormWithSelect() {\n const [country, setCountry] = useState("");\n \n const countries = [\n { label: "United States", value: "us" },\n { label: "Canada", value: "ca" },\n { label: "United Kingdom", value: "uk" },\n { label: "Germany", value: "de" }\n ];\n \n return (\n <form>\n <Select\n label="Country"\n options={countries}\n value={country}\n onChange={setCountry}\n required\n searchable\n />\n </form>\n );\n}\n```\n\n### Filter with Clear\n\n```tsx\nimport { Select } from "@components";\nimport { useState } from "react";\n\nfunction FilterSelect() {\n const [status, setStatus] = useState("");\n \n const statusOptions = [\n { label: "Active", value: "active" },\n { label: "Inactive", value: "inactive" },\n { label: "Pending", value: "pending" }\n ];\n \n return (\n <Select\n label="Filter by Status"\n options={statusOptions}\n value={status}\n onChange={setStatus}\n clearable\n placeholder="All statuses"\n />\n );\n}\n```\n\n### Disabled State\n\n```tsx\n<Select\n label="Disabled Select"\n options={options}\n disabled\n value="option1"\n/>\n```\n\n## Technical Details\n\n### State Management\n\n- Supports both controlled and uncontrolled modes\n- Use `value` + `onChange` for controlled\n- Use `defaultValue` for uncontrolled\n- The search query is owned internally and seeded from `filterValue`; a *change* to `filterValue`\n overwrites it and cancels any in-flight debounced `onFilterChange`\n\n### Filtering\n\n- Without `onFilterChange`, options are filtered locally via the shared `matchesQuery` helper, which\n is also used by `TransferList` and `MultiSelectTransfer`.\n- With `onFilterChange`, filtering is delegated to the parent and the query is debounced\n (`filterDebounceMs`). A pending debounce is cancelled on unmount, on an external `filterValue`\n reset, and when the dropdown closes \u2014 where `onFilterChange("")` fires instead so the parent\'s\n result set matches the now-empty search box. While Backspace/Delete is held the debounce is\n deferred until keyup (or blur), so a long-press cannot fire mid-hold. This lives in the shared\n `useFilterQuery` hook, which `MultiSelectTransfer` also uses, so its identically-named filter\n props behave identically.\n- `isLoading` renders the loader in place of react-select\'s menu list, which also keeps it out of the\n list\'s `role="listbox"` subtree (that role only accepts option children). Suppressing the "No\n options" notice this way is deliberate: returning `null` from react-select\'s `noOptionsMessage`\n makes it skip rendering the menu altogether, taking the search input with it.\n- `MultiSelectTransfer` behaves the same for a search fetch, but keeps appending the loader below the\n rows for a load-more it triggered itself, so pagination doesn\'t lose the scroll position.\n\n## Accessibility\n\n**Implemented:**\n- ARIA attributes for screen readers\n- Keyboard navigation (Arrow keys, Enter, ESC)\n- Focus management\n- Proper labeling\n\n**Best Practices:**\n- Always provide a label\n- Use descriptive option labels\n- Mark required fields\n- Provide error messages\n'
2964
3614
  }
2965
3615
  ],
2966
3616
  "directories": []
@@ -2979,11 +3629,11 @@ export const scrollbarVariants = tv({
2979
3629
  "files": [
2980
3630
  {
2981
3631
  "name": "tabsVariants.ts",
2982
- "content": 'import { tv } from "tailwind-variants";\n\nconst scrollbarStyles = [\n "scrollbar-width-thin",\n "[&::-webkit-scrollbar-thumb]:rounded-[5px]",\n "[&::-webkit-scrollbar]:w-[0.2rem]",\n "md:[&::-webkit-scrollbar]:w-[0rem]",\n "[&::-webkit-scrollbar]:h-[0rem]",\n "md:[&::-webkit-scrollbar]:h-[0.3em]",\n "[&::-webkit-scrollbar]:translate-y-2"\n];\n\nexport const tabsVariants = tv({\n slots: {\n root: "w-full",\n list: [\n "w-full list-none overflow-x-auto overflow-y-hidden whitespace-nowrap",\n "grid grid-flow-col justify-start z-10",\n "text-secondary-500",\n ...scrollbarStyles\n ],\n listItem: "flex items-center justify-center cursor-pointer rounded-none focus:outline-none disabled:cursor-not-allowed",\n content: "dark:text-white"\n },\n variants: {\n size: {\n xs: { listItem: "p-2 text-xs" },\n sm: { listItem: "px-1.5 py-1 text-sm" },\n md: { listItem: "px-2.5 py-2 text-md" },\n lg: { listItem: "p-3.5 text-lg" },\n xl: { listItem: "p-[18px] text-xl" }\n },\n variant: {\n text: {\n list: "mb-[-2px]",\n listItem: [\n "px-4",\n "border-0",\n "dark:text-white",\n "hover:text-primary-500",\n "dark:hover:text-primary-400",\n "dark:disabled:hover:text-secondary-300",\n "disabled:text-secondary-300",\n "dark:disabled:text-secondary-300",\n "disabled:hover:bg-transparent"\n ]\n },\n brick: {\n list: "mb-[-2px]",\n listItem: [\n "first:rounded-l last:rounded-r",\n "first:rtl:rounded-l-none first:rtl:rounded-r",\n "last:rtl:rounded-r-none last:rtl:rounded-l",\n "first:border-l-2",\n "first:rtl:border-l-0",\n "last:rtl:border-l-2",\n "px-4",\n "border-y-2",\n "border-r-2",\n "border-secondary-100",\n "hover:text-primary-500",\n "dark:hover:text-primary-400",\n "dark:disabled:hover:text-secondary-300",\n "dark:first:border-l-0 dark:last:border-r-0 dark:border-t-0 dark:border-b-0",\n "dark:last:rtl:border-r-2",\n "dark:bg-secondary-50",\n "disabled:text-secondary-300",\n "disabled:hover:bg-secondary-50"\n ]\n },\n filled: {\n listItem: "first:rounded-l last:rounded-r first:rtl:rounded-l-none first:rtl:rounded-r last:rtl:rounded-r-none last:rtl:rounded-l"\n }\n },\n color: {\n primary: {},\n secondary: {}\n },\n active: {\n true: {},\n false: {}\n }\n },\n compoundVariants: [\n // List variants\n {\n variant: "brick",\n color: "primary",\n class: { list: "border-gray-200" }\n },\n {\n variant: "filled",\n color: "primary",\n class: { list: "border-primary-500" }\n },\n {\n variant: "filled",\n color: "secondary",\n class: { list: "divide-gray-200 divide-x dark:divide-secondary-500" }\n },\n // Non-active filled variant styles\n {\n variant: "filled",\n color: "primary",\n active: false,\n class: {\n listItem: [\n "text-white",\n "bg-primary-500",\n "hover:bg-primary-700",\n "focus-visible:bg-primary-400",\n "active:bg-primary-500",\n "disabled:bg-primary-200",\n "disabled:text-white",\n "focus-visible:ring",\n "focus-visible:ring-[#99CBFA]",\n "focus-visible:active:bg-primary-500"\n ]\n }\n },\n {\n variant: "filled",\n color: "secondary",\n active: false,\n class: {\n listItem: [\n "bg-gray-100",\n "hover:bg-gray-300",\n "focus-visible:bg-gray-200",\n "active:bg-gray-100",\n "disabled:bg-gray-100",\n "disabled:text-secondary-300",\n "focus-visible:ring",\n "focus-visible:ring-gray-100",\n "focus-visible:active:bg-gray-100"\n ]\n }\n },\n // Active variant styles\n {\n variant: "text",\n active: true,\n class: {\n listItem: [\n "border-b-2 font-regular border-primary-500 dark:border-secondary-100",\n "text-primary-500 dark:hover:text-white dark:text-white bg-primary-50 dark:bg-primary-400"\n ]\n }\n },\n {\n variant: "brick",\n active: true,\n class: {\n listItem: [\n "text-primary-500 dark:text-white bg-primary-50",\n "dark:hover:text-white dark:text-white dark:bg-primary-400",\n "first:rtl:border-r-primary-50 first:rtl:dark:border-r-primary-400",\n "last:rtl:border-l-primary-50 last:rtl:dark:border-l-primary-400"\n ]\n }\n },\n {\n variant: "filled",\n color: "primary",\n active: true,\n class: { listItem: "border-primary-200 dark:text-white font-regular !bg-primary-700 text-white" }\n },\n {\n variant: "filled",\n color: "secondary",\n active: true,\n class: { listItem: "border-gray-200 font-regular !bg-primary-500 dark:!bg-primary-400 text-secondary-50 dark:text-white" }\n }\n ],\n defaultVariants: {\n size: "md",\n variant: "text",\n color: "secondary",\n active: false\n }\n});\n'
3632
+ "content": 'import { tv } from "tailwind-variants";\n\nconst scrollbarStyles = [\n "scrollbar-width-thin",\n "[&::-webkit-scrollbar-thumb]:rounded-[5px]",\n "[&::-webkit-scrollbar]:w-[0.2rem]",\n "md:[&::-webkit-scrollbar]:w-[0rem]",\n "[&::-webkit-scrollbar]:h-[0rem]",\n "md:[&::-webkit-scrollbar]:h-[0.3em]",\n "[&::-webkit-scrollbar]:translate-y-2"\n];\n\nexport const tabsVariants = tv({\n slots: {\n root: "w-full",\n list: [\n "w-full list-none overflow-x-auto overflow-y-hidden whitespace-nowrap",\n "grid grid-flow-col justify-start z-10",\n "text-secondary-500",\n ...scrollbarStyles\n ],\n listItem: "flex items-center justify-center cursor-pointer rounded-none focus:outline-none disabled:cursor-not-allowed",\n content: "dark:text-white"\n },\n variants: {\n size: {\n xs: { listItem: "p-2 text-xs" },\n sm: { listItem: "px-1.5 py-1 text-sm" },\n md: { listItem: "px-2.5 py-2 text-md" },\n lg: { listItem: "p-3.5 text-lg" },\n xl: { listItem: "p-[18px] text-xl" }\n },\n variant: {\n text: {\n list: "mb-[-2px]",\n listItem: [\n "px-4",\n "border-0",\n "dark:text-white",\n "hover:text-primary-700",\n "dark:hover:text-primary-400",\n "dark:disabled:hover:text-secondary-300",\n "disabled:text-secondary-300",\n "dark:disabled:text-secondary-300",\n "disabled:hover:bg-transparent"\n ]\n },\n brick: {\n list: "mb-[-2px]",\n listItem: [\n "first:rounded-l last:rounded-r",\n "first:rtl:rounded-l-none first:rtl:rounded-r",\n "last:rtl:rounded-r-none last:rtl:rounded-l",\n "first:border-l-2",\n "first:rtl:border-l-0",\n "last:rtl:border-l-2",\n "px-4",\n "border-y-2",\n "border-r-2",\n "border-secondary-100",\n "hover:text-primary-700",\n "dark:hover:text-primary-400",\n "dark:disabled:hover:text-secondary-300",\n "dark:first:border-l-0 dark:last:border-r-0 dark:border-t-0 dark:border-b-0",\n "dark:last:rtl:border-r-2",\n "dark:bg-secondary-50",\n "disabled:text-secondary-300",\n "disabled:hover:bg-secondary-50"\n ]\n },\n filled: {\n listItem: "first:rounded-l last:rounded-r first:rtl:rounded-l-none first:rtl:rounded-r last:rtl:rounded-r-none last:rtl:rounded-l"\n },\n contained: {\n list: "bg-gray-100 border border-gray-200 dark:bg-secondary-700 dark:border-secondary-500 rounded-sm p-1 w-fit mb-4 gap-1",\n listItem: [\n "px-3",\n "py-1.5",\n "border",\n "border-transparent",\n "text-secondary-400",\n "dark:text-secondary-300",\n "hover:bg-frostBlue",\n "dark:hover:bg-secondary-600",\n "focus-visible:border-primary-500",\n "focus-visible:bg-primary-50",\n "dark:focus-visible:border-primary-400",\n "dark:focus-visible:bg-primary-900",\n "disabled:text-secondary-400",\n "dark:disabled:text-secondary-300",\n "disabled:hover:bg-transparent",\n "dark:disabled:hover:bg-transparent",\n "disabled:opacity-40",\n "transition-colors"\n ]\n }\n },\n color: {\n primary: {},\n secondary: {}\n },\n active: {\n true: {},\n false: {}\n }\n },\n compoundVariants: [\n // List variants\n {\n variant: "brick",\n color: "primary",\n class: { list: "border-gray-200" }\n },\n {\n variant: "filled",\n color: "primary",\n class: { list: "border-primary-500" }\n },\n {\n variant: "filled",\n color: "secondary",\n class: { list: "divide-gray-200 divide-x dark:divide-secondary-500" }\n },\n // Non-active filled variant styles\n {\n variant: "filled",\n color: "primary",\n active: false,\n class: {\n listItem: [\n "text-white",\n "bg-primary-500",\n "hover:bg-primary-700",\n "focus-visible:bg-primary-400",\n "active:bg-primary-500",\n "disabled:bg-primary-200",\n "disabled:text-white",\n "focus-visible:ring",\n "focus-visible:ring-[#99CBFA]",\n "focus-visible:active:bg-primary-500"\n ]\n }\n },\n {\n variant: "filled",\n color: "secondary",\n active: false,\n class: {\n listItem: [\n "bg-gray-100",\n "hover:bg-gray-300",\n "focus-visible:bg-gray-200",\n "active:bg-gray-100",\n "disabled:bg-gray-100",\n "disabled:text-secondary-300",\n "focus-visible:ring",\n "focus-visible:ring-gray-100",\n "focus-visible:active:bg-gray-100"\n ]\n }\n },\n // Active variant styles\n {\n variant: "text",\n active: true,\n class: {\n listItem: [\n "border-b-2 font-regular border-primary-500 dark:border-secondary-100",\n "text-primary-700 dark:hover:text-white dark:text-white bg-primary-100 dark:bg-primary-400"\n ]\n }\n },\n {\n variant: "brick",\n active: true,\n class: {\n listItem: [\n "text-primary-700 dark:text-white bg-primary-100",\n "dark:hover:text-white dark:text-white dark:bg-primary-400",\n "first:rtl:border-r-primary-50 first:rtl:dark:border-r-primary-400",\n "last:rtl:border-l-primary-50 last:rtl:dark:border-l-primary-400"\n ]\n }\n },\n {\n variant: "filled",\n color: "primary",\n active: true,\n class: { listItem: "border-primary-200 dark:text-white font-regular !bg-primary-700 text-white" }\n },\n {\n variant: "filled",\n color: "secondary",\n active: true,\n class: { listItem: "border-gray-200 font-regular !bg-primary-700 dark:!bg-primary-400 text-secondary-50 dark:text-white" }\n },\n {\n variant: "contained",\n active: true,\n class: {\n listItem: [\n "bg-white",\n "hover:bg-white",\n "text-secondary-500",\n "rounded-sm",\n "shadow-sm",\n "dark:bg-secondary-500",\n "dark:hover:bg-secondary-500",\n "dark:text-white"\n ]\n }\n }\n ],\n defaultVariants: {\n size: "md",\n variant: "text",\n color: "secondary",\n active: false\n }\n});\n'
2983
3633
  },
2984
3634
  {
2985
3635
  "name": "tabs.tsx",
2986
- "content": 'import * as React from "react";\nimport {\n Children,\n createRef,\n useEffect,\n useRef,\n useState,\n isValidElement,\n type ReactElement,\n type RefObject\n} from "react";\n\nimport { tabsVariants } from "./tabsVariants";\nimport { keyboardKeys } from "@constants";\n\nexport enum ETabSizes {\n XS = "xs",\n SM = "sm",\n MD = "md",\n LG = "lg"\n}\nexport type TTabSize = `${ETabSizes}`;\n\n/**\n * Props for the Tab component.\n */\nexport interface ITabProps {\n /**\n * Id of the tab.\n */\n id?: string;\n /**\n * Name of the tab.\n */\n title: React.ReactNode;\n /**\n * Function to call when the tab is displayed.\n */\n onEnter?: () => void;\n /**\n * Function to call when the tab is exited.\n */\n onExit?: () => void;\n /**\n * Dynamically updates the className applied to the component.\n */\n className?: string;\n /**\n * Content to be displayed within the tab.\n */\n children: React.ReactNode;\n /**\n * Indicates whether the tab is disabled.\n */\n disabled?: boolean;\n /**\n * Icon to be displayed before the title of the Tab.\n * @description\n * This prop accepts either an IconType (string) or a ReactNode.\n * - If an IconType is provided, it will be rendered as-is.\n * - If a ReactNode is provided, it will be rendered as-is.\n */\n prefixIcon?: React.ReactNode;\n /**\n * Icon to be displayed after the title of the Tab.\n * @description\n * This prop accepts either an IconType (string) or a ReactNode.\n * - If an IconType is provided, it will be rendered as-is.\n * - If a ReactNode is provided, it will be rendered as-is.\n */\n suffixIcon?: React.ReactNode;\n}\n\nexport const Tab = React.forwardRef<HTMLDivElement, ITabProps>(\n ({ children, className }, ref ) => (\n <div ref={ref} className={className}>\n {children}\n </div>\n )\n);\nTab.displayName = "Tab";\n\n/**\n * Props for the Tabs component.\n */\nexport interface ITabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {\n /**\n * Active tab index. Tab index starts from 0.\n */\n activeIndex?: number;\n /**\n * Default active tab index, to be used with the uncontrolled version of the Tabs component.\n * @default 0\n */\n defaultActiveIndex?: number;\n /**\n * Dynamically updates the className applied to the component.\n */\n className?: string;\n /**\n * Renders all the tabs at once and switches between them using CSS.\n * @default false\n */\n switchUsingCss?: boolean;\n /**\n * Called on click of a tab header.\n * @param selectedTabIndex {number} Selected tab index.\n */\n onSelect?: ( selectedTabIndex: number ) => void;\n /**\n * Array of items to be displayed in the Tabs,\n * each item should be wrapped in Tabs.Tab component\n * @required\n * @example\n * ```tsx\n * <Tabs>\n * <Tabs.Tab title="Tab 1">Content of Tab 1</Tabs.Tab>\n * </Tabs>\n * ```\n */\n children:\n | ReactElement<ITabProps>\n | Array<ReactElement<ITabProps> | boolean>\n | boolean;\n /**\n * Size of the tab.\n * @default md\n */\n size?: TTabSize;\n /**\n * Variant of the tab.\n * @default text\n */\n variant?: "filled" | "text" | "brick";\n /**\n * Color of the tab. Only applicable for filled variant.\n */\n color?: "primary" | "secondary";\n}\n\nconst filterChildren = (\n children: ITabsProps["children"]\n): Array<ReactElement<ITabProps>> => {\n return Children.toArray( children ).filter(\n ( child ) =>\n isValidElement( child ) &&\n child.type === Tab &&\n child.props.title !== undefined\n ) as Array<ReactElement<ITabProps>>;\n};\n\nconst TabsComponent = React.forwardRef<HTMLDivElement, ITabsProps>(\n (\n {\n className,\n children,\n activeIndex,\n defaultActiveIndex = 0,\n switchUsingCss = false,\n onSelect,\n size = "md",\n variant = "text",\n color = "secondary",\n ...props\n },\n ref\n ) => {\n const [ activeIdx, setActiveIdx ] = useState<number>(() => {\n const childArray = Children.toArray( children );\n if (\n ( childArray[defaultActiveIndex] as ReactElement<ITabProps> )?.props\n .disabled\n ) {\n const nextIndex = childArray.findIndex(\n ( child, idx ) =>\n ( child as ReactElement<ITabProps> ).props.disabled === false &&\n idx > defaultActiveIndex\n );\n return nextIndex !== -1 ? nextIndex : 0;\n }\n return defaultActiveIndex;\n });\n const [ filteredChildren, setFilteredChildren ] = useState<\n Array<ReactElement<ITabProps>>\n >([]);\n const evalActiveIndex = activeIndex ?? activeIdx;\n const noOfChildren = filteredChildren.length;\n const activeTabProps = filteredChildren[evalActiveIndex]?.props;\n const tabRefs = useRef<Array<RefObject<HTMLButtonElement>>>([]);\n\n if ( tabRefs.current.length !== noOfChildren ) {\n tabRefs.current = filteredChildren.map(\n ( _, idx ) =>\n tabRefs.current[idx] || createRef<HTMLButtonElement>()\n );\n }\n\n const disabledTabIndexes = Children.toArray( children )\n .map(( child, idx ) =>\n ( child as ReactElement<ITabProps> ).props.disabled ? idx : null\n )\n .filter(( idx ) => idx !== null ) as number[];\n\n useEffect(() => {\n setFilteredChildren( filterChildren( children ));\n }, [children]);\n\n const handleSelect = ( tabProps: ITabProps, index: number ) => () => {\n if ( index === evalActiveIndex ) {\n return;\n }\n activeTabProps?.onExit?.();\n if ( activeIndex !== undefined ) {\n onSelect?.( index );\n } else {\n setActiveIdx( index );\n }\n tabProps.onEnter?.();\n };\n\n const handleKeyDown = ( event: React.KeyboardEvent<HTMLButtonElement> ) => {\n if ( noOfChildren <= 1 ) {\n return;\n }\n const { key } = event;\n let reqIndex = evalActiveIndex;\n switch ( key ) {\n case keyboardKeys.end:\n reqIndex = noOfChildren - 1;\n while ( disabledTabIndexes.includes( reqIndex ) && reqIndex > 0 ) {\n reqIndex--;\n }\n break;\n case keyboardKeys.home:\n reqIndex = 0;\n while (\n disabledTabIndexes.includes( reqIndex ) &&\n reqIndex < noOfChildren - 1\n ) {\n reqIndex++;\n }\n break;\n case keyboardKeys.arrowUp:\n case keyboardKeys.arrowLeft:\n event.preventDefault();\n do{\n reqIndex = ( reqIndex - 1 + noOfChildren ) % noOfChildren;\n } while ( disabledTabIndexes.includes( reqIndex ));\n break;\n case keyboardKeys.arrowDown:\n case keyboardKeys.arrowRight:\n event.preventDefault();\n do{\n reqIndex = ( reqIndex + 1 ) % noOfChildren;\n } while ( disabledTabIndexes.includes( reqIndex ));\n break;\n default:\n break;\n }\n activeTabProps?.onExit?.();\n if ( activeIndex !== undefined ) {\n onSelect?.( reqIndex );\n } else {\n setActiveIdx( reqIndex );\n }\n filteredChildren[reqIndex]?.props.onEnter?.();\n tabRefs.current[reqIndex]?.current?.focus();\n };\n\n if ( noOfChildren === 0 ) {\n return null;\n }\n\n const { root, list, content } = tabsVariants({ size, variant, color });\n\n return (\n <div ref={ref} className={root({ class: className })} {...props}>\n <div\n className={[ variant === "text" ? "border-b-2 border-gray-200" : "", "mb-4" ].filter( Boolean ).join( " " )}\n >\n <nav\n role="tablist"\n className={list()}\n >\n {filteredChildren.map(( tab, index ) => {\n const isActive = index === evalActiveIndex;\n const btnId = tab.props.id ? `${tab.props.id}-btn` : `tab-${index}-btn`;\n const ariaControls = tab.props.id || `tab-${index}`;\n const { listItem } = tabsVariants({ size, variant, color, active: isActive });\n return (\n <button\n key={index}\n type="button"\n role="tab"\n ref={tabRefs.current[index]}\n disabled={tab.props.disabled}\n id={btnId}\n aria-controls={ariaControls}\n aria-selected={isActive}\n onClick={handleSelect( tab.props, index )}\n onKeyDown={handleKeyDown}\n className={listItem()}\n >\n {tab.props.prefixIcon && (\n <span className="mr-2 rtl:mr-0 rtl:ml-2">{tab.props.prefixIcon}</span>\n )}\n {tab.props.title}\n {tab.props.suffixIcon && (\n <span className="ml-2 rtl:ml-0 rtl:mr-2">{tab.props.suffixIcon}</span>\n )}\n </button>\n );\n })}\n </nav>\n </div>\n {switchUsingCss\n ? filteredChildren.map(( tab, index ) => (\n <div\n key={index}\n id={tab.props.id || `tab-${index}`}\n role="tabpanel"\n aria-labelledby={\n tab.props.id ? `${tab.props.id}-btn` : `tab-${index}-btn`\n }\n tabIndex={0}\n className={content({ class: index === evalActiveIndex\n ? activeTabProps?.className\n : "hidden" })}\n >\n {tab.props.children}\n </div>\n ))\n : (\n <div\n id={\n activeTabProps?.id || `tab-${evalActiveIndex}`\n }\n role="tabpanel"\n aria-labelledby={\n activeTabProps?.id\n ? `${activeTabProps.id}-btn`\n : `tab-${evalActiveIndex}-btn`\n }\n tabIndex={0}\n className={content({ class: activeTabProps?.className })}\n >\n {activeTabProps?.children}\n </div>\n )}\n </div>\n );\n }\n);\n\nTabsComponent.displayName = "Tabs";\n\n// Create composite component to attach Tab as static member\ntype TTabsType = typeof TabsComponent & { Tab: typeof Tab };\nconst Tabs = TabsComponent as TTabsType;\nTabs.Tab = Tab;\nexport { Tabs };\n'
3636
+ "content": 'import * as React from "react";\nimport {\n Children,\n createRef,\n useEffect,\n useRef,\n useState,\n isValidElement,\n type ReactElement,\n type RefObject\n} from "react";\n\nimport { tabsVariants } from "./tabsVariants";\nimport { keyboardKeys } from "@constants";\n\nexport enum ETabSizes {\n XS = "xs",\n SM = "sm",\n MD = "md",\n LG = "lg"\n}\nexport type TTabSize = `${ETabSizes}`;\n\n/**\n * Props for the Tab component.\n */\nexport interface ITabProps {\n /**\n * Id of the tab.\n */\n id?: string;\n /**\n * Name of the tab.\n */\n title: React.ReactNode;\n /**\n * Function to call when the tab is displayed.\n */\n onEnter?: () => void;\n /**\n * Function to call when the tab is exited.\n */\n onExit?: () => void;\n /**\n * Dynamically updates the className applied to the component.\n */\n className?: string;\n /**\n * Content to be displayed within the tab.\n */\n children: React.ReactNode;\n /**\n * Indicates whether the tab is disabled.\n */\n disabled?: boolean;\n /**\n * Icon to be displayed before the title of the Tab.\n * @description\n * This prop accepts either an IconType (string) or a ReactNode.\n * - If an IconType is provided, it will be rendered as-is.\n * - If a ReactNode is provided, it will be rendered as-is.\n */\n prefixIcon?: React.ReactNode;\n /**\n * Icon to be displayed after the title of the Tab.\n * @description\n * This prop accepts either an IconType (string) or a ReactNode.\n * - If an IconType is provided, it will be rendered as-is.\n * - If a ReactNode is provided, it will be rendered as-is.\n */\n suffixIcon?: React.ReactNode;\n}\n\nexport const Tab = React.forwardRef<HTMLDivElement, ITabProps>(\n ({ children, className }, ref ) => (\n <div ref={ref} className={className}>\n {children}\n </div>\n )\n);\nTab.displayName = "Tab";\n\n/**\n * Props for the Tabs component.\n */\nexport interface ITabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {\n /**\n * Active tab index. Tab index starts from 0.\n */\n activeIndex?: number;\n /**\n * Default active tab index, to be used with the uncontrolled version of the Tabs component.\n * @default 0\n */\n defaultActiveIndex?: number;\n /**\n * Dynamically updates the className applied to the component.\n */\n className?: string;\n /**\n * Renders all the tabs at once and switches between them using CSS.\n * @default false\n */\n switchUsingCss?: boolean;\n /**\n * Called on click of a tab header.\n * @param selectedTabIndex {number} Selected tab index.\n */\n onSelect?: ( selectedTabIndex: number ) => void;\n /**\n * Array of items to be displayed in the Tabs,\n * each item should be wrapped in Tabs.Tab component\n * @required\n * @example\n * ```tsx\n * <Tabs>\n * <Tabs.Tab title="Tab 1">Content of Tab 1</Tabs.Tab>\n * </Tabs>\n * ```\n */\n children:\n | ReactElement<ITabProps>\n | Array<ReactElement<ITabProps> | boolean>\n | boolean;\n /**\n * Size of the tab.\n * @default md\n */\n size?: TTabSize;\n /**\n * Variant of the tab.\n * @default text\n */\n variant?: "filled" | "text" | "brick" | "contained";\n /**\n * Color of the tab. Only applicable for filled variant.\n */\n color?: "primary" | "secondary";\n}\n\nconst filterChildren = (\n children: ITabsProps["children"]\n): Array<ReactElement<ITabProps>> => {\n return Children.toArray( children ).filter(\n ( child ) =>\n isValidElement( child ) &&\n child.type === Tab &&\n child.props.title !== undefined\n ) as Array<ReactElement<ITabProps>>;\n};\n\n// Composite component type with Tab attached as a static member\ntype TTabsType = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<ITabsProps> & React.RefAttributes<HTMLDivElement>\n> & { Tab: typeof Tab };\n\nexport const Tabs = React.forwardRef<HTMLDivElement, ITabsProps>(\n (\n {\n className,\n children,\n activeIndex,\n defaultActiveIndex = 0,\n switchUsingCss = false,\n onSelect,\n size = "md",\n variant = "text",\n color = "secondary",\n ...props\n },\n ref\n ) => {\n const [ activeIdx, setActiveIdx ] = useState<number>(() => {\n const childArray = Children.toArray( children );\n if (\n ( childArray[defaultActiveIndex] as ReactElement<ITabProps> )?.props\n .disabled\n ) {\n const nextIndex = childArray.findIndex(\n ( child, idx ) =>\n ( child as ReactElement<ITabProps> ).props.disabled === false &&\n idx > defaultActiveIndex\n );\n return nextIndex !== -1 ? nextIndex : 0;\n }\n return defaultActiveIndex;\n });\n const [ filteredChildren, setFilteredChildren ] = useState<\n Array<ReactElement<ITabProps>>\n >([]);\n const evalActiveIndex = activeIndex ?? activeIdx;\n const noOfChildren = filteredChildren.length;\n const activeTabProps = filteredChildren[evalActiveIndex]?.props;\n const tabRefs = useRef<Array<RefObject<HTMLButtonElement>>>([]);\n\n if ( tabRefs.current.length !== noOfChildren ) {\n tabRefs.current = filteredChildren.map(\n ( _, idx ) =>\n tabRefs.current[idx] || createRef<HTMLButtonElement>()\n );\n }\n\n const disabledTabIndexes = Children.toArray( children )\n .map(( child, idx ) =>\n ( child as ReactElement<ITabProps> ).props.disabled ? idx : null\n )\n .filter(( idx ) => idx !== null ) as number[];\n\n useEffect(() => {\n setFilteredChildren( filterChildren( children ));\n }, [children]);\n\n const handleSelect = ( tabProps: ITabProps, index: number ) => () => {\n if ( index === evalActiveIndex ) {\n return;\n }\n activeTabProps?.onExit?.();\n if ( activeIndex !== undefined ) {\n onSelect?.( index );\n } else {\n setActiveIdx( index );\n }\n tabProps.onEnter?.();\n };\n\n const handleKeyDown = ( event: React.KeyboardEvent<HTMLButtonElement> ) => {\n if ( noOfChildren <= 1 ) {\n return;\n }\n const { key } = event;\n let reqIndex = evalActiveIndex;\n switch ( key ) {\n case keyboardKeys.end:\n reqIndex = noOfChildren - 1;\n while ( disabledTabIndexes.includes( reqIndex ) && reqIndex > 0 ) {\n reqIndex--;\n }\n break;\n case keyboardKeys.home:\n reqIndex = 0;\n while (\n disabledTabIndexes.includes( reqIndex ) &&\n reqIndex < noOfChildren - 1\n ) {\n reqIndex++;\n }\n break;\n case keyboardKeys.arrowUp:\n case keyboardKeys.arrowLeft:\n event.preventDefault();\n do{\n reqIndex = ( reqIndex - 1 + noOfChildren ) % noOfChildren;\n } while ( disabledTabIndexes.includes( reqIndex ));\n break;\n case keyboardKeys.arrowDown:\n case keyboardKeys.arrowRight:\n event.preventDefault();\n do{\n reqIndex = ( reqIndex + 1 ) % noOfChildren;\n } while ( disabledTabIndexes.includes( reqIndex ));\n break;\n default:\n break;\n }\n activeTabProps?.onExit?.();\n if ( activeIndex !== undefined ) {\n onSelect?.( reqIndex );\n } else {\n setActiveIdx( reqIndex );\n }\n filteredChildren[reqIndex]?.props.onEnter?.();\n tabRefs.current[reqIndex]?.current?.focus();\n };\n\n if ( noOfChildren === 0 ) {\n return null;\n }\n\n const { root, list, content } = tabsVariants({ size, variant, color });\n\n return (\n <div ref={ref} className={root({ class: className })} {...props}>\n <div\n className={[ variant === "text" ? "border-b-2 border-gray-200" : "", "mb-4" ].filter( Boolean ).join( " " )}\n >\n <nav\n role="tablist"\n className={list()}\n >\n {filteredChildren.map(( tab, index ) => {\n const isActive = index === evalActiveIndex;\n const btnId = tab.props.id ? `${tab.props.id}-btn` : `tab-${index}-btn`;\n const ariaControls = tab.props.id || `tab-${index}`;\n const { listItem } = tabsVariants({ size, variant, color, active: isActive });\n return (\n <button\n key={index}\n type="button"\n role="tab"\n ref={tabRefs.current[index]}\n disabled={tab.props.disabled}\n id={btnId}\n aria-controls={ariaControls}\n aria-selected={isActive}\n onClick={handleSelect( tab.props, index )}\n onKeyDown={handleKeyDown}\n className={listItem()}\n >\n {tab.props.prefixIcon && (\n <span className="mr-2 rtl:mr-0 rtl:ml-2">{tab.props.prefixIcon}</span>\n )}\n {tab.props.title}\n {tab.props.suffixIcon && (\n <span className="ml-2 rtl:ml-0 rtl:mr-2">{tab.props.suffixIcon}</span>\n )}\n </button>\n );\n })}\n </nav>\n </div>\n {switchUsingCss\n ? filteredChildren.map(( tab, index ) => (\n <div\n key={index}\n id={tab.props.id || `tab-${index}`}\n role="tabpanel"\n aria-labelledby={\n tab.props.id ? `${tab.props.id}-btn` : `tab-${index}-btn`\n }\n tabIndex={0}\n className={content({ class: index === evalActiveIndex\n ? activeTabProps?.className\n : "hidden" })}\n >\n {tab.props.children}\n </div>\n ))\n : (\n <div\n id={\n activeTabProps?.id || `tab-${evalActiveIndex}`\n }\n role="tabpanel"\n aria-labelledby={\n activeTabProps?.id\n ? `${activeTabProps.id}-btn`\n : `tab-${evalActiveIndex}-btn`\n }\n tabIndex={0}\n className={content({ class: activeTabProps?.className })}\n >\n {activeTabProps?.children}\n </div>\n )}\n </div>\n );\n }\n) as TTabsType;\n\nTabs.displayName = "Tabs";\nTabs.Tab = Tab;\n'
2987
3637
  },
2988
3638
  {
2989
3639
  "name": "index.ts",
@@ -2991,7 +3641,7 @@ export const scrollbarVariants = tv({
2991
3641
  },
2992
3642
  {
2993
3643
  "name": "README.md",
2994
- "content": '# Tabs Component\n\n## Component Overview\n\nThe Tabs component provides a tabbed interface for organizing content into separate views, showing one panel at a time. It\'s a controlled component that manages active tab state.\n\n**When to use:**\n- Organizing related content into separate views\n- Settings and configuration panels with multiple sections\n- Dashboard views with different data perspectives\n- Multi-step forms or workflows\n- Navigation between related pages or sections\n\n**Component Architecture:**\n- Controlled component (requires active tab state management)\n- Styled with Tailwind CSS and class-variance-authority (cva)\n- Keyboard navigation support (Arrow keys, Tab)\n- Supports both horizontal layouts\n- Accessible with proper ARIA attributes\n\n## Basic Usage\n\n```tsx\nimport { Tabs } from "@components";\nimport { useState } from "react";\n\nexport function Example() {\n const [activeTab, setActiveTab] = useState(0);\n \n const tabs = [\n { label: "Profile", content: <div>Profile content</div> },\n { label: "Settings", content: <div>Settings content</div> },\n { label: "Notifications", content: <div>Notifications content</div> }\n ];\n \n return (\n <Tabs \n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n />\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/tabs` or `@components/tabs`.\n\n## Component Props\n\n### Tabs (Root Component)\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `children` | `ReactElement<ITabProps> \\| Array<ReactElement<ITabProps>>` | - | Yes | Tab components (Tabs.Tab) to be displayed |\n| `activeIndex` | `number` | `undefined` | No | Active tab index (controlled mode, 0-based) |\n| `defaultActiveIndex` | `number` | `0` | No | Default active tab index for uncontrolled mode |\n| `onSelect` | `(selectedTabIndex: number) => void` | `undefined` | No | Callback when a tab is selected |\n| `size` | `TTabSize` | `\'md\'` | No | Size of the tabs |\n| `variant` | `\'filled\' \\| \'text\' \\| \'brick\'` | `\'text\'` | No | Visual variant of the tabs |\n| `color` | `\'primary\' \\| \'secondary\'` | `undefined` | No | Color of the tabs (only for filled variant) |\n| `switchUsingCss` | `boolean` | `false` | No | Renders all tabs at once and switches between them using CSS |\n| `className` | `string` | `undefined` | No | Additional CSS classes for the tabs container |\n\n### Tabs.Tab\n\nIndividual tab component within the Tabs container.\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `title` | `React.ReactNode` | - | Yes | Name/label of the tab displayed in the tab header |\n| `children` | `React.ReactNode` | - | Yes | Content to be displayed within the tab |\n| `id` | `string` | `undefined` | No | Unique identifier for the tab |\n| `disabled` | `boolean` | `false` | No | Whether the tab is disabled |\n| `prefixIcon` | `React.ReactNode` | `undefined` | No | Icon to be displayed before the title of the tab |\n| `suffixIcon` | `React.ReactNode` | `undefined` | No | Icon to be displayed after the title of the tab |\n| `onEnter` | `() => void` | `undefined` | No | Function called when the tab is displayed |\n| `onExit` | `() => void` | `undefined` | No | Function called when the tab is exited |\n| `className` | `string` | `undefined` | No | Additional CSS classes for the tab content |\n\n**Note:** This component forwards refs to the container div element (`HTMLDivElement`).\n\n## Practical Examples\n\n### Dashboard with Multiple Views\n\n```tsx\nimport { Tabs } from "@components";\nimport { useState } from "react";\n\nfunction DashboardTabs() {\n const [activeTab, setActiveTab] = useState(0);\n \n const tabs = [\n {\n label: "Overview",\n content: (\n <div className="space-y-4">\n <h2 className="text-xl font-semibold">Dashboard Overview</h2>\n {/* Overview content */}\n </div>\n )\n },\n {\n label: "Analytics",\n content: (\n <div className="space-y-4">\n <h2 className="text-xl font-semibold">Analytics</h2>\n {/* Analytics charts and data */}\n </div>\n )\n },\n {\n label: "Reports",\n content: (\n <div className="space-y-4">\n <h2 className="text-xl font-semibold">Reports</h2>\n {/* Reports content */}\n </div>\n )\n },\n {\n label: "Team",\n content: (\n <div className="space-y-4">\n <h2 className="text-xl font-semibold">Team Members</h2>\n {/* Team list */}\n </div>\n )\n }\n ];\n \n return (\n <Tabs \n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n />\n );\n}\n```\n\n### Settings Panel with Forms\n\n```tsx\nimport { Tabs } from "@components";\nimport { TextField } from "@components";\nimport { Button } from "@components";\nimport { useState } from "react";\n\nfunction SettingsTabs() {\n const [activeTab, setActiveTab] = useState(0);\n \n const tabs = [\n {\n label: "Profile",\n content: (\n <form className="space-y-4">\n <TextField label="Full Name" placeholder="John Doe" />\n <TextField label="Email" type="email" placeholder="john@example.com" />\n <TextField label="Phone" type="tel" placeholder="+1 (555) 123-4567" />\n <Button type="submit">Save Profile</Button>\n </form>\n )\n },\n {\n label: "Security",\n content: (\n <form className="space-y-4">\n <TextField label="Current Password" type="password" />\n <TextField label="New Password" type="password" />\n <TextField label="Confirm Password" type="password" />\n <Button type="submit">Update Password</Button>\n </form>\n )\n },\n {\n label: "Notifications",\n content: (\n <div className="space-y-4">\n <div className="flex items-center justify-between">\n <label>Email Notifications</label>\n <Toggle />\n </div>\n <div className="flex items-center justify-between">\n <label>Push Notifications</label>\n <Toggle />\n </div>\n <Button>Save Preferences</Button>\n </div>\n )\n }\n ];\n \n return (\n <Tabs \n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n />\n );\n}\n```\n\n### Tabs with Icons and Disabled State\n\n```tsx\nimport { Tabs } from "@components";\nimport { useState } from "react";\n\nfunction IconTabs() {\n const [activeTab, setActiveTab] = useState(0);\n \n const tabs = [\n {\n label: (\n <span className="flex items-center gap-2">\n <HomeIcon /> Home\n </span>\n ),\n content: <div>Home content</div>\n },\n {\n label: (\n <span className="flex items-center gap-2">\n <SettingsIcon /> Settings\n </span>\n ),\n content: <div>Settings content</div>\n },\n {\n label: (\n <span className="flex items-center gap-2">\n <UserIcon /> Profile\n </span>\n ),\n content: <div>Profile content</div>,\n disabled: true // This tab is disabled\n }\n ];\n \n return (\n <Tabs \n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n />\n );\n}\n```\n\n## Styling and Customization\n\n```tsx\n<Tabs \n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n className="border rounded-lg"\n tabClassName="px-6 py-3"\n contentClassName="p-6 bg-gray-50"\n/>\n```\n\n## Technical Details\n\n### State Management\n\n- Fully controlled component\n- Parent manages active tab index\n- Tab changes trigger `onTabChange` callback\n- Content switches based on `activeTab` prop\n\n### Keyboard Navigation\n\n- Arrow Left/Right: Navigate between tabs\n- Tab: Move focus to next focusable element\n- Enter/Space: Activate focused tab\n- Focus is visually indicated\n\n## Accessibility\n\nThe component includes built-in accessibility features:\n\n**Implemented:**\n- ARIA `role="tablist"`, `role="tab"`, `role="tabpanel"`\n- `aria-selected` attribute for active tab\n- `aria-controls` linking tabs to panels\n- Keyboard navigation (Arrow keys)\n- Proper focus management\n- Disabled state properly communicated\n\n**Best Practices:**\n- Use descriptive tab labels\n- Keep tab labels concise\n- Ensure tab content is meaningful\n- Don\'t use too many tabs (5-7 maximum recommended)\n- Consider responsive design for mobile\n'
3644
+ "content": '# Tabs Component\n\n## Component Overview\n\nThe Tabs component provides a tabbed interface for organizing content into separate views, showing one panel at a time. It\'s a controlled component that manages active tab state.\n\n**When to use:**\n- Organizing related content into separate views\n- Settings and configuration panels with multiple sections\n- Dashboard views with different data perspectives\n- Multi-step forms or workflows\n- Navigation between related pages or sections\n\n**Component Architecture:**\n- Controlled component (requires active tab state management)\n- Styled with Tailwind CSS and class-variance-authority (cva)\n- Keyboard navigation support (Arrow keys, Tab)\n- Supports both horizontal layouts\n- Accessible with proper ARIA attributes\n\n## Basic Usage\n\n```tsx\nimport { Tabs } from "@components";\nimport { useState } from "react";\n\nexport function Example() {\n const [activeTab, setActiveTab] = useState(0);\n \n const tabs = [\n { label: "Profile", content: <div>Profile content</div> },\n { label: "Settings", content: <div>Settings content</div> },\n { label: "Notifications", content: <div>Notifications content</div> }\n ];\n \n return (\n <Tabs \n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n />\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/tabs` or `@components/tabs`.\n\n## Component Props\n\n### Tabs (Root Component)\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `children` | `ReactElement<ITabProps> \\| Array<ReactElement<ITabProps>>` | - | Yes | Tab components (Tabs.Tab) to be displayed |\n| `activeIndex` | `number` | `undefined` | No | Active tab index (controlled mode, 0-based) |\n| `defaultActiveIndex` | `number` | `0` | No | Default active tab index for uncontrolled mode |\n| `onSelect` | `(selectedTabIndex: number) => void` | `undefined` | No | Callback when a tab is selected |\n| `size` | `TTabSize` | `\'md\'` | No | Size of the tabs |\n| `variant` | `\'filled\' \\| \'text\' \\| \'brick\' \\| \'contained\'` | `\'text\'` | No | Visual variant of the tabs |\n| `color` | `\'primary\' \\| \'secondary\'` | `undefined` | No | Color of the tabs (only for filled variant) |\n| `switchUsingCss` | `boolean` | `false` | No | Renders all tabs at once and switches between them using CSS |\n| `className` | `string` | `undefined` | No | Additional CSS classes for the tabs container |\n\n### Tabs.Tab\n\nIndividual tab component within the Tabs container.\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `title` | `React.ReactNode` | - | Yes | Name/label of the tab displayed in the tab header |\n| `children` | `React.ReactNode` | - | Yes | Content to be displayed within the tab |\n| `id` | `string` | `undefined` | No | Unique identifier for the tab |\n| `disabled` | `boolean` | `false` | No | Whether the tab is disabled |\n| `prefixIcon` | `React.ReactNode` | `undefined` | No | Icon to be displayed before the title of the tab |\n| `suffixIcon` | `React.ReactNode` | `undefined` | No | Icon to be displayed after the title of the tab |\n| `onEnter` | `() => void` | `undefined` | No | Function called when the tab is displayed |\n| `onExit` | `() => void` | `undefined` | No | Function called when the tab is exited |\n| `className` | `string` | `undefined` | No | Additional CSS classes for the tab content |\n\n**Note:** This component forwards refs to the container div element (`HTMLDivElement`).\n\n## Practical Examples\n\n### Dashboard with Multiple Views\n\n```tsx\nimport { Tabs } from "@components";\nimport { useState } from "react";\n\nfunction DashboardTabs() {\n const [activeTab, setActiveTab] = useState(0);\n \n const tabs = [\n {\n label: "Overview",\n content: (\n <div className="space-y-4">\n <h2 className="text-xl font-semibold">Dashboard Overview</h2>\n {/* Overview content */}\n </div>\n )\n },\n {\n label: "Analytics",\n content: (\n <div className="space-y-4">\n <h2 className="text-xl font-semibold">Analytics</h2>\n {/* Analytics charts and data */}\n </div>\n )\n },\n {\n label: "Reports",\n content: (\n <div className="space-y-4">\n <h2 className="text-xl font-semibold">Reports</h2>\n {/* Reports content */}\n </div>\n )\n },\n {\n label: "Team",\n content: (\n <div className="space-y-4">\n <h2 className="text-xl font-semibold">Team Members</h2>\n {/* Team list */}\n </div>\n )\n }\n ];\n \n return (\n <Tabs \n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n />\n );\n}\n```\n\n### Settings Panel with Forms\n\n```tsx\nimport { Tabs } from "@components";\nimport { TextField } from "@components";\nimport { Button } from "@components";\nimport { useState } from "react";\n\nfunction SettingsTabs() {\n const [activeTab, setActiveTab] = useState(0);\n \n const tabs = [\n {\n label: "Profile",\n content: (\n <form className="space-y-4">\n <TextField label="Full Name" placeholder="John Doe" />\n <TextField label="Email" type="email" placeholder="john@example.com" />\n <TextField label="Phone" type="tel" placeholder="+1 (555) 123-4567" />\n <Button type="submit">Save Profile</Button>\n </form>\n )\n },\n {\n label: "Security",\n content: (\n <form className="space-y-4">\n <TextField label="Current Password" type="password" />\n <TextField label="New Password" type="password" />\n <TextField label="Confirm Password" type="password" />\n <Button type="submit">Update Password</Button>\n </form>\n )\n },\n {\n label: "Notifications",\n content: (\n <div className="space-y-4">\n <div className="flex items-center justify-between">\n <label>Email Notifications</label>\n <Toggle />\n </div>\n <div className="flex items-center justify-between">\n <label>Push Notifications</label>\n <Toggle />\n </div>\n <Button>Save Preferences</Button>\n </div>\n )\n }\n ];\n \n return (\n <Tabs \n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n />\n );\n}\n```\n\n### Tabs with Icons and Disabled State\n\n```tsx\nimport { Tabs } from "@components";\nimport { useState } from "react";\n\nfunction IconTabs() {\n const [activeTab, setActiveTab] = useState(0);\n \n const tabs = [\n {\n label: (\n <span className="flex items-center gap-2">\n <HomeIcon /> Home\n </span>\n ),\n content: <div>Home content</div>\n },\n {\n label: (\n <span className="flex items-center gap-2">\n <SettingsIcon /> Settings\n </span>\n ),\n content: <div>Settings content</div>\n },\n {\n label: (\n <span className="flex items-center gap-2">\n <UserIcon /> Profile\n </span>\n ),\n content: <div>Profile content</div>,\n disabled: true // This tab is disabled\n }\n ];\n \n return (\n <Tabs \n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n />\n );\n}\n```\n## Styling and Customization\n\n```tsx\n<Tabs \n tabs={tabs}\n activeTab={activeTab}\n onTabChange={setActiveTab}\n className="border rounded-lg"\n tabClassName="px-6 py-3"\n contentClassName="p-6 bg-gray-50"\n/>\n```\n\n## Technical Details\n\n### State Management\n\n- Fully controlled component\n- Parent manages active tab index\n- Tab changes trigger `onTabChange` callback\n- Content switches based on `activeTab` prop\n\n### Keyboard Navigation\n\n- Arrow Left/Right: Navigate between tabs\n- Tab: Move focus to next focusable element\n- Enter/Space: Activate focused tab\n- Focus is visually indicated\n\n## Accessibility\n\nThe component includes built-in accessibility features:\n\n**Implemented:**\n- ARIA `role="tablist"`, `role="tab"`, `role="tabpanel"`\n- `aria-selected` attribute for active tab\n- `aria-controls` linking tabs to panels\n- Keyboard navigation (Arrow keys)\n- Proper focus management\n- Disabled state properly communicated\n\n**Best Practices:**\n- Use descriptive tab labels\n- Keep tab labels concise\n- Ensure tab content is meaningful\n- Don\'t use too many tabs (5-7 maximum recommended)\n- Consider responsive design for mobile\n'
2995
3645
  }
2996
3646
  ],
2997
3647
  "directories": []
@@ -3015,7 +3665,7 @@ export const scrollbarVariants = tv({
3015
3665
  },
3016
3666
  {
3017
3667
  "name": "textCopy.tsx",
3018
- "content": 'import * as React from "react";\nimport { cn } from "tailwind-variants";\nimport { textCopyVariants } from "./textCopyVariants";\n\nimport { ADPIcon, iconList } from "../adpIcon";\nimport { Button } from "../button";\n\n/**\n * TextCopy component for copying text to clipboard\n */\nexport interface ITextCopyProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Pass the text prop if you want to copy something other than children string\n */\n text?: string;\n /**\n * Pass the children to display the text or element to be copied.\n * When passing children as non-string, make sure to pass text prop as well\n */\n children?: React.ReactElement | string;\n /**\n * To display icon on hover of the text\n */\n displayOnHover?: boolean;\n /**\n * Title for the copy button\n */\n copyButtonTitle?: string;\n /**\n * Confirmation message to be shown after the text gets copied\n */\n confirmationMessage?: string;\n}\n\n/**\n * TextCopy component for copying text to clipboard with visual confirmation\n */\nexport const TextCopy = React.forwardRef<HTMLDivElement, ITextCopyProps>(\n ({\n className,\n text = "",\n children,\n displayOnHover = false,\n copyButtonTitle,\n confirmationMessage = "Copied",\n ...props\n }, ref ) => {\n const [ copied, setCopied ] = React.useState<boolean>( false );\n\n const copyText = async (): Promise<void> => {\n setCopied( true );\n // Copy text, if not exists copy children if children is string or empty string\n const textToCopy = text || ( typeof children === "string" ? children : "" );\n await navigator.clipboard.writeText( textToCopy );\n setTimeout(() => {\n setCopied( false );\n }, 1500 );\n };\n\n const textCopyClasses = textCopyVariants({ displayOnHover, class: [ displayOnHover && "group", className ] });\n\n return (\n <div\n ref={ref}\n data-testid="copyComponent"\n className={textCopyClasses}\n {...props}\n >\n {children}\n {copied ? (\n <div\n className="inline-flex align-bottom items-center gap-1 text-success-500 ms-2"\n data-testid="textCopied"\n aria-live="polite"\n >\n <ADPIcon size="xs" fixedWidth icon={iconList.checkCircle} />\n <span>{confirmationMessage}</span>\n </div>\n ) : (\n <Button\n variant="text"\n onClick={copyText}\n title={copyButtonTitle || "Copy Text"}\n className={cn(\n "cursor-pointer transition-opacity ease-in-out inline-flex align-text-top ms-2",\n displayOnHover && "opacity-0 group-hover:opacity-100 group-hover:delay-100 delay-300"\n )}\n data-testid="copyButton"\n >\n <ADPIcon size="xs" fixedWidth icon={iconList.clone} />\n </Button>\n )}\n </div>\n );\n }\n);\n\nTextCopy.displayName = "TextCopy";\n'
3668
+ "content": 'import * as React from "react";\nimport { cn } from "tailwind-variants";\nimport { textCopyVariants } from "./textCopyVariants";\n\nimport { ADPIcon, iconList } from "../adpIcon";\nimport { Button } from "../button";\n\n/**\n * TextCopy component for copying text to clipboard\n */\nexport interface ITextCopyProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Pass the text prop if you want to copy something other than children string\n */\n text?: string;\n /**\n * Pass the children to display the text or element to be copied.\n * When passing children as non-string, make sure to pass text prop as well\n */\n children?: React.ReactElement | string;\n /**\n * To display icon on hover of the text\n */\n displayOnHover?: boolean;\n /**\n * Title for the copy button\n */\n copyButtonTitle?: string;\n /**\n * Confirmation message to be shown after the text gets copied\n */\n confirmationMessage?: string;\n}\n\n/**\n * TextCopy component for copying text to clipboard with visual confirmation\n */\nexport const TextCopy = React.forwardRef<HTMLDivElement, ITextCopyProps>(\n ({\n className,\n text = "",\n children,\n displayOnHover = false,\n copyButtonTitle,\n confirmationMessage = "Copied",\n ...props\n }, ref ) => {\n const [ copied, setCopied ] = React.useState<boolean>( false );\n\n const copyText = async (): Promise<void> => {\n setCopied( true );\n // Copy text, if not exists copy children if children is string or empty string\n const textToCopy = text || ( typeof children === "string" ? children : "" );\n await navigator.clipboard.writeText( textToCopy );\n setTimeout(() => {\n setCopied( false );\n }, 1500 );\n };\n\n const textCopyClasses = textCopyVariants({ displayOnHover, class: [ displayOnHover && "group", className ] });\n\n return (\n <div\n ref={ref}\n data-testid="copyComponent"\n className={textCopyClasses}\n {...props}\n >\n {children}\n {copied ? (\n <div\n className="inline-flex align-bottom items-center gap-1 text-success-700 ms-2"\n data-testid="textCopied"\n aria-live="polite"\n >\n <ADPIcon size="xs" fixedWidth icon={iconList.checkCircle} />\n <span>{confirmationMessage}</span>\n </div>\n ) : (\n <Button\n variant="text"\n onClick={copyText}\n title={copyButtonTitle || "Copy Text"}\n className={cn(\n "cursor-pointer transition-opacity ease-in-out inline-flex align-text-top ms-2",\n displayOnHover && "opacity-0 group-hover:opacity-100 group-hover:delay-100 delay-300"\n )}\n data-testid="copyButton"\n >\n <ADPIcon size="xs" fixedWidth icon={iconList.clone} />\n </Button>\n )}\n </div>\n );\n }\n);\n\nTextCopy.displayName = "TextCopy";\n'
3019
3669
  },
3020
3670
  {
3021
3671
  "name": "index.ts",
@@ -3042,7 +3692,7 @@ export const scrollbarVariants = tv({
3042
3692
  "files": [
3043
3693
  {
3044
3694
  "name": "textFieldVariants.ts",
3045
- "content": 'import { tv } from "tailwind-variants";\n\nexport const textFieldVariants = tv({\n slots: {\n container: "inline-flex flex-col gap-2 relative",\n label: "text-base font-medium text-secondary-400 dark:text-secondary-300",\n input: [\n "w-full rounded border border-gray-200 text-secondary-400",\n "placeholder:text-secondary-200 dark:placeholder:text-secondary-400",\n "outline-none focus:border-primary-500 focus:shadow-primary-2px",\n "disabled:bg-gray-50 disabled:text-secondary-200",\n "dark:border-secondary-500 dark:bg-iridium dark:disabled:bg-secondary-800 dark:disabled:text-secondary-500",\n "dark:focus:border-primary-400 dark:text-secondary-200"\n ],\n icon: "w-5 absolute top-1/2 -translate-y-1/2 text-gray-800 dark:text-gray-800",\n helperText: "text-xs font-normal"\n },\n variants: {\n size: {\n md: {\n input: "ps-3 pe-3 py-2.5 text-base"\n },\n lg: {\n input: "ps-4 pe-4 py-3 text-md"\n }\n },\n error: {\n true: {\n input: "border-error-500 focus:shadow-error-2px dark:border-error-400",\n helperText: "text-error-500 dark:text-error-400"\n },\n false: {\n helperText: "text-secondary-400 dark:text-secondary-200"\n }\n },\n withPrefix: {\n true: { input: "ps-8" },\n false: {}\n },\n withSuffix: {\n true: { input: "pe-8" },\n false: {}\n },\n position: {\n prefix: {},\n suffix: {}\n }\n },\n compoundVariants: [\n { size: "md", position: "prefix", class: { icon: "start-3" } },\n { size: "md", position: "suffix", class: { icon: "end-3" } },\n { size: "lg", position: "prefix", class: { icon: "start-4" } },\n { size: "lg", position: "suffix", class: { icon: "end-4" } }\n ],\n defaultVariants: {\n size: "md",\n error: false,\n withPrefix: false,\n withSuffix: false,\n position: "prefix"\n }\n});\n'
3695
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const textFieldVariants = tv({\n slots: {\n container: "inline-flex flex-col gap-2 relative",\n label: "text-base font-medium text-secondary-400 dark:text-secondary-300",\n input: [\n "w-full rounded border border-gray-200 text-secondary-400",\n "placeholder:text-secondary-200 dark:placeholder:text-secondary-400",\n "outline-none focus:border-primary-500 focus:shadow-primary-2px",\n "disabled:bg-gray-50 disabled:text-secondary-200",\n "dark:border-secondary-500 dark:bg-iridium dark:disabled:bg-secondary-800 dark:disabled:text-secondary-500",\n "dark:focus:border-primary-400 dark:text-secondary-200"\n ],\n icon: "w-5 absolute top-1/2 -translate-y-1/2 text-gray-900 dark:text-gray-800",\n helperText: "text-xs font-normal"\n },\n variants: {\n size: {\n md: {\n input: "ps-3 pe-3 py-2.5 text-base"\n },\n lg: {\n input: "ps-4 pe-4 py-3 text-md"\n }\n },\n error: {\n true: {\n input: "border-error-700 focus:shadow-error-2px dark:border-error-400",\n helperText: "text-error-700 dark:text-error-400"\n },\n false: {\n helperText: "text-secondary-400 dark:text-secondary-200"\n }\n },\n withPrefix: {\n true: { input: "ps-8" },\n false: {}\n },\n withSuffix: {\n true: { input: "pe-8" },\n false: {}\n },\n position: {\n prefix: {},\n suffix: {}\n }\n },\n compoundVariants: [\n { size: "md", position: "prefix", class: { icon: "start-3" } },\n { size: "md", position: "suffix", class: { icon: "end-3" } },\n { size: "lg", position: "prefix", class: { icon: "start-4" } },\n { size: "lg", position: "suffix", class: { icon: "end-4" } }\n ],\n defaultVariants: {\n size: "md",\n error: false,\n withPrefix: false,\n withSuffix: false,\n position: "prefix"\n }\n});\n'
3046
3696
  },
3047
3697
  {
3048
3698
  "name": "textField.tsx",
@@ -3073,7 +3723,7 @@ export const scrollbarVariants = tv({
3073
3723
  "files": [
3074
3724
  {
3075
3725
  "name": "textareaVariants.ts",
3076
- "content": 'import { tv } from "tailwind-variants";\n\nexport const textareaVariants = tv({\n slots: {\n container: "flex flex-col rounded border border-gray-200 bg-white w-full",\n textarea: "resize-y outline-none border-none text-secondary-500 rounded-t px-4 pt-3 w-full placeholder:text-secondary-200",\n helperText: "w-full text-xs font-normal"\n },\n variants: {\n state: {\n default: {\n container: "focus-within:outline-none focus-within:border-primary-500 focus-within:shadow-primary-2px",\n textarea: "focus:outline-none",\n helperText: "text-secondary-400"\n },\n error: {\n container: "!border-error-500 !focus-within:border-error-500 !focus-within:shadow-error-2px",\n textarea: "",\n helperText: "text-error-500"\n },\n disabled: {\n container: "bg-gray-50 focus-within:outline-none focus-within:border-gray-200 focus-within:shadow-none",\n textarea: "bg-gray-50 text-secondary-200",\n helperText: ""\n }\n }\n },\n defaultVariants: {\n state: "default"\n }\n});\n'
3726
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const textareaVariants = tv({\n slots: {\n container: "flex flex-col rounded border border-gray-200 bg-white w-full",\n textarea: "resize-y outline-none border-none text-secondary-500 rounded-t px-4 pt-3 w-full placeholder:text-secondary-200",\n helperText: "w-full text-xs font-normal"\n },\n variants: {\n state: {\n default: {\n container: "focus-within:outline-none focus-within:border-primary-500 focus-within:shadow-primary-2px",\n textarea: "focus:outline-none",\n helperText: "text-secondary-400"\n },\n error: {\n container: "!border-error-700 !focus-within:border-error-700 !focus-within:shadow-error-2px",\n textarea: "",\n helperText: "text-error-700"\n },\n disabled: {\n container: "bg-gray-50 focus-within:outline-none focus-within:border-gray-200 focus-within:shadow-none",\n textarea: "bg-gray-50 text-secondary-200",\n helperText: ""\n }\n }\n },\n defaultVariants: {\n state: "default"\n }\n});\n'
3077
3727
  },
3078
3728
  {
3079
3729
  "name": "textarea.tsx",
@@ -3109,7 +3759,7 @@ export const scrollbarVariants = tv({
3109
3759
  },
3110
3760
  {
3111
3761
  "name": "toast.tsx",
3112
- "content": 'import * as React from "react";\n\nimport { toastVariants } from "./toastVariants";\nimport { ADPIcon, iconList, type TIconType } from "../adpIcon";\nimport { Button } from "../button";\n\n/**\n * Toast component for displaying notifications or alerts.\n */\nexport interface IToastProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Accepts a variant value\n * @default info\n */\n variant?: "success" | "info" | "warning" | "error";\n /**\n * Show/hide the toast component\n * @default true\n */\n display?: boolean;\n /**\n * Accepts children of ReactNode type\n */\n children?: React.ReactNode;\n /**\n * Hide the Toast components automatically in x milliseconds\n */\n autoHideDelay?: number;\n /**\n * Hide the close button on the toast\n * @default false\n */\n hideCloseButton?: boolean;\n /**\n * A callback that is fired once the Toast closes\n */\n onClose?: () => void;\n /**\n * Show a condensed form of the Toast\n * @default true\n */\n condensed?: boolean;\n}\n\nconst variantMapping: Record<NonNullable<IToastProps["variant"]>, TIconType> = {\n info: iconList.infoFilled,\n success: iconList.checkCircleFilled,\n warning: iconList.alertFilled,\n error: iconList.timesCircleFilled\n};\n\n/**\n * Toast component for displaying notifications or alerts.\n */\nexport const Toast = React.forwardRef<HTMLDivElement, IToastProps>(\n ({\n variant = "info",\n display = true,\n children,\n autoHideDelay,\n hideCloseButton = false,\n onClose,\n condensed = true,\n className,\n ...props\n }, ref ) => {\n const [ show, setShow ] = React.useState( display );\n\n const hideToast = React.useCallback(() => {\n onClose?.();\n setShow( false );\n }, [onClose]);\n\n React.useEffect(() => {\n setShow( display );\n }, [display]);\n\n React.useEffect(() => {\n let autoHide: ReturnType<typeof setTimeout>;\n if ( typeof autoHideDelay === "number" ) {\n autoHide = setTimeout( hideToast, Math.round( autoHideDelay ));\n }\n return () => {\n if ( autoHide ) {\n clearTimeout( autoHide );\n }\n };\n }, [ autoHideDelay, hideToast ]);\n\n const { root, iconWrapper, contentWrapper, content, closeButton } = toastVariants({ variant, condensed });\n\n return show ? (\n <div\n ref={ref}\n className={root({ class: className })}\n role="alert"\n aria-live="assertive"\n aria-atomic="true"\n {...props}\n >\n <div className={iconWrapper()}>\n {condensed && <ADPIcon icon={variantMapping[variant]} size="md" />}\n </div>\n <div className={contentWrapper()}>\n {children && <div className={content()}>{children}</div>}\n {!hideCloseButton && (\n <Button\n prefixIcon="cross"\n onClick={hideToast}\n variant="text"\n color="secondary"\n className={closeButton()}\n size="xl"\n />\n )}\n </div>\n </div>\n ) : null;\n }\n);\n\nToast.displayName = "Toast";\n'
3762
+ "content": 'import * as React from "react";\n\nimport { toastVariants } from "./toastVariants";\nimport { ADPIcon, iconList, type TIconType } from "../adpIcon";\nimport { Button } from "../button";\n\n/**\n * Toast component for displaying notifications or alerts.\n */\nexport interface IToastProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Accepts a variant value\n * @default info\n */\n variant?: "success" | "info" | "warning" | "error";\n /**\n * Show/hide the toast component\n * @default true\n */\n display?: boolean;\n /**\n * Accepts children of ReactNode type\n */\n children?: React.ReactNode;\n /**\n * Hide the Toast components automatically in x milliseconds\n */\n autoHideDelay?: number;\n /**\n * Hide the close button on the toast\n * @default false\n */\n hideCloseButton?: boolean;\n /**\n * A callback that is fired once the Toast closes\n */\n onClose?: () => void;\n /**\n * Show a condensed form of the Toast\n * @default true\n */\n condensed?: boolean;\n}\n\nconst variantMapping: Record<NonNullable<IToastProps["variant"]>, TIconType> = {\n info: iconList.infoFilled,\n success: iconList.checkCircleFilled,\n warning: iconList.alertFilled,\n error: iconList.timesCircleFilled\n};\n\n/**\n * Toast component for displaying notifications or alerts.\n */\nexport const Toast = React.forwardRef<HTMLDivElement, IToastProps>(\n ({\n variant = "info",\n display = true,\n children,\n autoHideDelay,\n hideCloseButton = false,\n onClose,\n condensed = true,\n className,\n ...props\n }, ref ) => {\n const [ show, setShow ] = React.useState( display );\n\n const hideToast = React.useCallback(() => {\n onClose?.();\n setShow( false );\n }, [onClose]);\n\n React.useEffect(() => {\n setShow( display );\n }, [display]);\n\n React.useEffect(() => {\n let autoHide: ReturnType<typeof setTimeout>;\n if ( typeof autoHideDelay === "number" ) {\n autoHide = setTimeout( hideToast, Math.round( autoHideDelay ));\n }\n return () => {\n if ( autoHide ) {\n clearTimeout( autoHide );\n }\n };\n }, [ autoHideDelay, hideToast ]);\n\n const { root, iconWrapper, contentWrapper, content, closeButton } = toastVariants({ variant, condensed });\n\n return show ? (\n <div\n ref={ref}\n className={root({ class: className })}\n role="alert"\n aria-live="assertive"\n aria-atomic="true"\n {...props}\n >\n <div className={iconWrapper()}>\n {condensed && <ADPIcon icon={variantMapping[variant]} size="md" />}\n </div>\n <div className={contentWrapper()}>\n {children && <div className={content()}>{children}</div>}\n {!hideCloseButton && (\n <Button\n prefixIcon="cross"\n onClick={hideToast}\n variant="text"\n color="secondary"\n className={closeButton()}\n size="xl"\n aria-label="Close"\n />\n )}\n </div>\n </div>\n ) : null;\n }\n);\n\nToast.displayName = "Toast";\n'
3113
3763
  },
3114
3764
  {
3115
3765
  "name": "index.ts",
@@ -3160,19 +3810,21 @@ export const scrollbarVariants = tv({
3160
3810
  "tailwind-variants",
3161
3811
  "react",
3162
3812
  "@floating-ui/react",
3813
+ "react-merge-refs",
3163
3814
  "tailwind-merge"
3164
3815
  ],
3165
3816
  "internalDependencies": [
3817
+ "button",
3166
3818
  "adpIcon"
3167
3819
  ],
3168
3820
  "files": [
3169
3821
  {
3170
3822
  "name": "tooltipVariants.ts",
3171
- "content": 'import { tv } from "tailwind-variants";\n\nexport const tooltipVariants = tv({\n slots: {\n container: "border border-gray-100 bg-white rounded shadow-xl max-w-[308px] z-[2040] dark:bg-secondary-800 dark:border-secondary-500 w-auto",\n content: "flex flex-col gap-1 relative z-10 break-words dark:text-secondary-50 text-secondary-300",\n title: "font-medium text-black dark:text-white",\n arrow: "absolute aspect-square w-4 h-4 rounded-tl-sm bg-inherit border-1.5 border-r-0 border-b-0 border-gray-100 dark:border-secondary-500",\n trigger: "relative text-secondary-400 dark:text-secondary-50 max-w-max"\n },\n variants: {\n size: {\n sm: {\n container: "p-2",\n content: "text-xs",\n title: "text-xs"\n },\n md: {\n container: "p-3",\n content: "text-sm",\n title: "text-base"\n }\n },\n disabled: {\n true: {\n trigger: "!text-secondary-200 cursor-not-allowed"\n }\n }\n },\n defaultVariants: {\n size: "md"\n }\n});\n'
3823
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const tooltipVariants = tv({\n slots: {\n container: "border border-gray-100 bg-white rounded shadow-xl max-w-[308px] z-[2040] dark:bg-secondary-800 dark:border-secondary-500 w-auto",\n content: "flex flex-col gap-1 relative z-10 break-words dark:text-secondary-50 text-secondary-400",\n title: "font-medium text-black dark:text-white",\n arrow: "absolute aspect-square w-4 h-4 rounded-tl-sm bg-inherit border-1.5 border-r-0 border-b-0 border-gray-100 dark:border-secondary-500",\n trigger: "relative max-w-max"\n },\n variants: {\n size: {\n sm: {\n container: "p-2",\n content: "text-xs",\n title: "text-xs"\n },\n md: {\n container: "p-3",\n content: "text-sm",\n title: "text-base"\n }\n },\n // Interactive triggers already carry their own color (native elements, links,\n // the DS Button, etc.), so the tooltip only supplies a default text color for\n // the non-interactive wrapper around bare icons/text.\n interactive: {\n false: {\n trigger: "text-secondary-400 dark:text-secondary-50"\n }\n }\n },\n defaultVariants: {\n size: "md",\n interactive: false\n }\n});\n'
3172
3824
  },
3173
3825
  {
3174
3826
  "name": "tooltip.tsx",
3175
- "content": 'import * as React from "react";\nimport {\n FloatingPortal,\n type Placement,\n type Side,\n arrow as arrowMiddleware,\n offset,\n flip,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useRole,\n autoUpdate\n} from "@floating-ui/react";\n\nimport { tooltipVariants } from "./tooltipVariants";\n\ntype TTooltipSizes = "sm" | "md";\n\nexport interface ITooltipProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Title of the tooltip */\n title?: string;\n /** Content of the tooltip */\n children?: React.ReactNode;\n /** The reference element that triggers the tooltip */\n trigger: React.ReactNode;\n /** Size of the tooltip content container @default "md" */\n size?: TTooltipSizes;\n /** Placement of the tooltip @default "bottom-end" */\n placement?: Placement;\n /** Renders the tooltip on click @default false */\n clickable?: boolean;\n /** Override tooltip container class names */\n className?: string;\n /** Override trigger element class names */\n triggerElementClassName?: string;\n /** Callback executed on trigger click */\n onTriggerClick?: () => void;\n /** Render tooltip outside portal @default false */\n renderOutsidePortal?: boolean;\n /** aria-label for the trigger element */\n triggerAriaLabel?: string;\n /** Disable tooltip interactions @default false */\n disabled?: boolean;\n}\n\nexport const Tooltip = React.forwardRef<HTMLDivElement, ITooltipProps>(\n (\n {\n title,\n children,\n trigger,\n size = "md",\n placement = "bottom-end",\n clickable = false,\n className,\n triggerElementClassName,\n onTriggerClick,\n renderOutsidePortal = false,\n triggerAriaLabel,\n disabled = false,\n ...props\n },\n ref\n ) => {\n const [ open, setOpen ] = React.useState( false );\n const arrowRef = React.useRef<HTMLDivElement | null>( null );\n\n const {\n x,\n y,\n refs,\n strategy,\n context,\n middlewareData: { arrow: { x: arrowX, y: arrowY } = {} },\n placement: hookPlacement\n } = useFloating({\n open,\n onOpenChange: setOpen,\n placement,\n whileElementsMounted: autoUpdate,\n middleware: [ offset( 10 ), flip(), shift(), arrowMiddleware({ element: arrowRef, padding: 14 }) ]\n });\n\n const hover = useHover( context, { move: false, enabled: !clickable, delay: 200 });\n const focus = useFocus( context );\n const click = useClick( context, { enabled: clickable && !disabled });\n const dismiss = useDismiss( context );\n const role = useRole( context, { role: "tooltip" });\n\n const { getReferenceProps, getFloatingProps } = useInteractions([\n hover,\n focus,\n click,\n dismiss,\n role\n ]);\n\n const invalidTrigger = isNodeInvalid( trigger );\n const invalidChild = isNodeInvalid( children );\n\n const referenceProps = getReferenceProps({\n onClick: () => {\n if ( !disabled ) {\n onTriggerClick?.();\n }\n }\n });\n\n const { container, content, title: titleClass, arrow, trigger: triggerClass } =\n tooltipVariants({ size, disabled: Boolean( disabled ) });\n\n const popupContent = (\n <div\n role="tooltip"\n ref={( node ) => {\n refs.setFloating( node );\n if ( ref && typeof ref === "function" ) {\n ref( node );\n } else if ( ref && "current" in ref ) {\n ( ref as React.MutableRefObject<HTMLDivElement | null> ).current = node;\n }\n }}\n style={{ position: strategy, top: y ?? 0, left: x ?? 0 }}\n className={container({ class: [ open ? "visible" : "invisible", className ] })}\n {...getFloatingProps()}\n {...props}\n >\n <div\n data-testid="tooltip-content"\n className={content()}\n >\n {title && (\n <h1 className={titleClass()}>\n {title}\n </h1>\n )}\n {!invalidChild && children}\n </div>\n <div\n ref={arrowRef}\n style={{ left: arrowX, top: arrowY, [getCSSPropertyForPlacement( hookPlacement )]: "-9px" }}\n className={arrow({ class: getArrowPlacementClass( hookPlacement ) })}\n />\n </div>\n );\n\n if ( invalidTrigger ) {\n return null;\n }\n\n return (\n <>\n <span\n data-testid="tooltip-trigger"\n role="button"\n ref={refs.setReference}\n tabIndex={0}\n aria-label={triggerAriaLabel}\n className={triggerClass({ class: triggerElementClassName })}\n {...referenceProps}\n >\n {trigger}\n </span>\n {open && ( renderOutsidePortal ? popupContent : <FloatingPortal>{popupContent}</FloatingPortal> )}\n </>\n );\n }\n);\n\nTooltip.displayName = "Tooltip";\n\n/**\n * Determines the CSS property for positioning the arrow based on placement\n */\nconst getCSSPropertyForPlacement = ( placementSide: Placement ): Side => {\n const [staticPosition] = placementSide.split( "-" );\n const mapping: Record<string, Side> = {\n top: "bottom",\n right: "left",\n bottom: "top",\n left: "right"\n };\n return mapping[staticPosition];\n};\n\n/**\n * Checks if the node is an invalid ReactNode (empty object)\n */\nconst isNodeInvalid = ( node: any ): boolean =>\n typeof node === "object" && !Array.isArray( node ) && Object.keys( node ).length === 0;\n\n/**\n * Returns the rotation class for the arrow based on placement\n */\nfunction getArrowPlacementClass( placementSide: Placement ): string {\n const [staticPosition] = placementSide.split( "-" );\n switch ( staticPosition ) {\n case "top":\n return "-rotate-[135deg]";\n case "right":\n return "-rotate-45";\n case "left":\n return "rotate-[135deg]";\n case "bottom":\n default:\n return "rotate-45";\n }\n}\n'
3827
+ "content": 'import * as React from "react";\nimport {\n FloatingPortal,\n type Placement,\n type Side,\n arrow as arrowMiddleware,\n offset,\n flip,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useRole,\n autoUpdate\n} from "@floating-ui/react";\nimport mergeRefs from "react-merge-refs";\n\nimport { tooltipVariants } from "./tooltipVariants";\nimport { isSemanticTrigger } from "@utils";\n\ntype TTooltipSizes = "sm" | "md";\n\nexport interface ITooltipProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Title of the tooltip */\n title?: string;\n /** Content of the tooltip */\n children?: React.ReactNode;\n /** The reference element that triggers the tooltip */\n trigger: React.ReactNode;\n /** Size of the tooltip content container @default "md" */\n size?: TTooltipSizes;\n /** Placement of the tooltip @default "bottom-end" */\n placement?: Placement;\n /** Renders the tooltip on click @default false */\n clickable?: boolean;\n /** Override tooltip container class names */\n className?: string;\n /** Override trigger element class names */\n triggerElementClassName?: string;\n /** Render tooltip outside portal @default false */\n renderOutsidePortal?: boolean;\n /**\n * Opt a custom trigger into the "interactive" path. Native interactive\n * elements (`button`, `a`, `summary`, `input`, `select`, `textarea`) are\n * detected automatically, but a custom component (e.g. this library\'s\n * `Button`) cannot be introspected. Set this when the trigger is a custom\n * component that renders a real interactive element and forwards its `ref`\n * and DOM props (`onClick`, `aria-*`, `className`) to it. When true the\n * reference props are merged directly onto the trigger instead of wrapping it\n * in a `span`. @default false\n */\n interactiveTrigger?: boolean;\n /**\n * Master gate for whether the tooltip may open. When `false` no interaction opens the popover and\n * the wrapper leaves the tab order, but the trigger still renders exactly as normal.\n * Gate it on a condition, e.g. `canOpen={isTruncated}`. @default true\n */\n canOpen?: boolean;\n}\n\nexport const Tooltip = React.forwardRef<HTMLDivElement, ITooltipProps>(\n (\n {\n title,\n children,\n trigger,\n size = "md",\n placement = "bottom-end",\n clickable = false,\n className,\n triggerElementClassName,\n renderOutsidePortal = false,\n interactiveTrigger = false,\n canOpen = true,\n ...props\n },\n ref\n ) => {\n const [ open, setOpen ] = React.useState( false );\n const arrowRef = React.useRef<HTMLDivElement | null>( null );\n\n const {\n x,\n y,\n refs,\n strategy,\n context,\n middlewareData: { arrow: { x: arrowX, y: arrowY } = {} },\n placement: hookPlacement\n } = useFloating({\n open,\n onOpenChange: setOpen,\n placement,\n whileElementsMounted: autoUpdate,\n middleware: [ offset( 10 ), flip(), shift(), arrowMiddleware({ element: arrowRef, padding: 14 }) ]\n });\n\n const hover = useHover( context, { move: false, enabled: canOpen && !clickable, delay: 200 });\n const focus = useFocus( context, { enabled: canOpen });\n const click = useClick( context, { enabled: canOpen && clickable });\n const dismiss = useDismiss( context );\n const role = useRole( context, { role: "tooltip" });\n\n const { getReferenceProps, getFloatingProps } = useInteractions([\n hover,\n focus,\n click,\n dismiss,\n role\n ]);\n\n const invalidTrigger = isNodeInvalid( trigger );\n const invalidChild = isNodeInvalid( children );\n // Native interactive elements are auto-detected; a custom component can opt\n // in via `interactiveTrigger` since its rendered output can\'t be introspected.\n const isSemanticInteractiveElement = isSemanticTrigger( trigger ) || interactiveTrigger;\n\n const { container, content, title: titleClass, arrow, trigger: triggerClass } =\n tooltipVariants({ size, interactive: isSemanticInteractiveElement });\n\n const popupContent = (\n <div\n role="tooltip"\n ref={( node ) => {\n refs.setFloating( node );\n if ( ref && typeof ref === "function" ) {\n ref( node );\n } else if ( ref && "current" in ref ) {\n ( ref as React.MutableRefObject<HTMLDivElement | null> ).current = node;\n }\n }}\n style={{ position: strategy, top: y ?? 0, left: x ?? 0 }}\n className={container({ class: [ open ? "visible" : "invisible", className ] })}\n {...getFloatingProps()}\n {...props}\n >\n <div\n data-testid="tooltip-content"\n className={content()}\n >\n {title && (\n <h1 className={titleClass()}>\n {title}\n </h1>\n )}\n {!invalidChild && children}\n </div>\n <div\n ref={arrowRef}\n style={{ left: arrowX, top: arrowY, [getCSSPropertyForPlacement( hookPlacement )]: "-9px" }}\n className={arrow({ class: getArrowPlacementClass( hookPlacement ) })}\n />\n </div>\n );\n\n if ( invalidTrigger ) {\n return null;\n }\n\n // When the trigger is already an interactive element, merge the reference\n // props (and ref) onto it directly instead of wrapping it in a span. This\n // makes the interactive element itself the tooltip reference, so it handles\n // click/keyboard/focus natively rather than relying on the wrapper.\n const renderTrigger = () => {\n if ( isSemanticInteractiveElement ) {\n const triggerElement = trigger as React.ReactElement;\n\n // The element\'s own `onClick` flows through `...triggerElement.props`, so `getReferenceProps`\n // preserves it while merging the tooltip\'s click-to-open handler alongside it.\n return React.cloneElement(\n triggerElement,\n getReferenceProps({\n ...triggerElement.props,\n ref: mergeRefs([\n refs.setReference,\n ( triggerElement as { ref?: React.Ref<unknown> }).ref ?? null\n ]),\n "data-testid": "tooltip-trigger",\n className: triggerClass({ class: [ triggerElement.props.className, triggerElementClassName ] })\n })\n );\n }\n\n // A non-interactive trigger (bare icon/text) needs a synthesized operable wrapper. When the\n // tooltip opens on click the wrapper is a real action target, so render a native `<button>`\n // to get Enter/Space activation and button semantics for free. For hover/focus tooltips the\n // wrapper only has to be focusable so keyboard users can reveal the popover, so a plain\n // focusable span is used - a `role="button"` there would announce an action that clicking\n // does not perform. Either way the wrapper leaves the tab order when the tooltip is gated off\n // (`canOpen` false) so it never becomes a dead tab stop.\n if ( clickable ) {\n return (\n <button\n type="button"\n data-testid="tooltip-trigger"\n ref={refs.setReference}\n tabIndex={canOpen ? 0 : -1}\n className={triggerClass({ class: triggerElementClassName })}\n {...getReferenceProps()}\n >\n {trigger}\n </button>\n );\n }\n\n return (\n <span\n data-testid="tooltip-trigger"\n ref={refs.setReference}\n tabIndex={canOpen ? 0 : -1}\n className={triggerClass({ class: triggerElementClassName })}\n {...getReferenceProps()}\n >\n {trigger}\n </span>\n );\n };\n\n return (\n <>\n {renderTrigger()}\n {open && canOpen && ( renderOutsidePortal ? popupContent : <FloatingPortal>{popupContent}</FloatingPortal> )}\n </>\n );\n }\n);\n\nTooltip.displayName = "Tooltip";\n\n/**\n * Determines the CSS property for positioning the arrow based on placement\n */\nconst getCSSPropertyForPlacement = ( placementSide: Placement ): Side => {\n const [staticPosition] = placementSide.split( "-" );\n const mapping: Record<string, Side> = {\n top: "bottom",\n right: "left",\n bottom: "top",\n left: "right"\n };\n return mapping[staticPosition];\n};\n\n/**\n * Checks if the node is an invalid ReactNode (empty object)\n */\nconst isNodeInvalid = ( node: any ): boolean =>\n typeof node === "object" && !Array.isArray( node ) && Object.keys( node ).length === 0;\n\n/**\n * Returns the rotation class for the arrow based on placement\n */\nfunction getArrowPlacementClass( placementSide: Placement ): string {\n const [staticPosition] = placementSide.split( "-" );\n switch ( staticPosition ) {\n case "top":\n return "-rotate-[135deg]";\n case "right":\n return "-rotate-45";\n case "left":\n return "rotate-[135deg]";\n case "bottom":\n default:\n return "rotate-45";\n }\n}\n'
3176
3828
  },
3177
3829
  {
3178
3830
  "name": "index.ts",
@@ -3180,7 +3832,451 @@ export const scrollbarVariants = tv({
3180
3832
  },
3181
3833
  {
3182
3834
  "name": "README.md",
3183
- "content": '# Tooltip Component\n\n## Component Overview\n\nThe Tooltip component displays informative text when hovering over an element.\n\n**When to use:**\n- Additional context for UI elements\n- Icon explanations\n- Truncated text full content\n- Help text\n- Keyboard shortcuts\n\n**Component Architecture:**\n- Built with @floating-ui for positioning\n- Styled with Tailwind CSS and cva\n- Multiple placement options\n- Keyboard accessible\n\n## Basic Usage\n\n```tsx\nimport { Tooltip } from "@components";\nimport { Button } from "@components";\n\nexport function Example() {\n return (\n <Tooltip content="This is a tooltip">\n <Button>Hover me</Button>\n </Tooltip>\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/tooltip` or `@components/tooltip`.\n\n## Component Props\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `trigger` | `React.ReactNode` | - | Yes | The reference element that triggers the tooltip |\n| `children` | `React.ReactNode` | `undefined` | No | Content of the tooltip |\n| `title` | `string` | `undefined` | No | Title of the tooltip (displayed above children if both are provided) |\n| `size` | `TTooltipSizes` | `\'md\'` | No | Size of the tooltip content container |\n| `placement` | `Placement` | `\'bottom-end\'` | No | Placement of the tooltip relative to trigger |\n| `clickable` | `boolean` | `false` | No | Renders the tooltip on click instead of hover |\n| `disabled` | `boolean` | `false` | No | Disable tooltip interactions |\n| `triggerAriaLabel` | `string` | `undefined` | No | aria-label for the trigger element |\n| `onTriggerClick` | `() => void` | `undefined` | No | Callback executed on trigger click |\n| `renderOutsidePortal` | `boolean` | `false` | No | Render tooltip outside portal (in DOM hierarchy) |\n| `className` | `string` | `undefined` | No | Additional CSS classes for tooltip container |\n| `triggerElementClassName` | `string` | `undefined` | No | Additional CSS classes for trigger element |\n\n**Note:** This component forwards refs to the container div element (`HTMLDivElement`).\n\n## Practical Examples\n\n### Icon with Tooltip\n\n```tsx\nimport { Tooltip } from "@components";\nimport { Button } from "@components";\n\nfunction IconButtons() {\n return (\n <div className="flex gap-2">\n <Tooltip content="Edit item">\n <Button variant="text" prefixIcon="edit" />\n </Tooltip>\n <Tooltip content="Delete item">\n <Button variant="text" prefixIcon="trash" color="error" />\n </Tooltip>\n <Tooltip content="Share item">\n <Button variant="text" prefixIcon="share" />\n </Tooltip>\n </div>\n );\n}\n```\n\n### Help Text\n\n```tsx\nimport { Tooltip } from "@components";\nimport { TextField } from "@components";\n\nfunction FormFieldWithHelp() {\n return (\n <div className="flex items-center gap-2">\n <TextField label="API Key" />\n <Tooltip \n content="Your API key can be found in the settings page"\n placement="right"\n >\n <button className="text-gray-400 hover:text-gray-600">\n <InfoIcon />\n </button>\n </Tooltip>\n </div>\n );\n}\n```\n\n## Accessibility\n\n- Keyboard accessible\n- ARIA attributes\n- Focus management\n'
3835
+ "content": '# Tooltip Component\n\n## Component Overview\n\nThe Tooltip component displays informative text when hovering over an element.\n\n**When to use:**\n- Additional context for UI elements\n- Icon explanations\n- Truncated text full content\n- Help text\n- Keyboard shortcuts\n\n**Component Architecture:**\n- Built with @floating-ui for positioning\n- Styled with Tailwind CSS and cva\n- Multiple placement options\n- Keyboard accessible\n\n## Basic Usage\n\n```tsx\nimport { Tooltip } from "@components";\nimport { Button } from "@components";\n\nexport function Example() {\n return (\n <Tooltip content="This is a tooltip">\n <Button>Hover me</Button>\n </Tooltip>\n );\n}\n```\n\n**Note:** Update the import path based on your project structure. If you used the Astral UI CLI, the typical import path would be `@components/ui/tooltip` or `@components/tooltip`.\n\n## Component Props\n\n| Prop | Type | Default | Required | Description |\n|------|------|---------|----------|-------------|\n| `trigger` | `React.ReactNode` | - | Yes | The reference element that triggers the tooltip |\n| `children` | `React.ReactNode` | `undefined` | No | Content of the tooltip |\n| `title` | `string` | `undefined` | No | Title of the tooltip (displayed above children if both are provided) |\n| `size` | `TTooltipSizes` | `\'md\'` | No | Size of the tooltip content container |\n| `placement` | `Placement` | `\'bottom-end\'` | No | Placement of the tooltip relative to trigger |\n| `clickable` | `boolean` | `false` | No | Renders the tooltip on click instead of hover. For a non-interactive trigger this also makes the generated wrapper a native `<button>` (see [Trigger Handling](#trigger-handling)) |\n| `canOpen` | `boolean` | `true` | No | Master gate for whether the tooltip may ever open. When `false`, no interaction (hover/focus/click) surfaces the popover, it stays out of the DOM, and the wrapper leaves the tab order \u2014 but the trigger renders exactly as normal. Use it to reveal the tooltip only when it adds information, e.g. `canOpen={isTruncated}` |\n| `interactiveTrigger` | `boolean` | `false` | No | Opt a custom-component trigger into the interactive (merge-onto-element) path so the wrapper is not added and the trigger stays a single tab stop. Native interactive elements are auto-detected; see [Trigger Handling](#trigger-handling) |\n| `renderOutsidePortal` | `boolean` | `false` | No | Render tooltip outside portal (in DOM hierarchy) |\n| `className` | `string` | `undefined` | No | Additional CSS classes for tooltip container |\n| `triggerElementClassName` | `string` | `undefined` | No | Additional CSS classes for trigger element |\n\n**Note:** This component forwards refs to the container div element (`HTMLDivElement`).\n\n## Practical Examples\n\n### Icon with Tooltip\n\n```tsx\nimport { Tooltip } from "@components";\nimport { Button } from "@components";\n\nfunction IconButtons() {\n return (\n <div className="flex gap-2">\n <Tooltip content="Edit item">\n <Button variant="text" prefixIcon="edit" />\n </Tooltip>\n <Tooltip content="Delete item">\n <Button variant="text" prefixIcon="trash" color="error" />\n </Tooltip>\n <Tooltip content="Share item">\n <Button variant="text" prefixIcon="share" />\n </Tooltip>\n </div>\n );\n}\n```\n\n### Help Text\n\n```tsx\nimport { Tooltip } from "@components";\nimport { TextField } from "@components";\n\nfunction FormFieldWithHelp() {\n return (\n <div className="flex items-center gap-2">\n <TextField label="API Key" />\n <Tooltip \n content="Your API key can be found in the settings page"\n placement="right"\n >\n <button className="text-gray-400 hover:text-gray-600">\n <InfoIcon />\n </button>\n </Tooltip>\n </div>\n );\n}\n```\n\n## Trigger Handling\n\nThe tooltip attaches its interaction props (click, hover, focus, keyboard and the\npositioning `ref`) to the trigger, but *how* it does so depends on the trigger type:\n\n- **Interactive triggers** (`button`, `a`, `summary`, `input`, `select`, `textarea`):\n the reference props and `ref` are merged **directly onto that element** via\n `cloneElement` (refs are combined with `react-merge-refs`, so any ref you put on\n the trigger is preserved). The element stays the real reference and handles\n click, keyboard activation and focus natively \u2014 no wrapper is added, and its own\n `onClick` is preserved (the click-to-open handler is merged alongside it).\n Because the element already has native semantics, no `role` or `tabIndex` is\n injected; keep the element\'s own accessible name (visible text or its own\n `aria-label`). If you need to respond to clicks, put the handler on the trigger\n element itself.\n\n```tsx\n// The button itself becomes the tooltip reference; its onClick runs as normal\n<Tooltip clickable title="Details" trigger={<button type="button" onClick={handleClick}>Open</button>}>\n Tooltip content\n</Tooltip>\n```\n\n- **Non-interactive triggers** (text, icons, a `span`/`div`, custom components):\n the trigger is wrapped in a Tooltip-generated element so it is keyboard-operable.\n The wrapper\'s element depends on `clickable`:\n - **hover/focus (`clickable={false}`)** \u2192 a focusable `<span>` (`tabIndex={0}`).\n It only reveals the popover on hover/focus, so it is *not* given a `button` role.\n - **click (`clickable`)** \u2192 a native `<button type="button">`, so it gets\n Enter/Space activation and button semantics for free.\n\n The tooltip does not name the wrapper \u2014 its content is exposed as a *description*\n (via `aria-describedby`), not an accessible name. If the trigger itself needs a\n name (e.g. a bare icon), give the trigger its own name \u2014 pass an icon that carries\n one, or author a self-labelled interactive element (a `<button aria-label>`/`<a>`)\n and pass that as the trigger, which then takes the interactive path above and owns\n both its `onClick` and its label.\n\n```tsx\n// The icon is wrapped in a focusable span; the tooltip content is its description\n<Tooltip trigger={<ADPIcon icon="info" aria-label="More information" />}>\n Tooltip content\n</Tooltip>\n```\n\n> Note: "interactive" is detected structurally \u2014 `element.type` must be one of\n> the intrinsic tags above. A custom component (including this library\'s `Button`\n> component) is **not** auto-detected, because its rendered output can\'t be\n> introspected at runtime, so by default it takes the wrapped path.\n>\n> To make a custom component take the merged-onto-element path, set\n> `interactiveTrigger`. Only do this when the component renders a real\n> interactive element and forwards its `ref` and DOM props (`onClick`, `aria-*`,\n> `className`) to it \u2014 otherwise the trigger loses its keyboard/focus\n> affordances. This library\'s `Button` satisfies that contract.\n\n```tsx\n// Custom component that forwards ref + props: opt in with interactiveTrigger\n<Tooltip clickable interactiveTrigger title="Details" trigger={<Button>Open</Button>}>\n Tooltip content\n</Tooltip>\n```\n\n## Accessibility\n\n- Keyboard accessible: interactive triggers activate natively; non-interactive\n triggers are exposed as a focusable wrapper (a native `<button>` when `clickable`,\n otherwise a focusable `<span>`).\n- Reference props (including `aria-describedby` linking the trigger to the tooltip)\n are applied to the actual reference element.\n- Preserves the trigger\'s own accessible name instead of overriding it.\n- Focus management handled via `@floating-ui/react`.\n'
3836
+ }
3837
+ ],
3838
+ "directories": []
3839
+ },
3840
+ "transferlist": {
3841
+ "name": "transferList",
3842
+ "description": 'The TransferList is a fully-controlled two-panel widget for moving items between an **Available** list and a **Selected** list. Each panel has a **"Select all" checkbox** above its list and a **move button** below it that transfers the currently-checked items to the other panel \u2014 "Add to select" on Available, "Remove from selected" on Selected. Items can also be moved by native HTML5 drag-and-drop. It is intentionally decoupled from any surrounding chrome \u2014 render it inside a `Modal`, a `Card`, or a page section and own the surrounding layout yourself. `MultiSelectTransfer` composes it inside a modal. **When to use:** - Assigning a subset of items (permissions, columns, members) from a larger pool - Building an ordered selection where position matters (enable `reorderable`) - Any "pick from a long, possibly paginated list" workflow **Component Architecture:** - Fully controlled: `availableItems`, `selectedItems`, and `onChange` are owned by the consumer - Styled with `tailwind-variants` (`tv()`) slots - Native drag-and-drop (no extra dependency) for cross-panel transfer and reorder - Infinite scroll on the Available panel via an `IntersectionObserver` sentinel - Responsive: panels sit side-by-side on `sm`+ and stack vertically on small screens - Reuses `Checkbox`, `Button`, `Scrollbar`, `Loader`, and `ADPIcon`',
3843
+ "dependencies": [
3844
+ "react",
3845
+ "tailwind-variants",
3846
+ "tailwind-merge"
3847
+ ],
3848
+ "internalDependencies": [
3849
+ "button",
3850
+ "adpIcon",
3851
+ "scrollbar",
3852
+ "loader",
3853
+ "checkbox",
3854
+ "emptyState",
3855
+ "card"
3856
+ ],
3857
+ "files": [
3858
+ {
3859
+ "name": "useTransferListSource.ts",
3860
+ "content": 'import { useCallback, useEffect, useRef, useState, type ReactNode } from "react";\n\nimport {\n useAsyncOptions,\n useAvailableProjection,\n useFilterQuery,\n useIgnoredPropWarning,\n useOnValueChange,\n usePrefetchBaseline\n} from "@hooks";\nimport { resolveLoadErrors } from "@utils";\nimport type {\n ITransferListItem,\n TTransferListLoadOptions,\n TTransferListPrefetch,\n TTransferListValue\n} from "./types";\n\n// One shared identity for the empty case: TransferList memoises several passes over this array, and a\n// fresh `[]` per render would invalidate every one of them.\nconst EMPTY_ITEMS: ITransferListItem[] = [];\n\n/**\n * Items previously seen in `selectedItems`, tagged with the `optionsKey` they were seen under. Held\n * as both a map (the identity check below is a lookup, not a scan) and the list the projection wants,\n * built once here rather than materialised on every read.\n */\ninterface ISeenSelected {\n key: string | number | undefined;\n items: Map<TTransferListValue, ITransferListItem>;\n list: ITransferListItem[];\n}\n\nconst EMPTY_SEEN: Map<TTransferListValue, ITransferListItem> = new Map();\n\ninterface IUseTransferListSourceArgs {\n availableItems?: ITransferListItem[];\n /** Controlled by the consumer in every mode \u2014 the selection is the whole point of the component. */\n selectedItems: ITransferListItem[];\n\n loadAvailableOptions?: TTransferListLoadOptions;\n initialAvailableOptions?: readonly ITransferListItem[];\n prefetch?: TTransferListPrefetch;\n refetchOnClear?: boolean;\n optionsKey?: string | number;\n availableFilterDebounceMs?: number;\n loadErrorMessage?: ReactNode;\n loadMoreErrorMessage?: ReactNode;\n onLoadError?: ( error: unknown ) => void;\n\n // Consumer-driven equivalents, used verbatim when there is no loader.\n hasMoreAvailable?: boolean;\n onLoadMoreAvailable?: () => void;\n isLoadingMoreAvailable?: boolean;\n isLoadingAvailable?: boolean;\n availableLoadError?: ReactNode;\n availableLoadMoreError?: ReactNode;\n onRetryLoadMoreAvailable?: () => void;\n availableTotalCount?: number;\n availableSearchTerm?: string;\n onAvailableSearchChange?: ( query: string ) => void;\n}\n\ninterface ITransferListSource {\n /** The available pool: derived from the loaded pages in async mode, the prop otherwise. */\n availableItems: ITransferListItem[];\n hasMoreAvailable: boolean;\n onLoadMoreAvailable?: () => void;\n isLoadingMoreAvailable: boolean;\n isLoadingAvailable: boolean;\n availableLoadError?: ReactNode;\n availableLoadMoreError?: ReactNode;\n onRetryLoadMoreAvailable?: () => void;\n availableTotalCount?: number;\n /** In async mode these make the panel\'s search controlled and server-driven. */\n availableSearchTerm?: string;\n onAvailableSearchChange?: ( query: string ) => void;\n}\n\n/**\n * `TransferList`\'s available-panel source. In async mode it owns a `useAsyncOptions` instance, a\n * debounced `useFilterQuery` for the panel\'s search (which is a raw `onChange` otherwise), the\n * mount/`optionsKey` prefetch, and the pool \u2192 available projection. Without a loader every value is\n * the corresponding prop, unchanged.\n */\nexport function useTransferListSource({\n availableItems,\n selectedItems,\n loadAvailableOptions,\n initialAvailableOptions,\n prefetch,\n refetchOnClear = false,\n optionsKey,\n availableFilterDebounceMs = 300,\n loadErrorMessage,\n loadMoreErrorMessage,\n onLoadError,\n hasMoreAvailable = false,\n onLoadMoreAvailable,\n isLoadingMoreAvailable = false,\n isLoadingAvailable = false,\n availableLoadError,\n availableLoadMoreError,\n onRetryLoadMoreAvailable,\n availableTotalCount,\n availableSearchTerm,\n onAvailableSearchChange\n}: IUseTransferListSourceArgs ): ITransferListSource {\n const isAsync = typeof loadAvailableOptions === "function";\n\n const asyncOptions = useAsyncOptions<ITransferListItem>({\n loadOptions: loadAvailableOptions,\n initialOptions: initialAvailableOptions,\n prefetchDefaults: prefetch !== "never",\n refetchOnClear,\n optionsKey,\n onLoadError,\n getOptionKey: ( item ) => item.value\n });\n\n const { filterQuery, setFilterQuery, resetFilter } = useFilterQuery({\n onFilterChange: asyncOptions.onFilterChange,\n filterDebounceMs: availableFilterDebounceMs\n });\n\n // Stable identity, because TransferList feeds this handler to the memo that guards the available\n // panel\'s per-render filter passes \u2014 and the drag-over path that memo exists for re-renders often\n // enough that a fresh arrow per render would defeat it. The consumer\'s own handler is read through\n // a ref, so an inline prop costs nothing here either.\n const onAvailableSearchChangeRef = useRef( onAvailableSearchChange );\n onAvailableSearchChangeRef.current = onAvailableSearchChange;\n const handleAsyncAvailableSearch = useCallback(( query: string ) => {\n onAvailableSearchChangeRef.current?.( query );\n setFilterQuery( query );\n }, [setFilterQuery]);\n\n // The panel has no open/close \u2014 its list is always visible \u2014 so mount is the only prefetch trigger\n // it has, which is why no `isOpen` is passed.\n usePrefetchBaseline({ prefetch: prefetch ?? "mount", optionsKey, ensureDefaults: asyncOptions.ensureDefaults });\n\n // Route an optionsKey CHANGE into the clear path. Skipped on mount.\n useOnValueChange( optionsKey, resetFilter );\n\n useIgnoredPropWarning(\n isAsync && availableItems !== undefined,\n "TransferList: `availableItems` is ignored when `loadAvailableOptions` is set \u2014 " +\n "use `initialAvailableOptions` to seed the list."\n );\n // The mirror of the above: seed rows only mean anything to the async source, so without a loader they\n // vanish silently \u2014 the same mistake, and just as quiet.\n useIgnoredPropWarning(\n !isAsync && initialAvailableOptions !== undefined,\n "TransferList: `initialAvailableOptions` is ignored without `loadAvailableOptions` \u2014 " +\n "pass those rows as `availableItems` instead."\n );\n // Same class of mistake: `prefetch` only ever schedules the baseline fetch, so with the rows already\n // in `availableItems` there is nothing for it to trigger and it silently does nothing.\n useIgnoredPropWarning(\n !isAsync && prefetch !== undefined,\n "TransferList: `prefetch` is ignored without `loadAvailableOptions` \u2014 " +\n "`availableItems` are already on screen, so there is nothing to fetch."\n );\n\n // Items the loaded pool may not contain: everything that has ever appeared in `selectedItems`.\n // Without this, moving a selected-but-never-fetched item back to Available would make it vanish \u2014\n // the pool and `selectedItems` are the only two ways an item can be in the component. State, not a\n // ref accumulated from the projection below: a `useMemo` is a calculation React may discard and\n // re-run. The key travels WITH the map, so a stale key is a pure comparison at read time rather than\n // an effect-based clear that would paint one frame of the previous set.\n const [ seenSelected, setSeenSelected ] = useState<ISeenSelected>(\n () => ({ key: optionsKey, items: EMPTY_SEEN, list: EMPTY_ITEMS })\n );\n\n useEffect(() => {\n if ( !isAsync ) {\n return;\n }\n setSeenSelected(( previous ) => {\n const carried = previous.key === optionsKey ? previous.items : null;\n // Nothing new to remember: `previous` keeps the projection\'s memo intact, so a re-render that\n // did not change the selection costs one pass and no extra render.\n if ( carried && selectedItems.every(( item ) => carried.get( item.value ) === item )) {\n return previous;\n }\n const items = new Map( carried ?? []);\n selectedItems.forEach(( item ) => items.set( item.value, item ));\n return { key: optionsKey, items, list: Array.from( items.values()) };\n });\n }, [ isAsync, selectedItems, optionsKey ]);\n\n // An `optionsKey` change drops the pool, so the items remembered for the previous option set go\n // with it \u2014 otherwise the new set\'s Available panel is polluted by the old one\'s rows.\n const remembered = seenSelected.key === optionsKey ? seenSelected.list : EMPTY_ITEMS;\n // Sync consumers never read this, hence the `isAsync` gate.\n const derivedAvailable = useAvailableProjection(\n isAsync,\n asyncOptions.options,\n remembered,\n selectedItems,\n filterQuery\n );\n\n if ( !isAsync ) {\n return {\n // Passed through by identity: TransferList memoises several O(n) passes over this array, and a\n // per-render copy would defeat every one of them.\n availableItems: availableItems ?? EMPTY_ITEMS,\n hasMoreAvailable,\n onLoadMoreAvailable,\n isLoadingMoreAvailable,\n isLoadingAvailable,\n availableLoadError,\n availableLoadMoreError,\n onRetryLoadMoreAvailable,\n availableTotalCount,\n availableSearchTerm,\n onAvailableSearchChange\n };\n }\n\n const { loadError, loadMoreError } = resolveLoadErrors({\n errorKind: asyncOptions.errorKind,\n loadErrorMessage,\n loadMoreErrorMessage\n });\n return {\n availableItems: derivedAvailable,\n hasMoreAvailable: asyncOptions.hasMore,\n onLoadMoreAvailable: asyncOptions.loadMore,\n isLoadingMoreAvailable: asyncOptions.isLoadingMore,\n isLoadingAvailable: isLoadingAvailable || asyncOptions.isReplacing,\n availableLoadError: loadError,\n availableLoadMoreError: loadMoreError,\n onRetryLoadMoreAvailable: asyncOptions.retryMore,\n availableTotalCount: availableTotalCount ?? asyncOptions.total,\n // Defined, so transferList.tsx\'s existing controlled-search path takes over and the local matcher\n // stands down \u2014 over a paged pool it would only ever search the pages that happen to be loaded.\n availableSearchTerm: filterQuery,\n onAvailableSearchChange: handleAsyncAvailableSearch\n };\n}\n'
3861
+ },
3862
+ {
3863
+ "name": "useTransferListPanelKeys.ts",
3864
+ "content": 'import type { KeyboardEvent } from "react";\n\nimport { keyboardKeys } from "@constants";\nimport type { ITransferListItem, TTransferListValue } from "./types";\n\ninterface IUseTransferListPanelKeysArgs {\n items: ITransferListItem[];\n activeIndex: number;\n setActiveIndex: ( index: number ) => void;\n moveActive: ( direction: 1 | -1 ) => void;\n firstEnabledIndex: ( from: number, direction: 1 | -1 ) => number;\n reorderable: boolean;\n onToggle: ( value: TTransferListValue ) => void;\n onRemove?: ( value: TTransferListValue ) => void;\n onMoveUp?: ( index: number ) => void;\n onMoveDown?: ( index: number ) => void;\n setIsFocused: ( focused: boolean ) => void;\n /**\n * The rows the arrow keys are addressing are about to be replaced (a search fetch is in flight, or\n * an error has taken the list\'s place), so every key is swallowed. The single place this gate is\n * expressed.\n */\n isBlocked: boolean;\n}\n\n/**\n * The listbox key handler for one transfer-list panel: arrow/Home/End navigation over\n * `aria-activedescendant`, Enter/Space to toggle, Delete/Backspace to remove, and Alt+Arrow to\n * reorder.\n */\nexport function useTransferListPanelKeys({\n items,\n activeIndex,\n setActiveIndex,\n moveActive,\n firstEnabledIndex,\n reorderable,\n onToggle,\n onRemove,\n onMoveUp,\n onMoveDown,\n setIsFocused,\n isBlocked\n}: IUseTransferListPanelKeysArgs ): ( e: KeyboardEvent<HTMLDivElement> ) => void {\n return ( e: KeyboardEvent<HTMLDivElement> ) => {\n if ( isBlocked ) {\n return;\n }\n // Any key interaction is keyboard mode, so light the active row - covers the case where focus\n // arrived by pointer (which is not :focus-visible, so onFocus left it dark) and the user then\n // starts navigating with the arrows. onMouseDown turns it back off when they switch to pointer.\n setIsFocused( true );\n const activeItem = items[activeIndex];\n\n // Alt+Arrow reorders the active row (reorderable selected panel), keeping it active as it\n // moves. Checked before the plain Arrow navigation below.\n if ( e.altKey && ( e.key === keyboardKeys.arrowUp || e.key === keyboardKeys.arrowDown )) {\n if ( !reorderable || !activeItem ) {\n return;\n }\n e.preventDefault();\n if ( e.key === keyboardKeys.arrowUp && activeIndex > 0 ) {\n onMoveUp?.( activeIndex );\n setActiveIndex( activeIndex - 1 );\n } else if ( e.key === keyboardKeys.arrowDown && activeIndex < items.length - 1 ) {\n onMoveDown?.( activeIndex );\n setActiveIndex( activeIndex + 1 );\n }\n return;\n }\n\n switch ( e.key ) {\n case keyboardKeys.arrowDown:\n e.preventDefault();\n moveActive( 1 );\n break;\n case keyboardKeys.arrowUp:\n e.preventDefault();\n moveActive( -1 );\n break;\n case keyboardKeys.home:\n e.preventDefault();\n setActiveIndex( firstEnabledIndex( 0, 1 ));\n break;\n case keyboardKeys.end:\n e.preventDefault();\n setActiveIndex( firstEnabledIndex( items.length - 1, -1 ));\n break;\n case keyboardKeys.enter:\n case keyboardKeys.space:\n if ( activeItem && !activeItem.isDisabled ) {\n e.preventDefault();\n onToggle( activeItem.value );\n }\n break;\n // Delete / Backspace removes the active row back to Available (selected panel only). On a\n // Mac keyboard the "delete" key reports as Backspace, so both are accepted.\n case keyboardKeys.delete:\n case keyboardKeys.backspace:\n if ( onRemove && activeItem && !activeItem.isDisabled ) {\n e.preventDefault();\n onRemove( activeItem.value );\n }\n break;\n default:\n break;\n }\n };\n}\n'
3865
+ },
3866
+ {
3867
+ "name": "useTransferList.ts",
3868
+ "content": 'import { useCallback, useState } from "react";\n\nimport type { ITransferListItem, TTransferListValue, TTransferPanel } from "./types";\n\ninterface IUseTransferListArgs {\n availableItems: ITransferListItem[];\n selectedItems: ITransferListItem[];\n onChange: ( availableItems: ITransferListItem[], selectedItems: ITransferListItem[]) => void;\n}\n\ninterface IDragState {\n value: TTransferListValue;\n panel: TTransferPanel;\n}\n\n/**\n * Holds the transient UI state for a TransferList: per-panel checkbox sets and\n * the active drag descriptor. The item arrays themselves stay controlled by the\n * parent \u2014 every mutation here is forwarded through `onChange`.\n */\nexport function useTransferList({ availableItems, selectedItems, onChange }: IUseTransferListArgs ) {\n const [ availableChecked, setAvailableChecked ] = useState<Set<TTransferListValue>>( new Set());\n const [ selectedChecked, setSelectedChecked ] = useState<Set<TTransferListValue>>( new Set());\n const [ drag, setDrag ] = useState<IDragState | null>( null );\n\n const clearChecks = useCallback(() => {\n setAvailableChecked( new Set());\n setSelectedChecked( new Set());\n }, []);\n\n const isChecked = useCallback(\n ( panel: TTransferPanel, value: TTransferListValue ) =>\n ( panel === "available" ? availableChecked : selectedChecked ).has( value ),\n [ availableChecked, selectedChecked ]\n );\n\n const toggleCheck = useCallback(( panel: TTransferPanel, value: TTransferListValue ) => {\n const setter = panel === "available" ? setAvailableChecked : setSelectedChecked;\n setter(( prev ) => {\n const next = new Set( prev );\n if ( next.has( value )) {\n next.delete( value );\n } else {\n next.add( value );\n }\n return next;\n });\n }, []);\n\n // Check or uncheck the given values in a panel, leaving every other value in the set alone.\n // Powers the per-panel "Select all" checkbox, which addresses only the search-visible rows \u2014 a\n // replace would silently drop checks the user made under a previous query.\n const setPanelChecked = useCallback(\n ( panel: TTransferPanel, values: TTransferListValue[], checked: boolean ) => {\n const setter = panel === "available" ? setAvailableChecked : setSelectedChecked;\n setter(( prev ) => {\n const next = new Set( prev );\n values.forEach(( value ) => ( checked ? next.add( value ) : next.delete( value )));\n return next;\n });\n },\n []\n );\n\n // Forward the next arrays to the parent in the correct (available, selected)\n // order given the panel a move originated from, then reset the checkboxes.\n const commit = useCallback(\n ( from: TTransferPanel, nextSource: ITransferListItem[], nextTarget: ITransferListItem[]) => {\n if ( from === "available" ) {\n onChange( nextSource, nextTarget );\n } else {\n onChange( nextTarget, nextSource );\n }\n clearChecks();\n },\n [ onChange, clearChecks ]\n );\n\n // Move the given items from one panel to the other (appended). Disabled items\n // are skipped. Used by the \u203A/\xBB (from available) and \u2039/\xAB (from selected) controls.\n const moveMany = useCallback(\n ( values: TTransferListValue[], from: TTransferPanel ) => {\n const [ source, target ] = from === "available" ? [ availableItems, selectedItems ] : [ selectedItems, availableItems ];\n const wanted = new Set( values );\n const moving = source.filter(( item ) => wanted.has( item.value ) && !item.isDisabled );\n if ( moving.length === 0 ) {\n return;\n }\n const movingValues = new Set( moving.map(( item ) => item.value ));\n commit( from, source.filter(( item ) => !movingValues.has( item.value )), [ ...target, ...moving ]);\n },\n [ availableItems, selectedItems, commit ]\n );\n\n const moveRight = useCallback(( values: TTransferListValue[]) => moveMany( values, "available" ), [moveMany]);\n const moveLeft = useCallback(( values: TTransferListValue[]) => moveMany( values, "selected" ), [moveMany]);\n\n // Cross-panel drag drop: transfer a single item to the other panel at an\n // optional insert index (appends when omitted).\n const transferOne = useCallback(\n ( value: TTransferListValue, from: TTransferPanel, insertIndex?: number ) => {\n const [ source, target ] = from === "available" ? [ availableItems, selectedItems ] : [ selectedItems, availableItems ];\n const item = source.find(( entry ) => entry.value === value );\n if ( !item || item.isDisabled ) {\n return;\n }\n const nextTarget = [...target];\n nextTarget.splice( insertIndex ?? nextTarget.length, 0, item );\n commit( from, source.filter(( entry ) => entry.value !== value ), nextTarget );\n },\n [ availableItems, selectedItems, commit ]\n );\n\n const transferToSelected = useCallback(\n ( value: TTransferListValue, insertIndex?: number ) => transferOne( value, "available", insertIndex ),\n [transferOne]\n );\n const transferToAvailable = useCallback(\n ( value: TTransferListValue ) => transferOne( value, "selected" ), [transferOne]);\n\n // Reorder within the selected panel (drag-reorder or up/down arrows).\n const reorderSelected = useCallback(\n ( from: number, to: number ) => {\n if ( from === to || from < 0 || to < 0 || from >= selectedItems.length || to >= selectedItems.length ) {\n return;\n }\n const next = [...selectedItems];\n const [moved] = next.splice( from, 1 );\n next.splice( to, 0, moved );\n onChange( availableItems, next );\n clearChecks();\n },\n [ availableItems, selectedItems, onChange, clearChecks ]\n );\n\n return {\n isChecked,\n toggleCheck,\n setPanelChecked,\n moveRight,\n moveLeft,\n transferToSelected,\n transferToAvailable,\n reorderSelected,\n drag,\n setDrag\n };\n}\n'
3869
+ },
3870
+ {
3871
+ "name": "useDragAutoScroll.ts",
3872
+ "content": 'import { useCallback, useEffect, useRef } from "react";\n\n/**\n * Auto-scrolls a container while a native drag hovers near its top/bottom edge. This is what\n * makes drag-to-reorder usable once the list is virtualized: only the rows near the pointer are\n * in the DOM, so without auto-scroll a far-off insertion point can never be reached.\n *\n * Attach `onDragOver` to the scrollable element. The scroll speed ramps up the closer the\n * pointer gets to an edge and is driven by a `requestAnimationFrame` loop so it keeps scrolling\n * even while the pointer is held still (native `dragover` only fires on movement). A window-level\n * `dragend`/`drop` listener guarantees the loop stops even when the drag ends over another panel.\n */\nexport function useDragAutoScroll(\n scrollRef: React.RefObject<HTMLElement>,\n edgeSize = 48,\n maxSpeed = 16\n): { onDragOver: ( e: React.DragEvent ) => void } {\n const speedRef = useRef( 0 );\n const rafRef = useRef<number | null>( null );\n\n const stop = useCallback(() => {\n speedRef.current = 0;\n if ( rafRef.current !== null ) {\n cancelAnimationFrame( rafRef.current );\n rafRef.current = null;\n }\n }, []);\n\n const tick = useCallback(() => {\n const el = scrollRef.current;\n if ( el && speedRef.current !== 0 ) {\n el.scrollTop += speedRef.current;\n rafRef.current = requestAnimationFrame( tick );\n } else {\n rafRef.current = null;\n }\n }, [scrollRef]);\n\n const onDragOver = useCallback(\n ( e: React.DragEvent ) => {\n const el = scrollRef.current;\n if ( !el ) {\n return;\n }\n const rect = el.getBoundingClientRect();\n const topDist = e.clientY - rect.top;\n const bottomDist = rect.bottom - e.clientY;\n let speed = 0;\n if ( topDist < edgeSize ) {\n speed = -Math.ceil((( edgeSize - topDist ) / edgeSize ) * maxSpeed );\n } else if ( bottomDist < edgeSize ) {\n speed = Math.ceil((( edgeSize - bottomDist ) / edgeSize ) * maxSpeed );\n }\n speedRef.current = speed;\n if ( speed !== 0 && rafRef.current === null ) {\n rafRef.current = requestAnimationFrame( tick );\n } else if ( speed === 0 ) {\n stop();\n }\n },\n [ scrollRef, edgeSize, maxSpeed, tick, stop ]\n );\n\n useEffect(() => {\n window.addEventListener( "dragend", stop );\n window.addEventListener( "drop", stop );\n return () => {\n window.removeEventListener( "dragend", stop );\n window.removeEventListener( "drop", stop );\n stop();\n };\n }, [stop]);\n\n return { onDragOver };\n}\n'
3873
+ },
3874
+ {
3875
+ "name": "types.ts",
3876
+ "content": 'import type { ReactNode } from "react";\n\nimport type { TLoadOptions, TPrefetch } from "@hooks";\n\n/**\n * `TPrefetch` minus `"open"`: the panel\'s list is always visible, so it has no open event to hang a\n * fetch on. Narrowed rather than redefined, so the family shares one vocabulary.\n */\nexport type TTransferListPrefetch = Exclude<TPrefetch, "open">;\n\n/**\n * Which of the two panels an item or action belongs to.\n */\nexport type TTransferPanel = "available" | "selected";\n\n/**\n * Unique identifier for a transferable item. Kept intentionally permissive so\n * consumers can key items off primitive ids (e.g. numeric database ids) without\n * having to stringify them first. Must be unique across both panels.\n */\nexport type TTransferListValue = string | number;\n\n/**\n * A single transferable item. The shape composing components alias rather than redeclare, so an\n * option and a transfer-list item stay structurally identical.\n */\nexport interface ITransferListItem {\n value: TTransferListValue;\n label: ReactNode;\n /** Plain-text used for searching when `label` is a ReactNode. Takes precedence over label/value. */\n searchValue?: string;\n isDisabled?: boolean;\n}\n\n/** Async source for the available panel. Paged: `cursor`, `hasMore` and `total` are all honoured. */\nexport type TTransferListLoadOptions = TLoadOptions<ITransferListItem>;\n\nexport interface ITransferListProps {\n /**\n * Items in the available (left) panel. Controlled. Optional and **ignored** (with a dev warning)\n * when `loadAvailableOptions` is set \u2014 in that mode the component owns the available pool.\n */\n availableItems?: ITransferListItem[];\n /** Items in the selected (right) panel. Order is preserved when reorderable. Controlled. */\n selectedItems: ITransferListItem[];\n /** Fired on every move/reorder with the next available + selected arrays. */\n onChange: ( availableItems: ITransferListItem[], selectedItems: ITransferListItem[]) => void;\n\n /** Heading for the available panel. @default "Available Items" */\n availablePanelTitle?: ReactNode;\n /** Heading for the selected panel. @default "Selected Items" */\n selectedPanelTitle?: ReactNode;\n\n /** Show the per-panel search inputs. @default true */\n searchable?: boolean;\n /** Controlled search term for the available panel. Overridden when `loadAvailableOptions` is set. */\n availableSearchTerm?: string;\n /**\n * Controlled-search change handler for the available panel. Fires on every keystroke (no built-in\n * debounce).\n *\n * Without `loadAvailableOptions`: switches off the panel\'s local filtering \u2014 `availableItems` is\n * treated as already filtered for the query \u2014 so the debounce, the fetch, the loading state, the\n * response ordering, and subtracting `selectedItems` from the result are the consumer\'s\n * responsibility.\n *\n * With `loadAvailableOptions`: notification-only, for analytics.\n */\n onAvailableSearchChange?: ( query: string ) => void;\n /** Controlled search term for the selected panel. */\n selectedSearchTerm?: string;\n /** Controlled-search change handler for the selected panel. */\n onSelectedSearchChange?: ( query: string ) => void;\n /** Placeholder for both search inputs. @default "Search here" */\n searchPlaceholder?: string;\n\n /** Custom content rendered under the available panel search input. */\n availablePanelHeaderSlot?: ReactNode;\n /** Custom content rendered under the selected panel search input. */\n selectedPanelHeaderSlot?: ReactNode;\n\n /** Label for the available panel\'s move button. A `(count)` suffix is appended when items are checked. @default "Add to select" */\n moveToSelectedLabel?: string;\n /** Label for the selected panel\'s move button. A `(count)` suffix is appended when items are checked. @default "Remove from selected" */\n moveToAvailableLabel?: string;\n\n /** Enable drag handles, position badges and up/down arrows on the selected panel. @default false */\n reorderable?: boolean;\n\n /** Tooltip for the transfer list reload button. */\n reloadTooltip?: string;\n /** Fired when the reload button is clicked. */\n onReload?: () => void;\n /** Spins the reload icon and disables the button. */\n isReloading?: boolean;\n\n // Consumer-owned paging and load state \u2014 the escape-hatch counterpart to `onAvailableSearchChange`\n // above. All of these are derived internally when `loadAvailableOptions` is set, and the ones marked\n // below are ignored in that mode rather than merged.\n /** More available items can be loaded (drives the infinite-scroll sentinel). Ignored when `loadAvailableOptions` is set. */\n hasMoreAvailable?: boolean;\n /** Fired when the available list sentinel scrolls into view. Ignored when `loadAvailableOptions` is set. */\n onLoadMoreAvailable?: () => void;\n /** Renders a loader row at the bottom of the available list. Ignored when `loadAvailableOptions` is set. */\n isLoadingMoreAvailable?: boolean;\n\n /**\n * Loader REPLACES the available rows (a search/refresh fetch, not a page append). OR-ed with the\n * loader\'s own state, so it still applies in async mode. @default false\n */\n isLoadingAvailable?: boolean;\n /** Replaces the available rows when set: the available source failed to load. Ignored in async mode \u2014 use `loadErrorMessage`. */\n availableLoadError?: ReactNode;\n /**\n * Shown under the loaded rows when a page append failed; renders a retry button. Ignored in async\n * mode \u2014 use `loadMoreErrorMessage`.\n */\n availableLoadMoreError?: ReactNode;\n /** Fired by the retry button under `availableLoadMoreError`. Ignored when `loadAvailableOptions` is set. */\n onRetryLoadMoreAvailable?: () => void;\n /** Label for that retry button. @default "Retry" */\n retryLabel?: string;\n /** Server-side total for the available panel; the header count becomes "(loaded of total)". Takes precedence over the loader\'s own total. */\n availableTotalCount?: number;\n\n /**\n * Async source for the available panel. When provided, the component owns that panel\'s pool, paging,\n * request lifecycle and loading/error state; `availableItems` is ignored (dev warning) and the\n * panel\'s search becomes server-driven. `selectedItems` stays controlled \u2014 the consumer owns the\n * selection \u2014 and `onChange` still fires with both arrays.\n */\n loadAvailableOptions?: TTransferListLoadOptions;\n /**\n * Seed rows for a pool you already have \u2014 an SSR payload, a route loader, a warm cache. They paint on the\n * first frame, so the panel is never briefly empty, and they stay put while the mount fetch revalidates over\n * them. They go through the same pool-minus-`selectedItems` projection as fetched rows. They do not suppress\n * that fetch: pair with `prefetch="never"` if the seed is the whole pool until the user searches. Seed rows\n * carry no cursor, so nothing pages until a real page lands. A *search* replaces them, since seed rows are\n * not results for a query. Async mode only \u2014 ignored (dev warning) without `loadAvailableOptions`, where the\n * rows belong in `availableItems`.\n */\n initialAvailableOptions?: readonly ITransferListItem[];\n /**\n * When to fetch the unfiltered available list. `"mount"` fires at render \u2014 the panel has no\n * open/close, so mount is the only trigger it has. `"never"` defers everything until the user\n * searches, for a heavy list that should stay untouched otherwise.\n *\n * Async mode only \u2014 ignored (dev warning) without `loadAvailableOptions`, where `availableItems` are\n * already on screen and there is nothing to fetch. @default "mount"\n */\n prefetch?: TTransferListPrefetch;\n /** Clearing the available search revalidates the cached baseline instead of just restoring it. @default false */\n refetchOnClear?: boolean;\n /** Identity of the available option set. A change drops cached pages and repopulates. Does NOT clear the selection. */\n optionsKey?: string | number;\n /** Debounce for the available panel\'s search when it is server-driven. @default 300 */\n availableFilterDebounceMs?: number;\n /** Shown in place of the available rows when the loader rejects. @default "Couldn\'t load options." */\n loadErrorMessage?: ReactNode;\n /** Shown under the loaded rows when a page append rejects. @default "Couldn\'t load more." */\n loadMoreErrorMessage?: ReactNode;\n /** Notified when a load rejects (the component renders the message and swallows it). */\n onLoadError?: ( error: unknown ) => void;\n\n /** Disable all interaction. */\n disabled?: boolean;\n\n /** Empty-state copy for the available panel. @default "No Data Found!" */\n availableEmptyText?: ReactNode;\n /** Empty-state copy for the selected panel. @default "No Data Found!" */\n selectedEmptyText?: ReactNode;\n\n className?: string;\n}\n'
3877
+ },
3878
+ {
3879
+ "name": "transferListVariants.ts",
3880
+ "content": 'import { tv } from "tailwind-variants";\n\nexport const transferListVariants = tv({\n slots: {\n base: "flex flex-col gap-3 w-full sm:flex-row sm:items-stretch sm:gap-4 sm:h-[30rem]",\n // `flex-1` is intentionally gated behind `sm:`: on desktop the base is a fixed-height flex-row\n // and flex-1 makes the two panels share the width. On mobile the base is an auto-height column,\n // where flex-1 (flex-basis:0%) would override the `h-[30rem]` height bound and let the panel grow\n // to its full content height - collapsing the virtualizer\'s viewport so it renders every row and\n // freezes on large lists. Keeping flex-1 desktop-only lets `h-[30rem]` bound the scroll container.\n panel: "flex flex-col min-w-0 h-[30rem] rounded-md border border-secondary-100 overflow-hidden bg-white" +\n " dark:bg-iridium dark:border-secondary-500 sm:flex-1 sm:h-full",\n panelHeader: "flex items-center justify-between gap-2 px-4 py-3 border-b dark:border-b-0 border-secondary-100 dark:bg-secondary-800",\n panelTitle: "flex items-center gap-1 font-medium text-base text-secondary-500 dark:text-secondary-50",\n panelCount: "text-base text-secondary-500 dark:text-secondary-50",\n searchArea: "p-3 border-b border-secondary-100 dark:border-secondary-500 dark:bg-secondary-800",\n searchBox: "flex items-center gap-2 px-3 py-2 rounded border border-secondary-100 bg-frostBlue dark:bg-iridium dark:border-secondary-500",\n search: "w-full outline-none bg-transparent dark:bg-iridium text-base text-secondary-500 placeholder:text-secondary-300 dark:text-secondary-200",\n headerSlot: "px-3 py-2 border-b border-secondary-100 dark:border-secondary-500",\n selectAllRow: "flex items-center px-4 pt-4",\n listRegion: "relative flex flex-col flex-1 min-h-0 outline-none" +\n " focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-400",\n listWrap: "flex-1 min-h-0",\n list: "flex flex-col gap-3 p-3",\n // Windowed (virtualized) list: the scroll element itself carries the padding (the sizer\n // below is absolutely-positioned content), and the sizer reserves the full scroll height.\n virtualScroll: "flex-1 min-h-0 overflow-y-auto p-3",\n virtualSizer: "relative w-full",\n emptyWrap: "flex flex-col flex-1 items-center justify-center gap-4 p-4",\n emptyText: "text-base font-medium text-center text-secondary-400 dark:text-secondary-300",\n loaderRow: "flex justify-center py-3",\n // The replace loader fills the list region, unlike loaderRow which appends below the rows.\n replaceLoader: "flex flex-1 items-center justify-center py-3",\n // "Error instead of rows" for the whole panel, and the recoverable "that page failed" row that\n // replaces the append loader at the bottom of the list.\n panelError: "flex flex-1 items-center justify-center px-4 py-3 text-base text-center text-error-700 dark:text-error-400",\n loadMoreErrorRow: "flex items-center justify-center gap-2 py-3 text-base text-error-700 dark:text-error-400",\n row: "group relative flex items-center gap-2 px-3 py-2 rounded border outline-none cursor-pointer select-none transition-colors",\n dragHandle: "shrink-0 text-gray-800 dark:text-gray-200 cursor-grab",\n badge: "absolute -top-2 -start-1 p-1 flex items-center justify-center min-w-4 h-4 rounded-full bg-white border border-primary-100" +\n " !text-primary-600 dark:!text-primary-300 text-xxs leading-none dark:bg-secondary-600 dark:border-primary-400",\n // min-h-5 reserves one text-base line (~20px) so the row keeps its height when the label\n // leaves flow (position:absolute) on hover. Without it the row\'s cross-size would collapse to\n // the shorter size="sm" checkbox / size="xs" drag handle, shrinking every hovered row by ~4px\n // and shifting the rows below. self-stretch then pins the wrapper to that reserved cross-size. The expand\n // is gated on data-truncated (set by useIsTruncated), so labels that already fit are untouched.\n rowLabelWrap: "relative flex flex-1 min-w-0 min-h-5 items-center self-stretch",\n rowLabel: "block w-full min-w-0 truncate text-base leading-5 text-secondary-500 dark:text-secondary-200" +\n " group-data-[truncated=true]:group-hover:absolute group-data-[truncated=true]:group-hover:inset-x-0" +\n " group-data-[truncated=true]:group-hover:top-1/2 group-data-[truncated=true]:group-hover:-translate-y-1/2" +\n " group-data-[truncated=true]:group-hover:z-20 group-data-[truncated=true]:group-hover:whitespace-normal" +\n " group-data-[truncated=true]:group-hover:overflow-visible group-data-[truncated=true]:group-hover:break-words" +\n " group-data-[truncated=true]:group-hover:rounded group-data-[truncated=true]:group-hover:border" +\n " group-data-[truncated=true]:group-hover:border-secondary-200 group-data-[truncated=true]:group-hover:bg-white" +\n " group-data-[truncated=true]:group-hover:shadow-md group-data-[truncated=true]:group-hover:p-2" +\n " group-data-[truncated=true]:group-focus-visible:absolute group-data-[truncated=true]:group-focus-visible:inset-x-0" +\n " group-data-[truncated=true]:group-focus-visible:top-1/2 group-data-[truncated=true]:group-focus-visible:-translate-y-1/2" +\n " group-data-[truncated=true]:group-focus-visible:z-20 group-data-[truncated=true]:group-focus-visible:whitespace-normal" +\n " group-data-[truncated=true]:group-focus-visible:overflow-visible group-data-[truncated=true]:group-focus-visible:break-words" +\n " group-data-[truncated=true]:group-focus-visible:rounded group-data-[truncated=true]:group-focus-visible:border" +\n " group-data-[truncated=true]:group-focus-visible:border-secondary-200 group-data-[truncated=true]:group-focus-visible:bg-white" +\n " group-data-[truncated=true]:group-focus-visible:shadow-md" +\n " dark:group-data-[truncated=true]:group-hover:border-primary-400 dark:group-data-[truncated=true]:group-hover:bg-iridium" +\n " dark:group-data-[truncated=true]:group-focus-visible:border-primary-400" +\n " dark:group-data-[truncated=true]:group-focus-visible:bg-iridium",\n rowActions: "flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",\n removeButton: "flex items-center text-gray-800 hover:text-error-500 dark:text-secondary-400",\n reorderButton: "flex items-center text-gray-800 hover:text-primary-500 disabled:opacity-30 dark:text-secondary-400",\n panelFooter: "flex items-center justify-end px-4 py-3 border-t border-secondary-100 dark:border-secondary-500",\n dropIndicator: "absolute inset-x-1 z-10 h-0.5 rounded bg-primary-500 pointer-events-none",\n dropOverlay: "absolute inset-2 z-10 flex items-center justify-center pointer-events-none rounded-md border-2 border-dashed" +\n " border-primary-300 bg-primary-50/95 text-base font-medium text-primary-600 dark:border-primary-400" +\n " dark:bg-secondary-700/95 dark:text-primary-300"\n },\n variants: {\n panel: {\n available: {\n row: "bg-white border-secondary-100 hover:bg-primary-50 hover:border-primary-200 focus-visible:border-primary-500" +\n " dark:bg-iridium dark:border-secondary-500 dark:hover:bg-secondary-800"\n },\n selected: {\n listRegion: "m-4 rounded-lg bg-frostBlue overflow-hidden dark:bg-secondary-900",\n virtualScroll: "p-4",\n row: "bg-primary-50 border-primary-100 hover:border-primary-200 focus-visible:border-primary-500 dark:bg-secondary-700 dark:border-secondary-500"\n }\n },\n checked: {\n true: { row: "bg-primary-50 border-primary-200 dark:bg-secondary-700 dark:border-primary-400" },\n false: {}\n },\n // Keyboard-active row (the one aria-activedescendant points at). Rows aren\'t individually\n // focusable under the listbox\'s activedescendant navigation, so this stands in for the\n // focus-visible ring the row would otherwise get.\n active: {\n true: { row: "border-primary-500 dark:border-primary-400" },\n false: {}\n },\n isDisabled: {\n true: { row: "opacity-50 cursor-not-allowed pointer-events-none" },\n false: {}\n },\n // Anchors the drop indicator to the row\'s top or bottom edge, centered in the flex gap\n // between rows. "before" is the common case (dropIndex === index); "after" only applies\n // to the last row, when dropIndex === items.length.\n dropIndicatorPosition: {\n before: { dropIndicator: "-top-[7px]" },\n after: { dropIndicator: "-bottom-[7px]" }\n }\n },\n defaultVariants: {\n panel: "available",\n checked: false,\n active: false,\n isDisabled: false,\n dropIndicatorPosition: "before"\n }\n});\n'
3881
+ },
3882
+ {
3883
+ "name": "transferListPanelHeader.tsx",
3884
+ "content": 'import * as React from "react";\n\nimport { ReloadButton } from "../button/reloadButton";\nimport { ADPIcon, iconList } from "../adpIcon";\nimport { transferListVariants } from "./transferListVariants";\nimport type { TTransferPanel } from "./types";\n\ninterface ITransferListPanelHeaderProps {\n panel: TTransferPanel;\n title: React.ReactNode;\n /** Rows currently loaded in this panel. */\n count: number;\n /** Server-side total; the count becomes "(loaded of total)" when it exceeds `count`. */\n totalCount?: number;\n disabled: boolean;\n\n searchable: boolean;\n searchValue: string;\n searchPlaceholder: string;\n onSearchChange: ( query: string ) => void;\n headerSlot?: React.ReactNode;\n\n reloadTooltip?: string;\n onReload?: () => void;\n isReloading?: boolean;\n}\n\n/**\n * The non-interactive chrome above a transfer-list panel\'s listbox: title + count, the optional\n * reload button, the search input, and the consumer\'s header slot. It shares no state with the\n * listbox below it.\n */\nexport function TransferListPanelHeader({\n panel,\n title,\n count,\n totalCount,\n disabled,\n searchable,\n searchValue,\n searchPlaceholder,\n onSearchChange,\n headerSlot,\n reloadTooltip,\n onReload,\n isReloading\n}: ITransferListPanelHeaderProps ): React.ReactElement {\n const {\n panelHeader,\n panelTitle,\n panelCount,\n searchArea,\n searchBox,\n search,\n headerSlot: headerSlotClass\n } = transferListVariants({ panel });\n\n return (\n <>\n <div className={panelHeader()}>\n <span className={panelTitle()}>\n {title}\n {/* A paged panel that reports "(20)" when the server holds 4 000 matches is lying. */}\n <span className={panelCount()}>\n {totalCount !== undefined && totalCount > count ? `(${count} of ${totalCount})` : `(${count})`}\n </span>\n </span>\n <ReloadButton\n onReload={onReload}\n isReloading={isReloading}\n disabled={disabled}\n tooltip={reloadTooltip}\n className="-m-2 p-2"\n />\n </div>\n\n {searchable && (\n <div className={searchArea()}>\n <div className={searchBox()}>\n <ADPIcon icon={iconList.search} size="xs" className="text-gray-800 dark:text-gray-300" />\n <input\n type="text"\n value={searchValue}\n placeholder={searchPlaceholder}\n disabled={disabled}\n aria-label={`Search ${panel} items`}\n id={`transferListSearch-${panel}`}\n className={search()}\n onChange={( e ) => onSearchChange( e.target.value )}\n />\n </div>\n </div>\n )}\n\n {headerSlot && <div className={headerSlotClass()}>{headerSlot}</div>}\n </>\n );\n}\n\nTransferListPanelHeader.displayName = "TransferListPanelHeader";\n'
3885
+ },
3886
+ {
3887
+ "name": "transferListPanel.tsx",
3888
+ "content": 'import * as React from "react";\nimport { useCallback, useId, useMemo, useRef, useState } from "react";\n\nimport { useInfiniteScroll, useListboxKeyboardNav } from "@hooks";\nimport { Scrollbar } from "../scrollbar";\nimport { Loader } from "../loader";\nimport { Checkbox } from "../checkbox";\nimport { Button } from "../button";\nimport { iconList } from "../adpIcon";\nimport { EmptyState } from "../emptyState";\nimport { TransferListItem } from "./transferListItem";\nimport { TransferListPanelHeader } from "./transferListPanelHeader";\nimport { useDragAutoScroll } from "./useDragAutoScroll";\nimport { useTransferListPanelKeys } from "./useTransferListPanelKeys";\nimport { transferListVariants } from "./transferListVariants";\nimport type { ITransferListItem, TTransferListValue, TTransferPanel } from "./types";\n\n// Above this many rows the panel renders a windowed (virtualized) list. Below it, the list renders\n// in full inside the custom Scrollbar, with full drag-and-drop support.\nconst VIRTUALIZE_THRESHOLD = 100;\n// Approximate row height (px) used before real rows are measured; measureElement corrects it.\nconst ESTIMATED_ROW_HEIGHT = 38;\n// Vertical gap between rows, matching the `gap-3` (0.75rem) of the non-virtualized list.\nconst ROW_GAP = 12;\n\n// `:focus-visible` isolates genuine keyboard focus from pointer/drag focus. jsdom may not support\n// the selector, so fall back to treating focus as keyboard focus there (tests assert on\n// aria-activedescendant, not the active-row border).\nconst isKeyboardFocus = ( el: HTMLElement ): boolean => {\n try {\n return el.matches( ":focus-visible" );\n } catch {\n return true;\n }\n};\n\ninterface ITransferListPanelProps {\n panel: TTransferPanel;\n title: React.ReactNode;\n items: ITransferListItem[];\n reorderable: boolean;\n disabled: boolean;\n emptyText: React.ReactNode;\n\n searchable: boolean;\n searchValue: string;\n searchPlaceholder: string;\n onSearchChange: ( query: string ) => void;\n headerSlot?: React.ReactNode;\n\n reloadTooltip?: string;\n onReload?: () => void;\n isReloading?: boolean;\n\n hasMore?: boolean;\n onLoadMore?: () => void;\n isLoadingMore?: boolean;\n\n /** Loader REPLACES the rows (a search/refresh fetch, not a page append). */\n isLoading?: boolean;\n /** Replaces the rows when set: the panel\'s source failed to load. */\n loadError?: React.ReactNode;\n /** Shown under the loaded rows when a page append failed; renders a retry button. */\n loadMoreError?: React.ReactNode;\n /** Fired by the retry button under `loadMoreError`. */\n onRetryLoadMore?: () => void;\n /** Label for that retry button. */\n retryLabel?: string;\n /** Server-side total; the header count becomes "(loaded of total)". */\n totalCount?: number;\n\n selectAllChecked: boolean;\n selectAllIndeterminate: boolean;\n /** Search-visible, non-disabled row count \u2014 the scope the select-all checkbox acts on. */\n selectAllCount: number;\n onToggleSelectAll: () => void;\n\n moveLabel: string;\n moveCount: number;\n moveDisabled: boolean;\n moveIconSide: "left" | "right";\n onMove: () => void;\n\n isChecked: ( value: TTransferListValue ) => boolean;\n onToggle: ( value: TTransferListValue ) => void;\n onRemove?: ( value: TTransferListValue ) => void;\n onMoveUp?: ( index: number ) => void;\n onMoveDown?: ( index: number ) => void;\n\n dropIndex: number | null;\n showDropOverlay: boolean;\n onItemDragStart: ( e: React.DragEvent, value: TTransferListValue ) => void;\n onItemDragEnd: () => void;\n onItemDragOver: ( e: React.DragEvent, index: number ) => void;\n onListDragOver: ( e: React.DragEvent ) => void;\n onListDrop: ( e: React.DragEvent ) => void;\n}\n\n/**\n * One panel of the transfer list: header (title, count, optional reload),\n * optional search + header slot, and a scrollable list of rows or an empty state.\n */\nexport function TransferListPanel({\n panel,\n title,\n items,\n reorderable,\n disabled,\n emptyText,\n searchable,\n searchValue,\n searchPlaceholder,\n onSearchChange,\n headerSlot,\n reloadTooltip,\n onReload,\n isReloading,\n hasMore,\n onLoadMore,\n isLoadingMore,\n isLoading,\n loadError,\n loadMoreError,\n onRetryLoadMore,\n retryLabel = "Retry",\n totalCount,\n selectAllChecked,\n selectAllIndeterminate,\n selectAllCount,\n onToggleSelectAll,\n moveLabel,\n moveCount,\n moveDisabled,\n moveIconSide,\n onMove,\n isChecked,\n onToggle,\n onRemove,\n onMoveUp,\n onMoveDown,\n dropIndex,\n showDropOverlay,\n onItemDragStart,\n onItemDragEnd,\n onItemDragOver,\n onListDragOver,\n onListDrop\n}: ITransferListPanelProps ): React.ReactElement {\n const {\n panel: panelClass,\n selectAllRow,\n panelFooter,\n listRegion,\n listWrap,\n list,\n virtualScroll,\n virtualSizer,\n emptyWrap,\n emptyText: emptyTextClass,\n loaderRow,\n replaceLoader,\n panelError,\n loadMoreErrorRow,\n dropOverlay\n } = transferListVariants({ panel });\n\n // While the rows are being replaced (or an error stands in for them) the arrow keys are addressing\n // rows that are about to leave, so navigation, activedescendant and Enter/Space are all suppressed.\n const isReplacing = Boolean( isLoading ) || loadError !== undefined;\n\n // Infinite-scroll sentinel (available panel only). Fires onLoadMore when the\n // bottom of the list scrolls into view.\n const sentinelRef = useInfiniteScroll({ hasMore, isLoading: isLoadingMore, onLoadMore });\n\n // No rows does not mean exhausted: with a paged source the panel can run dry while the server\n // still holds pages \u2014 every loaded row moved to the other panel, or filtered out. The panel is\n // then BETWEEN pages, not empty, so it renders the list (with its sentinel and the append loader)\n // rather than the empty state: "no data" would be untrue, and the sentinel is the only thing that\n // can pull the next page \u2014 dropping it with the rows would kill paging for good, with no list\n // left to scroll to bring it back.\n const isPagingIntoEmptyList = items.length === 0 && Boolean( hasMore );\n\n // Windowing scroll container: the virtualizer (owned by useListboxKeyboardNav) measures and\n // scrolls it, and useDragAutoScroll edge-scrolls it during a drag.\n const virtualScrollRef = useRef<HTMLDivElement>( null );\n const autoScroll = useDragAutoScroll( virtualScrollRef );\n\n // \u2500\u2500 Keyboard navigation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // The list is a single tab stop (role="listbox"); arrow keys move an "active" row via\n // aria-activedescendant instead of every row being its own tab stop - so Tab reaches the next\n // control/panel in one step regardless of list length.\n const listboxId = useId();\n const listRegionRef = useRef<HTMLDivElement>( null );\n const optionId = ( index: number ): string => `${listboxId}-opt-${index}`;\n\n // The active row is the keyboard-navigation cursor, so it should only be shown while the list\n // actually holds focus - otherwise the first row of every panel paints its active border on\n // mount and reads as a stray focus ring.\n const [ isFocused, setIsFocused ] = useState( false );\n\n // Reset key for the active row: keyed on the sorted values, so a pure reorder (same set, new\n // order) does not fire the reset and yank the active row back to the top mid-keyboard-reorder.\n // Memoized so the sort runs only when the item set actually changes, not on every re-render.\n const itemsKey = useMemo(\n () => items.map(( item ) => String( item.value )).sort().join( "\\n" ),\n [items]\n );\n\n const {\n activeIndex,\n setActiveIndex,\n moveActive,\n firstEnabledIndex,\n virtualizer: rowVirtualizer,\n shouldVirtualize\n } = useListboxKeyboardNav({\n itemCount: items.length,\n isItemDisabled: ( index ) => Boolean( items[index]?.isDisabled ),\n resetKey: itemsKey,\n scrollElementRef: virtualScrollRef,\n queryElementRef: listRegionRef,\n optionId,\n estimateSize: ESTIMATED_ROW_HEIGHT,\n gap: ROW_GAP,\n virtualizeThreshold: VIRTUALIZE_THRESHOLD\n });\n\n const isListFocusable = !disabled && items.length > 0;\n\n const handleListKeyDown = useTransferListPanelKeys({\n items,\n activeIndex,\n setActiveIndex,\n moveActive,\n firstEnabledIndex,\n reorderable,\n onToggle,\n onRemove,\n onMoveUp,\n onMoveDown,\n setIsFocused,\n isBlocked: isReplacing\n });\n\n // Shared row renderer so the windowed and full-render paths produce identical rows.\n const renderItem = ( item: ITransferListItem, index: number ): React.ReactElement => (\n <TransferListItem\n key={item.value}\n item={item}\n panel={panel}\n index={index}\n id={optionId( index )}\n active={isFocused && index === activeIndex}\n checked={isChecked( item.value )}\n reorderable={reorderable}\n disabled={disabled || Boolean( item.isDisabled )}\n isFirst={index === 0}\n isLast={index === items.length - 1}\n showTopIndicator={dropIndex === index}\n showBottomIndicator={index === items.length - 1 && dropIndex === items.length}\n onToggle={() => onToggle( item.value )}\n onRemove={onRemove ? () => onRemove( item.value ) : undefined}\n onMoveUp={onMoveUp ? () => onMoveUp( index ) : undefined}\n onMoveDown={onMoveDown ? () => onMoveDown( index ) : undefined}\n onDragStart={( e ) => onItemDragStart( e, item.value )}\n onDragEnd={onItemDragEnd}\n onDragOver={( e ) => onItemDragOver( e, index )}\n onDrop={onListDrop}\n />\n );\n\n // Below the loaded rows: the failed-page notice with its Retry, or the append loader. Only this\n // button retries, so a sentinel that never left the viewport cannot hammer a failing endpoint.\n const renderListFooter = (): React.ReactNode => {\n if ( loadMoreError !== undefined ) {\n return (\n <div className={loadMoreErrorRow()} role="alert">\n <span>{loadMoreError}</span>\n {typeof onRetryLoadMore === "function" && (\n <Button size="xs" variant="outline" color="secondary" onClick={onRetryLoadMore}>\n {retryLabel}\n </Button>\n )}\n </div>\n );\n }\n // Also spins in the gap between pages of an emptied list, so the cascade reads as one\n // continuous load instead of flickering an empty state between every page.\n return isLoadingMore || isPagingIntoEmptyList ? (\n <div className={loaderRow()} role="status" aria-label="Loading">\n <Loader size="sm" />\n </div>\n ) : null;\n };\n\n const handleVirtualDragOver = ( e: React.DragEvent ) => {\n onListDragOver( e );\n autoScroll.onDragOver( e );\n };\n\n // `Checkbox` renders a native input and has no `indeterminate` prop; it\'s a DOM property, so it has\n // to be written to the node. A callback ref, not an effect on `[selectAllIndeterminate]`: this row\n // unmounts whenever the panel replaces its rows, and a remount with the flag unchanged would not\n // re-run that effect \u2014 leaving a determinate checkbox over a partially-checked list. A callback ref\n // fires on every attach AND on identity change, covering both.\n const selectAllRef = useCallback(( node: HTMLInputElement | null ) => {\n if ( node ) {\n node.indeterminate = selectAllIndeterminate;\n }\n }, [selectAllIndeterminate]);\n\n return (\n <div className={panelClass()} data-testid={`transferListPanel-${panel}`}>\n <TransferListPanelHeader\n panel={panel}\n title={title}\n count={items.length}\n totalCount={totalCount}\n disabled={disabled}\n searchable={searchable}\n searchValue={searchValue}\n searchPlaceholder={searchPlaceholder}\n onSearchChange={onSearchChange}\n headerSlot={headerSlot}\n reloadTooltip={reloadTooltip}\n onReload={onReload}\n isReloading={isReloading}\n />\n\n <div\n ref={listRegionRef}\n className={listRegion()}\n role="listbox"\n aria-multiselectable="true"\n aria-label={typeof title === "string" ? title : undefined}\n tabIndex={isListFocusable ? 0 : -1}\n aria-busy={isLoading}\n // Dropped while replacing, so it never points at an id that is about to leave the DOM.\n aria-activedescendant={\n isListFocusable && !isReplacing && activeIndex >= 0 ? optionId( activeIndex ) : undefined\n }\n // Only light the active row for genuine keyboard focus. Starting a drag on a row also\n // focuses its listbox (a pointer interaction, so not :focus-visible); without this guard the\n // active cursor would paint a stray focus border on the new first row once the dragged row\n // leaves on drop.\n onFocus={( e ) => {\n if ( isKeyboardFocus( e.currentTarget )) {\n setIsFocused( true );\n }\n }}\n // A pointer interaction (including grabbing a row to drag) exits keyboard mode, mirroring\n // :focus-visible - so a drag never leaves the active-row border lit on the row that shifts\n // under the pointer once the dragged row is gone.\n onMouseDown={() => setIsFocused( false )}\n onBlur={() => setIsFocused( false )}\n onKeyDown={handleListKeyDown}\n >\n {selectAllCount >= 2 && !isReplacing && <div className={selectAllRow()}>\n <Checkbox\n ref={selectAllRef}\n size="sm"\n checked={selectAllChecked}\n disabled={disabled}\n label={`Select all (${selectAllCount})`}\n onChange={onToggleSelectAll}\n />\n </div>\n }\n {/* Loader, then error, then rows. The first two take the list\'s place so stale rows can\'t be\n clicked, but both keep the drag handlers: an error in Available must not break dragging\n items back out of Selected. role="alert" is assertive \u2014 the load did not do what was asked. */}\n {isLoading ? (\n <div\n className={replaceLoader()}\n role="status"\n aria-label="Loading"\n onDragOver={onListDragOver}\n onDrop={onListDrop}\n >\n <Loader size="sm" />\n </div>\n ) : loadError !== undefined ? (\n <div className={panelError()} role="alert" onDragOver={onListDragOver} onDrop={onListDrop}>\n {loadError}\n </div>\n ) : items.length === 0 && !isLoadingMore && !isPagingIntoEmptyList && loadMoreError === undefined ? (\n <div className={emptyWrap()} onDragOver={onListDragOver} onDrop={onListDrop}>\n <EmptyState imageVariant="no-data">\n <EmptyState.Content className={emptyTextClass()}>\n {emptyText}\n </EmptyState.Content>\n </EmptyState>\n </div>\n ) : shouldVirtualize ? (\n <div ref={virtualScrollRef} className={virtualScroll()} onDragOver={handleVirtualDragOver} onDrop={onListDrop}>\n <div className={virtualSizer()} style={{ height: rowVirtualizer.getTotalSize() }}>\n {rowVirtualizer.getVirtualItems().map(( virtualRow ) => (\n <div\n key={items[virtualRow.index].value}\n data-index={virtualRow.index}\n ref={rowVirtualizer.measureElement}\n className="absolute inset-x-0 top-0"\n style={{ transform: `translateY(${virtualRow.start}px)` }}\n >\n {renderItem( items[virtualRow.index], virtualRow.index )}\n </div>\n ))}\n {/* Sentinel pinned to the bottom of the full scroll height: clipped by the scroll\n container until the user reaches the end, where it triggers onLoadMore. */}\n <div ref={sentinelRef} className="absolute bottom-0 h-px w-px" aria-hidden="true" />\n </div>\n {renderListFooter()}\n </div>\n ) : (\n <Scrollbar className={listWrap()} onDragOver={onListDragOver} onDrop={onListDrop}>\n <div className={list()}>\n {items.map(( item, index ) => renderItem( item, index ))}\n {renderListFooter()}\n <div ref={sentinelRef} className="h-px" aria-hidden="true" />\n </div>\n </Scrollbar>\n )}\n {showDropOverlay && (\n <div className={dropOverlay()} data-testid="transferListDropOverlay" aria-hidden="true">\n Drop Here\n </div>\n )}\n </div>\n\n <div className={panelFooter()}>\n <Button\n size="xs"\n variant="outline"\n color="primary"\n disabled={moveDisabled}\n prefixIcon={moveIconSide === "left" ? iconList.leftArrowLong : undefined}\n suffixIcon={moveIconSide === "right" ? iconList.rightArrowLong : undefined}\n onClick={onMove}\n >\n {moveCount > 0 ? `${moveLabel} (${moveCount})` : moveLabel}\n </Button>\n </div>\n </div>\n );\n}\n\nTransferListPanel.displayName = "TransferListPanel";\n'
3889
+ },
3890
+ {
3891
+ "name": "transferListItem.tsx",
3892
+ "content": 'import * as React from "react";\n\nimport { useIsTruncated } from "@hooks";\nimport { Checkbox } from "../checkbox";\nimport { ADPIcon, iconList } from "../adpIcon";\nimport { transferListVariants } from "./transferListVariants";\nimport type { ITransferListItem, TTransferPanel } from "./types";\n\ninterface ITransferListItemProps {\n item: ITransferListItem;\n panel: TTransferPanel;\n index: number;\n /** Row element id, referenced by the panel listbox\'s aria-activedescendant. */\n id: string;\n checked: boolean;\n /** The row the keyboard navigation has landed on (highlighted, no DOM focus). */\n active: boolean;\n reorderable: boolean;\n disabled: boolean;\n isFirst: boolean;\n isLast: boolean;\n showTopIndicator: boolean;\n showBottomIndicator: boolean;\n onToggle: () => void;\n onRemove?: () => void;\n onMoveUp?: () => void;\n onMoveDown?: () => void;\n onDragStart: ( e: React.DragEvent ) => void;\n onDragEnd: () => void;\n onDragOver: ( e: React.DragEvent ) => void;\n onDrop: ( e: React.DragEvent ) => void;\n}\n\nconst stopPropagation = ( e: React.SyntheticEvent ) => e.stopPropagation();\n\n/**\n * A single transfer list row: drag handle + position badge (selected, reorderable\n * only), checkbox, label, and remove / reorder controls.\n */\nexport function TransferListItem({\n item,\n panel,\n index,\n id,\n checked,\n active,\n reorderable,\n disabled,\n isFirst,\n isLast,\n showTopIndicator,\n showBottomIndicator,\n onToggle,\n onRemove,\n onMoveUp,\n onMoveDown,\n onDragStart,\n onDragEnd,\n onDragOver,\n onDrop\n}: ITransferListItemProps ): React.ReactElement {\n const {\n row,\n dragHandle,\n badge,\n rowLabelWrap,\n rowLabel,\n rowActions,\n removeButton,\n reorderButton,\n dropIndicator: topDropIndicator\n } = transferListVariants({ panel, checked, active, isDisabled: disabled, dropIndicatorPosition: "before" });\n const { dropIndicator: bottomDropIndicator } = transferListVariants({\n panel, checked, isDisabled: disabled, dropIndicatorPosition: "after"\n });\n\n const { ref: labelRef, containerRef: labelWrapRef, isTruncated: isLabelTruncated } = useIsTruncated<HTMLSpanElement>();\n\n const isSelectedPanel = panel === "selected";\n // The position badge and up/down arrows only appear on the reorderable\n // selected panel; the grip drag affordance shows on every enabled row.\n const showReorderAffordances = isSelectedPanel && reorderable;\n\n return (\n <div\n id={id}\n role="option"\n aria-selected={checked}\n aria-disabled={disabled}\n // Rows are not individual tab stops: the panel\'s list is a single tab stop and arrow keys\n // drive navigation via aria-activedescendant (see TransferListPanel), so Tab never gets\n // trapped inside a long list. Enter/Space toggling is handled at the listbox level.\n tabIndex={-1}\n draggable={!disabled}\n data-index={index}\n data-active={active || undefined}\n data-truncated={isLabelTruncated || undefined}\n className={row()}\n onClick={onToggle}\n onDragStart={onDragStart}\n onDragEnd={onDragEnd}\n onDragOver={onDragOver}\n onDrop={onDrop}\n >\n {/* Absolutely positioned relative to the row: the dragover handler reads this row\'s\n bounding rect on every tick, so the indicator itself must never affect that layout. */}\n {showTopIndicator && <div className={topDropIndicator()} data-testid="transferListDropIndicator" aria-hidden="true" />}\n {showBottomIndicator && <div className={bottomDropIndicator()} data-testid="transferListDropIndicator" aria-hidden="true" />}\n {showReorderAffordances && <span className={badge()}>{index + 1}</span>}\n {!disabled && (\n <span className={dragHandle()} aria-hidden="true">\n <ADPIcon icon={iconList.grip} size="xs" />\n </span>\n )}\n {/* Row-internal controls are not individual tab stops (tabIndex -1): the panel listbox is\n the single tab stop and drives them from the active row (Enter/Space toggles, Delete\n removes, Alt+Arrow reorders). This keeps a long list from trapping Tab. */}\n <span className="flex" onClick={stopPropagation}>\n <Checkbox checked={checked} disabled={disabled} size="sm" tabIndex={-1} onChange={onToggle} />\n </span>\n <span ref={labelWrapRef} className={rowLabelWrap()}>\n <span ref={labelRef} className={rowLabel()}>{item.label}</span>\n </span>\n <span className={rowActions()}>\n {showReorderAffordances && (\n <>\n <button\n type="button"\n aria-label="Move up"\n tabIndex={-1}\n disabled={isFirst}\n className={reorderButton()}\n onClick={( e ) => {\n stopPropagation( e );\n onMoveUp?.();\n }}\n >\n <ADPIcon icon={iconList.upArrow} size="xs" />\n </button>\n <button\n type="button"\n aria-label="Move down"\n tabIndex={-1}\n disabled={isLast}\n className={reorderButton()}\n onClick={( e ) => {\n stopPropagation( e );\n onMoveDown?.();\n }}\n >\n <ADPIcon icon={iconList.downArrow} size="xs" />\n </button>\n </>\n )}\n {isSelectedPanel && (\n <button\n type="button"\n aria-label={`Remove ${item.value}`}\n tabIndex={-1}\n className={removeButton()}\n onClick={( e ) => {\n stopPropagation( e );\n onRemove?.();\n }}\n >\n <ADPIcon icon={iconList.cross} size="xs" />\n </button>\n )}\n </span>\n </div>\n );\n}\n\nTransferListItem.displayName = "TransferListItem";\n'
3893
+ },
3894
+ {
3895
+ "name": "transferList.tsx",
3896
+ "content": `import * as React from "react";
3897
+ import { useMemo, useState } from "react";
3898
+
3899
+ import { TransferListPanel } from "./transferListPanel";
3900
+ import { useTransferList } from "./useTransferList";
3901
+ import { useTransferListSource } from "./useTransferListSource";
3902
+ import { transferListVariants } from "./transferListVariants";
3903
+ import { matchesQuery } from "@utils";
3904
+ import type { ITransferListProps, TTransferListValue, TTransferPanel } from "./types";
3905
+
3906
+ /**
3907
+ * A fully-controlled two-panel transfer list. Move items between the Available
3908
+ * and Selected panels via checkboxes + arrow controls or native drag-and-drop.
3909
+ * Rendering and ownership of any surrounding chrome (modal, footer) is left to
3910
+ * the consumer. The forwarded ref lands on the wrapper \`<div>\`.
3911
+ */
3912
+ export const TransferList = React.forwardRef<HTMLDivElement, ITransferListProps>( function TransferList({
3913
+ availableItems: availableItemsProp,
3914
+ selectedItems,
3915
+ onChange,
3916
+ availablePanelTitle = "Available Items",
3917
+ selectedPanelTitle = "Selected Items",
3918
+ searchable = true,
3919
+ availableSearchTerm,
3920
+ onAvailableSearchChange,
3921
+ selectedSearchTerm,
3922
+ onSelectedSearchChange,
3923
+ searchPlaceholder = "Search here",
3924
+ availablePanelHeaderSlot,
3925
+ selectedPanelHeaderSlot,
3926
+ moveToSelectedLabel = "Add to select",
3927
+ moveToAvailableLabel = "Remove from selected",
3928
+ reorderable = false,
3929
+ reloadTooltip = "Reload",
3930
+ onReload,
3931
+ isReloading = false,
3932
+ hasMoreAvailable = false,
3933
+ onLoadMoreAvailable,
3934
+ isLoadingMoreAvailable = false,
3935
+ isLoadingAvailable = false,
3936
+ availableLoadError,
3937
+ availableLoadMoreError,
3938
+ onRetryLoadMoreAvailable,
3939
+ retryLabel = "Retry",
3940
+ availableTotalCount,
3941
+ loadAvailableOptions,
3942
+ initialAvailableOptions,
3943
+ // Left undefined here, not defaulted: sync mode warns on a \`prefetch\` the consumer actually passed,
3944
+ // which an eager default would erase. Resolved in useTransferListSource, where it becomes a trigger.
3945
+ prefetch,
3946
+ refetchOnClear = false,
3947
+ optionsKey,
3948
+ availableFilterDebounceMs = 300,
3949
+ loadErrorMessage,
3950
+ loadMoreErrorMessage,
3951
+ onLoadError,
3952
+ disabled = false,
3953
+ availableEmptyText = "No Data Found!",
3954
+ selectedEmptyText = "No Data Found!",
3955
+ className
3956
+ }, forwardedRef ) {
3957
+ // Resolves the available panel's source. In async mode the component owns that pool (and its
3958
+ // debounced, server-driven search); otherwise every value below is the corresponding prop verbatim.
3959
+ const availableSource = useTransferListSource({
3960
+ availableItems: availableItemsProp,
3961
+ selectedItems,
3962
+ loadAvailableOptions,
3963
+ initialAvailableOptions,
3964
+ prefetch,
3965
+ refetchOnClear,
3966
+ optionsKey,
3967
+ availableFilterDebounceMs,
3968
+ loadErrorMessage,
3969
+ loadMoreErrorMessage,
3970
+ onLoadError,
3971
+ hasMoreAvailable,
3972
+ onLoadMoreAvailable,
3973
+ isLoadingMoreAvailable,
3974
+ isLoadingAvailable,
3975
+ availableLoadError,
3976
+ availableLoadMoreError,
3977
+ onRetryLoadMoreAvailable,
3978
+ availableTotalCount,
3979
+ availableSearchTerm,
3980
+ onAvailableSearchChange
3981
+ });
3982
+ const {
3983
+ availableItems,
3984
+ availableSearchTerm: availableSearchValue,
3985
+ onAvailableSearchChange: onAvailableSearch
3986
+ } = availableSource;
3987
+
3988
+ const {
3989
+ isChecked,
3990
+ toggleCheck,
3991
+ setPanelChecked,
3992
+ moveRight,
3993
+ moveLeft,
3994
+ transferToSelected,
3995
+ transferToAvailable,
3996
+ reorderSelected,
3997
+ drag,
3998
+ setDrag
3999
+ } = useTransferList({ availableItems, selectedItems, onChange });
4000
+
4001
+ const [ availableQuery, setAvailableQuery ] = useState( "" );
4002
+ const [ selectedQuery, setSelectedQuery ] = useState( "" );
4003
+ const [ dropTarget, setDropTarget ] = useState<{ panel: TTransferPanel; index: number } | null>( null );
4004
+
4005
+ const availableValue = availableSearchValue === undefined ? availableQuery : availableSearchValue;
4006
+ const selectedValue = selectedSearchTerm === undefined ? selectedQuery : selectedSearchTerm;
4007
+
4008
+ const handleAvailableSearch = ( query: string ) => {
4009
+ setAvailableQuery( query );
4010
+ onAvailableSearch?.( query );
4011
+ };
4012
+ const handleSelectedSearch = ( query: string ) => {
4013
+ setSelectedQuery( query );
4014
+ onSelectedSearchChange?.( query );
4015
+ };
4016
+
4017
+ // When a search handler is supplied the parent owns filtering; otherwise filter
4018
+ // the loaded items client-side. Memoized so the repeated filter passes don't re-run on
4019
+ // every render (drag-over/hover updates fire frequently and the lists can be large). Keyed on
4020
+ // WHETHER a handler exists rather than on its identity: an inline handler prop \u2014 or the async
4021
+ // source's own \u2014 would otherwise change every render and defeat the memo entirely.
4022
+ const isAvailableSearchExternal = onAvailableSearch !== undefined;
4023
+ const isSelectedSearchExternal = onSelectedSearchChange !== undefined;
4024
+ const visibleAvailable = useMemo(
4025
+ () => ( isAvailableSearchExternal ? availableItems : availableItems.filter(( item ) => matchesQuery( item, availableValue ))),
4026
+ [ isAvailableSearchExternal, availableItems, availableValue ]
4027
+ );
4028
+ const visibleSelected = useMemo(
4029
+ () => ( isSelectedSearchExternal ? selectedItems : selectedItems.filter(( item ) => matchesQuery( item, selectedValue ))),
4030
+ [ isSelectedSearchExternal, selectedItems, selectedValue ]
4031
+ );
4032
+
4033
+ // "Select all" addresses only what the search leaves VISIBLE, so it can never reach an item the
4034
+ // user cannot see. It checks and unchecks that subset without touching the rest of the panel's
4035
+ // checked set, which is what lets a selection made under one query survive the next.
4036
+ const visibleMovableAvailable = useMemo(() => visibleAvailable.filter(( item ) => !item.isDisabled ), [visibleAvailable]);
4037
+ const visibleMovableSelected = useMemo(() => visibleSelected.filter(( item ) => !item.isDisabled ), [visibleSelected]);
4038
+
4039
+ // The move buttons keep the wider scope: they move everything currently checked, including rows
4040
+ // the active filter is hiding, so their count stays an honest tally of the selection. With a
4041
+ // paged source that scope is what has been LOADED, not what the server holds.
4042
+ const checkedAvailable = useMemo(
4043
+ () => availableItems.filter(( item ) => !item.isDisabled && isChecked( "available", item.value )),
4044
+ [ availableItems, isChecked ]
4045
+ );
4046
+ const checkedSelected = useMemo(
4047
+ () => selectedItems.filter(( item ) => !item.isDisabled && isChecked( "selected", item.value )),
4048
+ [ selectedItems, isChecked ]
4049
+ );
4050
+
4051
+ const visibleCheckedAvailableCount = useMemo(
4052
+ () => visibleMovableAvailable.filter(( item ) => isChecked( "available", item.value )).length,
4053
+ [ visibleMovableAvailable, isChecked ]
4054
+ );
4055
+ const visibleCheckedSelectedCount = useMemo(
4056
+ () => visibleMovableSelected.filter(( item ) => isChecked( "selected", item.value )).length,
4057
+ [ visibleMovableSelected, isChecked ]
4058
+ );
4059
+
4060
+ const availableAllChecked =
4061
+ visibleMovableAvailable.length > 0 && visibleCheckedAvailableCount === visibleMovableAvailable.length;
4062
+ const selectedAllChecked =
4063
+ visibleMovableSelected.length > 0 && visibleCheckedSelectedCount === visibleMovableSelected.length;
4064
+
4065
+ const makeDragStart = ( panel: TTransferPanel ) => ( e: React.DragEvent, value: TTransferListValue ) => {
4066
+ if ( disabled ) {
4067
+ return;
4068
+ }
4069
+ e.dataTransfer.effectAllowed = "move";
4070
+ e.dataTransfer.setData( "text/plain", String( value ));
4071
+ setDrag({ value, panel });
4072
+ };
4073
+
4074
+ const handleDragEnd = () => {
4075
+ setDrag( null );
4076
+ setDropTarget( null );
4077
+ };
4078
+
4079
+ // Per-panel drop policy. Available is never sortable: it only accepts items
4080
+ // dragged back from Selected and never shows a positional insertion indicator
4081
+ // (the whole-panel "Drop Here" overlay covers that case instead). Selected
4082
+ // accepts from either panel and only shows the positional line when reorderable
4083
+ // \u2014 the non-reorderable, position-irrelevant cases are covered by the overlay.
4084
+ const dropPolicy: Record<TTransferPanel, { showsInsertion: boolean; accepts: ( source: TTransferPanel ) => boolean }> = {
4085
+ available: { showsInsertion: false, accepts: ( source ) => source === "selected" },
4086
+ selected: { showsInsertion: reorderable, accepts: () => true }
4087
+ };
4088
+
4089
+ const makeItemDragOver = ( panel: TTransferPanel ) => ( e: React.DragEvent, index: number ) => {
4090
+ if ( !drag || !dropPolicy[panel].accepts( drag.panel )) {
4091
+ return;
4092
+ }
4093
+ e.preventDefault();
4094
+ if ( !dropPolicy[panel].showsInsertion ) {
4095
+ return;
4096
+ }
4097
+ e.stopPropagation();
4098
+ const rect = e.currentTarget.getBoundingClientRect();
4099
+ const after = e.clientY - rect.top > rect.height / 2;
4100
+ setDropTarget({ panel, index: after ? index + 1 : index });
4101
+ };
4102
+
4103
+ // Fires when the pointer is over the list container rather than a specific row \u2014 in the flex
4104
+ // gap between rows, or above/below all rows, none of which any row's own dragover handler
4105
+ // covers. Resolves the nearest row boundary from actual row positions so the insertion point
4106
+ // tracks the pointer's vertical position rather than defaulting to the end of the list.
4107
+ const makeListDragOver = ( panel: TTransferPanel ) => ( e: React.DragEvent ) => {
4108
+ if ( !drag || !dropPolicy[panel].accepts( drag.panel )) {
4109
+ return;
4110
+ }
4111
+ e.preventDefault();
4112
+ if ( !dropPolicy[panel].showsInsertion ) {
4113
+ return;
4114
+ }
4115
+ // Resolve the true item index from each row's data-index (not its position in the rendered
4116
+ // node list) so this stays correct when the list is virtualized and only a window of rows is
4117
+ // in the DOM. Falls back to just past the last rendered row when the pointer is below them all.
4118
+ const rows = Array.from( e.currentTarget.querySelectorAll<HTMLElement>( "[role='option']" ));
4119
+ const dataIndex = ( row: HTMLElement ): number => Number( row.getAttribute( "data-index" ));
4120
+ const hit = rows.find(( row ) => {
4121
+ const rect = row.getBoundingClientRect();
4122
+ return e.clientY < rect.top + rect.height / 2;
4123
+ });
4124
+ const afterLast = rows.length > 0 ? dataIndex( rows[rows.length - 1]) + 1 : 0;
4125
+ setDropTarget({ panel, index: hit ? dataIndex( hit ) : afterLast });
4126
+ };
4127
+
4128
+ // Whole-panel "Drop Here" overlay: a pure function of the top-level drag state,
4129
+ // visible for the entire drag (not just on hover) on every panel that is a valid,
4130
+ // position-irrelevant drop target. Positional (reorderable) drops keep the
4131
+ // per-row insertion line above instead and never show the overlay.
4132
+ const availableShowsDropOverlay = drag !== null && drag.panel === "selected";
4133
+ const selectedShowsDropOverlay = drag !== null && drag.panel === "available" && !reorderable;
4134
+
4135
+ // Map a visible-list insertion slot (0..visibleSelected.length) to an index in the full
4136
+ // selectedItems array, so reorder/insert land correctly even when a search filter hides rows.
4137
+ // With no filter active visibleSelected === selectedItems, so this is the identity.
4138
+ const visibleToFullSelectedIndex = ( visibleIndex: number ): number => {
4139
+ if ( visibleSelected.length === 0 ) {
4140
+ return selectedItems.length;
4141
+ }
4142
+ if ( visibleIndex >= visibleSelected.length ) {
4143
+ const lastValue = visibleSelected[visibleSelected.length - 1].value;
4144
+ return selectedItems.findIndex(( item ) => item.value === lastValue ) + 1;
4145
+ }
4146
+ const anchorValue = visibleSelected[visibleIndex].value;
4147
+ return selectedItems.findIndex(( item ) => item.value === anchorValue );
4148
+ };
4149
+
4150
+ const makeDrop = ( panel: TTransferPanel ) => ( e: React.DragEvent ) => {
4151
+ if ( !drag || !dropPolicy[panel].accepts( drag.panel )) {
4152
+ return;
4153
+ }
4154
+ e.preventDefault();
4155
+ const { value, panel: source } = drag;
4156
+ if ( panel === "selected" ) {
4157
+ const visibleInsert = dropTarget?.panel === "selected" ? dropTarget.index : visibleSelected.length;
4158
+ const insertIndex = visibleToFullSelectedIndex( visibleInsert );
4159
+ if ( source === "available" ) {
4160
+ transferToSelected( value, reorderable ? insertIndex : undefined );
4161
+ } else if ( reorderable ) {
4162
+ const from = selectedItems.findIndex(( item ) => item.value === value );
4163
+ const to = from < insertIndex ? insertIndex - 1 : insertIndex;
4164
+ reorderSelected( from, to );
4165
+ }
4166
+ } else {
4167
+ transferToAvailable( value );
4168
+ }
4169
+ handleDragEnd();
4170
+ };
4171
+
4172
+ const moveSelectedByValue = ( visibleIndex: number, delta: number ) => {
4173
+ const value = visibleSelected[visibleIndex]?.value;
4174
+ const from = selectedItems.findIndex(( item ) => item.value === value );
4175
+ if ( from !== -1 ) {
4176
+ reorderSelected( from, from + delta );
4177
+ }
4178
+ };
4179
+
4180
+ const { base } = transferListVariants();
4181
+
4182
+ return (
4183
+ <div ref={forwardedRef} className={base({ class: className })}>
4184
+ <TransferListPanel
4185
+ panel="available"
4186
+ title={availablePanelTitle}
4187
+ items={visibleAvailable}
4188
+ reorderable={false}
4189
+ disabled={disabled}
4190
+ emptyText={availableEmptyText}
4191
+ searchable={searchable}
4192
+ searchValue={availableValue}
4193
+ searchPlaceholder={searchPlaceholder}
4194
+ onSearchChange={handleAvailableSearch}
4195
+ headerSlot={availablePanelHeaderSlot}
4196
+ reloadTooltip={reloadTooltip}
4197
+ onReload={onReload}
4198
+ isReloading={isReloading}
4199
+ hasMore={availableSource.hasMoreAvailable}
4200
+ onLoadMore={availableSource.onLoadMoreAvailable}
4201
+ isLoadingMore={availableSource.isLoadingMoreAvailable}
4202
+ isLoading={availableSource.isLoadingAvailable}
4203
+ loadError={availableSource.availableLoadError}
4204
+ loadMoreError={availableSource.availableLoadMoreError}
4205
+ onRetryLoadMore={availableSource.onRetryLoadMoreAvailable}
4206
+ retryLabel={retryLabel}
4207
+ totalCount={availableSource.availableTotalCount}
4208
+ selectAllChecked={availableAllChecked}
4209
+ selectAllIndeterminate={visibleCheckedAvailableCount > 0 && !availableAllChecked}
4210
+ selectAllCount={visibleMovableAvailable.length}
4211
+ onToggleSelectAll={() =>
4212
+ setPanelChecked( "available", visibleMovableAvailable.map(( item ) => item.value ), !availableAllChecked )
4213
+ }
4214
+ moveLabel={moveToSelectedLabel}
4215
+ moveCount={checkedAvailable.length}
4216
+ moveDisabled={disabled || checkedAvailable.length === 0}
4217
+ moveIconSide="right"
4218
+ onMove={() => moveRight( checkedAvailable.map(( item ) => item.value ))}
4219
+ isChecked={( value ) => isChecked( "available", value )}
4220
+ onToggle={( value ) => toggleCheck( "available", value )}
4221
+ dropIndex={dropTarget?.panel === "available" ? dropTarget.index : null}
4222
+ showDropOverlay={availableShowsDropOverlay}
4223
+ onItemDragStart={makeDragStart( "available" )}
4224
+ onItemDragEnd={handleDragEnd}
4225
+ onItemDragOver={makeItemDragOver( "available" )}
4226
+ onListDragOver={makeListDragOver( "available" )}
4227
+ onListDrop={makeDrop( "available" )}
4228
+ />
4229
+
4230
+ <TransferListPanel
4231
+ panel="selected"
4232
+ title={selectedPanelTitle}
4233
+ items={visibleSelected}
4234
+ reorderable={reorderable}
4235
+ disabled={disabled}
4236
+ emptyText={selectedEmptyText}
4237
+ searchable={searchable}
4238
+ searchValue={selectedValue}
4239
+ searchPlaceholder={searchPlaceholder}
4240
+ onSearchChange={handleSelectedSearch}
4241
+ headerSlot={selectedPanelHeaderSlot}
4242
+ selectAllChecked={selectedAllChecked}
4243
+ selectAllIndeterminate={visibleCheckedSelectedCount > 0 && !selectedAllChecked}
4244
+ selectAllCount={visibleMovableSelected.length}
4245
+ onToggleSelectAll={() =>
4246
+ setPanelChecked( "selected", visibleMovableSelected.map(( item ) => item.value ), !selectedAllChecked )
4247
+ }
4248
+ moveLabel={moveToAvailableLabel}
4249
+ moveCount={checkedSelected.length}
4250
+ moveDisabled={disabled || checkedSelected.length === 0}
4251
+ moveIconSide="left"
4252
+ onMove={() => moveLeft( checkedSelected.map(( item ) => item.value ))}
4253
+ isChecked={( value ) => isChecked( "selected", value )}
4254
+ onToggle={( value ) => toggleCheck( "selected", value )}
4255
+ onRemove={( value ) => transferToAvailable( value )}
4256
+ onMoveUp={( index ) => moveSelectedByValue( index, -1 )}
4257
+ onMoveDown={( index ) => moveSelectedByValue( index, 1 )}
4258
+ dropIndex={dropTarget?.panel === "selected" ? dropTarget.index : null}
4259
+ showDropOverlay={selectedShowsDropOverlay}
4260
+ onItemDragStart={makeDragStart( "selected" )}
4261
+ onItemDragEnd={handleDragEnd}
4262
+ onItemDragOver={makeItemDragOver( "selected" )}
4263
+ onListDragOver={makeListDragOver( "selected" )}
4264
+ onListDrop={makeDrop( "selected" )}
4265
+ />
4266
+ </div>
4267
+ );
4268
+ });
4269
+
4270
+ TransferList.displayName = "TransferList";
4271
+ `
4272
+ },
4273
+ {
4274
+ "name": "index.ts",
4275
+ "content": 'export { TransferList } from "./transferList";\nexport { transferListVariants } from "./transferListVariants";\nexport type {\n ITransferListProps,\n ITransferListItem,\n TTransferListValue,\n TTransferPanel,\n TTransferListLoadOptions,\n TTransferListPrefetch\n} from "./types";\n'
4276
+ },
4277
+ {
4278
+ "name": "README.md",
4279
+ "content": '# TransferList Component\n\n## Component Overview\n\nThe TransferList is a fully-controlled two-panel widget for moving items between an\n**Available** list and a **Selected** list. Each panel has a **"Select all" checkbox**\nabove its list and a **move button** below it that transfers the currently-checked items\nto the other panel \u2014 "Add to select" on Available, "Remove from selected" on Selected.\nItems can also be moved by native HTML5 drag-and-drop. It is intentionally decoupled\nfrom any surrounding chrome \u2014 render it inside a `Modal`, a `Card`, or a page section\nand own the surrounding layout yourself. `MultiSelectTransfer` composes it inside a modal.\n\n**When to use:**\n- Assigning a subset of items (permissions, columns, members) from a larger pool\n- Building an ordered selection where position matters (enable `reorderable`)\n- Any "pick from a long, possibly paginated list" workflow\n\n**Component Architecture:**\n- Fully controlled: `availableItems`, `selectedItems`, and `onChange` are owned by the consumer\n- Styled with `tailwind-variants` (`tv()`) slots\n- Native drag-and-drop (no extra dependency) for cross-panel transfer and reorder\n- Infinite scroll on the Available panel via an `IntersectionObserver` sentinel\n- Responsive: panels sit side-by-side on `sm`+ and stack vertically on small screens\n- Reuses `Checkbox`, `Button`, `Scrollbar`, `Loader`, and `ADPIcon`\n\n## Basic Usage\n\n```tsx\nimport { useState } from "react";\nimport { TransferList, type ITransferListItem } from "@cloudwick/astral-ui";\n\nexport function Example() {\n const [available, setAvailable] = useState<ITransferListItem[]>([\n { value: "apple", label: "Apple" },\n { value: "banana", label: "Banana" }\n ]);\n const [selected, setSelected] = useState<ITransferListItem[]>([]);\n\n return (\n <TransferList\n availableItems={available}\n selectedItems={selected}\n onChange={( nextAvailable, nextSelected ) => {\n setAvailable( nextAvailable );\n setSelected( nextSelected );\n }}\n />\n );\n}\n```\n\n## Props\n\n| Prop | Type | Default | Description |\n|---|---|---|---|\n| `availableItems` | `ITransferListItem[]` | \u2014 | Items in the left panel. Controlled. Optional and **ignored** (dev warning) when `loadAvailableOptions` is set. |\n| `selectedItems` | `ITransferListItem[]` | \u2014 | Items in the right panel. Controlled. |\n| `onChange` | `( availableItems, selectedItems ) => void` | \u2014 | Fired on every move/reorder. |\n| `availablePanelTitle` / `selectedPanelTitle` | `ReactNode` | `"Available Items"` / `"Selected Items"` | Panel headings. |\n| `searchable` | `boolean` | `true` | Show the per-panel search inputs. |\n| `availableSearchTerm` / `onAvailableSearchChange` | `string` / `fn` | \u2014 | Controlled search for the available panel (parent owns filtering). |\n| `selectedSearchTerm` / `onSelectedSearchChange` | `string` / `fn` | \u2014 | Controlled search for the selected panel. |\n| `searchPlaceholder` | `string` | `"Search here"` | Placeholder for both inputs. |\n| `availablePanelHeaderSlot` / `selectedPanelHeaderSlot` | `ReactNode` | \u2014 | Custom content under each search input. |\n| `moveToSelectedLabel` | `string` | `"Add to select"` | Label for the available panel\'s move button. A `(count)` suffix is appended when items are checked. |\n| `moveToAvailableLabel` | `string` | `"Remove from selected"` | Label for the selected panel\'s move button. A `(count)` suffix is appended when items are checked. |\n| `reorderable` | `boolean` | `false` | Enable drag handles, position badges and up/down arrows on the selected panel. |\n| `showReload` / `onReload` / `isReloading` | `boolean` / `fn` / `boolean` | \u2014 | Reload button on the available panel header. |\n| `hasMoreAvailable` / `onLoadMoreAvailable` / `isLoadingMoreAvailable` | `boolean` / `fn` / `boolean` | \u2014 | Infinite scroll for the available panel. The loader **appends** below the rows. While `hasMoreAvailable` is true the panel never shows its empty state: with no rows left it keeps the sentinel and the append loader, so moving the whole loaded page across pulls the next one instead of dead-ending. |\n| `isLoadingAvailable` | `boolean` | `false` | Loader **replaces** the available rows (a search/refresh fetch, not a page append). |\n| `availableLoadError` | `ReactNode` | \u2014 | Replaces the available rows: that panel\'s source failed to load. |\n| `availableLoadMoreError` | `ReactNode` | \u2014 | Shown under the loaded rows when a page append failed; renders a retry button. |\n| `onRetryLoadMoreAvailable` | `fn` | \u2014 | Fired by that retry button. |\n| `retryLabel` | `string` | `"Retry"` | Label for the retry button. |\n| `availableTotalCount` | `number` | \u2014 | Server-side total; the available panel\'s header count becomes `(loaded of total)`. |\n| `loadAvailableOptions` | `(query, meta) => Promise<ITransferListItem[] \\| IOptionPage<...>>` | \u2014 | Async, paged source for the available panel. See [Async available panel](#async-available-panel). |\n| `initialAvailableOptions` | `readonly ITransferListItem[]` | \u2014 | Seed rows for a pool you already have (SSR payload, route loader, warm cache). Painted on the first frame and kept on screen while the mount fetch revalidates over them \u2014 see [Seeding the pool](#seeding-the-pool). Async mode only. |\n| `prefetch` | `"mount" \\| "never"` | `"mount"` | When to fetch the unfiltered available list. `"mount"` at render \u2014 the panel has no open/close, so mount is the only trigger it has; `"never"` only once the user searches. Async mode only. |\n| `refetchOnClear` | `boolean` | `false` | Clearing the available search revalidates the cached baseline instead of only restoring it. |\n| `optionsKey` | `string \\| number` | \u2014 | Identity of the available option set. A change drops cached pages and repopulates. Does **not** clear the selection. |\n| `availableFilterDebounceMs` | `number` | `300` | Debounce for the available panel\'s search when it is server-driven. |\n| `loadErrorMessage` / `loadMoreErrorMessage` | `ReactNode` | `"Couldn\'t load options."` / `"Couldn\'t load more."` | Async-mode copy for the two failure states above. |\n| `onLoadError` | `(error: unknown) => void` | \u2014 | Notified when a load rejects. |\n| `disabled` | `boolean` | `false` | Disable all interaction. |\n| `availableEmptyText` / `selectedEmptyText` | `ReactNode` | `"No Data Found!"` | Empty-state copy. |\n| `className` | `string` | \u2014 | Extra classes on the root. |\n| `ref` | `Ref<HTMLDivElement>` | \u2014 | Forwarded to the root \u2014 for programmatic focus/scroll and form libraries that bind by ref. |\n\n## Selecting and moving items\n\n- **Per-row checkboxes:** check individual rows in either panel.\n- **Select all:** the checkbox above each list checks/clears the non-disabled items the\n active search leaves **visible** \u2014 its label counts exactly that scope, and it reflects\n an indeterminate state when only some of them are checked. Items hidden by the filter are\n left as they are in both directions, so checks made under an earlier query survive. The\n row is shown only when there are at least two visible items to act on; below that it would\n duplicate a single row\'s own checkbox or have nothing to check.\n- **Move button:** the button below each list moves **every** currently-checked item to the\n other panel (skipping disabled items) and clears the checkboxes \u2014 including items the\n active filter is hiding, so its count stays an honest tally of the selection. It is\n disabled when nothing is checked. To move everything, clear the search, click "Select all",\n then the move button.\n\n## Drag-and-drop\n\n- **Cross-panel transfer:** drag any row onto the opposite panel to move it (honoring\n `isDisabled`). Same effect as checking the row and clicking the move button. While a drag is in progress, every\n panel that is a valid, position-irrelevant drop target shows a sticky "Drop Here"\n overlay across its whole content area, for the entire drag \u2014 not just while hovering\n it. This is consistent on both panels: dragging a Selected row always shows the\n overlay on Available, and dragging an Available row shows it on Selected whenever\n `reorderable` is not set (the drop always appends, regardless of which row is\n hovered).\n- **Reorder within Selected:** only when `reorderable` \u2014 drop a selected row (or an\n incoming available row) at a new position, tracked with a precise per-row insertion\n line instead of the overlay, or use the up/down arrows. Without `reorderable`,\n dragging a selected row within Selected is a no-op and shows neither the overlay nor\n an indicator.\n- The **Available panel is never sortable**: Available rows are draggable solely to enable\n transfer to Selected; dropping an Available row within Available is a no-op and shows\n no overlay or indicator.\n\n## Loading and error states on the available panel\n\nThese are plain prop additions, usable by any controlled consumer without touching async mode:\n\n- **`isLoadingAvailable`** shows a centred loader *instead of* the rows. Use it for a search or refresh\n fetch \u2014 the rows on screen belong to the previous query, so leaving them navigable would let the user\n act on something the incoming result set no longer contains. Arrow/Enter/Space are swallowed and\n `aria-activedescendant` is dropped while it is up. `isLoadingMoreAvailable` is the opposite: the\n loader *appends* below the rows, because a page fetch adds to what is already there.\n- **`availableLoadError`** replaces the rows with `role="alert"` copy. The drop targets stay live \u2014 an\n error in Available must not break dragging items back out of Selected.\n- **`availableLoadMoreError`** + **`onRetryLoadMoreAvailable`** render below the loaded rows, replacing\n the append loader. This is the affordance that makes a failed page recoverable; because only this\n button retries, a sentinel that never left the viewport cannot hammer a failing endpoint.\n- **`availableTotalCount`** turns the header count into `(loaded of total)` when it exceeds what is\n loaded. A paged panel reporting `(20)` when the server holds 4,000 matches is lying.\n\n## Async available panel\n\n`loadAvailableOptions` makes the component own the Available pool \u2014 its paging, request ordering and\nloading/error state \u2014 instead of every consumer hand-writing a monotonic-ticket guard and a page\naccumulator:\n\n```tsx\nconst [selected, setSelected] = useState<ITransferListItem[]>([]);\n\n<TransferList\n selectedItems={selected}\n onChange={(_available, nextSelected) => setSelected(nextSelected)}\n loadAvailableOptions={async (query, { cursor, signal }) => {\n const res = await fetchRows({ query, cursor, signal });\n return { options: res.rows, cursor: res.nextToken, total: res.totalCount };\n }}\n/>\n```\n\n- It fetches on **mount**, not on open: the panel has no open/close, so its list is always visible.\n That is why `prefetch` here is `"mount" | "never"` rather than the `"mount" | "open" | "never"` that\n `Select` and `MultiSelectTransfer` accept \u2014 there is no open event to hang a fetch on.\n `prefetch="never"` defers everything until the user searches.\n- The panel\'s search becomes **debounced and server-driven** (`availableFilterDebounceMs`); the local\n matcher stands down, since over a paged pool it could only search the pages that happen to be loaded.\n- Available is **derived** as the loaded pool minus `selectedItems`, so moving an item across needs no\n refetch. An item that was in `selectedItems` but never in the pool still returns to Available when\n moved back \u2014 the component remembers every item it has seen on the selected side. Those remembered\n items are matched locally against the active query, so one cannot surface as a result for a search it\n does not match, and they are forgotten on an `optionsKey` change along with the pool itself.\n- **`availableItems` becomes optional and is ignored** (with a dev warning), which sits a little\n awkwardly with the component\'s fully-controlled identity. `selectedItems` stays controlled \u2014 the\n consumer owns the selection, which is the whole point of the component \u2014 and `onChange` still fires\n with both arrays, so no existing call site breaks.\n- The paging, dedupe, failed-page/Retry and `optionsKey` semantics are identical to\n `MultiSelectTransfer`\'s; see its README for the full list.\n\n### Seeding the pool\n\n`initialAvailableOptions` is for the case where **you already have the rows** \u2014 an SSR payload, a route\nloader, a warm query cache. They are painted on the first frame, so the panel is never briefly empty,\nand they stay on screen while the mount fetch revalidates over them. They go through the same\npool-minus-`selectedItems` projection as fetched rows, so an already-selected seed row correctly starts\non the right-hand side.\n\n```tsx\n<TransferList\n selectedItems={selected}\n onChange={(_available, nextSelected) => setSelected(nextSelected)}\n initialAvailableOptions={ssrRows} // painted immediately\n loadAvailableOptions={fetchRows} // still runs at mount, and replaces them when page one lands\n/>\n```\n\nIt does **not** suppress that fetch. If the seed *is* the whole pool until the user searches \u2014 a heavy\nsource you do not want to hit on render \u2014 pair it with `prefetch="never"`, which otherwise leaves the\npanel empty:\n\n```tsx\n<TransferList\n selectedItems={selected}\n onChange={...}\n initialAvailableOptions={recentlyUsed}\n prefetch="never"\n loadAvailableOptions={searchEverything}\n/>\n```\n\nSeed rows carry no cursor, so the infinite-scroll sentinel stays disarmed until a real page lands \u2014 a\nseed is not page one. A *search* replaces them, because they are not results for a query. And seed rows\nonly mean something to the async source \u2014 passing `initialAvailableOptions` without\n`loadAvailableOptions` is ignored with a dev warning, because those rows belong in `availableItems`.\n\n`prefetch` is async-only for the same reason: it schedules the baseline fetch and nothing else, so\nwithout `loadAvailableOptions` there is no fetch to schedule. Passing it there is ignored with a dev\nwarning.\n\n## Notes\n\n- With a paged source, "the full list" that Select-all and the move buttons operate on is what has\n been **loaded**, not what the server holds.\n- Search is both controlled and uncontrolled per panel. When a search-change handler is\n provided the parent owns filtering; otherwise items are filtered client-side.\n- Client-side search matches an item\'s `searchValue` first, then a string `label`, then its\n `value`. Set `searchValue` on items whose `label` is custom JSX so they remain findable by\n their visible text (a ReactNode `label` is otherwise matched only against `value`).\n- Because the component is controlled, "pending until confirm" semantics (e.g. a modal\n with Cancel/Done) are owned by the parent \u2014 see `MultiSelectTransfer`.\n'
3184
4280
  }
3185
4281
  ],
3186
4282
  "directories": []