@toife/vue 3.1.4 → 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/README.md +1 -1
- package/package.json +4 -4
- package/src/components/action/action.scss +2 -2
- package/src/components/action/action.vue +5 -5
- package/src/components/app/app.scss +3 -3
- package/src/components/app/app.type.ts +0 -6
- package/src/components/app/app.vue +2 -8
- package/src/components/avatar/avatar.scss +4 -3
- package/src/components/avatar/avatar.vue +6 -6
- package/src/components/button/button.scss +29 -21
- package/src/components/button/button.type.ts +2 -4
- package/src/components/button/button.vue +7 -7
- package/src/components/cable/cable.vue +2 -2
- package/src/components/card/card/card.scss +3 -3
- package/src/components/card/card/card.vue +5 -5
- package/src/components/card/card-body/card-body.scss +3 -3
- package/src/components/card/card-body/card-body.vue +2 -2
- package/src/components/card/card-footer/card-footer.scss +4 -4
- package/src/components/card/card-footer/card-footer.vue +2 -2
- package/src/components/card/card-header/card-header.scss +4 -4
- package/src/components/card/card-header/card-header.vue +2 -2
- package/src/components/checkbox/checkbox.html +1 -1
- package/src/components/checkbox/checkbox.scss +19 -14
- package/src/components/checkbox/checkbox.type.ts +1 -3
- package/src/components/checkbox/checkbox.vue +7 -7
- package/src/components/collapse/collapse.html +1 -1
- package/src/components/collapse/collapse.scss +4 -7
- package/src/components/collapse/collapse.vue +9 -9
- package/src/components/container/container.vue +2 -2
- package/src/components/decision-modal/decision-modal.scss +11 -11
- package/src/components/decision-modal/decision-modal.vue +8 -8
- package/src/components/divider/divider.scss +3 -3
- package/src/components/divider/divider.vue +4 -4
- package/src/components/dropdown/dropdown.scss +4 -4
- package/src/components/dropdown/dropdown.type.ts +2 -2
- package/src/components/dropdown/dropdown.vue +7 -9
- package/src/components/field/field.html +28 -9
- package/src/components/field/{outline/outline.scss → field.scss} +29 -125
- package/src/components/field/field.type.ts +4 -4
- package/src/components/field/field.vue +83 -46
- package/src/components/field/index.ts +1 -1
- package/src/components/form-group/form-group.vue +2 -2
- package/src/components/gesture-indicator/gesture-indicator.scss +2 -2
- package/src/components/gesture-indicator/gesture-indicator.vue +4 -4
- package/src/components/image/image.vue +12 -5
- package/src/components/layout/flex/flex.vue +8 -8
- package/src/components/layout/flex-item/flex-item.vue +6 -6
- package/src/components/layout/grid/grid.vue +6 -6
- package/src/components/layout/grid-item/grid-item.vue +6 -6
- package/src/components/modal/modal.scss +2 -2
- package/src/components/modal/modal.vue +68 -5
- package/src/components/page/page.vue +2 -2
- package/src/components/present/present.scss +4 -4
- package/src/components/present/present.vue +14 -14
- package/src/components/radio/radio/radio.html +1 -1
- package/src/components/radio/radio/radio.scss +19 -14
- package/src/components/radio/radio/radio.type.ts +1 -3
- package/src/components/radio/radio/radio.vue +6 -6
- package/src/components/radio/radio-group/radio-group.vue +2 -2
- package/src/components/refresher/refresher.html +0 -3
- package/src/components/refresher/refresher.scss +1 -25
- package/src/components/refresher/refresher.vue +2 -16
- package/src/components/route/route-navigator/route-navigator.html +1 -1
- package/src/components/route/route-navigator/route-navigator.scss +3 -3
- package/src/components/route/route-navigator/route-navigator.vue +11 -14
- package/src/components/route/route-wrapper/route-wrapper.composable.ts +5 -15
- package/src/components/route/route-wrapper/route-wrapper.type.ts +0 -4
- package/src/components/route/route-wrapper/route-wrapper.vue +4 -12
- package/src/components/route/route.type.ts +0 -1
- package/src/components/segmented-field/segmented-field.html +1 -1
- package/src/components/segmented-field/segmented-field.scss +3 -3
- package/src/components/segmented-field/segmented-field.vue +8 -8
- package/src/components/select/select.html +2 -2
- package/src/components/select/select.scss +11 -11
- package/src/components/select/select.vue +10 -10
- package/src/components/skeleton/skeleton.scss +1 -1
- package/src/components/skeleton/skeleton.vue +7 -7
- package/src/components/slide-range/slide-range.html +3 -4
- package/src/components/slide-range/slide-range.scss +17 -14
- package/src/components/slide-range/slide-range.vue +17 -16
- package/src/components/switch/switch.html +1 -1
- package/src/components/switch/switch.scss +23 -21
- package/src/components/switch/switch.type.ts +2 -3
- package/src/components/switch/switch.vue +23 -9
- package/src/components/tabs/tab/tab.html +1 -1
- package/src/components/tabs/tab/tab.scss +13 -0
- package/src/components/tabs/tab/tab.vue +4 -2
- package/src/components/tabs/tabs/index.ts +1 -0
- package/src/components/tabs/tabs/tabs.scss +82 -54
- package/src/components/tabs/tabs/tabs.type.ts +4 -1
- package/src/components/tabs/tabs/tabs.vue +47 -23
- package/src/components/toast/toast/toast.scss +1 -1
- package/src/components/toast/toast/toast.vue +2 -2
- package/src/components/toast/toast-content/toast-content.scss +4 -4
- package/src/components/toast/toast-content/toast-content.vue +5 -5
- package/src/components/toolbar/toolbar.scss +4 -4
- package/src/components/toolbar/toolbar.vue +5 -5
- package/src/factory.ts +105 -51
- package/src/type.ts +2 -1
- package/src/utils/style/index.ts +9 -9
- package/src/utils/style.md +9 -9
- 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 -286
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ Usage docs live **next to source** under `src/`. Authoring scaffold: [docs/templ
|
|
|
55
55
|
|-----|----------|
|
|
56
56
|
| [element.md](src/utils/element.md) | `isFormElement`, `blurCurrentActive` |
|
|
57
57
|
| [events.md](src/utils/events.md) | `preventDefault` |
|
|
58
|
-
| [style.md](src/utils/style.md) | `
|
|
58
|
+
| [style.md](src/utils/style.md) | `stylePrefix`, `property`, `variable`, … |
|
|
59
59
|
|
|
60
60
|
## Requirements
|
|
61
61
|
|
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");
|
|
@@ -71,7 +71,7 @@ $border-width: sass.fn-naming-var("stroke", "width");
|
|
|
71
71
|
&.divider {
|
|
72
72
|
:deep(.#{$button}) {
|
|
73
73
|
border-color: transparent;
|
|
74
|
-
border-bottom-color:
|
|
74
|
+
border-bottom-color: rgba(#{$action-border-color});
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -6,7 +6,7 @@ import { Present } from "../present";
|
|
|
6
6
|
import { Button as CustomButton } from "../button";
|
|
7
7
|
import { FormGroup } from "../form-group";
|
|
8
8
|
import { type ActionEmit, type ActionButton, type ActionProps } from "./action.type";
|
|
9
|
-
import {
|
|
9
|
+
import { cssPrefix } from "../../utils";
|
|
10
10
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
11
11
|
|
|
12
12
|
// Component setup (props, emits, injects)
|
|
@@ -36,10 +36,10 @@ const actionAttrs = computed(() => {
|
|
|
36
36
|
const role = props.role ?? appState?.role.value ?? "";
|
|
37
37
|
return {
|
|
38
38
|
class: [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
cssPrefix("action"),
|
|
40
|
+
cssPrefix(["layer", "action"]),
|
|
41
|
+
cssPrefix(["role", role]),
|
|
42
|
+
cssPrefix(["shape", shape]),
|
|
43
43
|
props.placement,
|
|
44
44
|
{
|
|
45
45
|
pop: pop.value,
|
|
@@ -6,15 +6,15 @@ $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")};
|
|
13
13
|
max-width: #{sass.fn-naming-var("viewport", "max-width")};
|
|
14
14
|
height: #{sass.fn-naming-var("viewport", "height")};
|
|
15
15
|
max-height: #{sass.fn-naming-var("viewport", "max-height")};
|
|
16
|
-
background-color:
|
|
17
|
-
color:
|
|
16
|
+
background-color: rgba(#{$app-background-color});
|
|
17
|
+
color: rgba(#{$app-color});
|
|
18
18
|
transition:
|
|
19
19
|
background-color #{$transition-duration} ease,
|
|
20
20
|
color #{$transition-duration} ease,
|
|
@@ -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
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<style lang="scss" src="./app.scss" scoped></style>
|
|
2
2
|
<template src="./app.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
|
-
import {
|
|
4
|
+
import { cssPrefix } from "../../utils";
|
|
5
5
|
import { computed, provide, toRefs } from "vue";
|
|
6
6
|
import { Toast } from "../toast";
|
|
7
7
|
import { Action, useAction } from "../action";
|
|
@@ -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
|
-
withPrefix("app"),
|
|
34
|
-
withPrefix(["layer", "app"]),
|
|
35
|
-
withPrefix(["shape", shape.value]),
|
|
36
|
-
withPrefix(["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");
|
|
@@ -19,12 +19,13 @@ $avatar-border-color: sass.fn-naming-var("avatar", "border-color");
|
|
|
19
19
|
.#{$avatar} {
|
|
20
20
|
position: relative;
|
|
21
21
|
overflow: hidden;
|
|
22
|
-
background-color:
|
|
22
|
+
background-color: rgba(#{$avatar-background-color});
|
|
23
23
|
width: #{$width};
|
|
24
24
|
aspect-ratio: 1/1;
|
|
25
25
|
border-radius: calc(min(#{$width}, #{$radius-size}) * #{$radius-ratio});
|
|
26
26
|
background-repeat: no-repeat;
|
|
27
27
|
background-size: cover;
|
|
28
|
+
background-position: center;
|
|
28
29
|
transition:
|
|
29
30
|
background-color #{$transition-duration} ease,
|
|
30
31
|
color #{$transition-duration} ease,
|
|
@@ -39,6 +40,6 @@ $avatar-border-color: sass.fn-naming-var("avatar", "border-color");
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
&.divider {
|
|
42
|
-
border: #{$border-width} solid
|
|
43
|
+
border: #{$border-width} solid rgba(#{$avatar-border-color});
|
|
43
44
|
}
|
|
44
45
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject } from "vue";
|
|
5
5
|
import { type AvatarProps } from "./avatar.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssProperty, cssPrefix } from "../../utils";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
8
8
|
|
|
9
9
|
// Component setup (props, emits, injects)
|
|
@@ -27,16 +27,16 @@ const avatarAttrs = computed(() => {
|
|
|
27
27
|
|
|
28
28
|
return {
|
|
29
29
|
class: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
cssPrefix(["layer", "avatar"]),
|
|
31
|
+
cssPrefix(["role", role]),
|
|
32
|
+
cssPrefix(["shape", shape]),
|
|
33
|
+
cssPrefix("avatar"),
|
|
34
34
|
{
|
|
35
35
|
divider: divider,
|
|
36
36
|
},
|
|
37
37
|
],
|
|
38
38
|
style: {
|
|
39
|
-
[
|
|
39
|
+
[cssProperty("width")]: size,
|
|
40
40
|
backgroundImage: backgroundImage,
|
|
41
41
|
},
|
|
42
42
|
};
|
|
@@ -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
|
|
|
@@ -41,9 +41,9 @@ $size-line-height: sass.fn-naming-var("line-height");
|
|
|
41
41
|
align-items: center;
|
|
42
42
|
position: relative;
|
|
43
43
|
overflow: hidden;
|
|
44
|
-
color:
|
|
45
|
-
background:
|
|
46
|
-
border-color:
|
|
44
|
+
color: rgba(#{$button-color});
|
|
45
|
+
background: rgba(#{$button-background-color});
|
|
46
|
+
border-color: rgba(#{$button-border-color});
|
|
47
47
|
border-style: solid;
|
|
48
48
|
border-width: #{$border-width};
|
|
49
49
|
white-space: nowrap;
|
|
@@ -62,32 +62,40 @@ $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
|
-
|
|
66
|
-
|
|
67
|
-
background-color:
|
|
65
|
+
// Text variant
|
|
66
|
+
&.text {
|
|
67
|
+
background-color: transparent;
|
|
68
|
+
border-color: transparent;
|
|
69
|
+
color: rgba(#{$button-background-color});
|
|
68
70
|
}
|
|
69
71
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
border-color:
|
|
73
|
-
background-color:
|
|
72
|
+
// Fill variant
|
|
73
|
+
&.fill:hover {
|
|
74
|
+
border-color: rgba(#{$button-border-color-hover});
|
|
75
|
+
background-color: rgba(#{$button-background-color-hover});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.fill.focus,
|
|
79
|
+
&.fill:focus {
|
|
80
|
+
border-color: rgba(#{$button-border-color-focus});
|
|
81
|
+
background-color: rgba(#{$button-background-color-focus});
|
|
74
82
|
|
|
75
83
|
&.shadow {
|
|
76
|
-
box-shadow: 0 0 0 0.25rem
|
|
84
|
+
box-shadow: 0 0 0 0.25rem rgba(#{$button-box-shadow-color-focus}, 0.25);
|
|
77
85
|
}
|
|
78
86
|
}
|
|
79
87
|
|
|
80
|
-
|
|
81
|
-
&.active {
|
|
82
|
-
border-color:
|
|
83
|
-
background-color:
|
|
88
|
+
&.fill:active,
|
|
89
|
+
&.fill.active {
|
|
90
|
+
border-color: rgba(#{$button-border-color-active});
|
|
91
|
+
background-color: rgba(#{$button-background-color-active});
|
|
84
92
|
}
|
|
85
93
|
|
|
86
|
-
|
|
87
|
-
&.disabled {
|
|
88
|
-
border-color:
|
|
89
|
-
background-color:
|
|
90
|
-
color:
|
|
94
|
+
&.fill:disabled,
|
|
95
|
+
&.fill.disabled {
|
|
96
|
+
border-color: rgba(#{$button-border-color-disabled});
|
|
97
|
+
background-color: rgba(#{$button-background-color-disabled});
|
|
98
|
+
color: rgba(#{$button-color-disabled});
|
|
91
99
|
cursor: not-allowed;
|
|
92
100
|
}
|
|
93
101
|
|
|
@@ -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;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject, ref } from "vue";
|
|
5
5
|
import { type ButtonProps } from "./button.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssPrefix } from "../../utils";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
|
|
8
8
|
|
|
9
9
|
// Component setup (props, emits, injects)
|
|
@@ -30,11 +30,11 @@ const buttonAttrs = computed(() => {
|
|
|
30
30
|
|
|
31
31
|
return {
|
|
32
32
|
class: [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
cssPrefix(["layer", "button"]),
|
|
34
|
+
cssPrefix(["role", role]),
|
|
35
|
+
cssPrefix(["shape", shape]),
|
|
36
|
+
cssPrefix("button"),
|
|
37
|
+
cssPrefix(["size", props.size]),
|
|
38
38
|
props.variant,
|
|
39
39
|
{
|
|
40
40
|
block: props.block,
|
|
@@ -46,7 +46,7 @@ const buttonAttrs = computed(() => {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
const loaderAttrs = {
|
|
49
|
-
class: [
|
|
49
|
+
class: [cssPrefix("loader")],
|
|
50
50
|
} as const;
|
|
51
51
|
|
|
52
52
|
// Methods
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, provide, toRefs } from "vue";
|
|
5
5
|
import { type CableProviderState, type CableProps } from "./cable.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssPrefix } from "../../utils";
|
|
7
7
|
import { CABLE_PROVIDER_STATE_KEY } from "./cable.constants";
|
|
8
8
|
|
|
9
9
|
// Component setup (props, emits, injects)
|
|
@@ -21,7 +21,7 @@ const { placement } = toRefs(props);
|
|
|
21
21
|
// ----------------------------------------------------------------------------
|
|
22
22
|
const cableAttrs = computed(() => {
|
|
23
23
|
return {
|
|
24
|
-
class: [
|
|
24
|
+
class: [cssPrefix(["layer", "cable"]), cssPrefix("cable"), placement.value],
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
27
|
|
|
@@ -9,12 +9,12 @@ $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} {
|
|
16
|
-
background-color:
|
|
17
|
-
color:
|
|
16
|
+
background-color: rgba(#{$card-background-color});
|
|
17
|
+
color: rgba(#{$card-color});
|
|
18
18
|
border-radius: #{$border-radius};
|
|
19
19
|
transition:
|
|
20
20
|
box-shadow #{$transition-duration} ease,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject, provide } from "vue";
|
|
5
5
|
import { type CardProps, type CardProviderState } from "./card.type";
|
|
6
|
-
import {
|
|
6
|
+
import { cssPrefix } from "../../../utils";
|
|
7
7
|
import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../../app";
|
|
8
8
|
import { CARD_PROVIDER_STATE_KEY } from "./card.constants";
|
|
9
9
|
|
|
@@ -33,10 +33,10 @@ const role = computed(() => {
|
|
|
33
33
|
const cardAttrs = computed(() => {
|
|
34
34
|
return {
|
|
35
35
|
class: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
cssPrefix(["layer", "card"]),
|
|
37
|
+
cssPrefix(["role", role.value]),
|
|
38
|
+
cssPrefix(["shape", shape.value]),
|
|
39
|
+
cssPrefix("card"),
|
|
40
40
|
{
|
|
41
41
|
divider: divider.value,
|
|
42
42
|
},
|
|
@@ -8,11 +8,11 @@ $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
|
-
background-color:
|
|
15
|
-
color:
|
|
14
|
+
background-color: rgba(#{$card-background-color});
|
|
15
|
+
color: rgba(#{$card-color});
|
|
16
16
|
padding: calc(#{$padding-y} * 4) calc(#{$padding-x} * 4);
|
|
17
17
|
transition:
|
|
18
18
|
box-shadow #{$transition-duration} ease,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<style lang="scss" src="./card-body.scss"></style>
|
|
2
2
|
<template src="./card-body.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
|
-
import {
|
|
4
|
+
import { cssPrefix } from "../../../utils";
|
|
5
5
|
|
|
6
6
|
const cardBodyAttrs = {
|
|
7
|
-
class: [
|
|
7
|
+
class: [cssPrefix("card-body")],
|
|
8
8
|
} as const;
|
|
9
9
|
</script>
|
|
@@ -12,11 +12,11 @@ $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
|
-
background-color:
|
|
19
|
-
color:
|
|
18
|
+
background-color: rgba(#{$card-background-color});
|
|
19
|
+
color: rgba(#{$card-color});
|
|
20
20
|
padding: calc(#{$padding-y} * 4) calc(#{$padding-x} * 4);
|
|
21
21
|
border-top: #{$border};
|
|
22
22
|
transition:
|
|
@@ -27,6 +27,6 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
27
27
|
border-radius #{$transition-duration} ease;
|
|
28
28
|
|
|
29
29
|
&.divider {
|
|
30
|
-
border-color:
|
|
30
|
+
border-color: rgba(#{$card-border-color});
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<template src="./card-footer.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject } from "vue";
|
|
5
|
-
import {
|
|
5
|
+
import { cssPrefix } from "../../../utils";
|
|
6
6
|
import { type CardProviderState, CARD_PROVIDER_STATE_KEY } from "../card";
|
|
7
7
|
|
|
8
8
|
// Component setup (props, emits, injects)
|
|
@@ -15,7 +15,7 @@ const cardFooterAttrs = computed(() => {
|
|
|
15
15
|
const divider = cardProviderState?.divider.value ?? false;
|
|
16
16
|
return {
|
|
17
17
|
class: [
|
|
18
|
-
|
|
18
|
+
cssPrefix("card-footer"),
|
|
19
19
|
{
|
|
20
20
|
divider,
|
|
21
21
|
},
|
|
@@ -12,11 +12,11 @@ $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
|
-
background-color:
|
|
19
|
-
color:
|
|
18
|
+
background-color: rgba(#{$card-background-color});
|
|
19
|
+
color: rgba(#{$card-color});
|
|
20
20
|
padding: calc(#{$padding-y} * 4) calc(#{$padding-x} * 4);
|
|
21
21
|
border-bottom: #{$border};
|
|
22
22
|
transition:
|
|
@@ -27,6 +27,6 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
27
27
|
border-radius #{$transition-duration} ease;
|
|
28
28
|
|
|
29
29
|
&.divider {
|
|
30
|
-
border-color:
|
|
30
|
+
border-color: rgba(#{$card-border-color});
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<template src="./card-header.html"></template>
|
|
3
3
|
<script lang="ts" setup>
|
|
4
4
|
import { computed, inject } from "vue";
|
|
5
|
-
import {
|
|
5
|
+
import { cssPrefix } from "../../../utils";
|
|
6
6
|
import { type CardProviderState, CARD_PROVIDER_STATE_KEY } from "../card";
|
|
7
7
|
|
|
8
8
|
// Component setup (props, emits, injects)
|
|
@@ -15,7 +15,7 @@ const cardHeaderAttrs = computed(() => {
|
|
|
15
15
|
const divider = cardProviderState?.divider.value ?? false;
|
|
16
16
|
return {
|
|
17
17
|
class: [
|
|
18
|
-
|
|
18
|
+
cssPrefix("card-header"),
|
|
19
19
|
{
|
|
20
20
|
divider,
|
|
21
21
|
},
|
|
@@ -17,7 +17,11 @@ $checkbox-background-color-unchecked: sass.fn-naming-var(
|
|
|
17
17
|
$checkbox-background-color-checked: sass.fn-naming-var("checkbox", "background-color", "checked");
|
|
18
18
|
$checkbox-background-color-disabled: sass.fn-naming-var("checkbox", "background-color", "disabled");
|
|
19
19
|
|
|
20
|
-
$checkbox-color: sass.fn-naming-var("checkbox", "color");
|
|
20
|
+
$checkbox-color-checked: sass.fn-naming-var("checkbox", "color", "checked");
|
|
21
|
+
$checkbox-color-unchecked: sass.fn-naming-var("checkbox", "color", "unchecked");
|
|
22
|
+
$checkbox-color-hover: sass.fn-naming-var("checkbox", "color", "hover");
|
|
23
|
+
$checkbox-color-focus: sass.fn-naming-var("checkbox", "color", "focus");
|
|
24
|
+
$checkbox-color-disabled: sass.fn-naming-var("checkbox", "color", "disabled");
|
|
21
25
|
|
|
22
26
|
$checkbox-border-color-hover: sass.fn-naming-var("checkbox", "border-color", "hover");
|
|
23
27
|
$checkbox-border-color-focus: sass.fn-naming-var("checkbox", "border-color", "focus");
|
|
@@ -27,7 +31,7 @@ $checkbox-border-color-disabled: sass.fn-naming-var("checkbox", "border-color",
|
|
|
27
31
|
|
|
28
32
|
$checkbox-box-shadow-color-focus: sass.fn-naming-var("checkbox", "box-shadow-color", "focus");
|
|
29
33
|
|
|
30
|
-
$transition-duration: sass.fn-naming-var("
|
|
34
|
+
$transition-duration: sass.fn-naming-var("duration");
|
|
31
35
|
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
32
36
|
$radius-size: sass.fn-naming-var("radius-size");
|
|
33
37
|
$size-control-mark-size: sass.fn-naming-var("control-mark-size");
|
|
@@ -49,7 +53,7 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
49
53
|
display: flex;
|
|
50
54
|
align-items: center;
|
|
51
55
|
justify-content: center;
|
|
52
|
-
border: 1px solid
|
|
56
|
+
border: 1px solid transparent;
|
|
53
57
|
background-color: transparent;
|
|
54
58
|
border-radius: #{$border-radius};
|
|
55
59
|
transition:
|
|
@@ -65,7 +69,7 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
65
69
|
content: "";
|
|
66
70
|
width: calc(#{$size-control-mark-size} * 0.2);
|
|
67
71
|
height: calc(#{$size-control-mark-size} * 0.5);
|
|
68
|
-
border: solid
|
|
72
|
+
border: solid rgba(#{$checkbox-color-unchecked});
|
|
69
73
|
border-width: 0 2px 2px 0;
|
|
70
74
|
transform: rotate(45deg) scale(0);
|
|
71
75
|
transform-origin: center;
|
|
@@ -81,12 +85,12 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
81
85
|
&:not(.on) {
|
|
82
86
|
.#{$checkbox-icon} {
|
|
83
87
|
background-color: transparent;
|
|
84
|
-
border-color:
|
|
88
|
+
border-color: rgba(#{$checkbox-border-color-unchecked});
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
&:not(.disabled):not(.readonly):hover {
|
|
88
92
|
.#{$checkbox-icon} {
|
|
89
|
-
border-color:
|
|
93
|
+
border-color: rgba(#{$checkbox-border-color-hover});
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
96
|
}
|
|
@@ -94,22 +98,23 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
94
98
|
&.on {
|
|
95
99
|
&.fill {
|
|
96
100
|
.#{$checkbox-icon} {
|
|
97
|
-
background-color:
|
|
98
|
-
border-color:
|
|
101
|
+
background-color: rgba(#{$checkbox-background-color-checked});
|
|
102
|
+
border-color: rgba(#{$checkbox-border-color-checked});
|
|
99
103
|
|
|
100
104
|
&::after {
|
|
101
105
|
transform: rotate(45deg) scale(1);
|
|
106
|
+
border-color: rgba(#{$checkbox-color-checked});
|
|
102
107
|
}
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
110
|
|
|
106
111
|
&.outline {
|
|
107
112
|
.#{$checkbox-icon} {
|
|
108
|
-
border-color:
|
|
113
|
+
border-color: rgba(#{$checkbox-border-color-checked});
|
|
109
114
|
|
|
110
115
|
&::after {
|
|
111
116
|
transform: rotate(45deg) scale(1);
|
|
112
|
-
border-color:
|
|
117
|
+
border-color: rgba(#{$checkbox-background-color-checked});
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
}
|
|
@@ -121,8 +126,8 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
121
126
|
|
|
122
127
|
&.on {
|
|
123
128
|
.#{$checkbox-icon} {
|
|
124
|
-
background-color:
|
|
125
|
-
border-color:
|
|
129
|
+
background-color: rgba(#{$checkbox-background-color-disabled});
|
|
130
|
+
border-color: rgba(#{$checkbox-border-color-disabled});
|
|
126
131
|
}
|
|
127
132
|
}
|
|
128
133
|
}
|
|
@@ -134,12 +139,12 @@ $border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radiu
|
|
|
134
139
|
&.focus {
|
|
135
140
|
&.shadow {
|
|
136
141
|
.#{$checkbox-icon} {
|
|
137
|
-
box-shadow: 0 0 0 0.25rem
|
|
142
|
+
box-shadow: 0 0 0 0.25rem rgba(#{$checkbox-box-shadow-color-focus}, 0.25);
|
|
138
143
|
}
|
|
139
144
|
}
|
|
140
145
|
|
|
141
146
|
.#{$checkbox-icon} {
|
|
142
|
-
border-color:
|
|
147
|
+
border-color: rgba(#{$checkbox-border-color-focus});
|
|
143
148
|
}
|
|
144
149
|
}
|
|
145
150
|
}
|