From 246a4b3b5ecf72d3cdd67ee8db36333b6aa42bc8 Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Fri, 3 Sep 2021 16:59:05 +0300 Subject: [PATCH] Add Card component. Fix Popup. (#135) Signed-off-by: Alexander Platov --- packages/theme/styles/_colors.scss | 3 + packages/ui/src/components/Card.svelte | 83 +++++++++++++++++ packages/ui/src/components/Dialog.svelte | 93 +++++++++---------- .../ui/src/components/PopupInstance.svelte | 7 +- packages/ui/src/index.ts | 1 + packages/ui/src/types.ts | 2 +- .../src/components/CreateApplication.svelte | 27 +++--- .../src/components/TableView.svelte | 2 +- .../src/components/navigator/SpacesNav.svelte | 2 +- 9 files changed, 151 insertions(+), 69 deletions(-) create mode 100644 packages/ui/src/components/Card.svelte diff --git a/packages/theme/styles/_colors.scss b/packages/theme/styles/_colors.scss index d4ae85c3f0..e81693424a 100644 --- a/packages/theme/styles/_colors.scss +++ b/packages/theme/styles/_colors.scss @@ -65,6 +65,7 @@ --theme-menu-divider: rgba(255, 255, 255, .05); --theme-scroll-bar: #2C2C34; --theme-bg-modal: #2C2B35; + --theme-card-bg: rgba(222, 222, 240, .2); --theme-border-modal: rgba(0, 0, 0, 0.2); --theme-chat-selection: radial-gradient(135.96% 3333.35% at -2.36% -27.63%, rgba(210, 183, 156, 0.11) 0%, rgba(204, 196, 184, 0.0785128) 20.8%, rgba(104, 104, 114, 0.11) 100%); --theme-chat-divider: rgb(36, 36, 41); @@ -120,6 +121,7 @@ --theme-menu-divider: rgba(255, 255, 255, .05); --theme-scroll-bar: #494852; --theme-bg-modal: #2C2B35; + --theme-card-bg: rgba(222, 222, 240, .2); --theme-border-modal: rgba(0, 0, 0, 0.2); --theme-chat-selection: radial-gradient(135.96% 3333.35% at -2.36% -27.63%, rgba(210, 183, 156, 0.11) 0%, rgba(204, 196, 184, 0.0785128) 20.8%, rgba(104, 104, 114, 0.11) 100%); --theme-chat-divider: rgb(66, 65, 76); @@ -174,6 +176,7 @@ --theme-menu-divider: rgba(0, 0, 0, .08); --theme-scroll-bar: #CBCBCB; --theme-bg-modal: #fff; + --theme-card-bg: rgba(255, 255, 255, .4); --theme-border-modal: rgba(0, 0, 0, 0.2); --theme-chat-selection: radial-gradient(135.96% 3333.35% at -2.36% -27.63%, rgba(210, 183, 156, 0.11) 0%, rgba(204, 196, 184, 0.0785128) 20.8%, rgba(104, 104, 114, 0.11) 100%); --theme-chat-divider: rgb(233, 233, 233); diff --git a/packages/ui/src/components/Card.svelte b/packages/ui/src/components/Card.svelte new file mode 100644 index 0000000000..06086339e6 --- /dev/null +++ b/packages/ui/src/components/Card.svelte @@ -0,0 +1,83 @@ + + + + +
{ okAction(); dispatch('close') }}> +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/packages/ui/src/components/Dialog.svelte b/packages/ui/src/components/Dialog.svelte index 75bf18d697..598df70096 100644 --- a/packages/ui/src/components/Dialog.svelte +++ b/packages/ui/src/components/Dialog.svelte @@ -48,66 +48,57 @@
\ No newline at end of file diff --git a/packages/ui/src/components/PopupInstance.svelte b/packages/ui/src/components/PopupInstance.svelte index 1a6bac3825..758734184f 100644 --- a/packages/ui/src/components/PopupInstance.svelte +++ b/packages/ui/src/components/PopupInstance.svelte @@ -50,6 +50,10 @@ $: { modalHTML.style.left = rect.left + 'px' } } else if (element === 'right') { + modalHTML.style.top = '0' + modalHTML.style.bottom = '0' + modalHTML.style.right = '0' + } else if (element === 'float') { modalHTML.style.top = '4rem' modalHTML.style.bottom = '4rem' modalHTML.style.right = '4rem' @@ -76,6 +80,7 @@ $: { .popup { position: fixed; background-color: transparent; + backdrop-filter: blur(.5rem); filter: drop-shadow(0 1.5rem 4rem rgba(0, 0, 0, .6)); } .modal-overlay { @@ -84,6 +89,6 @@ $: { left: 0; width: 100%; height: 100%; - background: rgba(0, 0, 0, 0.25); + // background: rgba(0, 0, 0, 0.25); } diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 31029db1d7..b9c68ac4f3 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -52,6 +52,7 @@ export { default as Loading } from './components/Loading.svelte' export { default as Popup } from './components/Popup.svelte' export { default as CircleButton } from './components/CircleButton.svelte' export { default as Link } from './components/Link.svelte' +export { default as Card } from './components/Card.svelte' export { default as IconAdd } from './components/icons/Add.svelte' export { default as IconClose } from './components/icons/Close.svelte' diff --git a/packages/ui/src/types.ts b/packages/ui/src/types.ts index 20dd740b20..54dadfc116 100644 --- a/packages/ui/src/types.ts +++ b/packages/ui/src/types.ts @@ -54,4 +54,4 @@ export interface Tab { export type TabModel = Tab[] -export type PopupAlignment = HTMLElement | 'right' +export type PopupAlignment = HTMLElement | 'right' | 'float' diff --git a/plugins/recruit-resources/src/components/CreateApplication.svelte b/plugins/recruit-resources/src/components/CreateApplication.svelte index bedbd22472..8adc1af02a 100644 --- a/plugins/recruit-resources/src/components/CreateApplication.svelte +++ b/plugins/recruit-resources/src/components/CreateApplication.svelte @@ -16,8 +16,8 @@ - - -