cja-phoenix 0.1.1 → 0.2.2
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/dist/cja-phoenix.es.js +1574 -1542
- package/dist/style.css +1 -1
- package/dist/types/components/forms/FileInput.vue.d.ts +5 -5
- package/dist/types/components/index.d.ts +3 -1
- package/dist/types/components/structural/GridContainer.vue.d.ts +33 -0
- package/dist/types/components/{misc/ComponentA.vue.d.ts → structural/GridItem.vue.d.ts} +15 -4
- package/dist/types/utils/ViewportDetector.d.ts +6 -0
- package/dist/types/utils/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/assets/grid.scss +13 -0
- package/src/assets/shadows.scss +3 -8
- package/src/components/forms/FileInput.vue +4 -13
- package/src/components/forms/PhoneInput.vue +2 -9
- package/src/components/forms/SelectInput.vue +19 -27
- package/src/components/forms/TextInput.vue +2 -9
- package/src/components/index.ts +4 -0
- package/src/components/structural/CjaButton.vue +4 -4
- package/src/components/structural/GridContainer.vue +64 -0
- package/src/components/structural/GridItem.vue +45 -0
- package/src/utils/ViewportDetector.ts +30 -0
- package/src/utils/index.ts +2 -1
- package/dist/types/components/misc/ComponentB.vue.d.ts +0 -2
- package/src/components/misc/ComponentA.vue +0 -17
- package/src/components/misc/ComponentB.vue +0 -37
|
@@ -39,7 +39,7 @@ withDefaults(
|
|
|
39
39
|
font-weight: 700;
|
|
40
40
|
cursor: pointer;
|
|
41
41
|
transition: all 0.2s ease-in-out;
|
|
42
|
-
border-width:
|
|
42
|
+
border-width: 1px;
|
|
43
43
|
border-style: solid;
|
|
44
44
|
border-color: transparent;
|
|
45
45
|
background: none;
|
|
@@ -56,21 +56,21 @@ withDefaults(
|
|
|
56
56
|
font-size: 18px;
|
|
57
57
|
line-height: 20px;
|
|
58
58
|
padding: 6px 12px;
|
|
59
|
-
border-radius:
|
|
59
|
+
border-radius: 8px;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
&.btn-size-md {
|
|
63
63
|
font-size: 18px;
|
|
64
64
|
line-height: 20px;
|
|
65
65
|
padding: 10px 16px;
|
|
66
|
-
border-radius:
|
|
66
|
+
border-radius: 8px;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
&.btn-size-lg {
|
|
70
70
|
font-size: 20px;
|
|
71
71
|
line-height: 20px;
|
|
72
72
|
padding: 16px;
|
|
73
|
-
border-radius:
|
|
73
|
+
border-radius: 8px;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
&.btn-primary {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="[`grid-container-${size}`]">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
withDefaults(
|
|
9
|
+
defineProps<{
|
|
10
|
+
size?: 1 | 2 | 3;
|
|
11
|
+
}>(),
|
|
12
|
+
{
|
|
13
|
+
size: 1,
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style lang="scss" scoped>
|
|
19
|
+
@import "../../assets/grid.scss";
|
|
20
|
+
|
|
21
|
+
.grid-container-1,
|
|
22
|
+
.grid-container-2,
|
|
23
|
+
.grid-container-3 {
|
|
24
|
+
display: grid;
|
|
25
|
+
column-gap: $grid-column-gap-sm;
|
|
26
|
+
padding-left: $grid-side-padding-sm;
|
|
27
|
+
padding-right: $grid-side-padding-sm;
|
|
28
|
+
|
|
29
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
|
30
|
+
grid-template-columns: $grid-columns-md;
|
|
31
|
+
column-gap: $grid-column-gap-md;
|
|
32
|
+
padding-left: $grid-side-padding-md;
|
|
33
|
+
padding-right: $grid-side-padding-md;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media screen and (min-width: 1024px) {
|
|
37
|
+
grid-template-columns: $grid-columns-lg;
|
|
38
|
+
column-gap: $grid-column-gap-lg;
|
|
39
|
+
padding-left: $grid-side-padding-lg;
|
|
40
|
+
padding-right: $grid-side-padding-lg;
|
|
41
|
+
max-width: 1440px;
|
|
42
|
+
margin-left: auto;
|
|
43
|
+
margin-right: auto;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.grid-container-1 {
|
|
48
|
+
@media screen and (max-width: 767px) {
|
|
49
|
+
grid-template-columns: $grid-columns-sm-1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.grid-container-2 {
|
|
54
|
+
@media screen and (max-width: 767px) {
|
|
55
|
+
grid-template-columns: $grid-columns-sm-2;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.grid-container-3 {
|
|
60
|
+
@media screen and (max-width: 767px) {
|
|
61
|
+
grid-template-columns: $grid-columns-sm-3;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="[
|
|
4
|
+
`grid-item-sm-${sizeSm}`,
|
|
5
|
+
`grid-item-md-${sizeMd}`,
|
|
6
|
+
`grid-item-lg-${sizeLg}`,
|
|
7
|
+
]"
|
|
8
|
+
>
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
defineProps<{
|
|
15
|
+
sizeSm: 1 | 2 | 3 | 4;
|
|
16
|
+
sizeMd: 1 | 2 | 3 | 4;
|
|
17
|
+
sizeLg: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
18
|
+
}>();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style lang="scss" scoped>
|
|
22
|
+
@for $sm from 1 to 5 {
|
|
23
|
+
.grid-item-sm-#{$sm} {
|
|
24
|
+
@media screen and (max-width: 767px) {
|
|
25
|
+
grid-column: span #{$sm};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@for $md from 1 to 5 {
|
|
31
|
+
.grid-item-md-#{$md} {
|
|
32
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
|
33
|
+
grid-column: span #{$md};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@for $lg from 1 to 13 {
|
|
39
|
+
.grid-item-lg-#{$lg} {
|
|
40
|
+
@media screen and (min-width: 1024px) {
|
|
41
|
+
grid-column: span #{$lg};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Ref, onMounted, onUnmounted, ref } from "vue";
|
|
2
|
+
|
|
3
|
+
export const useViewportDetector = (
|
|
4
|
+
breakpoints: { [index: string]: number } = {
|
|
5
|
+
xs: 0,
|
|
6
|
+
s: 420,
|
|
7
|
+
m: 768,
|
|
8
|
+
lg: 992,
|
|
9
|
+
xl: 1200,
|
|
10
|
+
}
|
|
11
|
+
) => {
|
|
12
|
+
const activeViewport: Ref = ref({});
|
|
13
|
+
|
|
14
|
+
const setViewports = () => {
|
|
15
|
+
for (const key in breakpoints) {
|
|
16
|
+
activeViewport.value[key] = window.innerWidth >= breakpoints[key];
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
onMounted(() => {
|
|
21
|
+
window.addEventListener("resize", setViewports);
|
|
22
|
+
setViewports();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
onUnmounted(() => {
|
|
26
|
+
window.removeEventListener("resize", setViewports);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return { activeViewport };
|
|
30
|
+
};
|
package/src/utils/index.ts
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="component-a-container">
|
|
3
|
-
Hello {{ msg }}! <span class="icon-heart"></span>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
const props = defineProps<{
|
|
9
|
-
msg: string;
|
|
10
|
-
}>();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<style lang="scss" scoped>
|
|
14
|
-
.icon-heart {
|
|
15
|
-
color: tomato;
|
|
16
|
-
}
|
|
17
|
-
</style>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from "vue";
|
|
3
|
-
const count = ref(0);
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<template>
|
|
7
|
-
<div class="flex align-content-center flex-wrap counter">
|
|
8
|
-
<label class="flex align-items-center justify-content-center"
|
|
9
|
-
>Counter:</label
|
|
10
|
-
>
|
|
11
|
-
<button
|
|
12
|
-
icon="pi pi-plus"
|
|
13
|
-
class="p-button-sm flex align-items-center justify-content-center"
|
|
14
|
-
@click="count++"
|
|
15
|
-
></button>
|
|
16
|
-
<span class="flex align-items-center justify-content-center count">{{
|
|
17
|
-
count
|
|
18
|
-
}}</span>
|
|
19
|
-
<button
|
|
20
|
-
icon="pi pi-minus"
|
|
21
|
-
class="p-button-sm flex align-items-center justify-content-center"
|
|
22
|
-
@click="count--"
|
|
23
|
-
></button>
|
|
24
|
-
</div>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<style lang="scss" scoped>
|
|
28
|
-
.counter {
|
|
29
|
-
label {
|
|
30
|
-
padding-right: 10px;
|
|
31
|
-
font-weight: bold;
|
|
32
|
-
}
|
|
33
|
-
.count {
|
|
34
|
-
padding: 0 10px;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
</style>
|