mithril-materialized 3.2.1 → 3.3.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.
package/dist/index.css CHANGED
@@ -41,6 +41,7 @@
41
41
  --mm-switch-unchecked-thumb: #f5f5f5;
42
42
  --mm-switch-disabled-track: rgba(0, 0, 0, 0.12);
43
43
  --mm-switch-disabled-thumb: #bdbdbd;
44
+ --mm-table-striped-color: rgba(0, 0, 0, 0.05);
44
45
  }
45
46
 
46
47
  body {
@@ -96,6 +97,7 @@ body {
96
97
  --mm-switch-unchecked-thumb: #616161;
97
98
  --mm-switch-disabled-track: rgba(255, 255, 255, 0.12);
98
99
  --mm-switch-disabled-thumb: #424242;
100
+ --mm-table-striped-color: rgba(255, 255, 255, 0.05);
99
101
  }
100
102
 
101
103
  @media (prefers-color-scheme: dark) {
@@ -137,6 +139,7 @@ body {
137
139
  --mm-switch-unchecked-thumb: #616161;
138
140
  --mm-switch-disabled-track: rgba(255, 255, 255, 0.12);
139
141
  --mm-switch-disabled-thumb: #424242;
142
+ --mm-table-striped-color: rgba(255, 255, 255, 0.05);
140
143
  }
141
144
  }
142
145
  .materialize-red {
@@ -3027,7 +3030,7 @@ table.striped tr {
3027
3030
  border-bottom: none;
3028
3031
  }
3029
3032
  table.striped > tbody > tr:nth-child(odd) {
3030
- background-color: rgba(242, 242, 242, 0.5);
3033
+ background-color: var(--mm-table-striped-color, rgba(55, 55, 55, 0.5));
3031
3034
  }
3032
3035
  table.striped > tbody > tr > td {
3033
3036
  border-radius: 0;
@@ -3036,7 +3039,7 @@ table.highlight > tbody > tr {
3036
3039
  transition: background-color 0.25s ease;
3037
3040
  }
3038
3041
  table.highlight > tbody > tr:hover {
3039
- background-color: rgba(242, 242, 242, 0.5);
3042
+ background-color: var(--mm-table-striped-color, rgba(55, 55, 55, 0.5));
3040
3043
  }
3041
3044
  table.centered thead tr th, table.centered tbody tr td {
3042
3045
  text-align: center;
@@ -6325,6 +6328,9 @@ textarea.materialize-textarea {
6325
6328
  /* Character Counter */
6326
6329
  .character-counter {
6327
6330
  min-height: 18px;
6331
+ font-size: 12px;
6332
+ display: block;
6333
+ text-align: right;
6328
6334
  }
6329
6335
 
6330
6336
  /* Input Clear Button */
@@ -10106,7 +10112,7 @@ nav .theme-toggle:focus {
10106
10112
  }
10107
10113
  :root:not([data-theme]) .datatable-container .datatable.striped tbody tr:nth-child(odd),
10108
10114
  [data-theme=dark] .datatable-container .datatable.striped tbody tr:nth-child(odd) {
10109
- background-color: rgba(255, 255, 255, 0.05);
10115
+ background-color: var(--mm-table-striped-color, rgba(55, 55, 55, 0.5));
10110
10116
  }
10111
10117
  :root:not([data-theme]) .datatable-container .datatable.fixed-header thead th,
10112
10118
  [data-theme=dark] .datatable-container .datatable.fixed-header thead th {
@@ -11350,4 +11356,239 @@ body.dark {
11350
11356
  background: #f5f5f5;
11351
11357
  color: black;
11352
11358
  }
11359
+ }
11360
+ /* Rating Component
11361
+ ========================================================================== */
11362
+ .rating {
11363
+ position: relative;
11364
+ display: inline-flex;
11365
+ align-items: center;
11366
+ outline: none;
11367
+ cursor: pointer;
11368
+ transition: all 0.2s ease;
11369
+ }
11370
+ .rating:focus-visible {
11371
+ outline: 2px solid var(--mm-primary-color, #ee6e73);
11372
+ outline-offset: 2px;
11373
+ border-radius: 4px;
11374
+ }
11375
+ .rating--read-only {
11376
+ cursor: default;
11377
+ }
11378
+ .rating--read-only .rating__item {
11379
+ cursor: default;
11380
+ }
11381
+ .rating--disabled {
11382
+ cursor: not-allowed;
11383
+ opacity: 0.6;
11384
+ }
11385
+ .rating--disabled .rating__item {
11386
+ cursor: not-allowed;
11387
+ }
11388
+ .rating--focused:not(.rating--read-only):not(.rating--disabled) .rating__items {
11389
+ transform: scale(1.05);
11390
+ }
11391
+
11392
+ .rating__items {
11393
+ display: flex !important;
11394
+ flex-direction: row !important;
11395
+ align-items: center;
11396
+ transition: transform 0.15s ease;
11397
+ }
11398
+
11399
+ .rating__item {
11400
+ display: flex;
11401
+ flex-direction: row;
11402
+ align-items: center;
11403
+ }
11404
+ .rating__item > .rating__item {
11405
+ display: flex;
11406
+ }
11407
+ .rating__item:hover:not(.rating__item--disabled) {
11408
+ transform: scale(1.1);
11409
+ }
11410
+ .rating__item--filled .rating__icon--filled {
11411
+ color: var(--mm-primary-color, #ee6e73);
11412
+ }
11413
+ .rating__item--active .rating__icon--filled {
11414
+ color: var(--mm-primary-color, #ee6e73);
11415
+ }
11416
+ .rating__item--preview .rating__icon--filled {
11417
+ color: var(--mm-secondary-color, #26a69a);
11418
+ }
11419
+ .rating__item--half .rating__icon--filled {
11420
+ color: var(--mm-primary-color, #ee6e73);
11421
+ }
11422
+ .rating__item--disabled {
11423
+ cursor: not-allowed;
11424
+ opacity: 0.6;
11425
+ }
11426
+ .rating__item--disabled .rating__icon--empty {
11427
+ color: var(--mm-text-disabled, rgba(0, 0, 0, 0.38));
11428
+ }
11429
+ .rating__item--disabled.rating__item--filled .rating__icon--filled, .rating__item--disabled.rating__item--active .rating__icon--filled {
11430
+ color: var(--mm-primary-color, #ee6e73);
11431
+ opacity: 0.7;
11432
+ }
11433
+
11434
+ .rating__icon {
11435
+ position: relative;
11436
+ display: flex;
11437
+ align-items: center;
11438
+ justify-content: center;
11439
+ transition: color 0.15s ease;
11440
+ line-height: 1;
11441
+ width: 24px;
11442
+ height: 24px;
11443
+ font-size: 24px;
11444
+ }
11445
+ .rating__icon--empty {
11446
+ color: var(--mm-text-hint, #9e9e9e);
11447
+ }
11448
+ .rating__icon--filled {
11449
+ position: absolute;
11450
+ top: 0;
11451
+ width: 100%;
11452
+ height: 100%;
11453
+ display: flex;
11454
+ align-items: center;
11455
+ justify-content: center;
11456
+ color: transparent;
11457
+ overflow: hidden;
11458
+ transition: color 0.15s ease;
11459
+ }
11460
+
11461
+ .rating--small .rating__icon {
11462
+ width: 16px;
11463
+ height: 16px;
11464
+ font-size: 16px;
11465
+ }
11466
+
11467
+ .rating--medium .rating__icon {
11468
+ width: 24px;
11469
+ height: 24px;
11470
+ font-size: 24px;
11471
+ }
11472
+
11473
+ .rating--large .rating__icon {
11474
+ width: 32px;
11475
+ height: 32px;
11476
+ font-size: 32px;
11477
+ }
11478
+
11479
+ .rating--compact .rating__items {
11480
+ gap: 2px;
11481
+ }
11482
+
11483
+ .rating--standard .rating__items {
11484
+ gap: 4px;
11485
+ }
11486
+
11487
+ .rating--comfortable .rating__items {
11488
+ gap: 8px;
11489
+ }
11490
+
11491
+ .rating__tooltip {
11492
+ position: absolute;
11493
+ bottom: calc(100% + 8px);
11494
+ left: 50%;
11495
+ transform: translateX(-50%);
11496
+ padding: 4px 8px;
11497
+ background: rgba(0, 0, 0, 0.8);
11498
+ color: white;
11499
+ font-size: 12px;
11500
+ border-radius: 4px;
11501
+ white-space: nowrap;
11502
+ opacity: 0;
11503
+ pointer-events: none;
11504
+ transition: opacity 0.2s ease;
11505
+ z-index: 1000;
11506
+ }
11507
+ .rating__tooltip::after {
11508
+ content: "";
11509
+ position: absolute;
11510
+ top: 100%;
11511
+ left: 50%;
11512
+ transform: translateX(-50%);
11513
+ border: 4px solid transparent;
11514
+ border-top-color: rgba(0, 0, 0, 0.8);
11515
+ }
11516
+
11517
+ .rating__item:hover .rating__tooltip {
11518
+ opacity: 1;
11519
+ }
11520
+
11521
+ .rating__sr-only {
11522
+ position: absolute;
11523
+ width: 1px;
11524
+ height: 1px;
11525
+ padding: 0;
11526
+ margin: -1px;
11527
+ overflow: hidden;
11528
+ clip: rect(0, 0, 0, 0);
11529
+ white-space: nowrap;
11530
+ border: 0;
11531
+ }
11532
+
11533
+ @media (pointer: coarse) {
11534
+ .rating__item {
11535
+ min-width: 48px;
11536
+ min-height: 48px;
11537
+ }
11538
+ }
11539
+ [dir=rtl] .rating__tooltip::after {
11540
+ transform: translateX(50%);
11541
+ }
11542
+ [dir=rtl] .rating__item--half .rating__icon--filled {
11543
+ clip-path: inset(0 0 0 50%) !important;
11544
+ }
11545
+
11546
+ @media (prefers-contrast: high) {
11547
+ .rating__icon--empty {
11548
+ color: currentColor;
11549
+ }
11550
+ .rating__item--active .rating__icon--filled {
11551
+ color: currentColor;
11552
+ }
11553
+ }
11554
+ [data-theme=dark] .rating__tooltip {
11555
+ background: rgba(255, 255, 255, 0.9);
11556
+ color: rgba(0, 0, 0, 0.87);
11557
+ }
11558
+ [data-theme=dark] .rating__tooltip::after {
11559
+ border-top-color: rgba(255, 255, 255, 0.9);
11560
+ }
11561
+
11562
+ @keyframes rating-fill {
11563
+ 0% {
11564
+ transform: scale(0.8);
11565
+ opacity: 0.5;
11566
+ }
11567
+ 50% {
11568
+ transform: scale(1.2);
11569
+ }
11570
+ 100% {
11571
+ transform: scale(1);
11572
+ opacity: 1;
11573
+ }
11574
+ }
11575
+ .rating__item--filled .rating__icon--filled {
11576
+ animation: rating-fill 0.2s ease-out;
11577
+ }
11578
+
11579
+ @media (prefers-reduced-motion: reduce) {
11580
+ .rating,
11581
+ .rating__item,
11582
+ .rating__icon,
11583
+ .rating__tooltip,
11584
+ .rating__items {
11585
+ transition: none !important;
11586
+ animation: none !important;
11587
+ }
11588
+ .rating__item:hover:not(.rating__item--disabled) {
11589
+ transform: none;
11590
+ }
11591
+ .rating--focused:not(.rating--read-only):not(.rating--disabled) .rating__items {
11592
+ transform: none;
11593
+ }
11353
11594
  }
package/dist/index.d.ts CHANGED
@@ -42,4 +42,5 @@ export * from './treeview';
42
42
  export * from './timeline';
43
43
  export * from './masonry';
44
44
  export * from './image-list';
45
+ export * from './rating';
45
46
  export * from './types';