@ds-mo/ui 9.0.0 → 9.1.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 (122) hide show
  1. package/README.md +28 -0
  2. package/dist/.build-stamp +1 -1
  3. package/dist/agent-patterns.json +233 -0
  4. package/dist/agent.json +155 -19
  5. package/dist/angular/ds-menu.d.ts +6 -1
  6. package/dist/angular/ds-menu.js +7 -4
  7. package/dist/angular/ds-swatch-picker.d.ts +15 -0
  8. package/dist/angular/ds-swatch-picker.js +42 -0
  9. package/dist/angular/index.d.ts +1 -1
  10. package/dist/angular/index.js +1 -0
  11. package/dist/angular/proxies.d.ts +1 -0
  12. package/dist/angular/proxies.js +1 -0
  13. package/dist/components/ds-app-shell.js +1 -1
  14. package/dist/components/ds-bar-nav.js +1 -1
  15. package/dist/components/ds-bar-nav.js.map +1 -1
  16. package/dist/components/ds-menu.js +1 -1
  17. package/dist/components/ds-panel-nav.js +1 -1
  18. package/dist/components/ds-panel-nav.js.map +1 -1
  19. package/dist/components/ds-select-multi.js +1 -1
  20. package/dist/components/ds-select-multi.js.map +1 -1
  21. package/dist/components/ds-select.js +1 -1
  22. package/dist/components/ds-select.js.map +1 -1
  23. package/dist/components/ds-shell-gradient-picker.js +1 -1
  24. package/dist/components/ds-shell-gradient-picker.js.map +1 -1
  25. package/dist/components/ds-shell-gradient-swatch.js +1 -1
  26. package/dist/components/ds-shell-gradient-swatch.js.map +1 -1
  27. package/dist/components/ds-slider.js +1 -1
  28. package/dist/components/ds-slider.js.map +1 -1
  29. package/dist/components/ds-swatch-picker.d.ts +11 -0
  30. package/dist/components/ds-swatch-picker.js +2 -0
  31. package/dist/components/ds-swatch-picker.js.map +1 -0
  32. package/dist/components/ds-tooltip-data-viz.js +1 -1
  33. package/dist/components/p-D1HFMTdC.js +2 -0
  34. package/dist/components/p-D1HFMTdC.js.map +1 -0
  35. package/dist/components/p-HBIxvS5C.js +2 -0
  36. package/dist/components/p-HBIxvS5C.js.map +1 -0
  37. package/dist/components/p-l6PmnW_P.js +2 -0
  38. package/dist/components/p-l6PmnW_P.js.map +1 -0
  39. package/dist/components/p-tQ1QHeOE.js +2 -0
  40. package/dist/components/p-tQ1QHeOE.js.map +1 -0
  41. package/dist/docs/components.json +268 -30
  42. package/dist/lib/components/Menu/menu-placement.d.ts +6 -3
  43. package/dist/lib/shell/index.d.ts +2 -2
  44. package/dist/lib/shell/index.js +40 -39
  45. package/dist/lib/shell/index.js.map +3 -3
  46. package/dist/lib/shell/shell-gradient-presets.d.ts +15 -0
  47. package/dist/lib/utils/choice-popup-alignment.d.ts +20 -0
  48. package/dist/lib/utils/index.d.ts +2 -0
  49. package/dist/lib/utils/index.js +16 -0
  50. package/dist/lib/utils/index.js.map +3 -3
  51. package/dist/mcp/cli.js +31409 -0
  52. package/dist/mcp-data/registry/app-shell.json +210 -0
  53. package/dist/mcp-data/registry/badge.json +289 -0
  54. package/dist/mcp-data/registry/banner.json +206 -0
  55. package/dist/mcp-data/registry/bar-nav.json +341 -0
  56. package/dist/mcp-data/registry/button-filled.json +386 -0
  57. package/dist/mcp-data/registry/button-unfilled.json +537 -0
  58. package/dist/mcp-data/registry/card-data-viz-donut.json +143 -0
  59. package/dist/mcp-data/registry/card-setting.json +194 -0
  60. package/dist/mcp-data/registry/card-shell-data-viz.json +173 -0
  61. package/dist/mcp-data/registry/card.json +126 -0
  62. package/dist/mcp-data/registry/chart-bar.json +121 -0
  63. package/dist/mcp-data/registry/chart-donut.json +257 -0
  64. package/dist/mcp-data/registry/chart-legend.json +209 -0
  65. package/dist/mcp-data/registry/chart-line.json +153 -0
  66. package/dist/mcp-data/registry/checkbox.json +361 -0
  67. package/dist/mcp-data/registry/chip.json +276 -0
  68. package/dist/mcp-data/registry/divider.json +225 -0
  69. package/dist/mcp-data/registry/empty-state.json +197 -0
  70. package/dist/mcp-data/registry/field.json +222 -0
  71. package/dist/mcp-data/registry/icon.json +242 -0
  72. package/dist/mcp-data/registry/input.json +597 -0
  73. package/dist/mcp-data/registry/loader.json +192 -0
  74. package/dist/mcp-data/registry/menu.json +459 -0
  75. package/dist/mcp-data/registry/modal.json +150 -0
  76. package/dist/mcp-data/registry/panel-nav.json +622 -0
  77. package/dist/mcp-data/registry/panel-sub-nav.json +249 -0
  78. package/dist/mcp-data/registry/panel-tools.json +374 -0
  79. package/dist/mcp-data/registry/radio.json +374 -0
  80. package/dist/mcp-data/registry/registry.json +5389 -0
  81. package/dist/mcp-data/registry/select-multi.json +755 -0
  82. package/dist/mcp-data/registry/select.json +740 -0
  83. package/dist/mcp-data/registry/shell-gradient-picker.json +195 -0
  84. package/dist/mcp-data/registry/shell-gradient-swatch.json +215 -0
  85. package/dist/mcp-data/registry/skeleton.json +282 -0
  86. package/dist/mcp-data/registry/slider.json +657 -0
  87. package/dist/mcp-data/registry/swatch-picker.json +231 -0
  88. package/dist/mcp-data/registry/switch.json +361 -0
  89. package/dist/mcp-data/registry/tab-group.json +255 -0
  90. package/dist/mcp-data/registry/tag.json +352 -0
  91. package/dist/mcp-data/registry/text.json +371 -0
  92. package/dist/mcp-data/registry/tooltip-data-viz.json +158 -0
  93. package/dist/mcp-data/registry/tooltip.json +311 -0
  94. package/dist/react/components.d.ts +1 -0
  95. package/dist/react/components.js +1 -0
  96. package/dist/react/ds-menu.d.ts +1 -0
  97. package/dist/react/ds-menu.js +2 -1
  98. package/dist/react/ds-swatch-picker.d.ts +12 -0
  99. package/dist/react/ds-swatch-picker.js +12 -0
  100. package/dist/types/components/Menu/Menu.d.ts +7 -1
  101. package/dist/types/components/Menu/menu-placement.d.ts +6 -3
  102. package/dist/types/components/Menu/menu-types.d.ts +14 -1
  103. package/dist/types/components/ShellGradientPicker/ShellGradientPicker.d.ts +2 -5
  104. package/dist/types/components/ShellGradientSwatch/ShellGradientSwatch.d.ts +1 -0
  105. package/dist/types/components/SwatchPicker/SwatchPicker.d.ts +21 -0
  106. package/dist/types/components/SwatchPicker/swatch-picker-types.d.ts +26 -0
  107. package/dist/types/components.d.ts +117 -0
  108. package/dist/types/shell/index.d.ts +2 -2
  109. package/dist/types/shell/shell-gradient-presets.d.ts +15 -0
  110. package/dist/types/utils/choice-popup-alignment.d.ts +21 -0
  111. package/dist/types/utils/index.d.ts +2 -0
  112. package/package.json +6 -2
  113. package/dist/components/p-Bafp65bw.js +0 -2
  114. package/dist/components/p-Bafp65bw.js.map +0 -1
  115. package/dist/components/p-BdnR3jxi.js +0 -2
  116. package/dist/components/p-BdnR3jxi.js.map +0 -1
  117. package/dist/components/p-C_cu-HIT.js +0 -2
  118. package/dist/components/p-C_cu-HIT.js.map +0 -1
  119. package/dist/components/p-D0B9uDTP.js +0 -2
  120. package/dist/components/p-D0B9uDTP.js.map +0 -1
  121. package/dist/components/p-DF0yLZG_.js +0 -2
  122. package/dist/components/p-DF0yLZG_.js.map +0 -1
@@ -0,0 +1,153 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "chart-line",
4
+ "title": "ChartLine",
5
+ "description": "ChartLine component from @ds-mo/ui.",
6
+ "type": "registry:ui",
7
+ "meta": {
8
+ "library": "@ds-mo/ui",
9
+ "distribution": "npm",
10
+ "storybook": "https://zainadeel.github.io/compomo/?path=/story/chart-line",
11
+ "source": "src/wc/components/ChartLine/ChartLine.tsx",
12
+ "intentStatus": "migration-pending",
13
+ "intent": null,
14
+ "api": {
15
+ "props": {
16
+ "categories": {
17
+ "type": "string[]",
18
+ "resolvedType": "string[]",
19
+ "default": "[]",
20
+ "required": false,
21
+ "mutable": false,
22
+ "description": "X-axis labels — must match each series' `data` length. Set as a JS property."
23
+ },
24
+ "height": {
25
+ "type": "number",
26
+ "resolvedType": "number",
27
+ "attribute": "height",
28
+ "default": "240",
29
+ "required": false,
30
+ "mutable": false
31
+ },
32
+ "series": {
33
+ "type": "ChartSeries[]",
34
+ "resolvedType": "ChartSeries[]",
35
+ "default": "[]",
36
+ "required": false,
37
+ "mutable": false,
38
+ "description": "One or more series to plot. Set as a JS property (not an HTML attribute)."
39
+ },
40
+ "showPoints": {
41
+ "type": "boolean",
42
+ "resolvedType": "boolean",
43
+ "attribute": "show-points",
44
+ "default": "true",
45
+ "required": false,
46
+ "mutable": false
47
+ },
48
+ "width": {
49
+ "type": "number",
50
+ "resolvedType": "number",
51
+ "attribute": "width",
52
+ "default": "480",
53
+ "required": false,
54
+ "mutable": false
55
+ }
56
+ },
57
+ "events": [],
58
+ "methods": [],
59
+ "slots": []
60
+ },
61
+ "props": {
62
+ "categories": {
63
+ "type": "string[]",
64
+ "resolvedType": "string[]",
65
+ "default": "[]",
66
+ "required": false,
67
+ "mutable": false,
68
+ "description": "X-axis labels — must match each series' `data` length. Set as a JS property."
69
+ },
70
+ "height": {
71
+ "type": "number",
72
+ "resolvedType": "number",
73
+ "attribute": "height",
74
+ "default": "240",
75
+ "required": false,
76
+ "mutable": false
77
+ },
78
+ "series": {
79
+ "type": "ChartSeries[]",
80
+ "resolvedType": "ChartSeries[]",
81
+ "default": "[]",
82
+ "required": false,
83
+ "mutable": false,
84
+ "description": "One or more series to plot. Set as a JS property (not an HTML attribute)."
85
+ },
86
+ "showPoints": {
87
+ "type": "boolean",
88
+ "resolvedType": "boolean",
89
+ "attribute": "show-points",
90
+ "default": "true",
91
+ "required": false,
92
+ "mutable": false
93
+ },
94
+ "width": {
95
+ "type": "number",
96
+ "resolvedType": "number",
97
+ "attribute": "width",
98
+ "default": "480",
99
+ "required": false,
100
+ "mutable": false
101
+ }
102
+ },
103
+ "events": [],
104
+ "methods": [],
105
+ "slots": [],
106
+ "exports": {
107
+ "customElement": "ds-chart-line",
108
+ "react": "DsChartLine",
109
+ "angular": "DsChartLine"
110
+ },
111
+ "consumption": {
112
+ "install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
113
+ "cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
114
+ "customElements": {
115
+ "import": "import '@ds-mo/ui/dist/components/ds-chart-line.js';",
116
+ "example": "<ds-chart-line></ds-chart-line>"
117
+ },
118
+ "react": {
119
+ "import": "import { DsChartLine } from '@ds-mo/ui/react';",
120
+ "example": "<DsChartLine />"
121
+ },
122
+ "angular": {
123
+ "import": "import { DsChartLine } from '@ds-mo/ui/angular/ds-chart-line';",
124
+ "example": "<ds-chart-line></ds-chart-line>"
125
+ },
126
+ "complexPropertyNote": "Assign these non-primitive values as JavaScript properties: categories, series.",
127
+ "peerDependencies": {
128
+ "required": [
129
+ "@ds-mo/tokens ^3.1.1",
130
+ "@ds-mo/icons ^6.2.0"
131
+ ],
132
+ "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
133
+ }
134
+ }
135
+ },
136
+ "dependencies": [
137
+ "@ds-mo/ui",
138
+ "@ds-mo/tokens"
139
+ ],
140
+ "registryDependencies": [],
141
+ "files": [
142
+ {
143
+ "path": "src/wc/components/ChartLine/ChartLine.css",
144
+ "content": ":host {\n display: inline-block;\n font-family: var(--typography-font-family);\n}\n\n.chart-line__gridline {\n stroke: var(--color-border-tertiary);\n stroke-width: 1;\n}\n\n/* Matches ds-text text-caption regular (SVG cannot host ds-text). */\n.chart-line__axis-label {\n fill: var(--color-foreground-secondary);\n font-family: var(--typography-font-family);\n font-size: var(--typography-fontsize-xs);\n font-weight: var(--typography-weight-medium);\n letter-spacing: var(--typography-letterspacing-positive);\n text-transform: uppercase;\n}\n\n.chart-line__path {\n fill: none;\n stroke-width: 2;\n}\n\n.chart-line__point {\n stroke: var(--color-background-primary);\n stroke-width: 1.5;\n}\n",
145
+ "type": "registry:ui"
146
+ },
147
+ {
148
+ "path": "src/wc/components/ChartLine/ChartLine.tsx",
149
+ "content": "import { Component, Prop, h, Host } from '@stencil/core';\nimport { line as lineShape } from 'd3-shape';\nimport { scaleLinear, scalePoint } from 'd3-scale';\nimport { max } from 'd3-array';\nimport { categoryColor } from '../../utils/chart-colors';\nimport type { ChartSeries } from '../../utils/chart-types';\n\nconst MARGIN = { top: 16, right: 16, bottom: 24, left: 32 };\n\n@Component({\n tag: 'ds-chart-line',\n styleUrl: 'ChartLine.css',\n scoped: true,\n})\nexport class ChartLine {\n /** One or more series to plot. Set as a JS property (not an HTML attribute). */\n @Prop() series: ChartSeries[] = [];\n /** X-axis labels — must match each series' `data` length. Set as a JS property. */\n @Prop() categories: string[] = [];\n @Prop() width: number = 480;\n @Prop() height: number = 240;\n @Prop() showPoints: boolean = true;\n\n render() {\n const innerWidth = this.width - MARGIN.left - MARGIN.right;\n const innerHeight = this.height - MARGIN.top - MARGIN.bottom;\n\n const allValues = this.series.flatMap(s => s.data);\n const yMax = max(allValues) ?? 0;\n\n const xScale = scalePoint<number>()\n .domain(this.categories.map((_, i) => i))\n .range([0, innerWidth]);\n\n const yScale = scaleLinear()\n .domain([0, yMax || 1])\n .range([innerHeight, 0])\n .nice();\n\n const lineGenerator = lineShape<number>()\n .x((_, i) => xScale(i) ?? 0)\n .y(d => yScale(d));\n\n const yTicks = yScale.ticks(4);\n\n return (\n <Host class=\"chart-line\">\n <svg\n class=\"chart-line__svg\"\n viewBox={`0 0 ${this.width} ${this.height}`}\n width={this.width}\n height={this.height}\n role=\"img\"\n aria-label={this.series.map(s => s.name).join(', ')}\n >\n <g transform={`translate(${MARGIN.left}, ${MARGIN.top})`}>\n {yTicks.map(tick => (\n <g key={`grid-${tick}`} transform={`translate(0, ${yScale(tick)})`}>\n <line class=\"chart-line__gridline\" x1={0} x2={innerWidth} />\n <text class=\"chart-line__axis-label\" x={-8} text-anchor=\"end\" dominant-baseline=\"middle\">\n {tick}\n </text>\n </g>\n ))}\n\n {this.categories.map((label, i) => (\n <text\n key={`x-${label}`}\n class=\"chart-line__axis-label\"\n x={xScale(i) ?? 0}\n y={innerHeight + 16}\n text-anchor=\"middle\"\n >\n {label}\n </text>\n ))}\n\n {this.series.map((s, si) => {\n const color = s.color ?? categoryColor(si);\n return (\n <g key={s.name}>\n <path class=\"chart-line__path\" d={lineGenerator(s.data) ?? undefined} stroke={color} />\n {this.showPoints &&\n s.data.map((d, i) => (\n <circle\n key={`${s.name}-${i}`}\n class=\"chart-line__point\"\n cx={xScale(i) ?? 0}\n cy={yScale(d)}\n r={3}\n fill={color}\n />\n ))}\n </g>\n );\n })}\n </g>\n </svg>\n </Host>\n );\n }\n}\n",
150
+ "type": "registry:ui"
151
+ }
152
+ ]
153
+ }
@@ -0,0 +1,361 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "checkbox",
4
+ "title": "Checkbox",
5
+ "description": "Form-associated checkbox for independent choices, acknowledgment, or consent, with checked, unchecked, mixed, and three density states.",
6
+ "type": "registry:ui",
7
+ "meta": {
8
+ "library": "@ds-mo/ui",
9
+ "distribution": "npm",
10
+ "storybook": "https://zainadeel.github.io/compomo/?path=/story/checkbox",
11
+ "source": "src/wc/components/Checkbox/Checkbox.tsx",
12
+ "intentStatus": "complete",
13
+ "intent": {
14
+ "audience": "general",
15
+ "status": "stable",
16
+ "summary": "Form-associated checkbox for independent choices, acknowledgment, or consent, with checked, unchecked, mixed, and three density states.",
17
+ "useWhen": [
18
+ "A user may independently select zero or more choices.",
19
+ "A form requires acknowledgment, consent, or an opt-in value before submission.",
20
+ "A composite multi-select option needs a presentation-only checkbox indicator."
21
+ ],
22
+ "avoidWhen": [
23
+ "Exactly one option must be chosen from a mutually exclusive set.",
24
+ "A binary setting takes effect immediately rather than being submitted or confirmed.",
25
+ "The control triggers a one-time command instead of maintaining selection state."
26
+ ],
27
+ "alternatives": [
28
+ {
29
+ "when": "Exactly one option must be chosen from a mutually exclusive set.",
30
+ "component": "component:ds-radio",
31
+ "reason": "Radio communicates one-of-many selection."
32
+ },
33
+ {
34
+ "when": "A binary setting takes effect immediately.",
35
+ "component": "component:ds-switch",
36
+ "reason": "Switch communicates an immediately applied on/off setting."
37
+ },
38
+ {
39
+ "when": "The interaction triggers a one-time command.",
40
+ "component": "component:ds-button-filled",
41
+ "reason": "Button semantics communicate an action rather than persistent selection."
42
+ }
43
+ ],
44
+ "commonlyComposedWith": [
45
+ "component:ds-field",
46
+ "component:ds-select-multi",
47
+ "component:ds-text"
48
+ ],
49
+ "accessibility": [
50
+ "Every interactive checkbox requires a visible label that provides its accessible name.",
51
+ "Enter and Space activate the checkbox; checked and mixed state are exposed through aria-checked.",
52
+ "Disabled and inactive checkboxes leave the tab order and are omitted from form submission.",
53
+ "Use presentation mode only inside a composite option that owns selection semantics, focus, and interaction."
54
+ ],
55
+ "states": [
56
+ "Unchecked boxes use a tertiary-foreground inset stroke: 1.25px at md, 1px at sm, and 0.75px at xs. Selected and mixed boxes remove the border, use a brand fill, and draw a component-owned check or subtract mark at the same density-specific stroke width.",
57
+ "Activating an indeterminate checkbox clears the mixed state, toggles checked, and emits dsChange with the resulting boolean.",
58
+ "The initial checked and indeterminate values are restored by native form reset; checked values submit under name and unchecked values submit nothing.",
59
+ "Sizes are md with a 16px box in a 20px placement, sm with a 12px box in a 16px placement, and xs with an 8px box in a 12px placement.",
60
+ "Presentation mode removes checkbox semantics, focus, interaction, label rendering, and form submission while preserving the visual state."
61
+ ],
62
+ "responsiveBehavior": [
63
+ "Choose size from the density of the containing row; labels may wrap while the placement box stays fixed.",
64
+ "Use the md indicator centered by the shared 20px option icon zone in multi-select rows."
65
+ ],
66
+ "frameworkCaveats": {
67
+ "customElements": [
68
+ "Bind checked and indeterminate as properties for application state updates and listen for dsChange.",
69
+ "Use the form attribute on the host when associating a checkbox rendered outside its owning form."
70
+ ],
71
+ "react": [
72
+ "Use DsCheckbox and handle onDsChange; checked and indeterminate are mutable and update after user activation."
73
+ ],
74
+ "angular": [
75
+ "Use DsCheckbox with checked binding and dsChange, or the generated boolean value accessor in Angular forms."
76
+ ]
77
+ },
78
+ "references": [
79
+ {
80
+ "label": "Storybook examples",
81
+ "path": "src/wc/components/Checkbox/Checkbox.stories.ts"
82
+ },
83
+ {
84
+ "label": "Cross-browser form and accessibility coverage",
85
+ "path": "tests/e2e/forms.spec.ts"
86
+ }
87
+ ]
88
+ },
89
+ "api": {
90
+ "props": {
91
+ "checked": {
92
+ "type": "boolean",
93
+ "resolvedType": "boolean",
94
+ "attribute": "checked",
95
+ "default": "false",
96
+ "required": false,
97
+ "mutable": true,
98
+ "description": "Current checked state."
99
+ },
100
+ "disabled": {
101
+ "type": "boolean",
102
+ "resolvedType": "boolean",
103
+ "attribute": "disabled",
104
+ "default": "false",
105
+ "required": false,
106
+ "mutable": false,
107
+ "description": "Native disabled state."
108
+ },
109
+ "indeterminate": {
110
+ "type": "boolean",
111
+ "resolvedType": "boolean",
112
+ "attribute": "indeterminate",
113
+ "default": "false",
114
+ "required": false,
115
+ "mutable": true,
116
+ "description": "Mixed visual state. Activation clears it before toggling checked."
117
+ },
118
+ "isInactive": {
119
+ "type": "boolean",
120
+ "resolvedType": "boolean",
121
+ "attribute": "is-inactive",
122
+ "default": "false",
123
+ "required": false,
124
+ "mutable": false,
125
+ "description": "Design-system inactive state."
126
+ },
127
+ "label": {
128
+ "type": "string",
129
+ "resolvedType": "string",
130
+ "attribute": "label",
131
+ "required": true,
132
+ "mutable": false,
133
+ "description": "Visible label and accessible name. Omitted only in presentation mode."
134
+ },
135
+ "name": {
136
+ "type": "string | undefined",
137
+ "resolvedType": "string | undefined",
138
+ "attribute": "name",
139
+ "required": false,
140
+ "mutable": false,
141
+ "description": "Native form field name."
142
+ },
143
+ "presentation": {
144
+ "type": "boolean",
145
+ "resolvedType": "boolean",
146
+ "attribute": "presentation",
147
+ "default": "false",
148
+ "required": false,
149
+ "mutable": false,
150
+ "description": "Visual-only indicator for a composite control that owns selection semantics."
151
+ },
152
+ "required": {
153
+ "type": "boolean",
154
+ "resolvedType": "boolean",
155
+ "attribute": "required",
156
+ "default": "false",
157
+ "required": false,
158
+ "mutable": false,
159
+ "description": "Require the checkbox to be checked for form validity."
160
+ },
161
+ "requiredMessage": {
162
+ "type": "string",
163
+ "resolvedType": "string",
164
+ "attribute": "required-message",
165
+ "default": "'This field is required.'",
166
+ "required": false,
167
+ "mutable": false,
168
+ "description": "Validation message used when a required checkbox is unchecked."
169
+ },
170
+ "size": {
171
+ "type": "CheckboxSize",
172
+ "resolvedType": "\"md\" | \"sm\" | \"xs\"",
173
+ "attribute": "size",
174
+ "default": "'md'",
175
+ "required": false,
176
+ "mutable": false,
177
+ "description": "Visual and placement density."
178
+ },
179
+ "value": {
180
+ "type": "string",
181
+ "resolvedType": "string",
182
+ "attribute": "value",
183
+ "default": "'on'",
184
+ "required": false,
185
+ "mutable": false,
186
+ "description": "Submitted value when checked."
187
+ }
188
+ },
189
+ "events": [
190
+ {
191
+ "name": "dsChange",
192
+ "detail": "boolean",
193
+ "bubbles": true,
194
+ "cancelable": true,
195
+ "composed": true,
196
+ "description": "Emitted after user activation with the new checked state."
197
+ }
198
+ ],
199
+ "methods": [],
200
+ "slots": []
201
+ },
202
+ "props": {
203
+ "checked": {
204
+ "type": "boolean",
205
+ "resolvedType": "boolean",
206
+ "attribute": "checked",
207
+ "default": "false",
208
+ "required": false,
209
+ "mutable": true,
210
+ "description": "Current checked state."
211
+ },
212
+ "disabled": {
213
+ "type": "boolean",
214
+ "resolvedType": "boolean",
215
+ "attribute": "disabled",
216
+ "default": "false",
217
+ "required": false,
218
+ "mutable": false,
219
+ "description": "Native disabled state."
220
+ },
221
+ "indeterminate": {
222
+ "type": "boolean",
223
+ "resolvedType": "boolean",
224
+ "attribute": "indeterminate",
225
+ "default": "false",
226
+ "required": false,
227
+ "mutable": true,
228
+ "description": "Mixed visual state. Activation clears it before toggling checked."
229
+ },
230
+ "isInactive": {
231
+ "type": "boolean",
232
+ "resolvedType": "boolean",
233
+ "attribute": "is-inactive",
234
+ "default": "false",
235
+ "required": false,
236
+ "mutable": false,
237
+ "description": "Design-system inactive state."
238
+ },
239
+ "label": {
240
+ "type": "string",
241
+ "resolvedType": "string",
242
+ "attribute": "label",
243
+ "required": true,
244
+ "mutable": false,
245
+ "description": "Visible label and accessible name. Omitted only in presentation mode."
246
+ },
247
+ "name": {
248
+ "type": "string | undefined",
249
+ "resolvedType": "string | undefined",
250
+ "attribute": "name",
251
+ "required": false,
252
+ "mutable": false,
253
+ "description": "Native form field name."
254
+ },
255
+ "presentation": {
256
+ "type": "boolean",
257
+ "resolvedType": "boolean",
258
+ "attribute": "presentation",
259
+ "default": "false",
260
+ "required": false,
261
+ "mutable": false,
262
+ "description": "Visual-only indicator for a composite control that owns selection semantics."
263
+ },
264
+ "required": {
265
+ "type": "boolean",
266
+ "resolvedType": "boolean",
267
+ "attribute": "required",
268
+ "default": "false",
269
+ "required": false,
270
+ "mutable": false,
271
+ "description": "Require the checkbox to be checked for form validity."
272
+ },
273
+ "requiredMessage": {
274
+ "type": "string",
275
+ "resolvedType": "string",
276
+ "attribute": "required-message",
277
+ "default": "'This field is required.'",
278
+ "required": false,
279
+ "mutable": false,
280
+ "description": "Validation message used when a required checkbox is unchecked."
281
+ },
282
+ "size": {
283
+ "type": "CheckboxSize",
284
+ "resolvedType": "\"md\" | \"sm\" | \"xs\"",
285
+ "attribute": "size",
286
+ "default": "'md'",
287
+ "required": false,
288
+ "mutable": false,
289
+ "description": "Visual and placement density."
290
+ },
291
+ "value": {
292
+ "type": "string",
293
+ "resolvedType": "string",
294
+ "attribute": "value",
295
+ "default": "'on'",
296
+ "required": false,
297
+ "mutable": false,
298
+ "description": "Submitted value when checked."
299
+ }
300
+ },
301
+ "events": [
302
+ {
303
+ "name": "dsChange",
304
+ "detail": "boolean",
305
+ "bubbles": true,
306
+ "cancelable": true,
307
+ "composed": true,
308
+ "description": "Emitted after user activation with the new checked state."
309
+ }
310
+ ],
311
+ "methods": [],
312
+ "slots": [],
313
+ "exports": {
314
+ "customElement": "ds-checkbox",
315
+ "react": "DsCheckbox",
316
+ "angular": "DsCheckbox"
317
+ },
318
+ "consumption": {
319
+ "install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
320
+ "cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
321
+ "customElements": {
322
+ "import": "import '@ds-mo/ui/dist/components/ds-checkbox.js';",
323
+ "example": "<ds-checkbox></ds-checkbox>"
324
+ },
325
+ "react": {
326
+ "import": "import { DsCheckbox } from '@ds-mo/ui/react';",
327
+ "example": "<DsCheckbox />"
328
+ },
329
+ "angular": {
330
+ "import": "import { DsCheckbox } from '@ds-mo/ui/angular/ds-checkbox';",
331
+ "example": "<ds-checkbox></ds-checkbox>"
332
+ },
333
+ "peerDependencies": {
334
+ "required": [
335
+ "@ds-mo/tokens ^3.1.1",
336
+ "@ds-mo/icons ^6.2.0"
337
+ ],
338
+ "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
339
+ }
340
+ }
341
+ },
342
+ "dependencies": [
343
+ "@ds-mo/ui",
344
+ "@ds-mo/tokens"
345
+ ],
346
+ "registryDependencies": [
347
+ "text"
348
+ ],
349
+ "files": [
350
+ {
351
+ "path": "src/wc/components/Checkbox/Checkbox.css",
352
+ "content": "@import '../../utils/control-inactive.css';\n@import '../../utils/control-density.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/interaction-fill.css';\n\n:host {\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n gap: var(--ds-control-gap);\n height: var(--ds-control-height);\n padding: 0 var(--ds-control-padding-inline);\n border-radius: var(--ds-control-radius);\n cursor: pointer;\n user-select: none;\n}\n\n:host(.checkbox--presentation) {\n width: var(--ds-control-icon);\n height: var(--ds-control-icon);\n padding: 0;\n gap: 0;\n pointer-events: none;\n}\n\n/* Inactive: `.ds-control-inactive` (25% opacity). */\n\n:host(.checkbox--md) {\n --_checkbox-box: var(--dimension-iconography-sm);\n --_checkbox-stroke: var(--dimension-stroke-width-015);\n}\n\n:host(.checkbox--sm) {\n --_checkbox-box: var(--dimension-iconography-xs);\n --_checkbox-stroke: var(--dimension-stroke-width-012);\n}\n\n:host(.checkbox--xs) {\n --_checkbox-box: var(--dimension-size-100);\n --_checkbox-stroke: calc(var(--dimension-stroke-width-base) * 3 / 32);\n}\n\n.checkbox__placement {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--ds-control-icon);\n height: var(--ds-control-icon);\n}\n\n.box {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--_checkbox-box);\n height: var(--_checkbox-box);\n border: 0;\n border-radius: var(--dimension-radius-025);\n box-shadow: inset 0 0 0 var(--_checkbox-stroke) var(--color-foreground-tertiary);\n transition:\n background-color var(--effect-motion-short-2),\n box-shadow var(--effect-motion-short-2);\n}\n\n.box--marked {\n color: var(--color-foreground-on-bold-background-primary);\n background-color: var(--color-background-bold-brand);\n box-shadow: none;\n}\n\n.checkbox__mark {\n width: 100%;\n height: 100%;\n flex-shrink: 0;\n stroke: currentColor;\n stroke-width: var(--_checkbox-stroke);\n stroke-linecap: butt;\n stroke-linejoin: round;\n}\n\n.checkbox__mark--checked {\n transform: translateY(-0.5px);\n}\n\n.checkbox__label {\n flex: 1;\n min-width: 0;\n padding: 0 var(--ds-control-label-inset);\n}\n",
353
+ "type": "registry:ui"
354
+ },
355
+ {
356
+ "path": "src/wc/components/Checkbox/Checkbox.tsx",
357
+ "content": "import { AttachInternals, Component, Prop, State, Event, EventEmitter, Watch, h, Host } from '@stencil/core';\n\nexport type CheckboxSize = 'md' | 'sm' | 'xs';\n\nconst LABEL_VARIANT: Record<CheckboxSize, 'text-body-medium' | 'text-body-small' | 'text-caption'> = {\n md: 'text-body-medium',\n sm: 'text-body-small',\n xs: 'text-caption',\n};\n\nlet idCounter = 0;\n\n@Component({\n tag: 'ds-checkbox',\n styleUrl: 'Checkbox.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Checkbox {\n @AttachInternals() internals!: ElementInternals;\n private labelId = `ds-checkbox-label-${++idCounter}`;\n\n /** Visible label and accessible name. Omitted only in presentation mode. */\n @Prop() label!: string;\n /** Current checked state. */\n @Prop({ mutable: true }) checked: boolean = false;\n /** Visual and placement density. */\n @Prop() size: CheckboxSize = 'md';\n /** Native form field name. */\n @Prop({ reflect: true }) name: string | undefined;\n /** Submitted value when checked. */\n @Prop() value: string = 'on';\n /** Native disabled state. */\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Require the checkbox to be checked for form validity. */\n @Prop({ reflect: true }) required: boolean = false;\n /** Validation message used when a required checkbox is unchecked. */\n @Prop() requiredMessage: string = 'This field is required.';\n /** Mixed visual state. Activation clears it before toggling checked. */\n @Prop({ mutable: true }) indeterminate: boolean = false;\n /** Design-system inactive state. */\n @Prop() isInactive: boolean = false;\n /** Visual-only indicator for a composite control that owns selection semantics. */\n @Prop() presentation: boolean = false;\n\n /** Emitted after user activation with the new checked state. */\n @Event() dsChange!: EventEmitter<boolean>;\n\n private initialChecked = false;\n private initialIndeterminate = false;\n @State() private formDisabled = false;\n\n componentWillLoad() {\n this.initialChecked = this.checked;\n this.initialIndeterminate = this.indeterminate;\n this.syncFormValue();\n }\n\n @Watch('checked')\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n @Watch('presentation')\n syncFormValue() {\n const inactive = this.isInactive || this.disabled || this.formDisabled || this.presentation;\n this.internals.setFormValue(!inactive && this.checked ? this.value : null);\n const missing = this.required && !inactive && !this.checked;\n this.internals.setValidity(missing ? { valueMissing: true } : {}, missing ? this.requiredMessage : '');\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.checked = this.initialChecked;\n this.indeterminate = this.initialIndeterminate;\n }\n\n private handleActivate = () => {\n if (this.isInactive || this.disabled || this.formDisabled || this.presentation) return;\n if (this.indeterminate) this.indeterminate = false;\n this.checked = !this.checked;\n this.dsChange.emit(this.checked);\n };\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this.handleActivate();\n }\n };\n\n render() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n const isMarked = this.checked || this.indeterminate;\n const invalid = this.required && !inactive && !this.checked;\n\n return (\n <Host\n role={this.presentation ? undefined : 'checkbox'}\n aria-checked={this.presentation ? undefined : this.indeterminate ? 'mixed' : String(this.checked)}\n aria-disabled={!this.presentation && inactive ? 'true' : undefined}\n aria-required={!this.presentation && this.required ? 'true' : undefined}\n aria-invalid={!this.presentation && invalid ? 'true' : undefined}\n aria-labelledby={this.presentation ? undefined : this.labelId}\n aria-hidden={this.presentation ? 'true' : undefined}\n tabIndex={this.presentation || inactive ? -1 : 0}\n class={{\n checkbox: true,\n 'checkbox--presentation': this.presentation,\n [`checkbox--${this.size}`]: true,\n [`ds-control--${this.size}`]: true,\n 'ds-control-inactive': inactive && !this.presentation,\n 'ds-focus-ring-inset': !this.presentation,\n 'ds-interaction-fill': !inactive && !this.presentation,\n }}\n onClick={this.presentation ? undefined : this.handleActivate}\n onKeyDown={this.presentation ? undefined : this.handleKeyDown}\n >\n <span class=\"checkbox__placement ds-interaction-fill__content\" aria-hidden=\"true\">\n <span class={{ box: true, 'box--marked': isMarked }}>\n {isMarked && (\n // eslint-disable-next-line local/prefer-ds-icon -- Checkbox owns this density-specific state mark and its optical stroke.\n <svg\n class={{\n checkbox__mark: true,\n 'checkbox__mark--checked': !this.indeterminate,\n }}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n focusable=\"false\"\n >\n <path\n d={this.indeterminate ? 'M4 8H12' : 'M3.5 8.25L6.75 11.5L12.5 4.75'}\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </span>\n </span>\n {!this.presentation && (\n <ds-text\n class=\"checkbox__label ds-interaction-fill__content\"\n as=\"span\"\n variant={LABEL_VARIANT[this.size]}\n textId={this.labelId}\n >\n {this.label}\n </ds-text>\n )}\n </Host>\n );\n }\n}\n",
358
+ "type": "registry:ui"
359
+ }
360
+ ]
361
+ }