mithril-materialized 3.15.0 → 3.17.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 (47) hide show
  1. package/README.md +32 -2
  2. package/dist/advanced.css +109 -4
  3. package/dist/button.d.ts +3 -1
  4. package/dist/circular-progress.d.ts +2 -2
  5. package/dist/combobox.d.ts +35 -0
  6. package/dist/components.css +144 -17
  7. package/dist/core.css +278 -3
  8. package/dist/floating-action-button.d.ts +2 -1
  9. package/dist/form-section.d.ts +35 -0
  10. package/dist/forms.css +280 -5
  11. package/dist/index.css +357 -22
  12. package/dist/index.d.ts +3 -2
  13. package/dist/index.esm.js +728 -299
  14. package/dist/index.esm.js.map +1 -0
  15. package/dist/index.js +741 -298
  16. package/dist/index.js.map +1 -0
  17. package/dist/index.min.css +2 -2
  18. package/dist/index.umd.js +741 -298
  19. package/dist/index.umd.js.map +1 -0
  20. package/dist/input-options.d.ts +4 -1
  21. package/dist/likert-scale.d.ts +2 -1
  22. package/dist/linear-progress.d.ts +2 -2
  23. package/dist/material-icon.d.ts +2 -1
  24. package/dist/radio.d.ts +9 -0
  25. package/dist/range-slider.d.ts +3 -2
  26. package/dist/rating.d.ts +2 -1
  27. package/dist/search-select.d.ts +15 -2
  28. package/dist/select.d.ts +14 -1
  29. package/dist/sidenav.d.ts +11 -1
  30. package/dist/treeview.d.ts +2 -2
  31. package/dist/types.d.ts +5 -0
  32. package/dist/utilities.css +93 -2
  33. package/dist/utils.d.ts +30 -1
  34. package/package.json +20 -20
  35. package/sass/components/_badge-component.scss +8 -0
  36. package/sass/components/_buttons.scss +9 -9
  37. package/sass/components/_global.scss +93 -0
  38. package/sass/components/_likert-scale.scss +24 -0
  39. package/sass/components/_sidenav.scss +21 -3
  40. package/sass/components/_theme-variables.scss +22 -1
  41. package/sass/components/_toggle-group.scss +3 -0
  42. package/sass/components/forms/_form-groups.scss +1 -1
  43. package/sass/components/forms/_form-section.scss +63 -0
  44. package/sass/components/forms/_forms.scss +1 -0
  45. package/sass/components/forms/_input-fields.scss +55 -0
  46. package/sass/components/forms/_range-enhanced.scss +3 -3
  47. package/sass/components/forms/_select.scss +85 -0
package/dist/core.css CHANGED
@@ -400,6 +400,31 @@ html {
400
400
  box-sizing: border-box;
401
401
  }
402
402
 
403
+ /* Default themed scrollbar styling for all scroll containers */
404
+ * {
405
+ scrollbar-width: thin;
406
+ scrollbar-color: var(--mm-scrollbar-thumb-color, rgba(128, 128, 128, 0.35)) var(--mm-scrollbar-track-color, transparent);
407
+ }
408
+
409
+ *::-webkit-scrollbar {
410
+ width: 10px;
411
+ height: 10px;
412
+ }
413
+
414
+ *::-webkit-scrollbar-track {
415
+ background: var(--mm-scrollbar-track-color, transparent);
416
+ }
417
+
418
+ *::-webkit-scrollbar-thumb {
419
+ background-color: var(--mm-scrollbar-thumb-color, rgba(128, 128, 128, 0.35));
420
+ border-radius: 8px;
421
+ border: 2px solid var(--mm-scrollbar-track-color, transparent);
422
+ }
423
+
424
+ *::-webkit-scrollbar-thumb:hover {
425
+ background-color: var(--mm-scrollbar-thumb-hover-color, rgba(128, 128, 128, 0.5));
426
+ }
427
+
403
428
  *, *:before, *:after {
404
429
  box-sizing: inherit;
405
430
  }
@@ -892,7 +917,7 @@ td, th {
892
917
  }
893
918
  .collection .collection-item.active {
894
919
  background-color: #26a69a;
895
- color: rgb(234.25, 250.25, 248.75);
920
+ color: rgb(91.862745098%, 98.137254902%, 97.5490196078%);
896
921
  }
897
922
  .collection .collection-item.active .secondary-content {
898
923
  color: var(--mm-text-on-primary, #fff);
@@ -1021,6 +1046,72 @@ td, th {
1021
1046
  /*******************
1022
1047
  Utility Classes
1023
1048
  *******************/
1049
+ .mm-layout-row {
1050
+ display: flex;
1051
+ }
1052
+
1053
+ .mm-layout-row--center {
1054
+ align-items: center;
1055
+ }
1056
+
1057
+ .mm-layout-row--align-end {
1058
+ align-items: flex-end;
1059
+ }
1060
+
1061
+ .mm-layout-row--wrap {
1062
+ flex-wrap: wrap;
1063
+ }
1064
+
1065
+ .mm-layout-row--justify-start {
1066
+ justify-content: flex-start;
1067
+ }
1068
+
1069
+ .mm-layout-row--justify-end {
1070
+ justify-content: flex-end;
1071
+ }
1072
+
1073
+ .mm-layout-row--justify-between {
1074
+ justify-content: space-between;
1075
+ }
1076
+
1077
+ .mm-layout-stack {
1078
+ display: flex;
1079
+ flex-direction: column;
1080
+ gap: var(--mm-layout-gap, 0);
1081
+ }
1082
+
1083
+ .mm-layout-cluster {
1084
+ display: flex;
1085
+ align-items: center;
1086
+ flex-wrap: wrap;
1087
+ gap: var(--mm-layout-gap, 8px);
1088
+ }
1089
+
1090
+ .mm-layout-grow {
1091
+ flex: 1 1 auto;
1092
+ min-width: 0;
1093
+ }
1094
+
1095
+ .mm-layout-ml-auto {
1096
+ margin-left: auto;
1097
+ }
1098
+
1099
+ .mm-layout-ml-8 {
1100
+ margin-left: var(--mm-layout-inline-gap, 8px);
1101
+ }
1102
+
1103
+ .mm-layout-mr-8 {
1104
+ margin-right: var(--mm-layout-inline-gap, 8px);
1105
+ }
1106
+
1107
+ .mm-layout-item-icon {
1108
+ margin-right: var(--mm-layout-icon-gap, 32px);
1109
+ }
1110
+
1111
+ .mm-layout-gap-sm {
1112
+ gap: var(--mm-layout-gap-sm, 8px);
1113
+ }
1114
+
1024
1115
  .hide {
1025
1116
  display: none !important;
1026
1117
  }
@@ -2318,6 +2409,51 @@ textarea.materialize-textarea::-ms-input-placeholder {
2318
2409
  color: var(--mm-text-hint, #d1d1d1) !important;
2319
2410
  }
2320
2411
 
2412
+ .input-field input.number-input:not(.browser-default) {
2413
+ -moz-appearance: textfield;
2414
+ padding-right: 2rem;
2415
+ }
2416
+ .input-field input.number-input:not(.browser-default)::-webkit-inner-spin-button, .input-field input.number-input:not(.browser-default)::-webkit-outer-spin-button {
2417
+ -webkit-appearance: none;
2418
+ margin: 0;
2419
+ }
2420
+ .input-field .number-input-controls {
2421
+ position: absolute;
2422
+ top: 0;
2423
+ right: 0;
2424
+ display: flex;
2425
+ flex-direction: column;
2426
+ justify-content: center;
2427
+ height: 3rem;
2428
+ }
2429
+ .input-field .number-input-control {
2430
+ display: flex;
2431
+ align-items: center;
2432
+ justify-content: center;
2433
+ width: 1.75rem;
2434
+ height: 1.5rem;
2435
+ padding: 0;
2436
+ border: 0;
2437
+ border-radius: 2px;
2438
+ background: transparent;
2439
+ color: var(--mm-button-flat-text, #ee6e73);
2440
+ cursor: pointer;
2441
+ line-height: 1;
2442
+ }
2443
+ .input-field .number-input-control:hover {
2444
+ background-color: var(--mm-primary-color-alpha-10, rgba(38, 166, 154, 0.1));
2445
+ }
2446
+ .input-field .number-input-control:focus-visible {
2447
+ outline: 2px solid var(--mm-primary-color, #ee6e73);
2448
+ outline-offset: -2px;
2449
+ }
2450
+ .input-field .number-input-control svg {
2451
+ font-size: 1.25rem;
2452
+ line-height: 1;
2453
+ width: 1.25rem;
2454
+ height: 1.25rem;
2455
+ }
2456
+
2321
2457
  /* Validation Sass Placeholders */
2322
2458
  .select-wrapper.valid > input.select-dropdown, input:not([type]):not(.browser-default).valid:not([readonly]):not([disabled]), input:not([type]):not(.browser-default):focus.valid:not([readonly]):not([disabled]),
2323
2459
  input[type=text]:not(.browser-default).valid:not([readonly]):not([disabled]),
@@ -3008,7 +3144,7 @@ textarea.materialize-textarea {
3008
3144
  height: 0;
3009
3145
  }
3010
3146
  .switch label input[type=checkbox]:checked + .lever {
3011
- background-color: var(--mm-switch-checked-track, rgb(132.0625, 199.4375, 193.12109375));
3147
+ background-color: var(--mm-switch-checked-track, rgb(51.7892156863%, 78.2107843137%, 75.7337622549%));
3012
3148
  }
3013
3149
  .switch label input[type=checkbox]:checked + .lever:before, .switch label input[type=checkbox]:checked + .lever:after {
3014
3150
  left: 18px;
@@ -3158,6 +3294,63 @@ select:disabled {
3158
3294
  user-select: none;
3159
3295
  }
3160
3296
 
3297
+ .input-field.select-space.select-appearance-outlined {
3298
+ position: relative;
3299
+ }
3300
+ .input-field.select-space.select-appearance-outlined > i.prefix.material-icons {
3301
+ position: absolute;
3302
+ left: 24px;
3303
+ top: 50%;
3304
+ transform: translateY(-50%);
3305
+ margin: 0;
3306
+ z-index: 2;
3307
+ pointer-events: none;
3308
+ }
3309
+ .input-field.select-space.select-appearance-outlined > i.prefix.material-icons + .select-wrapper {
3310
+ padding-left: 54px;
3311
+ }
3312
+ .input-field.select-space.select-appearance-outlined > i.prefix ~ .select-wrapper {
3313
+ margin-left: 0;
3314
+ width: 100%;
3315
+ }
3316
+ .input-field.select-space.select-appearance-outlined .select-wrapper {
3317
+ border: 1px solid var(--mm-input-border, #9e9e9e);
3318
+ border-radius: 8px;
3319
+ background-color: var(--mm-surface-color, transparent);
3320
+ padding: 0 12px;
3321
+ min-height: var(--mm-input-height, 3rem);
3322
+ display: flex;
3323
+ align-items: center;
3324
+ overflow: visible;
3325
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
3326
+ }
3327
+ .input-field.select-space.select-appearance-outlined .select-wrapper:focus-within {
3328
+ border-color: var(--mm-primary-color, #2196f3);
3329
+ box-shadow: 0 0 0 1px var(--mm-primary-color, #2196f3);
3330
+ }
3331
+ .input-field.select-space.select-appearance-outlined .select-wrapper input.select-dropdown {
3332
+ border-bottom: none;
3333
+ margin: 0;
3334
+ width: auto;
3335
+ flex: 1 1 auto;
3336
+ height: var(--mm-input-height, 3rem);
3337
+ line-height: var(--mm-input-height, 3rem);
3338
+ padding-right: 24px;
3339
+ }
3340
+ .input-field.select-space.select-appearance-outlined .select-wrapper .select-inline-label {
3341
+ color: var(--mm-text-hint, #9e9e9e);
3342
+ font-size: 16px;
3343
+ margin-right: 8px;
3344
+ white-space: nowrap;
3345
+ flex: 0 0 auto;
3346
+ pointer-events: none;
3347
+ }
3348
+ .input-field.select-space.select-appearance-outlined .select-wrapper .caret {
3349
+ right: 10px;
3350
+ z-index: 2;
3351
+ pointer-events: none;
3352
+ }
3353
+
3161
3354
  .select-wrapper i {
3162
3355
  color: var(--mm-text-primary, rgba(0, 0, 0, 0.87));
3163
3356
  }
@@ -3273,6 +3466,24 @@ body.keyboard-focused .select-dropdown.dropdown-content li:focus {
3273
3466
  cursor: default;
3274
3467
  }
3275
3468
 
3469
+ .search-select-loading-info,
3470
+ .search-select-error-info {
3471
+ padding: 8px 16px;
3472
+ color: var(--mm-text-hint, #9e9e9e);
3473
+ font-style: italic;
3474
+ text-align: center;
3475
+ border-bottom: none;
3476
+ }
3477
+ .search-select-loading-info:hover,
3478
+ .search-select-error-info:hover {
3479
+ background-color: transparent;
3480
+ cursor: default;
3481
+ }
3482
+
3483
+ .dropdown-content li.search-select-error-info {
3484
+ color: var(--mm-error-color, #f44336) !important;
3485
+ }
3486
+
3276
3487
  .search-select-option-label {
3277
3488
  display: flex;
3278
3489
  align-items: center;
@@ -3540,7 +3751,7 @@ input[type=range]::-ms-thumb {
3540
3751
  /* Create columns that are at least 150px wide and fill the available space */
3541
3752
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
3542
3753
  /* Add space between grid items */
3543
- gap: 15px;
3754
+ gap: var(--mm-layout-gap-form, 15px);
3544
3755
  padding-top: 10px;
3545
3756
  padding-bottom: 20px;
3546
3757
  }
@@ -3558,3 +3769,67 @@ input[type=range]::-ms-thumb {
3558
3769
  cursor: text;
3559
3770
  text-align: initial;
3560
3771
  }
3772
+
3773
+ .mm-fieldset {
3774
+ border: 1px solid var(--mm-border-color);
3775
+ border-radius: 4px;
3776
+ margin: 0 0 1.5rem;
3777
+ padding: 1rem;
3778
+ }
3779
+
3780
+ .mm-fieldset__legend {
3781
+ font-size: 1rem;
3782
+ font-weight: 500;
3783
+ padding: 0 0.35rem;
3784
+ }
3785
+
3786
+ .mm-fieldset__required,
3787
+ .mm-fieldset__error,
3788
+ .mm-validation-summary {
3789
+ color: var(--mm-error-color);
3790
+ }
3791
+
3792
+ .mm-fieldset__description,
3793
+ .mm-form-section__description {
3794
+ color: var(--mm-text-secondary);
3795
+ margin: 0 0 1rem;
3796
+ }
3797
+
3798
+ .mm-fieldset__error {
3799
+ margin: 0.75rem 0 0;
3800
+ }
3801
+
3802
+ .mm-form-section {
3803
+ margin-bottom: 2rem;
3804
+ }
3805
+
3806
+ .mm-form-section__header {
3807
+ margin-bottom: 1rem;
3808
+ }
3809
+
3810
+ .mm-form-section__title {
3811
+ font-size: 1.3rem;
3812
+ margin: 0 0 0.4rem;
3813
+ }
3814
+
3815
+ .mm-validation-summary {
3816
+ background: color-mix(in srgb, var(--mm-error-color) 10%, transparent);
3817
+ border-left: 4px solid var(--mm-error-color);
3818
+ margin: 0 0 1.25rem;
3819
+ padding: 0.8rem 1rem;
3820
+ }
3821
+
3822
+ .mm-validation-summary__title {
3823
+ font-weight: 600;
3824
+ margin: 0 0 0.4rem;
3825
+ }
3826
+
3827
+ .mm-validation-summary__list {
3828
+ margin: 0;
3829
+ padding-left: 1.2rem;
3830
+ }
3831
+
3832
+ .mm-validation-summary a {
3833
+ color: inherit;
3834
+ text-decoration: underline;
3835
+ }
@@ -1,9 +1,10 @@
1
1
  import { FactoryComponent } from 'mithril';
2
+ import { ComponentStyle } from './types';
2
3
  export interface FloatingActionButtonAttrs {
3
4
  /** Optional classes to add to the top element */
4
5
  className?: string;
5
6
  /** Optional style to add to the top element, e.g. for positioning it inline */
6
- style?: string;
7
+ style?: ComponentStyle;
7
8
  /** Material-icons name for the main FAB, @see https://materializecss.com/icons.html */
8
9
  iconName: string;
9
10
  /** Helper option to place the FAB inline instead of the bottom right of the display */
@@ -0,0 +1,35 @@
1
+ import m, { Attributes, FactoryComponent } from 'mithril';
2
+ export interface ValidationSummaryError {
3
+ /** The ID of the invalid field. Used to link and focus the field from the summary. */
4
+ fieldId?: string;
5
+ /** Use a custom target when the error does not belong to a focusable field. */
6
+ href?: string;
7
+ /** Error text shown in the summary. */
8
+ message: m.Children;
9
+ }
10
+ export interface FieldsetAttrs extends Attributes {
11
+ /** Accessible label for the group of controls. */
12
+ legend: m.Children;
13
+ /** Optional explanatory text below the legend. */
14
+ description?: m.Children;
15
+ /** Mark the group as required. */
16
+ required?: boolean;
17
+ /** Disable native controls contained in the group. */
18
+ disabled?: boolean;
19
+ /** Group-level validation message. */
20
+ error?: m.Children;
21
+ }
22
+ /** A semantic native fieldset for related controls. */
23
+ export declare const Fieldset: FactoryComponent<FieldsetAttrs>;
24
+ export interface FormSectionAttrs extends Attributes {
25
+ /** Visible section heading. */
26
+ title?: m.Children;
27
+ /** Optional explanatory text below the heading. */
28
+ description?: m.Children;
29
+ /** Errors supplied by the application's form validation state. */
30
+ errors?: ValidationSummaryError[];
31
+ /** Heading used by the validation summary. */
32
+ summaryTitle?: m.Children;
33
+ }
34
+ /** A visual form section with an optional accessible validation summary. */
35
+ export declare const FormSection: FactoryComponent<FormSectionAttrs>;