@saasmakers/ui 0.1.63 → 0.1.65

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.
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import type { BaseAlert } from '../../types/bases'
3
3
  import { Preferences } from '@capacitor/preferences'
4
+ import { getIcon } from '../../composables/useIcons'
4
5
 
5
6
  const props = withDefaults(defineProps<BaseAlert>(), {
6
7
  closingId: '',
@@ -14,6 +15,11 @@ const emit = defineEmits<{
14
15
  close: [event: MouseEvent]
15
16
  }>()
16
17
 
18
+ defineSlots<{
19
+ buttons?: () => VNode[]
20
+ default?: () => VNode[]
21
+ }>()
22
+
17
23
  const { t } = useI18n()
18
24
 
19
25
  const isClosed = ref(false)
@@ -18,6 +18,10 @@ const emit = defineEmits<{
18
18
  click: [event: MouseEvent]
19
19
  }>()
20
20
 
21
+ defineSlots<{
22
+ bottom?: () => VNode[]
23
+ }>()
24
+
21
25
  const { createToast } = useToasts()
22
26
 
23
27
  const hovered = ref(false)
@@ -8,6 +8,10 @@ withDefaults(defineProps<BaseBordered>(), {
8
8
  shadow: false,
9
9
  title: '',
10
10
  })
11
+
12
+ defineSlots<{
13
+ default?: () => VNode[]
14
+ }>()
11
15
  </script>
12
16
 
13
17
  <template>
@@ -27,6 +27,10 @@ const emit = defineEmits<{
27
27
  confirm: [event: MouseEvent, id?: number | string]
28
28
  }>()
29
29
 
30
+ defineSlots<{
31
+ default?: () => VNode[]
32
+ }>()
33
+
30
34
  const confirming = ref(false)
31
35
 
32
36
  const { t } = useI18n()
@@ -123,7 +127,6 @@ function onClick(event: MouseEvent) {
123
127
  class="flex-initial"
124
128
  :color="iconColor"
125
129
  :icon="confirming ? undefined : icon"
126
- :light="light"
127
130
  :reverse="reverse"
128
131
  :size="size"
129
132
  :text="confirming ? t('confirm') : text"
@@ -6,6 +6,10 @@ withDefaults(defineProps<BaseHeading>(), {
6
6
  size: 'base',
7
7
  tag: 'h1',
8
8
  })
9
+
10
+ defineSlots<{
11
+ default?: () => VNode[]
12
+ }>()
9
13
  </script>
10
14
 
11
15
  <template>
@@ -7,6 +7,11 @@ withDefaults(defineProps<BaseMessage>(), {
7
7
  legend: '',
8
8
  title: '',
9
9
  })
10
+
11
+ defineSlots<{
12
+ animation?: () => VNode[]
13
+ default?: () => VNode[]
14
+ }>()
10
15
  </script>
11
16
 
12
17
  <template>
@@ -18,6 +18,10 @@ const emit = defineEmits<{
18
18
  close: [event: MouseEvent]
19
19
  }>()
20
20
 
21
+ defineSlots<{
22
+ default?: () => VNode[]
23
+ }>()
24
+
21
25
  const { fadeIn } = useMotion()
22
26
 
23
27
  function onClick(event: MouseEvent) {
@@ -5,6 +5,10 @@ withDefaults(defineProps<BaseParagraph>(), {
5
5
  alignment: 'left',
6
6
  size: 'base',
7
7
  })
8
+
9
+ defineSlots<{
10
+ default?: () => VNode[]
11
+ }>()
8
12
  </script>
9
13
 
10
14
  <template>
@@ -21,6 +21,13 @@ const emit = defineEmits<{
21
21
  close: [event: MouseEvent]
22
22
  }>()
23
23
 
24
+ defineSlots<{
25
+ bottom?: () => VNode[]
26
+ default?: () => VNode[]
27
+ left?: () => VNode[]
28
+ right?: () => VNode[]
29
+ }>()
30
+
24
31
  const { locale, t } = useI18n()
25
32
  const slots = useSlots()
26
33
  const { translatedContent } = useTranslation(slots, locale)
@@ -33,6 +33,10 @@ const emit = defineEmits<{
33
33
  remove: [event: MouseEvent, id?: number | string]
34
34
  }>()
35
35
 
36
+ defineSlots<{
37
+ default?: () => VNode[]
38
+ }>()
39
+
36
40
  const hovered = ref(false)
37
41
 
38
42
  const form = reactive({ name: '' })
@@ -132,7 +136,6 @@ function onRemove(event: MouseEvent) {
132
136
  <BaseAvatar
133
137
  v-if="avatar"
134
138
  class="h-full w-full"
135
- rounded="sm"
136
139
  :shadow="false"
137
140
  :src="avatar"
138
141
  />
@@ -145,10 +148,10 @@ function onRemove(event: MouseEvent) {
145
148
  </span>
146
149
 
147
150
  <span
148
- v-if="$slots.left"
151
+ v-if="$slots.default"
149
152
  class="mr-1"
150
153
  >
151
- <slot name="left" />
154
+ <slot />
152
155
  </span>
153
156
 
154
157
  <BaseText
@@ -23,10 +23,10 @@ const emit = defineEmits<{
23
23
  'attach': [event: MouseEvent, tagId?: number | string]
24
24
  'back': [event: MouseEvent]
25
25
  'click': [event: MouseEvent]
26
- 'create': [event: MouseEvent, name: string]
26
+ 'create': [event: FocusEvent | KeyboardEvent, name: string]
27
27
  'detach': [event: MouseEvent, tagId?: number | string]
28
28
  'remove': [event: MouseEvent, tagId?: number | string]
29
- 'update': [event: MouseEvent, name: string, tagId?: number | string]
29
+ 'update': [event: FocusEvent | KeyboardEvent, name: string, tagId?: number | string]
30
30
  'update:modelValue': [value: (number | string)[]]
31
31
  }>()
32
32
 
@@ -61,7 +61,7 @@ const sortedTags = computed({
61
61
  },
62
62
  })
63
63
 
64
- function onCreateTag(event: MouseEvent, name: string) {
64
+ function onCreateTag(event: FocusEvent | KeyboardEvent, name: string) {
65
65
  showingTagCreationField.value = false
66
66
  keyForTagCreation.value = Date.now()
67
67
 
@@ -110,7 +110,7 @@ function onTagClick(event: MouseEvent, tagId?: number | string) {
110
110
  }
111
111
  }
112
112
 
113
- function onUpdateTag(event: MouseEvent, name: string, tagId?: number | string) {
113
+ function onUpdateTag(event: FocusEvent | KeyboardEvent, name: string, tagId?: number | string) {
114
114
  if (name) {
115
115
  emit('update', event, name, tagId)
116
116
  }
@@ -166,8 +166,8 @@ function onRemoveTag(event: MouseEvent, tagId?: number | string) {
166
166
  :size="size"
167
167
  :text="showingTagCreationField ? '' : t('newTag')"
168
168
  @click="onShowTagField"
169
- @input:blur="onCreateTag"
170
- @input:submit="onCreateTag"
169
+ @input-blur="onCreateTag"
170
+ @input-submit="onCreateTag"
171
171
  />
172
172
 
173
173
  <div class="flex items-center">
@@ -199,8 +199,8 @@ function onRemoveTag(event: MouseEvent, tagId?: number | string) {
199
199
  :text="tag.text"
200
200
  :to="tag.to"
201
201
  @click="onTagClick"
202
- @input:blur="onUpdateTag"
203
- @input:submit="onUpdateTag"
202
+ @input-blur="onUpdateTag"
203
+ @input-submit="onUpdateTag"
204
204
  @remove="onRemoveTag"
205
205
  />
206
206
  </template>
@@ -22,6 +22,10 @@ const emit = defineEmits<{
22
22
  click: [event: MouseEvent]
23
23
  }>()
24
24
 
25
+ defineSlots<{
26
+ default?: () => VNode[]
27
+ }>()
28
+
25
29
  const showAll = ref(false)
26
30
 
27
31
  const { t } = useI18n()
@@ -70,7 +74,7 @@ function onShowMore() {
70
74
  </script>
71
75
 
72
76
  <template>
73
- <Component
77
+ <component
74
78
  :is="to ? NuxtLinkLocale : 'div'"
75
79
  :class="{
76
80
  'font-bold': bold,
@@ -152,7 +156,7 @@ function onShowMore() {
152
156
  />
153
157
 
154
158
  <slot />
155
- </Component>
159
+ </component>
156
160
  </template>
157
161
 
158
162
  <i18n lang="json">
@@ -30,9 +30,15 @@ const props = withDefaults(defineProps<FieldInput>(), {
30
30
  const emit = defineEmits<{
31
31
  'blur': [event: FocusEvent]
32
32
  'focus': [event: FocusEvent]
33
- 'keyup': [event: KeyboardEvent, value: number | string ]
34
- 'submit': [event: KeyboardEvent, value: number | string ]
35
- 'update:modelValue': [value: number | string ]
33
+ 'keyup': [event: KeyboardEvent, value: string ]
34
+ 'submit': [event: KeyboardEvent, value: string ]
35
+ 'update:modelValue': [value: string ]
36
+ }>()
37
+
38
+ defineSlots<{
39
+ inputLeft?: () => VNode[]
40
+ inputRight?: () => VNode[]
41
+ label?: () => VNode[]
36
42
  }>()
37
43
 
38
44
  const input = ref<HTMLInputElement>()
@@ -76,10 +82,10 @@ function onFieldFocus(event: FocusEvent) {
76
82
  }
77
83
 
78
84
  function onFieldInput(event: Event) {
79
- let value: number | string = (event.target as HTMLInputElement).value
85
+ let value = (event.target as HTMLInputElement).value
80
86
 
81
87
  if (props.type === 'number' && props.max && Number.parseInt(value) > props.max) {
82
- value = props.max
88
+ value = props.max.toString()
83
89
  }
84
90
 
85
91
  if (props.lowercaseOnly) {
@@ -87,6 +87,7 @@ function onFieldInput() {
87
87
  :id="uuid"
88
88
  ref="textarea"
89
89
  v-model="value"
90
+ v-bind="{ 'data-enable-grammarly': 'false' }"
90
91
  class="w-full flex-1 appearance-none rounded-lg text-gray-900 font-medium tracking-tight uppercase outline-none dark:text-gray-100 placeholder-gray-600 dark:placeholder-gray-400 focus:placeholder-gray-900 hover:placeholder-gray-900 dark:focus:placeholder-gray-100 dark:hover:placeholder-gray-100"
91
92
  :class="{
92
93
  'p-2.5': padding,
@@ -104,7 +105,6 @@ function onFieldInput() {
104
105
  'text-base': size === 'base',
105
106
  'text-lg': size === 'lg',
106
107
  }"
107
- data-enable-grammarly="false"
108
108
  :placeholder="placeholder"
109
109
  :rows="rows"
110
110
  spellcheck="false"
@@ -46,7 +46,7 @@ export interface FieldInput {
46
46
  lowercaseOnly?: boolean
47
47
  max?: number
48
48
  min?: number
49
- modelValue?: number | string
49
+ modelValue?: string
50
50
  placeholder?: string
51
51
  required?: boolean
52
52
  size?: FieldSize
@@ -1,6 +1,13 @@
1
1
  import type * as Bases from './bases'
2
2
  import type * as Fields from './fields'
3
3
 
4
+ declare module '@vue/runtime-core' {
5
+ interface ComponentCustomProperties {
6
+ vHotkey?: Record<string, (event?: KeyboardEvent | MouseEvent) => void>
7
+ vTooltip?: Record<string, any> | string
8
+ }
9
+ }
10
+
4
11
  declare global {
5
12
  // Libraries
6
13
  type ChartistBarChartData = import('chartist').BarChartData
package/nuxt.config.ts CHANGED
@@ -12,7 +12,12 @@ export default defineNuxtConfig({
12
12
 
13
13
  experimental: { typedPages: true },
14
14
 
15
- typescript: { tsConfig: { compilerOptions: { noUncheckedIndexedAccess: false } } },
15
+ typescript: {
16
+ tsConfig: {
17
+ compilerOptions: { noUncheckedIndexedAccess: false },
18
+ vueCompilerOptions: { strictTemplates: true },
19
+ },
20
+ },
16
21
 
17
22
  // --> COMPONENTS, CSS, MODULES & PLUGINS <--
18
23
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
3
  "type": "module",
4
- "version": "0.1.63",
4
+ "version": "0.1.65",
5
5
  "private": false,
6
6
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
7
7
  "license": "MIT",
@@ -40,7 +40,6 @@
40
40
  "@nuxtjs/robots": "5.5.6",
41
41
  "@nuxtjs/sitemap": "7.4.7",
42
42
  "@pinia/nuxt": "0.11.2",
43
- "@saasmakers/shared": "workspace:*",
44
43
  "@unocss/nuxt": "66.5.4",
45
44
  "@unocss/reset": "66.5.10",
46
45
  "@vuelidate/core": "2.0.3",
@@ -59,6 +58,7 @@
59
58
  "vue-router": "4.6.3"
60
59
  },
61
60
  "devDependencies": {
61
+ "@saasmakers/shared": "workspace:*",
62
62
  "nuxt": "4.2.1",
63
63
  "typescript": "5.9.3"
64
64
  }