@appscode/design-system 2.17.43 → 2.17.47
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/vue-components/styles/animations/_all.scss +1 -0
- package/vue-components/styles/animations/_form-animation.scss +100 -0
- package/vue-components/styles/base/utilities/_animation.scss +31 -0
- package/vue-components/styles/components/form-fields/_all.scss +1 -0
- package/vue-components/styles/components/form-fields/_range-slider.scss +162 -0
- package/vue-components/v3/form-fields/Switch.vue +3 -2
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./form-animation.scss";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Shared Keyframes
|
|
2
|
+
@keyframes slideInFromBottom {
|
|
3
|
+
0% {
|
|
4
|
+
opacity: 0;
|
|
5
|
+
transform: translateY(30px) scale(0.95);
|
|
6
|
+
}
|
|
7
|
+
60% {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
transform: translateY(-5px) scale(1.02);
|
|
10
|
+
}
|
|
11
|
+
100% {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
transform: translateY(0) scale(1);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@keyframes fadeOutCollapse {
|
|
18
|
+
0% {
|
|
19
|
+
opacity: 1;
|
|
20
|
+
transform: scale(1);
|
|
21
|
+
max-height: 1000px;
|
|
22
|
+
margin-bottom: 16px;
|
|
23
|
+
}
|
|
24
|
+
40% {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
transform: scale(0.95);
|
|
27
|
+
max-height: 1000px;
|
|
28
|
+
margin-bottom: 16px;
|
|
29
|
+
}
|
|
30
|
+
100% {
|
|
31
|
+
opacity: 0;
|
|
32
|
+
transform: scale(0.9);
|
|
33
|
+
max-height: 0;
|
|
34
|
+
margin-bottom: 0;
|
|
35
|
+
padding-top: 0;
|
|
36
|
+
padding-bottom: 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@keyframes fadeIn {
|
|
41
|
+
from {
|
|
42
|
+
opacity: 0;
|
|
43
|
+
}
|
|
44
|
+
to {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Reusable Mixins
|
|
50
|
+
@mixin item-enter-active {
|
|
51
|
+
animation: slideInFromBottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@mixin item-leave-active {
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
animation: fadeOutCollapse 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@mixin item-move {
|
|
60
|
+
transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@mixin newest-item-highlight {
|
|
64
|
+
background: linear-gradient(135deg, hsl(var(--primary-hue), 15%, 99%) 0%, hsl(var(--secondary-hue), 15%, 99%) 100%);
|
|
65
|
+
border: 2px solid hsl(var(--primary-hue), var(--primary-saturation), var(--primary-light));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Form Animation Classes
|
|
69
|
+
|
|
70
|
+
// Apply highlight to newest items in different contexts
|
|
71
|
+
.mixed-object-item.newest-item,
|
|
72
|
+
.each-object-card.newest-item {
|
|
73
|
+
@include newest-item-highlight;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Array Item Transitions (used in ArrayOfArrayObject.vue, ArrayItem.vue)
|
|
77
|
+
.array-item-enter-active {
|
|
78
|
+
@include item-enter-active;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.array-item-leave-active {
|
|
82
|
+
@include item-leave-active;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.array-item-move {
|
|
86
|
+
@include item-move;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Object Item Transitions (used in TheObject.vue)
|
|
90
|
+
.object-item-enter-active {
|
|
91
|
+
@include item-enter-active;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.object-item-leave-active {
|
|
95
|
+
@include item-leave-active;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.object-item-move {
|
|
99
|
+
@include item-move;
|
|
100
|
+
}
|
|
@@ -26,3 +26,34 @@
|
|
|
26
26
|
transform: translate(0, 0);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
// Animations
|
|
31
|
+
@keyframes slideIn {
|
|
32
|
+
from {
|
|
33
|
+
opacity: 0;
|
|
34
|
+
transform: translateY(5px);
|
|
35
|
+
}
|
|
36
|
+
to {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
transform: translateY(0);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@keyframes pulse {
|
|
43
|
+
0%,
|
|
44
|
+
100% {
|
|
45
|
+
transform: scale(1);
|
|
46
|
+
}
|
|
47
|
+
50% {
|
|
48
|
+
transform: scale(1.05);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@keyframes fadeIn {
|
|
53
|
+
from {
|
|
54
|
+
opacity: 0;
|
|
55
|
+
}
|
|
56
|
+
to {
|
|
57
|
+
opacity: 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
.threshold-field {
|
|
2
|
+
animation: slideIn 0.3s ease-out;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ac-slider-container {
|
|
6
|
+
display: block;
|
|
7
|
+
.slider-wrapper {
|
|
8
|
+
position: relative;
|
|
9
|
+
margin: 1rem 0 0.5rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.slider-tooltip {
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: -35px;
|
|
15
|
+
transform: translateX(-50%);
|
|
16
|
+
padding: 0.375rem 0.75rem;
|
|
17
|
+
background: hsl(217, 71%, 53%);
|
|
18
|
+
color: white;
|
|
19
|
+
font-size: 0.75rem;
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
border-radius: 4px;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
opacity: 0;
|
|
25
|
+
transition:
|
|
26
|
+
opacity 0.2s ease,
|
|
27
|
+
left 0.05s ease-out;
|
|
28
|
+
z-index: 10;
|
|
29
|
+
|
|
30
|
+
&::after {
|
|
31
|
+
content: "";
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 100%;
|
|
34
|
+
left: 50%;
|
|
35
|
+
transform: translateX(-50%);
|
|
36
|
+
border: 5px solid transparent;
|
|
37
|
+
border-top-color: hsl(217, 71%, 53%);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.slider-wrapper:hover .slider-tooltip,
|
|
42
|
+
.slider:focus ~ .slider-tooltip,
|
|
43
|
+
.slider:active ~ .slider-tooltip {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.slider {
|
|
48
|
+
-webkit-appearance: none;
|
|
49
|
+
appearance: none;
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 8px;
|
|
52
|
+
border-radius: 6px;
|
|
53
|
+
background: hsl(0, 0%, 96%);
|
|
54
|
+
outline: none;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
transition: all 0.3s ease;
|
|
57
|
+
|
|
58
|
+
background: linear-gradient(
|
|
59
|
+
to right,
|
|
60
|
+
hsl(217, 71%, 53%) 0%,
|
|
61
|
+
hsl(217, 71%, 53%) calc((var(--value) - var(--min)) / (var(--max) - var(--min)) * 100%),
|
|
62
|
+
hsl(0, 0%, 96%) calc((var(--value) - var(--min)) / (var(--max) - var(--min)) * 100%),
|
|
63
|
+
hsl(0, 0%, 96%) 100%
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
&:hover {
|
|
67
|
+
transform: scaleY(1.1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:disabled {
|
|
71
|
+
opacity: 0.5;
|
|
72
|
+
cursor: not-allowed;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Chrome, Safari, Edge, Opera
|
|
76
|
+
&::-webkit-slider-thumb {
|
|
77
|
+
-webkit-appearance: none;
|
|
78
|
+
appearance: none;
|
|
79
|
+
width: 20px;
|
|
80
|
+
height: 20px;
|
|
81
|
+
border-radius: 50%;
|
|
82
|
+
background: white;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
border: 3px solid hsl(217, 71%, 53%);
|
|
85
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
|
|
86
|
+
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
87
|
+
|
|
88
|
+
&:hover {
|
|
89
|
+
transform: scale(1.2);
|
|
90
|
+
box-shadow: 0 4px 12px rgba(72, 95, 199, 0.4);
|
|
91
|
+
border-width: 4px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:active {
|
|
95
|
+
transform: scale(1.1);
|
|
96
|
+
animation: pulse 0.3s ease;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Firefox
|
|
101
|
+
&::-moz-range-thumb {
|
|
102
|
+
width: 20px;
|
|
103
|
+
height: 20px;
|
|
104
|
+
border-radius: 50%;
|
|
105
|
+
background: white;
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
border: 3px solid hsl(217, 71%, 53%);
|
|
108
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
|
|
109
|
+
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
110
|
+
|
|
111
|
+
&:hover {
|
|
112
|
+
transform: scale(1.2);
|
|
113
|
+
box-shadow: 0 4px 12px rgba(72, 95, 199, 0.4);
|
|
114
|
+
border-width: 4px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&:active {
|
|
118
|
+
transform: scale(1.1);
|
|
119
|
+
animation: pulse 0.3s ease;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Firefox track
|
|
124
|
+
&::-moz-range-track {
|
|
125
|
+
background: transparent;
|
|
126
|
+
border: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Focus state with primary color
|
|
130
|
+
&:focus {
|
|
131
|
+
outline: none;
|
|
132
|
+
|
|
133
|
+
&::-webkit-slider-thumb {
|
|
134
|
+
box-shadow: 0 0 0 4px hsla(217, 71%, 53%, 0.25);
|
|
135
|
+
border-color: hsl(217, 71%, 45%);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&::-moz-range-thumb {
|
|
139
|
+
box-shadow: 0 0 0 4px hsla(217, 71%, 53%, 0.25);
|
|
140
|
+
border-color: hsl(217, 71%, 45%);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Responsive adjustments
|
|
147
|
+
@media (max-width: 768px) {
|
|
148
|
+
.slider {
|
|
149
|
+
height: 10px;
|
|
150
|
+
|
|
151
|
+
&::-webkit-slider-thumb,
|
|
152
|
+
&::-moz-range-thumb {
|
|
153
|
+
width: 24px;
|
|
154
|
+
height: 24px;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.slider-tooltip {
|
|
159
|
+
font-size: 0.875rem;
|
|
160
|
+
padding: 0.5rem 0.875rem;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
interface Props {
|
|
3
3
|
modifierClasses?: string;
|
|
4
4
|
name: string;
|
|
5
|
+
id?: string;
|
|
5
6
|
label?: string;
|
|
6
7
|
errorMsg?: string;
|
|
7
8
|
dataTestId?: string;
|
|
@@ -19,11 +20,11 @@ const model = defineModel({ type: Boolean });
|
|
|
19
20
|
|
|
20
21
|
<template>
|
|
21
22
|
<div class="ac-switch is-flex is-align-items-center gap-8" :class="modifierClasses">
|
|
22
|
-
<label :for="
|
|
23
|
+
<label :for="id">{{ label }}</label>
|
|
23
24
|
<label class="switch">
|
|
24
25
|
<input
|
|
25
26
|
v-model="model"
|
|
26
|
-
:id="
|
|
27
|
+
:id="id"
|
|
27
28
|
type="checkbox"
|
|
28
29
|
:name="name"
|
|
29
30
|
class="switch is-rounded is-primary"
|