@saasmakers/ui 0.1.117 → 0.2.0
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/app/components/bases/BaseAlert.vue +1 -1
- package/app/components/bases/BaseAvatar.vue +1 -1
- package/app/components/bases/BaseButton.vue +1 -1
- package/app/components/bases/BaseChart.vue +1 -1
- package/app/components/bases/BaseIcon.vue +1 -1
- package/app/components/bases/BaseOverlay.vue +1 -1
- package/app/components/bases/BaseTag.vue +1 -1
- package/app/components/bases/BaseText.vue +1 -1
- package/app/components/fields/FieldEmojis.vue +7 -2
- package/app/components/fields/FieldSelect.vue +1 -1
- package/app/components/fields/FieldTabs.vue +1 -1
- package/app/composables/useChartist.ts +8 -8
- package/app/composables/useLayerUtils.ts +7 -7
- package/app/types/bases.d.ts +32 -29
- package/app/types/fields.d.ts +9 -9
- package/app/types/global.d.ts +4 -1
- package/package.json +9 -14
- package/uno.config.ts +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { BaseChart } from '../../types/bases'
|
|
3
2
|
import { BarChart, LineChart, PieChart } from 'chartist'
|
|
3
|
+
import type { BaseChart } from '../../types/bases'
|
|
4
4
|
|
|
5
5
|
const properties = withDefaults(defineProps<BaseChart>(), {
|
|
6
6
|
data: () => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { BaseOverlay } from '../../types/bases'
|
|
3
2
|
import { onKeyStroke } from '@vueuse/core'
|
|
4
3
|
import { Motion } from 'motion-v'
|
|
4
|
+
import type { BaseOverlay } from '../../types/bases'
|
|
5
5
|
import useMotion from '../../composables/useMotion'
|
|
6
6
|
|
|
7
7
|
const props = withDefaults(defineProps<BaseOverlay>(), {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { FieldEmojis } from '../../types/fields'
|
|
3
2
|
import { emojis } from '@saasmakers/shared'
|
|
4
3
|
import { refDebounced } from '@vueuse/core'
|
|
4
|
+
import type { FieldEmojis } from '../../types/fields'
|
|
5
5
|
|
|
6
6
|
const props = withDefaults(defineProps<Omit<FieldEmojis, 'modelValue'>>(), { disabled: false })
|
|
7
7
|
|
|
@@ -18,7 +18,8 @@ const searchRaw = ref('')
|
|
|
18
18
|
const searchQuery = refDebounced(searchRaw, 250)
|
|
19
19
|
|
|
20
20
|
const emojisFiltered = computed(() => {
|
|
21
|
-
const
|
|
21
|
+
const searchQueryRaw = searchQuery.value.trim()
|
|
22
|
+
const searchQueryCleaned = normalizeText(searchQueryRaw)
|
|
22
23
|
|
|
23
24
|
if (!searchQueryCleaned) {
|
|
24
25
|
return emojis
|
|
@@ -27,6 +28,10 @@ const emojisFiltered = computed(() => {
|
|
|
27
28
|
return emojis
|
|
28
29
|
.map((category) => {
|
|
29
30
|
const filtered = category.emojis.filter((emoji) => {
|
|
31
|
+
if (emoji.character === searchQueryRaw) {
|
|
32
|
+
return true
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
const localizedKeywords = (emoji.keywords[locale.value] ?? [])
|
|
31
36
|
const englishKeywords = (emoji.keywords.en ?? [])
|
|
32
37
|
const allKeywords = [...localizedKeywords, ...englishKeywords]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { FieldSelect, FieldSelectOption } from '../../types/fields'
|
|
3
2
|
import { vOnClickOutside } from '@vueuse/components'
|
|
3
|
+
import type { FieldSelect, FieldSelectOption } from '../../types/fields'
|
|
4
4
|
|
|
5
5
|
const props = withDefaults(defineProps<Omit<FieldSelect, 'modelValue'>>(), {
|
|
6
6
|
border: 'full',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { FieldTabs, FieldTabsAction } from '../../types/fields'
|
|
3
2
|
import { NuxtLinkLocale } from '#components'
|
|
3
|
+
import type { FieldTabs, FieldTabsAction } from '../../types/fields'
|
|
4
4
|
|
|
5
5
|
withDefaults(defineProps<Omit<FieldTabs, 'modelValue'>>(), {
|
|
6
6
|
disabled: false,
|
|
@@ -11,13 +11,11 @@ export default function useChartist() {
|
|
|
11
11
|
easing?: EasingType
|
|
12
12
|
stagger?: number
|
|
13
13
|
} = {}) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
stagger = 0,
|
|
20
|
-
} = params
|
|
14
|
+
const animateArea = params.animateArea ?? true
|
|
15
|
+
const delay = params.delay ?? 0
|
|
16
|
+
const duration = params.duration ?? 500
|
|
17
|
+
const easing = params.easing ?? easings.easeOutQuart
|
|
18
|
+
const stagger = params.stagger ?? 0
|
|
21
19
|
|
|
22
20
|
return (chart: BaseChart) => {
|
|
23
21
|
chart.on('draw', (ctx: DrawEvent) => {
|
|
@@ -83,7 +81,9 @@ export default function useChartist() {
|
|
|
83
81
|
if (ctx.type === 'bar') {
|
|
84
82
|
const barCtx = ctx as BarDrawEvent
|
|
85
83
|
// Access private options property via type assertion
|
|
86
|
-
const chartOptions = (chart as unknown as {
|
|
84
|
+
const chartOptions = (chart as unknown as {
|
|
85
|
+
options?: Options & Partial<BarChartOptions>
|
|
86
|
+
}).options
|
|
87
87
|
const horizontal = !!(chartOptions as BarChartOptions | undefined)?.horizontalBars
|
|
88
88
|
|
|
89
89
|
// For vertical bars, y1 is baseline, y2 is top. For horizontal, x1 is baseline, x2 is end.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import numbroLib from 'numbro'
|
|
2
2
|
|
|
3
|
+
export default function useLayerUtils() {
|
|
4
|
+
return {
|
|
5
|
+
normalizeText,
|
|
6
|
+
numbro,
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
function normalizeText(text: string) {
|
|
4
11
|
return text
|
|
5
12
|
.toLowerCase()
|
|
@@ -17,10 +24,3 @@ function numbro(number: '∞' | number | undefined, format?: string) {
|
|
|
17
24
|
|
|
18
25
|
return numbroLib(number).format(format || '0,0')
|
|
19
26
|
}
|
|
20
|
-
|
|
21
|
-
export default function useLayerUtils() {
|
|
22
|
-
return {
|
|
23
|
-
normalizeText,
|
|
24
|
-
numbro,
|
|
25
|
-
}
|
|
26
|
-
}
|
package/app/types/bases.d.ts
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
// Global types for bases
|
|
2
|
-
export type BaseAlignment = 'center' | 'left' | 'right'
|
|
3
|
-
|
|
4
|
-
export type BaseBackground = 'gray' | 'white'
|
|
5
|
-
|
|
6
|
-
export type BaseColor
|
|
7
|
-
= | 'black'
|
|
8
|
-
| 'gray'
|
|
9
|
-
| 'green'
|
|
10
|
-
| 'indigo'
|
|
11
|
-
| 'orange'
|
|
12
|
-
| 'red'
|
|
13
|
-
| 'white'
|
|
14
|
-
|
|
15
|
-
export type BaseSize
|
|
16
|
-
= | '2xl'
|
|
17
|
-
| '2xs'
|
|
18
|
-
| '3xl'
|
|
19
|
-
| '3xs'
|
|
20
|
-
| '4xl'
|
|
21
|
-
| 'base'
|
|
22
|
-
| 'lg'
|
|
23
|
-
| 'sm'
|
|
24
|
-
| 'xl'
|
|
25
|
-
| 'xs'
|
|
26
|
-
|
|
27
|
-
export type BaseStatus = | 'error' | 'info' | 'success' | 'warning'
|
|
28
|
-
|
|
29
1
|
// Components
|
|
30
2
|
export interface BaseAlert {
|
|
31
3
|
closingId?: string
|
|
@@ -35,6 +7,9 @@ export interface BaseAlert {
|
|
|
35
7
|
text?: BaseTextText
|
|
36
8
|
}
|
|
37
9
|
|
|
10
|
+
// Global types for bases
|
|
11
|
+
export type BaseAlignment = 'center' | 'left' | 'right'
|
|
12
|
+
|
|
38
13
|
export interface BaseAvatar {
|
|
39
14
|
bordered?: boolean
|
|
40
15
|
borderWidth?: number
|
|
@@ -46,6 +21,8 @@ export interface BaseAvatar {
|
|
|
46
21
|
to?: RouteLocationNamedI18n
|
|
47
22
|
}
|
|
48
23
|
|
|
24
|
+
export type BaseBackground = 'gray' | 'white'
|
|
25
|
+
|
|
49
26
|
export interface BaseBordered {
|
|
50
27
|
background?: BaseBackground
|
|
51
28
|
borderColor?: BaseBorderedColor
|
|
@@ -119,6 +96,15 @@ export interface BaseChart {
|
|
|
119
96
|
|
|
120
97
|
export type BaseChartType = 'bar' | 'line' | 'pie'
|
|
121
98
|
|
|
99
|
+
export type BaseColor
|
|
100
|
+
= | 'black'
|
|
101
|
+
| 'gray'
|
|
102
|
+
| 'green'
|
|
103
|
+
| 'indigo'
|
|
104
|
+
| 'orange'
|
|
105
|
+
| 'red'
|
|
106
|
+
| 'white'
|
|
107
|
+
|
|
122
108
|
export interface BaseDivider {
|
|
123
109
|
borderStyle?: BaseDividerBorderStyle
|
|
124
110
|
margin?: number
|
|
@@ -283,6 +269,18 @@ export type BaseQuoteBackground = 'gray' | 'gray-light' | 'white'
|
|
|
283
269
|
|
|
284
270
|
export type BaseQuoteSize = 'base' | 'sm' | 'xs'
|
|
285
271
|
|
|
272
|
+
export type BaseSize
|
|
273
|
+
= | '2xl'
|
|
274
|
+
| '2xs'
|
|
275
|
+
| '3xl'
|
|
276
|
+
| '3xs'
|
|
277
|
+
| '4xl'
|
|
278
|
+
| 'base'
|
|
279
|
+
| 'lg'
|
|
280
|
+
| 'sm'
|
|
281
|
+
| 'xl'
|
|
282
|
+
| 'xs'
|
|
283
|
+
|
|
286
284
|
export interface BaseSpinner {
|
|
287
285
|
clickable?: boolean
|
|
288
286
|
color?: BaseColor
|
|
@@ -293,6 +291,8 @@ export interface BaseSpinner {
|
|
|
293
291
|
uppercase?: boolean
|
|
294
292
|
}
|
|
295
293
|
|
|
294
|
+
export type BaseStatus = | 'error' | 'info' | 'success' | 'warning'
|
|
295
|
+
|
|
296
296
|
export interface BaseTag {
|
|
297
297
|
active?: boolean
|
|
298
298
|
avatar?: string
|
|
@@ -352,7 +352,10 @@ export interface BaseText {
|
|
|
352
352
|
uppercase?: boolean
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
-
export type BaseTextText = string | {
|
|
355
|
+
export type BaseTextText = string | {
|
|
356
|
+
base: string
|
|
357
|
+
sm: string
|
|
358
|
+
}
|
|
356
359
|
|
|
357
360
|
export interface BaseToast {
|
|
358
361
|
hasClose?: boolean
|
package/app/types/fields.d.ts
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
// Global types for fields
|
|
2
2
|
export type FieldBackground = 'gray' | 'white'
|
|
3
3
|
|
|
4
|
-
export type FieldSize = 'base' | 'lg' | 'sm' | 'xs'
|
|
5
|
-
|
|
6
|
-
export type FieldStatus
|
|
7
|
-
= | 'default'
|
|
8
|
-
| 'error'
|
|
9
|
-
| 'info'
|
|
10
|
-
| 'success'
|
|
11
|
-
| 'warning'
|
|
12
|
-
|
|
13
4
|
// Components
|
|
14
5
|
export interface FieldCheckbox {
|
|
15
6
|
description?: BaseTextText
|
|
@@ -142,6 +133,15 @@ export interface FieldSelectOption {
|
|
|
142
133
|
value: string
|
|
143
134
|
}
|
|
144
135
|
|
|
136
|
+
export type FieldSize = 'base' | 'lg' | 'sm' | 'xs'
|
|
137
|
+
|
|
138
|
+
export type FieldStatus
|
|
139
|
+
= | 'default'
|
|
140
|
+
| 'error'
|
|
141
|
+
| 'info'
|
|
142
|
+
| 'success'
|
|
143
|
+
| 'warning'
|
|
144
|
+
|
|
145
145
|
export interface FieldTabs {
|
|
146
146
|
disabled?: boolean
|
|
147
147
|
minimizeOnMobile?: boolean
|
package/app/types/global.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saasmakers/ui",
|
|
3
|
-
"
|
|
4
|
-
"version": "0.1.117",
|
|
3
|
+
"version": "0.2.0",
|
|
5
4
|
"private": false,
|
|
6
5
|
"description": "Reusable Nuxt UI components for SaaS Makers projects",
|
|
7
|
-
"author": "SaaS Makers",
|
|
8
6
|
"license": "MIT",
|
|
9
|
-
"
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/saasmakers/saasmakers-turborepo.git",
|
|
12
|
-
"directory": "packages/ui"
|
|
13
|
-
},
|
|
7
|
+
"author": "SaaS Makers",
|
|
14
8
|
"sideEffects": false,
|
|
9
|
+
"type": "module",
|
|
15
10
|
"exports": {
|
|
16
11
|
".": "./nuxt.config.ts"
|
|
17
12
|
},
|
|
@@ -22,10 +17,6 @@
|
|
|
22
17
|
"public",
|
|
23
18
|
"uno.config.ts"
|
|
24
19
|
],
|
|
25
|
-
"peerDependencies": {
|
|
26
|
-
"@saasmakers/shared": "^0.1.17",
|
|
27
|
-
"nuxt": "4.2.2"
|
|
28
|
-
},
|
|
29
20
|
"dependencies": {
|
|
30
21
|
"@capacitor/preferences": "8.0.0",
|
|
31
22
|
"@nuxt/icon": "2.1.1",
|
|
@@ -60,12 +51,16 @@
|
|
|
60
51
|
"typescript": "5.9.3",
|
|
61
52
|
"@saasmakers/shared": "0.1.17"
|
|
62
53
|
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@saasmakers/shared": "^0.1.17",
|
|
56
|
+
"nuxt": "4.2.2"
|
|
57
|
+
},
|
|
63
58
|
"publishConfig": {
|
|
64
59
|
"access": "public"
|
|
65
60
|
},
|
|
66
61
|
"scripts": {
|
|
67
|
-
"dev": "storybook dev -p
|
|
68
|
-
"lint": "eslint .",
|
|
62
|
+
"dev": "storybook dev -p 3104 --no-open",
|
|
63
|
+
"lint": "eslint . --max-warnings=0",
|
|
69
64
|
"typecheck": "nuxi typecheck"
|
|
70
65
|
}
|
|
71
66
|
}
|
package/uno.config.ts
CHANGED