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,390 @@
1
+ // Offcanvas/Drawer component for JasminCSS
2
+
3
+ export function generateOffcanvasStyles(config) {
4
+ return `/* Offcanvas Base */
5
+ .offcanvas {
6
+ position: fixed;
7
+ z-index: 1050;
8
+ display: flex;
9
+ flex-direction: column;
10
+ max-width: 100%;
11
+ background-color: var(--j-bg);
12
+ background-clip: padding-box;
13
+ outline: 0;
14
+ transition: transform 300ms ease-in-out;
15
+ visibility: hidden;
16
+ }
17
+
18
+ .offcanvas.show {
19
+ visibility: visible;
20
+ }
21
+
22
+ /* Offcanvas Backdrop */
23
+ .offcanvas-backdrop {
24
+ position: fixed;
25
+ top: 0;
26
+ left: 0;
27
+ z-index: 1040;
28
+ width: 100vw;
29
+ height: 100vh;
30
+ background-color: rgba(0, 0, 0, 0.5);
31
+ opacity: 0;
32
+ visibility: hidden;
33
+ transition: opacity 300ms ease-in-out, visibility 300ms;
34
+ }
35
+
36
+ .offcanvas-backdrop.show {
37
+ opacity: 1;
38
+ visibility: visible;
39
+ }
40
+
41
+ .offcanvas-backdrop.fade {
42
+ opacity: 0;
43
+ }
44
+
45
+ /* Offcanvas Positions */
46
+ .offcanvas-start {
47
+ top: 0;
48
+ left: 0;
49
+ width: 400px;
50
+ height: 100vh;
51
+ border-right: 1px solid var(--j-border);
52
+ transform: translateX(-100%);
53
+ }
54
+
55
+ .offcanvas-start.show {
56
+ transform: translateX(0);
57
+ }
58
+
59
+ .offcanvas-end {
60
+ top: 0;
61
+ right: 0;
62
+ width: 400px;
63
+ height: 100vh;
64
+ border-left: 1px solid var(--j-border);
65
+ transform: translateX(100%);
66
+ }
67
+
68
+ .offcanvas-end.show {
69
+ transform: translateX(0);
70
+ }
71
+
72
+ .offcanvas-top {
73
+ top: 0;
74
+ left: 0;
75
+ right: 0;
76
+ width: 100%;
77
+ height: auto;
78
+ max-height: 100vh;
79
+ border-bottom: 1px solid var(--j-border);
80
+ transform: translateY(-100%);
81
+ }
82
+
83
+ .offcanvas-top.show {
84
+ transform: translateY(0);
85
+ }
86
+
87
+ .offcanvas-bottom {
88
+ bottom: 0;
89
+ left: 0;
90
+ right: 0;
91
+ width: 100%;
92
+ height: auto;
93
+ max-height: 100vh;
94
+ border-top: 1px solid var(--j-border);
95
+ transform: translateY(100%);
96
+ }
97
+
98
+ .offcanvas-bottom.show {
99
+ transform: translateY(0);
100
+ }
101
+
102
+ /* Offcanvas Sizes */
103
+ .offcanvas-sm {
104
+ width: 300px;
105
+ }
106
+
107
+ .offcanvas-lg {
108
+ width: 500px;
109
+ }
110
+
111
+ .offcanvas-xl {
112
+ width: 600px;
113
+ }
114
+
115
+ .offcanvas-full {
116
+ width: 100%;
117
+ }
118
+
119
+ .offcanvas-top.offcanvas-sm,
120
+ .offcanvas-bottom.offcanvas-sm {
121
+ height: 200px;
122
+ width: 100%;
123
+ }
124
+
125
+ .offcanvas-top.offcanvas-lg,
126
+ .offcanvas-bottom.offcanvas-lg {
127
+ height: 400px;
128
+ width: 100%;
129
+ }
130
+
131
+ /* Offcanvas Header */
132
+ .offcanvas-header {
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: space-between;
136
+ padding: 1rem 1.5rem;
137
+ border-bottom: 1px solid var(--j-border);
138
+ }
139
+
140
+ .offcanvas-title {
141
+ margin: 0;
142
+ font-size: 1.25rem;
143
+ font-weight: 600;
144
+ line-height: 1.5;
145
+ color: var(--j-text);
146
+ }
147
+
148
+ .offcanvas-close {
149
+ display: flex;
150
+ align-items: center;
151
+ justify-content: center;
152
+ width: 2rem;
153
+ height: 2rem;
154
+ padding: 0;
155
+ background-color: transparent;
156
+ border: none;
157
+ border-radius: var(--j-radius-default, 0.375rem);
158
+ cursor: pointer;
159
+ color: var(--j-text-muted);
160
+ transition: all 150ms ease-in-out;
161
+ }
162
+
163
+ .offcanvas-close:hover {
164
+ background-color: var(--j-bg-subtle);
165
+ color: var(--j-text);
166
+ }
167
+
168
+ .offcanvas-close svg {
169
+ width: 1.25rem;
170
+ height: 1.25rem;
171
+ }
172
+
173
+ /* Default X icon */
174
+ .offcanvas-close::before {
175
+ content: "×";
176
+ font-size: 1.5rem;
177
+ line-height: 1;
178
+ }
179
+
180
+ .offcanvas-close:has(svg)::before {
181
+ display: none;
182
+ }
183
+
184
+ /* Offcanvas Body */
185
+ .offcanvas-body {
186
+ flex: 1;
187
+ padding: 1.5rem;
188
+ overflow-y: auto;
189
+ }
190
+
191
+ .offcanvas-body-flush {
192
+ padding: 0;
193
+ }
194
+
195
+ /* Offcanvas Footer */
196
+ .offcanvas-footer {
197
+ display: flex;
198
+ align-items: center;
199
+ gap: 0.75rem;
200
+ padding: 1rem 1.5rem;
201
+ border-top: 1px solid var(--j-border);
202
+ }
203
+
204
+ .offcanvas-footer-end {
205
+ justify-content: flex-end;
206
+ }
207
+
208
+ .offcanvas-footer-between {
209
+ justify-content: space-between;
210
+ }
211
+
212
+ /* No Backdrop Variant */
213
+ .offcanvas-no-backdrop + .offcanvas-backdrop {
214
+ display: none;
215
+ }
216
+
217
+ /* Static Backdrop (no close on click) */
218
+ .offcanvas-static .offcanvas-backdrop {
219
+ cursor: default;
220
+ }
221
+
222
+ /* Scroll Body When Open */
223
+ body.offcanvas-open {
224
+ overflow: hidden;
225
+ padding-right: var(--j-scrollbar-width, 0);
226
+ }
227
+
228
+ /* Responsive Offcanvas */
229
+ @media (min-width: 576px) {
230
+ .offcanvas-sm-show {
231
+ visibility: visible;
232
+ transform: none;
233
+ }
234
+ }
235
+
236
+ @media (min-width: 768px) {
237
+ .offcanvas-md-show {
238
+ visibility: visible;
239
+ transform: none;
240
+ }
241
+ }
242
+
243
+ @media (min-width: 1024px) {
244
+ .offcanvas-lg-show {
245
+ visibility: visible;
246
+ transform: none;
247
+ }
248
+ }
249
+
250
+ @media (min-width: 1280px) {
251
+ .offcanvas-xl-show {
252
+ visibility: visible;
253
+ transform: none;
254
+ }
255
+ }
256
+
257
+ /* Dark Variant */
258
+ .offcanvas-dark {
259
+ background-color: var(--j-bg-dark, #1f2937);
260
+ color: white;
261
+ border-color: var(--j-border-dark, #374151);
262
+ }
263
+
264
+ .offcanvas-dark .offcanvas-header {
265
+ border-color: var(--j-border-dark, #374151);
266
+ }
267
+
268
+ .offcanvas-dark .offcanvas-title {
269
+ color: white;
270
+ }
271
+
272
+ .offcanvas-dark .offcanvas-close {
273
+ color: rgba(255, 255, 255, 0.7);
274
+ }
275
+
276
+ .offcanvas-dark .offcanvas-close:hover {
277
+ background-color: rgba(255, 255, 255, 0.1);
278
+ color: white;
279
+ }
280
+
281
+ .offcanvas-dark .offcanvas-footer {
282
+ border-color: var(--j-border-dark, #374151);
283
+ }
284
+
285
+ /* Glass Variant */
286
+ .offcanvas-glass {
287
+ background: rgba(255, 255, 255, 0.8);
288
+ backdrop-filter: blur(12px);
289
+ -webkit-backdrop-filter: blur(12px);
290
+ border-color: rgba(255, 255, 255, 0.3);
291
+ }
292
+
293
+ .dark .offcanvas-glass {
294
+ background: rgba(0, 0, 0, 0.7);
295
+ border-color: rgba(255, 255, 255, 0.1);
296
+ }
297
+
298
+ .offcanvas-glass .offcanvas-header,
299
+ .offcanvas-glass .offcanvas-footer {
300
+ border-color: rgba(0, 0, 0, 0.1);
301
+ }
302
+
303
+ .dark .offcanvas-glass .offcanvas-header,
304
+ .dark .offcanvas-glass .offcanvas-footer {
305
+ border-color: rgba(255, 255, 255, 0.1);
306
+ }
307
+
308
+ /* Push Content Variant */
309
+ .offcanvas-push ~ .page-content {
310
+ transition: transform 300ms ease-in-out;
311
+ }
312
+
313
+ .offcanvas-push.offcanvas-start.show ~ .page-content {
314
+ transform: translateX(400px);
315
+ }
316
+
317
+ .offcanvas-push.offcanvas-end.show ~ .page-content {
318
+ transform: translateX(-400px);
319
+ }
320
+
321
+ /* Slide Over (Mini variant for notifications, etc.) */
322
+ .offcanvas-mini {
323
+ width: 320px;
324
+ box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
325
+ }
326
+
327
+ .offcanvas-mini.offcanvas-start {
328
+ box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
329
+ }
330
+
331
+ /* Stacked Offcanvas */
332
+ .offcanvas-stacked {
333
+ z-index: 1060;
334
+ }
335
+
336
+ .offcanvas-stacked + .offcanvas-backdrop {
337
+ z-index: 1055;
338
+ }
339
+
340
+ /* Navigation Drawer */
341
+ .offcanvas-nav {
342
+ width: 280px;
343
+ }
344
+
345
+ .offcanvas-nav .offcanvas-body {
346
+ padding: 0;
347
+ }
348
+
349
+ .offcanvas-nav-item {
350
+ display: flex;
351
+ align-items: center;
352
+ gap: 0.75rem;
353
+ padding: 0.75rem 1.5rem;
354
+ color: var(--j-text);
355
+ text-decoration: none;
356
+ transition: background-color 150ms ease-in-out;
357
+ }
358
+
359
+ .offcanvas-nav-item:hover {
360
+ background-color: var(--j-bg-subtle);
361
+ }
362
+
363
+ .offcanvas-nav-item.active {
364
+ background-color: color-mix(in srgb, var(--j-primary) 10%, transparent);
365
+ color: var(--j-primary);
366
+ }
367
+
368
+ .offcanvas-nav-item-icon {
369
+ width: 1.25rem;
370
+ height: 1.25rem;
371
+ flex-shrink: 0;
372
+ opacity: 0.7;
373
+ }
374
+
375
+ .offcanvas-nav-divider {
376
+ height: 0;
377
+ margin: 0.5rem 0;
378
+ border-top: 1px solid var(--j-border);
379
+ }
380
+
381
+ .offcanvas-nav-header {
382
+ padding: 0.75rem 1.5rem 0.5rem;
383
+ font-size: 0.75rem;
384
+ font-weight: 600;
385
+ color: var(--j-text-muted);
386
+ text-transform: uppercase;
387
+ letter-spacing: 0.05em;
388
+ }
389
+ `;
390
+ }