@ds-mo/ui 2.8.0 → 2.9.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.
Files changed (119) hide show
  1. package/README.md +8 -9
  2. package/dist/.build-stamp +1 -1
  3. package/dist/components/ds-app-shell.js +1 -1
  4. package/dist/components/ds-banner.js +1 -1
  5. package/dist/components/ds-bar-nav.js +1 -1
  6. package/dist/components/{ds-toggle-button.d.ts → ds-button-filled.d.ts} +4 -4
  7. package/dist/components/ds-button-filled.js +2 -0
  8. package/dist/components/ds-button-unfilled-icon.js +1 -1
  9. package/dist/components/{ds-button-group.d.ts → ds-card-setting.d.ts} +4 -4
  10. package/dist/components/ds-card-setting.js +2 -0
  11. package/dist/components/ds-card-setting.js.map +1 -0
  12. package/dist/components/ds-card.js +1 -1
  13. package/dist/components/ds-checkbox.js +1 -1
  14. package/dist/components/ds-chip.js +1 -1
  15. package/dist/components/ds-divider.js +1 -1
  16. package/dist/components/ds-empty-state.js +1 -1
  17. package/dist/components/ds-empty-state.js.map +1 -1
  18. package/dist/components/ds-fade.js +1 -1
  19. package/dist/components/ds-field.js +1 -1
  20. package/dist/components/ds-field.js.map +1 -1
  21. package/dist/components/ds-header.js +1 -1
  22. package/dist/components/ds-icon.js +1 -1
  23. package/dist/components/ds-input.js +1 -1
  24. package/dist/components/ds-loader.js +1 -1
  25. package/dist/components/ds-loader.js.map +1 -1
  26. package/dist/components/ds-menu.js +1 -1
  27. package/dist/components/ds-modal.js +1 -1
  28. package/dist/components/ds-panel-nav.js +1 -1
  29. package/dist/components/ds-panel-tools.js +1 -1
  30. package/dist/components/ds-panel-tools.js.map +1 -1
  31. package/dist/components/ds-radio-group.js +1 -1
  32. package/dist/components/ds-scrollbar.js +1 -1
  33. package/dist/components/ds-select.js +1 -1
  34. package/dist/components/ds-shell-gradient-picker.js +1 -1
  35. package/dist/components/ds-shell-gradient-swatch.js +1 -1
  36. package/dist/components/ds-slider.js +1 -1
  37. package/dist/components/ds-surface.js +1 -1
  38. package/dist/components/ds-tab-group-nav.js +1 -1
  39. package/dist/components/ds-tab-group.js +1 -1
  40. package/dist/components/ds-table.js +1 -1
  41. package/dist/components/ds-table.js.map +1 -1
  42. package/dist/components/ds-tag.js +1 -1
  43. package/dist/components/ds-text.js +1 -1
  44. package/dist/components/ds-toast-provider.js +1 -1
  45. package/dist/components/ds-toggle.js +1 -1
  46. package/dist/components/ds-tooltip.js +1 -1
  47. package/dist/components/ds-tooltip.js.map +1 -1
  48. package/dist/components/{p-D4zKc1RW.js → p-BA6a6P0b.js} +2 -2
  49. package/dist/components/{p-DvBrQuie.js → p-CDNVPM2x.js} +2 -2
  50. package/dist/components/{p-DqBCQRRd.js → p-CF4avTQw.js} +2 -2
  51. package/dist/components/{p-C9za7IDu.js → p-CJubWt1F.js} +2 -2
  52. package/dist/components/{p-DDEAcGac.js → p-CKCBqwIw.js} +2 -2
  53. package/dist/components/{p-DDEAcGac.js.map → p-CKCBqwIw.js.map} +1 -1
  54. package/dist/components/p-C_hgdYcC.js +2 -0
  55. package/dist/components/p-C_hgdYcC.js.map +1 -0
  56. package/dist/components/p-Cv5NDZug.js +2 -0
  57. package/dist/components/p-Cv5NDZug.js.map +1 -0
  58. package/dist/components/{p-B3ua1NkM.js → p-DnGr8qtq.js} +2 -2
  59. package/dist/components/p-jjfqrXnP.js +2 -0
  60. package/dist/components/p-jjfqrXnP.js.map +1 -0
  61. package/dist/types/components/ButtonFilled/ButtonFilled.d.ts +26 -0
  62. package/dist/types/components/ButtonFilled/index.d.ts +2 -0
  63. package/dist/types/components/ButtonUnfilledIcon/ButtonUnfilledIcon.d.ts +9 -2
  64. package/dist/types/components/ButtonUnfilledIcon/index.d.ts +1 -1
  65. package/dist/types/components/CardSetting/CardSetting.d.ts +16 -0
  66. package/dist/types/components/CardSetting/index.d.ts +2 -0
  67. package/dist/types/components.d.ts +127 -412
  68. package/package.json +1 -1
  69. package/src/angular/index.ts +2 -4
  70. package/src/angular/proxies.ts +40 -105
  71. package/src/react/components.ts +2 -4
  72. package/src/react/ds-button-filled.ts +27 -0
  73. package/src/react/ds-card-setting.ts +27 -0
  74. package/src/wc/components/ButtonFilled/ButtonFilled.tsx +86 -0
  75. package/src/wc/components/ButtonFilled/index.ts +1 -0
  76. package/src/wc/components/ButtonUnfilledIcon/ButtonUnfilledIcon.tsx +19 -11
  77. package/src/wc/components/ButtonUnfilledIcon/index.ts +1 -1
  78. package/src/wc/components/CardSetting/CardSetting.tsx +96 -0
  79. package/src/wc/components/CardSetting/index.ts +1 -0
  80. package/src/wc/components.d.ts +127 -412
  81. package/dist/components/ds-button-group.js +0 -2
  82. package/dist/components/ds-button-group.js.map +0 -1
  83. package/dist/components/ds-button.d.ts +0 -11
  84. package/dist/components/ds-button.js +0 -2
  85. package/dist/components/ds-toggle-button-group.d.ts +0 -11
  86. package/dist/components/ds-toggle-button-group.js +0 -2
  87. package/dist/components/ds-toggle-button-group.js.map +0 -1
  88. package/dist/components/ds-toggle-button.js +0 -2
  89. package/dist/components/ds-toggle-button.js.map +0 -1
  90. package/dist/components/p-BPMJx63I.js +0 -2
  91. package/dist/components/p-BPMJx63I.js.map +0 -1
  92. package/dist/components/p-BTndnbR_.js +0 -2
  93. package/dist/components/p-BTndnbR_.js.map +0 -1
  94. package/dist/components/p-C0CUGiLm.js +0 -2
  95. package/dist/components/p-C0CUGiLm.js.map +0 -1
  96. package/dist/components/p-DUDppafq.js +0 -2
  97. package/dist/components/p-DUDppafq.js.map +0 -1
  98. package/dist/components/p-DgDSRPSP.js +0 -2
  99. package/dist/components/p-DgDSRPSP.js.map +0 -1
  100. package/dist/types/components/Button/Button.d.ts +0 -38
  101. package/dist/types/components/Button/index.d.ts +0 -2
  102. package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +0 -29
  103. package/dist/types/components/ToggleButton/ToggleButton.d.ts +0 -37
  104. package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +0 -33
  105. package/src/react/ds-button-group.ts +0 -27
  106. package/src/react/ds-button.ts +0 -35
  107. package/src/react/ds-toggle-button-group.ts +0 -27
  108. package/src/react/ds-toggle-button.ts +0 -27
  109. package/src/wc/components/Button/Button.tsx +0 -158
  110. package/src/wc/components/Button/index.ts +0 -1
  111. package/src/wc/components/ButtonGroup/ButtonGroup.tsx +0 -110
  112. package/src/wc/components/ToggleButton/ToggleButton.tsx +0 -124
  113. package/src/wc/components/ToggleButtonGroup/ToggleButtonGroup.tsx +0 -118
  114. /package/dist/components/{ds-button.js.map → ds-button-filled.js.map} +0 -0
  115. /package/dist/components/{p-D4zKc1RW.js.map → p-BA6a6P0b.js.map} +0 -0
  116. /package/dist/components/{p-DvBrQuie.js.map → p-CDNVPM2x.js.map} +0 -0
  117. /package/dist/components/{p-DqBCQRRd.js.map → p-CF4avTQw.js.map} +0 -0
  118. /package/dist/components/{p-C9za7IDu.js.map → p-CJubWt1F.js.map} +0 -0
  119. /package/dist/components/{p-B3ua1NkM.js.map → p-DnGr8qtq.js.map} +0 -0
@@ -1,124 +0,0 @@
1
- import { Component, Prop, Event, EventEmitter, h, Host } from '@stencil/core';
2
- import type { IconSize } from '../Icon/Icon';
3
- import { resolveCssLengthPx, TOKEN_DEFAULTS } from '../../utils';
4
-
5
- export type ToggleButtonElevation = 'none' | 'flat' | 'elevated' | 'floating';
6
- export type ToggleButtonSize = 'md' | 'sm' | 'xs';
7
- export type ToggleButtonBackground = 'faint' | 'medium' | 'bold' | 'strong' | 'always-dark';
8
-
9
- const ICON_SIZE: Record<ToggleButtonSize, IconSize> = { md: 'md', sm: 'sm', xs: 'xs' };
10
-
11
- const ICON_TOKEN: Record<ToggleButtonSize, string> = {
12
- md: TOKEN_DEFAULTS.iconographyMd,
13
- sm: TOKEN_DEFAULTS.iconographySm,
14
- xs: TOKEN_DEFAULTS.iconographyXs,
15
- };
16
-
17
- const TEXT_CLASS: Record<ToggleButtonSize, string> = {
18
- md: 'text-body-medium-emphasis',
19
- sm: 'text-body-small-emphasis',
20
- xs: 'text-caption-emphasis',
21
- };
22
-
23
- @Component({
24
- tag: 'ds-toggle-button',
25
- styleUrl: 'ToggleButton.css',
26
- scoped: true,
27
- })
28
- export class ToggleButton {
29
- /**
30
- * Chrome level.
31
- * none — ghost (transparent, no border, no shadow)
32
- * flat — border only, transparent bg
33
- * elevated — bg-primary + shadow [default]
34
- * floating — bg-primary + FAB-strength shadow
35
- */
36
- @Prop() elevation: ToggleButtonElevation = 'elevated';
37
-
38
- /** Label text. */
39
- @Prop() label: string | undefined;
40
-
41
- /**
42
- * Icon name for <ds-icon>. Set via JS property.
43
- * @example el.icon = 'GridView';
44
- */
45
- @Prop() icon: string | undefined;
46
-
47
- /** Size: md (32px), sm (24px), xs (16px). */
48
- @Prop() size: ToggleButtonSize = 'md';
49
-
50
- /** Pill shape. */
51
- @Prop() rounded: boolean = false;
52
-
53
- /** Parent surface context — adjusts hover tokens for colored backgrounds. */
54
- @Prop() background: ToggleButtonBackground | undefined;
55
-
56
- /** Controlled pressed state. */
57
- @Prop({ mutable: true }) pressed: boolean = false;
58
-
59
- /** Disables interaction. */
60
- @Prop() inactive: boolean = false;
61
-
62
- @Prop({ attribute: 'aria-label' }) ariaLabel: string | undefined;
63
-
64
- /** Emits the new pressed value (!pressed) on click. */
65
- @Event() dsChange!: EventEmitter<boolean>;
66
-
67
- private handleClick = () => {
68
- if (this.inactive) return;
69
- this.dsChange.emit(!this.pressed);
70
- };
71
-
72
- render() {
73
- const size = this.size;
74
- const iconSize = ICON_SIZE[size];
75
- const iconPx = resolveCssLengthPx(ICON_TOKEN[size], ICON_TOKEN[size]);
76
- const textClass = TEXT_CLASS[size];
77
- const hasIcon = !!this.icon;
78
- const hasLabel = !!this.label;
79
- const isIconOnly = hasIcon && !hasLabel;
80
- const isLabelOnly = hasLabel && !hasIcon;
81
- const isIconAndLabel = hasIcon && hasLabel;
82
- const bg = this.background;
83
- const elevKey = this.elevation.charAt(0).toUpperCase() + this.elevation.slice(1);
84
-
85
- const cls: Record<string, boolean> = {
86
- 'toggle-btn': true,
87
- [`elevation${elevKey}`]: true,
88
- sizeSM: size === 'sm',
89
- sizeXS: size === 'xs',
90
- rounded: this.rounded,
91
- inactive: this.inactive,
92
- pressed: this.pressed,
93
- iconOnly: isIconOnly,
94
- labelOnly: isLabelOnly,
95
- iconAndLabel: isIconAndLabel,
96
- onMedium: bg === 'medium',
97
- onBold: bg === 'bold',
98
- onStrong: bg === 'strong',
99
- onAlwaysDark: bg === 'always-dark',
100
- };
101
-
102
- return (
103
- <Host>
104
- <button
105
- type="button"
106
- class={cls}
107
- disabled={this.inactive}
108
- aria-label={this.ariaLabel ?? this.label ?? 'toggle'}
109
- aria-pressed={this.pressed}
110
- onClick={this.handleClick}
111
- >
112
- {hasIcon && (
113
- <span class="toggle-btn__icon" style={{ fontSize: `${iconPx}px` }}>
114
- <ds-icon name={this.icon} size={iconSize} />
115
- </span>
116
- )}
117
- {hasLabel && (
118
- <span class={`toggle-btn__label ${textClass}`}>{this.label}</span>
119
- )}
120
- </button>
121
- </Host>
122
- );
123
- }
124
- }
@@ -1,118 +0,0 @@
1
- import { Component, Prop, Event, EventEmitter, h, Host } from '@stencil/core';
2
-
3
- export type ToggleGroupElevation = 'none' | 'flat' | 'elevated' | 'floating';
4
- export type ToggleGroupSize = 'md' | 'sm' | 'xs';
5
- export type ToggleGroupBackground = 'faint' | 'medium' | 'bold' | 'strong' | 'always-dark';
6
-
7
- export interface ToggleGroupItem {
8
- id: string;
9
- label?: string;
10
- /** Icon name for <ds-icon>. */
11
- icon?: string;
12
- inactive?: boolean;
13
- }
14
-
15
- @Component({
16
- tag: 'ds-toggle-button-group',
17
- styleUrl: 'ToggleButtonGroup.css',
18
- scoped: true,
19
- })
20
- export class ToggleButtonGroup {
21
- /**
22
- * Array of item descriptors. Set via JS property.
23
- * @example el.items = [{ id: 'list', label: 'List' }, { id: 'grid', icon: 'GridView' }];
24
- */
25
- @Prop() items: ToggleGroupItem[] = [];
26
-
27
- /** ID of the currently selected / pressed item. */
28
- @Prop({ mutable: true }) value: string = '';
29
-
30
- /** Chrome level for the group container. */
31
- @Prop() elevation: ToggleGroupElevation = 'elevated';
32
-
33
- /** Size passed to each ds-toggle-button. */
34
- @Prop() size: ToggleGroupSize = 'md';
35
-
36
- /** Pill shape for group + buttons. */
37
- @Prop() rounded: boolean = false;
38
-
39
- /** Parent surface context. */
40
- @Prop() background: ToggleGroupBackground | undefined;
41
-
42
- /** Emits the id of the newly selected item. */
43
- @Event() dsChange!: EventEmitter<string>;
44
-
45
- private handleItemChange(id: string) {
46
- if (id === this.value) return;
47
- this.value = id;
48
- this.dsChange.emit(id);
49
- }
50
-
51
- render() {
52
- const items = this.items;
53
- const count = items.length;
54
- const elev = this.elevation;
55
- const elevKey = elev.charAt(0).toUpperCase() + elev.slice(1);
56
- const bg = this.background;
57
- const isGhost = elev === 'none';
58
-
59
- const groupCls: Record<string, boolean> = {
60
- group: true,
61
- [`group${elevKey}`]: true,
62
- groupRounded: this.rounded,
63
- };
64
-
65
- return (
66
- <Host>
67
- <div class={groupCls} role="group">
68
- {items.map((item, i) => {
69
- const isFirst = i === 0;
70
- const isLast = i === count - 1;
71
- const isMid = !isFirst && !isLast;
72
- const isPressed = item.id === this.value;
73
- const isIconOnly = !!item.icon && !item.label;
74
- const needsRoundedCorrection = this.rounded && !isIconOnly && this.size !== 'xs';
75
- const sizeKey = this.size.toUpperCase() as 'MD' | 'SM' | 'XS';
76
-
77
- const itemCls: Record<string, boolean> = {
78
- item: true,
79
- first: isFirst,
80
- last: isLast,
81
- middle: isMid,
82
- itemShort: isGhost,
83
- itemPressed: isGhost && isPressed,
84
- [`roundedFirst${sizeKey}`]: !!(needsRoundedCorrection && isFirst),
85
- [`roundedLast${sizeKey}`]: !!(needsRoundedCorrection && isLast),
86
- [`roundedMid${sizeKey}`]: !!(needsRoundedCorrection && isMid),
87
- };
88
-
89
- const dividerCls: Record<string, boolean> = {
90
- divider: true,
91
- dividerGhost: isGhost,
92
- dividerGhostXS: isGhost && this.size === 'xs',
93
- dividerGhostSM: isGhost && this.size === 'sm',
94
- };
95
-
96
- return [
97
- i > 0 && (
98
- <div class={dividerCls} aria-hidden="true" />
99
- ),
100
- <ds-toggle-button
101
- class={itemCls}
102
- elevation={elev}
103
- size={this.size}
104
- label={item.label}
105
- icon={item.icon}
106
- rounded={this.rounded}
107
- background={bg}
108
- pressed={isPressed}
109
- inactive={item.inactive}
110
- onDsChange={() => this.handleItemChange(item.id)}
111
- />,
112
- ];
113
- })}
114
- </div>
115
- </Host>
116
- );
117
- }
118
- }