srcdev-nuxt-components 9.1.55 → 9.1.57
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/.claude/settings.json +30 -2
- package/.claude/skills/components/alert-content-inner.md +60 -0
- package/.claude/skills/components/display-dialog.md +80 -0
- package/.claude/skills/components/display-prompt.md +163 -0
- package/.claude/skills/components/display-toast.md +235 -0
- package/.claude/skills/index.md +7 -3
- package/.claude/skills/theming-colour-ramps.md +328 -0
- package/.claude/skills/theming-override-default.md +115 -186
- package/.claude/skills/theming-partial-override.md +88 -75
- package/README.md +166 -0
- package/app/app.config.ts +44 -0
- package/app/assets/styles/setup/01.config/_head.css +3 -3
- package/app/assets/styles/setup/02.colours/_amber.css +12 -10
- package/app/assets/styles/setup/02.colours/_blue.css +10 -9
- package/app/assets/styles/setup/02.colours/_green.css +12 -11
- package/app/assets/styles/setup/02.colours/_orange.css +12 -10
- package/app/assets/styles/setup/02.colours/_red.css +10 -9
- package/app/assets/styles/setup/02.colours/_slate.css +12 -11
- package/app/assets/styles/setup/02.colours/_sunset.css +12 -10
- package/app/assets/styles/setup/02.colours/_theme-params.css +18 -0
- package/app/assets/styles/setup/02.colours/index.css +1 -0
- package/app/assets/styles/setup/03.theming/_default.css +87 -0
- package/app/assets/styles/setup/03.theming/_error.css +14 -0
- package/app/assets/styles/setup/03.theming/_success.css +4 -0
- package/app/assets/styles/setup/03.theming/_theme-slots.css +16 -0
- package/app/assets/styles/setup/03.theming/_warning.css +13 -0
- package/app/assets/styles/setup/03.theming/index.css +6 -4
- package/app/assets/styles/setup/03.theming/theme-ramp.css +19 -0
- package/app/assets/styles/setup/04.elements/forms/00.element-defaults.css +0 -7
- package/app/assets/styles/setup/04.elements/forms/06.button-geometry.css +1 -1
- package/app/assets/styles/setup/index.css +1 -1
- package/app/components/01.atoms/display-dialog/DisplayDialog.vue +74 -24
- package/app/components/01.atoms/display-dialog/tests/DisplayDialog.spec.ts +148 -14
- package/app/components/01.atoms/display-dialog/tests/__snapshots__/DisplayDialog.spec.ts.snap +3 -3
- package/app/components/01.atoms/prompt/DisplayPrompt.vue +113 -0
- package/app/components/01.atoms/prompt/stories/DisplayPrompt.stories.ts +112 -0
- package/app/components/01.atoms/prompt/tests/DisplayPrompt.spec.ts +205 -0
- package/app/components/01.atoms/toast/DisplayToast.vue +327 -0
- package/app/components/01.atoms/toast/DisplayToastProvider.vue +362 -0
- package/app/components/01.atoms/toast/stories/DisplayToast.stories.ts +195 -0
- package/app/components/01.atoms/toast/stories/DisplayToastProvider.stories.ts +142 -0
- package/app/components/01.atoms/toast/tests/DisplayToast.spec.ts +266 -0
- package/app/components/01.atoms/toast/tests/DisplayToastProvider.spec.ts +256 -0
- package/app/components/02.molecules/action-menu/ActionMenu.vue +8 -1
- package/app/components/02.molecules/action-menu/ActionMenuItemCore.vue +11 -3
- package/app/components/02.molecules/alert-content/AlertContent.vue +67 -0
- package/app/components/02.molecules/alert-content/AlertContentInner.vue +153 -0
- package/app/components/02.molecules/alert-content/stories/AlertContent.stories.ts +131 -0
- package/app/components/02.molecules/alert-content/tests/AlertContent.spec.ts +135 -0
- package/app/components/02.molecules/alert-content/tests/AlertContentInner.spec.ts +135 -0
- package/app/components/02.molecules/alert-masked-content/AlertMaskedContent.vue +78 -0
- package/app/components/02.molecules/alert-masked-content/stories/AlertMaskedContent.stories.ts +132 -0
- package/app/components/02.molecules/alert-masked-content/tests/AlertMaskedContent.spec.ts +149 -0
- package/app/components/05.forms/input-button/InputButtonCore.vue +35 -39
- package/app/components/05.forms/input-checkbox-radio/InputCheckboxRadioButton.vue +8 -8
- package/app/components/05.forms/input-checkbox-radio/InputCheckboxRadioCore.vue +5 -5
- package/app/components/05.forms/input-copy/InputCopyCore.vue +7 -7
- package/app/components/05.forms/input-number/InputNumberCore.vue +5 -5
- package/app/components/05.forms/input-select/InputSelectCore.vue +6 -6
- package/app/components/05.forms/input-text/InputTextCore.vue +6 -6
- package/app/components/05.forms/input-text/variants/InputTextAsNumberWithLabel.vue +2 -2
- package/app/components/05.forms/input-textarea/InputTextareaCore.vue +5 -5
- package/app/components/05.forms/pending-effect/PendingEffect.vue +60 -60
- package/app/components/05.forms/toggle-switch/ToggleSwitchCore.vue +10 -10
- package/app/components/05.forms/triple-toggle-switch/TripleToggleSwitchCore.vue +4 -4
- package/app/components/display-theme-switch/DisplayThemeSwitch.vue +4 -4
- package/app/components/display-tooltip/DisplayTooltip.vue +4 -4
- package/app/composables/useBodyLock.ts +21 -0
- package/app/composables/useDialogControls.ts +11 -11
- package/app/composables/useToastQueue.ts +39 -0
- package/app/layouts/default.vue +1 -1
- package/app/pages/ui/display-dialog.vue +275 -127
- package/app/pages/ui/display-prompt.vue +255 -52
- package/app/pages/ui/display-toast.vue +278 -299
- package/app/pages/ui/mask-element.vue +25 -3
- package/app/pages/ui/settings.vue +9 -35
- package/app/types/app-config.d.ts +41 -0
- package/app/types/components/display-prompt.d.ts +11 -0
- package/app/types/components/display-toast.d.ts +11 -9
- package/app/types/components/index.ts +2 -0
- package/app/types/components/semantic-theme.d.ts +1 -0
- package/nuxt.config.ts +16 -0
- package/package.json +8 -4
- package/ramps.config.mjs +28 -0
- package/scripts/check-ramps.mjs +50 -0
- package/scripts/generate-consumer-ramps.mjs +100 -0
- package/scripts/generate-ramps.mjs +92 -0
- package/app/assets/styles/setup/03.theming/default/_dark.css +0 -156
- package/app/assets/styles/setup/03.theming/default/_light.css +0 -166
- package/app/assets/styles/setup/03.theming/default/index.css +0 -2
- package/app/assets/styles/setup/03.theming/error/_dark.css +0 -56
- package/app/assets/styles/setup/03.theming/error/_light.css +0 -74
- package/app/assets/styles/setup/03.theming/error/index.css +0 -2
- package/app/assets/styles/setup/03.theming/success/_dark.css +0 -50
- package/app/assets/styles/setup/03.theming/success/_light.css +0 -65
- package/app/assets/styles/setup/03.theming/success/index.css +0 -2
- package/app/assets/styles/setup/03.theming/warning/_dark.css +0 -50
- package/app/assets/styles/setup/03.theming/warning/_light.css +0 -64
- package/app/assets/styles/setup/03.theming/warning/index.css +0 -2
- package/app/components/display-prompt/DisplayPromptCore.vue +0 -228
- package/app/components/display-prompt/variants/DisplayPromptError.vue +0 -53
- package/app/components/display-toast/DisplayToast.vue +0 -447
- package/app/components/display-toast/molecules/DefaultToastContent.vue +0 -163
- package/app/components/display-toast/stories/DisplayToast.stories.ts +0 -380
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="display-toast-inner">
|
|
3
|
-
<div class="toast-icon" aria-hidden="true">
|
|
4
|
-
<slot name="customToastIcon">
|
|
5
|
-
<Icon :name="customIcon || defaultThemeIcons[theme] || 'akar-icons:info'" class="icon" />
|
|
6
|
-
</slot>
|
|
7
|
-
</div>
|
|
8
|
-
<div :id="'toast-message-' + toastId" class="toast-message">
|
|
9
|
-
<template v-if="slots.title || slots.description || toastTitle || toastDescription">
|
|
10
|
-
<p v-if="slots.title || toastTitle" class="title" data-test-id="toast-title">
|
|
11
|
-
<slot name="title">{{ toastTitle }}</slot>
|
|
12
|
-
</p>
|
|
13
|
-
<p v-if="slots.description || toastDescription" class="description" data-test-id="toast-description">
|
|
14
|
-
<slot name="description">{{ toastDescription }}</slot>
|
|
15
|
-
</p>
|
|
16
|
-
</template>
|
|
17
|
-
<template v-else>
|
|
18
|
-
{{ toastDisplayText }}
|
|
19
|
-
</template>
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<div v-if="!autoDismiss" class="toast-action">
|
|
23
|
-
<button @click.prevent="setDismissToast()">
|
|
24
|
-
<Icon name="material-symbols:close" class="icon" />
|
|
25
|
-
<span class="sr-only">Close</span>
|
|
26
|
-
</button>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<script setup lang="ts">
|
|
32
|
-
import type { DisplayToastTheme } from "../../../types/components";
|
|
33
|
-
|
|
34
|
-
interface Props {
|
|
35
|
-
theme: DisplayToastTheme;
|
|
36
|
-
customIcon?: string;
|
|
37
|
-
toastId: string;
|
|
38
|
-
toastDisplayText: string;
|
|
39
|
-
toastTitle?: string;
|
|
40
|
-
toastDescription?: string;
|
|
41
|
-
autoDismiss: boolean;
|
|
42
|
-
setDismissToast: () => void;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
defineProps<Props>();
|
|
46
|
-
|
|
47
|
-
const defaultThemeIcons = {
|
|
48
|
-
primary: "akar-icons:info",
|
|
49
|
-
secondary: "akar-icons:info",
|
|
50
|
-
tertiary: "akar-icons:info",
|
|
51
|
-
ghost: "akar-icons:info",
|
|
52
|
-
error: "akar-icons:circle-alert",
|
|
53
|
-
info: "akar-icons:info",
|
|
54
|
-
success: "akar-icons:info",
|
|
55
|
-
warning: "akar-icons:circle-alert",
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const slots = useSlots();
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<style lang="css">
|
|
62
|
-
@layer components {
|
|
63
|
-
.display-toast-inner {
|
|
64
|
-
display: grid;
|
|
65
|
-
grid-template-columns: auto 1fr auto;
|
|
66
|
-
gap: 12px;
|
|
67
|
-
align-items: center;
|
|
68
|
-
background-color: var(--colour-theme-1);
|
|
69
|
-
border-start-start-radius: 8px;
|
|
70
|
-
border-end-start-radius: 8px;
|
|
71
|
-
padding: 12px 14px;
|
|
72
|
-
overflow: hidden;
|
|
73
|
-
|
|
74
|
-
.toast-icon {
|
|
75
|
-
display: inline-flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
margin-right: 12px;
|
|
79
|
-
|
|
80
|
-
.icon {
|
|
81
|
-
color: var(--colour-theme-0);
|
|
82
|
-
display: inline-block;
|
|
83
|
-
font-size: 2.5rem;
|
|
84
|
-
font-style: normal;
|
|
85
|
-
font-weight: normal;
|
|
86
|
-
overflow: hidden;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.toast-message {
|
|
91
|
-
display: flex;
|
|
92
|
-
align-items: center;
|
|
93
|
-
gap: var(--step-1);
|
|
94
|
-
font-size: var(--step-4);
|
|
95
|
-
font-weight: normal;
|
|
96
|
-
line-height: 1.3;
|
|
97
|
-
color: var(--colour-theme-0);
|
|
98
|
-
margin: 0;
|
|
99
|
-
padding: 0;
|
|
100
|
-
|
|
101
|
-
.title {
|
|
102
|
-
margin: 0;
|
|
103
|
-
font-weight: 600;
|
|
104
|
-
font-size: var(--step-4);
|
|
105
|
-
line-height: 1.2;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.description {
|
|
109
|
-
margin: 0;
|
|
110
|
-
font-size: var(--step-3);
|
|
111
|
-
line-height: 1.4;
|
|
112
|
-
opacity: 0.9;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/* When using slots, change flex direction to column */
|
|
116
|
-
&:has(.title, .text) {
|
|
117
|
-
flex-direction: column;
|
|
118
|
-
align-items: flex-start;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.toast-action {
|
|
123
|
-
display: flex;
|
|
124
|
-
align-items: center;
|
|
125
|
-
justify-content: center;
|
|
126
|
-
margin-left: 12px;
|
|
127
|
-
|
|
128
|
-
button {
|
|
129
|
-
display: flex;
|
|
130
|
-
align-items: center;
|
|
131
|
-
justify-content: center;
|
|
132
|
-
background: var(--colour-theme-10);
|
|
133
|
-
border: 0.1rem solid var(--colour-theme-8);
|
|
134
|
-
outline: 0.1rem solid transparent;
|
|
135
|
-
border-radius: 50%;
|
|
136
|
-
box-shadow: none;
|
|
137
|
-
color: var(--colour-theme-1);
|
|
138
|
-
cursor: pointer;
|
|
139
|
-
font-size: var(--step-4);
|
|
140
|
-
font-weight: bold;
|
|
141
|
-
padding: 0.5rem;
|
|
142
|
-
text-decoration: underline;
|
|
143
|
-
|
|
144
|
-
transition: all 0.3s ease;
|
|
145
|
-
|
|
146
|
-
.icon {
|
|
147
|
-
font-size: 1.5rem;
|
|
148
|
-
vertical-align: middle;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
&:hover,
|
|
152
|
-
&:focus-visible {
|
|
153
|
-
box-shadow: none;
|
|
154
|
-
background-color: var(--colour-theme-8);
|
|
155
|
-
color: var(--colour-theme-0);
|
|
156
|
-
outline: 0.1rem solid var(--colour-theme-3);
|
|
157
|
-
outline-offset: 0.2rem;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
</style>
|
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from "@nuxtjs/storybook";
|
|
2
|
-
import { ref, onMounted } from "vue";
|
|
3
|
-
import StorybookComponent from "../DisplayToast.vue";
|
|
4
|
-
|
|
5
|
-
// Custom interface for story args
|
|
6
|
-
interface ToastStoryArgs {
|
|
7
|
-
theme: "primary" | "secondary" | "success" | "warning" | "error" | "info";
|
|
8
|
-
position: "top" | "bottom";
|
|
9
|
-
alignment: "left" | "center" | "right";
|
|
10
|
-
fullWidth: boolean;
|
|
11
|
-
autoDismiss: boolean;
|
|
12
|
-
duration: number;
|
|
13
|
-
revealDuration: number;
|
|
14
|
-
text: string;
|
|
15
|
-
customIcon: string;
|
|
16
|
-
// DisplayPromptCore specific props
|
|
17
|
-
usePrompt: boolean;
|
|
18
|
-
promptTheme: "primary" | "secondary" | "success" | "warning" | "error" | "info";
|
|
19
|
-
dismissible: boolean;
|
|
20
|
-
promptTitle: string;
|
|
21
|
-
promptContent: string;
|
|
22
|
-
useAutoFocus: boolean;
|
|
23
|
-
styleClassPassthrough: string[];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
title: "Components/UI/DisplayToast",
|
|
28
|
-
component: StorybookComponent,
|
|
29
|
-
argTypes: {
|
|
30
|
-
// Appearance Config
|
|
31
|
-
theme: {
|
|
32
|
-
control: { type: "select" },
|
|
33
|
-
options: ["primary", "secondary", "success", "warning", "error", "info"],
|
|
34
|
-
description: "Toast theme/variant",
|
|
35
|
-
table: {
|
|
36
|
-
category: "Appearance",
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
position: {
|
|
40
|
-
control: { type: "select" },
|
|
41
|
-
options: ["top", "bottom"],
|
|
42
|
-
description: "Vertical position of toast",
|
|
43
|
-
table: {
|
|
44
|
-
category: "Appearance",
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
alignment: {
|
|
48
|
-
control: { type: "select" },
|
|
49
|
-
options: ["left", "center", "right"],
|
|
50
|
-
description: "Horizontal alignment of toast",
|
|
51
|
-
table: {
|
|
52
|
-
category: "Appearance",
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
fullWidth: {
|
|
56
|
-
control: { type: "boolean" },
|
|
57
|
-
description: "Whether toast spans full width",
|
|
58
|
-
table: {
|
|
59
|
-
category: "Appearance",
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
// Behavior Config
|
|
63
|
-
autoDismiss: {
|
|
64
|
-
control: { type: "boolean" },
|
|
65
|
-
description: "Auto dismiss toast after duration",
|
|
66
|
-
table: {
|
|
67
|
-
category: "Behavior",
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
duration: {
|
|
71
|
-
control: { type: "range", min: 1000, max: 10000, step: 500 },
|
|
72
|
-
description: "Auto dismiss duration in milliseconds",
|
|
73
|
-
table: {
|
|
74
|
-
category: "Behavior",
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
revealDuration: {
|
|
78
|
-
control: { type: "range", min: 100, max: 1000, step: 50 },
|
|
79
|
-
description: "Animation duration for reveal/hide",
|
|
80
|
-
table: {
|
|
81
|
-
category: "Behavior",
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
// Content Config
|
|
85
|
-
text: {
|
|
86
|
-
control: { type: "text" },
|
|
87
|
-
description: "Toast message text",
|
|
88
|
-
table: {
|
|
89
|
-
category: "Content",
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
customIcon: {
|
|
93
|
-
control: { type: "text" },
|
|
94
|
-
description: "Custom icon name (e.g., 'akar-icons:check-box')",
|
|
95
|
-
table: {
|
|
96
|
-
category: "Content",
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
// DisplayPromptCore Config
|
|
100
|
-
usePrompt: {
|
|
101
|
-
control: { type: "boolean" },
|
|
102
|
-
description: "Use DisplayPromptCore instead of simple text",
|
|
103
|
-
table: {
|
|
104
|
-
category: "Prompt",
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
promptTheme: {
|
|
108
|
-
control: { type: "select" },
|
|
109
|
-
options: ["primary", "secondary", "success", "warning", "error", "info"],
|
|
110
|
-
description: "Theme for DisplayPromptCore",
|
|
111
|
-
table: {
|
|
112
|
-
category: "Prompt",
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
dismissible: {
|
|
116
|
-
control: { type: "boolean" },
|
|
117
|
-
description: "Whether DisplayPromptCore is dismissible",
|
|
118
|
-
table: {
|
|
119
|
-
category: "Prompt",
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
promptTitle: {
|
|
123
|
-
control: { type: "text" },
|
|
124
|
-
description: "Title for DisplayPromptCore",
|
|
125
|
-
table: {
|
|
126
|
-
category: "Prompt",
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
promptContent: {
|
|
130
|
-
control: { type: "text" },
|
|
131
|
-
description: "Content for DisplayPromptCore",
|
|
132
|
-
table: {
|
|
133
|
-
category: "Prompt",
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
useAutoFocus: {
|
|
137
|
-
control: { type: "boolean" },
|
|
138
|
-
description: "Auto focus DisplayPromptCore",
|
|
139
|
-
table: {
|
|
140
|
-
category: "Prompt",
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
styleClassPassthrough: {
|
|
144
|
-
control: { type: "object" },
|
|
145
|
-
description: "Style classes for DisplayPromptCore (e.g., ['dark', 'outlined'])",
|
|
146
|
-
table: {
|
|
147
|
-
category: "Prompt",
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
// Hide complex internal props
|
|
151
|
-
config: {
|
|
152
|
-
table: {
|
|
153
|
-
disable: true,
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
modelValue: {
|
|
157
|
-
table: {
|
|
158
|
-
disable: true,
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
args: {
|
|
163
|
-
theme: "primary",
|
|
164
|
-
position: "top",
|
|
165
|
-
alignment: "right",
|
|
166
|
-
fullWidth: false,
|
|
167
|
-
autoDismiss: false,
|
|
168
|
-
duration: 3000,
|
|
169
|
-
revealDuration: 300,
|
|
170
|
-
text: "This is a toast notification message",
|
|
171
|
-
customIcon: "",
|
|
172
|
-
usePrompt: false,
|
|
173
|
-
promptTheme: "primary",
|
|
174
|
-
dismissible: true,
|
|
175
|
-
promptTitle: "Prompt Title",
|
|
176
|
-
promptContent: "This is prompt content, it can contain html or plain text.",
|
|
177
|
-
useAutoFocus: false,
|
|
178
|
-
styleClassPassthrough: ["dark", "outlined"],
|
|
179
|
-
},
|
|
180
|
-
} as Meta<ToastStoryArgs>;
|
|
181
|
-
|
|
182
|
-
const Template: StoryFn<ToastStoryArgs> = (args) => ({
|
|
183
|
-
components: {
|
|
184
|
-
StorybookComponent,
|
|
185
|
-
},
|
|
186
|
-
setup() {
|
|
187
|
-
const isActive = ref(false);
|
|
188
|
-
|
|
189
|
-
// Auto-trigger toast for demo
|
|
190
|
-
onMounted(() => {
|
|
191
|
-
setTimeout(() => {
|
|
192
|
-
isActive.value = true;
|
|
193
|
-
}, 500);
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
return { args, isActive };
|
|
197
|
-
},
|
|
198
|
-
template: `
|
|
199
|
-
<div style="position: relative; height: 200px; padding: 20px;">
|
|
200
|
-
<p style="margin-bottom: 20px;">Toast will appear and demonstrate the configured behavior:</p>
|
|
201
|
-
<p v-if="args.usePrompt" style="margin-bottom: 10px; font-style: italic; color: #666;">
|
|
202
|
-
Note: DisplayPromptCore examples require component to be properly loaded in the environment.
|
|
203
|
-
</p>
|
|
204
|
-
<button
|
|
205
|
-
@click="isActive = true"
|
|
206
|
-
style="padding: 8px 16px; background: #0066cc; color: white; border: none; border-radius: 4px; cursor: pointer;"
|
|
207
|
-
>
|
|
208
|
-
Trigger Toast
|
|
209
|
-
</button>
|
|
210
|
-
|
|
211
|
-
<StorybookComponent
|
|
212
|
-
v-model="isActive"
|
|
213
|
-
:config="{
|
|
214
|
-
appearance: {
|
|
215
|
-
theme: args.theme,
|
|
216
|
-
position: args.position,
|
|
217
|
-
alignment: args.alignment,
|
|
218
|
-
fullWidth: args.fullWidth
|
|
219
|
-
},
|
|
220
|
-
behavior: {
|
|
221
|
-
autoDismiss: args.autoDismiss,
|
|
222
|
-
duration: args.duration,
|
|
223
|
-
revealDuration: args.revealDuration
|
|
224
|
-
},
|
|
225
|
-
content: args.usePrompt ? {
|
|
226
|
-
text: args.promptTitle + ': ' + args.promptContent
|
|
227
|
-
} : {
|
|
228
|
-
text: args.text,
|
|
229
|
-
...(args.customIcon && { customIcon: args.customIcon })
|
|
230
|
-
},
|
|
231
|
-
}"
|
|
232
|
-
/>
|
|
233
|
-
</div>
|
|
234
|
-
`,
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
export const Default = Template.bind({});
|
|
238
|
-
|
|
239
|
-
export const SuccessToast = Template.bind({});
|
|
240
|
-
SuccessToast.args = {
|
|
241
|
-
theme: "success",
|
|
242
|
-
text: "Success! Your action was completed.",
|
|
243
|
-
customIcon: "akar-icons:check-box",
|
|
244
|
-
autoDismiss: false,
|
|
245
|
-
duration: 4000,
|
|
246
|
-
position: "top",
|
|
247
|
-
alignment: "right",
|
|
248
|
-
fullWidth: false,
|
|
249
|
-
revealDuration: 300,
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
export const ErrorToast = Template.bind({});
|
|
253
|
-
ErrorToast.args = {
|
|
254
|
-
theme: "error",
|
|
255
|
-
text: "Error! Something went wrong.",
|
|
256
|
-
autoDismiss: false,
|
|
257
|
-
position: "top",
|
|
258
|
-
alignment: "center",
|
|
259
|
-
fullWidth: false,
|
|
260
|
-
duration: 3000,
|
|
261
|
-
revealDuration: 300,
|
|
262
|
-
customIcon: "",
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
export const BottomCenterToast = Template.bind({});
|
|
266
|
-
BottomCenterToast.args = {
|
|
267
|
-
theme: "info",
|
|
268
|
-
text: "Info message at bottom center",
|
|
269
|
-
position: "bottom",
|
|
270
|
-
alignment: "center",
|
|
271
|
-
autoDismiss: false,
|
|
272
|
-
duration: 5000,
|
|
273
|
-
fullWidth: false,
|
|
274
|
-
revealDuration: 300,
|
|
275
|
-
customIcon: "",
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
export const FullWidthToast = Template.bind({});
|
|
279
|
-
FullWidthToast.args = {
|
|
280
|
-
theme: "warning",
|
|
281
|
-
text: "Full width warning message",
|
|
282
|
-
fullWidth: true,
|
|
283
|
-
position: "top",
|
|
284
|
-
alignment: "left",
|
|
285
|
-
autoDismiss: false,
|
|
286
|
-
duration: 6000,
|
|
287
|
-
revealDuration: 300,
|
|
288
|
-
customIcon: "",
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
// DisplayPromptCore Examples - Based on Playground
|
|
292
|
-
export const ErrorPromptToast = Template.bind({});
|
|
293
|
-
ErrorPromptToast.args = {
|
|
294
|
-
theme: "error",
|
|
295
|
-
position: "top",
|
|
296
|
-
alignment: "right",
|
|
297
|
-
fullWidth: false,
|
|
298
|
-
autoDismiss: false,
|
|
299
|
-
duration: 5000,
|
|
300
|
-
revealDuration: 300,
|
|
301
|
-
usePrompt: true,
|
|
302
|
-
promptTheme: "error",
|
|
303
|
-
dismissible: false,
|
|
304
|
-
promptTitle: "Error Prompt Title with content",
|
|
305
|
-
promptContent: "This is an error prompt content, it can contain html or plain text.",
|
|
306
|
-
useAutoFocus: false,
|
|
307
|
-
styleClassPassthrough: ["dark", "outlined"],
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
export const SuccessPromptToast = Template.bind({});
|
|
311
|
-
SuccessPromptToast.args = {
|
|
312
|
-
theme: "success",
|
|
313
|
-
position: "top",
|
|
314
|
-
alignment: "right",
|
|
315
|
-
fullWidth: false,
|
|
316
|
-
autoDismiss: false,
|
|
317
|
-
duration: 3000,
|
|
318
|
-
revealDuration: 300,
|
|
319
|
-
usePrompt: true,
|
|
320
|
-
promptTheme: "success",
|
|
321
|
-
dismissible: true,
|
|
322
|
-
promptTitle: "Success Prompt Title with content (Dismissible)",
|
|
323
|
-
promptContent: "This is success prompt content, it can contain html or plain text.",
|
|
324
|
-
useAutoFocus: true,
|
|
325
|
-
styleClassPassthrough: ["dark", "outlined"],
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
export const InfoPromptFullWidth = Template.bind({});
|
|
329
|
-
InfoPromptFullWidth.args = {
|
|
330
|
-
theme: "info",
|
|
331
|
-
position: "top",
|
|
332
|
-
alignment: "center",
|
|
333
|
-
fullWidth: true,
|
|
334
|
-
autoDismiss: false,
|
|
335
|
-
duration: 4000,
|
|
336
|
-
revealDuration: 300,
|
|
337
|
-
usePrompt: true,
|
|
338
|
-
promptTheme: "info",
|
|
339
|
-
dismissible: false,
|
|
340
|
-
promptTitle: "Info Prompt Title with content (Auto Dismiss)",
|
|
341
|
-
promptContent: "This is info prompt content displayed full width.",
|
|
342
|
-
useAutoFocus: false,
|
|
343
|
-
styleClassPassthrough: ["dark", "outlined"],
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
export const WarningPromptBottomCenter = Template.bind({});
|
|
347
|
-
WarningPromptBottomCenter.args = {
|
|
348
|
-
theme: "warning",
|
|
349
|
-
position: "bottom",
|
|
350
|
-
alignment: "center",
|
|
351
|
-
fullWidth: false,
|
|
352
|
-
autoDismiss: false,
|
|
353
|
-
duration: 6000,
|
|
354
|
-
revealDuration: 300,
|
|
355
|
-
usePrompt: true,
|
|
356
|
-
promptTheme: "warning",
|
|
357
|
-
dismissible: true,
|
|
358
|
-
promptTitle: "Warning Prompt at Bottom Center",
|
|
359
|
-
promptContent: "This warning prompt appears at the bottom center with auto dismiss.",
|
|
360
|
-
useAutoFocus: false,
|
|
361
|
-
styleClassPassthrough: ["outlined"],
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
export const PrimaryPromptCustomStyles = Template.bind({});
|
|
365
|
-
PrimaryPromptCustomStyles.args = {
|
|
366
|
-
theme: "primary",
|
|
367
|
-
position: "top",
|
|
368
|
-
alignment: "left",
|
|
369
|
-
fullWidth: false,
|
|
370
|
-
autoDismiss: false,
|
|
371
|
-
duration: 3000,
|
|
372
|
-
revealDuration: 500,
|
|
373
|
-
usePrompt: true,
|
|
374
|
-
promptTheme: "primary",
|
|
375
|
-
dismissible: true,
|
|
376
|
-
promptTitle: "Primary Prompt with Custom Styles",
|
|
377
|
-
promptContent: "This prompt uses custom style configurations and slower reveal animation.",
|
|
378
|
-
useAutoFocus: false,
|
|
379
|
-
styleClassPassthrough: ["dark"],
|
|
380
|
-
};
|