@deephaven/components 1.7.2-beta.1 → 1.7.2-react-18-alpha.3

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 (278) hide show
  1. package/dist/AutoCompleteInput.d.ts +0 -17
  2. package/dist/AutoCompleteInput.d.ts.map +1 -1
  3. package/dist/AutoCompleteInput.js +12 -31
  4. package/dist/AutoCompleteInput.js.map +1 -1
  5. package/dist/AutoResizeTextarea.d.ts +0 -23
  6. package/dist/AutoResizeTextarea.d.ts.map +1 -1
  7. package/dist/AutoResizeTextarea.js +0 -21
  8. package/dist/AutoResizeTextarea.js.map +1 -1
  9. package/dist/BasicModal.d.ts +0 -27
  10. package/dist/BasicModal.d.ts.map +1 -1
  11. package/dist/BasicModal.js +2 -28
  12. package/dist/BasicModal.js.map +1 -1
  13. package/dist/BulkActionBar.js.map +1 -1
  14. package/dist/Button.d.ts +1 -1
  15. package/dist/Button.d.ts.map +1 -1
  16. package/dist/Button.js +2 -79
  17. package/dist/Button.js.map +1 -1
  18. package/dist/CardFlip.d.ts.map +1 -1
  19. package/dist/CardFlip.js +1 -2
  20. package/dist/CardFlip.js.map +1 -1
  21. package/dist/Checkbox.d.ts.map +1 -1
  22. package/dist/Checkbox.js +3 -45
  23. package/dist/Checkbox.js.map +1 -1
  24. package/dist/Collapse.d.ts +0 -8
  25. package/dist/Collapse.d.ts.map +1 -1
  26. package/dist/Collapse.js +0 -8
  27. package/dist/Collapse.js.map +1 -1
  28. package/dist/ComponentUtils.js.map +1 -1
  29. package/dist/CopyButton.js.map +1 -1
  30. package/dist/CustomTimeSelect.js +14 -15
  31. package/dist/CustomTimeSelect.js.map +1 -1
  32. package/dist/DateInput.js.map +1 -1
  33. package/dist/DateInputUtils.js.map +1 -1
  34. package/dist/DateTimeInput.d.ts.map +1 -1
  35. package/dist/DateTimeInput.js +0 -8
  36. package/dist/DateTimeInput.js.map +1 -1
  37. package/dist/DateTimeInputUtils.js.map +1 -1
  38. package/dist/DebouncedSearchInput.js +1 -1
  39. package/dist/DebouncedSearchInput.js.map +1 -1
  40. package/dist/DragUtils.js.map +1 -1
  41. package/dist/DraggableItemList.d.ts +2 -2
  42. package/dist/DraggableItemList.d.ts.map +1 -1
  43. package/dist/DraggableItemList.js +8 -7
  44. package/dist/DraggableItemList.js.map +1 -1
  45. package/dist/EditableItemList.js +1 -2
  46. package/dist/EditableItemList.js.map +1 -1
  47. package/dist/ErrorBoundary.js +1 -1
  48. package/dist/ErrorBoundary.js.map +1 -1
  49. package/dist/ErrorView.js +1 -2
  50. package/dist/ErrorView.js.map +1 -1
  51. package/dist/HierarchicalCheckboxMenu.d.ts +1 -1
  52. package/dist/HierarchicalCheckboxMenu.d.ts.map +1 -1
  53. package/dist/HierarchicalCheckboxMenu.js +1 -2
  54. package/dist/HierarchicalCheckboxMenu.js.map +1 -1
  55. package/dist/ItemList.d.ts +1 -1
  56. package/dist/ItemList.d.ts.map +1 -1
  57. package/dist/ItemList.js +14 -14
  58. package/dist/ItemList.js.map +1 -1
  59. package/dist/ItemListItem.js.map +1 -1
  60. package/dist/LoadingOverlay.js +1 -2
  61. package/dist/LoadingOverlay.js.map +1 -1
  62. package/dist/LoadingSpinner.js.map +1 -1
  63. package/dist/MaskedInput.d.ts.map +1 -1
  64. package/dist/MaskedInput.js +11 -31
  65. package/dist/MaskedInput.js.map +1 -1
  66. package/dist/MaskedInputUtils.js.map +1 -1
  67. package/dist/Option.js.map +1 -1
  68. package/dist/RadioGroup.js +1 -2
  69. package/dist/RadioGroup.js.map +1 -1
  70. package/dist/RadioItem.d.ts.map +1 -1
  71. package/dist/RadioItem.js +1 -13
  72. package/dist/RadioItem.js.map +1 -1
  73. package/dist/RandomAreaPlotAnimation.d.ts +1 -1
  74. package/dist/RandomAreaPlotAnimation.d.ts.map +1 -1
  75. package/dist/RandomAreaPlotAnimation.js +5 -8
  76. package/dist/RandomAreaPlotAnimation.js.map +1 -1
  77. package/dist/SearchInput.js +3 -5
  78. package/dist/SearchInput.js.map +1 -1
  79. package/dist/SearchableCombobox.js.map +1 -1
  80. package/dist/Select.d.ts +1 -1
  81. package/dist/Select.d.ts.map +1 -1
  82. package/dist/Select.js.map +1 -1
  83. package/dist/SelectValueList.js +9 -9
  84. package/dist/SelectValueList.js.map +1 -1
  85. package/dist/SocketedButton.d.ts +4 -4
  86. package/dist/SocketedButton.d.ts.map +1 -1
  87. package/dist/SocketedButton.js +5 -20
  88. package/dist/SocketedButton.js.map +1 -1
  89. package/dist/SplitButtonGroup.d.ts +2 -18
  90. package/dist/SplitButtonGroup.d.ts.map +1 -1
  91. package/dist/SplitButtonGroup.js +0 -13
  92. package/dist/SplitButtonGroup.js.map +1 -1
  93. package/dist/TableViewEmptyState.js +1 -2
  94. package/dist/TableViewEmptyState.js.map +1 -1
  95. package/dist/TextWithTooltip.js +1 -3
  96. package/dist/TextWithTooltip.js.map +1 -1
  97. package/dist/ThemeExport.js.map +1 -1
  98. package/dist/TimeInput.d.ts.map +1 -1
  99. package/dist/TimeInput.js +7 -17
  100. package/dist/TimeInput.js.map +1 -1
  101. package/dist/TimeSlider.js +3 -6
  102. package/dist/TimeSlider.js.map +1 -1
  103. package/dist/ToastNotification.d.ts +1 -2
  104. package/dist/ToastNotification.d.ts.map +1 -1
  105. package/dist/ToastNotification.js +1 -2
  106. package/dist/ToastNotification.js.map +1 -1
  107. package/dist/UIConstants.js.map +1 -1
  108. package/dist/UISwitch.d.ts.map +1 -1
  109. package/dist/UISwitch.js +18 -14
  110. package/dist/UISwitch.js.map +1 -1
  111. package/dist/XComponent.d.ts +1 -1
  112. package/dist/XComponent.d.ts.map +1 -1
  113. package/dist/XComponent.js.map +1 -1
  114. package/dist/XComponentMap.d.ts +2 -2
  115. package/dist/XComponentMap.d.ts.map +1 -1
  116. package/dist/XComponentMap.js.map +1 -1
  117. package/dist/actions/ConfirmActionButton.js.map +1 -1
  118. package/dist/actions/IconActionButton.js +1 -2
  119. package/dist/actions/IconActionButton.js.map +1 -1
  120. package/dist/actions/index.js.map +1 -1
  121. package/dist/context-actions/ContextActionUtils.js.map +1 -1
  122. package/dist/context-actions/ContextActions.d.ts +1 -2
  123. package/dist/context-actions/ContextActions.d.ts.map +1 -1
  124. package/dist/context-actions/ContextActions.js +22 -22
  125. package/dist/context-actions/ContextActions.js.map +1 -1
  126. package/dist/context-actions/ContextMenu.js +5 -7
  127. package/dist/context-actions/ContextMenu.js.map +1 -1
  128. package/dist/context-actions/ContextMenuItem.d.ts.map +1 -1
  129. package/dist/context-actions/ContextMenuItem.js +21 -43
  130. package/dist/context-actions/ContextMenuItem.js.map +1 -1
  131. package/dist/context-actions/ContextMenuRoot.js +1 -1
  132. package/dist/context-actions/ContextMenuRoot.js.map +1 -1
  133. package/dist/context-actions/GlobalContextAction.js +1 -1
  134. package/dist/context-actions/GlobalContextAction.js.map +1 -1
  135. package/dist/context-actions/GlobalContextActions.js.map +1 -1
  136. package/dist/context-actions/index.js.map +1 -1
  137. package/dist/declaration.d.js.map +1 -1
  138. package/dist/dialogs/ActionButtonDialogTrigger.js +1 -2
  139. package/dist/dialogs/ActionButtonDialogTrigger.js.map +1 -1
  140. package/dist/dialogs/ConfirmationDialog.js +1 -2
  141. package/dist/dialogs/ConfirmationDialog.js.map +1 -1
  142. package/dist/dialogs/index.js.map +1 -1
  143. package/dist/index.js.map +1 -1
  144. package/dist/menu-actions/DropdownMenu.js +2 -2
  145. package/dist/menu-actions/DropdownMenu.js.map +1 -1
  146. package/dist/menu-actions/Menu.js +4 -6
  147. package/dist/menu-actions/Menu.js.map +1 -1
  148. package/dist/menu-actions/index.js.map +1 -1
  149. package/dist/modal/DebouncedModal.js +1 -3
  150. package/dist/modal/DebouncedModal.js.map +1 -1
  151. package/dist/modal/InfoModal.js +1 -2
  152. package/dist/modal/InfoModal.js.map +1 -1
  153. package/dist/modal/Modal.js +2 -3
  154. package/dist/modal/Modal.js.map +1 -1
  155. package/dist/modal/ModalBody.js.map +1 -1
  156. package/dist/modal/ModalFooter.js.map +1 -1
  157. package/dist/modal/ModalHeader.js +1 -2
  158. package/dist/modal/ModalHeader.js.map +1 -1
  159. package/dist/modal/index.js.map +1 -1
  160. package/dist/navigation/DashboardList.js +3 -4
  161. package/dist/navigation/DashboardList.js.map +1 -1
  162. package/dist/navigation/Menu.js.map +1 -1
  163. package/dist/navigation/MenuItem.js +1 -2
  164. package/dist/navigation/MenuItem.js.map +1 -1
  165. package/dist/navigation/NavTab.d.ts +1 -1
  166. package/dist/navigation/NavTab.d.ts.map +1 -1
  167. package/dist/navigation/NavTab.js +4 -5
  168. package/dist/navigation/NavTab.js.map +1 -1
  169. package/dist/navigation/NavTabList.js +4 -5
  170. package/dist/navigation/NavTabList.js.map +1 -1
  171. package/dist/navigation/Page.js +1 -2
  172. package/dist/navigation/Page.js.map +1 -1
  173. package/dist/navigation/Stack.js +1 -3
  174. package/dist/navigation/Stack.js.map +1 -1
  175. package/dist/navigation/index.js.map +1 -1
  176. package/dist/popper/Popper.d.ts +1 -14
  177. package/dist/popper/Popper.d.ts.map +1 -1
  178. package/dist/popper/Popper.js +18 -29
  179. package/dist/popper/Popper.js.map +1 -1
  180. package/dist/popper/Tooltip.d.ts.map +1 -1
  181. package/dist/popper/Tooltip.js +18 -12
  182. package/dist/popper/Tooltip.js.map +1 -1
  183. package/dist/popper/index.js.map +1 -1
  184. package/dist/shortcuts/GlobalShortcuts.js.map +1 -1
  185. package/dist/shortcuts/NavigationShortcuts.js.map +1 -1
  186. package/dist/shortcuts/Shortcut.js +11 -13
  187. package/dist/shortcuts/Shortcut.js.map +1 -1
  188. package/dist/shortcuts/ShortcutRegistry.js +1 -1
  189. package/dist/shortcuts/ShortcutRegistry.js.map +1 -1
  190. package/dist/shortcuts/index.js.map +1 -1
  191. package/dist/spectrum/ActionGroup.js.map +1 -1
  192. package/dist/spectrum/ActionMenu.js.map +1 -1
  193. package/dist/spectrum/CheckboxGroup.js.map +1 -1
  194. package/dist/spectrum/Heading.js.map +1 -1
  195. package/dist/spectrum/ItemContent.js +2 -4
  196. package/dist/spectrum/ItemContent.js.map +1 -1
  197. package/dist/spectrum/ItemTooltip.js.map +1 -1
  198. package/dist/spectrum/ListActionGroup.js.map +1 -1
  199. package/dist/spectrum/ListActionMenu.js.map +1 -1
  200. package/dist/spectrum/TabPanels.d.ts.map +1 -1
  201. package/dist/spectrum/TabPanels.js +8 -5
  202. package/dist/spectrum/TabPanels.js.map +1 -1
  203. package/dist/spectrum/Text.js.map +1 -1
  204. package/dist/spectrum/View.js.map +1 -1
  205. package/dist/spectrum/buttons.js.map +1 -1
  206. package/dist/spectrum/collections.js.map +1 -1
  207. package/dist/spectrum/comboBox/ComboBox.js.map +1 -1
  208. package/dist/spectrum/comboBox/ComboBoxNormalized.js.map +1 -1
  209. package/dist/spectrum/comboBox/index.js.map +1 -1
  210. package/dist/spectrum/content.js.map +1 -1
  211. package/dist/spectrum/dateAndTime.js.map +1 -1
  212. package/dist/spectrum/forms.js.map +1 -1
  213. package/dist/spectrum/icons.js.map +1 -1
  214. package/dist/spectrum/index.js.map +1 -1
  215. package/dist/spectrum/layout.js.map +1 -1
  216. package/dist/spectrum/listView/ListView.js.map +1 -1
  217. package/dist/spectrum/listView/ListViewNormalized.js +1 -2
  218. package/dist/spectrum/listView/ListViewNormalized.js.map +1 -1
  219. package/dist/spectrum/listView/ListViewWrapper.js.map +1 -1
  220. package/dist/spectrum/listView/index.js.map +1 -1
  221. package/dist/spectrum/navigation.js.map +1 -1
  222. package/dist/spectrum/overlays.js.map +1 -1
  223. package/dist/spectrum/picker/Picker.js.map +1 -1
  224. package/dist/spectrum/picker/PickerNormalized.js.map +1 -1
  225. package/dist/spectrum/picker/PickerProps.js.map +1 -1
  226. package/dist/spectrum/picker/index.js.map +1 -1
  227. package/dist/spectrum/picker/usePickerItemScale.js.map +1 -1
  228. package/dist/spectrum/picker/usePickerNormalizedProps.d.ts +1 -2
  229. package/dist/spectrum/picker/usePickerNormalizedProps.d.ts.map +1 -1
  230. package/dist/spectrum/picker/usePickerNormalizedProps.js.map +1 -1
  231. package/dist/spectrum/picker/usePickerProps.js.map +1 -1
  232. package/dist/spectrum/picker/usePickerScrollOnOpen.js +1 -1
  233. package/dist/spectrum/picker/usePickerScrollOnOpen.js.map +1 -1
  234. package/dist/spectrum/shared.js.map +1 -1
  235. package/dist/spectrum/status.js.map +1 -1
  236. package/dist/spectrum/utils/index.js.map +1 -1
  237. package/dist/spectrum/utils/itemUtils.d.ts +2 -2
  238. package/dist/spectrum/utils/itemUtils.d.ts.map +1 -1
  239. package/dist/spectrum/utils/itemUtils.js +5 -1
  240. package/dist/spectrum/utils/itemUtils.js.map +1 -1
  241. package/dist/spectrum/utils/itemWrapperUtils.js +3 -4
  242. package/dist/spectrum/utils/itemWrapperUtils.js.map +1 -1
  243. package/dist/spectrum/utils/propsUtils.js.map +1 -1
  244. package/dist/spectrum/utils/themeUtils.js.map +1 -1
  245. package/dist/spectrum/utils/useOnChangeTrackUncontrolled.js +1 -1
  246. package/dist/spectrum/utils/useOnChangeTrackUncontrolled.js.map +1 -1
  247. package/dist/spectrum/utils/useRenderNormalizedItem.js +1 -2
  248. package/dist/spectrum/utils/useRenderNormalizedItem.js.map +1 -1
  249. package/dist/spectrum/utils/useStaticItemInitialScrollPosition.js +1 -1
  250. package/dist/spectrum/utils/useStaticItemInitialScrollPosition.js.map +1 -1
  251. package/dist/spectrum/utils/useStringifiedMultiSelection.d.ts +1 -1
  252. package/dist/spectrum/utils/useStringifiedMultiSelection.d.ts.map +1 -1
  253. package/dist/spectrum/utils/useStringifiedMultiSelection.js.map +1 -1
  254. package/dist/spectrum/utils/useStringifiedSelection.d.ts +1 -1
  255. package/dist/spectrum/utils/useStringifiedSelection.d.ts.map +1 -1
  256. package/dist/spectrum/utils/useStringifiedSelection.js.map +1 -1
  257. package/dist/theme/Logo.js.map +1 -1
  258. package/dist/theme/SpectrumThemeProvider.js.map +1 -1
  259. package/dist/theme/ThemeModel.js +1 -0
  260. package/dist/theme/ThemeModel.js.map +1 -1
  261. package/dist/theme/ThemePicker.d.ts.map +1 -1
  262. package/dist/theme/ThemePicker.js +3 -1
  263. package/dist/theme/ThemePicker.js.map +1 -1
  264. package/dist/theme/ThemeProvider.js +1 -3
  265. package/dist/theme/ThemeProvider.js.map +1 -1
  266. package/dist/theme/ThemeUtils.js.map +1 -1
  267. package/dist/theme/colorUtils.js.map +1 -1
  268. package/dist/theme/index.js.map +1 -1
  269. package/dist/theme/theme-dark/index.js.map +1 -1
  270. package/dist/theme/theme-light/index.js.map +1 -1
  271. package/dist/theme/theme-spectrum/index.js.map +1 -1
  272. package/dist/theme/useExternalTheme.js.map +1 -1
  273. package/dist/theme/useSpectrumThemeProvider.js.map +1 -1
  274. package/dist/theme/useTheme.js.map +1 -1
  275. package/dist/transitions/FadeTransition.js.map +1 -1
  276. package/dist/transitions/SlideTransition.js.map +1 -1
  277. package/dist/transitions/index.js.map +1 -1
  278. package/package.json +12 -13
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.js","names":["createContext","useEffect","useMemo","useState","Log","DEFAULT_PRELOAD_DATA_VARIABLES","calculatePreloadStyleContent","getActiveThemes","getDefaultBaseThemes","setThemePreloadData","overrideSVGFillColors","getDefaultSelectedThemeKey","SpectrumThemeProvider","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","log","module","ThemeContext","displayName","ThemeProvider","_ref","themes","customThemes","waitForActivation","defaultPreloadValues","children","baseThemes","value","setValue","selectedThemeKey","setSelectedThemeKey","activeThemes","base","custom","updateThemePreloadData","preloadStyleContent","debug2","active","map","theme","themeKey","styleContent","Provider"],"sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import {\n createContext,\n type ReactNode,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport Log from '@deephaven/log';\nimport { DEFAULT_PRELOAD_DATA_VARIABLES, type ThemeData } from './ThemeModel';\nimport {\n calculatePreloadStyleContent,\n getActiveThemes,\n getDefaultBaseThemes,\n setThemePreloadData,\n overrideSVGFillColors,\n getDefaultSelectedThemeKey,\n} from './ThemeUtils';\nimport { SpectrumThemeProvider } from './SpectrumThemeProvider';\nimport './theme-svg.scss';\n\nexport interface ThemeContextValue {\n activeThemes: ThemeData[] | null;\n selectedThemeKey: string;\n themes: ThemeData[];\n setSelectedThemeKey: (themeKey: string) => void;\n}\n\nconst log = Log.module('ThemeProvider');\n\nexport const ThemeContext = createContext<ThemeContextValue | null>(null);\nThemeContext.displayName = 'ThemeContext';\n\nexport interface ThemeProviderProps {\n /*\n * Additional themes to load in addition to the base themes. If no additional\n * themes are to be loaded, this must be set to an empty array in order to\n * tell the provider to activate the base themes.\n */\n themes: ThemeData[] | null;\n // In DHC web, custom themes are typically loaded from plugins. Since these\n // get loaded after login, we have to be able to render the children containing\n // the `Login` component before themes are activated. This means that `children`\n // get loaded before all styles are available. In cases where themes don't require\n // children to be rendered such as external themes requested from a parent Window,\n // we can defer the rendering of children until the themes are activated which\n // is less likely to render initial content with the wrong theme. We can get\n // rid of this prop if we ever find a way to load themes without depending on\n // children. See https://deephaven.atlassian.net/browse/DH-19400\n waitForActivation?: boolean;\n defaultPreloadValues?: Record<string, string>;\n children: ReactNode;\n}\n\nexport function ThemeProvider({\n themes: customThemes,\n waitForActivation = false,\n defaultPreloadValues = DEFAULT_PRELOAD_DATA_VARIABLES,\n children,\n}: ThemeProviderProps): JSX.Element | null {\n const baseThemes = useMemo(() => getDefaultBaseThemes(), []);\n\n const [value, setValue] = useState<ThemeContextValue | null>(null);\n\n const [selectedThemeKey, setSelectedThemeKey] = useState<string>(\n getDefaultSelectedThemeKey\n );\n\n // Calculate active themes once a non-null themes array is provided.\n const activeThemes = useMemo(\n () =>\n customThemes == null\n ? null\n : getActiveThemes(selectedThemeKey, {\n base: baseThemes,\n custom: customThemes ?? [],\n }),\n [baseThemes, selectedThemeKey, customThemes]\n );\n\n const themes = useMemo(\n () => [...baseThemes, ...(customThemes ?? [])],\n [baseThemes, customThemes]\n );\n\n useEffect(\n function updateThemePreloadData() {\n // Don't update preload data until themes have been loaded and activated\n if (activeThemes == null || customThemes == null) {\n return;\n }\n\n // Override fill color for certain inline SVGs (the originals are provided\n // by theme-svg.scss)\n overrideSVGFillColors(defaultPreloadValues);\n\n const preloadStyleContent =\n calculatePreloadStyleContent(defaultPreloadValues);\n\n log.debug2('updateThemePreloadData:', {\n active: activeThemes.map(theme => theme.themeKey),\n custom: customThemes.map(theme => theme.themeKey),\n preloadStyleContent,\n selectedThemeKey,\n });\n\n setThemePreloadData({\n themeKey: selectedThemeKey,\n preloadStyleContent,\n });\n },\n [activeThemes, selectedThemeKey, customThemes, defaultPreloadValues]\n );\n\n useEffect(() => {\n setValue({\n activeThemes,\n selectedThemeKey,\n themes,\n setSelectedThemeKey,\n });\n }, [activeThemes, selectedThemeKey, themes]);\n\n if (waitForActivation && activeThemes == null) {\n return null;\n }\n\n return (\n <>\n {activeThemes == null ? null : (\n <>\n {activeThemes.map(theme => (\n <style data-theme-key={theme.themeKey} key={theme.themeKey}>\n {theme.styleContent}\n </style>\n ))}\n </>\n )}\n {value == null ? null : (\n <ThemeContext.Provider value={value}>\n <SpectrumThemeProvider>{children}</SpectrumThemeProvider>\n </ThemeContext.Provider>\n )}\n </>\n );\n}\n\nexport default ThemeProvider;\n"],"mappings":"AAAA,SACEA,aAAa,EAEbC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,OAAO;AACd,OAAOC,GAAG,MAAM,gBAAgB;AAAC,SACxBC,8BAA8B;AAAA,SAErCC,4BAA4B,EAC5BC,eAAe,EACfC,oBAAoB,EACpBC,mBAAmB,EACnBC,qBAAqB,EACrBC,0BAA0B;AAAA,SAEnBC,qBAAqB;AAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAU9B,IAAMC,GAAG,GAAGf,GAAG,CAACgB,MAAM,CAAC,eAAe,CAAC;AAEvC,OAAO,IAAMC,YAAY,gBAAGrB,aAAa,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useState","Log","DEFAULT_PRELOAD_DATA_VARIABLES","calculatePreloadStyleContent","getActiveThemes","getDefaultBaseThemes","setThemePreloadData","overrideSVGFillColors","getDefaultSelectedThemeKey","SpectrumThemeProvider","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","log","module","ThemeContext","displayName","ThemeProvider","_ref","themes","customThemes","waitForActivation","defaultPreloadValues","children","baseThemes","value","setValue","selectedThemeKey","setSelectedThemeKey","activeThemes","base","custom","updateThemePreloadData","preloadStyleContent","debug2","active","map","theme","themeKey","styleContent","Provider"],"sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import {\n createContext,\n type ReactNode,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport Log from '@deephaven/log';\nimport { DEFAULT_PRELOAD_DATA_VARIABLES, type ThemeData } from './ThemeModel';\nimport {\n calculatePreloadStyleContent,\n getActiveThemes,\n getDefaultBaseThemes,\n setThemePreloadData,\n overrideSVGFillColors,\n getDefaultSelectedThemeKey,\n} from './ThemeUtils';\nimport { SpectrumThemeProvider } from './SpectrumThemeProvider';\nimport './theme-svg.scss';\n\nexport interface ThemeContextValue {\n activeThemes: ThemeData[] | null;\n selectedThemeKey: string;\n themes: ThemeData[];\n setSelectedThemeKey: (themeKey: string) => void;\n}\n\nconst log = Log.module('ThemeProvider');\n\nexport const ThemeContext = createContext<ThemeContextValue | null>(null);\nThemeContext.displayName = 'ThemeContext';\n\nexport interface ThemeProviderProps {\n /*\n * Additional themes to load in addition to the base themes. If no additional\n * themes are to be loaded, this must be set to an empty array in order to\n * tell the provider to activate the base themes.\n */\n themes: ThemeData[] | null;\n // In DHC web, custom themes are typically loaded from plugins. Since these\n // get loaded after login, we have to be able to render the children containing\n // the `Login` component before themes are activated. This means that `children`\n // get loaded before all styles are available. In cases where themes don't require\n // children to be rendered such as external themes requested from a parent Window,\n // we can defer the rendering of children until the themes are activated which\n // is less likely to render initial content with the wrong theme. We can get\n // rid of this prop if we ever find a way to load themes without depending on\n // children. See https://deephaven.atlassian.net/browse/DH-19400\n waitForActivation?: boolean;\n defaultPreloadValues?: Record<string, string>;\n children: ReactNode;\n}\n\nexport function ThemeProvider({\n themes: customThemes,\n waitForActivation = false,\n defaultPreloadValues = DEFAULT_PRELOAD_DATA_VARIABLES,\n children,\n}: ThemeProviderProps): JSX.Element | null {\n const baseThemes = useMemo(() => getDefaultBaseThemes(), []);\n\n const [value, setValue] = useState<ThemeContextValue | null>(null);\n\n const [selectedThemeKey, setSelectedThemeKey] = useState<string>(\n getDefaultSelectedThemeKey\n );\n\n // Calculate active themes once a non-null themes array is provided.\n const activeThemes = useMemo(\n () =>\n customThemes == null\n ? null\n : getActiveThemes(selectedThemeKey, {\n base: baseThemes,\n custom: customThemes ?? [],\n }),\n [baseThemes, selectedThemeKey, customThemes]\n );\n\n const themes = useMemo(\n () => [...baseThemes, ...(customThemes ?? [])],\n [baseThemes, customThemes]\n );\n\n useEffect(\n function updateThemePreloadData() {\n // Don't update preload data until themes have been loaded and activated\n if (activeThemes == null || customThemes == null) {\n return;\n }\n\n // Override fill color for certain inline SVGs (the originals are provided\n // by theme-svg.scss)\n overrideSVGFillColors(defaultPreloadValues);\n\n const preloadStyleContent =\n calculatePreloadStyleContent(defaultPreloadValues);\n\n log.debug2('updateThemePreloadData:', {\n active: activeThemes.map(theme => theme.themeKey),\n custom: customThemes.map(theme => theme.themeKey),\n preloadStyleContent,\n selectedThemeKey,\n });\n\n setThemePreloadData({\n themeKey: selectedThemeKey,\n preloadStyleContent,\n });\n },\n [activeThemes, selectedThemeKey, customThemes, defaultPreloadValues]\n );\n\n useEffect(() => {\n setValue({\n activeThemes,\n selectedThemeKey,\n themes,\n setSelectedThemeKey,\n });\n }, [activeThemes, selectedThemeKey, themes]);\n\n if (waitForActivation && activeThemes == null) {\n return null;\n }\n\n return (\n <>\n {activeThemes == null ? null : (\n <>\n {activeThemes.map(theme => (\n <style data-theme-key={theme.themeKey} key={theme.themeKey}>\n {theme.styleContent}\n </style>\n ))}\n </>\n )}\n {value == null ? null : (\n <ThemeContext.Provider value={value}>\n <SpectrumThemeProvider>{children}</SpectrumThemeProvider>\n </ThemeContext.Provider>\n )}\n </>\n );\n}\n\nexport default ThemeProvider;\n"],"mappings":"AAAA,SACEA,aAAa,EAEbC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,OAAO;AACd,OAAOC,GAAG,MAAM,gBAAgB;AAAC,SACxBC,8BAA8B;AAAA,SAErCC,4BAA4B,EAC5BC,eAAe,EACfC,oBAAoB,EACpBC,mBAAmB,EACnBC,qBAAqB,EACrBC,0BAA0B;AAAA,SAEnBC,qBAAqB;AAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAU9B,IAAMC,GAAG,GAAGf,GAAG,CAACgB,MAAM,CAAC,eAAe,CAAC;AAEvC,OAAO,IAAMC,YAAY,gBAAGrB,aAAa,CAA2B,IAAI,CAAC;AACzEqB,YAAY,CAACC,WAAW,GAAG,cAAc;AAuBzC,OAAO,SAASC,aAAaA,CAAAC,IAAA,EAKc;EAAA,IALb;IAC5BC,MAAM,EAAEC,YAAY;IACpBC,iBAAiB,GAAG,KAAK;IACzBC,oBAAoB,GAAGvB,8BAA8B;IACrDwB;EACkB,CAAC,GAAAL,IAAA;EACnB,IAAMM,UAAU,GAAG5B,OAAO,CAAC,MAAMM,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC;EAE5D,IAAM,CAACuB,KAAK,EAAEC,QAAQ,CAAC,GAAG7B,QAAQ,CAA2B,IAAI,CAAC;EAElE,IAAM,CAAC8B,gBAAgB,EAAEC,mBAAmB,CAAC,GAAG/B,QAAQ,CACtDQ,0BACF,CAAC;;EAED;EACA,IAAMwB,YAAY,GAAGjC,OAAO,CAC1B,MACEwB,YAAY,IAAI,IAAI,GAChB,IAAI,GACJnB,eAAe,CAAC0B,gBAAgB,EAAE;IAChCG,IAAI,EAAEN,UAAU;IAChBO,MAAM,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EjB,KAAA,CAAAF,SAAA;IAAAa,QAAA,GACGM,YAAY,IAAI,IAAI,GAAG,IAAI,gBAC1BrB,IAAA,CAAAE,SAAA;MAAAa,QAAA,EACGM,YAAY,CAACO,GAAG,CAACC,KAAK,iBACrB7B,IAAA;QAAO,kBAAgB6B,KAAK,CAACC,QAAS;QAAAf,QAAA,EACnCc,KAAK,CAACE;MAAY,GADuBF,KAAK,CAACC,QAE3C,CACR;IAAC,CACF,CACH,EACAb,KAAK,IAAI,IAAI,GAAG,IAAI,gBACnBjB,IAAA,CAACO,YAAY,CAACyB,QAAQ;MAACf,KAAK,EAAEA,KAAM;MAAAF,QAAA,eAClCf,IAAA,CAACF,qBAAqB;QAAAiB,QAAA,EAAEA;MAAQ,CAAwB;IAAC,CACpC,CACxB;EAAA,CACD,CAAC;AAEP;AAEA,eAAeN,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeUtils.js","names":["Log","assertNotNull","ColorUtils","requestParentResponse","themeDark","themeLight","DEFAULT_DARK_THEME_KEY","DEFAULT_LIGHT_THEME_KEY","DEFAULT_PRELOAD_DATA_VARIABLES","THEME_CACHE_LOCAL_STORAGE_KEY","SVG_ICON_MANUAL_COLOR_MAP","THEME_KEY_OVERRIDE_QUERY_PARAM","EXTERNAL_THEME_KEY","MSG_REQUEST_GET_THEME","TRANSPARENT_PRELOAD_DATA_VARIABLES","PRELOAD_TRANSPARENT_THEME_QUERY_PARAM","log","module","CSS_VAR_EXPRESSION_PREFIX","DH_VAR_PREFIX","TMP_CSS_PROP_PREFIX","NON_WHITESPACE_REGEX","WHITESPACE_REGEX","DH_CSS_VAR_NAME_REGEXP","calculatePreloadStyleContent","defaultPreloadValues","resolveVar","createCssVariableResolver","document","body","pairs","Object","keys","map","key","concat","join","el","defaultValues","computedStyle","getComputedStyle","cssVariableResolver","varName","_defaultValues","value","getPropertyValue","createPreloadStyleElement","id","preloadStyleContent","style","createElement","innerHTML","head","appendChild","extractDistinctCssVariableExpressions","record","set","Set","values","forEach","getExpressionRanges","_ref","start","end","expression","substring","includes","add","getActiveThemes","themeKey","themeRegistration","_custom$baseThemeKey","custom","find","theme","baseThemeKey","base","error","debug","getDefaultBaseThemes","name","styleContent","getDefaultSelectedThemeKey","_ref2","_getThemeKeyOverride","_getThemePreloadData","getThemeKeyOverride","getThemePreloadData","getThemeKey","pluginName","themeName","searchParams","URLSearchParams","window","location","search","get","data","localStorage","getItem","JSON","parse","_unused","_NON_WHITESPACE_REGEX","_NON_WHITESPACE_REGEX2","ranges","exec","index","parenLevel","i","length","test","push","isBaseThemeKey","isExternalThemeData","maybeExternalThemeData","cssVars","isExternalThemeEnabled","isPreloadTransparentTheme","isValidColorVar","CSS","supports","parseExternalThemeData","_ref3","toExpression","_ref4","varValue","sanitized","entries","filter","str","replaceSVGFillColor","svgContent","fillColor","replace","encodeURIComponent","requestExternalThemeData","_requestExternalThemeData","apply","arguments","_asyncToGenerator","result","Error","stringify","resolveCssVariablesInRecord","targetElement","undefined","isAlphaOptional","perfStart","performance","now","tmpPropEl","display","recordArray","_ref5","setProperty","backgroundColor","tempPropElComputedStyle","_ref6","resolved","containsCssVar","isColor","children","color","normalizeCssColor","remove","resolveCssVariablesInString","resolver","_ref7","setThemePreloadData","preloadData","setItem","preloadTheme","_getThemePreloadData2","previousPreloadStyleContent","defaultPreloadStyleContent","overrideSVGFillColors","_ref8","removeProperty","newSVGContent"],"sources":["../../src/theme/ThemeUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport {\n assertNotNull,\n ColorUtils,\n requestParentResponse,\n} from '@deephaven/utils';\nimport { themeDark } from './theme-dark';\nimport { themeLight } from './theme-light';\nimport {\n DEFAULT_DARK_THEME_KEY,\n DEFAULT_LIGHT_THEME_KEY,\n DEFAULT_PRELOAD_DATA_VARIABLES,\n type BaseThemeKey,\n type ThemeData,\n type ThemePreloadData,\n type CssVariableStyleContent,\n type ThemePreloadColorVariable,\n type ThemeRegistrationData,\n THEME_CACHE_LOCAL_STORAGE_KEY,\n SVG_ICON_MANUAL_COLOR_MAP,\n type ThemeCssVariableName,\n type ThemeIconsRequiringManualColorChanges,\n THEME_KEY_OVERRIDE_QUERY_PARAM,\n EXTERNAL_THEME_KEY,\n type ExternalThemeData,\n MSG_REQUEST_GET_THEME,\n type ThemeCssColorVariableName,\n TRANSPARENT_PRELOAD_DATA_VARIABLES,\n PRELOAD_TRANSPARENT_THEME_QUERY_PARAM,\n} from './ThemeModel';\n\nconst log = Log.module('ThemeUtils');\n\nexport const CSS_VAR_EXPRESSION_PREFIX = 'var(--';\nexport const DH_VAR_PREFIX = '--dh-color-';\nexport const TMP_CSS_PROP_PREFIX = 'dh-tmp';\nexport const NON_WHITESPACE_REGEX = /\\S/;\nexport const WHITESPACE_REGEX = /\\s/;\n\nexport const DH_CSS_VAR_NAME_REGEXP = /^--dh-color-[a-z0-9_-]+$/;\n\nexport type VarExpressionResolver = (varExpression: string) => string;\n\n/**\n * Resolves the current values of CSS variables we want to preload. Preloading\n * happens before themes are fully loaded so that we can style things like the\n * loading spinner and background color which are shown to the user early on in\n * the app lifecycle.\n * @defaultPreloadValues Default values to use if a preload variable is not set.\n */\nexport function calculatePreloadStyleContent(\n defaultPreloadValues: Record<string, string>\n): CssVariableStyleContent {\n const resolveVar = createCssVariableResolver(\n document.body,\n defaultPreloadValues\n );\n\n // Calculate the current preload variables. If the variable is not set, use\n // the default value.\n const pairs = Object.keys(defaultPreloadValues).map(\n key => `${key}:${resolveVar(key as ThemePreloadColorVariable)}`\n );\n\n return `:root{${pairs.join(';')}}`;\n}\n\n/**\n * Create a resolver function for calculating the value of a css variable based\n * on a given element's computed style. If the variable resolves to '', we check\n * `defaultValues` for a default value, and if one does not exist,\n * return ''.\n * @param el Element to resolve css variables against\n * @param defaultValues Default values to use if a variable is not set.\n */\nexport function createCssVariableResolver(\n el: Element,\n defaultValues: Record<string, string>\n): (varName: ThemeCssVariableName) => string {\n const computedStyle = getComputedStyle(el);\n\n /**\n * Resolve the given css variable name to a value. If the variable is not set,\n * return the default preload value or '' if one does not exist.\n */\n return function cssVariableResolver(varName: ThemeCssVariableName): string {\n const value = computedStyle.getPropertyValue(varName);\n\n if (value !== '') {\n return value;\n }\n\n return defaultValues[varName as ThemePreloadColorVariable] ?? '';\n };\n}\n\n/**\n * Create a style tag containing preload css variables and add to the head.\n * @param id The id of the style tag\n * @param preloadStyleContent The css variable content to add to the style tag\n */\nexport function createPreloadStyleElement(\n id: `theme-preload-${string}`,\n preloadStyleContent: CssVariableStyleContent\n): void {\n const style = document.createElement('style');\n style.id = id;\n style.innerHTML = preloadStyleContent;\n document.head.appendChild(style);\n}\n\n/**\n * Extracts all css variable expressions from the given record and returns\n * a set of unique expressions.\n * @param record The record to extract css variable expressions from\n */\nexport function extractDistinctCssVariableExpressions(\n record: Record<string, string>\n): Set<string> {\n const set = new Set<string>();\n\n Object.values(record).forEach(value => {\n getExpressionRanges(value).forEach(([start, end]) => {\n const expression = value.substring(start, end + 1);\n\n if (expression.includes(CSS_VAR_EXPRESSION_PREFIX)) {\n set.add(expression);\n }\n });\n });\n\n return set;\n}\n\n/**\n * Returns an array of the active themes. The first item will always be one\n * of the base themes. Optionally, the second item will be a custom theme.\n */\nexport function getActiveThemes(\n themeKey: string,\n themeRegistration: ThemeRegistrationData\n): [ThemeData] | [ThemeData, ThemeData] {\n const custom = themeRegistration.custom.find(\n theme => theme.themeKey === themeKey\n );\n\n const baseThemeKey = custom?.baseThemeKey ?? themeKey;\n\n let base = themeRegistration.base.find(\n theme => theme.themeKey === baseThemeKey\n );\n\n if (base == null) {\n log.error(\n `No registered base theme found for theme key: '${baseThemeKey}'`,\n 'Registered:',\n themeRegistration.base.map(theme => theme.themeKey),\n themeRegistration.custom.map(theme => theme.themeKey)\n );\n base = themeRegistration.base.find(\n theme => theme.themeKey === DEFAULT_DARK_THEME_KEY\n );\n\n assertNotNull(\n base,\n `Default base theme '${DEFAULT_DARK_THEME_KEY}' is not registered`\n );\n }\n\n log.debug('Applied themes:', base.themeKey, custom?.themeKey);\n\n return custom == null ? [base] : [base, custom];\n}\n\n/**\n * Get default base theme data.\n */\nexport function getDefaultBaseThemes(): ThemeData[] {\n return [\n {\n name: 'Default Dark',\n themeKey: DEFAULT_DARK_THEME_KEY,\n styleContent: themeDark,\n },\n // The ThemePicker shows whenever more than 1 theme is available. Disable\n // light theme for now to keep the picker hidden until it is fully\n // implemented by #1539.\n {\n name: 'Default Light',\n themeKey: DEFAULT_LIGHT_THEME_KEY,\n styleContent: themeLight,\n },\n ];\n}\n\n/**\n * Get the default selected theme key. Precedence is:\n * 1. Theme key override query parameter\n * 2. Theme key from preload data\n * 3. Default dark theme key\n * @returns The default selected theme key\n */\nexport function getDefaultSelectedThemeKey(): string {\n return (\n getThemeKeyOverride() ??\n getThemePreloadData()?.themeKey ??\n DEFAULT_DARK_THEME_KEY\n );\n}\n\n/**\n * Derive unique theme key from plugin root path and theme name.\n * @param pluginName The root path of the plugin\n * @param themeName The name of the theme\n */\nexport function getThemeKey(pluginName: string, themeName: string): string {\n return `${pluginName}_${themeName}`;\n}\n\n/**\n * A theme key override can be set via a query parameter to force a specific\n * theme selection. Useful for embedded widget scenarios that don't expose the\n * theme selector.\n */\nexport function getThemeKeyOverride(): string | null {\n const searchParams = new URLSearchParams(window.location.search);\n return searchParams.get(THEME_KEY_OVERRIDE_QUERY_PARAM);\n}\n\n/**\n * Get the preload data from local storage or null if it does not exist or is\n * invalid\n */\nexport function getThemePreloadData(): ThemePreloadData | null {\n const data = localStorage.getItem(THEME_CACHE_LOCAL_STORAGE_KEY);\n\n try {\n return data == null ? null : JSON.parse(data);\n } catch {\n // ignore\n }\n\n return null;\n}\n\n/**\n * Identifies start and end indices of any top-level expressions in the given\n * string.\n *\n * e.g.\n * getExpressionRanges('var(--aaa-aa) #fff var(--bbb-bb)')\n * yields:\n * [\n * [0, 12], // 'var(--aaa-aa)'\n * [14, 17] // '#fff'\n * [19, 31], // 'var(--bbb-bb)'\n * ]\n *\n * In cases where there are nested expressions, only the indices of the outermost\n * expression will be included.\n *\n * e.g.\n * getExpressionRanges('var(--ccc-cc, var(--aaa-aa, green)) var(--bbb-bb)')\n * yields:\n * [\n * [0, 34], // 'var(--ccc-cc, var(--aaa-aa, green))'\n * [36, 48], // 'var(--bbb-bb)'\n * ]\n * @param value The string to search for expressions\n * @returns An array of [start, end] index pairs for each expression\n */\nexport function getExpressionRanges(value: string): [number, number][] {\n const ranges: [number, number][] = [];\n\n let start = NON_WHITESPACE_REGEX.exec(value)?.index ?? 0;\n let parenLevel = 0;\n\n for (let i = 0; i < value.length; i += 1) {\n if (value[i] === '(') {\n parenLevel += 1;\n } else if (value[i] === ')') {\n parenLevel -= 1;\n }\n\n if (\n i === value.length - 1 ||\n (WHITESPACE_REGEX.test(value[i + 1]) && parenLevel === 0)\n ) {\n ranges.push([start, i]);\n\n while (i < value.length - 1 && WHITESPACE_REGEX.test(value[i + 1])) {\n i += 1;\n }\n\n start = i + 1;\n }\n }\n\n if (parenLevel !== 0) {\n log.error('Unbalanced parentheses in css var expression', value);\n return [];\n }\n\n return ranges;\n}\n\n/**\n * Check if the given theme key is one of the base themes.\n * @param themeKey The theme key to check\n * @returns True if the theme key is a base theme key, false otherwise\n */\nexport function isBaseThemeKey(themeKey: string): themeKey is BaseThemeKey {\n return [DEFAULT_DARK_THEME_KEY, DEFAULT_LIGHT_THEME_KEY].includes(themeKey);\n}\n\n/**\n * Determine if a given object is a `ExternalThemeData` object.\n * @param maybeExternalThemeData An object that may or may not be a `ExternalThemeData`\n * @returns True if the object is a `ExternalThemeData`, false otherwise\n */\nexport function isExternalThemeData(\n maybeExternalThemeData: unknown\n): maybeExternalThemeData is ExternalThemeData {\n if (\n typeof maybeExternalThemeData !== 'object' ||\n maybeExternalThemeData == null\n ) {\n return false;\n }\n\n return (\n 'name' in maybeExternalThemeData &&\n typeof maybeExternalThemeData.name === 'string' &&\n 'cssVars' in maybeExternalThemeData &&\n typeof maybeExternalThemeData.cssVars === 'object' &&\n maybeExternalThemeData.cssVars != null\n );\n}\n\n/**\n * Check if the current URL specifies an external theme key override.\n * @returns True if the external theme key override is set, false otherwise\n */\nexport function isExternalThemeEnabled(): boolean {\n const searchParams = new URLSearchParams(window.location.search);\n return (\n searchParams.get(THEME_KEY_OVERRIDE_QUERY_PARAM) === EXTERNAL_THEME_KEY\n );\n}\n\n/**\n * Check if PRELOAD_TRANSPARENT_THEME_QUERY_PARAM query parameter is set to true.\n * @returns True if the preload transparent theme query parameter is set, false\n * otherwise\n */\nexport function isPreloadTransparentTheme(): boolean {\n const searchParams = new URLSearchParams(window.location.search);\n return searchParams.get(PRELOAD_TRANSPARENT_THEME_QUERY_PARAM) === 'true';\n}\n\n/**\n * Validate that a given CSS variable name / value pair is a valid Deephaven\n * color variable.\n * @param name The name of the CSS variable to validate, e.g. '--dh-color-primary'\n * @param value The value of the CSS color to validate\n * @returns True if the name is a valid Deephaven color variable and the value\n * is a valid CSS color, false otherwise\n */\nexport function isValidColorVar(\n name: string,\n value: string\n): name is ThemeCssColorVariableName {\n return DH_CSS_VAR_NAME_REGEXP.test(name) && CSS.supports('color', value);\n}\n\n/**\n * Parse external theme data into a `ThemeData` object. Invalid CSS color variable\n * pairs are excluded from the resulting `ThemeData` object.\n * @param externalThemeData The external theme data to parse\n * @returns A `ThemeData` object representing the external theme\n */\nexport function parseExternalThemeData({\n baseThemeKey = DEFAULT_DARK_THEME_KEY,\n name,\n cssVars,\n}: ExternalThemeData): ThemeData {\n const toExpression = ([varName, varValue]: [string, string]) =>\n isValidColorVar(varName, varValue) ? `${varName}:${varValue};` : null;\n\n const sanitized = Object.entries(cssVars)\n .map(toExpression)\n .filter((str): str is string => str != null);\n\n const styleContent =\n sanitized.length === 0 ? '' : `:root{${sanitized.join('')}}`;\n\n return {\n baseThemeKey,\n themeKey: EXTERNAL_THEME_KEY,\n name,\n styleContent,\n };\n}\n\n/**\n * Replace the `fill='...'` attribute in the given SVG content with the given\n * color string.\n * @param svgContent Inline SVG content to replace the fill color in\n * @param fillColor The color to replace the fill color with\n */\nexport function replaceSVGFillColor(\n svgContent: string,\n fillColor: string\n): string {\n return svgContent.replace(\n /fill='.*?'/,\n `fill='${encodeURIComponent(fillColor)}'`\n );\n}\n\n/**\n * Request theme data from the parent window.\n * @returns A promise that resolves to the external theme data\n * @throws Error if the response is not a valid `ExternalThemeData`\n */\nexport async function requestExternalThemeData(): Promise<ExternalThemeData> {\n const result = await requestParentResponse(MSG_REQUEST_GET_THEME);\n\n if (!isExternalThemeData(result)) {\n throw new Error(\n `Unexpected external theme data response: ${JSON.stringify(result)}`\n );\n }\n\n return result;\n}\n\n/**\n * Make a copy of the given object replacing any css variable expressions\n * contained in its prop values with values resolved from the given HTML element.\n * Variables that resolve to color strings will also be normalized to 8 digit\n * hex values (or optionally 6 digit hex if `isAlphaOptional` is true).\n *\n * Note that the browser will force a reflow when calling `getComputedStyle` if\n * css properties have changed. In order to avoid a reflow for every property\n * check we use distinct setup, resolve / normalize, and cleanup passes:\n * 1. Setup - Create a tmp element and set all css props we want to evaluate\n * 2. Resolve / Normalize - Evaluate all css props via `getPropertyValue` calls\n * and replace the original expressions with resolved values. Also normalize\n * css colors to rgb/a.\n * 3. Cleanup - Remove the tmp element\n * @param record An object whose values may contain css var expressions\n * @param targetElement The element to resolve css variables against. Defaults\n * to document.body\n * @param isAlphaOptional If true, the alpha value will be dropped from resolved\n * 8 character hex colors if it is 'ff'. Defaults to false.\n */\nexport function resolveCssVariablesInRecord<T extends Record<string, string>>(\n record: T,\n targetElement: HTMLElement = document.body,\n isAlphaOptional = false\n): T {\n const perfStart = performance.now();\n\n // Add a temporary div to attach temp css variables to\n const tmpPropEl = document.createElement('div');\n tmpPropEl.style.display = 'none';\n\n const recordArray = Object.entries(record);\n recordArray.forEach(([, value], i) => {\n tmpPropEl.style.setProperty(`--${TMP_CSS_PROP_PREFIX}-${i}`, value);\n // faster to create these now all at once, even if we don't use them all\n // since the parent isn't added yet to the DOM\n const el = document.createElement('div');\n // use background color instead of color to avoid inherited values\n el.style.backgroundColor = value;\n tmpPropEl.appendChild(el);\n });\n\n // append only once to avoid multiple re-layouts\n // must be part of DOM to get computed color\n targetElement.appendChild(tmpPropEl);\n const tempPropElComputedStyle = window.getComputedStyle(tmpPropEl);\n\n const result = {} as T;\n recordArray.forEach(([key, value], i) => {\n // resolves any variables in the expression\n let resolved = tempPropElComputedStyle.getPropertyValue(\n `--${TMP_CSS_PROP_PREFIX}-${i}`\n );\n\n const containsCssVar = value.includes(CSS_VAR_EXPRESSION_PREFIX);\n const isColor = CSS.supports('color', resolved);\n\n if (\n // only try to normalize non-hex strings that are valid colors\n // otherwise non-colors will be made #00000000\n isColor &&\n !/^#[0-9A-F]{6}[0-9a-f]{0,2}$/i.test(resolved)\n ) {\n // getting the computed background color is necessary\n // because resolved can still contain a color-mix() function\n const el = tmpPropEl.children[i] as HTMLDivElement;\n const computedStyle = window.getComputedStyle(el);\n const color = computedStyle.getPropertyValue('background-color');\n // convert color to hex, which is what monaco and plotly require\n resolved = ColorUtils.normalizeCssColor(color, isAlphaOptional);\n }\n (result as Record<string, string>)[key] =\n containsCssVar || isColor ? resolved : value;\n });\n\n // Remove the temporary div\n tmpPropEl.remove();\n\n log.debug('Resolved css variables', performance.now() - perfStart, 'ms');\n\n return result;\n}\n\n/**\n * Resolve css variable expressions in the given string using the\n * given resolver and replace the original expressions with the resolved values.\n *\n * @param resolver Function that can resolve a css variable expression\n * @param value Value that may contain css variable expressions\n */\nexport function resolveCssVariablesInString(\n resolver: VarExpressionResolver,\n value: string\n): string {\n const result: string[] = [];\n let i = 0;\n getExpressionRanges(value).forEach(([start, end]) => {\n if (i < start) {\n result.push(value.substring(i, start));\n i += start - i;\n }\n\n const expression = value.substring(start, end + 1);\n\n result.push(\n expression.includes(CSS_VAR_EXPRESSION_PREFIX)\n ? resolver(expression)\n : expression\n );\n\n i += end - start + 1;\n });\n\n if (result.length === 0) {\n return value;\n }\n\n return result.join('');\n}\n\n/**\n * Store theme preload data in local storage.\n * @param preloadData The preload data to set\n */\nexport function setThemePreloadData(preloadData: ThemePreloadData): void {\n localStorage.setItem(\n THEME_CACHE_LOCAL_STORAGE_KEY,\n JSON.stringify(preloadData)\n );\n}\n\n/**\n * Preload minimal theme variables from the cache.\n * @defaultPreloadValues Optional default values to use if a preload variable is not set.\n */\nexport function preloadTheme(\n defaultPreloadValues: Record<string, string> = DEFAULT_PRELOAD_DATA_VARIABLES\n): void {\n // In certain cases we may want to preload a transparent theme to allow the\n // parent container to show through. For example, when a parent Window is\n // providing a theme via `postMessage` apis, we may not have enough information\n // to properly preload the theme, so we can just preload a transparent\n // theme and let the parent container show through until `postMessage`\n // communication is complete.\n if (isPreloadTransparentTheme()) {\n createPreloadStyleElement(\n 'theme-preload-transparent',\n calculatePreloadStyleContent(TRANSPARENT_PRELOAD_DATA_VARIABLES)\n );\n return;\n }\n\n const previousPreloadStyleContent =\n getThemePreloadData()?.preloadStyleContent;\n\n const defaultPreloadStyleContent =\n calculatePreloadStyleContent(defaultPreloadValues);\n\n log.debug('Preloading theme content:', {\n defaultPreloadStyleContent,\n previousPreloadStyleContent,\n });\n\n createPreloadStyleElement(\n 'theme-preload-defaults',\n defaultPreloadStyleContent\n );\n\n // Any preload variables that were saved by last theme load should override\n // the defaults\n if (previousPreloadStyleContent != null) {\n createPreloadStyleElement(\n 'theme-preload-previous',\n previousPreloadStyleContent\n );\n }\n}\n\n/**\n * Inline SVGs cannot depend on dynamic CSS variables, so we have to statically\n * update them if we want to change their color.\n *\n * This function:\n * 1. Clears any previous overrides\n * 2. Resolves CSS variables containing inline SVG urls\n * 3. Resolves mapped color variables and replaces the `fill='...'` attribute with the result\n * 4. Sets the original CSS variable to the new replaced value\n *\n * Note that it is preferable to use inline SVGs as background-mask values and\n * just change the background color instead of relying on this util, but this\n * is not always possible. e.g. <select> elements don't support pseudo elements,\n * so there's not a good way to set icons via masks.\n * @param defaultValues Default values to use if a variable is not set.\n */\nexport function overrideSVGFillColors(\n defaultValues: Record<string, string>\n): void {\n const resolveVar = createCssVariableResolver(document.body, defaultValues);\n\n Object.entries(SVG_ICON_MANUAL_COLOR_MAP).forEach(([key, value]) => {\n // Clear any previous override so that our variables get resolved against the\n // actual svg content provided by the active themes and not from a previous\n // override\n document.body.style.removeProperty(key);\n\n const svgContent = resolveVar(key as ThemeIconsRequiringManualColorChanges);\n const fillColor = resolveVar(value as ThemePreloadColorVariable);\n\n const newSVGContent = replaceSVGFillColor(svgContent, fillColor);\n\n // This will take precedence over any values for the variable provided by\n // the active themes\n document.body.style.setProperty(key, newSVGContent);\n });\n}\n"],"mappings":";;AAAA,OAAOA,GAAG,MAAM,gBAAgB;AAChC,SACEC,aAAa,EACbC,UAAU,EACVC,qBAAqB,QAChB,kBAAkB;AAAC,SACjBC,SAAS;AAAA,SACTC,UAAU;AAAA,SAEjBC,sBAAsB,EACtBC,uBAAuB,EACvBC,8BAA8B,EAO9BC,6BAA6B,EAC7BC,yBAAyB,EAGzBC,8BAA8B,EAC9BC,kBAAkB,EAElBC,qBAAqB,EAErBC,kCAAkC,EAClCC,qCAAqC;AAGvC,IAAMC,GAAG,GAAGhB,GAAG,CAACiB,MAAM,CAAC,YAAY,CAAC;AAEpC,OAAO,IAAMC,yBAAyB,GAAG,QAAQ;AACjD,OAAO,IAAMC,aAAa,GAAG,aAAa;AAC1C,OAAO,IAAMC,mBAAmB,GAAG,QAAQ;AAC3C,OAAO,IAAMC,oBAAoB,GAAG,IAAI;AACxC,OAAO,IAAMC,gBAAgB,GAAG,IAAI;AAEpC,OAAO,IAAMC,sBAAsB,GAAG,0BAA0B;AAIhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAC1CC,oBAA4C,EACnB;EACzB,IAAMC,UAAU,GAAGC,yBAAyB,CAC1CC,QAAQ,CAACC,IAAI,EACbJ,oBACF,CAAC;;EAED;EACA;EACA,IAAMK,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACP,oBAAoB,CAAC,CAACQ,GAA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A;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,qBAAqBA,CACnC1I,aAAqC,EAC/B;EACN,IAAMZ,UAAU,GAAGC,yBAAyB,CAACC,QAAQ,CAACC,IAAI,EAAES,aAAa,CAAC;EAE1EP,MAAM,CAACiG,OAAO,CAACtH,yBAAyB,CAAC,CAACiD,OAAO,CAACsH,KAAA,IAAkB;IAAA,IAAjB,CAAC/I,GAAG,EAAEU,KAAK,CAAC,GAAAqI,KAAA;IAC7D;IACA;IACA;IACArJ,QAAQ,CAACC,IAAI,CAACoB,KAAK,CAACiI,cAAc,CAAChJ,GAAG,CAAC;IAEvC,IAAMkG,UAAU,GAAG1G,UAAU,CAACQ,GAA4C,CAAC;IAC3E,IAAMmG,SAAS,GAAG3G,UAAU,CAACkB,KAAkC,CAAC;IAEhE,IAAMuI,aAAa,GAAGhD,mBAAmB,CAACC,UAAU,EAAEC,SAAS,CAAC;;IAEhE;IACA;IACAzG,QAAQ,CAACC,IAAI,CAACoB,KAAK,CAAC0G,WAAW,CAACzH,GAAG,EAAEiJ,aAAa,CAAC;EACrD,CAAC,CAAC;AACJ"}
1
+ {"version":3,"file":"ThemeUtils.js","names":["Log","assertNotNull","ColorUtils","requestParentResponse","themeDark","themeLight","DEFAULT_DARK_THEME_KEY","DEFAULT_LIGHT_THEME_KEY","DEFAULT_PRELOAD_DATA_VARIABLES","THEME_CACHE_LOCAL_STORAGE_KEY","SVG_ICON_MANUAL_COLOR_MAP","THEME_KEY_OVERRIDE_QUERY_PARAM","EXTERNAL_THEME_KEY","MSG_REQUEST_GET_THEME","TRANSPARENT_PRELOAD_DATA_VARIABLES","PRELOAD_TRANSPARENT_THEME_QUERY_PARAM","log","module","CSS_VAR_EXPRESSION_PREFIX","DH_VAR_PREFIX","TMP_CSS_PROP_PREFIX","NON_WHITESPACE_REGEX","WHITESPACE_REGEX","DH_CSS_VAR_NAME_REGEXP","calculatePreloadStyleContent","defaultPreloadValues","resolveVar","createCssVariableResolver","document","body","pairs","Object","keys","map","key","concat","join","el","defaultValues","computedStyle","getComputedStyle","cssVariableResolver","varName","_defaultValues","value","getPropertyValue","createPreloadStyleElement","id","preloadStyleContent","style","createElement","innerHTML","head","appendChild","extractDistinctCssVariableExpressions","record","set","Set","values","forEach","getExpressionRanges","_ref","start","end","expression","substring","includes","add","getActiveThemes","themeKey","themeRegistration","_custom$baseThemeKey","custom","find","theme","baseThemeKey","base","error","debug","getDefaultBaseThemes","name","styleContent","getDefaultSelectedThemeKey","_ref2","_getThemeKeyOverride","_getThemePreloadData","getThemeKeyOverride","getThemePreloadData","getThemeKey","pluginName","themeName","searchParams","URLSearchParams","window","location","search","get","data","localStorage","getItem","JSON","parse","_unused","_NON_WHITESPACE_REGEX","_NON_WHITESPACE_REGEX2","ranges","exec","index","parenLevel","i","length","test","push","isBaseThemeKey","isExternalThemeData","maybeExternalThemeData","cssVars","isExternalThemeEnabled","isPreloadTransparentTheme","isValidColorVar","CSS","supports","parseExternalThemeData","_ref3","toExpression","_ref4","varValue","sanitized","entries","filter","str","replaceSVGFillColor","svgContent","fillColor","replace","encodeURIComponent","requestExternalThemeData","_requestExternalThemeData","apply","arguments","_asyncToGenerator","result","Error","stringify","resolveCssVariablesInRecord","targetElement","undefined","isAlphaOptional","perfStart","performance","now","tmpPropEl","display","recordArray","_ref5","setProperty","backgroundColor","tempPropElComputedStyle","_ref6","resolved","containsCssVar","isColor","children","color","normalizeCssColor","remove","resolveCssVariablesInString","resolver","_ref7","setThemePreloadData","preloadData","setItem","preloadTheme","_getThemePreloadData2","previousPreloadStyleContent","defaultPreloadStyleContent","overrideSVGFillColors","_ref8","removeProperty","newSVGContent"],"sources":["../../src/theme/ThemeUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport {\n assertNotNull,\n ColorUtils,\n requestParentResponse,\n} from '@deephaven/utils';\nimport { themeDark } from './theme-dark';\nimport { themeLight } from './theme-light';\nimport {\n DEFAULT_DARK_THEME_KEY,\n DEFAULT_LIGHT_THEME_KEY,\n DEFAULT_PRELOAD_DATA_VARIABLES,\n type BaseThemeKey,\n type ThemeData,\n type ThemePreloadData,\n type CssVariableStyleContent,\n type ThemePreloadColorVariable,\n type ThemeRegistrationData,\n THEME_CACHE_LOCAL_STORAGE_KEY,\n SVG_ICON_MANUAL_COLOR_MAP,\n type ThemeCssVariableName,\n type ThemeIconsRequiringManualColorChanges,\n THEME_KEY_OVERRIDE_QUERY_PARAM,\n EXTERNAL_THEME_KEY,\n type ExternalThemeData,\n MSG_REQUEST_GET_THEME,\n type ThemeCssColorVariableName,\n TRANSPARENT_PRELOAD_DATA_VARIABLES,\n PRELOAD_TRANSPARENT_THEME_QUERY_PARAM,\n} from './ThemeModel';\n\nconst log = Log.module('ThemeUtils');\n\nexport const CSS_VAR_EXPRESSION_PREFIX = 'var(--';\nexport const DH_VAR_PREFIX = '--dh-color-';\nexport const TMP_CSS_PROP_PREFIX = 'dh-tmp';\nexport const NON_WHITESPACE_REGEX = /\\S/;\nexport const WHITESPACE_REGEX = /\\s/;\n\nexport const DH_CSS_VAR_NAME_REGEXP = /^--dh-color-[a-z0-9_-]+$/;\n\nexport type VarExpressionResolver = (varExpression: string) => string;\n\n/**\n * Resolves the current values of CSS variables we want to preload. Preloading\n * happens before themes are fully loaded so that we can style things like the\n * loading spinner and background color which are shown to the user early on in\n * the app lifecycle.\n * @defaultPreloadValues Default values to use if a preload variable is not set.\n */\nexport function calculatePreloadStyleContent(\n defaultPreloadValues: Record<string, string>\n): CssVariableStyleContent {\n const resolveVar = createCssVariableResolver(\n document.body,\n defaultPreloadValues\n );\n\n // Calculate the current preload variables. If the variable is not set, use\n // the default value.\n const pairs = Object.keys(defaultPreloadValues).map(\n key => `${key}:${resolveVar(key as ThemePreloadColorVariable)}`\n );\n\n return `:root{${pairs.join(';')}}`;\n}\n\n/**\n * Create a resolver function for calculating the value of a css variable based\n * on a given element's computed style. If the variable resolves to '', we check\n * `defaultValues` for a default value, and if one does not exist,\n * return ''.\n * @param el Element to resolve css variables against\n * @param defaultValues Default values to use if a variable is not set.\n */\nexport function createCssVariableResolver(\n el: Element,\n defaultValues: Record<string, string>\n): (varName: ThemeCssVariableName) => string {\n const computedStyle = getComputedStyle(el);\n\n /**\n * Resolve the given css variable name to a value. If the variable is not set,\n * return the default preload value or '' if one does not exist.\n */\n return function cssVariableResolver(varName: ThemeCssVariableName): string {\n const value = computedStyle.getPropertyValue(varName);\n\n if (value !== '') {\n return value;\n }\n\n return defaultValues[varName as ThemePreloadColorVariable] ?? '';\n };\n}\n\n/**\n * Create a style tag containing preload css variables and add to the head.\n * @param id The id of the style tag\n * @param preloadStyleContent The css variable content to add to the style tag\n */\nexport function createPreloadStyleElement(\n id: `theme-preload-${string}`,\n preloadStyleContent: CssVariableStyleContent\n): void {\n const style = document.createElement('style');\n style.id = id;\n style.innerHTML = preloadStyleContent;\n document.head.appendChild(style);\n}\n\n/**\n * Extracts all css variable expressions from the given record and returns\n * a set of unique expressions.\n * @param record The record to extract css variable expressions from\n */\nexport function extractDistinctCssVariableExpressions(\n record: Record<string, string>\n): Set<string> {\n const set = new Set<string>();\n\n Object.values(record).forEach(value => {\n getExpressionRanges(value).forEach(([start, end]) => {\n const expression = value.substring(start, end + 1);\n\n if (expression.includes(CSS_VAR_EXPRESSION_PREFIX)) {\n set.add(expression);\n }\n });\n });\n\n return set;\n}\n\n/**\n * Returns an array of the active themes. The first item will always be one\n * of the base themes. Optionally, the second item will be a custom theme.\n */\nexport function getActiveThemes(\n themeKey: string,\n themeRegistration: ThemeRegistrationData\n): [ThemeData] | [ThemeData, ThemeData] {\n const custom = themeRegistration.custom.find(\n theme => theme.themeKey === themeKey\n );\n\n const baseThemeKey = custom?.baseThemeKey ?? themeKey;\n\n let base = themeRegistration.base.find(\n theme => theme.themeKey === baseThemeKey\n );\n\n if (base == null) {\n log.error(\n `No registered base theme found for theme key: '${baseThemeKey}'`,\n 'Registered:',\n themeRegistration.base.map(theme => theme.themeKey),\n themeRegistration.custom.map(theme => theme.themeKey)\n );\n base = themeRegistration.base.find(\n theme => theme.themeKey === DEFAULT_DARK_THEME_KEY\n );\n\n assertNotNull(\n base,\n `Default base theme '${DEFAULT_DARK_THEME_KEY}' is not registered`\n );\n }\n\n log.debug('Applied themes:', base.themeKey, custom?.themeKey);\n\n return custom == null ? [base] : [base, custom];\n}\n\n/**\n * Get default base theme data.\n */\nexport function getDefaultBaseThemes(): ThemeData[] {\n return [\n {\n name: 'Default Dark',\n themeKey: DEFAULT_DARK_THEME_KEY,\n styleContent: themeDark,\n },\n // The ThemePicker shows whenever more than 1 theme is available. Disable\n // light theme for now to keep the picker hidden until it is fully\n // implemented by #1539.\n {\n name: 'Default Light',\n themeKey: DEFAULT_LIGHT_THEME_KEY,\n styleContent: themeLight,\n },\n ];\n}\n\n/**\n * Get the default selected theme key. Precedence is:\n * 1. Theme key override query parameter\n * 2. Theme key from preload data\n * 3. Default dark theme key\n * @returns The default selected theme key\n */\nexport function getDefaultSelectedThemeKey(): string {\n return (\n getThemeKeyOverride() ??\n getThemePreloadData()?.themeKey ??\n DEFAULT_DARK_THEME_KEY\n );\n}\n\n/**\n * Derive unique theme key from plugin root path and theme name.\n * @param pluginName The root path of the plugin\n * @param themeName The name of the theme\n */\nexport function getThemeKey(pluginName: string, themeName: string): string {\n return `${pluginName}_${themeName}`;\n}\n\n/**\n * A theme key override can be set via a query parameter to force a specific\n * theme selection. Useful for embedded widget scenarios that don't expose the\n * theme selector.\n */\nexport function getThemeKeyOverride(): string | null {\n const searchParams = new URLSearchParams(window.location.search);\n return searchParams.get(THEME_KEY_OVERRIDE_QUERY_PARAM);\n}\n\n/**\n * Get the preload data from local storage or null if it does not exist or is\n * invalid\n */\nexport function getThemePreloadData(): ThemePreloadData | null {\n const data = localStorage.getItem(THEME_CACHE_LOCAL_STORAGE_KEY);\n\n try {\n return data == null ? null : JSON.parse(data);\n } catch {\n // ignore\n }\n\n return null;\n}\n\n/**\n * Identifies start and end indices of any top-level expressions in the given\n * string.\n *\n * e.g.\n * getExpressionRanges('var(--aaa-aa) #fff var(--bbb-bb)')\n * yields:\n * [\n * [0, 12], // 'var(--aaa-aa)'\n * [14, 17] // '#fff'\n * [19, 31], // 'var(--bbb-bb)'\n * ]\n *\n * In cases where there are nested expressions, only the indices of the outermost\n * expression will be included.\n *\n * e.g.\n * getExpressionRanges('var(--ccc-cc, var(--aaa-aa, green)) var(--bbb-bb)')\n * yields:\n * [\n * [0, 34], // 'var(--ccc-cc, var(--aaa-aa, green))'\n * [36, 48], // 'var(--bbb-bb)'\n * ]\n * @param value The string to search for expressions\n * @returns An array of [start, end] index pairs for each expression\n */\nexport function getExpressionRanges(value: string): [number, number][] {\n const ranges: [number, number][] = [];\n\n let start = NON_WHITESPACE_REGEX.exec(value)?.index ?? 0;\n let parenLevel = 0;\n\n for (let i = 0; i < value.length; i += 1) {\n if (value[i] === '(') {\n parenLevel += 1;\n } else if (value[i] === ')') {\n parenLevel -= 1;\n }\n\n if (\n i === value.length - 1 ||\n (WHITESPACE_REGEX.test(value[i + 1]) && parenLevel === 0)\n ) {\n ranges.push([start, i]);\n\n while (i < value.length - 1 && WHITESPACE_REGEX.test(value[i + 1])) {\n i += 1;\n }\n\n start = i + 1;\n }\n }\n\n if (parenLevel !== 0) {\n log.error('Unbalanced parentheses in css var expression', value);\n return [];\n }\n\n return ranges;\n}\n\n/**\n * Check if the given theme key is one of the base themes.\n * @param themeKey The theme key to check\n * @returns True if the theme key is a base theme key, false otherwise\n */\nexport function isBaseThemeKey(themeKey: string): themeKey is BaseThemeKey {\n return [DEFAULT_DARK_THEME_KEY, DEFAULT_LIGHT_THEME_KEY].includes(themeKey);\n}\n\n/**\n * Determine if a given object is a `ExternalThemeData` object.\n * @param maybeExternalThemeData An object that may or may not be a `ExternalThemeData`\n * @returns True if the object is a `ExternalThemeData`, false otherwise\n */\nexport function isExternalThemeData(\n maybeExternalThemeData: unknown\n): maybeExternalThemeData is ExternalThemeData {\n if (\n typeof maybeExternalThemeData !== 'object' ||\n maybeExternalThemeData == null\n ) {\n return false;\n }\n\n return (\n 'name' in maybeExternalThemeData &&\n typeof maybeExternalThemeData.name === 'string' &&\n 'cssVars' in maybeExternalThemeData &&\n typeof maybeExternalThemeData.cssVars === 'object' &&\n maybeExternalThemeData.cssVars != null\n );\n}\n\n/**\n * Check if the current URL specifies an external theme key override.\n * @returns True if the external theme key override is set, false otherwise\n */\nexport function isExternalThemeEnabled(): boolean {\n const searchParams = new URLSearchParams(window.location.search);\n return (\n searchParams.get(THEME_KEY_OVERRIDE_QUERY_PARAM) === EXTERNAL_THEME_KEY\n );\n}\n\n/**\n * Check if PRELOAD_TRANSPARENT_THEME_QUERY_PARAM query parameter is set to true.\n * @returns True if the preload transparent theme query parameter is set, false\n * otherwise\n */\nexport function isPreloadTransparentTheme(): boolean {\n const searchParams = new URLSearchParams(window.location.search);\n return searchParams.get(PRELOAD_TRANSPARENT_THEME_QUERY_PARAM) === 'true';\n}\n\n/**\n * Validate that a given CSS variable name / value pair is a valid Deephaven\n * color variable.\n * @param name The name of the CSS variable to validate, e.g. '--dh-color-primary'\n * @param value The value of the CSS color to validate\n * @returns True if the name is a valid Deephaven color variable and the value\n * is a valid CSS color, false otherwise\n */\nexport function isValidColorVar(\n name: string,\n value: string\n): name is ThemeCssColorVariableName {\n return DH_CSS_VAR_NAME_REGEXP.test(name) && CSS.supports('color', value);\n}\n\n/**\n * Parse external theme data into a `ThemeData` object. Invalid CSS color variable\n * pairs are excluded from the resulting `ThemeData` object.\n * @param externalThemeData The external theme data to parse\n * @returns A `ThemeData` object representing the external theme\n */\nexport function parseExternalThemeData({\n baseThemeKey = DEFAULT_DARK_THEME_KEY,\n name,\n cssVars,\n}: ExternalThemeData): ThemeData {\n const toExpression = ([varName, varValue]: [string, string]) =>\n isValidColorVar(varName, varValue) ? `${varName}:${varValue};` : null;\n\n const sanitized = Object.entries(cssVars)\n .map(toExpression)\n .filter((str): str is string => str != null);\n\n const styleContent =\n sanitized.length === 0 ? '' : `:root{${sanitized.join('')}}`;\n\n return {\n baseThemeKey,\n themeKey: EXTERNAL_THEME_KEY,\n name,\n styleContent,\n };\n}\n\n/**\n * Replace the `fill='...'` attribute in the given SVG content with the given\n * color string.\n * @param svgContent Inline SVG content to replace the fill color in\n * @param fillColor The color to replace the fill color with\n */\nexport function replaceSVGFillColor(\n svgContent: string,\n fillColor: string\n): string {\n return svgContent.replace(\n /fill='.*?'/,\n `fill='${encodeURIComponent(fillColor)}'`\n );\n}\n\n/**\n * Request theme data from the parent window.\n * @returns A promise that resolves to the external theme data\n * @throws Error if the response is not a valid `ExternalThemeData`\n */\nexport async function requestExternalThemeData(): Promise<ExternalThemeData> {\n const result = await requestParentResponse(MSG_REQUEST_GET_THEME);\n\n if (!isExternalThemeData(result)) {\n throw new Error(\n `Unexpected external theme data response: ${JSON.stringify(result)}`\n );\n }\n\n return result;\n}\n\n/**\n * Make a copy of the given object replacing any css variable expressions\n * contained in its prop values with values resolved from the given HTML element.\n * Variables that resolve to color strings will also be normalized to 8 digit\n * hex values (or optionally 6 digit hex if `isAlphaOptional` is true).\n *\n * Note that the browser will force a reflow when calling `getComputedStyle` if\n * css properties have changed. In order to avoid a reflow for every property\n * check we use distinct setup, resolve / normalize, and cleanup passes:\n * 1. Setup - Create a tmp element and set all css props we want to evaluate\n * 2. Resolve / Normalize - Evaluate all css props via `getPropertyValue` calls\n * and replace the original expressions with resolved values. Also normalize\n * css colors to rgb/a.\n * 3. Cleanup - Remove the tmp element\n * @param record An object whose values may contain css var expressions\n * @param targetElement The element to resolve css variables against. Defaults\n * to document.body\n * @param isAlphaOptional If true, the alpha value will be dropped from resolved\n * 8 character hex colors if it is 'ff'. Defaults to false.\n */\nexport function resolveCssVariablesInRecord<T extends Record<string, string>>(\n record: T,\n targetElement: HTMLElement = document.body,\n isAlphaOptional = false\n): T {\n const perfStart = performance.now();\n\n // Add a temporary div to attach temp css variables to\n const tmpPropEl = document.createElement('div');\n tmpPropEl.style.display = 'none';\n\n const recordArray = Object.entries(record);\n recordArray.forEach(([, value], i) => {\n tmpPropEl.style.setProperty(`--${TMP_CSS_PROP_PREFIX}-${i}`, value);\n // faster to create these now all at once, even if we don't use them all\n // since the parent isn't added yet to the DOM\n const el = document.createElement('div');\n // use background color instead of color to avoid inherited values\n el.style.backgroundColor = value;\n tmpPropEl.appendChild(el);\n });\n\n // append only once to avoid multiple re-layouts\n // must be part of DOM to get computed color\n targetElement.appendChild(tmpPropEl);\n const tempPropElComputedStyle = window.getComputedStyle(tmpPropEl);\n\n const result = {} as T;\n recordArray.forEach(([key, value], i) => {\n // resolves any variables in the expression\n let resolved = tempPropElComputedStyle.getPropertyValue(\n `--${TMP_CSS_PROP_PREFIX}-${i}`\n );\n\n const containsCssVar = value.includes(CSS_VAR_EXPRESSION_PREFIX);\n const isColor = CSS.supports('color', resolved);\n\n if (\n // only try to normalize non-hex strings that are valid colors\n // otherwise non-colors will be made #00000000\n isColor &&\n !/^#[0-9A-F]{6}[0-9a-f]{0,2}$/i.test(resolved)\n ) {\n // getting the computed background color is necessary\n // because resolved can still contain a color-mix() function\n const el = tmpPropEl.children[i] as HTMLDivElement;\n const computedStyle = window.getComputedStyle(el);\n const color = computedStyle.getPropertyValue('background-color');\n // convert color to hex, which is what monaco and plotly require\n resolved = ColorUtils.normalizeCssColor(color, isAlphaOptional);\n }\n (result as Record<string, string>)[key] =\n containsCssVar || isColor ? resolved : value;\n });\n\n // Remove the temporary div\n tmpPropEl.remove();\n\n log.debug('Resolved css variables', performance.now() - perfStart, 'ms');\n\n return result;\n}\n\n/**\n * Resolve css variable expressions in the given string using the\n * given resolver and replace the original expressions with the resolved values.\n *\n * @param resolver Function that can resolve a css variable expression\n * @param value Value that may contain css variable expressions\n */\nexport function resolveCssVariablesInString(\n resolver: VarExpressionResolver,\n value: string\n): string {\n const result: string[] = [];\n let i = 0;\n getExpressionRanges(value).forEach(([start, end]) => {\n if (i < start) {\n result.push(value.substring(i, start));\n i += start - i;\n }\n\n const expression = value.substring(start, end + 1);\n\n result.push(\n expression.includes(CSS_VAR_EXPRESSION_PREFIX)\n ? resolver(expression)\n : expression\n );\n\n i += end - start + 1;\n });\n\n if (result.length === 0) {\n return value;\n }\n\n return result.join('');\n}\n\n/**\n * Store theme preload data in local storage.\n * @param preloadData The preload data to set\n */\nexport function setThemePreloadData(preloadData: ThemePreloadData): void {\n localStorage.setItem(\n THEME_CACHE_LOCAL_STORAGE_KEY,\n JSON.stringify(preloadData)\n );\n}\n\n/**\n * Preload minimal theme variables from the cache.\n * @defaultPreloadValues Optional default values to use if a preload variable is not set.\n */\nexport function preloadTheme(\n defaultPreloadValues: Record<string, string> = DEFAULT_PRELOAD_DATA_VARIABLES\n): void {\n // In certain cases we may want to preload a transparent theme to allow the\n // parent container to show through. For example, when a parent Window is\n // providing a theme via `postMessage` apis, we may not have enough information\n // to properly preload the theme, so we can just preload a transparent\n // theme and let the parent container show through until `postMessage`\n // communication is complete.\n if (isPreloadTransparentTheme()) {\n createPreloadStyleElement(\n 'theme-preload-transparent',\n calculatePreloadStyleContent(TRANSPARENT_PRELOAD_DATA_VARIABLES)\n );\n return;\n }\n\n const previousPreloadStyleContent =\n getThemePreloadData()?.preloadStyleContent;\n\n const defaultPreloadStyleContent =\n calculatePreloadStyleContent(defaultPreloadValues);\n\n log.debug('Preloading theme content:', {\n defaultPreloadStyleContent,\n previousPreloadStyleContent,\n });\n\n createPreloadStyleElement(\n 'theme-preload-defaults',\n defaultPreloadStyleContent\n );\n\n // Any preload variables that were saved by last theme load should override\n // the defaults\n if (previousPreloadStyleContent != null) {\n createPreloadStyleElement(\n 'theme-preload-previous',\n previousPreloadStyleContent\n );\n }\n}\n\n/**\n * Inline SVGs cannot depend on dynamic CSS variables, so we have to statically\n * update them if we want to change their color.\n *\n * This function:\n * 1. Clears any previous overrides\n * 2. Resolves CSS variables containing inline SVG urls\n * 3. Resolves mapped color variables and replaces the `fill='...'` attribute with the result\n * 4. Sets the original CSS variable to the new replaced value\n *\n * Note that it is preferable to use inline SVGs as background-mask values and\n * just change the background color instead of relying on this util, but this\n * is not always possible. e.g. <select> elements don't support pseudo elements,\n * so there's not a good way to set icons via masks.\n * @param defaultValues Default values to use if a variable is not set.\n */\nexport function overrideSVGFillColors(\n defaultValues: Record<string, string>\n): void {\n const resolveVar = createCssVariableResolver(document.body, defaultValues);\n\n Object.entries(SVG_ICON_MANUAL_COLOR_MAP).forEach(([key, value]) => {\n // Clear any previous override so that our variables get resolved against the\n // actual svg content provided by the active themes and not from a previous\n // override\n document.body.style.removeProperty(key);\n\n const svgContent = resolveVar(key as ThemeIconsRequiringManualColorChanges);\n const fillColor = resolveVar(value as ThemePreloadColorVariable);\n\n const newSVGContent = replaceSVGFillColor(svgContent, fillColor);\n\n // This will take precedence over any values for the variable provided by\n // the active themes\n document.body.style.setProperty(key, newSVGContent);\n });\n}\n"],"mappings":";;AAAA,OAAOA,GAAG,MAAM,gBAAgB;AAChC,SACEC,aAAa,EACbC,UAAU,EACVC,qBAAqB,QAChB,kBAAkB;AAAC,SACjBC,SAAS;AAAA,SACTC,UAAU;AAAA,SAEjBC,sBAAsB,EACtBC,uBAAuB,EACvBC,8BAA8B,EAO9BC,6BAA6B,EAC7BC,yBAAyB,EAGzBC,8BAA8B,EAC9BC,kBAAkB,EAElBC,qBAAqB,EAErBC,kCAAkC,EAClCC,qCAAqC;AAGvC,IAAMC,GAAG,GAAGhB,GAAG,CAACiB,MAAM,CAAC,YAAY,CAAC;AAEpC,OAAO,IAAMC,yBAAyB,GAAG,QAAQ;AACjD,OAAO,IAAMC,aAAa,GAAG,aAAa;AAC1C,OAAO,IAAMC,mBAAmB,GAAG,QAAQ;AAC3C,OAAO,IAAMC,oBAAoB,GAAG,IAAI;AACxC,OAAO,IAAMC,gBAAgB,GAAG,IAAI;AAEpC,OAAO,IAAMC,sBAAsB,GAAG,0BAA0B;AAIhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAC1CC,oBAA4C,EACnB;EACzB,IAAMC,UAAU,GAAGC,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A2B,IAAI,IAAI,EAAE;IACvChI,yBAAyB,CACvB,wBAAwB,EACxBgI,2BACF,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,qBAAqBA,CACnC1I,aAAqC,EAC/B;EACN,IAAMZ,UAAU,GAAGC,yBAAyB,CAACC,QAAQ,CAACC,IAAI,EAAES,aAAa,CAAC;EAE1EP,MAAM,CAACiG,OAAO,CAACtH,yBAAyB,CAAC,CAACiD,OAAO,CAACsH,KAAA,IAAkB;IAAA,IAAjB,CAAC/I,GAAG,EAAEU,KAAK,CAAC,GAAAqI,KAAA;IAC7D;IACA;IACA;IACArJ,QAAQ,CAACC,IAAI,CAACoB,KAAK,CAACiI,cAAc,CAAChJ,GAAG,CAAC;IAEvC,IAAMkG,UAAU,GAAG1G,UAAU,CAACQ,GAA4C,CAAC;IAC3E,IAAMmG,SAAS,GAAG3G,UAAU,CAACkB,KAAkC,CAAC;IAEhE,IAAMuI,aAAa,GAAGhD,mBAAmB,CAACC,UAAU,EAAEC,SAAS,CAAC;;IAEhE;IACA;IACAzG,QAAQ,CAACC,IAAI,CAACoB,KAAK,CAAC0G,WAAW,CAACzH,GAAG,EAAEiJ,aAAa,CAAC;EACrD,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"colorUtils.js","names":["ColorValues","isDHColorValue","value","includes","colorValueStyle","concat"],"sources":["../../src/theme/colorUtils.ts"],"sourcesContent":["import { type CSSProperties } from 'react';\n\n/**\n * Color values for the DH color palette exposed to end users in spectrum components.\n */\nexport const ColorValues = [\n 'gray-50',\n 'gray-75',\n 'gray-100',\n 'gray-200',\n 'gray-300',\n 'gray-400',\n 'gray-500',\n 'gray-600',\n 'gray-700',\n 'gray-800',\n 'gray-900',\n 'red-100',\n 'red-200',\n 'red-300',\n 'red-400',\n 'red-500',\n 'red-600',\n 'red-700',\n 'red-800',\n 'red-900',\n 'red-1000',\n 'red-1100',\n 'red-1200',\n 'red-1300',\n 'red-1400',\n 'orange-100',\n 'orange-200',\n 'orange-300',\n 'orange-400',\n 'orange-500',\n 'orange-600',\n 'orange-700',\n 'orange-800',\n 'orange-900',\n 'orange-1000',\n 'orange-1100',\n 'orange-1200',\n 'orange-1300',\n 'orange-1400',\n 'yellow-100',\n 'yellow-200',\n 'yellow-300',\n 'yellow-400',\n 'yellow-500',\n 'yellow-600',\n 'yellow-700',\n 'yellow-800',\n 'yellow-900',\n 'yellow-1000',\n 'yellow-1100',\n 'yellow-1200',\n 'yellow-1300',\n 'yellow-1400',\n 'chartreuse-100',\n 'chartreuse-200',\n 'chartreuse-300',\n 'chartreuse-400',\n 'chartreuse-500',\n 'chartreuse-600',\n 'chartreuse-700',\n 'chartreuse-800',\n 'chartreuse-900',\n 'chartreuse-1000',\n 'chartreuse-1100',\n 'chartreuse-1200',\n 'chartreuse-1300',\n 'chartreuse-1400',\n 'celery-100',\n 'celery-200',\n 'celery-300',\n 'celery-400',\n 'celery-500',\n 'celery-600',\n 'celery-700',\n 'celery-800',\n 'celery-900',\n 'celery-1000',\n 'celery-1100',\n 'celery-1200',\n 'celery-1300',\n 'celery-1400',\n 'green-100',\n 'green-200',\n 'green-300',\n 'green-400',\n 'green-500',\n 'green-600',\n 'green-700',\n 'green-800',\n 'green-900',\n 'green-1000',\n 'green-1100',\n 'green-1200',\n 'green-1300',\n 'green-1400',\n 'seafoam-100',\n 'seafoam-200',\n 'seafoam-300',\n 'seafoam-400',\n 'seafoam-500',\n 'seafoam-600',\n 'seafoam-700',\n 'seafoam-800',\n 'seafoam-900',\n 'seafoam-1000',\n 'seafoam-1100',\n 'seafoam-1200',\n 'seafoam-1300',\n 'seafoam-1400',\n 'cyan-100',\n 'cyan-200',\n 'cyan-300',\n 'cyan-400',\n 'cyan-500',\n 'cyan-600',\n 'cyan-700',\n 'cyan-800',\n 'cyan-900',\n 'cyan-1000',\n 'cyan-1100',\n 'cyan-1200',\n 'cyan-1300',\n 'cyan-1400',\n 'blue-100',\n 'blue-200',\n 'blue-300',\n 'blue-400',\n 'blue-500',\n 'blue-600',\n 'blue-700',\n 'blue-800',\n 'blue-900',\n 'blue-1000',\n 'blue-1100',\n 'blue-1200',\n 'blue-1300',\n 'blue-1400',\n 'indigo-100',\n 'indigo-200',\n 'indigo-300',\n 'indigo-400',\n 'indigo-500',\n 'indigo-600',\n 'indigo-700',\n 'indigo-800',\n 'indigo-900',\n 'indigo-1000',\n 'indigo-1100',\n 'indigo-1200',\n 'indigo-1300',\n 'indigo-1400',\n 'purple-100',\n 'purple-200',\n 'purple-300',\n 'purple-400',\n 'purple-500',\n 'purple-600',\n 'purple-700',\n 'purple-800',\n 'purple-900',\n 'purple-1000',\n 'purple-1100',\n 'purple-1200',\n 'purple-1300',\n 'purple-1400',\n 'fuchsia-100',\n 'fuchsia-200',\n 'fuchsia-300',\n 'fuchsia-400',\n 'fuchsia-500',\n 'fuchsia-600',\n 'fuchsia-700',\n 'fuchsia-800',\n 'fuchsia-900',\n 'fuchsia-1000',\n 'fuchsia-1100',\n 'fuchsia-1200',\n 'fuchsia-1300',\n 'fuchsia-1400',\n 'magenta-100',\n 'magenta-200',\n 'magenta-300',\n 'magenta-400',\n 'magenta-500',\n 'magenta-600',\n 'magenta-700',\n 'magenta-800',\n 'magenta-900',\n 'magenta-1000',\n 'magenta-1100',\n 'magenta-1200',\n 'magenta-1300',\n 'magenta-1400',\n 'negative',\n 'notice',\n 'positive',\n 'info',\n // Additional DH ColorValues:\n 'accent',\n 'accent-100',\n 'accent-200',\n 'accent-300',\n 'accent-400',\n 'accent-500',\n 'accent-600',\n 'accent-700',\n 'accent-800',\n 'accent-900',\n 'accent-1000',\n 'accent-1100',\n 'accent-1200',\n 'accent-1300',\n 'accent-1400',\n 'bg',\n 'content-bg',\n 'subdued-content-bg',\n 'surface-bg',\n 'fg',\n] as const;\n\ntype DHColorValue = (typeof ColorValues)[number];\n\nexport type ColorValue = DHColorValue | CSSProperties['color'];\n\nexport function isDHColorValue(value: string): value is DHColorValue {\n return (\n typeof value === 'string' && ColorValues.includes(value as DHColorValue)\n );\n}\n\n/**\n * Returns the a css variable color value for a given theme color.\n * If the color value is a DH color value, it returns the CSS variable.\n * Otherwise, it returns the color value as is.\n *\n * @param value a string representing a color value\n * @returns CSS variable for DH color values, otherwise the color value as is\n *\n * ex. colorValueStyle('blue-1000') => 'var(--dh-color-blue-1000)'\n * ex. colorValueStyle('red') => 'red'\n * ex. colorValueStyle('#F00') => '#F00'\n */\nexport function colorValueStyle(value: string): string;\nexport function colorValueStyle(value: string | undefined): string | undefined;\nexport function colorValueStyle(value: string | undefined): string | undefined {\n if (value != null && isDHColorValue(value)) {\n return `var(--dh-color-${value})`;\n }\n\n return value;\n}\n"],"mappings":"AAEA;AACA;AACA;AACA,OAAO,IAAMA,WAAW,GAAG,CACzB,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB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,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM;AACN;AACA,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,IAAI,EACJ,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,IAAI,CACI;AAMV,OAAO,SAASC,cAAcA,CAACC,KAAa,EAAyB;EACnE,OACE,OAAOA,KAAK,KAAK,QAAQ,IAAIF,WAAW,CAACG,QAAQ,CAACD,KAAqB,CAAC;AAE5E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAO,SAASE,eAAeA,CAACF,KAAyB,EAAsB;EAC7E,IAAIA,KAAK,IAAI,IAAI,IAAID,cAAc,CAACC,KAAK,CAAC,EAAE;IAC1C,yBAAAG,MAAA,CAAyBH,KAAK;EAChC;EAEA,OAAOA,KAAK;AACd"}
1
+ {"version":3,"file":"colorUtils.js","names":["ColorValues","isDHColorValue","value","includes","colorValueStyle","concat"],"sources":["../../src/theme/colorUtils.ts"],"sourcesContent":["import { type CSSProperties } from 'react';\n\n/**\n * Color values for the DH color palette exposed to end users in spectrum components.\n */\nexport const ColorValues = [\n 'gray-50',\n 'gray-75',\n 'gray-100',\n 'gray-200',\n 'gray-300',\n 'gray-400',\n 'gray-500',\n 'gray-600',\n 'gray-700',\n 'gray-800',\n 'gray-900',\n 'red-100',\n 'red-200',\n 'red-300',\n 'red-400',\n 'red-500',\n 'red-600',\n 'red-700',\n 'red-800',\n 'red-900',\n 'red-1000',\n 'red-1100',\n 'red-1200',\n 'red-1300',\n 'red-1400',\n 'orange-100',\n 'orange-200',\n 'orange-300',\n 'orange-400',\n 'orange-500',\n 'orange-600',\n 'orange-700',\n 'orange-800',\n 'orange-900',\n 'orange-1000',\n 'orange-1100',\n 'orange-1200',\n 'orange-1300',\n 'orange-1400',\n 'yellow-100',\n 'yellow-200',\n 'yellow-300',\n 'yellow-400',\n 'yellow-500',\n 'yellow-600',\n 'yellow-700',\n 'yellow-800',\n 'yellow-900',\n 'yellow-1000',\n 'yellow-1100',\n 'yellow-1200',\n 'yellow-1300',\n 'yellow-1400',\n 'chartreuse-100',\n 'chartreuse-200',\n 'chartreuse-300',\n 'chartreuse-400',\n 'chartreuse-500',\n 'chartreuse-600',\n 'chartreuse-700',\n 'chartreuse-800',\n 'chartreuse-900',\n 'chartreuse-1000',\n 'chartreuse-1100',\n 'chartreuse-1200',\n 'chartreuse-1300',\n 'chartreuse-1400',\n 'celery-100',\n 'celery-200',\n 'celery-300',\n 'celery-400',\n 'celery-500',\n 'celery-600',\n 'celery-700',\n 'celery-800',\n 'celery-900',\n 'celery-1000',\n 'celery-1100',\n 'celery-1200',\n 'celery-1300',\n 'celery-1400',\n 'green-100',\n 'green-200',\n 'green-300',\n 'green-400',\n 'green-500',\n 'green-600',\n 'green-700',\n 'green-800',\n 'green-900',\n 'green-1000',\n 'green-1100',\n 'green-1200',\n 'green-1300',\n 'green-1400',\n 'seafoam-100',\n 'seafoam-200',\n 'seafoam-300',\n 'seafoam-400',\n 'seafoam-500',\n 'seafoam-600',\n 'seafoam-700',\n 'seafoam-800',\n 'seafoam-900',\n 'seafoam-1000',\n 'seafoam-1100',\n 'seafoam-1200',\n 'seafoam-1300',\n 'seafoam-1400',\n 'cyan-100',\n 'cyan-200',\n 'cyan-300',\n 'cyan-400',\n 'cyan-500',\n 'cyan-600',\n 'cyan-700',\n 'cyan-800',\n 'cyan-900',\n 'cyan-1000',\n 'cyan-1100',\n 'cyan-1200',\n 'cyan-1300',\n 'cyan-1400',\n 'blue-100',\n 'blue-200',\n 'blue-300',\n 'blue-400',\n 'blue-500',\n 'blue-600',\n 'blue-700',\n 'blue-800',\n 'blue-900',\n 'blue-1000',\n 'blue-1100',\n 'blue-1200',\n 'blue-1300',\n 'blue-1400',\n 'indigo-100',\n 'indigo-200',\n 'indigo-300',\n 'indigo-400',\n 'indigo-500',\n 'indigo-600',\n 'indigo-700',\n 'indigo-800',\n 'indigo-900',\n 'indigo-1000',\n 'indigo-1100',\n 'indigo-1200',\n 'indigo-1300',\n 'indigo-1400',\n 'purple-100',\n 'purple-200',\n 'purple-300',\n 'purple-400',\n 'purple-500',\n 'purple-600',\n 'purple-700',\n 'purple-800',\n 'purple-900',\n 'purple-1000',\n 'purple-1100',\n 'purple-1200',\n 'purple-1300',\n 'purple-1400',\n 'fuchsia-100',\n 'fuchsia-200',\n 'fuchsia-300',\n 'fuchsia-400',\n 'fuchsia-500',\n 'fuchsia-600',\n 'fuchsia-700',\n 'fuchsia-800',\n 'fuchsia-900',\n 'fuchsia-1000',\n 'fuchsia-1100',\n 'fuchsia-1200',\n 'fuchsia-1300',\n 'fuchsia-1400',\n 'magenta-100',\n 'magenta-200',\n 'magenta-300',\n 'magenta-400',\n 'magenta-500',\n 'magenta-600',\n 'magenta-700',\n 'magenta-800',\n 'magenta-900',\n 'magenta-1000',\n 'magenta-1100',\n 'magenta-1200',\n 'magenta-1300',\n 'magenta-1400',\n 'negative',\n 'notice',\n 'positive',\n 'info',\n // Additional DH ColorValues:\n 'accent',\n 'accent-100',\n 'accent-200',\n 'accent-300',\n 'accent-400',\n 'accent-500',\n 'accent-600',\n 'accent-700',\n 'accent-800',\n 'accent-900',\n 'accent-1000',\n 'accent-1100',\n 'accent-1200',\n 'accent-1300',\n 'accent-1400',\n 'bg',\n 'content-bg',\n 'subdued-content-bg',\n 'surface-bg',\n 'fg',\n] as const;\n\ntype DHColorValue = (typeof ColorValues)[number];\n\nexport type ColorValue = DHColorValue | CSSProperties['color'];\n\nexport function isDHColorValue(value: string): value is DHColorValue {\n return (\n typeof value === 'string' && ColorValues.includes(value as DHColorValue)\n );\n}\n\n/**\n * Returns the a css variable color value for a given theme color.\n * If the color value is a DH color value, it returns the CSS variable.\n * Otherwise, it returns the color value as is.\n *\n * @param value a string representing a color value\n * @returns CSS variable for DH color values, otherwise the color value as is\n *\n * ex. colorValueStyle('blue-1000') => 'var(--dh-color-blue-1000)'\n * ex. colorValueStyle('red') => 'red'\n * ex. colorValueStyle('#F00') => '#F00'\n */\nexport function colorValueStyle(value: string): string;\nexport function colorValueStyle(value: string | undefined): string | undefined;\nexport function colorValueStyle(value: string | undefined): string | undefined {\n if (value != null && isDHColorValue(value)) {\n return `var(--dh-color-${value})`;\n }\n\n return value;\n}\n"],"mappings":"AAEA;AACA;AACA;AACA,OAAO,IAAMA,WAAW,GAAG,CACzB,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aA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AAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM;AACN;AACA,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,IAAI,EACJ,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,IAAI,CACI;AAMV,OAAO,SAASC,cAAcA,CAACC,KAAa,EAAyB;EACnE,OACE,OAAOA,KAAK,KAAK,QAAQ,IAAIF,WAAW,CAACG,QAAQ,CAACD,KAAqB,CAAC;AAE5E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAO,SAASE,eAAeA,CAACF,KAAyB,EAAsB;EAC7E,IAAIA,KAAK,IAAI,IAAI,IAAID,cAAc,CAACC,KAAK,CAAC,EAAE;IAC1C,yBAAAG,MAAA,CAAyBH,KAAK;EAChC;EAEA,OAAOA,KAAK;AACd","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/theme/index.ts"],"sourcesContent":["export * from './theme-dark';\nexport * from './theme-light';\nexport * from './ThemeModel';\nexport * from './ThemePicker';\nexport * from './ThemeProvider';\nexport * from './ThemeUtils';\nexport * from './useTheme';\nexport * from './Logo';\nexport * from './colorUtils';\nexport * from './useExternalTheme';\nexport * from './useSpectrumThemeProvider';\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/theme/index.ts"],"sourcesContent":["export * from './theme-dark';\nexport * from './theme-light';\nexport * from './ThemeModel';\nexport * from './ThemePicker';\nexport * from './ThemeProvider';\nexport * from './ThemeUtils';\nexport * from './useTheme';\nexport * from './Logo';\nexport * from './colorUtils';\nexport * from './useExternalTheme';\nexport * from './useSpectrumThemeProvider';\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["themeDarkPalette","themeDarkSemantic","themeDarkSemanticChart","themeDarkSemanticEditor","themeDarkSemanticGrid","themeDarkComponents","themeDark","join"],"sources":["../../../src/theme/theme-dark/index.ts"],"sourcesContent":["import themeDarkPalette from './theme-dark-palette.css?raw';\nimport themeDarkSemantic from './theme-dark-semantic.css?raw';\nimport themeDarkSemanticChart from './theme-dark-semantic-chart.css?raw';\nimport themeDarkSemanticEditor from './theme-dark-semantic-editor.css?raw';\nimport themeDarkSemanticGrid from './theme-dark-semantic-grid.css?raw';\nimport themeDarkComponents from './theme-dark-components.css?raw';\n\n/**\n * DH theme variables are imported via Vite `?raw` query which provides the\n * text content of the variable files as a string. The exported theme is just a\n * concatenation of the contents of all of these imports.\n *\n * Note that ?raw / ?inline imports are natively supported by Vite, but consumers\n * of @deephaven/components using Webpack will need to add a rule to their module\n * config.\n * e.g.\n * module: {\n * rules: [\n * {\n * resourceQuery: /inline/,\n * type: 'asset/source',\n * },\n * ],\n * },\n *\n * e.g.\n *\n * :root {\n * --dh-color-from-dark-palette: #fff;\n * --dh-color-from-dark-palette2: #ccc;\n * }\n * :root {\n * --dh-color-from-dark-semantic: #000;\n * }\n * :root {\n * --dh-color-from-dark-semantic-editor: #000;\n * }\n * :root {\n * --dh-color-from-dark-semantic-grid: #000;\n * }\n * :root {\n * --dh-color-from-dark-components: #000;\n * }\n */\nexport const themeDark = [\n themeDarkPalette,\n themeDarkSemantic,\n themeDarkSemanticChart,\n themeDarkSemanticEditor,\n themeDarkSemanticGrid,\n themeDarkComponents,\n].join('\\n');\n\nexport default themeDark;\n"],"mappings":"OAAOA,gBAAgB;AAAA,OAChBC,iBAAiB;AAAA,OACjBC,sBAAsB;AAAA,OACtBC,uBAAuB;AAAA,OACvBC,qBAAqB;AAAA,OACrBC,mBAAmB;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,SAAS,GAAG,CACvBN,gBAAgB,EAChBC,iBAAiB,EACjBC,sBAAsB,EACtBC,uBAAuB,EACvBC,qBAAqB,EACrBC,mBAAmB,CACpB,CAACE,IAAI,CAAC,IAAI,CAAC;AAEZ,eAAeD,SAAS"}
1
+ {"version":3,"file":"index.js","names":["themeDarkPalette","themeDarkSemantic","themeDarkSemanticChart","themeDarkSemanticEditor","themeDarkSemanticGrid","themeDarkComponents","themeDark","join"],"sources":["../../../src/theme/theme-dark/index.ts"],"sourcesContent":["import themeDarkPalette from './theme-dark-palette.css?raw';\nimport themeDarkSemantic from './theme-dark-semantic.css?raw';\nimport themeDarkSemanticChart from './theme-dark-semantic-chart.css?raw';\nimport themeDarkSemanticEditor from './theme-dark-semantic-editor.css?raw';\nimport themeDarkSemanticGrid from './theme-dark-semantic-grid.css?raw';\nimport themeDarkComponents from './theme-dark-components.css?raw';\n\n/**\n * DH theme variables are imported via Vite `?raw` query which provides the\n * text content of the variable files as a string. The exported theme is just a\n * concatenation of the contents of all of these imports.\n *\n * Note that ?raw / ?inline imports are natively supported by Vite, but consumers\n * of @deephaven/components using Webpack will need to add a rule to their module\n * config.\n * e.g.\n * module: {\n * rules: [\n * {\n * resourceQuery: /inline/,\n * type: 'asset/source',\n * },\n * ],\n * },\n *\n * e.g.\n *\n * :root {\n * --dh-color-from-dark-palette: #fff;\n * --dh-color-from-dark-palette2: #ccc;\n * }\n * :root {\n * --dh-color-from-dark-semantic: #000;\n * }\n * :root {\n * --dh-color-from-dark-semantic-editor: #000;\n * }\n * :root {\n * --dh-color-from-dark-semantic-grid: #000;\n * }\n * :root {\n * --dh-color-from-dark-components: #000;\n * }\n */\nexport const themeDark = [\n themeDarkPalette,\n themeDarkSemantic,\n themeDarkSemanticChart,\n themeDarkSemanticEditor,\n themeDarkSemanticGrid,\n themeDarkComponents,\n].join('\\n');\n\nexport default themeDark;\n"],"mappings":"OAAOA,gBAAgB;AAAA,OAChBC,iBAAiB;AAAA,OACjBC,sBAAsB;AAAA,OACtBC,uBAAuB;AAAA,OACvBC,qBAAqB;AAAA,OACrBC,mBAAmB;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,SAAS,GAAG,CACvBN,gBAAgB,EAChBC,iBAAiB,EACjBC,sBAAsB,EACtBC,uBAAuB,EACvBC,qBAAqB,EACrBC,mBAAmB,CACpB,CAACE,IAAI,CAAC,IAAI,CAAC;AAEZ,eAAeD,SAAS","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["themeLightPalette","themeLightSemantic","themeLightSemanticChart","themeLightSemanticEditor","themeLightSemanticGrid","themeLightComponents","themeLight","join"],"sources":["../../../src/theme/theme-light/index.ts"],"sourcesContent":["import themeLightPalette from './theme-light-palette.css?raw';\nimport themeLightSemantic from './theme-light-semantic.css?raw';\nimport themeLightSemanticChart from './theme-light-semantic-chart.css?raw';\nimport themeLightSemanticEditor from './theme-light-semantic-editor.css?raw';\nimport themeLightSemanticGrid from './theme-light-semantic-grid.css?raw';\nimport themeLightComponents from './theme-light-components.css?raw';\n\n/**\n\n/**\n * DH theme variables are imported via Vite `?raw` query which provides the\n * text content of the variable files as a string. The exported theme is just a\n * concatenation of the contents of all of these imports.\n *\n * Note that ?raw / ?inline imports are natively supported by Vite, but consumers\n * of @deephaven/components using Webpack will need to add a rule to their module\n * config.\n * e.g.\n * module: {\n * rules: [\n * {\n * resourceQuery: /inline/,\n * type: 'asset/source',\n * },\n * ],\n * }\n *\n * e.g.\n *\n * :root {\n * --dh-color-from-light-palette: #fff;\n * --dh-color-from-light-palette2: #ccc;\n * }\n * :root {\n * --dh-color-from-light-semantic: #000;\n * }\n * :root {\n * --dh-color-from-light-semantic-editor: #000;\n * }\n * :root {\n * --dh-color-from-light-semantic-grid: #000;\n * }\n * :root {\n * --dh-color-from-light-components: #000;\n * }\n */\nexport const themeLight = [\n themeLightPalette,\n themeLightSemantic,\n themeLightSemanticChart,\n themeLightSemanticEditor,\n themeLightSemanticGrid,\n themeLightComponents,\n].join('\\n');\n\nexport default themeLight;\n"],"mappings":"OAAOA,iBAAiB;AAAA,OACjBC,kBAAkB;AAAA,OAClBC,uBAAuB;AAAA,OACvBC,wBAAwB;AAAA,OACxBC,sBAAsB;AAAA,OACtBC,oBAAoB;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,UAAU,GAAG,CACxBN,iBAAiB,EACjBC,kBAAkB,EAClBC,uBAAuB,EACvBC,wBAAwB,EACxBC,sBAAsB,EACtBC,oBAAoB,CACrB,CAACE,IAAI,CAAC,IAAI,CAAC;AAEZ,eAAeD,UAAU"}
1
+ {"version":3,"file":"index.js","names":["themeLightPalette","themeLightSemantic","themeLightSemanticChart","themeLightSemanticEditor","themeLightSemanticGrid","themeLightComponents","themeLight","join"],"sources":["../../../src/theme/theme-light/index.ts"],"sourcesContent":["import themeLightPalette from './theme-light-palette.css?raw';\nimport themeLightSemantic from './theme-light-semantic.css?raw';\nimport themeLightSemanticChart from './theme-light-semantic-chart.css?raw';\nimport themeLightSemanticEditor from './theme-light-semantic-editor.css?raw';\nimport themeLightSemanticGrid from './theme-light-semantic-grid.css?raw';\nimport themeLightComponents from './theme-light-components.css?raw';\n\n/**\n\n/**\n * DH theme variables are imported via Vite `?raw` query which provides the\n * text content of the variable files as a string. The exported theme is just a\n * concatenation of the contents of all of these imports.\n *\n * Note that ?raw / ?inline imports are natively supported by Vite, but consumers\n * of @deephaven/components using Webpack will need to add a rule to their module\n * config.\n * e.g.\n * module: {\n * rules: [\n * {\n * resourceQuery: /inline/,\n * type: 'asset/source',\n * },\n * ],\n * }\n *\n * e.g.\n *\n * :root {\n * --dh-color-from-light-palette: #fff;\n * --dh-color-from-light-palette2: #ccc;\n * }\n * :root {\n * --dh-color-from-light-semantic: #000;\n * }\n * :root {\n * --dh-color-from-light-semantic-editor: #000;\n * }\n * :root {\n * --dh-color-from-light-semantic-grid: #000;\n * }\n * :root {\n * --dh-color-from-light-components: #000;\n * }\n */\nexport const themeLight = [\n themeLightPalette,\n themeLightSemantic,\n themeLightSemanticChart,\n themeLightSemanticEditor,\n themeLightSemanticGrid,\n themeLightComponents,\n].join('\\n');\n\nexport default themeLight;\n"],"mappings":"OAAOA,iBAAiB;AAAA,OACjBC,kBAAkB;AAAA,OAClBC,uBAAuB;AAAA,OACvBC,wBAAwB;AAAA,OACxBC,sBAAsB;AAAA,OACtBC,oBAAoB;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,UAAU,GAAG,CACxBN,iBAAiB,EACjBC,kBAAkB,EAClBC,uBAAuB,EACvBC,wBAAwB,EACxBC,sBAAsB,EACtBC,oBAAoB,CACrB,CAACE,IAAI,CAAC,IAAI,CAAC;AAEZ,eAAeD,UAAU","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["palette","alias","themeSpectrumClassesCommon","_objectSpread"],"sources":["../../../src/theme/theme-spectrum/index.ts"],"sourcesContent":["import palette from './theme-spectrum-palette.module.css';\nimport alias from './theme-spectrum-alias.module.css';\n\n// don't import as module, so that classes can be used directly\nimport './theme-spectrum-overrides.css';\n\n/**\n * Spectrum theme variables are exported as a map of css class names. The keys\n * come from css classes in the imported css modules. The values are generated\n * by Vite.\n *\n * e.g.\n * {\n * 'dh-spectrum-palette': '_dh-spectrum-palette_abr16_1',\n * 'dh-spectrum-alias': '_dh-spectrum-alias_18mbe_1',\n * }\n */\nexport const themeSpectrumClassesCommon = {\n ...palette,\n ...alias,\n};\n\nexport default themeSpectrumClassesCommon;\n"],"mappings":";;;;;OAAOA,OAAO;AAAA,OACPC,KAAK,2CAEZ;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,0BAA0B,GAAAC,aAAA,CAAAA,aAAA,KAClCH,OAAO,GACPC,KAAK,CACT;AAED,eAAeC,0BAA0B"}
1
+ {"version":3,"file":"index.js","names":["palette","alias","themeSpectrumClassesCommon","_objectSpread"],"sources":["../../../src/theme/theme-spectrum/index.ts"],"sourcesContent":["import palette from './theme-spectrum-palette.module.css';\nimport alias from './theme-spectrum-alias.module.css';\n\n// don't import as module, so that classes can be used directly\nimport './theme-spectrum-overrides.css';\n\n/**\n * Spectrum theme variables are exported as a map of css class names. The keys\n * come from css classes in the imported css modules. The values are generated\n * by Vite.\n *\n * e.g.\n * {\n * 'dh-spectrum-palette': '_dh-spectrum-palette_abr16_1',\n * 'dh-spectrum-alias': '_dh-spectrum-alias_18mbe_1',\n * }\n */\nexport const themeSpectrumClassesCommon = {\n ...palette,\n ...alias,\n};\n\nexport default themeSpectrumClassesCommon;\n"],"mappings":";;;;;OAAOA,OAAO;AAAA,OACPC,KAAK,2CAEZ;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,0BAA0B,GAAAC,aAAA,CAAAA,aAAA,KAClCH,OAAO,GACPC,KAAK,CACT;AAED,eAAeC,0BAA0B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useExternalTheme.js","names":["useCallback","useEffect","useState","Log","getWindowParent","MSG_REQUEST_SET_THEME","isExternalThemeData","isExternalThemeEnabled","parseExternalThemeData","requestExternalThemeData","logger","module","useExternalTheme","result","setResult","isEnabled","isPending","handleExternalThemeData","externalThemeData","themeData","debug","onMessage","event","parent","source","window","data","message","payload","addEventListener","then","catch","err","error","removeEventListener"],"sources":["../../src/theme/useExternalTheme.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport Log from '@deephaven/log';\nimport { getWindowParent, type PostMessage } from '@deephaven/utils';\nimport {\n MSG_REQUEST_SET_THEME,\n type ExternalThemeData,\n type ThemeData,\n} from './ThemeModel';\nimport {\n isExternalThemeData,\n isExternalThemeEnabled,\n parseExternalThemeData,\n requestExternalThemeData,\n} from './ThemeUtils';\n\nconst logger = Log.module('useExternalTheme');\nexport interface UseExternalThemeResult {\n isEnabled: boolean;\n isPending: boolean;\n themeData?: ThemeData;\n}\n\n/**\n * If external theme is configured via `theme=EXTERNAL_THEME_KEY` query param,\n * handle `postMessage` communication to retrieve the theme data from the parent\n * Window. The hook will also listen for `MSG_REQUEST_SET_THEME` messages from\n * the parent and current Window to allow explicitly setting the theme.\n */\nexport function useExternalTheme(): UseExternalThemeResult {\n const [result, setResult] = useState<UseExternalThemeResult>(() => {\n const isEnabled = isExternalThemeEnabled();\n return {\n isEnabled,\n isPending: isEnabled,\n };\n });\n\n /** Parse external theme data and update the result */\n const handleExternalThemeData = useCallback(\n (externalThemeData: ExternalThemeData) => {\n const themeData = parseExternalThemeData(externalThemeData);\n\n setResult({\n isEnabled: true,\n isPending: false,\n themeData,\n });\n },\n []\n );\n\n useEffect(() => {\n if (!result.isEnabled) {\n return;\n }\n\n logger.debug('Requesting external theme data');\n\n /** Parent or current Window can explicitly set the theme */\n function onMessage(event: MessageEvent<PostMessage<unknown>>): void {\n const parent = getWindowParent();\n\n // Allow messages from parent or current window\n if (event.source !== window && event.source !== parent) {\n return;\n }\n\n if (event.data.message === MSG_REQUEST_SET_THEME) {\n if (isExternalThemeData(event.data.payload)) {\n handleExternalThemeData(event.data.payload);\n }\n }\n }\n\n window.addEventListener('message', onMessage);\n\n /** Request initial theme data from parent window */\n requestExternalThemeData()\n .then(handleExternalThemeData)\n .catch(err => {\n logger.error(err);\n setResult({ isEnabled: true, isPending: false });\n });\n\n return () => {\n window.removeEventListener('message', onMessage);\n };\n }, [handleExternalThemeData, result.isEnabled]);\n\n return result;\n}\n\nexport default useExternalTheme;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACxD,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,eAAe,QAA0B,kBAAkB;AAAC,SAEnEC,qBAAqB;AAAA,SAKrBC,mBAAmB,EACnBC,sBAAsB,EACtBC,sBAAsB,EACtBC,wBAAwB;AAG1B,IAAMC,MAAM,GAAGP,GAAG,CAACQ,MAAM,CAAC,kBAAkB,CAAC;AAO7C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAA2B;EACzD,IAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGZ,QAAQ,CAAyB,MAAM;IACjE,IAAMa,SAAS,GAAGR,sBAAsB,CAAC,CAAC;IAC1C,OAAO;MACLQ,SAAS;MACTC,SAAS,EAAED;IACb,CAAC;EACH,CAAC,CAAC;;EAE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,CAAC;EAE/C,OAAOF,MAAM;AACf;AAEA,eAAeD,gBAAgB"}
1
+ {"version":3,"file":"useExternalTheme.js","names":["useCallback","useEffect","useState","Log","getWindowParent","MSG_REQUEST_SET_THEME","isExternalThemeData","isExternalThemeEnabled","parseExternalThemeData","requestExternalThemeData","logger","module","useExternalTheme","result","setResult","isEnabled","isPending","handleExternalThemeData","externalThemeData","themeData","debug","onMessage","event","parent","source","window","data","message","payload","addEventListener","then","catch","err","error","removeEventListener"],"sources":["../../src/theme/useExternalTheme.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport Log from '@deephaven/log';\nimport { getWindowParent, type PostMessage } from '@deephaven/utils';\nimport {\n MSG_REQUEST_SET_THEME,\n type ExternalThemeData,\n type ThemeData,\n} from './ThemeModel';\nimport {\n isExternalThemeData,\n isExternalThemeEnabled,\n parseExternalThemeData,\n requestExternalThemeData,\n} from './ThemeUtils';\n\nconst logger = Log.module('useExternalTheme');\nexport interface UseExternalThemeResult {\n isEnabled: boolean;\n isPending: boolean;\n themeData?: ThemeData;\n}\n\n/**\n * If external theme is configured via `theme=EXTERNAL_THEME_KEY` query param,\n * handle `postMessage` communication to retrieve the theme data from the parent\n * Window. The hook will also listen for `MSG_REQUEST_SET_THEME` messages from\n * the parent and current Window to allow explicitly setting the theme.\n */\nexport function useExternalTheme(): UseExternalThemeResult {\n const [result, setResult] = useState<UseExternalThemeResult>(() => {\n const isEnabled = isExternalThemeEnabled();\n return {\n isEnabled,\n isPending: isEnabled,\n };\n });\n\n /** Parse external theme data and update the result */\n const handleExternalThemeData = useCallback(\n (externalThemeData: ExternalThemeData) => {\n const themeData = parseExternalThemeData(externalThemeData);\n\n setResult({\n isEnabled: true,\n isPending: false,\n themeData,\n });\n },\n []\n );\n\n useEffect(() => {\n if (!result.isEnabled) {\n return;\n }\n\n logger.debug('Requesting external theme data');\n\n /** Parent or current Window can explicitly set the theme */\n function onMessage(event: MessageEvent<PostMessage<unknown>>): void {\n const parent = getWindowParent();\n\n // Allow messages from parent or current window\n if (event.source !== window && event.source !== parent) {\n return;\n }\n\n if (event.data.message === MSG_REQUEST_SET_THEME) {\n if (isExternalThemeData(event.data.payload)) {\n handleExternalThemeData(event.data.payload);\n }\n }\n }\n\n window.addEventListener('message', onMessage);\n\n /** Request initial theme data from parent window */\n requestExternalThemeData()\n .then(handleExternalThemeData)\n .catch(err => {\n logger.error(err);\n setResult({ isEnabled: true, isPending: false });\n });\n\n return () => {\n window.removeEventListener('message', onMessage);\n };\n }, [handleExternalThemeData, result.isEnabled]);\n\n return result;\n}\n\nexport default useExternalTheme;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACxD,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,eAAe,QAA0B,kBAAkB;AAAC,SAEnEC,qBAAqB;AAAA,SAKrBC,mBAAmB,EACnBC,sBAAsB,EACtBC,sBAAsB,EACtBC,wBAAwB;AAG1B,IAAMC,MAAM,GAAGP,GAAG,CAACQ,MAAM,CAAC,kBAAkB,CAAC;AAO7C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAA2B;EACzD,IAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGZ,QAAQ,CAAyB,MAAM;IACjE,IAAMa,SAAS,GAAGR,sBAAsB,CAAC,CAAC;IAC1C,OAAO;MACLQ,SAAS;MACTC,SAAS,EAAED;IACb,CAAC;EACH,CAAC,CAAC;;EAEF;EACA,IAAME,uBAAuB,GAAGjB,WAAW,CACxCkB,iBAAoC,IAAK;IACxC,IAAMC,SAAS,GAAGX,sBAAsB,CAACU,iBAAiB,CAAC;IAE3DJ,SAAS,CAAC;MACRC,SAAS,EAAE,IAAI;MACfC,SAAS,EAAE,KAAK;MAChBG;IACF,CAAC,CAAC;EACJ,CAAC,EACD,EACF,CAAC;EAEDlB,SAAS,CAAC,MAAM;IACd,IAAI,CAACY,MAAM,CAACE,SAAS,EAAE;MACrB;IACF;IAEAL,MAAM,CAACU,KAAK,CAAC,gCAAgC,CAAC;;IAE9C;IACA,SAASC,SAASA,CAACC,KAAyC,EAAQ;MAClE,IAAMC,MAAM,GAAGnB,eAAe,CAAC,CAAC;;MAEhC;MACA,IAAIkB,KAAK,CAACE,MAAM,KAAKC,MAAM,IAAIH,KAAK,CAACE,MAAM,KAAKD,MAAM,EAAE;QACtD;MACF;MAEA,IAAID,KAAK,CAACI,IAAI,CAACC,OAAO,KAAKtB,qBAAqB,EAAE;QAChD,IAAIC,mBAAmB,CAACgB,KAAK,CAACI,IAAI,CAACE,OAAO,CAAC,EAAE;UAC3CX,uBAAuB,CAACK,KAAK,CAACI,IAAI,CAACE,OAAO,CAAC;QAC7C;MACF;IACF;IAEAH,MAAM,CAACI,gBAAgB,CAAC,SAAS,EAAER,SAAS,CAAC;;IAE7C;IACAZ,wBAAwB,CAAC,CAAC,CACvBqB,IAAI,CAACb,uBAAuB,CAAC,CAC7Bc,KAAK,CAACC,GAAG,IAAI;MACZtB,MAAM,CAACuB,KAAK,CAACD,GAAG,CAAC;MACjBlB,SAAS,CAAC;QAAEC,SAAS,EAAE,IAAI;QAAEC,SAAS,EAAE;MAAM,CAAC,CAAC;IAClD,CAAC,CAAC;IAEJ,OAAO,MAAM;MACXS,MAAM,CAACS,mBAAmB,CAAC,SAAS,EAAEb,SAAS,CAAC;IAClD,CAAC;EACH,CAAC,EAAE,CAACJ,uBAAuB,EAAEJ,MAAM,CAACE,SAAS,CAAC,CAAC;EAE/C,OAAOF,MAAM;AACf;AAEA,eAAeD,gBAAgB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useSpectrumThemeProvider.js","names":["useProvider","useSpectrumThemeProvider"],"sources":["../../src/theme/useSpectrumThemeProvider.ts"],"sourcesContent":["import { useProvider } from '@adobe/react-spectrum';\n\nexport const useSpectrumThemeProvider = useProvider;\n\nexport default useSpectrumThemeProvider;\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,uBAAuB;AAEnD,OAAO,IAAMC,wBAAwB,GAAGD,WAAW;AAEnD,eAAeC,wBAAwB"}
1
+ {"version":3,"file":"useSpectrumThemeProvider.js","names":["useProvider","useSpectrumThemeProvider"],"sources":["../../src/theme/useSpectrumThemeProvider.ts"],"sourcesContent":["import { useProvider } from '@adobe/react-spectrum';\n\nexport const useSpectrumThemeProvider = useProvider;\n\nexport default useSpectrumThemeProvider;\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,uBAAuB;AAEnD,OAAO,IAAMC,wBAAwB,GAAGD,WAAW;AAEnD,eAAeC,wBAAwB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.js","names":["useContextOrThrow","ThemeContext","useTheme"],"sources":["../../src/theme/useTheme.ts"],"sourcesContent":["import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ThemeContext, type ThemeContextValue } from './ThemeProvider';\n\n/**\n * Hook to get the current `ThemeContextValue`.\n */\nexport function useTheme(): ThemeContextValue {\n return useContextOrThrow(\n ThemeContext,\n 'No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider'\n );\n}\n\nexport default useTheme;\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,wBAAwB;AAAC,SAClDC,YAAY;AAErB;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAA,EAAsB;EAC5C,OAAOF,iBAAiB,CACtBC,YAAY,EACZ,mFACF,CAAC;AACH;AAEA,eAAeC,QAAQ"}
1
+ {"version":3,"file":"useTheme.js","names":["useContextOrThrow","ThemeContext","useTheme"],"sources":["../../src/theme/useTheme.ts"],"sourcesContent":["import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ThemeContext, type ThemeContextValue } from './ThemeProvider';\n\n/**\n * Hook to get the current `ThemeContextValue`.\n */\nexport function useTheme(): ThemeContextValue {\n return useContextOrThrow(\n ThemeContext,\n 'No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider'\n );\n}\n\nexport default useTheme;\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,wBAAwB;AAAC,SAClDC,YAAY;AAErB;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAA,EAAsB;EAC5C,OAAOF,iBAAiB,CACtBC,YAAY,EACZ,mFACF,CAAC;AACH;AAEA,eAAeC,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"FadeTransition.js","names":["CSSTransition","classNames","ThemeExport","jsx","_jsx","FadeTransition","_ref","className","timeout","transitionMs","props","_objectWithoutProperties","_excluded","_objectSpread"],"sources":["../../src/transitions/FadeTransition.tsx"],"sourcesContent":["import { CSSTransition } from 'react-transition-group';\nimport type { CSSTransitionProps } from 'react-transition-group/CSSTransition';\nimport type { EndHandler } from 'react-transition-group/Transition';\nimport classNames from 'classnames';\nimport ThemeExport from '../ThemeExport';\n\ntype FadeTransitionProps<Ref extends undefined | HTMLElement = undefined> =\n // We default the timeout, so user doesn't need to provide it\n // However, CSSTransitionProps get confused if you don't provide a timeout, it requires an endHandler\n // We're just making the endHandler optional here, as the timeout has a default\n Omit<CSSTransitionProps<Ref>, 'addEndHandler'> & {\n addEndHandler?: EndHandler<Ref> | undefined;\n };\n\n/**\n * Fade between two components. Defaults to 150ms transition.\n */\nfunction FadeTransition<Ref extends undefined | HTMLElement = undefined>({\n className,\n timeout = ThemeExport.transitionMs,\n ...props\n}: FadeTransitionProps<Ref>): JSX.Element {\n return (\n <CSSTransition\n timeout={timeout}\n classNames={classNames('fade', className)}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n );\n}\n\nexport default FadeTransition;\n"],"mappings":";;;;;;;;AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAGtD,OAAOC,UAAU,MAAM,YAAY;AAAC,OAC7BC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAUlB;AACA;AACA;AACA,SAASC,cAAcA,CAAAC,IAAA,EAImB;EAAA,IAJ+B;MACvEC,SAAS;MACTC,OAAO,GAAGN,WAAW,CAACO;IAEE,CAAC,GAAAH,IAAA;IADtBI,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAER,oBACER,IAAA,CAACJ,aAAa,EAAAa,aAAA;IACZL,OAAO,EAAEA,OAAQ;IACjBP,UAAU,EAAEA,UAAU,CAAC,MAAM,EAAEM,SAAS;IACxC;EAAA,GACIG,KAAK,CACV,CAAC;AAEN;AAEA,eAAeL,cAAc"}
1
+ {"version":3,"file":"FadeTransition.js","names":["CSSTransition","classNames","ThemeExport","jsx","_jsx","FadeTransition","_ref","className","timeout","transitionMs","props","_objectWithoutProperties","_excluded","_objectSpread"],"sources":["../../src/transitions/FadeTransition.tsx"],"sourcesContent":["import { CSSTransition } from 'react-transition-group';\nimport type { CSSTransitionProps } from 'react-transition-group/CSSTransition';\nimport type { EndHandler } from 'react-transition-group/Transition';\nimport classNames from 'classnames';\nimport ThemeExport from '../ThemeExport';\n\ntype FadeTransitionProps<Ref extends undefined | HTMLElement = undefined> =\n // We default the timeout, so user doesn't need to provide it\n // However, CSSTransitionProps get confused if you don't provide a timeout, it requires an endHandler\n // We're just making the endHandler optional here, as the timeout has a default\n Omit<CSSTransitionProps<Ref>, 'addEndHandler'> & {\n addEndHandler?: EndHandler<Ref> | undefined;\n };\n\n/**\n * Fade between two components. Defaults to 150ms transition.\n */\nfunction FadeTransition<Ref extends undefined | HTMLElement = undefined>({\n className,\n timeout = ThemeExport.transitionMs,\n ...props\n}: FadeTransitionProps<Ref>): JSX.Element {\n return (\n <CSSTransition\n timeout={timeout}\n classNames={classNames('fade', className)}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n );\n}\n\nexport default FadeTransition;\n"],"mappings":";;;;;;;;AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAGtD,OAAOC,UAAU,MAAM,YAAY;AAAC,OAC7BC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAUlB;AACA;AACA;AACA,SAASC,cAAcA,CAAAC,IAAA,EAImB;EAAA,IAJ+B;MACvEC,SAAS;MACTC,OAAO,GAAGN,WAAW,CAACO;IAEE,CAAC,GAAAH,IAAA;IADtBI,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAER,oBACER,IAAA,CAACJ,aAAa,EAAAa,aAAA;IACZL,OAAO,EAAEA,OAAQ;IACjBP,UAAU,EAAEA,UAAU,CAAC,MAAM,EAAEM,SAAS;IACxC;EAAA,GACIG,KAAK,CACV,CAAC;AAEN;AAEA,eAAeL,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"SlideTransition.js","names":["CSSTransition","classNames","ThemeExport","jsx","_jsx","SlideTransition","_ref","direction","className","timeout","transitionMidMs","props","_objectWithoutProperties","_excluded","_objectSpread","concat"],"sources":["../../src/transitions/SlideTransition.tsx"],"sourcesContent":["// SlideTransition class uses CSSTransition with slide-left and slide-right classNames, depending on the prop direction. The transition is 250ms long.\n//\nimport { CSSTransition } from 'react-transition-group';\nimport type { CSSTransitionProps } from 'react-transition-group/CSSTransition';\nimport type { EndHandler } from 'react-transition-group/Transition';\n\nimport classNames from 'classnames';\nimport ThemeExport from '../ThemeExport';\n\ntype SlideDirection = 'left' | 'right';\n\ntype SlideTransitionProps<Ref extends undefined | HTMLElement = undefined> =\n // We default the timeout, so user doesn't need to provide it\n // However, CSSTransitionProps get confused if you don't provide a timeout, it requires an endHandler\n // We're just making the endHandler optional here, as the timeout has a default\n Omit<CSSTransitionProps<Ref>, 'addEndHandler'> & {\n addEndHandler?: EndHandler<Ref> | undefined;\n } & {\n /**\n * The direction of the slide transition. Defaults to left.\n */\n direction?: SlideDirection;\n\n timeout?: number;\n };\n\n/**\n * Slides one component overtop of another component.\n * Defaults to sliding left, unless `direction='right'` is provided.\n * Timeout defaults to 200ms.\n */\nfunction SlideTransition({\n direction = 'left',\n className,\n\n /** Defaults to mid */\n timeout = ThemeExport.transitionMidMs,\n ...props\n}: SlideTransitionProps): JSX.Element {\n return (\n <CSSTransition\n timeout={timeout}\n classNames={classNames(`slide-${direction}`, className)}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n );\n}\n\nexport default SlideTransition;\n"],"mappings":";;;;;;;;AAAA;AACA;AACA,SAASA,aAAa,QAAQ,wBAAwB;AAItD,OAAOC,UAAU,MAAM,YAAY;AAAC,OAC7BC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAmBlB;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAAC,IAAA,EAOc;EAAA,IAPb;MACvBC,SAAS,GAAG,MAAM;MAClBC,SAAS;MAET;MACAC,OAAO,GAAGP,WAAW,CAACQ;IAEF,CAAC,GAAAJ,IAAA;IADlBK,KAAK,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA;EAER,oBACET,IAAA,CAACJ,aAAa,EAAAc,aAAA;IACZL,OAAO,EAAEA,OAAQ;IACjBR,UAAU,EAAEA,UAAU,UAAAc,MAAA,CAAUR,SAAS,GAAIC,SAAS;IACtD;EAAA,GACIG,KAAK,CACV,CAAC;AAEN;AAEA,eAAeN,eAAe"}
1
+ {"version":3,"file":"SlideTransition.js","names":["CSSTransition","classNames","ThemeExport","jsx","_jsx","SlideTransition","_ref","direction","className","timeout","transitionMidMs","props","_objectWithoutProperties","_excluded","_objectSpread","concat"],"sources":["../../src/transitions/SlideTransition.tsx"],"sourcesContent":["// SlideTransition class uses CSSTransition with slide-left and slide-right classNames, depending on the prop direction. The transition is 250ms long.\n//\nimport { CSSTransition } from 'react-transition-group';\nimport type { CSSTransitionProps } from 'react-transition-group/CSSTransition';\nimport type { EndHandler } from 'react-transition-group/Transition';\n\nimport classNames from 'classnames';\nimport ThemeExport from '../ThemeExport';\n\ntype SlideDirection = 'left' | 'right';\n\ntype SlideTransitionProps<Ref extends undefined | HTMLElement = undefined> =\n // We default the timeout, so user doesn't need to provide it\n // However, CSSTransitionProps get confused if you don't provide a timeout, it requires an endHandler\n // We're just making the endHandler optional here, as the timeout has a default\n Omit<CSSTransitionProps<Ref>, 'addEndHandler'> & {\n addEndHandler?: EndHandler<Ref> | undefined;\n } & {\n /**\n * The direction of the slide transition. Defaults to left.\n */\n direction?: SlideDirection;\n\n timeout?: number;\n };\n\n/**\n * Slides one component overtop of another component.\n * Defaults to sliding left, unless `direction='right'` is provided.\n * Timeout defaults to 200ms.\n */\nfunction SlideTransition({\n direction = 'left',\n className,\n\n /** Defaults to mid */\n timeout = ThemeExport.transitionMidMs,\n ...props\n}: SlideTransitionProps): JSX.Element {\n return (\n <CSSTransition\n timeout={timeout}\n classNames={classNames(`slide-${direction}`, className)}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n );\n}\n\nexport default SlideTransition;\n"],"mappings":";;;;;;;;AAAA;AACA;AACA,SAASA,aAAa,QAAQ,wBAAwB;AAItD,OAAOC,UAAU,MAAM,YAAY;AAAC,OAC7BC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAmBlB;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAAC,IAAA,EAOc;EAAA,IAPb;MACvBC,SAAS,GAAG,MAAM;MAClBC,SAAS;MAET;MACAC,OAAO,GAAGP,WAAW,CAACQ;IAEF,CAAC,GAAAJ,IAAA;IADlBK,KAAK,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA;EAER,oBACET,IAAA,CAACJ,aAAa,EAAAc,aAAA;IACZL,OAAO,EAAEA,OAAQ;IACjBR,UAAU,EAAEA,UAAU,UAAAc,MAAA,CAAUR,SAAS,GAAIC,SAAS;IACtD;EAAA,GACIG,KAAK,CACV,CAAC;AAEN;AAEA,eAAeN,eAAe","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","FadeTransition","SlideTransition"],"sources":["../../src/transitions/index.ts"],"sourcesContent":["export { default as FadeTransition } from './FadeTransition';\nexport { default as SlideTransition } from './SlideTransition';\n"],"mappings":"SAASA,OAAO,IAAIC,cAAc;AAAA,SACzBD,OAAO,IAAIE,eAAe"}
1
+ {"version":3,"file":"index.js","names":["default","FadeTransition","SlideTransition"],"sources":["../../src/transitions/index.ts"],"sourcesContent":["export { default as FadeTransition } from './FadeTransition';\nexport { default as SlideTransition } from './SlideTransition';\n"],"mappings":"SAASA,OAAO,IAAIC,cAAc;AAAA,SACzBD,OAAO,IAAIE,eAAe","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/components",
3
- "version": "1.7.2-beta.1+a19bc114",
3
+ "version": "1.7.2-react-18-alpha.3+b369a51e",
4
4
  "description": "Deephaven React component library",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -25,10 +25,10 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@adobe/react-spectrum": "3.38.0",
28
- "@deephaven/icons": "^1.7.2-beta.1+a19bc114",
29
- "@deephaven/log": "^1.7.2-beta.1+a19bc114",
30
- "@deephaven/react-hooks": "^1.7.2-beta.1+a19bc114",
31
- "@deephaven/utils": "^1.7.2-beta.1+a19bc114",
28
+ "@deephaven/icons": "^1.7.2-react-18-alpha.3+b369a51e",
29
+ "@deephaven/log": "^1.7.2-react-18-alpha.3+b369a51e",
30
+ "@deephaven/react-hooks": "^1.7.2-react-18-alpha.3+b369a51e",
31
+ "@deephaven/utils": "^1.7.2-react-18-alpha.3+b369a51e",
32
32
  "@fortawesome/fontawesome-svg-core": "^6.2.1",
33
33
  "@fortawesome/react-fontawesome": "^0.2.0",
34
34
  "@internationalized/date": "^3.5.5",
@@ -48,12 +48,11 @@
48
48
  "memoizee": "^0.4.15",
49
49
  "nanoid": "^5.0.7",
50
50
  "popper.js": "^1.16.1",
51
- "prop-types": "^15.7.2",
52
- "react-beautiful-dnd": "^13.1.0",
51
+ "react-beautiful-dnd": "^13.1.1",
53
52
  "react-reverse-portal": "^2.3.0",
54
53
  "react-transition-group": "^4.4.2",
55
- "react-virtualized-auto-sizer": "1.0.6",
56
- "react-window": "^1.8.6"
54
+ "react-virtualized-auto-sizer": "1.0.7",
55
+ "react-window": "^1.8.7"
57
56
  },
58
57
  "peerDependencies": {
59
58
  "react": ">=16.8.0",
@@ -61,9 +60,9 @@
61
60
  "react-is": ">=16.8.0"
62
61
  },
63
62
  "devDependencies": {
64
- "@deephaven/mocks": "^1.7.2-beta.1+a19bc114",
65
- "@deephaven/test-utils": "^1.7.2-beta.1+a19bc114",
66
- "react-redux": "^7.2.4"
63
+ "@deephaven/mocks": "^1.7.2-react-18-alpha.3+b369a51e",
64
+ "@deephaven/test-utils": "^1.7.2-react-18-alpha.3+b369a51e",
65
+ "react-redux": "^7.2.7"
67
66
  },
68
67
  "files": [
69
68
  "dist",
@@ -77,5 +76,5 @@
77
76
  "publishConfig": {
78
77
  "access": "public"
79
78
  },
80
- "gitHead": "a19bc11446da4328bc5c216064ec810b24ee0312"
79
+ "gitHead": "b369a51ee94d212641a14c6ce1f19fcc85168339"
81
80
  }