@orange-halo/components 2.2.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/custom-elements.json +551 -314
  2. package/dist/index.d.ts +1 -7
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +0 -4
  5. package/dist/index.js.map +1 -1
  6. package/dist/oh-accordion.d.ts +53 -8
  7. package/dist/oh-accordion.d.ts.map +1 -1
  8. package/dist/oh-accordion.js +77 -15
  9. package/dist/oh-accordion.js.map +1 -1
  10. package/dist/oh-alert.d.ts +26 -8
  11. package/dist/oh-alert.d.ts.map +1 -1
  12. package/dist/oh-alert.js +32 -14
  13. package/dist/oh-alert.js.map +1 -1
  14. package/dist/oh-badge.d.ts +32 -13
  15. package/dist/oh-badge.d.ts.map +1 -1
  16. package/dist/oh-badge.js +35 -16
  17. package/dist/oh-badge.js.map +1 -1
  18. package/dist/oh-breadcrumb.d.ts +39 -12
  19. package/dist/oh-breadcrumb.d.ts.map +1 -1
  20. package/dist/oh-breadcrumb.js +39 -17
  21. package/dist/oh-breadcrumb.js.map +1 -1
  22. package/dist/oh-button.d.ts +49 -23
  23. package/dist/oh-button.d.ts.map +1 -1
  24. package/dist/oh-button.js +63 -44
  25. package/dist/oh-button.js.map +1 -1
  26. package/dist/oh-card.d.ts +47 -19
  27. package/dist/oh-card.d.ts.map +1 -1
  28. package/dist/oh-card.js +110 -82
  29. package/dist/oh-card.js.map +1 -1
  30. package/dist/oh-checkbox-group.d.ts +56 -12
  31. package/dist/oh-checkbox-group.d.ts.map +1 -1
  32. package/dist/oh-checkbox-group.figma.js +4 -6
  33. package/dist/oh-checkbox-group.figma.js.map +1 -1
  34. package/dist/oh-checkbox-group.js +86 -44
  35. package/dist/oh-checkbox-group.js.map +1 -1
  36. package/dist/oh-checkbox.d.ts +54 -17
  37. package/dist/oh-checkbox.d.ts.map +1 -1
  38. package/dist/oh-checkbox.js +85 -55
  39. package/dist/oh-checkbox.js.map +1 -1
  40. package/dist/oh-cluster.d.ts +19 -14
  41. package/dist/oh-cluster.d.ts.map +1 -1
  42. package/dist/oh-cluster.js +19 -19
  43. package/dist/oh-cluster.js.map +1 -1
  44. package/dist/oh-container.d.ts +19 -16
  45. package/dist/oh-container.d.ts.map +1 -1
  46. package/dist/oh-container.js +21 -23
  47. package/dist/oh-container.js.map +1 -1
  48. package/dist/oh-drawer.d.ts +28 -11
  49. package/dist/oh-drawer.d.ts.map +1 -1
  50. package/dist/oh-drawer.js +31 -14
  51. package/dist/oh-drawer.js.map +1 -1
  52. package/dist/oh-footer.d.ts +37 -18
  53. package/dist/oh-footer.d.ts.map +1 -1
  54. package/dist/oh-footer.js +38 -19
  55. package/dist/oh-footer.js.map +1 -1
  56. package/dist/oh-grid.d.ts +27 -14
  57. package/dist/oh-grid.d.ts.map +1 -1
  58. package/dist/oh-grid.js +27 -19
  59. package/dist/oh-grid.js.map +1 -1
  60. package/dist/oh-icon.d.ts +21 -5
  61. package/dist/oh-icon.d.ts.map +1 -1
  62. package/dist/oh-icon.js +21 -5
  63. package/dist/oh-icon.js.map +1 -1
  64. package/dist/oh-input.d.ts +104 -20
  65. package/dist/oh-input.d.ts.map +1 -1
  66. package/dist/oh-input.figma.js +2 -2
  67. package/dist/oh-input.figma.js.map +1 -1
  68. package/dist/oh-input.js +205 -66
  69. package/dist/oh-input.js.map +1 -1
  70. package/dist/oh-link.d.ts +42 -19
  71. package/dist/oh-link.d.ts.map +1 -1
  72. package/dist/oh-link.js +47 -29
  73. package/dist/oh-link.js.map +1 -1
  74. package/dist/oh-modal.d.ts +29 -6
  75. package/dist/oh-modal.d.ts.map +1 -1
  76. package/dist/oh-modal.js +37 -16
  77. package/dist/oh-modal.js.map +1 -1
  78. package/dist/oh-navbar.d.ts +42 -19
  79. package/dist/oh-navbar.d.ts.map +1 -1
  80. package/dist/oh-navbar.js +42 -19
  81. package/dist/oh-navbar.js.map +1 -1
  82. package/dist/oh-progress.d.ts +26 -7
  83. package/dist/oh-progress.d.ts.map +1 -1
  84. package/dist/oh-progress.js +31 -12
  85. package/dist/oh-progress.js.map +1 -1
  86. package/dist/oh-radio-group.d.ts +55 -13
  87. package/dist/oh-radio-group.d.ts.map +1 -1
  88. package/dist/oh-radio-group.figma.js +2 -2
  89. package/dist/oh-radio-group.figma.js.map +1 -1
  90. package/dist/oh-radio-group.js +83 -43
  91. package/dist/oh-radio-group.js.map +1 -1
  92. package/dist/oh-radio.d.ts +55 -17
  93. package/dist/oh-radio.d.ts.map +1 -1
  94. package/dist/oh-radio.js +87 -56
  95. package/dist/oh-radio.js.map +1 -1
  96. package/dist/oh-select.d.ts +58 -16
  97. package/dist/oh-select.d.ts.map +1 -1
  98. package/dist/oh-select.js +70 -33
  99. package/dist/oh-select.js.map +1 -1
  100. package/dist/oh-skip-link.d.ts +33 -15
  101. package/dist/oh-skip-link.d.ts.map +1 -1
  102. package/dist/oh-skip-link.js +38 -25
  103. package/dist/oh-skip-link.js.map +1 -1
  104. package/dist/oh-stack.d.ts +17 -14
  105. package/dist/oh-stack.d.ts.map +1 -1
  106. package/dist/oh-stack.js +18 -20
  107. package/dist/oh-stack.js.map +1 -1
  108. package/dist/oh-tabs.d.ts +55 -30
  109. package/dist/oh-tabs.d.ts.map +1 -1
  110. package/dist/oh-tabs.js +80 -65
  111. package/dist/oh-tabs.js.map +1 -1
  112. package/dist/oh-textarea.d.ts +37 -6
  113. package/dist/oh-textarea.d.ts.map +1 -1
  114. package/dist/oh-textarea.js +40 -9
  115. package/dist/oh-textarea.js.map +1 -1
  116. package/dist/oh-toggle.d.ts +45 -12
  117. package/dist/oh-toggle.d.ts.map +1 -1
  118. package/dist/oh-toggle.js +64 -29
  119. package/dist/oh-toggle.js.map +1 -1
  120. package/package.json +3 -7
  121. package/dist/oh-hero.d.ts +0 -33
  122. package/dist/oh-hero.d.ts.map +0 -1
  123. package/dist/oh-hero.js +0 -248
  124. package/dist/oh-hero.js.map +0 -1
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * oh-radio-group
3
3
  *
4
- * A radio group with proper ARIA semantics and group-level error handling.
5
- * Individual radios cannot be used standalone.
4
+ * A radio group with ARIA group semantics and group-level error handling.
5
+ * Use it for every set of radios: separate oh-radio elements can't form a
6
+ * group, because each native radio is in its own shadow root.
6
7
  *
7
- * ACCESSIBILITY:
8
- * ─────────────
9
- * - role="radiogroup" with aria-labelledby
10
- * - Arrow key navigation between options
11
- * - Group-level error messaging
12
- * - Visible focus ring (outline, not inset)
13
- * - aria-required and aria-invalid
14
- *
15
- * @element oh-radio-group
8
+ * DESIGN DECISIONS:
9
+ * ─────────────────
10
+ * - role="radiogroup" with aria-labelledby, aria-required and aria-invalid
11
+ * - Native radios sharing one name in one shadow root, so the browser
12
+ * handles arrow-key navigation between options
13
+ * - One error for the group, after the label and before the options
14
+ * - Focus underlines the option's label (a solid indicator)
15
+ * - The drawn circles use the same tokens as oh-radio
16
16
  */
17
17
  import { type PropertyValues } from "lit";
18
18
  import { OhElement } from "./base.js";
@@ -20,6 +20,44 @@ export interface RadioOption {
20
20
  label: string;
21
21
  value: string;
22
22
  }
23
+ /**
24
+ * A set of radio buttons under one label, where exactly one can be chosen.
25
+ *
26
+ * **Use it for** one choice from a few options that should all be visible,
27
+ * such as a plan or a delivery speed. **Don't use it for** a long list (use
28
+ * `oh-select`), several choices (use `oh-checkbox-group`) or an on/off
29
+ * setting (use `oh-toggle` or `oh-checkbox`). Use it rather than separate
30
+ * `oh-radio` elements, which can't form a group.
31
+ *
32
+ * **Parts:** a `label` for the group and a list of `options`
33
+ * (`{ label, value }`). `value` is the chosen option's value. **States:**
34
+ * each option unchecked, checked, hover, active and focus; the group can be
35
+ * `required` and in error (set `error-text`).
36
+ *
37
+ * **Behaviour:** Tab moves into and out of the group; arrow keys move
38
+ * between options and choose them (the browser's native radio behaviour).
39
+ * Each change sets `value` and fires `oh-change`. The native radios sit in
40
+ * the shadow root, so they don't submit with a native form: read `value` or
41
+ * listen for `oh-change`. `required` sets `aria-required` and a marker on
42
+ * the label but doesn't validate; set the error yourself.
43
+ *
44
+ * **Accessibility:** `role="radiogroup"` labelled by `label`, so always set
45
+ * one. The error shows after the label and before the options, with an
46
+ * icon; the group gets `aria-invalid` and `aria-describedby`, and the error
47
+ * is announced (`role="alert"`) only when it appears after first render.
48
+ * Focus underlines the option's label.
49
+ *
50
+ * **Look:** set by tokens — the same as `oh-radio`: `stroke.control` in
51
+ * `color.border.emphasis` (border), `shape.pill` (circle),
52
+ * `elevation.offset.*` with `elevation.color.secondary` / `elevation.color.primary` (shadow),
53
+ * `lift.hoverSm` / `lift.pressSm` (movement on hover and press),
54
+ * `color.brand.primary` and `color.text.onBrand` (checked),
55
+ * `color.feedback.error` and `elevation.color.error` (error); `typography.control.*`
56
+ * for the group label and option labels.
57
+ *
58
+ * @element oh-radio-group
59
+ * @fires oh-change - An option was chosen. detail: { value }
60
+ */
23
61
  export declare class OhRadioGroup extends OhElement {
24
62
  static styles: import("lit").CSSResult[];
25
63
  label: string;
@@ -27,8 +65,11 @@ export declare class OhRadioGroup extends OhElement {
27
65
  options: RadioOption[];
28
66
  value: string;
29
67
  required: boolean;
30
- error: boolean;
31
- errorMessage: string;
68
+ /**
69
+ * Error shown with the control and linked to it. Setting it puts the
70
+ * control in its error state; clear it to leave that state.
71
+ */
72
+ errorText: string;
32
73
  private _labelId;
33
74
  private _focusedValue;
34
75
  private _handleChange;
@@ -40,6 +81,7 @@ export declare class OhRadioGroup extends OhElement {
40
81
  * aria-describedby, so they aren't read out unprompted.
41
82
  */
42
83
  private _announceError;
84
+ updated(changed: PropertyValues): void;
43
85
  willUpdate(changed: PropertyValues): void;
44
86
  render(): import("lit").TemplateResult<1>;
45
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"oh-radio-group.d.ts","sourceRoot":"","sources":["../src/oh-radio-group.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAsB,KAAK,cAAc,EAAE,MA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;;;OAGG;IAEH,SAAS,SAAM;IAGf,OAAO,CAAC,QAAQ,CACiD;IAGjE,OAAO,CAAC,aAAa,CAAuB;IAE5C,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,WAAW;IAInB;;;;OAIG;IAEH,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,OAAO,EAAE,cAAc;IAM/B,UAAU,CAAC,OAAO,EAAE,cAAc;IAMlC,MAAM;CA0EP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
@@ -8,13 +8,13 @@ figma.connect("https://www.figma.com/design/q9ZYrOj2w9DrTVmgQFU7bu/OHDS?node-id=
8
8
  props: {
9
9
  label: figma.string("Label"),
10
10
  required: figma.boolean("Required"),
11
- error: figma.boolean("Error"),
11
+ errorText: figma.string("Error Message"),
12
12
  },
13
13
  example: (props) => html `
14
14
  <oh-radio-group
15
15
  label="${props.label}"
16
16
  ?required="${props.required}"
17
- ?error="${props.error}"
17
+ error-text="${props.errorText}"
18
18
  .options="\${options}"
19
19
  ></oh-radio-group>
20
20
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"oh-radio-group.figma.js","sourceRoot":"","sources":["../src/oh-radio-group.figma.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;GAIG;AAEH,KAAK,CAAC,OAAO,CACX,wEAAwE,EACxE;IACE,KAAK,EAAE;QACL,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;QAC5B,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;QACnC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;KAC9B;IACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;;iBAEX,KAAK,CAAC,KAAK;qBACP,KAAK,CAAC,QAAQ;kBACjB,KAAK,CAAC,KAAK;;;KAGxB;CACF,CACF,CAAC"}
1
+ {"version":3,"file":"oh-radio-group.figma.js","sourceRoot":"","sources":["../src/oh-radio-group.figma.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;GAIG;AAEH,KAAK,CAAC,OAAO,CACX,wEAAwE,EACxE;IACE,KAAK,EAAE;QACL,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;QAC5B,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;QACnC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC;KACzC;IACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;;iBAEX,KAAK,CAAC,KAAK;qBACP,KAAK,CAAC,QAAQ;sBACb,KAAK,CAAC,SAAS;;;KAGhC;CACF,CACF,CAAC"}
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * oh-radio-group
3
3
  *
4
- * A radio group with proper ARIA semantics and group-level error handling.
5
- * Individual radios cannot be used standalone.
4
+ * A radio group with ARIA group semantics and group-level error handling.
5
+ * Use it for every set of radios: separate oh-radio elements can't form a
6
+ * group, because each native radio is in its own shadow root.
6
7
  *
7
- * ACCESSIBILITY:
8
- * ─────────────
9
- * - role="radiogroup" with aria-labelledby
10
- * - Arrow key navigation between options
11
- * - Group-level error messaging
12
- * - Visible focus ring (outline, not inset)
13
- * - aria-required and aria-invalid
14
- *
15
- * @element oh-radio-group
8
+ * DESIGN DECISIONS:
9
+ * ─────────────────
10
+ * - role="radiogroup" with aria-labelledby, aria-required and aria-invalid
11
+ * - Native radios sharing one name in one shadow root, so the browser
12
+ * handles arrow-key navigation between options
13
+ * - One error for the group, after the label and before the options
14
+ * - Focus underlines the option's label (a solid indicator)
15
+ * - The drawn circles use the same tokens as oh-radio
16
16
  */
17
17
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
18
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -23,6 +23,44 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
23
23
  import { html, css, nothing } from "lit";
24
24
  import { customElement, property, state } from "lit/decorators.js";
25
25
  import { OhElement, baseStyles } from "./base.js";
26
+ /**
27
+ * A set of radio buttons under one label, where exactly one can be chosen.
28
+ *
29
+ * **Use it for** one choice from a few options that should all be visible,
30
+ * such as a plan or a delivery speed. **Don't use it for** a long list (use
31
+ * `oh-select`), several choices (use `oh-checkbox-group`) or an on/off
32
+ * setting (use `oh-toggle` or `oh-checkbox`). Use it rather than separate
33
+ * `oh-radio` elements, which can't form a group.
34
+ *
35
+ * **Parts:** a `label` for the group and a list of `options`
36
+ * (`{ label, value }`). `value` is the chosen option's value. **States:**
37
+ * each option unchecked, checked, hover, active and focus; the group can be
38
+ * `required` and in error (set `error-text`).
39
+ *
40
+ * **Behaviour:** Tab moves into and out of the group; arrow keys move
41
+ * between options and choose them (the browser's native radio behaviour).
42
+ * Each change sets `value` and fires `oh-change`. The native radios sit in
43
+ * the shadow root, so they don't submit with a native form: read `value` or
44
+ * listen for `oh-change`. `required` sets `aria-required` and a marker on
45
+ * the label but doesn't validate; set the error yourself.
46
+ *
47
+ * **Accessibility:** `role="radiogroup"` labelled by `label`, so always set
48
+ * one. The error shows after the label and before the options, with an
49
+ * icon; the group gets `aria-invalid` and `aria-describedby`, and the error
50
+ * is announced (`role="alert"`) only when it appears after first render.
51
+ * Focus underlines the option's label.
52
+ *
53
+ * **Look:** set by tokens — the same as `oh-radio`: `stroke.control` in
54
+ * `color.border.emphasis` (border), `shape.pill` (circle),
55
+ * `elevation.offset.*` with `elevation.color.secondary` / `elevation.color.primary` (shadow),
56
+ * `lift.hoverSm` / `lift.pressSm` (movement on hover and press),
57
+ * `color.brand.primary` and `color.text.onBrand` (checked),
58
+ * `color.feedback.error` and `elevation.color.error` (error); `typography.control.*`
59
+ * for the group label and option labels.
60
+ *
61
+ * @element oh-radio-group
62
+ * @fires oh-change - An option was chosen. detail: { value }
63
+ */
26
64
  let OhRadioGroup = class OhRadioGroup extends OhElement {
27
65
  constructor() {
28
66
  super(...arguments);
@@ -31,8 +69,11 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
31
69
  this.options = [];
32
70
  this.value = "";
33
71
  this.required = false;
34
- this.error = false;
35
- this.errorMessage = "";
72
+ /**
73
+ * Error shown with the control and linked to it. Setting it puts the
74
+ * control in its error state; clear it to leave that state.
75
+ */
76
+ this.errorText = "";
36
77
  this._labelId = `radio-group-label-${Math.random().toString(36).substr(2, 9)}`;
37
78
  this._focusedValue = null;
38
79
  /**
@@ -106,10 +147,10 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
106
147
  border-radius: var(--oh-shape-pill);
107
148
  background-color: var(--oh-color-surface-base);
108
149
  box-shadow: var(--oh-elevation-offset-md) var(--oh-elevation-offset-md)
109
- 0 0 var(--oh-shadow-secondary);
150
+ 0 0 var(--oh-elevation-color-secondary);
110
151
  transition:
111
- transform var(--oh-motion-snappy) var(--oh-motion-ease-playful),
112
- box-shadow var(--oh-motion-snappy) var(--oh-motion-ease-playful),
152
+ transform var(--oh-motion-snappy) var(--oh-motion-ease-emphasized),
153
+ box-shadow var(--oh-motion-snappy) var(--oh-motion-ease-emphasized),
113
154
  background-color var(--oh-motion-quick) ease,
114
155
  border-color var(--oh-motion-quick) ease;
115
156
  }
@@ -125,7 +166,7 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
125
166
  border-radius: var(--oh-shape-pill);
126
167
  transform: translate(-50%, -50%) scale(0);
127
168
  transition: transform var(--oh-motion-snappy)
128
- var(--oh-motion-ease-playful);
169
+ var(--oh-motion-ease-emphasized);
129
170
  }
130
171
 
131
172
  .option-label {
@@ -140,27 +181,27 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
140
181
  STATES
141
182
  ═══════════════════════════════════════════════════════════════ */
142
183
 
143
- /* Hover: lift up-left, shadow grows */
184
+ /* Hover: moves by lift.hoverSm; shadow offset elevation.offset.lg */
144
185
  .radio-option:hover .radio-circle {
145
186
  border-color: var(--oh-color-border-hover);
146
187
  transform: translate(var(--oh-lift-hover-sm), var(--oh-lift-hover-sm));
147
188
  box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
148
- 0 0 var(--oh-shadow-secondary);
189
+ 0 0 var(--oh-elevation-color-secondary);
149
190
  }
150
191
 
151
- /* Active: press down-right, shadow shrinks */
192
+ /* Active: moves by lift.pressSm; shadow offset elevation.offset.xs */
152
193
  .radio-option:active .radio-circle {
153
194
  transform: translate(var(--oh-lift-press-sm), var(--oh-lift-press-sm));
154
195
  box-shadow: var(--oh-elevation-offset-xs) var(--oh-elevation-offset-xs)
155
- 0 0 var(--oh-shadow-secondary);
196
+ 0 0 var(--oh-elevation-color-secondary);
156
197
  }
157
198
 
158
- /* Checked: primary color with warm shadow */
199
+ /* Checked: color.brand.primary fill, elevation.color.primary shadow */
159
200
  .native-radio:checked + .radio-circle {
160
201
  background-color: var(--oh-color-brand-primary);
161
202
  border-color: var(--oh-color-brand-primary);
162
203
  box-shadow: var(--oh-elevation-offset-md) var(--oh-elevation-offset-md)
163
- 0 0 var(--oh-shadow-primary);
204
+ 0 0 var(--oh-elevation-color-primary);
164
205
  }
165
206
 
166
207
  .native-radio:checked + .radio-circle::after {
@@ -173,7 +214,7 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
173
214
  border-color: var(--oh-color-brand-primary-hover);
174
215
  transform: translate(var(--oh-lift-hover-sm), var(--oh-lift-hover-sm));
175
216
  box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
176
- 0 0 var(--oh-shadow-primary);
217
+ 0 0 var(--oh-elevation-color-primary);
177
218
  }
178
219
 
179
220
  /* Checked + Active */
@@ -181,7 +222,7 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
181
222
  background-color: var(--oh-color-brand-primary-active);
182
223
  transform: translate(var(--oh-lift-press-sm), var(--oh-lift-press-sm));
183
224
  box-shadow: var(--oh-elevation-offset-xs) var(--oh-elevation-offset-xs)
184
- 0 0 var(--oh-shadow-primary);
225
+ 0 0 var(--oh-elevation-color-primary);
185
226
  }
186
227
 
187
228
  /* Focus: underline the label (accessible indicator) */
@@ -200,16 +241,16 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
200
241
  ERROR STATE
201
242
  ═══════════════════════════════════════════════════════════════ */
202
243
 
203
- :host([error]) .radio-circle {
244
+ :host([data-invalid]) .radio-circle {
204
245
  border-color: var(--oh-color-feedback-error);
205
246
  box-shadow: var(--oh-elevation-offset-md) var(--oh-elevation-offset-md)
206
- 0 0 var(--oh-shadow-error);
247
+ 0 0 var(--oh-elevation-color-error);
207
248
  }
208
249
 
209
- :host([error]) .radio-option:hover .radio-circle {
250
+ :host([data-invalid]) .radio-option:hover .radio-circle {
210
251
  border-color: var(--oh-color-feedback-error-hover);
211
252
  box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
212
- 0 0 var(--oh-shadow-error);
253
+ 0 0 var(--oh-elevation-color-error);
213
254
  }
214
255
 
215
256
  .error-message {
@@ -251,10 +292,14 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
251
292
  _handleBlur() {
252
293
  this._focusedValue = null;
253
294
  }
295
+ updated(changed) {
296
+ // Styling hook for the error state (data-invalid on the host)
297
+ if (changed.has("errorText"))
298
+ this.toggleAttribute("data-invalid", !!this.errorText);
299
+ }
254
300
  willUpdate(changed) {
255
- if (this.hasUpdated &&
256
- (changed.has("error") || changed.has("errorMessage"))) {
257
- this._announceError = !!(this.error && this.errorMessage);
301
+ if (this.hasUpdated && changed.has("errorText")) {
302
+ this._announceError = !!this.errorText;
258
303
  }
259
304
  }
260
305
  render() {
@@ -272,7 +317,7 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
272
317
  </span>
273
318
  `
274
319
  : nothing}
275
- ${this.error && this.errorMessage
320
+ ${this.errorText
276
321
  ? html `
277
322
  <div
278
323
  id="error-msg"
@@ -291,7 +336,7 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
291
336
  clip-rule="evenodd"
292
337
  />
293
338
  </svg>
294
- ${this.errorMessage}
339
+ ${this.errorText}
295
340
  </div>
296
341
  `
297
342
  : nothing}
@@ -301,10 +346,8 @@ let OhRadioGroup = class OhRadioGroup extends OhElement {
301
346
  role="radiogroup"
302
347
  aria-labelledby=${this.label ? this._labelId : nothing}
303
348
  aria-required=${this.required ? "true" : nothing}
304
- aria-invalid=${this.error ? "true" : nothing}
305
- aria-describedby=${this.error && this.errorMessage
306
- ? "error-msg"
307
- : nothing}
349
+ aria-invalid=${this.errorText ? "true" : nothing}
350
+ aria-describedby=${this.errorText ? "error-msg" : nothing}
308
351
  >
309
352
  ${this.options.map((option) => html `
310
353
  <label class="radio-option">
@@ -348,11 +391,8 @@ __decorate([
348
391
  property({ type: Boolean, reflect: true })
349
392
  ], OhRadioGroup.prototype, "required", void 0);
350
393
  __decorate([
351
- property({ type: Boolean, reflect: true })
352
- ], OhRadioGroup.prototype, "error", void 0);
353
- __decorate([
354
- property({ type: String })
355
- ], OhRadioGroup.prototype, "errorMessage", void 0);
394
+ property({ type: String, attribute: "error-text" })
395
+ ], OhRadioGroup.prototype, "errorText", void 0);
356
396
  __decorate([
357
397
  state()
358
398
  ], OhRadioGroup.prototype, "_labelId", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"oh-radio-group.js","sourceRoot":"","sources":["../src/oh-radio-group.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EA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, playful radio button with hand-crafted feel.
5
- * Matches the inset/pressed aesthetic of oh-input.
6
- *
7
4
  * DESIGN DECISIONS:
8
5
  * ─────────────────
9
- * 1. CHUNKY & TACTILE
10
- * - Thick border (stroke.control)
11
- * - Inset shadow when unchecked (pressed into page)
12
- * - Fully circular (radio = circle)
6
+ * 1. LOOK FROM TOKENS
7
+ * - Border: stroke.control in color.border.emphasis
8
+ * - Circular: shape.pill
9
+ * - Shadow: offset by elevation.offset.* in elevation.color.secondary; hover and
10
+ * press move the circle by lift.hoverSm / lift.pressSm
13
11
  *
14
12
  * 2. CHECKED STATE
15
- * - Filled dot in center
16
- * - Primary color ring
17
- * - Shadow shifts to feel "activated"
13
+ * - Filled with color.brand.primary, a centre dot in color.text.onBrand,
14
+ * and the shadow in elevation.color.primary
18
15
  *
19
16
  * 3. ACCESSIBILITY
20
- * - Native radio hidden but accessible
17
+ * - A native radio, visually hidden but focusable and announced
21
18
  * - Label always required
22
- * - Focus ring matches input
23
- * - Works in radio groups via name attribute
24
- *
25
- * @element oh-radio
19
+ * - Focus underlines the label (a solid indicator)
20
+ * - Two oh-radios with the same name don't form a group (each native
21
+ * radio is in its own shadow root): use oh-radio-group for a set
26
22
  */
27
23
  import { type PropertyValues } from "lit";
28
24
  import { OhElement } from "./base.js";
29
25
  export type RadioState = "default" | "hover" | "focus";
26
+ /**
27
+ * A single radio button with its label.
28
+ *
29
+ * **Use it for** a one-off radio you manage yourself. **For a set of
30
+ * choices, use `oh-radio-group`.** Each `oh-radio` keeps its native radio
31
+ * inside its own shadow root, so two of them with the same `name` don't form
32
+ * a group: checking one doesn't uncheck the other, and arrow keys don't move
33
+ * between them. `oh-radio-group` renders the whole set in one place, with
34
+ * arrow-key navigation and one label for the group. For an independent
35
+ * on/off choice use `oh-checkbox`.
36
+ *
37
+ * **States:** unchecked, checked, hover, active, focus, error (set `error-text`).
38
+ *
39
+ * **Behaviour:** clicking the circle or label checks it. Checking sets
40
+ * `checked` and fires `oh-change`. The native radio sits in the shadow
41
+ * root, so it doesn't submit with a native form.
42
+ *
43
+ * **Accessibility:** a real native radio, visually hidden, carries the role
44
+ * and state; the drawn circle is decoration. Always set `label`: it's the
45
+ * radio's name. Focus underlines the label. The error message shows under
46
+ * the radio with an icon, sets `aria-invalid` and is linked with
47
+ * `aria-describedby`; it's announced (`role="alert"`) only when it appears
48
+ * after first render.
49
+ *
50
+ * **Look:** set by tokens — `stroke.control` in `color.border.emphasis`
51
+ * (border), `shape.pill` (circle), `typography.control.*` (label),
52
+ * `elevation.offset.*` and `elevation.color.secondary` (shadow), `lift.hoverSm` /
53
+ * `lift.pressSm` (movement on hover and press), `color.border.hover`
54
+ * (hover), `color.brand.primary` (and its hover and active tokens),
55
+ * `color.text.onBrand` and `elevation.color.primary` (checked),
56
+ * `color.feedback.error` and `elevation.color.error` (error).
57
+ *
58
+ * @element oh-radio
59
+ * @fires oh-change - The radio was checked. detail: { checked, value }
60
+ * @csspart circle - The drawn radio circle
61
+ * @csspart label - The label text
62
+ * @csspart error - The error message
63
+ */
30
64
  export declare class OhRadio extends OhElement {
31
65
  static styles: import("lit").CSSResult[];
32
66
  checked: boolean;
33
67
  label: string;
34
68
  name: string;
35
69
  value: string;
36
- error: boolean;
37
- errorMessage: string;
70
+ /**
71
+ * Error shown with the control and linked to it. Setting it puts the
72
+ * control in its error state; clear it to leave that state.
73
+ */
74
+ errorText: string;
38
75
  /**
39
76
  * Force a visual state (for documentation/Figma sync only)
40
77
  * Values: 'hover' | 'focus'
@@ -48,6 +85,7 @@ export declare class OhRadio extends OhElement {
48
85
  */
49
86
  private _announceError;
50
87
  private _errorId;
88
+ updated(changed: PropertyValues): void;
51
89
  willUpdate(changed: PropertyValues): void;
52
90
  render(): import("lit").TemplateResult<1>;
53
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"oh-radio.d.ts","sourceRoot":"","sources":["../src/oh-radio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO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