sprintify-ui 0.0.140 → 0.0.142
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/sprintify-ui.es.js +13123 -11495
- package/dist/style.css +1 -4
- package/dist/types/src/components/BaseColor.vue.d.ts +3 -3
- package/dist/types/src/components/BaseDatePicker.vue.d.ts +68 -22
- package/dist/types/src/components/BaseForm.vue.d.ts +2 -2
- package/dist/types/src/components/BaseInputLabel.vue.d.ts +13 -1
- package/dist/types/src/components/BaseRichText.vue.d.ts +1 -1
- package/package.json +6 -6
- package/src/components/BaseColor.vue +1 -1
- package/src/components/BaseDatePicker.stories.js +54 -10
- package/src/components/BaseDatePicker.vue +165 -226
- package/src/components/BaseDropdown.stories.js +1 -1
- package/src/components/BaseInput.vue +37 -33
- package/src/components/BaseInputLabel.stories.js +6 -1
- package/src/components/BaseInputLabel.vue +48 -2
|
@@ -20,7 +20,7 @@ const Template = (args) => ({
|
|
|
20
20
|
return { args };
|
|
21
21
|
},
|
|
22
22
|
template: `
|
|
23
|
-
<form @submit.prevent="">
|
|
23
|
+
<form @submit.prevent="" class="mt-10">
|
|
24
24
|
<BaseInputLabel v-bind="args"></BaseInputLabel>
|
|
25
25
|
<BaseInput required name="name" placeholder="Enter your first name"></BaseInput>
|
|
26
26
|
</form>
|
|
@@ -29,3 +29,8 @@ const Template = (args) => ({
|
|
|
29
29
|
|
|
30
30
|
export const Demo = Template.bind({});
|
|
31
31
|
Demo.args = {};
|
|
32
|
+
|
|
33
|
+
export const Help = Template.bind({});
|
|
34
|
+
Help.args = {
|
|
35
|
+
help: 'Enter your first name here',
|
|
36
|
+
};
|
|
@@ -1,13 +1,50 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<label :class="classes">
|
|
3
|
-
|
|
3
|
+
<div
|
|
4
|
+
class="relative"
|
|
5
|
+
:class="[help ? 'cursor-help' : 'cursor-default']"
|
|
6
|
+
@mouseenter="showTooltip = true"
|
|
7
|
+
@mouseleave="showTooltip = false"
|
|
8
|
+
>
|
|
9
|
+
<span> {{ label }}</span>
|
|
10
|
+
|
|
11
|
+
<BaseIcon
|
|
12
|
+
v-if="help"
|
|
13
|
+
class="relative bottom-px ml-1 inline h-4 w-4 text-slate-400"
|
|
14
|
+
icon="heroicons:question-mark-circle-20-solid"
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
<span v-if="required" class="ml-0.5 text-red-600"> *</span>
|
|
18
|
+
|
|
19
|
+
<Transition
|
|
20
|
+
enter-active-class="transition duration-200 ease-out"
|
|
21
|
+
enter-from-class="transform scale-95 opacity-0"
|
|
22
|
+
enter-to-class="transform scale-100 opacity-100"
|
|
23
|
+
leave-active-class="transition duration-75 ease-in"
|
|
24
|
+
leave-from-class="transform scale-100 opacity-100"
|
|
25
|
+
leave-to-class="transform scale-95 opacity-0"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
v-if="showTooltip && help"
|
|
29
|
+
class="pointer-events-none absolute bottom-[100%] left-0 z-[1] w-auto max-w-[300px]"
|
|
30
|
+
>
|
|
31
|
+
<div
|
|
32
|
+
class="relative bottom-1 rounded-md bg-slate-700 py-1 px-2 text-xs leading-tight text-white"
|
|
33
|
+
>
|
|
34
|
+
{{ help }}
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</Transition>
|
|
38
|
+
</div>
|
|
4
39
|
</label>
|
|
5
40
|
</template>
|
|
6
41
|
|
|
7
42
|
<script lang="ts">
|
|
8
|
-
import { defineComponent } from 'vue';
|
|
43
|
+
import { defineComponent, PropType } from 'vue';
|
|
44
|
+
import { BaseIcon } from '.';
|
|
9
45
|
|
|
10
46
|
export default defineComponent({
|
|
47
|
+
components: { BaseIcon },
|
|
11
48
|
props: {
|
|
12
49
|
required: {
|
|
13
50
|
default: false,
|
|
@@ -21,6 +58,15 @@ export default defineComponent({
|
|
|
21
58
|
default: 'mb-1 block text-sm',
|
|
22
59
|
type: String,
|
|
23
60
|
},
|
|
61
|
+
help: {
|
|
62
|
+
default: null,
|
|
63
|
+
type: [String, null] as PropType<string | null>,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
data() {
|
|
67
|
+
return {
|
|
68
|
+
showTooltip: false,
|
|
69
|
+
};
|
|
24
70
|
},
|
|
25
71
|
});
|
|
26
72
|
</script>
|