@onemrvapublic/design-system 22.5.0-develop.3 → 22.5.0-develop.5

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.
@@ -1,5 +1,5 @@
1
1
  // Auto-generated — do not edit
2
- const VERSION = '22.5.0-develop.3';
2
+ const VERSION = '22.5.0-develop.5';
3
3
 
4
4
  const ɵɵtsModuleIndicatorApiExtractorWorkaround = true;
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"onemrvapublic-design-system.mjs","sources":["../../../../projects/onemrva/design-system/version.ts","../../../../projects/onemrva/design-system/index.ts","../../../../projects/onemrva/design-system/onemrvapublic-design-system.ts"],"sourcesContent":["// Auto-generated — do not edit\nexport const VERSION = '22.5.0-develop.3';\n","export { VERSION } from './version';\n\nexport const ɵɵtsModuleIndicatorApiExtractorWorkaround = true;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;AACO,MAAM,OAAO,GAAG;;ACChB,MAAM,yCAAyC,GAAG;;ACFzD;;AAEG;;;;"}
1
+ {"version":3,"file":"onemrvapublic-design-system.mjs","sources":["../../../../projects/onemrva/design-system/version.ts","../../../../projects/onemrva/design-system/index.ts","../../../../projects/onemrva/design-system/onemrvapublic-design-system.ts"],"sourcesContent":["// Auto-generated — do not edit\nexport const VERSION = '22.5.0-develop.5';\n","export { VERSION } from './version';\n\nexport const ɵɵtsModuleIndicatorApiExtractorWorkaround = true;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;AACO,MAAM,OAAO,GAAG;;ACChB,MAAM,yCAAyC,GAAG;;ACFzD;;AAEG;;;;"}
@@ -1,5 +1,8 @@
1
1
  @use '@angular/material' as mat;
2
2
 
3
+ // Sized and spaced like mat-chip (see theme/overrides/_chips.scss): same
4
+ // container height, 12px horizontal padding, and an 18px leading checkmark
5
+ // with an 8px gap when selected, like a selected mat-chip-option.
3
6
  .onemrva-theme onemrva-mat-choice-chip {
4
7
  @include mat.checkbox-overrides(
5
8
  (
@@ -7,43 +10,54 @@
7
10
  )
8
11
  );
9
12
 
10
- .mat-mdc-checkbox:not(.mat-mdc-checkbox-checked)
11
- .mat-internal-form-field
12
- > label {
13
- padding-left: 14px;
14
- }
13
+ display: inline-block;
14
+ vertical-align: middle;
15
15
 
16
16
  mat-checkbox.onemrva-choice-chip {
17
+ display: inline-flex;
18
+ box-sizing: border-box;
19
+ height: var(--mat-chip-container-height, 38px);
17
20
  user-select: none;
18
21
  border: 1px solid var(--mat-sys-primary);
19
22
  border-radius: var(--chip-border-radius);
20
23
  background: var(--mat-sys-primary-container);
21
24
  padding: 0;
22
25
 
23
- label {
24
- color: var(--mat-sys-primary);
25
- font-family: var(--mat-sys-label-large-font);
26
- font-size: var(--mat-sys-label-large-size);
27
- font-weight: var(--mat-sys-label-large-weight);
28
- line-height: var(--mat-sys-label-large-line-height);
29
- }
26
+ .mdc-form-field {
27
+ display: flex;
28
+ align-items: center;
29
+ height: 100%;
30
30
 
31
- &.mat-mdc-checkbox-checked {
32
- background-color: var(--mat-sys-primary);
33
- color: var(--mat-sys-on-primary);
31
+ .mdc-checkbox {
32
+ flex: 0 0 auto;
33
+ width: 0;
34
+ height: 18px;
35
+ padding: 0;
36
+ margin: 0;
37
+ visibility: hidden;
38
+ transition:
39
+ width 400ms,
40
+ margin-left 400ms;
34
41
 
35
- .mdc-checkbox__background {
36
- background-color: var(--mat-sys-primary);
37
- background: none !important;
38
- border: none !important;
39
- top: -6px;
40
- left: 10px;
42
+ .mdc-checkbox__ripple,
43
+ input {
44
+ display: none;
45
+ }
46
+
47
+ .mdc-checkbox__background {
48
+ top: 0;
49
+ left: 0;
50
+ }
41
51
  }
42
52
 
43
- label {
44
- line-height: var(--mdc-chip-container-height);
45
- padding: 5px 14px 5px;
46
- color: var(--mat-sys-on-primary);
53
+ > label {
54
+ padding: 0 12px;
55
+ color: var(--mat-sys-primary);
56
+ font-family: var(--mat-sys-label-large-font);
57
+ font-size: var(--mat-sys-label-large-size);
58
+ font-weight: var(--mat-sys-label-large-weight);
59
+ line-height: var(--mat-sys-label-large-line-height);
60
+ white-space: nowrap;
47
61
  }
48
62
  }
49
63
 
@@ -51,29 +65,25 @@
51
65
  display: none;
52
66
  }
53
67
 
54
- .mdc-form-field {
55
- display: inline-block;
68
+ &.mat-mdc-checkbox-checked {
69
+ background-color: var(--mat-sys-primary);
56
70
 
57
- .mdc-checkbox {
58
- padding: 0;
59
- margin: 0;
60
- transition: width 400ms;
71
+ .mdc-form-field {
72
+ .mdc-checkbox {
73
+ width: 18px;
74
+ margin-left: 8px;
75
+ visibility: visible;
76
+ }
61
77
 
62
- .mdc-checkbox__ripple,
63
- input {
64
- display: none;
78
+ .mdc-checkbox__background {
79
+ background: none !important;
80
+ border: none !important;
65
81
  }
66
- }
67
- }
68
82
 
69
- &:not(.mat-mdc-checkbox-checked) {
70
- label {
71
- line-height: var(--mdc-chip-container-height);
72
- padding: 5px 14px;
73
- }
74
- .mdc-checkbox {
75
- visibility: hidden;
76
- width: 0;
83
+ > label {
84
+ padding-left: 8px;
85
+ color: var(--mat-sys-on-primary);
86
+ }
77
87
  }
78
88
  }
79
89
 
@@ -86,7 +96,8 @@
86
96
  color: var(--mat-sys-primary-fixed-dim);
87
97
  }
88
98
  }
89
- label {
99
+
100
+ .mdc-form-field > label {
90
101
  color: var(--mat-sys-on-surface);
91
102
  }
92
103
  }
@@ -2,33 +2,40 @@
2
2
  display: inline-block;
3
3
  width: 100%;
4
4
 
5
+ // Small chip (22px per Figma): same colors and outline as mat-chip, with a
6
+ // tighter radius, vertically centred on the select trigger.
5
7
  .mat-select-counter {
6
- top: var(--spacer);
8
+ top: 50%;
7
9
  right: var(--triple-spacer);
8
- display: block;
9
- padding: var(--quarter-spacer) var(--half-spacer) var(--quarter-spacer)
10
- var(--spacer);
11
- background: var(--mat-sys-primary-container);
12
- color: var(--mat-sys-on-primary-container);
10
+ transform: translateY(-50%);
11
+ display: inline-flex;
12
+ align-items: center;
13
+ gap: var(--quarter-spacer);
14
+ box-sizing: border-box;
15
+ height: 22px;
13
16
  min-width: var(--triple-spacer);
14
- font-family: var(--brand-font);
17
+ padding: 0 var(--half-spacer) 0 var(--spacer);
18
+ background: var(--mat-sys-primary-container);
19
+ color: var(--mat-sys-primary);
15
20
 
16
21
  border: 1px solid var(--mat-sys-primary);
17
- border-radius: var(--button-border-radius);
22
+ border-radius: var(--small-border-radius);
18
23
 
19
24
  span.text {
20
- font-family: var(--sys-label-large-font);
25
+ font-family: var(--mat-sys-label-large-font);
21
26
  font-style: normal;
22
- font-weight: 500;
27
+ font-weight: var(--mat-sys-label-large-weight);
23
28
  font-size: 0.75rem;
24
- line-height: 1.25rem;
29
+ line-height: 1rem;
25
30
  }
26
31
  mat-icon {
27
- font-size: 0.75rem;
28
- height: 0.75rem;
29
- width: 0.75rem;
30
- line-height: 1rem;
31
- padding: 0 var(--quarter-spacer) 0 var(--quarter-spacer);
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ font-size: 0.875rem;
36
+ height: 0.875rem;
37
+ width: 0.875rem;
38
+ color: var(--mat-sys-primary);
32
39
  cursor: pointer;
33
40
  }
34
41
  }
@@ -1,15 +1,34 @@
1
1
  @use '@angular/material' as mat;
2
2
 
3
3
  mat-card.onemrva-selectable-box {
4
- $main-color: var(--mat-sys-primary-container);
5
-
6
4
  border-radius: var(--half-border-radius);
7
5
  box-shadow: none;
8
6
  position: relative;
7
+ overflow: hidden;
9
8
  color: var(--mat-sys-on-surface);
10
- border: 2px solid transparent;
11
- background: $main-color;
9
+ border: none;
10
+ background: var(--mat-sys-surface);
12
11
  user-select: none;
12
+ transition: box-shadow 150ms ease;
13
+
14
+ // Disabled fading is done by the box (opacity on the content), so the
15
+ // disabled radio tokens are reset to stop the radio fading a second time.
16
+ @include mat.radio-overrides(
17
+ (
18
+ state-layer-size: 20px,
19
+ touch-target-display: none,
20
+ label-text-font: var(--text-font),
21
+ label-text-size: 16px,
22
+ label-text-weight: 600,
23
+ label-text-line-height: 26px,
24
+ label-text-color: var(--mat-sys-on-surface),
25
+ disabled-label-color: var(--mat-sys-on-surface),
26
+ disabled-unselected-icon-color: var(--mat-sys-on-surface),
27
+ disabled-unselected-icon-opacity: 1,
28
+ disabled-selected-icon-color: var(--mat-sys-tertiary),
29
+ disabled-selected-icon-opacity: 1,
30
+ )
31
+ );
13
32
 
14
33
  mat-icon {
15
34
  overflow: visible;
@@ -18,50 +37,90 @@ mat-card.onemrva-selectable-box {
18
37
 
19
38
  mat-radio-button {
20
39
  pointer-events: none;
40
+
41
+ .mdc-label {
42
+ padding-left: var(--spacer);
43
+ }
21
44
  }
22
45
 
23
46
  mat-card-title {
24
47
  display: flex;
25
- background: $main-color;
26
- border-top-left-radius: var(--half-border-radius);
27
- border-top-right-radius: var(--half-border-radius);
28
- padding: var(--spacer-and-half) var(--spacer-and-half)
29
- var(--spacer-and-half) calc(var(--spacer-and-half) + var(--quad-spacer));
48
+ justify-content: space-between;
30
49
  align-items: center;
50
+ gap: var(--double-spacer);
51
+ margin: 0;
52
+ padding: var(--double-spacer);
53
+ background: var(--mat-sys-primary-container);
31
54
  box-shadow: none;
32
55
  color: inherit;
33
56
 
34
- font-family: var(--label-large-font-family, Poppins);
35
- font-size: var(--label-large-font-size, 16px);
57
+ font-family: var(--text-font);
58
+ font-size: 16px;
36
59
  font-style: normal;
37
- font-weight: var(--label-large-font-weight, 500);
38
- line-height: var(--label-large-line-height, 21px); /* 131.25% */
60
+ font-weight: 600;
61
+ line-height: 26px;
62
+ }
39
63
 
40
- mat-label {
41
- display: flex;
42
- flex-grow: 1;
64
+ .selectable-box-start,
65
+ .selectable-box-end {
66
+ display: flex;
67
+ align-items: center;
68
+ gap: var(--double-spacer);
69
+
70
+ &:empty {
71
+ display: none;
43
72
  }
73
+ }
44
74
 
45
- mat-radio-button {
46
- //transform: translateY(-0.5rem);
47
- //max-height: 1rem;
48
- position: absolute;
49
- left: 2px;
75
+ .selectable-box-icon {
76
+ &:empty {
77
+ display: none;
78
+ }
79
+
80
+ &:not(.xsmall, .small, .large, .xlarge, .xxlarge) {
81
+ width: 20px;
82
+ height: 20px;
83
+ font-size: 20px;
84
+ line-height: 20px;
50
85
  }
51
86
  }
52
87
 
53
- &.checked {
54
- border: 2px solid var(--mat-sys-tertiary);
55
- overflow: hidden;
88
+ .selectable-box-info {
89
+ width: 16px;
90
+ height: 16px;
91
+ font-size: 16px;
92
+ line-height: 16px;
93
+ cursor: default;
94
+ }
95
+
96
+ &:not(.disabled):hover {
97
+ box-shadow: var(--box-shadow-level2);
98
+ }
99
+
100
+ // `.checked` is set from the explicit [checked] input. Inside a mat-radio-group the
101
+ // selection lives in the inner MatRadioButton, which toggles its own
102
+ // `mat-mdc-radio-checked` host class — follow that so the styling stays in sync
103
+ // with the radio dot without mirroring non-signal state in the component.
104
+ // An inset outline (not a border) keeps the box the same size in every state.
105
+ &.checked,
106
+ &:has(mat-radio-button.mat-mdc-radio-checked) {
107
+ outline: 2px solid var(--mat-sys-tertiary);
108
+ outline-offset: -2px;
56
109
 
57
110
  mat-card-title {
58
111
  background: var(--mat-sys-tertiary-container);
59
112
  }
60
113
  }
61
114
 
115
+ // Backgrounds stay at full strength, only the content fades.
62
116
  &.disabled {
63
- opacity: 0.4;
64
- cursor: auto;
117
+ cursor: default;
118
+
119
+ .selectable-box-start,
120
+ .selectable-box-end,
121
+ .selectable-box-body {
122
+ opacity: 0.4;
123
+ }
65
124
  }
66
125
 
67
126
  b,
@@ -70,12 +129,13 @@ mat-card.onemrva-selectable-box {
70
129
  }
71
130
 
72
131
  mat-card-content {
73
- background: var(--mat-sys-surface);
74
- padding: var(--spacer-and-half);
132
+ padding: var(--double-spacer);
133
+ border: 1px solid var(--mat-sys-primary-container);
134
+ border-top: none;
75
135
  border-bottom-left-radius: var(--half-border-radius);
76
136
  border-bottom-right-radius: var(--half-border-radius);
77
137
 
78
- &:empty {
138
+ &:has(> .selectable-box-body:empty) {
79
139
  display: none;
80
140
  }
81
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onemrvapublic/design-system",
3
- "version": "22.5.0-develop.3",
3
+ "version": "22.5.0-develop.5",
4
4
  "description": "Design System Onem/Rva without theme included",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,6 +15,10 @@
15
15
 
16
16
  --box-shadow: 0 2px 6px #00000026;
17
17
 
18
+ --box-shadow-level2: 0 3px 3px 0 rgba(49, 47, 59, 0.32);
19
+ --box-shadow-level3: 0 2px 6px 0 rgba(0, 0, 0, 0.32);
20
+ --box-shadow-level4: 0 3px 6px 0 rgba(0, 0, 0, 0.16);
21
+
18
22
  --border-radius: 16px;
19
23
  --half-border-radius: 8px;
20
24
  --small-border-radius: 4px;
@@ -5,8 +5,8 @@ import { OnemrvaMatSize } from '@onemrvapublic/design-system/utils';
5
5
  /**
6
6
  * Radio-card for selecting a single option with title and description.
7
7
  *
8
- * Exposes 5 inputs and 1 output.
9
- * Inputs: id, value, disabled, checked, iconSize: OnemrvaMatSize.
8
+ * Exposes 6 inputs and 1 output.
9
+ * Inputs: id, value, disabled, checked, iconSize: OnemrvaMatSize, tooltip: string.
10
10
  * Outputs: valueChange: MatRadioChange.
11
11
  *
12
12
  * @MatKeywords selectable-box, radio, card, select, choice
@@ -19,12 +19,13 @@ declare class OnemrvaMatSelectableBoxComponent {
19
19
  readonly disabled: _angular_core.InputSignal<boolean>;
20
20
  readonly checked: _angular_core.InputSignal<boolean>;
21
21
  readonly iconSize: _angular_core.InputSignal<OnemrvaMatSize>;
22
+ /** Text shown in a tooltip on the info icon at the end of the header. No icon when empty. */
23
+ readonly tooltip: _angular_core.InputSignal<string | undefined>;
22
24
  readonly valueChange: _angular_core.OutputEmitterRef<MatRadioChange<any>>;
23
25
  valueChanged(event: MatRadioChange): void;
24
- isChecked(): boolean;
25
26
  triggerRadioClick(): void;
26
27
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<OnemrvaMatSelectableBoxComponent, never>;
27
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<OnemrvaMatSelectableBoxComponent, "onemrva-mat-selectable-box", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "iconSize": { "alias": "iconSize"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, ["[title]", "[icon]", "[sticker]", "*"], true, never>;
28
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<OnemrvaMatSelectableBoxComponent, "onemrva-mat-selectable-box", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "iconSize": { "alias": "iconSize"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, ["[title]", "[icon]", "[sticker]", "*"], true, never>;
28
29
  }
29
30
 
30
31
  declare class OnemrvaMatSelectableBoxModule {
@@ -1,4 +1,4 @@
1
- declare const VERSION = "22.5.0-develop.3";
1
+ declare const VERSION = "22.5.0-develop.5";
2
2
 
3
3
  declare const ɵɵtsModuleIndicatorApiExtractorWorkaround = true;
4
4