@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,92 @@
1
+ ---
2
+ name: BaseBadge
3
+ status: preferred
4
+ category: Feedback
5
+ summary: Small non-interactive label or pill: listing status, "Vetrina", Premium/Gold tiers, tags and counters.
6
+ import: @wikicasa-dev/components/UIKit/BaseBadge
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # BaseBadge
11
+
12
+ Small non-interactive label or pill: listing status, "Vetrina", Premium/Gold tiers, tags and counters.
13
+
14
+ ```ts
15
+ import BaseBadge from "@wikicasa-dev/components/UIKit/BaseBadge";
16
+ ```
17
+
18
+ Use it to tag something with a short status or category, typically over a property card or next to a title. It is a plain `<span>`, not clickable; for a selectable chip use `BaseButton` with a selection variant.
19
+
20
+ Pick the look with `badgeClass` (default `uikit-badge-w-primary-sm`):
21
+
22
+ | `badgeClass` | Looks like | Typical use |
23
+ | --- | --- | --- |
24
+ | `uikit-badge-w-primary-sm` | Small blue pill, white 10px text | Counters, "Nuovo". |
25
+ | `uikit-badge-w-warning` | Yellow, dark text | Highlights such as "Vetrina". |
26
+ | `uikit-badge-w-lavender` | Lavender, dark text, soft shadow | Neutral info tags. |
27
+ | `uikit-badge-w-danger` | Red, white text | Negative states ("Bloccato"). |
28
+ | `uikit-badge-w-dark-primary` | Dark blue background | Date/time stamps, labels over photos. Set the text color yourself (white); it sets none. |
29
+ | `uikit-badge-outline-tag` | Black outline, taller (36px) | Feature tags ("Balcone", "Box auto"). |
30
+ | `uikit-badge-outline-tag-listing` | Black outline on white, 12px text | Compact tags/counters in lists. |
31
+ | `badge-gold` / `badge-silver` | Gold / silver gradient | Listing quality tiers (Gold / Silver). |
32
+ | `badge-black` | Black gradient, white text | "Premium" agencies/listings. |
33
+ | `badge-gray` | Translucent blurred dark, white text | Tags placed over photos. |
34
+
35
+ ## Usage
36
+
37
+ ```vue
38
+ <script setup lang="ts">
39
+ import BaseBadge from "@wikicasa-dev/components/UIKit/BaseBadge";
40
+ </script>
41
+
42
+ <template>
43
+ <div style="position: relative">
44
+ <img src="/mock/bilocale-navigli.jpg" alt="Bilocale ai Navigli" style="width: 100%" />
45
+ <BaseBadge badge-class="uikit-badge-w-warning" style="position: absolute; top: 10px; left: 10px">
46
+ Vetrina
47
+ </BaseBadge>
48
+ </div>
49
+
50
+ <BaseBadge badge-class="badge-black">Premium</BaseBadge>
51
+ <BaseBadge badge-class="uikit-badge-outline-tag">Terrazzo</BaseBadge>
52
+ <BaseBadge badge-class="uikit-badge-w-dark-primary" style="color: #fff">12/03/2026 - 10:30</BaseBadge>
53
+ </template>
54
+ ```
55
+
56
+ ## Do / Don't
57
+
58
+ - Keep the text to one or two words; the badge has a fixed height and does not wrap gracefully.
59
+ - Size and spacing tweaks (height, padding, text size) go in your own `class`/`style`; the variant classes set them too, so a class may need `!important` to win (inline `style` always wins).
60
+ - Don't make it interactive (no click handlers as the only action): it is not focusable and has no role.
61
+
62
+ ## Styling hooks
63
+
64
+ `--badge-text-color` sets the text color of `badge-gold`, `badge-silver`, `badge-black` and `badge-gray`.
65
+
66
+ ## API
67
+
68
+ _Generated from the component's types. Do not edit by hand._
69
+
70
+ ### Props
71
+
72
+ | Name | Type | Default | Required | Description |
73
+ | --- | --- | --- | --- | --- |
74
+ | `badgeClass` | `"uikit-badge-w-primary-sm" \| "uikit-badge-w-warning" \| "uikit-badge-w-lavender" \| "uikit-badge-outline-tag" \| "uikit-badge-outline-tag-listing" \| "uikit-badge-w-dark-primary" \| "uikit-badge-w-danger" \| "badge-black" \| "badge-gray" \| "badge-gold" \| "badge-silver"` | `"uikit-badge-w-primary-sm"` | | |
75
+
76
+ ### Events
77
+
78
+ None.
79
+
80
+ ### v-model
81
+
82
+ None.
83
+
84
+ ### Slots
85
+
86
+ | Name | Slot props |
87
+ | --- | --- |
88
+ | `default` | |
89
+
90
+ ### Exposed (template ref)
91
+
92
+ None.
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: BaseBreadcrumb
3
+ status: preferred
4
+ category: Navigation
5
+ summary: Breadcrumb trail of links separated by arrows, e.g. Home › Vendita › Milano › Navigli.
6
+ import: @wikicasa-dev/components/UIKit/BaseBreadcrumb
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # BaseBreadcrumb
11
+
12
+ Breadcrumb trail of links separated by arrows, e.g. Home › Vendita › Milano › Navigli.
13
+
14
+ ```ts
15
+ import BaseBreadcrumb from "@wikicasa-dev/components/UIKit/BaseBreadcrumb";
16
+ ```
17
+
18
+ Use it at the top of listing, place and detail pages to show where the page sits in the site hierarchy. Pass the trail as `items`, root first; each item is `{ link, label, active?, dataTooltip? }`. The `active` item is shown in blue (normally the last one).
19
+
20
+ ## Usage
21
+
22
+ ```vue
23
+ <script setup lang="ts">
24
+ import BaseBreadcrumb from "@wikicasa-dev/components/UIKit/BaseBreadcrumb";
25
+
26
+ const items = [
27
+ { link: "/", label: "Home" },
28
+ { link: "/vendita-case/lombardia/", label: "Lombardia" },
29
+ { link: "/vendita-case/milano/", label: "Milano" },
30
+ { link: "/vendita-case/milano/navigli/", label: "Navigli", active: true },
31
+ ];
32
+ </script>
33
+
34
+ <template>
35
+ <BaseBreadcrumb :items="items" list-classes="breadcrumb-list" />
36
+ </template>
37
+
38
+ <style>
39
+ .breadcrumb-list { flex-wrap: wrap; font-size: 12px; }
40
+ </style>
41
+ ```
42
+
43
+ ## Do / Don't
44
+
45
+ - Every item needs a non-empty `label`: an item with an empty label is rendered as a separator instead.
46
+ - Long trails: pass a `listClasses` class with `flex-wrap: wrap` so it wraps on mobile instead of overflowing.
47
+ - Customize an item with the `item` slot (receives `item`, including its `idx`) and the arrow with the `separator` slot.
48
+ - `dataTooltip` is only written to the `<li>` as `data-tooltip`; it shows nothing by itself.
49
+
50
+ ## Styling hooks
51
+
52
+ `listClasses` (the `<ol>`, a flex row with 10px gap) and `listItemClasses` (every `<li>`, separators included).
53
+
54
+ ## API
55
+
56
+ _Generated from the component's types. Do not edit by hand._
57
+
58
+ ### Props
59
+
60
+ | Name | Type | Default | Required | Description |
61
+ | --- | --- | --- | --- | --- |
62
+ | `items` | `BreadcrumbItemsType[]` | | yes | |
63
+ | `listClasses` | `ClassTypeProp` | | | |
64
+ | `listItemClasses` | `ClassTypeProp` | | | |
65
+
66
+ ### Events
67
+
68
+ None.
69
+
70
+ ### v-model
71
+
72
+ None.
73
+
74
+ ### Slots
75
+
76
+ | Name | Slot props |
77
+ | --- | --- |
78
+ | `item` | `{ item: BreadcrumbItemsTypeWithIdx; }` |
79
+ | `separator` | |
80
+
81
+ ### Exposed (template ref)
82
+
83
+ None.
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: BaseButton
3
+ status: preferred
4
+ category: Actions
5
+ summary: The standard button: primary/secondary/danger CTAs, light and text-style buttons, selectable chips, loading state.
6
+ import: @wikicasa-dev/components/UIKit/BaseButton
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # BaseButton
11
+
12
+ The standard button: primary/secondary/danger CTAs, light and text-style buttons, selectable chips, loading state.
13
+
14
+ ```ts
15
+ import BaseButton from "@wikicasa-dev/components/UIKit/BaseButton";
16
+ ```
17
+
18
+ Use it for every clickable action that is not navigation. Use a plain `<a>` (or the app's link component) for links to other pages. Use `BaseTabsTrigger` for tabs.
19
+
20
+ The look is chosen with `btnClass` (default `uikit-btn-w-primary`):
21
+
22
+ | `btnClass` | Looks like | Use it for |
23
+ | --- | --- | --- |
24
+ | `uikit-btn-w-primary` | Solid blue, white text | The main action of a view or form ("Cerca", "Contatta l'agenzia"). One per area. |
25
+ | `uikit-btn-w-secondary` | Solid light blue-lavender | Secondary action next to a primary one. |
26
+ | `uikit-btn-w-danger` | Solid red | Destructive/irreversible actions ("Elimina annuncio"). |
27
+ | `uikit-btn-w-warning` | Solid yellow, dark text | Attention-grabbing promos/upsells. Use sparingly. |
28
+ | `uikit-btn-light` | White, blue text | Actions on top of blue or dark backgrounds. |
29
+ | `uikit-btn-show-more` | White, blue text, no radius | "Mostra di più" / expand-list links. |
30
+ | `uikit-btn-transparent` | No background, no padding | Icon-only buttons and text-like buttons. Combine with `:with-min-width="false"`. |
31
+ | `uikit-btn-single-selection` | White, regular weight | One option in a single-choice group (e.g. number of rooms). Set `keepActive` on the selected one. |
32
+ | `uikit-btn-multi-selection` | Light gray, bordered | One option in a multi-choice group (e.g. features). Set `keepActive` on each selected one. |
33
+ | `uikit-btn-facile` | Solid orange | Only for CTAs of the Facile mortgage partner (its brand orange). Not a general-purpose color. |
34
+
35
+ `outlined` gives a white button with a colored border; it is styled only for `uikit-btn-w-primary`, `uikit-btn-w-secondary` and `uikit-btn-w-danger`. `size` is `sm` (36px tall), default (42px) or `lg` (47px).
36
+
37
+ ## Usage
38
+
39
+ ```vue
40
+ <script setup lang="ts">
41
+ import BaseButton from "@wikicasa-dev/components/UIKit/BaseButton";
42
+ import { ref } from "vue";
43
+
44
+ const sending = ref(false);
45
+ const rooms = ref(2);
46
+ </script>
47
+
48
+ <template>
49
+ <BaseButton type="button" :is-loading="sending" @click="sending = true">
50
+ Contatta l'agenzia
51
+ </BaseButton>
52
+ <BaseButton btn-class="uikit-btn-w-primary" outlined size="sm">Salva ricerca</BaseButton>
53
+
54
+ <BaseButton
55
+ v-for="n in [1, 2, 3, 4]"
56
+ :key="n"
57
+ btn-class="uikit-btn-single-selection"
58
+ :keep-active="rooms === n"
59
+ @click="rooms = n"
60
+ >
61
+ {{ n }} locali
62
+ </BaseButton>
63
+
64
+ <BaseButton btn-class="uikit-btn-transparent" :with-min-width="false" aria-label="Chiudi" title="Chiudi">
65
+ ✕
66
+ </BaseButton>
67
+ </template>
68
+ ```
69
+
70
+ ## Do / Don't
71
+
72
+ - Icon-only button: always pass `ariaLabel` (and `title` for a hover hint); the icon alone gives screen readers nothing.
73
+ - Set `type="button"` unless it should submit a form: no `type` is rendered by default, so inside a `<form>` it acts as submit.
74
+ - `isLoading` replaces the content with a spinner and disables the button; don't also swap the label yourself.
75
+ - `btnClass` only accepts the variants above. Put your own layout/spacing classes in `class`, not in `btnClass`.
76
+ - Full-width buttons: add `style="width: 100%"` (or your own class); a min width of 90px applies unless `:with-min-width="false"`.
77
+ - Content with an icon: make the button a flex row (`style="display: flex; align-items: center; gap: 10px"`). The default slot exposes `hover` (boolean) to swap icon colors.
78
+ - Hover colors only change from 576px up; on phones the button keeps its resting colors.
79
+
80
+ ## Styling hooks
81
+
82
+ Each variant sets these CSS custom properties on the button; override them with a more specific selector or inline `style`:
83
+ `--btn-bg-color`, `--btn-text-color`, `--btn-border-color`, `--btn-border-width`, `--btn-border-radius`, `--btn-height`, `--btn-px`, `--btn-py`, `--btn-min-w`, `--btn-font-size`. `uikit-btn-facile` also reads `--btn-facile-color` and `--btn-facile-hover-color`.
84
+
85
+ ## API
86
+
87
+ _Generated from the component's types. Do not edit by hand._
88
+
89
+ ### Props
90
+
91
+ | Name | Type | Default | Required | Description |
92
+ | --- | --- | --- | --- | --- |
93
+ | `btnClass` | `"uikit-btn-w-primary" \| "uikit-btn-w-secondary" \| "uikit-btn-w-warning" \| "uikit-btn-w-danger" \| "uikit-btn-transparent" \| "uikit-btn-light" \| "uikit-btn-show-more" \| "uikit-btn-multi-selection" \| "uikit-btn-single-selection" \| "uikit-btn-facile"` | `"uikit-btn-w-primary"` | | |
94
+ | `outlined` | `boolean` | | | |
95
+ | `size` | `"" \| "lg" \| "sm"` | | | |
96
+ | `withMinWidth` | `boolean` | `true` | | |
97
+ | `keepActive` | `boolean` | | | |
98
+ | `isLoading` | `boolean` | | | |
99
+ | `disabled` | `boolean` | | | |
100
+ | `ariaLabel` | `string` | | | |
101
+ | `title` | `string` | | | Add the title for screen readers when the button consists of just an icon |
102
+ | `dataCy` | `string` | | | |
103
+ | `type` | `HTMLButtonType` | | | |
104
+
105
+ ### Events
106
+
107
+ | Name | Payload |
108
+ | --- | --- |
109
+ | `click` | `[e: MouseEvent]` |
110
+ | `mouseover` | `[e: MouseEvent]` |
111
+ | `keydown` | `[e: KeyboardEvent]` |
112
+ | `mouseout` | `[e: MouseEvent]` |
113
+
114
+ ### v-model
115
+
116
+ None.
117
+
118
+ ### Slots
119
+
120
+ | Name | Slot props |
121
+ | --- | --- |
122
+ | `default` | `{ hover: boolean; }` |
123
+ | `spinner` | |
124
+
125
+ ### Exposed (template ref)
126
+
127
+ | Name | Type |
128
+ | --- | --- |
129
+ | `getRootElement` | `() => HTMLButtonElement \| null` |
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: BaseCard
3
+ status: preferred
4
+ category: Layout
5
+ summary: Image + body card with fixed layouts (default row, mini, vertical, news) for listings, agencies and articles.
6
+ import: @wikicasa-dev/components/UIKit/Card/BaseCard
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # BaseCard
11
+
12
+ Image + body card with fixed layouts (default row, mini, vertical, news) for listings, agencies and articles.
13
+
14
+ ```ts
15
+ import BaseCard from "@wikicasa-dev/components/UIKit/Card/BaseCard";
16
+ ```
17
+
18
+ Use `BaseCard` for any "picture plus text" tile: a property in a list, an agency, a news article. It renders two cells, `.card-img` (the `#card-image` slot) and `.card-body` (the `#card-description` slot), inside a rounded, shadowed, `overflow: hidden` box. Pick the layout with `type`:
19
+
20
+ - `""` (default): horizontal row. From 576px up the card is 240px tall and the image column is at most 300px wide; below 576px the height is `auto`. It stays a row on phones.
21
+ - `"vertical"`: image on top (200px tall), body below. Use for carousels and grids, and for phones.
22
+ - `"mini"`: compact row, max 370×100px, image at most 120×110px. Sidebars, "recently seen" lists.
23
+ - `"news"`: column from 576px up (270px tall, 150px image); a 320×100px row on phones.
24
+
25
+ Need only the image cell, a custom cell order, or extra cells? Compose `CardRootPrimitive` + `CardImagePrimitive` + `CardDescriptionPrimitive` instead.
26
+
27
+ ## Usage
28
+
29
+ ```vue
30
+ <script setup lang="ts">
31
+ import BaseCard from "@wikicasa-dev/components/UIKit/Card/BaseCard";
32
+
33
+ const openListing = () => console.log("open listing 4821");
34
+ </script>
35
+
36
+ <template>
37
+ <BaseCard type="vertical" root-component="article" class="listing-card" @click="openListing">
38
+ <template #card-image>
39
+ <img
40
+ src="/img/trilocale-milano.jpg"
41
+ alt="Trilocale in vendita a Milano, zona Navigli"
42
+ width="640"
43
+ height="360"
44
+ style="width: 100%; height: 100%; object-fit: cover"
45
+ />
46
+ </template>
47
+ <template #card-description>
48
+ <p class="price">€ 385.000</p>
49
+ <h3>Trilocale in Via Vigevano, Milano</h3>
50
+ <p>85 m² · 3 locali · 2° piano</p>
51
+ </template>
52
+ </BaseCard>
53
+ </template>
54
+
55
+ <style scoped>
56
+ .listing-card { background: #fff; cursor: pointer; }
57
+ </style>
58
+ ```
59
+
60
+ ## Do / Don't
61
+
62
+ - Do set a background on the card (`class`): the card itself has none, only a shadow.
63
+ - Do make the image fill its cell (`width/height: 100%; object-fit: cover`); the cell sizes itself, the image doesn't.
64
+ - Do use `root-component="article"` when the card is a self-contained item in a list.
65
+ - Don't nest interactive cards: `click` is emitted from the whole root, so stop propagation on inner buttons/links that must not trigger it.
66
+ - Don't expect the default type to stack on phones; use `type="vertical"` (or a primitive composition) for a stacked mobile layout.
67
+ - `card-img-classes` / `card-body-classes` add classes to the two cells (padding, background, alignment).
68
+
69
+ ## Styling hooks
70
+
71
+ CSS custom properties, declared on `.uikit-card` (the root) unless noted. Override them with a selector stronger than one class, e.g. `.uikit-card.listing-card { --card-height: 300px; }`, or the result depends on stylesheet order.
72
+
73
+ - Root: `--card-width`, `--card-height`, `--card-max-width` (930px), `--card-max-height`, `--card-border-radius-top-left` / `-top-right` / `-bottom-left` / `-bottom-right` (20px each).
74
+ - On `.card-img`: `--card-img-width`, `--card-img-height` (defaults to `--card-height`), `--card-img-max-width`, `--card-img-max-height`; in `vertical` also `--card-vertical-img-height` (200px). Target them as `.uikit-card.listing-card .card-img { … }`.
75
+ - On `.card-body`: `--card-body-width` (100%). Body padding is 10px 15px.
76
+ - Classes on the root: `uikit-card` plus `mini`, `vertical` or `news-card`.
77
+
78
+ ## API
79
+
80
+ _Generated from the component's types. Do not edit by hand._
81
+
82
+ ### Props
83
+
84
+ | Name | Type | Default | Required | Description |
85
+ | --- | --- | --- | --- | --- |
86
+ | `type` | `CardTypes` | `""` | | |
87
+ | `rootComponent` | `CardRootTypes` | `"div"` | | |
88
+ | `cardImgClasses` | `ClassTypeProp` | `""` | | |
89
+ | `cardBodyClasses` | `ClassTypeProp` | `""` | | |
90
+
91
+ ### Events
92
+
93
+ | Name | Payload |
94
+ | --- | --- |
95
+ | `click` | `[MouseEvent]` |
96
+
97
+ ### v-model
98
+
99
+ None.
100
+
101
+ ### Slots
102
+
103
+ | Name | Slot props |
104
+ | --- | --- |
105
+ | `card-image` | |
106
+ | `card-description` | |
107
+
108
+ ### Exposed (template ref)
109
+
110
+ None.
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: BaseComplexToggle
3
+ status: preferred
4
+ category: Selection
5
+ summary: Two-option segmented toggle (pill with a sliding highlight) that picks one of two labelled choices.
6
+ import: @wikicasa-dev/components/UIKit/BaseComplexToggle
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # BaseComplexToggle
11
+
12
+ Two-option segmented toggle (pill with a sliding highlight) that picks one of two labelled choices.
13
+
14
+ ```ts
15
+ import BaseComplexToggle from "@wikicasa-dev/components/UIKit/BaseComplexToggle";
16
+ ```
17
+
18
+ Use to switch between exactly two named modes: "Privato" / "Agenzia", "Tasso variabile" / "Tasso fisso", "Avviso immediato" / "Avviso giornaliero". For an on/off boolean use `BaseToggle`; for three or more options use `RadioButtonGroup`.
19
+
20
+ `labels` holds `leftToggle` and `rightToggle`, each `{ id?, label, icon?, checked?, payload? }`. `v-model` holds the whole active toggle object. On mount it selects the side marked `checked`, otherwise the left one, and emits it right away.
21
+
22
+ ## Usage
23
+
24
+ ```vue
25
+ <script setup lang="ts">
26
+ import { ref } from "vue";
27
+ import BaseComplexToggle from "@wikicasa-dev/components/UIKit/BaseComplexToggle";
28
+ import type { ToggleType } from "@wikicasa-dev/components";
29
+
30
+ const rateType = ref<ToggleType | null>(null);
31
+ </script>
32
+
33
+ <template>
34
+ <BaseComplexToggle
35
+ v-model="rateType"
36
+ data-cy="mortgage-rate-toggle"
37
+ type="padded"
38
+ :labels="{
39
+ leftToggle: { id: 'variabile', label: 'Tasso variabile' },
40
+ rightToggle: { id: 'fisso', label: 'Tasso fisso', checked: true },
41
+ }"
42
+ />
43
+ <p>Hai scelto: {{ rateType?.label }}</p>
44
+ </template>
45
+ ```
46
+
47
+ ## Do / Don't
48
+
49
+ - Do give the two options different `label`s: the active side is matched by label.
50
+ - Do use `type="padded"` for the inset pill highlight (most common), `"full"` (default) for a highlight that fills the half.
51
+ - Do use `size="lg"` (342×56px) for prominent page-level choices; default is 230×42px. `mode="mobile"` widens it to 342px below the `sm` breakpoint.
52
+ - Do pick the highlight color with `btnBgColor` (`uikit-bg-w-primary`, `uikit-bg-w-dark-primary`, `uikit-bg-w-lavender` default, …); text turns white on dark colors automatically.
53
+ - Do set the initial side with `checked: true` in `labels`, not by pre-filling `v-model`.
54
+ - Don't rely on it for keyboard-only users: the halves are clickable `div`s, not buttons. Offer another control if keyboard access matters.
55
+ - Don't use more than two options.
56
+
57
+ ## Styling hooks
58
+
59
+ - `.base-complex-toggle`: `--base-complex-toggle-width`, `--base-complex-toggle-height`, `--base-complex-toggle-radius`, `--base-complex-toggle-border-width`, `--base-complex-toggle-border-color`, `--padding-x-bg` / `--padding-y-bg` (inset of the padded highlight).
60
+ - `.base-complex-toggle-active { --base-complex-toggle-active-color }`: text color of the active side.
61
+ - `btnClasses` styles the sliding highlight (e.g. a custom background); `left_icon` / `right_icon` slots replace the optional `icon` images.
62
+
63
+ ## API
64
+
65
+ _Generated from the component's types. Do not edit by hand._
66
+
67
+ ### Props
68
+
69
+ | Name | Type | Default | Required | Description |
70
+ | --- | --- | --- | --- | --- |
71
+ | `labels` | `ComplexToggleType<TID, TPayload>` | | yes | |
72
+ | `type` | `"full" \| "padded"` | `"full"` | | |
73
+ | `mode` | `"" \| "mobile"` | `""` | | |
74
+ | `btnBgColor` | `BtnBgColorType` | `"uikit-bg-w-lavender"` | | |
75
+ | `btnClasses` | `ClassTypeProp` | | | |
76
+ | `borderContainerColor` | `"uikit-border-w-black" \| "uikit-border-w-primary" \| "uikit-border-w-secondary" \| "uikit-border-w-dark-primary" \| "uikit-border-w-carbon" \| "uikit-border-w-gray" \| "uikit-border-w-warning" \| "uikit-border-w-danger" \| "uikit-border-w-lavender"` | `"uikit-border-w-secondary"` | | |
77
+ | `size` | `"" \| "lg"` | `""` | | |
78
+ | `modelValue` | `Nullable<ToggleType<TID, TPayload>>` | `null` | | |
79
+
80
+ ### Events
81
+
82
+ | Name | Payload |
83
+ | --- | --- |
84
+ | `update:modelValue` | `[value: Nullable<ToggleType<TID, TPayload>> \| undefined]` |
85
+
86
+ ### v-model
87
+
88
+ - `v-model` binds `modelValue` (`Nullable<ToggleType<TID, TPayload>>`)
89
+
90
+ ### Slots
91
+
92
+ | Name | Slot props |
93
+ | --- | --- |
94
+ | `left_icon` | |
95
+ | `right_icon` | |
96
+
97
+ ### Exposed (template ref)
98
+
99
+ None.
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: BaseDropDown
3
+ status: preferred
4
+ category: Overlays
5
+ summary: Toggle button with an attached dropdown panel for menus, link lists and custom filter content.
6
+ import: @wikicasa-dev/components/UIKit/BaseDropDown
7
+ version: 2.10.0-alpha.0
8
+ ---
9
+
10
+ # BaseDropDown
11
+
12
+ Toggle button with an attached dropdown panel for menus, link lists and custom filter content.
13
+
14
+ ```ts
15
+ import BaseDropDown from "@wikicasa-dev/components/UIKit/BaseDropDown";
16
+ ```
17
+
18
+ Use for anything that opens a panel under (or above) a trigger: a language switcher, a user menu, a "more actions" menu on a listing card, a breadcrumb sub-menu, or a panel of custom filter controls. It handles open/close, outside click, Escape and arrow-key navigation. To choose a form value use `AccessibleSelect` (built on this component) instead.
19
+
20
+ The default trigger is a button showing `btnLabel` (plus a chevron with `withArrowIcon`). Replace it via the `btn_slot` slot and call `toggleDropdown()` yourself. Panel content goes in the default slot; its slot props are `isOpen`, `toggleDropdown`, `activeIdx`, `selectedIdx`, `setActiveIdx`, `setSelectedIdx`.
21
+
22
+ ## Usage
23
+
24
+ ```vue
25
+ <script setup lang="ts">
26
+ import BaseDropDown from "@wikicasa-dev/components/UIKit/BaseDropDown";
27
+ import SelectItem from "@wikicasa-dev/components/UIKit/BaseSelect/SelectItem";
28
+
29
+ const cities = [
30
+ { label: "Milano", href: "/vendita-case/milano" },
31
+ { label: "Roma", href: "/vendita-case/roma" },
32
+ { label: "Torino", href: "/vendita-case/torino" },
33
+ ];
34
+ </script>
35
+
36
+ <template>
37
+ <BaseDropDown btn-label="Città vicine" with-arrow-icon dropdown-element="ul">
38
+ <template #default="{ activeIdx, setActiveIdx, toggleDropdown }">
39
+ <SelectItem
40
+ v-for="(city, idx) in cities"
41
+ :key="city.href"
42
+ :idx="idx"
43
+ :active="activeIdx === idx"
44
+ @mouseover="setActiveIdx(idx)"
45
+ @click="toggleDropdown()"
46
+ >
47
+ <a :href="city.href">{{ city.label }}</a>
48
+ </SelectItem>
49
+ </template>
50
+ </BaseDropDown>
51
+ </template>
52
+ ```
53
+
54
+ ## Do / Don't
55
+
56
+ - Do use `dropdown-element="ul"` with `<li>` children (`SelectItem`) for lists; arrow keys move `activeIdx` over the panel's direct children, and Enter clicks the `<a>` inside the active one.
57
+ - Do keep `activateKeyboardController` on for menus; pass `:close-keys="['Escape']"` when the panel contains inputs, so Enter doesn't close it.
58
+ - Do set `direction="up"` when the trigger sits near the bottom of the screen (e.g. footer language switcher).
59
+ - Do use `v-model:open` to control or observe the open state; `keepState` (`"opened"` / `"closed"`) locks it.
60
+ - Do give a custom `btn_slot` trigger a real `<button>` with an `aria-label` (if icon-only) and `:aria-expanded="isOpen"`.
61
+ - Don't use it as a modal or tooltip; it is positioned inline under the trigger (`isAbsolute`), not portaled.
62
+
63
+ ## Styling hooks
64
+
65
+ - `.uikit-dropdown-content` (the panel): `--dropdown-max-height` (`220px`), `--dropdown-min-width` (`90px`), `--dropdown-border-color`, `--dropdown-border-{top,right,bottom,left}-width`, `--dropdown-border-{top-left,top-right,bottom-left,bottom-right}-radius`. It also carries `data-side="up|down"`.
66
+ - `class` styles the root; `btnClasses` / `labelClasses` the default trigger; `dropdownClasses` the panel (z-index, width, offset); `arrowWidth` / `arrowStrokeColor` the chevron.
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
+ | `dropdownAttrs` | `Record<string, unknown>` | | | |
77
+ | `dropdownClasses` | `ClassTypeProp` | `""` | | |
78
+ | `btnClasses` | `ClassTypeProp` | `""` | | |
79
+ | `withArrowIcon` | `boolean` | `false` | | |
80
+ | `btnLabel` | `string` | `""` | | |
81
+ | `labelClasses` | `ClassTypeProp` | `""` | | |
82
+ | `direction` | `"down" \| "up"` | `"down"` | | |
83
+ | `arrowWidth` | `number` | `12` | | |
84
+ | `arrowStrokeColor` | ``#${string}`` | `undefined` | | |
85
+ | `isAbsolute` | `boolean` | `true` | | |
86
+ | `closeWhenClickedOutside` | `boolean` | `true` | | |
87
+ | `dropdownElement` | `"div" \| "ol" \| "ul"` | `"div"` | | |
88
+ | `keepState` | `"" \| "closed" \| "opened"` | `""` | | |
89
+ | `activateKeyboardController` | `boolean` | `true` | | |
90
+ | `closeKeys` | `false \| string[]` | `["Escape", "Enter"]` | | List of keys that will close the dropdown. |
91
+ | `dataCy` | `string` | `""` | | |
92
+ | `resetKeyboardController` | `boolean` | `false` | | |
93
+ | `open` | `boolean` | `false` | | |
94
+
95
+ ### Events
96
+
97
+ | Name | Payload |
98
+ | --- | --- |
99
+ | `click` | |
100
+ | `update:open` | `[value: boolean]` |
101
+ | `update:resetKeyboardController` | `[value: boolean]` |
102
+
103
+ ### v-model
104
+
105
+ - `v-model:resetKeyboardController` (`boolean`)
106
+ - `v-model:open` (`boolean`)
107
+
108
+ ### Slots
109
+
110
+ | Name | Slot props |
111
+ | --- | --- |
112
+ | `btn_slot` | `{ toggleDropdown: () => void; isOpen: boolean; activeIdx: number; setActiveIdx: (idx?: Nullable<number> \| undefined) => void; setSelectedIdx: (idx?: Nullable<number> \| undefined) => void; }` |
113
+ | `default` | `{ isOpen: boolean; toggleDropdown: () => void; activeIdx: number; selectedIdx: number; setActiveIdx: (idx?: Nullable<number> \| undefined) => void; setSelectedIdx: (idx?: Nullable<number> \| undefined) => void; }` |
114
+
115
+ ### Exposed (template ref)
116
+
117
+ | Name | Type |
118
+ | --- | --- |
119
+ | `activeIdx` | `number` |
120
+ | `selectedIdx` | `number` |
121
+ | `getRootElement` | `() => HTMLDivElement \| null` |
122
+ | `getContentElement` | `() => HTMLElement \| null` |