vueless 0.0.631 → 0.0.633
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.
|
@@ -107,7 +107,7 @@ const SettingsTemplate: StoryFn<VOnClickOutsideArgs> = (args: VOnClickOutsideArg
|
|
|
107
107
|
});
|
|
108
108
|
|
|
109
109
|
export const Default = DefaultTemplate.bind({});
|
|
110
|
-
Default.args = {
|
|
110
|
+
Default.args = {};
|
|
111
111
|
|
|
112
112
|
export const Settings = SettingsTemplate.bind({});
|
|
113
113
|
Settings.args = {};
|
|
@@ -2,6 +2,8 @@ import type { Meta, StoryFn } from "@storybook/vue3";
|
|
|
2
2
|
|
|
3
3
|
import UIcon from "../../../ui.image-icon/UIcon.vue";
|
|
4
4
|
import URow from "../../../ui.container-row/URow.vue";
|
|
5
|
+
import UAlert from "../../../ui.text-alert/UAlert.vue";
|
|
6
|
+
import ULink from "../../../ui.button-link/ULink.vue";
|
|
5
7
|
import tooltip from "../vTooltip.ts";
|
|
6
8
|
|
|
7
9
|
import type { Props } from "tippy.js";
|
|
@@ -10,11 +12,6 @@ interface VTooltipArgs {
|
|
|
10
12
|
tooltipOptions: Partial<Props> | string;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
interface VTooltipEnumArgs extends VTooltipArgs {
|
|
14
|
-
enum: keyof Props;
|
|
15
|
-
options: unknown[];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
15
|
/**
|
|
19
16
|
* The `v-tooltip` directive. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/directives/tooltip)
|
|
20
17
|
*/
|
|
@@ -32,70 +29,34 @@ const DefaultTemplate: StoryFn<VTooltipArgs> = (args: VTooltipArgs) => ({
|
|
|
32
29
|
return { args };
|
|
33
30
|
},
|
|
34
31
|
template: `
|
|
35
|
-
<UIcon interactive name="sentiment_satisfied" v-tooltip="
|
|
32
|
+
<UIcon interactive name="sentiment_satisfied" v-tooltip="'Tooltip'" />
|
|
36
33
|
`,
|
|
37
34
|
});
|
|
38
35
|
|
|
39
|
-
const
|
|
40
|
-
components: { UIcon, URow },
|
|
36
|
+
const SettingsTemplate: StoryFn<VTooltipArgs> = (args: VTooltipArgs) => ({
|
|
37
|
+
components: { UIcon, URow, UAlert, ULink },
|
|
41
38
|
directives: { tooltip },
|
|
42
39
|
setup() {
|
|
43
40
|
return { args };
|
|
44
41
|
},
|
|
45
42
|
template: `
|
|
46
|
-
<URow>
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
<URow align="center">
|
|
44
|
+
<UAlert variant="secondary">
|
|
45
|
+
<p>
|
|
46
|
+
See all available settings in <ULink label="Tippy.js docs" href="https://atomiks.github.io/tippyjs/v6/all-props/" underlined />
|
|
47
|
+
</p>
|
|
48
|
+
</UAlert>
|
|
49
|
+
<UIcon
|
|
50
|
+
interactive
|
|
51
|
+
name="sentiment_satisfied"
|
|
52
|
+
v-tooltip="{ content: '<b>Tooltip</b>', placement: 'bottom', allowHTML: true, zIndex: 42 }"
|
|
52
53
|
/>
|
|
53
54
|
</URow>
|
|
54
55
|
`,
|
|
55
56
|
});
|
|
56
57
|
|
|
57
58
|
export const Default = DefaultTemplate.bind({});
|
|
58
|
-
Default.args = {
|
|
59
|
+
Default.args = {};
|
|
59
60
|
|
|
60
|
-
export const Settings =
|
|
61
|
-
Settings.args = {
|
|
62
|
-
|
|
63
|
-
Settings.parameters = {
|
|
64
|
-
docs: {
|
|
65
|
-
source: {
|
|
66
|
-
// Do not break this line, this will lead to wrong formatting.
|
|
67
|
-
code: `<UIcon interactive name="sentiment_satisfied" v-tooltip="{ content: 'Tooltip', placement: 'right' }">`,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const Placement = EnumTemplate.bind({});
|
|
73
|
-
Placement.args = {
|
|
74
|
-
tooltipOptions: {},
|
|
75
|
-
enum: "placement",
|
|
76
|
-
options: [
|
|
77
|
-
"top",
|
|
78
|
-
"top-start",
|
|
79
|
-
"top-end",
|
|
80
|
-
"right",
|
|
81
|
-
"right-start",
|
|
82
|
-
"right-end",
|
|
83
|
-
"bottom",
|
|
84
|
-
"bottom-start",
|
|
85
|
-
"bottom-end",
|
|
86
|
-
"left",
|
|
87
|
-
"left-start",
|
|
88
|
-
"left-end",
|
|
89
|
-
"auto",
|
|
90
|
-
"auto-start",
|
|
91
|
-
"auto-end",
|
|
92
|
-
],
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
Placement.parameters = {
|
|
96
|
-
docs: {
|
|
97
|
-
source: {
|
|
98
|
-
code: `<UIcon interactive name="sentiment_satisfied" v-tooltip="{ content: 'top', placement: 'top' }">`,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
};
|
|
61
|
+
export const Settings = SettingsTemplate.bind({});
|
|
62
|
+
Settings.args = {};
|
package/package.json
CHANGED
|
@@ -204,17 +204,17 @@ const { textareaAttrs, textareaLabelAttrs, textareaWrapperAttrs, leftSlotAttrs,
|
|
|
204
204
|
v-bind="textareaLabelAttrs"
|
|
205
205
|
:data-test="dataTest"
|
|
206
206
|
>
|
|
207
|
-
<label
|
|
208
|
-
v-if="hasSlotContent($slots['left'])"
|
|
209
|
-
ref="leftSlotWrapperRef"
|
|
210
|
-
:for="elementId"
|
|
211
|
-
v-bind="leftSlotAttrs"
|
|
212
|
-
>
|
|
213
|
-
<!-- @slot Use it to add something before the text. -->
|
|
214
|
-
<slot name="left" />
|
|
215
|
-
</label>
|
|
216
|
-
|
|
217
207
|
<label ref="textareaWrapperRef" :for="elementId" v-bind="textareaWrapperAttrs">
|
|
208
|
+
<div
|
|
209
|
+
v-if="hasSlotContent($slots['left'])"
|
|
210
|
+
ref="leftSlotWrapperRef"
|
|
211
|
+
:for="elementId"
|
|
212
|
+
v-bind="leftSlotAttrs"
|
|
213
|
+
>
|
|
214
|
+
<!-- @slot Use it to add something before the text. -->
|
|
215
|
+
<slot name="left" />
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
218
|
<textarea
|
|
219
219
|
:id="elementId"
|
|
220
220
|
ref="textareaRef"
|
|
@@ -235,11 +235,11 @@ const { textareaAttrs, textareaLabelAttrs, textareaWrapperAttrs, leftSlotAttrs,
|
|
|
235
235
|
@keydown.enter="onEnter"
|
|
236
236
|
@keydown.delete="onBackspace"
|
|
237
237
|
/>
|
|
238
|
-
</label>
|
|
239
238
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
<div v-if="hasSlotContent($slots['right'])" :for="elementId" v-bind="rightSlotAttrs">
|
|
240
|
+
<!-- @slot Use it to add something after the text. -->
|
|
241
|
+
<slot name="right" />
|
|
242
|
+
</div>
|
|
243
243
|
</label>
|
|
244
244
|
</ULabel>
|
|
245
245
|
</template>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
textareaLabel: "{ULabel}",
|
|
3
|
-
leftSlot: "flex items-center justify-center whitespace-nowrap
|
|
4
|
-
rightSlot: "flex items-center justify-center whitespace-nowrap
|
|
3
|
+
leftSlot: "flex items-center justify-center whitespace-nowrap pr-2.5 gap-1 rounded-dynamic rounded-r-none",
|
|
4
|
+
rightSlot: "flex items-center justify-center whitespace-nowrap pl-2.5 gap-1 rounded-dynamic rounded-l-none",
|
|
5
5
|
textareaWrapper: {
|
|
6
6
|
base: `
|
|
7
|
-
px-3 py-2 bg-white transition w-full
|
|
7
|
+
flex px-3 py-2 bg-white transition w-full
|
|
8
8
|
rounded-dynamic border border-gray-300 hover:border-gray-400 hover:focus-within:border-brand-500
|
|
9
9
|
focus-within:border-brand-500 focus-within:ring-dynamic focus-within:ring-offset-dynamic
|
|
10
10
|
focus-within:ring-brand-700/15 focus-within:outline-none
|
|
@@ -24,11 +24,6 @@ export default /*tw*/ {
|
|
|
24
24
|
`,
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
|
-
compoundVariants: [
|
|
28
|
-
{ labelAlign: "topInside", label: true, size: "sm", class: "pt-5" },
|
|
29
|
-
{ labelAlign: "topInside", label: true, size: "md", class: "pt-6" },
|
|
30
|
-
{ labelAlign: "topInside", label: true, size: "lg", class: "pt-7" },
|
|
31
|
-
],
|
|
32
27
|
},
|
|
33
28
|
textarea: {
|
|
34
29
|
base: `
|
|
@@ -49,6 +44,11 @@ export default /*tw*/ {
|
|
|
49
44
|
true: "placeholder:text-red-300",
|
|
50
45
|
},
|
|
51
46
|
},
|
|
47
|
+
compoundVariants: [
|
|
48
|
+
{ labelAlign: "topInside", label: true, size: "sm", class: "pt-5" },
|
|
49
|
+
{ labelAlign: "topInside", label: true, size: "md", class: "pt-6" },
|
|
50
|
+
{ labelAlign: "topInside", label: true, size: "lg", class: "pt-7" },
|
|
51
|
+
],
|
|
52
52
|
},
|
|
53
53
|
defaults: {
|
|
54
54
|
rows: "3",
|