fu-kit 0.7.2 → 1.0.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/LICENCE.txt +20 -20
- package/README.md +21 -21
- package/package.json +44 -42
- package/src/components/UIButtonRoute.vue +79 -0
- package/src/components/UiButton.vue +202 -169
- package/src/components/UiButtonLink.vue +74 -74
- package/src/components/UiCheck.vue +206 -206
- package/src/components/UiCodeInput.vue +47 -36
- package/src/components/UiCopy.vue +88 -88
- package/src/components/UiDropdown.vue +109 -109
- package/src/components/UiDropdownItem.vue +66 -66
- package/src/components/UiIcon.vue +29 -29
- package/src/components/UiIconProvider.vue +511 -32
- package/src/components/UiImg.vue +72 -0
- package/src/components/UiModal.vue +103 -103
- package/src/components/UiSelectX.vue +312 -312
- package/src/components/UiSidebar.vue +118 -118
- package/src/components/UiText.vue +121 -121
- package/src/components/UiTextarea.vue +117 -117
- package/src/entry.js +23 -21
- package/src/scss-kit/colors.scss +2 -3
- package/src/scss-kit/media.scss +3 -3
- package/src/scss-kit/pal_dark.scss +6 -6
- package/src/scss-kit/pal_fu.scss +8 -8
- package/src/scss-kit/pal_light.scss +6 -6
- package/src/scss-kit/typo.scss +39 -39
- package/src/scss-kit/typo_default.scss +4 -2
- package/src/scss-kit/ui.scss +49 -49
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="{'_shown':isOpen}" class="ui-sidebar" @mousedown.self="$emit('close')">
|
|
3
|
-
<transition name="bounce">
|
|
4
|
-
<div v-if="isOpen" class="ui-sidebar_content">
|
|
5
|
-
<button v-if="showClose" class="ui-sidebar_close" @click="$emit('close')">
|
|
6
|
-
<ui-icon name="cross" />
|
|
7
|
-
</button>
|
|
8
|
-
<slot />
|
|
9
|
-
</div>
|
|
10
|
-
</transition>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
import { defineComponent } from 'vue'
|
|
16
|
-
|
|
17
|
-
import UiIcon from './UiIcon.vue'
|
|
18
|
-
|
|
19
|
-
export default defineComponent({
|
|
20
|
-
name: 'ui-sidebar',
|
|
21
|
-
components: { UiIcon },
|
|
22
|
-
emits: [ 'close' ],
|
|
23
|
-
props: {
|
|
24
|
-
isOpen: { type: Boolean, default: false },
|
|
25
|
-
// todo: right side as well
|
|
26
|
-
side: { type: String, default: 'right' },
|
|
27
|
-
showClose: { type: Boolean, default: false },
|
|
28
|
-
},
|
|
29
|
-
watch: {
|
|
30
|
-
isOpen (val) {
|
|
31
|
-
if (val) document.body.style.overflow = 'hidden'
|
|
32
|
-
else document.body.style.overflow = 'visible'
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
})
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<style lang="scss">
|
|
39
|
-
@import "../../scss";
|
|
40
|
-
|
|
41
|
-
html {
|
|
42
|
-
--ui-sidebar-max-w: 45vw;
|
|
43
|
-
--ui-sidebar-min-w: 25vw;
|
|
44
|
-
}
|
|
45
|
-
</style>
|
|
46
|
-
|
|
47
|
-
<style lang="scss" scoped>
|
|
48
|
-
@import "../../scss";
|
|
49
|
-
|
|
50
|
-
.ui-sidebar {
|
|
51
|
-
position: fixed;
|
|
52
|
-
left: 0;
|
|
53
|
-
top: 0;
|
|
54
|
-
right: 0;
|
|
55
|
-
bottom: 0;
|
|
56
|
-
z-index: var(--lt-z-nav);
|
|
57
|
-
background-color: transparent;
|
|
58
|
-
transition-timing-function: linear;
|
|
59
|
-
transition-duration: 200ms;
|
|
60
|
-
transition-property: background-color, visibility;
|
|
61
|
-
pointer-events: none;
|
|
62
|
-
visibility: hidden;
|
|
63
|
-
|
|
64
|
-
&._shown {
|
|
65
|
-
background: var(--pal-overlay);
|
|
66
|
-
visibility: visible;
|
|
67
|
-
pointer-events: unset;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&_content {
|
|
71
|
-
@include scrollbar-awesome();
|
|
72
|
-
|
|
73
|
-
overflow: auto;
|
|
74
|
-
position: absolute;
|
|
75
|
-
left: auto;
|
|
76
|
-
top: 0;
|
|
77
|
-
right: 0;
|
|
78
|
-
bottom: 0;
|
|
79
|
-
border-top-left-radius: var(--lt-border-radius);
|
|
80
|
-
border-bottom-left-radius: var(--lt-border-radius);
|
|
81
|
-
background: var(--pal-
|
|
82
|
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
|
|
83
|
-
max-width: var(--ui-sidebar-max-w);
|
|
84
|
-
min-width: var(--ui-sidebar-min-w);
|
|
85
|
-
transform-origin: 100% 50%;
|
|
86
|
-
width: var(--ui-sidebar-width, auto);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&_close {
|
|
90
|
-
--icon-color: var(--pal-grey800);
|
|
91
|
-
|
|
92
|
-
position: absolute;
|
|
93
|
-
top: spacing(500);
|
|
94
|
-
left: spacing(500);
|
|
95
|
-
border: none;
|
|
96
|
-
padding: 0;
|
|
97
|
-
background: transparent;
|
|
98
|
-
cursor: pointer;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.bounce-enter-active {
|
|
103
|
-
animation: slide-right 200ms;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.bounce-leave-active {
|
|
107
|
-
animation: slide-right 200ms reverse;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
@keyframes slide-right {
|
|
111
|
-
0% {
|
|
112
|
-
transform: translateX(100%);
|
|
113
|
-
}
|
|
114
|
-
100% {
|
|
115
|
-
transform: translateX(0);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="{'_shown':isOpen}" class="ui-sidebar" @mousedown.self="$emit('close')">
|
|
3
|
+
<transition name="bounce">
|
|
4
|
+
<div v-if="isOpen" class="ui-sidebar_content">
|
|
5
|
+
<button v-if="showClose" class="ui-sidebar_close" @click="$emit('close')">
|
|
6
|
+
<ui-icon name="cross" />
|
|
7
|
+
</button>
|
|
8
|
+
<slot />
|
|
9
|
+
</div>
|
|
10
|
+
</transition>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import { defineComponent } from 'vue'
|
|
16
|
+
|
|
17
|
+
import UiIcon from './UiIcon.vue'
|
|
18
|
+
|
|
19
|
+
export default defineComponent({
|
|
20
|
+
name: 'ui-sidebar',
|
|
21
|
+
components: { UiIcon },
|
|
22
|
+
emits: [ 'close' ],
|
|
23
|
+
props: {
|
|
24
|
+
isOpen: { type: Boolean, default: false },
|
|
25
|
+
// todo: right side as well
|
|
26
|
+
side: { type: String, default: 'right' },
|
|
27
|
+
showClose: { type: Boolean, default: false },
|
|
28
|
+
},
|
|
29
|
+
watch: {
|
|
30
|
+
isOpen (val) {
|
|
31
|
+
if (val) document.body.style.overflow = 'hidden'
|
|
32
|
+
else document.body.style.overflow = 'visible'
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style lang="scss">
|
|
39
|
+
@import "../../scss";
|
|
40
|
+
|
|
41
|
+
html {
|
|
42
|
+
--ui-sidebar-max-w: 45vw;
|
|
43
|
+
--ui-sidebar-min-w: 25vw;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
46
|
+
|
|
47
|
+
<style lang="scss" scoped>
|
|
48
|
+
@import "../../scss";
|
|
49
|
+
|
|
50
|
+
.ui-sidebar {
|
|
51
|
+
position: fixed;
|
|
52
|
+
left: 0;
|
|
53
|
+
top: 0;
|
|
54
|
+
right: 0;
|
|
55
|
+
bottom: 0;
|
|
56
|
+
z-index: var(--lt-z-nav);
|
|
57
|
+
background-color: transparent;
|
|
58
|
+
transition-timing-function: linear;
|
|
59
|
+
transition-duration: 200ms;
|
|
60
|
+
transition-property: background-color, visibility;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
visibility: hidden;
|
|
63
|
+
|
|
64
|
+
&._shown {
|
|
65
|
+
background: var(--pal-overlay);
|
|
66
|
+
visibility: visible;
|
|
67
|
+
pointer-events: unset;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&_content {
|
|
71
|
+
@include scrollbar-awesome();
|
|
72
|
+
|
|
73
|
+
overflow: auto;
|
|
74
|
+
position: absolute;
|
|
75
|
+
left: auto;
|
|
76
|
+
top: 0;
|
|
77
|
+
right: 0;
|
|
78
|
+
bottom: 0;
|
|
79
|
+
border-top-left-radius: var(--lt-border-radius);
|
|
80
|
+
border-bottom-left-radius: var(--lt-border-radius);
|
|
81
|
+
background: var(--pal-back);
|
|
82
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
|
|
83
|
+
max-width: var(--ui-sidebar-max-w);
|
|
84
|
+
min-width: var(--ui-sidebar-min-w);
|
|
85
|
+
transform-origin: 100% 50%;
|
|
86
|
+
width: var(--ui-sidebar-width, auto);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&_close {
|
|
90
|
+
--icon-color: var(--pal-grey800);
|
|
91
|
+
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: spacing(500);
|
|
94
|
+
left: spacing(500);
|
|
95
|
+
border: none;
|
|
96
|
+
padding: 0;
|
|
97
|
+
background: transparent;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.bounce-enter-active {
|
|
103
|
+
animation: slide-right 200ms;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.bounce-leave-active {
|
|
107
|
+
animation: slide-right 200ms reverse;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@keyframes slide-right {
|
|
111
|
+
0% {
|
|
112
|
+
transform: translateX(100%);
|
|
113
|
+
}
|
|
114
|
+
100% {
|
|
115
|
+
transform: translateX(0);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="{'_disabled': disabled || $attrs.readOnly !== undefined, 'ui-text': !naked }"
|
|
4
|
-
v-bind="{ class: $attrs.class }"
|
|
5
|
-
>
|
|
6
|
-
<slot />
|
|
7
|
-
<slot name="left" />
|
|
8
|
-
<input
|
|
9
|
-
ref="inputRef"
|
|
10
|
-
:class="{ _naked: naked }"
|
|
11
|
-
:value="modelValue"
|
|
12
|
-
class="ui-text_input"
|
|
13
|
-
v-bind="{...$attrs, disabled, class: undefined}"
|
|
14
|
-
@focus="handleFocus"
|
|
15
|
-
@input="$emit('update:modelValue', $event.target.value)"
|
|
16
|
-
>
|
|
17
|
-
<slot name="right" />
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<script>
|
|
22
|
-
import { defineComponent } from 'vue'
|
|
23
|
-
|
|
24
|
-
export default defineComponent({
|
|
25
|
-
name: 'ui-text',
|
|
26
|
-
props: {
|
|
27
|
-
disabled: { type: Boolean, default: false },
|
|
28
|
-
autoSelect: { type: Boolean, default: false },
|
|
29
|
-
naked: { type: Boolean, default: false },
|
|
30
|
-
modelValue: {
|
|
31
|
-
type: [ String, Number ],
|
|
32
|
-
default: '',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
emits: [ 'update:modelValue' ],
|
|
36
|
-
expose: [ 'focus' ],
|
|
37
|
-
methods: {
|
|
38
|
-
focus () {
|
|
39
|
-
this.$refs.inputRef.focus()
|
|
40
|
-
},
|
|
41
|
-
handleFocus () {
|
|
42
|
-
if (this.autoSelect) this.$refs.inputRef.select()
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
})
|
|
46
|
-
</script>
|
|
47
|
-
<style lang="scss" scoped>
|
|
48
|
-
@import "../../scss";
|
|
49
|
-
|
|
50
|
-
.ui-text {
|
|
51
|
-
@include typo(200);
|
|
52
|
-
|
|
53
|
-
padding: 0;
|
|
54
|
-
display: flex;
|
|
55
|
-
box-sizing: border-box;
|
|
56
|
-
align-items: center;
|
|
57
|
-
justify-content: stretch;
|
|
58
|
-
border-style: var(--ui-lt-border-style);
|
|
59
|
-
border-width: var(--ui-lt-border-width);
|
|
60
|
-
border-color: var(--ui-pal-lateral);
|
|
61
|
-
border-radius: var(--ui-lt-border-radius);
|
|
62
|
-
transition-duration: 240ms;
|
|
63
|
-
transition-timing-function: ease-in-out;
|
|
64
|
-
transition-property: border-color, box-shadow;
|
|
65
|
-
height: var(--ui-lt-h);
|
|
66
|
-
background: var(--ui-pal-bg);
|
|
67
|
-
|
|
68
|
-
&_input {
|
|
69
|
-
@include typo(200);
|
|
70
|
-
padding: var(--ui-input-padding, #{spacing(100)} #{spacing(300)});
|
|
71
|
-
|
|
72
|
-
font-family: var(--typo-font-ui);
|
|
73
|
-
color: var(--ui-pal-text);
|
|
74
|
-
caret-color: var(--ui-pal);
|
|
75
|
-
min-height: min(100%);
|
|
76
|
-
border: none;
|
|
77
|
-
outline: none;
|
|
78
|
-
background: transparent;
|
|
79
|
-
box-sizing: border-box;
|
|
80
|
-
flex: 1;
|
|
81
|
-
display: block;
|
|
82
|
-
min-width: 0;
|
|
83
|
-
margin: 0;
|
|
84
|
-
|
|
85
|
-
&::selection {
|
|
86
|
-
background-color: var(--ui-pal);
|
|
87
|
-
color: var(--ui-pal-text-select);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
&::placeholder {
|
|
91
|
-
color: var(--ui-pal-placeholder);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&[disabled], &[read-only] {
|
|
95
|
-
cursor: not-allowed;
|
|
96
|
-
color: var(--ui-pal-disabled-border);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&._naked {
|
|
100
|
-
padding: var(--ui-input-padding, 0);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
&:hover {
|
|
105
|
-
outline: none;
|
|
106
|
-
box-shadow: 0 5px 12px -4px rgb(var(--rgb-front), 0.2);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
&:focus-within {
|
|
110
|
-
outline: none;
|
|
111
|
-
box-shadow: 0 0 0 0 var(--ui-pal);
|
|
112
|
-
border-color: var(--ui-pal);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&._disabled {
|
|
116
|
-
border: var(--ui-lt-border-width) var(--ui-lt-disabled-border-style) var(--ui-pal-disabled-border);
|
|
117
|
-
background: var(--ui-pal-bg);
|
|
118
|
-
box-shadow: none;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="{'_disabled': disabled || $attrs.readOnly !== undefined, 'ui-text': !naked }"
|
|
4
|
+
v-bind="{ class: $attrs.class }"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
7
|
+
<slot name="left" />
|
|
8
|
+
<input
|
|
9
|
+
ref="inputRef"
|
|
10
|
+
:class="{ _naked: naked }"
|
|
11
|
+
:value="modelValue"
|
|
12
|
+
class="ui-text_input"
|
|
13
|
+
v-bind="{...$attrs, disabled, class: undefined}"
|
|
14
|
+
@focus="handleFocus"
|
|
15
|
+
@input="$emit('update:modelValue', $event.target.value)"
|
|
16
|
+
>
|
|
17
|
+
<slot name="right" />
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
import { defineComponent } from 'vue'
|
|
23
|
+
|
|
24
|
+
export default defineComponent({
|
|
25
|
+
name: 'ui-text',
|
|
26
|
+
props: {
|
|
27
|
+
disabled: { type: Boolean, default: false },
|
|
28
|
+
autoSelect: { type: Boolean, default: false },
|
|
29
|
+
naked: { type: Boolean, default: false },
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: [ String, Number ],
|
|
32
|
+
default: '',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
emits: [ 'update:modelValue' ],
|
|
36
|
+
expose: [ 'focus' ],
|
|
37
|
+
methods: {
|
|
38
|
+
focus () {
|
|
39
|
+
this.$refs.inputRef.focus()
|
|
40
|
+
},
|
|
41
|
+
handleFocus () {
|
|
42
|
+
if (this.autoSelect) this.$refs.inputRef.select()
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
</script>
|
|
47
|
+
<style lang="scss" scoped>
|
|
48
|
+
@import "../../scss";
|
|
49
|
+
|
|
50
|
+
.ui-text {
|
|
51
|
+
@include typo(200);
|
|
52
|
+
|
|
53
|
+
padding: 0;
|
|
54
|
+
display: flex;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: stretch;
|
|
58
|
+
border-style: var(--ui-lt-border-style);
|
|
59
|
+
border-width: var(--ui-lt-border-width);
|
|
60
|
+
border-color: var(--ui-pal-lateral);
|
|
61
|
+
border-radius: var(--ui-lt-border-radius);
|
|
62
|
+
transition-duration: 240ms;
|
|
63
|
+
transition-timing-function: ease-in-out;
|
|
64
|
+
transition-property: border-color, box-shadow;
|
|
65
|
+
height: var(--ui-lt-h);
|
|
66
|
+
background: var(--ui-pal-bg);
|
|
67
|
+
|
|
68
|
+
&_input {
|
|
69
|
+
@include typo(200);
|
|
70
|
+
padding: var(--ui-input-padding, #{spacing(100)} #{spacing(300)});
|
|
71
|
+
|
|
72
|
+
font-family: var(--typo-font-ui);
|
|
73
|
+
color: var(--ui-pal-text);
|
|
74
|
+
caret-color: var(--ui-pal);
|
|
75
|
+
min-height: min(100%);
|
|
76
|
+
border: none;
|
|
77
|
+
outline: none;
|
|
78
|
+
background: transparent;
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
flex: 1;
|
|
81
|
+
display: block;
|
|
82
|
+
min-width: 0;
|
|
83
|
+
margin: 0;
|
|
84
|
+
|
|
85
|
+
&::selection {
|
|
86
|
+
background-color: var(--ui-pal);
|
|
87
|
+
color: var(--ui-pal-text-select);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&::placeholder {
|
|
91
|
+
color: var(--ui-pal-placeholder);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&[disabled], &[read-only] {
|
|
95
|
+
cursor: not-allowed;
|
|
96
|
+
color: var(--ui-pal-disabled-border);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&._naked {
|
|
100
|
+
padding: var(--ui-input-padding, 0);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:hover {
|
|
105
|
+
outline: none;
|
|
106
|
+
box-shadow: 0 5px 12px -4px rgb(var(--rgb-front), 0.2);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:focus-within {
|
|
110
|
+
outline: none;
|
|
111
|
+
box-shadow: 0 0 0 0 var(--ui-pal);
|
|
112
|
+
border-color: var(--ui-pal);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&._disabled {
|
|
116
|
+
border: var(--ui-lt-border-width) var(--ui-lt-disabled-border-style) var(--ui-pal-disabled-border);
|
|
117
|
+
background: var(--ui-pal-bg);
|
|
118
|
+
box-shadow: none;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
</style>
|