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.
Files changed (183) hide show
  1. package/melon/Help/HelpModal.vue +1 -1
  2. package/melon/HelpCenter/HelpCenter.vue +1 -1
  3. package/melon/Onboarding/IntermediateStepModal.vue +8 -2
  4. package/melon/Onboarding/OnboardingSteps.vue +45 -11
  5. package/melon/Onboarding/onboarding.js +27 -14
  6. package/melon/session.js +8 -0
  7. package/package.json +10 -1
  8. package/src/components/{Alert.vue → Alert/Alert.vue} +1 -5
  9. package/src/components/Alert/index.ts +2 -0
  10. package/src/components/Alert/types.ts +4 -0
  11. package/src/components/{Autocomplete.vue → Autocomplete/Autocomplete.vue} +10 -43
  12. package/src/components/Autocomplete/index.ts +2 -0
  13. package/src/components/Autocomplete/types.ts +38 -0
  14. package/src/components/{Avatar.vue → Avatar/Avatar.vue} +2 -8
  15. package/src/components/Avatar/index.ts +2 -0
  16. package/src/components/Avatar/types.ts +6 -0
  17. package/src/components/{Badge.vue → Badge/Badge.vue} +1 -11
  18. package/src/components/Badge/index.ts +2 -0
  19. package/src/components/Badge/types.ts +10 -0
  20. package/src/components/{Breadcrumbs.vue → Breadcrumbs/Breadcrumbs.vue} +4 -14
  21. package/src/components/Breadcrumbs/index.ts +2 -0
  22. package/src/components/Breadcrumbs/types.ts +12 -0
  23. package/src/components/Button/Button.vue +4 -23
  24. package/src/components/Button/index.ts +2 -1
  25. package/src/components/Button/types.ts +23 -0
  26. package/src/components/{Calendar.story.md → Calendar/Calendar.story.md} +38 -91
  27. package/src/components/{Calendar.story.vue → Calendar/Calendar.story.vue} +2 -2
  28. package/src/components/Calendar/Calendar.vue +1 -1
  29. package/src/components/Calendar/NewEventModal.vue +3 -3
  30. package/src/components/Charts/Charts.story.vue +4 -0
  31. package/src/components/Charts/ECharts.vue +11 -1
  32. package/src/components/Charts/axisChartOptions.ts +54 -74
  33. package/src/components/Charts/eChartOptions.ts +20 -4
  34. package/src/components/Charts/helpers.ts +31 -0
  35. package/src/components/Charts/types.ts +21 -0
  36. package/src/components/{Checkbox.vue → Checkbox/Checkbox.vue} +2 -10
  37. package/src/components/Checkbox/index.ts +2 -0
  38. package/src/components/Checkbox/types.ts +9 -0
  39. package/src/components/{CircularProgressBar.vue → CircularProgressBar/CircularProgressBar.vue} +3 -22
  40. package/src/components/CircularProgressBar/index.ts +2 -0
  41. package/src/components/CircularProgressBar/types.ts +25 -0
  42. package/src/components/Combobox/Combobox.vue +93 -93
  43. package/src/components/ConfirmDialog.vue +1 -1
  44. package/src/components/DatePicker/DatePicker.vue +7 -5
  45. package/src/components/DatePicker/DateRangePicker.vue +3 -3
  46. package/src/components/DatePicker/DateTimePicker.vue +7 -4
  47. package/src/components/DatePicker/{DatePicker.ts → types.ts} +2 -1
  48. package/src/components/{Dialog.story.vue → Dialog/Dialog.story.vue} +1 -1
  49. package/src/components/{Dialog.vue → Dialog/Dialog.vue} +5 -43
  50. package/src/components/Dialog/index.ts +2 -0
  51. package/src/components/Dialog/types.ts +41 -0
  52. package/src/components/{Divider.vue → Divider/Divider.vue} +2 -14
  53. package/src/components/Divider/index.ts +2 -0
  54. package/src/components/Divider/types.ts +12 -0
  55. package/src/components/{Dropdown.story.vue → Dropdown/Dropdown.story.vue} +2 -2
  56. package/src/components/{Dropdown.vue → Dropdown/Dropdown.vue} +9 -28
  57. package/src/components/Dropdown/index.ts +2 -0
  58. package/src/components/Dropdown/types.ts +26 -0
  59. package/src/components/ErrorMessage/ErrorMessage.vue +23 -0
  60. package/src/components/ErrorMessage/index.ts +2 -0
  61. package/src/components/ErrorMessage/types.ts +3 -0
  62. package/src/components/{FileUploader.story.vue → FileUploader/FileUploader.story.vue} +1 -1
  63. package/src/components/{FileUploader.vue → FileUploader/FileUploader.vue} +1 -1
  64. package/src/components/FileUploader/index.ts +1 -0
  65. package/src/components/{FormControl.story.vue → FormControl/FormControl.story.vue} +2 -2
  66. package/src/components/{FormControl.vue → FormControl/FormControl.vue} +31 -33
  67. package/src/components/FormControl/index.ts +2 -0
  68. package/src/components/FormControl/types.ts +10 -0
  69. package/src/components/FormLabel.vue +33 -0
  70. package/src/components/Input.vue +1 -1
  71. package/src/components/ListView/ListFooter.vue +1 -1
  72. package/src/components/ListView/ListHeader.vue +1 -1
  73. package/src/components/ListView/ListRow.vue +3 -3
  74. package/src/components/ListView/ListSelectBanner.vue +1 -1
  75. package/src/components/ListView/ListView.story.vue +2 -2
  76. package/src/components/ListView/ListView.vue +1 -0
  77. package/src/components/{Popover.story.vue → Popover/Popover.story.vue} +1 -1
  78. package/src/components/Popover/index.ts +1 -0
  79. package/src/components/{Progress.vue → Progress/Progress.vue} +2 -10
  80. package/src/components/Progress/index.ts +2 -0
  81. package/src/components/Progress/types.ts +8 -0
  82. package/src/components/Provider/MelonUIProvider.vue +9 -0
  83. package/src/components/Rating/Rating.vue +1 -8
  84. package/src/components/Rating/index.ts +2 -0
  85. package/src/components/Rating/types.ts +7 -0
  86. package/src/components/{Select.vue → Select/Select.vue} +1 -18
  87. package/src/components/Select/index.ts +2 -0
  88. package/src/components/Select/types.ts +18 -0
  89. package/src/components/Spinner/index.ts +1 -0
  90. package/src/components/{Switch.vue → Switch/Switch.vue} +4 -11
  91. package/src/components/Switch/index.ts +2 -0
  92. package/src/components/Switch/types.ts +7 -0
  93. package/src/components/{TabButtons.vue → TabButtons/TabButtons.vue} +1 -1
  94. package/src/components/TabButtons/index.ts +1 -0
  95. package/src/components/TextEditor/EditLink.vue +9 -22
  96. package/src/components/TextEditor/FontColor.vue +67 -32
  97. package/src/components/TextEditor/InsertImage.vue +2 -1
  98. package/src/components/TextEditor/InsertLink.vue +8 -66
  99. package/src/components/TextEditor/InsertVideo.vue +2 -2
  100. package/src/components/TextEditor/Menu.vue +1 -1
  101. package/src/components/TextEditor/TextEditor.vue +71 -26
  102. package/src/components/TextEditor/TextEditorBubbleMenu.vue +6 -1
  103. package/src/components/TextEditor/extensions/color/color-extension.ts +151 -0
  104. package/src/components/TextEditor/extensions/color/color-styles.css +25 -0
  105. package/src/components/TextEditor/extensions/color/index.ts +2 -0
  106. package/src/components/TextEditor/{EmojiList.vue → extensions/emoji/EmojiList.vue} +15 -10
  107. package/src/components/TextEditor/extensions/emoji/emoji-extension.ts +55 -0
  108. package/src/components/TextEditor/extensions/heading/heading.ts +20 -0
  109. package/src/components/TextEditor/extensions/highlight/highlight-extension.ts +241 -0
  110. package/src/components/TextEditor/extensions/highlight/highlight-styles.css +32 -0
  111. package/src/components/TextEditor/extensions/highlight/index.ts +2 -0
  112. package/src/components/TextEditor/extensions/image/ImageNodeView.vue +263 -0
  113. package/src/components/TextEditor/{image-extension.ts → extensions/image/image-extension.ts} +53 -26
  114. package/src/components/TextEditor/extensions/image/index.ts +5 -0
  115. package/src/components/TextEditor/extensions/shared/color-utils.ts +236 -0
  116. package/src/components/TextEditor/{SlashCommandsList.vue → extensions/slash-commands/SlashCommandsList.vue} +22 -10
  117. package/src/components/TextEditor/extensions/slash-commands/slash-commands-extension.ts +155 -0
  118. package/src/components/TextEditor/{SuggestionList.vue → extensions/suggestion/SuggestionList.vue} +4 -7
  119. package/src/components/TextEditor/extensions/suggestion/createSuggestionExtension.ts +151 -0
  120. package/src/components/TextEditor/extensions/tag/tag-extension.ts +153 -0
  121. package/src/components/TextEditor/link-extension.ts +235 -78
  122. package/src/components/TextEditor/linkPasteHandler.ts +51 -0
  123. package/src/components/{TextInput.story.vue → TextInput/TextInput.story.vue} +2 -2
  124. package/src/components/{TextInput.vue → TextInput/TextInput.vue} +2 -14
  125. package/src/components/TextInput/index.ts +2 -0
  126. package/src/components/TextInput/types.ts +14 -0
  127. package/src/components/{Textarea.vue → Textarea/Textarea.vue} +2 -13
  128. package/src/components/Textarea/index.ts +2 -0
  129. package/src/components/Textarea/types.ts +11 -0
  130. package/src/components/Toast/Toast.vue +145 -0
  131. package/src/components/Toast/ToastProvider.vue +14 -0
  132. package/src/components/Toast/index.ts +181 -0
  133. package/src/components/Toast/types.ts +15 -0
  134. package/src/components/Tooltip/Tooltip.vue +8 -18
  135. package/src/components/Tooltip/index.ts +2 -0
  136. package/src/components/Tooltip/types.ts +10 -0
  137. package/src/components/Tree/Tree.vue +8 -15
  138. package/src/components/Tree/index.ts +2 -0
  139. package/src/components/{types/Tree.ts → Tree/types.ts} +6 -0
  140. package/src/icons/CircleCheck.vue +9 -0
  141. package/src/index.ts +29 -27
  142. package/src/tailwind/colorPalette.js +23 -7
  143. package/src/tailwind/figma-variables-to-colors.js +3 -3
  144. package/src/tailwind/plugin.js +14 -6
  145. package/src/tailwind/preset.js +6 -7
  146. package/src/tailwind/update-tailwind-classes.js +3 -3
  147. package/src/utils/file-to-base64.ts +13 -0
  148. package/src/utils/tailwind.config.js +2 -2
  149. package/src/utils/url-validation.ts +39 -0
  150. package/src/utils/useFileUpload.ts +1 -1
  151. package/vite/buildConfig.js +3 -5
  152. package/vite/doctypeInterfaceGenerator.js +3 -5
  153. package/vite/generateTypes.js +6 -4
  154. package/vite/index.js +6 -6
  155. package/vite/jinjaBootData.js +1 -3
  156. package/vite/lucideIcons.js +9 -11
  157. package/vite/melonProxy.js +2 -4
  158. package/vite/melonTypes.js +8 -5
  159. package/vite/utils.js +5 -11
  160. package/src/components/ErrorMessage.vue +0 -24
  161. package/src/components/TextEditor/ImageNodeView.vue +0 -125
  162. package/src/components/TextEditor/emoji-extension.js +0 -100
  163. package/src/components/TextEditor/slash-commands-extension.ts +0 -265
  164. package/src/components/Toast.vue +0 -81
  165. package/src/components/toast.js +0 -98
  166. package/src/utils/file-to-base64.js +0 -9
  167. /package/src/components/{Autocomplete.story.vue → Autocomplete/Autocomplete.story.vue} +0 -0
  168. /package/src/components/{Avatar.story.vue → Avatar/Avatar.story.vue} +0 -0
  169. /package/src/components/{Badge.story.vue → Badge/Badge.story.vue} +0 -0
  170. /package/src/components/{Breadcrumbs.story.vue → Breadcrumbs/Breadcrumbs.story.vue} +0 -0
  171. /package/src/components/{Checkbox.story.vue → Checkbox/Checkbox.story.vue} +0 -0
  172. /package/src/components/{CircularProgressBar.story.md → CircularProgressBar/CircularProgressBar.story.md} +0 -0
  173. /package/src/components/{CircularProgressBar.story.vue → CircularProgressBar/CircularProgressBar.story.vue} +0 -0
  174. /package/src/components/{ErrorMessage.story.vue → ErrorMessage/ErrorMessage.story.vue} +0 -0
  175. /package/src/components/{Popover.vue → Popover/Popover.vue} +0 -0
  176. /package/src/components/{Progress.story.vue → Progress/Progress.story.vue} +0 -0
  177. /package/src/components/{Select.story.vue → Select/Select.story.vue} +0 -0
  178. /package/src/components/{Spinner.story.vue → Spinner/Spinner.story.vue} +0 -0
  179. /package/src/components/{Spinner.vue → Spinner/Spinner.vue} +0 -0
  180. /package/src/components/{Switch.story.vue → Switch/Switch.story.vue} +0 -0
  181. /package/src/components/{TabButtons.story.vue → TabButtons/TabButtons.story.vue} +0 -0
  182. /package/src/components/TextEditor/{emojis.json → extensions/emoji/emojis.json} +0 -0
  183. /package/src/components/{Textarea.story.vue → Textarea/Textarea.story.vue} +0 -0
@@ -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 v-if="currentStep.videoURL" class="w-full rounded" controls>
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.vue'
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="() => !step.completed && step.onClick()"
38
+ @click.stop="
39
+ () => !step.completed && !isDependent(step) && step.onClick()
40
+ "
39
41
  >
40
- <div
41
- class="flex gap-2 items-center"
42
- :class="[step.completed ? 'text-ink-gray-5' : 'text-ink-gray-8']"
42
+ <component
43
+ :is="isDependent(step) ? Tooltip : 'div'"
44
+ :text="dependsOnTooltip(step)"
43
45
  >
44
- <component :is="step.icon" class="h-4" />
45
- <div class="text-base" :class="{ 'line-through': step.completed }">
46
- {{ step.title }}
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
- </div>
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
- () => onboardingStatus.value?.[appName + '_onboarding_status'] || [],
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[appName + '_onboarding_status'] = onboardings[
67
- appName
68
- ].map((s) => {
69
- return { name: s.name, completed: false }
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[appName + '_onboarding_status'] = onboardings[
91
- appName
92
- ].map((s) => {
93
- return { name: s.name, completed: value }
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
@@ -0,0 +1,8 @@
1
+ export function sessionUser() {
2
+ let cookies = new URLSearchParams(document.cookie.split('; ').join('&'))
3
+ let _sessionUser = cookies.get('user_id')
4
+ if (_sessionUser === 'Guest') {
5
+ _sessionUser = null
6
+ }
7
+ return _sessionUser
8
+ }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "pimelon-ui",
3
- "version": "0.1.135",
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',
@@ -0,0 +1,2 @@
1
+ export { default as Alert } from './Alert.vue'
2
+ export type { AlertProps } from './types.ts'
@@ -0,0 +1,4 @@
1
+ export interface AlertProps {
2
+ title?: string
3
+ type?: 'warning'
4
+ }
@@ -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 './Popover.vue'
210
- import { Button } from './Button'
211
- import FeatherIcon from './FeatherIcon.vue'
212
- import LoadingIndicator from './LoadingIndicator.vue'
213
-
214
- type Option = {
215
- label: string
216
- value: OptionValue
217
- description?: string
218
- [key: string]: any
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,2 @@
1
+ export { default as Autocomplete } from './Autocomplete.vue'
2
+ export type { AutocompleteProps } from './types'
@@ -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',
@@ -0,0 +1,2 @@
1
+ export { default as Avatar } from './Avatar.vue'
2
+ export type { AvatarProps } from './types'
@@ -0,0 +1,6 @@
1
+ export interface AvatarProps {
2
+ image?: string
3
+ label?: string
4
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'
5
+ shape?: 'circle' | 'square'
6
+ }
@@ -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',
@@ -0,0 +1,2 @@
1
+ export { default as Badge } from './Badge.vue'
2
+ export type { BadgeProps } from './types'
@@ -0,0 +1,10 @@
1
+ interface Label {
2
+ toString(): string
3
+ }
4
+
5
+ export interface BadgeProps {
6
+ theme?: 'gray' | 'blue' | 'green' | 'orange' | 'red'
7
+ size?: 'sm' | 'md' | 'lg'
8
+ variant?: 'solid' | 'subtle' | 'outline' | 'ghost'
9
+ label?: Label | string | number
10
+ }
@@ -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 { RouterLinkProps, useRouter } from 'vue-router'
82
- import Dropdown from '../components/Dropdown.vue'
83
- import { Button } from './Button'
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
 
@@ -0,0 +1,2 @@
1
+ export { default as Breadcrumbs } from './Breadcrumbs.vue'
2
+ export type { BreadcrumbsProps } from './types'
@@ -0,0 +1,12 @@
1
+ import { RouterLinkProps } from 'vue-router'
2
+
3
+ interface BreadcrumbItem {
4
+ label: string
5
+ route?: RouterLinkProps['to']
6
+ onClick?: () => void
7
+ [key: string]: any
8
+ }
9
+
10
+ export interface BreadcrumbsProps {
11
+ items: BreadcrumbItem[]
12
+ }
@@ -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, type Component } from 'vue'
55
+ import { computed, useSlots } from 'vue'
56
56
  import FeatherIcon from '../FeatherIcon.vue'
57
57
  import LoadingIndicator from '../LoadingIndicator.vue'
58
- import { useRouter, type RouteLocation } from 'vue-router'
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, type ButtonProps } from './Button.vue'
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}`