@wikicasa-dev/components 2.9.1-alpha.3 → 2.10.0-alpha.0

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 (95) hide show
  1. package/dist/UIKit/BaseSnackbar.vue.js +1 -1
  2. package/dist/assets/AccessibleSelect.css +1 -1
  3. package/dist/assets/BaseBadge.css +1 -1
  4. package/dist/assets/BaseComplexToggle2.css +1 -1
  5. package/dist/assets/BaseDropDown.css +1 -1
  6. package/dist/assets/BaseFloatingLabel2.css +1 -1
  7. package/dist/assets/BaseSlider2.css +1 -1
  8. package/dist/assets/BaseSnackbar.css +1 -1
  9. package/dist/assets/BaseTabs.css +1 -1
  10. package/dist/assets/BaseTextarea2.css +1 -1
  11. package/dist/assets/BaseTooltip2.css +1 -1
  12. package/dist/assets/baseAlert.css +1 -1
  13. package/dist/assets/baseComplexToggle.css +1 -1
  14. package/dist/assets/baseFloatingLabel.css +1 -1
  15. package/dist/assets/baseSlider.css +1 -1
  16. package/dist/assets/baseTextarea.css +1 -1
  17. package/dist/assets/baseTooltip.css +1 -1
  18. package/dist/assets/tailwind.css +1 -1
  19. package/dist/assets/tokens.css +1 -0
  20. package/dist/docs/AccessibleSelect.md +121 -0
  21. package/dist/docs/AccordionContentPrimitive.md +70 -0
  22. package/dist/docs/AccordionHeaderPrimitive.md +70 -0
  23. package/dist/docs/AccordionItemPrimitive.md +98 -0
  24. package/dist/docs/AccordionTriggerPrimitive.md +71 -0
  25. package/dist/docs/BaseAccordion.md +98 -0
  26. package/dist/docs/BaseAccordionItem.md +100 -0
  27. package/dist/docs/BaseAlert.md +83 -0
  28. package/dist/docs/BaseAutocomplete.md +125 -0
  29. package/dist/docs/BaseBadge.md +92 -0
  30. package/dist/docs/BaseBreadcrumb.md +83 -0
  31. package/dist/docs/BaseButton.md +129 -0
  32. package/dist/docs/BaseCard.md +110 -0
  33. package/dist/docs/BaseComplexToggle.md +99 -0
  34. package/dist/docs/BaseDropDown.md +122 -0
  35. package/dist/docs/BaseFloatingLabel.md +89 -0
  36. package/dist/docs/BaseInput.md +130 -0
  37. package/dist/docs/BaseModal.md +129 -0
  38. package/dist/docs/BasePagination.md +109 -0
  39. package/dist/docs/BaseShimmerLoader.md +86 -0
  40. package/dist/docs/BaseSlider.md +87 -0
  41. package/dist/docs/BaseSnackbar.md +120 -0
  42. package/dist/docs/BaseTab.md +84 -0
  43. package/dist/docs/BaseTabView.md +90 -0
  44. package/dist/docs/BaseTabs.md +116 -0
  45. package/dist/docs/BaseTabsContent.md +71 -0
  46. package/dist/docs/BaseTabsIndicator.md +73 -0
  47. package/dist/docs/BaseTabsList.md +76 -0
  48. package/dist/docs/BaseTabsTrigger.md +70 -0
  49. package/dist/docs/BaseTextarea.md +99 -0
  50. package/dist/docs/BaseToggle.md +88 -0
  51. package/dist/docs/BaseTooltip.md +87 -0
  52. package/dist/docs/BaseUploadFile.md +96 -0
  53. package/dist/docs/CardDescriptionPrimitive.md +73 -0
  54. package/dist/docs/CardImagePrimitive.md +73 -0
  55. package/dist/docs/CardRootPrimitive.md +99 -0
  56. package/dist/docs/CheckboxBtn.md +96 -0
  57. package/dist/docs/CheckboxButtonGroup.md +115 -0
  58. package/dist/docs/CheckboxGroup.md +102 -0
  59. package/dist/docs/CheckboxGroupItemPrimitive.md +104 -0
  60. package/dist/docs/CheckboxGroupPrimitive.md +105 -0
  61. package/dist/docs/ClearableAutocomplete.md +135 -0
  62. package/dist/docs/DoughnutChart.md +88 -0
  63. package/dist/docs/INDEX.md +133 -0
  64. package/dist/docs/IntersectionObservable.md +78 -0
  65. package/dist/docs/IntersectionObserver.md +84 -0
  66. package/dist/docs/IntersectionObserverProvider.md +98 -0
  67. package/dist/docs/IntersectionObserverTarget.md +73 -0
  68. package/dist/docs/LineChart.md +98 -0
  69. package/dist/docs/ProgressIndicatorPrimitive.md +70 -0
  70. package/dist/docs/ProgressRootPrimitive.md +106 -0
  71. package/dist/docs/RadioButton.md +86 -0
  72. package/dist/docs/RadioButtonGroup.md +107 -0
  73. package/dist/docs/RadioButtonItem.md +101 -0
  74. package/dist/docs/RadioGroup.md +95 -0
  75. package/dist/docs/RadioGroupItemPrimitive.md +102 -0
  76. package/dist/docs/SelectItem.md +100 -0
  77. package/dist/docs/ShimmerMultiLine.md +79 -0
  78. package/dist/docs/SimpleSlider.md +80 -0
  79. package/dist/docs/StaticSpinner.md +76 -0
  80. package/dist/docs/SwiperCarousel.md +126 -0
  81. package/dist/docs/SwiperNavigationPrimitive.md +83 -0
  82. package/dist/docs/SwiperPaginationPrimitive.md +80 -0
  83. package/dist/docs/SwiperPrimitive.md +77 -0
  84. package/dist/docs/SwiperRootPrimitive.md +123 -0
  85. package/dist/docs/SwiperSlide.md +75 -0
  86. package/dist/docs/SwiperSlideImagePrimitive.md +98 -0
  87. package/dist/docs/SwiperThumbnailPrimitive.md +96 -0
  88. package/dist/docs/TOKENS.md +50 -0
  89. package/dist/docs/agent-index.md +86 -0
  90. package/dist/lazyModules/Swiper/Autoplay/index.js +1 -1
  91. package/dist/lazyModules/Swiper/Controller/index.js +1 -1
  92. package/dist/lazyModules/Swiper/Keyboard/index.js +1 -1
  93. package/dist/lazyModules/Swiper/Thumbs/index.js +1 -1
  94. package/package.json +7 -6
  95. /package/dist/assets/{swiper-controller.css → swiper-keyboard.css} +0 -0
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: SelectItem
3
+ status: primitive
4
+ category: Selection
5
+ summary: List row (`<li>`) with an active/highlighted state, for building option lists inside BaseDropDown.
6
+ import: @wikicasa-dev/components/UIKit/BaseSelect/SelectItem
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # SelectItem
11
+
12
+ > **Primitive.** A low-level building block. Prefer a `preferred` component; use primitives only to compose something that doesn't exist yet.
13
+
14
+ List row (`<li>`) with an active/highlighted state, for building option lists inside BaseDropDown.
15
+
16
+ ```ts
17
+ import SelectItem from "@wikicasa-dev/components/UIKit/BaseSelect/SelectItem";
18
+ ```
19
+
20
+ A building block for the panel of a `BaseDropDown`: it renders an `<li>` that highlights when `active` and moves keyboard focus onto itself, so arrow-key navigation is visible. `ClearableAutocomplete` (and the legacy `BaseAutocomplete`) use it internally. If you just need a select field use `AccessibleSelect`; use `SelectItem` only when composing a custom menu or list.
21
+
22
+ Content: the default slot (slot prop `itemIdx`), or the `label` prop (HTML allowed) if no slot is given. `click` and `mouseover` emit the item's `idx`.
23
+
24
+ ## Usage
25
+
26
+ ```vue
27
+ <script setup lang="ts">
28
+ import BaseDropDown from "@wikicasa-dev/components/UIKit/BaseDropDown";
29
+ import SelectItem from "@wikicasa-dev/components/UIKit/BaseSelect/SelectItem";
30
+
31
+ const languages = [
32
+ { code: "it", label: "Italiano" },
33
+ { code: "en", label: "English" },
34
+ ];
35
+ const changeLanguage = (code: string) => console.log("lang", code);
36
+ </script>
37
+
38
+ <template>
39
+ <BaseDropDown btn-label="Italiano" with-arrow-icon direction="up" dropdown-element="ul">
40
+ <template #default="{ activeIdx, setActiveIdx, toggleDropdown }">
41
+ <SelectItem
42
+ v-for="(lang, idx) in languages"
43
+ :key="lang.code"
44
+ :idx="idx"
45
+ :label="lang.label"
46
+ :active="activeIdx === idx"
47
+ @mouseover="setActiveIdx"
48
+ @click="changeLanguage(lang.code); toggleDropdown()"
49
+ @keydown.enter="changeLanguage(lang.code)"
50
+ />
51
+ </template>
52
+ </BaseDropDown>
53
+ </template>
54
+ ```
55
+
56
+ ## Do / Don't
57
+
58
+ - Do render it as a direct child of a `ul`/`ol` (`dropdown-element="ul"` on `BaseDropDown`).
59
+ - Do pass `idx` and bind `active` to the dropdown's `activeIdx`, updating it on `mouseover`.
60
+ - Do set `:focus-on-active="false"` when `active` is driven only by the pointer (e.g. next to a text input on mobile): focusing the item would steal focus and close the soft keyboard.
61
+ - Don't use it outside a list; it is an `<li>`.
62
+
63
+ ## Styling hooks
64
+
65
+ - Active rows get the class `active`, `data-active="true"` and a light (`w-cultured`) background.
66
+ - `class` is applied to the `<li>`; use it for padding, radius and cursor.
67
+
68
+ ## API
69
+
70
+ _Generated from the component's types. Do not edit by hand._
71
+
72
+ ### Props
73
+
74
+ | Name | Type | Default | Required | Description |
75
+ | --- | --- | --- | --- | --- |
76
+ | `label` | `string` | `""` | | |
77
+ | `active` | `boolean` | `false` | | |
78
+ | `idx` | `number` | `-1` | | |
79
+ | `focusOnActive` | `boolean` | `true` | | Whether becoming active should move real DOM focus onto the item. Focus exists here to serve keyboard navigation. Consumers that drive `active` from pointer events alone (touch synthesises `mouseover` before `click`) should turn this off: focusing the item runs scroll-into-view against every scrollable ancestor and blurs whatever held focus - on mobile that dismisses the soft keyboard, and both cost a forced layout before the tap is even processed. |
80
+
81
+ ### Events
82
+
83
+ | Name | Payload |
84
+ | --- | --- |
85
+ | `click` | `[number]` |
86
+ | `mouseover` | `[number]` |
87
+
88
+ ### v-model
89
+
90
+ None.
91
+
92
+ ### Slots
93
+
94
+ | Name | Slot props |
95
+ | --- | --- |
96
+ | `default` | `{ itemIdx: number; }` |
97
+
98
+ ### Exposed (template ref)
99
+
100
+ None.
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: ShimmerMultiLine
3
+ status: preferred
4
+ category: Loading
5
+ summary: Stack of BaseShimmerLoader lines, a quick skeleton for a paragraph or a card description.
6
+ import: @wikicasa-dev/components/UIKit/ShimmerLoader/ShimmerMultiLine
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # ShimmerMultiLine
11
+
12
+ Stack of BaseShimmerLoader lines, a quick skeleton for a paragraph or a card description.
13
+
14
+ ```ts
15
+ import ShimmerMultiLine from "@wikicasa-dev/components/UIKit/ShimmerLoader/ShimmerMultiLine";
16
+ ```
17
+
18
+ Renders `lines` skeleton bars stacked vertically (32px tall each, 8px apart, small radius), the usual stand-in for a block of text while it loads. Each line is a full-width `BaseShimmerLoader`. For a single sized block (price, image, button), use `BaseShimmerLoader` directly.
19
+
20
+ ## Usage
21
+
22
+ ```vue
23
+ <script setup lang="ts">
24
+ import ShimmerMultiLine from "@wikicasa-dev/components/UIKit/ShimmerLoader/ShimmerMultiLine";
25
+ </script>
26
+
27
+ <template>
28
+ <section class="description">
29
+ <h2>Descrizione dell'immobile</h2>
30
+ <ShimmerMultiLine :lines="4" inherit-height />
31
+ </section>
32
+ </template>
33
+
34
+ <style scoped>
35
+ .description { font-size: 16px; }
36
+ </style>
37
+ ```
38
+
39
+ ## Do / Don't
40
+
41
+ - Do use `inherit-height` to make each line 1em tall (follows the surrounding `font-size`) instead of the default 32px, so the skeleton matches body text.
42
+ - Do pick `lines` to match the expected text, so the height doesn't jump when content arrives.
43
+ - Don't use `random-length` on server-rendered pages: it picks a random right margin (0–50%) per line on every render, which causes a hydration mismatch and lines that change length on re-render. Fine in client-only mockups.
44
+ - `shimmer-classes` here is applied to every line box (use it for line background, height or width), unlike on `BaseShimmerLoader` where it targets the shine.
45
+ - `:enabled="false"` freezes the animation on all lines.
46
+
47
+ ## Styling hooks
48
+
49
+ Each line has the class `shimmer-line`; style it from a parent (e.g. `.description :deep(.shimmer-line) { … }`) or pass classes with `shimmer-classes`.
50
+
51
+ ## API
52
+
53
+ _Generated from the component's types. Do not edit by hand._
54
+
55
+ ### Props
56
+
57
+ | Name | Type | Default | Required | Description |
58
+ | --- | --- | --- | --- | --- |
59
+ | `lines` | `number` | `1` | | |
60
+ | `randomLength` | `boolean` | `false` | | |
61
+ | `shimmerClasses` | `ClassTypeProp` | | | |
62
+ | `inheritHeight` | `boolean` | `false` | | |
63
+ | `enabled` | `boolean` | `true` | | |
64
+
65
+ ### Events
66
+
67
+ None.
68
+
69
+ ### v-model
70
+
71
+ None.
72
+
73
+ ### Slots
74
+
75
+ None.
76
+
77
+ ### Exposed (template ref)
78
+
79
+ None.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: SimpleSlider
3
+ status: preferred
4
+ category: Forms
5
+ summary: Single-thumb draggable slider bound with v-model to one number (linear or logarithmic scale).
6
+ import: @wikicasa-dev/components/UIKit/Slider/SimpleSlider
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # SimpleSlider
11
+
12
+ Single-thumb draggable slider bound with v-model to one number (linear or logarithmic scale).
13
+
14
+ ```ts
15
+ import SimpleSlider from "@wikicasa-dev/components/UIKit/Slider/SimpleSlider";
16
+ ```
17
+
18
+ A minimal horizontal slider for picking one number: a 4px track, a primary-colored fill and a round 20px thumb you drag. Use it for one value such as a search radius or a budget cap. For a min–max range with number inputs, use `BaseSlider`.
19
+
20
+ The value is snapped to `step`, clamped to `min`–`max` and rounded to an integer. `logarithmic` spreads a wide range (e.g. 10.000–2.000.000 €) so small values get more room.
21
+
22
+ ## Usage
23
+
24
+ ```vue
25
+ <script setup lang="ts">
26
+ import { ref } from "vue";
27
+ import SimpleSlider from "@wikicasa-dev/components/UIKit/Slider/SimpleSlider";
28
+
29
+ const radius = ref(2000); // metres
30
+ </script>
31
+
32
+ <template>
33
+ <div class="radius">
34
+ <p>Cerca entro {{ radius / 1000 }} km</p>
35
+ <SimpleSlider v-model="radius" :min="1000" :max="5000" :step="1000" />
36
+ </div>
37
+ </template>
38
+ ```
39
+
40
+ ## Do / Don't
41
+
42
+ - Do show the current value in a visible label next to the slider; the slider shows no value itself.
43
+ - Do initialize the `v-model` with a value inside `min`–`max`: an out-of-range or off-step value is corrected and written back immediately.
44
+ - Don't use it for decimals: values are rounded to whole numbers (a `step` of 0.5 doesn't work).
45
+ - Don't use `logarithmic` with `min` 0 (the default); a logarithmic scale needs `min` > 0.
46
+ - Interaction is drag-only (mouse or touch on the thumb): clicking the track and arrow keys do nothing. If keyboard access matters, pair it with a number input bound to the same value.
47
+ - `id`, `class` and other attributes go on an outer wrapper `<div>`, not on the `role="slider"` element, so a `<label for>` or `aria-label` can't name the slider. The track has 20px margin above and below.
48
+
49
+ ## API
50
+
51
+ _Generated from the component's types. Do not edit by hand._
52
+
53
+ ### Props
54
+
55
+ | Name | Type | Default | Required | Description |
56
+ | --- | --- | --- | --- | --- |
57
+ | `min` | `number` | `0` | | |
58
+ | `max` | `number` | `100` | | |
59
+ | `step` | `number` | `1` | | |
60
+ | `dataCy` | `string` | | | |
61
+ | `logarithmic` | `boolean` | `false` | | |
62
+ | `modelValue` | `Optional<number>` | `0` | | |
63
+
64
+ ### Events
65
+
66
+ | Name | Payload |
67
+ | --- | --- |
68
+ | `update:modelValue` | `[value: Optional<number>]` |
69
+
70
+ ### v-model
71
+
72
+ - `v-model` binds `modelValue` (`Optional<number>`)
73
+
74
+ ### Slots
75
+
76
+ None.
77
+
78
+ ### Exposed (template ref)
79
+
80
+ None.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: StaticSpinner
3
+ status: preferred
4
+ category: Loading
5
+ summary: Small rotating SVG ring (24px) for inline waits, e.g. inside a button while a request runs.
6
+ import: @wikicasa-dev/components/UIKit/StaticSpinner
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # StaticSpinner
11
+
12
+ Small rotating SVG ring (24px) for inline waits, e.g. inside a button while a request runs.
13
+
14
+ ```ts
15
+ import StaticSpinner from "@wikicasa-dev/components/UIKit/StaticSpinner";
16
+ ```
17
+
18
+ A 24×24px spinning ring drawn as an SVG. Use it for short, local waits: inside a button after a click, next to a label that is refreshing. For placeholder content while a section loads, use `BaseShimmerLoader` / `ShimmerMultiLine` instead.
19
+
20
+ The ring is **white by default** (`stroke-color="#fff"`), meant for filled primary buttons. On a light background set `stroke-color`.
21
+
22
+ ## Usage
23
+
24
+ ```vue
25
+ <script setup lang="ts">
26
+ import { ref } from "vue";
27
+ import StaticSpinner from "@wikicasa-dev/components/UIKit/StaticSpinner";
28
+
29
+ const sending = ref(true);
30
+ </script>
31
+
32
+ <template>
33
+ <p class="status">
34
+ <StaticSpinner v-if="sending" stroke-color="#2b5dff" role="status" aria-label="Invio della richiesta in corso" />
35
+ <span>Stiamo inviando la tua richiesta all'agenzia…</span>
36
+ </p>
37
+ </template>
38
+
39
+ <style scoped>
40
+ .status { display: flex; align-items: center; gap: 8px; }
41
+ </style>
42
+ ```
43
+
44
+ ## Do / Don't
45
+
46
+ - Do set `stroke-color` whenever the background isn't dark or primary-colored, or the spinner is invisible.
47
+ - Do give it an accessible name (`role="status"` + `aria-label`, they land on the `<svg>`) when it is the only sign that something is happening.
48
+ - `thickness` is the stroke width in a 128-unit viewBox (default 9); raise it when you scale the spinner up.
49
+ - To resize it, set `width`/`height` through a class with enough specificity (or `!important`): the SVG already carries the library's 24px size classes.
50
+
51
+ ## API
52
+
53
+ _Generated from the component's types. Do not edit by hand._
54
+
55
+ ### Props
56
+
57
+ | Name | Type | Default | Required | Description |
58
+ | --- | --- | --- | --- | --- |
59
+ | `thickness` | `number` | `9` | | |
60
+ | `strokeColor` | `string` | `"#fff"` | | |
61
+
62
+ ### Events
63
+
64
+ None.
65
+
66
+ ### v-model
67
+
68
+ None.
69
+
70
+ ### Slots
71
+
72
+ None.
73
+
74
+ ### Exposed (template ref)
75
+
76
+ None.
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: SwiperCarousel
3
+ status: preferred
4
+ category: Media
5
+ summary: Ready-made Swiper carousel for slides or an image gallery, with optional arrows, bullets, autoplay and thumbnails.
6
+ dataType: Image
7
+ import: @wikicasa-dev/components/generic/carousel/SwiperCarousel
8
+ version: 2.10.0-alpha.0
9
+ ---
10
+
11
+ # SwiperCarousel
12
+
13
+ Ready-made Swiper carousel for slides or an image gallery, with optional arrows, bullets, autoplay and thumbnails.
14
+
15
+ ```ts
16
+ import SwiperCarousel from "@wikicasa-dev/components/generic/carousel/SwiperCarousel";
17
+ ```
18
+
19
+ Renders data shaped like `Image` from `@wikicasa-dev/types`.
20
+
21
+ The all-in-one carousel. Use it for horizontally swipeable rows of cards ("Visti di recente", agents, testimonials) or a simple photo gallery. Two ways to fill it:
22
+
23
+ - **Slots:** put `SwiperSlide` elements in the default slot, each holding any content.
24
+ - **Images:** pass `images` (`Image[]` from `@wikicasa-dev/types`, at least `{ src, alt }`) and leave the default slot empty; it renders one `<img>` per slide, adds `#last_slide` after them, and can add a thumbnail strip with `thumb-swiper-options`.
25
+
26
+ Behavior comes from `swiper-options` (plain [Swiper options](https://swiperjs.com/swiper-api#parameters)): `slidesPerView`, `spaceBetween`, `loop`, `breakpoints`, `navigation: true` (arrows), `pagination: true` (bullets) or `pagination: { type: "fraction" }` ("2 / 8" pill), `autoplay`, `keyboard`. Swiper loads after mount; until then the carousel is hidden (`display: none`) and the `#placeholder` slot is shown.
27
+
28
+ Need custom arrows, a deferred-loading gallery or a thumbnail strip with your own slides? Compose the primitives (see `SwiperRootPrimitive`).
29
+
30
+ ## Usage
31
+
32
+ ```vue
33
+ <script setup lang="ts">
34
+ import SwiperCarousel from "@wikicasa-dev/components/generic/carousel/SwiperCarousel";
35
+ import SwiperSlide from "@wikicasa-dev/components/generic/carousel/SwiperSlide";
36
+
37
+ const listings = [
38
+ { id: 1, title: "Bilocale a Firenze", price: "€ 290.000" },
39
+ { id: 2, title: "Trilocale a Bologna", price: "€ 340.000" },
40
+ { id: 3, title: "Villa a Lucca", price: "€ 720.000" },
41
+ { id: 4, title: "Loft a Milano", price: "€ 510.000" },
42
+ ];
43
+ </script>
44
+
45
+ <template>
46
+ <section class="recent">
47
+ <SwiperCarousel
48
+ id="recently-seen"
49
+ :swiper-options="{ slidesPerView: 1.2, spaceBetween: 16, pagination: true, breakpoints: { 768: { slidesPerView: 3 } } }"
50
+ >
51
+ <SwiperSlide v-for="l in listings" :key="l.id">
52
+ <article class="recent__card"><h3>{{ l.title }}</h3><p>{{ l.price }}</p></article>
53
+ </SwiperSlide>
54
+ <template #placeholder>
55
+ <div style="height: 180px" />
56
+ </template>
57
+ </SwiperCarousel>
58
+ </section>
59
+ </template>
60
+
61
+ <style scoped>
62
+ .recent :deep(.swiper-wrapper) { padding-bottom: 32px; }
63
+ .recent :deep(.swiper-pagination-bullet-active) { --swiper-pagination-color: rgb(var(--uikit-color-w-primary)); }
64
+ .recent__card { width: 100%; padding: 16px; border-radius: 20px; background: #fff; }
65
+ </style>
66
+ ```
67
+
68
+ ## Do / Don't
69
+
70
+ - Don't put `class` on `SwiperCarousel`: it is ignored. Use these kebab-case attributes instead (camelCase is ignored too): `root-classes` (outer wrapper), `swiper-classes` (the `.swiper` element), `swiper-wrapper-classes`, `swiper-pagination-classes`; in images mode also `swiper-slide-classes`, `slide-img-classes`, `thumb-swiper-classes`, `thumb-img-wrapper-classes`, `thumb-img-classes`.
71
+ - Scoped styles of your component don't reach the carousel's internal elements, even through the `*-classes` attributes: pass global classes there, or style from a wrapper you own with `:deep()` as above. Slide content you write in the slot is yours and scoped normally.
72
+ - Do fill `#placeholder` with a box of the carousel's final height, or the page jumps when it appears.
73
+ - Do treat `swiper-options` as fixed: it's read once. To change slides per view later, call the exposed `updateSlidesPerView(n)`; to jump, `moveTo(index)`; for anything else the exposed `swiper` is the Swiper instance.
74
+ - Do key slides by a stable id, not the index.
75
+ - Don't put `SwiperSlideImagePrimitive` with `lazy` in it: its images never load here. Use plain `<img>` or the primitives.
76
+ - Active pagination bullets are white by default: on light backgrounds override `--swiper-pagination-color` as above.
77
+
78
+ ## Styling hooks
79
+
80
+ Swiper's own CSS variables, set on an ancestor or on the elements (use `:deep()` from scoped styles, Swiper adds these classes at runtime): `--swiper-pagination-color` (active bullet), `--swiper-pagination-bullet-inactive-color`, `--swiper-pagination-bullet-inactive-opacity`, `--swiper-pagination-bullet-width` / `-height`, `--swiper-pagination-bottom`, `--swiper-navigation-color`, `--swiper-navigation-size`, `--swiper-navigation-sides-offset`. Thumbnail of the active slide: `.swiper-slide-thumb-active`.
81
+
82
+ ## API
83
+
84
+ _Generated from the component's types. Do not edit by hand._
85
+
86
+ ### Props
87
+
88
+ | Name | Type | Default | Required | Description |
89
+ | --- | --- | --- | --- | --- |
90
+ | `id` | `string` | | | |
91
+ | `swiperOptions` | `SwiperOptions` | | yes | |
92
+ | `thumbSwiperOptions` | `SwiperOptions` | | | |
93
+ | `lazyLoadImages` | `boolean` | `true` | | |
94
+ | `backgroundImage` | `boolean` | `false` | | |
95
+ | `images` | `Image[]` | `[]` | | |
96
+ | `artDirection` | `Record<string, { mq: string; width: string; }>` | | | |
97
+ | `shiftFirstImage` | `boolean` | `false` | | |
98
+
99
+ ### Events
100
+
101
+ | Name | Payload |
102
+ | --- | --- |
103
+ | `click` | |
104
+ | `moved` | `[{ activeIndex: number; }]` |
105
+ | `firstSlideLoaded` | |
106
+ | `init` | |
107
+
108
+ ### v-model
109
+
110
+ None.
111
+
112
+ ### Slots
113
+
114
+ | Name | Slot props |
115
+ | --- | --- |
116
+ | `default` | |
117
+ | `last_slide` | |
118
+ | `placeholder` | |
119
+
120
+ ### Exposed (template ref)
121
+
122
+ | Name | Type |
123
+ | --- | --- |
124
+ | `swiper` | `Nullable<Swiper>` |
125
+ | `moveTo` | `(index: number, speed?: number, runCallbacks?: boolean) => void` |
126
+ | `updateSlidesPerView` | `(value: number) => void` |
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: SwiperNavigationPrimitive
3
+ status: primitive
4
+ category: Media
5
+ summary: Swiper prev/next arrows for a SwiperRootPrimitive carousel.
6
+ import: @wikicasa-dev/components/generic/carousel/Primitive/SwiperNavigationPrimitive
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # SwiperNavigationPrimitive
11
+
12
+ > **Primitive.** A low-level building block. Prefer a `preferred` component; use primitives only to compose something that doesn't exist yet.
13
+
14
+ Swiper prev/next arrows for a SwiperRootPrimitive carousel.
15
+
16
+ ```ts
17
+ import SwiperNavigationPrimitive from "@wikicasa-dev/components/generic/carousel/Primitive/SwiperNavigationPrimitive";
18
+ ```
19
+
20
+ Adds Swiper's prev/next arrow buttons (`.swiper-button-prev` / `.swiper-button-next`, vertically centered on the sides) to a primitive carousel. Place it inside `SwiperRootPrimitive`, after `SwiperPrimitive`. `options` takes Swiper [navigation options](https://swiperjs.com/swiper-api#navigation) or `true` (default). See `SwiperRootPrimitive` for the full composition.
21
+
22
+ For arrows of your own design, skip this primitive and call `slidePrev()` / `slideNext()` on the Swiper instance the root gives you (`@init` or the exposed `swiper`).
23
+
24
+ ## Usage
25
+
26
+ ```vue
27
+ <script setup lang="ts">
28
+ import SwiperRootPrimitive from "@wikicasa-dev/components/generic/carousel/Primitive/SwiperRootPrimitive";
29
+ import SwiperPrimitive from "@wikicasa-dev/components/generic/carousel/Primitive/SwiperPrimitive";
30
+ import SwiperSlide from "@wikicasa-dev/components/generic/carousel/SwiperSlide";
31
+ import SwiperNavigationPrimitive from "@wikicasa-dev/components/generic/carousel/Primitive/SwiperNavigationPrimitive";
32
+ </script>
33
+
34
+ <template>
35
+ <div class="tour">
36
+ <SwiperRootPrimitive :swiper-options="{ slidesPerView: 1, rewind: true }">
37
+ <SwiperPrimitive>
38
+ <SwiperSlide v-for="room in ['Cucina', 'Soggiorno', 'Camera']" :key="room">{{ room }}</SwiperSlide>
39
+ </SwiperPrimitive>
40
+ <SwiperNavigationPrimitive />
41
+ </SwiperRootPrimitive>
42
+ </div>
43
+ </template>
44
+
45
+ <style scoped>
46
+ .tour { --swiper-navigation-color: rgb(var(--uikit-color-w-black)); --swiper-navigation-size: 30px; }
47
+ </style>
48
+ ```
49
+
50
+ ## Do / Don't
51
+
52
+ - Do render it unconditionally from the start; it registers with the root while the carousel is created. To hide arrows on small screens use Swiper `breakpoints` with `navigation: { enabled: false }` in the root's `swiper-options`.
53
+ - Don't put `class` on it: it renders two elements, so attributes are dropped. Style the arrows from an ancestor.
54
+
55
+ ## Styling hooks
56
+
57
+ `--swiper-navigation-color`, `--swiper-navigation-size` (44px), `--swiper-navigation-sides-offset`; classes `.swiper-button-prev`, `.swiper-button-next`, `.swiper-button-disabled`.
58
+
59
+ ## API
60
+
61
+ _Generated from the component's types. Do not edit by hand._
62
+
63
+ ### Props
64
+
65
+ | Name | Type | Default | Required | Description |
66
+ | --- | --- | --- | --- | --- |
67
+ | `options` | `SwiperNavigationPrimitiveProps` | `true` | | |
68
+
69
+ ### Events
70
+
71
+ None.
72
+
73
+ ### v-model
74
+
75
+ None.
76
+
77
+ ### Slots
78
+
79
+ None.
80
+
81
+ ### Exposed (template ref)
82
+
83
+ None.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: SwiperPaginationPrimitive
3
+ status: primitive
4
+ category: Media
5
+ summary: Pagination (bullets or "2 / 8" fraction) for a SwiperRootPrimitive carousel.
6
+ import: @wikicasa-dev/components/generic/carousel/Primitive/SwiperPaginationPrimitive
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # SwiperPaginationPrimitive
11
+
12
+ > **Primitive.** A low-level building block. Prefer a `preferred` component; use primitives only to compose something that doesn't exist yet.
13
+
14
+ Pagination (bullets or "2 / 8" fraction) for a SwiperRootPrimitive carousel.
15
+
16
+ ```ts
17
+ import SwiperPaginationPrimitive from "@wikicasa-dev/components/generic/carousel/Primitive/SwiperPaginationPrimitive";
18
+ ```
19
+
20
+ Adds Swiper pagination to a primitive carousel. Place it inside `SwiperRootPrimitive`, after `SwiperPrimitive`. `options` takes Swiper [pagination options](https://swiperjs.com/swiper-api#pagination) or `true` (default: bullets). `{ type: "fraction" }` renders a bordered white pill with "current / total"; `{ dynamicBullets: true }` keeps many bullets compact. See `SwiperRootPrimitive` for the full composition.
21
+
22
+ ## Usage
23
+
24
+ ```vue
25
+ <script setup lang="ts">
26
+ import SwiperRootPrimitive from "@wikicasa-dev/components/generic/carousel/Primitive/SwiperRootPrimitive";
27
+ import SwiperPrimitive from "@wikicasa-dev/components/generic/carousel/Primitive/SwiperPrimitive";
28
+ import SwiperSlide from "@wikicasa-dev/components/generic/carousel/SwiperSlide";
29
+ import SwiperPaginationPrimitive from "@wikicasa-dev/components/generic/carousel/Primitive/SwiperPaginationPrimitive";
30
+ </script>
31
+
32
+ <template>
33
+ <SwiperRootPrimitive class="photos">
34
+ <SwiperPrimitive>
35
+ <SwiperSlide v-for="n in 5" :key="n"><img :src="`/img/casale-${n}.jpg`" :alt="`Casale in Toscana, foto ${n}`" /></SwiperSlide>
36
+ </SwiperPrimitive>
37
+ <SwiperPaginationPrimitive :options="{ dynamicBullets: true }" />
38
+ </SwiperRootPrimitive>
39
+ </template>
40
+
41
+ <style scoped>
42
+ .photos :deep(.swiper-pagination-bullet-active) { --swiper-pagination-color: rgb(var(--uikit-color-w-primary)); }
43
+ </style>
44
+ ```
45
+
46
+ ## Do / Don't
47
+
48
+ - Do render it unconditionally from the start; it registers with the root while the carousel is created.
49
+ - The active bullet is white by default (made for photos). On light backgrounds override `--swiper-pagination-color`.
50
+ - `class` lands on the `.swiper-pagination` element; e.g. set `--swiper-pagination-bottom` there.
51
+
52
+ ## Styling hooks
53
+
54
+ `--swiper-pagination-color`, `--swiper-pagination-bullet-inactive-color`, `--swiper-pagination-bullet-inactive-opacity`, `--swiper-pagination-bullet-width` / `-height`, `--swiper-pagination-bottom`.
55
+
56
+ ## API
57
+
58
+ _Generated from the component's types. Do not edit by hand._
59
+
60
+ ### Props
61
+
62
+ | Name | Type | Default | Required | Description |
63
+ | --- | --- | --- | --- | --- |
64
+ | `options` | `SwiperPaginationPrimitiveProps` | `true` | | |
65
+
66
+ ### Events
67
+
68
+ None.
69
+
70
+ ### v-model
71
+
72
+ None.
73
+
74
+ ### Slots
75
+
76
+ None.
77
+
78
+ ### Exposed (template ref)
79
+
80
+ None.