@energycap/components 0.39.17-ECAP-23124-menu-item-divider-improvements.20240605-1048 → 0.39.18-ECAP-25250-eclipse-formula-builder-proto.20240606-1059

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energycap/components",
3
- "version": "0.39.17-ECAP-23124-menu-item-divider-improvements.20240605-1048",
3
+ "version": "0.39.18-ECAP-25250-eclipse-formula-builder-proto.20240606-1059",
4
4
  "dependencies": {
5
5
  "tslib": "^2.0.0"
6
6
  },
@@ -217,7 +217,7 @@
217
217
  --ec-form-control-border-color: var(--ec-color-gray-4);
218
218
  --ec-form-control-border-radius: var(--ec-border-radius);
219
219
  --ec-form-control-font-size: var(--ec-font-size-body);
220
- --ec-form-control-border-color-focus: var(--ec-background-color);
220
+ --ec-form-control-border-color-focus: var(--ec-color-interactive);
221
221
  --ec-form-control-box-shadow-focus: 0 0 0 2px var(--ec-color-interactive);
222
222
  --ec-form-control-background-color-invalid: var(--ec-background-color-caution);
223
223
  --ec-form-control-color-invalid: var(--ec-color-primary-dark);
@@ -0,0 +1,153 @@
1
+ @import '../../styles/mixins/common';
2
+
3
+ @function get-item-padding($height, $line-height) {
4
+ @return (($height - $line-height) * 0.5) .5rem;
5
+ }
6
+
7
+ $menu-item-height: 1.75rem;
8
+ $menu-item-line-height: 1.25rem;
9
+ $menu-item-color: var(--ec-color-secondary-dark);
10
+ $menu-item-font-size: var(--ec-menu-font-size, var(--ec-font-size-action));
11
+ $menu-item-padding: get-item-padding($menu-item-height, $menu-item-line-height);
12
+
13
+ @mixin menu-item {
14
+ cursor: inherit;
15
+ line-height: $menu-item-line-height;
16
+ min-height: $menu-item-height;
17
+ padding: $menu-item-padding;
18
+ border-radius: var(--ec-border-radius);
19
+ display: flex;
20
+
21
+ .label {
22
+ margin-right: auto;
23
+
24
+ & + .ec-icon {
25
+ margin-left: .5rem;
26
+ }
27
+ }
28
+
29
+ .ec-icon {
30
+ margin-top: calc(calc(#{$menu-item-line-height} - #{map-get($icon-sizes, default)}) / 2);
31
+ flex: none;
32
+
33
+ & + .label {
34
+ margin-left: .5rem;
35
+ }
36
+ }
37
+
38
+ .ec-icon-sm {
39
+ margin-top: calc(calc(#{$menu-item-line-height} - #{map-get($icon-sizes, sm)}) / 2);
40
+ }
41
+ }
42
+
43
+ @mixin menu-ul {
44
+ @include ul-reset;
45
+ flex: auto;
46
+ height: 100%;
47
+ overflow-y: auto;
48
+
49
+ li {
50
+ cursor: pointer;
51
+ padding: 0 .25rem;
52
+
53
+ a {
54
+ color: inherit;
55
+ border-bottom: 0;
56
+ text-decoration: none;
57
+ }
58
+
59
+ &.is-selected,
60
+ &.is-highlighted {
61
+ .item-wrapper {
62
+ background-color: var(--ec-background-color-selected);
63
+ }
64
+ }
65
+
66
+ &:hover .item-wrapper {
67
+ background-color: var(--ec-background-color-hover);
68
+ }
69
+
70
+ &:focus .item-wrapper{
71
+ outline: none;
72
+ background-color: var(--ec-color-disabled-dark);
73
+ position: relative;
74
+ z-index: 1;
75
+ }
76
+
77
+ &.is-disabled .item-wrapper {
78
+ color: var(--ec-color-disabled-dark);
79
+ opacity: var(--ec-form-control-opacity-disabled);
80
+ }
81
+
82
+ &.is-disabled,
83
+ &.is-readonly {
84
+ cursor: default;
85
+
86
+ .item-wrapper {
87
+ background-color: transparent;
88
+ color: inherit;
89
+ }
90
+ }
91
+
92
+ &.is-checked {
93
+ .icon-check {
94
+ opacity: 1;
95
+ }
96
+ }
97
+
98
+ &.heading {
99
+ cursor: default;
100
+
101
+ .item-wrapper {
102
+ background-color: transparent;
103
+ }
104
+
105
+ &:not(:first-child) {
106
+ margin-top: .5rem;
107
+ }
108
+ }
109
+
110
+ &.divider:not(:last-child) {
111
+ border-bottom: 1px solid var(--ec-border-color);
112
+ padding-bottom: .25rem;
113
+ margin-bottom: .25rem;
114
+ }
115
+
116
+ // The :not(.divider + .divider-top) prevents a double border from appearing when the previous item has a bottom divider
117
+ &.divider-top:not(:first-child):not(.divider + .divider-top) {
118
+ border-top: 1px solid var(--ec-border-color);
119
+ padding-top: .25rem;
120
+ margin-top: .25rem;
121
+ }
122
+
123
+ @each $index in (1, 2, 3) {
124
+ $padding: $index + .5;
125
+ &.indent-#{$index} .item-wrapper {
126
+ padding-left: #{$padding}rem;
127
+ }
128
+ }
129
+ }
130
+ }
131
+
132
+ @mixin menu-parent {
133
+ display: flex;
134
+ flex-direction: column;
135
+ flex: auto;
136
+ position: relative;
137
+ max-width: 100%;
138
+
139
+ > header {
140
+ cursor: pointer;
141
+
142
+ &.is-selected,
143
+ &.is-highlighted {
144
+ .item-wrapper {
145
+ background-color: var(--ec-background-color-selected);
146
+ }
147
+ }
148
+
149
+ &:hover .item-wrapper {
150
+ background-color: var(--ec-background-color-hover);
151
+ }
152
+ }
153
+ }