dap-design-system 0.51.0 → 0.52.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.
@@ -0,0 +1,24 @@
1
+ import { DdsElement } from '../../internal/dds-hu-element';
2
+ /**
3
+ * `dap-ds-option-group`
4
+ * @summary An option group is a container for grouping related option items.
5
+ * Used with dap-ds-select to create grouped options that render as native optgroup elements.
6
+ * @element dap-ds-option-group
7
+ * @title - Option group
8
+ *
9
+ * @property {string} label - The label of the option group (displayed in native optgroup).
10
+ * @property {boolean} disabled - Whether all options in the group are disabled.
11
+ *
12
+ * @slot - The option items in this group.
13
+ *
14
+ * @csspart base - The main option group container.
15
+ * @csspart label - The label of the option group.
16
+ */
17
+ export default class DapDSOptionGroup extends DdsElement {
18
+ /** The label of the option group */
19
+ label?: string;
20
+ /** Whether all options in the group are disabled */
21
+ disabled?: boolean;
22
+ static readonly styles: import('lit').CSSResult;
23
+ render(): import('lit-html').TemplateResult<1>;
24
+ }
@@ -0,0 +1,8 @@
1
+ import { default as DapDSOptionGroup } from './option-group.component.js';
2
+ export * from './option-group.component.js';
3
+ export default DapDSOptionGroup;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'dap-ds-option-group': DapDSOptionGroup;
7
+ }
8
+ }
@@ -0,0 +1,57 @@
1
+ import { DdsElement } from '../../internal/dds-hu-element';
2
+ export type ScrollProgressVariant = 'neutral' | 'brand' | 'negative' | 'positive' | 'inverted';
3
+ export type ScrollProgressSize = 'xs' | 'sm' | 'md';
4
+ /**
5
+ * `dap-ds-scroll-progress`
6
+ * @summary A progress bar that displays scroll position, supporting both page-level and container-level scroll tracking.
7
+ * @element dap-ds-scroll-progress
8
+ * @title - Scroll Progress
9
+ *
10
+ * @csspart base - The main scroll progress container.
11
+ * @csspart track - The progress track (background).
12
+ * @csspart fill - The progress fill bar.
13
+ *
14
+ * @cssprop --dds-scroll-progress-z-index - Z-index for fixed positioning (default: 1000)
15
+ * @cssprop --dds-scroll-progress-transition - Transition for progress updates (default: width 0.1s ease-out)
16
+ * @cssprop --dds-scroll-progress-track-color - Background color of the progress track (default: var(--dds-neutral-200))
17
+ * @cssprop --dds-scroll-progress-fill-color-neutral - Fill color for neutral variant
18
+ * @cssprop --dds-scroll-progress-fill-color-brand - Fill color for brand variant
19
+ * @cssprop --dds-scroll-progress-fill-color-negative - Fill color for negative variant
20
+ * @cssprop --dds-scroll-progress-fill-color-positive - Fill color for positive variant
21
+ * @cssprop --dds-scroll-progress-fill-color-inverted - Fill color for inverted variant
22
+ *
23
+ */
24
+ export default class DapDSScrollProgress extends DdsElement {
25
+ /**
26
+ * CSS selector for scroll container. If not set, tracks global page scroll.
27
+ * When set, the component uses sticky positioning within the container.
28
+ */
29
+ target?: string;
30
+ /**
31
+ * The color variant of the progress indicator.
32
+ * @type {"neutral" | "brand" | "negative" | "positive" | "inverted"}
33
+ */
34
+ variant: ScrollProgressVariant;
35
+ /**
36
+ * The size of the progress bar.
37
+ * @type {"xs" | "sm" | "md"}
38
+ */
39
+ size: ScrollProgressSize;
40
+ /**
41
+ * Current progress value (0-100).
42
+ */
43
+ private progress;
44
+ private targetElement;
45
+ private rafId;
46
+ private boundHandleScroll;
47
+ static readonly styles: import('lit').CSSResult;
48
+ constructor();
49
+ connectedCallback(): void;
50
+ disconnectedCallback(): void;
51
+ protected updated(changedProperties: Map<PropertyKey, unknown>): void;
52
+ private setupScrollListener;
53
+ private cleanupScrollListener;
54
+ private handleScroll;
55
+ private calculateProgress;
56
+ render(): import('lit-html').TemplateResult<1>;
57
+ }
@@ -1,5 +1,6 @@
1
1
  import { FloatingStrategy, PopupPlacement } from '../../common/types';
2
2
  import { GenericFormElement } from '../../internal/mixin/genericFormElement';
3
+ import { default as DapDSOptionItem } from '../option-item/option-item.component';
3
4
  import { default as DapDSOptionList } from '../option-list/option-list.component';
4
5
  /**
5
6
  * `dap-ds-select`
@@ -100,6 +101,8 @@ export default class DapDSSelect extends GenericFormElement {
100
101
  sync?: boolean;
101
102
  /** Whether the select is in mobile mode. */
102
103
  isMobile?: boolean;
104
+ /** Whether to render a native HTML select element for mobile-friendly option selection. */
105
+ native?: boolean;
103
106
  /** The loading state of the select. */
104
107
  loading?: boolean;
105
108
  /** The max heigth of the select dropdown. */
@@ -138,7 +141,7 @@ export default class DapDSSelect extends GenericFormElement {
138
141
  * Get the active descendant element for aria-activedescendant
139
142
  * Returns the currently focused option when dropdown is open, otherwise null
140
143
  */
141
- getActiveDescendant(): import('../option-item/option-item.component').default | null | undefined;
144
+ getActiveDescendant(): DapDSOptionItem | null | undefined;
142
145
  /**
143
146
  * Get the aria-describedby value, combining description and feedback IDs
144
147
  */
@@ -153,6 +156,11 @@ export default class DapDSSelect extends GenericFormElement {
153
156
  handleInvalid(event: Event): void;
154
157
  private readonly handleSelectedChange;
155
158
  private readonly handleOptionDeselect;
159
+ private readonly handleNativeChange;
160
+ private renderNativeOption;
161
+ private renderNativeOptgroup;
162
+ private renderNativeOptions;
163
+ private renderNativeSelect;
156
164
  renderTriggerElement(): import('lit-html').TemplateResult;
157
165
  renderOptionList(): import('lit-html').TemplateResult;
158
166
  render(): import('lit-html').TemplateResult;