@sebgroup/green-core 2.6.3 → 2.6.4

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,4 +1,4 @@
1
- import { GdsButton } from '../button';
1
+ import { GdsButton } from '../button/button.component';
2
2
  declare const GdsFab_base: (new (...args: any[]) => import("../../utils/mixins/declarative-layout-mixins").PositioningProps) & typeof GdsButton;
3
3
  /**
4
4
  * @element gds-fab
@@ -3,7 +3,7 @@ import {
3
3
  } from "../../chunks/chunk.QU3DSPNU.js";
4
4
  import { gdsCustomElement } from "../../scoping.js";
5
5
  import { withPositioningProps } from "../../utils/mixins/declarative-layout-mixins.js";
6
- import { GdsButton } from "../button/index.js";
6
+ import { GdsButton } from "../button/button.component.js";
7
7
  import FABStyles from "./fab.styles.js";
8
8
  let GdsFab = class extends withPositioningProps(GdsButton) {
9
9
  connectedCallback() {
@@ -12,6 +12,10 @@ const style = css`
12
12
  block-size: calc(var(--_block-size) + var(--gds-sys-space-xs));
13
13
  width: max-content;
14
14
  }
15
+
16
+ ::slotted([gds-element='gds-signal']) {
17
+ margin-left: var(--gds-sys-space-xs);
18
+ }
15
19
  `;
16
20
  var fab_styles_default = style;
17
21
  export {
@@ -33,6 +33,7 @@ __decorateClass([
33
33
  ], GdsGrid.prototype, "gap", 2);
34
34
  __decorateClass([
35
35
  styleExpressionProperty({
36
+ reflect: true,
36
37
  property: "--_col-width",
37
38
  valueTemplate: (v) => `${isNaN(v) ? v : `${v}px`}`
38
39
  })
package/gds-element.js CHANGED
@@ -14,7 +14,7 @@ class GdsElement extends LitElement {
14
14
  /**
15
15
  * The semantic version of this element. Can be used for troubleshooting to verify the version being used.
16
16
  */
17
- this.semanticVersion = "2.6.3";
17
+ this.semanticVersion = "2.6.4";
18
18
  this._isUsingTransitionalStyles = false;
19
19
  this._dynamicStylesController = new DynamicStylesController(this);
20
20
  }
@@ -52,8 +52,8 @@ export * from './formatted-number/index.js';
52
52
  export * from './radio-group/index.js';
53
53
  export * from './segment/index.js';
54
54
  export * from './sensitive-account/index.js';
55
- export * from './sensitive-number/index.js';
56
55
  export * from './sensitive-date/index.js';
56
+ export * from './sensitive-number/index.js';
57
57
  export * from './icons/icon-ai/index.js';
58
58
  export * from './icons/icon-airplane-up/index.js';
59
59
  export * from './icons/icon-archive/index.js';
@@ -52,8 +52,8 @@ export * from "./formatted-number/index.js";
52
52
  export * from "./radio-group/index.js";
53
53
  export * from "./segment/index.js";
54
54
  export * from "./sensitive-account/index.js";
55
- export * from "./sensitive-number/index.js";
56
55
  export * from "./sensitive-date/index.js";
56
+ export * from "./sensitive-number/index.js";
57
57
  export * from "./icons/icon-ai/index.js";
58
58
  export * from "./icons/icon-airplane-up/index.js";
59
59
  export * from "./icons/icon-archive/index.js";
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": "2.6.3",
4
+ "version": "2.6.4",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
7
7
  "type": "module",
@@ -23,6 +23,10 @@ export type StyleExpressionPropertyOptions = {
23
23
  * components with different style or value templates.
24
24
  */
25
25
  cacheOverrideKey?: string;
26
+ /**
27
+ * If true, mirror the property value to a DOM attribute (for CSS selectors).
28
+ */
29
+ reflect?: boolean;
26
30
  };
27
31
  /**
28
32
  * A decorator that can be used to create a Style Expression Property.
@@ -9,17 +9,26 @@ function styleExpressionProperty(options) {
9
9
  const valueTemplate = options?.valueTemplate;
10
10
  const styleTemplate = options?.styleTemplate;
11
11
  const cacheKey = options?.cacheOverrideKey ?? `0`;
12
- property({ attribute: options?.attribute, noAccessor: true })(
13
- proto,
14
- descriptor
15
- );
12
+ const attributeName = options?.attribute ?? String(descriptor);
13
+ property({
14
+ attribute: attributeName,
15
+ reflect: options?.reflect,
16
+ noAccessor: true
17
+ })(proto, descriptor);
16
18
  Object.defineProperty(proto, descriptor, {
17
19
  get: function() {
18
20
  return this["__" + String(descriptor)];
19
21
  },
20
22
  set: async function(newValue) {
21
- if (!newValue) return;
23
+ newValue = newValue?.toString().trim() ?? "";
22
24
  this["__" + String(descriptor)] = newValue;
25
+ if (options?.reflect) {
26
+ if (!newValue) {
27
+ this.removeAttribute(attributeName);
28
+ } else {
29
+ this.setAttribute(attributeName, String(newValue));
30
+ }
31
+ }
23
32
  await this.updateComplete;
24
33
  const sel = options?.selector ?? this.constructor.styleExpressionBaseSelector;
25
34
  const lvl = this.level ?? "0";
@@ -1,6 +1,6 @@
1
1
  import "../../chunks/chunk.QU3DSPNU.js";
2
2
  import { html as litHtml } from "lit";
3
- const VER_SUFFIX = "-e22c76";
3
+ const VER_SUFFIX = "-838d82";
4
4
  class ScopedElementRegistry {
5
5
  static get instance() {
6
6
  if (!globalThis.__gdsElementLookupTable?.[VER_SUFFIX])