test-bentoweb-ui 1.0.47 → 1.0.51

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 CHANGED
@@ -1,29 +1,225 @@
1
- # bentoweb-ui
2
-
3
- This template should help get you started developing with Vue 3 in Vite.
4
-
5
- ## Recommended IDE Setup
6
-
7
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
8
-
9
- ## Customize configuration
10
-
11
- See [Vite Configuration Reference](https://vitejs.dev/config/).
12
-
13
- ## Project Setup
14
-
15
- ```sh
16
- npm install
17
- ```
18
-
19
- ### Compile and Hot-Reload for Development
20
-
21
- ```sh
22
- npm run dev
23
- ```
24
-
25
- ### Compile and Minify for Production
26
-
27
- ```sh
28
- npm run build
29
- ```
1
+ # bentoweb-ui
2
+
3
+ This template should help get you started developing with Vue 3 in Vite.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
8
+
9
+ ## Customize configuration
10
+
11
+ See [Vite Configuration Reference](https://vitejs.dev/config/).
12
+
13
+ ## Project Setup
14
+
15
+ ```sh
16
+ npm install
17
+ ```
18
+
19
+ ### Compile and Hot-Reload for Development
20
+
21
+ ```sh
22
+ npm run dev
23
+ ```
24
+
25
+ ### Compile and Minify for Production
26
+
27
+ ```sh
28
+ npm run build
29
+ ```
30
+
31
+ # Bento UI Components
32
+
33
+ ## Swiper Components
34
+
35
+ The Swiper components have been updated to use the official Swiper Element (WebComponent) instead of the deprecated vue-awesome-swiper.
36
+
37
+ ### SwiperBanner Usage
38
+
39
+ ```vue
40
+ <template>
41
+ <SwiperBanner :BannerImage="bannerImages" size="xl" />
42
+ </template>
43
+
44
+ <script>
45
+ import { SwiperBanner } from 'test-bentoweb-ui';
46
+
47
+ export default {
48
+ components: {
49
+ SwiperBanner
50
+ },
51
+ data() {
52
+ return {
53
+ bannerImages: [
54
+ {
55
+ src: '/images/platform-btw.jpg',
56
+ link: '/platform'
57
+ },
58
+ {
59
+ src: '/images/t-shirt.jpg',
60
+ link: '/products'
61
+ },
62
+ {
63
+ src: 'https://example.com/external-image.jpg',
64
+ link: '/external'
65
+ }
66
+ ]
67
+ }
68
+ }
69
+ }
70
+ </script>
71
+ ```
72
+
73
+ #### Props
74
+
75
+ | Prop | Type | Default | Description |
76
+ |------|------|---------|-------------|
77
+ | BannerImage | Array | required | Array of objects with `src` and `link` properties |
78
+ | size | String | 'l' | Size/layout of the banner. Options: 'm' (interactive style), 'l' (full banner with pagination), 'xl' (two-column layout), 'grid-2' (two square banners), 'grid-6' (3x2 grid of banners) |
79
+
80
+ The `src` property can be:
81
+ - A path relative to the public directory (e.g., `/images/example.jpg`)
82
+ - An absolute URL (e.g., `https://example.com/image.jpg`)
83
+
84
+ The `link` property can be:
85
+ - A Vue Router path for internal navigation (e.g., `/products`)
86
+ - An external URL (e.g., `https://example.com`) which will open in a new tab
87
+
88
+ ### Banner Configurations
89
+
90
+ The SwiperBanner component supports multiple layout configurations, all with proper aspect ratios to maintain consistent proportions across different screen sizes:
91
+
92
+ #### Banner M (size="m")
93
+ Small interactive banner with horizontal scrolling. Shows 1.2 slides on mobile and 2 slides on desktop.
94
+
95
+ #### Banner L (size="l")
96
+ Full-width banner with pagination bullets. This is the default configuration and was previously called 'xl'.
97
+
98
+ #### Banner XL (size="xl")
99
+ Two-column layout where the left column takes 60% of the width (16:9 aspect ratio) and the right column has two rows of smaller banners (21:10 aspect ratio). Requires at least 3 banner images.
100
+
101
+ On mobile devices (screen width < 768px), this layout automatically switches to a regular swiper with pagination for better user experience.
102
+
103
+ #### Grid-2 (size="grid-2")
104
+ Two equal-width square banners side by side (1:1 aspect ratio). Requires at least 2 banner images. This layout has a maximum width of 900px and is centered on the page to prevent the square images from appearing too large on wide screens.
105
+
106
+ On mobile devices (screen width < 768px), this layout automatically switches to a regular swiper with pagination for better user experience.
107
+
108
+ #### Grid-6 (size="grid-6")
109
+ 3x2 grid of rectangle banners (16:9 aspect ratio). Requires at least 6 banner images for full display.
110
+
111
+ On mobile devices (screen width < 768px), this layout automatically switches to a regular swiper with pagination for better user experience.
112
+
113
+ ### Usage Examples
114
+
115
+ ```vue
116
+ <!-- Banner M - Small interactive banner -->
117
+ <SwiperBanner :BannerImage="bannerImages" size="m" />
118
+
119
+ <!-- Banner L - Full width banner with pagination (default) -->
120
+ <SwiperBanner :BannerImage="bannerImages" size="l" />
121
+
122
+ <!-- Banner XL - Two column layout -->
123
+ <SwiperBanner :BannerImage="bannerImages" size="xl" />
124
+
125
+ <!-- Grid-2 - Two square banners -->
126
+ <SwiperBanner :BannerImage="bannerImages" size="grid-2" />
127
+
128
+ <!-- Grid-6 - 3x2 grid of banners -->
129
+ <SwiperBanner :BannerImage="bannerImages" size="grid-6" />
130
+ ```
131
+
132
+ ### Swiper Element Attributes
133
+
134
+ When using Swiper Element (WebComponent), attributes must be passed as strings rather than bound objects:
135
+
136
+ ```vue
137
+ <!-- Correct -->
138
+ <swiper-container
139
+ slides-per-view="1"
140
+ pagination="true"
141
+ pagination-clickable="true"
142
+ autoplay-delay="2500"
143
+ breakpoints='{"768": {"slidesPerView": 2}}'
144
+ >
145
+ </swiper-container>
146
+
147
+ <!-- Incorrect - will display as [object Object] -->
148
+ <swiper-container
149
+ :pagination="{ clickable: true }"
150
+ :autoplay="{ delay: 2500 }"
151
+ >
152
+ </swiper-container>
153
+ ```
154
+
155
+ For complex options like breakpoints, use a JSON string.
156
+
157
+ ### CSS Styling
158
+
159
+ Swiper Element uses Shadow DOM, so CSS selectors need to use `::part()` to target internal elements. The element name must be included in the selector:
160
+
161
+ ```css
162
+ /* Correct way to target Shadow DOM parts */
163
+ swiper-container.banner-full::part(pagination) {
164
+ text-align: left;
165
+ padding-left: 0.9375rem;
166
+ }
167
+
168
+ swiper-container.banner-full::part(bullet) {
169
+ background-color: white;
170
+ width: 0.4375rem;
171
+ height: 0.4375rem;
172
+ }
173
+
174
+ swiper-container.banner-full::part(bullet-active) {
175
+ width: 0.9375rem;
176
+ border-radius: 0.3125rem;
177
+ }
178
+
179
+ /* This won't work */
180
+ .banner-full ::part(bullet) {
181
+ background-color: white;
182
+ }
183
+ ```
184
+
185
+ Available parts include: `container`, `wrapper`, `slide`, `pagination`, `bullet`, `bullet-active`, and more. See the [Swiper Element documentation](https://swiperjs.com/element#parts) for a complete list.
186
+
187
+ ### SwiperInteractive Usage (Removed)
188
+
189
+ The SwiperInteractive component has been removed. Please use the SwiperBanner component with `size="m"` instead:
190
+
191
+ ```vue
192
+ <template>
193
+ <SwiperBanner :BannerImage="interactiveImages" size="m" />
194
+ </template>
195
+
196
+ <script>
197
+ import { SwiperBanner } from 'test-bentoweb-ui';
198
+
199
+ export default {
200
+ components: {
201
+ SwiperBanner
202
+ },
203
+ data() {
204
+ return {
205
+ interactiveImages: [
206
+ {
207
+ src: '/images/platform-btw.jpg',
208
+ link: '/platform'
209
+ },
210
+ {
211
+ src: '/images/t-shirt.jpg',
212
+ link: '/products'
213
+ },
214
+ {
215
+ src: '/images/vdo.jpg',
216
+ link: '/videos'
217
+ }
218
+ ]
219
+ }
220
+ }
221
+ }
222
+ </script>
223
+ ```
224
+
225
+ The same path handling rules apply as for the standard SwiperBanner usage. Make sure your Vue Router is properly configured to handle these routes.