@deephaven/components 0.50.1-beta.5 → 0.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/AutoCompleteInput.js.map +1 -1
  2. package/dist/AutoResizeTextarea.js.map +1 -1
  3. package/dist/BasicModal.js.map +1 -1
  4. package/dist/BulkActionBar.js.map +1 -1
  5. package/dist/Button.js.map +1 -1
  6. package/dist/ButtonGroup.js.map +1 -1
  7. package/dist/ButtonOld.js.map +1 -1
  8. package/dist/CardFlip.js.map +1 -1
  9. package/dist/Checkbox.js.map +1 -1
  10. package/dist/Collapse.js.map +1 -1
  11. package/dist/ComboBox.js.map +1 -1
  12. package/dist/CopyButton.js.map +1 -1
  13. package/dist/CustomTimeSelect.js.map +1 -1
  14. package/dist/DateInput.js.map +1 -1
  15. package/dist/DateInputUtils.js.map +1 -1
  16. package/dist/DateTimeInput.js.map +1 -1
  17. package/dist/DateTimeInputUtils.js.map +1 -1
  18. package/dist/DebouncedSearchInput.js.map +1 -1
  19. package/dist/DragUtils.js.map +1 -1
  20. package/dist/DraggableItemList.js.map +1 -1
  21. package/dist/EditableItemList.js.map +1 -1
  22. package/dist/HierarchicalCheckboxMenu.js.map +1 -1
  23. package/dist/ItemList.js.map +1 -1
  24. package/dist/ItemListItem.js.map +1 -1
  25. package/dist/LoadingOverlay.js.map +1 -1
  26. package/dist/LoadingSpinner.js.map +1 -1
  27. package/dist/MaskedInput.js.map +1 -1
  28. package/dist/MaskedInputUtils.js.map +1 -1
  29. package/dist/Option.js.map +1 -1
  30. package/dist/RadioGroup.js.map +1 -1
  31. package/dist/RadioItem.js.map +1 -1
  32. package/dist/RandomAreaPlotAnimation.js.map +1 -1
  33. package/dist/SearchInput.js.map +1 -1
  34. package/dist/SearchableCombobox.js.map +1 -1
  35. package/dist/Select.js.map +1 -1
  36. package/dist/SelectValueList.js.map +1 -1
  37. package/dist/SocketedButton.js.map +1 -1
  38. package/dist/SpectrumUtils.d.ts.map +1 -1
  39. package/dist/SpectrumUtils.js +3 -4
  40. package/dist/SpectrumUtils.js.map +1 -1
  41. package/dist/TableViewEmptyState.js.map +1 -1
  42. package/dist/TextWithTooltip.js.map +1 -1
  43. package/dist/ThemeExport.js.map +1 -1
  44. package/dist/TimeInput.js.map +1 -1
  45. package/dist/TimeSlider.js.map +1 -1
  46. package/dist/ToastNotification.js.map +1 -1
  47. package/dist/UISwitch.js.map +1 -1
  48. package/dist/ValidateLabelInput.js.map +1 -1
  49. package/dist/actions/ConfirmActionButton.js.map +1 -1
  50. package/dist/actions/IconActionButton.js.map +1 -1
  51. package/dist/context-actions/ContextActionUtils.js +2 -0
  52. package/dist/context-actions/ContextActionUtils.js.map +1 -1
  53. package/dist/context-actions/ContextActions.js.map +1 -1
  54. package/dist/context-actions/ContextMenu.js.map +1 -1
  55. package/dist/context-actions/ContextMenuItem.js.map +1 -1
  56. package/dist/context-actions/ContextMenuRoot.js.map +1 -1
  57. package/dist/context-actions/GlobalContextAction.js.map +1 -1
  58. package/dist/context-actions/GlobalContextActions.js.map +1 -1
  59. package/dist/declaration.d.js.map +1 -1
  60. package/dist/dialogs/ActionButtonDialogTrigger.js.map +1 -1
  61. package/dist/dialogs/ConfirmationDialog.js.map +1 -1
  62. package/dist/menu-actions/DropdownMenu.js.map +1 -1
  63. package/dist/menu-actions/Menu.js.map +1 -1
  64. package/dist/modal/DebouncedModal.js.map +1 -1
  65. package/dist/modal/InfoModal.js.map +1 -1
  66. package/dist/modal/Modal.js.map +1 -1
  67. package/dist/modal/ModalBody.js.map +1 -1
  68. package/dist/modal/ModalFooter.js.map +1 -1
  69. package/dist/modal/ModalHeader.js.map +1 -1
  70. package/dist/navigation/Menu.js.map +1 -1
  71. package/dist/navigation/MenuItem.js.map +1 -1
  72. package/dist/navigation/Page.js.map +1 -1
  73. package/dist/navigation/Stack.js.map +1 -1
  74. package/dist/popper/Popper.js +3 -0
  75. package/dist/popper/Popper.js.map +1 -1
  76. package/dist/popper/Tooltip.js +3 -0
  77. package/dist/popper/Tooltip.js.map +1 -1
  78. package/dist/shortcuts/Shortcut.js.map +1 -1
  79. package/dist/shortcuts/ShortcutRegistry.js.map +1 -1
  80. package/dist/theme/SpectrumThemeProvider.d.ts +17 -0
  81. package/dist/theme/SpectrumThemeProvider.d.ts.map +1 -0
  82. package/dist/theme/SpectrumThemeProvider.js +31 -0
  83. package/dist/theme/SpectrumThemeProvider.js.map +1 -0
  84. package/dist/theme/ThemeProvider.d.ts.map +1 -1
  85. package/dist/theme/ThemeProvider.js +26 -12
  86. package/dist/theme/ThemeProvider.js.map +1 -1
  87. package/dist/theme/ThemeUtils.js.map +1 -1
  88. package/dist/theme/theme-dark/index.d.ts +24 -0
  89. package/dist/theme/theme-dark/index.d.ts.map +1 -1
  90. package/dist/theme/theme-dark/index.js +26 -1
  91. package/dist/theme/theme-dark/index.js.map +1 -1
  92. package/dist/theme/theme-dark/theme-dark-components.css +8 -0
  93. package/dist/theme/theme-dark/theme-dark-components.css.map +1 -0
  94. package/dist/theme/theme-dark/theme-dark-semantic.css +51 -4
  95. package/dist/theme/theme-dark/theme-dark-semantic.css.map +1 -1
  96. package/dist/theme/theme-spectrum/index.d.ts +16 -0
  97. package/dist/theme/theme-spectrum/index.d.ts.map +1 -0
  98. package/dist/theme/theme-spectrum/index.js +22 -0
  99. package/dist/theme/theme-spectrum/index.js.map +1 -0
  100. package/dist/theme/theme-spectrum/theme-spectrum-alias.module.css +192 -0
  101. package/dist/theme/theme-spectrum/theme-spectrum-alias.module.css.map +1 -0
  102. package/dist/theme/theme-spectrum/theme-spectrum-overrides.module.css +7 -0
  103. package/dist/theme/theme-spectrum/theme-spectrum-overrides.module.css.map +1 -0
  104. package/dist/theme/theme-spectrum/theme-spectrum-palette.module.css +211 -0
  105. package/dist/theme/theme-spectrum/theme-spectrum-palette.module.css.map +1 -0
  106. package/dist/theme/useTheme.js.map +1 -1
  107. package/package.json +7 -7
  108. package/dist/SpectrumThemeDark.module.css +0 -9
  109. package/dist/SpectrumThemeDark.module.css.map +0 -1
  110. package/dist/SpectrumThemeLight.module.css +0 -9
  111. package/dist/SpectrumThemeLight.module.css.map +0 -1
@@ -0,0 +1,31 @@
1
+ import { useState } from 'react';
2
+ import { Provider } from '@adobe/react-spectrum';
3
+ import shortid from 'shortid';
4
+ import { themeDHDefault } from "../SpectrumUtils.js";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ /**
7
+ * Wrapper around React Spectrum's theme Provider that provides DH mappings of
8
+ * Spectrum's theme variables to DH's theme variables. Also exposes an optional
9
+ * `isPortal` prop that if provided, adds a unique `data-unique-id` attribute to
10
+ * the Provider. This is needed to force the Provider to render the theme wrapper
11
+ * inside of portals.
12
+ */
13
+ export function SpectrumThemeProvider(_ref) {
14
+ var {
15
+ children,
16
+ isPortal = false,
17
+ theme = themeDHDefault,
18
+ colorScheme
19
+ } = _ref;
20
+ // a unique ID is used per provider to force it to render the theme wrapper element inside portals
21
+ // based on https://github.com/adobe/react-spectrum/issues/1697#issuecomment-999827266
22
+ // won't be needed if https://github.com/adobe/react-spectrum/pull/2669 is merged
23
+ var [id] = useState(isPortal ? shortid() : null);
24
+ return /*#__PURE__*/_jsx(Provider, {
25
+ theme: theme,
26
+ colorScheme: colorScheme,
27
+ "data-unique-id": id,
28
+ children: children
29
+ });
30
+ }
31
+ //# sourceMappingURL=SpectrumThemeProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpectrumThemeProvider.js","names":["useState","Provider","shortid","themeDHDefault","jsx","_jsx","SpectrumThemeProvider","_ref","children","isPortal","theme","colorScheme","id"],"sources":["../../src/theme/SpectrumThemeProvider.tsx"],"sourcesContent":["import { ReactNode, useState } from 'react';\nimport { Provider } from '@adobe/react-spectrum';\nimport type { Theme } from '@react-types/provider';\nimport shortid from 'shortid';\nimport { themeDHDefault } from '../SpectrumUtils';\n\nexport interface SpectrumThemeProviderProps {\n children: ReactNode;\n isPortal?: boolean;\n theme?: Theme;\n colorScheme?: 'light' | 'dark';\n}\n\n/**\n * Wrapper around React Spectrum's theme Provider that provides DH mappings of\n * Spectrum's theme variables to DH's theme variables. Also exposes an optional\n * `isPortal` prop that if provided, adds a unique `data-unique-id` attribute to\n * the Provider. This is needed to force the Provider to render the theme wrapper\n * inside of portals.\n */\nexport function SpectrumThemeProvider({\n children,\n isPortal = false,\n theme = themeDHDefault,\n colorScheme,\n}: SpectrumThemeProviderProps): JSX.Element {\n // a unique ID is used per provider to force it to render the theme wrapper element inside portals\n // based on https://github.com/adobe/react-spectrum/issues/1697#issuecomment-999827266\n // won't be needed if https://github.com/adobe/react-spectrum/pull/2669 is merged\n const [id] = useState(isPortal ? shortid() : null);\n\n return (\n <Provider theme={theme} colorScheme={colorScheme} data-unique-id={id}>\n {children}\n </Provider>\n );\n}\n"],"mappings":"AAAA,SAAoBA,QAAQ,QAAQ,OAAO;AAC3C,SAASC,QAAQ,QAAQ,uBAAuB;AAEhD,OAAOC,OAAO,MAAM,SAAS;AAAC,SACrBC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AASvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAAAC,IAAA,EAKO;EAAA,IALN;IACpCC,QAAQ;IACRC,QAAQ,GAAG,KAAK;IAChBC,KAAK,GAAGP,cAAc;IACtBQ;EAC0B,CAAC,GAAAJ,IAAA;EAC3B;EACA;EACA;EACA,IAAM,CAACK,EAAE,CAAC,GAAGZ,QAAQ,CAACS,QAAQ,GAAGP,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;EAElD,oBACEG,IAAA,CAACJ,QAAQ;IAACS,KAAK,EAAEA,KAAM;IAACC,WAAW,EAAEA,WAAY;IAAC,kBAAgBC,EAAG;IAAAJ,QAAA,EAClEA;EAAQ,CACD,CAAC;AAEf"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeProvider.tsx"],"names":[],"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, useEffect, useMemo, useState } from 'react';
2
2
  import Log from '@deephaven/log';
3
3
  import { DEFAULT_DARK_THEME_KEY } from "./ThemeModel.js";
4
4
  import { calculatePreloadStyleContent, getActiveThemes, getDefaultBaseThemes, getThemePreloadData, setThemePreloadData } from "./ThemeUtils.js";
5
+ import { SpectrumThemeProvider } from "./SpectrumThemeProvider.js";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { Fragment as _Fragment } from "react/jsx-runtime";
6
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
9
  var log = Log.module('ThemeProvider');
8
10
  export var ThemeContext = /*#__PURE__*/createContext(null);
@@ -16,21 +18,29 @@ export function ThemeProvider(_ref) {
16
18
  var _getThemePreloadData$, _getThemePreloadData;
17
19
  return (_getThemePreloadData$ = (_getThemePreloadData = getThemePreloadData()) === null || _getThemePreloadData === void 0 ? void 0 : _getThemePreloadData.themeKey) !== null && _getThemePreloadData$ !== void 0 ? _getThemePreloadData$ : DEFAULT_DARK_THEME_KEY;
18
20
  });
19
- var activeThemes = useMemo(() =>
20
- // Themes remain inactive until a non-null themes array is provided. This
21
- // avoids the default base theme overriding the preload if we are waiting
22
- // on additional themes to be available.
23
- themes == null ? null : getActiveThemes(selectedThemeKey, {
21
+
22
+ // Calculate active themes once a non-null themes array is provided.
23
+ var activeThemes = useMemo(() => themes == null ? null : getActiveThemes(selectedThemeKey, {
24
24
  base: baseThemes,
25
25
  custom: themes !== null && themes !== void 0 ? themes : []
26
26
  }), [baseThemes, selectedThemeKey, themes]);
27
27
  useEffect(function updateThemePreloadData() {
28
- log.debug('Active themes:', activeThemes === null || activeThemes === void 0 ? void 0 : activeThemes.map(theme => theme.themeKey));
28
+ // Don't update preload data until themes have been loaded and activated
29
+ if (activeThemes == null || themes == null) {
30
+ return;
31
+ }
32
+ var preloadStyleContent = calculatePreloadStyleContent();
33
+ log.debug2('updateThemePreloadData:', {
34
+ active: activeThemes.map(theme => theme.themeKey),
35
+ all: themes.map(theme => theme.themeKey),
36
+ preloadStyleContent,
37
+ selectedThemeKey
38
+ });
29
39
  setThemePreloadData({
30
40
  themeKey: selectedThemeKey,
31
- preloadStyleContent: calculatePreloadStyleContent()
41
+ preloadStyleContent
32
42
  });
33
- }, [activeThemes, selectedThemeKey]);
43
+ }, [activeThemes, selectedThemeKey, themes]);
34
44
  var value = useMemo(() => ({
35
45
  activeThemes,
36
46
  selectedThemeKey,
@@ -38,10 +48,14 @@ export function ThemeProvider(_ref) {
38
48
  }), [activeThemes, selectedThemeKey]);
39
49
  return /*#__PURE__*/_jsxs(ThemeContext.Provider, {
40
50
  value: value,
41
- children: [activeThemes === null || activeThemes === void 0 ? void 0 : activeThemes.map(theme => /*#__PURE__*/_jsx("style", {
42
- "data-theme-key": theme.themeKey,
43
- children: theme.styleContent
44
- }, theme.themeKey)), children]
51
+ children: [activeThemes == null ? null : /*#__PURE__*/_jsx(_Fragment, {
52
+ children: activeThemes.map(theme => /*#__PURE__*/_jsx("style", {
53
+ "data-theme-key": theme.themeKey,
54
+ children: theme.styleContent
55
+ }, theme.themeKey))
56
+ }), /*#__PURE__*/_jsx(SpectrumThemeProvider, {
57
+ children: children
58
+ })]
45
59
  });
46
60
  }
47
61
  export default ThemeProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.js","names":["createContext","useEffect","useMemo","useState","Log","DEFAULT_DARK_THEME_KEY","calculatePreloadStyleContent","getActiveThemes","getDefaultBaseThemes","getThemePreloadData","setThemePreloadData","log","module","ThemeContext","ThemeProvider","themes","children","baseThemes","selectedThemeKey","setSelectedThemeKey","themeKey","activeThemes","base","custom","updateThemePreloadData","debug","map","theme","preloadStyleContent","value","styleContent"],"sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import { createContext, ReactNode, useEffect, useMemo, useState } from 'react';\nimport Log from '@deephaven/log';\nimport { DEFAULT_DARK_THEME_KEY, ThemeData } from './ThemeModel';\nimport {\n calculatePreloadStyleContent,\n getActiveThemes,\n getDefaultBaseThemes,\n getThemePreloadData,\n setThemePreloadData,\n} from './ThemeUtils';\n\nexport interface ThemeContextValue {\n activeThemes: ThemeData[] | null;\n selectedThemeKey: string;\n setSelectedThemeKey: (themeKey: string) => void;\n}\n\nconst log = Log.module('ThemeProvider');\n\nexport const ThemeContext = createContext<ThemeContextValue | null>(null);\n\nexport interface ThemeProviderProps {\n themes: ThemeData[] | null;\n children: ReactNode;\n}\n\nexport function ThemeProvider({\n themes,\n children,\n}: ThemeProviderProps): JSX.Element {\n const baseThemes = useMemo(() => getDefaultBaseThemes(), []);\n\n const [selectedThemeKey, setSelectedThemeKey] = useState<string>(\n () => getThemePreloadData()?.themeKey ?? DEFAULT_DARK_THEME_KEY\n );\n\n const activeThemes = useMemo(\n () =>\n // Themes remain inactive until a non-null themes array is provided. This\n // avoids the default base theme overriding the preload if we are waiting\n // on additional themes to be available.\n themes == null\n ? null\n : getActiveThemes(selectedThemeKey, {\n base: baseThemes,\n custom: themes ?? [],\n }),\n [baseThemes, selectedThemeKey, themes]\n );\n\n useEffect(\n function updateThemePreloadData() {\n log.debug('Active themes:', activeThemes?.map(theme => theme.themeKey));\n\n setThemePreloadData({\n themeKey: selectedThemeKey,\n preloadStyleContent: calculatePreloadStyleContent(),\n });\n },\n [activeThemes, selectedThemeKey]\n );\n\n const value = useMemo(\n () => ({\n activeThemes,\n selectedThemeKey,\n setSelectedThemeKey,\n }),\n [activeThemes, selectedThemeKey]\n );\n\n return (\n <ThemeContext.Provider value={value}>\n {activeThemes?.map(theme => (\n <style data-theme-key={theme.themeKey} key={theme.themeKey}>\n {theme.styleContent}\n </style>\n ))}\n {children}\n </ThemeContext.Provider>\n );\n}\n\nexport default ThemeProvider;\n"],"mappings":"AAAA,SAASA,aAAa,EAAaC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC9E,OAAOC,GAAG,MAAM,gBAAgB;AAAC,SACxBC,sBAAsB;AAAA,SAE7BC,4BAA4B,EAC5BC,eAAe,EACfC,oBA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gBAAgB,CAAC,CACjC;EAED,oBACE,MAAC,YAAY,CAAC,QAAQ;IAAC,KAAK,EAAEW,KAAM;IAAA,WACjCR,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEK,GAAG,CAACC,KAAK,iBACtB;MAAO,kBAAgBA,KAAK,CAACP,QAAS;MAAA,UACnCO,KAAK,CAACG;IAAY,GADuBH,KAAK,CAACP,QAAQ,CAG3D,CAAC,EACDJ,QAAQ;EAAA,EACa;AAE5B;AAEA,eAAeF,aAAa"}
1
+ {"version":3,"file":"ThemeProvider.js","names":["createContext","useEffect","useMemo","useState","Log","DEFAULT_DARK_THEME_KEY","calculatePreloadStyleContent","getActiveThemes","getDefaultBaseThemes","getThemePreloadData","setThemePreloadData","SpectrumThemeProvider","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","log","module","ThemeContext","ThemeProvider","_ref","themes","children","baseThemes","selectedThemeKey","setSelectedThemeKey","_getThemePreloadData$","_getThemePreloadData","themeKey","activeThemes","base","custom","updateThemePreloadData","preloadStyleContent","debug2","active","map","theme","all","value","Provider","styleContent"],"sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import { createContext, ReactNode, useEffect, useMemo, useState } from 'react';\nimport Log from '@deephaven/log';\nimport { DEFAULT_DARK_THEME_KEY, ThemeData } from './ThemeModel';\nimport {\n calculatePreloadStyleContent,\n getActiveThemes,\n getDefaultBaseThemes,\n getThemePreloadData,\n setThemePreloadData,\n} from './ThemeUtils';\nimport { SpectrumThemeProvider } from './SpectrumThemeProvider';\n\nexport interface ThemeContextValue {\n activeThemes: ThemeData[] | null;\n selectedThemeKey: string;\n setSelectedThemeKey: (themeKey: string) => void;\n}\n\nconst log = Log.module('ThemeProvider');\n\nexport const ThemeContext = createContext<ThemeContextValue | null>(null);\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 children: ReactNode;\n}\n\nexport function ThemeProvider({\n themes,\n children,\n}: ThemeProviderProps): JSX.Element {\n const baseThemes = useMemo(() => getDefaultBaseThemes(), []);\n\n const [selectedThemeKey, setSelectedThemeKey] = useState<string>(\n () => getThemePreloadData()?.themeKey ?? DEFAULT_DARK_THEME_KEY\n );\n\n // Calculate active themes once a non-null themes array is provided.\n const activeThemes = useMemo(\n () =>\n themes == null\n ? null\n : getActiveThemes(selectedThemeKey, {\n base: baseThemes,\n custom: themes ?? [],\n }),\n [baseThemes, selectedThemeKey, themes]\n );\n\n useEffect(\n function updateThemePreloadData() {\n // Don't update preload data until themes have been loaded and activated\n if (activeThemes == null || themes == null) {\n return;\n }\n\n const preloadStyleContent = calculatePreloadStyleContent();\n\n log.debug2('updateThemePreloadData:', {\n active: activeThemes.map(theme => theme.themeKey),\n all: themes.map(theme => theme.themeKey),\n preloadStyleContent,\n selectedThemeKey,\n });\n\n setThemePreloadData({\n themeKey: selectedThemeKey,\n preloadStyleContent,\n });\n },\n [activeThemes, selectedThemeKey, themes]\n );\n\n const value = useMemo(\n () => ({\n activeThemes,\n selectedThemeKey,\n setSelectedThemeKey,\n }),\n [activeThemes, selectedThemeKey]\n );\n\n return (\n <ThemeContext.Provider value={value}>\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 <SpectrumThemeProvider>{children}</SpectrumThemeProvider>\n </ThemeContext.Provider>\n );\n}\n\nexport default ThemeProvider;\n"],"mappings":"AAAA,SAASA,aAAa,EAAaC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC9E,OAAOC,GAAG,MAAM,gBAAgB;AAAC,SACxBC,sBAAsB;AAAA,SAE7BC,4BAA4B,EAC5BC,eAAe,EACfC,oBAAoB,EACpBC,mBAAmB,EACnBC,mBAAmB;AAAA,SAEZC,qBAAqB;AAAA,SAAAC,GAAA,IAA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IA,KAAK,CAACT,QAAQ,CAAC;MACjDU,GAAG,EAAEjB,MAAM,CAACe,GAAG,CAACC,KAAK,IAAIA,KAAK,CAACT,QAAQ,CAAC;MACxCK,mBAAmB;MACnBT;IACF,CAAC,CAAC;IAEFhB,mBAAmB,CAAC;MAClBoB,QAAQ,EAAEJ,gBAAgB;MAC1BS;IACF,CAAC,CAAC;EACJ,CAAC,EACD,CAACJ,YAAY,EAAEL,gBAAgB,EAAEH,MAAM,CACzC,CAAC;EAED,IAAMkB,KAAK,GAAGvC,OAAO,CACnB,OAAO;IACL6B,YAAY;IACZL,gBAAgB;IAChBC;EACF,CAAC,CAAC,EACF,CAACI,YAAY,EAAEL,gBAAgB,CACjC,CAAC;EAED,oBACET,KAAA,CAACG,YAAY,CAACsB,QAAQ;IAACD,KAAK,EAAEA,KAAM;IAAAjB,QAAA,GACjCO,YAAY,IAAI,IAAI,GAAG,IAAI,gBAC1BlB,IAAA,CAAAE,SAAA;MAAAS,QAAA,EACGO,YAAY,CAACO,GAAG,CAACC,KAAK,iBACrB1B,IAAA;QAAO,kBAAgB0B,KAAK,CAACT,QAAS;QAAAN,QAAA,EACnCe,KAAK,CAACI;MAAY,GADuBJ,KAAK,CAACT,QAE3C,CACR;IAAC,CACF,CACH,eACDjB,IAAA,CAACF,qBAAqB;MAAAa,QAAA,EAAEA;IAAQ,CAAwB,CAAC;EAAA,CACpC,CAAC;AAE5B;AAEA,eAAeH,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeUtils.js","names":["Log","assertNotNull","ColorUtils","themeDark","themeLight","DEFAULT_DARK_THEME_KEY","DEFAULT_LIGHT_THEME_KEY","DEFAULT_PRELOAD_DATA_VARIABLES","THEME_CACHE_LOCAL_STORAGE_KEY","log","module","TMP_CSS_PROP_PREFIX","calculatePreloadStyleContent","bodyStyle","getComputedStyle","document","body","pairs","Object","entries","map","key","defaultValue","getPropertyValue","join","extractDistinctCssVariableExpressions","record","set","Set","values","forEach","value","getCssVariableRanges","start","end","add","substring","getActiveThemes","themeKey","themeRegistration","custom","find","theme","baseThemeKey","base","error","debug","getDefaultBaseThemes","name","styleContent","getThemePreloadData","data","localStorage","getItem","JSON","parse","ranges","cssVarPrefix","indexOf","parenLevel","i","length","push","resolveCssVariablesInRecord","targetElement","perfStart","performance","now","tmpPropEl","createElement","appendChild","varExpressions","varExpression","tmpPropKey","style","setProperty","result","computedStyle","window","resolver","resolved","normalizeCssColor","resolveCssVariablesInString","remove","setThemePreloadData","preloadData","setItem","stringify","getThemeKey","pluginName","themeName","preloadTheme","preloadStyleContent","innerHTML","head"],"sources":["../../src/theme/ThemeUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport { assertNotNull, ColorUtils } from '@deephaven/utils';\n// Note that ?inline imports are natively supported by Vite, but consumers of\n// @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// },\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 ThemeData,\n ThemePreloadData,\n ThemePreloadStyleContent,\n ThemeRegistrationData,\n THEME_CACHE_LOCAL_STORAGE_KEY,\n} from './ThemeModel';\n\nconst log = Log.module('ThemeUtils');\n\nexport const TMP_CSS_PROP_PREFIX = 'dh-tmp';\n\nexport type VarExpressionResolver = (varExpression: string) => string;\n\n/**\n * Creates a string containing preload style content for the current theme.\n * This resolves the current values of a few CSS variables that can be used\n * to style the page before the theme is loaded on next page load.\n */\nexport function calculatePreloadStyleContent(): ThemePreloadStyleContent {\n const bodyStyle = getComputedStyle(document.body);\n\n // Calculate the current preload variables. If the variable is not set, use\n // the default value.\n const pairs = Object.entries(DEFAULT_PRELOAD_DATA_VARIABLES).map(\n ([key, defaultValue]) =>\n `${key}:${bodyStyle.getPropertyValue(key) || defaultValue}`\n );\n\n return `:root{${pairs.join(';')}}`;\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 getCssVariableRanges(value).forEach(([start, end]) => {\n set.add(value.substring(start, end + 1));\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 {\n name: 'Default Light',\n themeKey: DEFAULT_LIGHT_THEME_KEY,\n styleContent: themeLight,\n },\n ];\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 css variable expressions in the given\n * string.\n *\n * e.g.\n * getCssVariableRanges('var(--aaa-aa) var(--bbb-bb)')\n * yields:\n * [\n * [0, 12],\n * [14, 26],\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 * getCssVariableRanges('var(--ccc-cc, var(--aaa-aa, green)) var(--bbb-bb)')\n * yields:\n * [\n * [0, 34], // range for --ccc-cc expression\n * [36, 48], // range for --bbb-bb expression\n * ]\n * @param value The string to search for css variable expressions\n * @returns An array of [start, end] index pairs for each css variable expression\n */\nexport function getCssVariableRanges(value: string): [number, number][] {\n const ranges: [number, number][] = [];\n\n const cssVarPrefix = 'var(--';\n let start = value.indexOf(cssVarPrefix);\n let parenLevel = 0;\n\n while (start > -1) {\n parenLevel = 1;\n let i = start + cssVarPrefix.length;\n for (; i < value.length; i += 1) {\n if (value[i] === '(') {\n parenLevel += 1;\n } else if (value[i] === ')') {\n parenLevel -= 1;\n }\n\n if (parenLevel === 0) {\n ranges.push([start, i]);\n break;\n }\n }\n\n if (parenLevel !== 0) {\n log.error('Unbalanced parentheses in css var expression', value);\n return [];\n }\n\n start = value.indexOf(cssVarPrefix, i + 1);\n }\n\n return ranges;\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 rgb or\n * rgba color strings.\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 */\nexport function resolveCssVariablesInRecord<T extends Record<string, string>>(\n record: T,\n targetElement: HTMLElement = document.body\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 targetElement.appendChild(tmpPropEl);\n\n const varExpressions = [...extractDistinctCssVariableExpressions(record)];\n\n // Set temporary css variables for resolving var expressions\n varExpressions.forEach((varExpression, i) => {\n const tmpPropKey = `--${TMP_CSS_PROP_PREFIX}-${i}`;\n tmpPropEl.style.setProperty(tmpPropKey, varExpression);\n });\n\n const result = {} as T;\n\n const computedStyle = window.getComputedStyle(tmpPropEl);\n\n const resolver = (varExpression: string): string => {\n const tmpPropKey = `--${TMP_CSS_PROP_PREFIX}-${varExpressions.indexOf(\n varExpression\n )}`;\n\n const resolved = computedStyle.getPropertyValue(tmpPropKey);\n\n return ColorUtils.normalizeCssColor(resolved);\n };\n\n // Resolve the temporary css variables\n Object.entries(record).forEach(([key, value]) => {\n result[key as keyof T] = resolveCssVariablesInString(\n resolver,\n value\n ) as T[keyof T];\n });\n\n // Remove the temporary css variables\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 getCssVariableRanges(value).forEach(([start, end]) => {\n if (i < start) {\n result.push(value.substring(i, start));\n i += start - i;\n }\n\n result.push(resolver(value.substring(start, end + 1)));\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 * 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 * Preload minimal theme variables from the cache.\n */\nexport function preloadTheme(): void {\n const preloadStyleContent =\n getThemePreloadData()?.preloadStyleContent ??\n calculatePreloadStyleContent();\n\n log.debug('Preloading theme content:', `'${preloadStyleContent}'`);\n\n const style = document.createElement('style');\n style.innerHTML = preloadStyleContent;\n document.head.appendChild(style);\n}\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,gBAAgB;AAChC,SAASC,aAAa,EAAEC,UAAU,QAAQ,kBAAkB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,SACSC,SAAS;AAAA,SACTC,UAAU;AAAA,SAEjBC,sBAAsB,EACtBC,uBAAuB,EACvBC,8BAA8B,EAK9BC,6BAA6B;AAG/B,IAAMC,GAAG,GAAGT,GAAG,CAACU,MAAM,CAAC,YAAY,CAAC;AAEpC,OAAO,IAAMC,mBAAmB,GAAG,QAAQ;AAI3C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4B,GAA6B;EACvE,IAAMC,SAAS,GAAGC,gBAAgB,CAACC,QAAQ,CAACC,IAAI,CAAC;;EAEjD;EACA;EACA,IAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACZ,8BAA8B,CAAC,CAACa,GAAG,CAC9D;IAAA,IAAC,CAACC,GAAG,EAAEC,YAAY,CAAC;IAAA,iBACfD,GAAG,cAAIR,SAAS,CAACU,gBAAgB,CAACF,GAAG,CAAC,IAAIC,YAAY;EAAA,CAAE,CAC9D;EAED,uBAAgBL,KAAK,CAACO,IAAI,CAAC,GAAG,CAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qCAAqC,CACnDC,MAA8B,EACjB;EACb,IAAMC,GAAG,GAAG,IAAIC,GAAG,EAAU;E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AC;IAChB;IAEAgB,MAAM,CAACd,IAAI,CAACiB,QAAQ,CAAChD,KAAK,CAACK,SAAS,CAACH,KAAK,EAAEC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAEtD0B,CAAC,IAAI1B,GAAG,GAAGD,KAAK,GAAG,CAAC;EACtB,CAAC,CAAC;EAEF,IAAI2C,MAAM,CAACf,MAAM,KAAK,CAAC,EAAE;IACvB,OAAO9B,KAAK;EACd;EAEA,OAAO6C,MAAM,CAACpD,IAAI,CAAC,EAAE,CAAC;AACxB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAAS4D,mBAAmB,CAACC,WAA6B,EAAQ;EACvEjC,YAAY,CAACkC,OAAO,CAClB9E,6BAA6B,EAC7B8C,IAAI,CAACiC,SAAS,CAACF,WAAW,CAAC,CAC5B;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,WAAW,CAACC,UAAkB,EAAEC,SAAiB,EAAU;EACzE,iBAAUD,UAAU,cAAIC,SAAS;AACnC;;AAEA;AACA;AACA;AACA,OAAO,SAASC,YAAY,GAAS;EAAA;EACnC,IAAMC,mBAAmB,oDACvB1C,mBAAmB,EAAE,yDAArB,qBAAuB0C,mBAAmB,yEAC1ChF,4BAA4B,EAAE;EAEhCH,GAAG,CAACqC,KAAK,CAAC,2BAA2B,aAAM8C,mBAAmB,OAAI;EAElE,IAAMlB,KAAK,GAAG3D,QAAQ,CAACsD,aAAa,CAAC,OAAO,CAAC;EAC7CK,KAAK,CAACmB,SAAS,GAAGD,mBAAmB;EACrC7E,QAAQ,CAAC+E,IAAI,CAACxB,WAAW,CAACI,KAAK,CAAC;AAClC"}
1
+ {"version":3,"file":"ThemeUtils.js","names":["Log","assertNotNull","ColorUtils","themeDark","themeLight","DEFAULT_DARK_THEME_KEY","DEFAULT_LIGHT_THEME_KEY","DEFAULT_PRELOAD_DATA_VARIABLES","THEME_CACHE_LOCAL_STORAGE_KEY","log","module","TMP_CSS_PROP_PREFIX","calculatePreloadStyleContent","bodyStyle","getComputedStyle","document","body","pairs","Object","entries","map","_ref","key","defaultValue","concat","getPropertyValue","join","extractDistinctCssVariableExpressions","record","set","Set","values","forEach","value","getCssVariableRanges","_ref2","start","end","add","substring","getActiveThemes","themeKey","themeRegistration","_custom$baseThemeKey","custom","find","theme","baseThemeKey","base","error","debug","getDefaultBaseThemes","name","styleContent","getThemePreloadData","data","localStorage","getItem","JSON","parse","_unused","ranges","cssVarPrefix","indexOf","parenLevel","i","length","push","resolveCssVariablesInRecord","targetElement","arguments","undefined","perfStart","performance","now","tmpPropEl","createElement","appendChild","varExpressions","varExpression","tmpPropKey","style","setProperty","result","computedStyle","window","resolver","resolved","normalizeCssColor","_ref3","resolveCssVariablesInString","remove","_ref4","setThemePreloadData","preloadData","setItem","stringify","getThemeKey","pluginName","themeName","preloadTheme","_getThemePreloadData$","_getThemePreloadData","preloadStyleContent","innerHTML","head"],"sources":["../../src/theme/ThemeUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport { assertNotNull, ColorUtils } from '@deephaven/utils';\n// Note that ?inline imports are natively supported by Vite, but consumers of\n// @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// },\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 ThemeData,\n ThemePreloadData,\n ThemePreloadStyleContent,\n ThemeRegistrationData,\n THEME_CACHE_LOCAL_STORAGE_KEY,\n} from './ThemeModel';\n\nconst log = Log.module('ThemeUtils');\n\nexport const TMP_CSS_PROP_PREFIX = 'dh-tmp';\n\nexport type VarExpressionResolver = (varExpression: string) => string;\n\n/**\n * Creates a string containing preload style content for the current theme.\n * This resolves the current values of a few CSS variables that can be used\n * to style the page before the theme is loaded on next page load.\n */\nexport function calculatePreloadStyleContent(): ThemePreloadStyleContent {\n const bodyStyle = getComputedStyle(document.body);\n\n // Calculate the current preload variables. If the variable is not set, use\n // the default value.\n const pairs = Object.entries(DEFAULT_PRELOAD_DATA_VARIABLES).map(\n ([key, defaultValue]) =>\n `${key}:${bodyStyle.getPropertyValue(key) || defaultValue}`\n );\n\n return `:root{${pairs.join(';')}}`;\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 getCssVariableRanges(value).forEach(([start, end]) => {\n set.add(value.substring(start, end + 1));\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 {\n name: 'Default Light',\n themeKey: DEFAULT_LIGHT_THEME_KEY,\n styleContent: themeLight,\n },\n ];\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 css variable expressions in the given\n * string.\n *\n * e.g.\n * getCssVariableRanges('var(--aaa-aa) var(--bbb-bb)')\n * yields:\n * [\n * [0, 12],\n * [14, 26],\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 * getCssVariableRanges('var(--ccc-cc, var(--aaa-aa, green)) var(--bbb-bb)')\n * yields:\n * [\n * [0, 34], // range for --ccc-cc expression\n * [36, 48], // range for --bbb-bb expression\n * ]\n * @param value The string to search for css variable expressions\n * @returns An array of [start, end] index pairs for each css variable expression\n */\nexport function getCssVariableRanges(value: string): [number, number][] {\n const ranges: [number, number][] = [];\n\n const cssVarPrefix = 'var(--';\n let start = value.indexOf(cssVarPrefix);\n let parenLevel = 0;\n\n while (start > -1) {\n parenLevel = 1;\n let i = start + cssVarPrefix.length;\n for (; i < value.length; i += 1) {\n if (value[i] === '(') {\n parenLevel += 1;\n } else if (value[i] === ')') {\n parenLevel -= 1;\n }\n\n if (parenLevel === 0) {\n ranges.push([start, i]);\n break;\n }\n }\n\n if (parenLevel !== 0) {\n log.error('Unbalanced parentheses in css var expression', value);\n return [];\n }\n\n start = value.indexOf(cssVarPrefix, i + 1);\n }\n\n return ranges;\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 rgb or\n * rgba color strings.\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 */\nexport function resolveCssVariablesInRecord<T extends Record<string, string>>(\n record: T,\n targetElement: HTMLElement = document.body\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 targetElement.appendChild(tmpPropEl);\n\n const varExpressions = [...extractDistinctCssVariableExpressions(record)];\n\n // Set temporary css variables for resolving var expressions\n varExpressions.forEach((varExpression, i) => {\n const tmpPropKey = `--${TMP_CSS_PROP_PREFIX}-${i}`;\n tmpPropEl.style.setProperty(tmpPropKey, varExpression);\n });\n\n const result = {} as T;\n\n const computedStyle = window.getComputedStyle(tmpPropEl);\n\n const resolver = (varExpression: string): string => {\n const tmpPropKey = `--${TMP_CSS_PROP_PREFIX}-${varExpressions.indexOf(\n varExpression\n )}`;\n\n const resolved = computedStyle.getPropertyValue(tmpPropKey);\n\n return ColorUtils.normalizeCssColor(resolved);\n };\n\n // Resolve the temporary css variables\n Object.entries(record).forEach(([key, value]) => {\n result[key as keyof T] = resolveCssVariablesInString(\n resolver,\n value\n ) as T[keyof T];\n });\n\n // Remove the temporary css variables\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 getCssVariableRanges(value).forEach(([start, end]) => {\n if (i < start) {\n result.push(value.substring(i, start));\n i += start - i;\n }\n\n result.push(resolver(value.substring(start, end + 1)));\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 * 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 * Preload minimal theme variables from the cache.\n */\nexport function preloadTheme(): void {\n const preloadStyleContent =\n getThemePreloadData()?.preloadStyleContent ??\n calculatePreloadStyleContent();\n\n log.debug('Preloading theme content:', `'${preloadStyleContent}'`);\n\n const style = document.createElement('style');\n style.innerHTML = preloadStyleContent;\n document.head.appendChild(style);\n}\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,gBAAgB;AAChC,SAASC,aAAa,EAAEC,UAAU,QAAQ,kBAAkB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,SACSC,SAAS;AAAA,SACTC,UAAU;AAAA,SAEjBC,sBAAsB,EACtBC,uBAAuB,EACvBC,8BAA8B,EAK9BC,6BAA6B;AAG/B,IAAMC,GAAG,GAAGT,GAAG,CAACU,MAAM,CAAC,YAAY,CAAC;AAEpC,OAAO,IAAMC,mBAAmB,GAAG,QAAQ;AAI3C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAAA,EAA6B;EACvE,IAAMC,SAAS,GAAGC,gBAAgB,CAACC,QAAQ,CAACC,IAAI,CAAC;;EAEjD;EACA;EACA,IAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACZ,8BAA8B,CAAC,CAACa,GAAG,CAC9DC,IAAA;IAAA,IAAC,CAACC,GAAG,EAAEC,YAAY,CAAC,GAAAF,IAAA;IAAA,UAAAG,MAAA,CACfF,GAAG,OAAAE,MAAA,C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1E,MAAA,CAAI2E,SAAS;AACnC;;AAEA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAAS;EAAA,IAAAC,qBAAA,EAAAC,oBAAA;EACnC,IAAMC,mBAAmB,IAAAF,qBAAA,IAAAC,oBAAA,GACvBhD,mBAAmB,CAAC,CAAC,cAAAgD,oBAAA,uBAArBA,oBAAA,CAAuBC,mBAAmB,cAAAF,qBAAA,cAAAA,qBAAA,GAC1CzF,4BAA4B,CAAC,CAAC;EAEhCH,GAAG,CAACyC,KAAK,CAAC,2BAA2B,MAAA1B,MAAA,CAAM+E,mBAAmB,MAAG,CAAC;EAElE,IAAMtB,KAAK,GAAGlE,QAAQ,CAAC6D,aAAa,CAAC,OAAO,CAAC;EAC7CK,KAAK,CAACuB,SAAS,GAAGD,mBAAmB;EACrCxF,QAAQ,CAAC0F,IAAI,CAAC5B,WAAW,CAACI,KAAK,CAAC;AAClC"}
@@ -1,3 +1,27 @@
1
+ /**
2
+ * DH theme variables are imported via Vite `?inline` query which provides the
3
+ * text content of the variable files as a string. The exported theme is just a
4
+ * concatenation of the contents of all of these imports.
5
+ *
6
+ * e.g.
7
+ *
8
+ * :root {
9
+ * --dh-color-from-dark-palette: #fff;
10
+ * --dh-color-from-dark-palette2: #ccc;
11
+ * }
12
+ * :root {
13
+ * --dh-color-from-dark-semantic: #000;
14
+ * }
15
+ * :root {
16
+ * --dh-color-from-dark-semantic-editor: #000;
17
+ * }
18
+ * :root {
19
+ * --dh-color-from-dark-semantic-grid: #000;
20
+ * }
21
+ * :root {
22
+ * --dh-color-from-dark-components: #000;
23
+ * }
24
+ */
1
25
  export declare const themeDark: string;
2
26
  export default themeDark;
3
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/theme-dark/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,QAKV,CAAC;AAEb,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/theme-dark/index.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,SAAS,QAMV,CAAC;AAEb,eAAe,SAAS,CAAC"}
@@ -2,6 +2,31 @@ import themeDarkPalette from "./theme-dark-palette.css?inline";
2
2
  import themeDarkSemantic from "./theme-dark-semantic.css?inline";
3
3
  import themeDarkSemanticEditor from "./theme-dark-semantic-editor.css?inline";
4
4
  import themeDarkSemanticGrid from "./theme-dark-semantic-grid.css?inline";
5
- export var themeDark = [themeDarkPalette, themeDarkSemantic, themeDarkSemanticEditor, themeDarkSemanticGrid].join('\n');
5
+ import themeDarkComponents from "./theme-dark-components.css?inline";
6
+ /**
7
+ * DH theme variables are imported via Vite `?inline` query which provides the
8
+ * text content of the variable files as a string. The exported theme is just a
9
+ * concatenation of the contents of all of these imports.
10
+ *
11
+ * e.g.
12
+ *
13
+ * :root {
14
+ * --dh-color-from-dark-palette: #fff;
15
+ * --dh-color-from-dark-palette2: #ccc;
16
+ * }
17
+ * :root {
18
+ * --dh-color-from-dark-semantic: #000;
19
+ * }
20
+ * :root {
21
+ * --dh-color-from-dark-semantic-editor: #000;
22
+ * }
23
+ * :root {
24
+ * --dh-color-from-dark-semantic-grid: #000;
25
+ * }
26
+ * :root {
27
+ * --dh-color-from-dark-components: #000;
28
+ * }
29
+ */
30
+ export var themeDark = [themeDarkPalette, themeDarkSemantic, themeDarkSemanticEditor, themeDarkSemanticGrid, themeDarkComponents].join('\n');
6
31
  export default themeDark;
7
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["themeDarkPalette","themeDarkSemantic","themeDarkSemanticEditor","themeDarkSemanticGrid","themeDark","join"],"sources":["../../../src/theme/theme-dark/index.ts"],"sourcesContent":["import themeDarkPalette from './theme-dark-palette.css?inline';\nimport themeDarkSemantic from './theme-dark-semantic.css?inline';\nimport themeDarkSemanticEditor from './theme-dark-semantic-editor.css?inline';\nimport themeDarkSemanticGrid from './theme-dark-semantic-grid.css?inline';\n\nexport const themeDark = [\n themeDarkPalette,\n themeDarkSemantic,\n themeDarkSemanticEditor,\n themeDarkSemanticGrid,\n].join('\\n');\n\nexport default themeDark;\n"],"mappings":"OAAOA,gBAAgB;AAAA,OAChBC,iBAAiB;AAAA,OACjBC,uBAAuB;AAAA,OACvBC,qBAAqB;AAE5B,OAAO,IAAMC,SAAS,GAAG,CACvBJ,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,qBAAqB,CACtB,CAACE,IAAI,CAAC,IAAI,CAAC;AAEZ,eAAeD,SAAS"}
1
+ {"version":3,"file":"index.js","names":["themeDarkPalette","themeDarkSemantic","themeDarkSemanticEditor","themeDarkSemanticGrid","themeDarkComponents","themeDark","join"],"sources":["../../../src/theme/theme-dark/index.ts"],"sourcesContent":["import themeDarkPalette from './theme-dark-palette.css?inline';\nimport themeDarkSemantic from './theme-dark-semantic.css?inline';\nimport themeDarkSemanticEditor from './theme-dark-semantic-editor.css?inline';\nimport themeDarkSemanticGrid from './theme-dark-semantic-grid.css?inline';\nimport themeDarkComponents from './theme-dark-components.css?inline';\n\n/**\n * DH theme variables are imported via Vite `?inline` 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 * 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 themeDarkSemanticEditor,\n themeDarkSemanticGrid,\n themeDarkComponents,\n].join('\\n');\n\nexport default themeDark;\n"],"mappings":"OAAOA,gBAAgB;AAAA,OAChBC,iBAAiB;AAAA,OACjBC,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,OAAO,IAAMC,SAAS,GAAG,CACvBL,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,qBAAqB,EACrBC,mBAAmB,CACpB,CAACE,IAAI,CAAC,IAAI,CAAC;AAEZ,eAAeD,SAAS"}
@@ -0,0 +1,8 @@
1
+ /* stylelint-disable alpha-value-notation */
2
+ :root {
3
+ --dh-color-quickactions-bg: hsla(var(--dh-color-gray-hue), 0%, 11%, 0.9);
4
+ --dh-color-radial-reaction: hsla(var(--dh-color-gray-hue), 0%, 92%, 0.6);
5
+ --dh-color-colorpicker-border: hsla(var(--dh-color-gray-hue), 0%, 94%, 0.1);
6
+ }
7
+
8
+ /*# sourceMappingURL=theme-dark-components.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../../../src/theme/theme-dark/theme-dark-components.css"],"names":[],"mappings":"AAAA;AACA;EACE;EACA;EACA","file":"theme-dark-components.css","sourcesContent":["/* stylelint-disable alpha-value-notation */\n:root {\n --dh-color-quickactions-bg: hsla(var(--dh-color-gray-hue), 0%, 11%, 0.9);\n --dh-color-radial-reaction: hsla(var(--dh-color-gray-hue), 0%, 92%, 0.6);\n --dh-color-colorpicker-border: hsla(var(--dh-color-gray-hue), 0%, 94%, 0.1);\n}\n"]}
@@ -32,6 +32,21 @@
32
32
  --dh-color-accent-background-hover: var(--dh-color-accent-500);
33
33
  --dh-color-accent-background-down: var(--dh-color-accent-400);
34
34
  --dh-color-accent-background-key-focus: var(--dh-color-accent-500);
35
+ /* Background Defaults */
36
+ --dh-color-default-gray-bg: var(--dh-color-gray-700);
37
+ --dh-color-default-blue-bg: var(--dh-color-blue-700);
38
+ --dh-color-default-red-bg: var(--dh-color-red-700);
39
+ --dh-color-default-orange-bg: var(--dh-color-orange-800);
40
+ --dh-color-default-yellow-bg: var(--dh-color-yellow-1000);
41
+ --dh-color-default-chartreuse-bg: var(--dh-color-chartreuse-900);
42
+ --dh-color-default-celery-bg: var(--dh-color-celery-800);
43
+ --dh-color-default-green-bg: var(--dh-color-green-700);
44
+ --dh-color-default-seafoam-bg: var(--dh-color-seafoam-700);
45
+ --dh-color-default-cyan-bg: var(--dh-color-cyan-700);
46
+ --dh-color-default-indigo-bg: var(--dh-color-indigo-700);
47
+ --dh-color-default-purple-bg: var(--dh-color-purple-700);
48
+ --dh-color-default-fuchsia-bg: var(--dh-color-fuchsia-700);
49
+ --dh-color-default-magenta-bg: var(--dh-color-magenta-700);
35
50
  /* Focus */
36
51
  --dh-color-focus: var(--dh-color-blue-800);
37
52
  --dh-color-focus-border: var(--dh-color-blue-800);
@@ -47,11 +62,39 @@
47
62
  62%,
48
63
  0.2
49
64
  );
65
+ /* Shadows / Overlays */
66
+ --dh-color-dropshadow: hsla(var(--dh-color-gray-hue), 0, 0, 0.8);
67
+ --dh-color-overlay-modal-bg: hsla(var(--dh-color-gray-hue), 0%, 0%, 0.6);
68
+ --dh-color-overlay-hover-bg: hsla(var(--dh-color-gray-hue), 0%, 100%, 0.08);
50
69
  /* Negative Background */
51
- --dh-color-negative-background-default: var(--dh-color-red-600);
52
- --dh-color-negative-background-hover: var(--dh-color-red-500);
53
- --dh-color-negative-background-down: var(--dh-color-red-400);
54
- --dh-color-negative-background-key-focus: var(--dh-color-red-500);
70
+ --dh-color-negative-default-bg: var(--dh-color-red-600);
71
+ --dh-color-negative-hover-bg: var(--dh-color-red-500);
72
+ --dh-color-negative-down-bg: var(--dh-color-red-400);
73
+ --dh-color-negative-key-focus-bg: var(--dh-color-red-500);
74
+ /* Neutral */
75
+ --dh-neutral-default-bg: var(--dh-color-gray-500);
76
+ --dh-neutral-hover-bg: var(--dh-color-gray-400);
77
+ --dh-neutral-down-bg: var(--dh-color-gray-300);
78
+ --dh-neutral-key-focus-bg: var(--dh-color-gray-400);
79
+ --dh-neutral-subdued-default-bg: var(--dh-color-gray-400);
80
+ --dh-neutral-subdued-hover-bg: var(--dh-color-gray-300);
81
+ --dh-neutral-subdued-down-bg: var(--dh-color-gray-200);
82
+ --dh-neutral-subdued-key-focus-bg: var(--dh-color-gray-300);
83
+ /* Positive */
84
+ --dh-color-positive-default-bg: var(--dh-color-green-900);
85
+ --dh-color-positive-hover-bg: var(--dh-color-green-800);
86
+ --dh-color-positive-down-bg: var(--dh-color-green-700);
87
+ --dh-color-positive-key-focus-bg: var(--dh-color-green-800);
88
+ /* Informative */
89
+ --dh-color-info-default-bg: var(--dh-color-cyan-1000);
90
+ --dh-color-info-hover-bg: var(--dh-color-cyan-900);
91
+ --dh-color-info-down-bg: var(--dh-color-cyan-800);
92
+ --dh-color-info-key-focus-bg: var(--dh-color-cyan-900);
93
+ /* Notice */
94
+ --dh-color-notice-default-bg: var(--dh-color-yellow-1000);
95
+ --dh-color-notice-hover-bg: var(--dh-color-yellow-900);
96
+ --dh-color-notice-down-bg: var(--dh-color-yellow-800);
97
+ --dh-color-notice-key-focus-bg: var(--dh-color-yellow-1000);
55
98
  /* Visual Colors */
56
99
  --dh-color-visual-blue: var(--dh-color-blue-700);
57
100
  --dh-color-visual-celery: var(--dh-color-celery-1000);
@@ -70,6 +113,10 @@
70
113
  --dh-color-visual-positive: var(--dh-color-green-1100);
71
114
  --dh-color-visual-negative: var(--dh-color-red-800);
72
115
  --dh-color-visual-notice: var(--dh-color-yellow-1200);
116
+ --dh-color-visual-info: var(--dh-color-cyan-1100);
117
+ /* Wells */
118
+ --dh-color-well-bg: hsla(var(--dh-color-gray-hue) 0% 92% 0.02);
119
+ --dh-color-well-border: hsla(var(--dh-color-gray-hue) 0% 94% 0.05);
73
120
  }
74
121
 
75
122
  /*# sourceMappingURL=theme-dark-semantic.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../src/theme/theme-dark/theme-dark-semantic.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACE;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA","file":"theme-dark-semantic.css","sourcesContent":["/* stylelint-disable custom-property-empty-line-before */\n/* stylelint-disable alpha-value-notation */\n:root {\n /* General */\n --dh-color-accent: var(--dh-color-blue-700);\n --dh-color-border: var(--dh-color-gray-500);\n --dh-color-background: var(--dh-color-black);\n --dh-color-foreground: var(--dh-color-white);\n --dh-color-content-background: var(--dh-color-gray-100);\n\n /* Text */\n --dh-color-heading-text: var(--dh-color-gray-900);\n --dh-color-text: var(--dh-color-gray-800);\n --dh-color-text-disabled: var(--dh-color-gray-400);\n --dh-color-text-highlight: hsla(var(--dh-color-blue-hue), 83%, 62%, 0.3);\n\n /** Accent Colors */\n --dh-color-accent-100: var(--dh-color-blue-100);\n --dh-color-accent-200: var(--dh-color-blue-200);\n --dh-color-accent-300: var(--dh-color-blue-300);\n --dh-color-accent-400: var(--dh-color-blue-400);\n --dh-color-accent-500: var(--dh-color-blue-500);\n --dh-color-accent-600: var(--dh-color-blue-600);\n --dh-color-accent-700: var(--dh-color-blue-700);\n --dh-color-accent-800: var(--dh-color-blue-800);\n --dh-color-accent-900: var(--dh-color-blue-900);\n --dh-color-accent-1000: var(--dh-color-blue-1000);\n --dh-color-accent-1100: var(--dh-color-blue-1100);\n --dh-color-accent-1200: var(--dh-color-blue-1200);\n --dh-color-accent-1300: var(--dh-color-blue-1300);\n --dh-color-accent-1400: var(--dh-color-blue-1400);\n\n /* Accent Background */\n --dh-color-accent-background-default: var(--dh-color-accent-600);\n --dh-color-accent-background-hover: var(--dh-color-accent-500);\n --dh-color-accent-background-down: var(--dh-color-accent-400);\n --dh-color-accent-background-key-focus: var(--dh-color-accent-500);\n\n /* Focus */\n --dh-color-focus: var(--dh-color-blue-800);\n --dh-color-focus-border: var(--dh-color-blue-800);\n --dh-color-focus-ring: var(--dh-color-focus);\n\n /* Highlight */\n --dh-color-highlight-active: hsla(var(--dh-color-gray-hue), 0%, 94%, 0.15);\n --dh-color-highlight-hover: hsla(var(--dh-color-gray-hue), 0%, 100%, 0.08);\n --dh-color-highlight-invalid: hsla(var(--dh-color-red-hue), 80%, 48%, 0.15);\n --dh-color-highlight-selected: hsla(var(--dh-color-blue-hue), 83%, 62%, 0.13);\n --dh-color-highlight-selected-hover: hsla(\n var(--dh-color-blue-hue),\n 83%,\n 62%,\n 0.2\n );\n\n /* Negative Background */\n --dh-color-negative-background-default: var(--dh-color-red-600);\n --dh-color-negative-background-hover: var(--dh-color-red-500);\n --dh-color-negative-background-down: var(--dh-color-red-400);\n --dh-color-negative-background-key-focus: var(--dh-color-red-500);\n\n /* Visual Colors */\n --dh-color-visual-blue: var(--dh-color-blue-700);\n --dh-color-visual-celery: var(--dh-color-celery-1000);\n --dh-color-visual-chartreuse: var(--dh-color-chartreuse-1100);\n --dh-color-visual-cyan: var(--dh-color-cyan-1100);\n --dh-color-visual-fuchsia: var(--dh-color-fuchsia-900);\n --dh-color-visual-gray: var(--dh-color-gray-600);\n --dh-color-visual-green: var(--dh-color-green-1100);\n --dh-color-visual-indigo: var(--dh-color-indigo-900);\n --dh-color-visual-magenta: var(--dh-color-magenta-900);\n --dh-color-visual-orange: var(--dh-color-orange-900);\n --dh-color-visual-purple: var(--dh-color-purple-900);\n --dh-color-visual-red: var(--dh-color-red-800);\n --dh-color-visual-seafoam: var(--dh-color-seafoam-1100);\n --dh-color-visual-yellow: var(--dh-color-yellow-1200);\n\n --dh-color-visual-positive: var(--dh-color-green-1100);\n --dh-color-visual-negative: var(--dh-color-red-800);\n --dh-color-visual-notice: var(--dh-color-yellow-1200);\n}\n"]}
1
+ {"version":3,"sourceRoot":"","sources":["../../../src/theme/theme-dark/theme-dark-semantic.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACE;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;AAEA;EACA;EACA","file":"theme-dark-semantic.css","sourcesContent":["/* stylelint-disable custom-property-empty-line-before */\n/* stylelint-disable alpha-value-notation */\n:root {\n /* General */\n --dh-color-accent: var(--dh-color-blue-700);\n --dh-color-border: var(--dh-color-gray-500);\n --dh-color-background: var(--dh-color-black);\n --dh-color-foreground: var(--dh-color-white);\n --dh-color-content-background: var(--dh-color-gray-100);\n\n /* Text */\n --dh-color-heading-text: var(--dh-color-gray-900);\n --dh-color-text: var(--dh-color-gray-800);\n --dh-color-text-disabled: var(--dh-color-gray-400);\n --dh-color-text-highlight: hsla(var(--dh-color-blue-hue), 83%, 62%, 0.3);\n\n /** Accent Colors */\n --dh-color-accent-100: var(--dh-color-blue-100);\n --dh-color-accent-200: var(--dh-color-blue-200);\n --dh-color-accent-300: var(--dh-color-blue-300);\n --dh-color-accent-400: var(--dh-color-blue-400);\n --dh-color-accent-500: var(--dh-color-blue-500);\n --dh-color-accent-600: var(--dh-color-blue-600);\n --dh-color-accent-700: var(--dh-color-blue-700);\n --dh-color-accent-800: var(--dh-color-blue-800);\n --dh-color-accent-900: var(--dh-color-blue-900);\n --dh-color-accent-1000: var(--dh-color-blue-1000);\n --dh-color-accent-1100: var(--dh-color-blue-1100);\n --dh-color-accent-1200: var(--dh-color-blue-1200);\n --dh-color-accent-1300: var(--dh-color-blue-1300);\n --dh-color-accent-1400: var(--dh-color-blue-1400);\n\n /* Accent Background */\n --dh-color-accent-background-default: var(--dh-color-accent-600);\n --dh-color-accent-background-hover: var(--dh-color-accent-500);\n --dh-color-accent-background-down: var(--dh-color-accent-400);\n --dh-color-accent-background-key-focus: var(--dh-color-accent-500);\n\n /* Background Defaults */\n --dh-color-default-gray-bg: var(--dh-color-gray-700);\n --dh-color-default-blue-bg: var(--dh-color-blue-700);\n --dh-color-default-red-bg: var(--dh-color-red-700);\n --dh-color-default-orange-bg: var(--dh-color-orange-800);\n --dh-color-default-yellow-bg: var(--dh-color-yellow-1000);\n --dh-color-default-chartreuse-bg: var(--dh-color-chartreuse-900);\n --dh-color-default-celery-bg: var(--dh-color-celery-800);\n --dh-color-default-green-bg: var(--dh-color-green-700);\n --dh-color-default-seafoam-bg: var(--dh-color-seafoam-700);\n --dh-color-default-cyan-bg: var(--dh-color-cyan-700);\n --dh-color-default-indigo-bg: var(--dh-color-indigo-700);\n --dh-color-default-purple-bg: var(--dh-color-purple-700);\n --dh-color-default-fuchsia-bg: var(--dh-color-fuchsia-700);\n --dh-color-default-magenta-bg: var(--dh-color-magenta-700);\n\n /* Focus */\n --dh-color-focus: var(--dh-color-blue-800);\n --dh-color-focus-border: var(--dh-color-blue-800);\n --dh-color-focus-ring: var(--dh-color-focus);\n\n /* Highlight */\n --dh-color-highlight-active: hsla(var(--dh-color-gray-hue), 0%, 94%, 0.15);\n --dh-color-highlight-hover: hsla(var(--dh-color-gray-hue), 0%, 100%, 0.08);\n --dh-color-highlight-invalid: hsla(var(--dh-color-red-hue), 80%, 48%, 0.15);\n --dh-color-highlight-selected: hsla(var(--dh-color-blue-hue), 83%, 62%, 0.13);\n --dh-color-highlight-selected-hover: hsla(\n var(--dh-color-blue-hue),\n 83%,\n 62%,\n 0.2\n );\n\n /* Shadows / Overlays */\n --dh-color-dropshadow: hsla(var(--dh-color-gray-hue), 0, 0, 0.8);\n --dh-color-overlay-modal-bg: hsla(var(--dh-color-gray-hue), 0%, 0%, 0.6);\n --dh-color-overlay-hover-bg: hsla(var(--dh-color-gray-hue), 0%, 100%, 0.08);\n\n /* Negative Background */\n --dh-color-negative-default-bg: var(--dh-color-red-600);\n --dh-color-negative-hover-bg: var(--dh-color-red-500);\n --dh-color-negative-down-bg: var(--dh-color-red-400);\n --dh-color-negative-key-focus-bg: var(--dh-color-red-500);\n\n /* Neutral */\n --dh-neutral-default-bg: var(--dh-color-gray-500);\n --dh-neutral-hover-bg: var(--dh-color-gray-400);\n --dh-neutral-down-bg: var(--dh-color-gray-300);\n --dh-neutral-key-focus-bg: var(--dh-color-gray-400);\n\n --dh-neutral-subdued-default-bg: var(--dh-color-gray-400);\n --dh-neutral-subdued-hover-bg: var(--dh-color-gray-300);\n --dh-neutral-subdued-down-bg: var(--dh-color-gray-200);\n --dh-neutral-subdued-key-focus-bg: var(--dh-color-gray-300);\n\n /* Positive */\n --dh-color-positive-default-bg: var(--dh-color-green-900);\n --dh-color-positive-hover-bg: var(--dh-color-green-800);\n --dh-color-positive-down-bg: var(--dh-color-green-700);\n --dh-color-positive-key-focus-bg: var(--dh-color-green-800);\n\n /* Informative */\n --dh-color-info-default-bg: var(--dh-color-cyan-1000);\n --dh-color-info-hover-bg: var(--dh-color-cyan-900);\n --dh-color-info-down-bg: var(--dh-color-cyan-800);\n --dh-color-info-key-focus-bg: var(--dh-color-cyan-900);\n\n /* Notice */\n --dh-color-notice-default-bg: var(--dh-color-yellow-1000);\n --dh-color-notice-hover-bg: var(--dh-color-yellow-900);\n --dh-color-notice-down-bg: var(--dh-color-yellow-800);\n --dh-color-notice-key-focus-bg: var(--dh-color-yellow-1000);\n\n /* Visual Colors */\n --dh-color-visual-blue: var(--dh-color-blue-700);\n --dh-color-visual-celery: var(--dh-color-celery-1000);\n --dh-color-visual-chartreuse: var(--dh-color-chartreuse-1100);\n --dh-color-visual-cyan: var(--dh-color-cyan-1100);\n --dh-color-visual-fuchsia: var(--dh-color-fuchsia-900);\n --dh-color-visual-gray: var(--dh-color-gray-600);\n --dh-color-visual-green: var(--dh-color-green-1100);\n --dh-color-visual-indigo: var(--dh-color-indigo-900);\n --dh-color-visual-magenta: var(--dh-color-magenta-900);\n --dh-color-visual-orange: var(--dh-color-orange-900);\n --dh-color-visual-purple: var(--dh-color-purple-900);\n --dh-color-visual-red: var(--dh-color-red-800);\n --dh-color-visual-seafoam: var(--dh-color-seafoam-1100);\n --dh-color-visual-yellow: var(--dh-color-yellow-1200);\n\n --dh-color-visual-positive: var(--dh-color-green-1100);\n --dh-color-visual-negative: var(--dh-color-red-800);\n --dh-color-visual-notice: var(--dh-color-yellow-1200);\n --dh-color-visual-info: var(--dh-color-cyan-1100);\n\n /* Wells */\n --dh-color-well-bg: hsla(var(--dh-color-gray-hue) 0% 92% 0.02);\n --dh-color-well-border: hsla(var(--dh-color-gray-hue) 0% 94% 0.05);\n}\n"]}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Spectrum theme variables are exported as a map of css class names. The keys
3
+ * come from css classes in the imported css modules. The values are generated
4
+ * by Vite.
5
+ *
6
+ * e.g.
7
+ * {
8
+ * 'dh-spectrum-palette': '_dh-spectrum-palette_abr16_1',
9
+ * 'dh-spectrum-alias': '_dh-spectrum-alias_18mbe_1',
10
+ * }
11
+ */
12
+ export declare const themeSpectrumClassesCommon: {
13
+ [x: string]: string;
14
+ };
15
+ export default themeSpectrumClassesCommon;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/theme-spectrum/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B;;CAItC,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,22 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ import palette from "./theme-spectrum-palette.module.css";
7
+ import alias from "./theme-spectrum-alias.module.css";
8
+ import overrides from "./theme-spectrum-overrides.module.css";
9
+ /**
10
+ * Spectrum theme variables are exported as a map of css class names. The keys
11
+ * come from css classes in the imported css modules. The values are generated
12
+ * by Vite.
13
+ *
14
+ * e.g.
15
+ * {
16
+ * 'dh-spectrum-palette': '_dh-spectrum-palette_abr16_1',
17
+ * 'dh-spectrum-alias': '_dh-spectrum-alias_18mbe_1',
18
+ * }
19
+ */
20
+ export var themeSpectrumClassesCommon = _objectSpread(_objectSpread(_objectSpread({}, palette), alias), overrides);
21
+ export default themeSpectrumClassesCommon;
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["palette","alias","overrides","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';\nimport overrides from './theme-spectrum-overrides.module.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 ...overrides,\n};\n\nexport default themeSpectrumClassesCommon;\n"],"mappings":";;;;;OAAOA,OAAO;AAAA,OACPC,KAAK;AAAA,OACLC,SAAS;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,0BAA0B,GAAAC,aAAA,CAAAA,aAAA,CAAAA,aAAA,KAClCJ,OAAO,GACPC,KAAK,GACLC,SAAS,CACb;AAED,eAAeC,0BAA0B"}