do-ui-design-system 0.0.5 → 0.0.7
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/dist/atoms/Button/Button.svelte +11 -10
- package/dist/atoms/Button/Button.svelte.d.ts +9 -8
- package/dist/atoms/Button/iProps.d.ts +0 -1
- package/dist/atoms/Icons/Icon.svelte +1 -1
- package/dist/do-theme/button.css +9 -0
- package/dist/do-theme/post-compiled.css +5 -14
- package/dist/molecules/IconButton/IconButton.svelte +13 -15
- package/dist/molecules/IconButton/IconButton.svelte.d.ts +10 -11
- package/dist/molecules/IconButton/iProps.d.ts +0 -1
- package/package.json +16 -2
|
@@ -9,17 +9,18 @@
|
|
|
9
9
|
export let type: iProps['type'] = 'button';
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
|
-
<!--
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- disabled
|
|
20
|
-
- loading
|
|
21
|
-
- type
|
|
12
|
+
<!-- @component
|
|
13
|
+
```Svelte
|
|
14
|
+
<Button color?={color} size?={size} label?={label} disabled?={disabled} loading?={loading} type?={type}/>
|
|
15
|
+
```
|
|
16
|
+
- `color?`: btn-primary | btn-secondary | btn-neutral | btn-accent, or any other tailwind color class
|
|
17
|
+
- `size?`: any tailwind size class.
|
|
18
|
+
- `label?`: string
|
|
19
|
+
- `disabled?`: boolean
|
|
20
|
+
- `loading?`: boolean
|
|
21
|
+
- `type?`: 'button' | 'submit' | 'reset'
|
|
22
22
|
-->
|
|
23
|
+
|
|
23
24
|
<button
|
|
24
25
|
{...$$restProps}
|
|
25
26
|
{type}
|
|
@@ -17,14 +17,15 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
|
17
17
|
children?: any;
|
|
18
18
|
} : {});
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* -
|
|
24
|
-
* -
|
|
25
|
-
* -
|
|
26
|
-
* -
|
|
27
|
-
* -
|
|
20
|
+
* ```Svelte
|
|
21
|
+
* <Button color?={color} size?={size} label?={label} disabled?={disabled} loading?={loading} type?={type}/>
|
|
22
|
+
* ```
|
|
23
|
+
* - `color?`: btn-primary | btn-secondary | btn-neutral | btn-accent, or any other tailwind color class
|
|
24
|
+
* - `size?`: any tailwind size class.
|
|
25
|
+
* - `label?`: string
|
|
26
|
+
* - `disabled?`: boolean
|
|
27
|
+
* - `loading?`: boolean
|
|
28
|
+
* - `type?`: 'button' | 'submit' | 'reset'
|
|
28
29
|
*/
|
|
29
30
|
declare const Button: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
30
31
|
[x: string]: any;
|
package/dist/do-theme/button.css
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.btn {
|
|
2
2
|
font-weight: 500;
|
|
3
3
|
padding: 6px 16px;
|
|
4
|
+
gap: 0.5rem;
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
.loading-spinner {
|
|
@@ -54,8 +55,16 @@
|
|
|
54
55
|
.btn-neutral:is(:disabled, [disabled], .btn-disabled):is(:disabled, [disabled], .btn-disabled) {
|
|
55
56
|
border-color: var(--do-transparent);
|
|
56
57
|
background-color: var(--do-transparent);
|
|
58
|
+
/* text-decoration: underline; */
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.btn-neutral:not(i){
|
|
57
62
|
text-decoration: underline;
|
|
58
63
|
}
|
|
64
|
+
/* .btn-neutral i{
|
|
65
|
+
text-decoration: none;
|
|
66
|
+
display: inline-block;
|
|
67
|
+
} */
|
|
59
68
|
|
|
60
69
|
.btn-accent:is(:disabled, [disabled], .btn-disabled):is(:disabled, [disabled], .btn-disabled) {
|
|
61
70
|
color: var(--color-neutral);
|
|
@@ -850,9 +850,6 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
|
|
|
850
850
|
.\!inline {
|
|
851
851
|
display: inline !important;
|
|
852
852
|
}
|
|
853
|
-
.block {
|
|
854
|
-
display: block;
|
|
855
|
-
}
|
|
856
853
|
.contents {
|
|
857
854
|
display: contents;
|
|
858
855
|
}
|
|
@@ -865,9 +862,6 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
|
|
|
865
862
|
.hidden {
|
|
866
863
|
display: none;
|
|
867
864
|
}
|
|
868
|
-
.inline-block {
|
|
869
|
-
display: inline-block;
|
|
870
|
-
}
|
|
871
865
|
.table {
|
|
872
866
|
display: table;
|
|
873
867
|
}
|
|
@@ -893,11 +887,8 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
|
|
|
893
887
|
-webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='black' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform-origin='center'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='2s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dasharray' values='0,150;42,150;42,150' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dashoffset' values='0;-16;-59' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");
|
|
894
888
|
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='black' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform-origin='center'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='2s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dasharray' values='0,150;42,150;42,150' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dashoffset' values='0;-16;-59' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");
|
|
895
889
|
}
|
|
896
|
-
.px-1 {
|
|
897
|
-
padding-inline: calc(var(--spacing) * 1);
|
|
898
|
-
}
|
|
899
|
-
.py-1\.5 {
|
|
900
|
-
padding-block: calc(var(--spacing) * 1.5);
|
|
890
|
+
.px-1\.5 {
|
|
891
|
+
padding-inline: calc(var(--spacing) * 1.5);
|
|
901
892
|
}
|
|
902
893
|
.text-2xl {
|
|
903
894
|
font-size: var(--text-2xl);
|
|
@@ -942,9 +933,6 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
|
|
|
942
933
|
.text-zinc-600 {
|
|
943
934
|
color: var(--color-zinc-600);
|
|
944
935
|
}
|
|
945
|
-
.no-underline {
|
|
946
|
-
text-decoration-line: none;
|
|
947
|
-
}
|
|
948
936
|
.underline {
|
|
949
937
|
text-decoration-line: underline;
|
|
950
938
|
}
|
|
@@ -1172,6 +1160,7 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
|
|
|
1172
1160
|
.btn {
|
|
1173
1161
|
font-weight: 500;
|
|
1174
1162
|
padding: 6px 16px;
|
|
1163
|
+
gap: 0.5rem;
|
|
1175
1164
|
}
|
|
1176
1165
|
.loading-spinner {
|
|
1177
1166
|
width: 1em;
|
|
@@ -1215,6 +1204,8 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
|
|
|
1215
1204
|
.btn-neutral:is(:disabled, [disabled], .btn-disabled):is(:disabled, [disabled], .btn-disabled) {
|
|
1216
1205
|
border-color: var(--do-transparent);
|
|
1217
1206
|
background-color: var(--do-transparent);
|
|
1207
|
+
}
|
|
1208
|
+
.btn-neutral:not(i) {
|
|
1218
1209
|
text-decoration: underline;
|
|
1219
1210
|
}
|
|
1220
1211
|
.btn-accent:is(:disabled, [disabled], .btn-disabled):is(:disabled, [disabled], .btn-disabled) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Icon from '../../atoms/
|
|
3
|
-
import Button from '../../atoms/Button/Button.svelte';
|
|
2
|
+
import {Button, Icon} from '../../atoms/index.ts';
|
|
4
3
|
import type { iProps } from './iProps.ts';
|
|
5
4
|
|
|
6
5
|
export let color: iProps['color'] = 'btn-primary';
|
|
@@ -16,32 +15,31 @@
|
|
|
16
15
|
|
|
17
16
|
<!-- @component
|
|
18
17
|
```Svelte
|
|
18
|
+
<IconButton label?={'text'} color?={'color'} size?={'size'} on:click={()=>{}} disabled?={disabled} loading?={loading} iconName?={'iconName'} iconSize?={'iconSize'} />
|
|
19
19
|
```
|
|
20
|
-
- `color
|
|
21
|
-
- `size
|
|
22
|
-
- `label
|
|
23
|
-
- `
|
|
24
|
-
|
|
25
|
-
- `
|
|
26
|
-
- `
|
|
27
|
-
- `
|
|
28
|
-
- `
|
|
29
|
-
- `iconPosition`: 'start' | 'end'
|
|
20
|
+
- `color?`: 'btn-primary' | 'btn-secondary' | 'btn-accent' | 'btn-neutral', or any Tailwind color class
|
|
21
|
+
- `size?`: any Tailwind size class
|
|
22
|
+
- `label?`: string
|
|
23
|
+
- `disabled?`: boolean
|
|
24
|
+
- `loading?`: boolean
|
|
25
|
+
- `iconName?`: any icon name from the Icon component
|
|
26
|
+
- `iconSize?`: any Tailwind text size class
|
|
27
|
+
- `iconColor?`: any tailwind color class
|
|
28
|
+
- `iconPosition?`: 'start' | 'end'
|
|
30
29
|
```
|
|
31
|
-
@endcomponent
|
|
32
30
|
-->
|
|
33
31
|
|
|
34
32
|
<Button {...$$restProps} {color} {size} {disabled} on:click>
|
|
35
33
|
|
|
36
34
|
{#if loading}
|
|
37
35
|
<span
|
|
38
|
-
class={`loading loading-spinner ${iconPosition === 'start' ? 'order-1' : 'order-2'}`}
|
|
36
|
+
class={`loading loading-spinner ${iconPosition === 'start' ? 'order-1' : 'order-2'} px-1.5`}
|
|
39
37
|
class:!inline={loading}
|
|
40
38
|
role="status"> </span
|
|
41
39
|
>
|
|
42
40
|
{:else}
|
|
43
41
|
<div class={`${iconPosition === 'start' ? 'order-1' : 'order-2'}`}>
|
|
44
|
-
<Icon name={iconName} size={iconSize} color={iconColor}
|
|
42
|
+
<Icon name={iconName} size={iconSize} color={iconColor}/>
|
|
45
43
|
</div>
|
|
46
44
|
{/if}
|
|
47
45
|
{#if label}
|
|
@@ -14,19 +14,18 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* ```Svelte
|
|
17
|
+
* <IconButton label?={'text'} color?={'color'} size?={'size'} on:click={()=>{}} disabled?={disabled} loading?={loading} iconName?={'iconName'} iconSize?={'iconSize'} />
|
|
17
18
|
* ```
|
|
18
|
-
* - `color
|
|
19
|
-
* - `size
|
|
20
|
-
* - `label
|
|
21
|
-
* - `
|
|
22
|
-
*
|
|
23
|
-
* - `
|
|
24
|
-
* - `
|
|
25
|
-
* - `
|
|
26
|
-
* - `
|
|
27
|
-
* - `iconPosition`: 'start' | 'end'
|
|
19
|
+
* - `color?`: 'btn-primary' | 'btn-secondary' | 'btn-accent' | 'btn-neutral', or any Tailwind color class
|
|
20
|
+
* - `size?`: any Tailwind size class
|
|
21
|
+
* - `label?`: string
|
|
22
|
+
* - `disabled?`: boolean
|
|
23
|
+
* - `loading?`: boolean
|
|
24
|
+
* - `iconName?`: any icon name from the Icon component
|
|
25
|
+
* - `iconSize?`: any Tailwind text size class
|
|
26
|
+
* - `iconColor?`: any tailwind color class
|
|
27
|
+
* - `iconPosition?`: 'start' | 'end'
|
|
28
28
|
* ```
|
|
29
|
-
* @endcomponent
|
|
30
29
|
*/
|
|
31
30
|
declare const IconButton: $$__sveltets_2_IsomorphicComponent<{
|
|
32
31
|
[x: string]: any;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "do-ui-design-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Design system en Svelte + Tailwind + DaisyUI",
|
|
5
5
|
"author": "Data Observatory",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"main": "./dist/index.js",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"dev": "vite dev",
|
|
9
10
|
"build": "postcss src/app.css -o src/lib/do-theme/post-compiled.css && vite build && npm run prepack",
|
|
@@ -38,7 +39,20 @@
|
|
|
38
39
|
".": {
|
|
39
40
|
"types": "./dist/index.d.ts",
|
|
40
41
|
"svelte": "./dist/index.js",
|
|
41
|
-
"import": "./dist/index.js"
|
|
42
|
+
"import": "./dist/index.js",
|
|
43
|
+
"default": "./dist/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./atoms": {
|
|
46
|
+
"types": "./dist/atoms/index.d.ts",
|
|
47
|
+
"svelte": "./dist/atoms/index.js",
|
|
48
|
+
"import": "./dist/atoms/index.js",
|
|
49
|
+
"default": "./dist/atoms/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./molecules": {
|
|
52
|
+
"types": "./dist/molecules/index.d.ts",
|
|
53
|
+
"svelte": "./dist/molecules/index.js",
|
|
54
|
+
"import": "./dist/molecules/index.js",
|
|
55
|
+
"default": "./dist/molecules/index.js"
|
|
42
56
|
}
|
|
43
57
|
},
|
|
44
58
|
"peerDependencies": {
|