@cloudscape-design/components-themeable 3.0.1072 → 3.0.1074
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/components/drag-handle/styles.scss +4 -0
- package/lib/internal/scss/internal/components/sortable-area/styles.scss +1 -3
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/template/alert/index.d.ts.map +1 -1
- package/lib/internal/template/alert/index.js +7 -5
- package/lib/internal/template/alert/index.js.map +1 -1
- package/lib/internal/template/alert/internal.d.ts +1 -1
- package/lib/internal/template/alert/internal.js +1 -1
- package/lib/internal/template/alert/internal.js.map +1 -1
- package/lib/internal/template/anchor-navigation/internal.d.ts.map +1 -1
- package/lib/internal/template/anchor-navigation/internal.js +1 -1
- package/lib/internal/template/anchor-navigation/internal.js.map +1 -1
- package/lib/internal/template/app-layout/index.js.map +1 -1
- package/lib/internal/template/app-layout-toolbar/index.js.map +1 -1
- package/lib/internal/template/area-chart/internal.d.ts.map +1 -1
- package/lib/internal/template/area-chart/internal.js +1 -1
- package/lib/internal/template/area-chart/internal.js.map +1 -1
- package/lib/internal/template/attribute-editor/internal.js +1 -1
- package/lib/internal/template/attribute-editor/internal.js.map +1 -1
- package/lib/internal/template/box/internal.d.ts.map +1 -1
- package/lib/internal/template/box/internal.js +1 -1
- package/lib/internal/template/box/internal.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/skeleton.d.ts +1 -1
- package/lib/internal/template/button/internal.d.ts +2 -2
- package/lib/internal/template/button/internal.d.ts.map +1 -1
- package/lib/internal/template/button/internal.js +1 -1
- package/lib/internal/template/button/internal.js.map +1 -1
- package/lib/internal/template/button-group/internal.js +1 -1
- package/lib/internal/template/button-group/internal.js.map +1 -1
- package/lib/internal/template/container/internal.d.ts.map +1 -1
- package/lib/internal/template/container/internal.js +1 -1
- package/lib/internal/template/container/internal.js.map +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.d.ts.map +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.js +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.js.map +1 -1
- package/lib/internal/template/date-input/internal.d.ts +1 -1
- package/lib/internal/template/date-input/internal.js +1 -1
- package/lib/internal/template/date-input/internal.js.map +1 -1
- package/lib/internal/template/file-dropzone/internal.d.ts.map +1 -1
- package/lib/internal/template/file-dropzone/internal.js +1 -1
- package/lib/internal/template/file-dropzone/internal.js.map +1 -1
- package/lib/internal/template/file-input/internal.d.ts +1 -1
- package/lib/internal/template/file-input/internal.d.ts.map +1 -1
- package/lib/internal/template/file-input/internal.js +1 -1
- package/lib/internal/template/file-input/internal.js.map +1 -1
- package/lib/internal/template/file-upload/internal.d.ts +1 -1
- package/lib/internal/template/file-upload/internal.js +1 -1
- package/lib/internal/template/file-upload/internal.js.map +1 -1
- package/lib/internal/template/form/index.d.ts.map +1 -1
- package/lib/internal/template/form/index.js +6 -5
- package/lib/internal/template/form/index.js.map +1 -1
- package/lib/internal/template/form-field/interfaces.d.ts +1 -1
- package/lib/internal/template/form-field/interfaces.d.ts.map +1 -1
- package/lib/internal/template/form-field/interfaces.js.map +1 -1
- package/lib/internal/template/form-field/internal.d.ts.map +1 -1
- package/lib/internal/template/form-field/internal.js +6 -4
- package/lib/internal/template/form-field/internal.js.map +1 -1
- package/lib/internal/template/grid/internal.js +1 -1
- package/lib/internal/template/grid/internal.js.map +1 -1
- package/lib/internal/template/header/internal.d.ts.map +1 -1
- package/lib/internal/template/header/internal.js +1 -1
- package/lib/internal/template/header/internal.js.map +1 -1
- package/lib/internal/template/icon/internal.js +1 -1
- package/lib/internal/template/icon/internal.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/drag-handle/button.d.ts +1 -1
- package/lib/internal/template/internal/components/drag-handle/button.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/button.js +8 -4
- package/lib/internal/template/internal/components/drag-handle/button.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.d.ts +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.js +3 -3
- package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts +3 -0
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/styles.css.js +14 -13
- package/lib/internal/template/internal/components/drag-handle/styles.scoped.css +22 -18
- package/lib/internal/template/internal/components/drag-handle/styles.selectors.js +14 -13
- package/lib/internal/template/internal/components/drag-handle-wrapper/index.d.ts +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/index.js +10 -9
- package/lib/internal/template/internal/components/drag-handle-wrapper/index.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/interfaces.d.ts +2 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/index.js +20 -5
- package/lib/internal/template/internal/components/sortable-area/index.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/index.d.ts +20 -5
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/index.js +60 -36
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/index.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/events.d.ts +3 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/events.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/events.js +2 -0
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/events.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/scroll.d.ts +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/scroll.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/scroll.js +4 -9
- package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/scroll.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/styles.css.js +8 -8
- package/lib/internal/template/internal/components/sortable-area/styles.scoped.css +15 -19
- package/lib/internal/template/internal/components/sortable-area/styles.selectors.js +8 -8
- package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.d.ts +4 -2
- package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.js +36 -40
- package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/theming/index.cjs +14 -0
- package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +63 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +63 -0
- package/lib/internal/template/internal/generated/theming/index.js +14 -0
- package/lib/internal/template/internal/hooks/use-base-component/index.d.ts +5 -5
- package/lib/internal/template/internal/hooks/use-base-component/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/index.js.map +1 -1
- package/lib/internal/template/link/internal.d.ts +1 -1
- package/lib/internal/template/link/internal.d.ts.map +1 -1
- package/lib/internal/template/link/internal.js +2 -4
- package/lib/internal/template/link/internal.js.map +1 -1
- package/lib/internal/template/list/internal.d.ts.map +1 -1
- package/lib/internal/template/list/internal.js +1 -1
- package/lib/internal/template/list/internal.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.js +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.js.map +1 -1
- package/lib/internal/template/modal/internal.js +1 -1
- package/lib/internal/template/modal/internal.js.map +1 -1
- package/lib/internal/template/multiselect/index.d.ts.map +1 -1
- package/lib/internal/template/multiselect/index.js +1 -0
- package/lib/internal/template/multiselect/index.js.map +1 -1
- package/lib/internal/template/multiselect/internal.d.ts +1 -1
- package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
- package/lib/internal/template/multiselect/internal.js +1 -1
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/pagination/internal.d.ts.map +1 -1
- package/lib/internal/template/pagination/internal.js +1 -1
- package/lib/internal/template/pagination/internal.js.map +1 -1
- package/lib/internal/template/popover/internal.js +1 -1
- package/lib/internal/template/popover/internal.js.map +1 -1
- package/lib/internal/template/prompt-input/internal.js +1 -1
- package/lib/internal/template/prompt-input/internal.js.map +1 -1
- package/lib/internal/template/property-filter/internal.d.ts +1 -1
- package/lib/internal/template/property-filter/internal.d.ts.map +1 -1
- package/lib/internal/template/radio-group/internal.d.ts +1 -1
- package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
- package/lib/internal/template/radio-group/internal.js +1 -1
- package/lib/internal/template/radio-group/internal.js.map +1 -1
- package/lib/internal/template/segmented-control/internal.d.ts.map +1 -1
- package/lib/internal/template/segmented-control/internal.js +1 -1
- package/lib/internal/template/segmented-control/internal.js.map +1 -1
- package/lib/internal/template/select/internal.js +1 -1
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/slider/internal.d.ts.map +1 -1
- package/lib/internal/template/slider/internal.js +1 -1
- package/lib/internal/template/slider/internal.js.map +1 -1
- package/lib/internal/template/space-between/internal.d.ts +1 -1
- package/lib/internal/template/space-between/internal.d.ts.map +1 -1
- package/lib/internal/template/steps/internal.d.ts +1 -1
- package/lib/internal/template/steps/internal.d.ts.map +1 -1
- package/lib/internal/template/steps/internal.js.map +1 -1
- package/lib/internal/template/text-filter/internal.d.ts +1 -1
- package/lib/internal/template/text-filter/internal.d.ts.map +1 -1
- package/lib/internal/template/tiles/internal.d.ts +1 -1
- package/lib/internal/template/tiles/internal.d.ts.map +1 -1
- package/lib/internal/template/tiles/internal.js +1 -1
- package/lib/internal/template/tiles/internal.js.map +1 -1
- package/lib/internal/template/time-input/internal.d.ts +1 -1
- package/lib/internal/template/time-input/internal.d.ts.map +1 -1
- package/lib/internal/template/time-input/internal.js +1 -1
- package/lib/internal/template/time-input/internal.js.map +1 -1
- package/lib/internal/template/toggle/internal.js +1 -1
- package/lib/internal/template/toggle/internal.js.map +1 -1
- package/lib/internal/template/wizard/wizard-form.js +5 -3
- package/lib/internal/template/wizard/wizard-form.js.map +1 -1
- package/package.json +1 -1
package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-drag-and-drop-reorder.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/sortable-area/use-drag-and-drop-reorder.ts"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAGL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"use-drag-and-drop-reorder.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/sortable-area/use-drag-and-drop-reorder.ts"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAGL,kBAAkB,EAGlB,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAwB,MAAM,mBAAmB,CAAC;AAoBzF,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,IAAI,EAAE,EAClD,KAAK,EACL,cAAc,GACf,EAAE;IACD,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,cAAc,EAAE,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;CACxD;;0BAK4B,gBAAgB,GAAG,IAAI;;;2BAQpB,mBAAmB;;;EA6GlD"}
|
package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.js
CHANGED
|
@@ -3,17 +3,8 @@
|
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
4
|
import { closestCenter, PointerSensor, useSensor, useSensors, } from '@dnd-kit/core';
|
|
5
5
|
import { hasSortableData } from '@dnd-kit/sortable';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
(function (KeyboardCode) {
|
|
9
|
-
KeyboardCode["Space"] = "Space";
|
|
10
|
-
KeyboardCode["Down"] = "ArrowDown";
|
|
11
|
-
KeyboardCode["Right"] = "ArrowRight";
|
|
12
|
-
KeyboardCode["Left"] = "ArrowLeft";
|
|
13
|
-
KeyboardCode["Up"] = "ArrowUp";
|
|
14
|
-
KeyboardCode["Esc"] = "Escape";
|
|
15
|
-
KeyboardCode["Enter"] = "Enter";
|
|
16
|
-
})(KeyboardCode || (KeyboardCode = {}));
|
|
6
|
+
import { KeyboardAndUAPSensor } from './keyboard-sensor';
|
|
7
|
+
import { EventName } from './keyboard-sensor/utilities/events';
|
|
17
8
|
// A custom collision detection algorithm is used when using a keyboard to
|
|
18
9
|
// work around an unexpected behavior when reordering items of variable height
|
|
19
10
|
// with the keyboard.
|
|
@@ -41,10 +32,10 @@ export default function useDragAndDropReorder({ items, itemDefinition, }) {
|
|
|
41
32
|
const handleKeyDown = (event) => {
|
|
42
33
|
if (isKeyboard.current && activeItemId) {
|
|
43
34
|
const currentTargetIndex = items.findIndex(item => itemDefinition.id(item) === activeItemId) + positionDelta.current;
|
|
44
|
-
if (event.key === 'ArrowDown' && currentTargetIndex < items.length - 1) {
|
|
35
|
+
if ((event.key === 'ArrowDown' || event.type === EventName.CustomDown) && currentTargetIndex < items.length - 1) {
|
|
45
36
|
positionDelta.current += 1;
|
|
46
37
|
}
|
|
47
|
-
else if (event.key === 'ArrowUp' && currentTargetIndex > 0) {
|
|
38
|
+
else if ((event.key === 'ArrowUp' || event.type === EventName.CustomUp) && currentTargetIndex > 0) {
|
|
48
39
|
positionDelta.current -= 1;
|
|
49
40
|
}
|
|
50
41
|
}
|
|
@@ -78,36 +69,40 @@ export default function useDragAndDropReorder({ items, itemDefinition, }) {
|
|
|
78
69
|
}
|
|
79
70
|
};
|
|
80
71
|
const coordinateGetter = (event, { context: { active, collisionRect, droppableRects, droppableContainers } }) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
};
|
|
106
|
-
}
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
if (!active || !collisionRect) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const closestId = getClosestId(active);
|
|
77
|
+
if (closestId !== null) {
|
|
78
|
+
const activeDroppable = droppableContainers.get(active.id);
|
|
79
|
+
const newDroppable = droppableContainers.get(closestId);
|
|
80
|
+
const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;
|
|
81
|
+
const newNode = newDroppable === null || newDroppable === void 0 ? void 0 : newDroppable.node.current;
|
|
82
|
+
if (newNode && newRect && activeDroppable && newDroppable) {
|
|
83
|
+
const isAfterActive = isAfter(activeDroppable, newDroppable);
|
|
84
|
+
const offset = {
|
|
85
|
+
x: isAfterActive ? collisionRect.width - newRect.width : 0,
|
|
86
|
+
y: isAfterActive ? collisionRect.height - newRect.height : 0,
|
|
87
|
+
};
|
|
88
|
+
const rectCoordinates = {
|
|
89
|
+
x: newRect.left,
|
|
90
|
+
y: newRect.top,
|
|
91
|
+
};
|
|
92
|
+
return {
|
|
93
|
+
x: rectCoordinates.x - offset.x,
|
|
94
|
+
y: rectCoordinates.y - offset.y,
|
|
95
|
+
};
|
|
107
96
|
}
|
|
108
97
|
}
|
|
109
98
|
};
|
|
110
|
-
const sensors = useSensors(useSensor(PointerSensor
|
|
99
|
+
const sensors = useSensors(useSensor(PointerSensor, {
|
|
100
|
+
activationConstraint: {
|
|
101
|
+
// allow KeyboardSensor (click to display UAP) to take priority
|
|
102
|
+
// if handle is clicked without movement
|
|
103
|
+
distance: 1,
|
|
104
|
+
},
|
|
105
|
+
}), useSensor(KeyboardAndUAPSensor, {
|
|
111
106
|
coordinateGetter,
|
|
112
107
|
onActivation: () => {
|
|
113
108
|
isKeyboard.current = true;
|
|
@@ -120,6 +115,7 @@ export default function useDragAndDropReorder({ items, itemDefinition, }) {
|
|
|
120
115
|
coordinateGetter,
|
|
121
116
|
handleKeyDown,
|
|
122
117
|
sensors,
|
|
118
|
+
isKeyboard,
|
|
123
119
|
};
|
|
124
120
|
}
|
|
125
121
|
function isAfter(a, b) {
|
package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-drag-and-drop-reorder.js","sourceRoot":"","sources":["../../../../../src/internal/components/sortable-area/use-drag-and-drop-reorder.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAEL,aAAa,EAIb,aAAa,EAEb,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,IAAK,YAQJ;AARD,WAAK,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AC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC;IAClF,IAAI,kBAAkB,EAAE;QACtB,OAAO;YACL,EAAE,EAAE,kBAAkB,CAAC,EAAE;YACzB,IAAI,EAAE;gBACJ,kBAAkB,EAAE,kBAAkB;gBACtC,KAAK,EAAE,CAAC;aACT;SACF,CAAC;KACH;AACH,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport {\n Active,\n closestCenter,\n CollisionDetection,\n DroppableContainer,\n KeyboardCoordinateGetter,\n PointerSensor,\n UniqueIdentifier,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport { hasSortableData } from '@dnd-kit/sortable';\n\nimport { SortableAreaProps } from './interfaces';\nimport { KeyboardSensor } from './keyboard-sensor';\n\nenum KeyboardCode {\n Space = 'Space',\n Down = 'ArrowDown',\n Right = 'ArrowRight',\n Left = 'ArrowLeft',\n Up = 'ArrowUp',\n Esc = 'Escape',\n Enter = 'Enter',\n}\n\n// A custom collision detection algorithm is used when using a keyboard to\n// work around an unexpected behavior when reordering items of variable height\n// with the keyboard.\n\n// Neither closestCenter nor closestCorners work really well for this case,\n// because the center (or corners) of a tall rectangle might be so low that it\n// is detected as being closest to the rectangle below of the one it should\n// actually swap with.\n\n// Instead of relying on coordinates, the expected results are achieved by\n// moving X positions up or down in the initially sorted array, depending on\n// the desired direction.\n\n// We let our collisionDetection and customCoordinateGetter use the same\n// getClosestId function which takes its value from the current component\n// state, to make sure they are always in sync.\n\nexport default function useDragAndDropReorder<Item>({\n items,\n itemDefinition,\n}: {\n items: readonly Item[];\n itemDefinition: SortableAreaProps.ItemDefinition<Item>;\n}) {\n const isKeyboard = useRef(false);\n const positionDelta = useRef(0);\n const [activeItemId, setActiveItemId] = useState<UniqueIdentifier | null>(null);\n\n const setActiveItem = (id: UniqueIdentifier | null) => {\n setActiveItemId(id);\n if (!id) {\n isKeyboard.current = false;\n positionDelta.current = 0;\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (isKeyboard.current && activeItemId) {\n const currentTargetIndex =\n items.findIndex(item => itemDefinition.id(item) === activeItemId) + positionDelta.current;\n if (event.key === 'ArrowDown' && currentTargetIndex < items.length - 1) {\n positionDelta.current += 1;\n } else if (event.key === 'ArrowUp' && currentTargetIndex > 0) {\n positionDelta.current -= 1;\n }\n }\n if (activeItemId && isEscape(event.key)) {\n // Prevent modal from closing when pressing Esc to cancel the dragging action\n event.stopPropagation();\n }\n };\n\n const getClosestId = (active: Active) => {\n if (positionDelta.current === 0) {\n return active.id;\n }\n const currentIndex = items.findIndex(item => itemDefinition.id(item) === active.id);\n const newIndex = Math.max(0, Math.min(items.length - 1, currentIndex + positionDelta.current));\n return itemDefinition.id(items[newIndex]);\n };\n\n const collisionDetection: CollisionDetection = ({\n active,\n collisionRect,\n droppableContainers,\n droppableRects,\n pointerCoordinates,\n }) => {\n if (isKeyboard.current) {\n // For keyboard interaction, determine the colliding container based on the movements made by the arrow keys,\n // via getClosestId\n const collidingContainer = getCollidingContainer({\n activeId: active.id,\n closestId: getClosestId(active),\n droppableContainers,\n });\n return collidingContainer ? [collidingContainer] : [];\n } else {\n // For mouse interaction, use the closest center algorithm\n return closestCenter({ active, collisionRect, droppableRects, droppableContainers, pointerCoordinates });\n }\n };\n\n const coordinateGetter: KeyboardCoordinateGetter = (\n event,\n { context: { active, collisionRect, droppableRects, droppableContainers } }\n ) => {\n if (event.code === KeyboardCode.Up || event.code === KeyboardCode.Down) {\n event.preventDefault();\n\n if (!active || !collisionRect) {\n return;\n }\n\n const closestId = getClosestId(active);\n\n if (closestId !== null) {\n const activeDroppable = droppableContainers.get(active.id);\n const newDroppable = droppableContainers.get(closestId);\n const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;\n const newNode = newDroppable?.node.current;\n\n if (newNode && newRect && activeDroppable && newDroppable) {\n const isAfterActive = isAfter(activeDroppable, newDroppable);\n const offset = {\n x: isAfterActive ? collisionRect.width - newRect.width : 0,\n y: isAfterActive ? collisionRect.height - newRect.height : 0,\n };\n const rectCoordinates = {\n x: newRect.left,\n y: newRect.top,\n };\n\n return {\n x: rectCoordinates.x - offset.x,\n y: rectCoordinates.y - offset.y,\n };\n }\n }\n }\n };\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter,\n onActivation: () => {\n isKeyboard.current = true;\n },\n })\n );\n\n return {\n activeItemId,\n setActiveItemId: setActiveItem,\n collisionDetection,\n coordinateGetter,\n handleKeyDown,\n sensors,\n };\n}\n\nfunction isAfter(a: DroppableContainer, b: DroppableContainer) {\n return hasSortableData(a) && hasSortableData(b) && a.data.current.sortable.index < b.data.current.sortable.index;\n}\n\nfunction getCollidingContainer({\n activeId,\n closestId,\n droppableContainers,\n}: {\n activeId: UniqueIdentifier;\n closestId: UniqueIdentifier;\n droppableContainers: DroppableContainer[];\n}) {\n if (closestId === activeId) {\n return;\n }\n const collidingContainer = droppableContainers.find(({ id }) => id === closestId);\n if (collidingContainer) {\n return {\n id: collidingContainer.id,\n data: {\n droppableContainer: collidingContainer,\n value: 0,\n },\n };\n }\n}\n\nconst isEscape = (key: string) => key === 'Escape' || key === 'Esc';\n"]}
|
|
1
|
+
{"version":3,"file":"use-drag-and-drop-reorder.js","sourceRoot":"","sources":["../../../../../src/internal/components/sortable-area/use-drag-and-drop-reorder.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAEL,aAAa,EAGb,aAAa,EAEb,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,E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E;QAC1B,OAAO;KACR;IACD,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC;IAClF,IAAI,kBAAkB,EAAE;QACtB,OAAO;YACL,EAAE,EAAE,kBAAkB,CAAC,EAAE;YACzB,IAAI,EAAE;gBACJ,kBAAkB,EAAE,kBAAkB;gBACtC,KAAK,EAAE,CAAC;aACT;SACF,CAAC;KACH;AACH,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport {\n Active,\n closestCenter,\n CollisionDetection,\n DroppableContainer,\n PointerSensor,\n UniqueIdentifier,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport { hasSortableData } from '@dnd-kit/sortable';\n\nimport { SortableAreaProps } from './interfaces';\nimport { KeyboardAndUAPCoordinateGetter, KeyboardAndUAPSensor } from './keyboard-sensor';\nimport { EventName } from './keyboard-sensor/utilities/events';\n\n// A custom collision detection algorithm is used when using a keyboard to\n// work around an unexpected behavior when reordering items of variable height\n// with the keyboard.\n\n// Neither closestCenter nor closestCorners work really well for this case,\n// because the center (or corners) of a tall rectangle might be so low that it\n// is detected as being closest to the rectangle below of the one it should\n// actually swap with.\n\n// Instead of relying on coordinates, the expected results are achieved by\n// moving X positions up or down in the initially sorted array, depending on\n// the desired direction.\n\n// We let our collisionDetection and customCoordinateGetter use the same\n// getClosestId function which takes its value from the current component\n// state, to make sure they are always in sync.\n\nexport default function useDragAndDropReorder<Item>({\n items,\n itemDefinition,\n}: {\n items: readonly Item[];\n itemDefinition: SortableAreaProps.ItemDefinition<Item>;\n}) {\n const isKeyboard = useRef(false);\n const positionDelta = useRef(0);\n const [activeItemId, setActiveItemId] = useState<UniqueIdentifier | null>(null);\n\n const setActiveItem = (id: UniqueIdentifier | null) => {\n setActiveItemId(id);\n if (!id) {\n isKeyboard.current = false;\n positionDelta.current = 0;\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (isKeyboard.current && activeItemId) {\n const currentTargetIndex =\n items.findIndex(item => itemDefinition.id(item) === activeItemId) + positionDelta.current;\n if ((event.key === 'ArrowDown' || event.type === EventName.CustomDown) && currentTargetIndex < items.length - 1) {\n positionDelta.current += 1;\n } else if ((event.key === 'ArrowUp' || event.type === EventName.CustomUp) && currentTargetIndex > 0) {\n positionDelta.current -= 1;\n }\n }\n if (activeItemId && isEscape(event.key)) {\n // Prevent modal from closing when pressing Esc to cancel the dragging action\n event.stopPropagation();\n }\n };\n\n const getClosestId = (active: Active) => {\n if (positionDelta.current === 0) {\n return active.id;\n }\n const currentIndex = items.findIndex(item => itemDefinition.id(item) === active.id);\n const newIndex = Math.max(0, Math.min(items.length - 1, currentIndex + positionDelta.current));\n return itemDefinition.id(items[newIndex]);\n };\n\n const collisionDetection: CollisionDetection = ({\n active,\n collisionRect,\n droppableContainers,\n droppableRects,\n pointerCoordinates,\n }) => {\n if (isKeyboard.current) {\n // For keyboard interaction, determine the colliding container based on the movements made by the arrow keys,\n // via getClosestId\n const collidingContainer = getCollidingContainer({\n activeId: active.id,\n closestId: getClosestId(active),\n droppableContainers,\n });\n return collidingContainer ? [collidingContainer] : [];\n } else {\n // For mouse interaction, use the closest center algorithm\n return closestCenter({ active, collisionRect, droppableRects, droppableContainers, pointerCoordinates });\n }\n };\n\n const coordinateGetter: KeyboardAndUAPCoordinateGetter = (\n event,\n { context: { active, collisionRect, droppableRects, droppableContainers } }\n ) => {\n event.preventDefault();\n\n if (!active || !collisionRect) {\n return;\n }\n\n const closestId = getClosestId(active);\n\n if (closestId !== null) {\n const activeDroppable = droppableContainers.get(active.id);\n const newDroppable = droppableContainers.get(closestId);\n const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;\n const newNode = newDroppable?.node.current;\n\n if (newNode && newRect && activeDroppable && newDroppable) {\n const isAfterActive = isAfter(activeDroppable, newDroppable);\n const offset = {\n x: isAfterActive ? collisionRect.width - newRect.width : 0,\n y: isAfterActive ? collisionRect.height - newRect.height : 0,\n };\n const rectCoordinates = {\n x: newRect.left,\n y: newRect.top,\n };\n\n return {\n x: rectCoordinates.x - offset.x,\n y: rectCoordinates.y - offset.y,\n };\n }\n }\n };\n\n const sensors = useSensors(\n useSensor(PointerSensor, {\n activationConstraint: {\n // allow KeyboardSensor (click to display UAP) to take priority\n // if handle is clicked without movement\n distance: 1,\n },\n }),\n useSensor(KeyboardAndUAPSensor, {\n coordinateGetter,\n onActivation: () => {\n isKeyboard.current = true;\n },\n })\n );\n\n return {\n activeItemId,\n setActiveItemId: setActiveItem,\n collisionDetection,\n coordinateGetter,\n handleKeyDown,\n sensors,\n isKeyboard,\n };\n}\n\nfunction isAfter(a: DroppableContainer, b: DroppableContainer) {\n return hasSortableData(a) && hasSortableData(b) && a.data.current.sortable.index < b.data.current.sortable.index;\n}\n\nfunction getCollidingContainer({\n activeId,\n closestId,\n droppableContainers,\n}: {\n activeId: UniqueIdentifier;\n closestId: UniqueIdentifier;\n droppableContainers: DroppableContainer[];\n}) {\n if (closestId === activeId) {\n return;\n }\n const collidingContainer = droppableContainers.find(({ id }) => id === closestId);\n if (collidingContainer) {\n return {\n id: collidingContainer.id,\n data: {\n droppableContainer: collidingContainer,\n value: 0,\n },\n };\n }\n}\n\nconst isEscape = (key: string) => key === 'Escape' || key === 'Esc';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (77f8676d)";
|
|
3
|
+
export var GIT_SHA = "77f8676d";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "console";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
@@ -10614,6 +10614,12 @@ module.exports.preset = {
|
|
|
10614
10614
|
"colorTextStatusSuccess",
|
|
10615
10615
|
"colorTextStatusWarning",
|
|
10616
10616
|
"colorTextTopNavigationTitle",
|
|
10617
|
+
"colorDropzoneBackgroundDefault",
|
|
10618
|
+
"colorDropzoneBackgroundHover",
|
|
10619
|
+
"colorDropzoneTextDefault",
|
|
10620
|
+
"colorDropzoneTextHover",
|
|
10621
|
+
"colorDropzoneBorderDefault",
|
|
10622
|
+
"colorDropzoneBorderHover",
|
|
10617
10623
|
"fontFamilyBase",
|
|
10618
10624
|
"fontFamilyMonospace",
|
|
10619
10625
|
"fontSizeBodyM",
|
|
@@ -10646,6 +10652,7 @@ module.exports.preset = {
|
|
|
10646
10652
|
"borderRadiusControlCircularFocusRing",
|
|
10647
10653
|
"borderRadiusControlDefaultFocusRing",
|
|
10648
10654
|
"borderRadiusDropdown",
|
|
10655
|
+
"borderRadiusDropzone",
|
|
10649
10656
|
"borderRadiusFlashbar",
|
|
10650
10657
|
"borderRadiusItem",
|
|
10651
10658
|
"borderRadiusInput",
|
|
@@ -10969,6 +10976,12 @@ module.exports.preset = {
|
|
|
10969
10976
|
"colorBoardPlaceholderHover",
|
|
10970
10977
|
"colorDragPlaceholderActive",
|
|
10971
10978
|
"colorDragPlaceholderHover",
|
|
10979
|
+
"colorDropzoneBackgroundDefault",
|
|
10980
|
+
"colorDropzoneBackgroundHover",
|
|
10981
|
+
"colorDropzoneTextDefault",
|
|
10982
|
+
"colorDropzoneTextHover",
|
|
10983
|
+
"colorDropzoneBorderDefault",
|
|
10984
|
+
"colorDropzoneBorderHover",
|
|
10972
10985
|
"fontFamilyBase",
|
|
10973
10986
|
"fontFamilyMonospace",
|
|
10974
10987
|
"fontSizeBodyM",
|
|
@@ -11001,6 +11014,7 @@ module.exports.preset = {
|
|
|
11001
11014
|
"borderRadiusControlCircularFocusRing",
|
|
11002
11015
|
"borderRadiusControlDefaultFocusRing",
|
|
11003
11016
|
"borderRadiusDropdown",
|
|
11017
|
+
"borderRadiusDropzone",
|
|
11004
11018
|
"borderRadiusFlashbar",
|
|
11005
11019
|
"borderRadiusItem",
|
|
11006
11020
|
"borderRadiusInput",
|
|
@@ -210,6 +210,12 @@ export declare interface TypedOverride {
|
|
|
210
210
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
211
211
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
212
212
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
213
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
214
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
215
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
216
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
217
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
218
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
213
219
|
fontFamilyBase?: GlobalValue;
|
|
214
220
|
fontFamilyMonospace?: GlobalValue;
|
|
215
221
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -242,6 +248,7 @@ export declare interface TypedOverride {
|
|
|
242
248
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
243
249
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
244
250
|
borderRadiusDropdown?: GlobalValue;
|
|
251
|
+
borderRadiusDropzone?: GlobalValue;
|
|
245
252
|
borderRadiusFlashbar?: GlobalValue;
|
|
246
253
|
borderRadiusItem?: GlobalValue;
|
|
247
254
|
borderRadiusInput?: GlobalValue;
|
|
@@ -469,6 +476,12 @@ export declare interface TypedOverride {
|
|
|
469
476
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
470
477
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
471
478
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
479
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
480
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
481
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
482
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
483
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
484
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
472
485
|
fontFamilyBase?: GlobalValue;
|
|
473
486
|
fontFamilyMonospace?: GlobalValue;
|
|
474
487
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -501,6 +514,7 @@ export declare interface TypedOverride {
|
|
|
501
514
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
502
515
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
503
516
|
borderRadiusDropdown?: GlobalValue;
|
|
517
|
+
borderRadiusDropzone?: GlobalValue;
|
|
504
518
|
borderRadiusFlashbar?: GlobalValue;
|
|
505
519
|
borderRadiusItem?: GlobalValue;
|
|
506
520
|
borderRadiusInput?: GlobalValue;
|
|
@@ -728,6 +742,12 @@ export declare interface TypedOverride {
|
|
|
728
742
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
729
743
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
730
744
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
745
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
746
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
747
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
748
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
749
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
750
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
731
751
|
fontFamilyBase?: GlobalValue;
|
|
732
752
|
fontFamilyMonospace?: GlobalValue;
|
|
733
753
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -760,6 +780,7 @@ export declare interface TypedOverride {
|
|
|
760
780
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
761
781
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
762
782
|
borderRadiusDropdown?: GlobalValue;
|
|
783
|
+
borderRadiusDropzone?: GlobalValue;
|
|
763
784
|
borderRadiusFlashbar?: GlobalValue;
|
|
764
785
|
borderRadiusItem?: GlobalValue;
|
|
765
786
|
borderRadiusInput?: GlobalValue;
|
|
@@ -987,6 +1008,12 @@ export declare interface TypedOverride {
|
|
|
987
1008
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
988
1009
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
989
1010
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1011
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1012
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1013
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1014
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1015
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1016
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
990
1017
|
fontFamilyBase?: GlobalValue;
|
|
991
1018
|
fontFamilyMonospace?: GlobalValue;
|
|
992
1019
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -1019,6 +1046,7 @@ export declare interface TypedOverride {
|
|
|
1019
1046
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
1020
1047
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
1021
1048
|
borderRadiusDropdown?: GlobalValue;
|
|
1049
|
+
borderRadiusDropzone?: GlobalValue;
|
|
1022
1050
|
borderRadiusFlashbar?: GlobalValue;
|
|
1023
1051
|
borderRadiusItem?: GlobalValue;
|
|
1024
1052
|
borderRadiusInput?: GlobalValue;
|
|
@@ -1246,6 +1274,12 @@ export declare interface TypedOverride {
|
|
|
1246
1274
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1247
1275
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1248
1276
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1277
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1278
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1279
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1280
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1281
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1282
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1249
1283
|
fontFamilyBase?: GlobalValue;
|
|
1250
1284
|
fontFamilyMonospace?: GlobalValue;
|
|
1251
1285
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -1278,6 +1312,7 @@ export declare interface TypedOverride {
|
|
|
1278
1312
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
1279
1313
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
1280
1314
|
borderRadiusDropdown?: GlobalValue;
|
|
1315
|
+
borderRadiusDropzone?: GlobalValue;
|
|
1281
1316
|
borderRadiusFlashbar?: GlobalValue;
|
|
1282
1317
|
borderRadiusItem?: GlobalValue;
|
|
1283
1318
|
borderRadiusInput?: GlobalValue;
|
|
@@ -1505,6 +1540,12 @@ export declare interface TypedOverride {
|
|
|
1505
1540
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1506
1541
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1507
1542
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1543
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1544
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1545
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1546
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1547
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1548
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1508
1549
|
fontFamilyBase?: GlobalValue;
|
|
1509
1550
|
fontFamilyMonospace?: GlobalValue;
|
|
1510
1551
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -1537,6 +1578,7 @@ export declare interface TypedOverride {
|
|
|
1537
1578
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
1538
1579
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
1539
1580
|
borderRadiusDropdown?: GlobalValue;
|
|
1581
|
+
borderRadiusDropzone?: GlobalValue;
|
|
1540
1582
|
borderRadiusFlashbar?: GlobalValue;
|
|
1541
1583
|
borderRadiusItem?: GlobalValue;
|
|
1542
1584
|
borderRadiusInput?: GlobalValue;
|
|
@@ -1764,6 +1806,12 @@ export declare interface TypedOverride {
|
|
|
1764
1806
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1765
1807
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1766
1808
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1809
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1810
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1811
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1812
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1813
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1814
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1767
1815
|
fontFamilyBase?: GlobalValue;
|
|
1768
1816
|
fontFamilyMonospace?: GlobalValue;
|
|
1769
1817
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -1796,6 +1844,7 @@ export declare interface TypedOverride {
|
|
|
1796
1844
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
1797
1845
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
1798
1846
|
borderRadiusDropdown?: GlobalValue;
|
|
1847
|
+
borderRadiusDropzone?: GlobalValue;
|
|
1799
1848
|
borderRadiusFlashbar?: GlobalValue;
|
|
1800
1849
|
borderRadiusItem?: GlobalValue;
|
|
1801
1850
|
borderRadiusInput?: GlobalValue;
|
|
@@ -2023,6 +2072,12 @@ export declare interface TypedOverride {
|
|
|
2023
2072
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2024
2073
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2025
2074
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2075
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2076
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2077
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2078
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2079
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2080
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2026
2081
|
fontFamilyBase?: GlobalValue;
|
|
2027
2082
|
fontFamilyMonospace?: GlobalValue;
|
|
2028
2083
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -2055,6 +2110,7 @@ export declare interface TypedOverride {
|
|
|
2055
2110
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
2056
2111
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
2057
2112
|
borderRadiusDropdown?: GlobalValue;
|
|
2113
|
+
borderRadiusDropzone?: GlobalValue;
|
|
2058
2114
|
borderRadiusFlashbar?: GlobalValue;
|
|
2059
2115
|
borderRadiusItem?: GlobalValue;
|
|
2060
2116
|
borderRadiusInput?: GlobalValue;
|
|
@@ -2282,6 +2338,12 @@ export declare interface TypedOverride {
|
|
|
2282
2338
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2283
2339
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2284
2340
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2341
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2342
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2343
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2344
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2345
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2346
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2285
2347
|
fontFamilyBase?: GlobalValue;
|
|
2286
2348
|
fontFamilyMonospace?: GlobalValue;
|
|
2287
2349
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -2314,6 +2376,7 @@ export declare interface TypedOverride {
|
|
|
2314
2376
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
2315
2377
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
2316
2378
|
borderRadiusDropdown?: GlobalValue;
|
|
2379
|
+
borderRadiusDropzone?: GlobalValue;
|
|
2317
2380
|
borderRadiusFlashbar?: GlobalValue;
|
|
2318
2381
|
borderRadiusItem?: GlobalValue;
|
|
2319
2382
|
borderRadiusInput?: GlobalValue;
|
|
@@ -210,6 +210,12 @@ export declare interface TypedOverride {
|
|
|
210
210
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
211
211
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
212
212
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
213
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
214
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
215
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
216
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
217
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
218
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
213
219
|
fontFamilyBase?: GlobalValue;
|
|
214
220
|
fontFamilyMonospace?: GlobalValue;
|
|
215
221
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -242,6 +248,7 @@ export declare interface TypedOverride {
|
|
|
242
248
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
243
249
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
244
250
|
borderRadiusDropdown?: GlobalValue;
|
|
251
|
+
borderRadiusDropzone?: GlobalValue;
|
|
245
252
|
borderRadiusFlashbar?: GlobalValue;
|
|
246
253
|
borderRadiusItem?: GlobalValue;
|
|
247
254
|
borderRadiusInput?: GlobalValue;
|
|
@@ -469,6 +476,12 @@ export declare interface TypedOverride {
|
|
|
469
476
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
470
477
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
471
478
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
479
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
480
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
481
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
482
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
483
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
484
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
472
485
|
fontFamilyBase?: GlobalValue;
|
|
473
486
|
fontFamilyMonospace?: GlobalValue;
|
|
474
487
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -501,6 +514,7 @@ export declare interface TypedOverride {
|
|
|
501
514
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
502
515
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
503
516
|
borderRadiusDropdown?: GlobalValue;
|
|
517
|
+
borderRadiusDropzone?: GlobalValue;
|
|
504
518
|
borderRadiusFlashbar?: GlobalValue;
|
|
505
519
|
borderRadiusItem?: GlobalValue;
|
|
506
520
|
borderRadiusInput?: GlobalValue;
|
|
@@ -728,6 +742,12 @@ export declare interface TypedOverride {
|
|
|
728
742
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
729
743
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
730
744
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
745
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
746
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
747
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
748
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
749
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
750
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
731
751
|
fontFamilyBase?: GlobalValue;
|
|
732
752
|
fontFamilyMonospace?: GlobalValue;
|
|
733
753
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -760,6 +780,7 @@ export declare interface TypedOverride {
|
|
|
760
780
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
761
781
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
762
782
|
borderRadiusDropdown?: GlobalValue;
|
|
783
|
+
borderRadiusDropzone?: GlobalValue;
|
|
763
784
|
borderRadiusFlashbar?: GlobalValue;
|
|
764
785
|
borderRadiusItem?: GlobalValue;
|
|
765
786
|
borderRadiusInput?: GlobalValue;
|
|
@@ -987,6 +1008,12 @@ export declare interface TypedOverride {
|
|
|
987
1008
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
988
1009
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
989
1010
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1011
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1012
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1013
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1014
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1015
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1016
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
990
1017
|
fontFamilyBase?: GlobalValue;
|
|
991
1018
|
fontFamilyMonospace?: GlobalValue;
|
|
992
1019
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -1019,6 +1046,7 @@ export declare interface TypedOverride {
|
|
|
1019
1046
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
1020
1047
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
1021
1048
|
borderRadiusDropdown?: GlobalValue;
|
|
1049
|
+
borderRadiusDropzone?: GlobalValue;
|
|
1022
1050
|
borderRadiusFlashbar?: GlobalValue;
|
|
1023
1051
|
borderRadiusItem?: GlobalValue;
|
|
1024
1052
|
borderRadiusInput?: GlobalValue;
|
|
@@ -1246,6 +1274,12 @@ export declare interface TypedOverride {
|
|
|
1246
1274
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1247
1275
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1248
1276
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1277
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1278
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1279
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1280
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1281
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1282
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1249
1283
|
fontFamilyBase?: GlobalValue;
|
|
1250
1284
|
fontFamilyMonospace?: GlobalValue;
|
|
1251
1285
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -1278,6 +1312,7 @@ export declare interface TypedOverride {
|
|
|
1278
1312
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
1279
1313
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
1280
1314
|
borderRadiusDropdown?: GlobalValue;
|
|
1315
|
+
borderRadiusDropzone?: GlobalValue;
|
|
1281
1316
|
borderRadiusFlashbar?: GlobalValue;
|
|
1282
1317
|
borderRadiusItem?: GlobalValue;
|
|
1283
1318
|
borderRadiusInput?: GlobalValue;
|
|
@@ -1505,6 +1540,12 @@ export declare interface TypedOverride {
|
|
|
1505
1540
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1506
1541
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1507
1542
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1543
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1544
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1545
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1546
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1547
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1548
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1508
1549
|
fontFamilyBase?: GlobalValue;
|
|
1509
1550
|
fontFamilyMonospace?: GlobalValue;
|
|
1510
1551
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -1537,6 +1578,7 @@ export declare interface TypedOverride {
|
|
|
1537
1578
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
1538
1579
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
1539
1580
|
borderRadiusDropdown?: GlobalValue;
|
|
1581
|
+
borderRadiusDropzone?: GlobalValue;
|
|
1540
1582
|
borderRadiusFlashbar?: GlobalValue;
|
|
1541
1583
|
borderRadiusItem?: GlobalValue;
|
|
1542
1584
|
borderRadiusInput?: GlobalValue;
|
|
@@ -1764,6 +1806,12 @@ export declare interface TypedOverride {
|
|
|
1764
1806
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1765
1807
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1766
1808
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1809
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1810
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1811
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1812
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1813
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1814
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1767
1815
|
fontFamilyBase?: GlobalValue;
|
|
1768
1816
|
fontFamilyMonospace?: GlobalValue;
|
|
1769
1817
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -1796,6 +1844,7 @@ export declare interface TypedOverride {
|
|
|
1796
1844
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
1797
1845
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
1798
1846
|
borderRadiusDropdown?: GlobalValue;
|
|
1847
|
+
borderRadiusDropzone?: GlobalValue;
|
|
1799
1848
|
borderRadiusFlashbar?: GlobalValue;
|
|
1800
1849
|
borderRadiusItem?: GlobalValue;
|
|
1801
1850
|
borderRadiusInput?: GlobalValue;
|
|
@@ -2023,6 +2072,12 @@ export declare interface TypedOverride {
|
|
|
2023
2072
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2024
2073
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2025
2074
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2075
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2076
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2077
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2078
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2079
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2080
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2026
2081
|
fontFamilyBase?: GlobalValue;
|
|
2027
2082
|
fontFamilyMonospace?: GlobalValue;
|
|
2028
2083
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -2055,6 +2110,7 @@ export declare interface TypedOverride {
|
|
|
2055
2110
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
2056
2111
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
2057
2112
|
borderRadiusDropdown?: GlobalValue;
|
|
2113
|
+
borderRadiusDropzone?: GlobalValue;
|
|
2058
2114
|
borderRadiusFlashbar?: GlobalValue;
|
|
2059
2115
|
borderRadiusItem?: GlobalValue;
|
|
2060
2116
|
borderRadiusInput?: GlobalValue;
|
|
@@ -2282,6 +2338,12 @@ export declare interface TypedOverride {
|
|
|
2282
2338
|
colorTextStatusSuccess?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2283
2339
|
colorTextStatusWarning?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2284
2340
|
colorTextTopNavigationTitle?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2341
|
+
colorDropzoneBackgroundDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2342
|
+
colorDropzoneBackgroundHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2343
|
+
colorDropzoneTextDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2344
|
+
colorDropzoneTextHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2345
|
+
colorDropzoneBorderDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2346
|
+
colorDropzoneBorderHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2285
2347
|
fontFamilyBase?: GlobalValue;
|
|
2286
2348
|
fontFamilyMonospace?: GlobalValue;
|
|
2287
2349
|
fontSizeBodyM?: GlobalValue;
|
|
@@ -2314,6 +2376,7 @@ export declare interface TypedOverride {
|
|
|
2314
2376
|
borderRadiusControlCircularFocusRing?: GlobalValue;
|
|
2315
2377
|
borderRadiusControlDefaultFocusRing?: GlobalValue;
|
|
2316
2378
|
borderRadiusDropdown?: GlobalValue;
|
|
2379
|
+
borderRadiusDropzone?: GlobalValue;
|
|
2317
2380
|
borderRadiusFlashbar?: GlobalValue;
|
|
2318
2381
|
borderRadiusItem?: GlobalValue;
|
|
2319
2382
|
borderRadiusInput?: GlobalValue;
|