From 7c4028f8f13c6c1a388403f940df036a0a137ccb Mon Sep 17 00:00:00 2001 From: DaneEveritt Date: Sat, 2 Jul 2022 17:24:12 -0400 Subject: [PATCH] Update dialog logic to support defining buttons/icon from anywhere --- .../activity/ActivityLogMetaButton.tsx | 4 +- .../elements/dialog/ConfirmationDialog.tsx | 8 +- .../components/elements/dialog/Dialog.tsx | 144 ++++++++---------- .../elements/dialog/DialogFooter.tsx | 17 +++ .../components/elements/dialog/DialogIcon.tsx | 39 ++--- .../components/elements/dialog/context.ts | 13 ++ .../elements/dialog/style.module.css | 36 +++++ .../server/files/NewDirectoryButton.tsx | 4 +- yarn.lock | 38 ++--- 9 files changed, 182 insertions(+), 121 deletions(-) create mode 100644 resources/scripts/components/elements/dialog/DialogFooter.tsx create mode 100644 resources/scripts/components/elements/dialog/context.ts create mode 100644 resources/scripts/components/elements/dialog/style.module.css diff --git a/resources/scripts/components/elements/activity/ActivityLogMetaButton.tsx b/resources/scripts/components/elements/activity/ActivityLogMetaButton.tsx index 405a7bac5..a1f99c9fe 100644 --- a/resources/scripts/components/elements/activity/ActivityLogMetaButton.tsx +++ b/resources/scripts/components/elements/activity/ActivityLogMetaButton.tsx @@ -12,9 +12,9 @@ export default ({ meta }: { meta: Record }) => {
                     {JSON.stringify(meta, null, 2)}
                 
- + setOpen(false)}>Close - + - + )} diff --git a/yarn.lock b/yarn.lock index 2d361d4b5..1be2e610b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1093,33 +1093,33 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@floating-ui/core@^0.7.2": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-0.7.2.tgz#f7af9613d080dc29360e77c970965b79b524d45a" - integrity sha512-FRVAkSNU/vGXLIsgbggcs70GkXKEOXgBBbNpYPNHSaKsCAMMd00NrjbtKTesxkdv9xm9N3+XiDlcFGY6WnatBg== +"@floating-ui/core@^0.7.3": + version "0.7.3" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-0.7.3.tgz#d274116678ffae87f6b60e90f88cc4083eefab86" + integrity sha512-buc8BXHmG9l82+OQXOFU3Kr2XQx9ys01U/Q9HMIrZ300iLc8HLMgh7dcCqgYzAzf4BkoQvDcXf5Y+CuEZ5JBYg== -"@floating-ui/dom@^0.5.1": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-0.5.2.tgz#908f3febbfc0d6696d70921616ec194fe07af183" - integrity sha512-z1DnEa7F3d8Fm/eXSbii8UEGpcjZGkQaYYUI0WpEVgD3vBfebDW8j/3ysusxonuMexoigA+A3b/fYH7sEqiwyg== +"@floating-ui/dom@^0.5.3": + version "0.5.4" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-0.5.4.tgz#4eae73f78bcd4bd553ae2ade30e6f1f9c73fe3f1" + integrity sha512-419BMceRLq0RrmTSDxn8hf9R3VCJv2K9PUfugh5JyEFmdjzDo+e8U5EdR8nzKq8Yj1htzLm3b6eQEEam3/rrtg== dependencies: - "@floating-ui/core" "^0.7.2" + "@floating-ui/core" "^0.7.3" -"@floating-ui/react-dom-interactions@^0.6.3": - version "0.6.3" - resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.6.3.tgz#895c52cb06bf5ea73c00f1074c75b0535e0046bc" - integrity sha512-xvbGEtBtA7JaEngnHQjROArv2onRp3oJIpb4+bEN5EGJf0hBYDY0vD8vFGPz/5TQwN++hb6icOB1QwdOnffMzw== +"@floating-ui/react-dom-interactions@^0.6.6": + version "0.6.6" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.6.6.tgz#8542e8c4bcbee2cd0d512de676c6a493e0a2d168" + integrity sha512-qnao6UPjSZNHnXrF+u4/n92qVroQkx0Umlhy3Avk1oIebm/5ee6yvDm4xbHob0OjY7ya8WmUnV3rQlPwX3Atwg== dependencies: - "@floating-ui/react-dom" "^0.7.1" + "@floating-ui/react-dom" "^0.7.2" aria-hidden "^1.1.3" use-isomorphic-layout-effect "^1.1.1" -"@floating-ui/react-dom@^0.7.1": - version "0.7.1" - resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-0.7.1.tgz#e0eb57cb05c7762d4c904bfbae73148684578d66" - integrity sha512-Dd7e8AupUjzcjeGf1g3EItf/QRtEWKF5GGyEs5WA5n3zlHvEgZ4XrZM6ANhUnzgE3pUQAaXkcXLnibgFp1YBRw== +"@floating-ui/react-dom@^0.7.2": + version "0.7.2" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-0.7.2.tgz#0bf4ceccb777a140fc535c87eb5d6241c8e89864" + integrity sha512-1T0sJcpHgX/u4I1OzIEhlcrvkUN8ln39nz7fMoE/2HDHrPiMFoOGR7++GYyfUmIQHkkrTinaeQsO3XWubjSvGg== dependencies: - "@floating-ui/dom" "^0.5.1" + "@floating-ui/dom" "^0.5.3" use-isomorphic-layout-effect "^1.1.1" "@fortawesome/fontawesome-common-types@^0.2.32":