+
{children}
diff --git a/src/components/Application/_dropzone.scss b/src/components/Application/_dropzone.scss
new file mode 100644
index 000000000..5c51670f2
--- /dev/null
+++ b/src/components/Application/_dropzone.scss
@@ -0,0 +1,36 @@
+[data-dropzone-for] {
+ transition: box-shadow 500ms;
+}
+
+body[data-monitor-dropzone] {
+ & > * {
+ pointer-events: none;
+ }
+ .#{$eccgui}-application__container,
+ .#{$eccgui}-dialog__portal {
+ *:not([data-dropzone-for], .uppy-DragDrop--isDragDropSupported) {
+ pointer-events: none;
+ }
+ }
+}
+
+body[data-monitor-dropzone~="application/reactflow"] [data-dropzone-for~="application/reactflow"],
+body[data-monitor-dropzone~="Files"] [data-dropzone-for~="Files"],
+body[data-monitor-dropzone~="Files"] .uppy-DragDrop--isDragDropSupported {
+ pointer-events: all !important;
+ box-shadow: 0 0 $eccgui-size-inline-whitespace $eccgui-color-accent inset;
+
+ & > * {
+ pointer-events: all;
+ opacity: $eccgui-opacity-regular;
+ }
+}
+
+body[data-monitor-dropzone]:has(.#{$eccgui}-dialog__portal > .#{$ns}-overlay-open) {
+ & > *:not(.#{$eccgui}-dialog__portal) {
+ &,
+ & * {
+ pointer-events: none !important;
+ }
+ }
+}
diff --git a/src/components/Application/application.scss b/src/components/Application/application.scss
index 257d2f55e..e98c18f85 100644
--- a/src/components/Application/application.scss
+++ b/src/components/Application/application.scss
@@ -8,3 +8,4 @@
// @import '~@carbon/styles/scss/components/ui-shell/navigation-menu';
@import "content";
+@import "dropzone";
diff --git a/src/components/Application/helper.ts b/src/components/Application/helper.ts
index 64222f8a0..d449c9de6 100644
--- a/src/components/Application/helper.ts
+++ b/src/components/Application/helper.ts
@@ -19,3 +19,42 @@ export const useApplicationHeaderOverModals = (elevate: boolean, className: stri
}
}, [elevate, className]);
};
+
+/**
+ * Tracks drag operations over the application.
+ * Sets different data attributes to the body element.
+ * They can be used to apply styling rules.
+ */
+export const useDropzoneMonitor = (enabledTypes: string[]) => {
+ React.useEffect(() => {
+ const monitor = window.document.body;
+
+ const addMonitor = (event: DragEvent) => {
+ const types = event.dataTransfer?.types || [];
+ const monitorTypes = [...new Set(types.filter((type) => enabledTypes.includes(type)))];
+ if (monitorTypes.length > 0 && !monitor.dataset.monitorDropzone) {
+ monitor.dataset.monitorDropzone = monitorTypes.join(" ");
+ }
+ event.preventDefault();
+ };
+
+ const removeMonitor = (event: DragEvent) => {
+ if (event.type === "drop" || monitor === event.target) {
+ delete monitor.dataset.monitorDropzone;
+ event.preventDefault();
+ }
+ };
+
+ if (monitor) {
+ monitor.addEventListener("dragover", addMonitor);
+ monitor.addEventListener("dragleave", removeMonitor);
+ monitor.addEventListener("drop", removeMonitor);
+ return () => {
+ monitor.removeEventListener("dragover", addMonitor);
+ monitor.removeEventListener("dragleave", removeMonitor);
+ monitor.removeEventListener("drop", removeMonitor);
+ };
+ }
+ return;
+ }, []);
+};
diff --git a/src/components/TextField/TextArea.tsx b/src/components/TextField/TextArea.tsx
index f8514a3df..01ae7103b 100644
--- a/src/components/TextField/TextArea.tsx
+++ b/src/components/TextField/TextArea.tsx
@@ -116,7 +116,7 @@ export const TextArea = ({
);
leftIconElement.addEventListener("click", (_event: MouseEvent) => {
textAreaElement.focus();
- }); //onclick((_event: MouseEvent) => {textAreaElement.dispatchEvent("click")})
+ });
}
if (rightElement && wrapperElement) {
diff --git a/src/components/TextField/stories/TextArea.stories.tsx b/src/components/TextField/stories/TextArea.stories.tsx
index 708d0799e..24bfd90ad 100644
--- a/src/components/TextField/stories/TextArea.stories.tsx
+++ b/src/components/TextField/stories/TextArea.stories.tsx
@@ -25,7 +25,12 @@ export default {
),
"2 Icon buttons": (
<>
-
alert("1 clicked")} text="Button 1" />
+ alert("1 clicked")}
+ text="Button 1"
+ affirmative
+ />
alert("2 clicked")} text="Button 2" />
>
),
diff --git a/src/components/TextField/textfield.scss b/src/components/TextField/textfield.scss
index e25e3d25f..bd73d22f8 100644
--- a/src/components/TextField/textfield.scss
+++ b/src/components/TextField/textfield.scss
@@ -184,6 +184,28 @@ $eccgui-map-intent-bgcolors: (
position: absolute;
top: 0;
right: 0;
+ filter: grayscale(1);
+
+ &:hover,
+ .#{$eccgui}-textarea:focus ~ & {
+ filter: none;
+ }
+
+ & > .#{$eccgui}-button--icon {
+ margin-top: -1 * $eccgui-size-textfield-padding-horizontal-regular;
+
+ &:last-of-type {
+ margin-right: -1 * $eccgui-size-textfield-padding-horizontal-regular;
+ }
+ }
+
+ .#{$ns}-input.#{$ns}-small ~ & > .#{$eccgui}-button--icon {
+ margin-top: -1 * $eccgui-size-textfield-padding-horizontal-small;
+
+ &:last-of-type {
+ margin-right: -1 * $eccgui-size-textfield-padding-horizontal-small;
+ }
+ }
}
.#{$eccgui}-textfield--justifyclearance {
diff --git a/src/configuration/_variables.scss b/src/configuration/_variables.scss
index cd75ccacb..61d41ecdf 100644
--- a/src/configuration/_variables.scss
+++ b/src/configuration/_variables.scss
@@ -72,6 +72,7 @@ $eccgui-opacity-regular: 1 !default;
$eccgui-opacity-narrow: 0.8 !default;
$eccgui-opacity-muted: 0.61 !default;
$eccgui-opacity-disabled: 0.39 !default;
+$eccgui-opacity-ghostly: 0.2 !default;
$eccgui-opacity-invisible: 0 !default;
// -- Configuration stack of z-indexes -----------------------------------------
diff --git a/src/extensions/_index.scss b/src/extensions/_index.scss
index be5ab90d6..8f23e9afd 100644
--- a/src/extensions/_index.scss
+++ b/src/extensions/_index.scss
@@ -5,3 +5,5 @@ CodeMirror styles are already included by the base component styles
because it is used as lib for elements there already.
@import "./codemirror/codemirror";
*/
+
+@import "./uppy/fileupload";
diff --git a/src/extensions/uppy/_fileupload.scss b/src/extensions/uppy/_fileupload.scss
new file mode 100644
index 000000000..b5b01e7b1
--- /dev/null
+++ b/src/extensions/uppy/_fileupload.scss
@@ -0,0 +1,47 @@
+/**
+ * TODO: we need to create a own FileUpload component based on Uppy to justify its usage.
+ */
+
+$eccgui-size-fileupload-border-width: $button-border-width;
+$eccgui-size-fileupload-border-radius: $button-border-radius;
+$eccgui-color-fileupload-border: rgba($black, $pt-drop-shadow-opacity);
+$eccgui-color-fileupload-background: $eccgui-color-accordion-background-elevated;
+$eccgui-color-fileupload-text: inherit;
+
+.uppy-DragDrop-container {
+ background-color: $eccgui-color-fileupload-background;
+ border: solid $eccgui-size-fileupload-border-width $eccgui-color-fileupload-border;
+ border-radius: $eccgui-size-fileupload-border-radius;
+ transition: box-shadow 500ms;
+
+ * {
+ color: $eccgui-color-fileupload-text;
+ }
+
+ .uppy-DragDrop-inner {
+ padding: $eccgui-size-block-whitespace;
+ line-height: inherit;
+ }
+
+ .uppy-DragDrop-arrow {
+ width: 20px; // normal icon size
+ height: 20px;
+ margin-bottom: $eccgui-size-inline-whitespace;
+ }
+
+ .uppy-DragDrop-label {
+ margin-bottom: $eccgui-size-inline-whitespace;
+ font-size: inherit;
+ }
+}
+
+.uppy-DragDrop--isDraggingOver.uppy-DragDrop--isDragDropSupported {
+ background-color: rgba($eccgui-color-accent, $eccgui-opacity-ghostly);
+ box-shadow: 0 0 $eccgui-size-block-whitespace $eccgui-color-accent inset;
+
+ & > * {
+ color: $eccgui-color-accent-contrast;
+ opacity: $eccgui-opacity-narrow;
+ fill: currentcolor;
+ }
+}
diff --git a/src/index.scss b/src/index.scss
index 8838390e4..50b055559 100644
--- a/src/index.scss
+++ b/src/index.scss
@@ -22,6 +22,9 @@
// load blueprintjs components
@import "./includes/blueprintjs/components";
+// set more readable variable for prefix
+$prefix-blueprintjs: $ns;
+
// -- Carbon Elements ----------------------------------------------------------
/*
@@ -41,11 +44,17 @@
// load carbon components
@import "./includes/carbon-components/components";
+// set more readable variable for prefix
+$prefix-carbon: $prefix;
+
// == Load basic components styles =============================================
@import "./components";
@import "./extensions/codemirror/codemirror";
+// set more readable variable for prefix
+$prefix-eccgui: $eccgui;
+
// == load tweaks ==============================================================
@import "./shame";
diff --git a/yarn.lock b/yarn.lock
index de0e8d7d9..e7de842ba 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4633,13 +4633,13 @@ bl@^4.0.3, bl@^4.1.0:
inherits "^2.0.4"
readable-stream "^3.4.0"
-body-parser@1.20.1:
- version "1.20.1"
- resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668"
- integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==
+body-parser@1.20.2:
+ version "1.20.2"
+ resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd"
+ integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==
dependencies:
bytes "3.1.2"
- content-type "~1.0.4"
+ content-type "~1.0.5"
debug "2.6.9"
depd "2.0.0"
destroy "1.2.0"
@@ -4647,7 +4647,7 @@ body-parser@1.20.1:
iconv-lite "0.4.24"
on-finished "2.4.1"
qs "6.11.0"
- raw-body "2.5.1"
+ raw-body "2.5.2"
type-is "~1.6.18"
unpipe "1.0.0"
@@ -5275,7 +5275,7 @@ content-disposition@0.5.4:
dependencies:
safe-buffer "5.2.1"
-content-type@~1.0.4:
+content-type@~1.0.4, content-type@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918"
integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==
@@ -5295,10 +5295,10 @@ cookie-signature@1.0.6:
resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==
-cookie@0.5.0:
- version "0.5.0"
- resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b"
- integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==
+cookie@0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051"
+ integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==
copy-to-clipboard@^3.3.1:
version "3.3.1"
@@ -5884,10 +5884,10 @@ ee-first@1.1.1:
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
-ejs@^3.1.8:
- version "3.1.9"
- resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.9.tgz#03c9e8777fe12686a9effcef22303ca3d8eeb361"
- integrity sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==
+ejs@^3.1.10, ejs@^3.1.8:
+ version "3.1.10"
+ resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b"
+ integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==
dependencies:
jake "^10.8.5"
@@ -6442,17 +6442,17 @@ expect@^29.0.0, expect@^29.7.0:
jest-message-util "^29.7.0"
jest-util "^29.7.0"
-express@^4.17.3:
- version "4.18.2"
- resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59"
- integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==
+express@^4.17.3, express@^4.19.2:
+ version "4.19.2"
+ resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465"
+ integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==
dependencies:
accepts "~1.3.8"
array-flatten "1.1.1"
- body-parser "1.20.1"
+ body-parser "1.20.2"
content-disposition "0.5.4"
content-type "~1.0.4"
- cookie "0.5.0"
+ cookie "0.6.0"
cookie-signature "1.0.6"
debug "2.6.9"
depd "2.0.0"
@@ -10533,10 +10533,10 @@ range-parser@^1.2.1, range-parser@~1.2.1:
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
-raw-body@2.5.1:
- version "2.5.1"
- resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857"
- integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==
+raw-body@2.5.2:
+ version "2.5.2"
+ resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a"
+ integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==
dependencies:
bytes "3.1.2"
http-errors "2.0.0"
@@ -12010,10 +12010,10 @@ tar-stream@^2.1.4:
inherits "^2.0.3"
readable-stream "^3.1.1"
-tar@^6.2.0:
- version "6.2.0"
- resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.0.tgz#b14ce49a79cb1cd23bc9b016302dea5474493f73"
- integrity sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==
+tar@^6.2.0, tar@^6.2.1:
+ version "6.2.1"
+ resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
+ integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==
dependencies:
chownr "^2.0.0"
fs-minipass "^2.0.0"