@toife/vue 3.1.3 → 3.1.5
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 +1 -1
- package/src/components/action/action.scss +1 -1
- package/src/components/action/action.vue +5 -5
- package/src/components/app/app.scss +2 -2
- package/src/components/app/app.type.ts +6 -0
- package/src/components/app/app.vue +8 -2
- package/src/components/avatar/avatar.scss +6 -4
- package/src/components/avatar/avatar.vue +6 -6
- package/src/components/button/button.scss +19 -16
- package/src/components/button/button.type.ts +3 -1
- package/src/components/button/button.vue +7 -7
- package/src/components/cable/cable.vue +2 -2
- package/src/components/card/card/card.scss +5 -3
- package/src/components/card/card/card.vue +5 -5
- package/src/components/card/card-body/card-body.scss +2 -2
- package/src/components/card/card-body/card-body.vue +2 -2
- package/src/components/card/card-footer/card-footer.scss +3 -3
- package/src/components/card/card-footer/card-footer.vue +2 -2
- package/src/components/card/card-header/card-header.scss +3 -3
- 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 +27 -27
- package/src/components/checkbox/checkbox.type.ts +4 -0
- package/src/components/checkbox/checkbox.vue +8 -6
- package/src/components/collapse/collapse.html +1 -1
- package/src/components/collapse/collapse.scss +2 -2
- package/src/components/collapse/collapse.vue +9 -9
- package/src/components/container/container.vue +2 -2
- package/src/components/decision-modal/decision-modal.scss +12 -10
- package/src/components/decision-modal/decision-modal.vue +8 -8
- package/src/components/divider/divider.scss +2 -2
- package/src/components/divider/divider.vue +4 -4
- package/src/components/dropdown/dropdown.scss +8 -5
- package/src/components/dropdown/dropdown.type.ts +4 -1
- package/src/components/dropdown/dropdown.vue +8 -6
- package/src/components/field/field.type.ts +4 -4
- package/src/components/field/outline/outline.scss +24 -21
- package/src/components/field/outline/outline.vue +26 -18
- package/src/components/form-group/form-group.vue +2 -2
- package/src/components/gesture-indicator/gesture-indicator.scss +4 -2
- package/src/components/gesture-indicator/gesture-indicator.vue +4 -4
- package/src/components/image/image.vue +12 -5
- package/src/components/index.ts +1 -0
- package/src/components/layout/flex/flex.scss +0 -2
- package/src/components/layout/flex/flex.vue +8 -8
- 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/grid.vue +6 -6
- 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 +4 -2
- package/src/components/modal/modal.vue +68 -5
- package/src/components/page/page.vue +2 -2
- package/src/components/present/present.scss +3 -3
- package/src/components/present/present.vue +14 -14
- package/src/components/radio/radio/radio.html +1 -1
- package/src/components/radio/radio/radio.scss +25 -18
- package/src/components/radio/radio/radio.type.ts +4 -0
- package/src/components/radio/radio/radio.vue +7 -5
- package/src/components/radio/radio-group/radio-group.vue +2 -2
- package/src/components/refresher/refresher.html +1 -4
- package/src/components/refresher/refresher.scss +8 -26
- package/src/components/refresher/refresher.vue +2 -16
- package/src/components/route/route-navigator/route-navigator.scss +2 -2
- package/src/components/route/route-navigator/route-navigator.vue +10 -13
- 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 +2 -2
- package/src/components/segmented-field/segmented-field.vue +8 -8
- package/src/components/select/select.html +2 -2
- package/src/components/select/select.scss +10 -10
- package/src/components/select/select.vue +10 -10
- package/src/components/skeleton/skeleton.scss +3 -1
- package/src/components/skeleton/skeleton.vue +7 -7
- package/src/components/slide-range/index.ts +2 -0
- package/src/components/slide-range/slide-range.html +19 -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.html +1 -1
- package/src/components/switch/switch.scss +29 -38
- package/src/components/switch/switch.type.ts +6 -0
- package/src/components/switch/switch.vue +24 -8
- 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 +194 -122
- package/src/components/tabs/tabs/tabs.type.ts +5 -2
- package/src/components/tabs/tabs/tabs.vue +47 -27
- package/src/components/toast/toast/toast.vue +2 -2
- package/src/components/toast/toast-content/toast-content.scss +6 -5
- package/src/components/toast/toast-content/toast-content.vue +5 -5
- package/src/components/toolbar/toolbar.scss +4 -4
- package/src/components/toolbar/toolbar.type.ts +1 -1
- package/src/components/toolbar/toolbar.vue +7 -7
- package/src/factory.ts +108 -50
- package/src/index.ts +1 -1
- package/src/type.ts +2 -1
- package/src/utils/style/index.ts +9 -9
- package/src/utils/style.md +9 -9
- 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/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
|
@@ -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,
|
|
@@ -13,8 +13,8 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
|
|
|
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,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
|
/**
|
|
@@ -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,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
|
+
cssPrefix("app"),
|
|
34
|
+
cssPrefix(["layer", "app"]),
|
|
35
|
+
cssPrefix(["shape", shape.value]),
|
|
36
|
+
cssPrefix(["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");
|
|
@@ -18,12 +19,13 @@ $avatar-border-color: sass.fn-naming-var("avatar", "border-color");
|
|
|
18
19
|
.#{$avatar} {
|
|
19
20
|
position: relative;
|
|
20
21
|
overflow: hidden;
|
|
21
|
-
background-color:
|
|
22
|
+
background-color: rgba(#{$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;
|
|
28
|
+
background-position: center;
|
|
27
29
|
transition:
|
|
28
30
|
background-color #{$transition-duration} ease,
|
|
29
31
|
color #{$transition-duration} ease,
|
|
@@ -38,6 +40,6 @@ $avatar-border-color: sass.fn-naming-var("avatar", "border-color");
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
&.divider {
|
|
41
|
-
border: #{$border-width} solid
|
|
43
|
+
border: #{$border-width} solid rgba(#{$avatar-border-color});
|
|
42
44
|
}
|
|
43
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
|
};
|
|
@@ -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");
|
|
@@ -39,13 +41,13 @@ $size-line-height: sass.fn-naming-var("line-height");
|
|
|
39
41
|
align-items: center;
|
|
40
42
|
position: relative;
|
|
41
43
|
overflow: hidden;
|
|
42
|
-
color:
|
|
43
|
-
background:
|
|
44
|
-
border-color:
|
|
44
|
+
color: rgba(#{$button-color});
|
|
45
|
+
background: rgba(#{$button-background-color});
|
|
46
|
+
border-color: rgba(#{$button-border-color});
|
|
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,34 +59,35 @@ $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 {
|
|
64
|
-
border-color:
|
|
65
|
-
background-color:
|
|
66
|
+
border-color: rgba(#{$button-border-color-hover});
|
|
67
|
+
background-color: rgba(#{$button-background-color-hover});
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
&.focus,
|
|
69
71
|
&:focus {
|
|
70
|
-
border-color:
|
|
71
|
-
background-color:
|
|
72
|
+
border-color: rgba(#{$button-border-color-focus});
|
|
73
|
+
background-color: rgba(#{$button-background-color-focus});
|
|
72
74
|
|
|
73
75
|
&.shadow {
|
|
74
|
-
box-shadow: 0 0 0 0.25rem
|
|
76
|
+
box-shadow: 0 0 0 0.25rem rgba(#{$button-box-shadow-color-focus}, 0.25);
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
&:active,
|
|
79
81
|
&.active {
|
|
80
|
-
border-color:
|
|
81
|
-
background-color:
|
|
82
|
+
border-color: rgba(#{$button-border-color-active});
|
|
83
|
+
background-color: rgba(#{$button-background-color-active});
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
&:disabled,
|
|
85
87
|
&.disabled {
|
|
86
|
-
border-color: rgba(#{$button-border-color-disabled}
|
|
87
|
-
background-color: rgba(#{$button-background-color-disabled}
|
|
88
|
+
border-color: rgba(#{$button-border-color-disabled});
|
|
89
|
+
background-color: rgba(#{$button-background-color-disabled});
|
|
90
|
+
color: rgba(#{$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;
|
|
@@ -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
|
|
|
@@ -7,12 +7,14 @@ $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
|
-
background-color:
|
|
15
|
-
color:
|
|
16
|
+
background-color: rgba(#{$card-background-color});
|
|
17
|
+
color: rgba(#{$card-color});
|
|
16
18
|
border-radius: #{$border-radius};
|
|
17
19
|
transition:
|
|
18
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
|
},
|
|
@@ -11,8 +11,8 @@ $padding-x: sass.fn-naming-var("spacing", "x");
|
|
|
11
11
|
$transition-duration: sass.fn-naming-var("motion", "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>
|
|
@@ -15,8 +15,8 @@ $border: #{$border-width} solid transparent;
|
|
|
15
15
|
$transition-duration: sass.fn-naming-var("motion", "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
|
},
|
|
@@ -15,8 +15,8 @@ $border: #{$border-width} solid transparent;
|
|
|
15
15
|
$transition-duration: sass.fn-naming-var("motion", "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");
|
|
@@ -28,7 +32,10 @@ $checkbox-border-color-disabled: sass.fn-naming-var("checkbox", "border-color",
|
|
|
28
32
|
$checkbox-box-shadow-color-focus: sass.fn-naming-var("checkbox", "box-shadow-color", "focus");
|
|
29
33
|
|
|
30
34
|
$transition-duration: sass.fn-naming-var("motion", "duration");
|
|
31
|
-
$
|
|
35
|
+
$radius-ratio: sass.fn-naming-var("radius-ratio");
|
|
36
|
+
$radius-size: sass.fn-naming-var("radius-size");
|
|
37
|
+
$size-control-mark-size: sass.fn-naming-var("control-mark-size");
|
|
38
|
+
$border-radius: calc(min(#{$size-control-mark-size}, #{$radius-size}) * #{$radius-ratio});
|
|
32
39
|
|
|
33
40
|
.#{$checkbox} {
|
|
34
41
|
display: inline-flex;
|
|
@@ -41,13 +48,14 @@ $border-radius: sass.fn-naming-var("border-radius");
|
|
|
41
48
|
|
|
42
49
|
.#{$checkbox-icon} {
|
|
43
50
|
flex-shrink: 0;
|
|
44
|
-
width:
|
|
45
|
-
height:
|
|
51
|
+
width: #{$size-control-mark-size};
|
|
52
|
+
height: #{$size-control-mark-size};
|
|
46
53
|
display: flex;
|
|
47
54
|
align-items: center;
|
|
48
55
|
justify-content: center;
|
|
49
|
-
border: 1px solid
|
|
56
|
+
border: 1px solid transparent;
|
|
50
57
|
background-color: transparent;
|
|
58
|
+
border-radius: #{$border-radius};
|
|
51
59
|
transition:
|
|
52
60
|
box-shadow #{$transition-duration} ease,
|
|
53
61
|
border-color #{$transition-duration} ease,
|
|
@@ -55,14 +63,13 @@ $border-radius: sass.fn-naming-var("border-radius");
|
|
|
55
63
|
color #{$transition-duration} ease,
|
|
56
64
|
border-radius #{$transition-duration} ease,
|
|
57
65
|
transform #{$transition-duration} ease;
|
|
58
|
-
border-radius: calc(#{$border-radius} * 0.5);
|
|
59
66
|
box-sizing: border-box;
|
|
60
67
|
|
|
61
68
|
&::after {
|
|
62
69
|
content: "";
|
|
63
|
-
width: 0.
|
|
64
|
-
height: 0.
|
|
65
|
-
border: solid
|
|
70
|
+
width: calc(#{$size-control-mark-size} * 0.2);
|
|
71
|
+
height: calc(#{$size-control-mark-size} * 0.5);
|
|
72
|
+
border: solid rgba(#{$checkbox-color-unchecked});
|
|
66
73
|
border-width: 0 2px 2px 0;
|
|
67
74
|
transform: rotate(45deg) scale(0);
|
|
68
75
|
transform-origin: center;
|
|
@@ -75,23 +82,15 @@ $border-radius: sass.fn-naming-var("border-radius");
|
|
|
75
82
|
}
|
|
76
83
|
}
|
|
77
84
|
|
|
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
85
|
&:not(.on) {
|
|
87
86
|
.#{$checkbox-icon} {
|
|
88
87
|
background-color: transparent;
|
|
89
|
-
border-color:
|
|
88
|
+
border-color: rgba(#{$checkbox-border-color-unchecked});
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
&:not(.disabled):not(.readonly):hover {
|
|
93
92
|
.#{$checkbox-icon} {
|
|
94
|
-
border-color:
|
|
93
|
+
border-color: rgba(#{$checkbox-border-color-hover});
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
96
|
}
|
|
@@ -99,22 +98,23 @@ $border-radius: sass.fn-naming-var("border-radius");
|
|
|
99
98
|
&.on {
|
|
100
99
|
&.fill {
|
|
101
100
|
.#{$checkbox-icon} {
|
|
102
|
-
background-color:
|
|
103
|
-
border-color:
|
|
101
|
+
background-color: rgba(#{$checkbox-background-color-checked});
|
|
102
|
+
border-color: rgba(#{$checkbox-border-color-checked});
|
|
104
103
|
|
|
105
104
|
&::after {
|
|
106
105
|
transform: rotate(45deg) scale(1);
|
|
106
|
+
border-color: rgba(#{$checkbox-color-checked});
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
&.outline {
|
|
112
112
|
.#{$checkbox-icon} {
|
|
113
|
-
border-color:
|
|
113
|
+
border-color: rgba(#{$checkbox-border-color-checked});
|
|
114
114
|
|
|
115
115
|
&::after {
|
|
116
116
|
transform: rotate(45deg) scale(1);
|
|
117
|
-
border-color:
|
|
117
|
+
border-color: rgba(#{$checkbox-background-color-checked});
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -126,8 +126,8 @@ $border-radius: sass.fn-naming-var("border-radius");
|
|
|
126
126
|
|
|
127
127
|
&.on {
|
|
128
128
|
.#{$checkbox-icon} {
|
|
129
|
-
background-color:
|
|
130
|
-
border-color:
|
|
129
|
+
background-color: rgba(#{$checkbox-background-color-disabled});
|
|
130
|
+
border-color: rgba(#{$checkbox-border-color-disabled});
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -139,12 +139,12 @@ $border-radius: sass.fn-naming-var("border-radius");
|
|
|
139
139
|
&.focus {
|
|
140
140
|
&.shadow {
|
|
141
141
|
.#{$checkbox-icon} {
|
|
142
|
-
box-shadow: 0 0 0 0.25rem
|
|
142
|
+
box-shadow: 0 0 0 0.25rem rgba(#{$checkbox-box-shadow-color-focus}, 0.25);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
.#{$checkbox-icon} {
|
|
147
|
-
border-color:
|
|
147
|
+
border-color: rgba(#{$checkbox-border-color-focus});
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
}
|
|
@@ -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;
|