From 2d4499b0fd713f3a67bc66a392de489aa45e57c5 Mon Sep 17 00:00:00 2001 From: Bryant Gillespie Date: Thu, 20 Jul 2023 16:27:25 -0400 Subject: [PATCH] Page Builder > Base Components (#22) * Merge branch 'types/schema-1.0' into nuxt/pageblocks * update fields and types * delete sample block * page and block base components * catch all route * Add types to Directus SDK * base css * file url utility composable * badge * buttons * card * divider * frame * heading * icon * text * video * default layout * fix separator * note * Use scoped styles * Fix global on app.vue usage * Remove unused styles * Cleanup * fix field syntax for new sdk * fix catch all page route * fix plugin config * drop reset.css for now until needed * app styling fix * Standardized folder capitalization * Remove app globals * Remove outdated files * Add size comments * Tweak base badge * Add global styles * Add missing text / line height sizes * Use font sizing vars * Temp remove invalid styling from buttongroup * Use variables in button component * Use vars in global css * Fix base styles of badge * Remove comment * Use nuxt link, fix nested styles * Update components * Remove button group Needs to be rearchitected * Remove unused import * Remove props usage in template * use computed for iframesource --------- Co-authored-by: rijkvanzanten --- assets/css/global.css | 39 +++++ assets/css/main.css | 1 + assets/css/vars.css | 111 ++++++++---- components/Base/Badge.vue | 143 +++++++++++++++ components/Base/Button.vue | 341 ++++++++++++++++++++++++++++++++++++ components/Base/Card.vue | 123 +++++++++++++ components/Base/Frame.vue | 58 ++++++ components/Base/Heading.vue | 58 ++++-- components/Base/Icon.vue | 6 +- components/Base/Text.vue | 23 +++ components/Base/Video.vue | 57 ++++++ 11 files changed, 907 insertions(+), 53 deletions(-) create mode 100644 assets/css/global.css create mode 100644 components/Base/Badge.vue create mode 100644 components/Base/Button.vue create mode 100644 components/Base/Card.vue create mode 100644 components/Base/Frame.vue create mode 100644 components/Base/Text.vue create mode 100644 components/Base/Video.vue diff --git a/assets/css/global.css b/assets/css/global.css new file mode 100644 index 00000000..7286eceb --- /dev/null +++ b/assets/css/global.css @@ -0,0 +1,39 @@ +*, +*::before, +*::after { + box-sizing: border-box; +} + +body { + margin: 0; + font-family: var(--family-body); + font-size: var(--font-size-base); + line-height: var(--line-height-base); + -webkit-font-smoothing: antialiased; +} + +img, +picture, +video, +canvas, +svg { + display: block; + max-width: 100%; +} + +input, +button, +textarea, +select { + font: inherit; +} + +p, +h1, +h2, +h3, +h4, +h5, +h6 { + overflow-wrap: break-word; +} diff --git a/assets/css/main.css b/assets/css/main.css index c4bbcd44..bfb50aef 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1,2 +1,3 @@ @import url('https://fonts.googleapis.com/css2?family=Fira+Code&family=Inter:wght@300;500;700&family=Poppins:wght@400;600;700&family=Material+Symbols+Outlined:opsz,wght@20..48,100..700&display=swap'); @import url('vars.css'); +@import url('global.css'); diff --git a/assets/css/vars.css b/assets/css/vars.css index 835ea609..c9c5ea86 100644 --- a/assets/css/vars.css +++ b/assets/css/vars.css @@ -9,7 +9,7 @@ --white: #ffffff; --black: #000000; - --bg-opacity: 1; + --bg-opacity: 100%; --primary: var(--purple-400); --secondary: var(--pink-200); @@ -19,7 +19,7 @@ --gray-50: #f9fafb; --gray-100: #f4f5f7; - --gray-200: #e5e7eb; /* rgba(229, 231, 235, 1) */ + --gray-200: #e5e7eb; --gray-300: #d2d6dc; --gray-400: #9fa6b2; --gray-500: #6b7280; @@ -83,39 +83,67 @@ --red-800: #a32f4a; --red-900: #802442; + /* Text sizes */ + --font-size-xs: 0.75rem; /* 12px */ + --font-size-sm: 0.875rem; /* 14px */ + --font-size-base: 1rem; /* 16px */ + --font-size-lg: 1.125rem; /* 18px */ + --font-size-xl: 1.25rem; /* 20px */ + --font-size-2xl: 1.5rem; /* 24px */ + --font-size-3xl: 1.875rem; /* 30px */ + --font-size-4xl: 2.25rem; /* 36px */ + --font-size-5xl: 3rem; /* 48px */ + --font-size-6xl: 3.75rem; /* 60px */ + --font-size-7xl: 4.5rem; /* 72px */ + --font-size-8xl: 6rem; /* 96px */ + --font-size-9xl: 8rem; /* 128px */ + --line-height-xs: 1rem; /* 16px */ + --line-height-sm: 1.25rem; /* 20px */ + --line-height-base: 1.5rem; /* 24px */ + --line-height-lg: 1.75rem; /* 28px */ + --line-height-xl: 1.75rem; /* 28px */ + --line-height-2xl: 2rem; /* 32px */ + --line-height-3xl: 2.25rem; /* 36px */ + --line-height-4xl: 2.5rem; /* 40px */ + --line-height-5xl: 1; + --line-height-6xl: 1; + --line-height-7xl: 1; + --line-height-8xl: 1; + --line-height-9xl: 1; + /* Spacing Scale */ --space-0: 0; --space-px: 1px; - --space-05: 0.125rem; - --space-1: 0.25rem; - --space-2: 0.5rem; - --space-3: 0.75rem; - --space-4: 1rem; - --space-5: 1.25rem; - --space-6: 1.5rem; - --space-7: 1.75rem; - --space-8: 2rem; - --space-9: 2.25rem; - --space-10: 2.5rem; - --space-11: 2.75rem; - --space-12: 3rem; - --space-14: 3.5rem; - --space-16: 4rem; - --space-20: 5rem; - --space-24: 6rem; - --space-28: 7rem; - --space-32: 8rem; - --space-36: 9rem; - --space-40: 10rem; - --space-44: 11rem; - --space-48: 12rem; - --space-52: 13rem; - --space-56: 14rem; - --space-60: 15rem; - --space-64: 16rem; - --space-72: 18rem; - --space-80: 20rem; - --space-96: 24rem; + --space-05: 0.125rem; /* 2px */ + --space-1: 0.25rem; /* 4px */ + --space-2: 0.5rem; /* 8px */ + --space-3: 0.75rem; /* 12px */ + --space-4: 1rem; /* 16px */ + --space-5: 1.25rem; /* 20px */ + --space-6: 1.5rem; /* 24px */ + --space-7: 1.75rem; /* 28px */ + --space-8: 2rem; /* 32px */ + --space-9: 2.25rem; /* 36px */ + --space-10: 2.5rem; /* 40px */ + --space-11: 2.75rem; /* 44px */ + --space-12: 3rem; /* 48px */ + --space-14: 3.5rem; /* 56px */ + --space-16: 4rem; /* 64px */ + --space-20: 5rem; /* 80px */ + --space-24: 6rem; /* 96px */ + --space-28: 7rem; /* 112px */ + --space-32: 8rem; /* 128px */ + --space-36: 9rem; /* 144px */ + --space-40: 10rem; /* 160px */ + --space-44: 11rem; /* 176px */ + --space-48: 12rem; /* 192px */ + --space-52: 13rem; /* 208px */ + --space-56: 14rem; /* 224px */ + --space-60: 15rem; /* 240px */ + --space-64: 16rem; /* 256px */ + --space-72: 18rem; /* 288px */ + --space-80: 20rem; /* 320px */ + --space-96: 24rem; /* 384px */ /* Border Radius */ --rounded-none: 0; @@ -127,4 +155,23 @@ --rounded-2xl: 1rem; --rounded-3xl: 1.5rem; --rounded-full: 9999px; + + /* Transitions */ + --ease-linear: linear; + --ease-in: cubic-bezier(0.4, 0, 1, 1); + --ease-out: cubic-bezier(0, 0, 0.2, 1); + --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); + + --duration-0: 0s; + --duration-75: 75ms; + --duration-100: 100ms; + --duration-150: 150ms; + --duration-200: 200ms; + --duration-300: 300ms; + --duration-500: 500ms; + --duration-700: 700ms; + --duration-1000: 1000ms; + + /* Shadows */ + --shadow-base: 0px 1.875rem 3.75rem -1.875rem rgba(0, 0, 0, 0.05), 0px 0.125rem 0.25rem 0px rgba(0, 0, 0, 0.05); } diff --git a/components/Base/Badge.vue b/components/Base/Badge.vue new file mode 100644 index 00000000..af7a9d8d --- /dev/null +++ b/components/Base/Badge.vue @@ -0,0 +1,143 @@ + + + + + diff --git a/components/Base/Button.vue b/components/Base/Button.vue new file mode 100644 index 00000000..60e32786 --- /dev/null +++ b/components/Base/Button.vue @@ -0,0 +1,341 @@ + + + + + diff --git a/components/Base/Card.vue b/components/Base/Card.vue new file mode 100644 index 00000000..601631e4 --- /dev/null +++ b/components/Base/Card.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/components/Base/Frame.vue b/components/Base/Frame.vue new file mode 100644 index 00000000..66564844 --- /dev/null +++ b/components/Base/Frame.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/components/Base/Heading.vue b/components/Base/Heading.vue index 60fb73ae..28f8036b 100644 --- a/components/Base/Heading.vue +++ b/components/Base/Heading.vue @@ -1,14 +1,14 @@ diff --git a/components/Base/Icon.vue b/components/Base/Icon.vue index f37f3c4c..ab49699b 100644 --- a/components/Base/Icon.vue +++ b/components/Base/Icon.vue @@ -1,6 +1,4 @@ + + + + diff --git a/components/Base/Video.vue b/components/Base/Video.vue new file mode 100644 index 00000000..869a5588 --- /dev/null +++ b/components/Base/Video.vue @@ -0,0 +1,57 @@ + + +