@saasmakers/ui 0.1.19 → 0.1.21
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/app.vue +1 -1
- package/app/components/bases/BaseDivider.vue +41 -0
- package/app/components/bases/BaseText.vue +16 -54
- package/app/types/bases.d.ts +57 -0
- package/{types/index.d.ts → app/types/globals.d.ts} +0 -2
- package/nuxt.config.ts +1 -9
- package/package.json +8 -11
- package/types/bases.d.ts +0 -50
package/app/app.vue
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
withDefaults(defineProps<BaseDivider>(), {
|
|
3
|
+
borderStyle: 'solid',
|
|
4
|
+
margin: 6,
|
|
5
|
+
size: 'base',
|
|
6
|
+
title: '',
|
|
7
|
+
})
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
class="relative block border-t border-gray-300 text-center dark:border-gray-700"
|
|
13
|
+
:class="{
|
|
14
|
+
'border-dashed': borderStyle === 'dashed',
|
|
15
|
+
'border-dotted': borderStyle === 'dotted',
|
|
16
|
+
'border-solid': borderStyle === 'solid',
|
|
17
|
+
|
|
18
|
+
'my-3': margin === 3,
|
|
19
|
+
'my-4': margin === 4,
|
|
20
|
+
'my-5': margin === 5,
|
|
21
|
+
'my-6': margin === 6,
|
|
22
|
+
'my-7': margin === 7,
|
|
23
|
+
'my-8': margin === 8,
|
|
24
|
+
'my-10': margin === 10,
|
|
25
|
+
'my-12': margin === 12,
|
|
26
|
+
'my-16': margin === 16,
|
|
27
|
+
'my-20': margin === 20,
|
|
28
|
+
|
|
29
|
+
'mx-auto max-w-xs': size === 'sm',
|
|
30
|
+
'w-full': size === 'base',
|
|
31
|
+
}"
|
|
32
|
+
style="height: 1px"
|
|
33
|
+
>
|
|
34
|
+
<BaseText
|
|
35
|
+
v-if="title"
|
|
36
|
+
class="absolute inline-block transform whitespace-nowrap bg-gray-100 px-4 text-center -mt-3 -translate-x-1/2 dark:bg-gray-900"
|
|
37
|
+
size="sm"
|
|
38
|
+
:text="title"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
@@ -1,59 +1,21 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { NuxtLinkLocale } from '#components'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
type: Number,
|
|
20
|
-
},
|
|
21
|
-
noWrap: {
|
|
22
|
-
default: false,
|
|
23
|
-
type: Boolean,
|
|
24
|
-
},
|
|
25
|
-
reverse: {
|
|
26
|
-
default: false,
|
|
27
|
-
type: Boolean,
|
|
28
|
-
},
|
|
29
|
-
size: {
|
|
30
|
-
default: 'base',
|
|
31
|
-
type: String as PropType<BaseSize>,
|
|
32
|
-
},
|
|
33
|
-
skeleton: {
|
|
34
|
-
default: false,
|
|
35
|
-
type: Boolean,
|
|
36
|
-
},
|
|
37
|
-
text: {
|
|
38
|
-
default: '',
|
|
39
|
-
type: [String, Object] as PropType<BaseTextText>,
|
|
40
|
-
},
|
|
41
|
-
to: {
|
|
42
|
-
default: undefined,
|
|
43
|
-
type: [Object, String] as PropType<RouteLocationRaw | string>,
|
|
44
|
-
},
|
|
45
|
-
truncate: {
|
|
46
|
-
default: false,
|
|
47
|
-
type: Boolean,
|
|
48
|
-
},
|
|
49
|
-
underline: {
|
|
50
|
-
default: false,
|
|
51
|
-
type: Boolean,
|
|
52
|
-
},
|
|
53
|
-
uppercase: {
|
|
54
|
-
default: false,
|
|
55
|
-
type: Boolean,
|
|
56
|
-
},
|
|
3
|
+
import type { BaseText } from '@/types/bases'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<BaseText>(), {
|
|
6
|
+
background: '',
|
|
7
|
+
bold: false,
|
|
8
|
+
hasMargin: false,
|
|
9
|
+
maxCharacters: 0,
|
|
10
|
+
noWrap: false,
|
|
11
|
+
reverse: false,
|
|
12
|
+
size: 'base',
|
|
13
|
+
skeleton: false,
|
|
14
|
+
text: '',
|
|
15
|
+
to: undefined,
|
|
16
|
+
truncate: false,
|
|
17
|
+
underline: false,
|
|
18
|
+
uppercase: false,
|
|
57
19
|
})
|
|
58
20
|
|
|
59
21
|
const emit = defineEmits<{
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type BaseColor
|
|
2
|
+
= | 'black'
|
|
3
|
+
| 'gray'
|
|
4
|
+
| 'green'
|
|
5
|
+
| 'indigo'
|
|
6
|
+
| 'orange'
|
|
7
|
+
| 'red'
|
|
8
|
+
| 'white'
|
|
9
|
+
|
|
10
|
+
export type BaseSize
|
|
11
|
+
= | '2xl'
|
|
12
|
+
| '2xs'
|
|
13
|
+
| '3xl'
|
|
14
|
+
| '3xs'
|
|
15
|
+
| '4xl'
|
|
16
|
+
| 'base'
|
|
17
|
+
| 'lg'
|
|
18
|
+
| 'sm'
|
|
19
|
+
| 'xl'
|
|
20
|
+
| 'xs'
|
|
21
|
+
|
|
22
|
+
export type BaseStatus
|
|
23
|
+
= | 'error'
|
|
24
|
+
| 'info'
|
|
25
|
+
| 'success'
|
|
26
|
+
| 'warning'
|
|
27
|
+
|
|
28
|
+
export interface BaseDivider {
|
|
29
|
+
borderStyle?: BaseDividerBorderStyle
|
|
30
|
+
margin?: number
|
|
31
|
+
size?: BaseDividerSize
|
|
32
|
+
title?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type BaseDividerBorderStyle = 'dashed' | 'dotted' | 'solid'
|
|
36
|
+
|
|
37
|
+
export type BaseDividerSize = 'base' | 'sm'
|
|
38
|
+
|
|
39
|
+
export interface BaseText {
|
|
40
|
+
background?: BaseTextBackground
|
|
41
|
+
bold?: boolean
|
|
42
|
+
hasMargin?: boolean
|
|
43
|
+
maxCharacters?: number
|
|
44
|
+
noWrap?: boolean
|
|
45
|
+
reverse?: boolean
|
|
46
|
+
size?: BaseSize
|
|
47
|
+
skeleton?: boolean
|
|
48
|
+
text?: BaseTextText
|
|
49
|
+
to?: RouteLocationRaw
|
|
50
|
+
truncate?: boolean
|
|
51
|
+
underline?: boolean
|
|
52
|
+
uppercase?: boolean
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type BaseTextBackground = '' | 'gray' | 'white'
|
|
56
|
+
|
|
57
|
+
export type BaseTextText = string | { base: string, sm: string }
|
package/nuxt.config.ts
CHANGED
|
@@ -11,15 +11,6 @@ export default defineNuxtConfig({
|
|
|
11
11
|
|
|
12
12
|
experimental: { typedPages: true },
|
|
13
13
|
|
|
14
|
-
typescript: {
|
|
15
|
-
tsConfig: {
|
|
16
|
-
compilerOptions: {
|
|
17
|
-
noUncheckedIndexedAccess: false,
|
|
18
|
-
types: ['@saasmakers/ui'],
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
|
|
23
14
|
// --> COMPONENTS, CSS, MODULES & PLUGINS <--
|
|
24
15
|
|
|
25
16
|
components: [
|
|
@@ -59,6 +50,7 @@ export default defineNuxtConfig({
|
|
|
59
50
|
|
|
60
51
|
i18n: {
|
|
61
52
|
defaultLocale: 'en',
|
|
53
|
+
locales: ['en', 'fr'],
|
|
62
54
|
strategy: 'prefix_except_default',
|
|
63
55
|
|
|
64
56
|
detectBrowserLanguage: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saasmakers/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.21",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Reusable Nuxt UI components for SaaS Makers projects",
|
|
7
7
|
"license": "MIT",
|
|
@@ -11,21 +11,13 @@
|
|
|
11
11
|
"directory": "packages/ui"
|
|
12
12
|
},
|
|
13
13
|
"main": "nuxt.config.ts",
|
|
14
|
-
"types": "types/index.d.ts",
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
17
16
|
},
|
|
18
17
|
"files": [
|
|
19
18
|
"app",
|
|
20
|
-
"nuxt.config.ts"
|
|
21
|
-
"types"
|
|
19
|
+
"nuxt.config.ts"
|
|
22
20
|
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"dev": "nuxi dev .playground",
|
|
25
|
-
"dev:prepare": "nuxi prepare .playground",
|
|
26
|
-
"lint": "eslint .",
|
|
27
|
-
"typecheck": "nuxi typecheck"
|
|
28
|
-
},
|
|
29
21
|
"peerDependencies": {
|
|
30
22
|
"nuxt": "4.2.1"
|
|
31
23
|
},
|
|
@@ -47,5 +39,10 @@
|
|
|
47
39
|
"devDependencies": {
|
|
48
40
|
"nuxt": "4.2.1",
|
|
49
41
|
"typescript": "5.9.3"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"dev": "nuxi dev",
|
|
45
|
+
"lint": "eslint .",
|
|
46
|
+
"typecheck": "nuxi typecheck"
|
|
50
47
|
}
|
|
51
|
-
}
|
|
48
|
+
}
|
package/types/bases.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
export type BaseColor
|
|
3
|
-
= | 'black'
|
|
4
|
-
| 'gray'
|
|
5
|
-
| 'green'
|
|
6
|
-
| 'indigo'
|
|
7
|
-
| 'orange'
|
|
8
|
-
| 'red'
|
|
9
|
-
| 'white'
|
|
10
|
-
|
|
11
|
-
export type BaseSize
|
|
12
|
-
= | '2xl'
|
|
13
|
-
| '2xs'
|
|
14
|
-
| '3xl'
|
|
15
|
-
| '3xs'
|
|
16
|
-
| '4xl'
|
|
17
|
-
| 'base'
|
|
18
|
-
| 'lg'
|
|
19
|
-
| 'sm'
|
|
20
|
-
| 'xl'
|
|
21
|
-
| 'xs'
|
|
22
|
-
|
|
23
|
-
export type BaseStatus
|
|
24
|
-
= | 'error'
|
|
25
|
-
| 'info'
|
|
26
|
-
| 'success'
|
|
27
|
-
| 'warning'
|
|
28
|
-
|
|
29
|
-
interface BaseText {
|
|
30
|
-
background?: BaseTextBackground
|
|
31
|
-
bold?: boolean
|
|
32
|
-
hasMargin?: boolean
|
|
33
|
-
maxCharacters?: number
|
|
34
|
-
noWrap?: boolean
|
|
35
|
-
reverse?: boolean
|
|
36
|
-
size?: BaseSize
|
|
37
|
-
skeleton?: boolean
|
|
38
|
-
text?: BaseTextText
|
|
39
|
-
to?: RouteLocationRaw
|
|
40
|
-
truncate?: boolean
|
|
41
|
-
underline?: boolean
|
|
42
|
-
uppercase?: boolean
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
type BaseTextBackground = 'gray' | 'white'
|
|
46
|
-
|
|
47
|
-
type BaseTextText = string | { base: string, sm: string }
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { }
|