@wikicasa-dev/components 2.9.1 → 2.10.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 +9 -8
  95. /package/dist/assets/{swiper-thumbs.css → swiper-autoplay.css} +0 -0
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: BaseTabsTrigger
3
+ status: preferred
4
+ category: Navigation
5
+ summary: A single tab button inside BaseTabsList; activates the BaseTabsContent with the same value.
6
+ import: @wikicasa-dev/components/UIKit/Tab/v2/BaseTabsTrigger
7
+ version: 2.10.0
8
+ ---
9
+
10
+ # BaseTabsTrigger
11
+
12
+ A single tab button inside BaseTabsList; activates the BaseTabsContent with the same value.
13
+
14
+ ```ts
15
+ import BaseTabsTrigger from "@wikicasa-dev/components/UIKit/Tab/v2/BaseTabsTrigger";
16
+ ```
17
+
18
+ Part of the `BaseTabs` compound component: see the `BaseTabs` doc for the full composition. `value` (string or number) is required and must match a `BaseTabsContent` (or a computed panel value).
19
+
20
+ ## Usage
21
+
22
+ ```vue
23
+ <script setup lang="ts">
24
+ import BaseTabsTrigger from "@wikicasa-dev/components/UIKit/Tab/v2/BaseTabsTrigger";
25
+ </script>
26
+
27
+ <template>
28
+ <!-- inside <BaseTabs><BaseTabsList> -->
29
+ <BaseTabsTrigger value="affitto" style="white-space: nowrap">Affitto</BaseTabsTrigger>
30
+ </template>
31
+ ```
32
+
33
+ ## Do / Don't
34
+
35
+ - Default look: white background, 4px padding, 16px text, semibold when active. On a non-white container override it (`style="background: transparent"` or a class with `!important`).
36
+ - Style the active state with a `[data-state="active"]` selector; inactive triggers have `data-state="inactive"`.
37
+ - `disabled` makes the tab unselectable but has no UIKit styling; add your own via the `[data-disabled]` attribute.
38
+ - Keep labels short (one or two words); icons go in the default slot next to the text.
39
+
40
+ ## API
41
+
42
+ _Generated from the component's types. Do not edit by hand._
43
+
44
+ ### Props
45
+
46
+ | Name | Type | Default | Required | Description |
47
+ | --- | --- | --- | --- | --- |
48
+ | `dataCy` | `string` | | | |
49
+ | `value` | `T` | | yes | |
50
+ | `disabled` | `boolean` | | | When `true`, prevents the user from interacting with the tab. |
51
+ | `asChild` | `boolean` | | | Change the default rendered element for the one passed as a child, merging their props and behavior. Read our [Composition](https://www.reka-ui.com/docs/guides/composition) guide for more details. |
52
+ | `as` | `AsTag \| Component` | | | The element or component this component should render as. Can be overwritten by `asChild`. |
53
+
54
+ ### Events
55
+
56
+ None.
57
+
58
+ ### v-model
59
+
60
+ None.
61
+
62
+ ### Slots
63
+
64
+ | Name | Slot props |
65
+ | --- | --- |
66
+ | `default` | |
67
+
68
+ ### Exposed (template ref)
69
+
70
+ None.
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: BaseTextarea
3
+ status: preferred
4
+ category: Forms
5
+ summary: Multi-line text field with floating label and validation state, matching BaseInput's look.
6
+ import: @wikicasa-dev/components/UIKit/BaseTextarea
7
+ version: 2.10.0
8
+ ---
9
+
10
+ # BaseTextarea
11
+
12
+ Multi-line text field with floating label and validation state, matching BaseInput's look.
13
+
14
+ ```ts
15
+ import BaseTextarea from "@wikicasa-dev/components/UIKit/BaseTextarea";
16
+ ```
17
+
18
+ Use for free-text messages: contact-the-agency forms, listing descriptions, personal notes on a property. For a single line use `BaseInput`.
19
+
20
+ Only these attributes reach the `<textarea>`: `id`, `data-cy`, `rows`, `disabled`, `readonly`, plus `required` (adds the label asterisk). `class` styles the textarea itself; `wrapper-classes` styles the outer wrapper.
21
+
22
+ ## Usage
23
+
24
+ ```vue
25
+ <script setup lang="ts">
26
+ import { computed, ref } from "vue";
27
+ import BaseTextarea from "@wikicasa-dev/components/UIKit/BaseTextarea";
28
+
29
+ const message = ref("");
30
+ const tooShort = computed(() => message.value.length > 0 && message.value.length < 20);
31
+ </script>
32
+
33
+ <template>
34
+ <BaseTextarea
35
+ id="contact-agency-message"
36
+ v-model="message"
37
+ label-text="Messaggio per l'agenzia"
38
+ rows="5"
39
+ required
40
+ :is-valid="tooShort ? false : null"
41
+ :feedback="{ invalid: 'Scrivi almeno 20 caratteri' }"
42
+ />
43
+ </template>
44
+ ```
45
+
46
+ ## Do / Don't
47
+
48
+ - Do always pass an `id`: the textarea gets no generated id, and without one the floating label is not linked to it.
49
+ - Do always set `labelText`; it starts inline and floats when the field is focused or filled.
50
+ - Do use `isValid` as tri-state: `null` neutral, `true` blue, `false` red. `feedback.valid` / `feedback.invalid` show only in the matching state; pass a single string (HTML allowed).
51
+ - Do set `resize` to let the user resize the box vertically; it is off by default.
52
+ - Don't pass `placeholder`, `maxlength` or `name`: they are not forwarded to the textarea. Enforce length limits in your own logic.
53
+ - Don't expect `required` to block submit: it is visual only.
54
+
55
+ ## Styling hooks
56
+
57
+ - `labelClasses` for the floating label; `class` for the textarea (padding, height); `wrapper-classes` for spacing around the field.
58
+ - Exposed methods for read-only "edit on focus" note patterns: `disableTextarea()`, `focusDisabledTextarea()`, `clearTextareaElem()`.
59
+
60
+ ## API
61
+
62
+ _Generated from the component's types. Do not edit by hand._
63
+
64
+ ### Props
65
+
66
+ | Name | Type | Default | Required | Description |
67
+ | --- | --- | --- | --- | --- |
68
+ | `labelText` | `string` | `""` | | |
69
+ | `feedback` | `FeedbackLabels` | | | |
70
+ | `isValid` | `Nullable<boolean>` | `null` | | |
71
+ | `resize` | `boolean` | `false` | | |
72
+ | `labelClasses` | `ClassTypeProp` | | | |
73
+ | `modelValue` | `string` | `""` | | |
74
+
75
+ ### Events
76
+
77
+ | Name | Payload |
78
+ | --- | --- |
79
+ | `update:modelValue` | `[value: string \| undefined]` |
80
+ | `click` | `[MouseEvent]` |
81
+ | `keydown` | `[KeyboardEvent]` |
82
+ | `focusin` | |
83
+ | `focusout` | |
84
+
85
+ ### v-model
86
+
87
+ - `v-model` binds `modelValue` (`string`)
88
+
89
+ ### Slots
90
+
91
+ None.
92
+
93
+ ### Exposed (template ref)
94
+
95
+ | Name | Type |
96
+ | --- | --- |
97
+ | `disableTextarea` | `() => void` |
98
+ | `clearTextareaElem` | `() => void` |
99
+ | `focusDisabledTextarea` | `() => void` |
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: BaseToggle
3
+ status: preferred
4
+ category: Forms
5
+ summary: On/off switch bound to a boolean, with a label on the left or right.
6
+ import: @wikicasa-dev/components/UIKit/BaseToggle
7
+ version: 2.10.0
8
+ ---
9
+
10
+ # BaseToggle
11
+
12
+ On/off switch bound to a boolean, with a label on the left or right.
13
+
14
+ ```ts
15
+ import BaseToggle from "@wikicasa-dev/components/UIKit/BaseToggle";
16
+ ```
17
+
18
+ Use for a yes/no setting that applies immediately or a boolean property feature: "Balcone", "Cantina", "Giardino privato", "Ricevi avvisi via email". For choosing between two named options (e.g. "Privato" / "Agenzia") use `BaseComplexToggle`; for a consent or a choice that's submitted with a form use `CheckboxBtn`.
19
+
20
+ `v-model` is a boolean. The text comes from the `label` prop (rendered on the right, HTML allowed), or from the `leftLabel` / `rightLabel` slots. With `leftLabel` the right label is not rendered.
21
+
22
+ ## Usage
23
+
24
+ ```vue
25
+ <script setup lang="ts">
26
+ import { ref } from "vue";
27
+ import BaseToggle from "@wikicasa-dev/components/UIKit/BaseToggle";
28
+
29
+ const hasBalcony = ref(false);
30
+ const hasCellar = ref(true);
31
+ </script>
32
+
33
+ <template>
34
+ <BaseToggle v-model="hasBalcony" data-cy="toggle-balcony" label="Balcone" />
35
+
36
+ <!-- Label on the left, switch pushed to the right edge of the row -->
37
+ <BaseToggle v-model="hasCellar" data-cy="toggle-cellar" style="justify-content: space-between">
38
+ <template #leftLabel>
39
+ <span>Cantina</span>
40
+ </template>
41
+ </BaseToggle>
42
+ </template>
43
+ ```
44
+
45
+ ## Do / Don't
46
+
47
+ - Do always show visible text next to the switch (via `label` or a slot): the switch itself carries no accessible name, so the adjacent text is all users get.
48
+ - Do use it for settings that take effect right away; use a checkbox when the value is only applied on submit.
49
+ - Don't put the label in both slots; only one side is rendered.
50
+ - Don't pass `aria-label` expecting it on the switch: attributes land on the wrapper `<div>`.
51
+
52
+ ## Styling hooks
53
+
54
+ - `class` / `style` go on the flex row wrapping label and switch (gap 8px); use them for layout such as `justify-content: space-between`.
55
+ - The switch is a `button` with `data-state="checked|unchecked"`; the checked track uses the primary color, unchecked the light (`w-cultured`) one.
56
+
57
+ ## API
58
+
59
+ _Generated from the component's types. Do not edit by hand._
60
+
61
+ ### Props
62
+
63
+ | Name | Type | Default | Required | Description |
64
+ | --- | --- | --- | --- | --- |
65
+ | `label` | `string` | | | |
66
+ | `dataCy` | `string` | | | |
67
+ | `modelValue` | `Optional<boolean>` | `false` | | |
68
+
69
+ ### Events
70
+
71
+ | Name | Payload |
72
+ | --- | --- |
73
+ | `update:modelValue` | `[value: Optional<boolean>]` |
74
+
75
+ ### v-model
76
+
77
+ - `v-model` binds `modelValue` (`Optional<boolean>`)
78
+
79
+ ### Slots
80
+
81
+ | Name | Slot props |
82
+ | --- | --- |
83
+ | `leftLabel` | |
84
+ | `rightLabel` | |
85
+
86
+ ### Exposed (template ref)
87
+
88
+ None.
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: BaseTooltip
3
+ status: preferred
4
+ category: Overlays
5
+ summary: CSS hover tooltip with an arrow, opening below a trigger (e.g. an info icon) to explain a value.
6
+ import: @wikicasa-dev/components/UIKit/BaseTooltip
7
+ version: 2.10.0
8
+ ---
9
+
10
+ # BaseTooltip
11
+
12
+ CSS hover tooltip with an arrow, opening below a trigger (e.g. an info icon) to explain a value.
13
+
14
+ ```ts
15
+ import BaseTooltip from "@wikicasa-dev/components/UIKit/BaseTooltip";
16
+ ```
17
+
18
+ Use it for a short explanation attached to a small trigger, typically an "i" icon next to a price estimate or a label. It opens on mouse hover only (pure CSS, no JavaScript positioning), so it is a desktop affordance: keep the information available elsewhere for touch and keyboard users. For longer content or anything interactive, use `BaseModal`.
19
+
20
+ ## Usage
21
+
22
+ ```vue
23
+ <script setup lang="ts">
24
+ import BaseTooltip from "@wikicasa-dev/components/UIKit/BaseTooltip";
25
+ </script>
26
+
27
+ <template>
28
+ <p style="display: flex; align-items: center; gap: 5px">
29
+ Prezzo stimato: 320.000 €
30
+ <BaseTooltip :theme="{ color: 'blue', size: 'md' }">
31
+ <template #trigger>
32
+ <button type="button" aria-label="Come calcoliamo la stima">i</button>
33
+ </template>
34
+ <template #content>
35
+ <p style="margin: 0; padding: 0 10px">
36
+ Stima basata su annunci simili in zona e dati OMI.
37
+ </p>
38
+ </template>
39
+ </BaseTooltip>
40
+ </p>
41
+ </template>
42
+ ```
43
+
44
+ ## Do / Don't
45
+
46
+ - `theme` must be passed whole: `{ color: 'blue' | 'white', size: 'sm' | 'md' | 'lg' }` (default blue / sm). Use `white` on colored backgrounds.
47
+ - Sizes have a fixed width and height (sm 250×65px, md 300×100px, lg 350×130px). Pick the size that fits the text; content does not grow the box.
48
+ - The tooltip always opens below the trigger. `direction` only moves the arrow (`top`, `top-center`, `bottom`, `bottom-center`, `left`, `right`); use `top` or `top-center` to point at the trigger.
49
+ - Fine-tune the box position with `tooltipContentClasses`: a class of your own setting `top`/`left` with `!important`.
50
+ - Make the trigger a real `<button>` with an `aria-label`.
51
+
52
+ ## Styling hooks
53
+
54
+ Set with inline `style` on the component (a class needs to be more specific than `.base-tooltip`, which defines them): `--tooltip-sm-content-width` (md/lg widths derive from it), `--tooltip-sm-height`, `--tooltip-md-height`, `--tooltip-lg-height`, `--tooltip-border-radius`, `--tooltip-blue-bg`, `--tooltip-blue-color`, `--tooltip-white-bg`, `--tooltip-white-color`, `--arrow-left-position`.
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
+ | `theme` | `{ color: "blue" \| "white"; size: "lg" \| "sm" \| "md"; }` | `{ color: "blue", size: "sm", }` | | |
65
+ | `direction` | `"top" \| "bottom" \| "left" \| "right" \| "top-center" \| "bottom-center"` | `"top"` | | |
66
+ | `customTooltipClass` | `"" \| "mail-alert"` | `""` | | |
67
+ | `showTooltipContentManually` | `boolean` | `true` | | |
68
+ | `tooltipContentClasses` | `ClassTypeProp` | `""` | | |
69
+
70
+ ### Events
71
+
72
+ None.
73
+
74
+ ### v-model
75
+
76
+ None.
77
+
78
+ ### Slots
79
+
80
+ | Name | Slot props |
81
+ | --- | --- |
82
+ | `trigger` | |
83
+ | `content` | |
84
+
85
+ ### Exposed (template ref)
86
+
87
+ None.
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: BaseUploadFile
3
+ status: preferred
4
+ category: Forms
5
+ summary: Dashed, field-shaped file picker with a floating label that emits the chosen File.
6
+ import: @wikicasa-dev/components/UIKit/BaseUploadFile
7
+ version: 2.10.0
8
+ ---
9
+
10
+ # BaseUploadFile
11
+
12
+ Dashed, field-shaped file picker with a floating label that emits the chosen File.
13
+
14
+ ```ts
15
+ import BaseUploadFile from "@wikicasa-dev/components/UIKit/BaseUploadFile";
16
+ ```
17
+
18
+ Use to attach a single document in a form: a CV in "Lavora con noi", a floor plan or a deed when publishing a listing. The whole field is the click target; its text comes from the `label` slot, which receives the chosen `filename` so you can show it.
19
+
20
+ It does not upload anything: it emits `uploaded` with the `File`, and you handle it. `accept` and `multiple` attributes are forwarded to the hidden `<input type="file">`.
21
+
22
+ ## Usage
23
+
24
+ ```vue
25
+ <script setup lang="ts">
26
+ import { ref } from "vue";
27
+ import BaseUploadFile from "@wikicasa-dev/components/UIKit/BaseUploadFile";
28
+
29
+ const floorPlan = ref<File | null>(null);
30
+ </script>
31
+
32
+ <template>
33
+ <BaseUploadFile
34
+ id="floor-plan-upload"
35
+ label-text="Planimetria"
36
+ accept="application/pdf, image/*"
37
+ :clear="!floorPlan"
38
+ @uploaded="(file) => (floorPlan = file)"
39
+ >
40
+ <template #label="{ filename }">
41
+ <span>{{ filename || "Carica un file (PDF o immagine)" }}</span>
42
+ </template>
43
+ </BaseUploadFile>
44
+ <button v-if="floorPlan" type="button" @click="floorPlan = null">Rimuovi</button>
45
+ </template>
46
+ ```
47
+
48
+ ## Do / Don't
49
+
50
+ - Do pass a unique `id`: it links the clickable area to the hidden file input.
51
+ - Do always fill the `label` slot with a call to action and show `filename` once chosen; the field is empty otherwise.
52
+ - Do reset the shown filename by switching `clear` to `true` (it emits `cleared`); switch it back to `false` before the next reset. Binding `:clear="!file"` does this for you.
53
+ - Don't rely on `multiple`: only the first selected file is emitted.
54
+ - Don't expect validation or error states; show errors next to it yourself.
55
+
56
+ ## Styling hooks
57
+
58
+ - `class` on the wrapper; `labelClasses` on the clickable area (height 48px, centered text).
59
+ - `fieldsetClasses` for the dashed border/background (default lavender fill), `legendClasses`, `floatingLabelClasses` for the floating label.
60
+
61
+ ## API
62
+
63
+ _Generated from the component's types. Do not edit by hand._
64
+
65
+ ### Props
66
+
67
+ | Name | Type | Default | Required | Description |
68
+ | --- | --- | --- | --- | --- |
69
+ | `id` | `string` | | yes | |
70
+ | `labelText` | `string` | `""` | | |
71
+ | `clear` | `boolean` | `false` | | |
72
+ | `labelClasses` | `ClassTypeProp` | `""` | | |
73
+ | `floatingLabelClasses` | `ClassTypeProp` | `""` | | |
74
+ | `fieldsetClasses` | `ClassTypeProp` | `""` | | |
75
+ | `legendClasses` | `ClassTypeProp` | `""` | | |
76
+
77
+ ### Events
78
+
79
+ | Name | Payload |
80
+ | --- | --- |
81
+ | `cleared` | |
82
+ | `uploaded` | `[File]` |
83
+
84
+ ### v-model
85
+
86
+ None.
87
+
88
+ ### Slots
89
+
90
+ | Name | Slot props |
91
+ | --- | --- |
92
+ | `label` | `{ filename: string; }` |
93
+
94
+ ### Exposed (template ref)
95
+
96
+ None.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: CardDescriptionPrimitive
3
+ status: primitive
4
+ category: Layout
5
+ summary: The body cell (.card-body) of a CardRootPrimitive composition, with the card's standard padding.
6
+ import: @wikicasa-dev/components/UIKit/Card/CardDescriptionPrimitive
7
+ version: 2.10.0
8
+ ---
9
+
10
+ # CardDescriptionPrimitive
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
+ The body cell (.card-body) of a CardRootPrimitive composition, with the card's standard padding.
15
+
16
+ ```ts
17
+ import CardDescriptionPrimitive from "@wikicasa-dev/components/UIKit/Card/CardDescriptionPrimitive";
18
+ ```
19
+
20
+ The `.card-body` cell of a card built with `CardRootPrimitive`: full width, 10px 15px padding, any content. See `CardRootPrimitive` for the full composition.
21
+
22
+ ## Usage
23
+
24
+ ```vue
25
+ <script setup lang="ts">
26
+ import CardRootPrimitive from "@wikicasa-dev/components/UIKit/Card/CardRootPrimitive";
27
+ import CardDescriptionPrimitive from "@wikicasa-dev/components/UIKit/Card/CardDescriptionPrimitive";
28
+ </script>
29
+
30
+ <template>
31
+ <CardRootPrimitive class="note-card">
32
+ <CardDescriptionPrimitive>
33
+ <h3>Valutazione gratuita</h3>
34
+ <p>Scopri in 2 minuti quanto vale la tua casa a Bologna.</p>
35
+ </CardDescriptionPrimitive>
36
+ </CardRootPrimitive>
37
+ </template>
38
+ ```
39
+
40
+ ## Do / Don't
41
+
42
+ - Do use it only inside `CardRootPrimitive`; its padding and width come from the card stylesheet the root loads.
43
+ - Add spacing/alignment with your own `class`; don't wrap it in extra elements that break the card's flex layout.
44
+
45
+ ## Styling hooks
46
+
47
+ `--card-body-width` (default 100%), set on `.card-body`.
48
+
49
+ ## API
50
+
51
+ _Generated from the component's types. Do not edit by hand._
52
+
53
+ ### Props
54
+
55
+ None.
56
+
57
+ ### Events
58
+
59
+ None.
60
+
61
+ ### v-model
62
+
63
+ None.
64
+
65
+ ### Slots
66
+
67
+ | Name | Slot props |
68
+ | --- | --- |
69
+ | `default` | |
70
+
71
+ ### Exposed (template ref)
72
+
73
+ None.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: CardImagePrimitive
3
+ status: primitive
4
+ category: Layout
5
+ summary: The image cell (.card-img) of a CardRootPrimitive composition, sized by the card type.
6
+ import: @wikicasa-dev/components/UIKit/Card/CardImagePrimitive
7
+ version: 2.10.0
8
+ ---
9
+
10
+ # CardImagePrimitive
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
+ The image cell (.card-img) of a CardRootPrimitive composition, sized by the card type.
15
+
16
+ ```ts
17
+ import CardImagePrimitive from "@wikicasa-dev/components/UIKit/Card/CardImagePrimitive";
18
+ ```
19
+
20
+ The `.card-img` cell of a card built with `CardRootPrimitive`. Its size comes from the card's `type` and the `--card-img-*` custom properties (at most 300px wide from 576px up in the default layout, 200px tall in `vertical`, 120×110px in `mini`). See `CardRootPrimitive` for the full composition.
21
+
22
+ ## Usage
23
+
24
+ ```vue
25
+ <script setup lang="ts">
26
+ import CardRootPrimitive from "@wikicasa-dev/components/UIKit/Card/CardRootPrimitive";
27
+ import CardImagePrimitive from "@wikicasa-dev/components/UIKit/Card/CardImagePrimitive";
28
+ </script>
29
+
30
+ <template>
31
+ <CardRootPrimitive type="mini">
32
+ <CardImagePrimitive>
33
+ <img src="/img/bilocale-torino.jpg" alt="Bilocale a Torino" style="width: 100%; height: 100%; object-fit: cover" />
34
+ </CardImagePrimitive>
35
+ </CardRootPrimitive>
36
+ </template>
37
+ ```
38
+
39
+ ## Do / Don't
40
+
41
+ - Do use it only inside `CardRootPrimitive` (it gets the card type and styles from there).
42
+ - Do make the content fill the cell (`width/height: 100%; object-fit: cover`).
43
+ - Add `position: relative` to the cell (via `class`) when you overlay badges or buttons on the image.
44
+
45
+ ## Styling hooks
46
+
47
+ `--card-img-width`, `--card-img-height`, `--card-img-max-width`, `--card-img-max-height` (and `--card-vertical-img-height` in `vertical`), set on `.card-img`. Target them as `.uikit-card.my-card .card-img { … }`.
48
+
49
+ ## API
50
+
51
+ _Generated from the component's types. Do not edit by hand._
52
+
53
+ ### Props
54
+
55
+ None.
56
+
57
+ ### Events
58
+
59
+ None.
60
+
61
+ ### v-model
62
+
63
+ None.
64
+
65
+ ### Slots
66
+
67
+ | Name | Slot props |
68
+ | --- | --- |
69
+ | `default` | |
70
+
71
+ ### Exposed (template ref)
72
+
73
+ None.
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: CardRootPrimitive
3
+ status: primitive
4
+ category: Layout
5
+ summary: Card shell (rounded, shadowed root with the BaseCard layouts) to compose with CardImagePrimitive and CardDescriptionPrimitive.
6
+ import: @wikicasa-dev/components/UIKit/Card/CardRootPrimitive
7
+ version: 2.10.0
8
+ ---
9
+
10
+ # CardRootPrimitive
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
+ Card shell (rounded, shadowed root with the BaseCard layouts) to compose with CardImagePrimitive and CardDescriptionPrimitive.
15
+
16
+ ```ts
17
+ import CardRootPrimitive from "@wikicasa-dev/components/UIKit/Card/CardRootPrimitive";
18
+ ```
19
+
20
+ The root of the card primitives. It renders the same `.uikit-card` box as `BaseCard` (same `type` layouts and `--card-*` custom properties, see BaseCard) but takes free content in its default slot. Use it when `BaseCard`'s fixed "image cell + body cell" doesn't fit: an image-only tile, a skeleton that must match a real card's geometry, a third cell, or a body that comes first.
21
+
22
+ The parts:
23
+
24
+ - `CardRootPrimitive`: the box. `type` sets the layout (`""`, `"mini"`, `"vertical"`, `"news"`) and is passed down to the image cell; `as` picks `div` or `article`; emits `click`. It also loads the card stylesheet for its parts.
25
+ - `CardImagePrimitive`: the `.card-img` cell, sized by the card type.
26
+ - `CardDescriptionPrimitive`: the `.card-body` cell (100% wide, 10px 15px padding).
27
+
28
+ Prefer `BaseCard` when the plain image + body layout is enough.
29
+
30
+ ## Usage
31
+
32
+ ```vue
33
+ <script setup lang="ts">
34
+ import CardRootPrimitive from "@wikicasa-dev/components/UIKit/Card/CardRootPrimitive";
35
+ import CardImagePrimitive from "@wikicasa-dev/components/UIKit/Card/CardImagePrimitive";
36
+ import CardDescriptionPrimitive from "@wikicasa-dev/components/UIKit/Card/CardDescriptionPrimitive";
37
+ </script>
38
+
39
+ <template>
40
+ <CardRootPrimitive as="article" class="agency-card">
41
+ <CardImagePrimitive class="agency-card__img">
42
+ <img src="/img/agenzia-roma.jpg" alt="Vetrina dell'agenzia Casa Roma Centro" />
43
+ </CardImagePrimitive>
44
+ <CardDescriptionPrimitive>
45
+ <h3>Casa Roma Centro</h3>
46
+ <p>Via del Corso 112, Roma · 48 immobili in vendita</p>
47
+ </CardDescriptionPrimitive>
48
+ </CardRootPrimitive>
49
+ </template>
50
+
51
+ <style scoped>
52
+ .agency-card { background: #fff; }
53
+ .agency-card__img { position: relative; flex-shrink: 0; }
54
+ .agency-card__img img { width: 100%; height: 100%; object-fit: cover; }
55
+ </style>
56
+ ```
57
+
58
+ ## Do / Don't
59
+
60
+ - Do place `CardImagePrimitive` / `CardDescriptionPrimitive` directly inside `CardRootPrimitive`: the image cell reads the card `type` from it, and the card stylesheet is loaded by the root only.
61
+ - Do set a background on the root; the card has only a shadow.
62
+ - Do reuse these primitives for a loading skeleton of a card (cells filled with `BaseShimmerLoader`), so the skeleton gets the exact same geometry.
63
+ - Don't change `type` expecting the image cell to follow at runtime: it's handed down once when the card is created.
64
+ - The root is a flex row (column for `vertical`); stack it on phones with your own `flex-direction` or use `type="vertical"`.
65
+
66
+ ## Styling hooks
67
+
68
+ Same as `BaseCard`: `--card-width`, `--card-height`, `--card-max-width`, `--card-max-height`, `--card-border-radius-*` on the root; `--card-img-width`, `--card-img-height`, `--card-img-max-width`, `--card-img-max-height` on `.card-img`; `--card-body-width` on `.card-body`. Override with a selector stronger than one class, e.g. `.uikit-card.agency-card`.
69
+
70
+ ## API
71
+
72
+ _Generated from the component's types. Do not edit by hand._
73
+
74
+ ### Props
75
+
76
+ | Name | Type | Default | Required | Description |
77
+ | --- | --- | --- | --- | --- |
78
+ | `type` | `CardTypes` | `""` | | |
79
+ | `as` | `CardRootTypes` | `"div"` | | |
80
+
81
+ ### Events
82
+
83
+ | Name | Payload |
84
+ | --- | --- |
85
+ | `click` | `[MouseEvent]` |
86
+
87
+ ### v-model
88
+
89
+ None.
90
+
91
+ ### Slots
92
+
93
+ | Name | Slot props |
94
+ | --- | --- |
95
+ | `default` | |
96
+
97
+ ### Exposed (template ref)
98
+
99
+ None.