@ds-mo/ui 2.15.0 → 3.0.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.
- package/dist/.build-stamp +1 -1
- package/dist/components/ds-app-shell.js +1 -1
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-banner.js +1 -1
- package/dist/components/ds-banner.js.map +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-nav.js.map +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/ds-card-data-viz-donut.js +1 -1
- package/dist/components/ds-card-data-viz-donut.js.map +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-card.js +1 -1
- package/dist/components/ds-chart-bar.js +1 -1
- package/dist/components/ds-chart-donut.js +1 -1
- package/dist/components/ds-chart-donut.js.map +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart-legend.js.map +1 -1
- package/dist/components/ds-chart-line.js +1 -1
- package/dist/components/ds-checkbox.js +1 -1
- package/dist/components/ds-checkbox.js.map +1 -1
- package/dist/components/ds-chip.js +1 -1
- package/dist/components/ds-chip.js.map +1 -1
- package/dist/components/ds-divider.js +1 -1
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-empty-state.js.map +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-icon.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-input.js.map +1 -1
- package/dist/components/ds-loader.js +1 -1
- package/dist/components/ds-loader.js.map +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-modal.js.map +1 -1
- package/dist/components/ds-pagination.js +1 -1
- package/dist/components/ds-pagination.js.map +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-nav.js.map +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-panel-tools.js.map +1 -1
- package/dist/components/ds-radio-group.js +1 -1
- package/dist/components/ds-radio-group.js.map +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-select.js.map +1 -1
- package/dist/components/ds-shell-gradient-picker.js +1 -1
- package/dist/components/ds-shell-gradient-swatch.js +1 -1
- package/dist/components/ds-slider.js +1 -1
- package/dist/components/ds-tab-group-nav.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-tab-group.js.map +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-table.js.map +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-tag.js.map +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-toggle.js +1 -1
- package/dist/components/ds-tooltip-data-viz.js +1 -1
- package/dist/components/ds-tooltip-data-viz.js.map +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/p-8WTsyLQ9.js +2 -0
- package/dist/components/p-8WTsyLQ9.js.map +1 -0
- package/dist/components/{p-CyFVn2Sc.js → p-9Qu1ls2y.js} +2 -2
- package/dist/components/p-BSNlp8Di.js +2 -0
- package/dist/components/p-BSNlp8Di.js.map +1 -0
- package/dist/components/p-BVNJnFI9.js +2 -0
- package/dist/components/p-BVNJnFI9.js.map +1 -0
- package/dist/components/p-B_ENgncs.js +2 -0
- package/dist/components/p-B_ENgncs.js.map +1 -0
- package/dist/components/p-CNgNgezy.js +2 -0
- package/dist/components/p-CNgNgezy.js.map +1 -0
- package/dist/components/p-CQmul5NK.js +2 -0
- package/dist/components/{p-DujEDZ7f.js.map → p-CQmul5NK.js.map} +1 -1
- package/dist/components/p-CsaW5gDM.js +2 -0
- package/dist/components/{p-C3ORQUOp.js.map → p-CsaW5gDM.js.map} +1 -1
- package/dist/components/{p-BvF44IQK.js → p-Cx-ywr1e.js} +1 -1
- package/dist/components/p-Cx-ywr1e.js.map +1 -0
- package/dist/components/p-DQ3l2TXw.js +2 -0
- package/dist/components/p-DQ3l2TXw.js.map +1 -0
- package/dist/components/p-DRqJ3RUb.js +2 -0
- package/dist/components/p-DRqJ3RUb.js.map +1 -0
- package/dist/components/p-V2qW8NL0.js +2 -0
- package/dist/components/p-V2qW8NL0.js.map +1 -0
- package/dist/components/p-sBx2MuF2.js +2 -0
- package/dist/components/p-sBx2MuF2.js.map +1 -0
- package/dist/lib/utils/control-text.d.ts +4 -4
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.js.map +2 -2
- package/dist/types/components/ChartDonut/ChartDonut.d.ts +2 -7
- package/dist/types/components/Loader/Loader.d.ts +7 -3
- package/dist/types/components/Loader/index.d.ts +1 -1
- package/dist/types/components/Text/text-utils.d.ts +3 -1
- package/dist/types/components/TooltipDataViz/TooltipDataViz.d.ts +3 -2
- package/dist/types/components.d.ts +32 -17
- package/dist/types/utils/control-text.d.ts +4 -4
- package/dist/types/utils/index.d.ts +1 -1
- package/package.json +7 -7
- package/src/angular/proxies.ts +2 -2
- package/src/wc/components/Banner/Banner.tsx +3 -5
- package/src/wc/components/BarNav/BarNav.tsx +10 -5
- package/src/wc/components/ButtonFilled/ButtonFilled.tsx +9 -5
- package/src/wc/components/ButtonUnfilled/ButtonUnfilled.tsx +9 -5
- package/src/wc/components/Card/Card.tsx +9 -12
- package/src/wc/components/ChartDonut/ChartDonut.tsx +4 -47
- package/src/wc/components/ChartLegend/ChartLegend.tsx +23 -15
- package/src/wc/components/Checkbox/Checkbox.tsx +3 -5
- package/src/wc/components/Chip/Chip.tsx +3 -5
- package/src/wc/components/EmptyState/EmptyState.tsx +3 -5
- package/src/wc/components/Input/Input.tsx +10 -3
- package/src/wc/components/Loader/Loader.tsx +77 -30
- package/src/wc/components/Loader/index.ts +1 -1
- package/src/wc/components/Menu/Menu.tsx +22 -17
- package/src/wc/components/Modal/Modal.tsx +10 -11
- package/src/wc/components/Pagination/Pagination.tsx +3 -3
- package/src/wc/components/PanelNav/PanelNav.tsx +30 -31
- package/src/wc/components/PanelTools/PanelTools.tsx +10 -5
- package/src/wc/components/RadioGroup/RadioGroup.tsx +3 -5
- package/src/wc/components/Select/Select.tsx +9 -5
- package/src/wc/components/Table/Table.tsx +15 -12
- package/src/wc/components/Tag/Tag.tsx +3 -5
- package/src/wc/components/Text/Text.tsx +4 -3
- package/src/wc/components/Text/text-utils.ts +8 -1
- package/src/wc/components/Tooltip/Tooltip.tsx +10 -4
- package/src/wc/components/TooltipDataViz/TooltipDataViz.tsx +20 -12
- package/src/wc/components.d.ts +32 -17
- package/src/wc/utils/control-density.css +2 -6
- package/src/wc/utils/control-text.ts +4 -4
- package/src/wc/utils/index.ts +1 -1
- package/src/wc/utils/interaction-fill.css +2 -2
- package/src/wc/utils/typography.css +146 -0
- package/dist/components/p-061wD4FM.js +0 -2
- package/dist/components/p-061wD4FM.js.map +0 -1
- package/dist/components/p-AiGt4dQS.js +0 -2
- package/dist/components/p-AiGt4dQS.js.map +0 -1
- package/dist/components/p-BDQgqw5J.js +0 -2
- package/dist/components/p-BDQgqw5J.js.map +0 -1
- package/dist/components/p-B_g8X0eh.js +0 -2
- package/dist/components/p-B_g8X0eh.js.map +0 -1
- package/dist/components/p-BvF44IQK.js.map +0 -1
- package/dist/components/p-C3ORQUOp.js +0 -2
- package/dist/components/p-DIgHkkPe.js +0 -2
- package/dist/components/p-DIgHkkPe.js.map +0 -1
- package/dist/components/p-DOqi-Vkb.js +0 -2
- package/dist/components/p-DOqi-Vkb.js.map +0 -1
- package/dist/components/p-DQ3MyAC7.js +0 -2
- package/dist/components/p-DQ3MyAC7.js.map +0 -1
- package/dist/components/p-DkcH8mRl.js +0 -2
- package/dist/components/p-DkcH8mRl.js.map +0 -1
- package/dist/components/p-DrhmNrKD.js +0 -2
- package/dist/components/p-DrhmNrKD.js.map +0 -1
- package/dist/components/p-DujEDZ7f.js +0 -2
- package/dist/components/p-DwQ-zdqa.js +0 -2
- package/dist/components/p-DwQ-zdqa.js.map +0 -1
- /package/dist/components/{p-CyFVn2Sc.js.map → p-9Qu1ls2y.js.map} +0 -0
|
@@ -683,11 +683,16 @@ export class BarNav {
|
|
|
683
683
|
)}
|
|
684
684
|
|
|
685
685
|
{!hasTabs && this.heading && (
|
|
686
|
-
<
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
686
|
+
<ds-text
|
|
687
|
+
class="bar-nav__heading"
|
|
688
|
+
as="span"
|
|
689
|
+
variant="text-body-medium"
|
|
690
|
+
emphasis
|
|
691
|
+
color="inherit"
|
|
692
|
+
wrap="nowrap"
|
|
693
|
+
>
|
|
694
|
+
{this.heading}
|
|
695
|
+
</ds-text>
|
|
691
696
|
)}
|
|
692
697
|
|
|
693
698
|
{hasTabs && this.hasOverflowTabs && (
|
|
@@ -154,11 +154,15 @@ export class ButtonFilled {
|
|
|
154
154
|
</span>
|
|
155
155
|
)}
|
|
156
156
|
{this.showLabel && (
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
<ds-text
|
|
158
|
+
class="button-filled__label ds-interaction-fill__content"
|
|
159
|
+
as="span"
|
|
160
|
+
variant={textVariant}
|
|
161
|
+
emphasis
|
|
162
|
+
color="inherit"
|
|
163
|
+
>
|
|
164
|
+
{this.label}
|
|
165
|
+
</ds-text>
|
|
162
166
|
)}
|
|
163
167
|
</button>
|
|
164
168
|
</Host>
|
|
@@ -212,11 +212,15 @@ export class ButtonUnfilled {
|
|
|
212
212
|
</span>
|
|
213
213
|
)}
|
|
214
214
|
{this.showLabel && (
|
|
215
|
-
<
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
215
|
+
<ds-text
|
|
216
|
+
class="button-unfilled__label ds-interaction-fill__content"
|
|
217
|
+
as="span"
|
|
218
|
+
variant={textVariant}
|
|
219
|
+
emphasis
|
|
220
|
+
color="inherit"
|
|
221
|
+
>
|
|
222
|
+
{this.label}
|
|
223
|
+
</ds-text>
|
|
220
224
|
)}
|
|
221
225
|
</button>
|
|
222
226
|
</Host>
|
|
@@ -56,18 +56,15 @@ export class Card {
|
|
|
56
56
|
}}
|
|
57
57
|
>
|
|
58
58
|
<header class="card__header">
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</ds-text>
|
|
69
|
-
</span>
|
|
70
|
-
</div>
|
|
59
|
+
<ds-text
|
|
60
|
+
class="card__title-wrap card__title"
|
|
61
|
+
variant="text-title-small"
|
|
62
|
+
emphasis
|
|
63
|
+
color={editing ? FAINT_BRAND_TITLE_COLOR : 'primary'}
|
|
64
|
+
as="h2"
|
|
65
|
+
>
|
|
66
|
+
{this.heading}
|
|
67
|
+
</ds-text>
|
|
71
68
|
<div class="card__actions">
|
|
72
69
|
<slot name="actions" />
|
|
73
70
|
</div>
|
|
@@ -12,12 +12,6 @@ const CENTER_TEXT_SAFE_WIDTH_RATIO = 0.82;
|
|
|
12
12
|
/** Fallback when filling before the first ResizeObserver measurement (matches fill min). */
|
|
13
13
|
const FILL_FALLBACK_PX = 128;
|
|
14
14
|
|
|
15
|
-
type DonutTooltipState = {
|
|
16
|
-
datum: ChartDatum;
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
15
|
@Component({
|
|
22
16
|
tag: 'ds-chart-donut',
|
|
23
17
|
styleUrl: 'ChartDonut.css',
|
|
@@ -49,14 +43,12 @@ export class ChartDonut {
|
|
|
49
43
|
* Externally controlled highlight, matched by `label` — e.g. drive this from a sibling
|
|
50
44
|
* `ds-chart-legend`'s `dsItemHover` event to keep chart and legend hover in sync.
|
|
51
45
|
* Falls back to this component's own pointer/focus hover when unset.
|
|
52
|
-
*
|
|
53
|
-
*
|
|
46
|
+
* Slice hover dims peer slices and emits `dsSliceHover` for legend sync — no data-viz
|
|
47
|
+
* tooltip (the legend already surfaces label/value).
|
|
54
48
|
*/
|
|
55
49
|
@Prop() activeLabel: string | null = null;
|
|
56
50
|
|
|
57
51
|
@State() private hoveredLabel: string | null = null;
|
|
58
|
-
/** Own-hover tooltip (cursor-following). Cleared on leave; not driven by `activeLabel`. */
|
|
59
|
-
@State() private tooltip: DonutTooltipState | null = null;
|
|
60
52
|
/** Center text, truncated with an ellipsis if it doesn't fit inside the inner circle. */
|
|
61
53
|
@State() private displayedValueText: string = '';
|
|
62
54
|
@State() private displayedCaptionText: string = '';
|
|
@@ -68,7 +60,6 @@ export class ChartDonut {
|
|
|
68
60
|
|
|
69
61
|
private valueTextEl?: SVGTextElement;
|
|
70
62
|
private captionTextEl?: SVGTextElement;
|
|
71
|
-
private wrapperEl?: HTMLDivElement;
|
|
72
63
|
private resizeObserver: ResizeObserver | null = null;
|
|
73
64
|
|
|
74
65
|
private get isFillMode(): boolean {
|
|
@@ -143,29 +134,9 @@ export class ChartDonut {
|
|
|
143
134
|
this.resizeObserver = null;
|
|
144
135
|
}
|
|
145
136
|
|
|
146
|
-
private handleHover(datum: ChartDatum | null
|
|
137
|
+
private handleHover(datum: ChartDatum | null) {
|
|
147
138
|
this.hoveredLabel = datum?.label ?? null;
|
|
148
139
|
this.dsSliceHover.emit(datum);
|
|
149
|
-
if (!datum) {
|
|
150
|
-
this.tooltip = null;
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
this.updateTooltip(datum, event);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
private handleSliceMove(datum: ChartDatum, event: MouseEvent) {
|
|
157
|
-
if (this.hoveredLabel !== datum.label) return;
|
|
158
|
-
this.updateTooltip(datum, event);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
private updateTooltip(datum: ChartDatum, event?: MouseEvent) {
|
|
162
|
-
const wrapper = this.wrapperEl;
|
|
163
|
-
if (!wrapper) return;
|
|
164
|
-
const size = this.resolvedSize;
|
|
165
|
-
const rect = wrapper.getBoundingClientRect();
|
|
166
|
-
const x = event ? event.clientX - rect.left : size / 2;
|
|
167
|
-
const y = event ? event.clientY - rect.top : size / 2;
|
|
168
|
-
this.tooltip = { datum, x, y };
|
|
169
140
|
}
|
|
170
141
|
|
|
171
142
|
componentDidRender() {
|
|
@@ -238,7 +209,6 @@ export class ChartDonut {
|
|
|
238
209
|
// Show the full text before the post-render truncation pass has measured it (avoids a blank first paint).
|
|
239
210
|
const fullValueText = this.centerValue ?? formatCompactNumber(total);
|
|
240
211
|
const fullCaptionText = this.centerCaption ?? '';
|
|
241
|
-
const tip = this.tooltip;
|
|
242
212
|
const fill = this.isFillMode;
|
|
243
213
|
|
|
244
214
|
return (
|
|
@@ -253,9 +223,6 @@ export class ChartDonut {
|
|
|
253
223
|
<div
|
|
254
224
|
class="chart-donut__wrapper"
|
|
255
225
|
style={!fill ? { width: `${size}px`, height: `${size}px` } : undefined}
|
|
256
|
-
ref={el => {
|
|
257
|
-
this.wrapperEl = (el as HTMLDivElement) ?? undefined;
|
|
258
|
-
}}
|
|
259
226
|
>
|
|
260
227
|
<svg
|
|
261
228
|
class="chart-donut__svg"
|
|
@@ -279,8 +246,7 @@ export class ChartDonut {
|
|
|
279
246
|
tabindex={0}
|
|
280
247
|
role="img"
|
|
281
248
|
aria-label={`${datum.label}: ${datum.value}`}
|
|
282
|
-
onMouseEnter={(
|
|
283
|
-
onMouseMove={(e: MouseEvent) => this.handleSliceMove(datum, e)}
|
|
249
|
+
onMouseEnter={() => this.handleHover(datum)}
|
|
284
250
|
onMouseLeave={() => this.handleHover(null)}
|
|
285
251
|
onFocus={() => this.handleHover(datum)}
|
|
286
252
|
onBlur={() => this.handleHover(null)}
|
|
@@ -316,15 +282,6 @@ export class ChartDonut {
|
|
|
316
282
|
</text>
|
|
317
283
|
)}
|
|
318
284
|
</svg>
|
|
319
|
-
{tip && (
|
|
320
|
-
<ds-tooltip-data-viz
|
|
321
|
-
key={tip.datum.label}
|
|
322
|
-
label={tip.datum.label}
|
|
323
|
-
value={formatCompactNumber(tip.datum.value)}
|
|
324
|
-
x={tip.x}
|
|
325
|
-
y={tip.y}
|
|
326
|
-
/>
|
|
327
|
-
)}
|
|
328
285
|
</div>
|
|
329
286
|
</Host>
|
|
330
287
|
);
|
|
@@ -87,24 +87,32 @@ export class ChartLegend {
|
|
|
87
87
|
<span class="chart-legend__swatch-box">
|
|
88
88
|
<span class="chart-legend__swatch" style={{ backgroundColor: item.color ?? categoryColor(i) }} />
|
|
89
89
|
</span>
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
<ds-text
|
|
91
|
+
class="chart-legend__label"
|
|
92
|
+
as="span"
|
|
93
|
+
variant="text-body-medium"
|
|
94
|
+
color="secondary"
|
|
95
|
+
lineTruncation={1}
|
|
96
|
+
title={item.label}
|
|
97
|
+
>
|
|
98
|
+
{item.label}
|
|
99
|
+
</ds-text>
|
|
95
100
|
{item.value != null && (
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
<ds-text
|
|
102
|
+
class="chart-legend__value"
|
|
103
|
+
as="span"
|
|
104
|
+
variant="text-body-medium"
|
|
105
|
+
color="primary"
|
|
106
|
+
lineTruncation={1}
|
|
107
|
+
title={String(item.value)}
|
|
108
|
+
>
|
|
109
|
+
{formatCompactNumber(item.value)}
|
|
110
|
+
</ds-text>
|
|
101
111
|
)}
|
|
102
112
|
{item.value != null && this.showPercentage && (
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
</ds-text>
|
|
107
|
-
</span>
|
|
113
|
+
<ds-text class="chart-legend__percentage" as="span" variant="text-body-medium" color="primary">
|
|
114
|
+
{(total ? (item.value / total) * 100 : 0).toFixed(1)}%
|
|
115
|
+
</ds-text>
|
|
108
116
|
)}
|
|
109
117
|
</RowTag>
|
|
110
118
|
</li>
|
|
@@ -51,11 +51,9 @@ export class Checkbox {
|
|
|
51
51
|
</span>
|
|
52
52
|
)}
|
|
53
53
|
</span>
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</ds-text>
|
|
58
|
-
</span>
|
|
54
|
+
<ds-text class="checkbox__label" as="span" variant="text-body-medium" textId={this.labelId}>
|
|
55
|
+
{this.label}
|
|
56
|
+
</ds-text>
|
|
59
57
|
</Host>
|
|
60
58
|
);
|
|
61
59
|
}
|
|
@@ -82,11 +82,9 @@ export class Chip {
|
|
|
82
82
|
style={maxWidthStyle}
|
|
83
83
|
aria-disabled={this.isInactive || undefined}
|
|
84
84
|
>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
</ds-text>
|
|
89
|
-
</span>
|
|
85
|
+
<ds-text class="tag__label" as="span" variant={textVariant} color="inherit">
|
|
86
|
+
{this.label}
|
|
87
|
+
</ds-text>
|
|
90
88
|
{this.removable && (
|
|
91
89
|
<button
|
|
92
90
|
type="button"
|
|
@@ -21,11 +21,9 @@ export class EmptyState {
|
|
|
21
21
|
render() {
|
|
22
22
|
return (
|
|
23
23
|
<Host>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</ds-text>
|
|
28
|
-
</div>
|
|
24
|
+
<ds-text class="empty-state" as="p" variant="text-body-medium" color="secondary">
|
|
25
|
+
{this.message || DEFAULT_MESSAGES[this.type]}
|
|
26
|
+
</ds-text>
|
|
29
27
|
</Host>
|
|
30
28
|
);
|
|
31
29
|
}
|
|
@@ -67,7 +67,7 @@ export class Input {
|
|
|
67
67
|
placeholder={this.placeholder}
|
|
68
68
|
disabled={this.isInactive}
|
|
69
69
|
autoFocus={this.autoFocus}
|
|
70
|
-
class="native-input"
|
|
70
|
+
class="native-input ds-text--body-medium ds-text--regular"
|
|
71
71
|
aria-label={this.ariaLabel}
|
|
72
72
|
aria-labelledby={this.ariaLabelledby}
|
|
73
73
|
aria-describedby={describedBy}
|
|
@@ -90,9 +90,16 @@ export class Input {
|
|
|
90
90
|
</div>
|
|
91
91
|
</div>
|
|
92
92
|
{showError && (
|
|
93
|
-
<
|
|
93
|
+
<ds-text
|
|
94
|
+
class="error-text"
|
|
95
|
+
as="div"
|
|
96
|
+
variant="text-body-small"
|
|
97
|
+
color="negative"
|
|
98
|
+
textId={this.errorId}
|
|
99
|
+
role="alert"
|
|
100
|
+
>
|
|
94
101
|
{this.errorMessage}
|
|
95
|
-
</
|
|
102
|
+
</ds-text>
|
|
96
103
|
)}
|
|
97
104
|
</Host>
|
|
98
105
|
);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { Component, Prop, h } from '@stencil/core';
|
|
2
|
-
import {
|
|
1
|
+
import { Component, Prop, h, Host } from '@stencil/core';
|
|
2
|
+
import type { IconColor, IconSize } from '../Icon/Icon';
|
|
3
|
+
|
|
4
|
+
export type LoaderSize = IconSize;
|
|
5
|
+
export type LoaderColor = IconColor;
|
|
3
6
|
|
|
4
7
|
@Component({
|
|
5
8
|
tag: 'ds-loader',
|
|
@@ -7,8 +10,10 @@ import { resolveCssLengthPx, TOKEN_DEFAULTS } from '../../utils';
|
|
|
7
10
|
shadow: true,
|
|
8
11
|
})
|
|
9
12
|
export class Loader {
|
|
10
|
-
/**
|
|
11
|
-
@Prop() size:
|
|
13
|
+
/** Iconography size token. Maps to `--dimension-iconography-{size}`. Default `md` = 20 px. */
|
|
14
|
+
@Prop() size: LoaderSize = 'md';
|
|
15
|
+
/** Semantic foreground color token, or a raw CSS var reference. Same tokens as `ds-icon`. */
|
|
16
|
+
@Prop() color: LoaderColor | undefined;
|
|
12
17
|
/**
|
|
13
18
|
* Accessible label for standalone usage. Wraps the spinner in a live region
|
|
14
19
|
* and renders the label visually-hidden. Omit when the host element already
|
|
@@ -16,37 +21,79 @@ export class Loader {
|
|
|
16
21
|
*/
|
|
17
22
|
@Prop() label: string | undefined;
|
|
18
23
|
|
|
19
|
-
private get sizePx(): number {
|
|
20
|
-
return resolveCssLengthPx(this.size, TOKEN_DEFAULTS.iconographyMd);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
24
|
render() {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
const isCustomColor = typeof this.color === 'string' && this.color.startsWith('var(--');
|
|
26
|
+
|
|
27
|
+
const cls: Record<string, boolean> = {
|
|
28
|
+
loader: true,
|
|
29
|
+
[`loader--size-${this.size}`]: true,
|
|
30
|
+
[`loader--color-${this.color}`]: !!this.color && !isCustomColor && this.color !== 'inherit',
|
|
31
|
+
'loader--color-inherit': this.color === 'inherit',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const style = isCustomColor ? { color: this.color as string } : undefined;
|
|
35
|
+
|
|
36
|
+
const spinner = (
|
|
37
|
+
<span class={cls} style={style} aria-hidden="true">
|
|
38
|
+
<svg class="loader__svg" viewBox="0 0 16 16" fill="none" focusable="false">
|
|
39
|
+
<path
|
|
40
|
+
opacity="0.1"
|
|
41
|
+
d="M3 8C3 5.23858 5.23858 3 8 3V2C4.68629 2 2 4.68629 2 8C2 9.99456 2.97323 11.7618 4.47072 12.8528L5.05894 12.044C3.81102 11.1348 3 9.66213 3 8Z"
|
|
42
|
+
fill="currentColor"
|
|
43
|
+
/>
|
|
44
|
+
<path
|
|
45
|
+
opacity="0.2"
|
|
46
|
+
fill-rule="evenodd"
|
|
47
|
+
clip-rule="evenodd"
|
|
48
|
+
d="M5.05892 12.0438C5.88425 12.6451 6.90069 12.9998 7.99998 12.9998C9.66211 12.9998 11.1348 12.1888 12.0439 10.9409L12.8527 11.5291C11.7618 13.0266 9.99454 13.9998 7.99998 13.9998C6.68083 13.9998 5.46111 13.5741 4.4707 12.8526L5.05892 12.0438Z"
|
|
49
|
+
fill="currentColor"
|
|
50
|
+
/>
|
|
51
|
+
<path
|
|
52
|
+
opacity="0.4"
|
|
53
|
+
fill-rule="evenodd"
|
|
54
|
+
clip-rule="evenodd"
|
|
55
|
+
d="M12.0435 10.9408C12.6447 10.1155 12.9995 9.09906 12.9995 7.99976C12.9995 7.45884 12.9136 6.93798 12.7547 6.45007L13.7057 6.14014C13.8964 6.72562 13.9995 7.35065 13.9995 7.99976C13.9995 9.31891 13.5738 10.5386 12.8523 11.529L12.0435 10.9408Z"
|
|
56
|
+
fill="currentColor"
|
|
57
|
+
/>
|
|
58
|
+
<path
|
|
59
|
+
opacity="0.6"
|
|
60
|
+
fill-rule="evenodd"
|
|
61
|
+
clip-rule="evenodd"
|
|
62
|
+
d="M12.7555 6.45152C12.4263 5.43958 11.7831 4.56933 10.9409 3.95577L11.5291 3.14697C12.5398 3.88325 13.3116 4.92755 13.7067 6.14188L12.7555 6.45152Z"
|
|
63
|
+
fill="currentColor"
|
|
64
|
+
/>
|
|
65
|
+
<path
|
|
66
|
+
opacity="0.8"
|
|
67
|
+
fill-rule="evenodd"
|
|
68
|
+
clip-rule="evenodd"
|
|
69
|
+
d="M10.941 3.95583C10.5307 3.65688 10.0731 3.41886 9.58154 3.25509L9.89786 2.30615C10.4877 2.50267 11.0368 2.78829 11.5293 3.14704L10.941 3.95583Z"
|
|
70
|
+
fill="currentColor"
|
|
71
|
+
/>
|
|
72
|
+
<path
|
|
73
|
+
fill-rule="evenodd"
|
|
74
|
+
clip-rule="evenodd"
|
|
75
|
+
d="M9.89788 2.30636C9.3014 2.10762 8.66327 2 8 2V3C8.55272 3 9.0845 3.08968 9.58157 3.2553L9.89788 2.30636Z"
|
|
76
|
+
fill="currentColor"
|
|
77
|
+
/>
|
|
78
|
+
</svg>
|
|
79
|
+
</span>
|
|
41
80
|
);
|
|
42
81
|
|
|
43
|
-
if (!this.label)
|
|
82
|
+
if (!this.label) {
|
|
83
|
+
return (
|
|
84
|
+
<Host style={{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
85
|
+
{spinner}
|
|
86
|
+
</Host>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
44
89
|
|
|
45
90
|
return (
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
91
|
+
<Host style={{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
92
|
+
<span role="status" aria-live="polite" class="status">
|
|
93
|
+
{spinner}
|
|
94
|
+
<span class="visually-hidden">{this.label}</span>
|
|
95
|
+
</span>
|
|
96
|
+
</Host>
|
|
50
97
|
);
|
|
51
98
|
}
|
|
52
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type {} from './Loader';
|
|
1
|
+
export type { LoaderSize, LoaderColor } from './Loader';
|
|
@@ -357,13 +357,16 @@ export class Menu {
|
|
|
357
357
|
aria-label={section.header}
|
|
358
358
|
>
|
|
359
359
|
{section.header && (
|
|
360
|
-
<
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
360
|
+
<ds-text
|
|
361
|
+
class="section-header ds-control--md"
|
|
362
|
+
as="span"
|
|
363
|
+
variant="text-body-small"
|
|
364
|
+
emphasis
|
|
365
|
+
color="inherit"
|
|
366
|
+
aria-hidden="true"
|
|
367
|
+
>
|
|
368
|
+
{section.header}
|
|
369
|
+
</ds-text>
|
|
367
370
|
)}
|
|
368
371
|
{isMenuGradientPickerSection(section) ? (
|
|
369
372
|
<ds-shell-gradient-picker
|
|
@@ -402,17 +405,19 @@ export class Menu {
|
|
|
402
405
|
onFocus={() => { this.focusedIndex = idx; }}
|
|
403
406
|
>
|
|
404
407
|
<div class="menu-item__content ds-interaction-fill__content">
|
|
405
|
-
<
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
<ds-text
|
|
409
|
+
class="menu-item__label"
|
|
410
|
+
as="span"
|
|
411
|
+
variant="text-body-medium"
|
|
412
|
+
emphasis={!!item.isSelected}
|
|
413
|
+
color="inherit"
|
|
414
|
+
>
|
|
415
|
+
{item.label}
|
|
416
|
+
</ds-text>
|
|
410
417
|
{item.subtext && (
|
|
411
|
-
<
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
</ds-text>
|
|
415
|
-
</span>
|
|
418
|
+
<ds-text class="menu-item__subtext" as="span" variant="text-body-small" color="inherit">
|
|
419
|
+
{item.subtext}
|
|
420
|
+
</ds-text>
|
|
416
421
|
)}
|
|
417
422
|
</div>
|
|
418
423
|
{item.showToggle && (
|
|
@@ -187,17 +187,16 @@ export class Modal {
|
|
|
187
187
|
{this.heading}
|
|
188
188
|
</ds-text>
|
|
189
189
|
{this.subtitle && (
|
|
190
|
-
<
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
</div>
|
|
190
|
+
<ds-text
|
|
191
|
+
class="modal-subtitle"
|
|
192
|
+
as="div"
|
|
193
|
+
variant="text-body-medium"
|
|
194
|
+
color="secondary"
|
|
195
|
+
wrap="balance"
|
|
196
|
+
textId={this.subtitleId}
|
|
197
|
+
>
|
|
198
|
+
{this.subtitle}
|
|
199
|
+
</ds-text>
|
|
201
200
|
)}
|
|
202
201
|
</div>
|
|
203
202
|
<div class="modal-body">
|
|
@@ -62,9 +62,9 @@ export class Pagination {
|
|
|
62
62
|
|
|
63
63
|
{pages.map((item, i) =>
|
|
64
64
|
item === 'ellipsis' ? (
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
</
|
|
65
|
+
<ds-text key={`e${i}`} class="ellipsis" as="span" variant="text-body-small" color="tertiary">
|
|
66
|
+
…
|
|
67
|
+
</ds-text>
|
|
68
68
|
) : (
|
|
69
69
|
<button
|
|
70
70
|
key={item}
|
|
@@ -515,24 +515,24 @@ export class PanelNav {
|
|
|
515
515
|
onKeyDown={(e: KeyboardEvent) => this.handleRovingKeyDown(e, this.getUserRovingIndex())}
|
|
516
516
|
onFocus={() => { this.rovingIndex = this.getUserRovingIndex(); }}
|
|
517
517
|
>
|
|
518
|
-
<
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
518
|
+
<ds-text
|
|
519
|
+
class="panel-nav__item-label panel-nav__footer-user-label panel-nav__item-label-text"
|
|
520
|
+
as="span"
|
|
521
|
+
variant="text-body-medium"
|
|
522
|
+
emphasis
|
|
523
|
+
color="inherit"
|
|
524
|
+
>
|
|
525
|
+
{userName}
|
|
526
|
+
</ds-text>
|
|
525
527
|
<span class="panel-nav__item-icon panel-nav__footer-user-icon" aria-hidden="true">
|
|
526
528
|
<span class="panel-nav__footer-icon-expanded">
|
|
527
529
|
<ds-icon name="ChevronUpDown" size="md" color="inherit" />
|
|
528
530
|
</span>
|
|
529
531
|
<span class="panel-nav__footer-icon-collapsed">
|
|
530
532
|
<ds-icon name="Circle" size="md" color="inherit" />
|
|
531
|
-
<
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
</ds-text>
|
|
535
|
-
</span>
|
|
533
|
+
<ds-text class="panel-nav__user-initial" as="span" variant="text-caption" emphasis color="inherit">
|
|
534
|
+
{userInitial}
|
|
535
|
+
</ds-text>
|
|
536
536
|
</span>
|
|
537
537
|
</span>
|
|
538
538
|
</button>
|
|
@@ -553,18 +553,15 @@ export class PanelNav {
|
|
|
553
553
|
<span class="panel-nav__item-icon">
|
|
554
554
|
<ds-icon name={item.icon} size="md" color="inherit" flag={item.flag} />
|
|
555
555
|
</span>,
|
|
556
|
-
<
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
</ds-text>
|
|
566
|
-
</span>
|
|
567
|
-
</span>,
|
|
556
|
+
<ds-text
|
|
557
|
+
class="panel-nav__item-label panel-nav__item-label-text"
|
|
558
|
+
as="span"
|
|
559
|
+
variant="text-body-medium"
|
|
560
|
+
emphasis={isActive}
|
|
561
|
+
color="inherit"
|
|
562
|
+
>
|
|
563
|
+
{item.label}
|
|
564
|
+
</ds-text>,
|
|
568
565
|
item.dot && (
|
|
569
566
|
<ds-badge
|
|
570
567
|
class="panel-nav__item-dot"
|
|
@@ -667,13 +664,15 @@ export class PanelNav {
|
|
|
667
664
|
return this.parsedGroups.map(group => (
|
|
668
665
|
<div class="panel-nav__group">
|
|
669
666
|
{group.label && (
|
|
670
|
-
<
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
667
|
+
<ds-text
|
|
668
|
+
class="panel-nav__group-label panel-nav__item-label-text"
|
|
669
|
+
as="span"
|
|
670
|
+
variant="text-caption"
|
|
671
|
+
emphasis
|
|
672
|
+
color="inherit"
|
|
673
|
+
>
|
|
674
|
+
{group.label}
|
|
675
|
+
</ds-text>
|
|
677
676
|
)}
|
|
678
677
|
{group.items.map(item => this.renderNavItem(item, flatIdx++, collapsed))}
|
|
679
678
|
</div>
|