@appscode/design-system 2.17.37 → 2.17.39

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.
Files changed (32) hide show
  1. package/main.scss +4 -1
  2. package/package.json +1 -1
  3. package/vue-components/styles/base/utilities/_global.scss +8 -0
  4. package/vue-components/styles/base/utilities/_typography.scss +5 -0
  5. package/vue-components/styles/components/_ac-duration.scss +50 -0
  6. package/vue-components/styles/components/_file-explore.scss +31 -0
  7. package/vue-components/styles/components/_platform-design.scss +1 -0
  8. package/vue-components/styles/components/_time-picker.scss +2 -0
  9. package/vue-components/styles/components/cards/_all.scss +1 -1
  10. package/vue-components/styles/components/cards/_cards-group.scss +26 -0
  11. package/vue-components/styles/components/form-fields/_input-card.scss +3 -1
  12. package/vue-components/styles/components/form-fields/_input.scss +63 -1
  13. package/vue-components/v3/alert/AlertLinked.vue +32 -0
  14. package/vue-components/v3/config-secret/ConfigSecret.vue +61 -0
  15. package/vue-components/v3/form-fields/AcSingleInput.vue +20 -0
  16. package/vue-components/v3/form-fields/CheckRadio.vue +3 -1
  17. package/vue-components/v3/icons/ArrowDownLongIcon.vue +8 -0
  18. package/vue-components/v3/icons/ArrowRightIcon.vue +14 -0
  19. package/vue-components/v3/icons/InfoLightIcon.vue +15 -0
  20. package/vue-components/v3/icons/MachineCpuIcon.vue +8 -0
  21. package/vue-components/v3/icons/MachineMemoryIcon.vue +8 -0
  22. package/vue-components/v3/icons/StorageIcon-2.vue +14 -0
  23. package/vue-components/v3/node-selection/NodeSelection.vue +82 -0
  24. package/vue-components/v3/postgres/Postgres.vue +33 -0
  25. package/vue-components/v3/replica-set/MachineProfile.vue +119 -0
  26. package/vue-components/v3/replica-set/MultiMachineProfile.vue +100 -0
  27. package/vue-components/v3/replica-set/UpgradeSet.vue +40 -0
  28. package/vue-components/v3/scaling-rules/ScalingRules.vue +93 -0
  29. package/vue-components/v3/section/SectionContent.vue +1 -1
  30. package/vue-components/v3/threshold/UsageThreshold.vue +24 -0
  31. package/vue-components/v3/time/AcDuration.vue +167 -0
  32. package/vue-components/v3/time/AcDurationNew.vue +235 -0
@@ -0,0 +1,235 @@
1
+ <script setup>
2
+ import { onMounted, onBeforeUnmount } from "vue";
3
+
4
+ function useDraggable(selector) {
5
+ let isDragging = false;
6
+ let startY = 0;
7
+ let scrollTop = 0;
8
+
9
+ const onMouseMove = (e) => {
10
+ if (!isDragging) return;
11
+ const y = e.pageY;
12
+ const walk = y - startY;
13
+ el.scrollTop = scrollTop - walk;
14
+ };
15
+
16
+ const onTouchMove = (e) => {
17
+ if (!isDragging) return;
18
+ const y = e.touches[0].pageY;
19
+ const walk = y - startY;
20
+ el.scrollTop = scrollTop - walk;
21
+ };
22
+
23
+ const stopDrag = () => (isDragging = false);
24
+
25
+ let el;
26
+
27
+ onMounted(() => {
28
+ el = document.querySelector(selector);
29
+ if (!el) return;
30
+
31
+ const startDragMouse = (e) => {
32
+ isDragging = true;
33
+ startY = e.pageY;
34
+ scrollTop = el.scrollTop;
35
+ };
36
+
37
+ const startDragTouch = (e) => {
38
+ isDragging = true;
39
+ startY = e.touches[0].pageY;
40
+ scrollTop = el.scrollTop;
41
+ };
42
+
43
+ el.addEventListener("mousedown", startDragMouse);
44
+ el.addEventListener("touchstart", startDragTouch);
45
+ window.addEventListener("mousemove", onMouseMove);
46
+ window.addEventListener("mouseup", stopDrag);
47
+ window.addEventListener("touchmove", onTouchMove, { passive: false });
48
+ window.addEventListener("touchend", stopDrag);
49
+ });
50
+
51
+ onBeforeUnmount(() => {
52
+ window.removeEventListener("mousemove", onMouseMove);
53
+ window.removeEventListener("mouseup", stopDrag);
54
+ window.removeEventListener("touchmove", onTouchMove);
55
+ window.removeEventListener("touchend", stopDrag);
56
+ });
57
+ }
58
+
59
+ useDraggable(".picker-day");
60
+ useDraggable(".picker-hour");
61
+ useDraggable(".picker-minute");
62
+ </script>
63
+
64
+ <template>
65
+ <div class="picker-wrapper">
66
+ <div class="duration-header"><h6>Duration ( 1day 06h 9min )</h6></div>
67
+ <div class="d-title">
68
+ <span>DAY</span>
69
+ <span>HOUR</span>
70
+ <span>MINUTE</span>
71
+ </div>
72
+ <div class="picker">
73
+ <div class="picker-window"></div>
74
+ <!-- <div class="triangle"></div> -->
75
+
76
+ <ul class="picker-day">
77
+ <li v-for="i in 30" :key="i">{{ i }}</li>
78
+ </ul>
79
+ <ul class="picker-hour">
80
+ <li v-for="i in 24" :key="i">{{ i }}</li>
81
+ </ul>
82
+ <ul class="picker-minute">
83
+ <li v-for="i in 60" :key="i">{{ i }}</li>
84
+ </ul>
85
+ </div>
86
+ <div class="duration-footer is-flex is-justify-content-flex-end pr-8 pb-8">
87
+ <div class="buttons">
88
+ <button class="button ac-button is-small is-outlined" @click="showDuration = false">Cancel</button>
89
+ <button class="button ac-button is-small is-outlined">Ok</button>
90
+ </div>
91
+ </div>
92
+ </div>
93
+ </template>
94
+ <style lang="scss" scoped>
95
+ /* ========== Variables ========== */
96
+ $cool-gray: #eff1f1;
97
+ $secondary-light-gray: #f7f9fa;
98
+ $scroll-highlight: darken($cool-gray, 10);
99
+
100
+ /* ========== Mixins ========== */
101
+ @mixin hide-scrollbars {
102
+ -ms-overflow-style: none; // IE 10+
103
+ scrollbar-width: none; // Firefox
104
+ &::-webkit-scrollbar {
105
+ display: none;
106
+ }
107
+ }
108
+
109
+ /* ========== Container ========== */
110
+ .picker-wrapper {
111
+ background: white;
112
+ box-shadow: 0 0.5vw 2vw -5px rgba(0, 0, 0, 0.2);
113
+ display: inline-flex;
114
+ flex-direction: column;
115
+ border-radius: 8px;
116
+ }
117
+
118
+ /* ========== Header ========== */
119
+ .duration-header {
120
+ background-color: $secondary-light-gray;
121
+ text-align: center;
122
+ height: 36px;
123
+ display: flex;
124
+ align-items: center;
125
+ justify-content: center;
126
+
127
+ h6 {
128
+ font-size: 13px;
129
+ margin: 0;
130
+ font-weight: 600;
131
+ }
132
+ }
133
+
134
+ /* ========== Title Labels ========== */
135
+ .d-title {
136
+ display: inline-grid;
137
+ grid-template-columns: repeat(3, fit-content(100px));
138
+ justify-content: end;
139
+ gap: 0.5em;
140
+ font-weight: bold;
141
+ font-size: 11px;
142
+ padding: 8px 1rem 0;
143
+
144
+ span {
145
+ width: 40px;
146
+ text-align: center;
147
+ margin-right: 1em;
148
+ }
149
+ }
150
+
151
+ /* ========== Picker Section ========== */
152
+ .picker {
153
+ position: relative;
154
+ display: inline-grid;
155
+ grid-template-columns: repeat(3, fit-content(80px));
156
+ justify-content: end;
157
+ padding: 0 1rem;
158
+ font-size: 13px;
159
+ font-weight: 500;
160
+ font-feature-settings: "tnum";
161
+
162
+ &::before,
163
+ &::after {
164
+ content: "";
165
+ position: absolute;
166
+ width: 100%;
167
+ pointer-events: none;
168
+ z-index: 1;
169
+ }
170
+
171
+ &::before {
172
+ top: 0;
173
+ height: 50%;
174
+ background: linear-gradient(white, rgba(255, 255, 255, 0));
175
+ }
176
+
177
+ &::after {
178
+ bottom: 0;
179
+ height: 50%;
180
+ background: linear-gradient(rgba(255, 255, 255, 0), white);
181
+ }
182
+
183
+ ul {
184
+ @include hide-scrollbars();
185
+ max-height: 190px;
186
+ overflow-y: scroll;
187
+ padding: 1.5em 0;
188
+ margin-right: 1em;
189
+ scroll-snap-type: y mandatory;
190
+ scroll-behavior: smooth;
191
+
192
+ li {
193
+ scroll-snap-align: center;
194
+ height: 2.35em;
195
+ width: 40px;
196
+ text-align: center;
197
+ user-select: none;
198
+ cursor: pointer;
199
+ line-height: 2.35em;
200
+ border-radius: 4px;
201
+
202
+ &:hover {
203
+ background: #f0f0f0;
204
+ }
205
+ }
206
+ }
207
+ }
208
+
209
+ /* ========== Highlight Window ========== */
210
+ .picker-window {
211
+ position: absolute;
212
+ top: 50%;
213
+ left: 0;
214
+ width: 100%;
215
+ height: 2.4em;
216
+ transform: translateY(-52%);
217
+ border-top: 1px solid $scroll-highlight;
218
+ border-bottom: 1px solid $scroll-highlight;
219
+ pointer-events: none;
220
+ z-index: 2;
221
+ }
222
+
223
+ /* ========== Footer Buttons ========== */
224
+ .duration-footer {
225
+ padding: 0 1rem 1rem;
226
+ display: flex;
227
+ justify-content: flex-end;
228
+ gap: 0.5rem;
229
+
230
+ .buttons {
231
+ display: flex;
232
+ gap: 0.5rem;
233
+ }
234
+ }
235
+ </style>