@toife/vue 3.1.3 → 3.1.4
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 +1 -1
- package/src/components/app/app.type.ts +6 -0
- package/src/components/app/app.vue +7 -1
- package/src/components/avatar/avatar.scss +3 -2
- package/src/components/button/button.scss +9 -6
- package/src/components/button/button.type.ts +3 -1
- package/src/components/card/card/card.scss +3 -1
- package/src/components/checkbox/checkbox.scss +9 -14
- package/src/components/checkbox/checkbox.type.ts +4 -0
- package/src/components/checkbox/checkbox.vue +2 -0
- package/src/components/decision-modal/decision-modal.scss +3 -1
- package/src/components/dropdown/dropdown.scss +5 -2
- package/src/components/dropdown/dropdown.type.ts +4 -1
- package/src/components/dropdown/dropdown.vue +4 -0
- package/src/components/field/field.type.ts +2 -2
- package/src/components/field/outline/outline.scss +9 -8
- package/src/components/gesture-indicator/gesture-indicator.scss +3 -1
- package/src/components/index.ts +1 -0
- package/src/components/layout/flex/flex.scss +0 -2
- package/src/components/layout/flex-item/flex-item.html +1 -0
- package/src/components/layout/flex-item/flex-item.scss +48 -0
- package/src/components/layout/flex-item/flex-item.type.ts +11 -0
- package/src/components/layout/flex-item/flex-item.vue +27 -0
- package/src/components/layout/flex-item/index.ts +2 -0
- package/src/components/layout/grid/grid.scss +0 -2
- package/src/components/layout/grid-item/grid-item.html +1 -0
- package/src/components/layout/grid-item/grid-item.scss +49 -0
- package/src/components/layout/grid-item/grid-item.type.ts +14 -0
- package/src/components/layout/grid-item/grid-item.vue +27 -0
- package/src/components/layout/grid-item/index.ts +2 -0
- package/src/components/layout/index.ts +2 -1
- package/src/components/modal/modal.scss +3 -1
- package/src/components/radio/radio/radio.scss +7 -5
- package/src/components/radio/radio/radio.type.ts +4 -0
- package/src/components/radio/radio/radio.vue +2 -0
- package/src/components/refresher/refresher.html +4 -4
- package/src/components/refresher/refresher.scss +10 -4
- package/src/components/refresher/refresher.vue +3 -3
- package/src/components/skeleton/skeleton.scss +3 -1
- package/src/components/slide-range/index.ts +2 -0
- package/src/components/slide-range/slide-range.html +20 -0
- package/src/components/slide-range/slide-range.scss +161 -0
- package/src/components/slide-range/slide-range.type.ts +16 -0
- package/src/components/slide-range/slide-range.vue +229 -0
- package/src/components/switch/switch.scss +11 -22
- package/src/components/switch/switch.type.ts +5 -0
- package/src/components/switch/switch.vue +2 -0
- package/src/components/tabs/tabs/tabs.scss +135 -95
- package/src/components/tabs/tabs/tabs.type.ts +0 -1
- package/src/components/tabs/tabs/tabs.vue +6 -10
- package/src/components/toast/toast-content/toast-content.scss +3 -2
- package/src/components/toolbar/toolbar.scss +1 -1
- package/src/components/toolbar/toolbar.type.ts +1 -1
- package/src/components/toolbar/toolbar.vue +2 -2
- package/src/factory.ts +6 -2
- package/src/index.ts +1 -1
- package/src/components/action/action.md +0 -115
- package/src/components/app/app.md +0 -77
- package/src/components/avatar/avatar.md +0 -64
- package/src/components/button/button.md +0 -66
- package/src/components/cable/cable.md +0 -57
- package/src/components/card/card/card.md +0 -57
- package/src/components/card/card-body/card-body.md +0 -34
- package/src/components/card/card-footer/card-footer.md +0 -42
- package/src/components/card/card-header/card-header.md +0 -44
- package/src/components/checkbox/checkbox.md +0 -60
- package/src/components/collapse/collapse.md +0 -59
- package/src/components/container/container.md +0 -38
- package/src/components/decision-modal/decision-modal.md +0 -79
- package/src/components/divider/divider.md +0 -42
- package/src/components/field/field.md +0 -68
- package/src/components/field/outline/outline-field.md +0 -44
- package/src/components/form-group/form-group.md +0 -41
- package/src/components/gesture-indicator/gesture-indicator.md +0 -42
- package/src/components/image/image.md +0 -41
- package/src/components/layout/cell/cell.html +0 -1
- package/src/components/layout/cell/cell.md +0 -47
- package/src/components/layout/cell/cell.scss +0 -54
- package/src/components/layout/cell/cell.type.ts +0 -19
- package/src/components/layout/cell/cell.vue +0 -35
- package/src/components/layout/cell/index.ts +0 -2
- package/src/components/layout/grid/grid.md +0 -50
- package/src/components/modal/modal.md +0 -65
- package/src/components/page/page.md +0 -39
- package/src/components/present/present.md +0 -60
- package/src/components/radio/radio/radio.md +0 -53
- package/src/components/radio/radio-group/radio-group.md +0 -62
- package/src/components/refresher/refresher.md +0 -53
- package/src/components/route/route-navigator/route-navigator.md +0 -50
- package/src/components/route/route-outlet/route-outlet.md +0 -30
- package/src/components/route/route-provider/route-provider.md +0 -46
- package/src/components/route/route-wrapper/route-wrapper.md +0 -45
- package/src/components/segmented-field/segmented-field.md +0 -58
- package/src/components/skeleton/skeleton.md +0 -47
- package/src/components/switch/switch.md +0 -57
- package/src/components/tabs/tab/tab.md +0 -52
- package/src/components/tabs/tabs/tabs.md +0 -59
- package/src/components/toast/toast/toast.md +0 -56
- package/src/components/toast/toast-content/toast-content.md +0 -41
- package/src/components/toolbar/toolbar.md +0 -54
package/package.json
CHANGED
|
@@ -5,6 +5,11 @@ 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
|
+
|
|
8
13
|
/**
|
|
9
14
|
* App Props Type
|
|
10
15
|
*/
|
|
@@ -15,6 +20,7 @@ export type AppProps = {
|
|
|
15
20
|
shadow?: boolean;
|
|
16
21
|
triple?: boolean;
|
|
17
22
|
direction?: AppDirection;
|
|
23
|
+
size?: AppSize;
|
|
18
24
|
};
|
|
19
25
|
|
|
20
26
|
/**
|
|
@@ -18,6 +18,7 @@ const props = withDefaults(defineProps<AppProps>(), {
|
|
|
18
18
|
shadow: false,
|
|
19
19
|
triple: false,
|
|
20
20
|
direction: "left",
|
|
21
|
+
size: "standard",
|
|
21
22
|
});
|
|
22
23
|
const { shape, divider, role, shadow, triple, direction } = toRefs(props);
|
|
23
24
|
const decisionModal = useDecisionModal();
|
|
@@ -28,7 +29,12 @@ const action = useAction();
|
|
|
28
29
|
// Root layout classes for the application shell (global theme layer)
|
|
29
30
|
const appAttrs = computed(() => {
|
|
30
31
|
return {
|
|
31
|
-
class: [
|
|
32
|
+
class: [
|
|
33
|
+
withPrefix("app"),
|
|
34
|
+
withPrefix(["layer", "app"]),
|
|
35
|
+
withPrefix(["shape", shape.value]),
|
|
36
|
+
withPrefix(["size", props.size]),
|
|
37
|
+
],
|
|
32
38
|
};
|
|
33
39
|
});
|
|
34
40
|
|
|
@@ -5,7 +5,8 @@ $avatar: sass.fn-naming-prefix("avatar");
|
|
|
5
5
|
$shape-pill: sass.fn-naming-prefix("shape-pill");
|
|
6
6
|
|
|
7
7
|
// Property - layer: avatar
|
|
8
|
-
$
|
|
8
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
9
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
9
10
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
10
11
|
$width: sass.fn-naming-var("width");
|
|
11
12
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
@@ -21,7 +22,7 @@ $avatar-border-color: sass.fn-naming-var("avatar", "border-color");
|
|
|
21
22
|
background-color: rgb(#{$avatar-background-color});
|
|
22
23
|
width: #{$width};
|
|
23
24
|
aspect-ratio: 1/1;
|
|
24
|
-
border-radius: #{$
|
|
25
|
+
border-radius: calc(min(#{$width}, #{$radius-size}) * #{$radius-ratio});
|
|
25
26
|
background-repeat: no-repeat;
|
|
26
27
|
background-size: cover;
|
|
27
28
|
transition:
|
|
@@ -5,13 +5,15 @@ $button: sass.fn-naming-prefix("button");
|
|
|
5
5
|
$loader: sass.fn-naming-prefix("loader");
|
|
6
6
|
|
|
7
7
|
// Property name
|
|
8
|
-
$
|
|
8
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
9
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
9
10
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
10
11
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
11
12
|
$spacing-x: sass.fn-naming-var("spacing", "x");
|
|
12
13
|
$spacing-y: sass.fn-naming-var("spacing", "y");
|
|
13
14
|
|
|
14
15
|
$button-color: sass.fn-naming-var("button", "color");
|
|
16
|
+
$button-color-disabled: sass.fn-naming-var("button", "color", "disabled");
|
|
15
17
|
|
|
16
18
|
$button-border-color: sass.fn-naming-var("button", "border-color");
|
|
17
19
|
$button-border-color-hover: sass.fn-naming-var("button", "border-color", "hover");
|
|
@@ -28,7 +30,7 @@ $button-background-color-disabled: sass.fn-naming-var("button", "background-colo
|
|
|
28
30
|
$button-box-shadow-color-focus: sass.fn-naming-var("button", "box-shadow-color", "focus");
|
|
29
31
|
|
|
30
32
|
$size-font-size: sass.fn-naming-var("font-size");
|
|
31
|
-
$size-
|
|
33
|
+
$size-control-block-size: sass.fn-naming-var("control-block-size");
|
|
32
34
|
$size-coefficient-x: sass.fn-naming-var("coefficient-x");
|
|
33
35
|
$size-coefficient-y: sass.fn-naming-var("coefficient-y");
|
|
34
36
|
$size-line-height: sass.fn-naming-var("line-height");
|
|
@@ -45,7 +47,7 @@ $size-line-height: sass.fn-naming-var("line-height");
|
|
|
45
47
|
border-style: solid;
|
|
46
48
|
border-width: #{$border-width};
|
|
47
49
|
white-space: nowrap;
|
|
48
|
-
border-radius: #{$
|
|
50
|
+
border-radius: calc(min(#{$size-control-block-size}, #{$radius-size}) * #{$radius-ratio});
|
|
49
51
|
cursor: pointer;
|
|
50
52
|
transition:
|
|
51
53
|
color #{$transition-duration} ease,
|
|
@@ -57,7 +59,7 @@ $size-line-height: sass.fn-naming-var("line-height");
|
|
|
57
59
|
|
|
58
60
|
padding: calc(#{$spacing-y} * #{$size-coefficient-y}) calc(#{$spacing-x} * #{$size-coefficient-x});
|
|
59
61
|
font-size: #{$size-font-size};
|
|
60
|
-
height: #{$size-
|
|
62
|
+
height: #{$size-control-block-size};
|
|
61
63
|
line-height: #{$size-line-height};
|
|
62
64
|
|
|
63
65
|
&:hover {
|
|
@@ -83,8 +85,9 @@ $size-line-height: sass.fn-naming-var("line-height");
|
|
|
83
85
|
|
|
84
86
|
&:disabled,
|
|
85
87
|
&.disabled {
|
|
86
|
-
border-color:
|
|
87
|
-
background-color:
|
|
88
|
+
border-color: rgb(#{$button-border-color-disabled});
|
|
89
|
+
background-color: rgb(#{$button-background-color-disabled});
|
|
90
|
+
color: rgb(#{$button-color-disabled});
|
|
88
91
|
cursor: not-allowed;
|
|
89
92
|
}
|
|
90
93
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { AppSize } from "../app";
|
|
2
|
+
|
|
1
3
|
// Type definitions
|
|
2
4
|
export type ButtonVariant = "fill" | "outline" | "text" | "link";
|
|
3
5
|
|
|
4
|
-
export type ButtonSize =
|
|
6
|
+
export type ButtonSize = AppSize;
|
|
5
7
|
|
|
6
8
|
export type ButtonProps = {
|
|
7
9
|
role?: string;
|
|
@@ -7,8 +7,10 @@ $card: sass.fn-naming-prefix("card");
|
|
|
7
7
|
$card-background-color: sass.fn-naming-var("card", "background-color");
|
|
8
8
|
$card-color: sass.fn-naming-var("card", "color");
|
|
9
9
|
|
|
10
|
-
$
|
|
10
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
11
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
11
12
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
13
|
+
$border-radius: calc(#{$radius-size} * #{$radius-ratio});
|
|
12
14
|
|
|
13
15
|
.#{$card} {
|
|
14
16
|
background-color: rgb(#{$card-background-color});
|
|
@@ -28,7 +28,10 @@ $checkbox-border-color-disabled: sass.fn-naming-var("checkbox", "border-color",
|
|
|
28
28
|
$checkbox-box-shadow-color-focus: sass.fn-naming-var("checkbox", "box-shadow-color", "focus");
|
|
29
29
|
|
|
30
30
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
31
|
-
$
|
|
31
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
32
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
33
|
+
$size-control-mark-size: sass.fn-naming-var("control-mark-size");
|
|
34
|
+
$border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radius-ratio});
|
|
32
35
|
|
|
33
36
|
.#{$checkbox} {
|
|
34
37
|
display: inline-flex;
|
|
@@ -41,13 +44,14 @@ $border-radius: sass.fn-naming-var("border-radius");
|
|
|
41
44
|
|
|
42
45
|
.#{$checkbox-icon} {
|
|
43
46
|
flex-shrink: 0;
|
|
44
|
-
width:
|
|
45
|
-
height:
|
|
47
|
+
width: #{$size-control-mark-size};
|
|
48
|
+
height: #{$size-control-mark-size};
|
|
46
49
|
display: flex;
|
|
47
50
|
align-items: center;
|
|
48
51
|
justify-content: center;
|
|
49
52
|
border: 1px solid rgb(#{$checkbox-color});
|
|
50
53
|
background-color: transparent;
|
|
54
|
+
border-radius: #{$border-radius};
|
|
51
55
|
transition:
|
|
52
56
|
box-shadow #{$transition-duration} ease,
|
|
53
57
|
border-color #{$transition-duration} ease,
|
|
@@ -55,13 +59,12 @@ $border-radius: sass.fn-naming-var("border-radius");
|
|
|
55
59
|
color #{$transition-duration} ease,
|
|
56
60
|
border-radius #{$transition-duration} ease,
|
|
57
61
|
transform #{$transition-duration} ease;
|
|
58
|
-
border-radius: calc(#{$border-radius} * 0.5);
|
|
59
62
|
box-sizing: border-box;
|
|
60
63
|
|
|
61
64
|
&::after {
|
|
62
65
|
content: "";
|
|
63
|
-
width: 0.
|
|
64
|
-
height: 0.
|
|
66
|
+
width: calc(#{$size-control-mark-size} * 0.2);
|
|
67
|
+
height: calc(#{$size-control-mark-size} * 0.5);
|
|
65
68
|
border: solid rgb(#{$checkbox-color});
|
|
66
69
|
border-width: 0 2px 2px 0;
|
|
67
70
|
transform: rotate(45deg) scale(0);
|
|
@@ -75,14 +78,6 @@ $border-radius: sass.fn-naming-var("border-radius");
|
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
80
|
|
|
78
|
-
&.#{$shape-rounded} .#{$checkbox-icon} {
|
|
79
|
-
border-radius: calc(#{$border-radius} - 10%);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
&.#{$shape-pill} .#{$checkbox-icon} {
|
|
83
|
-
border-radius: 50%;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
81
|
&:not(.on) {
|
|
87
82
|
.#{$checkbox-icon} {
|
|
88
83
|
background-color: transparent;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { AppSize } from "../app";
|
|
2
|
+
|
|
1
3
|
export type CheckboxVariant = "fill" | "outline";
|
|
4
|
+
export type CheckboxSize = AppSize;
|
|
2
5
|
|
|
3
6
|
export type CheckboxProps = {
|
|
4
7
|
modelValue?: boolean;
|
|
5
8
|
role?: string;
|
|
9
|
+
size?: CheckboxSize;
|
|
6
10
|
shape?: string;
|
|
7
11
|
variant?: CheckboxVariant;
|
|
8
12
|
readonly?: boolean;
|
|
@@ -11,6 +11,7 @@ import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
|
11
11
|
const props = withDefaults(defineProps<CheckboxProps>(), {
|
|
12
12
|
modelValue: false,
|
|
13
13
|
disabled: false,
|
|
14
|
+
size: "standard",
|
|
14
15
|
variant: "fill",
|
|
15
16
|
readonly: false,
|
|
16
17
|
shadow: undefined,
|
|
@@ -34,6 +35,7 @@ const checkboxAttrs = computed(() => {
|
|
|
34
35
|
withPrefix(["layer", "checkbox"]),
|
|
35
36
|
withPrefix(["role", role]),
|
|
36
37
|
withPrefix(["shape", shape]),
|
|
38
|
+
withPrefix(["size", props.size]),
|
|
37
39
|
withPrefix("checkbox"),
|
|
38
40
|
props.variant,
|
|
39
41
|
{
|
|
@@ -13,7 +13,8 @@ $decision-modal-background-color: sass.fn-naming-var("decision-modal", "backgrou
|
|
|
13
13
|
$decision-modal-border-color: sass.fn-naming-var("decision-modal", "border-color");
|
|
14
14
|
$decision-modal-color: sass.fn-naming-var("decision-modal", "color");
|
|
15
15
|
|
|
16
|
-
$
|
|
16
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
17
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
17
18
|
$width: sass.fn-naming-var("viewport", "width");
|
|
18
19
|
$max-width: sass.fn-naming-var("overlay", "max-width");
|
|
19
20
|
$padding-y: sass.fn-naming-var("spacing", "y");
|
|
@@ -23,6 +24,7 @@ $margin-x: sass.fn-naming-var("spacing", "x");
|
|
|
23
24
|
$animation-duration: sass.fn-naming-var("motion", "duration");
|
|
24
25
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
25
26
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
27
|
+
$border-radius: calc(min(#{$width}, #{$radius-size}) * #{$radius-ratio});
|
|
26
28
|
|
|
27
29
|
.#{$decision-modal} {
|
|
28
30
|
// Styles
|
|
@@ -8,7 +8,7 @@ $dropdown-panel: sass.fn-naming-prefix("dropdown-panel");
|
|
|
8
8
|
$dropdown-border-color: sass.fn-naming-var("dropdown", "border-color");
|
|
9
9
|
$dropdown-background-color: sass.fn-naming-var("dropdown", "background-color");
|
|
10
10
|
$dropdown-color: sass.fn-naming-var("dropdown", "color");
|
|
11
|
-
$
|
|
11
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
12
12
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
13
13
|
$spacing-x: sass.fn-naming-var("spacing", "x");
|
|
14
14
|
$spacing-y: sass.fn-naming-var("spacing", "y");
|
|
@@ -16,6 +16,9 @@ $size-font-size: sass.fn-naming-var("font-size");
|
|
|
16
16
|
$size-line-height: sass.fn-naming-var("line-height");
|
|
17
17
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
18
18
|
|
|
19
|
+
$size-control-block-size: sass.fn-naming-var("control-block-size");
|
|
20
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
21
|
+
|
|
19
22
|
.#{$dropdown} {
|
|
20
23
|
position: relative;
|
|
21
24
|
display: block;
|
|
@@ -27,7 +30,7 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
27
30
|
z-index: 20;
|
|
28
31
|
min-width: 100%;
|
|
29
32
|
box-sizing: border-box;
|
|
30
|
-
border-radius: #{$
|
|
33
|
+
border-radius: calc(min(#{$size-control-block-size}, #{$radius-size}) * #{$radius-ratio});
|
|
31
34
|
border-width: #{$border-width};
|
|
32
35
|
margin: #{$spacing-y} 0;
|
|
33
36
|
border-style: solid;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { AppDirection } from "../app";
|
|
1
|
+
import type { AppDirection, AppSize } from "../app";
|
|
2
2
|
|
|
3
3
|
export type DropdownPlacement = "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
4
4
|
|
|
5
|
+
export type DropdownSize = AppSize;
|
|
6
|
+
|
|
5
7
|
export type DropdownProps = {
|
|
6
8
|
modelValue?: boolean;
|
|
7
9
|
disabled?: boolean;
|
|
@@ -10,6 +12,7 @@ export type DropdownProps = {
|
|
|
10
12
|
shadow?: boolean;
|
|
11
13
|
shape?: string;
|
|
12
14
|
direction?: AppDirection;
|
|
15
|
+
size?: DropdownSize;
|
|
13
16
|
};
|
|
14
17
|
|
|
15
18
|
export type DropdownEmit = {
|
|
@@ -16,6 +16,7 @@ const props = withDefaults(defineProps<DropdownProps>(), {
|
|
|
16
16
|
shadow: undefined,
|
|
17
17
|
shape: undefined,
|
|
18
18
|
direction: undefined,
|
|
19
|
+
size: "standard",
|
|
19
20
|
});
|
|
20
21
|
const emit = defineEmits<DropdownEmit>();
|
|
21
22
|
const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
|
|
@@ -37,6 +38,7 @@ const wrapperAttrs = computed(() => {
|
|
|
37
38
|
withPrefix(["layer", "dropdown"]),
|
|
38
39
|
withPrefix(["role", role]),
|
|
39
40
|
withPrefix(["shape", shape]),
|
|
41
|
+
withPrefix(["size", props.size]),
|
|
40
42
|
withPrefix("dropdown"),
|
|
41
43
|
{
|
|
42
44
|
open: isOpen.value,
|
|
@@ -48,6 +50,8 @@ const wrapperAttrs = computed(() => {
|
|
|
48
50
|
});
|
|
49
51
|
|
|
50
52
|
const panelAttrs = computed(() => {
|
|
53
|
+
const shape = props.shape ?? appState?.shape.value ?? "";
|
|
54
|
+
|
|
51
55
|
return {
|
|
52
56
|
class: [withPrefix("dropdown-panel"), props.placement],
|
|
53
57
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AppDirection } from "../app";
|
|
1
|
+
import type { AppDirection, AppSize } from "../app";
|
|
2
2
|
|
|
3
3
|
export type FieldVariant = "outline" | "fill" | "underline";
|
|
4
|
-
export type FieldSize =
|
|
4
|
+
export type FieldSize = AppSize;
|
|
5
5
|
export type FieldType = "text" | "number" | "email" | "password" | "tel" | "url" | "paragraph";
|
|
6
6
|
|
|
7
7
|
// Type definitions
|
|
@@ -14,7 +14,8 @@ $field-background-color: sass.fn-naming-var("field", "background-color");
|
|
|
14
14
|
$field-line: sass.fn-naming-var("field", "line");
|
|
15
15
|
$field-max-line: sass.fn-naming-var("field", "max-line");
|
|
16
16
|
|
|
17
|
-
$
|
|
17
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
18
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
18
19
|
$border-width: sass.fn-naming-var("stroke", "width");
|
|
19
20
|
$app-color: sass.fn-naming-var("app", "color");
|
|
20
21
|
|
|
@@ -22,7 +23,7 @@ $spacing-x: sass.fn-naming-var("spacing", "x");
|
|
|
22
23
|
$spacing-y: sass.fn-naming-var("spacing", "y");
|
|
23
24
|
|
|
24
25
|
$size-font-size: sass.fn-naming-var("font-size");
|
|
25
|
-
$size-
|
|
26
|
+
$size-control-block-size: sass.fn-naming-var("control-block-size");
|
|
26
27
|
$size-coefficient-x: sass.fn-naming-var("coefficient-x");
|
|
27
28
|
$size-coefficient-y: sass.fn-naming-var("coefficient-y");
|
|
28
29
|
$size-line-height: sass.fn-naming-var("line-height");
|
|
@@ -45,7 +46,7 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
45
46
|
color #{$transition-duration} ease,
|
|
46
47
|
border-radius #{$transition-duration} ease;
|
|
47
48
|
border-color: rgb(#{$field-border-color});
|
|
48
|
-
border-radius: #{$
|
|
49
|
+
border-radius: calc(min(#{$size-control-block-size}, #{$radius-size}) * #{$radius-ratio});
|
|
49
50
|
border-width: #{$border-width};
|
|
50
51
|
border-style: solid;
|
|
51
52
|
overflow: hidden;
|
|
@@ -64,8 +65,8 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
64
65
|
position: relative;
|
|
65
66
|
background-color: transparent;
|
|
66
67
|
z-index: 2;
|
|
67
|
-
min-height: calc(#{$field-line} * #{$size-
|
|
68
|
-
max-height: calc(#{$field-max-line} * #{$size-
|
|
68
|
+
min-height: calc(#{$field-line} * #{$size-control-block-size} - 2 * #{$border-width});
|
|
69
|
+
max-height: calc(#{$field-max-line} * #{$size-control-block-size} - 2 * #{$border-width});
|
|
69
70
|
box-sizing: border-box;
|
|
70
71
|
width: 100%;
|
|
71
72
|
flex: 1;
|
|
@@ -96,8 +97,8 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
96
97
|
position: relative;
|
|
97
98
|
background-color: transparent;
|
|
98
99
|
z-index: 2;
|
|
99
|
-
min-height: calc(#{$field-line} * #{$size-
|
|
100
|
-
max-height: calc(#{$field-max-line} * #{$size-
|
|
100
|
+
min-height: calc(#{$field-line} * #{$size-control-block-size} - 2 * #{$border-width});
|
|
101
|
+
max-height: calc(#{$field-max-line} * #{$size-control-block-size} - 2 * #{$border-width});
|
|
101
102
|
box-sizing: border-box;
|
|
102
103
|
width: 100%;
|
|
103
104
|
flex: 1;
|
|
@@ -226,7 +227,7 @@ $direction-justify-content: sass.fn-naming-var("justify-content");
|
|
|
226
227
|
color: rgba(#{$app-color}, 0.5);
|
|
227
228
|
transition: color #{$transition-duration} ease;
|
|
228
229
|
position: absolute;
|
|
229
|
-
height: calc(#{$size-
|
|
230
|
+
height: calc(#{$size-control-block-size} - #{$border-width} * 2);
|
|
230
231
|
box-sizing: border-box;
|
|
231
232
|
top: 0;
|
|
232
233
|
pointer-events: none;
|
|
@@ -5,6 +5,8 @@ $gesture-indicator: sass.fn-naming-prefix("gesture-indicator");
|
|
|
5
5
|
|
|
6
6
|
// Property name - layer: gesture-indicator
|
|
7
7
|
$gesture-indicator-border-color: sass.fn-naming-var("gesture-indicator", "border-color");
|
|
8
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
9
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
8
10
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
9
11
|
|
|
10
12
|
.#{$gesture-indicator} {
|
|
@@ -16,7 +18,7 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
16
18
|
color #{$transition-duration} ease,
|
|
17
19
|
border-radius #{$transition-duration} ease;
|
|
18
20
|
position: absolute;
|
|
19
|
-
border-radius:
|
|
21
|
+
border-radius: calc(min(40px, #{$radius-size}) * #{$radius-ratio});
|
|
20
22
|
z-index: 99;
|
|
21
23
|
|
|
22
24
|
&.bottom {
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div v-bind="flexItemAttrs"><slot /></div>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@use "@toife/sass-layer" as sass;
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
|
|
5
|
+
$flex-item: sass.fn-naming-prefix("flex-item");
|
|
6
|
+
$flex-item-grow: sass.fn-naming-var("flex-item", "grow");
|
|
7
|
+
$flex-item-shrink: sass.fn-naming-var("flex-item", "shrink");
|
|
8
|
+
$flex-item-basis: sass.fn-naming-var("flex-item", "basis");
|
|
9
|
+
$flex-item-order: sass.fn-naming-var("flex-item", "order");
|
|
10
|
+
|
|
11
|
+
.#{$flex-item} {
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
flex-grow: #{$flex-item-grow};
|
|
15
|
+
flex-shrink: #{$flex-item-shrink};
|
|
16
|
+
flex-basis: #{$flex-item-basis};
|
|
17
|
+
order: #{$flex-item-order};
|
|
18
|
+
|
|
19
|
+
$bp-names: map.keys(sass.$breakpoints);
|
|
20
|
+
$bp-count: list.length($bp-names);
|
|
21
|
+
|
|
22
|
+
@for $i from 1 through $bp-count {
|
|
23
|
+
$bp-name: list.nth($bp-names, $i);
|
|
24
|
+
$bp-min: map.get(sass.$breakpoints, $bp-name);
|
|
25
|
+
|
|
26
|
+
@media (min-width: $bp-min) {
|
|
27
|
+
flex-grow: #{sass.fn-naming-cascade-dvar(
|
|
28
|
+
("flex-item", "grow"),
|
|
29
|
+
$bp-names,
|
|
30
|
+
$i,
|
|
31
|
+
$flex-item-grow
|
|
32
|
+
)};
|
|
33
|
+
flex-shrink: #{sass.fn-naming-cascade-dvar(
|
|
34
|
+
("flex-item", "shrink"),
|
|
35
|
+
$bp-names,
|
|
36
|
+
$i,
|
|
37
|
+
$flex-item-shrink
|
|
38
|
+
)};
|
|
39
|
+
flex-basis: #{sass.fn-naming-cascade-dvar(
|
|
40
|
+
("flex-item", "basis"),
|
|
41
|
+
$bp-names,
|
|
42
|
+
$i,
|
|
43
|
+
$flex-item-basis
|
|
44
|
+
)};
|
|
45
|
+
order: #{sass.fn-naming-cascade-dvar(("flex-item", "order"), $bp-names, $i, $flex-item-order)};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<style lang="scss" src="./flex-item.scss" scoped></style>
|
|
2
|
+
<template src="./flex-item.html"></template>
|
|
3
|
+
<script lang="ts" setup>
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
import { withPrefix, property } from "../../../utils";
|
|
6
|
+
import type { FlexItemProps } from "./flex-item.type";
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(defineProps<FlexItemProps>(), {
|
|
9
|
+
options: () => [],
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const flexItemAttrs = computed(() => {
|
|
13
|
+
const style = props.options.map((option) => {
|
|
14
|
+
return {
|
|
15
|
+
[property(["flex-item", "grow", option?.breakpoint || ""])]: option.grow,
|
|
16
|
+
[property(["flex-item", "shrink", option?.breakpoint || ""])]: option.shrink,
|
|
17
|
+
[property(["flex-item", "basis", option?.breakpoint || ""])]: option.basis,
|
|
18
|
+
[property(["flex-item", "order", option?.breakpoint || ""])]: option.order,
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
class: [withPrefix("flex-item")],
|
|
24
|
+
style,
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div v-bind="gridItemAttrs"><slot /></div>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@use "@toife/sass-layer" as sass;
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
|
|
5
|
+
$grid-item: sass.fn-naming-prefix("grid-item");
|
|
6
|
+
$grid-item-row: sass.fn-naming-var("grid-item", "row");
|
|
7
|
+
$grid-item-column: sass.fn-naming-var("grid-item", "column");
|
|
8
|
+
$grid-item-justify: sass.fn-naming-var("grid-item", "justify");
|
|
9
|
+
$grid-item-align: sass.fn-naming-var("grid-item", "align");
|
|
10
|
+
|
|
11
|
+
.#{$grid-item} {
|
|
12
|
+
display: grid;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
grid-column: #{$grid-item-column};
|
|
16
|
+
grid-row: #{$grid-item-row};
|
|
17
|
+
justify-self: #{$grid-item-justify};
|
|
18
|
+
align-self: #{$grid-item-align};
|
|
19
|
+
|
|
20
|
+
$bp-names: map.keys(sass.$breakpoints);
|
|
21
|
+
$bp-count: list.length($bp-names);
|
|
22
|
+
|
|
23
|
+
@for $i from 1 through $bp-count {
|
|
24
|
+
$bp-name: list.nth($bp-names, $i);
|
|
25
|
+
$bp-min: map.get(sass.$breakpoints, $bp-name);
|
|
26
|
+
|
|
27
|
+
@media (min-width: $bp-min) {
|
|
28
|
+
grid-column: #{sass.fn-naming-cascade-dvar(
|
|
29
|
+
("grid-item", "column"),
|
|
30
|
+
$bp-names,
|
|
31
|
+
$i,
|
|
32
|
+
$grid-item-column
|
|
33
|
+
)};
|
|
34
|
+
grid-row: #{sass.fn-naming-cascade-dvar(("grid-item", "row"), $bp-names, $i, $grid-item-row)};
|
|
35
|
+
justify-self: #{sass.fn-naming-cascade-dvar(
|
|
36
|
+
("grid-item", "justify"),
|
|
37
|
+
$bp-names,
|
|
38
|
+
$i,
|
|
39
|
+
$grid-item-justify
|
|
40
|
+
)};
|
|
41
|
+
align-self: #{sass.fn-naming-cascade-dvar(
|
|
42
|
+
("grid-item", "align"),
|
|
43
|
+
$bp-names,
|
|
44
|
+
$i,
|
|
45
|
+
$grid-item-align
|
|
46
|
+
)};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type GridItemJustify = "start" | "end" | "center" | "stretch";
|
|
2
|
+
export type GridItemAlign = "start" | "end" | "center" | "stretch";
|
|
3
|
+
|
|
4
|
+
export type GridItemOption = {
|
|
5
|
+
breakpoint?: string;
|
|
6
|
+
row?: number;
|
|
7
|
+
column?: number;
|
|
8
|
+
justify?: GridItemJustify;
|
|
9
|
+
align?: GridItemAlign;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type GridItemProps = {
|
|
13
|
+
options?: GridItemOption[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<style lang="scss" src="./grid-item.scss" scoped></style>
|
|
2
|
+
<template src="./grid-item.html"></template>
|
|
3
|
+
<script lang="ts" setup>
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
import { withPrefix, property } from "../../../utils";
|
|
6
|
+
import type { GridItemProps } from "./grid-item.type";
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(defineProps<GridItemProps>(), {
|
|
9
|
+
options: () => [],
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const gridItemAttrs = computed(() => {
|
|
13
|
+
const style = props.options.map((option) => {
|
|
14
|
+
return {
|
|
15
|
+
[property(["grid-item", "row", option?.breakpoint || ""])]: option.row,
|
|
16
|
+
[property(["grid-item", "column", option?.breakpoint || ""])]: option.column,
|
|
17
|
+
[property(["grid-item", "justify", option?.breakpoint || ""])]: option.justify,
|
|
18
|
+
[property(["grid-item", "align", option?.breakpoint || ""])]: option.align,
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
class: [withPrefix("grid-item")],
|
|
24
|
+
style,
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
</script>
|