@toife/vue 3.1.5 → 3.1.6
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 +4 -4
- package/src/components/action/action.scss +1 -1
- package/src/components/app/app.scss +1 -1
- package/src/components/app/app.type.ts +0 -6
- package/src/components/app/app.vue +1 -7
- package/src/components/avatar/avatar.scss +1 -1
- package/src/components/button/button.scss +16 -8
- package/src/components/button/button.type.ts +2 -4
- package/src/components/card/card/card.scss +1 -1
- package/src/components/card/card-body/card-body.scss +1 -1
- package/src/components/card/card-footer/card-footer.scss +1 -1
- package/src/components/card/card-header/card-header.scss +1 -1
- package/src/components/checkbox/checkbox.scss +1 -1
- package/src/components/checkbox/checkbox.type.ts +1 -3
- package/src/components/collapse/collapse.scss +2 -5
- package/src/components/decision-modal/decision-modal.scss +2 -2
- package/src/components/divider/divider.scss +1 -1
- package/src/components/dropdown/dropdown.scss +1 -1
- package/src/components/dropdown/dropdown.type.ts +2 -2
- package/src/components/field/field.html +28 -9
- package/src/components/field/{outline/outline.scss → field.scss} +20 -118
- package/src/components/field/field.type.ts +2 -2
- package/src/components/field/field.vue +83 -46
- package/src/components/field/index.ts +1 -1
- package/src/components/gesture-indicator/gesture-indicator.scss +1 -1
- package/src/components/modal/modal.scss +1 -1
- package/src/components/present/present.scss +1 -1
- package/src/components/present/present.vue +1 -1
- package/src/components/radio/radio/radio.scss +1 -1
- package/src/components/radio/radio/radio.type.ts +1 -3
- package/src/components/route/route-navigator/route-navigator.html +1 -1
- package/src/components/route/route-navigator/route-navigator.scss +1 -1
- package/src/components/route/route-navigator/route-navigator.vue +1 -1
- package/src/components/segmented-field/segmented-field.scss +1 -1
- package/src/components/select/select.scss +1 -1
- package/src/components/skeleton/skeleton.scss +1 -1
- package/src/components/slide-range/slide-range.scss +7 -4
- package/src/components/slide-range/slide-range.vue +1 -0
- package/src/components/switch/switch.scss +1 -1
- package/src/components/switch/switch.type.ts +1 -3
- package/src/components/tabs/tabs/tabs.scss +1 -5
- package/src/components/tabs/tabs/tabs.type.ts +1 -2
- package/src/components/toast/toast/toast.scss +1 -1
- package/src/components/toast/toast-content/toast-content.scss +1 -1
- package/src/components/toolbar/toolbar.scss +1 -1
- package/src/components/field/outline/index.ts +0 -1
- package/src/components/field/outline/outline.html +0 -36
- package/src/components/field/outline/outline.vue +0 -294
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toife/vue",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"description": "A Frontend framework for Vue",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"frontend",
|
|
24
24
|
"web"
|
|
25
25
|
],
|
|
26
|
-
"author": "
|
|
26
|
+
"author": "lamtoi",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@commitlint/cli": "^20.4.4",
|
|
48
48
|
"@commitlint/config-conventional": "^20.4.4",
|
|
49
|
-
"@toife/gesture": "^1.1.
|
|
50
|
-
"@toife/sass-layer": "^1.
|
|
49
|
+
"@toife/gesture": "^1.1.6",
|
|
50
|
+
"@toife/sass-layer": "^1.1.2",
|
|
51
51
|
"@types/node": "^25.0.3",
|
|
52
52
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
53
53
|
"husky": "^9.1.7",
|
|
@@ -13,7 +13,7 @@ $width: sass.fn-naming-var("viewport", "width");
|
|
|
13
13
|
$max-width: sass.fn-naming-var("overlay", "max-width");
|
|
14
14
|
$height: sass.fn-naming-var("viewport", "height");
|
|
15
15
|
$max-height: sass.fn-naming-var("overlay", "max-height");
|
|
16
|
-
$transition-duration: sass.fn-naming-var("
|
|
16
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
17
17
|
$safe-area-bottom: sass.fn-naming-var("safe-area", "bottom");
|
|
18
18
|
$safe-area-top: sass.fn-naming-var("safe-area", "top");
|
|
19
19
|
$safe-area-left: sass.fn-naming-var("safe-area", "left");
|
|
@@ -6,7 +6,7 @@ $app: sass.fn-naming-prefix("app");
|
|
|
6
6
|
// Property name - layer: app
|
|
7
7
|
$app-background-color: sass.fn-naming-var("app", "background-color");
|
|
8
8
|
$app-color: sass.fn-naming-var("app", "color");
|
|
9
|
-
$transition-duration: sass.fn-naming-var("
|
|
9
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
10
10
|
|
|
11
11
|
.#{$app} {
|
|
12
12
|
width: #{sass.fn-naming-var("viewport", "width")};
|
|
@@ -5,11 +5,6 @@ import type { Ref } from "vue";
|
|
|
5
5
|
*/
|
|
6
6
|
export type AppDirection = "left" | "right";
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* App Size Type
|
|
10
|
-
*/
|
|
11
|
-
export type AppSize = "small" | "standard" | "large";
|
|
12
|
-
|
|
13
8
|
/**
|
|
14
9
|
* App Props Type
|
|
15
10
|
*/
|
|
@@ -20,7 +15,6 @@ export type AppProps = {
|
|
|
20
15
|
shadow?: boolean;
|
|
21
16
|
triple?: boolean;
|
|
22
17
|
direction?: AppDirection;
|
|
23
|
-
size?: AppSize;
|
|
24
18
|
};
|
|
25
19
|
|
|
26
20
|
/**
|
|
@@ -18,7 +18,6 @@ const props = withDefaults(defineProps<AppProps>(), {
|
|
|
18
18
|
shadow: false,
|
|
19
19
|
triple: false,
|
|
20
20
|
direction: "left",
|
|
21
|
-
size: "standard",
|
|
22
21
|
});
|
|
23
22
|
const { shape, divider, role, shadow, triple, direction } = toRefs(props);
|
|
24
23
|
const decisionModal = useDecisionModal();
|
|
@@ -29,12 +28,7 @@ const action = useAction();
|
|
|
29
28
|
// Root layout classes for the application shell (global theme layer)
|
|
30
29
|
const appAttrs = computed(() => {
|
|
31
30
|
return {
|
|
32
|
-
class: [
|
|
33
|
-
cssPrefix("app"),
|
|
34
|
-
cssPrefix(["layer", "app"]),
|
|
35
|
-
cssPrefix(["shape", shape.value]),
|
|
36
|
-
cssPrefix(["size", props.size]),
|
|
37
|
-
],
|
|
31
|
+
class: [cssPrefix("app"), cssPrefix(["layer", "app"]), cssPrefix(["shape", shape.value])],
|
|
38
32
|
};
|
|
39
33
|
});
|
|
40
34
|
|
|
@@ -9,7 +9,7 @@ $radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
|
9
9
|
$radius-size: sass.fn-naming-var("radius-size");
|
|
10
10
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
11
11
|
$width: sass.fn-naming-var("width");
|
|
12
|
-
$transition-duration: sass.fn-naming-var("
|
|
12
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
13
13
|
|
|
14
14
|
$avatar-background-color: sass.fn-naming-var("avatar", "background-color");
|
|
15
15
|
$avatar-border-color: sass.fn-naming-var("avatar", "border-color");
|
|
@@ -8,7 +8,7 @@ $loader: sass.fn-naming-prefix("loader");
|
|
|
8
8
|
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
9
9
|
$radius-size: sass.fn-naming-var("radius-size");
|
|
10
10
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
11
|
-
$transition-duration: sass.fn-naming-var("
|
|
11
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
12
12
|
$spacing-x: sass.fn-naming-var("spacing", "x");
|
|
13
13
|
$spacing-y: sass.fn-naming-var("spacing", "y");
|
|
14
14
|
|
|
@@ -62,13 +62,21 @@ $size-line-height: sass.fn-naming-var("line-height");
|
|
|
62
62
|
height: #{$size-control-block-size};
|
|
63
63
|
line-height: #{$size-line-height};
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
// Text variant
|
|
66
|
+
&.text {
|
|
67
|
+
background-color: transparent;
|
|
68
|
+
border-color: transparent;
|
|
69
|
+
color: rgba(#{$button-background-color});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Fill variant
|
|
73
|
+
&.fill:hover {
|
|
66
74
|
border-color: rgba(#{$button-border-color-hover});
|
|
67
75
|
background-color: rgba(#{$button-background-color-hover});
|
|
68
76
|
}
|
|
69
77
|
|
|
70
|
-
&.focus,
|
|
71
|
-
|
|
78
|
+
&.fill.focus,
|
|
79
|
+
&.fill:focus {
|
|
72
80
|
border-color: rgba(#{$button-border-color-focus});
|
|
73
81
|
background-color: rgba(#{$button-background-color-focus});
|
|
74
82
|
|
|
@@ -77,14 +85,14 @@ $size-line-height: sass.fn-naming-var("line-height");
|
|
|
77
85
|
}
|
|
78
86
|
}
|
|
79
87
|
|
|
80
|
-
|
|
81
|
-
&.active {
|
|
88
|
+
&.fill:active,
|
|
89
|
+
&.fill.active {
|
|
82
90
|
border-color: rgba(#{$button-border-color-active});
|
|
83
91
|
background-color: rgba(#{$button-background-color-active});
|
|
84
92
|
}
|
|
85
93
|
|
|
86
|
-
|
|
87
|
-
&.disabled {
|
|
94
|
+
&.fill:disabled,
|
|
95
|
+
&.fill.disabled {
|
|
88
96
|
border-color: rgba(#{$button-border-color-disabled});
|
|
89
97
|
background-color: rgba(#{$button-background-color-disabled});
|
|
90
98
|
color: rgba(#{$button-color-disabled});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { AppSize } from "../app";
|
|
2
|
-
|
|
3
1
|
// Type definitions
|
|
4
|
-
export type ButtonVariant = "fill" | "outline" | "text"
|
|
2
|
+
export type ButtonVariant = "fill" | "outline" | "text";
|
|
5
3
|
|
|
6
|
-
export type ButtonSize =
|
|
4
|
+
export type ButtonSize = string;
|
|
7
5
|
|
|
8
6
|
export type ButtonProps = {
|
|
9
7
|
role?: string;
|
|
@@ -9,7 +9,7 @@ $card-color: sass.fn-naming-var("card", "color");
|
|
|
9
9
|
|
|
10
10
|
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
11
11
|
$radius-size: sass.fn-naming-var("radius-size");
|
|
12
|
-
$transition-duration: sass.fn-naming-var("
|
|
12
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
13
13
|
$border-radius: calc(#{$radius-size} * #{$radius-ratio});
|
|
14
14
|
|
|
15
15
|
.#{$card} {
|
|
@@ -8,7 +8,7 @@ $card-background-color: sass.fn-naming-var("card", "background-color");
|
|
|
8
8
|
$card-color: sass.fn-naming-var("card", "color");
|
|
9
9
|
$padding-y: sass.fn-naming-var("spacing", "y");
|
|
10
10
|
$padding-x: sass.fn-naming-var("spacing", "x");
|
|
11
|
-
$transition-duration: sass.fn-naming-var("
|
|
11
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
12
12
|
|
|
13
13
|
.#{$card-body} {
|
|
14
14
|
background-color: rgba(#{$card-background-color});
|
|
@@ -12,7 +12,7 @@ $padding-y: sass.fn-naming-var("spacing", "y");
|
|
|
12
12
|
$padding-x: sass.fn-naming-var("spacing", "x");
|
|
13
13
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
14
14
|
$border: #{$border-width} solid transparent;
|
|
15
|
-
$transition-duration: sass.fn-naming-var("
|
|
15
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
16
16
|
|
|
17
17
|
.#{$card-footer} {
|
|
18
18
|
background-color: rgba(#{$card-background-color});
|
|
@@ -12,7 +12,7 @@ $padding-y: sass.fn-naming-var("spacing", "y");
|
|
|
12
12
|
$padding-x: sass.fn-naming-var("spacing", "x");
|
|
13
13
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
14
14
|
$border: #{$border-width} solid transparent;
|
|
15
|
-
$transition-duration: sass.fn-naming-var("
|
|
15
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
16
16
|
|
|
17
17
|
.#{$card-header} {
|
|
18
18
|
background-color: rgba(#{$card-background-color});
|
|
@@ -31,7 +31,7 @@ $checkbox-border-color-disabled: sass.fn-naming-var("checkbox", "border-color",
|
|
|
31
31
|
|
|
32
32
|
$checkbox-box-shadow-color-focus: sass.fn-naming-var("checkbox", "box-shadow-color", "focus");
|
|
33
33
|
|
|
34
|
-
$transition-duration: sass.fn-naming-var("
|
|
34
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
35
35
|
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
36
36
|
$radius-size: sass.fn-naming-var("radius-size");
|
|
37
37
|
$size-control-mark-size: sass.fn-naming-var("control-mark-size");
|
|
@@ -8,14 +8,11 @@ $collapse-content-inner: sass.fn-naming-prefix("collapse-content-inner");
|
|
|
8
8
|
|
|
9
9
|
// Property name - layer: collapse
|
|
10
10
|
$collapse-height: sass.fn-naming-dvar(("collapse", "height"), 0);
|
|
11
|
-
$collapse-duration: sass.fn-naming-dvar(
|
|
12
|
-
("collapse", "duration"),
|
|
13
|
-
sass.fn-naming-var("motion", "duration")
|
|
14
|
-
);
|
|
11
|
+
$collapse-duration: sass.fn-naming-dvar(("collapse", "duration"), sass.fn-naming-var("duration"));
|
|
15
12
|
|
|
16
13
|
$collapse-background-color: sass.fn-naming-var("collapse", "background-color");
|
|
17
14
|
$collapse-color: sass.fn-naming-var("collapse", "color");
|
|
18
|
-
$transition-duration: sass.fn-naming-var("
|
|
15
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
19
16
|
|
|
20
17
|
// Collapse
|
|
21
18
|
.#{$collapse} {
|
|
@@ -21,9 +21,9 @@ $padding-y: sass.fn-naming-var("spacing", "y");
|
|
|
21
21
|
$padding-x: sass.fn-naming-var("spacing", "x");
|
|
22
22
|
$margin-y: sass.fn-naming-var("spacing", "y");
|
|
23
23
|
$margin-x: sass.fn-naming-var("spacing", "x");
|
|
24
|
-
$animation-duration: sass.fn-naming-var("
|
|
24
|
+
$animation-duration: sass.fn-naming-var("duration");
|
|
25
25
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
26
|
-
$transition-duration: sass.fn-naming-var("
|
|
26
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
27
27
|
$border-radius: calc(min(#{$width}, #{$radius-size}) * #{$radius-ratio});
|
|
28
28
|
|
|
29
29
|
.#{$decision-modal} {
|
|
@@ -6,7 +6,7 @@ $divider: sass.fn-naming-prefix("divider");
|
|
|
6
6
|
// Property name - layer: divider
|
|
7
7
|
$divider-border-color: sass.fn-naming-var("divider", "border-color");
|
|
8
8
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
9
|
-
$transition-duration: sass.fn-naming-var("
|
|
9
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
10
10
|
|
|
11
11
|
// Divider
|
|
12
12
|
.#{$divider} {
|
|
@@ -14,7 +14,7 @@ $spacing-x: sass.fn-naming-var("spacing", "x");
|
|
|
14
14
|
$spacing-y: sass.fn-naming-var("spacing", "y");
|
|
15
15
|
$size-font-size: sass.fn-naming-var("font-size");
|
|
16
16
|
$size-line-height: sass.fn-naming-var("line-height");
|
|
17
|
-
$transition-duration: sass.fn-naming-var("
|
|
17
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
18
18
|
|
|
19
19
|
$size-control-block-size: sass.fn-naming-var("control-block-size");
|
|
20
20
|
$radius-size: sass.fn-naming-var("radius-size");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { AppDirection
|
|
1
|
+
import type { AppDirection } from "../app";
|
|
2
2
|
|
|
3
3
|
export type DropdownPlacement = "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
4
4
|
|
|
5
|
-
export type DropdownSize =
|
|
5
|
+
export type DropdownSize = string;
|
|
6
6
|
|
|
7
7
|
export type DropdownProps = {
|
|
8
8
|
modelValue?: boolean;
|
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
<
|
|
2
|
-
<
|
|
1
|
+
<div v-bind="fieldAttrs">
|
|
2
|
+
<div v-bind="fieldContentAttrs">
|
|
3
3
|
<slot name="start-input"></slot>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
<slot name="input">
|
|
5
|
+
<textarea
|
|
6
|
+
v-bind="fieldInputAttrs"
|
|
7
|
+
@input="onInput"
|
|
8
|
+
@focus="onFocus"
|
|
9
|
+
@blur="onBlur"
|
|
10
|
+
@beforeinput="onBeforeinput"
|
|
11
|
+
v-model="content"
|
|
12
|
+
:rows="line"
|
|
13
|
+
v-if="type === 'paragraph'"
|
|
14
|
+
/>
|
|
15
|
+
<input
|
|
16
|
+
v-bind="fieldInputAttrs"
|
|
17
|
+
@input="onInput"
|
|
18
|
+
@focus="onFocus"
|
|
19
|
+
@blur="onBlur"
|
|
20
|
+
@beforeinput="onBeforeinput"
|
|
21
|
+
v-model="content"
|
|
22
|
+
:type="type"
|
|
23
|
+
v-else
|
|
24
|
+
/>
|
|
25
|
+
</slot>
|
|
9
26
|
<slot name="end-input"></slot>
|
|
10
|
-
</
|
|
27
|
+
</div>
|
|
28
|
+
<div v-bind="fieldMessageAttrs" v-if="message">{{ message }}</div>
|
|
29
|
+
<div v-bind="fieldHelpAttrs" v-if="help">{{ help }}</div>
|
|
11
30
|
<slot></slot>
|
|
12
|
-
</
|
|
31
|
+
</div>
|
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
$field: sass.fn-naming-prefix("field");
|
|
5
5
|
$field-content: sass.fn-naming-prefix("field-content");
|
|
6
6
|
$field-input: sass.fn-naming-prefix("field-input");
|
|
7
|
-
$field-input-editable: sass.fn-naming-prefix("field-input-editable");
|
|
8
7
|
$field-message: sass.fn-naming-prefix("field-message");
|
|
9
8
|
$field-help: sass.fn-naming-prefix("field-help");
|
|
10
9
|
|
|
11
10
|
// Property name - layer: field
|
|
12
11
|
$field-border-color: sass.fn-naming-var("field", "border-color");
|
|
12
|
+
$field-border-color-focus: sass.fn-naming-var("field", "border-color", "focus");
|
|
13
|
+
$field-border-color-hover: sass.fn-naming-var("field", "border-color", "hover");
|
|
14
|
+
$field-border-color-active: sass.fn-naming-var("field", "border-color", "active");
|
|
15
|
+
$field-border-color-disabled: sass.fn-naming-var("field", "border-color", "disabled");
|
|
13
16
|
$field-background-color: sass.fn-naming-var("field", "background-color");
|
|
14
17
|
$field-color: sass.fn-naming-var("field", "color");
|
|
15
18
|
$field-placeholder-color: sass.fn-naming-var("field", "placeholder-color");
|
|
@@ -30,7 +33,7 @@ $size-coefficient-x: sass.fn-naming-var("coefficient-x");
|
|
|
30
33
|
$size-coefficient-y: sass.fn-naming-var("coefficient-y");
|
|
31
34
|
$size-line-height: sass.fn-naming-var("line-height");
|
|
32
35
|
|
|
33
|
-
$transition-duration: sass.fn-naming-var("
|
|
36
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
34
37
|
|
|
35
38
|
$direction-text-align: sass.fn-naming-var("text-align");
|
|
36
39
|
$direction-justify-content: sass.fn-naming-var("justify-content");
|
|
@@ -60,38 +63,6 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
60
63
|
align-items: center;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
// Input shell wrapping contenteditable (flex layout); must not apply display:flex to <input>.
|
|
64
|
-
div.#{$field-input} {
|
|
65
|
-
padding: calc(#{$spacing-y} * #{$size-coefficient-y})
|
|
66
|
-
calc(#{$spacing-x} * #{$size-coefficient-x});
|
|
67
|
-
position: relative;
|
|
68
|
-
background-color: transparent;
|
|
69
|
-
z-index: 2;
|
|
70
|
-
min-height: calc(#{$field-line} * #{$size-control-block-size} - 2 * #{$border-width});
|
|
71
|
-
max-height: calc(#{$field-max-line} * #{$size-control-block-size} - 2 * #{$border-width});
|
|
72
|
-
box-sizing: border-box;
|
|
73
|
-
width: 100%;
|
|
74
|
-
flex: 1;
|
|
75
|
-
display: flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
transition:
|
|
78
|
-
box-shadow #{$transition-duration} ease,
|
|
79
|
-
border-color #{$transition-duration} ease,
|
|
80
|
-
background-color #{$transition-duration} ease,
|
|
81
|
-
color #{$transition-duration} ease,
|
|
82
|
-
border-radius #{$transition-duration} ease;
|
|
83
|
-
|
|
84
|
-
&:focus-within,
|
|
85
|
-
&:active,
|
|
86
|
-
&:hover {
|
|
87
|
-
outline: none;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
&::placeholder {
|
|
91
|
-
color: rgba(#{$field-placeholder-color});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
66
|
// Native password <input> (single node, not wrapped).
|
|
96
67
|
input.#{$field-input} {
|
|
97
68
|
padding: calc(#{$spacing-y} * #{$size-coefficient-y})
|
|
@@ -142,34 +113,6 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
142
113
|
}
|
|
143
114
|
}
|
|
144
115
|
|
|
145
|
-
.#{$field-input-editable} {
|
|
146
|
-
flex: 1 1 auto;
|
|
147
|
-
min-width: 0;
|
|
148
|
-
min-height: 0;
|
|
149
|
-
display: block;
|
|
150
|
-
position: relative;
|
|
151
|
-
z-index: 2;
|
|
152
|
-
background-color: transparent;
|
|
153
|
-
color: rgba(#{$field-color});
|
|
154
|
-
caret-color: rgba(#{$field-color});
|
|
155
|
-
border: none;
|
|
156
|
-
// user-select:all breaks caret placement on many mobile browsers for contenteditable.
|
|
157
|
-
-webkit-user-select: text;
|
|
158
|
-
user-select: text;
|
|
159
|
-
font-size: #{$size-font-size};
|
|
160
|
-
line-height: #{$size-line-height};
|
|
161
|
-
box-sizing: border-box;
|
|
162
|
-
width: 100%;
|
|
163
|
-
overflow: auto;
|
|
164
|
-
outline: none;
|
|
165
|
-
|
|
166
|
-
&:focus,
|
|
167
|
-
&:active {
|
|
168
|
-
outline: none;
|
|
169
|
-
border: none;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
116
|
// Message
|
|
174
117
|
.#{$field-message} {
|
|
175
118
|
color: rgba(#{$field-background-color});
|
|
@@ -197,85 +140,44 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
197
140
|
}
|
|
198
141
|
|
|
199
142
|
&.focus {
|
|
143
|
+
.#{$field-content} {
|
|
144
|
+
border-color: rgba(#{$field-border-color-focus});
|
|
145
|
+
}
|
|
146
|
+
|
|
200
147
|
&.shadow {
|
|
201
148
|
.#{$field-content} {
|
|
202
|
-
box-shadow: 0 0 0 0.25rem rgba(#{$field-border-color}, 0.25);
|
|
149
|
+
box-shadow: 0 0 0 0.25rem rgba(#{$field-border-color-focus}, 0.25);
|
|
203
150
|
}
|
|
204
151
|
}
|
|
205
152
|
|
|
206
153
|
&:not(.shadow) {
|
|
207
154
|
.#{$field-content} {
|
|
208
|
-
box-shadow: 0 0 0 calc(#{$border-width} * 1.5) rgba(#{$field-border-color});
|
|
155
|
+
box-shadow: 0 0 0 calc(#{$border-width} * 1.5) rgba(#{$field-border-color-focus});
|
|
209
156
|
}
|
|
210
157
|
}
|
|
211
158
|
}
|
|
212
159
|
|
|
160
|
+
&.hover {
|
|
161
|
+
.#{$field-content} {
|
|
162
|
+
border-color: rgba(#{$field-border-color-hover});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
213
166
|
&.disabled {
|
|
214
167
|
opacity: 0.5;
|
|
215
168
|
cursor: not-allowed;
|
|
216
|
-
|
|
217
|
-
input.#{$field-input},
|
|
218
|
-
.#{$field-input-editable} {
|
|
169
|
+
input.#{$field-input} {
|
|
219
170
|
cursor: not-allowed;
|
|
220
171
|
-webkit-user-select: none;
|
|
221
172
|
user-select: none;
|
|
222
173
|
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
&.empty:not(.typing) {
|
|
226
|
-
div.#{$field-input} {
|
|
227
|
-
&::before {
|
|
228
|
-
content: attr(placeholder);
|
|
229
|
-
color: rgba(#{$field-placeholder-color});
|
|
230
|
-
transition: color #{$transition-duration} ease;
|
|
231
|
-
position: absolute;
|
|
232
|
-
height: calc(#{$size-control-block-size} - #{$border-width} * 2);
|
|
233
|
-
box-sizing: border-box;
|
|
234
|
-
top: 0;
|
|
235
|
-
pointer-events: none;
|
|
236
|
-
z-index: 0;
|
|
237
|
-
display: block;
|
|
238
|
-
white-space: pre-wrap;
|
|
239
|
-
word-break: break-word;
|
|
240
|
-
line-height: inherit;
|
|
241
|
-
font-size: inherit;
|
|
242
|
-
display: flex;
|
|
243
|
-
align-items: center;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// Type
|
|
249
|
-
&.paragraph {
|
|
250
|
-
div.#{$field-input} {
|
|
251
|
-
align-items: flex-start;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.#{$field-input-editable} {
|
|
255
|
-
white-space: pre-wrap;
|
|
256
|
-
word-break: break-word;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
174
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
input.#{$field-input} {
|
|
263
|
-
white-space: nowrap;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
&.password {
|
|
268
|
-
input.#{$field-input} {
|
|
269
|
-
white-space: nowrap;
|
|
175
|
+
.#{$field-content} {
|
|
176
|
+
border-color: rgba(#{$field-border-color-disabled});
|
|
270
177
|
}
|
|
271
178
|
}
|
|
272
179
|
|
|
273
180
|
// Direction
|
|
274
|
-
div.#{$field-input} {
|
|
275
|
-
justify-content: #{$direction-justify-content};
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.#{$field-input-editable},
|
|
279
181
|
input.#{$field-input} {
|
|
280
182
|
text-align: #{$direction-text-align};
|
|
281
183
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AppDirection
|
|
1
|
+
import type { AppDirection } from "../app";
|
|
2
2
|
|
|
3
3
|
export type FieldVariant = "outline" | "fill" | "underline";
|
|
4
|
-
export type FieldSize =
|
|
4
|
+
export type FieldSize = string;
|
|
5
5
|
export type FieldType = "text" | "number" | "email" | "password" | "tel" | "url" | "paragraph";
|
|
6
6
|
|
|
7
7
|
// Type definitions
|