do-ui-design-system 1.1.7 → 1.1.9
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 +3 -0
- package/dist/atoms/Button/Button.svelte.d.ts +1 -0
- package/dist/atoms/Button/Button.svelte.d.ts.map +1 -1
- package/dist/atoms/Button/iProps.d.ts +2 -0
- package/dist/atoms/Button/iProps.d.ts.map +1 -1
- package/dist/atoms/Icons/iProps.d.ts +1 -1
- package/dist/atoms/Icons/iProps.d.ts.map +1 -1
- package/dist/do-theme/badge.css +12 -2
- package/dist/do-theme/chip.css +1 -2
- package/dist/do-theme/form.css +42 -0
- package/dist/do-theme/icomoon/backup-icons.json +1 -1
- package/dist/do-theme/icomoon/fonts/icomoon.eot +0 -0
- package/dist/do-theme/icomoon/fonts/icomoon.svg +10 -1
- package/dist/do-theme/icomoon/fonts/icomoon.ttf +0 -0
- package/dist/do-theme/icomoon/fonts/icomoon.woff +0 -0
- package/dist/do-theme/icomoon/iconList.d.ts +1 -1
- package/dist/do-theme/icomoon/iconList.d.ts.map +1 -1
- package/dist/do-theme/icomoon/iconList.js +10 -1
- package/dist/do-theme/icomoon/icons.css +78 -8
- package/dist/do-theme/index.css +4 -1
- package/dist/do-theme/pagination.css +9 -0
- package/dist/do-theme/table.css +138 -0
- package/dist/do-theme/var-dark.css +20 -5
- package/dist/do-theme/var-light.css +3 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/molecules/IconButton/IconButton.svelte +4 -1
- package/dist/molecules/IconButton/IconButton.svelte.d.ts +2 -1
- package/dist/molecules/IconButton/IconButton.svelte.d.ts.map +1 -1
- package/dist/molecules/IconButton/iProps.d.ts +3 -0
- package/dist/molecules/IconButton/iProps.d.ts.map +1 -1
- package/dist/molecules/Pagination/Pagination.svelte +101 -0
- package/dist/molecules/Pagination/Pagination.svelte.d.ts +15 -0
- package/dist/molecules/Pagination/Pagination.svelte.d.ts.map +1 -0
- package/dist/organisms/TableBasic/TableBasic.svelte +273 -0
- package/dist/organisms/TableBasic/TableBasic.svelte.d.ts +18 -0
- package/dist/organisms/TableBasic/TableBasic.svelte.d.ts.map +1 -0
- package/dist/organisms/index.d.ts +3 -0
- package/dist/organisms/index.d.ts.map +1 -0
- package/dist/organisms/index.js +2 -0
- package/package.json +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: 'icomoon';
|
|
3
|
-
src:
|
|
4
|
-
src:
|
|
5
|
-
url('./fonts/icomoon.ttf?
|
|
6
|
-
url('./fonts/icomoon.woff?
|
|
7
|
-
url('./fonts/icomoon.svg?
|
|
3
|
+
src: url('./fonts/icomoon.eot?ew4zhc');
|
|
4
|
+
src: url('./fonts/icomoon.eot?ew4zhc#iefix') format('embedded-opentype'),
|
|
5
|
+
url('./fonts/icomoon.ttf?ew4zhc') format('truetype'),
|
|
6
|
+
url('./fonts/icomoon.woff?ew4zhc') format('woff'),
|
|
7
|
+
url('./fonts/icomoon.svg?ew4zhc#icomoon') format('svg');
|
|
8
8
|
font-weight: normal;
|
|
9
9
|
font-style: normal;
|
|
10
10
|
font-display: block;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
[class^="icon-"],
|
|
13
|
+
[class^="icon-"],
|
|
14
|
+
[class*=" icon-"] {
|
|
14
15
|
/* use !important to prevent issues with browser extensions that change fonts */
|
|
15
16
|
font-family: 'icomoon' !important;
|
|
16
17
|
speak: never;
|
|
@@ -25,105 +26,174 @@
|
|
|
25
26
|
-moz-osx-font-smoothing: grayscale;
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
.icon-checkmark-circle-o:before {
|
|
30
|
+
content: "\e927";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.icon-check:before {
|
|
34
|
+
content: "\e925";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.icon-close-circle-o:before {
|
|
38
|
+
content: "\e926";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.icon-duplicate-o:before {
|
|
42
|
+
content: "\e928";
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.icon-pencil:before {
|
|
46
|
+
content: "\e929";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.icon-process:before {
|
|
50
|
+
content: "\e92a";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.icon-filter:before {
|
|
54
|
+
content: "\e922";
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.icon-ellipsis-vertical:before {
|
|
58
|
+
content: "\e923";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.icon-cog-sharp:before {
|
|
62
|
+
content: "\e924";
|
|
63
|
+
}
|
|
64
|
+
|
|
28
65
|
.icon-moon-o:before {
|
|
29
66
|
content: "\e91b";
|
|
30
67
|
}
|
|
68
|
+
|
|
31
69
|
.icon-sun-o:before {
|
|
32
70
|
content: "\e91c";
|
|
33
71
|
}
|
|
72
|
+
|
|
34
73
|
.icon-edit-o:before {
|
|
35
74
|
content: "\e91d";
|
|
36
75
|
}
|
|
76
|
+
|
|
37
77
|
.icon-search:before {
|
|
38
78
|
content: "\e918";
|
|
39
79
|
}
|
|
80
|
+
|
|
40
81
|
.icon-map-o:before {
|
|
41
82
|
content: "\e919";
|
|
42
83
|
}
|
|
84
|
+
|
|
43
85
|
.icon-analytics-o:before {
|
|
44
86
|
content: "\e91a";
|
|
45
87
|
}
|
|
88
|
+
|
|
46
89
|
.icon-chart:before {
|
|
47
90
|
content: "\e917";
|
|
48
91
|
}
|
|
92
|
+
|
|
49
93
|
.icon-loading:before {
|
|
50
94
|
content: "\e916";
|
|
51
95
|
}
|
|
96
|
+
|
|
52
97
|
.icon-close:before {
|
|
53
98
|
content: "\e915";
|
|
54
99
|
}
|
|
100
|
+
|
|
55
101
|
.icon-copy-o:before {
|
|
56
102
|
content: "\e914";
|
|
57
103
|
}
|
|
104
|
+
|
|
58
105
|
.icon-alert:before {
|
|
59
106
|
content: "\e90d";
|
|
60
107
|
}
|
|
108
|
+
|
|
61
109
|
.icon-eye-o:before {
|
|
62
110
|
content: "\e90e";
|
|
63
111
|
}
|
|
112
|
+
|
|
64
113
|
.icon-eye-closed-o:before {
|
|
65
114
|
content: "\e90f";
|
|
66
115
|
}
|
|
116
|
+
|
|
67
117
|
.icon-info:before {
|
|
68
118
|
content: "\e910";
|
|
69
119
|
}
|
|
120
|
+
|
|
70
121
|
.icon-layers-o:before {
|
|
71
122
|
content: "\e911";
|
|
72
123
|
}
|
|
124
|
+
|
|
73
125
|
.icon-marker:before {
|
|
74
126
|
content: "\e912";
|
|
75
127
|
}
|
|
128
|
+
|
|
76
129
|
.icon-move:before {
|
|
77
130
|
content: "\e913";
|
|
78
131
|
}
|
|
132
|
+
|
|
79
133
|
.icon-contrast:before {
|
|
80
134
|
content: "\e906";
|
|
81
135
|
}
|
|
136
|
+
|
|
82
137
|
.icon-arrow:before {
|
|
83
138
|
content: "\e907";
|
|
84
139
|
}
|
|
140
|
+
|
|
85
141
|
.icon-chevron-up-down:before {
|
|
86
142
|
content: "\e908";
|
|
87
143
|
}
|
|
144
|
+
|
|
88
145
|
.icon-chevron-down:before {
|
|
89
146
|
content: "\e909";
|
|
90
147
|
}
|
|
148
|
+
|
|
91
149
|
.icon-download:before {
|
|
92
150
|
content: "\e90a";
|
|
93
151
|
}
|
|
152
|
+
|
|
94
153
|
.icon-plus:before {
|
|
95
154
|
content: "\e90b";
|
|
96
155
|
}
|
|
156
|
+
|
|
97
157
|
.icon-trash-o:before {
|
|
98
158
|
content: "\e90c";
|
|
99
159
|
}
|
|
160
|
+
|
|
100
161
|
.icon-chain:before {
|
|
101
162
|
content: "\e900";
|
|
102
163
|
}
|
|
103
|
-
|
|
164
|
+
|
|
165
|
+
.icon-double-check:before {
|
|
104
166
|
content: "\e901";
|
|
105
167
|
}
|
|
168
|
+
|
|
106
169
|
.icon-frame-o:before {
|
|
107
170
|
content: "\e902";
|
|
108
171
|
}
|
|
172
|
+
|
|
109
173
|
.icon-database-o:before {
|
|
110
174
|
content: "\e903";
|
|
111
175
|
}
|
|
176
|
+
|
|
112
177
|
.icon-menu:before {
|
|
113
178
|
content: "\e904";
|
|
114
179
|
}
|
|
180
|
+
|
|
115
181
|
.icon-refresh:before {
|
|
116
182
|
content: "\e905";
|
|
117
183
|
}
|
|
184
|
+
|
|
118
185
|
.icon-warning:before {
|
|
119
186
|
content: "\e91e";
|
|
120
187
|
}
|
|
188
|
+
|
|
121
189
|
.icon-not-repeat:before {
|
|
122
190
|
content: "\e91f";
|
|
123
191
|
}
|
|
192
|
+
|
|
124
193
|
.icon-repeat:before {
|
|
125
194
|
content: "\e920";
|
|
126
195
|
}
|
|
196
|
+
|
|
127
197
|
.icon-navigate-o:before {
|
|
128
198
|
content: "\e921";
|
|
129
|
-
}
|
|
199
|
+
}
|
package/dist/do-theme/index.css
CHANGED
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
@import "./var-dark.css";
|
|
4
4
|
@import "./font.css";
|
|
5
5
|
@import "./icomoon/icons.css";
|
|
6
|
+
@import "./color.css";
|
|
7
|
+
@import "./form.css";
|
|
6
8
|
@import "./badge.css";
|
|
7
9
|
@import "./button.css";
|
|
8
10
|
@import "./border.css";
|
|
9
11
|
@import "./card.css";
|
|
10
12
|
@import "./chip.css";
|
|
11
|
-
@import "./
|
|
13
|
+
@import "./pagination.css";
|
|
14
|
+
@import "./table.css";
|
|
12
15
|
|
|
13
16
|
/*
|
|
14
17
|
To modify themes (light and dark):
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
.do-table {
|
|
2
|
+
.do-table__header {
|
|
3
|
+
.do-table__header__tags {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 0.5rem;
|
|
7
|
+
margin-bottom: 1rem;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.do-table__content {
|
|
12
|
+
|
|
13
|
+
width: 100%;
|
|
14
|
+
border-collapse: collapse;
|
|
15
|
+
|
|
16
|
+
thead tr {
|
|
17
|
+
background: var(--do-table-bg-head);
|
|
18
|
+
border-bottom: 1px solid #1e1e1e;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.do-table__content__th {
|
|
22
|
+
padding: 0.75rem 1rem;
|
|
23
|
+
text-align: left;
|
|
24
|
+
font-size: 1rem;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
user-select: none;
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
transition: color 0.15s;
|
|
30
|
+
color: #ffffff;
|
|
31
|
+
|
|
32
|
+
.do-table__content__th__sort {
|
|
33
|
+
display: inline-block;
|
|
34
|
+
font-size: 0.8rem;
|
|
35
|
+
margin-left: 4px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.do-table__content__th__sort--up {
|
|
39
|
+
transform: rotate(180deg);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.do-table__content__th:hover {
|
|
43
|
+
color: #ffffff;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.do-table__content__th.sort-active {
|
|
47
|
+
color: #eee;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.sort-icon {
|
|
52
|
+
margin-left: 4px;
|
|
53
|
+
font-size: 1rem;
|
|
54
|
+
color: #6366f1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.sort-icon.muted {
|
|
58
|
+
color: #374151;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.col-check {
|
|
62
|
+
padding: 0.75rem 1rem;
|
|
63
|
+
width: 1rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.do-row {
|
|
67
|
+
background: var(--do-table-bg-row);
|
|
68
|
+
transition: background 0.12s;
|
|
69
|
+
color: var(--do-table-text);
|
|
70
|
+
border: 1px solid transparent;
|
|
71
|
+
|
|
72
|
+
&:nth-child(2n) {
|
|
73
|
+
background: var(--do-table-bg-row-striped);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
background: var(--do-table-bg-row-hover);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.selected {
|
|
81
|
+
background: var(--do-table-bg-row-hover);
|
|
82
|
+
outline: 2px solid rgb(15, 116, 182);
|
|
83
|
+
outline-offset: -1px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
td {
|
|
88
|
+
padding: 0.75rem 1rem;
|
|
89
|
+
color: inherit;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
td:first-child {
|
|
93
|
+
color: #e2e8f0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.do-checkbox {
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
accent-color: #6366f1;
|
|
99
|
+
width: 15px;
|
|
100
|
+
height: 15px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.do-table_content-wrapper {
|
|
104
|
+
border: 1px solid var(--do-bg-secondary);
|
|
105
|
+
border-radius: 12px;
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.do-table__footer {
|
|
111
|
+
display: grid;
|
|
112
|
+
grid-template-columns: 1fr min-content;
|
|
113
|
+
align-items: center;
|
|
114
|
+
padding: 10px 16px;
|
|
115
|
+
border-top: 1px solid white;
|
|
116
|
+
gap: 16px;
|
|
117
|
+
color: inherit;
|
|
118
|
+
font-size: 1rem;
|
|
119
|
+
|
|
120
|
+
.selected-count {
|
|
121
|
+
color: #6366f1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.sort-label strong {
|
|
125
|
+
color: #6366f1;
|
|
126
|
+
font-weight: 500;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.do-table-card {
|
|
132
|
+
border: 1px solid var(--do-bg-secondary);
|
|
133
|
+
border-radius: 12px;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
background: var(--do-table-bg);
|
|
136
|
+
font-size: 1rem;
|
|
137
|
+
padding: 0.75rem 1rem;
|
|
138
|
+
}
|
|
@@ -3,11 +3,19 @@
|
|
|
3
3
|
--do-bg-primary: var(--do-color-black-3);
|
|
4
4
|
--do-bg-secondary: var(--do-color-grey-1);
|
|
5
5
|
|
|
6
|
+
/*border*/
|
|
7
|
+
--do-border-primary: var(--do-color-grey-2);
|
|
8
|
+
--do-border-secondary: var(--do-color-grey-1);
|
|
9
|
+
|
|
10
|
+
/*text*/
|
|
11
|
+
--do-text-base: #FAFAFA;
|
|
12
|
+
--do-text-contrast: #fff;
|
|
13
|
+
|
|
6
14
|
/*box*/
|
|
7
15
|
--do-box-primary-bg: var(--do-color-black-2);
|
|
8
16
|
--do-box-primary-border: var(--do-color-grey-1);
|
|
9
17
|
--do-box-secondary-bg: var(--do-color-grey-1);
|
|
10
|
-
--do-box-secondary-border: var(--do-
|
|
18
|
+
--do-box-secondary-border: var(--do-border-primary);
|
|
11
19
|
|
|
12
20
|
/*buttons*/
|
|
13
21
|
--do-btn-primary: var(--do-color-black-2);
|
|
@@ -42,7 +50,7 @@
|
|
|
42
50
|
--do-btn-link: var(--do-color-white-5);
|
|
43
51
|
--do-btn-link-content: none;
|
|
44
52
|
--do-btn-link-hover-content: var(--do-color-white-5);
|
|
45
|
-
--do-btn-link-hover-border: var(--do-
|
|
53
|
+
--do-btn-link-hover-border: var(--do-border-primary);
|
|
46
54
|
|
|
47
55
|
--do-btn-link-secondary: #1d4ed8;
|
|
48
56
|
--do-btn-link-secondary-content: none;
|
|
@@ -91,9 +99,7 @@
|
|
|
91
99
|
--do-card-secondary-bg: var(--do-color-grey);
|
|
92
100
|
--do-card-secondary-border: var(--do-color-grey-border);
|
|
93
101
|
|
|
94
|
-
/*styles*/
|
|
95
|
-
--do-text-base: #FAFAFA;
|
|
96
|
-
--do-text-contrast: #fff;
|
|
102
|
+
/*generic styles*/
|
|
97
103
|
--do-transparent: transparent;
|
|
98
104
|
|
|
99
105
|
/*daisy color variables*/
|
|
@@ -101,4 +107,13 @@
|
|
|
101
107
|
--color-secondary: #fafafa;
|
|
102
108
|
--color-tertiary: #eff6ff;
|
|
103
109
|
--color-accent: #1d4ed8;
|
|
110
|
+
|
|
111
|
+
/*table*/
|
|
112
|
+
--do-table-bg: var(--do-box-primary-bg);
|
|
113
|
+
--do-table-border: var(--do-border-primary);
|
|
114
|
+
--do-table-bg-head: var(--do-box-primary-bg);
|
|
115
|
+
--do-table-bg-row: var(--do-bg-primary);
|
|
116
|
+
--do-table-bg-row-striped: var(--do-box-primary-bg);
|
|
117
|
+
--do-table-bg-row-hover: var(--do-color-grey-2);
|
|
118
|
+
--do-table-text: var(--do-text-base);
|
|
104
119
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Badge, Button, Card, Chip, Icon } from './atoms/index.js';
|
|
2
2
|
import { IconButton } from './molecules/index.js';
|
|
3
|
-
|
|
3
|
+
import { TableBasic } from './organisms/index.js';
|
|
4
|
+
export { Button, Icon, Badge, IconButton, Card, Chip, TableBasic };
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Badge, Button, Card, Chip, Icon } from './atoms/index.js';
|
|
2
2
|
import { IconButton } from './molecules/index.js';
|
|
3
|
-
|
|
3
|
+
import { TableBasic } from './organisms/index.js';
|
|
4
|
+
export { Button, Icon, Badge, IconButton, Card, Chip, TableBasic };
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
loading,
|
|
11
11
|
title,
|
|
12
12
|
onClick,
|
|
13
|
+
onBlur,
|
|
13
14
|
ariaLabel,
|
|
14
15
|
ariaDisabled,
|
|
15
16
|
iconName = 'icon-arrow',
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
|
|
44
45
|
<!-- @component
|
|
45
46
|
```Svelte
|
|
46
|
-
<IconButton label?={'text'} variant?={'variant'} size?={'size'} onClick={()=>{}} disabled?={disabled} loading?={loading} iconName?={'iconName'} iconSize?={'iconSize'} ariaLabel={ariaLabel} ariaDisabled={ariaDisabled}/>
|
|
47
|
+
<IconButton label?={'text'} variant?={'variant'} size?={'size'} onClick={()=>{}} onBlur={()=>{}} disabled?={disabled} loading?={loading} iconName?={'iconName'} iconSize?={'iconSize'} ariaLabel={ariaLabel} ariaDisabled={ariaDisabled}/>
|
|
47
48
|
```
|
|
48
49
|
- `variant?`: 'do-btn-primary' | 'do-btn-secondary' | 'do-btn-tertiary' | 'do-btn-accent' | 'do-btn-neutral'
|
|
49
50
|
- `anchor?`: boolean (use `<a>` tag instead of `<button>`)
|
|
@@ -53,6 +54,7 @@
|
|
|
53
54
|
- `rounded?`: boolean
|
|
54
55
|
- `loading?`: boolean
|
|
55
56
|
- `onClick`: () => void - only use when anchor is false
|
|
57
|
+
- `onBlur`: () => void - only use when anchor is false
|
|
56
58
|
- `href?`: string - only use when anchor is true
|
|
57
59
|
- `ariaLabel`: string
|
|
58
60
|
- `title`: string
|
|
@@ -124,6 +126,7 @@
|
|
|
124
126
|
{size}
|
|
125
127
|
type={type ?? 'button'}
|
|
126
128
|
{onClick}
|
|
129
|
+
{onBlur}
|
|
127
130
|
{disabled}
|
|
128
131
|
{title}
|
|
129
132
|
{ariaLabel}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IconButtonProps } from './iProps.ts';
|
|
2
2
|
/**
|
|
3
3
|
* ```Svelte
|
|
4
|
-
* <IconButton label?={'text'} variant?={'variant'} size?={'size'} onClick={()=>{}} disabled?={disabled} loading?={loading} iconName?={'iconName'} iconSize?={'iconSize'} ariaLabel={ariaLabel} ariaDisabled={ariaDisabled}/>
|
|
4
|
+
* <IconButton label?={'text'} variant?={'variant'} size?={'size'} onClick={()=>{}} onBlur={()=>{}} disabled?={disabled} loading?={loading} iconName?={'iconName'} iconSize?={'iconSize'} ariaLabel={ariaLabel} ariaDisabled={ariaDisabled}/>
|
|
5
5
|
* ```
|
|
6
6
|
* - `variant?`: 'do-btn-primary' | 'do-btn-secondary' | 'do-btn-tertiary' | 'do-btn-accent' | 'do-btn-neutral'
|
|
7
7
|
* - `anchor?`: boolean (use `<a>` tag instead of `<button>`)
|
|
@@ -11,6 +11,7 @@ import type { IconButtonProps } from './iProps.ts';
|
|
|
11
11
|
* - `rounded?`: boolean
|
|
12
12
|
* - `loading?`: boolean
|
|
13
13
|
* - `onClick`: () => void - only use when anchor is false
|
|
14
|
+
* - `onBlur`: () => void - only use when anchor is false
|
|
14
15
|
* - `href?`: string - only use when anchor is true
|
|
15
16
|
* - `ariaLabel`: string
|
|
16
17
|
* - `title`: string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/molecules/IconButton/IconButton.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAU,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"IconButton.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/molecules/IconButton/IconButton.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAU,MAAM,aAAa,CAAC;AA8E3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,QAAA,MAAM,UAAU,qDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -7,6 +7,7 @@ export interface iProps extends HTMLButtonAttributes {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
loading?: boolean;
|
|
9
9
|
onClick?: () => void;
|
|
10
|
+
onBlur?: () => void;
|
|
10
11
|
ariaLabel: string;
|
|
11
12
|
ariaDisabled?: boolean;
|
|
12
13
|
iconName: IconNames;
|
|
@@ -37,11 +38,13 @@ export type IconButtonAnchorProps = BaseIconButtonProps & {
|
|
|
37
38
|
rel?: HTMLAnchorAttributes['rel'];
|
|
38
39
|
referrerpolicy?: HTMLAnchorAttributes['referrerpolicy'];
|
|
39
40
|
onClick?: never;
|
|
41
|
+
onBlur?: never;
|
|
40
42
|
type?: never;
|
|
41
43
|
};
|
|
42
44
|
export type IconButtonButtonProps = BaseIconButtonProps & {
|
|
43
45
|
anchor?: false;
|
|
44
46
|
onClick?: () => void;
|
|
47
|
+
onBlur?: () => void;
|
|
45
48
|
type?: 'button' | 'submit' | 'reset';
|
|
46
49
|
href?: never;
|
|
47
50
|
target?: never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iProps.d.ts","sourceRoot":"","sources":["../../../src/lib/molecules/IconButton/iProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAElF,MAAM,WAAW,MAAO,SAAQ,oBAAoB;IACnD,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"iProps.d.ts","sourceRoot":"","sources":["../../../src/lib/molecules/IconButton/iProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAElF,MAAM,WAAW,MAAO,SAAQ,oBAAoB;IACnD,OAAO,CAAC,EACN,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,aAAa,GACb,eAAe,CAAC;IAClB,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC;AAEnE,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,GAAG;IACzD,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC5C,GAAG,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACxD,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,GAAG;IACzD,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import IconButton from '../IconButton/IconButton.svelte';
|
|
3
|
+
|
|
4
|
+
type PaginationState = {
|
|
5
|
+
totalPages: number;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
currentPage: number;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type Props = {
|
|
12
|
+
pagination: PaginationState;
|
|
13
|
+
goToPage: (page: number) => void;
|
|
14
|
+
pageSizeChange: (size: number) => void;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
let { pagination, goToPage, pageSizeChange }: Props = $props();
|
|
18
|
+
|
|
19
|
+
const getPaginationPages = (current: number, total: number, maxPages: number = 5) => {
|
|
20
|
+
if (total <= maxPages) {
|
|
21
|
+
return Array.from({ length: total }, (_, i) => i + 1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const pages: (number | string)[] = [];
|
|
25
|
+
const radius = 2;
|
|
26
|
+
|
|
27
|
+
pages.push(1);
|
|
28
|
+
|
|
29
|
+
const start = Math.max(2, current - radius);
|
|
30
|
+
const end = Math.min(total - 1, current + radius);
|
|
31
|
+
|
|
32
|
+
if (start > 2) {
|
|
33
|
+
pages.push('...');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
for (let i = start; i <= end; i++) {
|
|
37
|
+
if (!pages.includes(i)) {
|
|
38
|
+
pages.push(i);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (end < total - 1) {
|
|
43
|
+
pages.push('...');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!pages.includes(total)) {
|
|
47
|
+
pages.push(total);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return pages;
|
|
51
|
+
};
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<div class="do-pagination">
|
|
55
|
+
<label>
|
|
56
|
+
Mostrar:
|
|
57
|
+
<select bind:value={pagination.pageSize} onchange={() => pageSizeChange(pagination.pageSize)}>
|
|
58
|
+
<option value={5}>5</option>
|
|
59
|
+
<option value={10}>10</option>
|
|
60
|
+
<option value={25}>25</option>
|
|
61
|
+
<option value={50}>50</option>
|
|
62
|
+
</select>
|
|
63
|
+
</label>
|
|
64
|
+
|
|
65
|
+
{#if pagination.totalPages && !pagination.loading}
|
|
66
|
+
<div class="do-pagination__nav">
|
|
67
|
+
<IconButton
|
|
68
|
+
iconName="icon-chevron-down"
|
|
69
|
+
iCustomClass="rotate-90"
|
|
70
|
+
disabled={pagination.currentPage === 1}
|
|
71
|
+
onClick={() => goToPage(pagination.currentPage - 1)}
|
|
72
|
+
ariaLabel="página anterior"
|
|
73
|
+
/>
|
|
74
|
+
|
|
75
|
+
{#each getPaginationPages(pagination.currentPage, pagination.totalPages) as page}
|
|
76
|
+
{#if page === '...'}
|
|
77
|
+
<span class="px-2">...</span>
|
|
78
|
+
{:else}
|
|
79
|
+
<button
|
|
80
|
+
class="do-btn {pagination.currentPage === page ? 'do-btn-secondary' : 'do-btn-primary'}"
|
|
81
|
+
class:selected={pagination.currentPage === page}
|
|
82
|
+
onclick={() => {
|
|
83
|
+
if (typeof page === 'number') goToPage(page);
|
|
84
|
+
}}
|
|
85
|
+
disabled={pagination.totalPages === 1}
|
|
86
|
+
>
|
|
87
|
+
{page}
|
|
88
|
+
</button>
|
|
89
|
+
{/if}
|
|
90
|
+
{/each}
|
|
91
|
+
|
|
92
|
+
<IconButton
|
|
93
|
+
iconName="icon-chevron-down"
|
|
94
|
+
iCustomClass="-rotate-90"
|
|
95
|
+
disabled={pagination.currentPage === pagination.totalPages}
|
|
96
|
+
onClick={() => goToPage(pagination.currentPage + 1)}
|
|
97
|
+
ariaLabel="página siguiente"
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
{/if}
|
|
101
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type PaginationState = {
|
|
2
|
+
totalPages: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
currentPage: number;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
};
|
|
7
|
+
type Props = {
|
|
8
|
+
pagination: PaginationState;
|
|
9
|
+
goToPage: (page: number) => void;
|
|
10
|
+
pageSizeChange: (size: number) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const Pagination: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type Pagination = ReturnType<typeof Pagination>;
|
|
14
|
+
export default Pagination;
|
|
15
|
+
//# sourceMappingURL=Pagination.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/molecules/Pagination/Pagination.svelte.ts"],"names":[],"mappings":"AAMC,KAAK,eAAe,GAAG;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,KAAK,GAAG;IACZ,UAAU,EAAE,eAAe,CAAC;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AA6EH,QAAA,MAAM,UAAU,2CAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|