@deephaven/components 0.55.1-beta.8 → 0.56.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.
- package/css/BaseStyleSheet.css +837 -3627
- package/css/BaseStyleSheet.css.map +1 -1
- package/dist/AutoCompleteInput.css +4 -4
- package/dist/AutoCompleteInput.css.map +1 -1
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +26 -2
- package/dist/Button.js.map +1 -1
- package/dist/ComboBox.css +7 -7
- package/dist/ComboBox.css.map +1 -1
- package/dist/CustomTimeSelect.css +9 -9
- package/dist/CustomTimeSelect.css.map +1 -1
- package/dist/DraggableItemList.css +14 -14
- package/dist/DraggableItemList.css.map +1 -1
- package/dist/ErrorBoundary.d.ts +26 -0
- package/dist/ErrorBoundary.d.ts.map +1 -0
- package/dist/ErrorBoundary.js +55 -0
- package/dist/ErrorBoundary.js.map +1 -0
- package/dist/HierarchicalCheckboxMenu.css +20 -6
- package/dist/HierarchicalCheckboxMenu.css.map +1 -1
- package/dist/HierarchicalCheckboxMenu.d.ts.map +1 -1
- package/dist/HierarchicalCheckboxMenu.js +2 -4
- package/dist/HierarchicalCheckboxMenu.js.map +1 -1
- package/dist/ItemList.css +1 -1
- package/dist/ItemList.css.map +1 -1
- package/dist/ItemListItem.css +7 -7
- package/dist/ItemListItem.css.map +1 -1
- package/dist/LoadingOverlay.css +1 -1
- package/dist/LoadingOverlay.css.map +1 -1
- package/dist/MaskedInput.css.map +1 -1
- package/dist/RandomAreaPlotAnimation.d.ts +1 -1
- package/dist/RandomAreaPlotAnimation.d.ts.map +1 -1
- package/dist/RandomAreaPlotAnimation.js +49 -13
- package/dist/RandomAreaPlotAnimation.js.map +1 -1
- package/dist/SearchInput.css +3 -3
- package/dist/SearchInput.css.map +1 -1
- package/dist/SelectValueList.css +3 -3
- package/dist/SelectValueList.css.map +1 -1
- package/dist/SocketedButton.css +33 -33
- package/dist/SocketedButton.css.map +1 -1
- package/dist/ThemeExport.module.css +33 -33
- package/dist/ThemeExport.module.css.map +1 -1
- package/dist/TimeSlider.css +10 -10
- package/dist/TimeSlider.css.map +1 -1
- package/dist/TimeSlider.module.css +10 -10
- package/dist/TimeSlider.module.css.map +1 -1
- package/dist/ToastNotification.css +4 -4
- package/dist/ToastNotification.css.map +1 -1
- package/dist/UISwitch.css +19 -19
- package/dist/UISwitch.css.map +1 -1
- package/dist/ValidateLabelInput.css +1 -1
- package/dist/ValidateLabelInput.css.map +1 -1
- package/dist/context-actions/ContextActions.css +19 -19
- package/dist/context-actions/ContextActions.css.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/menu-actions/DropdownMenu.css +2 -2
- package/dist/menu-actions/DropdownMenu.css.map +1 -1
- package/dist/navigation/MenuItem.css +9 -9
- package/dist/navigation/MenuItem.css.map +1 -1
- package/dist/navigation/Page.css.map +1 -1
- package/dist/navigation/Stack.css +2 -2
- package/dist/navigation/Stack.css.map +1 -1
- package/dist/popper/Popper.css +4 -4
- package/dist/popper/Popper.css.map +1 -1
- package/dist/theme/SpectrumThemeProvider.d.ts.map +1 -1
- package/dist/theme/SpectrumThemeProvider.js +1 -0
- package/dist/theme/SpectrumThemeProvider.js.map +1 -1
- package/dist/theme/ThemeModel.d.ts +1 -1
- package/dist/theme/ThemeModel.d.ts.map +1 -1
- package/dist/theme/ThemeModel.js +56 -7
- package/dist/theme/ThemeModel.js.map +1 -1
- package/dist/theme/ThemePicker.d.ts +4 -0
- package/dist/theme/ThemePicker.d.ts.map +1 -0
- package/dist/theme/ThemePicker.js +25 -0
- package/dist/theme/ThemePicker.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +2 -1
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +10 -8
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/ThemeUtils.d.ts +5 -3
- package/dist/theme/ThemeUtils.d.ts.map +1 -1
- package/dist/theme/ThemeUtils.js +18 -22
- package/dist/theme/ThemeUtils.js.map +1 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/theme-dark/theme-dark-components.css +1 -1
- package/dist/theme/theme-dark/theme-dark-components.css.map +1 -1
- package/dist/theme/theme-dark/theme-dark-palette.css +1 -1
- package/dist/theme/theme-dark/theme-dark-palette.css.map +1 -1
- package/dist/theme/theme-dark/theme-dark-semantic-chart.css +1 -1
- package/dist/theme/theme-dark/theme-dark-semantic-chart.css.map +1 -1
- package/dist/theme/theme-dark/theme-dark-semantic-editor.css +1 -1
- package/dist/theme/theme-dark/theme-dark-semantic-editor.css.map +1 -1
- package/dist/theme/theme-dark/theme-dark-semantic-grid.css +1 -1
- package/dist/theme/theme-dark/theme-dark-semantic-grid.css.map +1 -1
- package/dist/theme/theme-dark/theme-dark-semantic.css +1 -1
- package/dist/theme/theme-dark/theme-dark-semantic.css.map +1 -1
- package/dist/theme/theme-light/theme-light-palette.css +1 -1
- package/dist/theme/theme-light/theme-light-palette.css.map +1 -1
- package/dist/theme/theme-spectrum/theme-spectrum-alias.module.css +1 -1
- package/dist/theme/theme-spectrum/theme-spectrum-alias.module.css.map +1 -1
- package/package.json +7 -7
- package/scss/BaseStyleSheet.scss +68 -60
- package/scss/bootstrap_imports.scss +49 -0
- package/scss/bootstrap_override_functions.scss +31 -0
- package/scss/bootstrap_override_mixins_background_variant.scss +16 -0
- package/scss/bootstrap_override_mixins_buttons.scss +123 -0
- package/scss/bootstrap_override_mixins_forms.scss +231 -0
- package/scss/bootstrap_override_mixins_text_emphasis.scss +21 -0
- package/scss/bootstrap_overrides.scss +144 -101
- package/scss/new_variables.scss +18 -0
- package/scss/util.scss +2 -2
package/dist/MaskedInput.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../scss/custom.scss","../src/MaskedInput.scss","../scss/bootstrap_overrides.scss"],"names":[],"mappings":"AAAA;ACEA;EACE,aC+FA;ED9FA","file":"MaskedInput.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","@import '../scss/custom.scss';\n\n.masked-input {\n font-family: $font-family-sans-serif;\n font-variant-numeric: tabular-nums;\n}\n","// Styling overrides for bootstrap\n\n// Override / set color variables\n$red: #f95d84;\n$orange: #f37e3f;\n$yellow: #fcd65b;\n$green: #9edc6f;\n$blue: #76d9e4;\n$purple: #aa9af4;\n\n//Define some UI colors\n$interfacegray: #2d2a2e;\n$interfaceblue: #4878ea;\n$interfacewhite: #f0f0ee; //same as gray-200\n$interfaceblack: #1a171a;\n\n//Define our Gray scale\n$white: $interfacewhite;\n$gray-100: #fcfcfa;\n$gray-200: $interfacewhite;\n$gray-300: #c0bfbf;\n$gray-400: #929192;\n$gray-500: #5b5a5c;\n$gray-600: #555356;\n$gray-700: #403e41;\n$gray-800: #373438;\n$gray-850: #322f33;\n$gray-900: #211f22;\n$black: $interfaceblack;\n$content-bg: $interfacegray;\n$background: $interfaceblack;\n$foreground: $interfacewhite;\n\n//Load colors into map\n$colors: ();\n$colors: map-merge(\n (\n 'red': $red,\n 'orange': $orange,\n 'yellow': $yellow,\n 'green': $green,\n 'blue': $blue,\n 'purple': $purple,\n 'white': $white,\n 'black': $black,\n ),\n $colors\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: $interfaceblue;\n$primary-hover: darken($primary, 8%);\n$primary-dark: mix($primary, $content-bg, 25%);\n$primary-light: scale-color($primary, $lightness: -25%);\n$secondary: $gray-500;\n$secondary-hover: darken($secondary, 8%);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: $red;\n$danger-hover: darken($danger, 8%);\n$light: $gray-100;\n$mid: $gray-400; //Added a mid color, useful for input styling\n$dark: $gray-800;\n$green-dark: scale-color($green, $lightness: -45%, $saturation: -10%);\n\n$theme-colors: () !default;\n$theme-colors: map-merge(\n (\n 'primary': $primary,\n 'primary-hover': $primary-hover,\n 'primary-light': $primary-light,\n 'primary-dark': $primary-dark,\n 'secondary': $secondary,\n 'success': $success,\n 'info': $info,\n 'warning': $warning,\n 'danger': $danger,\n 'light': $light,\n 'dark': $dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n ),\n $theme-colors\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n//so browsers add alpha to your color by default, ignoring opacity 1\n//by setting rgba with 0.99 it tricks browser into thinking there is alpha applied\n$text-select-color: $primary-hover;\n$text-select-color-editor: lighten(\n $gray-700,\n 15%\n); //we lighten it abit to account for that 0.01 loss, and because it needs some anyways.\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem rgba($black, 45%); //because our UI is so dark, we need darker default shadows\n$box-shadow-900: 0 0.1rem 1rem rgba(0, 0, 0, 45%); //darkest shadow for $black popups over $black UI\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n\n//Override Inputs\n$input-bg: $gray-600;\n$input-disabled-bg: $gray-800;\n$input-color: $foreground;\n$input-border-color: $gray-400;\n$input-placeholder-color: $gray-400;\n$input-focus-border-color: rgba($primary, 85%);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: rgba($component-active-bg, 35%);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n\n//checkbox\n$custom-control-indicator-bg: $gray-600;\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: $gray-800;\n$custom-control-indicator-checked-disabled-bg: $gray-800;\n$custom-control-label-disabled-color: $gray-400;\n\n//Custom Select\n$custom-select-indicator-color: $gray-400;\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: darken($gray-400, 5%);\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $gray-200;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n\n// Toast notification\n$toast-bg: $primary-dark;\n$toast-color: $foreground;\n$toast-error-bg: mix($danger, $content-bg, 15%);\n$toast-error-color: $foreground;\n\n//tooltips\n$tooltip-bg: $gray-700;\n$tooltip-color: $foreground;\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem rgba($black, 80%);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: $primary;\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: $gray-600;\n$contextmenu-color: $foreground;\n$contextmenu-disabled-color: $text-muted;\n$contextmenu-keyboard-selected-bg: rgba($primary, 50%);\n$contextmenu-selected-bg: $primary;\n$contextmenu-selected-color: $foreground;\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: theme-color('danger');\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n"]}
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../scss/custom.scss","../src/MaskedInput.scss","../scss/bootstrap_overrides.scss"],"names":[],"mappings":"AAAA;ACEA;EACE,aC+HA;ED9HA","file":"MaskedInput.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","@import '../scss/custom.scss';\n\n.masked-input {\n font-family: $font-family-sans-serif;\n font-variant-numeric: tabular-nums;\n}\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg);\n$foreground: var(--dh-color-fg);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$primary-light: var(--dh-color-accent-1100);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-light': $primary-light,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem hsla(var(--dh-color-black-hsl), 0.45); //because our UI is so dark, we need darker default shadows\n$box-shadow-900: 0 0.1rem 1rem hsla(var(--dh-color-true-black-hsl), 0.45); //darkest shadow for $black popups over $black UI\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: hsla(var(--dh-color-accent-hsl), 0.35);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n\n//checkbox\n$custom-control-indicator-bg: $gray-600;\n$custom-control-indicator-active-bg: var(--dh-color-accent-1100);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: $gray-800;\n$custom-control-indicator-checked-disabled-bg: $gray-800;\n$custom-control-label-disabled-color: $gray-400;\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $gray-200;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: $primary;\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: $gray-600;\n$contextmenu-color: $foreground;\n$contextmenu-disabled-color: $text-muted;\n$contextmenu-keyboard-selected-bg: hsla(var(--dh-color-accent-hsl), 0.5);\n$contextmenu-selected-bg: $primary;\n$contextmenu-selected-color: $foreground;\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './RandomAreaPlotAnimation.scss';
|
|
3
|
-
declare const RandomAreaPlotAnimation: React.MemoExoticComponent<() => JSX.Element>;
|
|
3
|
+
declare const RandomAreaPlotAnimation: React.MemoExoticComponent<() => JSX.Element | null>;
|
|
4
4
|
export default RandomAreaPlotAnimation;
|
|
5
5
|
//# sourceMappingURL=RandomAreaPlotAnimation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RandomAreaPlotAnimation.d.ts","sourceRoot":"","sources":["../src/RandomAreaPlotAnimation.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"RandomAreaPlotAnimation.d.ts","sourceRoot":"","sources":["../src/RandomAreaPlotAnimation.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,gCAAgC,CAAC;AAmCxC,QAAA,MAAM,uBAAuB,qDAsT3B,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|
|
@@ -5,27 +5,47 @@ import React, { useEffect, useState, useRef } from 'react';
|
|
|
5
5
|
import debounce from 'lodash.debounce';
|
|
6
6
|
import { assertNotNull } from '@deephaven/utils';
|
|
7
7
|
import "./RandomAreaPlotAnimation.css";
|
|
8
|
-
import
|
|
8
|
+
import { resolveCssVariablesInRecord, useTheme } from "./theme/index.js";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
var VOLATILITY = 0.025; // how spikey the data gets
|
|
11
11
|
var LOW = 0.9;
|
|
12
12
|
var HIGH = 0.1;
|
|
13
13
|
var START_Y = 0.618;
|
|
14
|
-
var FOREGROUND = ThemeExport['primary-dark'];
|
|
15
14
|
var GRID_SIZE = 80;
|
|
16
|
-
var GRID_COLOR = ThemeExport['gray-800'];
|
|
17
|
-
var BACKGROUND = ThemeExport['gray-900'];
|
|
18
15
|
var PATTERN = {
|
|
19
16
|
SIZE: 8,
|
|
20
|
-
DOT_SIZE: 2
|
|
21
|
-
FILL_OPACITY: 0.25
|
|
17
|
+
DOT_SIZE: 2
|
|
22
18
|
};
|
|
23
19
|
var PX_PER_SECOND = 18;
|
|
24
20
|
var RESIZE_DEBOUNCE = 250;
|
|
25
21
|
var INTERACTION_TIMEOUT = 60 * 1000;
|
|
22
|
+
var THEME_COLOR_VARIABLES = {
|
|
23
|
+
background: 'var(--dh-color-random-area-plot-animation-bg)',
|
|
24
|
+
foregroundFill: 'var(--dh-color-random-area-plot-animation-fg-fill)',
|
|
25
|
+
foregroundStroke: 'var(--dh-color-random-area-plot-animation-fg-stroke)',
|
|
26
|
+
gridColor: 'var(--dh-color-random-area-plot-animation-grid)'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Resolve theme colors needed for our animation.
|
|
31
|
+
*/
|
|
32
|
+
function getRandomAreaPlotAnimationThemeColors() {
|
|
33
|
+
return resolveCssVariablesInRecord(THEME_COLOR_VARIABLES);
|
|
34
|
+
}
|
|
26
35
|
|
|
27
36
|
// Draw a background canvas, paint it with a fun chart looking animation
|
|
28
37
|
var RandomAreaPlotAnimation = /*#__PURE__*/React.memo(() => {
|
|
38
|
+
var {
|
|
39
|
+
activeThemes
|
|
40
|
+
} = useTheme();
|
|
41
|
+
var [themeColors, setThemeColors] = useState(null);
|
|
42
|
+
|
|
43
|
+
// Resolving css variables has to run in `useEffect` or `useLayoutEffect` so
|
|
44
|
+
// that we know React has updated the DOM with any styles set by the
|
|
45
|
+
// ThemeProvider.
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
setThemeColors(getRandomAreaPlotAnimationThemeColors());
|
|
48
|
+
}, [activeThemes]);
|
|
29
49
|
var canvas = useRef(null);
|
|
30
50
|
var container = useRef(null);
|
|
31
51
|
var [shade, setShade] = useState(false);
|
|
@@ -55,6 +75,14 @@ var RandomAreaPlotAnimation = /*#__PURE__*/React.memo(() => {
|
|
|
55
75
|
|
|
56
76
|
// Returns the background fill create offscreen as pattern
|
|
57
77
|
function createPatternFill() {
|
|
78
|
+
if (themeColors == null) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
var {
|
|
82
|
+
foregroundFill,
|
|
83
|
+
foregroundStroke
|
|
84
|
+
} = themeColors;
|
|
85
|
+
|
|
58
86
|
// create the off-screen canvas
|
|
59
87
|
var canvasPattern = document.createElement('canvas');
|
|
60
88
|
canvasPattern.width = PATTERN.SIZE;
|
|
@@ -63,11 +91,11 @@ var RandomAreaPlotAnimation = /*#__PURE__*/React.memo(() => {
|
|
|
63
91
|
|
|
64
92
|
// draw pattern to off-screen context
|
|
65
93
|
if (contextPattern != null) {
|
|
66
|
-
contextPattern.fillStyle =
|
|
94
|
+
contextPattern.fillStyle = foregroundStroke;
|
|
67
95
|
contextPattern.fillRect(0, 0, PATTERN.DOT_SIZE, PATTERN.DOT_SIZE);
|
|
68
96
|
|
|
69
97
|
// add an overlay fill
|
|
70
|
-
contextPattern.fillStyle =
|
|
98
|
+
contextPattern.fillStyle = foregroundFill;
|
|
71
99
|
contextPattern.fillRect(0, 0, PATTERN.SIZE, PATTERN.SIZE);
|
|
72
100
|
}
|
|
73
101
|
return contextPattern === null || contextPattern === void 0 ? void 0 : contextPattern.createPattern(canvasPattern, 'repeat');
|
|
@@ -146,14 +174,22 @@ var RandomAreaPlotAnimation = /*#__PURE__*/React.memo(() => {
|
|
|
146
174
|
*/
|
|
147
175
|
function drawCanvas(timestamp) {
|
|
148
176
|
var _lastTimestamp, _lastTimestamp2, _lastTimestamp3;
|
|
177
|
+
if (themeColors == null) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
149
180
|
lastTimestamp = (_lastTimestamp = lastTimestamp) !== null && _lastTimestamp !== void 0 ? _lastTimestamp : timestamp;
|
|
181
|
+
var {
|
|
182
|
+
background,
|
|
183
|
+
foregroundStroke,
|
|
184
|
+
gridColor
|
|
185
|
+
} = themeColors;
|
|
150
186
|
assertNotNull(ctx);
|
|
151
187
|
// clear the canvas
|
|
152
|
-
ctx.fillStyle =
|
|
188
|
+
ctx.fillStyle = background;
|
|
153
189
|
ctx.fillRect(0, 0, width, height);
|
|
154
190
|
drawGridLines(ctx);
|
|
155
191
|
ctx.lineWidth = 1;
|
|
156
|
-
ctx.strokeStyle =
|
|
192
|
+
ctx.strokeStyle = gridColor;
|
|
157
193
|
ctx.stroke();
|
|
158
194
|
|
|
159
195
|
// for speeds less then 60 px per second, subpixel motion is required to look smooth
|
|
@@ -161,7 +197,7 @@ var RandomAreaPlotAnimation = /*#__PURE__*/React.memo(() => {
|
|
|
161
197
|
ctx.translate(subPixelMotion, 0);
|
|
162
198
|
drawAreaLine(data, ctx);
|
|
163
199
|
ctx.lineWidth = 2;
|
|
164
|
-
ctx.strokeStyle =
|
|
200
|
+
ctx.strokeStyle = foregroundStroke;
|
|
165
201
|
ctx.stroke();
|
|
166
202
|
ctx.translate(-subPixelMotion, 0); // we don't pattern to shift however
|
|
167
203
|
if (pattern != null) {
|
|
@@ -278,8 +314,8 @@ var RandomAreaPlotAnimation = /*#__PURE__*/React.memo(() => {
|
|
|
278
314
|
resetIdleTimeout.cancel();
|
|
279
315
|
debouncedHandleResize.cancel();
|
|
280
316
|
};
|
|
281
|
-
}, []);
|
|
282
|
-
return /*#__PURE__*/_jsx("div", {
|
|
317
|
+
}, [themeColors]);
|
|
318
|
+
return themeColors && /*#__PURE__*/_jsx("div", {
|
|
283
319
|
className: "random-area-plot-animation-container",
|
|
284
320
|
ref: container,
|
|
285
321
|
children: /*#__PURE__*/_jsx("canvas", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RandomAreaPlotAnimation.js","names":["React","useEffect","useState","useRef","debounce","assertNotNull","ThemeExport","jsx","_jsx","VOLATILITY","LOW","HIGH","START_Y","FOREGROUND","GRID_SIZE","GRID_COLOR","BACKGROUND","PATTERN","SIZE","DOT_SIZE","FILL_OPACITY","PX_PER_SECOND","RESIZE_DEBOUNCE","INTERACTION_TIMEOUT","RandomAreaPlotAnimation","memo","canvas","container","shade","setShade","scale","window","devicePixelRatio","ctx","pattern","width","height","rAF","lastTimestamp","data","setCanvasSize","_ctx","current","offsetWidth","offsetHeight","style","concat","createPatternFill","canvasPattern","document","createElement","contextPattern","getContext","fillStyle","fillRect","Math","round","toString","padStart","createPattern","randomWalk","prev","rand","random","change","abs","initData","startingData","y","x","push","setDataSize","length","pop","drawAreaLine","path","context","beginPath","moveTo","lineTo","i","closePath","drawGridLines","drawCanvas","timestamp","_lastTimestamp","_lastTimestamp2","_lastTimestamp3","lineWidth","strokeStyle","stroke","subPixelMotion","translate","fill","setTransform","_lastTimestamp4","numberOfPoints","floor","shift","cancelAnimationFrame","requestAnimationFrame","debouncedHandleResize","leading","pauseAnimation","resetIdleTimeout","startAnimation","handleActivity","hasFocus","handleResize","_canvas$current","alpha","addEventListener","removeEventListener","cancel","className","ref","children"],"sources":["../src/RandomAreaPlotAnimation.tsx"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\n/* eslint-disable react/display-name */\n\nimport React, { useEffect, useState, useRef } from 'react';\nimport debounce from 'lodash.debounce';\nimport { assertNotNull } from '@deephaven/utils';\nimport './RandomAreaPlotAnimation.scss';\nimport ThemeExport from './ThemeExport';\n\nconst VOLATILITY = 0.025; // how spikey the data gets\nconst LOW = 0.9;\nconst HIGH = 0.1;\nconst START_Y = 0.618;\nconst FOREGROUND = ThemeExport['primary-dark'];\nconst GRID_SIZE = 80;\nconst GRID_COLOR = ThemeExport['gray-800'];\nconst BACKGROUND = ThemeExport['gray-900'];\nconst PATTERN = { SIZE: 8, DOT_SIZE: 2, FILL_OPACITY: 0.25 };\nconst PX_PER_SECOND = 18;\nconst RESIZE_DEBOUNCE = 250;\nconst INTERACTION_TIMEOUT = 60 * 1000;\n\n// Draw a background canvas, paint it with a fun chart looking animation\nconst RandomAreaPlotAnimation = React.memo(() => {\n const canvas = useRef<HTMLCanvasElement>(null);\n const container = useRef<HTMLDivElement>(null);\n const [shade, setShade] = useState(false);\n const scale = window.devicePixelRatio;\n\n let ctx: CanvasRenderingContext2D | null | undefined;\n let pattern: CanvasPattern | null | undefined;\n let width: number;\n let height: number;\n let rAF: number | null;\n\n let lastTimestamp: DOMHighResTimeStamp | null | undefined = null;\n let data: number[] = [];\n\n function setCanvasSize(): void {\n // Set canvas size to fill screen\n if (container.current != null) {\n width = container.current.offsetWidth;\n height = container.current.offsetHeight;\n }\n\n if (canvas.current != null) {\n canvas.current.style.width = `${width}px`;\n canvas.current.style.height = `${height}px`;\n\n canvas.current.width = width * scale;\n canvas.current.height = height * scale;\n }\n\n ctx?.scale(scale, scale);\n }\n\n // Returns the background fill create offscreen as pattern\n function createPatternFill(): CanvasPattern | null | undefined {\n // create the off-screen canvas\n const canvasPattern = document.createElement('canvas');\n canvasPattern.width = PATTERN.SIZE;\n canvasPattern.height = PATTERN.SIZE;\n const contextPattern = canvasPattern.getContext('2d');\n\n // draw pattern to off-screen context\n if (contextPattern != null) {\n contextPattern.fillStyle = FOREGROUND;\n contextPattern.fillRect(0, 0, PATTERN.DOT_SIZE, PATTERN.DOT_SIZE);\n\n // add an overlay fill\n contextPattern.fillStyle =\n FOREGROUND +\n Math.round(255 * PATTERN.FILL_OPACITY)\n .toString(16)\n .padStart(2, '0'); // adds opacity in hex to color\n contextPattern.fillRect(0, 0, PATTERN.SIZE, PATTERN.SIZE);\n }\n return contextPattern?.createPattern(canvasPattern, 'repeat');\n }\n\n /**\n * Generates a step in a random walk between LOW - HIGH given a previous value\n * data is always in 0-1 data space so its scaleable\n * data space is converted to screen space inside draw functions\n * @param prev previous random walk step\n * @return new random walk step\n */\n function randomWalk(prev: number): number {\n const rand = Math.random() - 0.5; // give it directionality\n let change = VOLATILITY * rand; // scale by volatity constant\n\n // ensure directional bounce off approaching edges\n if (prev < HIGH) {\n change = Math.abs(change);\n } else if (prev > LOW) {\n change = -Math.abs(change);\n }\n\n return prev + change;\n }\n\n function initData(): number[] {\n const startingData = [];\n let y = START_Y; // always start towards the bottom of the screen\n for (let x = 0; x < width + PX_PER_SECOND; x += 1) {\n y = randomWalk(y);\n startingData.push(y);\n }\n return startingData;\n }\n\n function setDataSize(): void {\n while (data.length >= width + PX_PER_SECOND) {\n data.pop();\n }\n while (data.length < width + PX_PER_SECOND) {\n data.push(randomWalk(data[data.length - 1]));\n }\n }\n\n function drawAreaLine(\n path: number[],\n context: CanvasRenderingContext2D\n ): void {\n context.beginPath();\n // start offscreen\n context.moveTo(-1, height + 1);\n context.lineTo(-1, height * path[0]);\n\n // draw the line\n for (let i = 0; i < path.length; i += 1) {\n context.lineTo(i, height * path[i]);\n }\n\n // close offscreen\n context.lineTo(width + PX_PER_SECOND, height * path[path.length - 1]);\n context.lineTo(width + PX_PER_SECOND, height + 1);\n context.closePath();\n }\n\n function drawGridLines(context: CanvasRenderingContext2D): void {\n context.beginPath();\n // draw verticals\n for (let x = 1; x < width; x += GRID_SIZE) {\n context.moveTo(x, 0);\n context.lineTo(x, height);\n }\n // draw horizontals\n for (let y = 1; y < height; y += GRID_SIZE) {\n context.moveTo(0, y);\n context.lineTo(width, y);\n }\n }\n\n /**\n * Main draw loop for where the animation happens\n * all the styling happens within drawCanvas from paths generated by other functions\n * @param timestamp passed in callback from requestAnimationFrame\n */\n function drawCanvas(timestamp?: DOMHighResTimeStamp): void {\n lastTimestamp = lastTimestamp ?? timestamp;\n\n assertNotNull(ctx);\n // clear the canvas\n ctx.fillStyle = BACKGROUND;\n ctx.fillRect(0, 0, width, height);\n\n drawGridLines(ctx);\n ctx.lineWidth = 1;\n ctx.strokeStyle = GRID_COLOR;\n ctx.stroke();\n\n // for speeds less then 60 px per second, subpixel motion is required to look smooth\n const subPixelMotion =\n ((lastTimestamp ?? 0) - (timestamp ?? 0)) / (1000 / PX_PER_SECOND);\n ctx.translate(subPixelMotion, 0);\n\n drawAreaLine(data, ctx);\n ctx.lineWidth = 2;\n ctx.strokeStyle = FOREGROUND;\n ctx.stroke();\n\n ctx.translate(-subPixelMotion, 0); // we don't pattern to shift however\n if (pattern != null) {\n ctx.fillStyle = pattern;\n }\n ctx.fill();\n ctx.setTransform(scale, 0, 0, scale, 0, 0); // reset the translate matrix to normal\n\n // generate new data points\n if ((timestamp ?? 0) - (lastTimestamp ?? 0) > 1000 / PX_PER_SECOND) {\n // number of points to add since last update\n const numberOfPoints = Math.floor(\n ((timestamp ?? 0) - (lastTimestamp ?? 0)) / (1000 / PX_PER_SECOND)\n );\n for (let i = 0; i < numberOfPoints; i += 1) {\n data.shift();\n data.push(randomWalk(data[data.length - 1]));\n }\n lastTimestamp = timestamp;\n }\n\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n rAF = requestAnimationFrame(drawCanvas);\n }\n\n // debounce the resize so its not overly aggresive\n const debouncedHandleResize = debounce(\n () => {\n rAF = requestAnimationFrame(timestamp => {\n setCanvasSize(); // setCanvas can cause lag if not debounced\n\n // fill or remove extra data points\n setDataSize();\n\n // opening devtools triggers a blur then resize,\n // need to reset shade as we are restarting animation\n setShade(false);\n drawCanvas(timestamp);\n });\n },\n RESIZE_DEBOUNCE,\n { leading: true } // resize immediately, once.\n );\n\n function pauseAnimation(): void {\n // pause animation when browser window is blurred to conserve CPU usage\n setShade(true);\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n rAF = null;\n lastTimestamp = null;\n }\n\n // when timeout expires, pause animation\n const resetIdleTimeout = debounce(() => {\n pauseAnimation();\n }, INTERACTION_TIMEOUT);\n\n function startAnimation(): void {\n // can fire multiple times, check if rAF is null first\n // restart animation loop, and fade back in\n if (rAF == null) {\n setShade(false);\n setCanvasSize();\n setDataSize();\n rAF = requestAnimationFrame(drawCanvas);\n }\n resetIdleTimeout();\n }\n\n function handleActivity(): void {\n if (document.hasFocus()) {\n // only if document has focus (mousemove can fire on non-focused tabs)\n startAnimation();\n }\n }\n\n function handleResize(): void {\n // pause and debounce animation during resize for better resizing performance\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n resetIdleTimeout(); // treat resizing as a form of activity\n debouncedHandleResize();\n }\n\n // react mount/unmount hooks\n useEffect(() => {\n ctx = canvas.current?.getContext('2d', { alpha: false });\n setCanvasSize();\n data = initData();\n pattern = createPatternFill();\n\n // start draw loop\n drawCanvas();\n resetIdleTimeout();\n\n window.addEventListener('resize', handleResize);\n\n window.addEventListener('focus', startAnimation);\n window.addEventListener('blur', pauseAnimation);\n\n // don't burn cpu if the user is \"idle\", start a timer that resets\n // on any user activity, and on timeout expiry pause the animation\n window.addEventListener('mousemove', handleActivity);\n window.addEventListener('keydown', handleActivity);\n\n return () => {\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n window.removeEventListener('resize', handleResize);\n window.removeEventListener('focus', startAnimation);\n window.removeEventListener('blur', pauseAnimation);\n\n window.removeEventListener('mousemove', handleActivity);\n window.removeEventListener('keydown', handleActivity);\n\n resetIdleTimeout.cancel();\n debouncedHandleResize.cancel();\n };\n }, []);\n\n return (\n <div className=\"random-area-plot-animation-container\" ref={container}>\n <canvas ref={canvas} className={shade ? 'shade' : ''} />\n </div>\n );\n});\n\nexport default RandomAreaPlotAnimation;\n"],"mappings":"AAAA;AACA;;AAEA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,OAAO;AAC1D,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAASC,aAAa,QAAQ,kBAAkB;AAAC;AAAA,OAE1CC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAElB,IAAMC,UAAU,GAAG,KAAK,CAAC,CAAC;AAC1B,IAAMC,GAAG,GAAG,GAAG;AACf,IAAMC,IAAI,GAAG,GAAG;AAChB,IAAMC,OAAO,GAAG,KAAK;AACrB,IAAMC,UAAU,GAAGP,WAAW,CAAC,cAAc,CAAC;AAC9C,IAAMQ,SAAS,GAAG,EAAE;AACpB,IAAMC,UAAU,GAAGT,WAAW,CAAC,UAAU,CAAC;AAC1C,IAAMU,UAAU,GAAGV,WAAW,CAAC,UAAU,CAAC;AAC1C,IAAMW,OAAO,GAAG;EAAEC,IAAI,EAAE,CAAC;EAAEC,QAAQ,EAAE,CAAC;EA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AAC;IACpD3E,MAAM,CAACgF,gBAAgB,CAAC,SAAS,EAAEL,cAAc,CAAC;IAElD,OAAO,MAAM;MACX,IAAIrE,GAAG,IAAI,IAAI,EAAE;QACf8D,oBAAoB,CAAC9D,GAAG,CAAC;MAC3B;MACAN,MAAM,CAACiF,mBAAmB,CAAC,QAAQ,EAAEJ,YAAY,CAAC;MAClD7E,MAAM,CAACiF,mBAAmB,CAAC,OAAO,EAAEP,cAAc,CAAC;MACnD1E,MAAM,CAACiF,mBAAmB,CAAC,MAAM,EAAET,cAAc,CAAC;MAElDxE,MAAM,CAACiF,mBAAmB,CAAC,WAAW,EAAEN,cAAc,CAAC;MACvD3E,MAAM,CAACiF,mBAAmB,CAAC,SAAS,EAAEN,cAAc,CAAC;MAErDF,gBAAgB,CAACS,MAAM,CAAC,CAAC;MACzBZ,qBAAqB,CAACY,MAAM,CAAC,CAAC;IAChC,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,oBACEzG,IAAA;IAAK0G,SAAS,EAAC,sCAAsC;IAACC,GAAG,EAAExF,SAAU;IAAAyF,QAAA,eACnE5G,IAAA;MAAQ2G,GAAG,EAAEzF,MAAO;MAACwF,SAAS,EAAEtF,KAAK,GAAG,OAAO,GAAG;IAAG,CAAE;EAAC,CACrD,CAAC;AAEV,CAAC,CAAC;AAEF,eAAeJ,uBAAuB"}
|
|
1
|
+
{"version":3,"file":"RandomAreaPlotAnimation.js","names":["React","useEffect","useState","useRef","debounce","assertNotNull","resolveCssVariablesInRecord","useTheme","jsx","_jsx","VOLATILITY","LOW","HIGH","START_Y","GRID_SIZE","PATTERN","SIZE","DOT_SIZE","PX_PER_SECOND","RESIZE_DEBOUNCE","INTERACTION_TIMEOUT","THEME_COLOR_VARIABLES","background","foregroundFill","foregroundStroke","gridColor","getRandomAreaPlotAnimationThemeColors","RandomAreaPlotAnimation","memo","activeThemes","themeColors","setThemeColors","canvas","container","shade","setShade","scale","window","devicePixelRatio","ctx","pattern","width","height","rAF","lastTimestamp","data","setCanvasSize","_ctx","current","offsetWidth","offsetHeight","style","concat","createPatternFill","canvasPattern","document","createElement","contextPattern","getContext","fillStyle","fillRect","createPattern","randomWalk","prev","rand","Math","random","change","abs","initData","startingData","y","x","push","setDataSize","length","pop","drawAreaLine","path","context","beginPath","moveTo","lineTo","i","closePath","drawGridLines","drawCanvas","timestamp","_lastTimestamp","_lastTimestamp2","_lastTimestamp3","lineWidth","strokeStyle","stroke","subPixelMotion","translate","fill","setTransform","_lastTimestamp4","numberOfPoints","floor","shift","cancelAnimationFrame","requestAnimationFrame","debouncedHandleResize","leading","pauseAnimation","resetIdleTimeout","startAnimation","handleActivity","hasFocus","handleResize","_canvas$current","alpha","addEventListener","removeEventListener","cancel","className","ref","children"],"sources":["../src/RandomAreaPlotAnimation.tsx"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\n/* eslint-disable react/display-name */\n\nimport React, { useEffect, useState, useRef } from 'react';\nimport debounce from 'lodash.debounce';\nimport { assertNotNull } from '@deephaven/utils';\nimport './RandomAreaPlotAnimation.scss';\nimport { resolveCssVariablesInRecord, useTheme } from './theme';\n\nconst VOLATILITY = 0.025; // how spikey the data gets\nconst LOW = 0.9;\nconst HIGH = 0.1;\nconst START_Y = 0.618;\nconst GRID_SIZE = 80;\nconst PATTERN = { SIZE: 8, DOT_SIZE: 2 };\nconst PX_PER_SECOND = 18;\nconst RESIZE_DEBOUNCE = 250;\nconst INTERACTION_TIMEOUT = 60 * 1000;\n\ninterface ThemeColors {\n background: string;\n foregroundFill: string;\n foregroundStroke: string;\n gridColor: string;\n}\n\nconst THEME_COLOR_VARIABLES = {\n background: 'var(--dh-color-random-area-plot-animation-bg)',\n foregroundFill: 'var(--dh-color-random-area-plot-animation-fg-fill)',\n foregroundStroke: 'var(--dh-color-random-area-plot-animation-fg-stroke)',\n gridColor: 'var(--dh-color-random-area-plot-animation-grid)',\n} satisfies ThemeColors;\n\n/**\n * Resolve theme colors needed for our animation.\n */\nfunction getRandomAreaPlotAnimationThemeColors(): ThemeColors {\n return resolveCssVariablesInRecord(THEME_COLOR_VARIABLES);\n}\n\n// Draw a background canvas, paint it with a fun chart looking animation\nconst RandomAreaPlotAnimation = React.memo(() => {\n const { activeThemes } = useTheme();\n\n const [themeColors, setThemeColors] = useState<ThemeColors | null>(null);\n\n // Resolving css variables has to run in `useEffect` or `useLayoutEffect` so\n // that we know React has updated the DOM with any styles set by the\n // ThemeProvider.\n useEffect(() => {\n setThemeColors(getRandomAreaPlotAnimationThemeColors());\n }, [activeThemes]);\n\n const canvas = useRef<HTMLCanvasElement>(null);\n const container = useRef<HTMLDivElement>(null);\n const [shade, setShade] = useState(false);\n const scale = window.devicePixelRatio;\n\n let ctx: CanvasRenderingContext2D | null | undefined;\n let pattern: CanvasPattern | null | undefined;\n let width: number;\n let height: number;\n let rAF: number | null;\n\n let lastTimestamp: DOMHighResTimeStamp | null | undefined = null;\n let data: number[] = [];\n\n function setCanvasSize(): void {\n // Set canvas size to fill screen\n if (container.current != null) {\n width = container.current.offsetWidth;\n height = container.current.offsetHeight;\n }\n\n if (canvas.current != null) {\n canvas.current.style.width = `${width}px`;\n canvas.current.style.height = `${height}px`;\n\n canvas.current.width = width * scale;\n canvas.current.height = height * scale;\n }\n\n ctx?.scale(scale, scale);\n }\n\n // Returns the background fill create offscreen as pattern\n function createPatternFill(): CanvasPattern | null | undefined {\n if (themeColors == null) {\n return null;\n }\n\n const { foregroundFill, foregroundStroke } = themeColors;\n\n // create the off-screen canvas\n const canvasPattern = document.createElement('canvas');\n canvasPattern.width = PATTERN.SIZE;\n canvasPattern.height = PATTERN.SIZE;\n const contextPattern = canvasPattern.getContext('2d');\n\n // draw pattern to off-screen context\n if (contextPattern != null) {\n contextPattern.fillStyle = foregroundStroke;\n contextPattern.fillRect(0, 0, PATTERN.DOT_SIZE, PATTERN.DOT_SIZE);\n\n // add an overlay fill\n contextPattern.fillStyle = foregroundFill;\n contextPattern.fillRect(0, 0, PATTERN.SIZE, PATTERN.SIZE);\n }\n return contextPattern?.createPattern(canvasPattern, 'repeat');\n }\n\n /**\n * Generates a step in a random walk between LOW - HIGH given a previous value\n * data is always in 0-1 data space so its scaleable\n * data space is converted to screen space inside draw functions\n * @param prev previous random walk step\n * @return new random walk step\n */\n function randomWalk(prev: number): number {\n const rand = Math.random() - 0.5; // give it directionality\n let change = VOLATILITY * rand; // scale by volatity constant\n\n // ensure directional bounce off approaching edges\n if (prev < HIGH) {\n change = Math.abs(change);\n } else if (prev > LOW) {\n change = -Math.abs(change);\n }\n\n return prev + change;\n }\n\n function initData(): number[] {\n const startingData = [];\n let y = START_Y; // always start towards the bottom of the screen\n for (let x = 0; x < width + PX_PER_SECOND; x += 1) {\n y = randomWalk(y);\n startingData.push(y);\n }\n return startingData;\n }\n\n function setDataSize(): void {\n while (data.length >= width + PX_PER_SECOND) {\n data.pop();\n }\n while (data.length < width + PX_PER_SECOND) {\n data.push(randomWalk(data[data.length - 1]));\n }\n }\n\n function drawAreaLine(\n path: number[],\n context: CanvasRenderingContext2D\n ): void {\n context.beginPath();\n // start offscreen\n context.moveTo(-1, height + 1);\n context.lineTo(-1, height * path[0]);\n\n // draw the line\n for (let i = 0; i < path.length; i += 1) {\n context.lineTo(i, height * path[i]);\n }\n\n // close offscreen\n context.lineTo(width + PX_PER_SECOND, height * path[path.length - 1]);\n context.lineTo(width + PX_PER_SECOND, height + 1);\n context.closePath();\n }\n\n function drawGridLines(context: CanvasRenderingContext2D): void {\n context.beginPath();\n // draw verticals\n for (let x = 1; x < width; x += GRID_SIZE) {\n context.moveTo(x, 0);\n context.lineTo(x, height);\n }\n // draw horizontals\n for (let y = 1; y < height; y += GRID_SIZE) {\n context.moveTo(0, y);\n context.lineTo(width, y);\n }\n }\n\n /**\n * Main draw loop for where the animation happens\n * all the styling happens within drawCanvas from paths generated by other functions\n * @param timestamp passed in callback from requestAnimationFrame\n */\n function drawCanvas(timestamp?: DOMHighResTimeStamp): void {\n if (themeColors == null) {\n return;\n }\n\n lastTimestamp = lastTimestamp ?? timestamp;\n\n const { background, foregroundStroke, gridColor } = themeColors;\n\n assertNotNull(ctx);\n // clear the canvas\n ctx.fillStyle = background;\n ctx.fillRect(0, 0, width, height);\n\n drawGridLines(ctx);\n ctx.lineWidth = 1;\n ctx.strokeStyle = gridColor;\n ctx.stroke();\n\n // for speeds less then 60 px per second, subpixel motion is required to look smooth\n const subPixelMotion =\n ((lastTimestamp ?? 0) - (timestamp ?? 0)) / (1000 / PX_PER_SECOND);\n ctx.translate(subPixelMotion, 0);\n\n drawAreaLine(data, ctx);\n ctx.lineWidth = 2;\n ctx.strokeStyle = foregroundStroke;\n ctx.stroke();\n\n ctx.translate(-subPixelMotion, 0); // we don't pattern to shift however\n if (pattern != null) {\n ctx.fillStyle = pattern;\n }\n ctx.fill();\n ctx.setTransform(scale, 0, 0, scale, 0, 0); // reset the translate matrix to normal\n\n // generate new data points\n if ((timestamp ?? 0) - (lastTimestamp ?? 0) > 1000 / PX_PER_SECOND) {\n // number of points to add since last update\n const numberOfPoints = Math.floor(\n ((timestamp ?? 0) - (lastTimestamp ?? 0)) / (1000 / PX_PER_SECOND)\n );\n for (let i = 0; i < numberOfPoints; i += 1) {\n data.shift();\n data.push(randomWalk(data[data.length - 1]));\n }\n lastTimestamp = timestamp;\n }\n\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n rAF = requestAnimationFrame(drawCanvas);\n }\n\n // debounce the resize so its not overly aggresive\n const debouncedHandleResize = debounce(\n () => {\n rAF = requestAnimationFrame(timestamp => {\n setCanvasSize(); // setCanvas can cause lag if not debounced\n\n // fill or remove extra data points\n setDataSize();\n\n // opening devtools triggers a blur then resize,\n // need to reset shade as we are restarting animation\n setShade(false);\n drawCanvas(timestamp);\n });\n },\n RESIZE_DEBOUNCE,\n { leading: true } // resize immediately, once.\n );\n\n function pauseAnimation(): void {\n // pause animation when browser window is blurred to conserve CPU usage\n setShade(true);\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n rAF = null;\n lastTimestamp = null;\n }\n\n // when timeout expires, pause animation\n const resetIdleTimeout = debounce(() => {\n pauseAnimation();\n }, INTERACTION_TIMEOUT);\n\n function startAnimation(): void {\n // can fire multiple times, check if rAF is null first\n // restart animation loop, and fade back in\n if (rAF == null) {\n setShade(false);\n setCanvasSize();\n setDataSize();\n rAF = requestAnimationFrame(drawCanvas);\n }\n resetIdleTimeout();\n }\n\n function handleActivity(): void {\n if (document.hasFocus()) {\n // only if document has focus (mousemove can fire on non-focused tabs)\n startAnimation();\n }\n }\n\n function handleResize(): void {\n // pause and debounce animation during resize for better resizing performance\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n resetIdleTimeout(); // treat resizing as a form of activity\n debouncedHandleResize();\n }\n\n // react mount/unmount hooks\n useEffect(() => {\n ctx = canvas.current?.getContext('2d', { alpha: false });\n setCanvasSize();\n data = initData();\n pattern = createPatternFill();\n\n // start draw loop\n drawCanvas();\n resetIdleTimeout();\n\n window.addEventListener('resize', handleResize);\n\n window.addEventListener('focus', startAnimation);\n window.addEventListener('blur', pauseAnimation);\n\n // don't burn cpu if the user is \"idle\", start a timer that resets\n // on any user activity, and on timeout expiry pause the animation\n window.addEventListener('mousemove', handleActivity);\n window.addEventListener('keydown', handleActivity);\n\n return () => {\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n window.removeEventListener('resize', handleResize);\n window.removeEventListener('focus', startAnimation);\n window.removeEventListener('blur', pauseAnimation);\n\n window.removeEventListener('mousemove', handleActivity);\n window.removeEventListener('keydown', handleActivity);\n\n resetIdleTimeout.cancel();\n debouncedHandleResize.cancel();\n };\n }, [themeColors]);\n\n return (\n themeColors && (\n <div className=\"random-area-plot-animation-container\" ref={container}>\n <canvas ref={canvas} className={shade ? 'shade' : ''} />\n </div>\n )\n );\n});\n\nexport default RandomAreaPlotAnimation;\n"],"mappings":"AAAA;AACA;;AAEA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,OAAO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AAM,CAAC8E,mBAAmB,CAAC,OAAO,EAAEP,cAAc,CAAC;MACnDvE,MAAM,CAAC8E,mBAAmB,CAAC,MAAM,EAAET,cAAc,CAAC;MAElDrE,MAAM,CAAC8E,mBAAmB,CAAC,WAAW,EAAEN,cAAc,CAAC;MACvDxE,MAAM,CAAC8E,mBAAmB,CAAC,SAAS,EAAEN,cAAc,CAAC;MAErDF,gBAAgB,CAACS,MAAM,CAAC,CAAC;MACzBZ,qBAAqB,CAACY,MAAM,CAAC,CAAC;IAChC,CAAC;EACH,CAAC,EAAE,CAACtF,WAAW,CAAC,CAAC;EAEjB,OACEA,WAAW,iBACTrB,IAAA;IAAK4G,SAAS,EAAC,sCAAsC;IAACC,GAAG,EAAErF,SAAU;IAAAsF,QAAA,eACnE9G,IAAA;MAAQ6G,GAAG,EAAEtF,MAAO;MAACqF,SAAS,EAAEnF,KAAK,GAAG,OAAO,GAAG;IAAG,CAAE;EAAC,CACrD,CACN;AAEL,CAAC,CAAC;AAEF,eAAeP,uBAAuB"}
|
package/dist/SearchInput.css
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
.search-group ::-webkit-search-cancel-button {
|
|
20
20
|
background-size: 16px;
|
|
21
|
-
background-color: var(--dh-color-
|
|
21
|
+
background-color: var(--dh-color-fg);
|
|
22
22
|
mask-image: var(--dh-svg-icon-search-cancel);
|
|
23
23
|
mask-position: center center;
|
|
24
24
|
mask-repeat: no-repeat;
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
padding: 1px 2px;
|
|
46
46
|
}
|
|
47
47
|
.search-group .search-change-text {
|
|
48
|
-
background-color:
|
|
48
|
+
background-color: hsla(var(--dh-color-white-hsl), 0.2);
|
|
49
49
|
border-radius: 10px;
|
|
50
50
|
padding: 1px 5px;
|
|
51
51
|
}
|
|
52
52
|
.search-group .search-match {
|
|
53
|
-
background-color:
|
|
53
|
+
background-color: hsla(var(--dh-color-white-hsl), 0.2);
|
|
54
54
|
border-radius: 10px;
|
|
55
55
|
padding: 1px 5px;
|
|
56
56
|
margin: 0 5px;
|
package/dist/SearchInput.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../scss/custom.scss","../src/SearchInput.scss","../scss/new_variables.scss","../scss/util.scss"],"names":[],"mappings":"AAAA;ACGA;EACE;;AAEA;EACE;;AAGF;EACE;EACA;EACA;EACA,
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../scss/custom.scss","../src/SearchInput.scss","../scss/new_variables.scss","../scss/util.scss"],"names":[],"mappings":"AAAA;ACGA;EACE;;AAEA;EACE;;AAGF;EACE;EACA;EACA;EACA,OCTO;EDUP;EACA;EACA;EACA;EACA;;AAGF;EEpBA,iBFqBc;EEpBd;EACA,YFoB2B;EEnB3B;EACA;EACA,WFgBc;EAIZ;EACA,QALY;EAMZ,OANY;EAOZ;EACA;;AACA;EACE;;AAIJ;EACE;EACA,OCnCO;EDoCP;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA","file":"SearchInput.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","@import '../scss/custom.scss';\n@import '../scss/util.scss';\n\n.search-group {\n position: relative;\n\n .form-control {\n padding-right: 1.75rem; // leave space for search icon and cancel button from browser\n }\n\n .search-icon {\n color: var(--dh-color-search-icon);\n pointer-events: none;\n position: absolute;\n right: $spacer-2;\n top: 0;\n bottom: 0;\n height: 100%;\n display: flex;\n align-items: center;\n }\n\n ::-webkit-search-cancel-button {\n $icon-size: 16px;\n @include icon-image-mask(var(--dh-svg-icon-search-cancel), $icon-size);\n\n // Need to specify -webkit-appearance: none for Chrome\n -webkit-appearance: none;\n height: $icon-size;\n width: $icon-size;\n opacity: 0.4;\n transition: opacity 300ms ease;\n &:hover {\n opacity: 1;\n }\n }\n\n .search-change-selection {\n position: absolute;\n right: $spacer-1;\n top: 15%;\n bottom: 15%;\n height: 70%;\n }\n\n .search-change-button {\n background: none;\n border: none;\n padding: 1px 2px;\n }\n\n .search-change-text {\n background-color: hsla(var(--dh-color-white-hsl), 0.2);\n border-radius: 10px;\n padding: 1px 5px;\n }\n\n .search-match {\n background-color: hsla(var(--dh-color-white-hsl), 0.2);\n border-radius: 10px;\n padding: 1px 5px;\n margin: 0 5px;\n }\n}\n","@use 'sass:math';\n\n//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size:\n $ant-size $ant-thickness,\n $ant-size $ant-thickness,\n $ant-thickness $ant-size,\n $ant-thickness $ant-size;\n background-position:\n 0 top,\n 0 bottom,\n left 0,\n right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n@function hsla-opacity($semantic-name, $i: 100) {\n @return hsla(var(--dh-color-#{$semantic-name}-hsl), math.div($i, 100));\n}\n\n@function accent-opacity($i: 100) {\n @return hsla-opacity('accent', $i);\n}\n\n@function background-opacity($i: 100) {\n @return hsla-opacity('bg', $i);\n}\n\n@function foreground-opacity($i: 100) {\n @return hsla-opacity('fg', $i);\n}\n\n$focus-bg-transparency: 0.12;\n$hover-bg-transparency: 0.14;\n$active-bg-transparency: 0.28;\n$exception-transparency: 0.13;\n","// Setup a mask-image for an inline svg\n@mixin icon-image-mask($mask-image, $size: 16px) {\n background-size: $size;\n background-color: var(--dh-color-fg);\n mask-image: $mask-image;\n mask-position: center center;\n mask-repeat: no-repeat;\n mask-size: $size;\n}\n\n// Caret icon for pickers, dropdowns, select, etc.\n@mixin caret-icon() {\n $width: 10px;\n $height: 6px;\n @include icon-image-mask(var(--dh-svg-icon-selector-caret), $width $height);\n\n background-color: var(--dh-color-selector-fg);\n width: $width;\n height: $height;\n}\n\n/// Utilty for increasing specificity by repeating a given selector n number of\n/// times.\n///\n/// It should work for selectors that can be concatenated without delimiters\n/// such as '.some-selector.some-selector', '#some-id#some-id', or '&&'. A\n/// case where it would not work would be with an element selector e.g. 'divdiv'.\n///\n/// Example usage:\n///\n/// #{multiply-specificity-n('.some-selector', 2)} {\n/// }\n///\n/// would produce\n///\n/// .some-selector.some-selector {\n/// }\n///\n/// @param {string} $selector the selector to duplicate\n/// @param {number} $n number of times to duplicate\n/// @return {string} duplicated selector\n@function multiply-specificity-n($selector, $n) {\n $result: $selector;\n @for $i from 2 through $n {\n $result: selector-append($result, $selector);\n }\n\n @return $result;\n}\n\n// Linear gradient with same start and end color. Useful for certain scenarios\n// where we need a solid background image layer.\n@function solid-gradient($color) {\n @return linear-gradient(0deg, $color, $color);\n}\n"]}
|
package/dist/SelectValueList.css
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
.select-value-list-scroll-pane {
|
|
3
3
|
overflow-x: hidden;
|
|
4
4
|
overflow-y: auto;
|
|
5
|
-
border: 1px solid
|
|
5
|
+
border: 1px solid var(--dh-color-input-border);
|
|
6
6
|
border-radius: 4px;
|
|
7
7
|
padding: 0.375rem 0 0.375rem;
|
|
8
8
|
}
|
|
9
9
|
.select-value-list-scroll-pane.is-invalid {
|
|
10
|
-
border-color:
|
|
10
|
+
border-color: hsla(var(--dh-color-negative-hsl), 0.85);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.select-value-list {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
display: flex;
|
|
28
28
|
}
|
|
29
29
|
.select-value-list .select-value-list-content .custom-control:hover {
|
|
30
|
-
background:
|
|
30
|
+
background: var(--dh-color-gray-500);
|
|
31
31
|
}
|
|
32
32
|
.select-value-list .select-value-list-content .custom-control .custom-control-label {
|
|
33
33
|
margin-left: 0.75rem;
|