@baklavue/ui 1.0.0-preview.4 → 1.0.1
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/accordion/Accordion.vue.d.ts +51 -0
- package/dist/accordion/Accordion.vue.d.ts.map +1 -0
- package/dist/accordion/accordion.types.d.ts +97 -0
- package/dist/accordion/accordion.types.d.ts.map +1 -0
- package/dist/accordion/index.d.ts +3 -0
- package/dist/accordion/index.d.ts.map +1 -0
- package/dist/alert/Alert.vue.d.ts +49 -0
- package/dist/alert/Alert.vue.d.ts.map +1 -0
- package/dist/alert/alert.types.d.ts +52 -0
- package/dist/alert/alert.types.d.ts.map +1 -0
- package/dist/alert/index.d.ts +3 -0
- package/dist/alert/index.d.ts.map +1 -0
- package/dist/badge/Badge.vue.d.ts +22 -0
- package/dist/badge/Badge.vue.d.ts.map +1 -0
- package/dist/badge/badge.types.d.ts +7 -0
- package/dist/badge/badge.types.d.ts.map +1 -0
- package/dist/badge/index.d.ts +3 -0
- package/dist/badge/index.d.ts.map +1 -0
- package/dist/banner/Banner.vue.d.ts +36 -0
- package/dist/banner/Banner.vue.d.ts.map +1 -0
- package/dist/banner/banner.types.d.ts +70 -0
- package/dist/banner/banner.types.d.ts.map +1 -0
- package/dist/banner/index.d.ts +3 -0
- package/dist/banner/index.d.ts.map +1 -0
- package/dist/button/Button.vue.d.ts +36 -0
- package/dist/button/Button.vue.d.ts.map +1 -0
- package/dist/button/button.types.d.ts +24 -0
- package/dist/button/button.types.d.ts.map +1 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/index.d.ts.map +1 -0
- package/dist/checkbox/Checkbox.vue.d.ts +39 -0
- package/dist/checkbox/Checkbox.vue.d.ts.map +1 -0
- package/dist/checkbox/checkbox.types.d.ts +95 -0
- package/dist/checkbox/checkbox.types.d.ts.map +1 -0
- package/dist/checkbox/index.d.ts +3 -0
- package/dist/checkbox/index.d.ts.map +1 -0
- package/dist/chip/Chip.vue.d.ts +29 -0
- package/dist/chip/Chip.vue.d.ts.map +1 -0
- package/dist/chip/chip.types.d.ts +59 -0
- package/dist/chip/chip.types.d.ts.map +1 -0
- package/dist/chip/index.d.ts +3 -0
- package/dist/chip/index.d.ts.map +1 -0
- package/dist/datepicker/Datepicker.vue.d.ts +41 -0
- package/dist/datepicker/Datepicker.vue.d.ts.map +1 -0
- package/dist/datepicker/datepicker.types.d.ts +38 -0
- package/dist/datepicker/datepicker.types.d.ts.map +1 -0
- package/dist/datepicker/index.d.ts +3 -0
- package/dist/datepicker/index.d.ts.map +1 -0
- package/dist/dialog/Dialog.vue.d.ts +44 -0
- package/dist/dialog/Dialog.vue.d.ts.map +1 -0
- package/dist/dialog/dialog.types.d.ts +18 -0
- package/dist/dialog/dialog.types.d.ts.map +1 -0
- package/dist/dialog/index.d.ts +3 -0
- package/dist/dialog/index.d.ts.map +1 -0
- package/dist/drawer/Drawer.vue.d.ts +42 -0
- package/dist/drawer/Drawer.vue.d.ts.map +1 -0
- package/dist/drawer/drawer.types.d.ts +18 -0
- package/dist/drawer/drawer.types.d.ts.map +1 -0
- package/dist/drawer/index.d.ts +3 -0
- package/dist/drawer/index.d.ts.map +1 -0
- package/dist/dropdown/Dropdown.vue.d.ts +59 -0
- package/dist/dropdown/Dropdown.vue.d.ts.map +1 -0
- package/dist/dropdown/dropdown.types.d.ts +92 -0
- package/dist/dropdown/dropdown.types.d.ts.map +1 -0
- package/dist/dropdown/index.d.ts +3 -0
- package/dist/dropdown/index.d.ts.map +1 -0
- package/dist/file-upload/FileUpload.vue.d.ts +44 -0
- package/dist/file-upload/FileUpload.vue.d.ts.map +1 -0
- package/dist/file-upload/file-upload.types.d.ts +76 -0
- package/dist/file-upload/file-upload.types.d.ts.map +1 -0
- package/dist/file-upload/index.d.ts +3 -0
- package/dist/file-upload/index.d.ts.map +1 -0
- package/dist/icon/Icon.vue.d.ts +29 -0
- package/dist/icon/Icon.vue.d.ts.map +1 -0
- package/dist/icon/icon.types.d.ts +23 -0
- package/dist/icon/icon.types.d.ts.map +1 -0
- package/dist/icon/index.d.ts +3 -0
- package/dist/icon/index.d.ts.map +1 -0
- package/dist/image/Image.vue.d.ts +30 -0
- package/dist/image/Image.vue.d.ts.map +1 -0
- package/dist/image/image.types.d.ts +48 -0
- package/dist/image/image.types.d.ts.map +1 -0
- package/dist/image/index.d.ts +3 -0
- package/dist/image/index.d.ts.map +1 -0
- package/dist/index.css +474 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2404 -0
- package/dist/index.js.map +1 -0
- package/dist/input/Input.vue.d.ts +39 -0
- package/dist/input/Input.vue.d.ts.map +1 -0
- package/dist/input/index.d.ts +3 -0
- package/dist/input/index.d.ts.map +1 -0
- package/dist/input/input.types.d.ts +122 -0
- package/dist/input/input.types.d.ts.map +1 -0
- package/dist/link/Link.vue.d.ts +38 -0
- package/dist/link/Link.vue.d.ts.map +1 -0
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/link.types.d.ts +40 -0
- package/dist/link/link.types.d.ts.map +1 -0
- package/dist/notification/Notification.vue.d.ts +7 -0
- package/dist/notification/Notification.vue.d.ts.map +1 -0
- package/dist/notification/index.d.ts +3 -0
- package/dist/notification/index.d.ts.map +1 -0
- package/dist/notification/notification.types.d.ts +25 -0
- package/dist/notification/notification.types.d.ts.map +1 -0
- package/dist/pagination/Pagination.vue.d.ts +34 -0
- package/dist/pagination/Pagination.vue.d.ts.map +1 -0
- package/dist/pagination/index.d.ts +3 -0
- package/dist/pagination/index.d.ts.map +1 -0
- package/dist/pagination/pagination.types.d.ts +54 -0
- package/dist/pagination/pagination.types.d.ts.map +1 -0
- package/dist/radio/Radio.vue.d.ts +42 -0
- package/dist/radio/Radio.vue.d.ts.map +1 -0
- package/dist/radio/index.d.ts +3 -0
- package/dist/radio/index.d.ts.map +1 -0
- package/dist/radio/radio.types.d.ts +84 -0
- package/dist/radio/radio.types.d.ts.map +1 -0
- package/dist/scroll-to-top/ScrollToTop.vue.d.ts +14 -0
- package/dist/scroll-to-top/ScrollToTop.vue.d.ts.map +1 -0
- package/dist/scroll-to-top/index.d.ts +3 -0
- package/dist/scroll-to-top/index.d.ts.map +1 -0
- package/dist/scroll-to-top/scroll-to-top.types.d.ts +33 -0
- package/dist/scroll-to-top/scroll-to-top.types.d.ts.map +1 -0
- package/dist/select/Select.vue.d.ts +42 -0
- package/dist/select/Select.vue.d.ts.map +1 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/index.d.ts.map +1 -0
- package/dist/select/select.types.d.ts +52 -0
- package/dist/select/select.types.d.ts.map +1 -0
- package/dist/skeleton/Skeleton.vue.d.ts +9 -0
- package/dist/skeleton/Skeleton.vue.d.ts.map +1 -0
- package/dist/skeleton/index.d.ts +3 -0
- package/dist/skeleton/index.d.ts.map +1 -0
- package/dist/skeleton/skeleton.types.d.ts +30 -0
- package/dist/skeleton/skeleton.types.d.ts.map +1 -0
- package/dist/spinner/Spinner.vue.d.ts +8 -0
- package/dist/spinner/Spinner.vue.d.ts.map +1 -0
- package/dist/spinner/index.d.ts +3 -0
- package/dist/spinner/index.d.ts.map +1 -0
- package/dist/spinner/spinner.types.d.ts +12 -0
- package/dist/spinner/spinner.types.d.ts.map +1 -0
- package/dist/split-button/SplitButton.vue.d.ts +25 -0
- package/dist/split-button/SplitButton.vue.d.ts.map +1 -0
- package/dist/split-button/index.d.ts +3 -0
- package/dist/split-button/index.d.ts.map +1 -0
- package/dist/split-button/split-button.types.d.ts +19 -0
- package/dist/split-button/split-button.types.d.ts.map +1 -0
- package/dist/stepper/Stepper.vue.d.ts +30 -0
- package/dist/stepper/Stepper.vue.d.ts.map +1 -0
- package/dist/stepper/index.d.ts +3 -0
- package/dist/stepper/index.d.ts.map +1 -0
- package/dist/stepper/stepper.types.d.ts +29 -0
- package/dist/stepper/stepper.types.d.ts.map +1 -0
- package/dist/switch/Switch.vue.d.ts +32 -0
- package/dist/switch/Switch.vue.d.ts.map +1 -0
- package/dist/switch/index.d.ts +3 -0
- package/dist/switch/index.d.ts.map +1 -0
- package/dist/switch/switch.types.d.ts +14 -0
- package/dist/switch/switch.types.d.ts.map +1 -0
- package/dist/tab/Tab.vue.d.ts +31 -0
- package/dist/tab/Tab.vue.d.ts.map +1 -0
- package/dist/tab/index.d.ts +3 -0
- package/dist/tab/index.d.ts.map +1 -0
- package/dist/tab/tab.types.d.ts +17 -0
- package/dist/tab/tab.types.d.ts.map +1 -0
- package/dist/table/Table.vue.d.ts +181 -0
- package/dist/table/Table.vue.d.ts.map +1 -0
- package/dist/table/index.d.ts +3 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/table.types.d.ts +61 -0
- package/dist/table/table.types.d.ts.map +1 -0
- package/dist/tag/Tag.vue.d.ts +31 -0
- package/dist/tag/Tag.vue.d.ts.map +1 -0
- package/dist/tag/index.d.ts +3 -0
- package/dist/tag/index.d.ts.map +1 -0
- package/dist/tag/tag.types.d.ts +22 -0
- package/dist/tag/tag.types.d.ts.map +1 -0
- package/dist/textarea/Textarea.vue.d.ts +35 -0
- package/dist/textarea/Textarea.vue.d.ts.map +1 -0
- package/dist/textarea/index.d.ts +3 -0
- package/dist/textarea/index.d.ts.map +1 -0
- package/dist/textarea/textarea.types.d.ts +37 -0
- package/dist/textarea/textarea.types.d.ts.map +1 -0
- package/dist/tooltip/Tooltip.vue.d.ts +33 -0
- package/dist/tooltip/Tooltip.vue.d.ts.map +1 -0
- package/dist/tooltip/index.d.ts +3 -0
- package/dist/tooltip/index.d.ts.map +1 -0
- package/dist/tooltip/tooltip.types.d.ts +17 -0
- package/dist/tooltip/tooltip.types.d.ts.map +1 -0
- package/dist/utils/loadBaklavaResources.d.ts +2 -0
- package/dist/utils/loadBaklavaResources.d.ts.map +1 -0
- package/package.json +28 -4
- package/.releaserc.json +0 -14
- package/CHANGELOG.md +0 -56
- package/index.ts +0 -1
- package/src/accordion/Accordion.vue +0 -206
- package/src/accordion/accordion.types.ts +0 -109
- package/src/accordion/index.ts +0 -3
- package/src/alert/Alert.vue +0 -199
- package/src/alert/alert.types.ts +0 -58
- package/src/alert/index.ts +0 -2
- package/src/badge/Badge.vue +0 -20
- package/src/badge/badge.types.ts +0 -7
- package/src/badge/index.ts +0 -2
- package/src/button/Button.vue +0 -45
- package/src/button/button.types.ts +0 -30
- package/src/button/index.ts +0 -3
- package/src/checkbox/Checkbox.vue +0 -148
- package/src/checkbox/checkbox.types.ts +0 -108
- package/src/checkbox/index.ts +0 -2
- package/src/datepicker/Datepicker.vue +0 -172
- package/src/datepicker/datepicker.types.ts +0 -39
- package/src/datepicker/index.ts +0 -2
- package/src/dialog/Dialog.vue +0 -178
- package/src/dialog/dialog.types.ts +0 -17
- package/src/dialog/index.ts +0 -2
- package/src/drawer/Drawer.vue +0 -162
- package/src/drawer/drawer.types.ts +0 -17
- package/src/drawer/index.ts +0 -2
- package/src/dropdown/Dropdown.vue +0 -231
- package/src/dropdown/dropdown.types.ts +0 -110
- package/src/dropdown/index.ts +0 -2
- package/src/file-upload/FileUpload.vue +0 -440
- package/src/file-upload/file-upload.types.ts +0 -89
- package/src/file-upload/index.ts +0 -7
- package/src/icon/Icon.vue +0 -102
- package/src/icon/icon.types.ts +0 -25
- package/src/icon/index.ts +0 -2
- package/src/image/Image.vue +0 -144
- package/src/image/image.types.ts +0 -57
- package/src/image/index.ts +0 -3
- package/src/index.ts +0 -41
- package/src/input/Input.vue +0 -148
- package/src/input/index.ts +0 -3
- package/src/input/input.types.ts +0 -156
- package/src/link/Link.vue +0 -133
- package/src/link/index.ts +0 -2
- package/src/link/link.types.ts +0 -42
- package/src/notification/Notification.vue +0 -57
- package/src/notification/index.ts +0 -2
- package/src/notification/notification.types.ts +0 -25
- package/src/pagination/Pagination.vue +0 -137
- package/src/pagination/index.ts +0 -2
- package/src/pagination/pagination.types.ts +0 -61
- package/src/radio/Radio.vue +0 -205
- package/src/radio/index.ts +0 -2
- package/src/radio/radio.types.ts +0 -95
- package/src/scroll-to-top/ScrollToTop.vue +0 -130
- package/src/scroll-to-top/index.ts +0 -2
- package/src/scroll-to-top/scroll-to-top.types.ts +0 -42
- package/src/select/Select.vue +0 -147
- package/src/select/index.ts +0 -2
- package/src/select/select.types.ts +0 -53
- package/src/skeleton/Skeleton.vue +0 -115
- package/src/skeleton/index.ts +0 -2
- package/src/skeleton/skeleton.types.ts +0 -33
- package/src/spinner/Spinner.vue +0 -49
- package/src/spinner/index.ts +0 -2
- package/src/spinner/spinner.types.ts +0 -11
- package/src/split-button/SplitButton.vue +0 -73
- package/src/split-button/index.ts +0 -2
- package/src/split-button/split-button.types.ts +0 -19
- package/src/stepper/Stepper.vue +0 -100
- package/src/stepper/index.ts +0 -2
- package/src/stepper/stepper.types.ts +0 -29
- package/src/switch/Switch.vue +0 -80
- package/src/switch/index.ts +0 -2
- package/src/switch/switch.types.ts +0 -13
- package/src/tab/Tab.vue +0 -99
- package/src/tab/index.ts +0 -2
- package/src/tab/tab.types.ts +0 -17
- package/src/table/Table.vue +0 -264
- package/src/table/index.ts +0 -7
- package/src/table/table.types.ts +0 -62
- package/src/tag/Tag.vue +0 -83
- package/src/tag/index.ts +0 -2
- package/src/tag/tag.types.ts +0 -24
- package/src/textarea/Textarea.vue +0 -84
- package/src/textarea/index.ts +0 -2
- package/src/textarea/textarea.types.ts +0 -37
- package/src/tooltip/Tooltip.vue +0 -81
- package/src/tooltip/index.ts +0 -3
- package/src/tooltip/tooltip.types.ts +0 -29
- package/src/utils/loadBaklavaResources.ts +0 -24
- package/tsconfig.json +0 -28
package/src/image/Image.vue
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Image Component
|
|
4
|
-
*
|
|
5
|
-
* Performance-focused image wrapper with lazy loading,
|
|
6
|
-
* skeleton placeholder, and error handling.
|
|
7
|
-
*
|
|
8
|
-
* @component
|
|
9
|
-
* @example
|
|
10
|
-
* ```vue
|
|
11
|
-
* <template>
|
|
12
|
-
* <BvImage src="/photo.jpg" alt="Photo" width="200px" height="120px" />
|
|
13
|
-
* </template>
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
import { ref, computed, onMounted } from "vue";
|
|
17
|
-
import { loadBaklavaResources } from "../utils/loadBaklavaResources";
|
|
18
|
-
import BvSkeleton from "../skeleton/Skeleton.vue";
|
|
19
|
-
import type { ImageProps } from "./image.types";
|
|
20
|
-
|
|
21
|
-
const props = withDefaults(defineProps<ImageProps>(), {
|
|
22
|
-
loading: "lazy",
|
|
23
|
-
placeholder: "skeleton",
|
|
24
|
-
objectFit: "cover",
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const emit = defineEmits<{
|
|
28
|
-
load: [event: Event];
|
|
29
|
-
error: [event: Event];
|
|
30
|
-
}>();
|
|
31
|
-
|
|
32
|
-
const isLoading = ref(true);
|
|
33
|
-
const hasError = ref(false);
|
|
34
|
-
|
|
35
|
-
const showPlaceholder = computed(
|
|
36
|
-
() => isLoading.value && props.placeholder === "skeleton" && !hasError.value,
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
const showImage = computed(() => !hasError.value);
|
|
40
|
-
|
|
41
|
-
const wrapperStyle = computed(() => ({
|
|
42
|
-
width: props.width ?? "100%",
|
|
43
|
-
height: props.height ?? "auto",
|
|
44
|
-
aspectRatio: !props.height && props.width ? "16 / 9" : undefined,
|
|
45
|
-
}));
|
|
46
|
-
|
|
47
|
-
function onLoad(event: Event) {
|
|
48
|
-
isLoading.value = false;
|
|
49
|
-
emit("load", event);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function onError(event: Event) {
|
|
53
|
-
isLoading.value = false;
|
|
54
|
-
hasError.value = true;
|
|
55
|
-
emit("error", event);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
onMounted(() => {
|
|
59
|
-
loadBaklavaResources();
|
|
60
|
-
});
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<template>
|
|
64
|
-
<div class="image-wrapper" :style="wrapperStyle">
|
|
65
|
-
<!-- Placeholder (skeleton or custom slot) -->
|
|
66
|
-
<div v-if="showPlaceholder" class="image-placeholder">
|
|
67
|
-
<slot name="placeholder">
|
|
68
|
-
<BvSkeleton
|
|
69
|
-
class="image-skeleton"
|
|
70
|
-
width="100%"
|
|
71
|
-
height="100%"
|
|
72
|
-
variant="rectangle"
|
|
73
|
-
/>
|
|
74
|
-
</slot>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<!-- Loaded image -->
|
|
78
|
-
<img
|
|
79
|
-
v-show="showImage"
|
|
80
|
-
:src="src"
|
|
81
|
-
:alt="alt"
|
|
82
|
-
:loading="loading"
|
|
83
|
-
:srcset="srcset"
|
|
84
|
-
:sizes="sizes"
|
|
85
|
-
class="image-img"
|
|
86
|
-
:style="{ objectFit }"
|
|
87
|
-
@load="onLoad"
|
|
88
|
-
@error="onError"
|
|
89
|
-
/>
|
|
90
|
-
|
|
91
|
-
<!-- Error fallback -->
|
|
92
|
-
<div v-if="hasError" class="image-fallback">
|
|
93
|
-
<slot name="fallback">
|
|
94
|
-
<div class="image-fallback-default" role="img" :aria-label="alt">
|
|
95
|
-
Failed to load image
|
|
96
|
-
</div>
|
|
97
|
-
</slot>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
</template>
|
|
101
|
-
|
|
102
|
-
<style scoped>
|
|
103
|
-
.image-wrapper {
|
|
104
|
-
position: relative;
|
|
105
|
-
overflow: hidden;
|
|
106
|
-
display: block;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.image-placeholder {
|
|
110
|
-
position: absolute;
|
|
111
|
-
inset: 0;
|
|
112
|
-
display: flex;
|
|
113
|
-
align-items: center;
|
|
114
|
-
justify-content: center;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.image-skeleton {
|
|
118
|
-
width: 100% !important;
|
|
119
|
-
height: 100% !important;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.image-img {
|
|
123
|
-
display: block;
|
|
124
|
-
width: 100%;
|
|
125
|
-
height: 100%;
|
|
126
|
-
vertical-align: middle;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.image-fallback {
|
|
130
|
-
position: absolute;
|
|
131
|
-
inset: 0;
|
|
132
|
-
display: flex;
|
|
133
|
-
align-items: center;
|
|
134
|
-
justify-content: center;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.image-fallback-default {
|
|
138
|
-
background: var(--bl-color-neutral-light, #e5e7eb);
|
|
139
|
-
color: var(--bl-color-neutral-darker, #6b7280);
|
|
140
|
-
font-size: 0.875rem;
|
|
141
|
-
padding: 1rem;
|
|
142
|
-
text-align: center;
|
|
143
|
-
}
|
|
144
|
-
</style>
|
package/src/image/image.types.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/** Native image loading behavior */
|
|
2
|
-
export type ImageLoading = "lazy" | "eager";
|
|
3
|
-
|
|
4
|
-
/** Placeholder type while image loads */
|
|
5
|
-
export type ImagePlaceholder = "skeleton" | "none";
|
|
6
|
-
|
|
7
|
-
export interface ImageProps {
|
|
8
|
-
/**
|
|
9
|
-
* Image URL (required).
|
|
10
|
-
*/
|
|
11
|
-
src: string;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Accessible description (required).
|
|
15
|
-
*/
|
|
16
|
-
alt: string;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* CSS width (e.g. "200px", "100%").
|
|
20
|
-
* Recommended to prevent CLS.
|
|
21
|
-
*/
|
|
22
|
-
width?: string;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* CSS height (e.g. "120px", "auto").
|
|
26
|
-
* Recommended to prevent CLS.
|
|
27
|
-
*/
|
|
28
|
-
height?: string;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Native loading behavior.
|
|
32
|
-
* @default "lazy"
|
|
33
|
-
*/
|
|
34
|
-
loading?: ImageLoading;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Placeholder when lazy and not yet loaded.
|
|
38
|
-
* @default "skeleton"
|
|
39
|
-
*/
|
|
40
|
-
placeholder?: ImagePlaceholder;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* CSS object-fit.
|
|
44
|
-
* @default "cover"
|
|
45
|
-
*/
|
|
46
|
-
objectFit?: string;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Responsive image sources (srcset attribute).
|
|
50
|
-
*/
|
|
51
|
-
srcset?: string;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Sizes attribute for srcset.
|
|
55
|
-
*/
|
|
56
|
-
sizes?: string;
|
|
57
|
-
}
|
package/src/image/index.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component Exports
|
|
3
|
-
*
|
|
4
|
-
* IMPORTANT: All components MUST be exported with the "Bv-" prefix.
|
|
5
|
-
* Example: BvButton, BvInput, BvBadge, etc.
|
|
6
|
-
*
|
|
7
|
-
* This convention ensures consistency and prevents naming conflicts.
|
|
8
|
-
* Each component's index.ts file should export: export { default as Bv[ComponentName] } from "./[ComponentName].vue";
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from "./accordion";
|
|
12
|
-
export * from "./alert";
|
|
13
|
-
export * from "./badge";
|
|
14
|
-
export * from "./button";
|
|
15
|
-
export * from "./checkbox";
|
|
16
|
-
export * from "./datepicker";
|
|
17
|
-
export * from "./dialog";
|
|
18
|
-
export * from "./drawer";
|
|
19
|
-
export * from "./dropdown";
|
|
20
|
-
export * from "./file-upload";
|
|
21
|
-
export * from "./icon";
|
|
22
|
-
export * from "./image";
|
|
23
|
-
export * from "./input";
|
|
24
|
-
export * from "./link";
|
|
25
|
-
export * from "./notification";
|
|
26
|
-
export * from "./pagination";
|
|
27
|
-
export * from "./radio";
|
|
28
|
-
export * from "./scroll-to-top";
|
|
29
|
-
export * from "./select";
|
|
30
|
-
export * from "./skeleton";
|
|
31
|
-
export * from "./spinner";
|
|
32
|
-
export * from "./split-button";
|
|
33
|
-
export * from "./stepper";
|
|
34
|
-
export * from "./switch";
|
|
35
|
-
export * from "./tab";
|
|
36
|
-
export * from "./table";
|
|
37
|
-
export * from "./tag";
|
|
38
|
-
export * from "./textarea";
|
|
39
|
-
export * from "./tooltip";
|
|
40
|
-
|
|
41
|
-
export { loadBaklavaResources } from "./utils/loadBaklavaResources";
|
package/src/input/Input.vue
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Input Component
|
|
4
|
-
*
|
|
5
|
-
* A Vue UI kit component for Baklava's `bl-input` web component with full v-model support
|
|
6
|
-
* and TypeScript types. Supports text, email, password, number, date, time, and
|
|
7
|
-
* other input types with validation, help text, loading state, and icons.
|
|
8
|
-
*
|
|
9
|
-
* @component
|
|
10
|
-
* @example
|
|
11
|
-
* ```vue
|
|
12
|
-
* <!-- Basic usage -->
|
|
13
|
-
* <template>
|
|
14
|
-
* <BvInput v-model="value" label="Email" placeholder="Enter your email" />
|
|
15
|
-
* </template>
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```vue
|
|
20
|
-
* <!-- With validation -->
|
|
21
|
-
* <template>
|
|
22
|
-
* <BvInput
|
|
23
|
-
* v-model="email"
|
|
24
|
-
* type="email"
|
|
25
|
-
* label="Email"
|
|
26
|
-
* required
|
|
27
|
-
* :invalid-text="emailError"
|
|
28
|
-
* @invalid="handleInvalid"
|
|
29
|
-
* />
|
|
30
|
-
* </template>
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```vue
|
|
35
|
-
* <!-- With icon -->
|
|
36
|
-
* <template>
|
|
37
|
-
* <BvInput v-model="search" label="Search" icon="search" />
|
|
38
|
-
* </template>
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
import { onMounted } from "vue";
|
|
42
|
-
import { loadBaklavaResources } from "../utils/loadBaklavaResources";
|
|
43
|
-
import type { InputProps } from "./input.types";
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Component props with default values.
|
|
47
|
-
*/
|
|
48
|
-
const props = withDefaults(defineProps<InputProps>(), {
|
|
49
|
-
modelValue: undefined,
|
|
50
|
-
name: undefined,
|
|
51
|
-
type: "text",
|
|
52
|
-
label: undefined,
|
|
53
|
-
placeholder: undefined,
|
|
54
|
-
required: undefined,
|
|
55
|
-
minlength: undefined,
|
|
56
|
-
maxlength: undefined,
|
|
57
|
-
min: undefined,
|
|
58
|
-
max: undefined,
|
|
59
|
-
pattern: undefined,
|
|
60
|
-
step: undefined,
|
|
61
|
-
autocomplete: undefined,
|
|
62
|
-
inputmode: undefined,
|
|
63
|
-
autofocus: undefined,
|
|
64
|
-
icon: undefined,
|
|
65
|
-
size: "medium",
|
|
66
|
-
disabled: undefined,
|
|
67
|
-
readonly: undefined,
|
|
68
|
-
invalidText: undefined,
|
|
69
|
-
labelFixed: true,
|
|
70
|
-
helpText: undefined,
|
|
71
|
-
loading: undefined,
|
|
72
|
-
suffixText: undefined,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Component events.
|
|
77
|
-
*/
|
|
78
|
-
const emit = defineEmits<{
|
|
79
|
-
/**
|
|
80
|
-
* Emitted when the input value changes. Use with v-model.
|
|
81
|
-
*
|
|
82
|
-
* @param {string | number | null} value - The new input value.
|
|
83
|
-
*/
|
|
84
|
-
"update:modelValue": [value: string | number | null];
|
|
85
|
-
/**
|
|
86
|
-
* Emitted when validation fails.
|
|
87
|
-
*
|
|
88
|
-
* @param {ValidityState} state - The native ValidityState object.
|
|
89
|
-
*/
|
|
90
|
-
invalid: [state: ValidityState];
|
|
91
|
-
/**
|
|
92
|
-
* Emitted when the input receives focus.
|
|
93
|
-
*
|
|
94
|
-
* @param {FocusEvent} event - The native focus event.
|
|
95
|
-
*/
|
|
96
|
-
focus: [event: FocusEvent];
|
|
97
|
-
/**
|
|
98
|
-
* Emitted when the input loses focus.
|
|
99
|
-
*
|
|
100
|
-
* @param {FocusEvent} event - The native focus event.
|
|
101
|
-
*/
|
|
102
|
-
blur: [event: FocusEvent];
|
|
103
|
-
}>();
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Triggers the native date/time picker for inputs with type="date", "time",
|
|
107
|
-
* "datetime-local", etc. Called on click to ensure the picker opens when
|
|
108
|
-
* the user clicks the input.
|
|
109
|
-
*
|
|
110
|
-
* @param {Event} event - The click event.
|
|
111
|
-
*/
|
|
112
|
-
const showPicker = ({ currentTarget }: Event) =>
|
|
113
|
-
(currentTarget as HTMLInputElement)?.showPicker();
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Lifecycle hook: Component mounted.
|
|
117
|
-
*
|
|
118
|
-
* Loads Baklava resources when the component is mounted.
|
|
119
|
-
*/
|
|
120
|
-
onMounted(() => {
|
|
121
|
-
loadBaklavaResources();
|
|
122
|
-
});
|
|
123
|
-
</script>
|
|
124
|
-
|
|
125
|
-
<template>
|
|
126
|
-
<bl-input
|
|
127
|
-
v-bind="{
|
|
128
|
-
...props,
|
|
129
|
-
'label-fixed': props.labelFixed === true ? true : undefined,
|
|
130
|
-
'help-text': props.helpText ? props.helpText : undefined,
|
|
131
|
-
'invalid-text': props.invalidText ? props.invalidText : undefined,
|
|
132
|
-
loading: props.loading ? props.loading : undefined,
|
|
133
|
-
placeholder: props.placeholder ? props.placeholder : props.label,
|
|
134
|
-
}"
|
|
135
|
-
:value="props.modelValue"
|
|
136
|
-
@bl-input="
|
|
137
|
-
emit('update:modelValue', ($event.target as HTMLInputElement)?.value)
|
|
138
|
-
"
|
|
139
|
-
@bl-invalid="emit('invalid', $event)"
|
|
140
|
-
@focus="emit('focus', $event)"
|
|
141
|
-
@blur="emit('blur', $event)"
|
|
142
|
-
@click="showPicker"
|
|
143
|
-
>
|
|
144
|
-
<span v-if="props.suffixText" slot="icon">
|
|
145
|
-
{{ props.suffixText }}
|
|
146
|
-
</span>
|
|
147
|
-
</bl-input>
|
|
148
|
-
</template>
|
package/src/input/index.ts
DELETED
package/src/input/input.types.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import type { BaklavaIcon } from "@trendyol/baklava-icons";
|
|
2
|
-
import type {
|
|
3
|
-
InputSize,
|
|
4
|
-
InputType,
|
|
5
|
-
} from "@trendyol/baklava/dist/components/input/bl-input";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Input mode hint for virtual keyboards.
|
|
9
|
-
*
|
|
10
|
-
* @typedef InputMode
|
|
11
|
-
*/
|
|
12
|
-
type InputMode =
|
|
13
|
-
| "none"
|
|
14
|
-
| "text"
|
|
15
|
-
| "decimal"
|
|
16
|
-
| "numeric"
|
|
17
|
-
| "tel"
|
|
18
|
-
| "search"
|
|
19
|
-
| "email"
|
|
20
|
-
| "url";
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Props for the Input component.
|
|
24
|
-
*
|
|
25
|
-
* A Vue UI kit component for Baklava's bl-input web component with full v-model support
|
|
26
|
-
* and TypeScript types.
|
|
27
|
-
*
|
|
28
|
-
* @interface InputProps
|
|
29
|
-
*/
|
|
30
|
-
export interface InputProps {
|
|
31
|
-
/**
|
|
32
|
-
* Input value (v-model).
|
|
33
|
-
*/
|
|
34
|
-
modelValue?: string | number | null;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Input name attribute for form submission.
|
|
38
|
-
*/
|
|
39
|
-
name?: string;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Input type (text, email, password, number, date, time, etc.).
|
|
43
|
-
*
|
|
44
|
-
* @default "text"
|
|
45
|
-
*/
|
|
46
|
-
type?: InputType;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Input label displayed above or beside the input.
|
|
50
|
-
*/
|
|
51
|
-
label?: string;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Placeholder text when the input is empty.
|
|
55
|
-
*/
|
|
56
|
-
placeholder?: string;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Whether the input is required for form validation.
|
|
60
|
-
*/
|
|
61
|
-
required?: boolean;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Minimum character length for validation.
|
|
65
|
-
*/
|
|
66
|
-
minlength?: number;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Maximum character length for validation.
|
|
70
|
-
*/
|
|
71
|
-
maxlength?: number;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Minimum value for number/date inputs.
|
|
75
|
-
*/
|
|
76
|
-
min?: number | string;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Maximum value for number/date inputs.
|
|
80
|
-
*/
|
|
81
|
-
max?: number | string;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* RegExp pattern for validation.
|
|
85
|
-
*/
|
|
86
|
-
pattern?: string;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Step value for number inputs.
|
|
90
|
-
*/
|
|
91
|
-
step?: number;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Autocomplete attribute for the input.
|
|
95
|
-
*/
|
|
96
|
-
autocomplete?: string;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Input mode hint for virtual keyboards.
|
|
100
|
-
*/
|
|
101
|
-
inputmode?: InputMode;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Whether the input should receive focus on mount.
|
|
105
|
-
*/
|
|
106
|
-
autofocus?: boolean;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Baklava icon name to display in the input.
|
|
110
|
-
*/
|
|
111
|
-
icon?: BaklavaIcon;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Input size (small, medium, large).
|
|
115
|
-
*
|
|
116
|
-
* @default "medium"
|
|
117
|
-
*/
|
|
118
|
-
size?: InputSize;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Whether the input is disabled.
|
|
122
|
-
*/
|
|
123
|
-
disabled?: boolean;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Whether the input is readonly.
|
|
127
|
-
*/
|
|
128
|
-
readonly?: boolean;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Whether the label has fixed position.
|
|
132
|
-
*
|
|
133
|
-
* @default true
|
|
134
|
-
*/
|
|
135
|
-
labelFixed?: boolean;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Error message text displayed when validation fails.
|
|
139
|
-
*/
|
|
140
|
-
invalidText?: string;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Helper text displayed below the input.
|
|
144
|
-
*/
|
|
145
|
-
helpText?: string;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Whether to show loading indicator.
|
|
149
|
-
*/
|
|
150
|
-
loading?: boolean;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Suffix text displayed in the icon slot.
|
|
154
|
-
*/
|
|
155
|
-
suffixText?: string;
|
|
156
|
-
}
|
package/src/link/Link.vue
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Link Component
|
|
4
|
-
*
|
|
5
|
-
* A Vue UI kit component for Baklava's `bl-link` web component for navigation links.
|
|
6
|
-
* Supports inline (text within content) and standalone (button-like) variants with
|
|
7
|
-
* full TypeScript support and HTML anchor attributes (href, target, rel, etc.).
|
|
8
|
-
*
|
|
9
|
-
* @component
|
|
10
|
-
* @example
|
|
11
|
-
* ```vue
|
|
12
|
-
* <!-- Basic usage -->
|
|
13
|
-
* <template>
|
|
14
|
-
* <BvLink href="/about">About</BvLink>
|
|
15
|
-
* </template>
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```vue
|
|
20
|
-
* <!-- Inline variant (default) -->
|
|
21
|
-
* <template>
|
|
22
|
-
* <p>Visit our <BvLink href="/docs">documentation</BvLink> for more info.</p>
|
|
23
|
-
* </template>
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```vue
|
|
28
|
-
* <!-- Standalone variant with size -->
|
|
29
|
-
* <template>
|
|
30
|
-
* <BvLink href="/signup" variant="standalone" size="large">
|
|
31
|
-
* Sign up
|
|
32
|
-
* </BvLink>
|
|
33
|
-
* </template>
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```vue
|
|
38
|
-
* <!-- With icon slot -->
|
|
39
|
-
* <template>
|
|
40
|
-
* <BvLink href="/settings" variant="standalone">
|
|
41
|
-
* <template #icon><BvIcon name="settings" /></template>
|
|
42
|
-
* Settings
|
|
43
|
-
* </BvLink>
|
|
44
|
-
* </template>
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```vue
|
|
49
|
-
* <!-- External link with target -->
|
|
50
|
-
* <template>
|
|
51
|
-
* <BvLink href="https://example.com" target="_blank" rel="noopener noreferrer">
|
|
52
|
-
* External site
|
|
53
|
-
* </BvLink>
|
|
54
|
-
* </template>
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```vue
|
|
59
|
-
* <!-- Disabled state -->
|
|
60
|
-
* <template>
|
|
61
|
-
* <BvLink href="/disabled" :disabled="true">Disabled link</BvLink>
|
|
62
|
-
* </template>
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
import { computed, onMounted } from "vue";
|
|
66
|
-
import { loadBaklavaResources } from "../utils/loadBaklavaResources";
|
|
67
|
-
import type { LinkProps } from "./link.types";
|
|
68
|
-
|
|
69
|
-
const props = withDefaults(defineProps<LinkProps>(), {
|
|
70
|
-
href: undefined,
|
|
71
|
-
target: undefined,
|
|
72
|
-
disabled: undefined,
|
|
73
|
-
variant: undefined,
|
|
74
|
-
size: undefined,
|
|
75
|
-
kind: undefined,
|
|
76
|
-
ariaLabel: undefined,
|
|
77
|
-
rel: undefined,
|
|
78
|
-
hreflang: undefined,
|
|
79
|
-
type: undefined,
|
|
80
|
-
referrerPolicy: undefined,
|
|
81
|
-
download: undefined,
|
|
82
|
-
ping: undefined,
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
const emit = defineEmits<{
|
|
86
|
-
/** Emitted when the link is clicked. */
|
|
87
|
-
click: [event: CustomEvent];
|
|
88
|
-
}>();
|
|
89
|
-
|
|
90
|
-
/** Props to pass to bl-link. When disabled, omit href so navigation is prevented. */
|
|
91
|
-
const linkBindings = computed(() => {
|
|
92
|
-
const { disabled, href, ...rest } = props;
|
|
93
|
-
return {
|
|
94
|
-
...rest,
|
|
95
|
-
href: disabled ? undefined : href,
|
|
96
|
-
"aria-disabled": disabled ? "true" : undefined,
|
|
97
|
-
tabindex: disabled ? -1 : undefined,
|
|
98
|
-
};
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
/** Prevents navigation and click when disabled. */
|
|
102
|
-
function handleClick(event: CustomEvent) {
|
|
103
|
-
if (props.disabled) {
|
|
104
|
-
event.preventDefault();
|
|
105
|
-
event.stopPropagation();
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
emit("click", event);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
onMounted(() => {
|
|
112
|
-
loadBaklavaResources();
|
|
113
|
-
});
|
|
114
|
-
</script>
|
|
115
|
-
|
|
116
|
-
<template>
|
|
117
|
-
<bl-link
|
|
118
|
-
v-bind="linkBindings"
|
|
119
|
-
:class="{ 'bv-link--disabled': disabled }"
|
|
120
|
-
@bl-click="handleClick"
|
|
121
|
-
>
|
|
122
|
-
<slot v-if="$slots['icon']" name="icon" />
|
|
123
|
-
<slot />
|
|
124
|
-
</bl-link>
|
|
125
|
-
</template>
|
|
126
|
-
|
|
127
|
-
<style scoped>
|
|
128
|
-
.bv-link--disabled {
|
|
129
|
-
pointer-events: none;
|
|
130
|
-
opacity: 0.5;
|
|
131
|
-
cursor: not-allowed;
|
|
132
|
-
}
|
|
133
|
-
</style>
|
package/src/link/index.ts
DELETED