spoko-design-system 0.0.1 → 0.0.2

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 (99) hide show
  1. package/.astro/icon.d.ts +2199 -2192
  2. package/.github/workflows/deploy.yml +39 -39
  3. package/.stackblitzrc +5 -5
  4. package/.vscode/extensions.json +4 -4
  5. package/.vscode/launch.json +11 -11
  6. package/LICENSE +21 -21
  7. package/Layout/Header.astro +111 -89
  8. package/README.md +69 -69
  9. package/astro-i18next.config.mjs +17 -17
  10. package/astro-i18next.config.ts +10 -10
  11. package/astro.config.mjs +45 -42
  12. package/index.ts +6 -6
  13. package/package.json +75 -71
  14. package/public/astro-design-system-logo.svg +10 -10
  15. package/public/fonts/lg.svg +53 -53
  16. package/public/fonts/vwhead-bold-demo.html +549 -549
  17. package/public/fonts/vwhead-regular-demo.html +549 -549
  18. package/public/fonts/vwtext-bold-demo.html +549 -549
  19. package/public/fonts/vwtext-regular-demo.html +549 -549
  20. package/public/github.svg +3 -3
  21. package/public/grid_dot.svg +4 -4
  22. package/public/linkedin.svg +44 -44
  23. package/public/locales/en/translation.json +5 -5
  24. package/public/locales/pl/translation.json +5 -5
  25. package/public/make-scrollable-code-focusable.js +3 -3
  26. package/public/polo.blue.svg +29 -0
  27. package/public/spoko.space.svg +71 -0
  28. package/public/twitter.svg +46 -46
  29. package/sandbox.config.json +11 -11
  30. package/src/MyComponent.astro +8 -8
  31. package/src/components/Badge.vue +19 -19
  32. package/src/components/Badges.vue +24 -23
  33. package/src/components/Breadcrumbs.vue +108 -111
  34. package/src/components/Button.vue +28 -0
  35. package/src/components/CategoryLink.astro +18 -0
  36. package/src/components/Copyright.astro +11 -11
  37. package/src/components/Date.astro +7 -0
  38. package/src/components/FuckRussia.vue +65 -65
  39. package/src/components/HandDrive.astro +30 -30
  40. package/src/components/HeadCommon.astro +40 -40
  41. package/src/components/HeadSEO.astro +41 -41
  42. package/src/components/Header/AstroLogo.astro +7 -27
  43. package/src/components/Header/Header.astro +44 -48
  44. package/src/components/Header/SkipToContent.astro +1 -1
  45. package/src/components/Headline.vue +28 -0
  46. package/src/components/Jumbatron.vue +31 -31
  47. package/src/components/LeftSidebar.astro +44 -44
  48. package/src/components/MainColors.vue +29 -29
  49. package/src/components/MainInput.vue +18 -18
  50. package/src/components/MainTable.vue +40 -45
  51. package/src/components/Modal.astro +30 -0
  52. package/src/components/PageContent.astro +14 -14
  53. package/src/components/PostHeader.astro +104 -0
  54. package/src/components/RightSidebar.astro +15 -11
  55. package/src/components/SlimBanner.vue +59 -59
  56. package/src/components/TableOfContents.astro +11 -11
  57. package/src/components/Translations.vue +27 -0
  58. package/src/components/flags/FlagPL.vue +2 -2
  59. package/src/components/flags/FlagUA.vue +2 -2
  60. package/src/components/layout/Header.astro +50 -69
  61. package/src/config.ts +47 -42
  62. package/src/design.config.ts +73 -92
  63. package/src/env.d.ts +1 -1
  64. package/src/flag-poland.svg +1 -0
  65. package/src/flag-uk.svg +1 -0
  66. package/src/layouts/Layout.astro +51 -0
  67. package/src/layouts/MainLayout.astro +68 -50
  68. package/src/pages/components/badges.mdx +37 -35
  69. package/src/pages/components/breadcrumbs.mdx +100 -103
  70. package/src/pages/components/buttons.mdx +62 -60
  71. package/src/pages/components/copyright.mdx +41 -24
  72. package/src/pages/components/flags.mdx +40 -26
  73. package/src/pages/components/fuck-russia.mdx +39 -16
  74. package/src/pages/components/hand-drive.mdx +33 -27
  75. package/src/pages/components/headline.mdx +129 -0
  76. package/src/pages/components/icons.astro +52 -45
  77. package/src/pages/components/input.mdx +45 -14
  78. package/src/pages/components/jumbatron.mdx +48 -48
  79. package/src/pages/components/modal.mdx +58 -0
  80. package/src/pages/components/post-header.mdx +36 -0
  81. package/src/pages/components/slimbanner.mdx +29 -27
  82. package/src/pages/components/table.mdx +20 -20
  83. package/src/pages/core/colors.mdx +8 -8
  84. package/src/pages/core/introduction.mdx +74 -68
  85. package/src/pages/core/shadows.astro +20 -20
  86. package/src/pages/core/typography.astro +46 -46
  87. package/src/pages/index.astro +67 -52
  88. package/src/pages/patterns/introduction.mdx +60 -61
  89. package/src/styles/_variables.scss +75 -75
  90. package/src/styles/base/_base.scss +158 -158
  91. package/src/styles/base/_typography.scss +147 -147
  92. package/src/styles/content.scss +51 -72
  93. package/src/styles/main.scss +22 -22
  94. package/tailwind.config.cjs +8 -8
  95. package/tsconfig.json +11 -11
  96. package/uno.config.ts +227 -227
  97. package/src/components/MainButton.vue +0 -26
  98. package/src/components/MainStatusPill.vue +0 -32
  99. package/src/pages/components/status-pill.mdx +0 -22
@@ -1,48 +1,48 @@
1
- ---
2
- title: "Jumbatron"
3
- layout: "../../layouts/MainLayout.astro"
4
- ---
5
- import Jumbatron from '../../components/Jumbatron.vue'
6
-
7
- ## Jumbatron
8
-
9
- This page is an example on how to document your button components, most of the copy was written by AI so don't take it very seriously.
10
-
11
- Find the code for this page in the `src/pages/components/buttons.md` file.
12
- <div class="component-preview">
13
- <Jumbatron class="w-full">
14
- <span slot="intro" set:html={`Lorem ipsum dolor sit amet, <span class=\"text-lightBlue-500\">consectetur</span> adipiscing elit.`} />
15
- <p slot="subtitle"
16
- class="mt-3 text-base text-gray-200 sm:mt-5 text-lg md:text-xl lg:mx-0 md:mt-5"
17
- set:html="Nunc posuere massa eget turpis laoreet ultrices eget vel massa."
18
- />
19
-
20
-
21
- <a slot="cta"
22
- href="/about/"
23
- title="short text"
24
- class="w-full inline-flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-full text-white bg-lightBlue-500 hover:bg-lightBlue-600 md:py-2 md:text-lg md:px-10 shadow"
25
- >
26
- Read More
27
- </a>
28
- </Jumbatron>
29
- </div>
30
-
31
- ```js
32
- <Jumbatron>
33
- <span slot="intro" set:html="text-intro" />
34
- <p slot="subtitle"
35
- class="mt-3 text-base text-gray-200 sm:mt-5 text-lg md:text-xl lg:mx-0 md:mt-5"
36
- set:html="subtitle"
37
- />
38
-
39
-
40
- <a slot="cta"
41
- href="/about/"
42
- title="short text"
43
- class="w-full inline-flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-full text-white bg-lightBlue-500 hover:bg-lightBlue-600 md:py-2 md:text-lg md:px-10 shadow"
44
- >
45
- Read More
46
- </a>
47
- </Jumbatron>
48
- ```
1
+ ---
2
+ title: "Jumbatron"
3
+ layout: "../../layouts/MainLayout.astro"
4
+ ---
5
+ import Jumbatron from '../../components/Jumbatron.vue'
6
+
7
+ ## Jumbatron
8
+
9
+ This page is an example on how to document your button components, most of the copy was written by AI so don't take it very seriously.
10
+
11
+ Find the code for this page in the `src/pages/components/jumbatron.mdx` file.
12
+ <div class="component-preview">
13
+ <Jumbatron class="w-full">
14
+ <span slot="intro" set:html={`Lorem ipsum dolor sit amet, <span class=\"text-lightBlue-500\">consectetur</span> adipiscing elit.`} />
15
+ <p slot="subtitle"
16
+ class="mt-3 text-base text-gray-200 sm:mt-5 text-lg md:text-xl lg:mx-0 md:mt-5"
17
+ set:html="Nunc posuere massa eget turpis laoreet ultrices eget vel massa."
18
+ />
19
+
20
+
21
+ <a slot="cta"
22
+ href="/about/"
23
+ title="short text"
24
+ class="w-full inline-flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-full text-white bg-lightBlue-500 hover:bg-lightBlue-600 md:py-2 md:text-lg md:px-10 shadow"
25
+ >
26
+ Read More
27
+ </a>
28
+ </Jumbatron>
29
+ </div>
30
+
31
+ ```js
32
+ <Jumbatron>
33
+ <span slot="intro" set:html="text-intro" />
34
+ <p slot="subtitle"
35
+ class="mt-3 text-base text-gray-200 sm:mt-5 text-lg md:text-xl lg:mx-0 md:mt-5"
36
+ set:html="subtitle"
37
+ />
38
+
39
+
40
+ <a slot="cta"
41
+ href="/about/"
42
+ title="short text"
43
+ class="w-full inline-flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-full text-white bg-lightBlue-500 hover:bg-lightBlue-600 md:py-2 md:text-lg md:px-10 shadow"
44
+ >
45
+ Read More
46
+ </a>
47
+ </Jumbatron>
48
+ ```
@@ -0,0 +1,58 @@
1
+ ---
2
+ title: "Modal"
3
+ layout: "../../layouts/MainLayout.astro"
4
+ ---
5
+ import Modal from '../../components/Modal.astro'
6
+ import Button from '../../components/Button.vue'
7
+ import { Icon } from 'astro-icon/components';
8
+
9
+
10
+ ## Modal
11
+
12
+ ### Modal (native) based on dialog tag.
13
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
14
+
15
+
16
+ <div class="component-preview">
17
+ <Modal id="dialog" open="Open modal">
18
+ <main slot="main">
19
+ <p>Some extra content you would like here</p>
20
+ <hr />
21
+ </main>
22
+ <Button primary slot="close" class="mt-4">Close</Button>
23
+ </Modal>
24
+ </div>
25
+
26
+ ```js
27
+ <Modal id="dialog" open="Open modal">
28
+ <main slot="main">
29
+ <p>Some extra content you would like here</p>
30
+ <hr />
31
+ <img width="60" height="80" src="/assets/logo.svg" alt="Astro logo">
32
+ </main>
33
+ <Button primary slot="close" class="mt-4">Close</Button>
34
+ </Modal>
35
+ ```
36
+
37
+ ### Modal with different close button
38
+
39
+ <div class="component-preview">
40
+ <Modal id="dialog2" open="Open modal">
41
+ <main slot="main">
42
+ <p>Some extra content you would like here</p>
43
+ </main>
44
+ <Button primary slot="close" class="mt-4"><Icon name="octicon:x-24" /></Button>
45
+ </Modal>
46
+ </div>
47
+
48
+ ```js
49
+ <Modal id="dialog2" open="Open modal">
50
+ <main slot="main">
51
+ <p>Some extra content you would like here</p>
52
+ <img width="60" height="80" src="/assets/logo.svg" alt="Astro logo">
53
+ </main>
54
+ <Button primary slot="close" class="mt-4"><Icon name="octicon:x-24" /></Button>
55
+ </Modal>
56
+ ```
57
+
58
+
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: "PostHeader"
3
+ layout: "../../layouts/MainLayout.astro"
4
+ ---
5
+ import PostHeader from '../../components/PostHeader.astro'
6
+ export const author = { firstName: 'Szymon', name: 'CNK' }
7
+ export const categories = [{"name":"Tools & garage accessories","uri":"#"}, {"name":"Lorem Ipsum","uri":"#"}]
8
+ export const date = "2023-07-13T01:35:03"
9
+
10
+ ## PostHeader
11
+
12
+ WordPress PostHeader - post top component for WordPress Single Post template data like categories etc. comes from WP Rest API.
13
+
14
+
15
+ <div class="component-preview">
16
+ <div class="relative w-full">
17
+ <PostHeader
18
+ author={author}
19
+ categories={categories}
20
+ title="Lorem Ipsum"
21
+ date={date}
22
+ image="https://placehold.co/2000x700/EEE/31343C"
23
+ />
24
+ </div>
25
+ </div>
26
+
27
+ ```js
28
+ <div class="relative">
29
+ <PostHeader
30
+ author={ { firstName: 'Szymon', name: 'CNK' } }
31
+ categories={ [{"name":"Tools & garage accessories","uri":"/category/garage/tools-garage-accessories/"}, , {"name":"Lorem Ipsum","uri":"#"}] }
32
+ date="2023-07-13T01:35:03"
33
+ image="https://placehold.co/2000x700/EEE/31343C"
34
+ />
35
+ </div>
36
+ ```
@@ -1,27 +1,29 @@
1
- ---
2
- title: "SlimBanner"
3
- layout: "../../layouts/MainLayout.astro"
4
- ---
5
- import SlimBanner from '../../components/SlimBanner.vue'
6
-
7
- ## SlimBanner
8
-
9
- SlimBanner - solidarity with Ukraine.
10
-
11
- <div class="component-preview">
12
- <SlimBanner
13
- client:load
14
- showCloseButton
15
- transition:name="slim-banner"
16
- transition:persist
17
- />
18
- </div>
19
-
20
- ```js
21
- <SlimBanner
22
- client:load
23
- showCloseButton
24
- transition:name="slim-banner"
25
- transition:persist
26
- />
27
- ```
1
+ ---
2
+ title: "SlimBanner"
3
+ layout: "../../layouts/MainLayout.astro"
4
+ ---
5
+ import SlimBanner from '../../components/SlimBanner.vue'
6
+
7
+ ## SlimBanner
8
+
9
+ SlimBanner - solidarity with Ukraine.
10
+
11
+ <div class="component-preview">
12
+ <SlimBanner
13
+ class="w-full"
14
+ client:load
15
+ showCloseButton
16
+ transition:name="slim-banner"
17
+ transition:persist
18
+ />
19
+ </div>
20
+
21
+ ```js
22
+ <SlimBanner
23
+ class="w-full"
24
+ client:load
25
+ showCloseButton
26
+ transition:name="slim-banner"
27
+ transition:persist
28
+ />
29
+ ```
@@ -1,20 +1,20 @@
1
- ---
2
- title: "Table"
3
- layout: "../../layouts/MainLayout.astro"
4
-
5
- ---
6
-
7
- import MainTable from '../../components/MainTable.vue'
8
-
9
-
10
- ## Primary table
11
-
12
- <div class="component-preview">
13
- <MainTable></MainTable>
14
- </div>
15
-
16
- ### Code
17
-
18
- ```ts
19
- <MainTable :data="data"></MainTable>
20
- ```
1
+ ---
2
+ title: "Table"
3
+ layout: "../../layouts/MainLayout.astro"
4
+
5
+ ---
6
+
7
+ import MainTable from '../../components/MainTable.vue'
8
+
9
+
10
+ ## Primary table
11
+
12
+ <div class="component-preview">
13
+ <MainTable></MainTable>
14
+ </div>
15
+
16
+ ### Code
17
+
18
+ ```ts
19
+ <MainTable :data="data"></MainTable>
20
+ ```
@@ -1,8 +1,8 @@
1
- ---
2
- layout: ../../layouts/MainLayout.astro
3
- ---
4
-
5
- import MainColors from '../../components/MainColors.vue';
6
-
7
- <h1>Colors</h1>
8
- <MainColors />
1
+ ---
2
+ layout: ../../layouts/MainLayout.astro
3
+ ---
4
+
5
+ import MainColors from '../../components/MainColors.vue';
6
+
7
+ <h1>Colors</h1>
8
+ <MainColors />
@@ -1,68 +1,74 @@
1
- ---
2
- title: Introduction
3
- description: Docs intro
4
- layout: ../../layouts/MainLayout.astro
5
- ---
6
-
7
- # Spoko Design System Theme
8
-
9
- Astro Design System is the easiest way to start your our design system. Since Astro is compatible with many frameworks, you can import your components and document them right in the markdown files.
10
-
11
- ## Getting started
12
-
13
- ### Adding new sections
14
-
15
- Although it's not required, you can create folders for new sections.
16
-
17
- To show the section on the left side navigation, add it to the navigation config file at `src/config.ts`.
18
-
19
- Example:
20
-
21
- ```js
22
- export const SIDEBAR = [
23
- { text: "Core", header: true },
24
- { text: "Introduction", link: "/core/introduction" },
25
- ...,
26
- { text: "Components", header: true },
27
- { text: "Buttons", link: "/components/buttons" },
28
- ...,
29
- { text: "New section", header: true },
30
- { text: "New component", link: "/new-section/new-component.md" },
31
- ];
32
- ```
33
-
34
- ### Adding new pages
35
-
36
- To add new pages just create an .astro or markdown file in `src/pages/[section]/my-page.md`. Remember to add it to the navigation config in `src/config.ts` so it shows up in the left side navigation.
37
-
38
- You're free to organize the pages however you want.
39
-
40
- ### Customizing Core section (colors, typography, shadows...)
41
-
42
- If you want to customize the default colors, typography or shadows you can find the configuration file at `src/config/design.config.ts`.
43
-
44
- Feel free to add new pages to the Core section
45
-
46
- ### Customizing the page layout
47
-
48
- You can find the css for the pages in `src/styles/content.scss`.
49
-
50
- ### Adding your components
51
-
52
- Astro is great for design systems because it allows you to import components from different frameworks like react, vue or svelte.
53
-
54
- To get started check how the `MainButton` component is used in the `src/pages/en/buttons.md` file.
55
-
56
- You can import your component library or create your own and document it easily.
57
-
58
- ### `.component-preview` utility
59
-
60
- There's a class called `.component-preview` that you can use to wrap your component in a grid, and it will look like this:
61
-
62
- <div class="component-preview">
63
- <button class="text-white bg-blue-500 px-4 py-2 rounded-md">Your component</button>
64
- </div>
65
-
66
- ### Have fun!
67
-
68
- Spoko Design System template was made by **[@spokospace](https://spoko.space)** for personal and commercial use.
1
+ ---
2
+ title: Introduction
3
+ description: Docs intro
4
+ layout: ../../layouts/MainLayout.astro
5
+ ---
6
+
7
+ # Spoko Design System Theme
8
+
9
+ SDS is the easiest way to start with some my websites.
10
+ Since Astro is compatible with many frameworks, we can import components and document them right in the markdown files.
11
+
12
+ The project is still in the development phase, use at your own risk ;-)
13
+
14
+ The project is still in the development phase, use at your own risk ;-)
15
+
16
+ ## Getting started
17
+
18
+ ### Adding new sections
19
+
20
+ Although it's not required, you can create folders for new sections.
21
+
22
+ To show the section on the left side navigation, add it to the navigation config file at `src/config.ts`.
23
+
24
+ Example:
25
+
26
+ ```js
27
+ export const SIDEBAR = [
28
+ { text: "Core", header: true },
29
+ { text: "Introduction", link: "/core/introduction" },
30
+ ...,
31
+ { text: "Components", header: true },
32
+ { text: "Buttons", link: "/components/buttons" },
33
+ ...,
34
+ { text: "New section", header: true },
35
+ { text: "New component", link: "/new-section/new-component.md" },
36
+ ];
37
+ ```
38
+
39
+ ### Adding new pages
40
+
41
+ To add new pages just create an .astro or markdown file in `src/pages/[section]/my-page.md`. Remember to add it to the navigation config in `src/config.ts` so it shows up in the left side navigation.
42
+
43
+ You're free to organize the pages however you want.
44
+
45
+ ### Customizing Core section (colors, typography, shadows...)
46
+
47
+ If you want to customize the default colors, typography or shadows you can find the configuration file at `src/design.config.ts`. I think I have prepared enough shades of blue ;-)
48
+
49
+ Feel free to add new pages to the Core section
50
+
51
+ ### Customizing the page layout
52
+
53
+ You can find the css for the pages in `src/styles/content.scss`.
54
+
55
+ ### Adding mew components
56
+
57
+ Astro is great for design systems because it allows you to import components from different frameworks like react, vue or svelte.
58
+
59
+ To get started check how the `Button` component is used in the `src/pages/buttons.mdx` file.
60
+
61
+ You can import your component library or create your own and document it easily.
62
+
63
+
64
+ ### `.component-preview` utility
65
+
66
+ There's a class called `.component-preview` that you can use to wrap your component in a grid, and it will look like this:
67
+
68
+ <div class="component-preview">
69
+ <button class="text-white bg-blue-500 px-4 py-2 rounded-md">Your component</button>
70
+ </div>
71
+
72
+ ### Have fun!
73
+
74
+ Spoko Design System template was made by **[@spokospace](https://spoko.space)** for personal and commercial use.
@@ -1,21 +1,21 @@
1
- ---
2
- import MainLayout from '../../layouts/MainLayout.astro';
3
- import { SHADOWS } from '../../design.config'
4
-
5
- ---
6
-
7
- <MainLayout>
8
- <h1>Shadows</h1>
9
- <div class="component-preview">
10
- <div class="inline-grid grid-cols-2 gap-16">
11
- {SHADOWS.types.map(({name, value}) => (
12
- <div class="p-2 bg-white rounded-md text-slate-500 text-right pt-16 pl-24 font-mono" style={"box-shadow: " + value}>{name}</div>
13
- ))}
14
- </div>
15
- </div>
16
- <pre class="astro-code bg-slate-800 text-white">
17
- {SHADOWS.types.map(({name, value}) => (
18
- <div class="my-2">{`${name}: ${value}`}</div>
19
- ))}
20
- </pre>
1
+ ---
2
+ import MainLayout from '../../layouts/MainLayout.astro';
3
+ import { SHADOWS } from '../../design.config'
4
+
5
+ ---
6
+
7
+ <MainLayout>
8
+ <h1>Shadows</h1>
9
+ <div class="component-preview">
10
+ <div class="inline-grid grid-cols-2 gap-16">
11
+ {SHADOWS.types.map(({name, value}) => (
12
+ <div class="p-2 bg-white rounded-md text-slate-500 text-right pt-16 pl-24 font-mono" style={"box-shadow: " + value}>{name}</div>
13
+ ))}
14
+ </div>
15
+ </div>
16
+ <pre class="astro-code bg-slate-800 text-white">
17
+ {SHADOWS.types.map(({name, value}) => (
18
+ <div class="my-2">{`${name}: ${value}`}</div>
19
+ ))}
20
+ </pre>
21
21
  </MainLayout>
@@ -1,47 +1,47 @@
1
- ---
2
- import MainLayout from '../../layouts/MainLayout.astro'
3
- import { TYPOGRAPHY } from '../../design.config'
4
- import { FONTS } from '../../design.config'
5
- const getStyle = (item) => {
6
- return `font-size: ${item.size}; font-weight: ${item.weight};`
7
- }
8
- ---
9
-
10
- <MainLayout>
11
- <h1>Typography</h1>
12
- <div class="w-full">
13
- {
14
- TYPOGRAPHY.scale.map((item) => (
15
- <div class="mt-6 border-t py-4">
16
- <p style={getStyle(item)}>Hello world</p>
17
- <div class="flex gap-6 text-slate-500 font-mono">
18
- <span>{item.name}</span>
19
- <span>weight: {item.weight}</span>
20
- <span>size: {item.size}</span>
21
- </div>
22
- </div>
23
- ))
24
- }
25
- </div>
26
-
27
-
28
-
29
- <h1>Fonts</h1>
30
- <div class="component-preview ">
31
- <div class="flex flex-wrap gap-16">
32
- {FONTS.types.map(({name, value}) => (
33
- <div class="w-full">
34
- <div class={`${value} text-3xl`} >Lorem Ipsum</div>
35
- <div class="">{name}</div>
36
- </div>
37
- ))}
38
- </div>
39
- </div>
40
-
41
- <pre class="astro-code bg-slate-800 text-white">
42
- {FONTS.types.map(({name, value}) => (
43
- <div class="my-5">{`${name}:`}<br><pre>{value}</pre></div>
44
- ))}
45
- </pre>
46
-
1
+ ---
2
+ import MainLayout from '../../layouts/MainLayout.astro'
3
+ import { TYPOGRAPHY } from '../../design.config'
4
+ import { FONTS } from '../../design.config'
5
+ const getStyle = (item) => {
6
+ return `font-size: ${item.size}; font-weight: ${item.weight};`
7
+ }
8
+ ---
9
+
10
+ <MainLayout>
11
+ <h1>Typography</h1>
12
+ <div class="w-full">
13
+ {
14
+ TYPOGRAPHY.scale.map((item) => (
15
+ <div class="mt-6 border-t py-4">
16
+ <p style={getStyle(item)}>Hello world</p>
17
+ <div class="flex gap-6 text-slate-500 font-mono">
18
+ <span>{item.name}</span>
19
+ <span>weight: {item.weight}</span>
20
+ <span>size: {item.size}</span>
21
+ </div>
22
+ </div>
23
+ ))
24
+ }
25
+ </div>
26
+ <div class="font-novamono"></div>
27
+
28
+
29
+ <h1>Fonts</h1>
30
+ <div class="component-preview ">
31
+ <div class="flex flex-wrap gap-16">
32
+ {FONTS.types.map(({name, value}) => (
33
+ <div class="w-full">
34
+ <div class={`${value} text-3xl`} >Lorem Ipsum</div>
35
+ <div class="">{name}</div>
36
+ </div>
37
+ ))}
38
+ </div>
39
+ </div>
40
+
41
+ <pre class="astro-code bg-slate-800 text-white">
42
+ {FONTS.types.map(({name, value}) => (
43
+ <div class="my-5">{`${name}:`}<br><pre>{value}</pre></div>
44
+ ))}
45
+ </pre>
46
+
47
47
  </MainLayout>