@protonradio/proton-ui 0.11.12 → 0.11.13-beta.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 (162) hide show
  1. package/README.md +148 -148
  2. package/dist/components/ActionMenu/ActionMenu.cjs.js +1 -1
  3. package/dist/components/ActionMenu/ActionMenu.cjs.js.map +1 -1
  4. package/dist/components/ActionMenu/ActionMenu.es.js.map +1 -1
  5. package/dist/components/Badge/Badge.cjs.js.map +1 -1
  6. package/dist/components/Badge/Badge.es.js.map +1 -1
  7. package/dist/components/Banner/Banner.cjs.js +1 -1
  8. package/dist/components/Banner/Banner.cjs.js.map +1 -1
  9. package/dist/components/Banner/Banner.es.js.map +1 -1
  10. package/dist/components/Button/Button.cjs.js +1 -1
  11. package/dist/components/Button/Button.cjs.js.map +1 -1
  12. package/dist/components/Button/Button.es.js.map +1 -1
  13. package/dist/components/ButtonGroup/ButtonGroup.cjs.js +1 -1
  14. package/dist/components/ButtonGroup/ButtonGroup.cjs.js.map +1 -1
  15. package/dist/components/ButtonGroup/ButtonGroup.es.js.map +1 -1
  16. package/dist/components/ButtonWithSelect/ButtonWithSelect.cjs.js.map +1 -1
  17. package/dist/components/ButtonWithSelect/ButtonWithSelect.es.js +13 -13
  18. package/dist/components/ButtonWithSelect/ButtonWithSelect.es.js.map +1 -1
  19. package/dist/components/DataTable/DataTable.cjs.js +1 -1
  20. package/dist/components/DataTable/DataTable.cjs.js.map +1 -1
  21. package/dist/components/DataTable/DataTable.es.js.map +1 -1
  22. package/dist/components/Dialog/Dialog.cjs.js +1 -1
  23. package/dist/components/Dialog/Dialog.cjs.js.map +1 -1
  24. package/dist/components/Dialog/Dialog.es.js.map +1 -1
  25. package/dist/components/Elevation/Elevation.cjs.js.map +1 -1
  26. package/dist/components/Elevation/Elevation.es.js.map +1 -1
  27. package/dist/components/Icon/Icon.cjs.js.map +1 -1
  28. package/dist/components/Icon/Icon.es.js.map +1 -1
  29. package/dist/components/ImageBackground/ImageBackground.cjs.js.map +1 -1
  30. package/dist/components/ImageBackground/ImageBackground.es.js.map +1 -1
  31. package/dist/components/Input/BaseInput/Input.cjs.js +1 -1
  32. package/dist/components/Input/BaseInput/Input.cjs.js.map +1 -1
  33. package/dist/components/Input/BaseInput/Input.es.js.map +1 -1
  34. package/dist/components/Input/CopyInput/CopyInput.cjs.js.map +1 -1
  35. package/dist/components/Input/CopyInput/CopyInput.es.js.map +1 -1
  36. package/dist/components/Input/SearchInput/SearchInput.cjs.js +1 -1
  37. package/dist/components/Input/SearchInput/SearchInput.cjs.js.map +1 -1
  38. package/dist/components/Input/SearchInput/SearchInput.es.js +1 -1
  39. package/dist/components/Input/SearchInput/SearchInput.es.js.map +1 -1
  40. package/dist/components/Menu/MenuTrigger.cjs.js +1 -1
  41. package/dist/components/Menu/MenuTrigger.cjs.js.map +1 -1
  42. package/dist/components/Menu/MenuTrigger.es.js.map +1 -1
  43. package/dist/components/Menu/PopoverMenu.cjs.js.map +1 -1
  44. package/dist/components/Menu/PopoverMenu.es.js.map +1 -1
  45. package/dist/components/Modal/Modal.cjs.js +1 -1
  46. package/dist/components/Modal/Modal.cjs.js.map +1 -1
  47. package/dist/components/Modal/Modal.es.js.map +1 -1
  48. package/dist/components/Popover/Popover.cjs.js.map +1 -1
  49. package/dist/components/Popover/Popover.es.js.map +1 -1
  50. package/dist/components/ScreenOverlay/ScreenOverlay.cjs.js.map +1 -1
  51. package/dist/components/ScreenOverlay/ScreenOverlay.es.js.map +1 -1
  52. package/dist/components/Select/Select.cjs.js.map +1 -1
  53. package/dist/components/Select/Select.es.js.map +1 -1
  54. package/dist/components/Switch/Switch.cjs.js +1 -1
  55. package/dist/components/Switch/Switch.cjs.js.map +1 -1
  56. package/dist/components/Switch/Switch.es.js.map +1 -1
  57. package/dist/components/Table/Collection/CompoundComponents.cjs.js.map +1 -1
  58. package/dist/components/Table/Collection/CompoundComponents.es.js.map +1 -1
  59. package/dist/components/Table/Collection/collectionParser.cjs.js +1 -1
  60. package/dist/components/Table/Collection/collectionParser.cjs.js.map +1 -1
  61. package/dist/components/Table/Collection/collectionParser.es.js.map +1 -1
  62. package/dist/components/Table/Collection/useTableCollection.cjs.js +1 -1
  63. package/dist/components/Table/Collection/useTableCollection.cjs.js.map +1 -1
  64. package/dist/components/Table/Collection/useTableCollection.es.js.map +1 -1
  65. package/dist/components/Table/Table.cjs.js.map +1 -1
  66. package/dist/components/Table/Table.es.js.map +1 -1
  67. package/dist/components/Text/TextEllipsis/TextEllipsis.cjs.js.map +1 -1
  68. package/dist/components/Text/TextEllipsis/TextEllipsis.es.js.map +1 -1
  69. package/dist/components/Text/TextEmphasis/TextEmphasis.cjs.js +1 -1
  70. package/dist/components/Text/TextEmphasis/TextEmphasis.cjs.js.map +1 -1
  71. package/dist/components/Text/TextEmphasis/TextEmphasis.es.js +15 -15
  72. package/dist/components/Text/TextEmphasis/TextEmphasis.es.js.map +1 -1
  73. package/dist/components/ThemeProvider.cjs.js +1 -1
  74. package/dist/components/ThemeProvider.cjs.js.map +1 -1
  75. package/dist/components/ThemeProvider.es.js.map +1 -1
  76. package/dist/components/Tombstone/Tombstone.cjs.js.map +1 -1
  77. package/dist/components/Tombstone/Tombstone.es.js.map +1 -1
  78. package/dist/components/Tooltip/Tooltip.cjs.js +1 -1
  79. package/dist/components/Tooltip/Tooltip.cjs.js.map +1 -1
  80. package/dist/components/Tooltip/Tooltip.es.js +71 -56
  81. package/dist/components/Tooltip/Tooltip.es.js.map +1 -1
  82. package/dist/components/Waveform/Waveform.cjs.js +1 -1
  83. package/dist/components/Waveform/Waveform.cjs.js.map +1 -1
  84. package/dist/components/Waveform/Waveform.es.js.map +1 -1
  85. package/dist/components/Waveform/WaveformBar.cjs.js.map +1 -1
  86. package/dist/components/Waveform/WaveformBar.es.js.map +1 -1
  87. package/dist/constants/breakpoint.cjs.js.map +1 -1
  88. package/dist/constants/breakpoint.es.js.map +1 -1
  89. package/dist/constants/placement.cjs.js.map +1 -1
  90. package/dist/constants/placement.es.js.map +1 -1
  91. package/dist/design/colors.cjs.js.map +1 -1
  92. package/dist/design/colors.es.js.map +1 -1
  93. package/dist/design/darkTheme/colors.cjs.js.map +1 -1
  94. package/dist/design/darkTheme/colors.es.js.map +1 -1
  95. package/dist/design/darkTheme/stylesheet.cjs.js.map +1 -1
  96. package/dist/design/darkTheme/stylesheet.es.js.map +1 -1
  97. package/dist/design/generateStylesheet.cjs.js.map +1 -1
  98. package/dist/design/generateStylesheet.es.js.map +1 -1
  99. package/dist/design/lightTheme/colors.cjs.js.map +1 -1
  100. package/dist/design/lightTheme/colors.es.js.map +1 -1
  101. package/dist/design/lightTheme/stylesheet.cjs.js.map +1 -1
  102. package/dist/design/lightTheme/stylesheet.es.js.map +1 -1
  103. package/dist/design/theme.cjs.js.map +1 -1
  104. package/dist/design/theme.es.js.map +1 -1
  105. package/dist/hooks/useBreakpoint.cjs.js +1 -1
  106. package/dist/hooks/useBreakpoint.cjs.js.map +1 -1
  107. package/dist/hooks/useBreakpoint.es.js.map +1 -1
  108. package/dist/hooks/useIsClosing.cjs.js +1 -1
  109. package/dist/hooks/useIsClosing.cjs.js.map +1 -1
  110. package/dist/hooks/useIsClosing.es.js.map +1 -1
  111. package/dist/hooks/useLockBodyScroll.cjs.js.map +1 -1
  112. package/dist/hooks/useLockBodyScroll.es.js.map +1 -1
  113. package/dist/hooks/usePalette.cjs.js.map +1 -1
  114. package/dist/hooks/usePalette.es.js.map +1 -1
  115. package/dist/icons.svg +10 -10
  116. package/dist/index.cjs.js +1 -1
  117. package/dist/index.d.ts +52 -25
  118. package/dist/index.es.js +6 -6
  119. package/dist/node_modules/@react-aria/focus/dist/FocusScope.cjs.js +1 -1
  120. package/dist/node_modules/@react-aria/form/dist/useFormValidation.cjs.js +1 -1
  121. package/dist/node_modules/@react-aria/i18n/dist/context.cjs.js +1 -1
  122. package/dist/node_modules/@react-aria/i18n/dist/context.es.js +3 -3
  123. package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.cjs.js +1 -1
  124. package/dist/node_modules/@react-aria/interactions/dist/useFocusable.cjs.js +1 -1
  125. package/dist/node_modules/@react-aria/interactions/dist/useFocusable.cjs.js.map +1 -1
  126. package/dist/node_modules/@react-aria/interactions/dist/useFocusable.es.js +20 -30
  127. package/dist/node_modules/@react-aria/interactions/dist/useFocusable.es.js.map +1 -1
  128. package/dist/node_modules/@react-aria/interactions/dist/usePress.cjs.js +2 -2
  129. package/dist/node_modules/@react-aria/overlays/dist/Overlay.cjs.js +1 -1
  130. package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.es.js.map +1 -1
  131. package/dist/node_modules/@react-stately/form/dist/useFormValidationState.cjs.js +1 -1
  132. package/dist/node_modules/@react-stately/radio/dist/useRadioGroupState.cjs.js +1 -1
  133. package/dist/node_modules/@react-stately/utils/dist/useControlledState.cjs.js +1 -1
  134. package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs.js +5 -5
  135. package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js +14 -14
  136. package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.es.js +2 -2
  137. package/dist/style.css +1 -1
  138. package/dist/utils/color2k.cjs.js.map +1 -1
  139. package/dist/utils/color2k.es.js.map +1 -1
  140. package/dist/utils/copy.cjs.js.map +1 -1
  141. package/dist/utils/copy.es.js.map +1 -1
  142. package/dist/utils/image.cjs.js.map +1 -1
  143. package/dist/utils/image.es.js.map +1 -1
  144. package/dist/utils/navigation.cjs.js.map +1 -1
  145. package/dist/utils/navigation.es.js.map +1 -1
  146. package/dist/utils/palette.cjs.js.map +1 -1
  147. package/dist/utils/palette.es.js.map +1 -1
  148. package/dist/utils/string.cjs.js.map +1 -1
  149. package/dist/utils/string.es.js.map +1 -1
  150. package/package.json +140 -140
  151. package/dist/node_modules/react-aria-components/dist/OverlayArrow.cjs.js +0 -2
  152. package/dist/node_modules/react-aria-components/dist/OverlayArrow.cjs.js.map +0 -1
  153. package/dist/node_modules/react-aria-components/dist/OverlayArrow.es.js +0 -37
  154. package/dist/node_modules/react-aria-components/dist/OverlayArrow.es.js.map +0 -1
  155. package/dist/node_modules/react-aria-components/dist/Tooltip.cjs.js +0 -2
  156. package/dist/node_modules/react-aria-components/dist/Tooltip.cjs.js.map +0 -1
  157. package/dist/node_modules/react-aria-components/dist/Tooltip.es.js +0 -98
  158. package/dist/node_modules/react-aria-components/dist/Tooltip.es.js.map +0 -1
  159. package/dist/node_modules/react-aria-components/dist/utils.cjs.js +0 -2
  160. package/dist/node_modules/react-aria-components/dist/utils.cjs.js.map +0 -1
  161. package/dist/node_modules/react-aria-components/dist/utils.es.js +0 -89
  162. package/dist/node_modules/react-aria-components/dist/utils.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"palette.es.js","sources":["../../src/utils/palette.ts"],"sourcesContent":["import {\n adjustHue,\n darken,\n getLuminance,\n getScale,\n hasBadContrast,\n lighten,\n toRgba,\n} from \"color2k\";\nimport { ProtonPalette, RGBArray } from \"../design/types\";\nimport { arrayToRgbString, desaturate, saturate } from \"./color2k\";\nimport { LIGHT_GRAYSCALE } from \"../design/lightTheme/colors\";\nimport { DARK_GRAYSCALE } from \"../design/darkTheme/colors\";\n\n/**\n * Generates a complete color palette based on a primary color input.\n * The palette includes primary and secondary color scales with varying shades.\n *\n * @param primaryColor - The base RGB color array to generate the palette from\n * @returns A Palette object containing:\n * - BRAND colors (primary, light primary, and secondary)\n * - PRIMARY scale (7 shades from super dark to super light)\n * - SECONDARY scale (7 shades from super dark to super light)\n *\n * The function:\n * 1. Creates a 12-color scale from white to the primary color to black\n * 2. Generates a complementary secondary color by shifting the hue 180 degrees\n * 3. Creates another 12-color scale for the secondary color\n * 4. Maps specific positions from these scales to create the final palette structure\n */\nexport const generatePalette = (baseColor: RGBArray): ProtonPalette => {\n const primaryRgba = arrayToRgbString(baseColor);\n\n const primaryScaleFunc = getScale(\"#FFFFFF\", primaryRgba, \"#000000\");\n const primaryScale = Array.from({ length: 12 }, (_, i) => {\n const color = primaryScaleFunc(i / 11);\n return desaturate(color, 0.0085);\n });\n\n const adjustedPrimaryScale = primaryScale.map((color) =>\n saturate(adjustBrightnessForLuminance(color), 0.005)\n );\n\n const secondaryColor = toRgba(saturate(adjustHue(primaryRgba, 180), 1));\n\n const secondaryScaleFunc = getScale(\"#FFFFFF\", secondaryColor, \"#000000\");\n const secondaryScale = Array.from({ length: 12 }, (_, i) => {\n const color = secondaryScaleFunc(i / 11);\n return desaturate(color, 0.1);\n });\n\n const adjustedSecondaryScale = secondaryScale.map((color) =>\n desaturate(adjustBrightnessForLuminance(color), 0.22)\n );\n\n const brandPrimary = darkenForContrast(\n saturate(adjustedPrimaryScale[5], 0.115)\n );\n const brandSecondary = desaturate(adjustedSecondaryScale[4], 0.02);\n\n return {\n BASE_COLOR: arrayToRgbString(baseColor),\n BRAND: {\n PRIMARY: brandPrimary,\n PRIMARY_LIGHT: lightenWithinRange(brandPrimary, 0.25, {\n min: 0.6,\n max: 0.8,\n }),\n PRIMARY_SUPER_LIGHT: lightenWithinRange(brandPrimary, 0.15, {\n min: 0.8,\n max: 0.9,\n }),\n SECONDARY: brandSecondary,\n SECONDARY_LIGHT: lightenWithinRange(brandSecondary, 0.25, {\n min: 0.6,\n max: 0.8,\n }),\n SECONDARY_SUPER_LIGHT: lightenWithinRange(brandSecondary, 0.15, {\n min: 0.8,\n max: 0.9,\n }),\n },\n PRIMARY: {\n //backgrounds\n SUPER_DARK: lightenWithinRange(\n lightenForContrast(primaryScale[9]),\n -0.6,\n {\n min: 0.0,\n max: 0.02,\n }\n ),\n DARK: lightenWithinRange(lightenForContrast(primaryScale[8]), -0.4, {\n min: 0.01,\n max: 0.02,\n }),\n //interactive components\n MEDIUM: lightenWithinRange(adjustedPrimaryScale[7], -0.2, {\n min: 0.0,\n max: 0.11,\n }),\n //borders and seperators\n MEDIUM_LIGHT: lightenWithinRange(\n desaturate(adjustedPrimaryScale[6], 0.1),\n 0.08\n ),\n //solid colors\n LIGHT: lightenWithinRange(saturate(adjustedPrimaryScale[5], 0.1), 0.16),\n //accessible text\n LIGHTEST: lightenWithinRange(\n saturate(adjustedPrimaryScale[3], 0.2),\n 0.12,\n {\n min: 0.5,\n max: 0.9,\n }\n ),\n SUPER_LIGHT: lightenWithinRange(adjustedPrimaryScale[1], 0.02, {\n min: 0.76,\n max: 0.92,\n }),\n WHITE: lightenWithinRange(adjustedPrimaryScale[1], 0.11, {\n min: 0.9,\n max: 0.98,\n }),\n },\n SECONDARY: {\n //backgrounds\n SUPER_DARK: lightenWithinRange(\n lightenForContrast(secondaryScale[9]),\n -0.6,\n {\n min: 0.0,\n max: 0.02,\n }\n ),\n DARK: lightenWithinRange(lightenForContrast(secondaryScale[8]), -0.4, {\n min: 0.01,\n max: 0.02,\n }),\n // interactive components\n MEDIUM: lightenWithinRange(adjustedSecondaryScale[7], -0.2, {\n min: 0.0,\n max: 0.11,\n }),\n //borders and seperators\n MEDIUM_LIGHT: lightenWithinRange(adjustedSecondaryScale[6], 0.1),\n //solid colors\n LIGHT: lightenWithinRange(saturate(adjustedSecondaryScale[5], 0.1), 0.16),\n //accessible text\n LIGHTEST: lightenWithinRange(\n saturate(adjustedSecondaryScale[3], 0.2),\n 0.12,\n {\n min: 0.5,\n max: 0.9,\n }\n ),\n SUPER_LIGHT: lightenWithinRange(adjustedSecondaryScale[1], 0.02, {\n min: 0.76,\n max: 0.92,\n }),\n WHITE: lightenWithinRange(adjustedSecondaryScale[1], 0.11, {\n min: 0.9,\n max: 0.98,\n }),\n },\n //TODO: make theme aware grayscale color scale\n //Can we remove the basecolor after this?\n GRAYSCALE: {\n SUPER_DARK: DARK_GRAYSCALE.SUPER_DARK,\n DARK: DARK_GRAYSCALE.DARK,\n MEDIUM: DARK_GRAYSCALE.MEDIUM,\n MEDIUM_LIGHT: DARK_GRAYSCALE.MEDIUM_LIGHT,\n LIGHT: DARK_GRAYSCALE.LIGHT,\n LIGHTEST: DARK_GRAYSCALE.LIGHTEST,\n SUPER_LIGHT: DARK_GRAYSCALE.SUPER_LIGHT,\n WHITE: DARK_GRAYSCALE.WHITE,\n },\n };\n};\n\nconst lightenWithinRange = (\n color: string,\n amount: number,\n range: { min: number; max: number } = { min: 0.03, max: 0.97 }\n): string => {\n let adjustedColor = color;\n let currentLuminance = getLuminance(adjustedColor);\n\n // Validate range bounds\n if (range.min < 0) range.min = 0;\n if (range.max > 1) range.max = 1;\n if (range.min >= range.max) {\n throw new Error(\"Invalid range: min must be less than max\");\n }\n\n // For lightening (positive amount)\n if (amount > 0) {\n // Calculate how much we can lighten before hitting max\n const remainingLuminance = range.max - currentLuminance;\n if (remainingLuminance <= 0) return toRgba(adjustedColor);\n\n // Scale the amount based on remaining room to lighten\n const scaledAmount = amount * (remainingLuminance / (1 - currentLuminance));\n adjustedColor = lighten(adjustedColor, scaledAmount);\n }\n // For darkening (negative amount)\n else if (amount < 0) {\n // Calculate how much we can darken before hitting min\n const remainingLuminance = currentLuminance - range.min;\n if (remainingLuminance <= 0) return toRgba(adjustedColor);\n\n // Scale the amount based on remaining room to darken\n const scaledAmount = amount * (remainingLuminance / currentLuminance);\n adjustedColor = darken(adjustedColor, Math.abs(scaledAmount));\n }\n\n // Verify final luminance is within bounds\n const finalLuminance = getLuminance(adjustedColor);\n if (finalLuminance > range.max) {\n adjustedColor = adjustBrightnessWithinRange(adjustedColor, range);\n } else if (finalLuminance < range.min) {\n adjustedColor = adjustBrightnessWithinRange(adjustedColor, range);\n }\n\n return toRgba(adjustedColor);\n};\n\nconst adjustBrightnessWithinRange = (\n color: string,\n range: { min: number; max: number }\n): string => {\n let adjustedColor = color;\n let luminance = getLuminance(adjustedColor);\n\n // Darken if too bright\n while (luminance > range.max) {\n adjustedColor = darken(adjustedColor, 0.05);\n luminance = getLuminance(adjustedColor);\n }\n\n // Lighten if too dark\n while (luminance < range.min) {\n adjustedColor = lighten(adjustedColor, 0.05);\n luminance = getLuminance(adjustedColor);\n }\n\n return toRgba(adjustedColor);\n};\n\nconst lightenForContrast = (color: string): string => {\n while (hasBadContrast(color, \"readable\", LIGHT_GRAYSCALE.DARK)) {\n color = lighten(color, 0.01);\n }\n return toRgba(color);\n};\n\nconst darkenForContrast = (color: string): string => {\n while (hasBadContrast(LIGHT_GRAYSCALE.SUPER_LIGHT, \"readable\", color)) {\n color = darken(color, 0.01);\n }\n return toRgba(color);\n};\n\nconst adjustBrightnessForLuminance = (color: string): string => {\n let currentColor = color;\n let currentLuminance = getLuminance(toRgba(currentColor));\n let adjustmentAttempts = 0;\n const MAX_ATTEMPTS = 6;\n\n while (currentLuminance < 0.16 && adjustmentAttempts < MAX_ATTEMPTS) {\n adjustmentAttempts++;\n currentColor = lighten(currentColor, 0.1);\n currentLuminance = getLuminance(toRgba(currentColor));\n }\n\n while (currentLuminance > 0.6 && adjustmentAttempts < MAX_ATTEMPTS) {\n adjustmentAttempts++;\n currentColor = darken(currentColor, 0.1);\n currentLuminance = getLuminance(toRgba(currentColor));\n }\n\n return toRgba(currentColor);\n};\n"],"names":["generatePalette","baseColor","primaryRgba","arrayToRgbString","primaryScaleFunc","getScale","primaryScale","_","i","color","desaturate","adjustedPrimaryScale","saturate","adjustBrightnessForLuminance","secondaryColor","toRgba","adjustHue","secondaryScaleFunc","secondaryScale","adjustedSecondaryScale","brandPrimary","darkenForContrast","brandSecondary","lightenWithinRange","lightenForContrast","DARK_GRAYSCALE","amount","range","adjustedColor","currentLuminance","getLuminance","remainingLuminance","scaledAmount","lighten","darken","finalLuminance","adjustBrightnessWithinRange","luminance","hasBadContrast","LIGHT_GRAYSCALE","currentColor","adjustmentAttempts","MAX_ATTEMPTS"],"mappings":";;;;AA8Ba,MAAAA,IAAkB,CAACC,MAAuC;AAC/D,QAAAC,IAAcC,EAAiBF,CAAS,GAExCG,IAAmBC,EAAS,WAAWH,GAAa,SAAS,GAC7DI,IAAe,MAAM,KAAK,EAAE,QAAQ,GAAG,GAAG,CAACC,GAAGC,MAAM;AAClD,UAAAC,IAAQL,EAAiBI,IAAI,EAAE;AAC9B,WAA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AAmB,OAAOY,IAAqBC;AACpD,IAAAD,KACeD,IAAAN,EAAOM,GAAc,GAAG,GACpBX,IAAAC,EAAaf,EAAOyB,CAAY,CAAC;AAGtD,SAAOzB,EAAOyB,CAAY;AAC5B;"}
1
+ {"version":3,"file":"palette.es.js","sources":["../../src/utils/palette.ts"],"sourcesContent":["import {\r\n adjustHue,\r\n darken,\r\n getLuminance,\r\n getScale,\r\n hasBadContrast,\r\n lighten,\r\n toRgba,\r\n} from \"color2k\";\r\nimport { ProtonPalette, RGBArray } from \"../design/types\";\r\nimport { arrayToRgbString, desaturate, saturate } from \"./color2k\";\r\nimport { LIGHT_GRAYSCALE } from \"../design/lightTheme/colors\";\r\nimport { DARK_GRAYSCALE } from \"../design/darkTheme/colors\";\r\n\r\n/**\r\n * Generates a complete color palette based on a primary color input.\r\n * The palette includes primary and secondary color scales with varying shades.\r\n *\r\n * @param primaryColor - The base RGB color array to generate the palette from\r\n * @returns A Palette object containing:\r\n * - BRAND colors (primary, light primary, and secondary)\r\n * - PRIMARY scale (7 shades from super dark to super light)\r\n * - SECONDARY scale (7 shades from super dark to super light)\r\n *\r\n * The function:\r\n * 1. Creates a 12-color scale from white to the primary color to black\r\n * 2. Generates a complementary secondary color by shifting the hue 180 degrees\r\n * 3. Creates another 12-color scale for the secondary color\r\n * 4. Maps specific positions from these scales to create the final palette structure\r\n */\r\nexport const generatePalette = (baseColor: RGBArray): ProtonPalette => {\r\n const primaryRgba = arrayToRgbString(baseColor);\r\n\r\n const primaryScaleFunc = getScale(\"#FFFFFF\", primaryRgba, \"#000000\");\r\n const primaryScale = Array.from({ length: 12 }, (_, i) => {\r\n const color = primaryScaleFunc(i / 11);\r\n return desaturate(color, 0.0085);\r\n });\r\n\r\n const adjustedPrimaryScale = primaryScale.map((color) =>\r\n saturate(adjustBrightnessForLuminance(color), 0.005)\r\n );\r\n\r\n const secondaryColor = toRgba(saturate(adjustHue(primaryRgba, 180), 1));\r\n\r\n const secondaryScaleFunc = getScale(\"#FFFFFF\", secondaryColor, \"#000000\");\r\n const secondaryScale = Array.from({ length: 12 }, (_, i) => {\r\n const color = secondaryScaleFunc(i / 11);\r\n return desaturate(color, 0.1);\r\n });\r\n\r\n const adjustedSecondaryScale = secondaryScale.map((color) =>\r\n desaturate(adjustBrightnessForLuminance(color), 0.22)\r\n );\r\n\r\n const brandPrimary = darkenForContrast(\r\n saturate(adjustedPrimaryScale[5], 0.115)\r\n );\r\n const brandSecondary = desaturate(adjustedSecondaryScale[4], 0.02);\r\n\r\n return {\r\n BASE_COLOR: arrayToRgbString(baseColor),\r\n BRAND: {\r\n PRIMARY: brandPrimary,\r\n PRIMARY_LIGHT: lightenWithinRange(brandPrimary, 0.25, {\r\n min: 0.6,\r\n max: 0.8,\r\n }),\r\n PRIMARY_SUPER_LIGHT: lightenWithinRange(brandPrimary, 0.15, {\r\n min: 0.8,\r\n max: 0.9,\r\n }),\r\n SECONDARY: brandSecondary,\r\n SECONDARY_LIGHT: lightenWithinRange(brandSecondary, 0.25, {\r\n min: 0.6,\r\n max: 0.8,\r\n }),\r\n SECONDARY_SUPER_LIGHT: lightenWithinRange(brandSecondary, 0.15, {\r\n min: 0.8,\r\n max: 0.9,\r\n }),\r\n },\r\n PRIMARY: {\r\n //backgrounds\r\n SUPER_DARK: lightenWithinRange(\r\n lightenForContrast(primaryScale[9]),\r\n -0.6,\r\n {\r\n min: 0.0,\r\n max: 0.02,\r\n }\r\n ),\r\n DARK: lightenWithinRange(lightenForContrast(primaryScale[8]), -0.4, {\r\n min: 0.01,\r\n max: 0.02,\r\n }),\r\n //interactive components\r\n MEDIUM: lightenWithinRange(adjustedPrimaryScale[7], -0.2, {\r\n min: 0.0,\r\n max: 0.11,\r\n }),\r\n //borders and seperators\r\n MEDIUM_LIGHT: lightenWithinRange(\r\n desaturate(adjustedPrimaryScale[6], 0.1),\r\n 0.08\r\n ),\r\n //solid colors\r\n LIGHT: lightenWithinRange(saturate(adjustedPrimaryScale[5], 0.1), 0.16),\r\n //accessible text\r\n LIGHTEST: lightenWithinRange(\r\n saturate(adjustedPrimaryScale[3], 0.2),\r\n 0.12,\r\n {\r\n min: 0.5,\r\n max: 0.9,\r\n }\r\n ),\r\n SUPER_LIGHT: lightenWithinRange(adjustedPrimaryScale[1], 0.02, {\r\n min: 0.76,\r\n max: 0.92,\r\n }),\r\n WHITE: lightenWithinRange(adjustedPrimaryScale[1], 0.11, {\r\n min: 0.9,\r\n max: 0.98,\r\n }),\r\n },\r\n SECONDARY: {\r\n //backgrounds\r\n SUPER_DARK: lightenWithinRange(\r\n lightenForContrast(secondaryScale[9]),\r\n -0.6,\r\n {\r\n min: 0.0,\r\n max: 0.02,\r\n }\r\n ),\r\n DARK: lightenWithinRange(lightenForContrast(secondaryScale[8]), -0.4, {\r\n min: 0.01,\r\n max: 0.02,\r\n }),\r\n // interactive components\r\n MEDIUM: lightenWithinRange(adjustedSecondaryScale[7], -0.2, {\r\n min: 0.0,\r\n max: 0.11,\r\n }),\r\n //borders and seperators\r\n MEDIUM_LIGHT: lightenWithinRange(adjustedSecondaryScale[6], 0.1),\r\n //solid colors\r\n LIGHT: lightenWithinRange(saturate(adjustedSecondaryScale[5], 0.1), 0.16),\r\n //accessible text\r\n LIGHTEST: lightenWithinRange(\r\n saturate(adjustedSecondaryScale[3], 0.2),\r\n 0.12,\r\n {\r\n min: 0.5,\r\n max: 0.9,\r\n }\r\n ),\r\n SUPER_LIGHT: lightenWithinRange(adjustedSecondaryScale[1], 0.02, {\r\n min: 0.76,\r\n max: 0.92,\r\n }),\r\n WHITE: lightenWithinRange(adjustedSecondaryScale[1], 0.11, {\r\n min: 0.9,\r\n max: 0.98,\r\n }),\r\n },\r\n //TODO: make theme aware grayscale color scale\r\n //Can we remove the basecolor after this?\r\n GRAYSCALE: {\r\n SUPER_DARK: DARK_GRAYSCALE.SUPER_DARK,\r\n DARK: DARK_GRAYSCALE.DARK,\r\n MEDIUM: DARK_GRAYSCALE.MEDIUM,\r\n MEDIUM_LIGHT: DARK_GRAYSCALE.MEDIUM_LIGHT,\r\n LIGHT: DARK_GRAYSCALE.LIGHT,\r\n LIGHTEST: DARK_GRAYSCALE.LIGHTEST,\r\n SUPER_LIGHT: DARK_GRAYSCALE.SUPER_LIGHT,\r\n WHITE: DARK_GRAYSCALE.WHITE,\r\n },\r\n };\r\n};\r\n\r\nconst lightenWithinRange = (\r\n color: string,\r\n amount: number,\r\n range: { min: number; max: number } = { min: 0.03, max: 0.97 }\r\n): string => {\r\n let adjustedColor = color;\r\n let currentLuminance = getLuminance(adjustedColor);\r\n\r\n // Validate range bounds\r\n if (range.min < 0) range.min = 0;\r\n if (range.max > 1) range.max = 1;\r\n if (range.min >= range.max) {\r\n throw new Error(\"Invalid range: min must be less than max\");\r\n }\r\n\r\n // For lightening (positive amount)\r\n if (amount > 0) {\r\n // Calculate how much we can lighten before hitting max\r\n const remainingLuminance = range.max - currentLuminance;\r\n if (remainingLuminance <= 0) return toRgba(adjustedColor);\r\n\r\n // Scale the amount based on remaining room to lighten\r\n const scaledAmount = amount * (remainingLuminance / (1 - currentLuminance));\r\n adjustedColor = lighten(adjustedColor, scaledAmount);\r\n }\r\n // For darkening (negative amount)\r\n else if (amount < 0) {\r\n // Calculate how much we can darken before hitting min\r\n const remainingLuminance = currentLuminance - range.min;\r\n if (remainingLuminance <= 0) return toRgba(adjustedColor);\r\n\r\n // Scale the amount based on remaining room to darken\r\n const scaledAmount = amount * (remainingLuminance / currentLuminance);\r\n adjustedColor = darken(adjustedColor, Math.abs(scaledAmount));\r\n }\r\n\r\n // Verify final luminance is within bounds\r\n const finalLuminance = getLuminance(adjustedColor);\r\n if (finalLuminance > range.max) {\r\n adjustedColor = adjustBrightnessWithinRange(adjustedColor, range);\r\n } else if (finalLuminance < range.min) {\r\n adjustedColor = adjustBrightnessWithinRange(adjustedColor, range);\r\n }\r\n\r\n return toRgba(adjustedColor);\r\n};\r\n\r\nconst adjustBrightnessWithinRange = (\r\n color: string,\r\n range: { min: number; max: number }\r\n): string => {\r\n let adjustedColor = color;\r\n let luminance = getLuminance(adjustedColor);\r\n\r\n // Darken if too bright\r\n while (luminance > range.max) {\r\n adjustedColor = darken(adjustedColor, 0.05);\r\n luminance = getLuminance(adjustedColor);\r\n }\r\n\r\n // Lighten if too dark\r\n while (luminance < range.min) {\r\n adjustedColor = lighten(adjustedColor, 0.05);\r\n luminance = getLuminance(adjustedColor);\r\n }\r\n\r\n return toRgba(adjustedColor);\r\n};\r\n\r\nconst lightenForContrast = (color: string): string => {\r\n while (hasBadContrast(color, \"readable\", LIGHT_GRAYSCALE.DARK)) {\r\n color = lighten(color, 0.01);\r\n }\r\n return toRgba(color);\r\n};\r\n\r\nconst darkenForContrast = (color: string): string => {\r\n while (hasBadContrast(LIGHT_GRAYSCALE.SUPER_LIGHT, \"readable\", color)) {\r\n color = darken(color, 0.01);\r\n }\r\n return toRgba(color);\r\n};\r\n\r\nconst adjustBrightnessForLuminance = (color: string): string => {\r\n let currentColor = color;\r\n let currentLuminance = getLuminance(toRgba(currentColor));\r\n let adjustmentAttempts = 0;\r\n const MAX_ATTEMPTS = 6;\r\n\r\n while (currentLuminance < 0.16 && adjustmentAttempts < MAX_ATTEMPTS) {\r\n adjustmentAttempts++;\r\n currentColor = lighten(currentColor, 0.1);\r\n currentLuminance = getLuminance(toRgba(currentColor));\r\n }\r\n\r\n while (currentLuminance > 0.6 && adjustmentAttempts < MAX_ATTEMPTS) {\r\n adjustmentAttempts++;\r\n currentColor = darken(currentColor, 0.1);\r\n currentLuminance = getLuminance(toRgba(currentColor));\r\n }\r\n\r\n return toRgba(currentColor);\r\n};\r\n"],"names":["generatePalette","baseColor","primaryRgba","arrayToRgbString","primaryScaleFunc","getScale","primaryScale","_","i","color","desaturate","adjustedPrimaryScale","saturate","adjustBrightnessForLuminance","secondaryColor","toRgba","adjustHue","secondaryScaleFunc","secondaryScale","adjustedSecondaryScale","brandPrimary","darkenForContrast","brandSecondary","lightenWithinRange","lightenForContrast","DARK_GRAYSCALE","amount","range","adjustedColor","currentLuminance","getLuminance","remainingLuminance","scaledAmount","lighten","darken","finalLuminance","adjustBrightnessWithinRange","luminance","hasBadContrast","LIGHT_GRAYSCALE","currentColor","adjustmentAttempts","MAX_ATTEMPTS"],"mappings":";;;;AA8Ba,MAAAA,IAAkB,CAACC,MAAuC;AAC/D,QAAAC,IAAcC,EAAiBF,CAAS,GAExCG,IAAmBC,EAAS,WAAWH,GAAa,SAAS,GAC7DI,IAAe,MAAM,KAAK,EAAE,QAAQ,GAAG,GAAG,CAACC,GAAGC,MAAM;AAClD,UAAAC,IAAQL,EAAiBI,IAAI,EAAE;AAC9B,WAAAE,EAAWD,GAAO,KAAM;AAAA,EAAA,CAChC,GAEKE,IAAuBL,EAAa;AAAA,IAAI,CAACG,MAC7CG,EAASC,EAA6BJ,CAAK,GAAG,IAAK;AAAA,EAAA,GAG/CK,IAAiBC,EAAOH,EAASI,EAAUd,GAAa,GAAG,GAAG,CAAC,CAAC,GAEhEe,IAAqBZ,EAAS,WAAWS,GAAgB,SAAS,GAClEI,IAAiB,MAAM,KAAK,EAAE,QAAQ,GAAG,GAAG,CAACX,GAAGC,MAAM;AACpD,UAAAC,IAAQQ,EAAmBT,IAAI,EAAE;AAChC,WAAAE,EAAWD,GAAO,GAAG;AAAA,EAAA,CAC7B,GAEKU,IAAyBD,EAAe;AAAA,IAAI,CAACT,MACjDC,EAAWG,EAA6BJ,CAAK,GAAG,IAAI;AAAA,EAAA,GAGhDW,IAAeC;AAAA,IACnBT,EAASD,EAAqB,CAAC,GAAG,KAAK;AAAA,EAAA,GAEnCW,IAAiBZ,EAAWS,EAAuB,CAAC,GAAG,IAAI;AAE1D,SAAA;AAAA,IACL,YAAYhB,EAAiBF,CAAS;AAAA,IACtC,OAAO;AAAA,MACL,SAASmB;AAAA,MACT,eAAeG,EAAmBH,GAAc,MAAM;AAAA,QACpD,KAAK;AAAA,QACL,KAAK;AAAA,MAAA,CACN;AAAA,MACD,qBAAqBG,EAAmBH,GAAc,MAAM;AA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AAO6B,EAAeC,EAAgB,aAAa,YAAY9B,CAAK;AAC1D,IAAAA,IAAAyB,EAAOzB,GAAO,IAAI;AAE5B,SAAOM,EAAON,CAAK;AACrB,GAEMI,IAA+B,CAACJ,MAA0B;AAC9D,MAAI+B,IAAe/B,GACfoB,IAAmBC,EAAaf,EAAOyB,CAAY,CAAC,GACpDC,IAAqB;AACzB,QAAMC,IAAe;AAEd,SAAAb,IAAmB,QAAQY,IAAqBC;AACrD,IAAAD,KACeD,IAAAP,EAAQO,GAAc,GAAG,GACrBX,IAAAC,EAAaf,EAAOyB,CAAY,CAAC;AAG/C,SAAAX,IAAmB,OAAOY,IAAqBC;AACpD,IAAAD,KACeD,IAAAN,EAAOM,GAAc,GAAG,GACpBX,IAAAC,EAAaf,EAAOyB,CAAY,CAAC;AAGtD,SAAOzB,EAAOyB,CAAY;AAC5B;"}
@@ -1 +1 @@
1
- {"version":3,"file":"string.cjs.js","sources":["../../src/utils/string.ts"],"sourcesContent":["/**\n * Concatenates class names into a single string, filtering out non-string values.\n */\nexport function csx(...classnames: unknown[]): string {\n return classnames.filter(isString).join(\" \");\n}\n\nconst isString = (x: unknown): boolean =>\n typeof x === \"string\" || x instanceof String;\n"],"names":["csx","classnames","isString","x"],"mappings":"gFAGO,SAASA,KAAOC,EAA+B,CACpD,OAAOA,EAAW,OAAOC,CAAQ,EAAE,KAAK,GAAG,CAC7C,CAEA,MAAMA,EAAYC,GAChB,OAAOA,GAAM,UAAYA,aAAa"}
1
+ {"version":3,"file":"string.cjs.js","sources":["../../src/utils/string.ts"],"sourcesContent":["/**\r\n * Concatenates class names into a single string, filtering out non-string values.\r\n */\r\nexport function csx(...classnames: unknown[]): string {\r\n return classnames.filter(isString).join(\" \");\r\n}\r\n\r\nconst isString = (x: unknown): boolean =>\r\n typeof x === \"string\" || x instanceof String;\r\n"],"names":["csx","classnames","isString","x"],"mappings":"gFAGO,SAASA,KAAOC,EAA+B,CACpD,OAAOA,EAAW,OAAOC,CAAQ,EAAE,KAAK,GAAG,CAC7C,CAEA,MAAMA,EAAYC,GAChB,OAAOA,GAAM,UAAYA,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"string.es.js","sources":["../../src/utils/string.ts"],"sourcesContent":["/**\n * Concatenates class names into a single string, filtering out non-string values.\n */\nexport function csx(...classnames: unknown[]): string {\n return classnames.filter(isString).join(\" \");\n}\n\nconst isString = (x: unknown): boolean =>\n typeof x === \"string\" || x instanceof String;\n"],"names":["csx","classnames","isString","x"],"mappings":"AAGO,SAASA,KAAOC,GAA+B;AACpD,SAAOA,EAAW,OAAOC,CAAQ,EAAE,KAAK,GAAG;AAC7C;AAEA,MAAMA,IAAW,CAACC,MAChB,OAAOA,KAAM,YAAYA,aAAa;"}
1
+ {"version":3,"file":"string.es.js","sources":["../../src/utils/string.ts"],"sourcesContent":["/**\r\n * Concatenates class names into a single string, filtering out non-string values.\r\n */\r\nexport function csx(...classnames: unknown[]): string {\r\n return classnames.filter(isString).join(\" \");\r\n}\r\n\r\nconst isString = (x: unknown): boolean =>\r\n typeof x === \"string\" || x instanceof String;\r\n"],"names":["csx","classnames","isString","x"],"mappings":"AAGO,SAASA,KAAOC,GAA+B;AACpD,SAAOA,EAAW,OAAOC,CAAQ,EAAE,KAAK,GAAG;AAC7C;AAEA,MAAMA,IAAW,CAACC,MAChB,OAAOA,KAAM,YAAYA,aAAa;"}
package/package.json CHANGED
@@ -1,140 +1,140 @@
1
- {
2
- "name": "@protonradio/proton-ui",
3
- "version": "0.11.12",
4
- "description": "",
5
- "main": "./dist/proton-ui.umd.js",
6
- "module": "./dist/proton-ui.es.js",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.es.js",
11
- "require": "./dist/index.cjs.js"
12
- },
13
- "./utils": {
14
- "types": "./dist/utils.d.ts",
15
- "import": "./dist/utils.es.js",
16
- "require": "./dist/utils.cjs.js"
17
- },
18
- "./constants": {
19
- "types": "./dist/constants.d.ts",
20
- "import": "./dist/constants.es.js",
21
- "require": "./dist/constants.cjs.js"
22
- },
23
- "./hooks": {
24
- "types": "./dist/hooks.d.ts",
25
- "import": "./dist/hooks.es.js",
26
- "require": "./dist/hooks.cjs.js"
27
- },
28
- "./theme": {
29
- "types": "./dist/theme.d.ts",
30
- "import": "./dist/theme.es.js",
31
- "require": "./dist/theme.cjs.js"
32
- },
33
- "./light": {
34
- "types": "./dist/light.d.ts",
35
- "import": "./dist/light.es.js",
36
- "require": "./dist/light.cjs.js"
37
- },
38
- "./dark": {
39
- "types": "./dist/dark.d.ts",
40
- "import": "./dist/dark.es.js",
41
- "require": "./dist/dark.cjs.js"
42
- }
43
- },
44
- "typesVersions": {
45
- "*": {
46
- "*": [
47
- "./dist/index.d.ts"
48
- ],
49
- "constants": [
50
- "./dist/constants.d.ts"
51
- ],
52
- "utils": [
53
- "./dist/utils.d.ts"
54
- ],
55
- "hooks": [
56
- "./dist/hooks.d.ts"
57
- ],
58
- "theme": [
59
- "./dist/theme.d.ts"
60
- ],
61
- "light": [
62
- "./dist/light.d.ts"
63
- ],
64
- "dark": [
65
- "./dist/dark.d.ts"
66
- ]
67
- }
68
- },
69
- "sideEffects": [
70
- "**/*.css",
71
- "**/ThemeProvider.tsx"
72
- ],
73
- "scripts": {
74
- "dev": "vite",
75
- "build": "vite build",
76
- "build:analyze": "ANALYZE=true vite build",
77
- "preview": "vite preview",
78
- "publish-beta": "npm version prerelease --preid=beta && npm run build && npm publish --tag beta",
79
- "storybook": "storybook dev -p 6006",
80
- "build-storybook": "storybook build",
81
- "test": "jest",
82
- "dev-test": "jest --watch",
83
- "prepare": "vite build",
84
- "chromatic": "npx chromatic --exit-once-uploaded flag --force-rebuild --project-token=$CHROMATIC_PROJECT_TOKEN",
85
- "omlet:analyze": "npx @omlet/cli analyze"
86
- },
87
- "files": [
88
- "dist"
89
- ],
90
- "author": "",
91
- "license": "MIT",
92
- "dependencies": {
93
- "@radix-ui/react-portal": "^1.1.9",
94
- "@storybook/cli": "^8.4.2",
95
- "color2k": "^2.0.3",
96
- "colorthief": "^2.6.0",
97
- "radix-ui": "^1.4.2",
98
- "react": "^18.3.1",
99
- "react-dom": "^18.3.1"
100
- },
101
- "peerDependencies": {
102
- "@radix-ui/react-portal": "^1.1.9",
103
- "@react-aria/utils": "^3.30.0",
104
- "radix-ui": "^1.4.2",
105
- "react-aria": "^3.42.0",
106
- "react-aria-components": "^1.11.0",
107
- "react-stately": "^3.40.0"
108
- },
109
- "devDependencies": {
110
- "@chromatic-com/storybook": "^3.2.2",
111
- "@react-aria/utils": "^3.30.0",
112
- "@storybook/addon-a11y": "^8.4.2",
113
- "@storybook/addon-essentials": "^8.4.2",
114
- "@storybook/addon-interactions": "^8.4.2",
115
- "@storybook/addon-links": "^8.4.2",
116
- "@storybook/addon-onboarding": "^8.4.2",
117
- "@storybook/blocks": "^8.4.2",
118
- "@storybook/react": "^8.4.2",
119
- "@storybook/react-vite": "^8.4.2",
120
- "@storybook/test": "^8.4.2",
121
- "@testing-library/jest-dom": "^6.6.3",
122
- "@testing-library/react": "^16.0.1",
123
- "@testing-library/user-event": "^14.5.2",
124
- "@types/jest": "^29.5.14",
125
- "@vitejs/plugin-react": "^4.3.3",
126
- "jest": "^29.7.0",
127
- "jest-environment-jsdom": "^29.7.0",
128
- "lightningcss": "^1.28.1",
129
- "react-aria": "^3.42.0",
130
- "react-aria-components": "^1.11.0",
131
- "react-docgen-typescript": "^2.2.2",
132
- "react-stately": "^3.40.0",
133
- "storybook": "^8.4.2",
134
- "ts-jest": "^29.2.5",
135
- "ts-node": "^10.9.2",
136
- "vite": "^5.4.10",
137
- "vite-bundle-analyzer": "^0.22.3",
138
- "vite-plugin-dts": "^4.3.0"
139
- }
140
- }
1
+ {
2
+ "name": "@protonradio/proton-ui",
3
+ "version": "0.11.13-beta.1",
4
+ "description": "",
5
+ "main": "./dist/proton-ui.umd.js",
6
+ "module": "./dist/proton-ui.es.js",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.es.js",
11
+ "require": "./dist/index.cjs.js"
12
+ },
13
+ "./utils": {
14
+ "types": "./dist/utils.d.ts",
15
+ "import": "./dist/utils.es.js",
16
+ "require": "./dist/utils.cjs.js"
17
+ },
18
+ "./constants": {
19
+ "types": "./dist/constants.d.ts",
20
+ "import": "./dist/constants.es.js",
21
+ "require": "./dist/constants.cjs.js"
22
+ },
23
+ "./hooks": {
24
+ "types": "./dist/hooks.d.ts",
25
+ "import": "./dist/hooks.es.js",
26
+ "require": "./dist/hooks.cjs.js"
27
+ },
28
+ "./theme": {
29
+ "types": "./dist/theme.d.ts",
30
+ "import": "./dist/theme.es.js",
31
+ "require": "./dist/theme.cjs.js"
32
+ },
33
+ "./light": {
34
+ "types": "./dist/light.d.ts",
35
+ "import": "./dist/light.es.js",
36
+ "require": "./dist/light.cjs.js"
37
+ },
38
+ "./dark": {
39
+ "types": "./dist/dark.d.ts",
40
+ "import": "./dist/dark.es.js",
41
+ "require": "./dist/dark.cjs.js"
42
+ }
43
+ },
44
+ "typesVersions": {
45
+ "*": {
46
+ "*": [
47
+ "./dist/index.d.ts"
48
+ ],
49
+ "constants": [
50
+ "./dist/constants.d.ts"
51
+ ],
52
+ "utils": [
53
+ "./dist/utils.d.ts"
54
+ ],
55
+ "hooks": [
56
+ "./dist/hooks.d.ts"
57
+ ],
58
+ "theme": [
59
+ "./dist/theme.d.ts"
60
+ ],
61
+ "light": [
62
+ "./dist/light.d.ts"
63
+ ],
64
+ "dark": [
65
+ "./dist/dark.d.ts"
66
+ ]
67
+ }
68
+ },
69
+ "sideEffects": [
70
+ "**/*.css",
71
+ "**/ThemeProvider.tsx"
72
+ ],
73
+ "scripts": {
74
+ "dev": "vite",
75
+ "build": "vite build",
76
+ "build:analyze": "ANALYZE=true vite build",
77
+ "preview": "vite preview",
78
+ "publish-beta": "npm version prerelease --preid=beta && npm run build && npm publish --tag beta",
79
+ "storybook": "storybook dev -p 6006",
80
+ "build-storybook": "storybook build",
81
+ "test": "jest",
82
+ "dev-test": "jest --watch",
83
+ "prepare": "vite build",
84
+ "chromatic": "npx chromatic --exit-once-uploaded flag --force-rebuild --project-token=$CHROMATIC_PROJECT_TOKEN",
85
+ "omlet:analyze": "npx @omlet/cli analyze"
86
+ },
87
+ "files": [
88
+ "dist"
89
+ ],
90
+ "author": "",
91
+ "license": "MIT",
92
+ "dependencies": {
93
+ "@radix-ui/react-portal": "^1.1.9",
94
+ "@storybook/cli": "^8.4.2",
95
+ "color2k": "^2.0.3",
96
+ "colorthief": "^2.6.0",
97
+ "radix-ui": "^1.4.2",
98
+ "react": "^18.3.1",
99
+ "react-dom": "^18.3.1"
100
+ },
101
+ "peerDependencies": {
102
+ "@radix-ui/react-portal": "^1.1.9",
103
+ "@react-aria/utils": "^3.30.0",
104
+ "radix-ui": "^1.4.2",
105
+ "react-aria": "^3.42.0",
106
+ "react-aria-components": "^1.11.0",
107
+ "react-stately": "^3.40.0"
108
+ },
109
+ "devDependencies": {
110
+ "@chromatic-com/storybook": "^3.2.2",
111
+ "@react-aria/utils": "^3.30.0",
112
+ "@storybook/addon-a11y": "^8.4.2",
113
+ "@storybook/addon-essentials": "^8.4.2",
114
+ "@storybook/addon-interactions": "^8.4.2",
115
+ "@storybook/addon-links": "^8.4.2",
116
+ "@storybook/addon-onboarding": "^8.4.2",
117
+ "@storybook/blocks": "^8.4.2",
118
+ "@storybook/react": "^8.4.2",
119
+ "@storybook/react-vite": "^8.4.2",
120
+ "@storybook/test": "^8.4.2",
121
+ "@testing-library/jest-dom": "^6.6.3",
122
+ "@testing-library/react": "^16.0.1",
123
+ "@testing-library/user-event": "^14.5.2",
124
+ "@types/jest": "^29.5.14",
125
+ "@vitejs/plugin-react": "^4.3.3",
126
+ "jest": "^29.7.0",
127
+ "jest-environment-jsdom": "^29.7.0",
128
+ "lightningcss": "^1.28.1",
129
+ "react-aria": "^3.42.0",
130
+ "react-aria-components": "^1.11.0",
131
+ "react-docgen-typescript": "^2.2.2",
132
+ "react-stately": "^3.40.0",
133
+ "storybook": "^8.4.2",
134
+ "ts-jest": "^29.2.5",
135
+ "ts-node": "^10.9.2",
136
+ "vite": "^5.4.10",
137
+ "vite-bundle-analyzer": "^0.22.3",
138
+ "vite-plugin-dts": "^4.3.0"
139
+ }
140
+ }
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./utils.cjs.js"),f=require("@react-aria/utils"),a=require("react"),c=a.createContext({placement:"bottom"}),i=a.forwardRef(function(r,l){[r,l]=s.useContextProps(r,l,c);let e=r.placement,o={position:"absolute",transform:e==="top"||e==="bottom"?"translateX(-50%)":"translateY(-50%)"};e!=null&&(o[e]="100%");let t=s.useRenderProps({...r,defaultClassName:"react-aria-OverlayArrow",values:{placement:e}});t.style&&Object.keys(t.style).forEach(n=>t.style[n]===void 0&&delete t.style[n]);let d=f.filterDOMProps(r);return a.createElement("div",{...d,...t,style:{...o,...t.style},ref:l,"data-placement":e})});exports.OverlayArrow=i;exports.OverlayArrowContext=c;
2
- //# sourceMappingURL=OverlayArrow.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OverlayArrow.cjs.js","sources":["../../../../node_modules/react-aria-components/dist/OverlayArrow.mjs"],"sourcesContent":["import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from \"./utils.mjs\";\nimport {filterDOMProps as $8wt2Z$filterDOMProps} from \"@react-aria/utils\";\nimport $8wt2Z$react, {createContext as $8wt2Z$createContext, forwardRef as $8wt2Z$forwardRef} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\nconst $44f671af83e7d9e0$export$2de4954e8ae13b9f = /*#__PURE__*/ (0, $8wt2Z$createContext)({\n placement: 'bottom'\n});\nconst $44f671af83e7d9e0$export$746d02f47f4d381 = /*#__PURE__*/ (0, $8wt2Z$forwardRef)(function OverlayArrow(props, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $44f671af83e7d9e0$export$2de4954e8ae13b9f);\n let placement = props.placement;\n let style = {\n position: 'absolute',\n transform: placement === 'top' || placement === 'bottom' ? 'translateX(-50%)' : 'translateY(-50%)'\n };\n if (placement != null) style[placement] = '100%';\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultClassName: 'react-aria-OverlayArrow',\n values: {\n placement: placement\n }\n });\n // remove undefined values from renderProps.style object so that it can be\n // spread merged with the other style object\n if (renderProps.style) Object.keys(renderProps.style).forEach((key)=>renderProps.style[key] === undefined && delete renderProps.style[key]);\n let DOMProps = (0, $8wt2Z$filterDOMProps)(props);\n return /*#__PURE__*/ (0, $8wt2Z$react).createElement(\"div\", {\n ...DOMProps,\n ...renderProps,\n style: {\n ...style,\n ...renderProps.style\n },\n ref: ref,\n \"data-placement\": placement\n });\n});\n\n\nexport {$44f671af83e7d9e0$export$2de4954e8ae13b9f as OverlayArrowContext, $44f671af83e7d9e0$export$746d02f47f4d381 as OverlayArrow};\n//# sourceMappingURL=OverlayArrow.module.js.map\n"],"names":["$44f671af83e7d9e0$export$2de4954e8ae13b9f","$8wt2Z$createContext","$44f671af83e7d9e0$export$746d02f47f4d381","$8wt2Z$forwardRef","props","ref","$64fa3d84918910a7$export$29f1550f4b0d4415","placement","style","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","key","DOMProps","$8wt2Z$filterDOMProps","$8wt2Z$react"],"mappings":"oKAiBMA,EAA8DC,EAAAA,cAAsB,CACtF,UAAW,QACf,CAAC,EACKC,EAA6DC,EAAiB,WAAE,SAAsBC,EAAOC,EAAK,CACpH,CAACD,EAAOC,CAAG,EAAQC,EAAyC,gBAAEF,EAAOC,EAAKL,CAAyC,EACnH,IAAIO,EAAYH,EAAM,UAClBI,EAAQ,CACR,SAAU,WACV,UAAWD,IAAc,OAASA,IAAc,SAAW,mBAAqB,kBACxF,EACQA,GAAa,OAAMC,EAAMD,CAAS,EAAI,QAC1C,IAAIE,EAAkBC,iBAAyC,CAC3D,GAAGN,EACH,iBAAkB,0BAClB,OAAQ,CACJ,UAAWG,CACd,CACT,CAAK,EAGGE,EAAY,OAAO,OAAO,KAAKA,EAAY,KAAK,EAAE,QAASE,GAAMF,EAAY,MAAME,CAAG,IAAM,QAAa,OAAOF,EAAY,MAAME,CAAG,CAAC,EAC1I,IAAIC,EAAeC,iBAAuBT,CAAK,EAC/C,OAAyBU,EAAc,cAAc,MAAO,CACxD,GAAGF,EACH,GAAGH,EACH,MAAO,CACH,GAAGD,EACH,GAAGC,EAAY,KAClB,EACD,IAAKJ,EACL,iBAAkBE,CAC1B,CAAK,CACL,CAAC","x_google_ignoreList":[0]}
@@ -1,37 +0,0 @@
1
- import { useContextProps as f, useRenderProps as n } from "./utils.es.js";
2
- import { filterDOMProps as d } from "@react-aria/utils";
3
- import c, { forwardRef as m, createContext as $ } from "react";
4
- const i = /* @__PURE__ */ $({
5
- placement: "bottom"
6
- }), b = /* @__PURE__ */ m(function(a, r) {
7
- [a, r] = f(a, r, i);
8
- let e = a.placement, o = {
9
- position: "absolute",
10
- transform: e === "top" || e === "bottom" ? "translateX(-50%)" : "translateY(-50%)"
11
- };
12
- e != null && (o[e] = "100%");
13
- let t = n({
14
- ...a,
15
- defaultClassName: "react-aria-OverlayArrow",
16
- values: {
17
- placement: e
18
- }
19
- });
20
- t.style && Object.keys(t.style).forEach((l) => t.style[l] === void 0 && delete t.style[l]);
21
- let s = d(a);
22
- return /* @__PURE__ */ c.createElement("div", {
23
- ...s,
24
- ...t,
25
- style: {
26
- ...o,
27
- ...t.style
28
- },
29
- ref: r,
30
- "data-placement": e
31
- });
32
- });
33
- export {
34
- b as OverlayArrow,
35
- i as OverlayArrowContext
36
- };
37
- //# sourceMappingURL=OverlayArrow.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OverlayArrow.es.js","sources":["../../../../node_modules/react-aria-components/dist/OverlayArrow.mjs"],"sourcesContent":["import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from \"./utils.mjs\";\nimport {filterDOMProps as $8wt2Z$filterDOMProps} from \"@react-aria/utils\";\nimport $8wt2Z$react, {createContext as $8wt2Z$createContext, forwardRef as $8wt2Z$forwardRef} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\nconst $44f671af83e7d9e0$export$2de4954e8ae13b9f = /*#__PURE__*/ (0, $8wt2Z$createContext)({\n placement: 'bottom'\n});\nconst $44f671af83e7d9e0$export$746d02f47f4d381 = /*#__PURE__*/ (0, $8wt2Z$forwardRef)(function OverlayArrow(props, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $44f671af83e7d9e0$export$2de4954e8ae13b9f);\n let placement = props.placement;\n let style = {\n position: 'absolute',\n transform: placement === 'top' || placement === 'bottom' ? 'translateX(-50%)' : 'translateY(-50%)'\n };\n if (placement != null) style[placement] = '100%';\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultClassName: 'react-aria-OverlayArrow',\n values: {\n placement: placement\n }\n });\n // remove undefined values from renderProps.style object so that it can be\n // spread merged with the other style object\n if (renderProps.style) Object.keys(renderProps.style).forEach((key)=>renderProps.style[key] === undefined && delete renderProps.style[key]);\n let DOMProps = (0, $8wt2Z$filterDOMProps)(props);\n return /*#__PURE__*/ (0, $8wt2Z$react).createElement(\"div\", {\n ...DOMProps,\n ...renderProps,\n style: {\n ...style,\n ...renderProps.style\n },\n ref: ref,\n \"data-placement\": placement\n });\n});\n\n\nexport {$44f671af83e7d9e0$export$2de4954e8ae13b9f as OverlayArrowContext, $44f671af83e7d9e0$export$746d02f47f4d381 as OverlayArrow};\n//# sourceMappingURL=OverlayArrow.module.js.map\n"],"names":["$44f671af83e7d9e0$export$2de4954e8ae13b9f","$8wt2Z$createContext","$44f671af83e7d9e0$export$746d02f47f4d381","$8wt2Z$forwardRef","props","ref","$64fa3d84918910a7$export$29f1550f4b0d4415","placement","style","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","key","DOMProps","$8wt2Z$filterDOMProps","$8wt2Z$react"],"mappings":";;;AAiBK,MAACA,IAA8DC,gBAAAA,EAAsB;AAAA,EACtF,WAAW;AACf,CAAC,GACKC,IAA6DC,gBAAAA,EAAmB,SAAsBC,GAAOC,GAAK;AACpH,GAACD,GAAOC,CAAG,IAAQC,EAA2CF,GAAOC,GAAKL,CAAyC;AACnH,MAAIO,IAAYH,EAAM,WAClBI,IAAQ;AAAA,IACR,UAAU;AAAA,IACV,WAAWD,MAAc,SAASA,MAAc,WAAW,qBAAqB;AAAA,EACxF;AACI,EAAIA,KAAa,SAAMC,EAAMD,CAAS,IAAI;AAC1C,MAAIE,IAAkBC,EAAyC;AAAA,IAC3D,GAAGN;AAAA,IACH,kBAAkB;AAAA,IAClB,QAAQ;AAAA,MACJ,WAAWG;AAAA,IACd;AAAA,EACT,CAAK;AAGD,EAAIE,EAAY,SAAO,OAAO,KAAKA,EAAY,KAAK,EAAE,QAAQ,CAACE,MAAMF,EAAY,MAAME,CAAG,MAAM,UAAa,OAAOF,EAAY,MAAME,CAAG,CAAC;AAC1I,MAAIC,IAAeC,EAAuBT,CAAK;AAC/C,SAAyBU,gBAAAA,EAAc,cAAc,OAAO;AAAA,IACxD,GAAGF;AAAA,IACH,GAAGH;AAAA,IACH,OAAO;AAAA,MACH,GAAGD;AAAA,MACH,GAAGC,EAAY;AAAA,IAClB;AAAA,IACD,KAAKJ;AAAA,IACL,kBAAkBE;AAAA,EAC1B,CAAK;AACL,CAAC;","x_google_ignoreList":[0]}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./utils.cjs.js"),T=require("./OverlayArrow.cjs.js"),a=require("react-aria"),c=require("@react-aria/utils"),$=require("../../@react-aria/interactions/dist/useFocusable.cjs.js"),m=require("react-stately"),r=require("react"),f=r.createContext(null),P=r.createContext(null);function v(e){let i=m.useTooltipTriggerState(e),t=r.useRef(null),{triggerProps:o,tooltipProps:l}=a.useTooltipTrigger(e,i,t);return r.createElement(g.Provider,{values:[[f,i],[P,{...l,triggerRef:t}]]},r.createElement($.FocusableProvider,{...o,ref:t},e.children))}const y=r.forwardRef(function({UNSTABLE_portalContainer:i,...t},o){[t,o]=g.useContextProps(t,o,P);let l=r.useContext(f),s=m.useTooltipTriggerState(t),u=t.isOpen!=null||t.defaultOpen!=null||!l?s:l,n=c.useExitAnimation(o,u.isOpen)||t.isExiting||!1;return!u.isOpen&&!n?null:r.createElement(a.OverlayContainer,{portalContainer:i},r.createElement(R,{...t,tooltipRef:o,isExiting:n}))});function R(e){let i=r.useContext(f),t=r.useRef(null),[o,l]=r.useState(0);c.useLayoutEffect(()=>{t.current&&i.isOpen&&l(t.current.getBoundingClientRect().width)},[i.isOpen,t]);let{overlayProps:s,arrowProps:u,placement:n}=a.useOverlayPosition({placement:e.placement||"top",targetRef:e.triggerRef,overlayRef:e.tooltipRef,offset:e.offset,crossOffset:e.crossOffset,isOpen:i.isOpen,arrowSize:o,arrowBoundaryOffset:e.arrowBoundaryOffset,shouldFlip:e.shouldFlip,onClose:()=>i.close(!0)}),x=c.useEnterAnimation(e.tooltipRef,!!n)||e.isEntering||!1,d=g.useRenderProps({...e,defaultClassName:"react-aria-Tooltip",values:{placement:n,isEntering:x,isExiting:e.isExiting,state:i}});e=a.mergeProps(e,s);let{tooltipProps:E}=a.useTooltip(e,i),O=c.filterDOMProps(e,{global:!0});return r.createElement("div",{...a.mergeProps(O,d,E),ref:e.tooltipRef,style:{...s.style,...d.style},"data-placement":n??void 0,"data-entering":x||void 0,"data-exiting":e.isExiting||void 0},r.createElement(T.OverlayArrowContext.Provider,{value:{...u,placement:n,ref:t}},d.children))}exports.Tooltip=y;exports.TooltipContext=P;exports.TooltipTrigger=v;exports.TooltipTriggerStateContext=f;
2
- //# sourceMappingURL=Tooltip.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tooltip.cjs.js","sources":["../../../../node_modules/react-aria-components/dist/Tooltip.mjs"],"sourcesContent":["import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from \"./utils.mjs\";\nimport {OverlayArrowContext as $44f671af83e7d9e0$export$2de4954e8ae13b9f} from \"./OverlayArrow.mjs\";\nimport {useTooltipTrigger as $cCslV$useTooltipTrigger, OverlayContainer as $cCslV$OverlayContainer, useOverlayPosition as $cCslV$useOverlayPosition, mergeProps as $cCslV$mergeProps, useTooltip as $cCslV$useTooltip} from \"react-aria\";\nimport {useExitAnimation as $cCslV$useExitAnimation, useLayoutEffect as $cCslV$useLayoutEffect, useEnterAnimation as $cCslV$useEnterAnimation, filterDOMProps as $cCslV$filterDOMProps} from \"@react-aria/utils\";\nimport {FocusableProvider as $cCslV$FocusableProvider} from \"@react-aria/focus\";\nimport {useTooltipTriggerState as $cCslV$useTooltipTriggerState} from \"react-stately\";\nimport $cCslV$react, {createContext as $cCslV$createContext, useRef as $cCslV$useRef, forwardRef as $cCslV$forwardRef, useContext as $cCslV$useContext, useState as $cCslV$useState} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\n\nconst $4e3b923658d69c60$export$7a7623236eec67fa = /*#__PURE__*/ (0, $cCslV$createContext)(null);\nconst $4e3b923658d69c60$export$39ae08fa83328b12 = /*#__PURE__*/ (0, $cCslV$createContext)(null);\nfunction $4e3b923658d69c60$export$8c610744efcf8a1d(props) {\n let state = (0, $cCslV$useTooltipTriggerState)(props);\n let ref = (0, $cCslV$useRef)(null);\n let { triggerProps: triggerProps, tooltipProps: tooltipProps } = (0, $cCslV$useTooltipTrigger)(props, state, ref);\n return /*#__PURE__*/ (0, $cCslV$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {\n values: [\n [\n $4e3b923658d69c60$export$7a7623236eec67fa,\n state\n ],\n [\n $4e3b923658d69c60$export$39ae08fa83328b12,\n {\n ...tooltipProps,\n triggerRef: ref\n }\n ]\n ]\n }, /*#__PURE__*/ (0, $cCslV$react).createElement((0, $cCslV$FocusableProvider), {\n ...triggerProps,\n ref: ref\n }, props.children));\n}\nconst $4e3b923658d69c60$export$28c660c63b792dea = /*#__PURE__*/ (0, $cCslV$forwardRef)(function Tooltip({ UNSTABLE_portalContainer: UNSTABLE_portalContainer, ...props }, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $4e3b923658d69c60$export$39ae08fa83328b12);\n let contextState = (0, $cCslV$useContext)($4e3b923658d69c60$export$7a7623236eec67fa);\n let localState = (0, $cCslV$useTooltipTriggerState)(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = (0, $cCslV$useExitAnimation)(ref, state.isOpen) || props.isExiting || false;\n if (!state.isOpen && !isExiting) return null;\n return /*#__PURE__*/ (0, $cCslV$react).createElement((0, $cCslV$OverlayContainer), {\n portalContainer: UNSTABLE_portalContainer\n }, /*#__PURE__*/ (0, $cCslV$react).createElement($4e3b923658d69c60$var$TooltipInner, {\n ...props,\n tooltipRef: ref,\n isExiting: isExiting\n }));\n});\nfunction $4e3b923658d69c60$var$TooltipInner(props) {\n let state = (0, $cCslV$useContext)($4e3b923658d69c60$export$7a7623236eec67fa);\n // Calculate the arrow size internally\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = (0, $cCslV$useRef)(null);\n let [arrowWidth, setArrowWidth] = (0, $cCslV$useState)(0);\n (0, $cCslV$useLayoutEffect)(()=>{\n if (arrowRef.current && state.isOpen) setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }, [\n state.isOpen,\n arrowRef\n ]);\n let { overlayProps: overlayProps, arrowProps: arrowProps, placement: placement } = (0, $cCslV$useOverlayPosition)({\n placement: props.placement || 'top',\n targetRef: props.triggerRef,\n overlayRef: props.tooltipRef,\n offset: props.offset,\n crossOffset: props.crossOffset,\n isOpen: state.isOpen,\n arrowSize: arrowWidth,\n arrowBoundaryOffset: props.arrowBoundaryOffset,\n shouldFlip: props.shouldFlip,\n onClose: ()=>state.close(true)\n });\n let isEntering = (0, $cCslV$useEnterAnimation)(props.tooltipRef, !!placement) || props.isEntering || false;\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultClassName: 'react-aria-Tooltip',\n values: {\n placement: placement,\n isEntering: isEntering,\n isExiting: props.isExiting,\n state: state\n }\n });\n props = (0, $cCslV$mergeProps)(props, overlayProps);\n let { tooltipProps: tooltipProps } = (0, $cCslV$useTooltip)(props, state);\n let DOMProps = (0, $cCslV$filterDOMProps)(props, {\n global: true\n });\n return /*#__PURE__*/ (0, $cCslV$react).createElement(\"div\", {\n ...(0, $cCslV$mergeProps)(DOMProps, renderProps, tooltipProps),\n ref: props.tooltipRef,\n style: {\n ...overlayProps.style,\n ...renderProps.style\n },\n \"data-placement\": placement !== null && placement !== void 0 ? placement : undefined,\n \"data-entering\": isEntering || undefined,\n \"data-exiting\": props.isExiting || undefined\n }, /*#__PURE__*/ (0, $cCslV$react).createElement((0, $44f671af83e7d9e0$export$2de4954e8ae13b9f).Provider, {\n value: {\n ...arrowProps,\n placement: placement,\n ref: arrowRef\n }\n }, renderProps.children));\n}\n\n\nexport {$4e3b923658d69c60$export$7a7623236eec67fa as TooltipTriggerStateContext, $4e3b923658d69c60$export$39ae08fa83328b12 as TooltipContext, $4e3b923658d69c60$export$8c610744efcf8a1d as TooltipTrigger, $4e3b923658d69c60$export$28c660c63b792dea as Tooltip};\n//# sourceMappingURL=Tooltip.module.js.map\n"],"names":["$4e3b923658d69c60$export$7a7623236eec67fa","$cCslV$createContext","$4e3b923658d69c60$export$39ae08fa83328b12","$4e3b923658d69c60$export$8c610744efcf8a1d","props","state","$cCslV$useTooltipTriggerState","ref","$cCslV$useRef","triggerProps","tooltipProps","$cCslV$useTooltipTrigger","$cCslV$react","$64fa3d84918910a7$export$2881499e37b75b9a","$cCslV$FocusableProvider","$4e3b923658d69c60$export$28c660c63b792dea","$cCslV$forwardRef","UNSTABLE_portalContainer","$64fa3d84918910a7$export$29f1550f4b0d4415","contextState","$cCslV$useContext","localState","isExiting","$cCslV$useExitAnimation","$cCslV$OverlayContainer","$4e3b923658d69c60$var$TooltipInner","arrowRef","arrowWidth","setArrowWidth","$cCslV$useState","$cCslV$useLayoutEffect","overlayProps","arrowProps","placement","$cCslV$useOverlayPosition","isEntering","$cCslV$useEnterAnimation","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","$cCslV$mergeProps","$cCslV$useTooltip","DOMProps","$cCslV$fil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_ignoreList":[0]}
@@ -1,98 +0,0 @@
1
- import { Provider as O, useContextProps as b, useRenderProps as v } from "./utils.es.js";
2
- import { OverlayArrowContext as T } from "./OverlayArrow.es.js";
3
- import { useTooltipTrigger as R, OverlayContainer as y, useOverlayPosition as C, mergeProps as u, useTooltip as w } from "react-aria";
4
- import { useExitAnimation as S, useLayoutEffect as h, useEnterAnimation as A, filterDOMProps as B } from "@react-aria/utils";
5
- import { FocusableProvider as F } from "../../@react-aria/interactions/dist/useFocusable.es.js";
6
- import { useTooltipTriggerState as g } from "react-stately";
7
- import l, { useRef as $, createContext as m, forwardRef as D, useContext as x, useState as L } from "react";
8
- const d = /* @__PURE__ */ m(null), p = /* @__PURE__ */ m(null);
9
- function k(e) {
10
- let r = g(e), t = $(null), { triggerProps: i, tooltipProps: a } = R(e, r, t);
11
- return /* @__PURE__ */ l.createElement(O, {
12
- values: [
13
- [
14
- d,
15
- r
16
- ],
17
- [
18
- p,
19
- {
20
- ...a,
21
- triggerRef: t
22
- }
23
- ]
24
- ]
25
- }, /* @__PURE__ */ l.createElement(F, {
26
- ...i,
27
- ref: t
28
- }, e.children));
29
- }
30
- const q = /* @__PURE__ */ D(function({ UNSTABLE_portalContainer: r, ...t }, i) {
31
- [t, i] = b(t, i, p);
32
- let a = x(d), n = g(t), f = t.isOpen != null || t.defaultOpen != null || !a ? n : a, o = S(i, f.isOpen) || t.isExiting || !1;
33
- return !f.isOpen && !o ? null : /* @__PURE__ */ l.createElement(y, {
34
- portalContainer: r
35
- }, /* @__PURE__ */ l.createElement(M, {
36
- ...t,
37
- tooltipRef: i,
38
- isExiting: o
39
- }));
40
- });
41
- function M(e) {
42
- let r = x(d), t = $(null), [i, a] = L(0);
43
- h(() => {
44
- t.current && r.isOpen && a(t.current.getBoundingClientRect().width);
45
- }, [
46
- r.isOpen,
47
- t
48
- ]);
49
- let { overlayProps: n, arrowProps: f, placement: o } = C({
50
- placement: e.placement || "top",
51
- targetRef: e.triggerRef,
52
- overlayRef: e.tooltipRef,
53
- offset: e.offset,
54
- crossOffset: e.crossOffset,
55
- isOpen: r.isOpen,
56
- arrowSize: i,
57
- arrowBoundaryOffset: e.arrowBoundaryOffset,
58
- shouldFlip: e.shouldFlip,
59
- onClose: () => r.close(!0)
60
- }), c = A(e.tooltipRef, !!o) || e.isEntering || !1, s = v({
61
- ...e,
62
- defaultClassName: "react-aria-Tooltip",
63
- values: {
64
- placement: o,
65
- isEntering: c,
66
- isExiting: e.isExiting,
67
- state: r
68
- }
69
- });
70
- e = u(e, n);
71
- let { tooltipProps: P } = w(e, r), E = B(e, {
72
- global: !0
73
- });
74
- return /* @__PURE__ */ l.createElement("div", {
75
- ...u(E, s, P),
76
- ref: e.tooltipRef,
77
- style: {
78
- ...n.style,
79
- ...s.style
80
- },
81
- "data-placement": o ?? void 0,
82
- "data-entering": c || void 0,
83
- "data-exiting": e.isExiting || void 0
84
- }, /* @__PURE__ */ l.createElement(T.Provider, {
85
- value: {
86
- ...f,
87
- placement: o,
88
- ref: t
89
- }
90
- }, s.children));
91
- }
92
- export {
93
- q as Tooltip,
94
- p as TooltipContext,
95
- k as TooltipTrigger,
96
- d as TooltipTriggerStateContext
97
- };
98
- //# sourceMappingURL=Tooltip.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tooltip.es.js","sources":["../../../../node_modules/react-aria-components/dist/Tooltip.mjs"],"sourcesContent":["import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from \"./utils.mjs\";\nimport {OverlayArrowContext as $44f671af83e7d9e0$export$2de4954e8ae13b9f} from \"./OverlayArrow.mjs\";\nimport {useTooltipTrigger as $cCslV$useTooltipTrigger, OverlayContainer as $cCslV$OverlayContainer, useOverlayPosition as $cCslV$useOverlayPosition, mergeProps as $cCslV$mergeProps, useTooltip as $cCslV$useTooltip} from \"react-aria\";\nimport {useExitAnimation as $cCslV$useExitAnimation, useLayoutEffect as $cCslV$useLayoutEffect, useEnterAnimation as $cCslV$useEnterAnimation, filterDOMProps as $cCslV$filterDOMProps} from \"@react-aria/utils\";\nimport {FocusableProvider as $cCslV$FocusableProvider} from \"@react-aria/focus\";\nimport {useTooltipTriggerState as $cCslV$useTooltipTriggerState} from \"react-stately\";\nimport $cCslV$react, {createContext as $cCslV$createContext, useRef as $cCslV$useRef, forwardRef as $cCslV$forwardRef, useContext as $cCslV$useContext, useState as $cCslV$useState} from \"react\";\n\n/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\n\n\n\n\n\nconst $4e3b923658d69c60$export$7a7623236eec67fa = /*#__PURE__*/ (0, $cCslV$createContext)(null);\nconst $4e3b923658d69c60$export$39ae08fa83328b12 = /*#__PURE__*/ (0, $cCslV$createContext)(null);\nfunction $4e3b923658d69c60$export$8c610744efcf8a1d(props) {\n let state = (0, $cCslV$useTooltipTriggerState)(props);\n let ref = (0, $cCslV$useRef)(null);\n let { triggerProps: triggerProps, tooltipProps: tooltipProps } = (0, $cCslV$useTooltipTrigger)(props, state, ref);\n return /*#__PURE__*/ (0, $cCslV$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {\n values: [\n [\n $4e3b923658d69c60$export$7a7623236eec67fa,\n state\n ],\n [\n $4e3b923658d69c60$export$39ae08fa83328b12,\n {\n ...tooltipProps,\n triggerRef: ref\n }\n ]\n ]\n }, /*#__PURE__*/ (0, $cCslV$react).createElement((0, $cCslV$FocusableProvider), {\n ...triggerProps,\n ref: ref\n }, props.children));\n}\nconst $4e3b923658d69c60$export$28c660c63b792dea = /*#__PURE__*/ (0, $cCslV$forwardRef)(function Tooltip({ UNSTABLE_portalContainer: UNSTABLE_portalContainer, ...props }, ref) {\n [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $4e3b923658d69c60$export$39ae08fa83328b12);\n let contextState = (0, $cCslV$useContext)($4e3b923658d69c60$export$7a7623236eec67fa);\n let localState = (0, $cCslV$useTooltipTriggerState)(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = (0, $cCslV$useExitAnimation)(ref, state.isOpen) || props.isExiting || false;\n if (!state.isOpen && !isExiting) return null;\n return /*#__PURE__*/ (0, $cCslV$react).createElement((0, $cCslV$OverlayContainer), {\n portalContainer: UNSTABLE_portalContainer\n }, /*#__PURE__*/ (0, $cCslV$react).createElement($4e3b923658d69c60$var$TooltipInner, {\n ...props,\n tooltipRef: ref,\n isExiting: isExiting\n }));\n});\nfunction $4e3b923658d69c60$var$TooltipInner(props) {\n let state = (0, $cCslV$useContext)($4e3b923658d69c60$export$7a7623236eec67fa);\n // Calculate the arrow size internally\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = (0, $cCslV$useRef)(null);\n let [arrowWidth, setArrowWidth] = (0, $cCslV$useState)(0);\n (0, $cCslV$useLayoutEffect)(()=>{\n if (arrowRef.current && state.isOpen) setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }, [\n state.isOpen,\n arrowRef\n ]);\n let { overlayProps: overlayProps, arrowProps: arrowProps, placement: placement } = (0, $cCslV$useOverlayPosition)({\n placement: props.placement || 'top',\n targetRef: props.triggerRef,\n overlayRef: props.tooltipRef,\n offset: props.offset,\n crossOffset: props.crossOffset,\n isOpen: state.isOpen,\n arrowSize: arrowWidth,\n arrowBoundaryOffset: props.arrowBoundaryOffset,\n shouldFlip: props.shouldFlip,\n onClose: ()=>state.close(true)\n });\n let isEntering = (0, $cCslV$useEnterAnimation)(props.tooltipRef, !!placement) || props.isEntering || false;\n let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({\n ...props,\n defaultClassName: 'react-aria-Tooltip',\n values: {\n placement: placement,\n isEntering: isEntering,\n isExiting: props.isExiting,\n state: state\n }\n });\n props = (0, $cCslV$mergeProps)(props, overlayProps);\n let { tooltipProps: tooltipProps } = (0, $cCslV$useTooltip)(props, state);\n let DOMProps = (0, $cCslV$filterDOMProps)(props, {\n global: true\n });\n return /*#__PURE__*/ (0, $cCslV$react).createElement(\"div\", {\n ...(0, $cCslV$mergeProps)(DOMProps, renderProps, tooltipProps),\n ref: props.tooltipRef,\n style: {\n ...overlayProps.style,\n ...renderProps.style\n },\n \"data-placement\": placement !== null && placement !== void 0 ? placement : undefined,\n \"data-entering\": isEntering || undefined,\n \"data-exiting\": props.isExiting || undefined\n }, /*#__PURE__*/ (0, $cCslV$react).createElement((0, $44f671af83e7d9e0$export$2de4954e8ae13b9f).Provider, {\n value: {\n ...arrowProps,\n placement: placement,\n ref: arrowRef\n }\n }, renderProps.children));\n}\n\n\nexport {$4e3b923658d69c60$export$7a7623236eec67fa as TooltipTriggerStateContext, $4e3b923658d69c60$export$39ae08fa83328b12 as TooltipContext, $4e3b923658d69c60$export$8c610744efcf8a1d as TooltipTrigger, $4e3b923658d69c60$export$28c660c63b792dea as Tooltip};\n//# sourceMappingURL=Tooltip.module.js.map\n"],"names":["$4e3b923658d69c60$export$7a7623236eec67fa","$cCslV$createContext","$4e3b923658d69c60$export$39ae08fa83328b12","$4e3b923658d69c60$export$8c610744efcf8a1d","props","state","$cCslV$useTooltipTriggerState","ref","$cCslV$useRef","triggerProps","tooltipProps","$cCslV$useTooltipTrigger","$cCslV$react","$64fa3d84918910a7$export$2881499e37b75b9a","$cCslV$FocusableProvider","$4e3b923658d69c60$export$28c660c63b792dea","$cCslV$forwardRef","UNSTABLE_portalContainer","$64fa3d84918910a7$export$29f1550f4b0d4415","contextState","$cCslV$useContext","localState","isExiting","$cCslV$useExitAnimation","$cCslV$OverlayContainer","$4e3b923658d69c60$var$TooltipInner","arrowRef","arrowWidth","setArrowWidth","$cCslV$useState","$cCslV$useLayoutEffect","overlayProps","arrowProps","placement","$cCslV$useOverlayPosition","isEntering","$cCslV$useEnterAnimation","renderProps","$64fa3d84918910a7$export$4d86445c2cf5e3","$cCslV$mergeProps","$cCslV$useTooltip","DOMProps","$cCslV$filterDOMProps","$44f671af83e7d9e0$export$2de4954e8ae13b9f"],"mappings":";;;;;;;AAyBK,MAACA,IAA8DC,gBAAAA,EAAsB,IAAI,GACxFC,IAA8DD,gBAAAA,EAAsB,IAAI;AAC9F,SAASE,EAA0CC,GAAO;AACtD,MAAIC,IAAYC,EAA+BF,CAAK,GAChDG,IAAUC,EAAe,IAAI,GAC7B,EAAE,cAAcC,GAAc,cAAcC,EAAY,IAASC,EAA0BP,GAAOC,GAAOE,CAAG;AAChH,SAAyBK,gBAAAA,EAAc,cAAkBC,GAA4C;AAAA,IACjG,QAAQ;AAAA,MACJ;AAAA,QACIb;AAAA,QACAK;AAAA,MACH;AAAA,MACD;AAAA,QACIH;AAAA,QACA;AAAA,UACI,GAAGQ;AAAA,UACH,YAAYH;AAAA,QACf;AAAA,MACJ;AAAA,IACJ;AAAA,EACT,GAAyBK,gBAAAA,EAAc,cAAkBE,GAA2B;AAAA,IAC5E,GAAGL;AAAA,IACH,KAAKF;AAAA,EACb,GAAOH,EAAM,QAAQ,CAAC;AACtB;AACK,MAACW,IAA8DC,gBAAAA,EAAmB,SAAiB,EAAE,0BAA0BC,GAA0B,GAAGb,EAAO,GAAEG,GAAK;AAC3K,GAACH,GAAOG,CAAG,IAAQW,EAA2Cd,GAAOG,GAAKL,CAAyC;AACnH,MAAIiB,IAAmBC,EAAmBpB,CAAyC,GAC/EqB,IAAiBf,EAA+BF,CAAK,GACrDC,IAAQD,EAAM,UAAU,QAAQA,EAAM,eAAe,QAAQ,CAACe,IAAeE,IAAaF,GAC1FG,IAAgBC,EAAyBhB,GAAKF,EA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D,IAAYmC,EAAmBnC,GAAO2B,CAAY;AAClD,MAAI,EAAE,cAAcrB,EAAc,IAAO8B,EAAmBpC,GAAOC,CAAK,GACpEoC,IAAeC,EAAuBtC,GAAO;AAAA,IAC7C,QAAQ;AAAA,EAChB,CAAK;AACD,SAAyBQ,gBAAAA,EAAc,cAAc,OAAO;AAAA,IACxD,GAAO2B,EAAmBE,GAAUJ,GAAa3B,CAAY;AAAA,IAC7D,KAAKN,EAAM;AAAA,IACX,OAAO;AAAA,MACH,GAAG2B,EAAa;AAAA,MAChB,GAAGM,EAAY;AAAA,IAClB;AAAA,IACD,kBAAkBJ,KAAyD;AAAA,IAC3E,iBAAiBE,KAAc;AAAA,IAC/B,gBAAgB/B,EAAM,aAAa;AAAA,EACtC,GAAoBQ,gBAAAA,EAAc,cAAkB+B,EAA2C,UAAU;AAAA,IACtG,OAAO;AAAA,MACH,GAAGX;AAAA,MACH,WAAWC;AAAA,MACX,KAAKP;AAAA,IACR;AAAA,EACT,GAAOW,EAAY,QAAQ,CAAC;AAC5B;","x_google_ignoreList":[0]}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@react-aria/utils"),i=require("react"),c=Symbol("default");function S({values:l,children:t}){for(let[e,a]of l)t=i.createElement(e.Provider,{value:a},t);return t}function x(l){let{className:t,style:e,children:a,defaultClassName:f,defaultChildren:s,defaultStyle:u,values:r}=l;return i.useMemo(()=>{let n,d,o;return typeof t=="function"?n=t({...r,defaultClassName:f}):n=t,typeof e=="function"?d=e({...r,defaultStyle:u||{}}):d=e,typeof a=="function"?o=a({...r,defaultChildren:s}):a==null?o=s:o=a,{className:n??f,style:d||u?{...u,...d}:void 0,children:o??s,"data-rac":""}},[t,e,a,f,s,u,r])}function m(l,t){let e=i.useContext(l);if(t===null)return null;if(e&&typeof e=="object"&&"slots"in e&&e.slots){let a=t||c;if(!e.slots[a]){let f=new Intl.ListFormat().format(Object.keys(e.slots).map(u=>`"${u}"`)),s=t?`Invalid slot "${t}".`:"A slot prop is required.";throw new Error(`${s} Valid slot names are ${f}.`)}return e.slots[a]}return e}function b(l,t,e){let a=m(e,l.slot)||{},{ref:f,...s}=a,u=y.useObjectRef(i.useMemo(()=>y.mergeRefs(t,f),[t,f])),r=y.mergeProps(s,l);return"style"in s&&s.style&&"style"in l&&l.style&&(typeof s.style=="function"||typeof l.style=="function"?r.style=n=>{let d=typeof s.style=="function"?s.style(n):s.style,o={...n.defaultStyle,...d},$=typeof l.style=="function"?l.style({...n,defaultStyle:o}):l.style;return{...o,...$}}:r.style={...s.style,...l.style}),[r,u]}exports.DEFAULT_SLOT=c;exports.Provider=S;exports.useContextProps=b;exports.useRenderProps=x;exports.useSlottedContext=m;
2
- //# sourceMappingURL=utils.cjs.js.map