@saasmakers/ui 1.5.0 → 1.5.1

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.
@@ -3,8 +3,10 @@ import type { BaseDivider } from '../../types/bases'
3
3
 
4
4
  const props = withDefaults(defineProps<BaseDivider>(), {
5
5
  borderStyle: 'solid',
6
+ color: 'black',
6
7
  hideNext: false,
7
8
  hidePrevious: false,
9
+ light: false,
8
10
  loading: false,
9
11
  navigable: false,
10
12
  pill: false,
@@ -12,6 +14,34 @@ const props = withDefaults(defineProps<BaseDivider>(), {
12
14
  title: '',
13
15
  })
14
16
 
17
+ const pillLineBorderClasses = computed(() => {
18
+ if (!props.pill) {
19
+ return 'border-gray-300 dark:border-gray-700'
20
+ }
21
+
22
+ if (props.color === 'indigo' && !props.light) {
23
+ return 'border-indigo-700 dark:border-indigo-300'
24
+ }
25
+
26
+ if (props.color === 'gray' && props.light) {
27
+ return 'border-gray-300 dark:border-gray-700'
28
+ }
29
+
30
+ return 'border-gray-900 dark:border-gray-300'
31
+ })
32
+
33
+ const pillClasses = computed(() => {
34
+ if (props.color === 'indigo' && !props.light) {
35
+ return 'bg-indigo-800 dark:bg-indigo-200 text-white dark:text-black'
36
+ }
37
+
38
+ if (props.color === 'gray' && props.light) {
39
+ return 'bg-gray-100 dark:bg-gray-900 text-gray-600 dark:text-gray-400'
40
+ }
41
+
42
+ return 'bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900'
43
+ })
44
+
15
45
  const emit = defineEmits<{
16
46
  navigate: [event: MouseEvent, direction: BaseDividerNavigateDirection]
17
47
  }>()
@@ -64,19 +94,21 @@ function onNavigate(event: MouseEvent, direction: BaseDividerNavigateDirection)
64
94
 
65
95
  <div
66
96
  class="flex-1 border-t"
67
- :class="{
68
- 'border-dashed': borderStyle === 'dashed',
69
- 'border-dotted': borderStyle === 'dotted',
70
- 'border-gray-900 dark:border-gray-300': pill,
71
- 'border-gray-300 dark:border-gray-700': !pill,
72
- }"
97
+ :class="[
98
+ pillLineBorderClasses,
99
+ {
100
+ 'border-dashed': borderStyle === 'dashed',
101
+ 'border-dotted': borderStyle === 'dotted',
102
+ },
103
+ ]"
73
104
  style="height: 1px"
74
105
  />
75
106
  </div>
76
107
 
77
108
  <span
78
109
  v-if="pill && title && !loading"
79
- class="mx-3 rounded-full bg-gray-900 px-3 py-1 text-xs text-white font-medium tracking-wide dark:bg-gray-100 dark:text-gray-900"
110
+ class="mx-3 rounded-full px-3 py-1 text-xs font-medium tracking-wide"
111
+ :class="pillClasses"
80
112
  >{{ title }}</span>
81
113
 
82
114
  <BaseText
@@ -89,12 +121,13 @@ function onNavigate(event: MouseEvent, direction: BaseDividerNavigateDirection)
89
121
  <div class="flex items-center">
90
122
  <div
91
123
  class="flex-1 border-t"
92
- :class="{
93
- 'border-dashed': borderStyle === 'dashed',
94
- 'border-dotted': borderStyle === 'dotted',
95
- 'border-gray-900 dark:border-gray-300': pill,
96
- 'border-gray-300 dark:border-gray-700': !pill,
97
- }"
124
+ :class="[
125
+ pillLineBorderClasses,
126
+ {
127
+ 'border-dashed': borderStyle === 'dashed',
128
+ 'border-dotted': borderStyle === 'dotted',
129
+ },
130
+ ]"
98
131
  style="height: 1px"
99
132
  />
100
133
 
@@ -131,8 +131,10 @@ export type BaseColor
131
131
 
132
132
  export interface BaseDivider {
133
133
  borderStyle?: BaseDividerBorderStyle
134
+ color?: BaseColor
134
135
  hideNext?: boolean
135
136
  hidePrevious?: boolean
137
+ light?: boolean
136
138
  loading?: boolean
137
139
  navigable?: boolean
138
140
  pill?: boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "private": false,
5
5
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
6
6
  "license": "MIT",