@sebgroup/green-core 1.11.0 → 1.12.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.
@@ -20,7 +20,7 @@ export declare class GdsGrid extends LitElement {
20
20
  */
21
21
  columns?: string | undefined;
22
22
  /**
23
- * @property {string} gap - Defines the gap size between grid items. Accepts a single value for all breakpoints or a "l:desktop m:tablet s:mobile" format. Sizes can be 'none', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'.
23
+ * @property {string} `gap` - Defines the gap size between grid items. Accepts a single value for all breakpoints or a "l:desktop m:tablet s:mobile" format. Sizes can be 'none', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'.
24
24
  * @example
25
25
  * ```html
26
26
  * <gds-grid gap="m"></gds-grid> <!-- applies to all breakpoints -->
@@ -28,6 +28,15 @@ export declare class GdsGrid extends LitElement {
28
28
  * ```
29
29
  */
30
30
  gap?: GridSizes;
31
+ /**
32
+ * @property {string} `row-gap` - Defines the gap size between grid items in vertical axis. Accepts a single value for all breakpoints or a "l:desktop m:tablet s:mobile" format. Sizes can be 'none', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'.
33
+ * @example
34
+ * ```html
35
+ * <gds-grid row-gap="m"></gds-grid> <!-- applies to all breakpoints -->
36
+ * <gds-grid row-gap="l:m m:s s:xs"></gds-grid> <!-- different values for each breakpoint -->
37
+ * ```
38
+ */
39
+ rowGap?: GridSizes;
31
40
  /**
32
41
  * @property {string} padding - Defines the padding size around the grid. Accepts a single value for all breakpoints or a "l:desktop m:tablet s:mobile" format. Sizes can be 'none', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'.
33
42
  * @example
@@ -65,6 +74,11 @@ export declare class GdsGrid extends LitElement {
65
74
  * It updates the gap CSS variables when the 'gap' property changes.
66
75
  */
67
76
  private _updateGapVariables;
77
+ /**
78
+ * Watcher for the 'row-gap' property.
79
+ * It updates the row-gap CSS variables when the 'row-gap' property changes.
80
+ */
81
+ private _updateRowGapVariables;
68
82
  /**
69
83
  * Watcher for the 'padding' property.
70
84
  * It updates the padding CSS variables when the 'padding' property changes.
package/index.js CHANGED
@@ -144,7 +144,7 @@ function watchMediaQuery(q) {
144
144
  // libs/core/src/utils/helpers/custom-element-scoping.ts
145
145
  import { html as litHtml } from "lit";
146
146
  import { customElement } from "lit/decorators.js";
147
- var VER_SUFFIX = "-8cc777";
147
+ var VER_SUFFIX = "-b357a1";
148
148
  var elementLookupTable = /* @__PURE__ */ new Map();
149
149
  var gdsCustomElement = (tagName) => {
150
150
  if (globalThis.GDS_DISABLE_VERSIONED_ELEMENTS) {
@@ -2808,7 +2808,7 @@ import { unsafeCSS as unsafeCSS2 } from "lit";
2808
2808
  // dist/libs/tokens/internal/pallet.css
2809
2809
  var pallet_default = `/**
2810
2810
  * Do not edit directly
2811
- * Generated on Tue, 02 Apr 2024 11:52:08 GMT
2811
+ * Generated on Wed, 10 Apr 2024 11:06:21 GMT
2812
2812
  */
2813
2813
 
2814
2814
  :host {
@@ -2969,7 +2969,7 @@ var pallet_default = `/**
2969
2969
  // dist/libs/tokens/internal/theme/light.css
2970
2970
  var light_default = `/**
2971
2971
  * Do not edit directly
2972
- * Generated on Tue, 02 Apr 2024 11:52:08 GMT
2972
+ * Generated on Wed, 10 Apr 2024 11:06:21 GMT
2973
2973
  */
2974
2974
 
2975
2975
  :host {
@@ -3006,22 +3006,27 @@ var light_default = `/**
3006
3006
  --gds-sys-color-base800: #333333;
3007
3007
  --gds-sys-color-base900: #1a1a1a;
3008
3008
  --gds-sys-color-accent-accent-green: #006D31;
3009
+ --gds-sys-color-accent-on-accent-green: #FFFFFF;
3009
3010
  --gds-sys-color-accent-accent-orange: #FFBA30;
3011
+ --gds-sys-color-accent-on-accent-orange: #353531;
3010
3012
  --gds-sys-color-background-background: #FFFFFF;
3011
3013
  --gds-sys-color-background-background-dim: #F3F3F2;
3012
3014
  --gds-sys-color-container-container: #F3F3F2;
3013
- --gds-sys-color-container-dim1: #E7E7E4;
3014
- --gds-sys-color-container-dim2: #DADAD7;
3015
- --gds-sys-color-container-bright: #FFFFFF;
3016
- --gds-sys-color-container-shade1: #353531;
3017
- --gds-sys-color-container-shade2: #1B1B18;
3018
- --gds-sys-color-container-disabled: #F9F9F9;
3019
- --gds-sys-color-container-positive: #006D31;
3020
- --gds-sys-color-container-negative: #BA1D00;
3015
+ --gds-sys-color-container-container-dim1: #E7E7E4;
3016
+ --gds-sys-color-container-container-dim2: #DADAD7;
3017
+ --gds-sys-color-container-container-bright: #FFFFFF;
3018
+ --gds-sys-color-container-container-shade1: #353531;
3019
+ --gds-sys-color-container-container-shade2: #1B1B18;
3020
+ --gds-sys-color-container-container-shade3: #353531;
3021
+ --gds-sys-color-container-container-disabled: #F9F9F9;
3022
+ --gds-sys-color-container-container-positive: #006D31;
3023
+ --gds-sys-color-container-container-negative: #BA1D00;
3024
+ --gds-sys-color-container-container-negative-bright: #FFEDE9;
3021
3025
  --gds-sys-color-content-content: #353531;
3022
3026
  --gds-sys-color-content-content-inverse: #FFFFFF;
3023
3027
  --gds-sys-color-content-content-secondary: #6A6A62;
3024
3028
  --gds-sys-color-content-content-positive: #006D31;
3029
+ --gds-sys-color-content-content-positive-bright: #EAFFE8;
3025
3030
  --gds-sys-color-content-content-negative: #BA1D00;
3026
3031
  --gds-sys-color-content-content-negative-bright: #FFF8F6;
3027
3032
  --gds-sys-color-content-content-custom-blue-bright: #F8F9FF;
@@ -3076,14 +3081,16 @@ var light_default = `/**
3076
3081
  --gds-sys-color-stroke-stroke-positive: #006D31;
3077
3082
  --gds-sys-color-stroke-stroke-warning: #7D5700;
3078
3083
  --gds-sys-color-stroke-stroke-negative: #BA1D00;
3079
- --gds-sys-color-stroke-stroke-custom-blue: #BA1D00;
3084
+ --gds-sys-color-stroke-stroke-custom-blue: #005FAC;
3085
+ --gds-sys-color-stroke-stroke-custom-blue-bright: #6FAEFF;
3086
+ --gds-sys-color-stroke-stroke-inversed: #FFFFFF;
3080
3087
  }
3081
3088
  `;
3082
3089
 
3083
3090
  // dist/libs/tokens/internal/size.css
3084
3091
  var size_default = `/**
3085
3092
  * Do not edit directly
3086
- * Generated on Tue, 02 Apr 2024 11:52:08 GMT
3093
+ * Generated on Wed, 10 Apr 2024 11:06:21 GMT
3087
3094
  */
3088
3095
 
3089
3096
  :host {
@@ -3258,10 +3265,12 @@ var style8 = css9`
3258
3265
  --_grid-col-start: 1;
3259
3266
  --_grid-col-end: -1;
3260
3267
  --_gap-column: 0;
3268
+ --_gap-row: 0;
3261
3269
  display: grid;
3262
3270
  width: 100%;
3263
3271
  grid-template-columns: var(--_grid-col);
3264
3272
  grid-column-gap: var(--_gap-column);
3273
+ grid-row-gap: var(--_gap-row);
3265
3274
  padding: var(--_grid-padding);
3266
3275
  text-wrap: balance;
3267
3276
  }
@@ -3284,23 +3293,26 @@ var style8 = css9`
3284
3293
  :host {
3285
3294
  --_c: var(--_columns-desktop);
3286
3295
  --_gap-column: var(--_gap-desktop);
3296
+ --_gap-row: var(--_row-gap-desktop);
3287
3297
  --_grid-padding: var(--_padding-desktop);
3288
3298
  --_col-width: var(--_col-width-desktop);
3289
3299
  }
3290
3300
 
3291
3301
  @media only screen and (max-width: 768px) {
3292
- :host(:not([auto-columns])) {
3302
+ :host {
3293
3303
  --_c: var(--_columns-tablet);
3294
3304
  --_gap-column: var(--_gap-tablet);
3305
+ --_gap-row: var(--_row-gap-tablet);
3295
3306
  --_grid-padding: var(--_padding-tablet);
3296
3307
  --_col-width: var(--_col-width-tablet);
3297
3308
  }
3298
3309
  }
3299
3310
 
3300
3311
  @media only screen and (max-width: 425px) {
3301
- :host(:not([auto-columns])) {
3312
+ :host {
3302
3313
  --_c: var(--_columns-mobile);
3303
3314
  --_gap-column: var(--_gap-mobile);
3315
+ --_gap-row: var(--_row-gap-mobile);
3304
3316
  --_grid-padding: var(--_padding-mobile);
3305
3317
  --_col-width: var(--_col-width-mobile);
3306
3318
  }
@@ -3316,6 +3328,7 @@ var GdsGrid = class extends LitElement7 {
3316
3328
  this._gridVariables = {
3317
3329
  varsColumn: css10``,
3318
3330
  varsGap: css10``,
3331
+ varsRowGap: css10``,
3319
3332
  varsPadding: css10``,
3320
3333
  varsAutoColumns: css10``
3321
3334
  };
@@ -3328,6 +3341,7 @@ var GdsGrid = class extends LitElement7 {
3328
3341
  super.connectedCallback();
3329
3342
  this._updateColumnVariables();
3330
3343
  this._updateGapVariables();
3344
+ this._updateRowGapVariables();
3331
3345
  this._updatePaddingVariables();
3332
3346
  this._updateAutoColumnsVariables();
3333
3347
  }
@@ -3381,6 +3395,31 @@ var GdsGrid = class extends LitElement7 {
3381
3395
  };
3382
3396
  this.requestUpdate("_gridVariables");
3383
3397
  }
3398
+ _updateRowGapVariables() {
3399
+ const match = this.rowGap?.match(BreakpointPattern);
3400
+ let rowGapDesktop, rowGapTablet, rowGapMobile;
3401
+ if (this.rowGap && !this.rowGap.includes(" ")) {
3402
+ rowGapDesktop = rowGapTablet = rowGapMobile = `var(--gds-sys-grid-gap-${this.rowGap})`;
3403
+ } else {
3404
+ const { l, m, s } = match?.groups || {};
3405
+ rowGapDesktop = l ? `var(--gds-sys-grid-gap-${l.split(":")[1]})` : void 0;
3406
+ rowGapTablet = m ? `var(--gds-sys-grid-gap-${m.split(":")[1]})` : void 0;
3407
+ rowGapMobile = s ? `var(--gds-sys-grid-gap-${s.split(":")[1]})` : void 0;
3408
+ }
3409
+ const gapProperties = [
3410
+ { name: "_row-gap-desktop", value: rowGapDesktop },
3411
+ { name: "_row-gap-tablet", value: rowGapTablet },
3412
+ { name: "_row-gap-mobile", value: rowGapMobile }
3413
+ ];
3414
+ const cssVariables = gapProperties.filter(({ value }) => value !== void 0).map(({ name, value }) => `--${name}: ${value};`).join(" ");
3415
+ this._gridVariables = {
3416
+ ...this._gridVariables,
3417
+ varsRowGap: css10`
3418
+ ${unsafeCSS3(cssVariables)}
3419
+ `
3420
+ };
3421
+ this.requestUpdate("_gridVariables");
3422
+ }
3384
3423
  _updatePaddingVariables() {
3385
3424
  const match = this.padding?.match(BreakpointPattern);
3386
3425
  let paddingDesktop, paddingTablet, paddingMobile;
@@ -3467,6 +3506,9 @@ __decorateClass([
3467
3506
  __decorateClass([
3468
3507
  property10({ attribute: "gap", type: String })
3469
3508
  ], GdsGrid.prototype, "gap", 2);
3509
+ __decorateClass([
3510
+ property10({ attribute: "row-gap", type: String })
3511
+ ], GdsGrid.prototype, "rowGap", 2);
3470
3512
  __decorateClass([
3471
3513
  property10({ attribute: "padding", type: String })
3472
3514
  ], GdsGrid.prototype, "padding", 2);
@@ -3482,6 +3524,9 @@ __decorateClass([
3482
3524
  __decorateClass([
3483
3525
  watch("gap")
3484
3526
  ], GdsGrid.prototype, "_updateGapVariables", 1);
3527
+ __decorateClass([
3528
+ watch("row-gap")
3529
+ ], GdsGrid.prototype, "_updateRowGapVariables", 1);
3485
3530
  __decorateClass([
3486
3531
  watch("padding")
3487
3532
  ], GdsGrid.prototype, "_updatePaddingVariables", 1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sebgroup/green-core",
3
3
  "description": "A carefully crafted set of Web Components, laying the foundation of the Green Design System.",
4
- "version": "1.11.0",
4
+ "version": "1.12.0",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
7
7
  "type": "module",
@@ -3364,7 +3364,7 @@ function register7() {
3364
3364
  // libs/core/src/utils/helpers/custom-element-scoping.ts
3365
3365
  import { html as litHtml } from "lit";
3366
3366
  import { customElement } from "lit/decorators.js";
3367
- var VER_SUFFIX = "-8cc777";
3367
+ var VER_SUFFIX = "-b357a1";
3368
3368
  var elementLookupTable = /* @__PURE__ */ new Map();
3369
3369
  var templateCache = /* @__PURE__ */ new WeakMap();
3370
3370
  function applyElementScoping(strings, ...values) {