spoko-design-system 0.0.6 → 0.0.8

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.
Files changed (51) hide show
  1. package/README.md +15 -2
  2. package/astro.config.mjs +55 -7
  3. package/package.json +23 -8
  4. package/public/pagefind.yml +4 -0
  5. package/src/components/Button.vue +10 -2
  6. package/src/components/ButtonCopy.vue +1 -6
  7. package/src/components/Card.astro +2 -2
  8. package/src/components/Carousel.astro +41 -0
  9. package/src/components/HeadCommon.astro +3 -3
  10. package/src/components/Header/Header.astro +171 -0
  11. package/src/components/Image.astro +0 -2
  12. package/src/components/Jumbatron.vue +17 -18
  13. package/src/components/MainTable.vue +20 -26
  14. package/src/components/Modal.astro +1 -4
  15. package/src/components/PageContent.astro +0 -1
  16. package/src/components/ProductTile.astro +30 -32
  17. package/src/components/RightSidebar.astro +0 -3
  18. package/src/config.ts +1 -0
  19. package/src/design.config.ts +4 -0
  20. package/src/layouts/Layout.astro +2 -2
  21. package/src/layouts/MainLayout.astro +7 -7
  22. package/src/pages/components/badges.mdx +17 -31
  23. package/src/pages/components/breadcrumbs.mdx +9 -6
  24. package/src/pages/components/buttons.mdx +106 -13
  25. package/src/pages/components/card.mdx +5 -5
  26. package/src/pages/components/carousel.mdx +20 -0
  27. package/src/pages/components/copyright.mdx +3 -2
  28. package/src/pages/components/flags.mdx +3 -2
  29. package/src/pages/components/fuck-russia.mdx +1 -1
  30. package/src/pages/components/hand-drive.mdx +4 -4
  31. package/src/pages/components/headline.mdx +19 -13
  32. package/src/pages/components/image.mdx +17 -5
  33. package/src/pages/components/input.mdx +1 -1
  34. package/src/pages/components/jumbatron.mdx +5 -3
  35. package/src/pages/components/modal.mdx +3 -3
  36. package/src/pages/components/post-header.mdx +3 -1
  37. package/src/pages/components/pr-code.mdx +6 -10
  38. package/src/pages/components/product-number.mdx +2 -1
  39. package/src/pages/components/product-tile.mdx +1 -1
  40. package/src/pages/components/slimbanner.mdx +1 -1
  41. package/src/pages/components/table.mdx +74 -4
  42. package/src/pages/core/colors.mdx +3 -1
  43. package/src/pages/core/introduction.mdx +1 -1
  44. package/src/pages/index.astro +8 -6
  45. package/src/styles/_variables.scss +6 -15
  46. package/src/styles/base/_base.scss +14 -5
  47. package/src/styles/base/_typography.scss +1 -80
  48. package/src/styles/content.scss +6 -9
  49. package/src/styles/main.scss +0 -16
  50. package/uno.config.ts +13 -11
  51. package/Layout/Header.astro +0 -111
package/README.md CHANGED
@@ -25,8 +25,8 @@ or just clone the repository.
25
25
 
26
26
 
27
27
 
28
- Example:
29
- - https://spoko-design-system.netlify.app/
28
+ ### Example:
29
+ - https://sds.spoko.space/
30
30
 
31
31
  #
32
32
 
@@ -36,6 +36,19 @@ Most of the components from this repository can be seen in my projects:
36
36
  - https://polo.blue
37
37
 
38
38
 
39
+ ### Feateures
40
+ - ⚡️[Vue 3](https://github.com/vuejs/core), [Vite](https://github.com/vitejs/vite), [pnpm](https://pnpm.io/) - born with fastness
41
+ - 🎨 [UnoCSS](https://github.com/antfu/unocss) - the instant on-demand atomic CSS engine
42
+ - 😃 [astro-icon](https://github.com/natemoo-re/astro-icon) - for local icons, sprites and `@iconify-json/*` sets
43
+ - 🍔 [astro-navbar](https://github.com/surjithctly/astro-navbar) - fully responsive and accessible headless navigation bar
44
+ - 🌍 [astro-i18next](https://github.com/yassinedoghri/astro-i18next) - Astro integration of i18next
45
+ - 🔎 [astro-pagefind](https://github.com/shishkin/astro-pagefind) - Astro integration for Pagefind static site search
46
+ - 🗒 [astrojs/mdx](https://github.com/withastro/astro/tree/main/packages/integrations/mdx/) - markdown support
47
+ - 📦 [astro-compress](https://github.com/astro-community/AstroCompress) - compression utilities to your Astro project
48
+ - 🖨 Static-site generation (SSG)
49
+ - 🎡 [Swiper](https://github.com/nolimits4web/swiper) - modern mobile touch slider with hardware accelerated transitions and amazing native behavior
50
+ - 🌠 [View Transitions API](https://docs.astro.build/en/guides/view-transitions/#full-site-view-transitions-spa-mode) - [View Transition API](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) - makes it easy to change the DOM in a single step, while creating an animated transition between the two states. It's available in Chrome 111+ ([more details](https://developer.chrome.com/docs/web-platform/view-transitions?hl=en))
51
+ - ☁️ Deploy on Netlify
39
52
 
40
53
  ### Adding new sections
41
54
 
package/astro.config.mjs CHANGED
@@ -1,30 +1,29 @@
1
1
  import { defineConfig, sharpImageService } from "astro/config";
2
- // import tailwind from "@astrojs/tailwind";
3
2
  import vue from "@astrojs/vue";
4
3
  import mdx from '@astrojs/mdx';
5
4
  import UnoCSS from '@unocss/astro';
6
-
5
+ import Compress from "astro-compress";
7
6
  // https://github.com/yassinedoghri/astro-i18next#readme
8
7
  import astroI18next from "astro-i18next";
9
-
10
8
  import icon from "astro-icon";
9
+ import sitemap from "@astrojs/sitemap";
10
+ import pagefind from "astro-pagefind";
11
11
 
12
12
  // https://astro.build/config
13
13
  export default defineConfig({
14
- site: "https://spoko-design-system.netlify.app",
14
+ site: "https://sds.spoko.space/",
15
15
  server: {
16
16
  port: 1234
17
17
  },
18
18
  image: {
19
19
  service: sharpImageService(),
20
- domains: ["api.polo.blue", "polo.blue", "media.istockphoto.com", "img.freepik.com"]
20
+ domains: ["placehold.co", "api.polo.blue", "polo.blue", "media.istockphoto.com", "img.freepik.com"]
21
21
  },
22
22
  integrations: [
23
23
  // Enable Vue to support Vue3 components.
24
24
  vue(),
25
25
  mdx(),
26
26
  astroI18next(),
27
- // tailwind(), // sorry - Uno is better ;-P
28
27
  UnoCSS({
29
28
  injectReset: true
30
29
  }), icon(
@@ -48,5 +47,54 @@ export default defineConfig({
48
47
  flowbite: ["arrow-left-outline", "arrow-right-outline", "angle-left-outline", "angle-right-outline", "chevron-left-outline", "chevron-right-outline","map-location-outline", "map-pin-alt-solid", "x-outline", "messages-outline", "arrow-down-to-bracket-outline", "check-outline"]
49
48
  }
50
49
  }
51
- )]
50
+ ),
51
+ Compress({
52
+ CSS: true,
53
+ HTML: {
54
+ caseSensitive: true,
55
+ collapseBooleanAttributes: true,
56
+ collapseInlineTagWhitespace: false,
57
+ collapseWhitespace: true,
58
+ conservativeCollapse: false,
59
+ continueOnParseError: false,
60
+ customAttrAssign: [],
61
+ customAttrCollapse: "",
62
+ customAttrSurround: [],
63
+ customEventAttributes: [/^on[a-z]{3,}$/],
64
+ decodeEntities: false,
65
+ html5: true,
66
+ ignoreCustomComments: [],
67
+ ignoreCustomFragments: [],
68
+ includeAutoGeneratedTags: true,
69
+ keepClosingSlash: true,
70
+ maxLineLength: null,
71
+ minifyCSS: true,
72
+ minifyJS: true,
73
+ minifyURLs: false,
74
+ preserveLineBreaks: false,
75
+ preventAttributesEscaping: false,
76
+ processConditionalComments: true,
77
+ processScripts: ["module"],
78
+ quoteCharacter: "",
79
+ removeAttributeQuotes: true,
80
+ removeComments: false,
81
+ removeEmptyAttributes: false,
82
+ removeEmptyElements: false,
83
+ removeOptionalTags: false,
84
+ removeRedundantAttributes: true,
85
+ removeScriptTypeAttributes: true,
86
+ removeStyleLinkTypeAttributes: true,
87
+ removeTagWhitespace: true,
88
+ sortAttributes: true,
89
+ sortClassName: true,
90
+ trimCustomFragments: false,
91
+ useShortDoctype: false
92
+ },
93
+ Image: false,
94
+ JavaScript: true,
95
+ SVG: true
96
+ }),
97
+ pagefind(),
98
+ sitemap()
99
+ ]
52
100
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoko-design-system",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "astro dev",
@@ -8,10 +8,29 @@
8
8
  "build": "astro build",
9
9
  "preview": "astro preview"
10
10
  },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/polo-blue/sds"
14
+ },
15
+ "author": {
16
+ "name": "spokospace",
17
+ "email": "szymon@spoko.space",
18
+ "url": "https://spoko.space"
19
+ },
20
+ "homepage": "https://sds.spoko.space/",
21
+ "license": "MIT",
22
+ "keywords": [
23
+ "astro-starter",
24
+ "seo",
25
+ "astro",
26
+ "sds design system",
27
+ "spoko design system"
28
+ ],
11
29
  "dependencies": {
12
30
  "@algolia/client-search": "^4.22.1",
13
31
  "@astrojs/mdx": "^2.1.0",
14
32
  "@astrojs/node": "^7.0.4",
33
+ "@astrojs/sitemap": "^3.0.5",
15
34
  "@astrojs/vue": "^4.0.8",
16
35
  "@docsearch/css": "^3.5.2",
17
36
  "@docsearch/react": "^3.5.2",
@@ -45,6 +64,7 @@
45
64
  "@unocss/preset-wind": "^0.58.4",
46
65
  "@unocss/reset": "^0.58.4",
47
66
  "@vueuse/core": "^10.7.2",
67
+ "astro-compress": "^2.2.8",
48
68
  "astro-i18next": "1.0.0-beta.21",
49
69
  "astro-icon": "^1.0.2",
50
70
  "astro-navbar": "^2.3.0",
@@ -54,18 +74,13 @@
54
74
  "i18next-fs-backend": "^2.3.1",
55
75
  "i18next-http-backend": "^2.4.2",
56
76
  "i18next-vue": "^3.0.0",
57
- "preact": "^10.19.3",
58
- "react": "^18.2.0",
59
- "react-dom": "^18.2.0",
60
77
  "sass": "^1.70.0",
61
78
  "unocss": "^0.57.7",
62
79
  "vite": "^5.0.12",
63
- "vue": "^3.4.15"
80
+ "vue": "^3.4.15",
81
+ "swiper": "^11.0.5"
64
82
  },
65
83
  "devDependencies": {
66
- "@astrojs/preact": "^3.1.0",
67
- "@astrojs/react": "^3.0.9",
68
- "@astrojs/tailwind": "^5.1.0",
69
84
  "@unocss/transformer-variant-group": "^0.58.4",
70
85
  "astro": "^4.2.4",
71
86
  "unocss": "^0.58.3"
@@ -0,0 +1,4 @@
1
+ exclude_selectors:
2
+ - "code"
3
+ - ".component-preview"
4
+ - "pre"
@@ -5,25 +5,33 @@ const props = defineProps<{
5
5
  href?: string;
6
6
  title?: string;
7
7
  primary?: boolean;
8
- tertiary?: boolean;
8
+ primaryOutline?: boolean;
9
9
  secondary?: boolean;
10
+ secondaryOutline?: boolean;
11
+ tertiary?: boolean;
12
+ tertiaryOutline?: boolean;
10
13
  text?: boolean;
11
14
  tag?: boolean;
12
15
  small?: boolean;
13
16
  medium?: boolean;
17
+ rounded?: boolean;
14
18
  }>();
15
19
 
16
20
  const tag = props.href && props.href.length ? 'a' : 'button'
17
21
 
18
22
  const classes = {
19
23
  "btn-primary": props.primary,
24
+ "btn-primary-outline": props.primaryOutline,
20
25
  "btn-secondary": props.secondary,
26
+ "btn-secondary-outline": props.secondaryOutline,
21
27
  "btn-tertiary": props.tertiary,
28
+ "btn-tertiary-outline": props.tertiaryOutline,
22
29
  "btn-text": props.text,
23
30
  "btn-tag": props.tag,
24
31
  "btn-sm": props.medium,
25
32
  "btn-xs": props.small,
26
- "btn-normal": !props.small && !props.medium
33
+ "btn-normal": !props.small && !props.medium,
34
+ "rounded-full": props.rounded
27
35
  };
28
36
 
29
37
 
@@ -1,7 +1,5 @@
1
1
  <script lang="ts" setup>
2
-
3
2
  import { useClipboard } from "@vueuse/core";
4
-
5
3
  import { Icon } from "@iconify/vue";
6
4
  import { PropType } from "vue";
7
5
 
@@ -30,7 +28,6 @@ const { copy, copied, isSupported } = useClipboard({ source });
30
28
 
31
29
  </script>
32
30
 
33
-
34
31
  <template>
35
32
  <button v-if="isSupported" :aria-label="String(texts.copy)"
36
33
  class="btn-copy has-tooltip" @click="copy()">
@@ -40,7 +37,6 @@ const { copy, copied, isSupported } = useClipboard({ source });
40
37
  </template>
41
38
 
42
39
  <style>
43
-
44
40
  .tooltip {
45
41
  @apply invisible absolute;
46
42
  }
@@ -48,5 +44,4 @@ const { copy, copied, isSupported } = useClipboard({ source });
48
44
  .has-tooltip:hover .tooltip {
49
45
  @apply visible z-50;
50
46
  }
51
-
52
- </style>
47
+ </style>
@@ -1,11 +1,11 @@
1
1
  ---
2
- const { class: className, imgSrc, imgAlt } = Astro.props;
2
+ const { class: className, imgSrc, imgAlt, href } = Astro.props;
3
3
 
4
4
  import Image from '../components/Image.astro'
5
5
  ---
6
6
 
7
7
  <div class="bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700 overflow-hidden">
8
- <a href="#" class="aspect-ratio-video block relative">
8
+ <a href={href} class="aspect-ratio-video block relative">
9
9
  { imgSrc && (
10
10
  <Image
11
11
  imageObject={
@@ -0,0 +1,41 @@
1
+ ---
2
+
3
+ ---
4
+ <script>
5
+ import { register } from "swiper/element/bundle";
6
+
7
+ document.addEventListener("astro:page-load", () => {
8
+ //"DOMContentLoaded"
9
+ // register Swiper custom elements
10
+ register();
11
+ })
12
+
13
+ </script>
14
+
15
+ <swiper-container
16
+ class="max-w=full w-full flex"
17
+ grid-rows="1"
18
+ mousewheel-force-to-axis="true"
19
+ navigation="true"
20
+ pagination-type="fraction"
21
+ scrollbar="false"
22
+ slides-per-view="auto"
23
+ space-between="0"
24
+ >
25
+ <swiper-slide class="bg-blue-50 p-12 border-1">
26
+ A
27
+ </swiper-slide>
28
+ <swiper-slide class="bg-blue-100 p-12 border-1">
29
+ B
30
+ </swiper-slide>
31
+ <swiper-slide class="bg-blue-200 p-12 border-1">
32
+ C
33
+ </swiper-slide>
34
+ <swiper-slide class="bg-blue-300 p-12 border-1">
35
+ D
36
+ </swiper-slide>
37
+ <swiper-slide class="bg-blue-400 p-12 border-1">
38
+ A
39
+ </swiper-slide>
40
+
41
+ </swiper-container>
@@ -9,12 +9,12 @@
9
9
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
10
10
  <link rel="alternate icon" type="image/x-icon" href="/favicon.ico" />
11
11
 
12
- <link rel="sitemap" href="/sitemap.xml" />
12
+ <link rel="sitemap" href="/sitemap-index.xml" />
13
13
 
14
14
  <!-- Preload Fonts -->
15
- <link rel="preconnect" href="https://fonts.googleapis.com" />
15
+ <!-- <link rel="preconnect" href="https://fonts.googleapis.com" />
16
16
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
17
- <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital@0;1&display=swap" rel="stylesheet" />
17
+ <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital@0;1&display=swap" rel="stylesheet" /> -->
18
18
 
19
19
  <!-- Scrollable a11y code helper -->
20
20
  <script src="/make-scrollable-code-focusable.js" is:inline></script>
@@ -2,6 +2,7 @@
2
2
  import { SITE } from "../../config";
3
3
  import SkipToContent from "./SkipToContent.astro";
4
4
  import { MenuIcon } from "astro-navbar";
5
+ import Search from "astro-pagefind/components/Search";
5
6
  ---
6
7
 
7
8
  <header
@@ -15,6 +16,17 @@ import { MenuIcon } from "astro-navbar";
15
16
  <div class="flex flex-nowrap">
16
17
  <MenuIcon class="w-4 h-4 text-gray-800 lg:hidden mr-4" />
17
18
  <a class="text-2xl font-medium block font-textbold" href="/"> SDS</a>
19
+ <Search
20
+ transition:persist
21
+ transition:name="search-field"
22
+ className="search-container"
23
+ id="search"
24
+ uiOptions={{
25
+ showImages: false,
26
+ showFilters: false,
27
+ resetStyles: true,
28
+ }}
29
+ />
18
30
  </div>
19
31
  <div class="flex gap-2">
20
32
  {
@@ -42,3 +54,162 @@ import { MenuIcon } from "astro-navbar";
42
54
  </div>
43
55
  </nav>
44
56
  </header>
57
+
58
+ <style lang="scss" is:global>
59
+ #search {
60
+ @apply ml-6;
61
+
62
+ &.search-container {
63
+ box-sizing: border-box;
64
+ @apply h-10 border-0 border-gray-800 rounded-3xl hidden md:block;
65
+ }
66
+ .pagefind-ui {
67
+
68
+ @apply font-textlight text-base;
69
+
70
+ &__search-input {
71
+ height: 40px !important;
72
+ border: 0;
73
+ @apply rounded-none sm-rounded-3xl h-10 w-full;
74
+ }
75
+
76
+ &__result-excerpt,
77
+ __button {
78
+ font-size: 14px !important;
79
+ }
80
+
81
+ &__filter-name {
82
+ font-size: 12px !important;
83
+ }
84
+ &__drawer:not(.pagefind-ui__hidden) {
85
+ @apply p-4;
86
+ }
87
+
88
+ &__result-link {
89
+ color: var(--pagefind-ui-primary);
90
+ // font-family: 'vw_headregular';
91
+ font-family: vw_headlight;
92
+ font-size: 1rem;
93
+
94
+ &:before {
95
+ top: 0;
96
+ bottom: 0;
97
+ left: 0;
98
+ right: 0;
99
+ content: "";
100
+ position: absolute;
101
+ }
102
+ }
103
+
104
+ &__result-excerpt {
105
+ color: var(--pagefind-ui-text);
106
+ order: 3;
107
+ }
108
+
109
+ &__drawer {
110
+ @apply bg-white md-position-fixed shadow-lg rounded-b-lg border-t border-t-transparent overflow-auto top-17 md:max-w-[calc(100vw-10%)] max-h-[calc(100vh-10%)];
111
+ gap: 30px;
112
+ }
113
+
114
+ &__search-clear {
115
+ height: 38px;
116
+ top: 0;
117
+ @apply sm-rounded-3xl;
118
+ }
119
+
120
+ &__search-input {
121
+ font-size: 1rem;
122
+ font-weight: 400;
123
+ padding: 0 2.5rem 2px;
124
+ }
125
+
126
+ &__form {
127
+ &:before {
128
+ top: 14px;
129
+ left: 16px;
130
+ width: 14px;
131
+ height: 14px;
132
+ }
133
+ }
134
+
135
+ &__result {
136
+ padding: 0.875rem 0;
137
+ gap: 1rem;
138
+ @apply position-relative;
139
+ }
140
+
141
+ &__filter-block {
142
+ padding: 0.875rem 0;
143
+ border-width: 1px;
144
+ }
145
+
146
+ &__filter-group {
147
+ gap: 0.5rem;
148
+ padding-top: 0.875rem;
149
+ }
150
+
151
+ &__filter-value {
152
+ gap: 10px;
153
+ }
154
+
155
+ &__filter-checkbox {
156
+ border-radius: 3px;
157
+ margin-top: 1px;
158
+ min-width: calc(16px * var(--pagefind-ui-scale));
159
+ }
160
+
161
+ &__result-image {
162
+ @apply drop-shadow-sm w-full h-full object-contain rounded-none;
163
+ }
164
+
165
+ &__filter-panel {
166
+ // min-width: 220px;
167
+ @apply hidden;
168
+ }
169
+
170
+ &__filter-label {
171
+ font-size: 0.9rem;
172
+ }
173
+
174
+ &__button {
175
+ font-weight: 400;
176
+ height: 40px;
177
+ }
178
+
179
+ &__result-tag {
180
+ background: inherit;
181
+ padding: 0;
182
+ color: #9ca3af;
183
+ }
184
+
185
+ &__result-thumb {
186
+ max-width: 120px;
187
+ }
188
+
189
+ &__result-tags {
190
+ margin-top: 0.4rem;
191
+ order: 2;
192
+ }
193
+
194
+ &__filter-name {
195
+ &:after {
196
+ color: var(--pagefind-ui-primary);
197
+ }
198
+ }
199
+
200
+ &__result-title {
201
+ font-size: inherit;
202
+ line-height: 1;
203
+ }
204
+
205
+ &__filter-panel,
206
+ &__results-area {
207
+ margin-top: 0;
208
+ }
209
+
210
+ &__message {
211
+ padding: 0.875rem 0;
212
+ }
213
+ }
214
+ }
215
+ </style>
@@ -2,10 +2,8 @@
2
2
  import { Image } from 'astro:assets'
3
3
 
4
4
  const { imageObject } = Astro.props;
5
-
6
5
  let inputProps = {};
7
6
 
8
-
9
7
  if (imageObject.index && imageObject.index === 1) {
10
8
  inputProps['data-pagefind-meta'] = 'image[src], image_alt[alt]';
11
9
  inputProps['loading'] = 'eager'
@@ -1,24 +1,24 @@
1
1
  <script setup lang="ts">
2
2
  import { useSlots } from 'vue';
3
3
 
4
- const slots = useSlots()
5
- const hasSlot = (name) => {
6
- return !!slots[name];
7
- }
8
- const props = defineProps({
9
- small: {
10
- type: Boolean,
11
- default: null,
12
- required: false,
13
- },
14
- })
4
+ const slots = useSlots()
5
+ const hasSlot = (name) => {
6
+ return !!slots[name];
7
+ }
8
+ const props = defineProps({
9
+ small: {
10
+ type: Boolean,
11
+ default: null,
12
+ required: false,
13
+ },
14
+ })
15
15
  </script>
16
16
 
17
-
18
17
  <template>
19
- <div class="relative flex bg-vw " :class="props.small ? 'md:min-h-xs' : 'md:min-h-md' ">
18
+ <div class="relative flex bg-vw " :class="props.small ? 'md:min-h-xs' : 'md:min-h-md'">
20
19
  <div class="max-w-7xl mx-auto my-auto">
21
- <div class="py-8 lg:w-full" :class="props.small ? 'sm:py-12 md:py-14 lg:py-16 xl:py-20' : 'sm:py-16 md:py-20 lg:py-28 xl:py-32' ">
20
+ <div class="py-8 lg:w-full"
21
+ :class="props.small ? 'sm:py-12 md:py-14 lg:py-16 xl:py-20' : 'sm:py-16 md:py-20 lg:py-28 xl:py-32'">
22
22
  <header class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8"> <!-- sm:pt-12 md:pt-16 lg:pt-20 xl:pt-28 -->
23
23
  <div class="text-center">
24
24
  <h1 class="text-3xl tracking-tight sm:(text-4xl pt-0) md:text-5xl lg:text-6xl font-headlight text-white">
@@ -38,9 +38,8 @@ import { useSlots } from 'vue';
38
38
  </template>
39
39
  <style lang="scss">
40
40
  .bg-vw {
41
- background: radial-gradient(
42
- circle at 50% 85%,
41
+ background: radial-gradient(circle at 50% 85%,
43
42
  #00437A 0%,
44
- #001E50 100%
45
- )}
43
+ #001E50 100%)
44
+ }
46
45
  </style>
@@ -1,14 +1,29 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ data: string;
4
+ }>();
5
+
6
+ const theads = Object.keys(Object.values(props.data)[0])
7
+
8
+ const capitalizeFirstLetter = (text: String) => {
9
+ return text[0].toUpperCase() + text.slice(1)
10
+ }
11
+
12
+ </script>
13
+
14
+
15
+
1
16
  <template>
2
17
  <table class="table-auto text-left border bg-white shadow-md">
3
- <thead class="bg-slate-800 text-white">
18
+ <thead class="bg-gray-500 text-white">
4
19
  <tr class="border">
5
- <th class="px-4 py-2">id</th>
6
- <th class="px-4 py-2">Name</th>
7
- <th class="px-4 py-2">Email</th>
20
+ <th class="px-4 py-2 font-semibold" v-for="thead, index in theads" :key="index">
21
+ {{ capitalizeFirstLetter(thead) }}
22
+ </th>
8
23
  </tr>
9
24
  </thead>
10
25
  <tbody>
11
- <tr class="border" v-for="row in tableData" :key="row">
26
+ <tr class="border" v-for="row in props.data" :key="row">
12
27
  <td class="px-4 py-2" v-for="key in Object.keys(row)" :key="key">
13
28
  {{ row[key] }}
14
29
  </td>
@@ -17,24 +32,3 @@
17
32
  </table>
18
33
  </template>
19
34
 
20
- <script setup lang="ts">
21
- const tableData = [
22
- {
23
- id: 1,
24
- name: "Lorem Ipsum",
25
- email: "lorem@email.com",
26
- },
27
- {
28
- id: 2,
29
- name: "Chuck Norris",
30
- email: "ipsum@email.com",
31
- },
32
- {
33
- id: 3,
34
- name: "Ipsum Lorem",
35
- email: "lorem@email.com",
36
- }
37
- ];
38
- </script>
39
-
40
- <style scoped></style>
@@ -5,10 +5,7 @@ import Button from '../components/Button.vue'
5
5
  <style lang="scss">
6
6
  dialog {
7
7
  @apply fixed top-0 left-0 right-0 bottom-0;
8
- // position: fixed;
9
- // left: 50%;
10
- // top: 50%;
11
- // transform: translate(-50%, -50%);
8
+
12
9
  &::backdrop {
13
10
  @apply bg-gray-500/50 fixed;
14
11
  top: 0px;
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  const { content, githubEditUrl } = Astro.props;
3
3
  const title = content.title;
4
- // const headers = content.astro.headers;
5
4
  ---
6
5
 
7
6
  <article id="article" class="content">