spoko-design-system 1.19.0 → 1.20.0
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.
- package/.claude/settings.json +48 -48
- package/.github/dependabot.yml +11 -11
- package/.github/todo.yml +3 -3
- package/.github/workflows/claude.yml +37 -37
- package/.github/workflows/code-quality.yml +72 -72
- package/.github/workflows/deploy.yml +43 -43
- package/.husky/README.md +41 -41
- package/.husky/commit-msg +1 -1
- package/.husky/pre-commit +40 -40
- package/.prettierignore +14 -14
- package/.prettierrc +30 -30
- package/.stackblitzrc +5 -5
- package/.vscode/extensions.json +4 -4
- package/.vscode/launch.json +11 -11
- package/.vscode/settings.json +21 -21
- package/CHANGELOG.md +462 -456
- package/CLAUDE.md +268 -268
- package/LICENSE +21 -21
- package/README.md +303 -132
- package/TOOLTIPS.md +236 -236
- package/astro.config.mjs +84 -84
- package/commitlint.config.js +3 -3
- package/dev-dist/sw.js +91 -91
- package/dev-dist/workbox-c676b6d3.js +3391 -3391
- package/eslint.config.js +70 -70
- package/icon.config.ts +348 -348
- package/index.ts +78 -78
- package/package.json +160 -160
- package/public/arrow-bottom.svg +7 -7
- package/public/fonts/lg.svg +53 -53
- package/public/fonts/vwhead-bold-demo.html +549 -549
- package/public/fonts/vwhead-regular-demo.html +549 -549
- package/public/fonts/vwtext-bold-demo.html +549 -549
- package/public/fonts/vwtext-regular-demo.html +549 -549
- package/public/github.svg +3 -3
- package/public/grid_dot.svg +4 -4
- package/public/linkedin.svg +44 -44
- package/public/make-scrollable-code-focusable.js +3 -3
- package/public/pagefind.yml +3 -3
- package/public/polo.blue.svg +29 -29
- package/public/spoko.space.svg +71 -71
- package/public/twitter.svg +46 -46
- package/renovate.json +6 -6
- package/sandbox.config.json +11 -11
- package/sonar-project.properties +26 -26
- package/src/components/Category/CategoryDetails.astro +46 -18
- package/src/pages/components/badges.mdx +57 -57
- package/src/pages/components/breadcrumbs.mdx +139 -139
- package/src/pages/components/buttons.mdx +359 -359
- package/src/pages/components/card.mdx +294 -294
- package/src/pages/components/carousel.mdx +62 -62
- package/src/pages/components/copyright.mdx +42 -42
- package/src/pages/components/details-list.mdx +207 -207
- package/src/pages/components/features-list.mdx +37 -37
- package/src/pages/components/flags.mdx +49 -49
- package/src/pages/components/fuck-russia.mdx +39 -39
- package/src/pages/components/hand-drive.mdx +78 -78
- package/src/pages/components/headline.mdx +337 -337
- package/src/pages/components/image.mdx +513 -513
- package/src/pages/components/input.mdx +367 -367
- package/src/pages/components/jumbotron.mdx +530 -530
- package/src/pages/components/modal.mdx +212 -212
- package/src/pages/components/post-header.mdx +64 -64
- package/src/pages/components/pr-code.mdx +213 -213
- package/src/pages/components/product-engine.mdx +418 -418
- package/src/pages/components/product-number.mdx +58 -58
- package/src/pages/components/product-tile.mdx +51 -51
- package/src/pages/components/quote.mdx +33 -33
- package/src/pages/components/slimbanner.mdx +260 -260
- package/src/pages/components/table.mdx +108 -108
- package/src/pages/core/colors.mdx +21 -21
- package/src/pages/core/grid.mdx +193 -193
- package/src/pages/core/introduction.mdx +77 -77
- package/src/pages/core/tooltips.mdx +491 -491
- package/src/pages/patterns/introduction.mdx +60 -60
- package/src/styles/_variables.scss +70 -70
- package/tailwind.config.cjs +8 -8
- package/tsconfig.json +28 -28
- package/uno-config/index.ts +269 -269
- package/uno-config/theme/breakpoints.ts +9 -9
- package/uno-config/theme/colors.ts +65 -65
- package/uno-config/theme/dimensions.ts +17 -17
- package/uno-config/theme/effects.ts +14 -14
- package/uno-config/theme/grid.ts +10 -10
- package/uno-config/theme/index.ts +26 -26
- package/uno-config/theme/shortcuts/buttons.ts +53 -53
- package/uno-config/theme/shortcuts/components.ts +124 -124
- package/uno-config/theme/shortcuts/index.ts +20 -20
- package/uno-config/theme/shortcuts/jumbotron.ts +71 -71
- package/uno-config/theme/shortcuts/layout.ts +75 -75
- package/uno-config/theme/typography.ts +29 -29
- package/uno.config.ts +2 -2
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "DetailsList"
|
|
3
|
-
layout: "../../layouts/MainLayout.astro"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import FeaturesList from '../../components/FeaturesList.vue'
|
|
7
|
-
|
|
8
|
-
export const items = [
|
|
9
|
-
"do ad dolor exercitation dolor eu eiusmod commodo dolor aliqua deserunt aliquip reprehenderit minim. Lorem fugiat deserunt reprehenderit non velit dolore voluptate nostrud aliquip consectetur minim. Labore dolore anim excepteur sit nostrud deserunt eu occaecat.",
|
|
10
|
-
"cillum dolore cupidatat ad mollit excepteur quis. Non nisi consequat deserunt dolore laboris est culpa. Elit eu aute magna sunt cupidatat officia do adipisicing quis velit. Consectetur deserunt et pariatur ea laborum occaecat veniam proident elit anim dolor eu nostrud voluptate. Do laboris nisi pariatur ipsum est ad anim ex quis officia est ut.",
|
|
11
|
-
"dolore cupidatat ad mollit excepteur quis"
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
# Product Details Table
|
|
15
|
-
|
|
16
|
-
<div class="component-preview flex-wrap">
|
|
17
|
-
<div class="bg-white rounded-lg p-8">
|
|
18
|
-
<p class="mb-4">Dolor amet excepteur id quis ut. Nisi incididunt occaecat est officia ea do voluptate deserunt aliqua cillum duis eiusmod. Officia veniam nisi mollit exercitation consequat ex fugiat ea veniam in culpa aliquip deserunt ea. Magna elit aliqua reprehenderit anim. Ullamco do nostrud nulla consectetur dolor fugiat adipisicing adipisicing. Reprehenderit est do culpa eu non quis. Veniam anim amet excepteur in sit et eiusmod. Id amet adipisicing amet ut eiusmod et. Tempor Lorem amet aute anim magna. Do ea aute consectetur fugiat nulla laboris pariatur ad enim anim. Dolor culpa veniam aliquip amet aute sunt excepteur consectetur sit excepteur excepteur Lorem. Ipsum esse ad aute nulla eu do incididunt eiusmod nulla sunt labore id cupidatat incididunt.</p>
|
|
19
|
-
<FeaturesList items={items} caption="Main features"/>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
const items = [
|
|
25
|
-
"do ad dolor exercitation dolor eu eiusmod commodo dolor aliqua deserunt aliquip reprehenderit minim. Lorem fugiat deserunt reprehenderit non velit dolore voluptate nostrud aliquip consectetur minim. Labore dolore anim excepteur sit nostrud deserunt eu occaecat.",
|
|
26
|
-
"cillum dolore cupidatat ad mollit excepteur quis. Non nisi consequat deserunt dolore laboris est culpa. Elit eu aute magna sunt cupidatat officia do adipisicing quis velit. Consectetur deserunt et pariatur ea laborum occaecat veniam proident elit anim dolor eu nostrud voluptate. Do laboris nisi pariatur ipsum est ad anim ex quis officia est ut.",
|
|
27
|
-
"dolore cupidatat ad mollit excepteur quis"
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
### Astro:
|
|
32
|
-
```html
|
|
33
|
-
<FeaturesList items={items} caption="Main features" />
|
|
34
|
-
```
|
|
35
|
-
### Vue:
|
|
36
|
-
```html
|
|
37
|
-
<FeaturesList :items="items" caption="Main features" />
|
|
1
|
+
---
|
|
2
|
+
title: "DetailsList"
|
|
3
|
+
layout: "../../layouts/MainLayout.astro"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import FeaturesList from '../../components/FeaturesList.vue'
|
|
7
|
+
|
|
8
|
+
export const items = [
|
|
9
|
+
"do ad dolor exercitation dolor eu eiusmod commodo dolor aliqua deserunt aliquip reprehenderit minim. Lorem fugiat deserunt reprehenderit non velit dolore voluptate nostrud aliquip consectetur minim. Labore dolore anim excepteur sit nostrud deserunt eu occaecat.",
|
|
10
|
+
"cillum dolore cupidatat ad mollit excepteur quis. Non nisi consequat deserunt dolore laboris est culpa. Elit eu aute magna sunt cupidatat officia do adipisicing quis velit. Consectetur deserunt et pariatur ea laborum occaecat veniam proident elit anim dolor eu nostrud voluptate. Do laboris nisi pariatur ipsum est ad anim ex quis officia est ut.",
|
|
11
|
+
"dolore cupidatat ad mollit excepteur quis"
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
# Product Details Table
|
|
15
|
+
|
|
16
|
+
<div class="component-preview flex-wrap">
|
|
17
|
+
<div class="bg-white rounded-lg p-8">
|
|
18
|
+
<p class="mb-4">Dolor amet excepteur id quis ut. Nisi incididunt occaecat est officia ea do voluptate deserunt aliqua cillum duis eiusmod. Officia veniam nisi mollit exercitation consequat ex fugiat ea veniam in culpa aliquip deserunt ea. Magna elit aliqua reprehenderit anim. Ullamco do nostrud nulla consectetur dolor fugiat adipisicing adipisicing. Reprehenderit est do culpa eu non quis. Veniam anim amet excepteur in sit et eiusmod. Id amet adipisicing amet ut eiusmod et. Tempor Lorem amet aute anim magna. Do ea aute consectetur fugiat nulla laboris pariatur ad enim anim. Dolor culpa veniam aliquip amet aute sunt excepteur consectetur sit excepteur excepteur Lorem. Ipsum esse ad aute nulla eu do incididunt eiusmod nulla sunt labore id cupidatat incididunt.</p>
|
|
19
|
+
<FeaturesList items={items} caption="Main features"/>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
const items = [
|
|
25
|
+
"do ad dolor exercitation dolor eu eiusmod commodo dolor aliqua deserunt aliquip reprehenderit minim. Lorem fugiat deserunt reprehenderit non velit dolore voluptate nostrud aliquip consectetur minim. Labore dolore anim excepteur sit nostrud deserunt eu occaecat.",
|
|
26
|
+
"cillum dolore cupidatat ad mollit excepteur quis. Non nisi consequat deserunt dolore laboris est culpa. Elit eu aute magna sunt cupidatat officia do adipisicing quis velit. Consectetur deserunt et pariatur ea laborum occaecat veniam proident elit anim dolor eu nostrud voluptate. Do laboris nisi pariatur ipsum est ad anim ex quis officia est ut.",
|
|
27
|
+
"dolore cupidatat ad mollit excepteur quis"
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
### Astro:
|
|
32
|
+
```html
|
|
33
|
+
<FeaturesList items={items} caption="Main features" />
|
|
34
|
+
```
|
|
35
|
+
### Vue:
|
|
36
|
+
```html
|
|
37
|
+
<FeaturesList :items="items" caption="Main features" />
|
|
38
38
|
```
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "FuckRussia"
|
|
3
|
-
layout: "../../layouts/MainLayout.astro"
|
|
4
|
-
---
|
|
5
|
-
import FlagPL from '../../components/flags/FlagPL.vue'
|
|
6
|
-
import FlagUA from '../../components/flags/FlagUA.vue'
|
|
7
|
-
import { Icon } from 'astro-icon/components'
|
|
8
|
-
|
|
9
|
-
# Flags
|
|
10
|
-
Flags based on CSS (UnoCSS) classes only.
|
|
11
|
-
|
|
12
|
-
## Pure CSS flags:
|
|
13
|
-
### Flag PL
|
|
14
|
-
<div class="component-preview">
|
|
15
|
-
<FlagPL />
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
```js
|
|
19
|
-
<FlagPL />
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Flag UA
|
|
23
|
-
<div class="component-preview">
|
|
24
|
-
<FlagUA />
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
```js
|
|
28
|
-
<FlagUA />
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Circle icon flags with shadow
|
|
32
|
-
<div class="component-preview">
|
|
33
|
-
<div class="bg-white p-6 columns-8 md:columns-16 w-full rounded-full">
|
|
34
|
-
<Icon name="circle-flags:pl" class="shadow-md rounded-full" />
|
|
35
|
-
<Icon name="circle-flags:fi" class="shadow-md rounded-full" />
|
|
36
|
-
<Icon name="circle-flags:nl" class="shadow-md rounded-full" />
|
|
37
|
-
<Icon name="circle-flags:no" class="shadow-md rounded-full" />
|
|
38
|
-
<Icon name="circle-flags:ua" class="shadow-md rounded-full" />
|
|
39
|
-
<Icon name="circle-flags:uk" class="shadow-md rounded-full" />
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
```js
|
|
44
|
-
<Icon name="circle-flags:pl" class="shadow-md rounded-full" />
|
|
45
|
-
<Icon name="circle-flags:fi" class="shadow-md rounded-full" />
|
|
46
|
-
<Icon name="circle-flags:nl" class="shadow-md rounded-full" />
|
|
47
|
-
<Icon name="circle-flags:no" class="shadow-md rounded-full" />
|
|
48
|
-
<Icon name="circle-flags:ua" class="shadow-md rounded-full" />
|
|
49
|
-
<Icon name="circle-flags:uk" class="shadow-md rounded-full" />
|
|
1
|
+
---
|
|
2
|
+
title: "FuckRussia"
|
|
3
|
+
layout: "../../layouts/MainLayout.astro"
|
|
4
|
+
---
|
|
5
|
+
import FlagPL from '../../components/flags/FlagPL.vue'
|
|
6
|
+
import FlagUA from '../../components/flags/FlagUA.vue'
|
|
7
|
+
import { Icon } from 'astro-icon/components'
|
|
8
|
+
|
|
9
|
+
# Flags
|
|
10
|
+
Flags based on CSS (UnoCSS) classes only.
|
|
11
|
+
|
|
12
|
+
## Pure CSS flags:
|
|
13
|
+
### Flag PL
|
|
14
|
+
<div class="component-preview">
|
|
15
|
+
<FlagPL />
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
<FlagPL />
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Flag UA
|
|
23
|
+
<div class="component-preview">
|
|
24
|
+
<FlagUA />
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
<FlagUA />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Circle icon flags with shadow
|
|
32
|
+
<div class="component-preview">
|
|
33
|
+
<div class="bg-white p-6 columns-8 md:columns-16 w-full rounded-full">
|
|
34
|
+
<Icon name="circle-flags:pl" class="shadow-md rounded-full" />
|
|
35
|
+
<Icon name="circle-flags:fi" class="shadow-md rounded-full" />
|
|
36
|
+
<Icon name="circle-flags:nl" class="shadow-md rounded-full" />
|
|
37
|
+
<Icon name="circle-flags:no" class="shadow-md rounded-full" />
|
|
38
|
+
<Icon name="circle-flags:ua" class="shadow-md rounded-full" />
|
|
39
|
+
<Icon name="circle-flags:uk" class="shadow-md rounded-full" />
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
<Icon name="circle-flags:pl" class="shadow-md rounded-full" />
|
|
45
|
+
<Icon name="circle-flags:fi" class="shadow-md rounded-full" />
|
|
46
|
+
<Icon name="circle-flags:nl" class="shadow-md rounded-full" />
|
|
47
|
+
<Icon name="circle-flags:no" class="shadow-md rounded-full" />
|
|
48
|
+
<Icon name="circle-flags:ua" class="shadow-md rounded-full" />
|
|
49
|
+
<Icon name="circle-flags:uk" class="shadow-md rounded-full" />
|
|
50
50
|
```
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "FuckRussia"
|
|
3
|
-
layout: "../../layouts/MainLayout.astro"
|
|
4
|
-
---
|
|
5
|
-
import FuckRussia from '../../components/FuckRussia.vue'
|
|
6
|
-
|
|
7
|
-
# FuckRussia
|
|
8
|
-
|
|
9
|
-
FuckRussia - solidarity with Ukraine.
|
|
10
|
-
|
|
11
|
-
```js
|
|
12
|
-
import FuckRussia from '../../components/FuckRussia.vue'
|
|
13
|
-
```
|
|
14
|
-
####
|
|
15
|
-
|
|
16
|
-
### Animation only
|
|
17
|
-
|
|
18
|
-
<div class="component-preview">
|
|
19
|
-
<FuckRussia />
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
```js
|
|
23
|
-
<FuckRussia />
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
### Linked animation
|
|
28
|
-
|
|
29
|
-
<div class="component-preview">
|
|
30
|
-
<a href="https://polo.blue/support-ukraine/" target="_blank" rel="noopener">
|
|
31
|
-
<FuckRussia />
|
|
32
|
-
</a>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
```js
|
|
36
|
-
<a href="https://polo.blue/support-ukraine/" target="_blank" rel="noopener">
|
|
37
|
-
<FuckRussia />
|
|
38
|
-
</a>
|
|
39
|
-
```
|
|
1
|
+
---
|
|
2
|
+
title: "FuckRussia"
|
|
3
|
+
layout: "../../layouts/MainLayout.astro"
|
|
4
|
+
---
|
|
5
|
+
import FuckRussia from '../../components/FuckRussia.vue'
|
|
6
|
+
|
|
7
|
+
# FuckRussia
|
|
8
|
+
|
|
9
|
+
FuckRussia - solidarity with Ukraine.
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import FuckRussia from '../../components/FuckRussia.vue'
|
|
13
|
+
```
|
|
14
|
+
####
|
|
15
|
+
|
|
16
|
+
### Animation only
|
|
17
|
+
|
|
18
|
+
<div class="component-preview">
|
|
19
|
+
<FuckRussia />
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
<FuckRussia />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Linked animation
|
|
28
|
+
|
|
29
|
+
<div class="component-preview">
|
|
30
|
+
<a href="https://polo.blue/support-ukraine/" target="_blank" rel="noopener">
|
|
31
|
+
<FuckRussia />
|
|
32
|
+
</a>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
<a href="https://polo.blue/support-ukraine/" target="_blank" rel="noopener">
|
|
37
|
+
<FuckRussia />
|
|
38
|
+
</a>
|
|
39
|
+
```
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "HandDrive"
|
|
3
|
-
layout: "../../layouts/MainLayout.astro"
|
|
4
|
-
---
|
|
5
|
-
import HandDrive from '../../components/HandDrive.astro'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# HandDrive
|
|
9
|
-
Universal RHD (right-hand drive) and LHD (left-hand drive) component with API-first design.
|
|
10
|
-
- https://en.wikipedia.org/wiki/Left-_and_right-hand_traffic
|
|
11
|
-
|
|
12
|
-
#### Import:
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
import HandDrive from 'spoko-design-system/src/components/HandDrive.astro'
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Props
|
|
19
|
-
|
|
20
|
-
| Prop | Type | Required | Default | Description |
|
|
21
|
-
|------|------|----------|---------|-------------|
|
|
22
|
-
| `handDrive` | `'lhd' \| 'rhd'` | Yes | - | Hand drive type |
|
|
23
|
-
| `text` | `string` | No | - | Display text from API |
|
|
24
|
-
| `class` | `string` | No | - | CSS classes for styling |
|
|
25
|
-
| `biggerText` | `boolean` | No | `false` | Use larger text size |
|
|
26
|
-
| `title` | `string` | No | - | Override tooltip text |
|
|
27
|
-
|
|
28
|
-
## Examples
|
|
29
|
-
|
|
30
|
-
### LHD (Left-Hand Drive)
|
|
31
|
-
<div class="component-preview">
|
|
32
|
-
<HandDrive handDrive="lhd" text="Left-Hand Drive" />
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
```js
|
|
36
|
-
<HandDrive handDrive="lhd" text="Left-Hand Drive" />
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### RHD (Right-Hand Drive)
|
|
40
|
-
<div class="component-preview">
|
|
41
|
-
<HandDrive handDrive="rhd" text="Right-Hand Drive" />
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
<HandDrive handDrive="rhd" text="Right-Hand Drive" />
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Without Text
|
|
49
|
-
<div class="component-preview">
|
|
50
|
-
<HandDrive handDrive="lhd" />
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
<HandDrive handDrive="lhd" />
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### With Custom Styling
|
|
58
|
-
<div class="component-preview">
|
|
59
|
-
<HandDrive handDrive="lhd" text="Left-Hand Drive" class="mb-4 border rounded p-2" biggerText={true} />
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
```js
|
|
63
|
-
<HandDrive
|
|
64
|
-
handDrive="lhd"
|
|
65
|
-
text="Left-Hand Drive"
|
|
66
|
-
class="mb-4 border rounded p-2"
|
|
67
|
-
biggerText={true}
|
|
68
|
-
/>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## Design Principles
|
|
73
|
-
|
|
74
|
-
- **Universal**: No i18n dependencies, works across multiple projects
|
|
75
|
-
- **API-first**: All data comes from consistent API endpoints
|
|
76
|
-
- **Self-documenting**: 'lhd'/'rhd' values are clear in any language
|
|
77
|
-
- **Type-safe**: Strong TypeScript support with string literals
|
|
78
|
-
- **Clean**: No magic numbers or mixed value types
|
|
1
|
+
---
|
|
2
|
+
title: "HandDrive"
|
|
3
|
+
layout: "../../layouts/MainLayout.astro"
|
|
4
|
+
---
|
|
5
|
+
import HandDrive from '../../components/HandDrive.astro'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# HandDrive
|
|
9
|
+
Universal RHD (right-hand drive) and LHD (left-hand drive) component with API-first design.
|
|
10
|
+
- https://en.wikipedia.org/wiki/Left-_and_right-hand_traffic
|
|
11
|
+
|
|
12
|
+
#### Import:
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
import HandDrive from 'spoko-design-system/src/components/HandDrive.astro'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
|
|
20
|
+
| Prop | Type | Required | Default | Description |
|
|
21
|
+
|------|------|----------|---------|-------------|
|
|
22
|
+
| `handDrive` | `'lhd' \| 'rhd'` | Yes | - | Hand drive type |
|
|
23
|
+
| `text` | `string` | No | - | Display text from API |
|
|
24
|
+
| `class` | `string` | No | - | CSS classes for styling |
|
|
25
|
+
| `biggerText` | `boolean` | No | `false` | Use larger text size |
|
|
26
|
+
| `title` | `string` | No | - | Override tooltip text |
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
### LHD (Left-Hand Drive)
|
|
31
|
+
<div class="component-preview">
|
|
32
|
+
<HandDrive handDrive="lhd" text="Left-Hand Drive" />
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
<HandDrive handDrive="lhd" text="Left-Hand Drive" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### RHD (Right-Hand Drive)
|
|
40
|
+
<div class="component-preview">
|
|
41
|
+
<HandDrive handDrive="rhd" text="Right-Hand Drive" />
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
<HandDrive handDrive="rhd" text="Right-Hand Drive" />
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Without Text
|
|
49
|
+
<div class="component-preview">
|
|
50
|
+
<HandDrive handDrive="lhd" />
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
<HandDrive handDrive="lhd" />
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### With Custom Styling
|
|
58
|
+
<div class="component-preview">
|
|
59
|
+
<HandDrive handDrive="lhd" text="Left-Hand Drive" class="mb-4 border rounded p-2" biggerText={true} />
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
<HandDrive
|
|
64
|
+
handDrive="lhd"
|
|
65
|
+
text="Left-Hand Drive"
|
|
66
|
+
class="mb-4 border rounded p-2"
|
|
67
|
+
biggerText={true}
|
|
68
|
+
/>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## Design Principles
|
|
73
|
+
|
|
74
|
+
- **Universal**: No i18n dependencies, works across multiple projects
|
|
75
|
+
- **API-first**: All data comes from consistent API endpoints
|
|
76
|
+
- **Self-documenting**: 'lhd'/'rhd' values are clear in any language
|
|
77
|
+
- **Type-safe**: Strong TypeScript support with string literals
|
|
78
|
+
- **Clean**: No magic numbers or mixed value types
|