mithril-materialized 3.8.0 → 3.9.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.
@@ -0,0 +1,43 @@
1
+ import { FactoryComponent, Attributes } from 'mithril';
2
+ import { MaterialColor, ColorIntensity } from './types';
3
+ /** Progress mode - determinate shows specific progress, indeterminate shows loading animation */
4
+ export type ProgressMode = 'determinate' | 'indeterminate';
5
+ /** Progress size options */
6
+ export type ProgressSize = 'small' | 'medium' | 'large';
7
+ /** CircularProgress component attributes */
8
+ export interface CircularProgressAttrs extends Attributes {
9
+ /** Progress mode (default: 'indeterminate') */
10
+ mode?: ProgressMode;
11
+ /** Current progress value (0-100) for determinate mode */
12
+ value?: number;
13
+ /** Maximum progress value (default: 100) */
14
+ max?: number;
15
+ /** Size variant (default: 'medium') */
16
+ size?: ProgressSize;
17
+ /** Materialize color (default: 'teal') */
18
+ color?: MaterialColor;
19
+ /** Color intensity modifier */
20
+ colorIntensity?: ColorIntensity;
21
+ /** Label to display inside the circle */
22
+ label?: string | number;
23
+ /** Auto-show percentage inside circle for determinate mode (default: false) */
24
+ showPercentage?: boolean;
25
+ /** Additional CSS class names */
26
+ className?: string;
27
+ /** Additional CSS styles */
28
+ style?: any;
29
+ /** HTML ID for the component */
30
+ id?: string;
31
+ /** ARIA label for accessibility */
32
+ 'aria-label'?: string;
33
+ /** ARIA valuemin (default: 0) */
34
+ 'aria-valuemin'?: number;
35
+ /** ARIA valuemax (default: 100) */
36
+ 'aria-valuemax'?: number;
37
+ /** ARIA valuenow (current value) */
38
+ 'aria-valuenow'?: number;
39
+ /** ARIA valuetext (custom text description) */
40
+ 'aria-valuetext'?: string;
41
+ }
42
+ /** Create a CircularProgress component */
43
+ export declare const CircularProgress: FactoryComponent<CircularProgressAttrs>;
package/dist/index.css CHANGED
@@ -12043,4 +12043,479 @@ body.dark {
12043
12043
  [data-theme=dark] .toggle-group .toggle-button.checked {
12044
12044
  background-color: var(--mm-primary-color, #80cbc4);
12045
12045
  color: var(--mm-button-text, #000);
12046
+ }
12047
+
12048
+ /* CircularProgress Component
12049
+ ========================================================================== */
12050
+ .circular-progress {
12051
+ position: relative;
12052
+ display: inline-flex;
12053
+ align-items: center;
12054
+ justify-content: center;
12055
+ color: var(--mm-primary-color, #ee6e73);
12056
+ }
12057
+ .circular-progress--small {
12058
+ width: 36px;
12059
+ height: 36px;
12060
+ }
12061
+ .circular-progress--small .circular-progress__label {
12062
+ font-size: 10px;
12063
+ }
12064
+ .circular-progress--medium {
12065
+ width: 50px;
12066
+ height: 50px;
12067
+ }
12068
+ .circular-progress--medium .circular-progress__label {
12069
+ font-size: 12px;
12070
+ }
12071
+ .circular-progress--large {
12072
+ width: 64px;
12073
+ height: 64px;
12074
+ }
12075
+ .circular-progress--large .circular-progress__label {
12076
+ font-size: 14px;
12077
+ }
12078
+
12079
+ .circular-progress__svg {
12080
+ width: 100%;
12081
+ height: 100%;
12082
+ transform: rotate(-90deg);
12083
+ transform-origin: center;
12084
+ }
12085
+
12086
+ .circular-progress__circle {
12087
+ transition: stroke-dashoffset 0.3s cubic-bezier(0.4, 0, 0.2, 1);
12088
+ }
12089
+ .circular-progress__circle--track {
12090
+ opacity: 0.2;
12091
+ }
12092
+ .circular-progress__circle--indicator {
12093
+ opacity: 1;
12094
+ }
12095
+
12096
+ .circular-progress__label {
12097
+ position: absolute;
12098
+ top: 50%;
12099
+ left: 50%;
12100
+ transform: translate(-50%, -50%);
12101
+ font-weight: 500;
12102
+ text-align: center;
12103
+ line-height: 1;
12104
+ color: currentColor;
12105
+ -webkit-user-select: none;
12106
+ -moz-user-select: none;
12107
+ user-select: none;
12108
+ }
12109
+
12110
+ .circular-progress--indeterminate .circular-progress__svg {
12111
+ animation: circular-rotate 2s linear infinite;
12112
+ }
12113
+ .circular-progress--indeterminate .circular-progress__circle--indicator {
12114
+ stroke-dasharray: 80, 200;
12115
+ stroke-dashoffset: 0;
12116
+ animation: circular-dash 1.5s ease-in-out infinite;
12117
+ }
12118
+
12119
+ .circular-progress--determinate .circular-progress__circle--indicator {
12120
+ transition: stroke-dashoffset 0.3s cubic-bezier(0.4, 0, 0.2, 1);
12121
+ }
12122
+
12123
+ .circular-progress--red {
12124
+ color: #F44336;
12125
+ }
12126
+
12127
+ .circular-progress--pink {
12128
+ color: #e91e63;
12129
+ }
12130
+
12131
+ .circular-progress--purple {
12132
+ color: #9c27b0;
12133
+ }
12134
+
12135
+ .circular-progress--deep-purple {
12136
+ color: #673ab7;
12137
+ }
12138
+
12139
+ .circular-progress--indigo {
12140
+ color: #3f51b5;
12141
+ }
12142
+
12143
+ .circular-progress--blue {
12144
+ color: #2196F3;
12145
+ }
12146
+
12147
+ .circular-progress--light-blue {
12148
+ color: #03a9f4;
12149
+ }
12150
+
12151
+ .circular-progress--cyan {
12152
+ color: #00bcd4;
12153
+ }
12154
+
12155
+ .circular-progress--teal {
12156
+ color: #009688;
12157
+ }
12158
+
12159
+ .circular-progress--green {
12160
+ color: #4CAF50;
12161
+ }
12162
+
12163
+ .circular-progress--light-green {
12164
+ color: #8bc34a;
12165
+ }
12166
+
12167
+ .circular-progress--lime {
12168
+ color: #cddc39;
12169
+ }
12170
+
12171
+ .circular-progress--yellow {
12172
+ color: #ffeb3b;
12173
+ }
12174
+
12175
+ .circular-progress--amber {
12176
+ color: #ffc107;
12177
+ }
12178
+
12179
+ .circular-progress--orange {
12180
+ color: #ff9800;
12181
+ }
12182
+
12183
+ .circular-progress--deep-orange {
12184
+ color: #ff5722;
12185
+ }
12186
+
12187
+ .circular-progress--brown {
12188
+ color: #795548;
12189
+ }
12190
+
12191
+ .circular-progress--grey {
12192
+ color: #9e9e9e;
12193
+ }
12194
+
12195
+ .circular-progress--blue-grey {
12196
+ color: #607d8b;
12197
+ }
12198
+
12199
+ .circular-progress--lighten-5 {
12200
+ filter: brightness(1.4);
12201
+ }
12202
+
12203
+ .circular-progress--lighten-4 {
12204
+ filter: brightness(1.3);
12205
+ }
12206
+
12207
+ .circular-progress--lighten-3 {
12208
+ filter: brightness(1.2);
12209
+ }
12210
+
12211
+ .circular-progress--lighten-2 {
12212
+ filter: brightness(1.1);
12213
+ }
12214
+
12215
+ .circular-progress--lighten-1 {
12216
+ filter: brightness(1.05);
12217
+ }
12218
+
12219
+ .circular-progress--darken-1 {
12220
+ filter: brightness(0.95);
12221
+ }
12222
+
12223
+ .circular-progress--darken-2 {
12224
+ filter: brightness(0.9);
12225
+ }
12226
+
12227
+ .circular-progress--darken-3 {
12228
+ filter: brightness(0.8);
12229
+ }
12230
+
12231
+ .circular-progress--darken-4 {
12232
+ filter: brightness(0.7);
12233
+ }
12234
+
12235
+ @keyframes circular-rotate {
12236
+ 0% {
12237
+ transform: rotate(-90deg);
12238
+ }
12239
+ 100% {
12240
+ transform: rotate(270deg);
12241
+ }
12242
+ }
12243
+ @keyframes circular-dash {
12244
+ 0% {
12245
+ stroke-dasharray: 1, 200;
12246
+ stroke-dashoffset: 0;
12247
+ }
12248
+ 50% {
12249
+ stroke-dasharray: 100, 200;
12250
+ stroke-dashoffset: -15;
12251
+ }
12252
+ 100% {
12253
+ stroke-dasharray: 100, 200;
12254
+ stroke-dashoffset: -125;
12255
+ }
12256
+ }
12257
+ [data-theme=dark] .circular-progress .circular-progress__circle--track {
12258
+ opacity: 0.15;
12259
+ }
12260
+
12261
+ [dir=rtl] .circular-progress__svg {
12262
+ transform: rotate(90deg);
12263
+ }
12264
+ [dir=rtl] .circular-progress--indeterminate .circular-progress__svg {
12265
+ animation: circular-rotate-rtl 2s linear infinite;
12266
+ }
12267
+ @keyframes circular-rotate-rtl {
12268
+ 0% {
12269
+ transform: rotate(90deg);
12270
+ }
12271
+ 100% {
12272
+ transform: rotate(-270deg);
12273
+ }
12274
+ }
12275
+
12276
+ @media (prefers-reduced-motion: reduce) {
12277
+ .circular-progress__circle,
12278
+ .circular-progress__svg {
12279
+ transition: none !important;
12280
+ animation: none !important;
12281
+ }
12282
+ .circular-progress--indeterminate .circular-progress__svg {
12283
+ animation: none;
12284
+ }
12285
+ .circular-progress--indeterminate .circular-progress__circle--indicator {
12286
+ animation: none;
12287
+ stroke-dasharray: 100, 200;
12288
+ stroke-dashoffset: -50;
12289
+ }
12290
+ }
12291
+ @media (prefers-contrast: high) {
12292
+ .circular-progress__circle--track {
12293
+ opacity: 0.4;
12294
+ }
12295
+ }
12296
+ /* LinearProgress Component
12297
+ ========================================================================== */
12298
+ .linear-progress {
12299
+ display: flex;
12300
+ align-items: center;
12301
+ gap: 12px;
12302
+ width: 100%;
12303
+ color: var(--mm-primary-color, #ee6e73);
12304
+ }
12305
+
12306
+ .linear-progress__track {
12307
+ position: relative;
12308
+ flex: 1;
12309
+ background-color: rgba(0, 0, 0, 0.1);
12310
+ border-radius: 2px;
12311
+ overflow: hidden;
12312
+ }
12313
+ .linear-progress__track--small {
12314
+ height: 4px;
12315
+ }
12316
+ .linear-progress__track--medium {
12317
+ height: 8px;
12318
+ }
12319
+ .linear-progress__track--large {
12320
+ height: 12px;
12321
+ }
12322
+
12323
+ .linear-progress__bar {
12324
+ position: absolute;
12325
+ top: 0;
12326
+ left: 0;
12327
+ bottom: 0;
12328
+ background-color: currentColor;
12329
+ transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
12330
+ border-radius: 2px;
12331
+ }
12332
+ .linear-progress__bar--indeterminate {
12333
+ width: 30%;
12334
+ animation: linear-indeterminate 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
12335
+ }
12336
+
12337
+ .linear-progress__label {
12338
+ flex-shrink: 0;
12339
+ font-size: 0.875rem;
12340
+ font-weight: 500;
12341
+ white-space: nowrap;
12342
+ color: currentColor;
12343
+ -webkit-user-select: none;
12344
+ -moz-user-select: none;
12345
+ user-select: none;
12346
+ min-width: 40px;
12347
+ text-align: right;
12348
+ }
12349
+
12350
+ .linear-progress--red {
12351
+ color: #F44336;
12352
+ }
12353
+
12354
+ .linear-progress--pink {
12355
+ color: #e91e63;
12356
+ }
12357
+
12358
+ .linear-progress--purple {
12359
+ color: #9c27b0;
12360
+ }
12361
+
12362
+ .linear-progress--deep-purple {
12363
+ color: #673ab7;
12364
+ }
12365
+
12366
+ .linear-progress--indigo {
12367
+ color: #3f51b5;
12368
+ }
12369
+
12370
+ .linear-progress--blue {
12371
+ color: #2196F3;
12372
+ }
12373
+
12374
+ .linear-progress--light-blue {
12375
+ color: #03a9f4;
12376
+ }
12377
+
12378
+ .linear-progress--cyan {
12379
+ color: #00bcd4;
12380
+ }
12381
+
12382
+ .linear-progress--teal {
12383
+ color: #009688;
12384
+ }
12385
+
12386
+ .linear-progress--green {
12387
+ color: #4CAF50;
12388
+ }
12389
+
12390
+ .linear-progress--light-green {
12391
+ color: #8bc34a;
12392
+ }
12393
+
12394
+ .linear-progress--lime {
12395
+ color: #cddc39;
12396
+ }
12397
+
12398
+ .linear-progress--yellow {
12399
+ color: #ffeb3b;
12400
+ }
12401
+
12402
+ .linear-progress--amber {
12403
+ color: #ffc107;
12404
+ }
12405
+
12406
+ .linear-progress--orange {
12407
+ color: #ff9800;
12408
+ }
12409
+
12410
+ .linear-progress--deep-orange {
12411
+ color: #ff5722;
12412
+ }
12413
+
12414
+ .linear-progress--brown {
12415
+ color: #795548;
12416
+ }
12417
+
12418
+ .linear-progress--grey {
12419
+ color: #9e9e9e;
12420
+ }
12421
+
12422
+ .linear-progress--blue-grey {
12423
+ color: #607d8b;
12424
+ }
12425
+
12426
+ .linear-progress--lighten-5 {
12427
+ filter: brightness(1.4);
12428
+ }
12429
+
12430
+ .linear-progress--lighten-4 {
12431
+ filter: brightness(1.3);
12432
+ }
12433
+
12434
+ .linear-progress--lighten-3 {
12435
+ filter: brightness(1.2);
12436
+ }
12437
+
12438
+ .linear-progress--lighten-2 {
12439
+ filter: brightness(1.1);
12440
+ }
12441
+
12442
+ .linear-progress--lighten-1 {
12443
+ filter: brightness(1.05);
12444
+ }
12445
+
12446
+ .linear-progress--darken-1 {
12447
+ filter: brightness(0.95);
12448
+ }
12449
+
12450
+ .linear-progress--darken-2 {
12451
+ filter: brightness(0.9);
12452
+ }
12453
+
12454
+ .linear-progress--darken-3 {
12455
+ filter: brightness(0.8);
12456
+ }
12457
+
12458
+ .linear-progress--darken-4 {
12459
+ filter: brightness(0.7);
12460
+ }
12461
+
12462
+ @keyframes linear-indeterminate {
12463
+ 0% {
12464
+ left: -35%;
12465
+ right: 100%;
12466
+ }
12467
+ 60% {
12468
+ left: 100%;
12469
+ right: -90%;
12470
+ }
12471
+ 100% {
12472
+ left: 100%;
12473
+ right: -90%;
12474
+ }
12475
+ }
12476
+ [data-theme=dark] .linear-progress__track {
12477
+ background-color: rgba(255, 255, 255, 0.15);
12478
+ }
12479
+
12480
+ [dir=rtl] .linear-progress__label {
12481
+ text-align: left;
12482
+ }
12483
+ [dir=rtl] .linear-progress__bar--indeterminate {
12484
+ animation: linear-indeterminate-rtl 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
12485
+ }
12486
+ @keyframes linear-indeterminate-rtl {
12487
+ 0% {
12488
+ right: -35%;
12489
+ left: 100%;
12490
+ }
12491
+ 60% {
12492
+ right: 100%;
12493
+ left: -90%;
12494
+ }
12495
+ 100% {
12496
+ right: 100%;
12497
+ left: -90%;
12498
+ }
12499
+ }
12500
+
12501
+ @media (prefers-reduced-motion: reduce) {
12502
+ .linear-progress__bar {
12503
+ transition: none !important;
12504
+ animation: none !important;
12505
+ }
12506
+ .linear-progress__bar--indeterminate {
12507
+ animation: none;
12508
+ width: 100%;
12509
+ left: 0;
12510
+ opacity: 0.5;
12511
+ }
12512
+ }
12513
+ @media (prefers-contrast: high) {
12514
+ .linear-progress__track {
12515
+ background-color: rgba(0, 0, 0, 0.3);
12516
+ border: 1px solid currentColor;
12517
+ }
12518
+ [data-theme=dark] .linear-progress__track {
12519
+ background-color: rgba(255, 255, 255, 0.3);
12520
+ }
12046
12521
  }
package/dist/index.d.ts CHANGED
@@ -49,4 +49,6 @@ export * from './masonry';
49
49
  export * from './image-list';
50
50
  export * from './rating';
51
51
  export * from './toggle-group';
52
+ export * from './circular-progress';
53
+ export * from './linear-progress';
52
54
  export * from './types';