dash-core-components 3.1.0 → 4.0.0-rc0

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 (53) hide show
  1. package/dash_core_components/async-datepicker.js +1 -1
  2. package/dash_core_components/async-datepicker.js.map +1 -1
  3. package/dash_core_components/async-dropdown.js +1 -1
  4. package/dash_core_components/async-dropdown.js.map +1 -1
  5. package/dash_core_components/async-graph.js +1 -1
  6. package/dash_core_components/async-graph.js.map +1 -1
  7. package/dash_core_components/async-highlight.js +1 -1
  8. package/dash_core_components/async-highlight.js.map +1 -1
  9. package/dash_core_components/async-markdown.js +1 -1
  10. package/dash_core_components/async-markdown.js.map +1 -1
  11. package/dash_core_components/async-slider.js +1 -1
  12. package/dash_core_components/async-slider.js.map +1 -1
  13. package/dash_core_components/dash_core_components-shared.js +1 -1
  14. package/dash_core_components/dash_core_components-shared.js.map +1 -1
  15. package/dash_core_components/dash_core_components.js +1 -1
  16. package/dash_core_components/dash_core_components.js.map +1 -1
  17. package/dash_core_components/plotly.min.js +8 -0
  18. package/dash_core_components/proptypes.js +81 -0
  19. package/lib/components/Dropdown.react.js.old +228 -0
  20. package/lib/components/Input.react.js.old +507 -0
  21. package/lib/components/Input.tsx +543 -0
  22. package/lib/components/RangeSlider.tsx +39 -0
  23. package/lib/components/Slider.react.js.old +214 -0
  24. package/lib/components/Slider.tsx +81 -0
  25. package/lib/components/css/dcc.css +13 -0
  26. package/lib/components/css/input.css +116 -2
  27. package/lib/components/css/react-select@1.0.0-rc.3.min.css +1 -1
  28. package/lib/components/css/sliders.css +198 -4
  29. package/lib/fragments/Graph.react.js +24 -4
  30. package/lib/fragments/RangeSlider.tsx +412 -0
  31. package/lib/fragments/Slider.tsx.old +364 -0
  32. package/lib/index.ts +58 -0
  33. package/lib/types.ts +331 -0
  34. package/lib/utils/LazyLoader/rangeSlider.ts +2 -0
  35. package/lib/utils/LazyLoader/slider.ts +2 -0
  36. package/lib/utils/_LoadingElement.tsx +36 -0
  37. package/lib/utils/computeSliderMarkers.ts +302 -0
  38. package/lib/utils/formatSliderTooltip.ts +20 -0
  39. package/lib/utils/sliderRendering.tsx +144 -0
  40. package/lib/utils/sliderSnapToMark.ts +17 -0
  41. package/lib/utils/sliderTooltip.tsx +65 -0
  42. package/package.json +27 -10
  43. package/lib/components/Input.react.js +0 -403
  44. package/lib/components/RangeSlider.react.js +0 -194
  45. package/lib/components/Slider.react.js +0 -179
  46. package/lib/fragments/RangeSlider.react.js +0 -143
  47. package/lib/fragments/Slider.react.js +0 -147
  48. package/lib/index.js +0 -183
  49. package/lib/utils/LazyLoader/rangeSlider.js +0 -8
  50. package/lib/utils/LazyLoader/slider.js +0 -8
  51. package/lib/utils/computeSliderMarkers.js +0 -153
  52. package/lib/utils/computeSliderStyle.js +0 -26
  53. package/lib/utils/formatSliderTooltip.js +0 -19
@@ -0,0 +1,214 @@
1
+ import React, {Component, lazy, Suspense} from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import slider from '../utils/LazyLoader/slider';
4
+
5
+ import './css/sliders.css';
6
+
7
+ const RealSlider = lazy(slider);
8
+
9
+ /**
10
+ * A slider component with a single handle.
11
+ */
12
+ export default class Slider extends Component {
13
+ render() {
14
+ return (
15
+ <Suspense fallback={null}>
16
+ <RealSlider {...this.props} />
17
+ </Suspense>
18
+ );
19
+ }
20
+ }
21
+
22
+ Slider.propTypes = {
23
+ /**
24
+ * Minimum allowed value of the slider
25
+ */
26
+ min: PropTypes.number,
27
+
28
+ /**
29
+ * Maximum allowed value of the slider
30
+ */
31
+ max: PropTypes.number,
32
+
33
+ /**
34
+ * Value by which increments or decrements are made
35
+ */
36
+ step: PropTypes.number,
37
+
38
+ /**
39
+ * Marks on the slider.
40
+ * The key determines the position (a number),
41
+ * and the value determines what will show.
42
+ * If you want to set the style of a specific mark point,
43
+ * the value should be an object which
44
+ * contains style and label properties.
45
+ */
46
+ marks: PropTypes.objectOf(
47
+ PropTypes.oneOfType([
48
+ PropTypes.string,
49
+ PropTypes.exact({
50
+ label: PropTypes.string,
51
+ style: PropTypes.object,
52
+ }),
53
+ ])
54
+ ),
55
+
56
+ /**
57
+ * The value of the input
58
+ */
59
+ value: PropTypes.number,
60
+
61
+ /**
62
+ * The value of the input during a drag
63
+ */
64
+ drag_value: PropTypes.number,
65
+
66
+ /**
67
+ * If true, the handles can't be moved.
68
+ */
69
+ disabled: PropTypes.bool,
70
+
71
+ /**
72
+ * When the step value is greater than 1,
73
+ * you can set the dots to true if you want to
74
+ * render the slider with dots.
75
+ */
76
+ dots: PropTypes.bool,
77
+
78
+ /**
79
+ * If the value is true, it means a continuous
80
+ * value is included. Otherwise, it is an independent value.
81
+ */
82
+ included: PropTypes.bool,
83
+
84
+ /**
85
+ * Configuration for tooltips describing the current slider value
86
+ */
87
+ tooltip: PropTypes.exact({
88
+ /**
89
+ * Determines whether tooltips should always be visible
90
+ * (as opposed to the default, visible on hover)
91
+ */
92
+ always_visible: PropTypes.bool,
93
+
94
+ /**
95
+ * Determines the placement of tooltips
96
+ * See https://github.com/react-component/tooltip#api
97
+ * top/bottom{*} sets the _origin_ of the tooltip, so e.g. `topLeft`
98
+ * will in reality appear to be on the top right of the handle
99
+ */
100
+ placement: PropTypes.oneOf([
101
+ 'left',
102
+ 'right',
103
+ 'top',
104
+ 'bottom',
105
+ 'topLeft',
106
+ 'topRight',
107
+ 'bottomLeft',
108
+ 'bottomRight',
109
+ ]),
110
+ /**
111
+ * Template string to display the tooltip in.
112
+ * Must contain `{value}`, which will be replaced with either
113
+ * the default string representation of the value or the result of the
114
+ * transform function if there is one.
115
+ */
116
+ template: PropTypes.string,
117
+ /**
118
+ * Custom style for the tooltip.
119
+ */
120
+ style: PropTypes.object,
121
+ /**
122
+ * Reference to a function in the `window.dccFunctions` namespace.
123
+ * This can be added in a script in the asset folder.
124
+ *
125
+ * For example, in `assets/tooltip.js`:
126
+ * ```
127
+ * window.dccFunctions = window.dccFunctions || {};
128
+ * window.dccFunctions.multByTen = function(value) {
129
+ * return value * 10;
130
+ * }
131
+ * ```
132
+ * Then in the component `tooltip={'transform': 'multByTen'}`
133
+ */
134
+ transform: PropTypes.string,
135
+ }),
136
+
137
+ /**
138
+ * Determines when the component should update its `value`
139
+ * property. If `mouseup` (the default) then the slider
140
+ * will only trigger its value when the user has finished
141
+ * dragging the slider. If `drag`, then the slider will
142
+ * update its value continuously as it is being dragged.
143
+ * If you want different actions during and after drag,
144
+ * leave `updatemode` as `mouseup` and use `drag_value`
145
+ * for the continuously updating value.
146
+ */
147
+ updatemode: PropTypes.oneOf(['mouseup', 'drag']),
148
+
149
+ /**
150
+ * If true, the slider will be vertical
151
+ */
152
+ vertical: PropTypes.bool,
153
+
154
+ /**
155
+ * The height, in px, of the slider if it is vertical.
156
+ */
157
+ verticalHeight: PropTypes.number,
158
+
159
+ /**
160
+ * Additional CSS class for the root DOM node
161
+ */
162
+ className: PropTypes.string,
163
+
164
+ /**
165
+ * The ID of this component, used to identify dash components
166
+ * in callbacks. The ID needs to be unique across all of the
167
+ * components in an app.
168
+ */
169
+ id: PropTypes.string,
170
+
171
+ /**
172
+ * Dash-assigned callback that gets fired when the value or drag_value changes.
173
+ */
174
+ setProps: PropTypes.func,
175
+
176
+ /**
177
+ * Used to allow user interactions in this component to be persisted when
178
+ * the component - or the page - is refreshed. If `persisted` is truthy and
179
+ * hasn't changed from its previous value, a `value` that the user has
180
+ * changed while using the app will keep that change, as long as
181
+ * the new `value` also matches what was given originally.
182
+ * Used in conjunction with `persistence_type`.
183
+ */
184
+ persistence: PropTypes.oneOfType([
185
+ PropTypes.bool,
186
+ PropTypes.string,
187
+ PropTypes.number,
188
+ ]),
189
+
190
+ /**
191
+ * Properties whose user interactions will persist after refreshing the
192
+ * component or the page. Since only `value` is allowed this prop can
193
+ * normally be ignored.
194
+ */
195
+ persisted_props: PropTypes.arrayOf(PropTypes.oneOf(['value'])),
196
+
197
+ /**
198
+ * Where persisted user changes will be stored:
199
+ * memory: only kept in memory, reset on page refresh.
200
+ * local: window.localStorage, data is kept after the browser quit.
201
+ * session: window.sessionStorage, data is cleared once the browser quit.
202
+ */
203
+ persistence_type: PropTypes.oneOf(['local', 'session', 'memory']),
204
+ };
205
+
206
+ Slider.defaultProps = {
207
+ updatemode: 'mouseup',
208
+ persisted_props: ['value'],
209
+ persistence_type: 'local',
210
+ verticalHeight: 400,
211
+ };
212
+
213
+ export const propTypes = Slider.propTypes;
214
+ export const defaultProps = Slider.defaultProps;
@@ -0,0 +1,81 @@
1
+ import {omit} from 'ramda';
2
+ import React, {lazy, Suspense, useCallback, useMemo} from 'react';
3
+ import {
4
+ PersistedProps,
5
+ PersistenceTypes,
6
+ RangeSliderProps,
7
+ SliderProps,
8
+ } from '../types';
9
+ import rangeSlider from '../utils/LazyLoader/rangeSlider';
10
+ import './css/sliders.css';
11
+
12
+ const RealSlider = lazy(rangeSlider);
13
+
14
+ /**
15
+ * A slider component with a single handle.
16
+ */
17
+ export default function Slider({
18
+ updatemode = 'mouseup',
19
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
20
+ persisted_props = [PersistedProps.value],
21
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
+ persistence_type = PersistenceTypes.local,
23
+ // eslint-disable-next-line no-magic-numbers
24
+ verticalHeight = 400,
25
+ step = 1,
26
+ setProps,
27
+ value,
28
+ drag_value,
29
+ ...props
30
+ }: SliderProps) {
31
+ // This is actually a wrapper around a RangeSlider.
32
+ // We'll modify key `Slider` props to be compatible with a Range Slider.
33
+
34
+ const mappedValue: RangeSliderProps['value'] = useMemo(() => {
35
+ return typeof value === 'number' ? [value] : value;
36
+ }, [value]);
37
+
38
+ const mappedDragValue: RangeSliderProps['drag_value'] = useMemo(() => {
39
+ return typeof drag_value === 'number' ? [drag_value] : drag_value;
40
+ }, [drag_value]);
41
+
42
+ const mappedSetProps: RangeSliderProps['setProps'] = useCallback(
43
+ newProps => {
44
+ const {value, drag_value} = newProps;
45
+ const mappedProps: Partial<SliderProps> = omit(
46
+ ['value', 'drag_value', 'setProps'],
47
+ newProps
48
+ );
49
+ if ('value' in newProps) {
50
+ mappedProps.value = value ? value[0] : value;
51
+ }
52
+ if ('drag_value' in newProps) {
53
+ mappedProps.drag_value = drag_value
54
+ ? drag_value[0]
55
+ : drag_value;
56
+ }
57
+
58
+ setProps(mappedProps);
59
+ },
60
+ [setProps]
61
+ );
62
+
63
+ return (
64
+ <Suspense fallback={null}>
65
+ <RealSlider
66
+ updatemode={updatemode}
67
+ verticalHeight={verticalHeight}
68
+ step={step}
69
+ value={mappedValue}
70
+ drag_value={mappedDragValue}
71
+ setProps={mappedSetProps}
72
+ {...props}
73
+ />
74
+ </Suspense>
75
+ );
76
+ }
77
+
78
+ Slider.dashPersistence = {
79
+ persisted_props: [PersistedProps.value],
80
+ persistence_type: PersistenceTypes.local,
81
+ };
@@ -0,0 +1,13 @@
1
+ :root {
2
+ --Dash-Spacing: 4px;
3
+ --Dash-Stroke-Strong: rgba(0, 18, 77, 0.45);
4
+ --Dash-Stroke-Weak: rgba(0, 24, 102, 0.1);
5
+ --Dash-Fill-Interactive-Strong: #7f4bc4;
6
+ --Dash-Fill-Weak: rgba(0, 30, 128, 0.04);
7
+ --Dash-Fill-Inverse-Strong: #fff;
8
+ --Dash-Text-Primary: rgba(0, 18, 77, 0.87);
9
+ --Dash-Text-Strong: rgba(0, 9, 38, 0.9);
10
+ --Dash-Fill-Primary-Hover: rgba(0, 18, 77, 0.04);
11
+ --Dash-Fill-Primary-Active: rgba(0, 18, 77, 0.08);
12
+ --Dash-Fill-Disabled: rgba(0, 24, 102, 0.1);
13
+ }
@@ -1,7 +1,121 @@
1
- input.dash-input:invalid {
1
+ /* Input container styles */
2
+ .dash-input-container {
3
+ position: relative;
4
+ display: inline-flex;
5
+ align-items: center;
6
+ width: 170px; /* default input width */
7
+ height: 32px;
8
+ background: var(--Dash-Fill-Inverse-Strong);
9
+ border-radius: var(--Dash-Spacing);
10
+ border: 1px solid var(--Dash-Stroke-Strong);
11
+ box-sizing: border-box;
12
+ container-type: inline-size;
13
+ vertical-align: middle;
14
+ color: inherit;
15
+ overflow: hidden;
16
+ }
17
+
18
+ .dash-input-container:has(input[type='range']) {
19
+ background: inherit;
20
+ }
21
+
22
+ /* Input field styles */
23
+ .dash-input-element {
24
+ padding: var(--Dash-Spacing) calc(2 * var(--Dash-Spacing));
25
+ color: inherit;
26
+ background: inherit;
27
+ border: none;
28
+ border-radius: var(--Dash-Spacing);
29
+ flex: 1 1 0;
30
+ min-width: 0;
31
+ height: 100%;
32
+ box-sizing: border-box;
33
+ z-index: 1;
34
+ order: 2;
35
+ }
36
+
37
+ /* Hide native steppers for number inputs */
38
+ .dash-input-element[type='number'] {
39
+ -moz-appearance: textfield;
40
+ }
41
+
42
+ .dash-input-element[type='number']::-webkit-outer-spin-button,
43
+ .dash-input-element[type='number']::-webkit-inner-spin-button {
44
+ -webkit-appearance: none;
45
+ margin: 0;
46
+ }
47
+
48
+ /* Show native steppers when container is narrow and input is number type */
49
+ @container (max-width: 99px) {
50
+ .dash-input-element[type='number'] {
51
+ -moz-appearance: number-input;
52
+ }
53
+
54
+ .dash-input-element[type='number']::-webkit-outer-spin-button,
55
+ .dash-input-element[type='number']::-webkit-inner-spin-button {
56
+ -webkit-appearance: inner-spin-button;
57
+ margin: 0;
58
+ }
59
+ }
60
+
61
+ /* Stepper button base styles */
62
+ .dash-input-stepper {
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ width: 32px;
67
+ height: 100%;
68
+ border: none;
69
+ background: var(--Dash-Fill-Inverse-Strong);
70
+ cursor: pointer;
71
+ font-size: 16px;
72
+ font-weight: bold;
73
+ color: var(--Dash-Text-Primary);
74
+ }
75
+
76
+ .dash-input-stepper:hover {
77
+ background: var(--Dash-Fill-Primary-Hover);
78
+ }
79
+
80
+ .dash-input-stepper:active {
81
+ background: var(--Dash-Fill-Primary-Active);
82
+ }
83
+
84
+ .dash-input-stepper:disabled {
85
+ background: var(--Dash-Fill-Inverse-Strong);
86
+ opacity: 0.5;
87
+ cursor: default;
88
+ }
89
+
90
+ @container (max-width: 99px) {
91
+ .dash-input-stepper {
92
+ display: none;
93
+ }
94
+ }
95
+
96
+ /* Decrement button specific styles */
97
+ .dash-input-stepper.dash-stepper-decrement {
98
+ border-right: 1px solid var(--Dash-Stroke-Weak);
99
+ border-radius: var(--Dash-Spacing) 0 0 var(--Dash-Spacing);
100
+ order: 1;
101
+ }
102
+
103
+ /* Increment button specific styles */
104
+ .dash-input-stepper.dash-stepper-increment {
105
+ border-left: 1px solid var(--Dash-Stroke-Weak);
106
+ border-radius: 0 var(--Dash-Spacing) var(--Dash-Spacing) 0;
107
+ order: 3;
108
+ }
109
+
110
+ /* Hidden input type */
111
+ .dash-input-container.dash-input-hidden {
112
+ display: none;
113
+ }
114
+
115
+ input.dash-input-element:invalid {
2
116
  outline: solid red;
3
117
  }
4
118
 
5
- input.dash-input:valid {
119
+ input.dash-input-element:valid {
6
120
  outline: none black;
7
121
  }
@@ -1 +1 @@
1
- .Select,.Select-control{position:relative}.Select-control,.Select-input>input{width:100%;cursor:default;outline:0}.Select-arrow-zone,.Select-clear-zone,.Select-loading-zone{text-align:center;cursor:pointer}.Select,.Select div,.Select input,.Select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.Select.is-disabled>.Select-control{background-color:#f9f9f9}.Select.is-disabled>.Select-control:hover{box-shadow:none}.Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none;opacity:.35}.Select-control{background-color:#fff;border-radius:4px;border:1px solid #ccc;color:#333;display:table;border-spacing:0;border-collapse:separate;height:36px;overflow:hidden}.is-searchable.is-focused:not(.is-open)>.Select-control,.is-searchable.is-open>.Select-control{cursor:text}.Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.Select-control .Select-input:focus{outline:0}.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9}.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.is-focused:not(.is-open)>.Select-control{border-color:#007eff;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 0 3px rgba(0,126,255,.1)}.Select--single>.Select-control .Select-value,.Select-placeholder{bottom:0;color:#aaa;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.has-value.Select--single>.Select-control .Select-value .Select-value-label,.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label{color:#333}.has-value.Select--single>.Select-control .Select-value a.Select-value-label,.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover,.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#007eff;outline:0;text-decoration:underline}.Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.Select-input>input{background:none;border:0;box-shadow:none;display:inline-block;font-family:inherit;font-size:inherit;margin:0;line-height:14px;padding:8px 0 12px;-webkit-appearance:none}.Select-loading,.Select-loading-zone{width:16px;position:relative;vertical-align:middle}.is-focused .Select-input>input{cursor:text}.has-value.is-pseudo-focused .Select-input{opacity:0}.Select-control:not(.is-searchable)>.Select-input{outline:0}.Select-loading-zone{display:table-cell}.Select-loading{-webkit-animation:Select-animation-spin .4s infinite linear;-o-animation:Select-animation-spin .4s infinite linear;animation:Select-animation-spin .4s infinite linear;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block}.Select-clear-zone{-webkit-animation:Select-animation-fadeIn .2s;-o-animation:Select-animation-fadeIn .2s;animation:Select-animation-fadeIn .2s;color:#999;display:table-cell;position:relative;vertical-align:middle;width:17px}.Select-clear-zone:hover{color:#D0021B}.Select-clear{display:inline-block;font-size:18px;line-height:1}.Select--multi .Select-clear-zone{width:17px}.Select-arrow-zone{display:table-cell;position:relative;vertical-align:middle;width:25px;padding-right:5px}.Select--multi .Select-multi-value-wrapper,.Select-arrow{display:inline-block}.Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;height:0;width:0;position:relative}.Select-arrow-zone:hover>.Select-arrow,.is-open .Select-arrow{border-top-color:#666}.Select .Select-aria-only{display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}.Select-noresults,.Select-option{box-sizing:border-box;display:block;padding:8px 10px}@-webkit-keyframes Select-animation-fadeIn{from{opacity:0}to{opacity:1}}@keyframes Select-animation-fadeIn{from{opacity:0}to{opacity:1}}.Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;top:100%;width:100%;z-index:1;-webkit-overflow-scrolling:touch}.Select-menu{max-height:198px;overflow-y:auto}.Select-option{background-color:#fff;color:#666;cursor:pointer}.Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.Select-option.is-selected{background-color:#f5faff;background-color:rgba(0,126,255,.04);color:#333}.Select-option.is-focused{background-color:#ebf5ff;background-color:rgba(0,126,255,.08);color:#333}.Select-option.is-disabled{color:#ccc;cursor:default}.Select-noresults{color:#999;cursor:default}.Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.Select--multi.has-value .Select-input{margin-left:5px}.Select--multi .Select-value{background-color:#ebf5ff;background-color:rgba(0,126,255,.08);border-radius:2px;border:1px solid #c2e0ff;border:1px solid rgba(0,126,255,.24);color:#007eff;display:inline-block;font-size:.9em;line-height:1.4;margin-left:5px;margin-top:5px;vertical-align:top}.Select--multi .Select-value-icon,.Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.Select--multi a.Select-value-label{color:#007eff;cursor:pointer;text-decoration:none}.Select--multi a.Select-value-label:hover{text-decoration:underline}.Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c2e0ff;border-right:1px solid rgba(0,126,255,.24);padding:1px 5px 3px}.Select--multi .Select-value-icon:focus,.Select--multi .Select-value-icon:hover{background-color:#d8eafd;background-color:rgba(0,113,230,.08);color:#0071e6}.Select--multi .Select-value-icon:active{background-color:#c2e0ff;background-color:rgba(0,126,255,.24)}.Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#333}.Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.Select--multi.is-disabled .Select-value-icon:active,.Select--multi.is-disabled .Select-value-icon:focus,.Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}@keyframes Select-animation-spin{to{transform:rotate(1turn)}}@-webkit-keyframes Select-animation-spin{to{-webkit-transform:rotate(1turn)}}
1
+ .Select,.Select-control{position:relative}.Select-control,.Select-input>input{width:100%;cursor:default;outline:0}.Select-arrow-zone,.Select-clear-zone,.Select-loading-zone{text-align:center;cursor:pointer}.Select,.Select div,.Select input,.Select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.Select.is-disabled>.Select-control{background-color:#f9f9f9}.Select.is-disabled>.Select-control:hover{box-shadow:none}.Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none;opacity:.35}.Select-control{background-color:#fff;border-radius:4px;border:1px solid #ccc;color:#333;display:table;border-spacing:0;border-collapse:separate;height:36px;overflow:hidden}.is-searchable.is-focused:not(.is-open)>.Select-control,.is-searchable.is-open>.Select-control{cursor:text}.Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.Select-control .Select-input:focus{outline:0}.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9}.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.is-focused:not(.is-open)>.Select-control{border-color:#007eff;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 0 3px rgba(0,126,255,.1)}.Select--single>.Select-control .Select-value,.Select-placeholder{bottom:0;color:#aaa;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.has-value.Select--single>.Select-control .Select-value .Select-value-label,.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label{color:#333}.has-value.Select--single>.Select-control .Select-value a.Select-value-label,.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover,.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#007eff;outline:0;text-decoration:underline}.Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.Select-input>input{background:none;border:0;box-shadow:none;display:inline-block;font-family:inherit;font-size:inherit;margin:0;line-height:14px;padding:8px 0 12px;-webkit-appearance:none}.Select-loading,.Select-loading-zone{width:16px;position:relative;vertical-align:middle}.is-focused .Select-input>input{cursor:text}.has-value.is-pseudo-focused .Select-input{opacity:0}.Select-control:not(.is-searchable)>.Select-input{outline:0}.Select-loading-zone{display:table-cell}.Select-loading{-webkit-animation:Select-animation-spin .4s infinite linear;-o-animation:Select-animation-spin .4s infinite linear;animation:Select-animation-spin .4s infinite linear;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block}.Select-clear-zone{-webkit-animation:Select-animation-fadeIn .2s;-o-animation:Select-animation-fadeIn .2s;animation:Select-animation-fadeIn .2s;color:#999;display:table-cell;position:relative;vertical-align:middle;width:17px}.Select-clear-zone:hover{color:#D0021B}.Select-clear{display:inline-block;font-size:18px;line-height:1}.Select--multi .Select-clear-zone{width:17px}.Select-arrow-zone{display:table-cell;position:relative;vertical-align:middle;width:25px;padding-right:5px}.Select--multi .Select-multi-value-wrapper,.Select-arrow{display:inline-block}.Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;height:0;width:0;position:relative}.Select-arrow-zone:hover>.Select-arrow,.is-open .Select-arrow{border-top-color:#666}.Select .Select-aria-only{display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}.Select-noresults,.Select-option{box-sizing:border-box;display:block;padding:8px 10px}@-webkit-keyframes Select-animation-fadeIn{from{opacity:0}to{opacity:1}}@keyframes Select-animation-fadeIn{from{opacity:0}to{opacity:1}}.Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;top:100%;width:100%;z-index:1;-webkit-overflow-scrolling:touch}.Select-menu{max-height:198px;overflow-y:auto}.Select-option{background-color:#fff;color:#666;cursor:pointer}.Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.Select-option.is-selected{background-color:#f5faff;background-color:rgba(0,126,255,.04);color:#333}.Select-option.is-focused{background-color:#ebf5ff;background-color:rgba(0,126,255,.08);color:#333}.Select-option.is-disabled{color:#ccc;cursor:default}.Select-noresults{color:#999;cursor:default}.Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.Select--multi.has-value .Select-input{margin-left:5px}.Select--multi .Select-value{background-color:#ebf5ff;background-color:rgba(0,126,255,.08);border-radius:2px;border:1px solid #c2e0ff;border:1px solid rgba(0,126,255,.24);color:#007eff;display:inline-block;font-size:.9em;line-height:1.4;margin-left:5px;margin-top:5px;vertical-align:top}.Select--multi .Select-value-icon,.Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.Select--multi a.Select-value-label{color:#007eff;cursor:pointer;text-decoration:none}.Select--multi a.Select-value-label:hover{text-decoration:underline}.Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c2e0ff;border-right:1px solid rgba(0,126,255,.24);padding:1px 5px 3px}.Select--multi .Select-value-icon:focus,.Select--multi .Select-value-icon:hover{background-color:#d8eafd;background-color:rgba(0,113,230,.08);color:#0071e6}.Select--multi .Select-value-icon:active{background-color:#c2e0ff;background-color:rgba(0,126,255,.24)}.Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#333}.Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.Select--multi.is-disabled .Select-value-icon:active,.Select--multi.is-disabled .Select-value-icon:focus,.Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}@keyframes Select-animation-spin{to{transform:rotate(1turn)}}@-webkit-keyframes Select-animation-spin{to{-webkit-transform:rotate(1turn)}}
@@ -1,5 +1,199 @@
1
- /* Fix the default tooltip style height conflicting with the actual size of the tooltip. */
2
- .rc-slider-tooltip-content > .rc-slider-tooltip-inner {
3
- height: unset;
4
- min-height: 20px;
1
+ .dash-slider-root {
2
+ position: relative;
3
+ z-index: 0;
4
+ display: flex;
5
+ align-items: center;
6
+ user-select: none;
7
+ touch-action: none;
8
+ width: 100%;
9
+ height: 14px;
10
+ padding: 8px 0 28px 0;
11
+ box-sizing: border-box;
12
+ /* Override Radix's default margin/padding behavior */
13
+ --radix-slider-thumb-width: 16px;
14
+ }
15
+
16
+ .dash-slider-root[data-orientation='vertical'].has-marks {
17
+ padding-bottom: 0px;
18
+ }
19
+
20
+ .dash-slider-root[data-orientation='vertical'] {
21
+ flex-direction: column;
22
+ width: 20px;
23
+ height: 100%;
24
+ }
25
+
26
+ .dash-slider-track {
27
+ position: relative;
28
+ flex-grow: 1;
29
+ border-radius: 9999px;
30
+ height: 4px;
31
+ background-color: var(--Dash-Fill-Disabled);
32
+ }
33
+
34
+ .dash-slider-root[data-orientation='vertical'] .dash-slider-track {
35
+ width: 4px;
36
+ height: auto;
37
+ overflow-y: hidden;
38
+ }
39
+
40
+ .dash-slider-range {
41
+ position: absolute;
42
+ border-radius: 9999px;
43
+ height: 100%;
44
+ background-color: var(--Dash-Fill-Interactive-Strong);
45
+ }
46
+
47
+ .dash-slider-root[data-orientation='vertical'] .dash-slider-range {
48
+ width: 100%;
49
+ height: auto;
50
+ }
51
+
52
+ .dash-slider-thumb {
53
+ display: block;
54
+ width: 16px;
55
+ height: 16px;
56
+ background-color: var(--Dash-Fill-Interactive-Strong);
57
+ border: 2px solid var(--Dash-Fill-Inverse-Strong);
58
+ border-radius: 50%;
59
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
60
+ cursor: pointer;
61
+ outline: none;
62
+ transition: all 0.15s ease-in-out;
63
+ }
64
+
65
+ .dash-slider-thumb:focus,
66
+ .dash-slider-thumb:hover {
67
+ transform: scale(1.125); /* Scale to make 16px thumb appear as 18px */
68
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
69
+ }
70
+
71
+ .dash-slider-thumb:focus .dash-slider-tooltip,
72
+ .dash-slider-thumb:hover .dash-slider-tooltip {
73
+ display: block;
74
+ }
75
+
76
+ .dash-slider-thumb[data-disabled] {
77
+ cursor: not-allowed;
78
+ opacity: 0.5;
79
+ }
80
+
81
+ .dash-slider-mark {
82
+ position: absolute;
83
+ font-size: 12px;
84
+ line-height: 12px;
85
+ color: var(--Dash-Text-Strong);
86
+ white-space: nowrap;
87
+ pointer-events: none;
88
+ }
89
+
90
+ .dash-slider-mark:before {
91
+ content: '';
92
+ position: absolute;
93
+ bottom: 100%;
94
+ left: 50%;
95
+ transform: translateX(-50%);
96
+ background-color: var(--Dash-Fill-Disabled);
97
+ width: 4px;
98
+ height: 6px;
99
+ border-radius: 2px;
100
+ margin-bottom: 2px;
101
+ }
102
+ .dash-slider-mark.with-dots:before {
103
+ content: initial;
104
+ }
105
+
106
+ .dash-slider-root[data-orientation='vertical'] .dash-slider-mark:before {
107
+ content: initial;
108
+ }
109
+
110
+ .dash-slider-dot {
111
+ pointer-events: none;
112
+ position: absolute;
113
+ width: 8px;
114
+ height: 8px;
115
+ border-radius: 50%;
116
+ background-color: var(--Dash-Fill-Disabled);
117
+ }
118
+
119
+ .dash-slider-tooltip {
120
+ display: none;
121
+ position: absolute;
122
+ border-radius: var(--Dash-Spacing);
123
+ padding: calc(var(--Dash-Spacing) * 3);
124
+ font-size: 12px;
125
+ line-height: 1;
126
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
127
+ background-color: var(--Dash-Fill-Inverse-Strong);
128
+ user-select: none;
129
+ z-index: 1000;
130
+ fill: var(--Dash-Fill-Inverse-Strong);
131
+ }
132
+
133
+ .dash-slider-tooltip.always-visible {
134
+ display: block;
135
+ }
136
+
137
+ /* Include property to mimic rc-slider behavior */
138
+ .dash-slider-root:not([data-included='false']) .dash-slider-range {
139
+ background-color: var(--Dash-Fill-Interactive-Strong);
140
+ }
141
+
142
+ .dash-slider-root[data-included='false'] .dash-slider-range {
143
+ background-color: transparent;
144
+ }
145
+
146
+ /* Disabled state */
147
+ .dash-slider-root[data-disabled] {
148
+ opacity: 0.5;
149
+ cursor: not-allowed;
150
+ }
151
+
152
+ .dash-slider-root[data-disabled] .dash-slider-track {
153
+ background-color: var(--Dash-Fill-Disabled);
154
+ }
155
+
156
+ .dash-slider-root[data-disabled] .dash-slider-range {
157
+ background-color: var(--Dash-Fill-Disabled);
158
+ }
159
+
160
+ .dash-slider-root[data-disabled] .dash-slider-thumb {
161
+ cursor: not-allowed;
162
+ border-color: var(--Dash-Fill-Disabled);
163
+ }
164
+
165
+ .dash-slider-container {
166
+ display: flex;
167
+ align-items: center;
168
+ gap: 12px;
169
+ width: 100%;
170
+ }
171
+
172
+ .dash-slider-wrapper {
173
+ flex: 1;
174
+ min-width: 0;
175
+ }
176
+
177
+ .dash-range-slider-inputs {
178
+ display: flex;
179
+ flex-direction: column;
180
+ gap: 4px;
181
+ min-width: 64px;
182
+ }
183
+
184
+ .dash-range-slider-min-input {
185
+ min-width: 64px;
186
+ }
187
+
188
+ .dash-range-slider-input {
189
+ width: 64px;
190
+ margin-top: 8px;
191
+ -moz-appearance: textfield;
192
+ }
193
+
194
+ /* Hide the number input spinners */
195
+ .dash-range-slider-input::-webkit-inner-spin-button,
196
+ .dash-range-slider-input::-webkit-outer-spin-button {
197
+ -webkit-appearance: none;
198
+ margin: 0;
5
199
  }