lau-ecom-design-system 1.0.19 → 1.0.21
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 +49 -0
- package/dist/316236bc7a52233c.png +0 -0
- package/dist/lau-ecom-design-system.esm.css +8 -1
- package/dist/lau-ecom-design-system.esm.js +1657 -682
- package/dist/lau-ecom-design-system.min.css +8 -1
- package/dist/lau-ecom-design-system.min.js +1 -1
- package/dist/lau-ecom-design-system.ssr.css +8 -1
- package/dist/lau-ecom-design-system.ssr.js +1406 -470
- package/dist/style.css +290 -69
- package/package.json +81 -80
- package/src/components/LauEcomBannerCookies/LauEcomBannerCookies.vue +178 -168
- package/src/components/LauEcomBannerCookies/LauEcomBannerCookiesConfig.vue +160 -159
- package/src/components/LauEcomBannerCookies/LauEcomBannerCookiesConfigAccordion.vue +80 -76
- package/src/components/LauEcomButton/LauEcomButton.vue +137 -137
- package/src/components/LauEcomCheckbox/LauEcomCheckbox.vue +143 -143
- package/src/components/LauEcomDisclamer/LauEcomDisclamer.vue +79 -79
- package/src/components/LauEcomDropdown/LauEcomDropdown.vue +208 -203
- package/src/components/LauEcomFooter/LauEcomFooter.vue +24 -73
- package/src/components/LauEcomFooter/LauEcomSubFooter.vue +5 -31
- package/src/components/LauEcomFooter/LauEcomSubFooterCategory.vue +9 -48
- package/src/components/LauEcomIcon/LauEcomCoreIconBook.vue +26 -26
- package/src/components/LauEcomIcon/LauEcomCoreIconFileCode.vue +28 -28
- package/src/components/LauEcomIcon/LauEcomUpcIconArrowDown.vue +0 -7
- package/src/components/LauEcomIcon/LauEcomUpcIconCertificate.vue +28 -28
- package/src/components/LauEcomIcon/LauEcomUpcIconCheck.vue +26 -26
- package/src/components/LauEcomIcon/LauEcomUpcIconCheckCircle.vue +28 -28
- package/src/components/LauEcomIcon/LauEcomUpcIconCreditCard.vue +28 -28
- package/src/components/LauEcomIcon/LauEcomUpcIconExclamationCircle.vue +28 -28
- package/src/components/LauEcomIcon/LauEcomUpcIconExclamationTriangle.vue +28 -28
- package/src/components/LauEcomIcon/LauEcomUpcIconInfoCircle.vue +26 -26
- package/src/components/LauEcomIcon/LauEcomUpcIconNavArrow.vue +26 -26
- package/src/components/LauEcomIcon/LauEcomUpcIconNavBack.vue +25 -0
- package/src/components/LauEcomIcon/LauEcomUpcIconNavCheckmark.vue +26 -26
- package/src/components/LauEcomInput/LauEcomInput.vue +207 -207
- package/src/components/LauEcomInput2/LauEcomInput2.vue +207 -0
- package/src/components/LauEcomInputSearch/LauEcomInputSearch.vue +244 -0
- package/src/components/LauEcomLoaderPage/LauEcomLoaderPage.vue +16 -16
- package/src/components/LauEcomPaginator/LauEcomPaginator.vue +57 -0
- package/src/components/LauEcomPaginator/LauEcomPaginatorButton.vue +68 -0
- package/src/components/LauEcomRadioButton/LauEcomRadioButton.vue +103 -103
- package/src/components/LauEcomRtb/LauEcomRtb.vue +71 -71
- package/src/components/LauEcomStepbar/LauEcomStepbar.vue +43 -43
- package/src/components/LauEcomStepbar/LauEcomStepbarItem.vue +128 -128
- package/src/components/LauEcomSwitch/LauEcomSwitch.vue +110 -108
- package/src/components/LauEcomTab/LauEcomTab.vue +82 -82
- package/src/components/LauEcomTag/LauEcomTag.vue +56 -0
- package/src/components/LauEcomTextButton/LauEcomTextButton.vue +71 -71
- package/src/components/LauEcomTyPage/LauEcomSummary.vue +14 -0
- package/src/components/LauEcomTyPage/LauEcomSummaryItem.vue +22 -0
- package/src/components/LauEcomTyPage/LauEcomTyPage.vue +149 -0
@@ -1,137 +1,137 @@
|
|
1
|
-
<script lang="ts" setup>
|
2
|
-
import { computed } from "vue";
|
3
|
-
import { LauEcomUpcIconNavArrow } from "../LauEcomIcon";
|
4
|
-
import { LauEcomButtonType } from "./types";
|
5
|
-
import { LauEcomSize } from "../../enums";
|
6
|
-
|
7
|
-
const props = withDefaults(
|
8
|
-
defineProps<{
|
9
|
-
type?: LauEcomButtonType;
|
10
|
-
size?: LauEcomSize;
|
11
|
-
isDisabled?: boolean;
|
12
|
-
hasArrow?: boolean;
|
13
|
-
}>(),
|
14
|
-
{
|
15
|
-
text: "Button Text",
|
16
|
-
type: LauEcomButtonType.Primary,
|
17
|
-
size: LauEcomSize.lg,
|
18
|
-
isDisabled: false,
|
19
|
-
hasArrow: false,
|
20
|
-
},
|
21
|
-
);
|
22
|
-
|
23
|
-
const emit = defineEmits(["onClick"]);
|
24
|
-
|
25
|
-
const lauEcomButtonClasses = computed(() => {
|
26
|
-
return {
|
27
|
-
"lau-ecom-button lau-ecom-button--upc upc-font-button-16px": true,
|
28
|
-
"lau-ecom-button--secondary": props.type === LauEcomButtonType.Secondary,
|
29
|
-
"lau-ecom-button--secondary-upc":
|
30
|
-
props.type === LauEcomButtonType.Secondary,
|
31
|
-
"lau-ecom-button--secondary-upc-disabled":
|
32
|
-
props.type === LauEcomButtonType.Secondary && props.isDisabled,
|
33
|
-
"lau-ecom-button--large": props.size === LauEcomSize.lg,
|
34
|
-
"lau-ecom-button--medium": props.size === LauEcomSize.md,
|
35
|
-
"lau-ecom-button--disabled":
|
36
|
-
props.type === LauEcomButtonType.Primary && props.isDisabled,
|
37
|
-
};
|
38
|
-
});
|
39
|
-
|
40
|
-
const iconClasses = computed(() => {
|
41
|
-
return [
|
42
|
-
`lau-ecom-icon-button${props.type === LauEcomButtonType.Secondary ? "-secondary" : ""}`,
|
43
|
-
];
|
44
|
-
});
|
45
|
-
|
46
|
-
const handleClick = () => {
|
47
|
-
emit("onClick");
|
48
|
-
};
|
49
|
-
</script>
|
50
|
-
|
51
|
-
<template>
|
52
|
-
<button
|
53
|
-
:class="lauEcomButtonClasses"
|
54
|
-
:disabled="isDisabled"
|
55
|
-
@click="handleClick"
|
56
|
-
>
|
57
|
-
<LauEcomUpcIconNavArrow v-if="hasArrow" :class="iconClasses" />
|
58
|
-
<slot></slot>
|
59
|
-
</button>
|
60
|
-
</template>
|
61
|
-
|
62
|
-
<style scoped>
|
63
|
-
.lau-ecom-button {
|
64
|
-
@apply dsEcom-text-neutral-10
|
65
|
-
dsEcom-flex
|
66
|
-
dsEcom-items-center
|
67
|
-
dsEcom-justify-center
|
68
|
-
dsEcom-gap-2
|
69
|
-
dsEcom-rounded-core-border-radius-32px
|
70
|
-
dsEcom-border-[1px]
|
71
|
-
dsEcom-text-center
|
72
|
-
dsEcom-py-[14px]
|
73
|
-
dsEcom-px-[16px];
|
74
|
-
}
|
75
|
-
|
76
|
-
.lau-ecom-button--upc {
|
77
|
-
@apply dsEcom-bg-primary-60
|
78
|
-
dsEcom-border-primary-60
|
79
|
-
hover:dsEcom-bg-primary-70
|
80
|
-
hover:dsEcom-border-primary-70
|
81
|
-
active:dsEcom-bg-primary-80
|
82
|
-
active:dsEcom-border-primary-80;
|
83
|
-
}
|
84
|
-
|
85
|
-
.lau-ecom-button--large {
|
86
|
-
@apply dsEcom-w-auto
|
87
|
-
dsEcom-h-[48px];
|
88
|
-
}
|
89
|
-
|
90
|
-
.lau-ecom-button--medium {
|
91
|
-
@apply dsEcom-w-auto
|
92
|
-
dsEcom-h-[44px];
|
93
|
-
}
|
94
|
-
|
95
|
-
.lau-ecom-button--disabled {
|
96
|
-
@apply dsEcom-border-neutral-70
|
97
|
-
dsEcom-bg-neutral-70
|
98
|
-
hover:dsEcom-bg-neutral-70
|
99
|
-
hover:dsEcom-border-neutral-70
|
100
|
-
active:dsEcom-bg-neutral-70
|
101
|
-
active:dsEcom-border-neutral-70;
|
102
|
-
}
|
103
|
-
|
104
|
-
.lau-ecom-button--secondary {
|
105
|
-
@apply dsEcom-bg-neutral-10
|
106
|
-
hover:dsEcom-bg-neutral-10
|
107
|
-
active:dsEcom-bg-neutral-10;
|
108
|
-
}
|
109
|
-
|
110
|
-
.lau-ecom-button--secondary-upc {
|
111
|
-
@apply dsEcom-border-primary-60
|
112
|
-
dsEcom-text-primary-60
|
113
|
-
hover:dsEcom-text-primary-70
|
114
|
-
hover:dsEcom-border-primary-70
|
115
|
-
active:dsEcom-text-primary-80
|
116
|
-
active:dsEcom-border-primary-80;
|
117
|
-
}
|
118
|
-
|
119
|
-
.lau-ecom-button--secondary-upc-disabled {
|
120
|
-
@apply dsEcom-border-neutral-70
|
121
|
-
dsEcom-text-neutral-70
|
122
|
-
hover:dsEcom-border-neutral-70
|
123
|
-
hover:dsEcom-text-neutral-70
|
124
|
-
active:dsEcom-border-neutral-70
|
125
|
-
active:dsEcom-text-neutral-70;
|
126
|
-
}
|
127
|
-
|
128
|
-
.lau-ecom-icon-button {
|
129
|
-
@apply dsEcom-fill-neutral-10;
|
130
|
-
}
|
131
|
-
|
132
|
-
.lau-ecom-icon-button-secondary {
|
133
|
-
@apply dsEcom-fill-primary-60
|
134
|
-
hover:dsEcom-fill-primary-70
|
135
|
-
active:dsEcom-fill-primary-80;
|
136
|
-
}
|
137
|
-
</style>
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { computed } from "vue";
|
3
|
+
import { LauEcomUpcIconNavArrow } from "../LauEcomIcon";
|
4
|
+
import { LauEcomButtonType } from "./types";
|
5
|
+
import { LauEcomSize } from "../../enums";
|
6
|
+
|
7
|
+
const props = withDefaults(
|
8
|
+
defineProps<{
|
9
|
+
type?: LauEcomButtonType;
|
10
|
+
size?: LauEcomSize;
|
11
|
+
isDisabled?: boolean;
|
12
|
+
hasArrow?: boolean;
|
13
|
+
}>(),
|
14
|
+
{
|
15
|
+
text: "Button Text",
|
16
|
+
type: LauEcomButtonType.Primary,
|
17
|
+
size: LauEcomSize.lg,
|
18
|
+
isDisabled: false,
|
19
|
+
hasArrow: false,
|
20
|
+
},
|
21
|
+
);
|
22
|
+
|
23
|
+
const emit = defineEmits(["onClick"]);
|
24
|
+
|
25
|
+
const lauEcomButtonClasses = computed(() => {
|
26
|
+
return {
|
27
|
+
"lau-ecom-button lau-ecom-button--upc upc-font-button-16px": true,
|
28
|
+
"lau-ecom-button--secondary": props.type === LauEcomButtonType.Secondary,
|
29
|
+
"lau-ecom-button--secondary-upc":
|
30
|
+
props.type === LauEcomButtonType.Secondary,
|
31
|
+
"lau-ecom-button--secondary-upc-disabled":
|
32
|
+
props.type === LauEcomButtonType.Secondary && props.isDisabled,
|
33
|
+
"lau-ecom-button--large": props.size === LauEcomSize.lg,
|
34
|
+
"lau-ecom-button--medium": props.size === LauEcomSize.md,
|
35
|
+
"lau-ecom-button--disabled":
|
36
|
+
props.type === LauEcomButtonType.Primary && props.isDisabled,
|
37
|
+
};
|
38
|
+
});
|
39
|
+
|
40
|
+
const iconClasses = computed(() => {
|
41
|
+
return [
|
42
|
+
`lau-ecom-icon-button${props.type === LauEcomButtonType.Secondary ? "-secondary" : ""}`,
|
43
|
+
];
|
44
|
+
});
|
45
|
+
|
46
|
+
const handleClick = () => {
|
47
|
+
emit("onClick");
|
48
|
+
};
|
49
|
+
</script>
|
50
|
+
|
51
|
+
<template>
|
52
|
+
<button
|
53
|
+
:class="lauEcomButtonClasses"
|
54
|
+
:disabled="isDisabled"
|
55
|
+
@click="handleClick"
|
56
|
+
>
|
57
|
+
<LauEcomUpcIconNavArrow v-if="hasArrow" :class="iconClasses" />
|
58
|
+
<slot></slot>
|
59
|
+
</button>
|
60
|
+
</template>
|
61
|
+
|
62
|
+
<style scoped>
|
63
|
+
.lau-ecom-button {
|
64
|
+
@apply dsEcom-text-neutral-10
|
65
|
+
dsEcom-flex
|
66
|
+
dsEcom-items-center
|
67
|
+
dsEcom-justify-center
|
68
|
+
dsEcom-gap-2
|
69
|
+
dsEcom-rounded-core-border-radius-32px
|
70
|
+
dsEcom-border-[1px]
|
71
|
+
dsEcom-text-center
|
72
|
+
dsEcom-py-[14px]
|
73
|
+
dsEcom-px-[16px];
|
74
|
+
}
|
75
|
+
|
76
|
+
.lau-ecom-button--upc {
|
77
|
+
@apply dsEcom-bg-primary-60
|
78
|
+
dsEcom-border-primary-60
|
79
|
+
hover:dsEcom-bg-primary-70
|
80
|
+
hover:dsEcom-border-primary-70
|
81
|
+
active:dsEcom-bg-primary-80
|
82
|
+
active:dsEcom-border-primary-80;
|
83
|
+
}
|
84
|
+
|
85
|
+
.lau-ecom-button--large {
|
86
|
+
@apply dsEcom-w-auto
|
87
|
+
dsEcom-h-[48px];
|
88
|
+
}
|
89
|
+
|
90
|
+
.lau-ecom-button--medium {
|
91
|
+
@apply dsEcom-w-auto
|
92
|
+
dsEcom-h-[44px];
|
93
|
+
}
|
94
|
+
|
95
|
+
.lau-ecom-button--disabled {
|
96
|
+
@apply dsEcom-border-neutral-70
|
97
|
+
dsEcom-bg-neutral-70
|
98
|
+
hover:dsEcom-bg-neutral-70
|
99
|
+
hover:dsEcom-border-neutral-70
|
100
|
+
active:dsEcom-bg-neutral-70
|
101
|
+
active:dsEcom-border-neutral-70;
|
102
|
+
}
|
103
|
+
|
104
|
+
.lau-ecom-button--secondary {
|
105
|
+
@apply dsEcom-bg-neutral-10
|
106
|
+
hover:dsEcom-bg-neutral-10
|
107
|
+
active:dsEcom-bg-neutral-10;
|
108
|
+
}
|
109
|
+
|
110
|
+
.lau-ecom-button--secondary-upc {
|
111
|
+
@apply dsEcom-border-primary-60
|
112
|
+
dsEcom-text-primary-60
|
113
|
+
hover:dsEcom-text-primary-70
|
114
|
+
hover:dsEcom-border-primary-70
|
115
|
+
active:dsEcom-text-primary-80
|
116
|
+
active:dsEcom-border-primary-80;
|
117
|
+
}
|
118
|
+
|
119
|
+
.lau-ecom-button--secondary-upc-disabled {
|
120
|
+
@apply dsEcom-border-neutral-70
|
121
|
+
dsEcom-text-neutral-70
|
122
|
+
hover:dsEcom-border-neutral-70
|
123
|
+
hover:dsEcom-text-neutral-70
|
124
|
+
active:dsEcom-border-neutral-70
|
125
|
+
active:dsEcom-text-neutral-70;
|
126
|
+
}
|
127
|
+
|
128
|
+
.lau-ecom-icon-button {
|
129
|
+
@apply dsEcom-fill-neutral-10;
|
130
|
+
}
|
131
|
+
|
132
|
+
.lau-ecom-icon-button-secondary {
|
133
|
+
@apply dsEcom-fill-primary-60
|
134
|
+
hover:dsEcom-fill-primary-70
|
135
|
+
active:dsEcom-fill-primary-80;
|
136
|
+
}
|
137
|
+
</style>
|
@@ -1,143 +1,143 @@
|
|
1
|
-
<script lang="ts" setup>
|
2
|
-
import { computed, ref } from "vue";
|
3
|
-
import { LauEcomUpcIconNavCheckmark } from "../LauEcomIcon";
|
4
|
-
|
5
|
-
interface Props {
|
6
|
-
id?: string;
|
7
|
-
label?: string;
|
8
|
-
value?: string | number | boolean;
|
9
|
-
modelValue?: string | number | boolean | [];
|
10
|
-
isRequired?: boolean;
|
11
|
-
isDisabled?: boolean;
|
12
|
-
}
|
13
|
-
|
14
|
-
const props = withDefaults(defineProps<Props>(), {
|
15
|
-
id: "",
|
16
|
-
label: "text label",
|
17
|
-
value: "",
|
18
|
-
modelValue: () => false,
|
19
|
-
isRequired: false,
|
20
|
-
isDisabled: false,
|
21
|
-
});
|
22
|
-
|
23
|
-
const emit = defineEmits<{
|
24
|
-
"update:modelValue": [value: string | number | boolean];
|
25
|
-
}>();
|
26
|
-
|
27
|
-
const isChecked = ref(
|
28
|
-
typeof props.modelValue === "boolean"
|
29
|
-
? props.modelValue
|
30
|
-
: //@ts-ignore
|
31
|
-
props.modelValue.includes(props.value),
|
32
|
-
);
|
33
|
-
|
34
|
-
const handleChange = () => {
|
35
|
-
if (typeof props.modelValue !== "boolean") {
|
36
|
-
isChecked.value = !isChecked.value;
|
37
|
-
//@ts-ignore
|
38
|
-
const newValue = isChecked.value
|
39
|
-
? [...props.modelValue, props.value]
|
40
|
-
: props.modelValue.filter((val) => val !== props.value);
|
41
|
-
emit("update:modelValue", newValue);
|
42
|
-
} else {
|
43
|
-
isChecked.value = !isChecked.value;
|
44
|
-
emit("update:modelValue", isChecked.value);
|
45
|
-
}
|
46
|
-
};
|
47
|
-
|
48
|
-
const lauEcomCheckboxClasses = computed(() => {
|
49
|
-
return {
|
50
|
-
"lau-ecom-checkbox dsEcom-peer lau-ecom-checkbox--upc": true,
|
51
|
-
"lau-ecom-checkbox--disabled": props.isDisabled,
|
52
|
-
"lau-ecom-checkbox--checked": !props.isDisabled,
|
53
|
-
"!dsEcom-border-upc-primary-60": props.isRequired && !props.isDisabled,
|
54
|
-
};
|
55
|
-
});
|
56
|
-
|
57
|
-
const textLabelClass = computed(() => {
|
58
|
-
if (props.isDisabled) return "!dsEcom-text-neutral-70";
|
59
|
-
return "";
|
60
|
-
});
|
61
|
-
</script>
|
62
|
-
|
63
|
-
<template>
|
64
|
-
<div class="dsEcom-flex">
|
65
|
-
<label class="lau-ecom-label group upc-font-body-reg-05-14px">
|
66
|
-
<input
|
67
|
-
:class="lauEcomCheckboxClasses"
|
68
|
-
type="checkbox"
|
69
|
-
:required="isRequired"
|
70
|
-
:disabled="isDisabled"
|
71
|
-
:checked="isChecked"
|
72
|
-
@change="handleChange"
|
73
|
-
/>
|
74
|
-
<LauEcomUpcIconNavCheckmark
|
75
|
-
class="icon-checkmark"
|
76
|
-
width="16"
|
77
|
-
height="16"
|
78
|
-
/>
|
79
|
-
<span
|
80
|
-
v-if="!$slots.default"
|
81
|
-
class="upc-font-link-03-14px"
|
82
|
-
:class="textLabelClass"
|
83
|
-
>{{ label }}</span
|
84
|
-
>
|
85
|
-
</label>
|
86
|
-
<div :class="textLabelClass">
|
87
|
-
<slot :text="`upc-font-link-03-14px ${textLabelClass}`" />
|
88
|
-
</div>
|
89
|
-
</div>
|
90
|
-
</template>
|
91
|
-
|
92
|
-
<style scoped>
|
93
|
-
.lau-ecom-checkbox {
|
94
|
-
@apply dsEcom-w-5
|
95
|
-
dsEcom-h-5
|
96
|
-
dsEcom-mr-2
|
97
|
-
dsEcom-rounded
|
98
|
-
dsEcom-appearance-none
|
99
|
-
dsEcom-border
|
100
|
-
dsEcom-border-neutral-90
|
101
|
-
dsEcom-transition
|
102
|
-
dsEcom-duration-200
|
103
|
-
after:dsEcom-absolute
|
104
|
-
after:dsEcom-left-0
|
105
|
-
after:dsEcom-top-0
|
106
|
-
after:dsEcom-h-full
|
107
|
-
after:dsEcom-w-full
|
108
|
-
focus:dsEcom-outline-none;
|
109
|
-
}
|
110
|
-
|
111
|
-
.lau-ecom-checkbox--upc {
|
112
|
-
@apply hover:dsEcom-border-primary-80
|
113
|
-
checked:dsEcom-bg-primary-60
|
114
|
-
checked:!dsEcom-border-primary-60;
|
115
|
-
}
|
116
|
-
|
117
|
-
.lau-ecom-checkbox--checked {
|
118
|
-
@apply dsEcom-cursor-pointer
|
119
|
-
checked:!dsEcom-border-primary-60
|
120
|
-
group-hover:dsEcom-border-primary-60;
|
121
|
-
}
|
122
|
-
|
123
|
-
.lau-ecom-checkbox--disabled {
|
124
|
-
@apply !dsEcom-border-neutral-60
|
125
|
-
checked:!dsEcom-border-neutral-60
|
126
|
-
checked:!dsEcom-bg-neutral-60;
|
127
|
-
}
|
128
|
-
|
129
|
-
.lau-ecom-label {
|
130
|
-
@apply dsEcom-flex
|
131
|
-
dsEcom-items-center
|
132
|
-
dsEcom-text-neutral-90
|
133
|
-
dsEcom-relative;
|
134
|
-
}
|
135
|
-
|
136
|
-
.icon-checkmark {
|
137
|
-
@apply dsEcom-absolute
|
138
|
-
dsEcom-left-[2px]
|
139
|
-
dsEcom-hidden
|
140
|
-
dsEcom-fill-white
|
141
|
-
peer-checked:!dsEcom-block;
|
142
|
-
}
|
143
|
-
</style>
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { computed, ref } from "vue";
|
3
|
+
import { LauEcomUpcIconNavCheckmark } from "../LauEcomIcon";
|
4
|
+
|
5
|
+
interface Props {
|
6
|
+
id?: string;
|
7
|
+
label?: string;
|
8
|
+
value?: string | number | boolean;
|
9
|
+
modelValue?: string | number | boolean | [];
|
10
|
+
isRequired?: boolean;
|
11
|
+
isDisabled?: boolean;
|
12
|
+
}
|
13
|
+
|
14
|
+
const props = withDefaults(defineProps<Props>(), {
|
15
|
+
id: "",
|
16
|
+
label: "text label",
|
17
|
+
value: "",
|
18
|
+
modelValue: () => false,
|
19
|
+
isRequired: false,
|
20
|
+
isDisabled: false,
|
21
|
+
});
|
22
|
+
|
23
|
+
const emit = defineEmits<{
|
24
|
+
"update:modelValue": [value: string | number | boolean];
|
25
|
+
}>();
|
26
|
+
|
27
|
+
const isChecked = ref(
|
28
|
+
typeof props.modelValue === "boolean"
|
29
|
+
? props.modelValue
|
30
|
+
: //@ts-ignore
|
31
|
+
props.modelValue.includes(props.value),
|
32
|
+
);
|
33
|
+
|
34
|
+
const handleChange = () => {
|
35
|
+
if (typeof props.modelValue !== "boolean") {
|
36
|
+
isChecked.value = !isChecked.value;
|
37
|
+
//@ts-ignore
|
38
|
+
const newValue = isChecked.value
|
39
|
+
? [...props.modelValue, props.value]
|
40
|
+
: props.modelValue.filter((val) => val !== props.value);
|
41
|
+
emit("update:modelValue", newValue);
|
42
|
+
} else {
|
43
|
+
isChecked.value = !isChecked.value;
|
44
|
+
emit("update:modelValue", isChecked.value);
|
45
|
+
}
|
46
|
+
};
|
47
|
+
|
48
|
+
const lauEcomCheckboxClasses = computed(() => {
|
49
|
+
return {
|
50
|
+
"lau-ecom-checkbox dsEcom-peer lau-ecom-checkbox--upc": true,
|
51
|
+
"lau-ecom-checkbox--disabled": props.isDisabled,
|
52
|
+
"lau-ecom-checkbox--checked": !props.isDisabled,
|
53
|
+
"!dsEcom-border-upc-primary-60": props.isRequired && !props.isDisabled,
|
54
|
+
};
|
55
|
+
});
|
56
|
+
|
57
|
+
const textLabelClass = computed(() => {
|
58
|
+
if (props.isDisabled) return "!dsEcom-text-neutral-70";
|
59
|
+
return "";
|
60
|
+
});
|
61
|
+
</script>
|
62
|
+
|
63
|
+
<template>
|
64
|
+
<div class="dsEcom-flex">
|
65
|
+
<label class="lau-ecom-label group upc-font-body-reg-05-14px">
|
66
|
+
<input
|
67
|
+
:class="lauEcomCheckboxClasses"
|
68
|
+
type="checkbox"
|
69
|
+
:required="isRequired"
|
70
|
+
:disabled="isDisabled"
|
71
|
+
:checked="isChecked"
|
72
|
+
@change="handleChange"
|
73
|
+
/>
|
74
|
+
<LauEcomUpcIconNavCheckmark
|
75
|
+
class="icon-checkmark"
|
76
|
+
width="16"
|
77
|
+
height="16"
|
78
|
+
/>
|
79
|
+
<span
|
80
|
+
v-if="!$slots.default"
|
81
|
+
class="upc-font-link-03-14px"
|
82
|
+
:class="textLabelClass"
|
83
|
+
>{{ label }}</span
|
84
|
+
>
|
85
|
+
</label>
|
86
|
+
<div :class="textLabelClass">
|
87
|
+
<slot :text="`upc-font-link-03-14px ${textLabelClass}`" />
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
</template>
|
91
|
+
|
92
|
+
<style scoped>
|
93
|
+
.lau-ecom-checkbox {
|
94
|
+
@apply dsEcom-w-5
|
95
|
+
dsEcom-h-5
|
96
|
+
dsEcom-mr-2
|
97
|
+
dsEcom-rounded
|
98
|
+
dsEcom-appearance-none
|
99
|
+
dsEcom-border
|
100
|
+
dsEcom-border-neutral-90
|
101
|
+
dsEcom-transition
|
102
|
+
dsEcom-duration-200
|
103
|
+
after:dsEcom-absolute
|
104
|
+
after:dsEcom-left-0
|
105
|
+
after:dsEcom-top-0
|
106
|
+
after:dsEcom-h-full
|
107
|
+
after:dsEcom-w-full
|
108
|
+
focus:dsEcom-outline-none;
|
109
|
+
}
|
110
|
+
|
111
|
+
.lau-ecom-checkbox--upc {
|
112
|
+
@apply hover:dsEcom-border-primary-80
|
113
|
+
checked:dsEcom-bg-primary-60
|
114
|
+
checked:!dsEcom-border-primary-60;
|
115
|
+
}
|
116
|
+
|
117
|
+
.lau-ecom-checkbox--checked {
|
118
|
+
@apply dsEcom-cursor-pointer
|
119
|
+
checked:!dsEcom-border-primary-60
|
120
|
+
group-hover:dsEcom-border-primary-60;
|
121
|
+
}
|
122
|
+
|
123
|
+
.lau-ecom-checkbox--disabled {
|
124
|
+
@apply !dsEcom-border-neutral-60
|
125
|
+
checked:!dsEcom-border-neutral-60
|
126
|
+
checked:!dsEcom-bg-neutral-60;
|
127
|
+
}
|
128
|
+
|
129
|
+
.lau-ecom-label {
|
130
|
+
@apply dsEcom-flex
|
131
|
+
dsEcom-items-center
|
132
|
+
dsEcom-text-neutral-90
|
133
|
+
dsEcom-relative;
|
134
|
+
}
|
135
|
+
|
136
|
+
.icon-checkmark {
|
137
|
+
@apply dsEcom-absolute
|
138
|
+
dsEcom-left-[2px]
|
139
|
+
dsEcom-hidden
|
140
|
+
dsEcom-fill-white
|
141
|
+
peer-checked:!dsEcom-block;
|
142
|
+
}
|
143
|
+
</style>
|