jasmincss 1.0.0

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 (76) hide show
  1. package/README.md +524 -0
  2. package/bin/jasmin.js +45 -0
  3. package/dist/index.d.ts +62 -0
  4. package/dist/index.js +14568 -0
  5. package/dist/index.mjs +14524 -0
  6. package/dist/jasmin.css +63308 -0
  7. package/dist/jasmin.min.css +1 -0
  8. package/dist/plugins/nextjs.js +14777 -0
  9. package/dist/plugins/nextjs.mjs +14747 -0
  10. package/dist/plugins/vite.js +14889 -0
  11. package/dist/plugins/vite.mjs +14860 -0
  12. package/package.json +101 -0
  13. package/src/cli/add.js +83 -0
  14. package/src/cli/init.js +210 -0
  15. package/src/cli/run.js +142 -0
  16. package/src/components/accordion.js +309 -0
  17. package/src/components/alerts.js +357 -0
  18. package/src/components/avatars.js +331 -0
  19. package/src/components/badges.js +353 -0
  20. package/src/components/buttons.js +412 -0
  21. package/src/components/cards.js +342 -0
  22. package/src/components/carousel.js +495 -0
  23. package/src/components/chips.js +440 -0
  24. package/src/components/command-palette.js +434 -0
  25. package/src/components/datepicker.js +517 -0
  26. package/src/components/dropdown.js +411 -0
  27. package/src/components/forms.js +516 -0
  28. package/src/components/index.js +81 -0
  29. package/src/components/modals.js +349 -0
  30. package/src/components/navigation.js +463 -0
  31. package/src/components/offcanvas.js +390 -0
  32. package/src/components/popover.js +427 -0
  33. package/src/components/progress.js +396 -0
  34. package/src/components/rating.js +394 -0
  35. package/src/components/skeleton.js +408 -0
  36. package/src/components/spinner.js +453 -0
  37. package/src/components/stepper.js +389 -0
  38. package/src/components/tables.js +304 -0
  39. package/src/components/timeline.js +452 -0
  40. package/src/components/timepicker.js +529 -0
  41. package/src/components/tooltips.js +345 -0
  42. package/src/components/upload.js +490 -0
  43. package/src/config/defaults.js +263 -0
  44. package/src/config/loader.js +109 -0
  45. package/src/core/base.js +241 -0
  46. package/src/core/compiler.js +135 -0
  47. package/src/core/utilities/accessibility.js +290 -0
  48. package/src/core/utilities/animations.js +205 -0
  49. package/src/core/utilities/background.js +109 -0
  50. package/src/core/utilities/colors.js +234 -0
  51. package/src/core/utilities/columns.js +161 -0
  52. package/src/core/utilities/effects.js +261 -0
  53. package/src/core/utilities/filters.js +135 -0
  54. package/src/core/utilities/icons.js +806 -0
  55. package/src/core/utilities/index.js +239 -0
  56. package/src/core/utilities/layout.js +321 -0
  57. package/src/core/utilities/scroll.js +205 -0
  58. package/src/core/utilities/spacing.js +120 -0
  59. package/src/core/utilities/svg.js +191 -0
  60. package/src/core/utilities/transforms.js +116 -0
  61. package/src/core/utilities/typography.js +188 -0
  62. package/src/index.js +7 -0
  63. package/src/js/components/accordion.js +154 -0
  64. package/src/js/components/alert.js +198 -0
  65. package/src/js/components/carousel.js +226 -0
  66. package/src/js/components/dropdown.js +166 -0
  67. package/src/js/components/modal.js +169 -0
  68. package/src/js/components/offcanvas.js +175 -0
  69. package/src/js/components/popover.js +221 -0
  70. package/src/js/components/tabs.js +163 -0
  71. package/src/js/components/tooltip.js +200 -0
  72. package/src/js/index.js +79 -0
  73. package/src/js/types/config.d.ts +228 -0
  74. package/src/js/types/index.d.ts +439 -0
  75. package/src/plugins/nextjs.js +100 -0
  76. package/src/plugins/vite.js +133 -0
@@ -0,0 +1,394 @@
1
+ // Rating/Stars component for JasminCSS
2
+
3
+ export function generateRatingStyles(config) {
4
+ return `/* Rating Base */
5
+ .rating {
6
+ display: inline-flex;
7
+ align-items: center;
8
+ gap: 0.125rem;
9
+ }
10
+
11
+ /* Rating Item */
12
+ .rating-item {
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ width: 1.5rem;
17
+ height: 1.5rem;
18
+ padding: 0;
19
+ background: none;
20
+ border: none;
21
+ color: var(--j-border);
22
+ cursor: pointer;
23
+ transition: all 150ms ease-in-out;
24
+ }
25
+
26
+ .rating-item:hover {
27
+ transform: scale(1.1);
28
+ }
29
+
30
+ .rating-item:focus {
31
+ outline: none;
32
+ }
33
+
34
+ .rating-item:focus-visible {
35
+ outline: 2px solid var(--j-primary);
36
+ outline-offset: 2px;
37
+ border-radius: var(--j-radius-sm, 0.25rem);
38
+ }
39
+
40
+ /* Rating States */
41
+ .rating-item.active,
42
+ .rating-item.filled {
43
+ color: var(--j-warning);
44
+ }
45
+
46
+ .rating-item.half {
47
+ position: relative;
48
+ }
49
+
50
+ .rating-item.half::before {
51
+ content: "";
52
+ position: absolute;
53
+ left: 0;
54
+ top: 0;
55
+ width: 50%;
56
+ height: 100%;
57
+ overflow: hidden;
58
+ color: var(--j-warning);
59
+ }
60
+
61
+ /* Star Icon (default) */
62
+ .rating-star {
63
+ width: 100%;
64
+ height: 100%;
65
+ }
66
+
67
+ /* Default star using CSS */
68
+ .rating-item::before {
69
+ content: "★";
70
+ font-size: 1.25rem;
71
+ line-height: 1;
72
+ }
73
+
74
+ .rating-item:has(svg)::before,
75
+ .rating-item:has(.rating-star)::before {
76
+ display: none;
77
+ }
78
+
79
+ /* Rating Sizes */
80
+ .rating-xs .rating-item {
81
+ width: 1rem;
82
+ height: 1rem;
83
+ }
84
+
85
+ .rating-xs .rating-item::before {
86
+ font-size: 0.875rem;
87
+ }
88
+
89
+ .rating-sm .rating-item {
90
+ width: 1.25rem;
91
+ height: 1.25rem;
92
+ }
93
+
94
+ .rating-sm .rating-item::before {
95
+ font-size: 1rem;
96
+ }
97
+
98
+ .rating-lg .rating-item {
99
+ width: 2rem;
100
+ height: 2rem;
101
+ }
102
+
103
+ .rating-lg .rating-item::before {
104
+ font-size: 1.75rem;
105
+ }
106
+
107
+ .rating-xl .rating-item {
108
+ width: 2.5rem;
109
+ height: 2.5rem;
110
+ }
111
+
112
+ .rating-xl .rating-item::before {
113
+ font-size: 2.25rem;
114
+ }
115
+
116
+ /* Rating Colors */
117
+ .rating-primary .rating-item.active,
118
+ .rating-primary .rating-item.filled {
119
+ color: var(--j-primary);
120
+ }
121
+
122
+ .rating-secondary .rating-item.active,
123
+ .rating-secondary .rating-item.filled {
124
+ color: var(--j-secondary);
125
+ }
126
+
127
+ .rating-success .rating-item.active,
128
+ .rating-success .rating-item.filled {
129
+ color: var(--j-success);
130
+ }
131
+
132
+ .rating-error .rating-item.active,
133
+ .rating-error .rating-item.filled {
134
+ color: var(--j-error);
135
+ }
136
+
137
+ /* Hover Fill Effect */
138
+ .rating-hover .rating-item:hover ~ .rating-item {
139
+ color: var(--j-border);
140
+ }
141
+
142
+ .rating-hover:hover .rating-item {
143
+ color: var(--j-warning);
144
+ }
145
+
146
+ .rating-hover .rating-item:hover ~ .rating-item {
147
+ color: var(--j-border);
148
+ }
149
+
150
+ /* Read-only Rating */
151
+ .rating-readonly .rating-item {
152
+ cursor: default;
153
+ pointer-events: none;
154
+ }
155
+
156
+ .rating-readonly .rating-item:hover {
157
+ transform: none;
158
+ }
159
+
160
+ /* Disabled Rating */
161
+ .rating-disabled {
162
+ opacity: 0.5;
163
+ pointer-events: none;
164
+ }
165
+
166
+ /* Rating with Labels */
167
+ .rating-labeled {
168
+ display: flex;
169
+ align-items: center;
170
+ gap: 0.75rem;
171
+ }
172
+
173
+ .rating-label {
174
+ font-size: 0.875rem;
175
+ color: var(--j-text-muted);
176
+ }
177
+
178
+ .rating-value {
179
+ font-size: 0.875rem;
180
+ font-weight: 600;
181
+ color: var(--j-text);
182
+ min-width: 2rem;
183
+ }
184
+
185
+ /* Rating with Count */
186
+ .rating-count {
187
+ font-size: 0.75rem;
188
+ color: var(--j-text-muted);
189
+ margin-left: 0.25rem;
190
+ }
191
+
192
+ /* Heart Rating */
193
+ .rating-hearts .rating-item::before {
194
+ content: "♥";
195
+ }
196
+
197
+ /* Emoji Rating */
198
+ .rating-emoji .rating-item {
199
+ width: 2rem;
200
+ height: 2rem;
201
+ }
202
+
203
+ .rating-emoji .rating-item::before {
204
+ content: "😐";
205
+ font-size: 1.5rem;
206
+ }
207
+
208
+ .rating-emoji .rating-item:nth-child(1)::before {
209
+ content: "😠";
210
+ }
211
+
212
+ .rating-emoji .rating-item:nth-child(2)::before {
213
+ content: "😕";
214
+ }
215
+
216
+ .rating-emoji .rating-item:nth-child(3)::before {
217
+ content: "😐";
218
+ }
219
+
220
+ .rating-emoji .rating-item:nth-child(4)::before {
221
+ content: "😊";
222
+ }
223
+
224
+ .rating-emoji .rating-item:nth-child(5)::before {
225
+ content: "😍";
226
+ }
227
+
228
+ .rating-emoji .rating-item.active {
229
+ color: inherit;
230
+ transform: scale(1.2);
231
+ }
232
+
233
+ .rating-emoji .rating-item:not(.active) {
234
+ filter: grayscale(1);
235
+ opacity: 0.5;
236
+ }
237
+
238
+ /* Thumbs Rating */
239
+ .rating-thumbs {
240
+ gap: 0.5rem;
241
+ }
242
+
243
+ .rating-thumbs .rating-item {
244
+ width: 2.5rem;
245
+ height: 2.5rem;
246
+ border-radius: 50%;
247
+ background-color: var(--j-bg-subtle);
248
+ border: 1px solid var(--j-border);
249
+ }
250
+
251
+ .rating-thumbs .rating-item:hover {
252
+ background-color: var(--j-bg-muted);
253
+ }
254
+
255
+ .rating-thumbs .rating-item.active.rating-up {
256
+ background-color: color-mix(in srgb, var(--j-success) 15%, transparent);
257
+ border-color: var(--j-success);
258
+ color: var(--j-success);
259
+ }
260
+
261
+ .rating-thumbs .rating-item.active.rating-down {
262
+ background-color: color-mix(in srgb, var(--j-error) 15%, transparent);
263
+ border-color: var(--j-error);
264
+ color: var(--j-error);
265
+ }
266
+
267
+ /* Rating Bar (for displaying aggregated ratings) */
268
+ .rating-bar {
269
+ display: flex;
270
+ flex-direction: column;
271
+ gap: 0.5rem;
272
+ width: 100%;
273
+ }
274
+
275
+ .rating-bar-item {
276
+ display: flex;
277
+ align-items: center;
278
+ gap: 0.75rem;
279
+ }
280
+
281
+ .rating-bar-label {
282
+ display: flex;
283
+ align-items: center;
284
+ gap: 0.25rem;
285
+ min-width: 3rem;
286
+ font-size: 0.875rem;
287
+ color: var(--j-text-muted);
288
+ }
289
+
290
+ .rating-bar-track {
291
+ flex: 1;
292
+ height: 0.5rem;
293
+ background-color: var(--j-bg-muted);
294
+ border-radius: var(--j-radius-full, 9999px);
295
+ overflow: hidden;
296
+ }
297
+
298
+ .rating-bar-fill {
299
+ height: 100%;
300
+ background-color: var(--j-warning);
301
+ border-radius: var(--j-radius-full, 9999px);
302
+ transition: width 300ms ease-in-out;
303
+ }
304
+
305
+ .rating-bar-count {
306
+ min-width: 2.5rem;
307
+ font-size: 0.75rem;
308
+ color: var(--j-text-muted);
309
+ text-align: right;
310
+ }
311
+
312
+ /* Rating Summary */
313
+ .rating-summary {
314
+ display: flex;
315
+ gap: 2rem;
316
+ padding: 1rem;
317
+ background-color: var(--j-bg-subtle);
318
+ border-radius: var(--j-radius-lg, 0.5rem);
319
+ }
320
+
321
+ .rating-summary-score {
322
+ display: flex;
323
+ flex-direction: column;
324
+ align-items: center;
325
+ justify-content: center;
326
+ min-width: 6rem;
327
+ }
328
+
329
+ .rating-summary-value {
330
+ font-size: 3rem;
331
+ font-weight: 700;
332
+ line-height: 1;
333
+ color: var(--j-text);
334
+ }
335
+
336
+ .rating-summary-max {
337
+ font-size: 1rem;
338
+ color: var(--j-text-muted);
339
+ }
340
+
341
+ .rating-summary-total {
342
+ font-size: 0.75rem;
343
+ color: var(--j-text-muted);
344
+ margin-top: 0.25rem;
345
+ }
346
+
347
+ .rating-summary-bars {
348
+ flex: 1;
349
+ }
350
+
351
+ /* Animated Rating */
352
+ .rating-animated .rating-item {
353
+ transition: transform 200ms ease-in-out, color 200ms ease-in-out;
354
+ }
355
+
356
+ .rating-animated .rating-item.active {
357
+ animation: j-bounce 400ms ease-out;
358
+ }
359
+
360
+ /* Glow Rating (Futuristic) */
361
+ .rating-glow .rating-item.active {
362
+ filter: drop-shadow(0 0 4px currentColor);
363
+ }
364
+
365
+ /* Vertical Rating */
366
+ .rating-vertical {
367
+ flex-direction: column;
368
+ }
369
+
370
+ /* Spaced Rating */
371
+ .rating-spaced {
372
+ gap: 0.5rem;
373
+ }
374
+
375
+ /* Bordered Rating Items */
376
+ .rating-bordered .rating-item {
377
+ border: 1px solid var(--j-border);
378
+ border-radius: var(--j-radius-default, 0.375rem);
379
+ padding: 0.25rem;
380
+ }
381
+
382
+ .rating-bordered .rating-item.active {
383
+ border-color: var(--j-warning);
384
+ background-color: color-mix(in srgb, var(--j-warning) 10%, transparent);
385
+ }
386
+
387
+ /* Custom Star Colors by Rating */
388
+ .rating-gradient .rating-item:nth-child(1).active { color: #ef4444; }
389
+ .rating-gradient .rating-item:nth-child(2).active { color: #f97316; }
390
+ .rating-gradient .rating-item:nth-child(3).active { color: #eab308; }
391
+ .rating-gradient .rating-item:nth-child(4).active { color: #84cc16; }
392
+ .rating-gradient .rating-item:nth-child(5).active { color: #22c55e; }
393
+ `;
394
+ }