@itzsa/nepali-datepicker 0.3.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.
package/src/styles.css ADDED
@@ -0,0 +1,619 @@
1
+ /**
2
+ * Optional styles for @itzsa/nepali-datepicker.
3
+ * Import once: `import "@itzsa/nepali-datepicker/styles.css"`
4
+ *
5
+ * Uses brand tokens; override via CSS variables on `.itzsa-ndp` or `:root`.
6
+ */
7
+
8
+ .itzsa-ndp {
9
+ --ndp-bg: #ffffff;
10
+ --ndp-fg: #1a1915;
11
+ --ndp-muted: #6f6e68;
12
+ --ndp-border: #e4e2db;
13
+ --ndp-surface: #f7f6f2;
14
+ --ndp-accent: #1d9e75;
15
+ --ndp-accent-fg: #04342c;
16
+ --ndp-ring: color-mix(in oklab, var(--ndp-accent) 40%, transparent);
17
+ --ndp-radius: 10px;
18
+ /* English (default): Outfit. Nepali UI: Devanagari via [data-locale="ne"]. */
19
+ --ndp-font: var(--font-outfit, "Outfit"), ui-sans-serif, system-ui, sans-serif;
20
+ position: relative;
21
+ width: 100%;
22
+ font-family: var(--ndp-font);
23
+ color: var(--ndp-fg);
24
+ }
25
+
26
+ .itzsa-ndp[data-locale="ne"],
27
+ .itzsa-ndp-popover[data-locale="ne"] {
28
+ --ndp-font: var(
29
+ --itzsa-nepali-font,
30
+ "Noto Sans Devanagari"
31
+ ), var(--font-outfit, "Outfit"), ui-sans-serif, system-ui, sans-serif;
32
+ }
33
+
34
+ .dark .itzsa-ndp,
35
+ .itzsa-ndp[data-theme="dark"],
36
+ .dark .itzsa-ndp-popover,
37
+ .itzsa-ndp-popover[data-theme="dark"] {
38
+ --ndp-bg: #161615;
39
+ --ndp-fg: #f1efe8;
40
+ --ndp-muted: #888780;
41
+ --ndp-border: #2c2c2a;
42
+ --ndp-surface: #1c1c1a;
43
+ --ndp-accent: #1d9e75;
44
+ --ndp-accent-fg: #04342c;
45
+ }
46
+
47
+ .itzsa-ndp-field {
48
+ position: relative;
49
+ display: flex;
50
+ align-items: center;
51
+ }
52
+
53
+ .itzsa-ndp-input {
54
+ box-sizing: border-box;
55
+ width: 100%;
56
+ height: 2rem;
57
+ min-width: 0;
58
+ padding: 0.25rem 2rem 0.25rem 0.625rem;
59
+ border: 1px solid var(--ndp-border);
60
+ border-radius: var(--ndp-radius);
61
+ background: transparent;
62
+ color: var(--ndp-fg);
63
+ font: inherit;
64
+ font-size: 0.875rem;
65
+ line-height: 1.25;
66
+ outline: none;
67
+ cursor: pointer;
68
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
69
+ }
70
+
71
+ .itzsa-ndp-input::placeholder {
72
+ color: var(--ndp-muted);
73
+ }
74
+
75
+ .itzsa-ndp-input:focus-visible {
76
+ border-color: var(--ndp-accent);
77
+ box-shadow: 0 0 0 3px var(--ndp-ring);
78
+ }
79
+
80
+ .itzsa-ndp[data-disabled] .itzsa-ndp-input,
81
+ .itzsa-ndp-input:disabled {
82
+ opacity: 0.5;
83
+ cursor: not-allowed;
84
+ background: color-mix(in oklab, var(--ndp-surface) 80%, transparent);
85
+ }
86
+
87
+ .itzsa-ndp-trigger {
88
+ position: absolute;
89
+ right: 0.25rem;
90
+ display: inline-flex;
91
+ align-items: center;
92
+ justify-content: center;
93
+ width: 1.75rem;
94
+ height: 1.75rem;
95
+ border: 0;
96
+ border-radius: calc(var(--ndp-radius) - 2px);
97
+ background: transparent;
98
+ color: var(--ndp-muted);
99
+ cursor: pointer;
100
+ }
101
+
102
+ .itzsa-ndp-trigger:hover:not(:disabled) {
103
+ color: var(--ndp-fg);
104
+ background: var(--ndp-surface);
105
+ }
106
+
107
+ .itzsa-ndp-trigger:disabled {
108
+ opacity: 0.5;
109
+ cursor: not-allowed;
110
+ }
111
+
112
+ .itzsa-ndp-popover {
113
+ --ndp-bg: #ffffff;
114
+ --ndp-fg: #1a1915;
115
+ --ndp-muted: #6f6e68;
116
+ --ndp-border: #e4e2db;
117
+ --ndp-surface: #f7f6f2;
118
+ --ndp-accent: #1d9e75;
119
+ --ndp-accent-fg: #04342c;
120
+ --ndp-ring: color-mix(in oklab, var(--ndp-accent) 40%, transparent);
121
+ --ndp-radius: 10px;
122
+ --ndp-font: var(--font-outfit, "Outfit"), ui-sans-serif, system-ui, sans-serif;
123
+ box-sizing: border-box;
124
+ padding: 0.75rem;
125
+ border: 1px solid var(--ndp-border);
126
+ border-radius: calc(var(--ndp-radius) + 2px);
127
+ background: var(--ndp-bg);
128
+ color: var(--ndp-fg);
129
+ font-family: var(--ndp-font);
130
+ box-shadow:
131
+ 0 10px 30px color-mix(in oklab, #000 12%, transparent),
132
+ 0 1px 2px color-mix(in oklab, #000 6%, transparent);
133
+ animation: itzsa-ndp-in 120ms ease-out;
134
+ }
135
+
136
+ @keyframes itzsa-ndp-in {
137
+ from {
138
+ opacity: 0;
139
+ transform: translateY(-4px);
140
+ }
141
+ to {
142
+ opacity: 1;
143
+ transform: translateY(0);
144
+ }
145
+ }
146
+
147
+ .itzsa-ndp-header {
148
+ display: flex;
149
+ align-items: center;
150
+ justify-content: space-between;
151
+ gap: 0.35rem;
152
+ margin-bottom: 0.65rem;
153
+ }
154
+
155
+ .itzsa-ndp-header-title {
156
+ display: flex;
157
+ flex: 1;
158
+ align-items: center;
159
+ justify-content: center;
160
+ gap: 0.35rem;
161
+ min-width: 0;
162
+ }
163
+
164
+ .itzsa-ndp-title-btn,
165
+ .itzsa-ndp-title-static {
166
+ border: 0;
167
+ background: transparent;
168
+ color: var(--ndp-fg);
169
+ font: inherit;
170
+ font-size: 0.875rem;
171
+ font-weight: 500;
172
+ padding: 0.2rem 0.4rem;
173
+ border-radius: 6px;
174
+ cursor: pointer;
175
+ }
176
+
177
+ .itzsa-ndp-title-btn:hover {
178
+ background: var(--ndp-surface);
179
+ }
180
+
181
+ .itzsa-ndp-title-static {
182
+ cursor: default;
183
+ }
184
+
185
+ .itzsa-ndp-nav-btn {
186
+ display: inline-flex;
187
+ align-items: center;
188
+ justify-content: center;
189
+ width: 1.75rem;
190
+ height: 1.75rem;
191
+ border: 0;
192
+ border-radius: 6px;
193
+ background: transparent;
194
+ color: var(--ndp-muted);
195
+ cursor: pointer;
196
+ }
197
+
198
+ .itzsa-ndp-nav-btn:hover:not(:disabled) {
199
+ color: var(--ndp-fg);
200
+ background: var(--ndp-surface);
201
+ }
202
+
203
+ .itzsa-ndp-nav-btn:disabled {
204
+ opacity: 0.35;
205
+ cursor: not-allowed;
206
+ }
207
+
208
+ .itzsa-ndp-weekdays,
209
+ .itzsa-ndp-days {
210
+ display: grid;
211
+ grid-template-columns: repeat(7, 1fr);
212
+ gap: 0.2rem;
213
+ }
214
+
215
+ .itzsa-ndp-weekday {
216
+ display: flex;
217
+ align-items: center;
218
+ justify-content: center;
219
+ height: 1.75rem;
220
+ font-size: 0.7rem;
221
+ font-weight: 500;
222
+ color: var(--ndp-muted);
223
+ }
224
+
225
+ .itzsa-ndp-day {
226
+ display: flex;
227
+ align-items: center;
228
+ justify-content: center;
229
+ height: 2rem;
230
+ border: 0;
231
+ border-radius: 8px;
232
+ background: transparent;
233
+ color: var(--ndp-fg);
234
+ font: inherit;
235
+ font-size: 0.8125rem;
236
+ cursor: pointer;
237
+ }
238
+
239
+ .itzsa-ndp-day.is-empty {
240
+ pointer-events: none;
241
+ visibility: hidden;
242
+ }
243
+
244
+ .itzsa-ndp-day:hover:not(:disabled):not(.is-selected) {
245
+ background: var(--ndp-surface);
246
+ }
247
+
248
+ .itzsa-ndp-day.is-today:not(.is-selected) {
249
+ box-shadow: inset 0 0 0 1px var(--ndp-accent);
250
+ }
251
+
252
+ .itzsa-ndp-day.is-selected {
253
+ background: var(--ndp-accent);
254
+ color: #fff;
255
+ font-weight: 600;
256
+ }
257
+
258
+ .itzsa-ndp-day.is-disabled,
259
+ .itzsa-ndp-day:disabled {
260
+ opacity: 0.35;
261
+ cursor: not-allowed;
262
+ }
263
+
264
+ .itzsa-ndp-grid-months,
265
+ .itzsa-ndp-year-list {
266
+ display: grid;
267
+ grid-template-columns: repeat(3, 1fr);
268
+ gap: 0.35rem;
269
+ }
270
+
271
+ .itzsa-ndp-grid-years {
272
+ display: flex;
273
+ align-items: flex-start;
274
+ gap: 0.25rem;
275
+ }
276
+
277
+ .itzsa-ndp-year-list {
278
+ flex: 1;
279
+ }
280
+
281
+ .itzsa-ndp-year-shift {
282
+ margin-top: 0.35rem;
283
+ }
284
+
285
+ .itzsa-ndp-chip {
286
+ height: 2.25rem;
287
+ border: 0;
288
+ border-radius: 8px;
289
+ background: var(--ndp-surface);
290
+ color: var(--ndp-fg);
291
+ font: inherit;
292
+ font-size: 0.75rem;
293
+ cursor: pointer;
294
+ }
295
+
296
+ .itzsa-ndp-chip:hover {
297
+ outline: 1px solid var(--ndp-border);
298
+ }
299
+
300
+ .itzsa-ndp-chip.is-active {
301
+ background: var(--ndp-accent);
302
+ color: #fff;
303
+ font-weight: 600;
304
+ }
305
+
306
+ .itzsa-ndp-footer {
307
+ display: flex;
308
+ align-items: center;
309
+ justify-content: space-between;
310
+ gap: 0.5rem;
311
+ margin-top: 0.65rem;
312
+ padding-top: 0.55rem;
313
+ border-top: 1px solid var(--ndp-border);
314
+ }
315
+
316
+ .itzsa-ndp-footer-btn {
317
+ border: 0;
318
+ background: transparent;
319
+ color: var(--ndp-accent);
320
+ font: inherit;
321
+ font-size: 0.8125rem;
322
+ font-weight: 500;
323
+ padding: 0.25rem 0.4rem;
324
+ border-radius: 6px;
325
+ cursor: pointer;
326
+ }
327
+
328
+ .itzsa-ndp-footer-btn:hover:not(:disabled) {
329
+ background: color-mix(in oklab, var(--ndp-accent) 12%, transparent);
330
+ }
331
+
332
+ .itzsa-ndp-footer-btn:disabled {
333
+ opacity: 0.4;
334
+ cursor: not-allowed;
335
+ }
336
+
337
+ .itzsa-ndp-nav-spacer {
338
+ width: 1.75rem;
339
+ height: 1.75rem;
340
+ flex-shrink: 0;
341
+ }
342
+
343
+ .itzsa-ndp-input-editable {
344
+ cursor: text;
345
+ font-variant-numeric: tabular-nums;
346
+ letter-spacing: 0.02em;
347
+ }
348
+
349
+ .itzsa-ndp-day.is-in-range,
350
+ .itzsa-ndp-day.is-range-preview {
351
+ border-radius: 0;
352
+ background: color-mix(in oklab, var(--ndp-accent) 14%, transparent);
353
+ }
354
+
355
+ .itzsa-ndp-day.is-range-start,
356
+ .itzsa-ndp-day.is-range-end,
357
+ .itzsa-ndp-day.is-selected.is-range-start,
358
+ .itzsa-ndp-day.is-selected.is-range-end {
359
+ background: var(--ndp-accent);
360
+ color: #fff;
361
+ font-weight: 600;
362
+ }
363
+
364
+ .itzsa-ndp-day.is-range-start {
365
+ border-radius: 8px 0 0 8px;
366
+ }
367
+
368
+ .itzsa-ndp-day.is-range-end {
369
+ border-radius: 0 8px 8px 0;
370
+ }
371
+
372
+ .itzsa-ndp-day.is-range-start.is-range-end {
373
+ border-radius: 8px;
374
+ }
375
+
376
+ .itzsa-ndp-day.is-in-range:hover:not(:disabled),
377
+ .itzsa-ndp-day.is-range-preview:hover:not(:disabled) {
378
+ background: color-mix(in oklab, var(--ndp-accent) 22%, transparent);
379
+ }
380
+
381
+ .itzsa-ndp-range-trigger {
382
+ box-sizing: border-box;
383
+ display: flex;
384
+ align-items: center;
385
+ gap: 0.5rem;
386
+ width: 100%;
387
+ min-height: 2.5rem;
388
+ padding: 0.5rem 0.75rem;
389
+ border: 1px solid var(--ndp-border);
390
+ border-radius: var(--ndp-radius);
391
+ background: transparent;
392
+ color: var(--ndp-fg);
393
+ font: inherit;
394
+ font-size: 0.875rem;
395
+ text-align: left;
396
+ cursor: pointer;
397
+ transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
398
+ }
399
+
400
+ .itzsa-ndp-range-trigger:hover:not(:disabled) {
401
+ background: color-mix(in oklab, var(--ndp-surface) 80%, transparent);
402
+ }
403
+
404
+ .itzsa-ndp-range-trigger:focus-visible {
405
+ border-color: var(--ndp-accent);
406
+ box-shadow: 0 0 0 3px var(--ndp-ring);
407
+ outline: none;
408
+ }
409
+
410
+ .itzsa-ndp-range-trigger:disabled {
411
+ opacity: 0.5;
412
+ cursor: not-allowed;
413
+ }
414
+
415
+ .itzsa-ndp-range-trigger-icon {
416
+ flex-shrink: 0;
417
+ color: var(--ndp-muted);
418
+ }
419
+
420
+ .itzsa-ndp-range-trigger-label {
421
+ flex: 1;
422
+ min-width: 0;
423
+ overflow: hidden;
424
+ text-overflow: ellipsis;
425
+ white-space: nowrap;
426
+ }
427
+
428
+ .itzsa-ndp-range-trigger-label.is-placeholder {
429
+ color: var(--ndp-muted);
430
+ }
431
+
432
+ .itzsa-ndp-range-trigger-chevron {
433
+ flex-shrink: 0;
434
+ color: var(--ndp-muted);
435
+ opacity: 0.7;
436
+ }
437
+
438
+ .itzsa-ndp-popover-range.is-dual {
439
+ padding: 0.85rem;
440
+ }
441
+
442
+ .itzsa-ndp-range-toolbar {
443
+ display: flex;
444
+ align-items: center;
445
+ justify-content: space-between;
446
+ gap: 0.5rem;
447
+ margin-bottom: 0.5rem;
448
+ }
449
+
450
+ .itzsa-ndp-range-hint {
451
+ margin: 0;
452
+ flex: 1;
453
+ text-align: center;
454
+ font-size: 0.75rem;
455
+ font-weight: 500;
456
+ color: var(--ndp-muted);
457
+ letter-spacing: 0.02em;
458
+ }
459
+
460
+ .itzsa-ndp-range-months {
461
+ display: grid;
462
+ gap: 0.75rem;
463
+ }
464
+
465
+ .itzsa-ndp-range-months.is-dual {
466
+ grid-template-columns: 1fr 1fr;
467
+ gap: 1rem;
468
+ }
469
+
470
+ @media (max-width: 640px) {
471
+ .itzsa-ndp-range-months.is-dual {
472
+ grid-template-columns: 1fr;
473
+ }
474
+
475
+ .itzsa-ndp-popover-range.is-dual {
476
+ width: min(320px, calc(100vw - 16px)) !important;
477
+ }
478
+ }
479
+
480
+ .itzsa-ndp-range-footer {
481
+ align-items: center;
482
+ }
483
+
484
+ .itzsa-ndp-range-meta {
485
+ margin: 0;
486
+ font-size: 0.75rem;
487
+ color: var(--ndp-muted);
488
+ }
489
+
490
+ .itzsa-ndp-range-actions {
491
+ display: flex;
492
+ align-items: center;
493
+ gap: 0.25rem;
494
+ }
495
+
496
+ .itzsa-ndp-footer-btn.is-primary {
497
+ background: var(--ndp-accent);
498
+ color: #fff;
499
+ padding: 0.35rem 0.7rem;
500
+ }
501
+
502
+ .itzsa-ndp-footer-btn.is-primary:hover:not(:disabled) {
503
+ background: color-mix(in oklab, var(--ndp-accent) 88%, #000);
504
+ }
505
+
506
+ .itzsa-ndp-month + .itzsa-ndp-month {
507
+ border-left: 1px solid var(--ndp-border);
508
+ padding-left: 1rem;
509
+ }
510
+
511
+ @media (max-width: 640px) {
512
+ .itzsa-ndp-month + .itzsa-ndp-month {
513
+ border-left: 0;
514
+ border-top: 1px solid var(--ndp-border);
515
+ padding-left: 0;
516
+ padding-top: 0.75rem;
517
+ }
518
+ }
519
+
520
+ /* Date + time */
521
+ .itzsa-ndp-datetime-layout {
522
+ display: flex;
523
+ flex-direction: column;
524
+ gap: 0.75rem;
525
+ }
526
+
527
+ @media (min-width: 420px) {
528
+ .itzsa-ndp-datetime-layout {
529
+ flex-direction: row;
530
+ align-items: stretch;
531
+ gap: 0.85rem;
532
+ }
533
+
534
+ .itzsa-ndp-datetime-layout .itzsa-ndp-panel {
535
+ flex: 1;
536
+ min-width: 0;
537
+ }
538
+
539
+ .itzsa-ndp-time-panel {
540
+ width: 7.5rem;
541
+ flex-shrink: 0;
542
+ border-left: 1px solid var(--ndp-border);
543
+ padding-left: 0.75rem;
544
+ }
545
+ }
546
+
547
+ .itzsa-ndp-time-heading {
548
+ margin: 0 0 0.45rem;
549
+ font-size: 0.75rem;
550
+ font-weight: 500;
551
+ color: var(--ndp-muted);
552
+ letter-spacing: 0.02em;
553
+ }
554
+
555
+ .itzsa-ndp-time-cols {
556
+ display: flex;
557
+ gap: 0.35rem;
558
+ justify-content: center;
559
+ }
560
+
561
+ .itzsa-ndp-time-col {
562
+ flex: 1;
563
+ min-width: 0;
564
+ display: flex;
565
+ flex-direction: column;
566
+ gap: 0.25rem;
567
+ }
568
+
569
+ .itzsa-ndp-time-col-label {
570
+ margin: 0;
571
+ text-align: center;
572
+ font-size: 0.65rem;
573
+ font-weight: 500;
574
+ color: var(--ndp-muted);
575
+ }
576
+
577
+ .itzsa-ndp-time-list {
578
+ height: 11.5rem;
579
+ overflow-y: auto;
580
+ border: 1px solid var(--ndp-border);
581
+ border-radius: 8px;
582
+ background: var(--ndp-surface);
583
+ scrollbar-width: thin;
584
+ }
585
+
586
+ .itzsa-ndp-time-item {
587
+ display: flex;
588
+ width: 100%;
589
+ align-items: center;
590
+ justify-content: center;
591
+ height: 1.85rem;
592
+ border: 0;
593
+ background: transparent;
594
+ color: var(--ndp-fg);
595
+ font: inherit;
596
+ font-size: 0.8125rem;
597
+ font-variant-numeric: tabular-nums;
598
+ cursor: pointer;
599
+ }
600
+
601
+ .itzsa-ndp-time-item:hover:not(:disabled):not(.is-selected) {
602
+ background: color-mix(in oklab, var(--ndp-accent) 10%, transparent);
603
+ }
604
+
605
+ .itzsa-ndp-time-item.is-selected {
606
+ background: var(--ndp-accent);
607
+ color: #fff;
608
+ font-weight: 600;
609
+ }
610
+
611
+ .itzsa-ndp-time-item:disabled,
612
+ .itzsa-ndp-time-item.is-disabled {
613
+ opacity: 0.3;
614
+ cursor: not-allowed;
615
+ }
616
+
617
+ .itzsa-ndp-popover-datetime .itzsa-ndp-footer {
618
+ margin-top: 0.75rem;
619
+ }