pimelon-ui 0.1.135 → 0.1.155
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/melon/Help/HelpModal.vue +1 -1
- package/melon/HelpCenter/HelpCenter.vue +1 -1
- package/melon/Onboarding/IntermediateStepModal.vue +8 -2
- package/melon/Onboarding/OnboardingSteps.vue +45 -11
- package/melon/Onboarding/onboarding.js +27 -14
- package/melon/session.js +8 -0
- package/package.json +10 -1
- package/src/components/{Alert.vue → Alert/Alert.vue} +1 -5
- package/src/components/Alert/index.ts +2 -0
- package/src/components/Alert/types.ts +4 -0
- package/src/components/{Autocomplete.vue → Autocomplete/Autocomplete.vue} +10 -43
- package/src/components/Autocomplete/index.ts +2 -0
- package/src/components/Autocomplete/types.ts +38 -0
- package/src/components/{Avatar.vue → Avatar/Avatar.vue} +2 -8
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/Avatar/types.ts +6 -0
- package/src/components/{Badge.vue → Badge/Badge.vue} +1 -11
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Badge/types.ts +10 -0
- package/src/components/{Breadcrumbs.vue → Breadcrumbs/Breadcrumbs.vue} +4 -14
- package/src/components/Breadcrumbs/index.ts +2 -0
- package/src/components/Breadcrumbs/types.ts +12 -0
- package/src/components/Button/Button.vue +4 -23
- package/src/components/Button/index.ts +2 -1
- package/src/components/Button/types.ts +23 -0
- package/src/components/{Calendar.story.md → Calendar/Calendar.story.md} +38 -91
- package/src/components/{Calendar.story.vue → Calendar/Calendar.story.vue} +2 -2
- package/src/components/Calendar/Calendar.vue +1 -1
- package/src/components/Calendar/NewEventModal.vue +3 -3
- package/src/components/Charts/Charts.story.vue +4 -0
- package/src/components/Charts/ECharts.vue +11 -1
- package/src/components/Charts/axisChartOptions.ts +54 -74
- package/src/components/Charts/eChartOptions.ts +20 -4
- package/src/components/Charts/helpers.ts +31 -0
- package/src/components/Charts/types.ts +21 -0
- package/src/components/{Checkbox.vue → Checkbox/Checkbox.vue} +2 -10
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/Checkbox/types.ts +9 -0
- package/src/components/{CircularProgressBar.vue → CircularProgressBar/CircularProgressBar.vue} +3 -22
- package/src/components/CircularProgressBar/index.ts +2 -0
- package/src/components/CircularProgressBar/types.ts +25 -0
- package/src/components/Combobox/Combobox.vue +93 -93
- package/src/components/ConfirmDialog.vue +1 -1
- package/src/components/DatePicker/DatePicker.vue +7 -5
- package/src/components/DatePicker/DateRangePicker.vue +3 -3
- package/src/components/DatePicker/DateTimePicker.vue +7 -4
- package/src/components/DatePicker/{DatePicker.ts → types.ts} +2 -1
- package/src/components/{Dialog.story.vue → Dialog/Dialog.story.vue} +1 -1
- package/src/components/{Dialog.vue → Dialog/Dialog.vue} +5 -43
- package/src/components/Dialog/index.ts +2 -0
- package/src/components/Dialog/types.ts +41 -0
- package/src/components/{Divider.vue → Divider/Divider.vue} +2 -14
- package/src/components/Divider/index.ts +2 -0
- package/src/components/Divider/types.ts +12 -0
- package/src/components/{Dropdown.story.vue → Dropdown/Dropdown.story.vue} +2 -2
- package/src/components/{Dropdown.vue → Dropdown/Dropdown.vue} +9 -28
- package/src/components/Dropdown/index.ts +2 -0
- package/src/components/Dropdown/types.ts +26 -0
- package/src/components/ErrorMessage/ErrorMessage.vue +23 -0
- package/src/components/ErrorMessage/index.ts +2 -0
- package/src/components/ErrorMessage/types.ts +3 -0
- package/src/components/{FileUploader.story.vue → FileUploader/FileUploader.story.vue} +1 -1
- package/src/components/{FileUploader.vue → FileUploader/FileUploader.vue} +1 -1
- package/src/components/FileUploader/index.ts +1 -0
- package/src/components/{FormControl.story.vue → FormControl/FormControl.story.vue} +2 -2
- package/src/components/{FormControl.vue → FormControl/FormControl.vue} +31 -33
- package/src/components/FormControl/index.ts +2 -0
- package/src/components/FormControl/types.ts +10 -0
- package/src/components/FormLabel.vue +33 -0
- package/src/components/Input.vue +1 -1
- package/src/components/ListView/ListFooter.vue +1 -1
- package/src/components/ListView/ListHeader.vue +1 -1
- package/src/components/ListView/ListRow.vue +3 -3
- package/src/components/ListView/ListSelectBanner.vue +1 -1
- package/src/components/ListView/ListView.story.vue +2 -2
- package/src/components/ListView/ListView.vue +1 -0
- package/src/components/{Popover.story.vue → Popover/Popover.story.vue} +1 -1
- package/src/components/Popover/index.ts +1 -0
- package/src/components/{Progress.vue → Progress/Progress.vue} +2 -10
- package/src/components/Progress/index.ts +2 -0
- package/src/components/Progress/types.ts +8 -0
- package/src/components/Provider/MelonUIProvider.vue +9 -0
- package/src/components/Rating/Rating.vue +1 -8
- package/src/components/Rating/index.ts +2 -0
- package/src/components/Rating/types.ts +7 -0
- package/src/components/{Select.vue → Select/Select.vue} +1 -18
- package/src/components/Select/index.ts +2 -0
- package/src/components/Select/types.ts +18 -0
- package/src/components/Spinner/index.ts +1 -0
- package/src/components/{Switch.vue → Switch/Switch.vue} +4 -11
- package/src/components/Switch/index.ts +2 -0
- package/src/components/Switch/types.ts +7 -0
- package/src/components/{TabButtons.vue → TabButtons/TabButtons.vue} +1 -1
- package/src/components/TabButtons/index.ts +1 -0
- package/src/components/TextEditor/EditLink.vue +9 -22
- package/src/components/TextEditor/FontColor.vue +67 -32
- package/src/components/TextEditor/InsertImage.vue +2 -1
- package/src/components/TextEditor/InsertLink.vue +8 -66
- package/src/components/TextEditor/InsertVideo.vue +2 -2
- package/src/components/TextEditor/Menu.vue +1 -1
- package/src/components/TextEditor/TextEditor.vue +71 -26
- package/src/components/TextEditor/TextEditorBubbleMenu.vue +6 -1
- package/src/components/TextEditor/extensions/color/color-extension.ts +151 -0
- package/src/components/TextEditor/extensions/color/color-styles.css +25 -0
- package/src/components/TextEditor/extensions/color/index.ts +2 -0
- package/src/components/TextEditor/{EmojiList.vue → extensions/emoji/EmojiList.vue} +15 -10
- package/src/components/TextEditor/extensions/emoji/emoji-extension.ts +55 -0
- package/src/components/TextEditor/extensions/heading/heading.ts +20 -0
- package/src/components/TextEditor/extensions/highlight/highlight-extension.ts +241 -0
- package/src/components/TextEditor/extensions/highlight/highlight-styles.css +32 -0
- package/src/components/TextEditor/extensions/highlight/index.ts +2 -0
- package/src/components/TextEditor/extensions/image/ImageNodeView.vue +263 -0
- package/src/components/TextEditor/{image-extension.ts → extensions/image/image-extension.ts} +53 -26
- package/src/components/TextEditor/extensions/image/index.ts +5 -0
- package/src/components/TextEditor/extensions/shared/color-utils.ts +236 -0
- package/src/components/TextEditor/{SlashCommandsList.vue → extensions/slash-commands/SlashCommandsList.vue} +22 -10
- package/src/components/TextEditor/extensions/slash-commands/slash-commands-extension.ts +155 -0
- package/src/components/TextEditor/{SuggestionList.vue → extensions/suggestion/SuggestionList.vue} +4 -7
- package/src/components/TextEditor/extensions/suggestion/createSuggestionExtension.ts +151 -0
- package/src/components/TextEditor/extensions/tag/tag-extension.ts +153 -0
- package/src/components/TextEditor/link-extension.ts +235 -78
- package/src/components/TextEditor/linkPasteHandler.ts +51 -0
- package/src/components/{TextInput.story.vue → TextInput/TextInput.story.vue} +2 -2
- package/src/components/{TextInput.vue → TextInput/TextInput.vue} +2 -14
- package/src/components/TextInput/index.ts +2 -0
- package/src/components/TextInput/types.ts +14 -0
- package/src/components/{Textarea.vue → Textarea/Textarea.vue} +2 -13
- package/src/components/Textarea/index.ts +2 -0
- package/src/components/Textarea/types.ts +11 -0
- package/src/components/Toast/Toast.vue +145 -0
- package/src/components/Toast/ToastProvider.vue +14 -0
- package/src/components/Toast/index.ts +181 -0
- package/src/components/Toast/types.ts +15 -0
- package/src/components/Tooltip/Tooltip.vue +8 -18
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/Tooltip/types.ts +10 -0
- package/src/components/Tree/Tree.vue +8 -15
- package/src/components/Tree/index.ts +2 -0
- package/src/components/{types/Tree.ts → Tree/types.ts} +6 -0
- package/src/icons/CircleCheck.vue +9 -0
- package/src/index.ts +29 -27
- package/src/tailwind/colorPalette.js +23 -7
- package/src/tailwind/figma-variables-to-colors.js +3 -3
- package/src/tailwind/plugin.js +14 -6
- package/src/tailwind/preset.js +6 -7
- package/src/tailwind/update-tailwind-classes.js +3 -3
- package/src/utils/file-to-base64.ts +13 -0
- package/src/utils/tailwind.config.js +2 -2
- package/src/utils/url-validation.ts +39 -0
- package/src/utils/useFileUpload.ts +1 -1
- package/vite/buildConfig.js +3 -5
- package/vite/doctypeInterfaceGenerator.js +3 -5
- package/vite/generateTypes.js +6 -4
- package/vite/index.js +6 -6
- package/vite/jinjaBootData.js +1 -3
- package/vite/lucideIcons.js +9 -11
- package/vite/melonProxy.js +2 -4
- package/vite/melonTypes.js +8 -5
- package/vite/utils.js +5 -11
- package/src/components/ErrorMessage.vue +0 -24
- package/src/components/TextEditor/ImageNodeView.vue +0 -125
- package/src/components/TextEditor/emoji-extension.js +0 -100
- package/src/components/TextEditor/slash-commands-extension.ts +0 -265
- package/src/components/Toast.vue +0 -81
- package/src/components/toast.js +0 -98
- package/src/utils/file-to-base64.js +0 -9
- /package/src/components/{Autocomplete.story.vue → Autocomplete/Autocomplete.story.vue} +0 -0
- /package/src/components/{Avatar.story.vue → Avatar/Avatar.story.vue} +0 -0
- /package/src/components/{Badge.story.vue → Badge/Badge.story.vue} +0 -0
- /package/src/components/{Breadcrumbs.story.vue → Breadcrumbs/Breadcrumbs.story.vue} +0 -0
- /package/src/components/{Checkbox.story.vue → Checkbox/Checkbox.story.vue} +0 -0
- /package/src/components/{CircularProgressBar.story.md → CircularProgressBar/CircularProgressBar.story.md} +0 -0
- /package/src/components/{CircularProgressBar.story.vue → CircularProgressBar/CircularProgressBar.story.vue} +0 -0
- /package/src/components/{ErrorMessage.story.vue → ErrorMessage/ErrorMessage.story.vue} +0 -0
- /package/src/components/{Popover.vue → Popover/Popover.vue} +0 -0
- /package/src/components/{Progress.story.vue → Progress/Progress.story.vue} +0 -0
- /package/src/components/{Select.story.vue → Select/Select.story.vue} +0 -0
- /package/src/components/{Spinner.story.vue → Spinner/Spinner.story.vue} +0 -0
- /package/src/components/{Spinner.vue → Spinner/Spinner.vue} +0 -0
- /package/src/components/{Switch.story.vue → Switch/Switch.story.vue} +0 -0
- /package/src/components/{TabButtons.story.vue → TabButtons/TabButtons.story.vue} +0 -0
- /package/src/components/TextEditor/{emojis.json → extensions/emoji/emojis.json} +0 -0
- /package/src/components/{Textarea.story.vue → Textarea/Textarea.story.vue} +0 -0
package/melon/Help/HelpModal.vue
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</div>
|
|
54
54
|
</template>
|
|
55
55
|
<script setup>
|
|
56
|
-
import Dropdown from '../../src/components/Dropdown.vue'
|
|
56
|
+
import Dropdown from '../../src/components/Dropdown/Dropdown.vue'
|
|
57
57
|
import Button from '../../src/components/Button/Button.vue'
|
|
58
58
|
import StepsIcon from '../Icons/StepsIcon.vue'
|
|
59
59
|
import MinimizeIcon from '../Icons/MinimizeIcon.vue'
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
<script setup>
|
|
65
65
|
import Button from '../../src/components/Button/Button.vue'
|
|
66
66
|
import FeatherIcon from '../../src/components/FeatherIcon.vue'
|
|
67
|
-
import TextInput from '../../src/components/TextInput.vue'
|
|
67
|
+
import TextInput from '../../src/components/TextInput/TextInput.vue'
|
|
68
68
|
import { ref, computed, onMounted } from 'vue'
|
|
69
69
|
|
|
70
70
|
const props = defineProps({
|
|
@@ -7,7 +7,13 @@
|
|
|
7
7
|
<slot>
|
|
8
8
|
<div class="flex flex-col gap-2 text-ink-gray-9 text-base">
|
|
9
9
|
<div v-if="currentStep.message">{{ currentStep.message }}</div>
|
|
10
|
-
<video
|
|
10
|
+
<video
|
|
11
|
+
v-if="currentStep.videoURL"
|
|
12
|
+
class="w-full rounded"
|
|
13
|
+
controls
|
|
14
|
+
autoplay
|
|
15
|
+
muted
|
|
16
|
+
>
|
|
11
17
|
<source :src="currentStep.videoURL" type="video/mp4" />
|
|
12
18
|
Your browser does not support the video tag.
|
|
13
19
|
</video>
|
|
@@ -20,7 +26,7 @@
|
|
|
20
26
|
</Dialog>
|
|
21
27
|
</template>
|
|
22
28
|
<script setup>
|
|
23
|
-
import Dialog from '../../src/components/Dialog
|
|
29
|
+
import { Dialog } from '../../src/components/Dialog'
|
|
24
30
|
import { computed } from 'vue'
|
|
25
31
|
|
|
26
32
|
const props = defineProps({
|
|
@@ -35,25 +35,38 @@
|
|
|
35
35
|
v-for="step in steps"
|
|
36
36
|
:key="step.title"
|
|
37
37
|
class="group w-full flex gap-2 justify-between items-center hover:bg-surface-gray-1 rounded px-2 py-1.5 cursor-pointer"
|
|
38
|
-
@click.stop="
|
|
38
|
+
@click.stop="
|
|
39
|
+
() => !step.completed && !isDependent(step) && step.onClick()
|
|
40
|
+
"
|
|
39
41
|
>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
:
|
|
42
|
+
<component
|
|
43
|
+
:is="isDependent(step) ? Tooltip : 'div'"
|
|
44
|
+
:text="dependsOnTooltip(step)"
|
|
43
45
|
>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
<div
|
|
47
|
+
class="flex gap-2 items-center"
|
|
48
|
+
:class="[
|
|
49
|
+
step.completed
|
|
50
|
+
? 'text-ink-gray-5'
|
|
51
|
+
: isDependent(step)
|
|
52
|
+
? 'text-ink-gray-4'
|
|
53
|
+
: 'text-ink-gray-8',
|
|
54
|
+
]"
|
|
55
|
+
>
|
|
56
|
+
<component :is="step.icon" class="h-4" />
|
|
57
|
+
<div class="text-base" :class="{ 'line-through': step.completed }">
|
|
58
|
+
{{ step.title }}
|
|
59
|
+
</div>
|
|
47
60
|
</div>
|
|
48
|
-
</
|
|
61
|
+
</component>
|
|
49
62
|
<Button
|
|
50
|
-
v-if="!step.completed"
|
|
63
|
+
v-if="!step.completed && !isDependent(step)"
|
|
51
64
|
:label="'Skip'"
|
|
52
65
|
class="!h-4 text-xs !text-ink-gray-6 hidden group-hover:flex"
|
|
53
66
|
@click="() => skip(step.name, afterSkip)"
|
|
54
67
|
/>
|
|
55
68
|
<Button
|
|
56
|
-
v-else
|
|
69
|
+
v-else-if="!isDependent(step)"
|
|
57
70
|
:label="'Reset'"
|
|
58
71
|
class="!h-4 text-xs !text-ink-gray-6 hidden group-hover:flex"
|
|
59
72
|
@click.stop="() => reset(step.name, afterReset)"
|
|
@@ -64,8 +77,9 @@
|
|
|
64
77
|
</template>
|
|
65
78
|
<script setup>
|
|
66
79
|
import { useOnboarding } from './onboarding'
|
|
80
|
+
import Tooltip from '../../src/components/Tooltip/Tooltip.vue'
|
|
67
81
|
import Button from '../../src/components/Button/Button.vue'
|
|
68
|
-
import Badge from '../../src/components/Badge.vue'
|
|
82
|
+
import Badge from '../../src/components/Badge/Badge.vue'
|
|
69
83
|
|
|
70
84
|
const props = defineProps({
|
|
71
85
|
appName: {
|
|
@@ -98,6 +112,26 @@ const props = defineProps({
|
|
|
98
112
|
},
|
|
99
113
|
})
|
|
100
114
|
|
|
115
|
+
function isDependent(step) {
|
|
116
|
+
if (step.dependsOn && !step.completed) {
|
|
117
|
+
const dependsOnStep = steps.find((s) => s.name === step.dependsOn)
|
|
118
|
+
if (dependsOnStep && !dependsOnStep.completed) {
|
|
119
|
+
return true
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return false
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function dependsOnTooltip(step) {
|
|
126
|
+
if (step.dependsOn && !step.completed) {
|
|
127
|
+
const dependsOnStep = steps.find((s) => s.name === step.dependsOn)
|
|
128
|
+
if (dependsOnStep && !dependsOnStep.completed) {
|
|
129
|
+
return `You need to complete "${dependsOnStep.title}" first.`
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return ''
|
|
133
|
+
}
|
|
134
|
+
|
|
101
135
|
const {
|
|
102
136
|
steps,
|
|
103
137
|
stepsCompleted,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import call from '../../src/utils/call'
|
|
2
2
|
import { createResource } from '../../src/resources'
|
|
3
|
-
import { minimize } from '../Help/help'
|
|
3
|
+
import { minimize, showHelpModal } from '../Help/help'
|
|
4
|
+
import { sessionUser } from '../session'
|
|
4
5
|
import { useStorage } from '@vueuse/core'
|
|
5
6
|
import { computed, reactive } from 'vue'
|
|
6
7
|
|
|
@@ -8,13 +9,18 @@ const onboardings = reactive({})
|
|
|
8
9
|
const onboardingStatus = useStorage('onboardingStatus', {})
|
|
9
10
|
|
|
10
11
|
export function useOnboarding(appName) {
|
|
12
|
+
const user = sessionUser()
|
|
13
|
+
|
|
14
|
+
if (!user || user === 'Guest') return
|
|
15
|
+
|
|
11
16
|
const isOnboardingStepsCompleted = useStorage(
|
|
12
|
-
'isOnboardingStepsCompleted' + appName,
|
|
17
|
+
'isOnboardingStepsCompleted' + appName + user,
|
|
13
18
|
false,
|
|
14
19
|
)
|
|
15
20
|
|
|
16
21
|
const onboardingSteps = computed(
|
|
17
|
-
() =>
|
|
22
|
+
() =>
|
|
23
|
+
onboardingStatus.value?.[user]?.[appName + '_onboarding_status'] || [],
|
|
18
24
|
)
|
|
19
25
|
|
|
20
26
|
if (!onboardingSteps.value.length && !isOnboardingStepsCompleted.value) {
|
|
@@ -23,7 +29,7 @@ export function useOnboarding(appName) {
|
|
|
23
29
|
cache: 'onboarding_status',
|
|
24
30
|
auto: true,
|
|
25
31
|
onSuccess: (data) => {
|
|
26
|
-
onboardingStatus.value = data
|
|
32
|
+
onboardingStatus.value[user] = data
|
|
27
33
|
syncStatus()
|
|
28
34
|
},
|
|
29
35
|
})
|
|
@@ -63,11 +69,13 @@ export function useOnboarding(appName) {
|
|
|
63
69
|
if (isOnboardingStepsCompleted.value) return
|
|
64
70
|
|
|
65
71
|
if (!onboardingSteps.value.length) {
|
|
66
|
-
onboardingStatus.value[
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
if (!onboardingStatus.value[user]) {
|
|
73
|
+
onboardingStatus.value[user] = {}
|
|
74
|
+
}
|
|
75
|
+
onboardingStatus.value[user][appName + '_onboarding_status'] =
|
|
76
|
+
onboardings[appName].map((s) => {
|
|
77
|
+
return { name: s.name, completed: false }
|
|
78
|
+
})
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
let index = onboardingSteps.value.findIndex((s) => s.name === step)
|
|
@@ -87,11 +95,14 @@ export function useOnboarding(appName) {
|
|
|
87
95
|
if (isOnboardingStepsCompleted.value && value) return
|
|
88
96
|
|
|
89
97
|
if (!onboardingSteps.value.length) {
|
|
90
|
-
onboardingStatus.value[
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
if (!onboardingStatus.value[user]) {
|
|
99
|
+
onboardingStatus.value[user] = {}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
onboardingStatus.value[user][appName + '_onboarding_status'] =
|
|
103
|
+
onboardings[appName].map((s) => {
|
|
104
|
+
return { name: s.name, completed: value }
|
|
105
|
+
})
|
|
95
106
|
} else {
|
|
96
107
|
onboardingSteps.value.forEach((step) => {
|
|
97
108
|
step.completed = value
|
|
@@ -129,6 +140,8 @@ export function useOnboarding(appName) {
|
|
|
129
140
|
}
|
|
130
141
|
|
|
131
142
|
function setUp(steps) {
|
|
143
|
+
showHelpModal.value = !isOnboardingStepsCompleted.value
|
|
144
|
+
|
|
132
145
|
if (onboardings[appName]) return
|
|
133
146
|
|
|
134
147
|
onboardings[appName] = steps
|
package/melon/session.js
ADDED
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pimelon-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.155",
|
|
4
4
|
"description": "A set of components and utilities for rapid UI development",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "vitest",
|
|
8
9
|
"prettier": "yarn prettier -w ./src",
|
|
@@ -27,12 +28,16 @@
|
|
|
27
28
|
"author": "Alphamonak Solutions",
|
|
28
29
|
"license": "MIT",
|
|
29
30
|
"dependencies": {
|
|
31
|
+
"@floating-ui/vue": "^1.1.6",
|
|
30
32
|
"@headlessui/vue": "^1.7.14",
|
|
31
33
|
"@popperjs/core": "^2.11.2",
|
|
32
34
|
"@tailwindcss/forms": "^0.5.3",
|
|
33
35
|
"@tailwindcss/typography": "^0.5.16",
|
|
36
|
+
"@tiptap/core": "^2.11.7",
|
|
37
|
+
"@tiptap/extension-code-block": "^2.11.9",
|
|
34
38
|
"@tiptap/extension-code-block-lowlight": "^2.11.5",
|
|
35
39
|
"@tiptap/extension-color": "^2.0.3",
|
|
40
|
+
"@tiptap/extension-heading": "^2.12.0",
|
|
36
41
|
"@tiptap/extension-highlight": "^2.0.3",
|
|
37
42
|
"@tiptap/extension-image": "^2.0.3",
|
|
38
43
|
"@tiptap/extension-link": "^2.0.3",
|
|
@@ -53,12 +58,16 @@
|
|
|
53
58
|
"dayjs": "^1.11.13",
|
|
54
59
|
"echarts": "^5.6.0",
|
|
55
60
|
"feather-icons": "^4.28.0",
|
|
61
|
+
"highlight.js": "^11.11.1",
|
|
56
62
|
"husky": "^9.1.7",
|
|
57
63
|
"idb-keyval": "^6.2.0",
|
|
58
64
|
"lowlight": "^3.3.0",
|
|
59
65
|
"lucide-static": "^0.479.0",
|
|
60
66
|
"ora": "5.4.1",
|
|
61
67
|
"prettier": "^3.3.2",
|
|
68
|
+
"prosemirror-model": "^1.25.1",
|
|
69
|
+
"prosemirror-state": "^1.4.3",
|
|
70
|
+
"prosemirror-view": "^1.39.2",
|
|
62
71
|
"radix-vue": "^1.5.3",
|
|
63
72
|
"reka-ui": "^2.0.2",
|
|
64
73
|
"showdown": "^2.1.0",
|
|
@@ -38,11 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
<script setup lang="ts">
|
|
40
40
|
import { computed } from 'vue'
|
|
41
|
-
|
|
42
|
-
interface AlertProps {
|
|
43
|
-
title?: string
|
|
44
|
-
type?: 'warning'
|
|
45
|
-
}
|
|
41
|
+
import type { AlertProps } from './types'
|
|
46
42
|
|
|
47
43
|
const props = withDefaults(defineProps<AlertProps>(), {
|
|
48
44
|
type: 'warning',
|
|
@@ -206,49 +206,16 @@ import {
|
|
|
206
206
|
ComboboxOptions,
|
|
207
207
|
} from '@headlessui/vue'
|
|
208
208
|
import { computed, nextTick, ref, watch } from 'vue'
|
|
209
|
-
import Popover from '
|
|
210
|
-
import { Button } from '
|
|
211
|
-
import FeatherIcon from '
|
|
212
|
-
import LoadingIndicator from '
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
type OptionValue = string | number | boolean
|
|
222
|
-
|
|
223
|
-
type AutocompleteOption = OptionValue | Option
|
|
224
|
-
|
|
225
|
-
type AutocompleteOptionGroup = {
|
|
226
|
-
group: string
|
|
227
|
-
items: AutocompleteOption[]
|
|
228
|
-
hideLabel?: boolean
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
type AutocompleteOptions = AutocompleteOption[] | AutocompleteOptionGroup[]
|
|
232
|
-
|
|
233
|
-
type AutocompleteProps = {
|
|
234
|
-
label?: string
|
|
235
|
-
options: AutocompleteOptions
|
|
236
|
-
hideSearch?: boolean
|
|
237
|
-
placeholder?: string
|
|
238
|
-
bodyClasses?: string | string[]
|
|
239
|
-
loading?: boolean
|
|
240
|
-
placement?: string
|
|
241
|
-
showFooter?: boolean
|
|
242
|
-
} & (
|
|
243
|
-
| {
|
|
244
|
-
multiple: true
|
|
245
|
-
modelValue?: AutocompleteOption[] | null
|
|
246
|
-
}
|
|
247
|
-
| {
|
|
248
|
-
multiple?: false
|
|
249
|
-
modelValue?: AutocompleteOption | null
|
|
250
|
-
}
|
|
251
|
-
)
|
|
209
|
+
import { Popover } from '../Popover'
|
|
210
|
+
import { Button } from '../Button'
|
|
211
|
+
import FeatherIcon from '../FeatherIcon.vue'
|
|
212
|
+
import LoadingIndicator from '../LoadingIndicator.vue'
|
|
213
|
+
import type {
|
|
214
|
+
AutocompleteOptionGroup,
|
|
215
|
+
AutocompleteOption,
|
|
216
|
+
AutocompleteProps,
|
|
217
|
+
Option,
|
|
218
|
+
} from './types'
|
|
252
219
|
|
|
253
220
|
const props = withDefaults(defineProps<AutocompleteProps>(), {
|
|
254
221
|
multiple: false,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type OptionValue = string | number | boolean
|
|
2
|
+
|
|
3
|
+
export type Option = {
|
|
4
|
+
label: string
|
|
5
|
+
value: OptionValue
|
|
6
|
+
description?: string
|
|
7
|
+
[key: string]: any
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type AutocompleteOption = OptionValue | Option
|
|
11
|
+
|
|
12
|
+
export type AutocompleteOptionGroup = {
|
|
13
|
+
group: string
|
|
14
|
+
items: AutocompleteOption[]
|
|
15
|
+
hideLabel?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type AutocompleteOptions = AutocompleteOption[] | AutocompleteOptionGroup[]
|
|
19
|
+
|
|
20
|
+
export type AutocompleteProps = {
|
|
21
|
+
label?: string
|
|
22
|
+
options: AutocompleteOptions
|
|
23
|
+
hideSearch?: boolean
|
|
24
|
+
placeholder?: string
|
|
25
|
+
bodyClasses?: string | string[]
|
|
26
|
+
loading?: boolean
|
|
27
|
+
placement?: string
|
|
28
|
+
showFooter?: boolean
|
|
29
|
+
} & (
|
|
30
|
+
| {
|
|
31
|
+
multiple: true
|
|
32
|
+
modelValue?: AutocompleteOption[] | null
|
|
33
|
+
}
|
|
34
|
+
| {
|
|
35
|
+
multiple?: false
|
|
36
|
+
modelValue?: AutocompleteOption | null
|
|
37
|
+
}
|
|
38
|
+
)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
/>
|
|
13
13
|
<div
|
|
14
14
|
v-else
|
|
15
|
-
class="flex h-full w-full items-center justify-center bg-surface-gray-2 uppercase text-ink-gray-5"
|
|
15
|
+
class="flex h-full w-full items-center justify-center bg-surface-gray-2 uppercase text-ink-gray-5 select-none"
|
|
16
16
|
:class="[labelClasses, shapeClasses]"
|
|
17
17
|
>
|
|
18
18
|
<div :class="iconClasses" v-if="$slots.default">
|
|
@@ -38,16 +38,10 @@
|
|
|
38
38
|
|
|
39
39
|
<script setup lang="ts">
|
|
40
40
|
import { ref, computed } from 'vue'
|
|
41
|
+
import type { AvatarProps } from './types'
|
|
41
42
|
|
|
42
43
|
const imgFetchError = ref(false)
|
|
43
44
|
|
|
44
|
-
interface AvatarProps {
|
|
45
|
-
image?: string
|
|
46
|
-
label?: string
|
|
47
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'
|
|
48
|
-
shape?: 'circle' | 'square'
|
|
49
|
-
}
|
|
50
|
-
|
|
51
45
|
const props = withDefaults(defineProps<AvatarProps>(), {
|
|
52
46
|
size: 'md',
|
|
53
47
|
shape: 'circle',
|
|
@@ -21,17 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
<script lang="ts" setup>
|
|
23
23
|
import { computed } from 'vue'
|
|
24
|
-
|
|
25
|
-
interface Label {
|
|
26
|
-
toString(): string
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface BadgeProps {
|
|
30
|
-
theme?: 'gray' | 'blue' | 'green' | 'orange' | 'red'
|
|
31
|
-
size?: 'sm' | 'md' | 'lg'
|
|
32
|
-
variant?: 'solid' | 'subtle' | 'outline' | 'ghost'
|
|
33
|
-
label?: Label | string | number
|
|
34
|
-
}
|
|
24
|
+
import type { BadgeProps } from './types'
|
|
35
25
|
|
|
36
26
|
const props = withDefaults(defineProps<BadgeProps>(), {
|
|
37
27
|
theme: 'gray',
|
|
@@ -78,20 +78,10 @@
|
|
|
78
78
|
<script setup lang="ts">
|
|
79
79
|
import { useWindowSize } from '@vueuse/core'
|
|
80
80
|
import { computed } from 'vue'
|
|
81
|
-
import {
|
|
82
|
-
import Dropdown from '../
|
|
83
|
-
import { Button } from '
|
|
84
|
-
|
|
85
|
-
interface BreadcrumbItem {
|
|
86
|
-
label: string
|
|
87
|
-
route?: RouterLinkProps['to']
|
|
88
|
-
onClick?: () => void
|
|
89
|
-
[key: string]: any
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
interface BreadcrumbsProps {
|
|
93
|
-
items: BreadcrumbItem[]
|
|
94
|
-
}
|
|
81
|
+
import { useRouter } from 'vue-router'
|
|
82
|
+
import { Dropdown } from '../Dropdown'
|
|
83
|
+
import { Button } from '../Button'
|
|
84
|
+
import type { BreadcrumbsProps } from './types'
|
|
95
85
|
|
|
96
86
|
const props = defineProps<BreadcrumbsProps>()
|
|
97
87
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
<component v-else-if="icon" :is="icon" :class="slotClasses" />
|
|
37
37
|
<slot name="icon" v-else-if="$slots.icon" />
|
|
38
38
|
</template>
|
|
39
|
-
<span v-else :class="{ 'sr-only': isIconButton }">
|
|
39
|
+
<span v-else :class="{ 'sr-only': isIconButton }" class="truncate">
|
|
40
40
|
<slot>{{ label }}</slot>
|
|
41
41
|
</span>
|
|
42
42
|
|
|
@@ -52,29 +52,11 @@
|
|
|
52
52
|
</button>
|
|
53
53
|
</template>
|
|
54
54
|
<script lang="ts" setup>
|
|
55
|
-
import { computed, useSlots
|
|
55
|
+
import { computed, useSlots } from 'vue'
|
|
56
56
|
import FeatherIcon from '../FeatherIcon.vue'
|
|
57
57
|
import LoadingIndicator from '../LoadingIndicator.vue'
|
|
58
|
-
import { useRouter
|
|
59
|
-
|
|
60
|
-
type Theme = 'gray' | 'blue' | 'green' | 'red'
|
|
61
|
-
type Size = 'sm' | 'md' | 'lg' | 'xl' | '2xl'
|
|
62
|
-
type Variant = 'solid' | 'subtle' | 'outline' | 'ghost'
|
|
63
|
-
|
|
64
|
-
export interface ButtonProps {
|
|
65
|
-
theme?: Theme
|
|
66
|
-
size?: Size
|
|
67
|
-
variant?: Variant
|
|
68
|
-
label?: string
|
|
69
|
-
icon?: string | Component
|
|
70
|
-
iconLeft?: string | Component
|
|
71
|
-
iconRight?: string | Component
|
|
72
|
-
loading?: boolean
|
|
73
|
-
loadingText?: string
|
|
74
|
-
disabled?: boolean
|
|
75
|
-
route?: RouteLocation
|
|
76
|
-
link?: string
|
|
77
|
-
}
|
|
58
|
+
import { useRouter } from 'vue-router'
|
|
59
|
+
import type { ButtonProps, ThemeVariant } from './types'
|
|
78
60
|
|
|
79
61
|
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
80
62
|
theme: 'gray',
|
|
@@ -134,7 +116,6 @@ const buttonClasses = computed(() => {
|
|
|
134
116
|
ghost: ghostClasses,
|
|
135
117
|
}[props.variant]
|
|
136
118
|
|
|
137
|
-
type ThemeVariant = `${Theme}-${Variant}`
|
|
138
119
|
let themeVariant: ThemeVariant = `${props.theme}-${props.variant}`
|
|
139
120
|
|
|
140
121
|
let disabledClassesMap: Record<ThemeVariant, string> = {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as Button
|
|
1
|
+
export { default as Button } from './Button.vue'
|
|
2
|
+
export type { ButtonProps } from './types'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type RouteLocation } from 'vue-router'
|
|
2
|
+
import { type Component } from 'vue'
|
|
3
|
+
|
|
4
|
+
type Theme = 'gray' | 'blue' | 'green' | 'red'
|
|
5
|
+
type Size = 'sm' | 'md' | 'lg' | 'xl' | '2xl'
|
|
6
|
+
type Variant = 'solid' | 'subtle' | 'outline' | 'ghost'
|
|
7
|
+
|
|
8
|
+
export interface ButtonProps {
|
|
9
|
+
theme?: Theme
|
|
10
|
+
size?: Size
|
|
11
|
+
variant?: Variant
|
|
12
|
+
label?: string
|
|
13
|
+
icon?: string | Component
|
|
14
|
+
iconLeft?: string | Component
|
|
15
|
+
iconRight?: string | Component
|
|
16
|
+
loading?: boolean
|
|
17
|
+
loadingText?: string
|
|
18
|
+
disabled?: boolean
|
|
19
|
+
route?: RouteLocation
|
|
20
|
+
link?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type ThemeVariant = `${Theme}-${Variant}`
|