@witchcraft/ui 0.3.17 → 0.3.18
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/module.json +1 -1
- package/dist/runtime/components/LibNotifications/LibNotification.vue +2 -0
- package/dist/runtime/components/LibNotifications/LibNotifications.vue +4 -1
- package/dist/runtime/components/LibTable/LibTable.d.vue.ts +1 -1
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +1 -1
- package/package.json +1 -1
- package/src/runtime/components/LibNotifications/LibNotification.vue +2 -0
- package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +16 -9
- package/src/runtime/components/LibNotifications/LibNotifications.vue +4 -1
- package/src/runtime/components/LibTable/LibTable.vue +1 -1
package/dist/module.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
:handler="handler"
|
|
30
30
|
tabindex="0"
|
|
31
31
|
:notification="notification"
|
|
32
|
-
class="overflow-hidden my-2"
|
|
32
|
+
class="overflow-hidden my-2 max-h-[25dvh] min-h-[300px]"
|
|
33
33
|
v-for="notification of notifications"
|
|
34
34
|
:key="notification.id"
|
|
35
35
|
@pause="handler.pause(notification)"
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
class="
|
|
69
69
|
data-[state=open]:animate-contentShow
|
|
70
70
|
fixed
|
|
71
|
+
flex
|
|
71
72
|
top-[50%]
|
|
72
73
|
left-[50%]
|
|
73
74
|
translate-x-[-50%]
|
|
@@ -79,6 +80,8 @@
|
|
|
79
80
|
>
|
|
80
81
|
<lib-notification
|
|
81
82
|
class="
|
|
83
|
+
max-w-full
|
|
84
|
+
max-h-full
|
|
82
85
|
top-notification
|
|
83
86
|
text-md
|
|
84
87
|
gap-2
|
|
@@ -36,7 +36,7 @@ type RealProps = {
|
|
|
36
36
|
* Since the table now truncates rows by default, they will always be the same height unless you change the inner styling. In fixed mode, `forceRecalculateFixedVirtualizer` is exposed if you need to force re-calculation.
|
|
37
37
|
*
|
|
38
38
|
* If using slots, be sure to at least pass the `class` slot prop to the td element. `style` with width is also supplied but is not required if you're displaying the table as a table.
|
|
39
|
-
|
|
39
|
+
*
|
|
40
40
|
* ### Dynamic (experimental)
|
|
41
41
|
*
|
|
42
42
|
* In `dynamic` mode we use tanstack's measureElement method. This is more expensive, but it will work with any heights.
|
|
@@ -36,7 +36,7 @@ type RealProps = {
|
|
|
36
36
|
* Since the table now truncates rows by default, they will always be the same height unless you change the inner styling. In fixed mode, `forceRecalculateFixedVirtualizer` is exposed if you need to force re-calculation.
|
|
37
37
|
*
|
|
38
38
|
* If using slots, be sure to at least pass the `class` slot prop to the td element. `style` with width is also supplied but is not required if you're displaying the table as a table.
|
|
39
|
-
|
|
39
|
+
*
|
|
40
40
|
* ### Dynamic (experimental)
|
|
41
41
|
*
|
|
42
42
|
* In `dynamic` mode we use tanstack's measureElement method. This is more expensive, but it will work with any heights.
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
+
import { faker } from "@faker-js/faker"
|
|
2
3
|
import type { Meta, StoryObj } from "@storybook/vue3"
|
|
3
|
-
import { ref } from "vue"
|
|
4
|
+
import { computed, ref } from "vue"
|
|
4
5
|
|
|
5
6
|
import LibNotifications from "./LibNotifications.vue"
|
|
6
7
|
|
|
@@ -29,22 +30,26 @@ export const Primary: Story = {
|
|
|
29
30
|
|
|
30
31
|
const withTitle = ref(args.withTitle)
|
|
31
32
|
const disableTimeout = ref(false)
|
|
33
|
+
const lotsOfText = ref(false)
|
|
34
|
+
const paragraphs = `\n Simulating lots of text:\n${faker.lorem.paragraphs(20)}`
|
|
35
|
+
const extraText = computed(() => lotsOfText.value ? paragraphs : "")
|
|
32
36
|
|
|
33
37
|
const notifyRequiresAction = () => {
|
|
34
38
|
count++
|
|
35
39
|
void handler.notify({
|
|
36
40
|
title: withTitle.value ? `Notification(${count})` : undefined,
|
|
37
|
-
message: `This is a notification that requires action. Pick an option
|
|
41
|
+
message: `This is a notification that requires action. Pick an option:${extraText.value}`,
|
|
38
42
|
requiresAction: true,
|
|
39
43
|
options: ["Ok", "Default Answer", "Cancel"],
|
|
40
44
|
default: "Default Answer"
|
|
41
45
|
})
|
|
42
46
|
}
|
|
47
|
+
|
|
43
48
|
const notifyWithDangerousOption = () => {
|
|
44
49
|
count++
|
|
45
50
|
void handler.notify({
|
|
46
51
|
title: withTitle.value ? `Notification(${count})` : undefined,
|
|
47
|
-
message: `This is a notification that has a dangerous option. Pick an option
|
|
52
|
+
message: `This is a notification that has a dangerous option. Pick an option:${extraText.value}`,
|
|
48
53
|
options: ["Ok", "Default Answer", "Dangerous Option", "Cancel"],
|
|
49
54
|
default: "Default Answer",
|
|
50
55
|
dangerous: ["Dangerous Option"]
|
|
@@ -54,7 +59,7 @@ export const Primary: Story = {
|
|
|
54
59
|
count++
|
|
55
60
|
void handler.notify({
|
|
56
61
|
title: withTitle.value ? `Notification(${count})` : undefined,
|
|
57
|
-
message: `This is a non-cancellable notification. Pick an option
|
|
62
|
+
message: `This is a non-cancellable notification. Pick an option:${extraText.value}`,
|
|
58
63
|
options: ["Ok", "Default Answer"],
|
|
59
64
|
default: "Default Answer",
|
|
60
65
|
cancellable: false
|
|
@@ -64,7 +69,7 @@ export const Primary: Story = {
|
|
|
64
69
|
count++
|
|
65
70
|
void handler.notify({
|
|
66
71
|
title: withTitle.value ? `Notification(${count})` : undefined,
|
|
67
|
-
message: `This is a non-cancellable notification. Pick an option
|
|
72
|
+
message: `This is a non-cancellable notification. Pick an option:${extraText.value}`,
|
|
68
73
|
requiresAction: true,
|
|
69
74
|
options: ["Ok", "Default Answer"],
|
|
70
75
|
default: "Default Answer",
|
|
@@ -75,7 +80,7 @@ export const Primary: Story = {
|
|
|
75
80
|
count++
|
|
76
81
|
void handler.notify({
|
|
77
82
|
title: withTitle.value ? `Notification(${count})` : undefined,
|
|
78
|
-
message: `This is a notification. No action required
|
|
83
|
+
message: `This is a notification. No action required.${extraText.value}`,
|
|
79
84
|
timeout: disableTimeout.value ? false : 5000
|
|
80
85
|
})
|
|
81
86
|
}
|
|
@@ -88,6 +93,7 @@ export const Primary: Story = {
|
|
|
88
93
|
handler,
|
|
89
94
|
withTitle,
|
|
90
95
|
disableTimeout,
|
|
96
|
+
lotsOfText,
|
|
91
97
|
args: {
|
|
92
98
|
outline: false,
|
|
93
99
|
...args
|
|
@@ -103,9 +109,10 @@ export const Primary: Story = {
|
|
|
103
109
|
<lib-button :label="'Notify Non-Cancellable that RequiresAction'" @click="notifyNonCancellableRequiresAction()"></lib-button>
|
|
104
110
|
<lib-button :label="'Notify With Dangerous Option'" @click="notifyWithDangerousOption()"></lib-button>
|
|
105
111
|
<lib-button :label="'Notify Non-Cancellable'" @click="notifyNonCancellable()"></lib-button>
|
|
106
|
-
<
|
|
107
|
-
<
|
|
108
|
-
|
|
112
|
+
<lib-checkbox v-model="lotsOfText">Use lots of text</lib-checkbox>
|
|
113
|
+
<lib-checkbox v-model="disableTimeout">Disable Timeout</lib-checkbox>
|
|
114
|
+
<lib-checkbox v-model="withTitle">With Title</lib-checkbox>
|
|
115
|
+
<lib-notifications :handler="handler" />
|
|
109
116
|
History:
|
|
110
117
|
<lib-debug>
|
|
111
118
|
<template v-for="entry in handler.history">
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
:handler="handler"
|
|
30
30
|
tabindex="0"
|
|
31
31
|
:notification="notification"
|
|
32
|
-
class="overflow-hidden my-2"
|
|
32
|
+
class="overflow-hidden my-2 max-h-[25dvh] min-h-[300px]"
|
|
33
33
|
v-for="notification of notifications"
|
|
34
34
|
:key="notification.id"
|
|
35
35
|
@pause="handler.pause(notification)"
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
class="
|
|
69
69
|
data-[state=open]:animate-contentShow
|
|
70
70
|
fixed
|
|
71
|
+
flex
|
|
71
72
|
top-[50%]
|
|
72
73
|
left-[50%]
|
|
73
74
|
translate-x-[-50%]
|
|
@@ -79,6 +80,8 @@
|
|
|
79
80
|
>
|
|
80
81
|
<lib-notification
|
|
81
82
|
class="
|
|
83
|
+
max-w-full
|
|
84
|
+
max-h-full
|
|
82
85
|
top-notification
|
|
83
86
|
text-md
|
|
84
87
|
gap-2
|
|
@@ -439,7 +439,7 @@ type RealProps = {
|
|
|
439
439
|
* Since the table now truncates rows by default, they will always be the same height unless you change the inner styling. In fixed mode, `forceRecalculateFixedVirtualizer` is exposed if you need to force re-calculation.
|
|
440
440
|
*
|
|
441
441
|
* If using slots, be sure to at least pass the `class` slot prop to the td element. `style` with width is also supplied but is not required if you're displaying the table as a table.
|
|
442
|
-
|
|
442
|
+
*
|
|
443
443
|
* ### Dynamic (experimental)
|
|
444
444
|
*
|
|
445
445
|
* In `dynamic` mode we use tanstack's measureElement method. This is more expensive, but it will work with any heights.
|