Skip to content

Commit 4eeff4a

Browse files
committed
Chore: Refactor button to use js spec files
1 parent b2e121f commit 4eeff4a

File tree

8 files changed

+749
-865
lines changed

8 files changed

+749
-865
lines changed

src/primitives/button/button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { get, inArray } from '@semantic-ui/utils';
33

44
import css from './button-bundle.css?raw';
55
import template from './button.html?raw';
6-
import componentSpec from './specs/button-component.js';
6+
import componentSpec from './specs/button.component.js';
77

88
const createComponent = ({ el, self, settings, data, $ }) => ({
99
isIconBefore() {

src/primitives/button/plural/buttons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineComponent } from '@semantic-ui/component';
22

33
import css from '../button-bundle.css?raw';
4-
import componentSpec from '../specs/buttons-component.js';
4+
import componentSpec from '../specs/buttons.component.js';
55
import template from './buttons.html?raw';
66

77
export const UIButtons = defineComponent({

src/primitives/button/specs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import ButtonComponentSpec from './specs/button-component.js';
2-
import ButtonSpec from './specs/button.js';
3-
import ButtonsComponentSpec from './specs/buttons-component.js';
1+
import ButtonComponentSpec from './specs/button.component.js';
2+
import ButtonSpec from './specs/button.spec.json';
3+
import ButtonsComponentSpec from './specs/buttons.component.js';
44

55
export { ButtonComponentSpec, ButtonsComponentSpec, ButtonSpec };

src/primitives/button/specs/button-component.js renamed to src/primitives/button/specs/button.component.js

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Auto-generated from button.json
1+
// Auto-generated from button.spec.js
22
export default {
33
"tagName": "ui-button",
44
"content": [
@@ -19,20 +19,20 @@ export default {
1919
"animated"
2020
],
2121
"variations": [
22+
"floated",
23+
"fluid",
24+
"compact",
25+
"size",
26+
"circular",
2227
"attached",
2328
"type",
24-
"circular",
2529
"color",
26-
"compact",
2730
"social",
2831
"positive",
2932
"warning",
3033
"negative",
3134
"info",
32-
"transparent",
33-
"floated",
34-
"fluid",
35-
"size"
35+
"transparent"
3636
],
3737
"states": [
3838
"hover",
@@ -62,20 +62,20 @@ export default {
6262
"active",
6363
"disabled",
6464
"loading",
65+
"floated",
66+
"fluid",
67+
"compact",
68+
"size",
69+
"circular",
6570
"attached",
6671
"type",
67-
"circular",
6872
"color",
69-
"compact",
7073
"social",
7174
"positive",
7275
"warning",
7376
"negative",
7477
"info",
7578
"transparent",
76-
"floated",
77-
"fluid",
78-
"size",
7979
"icon-only",
8080
"icon-after",
8181
"href"
@@ -92,6 +92,18 @@ export default {
9292
"fade-animated": "animated",
9393
"disabled": "disabled",
9494
"clickable-disabled": "disabled",
95+
"left-floated": "floated",
96+
"right-floated": "floated",
97+
"compact": "compact",
98+
"very-compact": "compact",
99+
"mini": "size",
100+
"tiny": "size",
101+
"small": "size",
102+
"medium": "size",
103+
"large": "size",
104+
"big": "size",
105+
"huge": "size",
106+
"massive": "size",
95107
"top-attached": "attached",
96108
"attached": "attached",
97109
"bottom-attached": "attached",
@@ -112,8 +124,6 @@ export default {
112124
"brown": "color",
113125
"grey": "color",
114126
"slate": "color",
115-
"compact": "compact",
116-
"very-compact": "compact",
117127
"instagram": "social",
118128
"facebook": "social",
119129
"twitter": "social",
@@ -126,17 +136,7 @@ export default {
126136
"negative": "negative",
127137
"subtle-negative": "negative",
128138
"info": "info",
129-
"subtle-info": "info",
130-
"left-floated": "floated",
131-
"right-floated": "floated",
132-
"mini": "size",
133-
"tiny": "size",
134-
"small": "size",
135-
"medium": "size",
136-
"large": "size",
137-
"big": "size",
138-
"huge": "size",
139-
"massive": "size"
139+
"subtle-info": "info"
140140
},
141141
"propertyTypes": {
142142
"icon": "string",
@@ -153,20 +153,20 @@ export default {
153153
"active": "boolean",
154154
"disabled": "string",
155155
"loading": "boolean",
156+
"floated": "string",
157+
"fluid": "boolean",
158+
"compact": "string",
159+
"size": "string",
160+
"circular": "boolean",
156161
"attached": "string",
157162
"type": "string",
158-
"circular": "boolean",
159163
"color": "string",
160-
"compact": "string",
161164
"social": "string",
162165
"positive": "string",
163166
"warning": "string",
164167
"negative": "string",
165168
"info": "string",
166169
"transparent": "boolean",
167-
"floated": "string",
168-
"fluid": "boolean",
169-
"size": "string",
170170
"icon-only": "boolean",
171171
"icon-after": "boolean",
172172
"href": "string"
@@ -191,6 +191,24 @@ export default {
191191
"disabled",
192192
"clickable-disabled"
193193
],
194+
"floated": [
195+
"left-floated",
196+
"right-floated"
197+
],
198+
"compact": [
199+
"compact",
200+
"very-compact"
201+
],
202+
"size": [
203+
"mini",
204+
"tiny",
205+
"small",
206+
"medium",
207+
"large",
208+
"big",
209+
"huge",
210+
"massive"
211+
],
194212
"attached": [
195213
"top-attached",
196214
"attached",
@@ -217,10 +235,6 @@ export default {
217235
"grey",
218236
"slate"
219237
],
220-
"compact": [
221-
"compact",
222-
"very-compact"
223-
],
224238
"social": [
225239
"instagram",
226240
"facebook",
@@ -243,20 +257,6 @@ export default {
243257
"info": [
244258
"info",
245259
"subtle-info"
246-
],
247-
"floated": [
248-
"left-floated",
249-
"right-floated"
250-
],
251-
"size": [
252-
"mini",
253-
"tiny",
254-
"small",
255-
"medium",
256-
"large",
257-
"big",
258-
"huge",
259-
"massive"
260260
]
261261
},
262262
"attributeClasses": [

0 commit comments

Comments
 (0)