@sebgroup/green-core 1.65.2 → 1.66.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 (181) hide show
  1. package/chunks/{chunk.MNBT4BBM.js → chunk.2OB745JA.js} +17 -16
  2. package/chunks/{chunk.QQZ6OU7Y.js → chunk.3H5ICQVZ.js} +7 -43
  3. package/chunks/{chunk.HLECFPM7.js → chunk.3ONXWPQW.js} +2 -2
  4. package/chunks/{chunk.NXCMDWVV.js → chunk.5UF3G7BV.js} +13 -31
  5. package/chunks/{chunk.ZJAOT2TY.js → chunk.6IPE43TE.js} +13 -9
  6. package/chunks/chunk.76QWARGM.js +48 -0
  7. package/chunks/{chunk.3HYF3OQJ.js → chunk.ANVDAFT6.js} +1 -1
  8. package/chunks/{chunk.6AXAS42G.js → chunk.AOL7I7LG.js} +1 -1
  9. package/chunks/{chunk.5KH5FC7L.js → chunk.B3QCLV6X.js} +27 -18
  10. package/chunks/{chunk.33KNAKAX.js → chunk.BCTJIMKU.js} +1 -1
  11. package/chunks/chunk.C6D7M75U.js +189 -0
  12. package/chunks/{chunk.WXLGEKTJ.js → chunk.C7QZFHHI.js} +2 -2
  13. package/chunks/{chunk.ZRVWDJF3.js → chunk.D7OG6JDU.js} +19 -39
  14. package/chunks/{chunk.I26S7X2I.js → chunk.ESW6XPZT.js} +1 -1
  15. package/chunks/{chunk.IVF6XCAV.js → chunk.FHNILNLX.js} +33 -22
  16. package/chunks/chunk.G2WTHFPE.js +136 -0
  17. package/chunks/{chunk.ERDZD4ZA.js → chunk.GB5SVW2I.js} +18 -42
  18. package/chunks/{chunk.72P5ER45.js → chunk.JKCCH7B5.js} +2 -2
  19. package/chunks/{chunk.RZC5YKY2.js → chunk.KHEFX7ET.js} +1 -1
  20. package/chunks/{chunk.S6H4MUKG.js → chunk.LNQWCKU7.js} +39 -1
  21. package/chunks/chunk.M5C2HLKD.js +0 -0
  22. package/chunks/{chunk.TMGAZY2U.js → chunk.MHE47HSD.js} +3 -8
  23. package/chunks/{chunk.K4KPKUH4.js → chunk.NUUST5OZ.js} +5 -5
  24. package/chunks/{chunk.FQ5S3SPL.js → chunk.O5MF3AWQ.js} +39 -28
  25. package/chunks/{chunk.7RH4YLXP.js → chunk.OGQ5SET4.js} +1 -1
  26. package/chunks/{chunk.E2DI7SCS.js → chunk.OPSLMB6U.js} +3 -3
  27. package/chunks/{chunk.IDLO4SF7.js → chunk.OXIKAUCN.js} +3 -4
  28. package/chunks/{chunk.WVIONKU4.js → chunk.PVDNSDQ5.js} +1 -1
  29. package/chunks/{chunk.AOTGGABX.js → chunk.PZHMIVFF.js} +10 -3
  30. package/chunks/chunk.QK3R23GV.js +1 -1
  31. package/chunks/{chunk.JIYNFF4D.js → chunk.QL3SRQMU.js} +5 -20
  32. package/chunks/{chunk.N5YJ6GYI.js → chunk.RW5RXCBK.js} +10 -3
  33. package/chunks/{chunk.RWKRHNWT.js → chunk.SHOSMOYU.js} +1 -1
  34. package/chunks/{chunk.BJYILCTQ.js → chunk.SPON3Z5D.js} +1 -1
  35. package/chunks/{chunk.N7UBPAKJ.js → chunk.SVOA74C3.js} +5 -4
  36. package/chunks/{chunk.3YLD22MP.js → chunk.TF6J2JQN.js} +11 -2
  37. package/chunks/{chunk.NXUVLTO7.js → chunk.UBXNWORG.js} +25 -14
  38. package/chunks/chunk.UGHZGD2M.js +38 -0
  39. package/chunks/{chunk.UQ24RS46.js → chunk.VQ7OJPCU.js} +8 -2
  40. package/chunks/{chunk.L2TDNB6Z.js → chunk.WBBCGR25.js} +6 -6
  41. package/chunks/{chunk.M3LCBAMM.js → chunk.WSOQAUSR.js} +23 -12
  42. package/chunks/{chunk.7M5L527M.js → chunk.WXOLDCJC.js} +10 -3
  43. package/chunks/{chunk.QOMPMV5S.js → chunk.XER65FVD.js} +9 -2
  44. package/chunks/chunk.XHVRV33B.js +20 -0
  45. package/chunks/{chunk.6J4YIHNE.js → chunk.ZCIBIPPR.js} +1 -1
  46. package/chunks/{chunk.D7J47HUV.js → chunk.ZHRMYWJY.js} +5 -18
  47. package/components/badge/badge.d.ts +3 -1
  48. package/components/badge/badge.js +9 -7
  49. package/components/badge/index.js +9 -7
  50. package/components/button/button.d.ts +16 -12
  51. package/components/button/button.js +8 -5
  52. package/components/button/button.trans.styles.js +2 -2
  53. package/components/button/index.js +8 -5
  54. package/components/calendar/calendar.js +4 -4
  55. package/components/calendar/calendar.trans.styles.js +2 -2
  56. package/components/calendar/index.js +4 -4
  57. package/components/card/card.d.ts +6 -5
  58. package/components/card/card.js +7 -5
  59. package/components/card/index.js +7 -5
  60. package/components/container/container.d.ts +3 -392
  61. package/components/container/container.js +8 -3
  62. package/components/container/index.js +8 -3
  63. package/components/context-menu/context-menu.d.ts +3 -1
  64. package/components/context-menu/context-menu.js +10 -7
  65. package/components/context-menu/context-menu.trans.styles.js +2 -2
  66. package/components/context-menu/index.js +11 -8
  67. package/components/datepicker/datepicker.d.ts +19 -15
  68. package/components/datepicker/datepicker.js +26 -24
  69. package/components/datepicker/datepicker.trans.styles.js +2 -2
  70. package/components/datepicker/index.js +26 -24
  71. package/components/dialog/dialog.js +13 -11
  72. package/components/dialog/index.js +13 -11
  73. package/components/div/div.d.ts +173 -0
  74. package/components/div/div.js +15 -0
  75. package/components/div/index.d.ts +1 -0
  76. package/components/div/index.js +16 -0
  77. package/components/divider/divider.d.ts +10 -8
  78. package/components/divider/divider.js +4 -3
  79. package/components/divider/index.js +4 -3
  80. package/components/dropdown/dropdown.js +20 -18
  81. package/components/dropdown/dropdown.trans.styles.js +2 -2
  82. package/components/dropdown/index.js +21 -19
  83. package/components/fab/fab.d.ts +3 -17
  84. package/components/fab/fab.js +9 -7
  85. package/components/fab/index.js +9 -7
  86. package/components/filter-chips/filter-chip/filter-chip.js +9 -6
  87. package/components/filter-chips/filter-chip/filter-chip.trans.styles.js +2 -2
  88. package/components/filter-chips/filter-chip/index.js +9 -6
  89. package/components/filter-chips/filter-chips.js +9 -6
  90. package/components/filter-chips/filter-chips.trans.styles.js +2 -2
  91. package/components/filter-chips/index.js +9 -6
  92. package/components/flex/flex.d.ts +3 -76
  93. package/components/flex/flex.js +7 -5
  94. package/components/flex/index.js +7 -5
  95. package/components/form/index.js +12 -8
  96. package/components/form/summary/index.js +12 -8
  97. package/components/form/summary/summary.js +12 -8
  98. package/components/grid/grid.d.ts +5 -6
  99. package/components/grid/grid.js +7 -5
  100. package/components/grid/index.js +7 -5
  101. package/components/grouped-list/grouped-list.js +4 -4
  102. package/components/grouped-list/grouped-list.trans.styles.js +2 -2
  103. package/components/grouped-list/index.js +4 -4
  104. package/components/icon/icons/index.js +132 -132
  105. package/components/img/img.d.ts +17 -77
  106. package/components/img/img.js +5 -3
  107. package/components/img/index.js +5 -3
  108. package/components/index.js +63 -59
  109. package/components/input/index.js +17 -15
  110. package/components/input/input.d.ts +19 -15
  111. package/components/input/input.js +17 -15
  112. package/components/input/input.trans.styles.js +2 -2
  113. package/components/link/index.js +6 -4
  114. package/components/link/link.d.ts +3 -1
  115. package/components/link/link.js +6 -4
  116. package/components/mask/index.js +8 -6
  117. package/components/mask/mask.d.ts +1 -0
  118. package/components/mask/mask.js +8 -6
  119. package/components/menu-button/index.js +6 -3
  120. package/components/menu-button/menu-button.d.ts +3 -1
  121. package/components/menu-button/menu-button.js +6 -3
  122. package/components/popover/index.js +6 -6
  123. package/components/popover/popover.js +4 -4
  124. package/components/popover/popover.trans.styles.js +2 -2
  125. package/components/rich-text/index.js +6 -3
  126. package/components/rich-text/rich-text.d.ts +3 -1
  127. package/components/rich-text/rich-text.js +6 -3
  128. package/components/segmented-control/index.js +9 -7
  129. package/components/segmented-control/segment/index.js +7 -5
  130. package/components/segmented-control/segment/segment.d.ts +3 -13
  131. package/components/segmented-control/segment/segment.js +7 -5
  132. package/components/segmented-control/segment/segment.trans.styles.js +2 -2
  133. package/components/segmented-control/segmented-control.d.ts +3 -1
  134. package/components/segmented-control/segmented-control.js +9 -7
  135. package/components/segmented-control/segmented-control.trans.styles.js +2 -2
  136. package/components/select/index.js +17 -15
  137. package/components/select/select.d.ts +31 -27
  138. package/components/select/select.js +17 -15
  139. package/components/select/select.trans.styles.js +2 -2
  140. package/components/signal/index.js +3 -3
  141. package/components/signal/signal.js +3 -3
  142. package/components/spacer/index.js +3 -3
  143. package/components/spacer/spacer.d.ts +3 -0
  144. package/components/spacer/spacer.js +3 -3
  145. package/components/text/index.js +7 -5
  146. package/components/text/text.d.ts +9 -87
  147. package/components/text/text.js +7 -5
  148. package/components/textarea/index.js +17 -15
  149. package/components/textarea/textarea.d.ts +19 -15
  150. package/components/textarea/textarea.js +17 -15
  151. package/components/theme/index.js +4 -4
  152. package/components/theme/theme.js +4 -4
  153. package/components/theme/theme.trans.styles.js +2 -2
  154. package/components/video/index.js +5 -3
  155. package/components/video/video.d.ts +5 -31
  156. package/components/video/video.js +5 -3
  157. package/index.js +63 -59
  158. package/package.json +1 -1
  159. package/primitives/field-base/field-base.js +4 -4
  160. package/primitives/field-base/index.js +4 -4
  161. package/primitives/form-control-footer/form-control-footer.js +9 -7
  162. package/primitives/form-control-footer/index.js +9 -7
  163. package/primitives/form-control-header/form-control-header.js +11 -9
  164. package/primitives/form-control-header/index.js +11 -9
  165. package/primitives/listbox/index.js +5 -5
  166. package/primitives/listbox/listbox.js +5 -5
  167. package/primitives/listbox/option.js +4 -4
  168. package/primitives/menu/index.js +5 -5
  169. package/primitives/menu/menu-heading.js +4 -4
  170. package/primitives/menu/menu-item.js +4 -4
  171. package/primitives/menu/menu.js +5 -5
  172. package/primitives/ripple/index.js +3 -3
  173. package/primitives/ripple/ripple.js +3 -3
  174. package/transitional-styles.js +2 -2
  175. package/utils/helpers/index.d.ts +1 -0
  176. package/utils/helpers/style-expression-helpers.d.ts +33 -0
  177. package/utils/mixins/declarative-layout-mixins.d.ts +69 -0
  178. package/utils/mixins/mixin-builder.d.ts +24 -0
  179. package/chunks/chunk.5SFGYE7C.js +0 -106
  180. package/chunks/chunk.N4DG6Q7H.js +0 -381
  181. /package/components/{container/container.style.d.ts → div/div.style.d.ts} +0 -0
@@ -1,18 +1,23 @@
1
1
  import {
2
- GdsContainer
3
- } from "./chunk.N4DG6Q7H.js";
2
+ GdsDiv
3
+ } from "./chunk.C6D7M75U.js";
4
+ import {
5
+ forSpaceTokens
6
+ } from "./chunk.76QWARGM.js";
4
7
  import {
5
8
  styleExpressionProperty
6
- } from "./chunk.K4KPKUH4.js";
9
+ } from "./chunk.NUUST5OZ.js";
7
10
  import {
8
11
  tokens
9
- } from "./chunk.L2TDNB6Z.js";
12
+ } from "./chunk.WBBCGR25.js";
10
13
  import {
11
14
  gdsCustomElement,
12
15
  html
13
16
  } from "./chunk.QK3R23GV.js";
14
17
  import {
15
- __decorateClass
18
+ __decorateClass,
19
+ __spreadProps,
20
+ __spreadValues
16
21
  } from "./chunk.SEHSDSX2.js";
17
22
 
18
23
  // libs/core/src/components/grid/grid.style.ts
@@ -21,6 +26,8 @@ var style = css`
21
26
  :host {
22
27
  --_c: 12;
23
28
  --_grid-col: repeat(var(--_c), 1fr);
29
+ width: 100%;
30
+ display: grid;
24
31
  grid-template-columns: var(--_grid-col);
25
32
  grid-column-gap: var(--_gap-column, 0px);
26
33
  grid-row-gap: var(--_gap-row, 0px);
@@ -42,12 +49,7 @@ var style = css`
42
49
  var grid_style_default = style;
43
50
 
44
51
  // libs/core/src/components/grid/grid.ts
45
- var GdsGrid = class extends GdsContainer {
46
- constructor() {
47
- super();
48
- this.display = "grid";
49
- this.width = "100%";
50
- }
52
+ var GdsGrid = class extends GdsDiv {
51
53
  render() {
52
54
  return html`<slot></slot>`;
53
55
  }
@@ -55,23 +57,22 @@ var GdsGrid = class extends GdsContainer {
55
57
  GdsGrid.styles = [tokens, grid_style_default];
56
58
  __decorateClass([
57
59
  styleExpressionProperty({
58
- property: "--_c",
59
- valueTemplate: (v) => v
60
+ property: "--_c"
60
61
  })
61
62
  ], GdsGrid.prototype, "columns", 2);
62
63
  __decorateClass([
63
- styleExpressionProperty({
64
+ styleExpressionProperty(__spreadProps(__spreadValues({}, forSpaceTokens), {
64
65
  styleTemplate: (_prop, values) => {
65
66
  const rowGap = values[0];
66
67
  const colGap = values[1] || rowGap;
67
68
  return `--_gap-column: ${colGap}; --_gap-row: ${rowGap};`;
68
69
  }
69
- })
70
+ }))
70
71
  ], GdsGrid.prototype, "gap", 2);
71
72
  __decorateClass([
72
73
  styleExpressionProperty({
73
74
  property: "--_col-width",
74
- valueTemplate: (v) => `${v}px`
75
+ valueTemplate: (v) => `${isNaN(v) ? v : `${v}px`}`
75
76
  })
76
77
  ], GdsGrid.prototype, "auto-columns", 2);
77
78
  GdsGrid = __decorateClass([
@@ -2,14 +2,14 @@ import {
2
2
  defaultStyles
3
3
  } from "./chunk.UEJZWDMS.js";
4
4
  import {
5
- GdsContainer
6
- } from "./chunk.N4DG6Q7H.js";
5
+ GdsDiv
6
+ } from "./chunk.C6D7M75U.js";
7
7
  import {
8
8
  styleExpressionProperty
9
- } from "./chunk.K4KPKUH4.js";
9
+ } from "./chunk.NUUST5OZ.js";
10
10
  import {
11
11
  tokens
12
- } from "./chunk.L2TDNB6Z.js";
12
+ } from "./chunk.WBBCGR25.js";
13
13
  import {
14
14
  gdsCustomElement
15
15
  } from "./chunk.QK3R23GV.js";
@@ -37,10 +37,9 @@ var style = css`
37
37
  var text_style_default = style;
38
38
 
39
39
  // libs/core/src/components/text/text.ts
40
- var GdsText = class extends GdsContainer {
40
+ var GdsText = class extends GdsDiv {
41
41
  constructor() {
42
42
  super(...arguments);
43
- this.level = "2";
44
43
  this.tag = "span";
45
44
  }
46
45
  render() {
@@ -49,17 +48,13 @@ var GdsText = class extends GdsContainer {
49
48
  }
50
49
  };
51
50
  GdsText.styles = [tokens, defaultStyles, text_style_default];
52
- __decorateClass([
53
- property()
54
- ], GdsText.prototype, "level", 2);
55
51
  __decorateClass([
56
52
  property({ type: String })
57
53
  ], GdsText.prototype, "tag", 2);
58
54
  __decorateClass([
59
55
  styleExpressionProperty({
60
- valueTemplate: (v) => `${v}`,
61
56
  selector: "[tag]",
62
- styleTemplate: (prop, values) => {
57
+ styleTemplate: (_prop, values) => {
63
58
  const size = values[0];
64
59
  const styleSize = `font-size: var(--gds-text-size-${size});`;
65
60
  const styleLine = `line-height: var(--gds-text-line-height-${size});`;
@@ -69,38 +64,20 @@ __decorateClass([
69
64
  ], GdsText.prototype, "font-size", 2);
70
65
  __decorateClass([
71
66
  styleExpressionProperty({
72
- property: "font-weight",
73
67
  selector: "[tag]",
74
68
  valueTemplate: (v) => `var(--gds-text-weight-${v})`
75
69
  })
76
70
  ], GdsText.prototype, "font-weight", 2);
77
71
  __decorateClass([
78
- styleExpressionProperty({
79
- property: "text-wrap",
80
- valueTemplate: (v) => v
81
- })
82
- ], GdsText.prototype, "text-wrap", 2);
83
- __decorateClass([
84
- styleExpressionProperty({
85
- property: "text-transform",
86
- valueTemplate: (v) => v
87
- })
72
+ styleExpressionProperty()
88
73
  ], GdsText.prototype, "text-transform", 2);
89
74
  __decorateClass([
90
75
  styleExpressionProperty({
91
- property: "text-align",
92
- valueTemplate: (v) => v
93
- })
94
- ], GdsText.prototype, "text-align", 2);
95
- __decorateClass([
96
- styleExpressionProperty({
97
- valueTemplate: (v) => v,
98
76
  selector: "[tag]"
99
77
  })
100
78
  ], GdsText.prototype, "text-decoration", 2);
101
79
  __decorateClass([
102
80
  styleExpressionProperty({
103
- valueTemplate: (v) => v,
104
81
  styleTemplate: (_prop, values) => {
105
82
  return `overflow: hidden;
106
83
  text-overflow: ellipsis;
@@ -110,19 +87,6 @@ __decorateClass([
110
87
  }
111
88
  })
112
89
  ], GdsText.prototype, "lines", 2);
113
- __decorateClass([
114
- styleExpressionProperty({
115
- property: "color",
116
- valueTemplate: function(v) {
117
- const [colorName, transparency] = v.split("/");
118
- if (transparency) {
119
- return `color-mix(in srgb, var(--gds-color-${"l" + this.level}-content-${colorName}) ${parseFloat(transparency) * 100}%, transparent 0%)`;
120
- } else {
121
- return `var(--gds-color-${"l" + this.level}-content-${colorName})`;
122
- }
123
- }
124
- })
125
- ], GdsText.prototype, "color", 2);
126
90
  GdsText = __decorateClass([
127
91
  gdsCustomElement("gds-text")
128
92
  ], GdsText);
@@ -4,13 +4,13 @@ import {
4
4
  } from "./chunk.ZRKILGXZ.js";
5
5
  import {
6
6
  TransitionalStyles
7
- } from "./chunk.S6H4MUKG.js";
7
+ } from "./chunk.LNQWCKU7.js";
8
8
  import {
9
9
  watch
10
10
  } from "./chunk.TYGMNHNO.js";
11
11
  import {
12
12
  tokens
13
- } from "./chunk.L2TDNB6Z.js";
13
+ } from "./chunk.WBBCGR25.js";
14
14
  import {
15
15
  GdsElement
16
16
  } from "./chunk.TMEWQZER.js";
@@ -1,9 +1,12 @@
1
+ import {
2
+ forColorTokens
3
+ } from "./chunk.76QWARGM.js";
1
4
  import {
2
5
  styleExpressionProperty
3
- } from "./chunk.K4KPKUH4.js";
6
+ } from "./chunk.NUUST5OZ.js";
4
7
  import {
5
8
  tokens
6
- } from "./chunk.L2TDNB6Z.js";
9
+ } from "./chunk.WBBCGR25.js";
7
10
  import {
8
11
  GdsElement
9
12
  } from "./chunk.TMEWQZER.js";
@@ -16,6 +19,7 @@ import {
16
19
  } from "./chunk.SEHSDSX2.js";
17
20
 
18
21
  // libs/core/src/components/divider/divider.ts
22
+ import { nothing } from "lit";
19
23
  import { property } from "lit/decorators.js";
20
24
 
21
25
  // libs/core/src/components/divider/divider.style.ts
@@ -43,9 +47,10 @@ var GdsDivider = class extends GdsElement {
43
47
  constructor() {
44
48
  super(...arguments);
45
49
  this.level = "2";
50
+ this.role = null;
46
51
  }
47
52
  render() {
48
- return html`<hr />`;
53
+ return html`<hr role=${this.role || nothing} />`;
49
54
  }
50
55
  };
51
56
  GdsDivider.styles = [tokens, divider_style_default];
@@ -53,30 +58,7 @@ __decorateClass([
53
58
  property()
54
59
  ], GdsDivider.prototype, "level", 2);
55
60
  __decorateClass([
56
- styleExpressionProperty({
57
- valueTemplate: function(v) {
58
- const [colorInput, transparency] = v.split("/");
59
- const isCustomColor = (color) => {
60
- const trimmedColor = color.trim();
61
- return trimmedColor.startsWith("#") || // Hex color
62
- trimmedColor.startsWith("rgb(") || // RGB color
63
- trimmedColor.startsWith("rgba(") || // RGBA color
64
- trimmedColor.startsWith("hsl(") || // HSL color
65
- trimmedColor.startsWith("hsla(");
66
- };
67
- const constructCssVariable = (level, colorName) => {
68
- return `var(--gds-color-l${level}-border-${colorName})`;
69
- };
70
- const getColorValue = (color, transparency2) => {
71
- if (isCustomColor(color)) {
72
- return transparency2 ? `color-mix(in srgb, ${color} ${parseFloat(transparency2) * 100}%, transparent 0%)` : color;
73
- } else {
74
- return constructCssVariable(this.level, color);
75
- }
76
- };
77
- return getColorValue(colorInput, transparency);
78
- }
79
- })
61
+ styleExpressionProperty(forColorTokens("border"))
80
62
  ], GdsDivider.prototype, "color", 2);
81
63
  __decorateClass([
82
64
  styleExpressionProperty({
@@ -85,11 +67,11 @@ __decorateClass([
85
67
  })
86
68
  ], GdsDivider.prototype, "size", 2);
87
69
  __decorateClass([
88
- styleExpressionProperty({
89
- property: "opacity",
90
- valueTemplate: (v) => v
91
- })
70
+ styleExpressionProperty()
92
71
  ], GdsDivider.prototype, "opacity", 2);
72
+ __decorateClass([
73
+ property()
74
+ ], GdsDivider.prototype, "role", 2);
93
75
  GdsDivider = __decorateClass([
94
76
  gdsCustomElement("gds-divider")
95
77
  ], GdsDivider);
@@ -1,12 +1,12 @@
1
1
  import {
2
- GdsContainer
3
- } from "./chunk.N4DG6Q7H.js";
2
+ GdsDiv
3
+ } from "./chunk.C6D7M75U.js";
4
4
  import {
5
5
  styleExpressionProperty
6
- } from "./chunk.K4KPKUH4.js";
6
+ } from "./chunk.NUUST5OZ.js";
7
7
  import {
8
8
  tokens
9
- } from "./chunk.L2TDNB6Z.js";
9
+ } from "./chunk.WBBCGR25.js";
10
10
  import {
11
11
  gdsCustomElement,
12
12
  html
@@ -17,14 +17,14 @@ import {
17
17
 
18
18
  // libs/core/src/components/card/card.ts
19
19
  import { css } from "lit";
20
- var GdsCard = class extends GdsContainer {
20
+ var GdsCard = class extends GdsDiv {
21
21
  /// This sets variables that are used in the default styles. Any other SEPs will override.
22
22
  constructor() {
23
23
  super();
24
24
  this.variant = "primary";
25
- this.padding = "s; m{l}";
26
- this["border-radius"] = "xs; m{s}";
27
- this["border-width"] = "4xs";
25
+ this.padding = "s;m{l}";
26
+ this["border-radius"] = "xs;m{s}";
27
+ this["gap"] = "s;m{l}";
28
28
  }
29
29
  render() {
30
30
  return html`<slot></slot>`;
@@ -34,9 +34,14 @@ GdsCard.styles = [
34
34
  tokens,
35
35
  css`
36
36
  :host {
37
+ box-sizing: border-box;
37
38
  border-color: var(--_border-color);
38
39
  background-color: var(--_background-color);
39
40
  color: var(--_color);
41
+ border-width: var(--gds-space-4xs);
42
+ border-style: solid;
43
+ display: flex;
44
+ flex-direction: column;
40
45
  }
41
46
  `
42
47
  ];
@@ -48,7 +53,6 @@ __decorateClass([
48
53
  ], GdsCard.prototype, "shadow", 2);
49
54
  __decorateClass([
50
55
  styleExpressionProperty({
51
- valueTemplate: (v) => v,
52
56
  styleTemplate: function(_prop, v) {
53
57
  return `
54
58
  --_border-color: var(--gds-color-l${this.level}-background-${v});
@@ -0,0 +1,48 @@
1
+ // libs/core/src/utils/helpers/style-expression-helpers.ts
2
+ function parseColorValue(value, context, level) {
3
+ if (value === "transparent" || value === "currentColor" || value === "inherit") {
4
+ return value;
5
+ }
6
+ const [colorName, transparency] = value.split("/");
7
+ const colorVar = `var(--gds-color-l${level}-${context}-${colorName})`;
8
+ return transparency ? `color-mix(in srgb, ${colorVar} ${parseFloat(transparency) * 100}%, transparent 0%)` : colorVar;
9
+ }
10
+ function forColorTokens(context) {
11
+ return {
12
+ valueTemplate: function(v) {
13
+ return parseColorValue(v, context, this.level);
14
+ }
15
+ };
16
+ }
17
+ var forSpaceTokens = {
18
+ valueTemplate: (value) => `var(--gds-space-${value}, 0)`
19
+ };
20
+ var forSpaceTokensAndCustomValues = {
21
+ valueTemplate: (value) => `var(--gds-space-${sanitizeVariableName(value)}, ${value})`
22
+ };
23
+ var forSpaceTokensSupportingNegative = {
24
+ valueTemplate: (v) => {
25
+ const sign = v.startsWith("-") ? "neg" : "pos";
26
+ const val = sign == "pos" ? `var(--gds-space-${v})` : `calc(var(--gds-space-${v.substring(1)}) * -1)`;
27
+ return v === "auto" ? "auto" : val;
28
+ },
29
+ styleTemplate: (prop, values) => {
30
+ const transformValue = (v) => v === "auto" ? "auto" : `${v}`;
31
+ const top = transformValue(values[0]);
32
+ const right = values.length > 1 ? transformValue(values[1]) : top;
33
+ const bottom = values.length > 2 ? transformValue(values[2]) : top;
34
+ const left = values.length > 3 ? transformValue(values[3]) : right;
35
+ return `${prop}: ${top} ${right} ${bottom} ${left};`;
36
+ }
37
+ };
38
+ function sanitizeVariableName(name) {
39
+ return name.replace(/[^a-zA-Z0-9-]/g, "");
40
+ }
41
+
42
+ export {
43
+ parseColorValue,
44
+ forColorTokens,
45
+ forSpaceTokens,
46
+ forSpaceTokensAndCustomValues,
47
+ forSpaceTokensSupportingNegative
48
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TransitionalStyles
3
- } from "./chunk.S6H4MUKG.js";
3
+ } from "./chunk.LNQWCKU7.js";
4
4
  import {
5
5
  GdsElement
6
6
  } from "./chunk.TMEWQZER.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk.ZRKILGXZ.js";
5
5
  import {
6
6
  TransitionalStyles
7
- } from "./chunk.S6H4MUKG.js";
7
+ } from "./chunk.LNQWCKU7.js";
8
8
  import {
9
9
  GdsElement
10
10
  } from "./chunk.TMEWQZER.js";
@@ -4,12 +4,17 @@ import {
4
4
  import {
5
5
  observeLightDOM
6
6
  } from "./chunk.WM7HBMMV.js";
7
+ import {
8
+ withLayoutChildProps,
9
+ withMarginProps,
10
+ withSizeXProps
11
+ } from "./chunk.G2WTHFPE.js";
7
12
  import {
8
13
  TransitionalStyles
9
- } from "./chunk.S6H4MUKG.js";
14
+ } from "./chunk.LNQWCKU7.js";
10
15
  import {
11
16
  tokens
12
- } from "./chunk.L2TDNB6Z.js";
17
+ } from "./chunk.WBBCGR25.js";
13
18
  import {
14
19
  gdsCustomElement,
15
20
  html
@@ -398,7 +403,7 @@ var button_style_default = `@layer tokens, core, a11y, ranks, sizes, variants, d
398
403
  var ariaForwards = ["aria-label", "aria-haspopup", "aria-expanded"];
399
404
  var html2 = stripWhitespace(html);
400
405
  var _isIconButton, _isLink, isLink_get, _defaultRel, defaultRel_get, _mainSlotChange, _handleClick;
401
- var GdsButton = class extends GdsFormControlElement {
406
+ var Button = class extends GdsFormControlElement {
402
407
  constructor() {
403
408
  super();
404
409
  __privateAdd(this, _isLink);
@@ -500,50 +505,50 @@ defaultRel_get = function() {
500
505
  };
501
506
  _mainSlotChange = new WeakMap();
502
507
  _handleClick = new WeakMap();
503
- GdsButton.styles = [tokens, unsafeCSS(button_style_default)];
508
+ Button.styles = [tokens, unsafeCSS(button_style_default)];
504
509
  /**
505
510
  * @internal
506
511
  */
507
- GdsButton.shadowRootOptions = {
512
+ Button.shadowRootOptions = {
508
513
  mode: "open",
509
514
  delegatesFocus: true
510
515
  };
511
516
  __decorateClass([
512
517
  property({ type: Boolean, reflect: true })
513
- ], GdsButton.prototype, "disabled", 2);
518
+ ], Button.prototype, "disabled", 2);
514
519
  __decorateClass([
515
520
  property({ reflect: true })
516
- ], GdsButton.prototype, "type", 2);
521
+ ], Button.prototype, "type", 2);
517
522
  __decorateClass([
518
523
  property({ reflect: true })
519
- ], GdsButton.prototype, "rank", 2);
524
+ ], Button.prototype, "rank", 2);
520
525
  __decorateClass([
521
526
  property({ reflect: true })
522
- ], GdsButton.prototype, "variant", 2);
527
+ ], Button.prototype, "variant", 2);
523
528
  __decorateClass([
524
529
  property({ reflect: true })
525
- ], GdsButton.prototype, "size", 2);
530
+ ], Button.prototype, "size", 2);
526
531
  __decorateClass([
527
532
  property()
528
- ], GdsButton.prototype, "label", 2);
533
+ ], Button.prototype, "label", 2);
529
534
  __decorateClass([
530
535
  property()
531
- ], GdsButton.prototype, "href", 2);
536
+ ], Button.prototype, "href", 2);
532
537
  __decorateClass([
533
538
  property()
534
- ], GdsButton.prototype, "target", 2);
539
+ ], Button.prototype, "target", 2);
535
540
  __decorateClass([
536
541
  property()
537
- ], GdsButton.prototype, "rel", 2);
542
+ ], Button.prototype, "rel", 2);
538
543
  __decorateClass([
539
544
  property()
540
- ], GdsButton.prototype, "download", 2);
545
+ ], Button.prototype, "download", 2);
541
546
  __decorateClass([
542
547
  query("slot:not([name])")
543
- ], GdsButton.prototype, "_mainSlot", 2);
548
+ ], Button.prototype, "_mainSlot", 2);
544
549
  __decorateClass([
545
550
  query(".button")
546
- ], GdsButton.prototype, "_button", 2);
551
+ ], Button.prototype, "_button", 2);
547
552
  __decorateClass([
548
553
  observeLightDOM({
549
554
  attributes: true,
@@ -551,7 +556,11 @@ __decorateClass([
551
556
  subtree: false,
552
557
  characterData: false
553
558
  })
554
- ], GdsButton.prototype, "_attributeChanged", 1);
559
+ ], Button.prototype, "_attributeChanged", 1);
560
+ var GdsButton = class extends withSizeXProps(
561
+ withMarginProps(withLayoutChildProps(Button))
562
+ ) {
563
+ };
555
564
  GdsButton = __decorateClass([
556
565
  gdsCustomElement("gds-button")
557
566
  ], GdsButton);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TransitionalStyles
3
- } from "./chunk.S6H4MUKG.js";
3
+ } from "./chunk.LNQWCKU7.js";
4
4
  import {
5
5
  watch
6
6
  } from "./chunk.TYGMNHNO.js";