@brickflow/ui 0.0.48 → 0.0.49

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "configKey": "brickflowUi",
6
6
  "name": "@brickflow/ui",
7
- "version": "0.0.48",
7
+ "version": "0.0.49",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
@@ -3,6 +3,7 @@
3
3
  colorClasses: Record<string, Record<string, string>>
4
4
  colorDefault: string
5
5
  loadingIconName: string
6
+ loadingIconTransition: string
6
7
  sizeClasses: Record<string, string>
7
8
  sizeDefault: string
8
9
  sizeIconClasses: Record<string, string>
@@ -15,6 +16,7 @@
15
16
  <script setup lang="ts">
16
17
  import type { RouteLocationRaw } from 'vue-router'
17
18
 
19
+ import { twMerge } from 'tailwind-merge'
18
20
  import { computed, shallowRef } from 'vue'
19
21
 
20
22
  import Icon from '../Icon/index.vue'
@@ -58,10 +60,9 @@
58
60
  const isButton = computed(() => props.to === undefined)
59
61
  const classes = computed(() => [
60
62
  UI_STYLE.base,
61
- sizeClasses[props.size],
63
+ twMerge(sizeClasses[props.size], props.square && UI_STYLE.state.square),
62
64
  colorClasses[props.color][props.variant],
63
65
  props.block && UI_STYLE.state.block,
64
- props.square && UI_STYLE.state.square,
65
66
  disabled.value && UI_STYLE.state.disabled,
66
67
  ])
67
68
 
@@ -93,25 +94,30 @@
93
94
  }"
94
95
  @contextmenu.prevent
95
96
  >
96
- <span
97
- v-if="$slots.leading || props.icon || props.loading"
98
- :class="UI_STYLE.slot.leading"
97
+ <Transition
98
+ name="poof"
99
+ mode="out-in"
99
100
  >
100
- <slot name="leading">
101
+ <span v-if="props.loading">
101
102
  <Icon
102
- v-if="props.loading"
103
103
  :name="UI_CONFIG.loadingIconName"
104
- :class="UI_STYLE.state.loading"
104
+ :class="[UI_STYLE.state.loading, sizeIconClasses[props.size]]"
105
105
  aria-hidden="true"
106
106
  />
107
- <Icon
108
- v-else
109
- :name="props.icon!"
110
- :class="sizeIconClasses[props.size]"
111
- aria-hidden="true"
112
- />
113
- </slot>
114
- </span>
107
+ </span>
108
+ <span
109
+ v-else-if="$slots.leading || props.icon"
110
+ :class="UI_STYLE.slot.leading"
111
+ >
112
+ <slot name="leading">
113
+ <Icon
114
+ :name="props.icon!"
115
+ :class="sizeIconClasses[props.size]"
116
+ aria-hidden="true"
117
+ />
118
+ </slot>
119
+ </span>
120
+ </Transition>
115
121
 
116
122
  <span
117
123
  v-if="$slots.default"
@@ -43,5 +43,19 @@
43
43
  </Button>
44
44
  </div>
45
45
  </div>
46
+ <div class="flex flex-wrap items-center gap-3">
47
+ <div
48
+ v-for="(_, size) in buttonConfig.sizeClasses"
49
+ :key="size"
50
+ class="flex flex-col items-center gap-1"
51
+ >
52
+ <span class="text-xs text-zinc-500">{{ size }}</span>
53
+ <Button
54
+ :icon="firstIconName"
55
+ :size="size"
56
+ square
57
+ ></Button>
58
+ </div>
59
+ </div>
46
60
  </div>
47
61
  </template>
@@ -5,15 +5,26 @@
5
5
  </script>
6
6
 
7
7
  <script lang="ts" setup>
8
- import { buttonConfig } from '#brickflow-ui-icons'
8
+ import { ref } from 'vue'
9
+
10
+ import { buttonConfig, firstIconName } from '#brickflow-ui-icons'
9
11
 
10
12
  import Button from './index.vue'
11
13
 
12
14
  const firstColorClasses = Object.values(buttonConfig.colorClasses)[0] ?? {}
15
+
16
+ const stateActive = ref(true)
13
17
  </script>
14
18
 
15
19
  <template>
16
20
  <div class="flex flex-wrap items-center gap-3">
21
+ <button
22
+ type="button"
23
+ class="cursor-pointer rounded-xl bg-blue-500 px-3 py-2"
24
+ @click="stateActive = !stateActive"
25
+ >
26
+ {{ stateActive ? 'On' : 'Off' }}
27
+ </button>
17
28
  <div class="basis-full">
18
29
  <div class="relative flex w-fit flex-col items-start gap-3 pl-13">
19
30
  <div class="absolute top-0 left-0 z-0 size-full object-cover pt-7 pl-13">
@@ -44,14 +55,15 @@
44
55
  class="flex flex-col items-stretch gap-2"
45
56
  >
46
57
  <Button
47
- disabled
58
+ :disabled="stateActive"
48
59
  :color="color"
49
60
  :variant="variant"
50
61
  >
51
62
  Disabled
52
63
  </Button>
53
64
  <Button
54
- loading
65
+ :loading="stateActive"
66
+ :icon="firstIconName"
55
67
  :color="color"
56
68
  :variant="variant"
57
69
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickflow/ui",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "type": "module",
5
5
  "description": "brickflow UI Nuxt module.",
6
6
  "files": [
@@ -36,6 +36,7 @@
36
36
  "@tailwindcss/vite": "4.3.3",
37
37
  "fantasticon": "4.1.0",
38
38
  "jiti": "2.7.0",
39
+ "tailwind-merge": "3.6.0",
39
40
  "tailwindcss": "4.3.3"
40
41
  },
41
42
  "devDependencies": {