Skip to content

Commit 5509d0f

Browse files
authored
refactor(components): dlt-3282 renamed show prop to open (#1190)
Co-authored-by: iropolo <ignacio.ropolo@dialpad.com>
1 parent 73f1479 commit 5509d0f

27 files changed

Lines changed: 149 additions & 148 deletions

.claude/rules/vue-components.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ paths:
2020
## Events
2121

2222
- `update:modelValue` for v-model.
23-
- `update:open` for Popover, Collapsible, ImageViewer, FilterPill.
24-
- `update:show` for Modal, Tooltip, Toast (legacy — don't change existing, use `update:open` for new).
23+
- `update:open` for Modal, Tooltip, Toast, Popover, Collapsible, ImageViewer, FilterPill.
2524

2625
## Slots
2726

.claude/skills/vue-conventions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ Detailed rules are applied automatically via path-scoped rules when editing comp
1515
| Prop validation | `validator` (NEVER `validate` — Vue silently ignores it) |
1616
| Constants | Export from `*_constants.js`, import in component + tests |
1717
| v-model event | `update:modelValue` |
18-
| Open/close (new) | `update:open` (Popover, Collapsible, ImageViewer, FilterPill) |
19-
| Open/close (legacy) | `update:show` (Modal, Tooltip, Toast — don't change) |
18+
| Open/close | `update:open` (Modal, Tooltip, Toast, Popover, Collapsible, ImageViewer, FilterPill) |
2019
| Overlay slots | `headerContent` / `footerContent` |
2120
| Structural slots | `header` / `footer` |
2221
| Sizes (interactive) | `xs`, `sm`, `md`, `lg`, `xl` |

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ chore: NO-JIRA update dependencies
8989
- **New components**: Composition API with `<script setup lang="ts">`
9090
- **Existing components**: Options API with `compatConfig: { MODE: 3 }` — do NOT convert unless explicitly asked
9191
- **Props**: Use `validator` (NOT `validate` — Vue silently ignores `validate`)
92-
- **Events**: `update:modelValue` for v-model; `update:open` for new overlays; `update:show` for legacy Modal/Tooltip/Toast
92+
- **Events**: `update:modelValue` for v-model; `update:open` for all overlay visibility (Modal, Tooltip, Toast, Popover, Dropdown, etc.)
9393

9494
Detailed conventions are in path-scoped rules (`.claude/rules/vue-components.md`) that activate automatically when editing component files.
9595

apps/dialtone-documentation/docs/.vuepress/exampleComponents/ExampleModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
22
<dt-modal
33
title="Example title"
4-
:show="isOpen"
4+
:open="isOpen"
55
:banner-title="bannerTitle"
66
:banner-kind="bannerKind"
77
:fixed-header-footer="fixedHeaderFooter"
88
:size="size"
99
:copy="copy"
10-
@update:show="isOpen = $event"
10+
@update:open="isOpen = $event"
1111
>
1212
<template
1313
#footer

apps/dialtone-documentation/docs/.vuepress/exampleComponents/ExampleToast.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<aside :class="['d-toast-wrapper', { 'd-ps-fixed': fixed }]">
33
<dt-toast
44
:title="title"
5-
:show="show"
5+
:open="open"
66
:important="important"
77
:duration="duration"
88
:kind="kind"
99
@close="$emit('close')"
10-
@update:show="$emit('update:show', $event)"
10+
@update:open="$emit('update:open', $event)"
1111
>
1212
Message body with
1313
<dt-link
@@ -38,7 +38,7 @@ export default {
3838
default: '',
3939
},
4040
41-
show: {
41+
open: {
4242
type: Boolean,
4343
default: false,
4444
},
@@ -64,7 +64,7 @@ export default {
6464
},
6565
},
6666
67-
emits: ['close', 'update:show'],
67+
emits: ['close', 'update:open'],
6868
computed: {
6969
linkClass () {
7070
if (this.kind === 'warning' && this.important) return 'd-fc-neutral-black';

apps/dialtone-documentation/docs/.vuepress/views/IconCatalog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@
101101
</dt-empty-state>
102102
<dt-modal
103103
v-if="selectedIcon"
104-
:show="isModalOpen"
104+
:open="isModalOpen"
105105
size="full"
106106
content-class="d-wmx100p d-pie-400"
107-
@update:show="isModalOpen = false"
107+
@update:open="isModalOpen = false"
108108
>
109109
<template #header>
110110
<span

apps/dialtone-documentation/docs/components/modal.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ Although highly versatile, this doesn't mean modal dialogs are fit for all purpo
7272
<!-- @code -->
7373
<dt-modal
7474
title="Example title"
75-
:show="isOpen"
76-
@update:show="updateShow"
75+
:open="isOpen"
76+
@update:open="updateOpen"
7777
copy="Lorem ipsum ..."
7878
>
7979
<template
@@ -110,8 +110,8 @@ This is the default behavior that adds the scroll automatically in the modal con
110110
<!-- @code -->
111111
<dt-modal
112112
title="Example title"
113-
:show="isOpen"
114-
@update:show="updateShow"
113+
:open="isOpen"
114+
@update:open="updateOpen"
115115
:showFooter="true"
116116
:fixed-header-footer="true"
117117
copy="Sed at orci quis nunc finibus gravida eget vitae est..."
@@ -150,10 +150,10 @@ A modal style for destructive or irreversible actions.
150150
<!-- @code -->
151151
<dt-modal
152152
title="Example title"
153-
:show="isOpen"
153+
:open="isOpen"
154154
kind="critical"
155155
copy="Sed at orci quis nunc finibus gravida eget vitae est..."
156-
@update:show="updateShow"
156+
@update:open="updateOpen"
157157
>
158158
<template
159159
#footer
@@ -190,10 +190,10 @@ To make this modal take up as much of the screen as possible.
190190
<!-- @code -->
191191
<dt-modal
192192
title="Example title"
193-
:show="isOpen"
193+
:open="isOpen"
194194
size="full"
195195
copy="Sed at orci quis nunc finibus gravida eget vitae est..."
196-
@update:show="updateShow"
196+
@update:open="updateOpen"
197197
>
198198
<template
199199
#footer
@@ -237,11 +237,11 @@ When there is a need of more context information regarding the content of the Mo
237237
<!-- @code -->
238238
<dt-modal
239239
title="Example title"
240-
:show="isOpen"
240+
:open="isOpen"
241241
banner-title="This banner can have different kinds."
242242
:bannerKind="selectedBannerKind"
243243
copy="Sed at orci quis nunc finibus gravida eget vitae est..."
244-
@update:show="updateShow"
244+
@update:open="updateOpen"
245245
>
246246
<template
247247
#footer
@@ -279,8 +279,8 @@ In addition to the footer, custom elements can be inserted into the header and b
279279
```vue demo
280280
<div>
281281
<dt-modal
282-
:show="isOpen"
283-
@update:show="updateShow"
282+
:open="isOpen"
283+
@update:open="updateOpen"
284284
>
285285
<template #header>
286286
<dt-stack direction="row" align="center" justify="center" class="d-p-150 d-bgc-purple-100">
@@ -299,8 +299,8 @@ In addition to the footer, custom elements can be inserted into the header and b
299299
</div>
300300
<!-- @code -->
301301
<dt-modal
302-
:show="isOpen"
303-
@update:show="updateShow"
302+
:open="isOpen"
303+
@update:open="updateOpen"
304304
>
305305
<template #header>
306306
<dt-stack direction="row" align="center" justify="center" class="d-p-150 d-bgc-purple-100">
@@ -324,8 +324,8 @@ Modal content renders outside the DOM tree. Use the `contentMode` prop to apply
324324
content-mode="invert"
325325
title="Inverted Modal"
326326
copy="This modal's content is in the inverted mode."
327-
:show="invertedModalOpen"
328-
@update:show="invertedModalOpen = $event"
327+
:open="invertedModalOpen"
328+
@update:open="invertedModalOpen = $event"
329329
/>
330330
</div>
331331
<!-- @code -->
@@ -361,7 +361,7 @@ At minimum, modals contain a title and one button. They could also contain body
361361
isOpen.value = true;
362362
};
363363

364-
const updateShow = (value) => {
364+
const updateOpen = (value) => {
365365
if (!value) isOpen.value = false;
366366
};
367367

apps/dialtone-documentation/docs/components/toast.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ keywords: ["notification", "snackbar", "alert", "message", "d-toast", "DtToast",
2424
<!-- @code -->
2525
<dt-toast
2626
title="Title"
27-
:show="showToast"
27+
:open="showToast"
2828
:important="important"
2929
:kind="selectedKind"
3030
@close="closeEvent"
@@ -47,7 +47,7 @@ keywords: ["notification", "snackbar", "alert", "message", "d-toast", "DtToast",
4747

4848
<example-toast
4949
class="d-zi-notification"
50-
:show="showToast"
50+
:open="showToast"
5151
title="Title"
5252
:important="important"
5353
:kind="selectedKind"
@@ -63,16 +63,16 @@ If the duration is not provided the toast won't disappear automatically.
6363
<dt-button @click="toggleDurationToast(true)">Show Example</dt-button>
6464
<example-toast
6565
class="d-zi-notification"
66-
:show="showDurationToast"
66+
:open="showDurationToast"
6767
title="Title"
6868
@close="toggleDurationToast(false)"
69-
@update:show="updateShow"
69+
@update:open="updateOpen"
7070
:duration="6000"
7171
/>
7272
<!-- @code -->
7373
<dt-toast
7474
title="Title"
75-
:show="showDurationToast"
75+
:open="showDurationToast"
7676
@close="closeEvent"
7777
:duration="7500"
7878
>
@@ -101,7 +101,7 @@ If you need to self-position the toast at the top center, use the `d-toast-wrapp
101101
<dt-toast
102102
:title="title"
103103
:message="message"
104-
:show="isShown"
104+
:open="isShown"
105105
></dt-toast>
106106
</aside>
107107
```
@@ -158,7 +158,7 @@ function toggleToast () {
158158
function toggleDurationToast (value) {
159159
showDurationToast.value = value;
160160
}
161-
const updateShow = (value) => {
161+
const updateOpen = (value) => {
162162
if (!value) showDurationToast.value = false;
163163
};
164164

apps/dialtone-documentation/docs/scratch.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,25 +1263,25 @@ Real-world patterns showing how `v-dt-focusgroup` composes with Dialtone compone
12631263
<div class="d-d-grid d-g-400 d-g-cols2">
12641264
<dt-stack gap="100">
12651265
<dt-text as="h3" kind="headline" :size="300">Default</dt-text>
1266-
<dt-toast :show="true" kind="info" title="Info toast" message="Informational message." :duration="null" />
1267-
<dt-toast :show="true" kind="success" title="Success toast" message="Action completed." :duration="null" />
1268-
<dt-toast :show="true" kind="warning" title="Warning toast" message="Review before proceeding." :duration="null" />
1269-
<dt-toast :show="true" kind="critical" title="Critical toast" message="Something went wrong." :duration="null" />
1270-
<dt-toast :show="true" kind="base" title="Base toast" message="Neutral notification." :duration="null" />
1266+
<dt-toast :open="true" kind="info" title="Info toast" message="Informational message." :duration="null" />
1267+
<dt-toast :open="true" kind="success" title="Success toast" message="Action completed." :duration="null" />
1268+
<dt-toast :open="true" kind="warning" title="Warning toast" message="Review before proceeding." :duration="null" />
1269+
<dt-toast :open="true" kind="critical" title="Critical toast" message="Something went wrong." :duration="null" />
1270+
<dt-toast :open="true" kind="base" title="Base toast" message="Neutral notification." :duration="null" />
12711271
</dt-stack>
12721272
<dt-stack gap="100">
12731273
<dt-text as="h3" kind="headline" :size="300">Important</dt-text>
1274-
<dt-toast :show="true" kind="info" title="Info toast" message="Informational message." :important="true" :duration="null" />
1275-
<dt-toast :show="true" kind="success" title="Success toast" message="Action completed." :important="true" :duration="null" />
1276-
<dt-toast :show="true" kind="warning" title="Warning toast" message="Review before proceeding." :important="true" :duration="null" />
1277-
<dt-toast :show="true" kind="critical" title="Critical toast" message="Something went wrong." :important="true" :duration="null" />
1278-
<dt-toast :show="true" kind="base" title="Base toast" message="Neutral notification." :important="true" :duration="null" />
1274+
<dt-toast :open="true" kind="info" title="Info toast" message="Informational message." :important="true" :duration="null" />
1275+
<dt-toast :open="true" kind="success" title="Success toast" message="Action completed." :important="true" :duration="null" />
1276+
<dt-toast :open="true" kind="warning" title="Warning toast" message="Review before proceeding." :important="true" :duration="null" />
1277+
<dt-toast :open="true" kind="critical" title="Critical toast" message="Something went wrong." :important="true" :duration="null" />
1278+
<dt-toast :open="true" kind="base" title="Base toast" message="Neutral notification." :important="true" :duration="null" />
12791279
</dt-stack>
12801280
<dt-stack gap="100">
12811281
<dt-text as="h3" kind="headline" :size="300">Alignment per internal parts</dt-text>
1282-
<dt-toast :show="true" kind="info" title="Title only" :duration="null" />
1283-
<dt-toast :show="true" kind="info" message="Action completed." :duration="null" />
1284-
<dt-toast :show="true" kind="info" title="Title and message" message="Review before proceeding." :duration="null" />
1282+
<dt-toast :open="true" kind="info" title="Title only" :duration="null" />
1283+
<dt-toast :open="true" kind="info" message="Action completed." :duration="null" />
1284+
<dt-toast :open="true" kind="info" title="Title and message" message="Review before proceeding." :duration="null" />
12851285
</dt-stack>
12861286
</div>
12871287
</dt-stack>

packages/dialtone-docs/src/content/reference/reference-component-api-patterns.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,15 @@ All form components implement Vue 3 v-model via `modelValue` prop + `update:mode
7575
| DtSelectMenu | `String \| Number` | |
7676
| DtToggle | `Boolean \| String` | Supports `'mixed'` for indeterminate state |
7777

78-
Visibility-toggle components use `update:show` instead:
78+
Visibility-toggle components use `update:open`:
7979

8080
| Component | Emit |
8181
|-----------|------|
82-
| DtModal | `update:show` |
83-
| DtTooltip | `update:show` |
82+
| DtModal | `update:open` |
83+
| DtTooltip | `update:open` |
84+
| DtToast | `update:open` |
85+
| DtPopover | `update:open` |
86+
| DtDropdown | `update:open` |
8487

8588
## Event Naming
8689

@@ -90,7 +93,7 @@ Custom events use the `update:{prop}` convention to stay compatible with `v-mode
9093

9194
```
9295
update:modelValue — value changed
93-
update:show — visibility changed
96+
update:open — visibility changed
9497
update:length — input length changed (DtInput)
9598
update:invalid — validation state changed (DtInput)
9699
```

0 commit comments

Comments
 (0)