@telperion/elements 5.2.0 → 5.4.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.
@@ -101,5 +101,5 @@
101
101
  }
102
102
  }
103
103
  ],
104
- "generatedAt": "2026-05-07T12:41:20.638Z"
104
+ "generatedAt": "2026-05-11T14:09:29.013Z"
105
105
  }
package/README.md CHANGED
@@ -223,11 +223,13 @@ Form-associated, framework-agnostic selectbox built on `<tp-popover>`. Single-se
223
223
  **Features:**
224
224
  - Form-associated custom element with full `<form>` integration via `ElementInternals` (`name`, `disabled`, `required`, reset/restore callbacks, `validity`)
225
225
  - `max` attribute &mdash; `1` for single-select, any positive integer for multi-select with FIFO eviction at the cap, or `infinite` for unbounded selection
226
+ - `min` attribute &mdash; lower-bound floor; user-driven deselection is ignored once the selection size hits `min`
226
227
  - Single-select submits a string; multi-select submits a `FormData` with one entry per value (matching native `<select multiple>`)
227
228
  - Auto-closes the popover when a selection fills the quota; stays open while accumulating in multi-select
228
229
  - Three slots: `slot="button"` (replace trigger), `slot="popover"` (replace panel content while keeping `<tp-option>` children registered for selection / validation / submission), and the default slot (option list)
229
230
  - `<tp-selected-content>` works anywhere in the descendant composed tree &mdash; including across shadow DOM boundaries
230
231
  - Signal-driven re-rendering via the `SignalWatcher` mixin &mdash; no manual change listeners
232
+ - Palette-driven selection highlight via the shared shade-mixer mixin: pick a `color` token (`primary`, `secondary`, `success`, &hellip;) and tune intensity with `shade` (`0`&ndash;`1000`); flows into `--tp-select-selection-color` / `--tp-select-selection-contrast-color`
231
233
 
232
234
  #### JS/TS
233
235
  ```ts
@@ -0,0 +1,50 @@
1
+ import { LitElement } from 'lit';
2
+
3
+ type PredefinedColors = "contrast" | "primary" | "secondary" | "tertiary" | "quaternary" | "success" | "danger" | "warning" | "neutral";
4
+ type ShadeMixerType = "none" | "black" | "white";
5
+ /**
6
+ * Base class that powers Telperion's shared color/design system.
7
+ *
8
+ * Elements that extend `ShadeMixerLitElement` participate in a fully themable
9
+ * palette driven entirely by CSS custom properties. The class:
10
+ *
11
+ * 1. Auto-injects a default palette onto `:root` &mdash; `--tp-color-white`,
12
+ * `--tp-color-black`, `--tp-color-contrast`, `--tp-color-primary`,
13
+ * `--tp-color-secondary`, `--tp-color-tertiary`, `--tp-color-quaternary`,
14
+ * `--tp-color-success`, `--tp-color-danger`, `--tp-color-warning`, and
15
+ * `--tp-color-neutral`. Override any of them at `:root` or any ancestor to
16
+ * re-theme every shade-mixer-aware element underneath.
17
+ * 2. Exposes `shadedElementStyles` &mdash; a `css` block that resolves the
18
+ * selected `color` to `--tp-element-color`, applies the `shade`/`mixer`
19
+ * math, and exposes the result as `--tp-calc-element-color` and
20
+ * `--tp-calc-contrast-color` for consumers (variants, hover, focus, …).
21
+ * Subclasses include it once in their own host rule.
22
+ * 3. Provides three reflected attributes that drive the math:
23
+ * - `color` &mdash; palette token name (predefined or custom).
24
+ * - `shade` (`0`&ndash;`1000`, default `500`) &mdash; lighten/darken the
25
+ * resolved color (`<500` mixes white, `>500` mixes black).
26
+ * - `mixer` (`none` / `black` / `white`) &mdash; read-only output, auto-set
27
+ * whenever `shade` changes.
28
+ *
29
+ * **Adding custom color tokens.** If the predefined names are not enough,
30
+ * declare a new selector that supplies `--tp-element-color`:
31
+ *
32
+ * ```css
33
+ * tp-button[color="brand"] {
34
+ * --tp-element-color: hsl(265 75% 45%);
35
+ * }
36
+ * ```
37
+ *
38
+ * The shade math, hover/focus styles, and contrast color all derive from this
39
+ * one variable, so the new token "just works" with `shade`, `variant`, etc.
40
+ */
41
+ declare class ShadeMixerLitElement extends LitElement {
42
+ static rootStyles: any;
43
+ static shadedElementStyles: any;
44
+ color: PredefinedColors | string;
45
+ shade: number;
46
+ mixer: ShadeMixerType;
47
+ protected willUpdate(changed: Map<string, unknown>): void;
48
+ }
49
+
50
+ export { ShadeMixerLitElement as S };
@@ -0,0 +1,50 @@
1
+ import { LitElement } from 'lit';
2
+
3
+ type PredefinedColors = "contrast" | "primary" | "secondary" | "tertiary" | "quaternary" | "success" | "danger" | "warning" | "neutral";
4
+ type ShadeMixerType = "none" | "black" | "white";
5
+ /**
6
+ * Base class that powers Telperion's shared color/design system.
7
+ *
8
+ * Elements that extend `ShadeMixerLitElement` participate in a fully themable
9
+ * palette driven entirely by CSS custom properties. The class:
10
+ *
11
+ * 1. Auto-injects a default palette onto `:root` &mdash; `--tp-color-white`,
12
+ * `--tp-color-black`, `--tp-color-contrast`, `--tp-color-primary`,
13
+ * `--tp-color-secondary`, `--tp-color-tertiary`, `--tp-color-quaternary`,
14
+ * `--tp-color-success`, `--tp-color-danger`, `--tp-color-warning`, and
15
+ * `--tp-color-neutral`. Override any of them at `:root` or any ancestor to
16
+ * re-theme every shade-mixer-aware element underneath.
17
+ * 2. Exposes `shadedElementStyles` &mdash; a `css` block that resolves the
18
+ * selected `color` to `--tp-element-color`, applies the `shade`/`mixer`
19
+ * math, and exposes the result as `--tp-calc-element-color` and
20
+ * `--tp-calc-contrast-color` for consumers (variants, hover, focus, …).
21
+ * Subclasses include it once in their own host rule.
22
+ * 3. Provides three reflected attributes that drive the math:
23
+ * - `color` &mdash; palette token name (predefined or custom).
24
+ * - `shade` (`0`&ndash;`1000`, default `500`) &mdash; lighten/darken the
25
+ * resolved color (`<500` mixes white, `>500` mixes black).
26
+ * - `mixer` (`none` / `black` / `white`) &mdash; read-only output, auto-set
27
+ * whenever `shade` changes.
28
+ *
29
+ * **Adding custom color tokens.** If the predefined names are not enough,
30
+ * declare a new selector that supplies `--tp-element-color`:
31
+ *
32
+ * ```css
33
+ * tp-button[color="brand"] {
34
+ * --tp-element-color: hsl(265 75% 45%);
35
+ * }
36
+ * ```
37
+ *
38
+ * The shade math, hover/focus styles, and contrast color all derive from this
39
+ * one variable, so the new token "just works" with `shade`, `variant`, etc.
40
+ */
41
+ declare class ShadeMixerLitElement extends LitElement {
42
+ static rootStyles: any;
43
+ static shadedElementStyles: any;
44
+ color: PredefinedColors | string;
45
+ shade: number;
46
+ mixer: ShadeMixerType;
47
+ protected willUpdate(changed: Map<string, unknown>): void;
48
+ }
49
+
50
+ export { ShadeMixerLitElement as S };
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import { S as ShadeMixerLitElement } from './shade-mixer-lit-element-sw8t_VC5.js';
2
3
 
3
4
  interface EffectOptions {
4
5
  /**
@@ -24,6 +25,11 @@ declare const SignalWatcherLitElement: ({
24
25
  updateEffect(fn: () => void, options?: EffectOptions): () => void;
25
26
  };
26
27
  });
28
+ declare const ShadeMixerSignalWatcherLitElement: ({
29
+ new (): ShadeMixerLitElement & {
30
+ updateEffect(fn: () => void, options?: EffectOptions): () => void;
31
+ };
32
+ });
27
33
 
28
- export { SignalWatcherLitElement as S };
34
+ export { SignalWatcherLitElement as S, ShadeMixerSignalWatcherLitElement as a };
29
35
  export type { EffectOptions as E };
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import { S as ShadeMixerLitElement } from './shade-mixer-lit-element-sw8t_VC5.cjs';
2
3
 
3
4
  interface EffectOptions {
4
5
  /**
@@ -24,6 +25,11 @@ declare const SignalWatcherLitElement: ({
24
25
  updateEffect(fn: () => void, options?: EffectOptions): () => void;
25
26
  };
26
27
  });
28
+ declare const ShadeMixerSignalWatcherLitElement: ({
29
+ new (): ShadeMixerLitElement & {
30
+ updateEffect(fn: () => void, options?: EffectOptions): () => void;
31
+ };
32
+ });
27
33
 
28
- export { SignalWatcherLitElement as S };
34
+ export { SignalWatcherLitElement as S, ShadeMixerSignalWatcherLitElement as a };
29
35
  export type { EffectOptions as E };
@@ -1,51 +1,5 @@
1
- import { LitElement } from 'lit';
2
-
3
- type PredefinedColors = "contrast" | "primary" | "secondary" | "tertiary" | "quaternary" | "success" | "danger" | "warning" | "neutral";
4
- type ShadeMixerType = "none" | "black" | "white";
5
- /**
6
- * Base class that powers Telperion's shared color/design system.
7
- *
8
- * Elements that extend `ShadeMixerLitElement` participate in a fully themable
9
- * palette driven entirely by CSS custom properties. The class:
10
- *
11
- * 1. Auto-injects a default palette onto `:root` &mdash; `--tp-color-white`,
12
- * `--tp-color-black`, `--tp-color-contrast`, `--tp-color-primary`,
13
- * `--tp-color-secondary`, `--tp-color-tertiary`, `--tp-color-quaternary`,
14
- * `--tp-color-success`, `--tp-color-danger`, `--tp-color-warning`, and
15
- * `--tp-color-neutral`. Override any of them at `:root` or any ancestor to
16
- * re-theme every shade-mixer-aware element underneath.
17
- * 2. Exposes `shadedElementStyles` &mdash; a `css` block that resolves the
18
- * selected `color` to `--tp-element-color`, applies the `shade`/`mixer`
19
- * math, and exposes the result as `--tp-calc-element-color` and
20
- * `--tp-calc-contrast-color` for consumers (variants, hover, focus, …).
21
- * Subclasses include it once in their own host rule.
22
- * 3. Provides three reflected attributes that drive the math:
23
- * - `color` &mdash; palette token name (predefined or custom).
24
- * - `shade` (`0`&ndash;`1000`, default `500`) &mdash; lighten/darken the
25
- * resolved color (`<500` mixes white, `>500` mixes black).
26
- * - `mixer` (`none` / `black` / `white`) &mdash; read-only output, auto-set
27
- * whenever `shade` changes.
28
- *
29
- * **Adding custom color tokens.** If the predefined names are not enough,
30
- * declare a new selector that supplies `--tp-element-color`:
31
- *
32
- * ```css
33
- * tp-button[color="brand"] {
34
- * --tp-element-color: hsl(265 75% 45%);
35
- * }
36
- * ```
37
- *
38
- * The shade math, hover/focus styles, and contrast color all derive from this
39
- * one variable, so the new token "just works" with `shade`, `variant`, etc.
40
- */
41
- declare class ShadeMixerLitElement extends LitElement {
42
- static rootStyles: any;
43
- static shadedElementStyles: any;
44
- color: PredefinedColors | string;
45
- shade: number;
46
- mixer: ShadeMixerType;
47
- protected willUpdate(changed: Map<string, unknown>): void;
48
- }
1
+ import { S as ShadeMixerLitElement } from '../_chunks/shade-mixer-lit-element-sw8t_VC5.cjs';
2
+ import 'lit';
49
3
 
50
4
  /**
51
5
  * Visual treatment applied by `<tp-button>`.
package/button/index.d.ts CHANGED
@@ -1,51 +1,5 @@
1
- import { LitElement } from 'lit';
2
-
3
- type PredefinedColors = "contrast" | "primary" | "secondary" | "tertiary" | "quaternary" | "success" | "danger" | "warning" | "neutral";
4
- type ShadeMixerType = "none" | "black" | "white";
5
- /**
6
- * Base class that powers Telperion's shared color/design system.
7
- *
8
- * Elements that extend `ShadeMixerLitElement` participate in a fully themable
9
- * palette driven entirely by CSS custom properties. The class:
10
- *
11
- * 1. Auto-injects a default palette onto `:root` &mdash; `--tp-color-white`,
12
- * `--tp-color-black`, `--tp-color-contrast`, `--tp-color-primary`,
13
- * `--tp-color-secondary`, `--tp-color-tertiary`, `--tp-color-quaternary`,
14
- * `--tp-color-success`, `--tp-color-danger`, `--tp-color-warning`, and
15
- * `--tp-color-neutral`. Override any of them at `:root` or any ancestor to
16
- * re-theme every shade-mixer-aware element underneath.
17
- * 2. Exposes `shadedElementStyles` &mdash; a `css` block that resolves the
18
- * selected `color` to `--tp-element-color`, applies the `shade`/`mixer`
19
- * math, and exposes the result as `--tp-calc-element-color` and
20
- * `--tp-calc-contrast-color` for consumers (variants, hover, focus, …).
21
- * Subclasses include it once in their own host rule.
22
- * 3. Provides three reflected attributes that drive the math:
23
- * - `color` &mdash; palette token name (predefined or custom).
24
- * - `shade` (`0`&ndash;`1000`, default `500`) &mdash; lighten/darken the
25
- * resolved color (`<500` mixes white, `>500` mixes black).
26
- * - `mixer` (`none` / `black` / `white`) &mdash; read-only output, auto-set
27
- * whenever `shade` changes.
28
- *
29
- * **Adding custom color tokens.** If the predefined names are not enough,
30
- * declare a new selector that supplies `--tp-element-color`:
31
- *
32
- * ```css
33
- * tp-button[color="brand"] {
34
- * --tp-element-color: hsl(265 75% 45%);
35
- * }
36
- * ```
37
- *
38
- * The shade math, hover/focus styles, and contrast color all derive from this
39
- * one variable, so the new token "just works" with `shade`, `variant`, etc.
40
- */
41
- declare class ShadeMixerLitElement extends LitElement {
42
- static rootStyles: any;
43
- static shadedElementStyles: any;
44
- color: PredefinedColors | string;
45
- shade: number;
46
- mixer: ShadeMixerType;
47
- protected willUpdate(changed: Map<string, unknown>): void;
48
- }
1
+ import { S as ShadeMixerLitElement } from '../_chunks/shade-mixer-lit-element-sw8t_VC5.js';
2
+ import 'lit';
49
3
 
50
4
  /**
51
5
  * Visual treatment applied by `<tp-button>`.