@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.
- package/dist/UIKit/BaseSnackbar.vue.js +1 -1
- package/dist/assets/AccessibleSelect.css +1 -1
- package/dist/assets/BaseBadge.css +1 -1
- package/dist/assets/BaseComplexToggle2.css +1 -1
- package/dist/assets/BaseDropDown.css +1 -1
- package/dist/assets/BaseFloatingLabel2.css +1 -1
- package/dist/assets/BaseSlider2.css +1 -1
- package/dist/assets/BaseSnackbar.css +1 -1
- package/dist/assets/BaseTabs.css +1 -1
- package/dist/assets/BaseTextarea2.css +1 -1
- package/dist/assets/BaseTooltip2.css +1 -1
- package/dist/assets/baseAlert.css +1 -1
- package/dist/assets/baseComplexToggle.css +1 -1
- package/dist/assets/baseFloatingLabel.css +1 -1
- package/dist/assets/baseSlider.css +1 -1
- package/dist/assets/baseTextarea.css +1 -1
- package/dist/assets/baseTooltip.css +1 -1
- package/dist/assets/tailwind.css +1 -1
- package/dist/assets/tokens.css +1 -0
- package/dist/docs/AccessibleSelect.md +121 -0
- package/dist/docs/AccordionContentPrimitive.md +70 -0
- package/dist/docs/AccordionHeaderPrimitive.md +70 -0
- package/dist/docs/AccordionItemPrimitive.md +98 -0
- package/dist/docs/AccordionTriggerPrimitive.md +71 -0
- package/dist/docs/BaseAccordion.md +98 -0
- package/dist/docs/BaseAccordionItem.md +100 -0
- package/dist/docs/BaseAlert.md +83 -0
- package/dist/docs/BaseAutocomplete.md +125 -0
- package/dist/docs/BaseBadge.md +92 -0
- package/dist/docs/BaseBreadcrumb.md +83 -0
- package/dist/docs/BaseButton.md +129 -0
- package/dist/docs/BaseCard.md +110 -0
- package/dist/docs/BaseComplexToggle.md +99 -0
- package/dist/docs/BaseDropDown.md +122 -0
- package/dist/docs/BaseFloatingLabel.md +89 -0
- package/dist/docs/BaseInput.md +130 -0
- package/dist/docs/BaseModal.md +129 -0
- package/dist/docs/BasePagination.md +109 -0
- package/dist/docs/BaseShimmerLoader.md +86 -0
- package/dist/docs/BaseSlider.md +87 -0
- package/dist/docs/BaseSnackbar.md +120 -0
- package/dist/docs/BaseTab.md +84 -0
- package/dist/docs/BaseTabView.md +90 -0
- package/dist/docs/BaseTabs.md +116 -0
- package/dist/docs/BaseTabsContent.md +71 -0
- package/dist/docs/BaseTabsIndicator.md +73 -0
- package/dist/docs/BaseTabsList.md +76 -0
- package/dist/docs/BaseTabsTrigger.md +70 -0
- package/dist/docs/BaseTextarea.md +99 -0
- package/dist/docs/BaseToggle.md +88 -0
- package/dist/docs/BaseTooltip.md +87 -0
- package/dist/docs/BaseUploadFile.md +96 -0
- package/dist/docs/CardDescriptionPrimitive.md +73 -0
- package/dist/docs/CardImagePrimitive.md +73 -0
- package/dist/docs/CardRootPrimitive.md +99 -0
- package/dist/docs/CheckboxBtn.md +96 -0
- package/dist/docs/CheckboxButtonGroup.md +115 -0
- package/dist/docs/CheckboxGroup.md +102 -0
- package/dist/docs/CheckboxGroupItemPrimitive.md +104 -0
- package/dist/docs/CheckboxGroupPrimitive.md +105 -0
- package/dist/docs/ClearableAutocomplete.md +135 -0
- package/dist/docs/DoughnutChart.md +88 -0
- package/dist/docs/INDEX.md +133 -0
- package/dist/docs/IntersectionObservable.md +78 -0
- package/dist/docs/IntersectionObserver.md +84 -0
- package/dist/docs/IntersectionObserverProvider.md +98 -0
- package/dist/docs/IntersectionObserverTarget.md +73 -0
- package/dist/docs/LineChart.md +98 -0
- package/dist/docs/ProgressIndicatorPrimitive.md +70 -0
- package/dist/docs/ProgressRootPrimitive.md +106 -0
- package/dist/docs/RadioButton.md +86 -0
- package/dist/docs/RadioButtonGroup.md +107 -0
- package/dist/docs/RadioButtonItem.md +101 -0
- package/dist/docs/RadioGroup.md +95 -0
- package/dist/docs/RadioGroupItemPrimitive.md +102 -0
- package/dist/docs/SelectItem.md +100 -0
- package/dist/docs/ShimmerMultiLine.md +79 -0
- package/dist/docs/SimpleSlider.md +80 -0
- package/dist/docs/StaticSpinner.md +76 -0
- package/dist/docs/SwiperCarousel.md +126 -0
- package/dist/docs/SwiperNavigationPrimitive.md +83 -0
- package/dist/docs/SwiperPaginationPrimitive.md +80 -0
- package/dist/docs/SwiperPrimitive.md +77 -0
- package/dist/docs/SwiperRootPrimitive.md +123 -0
- package/dist/docs/SwiperSlide.md +75 -0
- package/dist/docs/SwiperSlideImagePrimitive.md +98 -0
- package/dist/docs/SwiperThumbnailPrimitive.md +96 -0
- package/dist/docs/TOKENS.md +50 -0
- package/dist/docs/agent-index.md +86 -0
- package/dist/lazyModules/Swiper/Autoplay/index.js +1 -1
- package/dist/lazyModules/Swiper/Controller/index.js +1 -1
- package/dist/lazyModules/Swiper/Keyboard/index.js +1 -1
- package/dist/lazyModules/Swiper/Thumbs/index.js +1 -1
- package/package.json +9 -8
- /package/dist/assets/{swiper-thumbs.css → swiper-autoplay.css} +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: AccordionHeaderPrimitive
|
|
3
|
+
status: primitive
|
|
4
|
+
category: Layout
|
|
5
|
+
summary: Unstyled heading element (h3 by default) wrapping the trigger of a primitive accordion item.
|
|
6
|
+
import: @wikicasa-dev/components/UIKit/Accordion/AccordionHeaderPrimitive
|
|
7
|
+
version: 2.10.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# AccordionHeaderPrimitive
|
|
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
|
+
Unstyled heading element (h3 by default) wrapping the trigger of a primitive accordion item.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import AccordionHeaderPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionHeaderPrimitive";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Part of the primitive accordion composition: see the `AccordionItemPrimitive` doc for the full example. Place it inside `AccordionItemPrimitive`, with an `AccordionTriggerPrimitive` inside.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```vue
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import AccordionHeaderPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionHeaderPrimitive";
|
|
27
|
+
import AccordionTriggerPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionTriggerPrimitive";
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<!-- inside <AccordionItemPrimitive> -->
|
|
32
|
+
<AccordionHeaderPrimitive as="h4">
|
|
33
|
+
<AccordionTriggerPrimitive>Spese condominiali</AccordionTriggerPrimitive>
|
|
34
|
+
</AccordionHeaderPrimitive>
|
|
35
|
+
</template>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Do / Don't
|
|
39
|
+
|
|
40
|
+
- Change the heading level with `as` to fit the page outline (default `h3`).
|
|
41
|
+
- Keep extra header content (checkboxes, badges) next to the trigger, not inside it.
|
|
42
|
+
|
|
43
|
+
## API
|
|
44
|
+
|
|
45
|
+
_Generated from the component's types. Do not edit by hand._
|
|
46
|
+
|
|
47
|
+
### Props
|
|
48
|
+
|
|
49
|
+
| Name | Type | Default | Required | Description |
|
|
50
|
+
| --- | --- | --- | --- | --- |
|
|
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,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: AccordionItemPrimitive
|
|
3
|
+
status: primitive
|
|
4
|
+
category: Layout
|
|
5
|
+
summary: Unstyled accordion section wrapper, for custom accordion items composed from the Accordion*Primitive parts.
|
|
6
|
+
import: @wikicasa-dev/components/UIKit/Accordion/AccordionItemPrimitive
|
|
7
|
+
version: 2.10.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# AccordionItemPrimitive
|
|
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
|
+
Unstyled accordion section wrapper, for custom accordion items composed from the Accordion*Primitive parts.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import AccordionItemPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionItemPrimitive";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Use it only when `BaseAccordionItem` can't produce the header you need (e.g. a two-line title with a custom "+/−" marker). It must sit inside `BaseAccordion` and wrap one `AccordionHeaderPrimitive` (containing an `AccordionTriggerPrimitive`) and one `AccordionContentPrimitive`. None of the parts has any styling, animation or arrow.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```vue
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import BaseAccordion from "@wikicasa-dev/components/UIKit/Accordion/BaseAccordion";
|
|
27
|
+
import AccordionItemPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionItemPrimitive";
|
|
28
|
+
import AccordionHeaderPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionHeaderPrimitive";
|
|
29
|
+
import AccordionTriggerPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionTriggerPrimitive";
|
|
30
|
+
import AccordionContentPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionContentPrimitive";
|
|
31
|
+
|
|
32
|
+
const projects = [
|
|
33
|
+
{ id: "app", title: "Wikicasa App", subtitle: "Cerca casa dal telefono", img: "/mock/app.webp" },
|
|
34
|
+
{ id: "valuta", title: "Valuta casa", subtitle: "Stima online in 30 secondi", img: "/mock/valuta.webp" },
|
|
35
|
+
];
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<BaseAccordion type="multiple">
|
|
40
|
+
<AccordionItemPrimitive v-for="p in projects" :key="p.id" v-slot="{ open }" :value="p.id">
|
|
41
|
+
<AccordionHeaderPrimitive>
|
|
42
|
+
<AccordionTriggerPrimitive class="project-trigger">
|
|
43
|
+
<span>
|
|
44
|
+
<strong>{{ p.title }}</strong><br />
|
|
45
|
+
{{ p.subtitle }}
|
|
46
|
+
</span>
|
|
47
|
+
<span aria-hidden="true">{{ open ? "−" : "+" }}</span>
|
|
48
|
+
</AccordionTriggerPrimitive>
|
|
49
|
+
</AccordionHeaderPrimitive>
|
|
50
|
+
<AccordionContentPrimitive>
|
|
51
|
+
<img :src="p.img" :alt="p.title" style="width: 100%" />
|
|
52
|
+
</AccordionContentPrimitive>
|
|
53
|
+
</AccordionItemPrimitive>
|
|
54
|
+
</BaseAccordion>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<style>
|
|
58
|
+
.project-trigger { display: flex; width: 100%; justify-content: space-between; background: none; border: 0; text-align: left; }
|
|
59
|
+
</style>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Do / Don't
|
|
63
|
+
|
|
64
|
+
- `value` is required and unique within the accordion. `disabled` disables just this section.
|
|
65
|
+
- Its default slot exposes `open` (boolean) for open/closed visuals; the parts also carry `data-state="open"|"closed"` for CSS.
|
|
66
|
+
- Prefer `BaseAccordionItem` whenever a title plus arrow is enough.
|
|
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
|
+
| `disabled` | `boolean` | | | Whether or not an accordion item is disabled from user interaction. When `true`, prevents the user from interacting with the item. |
|
|
77
|
+
| `value` | `string` | | yes | A string value for the accordion item. All items within an accordion should use a unique value. |
|
|
78
|
+
| `unmountOnHide` | `boolean` | | | When `true`, the element will be unmounted on closed state. |
|
|
79
|
+
| `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. |
|
|
80
|
+
| `as` | `AsTag \| Component` | | | The element or component this component should render as. Can be overwritten by `asChild`. |
|
|
81
|
+
|
|
82
|
+
### Events
|
|
83
|
+
|
|
84
|
+
None.
|
|
85
|
+
|
|
86
|
+
### v-model
|
|
87
|
+
|
|
88
|
+
None.
|
|
89
|
+
|
|
90
|
+
### Slots
|
|
91
|
+
|
|
92
|
+
| Name | Slot props |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `default` | `{ open: boolean; }` |
|
|
95
|
+
|
|
96
|
+
### Exposed (template ref)
|
|
97
|
+
|
|
98
|
+
None.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: AccordionTriggerPrimitive
|
|
3
|
+
status: primitive
|
|
4
|
+
category: Layout
|
|
5
|
+
summary: Unstyled button that opens and closes a primitive accordion item.
|
|
6
|
+
import: @wikicasa-dev/components/UIKit/Accordion/AccordionTriggerPrimitive
|
|
7
|
+
version: 2.10.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# AccordionTriggerPrimitive
|
|
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
|
+
Unstyled button that opens and closes a primitive accordion item.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import AccordionTriggerPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionTriggerPrimitive";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Part of the primitive accordion composition: see the `AccordionItemPrimitive` doc for the full example. Place it inside `AccordionHeaderPrimitive`. It renders a `<button>` with `aria-expanded`/`aria-controls` and keyboard support already wired.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```vue
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import AccordionTriggerPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionTriggerPrimitive";
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<!-- inside <AccordionHeaderPrimitive> -->
|
|
31
|
+
<AccordionTriggerPrimitive class="faq-trigger" data-cy="faq-trigger">
|
|
32
|
+
Quanto costa pubblicare un annuncio?
|
|
33
|
+
</AccordionTriggerPrimitive>
|
|
34
|
+
</template>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Do / Don't
|
|
38
|
+
|
|
39
|
+
- It is already a button: don't nest `<button>` or links inside it.
|
|
40
|
+
- It has no UIKit styling at all: give it your own class for background, border, width and alignment.
|
|
41
|
+
- Style the open state with `[data-state="open"]`.
|
|
42
|
+
|
|
43
|
+
## API
|
|
44
|
+
|
|
45
|
+
_Generated from the component's types. Do not edit by hand._
|
|
46
|
+
|
|
47
|
+
### Props
|
|
48
|
+
|
|
49
|
+
| Name | Type | Default | Required | Description |
|
|
50
|
+
| --- | --- | --- | --- | --- |
|
|
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
|
+
| `dataCy` | `string` | | | |
|
|
54
|
+
|
|
55
|
+
### Events
|
|
56
|
+
|
|
57
|
+
None.
|
|
58
|
+
|
|
59
|
+
### v-model
|
|
60
|
+
|
|
61
|
+
None.
|
|
62
|
+
|
|
63
|
+
### Slots
|
|
64
|
+
|
|
65
|
+
| Name | Slot props |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| `default` | |
|
|
68
|
+
|
|
69
|
+
### Exposed (template ref)
|
|
70
|
+
|
|
71
|
+
None.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: BaseAccordion
|
|
3
|
+
status: preferred
|
|
4
|
+
category: Layout
|
|
5
|
+
summary: Accessible accordion root: a stack of collapsible sections (FAQs, grouped filters), one or many open at a time.
|
|
6
|
+
import: @wikicasa-dev/components/UIKit/Accordion/BaseAccordion
|
|
7
|
+
version: 2.10.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# BaseAccordion
|
|
11
|
+
|
|
12
|
+
Accessible accordion root: a stack of collapsible sections (FAQs, grouped filters), one or many open at a time.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import BaseAccordion from "@wikicasa-dev/components/UIKit/Accordion/BaseAccordion";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Use it to stack collapsible sections: FAQs on a valuation page, property typologies grouped under "Residenziale / Commerciale", zones grouped by district. Fill it with `BaseAccordionItem`s. Use the `Accordion*Primitive` parts only when an item needs a header layout `BaseAccordionItem` can't produce.
|
|
19
|
+
|
|
20
|
+
- `type` is required: `"single"` (one section open at a time; `v-model` is a string) or `"multiple"` (`v-model` is a string array).
|
|
21
|
+
- `collapsible` lets the user close the open section in `"single"` mode. Without it, one section always stays open once opened.
|
|
22
|
+
- `v-model` is optional; use it to open sections initially or to read which are open. Values are the items' `value`s.
|
|
23
|
+
|
|
24
|
+
Keyboard support (arrow keys between headers, Enter/Space to toggle) and ARIA wiring come built in.
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import BaseAccordion from "@wikicasa-dev/components/UIKit/Accordion/BaseAccordion";
|
|
31
|
+
import BaseAccordionItem from "@wikicasa-dev/components/UIKit/Accordion/BaseAccordionItem";
|
|
32
|
+
import { ref } from "vue";
|
|
33
|
+
|
|
34
|
+
const faqs = [
|
|
35
|
+
{ id: "faq-1", question: "Come viene calcolata la valutazione?", answer: "Confrontiamo annunci simili in zona con i dati OMI." },
|
|
36
|
+
{ id: "faq-2", question: "La valutazione online è gratuita?", answer: "Sì, ed è disponibile anche dall'app Wikicasa." },
|
|
37
|
+
];
|
|
38
|
+
const open = ref("faq-1");
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<BaseAccordion v-model="open" type="single" collapsible class="faq-list">
|
|
43
|
+
<BaseAccordionItem v-for="faq in faqs" :key="faq.id" :value="faq.id" :title="faq.question" :arrow-width="18">
|
|
44
|
+
<p style="margin-top: 0">{{ faq.answer }}</p>
|
|
45
|
+
</BaseAccordionItem>
|
|
46
|
+
</BaseAccordion>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
.faq-list > * + * { border-top: 1px solid #dee2e6; }
|
|
51
|
+
</style>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Do / Don't
|
|
55
|
+
|
|
56
|
+
- Give every item a unique `value`; it is what `v-model` holds.
|
|
57
|
+
- Closed sections stay in the DOM (hidden), which keeps FAQ text indexable. Pass `unmount-on-hide` to drop it instead.
|
|
58
|
+
- `disabled` on the root disables every section.
|
|
59
|
+
- Separators/borders between items go in `class` on the root or items; the accordion draws none.
|
|
60
|
+
- Its default slot exposes `modelValue` if a header needs to know what is open.
|
|
61
|
+
|
|
62
|
+
## API
|
|
63
|
+
|
|
64
|
+
_Generated from the component's types. Do not edit by hand._
|
|
65
|
+
|
|
66
|
+
### Props
|
|
67
|
+
|
|
68
|
+
| Name | Type | Default | Required | Description |
|
|
69
|
+
| --- | --- | --- | --- | --- |
|
|
70
|
+
| `collapsible` | `boolean` | | | When type is "single", allows closing content when clicking trigger for an open item. When type is "multiple", this prop has no effect. |
|
|
71
|
+
| `type` | `T` | | yes | Determines whether a "single" or "multiple" items can be selected at a time. |
|
|
72
|
+
| `disabled` | `boolean` | | | When `true`, prevents the user from interacting with the accordion and all its items |
|
|
73
|
+
| `dir` | `Direction` | | | The reading direction of the accordion when applicable. If omitted, assumes LTR (left-to-right) reading mode. |
|
|
74
|
+
| `orientation` | `DataOrientation` | | | The orientation of the accordion. |
|
|
75
|
+
| `unmountOnHide` | `boolean` | | | When `true`, the element will be unmounted on closed state. |
|
|
76
|
+
| `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. |
|
|
77
|
+
| `as` | `AsTag \| Component` | | | The element or component this component should render as. Can be overwritten by `asChild`. |
|
|
78
|
+
| `modelValue` | `Optional<ModelType>` | | | |
|
|
79
|
+
|
|
80
|
+
### Events
|
|
81
|
+
|
|
82
|
+
| Name | Payload |
|
|
83
|
+
| --- | --- |
|
|
84
|
+
| `update:modelValue` | `[value: Optional<ModelType>]` |
|
|
85
|
+
|
|
86
|
+
### v-model
|
|
87
|
+
|
|
88
|
+
- `v-model` binds `modelValue` (`Optional<ModelType>`)
|
|
89
|
+
|
|
90
|
+
### Slots
|
|
91
|
+
|
|
92
|
+
| Name | Slot props |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `default` | `{ modelValue: AcceptableValue \| AcceptableValue[] \| undefined; }` |
|
|
95
|
+
|
|
96
|
+
### Exposed (template ref)
|
|
97
|
+
|
|
98
|
+
None.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: BaseAccordionItem
|
|
3
|
+
status: preferred
|
|
4
|
+
category: Layout
|
|
5
|
+
summary: One collapsible section of BaseAccordion: a header with title and rotating arrow, plus the content.
|
|
6
|
+
import: @wikicasa-dev/components/UIKit/Accordion/BaseAccordionItem
|
|
7
|
+
version: 2.10.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# BaseAccordionItem
|
|
11
|
+
|
|
12
|
+
One collapsible section of BaseAccordion: a header with title and rotating arrow, plus the content.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import BaseAccordionItem from "@wikicasa-dev/components/UIKit/Accordion/BaseAccordionItem";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Use it inside `BaseAccordion` (see that doc for single/multiple mode and `v-model`). It renders a heading (`h3` by default, change with `headerTag`) containing a full-width trigger button with `title` and a chevron that rotates when open, then the content, which animates its height.
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```vue
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import BaseAccordion from "@wikicasa-dev/components/UIKit/Accordion/BaseAccordion";
|
|
25
|
+
import BaseAccordionItem from "@wikicasa-dev/components/UIKit/Accordion/BaseAccordionItem";
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<BaseAccordion type="multiple">
|
|
30
|
+
<BaseAccordionItem value="residenziale" title="Residenziale" header-tag="h4" content-classes="typology-options">
|
|
31
|
+
<label><input type="checkbox" /> Appartamento</label>
|
|
32
|
+
<label><input type="checkbox" /> Villa</label>
|
|
33
|
+
</BaseAccordionItem>
|
|
34
|
+
|
|
35
|
+
<BaseAccordionItem value="centro" trigger-classes="zone-trigger">
|
|
36
|
+
<template #header-content>
|
|
37
|
+
<label style="flex-grow: 1"><input type="checkbox" /> Centro storico</label>
|
|
38
|
+
</template>
|
|
39
|
+
<label><input type="checkbox" /> Duomo</label>
|
|
40
|
+
<label><input type="checkbox" /> Brera</label>
|
|
41
|
+
</BaseAccordionItem>
|
|
42
|
+
</BaseAccordion>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<style>
|
|
46
|
+
.typology-options { display: flex; flex-direction: column; }
|
|
47
|
+
.zone-trigger { padding-inline: 20px !important; }
|
|
48
|
+
</style>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Do / Don't
|
|
52
|
+
|
|
53
|
+
- `value` is required and must be unique within the accordion.
|
|
54
|
+
- `header-content` slot: content placed in the header before the trigger (e.g. a checkbox that selects the whole group). With it, the trigger shrinks to the arrow, so pass a `title` only if you want text next to the arrow.
|
|
55
|
+
- `trigger` slot replaces the title and arrow inside the trigger button and removes its default padding/styling. Don't put buttons or links in it (it is already a button).
|
|
56
|
+
- `arrowColor` currently has no effect (the arrow stays #222). To recolor it, pass `arrowClasses` with a class that sets the stroke of its `path` (e.g. `.my-arrow path { stroke: #2b5dff; }`).
|
|
57
|
+
- Default spacing is 16px around the title and 16px horizontal padding in the content; override with `triggerClasses` / `contentClasses`.
|
|
58
|
+
|
|
59
|
+
## Styling hooks
|
|
60
|
+
|
|
61
|
+
Class props: `headerClasses` (the heading, a flex row), `triggerClasses` (the button), `arrowClasses` (the chevron), `contentClasses` (the panel). `class` goes on the item wrapper. The open trigger and content carry `data-state="open"` for `data-[state=open]:` utilities.
|
|
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
|
+
| `title` | `string` | | | |
|
|
72
|
+
| `arrowColor` | ``#${string}`` | | | |
|
|
73
|
+
| `arrowWidth` | `number` | `12` | | |
|
|
74
|
+
| `dataCy` | `string` | | | |
|
|
75
|
+
| `value` | `string` | | yes | |
|
|
76
|
+
| `triggerClasses` | `ClassTypeProp` | | | |
|
|
77
|
+
| `headerClasses` | `ClassTypeProp` | | | |
|
|
78
|
+
| `contentClasses` | `ClassTypeProp` | | | |
|
|
79
|
+
| `arrowClasses` | `ClassTypeProp` | | | |
|
|
80
|
+
| `headerTag` | `AsTag \| Component` | `"h3"` | | The element or component this component should render as. Can be overwritten by asChild. |
|
|
81
|
+
|
|
82
|
+
### Events
|
|
83
|
+
|
|
84
|
+
None.
|
|
85
|
+
|
|
86
|
+
### v-model
|
|
87
|
+
|
|
88
|
+
None.
|
|
89
|
+
|
|
90
|
+
### Slots
|
|
91
|
+
|
|
92
|
+
| Name | Slot props |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `header-content` | |
|
|
95
|
+
| `trigger` | |
|
|
96
|
+
| `default` | |
|
|
97
|
+
|
|
98
|
+
### Exposed (template ref)
|
|
99
|
+
|
|
100
|
+
None.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: BaseAlert
|
|
3
|
+
status: preferred
|
|
4
|
+
category: Feedback
|
|
5
|
+
summary: Inline, static message box (success/info, error, dark) shown in the page flow, e.g. under a form.
|
|
6
|
+
import: @wikicasa-dev/components/UIKit/BaseAlert
|
|
7
|
+
version: 2.10.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# BaseAlert
|
|
11
|
+
|
|
12
|
+
Inline, static message box (success/info, error, dark) shown in the page flow, e.g. under a form.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import BaseAlert from "@wikicasa-dev/components/UIKit/BaseAlert";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Use it for a persistent message that belongs to a spot on the page: the result of a form submission, a validation summary, an informative notice. It has no close button, timer or animation: show and hide it with `v-if`. For a temporary, floating notification use `BaseSnackbar`.
|
|
19
|
+
|
|
20
|
+
The look is chosen with `alertClass`:
|
|
21
|
+
|
|
22
|
+
- `uikit-alert-w-primary`: lavender background, blue text. Success and neutral info ("Messaggio inviato all'agenzia").
|
|
23
|
+
- `uikit-alert-w-danger`: pale red background, red text. Errors.
|
|
24
|
+
- `uikit-alert-w-dark-primary`: dark blue background, white text. Strong emphasis on light pages.
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import BaseAlert from "@wikicasa-dev/components/UIKit/BaseAlert";
|
|
31
|
+
import { ref } from "vue";
|
|
32
|
+
|
|
33
|
+
const status = ref<"idle" | "success" | "error">("success");
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<BaseAlert v-if="status === 'success'" alert-class="uikit-alert-w-primary" style="margin-top: 20px">
|
|
38
|
+
Richiesta inviata! L'agenzia Immobiliare Bianchi ti contatterà a breve.
|
|
39
|
+
</BaseAlert>
|
|
40
|
+
<BaseAlert v-else-if="status === 'error'" alert-class="uikit-alert-w-danger" style="margin-top: 20px">
|
|
41
|
+
Si è verificato un errore. Riprova tra qualche minuto.
|
|
42
|
+
</BaseAlert>
|
|
43
|
+
</template>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Do / Don't
|
|
47
|
+
|
|
48
|
+
- Always pass `alertClass`. Without it the box only gets padding and rounded corners, and its colors depend on which other stylesheets happen to be loaded.
|
|
49
|
+
- It renders `role="alert"`, so screen readers announce it when it appears. Don't use it for decorative or permanent page copy.
|
|
50
|
+
- The slot accepts any markup (icons, links, bold text). For an icon + text row, make it a flex row with your own class or `style="display: flex; align-items: center; gap: 12px"`.
|
|
51
|
+
- Margins and width go in your own `class`/`style`; the box itself has no outer spacing.
|
|
52
|
+
|
|
53
|
+
## Styling hooks
|
|
54
|
+
|
|
55
|
+
Classes `uikit-alert` (base: rounded, 16px padding, medium weight) plus the variant class. Override colors with utility classes in `class`.
|
|
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
|
+
| `alertClass` | `AlertClass` | `""` | | |
|
|
66
|
+
|
|
67
|
+
### Events
|
|
68
|
+
|
|
69
|
+
None.
|
|
70
|
+
|
|
71
|
+
### v-model
|
|
72
|
+
|
|
73
|
+
None.
|
|
74
|
+
|
|
75
|
+
### Slots
|
|
76
|
+
|
|
77
|
+
| Name | Slot props |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| `default` | |
|
|
80
|
+
|
|
81
|
+
### Exposed (template ref)
|
|
82
|
+
|
|
83
|
+
None.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: BaseAutocomplete
|
|
3
|
+
status: legacy
|
|
4
|
+
category: Forms
|
|
5
|
+
summary: Legacy search-as-you-type form field (BaseInput look) replaced by ClearableAutocomplete; wikicasa-nuxt no longer uses it.
|
|
6
|
+
useInstead: ClearableAutocomplete
|
|
7
|
+
import: @wikicasa-dev/components/UIKit/BaseAutocomplete
|
|
8
|
+
version: 2.10.0
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# BaseAutocomplete
|
|
12
|
+
|
|
13
|
+
> **Legacy.** Don't use in new designs. Use `ClearableAutocomplete` instead.
|
|
14
|
+
|
|
15
|
+
Legacy search-as-you-type form field (BaseInput look) replaced by ClearableAutocomplete; wikicasa-nuxt no longer uses it.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import BaseAutocomplete from "@wikicasa-dev/components/UIKit/BaseAutocomplete";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Legacy: don't use it in new work. `ClearableAutocomplete` replaces it everywhere, including inside forms (style its trigger to match the other fields), and wikicasa-nuxt no longer uses it. This page is for reading existing code.
|
|
22
|
+
|
|
23
|
+
It wraps `BaseInput`, so it has a floating label, validation colors and icon slots. For a short fixed list use `AccessibleSelect`.
|
|
24
|
+
|
|
25
|
+
`onInputChangeCb` is called 300 ms after the user stops typing and must resolve to `{ id, label }[]` (extra fields are kept). `v-model` holds the chosen option; with nothing chosen it is `{ id: "", label: "" }`.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```vue
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
import { ref } from "vue";
|
|
32
|
+
import BaseAutocomplete from "@wikicasa-dev/components/UIKit/BaseAutocomplete";
|
|
33
|
+
import type { AccessibleSelectOptions } from "@wikicasa-dev/components";
|
|
34
|
+
|
|
35
|
+
type Address = AccessibleSelectOptions<{ city: string }, string>;
|
|
36
|
+
|
|
37
|
+
const ADDRESSES: Address[] = [
|
|
38
|
+
{ id: "a1", label: "Via Roma 12, Milano", city: "Milano" },
|
|
39
|
+
{ id: "a2", label: "Via Roma 3, Torino", city: "Torino" },
|
|
40
|
+
{ id: "a3", label: "Viale Monza 140, Milano", city: "Milano" },
|
|
41
|
+
];
|
|
42
|
+
// Mock search: replace with your data source
|
|
43
|
+
const searchAddress = async (q: string | null) =>
|
|
44
|
+
q ? ADDRESSES.filter((a) => a.label.toLowerCase().includes(q.toLowerCase())) : [];
|
|
45
|
+
|
|
46
|
+
const address = ref<Address>();
|
|
47
|
+
const onSelected = (opt: Address) => console.log("selected", opt.id, opt.city);
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<BaseAutocomplete
|
|
52
|
+
id="valuation-address"
|
|
53
|
+
v-model="address"
|
|
54
|
+
label="Indirizzo dell'immobile"
|
|
55
|
+
:on-input-change-cb="searchAddress"
|
|
56
|
+
:on-option-selected-cb="onSelected"
|
|
57
|
+
/>
|
|
58
|
+
</template>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Do / Don't
|
|
62
|
+
|
|
63
|
+
- Do pass an `id`: it derives the inner input's id (`ac_input_<id>`) and a default `data-cy`.
|
|
64
|
+
- Do set `label`, or at least `placeholder` (forwarded to the input along with `disabled`).
|
|
65
|
+
- Do return `[]` for no results: the dropdown only opens when there is at least one option. The callback also receives `null` when the field is cleared.
|
|
66
|
+
- Do use `disableCb` to pause searching while it is `true` (e.g. a prefilled address; set it back to `false` on `click`).
|
|
67
|
+
- Do choose a `theme`: `""` (default, rounded bordered list), `"bordered"`, `"all-bordered"` / `"all-bordered-thick"` (field and list merge into one card) or `"empty"` (no extra list styling).
|
|
68
|
+
- Do use the `option-content` slot (`{ option, idx }`) for richer rows, `lefticon` for a leading icon, `righticon` (`{ handleClean }`) for a clear icon.
|
|
69
|
+
- Don't call a real API in mockups; use a mock function like the one above.
|
|
70
|
+
|
|
71
|
+
## Styling hooks
|
|
72
|
+
|
|
73
|
+
- `.uikit-autocomplete { --autocomplete-dropdown-max-height }` (default `210px`).
|
|
74
|
+
- `root-classes` (attribute) on the wrapper, `inputClasses` / `fieldsetClasses` on the inner field, `dropdownClasses` on the list.
|
|
75
|
+
- Icons in `lefticon` / `righticon` use BaseInput's `text-input-icon left|right sm|md|lg` classes.
|
|
76
|
+
|
|
77
|
+
## API
|
|
78
|
+
|
|
79
|
+
_Generated from the component's types. Do not edit by hand._
|
|
80
|
+
|
|
81
|
+
### Props
|
|
82
|
+
|
|
83
|
+
| Name | Type | Default | Required | Description |
|
|
84
|
+
| --- | --- | --- | --- | --- |
|
|
85
|
+
| `isValid` | `Nullable<boolean>` | `null` | | |
|
|
86
|
+
| `theme` | `BaseAutocompleteThemes` | `""` | | |
|
|
87
|
+
| `label` | `string` | `""` | | |
|
|
88
|
+
| `disableCb` | `boolean` | `false` | | |
|
|
89
|
+
| `onInputChangeCb` | `(v: string \| null) => Promise<AccessibleSelectOptions<TPayload, TID>[]>` | | yes | |
|
|
90
|
+
| `onOptionSelectedCb` | `Nullable<(v: AccessibleSelectOptions<TPayload, TID>) => void>` | `null` | | |
|
|
91
|
+
| `keepState` | `Nullable<"open" \| "closed">` | `null` | | |
|
|
92
|
+
| `cleanupOnClose` | `boolean` | `true` | | |
|
|
93
|
+
| `dropdownClasses` | `string` | `""` | | |
|
|
94
|
+
| `closeDropdownOnBodyPressed` | `boolean` | `true` | | If true, we will close the dropdown when the user clicks or touches the body of the document |
|
|
95
|
+
| `inputClasses` | `ClassTypeProp` | | | |
|
|
96
|
+
| `fieldsetClasses` | `ClassTypeProp` | | | |
|
|
97
|
+
| `dataCy` | `string` | `""` | | |
|
|
98
|
+
| `modelValue` | `AccessibleSelectOptions<TPayload, TID>` | | | The modelValue holds the value of one of the selectItems. If empty, it means that no selectItem has been selected |
|
|
99
|
+
|
|
100
|
+
### Events
|
|
101
|
+
|
|
102
|
+
| Name | Payload |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| `click` | |
|
|
105
|
+
| `update:dropdownState` | `[boolean]` |
|
|
106
|
+
| `changedValue` | `[string]` |
|
|
107
|
+
| `keydown` | `[KeyboardEvent]` |
|
|
108
|
+
| `keydownEnterPressed` | |
|
|
109
|
+
| `update:modelValue` | `[value: AccessibleSelectOptions<TPayload, TID> \| undefined]` |
|
|
110
|
+
|
|
111
|
+
### v-model
|
|
112
|
+
|
|
113
|
+
- `v-model` binds `modelValue` (`AccessibleSelectOptions<TPayload, TID>`)
|
|
114
|
+
|
|
115
|
+
### Slots
|
|
116
|
+
|
|
117
|
+
| Name | Slot props |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| `lefticon` | |
|
|
120
|
+
| `righticon` | `{ handleClean: () => void; }` |
|
|
121
|
+
| `option-content` | `{ option: AccessibleSelectOptions<TPayload, TID>; idx: number; }` |
|
|
122
|
+
|
|
123
|
+
### Exposed (template ref)
|
|
124
|
+
|
|
125
|
+
None.
|