@genexus/mercury 0.21.2 → 0.21.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.
@@ -0,0 +1,201 @@
1
+ // The following mixins, are helpers that Mercury expose publicly.
2
+ // At the time of writting only tabular-grid helpers are being included.
3
+ // Instead of bundling the actual stylesheets, these mixins have been
4
+ // copied by hand, since scss-bundle does not works with @use, which is
5
+ // the actual way for including sass modules, that Mercury is using.
6
+
7
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
8
+ // copied from "src/base/_common.scss"
9
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
10
+
11
+ @mixin control-remove-border() {
12
+ // This resets the border applied
13
+ // (for controls inside the property grid)
14
+ --control__border-width: 0;
15
+ --control__border-color: transparent;
16
+ --control__border-radius: 0;
17
+ }
18
+
19
+ @mixin grid-cell-remove-padding() {
20
+ // we should redefine '--grid-cell__padding-inline' here because when a control
21
+ // is inside a a tabular-grid-cell the cell padding-inline value is required to
22
+ // be applied on the control padding-inline.
23
+ padding-block: 0;
24
+ padding-inline: 0;
25
+ }
26
+
27
+ @mixin grid-cell-padding-inline-block() {
28
+ padding-block: var(--grid-cell__padding-block);
29
+ padding-inline: var(--grid-cell__padding-inline);
30
+ }
31
+
32
+ @mixin focus-outline() {
33
+ outline: var(--focus__outline-width) var(--focus__outline-style)
34
+ var(--focus__outline-color);
35
+ outline-offset: var(--focus__outline-offset);
36
+ }
37
+ @mixin focus-border() {
38
+ border-color: var(--borders-un-border-color__focused);
39
+ }
40
+
41
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
42
+ // copied from "src/components/tabular-grid/_helpers.scss"
43
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
44
+
45
+ // node type
46
+ @mixin cell-node-type-text() {
47
+ @include grid-cell-padding-inline-block();
48
+ }
49
+
50
+ @mixin cell-node-type-element() {
51
+ @include control-remove-border();
52
+ @include grid-cell-remove-padding();
53
+ padding-block: 0;
54
+ padding-inline: 0;
55
+ --control__padding-inline: var(--grid-cell__padding-inline);
56
+ // to stretch the control
57
+ display: grid;
58
+ align-items: stretch;
59
+ justify-content: stretch;
60
+ }
61
+
62
+ @mixin cell-node-type-element--hover() {
63
+ outline: var(--focus__outline-width) var(--focus__outline-style)
64
+ var(--control__border-color--hover);
65
+ outline-offset: var(--focus__outline-offset);
66
+ }
67
+
68
+ // cell alignment block
69
+ @mixin cell-alignment-block-start() {
70
+ align-items: start;
71
+ }
72
+
73
+ @mixin cell-alignment-block-center() {
74
+ align-items: center;
75
+ }
76
+
77
+ @mixin cell-alignment-block-end() {
78
+ align-items: end;
79
+ }
80
+
81
+ // cell alignment inline
82
+ @mixin cell-alignment-inline-start() {
83
+ justify-content: start;
84
+ }
85
+
86
+ @mixin cell-alignment-inline-center() {
87
+ justify-content: center;
88
+ }
89
+
90
+ @mixin cell-alignment-inline-end() {
91
+ justify-content: center;
92
+ }
93
+
94
+ // cell with ellipsis
95
+ @mixin cell-ellipsis() {
96
+ display: inline-block;
97
+ white-space: nowrap;
98
+ overflow: hidden;
99
+ text-overflow: ellipsis;
100
+ }
101
+
102
+ /// @group Grid
103
+ /// @param {String} $tabular-grid-selector [".tabular-grid"] -
104
+ /// @param {("text" | "element")} $tabular-grid-cell-node-type ["text"] -
105
+ /// @param {("start" | "center" | "end")} $tabular-grid-cell-block-alignment ["start"] -
106
+ /// @param {("start" | "center" | "end")} $tabular-grid-cell-inline-alignment ["start"] -
107
+ /// @param {Boolean} $tabular-grid-cell-apply-ellipsis [false] -
108
+ /// @param {List} $tabular-grid-affected-columns-nth-list [null] -
109
+
110
+ @mixin tabular-grid-cell-layout(
111
+ $tabular-grid-selector: ".tabular-grid",
112
+ $tabular-grid-cell-node-type: "text",
113
+ $tabular-grid-cell-block-alignment: "start",
114
+ $tabular-grid-cell-inline-alignment: "start",
115
+ $tabular-grid-cell-apply-ellipsis: false,
116
+ $tabular-grid-affected-columns-nth-list: null
117
+ ) {
118
+ $selector: null;
119
+ $cell-tag-name: "ch-tabular-grid-cell";
120
+ $where-pseudo-class: ":is";
121
+ $where-selector: ();
122
+ // the selector varies depending on wether $tabular-grid-affected-columns-nth-list is null or not.
123
+ // if it is null, all cells should be affected.
124
+ @if $tabular-grid-affected-columns-nth-list != null {
125
+ @each $nth in $tabular-grid-affected-columns-nth-list {
126
+ $where-selector: append($where-selector, ":nth-child(#{$nth})", comma);
127
+ }
128
+ $selector: #{$tabular-grid-selector}
129
+ #{$cell-tag-name}#{$where-pseudo-class
130
+ }(#{$where-selector});
131
+ } @else {
132
+ // if no $editable-columns-nth was provided, apply to all cells
133
+ $selector: #{$tabular-grid-selector} #{$cell-tag-name};
134
+ }
135
+ #{$selector} {
136
+ // node type
137
+ @if $tabular-grid-cell-node-type == "text" {
138
+ @include cell-node-type-text();
139
+ }
140
+ @if $tabular-grid-cell-node-type == "element" {
141
+ @include cell-node-type-element();
142
+ }
143
+ &:hover {
144
+ @if $tabular-grid-cell-node-type == "element" {
145
+ @include cell-node-type-element--hover();
146
+ }
147
+ }
148
+ // block alignment (only should apply if $tabular-grid-cell-node-type == "text"
149
+ @if $tabular-grid-cell-node-type ==
150
+ "text" and
151
+ $tabular-grid-cell-block-alignment ==
152
+ "start"
153
+ {
154
+ @include cell-alignment-block-start();
155
+ }
156
+ @if $tabular-grid-cell-node-type ==
157
+ "text" and
158
+ $tabular-grid-cell-block-alignment ==
159
+ "center"
160
+ {
161
+ @include cell-alignment-block-center();
162
+ }
163
+ @if $tabular-grid-cell-node-type ==
164
+ "text" and
165
+ $tabular-grid-cell-block-alignment ==
166
+ "end"
167
+ {
168
+ @include cell-alignment-block-end();
169
+ }
170
+ // inline alignment
171
+ @if $tabular-grid-cell-node-type ==
172
+ "text" and
173
+ $tabular-grid-cell-inline-alignment ==
174
+ "start"
175
+ {
176
+ @include cell-alignment-inline-start();
177
+ }
178
+ @if $tabular-grid-cell-node-type ==
179
+ "text" and
180
+ $tabular-grid-cell-inline-alignment ==
181
+ "center"
182
+ {
183
+ @include cell-alignment-inline-center();
184
+ }
185
+ @if $tabular-grid-cell-node-type ==
186
+ "text" and
187
+ $tabular-grid-cell-inline-alignment ==
188
+ "end"
189
+ {
190
+ @include cell-alignment-inline-end();
191
+ }
192
+ // ellipsis (only should apply if $tabular-grid-cell-node-type == "text"
193
+ @if $tabular-grid-cell-node-type ==
194
+ "text" and
195
+ $tabular-grid-cell-apply-ellipsis ==
196
+ true
197
+ {
198
+ @include cell-ellipsis();
199
+ }
200
+ }
201
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genexus/mercury",
3
- "version": "0.21.2",
3
+ "version": "0.21.5",
4
4
  "description": "Mercury Design System is a robust and scalable solution designed to improve product development.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -54,6 +54,7 @@
54
54
  "build.scss.bundles": "node dist/cli/bundle.js",
55
55
  "build.scss.watch": "tsc && yarn build.scss.base && yarn copy-tasks && yarn build.scss.bundles --watch -i=/assets/icons/ -f=/assets/fonts/ --outDir=../showcase/.mercury/ --avoid-hash=base/base",
56
56
  "start": "vite --port 5200 --open showcase/button.html",
57
+ "build.scss.helpers": "scss-bundle -e ./src/assets/scss/_helpers.scss -o ./src/assets/scss/helpers-bundled.scss --logLevel=info",
57
58
  "validate.ci": "yarn build-no-svg && yarn test",
58
59
  "icons-svg": "ssg-svg --srcDir=src/icons/svg-source --outDir=src/assets/icons/_generated/ --configFilePath=src/icons/svg-source/.config/color-states.json --showcaseDir=showcase/icons/ --showcaseBaseHref=../assets/icons/ --logDir=./log --objectFilePath=src/assets/MERCURY_ASSETS.ts --defaultColorType=on-surface",
59
60
  "process-icons": "ssg --configPath=./src/config/icons.js",