@veeqo/ui 12.2.0 → 12.3.1

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 (71) hide show
  1. package/dist/components/Anchor/utils/urlUtils.cjs +8 -1
  2. package/dist/components/Anchor/utils/urlUtils.cjs.map +1 -1
  3. package/dist/components/Anchor/utils/urlUtils.d.ts +6 -0
  4. package/dist/components/Anchor/utils/urlUtils.js +8 -2
  5. package/dist/components/Anchor/utils/urlUtils.js.map +1 -1
  6. package/dist/components/SelectDropdown/SelectDropdown.cjs +2 -2
  7. package/dist/components/SelectDropdown/SelectDropdown.cjs.map +1 -1
  8. package/dist/components/SelectDropdown/SelectDropdown.js +2 -2
  9. package/dist/components/SelectDropdown/SelectDropdown.js.map +1 -1
  10. package/dist/components/SelectDropdown/components/GridItem/GridItem.d.ts +3 -0
  11. package/dist/components/SelectDropdown/components/GridItem/index.d.ts +1 -0
  12. package/dist/components/SelectDropdown/components/GridItem/types.d.ts +7 -0
  13. package/dist/components/SelectDropdown/{ListItem/components/ListItemContent.cjs → components/ItemContent/ItemContent.cjs} +17 -17
  14. package/dist/components/SelectDropdown/components/ItemContent/ItemContent.cjs.map +1 -0
  15. package/dist/components/SelectDropdown/components/ItemContent/ItemContent.d.ts +3 -0
  16. package/dist/components/SelectDropdown/{ListItem/components/ListItemContent.js → components/ItemContent/ItemContent.js} +15 -15
  17. package/dist/components/SelectDropdown/components/ItemContent/ItemContent.js.map +1 -0
  18. package/dist/components/SelectDropdown/components/ItemContent/ItemContent.module.scss.cjs +9 -0
  19. package/dist/components/SelectDropdown/components/ItemContent/ItemContent.module.scss.cjs.map +1 -0
  20. package/dist/components/SelectDropdown/components/ItemContent/ItemContent.module.scss.js +7 -0
  21. package/dist/components/SelectDropdown/components/ItemContent/ItemContent.module.scss.js.map +1 -0
  22. package/dist/components/SelectDropdown/components/ItemContent/SelectionType.cjs.map +1 -0
  23. package/dist/components/SelectDropdown/components/ItemContent/SelectionType.js.map +1 -0
  24. package/dist/components/SelectDropdown/components/ItemContent/index.d.ts +1 -0
  25. package/dist/components/SelectDropdown/{ListItem/components → components/ItemContent}/types.d.ts +4 -2
  26. package/dist/components/SelectDropdown/components/ListItem/ListItem.cjs +23 -0
  27. package/dist/components/SelectDropdown/components/ListItem/ListItem.cjs.map +1 -0
  28. package/dist/components/SelectDropdown/components/ListItem/ListItem.js +17 -0
  29. package/dist/components/SelectDropdown/components/ListItem/ListItem.js.map +1 -0
  30. package/dist/components/SelectDropdown/components/ListItem/types.d.ts +3 -0
  31. package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/ListItemSection.cjs +5 -5
  32. package/dist/components/SelectDropdown/components/ListItemSection/ListItemSection.cjs.map +1 -0
  33. package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/ListItemSection.js +5 -5
  34. package/dist/components/SelectDropdown/components/ListItemSection/ListItemSection.js.map +1 -0
  35. package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/ListItemSection.module.scss.cjs +1 -1
  36. package/dist/components/SelectDropdown/components/ListItemSection/ListItemSection.module.scss.cjs.map +1 -0
  37. package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/ListItemSection.module.scss.js +1 -1
  38. package/dist/components/SelectDropdown/components/ListItemSection/ListItemSection.module.scss.js.map +1 -0
  39. package/dist/components/SelectDropdown/components/item.module.scss.cjs +9 -0
  40. package/dist/components/SelectDropdown/components/item.module.scss.cjs.map +1 -0
  41. package/dist/components/SelectDropdown/components/item.module.scss.js +7 -0
  42. package/dist/components/SelectDropdown/components/item.module.scss.js.map +1 -0
  43. package/dist/components/SelectDropdown/{ListItem → components}/types.d.ts +5 -7
  44. package/dist/components/SelectDropdown/types.d.ts +2 -2
  45. package/dist/components/SelectDropdown/utils.cjs.map +1 -1
  46. package/dist/components/SelectDropdown/utils.js.map +1 -1
  47. package/package.json +1 -1
  48. package/dist/components/SelectDropdown/ListItem/ListItem.cjs +0 -23
  49. package/dist/components/SelectDropdown/ListItem/ListItem.cjs.map +0 -1
  50. package/dist/components/SelectDropdown/ListItem/ListItem.js +0 -17
  51. package/dist/components/SelectDropdown/ListItem/ListItem.js.map +0 -1
  52. package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.cjs +0 -9
  53. package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.cjs.map +0 -1
  54. package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.js +0 -7
  55. package/dist/components/SelectDropdown/ListItem/ListItem.module.scss.js.map +0 -1
  56. package/dist/components/SelectDropdown/ListItem/components/ListItemContent.cjs.map +0 -1
  57. package/dist/components/SelectDropdown/ListItem/components/ListItemContent.d.ts +0 -3
  58. package/dist/components/SelectDropdown/ListItem/components/ListItemContent.js.map +0 -1
  59. package/dist/components/SelectDropdown/ListItem/components/SelectionType.cjs.map +0 -1
  60. package/dist/components/SelectDropdown/ListItem/components/SelectionType.js.map +0 -1
  61. package/dist/components/SelectDropdown/ListItemSection/ListItemSection.cjs.map +0 -1
  62. package/dist/components/SelectDropdown/ListItemSection/ListItemSection.js.map +0 -1
  63. package/dist/components/SelectDropdown/ListItemSection/ListItemSection.module.scss.cjs.map +0 -1
  64. package/dist/components/SelectDropdown/ListItemSection/ListItemSection.module.scss.js.map +0 -1
  65. /package/dist/components/SelectDropdown/{ListItem/components → components/ItemContent}/SelectionType.cjs +0 -0
  66. /package/dist/components/SelectDropdown/{ListItem/components → components/ItemContent}/SelectionType.d.ts +0 -0
  67. /package/dist/components/SelectDropdown/{ListItem/components → components/ItemContent}/SelectionType.js +0 -0
  68. /package/dist/components/SelectDropdown/{ListItem → components/ListItem}/ListItem.d.ts +0 -0
  69. /package/dist/components/SelectDropdown/{ListItem → components/ListItem}/index.d.ts +0 -0
  70. /package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/ListItemSection.d.ts +0 -0
  71. /package/dist/components/SelectDropdown/{ListItemSection → components/ListItemSection}/index.d.ts +0 -0
@@ -22,6 +22,12 @@ const isRelativeUrl = (url) => !url.match(/^(https?:\/\/|\/\/)/);
22
22
  * @returns {boolean} Whether the URL is an anchor link
23
23
  */
24
24
  const isAnchorUrl = (url) => url.startsWith('#');
25
+ /**
26
+ * Checks if a URL is a mailto link (starts with mailto)
27
+ * @param {string} url - The URL to check
28
+ * @returns {boolean} Whether the URL is an anchor link
29
+ */
30
+ const isMailtoUrl = (url) => url.startsWith('mailto:');
25
31
  /**
26
32
  * Adds the appropriate prefix to a URL based on the current context
27
33
  * @param {string} url - The URL to add a prefix to
@@ -36,7 +42,7 @@ const addPrefixToUrl = (url) => { var _a; return `${((_a = window.veeqoContext)
36
42
  const createContextAwareUrl = (url) => {
37
43
  if (!url)
38
44
  return '';
39
- if (isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url))
45
+ if (isMailtoUrl(url) || isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url))
40
46
  return url;
41
47
  return addPrefixToUrl(url);
42
48
  };
@@ -44,6 +50,7 @@ const createContextAwareUrl = (url) => {
44
50
  exports.addPrefixToUrl = addPrefixToUrl;
45
51
  exports.createContextAwareUrl = createContextAwareUrl;
46
52
  exports.isAnchorUrl = isAnchorUrl;
53
+ exports.isMailtoUrl = isMailtoUrl;
47
54
  exports.isRelativeUrl = isRelativeUrl;
48
55
  exports.shouldAddPrefix = shouldAddPrefix;
49
56
  //# sourceMappingURL=urlUtils.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"urlUtils.cjs","sources":["../../../../src/components/Anchor/utils/urlUtils.ts"],"sourcesContent":["/**\n * Utility functions for URL processing\n */\n\n/**\n * Checks if the URL should have a prefix added based on the current context\n * @returns {boolean} Whether a prefix should be added\n */\nexport const shouldAddPrefix = (): boolean =>\n !!(\n window.veeqoContext &&\n window.veeqoContext.vqHost !== 'standalone' &&\n window.veeqoContext.baseUrl\n );\n\n/**\n * Checks if a URL is relative (not starting with http://, https://, or //)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is relative\n */\nexport const isRelativeUrl = (url: string): boolean => !url.match(/^(https?:\\/\\/|\\/\\/)/);\n\n/**\n * Checks if a URL is an anchor link (starts with #)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is an anchor link\n */\nexport const isAnchorUrl = (url: string): boolean => url.startsWith('#');\n\n/**\n * Adds the appropriate prefix to a URL based on the current context\n * @param {string} url - The URL to add a prefix to\n * @returns {string} The URL with prefix added if needed\n */\nexport const addPrefixToUrl = (url: string): string =>\n `${window.veeqoContext?.baseUrl || ''}${url.startsWith('/') ? '' : '/'}${url}`;\n\n/**\n * Processes a URL by adding the appropriate prefix if needed\n * @param {string} url - The URL to process\n * @returns {string} The processed URL\n */\nexport const createContextAwareUrl = (url: string | undefined | null): string => {\n if (!url) return '';\n if (isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url)) return url;\n\n return addPrefixToUrl(url);\n};\n"],"names":[],"mappings":";;AAAA;;AAEG;AAEH;;;AAGG;AACI,MAAM,eAAe,GAAG,MAC7B,CAAC,EACC,MAAM,CAAC,YAAY;AACnB,IAAA,MAAM,CAAC,YAAY,CAAC,MAAM,KAAK,YAAY;AAC3C,IAAA,MAAM,CAAC,YAAY,CAAC,OAAO;AAG/B;;;;AAIG;AACU,MAAA,aAAa,GAAG,CAAC,GAAW,KAAc,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB;AAEvF;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,GAAG;AAEvE;;;;AAIG;AACU,MAAA,cAAc,GAAG,CAAC,GAAW,KAAY,EAAA,IAAA,EAAA,CAAA,CACpD,OAAA,CAAA,EAAG,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,YAAY,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,OAAO,KAAI,EAAE,CAAG,EAAA,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,CAAA,EAAG,GAAG,CAAE,CAAA,CAAA;AAEhF;;;;AAIG;AACU,MAAA,qBAAqB,GAAG,CAAC,GAA8B,KAAY;AAC9E,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,EAAE;AACnB,IAAA,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,GAAG;AAE7E,IAAA,OAAO,cAAc,CAAC,GAAG,CAAC;AAC5B;;;;;;;;"}
1
+ {"version":3,"file":"urlUtils.cjs","sources":["../../../../src/components/Anchor/utils/urlUtils.ts"],"sourcesContent":["/**\n * Utility functions for URL processing\n */\n\n/**\n * Checks if the URL should have a prefix added based on the current context\n * @returns {boolean} Whether a prefix should be added\n */\nexport const shouldAddPrefix = (): boolean =>\n !!(\n window.veeqoContext &&\n window.veeqoContext.vqHost !== 'standalone' &&\n window.veeqoContext.baseUrl\n );\n\n/**\n * Checks if a URL is relative (not starting with http://, https://, or //)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is relative\n */\nexport const isRelativeUrl = (url: string): boolean => !url.match(/^(https?:\\/\\/|\\/\\/)/);\n\n/**\n * Checks if a URL is an anchor link (starts with #)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is an anchor link\n */\nexport const isAnchorUrl = (url: string): boolean => url.startsWith('#');\n\n/**\n * Checks if a URL is a mailto link (starts with mailto)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is an anchor link\n */\nexport const isMailtoUrl = (url: string): boolean => url.startsWith('mailto:');\n\n/**\n * Adds the appropriate prefix to a URL based on the current context\n * @param {string} url - The URL to add a prefix to\n * @returns {string} The URL with prefix added if needed\n */\nexport const addPrefixToUrl = (url: string): string =>\n `${window.veeqoContext?.baseUrl || ''}${url.startsWith('/') ? '' : '/'}${url}`;\n\n/**\n * Processes a URL by adding the appropriate prefix if needed\n * @param {string} url - The URL to process\n * @returns {string} The processed URL\n */\nexport const createContextAwareUrl = (url: string | undefined | null): string => {\n if (!url) return '';\n if (isMailtoUrl(url) || isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url)) return url;\n\n return addPrefixToUrl(url);\n};\n"],"names":[],"mappings":";;AAAA;;AAEG;AAEH;;;AAGG;AACI,MAAM,eAAe,GAAG,MAC7B,CAAC,EACC,MAAM,CAAC,YAAY;AACnB,IAAA,MAAM,CAAC,YAAY,CAAC,MAAM,KAAK,YAAY;AAC3C,IAAA,MAAM,CAAC,YAAY,CAAC,OAAO;AAG/B;;;;AAIG;AACU,MAAA,aAAa,GAAG,CAAC,GAAW,KAAc,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB;AAEvF;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,GAAG;AAEvE;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,SAAS;AAE7E;;;;AAIG;AACU,MAAA,cAAc,GAAG,CAAC,GAAW,KAAY,EAAA,IAAA,EAAA,CAAA,CACpD,OAAA,CAAA,EAAG,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,YAAY,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,OAAO,KAAI,EAAE,CAAG,EAAA,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,CAAA,EAAG,GAAG,CAAE,CAAA,CAAA;AAEhF;;;;AAIG;AACU,MAAA,qBAAqB,GAAG,CAAC,GAA8B,KAAY;AAC9E,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,EAAE;AACnB,IAAA,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,GAAG;AAEjG,IAAA,OAAO,cAAc,CAAC,GAAG,CAAC;AAC5B;;;;;;;;;"}
@@ -18,6 +18,12 @@ export declare const isRelativeUrl: (url: string) => boolean;
18
18
  * @returns {boolean} Whether the URL is an anchor link
19
19
  */
20
20
  export declare const isAnchorUrl: (url: string) => boolean;
21
+ /**
22
+ * Checks if a URL is a mailto link (starts with mailto)
23
+ * @param {string} url - The URL to check
24
+ * @returns {boolean} Whether the URL is an anchor link
25
+ */
26
+ export declare const isMailtoUrl: (url: string) => boolean;
21
27
  /**
22
28
  * Adds the appropriate prefix to a URL based on the current context
23
29
  * @param {string} url - The URL to add a prefix to
@@ -20,6 +20,12 @@ const isRelativeUrl = (url) => !url.match(/^(https?:\/\/|\/\/)/);
20
20
  * @returns {boolean} Whether the URL is an anchor link
21
21
  */
22
22
  const isAnchorUrl = (url) => url.startsWith('#');
23
+ /**
24
+ * Checks if a URL is a mailto link (starts with mailto)
25
+ * @param {string} url - The URL to check
26
+ * @returns {boolean} Whether the URL is an anchor link
27
+ */
28
+ const isMailtoUrl = (url) => url.startsWith('mailto:');
23
29
  /**
24
30
  * Adds the appropriate prefix to a URL based on the current context
25
31
  * @param {string} url - The URL to add a prefix to
@@ -34,10 +40,10 @@ const addPrefixToUrl = (url) => { var _a; return `${((_a = window.veeqoContext)
34
40
  const createContextAwareUrl = (url) => {
35
41
  if (!url)
36
42
  return '';
37
- if (isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url))
43
+ if (isMailtoUrl(url) || isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url))
38
44
  return url;
39
45
  return addPrefixToUrl(url);
40
46
  };
41
47
 
42
- export { addPrefixToUrl, createContextAwareUrl, isAnchorUrl, isRelativeUrl, shouldAddPrefix };
48
+ export { addPrefixToUrl, createContextAwareUrl, isAnchorUrl, isMailtoUrl, isRelativeUrl, shouldAddPrefix };
43
49
  //# sourceMappingURL=urlUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"urlUtils.js","sources":["../../../../src/components/Anchor/utils/urlUtils.ts"],"sourcesContent":["/**\n * Utility functions for URL processing\n */\n\n/**\n * Checks if the URL should have a prefix added based on the current context\n * @returns {boolean} Whether a prefix should be added\n */\nexport const shouldAddPrefix = (): boolean =>\n !!(\n window.veeqoContext &&\n window.veeqoContext.vqHost !== 'standalone' &&\n window.veeqoContext.baseUrl\n );\n\n/**\n * Checks if a URL is relative (not starting with http://, https://, or //)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is relative\n */\nexport const isRelativeUrl = (url: string): boolean => !url.match(/^(https?:\\/\\/|\\/\\/)/);\n\n/**\n * Checks if a URL is an anchor link (starts with #)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is an anchor link\n */\nexport const isAnchorUrl = (url: string): boolean => url.startsWith('#');\n\n/**\n * Adds the appropriate prefix to a URL based on the current context\n * @param {string} url - The URL to add a prefix to\n * @returns {string} The URL with prefix added if needed\n */\nexport const addPrefixToUrl = (url: string): string =>\n `${window.veeqoContext?.baseUrl || ''}${url.startsWith('/') ? '' : '/'}${url}`;\n\n/**\n * Processes a URL by adding the appropriate prefix if needed\n * @param {string} url - The URL to process\n * @returns {string} The processed URL\n */\nexport const createContextAwareUrl = (url: string | undefined | null): string => {\n if (!url) return '';\n if (isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url)) return url;\n\n return addPrefixToUrl(url);\n};\n"],"names":[],"mappings":"AAAA;;AAEG;AAEH;;;AAGG;AACI,MAAM,eAAe,GAAG,MAC7B,CAAC,EACC,MAAM,CAAC,YAAY;AACnB,IAAA,MAAM,CAAC,YAAY,CAAC,MAAM,KAAK,YAAY;AAC3C,IAAA,MAAM,CAAC,YAAY,CAAC,OAAO;AAG/B;;;;AAIG;AACU,MAAA,aAAa,GAAG,CAAC,GAAW,KAAc,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB;AAEvF;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,GAAG;AAEvE;;;;AAIG;AACU,MAAA,cAAc,GAAG,CAAC,GAAW,KAAY,EAAA,IAAA,EAAA,CAAA,CACpD,OAAA,CAAA,EAAG,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,YAAY,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,OAAO,KAAI,EAAE,CAAG,EAAA,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,CAAA,EAAG,GAAG,CAAE,CAAA,CAAA;AAEhF;;;;AAIG;AACU,MAAA,qBAAqB,GAAG,CAAC,GAA8B,KAAY;AAC9E,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,EAAE;AACnB,IAAA,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,GAAG;AAE7E,IAAA,OAAO,cAAc,CAAC,GAAG,CAAC;AAC5B;;;;"}
1
+ {"version":3,"file":"urlUtils.js","sources":["../../../../src/components/Anchor/utils/urlUtils.ts"],"sourcesContent":["/**\n * Utility functions for URL processing\n */\n\n/**\n * Checks if the URL should have a prefix added based on the current context\n * @returns {boolean} Whether a prefix should be added\n */\nexport const shouldAddPrefix = (): boolean =>\n !!(\n window.veeqoContext &&\n window.veeqoContext.vqHost !== 'standalone' &&\n window.veeqoContext.baseUrl\n );\n\n/**\n * Checks if a URL is relative (not starting with http://, https://, or //)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is relative\n */\nexport const isRelativeUrl = (url: string): boolean => !url.match(/^(https?:\\/\\/|\\/\\/)/);\n\n/**\n * Checks if a URL is an anchor link (starts with #)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is an anchor link\n */\nexport const isAnchorUrl = (url: string): boolean => url.startsWith('#');\n\n/**\n * Checks if a URL is a mailto link (starts with mailto)\n * @param {string} url - The URL to check\n * @returns {boolean} Whether the URL is an anchor link\n */\nexport const isMailtoUrl = (url: string): boolean => url.startsWith('mailto:');\n\n/**\n * Adds the appropriate prefix to a URL based on the current context\n * @param {string} url - The URL to add a prefix to\n * @returns {string} The URL with prefix added if needed\n */\nexport const addPrefixToUrl = (url: string): string =>\n `${window.veeqoContext?.baseUrl || ''}${url.startsWith('/') ? '' : '/'}${url}`;\n\n/**\n * Processes a URL by adding the appropriate prefix if needed\n * @param {string} url - The URL to process\n * @returns {string} The processed URL\n */\nexport const createContextAwareUrl = (url: string | undefined | null): string => {\n if (!url) return '';\n if (isMailtoUrl(url) || isAnchorUrl(url) || !shouldAddPrefix() || !isRelativeUrl(url)) return url;\n\n return addPrefixToUrl(url);\n};\n"],"names":[],"mappings":"AAAA;;AAEG;AAEH;;;AAGG;AACI,MAAM,eAAe,GAAG,MAC7B,CAAC,EACC,MAAM,CAAC,YAAY;AACnB,IAAA,MAAM,CAAC,YAAY,CAAC,MAAM,KAAK,YAAY;AAC3C,IAAA,MAAM,CAAC,YAAY,CAAC,OAAO;AAG/B;;;;AAIG;AACU,MAAA,aAAa,GAAG,CAAC,GAAW,KAAc,CAAC,GAAG,CAAC,KAAK,CAAC,qBAAqB;AAEvF;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,GAAG;AAEvE;;;;AAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,SAAS;AAE7E;;;;AAIG;AACU,MAAA,cAAc,GAAG,CAAC,GAAW,KAAY,EAAA,IAAA,EAAA,CAAA,CACpD,OAAA,CAAA,EAAG,CAAA,CAAA,EAAA,GAAA,MAAM,CAAC,YAAY,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,OAAO,KAAI,EAAE,CAAG,EAAA,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,CAAA,EAAG,GAAG,CAAE,CAAA,CAAA;AAEhF;;;;AAIG;AACU,MAAA,qBAAqB,GAAG,CAAC,GAA8B,KAAY;AAC9E,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,EAAE;AACnB,IAAA,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,GAAG;AAEjG,IAAA,OAAO,cAAc,CAAC,GAAG,CAAC;AAC5B;;;;"}
@@ -6,8 +6,8 @@ var buildClassnames = require('../../utils/buildClassnames.cjs');
6
6
  require('uid/secure');
7
7
  var SelectedOption = require('./components/SelectedOption.cjs');
8
8
  var utils = require('./utils.cjs');
9
- var ListItemSection = require('./ListItemSection/ListItemSection.cjs');
10
- var ListItem = require('./ListItem/ListItem.cjs');
9
+ var ListItemSection = require('./components/ListItemSection/ListItemSection.cjs');
10
+ var ListItem = require('./components/ListItem/ListItem.cjs');
11
11
  var SelectDropdownState = require('./components/SelectDropdownState.cjs');
12
12
  var Dropdown = require('../Dropdown/Dropdown.cjs');
13
13
  var Search = require('../Search/Search.cjs');
@@ -1 +1 @@
1
- {"version":3,"file":"SelectDropdown.cjs","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Key, ListBox, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport { SelectDropdownItem, SelectDropdownProps } from './types';\nimport { ListItemSection, ListItemSectionProps } from './ListItemSection/ListItemSection';\nimport { ListItem } from './ListItem';\nimport { ListItemProps } from './ListItem/types';\nimport { SelectDropdownState } from './components/SelectDropdownState';\nimport { Dropdown } from '../Dropdown';\nimport { Search } from '../Search';\nimport { Button } from '../Button';\nimport styles from './SelectDropdown.module.scss';\nimport formStyles from '../../utils/forms/form.module.scss';\n\nexport const SelectDropdown = ({\n id,\n className,\n placeholder = 'Select item',\n multiple = false,\n compact = false,\n hasError = false,\n disabled,\n options,\n value,\n actions,\n isLoading = false,\n searchValue,\n emptyStateSlot,\n onSearchChange,\n onChange,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...otherProps\n}: SelectDropdownProps) => {\n const hasSection = options.flatMap((option) => option).some((item) => 'items' in item);\n const classNames = generateClassNames(className);\n\n const [isSelectOpen, setIsSelectOpen] = useState(false);\n\n const selectedValues = getSelectedValues(options, hasSection, value);\n const selectionMode = multiple ? 'multiple' : 'single';\n\n const onSelectionChange = useCallback(\n (keys: Selection) => {\n const selectedKeys = Array.from(keys);\n const newSelectedValues = getSelectedValues(options, hasSection, selectedKeys);\n\n if (multiple) {\n (onChange as (items: SelectDropdownItem[]) => void)(newSelectedValues);\n } else {\n (onChange as (item: SelectDropdownItem) => void)(newSelectedValues[0]);\n setIsSelectOpen(false);\n }\n },\n [options, hasSection, multiple, onChange],\n );\n\n return (\n <Dropdown\n id={`select-dropdown-${id}`}\n className={buildClassnames([classNames?.popover, styles.dropdown, className])}\n shouldShow={isSelectOpen}\n setShouldShow={setIsSelectOpen}\n useAnchorWidth\n disabled={disabled}\n renderCta={(buttonProps, anchorRef) => (\n <button\n {...buttonProps}\n type=\"button\"\n ref={anchorRef}\n className={buildClassnames([\n className,\n styles.dropdownTrigger,\n formStyles.fullStyles,\n formStyles.base,\n hasError && formStyles.error,\n compact && formStyles.compact,\n ])}\n >\n <SelectedOption\n placeholder={placeholder}\n options={selectedValues}\n selectionMode={selectionMode}\n />\n </button>\n )}\n >\n {onSearchChange && (\n <>\n <Search className={styles.search} value={searchValue} onChange={onSearchChange} />\n <hr className={styles.separator} />\n </>\n )}\n <ListBox\n className={buildClassnames([classNames?.optionsContainer, styles.listBox, className])}\n aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n selectionMode={selectionMode}\n items={options}\n onSelectionChange={onSelectionChange}\n selectedKeys={selectedValues.map((selectedValue) => selectedValue.id) as Key[]}\n renderEmptyState={() => (\n <SelectDropdownState isLoading={isLoading} emptyStateSlot={emptyStateSlot} />\n )}\n {...otherProps}\n >\n {(item) =>\n hasSection ? (\n <ListItemSection {...(item as ListItemSectionProps)} />\n ) : (\n <ListItem {...(item as ListItemProps)} />\n )\n }\n </ListBox>\n {actions?.map(({ label, ...actionProps }) => (\n <Fragment key={label}>\n <hr className={styles.separator} key={`seperator-${label}`} />\n <Button className={styles.ctaButton} variant=\"flat\" key={label} {...actionProps} />\n </Fragment>\n ))}\n </Dropdown>\n );\n};\n"],"names":["generateClassNames","useState","getSelectedValues","useCallback","React","Dropdown","buildClassnames","styles","formStyles","SelectedOption","Search","ListBox","SelectDropdownState","ListItemSection","ListItem","Fragment","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAkBa,MAAA,cAAc,GAAG,CAAC,EAC7B,EAAE,EACF,SAAS,EACT,WAAW,GAAG,aAAa,EAC3B,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,GAAG,UAAU,EACO,KAAI;IACxB,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC;AACtF,IAAA,MAAM,UAAU,GAAGA,wBAAkB,CAAC,SAAS,CAAC;IAEhD,MAAM,CAAC,YAAY,EAAE,eA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,KAAK,aAAa,CAAC,EAAE,CAAU,EAC9E,gBAAgB,EAAE,OAChBH,sBAAA,CAAA,aAAA,CAACQ,uCAAmB,EAAA,EAAC,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAC9E,EAAA,GACG,UAAU,EAAA,EAEb,CAAC,IAAI,KACJ,UAAU,IACRR,sBAAC,CAAA,aAAA,CAAAS,+BAAe,EAAM,EAAA,GAAA,IAA6B,EAAI,CAAA,KAEvDT,sBAAC,CAAA,aAAA,CAAAU,iBAAQ,EAAM,EAAA,GAAA,IAAsB,EAAI,CAAA,CAC1C,CAEK,EACT,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,SAAA,GAAA,SAAA;AAAP,QAAA,OAAO,CAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MACtCV,sBAAA,CAAA,aAAA,CAACW,cAAQ,EAAC,EAAA,GAAG,EAAE,KAAK,EAAA;YAClBX,sBAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAEG,qBAAM,CAAC,SAAS,EAAE,GAAG,EAAE,CAAA,UAAA,EAAa,KAAK,CAAA,CAAE,EAAI,CAAA;YAC9DH,sBAAC,CAAA,aAAA,CAAAY,aAAM,IAAC,SAAS,EAAET,qBAAM,CAAC,SAAS,EAAE,OAAO,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,EAAA,GAAM,WAAW,EAAA,CAAI,CAC1E,CACZ,CAAC,CACO;AAEf;;;;"}
1
+ {"version":3,"file":"SelectDropdown.cjs","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Key, ListBox, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport { SelectDropdownItem, SelectDropdownProps } from './types';\nimport {\n ListItemSection,\n ListItemSectionProps,\n} from './components/ListItemSection/ListItemSection';\nimport { ListItem } from './components/ListItem';\nimport { ListItemProps } from './components/ListItem/types';\nimport { SelectDropdownState } from './components/SelectDropdownState';\nimport { Dropdown } from '../Dropdown';\nimport { Search } from '../Search';\nimport { Button } from '../Button';\nimport styles from './SelectDropdown.module.scss';\nimport formStyles from '../../utils/forms/form.module.scss';\n\nexport const SelectDropdown = ({\n id,\n className,\n placeholder = 'Select item',\n multiple = false,\n compact = false,\n hasError = false,\n disabled,\n options,\n value,\n actions,\n isLoading = false,\n searchValue,\n emptyStateSlot,\n onSearchChange,\n onChange,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...otherProps\n}: SelectDropdownProps) => {\n const hasSection = options.flatMap((option) => option).some((item) => 'items' in item);\n const classNames = generateClassNames(className);\n\n const [isSelectOpen, setIsSelectOpen] = useState(false);\n\n const selectedValues = getSelectedValues(options, hasSection, value);\n const selectionMode = multiple ? 'multiple' : 'single';\n\n const onSelectionChange = useCallback(\n (keys: Selection) => {\n const selectedKeys = Array.from(keys);\n const newSelectedValues = getSelectedValues(options, hasSection, selectedKeys);\n\n if (multiple) {\n (onChange as (items: SelectDropdownItem[]) => void)(newSelectedValues);\n } else {\n (onChange as (item: SelectDropdownItem) => void)(newSelectedValues[0]);\n setIsSelectOpen(false);\n }\n },\n [options, hasSection, multiple, onChange],\n );\n\n return (\n <Dropdown\n id={`select-dropdown-${id}`}\n className={buildClassnames([classNames?.popover, styles.dropdown, className])}\n shouldShow={isSelectOpen}\n setShouldShow={setIsSelectOpen}\n useAnchorWidth\n disabled={disabled}\n renderCta={(buttonProps, anchorRef) => (\n <button\n {...buttonProps}\n type=\"button\"\n ref={anchorRef}\n className={buildClassnames([\n className,\n styles.dropdownTrigger,\n formStyles.fullStyles,\n formStyles.base,\n hasError && formStyles.error,\n compact && formStyles.compact,\n ])}\n >\n <SelectedOption\n placeholder={placeholder}\n options={selectedValues}\n selectionMode={selectionMode}\n />\n </button>\n )}\n >\n {onSearchChange && (\n <>\n <Search className={styles.search} value={searchValue} onChange={onSearchChange} />\n <hr className={styles.separator} />\n </>\n )}\n <ListBox\n className={buildClassnames([classNames?.optionsContainer, styles.listBox, className])}\n aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n selectionMode={selectionMode}\n items={options}\n onSelectionChange={onSelectionChange}\n selectedKeys={selectedValues.map((selectedValue) => selectedValue.id) as Key[]}\n renderEmptyState={() => (\n <SelectDropdownState isLoading={isLoading} emptyStateSlot={emptyStateSlot} />\n )}\n {...otherProps}\n >\n {(item) =>\n hasSection ? (\n <ListItemSection {...(item as ListItemSectionProps)} />\n ) : (\n <ListItem {...(item as ListItemProps)} />\n )\n }\n </ListBox>\n {actions?.map(({ label, ...actionProps }) => (\n <Fragment key={label}>\n <hr className={styles.separator} key={`seperator-${label}`} />\n <Button className={styles.ctaButton} variant=\"flat\" key={label} {...actionProps} />\n </Fragment>\n ))}\n </Dropdown>\n );\n};\n"],"names":["generateClassNames","useState","getSelectedValues","useCallback","React","Dropdown","buildClassnames","styles","formStyles","SelectedOption","Search","ListBox","SelectDropdownState","ListItemSection","ListItem","Fragment","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAqBa,MAAA,cAAc,GAAG,CAAC,EAC7B,EAAE,EACF,SAAS,EACT,WAAW,GAAG,aAAa,EAC3B,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,GAAG,UAAU,EACO,KAAI;IACxB,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KA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,CAAG,EAAA,EAAE,CAAO,KAAA,CAAA,EACjD,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,aAAa,KAAK,aAAa,CAAC,EAAE,CAAU,EAC9E,gBAAgB,EAAE,OAChBH,sBAAA,CAAA,aAAA,CAACQ,uCAAmB,EAAA,EAAC,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAC9E,EAAA,GACG,UAAU,EAAA,EAEb,CAAC,IAAI,KACJ,UAAU,IACRR,sBAAC,CAAA,aAAA,CAAAS,+BAAe,EAAM,EAAA,GAAA,IAA6B,EAAI,CAAA,KAEvDT,sBAAC,CAAA,aAAA,CAAAU,iBAAQ,EAAM,EAAA,GAAA,IAAsB,EAAI,CAAA,CAC1C,CAEK,EACT,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,SAAA,GAAA,SAAA;AAAP,QAAA,OAAO,CAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MACtCV,sBAAA,CAAA,aAAA,CAACW,cAAQ,EAAC,EAAA,GAAG,EAAE,KAAK,EAAA;YAClBX,sBAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAEG,qBAAM,CAAC,SAAS,EAAE,GAAG,EAAE,CAAA,UAAA,EAAa,KAAK,CAAA,CAAE,EAAI,CAAA;YAC9DH,sBAAC,CAAA,aAAA,CAAAY,aAAM,IAAC,SAAS,EAAET,qBAAM,CAAC,SAAS,EAAE,OAAO,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,EAAA,GAAM,WAAW,EAAA,CAAI,CAC1E,CACZ,CAAC,CACO;AAEf;;;;"}
@@ -4,8 +4,8 @@ import { buildClassnames } from '../../utils/buildClassnames.js';
4
4
  import 'uid/secure';
5
5
  import { SelectedOption } from './components/SelectedOption.js';
6
6
  import { getSelectedValues, generateClassNames } from './utils.js';
7
- import { ListItemSection } from './ListItemSection/ListItemSection.js';
8
- import { ListItem } from './ListItem/ListItem.js';
7
+ import { ListItemSection } from './components/ListItemSection/ListItemSection.js';
8
+ import { ListItem } from './components/ListItem/ListItem.js';
9
9
  import { SelectDropdownState } from './components/SelectDropdownState.js';
10
10
  import { Dropdown } from '../Dropdown/Dropdown.js';
11
11
  import { Search } from '../Search/Search.js';
@@ -1 +1 @@
1
- {"version":3,"file":"SelectDropdown.js","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Key, ListBox, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport { SelectDropdownItem, SelectDropdownProps } from './types';\nimport { ListItemSection, ListItemSectionProps } from './ListItemSection/ListItemSection';\nimport { ListItem } from './ListItem';\nimport { ListItemProps } from './ListItem/types';\nimport { SelectDropdownState } from './components/SelectDropdownState';\nimport { Dropdown } from '../Dropdown';\nimport { Search } from '../Search';\nimport { Button } from '../Button';\nimport styles from './SelectDropdown.module.scss';\nimport formStyles from '../../utils/forms/form.module.scss';\n\nexport const SelectDropdown = ({\n id,\n className,\n placeholder = 'Select item',\n multiple = false,\n compact = false,\n hasError = false,\n disabled,\n options,\n value,\n actions,\n isLoading = false,\n searchValue,\n emptyStateSlot,\n onSearchChange,\n onChange,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...otherProps\n}: SelectDropdownProps) => {\n const hasSection = options.flatMap((option) => option).some((item) => 'items' in item);\n const classNames = generateClassNames(className);\n\n const [isSelectOpen, setIsSelectOpen] = useState(false);\n\n const selectedValues = getSelectedValues(options, hasSection, value);\n const selectionMode = multiple ? 'multiple' : 'single';\n\n const onSelectionChange = useCallback(\n (keys: Selection) => {\n const selectedKeys = Array.from(keys);\n const newSelectedValues = getSelectedValues(options, hasSection, selectedKeys);\n\n if (multiple) {\n (onChange as (items: SelectDropdownItem[]) => void)(newSelectedValues);\n } else {\n (onChange as (item: SelectDropdownItem) => void)(newSelectedValues[0]);\n setIsSelectOpen(false);\n }\n },\n [options, hasSection, multiple, onChange],\n );\n\n return (\n <Dropdown\n id={`select-dropdown-${id}`}\n className={buildClassnames([classNames?.popover, styles.dropdown, className])}\n shouldShow={isSelectOpen}\n setShouldShow={setIsSelectOpen}\n useAnchorWidth\n disabled={disabled}\n renderCta={(buttonProps, anchorRef) => (\n <button\n {...buttonProps}\n type=\"button\"\n ref={anchorRef}\n className={buildClassnames([\n className,\n styles.dropdownTrigger,\n formStyles.fullStyles,\n formStyles.base,\n hasError && formStyles.error,\n compact && formStyles.compact,\n ])}\n >\n <SelectedOption\n placeholder={placeholder}\n options={selectedValues}\n selectionMode={selectionMode}\n />\n </button>\n )}\n >\n {onSearchChange && (\n <>\n <Search className={styles.search} value={searchValue} onChange={onSearchChange} />\n <hr className={styles.separator} />\n </>\n )}\n <ListBox\n className={buildClassnames([classNames?.optionsContainer, styles.listBox, className])}\n aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n selectionMode={selectionMode}\n items={options}\n onSelectionChange={onSelectionChange}\n selectedKeys={selectedValues.map((selectedValue) => selectedValue.id) as Key[]}\n renderEmptyState={() => (\n <SelectDropdownState isLoading={isLoading} emptyStateSlot={emptyStateSlot} />\n )}\n {...otherProps}\n >\n {(item) =>\n hasSection ? (\n <ListItemSection {...(item as ListItemSectionProps)} />\n ) : (\n <ListItem {...(item as ListItemProps)} />\n )\n }\n </ListBox>\n {actions?.map(({ label, ...actionProps }) => (\n <Fragment key={label}>\n <hr className={styles.separator} key={`seperator-${label}`} />\n <Button className={styles.ctaButton} variant=\"flat\" key={label} {...actionProps} />\n </Fragment>\n ))}\n </Dropdown>\n );\n};\n"],"names":["React"],"mappings":";;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GAAG,EAAE,CAAA,UAAA,EAAa,KAAK,CAAA,CAAE,EAAI,CAAA;YAC9DA,cAAC,CAAA,aAAA,CAAA,MAAM,IAAC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,EAAA,GAAM,WAAW,EAAA,CAAI,CAC1E,CACZ,CAAC,CACO;AAEf;;;;"}
1
+ {"version":3,"file":"SelectDropdown.js","sources":["../../../src/components/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Key, ListBox, Selection } from 'react-aria-components';\n\nimport { buildClassnames } from '../../utils';\nimport { SelectedOption } from './components/SelectedOption';\nimport { generateClassNames, getSelectedValues } from './utils';\nimport { SelectDropdownItem, SelectDropdownProps } from './types';\nimport {\n ListItemSection,\n ListItemSectionProps,\n} from './components/ListItemSection/ListItemSection';\nimport { ListItem } from './components/ListItem';\nimport { ListItemProps } from './components/ListItem/types';\nimport { SelectDropdownState } from './components/SelectDropdownState';\nimport { Dropdown } from '../Dropdown';\nimport { Search } from '../Search';\nimport { Button } from '../Button';\nimport styles from './SelectDropdown.module.scss';\nimport formStyles from '../../utils/forms/form.module.scss';\n\nexport const SelectDropdown = ({\n id,\n className,\n placeholder = 'Select item',\n multiple = false,\n compact = false,\n hasError = false,\n disabled,\n options,\n value,\n actions,\n isLoading = false,\n searchValue,\n emptyStateSlot,\n onSearchChange,\n onChange,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...otherProps\n}: SelectDropdownProps) => {\n const hasSection = options.flatMap((option) => option).some((item) => 'items' in item);\n const classNames = generateClassNames(className);\n\n const [isSelectOpen, setIsSelectOpen] = useState(false);\n\n const selectedValues = getSelectedValues(options, hasSection, value);\n const selectionMode = multiple ? 'multiple' : 'single';\n\n const onSelectionChange = useCallback(\n (keys: Selection) => {\n const selectedKeys = Array.from(keys);\n const newSelectedValues = getSelectedValues(options, hasSection, selectedKeys);\n\n if (multiple) {\n (onChange as (items: SelectDropdownItem[]) => void)(newSelectedValues);\n } else {\n (onChange as (item: SelectDropdownItem) => void)(newSelectedValues[0]);\n setIsSelectOpen(false);\n }\n },\n [options, hasSection, multiple, onChange],\n );\n\n return (\n <Dropdown\n id={`select-dropdown-${id}`}\n className={buildClassnames([classNames?.popover, styles.dropdown, className])}\n shouldShow={isSelectOpen}\n setShouldShow={setIsSelectOpen}\n useAnchorWidth\n disabled={disabled}\n renderCta={(buttonProps, anchorRef) => (\n <button\n {...buttonProps}\n type=\"button\"\n ref={anchorRef}\n className={buildClassnames([\n className,\n styles.dropdownTrigger,\n formStyles.fullStyles,\n formStyles.base,\n hasError && formStyles.error,\n compact && formStyles.compact,\n ])}\n >\n <SelectedOption\n placeholder={placeholder}\n options={selectedValues}\n selectionMode={selectionMode}\n />\n </button>\n )}\n >\n {onSearchChange && (\n <>\n <Search className={styles.search} value={searchValue} onChange={onSearchChange} />\n <hr className={styles.separator} />\n </>\n )}\n <ListBox\n className={buildClassnames([classNames?.optionsContainer, styles.listBox, className])}\n aria-labelledby={ariaLabelledBy ?? `${id}-label`}\n aria-describedby={ariaDescribedBy ?? `${id}-hint`}\n selectionMode={selectionMode}\n items={options}\n onSelectionChange={onSelectionChange}\n selectedKeys={selectedValues.map((selectedValue) => selectedValue.id) as Key[]}\n renderEmptyState={() => (\n <SelectDropdownState isLoading={isLoading} emptyStateSlot={emptyStateSlot} />\n )}\n {...otherProps}\n >\n {(item) =>\n hasSection ? (\n <ListItemSection {...(item as ListItemSectionProps)} />\n ) : (\n <ListItem {...(item as ListItemProps)} />\n )\n }\n </ListBox>\n {actions?.map(({ label, ...actionProps }) => (\n <Fragment key={label}>\n <hr className={styles.separator} key={`seperator-${label}`} />\n <Button className={styles.ctaButton} variant=\"flat\" key={label} {...actionProps} />\n </Fragment>\n ))}\n </Dropdown>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;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AAA,UAAA,EAAa,KAAK,CAAA,CAAE,EAAI,CAAA;YAC9DA,cAAC,CAAA,aAAA,CAAA,MAAM,IAAC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,EAAA,GAAM,WAAW,EAAA,CAAI,CAC1E,CACZ,CAAC,CACO;AAEf;;;;"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { GridItemProps } from './types';
3
+ export declare function GridItem({ id, label, href, appearance, className, onClickRowAction, rowActionAriaLabel, isRowActionDisabled, ...props }: GridItemProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export { GridItem } from './GridItem';
@@ -0,0 +1,7 @@
1
+ import { GridListItemProps } from 'react-aria-components';
2
+ import { BaseItemProps } from '../types';
3
+ export type GridItemProps = BaseItemProps & GridListItemProps & {
4
+ onClickRowAction?: () => void;
5
+ rowActionAriaLabel?: string;
6
+ isRowActionDisabled?: boolean;
7
+ };
@@ -10,43 +10,43 @@ var DragIndicatorIcon = require('../../../../icons/design-system/components/Drag
10
10
  var Text = require('../../../Text/Text.cjs');
11
11
  var MiniAlert = require('../../../Alerts/MiniAlert/MiniAlert.cjs');
12
12
  var SelectionType = require('./SelectionType.cjs');
13
- var ListItem_module = require('../ListItem.module.scss.cjs');
13
+ var ItemContent_module = require('./ItemContent.module.scss.cjs');
14
14
  var FlexRow = require('../../../Flex/FlexRow/FlexRow.cjs');
15
15
 
16
16
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
17
17
 
18
18
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
19
19
 
20
- const ListItemContent = ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaSlot, allowsDragging = false, selectionMode = 'single', isLink, isSelected = false, }) => {
21
- const getInfoContainerClassNames = React.useMemo(() => {
22
- const base = ListItem_module.infoContainer;
20
+ const ItemContent = ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaSlot, allowsDragging = false, selectionMode = 'single', isLink, isSelected = false, itemType, }) => {
21
+ const infoContainerClassNames = React.useMemo(() => {
22
+ const base = ItemContent_module.infoContainer;
23
23
  if (itemInfoSlot && endInfoSlot) {
24
- return buildClassnames.buildClassnames([base, ListItem_module.hasItemInfoAndEndInfo]);
24
+ return buildClassnames.buildClassnames([base, ItemContent_module.hasItemInfoAndEndInfo]);
25
25
  }
26
26
  if (itemInfoSlot) {
27
- return buildClassnames.buildClassnames([base, ListItem_module.hasItemInfoOnly]);
27
+ return buildClassnames.buildClassnames([base, ItemContent_module.hasItemInfoOnly]);
28
28
  }
29
29
  if (endInfoSlot) {
30
- return buildClassnames.buildClassnames([base, ListItem_module.hasEndInfoOnly]);
30
+ return buildClassnames.buildClassnames([base, ItemContent_module.hasEndInfoOnly]);
31
31
  }
32
32
  return buildClassnames.buildClassnames([base]);
33
33
  }, [endInfoSlot, itemInfoSlot]);
34
- return (React__default.default.createElement(FlexRow.FlexRow, { flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", gap: "base" },
35
- React__default.default.createElement(FlexRow.FlexRow, { flexWrap: "nowrap", gap: "base", flexGrow: "1" },
34
+ return (React__default.default.createElement(FlexRow.FlexRow, { flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", gap: "base", style: { flexGrow: 1 } },
35
+ React__default.default.createElement(FlexRow.FlexRow, { flexWrap: "nowrap", gap: "base", style: { flexGrow: 1 } },
36
36
  allowsDragging && React__default.default.createElement(DragIndicatorIcon.ReactComponent, { "data-testid": "drag-icon" }),
37
37
  React__default.default.createElement(SelectionType.SelectionType, { selectionMode: selectionMode, isSelected: isSelected, isLink: isLink }),
38
38
  mediaSlot,
39
- React__default.default.createElement(FlexCol.FlexCol, { gap: "xs", flexGrow: "1" },
40
- React__default.default.createElement("div", { className: getInfoContainerClassNames, "data-testid": "info-container" },
41
- React__default.default.createElement(reactAriaComponents.Text, { slot: "label" },
42
- React__default.default.createElement(Text.Text, { variant: "body" }, label)),
39
+ React__default.default.createElement(FlexCol.FlexCol, { gap: "xs", style: { flexGrow: 1 } },
40
+ React__default.default.createElement("div", { className: infoContainerClassNames, "data-testid": "info-container" },
41
+ itemType === 'grid' ? (React__default.default.createElement(Text.Text, { variant: "body" }, label)) : (React__default.default.createElement(reactAriaComponents.Text, { slot: "label" },
42
+ React__default.default.createElement(Text.Text, { variant: "body" }, label))),
43
43
  itemInfoSlot,
44
- endInfoSlot && (React__default.default.createElement("div", { className: endInfoSlot ? ListItem_module.justifyEnd : ListItem_module.justifyStart }, endInfoSlot))),
44
+ endInfoSlot && (React__default.default.createElement("div", { className: endInfoSlot ? ItemContent_module.justifyEnd : ItemContent_module.justifyStart }, endInfoSlot))),
45
45
  hint && (React__default.default.createElement(reactAriaComponents.Text, { slot: "description" },
46
46
  React__default.default.createElement(Text.Text, { variant: "hintText" }, hint))),
47
47
  alert && React__default.default.createElement(MiniAlert.MiniAlert, { title: alert.title, variant: alert.variant }))),
48
- isLink && React__default.default.createElement(ArrowRightIcon.ReactComponent, { className: ListItem_module.linkIcon, "data-testid": "link-icon" })));
48
+ isLink && React__default.default.createElement(ArrowRightIcon.ReactComponent, { className: ItemContent_module.linkIcon, "data-testid": "link-icon" })));
49
49
  };
50
50
 
51
- exports.ListItemContent = ListItemContent;
52
- //# sourceMappingURL=ListItemContent.cjs.map
51
+ exports.ItemContent = ItemContent;
52
+ //# sourceMappingURL=ItemContent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemContent.cjs","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/ItemContent.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Text } from 'react-aria-components';\nimport { buildClassnames } from '../../../../utils';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { ArrowRightIcon, DragIndicatorIcon } from '../../../../icons';\nimport { ItemContentProps } from './types';\nimport { Text as VeeqoText } from '../../../Text';\nimport { MiniAlert } from '../../../Alerts/MiniAlert';\nimport { SelectionType } from './SelectionType';\nimport styles from './ItemContent.module.scss';\nimport { FlexRow } from '../../../Flex/FlexRow';\n\nexport const ItemContent = ({\n label,\n hint,\n itemInfoSlot,\n endInfoSlot,\n alert,\n mediaSlot,\n allowsDragging = false,\n selectionMode = 'single',\n isLink,\n isSelected = false,\n itemType,\n}: ItemContentProps) => {\n const infoContainerClassNames = useMemo(() => {\n const base = styles.infoContainer;\n\n if (itemInfoSlot && endInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoAndEndInfo]);\n }\n\n if (itemInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoOnly]);\n }\n\n if (endInfoSlot) {\n return buildClassnames([base, styles.hasEndInfoOnly]);\n }\n\n return buildClassnames([base]);\n }, [endInfoSlot, itemInfoSlot]);\n\n return (\n <FlexRow\n flexWrap=\"nowrap\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n gap=\"base\"\n style={{ flexGrow: 1 }}\n >\n <FlexRow flexWrap=\"nowrap\" gap=\"base\" style={{ flexGrow: 1 }}>\n {allowsDragging && <DragIndicatorIcon data-testid=\"drag-icon\" />}\n <SelectionType selectionMode={selectionMode} isSelected={isSelected} isLink={isLink} />\n {mediaSlot}\n <FlexCol gap=\"xs\" style={{ flexGrow: 1 }}>\n <div className={infoContainerClassNames} data-testid=\"info-container\">\n {itemType === 'grid' ? (\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n ) : (\n <Text slot=\"label\">\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n </Text>\n )}\n {itemInfoSlot}\n {endInfoSlot && (\n <div className={endInfoSlot ? styles.justifyEnd : styles.justifyStart}>\n {endInfoSlot}\n </div>\n )}\n </div>\n\n {hint && (\n <Text slot=\"description\">\n <VeeqoText variant=\"hintText\">{hint}</VeeqoText>\n </Text>\n )}\n {alert && <MiniAlert title={alert.title} variant={alert.variant} />}\n </FlexCol>\n </FlexRow>\n {isLink && <ArrowRightIcon className={styles.linkIcon} data-testid=\"link-icon\" />}\n </FlexRow>\n );\n};\n"],"names":["use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AA,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAA,CAAI,CAC3D,CACF;AACT,QAAA,MAAM,IAAIP,sBAAA,CAAA,aAAA,CAACQ,6BAAc,EAAA,EAAC,SAAS,EAAEV,kBAAM,CAAC,QAAQ,EAAc,aAAA,EAAA,WAAW,EAAG,CAAA,CACzE;AAEd;;;;"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ItemContentProps } from './types';
3
+ export declare const ItemContent: ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaSlot, allowsDragging, selectionMode, isLink, isSelected, itemType, }: ItemContentProps) => React.JSX.Element;
@@ -1,18 +1,18 @@
1
1
  import React__default, { useMemo } from 'react';
2
- import { Text } from 'react-aria-components';
2
+ import { Text as Text$1 } from 'react-aria-components';
3
3
  import { buildClassnames } from '../../../../utils/buildClassnames.js';
4
4
  import 'uid/secure';
5
5
  import { FlexCol } from '../../../Flex/FlexCol/FlexCol.js';
6
6
  import { ReactComponent as ArrowRightIcon } from '../../../../icons/design-system/components/ArrowRightIcon.js';
7
7
  import { ReactComponent as DragIndicatorIcon } from '../../../../icons/design-system/components/DragIndicatorIcon.js';
8
- import { Text as Text$1 } from '../../../Text/Text.js';
8
+ import { Text } from '../../../Text/Text.js';
9
9
  import { MiniAlert } from '../../../Alerts/MiniAlert/MiniAlert.js';
10
10
  import { SelectionType } from './SelectionType.js';
11
- import styles from '../ListItem.module.scss.js';
11
+ import styles from './ItemContent.module.scss.js';
12
12
  import { FlexRow } from '../../../Flex/FlexRow/FlexRow.js';
13
13
 
14
- const ListItemContent = ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaSlot, allowsDragging = false, selectionMode = 'single', isLink, isSelected = false, }) => {
15
- const getInfoContainerClassNames = useMemo(() => {
14
+ const ItemContent = ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaSlot, allowsDragging = false, selectionMode = 'single', isLink, isSelected = false, itemType, }) => {
15
+ const infoContainerClassNames = useMemo(() => {
16
16
  const base = styles.infoContainer;
17
17
  if (itemInfoSlot && endInfoSlot) {
18
18
  return buildClassnames([base, styles.hasItemInfoAndEndInfo]);
@@ -25,22 +25,22 @@ const ListItemContent = ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaS
25
25
  }
26
26
  return buildClassnames([base]);
27
27
  }, [endInfoSlot, itemInfoSlot]);
28
- return (React__default.createElement(FlexRow, { flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", gap: "base" },
29
- React__default.createElement(FlexRow, { flexWrap: "nowrap", gap: "base", flexGrow: "1" },
28
+ return (React__default.createElement(FlexRow, { flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", gap: "base", style: { flexGrow: 1 } },
29
+ React__default.createElement(FlexRow, { flexWrap: "nowrap", gap: "base", style: { flexGrow: 1 } },
30
30
  allowsDragging && React__default.createElement(DragIndicatorIcon, { "data-testid": "drag-icon" }),
31
31
  React__default.createElement(SelectionType, { selectionMode: selectionMode, isSelected: isSelected, isLink: isLink }),
32
32
  mediaSlot,
33
- React__default.createElement(FlexCol, { gap: "xs", flexGrow: "1" },
34
- React__default.createElement("div", { className: getInfoContainerClassNames, "data-testid": "info-container" },
35
- React__default.createElement(Text, { slot: "label" },
36
- React__default.createElement(Text$1, { variant: "body" }, label)),
33
+ React__default.createElement(FlexCol, { gap: "xs", style: { flexGrow: 1 } },
34
+ React__default.createElement("div", { className: infoContainerClassNames, "data-testid": "info-container" },
35
+ itemType === 'grid' ? (React__default.createElement(Text, { variant: "body" }, label)) : (React__default.createElement(Text$1, { slot: "label" },
36
+ React__default.createElement(Text, { variant: "body" }, label))),
37
37
  itemInfoSlot,
38
38
  endInfoSlot && (React__default.createElement("div", { className: endInfoSlot ? styles.justifyEnd : styles.justifyStart }, endInfoSlot))),
39
- hint && (React__default.createElement(Text, { slot: "description" },
40
- React__default.createElement(Text$1, { variant: "hintText" }, hint))),
39
+ hint && (React__default.createElement(Text$1, { slot: "description" },
40
+ React__default.createElement(Text, { variant: "hintText" }, hint))),
41
41
  alert && React__default.createElement(MiniAlert, { title: alert.title, variant: alert.variant }))),
42
42
  isLink && React__default.createElement(ArrowRightIcon, { className: styles.linkIcon, "data-testid": "link-icon" })));
43
43
  };
44
44
 
45
- export { ListItemContent };
46
- //# sourceMappingURL=ListItemContent.js.map
45
+ export { ItemContent };
46
+ //# sourceMappingURL=ItemContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemContent.js","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/ItemContent.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Text } from 'react-aria-components';\nimport { buildClassnames } from '../../../../utils';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { ArrowRightIcon, DragIndicatorIcon } from '../../../../icons';\nimport { ItemContentProps } from './types';\nimport { Text as VeeqoText } from '../../../Text';\nimport { MiniAlert } from '../../../Alerts/MiniAlert';\nimport { SelectionType } from './SelectionType';\nimport styles from './ItemContent.module.scss';\nimport { FlexRow } from '../../../Flex/FlexRow';\n\nexport const ItemContent = ({\n label,\n hint,\n itemInfoSlot,\n endInfoSlot,\n alert,\n mediaSlot,\n allowsDragging = false,\n selectionMode = 'single',\n isLink,\n isSelected = false,\n itemType,\n}: ItemContentProps) => {\n const infoContainerClassNames = useMemo(() => {\n const base = styles.infoContainer;\n\n if (itemInfoSlot && endInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoAndEndInfo]);\n }\n\n if (itemInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoOnly]);\n }\n\n if (endInfoSlot) {\n return buildClassnames([base, styles.hasEndInfoOnly]);\n }\n\n return buildClassnames([base]);\n }, [endInfoSlot, itemInfoSlot]);\n\n return (\n <FlexRow\n flexWrap=\"nowrap\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n gap=\"base\"\n style={{ flexGrow: 1 }}\n >\n <FlexRow flexWrap=\"nowrap\" gap=\"base\" style={{ flexGrow: 1 }}>\n {allowsDragging && <DragIndicatorIcon data-testid=\"drag-icon\" />}\n <SelectionType selectionMode={selectionMode} isSelected={isSelected} isLink={isLink} />\n {mediaSlot}\n <FlexCol gap=\"xs\" style={{ flexGrow: 1 }}>\n <div className={infoContainerClassNames} data-testid=\"info-container\">\n {itemType === 'grid' ? (\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n ) : (\n <Text slot=\"label\">\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n </Text>\n )}\n {itemInfoSlot}\n {endInfoSlot && (\n <div className={endInfoSlot ? styles.justifyEnd : styles.justifyStart}>\n {endInfoSlot}\n </div>\n )}\n </div>\n\n {hint && (\n <Text slot=\"description\">\n <VeeqoText variant=\"hintText\">{hint}</VeeqoText>\n </Text>\n )}\n {alert && <MiniAlert title={alert.title} variant={alert.variant} />}\n </FlexCol>\n </FlexRow>\n {isLink && <ArrowRightIcon className={styles.linkIcon} data-testid=\"link-icon\" />}\n </FlexRow>\n );\n};\n"],"names":["React","VeeqoText","Text"],"mappings":";;;;;;;;;;;;;AAYO,MAAM,WAAW,GAAG,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,cAAc,GAAG,KAAK,EACtB,aAAa,GAAG,QAAQ,EACxB,MAAM,EACN,UAAU,GAAG,KAAK,EAClB,QAAQ,GACS,KAAI;AACrB,IAAA,MAAM,uBAAuB,GAAG,OAAO,CAAC,MAAK;AAC3C,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa;QAEjC,IAAI,YAAY,IAAI,WAAW,EAAE;YAC/B,OAAO,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC7D;AAED,QAAA,IAAI,YAAY,EAAE;YAChB,OAAO,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;AACvD;AAED,QAAA,IAAI,WAAW,EAAE;YACf,OAAO,eAAe,CAAC,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AAC,OAAO,EAAC,MAAM,EAAE,EAAA,KAAK,CAAa,CACxC,CACR;oBACA,YAAY;oBACZ,WAAW,KACVD,cAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,YAAY,EAClE,EAAA,WAAW,CACR,CACP,CACG;AAEL,gBAAA,IAAI,KACHA,cAAA,CAAA,aAAA,CAACE,MAAI,EAAC,EAAA,IAAI,EAAC,aAAa,EAAA;oBACtBF,cAAC,CAAA,aAAA,CAAAC,IAAS,IAAC,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CAC3C,CACR;AACA,gBAAA,KAAK,IAAID,cAAC,CAAA,aAAA,CAAA,SAAS,EAAC,EAAA,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAA,CAAI,CAC3D,CACF;AACT,QAAA,MAAM,IAAIA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAc,aAAA,EAAA,WAAW,EAAG,CAAA,CACzE;AAEd;;;;"}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var ___$insertStyle = require('../../../../_virtual/____insertStyle.cjs');
4
+
5
+ ___$insertStyle("._infoContainer_khhvq_1 {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n}\n._infoContainer_khhvq_1._hasItemInfoAndEndInfo_khhvq_9 {\n grid-template-columns: auto 1fr 1fr;\n}\n._infoContainer_khhvq_1._hasItemInfoOnly_khhvq_12, ._infoContainer_khhvq_1._hasEndInfoOnly_khhvq_12 {\n grid-template-columns: auto 1fr;\n}\n._infoContainer_khhvq_1 > *:last-child._justifyEnd_khhvq_15 {\n justify-self: end;\n}\n._infoContainer_khhvq_1 > *:last-child._justifyStart_khhvq_18 {\n justify-self: start;\n}\n\n._linkIcon_khhvq_22 {\n color: var(--colors-neutral-ink-base);\n}");
6
+ var styles = {"infoContainer":"_infoContainer_khhvq_1","hasItemInfoAndEndInfo":"_hasItemInfoAndEndInfo_khhvq_9","hasItemInfoOnly":"_hasItemInfoOnly_khhvq_12","hasEndInfoOnly":"_hasEndInfoOnly_khhvq_12","justifyEnd":"_justifyEnd_khhvq_15","justifyStart":"_justifyStart_khhvq_18","linkIcon":"_linkIcon_khhvq_22"};
7
+
8
+ module.exports = styles;
9
+ //# sourceMappingURL=ItemContent.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemContent.module.scss.cjs","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/ItemContent.module.scss"],"sourcesContent":[".infoContainer {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n\n &.hasItemInfoAndEndInfo {\n grid-template-columns: auto 1fr 1fr;\n }\n\n &.hasItemInfoOnly,\n &.hasEndInfoOnly {\n grid-template-columns: auto 1fr;\n }\n\n > *:last-child {\n &.justifyEnd {\n justify-self: end;\n }\n\n &.justifyStart {\n justify-self: start;\n }\n }\n}\n\n.linkIcon {\n color: var(--colors-neutral-ink-base);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,2nBAAA;AACA,aAAA,CAAA,eAAA,CAAA,wBAAA,CAAA,uBAAA,CAAA,gCAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,0BAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,cAAA,CAAA,wBAAA,CAAA,UAAA,CAAA,oBAAA;;;;"}
@@ -0,0 +1,7 @@
1
+ import insertStyle from '../../../../_virtual/____insertStyle.js';
2
+
3
+ insertStyle("._infoContainer_khhvq_1 {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n}\n._infoContainer_khhvq_1._hasItemInfoAndEndInfo_khhvq_9 {\n grid-template-columns: auto 1fr 1fr;\n}\n._infoContainer_khhvq_1._hasItemInfoOnly_khhvq_12, ._infoContainer_khhvq_1._hasEndInfoOnly_khhvq_12 {\n grid-template-columns: auto 1fr;\n}\n._infoContainer_khhvq_1 > *:last-child._justifyEnd_khhvq_15 {\n justify-self: end;\n}\n._infoContainer_khhvq_1 > *:last-child._justifyStart_khhvq_18 {\n justify-self: start;\n}\n\n._linkIcon_khhvq_22 {\n color: var(--colors-neutral-ink-base);\n}");
4
+ var styles = {"infoContainer":"_infoContainer_khhvq_1","hasItemInfoAndEndInfo":"_hasItemInfoAndEndInfo_khhvq_9","hasItemInfoOnly":"_hasItemInfoOnly_khhvq_12","hasEndInfoOnly":"_hasEndInfoOnly_khhvq_12","justifyEnd":"_justifyEnd_khhvq_15","justifyStart":"_justifyStart_khhvq_18","linkIcon":"_linkIcon_khhvq_22"};
5
+
6
+ export { styles as default };
7
+ //# sourceMappingURL=ItemContent.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemContent.module.scss.js","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/ItemContent.module.scss"],"sourcesContent":[".infoContainer {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n\n &.hasItemInfoAndEndInfo {\n grid-template-columns: auto 1fr 1fr;\n }\n\n &.hasItemInfoOnly,\n &.hasEndInfoOnly {\n grid-template-columns: auto 1fr;\n }\n\n > *:last-child {\n &.justifyEnd {\n justify-self: end;\n }\n\n &.justifyStart {\n justify-self: start;\n }\n }\n}\n\n.linkIcon {\n color: var(--colors-neutral-ink-base);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,2nBAAA;AACA,aAAA,CAAA,eAAA,CAAA,wBAAA,CAAA,uBAAA,CAAA,gCAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,0BAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,cAAA,CAAA,wBAAA,CAAA,UAAA,CAAA,oBAAA;;;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectionType.cjs","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/SelectionType.tsx"],"sourcesContent":["import React from 'react';\nimport { Radio } from '../../../Radio';\nimport { Checkbox } from '../../../Checkbox';\n\ntype SelectionTypeProps = {\n selectionMode: 'single' | 'multiple' | 'none';\n isSelected: boolean;\n isLink?: boolean;\n};\n\nexport const SelectionType = ({ selectionMode, isSelected, isLink }: SelectionTypeProps) => {\n if (isLink || selectionMode === 'none') return null;\n\n if (selectionMode === 'single') return <Radio checked={isSelected} onChange={() => {}} />;\n\n return <Checkbox checked={isSelected} onChange={() => {}} />;\n};\n"],"names":["React","Radio","Checkbox"],"mappings":";;;;;;;;;;AAUO,MAAM,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAsB,KAAI;AACzF,IAAA,IAAI,MAAM,IAAI,aAAa,KAAK,MAAM;AAAE,QAAA,OAAO,IAAI;IAEnD,IAAI,aAAa,KAAK,QAAQ;AAAE,QAAA,OAAOA,sBAAC,CAAA,aAAA,CAAAC,WAAK,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAEzF,IAAA,OAAOD,sBAAC,CAAA,aAAA,CAAAE,iBAAQ,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAC9D;;;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectionType.js","sources":["../../../../../src/components/SelectDropdown/components/ItemContent/SelectionType.tsx"],"sourcesContent":["import React from 'react';\nimport { Radio } from '../../../Radio';\nimport { Checkbox } from '../../../Checkbox';\n\ntype SelectionTypeProps = {\n selectionMode: 'single' | 'multiple' | 'none';\n isSelected: boolean;\n isLink?: boolean;\n};\n\nexport const SelectionType = ({ selectionMode, isSelected, isLink }: SelectionTypeProps) => {\n if (isLink || selectionMode === 'none') return null;\n\n if (selectionMode === 'single') return <Radio checked={isSelected} onChange={() => {}} />;\n\n return <Checkbox checked={isSelected} onChange={() => {}} />;\n};\n"],"names":["React"],"mappings":";;;;AAUO,MAAM,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAsB,KAAI;AACzF,IAAA,IAAI,MAAM,IAAI,aAAa,KAAK,MAAM;AAAE,QAAA,OAAO,IAAI;IAEnD,IAAI,aAAa,KAAK,QAAQ;AAAE,QAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAEzF,IAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAC9D;;;;"}
@@ -0,0 +1 @@
1
+ export { ItemContent } from './ItemContent';
@@ -1,5 +1,5 @@
1
- import { BasicListItemProps } from '../types';
2
- export type ListItemContentProps = BasicListItemProps & {
1
+ import { BaseItemProps } from '../types';
2
+ export type ItemContentProps = BaseItemProps & {
3
3
  /** renders a drag icon */
4
4
  allowsDragging?: boolean;
5
5
  /** renders a checkbox or radio depending on state, default is radio */
@@ -8,4 +8,6 @@ export type ListItemContentProps = BasicListItemProps & {
8
8
  isSelected?: boolean;
9
9
  /** Renders icon to indicate item is a link */
10
10
  isLink?: boolean;
11
+ /** type of item */
12
+ itemType: 'list' | 'grid';
11
13
  };
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var reactAriaComponents = require('react-aria-components');
5
+ require('../../../../hooks/useFocusVisible.cjs');
6
+ var useId = require('../../../../hooks/useId.cjs');
7
+ require('lodash.throttle');
8
+ var ItemContent = require('../ItemContent/ItemContent.cjs');
9
+ var buildClassnames = require('../../../../utils/buildClassnames.cjs');
10
+ require('uid/secure');
11
+ var item_module = require('../item.module.scss.cjs');
12
+
13
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
14
+
15
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
16
+
17
+ const ListItem = ({ id, label, href, appearance = 'primary', className, ...props }) => {
18
+ const idComputed = useId.useId({ id, prefix: 'list-item' });
19
+ return (React__default.default.createElement(reactAriaComponents.ListBoxItem, { id: idComputed, textValue: label, href: href, className: buildClassnames.buildClassnames([item_module.item, item_module[`appearance-${appearance}`], className]), ...props }, ({ selectionMode, allowsDragging, isSelected }) => (React__default.default.createElement(ItemContent.ItemContent, { selectionMode: selectionMode, allowsDragging: allowsDragging, isSelected: isSelected, label: label, isLink: Boolean(href), appearance: appearance, itemType: "list", ...props }))));
20
+ };
21
+
22
+ exports.ListItem = ListItem;
23
+ //# sourceMappingURL=ListItem.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItem.cjs","sources":["../../../../../src/components/SelectDropdown/components/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItem, ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../../hooks';\nimport { ListItemProps } from './types';\nimport { ItemContent } from '../ItemContent';\nimport { buildClassnames } from '../../../../utils';\n\nimport styles from '../item.module.scss';\n\nexport const ListItem = ({\n id,\n label,\n href,\n appearance = 'primary',\n className,\n ...props\n}: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n\n return (\n <ListBoxItem\n id={idComputed}\n textValue={label}\n href={href}\n className={buildClassnames([styles.item, styles[`appearance-${appearance}`], className])}\n {...props}\n >\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n appearance={appearance}\n itemType=\"list\"\n {...props}\n />\n )}\n </ListBoxItem>\n );\n};\n"],"names":["useId","React","ListBoxItem","buildClassnames","styles","ItemContent"],"mappings":";;;;;;;;;;;;;;;;MASa,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,GAAG,KAAK,EACM,KAAI;AAClB,IAAA,MAAM,UAAU,GAAGA,WAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAErD,IAAA,QACEC,sBAAC,CAAA,aAAA,CAAAC,+BAAW,IACV,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAEC,+BAAe,CAAC,CAACC,WAAM,CAAC,IAAI,EAAEA,WAAM,CAAC,CAAc,WAAA,EAAA,UAAU,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,KACpF,KAAK,EAAA,EAGR,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrEH,sBAAC,CAAA,aAAA,CAAAI,uBAAW,IACV,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAC,MAAM,EACX,GAAA,KAAK,GACT,CACH,CACW;AAElB;;;;"}
@@ -0,0 +1,17 @@
1
+ import React__default from 'react';
2
+ import { ListBoxItem } from 'react-aria-components';
3
+ import '../../../../hooks/useFocusVisible.js';
4
+ import { useId } from '../../../../hooks/useId.js';
5
+ import 'lodash.throttle';
6
+ import { ItemContent } from '../ItemContent/ItemContent.js';
7
+ import { buildClassnames } from '../../../../utils/buildClassnames.js';
8
+ import 'uid/secure';
9
+ import styles from '../item.module.scss.js';
10
+
11
+ const ListItem = ({ id, label, href, appearance = 'primary', className, ...props }) => {
12
+ const idComputed = useId({ id, prefix: 'list-item' });
13
+ return (React__default.createElement(ListBoxItem, { id: idComputed, textValue: label, href: href, className: buildClassnames([styles.item, styles[`appearance-${appearance}`], className]), ...props }, ({ selectionMode, allowsDragging, isSelected }) => (React__default.createElement(ItemContent, { selectionMode: selectionMode, allowsDragging: allowsDragging, isSelected: isSelected, label: label, isLink: Boolean(href), appearance: appearance, itemType: "list", ...props }))));
14
+ };
15
+
16
+ export { ListItem };
17
+ //# sourceMappingURL=ListItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItem.js","sources":["../../../../../src/components/SelectDropdown/components/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItem, ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../../hooks';\nimport { ListItemProps } from './types';\nimport { ItemContent } from '../ItemContent';\nimport { buildClassnames } from '../../../../utils';\n\nimport styles from '../item.module.scss';\n\nexport const ListItem = ({\n id,\n label,\n href,\n appearance = 'primary',\n className,\n ...props\n}: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n\n return (\n <ListBoxItem\n id={idComputed}\n textValue={label}\n href={href}\n className={buildClassnames([styles.item, styles[`appearance-${appearance}`], className])}\n {...props}\n >\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n appearance={appearance}\n itemType=\"list\"\n {...props}\n />\n )}\n </ListBoxItem>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;MASa,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,GAAG,KAAK,EACM,KAAI;AAClB,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAErD,IAAA,QACEA,cAAC,CAAA,aAAA,CAAA,WAAW,IACV,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAc,WAAA,EAAA,UAAU,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,KACpF,KAAK,EAAA,EAGR,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrEA,cAAC,CAAA,aAAA,CAAA,WAAW,IACV,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAC,MAAM,EACX,GAAA,KAAK,GACT,CACH,CACW;AAElB;;;;"}
@@ -0,0 +1,3 @@
1
+ import { ListBoxItemProps } from 'react-aria-components';
2
+ import { BaseItemProps } from '../types';
3
+ export type ListItemProps = ListBoxItemProps & BaseItemProps;
@@ -2,13 +2,13 @@
2
2
 
3
3
  var React = require('react');
4
4
  var reactAriaComponents = require('react-aria-components');
5
- var FlexRow = require('../../Flex/FlexRow/FlexRow.cjs');
6
- var FlexCol = require('../../Flex/FlexCol/FlexCol.cjs');
7
- var Text = require('../../Text/Text.cjs');
5
+ var FlexRow = require('../../../Flex/FlexRow/FlexRow.cjs');
6
+ var FlexCol = require('../../../Flex/FlexCol/FlexCol.cjs');
7
+ var Text = require('../../../Text/Text.cjs');
8
8
  var ListItem = require('../ListItem/ListItem.cjs');
9
- var ListItemSection_module = require('./ListItemSection.module.scss.cjs');
10
- var buildClassnames = require('../../../utils/buildClassnames.cjs');
9
+ var buildClassnames = require('../../../../utils/buildClassnames.cjs');
11
10
  require('uid/secure');
11
+ var ListItemSection_module = require('./ListItemSection.module.scss.cjs');
12
12
 
13
13
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
14
14
 
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemSection.cjs","sources":["../../../../../src/components/SelectDropdown/components/ListItemSection/ListItemSection.tsx"],"sourcesContent":["import React, { ReactElement } from 'react';\nimport { Collection, Header, Section, SectionProps } from 'react-aria-components';\nimport { FlexRow } from '../../../Flex/FlexRow';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { Text as VeeqoText } from '../../../Text';\nimport { ListItemProps } from '../ListItem/types';\nimport { ListItem } from '../ListItem/ListItem';\nimport { buildClassnames } from '../../../../utils';\nimport styles from './ListItemSection.module.scss';\n\nexport type ListItemSectionProps = Omit<SectionProps<ListItemProps>, 'items'> & {\n label: string;\n hint?: string;\n itemInfoSlot?: ReactElement;\n items?: ListItemProps[];\n};\n\nexport const ListItemSection = ({\n label,\n hint,\n itemInfoSlot,\n items,\n children,\n className,\n ...props\n}: ListItemSectionProps) => (\n <Section className={buildClassnames([styles.section, className])} {...props}>\n <Header>\n <FlexCol gap=\"xs\">\n <FlexRow>\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n {itemInfoSlot}\n </FlexRow>\n {hint && <VeeqoText variant=\"hintText\">{hint}</VeeqoText>}\n </FlexCol>\n </Header>\n {children}\n {items && (\n <Collection items={items}>{(item: ListItemProps) => <ListItem {...item} />}</Collection>\n )}\n </Section>\n);\n"],"names":["React","Section","buildClassnames","styles","Header","FlexCol","FlexRow","VeeqoText","Collection","ListItem"],"mappings":";;;;;;;;;;;;;;;;AAiBa,MAAA,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACa,MACrBA,qCAACC,2BAAO,EAAA,EAAC,SAAS,EAAEC,+BAAe,CAAC,CAACC,sBAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,KAAM,KAAK,EAAA;AACzE,IAAAH,sBAAA,CAAA,aAAA,CAACI,0BAAM,EAAA,IAAA;AACL,QAAAJ,sBAAA,CAAA,aAAA,CAACK,eAAO,EAAA,EAAC,GAAG,EAAC,IAAI,EAAA;AACf,YAAAL,sBAAA,CAAA,aAAA,CAACM,eAAO,EAAA,IAAA;AACN,gBAAAN,sBAAA,CAAA,aAAA,CAACO,SAAS,EAAC,EAAA,OAAO,EAAC,MAAM,EAAA,EAAE,KAAK,CAAa;AAC5C,gBAAA,YAAY,CACL;YACT,IAAI,IAAIP,sBAAC,CAAA,aAAA,CAAAO,SAAS,EAAC,EAAA,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CACjD,CACH;IACR,QAAQ;IACR,KAAK,KACJP,sBAAC,CAAA,aAAA,CAAAQ,8BAAU,IAAC,KAAK,EAAE,KAAK,EAAA,EAAG,CAAC,IAAmB,KAAKR,sBAAC,CAAA,aAAA,CAAAS,iBAAQ,EAAK,EAAA,GAAA,IAAI,GAAI,CAAc,CACzF,CACO;;;;"}
@@ -1,12 +1,12 @@
1
1
  import React__default from 'react';
2
2
  import { Section, Header, Collection } from 'react-aria-components';
3
- import { FlexRow } from '../../Flex/FlexRow/FlexRow.js';
4
- import { FlexCol } from '../../Flex/FlexCol/FlexCol.js';
5
- import { Text } from '../../Text/Text.js';
3
+ import { FlexRow } from '../../../Flex/FlexRow/FlexRow.js';
4
+ import { FlexCol } from '../../../Flex/FlexCol/FlexCol.js';
5
+ import { Text } from '../../../Text/Text.js';
6
6
  import { ListItem } from '../ListItem/ListItem.js';
7
- import styles from './ListItemSection.module.scss.js';
8
- import { buildClassnames } from '../../../utils/buildClassnames.js';
7
+ import { buildClassnames } from '../../../../utils/buildClassnames.js';
9
8
  import 'uid/secure';
9
+ import styles from './ListItemSection.module.scss.js';
10
10
 
11
11
  const ListItemSection = ({ label, hint, itemInfoSlot, items, children, className, ...props }) => (React__default.createElement(Section, { className: buildClassnames([styles.section, className]), ...props },
12
12
  React__default.createElement(Header, null,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemSection.js","sources":["../../../../../src/components/SelectDropdown/components/ListItemSection/ListItemSection.tsx"],"sourcesContent":["import React, { ReactElement } from 'react';\nimport { Collection, Header, Section, SectionProps } from 'react-aria-components';\nimport { FlexRow } from '../../../Flex/FlexRow';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { Text as VeeqoText } from '../../../Text';\nimport { ListItemProps } from '../ListItem/types';\nimport { ListItem } from '../ListItem/ListItem';\nimport { buildClassnames } from '../../../../utils';\nimport styles from './ListItemSection.module.scss';\n\nexport type ListItemSectionProps = Omit<SectionProps<ListItemProps>, 'items'> & {\n label: string;\n hint?: string;\n itemInfoSlot?: ReactElement;\n items?: ListItemProps[];\n};\n\nexport const ListItemSection = ({\n label,\n hint,\n itemInfoSlot,\n items,\n children,\n className,\n ...props\n}: ListItemSectionProps) => (\n <Section className={buildClassnames([styles.section, className])} {...props}>\n <Header>\n <FlexCol gap=\"xs\">\n <FlexRow>\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n {itemInfoSlot}\n </FlexRow>\n {hint && <VeeqoText variant=\"hintText\">{hint}</VeeqoText>}\n </FlexCol>\n </Header>\n {children}\n {items && (\n <Collection items={items}>{(item: ListItemProps) => <ListItem {...item} />}</Collection>\n )}\n </Section>\n);\n"],"names":["React","VeeqoText"],"mappings":";;;;;;;;;;AAiBa,MAAA,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACa,MACrBA,6BAAC,OAAO,EAAA,EAAC,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,KAAM,KAAK,EAAA;AACzE,IAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA;AACL,QAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EAAC,GAAG,EAAC,IAAI,EAAA;AACf,YAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,IAAA;AACN,gBAAAA,cAAA,CAAA,aAAA,CAACC,IAAS,EAAC,EAAA,OAAO,EAAC,MAAM,EAAA,EAAE,KAAK,CAAa;AAC5C,gBAAA,YAAY,CACL;YACT,IAAI,IAAID,cAAC,CAAA,aAAA,CAAAC,IAAS,EAAC,EAAA,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CACjD,CACH;IACR,QAAQ;IACR,KAAK,KACJD,cAAC,CAAA,aAAA,CAAA,UAAU,IAAC,KAAK,EAAE,KAAK,EAAA,EAAG,CAAC,IAAmB,KAAKA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAK,EAAA,GAAA,IAAI,GAAI,CAAc,CACzF,CACO;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var ___$insertStyle = require('../../../_virtual/____insertStyle.cjs');
3
+ var ___$insertStyle = require('../../../../_virtual/____insertStyle.cjs');
4
4
 
5
5
  ___$insertStyle("._section_wlx0b_1 {\n border-radius: var(--sizes-base);\n}");
6
6
  var styles = {"section":"_section_wlx0b_1"};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemSection.module.scss.cjs","sources":["../../../../../src/components/SelectDropdown/components/ListItemSection/ListItemSection.module.scss"],"sourcesContent":[".section {\n border-radius: var(--sizes-base);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,6DAAA;;;;;"}
@@ -1,4 +1,4 @@
1
- import insertStyle from '../../../_virtual/____insertStyle.js';
1
+ import insertStyle from '../../../../_virtual/____insertStyle.js';
2
2
 
3
3
  insertStyle("._section_wlx0b_1 {\n border-radius: var(--sizes-base);\n}");
4
4
  var styles = {"section":"_section_wlx0b_1"};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItemSection.module.scss.js","sources":["../../../../../src/components/SelectDropdown/components/ListItemSection/ListItemSection.module.scss"],"sourcesContent":[".section {\n border-radius: var(--sizes-base);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,6DAAA;;;;;"}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var ___$insertStyle = require('../../../_virtual/____insertStyle.cjs');
4
+
5
+ ___$insertStyle("._item_19dv4_1 {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n}\n._item_19dv4_1._appearance-secondary_19dv4_7 {\n background-color: var(--colors-neutral-grey-lightest);\n}\n._item_19dv4_1[data-hovered] > div, ._item_19dv4_1[data-hovered] > div:first-of-type[role=gridcell] > :first-child {\n background-color: #f0f7fc;\n}\n._item_19dv4_1[data-pressed] > div, ._item_19dv4_1[data-pressed] > div:first-of-type[role=gridcell] > :first-child {\n background-color: #e3f0fa;\n}\n._item_19dv4_1[data-focused] {\n outline: 0;\n}\n._item_19dv4_1[data-focus-visible] > div, ._item_19dv4_1[data-focus-visible] > div:first-of-type[role=gridcell] > :first-child {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n}\n._item_19dv4_1[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n}\n._item_19dv4_1[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n}\n._item_19dv4_1[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n}\n._item_19dv4_1 > div,\n._item_19dv4_1 > div:first-of-type[role=gridcell] > :first-child {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n}");
6
+ var styles = {"item":"_item_19dv4_1","appearance-secondary":"_appearance-secondary_19dv4_7"};
7
+
8
+ module.exports = styles;
9
+ //# sourceMappingURL=item.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.module.scss.cjs","sources":["../../../../src/components/SelectDropdown/components/item.module.scss"],"sourcesContent":[".item {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n\n &.appearance-secondary {\n background-color: var(--colors-neutral-grey-lightest);\n }\n\n &[data-hovered] > div,\n &[data-hovered] > div:first-of-type[role='gridcell'] > :first-child {\n background-color: #f0f7fc;\n }\n\n &[data-pressed] > div,\n &[data-pressed] > div:first-of-type[role='gridcell'] > :first-child {\n background-color: #e3f0fa;\n }\n\n &[data-focused] {\n outline: 0;\n }\n\n &[data-focus-visible] > div,\n &[data-focus-visible] > div:first-of-type[role='gridcell'] > :first-child {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n }\n\n &[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n }\n\n &[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n }\n\n > div,\n > div:first-of-type[role='gridcell'] > :first-child {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,64CAAA;AACA,aAAA,CAAA,MAAA,CAAA,eAAA,CAAA,sBAAA,CAAA,+BAAA;;;;"}
@@ -0,0 +1,7 @@
1
+ import insertStyle from '../../../_virtual/____insertStyle.js';
2
+
3
+ insertStyle("._item_19dv4_1 {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n}\n._item_19dv4_1._appearance-secondary_19dv4_7 {\n background-color: var(--colors-neutral-grey-lightest);\n}\n._item_19dv4_1[data-hovered] > div, ._item_19dv4_1[data-hovered] > div:first-of-type[role=gridcell] > :first-child {\n background-color: #f0f7fc;\n}\n._item_19dv4_1[data-pressed] > div, ._item_19dv4_1[data-pressed] > div:first-of-type[role=gridcell] > :first-child {\n background-color: #e3f0fa;\n}\n._item_19dv4_1[data-focused] {\n outline: 0;\n}\n._item_19dv4_1[data-focus-visible] > div, ._item_19dv4_1[data-focus-visible] > div:first-of-type[role=gridcell] > :first-child {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n}\n._item_19dv4_1[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n}\n._item_19dv4_1[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n}\n._item_19dv4_1[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n}\n._item_19dv4_1 > div,\n._item_19dv4_1 > div:first-of-type[role=gridcell] > :first-child {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n}");
4
+ var styles = {"item":"_item_19dv4_1","appearance-secondary":"_appearance-secondary_19dv4_7"};
5
+
6
+ export { styles as default };
7
+ //# sourceMappingURL=item.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.module.scss.js","sources":["../../../../src/components/SelectDropdown/components/item.module.scss"],"sourcesContent":[".item {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n\n &.appearance-secondary {\n background-color: var(--colors-neutral-grey-lightest);\n }\n\n &[data-hovered] > div,\n &[data-hovered] > div:first-of-type[role='gridcell'] > :first-child {\n background-color: #f0f7fc;\n }\n\n &[data-pressed] > div,\n &[data-pressed] > div:first-of-type[role='gridcell'] > :first-child {\n background-color: #e3f0fa;\n }\n\n &[data-focused] {\n outline: 0;\n }\n\n &[data-focus-visible] > div,\n &[data-focus-visible] > div:first-of-type[role='gridcell'] > :first-child {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n }\n\n &[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n }\n\n &[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n }\n\n > div,\n > div:first-of-type[role='gridcell'] > :first-child {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,64CAAA;AACA,aAAA,CAAA,MAAA,CAAA,eAAA,CAAA,sBAAA,CAAA,+BAAA;;;;"}
@@ -1,16 +1,15 @@
1
- import { ReactElement } from 'react';
2
- import { ListBoxItemProps } from 'react-aria-components';
3
- export type BasicListItemProps = {
1
+ import { ReactNode } from 'react';
2
+ export type BaseItemProps = {
4
3
  id?: string;
5
4
  /** Label for the item */
6
5
  label: string;
7
6
  /** Renders the media provided, e.g Image or Icon */
8
- mediaSlot?: ReactElement;
7
+ mediaSlot?: ReactNode;
9
8
  /** Hint text for the item */
10
9
  hint?: string;
11
10
  /** Slot for extra info for the item, e.g (Tooltip, mini-tag) */
12
- itemInfoSlot?: ReactElement;
13
- endInfoSlot?: ReactElement;
11
+ itemInfoSlot?: ReactNode;
12
+ endInfoSlot?: ReactNode;
14
13
  /** Renders mini alert, e.g (Low stock) */
15
14
  alert?: {
16
15
  title: string;
@@ -19,4 +18,3 @@ export type BasicListItemProps = {
19
18
  /** Used to differentiate between items */
20
19
  appearance?: 'primary' | 'secondary';
21
20
  };
22
- export type ListItemProps = ListBoxItemProps & BasicListItemProps;
@@ -1,8 +1,8 @@
1
1
  import { Key, ListBoxProps } from 'react-aria-components';
2
2
  import { ReactElement } from 'react';
3
3
  import { ButtonProps } from '../Button/types';
4
- import { ListItemProps } from './ListItem/types';
5
- import { ListItemSectionProps } from './ListItemSection/ListItemSection';
4
+ import { ListItemProps } from './components/ListItem/types';
5
+ import { ListItemSectionProps } from './components/ListItemSection/ListItemSection';
6
6
  type CTAButtonProps = Omit<ButtonProps, 'variant'> & {
7
7
  label: string;
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","sources":["../../../src/components/SelectDropdown/utils.ts"],"sourcesContent":["import { Key } from 'react-aria-components';\nimport { ClassNamesReturnPayload, SelectDropdownItem } from './types';\nimport { ListItemSectionProps } from './ListItemSection/ListItemSection';\nimport { ListItemProps } from './ListItem/types';\n\nexport const getValueFromKey = (items: SelectDropdownItem[], hasSection: boolean, key?: Key) => {\n if (!key) return undefined;\n if (!hasSection) {\n return items.find((item) => item.id === key) || undefined;\n }\n\n const selectedSection = items.find((section) => section.id === key);\n if (selectedSection) return selectedSection;\n\n return items\n .flatMap((section) => ('items' in section && Array.isArray(section.items) ? section.items : []))\n .find((item: ListItemProps) => item.id === key);\n};\n\nexport const getValuesFromKeys = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n keys?: Key[],\n): SelectDropdownItem[] => {\n if (!keys) return [];\n if (!hasSection) {\n return items.filter((item) => keys.includes(item.id as Key));\n }\n\n return (items as ListItemSectionProps[]).flatMap((section) => [\n ...(keys.includes(section.id as Key) ? [section] : []),\n ...(section.items?.filter((item: ListItemProps) => keys.includes(item.id as Key)) || []),\n ]);\n};\n\nexport const getSelectedValues = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n value?: Key | Key[],\n): SelectDropdownItem[] => {\n if (!value) return [];\n if (Array.isArray(value)) {\n return getValuesFromKeys(items, hasSection, value);\n }\n const keyValue = getValueFromKey(items, hasSection, value);\n return keyValue === undefined ? [] : [keyValue];\n};\n\nexport const generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n button: prefix ? `${prefix}-select-dropdown-button` : undefined,\n optionsContainer: prefix ? `${prefix}-select-dropdown-container` : undefined,\n popover: prefix ? `${prefix}-select-dropdown` : undefined,\n});\n"],"names":[],"mappings":";;AAKa,MAAA,eAAe,GAAG,CAAC,KAA2B,EAAE,UAAmB,EAAE,GAAS,KAAI;AAC7F,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,SAAS;IAC1B,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,IAA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AAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,EAAE;AACrB,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;AACnD;IACD,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;AAC1D,IAAA,OAAO,QAAQ,KAAK,SAAS,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AACjD;MAEa,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IAC/E,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAyB,uBAAA,CAAA,GAAG,SAAS;IAC/D,gBAAgB,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAA4B,0BAAA,CAAA,GAAG,SAAS;IAC5E,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAkB,gBAAA,CAAA,GAAG,SAAS;AAC1D,CAAA;;;;;;;"}
1
+ {"version":3,"file":"utils.cjs","sources":["../../../src/components/SelectDropdown/utils.ts"],"sourcesContent":["import { Key } from 'react-aria-components';\nimport { ClassNamesReturnPayload, SelectDropdownItem } from './types';\nimport { ListItemSectionProps } from './components/ListItemSection/ListItemSection';\nimport { ListItemProps } from './components/ListItem/types';\n\nexport const getValueFromKey = (items: SelectDropdownItem[], hasSection: boolean, key?: Key) => {\n if (!key) return undefined;\n if (!hasSection) {\n return items.find((item) => item.id === key) || undefined;\n }\n\n const selectedSection = items.find((section) => section.id === key);\n if (selectedSection) return selectedSection;\n\n return items\n .flatMap((section) => ('items' in section && Array.isArray(section.items) ? section.items : []))\n .find((item: ListItemProps) => item.id === key);\n};\n\nexport const getValuesFromKeys = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n keys?: Key[],\n): SelectDropdownItem[] => {\n if (!keys) return [];\n if (!hasSection) {\n return items.filter((item) => keys.includes(item.id as Key));\n }\n\n return (items as ListItemSectionProps[]).flatMap((section) => [\n ...(keys.includes(section.id as Key) ? [section] : []),\n ...(section.items?.filter((item: ListItemProps) => keys.includes(item.id as Key)) || []),\n ]);\n};\n\nexport const getSelectedValues = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n value?: Key | Key[],\n): SelectDropdownItem[] => {\n if (!value) return [];\n if (Array.isArray(value)) {\n return getValuesFromKeys(items, hasSection, value);\n }\n const keyValue = getValueFromKey(items, hasSection, value);\n return keyValue === undefined ? [] : [keyValue];\n};\n\nexport const generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n button: prefix ? `${prefix}-select-dropdown-button` : undefined,\n optionsContainer: prefix ? `${prefix}-select-dropdown-container` : undefined,\n popover: prefix ? `${prefix}-select-dropdown` : undefined,\n});\n"],"names":[],"mappings":";;AAKa,MAAA,eAAe,GAAG,CAAC,KAA2B,EAAE,UAAmB,EAAE,GAAS,KAAI;AAC7F,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,SAAS;IAC1B,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,SAAS;AAC1D;AAED,IAAA,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,KAAK,GAAG,CAAC;AACnE,IAAA,IAAI,eAAe;AAAE,QAAA,OAAO,eAAe;AAE3C,IAAA,OAAO;AACJ,SAAA,OAAO,CAAC,CAAC,OAAO,MAAM,OAAO,IAAI,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;AAC9F,SAAA,IAAI,CAAC,CAAC,IAAmB,KAAK,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC;AACnD;AAEa,MAAA,iBAAiB,GAAG,CAC/B,KAA2B,EAC3B,UA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,CAAG,EAAA,MAAM,CAA4B,0BAAA,CAAA,GAAG,SAAS;IAC5E,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAkB,gBAAA,CAAA,GAAG,SAAS;AAC1D,CAAA;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/components/SelectDropdown/utils.ts"],"sourcesContent":["import { Key } from 'react-aria-components';\nimport { ClassNamesReturnPayload, SelectDropdownItem } from './types';\nimport { ListItemSectionProps } from './ListItemSection/ListItemSection';\nimport { ListItemProps } from './ListItem/types';\n\nexport const getValueFromKey = (items: SelectDropdownItem[], hasSection: boolean, key?: Key) => {\n if (!key) return undefined;\n if (!hasSection) {\n return items.find((item) => item.id === key) || undefined;\n }\n\n const selectedSection = items.find((section) => section.id === key);\n if (selectedSection) return selectedSection;\n\n return items\n .flatMap((section) => ('items' in section && Array.isArray(section.items) ? section.items : []))\n .find((item: ListItemProps) => item.id === key);\n};\n\nexport const getValuesFromKeys = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n keys?: Key[],\n): SelectDropdownItem[] => {\n if (!keys) return [];\n if (!hasSection) {\n return items.filter((item) => keys.includes(item.id as Key));\n }\n\n return (items as ListItemSectionProps[]).flatMap((section) => [\n ...(keys.includes(section.id as Key) ? [section] : []),\n ...(section.items?.filter((item: ListItemProps) => keys.includes(item.id as Key)) || []),\n ]);\n};\n\nexport const getSelectedValues = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n value?: Key | Key[],\n): SelectDropdownItem[] => {\n if (!value) return [];\n if (Array.isArray(value)) {\n return getValuesFromKeys(items, hasSection, value);\n }\n const keyValue = getValueFromKey(items, hasSection, value);\n return keyValue === undefined ? [] : [keyValue];\n};\n\nexport const generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n button: prefix ? `${prefix}-select-dropdown-button` : undefined,\n optionsContainer: prefix ? `${prefix}-select-dropdown-container` : undefined,\n popover: prefix ? `${prefix}-select-dropdown` : undefined,\n});\n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IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAA,MAAM,CAAC,CAAC,IAAmB,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAS,CAAC,CAAC,KAAI,EAAE,CAAC;SACzF;AAAA,KAAA,CAAC;AACJ;AAEa,MAAA,iBAAiB,GAAG,CAC/B,KAA2B,EAC3B,UAAmB,EACnB,KAAmB,KACK;AACxB,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,EAAE;AACrB,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;AACnD;IACD,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;AAC1D,IAAA,OAAO,QAAQ,KAAK,SAAS,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AACjD;MAEa,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IAC/E,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAyB,uBAAA,CAAA,GAAG,SAAS;IAC/D,gBAAgB,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAA4B,0BAAA,CAAA,GAAG,SAAS;IAC5E,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAkB,gBAAA,CAAA,GAAG,SAAS;AAC1D,CAAA;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../src/components/SelectDropdown/utils.ts"],"sourcesContent":["import { Key } from 'react-aria-components';\nimport { ClassNamesReturnPayload, SelectDropdownItem } from './types';\nimport { ListItemSectionProps } from './components/ListItemSection/ListItemSection';\nimport { ListItemProps } from './components/ListItem/types';\n\nexport const getValueFromKey = (items: SelectDropdownItem[], hasSection: boolean, key?: Key) => {\n if (!key) return undefined;\n if (!hasSection) {\n return items.find((item) => item.id === key) || undefined;\n }\n\n const selectedSection = items.find((section) => section.id === key);\n if (selectedSection) return selectedSection;\n\n return items\n .flatMap((section) => ('items' in section && Array.isArray(section.items) ? section.items : []))\n .find((item: ListItemProps) => item.id === key);\n};\n\nexport const getValuesFromKeys = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n keys?: Key[],\n): SelectDropdownItem[] => {\n if (!keys) return [];\n if (!hasSection) {\n return items.filter((item) => keys.includes(item.id as Key));\n }\n\n return (items as ListItemSectionProps[]).flatMap((section) => [\n ...(keys.includes(section.id as Key) ? [section] : []),\n ...(section.items?.filter((item: ListItemProps) => keys.includes(item.id as Key)) || []),\n ]);\n};\n\nexport const getSelectedValues = (\n items: SelectDropdownItem[],\n hasSection: boolean,\n value?: Key | Key[],\n): SelectDropdownItem[] => {\n if (!value) return [];\n if (Array.isArray(value)) {\n return getValuesFromKeys(items, hasSection, value);\n }\n const keyValue = getValueFromKey(items, hasSection, value);\n return keyValue === undefined ? [] : [keyValue];\n};\n\nexport const generateClassNames = (prefix?: string): ClassNamesReturnPayload => ({\n button: prefix ? `${prefix}-select-dropdown-button` : undefined,\n optionsContainer: prefix ? `${prefix}-select-dropdown-container` : undefined,\n popover: prefix ? `${prefix}-select-dropdown` : undefined,\n});\n"],"names":[],"mappings":"AAKa,MAAA,eAAe,GAAG,CAAC,KAA2B,EAAE,UAAmB,EAAE,GAAS,KAAI;AAC7F,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,SAAS;IAC1B,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,SAAS;AAC1D;AAED,IAAA,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,KAAK,GAAG,CAAC;AACnE,IAAA,IAAI,eAAe;AAAE,QAAA,OAAO,eAAe;AAE3C,IAAA,OAAO;AACJ,SAAA,OAAO,CAAC,CAAC,O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E,UAAU,EAAE,KAAK,CAAC;AAC1D,IAAA,OAAO,QAAQ,KAAK,SAAS,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AACjD;MAEa,kBAAkB,GAAG,CAAC,MAAe,MAA+B;IAC/E,MAAM,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAyB,uBAAA,CAAA,GAAG,SAAS;IAC/D,gBAAgB,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAA4B,0BAAA,CAAA,GAAG,SAAS;IAC5E,OAAO,EAAE,MAAM,GAAG,CAAG,EAAA,MAAM,CAAkB,gBAAA,CAAA,GAAG,SAAS;AAC1D,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/ui",
3
- "version": "12.2.0",
3
+ "version": "12.3.1",
4
4
  "description": "New optimised component library for Veeqo.",
5
5
  "author": "Robert Wealthall",
6
6
  "license": "ISC",
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var reactAriaComponents = require('react-aria-components');
5
- require('../../../hooks/useFocusVisible.cjs');
6
- var useId = require('../../../hooks/useId.cjs');
7
- require('lodash.throttle');
8
- var ListItemContent = require('./components/ListItemContent.cjs');
9
- var ListItem_module = require('./ListItem.module.scss.cjs');
10
- var buildClassnames = require('../../../utils/buildClassnames.cjs');
11
- require('uid/secure');
12
-
13
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
14
-
15
- var React__default = /*#__PURE__*/_interopDefaultCompat(React);
16
-
17
- const ListItem = ({ id, label, href, appearance = 'primary', className, ...props }) => {
18
- const idComputed = useId.useId({ id, prefix: 'list-item' });
19
- return (React__default.default.createElement(reactAriaComponents.ListBoxItem, { id: idComputed, textValue: label, href: href, className: buildClassnames.buildClassnames([ListItem_module.listItem, ListItem_module[`appearance-${appearance}`], className]), ...props }, ({ selectionMode, allowsDragging, isSelected }) => (React__default.default.createElement(ListItemContent.ListItemContent, { selectionMode: selectionMode, allowsDragging: allowsDragging, isSelected: isSelected, label: label, isLink: Boolean(href), appearance: appearance, ...props }))));
20
- };
21
-
22
- exports.ListItem = ListItem;
23
- //# sourceMappingURL=ListItem.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItem.cjs","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItem, ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../hooks';\nimport { ListItemProps } from './types';\nimport { ListItemContent } from './components/ListItemContent';\nimport styles from './ListItem.module.scss';\nimport { buildClassnames } from '../../../utils';\n\nexport const ListItem = ({\n id,\n label,\n href,\n appearance = 'primary',\n className,\n ...props\n}: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n\n return (\n <ListBoxItem\n id={idComputed}\n textValue={label}\n href={href}\n className={buildClassnames([styles.listItem, styles[`appearance-${appearance}`], className])}\n {...props}\n >\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ListItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n appearance={appearance}\n {...props}\n />\n )}\n </ListBoxItem>\n );\n};\n"],"names":["useId","React","ListBoxItem","buildClassnames","styles","ListItemContent"],"mappings":";;;;;;;;;;;;;;;;MAQa,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,GAAG,KAAK,EACM,KAAI;AAClB,IAAA,MAAM,UAAU,GAAGA,WAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAErD,IAAA,QACEC,sBAAC,CAAA,aAAA,CAAAC,+BAAW,IACV,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAEC,+BAAe,CAAC,CAACC,eAAM,CAAC,QAAQ,EAAEA,eAAM,CAAC,CAAA,WAAA,EAAc,UAAU,CAAE,CAAA,CAAC,EAAE,SAAS,CAAC,CAAC,EAAA,GACxF,KAAK,EAGR,EAAA,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrEH,qCAACI,+BAAe,EAAA,EACd,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,UAAU,EAAE,UAAU,EAClB,GAAA,KAAK,GACT,CACH,CACW;AAElB;;;;"}
@@ -1,17 +0,0 @@
1
- import React__default from 'react';
2
- import { ListBoxItem } from 'react-aria-components';
3
- import '../../../hooks/useFocusVisible.js';
4
- import { useId } from '../../../hooks/useId.js';
5
- import 'lodash.throttle';
6
- import { ListItemContent } from './components/ListItemContent.js';
7
- import styles from './ListItem.module.scss.js';
8
- import { buildClassnames } from '../../../utils/buildClassnames.js';
9
- import 'uid/secure';
10
-
11
- const ListItem = ({ id, label, href, appearance = 'primary', className, ...props }) => {
12
- const idComputed = useId({ id, prefix: 'list-item' });
13
- return (React__default.createElement(ListBoxItem, { id: idComputed, textValue: label, href: href, className: buildClassnames([styles.listItem, styles[`appearance-${appearance}`], className]), ...props }, ({ selectionMode, allowsDragging, isSelected }) => (React__default.createElement(ListItemContent, { selectionMode: selectionMode, allowsDragging: allowsDragging, isSelected: isSelected, label: label, isLink: Boolean(href), appearance: appearance, ...props }))));
14
- };
15
-
16
- export { ListItem };
17
- //# sourceMappingURL=ListItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItem.js","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { ListBoxItem, ListBoxItemRenderProps } from 'react-aria-components';\nimport { useId } from '../../../hooks';\nimport { ListItemProps } from './types';\nimport { ListItemContent } from './components/ListItemContent';\nimport styles from './ListItem.module.scss';\nimport { buildClassnames } from '../../../utils';\n\nexport const ListItem = ({\n id,\n label,\n href,\n appearance = 'primary',\n className,\n ...props\n}: ListItemProps) => {\n const idComputed = useId({ id, prefix: 'list-item' });\n\n return (\n <ListBoxItem\n id={idComputed}\n textValue={label}\n href={href}\n className={buildClassnames([styles.listItem, styles[`appearance-${appearance}`], className])}\n {...props}\n >\n {/* use react aria's render props to add more such as isHovered */}\n {({ selectionMode, allowsDragging, isSelected }: ListBoxItemRenderProps) => (\n <ListItemContent\n selectionMode={selectionMode}\n allowsDragging={allowsDragging}\n isSelected={isSelected}\n label={label}\n isLink={Boolean(href)}\n appearance={appearance}\n {...props}\n />\n )}\n </ListBoxItem>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;MAQa,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,SAAS,EACtB,SAAS,EACT,GAAG,KAAK,EACM,KAAI;AAClB,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAErD,IAAA,QACEA,cAAC,CAAA,aAAA,CAAA,WAAW,IACV,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA,WAAA,EAAc,UAAU,CAAE,CAAA,CAAC,EAAE,SAAS,CAAC,CAAC,EAAA,GACxF,KAAK,EAGR,EAAA,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAA0B,MACrEA,6BAAC,eAAe,EAAA,EACd,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EACrB,UAAU,EAAE,UAAU,EAClB,GAAA,KAAK,GACT,CACH,CACW;AAElB;;;;"}
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- var ___$insertStyle = require('../../../_virtual/____insertStyle.cjs');
4
-
5
- ___$insertStyle("._listItem_y5fce_1 {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n}\n._listItem_y5fce_1._appearance-secondary_y5fce_7 {\n background-color: var(--colors-neutral-grey-lightest);\n}\n._listItem_y5fce_1[data-hovered] > div {\n background-color: #f0f7fc;\n}\n._listItem_y5fce_1[data-pressed] > div {\n background-color: #e3f0fa;\n}\n._listItem_y5fce_1[data-focused] {\n outline: 0;\n}\n._listItem_y5fce_1[data-focus-visible] > div {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n}\n._listItem_y5fce_1[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n}\n._listItem_y5fce_1[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n}\n._listItem_y5fce_1[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n}\n._listItem_y5fce_1 > div {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n}\n\n._linkIcon_y5fce_42 {\n color: var(--colors-neutral-ink-base);\n}\n\n._infoContainer_y5fce_46 {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n}\n._infoContainer_y5fce_46._hasItemInfoAndEndInfo_y5fce_54 {\n grid-template-columns: auto 1fr 1fr;\n}\n._infoContainer_y5fce_46._hasItemInfoOnly_y5fce_57, ._infoContainer_y5fce_46._hasEndInfoOnly_y5fce_57 {\n grid-template-columns: auto 1fr;\n}\n._infoContainer_y5fce_46 > *:last-child._justifyEnd_y5fce_60 {\n justify-self: end;\n}\n._infoContainer_y5fce_46 > *:last-child._justifyStart_y5fce_63 {\n justify-self: start;\n}");
6
- var styles = {"listItem":"_listItem_y5fce_1","appearance-secondary":"_appearance-secondary_y5fce_7","linkIcon":"_linkIcon_y5fce_42","infoContainer":"_infoContainer_y5fce_46","hasItemInfoAndEndInfo":"_hasItemInfoAndEndInfo_y5fce_54","hasItemInfoOnly":"_hasItemInfoOnly_y5fce_57","hasEndInfoOnly":"_hasEndInfoOnly_y5fce_57","justifyEnd":"_justifyEnd_y5fce_60","justifyStart":"_justifyStart_y5fce_63"};
7
-
8
- module.exports = styles;
9
- //# sourceMappingURL=ListItem.module.scss.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItem.module.scss.cjs","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.module.scss"],"sourcesContent":[".listItem {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n\n &.appearance-secondary {\n background-color: var(--colors-neutral-grey-lightest);\n }\n\n &[data-hovered] > div {\n background-color: #f0f7fc;\n }\n\n &[data-pressed] > div {\n background-color: #e3f0fa;\n }\n\n &[data-focused] {\n outline: 0;\n }\n\n &[data-focus-visible] > div {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n }\n\n &[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n }\n\n &[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n }\n\n > div {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n }\n}\n\n.linkIcon {\n color: var(--colors-neutral-ink-base);\n}\n\n.infoContainer {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n\n &.hasItemInfoAndEndInfo {\n grid-template-columns: auto 1fr 1fr;\n }\n\n &.hasItemInfoOnly,\n &.hasEndInfoOnly {\n grid-template-columns: auto 1fr;\n }\n\n > *:last-child {\n &.justifyEnd {\n justify-self: end;\n }\n\n &.justifyStart {\n justify-self: start;\n }\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,gwDAAA;AACA,aAAA,CAAA,UAAA,CAAA,mBAAA,CAAA,sBAAA,CAAA,+BAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,uBAAA,CAAA,iCAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,0BAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,cAAA,CAAA,wBAAA;;;;"}
@@ -1,7 +0,0 @@
1
- import insertStyle from '../../../_virtual/____insertStyle.js';
2
-
3
- insertStyle("._listItem_y5fce_1 {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n}\n._listItem_y5fce_1._appearance-secondary_y5fce_7 {\n background-color: var(--colors-neutral-grey-lightest);\n}\n._listItem_y5fce_1[data-hovered] > div {\n background-color: #f0f7fc;\n}\n._listItem_y5fce_1[data-pressed] > div {\n background-color: #e3f0fa;\n}\n._listItem_y5fce_1[data-focused] {\n outline: 0;\n}\n._listItem_y5fce_1[data-focus-visible] > div {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n}\n._listItem_y5fce_1[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n}\n._listItem_y5fce_1[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n}\n._listItem_y5fce_1[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n}\n._listItem_y5fce_1 > div {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n}\n\n._linkIcon_y5fce_42 {\n color: var(--colors-neutral-ink-base);\n}\n\n._infoContainer_y5fce_46 {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n}\n._infoContainer_y5fce_46._hasItemInfoAndEndInfo_y5fce_54 {\n grid-template-columns: auto 1fr 1fr;\n}\n._infoContainer_y5fce_46._hasItemInfoOnly_y5fce_57, ._infoContainer_y5fce_46._hasEndInfoOnly_y5fce_57 {\n grid-template-columns: auto 1fr;\n}\n._infoContainer_y5fce_46 > *:last-child._justifyEnd_y5fce_60 {\n justify-self: end;\n}\n._infoContainer_y5fce_46 > *:last-child._justifyStart_y5fce_63 {\n justify-self: start;\n}");
4
- var styles = {"listItem":"_listItem_y5fce_1","appearance-secondary":"_appearance-secondary_y5fce_7","linkIcon":"_linkIcon_y5fce_42","infoContainer":"_infoContainer_y5fce_46","hasItemInfoAndEndInfo":"_hasItemInfoAndEndInfo_y5fce_54","hasItemInfoOnly":"_hasItemInfoOnly_y5fce_57","hasEndInfoOnly":"_hasEndInfoOnly_y5fce_57","justifyEnd":"_justifyEnd_y5fce_60","justifyStart":"_justifyStart_y5fce_63"};
5
-
6
- export { styles as default };
7
- //# sourceMappingURL=ListItem.module.scss.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItem.module.scss.js","sources":["../../../../src/components/SelectDropdown/ListItem/ListItem.module.scss"],"sourcesContent":[".listItem {\n border-radius: var(--radius-base);\n cursor: pointer;\n background-color: #ffffff;\n text-decoration: none;\n\n &.appearance-secondary {\n background-color: var(--colors-neutral-grey-lightest);\n }\n\n &[data-hovered] > div {\n background-color: #f0f7fc;\n }\n\n &[data-pressed] > div {\n background-color: #e3f0fa;\n }\n\n &[data-focused] {\n outline: 0;\n }\n\n &[data-focus-visible] > div {\n outline: solid var(--sizes-xs) var(--colors-secondary-blue-light);\n z-index: 1;\n position: relative;\n }\n\n &[data-dragging] {\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--color-secondary-blue-base);\n }\n\n &[data-drop-target] {\n background-color: var(--colors-secondary-green-base);\n border-color: var(--colors-secondary-green-base);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n background-color: var(--colors-neutral-grey-light);\n opacity: 0.75;\n }\n\n > div {\n padding: var(--sizes-sm);\n border-radius: var(--radius-base);\n }\n}\n\n.linkIcon {\n color: var(--colors-neutral-ink-base);\n}\n\n.infoContainer {\n display: grid;\n gap: var(--sizes-sm);\n width: 100%;\n align-items: center;\n min-width: 0;\n flex: 1;\n\n &.hasItemInfoAndEndInfo {\n grid-template-columns: auto 1fr 1fr;\n }\n\n &.hasItemInfoOnly,\n &.hasEndInfoOnly {\n grid-template-columns: auto 1fr;\n }\n\n > *:last-child {\n &.justifyEnd {\n justify-self: end;\n }\n\n &.justifyStart {\n justify-self: start;\n }\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,gwDAAA;AACA,aAAA,CAAA,UAAA,CAAA,mBAAA,CAAA,sBAAA,CAAA,+BAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,uBAAA,CAAA,iCAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,0BAAA,CAAA,YAAA,CAAA,sBAAA,CAAA,cAAA,CAAA,wBAAA;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemContent.cjs","sources":["../../../../../src/components/SelectDropdown/ListItem/components/ListItemContent.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Text } from 'react-aria-components';\nimport { buildClassnames } from '../../../../utils';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { ArrowRightIcon, DragIndicatorIcon } from '../../../../icons';\nimport { ListItemContentProps } from './types';\nimport { Text as VeeqoText } from '../../../Text';\nimport { MiniAlert } from '../../../Alerts/MiniAlert';\nimport { SelectionType } from './SelectionType';\nimport styles from '../ListItem.module.scss';\nimport { FlexRow } from '../../../Flex/FlexRow';\n\nexport const ListItemContent = ({\n label,\n hint,\n itemInfoSlot,\n endInfoSlot,\n alert,\n mediaSlot,\n allowsDragging = false,\n selectionMode = 'single',\n isLink,\n isSelected = false,\n}: ListItemContentProps) => {\n const getInfoContainerClassNames = useMemo(() => {\n const base = styles.infoContainer;\n\n if (itemInfoSlot && endInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoAndEndInfo]);\n }\n\n if (itemInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoOnly]);\n }\n\n if (endInfoSlot) {\n return buildClassnames([base, styles.hasEndInfoOnly]);\n }\n\n return buildClassnames([base]);\n }, [endInfoSlot, itemInfoSlot]);\n\n return (\n <FlexRow flexWrap=\"nowrap\" justifyContent=\"space-between\" alignItems=\"center\" gap=\"base\">\n <FlexRow flexWrap=\"nowrap\" gap=\"base\" flexGrow=\"1\">\n {allowsDragging && <DragIndicatorIcon data-testid=\"drag-icon\" />}\n <SelectionType selectionMode={selectionMode} isSelected={isSelected} isLink={isLink} />\n {mediaSlot}\n <FlexCol gap=\"xs\" flexGrow=\"1\">\n <div className={getInfoContainerClassNames} data-testid=\"info-container\">\n <Text slot=\"label\">\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n </Text>\n {itemInfoSlot}\n {endInfoSlot && (\n <div className={endInfoSlot ? styles.justifyEnd : styles.justifyStart}>\n {endInfoSlot}\n </div>\n )}\n </div>\n\n {hint && (\n <Text slot=\"description\">\n <VeeqoText variant=\"hintText\">{hint}</VeeqoText>\n </Text>\n )}\n {alert && <MiniAlert title={alert.title} variant={alert.variant} />}\n </FlexCol>\n </FlexRow>\n {isLink && <ArrowRightIcon className={styles.linkIcon} data-testid=\"link-icon\" />}\n </FlexRow>\n );\n};\n"],"names":["useMemo","styles","buildClassnames","React","FlexRow","DragIndicatorIcon","SelectionType","FlexCol","Text","VeeqoText","MiniAlert","ArrowRightIcon"],"mappings":";;;;;;;;;;;;;;;;;;;AAYO,MAAM,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,cA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C,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAA;AAC5B,gBAAAJ,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,0BAA0B,EAAA,aAAA,EAAc,gBAAgB,EAAA;AACtE,oBAAAA,sBAAA,CAAA,aAAA,CAACK,wBAAI,EAAA,EAAC,IAAI,EAAC,OAAO,EAAA;wBAChBL,sBAAC,CAAA,aAAA,CAAAM,SAAS,IAAC,OAAO,EAAC,MAAM,EAAE,EAAA,KAAK,CAAa,CACxC;oBACN,YAAY;oBACZ,WAAW,KACVN,sBAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,WAAW,GAAGF,eAAM,CAAC,UAAU,GAAGA,eAAM,CAAC,YAAY,EAClE,EAAA,WAAW,CACR,CACP,CACG;AAEL,gBAAA,IAAI,KACHE,sBAAA,CAAA,aAAA,CAACK,wBAAI,EAAC,EAAA,IAAI,EAAC,aAAa,EAAA;oBACtBL,sBAAC,CAAA,aAAA,CAAAM,SAAS,IAAC,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CAC3C,CACR;AACA,gBAAA,KAAK,IAAIN,sBAAC,CAAA,aAAA,CAAAO,mBAAS,EAAC,EAAA,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAA,CAAI,CAC3D,CACF;AACT,QAAA,MAAM,IAAIP,sBAAA,CAAA,aAAA,CAACQ,6BAAc,EAAA,EAAC,SAAS,EAAEV,eAAM,CAAC,QAAQ,EAAc,aAAA,EAAA,WAAW,EAAG,CAAA,CACzE;AAEd;;;;"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { ListItemContentProps } from './types';
3
- export declare const ListItemContent: ({ label, hint, itemInfoSlot, endInfoSlot, alert, mediaSlot, allowsDragging, selectionMode, isLink, isSelected, }: ListItemContentProps) => React.JSX.Element;
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemContent.js","sources":["../../../../../src/components/SelectDropdown/ListItem/components/ListItemContent.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Text } from 'react-aria-components';\nimport { buildClassnames } from '../../../../utils';\nimport { FlexCol } from '../../../Flex/FlexCol';\nimport { ArrowRightIcon, DragIndicatorIcon } from '../../../../icons';\nimport { ListItemContentProps } from './types';\nimport { Text as VeeqoText } from '../../../Text';\nimport { MiniAlert } from '../../../Alerts/MiniAlert';\nimport { SelectionType } from './SelectionType';\nimport styles from '../ListItem.module.scss';\nimport { FlexRow } from '../../../Flex/FlexRow';\n\nexport const ListItemContent = ({\n label,\n hint,\n itemInfoSlot,\n endInfoSlot,\n alert,\n mediaSlot,\n allowsDragging = false,\n selectionMode = 'single',\n isLink,\n isSelected = false,\n}: ListItemContentProps) => {\n const getInfoContainerClassNames = useMemo(() => {\n const base = styles.infoContainer;\n\n if (itemInfoSlot && endInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoAndEndInfo]);\n }\n\n if (itemInfoSlot) {\n return buildClassnames([base, styles.hasItemInfoOnly]);\n }\n\n if (endInfoSlot) {\n return buildClassnames([base, styles.hasEndInfoOnly]);\n }\n\n return buildClassnames([base]);\n }, [endInfoSlot, itemInfoSlot]);\n\n return (\n <FlexRow flexWrap=\"nowrap\" justifyContent=\"space-between\" alignItems=\"center\" gap=\"base\">\n <FlexRow flexWrap=\"nowrap\" gap=\"base\" flexGrow=\"1\">\n {allowsDragging && <DragIndicatorIcon data-testid=\"drag-icon\" />}\n <SelectionType selectionMode={selectionMode} isSelected={isSelected} isLink={isLink} />\n {mediaSlot}\n <FlexCol gap=\"xs\" flexGrow=\"1\">\n <div className={getInfoContainerClassNames} data-testid=\"info-container\">\n <Text slot=\"label\">\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n </Text>\n {itemInfoSlot}\n {endInfoSlot && (\n <div className={endInfoSlot ? styles.justifyEnd : styles.justifyStart}>\n {endInfoSlot}\n </div>\n )}\n </div>\n\n {hint && (\n <Text slot=\"description\">\n <VeeqoText variant=\"hintText\">{hint}</VeeqoText>\n </Text>\n )}\n {alert && <MiniAlert title={alert.title} variant={alert.variant} />}\n </FlexCol>\n </FlexRow>\n {isLink && <ArrowRightIcon className={styles.linkIcon} data-testid=\"link-icon\" />}\n </FlexRow>\n );\n};\n"],"names":["React","VeeqoText"],"mappings":";;;;;;;;;;;;;AAYO,MAAM,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,cAAc,GAAG,KAAK,EACtB,aAAa,GAAG,QAAQ,EACxB,MAAM,EACN,UAAU,GAAG,KAAK,GACG,KAAI;AACzB,IAAA,MAAM,0BAA0B,GAAG,OAAO,CAAC,MAAK;AAC9C,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa;QAEjC,IAAI,YAAY,IAAI,WAAW,EAAE;YAC/B,OAAO,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC7D;AAED,QAAA,IAAI,YAAY,EAAE;YAChB,OAAO,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;AACvD;AAED,QAAA,IAAI,WAAW,EAAE;YACf,OAAO,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;AACtD;AAED,QAAA,OAAO,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC;AAChC,KAAC,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAE/B,IAAA,QACEA,cAAC,CAAA,aAAA,CAAA,OAAO,IAAC,QAAQ,EAAC,QAAQ,EAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,EAAC,GAAG,EAAC,MAAM,EAAA;AACtF,QAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EAAC,QAAQ,EAAC,QAAQ,EAAC,GAAG,EAAC,MAAM,EAAC,QAAQ,E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EAAE,MAAM,CAAC,QAAQ,EAAc,aAAA,EAAA,WAAW,EAAG,CAAA,CACzE;AAEd;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectionType.cjs","sources":["../../../../../src/components/SelectDropdown/ListItem/components/SelectionType.tsx"],"sourcesContent":["import React from 'react';\nimport { Radio } from '../../../Radio';\nimport { Checkbox } from '../../../Checkbox';\n\ntype SelectionTypeProps = {\n selectionMode: 'single' | 'multiple' | 'none';\n isSelected: boolean;\n isLink?: boolean;\n};\n\nexport const SelectionType = ({ selectionMode, isSelected, isLink }: SelectionTypeProps) => {\n if (isLink || selectionMode === 'none') return null;\n\n if (selectionMode === 'single') return <Radio checked={isSelected} onChange={() => {}} />;\n\n return <Checkbox checked={isSelected} onChange={() => {}} />;\n};\n"],"names":["React","Radio","Checkbox"],"mappings":";;;;;;;;;;AAUO,MAAM,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAsB,KAAI;AACzF,IAAA,IAAI,MAAM,IAAI,aAAa,KAAK,MAAM;AAAE,QAAA,OAAO,IAAI;IAEnD,IAAI,aAAa,KAAK,QAAQ;AAAE,QAAA,OAAOA,sBAAC,CAAA,aAAA,CAAAC,WAAK,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAEzF,IAAA,OAAOD,sBAAC,CAAA,aAAA,CAAAE,iBAAQ,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAC9D;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectionType.js","sources":["../../../../../src/components/SelectDropdown/ListItem/components/SelectionType.tsx"],"sourcesContent":["import React from 'react';\nimport { Radio } from '../../../Radio';\nimport { Checkbox } from '../../../Checkbox';\n\ntype SelectionTypeProps = {\n selectionMode: 'single' | 'multiple' | 'none';\n isSelected: boolean;\n isLink?: boolean;\n};\n\nexport const SelectionType = ({ selectionMode, isSelected, isLink }: SelectionTypeProps) => {\n if (isLink || selectionMode === 'none') return null;\n\n if (selectionMode === 'single') return <Radio checked={isSelected} onChange={() => {}} />;\n\n return <Checkbox checked={isSelected} onChange={() => {}} />;\n};\n"],"names":["React"],"mappings":";;;;AAUO,MAAM,aAAa,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAsB,KAAI;AACzF,IAAA,IAAI,MAAM,IAAI,aAAa,KAAK,MAAM;AAAE,QAAA,OAAO,IAAI;IAEnD,IAAI,aAAa,KAAK,QAAQ;AAAE,QAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAEzF,IAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAO,GAAC,GAAI;AAC9D;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemSection.cjs","sources":["../../../../src/components/SelectDropdown/ListItemSection/ListItemSection.tsx"],"sourcesContent":["import React, { ReactElement } from 'react';\nimport { Collection, Header, Section, SectionProps } from 'react-aria-components';\nimport { FlexRow } from '../../Flex/FlexRow';\nimport { FlexCol } from '../../Flex/FlexCol';\nimport { Text as VeeqoText } from '../../Text';\nimport { ListItemProps } from '../ListItem/types';\nimport { ListItem } from '../ListItem/ListItem';\nimport styles from './ListItemSection.module.scss';\nimport { buildClassnames } from '../../../utils';\n\nexport type ListItemSectionProps = Omit<SectionProps<ListItemProps>, 'items'> & {\n label: string;\n hint?: string;\n itemInfoSlot?: ReactElement;\n items?: ListItemProps[];\n};\n\nexport const ListItemSection = ({\n label,\n hint,\n itemInfoSlot,\n items,\n children,\n className,\n ...props\n}: ListItemSectionProps) => (\n <Section className={buildClassnames([styles.section, className])} {...props}>\n <Header>\n <FlexCol gap=\"xs\">\n <FlexRow>\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n {itemInfoSlot}\n </FlexRow>\n {hint && <VeeqoText variant=\"hintText\">{hint}</VeeqoText>}\n </FlexCol>\n </Header>\n {children}\n {items && (\n <Collection items={items}>{(item: ListItemProps) => <ListItem {...item} />}</Collection>\n )}\n </Section>\n);\n"],"names":["React","Section","buildClassnames","styles","Header","FlexCol","FlexRow","VeeqoText","Collection","ListItem"],"mappings":";;;;;;;;;;;;;;;;AAiBa,MAAA,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACa,MACrBA,qCAACC,2BAAO,EAAA,EAAC,SAAS,EAAEC,+BAAe,CAAC,CAACC,sBAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,KAAM,KAAK,EAAA;AACzE,IAAAH,sBAAA,CAAA,aAAA,CAACI,0BAAM,EAAA,IAAA;AACL,QAAAJ,sBAAA,CAAA,aAAA,CAACK,eAAO,EAAA,EAAC,GAAG,EAAC,IAAI,EAAA;AACf,YAAAL,sBAAA,CAAA,aAAA,CAACM,eAAO,EAAA,IAAA;AACN,gBAAAN,sBAAA,CAAA,aAAA,CAACO,SAAS,EAAC,EAAA,OAAO,EAAC,MAAM,EAAA,EAAE,KAAK,CAAa;AAC5C,gBAAA,YAAY,CACL;YACT,IAAI,IAAIP,sBAAC,CAAA,aAAA,CAAAO,SAAS,EAAC,EAAA,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CACjD,CACH;IACR,QAAQ;IACR,KAAK,KACJP,sBAAC,CAAA,aAAA,CAAAQ,8BAAU,IAAC,KAAK,EAAE,KAAK,EAAA,EAAG,CAAC,IAAmB,KAAKR,sBAAC,CAAA,aAAA,CAAAS,iBAAQ,EAAK,EAAA,GAAA,IAAI,GAAI,CAAc,CACzF,CACO;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemSection.js","sources":["../../../../src/components/SelectDropdown/ListItemSection/ListItemSection.tsx"],"sourcesContent":["import React, { ReactElement } from 'react';\nimport { Collection, Header, Section, SectionProps } from 'react-aria-components';\nimport { FlexRow } from '../../Flex/FlexRow';\nimport { FlexCol } from '../../Flex/FlexCol';\nimport { Text as VeeqoText } from '../../Text';\nimport { ListItemProps } from '../ListItem/types';\nimport { ListItem } from '../ListItem/ListItem';\nimport styles from './ListItemSection.module.scss';\nimport { buildClassnames } from '../../../utils';\n\nexport type ListItemSectionProps = Omit<SectionProps<ListItemProps>, 'items'> & {\n label: string;\n hint?: string;\n itemInfoSlot?: ReactElement;\n items?: ListItemProps[];\n};\n\nexport const ListItemSection = ({\n label,\n hint,\n itemInfoSlot,\n items,\n children,\n className,\n ...props\n}: ListItemSectionProps) => (\n <Section className={buildClassnames([styles.section, className])} {...props}>\n <Header>\n <FlexCol gap=\"xs\">\n <FlexRow>\n <VeeqoText variant=\"body\">{label}</VeeqoText>\n {itemInfoSlot}\n </FlexRow>\n {hint && <VeeqoText variant=\"hintText\">{hint}</VeeqoText>}\n </FlexCol>\n </Header>\n {children}\n {items && (\n <Collection items={items}>{(item: ListItemProps) => <ListItem {...item} />}</Collection>\n )}\n </Section>\n);\n"],"names":["React","VeeqoText"],"mappings":";;;;;;;;;;AAiBa,MAAA,eAAe,GAAG,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACa,MACrBA,6BAAC,OAAO,EAAA,EAAC,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,KAAM,KAAK,EAAA;AACzE,IAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA;AACL,QAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EAAC,GAAG,EAAC,IAAI,EAAA;AACf,YAAAA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,IAAA;AACN,gBAAAA,cAAA,CAAA,aAAA,CAACC,IAAS,EAAC,EAAA,OAAO,EAAC,MAAM,EAAA,EAAE,KAAK,CAAa;AAC5C,gBAAA,YAAY,CACL;YACT,IAAI,IAAID,cAAC,CAAA,aAAA,CAAAC,IAAS,EAAC,EAAA,OAAO,EAAC,UAAU,EAAE,EAAA,IAAI,CAAa,CACjD,CACH;IACR,QAAQ;IACR,KAAK,KACJD,cAAC,CAAA,aAAA,CAAA,UAAU,IAAC,KAAK,EAAE,KAAK,EAAA,EAAG,CAAC,IAAmB,KAAKA,cAAC,CAAA,aAAA,CAAA,QAAQ,EAAK,EAAA,GAAA,IAAI,GAAI,CAAc,CACzF,CACO;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemSection.module.scss.cjs","sources":["../../../../src/components/SelectDropdown/ListItemSection/ListItemSection.module.scss"],"sourcesContent":[".section {\n border-radius: var(--sizes-base);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,6DAAA;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemSection.module.scss.js","sources":["../../../../src/components/SelectDropdown/ListItemSection/ListItemSection.module.scss"],"sourcesContent":[".section {\n border-radius: var(--sizes-base);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,6DAAA;;;;;"}