spoko-design-system 0.4.4 → 0.4.5
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/icon.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spoko-design-system",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./index.ts",
|
|
6
6
|
"module": "./index.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"spoko design system"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@algolia/client-search": "^5.20.
|
|
43
|
+
"@algolia/client-search": "^5.20.3",
|
|
44
44
|
"@astrojs/mdx": "^4.0.8",
|
|
45
45
|
"@astrojs/node": "^9.1.0",
|
|
46
46
|
"@astrojs/sitemap": "^3.2.1",
|
|
@@ -67,20 +67,20 @@
|
|
|
67
67
|
"@iconify-json/noto-v1": "^1.2.1",
|
|
68
68
|
"@iconify-json/octicon": "^1.2.4",
|
|
69
69
|
"@iconify-json/ph": "^1.2.2",
|
|
70
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
70
|
+
"@iconify-json/simple-icons": "^1.2.25",
|
|
71
71
|
"@iconify-json/system-uicons": "^1.2.2",
|
|
72
72
|
"@iconify-json/uil": "^1.2.3",
|
|
73
|
-
"@iconify/json": "^2.2.
|
|
73
|
+
"@iconify/json": "^2.2.308",
|
|
74
74
|
"@iconify/vue": "^4.3.0",
|
|
75
75
|
"@playform/compress": "^0.1.7",
|
|
76
76
|
"@playform/inline": "^0.1.1",
|
|
77
|
-
"@unocss/astro": "^
|
|
78
|
-
"@unocss/preset-attributify": "^
|
|
79
|
-
"@unocss/preset-typography": "^
|
|
80
|
-
"@unocss/preset-uno": "^
|
|
81
|
-
"@unocss/preset-web-fonts": "^
|
|
82
|
-
"@unocss/preset-wind": "^
|
|
83
|
-
"@unocss/reset": "^
|
|
77
|
+
"@unocss/astro": "^66.0.0",
|
|
78
|
+
"@unocss/preset-attributify": "^66.0.0",
|
|
79
|
+
"@unocss/preset-typography": "^66.0.0",
|
|
80
|
+
"@unocss/preset-uno": "^66.0.0",
|
|
81
|
+
"@unocss/preset-web-fonts": "^66.0.0",
|
|
82
|
+
"@unocss/preset-wind": "^66.0.0",
|
|
83
|
+
"@unocss/reset": "^66.0.0",
|
|
84
84
|
"@vite-pwa/astro": "^0.5.0",
|
|
85
85
|
"@vueuse/core": "^12.7.0",
|
|
86
86
|
"astro-i18next": "1.0.0-beta.21",
|
|
@@ -96,13 +96,13 @@
|
|
|
96
96
|
"i18next-http-backend": "^3.0.2",
|
|
97
97
|
"i18next-vue": "^5.1.0",
|
|
98
98
|
"swiper": "^11.2.4",
|
|
99
|
-
"unocss": "^
|
|
99
|
+
"unocss": "^66.0.0",
|
|
100
100
|
"vue": "^3.5.13"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@types/gtag.js": "^0.0.20",
|
|
104
104
|
"@types/node": "^22.13.4",
|
|
105
|
-
"@unocss/transformer-variant-group": "^
|
|
105
|
+
"@unocss/transformer-variant-group": "^66.0.0",
|
|
106
106
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
107
107
|
"@vue/compiler-sfc": "^3.5.13",
|
|
108
108
|
"astro": "^5.3.0",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
2
|
const props = defineProps<{
|
|
4
3
|
href?: string;
|
|
5
4
|
title?: string;
|
|
@@ -18,8 +17,16 @@ const props = defineProps<{
|
|
|
18
17
|
lightHover?: boolean;
|
|
19
18
|
mediumHover?: boolean;
|
|
20
19
|
darkHover?: boolean;
|
|
20
|
+
circle?: boolean;
|
|
21
21
|
}>();
|
|
22
22
|
|
|
23
|
+
// Check if we should add a default mediumHover for tertiary
|
|
24
|
+
const shouldAddDefaultMediumHover = props.tertiary || props.tertiaryOutline &&
|
|
25
|
+
!props.whiteHover &&
|
|
26
|
+
!props.lightHover &&
|
|
27
|
+
!props.mediumHover &&
|
|
28
|
+
!props.darkHover;
|
|
29
|
+
|
|
23
30
|
const tag = props.href && props.href.length ? 'a' : 'button'
|
|
24
31
|
const classes = {
|
|
25
32
|
"btn-primary": props.primary,
|
|
@@ -34,9 +41,10 @@ const classes = {
|
|
|
34
41
|
"btn-xs": props.small,
|
|
35
42
|
"btn-normal": !props.small && !props.medium,
|
|
36
43
|
"rounded-full": props.rounded,
|
|
44
|
+
"btn-circle": props.circle,
|
|
37
45
|
"btn-white-hover": props.whiteHover,
|
|
38
46
|
"btn-light-hover": props.lightHover,
|
|
39
|
-
"btn-medium-hover": props.mediumHover,
|
|
47
|
+
"btn-medium-hover": props.mediumHover || shouldAddDefaultMediumHover,
|
|
40
48
|
"btn-dark-hover": props.darkHover
|
|
41
49
|
};
|
|
42
50
|
</script>
|
|
@@ -61,4 +69,20 @@ const classes = {
|
|
|
61
69
|
}
|
|
62
70
|
}
|
|
63
71
|
|
|
72
|
+
/* Circle button styles */
|
|
73
|
+
.btn-circle.btn-normal {
|
|
74
|
+
@apply w-12;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.btn-circle.btn-sm {
|
|
78
|
+
@apply w-9.5;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.btn-circle.btn-xs {
|
|
82
|
+
@apply w-7;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.btn-circle svg {
|
|
86
|
+
margin: 0;
|
|
87
|
+
}
|
|
64
88
|
</style>
|
|
@@ -3,7 +3,7 @@ title: "Buttons"
|
|
|
3
3
|
layout: "../../layouts/MainLayout.astro"
|
|
4
4
|
---
|
|
5
5
|
import Button from '../../components/Button.vue'
|
|
6
|
-
import ButtonCopy from '../../components/ButtonCopy.
|
|
6
|
+
import ButtonCopy from '../../components/ButtonCopy.astro'
|
|
7
7
|
import { Icon } from 'astro-icon/components';
|
|
8
8
|
import { t } from "i18next";
|
|
9
9
|
|
|
@@ -113,34 +113,34 @@ Text buttons are used for actions that do not require a primary or secondary but
|
|
|
113
113
|
<div class="component-preview">
|
|
114
114
|
<Button tertiary href="#">
|
|
115
115
|
Read more
|
|
116
|
-
<Icon name="
|
|
116
|
+
<Icon name="la:arrow-right" class="ml-2 text-2xl -my-1 -mr-1" />
|
|
117
117
|
</Button>
|
|
118
118
|
|
|
119
119
|
<Button tertiary href="#" medium>
|
|
120
120
|
Read more
|
|
121
|
-
<Icon name="
|
|
121
|
+
<Icon name="la:arrow-right" class="ml-2 text-2xl -my-1 -mr-1" />
|
|
122
122
|
</Button>
|
|
123
123
|
|
|
124
124
|
<Button tertiary href="#" small class="px-5">
|
|
125
125
|
Read more
|
|
126
|
-
<Icon name="
|
|
126
|
+
<Icon name="la:arrow-right" class="ml-2 text-2xl -my-1 -mr-1" />
|
|
127
127
|
</Button>
|
|
128
128
|
</div>
|
|
129
129
|
|
|
130
130
|
```html
|
|
131
131
|
<Button tertiary href="#">
|
|
132
132
|
Read more
|
|
133
|
-
<Icon name="
|
|
133
|
+
<Icon name="la:arrow-right" class="ml-2 text-2xl -my-1 -mr-1" />
|
|
134
134
|
</Button>
|
|
135
135
|
|
|
136
136
|
<Button tertiary href="#" medium>
|
|
137
137
|
Read more
|
|
138
|
-
<Icon name="
|
|
138
|
+
<Icon name="la:arrow-right" class="ml-2 text-2xl -my-1 -mr-1" />
|
|
139
139
|
</Button>
|
|
140
140
|
|
|
141
141
|
<Button tertiary href="#" small class="px-5">
|
|
142
142
|
Read more
|
|
143
|
-
<Icon name="
|
|
143
|
+
<Icon name="la:arrow-right" class="ml-2 text-2xl -my-1 -mr-1" />
|
|
144
144
|
</Button>
|
|
145
145
|
|
|
146
146
|
```
|
|
@@ -251,3 +251,107 @@ Text buttons are used for actions that do not require a primary or secondary but
|
|
|
251
251
|
```js
|
|
252
252
|
<Button primary href="#" title="Title">Text button</Button>
|
|
253
253
|
```
|
|
254
|
+
|
|
255
|
+
## Circle button
|
|
256
|
+
|
|
257
|
+
Circle buttons are perfect for icon-only actions, maintaining equal width and height.
|
|
258
|
+
|
|
259
|
+
<div class="component-preview flex-wrap">
|
|
260
|
+
<div class="flex w-full gap-4 items-center">
|
|
261
|
+
<Button primary circle>
|
|
262
|
+
<Icon name="la:arrow-right" />
|
|
263
|
+
</Button>
|
|
264
|
+
<Button secondary circle>
|
|
265
|
+
<Icon name="la:arrow-right" />
|
|
266
|
+
</Button>
|
|
267
|
+
<Button tertiary circle>
|
|
268
|
+
<Icon name="la:arrow-right" />
|
|
269
|
+
</Button>
|
|
270
|
+
</div>
|
|
271
|
+
<div class="flex w-full gap-4 items-center">
|
|
272
|
+
<Button primary medium circle>
|
|
273
|
+
<Icon name="la:arrow-right" class="text-xl" />
|
|
274
|
+
</Button>
|
|
275
|
+
<Button secondary medium circle>
|
|
276
|
+
<Icon name="la:arrow-right" class="text-xl" />
|
|
277
|
+
</Button>
|
|
278
|
+
<Button tertiary medium circle>
|
|
279
|
+
<Icon name="la:arrow-right" class="text-xl" />
|
|
280
|
+
</Button>
|
|
281
|
+
</div>
|
|
282
|
+
<div class="flex w-full gap-4 items-center">
|
|
283
|
+
<Button primary small circle>
|
|
284
|
+
<Icon name="la:arrow-right" class="text-lg" />
|
|
285
|
+
</Button>
|
|
286
|
+
<Button secondary small circle>
|
|
287
|
+
<Icon name="la:arrow-right" class="text-lg" />
|
|
288
|
+
</Button>
|
|
289
|
+
<Button tertiary small circle>
|
|
290
|
+
<Icon name="la:arrow-right" class="text-lg" />
|
|
291
|
+
</Button>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
```js
|
|
296
|
+
<Button primary circle>
|
|
297
|
+
<Icon name="la:arrow-right" />
|
|
298
|
+
</Button>
|
|
299
|
+
<Button secondary circle>
|
|
300
|
+
<Icon name="la:arrow-right" />
|
|
301
|
+
</Button>
|
|
302
|
+
<Button tertiary circle>
|
|
303
|
+
<Icon name="la:arrow-right" />
|
|
304
|
+
</Button>
|
|
305
|
+
|
|
306
|
+
<Button primary medium circle>
|
|
307
|
+
<Icon name="la:arrow-right" class="text-xl" />
|
|
308
|
+
</Button>
|
|
309
|
+
<Button secondary medium circle>
|
|
310
|
+
<Icon name="la:arrow-right" class="text-xl" />
|
|
311
|
+
</Button>
|
|
312
|
+
<Button tertiary medium circle>
|
|
313
|
+
<Icon name="la:arrow-right" class="text-xl" />
|
|
314
|
+
</Button>
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
<Button primary small circle>
|
|
319
|
+
<Icon name="la:arrow-right" class="text-lg" />
|
|
320
|
+
</Button>
|
|
321
|
+
<Button secondary small circle>
|
|
322
|
+
<Icon name="la:arrow-right" class="text-lg" />
|
|
323
|
+
</Button>
|
|
324
|
+
<Button tertiary small circle>
|
|
325
|
+
<Icon name="la:arrow-right" class="text-lg" />
|
|
326
|
+
</Button>
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Circle outline buttons
|
|
330
|
+
|
|
331
|
+
Circle buttons are also available in outline variants.
|
|
332
|
+
|
|
333
|
+
<div class="component-preview">
|
|
334
|
+
<Button primary-outline circle>
|
|
335
|
+
<Icon name="la:arrow-right" class="text-2xl" />
|
|
336
|
+
</Button>
|
|
337
|
+
|
|
338
|
+
<Button secondary-outline circle>
|
|
339
|
+
<Icon name="la:arrow-right" class="text-2xl" />
|
|
340
|
+
</Button>
|
|
341
|
+
|
|
342
|
+
<Button tertiary-outline circle>
|
|
343
|
+
<Icon name="la:arrow-right" class="text-2xl" />
|
|
344
|
+
</Button>
|
|
345
|
+
</div>
|
|
346
|
+
|
|
347
|
+
```js
|
|
348
|
+
<Button primary-outline circle>
|
|
349
|
+
<Icon name="la:arrow-right" class="text-2xl" />
|
|
350
|
+
</Button>
|
|
351
|
+
<Button secondary-outline circle>
|
|
352
|
+
<Icon name="la:arrow-right" class="text-2xl" />
|
|
353
|
+
</Button>
|
|
354
|
+
<Button tertiary-outline circle>
|
|
355
|
+
<Icon name="la:arrow-right" class="text-2xl" />
|
|
356
|
+
</Button>
|
|
357
|
+
```
|
|
@@ -5,19 +5,19 @@ const { base, sizes, variants, hover } = BUTTON_STYLES
|
|
|
5
5
|
|
|
6
6
|
export const buttonShortcuts = [
|
|
7
7
|
// Base buttons
|
|
8
|
-
['btn', `px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:(cursor-default bg-gray-600 opacity-50)`],
|
|
8
|
+
['btn', `px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:(cursor-default bg-gray-600 opacity-50) ${TRANSITIONS.base}`],
|
|
9
9
|
['icon-btn', `text-[0.9em] inline-block cursor-pointer select-none opacity-75 ${TRANSITIONS.base} hover:(opacity-100 text-teal-600)`],
|
|
10
10
|
|
|
11
11
|
// Primary buttons
|
|
12
|
-
['btn-primary', `${base.layout} ${base.text} ${variants.primary.solid}`],
|
|
13
|
-
['btn-primary-outline', `${base.layout} ${base.text} ${variants.primary.outline} ${TRANSITIONS.base}`],
|
|
12
|
+
['btn-primary', `${base.layout} ${base.text} ${variants.primary.solid} ${TRANSITIONS.base}`],
|
|
13
|
+
['btn-primary-outline', `${base.layout} ${base.text} ${variants.primary.outline} ${TRANSITIONS.base} ${TRANSITIONS.base}`],
|
|
14
14
|
|
|
15
15
|
// Secondary buttons
|
|
16
|
-
['btn-secondary', `${base.layout} ${base.text} ${variants.secondary.solid}`],
|
|
17
|
-
['btn-secondary-outline', `${base.layout} ${base.text} ${variants.secondary.outline}`],
|
|
16
|
+
['btn-secondary', `${base.layout} ${base.text} ${variants.secondary.solid} ${TRANSITIONS.base}`],
|
|
17
|
+
['btn-secondary-outline', `${base.layout} ${base.text} ${variants.secondary.outline} ${TRANSITIONS.base}`],
|
|
18
18
|
|
|
19
19
|
// Tertiary buttons
|
|
20
|
-
['btn-tertiary', `${base.layout} ${base.text} ${variants.tertiary.solid}`],
|
|
20
|
+
['btn-tertiary', `${base.layout} ${base.text} ${variants.tertiary.solid} ${TRANSITIONS.base}`],
|
|
21
21
|
['btn-tertiary-outline', `${base.layout} border ${base.text} ${variants.tertiary.outline} ${TRANSITIONS.base}`],
|
|
22
22
|
|
|
23
23
|
// Utility buttons
|
|
@@ -36,6 +36,7 @@ export const buttonShortcuts = [
|
|
|
36
36
|
['btn-dark-hover', hover.dark],
|
|
37
37
|
|
|
38
38
|
// Special buttons
|
|
39
|
+
['btn-circle', `rounded-full !p-0 aspect-square inline-flex`],
|
|
39
40
|
['btn-copy', `leading-none opacity-10 hover:opacity-80 ml-auto w-6 h-6 -right-7 sm:(h-4 w-4 -right-5) ${LAYOUT.position.absolute}`],
|
|
40
41
|
['btn-copy-text', 'shadow-sm py-0.5 px-1 bg-gray-100 -ml-1 -mt-4 text-xxs whitespace-nowrap'],
|
|
41
42
|
['btn-prcode', `${LAYOUT.position.relative} inline-block text-center leading-none px-1 py-0.5 mr-1 cursor-pointer font-mono border-solid border-1 border-gray-200 select-none text-gray-500 last:mr-0 not-last:mr-2 not-last:after:content-[+] after:(text-blue-darker ${LAYOUT.position.absolute} w-4 pl-0.5)`]
|
|
@@ -63,22 +63,22 @@ export const LAYOUT = {
|
|
|
63
63
|
|
|
64
64
|
// Common transitions
|
|
65
65
|
export const TRANSITIONS = {
|
|
66
|
-
base: 'transition-all duration-
|
|
66
|
+
base: 'transition-all duration-100 ease-linear',
|
|
67
67
|
transform: 'transition-transform-300',
|
|
68
|
-
hover: 'transition duration-
|
|
68
|
+
hover: 'transition duration-100 ease-in-out',
|
|
69
69
|
} as const
|
|
70
70
|
|
|
71
71
|
// Button base styles
|
|
72
72
|
export const BUTTON_STYLES = {
|
|
73
73
|
base: {
|
|
74
74
|
layout: 'inline-flex items-center justify-center',
|
|
75
|
-
text: 'text-base font-medium text-center',
|
|
75
|
+
text: 'text-base font-medium text-center leading-4.5',
|
|
76
76
|
transition: 'transition-all duration-200 ease-in-out',
|
|
77
77
|
},
|
|
78
78
|
sizes: {
|
|
79
|
-
normal: 'md:px-10 md:py-2 md:text-lg px-8 py-3 whitespace-nowrap',
|
|
80
|
-
sm: 'px-6 py-2 text-sm whitespace-nowrap',
|
|
81
|
-
xs: 'px-4 py-1 text-sm whitespace-nowrap',
|
|
79
|
+
normal: 'md:px-10 md:py-2 md:text-lg px-8 py-3 whitespace-nowrap h-12',
|
|
80
|
+
sm: 'px-6 py-2 text-sm whitespace-nowrap h-9.5',
|
|
81
|
+
xs: 'px-4 py-1 text-sm whitespace-nowrap ',
|
|
82
82
|
},
|
|
83
83
|
variants: {
|
|
84
84
|
primary: {
|
|
@@ -110,10 +110,10 @@ export const TYPOGRAPHY = {
|
|
|
110
110
|
light: 'font-headlight font-300 tracking-tight',
|
|
111
111
|
},
|
|
112
112
|
text: {
|
|
113
|
-
xs: 'text-
|
|
114
|
-
sm: 'text
|
|
115
|
-
base: 'text-
|
|
116
|
-
lg: 'text-
|
|
113
|
+
xs: 'text-3',
|
|
114
|
+
sm: 'text 3.5',
|
|
115
|
+
base: 'text-4',
|
|
116
|
+
lg: 'text-4.5',
|
|
117
117
|
},
|
|
118
118
|
} as const
|
|
119
119
|
|