dash-core-components 4.0.0-rc0 → 4.0.0-rc2

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 (67) 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-slider.js +1 -2
  7. package/dash_core_components/async-slider.js.map +1 -1
  8. package/dash_core_components/dash_core_components-shared.js +1 -1
  9. package/dash_core_components/dash_core_components-shared.js.map +1 -1
  10. package/dash_core_components/dash_core_components.js +1 -1
  11. package/dash_core_components/dash_core_components.js.map +1 -1
  12. package/dash_core_components/proptypes.js +118 -1
  13. package/lib/components/Checklist.tsx +67 -0
  14. package/lib/components/Dropdown.tsx +68 -0
  15. package/lib/components/Loading.tsx +185 -0
  16. package/lib/components/RadioItems.tsx +69 -0
  17. package/lib/components/RangeSlider.tsx +12 -1
  18. package/lib/components/Slider.tsx +12 -1
  19. package/lib/components/Tab.react.js.old +79 -0
  20. package/lib/components/Textarea.react.js.old +287 -0
  21. package/lib/components/Textarea.tsx +79 -0
  22. package/lib/components/Tooltip.tsx +66 -0
  23. package/lib/components/css/checklist.css +4 -0
  24. package/lib/components/css/dcc.css +3 -0
  25. package/lib/components/css/dropdown.css +211 -0
  26. package/lib/components/css/input.css +22 -6
  27. package/lib/components/css/optionslist.css +34 -0
  28. package/lib/components/css/radioitems.css +4 -0
  29. package/lib/components/css/sliders.css +19 -7
  30. package/lib/components/css/textarea.css +21 -0
  31. package/lib/components/css/tooltip.css +127 -0
  32. package/lib/fragments/Dropdown.tsx +513 -0
  33. package/lib/fragments/Loading/spinners/CircleSpinner.tsx +185 -0
  34. package/lib/fragments/Loading/spinners/CubeSpinner.tsx +193 -0
  35. package/lib/fragments/Loading/spinners/DebugTitle.tsx +11 -0
  36. package/lib/fragments/Loading/spinners/DefaultSpinner.tsx +110 -0
  37. package/lib/fragments/Loading/spinners/DotSpinner.tsx +96 -0
  38. package/lib/fragments/Loading/spinners/GraphSpinner.tsx +332 -0
  39. package/lib/fragments/Loading/types.ts +13 -0
  40. package/lib/fragments/RangeSlider.tsx +235 -105
  41. package/lib/index.ts +6 -6
  42. package/lib/types.ts +571 -64
  43. package/lib/utils/LazyLoader/dropdown.ts +2 -0
  44. package/lib/utils/_LoadingElement.tsx +8 -18
  45. package/lib/utils/dropdownSearch.ts +92 -0
  46. package/lib/utils/optionRendering.tsx +168 -0
  47. package/lib/utils/optionTypes.ts +27 -0
  48. package/lib/utils/sliderRendering.tsx +23 -4
  49. package/package.json +7 -4
  50. package/lib/components/Checklist.react.js +0 -193
  51. package/lib/components/Dropdown.react.js +0 -182
  52. package/lib/components/Input.react.js.old +0 -507
  53. package/lib/components/Loading.react.js +0 -254
  54. package/lib/components/RadioItems.react.js +0 -192
  55. package/lib/components/Slider.react.js.old +0 -214
  56. package/lib/components/Textarea.react.js +0 -223
  57. package/lib/components/Tooltip.react.js +0 -120
  58. package/lib/components/css/Dropdown.css +0 -8
  59. package/lib/fragments/Dropdown.react.js +0 -158
  60. package/lib/fragments/Loading/spinners/CircleSpinner.js +0 -68
  61. package/lib/fragments/Loading/spinners/CubeSpinner.js +0 -57
  62. package/lib/fragments/Loading/spinners/DebugTitle.js +0 -15
  63. package/lib/fragments/Loading/spinners/DefaultSpinner.js +0 -54
  64. package/lib/fragments/Loading/spinners/DotSpinner.js +0 -50
  65. package/lib/fragments/Loading/spinners/GraphSpinner.js +0 -68
  66. package/lib/fragments/Slider.tsx.old +0 -364
  67. package/lib/utils/LazyLoader/dropdown.js +0 -8
@@ -0,0 +1,287 @@
1
+ /* eslint-disable no-unused-vars */
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import {pick} from 'ramda';
5
+
6
+ const textAreaProps = [
7
+ 'id',
8
+ 'autoFocus',
9
+ 'cols',
10
+ 'disabled',
11
+ 'form',
12
+ 'maxLength',
13
+ 'minLength',
14
+ 'name',
15
+ 'placeholder',
16
+ 'readOnly',
17
+ 'required',
18
+ 'rows',
19
+ 'wrap',
20
+ 'accessKey',
21
+ 'className',
22
+ 'contentEditable',
23
+ 'contextMenu',
24
+ 'dir',
25
+ 'draggable',
26
+ 'hidden',
27
+ 'lang',
28
+ 'spellCheck',
29
+ 'style',
30
+ 'tabIndex',
31
+ 'title',
32
+ ];
33
+
34
+ /**
35
+ * A basic HTML textarea for entering multiline text.
36
+ *
37
+ */
38
+ const Textarea = ({
39
+ setProps,
40
+ value,
41
+ n_blur = 0,
42
+ n_blur_timestamp = -1,
43
+ n_clicks,
44
+ n_clicks_timestamp = -1,
45
+ persisted_props,
46
+ persistence_type,
47
+ ...props
48
+ }) => {
49
+ const ctx = window.dash_component_api.useDashContext();
50
+ const isLoading = ctx.useLoading();
51
+
52
+ return (
53
+ <textarea
54
+ data-dash-is-loading={isLoading || undefined}
55
+ value={value}
56
+ onChange={e => {
57
+ setProps({value: e.target.value});
58
+ }}
59
+ onBlur={() => {
60
+ setProps({
61
+ n_blur: n_blur + 1,
62
+ n_blur_timestamp: Date.now(),
63
+ });
64
+ }}
65
+ onClick={() => {
66
+ setProps({
67
+ n_clicks: n_clicks + 1,
68
+ n_clicks_timestamp: Date.now(),
69
+ });
70
+ }}
71
+ {...pick(textAreaProps, props)}
72
+ />
73
+ );
74
+ };
75
+
76
+ Textarea.dashPersistence = {
77
+ persisted_props: ['value'],
78
+ persistence_type: 'local',
79
+ };
80
+
81
+ Textarea.propTypes = {
82
+ /**
83
+ * The ID of this component, used to identify dash components
84
+ * in callbacks. The ID needs to be unique across all of the
85
+ * components in an app.
86
+ */
87
+ id: PropTypes.string,
88
+
89
+ /**
90
+ * The value of the textarea
91
+ */
92
+ value: PropTypes.string,
93
+
94
+ /**
95
+ * The element should be automatically focused after the page loaded.
96
+ */
97
+ autoFocus: PropTypes.string,
98
+
99
+ /**
100
+ * Defines the number of columns in a textarea.
101
+ */
102
+ cols: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
103
+
104
+ /**
105
+ * Indicates whether the user can interact with the element.
106
+ */
107
+ disabled: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
108
+
109
+ /**
110
+ * Indicates the form that is the owner of the element.
111
+ */
112
+ form: PropTypes.string,
113
+
114
+ /**
115
+ * Defines the maximum number of characters allowed in the element.
116
+ */
117
+ maxLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
118
+
119
+ /**
120
+ * Defines the minimum number of characters allowed in the element.
121
+ */
122
+ minLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
123
+
124
+ /**
125
+ * Name of the element. For example used by the server to identify the fields in form submits.
126
+ */
127
+ name: PropTypes.string,
128
+
129
+ /**
130
+ * Provides a hint to the user of what can be entered in the field.
131
+ */
132
+ placeholder: PropTypes.string,
133
+
134
+ /**
135
+ * Indicates whether the element can be edited.
136
+ * readOnly is an HTML boolean attribute - it is enabled by a boolean or
137
+ * 'readOnly'. Alternative capitalizations `readonly` & `READONLY`
138
+ * are also acccepted.
139
+ */
140
+ readOnly: PropTypes.oneOfType([
141
+ PropTypes.bool,
142
+ PropTypes.oneOf(['readOnly', 'readonly', 'READONLY']),
143
+ ]),
144
+
145
+ /**
146
+ * Indicates whether this element is required to fill out or not.
147
+ * required is an HTML boolean attribute - it is enabled by a boolean or
148
+ * 'required'. Alternative capitalizations `REQUIRED`
149
+ * are also acccepted.
150
+ */
151
+ required: PropTypes.oneOfType([
152
+ PropTypes.oneOf(['required', 'REQUIRED']),
153
+ PropTypes.bool,
154
+ ]),
155
+
156
+ /**
157
+ * Defines the number of rows in a text area.
158
+ */
159
+ rows: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
160
+
161
+ /**
162
+ * Indicates whether the text should be wrapped.
163
+ */
164
+ wrap: PropTypes.string,
165
+
166
+ /**
167
+ * Defines a keyboard shortcut to activate or add focus to the element.
168
+ */
169
+ accessKey: PropTypes.string,
170
+
171
+ /**
172
+ * Often used with CSS to style elements with common properties.
173
+ */
174
+ className: PropTypes.string,
175
+
176
+ /**
177
+ * Indicates whether the element's content is editable.
178
+ */
179
+ contentEditable: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
180
+
181
+ /**
182
+ * Defines the ID of a <menu> element which will serve as the element's context menu.
183
+ */
184
+ contextMenu: PropTypes.string,
185
+
186
+ /**
187
+ * Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
188
+ */
189
+ dir: PropTypes.string,
190
+
191
+ /**
192
+ * Defines whether the element can be dragged.
193
+ */
194
+ draggable: PropTypes.oneOfType([
195
+ // enumerated property, not a boolean property: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
196
+ PropTypes.oneOf(['true', 'false']),
197
+ PropTypes.bool,
198
+ ]),
199
+
200
+ /**
201
+ * Prevents rendering of given element, while keeping child elements, e.g. script elements, active.
202
+ */
203
+ hidden: PropTypes.string,
204
+
205
+ /**
206
+ * Defines the language used in the element.
207
+ */
208
+ lang: PropTypes.string,
209
+
210
+ /**
211
+ * Indicates whether spell checking is allowed for the element.
212
+ */
213
+ spellCheck: PropTypes.oneOfType([
214
+ // enumerated property, not a boolean property: https://www.w3.org/TR/html51/editing.html#spelling-and-grammar-checking
215
+ PropTypes.oneOf(['true', 'false']),
216
+ PropTypes.bool,
217
+ ]),
218
+
219
+ /**
220
+ * Defines CSS styles which will override styles previously set.
221
+ */
222
+ style: PropTypes.object,
223
+
224
+ /**
225
+ * Overrides the browser's default tab order and follows the one specified instead.
226
+ */
227
+ tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
228
+
229
+ /**
230
+ * Text to be displayed in a tooltip when hovering over the element.
231
+ */
232
+ title: PropTypes.string,
233
+
234
+ /**
235
+ * Number of times the textarea lost focus.
236
+ */
237
+ n_blur: PropTypes.number,
238
+ /**
239
+ * Last time the textarea lost focus.
240
+ */
241
+ n_blur_timestamp: PropTypes.number,
242
+
243
+ /**
244
+ * Number of times the textarea has been clicked.
245
+ */
246
+ n_clicks: PropTypes.number,
247
+ /**
248
+ * Last time the textarea was clicked.
249
+ */
250
+ n_clicks_timestamp: PropTypes.number,
251
+
252
+ /**
253
+ * Dash-assigned callback that gets fired when the value changes.
254
+ */
255
+ setProps: PropTypes.func,
256
+
257
+ /**
258
+ * Used to allow user interactions in this component to be persisted when
259
+ * the component - or the page - is refreshed. If `persisted` is truthy and
260
+ * hasn't changed from its previous value, a `value` that the user has
261
+ * changed while using the app will keep that change, as long as
262
+ * the new `value` also matches what was given originally.
263
+ * Used in conjunction with `persistence_type`.
264
+ */
265
+ persistence: PropTypes.oneOfType([
266
+ PropTypes.bool,
267
+ PropTypes.string,
268
+ PropTypes.number,
269
+ ]),
270
+
271
+ /**
272
+ * Properties whose user interactions will persist after refreshing the
273
+ * component or the page. Since only `value` is allowed this prop can
274
+ * normally be ignored.
275
+ */
276
+ persisted_props: PropTypes.arrayOf(PropTypes.oneOf(['value'])),
277
+
278
+ /**
279
+ * Where persisted user changes will be stored:
280
+ * memory: only kept in memory, reset on page refresh.
281
+ * local: window.localStorage, data is kept after the browser quit.
282
+ * session: window.sessionStorage, data is cleared once the browser quit.
283
+ */
284
+ persistence_type: PropTypes.oneOf(['local', 'session', 'memory']),
285
+ };
286
+
287
+ export default Textarea;
@@ -0,0 +1,79 @@
1
+ /* eslint-disable no-unused-vars */
2
+ import React from 'react';
3
+ import {pick} from 'ramda';
4
+ import {PersistedProps, PersistenceTypes, TextAreaProps} from '../types';
5
+ import './css/textarea.css';
6
+
7
+ const textAreaProps = [
8
+ 'id',
9
+ 'cols',
10
+ 'rows',
11
+ 'minLength',
12
+ 'maxLength',
13
+ 'contentEditable',
14
+ 'tabIndex',
15
+ 'form',
16
+ 'name',
17
+ 'placeholder',
18
+ 'wrap',
19
+ 'accessKey',
20
+ 'contextMenu',
21
+ 'dir',
22
+ 'draggable',
23
+ 'lang',
24
+ 'spellCheck',
25
+ 'style',
26
+ 'title',
27
+ ] as const;
28
+
29
+ /**
30
+ * A basic HTML textarea for entering multiline text.
31
+ *
32
+ */
33
+ const Textarea = ({
34
+ setProps,
35
+ n_blur = 0,
36
+ n_blur_timestamp = -1,
37
+ n_clicks = 0,
38
+ n_clicks_timestamp = -1,
39
+ ...props
40
+ }: TextAreaProps) => {
41
+ const ctx = window.dash_component_api.useDashContext();
42
+ const isLoading = ctx.useLoading();
43
+
44
+ return (
45
+ <textarea
46
+ data-dash-is-loading={isLoading || undefined}
47
+ className={'dash-textarea ' + props.className}
48
+ value={props.value}
49
+ disabled={!!props.disabled}
50
+ readOnly={!!props.readOnly}
51
+ required={!!props.required}
52
+ autoFocus={!!props.autoFocus}
53
+ hidden={!!props.hidden}
54
+ onChange={e => {
55
+ setProps({value: e.target.value});
56
+ }}
57
+ onBlur={() => {
58
+ setProps({
59
+ n_blur: n_blur + 1,
60
+ n_blur_timestamp: Date.now(),
61
+ });
62
+ }}
63
+ onClick={() => {
64
+ setProps({
65
+ n_clicks: n_clicks + 1,
66
+ n_clicks_timestamp: Date.now(),
67
+ });
68
+ }}
69
+ {...pick(textAreaProps, props)}
70
+ />
71
+ );
72
+ };
73
+
74
+ Textarea.dashPersistence = {
75
+ persisted_props: [PersistedProps.value],
76
+ persistence_type: PersistenceTypes.local,
77
+ };
78
+
79
+ export default Textarea;
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import {TooltipProps} from '../types';
3
+ import './css/tooltip.css';
4
+
5
+ /**
6
+ * A tooltip with an absolute position.
7
+ */
8
+ const Tooltip = ({
9
+ show = true,
10
+ targetable = false,
11
+ direction = 'right',
12
+ border_color = 'var(--Dash-Stroke-Weak)',
13
+ background_color = 'var(--Dash-Fill-Inverse-Strong)',
14
+ className = '',
15
+ zindex = 1,
16
+ loading_text = 'Loading...',
17
+ ...props
18
+ }: TooltipProps) => {
19
+ const {bbox, id} = props;
20
+ const show_tooltip = show && bbox;
21
+
22
+ const ctx = window.dash_component_api.useDashContext();
23
+ const is_loading = ctx.useLoading();
24
+
25
+ const position = bbox ?? {x0: 0, x1: 0, y0: 0, y1: 0};
26
+
27
+ const styles = {
28
+ top: `${position?.y0}px`,
29
+ left: `${position?.x0}px`,
30
+ width: `${position?.x1 - position?.x0}px`,
31
+ height: `${position?.y1 - position?.y0}px`,
32
+ display: `${show_tooltip ? 'inline-block' : 'none'}`,
33
+ pointerEvents: `${targetable ? 'auto' : 'none'}`,
34
+ '--Dash-Tooltip-Border-Color': border_color,
35
+ '--Dash-Tooltip-Background-Color': background_color,
36
+ '--Dash-Tooltip-ZIndex': zindex,
37
+ } as const;
38
+
39
+ return (
40
+ <>
41
+ <div
42
+ className="dcc-tooltip-bounding-box dash-tooltip"
43
+ style={styles}
44
+ >
45
+ <div
46
+ className={`hover hover-${direction}`}
47
+ data-dash-is-loading={is_loading}
48
+ >
49
+ <span
50
+ id={id}
51
+ className={`hover-content ${className}`}
52
+ style={props.style}
53
+ >
54
+ {is_loading ? (
55
+ <span>{loading_text}</span>
56
+ ) : (
57
+ props.children
58
+ )}
59
+ </span>
60
+ </div>
61
+ </div>
62
+ </>
63
+ );
64
+ };
65
+
66
+ export default Tooltip;
@@ -0,0 +1,4 @@
1
+ .dash-options-list-option.dash-checklist-inline {
2
+ display: inline-flex;
3
+ margin-right: calc(var(--Dash-Spacing) * 4);
4
+ }
@@ -7,7 +7,10 @@
7
7
  --Dash-Fill-Inverse-Strong: #fff;
8
8
  --Dash-Text-Primary: rgba(0, 18, 77, 0.87);
9
9
  --Dash-Text-Strong: rgba(0, 9, 38, 0.9);
10
+ --Dash-Text-Disabled: rgba(0, 21, 89, 0.3);
10
11
  --Dash-Fill-Primary-Hover: rgba(0, 18, 77, 0.04);
11
12
  --Dash-Fill-Primary-Active: rgba(0, 18, 77, 0.08);
12
13
  --Dash-Fill-Disabled: rgba(0, 24, 102, 0.1);
14
+ --Dash-Shading-Strong: rgba(22, 23, 24, 0.35);
15
+ --Dash-Shading-Weak: rgba(22, 23, 24, 0.2);
13
16
  }
@@ -0,0 +1,211 @@
1
+ .dash-dropdown {
2
+ display: block;
3
+ flex: 1;
4
+ box-sizing: border-box;
5
+ margin: calc(var(--Dash-Spacing) * 2) 0;
6
+ padding: 0;
7
+ background: inherit;
8
+ border: none;
9
+ outline: none;
10
+ width: 100%;
11
+ cursor: pointer;
12
+ font-size: inherit;
13
+ overflow: hidden;
14
+ accent-color: var(--Dash-Fill-Interactive-Strong);
15
+ outline-color: var(--Dash-Fill-Interactive-Strong);
16
+ }
17
+
18
+ .dash-dropdown-grid-container {
19
+ display: grid;
20
+ grid-template-columns: auto 1fr;
21
+ justify-items: start;
22
+ align-items: center;
23
+ gap: 8px;
24
+ }
25
+
26
+ .dash-dropdown-grid-container:has(:nth-child(3)) {
27
+ grid-template-columns: auto 1fr auto;
28
+ }
29
+
30
+ .dash-dropdown-grid-container:has(:nth-child(4)) {
31
+ grid-template-columns: auto 1fr auto auto;
32
+ }
33
+
34
+ .dash-dropdown,
35
+ .dash-dropdown-content {
36
+ border-radius: var(--Dash-Spacing);
37
+ border: 1px solid var(--Dash-Stroke-Strong);
38
+ color: inherit;
39
+ text-align: left;
40
+ }
41
+
42
+ .dash-dropdown-trigger {
43
+ padding: 0 12px;
44
+ min-height: 32px;
45
+ height: 100%;
46
+ }
47
+
48
+ .dash-dropdown:focus {
49
+ outline: 1px solid var(--Dash-Fill-Interactive-Strong);
50
+ }
51
+
52
+ .dash-dropdown:disabled {
53
+ opacity: 0.6;
54
+ cursor: not-allowed;
55
+ }
56
+
57
+ .dash-dropdown-value {
58
+ max-width: 100%;
59
+ text-align: left;
60
+ overflow: hidden;
61
+ text-overflow: ellipsis;
62
+ white-space: nowrap;
63
+ }
64
+
65
+ .dash-dropdown-placeholder {
66
+ color: var(--Dash-Text-Disabled);
67
+ }
68
+
69
+ .dash-dropdown-value > * {
70
+ display: inline;
71
+ }
72
+
73
+ .dash-dropdown-content {
74
+ background: var(--Dash-Fill-Inverse-Strong);
75
+ width: fit-content;
76
+ min-width: var(--radix-popover-trigger-width);
77
+ max-width: 98vw;
78
+ overflow-y: auto;
79
+ z-index: 500;
80
+ box-shadow: 0px 10px 38px -10px var(--Dash-Shading-Strong),
81
+ 0px 10px 20px -15px var(--Dash-Shading-Weak);
82
+ }
83
+
84
+ .dash-dropdown-value-count,
85
+ .dash-dropdown-trigger-icon {
86
+ color: var(--Dash-Text-Strong);
87
+ fill: var(--Dash-Text-Strong);
88
+ white-space: nowrap;
89
+ justify-self: end;
90
+ }
91
+
92
+ .dash-dropdown-trigger-icon {
93
+ transition: transform 0.15s;
94
+ }
95
+
96
+ [data-state='open'] .dash-dropdown-trigger-icon {
97
+ transform: rotate(180deg);
98
+ }
99
+
100
+ .dash-dropdown-value-count {
101
+ line-height: 18px;
102
+ padding: 0 2px;
103
+ background: var(--Dash-Fill-Weak);
104
+ }
105
+
106
+ .dash-dropdown-search-container {
107
+ position: sticky;
108
+ top: calc(var(--Dash-Spacing) * 2);
109
+ margin: calc(var(--Dash-Spacing) * 2);
110
+ padding: var(--Dash-Spacing);
111
+ border-radius: 4px;
112
+ border: 1px solid var(--Dash-Stroke-Strong);
113
+ background: var(--Dash-Fill-Inverse-Strong);
114
+ }
115
+
116
+ .dash-dropdown-search-container:focus-within {
117
+ border-color: var(--Dash-Fill-Interactive-Strong);
118
+ }
119
+
120
+ .dash-dropdown-search-icon,
121
+ .dash-dropdown-clear {
122
+ width: calc(var(--Dash-Spacing) * 3);
123
+ height: calc(var(--Dash-Spacing) * 3);
124
+ }
125
+
126
+ .dash-dropdown-search-container:focus-within .dash-dropdown-search-icon {
127
+ color: var(--Dash-Fill-Interactive-Strong);
128
+ }
129
+
130
+ .dash-dropdown-clear {
131
+ background: none;
132
+ border: none;
133
+ cursor: pointer;
134
+ padding: 0;
135
+ display: flex;
136
+ align-items: center;
137
+ justify-content: center;
138
+ justify-self: end;
139
+ color: var(--Dash-Text-Strong);
140
+ }
141
+
142
+ .dash-dropdown-clear:hover {
143
+ color: var(--Dash-Fill-Interactive-Strong);
144
+ }
145
+
146
+ .dash-dropdown-clear:focus {
147
+ outline: 2px solid var(--Dash-Fill-Interactive-Strong);
148
+ outline-offset: 1px;
149
+ border-radius: 2px;
150
+ }
151
+
152
+ .dash-dropdown-search {
153
+ line-height: calc(var(--Dash-Spacing) * 6);
154
+ width: 100%;
155
+ border: none;
156
+ background: transparent;
157
+ color: var(--Dash-Text-Strong);
158
+ outline: none;
159
+ padding: 0;
160
+
161
+ /* Hide the "x" clear button in search inputs */
162
+ &::-webkit-search-cancel-button {
163
+ -webkit-appearance: none;
164
+ appearance: none;
165
+ display: none;
166
+ }
167
+
168
+ &::-ms-clear {
169
+ display: none;
170
+ }
171
+ }
172
+
173
+ .dash-dropdown-actions {
174
+ display: flex;
175
+ gap: calc(var(--Dash-Spacing) * 6);
176
+ line-height: 18px;
177
+ padding: var(--Dash-Spacing) calc(var(--Dash-Spacing) * 3);
178
+ border-top: 1px solid var(--Dash-Fill-Disabled);
179
+ border-bottom: 1px solid var(--Dash-Fill-Disabled);
180
+ }
181
+
182
+ .dash-dropdown-action-button {
183
+ background: none;
184
+ border: none;
185
+ cursor: pointer;
186
+ font-size: 14px;
187
+ font-weight: 600;
188
+ padding: 0;
189
+ text-decoration: none;
190
+ color: var(--Dash-Text-Disabled);
191
+ white-space: nowrap;
192
+ accent-color: var(--Dash-Fill-Interactive-Strong);
193
+ outline-color: var(--Dash-Fill-Interactive-Strong);
194
+ }
195
+
196
+ .dash-dropdown-action-button:hover {
197
+ color: var(--Dash-Fill-Interactive-Strong);
198
+ }
199
+
200
+ .dash-dropdown-action-button:focus {
201
+ text-decoration: underline;
202
+ }
203
+
204
+ .dash-dropdown-options {
205
+ overflow-y: auto;
206
+ }
207
+
208
+ .dash-dropdown-option {
209
+ padding: calc(var(--Dash-Spacing) * 2) calc(var(--Dash-Spacing) * 3);
210
+ box-shadow: 0 -1px 0 0 var(--Dash-Fill-Disabled) inset;
211
+ }
@@ -15,6 +15,19 @@
15
15
  overflow: hidden;
16
16
  }
17
17
 
18
+ .dash-input-container:focus-within {
19
+ outline: 1px solid var(--Dash-Fill-Interactive-Strong);
20
+ }
21
+
22
+ .dash-input-container:has(.dash-input-element:disabled) {
23
+ opacity: 0.6;
24
+ cursor: not-allowed;
25
+ }
26
+
27
+ .dash-input-container input:focus {
28
+ outline: none;
29
+ }
30
+
18
31
  .dash-input-container:has(input[type='range']) {
19
32
  background: inherit;
20
33
  }
@@ -32,11 +45,17 @@
32
45
  box-sizing: border-box;
33
46
  z-index: 1;
34
47
  order: 2;
48
+ accent-color: var(--Dash-Fill-Interactive-Strong);
49
+ }
50
+
51
+ .dash-input-element:disabled {
52
+ cursor: not-allowed;
35
53
  }
36
54
 
37
55
  /* Hide native steppers for number inputs */
38
56
  .dash-input-element[type='number'] {
39
57
  -moz-appearance: textfield;
58
+ border-radius: 0;
40
59
  }
41
60
 
42
61
  .dash-input-element[type='number']::-webkit-outer-spin-button,
@@ -70,10 +89,11 @@
70
89
  cursor: pointer;
71
90
  font-size: 16px;
72
91
  font-weight: bold;
73
- color: var(--Dash-Text-Primary);
92
+ color: var(--Dash -Text-Primary);
74
93
  }
75
94
 
76
- .dash-input-stepper:hover {
95
+ .dash-input-stepper:hover,
96
+ .dash-input-stepper:focus {
77
97
  background: var(--Dash-Fill-Primary-Hover);
78
98
  }
79
99
 
@@ -115,7 +135,3 @@
115
135
  input.dash-input-element:invalid {
116
136
  outline: solid red;
117
137
  }
118
-
119
- input.dash-input-element:valid {
120
- outline: none black;
121
- }