@brickflow/ui 0.0.40 → 0.0.43
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/dist/module.json +1 -1
- package/dist/module.mjs +3 -0
- package/dist/runtime/components/Button/icons.demo.vue +9 -9
- package/dist/runtime/components/Button/index.vue +83 -57
- package/dist/runtime/components/Button/size.demo.vue +35 -66
- package/dist/runtime/components/Button/slots.demo.vue +10 -8
- package/dist/runtime/components/Button/state.demo.vue +58 -8
- package/dist/runtime/components/Button/variants.demo.vue +18 -20
- package/dist/runtime/components/Icon/basic.demo.vue +13 -10
- package/dist/runtime/components/Icon/gallery.demo.vue +142 -0
- package/dist/runtime/components/Icon/index.vue +15 -9
- package/dist/runtime/components/Link/basic.demo.vue +7 -7
- package/dist/runtime/components/Link/index.vue +81 -50
- package/dist/runtime/icon-font.d.ts +1 -0
- package/dist/runtime/pages/ui.vue +514 -347
- package/package.json +5 -5
- package/dist/runtime/components/Button/icons.demo.d.vue.ts +0 -8
- package/dist/runtime/components/Button/icons.demo.vue.d.ts +0 -8
- package/dist/runtime/components/Button/index.d.vue.ts +0 -51
- package/dist/runtime/components/Button/index.vue.d.ts +0 -51
- package/dist/runtime/components/Button/size.demo.d.vue.ts +0 -7
- package/dist/runtime/components/Button/size.demo.vue.d.ts +0 -7
- package/dist/runtime/components/Button/slots.demo.d.vue.ts +0 -7
- package/dist/runtime/components/Button/slots.demo.vue.d.ts +0 -7
- package/dist/runtime/components/Button/state.demo.d.vue.ts +0 -7
- package/dist/runtime/components/Button/state.demo.vue.d.ts +0 -7
- package/dist/runtime/components/Button/variants.demo.d.vue.ts +0 -7
- package/dist/runtime/components/Button/variants.demo.vue.d.ts +0 -7
- package/dist/runtime/components/Icon/basic.demo.d.vue.ts +0 -8
- package/dist/runtime/components/Icon/basic.demo.vue.d.ts +0 -8
- package/dist/runtime/components/Icon/index.d.vue.ts +0 -7
- package/dist/runtime/components/Icon/index.vue.d.ts +0 -7
- package/dist/runtime/components/Link/basic.demo.d.vue.ts +0 -8
- package/dist/runtime/components/Link/basic.demo.vue.d.ts +0 -8
- package/dist/runtime/components/Link/index.d.vue.ts +0 -51
- package/dist/runtime/components/Link/index.vue.d.ts +0 -51
- package/dist/runtime/pages/ui.d.vue.ts +0 -4
- package/dist/runtime/pages/ui.vue.d.ts +0 -4
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
defineOptions({
|
|
5
|
+
inheritAttrs: false,
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<{
|
|
10
|
+
name: string
|
|
11
|
+
}>(),
|
|
12
|
+
{},
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
const classes = computed(() => `icon-${props.name}`)
|
|
10
16
|
</script>
|
|
11
17
|
|
|
12
18
|
<template>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export const uiDemo = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export const uiDemo = {
|
|
3
|
+
description: 'Internal navigation keeps the current locale.',
|
|
4
|
+
title: 'Basic usage',
|
|
5
|
+
}
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
|
-
<script setup>
|
|
9
|
-
import Link from
|
|
8
|
+
<script lang="ts" setup>
|
|
9
|
+
import Link from './index.vue'
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -8,55 +8,86 @@
|
|
|
8
8
|
</NuxtLink>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
|
-
<script setup>
|
|
12
|
-
import { computed, ref } from
|
|
13
|
-
import { useRouter } from
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
import { type ComponentPublicInstance, computed, ref } from 'vue'
|
|
13
|
+
import { type RouteLocationPathRaw, type RouteLocationRaw, useRouter } from 'vue-router'
|
|
14
|
+
|
|
15
|
+
import { useTranslate } from '../../composables/useTranslate'
|
|
16
|
+
|
|
17
|
+
defineOptions({ inheritAttrs: false })
|
|
18
|
+
|
|
19
|
+
const props = withDefaults(
|
|
20
|
+
defineProps<{
|
|
21
|
+
activeClass?: string
|
|
22
|
+
class?: (false | string)[] | string
|
|
23
|
+
custom?: boolean
|
|
24
|
+
exactActiveClass?: string
|
|
25
|
+
external?: boolean
|
|
26
|
+
faster?: boolean
|
|
27
|
+
href?: RouteLocationRaw
|
|
28
|
+
onClick?: () => void
|
|
29
|
+
onPointerdown?: () => void
|
|
30
|
+
prefetch?: boolean
|
|
31
|
+
rel?: null | string
|
|
32
|
+
replace?: boolean
|
|
33
|
+
style?: Record<string, string>
|
|
34
|
+
target?: '_blank' | '_parent' | '_self' | '_top' | null | (Record<string, never> & string)
|
|
35
|
+
to?: RouteLocationRaw
|
|
36
|
+
}>(),
|
|
37
|
+
{
|
|
38
|
+
activeClass: undefined,
|
|
39
|
+
class: undefined,
|
|
40
|
+
custom: false,
|
|
41
|
+
exactActiveClass: undefined,
|
|
42
|
+
external: false,
|
|
43
|
+
faster: false,
|
|
44
|
+
href: undefined,
|
|
45
|
+
onClick: undefined,
|
|
46
|
+
onPointerdown: undefined,
|
|
47
|
+
prefetch: false,
|
|
48
|
+
rel: undefined,
|
|
49
|
+
replace: false,
|
|
50
|
+
style: undefined,
|
|
51
|
+
target: undefined,
|
|
52
|
+
to: undefined,
|
|
53
|
+
},
|
|
54
|
+
)
|
|
55
|
+
const { localePath } = useTranslate()
|
|
56
|
+
|
|
57
|
+
const prepareProps = computed(() => {
|
|
58
|
+
const { faster: _faster, onPointerdown: _onPointerdown, ...linkProps } = props
|
|
59
|
+
const refineDrops = { ...linkProps, onPointerdown: props.faster ? handlePointerDown : undefined }
|
|
60
|
+
|
|
61
|
+
if (typeof props.to === 'string') {
|
|
62
|
+
return { ...refineDrops, to: localePath(props.to) }
|
|
63
|
+
} else if ((props.to as RouteLocationPathRaw)?.path) {
|
|
64
|
+
return { ...refineDrops, to: { ...props.to, path: localePath((props.to as RouteLocationPathRaw).path) } }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return refineDrops
|
|
68
|
+
})
|
|
69
|
+
const linkRef = ref<ComponentPublicInstance>()
|
|
70
|
+
|
|
71
|
+
function handlePointerDown(e: PointerEvent): void {
|
|
72
|
+
const router = useRouter()
|
|
73
|
+
props.onPointerdown?.()
|
|
74
|
+
if (e.button !== 0) {
|
|
75
|
+
return
|
|
76
|
+
}
|
|
77
|
+
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
e.preventDefault()
|
|
82
|
+
|
|
83
|
+
const to = prepareProps.value.to
|
|
84
|
+
|
|
85
|
+
if (!to) {
|
|
86
|
+
return
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
props.replace ? router.replace(to) : router.push(to)
|
|
58
90
|
}
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
defineExpose({ linkRef });
|
|
91
|
+
|
|
92
|
+
defineExpose({ linkRef })
|
|
62
93
|
</script>
|