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.
@@ -1,117 +1,117 @@
1
- <template>
2
- <div
3
- :class="{'_disabled': $attrs.disabled !== undefined || $attrs.readOnly !== undefined }"
4
- class="ui-text"
5
- v-bind="{ class: $attrs.class }"
6
- >
7
- <textarea
8
- ref="textarea"
9
- :value="modelValue"
10
- class="ui-text_textarea"
11
- v-bind="{...$attrs, class: undefined}"
12
- @input="handleInput"
13
- />
14
- </div>
15
- </template>
16
-
17
- <script>
18
- import { defineComponent, onMounted, ref } from 'vue'
19
-
20
- export default defineComponent({
21
- name: 'ui-textarea',
22
- props: {
23
- modelValue: {
24
- type: [ String, Number ],
25
- default: '',
26
- },
27
- autoResize: { type: Boolean, default: false },
28
- },
29
- emits: [ 'update:modelValue' ],
30
- setup (props, { emit }) {
31
- const textarea = ref(null)
32
- const handleInput = async (e) => {
33
- emit('update:modelValue', e.target.value)
34
- resize(e.target)
35
- }
36
- const resize = (elm) => {
37
- if (!props.autoResize) return
38
- elm.style.height = 'auto'
39
- elm.style.height = `${ elm.scrollHeight }px`
40
- }
41
- onMounted(() => resize(textarea.value))
42
-
43
- return { handleInput, textarea }
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
- min-height: var(--ui-lt-h);
66
- background: var(--ui-pal-bg);
67
-
68
- &_textarea {
69
- @include scrollbar-awesome();
70
- @include typo(200);
71
- padding: spacing(200, 300);
72
- margin: spacing(100, 100, 100, 0);
73
-
74
- color: var(--ui-pal-text);
75
- caret-color: var(--ui-pal);
76
- border: 0 none;
77
- outline: none;
78
- background: transparent;
79
- box-sizing: border-box;
80
- flex: 1;
81
- display: block;
82
- min-width: var(--ui-textarea-min-w, 0);
83
- max-width: var(--ui-textarea-max-w, unset);
84
- resize: var(--ui-textarea-resize, vertical);
85
- min-height: var(--ui-textarea-min-h, 4em);
86
- max-height: var(--ui-textarea-max-h, 400px);
87
- height: var(--ui-lt-h);
88
- font-family: var(--typo-font-ui);
89
-
90
- &::selection {
91
- background-color: var(--ui-pal);
92
- color: var(--ui-pal-text-select);
93
- }
94
-
95
- &[disabled], &[read-only] {
96
- cursor: text;
97
- color: var(--ui-pal-disabled-border);
98
- }
99
- }
100
-
101
- &:hover {
102
- outline: none;
103
- box-shadow: 0 5px 12px -4px rgb(var(--rgb-front), 0.2);
104
- }
105
-
106
- &:focus-within {
107
- outline: none;
108
- box-shadow: 0 0 0 0 var(--ui-pal);
109
- border-color: var(--ui-pal);
110
- }
111
-
112
- &._disabled {
113
- border: var(--ui-lt-border-width) var(--ui-lt-disabled-border-style) var(--ui-pal-disabled-border);
114
- box-shadow: none;
115
- }
116
- }
117
- </style>
1
+ <template>
2
+ <div
3
+ :class="{'_disabled': $attrs.disabled !== undefined || $attrs.readOnly !== undefined }"
4
+ class="ui-text"
5
+ v-bind="{ class: $attrs.class }"
6
+ >
7
+ <textarea
8
+ ref="textarea"
9
+ :value="modelValue"
10
+ class="ui-text_textarea"
11
+ v-bind="{...$attrs, class: undefined}"
12
+ @input="handleInput"
13
+ />
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ import { defineComponent, onMounted, ref } from 'vue'
19
+
20
+ export default defineComponent({
21
+ name: 'ui-textarea',
22
+ props: {
23
+ modelValue: {
24
+ type: [ String, Number ],
25
+ default: '',
26
+ },
27
+ autoResize: { type: Boolean, default: false },
28
+ },
29
+ emits: [ 'update:modelValue' ],
30
+ setup (props, { emit }) {
31
+ const textarea = ref(null)
32
+ const handleInput = async (e) => {
33
+ emit('update:modelValue', e.target.value)
34
+ resize(e.target)
35
+ }
36
+ const resize = (elm) => {
37
+ if (!props.autoResize) return
38
+ elm.style.height = 'auto'
39
+ elm.style.height = `${ elm.scrollHeight }px`
40
+ }
41
+ onMounted(() => resize(textarea.value))
42
+
43
+ return { handleInput, textarea }
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
+ min-height: var(--ui-lt-h);
66
+ background: var(--ui-pal-bg);
67
+
68
+ &_textarea {
69
+ @include scrollbar-awesome();
70
+ @include typo(200);
71
+ padding: spacing(200, 300);
72
+ margin: spacing(100, 100, 100, 0);
73
+
74
+ color: var(--ui-pal-text);
75
+ caret-color: var(--ui-pal);
76
+ border: 0 none;
77
+ outline: none;
78
+ background: transparent;
79
+ box-sizing: border-box;
80
+ flex: 1;
81
+ display: block;
82
+ min-width: var(--ui-textarea-min-w, 0);
83
+ max-width: var(--ui-textarea-max-w, unset);
84
+ resize: var(--ui-textarea-resize, vertical);
85
+ min-height: var(--ui-textarea-min-h, 4em);
86
+ max-height: var(--ui-textarea-max-h, 400px);
87
+ height: var(--ui-lt-h);
88
+ font-family: var(--typo-font-ui);
89
+
90
+ &::selection {
91
+ background-color: var(--ui-pal);
92
+ color: var(--ui-pal-text-select);
93
+ }
94
+
95
+ &[disabled], &[read-only] {
96
+ cursor: text;
97
+ color: var(--ui-pal-disabled-border);
98
+ }
99
+ }
100
+
101
+ &:hover {
102
+ outline: none;
103
+ box-shadow: 0 5px 12px -4px rgb(var(--rgb-front), 0.2);
104
+ }
105
+
106
+ &:focus-within {
107
+ outline: none;
108
+ box-shadow: 0 0 0 0 var(--ui-pal);
109
+ border-color: var(--ui-pal);
110
+ }
111
+
112
+ &._disabled {
113
+ border: var(--ui-lt-border-width) var(--ui-lt-disabled-border-style) var(--ui-pal-disabled-border);
114
+ box-shadow: none;
115
+ }
116
+ }
117
+ </style>
package/src/entry.js CHANGED
@@ -1,21 +1,23 @@
1
- /* eslint-disable import/prefer-default-export */
2
-
3
- export { default as UiButton } from './components/UiButton.vue'
4
- export { default as UiButtonLink } from './components/UiButtonLink.vue'
5
- export { default as UiCodeView } from './components/UiCodeView.vue'
6
- export { default as UiCodeInput } from './components/UiCodeInput.vue'
7
- export { default as UiCopy } from './components/UiCopy.vue'
8
- export { default as UiSelect } from './components/UiSelect.vue'
9
- export { default as UiSelectX } from './components/UiSelectX.vue'
10
- export { default as UiModal } from './components/UiModal.vue'
11
- export { default as UiSidebar } from './components/UiSidebar.vue'
12
- export { default as UiText } from './components/UiText.vue'
13
- export { default as UiTextarea } from './components/UiTextarea.vue'
14
- export { default as UiCheck } from './components/UiCheck.vue'
15
- export { default as UiDropdown } from './components/UiDropdown.vue'
16
- export { default as UiDropdownItem } from './components/UiDropdownItem.vue'
17
- export { default as UiIconProvider } from './components/UiIconProvider.vue'
18
- export { default as UiIcon } from './components/UiIcon.vue'
19
- export { default as UiProgressRadial } from './components/UiProgressRadial.vue'
20
-
21
- export { default as browserTheme } from './utils/browserTheme.js'
1
+ /* eslint-disable import/prefer-default-export */
2
+
3
+ export { default as UiButton } from './components/UiButton.vue'
4
+ export { default as UiButtonLink } from './components/UiButtonLink.vue'
5
+ export { default as UiButtonRoute } from './components/UiButtonRoute.vue'
6
+ export { default as UiCodeView } from './components/UiCodeView.vue'
7
+ export { default as UiCodeInput } from './components/UiCodeInput.vue'
8
+ export { default as UiCopy } from './components/UiCopy.vue'
9
+ export { default as UiSelect } from './components/UiSelect.vue'
10
+ export { default as UiSelectX } from './components/UiSelectX.vue'
11
+ export { default as UiModal } from './components/UiModal.vue'
12
+ export { default as UiSidebar } from './components/UiSidebar.vue'
13
+ export { default as UiText } from './components/UiText.vue'
14
+ export { default as UiTextarea } from './components/UiTextarea.vue'
15
+ export { default as UiCheck } from './components/UiCheck.vue'
16
+ export { default as UiDropdown } from './components/UiDropdown.vue'
17
+ export { default as UiDropdownItem } from './components/UiDropdownItem.vue'
18
+ export { default as UiIconProvider } from './components/UiIconProvider.vue'
19
+ export { default as UiIcon } from './components/UiIcon.vue'
20
+ export { default as UiProgressRadial } from './components/UiProgressRadial.vue'
21
+ export { default as UiImg } from './components/UiImg.vue'
22
+
23
+ export { default as browserTheme } from './utils/browserTheme.js'
@@ -26,7 +26,6 @@
26
26
  //
27
27
  // COLOR HELPERS
28
28
  //
29
-
30
29
  @function pal($color-code, $opacity:1) {
31
30
  @if ($opacity < 1) {
32
31
  @return rgba(var(--pal-#{$color-code}), #{$opacity})
@@ -37,9 +36,9 @@
37
36
 
38
37
  @function pal-acc($color-code, $opacity:1) {
39
38
  @if ($opacity < 1) {
40
- @return rgba(var(--pal-acc-#{$color-code}), #{$opacity})
39
+ @return rgba(var(--pal-#{$color-code}-acc), #{$opacity})
41
40
  } @else {
42
- @return rgb(var(--pal-acc-#{$color-code}))
41
+ @return rgb(var(--pal-#{$color-code}-acc))
43
42
  }
44
43
  }
45
44
 
@@ -1,7 +1,7 @@
1
1
  $ui-media-breakpoints: (
2
- xs: 812px, // everything at this point and below is a mobile. (<= iphoneX)
3
- sm: 1200px, // everything equal or below can be considered as a tablet.
4
- md: 1440px, // ~15" laptop display and below.
2
+ xs: 812px, // everything at this point and below is a mobile. (<= iphoneX)
3
+ sm: 1200px, // everything equal or below can be considered as a tablet.
4
+ md: 1440px, // ~15" laptop display and below.
5
5
  // everything else above is a ~17" laptop or a large screen. (default)
6
6
  ) !default;
7
7
 
@@ -42,11 +42,11 @@
42
42
  --pal-warning: rgb(var(--rgb-warning));
43
43
  --pal-negative: rgb(var(--rgb-negative));
44
44
 
45
- --pal-acc-primary: rgb(var(--rgb-front));
46
- --pal-acc-secondary: rgb(var(--rgb-front));
47
- --pal-acc-positive: rgb(var(--rgb-front));
48
- --pal-acc-warning: rgb(var(--rgb-front));
49
- --pal-acc-negative: rgb(var(--rgb-front));
45
+ --pal-primary-acc: rgb(var(--rgb-front));
46
+ --pal-secondary-acc: rgb(var(--rgb-front));
47
+ --pal-positive-acc: rgb(var(--rgb-front));
48
+ --pal-warning-acc: rgb(var(--rgb-front));
49
+ --pal-negative-acc: rgb(var(--rgb-front));
50
50
 
51
51
  --pal-text: rgb(var(--rgb-grey900));
52
52
  --pal-text-dimm: rgb(var(--rgb-grey600));
@@ -63,7 +63,7 @@
63
63
  --ui-rgb: var(--rgb-primary);
64
64
  --ui-pal: var(--pal-primary);
65
65
  --ui-pal-bg: var(--pal-grey100);
66
- --ui-pal-acc: var(--pal-acc-primary);
66
+ --ui-pal-acc: var(--pal-primary-acc);
67
67
  --ui-pal-lateral: var(--pal-grey300);
68
68
  --ui-pal-text: var(--pal-front);
69
69
  --ui-pal-text-select: var(--pal-front);
@@ -14,8 +14,8 @@
14
14
  --rgb-front: #{hex2rgb(#FFFFFF)};
15
15
 
16
16
  --rgb-primary: #{hex2rgb(#ff7300)};
17
- --rgb-secondary: #{hex2rgb(#ff4400)};
18
- --rgb-positive: #{hex2rgb(#ffecdd)};
17
+ --rgb-secondary: #{hex2rgb(#ffecdd)};
18
+ --rgb-positive: #{hex2rgb(#ff4400)};
19
19
  --rgb-warning: #{hex2rgb(#ffc500)};
20
20
  --rgb-negative: #{hex2rgb(#ff3535)};
21
21
 
@@ -42,11 +42,11 @@
42
42
  --pal-warning: rgb(var(--rgb-warning));
43
43
  --pal-negative: rgb(var(--rgb-negative));
44
44
 
45
- --pal-acc-primary: rgb(var(--rgb-front));
46
- --pal-acc-secondary: rgb(var(--rgb-front));
47
- --pal-acc-positive: rgb(var(--rgb-back));
48
- --pal-acc-warning: rgb(var(--rgb-front));
49
- --pal-acc-negative: rgb(var(--rgb-front));
45
+ --pal-primary-acc: rgb(var(--rgb-front));
46
+ --pal-secondary-acc: rgb(var(--rgb-back));
47
+ --pal-positive-acc: rgb(var(--rgb-front));
48
+ --pal-warning-acc: rgb(var(--rgb-front));
49
+ --pal-negative-acc: rgb(var(--rgb-front));
50
50
 
51
51
  --pal-text: rgb(var(--rgb-grey900));
52
52
  --pal-text-dimm: rgb(var(--rgb-grey600));
@@ -63,7 +63,7 @@
63
63
  --ui-rgb: var(--rgb-primary);
64
64
  --ui-pal: var(--pal-primary);
65
65
  --ui-pal-bg: var(--pal-grey100);
66
- --ui-pal-acc: var(--pal-acc-primary);
66
+ --ui-pal-acc: var(--pal-primary-acc);
67
67
  --ui-pal-lateral: var(--pal-grey300);
68
68
  --ui-pal-text: var(--pal-front);
69
69
  --ui-pal-text-select: var(--pal-front);
@@ -42,11 +42,11 @@
42
42
  --pal-warning: rgb(var(--rgb-warning));
43
43
  --pal-negative: rgb(var(--rgb-negative));
44
44
 
45
- --pal-acc-primary: rgb(var(--rgb-back));
46
- --pal-acc-secondary: rgb(var(--rgb-back));
47
- --pal-acc-positive: rgb(var(--rgb-back));
48
- --pal-acc-warning: rgb(var(--rgb-back));
49
- --pal-acc-negative: rgb(var(--rgb-back));
45
+ --pal-primary-acc: rgb(var(--rgb-back));
46
+ --pal-secondary-acc: rgb(var(--rgb-back));
47
+ --pal-positive-acc: rgb(var(--rgb-back));
48
+ --pal-warning-acc: rgb(var(--rgb-back));
49
+ --pal-negative-acc: rgb(var(--rgb-back));
50
50
 
51
51
  --pal-text: rgb(var(--rgb-grey900));
52
52
  --pal-text-dimm: rgb(var(--rgb-grey600));
@@ -63,7 +63,7 @@
63
63
  --ui-rgb: var(--rgb-primary);
64
64
  --ui-pal: var(--pal-primary);
65
65
  --ui-pal-bg: var(--pal-bg);
66
- --ui-pal-acc: var(--pal-acc-primary);
66
+ --ui-pal-acc: var(--pal-primary-acc);
67
67
  --ui-pal-lateral: rgb(var(--rgb-grey200));
68
68
  --ui-pal-text: rgb(var(--rgb-front));
69
69
  --ui-pal-text-select: rgb(var(--rgb-back));
@@ -1,39 +1,39 @@
1
- @function typo-h($h) {
2
- @return var(--typo-h#{$h});
3
- }
4
-
5
- @function typo-lh($l) {
6
- @return var(--typo-lh#{$l});
7
- }
8
-
9
- @mixin typo($h, $l:null) {
10
- font-size: typo-h($h);
11
-
12
- @if ($l) {
13
- line-height: typo-lh($l);
14
- }
15
- }
16
-
17
- @function _spacing($spacing-code) {
18
- @if (
19
- $spacing-code == 0 or
20
- $spacing-code == auto or
21
- $spacing-code == unset or
22
- $spacing-code == null
23
- ) {
24
- @return $spacing-code;
25
- }
26
-
27
- @return var(--lt-sp#{$spacing-code});
28
- }
29
-
30
- @function spacing($t, $r: null, $b: null, $l: null) {
31
- @return _spacing($t) _spacing($r) _spacing($b) _spacing($l)
32
- }
33
-
34
- @mixin ellipsis($display: block) {
35
- display: $display;
36
- overflow: hidden;
37
- text-overflow: ellipsis;
38
- white-space: nowrap;
39
- }
1
+ @function typo-h($h) {
2
+ @return var(--typo-h#{$h});
3
+ }
4
+
5
+ @function typo-lh($l) {
6
+ @return var(--typo-lh#{$l});
7
+ }
8
+
9
+ @mixin typo($h, $l:null) {
10
+ font-size: typo-h($h);
11
+
12
+ @if ($l) {
13
+ line-height: typo-lh($l);
14
+ }
15
+ }
16
+
17
+ @function _spacing($spacing-code) {
18
+ @if (
19
+ $spacing-code == 0 or
20
+ $spacing-code == auto or
21
+ $spacing-code == unset or
22
+ $spacing-code == null
23
+ ) {
24
+ @return $spacing-code;
25
+ }
26
+
27
+ @return var(--lt-sp#{$spacing-code});
28
+ }
29
+
30
+ @function spacing($t, $r: null, $b: null, $l: null) {
31
+ @return _spacing($t) _spacing($r) _spacing($b) _spacing($l);
32
+ }
33
+
34
+ @mixin ellipsis($display: block) {
35
+ display: $display;
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ white-space: nowrap;
39
+ }
@@ -1,4 +1,4 @@
1
- $spacing_growth_k: 2;
1
+ $spacing_growth_k: 3;
2
2
 
3
3
  @mixin typo_default {
4
4
  --ui-lt-h: 36px;
@@ -24,6 +24,7 @@ $spacing_growth_k: 2;
24
24
  --typo-font-mono: monospace;
25
25
 
26
26
  // font-sizes
27
+ --typo-h50: 10px;
27
28
  --typo-h100: 12px;
28
29
  --typo-h200: 14px;
29
30
  --typo-h300: 16px;
@@ -35,6 +36,7 @@ $spacing_growth_k: 2;
35
36
  --typo-h900: 42px;
36
37
 
37
38
  // line heights
39
+ --typo-lh50: 12px;
38
40
  --typo-lh100: 14px;
39
41
  --typo-lh200: 16px;
40
42
  --typo-lh300: 18px;
@@ -68,4 +70,4 @@ $spacing_growth_k: 2;
68
70
  --lt-z-modal: 3001;
69
71
 
70
72
  --ui-transition: linear 120ms;
71
- }
73
+ }
@@ -1,49 +1,49 @@
1
- @mixin scrollbar-awesome($hide: false) {
2
- &::-webkit-scrollbar-track {
3
- background-color: var(--ui-scroll-bg, inherit);
4
- }
5
-
6
- &::-webkit-scrollbar {
7
- width: var(--ui-scroll-width);
8
- height: var(--ui-scroll-width);
9
- border-radius: var(--ui-scroll-width);
10
- background-color: var(--ui-scroll-bg, inherit);
11
- }
12
-
13
- &::-webkit-scrollbar-thumb {
14
- border: 1px solid var(--ui-scroll-bg, inherit);
15
- border-radius: var(--ui-scroll-width);
16
- @if ($hide) {
17
- background-color: inherit;
18
- } @else {
19
- background-color: var(--ui-pal);
20
- }
21
- }
22
-
23
- ::-webkit-scrollbar-corner {
24
- background-color: transparent !important;
25
- border: 0 none !important;
26
- box-shadow: none !important;
27
- }
28
- @if ($hide) {
29
- &:focus::-webkit-scrollbar-thumb,
30
- &:hover::-webkit-scrollbar-thumb, {
31
- background-color: var(--ui-pal);
32
- }
33
- }
34
- }
35
-
36
- @mixin scrollbar-invisible() {
37
- &::-webkit-scrollbar {
38
- width: 0;
39
- background-color: transparent;
40
- display: none;
41
- }
42
-
43
- &::-webkit-scrollbar-thumb {
44
- background-color: transparent;
45
- }
46
-
47
- -ms-overflow-style: none;
48
- scrollbar-width: none;
49
- }
1
+ @mixin scrollbar-awesome($hide: false) {
2
+ &::-webkit-scrollbar-track {
3
+ background-color: var(--ui-scroll-bg, inherit);
4
+ }
5
+
6
+ &::-webkit-scrollbar {
7
+ width: var(--ui-scroll-width);
8
+ height: var(--ui-scroll-width);
9
+ border-radius: var(--ui-scroll-width);
10
+ background-color: var(--ui-scroll-bg, inherit);
11
+ }
12
+
13
+ &::-webkit-scrollbar-thumb {
14
+ border: 1px solid var(--ui-scroll-bg, inherit);
15
+ border-radius: var(--ui-scroll-width);
16
+ @if ($hide) {
17
+ background-color: inherit;
18
+ } @else {
19
+ background-color: var(--ui-pal);
20
+ }
21
+ }
22
+
23
+ ::-webkit-scrollbar-corner {
24
+ background-color: transparent !important;
25
+ border: 0 none !important;
26
+ box-shadow: none !important;
27
+ }
28
+ @if ($hide) {
29
+ &:focus::-webkit-scrollbar-thumb,
30
+ &:hover::-webkit-scrollbar-thumb, {
31
+ background-color: var(--ui-pal);
32
+ }
33
+ }
34
+ }
35
+
36
+ @mixin scrollbar-invisible() {
37
+ &::-webkit-scrollbar {
38
+ width: 0;
39
+ background-color: transparent;
40
+ display: none;
41
+ }
42
+
43
+ &::-webkit-scrollbar-thumb {
44
+ background-color: transparent;
45
+ }
46
+
47
+ -ms-overflow-style: none;
48
+ scrollbar-width: none;
49
+ }