mgv-backoffice 1.0.6 → 1.0.8

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": "mgv-backoffice",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Shared Vue 3 UI component library",
5
5
  "main": "./dist/ui-lib.umd.js",
6
6
  "module": "./dist/ui-lib.mjs",
@@ -11,11 +11,13 @@
11
11
  "require": "./dist/ui-lib.umd.js",
12
12
  "types": "./dist/index.d.ts"
13
13
  },
14
- "./dist/style.css": "./dist/style.css"
14
+ "./dist/style.css": "./dist/style.css",
15
+ "./tailwind.safelist": "./tailwind.safelist.js"
15
16
  },
16
17
  "files": [
17
18
  "dist",
18
- "src"
19
+ "src",
20
+ "tailwind.safelist.js"
19
21
  ],
20
22
  "scripts": {
21
23
  "build": "vite build",
@@ -0,0 +1,292 @@
1
+ /**
2
+ * MGV-Backoffice Tailwind Safelist
3
+ *
4
+ * Some components in this library build Tailwind classes dynamically
5
+ * (e.g. "bg-" + color + "-100"), which means the Tailwind compiler
6
+ * can't detect them at build time and will purge them.
7
+ *
8
+ * Import this file in your consuming project's tailwind.config.js:
9
+ *
10
+ * const mgvSafelist = require('mgv-backoffice/tailwind.safelist')
11
+ *
12
+ * module.exports = {
13
+ * safelist: mgvSafelist,
14
+ * // ... rest of your config
15
+ * }
16
+ */
17
+
18
+ const colors = ['red', 'green', 'blue', 'yellow', 'gray', 'orange', 'purple']
19
+
20
+ const safelist = [
21
+
22
+ // ── BaseAlert ──────────────────────────────────────────────
23
+ // Dynamic: "text-" + color + "-800 border border-" + color + "-300 ..."
24
+ ...colors.flatMap(c => [
25
+ `text-${c}-800`,
26
+ `border-${c}-300`,
27
+ `bg-${c}-50`,
28
+ `dark:text-${c}-400`,
29
+ `dark:border-${c}-800`,
30
+ ]),
31
+ 'flex',
32
+ 'items-center',
33
+ 'p-4',
34
+ 'mb-4',
35
+ 'text-sm',
36
+ 'border',
37
+ 'rounded-lg',
38
+ 'dark:bg-gray-800',
39
+ 'w-6',
40
+ 'h-6',
41
+ 'text-gray-400',
42
+ 'font-medium',
43
+ 'pl-1',
44
+
45
+ // ── BaseBadge ──────────────────────────────────────────────
46
+ // Dynamic: computed badgeClasses template literal
47
+ 'bg-red-100', 'text-red-700', 'border-red-200',
48
+ 'bg-green-100', 'text-green-700', 'border-green-200',
49
+ 'bg-blue-100', 'text-blue-700', 'border-blue-200',
50
+ 'bg-yellow-100', 'text-yellow-700', 'border-yellow-200',
51
+ 'bg-gray-100', 'text-gray-700', 'border-gray-200',
52
+ 'bg-gray-50', 'text-gray-600',
53
+ 'inline-flex',
54
+ 'gap-1',
55
+ 'font-semibold',
56
+ 'text-xs',
57
+ 'leading-none',
58
+ 'px-3',
59
+ 'py-1.5',
60
+ 'rounded-full',
61
+
62
+ // ── BaseButton ─────────────────────────────────────────────
63
+ // Dynamic: switch on color
64
+ 'focus:outline-none',
65
+ 'text-white',
66
+ 'bg-blue-700',
67
+ 'hover:bg-blue-800',
68
+ 'focus:ring-4',
69
+ 'focus:ring-blue-300',
70
+ 'bg-blue-400',
71
+ 'text-gray-900',
72
+ 'bg-white',
73
+ 'border-gray-200',
74
+ 'hover:bg-gray-100',
75
+ 'hover:text-blue-700',
76
+ 'focus:z-10',
77
+ 'focus:ring-gray-200',
78
+ 'bg-gray-400',
79
+ 'bg-gray-800',
80
+ 'hover:bg-gray-900',
81
+ 'focus:ring-gray-300',
82
+ 'bg-green-700',
83
+ 'hover:bg-green-800',
84
+ 'focus:ring-green-300',
85
+ 'bg-green-400',
86
+ 'bg-red-700',
87
+ 'hover:bg-red-800',
88
+ 'focus:ring-red-300',
89
+ 'bg-red-400',
90
+ 'bg-yellow-400',
91
+ 'hover:bg-yellow-500',
92
+ 'focus:ring-yellow-300',
93
+ 'bg-purple-700',
94
+ 'hover:bg-purple-800',
95
+ 'focus:ring-purple-300',
96
+ 'bg-purple-400',
97
+ // Dynamic: switch on size
98
+ 'px-5',
99
+ 'py-2.5',
100
+ 'mr-2',
101
+ 'mb-2',
102
+ 'py-2',
103
+ 'text-base',
104
+ 'py-3',
105
+ 'px-6',
106
+ 'py-3.5',
107
+ // Dynamic: common
108
+ 'font-medium',
109
+ 'rounded-lg',
110
+ 'rounded-full',
111
+ 'cursor-not-allowed',
112
+ // Static in template
113
+ 'inline',
114
+ 'w-4',
115
+ 'h-4',
116
+ 'me-3',
117
+ 'animate-spin',
118
+
119
+ // ── BaseToast ──────────────────────────────────────────────
120
+ // Dynamic: switch on mode
121
+ 'text-red-500',
122
+ 'bg-red-100',
123
+ 'dark:bg-red-800',
124
+ 'dark:text-red-200',
125
+ 'text-green-500',
126
+ 'bg-green-100',
127
+ 'dark:bg-green-800',
128
+ 'dark:text-green-200',
129
+ 'text-orange-500',
130
+ 'bg-orange-100',
131
+ 'dark:bg-orange-700',
132
+ 'dark:text-orange-200',
133
+ 'inline-flex',
134
+ 'items-center',
135
+ 'justify-center',
136
+ 'flex-shrink-0',
137
+ 'w-8',
138
+ 'h-8',
139
+ // Dynamic: switch on positioning
140
+ 'top-5',
141
+ 'right-5',
142
+ 'bottom-5',
143
+ // Dynamic: computeMainComponentCss
144
+ 'fixed',
145
+ 'w-full',
146
+ 'max-w-md',
147
+ 'space-x-4',
148
+ 'divide-x',
149
+ // Static in template
150
+ 'shadow',
151
+ 'text-gray-500',
152
+ 'bg-white',
153
+ 'dark:text-gray-400',
154
+ 'dark:bg-gray-800',
155
+ 'ml-3',
156
+ 'font-normal',
157
+ 'ml-auto',
158
+ '-mx-1.5',
159
+ '-my-1.5',
160
+ 'hover:text-gray-900',
161
+ 'focus:ring-2',
162
+ 'focus:ring-gray-300',
163
+ 'p-1.5',
164
+ 'hover:bg-gray-100',
165
+ 'h-8',
166
+ 'w-8',
167
+ 'dark:text-gray-500',
168
+ 'dark:hover:text-white',
169
+ 'dark:hover:bg-gray-700',
170
+ 'text-gray-500',
171
+ 'cursor-pointer',
172
+ 'sr-only',
173
+ 'h-6',
174
+ 'w-6',
175
+ 'text-yellow-500',
176
+
177
+ // ── ColoredSquares ─────────────────────────────────────────
178
+ // Dynamic: computeCss() concatenation
179
+ ...colors.flatMap(c => [
180
+ `bg-${c}-100`,
181
+ `text-${c}-800`,
182
+ ]),
183
+ 'font-bold',
184
+ 'px-2.5',
185
+ 'py-0.5',
186
+ // Dynamic: random pastel colors
187
+ 'bg-slate-300',
188
+ 'bg-zinc-300',
189
+ 'bg-neutral-300',
190
+ 'bg-stone-300',
191
+ 'bg-blue-300',
192
+ 'bg-green-300',
193
+ 'bg-yellow-300',
194
+ 'bg-purple-300',
195
+ 'bg-pink-300',
196
+ // Static in template
197
+ 'w-13',
198
+ 'border-gray-300',
199
+ 'relative',
200
+ 'aspect-square',
201
+ 'bg-white',
202
+ 'shadow-sm',
203
+ 'overflow-hidden',
204
+ 'text-center',
205
+ 'absolute',
206
+ 'bottom-0',
207
+ 'left-0',
208
+ 'h-1',
209
+ 'w-full',
210
+
211
+ // ── EuroAmount ─────────────────────────────────────────────
212
+ // Dynamic: conditional :class
213
+ 'text-green-800',
214
+ 'text-red-800',
215
+ 'text-gray-800',
216
+ 'font-bold',
217
+
218
+ // ── TrendArrow ─────────────────────────────────────────────
219
+ 'space-x-2',
220
+ 'h-5',
221
+ 'w-5',
222
+ 'text-red-500',
223
+ 'text-green-500',
224
+
225
+ // ── BaseSpinner ────────────────────────────────────────────
226
+ 'border-2',
227
+ 'border-gray-200',
228
+ 'border-t-blue-500',
229
+ 'animate-spin',
230
+
231
+ // ── BaseRow ────────────────────────────────────────────────
232
+ 'block',
233
+ 'p-8',
234
+ 'rounded-xl',
235
+ 'shadow-sm',
236
+ 'dark:border-gray-700',
237
+
238
+ // ── BaseLine ───────────────────────────────────────────────
239
+ 'h-px',
240
+ 'my-8',
241
+ 'bg-gray-200',
242
+ 'border-0',
243
+ 'dark:bg-gray-700',
244
+ 'w-48',
245
+ 'mx-auto',
246
+ 'my-4',
247
+ 'bg-gray-100',
248
+ 'rounded',
249
+ 'md:my-10',
250
+ 'md:my-12',
251
+
252
+ // ── BaseLogo ───────────────────────────────────────────────
253
+ 'mb-6',
254
+ 'text-2xl',
255
+ 'font-semibold',
256
+ 'text-gray-900',
257
+ 'dark:text-white',
258
+
259
+ // ── BaseModal ──────────────────────────────────────────────
260
+ 'top-20',
261
+ 'mx-auto',
262
+ 'p-5',
263
+ 'w-96',
264
+ 'shadow-lg',
265
+ 'rounded-md',
266
+ 'p-6',
267
+ 'text-center',
268
+ 'w-12',
269
+ 'h-12',
270
+ 'mb-4',
271
+ 'mb-5',
272
+ 'text-lg',
273
+ 'font-normal',
274
+ 'dark:text-gray-400',
275
+ 'justify-center',
276
+
277
+ // ── BaseBreadcrumb ─────────────────────────────────────────
278
+ 'px-5',
279
+ 'py-3',
280
+ 'text-gray-700',
281
+ 'bg-gray-50',
282
+ 'dark:border-gray-700',
283
+ 'space-x-1',
284
+ 'md:space-x-3',
285
+ 'hover:text-blue-600',
286
+ 'dark:hover:text-white',
287
+ 'ml-1',
288
+ 'md:ml-2',
289
+ ]
290
+
291
+ // Deduplicate
292
+ module.exports = [...new Set(safelist)]