@adia-ai/web-components 0.5.8 → 0.5.9

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/USAGE.md +218 -0
  2. package/components/accordion/accordion.d.ts +22 -1
  3. package/components/action-list/action-list.d.ts +14 -1
  4. package/components/agent-artifact/agent-artifact.d.ts +1 -1
  5. package/components/agent-feedback-bar/agent-feedback-bar.d.ts +1 -1
  6. package/components/agent-questions/agent-questions.d.ts +1 -1
  7. package/components/agent-reasoning/agent-reasoning.d.ts +1 -1
  8. package/components/agent-suggestions/agent-suggestions.d.ts +1 -1
  9. package/components/agent-trace/agent-trace.d.ts +1 -1
  10. package/components/alert/alert.d.ts +1 -1
  11. package/components/avatar/avatar.d.ts +8 -1
  12. package/components/badge/badge.d.ts +1 -1
  13. package/components/block/block.d.ts +1 -1
  14. package/components/breadcrumb/breadcrumb.d.ts +1 -1
  15. package/components/button/button.d.ts +1 -1
  16. package/components/canvas/canvas.d.ts +1 -1
  17. package/components/card/card.d.ts +1 -1
  18. package/components/chart/chart.d.ts +1 -1
  19. package/components/chart-legend/chart-legend.d.ts +1 -1
  20. package/components/chat-thread/chat-thread.d.ts +40 -1
  21. package/components/code/code.css +1 -1
  22. package/components/col/col.a2ui.json +4 -4
  23. package/components/col/col.d.ts +2 -2
  24. package/components/col/col.yaml +2 -2
  25. package/components/command/command.d.ts +1 -1
  26. package/components/demo-toggle/demo-toggle.d.ts +1 -1
  27. package/components/description-list/description-list.d.ts +1 -1
  28. package/components/divider/divider.d.ts +1 -1
  29. package/components/drawer/drawer.d.ts +1 -1
  30. package/components/embed/embed.d.ts +1 -1
  31. package/components/empty-state/class.js +10 -4
  32. package/components/empty-state/empty-state.a2ui.json +5 -0
  33. package/components/empty-state/empty-state.css +36 -0
  34. package/components/empty-state/empty-state.d.ts +6 -1
  35. package/components/empty-state/empty-state.test.js +77 -0
  36. package/components/empty-state/empty-state.yaml +9 -0
  37. package/components/feed/feed.css +1 -1
  38. package/components/feed/feed.d.ts +29 -5
  39. package/components/field/field.d.ts +1 -1
  40. package/components/fields/fields.d.ts +1 -1
  41. package/components/grid/grid.d.ts +1 -1
  42. package/components/heatmap/heatmap.d.ts +1 -1
  43. package/components/icon/icon.d.ts +1 -1
  44. package/components/image/image.d.ts +1 -1
  45. package/components/input/class.js +2 -1
  46. package/components/input/input.a2ui.json +5 -0
  47. package/components/input/input.test.js +99 -0
  48. package/components/input/input.yaml +14 -0
  49. package/components/inspector/inspector.d.ts +1 -1
  50. package/components/kbd/kbd.d.ts +1 -1
  51. package/components/link/link.d.ts +1 -1
  52. package/components/list/list.d.ts +10 -1
  53. package/components/menu/menu-divider.a2ui.json +41 -0
  54. package/components/menu/menu-divider.yaml +15 -0
  55. package/components/menu/menu-item.a2ui.json +77 -0
  56. package/components/menu/menu-item.yaml +45 -0
  57. package/components/menu/menu.d.ts +17 -1
  58. package/components/modal/modal.d.ts +1 -1
  59. package/components/nav/nav.css +1 -1
  60. package/components/nav/nav.d.ts +1 -1
  61. package/components/nav-group/nav-group.d.ts +1 -1
  62. package/components/nav-item/nav-item.d.ts +1 -1
  63. package/components/noodles/noodles.d.ts +1 -1
  64. package/components/page/page.d.ts +1 -1
  65. package/components/pagination/pagination.d.ts +1 -1
  66. package/components/pane/pane.d.ts +1 -1
  67. package/components/pipeline-status/pipeline-status.d.ts +1 -1
  68. package/components/popover/popover.d.ts +1 -1
  69. package/components/progress/progress.d.ts +1 -1
  70. package/components/progress-row/progress-row.d.ts +1 -1
  71. package/components/range/range.css +1 -1
  72. package/components/richtext/richtext.a2ui.json +4 -4
  73. package/components/richtext/richtext.d.ts +2 -2
  74. package/components/richtext/richtext.yaml +2 -2
  75. package/components/row/row.d.ts +1 -1
  76. package/components/segment/segment.d.ts +1 -1
  77. package/components/select/class.js +28 -0
  78. package/components/select/select.css +1 -1
  79. package/components/select/select.yaml +28 -0
  80. package/components/skeleton/skeleton.d.ts +1 -1
  81. package/components/slider/class.js +20 -50
  82. package/components/slider/slider.css +1 -1
  83. package/components/stack/stack.d.ts +1 -1
  84. package/components/step-progress/step-progress.d.ts +1 -1
  85. package/components/stepper/stepper-item.a2ui.json +74 -0
  86. package/components/stepper/stepper-item.yaml +45 -0
  87. package/components/stepper/stepper.d.ts +13 -1
  88. package/components/stream/stream.d.ts +1 -1
  89. package/components/swatch/swatch.css +1 -1
  90. package/components/swatch/swatch.d.ts +1 -1
  91. package/components/swiper/swiper.d.ts +1 -1
  92. package/components/switch/switch.css +1 -1
  93. package/components/table/table.d.ts +1 -1
  94. package/components/table-toolbar/table-toolbar.d.ts +1 -1
  95. package/components/tabs/tabs.d.ts +12 -1
  96. package/components/tag/tag.d.ts +1 -1
  97. package/components/text/text.d.ts +1 -1
  98. package/components/textarea/class.js +7 -1
  99. package/components/textarea/textarea.a2ui.json +5 -0
  100. package/components/textarea/textarea.yaml +14 -0
  101. package/components/timeline/timeline.d.ts +20 -1
  102. package/components/toast/class.js +9 -0
  103. package/components/toast/toast.d.ts +9 -5
  104. package/components/toast/toast.yaml +16 -0
  105. package/components/toggle-group/toggle-group.d.ts +12 -1
  106. package/components/toggle-group/toggle-option.a2ui.json +61 -0
  107. package/components/toggle-group/toggle-option.yaml +33 -0
  108. package/components/toggle-scheme/toggle-scheme.d.ts +1 -1
  109. package/components/toolbar/toolbar-group.a2ui.json +41 -0
  110. package/components/toolbar/toolbar-group.yaml +16 -0
  111. package/components/toolbar/toolbar.d.ts +4 -1
  112. package/components/tooltip/tooltip.css +2 -2
  113. package/components/tooltip/tooltip.d.ts +1 -1
  114. package/components/tree/tree.css +1 -1
  115. package/components/tree/tree.d.ts +18 -1
  116. package/core/form.js +93 -0
  117. package/core/signals.d.ts +28 -0
  118. package/index.d.ts +2 -2
  119. package/package.json +1 -1
  120. package/styles/colors/semantics.css +6 -0
  121. package/styles/tokens.css +3 -0
  122. package/styles/typography.css +2 -0
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://adiaui.dev/a2ui/v0_9/components/MenuItem.json",
4
+ "title": "MenuItem",
5
+ "description": "Child of `<menu-ui>`. One actionable row inside a menu, with optional leading icon + label + value.",
6
+ "type": "object",
7
+ "allOf": [
8
+ {
9
+ "$ref": "common_types.json#/$defs/ComponentCommon"
10
+ },
11
+ {
12
+ "$ref": "common_types.json#/$defs/CatalogComponentCommon"
13
+ }
14
+ ],
15
+ "properties": {
16
+ "component": {
17
+ "const": "MenuItem"
18
+ },
19
+ "disabled": {
20
+ "description": "Disabled state — blocks pointer + keyboard activation.",
21
+ "type": "boolean",
22
+ "default": false
23
+ },
24
+ "icon": {
25
+ "description": "Optional leading Phosphor icon name.",
26
+ "type": "string",
27
+ "default": ""
28
+ },
29
+ "text": {
30
+ "description": "Item label text.",
31
+ "type": "string",
32
+ "default": ""
33
+ },
34
+ "value": {
35
+ "description": "Stable identifier emitted via the parent menu's `select` event.",
36
+ "type": "string",
37
+ "default": ""
38
+ },
39
+ "variant": {
40
+ "description": "Semantic variant.",
41
+ "type": "string",
42
+ "enum": [
43
+ "default",
44
+ "danger"
45
+ ],
46
+ "default": "default"
47
+ }
48
+ },
49
+ "required": [
50
+ "component"
51
+ ],
52
+ "unevaluatedProperties": false,
53
+ "x-adiaui": {
54
+ "anti_patterns": [],
55
+ "category": "navigation",
56
+ "composes": [],
57
+ "events": {},
58
+ "examples": [],
59
+ "keywords": [],
60
+ "name": "UIMenuItem",
61
+ "related": [],
62
+ "slots": {
63
+ "icon": {
64
+ "description": "Custom leading element override; falls through to `[icon]` prop if not slotted."
65
+ },
66
+ "text": {
67
+ "description": "Custom label content; falls through to `[text]` prop if not slotted."
68
+ }
69
+ },
70
+ "states": [],
71
+ "synonyms": {},
72
+ "tag": "menu-item-ui",
73
+ "tokens": {},
74
+ "traits": [],
75
+ "version": 1
76
+ }
77
+ }
@@ -0,0 +1,45 @@
1
+ # Edit this file; run `npm run build:components` to regenerate a2ui.json.
2
+ #
3
+ # §228 (v0.5.9): authored to close the §229 baseline class-export-undeclared
4
+ # drift for UIMenuItem. The item ships as a sibling class in menu/class.js
5
+ # + is registered alongside UIMenu + UIMenuDivider.
6
+
7
+ # Child component of <menu-ui>. Surface only inside that parent.
8
+ $schema: ../../../../scripts/schemas/component.yaml.schema.json
9
+ name: UIMenuItem
10
+ tag: menu-item-ui
11
+ component: MenuItem
12
+ category: navigation
13
+ version: 1
14
+ description: |-
15
+ Child of `<menu-ui>`. One actionable row inside a menu, with optional leading icon + label + value.
16
+
17
+ props:
18
+ icon:
19
+ description: Optional leading Phosphor icon name.
20
+ type: string
21
+ default: ""
22
+ text:
23
+ description: Item label text.
24
+ type: string
25
+ default: ""
26
+ value:
27
+ description: Stable identifier emitted via the parent menu's `select` event.
28
+ type: string
29
+ default: ""
30
+ variant:
31
+ description: Semantic variant.
32
+ type: string
33
+ default: default
34
+ enum:
35
+ - default
36
+ - danger
37
+ disabled:
38
+ description: Disabled state — blocks pointer + keyboard activation.
39
+ type: boolean
40
+ default: false
41
+ slots:
42
+ icon:
43
+ description: Custom leading element override; falls through to `[icon]` prop if not slotted.
44
+ text:
45
+ description: Custom label content; falls through to `[text]` prop if not slotted.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/menu
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -36,3 +36,19 @@ export class UIMenu extends UIElement {
36
36
  ): void;
37
37
  addEventListener(type: 'action', listener: (ev: MenuActionEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
38
38
  }
39
+
40
+ export class UIMenuDivider extends UIElement {
41
+ }
42
+
43
+ export class UIMenuItem extends UIElement {
44
+ /** Disabled state — blocks pointer + keyboard activation. */
45
+ disabled: boolean;
46
+ /** Optional leading Phosphor icon name. */
47
+ icon: string;
48
+ /** Item label text. */
49
+ text: string;
50
+ /** Stable identifier emitted via the parent menu's `select` event. */
51
+ value: string;
52
+ /** Semantic variant. */
53
+ variant: 'default' | 'danger';
54
+ }
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/modal
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -17,7 +17,7 @@
17
17
  /* Primary-variant collapse */
18
18
  --nav-width: auto;
19
19
  --nav-width-collapsed: 48px;
20
- --nav-duration: var(--a-duration-base, 200ms);
20
+ --nav-duration: var(--a-duration); /* §230-bundle (v0.5.9): canonical mid-tier duration (250ms). Was orphaned --a-duration-base. */
21
21
  --nav-easing: var(--a-easing, ease);
22
22
 
23
23
  /* Group-heading kicker */
@@ -12,7 +12,7 @@ and a [heading] kicker rendered via CSS.
12
12
  * @see https://ui-kit.exe.xyz/site/components/nav
13
13
  *
14
14
  * Type declarations generated by scripts/build/dts-codegen.mjs from
15
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
15
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
16
16
  * run `npm run build:components`, then `npm run codegen:dts` to
17
17
  * regenerate; or hand-author this file fully if rich event types are
18
18
  * needed beyond what the yaml `events:` block can express.
@@ -12,7 +12,7 @@ when [collapsible] (default true).
12
12
  * @see https://ui-kit.exe.xyz/site/components/nav-group
13
13
  *
14
14
  * Type declarations generated by scripts/build/dts-codegen.mjs from
15
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
15
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
16
16
  * run `npm run build:components`, then `npm run codegen:dts` to
17
17
  * regenerate; or hand-author this file fully if rich event types are
18
18
  * needed beyond what the yaml `events:` block can express.
@@ -12,7 +12,7 @@ bubbles a `nav-select` event.
12
12
  * @see https://ui-kit.exe.xyz/site/components/nav-item
13
13
  *
14
14
  * Type declarations generated by scripts/build/dts-codegen.mjs from
15
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
15
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
16
16
  * run `npm run build:components`, then `npm run codegen:dts` to
17
17
  * regenerate; or hand-author this file fully if rich event types are
18
18
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/noodles
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -10,7 +10,7 @@ primitives (`<header-ui>`, `<section-ui>`, `<footer-ui>`); the page's
10
10
  * @see https://ui-kit.exe.xyz/site/components/page
11
11
  *
12
12
  * Type declarations generated by scripts/build/dts-codegen.mjs from
13
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
13
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
14
14
  * run `npm run build:components`, then `npm run codegen:dts` to
15
15
  * regenerate; or hand-author this file fully if rich event types are
16
16
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/pagination
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/pane
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/pipeline-status
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/popover
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/progress
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/progress-row
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -13,7 +13,7 @@ range-ui:not([disabled]) [slot="field"]:hover [data-layer="fill"] {
13
13
  --range-fill-bg-hover: var(--a-ui-bg-hover);
14
14
  --range-fill-bg-active: var(--a-ui-bg-active);
15
15
  --range-fill-bg-disabled: var(--a-canvas-muted);
16
- --range-fill-fg: var(--a-ui-fg);
16
+ --range-fill-fg: var(--a-fg);
17
17
  --range-fill-fg-disabled: var(--a-ui-text-disabled);
18
18
  --range-fill-label-fg: var(--a-ui-text-subtle);
19
19
  --range-border: var(--a-ui-border);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://adiaui.dev/a2ui/v0_9/components/Richtext.json",
4
- "title": "Richtext",
3
+ "$id": "https://adiaui.dev/a2ui/v0_9/components/RichText.json",
4
+ "title": "RichText",
5
5
  "description": "Renders markdown to styled HTML.",
6
6
  "type": "object",
7
7
  "allOf": [
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "properties": {
16
16
  "component": {
17
- "const": "Richtext"
17
+ "const": "RichText"
18
18
  },
19
19
  "markdown": {
20
20
  "description": "Component property: markdown.",
@@ -61,7 +61,7 @@
61
61
  "keywords": [
62
62
  "richtext"
63
63
  ],
64
- "name": "UIRichtext",
64
+ "name": "UIRichText",
65
65
  "related": [],
66
66
  "slots": {
67
67
  "default": {
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/richtext
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { UIElement } from '../../core/element.js';
14
14
 
15
- export class UIRichtext extends UIElement {
15
+ export class UIRichText extends UIElement {
16
16
  /** Component property: markdown. */
17
17
  markdown: string;
18
18
  /** Source URL (image, iframe, etc.). */
@@ -1,7 +1,7 @@
1
1
  $schema: ../../../../scripts/schemas/component.yaml.schema.json
2
- name: UIRichtext
2
+ name: UIRichText
3
3
  tag: richtext-ui
4
- component: Richtext
4
+ component: RichText
5
5
  category: forms
6
6
  version: 1
7
7
  description: Renders markdown to styled HTML.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/row
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/segment
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -26,6 +26,14 @@ export class UISelect extends UIFormElement {
26
26
  // (slot 11). Per FEEDBACK-06 §4 + FEEDBACK-07 §4.
27
27
  static requiredIcons = ['caret-up-down'];
28
28
 
29
+ // §225 (v0.5.9, FEEDBACK-10 §3): once-per-element console.warn dedup when
30
+ // consumer authors children that aren't native <option>/<optgroup>. The
31
+ // common authoring mistake is reaching for <select-option> (mirroring the
32
+ // <*-ui> naming convention), which #parseOptions silently ignores. Matches
33
+ // v0.5.5 §184 §8 button-ui safety-net + v0.5.7 §201 color-picker WeakSet
34
+ // pattern. WeakSet so the warn doesn't pin the element from GC.
35
+ static #warnedNonOption = new WeakSet();
36
+
29
37
  static properties = {
30
38
  ...UIFormElement.properties,
31
39
  placeholder: { type: String, default: 'Select...', reflect: true },
@@ -201,6 +209,8 @@ export class UISelect extends UIFormElement {
201
209
  /** Parse <option> and <optgroup> children into internal model. */
202
210
  #parseOptions() {
203
211
  this.#options = [];
212
+ // §225 (v0.5.9): track unknown-child-tag names so we can warn once per element.
213
+ const unknownTags = new Set();
204
214
  for (const child of this.children) {
205
215
  if (child.tagName === 'OPTGROUP') {
206
216
  const group = { label: child.label || child.getAttribute('label') || '', options: [] };
@@ -210,9 +220,27 @@ export class UISelect extends UIFormElement {
210
220
  this.#options.push(group);
211
221
  } else if (child.tagName === 'OPTION') {
212
222
  this.#options.push({ value: child.value, label: child.textContent.trim(), disabled: child.disabled });
223
+ } else if (
224
+ // §225: skip [slot="display"] / [slot="listbox"] / [slot="action"] etc. — these are
225
+ // stamped by the component itself, not consumer-authored options. Anything other
226
+ // than a slot-bearing child OR <option>/<optgroup> is a likely authoring mistake.
227
+ !child.hasAttribute('slot')
228
+ ) {
229
+ unknownTags.add(child.tagName.toLowerCase());
213
230
  }
214
231
  }
215
232
  for (const child of [...this.querySelectorAll('option, optgroup')]) child.remove();
233
+ // §225 (v0.5.9): warn once per element when consumer authored non-<option> children.
234
+ if (unknownTags.size > 0 && !UISelect.#warnedNonOption.has(this)) {
235
+ UISelect.#warnedNonOption.add(this);
236
+ // eslint-disable-next-line no-console
237
+ console.warn(
238
+ `<select-ui>: ignoring unrecognized child element(s) [${[...unknownTags].join(', ')}]. ` +
239
+ `Consumer-authored children must be native <option> or <optgroup>, NOT <select-option> ` +
240
+ `or other <*-ui> shapes. Or set element.options = [...] programmatically. ` +
241
+ `(Once-per-element warn; see select.yaml usage: for details.)`,
242
+ );
243
+ }
216
244
  }
217
245
 
218
246
  set options(list) {
@@ -314,7 +314,7 @@ select-ui[divider] [role="group"] + [role="group"] {
314
314
  select-ui > [slot="hint"] {
315
315
  display: block;
316
316
  margin-top: var(--select-hint-mt, var(--a-space-1));
317
- font-size: var(--select-hint-size, var(--a-fine-size));
317
+ font-size: var(--select-hint-size, var(--a-ui-xs));
318
318
  color: var(--select-hint-fg, var(--a-fg-muted));
319
319
  line-height: var(--select-hint-lh, 1.4);
320
320
  }
@@ -117,6 +117,34 @@ props:
117
117
  events:
118
118
  change:
119
119
  description: Fired when selected value changes
120
+ usage: |-
121
+ §225 (v0.5.9) — Consumer-authored children must be native `<option>` or
122
+ `<optgroup>`. The `#parseOptions()` walker reads only those two tag names;
123
+ other shapes (including hypothetical `<select-option>` mirroring the `<*-ui>`
124
+ convention) are silently ignored. v0.5.9 adds a once-per-element
125
+ `console.warn` to surface the authoring mistake at runtime.
126
+
127
+ Two canonical paths:
128
+
129
+ ```html
130
+ <!-- Path 1: native option children -->
131
+ <select-ui name="role" label="Role">
132
+ <option value="user">User</option>
133
+ <option value="admin">Admin</option>
134
+ <optgroup label="Special">
135
+ <option value="ghost">Ghost</option>
136
+ </optgroup>
137
+ </select-ui>
138
+
139
+ <!-- Path 2: programmatic .options property -->
140
+ <select-ui id="role" name="role" label="Role"></select-ui>
141
+ <script>
142
+ document.getElementById('role').options = [
143
+ { value: 'user', label: 'User' },
144
+ { value: 'admin', label: 'Admin' },
145
+ ];
146
+ </script>
147
+ ```
120
148
  slots:
121
149
  label:
122
150
  description: Label element above the trigger
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/skeleton
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -42,16 +42,17 @@ export class UISlider extends UIFormElement {
42
42
  step: { type: Number, default: 1, reflect: true },
43
43
  label: { type: String, default: '', reflect: true },
44
44
  suffix: { type: String, default: '', reflect: true },
45
- // §184 (v0.5.5, FEEDBACK-08 §4): declarative debounce for the
46
- // `input` event when driving expensive computation (palette regen,
47
- // shader compile, large list reflow). When > 0, value updates +
48
- // visual feedback are immediate but `input` event emission is
49
- // debounced only the FINAL value in the throttle window dispatches.
50
- // `change` fires unthrottled on pointerup / track click / keyboard;
51
- // any pending `input` flushes BEFORE `change` so consumers always
52
- // see input→input→…→input→change ordering. throttle="0" (default)
45
+ // §184 (v0.5.5, FEEDBACK-08 §4) §220 (v0.5.9, FEEDBACK-14 §3):
46
+ // declarative trailing-debounce on `input` for expensive consumers
47
+ // (palette regen, shader compile, large list reflow). When > 0,
48
+ // value updates + visual feedback are immediate but `input` is
49
+ // collapsed across the window. `change` fires unthrottled on
50
+ // pointerup / track click / keyboard; any pending `input` flushes
51
+ // BEFORE `change` so consumers always see
52
+ // input→input→…→input→change ordering. throttle="0" (default)
53
53
  // preserves the pre-§184 every-pointer-move-fires-input behavior.
54
- throttle: { type: Number, default: 0, reflect: true },
54
+ // The mechanism graduated to UIFormElement at v0.5.9 §220 — slider
55
+ // delegates via scheduleThrottledInput() + flushPendingInput().
55
56
  };
56
57
 
57
58
  static template = () => null;
@@ -62,11 +63,6 @@ export class UISlider extends UIFormElement {
62
63
  #trackEl = null;
63
64
  #thumbEl = null;
64
65
  #dragging = false;
65
- // §184 (v0.5.5, FEEDBACK-08 §4): debounce timer for the `input`
66
- // event. When `throttle > 0`, #setValue stores a pending dispatch
67
- // here + restarts the timer on every value change. Flushed before
68
- // any `change` event so input always precedes change.
69
- #inputTimer = null;
70
66
 
71
67
  get #pct() {
72
68
  const range = this.max - this.min;
@@ -171,34 +167,11 @@ export class UISlider extends UIFormElement {
171
167
  #setValue(v) {
172
168
  if (v === this.value) return;
173
169
  this.value = v;
174
- // §184: when throttle > 0, debounce the `input` dispatch.
175
- // The value update + UI is still immediate; only event emission is
176
- // accumulated. Same value can dispatch input multiple times across
177
- // pointer moves, but the throttle collapses them to one trailing
178
- // emission at quiet+throttle ms.
179
- const t = Number(this.throttle) || 0;
180
- if (t > 0) {
181
- if (this.#inputTimer != null) clearTimeout(this.#inputTimer);
182
- this.#inputTimer = setTimeout(() => {
183
- this.#inputTimer = null;
184
- this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: { value: this.value } }));
185
- }, t);
186
- return;
187
- }
188
- this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: { value: this.value } }));
189
- }
190
-
191
- /**
192
- * §184: flush any pending throttled `input` dispatch synchronously.
193
- * Called before `change` so consumers see the trailing input event
194
- * BEFORE the change commit. No-op when no timer is pending.
195
- */
196
- #flushInput() {
197
- if (this.#inputTimer != null) {
198
- clearTimeout(this.#inputTimer);
199
- this.#inputTimer = null;
200
- this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: { value: this.value } }));
201
- }
170
+ // §220 (v0.5.9): delegate to UIFormElement's shared throttle helper.
171
+ // When `this.throttle > 0`, the dispatch is trailing-debounced
172
+ // (collapses pointer-move bursts to one emission). When 0, fires
173
+ // synchronously.
174
+ this.scheduleThrottledInput();
202
175
  }
203
176
 
204
177
  #onPointerDown = (e) => {
@@ -220,14 +193,14 @@ export class UISlider extends UIFormElement {
220
193
  this.#thumbEl.releasePointerCapture(e.pointerId);
221
194
  this.#thumbEl.removeEventListener('pointermove', this.#onPointerMove);
222
195
  this.#thumbEl.removeEventListener('pointerup', this.#onPointerUp);
223
- this.#flushInput(); // §184: pending throttled input fires before change
196
+ this.flushPendingInput(); // §220 (was §184 #flushInput): pending throttled input fires before change
224
197
  this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { value: this.value } }));
225
198
  };
226
199
 
227
200
  #onTrackClick = (e) => {
228
201
  if (this.disabled || e.target === this.#thumbEl) return;
229
202
  this.#setValue(this.#valueFromX(e.clientX));
230
- this.#flushInput(); // §184: ensure trailing input precedes change
203
+ this.flushPendingInput(); // §220 (was §184 #flushInput): ensure trailing input precedes change
231
204
  this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { value: this.value } }));
232
205
  };
233
206
 
@@ -245,7 +218,7 @@ export class UISlider extends UIFormElement {
245
218
  }
246
219
  e.preventDefault();
247
220
  this.#setValue(this.#snap(v));
248
- this.#flushInput(); // §184: trailing input fires before change
221
+ this.flushPendingInput(); // §220 (was §184 #flushInput): trailing input fires before change
249
222
  this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { value: this.value } }));
250
223
  };
251
224
 
@@ -256,11 +229,8 @@ export class UISlider extends UIFormElement {
256
229
  this.#thumbEl?.removeEventListener('pointermove', this.#onPointerMove);
257
230
  this.#thumbEl?.removeEventListener('pointerup', this.#onPointerUp);
258
231
  this.removeEventListener('keydown', this.#onKey);
259
- // §184: drop any pending throttle timer (no flush element is gone)
260
- if (this.#inputTimer != null) {
261
- clearTimeout(this.#inputTimer);
262
- this.#inputTimer = null;
263
- }
232
+ // §220 (v0.5.9): UIFormElement.disconnected() auto-drops the pending
233
+ // throttled input dispatch via super.disconnected().
264
234
  this.#trackEl = null;
265
235
  this.#thumbEl = null;
266
236
  }
@@ -143,7 +143,7 @@
143
143
  [slot="hint"] {
144
144
  display: block;
145
145
  margin-top: var(--slider-hint-mt, var(--a-space-1));
146
- font-size: var(--slider-hint-size, var(--a-fine-size));
146
+ font-size: var(--slider-hint-size, var(--a-ui-xs));
147
147
  color: var(--slider-hint-fg, var(--a-fg-muted));
148
148
  line-height: var(--slider-hint-lh, 1.4);
149
149
  }
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/stack
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -10,7 +10,7 @@ primitive.
10
10
  * @see https://ui-kit.exe.xyz/site/components/step-progress
11
11
  *
12
12
  * Type declarations generated by scripts/build/dts-codegen.mjs from
13
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
13
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
14
14
  * run `npm run build:components`, then `npm run codegen:dts` to
15
15
  * regenerate; or hand-author this file fully if rich event types are
16
16
  * needed beyond what the yaml `events:` block can express.