@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.
Files changed (38) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +3 -0
  3. package/dist/runtime/components/Button/icons.demo.vue +9 -9
  4. package/dist/runtime/components/Button/index.vue +83 -57
  5. package/dist/runtime/components/Button/size.demo.vue +35 -66
  6. package/dist/runtime/components/Button/slots.demo.vue +10 -8
  7. package/dist/runtime/components/Button/state.demo.vue +58 -8
  8. package/dist/runtime/components/Button/variants.demo.vue +18 -20
  9. package/dist/runtime/components/Icon/basic.demo.vue +13 -10
  10. package/dist/runtime/components/Icon/gallery.demo.vue +142 -0
  11. package/dist/runtime/components/Icon/index.vue +15 -9
  12. package/dist/runtime/components/Link/basic.demo.vue +7 -7
  13. package/dist/runtime/components/Link/index.vue +81 -50
  14. package/dist/runtime/icon-font.d.ts +1 -0
  15. package/dist/runtime/pages/ui.vue +514 -347
  16. package/package.json +5 -5
  17. package/dist/runtime/components/Button/icons.demo.d.vue.ts +0 -8
  18. package/dist/runtime/components/Button/icons.demo.vue.d.ts +0 -8
  19. package/dist/runtime/components/Button/index.d.vue.ts +0 -51
  20. package/dist/runtime/components/Button/index.vue.d.ts +0 -51
  21. package/dist/runtime/components/Button/size.demo.d.vue.ts +0 -7
  22. package/dist/runtime/components/Button/size.demo.vue.d.ts +0 -7
  23. package/dist/runtime/components/Button/slots.demo.d.vue.ts +0 -7
  24. package/dist/runtime/components/Button/slots.demo.vue.d.ts +0 -7
  25. package/dist/runtime/components/Button/state.demo.d.vue.ts +0 -7
  26. package/dist/runtime/components/Button/state.demo.vue.d.ts +0 -7
  27. package/dist/runtime/components/Button/variants.demo.d.vue.ts +0 -7
  28. package/dist/runtime/components/Button/variants.demo.vue.d.ts +0 -7
  29. package/dist/runtime/components/Icon/basic.demo.d.vue.ts +0 -8
  30. package/dist/runtime/components/Icon/basic.demo.vue.d.ts +0 -8
  31. package/dist/runtime/components/Icon/index.d.vue.ts +0 -7
  32. package/dist/runtime/components/Icon/index.vue.d.ts +0 -7
  33. package/dist/runtime/components/Link/basic.demo.d.vue.ts +0 -8
  34. package/dist/runtime/components/Link/basic.demo.vue.d.ts +0 -8
  35. package/dist/runtime/components/Link/index.d.vue.ts +0 -51
  36. package/dist/runtime/components/Link/index.vue.d.ts +0 -51
  37. package/dist/runtime/pages/ui.d.vue.ts +0 -4
  38. package/dist/runtime/pages/ui.vue.d.ts +0 -4
@@ -1,12 +1,18 @@
1
- <script setup>
2
- import { computed } from "vue";
3
- defineOptions({
4
- inheritAttrs: false
5
- });
6
- const props = defineProps({
7
- name: { type: String, required: true }
8
- });
9
- const classes = computed(() => `icon-${props.name}`);
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
- description: "Internal navigation keeps the current locale.",
4
- title: "Basic usage"
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 "./index.vue";
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 "vue";
13
- import { useRouter } from "vue-router";
14
- import { useTranslate } from "../../composables/useTranslate";
15
- defineOptions({ inheritAttrs: false });
16
- const props = defineProps({
17
- activeClass: { type: String, required: false, default: void 0 },
18
- class: { type: [Array, String], required: false, default: void 0 },
19
- custom: { type: Boolean, required: false, default: false },
20
- exactActiveClass: { type: String, required: false, default: void 0 },
21
- external: { type: Boolean, required: false, default: false },
22
- faster: { type: Boolean, required: false, default: false },
23
- href: { type: null, required: false, default: void 0 },
24
- onClick: { type: Function, required: false, default: void 0 },
25
- onPointerdown: { type: Function, required: false, default: void 0 },
26
- prefetch: { type: Boolean, required: false, default: false },
27
- rel: { type: [null, String], required: false, default: void 0 },
28
- replace: { type: Boolean, required: false, default: false },
29
- style: { type: Object, required: false, default: void 0 },
30
- target: { type: [String, null, Object], required: false, default: void 0 },
31
- to: { type: null, required: false, default: void 0 }
32
- });
33
- const { localePath } = useTranslate();
34
- const prepareProps = computed(() => {
35
- const { faster: _faster, onPointerdown: _onPointerdown, ...linkProps } = props;
36
- const refineDrops = { ...linkProps, onPointerdown: props.faster ? handlePointerDown : void 0 };
37
- if (typeof props.to === "string") {
38
- return { ...refineDrops, to: localePath(props.to) };
39
- } else if (props.to?.path) {
40
- return { ...refineDrops, to: { ...props.to, path: localePath(props.to.path) } };
41
- }
42
- return refineDrops;
43
- });
44
- const linkRef = ref();
45
- function handlePointerDown(e) {
46
- const router = useRouter();
47
- props.onPointerdown?.();
48
- if (e.button !== 0) {
49
- return;
50
- }
51
- if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
52
- return;
53
- }
54
- e.preventDefault();
55
- const to = prepareProps.value.to;
56
- if (!to) {
57
- return;
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
- props.replace ? router.replace(to) : router.push(to);
60
- }
61
- defineExpose({ linkRef });
91
+
92
+ defineExpose({ linkRef })
62
93
  </script>
@@ -1,4 +1,5 @@
1
1
  declare module '#brickflow-ui-icons' {
2
+ export const buttonConfig: import('./components/Button/index.vue').ButtonConfig
2
3
  export const firstIconName: string
3
4
  export const iconNames: readonly string[]
4
5
  }