sprintify-ui 0.1.10 → 0.1.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -39,7 +39,7 @@
39
39
  "vue-router": "^4.0.0"
40
40
  },
41
41
  "dependencies": {
42
- "@headlessui/vue": "^1.7.9",
42
+ "@headlessui/vue": "^1.7.12",
43
43
  "color2k": "^2.0.2"
44
44
  },
45
45
  "devDependencies": {
@@ -4,7 +4,7 @@
4
4
  :href="action.href"
5
5
  :action="action.action"
6
6
  :class="classes"
7
- class="flex items-center"
7
+ class="flex items-center justify-center"
8
8
  >
9
9
  <BaseIcon
10
10
  v-if="action.icon"
@@ -3,37 +3,36 @@
3
3
  <BaseBreadcrumbs
4
4
  v-if="breadcrumbs"
5
5
  :breadcrumbs="breadcrumbs"
6
- :class="[attributes || subtitle ? 'mb-3' : 'mb-2']"
7
- ></BaseBreadcrumbs>
6
+ class="mb-2"
7
+ />
8
+
8
9
  <div class="lg:flex lg:items-center lg:justify-between">
9
10
  <div class="min-w-0 flex-1">
10
- <div
11
- class="flex flex-wrap items-center"
12
- :class="[compactLayout ? 'gap-2' : 'gap-3']"
13
- >
11
+ <div class="flex flex-col xs:flex-row xs:flex-wrap xs:items-center">
14
12
  <h2
15
- class="font-bold text-slate-900"
13
+ class="order-2 font-bold text-slate-900 xs:order-1"
16
14
  :class="[
17
15
  compactLayout
18
- ? 'text-2xl leading-7'
19
- : 'truncate text-3xl tracking-tight',
16
+ ? 'mr-2 text-2xl leading-7'
17
+ : 'mr-3 truncate text-3xl tracking-tight',
20
18
  ]"
21
19
  >
22
20
  {{ title }}
23
21
  </h2>
24
22
 
25
- <BaseBadge
26
- v-if="badge"
27
- :color="badge.color"
28
- :icon="badge.icon"
29
- class="relative -bottom-px"
30
- >
31
- {{ badge.label }}
32
- </BaseBadge>
23
+ <div v-if="badge" class="order-1 mb-1 xs:order-2 xs:mb-0">
24
+ <BaseBadge
25
+ :color="badge.color"
26
+ :icon="badge.icon"
27
+ class="relative xs:-bottom-[2px]"
28
+ >
29
+ {{ badge.label }}
30
+ </BaseBadge>
31
+ </div>
33
32
  </div>
34
33
  <h3
35
34
  v-if="subtitle"
36
- class="mt-0.5 leading-tight text-slate-500"
35
+ class="mt-1 leading-tight text-slate-500"
37
36
  :class="[compactLayout ? 'text-sm' : 'truncate text-base']"
38
37
  >
39
38
  {{ subtitle }}
@@ -70,7 +69,7 @@
70
69
  />
71
70
 
72
71
  <BaseMenu
73
- v-if="secondaryActions.length"
72
+ v-if="secondaryActions.length > 1"
74
73
  :items="secondaryActions"
75
74
  size="sm"
76
75
  position="bottom-right"
@@ -88,6 +87,11 @@
88
87
  </div>
89
88
  </template>
90
89
  </BaseMenu>
90
+ <BaseActionItemButton
91
+ v-else-if="secondaryActions.length === 1"
92
+ :action="secondaryActions[0]"
93
+ size="sm"
94
+ />
91
95
  </div>
92
96
 
93
97
  <div v-else class="mt-5 flex gap-2 lg:mt-0 lg:ml-4">
@@ -131,13 +135,21 @@ const props = withDefaults(
131
135
  );
132
136
 
133
137
  const primaryActionIndex = computed(() => {
134
- if (!props.actions) {
138
+ if (!props.actions || props.actions.length === 0) {
135
139
  return undefined;
136
140
  }
141
+
137
142
  if (props.actions?.length === 1) {
138
143
  return 0;
139
144
  }
140
- return props.actions?.findIndex((a) => a.color == 'primary');
145
+
146
+ const primaryIndex = props.actions?.findIndex((a) => a.color == 'primary');
147
+
148
+ if (primaryIndex !== -1) {
149
+ return primaryIndex;
150
+ }
151
+
152
+ return 0;
141
153
  });
142
154
 
143
155
  const primaryAction = computed(() => {
@@ -147,7 +159,7 @@ const primaryAction = computed(() => {
147
159
 
148
160
  const index = primaryActionIndex.value;
149
161
 
150
- if (index) {
162
+ if (index !== undefined) {
151
163
  return props.actions[index];
152
164
  }
153
165