@ds-mo/ui 14.29.2 → 14.31.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/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +17 -11
- package/dist/angular/ds-score.d.ts +1 -1
- package/dist/angular/ds-score.js +3 -3
- package/dist/angular/ds-table.js +2 -1
- package/dist/components/ds-card-overview.js +1 -1
- package/dist/components/ds-card-overview.js.map +1 -1
- package/dist/components/ds-score.js +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-table.js.map +1 -1
- package/dist/components/p-GwqA_Gzi.js +2 -0
- package/dist/components/p-GwqA_Gzi.js.map +1 -0
- package/dist/docs/components.json +83 -2
- package/dist/mcp-data/registry/card-overview.json +2 -2
- package/dist/mcp-data/registry/registry.json +16 -10
- package/dist/mcp-data/registry/score.json +30 -10
- package/dist/mcp-data/registry/table.json +21 -9
- package/dist/styles/table.css +55 -19
- package/dist/types/components/Score/Score.d.ts +6 -1
- package/dist/types/components/Score/index.d.ts +1 -1
- package/dist/types/components/Score/score-model.d.ts +10 -3
- package/dist/types/components/Score/score-types.d.ts +2 -0
- package/dist/types/components/Table/Table.d.ts +9 -0
- package/dist/types/components/Table/table-model.d.ts +11 -2
- package/dist/types/components/Table/table-types.d.ts +2 -0
- package/dist/types/components/Table/table-virtual-controller.d.ts +2 -0
- package/dist/types/components.d.ts +17 -2
- package/dist/vue/ds-score.js +1 -0
- package/package.json +1 -1
- package/dist/components/p-DDOuPq-N.js +0 -2
- package/dist/components/p-DDOuPq-N.js.map +0 -1
package/dist/styles/table.css
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
--_table-wrap-secondary-padding-block: 0;
|
|
36
36
|
--_table-surface: var(--ds-table-surface, var(--color-background-primary));
|
|
37
37
|
--_table-header-surface: var(--ds-table-header-surface, var(--color-background-primary));
|
|
38
|
-
--_table-group-surface: var(--ds-table-group-surface, var(--color-background-
|
|
38
|
+
--_table-group-surface: var(--ds-table-group-surface, var(--color-background-secondary));
|
|
39
39
|
--_table-row-hover: var(--ds-table-row-hover, var(--color-interaction-hover));
|
|
40
40
|
--_table-row-pressed: var(--ds-table-row-pressed, var(--color-interaction-pressed));
|
|
41
41
|
--_table-row-selected: var(--ds-table-row-selected, var(--color-interaction-active-brand));
|
|
@@ -1463,7 +1463,7 @@
|
|
|
1463
1463
|
inset-block-end: 0;
|
|
1464
1464
|
z-index: 1;
|
|
1465
1465
|
block-size: var(--dimension-stroke-width-012);
|
|
1466
|
-
background: var(--_table-border);
|
|
1466
|
+
background: var(--_table-column-border);
|
|
1467
1467
|
pointer-events: none;
|
|
1468
1468
|
}
|
|
1469
1469
|
|
|
@@ -1504,7 +1504,6 @@
|
|
|
1504
1504
|
}
|
|
1505
1505
|
|
|
1506
1506
|
:where(.ds-table__group-hero) {
|
|
1507
|
-
position: relative;
|
|
1508
1507
|
box-sizing: border-box;
|
|
1509
1508
|
display: inline-flex;
|
|
1510
1509
|
flex: 0 0 auto;
|
|
@@ -1513,20 +1512,30 @@
|
|
|
1513
1512
|
margin-inline-start: var(--dimension-space-075);
|
|
1514
1513
|
}
|
|
1515
1514
|
|
|
1516
|
-
:where(.ds-table__group-hero)
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1515
|
+
:where(.ds-table__group-content--hero-two-track .ds-table__group-hero) {
|
|
1516
|
+
align-self: center;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
:where(.ds-table__table):not(:where(.ds-table__table--selectable))
|
|
1520
|
+
:where(.ds-table__group-content--hero):not(:where(.ds-table__group-content--hero-two-track))
|
|
1521
|
+
:where(.ds-table__group-hero),
|
|
1522
|
+
:where(.ds-table__sticky-group):not(:where(.ds-table__sticky-group--selectable))
|
|
1523
|
+
:where(.ds-table__group-content--hero):not(:where(.ds-table__group-content--hero-two-track))
|
|
1524
|
+
:where(.ds-table__group-hero) {
|
|
1525
|
+
/* Without a selection lane, the sm figure shares the content's top and start inset. */
|
|
1526
|
+
margin-inline-start: 0;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
:where(.ds-table__table--selectable .ds-table__group-content--hero-two-track .ds-table__group-hero),
|
|
1530
|
+
:where(
|
|
1531
|
+
.ds-table__sticky-group--selectable .ds-table__group-content--hero-two-track .ds-table__group-hero
|
|
1532
|
+
) {
|
|
1533
|
+
/* The lg two-track figure starts exactly at the selection-column boundary. */
|
|
1534
|
+
margin-inline-start: 0;
|
|
1525
1535
|
}
|
|
1526
1536
|
|
|
1527
1537
|
:where(.ds-table__table--selectable .ds-table__group-hero),
|
|
1528
1538
|
:where(.ds-table__sticky-group--selectable .ds-table__group-hero) {
|
|
1529
|
-
/* Margin, not padding: ::after inset:0 must hug the 24px sm fill. */
|
|
1530
1539
|
margin-inline-end: var(--dimension-space-100);
|
|
1531
1540
|
}
|
|
1532
1541
|
|
|
@@ -1578,17 +1587,48 @@
|
|
|
1578
1587
|
padding-inline-start: var(--dimension-space-050);
|
|
1579
1588
|
}
|
|
1580
1589
|
|
|
1581
|
-
:where(.ds-table__group-separator),
|
|
1582
1590
|
:where(.ds-table__group-count),
|
|
1583
1591
|
:where(.ds-table__group-accessory-separator) {
|
|
1584
1592
|
flex: 0 0 auto;
|
|
1585
1593
|
}
|
|
1586
1594
|
|
|
1595
|
+
:where(.ds-table__group-trailing) {
|
|
1596
|
+
box-sizing: border-box;
|
|
1597
|
+
display: inline-flex;
|
|
1598
|
+
flex: 0 0 auto;
|
|
1599
|
+
align-self: flex-start;
|
|
1600
|
+
align-items: flex-start;
|
|
1601
|
+
gap: var(--dimension-space-100);
|
|
1602
|
+
min-block-size: var(--_table-cell-track-min-block-size);
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
:where(.ds-table__group-action) {
|
|
1606
|
+
position: relative;
|
|
1607
|
+
box-sizing: border-box;
|
|
1608
|
+
display: inline-flex;
|
|
1609
|
+
flex: 0 0 calc(var(--dimension-size-500) - var(--dimension-space-100));
|
|
1610
|
+
inline-size: calc(var(--dimension-size-500) - var(--dimension-space-100));
|
|
1611
|
+
align-self: flex-start;
|
|
1612
|
+
align-items: flex-start;
|
|
1613
|
+
justify-content: flex-end;
|
|
1614
|
+
min-block-size: var(--_table-cell-track-min-block-size);
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
:where(.ds-table__group-action)::before {
|
|
1618
|
+
content: '';
|
|
1619
|
+
position: absolute;
|
|
1620
|
+
inset-block-start: var(--dimension-space-025);
|
|
1621
|
+
inset-inline-start: 0;
|
|
1622
|
+
inline-size: var(--dimension-stroke-width-012);
|
|
1623
|
+
block-size: calc(var(--_table-cell-track-min-block-size) - (2 * var(--dimension-space-025)));
|
|
1624
|
+
background: var(--_table-column-border);
|
|
1625
|
+
pointer-events: none;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1587
1628
|
:where(.ds-table__group-toggle) {
|
|
1588
1629
|
--color-interaction-hover: transparent;
|
|
1589
1630
|
--color-interaction-pressed: transparent;
|
|
1590
1631
|
flex: 0 0 auto;
|
|
1591
|
-
margin-inline-start: auto;
|
|
1592
1632
|
}
|
|
1593
1633
|
|
|
1594
1634
|
:where(.ds-table__load-cell),
|
|
@@ -1739,10 +1779,6 @@
|
|
|
1739
1779
|
background: var(--ds-forced-color-surface);
|
|
1740
1780
|
}
|
|
1741
1781
|
|
|
1742
|
-
:where(.ds-table__group-hero)::after {
|
|
1743
|
-
border-color: var(--ds-forced-color-content);
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
1782
|
:where(.ds-table__row--disabled) {
|
|
1747
1783
|
color: var(--ds-forced-color-disabled);
|
|
1748
1784
|
opacity: 1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SafetyScoreLevel, ScoreSize } from './score-types';
|
|
1
|
+
import type { SafetyScoreLevel, ScoreSize, ScoreVariant } from './score-types';
|
|
2
2
|
export declare class Score {
|
|
3
3
|
/** Display-ready headline figure. */
|
|
4
4
|
value: string | number;
|
|
@@ -7,6 +7,11 @@ export declare class Score {
|
|
|
7
7
|
* `lg` is the Card Overview recipe.
|
|
8
8
|
*/
|
|
9
9
|
size: ScoreSize;
|
|
10
|
+
/**
|
|
11
|
+
* Value typography recipe. `dense` keeps the selected size's fill dimensions
|
|
12
|
+
* and uses a larger emphasized figure with tighter surrounding space.
|
|
13
|
+
*/
|
|
14
|
+
variant: ScoreVariant;
|
|
10
15
|
/**
|
|
11
16
|
* Safety-score color level. Numeric values from 0–100 infer fair (0–50),
|
|
12
17
|
* good (51–80), or excellent (81–100) when this is omitted.
|
|
@@ -7,8 +7,15 @@ export declare function isSafetyScoreLevel(value: unknown): value is SafetyScore
|
|
|
7
7
|
export declare function resolveSafetyScoreLevel(value: string | number): SafetyScoreLevel | undefined;
|
|
8
8
|
export declare function resolveScoreLevel(value: string | number, level?: SafetyScoreLevel): SafetyScoreLevel | undefined;
|
|
9
9
|
export declare const SCORE_VALUE_VARIANT: {
|
|
10
|
-
readonly
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
readonly default: {
|
|
11
|
+
readonly sm: "text-title-small";
|
|
12
|
+
readonly md: "text-title-medium";
|
|
13
|
+
readonly lg: "text-title-large";
|
|
14
|
+
};
|
|
15
|
+
readonly dense: {
|
|
16
|
+
readonly sm: "text-title-medium";
|
|
17
|
+
readonly md: "text-title-large";
|
|
18
|
+
readonly lg: "text-display-small";
|
|
19
|
+
};
|
|
13
20
|
};
|
|
14
21
|
//# sourceMappingURL=score-model.d.ts.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type SafetyScoreLevel = 'fair' | 'good' | 'excellent';
|
|
2
2
|
export type ScoreSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export type ScoreVariant = 'default' | 'dense';
|
|
3
4
|
export declare const SCORE_SIZES: readonly ["sm", "md", "lg"];
|
|
5
|
+
export declare const SCORE_VARIANTS: readonly ["default", "dense"];
|
|
4
6
|
export declare const SAFETY_SCORE_LEVELS: readonly ["fair", "good", "excellent"];
|
|
5
7
|
//# sourceMappingURL=score-types.d.ts.map
|
|
@@ -193,6 +193,12 @@ export declare class Table {
|
|
|
193
193
|
componentWillLoad(): void;
|
|
194
194
|
componentDidLoad(): void;
|
|
195
195
|
componentDidRender(): void;
|
|
196
|
+
/**
|
|
197
|
+
* Scroll the nearest vertical owner only enough to reveal a supplied row.
|
|
198
|
+
* Resolves false when the row is absent from the supplied, expanded table model.
|
|
199
|
+
* This method never moves focus.
|
|
200
|
+
*/
|
|
201
|
+
scrollRowIntoView(rowId: string): Promise<boolean>;
|
|
196
202
|
connectedCallback(): void;
|
|
197
203
|
disconnectedCallback(): void;
|
|
198
204
|
private syncHeaderSlotPresence;
|
|
@@ -245,6 +251,9 @@ export declare class Table {
|
|
|
245
251
|
private get hasVirtualViewportBounds();
|
|
246
252
|
private estimateVirtualViewportSize;
|
|
247
253
|
private virtualPinnedRowIds;
|
|
254
|
+
private findRenderedRow;
|
|
255
|
+
private revealRenderedRow;
|
|
256
|
+
private nextAnimationFrame;
|
|
248
257
|
private syncVirtualItems;
|
|
249
258
|
private shouldWindowRows;
|
|
250
259
|
private get resolvedMaxHeight();
|
|
@@ -49,8 +49,17 @@ export declare function resolvedTableGroupCount(group: TableGroup): number;
|
|
|
49
49
|
export declare const TABLE_GROUP_ACCESSORY_LIMIT = 4;
|
|
50
50
|
/** Trim, drop empty copy, and cap accessories at the second-track limit. */
|
|
51
51
|
export declare function tableGroupAccessories(group: TableGroup): TableGroupAccessory[];
|
|
52
|
-
/**
|
|
53
|
-
export declare const
|
|
52
|
+
/** Score recipes for a leading group-header hero spanning one or two tracks. */
|
|
53
|
+
export declare const TABLE_GROUP_HERO_SCORE_PRESENTATION: {
|
|
54
|
+
readonly 1: {
|
|
55
|
+
readonly size: "sm";
|
|
56
|
+
readonly variant: "default";
|
|
57
|
+
};
|
|
58
|
+
readonly 2: {
|
|
59
|
+
readonly size: "lg";
|
|
60
|
+
readonly variant: "default";
|
|
61
|
+
};
|
|
62
|
+
};
|
|
54
63
|
/** Resolve a supported group-header hero, or undefined when none is supplied. */
|
|
55
64
|
export declare function tableGroupHero(group: TableGroup): TableGroupHero | undefined;
|
|
56
65
|
export declare const TABLE_GROUP_INTENTS: readonly ["brand", "neutral", "negative", "warning", "caution", "positive"];
|
|
@@ -353,6 +353,8 @@ export interface TableGroupHeroScore {
|
|
|
353
353
|
kind: 'score';
|
|
354
354
|
value: string | number;
|
|
355
355
|
level?: SafetyScoreLevel;
|
|
356
|
+
/** Span one label track by default, or center a larger score across two tracks. */
|
|
357
|
+
tracks?: 1 | 2;
|
|
356
358
|
/** Accessible name prefix, for example “Safety score”. */
|
|
357
359
|
label?: string;
|
|
358
360
|
isLoading?: boolean;
|
|
@@ -46,6 +46,8 @@ export declare class TableVirtualController {
|
|
|
46
46
|
sizeFor(item: TableVirtualItem): number;
|
|
47
47
|
currentPlan(): TableVirtualPlan | null;
|
|
48
48
|
currentViewportSize(): number;
|
|
49
|
+
/** Reveal a supplied row without requiring its recycled DOM node to exist first. */
|
|
50
|
+
scrollRowIntoView(rowId: string, contentOffset?: number, stickyInset?: number): boolean;
|
|
49
51
|
/** Measure painted rows and correct scroll when estimates were wrong. */
|
|
50
52
|
collectMeasurements(root: ParentNode | null): void;
|
|
51
53
|
private applyMeasurements;
|
|
@@ -56,7 +56,7 @@ import { PanelSubNavBackground } from "./components/PanelSubNav/PanelSubNav";
|
|
|
56
56
|
import { PanelToolHeaderActionDetail, PanelToolsHeaderAction, PanelToolsHeaderActionDetail, PanelToolsHeaders, PanelToolsItem, PanelToolsRailAccessory, PanelToolsRailAccessoryActionDetail, PanelToolsToolId } from "./components/PanelTools/panel-tools-types";
|
|
57
57
|
import { PaperTextureConfig } from "./components/PaperTexture/paper-texture-types";
|
|
58
58
|
import { RadioOption, RadioSize } from "./components/Radio/Radio";
|
|
59
|
-
import { SafetyScoreLevel, ScoreSize } from "./components/Score/score-types";
|
|
59
|
+
import { SafetyScoreLevel, ScoreSize, ScoreVariant } from "./components/Score/score-types";
|
|
60
60
|
import { ScrollOverlayScrollDetail } from "./components/ScrollOverlay/ScrollOverlay";
|
|
61
61
|
import { SelectBackground, SelectIndicator, SelectOption, SelectOptionActionDetail, SelectOptionSubtextActionDetail, SelectPopupAlign, SelectSection, SelectSize, SelectValue, SelectWidth } from "./components/Select/Select";
|
|
62
62
|
import { ShellAppComposition, ShellNavigationConfig, ShellPageChromeConfig, ShellSectionNavigation, ShellToolsConfig } from "./components/ShellApp/shell-app-types";
|
|
@@ -130,7 +130,7 @@ export { PanelSubNavBackground } from "./components/PanelSubNav/PanelSubNav";
|
|
|
130
130
|
export { PanelToolHeaderActionDetail, PanelToolsHeaderAction, PanelToolsHeaderActionDetail, PanelToolsHeaders, PanelToolsItem, PanelToolsRailAccessory, PanelToolsRailAccessoryActionDetail, PanelToolsToolId } from "./components/PanelTools/panel-tools-types";
|
|
131
131
|
export { PaperTextureConfig } from "./components/PaperTexture/paper-texture-types";
|
|
132
132
|
export { RadioOption, RadioSize } from "./components/Radio/Radio";
|
|
133
|
-
export { SafetyScoreLevel, ScoreSize } from "./components/Score/score-types";
|
|
133
|
+
export { SafetyScoreLevel, ScoreSize, ScoreVariant } from "./components/Score/score-types";
|
|
134
134
|
export { ScrollOverlayScrollDetail } from "./components/ScrollOverlay/ScrollOverlay";
|
|
135
135
|
export { SelectBackground, SelectIndicator, SelectOption, SelectOptionActionDetail, SelectOptionSubtextActionDetail, SelectPopupAlign, SelectSection, SelectSize, SelectValue, SelectWidth } from "./components/Select/Select";
|
|
136
136
|
export { ShellAppComposition, ShellNavigationConfig, ShellPageChromeConfig, ShellSectionNavigation, ShellToolsConfig } from "./components/ShellApp/shell-app-types";
|
|
@@ -2561,6 +2561,11 @@ export namespace Components {
|
|
|
2561
2561
|
* @default ''
|
|
2562
2562
|
*/
|
|
2563
2563
|
"value": string | number;
|
|
2564
|
+
/**
|
|
2565
|
+
* Value typography recipe. `dense` keeps the selected size's fill dimensions and uses a larger emphasized figure with tighter surrounding space.
|
|
2566
|
+
* @default 'default'
|
|
2567
|
+
*/
|
|
2568
|
+
"variant": ScoreVariant;
|
|
2564
2569
|
}
|
|
2565
2570
|
interface DsScrollOverlay {
|
|
2566
2571
|
/**
|
|
@@ -3443,6 +3448,10 @@ export namespace Components {
|
|
|
3443
3448
|
* Optional explicit label for the horizontal/vertical scroll region.
|
|
3444
3449
|
*/
|
|
3445
3450
|
"scrollLabel": string | undefined;
|
|
3451
|
+
/**
|
|
3452
|
+
* Scroll the nearest vertical owner only enough to reveal a supplied row. Resolves false when the row is absent from the supplied, expanded table model. This method never moves focus.
|
|
3453
|
+
*/
|
|
3454
|
+
"scrollRowIntoView": (rowId: string) => Promise<boolean>;
|
|
3446
3455
|
/**
|
|
3447
3456
|
* Controlled selected row identities. IDs outside the loaded rows are preserved.
|
|
3448
3457
|
* @default []
|
|
@@ -8243,6 +8252,11 @@ declare namespace LocalJSX {
|
|
|
8243
8252
|
* @default ''
|
|
8244
8253
|
*/
|
|
8245
8254
|
"value"?: string | number;
|
|
8255
|
+
/**
|
|
8256
|
+
* Value typography recipe. `dense` keeps the selected size's fill dimensions and uses a larger emphasized figure with tighter surrounding space.
|
|
8257
|
+
* @default 'default'
|
|
8258
|
+
*/
|
|
8259
|
+
"variant"?: ScoreVariant;
|
|
8246
8260
|
}
|
|
8247
8261
|
interface DsScrollOverlay {
|
|
8248
8262
|
/**
|
|
@@ -10462,6 +10476,7 @@ declare namespace LocalJSX {
|
|
|
10462
10476
|
interface DsScoreAttributes {
|
|
10463
10477
|
"value": string;
|
|
10464
10478
|
"size": ScoreSize;
|
|
10479
|
+
"variant": ScoreVariant;
|
|
10465
10480
|
"level": SafetyScoreLevel | undefined;
|
|
10466
10481
|
"isLoading": boolean;
|
|
10467
10482
|
"label": string;
|
package/dist/vue/ds-score.js
CHANGED
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as e,H as s,h as o,a as r,t as n}from"./index.js";import{d as i}from"./p-1gt8QlyW.js";import{d as c}from"./p-aMyflqva.js";const a=["fair","good","excellent"];function d(e){return typeof e==="string"&&a.includes(e)}function t(e){if(typeof e==="string"&&e.trim()==="")return undefined;const s=typeof e==="number"?e:Number(e);if(!Number.isFinite(s)||s<0||s>100)return undefined;if(s<=50)return"fair";if(s<=80)return"good";return"excellent"}function l(e,s){return d(s)?s:t(e)}const b={sm:"text-title-small",md:"text-title-large",lg:"text-display-small"};const g=()=>`.ds-control-frame.sc-ds-score{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));border-radius:var(--ds-control-radius, var(--dimension-radius-025))}.ds-control-section-heading.sc-ds-score{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-control-icon-box.sc-ds-score{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md))}.ds-control-label-box.sc-ds-score{min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025))}.ds-control-label-dot.sc-ds-score{position:relative;padding-inline-end:calc( var(--ds-control-label-inset, var(--dimension-space-025)) + var(--ds-control-gap, var(--dimension-space-050)) )}.ds-control-label-dot__badge.sc-ds-score{position:absolute;inset-block-start:0;inset-inline-end:0;pointer-events:none}@media (forced-colors: active){.sc-ds-score:root,.sc-ds-score-h,.ds-forced-colors-scope.sc-ds-score{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-score-h{display:inline-flex;align-items:center;box-sizing:border-box;min-width:0;--_score-badge-inline-size:var(--dimension-size-500);--_score-badge-block-size:var(--dimension-size-400);--_score-skeleton-inset:calc(var(--_score-badge-block-size) / 8)}.score--sm.sc-ds-score-h{--_score-badge-inline-size:calc(var(--dimension-size-400) - var(--dimension-space-050));--_score-badge-block-size:var(--dimension-size-300)}.score--md.sc-ds-score-h{--_score-badge-inline-size:var(--dimension-size-500);--_score-badge-block-size:var(--dimension-size-400)}.score--lg.sc-ds-score-h{--_score-badge-inline-size:calc(var(--dimension-size-600) + var(--dimension-space-100));--_score-badge-block-size:var(--dimension-size-500)}.score__badge.sc-ds-score{display:flex;flex:0 0 auto;align-items:center;justify-content:center;box-sizing:border-box;inline-size:var(--_score-badge-inline-size);block-size:var(--_score-badge-block-size);overflow:hidden;border-radius:var(--dimension-radius-025);background:var(--color-background-faint-neutral);color:var(--color-foreground-bold-neutral);-webkit-user-select:none;user-select:none}.score__badge--fair.sc-ds-score{background:var(--color-safety-score-background-fair);color:var(--color-safety-score-foreground-on-fair)}.score__badge--good.sc-ds-score{background:var(--color-safety-score-background-good);color:var(--color-safety-score-foreground-on-good)}.score__badge--excellent.sc-ds-score{background:var(--color-safety-score-background-excellent);color:var(--color-safety-score-foreground-on-excellent)}.score__value.sc-ds-score,.score__badge.sc-ds-score ds-skeleton.sc-ds-score{flex:0 0 auto}.score__badge--loading.sc-ds-score{padding-inline:var(--_score-skeleton-inset)}.score__badge--loading.sc-ds-score .score__value.sc-ds-score{flex:1 1 auto;inline-size:100%;block-size:100%;max-inline-size:100%;max-block-size:100%;min-inline-size:0}@media (forced-colors: active){.score__badge.sc-ds-score{border:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);background:var(--ds-forced-color-surface);color:var(--ds-forced-color-content)}}`;const f=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.value="";this.size="md";this.isLoading=false;this.label=""}render(){const e=this.size;const s=l(this.value,this.level);const n=b[e];const i=[this.label.trim(),this.isLoading?"":this.value].filter(Boolean).join(" ");return o(r,{key:"d8cb0a5b2814b38808d345b64b7cf8086fb5c33f",class:{score:true,[`score--${e}`]:true,"score--loading":this.isLoading},role:i?"img":undefined,"aria-busy":this.isLoading?"true":undefined,"aria-label":i||undefined},o("span",{key:"eb7210283bcaa73fa1326579ea319ef8685df3fc",class:{score__badge:true,[`score__badge--${s}`]:Boolean(s),"score__badge--loading":this.isLoading}},this.isLoading?o("ds-skeleton",{class:"score__value",variant:"text",textVariant:n,background:s?"bold":"faint"}):o("ds-text",{as:"span",class:"score__value ds-control-label-box",variant:n,emphasis:true,color:"inherit",fontFeature:"tabular-nums"},this.value)))}static get style(){return g()}},[2,"ds-score",{value:[8],size:[1],level:[1],isLoading:[4,"is-loading"],label:[1]}]);function u(){if(typeof customElements==="undefined"){return}const e=["ds-score","ds-skeleton","ds-text"];e.forEach((e=>{switch(e){case"ds-score":if(!customElements.get(n(e))){customElements.define(n(e),f)}break;case"ds-skeleton":if(!customElements.get(n(e))){i()}break;case"ds-text":if(!customElements.get(n(e))){c()}break}}))}u();export{f as S,u as d,d as i};
|
|
2
|
-
//# sourceMappingURL=p-DDOuPq-N.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SAFETY_SCORE_LEVELS","isSafetyScoreLevel","value","includes","resolveSafetyScoreLevel","trim","undefined","numericValue","Number","isFinite","resolveScoreLevel","level","SCORE_VALUE_VARIANT","sm","md","lg","scoreCss","Score","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","size","isLoading","label","render","valueVariant","accessibleName","filter","Boolean","join","h","Host","key","class","score","role","score__badge","variant","textVariant","background","as","emphasis","color","fontFeature"],"sources":["src/wc/components/Score/score-types.ts","src/wc/components/Score/score-model.ts","src/wc/components/Score/Score.css?tag=ds-score&encapsulation=scoped","src/wc/components/Score/Score.tsx"],"sourcesContent":["export type SafetyScoreLevel = 'fair' | 'good' | 'excellent';\nexport type ScoreSize = 'sm' | 'md' | 'lg';\n\nexport const SCORE_SIZES = ['sm', 'md', 'lg'] as const;\nexport const SAFETY_SCORE_LEVELS = ['fair', 'good', 'excellent'] as const;\n","import { SAFETY_SCORE_LEVELS, type SafetyScoreLevel, type ScoreSize } from './score-types';\n\nexport function isSafetyScoreLevel(value: unknown): value is SafetyScoreLevel {\n return typeof value === 'string' && (SAFETY_SCORE_LEVELS as readonly string[]).includes(value);\n}\n\n/**\n * Infer a safety-score color level from a 0–100 figure. Non-numeric or out-of-range\n * values return undefined so the owner can supply `level` explicitly.\n */\nexport function resolveSafetyScoreLevel(value: string | number): SafetyScoreLevel | undefined {\n if (typeof value === 'string' && value.trim() === '') return undefined;\n const numericValue = typeof value === 'number' ? value : Number(value);\n if (!Number.isFinite(numericValue) || numericValue < 0 || numericValue > 100) return undefined;\n if (numericValue <= 50) return 'fair';\n if (numericValue <= 80) return 'good';\n return 'excellent';\n}\n\nexport function resolveScoreLevel(\n value: string | number,\n level?: SafetyScoreLevel\n): SafetyScoreLevel | undefined {\n return isSafetyScoreLevel(level) ? level : resolveSafetyScoreLevel(value);\n}\n\nexport const SCORE_VALUE_VARIANT = {\n sm: 'text-title-small',\n md: 'text-title-large',\n lg: 'text-display-small',\n} as const satisfies Record<\n ScoreSize,\n 'text-title-small' | 'text-title-large' | 'text-display-small'\n>;\n","@import '../../utils/control-parts.css';\n@import '../../utils/forced-colors.css';\n\n:host {\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n min-width: 0;\n --_score-badge-inline-size: var(--dimension-size-500);\n --_score-badge-block-size: var(--dimension-size-400);\n /* Matches the text skeleton’s 75% bar so the fill inset is even on all sides. */\n --_score-skeleton-inset: calc(var(--_score-badge-block-size) / 8);\n}\n\n:host(.score--sm) {\n --_score-badge-inline-size: calc(var(--dimension-size-400) - var(--dimension-space-050));\n --_score-badge-block-size: var(--dimension-size-300);\n}\n\n:host(.score--md) {\n --_score-badge-inline-size: var(--dimension-size-500);\n --_score-badge-block-size: var(--dimension-size-400);\n}\n\n:host(.score--lg) {\n --_score-badge-inline-size: calc(var(--dimension-size-600) + var(--dimension-space-100));\n --_score-badge-block-size: var(--dimension-size-500);\n}\n\n.score__badge {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n inline-size: var(--_score-badge-inline-size);\n block-size: var(--_score-badge-block-size);\n overflow: hidden;\n border-radius: var(--dimension-radius-025);\n background: var(--color-background-faint-neutral);\n color: var(--color-foreground-bold-neutral);\n -webkit-user-select: none;\n user-select: none;\n}\n\n.score__badge--fair {\n background: var(--color-safety-score-background-fair);\n color: var(--color-safety-score-foreground-on-fair);\n}\n\n.score__badge--good {\n background: var(--color-safety-score-background-good);\n color: var(--color-safety-score-foreground-on-good);\n}\n\n.score__badge--excellent {\n background: var(--color-safety-score-background-excellent);\n color: var(--color-safety-score-foreground-on-excellent);\n}\n\n.score__value,\n.score__badge ds-skeleton {\n flex: 0 0 auto;\n}\n\n.score__badge--loading {\n padding-inline: var(--_score-skeleton-inset);\n}\n\n.score__badge--loading .score__value {\n flex: 1 1 auto;\n inline-size: 100%;\n block-size: 100%;\n max-inline-size: 100%;\n max-block-size: 100%;\n min-inline-size: 0;\n}\n\n@media (forced-colors: active) {\n .score__badge {\n border: var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);\n background: var(--ds-forced-color-surface);\n color: var(--ds-forced-color-content);\n }\n}\n","import { Component, Prop, h, Host } from '@stencil/core';\nimport { SCORE_VALUE_VARIANT, resolveScoreLevel } from './score-model';\nimport type { SafetyScoreLevel, ScoreSize } from './score-types';\n\n@Component({\n tag: 'ds-score',\n styleUrl: 'Score.css',\n scoped: true,\n})\nexport class Score {\n /** Display-ready headline figure. */\n @Prop() value: string | number = '';\n /**\n * Visual density matching control height: `sm` 24px, `md` 32px, `lg` 40px.\n * `lg` is the Card Overview recipe.\n */\n @Prop() size: ScoreSize = 'md';\n /**\n * Safety-score color level. Numeric values from 0–100 infer fair (0–50),\n * good (51–80), or excellent (81–100) when this is omitted.\n */\n @Prop() level: SafetyScoreLevel | undefined;\n /** Replace the figure with a skeleton while data resolves. */\n @Prop() isLoading: boolean = false;\n /** Accessible name prefix, for example “Safety score”. */\n @Prop() label: string = '';\n\n render() {\n const size = this.size;\n const level = resolveScoreLevel(this.value, this.level);\n const valueVariant = SCORE_VALUE_VARIANT[size];\n const accessibleName = [this.label.trim(), this.isLoading ? '' : this.value]\n .filter(Boolean)\n .join(' ');\n\n return (\n <Host\n class={{\n score: true,\n [`score--${size}`]: true,\n 'score--loading': this.isLoading,\n }}\n role={accessibleName ? 'img' : undefined}\n aria-busy={this.isLoading ? 'true' : undefined}\n aria-label={accessibleName || undefined}\n >\n <span\n class={{\n score__badge: true,\n [`score__badge--${level}`]: Boolean(level),\n 'score__badge--loading': this.isLoading,\n }}\n >\n {this.isLoading ? (\n <ds-skeleton\n class=\"score__value\"\n variant=\"text\"\n textVariant={valueVariant}\n background={level ? 'bold' : 'faint'}\n />\n ) : (\n <ds-text\n as=\"span\"\n class=\"score__value ds-control-label-box\"\n variant={valueVariant}\n emphasis={true}\n color=\"inherit\"\n fontFeature=\"tabular-nums\"\n >\n {this.value}\n </ds-text>\n )}\n </span>\n </Host>\n );\n }\n}\n"],"mappings":"mIAIO,MAAMA,EAAsB,CAAC,OAAQ,OAAQ,aCF9C,SAAUC,EAAmBC,GACjC,cAAcA,IAAU,UAAaF,EAA0CG,SAASD,EAC1F,CAMM,SAAUE,EAAwBF,GACtC,UAAWA,IAAU,UAAYA,EAAMG,SAAW,GAAI,OAAOC,UAC7D,MAAMC,SAAsBL,IAAU,SAAWA,EAAQM,OAAON,GAChE,IAAKM,OAAOC,SAASF,IAAiBA,EAAe,GAAKA,EAAe,IAAK,OAAOD,UACrF,GAAIC,GAAgB,GAAI,MAAO,OAC/B,GAAIA,GAAgB,GAAI,MAAO,OAC/B,MAAO,WACT,CAEM,SAAUG,EACdR,EACAS,GAEA,OAAOV,EAAmBU,GAASA,EAAQP,EAAwBF,EACrE,CAEO,MAAMU,EAAsB,CACjCC,GAAI,mBACJC,GAAI,mBACJC,GAAI,sBC7BN,MAAMC,EAAW,IAAM,yqH,MCSVC,EAAKC,EAAA,MAAAD,UAAAE,EALlB,WAAAC,CAAAC,G,4CAOUC,KAAApB,MAAyB,GAKzBoB,KAAAC,KAAkB,KAOlBD,KAAAE,UAAqB,MAErBF,KAAAG,MAAgB,EAmDzB,CAjDC,MAAAC,GACE,MAAMH,EAAOD,KAAKC,KAClB,MAAMZ,EAAQD,EAAkBY,KAAKpB,MAAOoB,KAAKX,OACjD,MAAMgB,EAAef,EAAoBW,GACzC,MAAMK,EAAiB,CAACN,KAAKG,MAAMpB,OAAQiB,KAAKE,UAAY,GAAKF,KAAKpB,OACnE2B,OAAOC,SACPC,KAAK,KAER,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAO,CACLC,MAAO,KACP,CAAC,UAAUb,KAAS,KACpB,iBAAkBD,KAAKE,WAEzBa,KAAMT,EAAiB,MAAQtB,UAAS,YAC7BgB,KAAKE,UAAY,OAASlB,UAAS,aAClCsB,GAAkBtB,WAE9B0B,EAAA,QAAAE,IAAA,2CACEC,MAAO,CACLG,aAAc,KACd,CAAC,iBAAiB3B,KAAUmB,QAAQnB,GACpC,wBAAyBW,KAAKE,YAG/BF,KAAKE,UACJQ,EAAA,eACEG,MAAM,eACNI,QAAQ,OACRC,YAAab,EACbc,WAAY9B,EAAQ,OAAS,UAG/BqB,EAAA,WACEU,GAAG,OACHP,MAAM,oCACNI,QAASZ,EACTgB,SAAU,KACVC,MAAM,UACNC,YAAY,gBAEXvB,KAAKpB,Q","ignoreList":[]}
|