spoko-design-system 0.0.2 → 0.0.6

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 (50) hide show
  1. package/.astro/icon.d.ts +10291 -2199
  2. package/.vscode/extensions.json +2 -1
  3. package/.vscode/settings.json +6 -0
  4. package/Layout/Header.astro +3 -3
  5. package/README.md +38 -13
  6. package/astro.config.mjs +24 -18
  7. package/package.json +79 -75
  8. package/public/favicon.ico +0 -0
  9. package/public/favicon.svg +0 -0
  10. package/public/locales/en/translation.json +5 -2
  11. package/public/locales/pl/translation.json +5 -2
  12. package/src/components/Badge.vue +1 -1
  13. package/src/components/Badges.vue +1 -1
  14. package/src/components/Button.vue +17 -8
  15. package/src/components/ButtonCopy.vue +52 -0
  16. package/src/components/Card.astro +25 -0
  17. package/src/components/HandDrive.astro +0 -1
  18. package/src/components/Header/Header.astro +1 -1
  19. package/src/components/Headline.vue +37 -5
  20. package/src/components/Image.astro +30 -0
  21. package/src/components/Jumbatron.vue +23 -8
  22. package/src/components/LeftSidebar.astro +9 -8
  23. package/src/components/PrCode.vue +156 -0
  24. package/src/components/ProductNumber.astro +117 -0
  25. package/src/components/ProductTile.astro +54 -0
  26. package/src/components/layout/Header.astro +1 -1
  27. package/src/config.ts +4 -1
  28. package/src/layouts/Layout.astro +0 -8
  29. package/src/layouts/MainLayout.astro +6 -14
  30. package/src/pages/components/badges.mdx +39 -7
  31. package/src/pages/components/breadcrumbs.mdx +37 -1
  32. package/src/pages/components/buttons.mdx +92 -11
  33. package/src/pages/components/card.mdx +94 -0
  34. package/src/pages/components/flags.mdx +15 -7
  35. package/src/pages/components/hand-drive.mdx +6 -1
  36. package/src/pages/components/headline.mdx +20 -3
  37. package/src/pages/components/icons.astro +23 -21
  38. package/src/pages/components/image.mdx +502 -0
  39. package/src/pages/components/jumbatron.mdx +33 -10
  40. package/src/pages/components/modal.mdx +8 -2
  41. package/src/pages/components/post-header.mdx +24 -2
  42. package/src/pages/components/pr-code.mdx +41 -0
  43. package/src/pages/components/product-number.mdx +65 -0
  44. package/src/pages/components/product-tile.mdx +39 -0
  45. package/src/pages/components/table.mdx +19 -0
  46. package/src/pages/core/introduction.mdx +3 -3
  47. package/src/pages/index.astro +25 -22
  48. package/src/styles/base/_base.scss +8 -0
  49. package/src/styles/content.scss +17 -1
  50. package/uno.config.ts +26 -7
@@ -3,6 +3,9 @@ title: "Buttons"
3
3
  layout: "../../layouts/MainLayout.astro"
4
4
  ---
5
5
  import Button from '../../components/Button.vue'
6
+ import ButtonCopy from '../../components/ButtonCopy.vue'
7
+ import { Icon } from 'astro-icon/components';
8
+ import { t } from "i18next";
6
9
 
7
10
  ## All buttons
8
11
 
@@ -13,27 +16,34 @@ Find the code for this page in the `src/pages/components/buttons.md` file.
13
16
  <div class="component-preview">
14
17
  <Button primary>Primary</Button>
15
18
  <Button secondary>Secondary</Button>
16
- <Button text>Text</Button>
17
- <Button tag>Text</Button>
19
+ <Button tertiary>Tertiary</Button>
20
+
21
+ <Button text medium>Text</Button>
22
+ <Button tag small>Tag Name</Button>
18
23
  </div>
19
24
 
20
25
  ```js
21
- <Button primary>Primary</Button>
22
- <Button secondary>Secondary</Button>
23
- <Button text>Text</Button>
24
- <Button tag>Text</Button>
26
+ <Button primary>Primary</Button>
27
+ <Button secondary>Secondary</Button>
28
+ <Button tertiary>Tertiary</Button>
29
+ <Button text medium>Text</Button>
30
+ <Button tag small>Tag Name</Button>
25
31
  ```
26
32
 
27
- ## Primary button
33
+ ## Primary button `<button>`
28
34
 
29
35
  We use the primary button for main actions like saving a form or creating a new item.
30
36
 
31
37
  <div class="component-preview">
32
- <Button primary>Primary button</Button>
38
+ <Button primary>Primary</Button>
39
+ <Button primary medium>Primary</Button>
40
+ <Button primary small>Primary</Button>
33
41
  </div>
34
42
 
35
43
  ```js
36
- <Button primary>Primary button</Button>
44
+ <Button primary>Primary</Button>
45
+ <Button primary medium>Primary</Button>
46
+ <Button primary small>Primary</Button>
37
47
  ```
38
48
 
39
49
  ## Secondary button
@@ -42,11 +52,15 @@ Secondary buttons accompany primary buttons to provide additional actions.
42
52
  For example, cancel buttons are secondary buttons.
43
53
 
44
54
  <div class="component-preview">
45
- <Button secondary>Secondary button</Button>
55
+ <Button secondary>Secondary</Button>
56
+ <Button secondary medium>Secondary</Button>
57
+ <Button secondary small>Secondary</Button>
46
58
  </div>
47
59
 
48
60
  ```js
49
- <Button secondary>Secondary button</Button>
61
+ <Button secondary>Secondary</Button>
62
+ <Button secondary medium>Secondary</Button>
63
+ <Button secondary small>Secondary</Button>
50
64
  ```
51
65
 
52
66
  ## Text button
@@ -55,8 +69,75 @@ Text buttons are used for actions that do not require a primary or secondary but
55
69
 
56
70
  <div class="component-preview">
57
71
  <Button text>Text button</Button>
72
+ <Button text>Text button</Button>
73
+ <Button text>Text button</Button>
58
74
  </div>
59
75
 
60
76
  ```js
61
77
  <Button text>Text button</Button>
62
78
  ```
79
+
80
+ ## Link tertiary
81
+
82
+ <div class="component-preview">
83
+
84
+ <Button tertiary>Tertiary</Button>
85
+ <Button tertiary medium>Tertiary</Button>
86
+ <Button tertiary small>Tertiary</Button>
87
+
88
+ </div>
89
+
90
+ ```html
91
+ <Button tertiary>Tertiary</Button>
92
+ <Button tertiary medium>Tertiary</Button>
93
+ <Button tertiary small>Tertiary</Button>
94
+ ```
95
+
96
+ ## Tertiary with icon
97
+ <div class="component-preview">
98
+ <Button tertiary href="#">
99
+ Read more
100
+ <Icon name="flowbite:arrow-right-outline" class="ml-2 text-2xl -my-1 -mr-1" />
101
+ </Button>
102
+
103
+ <Button tertiary href="#" medium>
104
+ Read more
105
+ <Icon name="flowbite:arrow-right-outline" class="ml-2 text-2xl -my-1 -mr-1" />
106
+ </Button>
107
+
108
+ <Button tertiary href="#" small class="px-5">
109
+ Read more
110
+ <Icon name="flowbite:arrow-right-outline" class="ml-2 text-2xl -my-1 -mr-1" />
111
+ </Button>
112
+ </div>
113
+
114
+ ```html
115
+ <Button tertiary href="#">
116
+ Read more
117
+ <Icon name="flowbite:arrow-right-outline" class="ml-2 text-2xl -my-1 -mr-1" />
118
+ </Button>
119
+
120
+ <Button tertiary href="#" medium>
121
+ Read more
122
+ <Icon name="flowbite:arrow-right-outline" class="ml-2 text-2xl -my-1 -mr-1" />
123
+ </Button>
124
+
125
+ <Button tertiary href="#" small class="px-5">
126
+ Read more
127
+ <Icon name="flowbite:arrow-right-outline" class="ml-2 text-2xl -my-1 -mr-1" />
128
+ </Button>
129
+
130
+ ```
131
+
132
+
133
+ ## Link button `<a>`
134
+
135
+ Text buttons are used for actions that do not require a primary or secondary button.
136
+
137
+ <div class="component-preview">
138
+ <Button primary href="#" title="Title">Text button</Button>
139
+ </div>
140
+
141
+ ```js
142
+ <Button primary href="#" title="Title">Text button</Button>
143
+ ```
@@ -0,0 +1,94 @@
1
+ ---
2
+ title: "Card"
3
+ layout: "../../layouts/MainLayout.astro"
4
+ ---
5
+ import Button from '../../components/Button.vue';
6
+ import Card from '../../components/Card.astro'
7
+ import { Icon } from 'astro-icon/components';
8
+ import Image from '../../components/Image.astro'
9
+
10
+ ## Card
11
+
12
+ Card - product link component which can be used for carousels, section with related products, recently added etc.
13
+
14
+ <div class="component-preview">
15
+ <div class="grid grid-cols-3 gap-8 w-full" itemscope itemtype="https://schema.org/ItemList">
16
+ <Card imgAlt="Image Alt" imgSrc="https://img.freepik.com/free-photo/beautiful-green-landscape-with-plantations-trees-cloudy-sky_181624-42918.jpg?w=826&t=st=1706315168~exp=1706315768~hmac=ed7872d0924dbda4322a3d346eef282edd77db3673fc209c933b02e37c29f9ac" >
17
+ <a href="#">
18
+ <h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white leading-none">Lorem Ipsum</h5>
19
+ </a>
20
+ <p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
21
+ Magna magna mollit esse incididunt deserunt eiusmod ad id ullamco cupidatat laborum enim nostrud. Irure officia occaecat adipisicing amet labore et incididunt exercitation. Consequat aliqua excepteur duis dolore cupidatat.
22
+ </p>
23
+
24
+ <div class="flex items-center justify-between my-4">
25
+ <span class="text-2xl font-bold text-gray-900 dark:text-white">€599.00</span>
26
+ </div>
27
+
28
+ <Button tertiary small href="#">
29
+ Read more
30
+ <Icon name="flowbite:arrow-right-outline" class="ml-2 text-2xl leading-none" />
31
+ </Button>
32
+ </Card>
33
+
34
+ <Card imgAlt="Image Alt" imgSrc="https://img.freepik.com/free-photo/beautiful-green-landscape-with-plantations-trees-cloudy-sky_181624-42918.jpg?w=826&t=st=1706315168~exp=1706315768~hmac=ed7872d0924dbda4322a3d346eef282edd77db3673fc209c933b02e37c29f9ac" >
35
+ <a href="#">
36
+ <h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white leading-none">Lorem Ipsum</h5>
37
+ </a>
38
+ <p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
39
+ Magna magna mollit esse incididunt deserunt eiusmod ad id ullamco cupidatat laborum enim nostrud. Irure officia occaecat adipisicing amet labore et incididunt exercitation. Consequat aliqua excepteur duis dolore cupidatat.
40
+ </p>
41
+
42
+ <div class="flex items-center justify-between my-4">
43
+ <span class="text-2xl font-bold text-gray-900 dark:text-white">€599.00</span>
44
+ </div>
45
+
46
+ <Button tertiary small href="#">
47
+ Read more
48
+ <Icon name="flowbite:arrow-right-outline" class="ml-2 text-2xl leading-none" />
49
+ </Button>
50
+ </Card>
51
+
52
+ <Card imgAlt="Image Alt" imgSrc="https://img.freepik.com/free-photo/beautiful-green-landscape-with-plantations-trees-cloudy-sky_181624-42918.jpg?w=826&t=st=1706315168~exp=1706315768~hmac=ed7872d0924dbda4322a3d346eef282edd77db3673fc209c933b02e37c29f9ac" >
53
+ <a href="#">
54
+ <h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white leading-none">Lorem Ipsum</h5>
55
+ </a>
56
+ <p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
57
+ Magna magna mollit esse incididunt deserunt eiusmod ad id ullamco cupidatat laborum enim nostrud. Irure officia occaecat adipisicing amet labore et incididunt exercitation. Consequat aliqua excepteur duis dolore cupidatat.
58
+ </p>
59
+
60
+ <div class="flex items-center justify-between my-4">
61
+ <span class="text-2xl font-bold text-gray-900 dark:text-white">€599.00</span>
62
+ </div>
63
+
64
+ <Button tertiary small href="#">
65
+ Read more
66
+ <Icon name="flowbite:arrow-right-outline" class="ml-2 text-2xl leading-none" />
67
+ </Button>
68
+ </Card>
69
+ </div>
70
+ </div>
71
+
72
+ ```html
73
+ <div class="grid grid-cols-3 gap-8 w-full" itemscope itemtype="https://schema.org/ItemList">
74
+ <Card imgAlt="Image Alt" imgSrc="https://img.freepik.com/free-photo/beautiful-green-landscape-with-plantations-trees-cloudy-sky_181624-42918.jpg?w=826&t=st=1706315168~exp=1706315768~hmac=ed7872d0924dbda4322a3d346eef282edd77db3673fc209c933b02e37c29f9ac" >
75
+ <a href="#">
76
+ <h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white leading-none">Lorem Ipsum</h5>
77
+ </a>
78
+ <p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
79
+ Magna magna mollit esse incididunt deserunt eiusmod ad id ullamco cupidatat laborum enim nostrud. Irure officia occaecat adipisicing amet labore et incididunt exercitation. Consequat aliqua excepteur duis dolore cupidatat.
80
+ </p>
81
+
82
+ <div class="flex items-center justify-between my-4">
83
+ <span class="text-2xl font-bold text-gray-900 dark:text-white">€599.00</span>
84
+ </div>
85
+
86
+ <Button tertiary small href="#">
87
+ Read more
88
+ <Icon name="flowbite:arrow-right-outline" class="ml-2 text-2xl leading-none" />
89
+ </Button>
90
+ </Card>
91
+ </div>
92
+ ```
93
+
94
+
@@ -27,15 +27,23 @@ Flags based on CSS (UnoCSS) classes only.
27
27
  <FlagUA />
28
28
  ```
29
29
 
30
- ## Circle icon flags
30
+ ## Circle icon flags with shadow
31
31
  <div class="component-preview">
32
- <Icon name="circle-flags:pl" />
33
- <Icon name="circle-flags:uk" />
34
- <Icon name="circle-flags:ua" />
32
+ <div class="bg-white p-6 columns-8 md:columns-16 w-full">
33
+ <Icon name="circle-flags:pl" class="shadow-md rounded-full" />
34
+ <Icon name="circle-flags:fi" class="shadow-md rounded-full" />
35
+ <Icon name="circle-flags:nl" class="shadow-md rounded-full" />
36
+ <Icon name="circle-flags:no" class="shadow-md rounded-full" />
37
+ <Icon name="circle-flags:ua" class="shadow-md rounded-full" />
38
+ <Icon name="circle-flags:uk" class="shadow-md rounded-full" />
39
+ </div>
35
40
  </div>
36
41
 
37
42
  ```js
38
- <Icon name="circle-flags:pl" />
39
- <Icon name="circle-flags:uk" />
40
- <Icon name="circle-flags:ua" />
43
+ <Icon name="circle-flags:pl" class="shadow-md rounded-full" />
44
+ <Icon name="circle-flags:fi" class="shadow-md rounded-full" />
45
+ <Icon name="circle-flags:nl" class="shadow-md rounded-full" />
46
+ <Icon name="circle-flags:no" class="shadow-md rounded-full" />
47
+ <Icon name="circle-flags:ua" class="shadow-md rounded-full" />
48
+ <Icon name="circle-flags:uk" class="shadow-md rounded-full" />
41
49
  ```
@@ -4,10 +4,15 @@ layout: "../../layouts/MainLayout.astro"
4
4
  ---
5
5
  import HandDrive from '../../components/HandDrive.astro'
6
6
 
7
+
7
8
  ## HandDrive
9
+ RHD (right-hand drive) and LHD (left-hand drive) badges.
10
+ - https://en.wikipedia.org/wiki/Left-_and_right-hand_traffic
11
+
12
+ #### import:
8
13
 
9
14
  ```js
10
- import HandDrive from '../../components/HandDrive.astro'
15
+ import HandDrive from 'spoko-design-system/src/components/HandDrive.astro'
11
16
  ```
12
17
 
13
18
 
@@ -20,7 +20,7 @@ Thanks to this, I can make a header that always looks the same, regardless of wh
20
20
  import Headline from 'spoko-design-system/src/components/Headline.vue';
21
21
  ```
22
22
 
23
- ## parameters
23
+ ## settings (parameters)
24
24
  ```js
25
25
  as: {
26
26
  type: String as PropType<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span'>,
@@ -52,12 +52,12 @@ textSize: {
52
52
  #### Headline H2
53
53
 
54
54
  <div class="component-preview">
55
- <Headline as="h2"><Icon name="ph:cat-thin" class="inline-block mb-0 sm:mb-2.5 md:mb-0 md:(mr-4) text-blue-wrc" aria-hidden="true" />Lorem Ipsum</Headline>
55
+ <Headline as="h2"><Icon name="ph:cat-thin" class="inline-block mb-0 sm:mb-2.5 md:mb-0 md:(mr-4)" aria-hidden="true" />Lorem Ipsum</Headline>
56
56
  </div>
57
57
 
58
58
  ```js
59
59
  <Headline as="h2">
60
- <Icon name="ph:cat-thin" class="mb-0 sm:mb-2.5 md:mb-0 md:(mr-4) text-blue-wrc" aria-hidden="true" />
60
+ <Icon name="ph:cat-thin" class="mb-0 sm:mb-2.5 md:mb-0 md:(mr-4)" aria-hidden="true" />
61
61
  Lorem Ipsum
62
62
  </Headline>
63
63
 
@@ -127,3 +127,20 @@ textSize: {
127
127
  </Headline>
128
128
 
129
129
  ```
130
+
131
+
132
+ #### Headline with underline
133
+
134
+ <div class="component-preview">
135
+ <Headline as="h1" text-size="4xl" underline><Icon name="ph:cat-thin" class="inline-block text-4xl mb-0 sm:mb-2.5 md:mb-0 md:(mr-4) text-4xl text-blue-wrc" aria-hidden="true" />Lorem Ipsum</Headline>
136
+ </div>
137
+
138
+ ```js
139
+ <Headline as="h1" text-size="4xl" icon-color="blue-wrc" underline>
140
+ <Icon name="ph:cat-thin" class="inline-block text-4xl mb-0 sm:mb-2.5 md:mb-0 md:(mr-4) text-4xl text-blue-wrc" aria-hidden="true" />
141
+ Lorem Ipsum
142
+ </Headline>
143
+
144
+ ```
145
+
146
+ #
@@ -1,44 +1,46 @@
1
1
  ---
2
- import MainLayout from '../../layouts/MainLayout.astro';
3
- import { Icon } from 'astro-icon/components';
2
+ import { changeLanguage } from "i18next";
3
+ import MainLayout from "../../layouts/MainLayout.astro";
4
+ import { Icon } from "astro-icon/components";
4
5
 
5
- const iconifyUrl = 'https://icon-sets.iconify.design/'
6
6
 
7
+ const iconifyUrl = "https://icon-sets.iconify.design/";
7
8
  const ICONS = {
8
- mdi: ["facebook", "instagram", "post-it-note-edit-outline"], // Loads only Material Design Icon's "account" SVG
9
- 'ant-design': ["menu-fold-outlined", "menu-unfold-outlined", "menu-outlined", "cluster-outlined", "audit-outlined", "build-twotone" ],
10
- bi: ["envelope-open", "credit-card"],
11
- bx: ["arrow-back"],
12
- carbon: ["language", "checkmark", "home", "dicom-overlay"],
13
- el: ["star-empty", "star"],
14
- 'eos-icons': ["three-dots-loading"],
15
- fluent: ["share-android-24-regular"],
16
- 'fluent-emoji': ["cookie"],
17
- la: ["arrow-right", "arrow-left"],
18
- octicon: ["chevron-left-24", "x-24"],
19
- uil: ["map-marker", "envelope", "phone"]
20
- }
21
-
9
+ mdi: ["facebook", "instagram", "post-it-note-edit-outline", "car-hatchback", "car-door", "car-side", "car-windshield-outline", "car-light-alert", "car-tire-alert", "car-light-dimmed", "car-light-fog", "car-light-high", "car-parking-lights", "car-esp", "car-brake-abs", "car-horn", "engine-outline", "fan", "fan-off", "air-conditioner", "coolant-temperature", "car-brake-alert", "car-traction-control", "card-text-outline", "fuel", "oil", "hazard-lights", "credit-card-outline"],
10
+ el: ["star-empty", "star", "heart-empty", "heart", "map-marker", "fire", "quote-right", "qrcode", "car", "indent-left", "indent-right", "ok"], 'eos-icons': ["three-dots-loading", "bubble-loading", "loading", "installing"],
11
+ fluent: ["share-android-24-regular", "checkmark-24-filled", "tag-24-regular", "tag-multiple-24-regular" ],
12
+ "fluent-emoji": ["cookie", "construction", "warning", "wrench"],
13
+ la: ["arrow-right", "arrow-left", "car", "car-side"],
14
+ octicon: ["chevron-left-24", "x-24", "alert-24", "graph-24", "comment-24", "comment-discussion-24", "clock-24", "star-24", "star-fill-24", "file-media-24", "heart-24", "heart-fill-24", "project-roadmap-24", "location-24", "info-24", "mark-github-16"],
15
+ uil: ["map-marker", "envelope", "phone", "tag-alt"],
16
+ "simple-icons": ["ebay", "allegro", "volkswagen", "audi", "skoda", "seat", "whatsapp", "x", "facebook", "messenger", "instagram", "telegram"],
17
+ "icon-park-outline": ["shopping-bag", "comment", "comments", "tag-one"],
18
+ 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"]
19
+
20
+ };
22
21
  ---
23
22
 
24
23
  <MainLayout>
25
24
  <h1>Icons</h1>
25
+ <p>Astro Icon is a straightforward icon system for the Astro framework.</p>
26
+
27
+ <a href="https://www.astroicon.dev/">https://www.astroicon.dev/</a>
26
28
 
27
29
  <pre class="mt-6 astro-code bg-slate-800 text-white">import &#123; Icon &#125; from 'astro-icon/components';</pre>
28
30
  <div class="">
29
31
  {Object.keys(ICONS).map((key) => (
30
32
  <h2 class="mt-6 mx-2">
31
- <a href={`${iconifyUrl}/${key}`} target="_blank">
33
+ <a href={`${iconifyUrl}${key}/`} target="_blank">
32
34
  {key}
33
35
  </a>
34
36
  </h2>
35
- <div class="inline-grid grid-cols-4 gap-0 w-full">
37
+ <div class="inline-grid grid-cols-2 md:grid-cols-4 gap-0 w-full">
36
38
  {ICONS[key].map((value) => (
37
39
  <div class="mx-1 mb-2">
38
40
  <div class="component-preview ">
39
- <Icon name={`${key}:${value}`} />
41
+ <Icon name={`${key}:${value}`} class="text-3xl mx-auto" />
40
42
  </div>
41
- <pre class="astro-code bg-slate-800 text-white text-sm">&lt;Icon name={`${key}:${value}`} /&gt;</pre>
43
+ <pre class="astro-code bg-slate-800 text-white text-sm text-center">&lt;Icon name={`"${key}:${value}"`} /&gt;</pre>
42
44
  </div>
43
45
  ))}
44
46
  </div>