This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree 11 files changed +153
-19
lines changed
11 files changed +153
-19
lines changed Original file line number Diff line number Diff line change
1
+ @fortawesome:registry = https://npm.fontawesome.com/
2
+ //npm.fontawesome.com/:_authToken = 9 EEF60 B7-9 FFF-4698-88 EC-EE6087 D439 F8
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ yarn serve
28
28
- [x] Setup Vue.js plugin system
29
29
- [x] Provide Theme
30
30
- [x] Observe theme and set it dynamically in javascript with ease.
31
- - [ ] Provide icons API for icons component
32
- - [ ] Accessibility (Focus) Styling
31
+ - [x ] Provide icons API for icons component
32
+ - [x ] Accessibility (Focus) Styling
33
33
- [ ] Setup NPM distribution
34
34
- [ ] Set up type system for components with Typescript
35
35
Original file line number Diff line number Diff line change 17
17
"dependencies" : {
18
18
"@babel/preset-env" : " ^7.6.3" ,
19
19
"@fortawesome/free-solid-svg-icons" : " ^5.11.2" ,
20
+ "@fortawesome/pro-light-svg-icons" : " ^5.11.2" ,
20
21
"@styled-system/should-forward-prop" : " ^5.1.2" ,
21
22
"@vue/composition-api" : " ^0.3.2" ,
22
23
"color" : " ^3.1.2" ,
Original file line number Diff line number Diff line change 4
4
<Icon
5
5
name =" star"
6
6
color =" yellow.500"
7
- size =" 5"
7
+ size =" 6"
8
+ mx =" 3"
8
9
/>
9
10
<Icon
10
11
name =" email"
11
- color =" teal.600"
12
- size =" 8"
12
+ color =" orange.400"
13
+ size =" 12"
14
+ mx =" 3"
13
15
/>
14
16
<Icon
15
- name =" phone"
16
- color =" indigo.400"
17
- size =" 10"
17
+ name =" not-allowed"
18
+ color =" red.400"
19
+ size =" 12"
20
+ mx =" 3"
18
21
/>
19
22
<Icon
20
- name =" ambulance"
21
- color =" indigo.400"
22
- size =" 10"
23
+ name =" chevron-circle-up"
24
+ color =" blue.500"
25
+ size =" 12"
26
+ mx =" 3"
23
27
/>
24
28
<Icon
25
- name =" not-allowed"
26
- color =" teal.600"
27
- size =" 12"
29
+ name =" times-circle"
30
+ color =" indigo.300"
31
+ size =" 24"
32
+ mx =" 3"
28
33
/>
34
+ <Button variant-color =" blue" size =" lg" >Large</Button >
35
+ <Button variant-color =" red" size =" md" >Medium</Button >
36
+ <Button variant-color =" blue" size =" sm" >Small</Button >
29
37
</div >
30
38
</theme-provider >
31
39
</template >
32
40
33
41
<script >
34
42
import ThemeProvider from ' ./components/ThemeProvider'
35
- import { Icon } from ' ./lib/core/'
43
+ import { Icon , Button } from ' ./lib/core/'
36
44
import Badge from ' ./components/Badge'
37
45
import theme from ' ./lib/theme'
38
46
@@ -47,7 +55,8 @@ export default {
47
55
name: ' App' ,
48
56
components: {
49
57
ThemeProvider,
50
- Icon
58
+ Icon,
59
+ Button
51
60
},
52
61
methods: {
53
62
toggle () {
Original file line number Diff line number Diff line change 1
1
import * as Vue from 'vue' ;
2
2
3
+ /**
4
+ * Kiwi Button component for UI interactions
5
+ */
3
6
declare const Button : Vue . Component < {
4
7
as ?: String ,
5
8
type ?: String ,
Original file line number Diff line number Diff line change
1
+ import { keyframes } from 'vue-styled-components'
2
+ import { baseProps } from '../../lib/config/props'
3
+ import { Box , VisuallyHidden } from '../../lib/core'
4
+ import { forwardProps } from '../../lib/utils'
5
+
6
+ const spin = keyframes `
7
+ 0% {
8
+ transform: rotate(0deg);
9
+ }
10
+ 100% {
11
+ transform: rotate(360deg);
12
+ }
13
+ `
14
+
15
+ const sizes = {
16
+ xs : {
17
+ w : '0.75rem' ,
18
+ h : '0.75rem'
19
+ } ,
20
+ sm : {
21
+ w : '1rem' ,
22
+ h : '1rem'
23
+ } ,
24
+ md : {
25
+ w : '1.5rem' ,
26
+ h : '1.5rem'
27
+ } ,
28
+ lg : {
29
+ w : '2rem' ,
30
+ h : '2rem'
31
+ } ,
32
+ xl : {
33
+ w : '3rem' ,
34
+ h : '3rem'
35
+ }
36
+ }
37
+
38
+ const setSizes = ( props ) => {
39
+ return sizes [ props . size ] || sizes [ 'md' ]
40
+ }
41
+
42
+ export default {
43
+ name : 'Spinner' ,
44
+ props : {
45
+ size : {
46
+ type : [ String , Array ] ,
47
+ default : 'md'
48
+ } ,
49
+ label : {
50
+ type : String ,
51
+ default : 'Loading...'
52
+ } ,
53
+ thickness : {
54
+ type : [ String , Array ] ,
55
+ default : '2px'
56
+ } ,
57
+ speed : {
58
+ type : [ String , Array ] ,
59
+ default : '0.45s'
60
+ } ,
61
+ color : {
62
+ type : [ String , Array ] ,
63
+ default : 'gray.200'
64
+ } ,
65
+ emptyColor : {
66
+ type : [ String , Array ] ,
67
+ default : 'transparent'
68
+ } ,
69
+ _ref : Object ,
70
+ ...baseProps
71
+ } ,
72
+ render ( h ) {
73
+ return h ( Box , {
74
+ ref : this . _ref ,
75
+ props : {
76
+ d : 'inline-block' ,
77
+ borderWidth : this . thickness ,
78
+ borderBottomColor : this . emptyColor ,
79
+ borderLeftColor : this . emptyColor ,
80
+ borderStyle : 'solid' ,
81
+ rounded : 'full' ,
82
+ color : this . color ,
83
+ animation : `${ spin } ${ this . speed } linear infinite` ,
84
+ ...setSizes ( this . $props ) ,
85
+ ...forwardProps ( this . $props )
86
+ }
87
+ } , this . label && h ( VisuallyHidden , { } , this . label ) )
88
+ }
89
+ }
Original file line number Diff line number Diff line change @@ -75,7 +75,13 @@ const baseProps = {
75
75
order : [ String , Array ] ,
76
76
outline : [ String , Array ] ,
77
77
cursor : [ String , Array ] ,
78
- transition : [ String , Array ]
78
+ transition : [ String , Array ] ,
79
+ borderBottomColor : [ String , Array ] ,
80
+ borderTopColor : [ String , Array ] ,
81
+ borderLeftColor : [ String , Array ] ,
82
+ borderRightColor : [ String , Array ] ,
83
+ borderColor : [ String , Array ] ,
84
+ borderStyle : [ String , Array ]
79
85
// appearance: [String, Array],
80
86
// transform: [String, Array],
81
87
// transformOrigin: [String, Array],
Original file line number Diff line number Diff line change @@ -2,3 +2,7 @@ export { default as Box } from '../../components/Box'
2
2
export { default as PseudoBox } from '../../components/PseudoBox'
3
3
export { default as Button } from '../../components/Button'
4
4
export { default as Icon } from '../../components/Icon'
5
+ export { default as Spinner } from '../../components/Spinner'
6
+ export { default as VisuallyHidden } from '../../components/VisuallyHidden'
7
+ export { default as TransitionExpand } from '../../components/TransitionExpand'
8
+ export { default as ThemeProvider } from '../../components/ThemeProvider'
Original file line number Diff line number Diff line change @@ -10,13 +10,22 @@ import { faCoffee,
10
10
faCalendar ,
11
11
faCar ,
12
12
faBraille ,
13
- faCaretLeft } from '@fortawesome/free-solid-svg-icons'
13
+ faCaretLeft ,
14
+ faAnchor } from '@fortawesome/free-solid-svg-icons'
15
+ import { faChevronCircleUp , faTimesCircle } from '@fortawesome/pro-light-svg-icons'
14
16
15
17
Vue . config . productionTip = false
16
18
Vue . use ( VueCompositionApi )
17
19
18
20
// Install Kiwi plugin
19
21
Vue . use ( Kiwi , {
22
+ // include theme property that can be extended by user.
23
+ /**
24
+ * theme: {
25
+ * ...someImportedThemeObject
26
+ * icons: Object
27
+ * }
28
+ */
20
29
icons : {
21
30
iconPack : 'fa' ,
22
31
iconSet : {
@@ -25,7 +34,10 @@ Vue.use(Kiwi, {
25
34
faCoffee,
26
35
faBraille,
27
36
faAmbulance,
28
- faCaretLeft
37
+ faCaretLeft,
38
+ faAnchor,
39
+ faChevronCircleUp,
40
+ faTimesCircle
29
41
} ,
30
42
extend : {
31
43
'not-allowed' : {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ storiesOf('UI | Icon', module)
11
11
<Icon name="star" mx="2" color="yellow.400" size="4" />
12
12
<Icon name="email" mx="2" color="indigo.400" size="5" />
13
13
<Icon name="phone" mx="2" color="green.400" size="6" />
14
+ <Icon name="anchor" mx="2" color="red.400" size="10" />
14
15
</div>
15
16
`
16
17
} ) )
Original file line number Diff line number Diff line change 1154
1154
dependencies:
1155
1155
"@fortawesome/fontawesome-common-types" "^0.2.25"
1156
1156
1157
+ "@fortawesome/pro-light-svg-icons@^5.11.2":
1158
+ version "5.11.2"
1159
+ resolved "https://npm.fontawesome.com/@fortawesome/pro-light-svg-icons/-/pro-light-svg-icons-5.11.2.tgz#61543170feb34e04f4d4bd1843b08bbde6682833"
1160
+ integrity sha512-NzN0K+hnKQ8fw4PLsr7WjLgtlnH1QjD4/N26YVUEMzLZiTgYBiqE7NDlRL6q/xJ9ittCj6PDPNY/IQ0T8XPLiA==
1161
+ dependencies:
1162
+ "@fortawesome/fontawesome-common-types" "^0.2.25"
1163
+
1157
1164
1158
1165
version "2.1.1"
1159
1166
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.1.tgz#61395b5ed94c4cb19c2dc4c85969cff3d40d583f"
You can’t perform that action at this time.
0 commit comments