fu-kit 0.5.1 → 0.6.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fu-kit",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "",
5
5
  "main": "src/entry.js",
6
6
  "scripts": {
@@ -15,17 +15,19 @@
15
15
  "files": [
16
16
  "src/components/*",
17
17
  "src/scss-kit/*",
18
+ "src/utils/*",
18
19
  "src/entry.js",
20
+ "src/constants.js",
19
21
  "reset.scss",
20
22
  "root.scss",
21
23
  "scss.scss"
22
24
  ],
23
25
  "devDependencies": {
24
26
  "@vitejs/plugin-vue": "^1.9.3",
25
- "vite": "^2.6.4",
26
27
  "cross-env": "^7.0.3",
27
28
  "rimraf": "^3.0.2",
28
- "sass": "^1.26.5"
29
+ "sass": "^1.26.5",
30
+ "vite": "^2.6.4"
29
31
  },
30
32
  "peerDependencies": {
31
33
  "vue": "^3.2.16"
@@ -34,8 +36,10 @@
34
36
  "node": ">=12"
35
37
  },
36
38
  "dependencies": {
39
+ "lodash": "^4.17.21",
37
40
  "vue": "^3.2.16",
38
41
  "vue-router": "^4.0.0-0",
42
+ "vue-the-mask": "^0.11.1",
39
43
  "vue3-click-away": "^1.2.1"
40
44
  }
41
45
  }
package/reset.scss CHANGED
@@ -1,71 +1,81 @@
1
- @import "src/scss-kit/typo";
2
-
3
- body {
4
- margin: 0;
5
- padding: 0;
6
- color: var(--pal-text);
7
- }
8
-
9
- address, article, aside, blockquote, details, dialog, dd, div, dl, dt, fieldset, figcaption,
10
- figure, footer, form, hgroup, hr, li, main, nav,
11
- ol, p, pre, section, table, ul {
12
- margin: 0;
13
- padding: 0;
14
- box-sizing: border-box;
15
- font-family: var(--typo-font-text);
16
- line-height: 1.2;
17
- }
18
-
19
- h1, h2, h3, h4, h5, h6, header {
20
- font-family: var(--typo-font-heading);
21
- margin: 0;
22
- padding: 0;
23
- box-sizing: border-box;
24
- line-height: 1.2;
25
- }
26
-
27
- input, button, textarea, select, span, b, small {
28
- box-sizing: border-box;
29
- line-height: 1.2;
30
- }
31
-
32
- h1 {
33
- @include typo(700);
34
- }
35
-
36
- h2 {
37
- @include typo(600);
38
- }
39
-
40
- h3 {
41
- @include typo(500);
42
- }
43
-
44
- h4 {
45
- @include typo(400);
46
- }
47
-
48
- h5 {
49
- @include typo(300);
50
- }
51
-
52
- p {
53
- @include typo(200);
54
- }
55
-
56
- small {
57
- @include typo(100);
58
- }
59
-
60
- label {
61
- @include typo(100);
62
- display: block;
63
- }
64
-
65
- a {
66
- color: var(--pal-link);
67
-
68
- &:active, &:focus {
69
- color: var(--pal-link-active);
70
- }
71
- }
1
+ @import "src/scss-kit/typo";
2
+
3
+ body {
4
+ margin: 0;
5
+ padding: 0;
6
+ color: var(--pal-text);
7
+ }
8
+
9
+ address, article, aside, blockquote, details, dialog, dd, div, dl, dt, fieldset, figcaption,
10
+ figure, footer, form, hgroup, hr, li, main, nav,
11
+ ol, p, pre, section, table, ul {
12
+ margin: 0;
13
+ padding: 0;
14
+ box-sizing: border-box;
15
+ font-family: var(--typo-font-text);
16
+ line-height: 1.2;
17
+ }
18
+
19
+ h1, h2, h3, h4, h5, h6, header {
20
+ font-family: var(--typo-font-heading);
21
+ margin: 0;
22
+ padding: 0;
23
+ box-sizing: border-box;
24
+ line-height: 1.2;
25
+ }
26
+
27
+ input, button, textarea, select, span, b, small {
28
+ box-sizing: border-box;
29
+ line-height: 1;
30
+ font-family: var(--typo-font-text);
31
+ font-size: inherit;
32
+ }
33
+
34
+ pre {
35
+ font-family: var(--typo-font-mono);
36
+ }
37
+
38
+ h1 {
39
+ @include typo(700);
40
+ }
41
+
42
+ h2 {
43
+ @include typo(600);
44
+ }
45
+
46
+ h3 {
47
+ @include typo(500);
48
+ }
49
+
50
+ h4 {
51
+ @include typo(400);
52
+ }
53
+
54
+ h5 {
55
+ @include typo(300);
56
+ }
57
+
58
+ p {
59
+ @include typo(200);
60
+ }
61
+
62
+ small {
63
+ @include typo(100);
64
+ }
65
+
66
+ label {
67
+ @include typo(100);
68
+ display: block;
69
+ }
70
+
71
+ a {
72
+ color: var(--pal-link);
73
+
74
+ &:active, &:focus {
75
+ color: var(--pal-link-active);
76
+ }
77
+ }
78
+
79
+ svg {
80
+ fill: none;
81
+ }
package/root.scss CHANGED
@@ -1,11 +1,10 @@
1
1
  @import "src/scss-kit/typo";
2
2
  @import "src/scss-kit/colors";
3
3
 
4
- :root {
5
-
4
+ html {
6
5
  // RAW RGB VALUES
7
6
  --rgb-white: #{hex2rgb(#FFFFFF)};
8
- --rgb-light: #{hex2rgb(#FEFEFE)};
7
+ --rgb-light: #{hex2rgb(#FAFAFA)};
9
8
  --rgb-grey100: #{hex2rgb(#F4F4F4)};
10
9
  --rgb-grey200: #{hex2rgb(#DCDCDC)};
11
10
  --rgb-grey300: #{hex2rgb(#BFBFBF)};
@@ -18,13 +17,13 @@
18
17
  --rgb-dark: #{hex2rgb(#151515)};
19
18
  --rgb-black: #{hex2rgb(#000000)};
20
19
 
21
- --rgb-brand: #{hex2rgb(#7F9CBB)};
22
- --rgb-primary: #{hex2rgb(#2196F3)};
23
- --rgb-secondary: #{hex2rgb(#434F5F)};
24
- --rgb-positive: #{hex2rgb(#13964B)};
25
- --rgb-warning: #{hex2rgb(#FF9900)};
26
- --rgb-negative: #{hex2rgb(#FF331F)};
27
- --rgb-link: #{hex2rgb(#0077B6)};
20
+ --rgb-brand: #{hex2rgb(#0095ff)};
21
+ --rgb-primary: #{hex2rgb(#0095ff)};
22
+ --rgb-secondary: #{hex2rgb(#131315)};
23
+ --rgb-positive: #{hex2rgb(#3e9400)};
24
+ --rgb-warning: #{hex2rgb(#ff7300)};
25
+ --rgb-negative: #{hex2rgb(#ff3535)};
26
+ --rgb-link: #{hex2rgb(#0095ff)};
28
27
 
29
28
  // Format palette colors: "--pal-{code}": #RGB
30
29
 
@@ -56,15 +55,16 @@
56
55
  --pal-acc-warning: rgb(var(--rgb-white));
57
56
  --pal-acc-negative: rgb(var(--rgb-white));
58
57
 
59
- --pal-text: rgb(var(--rgb-dark));
58
+ --pal-text: rgb(var(--rgb-grey700));
60
59
  --pal-text-dimm: rgb(var(--rgb-grey600));
61
60
  --pal-block: rgb(var(--rgb-grey100));
62
61
  --pal-block-border: rgb(var(--rgb-grey200));
63
62
  --pal-bg: rgb(var(--rgb-white));
64
- --pal-overlay: rgba(var(--rgb-dark), 0.2);
65
- --pal-link: rgb(var(--rgb-link));
63
+ --pal-overlay: rgba(var(--rgb-grey500), 0.2);
64
+ --pal-link: rgb(var(--rgb-primary));
66
65
  --pal-link-active: rgb(var(--rgb-brand));
67
66
 
67
+ --ui-rgb: var(--rgb-primary);
68
68
  --ui-pal: var(--pal-primary);
69
69
  --ui-pal-bg: var(--pal-bg);
70
70
  --ui-pal-acc: var(--pal-acc-primary);
@@ -75,18 +75,24 @@
75
75
  --ui-pal-disabled: rgb(var(--rgb-grey100));
76
76
  --ui-pal-disabled-border: rgb(var(--rgb-grey300));
77
77
 
78
- --ui-transition: linear 120ms;
79
78
  --ui-lt-h: 36px;
80
79
  --ui-lt-h-sub: 22px;
80
+ --ui-lt-check-border-width: 2px;
81
+ --ui-switch-h: 24px;
82
+ --ui-switch-w: 38px;
83
+ --ui-check-size: 20px;
84
+ --ui-check-border-w: 2px;
81
85
  --ui-lt-border-style: solid;
82
- --ui-lt-border-width: 1px;
86
+ --ui-lt-border-width: 2px;
83
87
  --ui-lt-border-radius: var(--lt-border-radius-inner);
84
88
  --ui-lt-disabled-border-style: dashed;
85
89
 
86
90
  --ui-scroll-bg: inherit;
87
- --ui-scroll-width: 11px;
91
+ --ui-scroll-width: 8px;
92
+
93
+ --ui-dropdown-max-height: 30vh;
88
94
 
89
- --typo-font-text: Avenir, Helvetica, Arial, sans-serif;
95
+ --typo-font-text: Helvetica, 'Segoe UI', San Francisco, Roboto, Lucida Sans;
90
96
  --typo-font-heading: var(--typo-font-text);
91
97
  --typo-font-ui: var(--typo-font-text);
92
98
  --typo-font-mono: monospace;
@@ -109,8 +115,8 @@
109
115
  --typo-lh200: 16px;
110
116
  --typo-lh300: 18px;
111
117
  --typo-lh400: 22px;
112
- --typo-lh500: 26px;
113
- --typo-lh600: 32px;
118
+ --typo-lh500: 24px;
119
+ --typo-lh600: 36px;
114
120
  --typo-lh700: 42px;
115
121
  --typo-lh800: 48px;
116
122
  --typo-lh900: 64px;
@@ -126,8 +132,8 @@
126
132
  --lt-sp800: 256px;
127
133
  --lt-sp900: 512px;
128
134
 
129
- --lt-border-radius: 9px;
130
- --lt-border-radius-inner: 5px;
135
+ --lt-border-radius: 0px;
136
+ --lt-border-radius-inner: 0px;
131
137
 
132
138
  --lt-z-1: 1;
133
139
  --lt-z-back: -1;
@@ -135,4 +141,6 @@
135
141
  --lt-z-nav: 2000;
136
142
  --lt-z-modal-backdrop: 3000;
137
143
  --lt-z-modal: 3001;
144
+
145
+ --ui-transition: linear 120ms;
138
146
  }
@@ -3,39 +3,47 @@
3
3
  v-bind="{
4
4
  ...$attrs,
5
5
  type: $attrs.type || 'button',
6
- class: 'fu-button' + (hollow ? ' _hollow' : ''),
6
+ class: ['ui-button', (hollow ? ' _hollow' : ''), (naked ? ' _naked' : ''), (isLoading ? ' _loading' : '')].join(''),
7
7
  }"
8
8
  @mouseup="mUp"
9
9
  >
10
10
  <slot />
11
+ <ui-icon v-if="isLoading" name="loader" class="ui-button_loader" />
11
12
  </button>
12
13
  </template>
13
14
 
14
15
  <script>
15
- export default {
16
- name: 'fu-button',
16
+ import { defineComponent } from 'vue'
17
+
18
+ import UiIcon from './UiIcon.vue'
19
+
20
+ export default defineComponent({
21
+ name: 'ui-button',
22
+ components: { UiIcon },
17
23
  props: {
18
24
  hollow: { type: Boolean, default: false },
25
+ naked: { type: Boolean, default: false },
26
+ isLoading: { type: Boolean, default: false },
19
27
  },
20
- setup (props) {
28
+ setup () {
21
29
  const mUp = (e) => e.target.blur()
22
- return { hollow: props.hollow, mUp }
30
+ return { mUp }
23
31
  },
24
- }
32
+ })
25
33
  </script>
26
34
 
27
35
  <style lang="scss" scoped>
28
36
  @import "../../scss";
29
37
 
30
- .fu-button {
38
+ .ui-button {
31
39
  @include typo(200);
32
40
 
33
- padding: var(--ui-button-padding, #{spacing(300)} #{spacing(400)});
34
41
  display: flex;
35
42
  align-items: center;
36
43
  justify-content: center;
37
44
  box-sizing: border-box;
38
45
  cursor: pointer;
46
+ padding: var(--ui-button-padding, #{spacing(300)} #{spacing(400)});
39
47
  font-family: var(--typo-font-ui);
40
48
  min-height: var(--ui-lt-h);
41
49
  border-width: var(--ui-lt-border-width);
@@ -47,9 +55,12 @@ export default {
47
55
  color: var(--ui-pal-acc);
48
56
  line-height: 1;
49
57
  will-change: box-shadow, transform;
50
-
58
+ gap: var(--ui-button-gap, #{spacing(300)});
51
59
  outline: none;
52
60
  user-select: none;
61
+
62
+ --icon-size: 1em;
63
+
53
64
  -webkit-tap-highlight-color: transparent;
54
65
 
55
66
  & > * {
@@ -66,7 +77,6 @@ export default {
66
77
  }
67
78
 
68
79
  &:active {
69
- transform: translateY(2px);
70
80
  transition-duration: 20ms;
71
81
  box-shadow: 0 3px 4px -2px var(--ui-pal);
72
82
  }
@@ -86,7 +96,6 @@ export default {
86
96
 
87
97
  &:hover {
88
98
  box-shadow: 0 3px 10px -4px var(--ui-pal);
89
- color: var(--ui-pal);
90
99
  }
91
100
 
92
101
  &:focus {
@@ -102,5 +111,59 @@ export default {
102
111
  box-shadow: none;
103
112
  }
104
113
  }
114
+
115
+ &._naked {
116
+ background: transparent;
117
+ color: var(--ui-pal);
118
+ border: 0 none;
119
+ padding: var(--ui-button-padding, var(--lt-sp300));
120
+
121
+ &:hover {
122
+ box-shadow: none;
123
+ }
124
+
125
+ &:focus {
126
+ box-shadow: none;
127
+ }
128
+
129
+ &:active {
130
+ box-shadow: none;
131
+ }
132
+
133
+ &:disabled {
134
+ color: var(--ui-pal-disabled-border);
135
+ box-shadow: none;
136
+ }
137
+ }
138
+
139
+ &._loading {
140
+ color: transparent;
141
+ }
142
+
143
+ &_loader {
144
+ --icon-size: 1em;
145
+ --icon-color: var(--ui-pal-acc);
146
+ position: absolute;
147
+ animation: spin 2s infinite;
148
+ }
149
+
150
+ &._hollow > &_loader, &._naked > &_loader {
151
+ --icon-size: 1em;
152
+ --icon-color: var(--ui-pal);
153
+ position: absolute;
154
+ animation: spin 2s infinite;
155
+ }
156
+ }
157
+
158
+ @keyframes spin {
159
+ 0% {
160
+ transform: scale(1) rotate(0);
161
+ }
162
+ 50% {
163
+ transform: scale(1.5) rotate(180deg);
164
+ }
165
+ 100% {
166
+ transform: scale(1) rotate(360deg);
167
+ }
105
168
  }
106
169
  </style>
@@ -3,7 +3,7 @@
3
3
  v-bind="{
4
4
  ...$attrs,
5
5
  type: $attrs.type || 'button',
6
- class: 'fu-button-link',
6
+ class: 'ui-button-link',
7
7
  }"
8
8
  @mouseup="mUp"
9
9
  >
@@ -12,8 +12,10 @@
12
12
  </template>
13
13
 
14
14
  <script>
15
- export default {
16
- name: 'fu-button-link',
15
+ import { defineComponent } from 'vue'
16
+
17
+ export default defineComponent({
18
+ name: 'ui-button-link',
17
19
  props: {
18
20
  hollow: { type: Boolean, default: false },
19
21
  },
@@ -21,23 +23,22 @@ export default {
21
23
  const mUp = (e) => e.target.blur()
22
24
  return { hollow: props.hollow, mUp }
23
25
  },
24
- }
26
+ })
25
27
  </script>
26
28
 
27
29
  <style lang="scss" scoped>
28
30
  @import "../../scss";
29
31
 
30
- .fu-button-link {
32
+ .ui-button-link {
31
33
  @include typo(200);
32
- @include spacing-padding(0, 0);
34
+ padding: spacing(0, 0);
33
35
 
34
36
  display: inline-block;
35
- font-weight: normal;
36
37
  box-sizing: border-box;
37
38
  cursor: pointer;
38
39
  font-family: var(--typo-font-text);
39
40
  border: 0 none;
40
- transition: var(--ui-transition);
41
+ transition: all var(--ui-transition);
41
42
  background: transparent;
42
43
  color: var(--pal-link);
43
44
  line-height: 1;
@@ -45,24 +46,24 @@ export default {
45
46
  outline: none;
46
47
  user-select: none;
47
48
  -webkit-tap-highlight-color: transparent;
48
- text-decoration: underline;
49
+ text-decoration: none;
49
50
 
50
51
  & > * {
51
52
  pointer-events: none;
52
53
  }
53
54
 
54
55
  &:hover {
55
- text-decoration: none;
56
+ text-decoration: underline;
56
57
  }
57
58
 
58
59
  &:focus {
59
60
  color: var(--pal-link-active);
60
- text-decoration: underline dashed;
61
+ text-decoration: underline;
61
62
  }
62
63
 
63
64
  &:active {
64
65
  color: var(--pal-link-active);
65
- text-decoration: underline dashed;
66
+ text-decoration: underline;
66
67
  }
67
68
 
68
69
  &:disabled {