@orange-halo/components 2.2.0 → 3.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 (140) hide show
  1. package/custom-elements.json +565 -328
  2. package/dist/base.d.ts.map +1 -1
  3. package/dist/base.js +7 -0
  4. package/dist/base.js.map +1 -1
  5. package/dist/index.d.ts +2 -7
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +0 -4
  8. package/dist/index.js.map +1 -1
  9. package/dist/oh-accordion.d.ts +53 -8
  10. package/dist/oh-accordion.d.ts.map +1 -1
  11. package/dist/oh-accordion.js +83 -21
  12. package/dist/oh-accordion.js.map +1 -1
  13. package/dist/oh-alert.d.ts +26 -8
  14. package/dist/oh-alert.d.ts.map +1 -1
  15. package/dist/oh-alert.js +32 -14
  16. package/dist/oh-alert.js.map +1 -1
  17. package/dist/oh-badge.d.ts +32 -13
  18. package/dist/oh-badge.d.ts.map +1 -1
  19. package/dist/oh-badge.js +35 -16
  20. package/dist/oh-badge.js.map +1 -1
  21. package/dist/oh-breadcrumb.d.ts +39 -12
  22. package/dist/oh-breadcrumb.d.ts.map +1 -1
  23. package/dist/oh-breadcrumb.js +43 -21
  24. package/dist/oh-breadcrumb.js.map +1 -1
  25. package/dist/oh-button.d.ts +50 -24
  26. package/dist/oh-button.d.ts.map +1 -1
  27. package/dist/oh-button.js +66 -47
  28. package/dist/oh-button.js.map +1 -1
  29. package/dist/oh-card.d.ts +47 -19
  30. package/dist/oh-card.d.ts.map +1 -1
  31. package/dist/oh-card.js +110 -82
  32. package/dist/oh-card.js.map +1 -1
  33. package/dist/oh-checkbox-group.d.ts +56 -12
  34. package/dist/oh-checkbox-group.d.ts.map +1 -1
  35. package/dist/oh-checkbox-group.js +87 -45
  36. package/dist/oh-checkbox-group.js.map +1 -1
  37. package/dist/oh-checkbox.d.ts +55 -18
  38. package/dist/oh-checkbox.d.ts.map +1 -1
  39. package/dist/oh-checkbox.js +91 -59
  40. package/dist/oh-checkbox.js.map +1 -1
  41. package/dist/oh-cluster.d.ts +19 -14
  42. package/dist/oh-cluster.d.ts.map +1 -1
  43. package/dist/oh-cluster.js +19 -19
  44. package/dist/oh-cluster.js.map +1 -1
  45. package/dist/oh-container.d.ts +19 -16
  46. package/dist/oh-container.d.ts.map +1 -1
  47. package/dist/oh-container.js +26 -33
  48. package/dist/oh-container.js.map +1 -1
  49. package/dist/oh-drawer.d.ts +36 -14
  50. package/dist/oh-drawer.d.ts.map +1 -1
  51. package/dist/oh-drawer.js +57 -26
  52. package/dist/oh-drawer.js.map +1 -1
  53. package/dist/oh-footer.d.ts +37 -18
  54. package/dist/oh-footer.d.ts.map +1 -1
  55. package/dist/oh-footer.js +38 -19
  56. package/dist/oh-footer.js.map +1 -1
  57. package/dist/oh-grid.d.ts +27 -14
  58. package/dist/oh-grid.d.ts.map +1 -1
  59. package/dist/oh-grid.js +27 -19
  60. package/dist/oh-grid.js.map +1 -1
  61. package/dist/oh-icon.d.ts +21 -5
  62. package/dist/oh-icon.d.ts.map +1 -1
  63. package/dist/oh-icon.js +28 -5
  64. package/dist/oh-icon.js.map +1 -1
  65. package/dist/oh-input.d.ts +105 -21
  66. package/dist/oh-input.d.ts.map +1 -1
  67. package/dist/oh-input.js +207 -68
  68. package/dist/oh-input.js.map +1 -1
  69. package/dist/oh-link.d.ts +42 -19
  70. package/dist/oh-link.d.ts.map +1 -1
  71. package/dist/oh-link.js +56 -34
  72. package/dist/oh-link.js.map +1 -1
  73. package/dist/oh-modal.d.ts +29 -6
  74. package/dist/oh-modal.d.ts.map +1 -1
  75. package/dist/oh-modal.js +37 -16
  76. package/dist/oh-modal.js.map +1 -1
  77. package/dist/oh-navbar.d.ts +42 -19
  78. package/dist/oh-navbar.d.ts.map +1 -1
  79. package/dist/oh-navbar.js +44 -21
  80. package/dist/oh-navbar.js.map +1 -1
  81. package/dist/oh-progress.d.ts +26 -7
  82. package/dist/oh-progress.d.ts.map +1 -1
  83. package/dist/oh-progress.js +32 -13
  84. package/dist/oh-progress.js.map +1 -1
  85. package/dist/oh-radio-group.d.ts +55 -13
  86. package/dist/oh-radio-group.d.ts.map +1 -1
  87. package/dist/oh-radio-group.js +84 -44
  88. package/dist/oh-radio-group.js.map +1 -1
  89. package/dist/oh-radio.d.ts +56 -18
  90. package/dist/oh-radio.d.ts.map +1 -1
  91. package/dist/oh-radio.js +93 -60
  92. package/dist/oh-radio.js.map +1 -1
  93. package/dist/oh-select.d.ts +58 -16
  94. package/dist/oh-select.d.ts.map +1 -1
  95. package/dist/oh-select.js +72 -36
  96. package/dist/oh-select.js.map +1 -1
  97. package/dist/oh-skip-link.d.ts +33 -15
  98. package/dist/oh-skip-link.d.ts.map +1 -1
  99. package/dist/oh-skip-link.js +39 -26
  100. package/dist/oh-skip-link.js.map +1 -1
  101. package/dist/oh-stack.d.ts +17 -14
  102. package/dist/oh-stack.d.ts.map +1 -1
  103. package/dist/oh-stack.js +18 -20
  104. package/dist/oh-stack.js.map +1 -1
  105. package/dist/oh-tabs.d.ts +56 -30
  106. package/dist/oh-tabs.d.ts.map +1 -1
  107. package/dist/oh-tabs.js +89 -70
  108. package/dist/oh-tabs.js.map +1 -1
  109. package/dist/oh-textarea.d.ts +37 -6
  110. package/dist/oh-textarea.d.ts.map +1 -1
  111. package/dist/oh-textarea.js +40 -9
  112. package/dist/oh-textarea.js.map +1 -1
  113. package/dist/oh-toggle.d.ts +45 -12
  114. package/dist/oh-toggle.d.ts.map +1 -1
  115. package/dist/oh-toggle.js +68 -33
  116. package/dist/oh-toggle.js.map +1 -1
  117. package/dist/styles/typography.d.ts.map +1 -1
  118. package/dist/styles/typography.js +1 -2
  119. package/dist/styles/typography.js.map +1 -1
  120. package/package.json +3 -7
  121. package/dist/oh-button.figma.d.ts +0 -2
  122. package/dist/oh-button.figma.d.ts.map +0 -1
  123. package/dist/oh-button.figma.js +0 -18
  124. package/dist/oh-button.figma.js.map +0 -1
  125. package/dist/oh-checkbox-group.figma.d.ts +0 -2
  126. package/dist/oh-checkbox-group.figma.d.ts.map +0 -1
  127. package/dist/oh-checkbox-group.figma.js +0 -24
  128. package/dist/oh-checkbox-group.figma.js.map +0 -1
  129. package/dist/oh-hero.d.ts +0 -33
  130. package/dist/oh-hero.d.ts.map +0 -1
  131. package/dist/oh-hero.js +0 -248
  132. package/dist/oh-hero.js.map +0 -1
  133. package/dist/oh-input.figma.d.ts +0 -2
  134. package/dist/oh-input.figma.d.ts.map +0 -1
  135. package/dist/oh-input.figma.js +0 -36
  136. package/dist/oh-input.figma.js.map +0 -1
  137. package/dist/oh-radio-group.figma.d.ts +0 -2
  138. package/dist/oh-radio-group.figma.d.ts.map +0 -1
  139. package/dist/oh-radio-group.figma.js +0 -22
  140. package/dist/oh-radio-group.figma.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"oh-alert.js","sourceRoot":"","sources":["../src/oh-alert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAK3C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,SAAS;IAA/B;;QA8NL,YAAO,GAAiB,MAAM,CAAC;QAG/B,gBAAW,GAAG,KAAK,CAAC;QAEpB;;;WAGG;QAEH,SAAI,GAAG,KAAK,CAAC;IA6Gf,CAAC;aApViB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA;;;;;;;;;;;;;SAaV,CAAC;YACJ,KAAK,OAAO;gBACV,OAAO,IAAI,CAAA;;;;;;;;;;;;;SAaV,CAAC;YACJ,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAA;;;;;;;;;;;;;SAaV,CAAC;YACJ,KAAK,MAAM,CAAC;YACZ;gBACE,OAAO,IAAI,CAAA;;;;;;;;;;;;;SAaV,CAAC;QACN,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC5B,KAAK,EAAE,IAAI;YACX,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI;SACjC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAA;mBACI,OAAO,SAAS,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;UACtD,IAAI,CAAC,QAAQ,EAAE;;;;;;UAMf,IAAI,CAAC,WAAW;YAChB,CAAC,CAAC,IAAI,CAAA;;;;;yBAKS,IAAI,CAAC,cAAc;;;;;;;;;;;aAW/B;YACH,CAAC,CAAC,OAAO;;KAEd,CAAC;IACJ,CAAC;;AAtHD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACX;AAG/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACvB;AAOpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAC9B;AAxOF,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAqVnB"}
@@ -1,33 +1,52 @@
1
1
  /**
2
2
  * oh-badge
3
3
  *
4
- * A flat, non-interactive badge for status indicators and labels.
5
- * Two styles per color: subtle (muted bg) and filled (strong bg).
4
+ * A non-interactive label for a status or category.
5
+ * Two types per variant: subtle and filled.
6
6
  *
7
7
  * DESIGN DECISIONS:
8
8
  * ─────────────────
9
- * 1. FLAT & NON-INTERACTIVE
10
- * - No shadows, no hover states
9
+ * 1. NON-INTERACTIVE
10
+ * - No shadow, no hover states, pointer-events off
11
11
  * - Pure informational element
12
12
  * - Not clickable
13
13
  *
14
- * 2. TWO INTENSITIES
15
- * - Subtle: muted background, darker text
16
- * - Filled: strong background, white/dark text
14
+ * 2. TWO TYPES
15
+ * - Subtle: the variant's *Subtle background token, its role colour as text
16
+ * - Filled: the role colour as background, its color.text.on* token as text
17
17
  *
18
18
  * 3. ACCESSIBLE CONTRAST
19
- * - All text meets WCAG AA (4.5:1)
20
- * - Filled variants use appropriate text color
21
- *
22
- * @element oh-badge
19
+ * - Every text/background pair is in contrast-pairs.json, so
20
+ * check:contrast checks it in every brand and mode
23
21
  */
24
22
  import { OhElement } from "./base.js";
25
23
  export type BadgeVariant = "success" | "error" | "warning" | "info" | "brand" | "accent";
26
- export type BadgeType = "subtle" | "filled";
24
+ export type BadgeAppearance = "subtle" | "filled";
25
+ /**
26
+ * A short, non-interactive label that shows the status or category of the thing next to it.
27
+ *
28
+ * **Use it for** a status ("Delivered", "Pending"), a count or a tag next to the item it describes. **Don't use it for** anything the user can select (use `oh-button` or a link); or for a message with more than a word or two (use `oh-alert`).
29
+ *
30
+ * **Variants:** `brand` (default) and `accent` for categories; `success`, `warning`, `error` and `info` for status. **Appearance:** `subtle` (default), for most badges; `filled`, the stronger appearance, for the one status that matters most.
31
+ *
32
+ * **Parts:** the default slot holds the text; the `icon` slot an optional leading icon, sized to the text.
33
+ *
34
+ * **Behaviour:** none. It doesn't take focus or respond to the pointer.
35
+ *
36
+ * **Accessibility:** the badge is plain text to screen readers, so the text must make sense on its own (say "Pending", don't rely on the colour). Mark a decorative icon `aria-hidden`.
37
+ *
38
+ * **Look:** set by tokens. Subtle uses the variant's `color.feedback.<variant>Subtle`, `color.brand.primarySubtle` or `color.accent.subtle` background with the role colour as text; filled uses the role colour (`color.feedback.<variant>`, `color.brand.primary`, `color.accent.default`) as background with `color.text.on<Role>` as text. `shape.compact` sets the corners; `typography.body.*`, `typography.label.base.fontWeight` and `typography.control.letterSpacing` the text.
39
+ *
40
+ * @element oh-badge
41
+ * @slot - The badge text.
42
+ * @slot icon - Optional leading icon.
43
+ * @csspart badge - The badge.
44
+ */
27
45
  export declare class OhBadge extends OhElement {
28
46
  static styles: import("lit").CSSResult[];
29
47
  variant: BadgeVariant;
30
- type: BadgeType;
48
+ /** `subtle` (default) for most badges; `filled`, the stronger appearance, for the one status that matters most */
49
+ appearance: BadgeAppearance;
31
50
  render(): import("lit").TemplateResult<1>;
32
51
  }
33
52
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"oh-badge.d.ts","sourceRoot":"","sources":["../src/oh-badge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,OAAO,GACP,SAAS,GACT,MAAM,GACN,OAAO,GACP,QAAQ,CAAC;AACb,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5C,qBACa,OAAQ,SAAQ,SAAS;IACpC,OAAgB,MAAM,4BAgHpB;IAGF,OAAO,EAAE,YAAY,CAAW;IAGhC,IAAI,EAAE,SAAS,CAAY;IAE3B,MAAM;CAcP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
1
+ {"version":3,"file":"oh-badge.d.ts","sourceRoot":"","sources":["../src/oh-badge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,OAAO,GACP,SAAS,GACT,MAAM,GACN,OAAO,GACP,QAAQ,CAAC;AACb,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAElD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,OAAQ,SAAQ,SAAS;IACpC,OAAgB,MAAM,4BAgHpB;IAGF,OAAO,EAAE,YAAY,CAAW;IAEhC,kHAAkH;IAElH,UAAU,EAAE,eAAe,CAAY;IAEvC,MAAM;CAcP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
package/dist/oh-badge.js CHANGED
@@ -1,25 +1,23 @@
1
1
  /**
2
2
  * oh-badge
3
3
  *
4
- * A flat, non-interactive badge for status indicators and labels.
5
- * Two styles per color: subtle (muted bg) and filled (strong bg).
4
+ * A non-interactive label for a status or category.
5
+ * Two types per variant: subtle and filled.
6
6
  *
7
7
  * DESIGN DECISIONS:
8
8
  * ─────────────────
9
- * 1. FLAT & NON-INTERACTIVE
10
- * - No shadows, no hover states
9
+ * 1. NON-INTERACTIVE
10
+ * - No shadow, no hover states, pointer-events off
11
11
  * - Pure informational element
12
12
  * - Not clickable
13
13
  *
14
- * 2. TWO INTENSITIES
15
- * - Subtle: muted background, darker text
16
- * - Filled: strong background, white/dark text
14
+ * 2. TWO TYPES
15
+ * - Subtle: the variant's *Subtle background token, its role colour as text
16
+ * - Filled: the role colour as background, its color.text.on* token as text
17
17
  *
18
18
  * 3. ACCESSIBLE CONTRAST
19
- * - All text meets WCAG AA (4.5:1)
20
- * - Filled variants use appropriate text color
21
- *
22
- * @element oh-badge
19
+ * - Every text/background pair is in contrast-pairs.json, so
20
+ * check:contrast checks it in every brand and mode
23
21
  */
24
22
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
25
23
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -30,18 +28,39 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
30
28
  import { html, css } from "lit";
31
29
  import { customElement, property } from "lit/decorators.js";
32
30
  import { OhElement, baseStyles } from "./base.js";
31
+ /**
32
+ * A short, non-interactive label that shows the status or category of the thing next to it.
33
+ *
34
+ * **Use it for** a status ("Delivered", "Pending"), a count or a tag next to the item it describes. **Don't use it for** anything the user can select (use `oh-button` or a link); or for a message with more than a word or two (use `oh-alert`).
35
+ *
36
+ * **Variants:** `brand` (default) and `accent` for categories; `success`, `warning`, `error` and `info` for status. **Appearance:** `subtle` (default), for most badges; `filled`, the stronger appearance, for the one status that matters most.
37
+ *
38
+ * **Parts:** the default slot holds the text; the `icon` slot an optional leading icon, sized to the text.
39
+ *
40
+ * **Behaviour:** none. It doesn't take focus or respond to the pointer.
41
+ *
42
+ * **Accessibility:** the badge is plain text to screen readers, so the text must make sense on its own (say "Pending", don't rely on the colour). Mark a decorative icon `aria-hidden`.
43
+ *
44
+ * **Look:** set by tokens. Subtle uses the variant's `color.feedback.<variant>Subtle`, `color.brand.primarySubtle` or `color.accent.subtle` background with the role colour as text; filled uses the role colour (`color.feedback.<variant>`, `color.brand.primary`, `color.accent.default`) as background with `color.text.on<Role>` as text. `shape.compact` sets the corners; `typography.body.*`, `typography.label.base.fontWeight` and `typography.control.letterSpacing` the text.
45
+ *
46
+ * @element oh-badge
47
+ * @slot - The badge text.
48
+ * @slot icon - Optional leading icon.
49
+ * @csspart badge - The badge.
50
+ */
33
51
  let OhBadge = class OhBadge extends OhElement {
34
52
  constructor() {
35
53
  super(...arguments);
36
54
  this.variant = "brand";
37
- this.type = "subtle";
55
+ /** `subtle` (default) for most badges; `filled`, the stronger appearance, for the one status that matters most */
56
+ this.appearance = "subtle";
38
57
  }
39
58
  static { this.styles = [
40
59
  baseStyles,
41
60
  css `
42
61
  /* ═══════════════════════════════════════════════════════════════
43
- ORANGE HALO BADGE
44
- Flat • Non-interactive • Informational
62
+ BADGE
63
+ Non-interactive • Informational
45
64
  ═══════════════════════════════════════════════════════════════ */
46
65
 
47
66
  :host {
@@ -153,7 +172,7 @@ let OhBadge = class OhBadge extends OhElement {
153
172
  const classes = this.classMap({
154
173
  badge: true,
155
174
  [`badge--${this.variant}`]: true,
156
- [`badge--${this.type}`]: true,
175
+ [`badge--${this.appearance}`]: true,
157
176
  });
158
177
  return html `
159
178
  <span class=${classes} part="badge">
@@ -168,7 +187,7 @@ __decorate([
168
187
  ], OhBadge.prototype, "variant", void 0);
169
188
  __decorate([
170
189
  property({ type: String, reflect: true })
171
- ], OhBadge.prototype, "type", void 0);
190
+ ], OhBadge.prototype, "appearance", void 0);
172
191
  OhBadge = __decorate([
173
192
  customElement("oh-badge")
174
193
  ], OhBadge);
@@ -1 +1 @@
1
- {"version":3,"file":"oh-badge.js","sourceRoot":"","sources":["../src/oh-badge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAY3C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,SAAS;IAA/B;;QAoHL,YAAO,GAAiB,OAAO,CAAC;QAGhC,SAAI,GAAc,QAAQ,CAAC;IAgB7B,CAAC;aAtIiB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6GF;KACF,AAhHqB,CAgHpB;IAQF,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC5B,KAAK,EAAE,IAAI;YACX,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI;YAChC,CAAC,UA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UAAU,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,IAAI;SACpC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAA;oBACK,OAAO;;;;KAItB,CAAC;IACJ,CAAC;;AAnBD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACV;AAIhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CACH;AAxH5B,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAwInB"}
@@ -1,24 +1,20 @@
1
1
  /**
2
2
  * oh-breadcrumb
3
3
  *
4
- * Accessible breadcrumb navigation with responsive collapse.
5
- *
6
4
  * DESIGN DECISIONS:
7
5
  * ─────────────────
8
6
  * 1. SEMANTIC STRUCTURE
9
- * - <nav> with aria-label="Breadcrumb"
10
- * - <ol> for ordered list semantics
11
- * - aria-current="page" on last item
7
+ * - <nav aria-label="Breadcrumb"> around an <ol>
8
+ * - aria-current="page" on the last item, which is not a link
9
+ * - Separators are aria-hidden
12
10
  *
13
- * 2. REUSES EXISTING STYLES
14
- * - Link styles match oh-link (dashed underline, shrink animation)
15
- * - Typography and spacing from tokens
11
+ * 2. LINKS MIRROR oh-link INLINE
12
+ * - Same underline tokens and hover/focus behaviour, written locally
13
+ * so the trail is one component
16
14
  *
17
15
  * 3. RESPONSIVE
18
- * - Desktop: Full breadcrumb trail
19
- * - Mobile (<640px): Collapses to "← Back to [parent]"
20
- *
21
- * @element oh-breadcrumb
16
+ * - Wide viewports: the full trail
17
+ * - Below `size.breakpoint.sm`: a single "Back to [parent]" link
22
18
  */
23
19
  import { nothing } from "lit";
24
20
  import { OhElement } from "./base.js";
@@ -26,6 +22,37 @@ export interface BreadcrumbItem {
26
22
  label: string;
27
23
  href?: string;
28
24
  }
25
+ /**
26
+ * A breadcrumb trail showing where the current page sits in the site's hierarchy.
27
+ *
28
+ * **Use it for** pages two or more levels deep in a hierarchy. **Don't use it
29
+ * for** a site's main navigation (use `oh-navbar`) or for steps in a process.
30
+ *
31
+ * **Parts:** pass `items`, an array of `{ label, href }`, from the top level
32
+ * down. The last item is the current page and is shown as text, not a link.
33
+ *
34
+ * **Behaviour:** below the `size.breakpoint.sm` width the trail collapses to a
35
+ * single "Back to [parent]" link to the second-to-last item; with one item,
36
+ * nothing shows there. Link underlines retract on hover; keyboard focus
37
+ * (`:focus-visible`) shows a solid underline and a background tint.
38
+ * Transitions are cut short under `prefers-reduced-motion`. Renders nothing
39
+ * when `items` is empty.
40
+ *
41
+ * **Accessibility:** renders `<nav aria-label="Breadcrumb">` with an ordered
42
+ * list, `aria-current="page"` on the last item and `aria-hidden` separators.
43
+ * Use one breadcrumb per page.
44
+ *
45
+ * **Look:** set by tokens — `color.text.link` the links,
46
+ * `decoration.underlineThickness`, `decoration.underlineDash` and
47
+ * `decoration.underlinePeriod` their underline; `color.brand.primary` the
48
+ * focus underline and `color.surface.hover` the focus tint;
49
+ * `color.text.primary` and `typography.label.base.fontWeight` the current
50
+ * page; `color.text.secondary` the separators; `typography.body.*` the text;
51
+ * `spacing.*` the gaps; `motion.relaxed` and `motion.easeGentle` the
52
+ * transitions.
53
+ *
54
+ * @element oh-breadcrumb
55
+ */
29
56
  export declare class OhBreadcrumb extends OhElement {
30
57
  static styles: import("lit").CSSResult[];
31
58
  items: BreadcrumbItem[];
@@ -1 +1 @@
1
- {"version":3,"file":"oh-breadcrumb.d.ts","sourceRoot":"","sources":["../src/oh-breadcrumb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAa,OAAO,EAAE,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBACa,YAAa,SAAQ,SAAS;IACzC,OAAgB,MAAM,4BAgMpB;IAGF,KAAK,EAAE,cAAc,EAAE,CAAM;IAE7B,MAAM;CA8DP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
1
+ {"version":3,"file":"oh-breadcrumb.d.ts","sourceRoot":"","sources":["../src/oh-breadcrumb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAa,OAAO,EAAE,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBACa,YAAa,SAAQ,SAAS;IACzC,OAAgB,MAAM,4BA2LpB;IAGF,KAAK,EAAE,cAAc,EAAE,CAAM;IAE7B,MAAM;CA8DP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
@@ -1,24 +1,20 @@
1
1
  /**
2
2
  * oh-breadcrumb
3
3
  *
4
- * Accessible breadcrumb navigation with responsive collapse.
5
- *
6
4
  * DESIGN DECISIONS:
7
5
  * ─────────────────
8
6
  * 1. SEMANTIC STRUCTURE
9
- * - <nav> with aria-label="Breadcrumb"
10
- * - <ol> for ordered list semantics
11
- * - aria-current="page" on last item
7
+ * - <nav aria-label="Breadcrumb"> around an <ol>
8
+ * - aria-current="page" on the last item, which is not a link
9
+ * - Separators are aria-hidden
12
10
  *
13
- * 2. REUSES EXISTING STYLES
14
- * - Link styles match oh-link (dashed underline, shrink animation)
15
- * - Typography and spacing from tokens
11
+ * 2. LINKS MIRROR oh-link INLINE
12
+ * - Same underline tokens and hover/focus behaviour, written locally
13
+ * so the trail is one component
16
14
  *
17
15
  * 3. RESPONSIVE
18
- * - Desktop: Full breadcrumb trail
19
- * - Mobile (<640px): Collapses to "← Back to [parent]"
20
- *
21
- * @element oh-breadcrumb
16
+ * - Wide viewports: the full trail
17
+ * - Below `size.breakpoint.sm`: a single "Back to [parent]" link
22
18
  */
23
19
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
24
20
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -29,6 +25,37 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
29
25
  import { html, css, nothing } from "lit";
30
26
  import { customElement, property } from "lit/decorators.js";
31
27
  import { OhElement, baseStyles } from "./base.js";
28
+ /**
29
+ * A breadcrumb trail showing where the current page sits in the site's hierarchy.
30
+ *
31
+ * **Use it for** pages two or more levels deep in a hierarchy. **Don't use it
32
+ * for** a site's main navigation (use `oh-navbar`) or for steps in a process.
33
+ *
34
+ * **Parts:** pass `items`, an array of `{ label, href }`, from the top level
35
+ * down. The last item is the current page and is shown as text, not a link.
36
+ *
37
+ * **Behaviour:** below the `size.breakpoint.sm` width the trail collapses to a
38
+ * single "Back to [parent]" link to the second-to-last item; with one item,
39
+ * nothing shows there. Link underlines retract on hover; keyboard focus
40
+ * (`:focus-visible`) shows a solid underline and a background tint.
41
+ * Transitions are cut short under `prefers-reduced-motion`. Renders nothing
42
+ * when `items` is empty.
43
+ *
44
+ * **Accessibility:** renders `<nav aria-label="Breadcrumb">` with an ordered
45
+ * list, `aria-current="page"` on the last item and `aria-hidden` separators.
46
+ * Use one breadcrumb per page.
47
+ *
48
+ * **Look:** set by tokens — `color.text.link` the links,
49
+ * `decoration.underlineThickness`, `decoration.underlineDash` and
50
+ * `decoration.underlinePeriod` their underline; `color.brand.primary` the
51
+ * focus underline and `color.surface.hover` the focus tint;
52
+ * `color.text.primary` and `typography.label.base.fontWeight` the current
53
+ * page; `color.text.secondary` the separators; `typography.body.*` the text;
54
+ * `spacing.*` the gaps; `motion.relaxed` and `motion.easeGentle` the
55
+ * transitions.
56
+ *
57
+ * @element oh-breadcrumb
58
+ */
32
59
  let OhBreadcrumb = class OhBreadcrumb extends OhElement {
33
60
  constructor() {
34
61
  super(...arguments);
@@ -37,11 +64,6 @@ let OhBreadcrumb = class OhBreadcrumb extends OhElement {
37
64
  static { this.styles = [
38
65
  baseStyles,
39
66
  css `
40
- /* ═══════════════════════════════════════════════════════════════
41
- ORANGE HALO BREADCRUMB
42
- Semantic • Responsive • Accessible
43
- ═══════════════════════════════════════════════════════════════ */
44
-
45
67
  :host {
46
68
  display: block;
47
69
  font-family: var(--oh-typography-body-font-family);
@@ -93,7 +115,7 @@ let OhBreadcrumb = class OhBreadcrumb extends OhElement {
93
115
  .breadcrumb-link::after {
94
116
  content: "";
95
117
  position: absolute;
96
- left: 0;
118
+ inset-inline-start: 0;
97
119
  bottom: 0;
98
120
  width: 100%;
99
121
  height: var(--oh-decoration-underline-thickness);
@@ -106,7 +128,7 @@ let OhBreadcrumb = class OhBreadcrumb extends OhElement {
106
128
  );
107
129
  background-size: 100% 100%;
108
130
  background-repeat: no-repeat;
109
- transform-origin: right;
131
+ transform-origin: calc(50% + 50% * var(--_oh-dir)); /* the end side */
110
132
  transition: transform var(--oh-motion-relaxed)
111
133
  var(--oh-motion-ease-gentle);
112
134
  }
@@ -160,7 +182,7 @@ let OhBreadcrumb = class OhBreadcrumb extends OhElement {
160
182
  .back-link::after {
161
183
  content: "";
162
184
  position: absolute;
163
- left: 0;
185
+ inset-inline-start: 0;
164
186
  bottom: 0;
165
187
  width: 100%;
166
188
  height: var(--oh-decoration-underline-thickness);
@@ -173,7 +195,7 @@ let OhBreadcrumb = class OhBreadcrumb extends OhElement {
173
195
  );
174
196
  background-size: 100% 100%;
175
197
  background-repeat: no-repeat;
176
- transform-origin: right;
198
+ transform-origin: calc(50% + 50% * var(--_oh-dir)); /* the end side */
177
199
  transition: transform var(--oh-motion-relaxed)
178
200
  var(--oh-motion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AI,IAAI,GAAG;;;;;;;;;;;;;;;kCAehC,UAAU,CAAC,KAAK;;;aAGrC;YACH,CAAC,CAAC,OAAO;;KAEd,CAAC;IACJ,CAAC;;AA/DD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;2CACG;AA/LlB,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA+PxB"}
@@ -1,37 +1,63 @@
1
1
  /**
2
2
  * oh-button
3
3
  *
4
- * A chunky, confident button with playful personality.
5
- * Inspired by hand-crafted, illustrative UI — not corporate SaaS.
6
- *
7
4
  * DESIGN DECISIONS:
8
5
  * ─────────────────
9
- * 1. CHUNKY & CONFIDENT
10
- * - Thick border (stroke.control) that feels illustrative
11
- * - Solid fills, no subtle gradients
12
- * - Generous padding, substantial presence
6
+ * 1. Renders a native <button>, or an <a> when `href` is set, inside the
7
+ * shadow root, so keyboard and screen reader behaviour come from the
8
+ * platform. `accessible-label` is forwarded to it (an aria-label on the
9
+ * host isn't).
10
+ * 2. Look comes from button.* component tokens: button.base.borderWidth
11
+ * (stroke.control), button.base.borderRadius (shape.control),
12
+ * button.variant.<variant>.* for fills, text, border and shadow colour,
13
+ * button.size.<size>.* for type, padding and height.
14
+ * 3. Hover and active move the button by lift.hoverMd / lift.pressMd and set
15
+ * the shadow offset to elevation.offset.2xl / elevation.offset.xs (rest is
16
+ * elevation.offset.lg).
17
+ * 4. Focus is a solid underline on the label (an underline the button draws
18
+ * itself for icon-only and loading buttons, whose text is hidden).
19
+ * 5. Loading uses aria-disabled + aria-busy, not disabled, so focus stays on
20
+ * the button.
21
+ */
22
+ import { OhElement } from "./base.js";
23
+ export type ButtonVariant = "primary" | "secondary" | "accent";
24
+ export type ButtonSize = "sm" | "md" | "lg";
25
+ export type ButtonState = "default" | "hover" | "active" | "focus";
26
+ /**
27
+ * A button that starts an action, or a link styled as a button when `href` is set.
13
28
  *
14
- * 2. OFFSET SHADOW (STICKER EFFECT)
15
- * - Shadow offset to bottom-right
16
- * - Feels like a physical sticker or stamp
17
- * - Not a generic centered drop shadow
29
+ * **Use it for** actions: submitting, saving, opening a dialog, confirming.
30
+ * **Don't use it for** links inside running text (use `oh-link`).
18
31
  *
19
- * 3. PLAYFUL INTERACTIONS
20
- * - Hover: slight upward lift + shadow grows
21
- * - Active: pressed down, shadow shrinks (stamp effect)
22
- * - Focus: warm glow + accessible underline
32
+ * **Variants:** `primary` for the main action, `secondary` for the others,
33
+ * `accent` for an action that takes the accent colour role. **Sizes:** `sm`, `md` (default), `lg`.
34
+ * **States:** rest, hover, active, focus and `loading`.
23
35
  *
24
- * 4. HAND-CRAFTED FEEL
25
- * - Bold, defined edges
26
- * - Confident color choices
27
- * - Personality over polish
36
+ * **Behaviour:** fires `oh-click` when the inner `<button>` is clicked, except
37
+ * while `loading`. `loading` shows a spinner, keeps the label for screen
38
+ * readers, sets `aria-busy` and `aria-disabled` and ignores clicks, while the
39
+ * button stays focusable. With `href` it renders an `<a>` (and
40
+ * `target="_blank"` adds `rel="noopener noreferrer"`); link buttons don't fire
41
+ * `oh-click`. It has no `disabled` property and doesn't submit a form by
42
+ * itself: handle `oh-click`. Under `prefers-reduced-motion` it doesn't move.
43
+ *
44
+ * **Accessibility:** focus shows a solid underline on the label. An
45
+ * `icon-only` button has no visible text, so always set `accessible-label`
46
+ * (not `aria-label`, which isn't forwarded into the shadow root).
47
+ *
48
+ * **Look:** set by tokens — `stroke.control` (border width), `shape.control`
49
+ * (corners), `typography.control.*` (type), `button.variant.<variant>.*`
50
+ * (background, text, border and shadow colour per state), `button.size.<size>.*`
51
+ * (font size, padding, minimum height), `elevation.offset.*` (shadow offset)
52
+ * and `lift.hoverMd` / `lift.pressMd` (movement on hover and press).
28
53
  *
29
54
  * @element oh-button
55
+ * @fires oh-click - The button was clicked (not while loading). `detail.originalEvent` is the click.
56
+ * @slot - The label.
57
+ * @slot icon-left - An icon before the label.
58
+ * @slot icon-right - An icon after the label.
59
+ * @csspart button - The inner `<button>` or `<a>`.
30
60
  */
31
- import { OhElement } from "./base.js";
32
- export type ButtonVariant = "primary" | "secondary" | "accent";
33
- export type ButtonSize = "sm" | "md" | "lg";
34
- export type ButtonState = "default" | "hover" | "active" | "focus";
35
61
  export declare class OhButton extends OhElement {
36
62
  static styles: import("lit").CSSResult[];
37
63
  variant: ButtonVariant;
@@ -45,7 +71,7 @@ export declare class OhButton extends OhElement {
45
71
  */
46
72
  accessibleLabel?: string;
47
73
  /**
48
- * Force a visual state (for documentation/Figma sync only)
74
+ * Force a visual state (for documentation only)
49
75
  * Values: 'hover' | 'active' | 'focus'
50
76
  */
51
77
  forceState: ButtonState;
@@ -1 +1 @@
1
- {"version":3,"file":"oh-button.d.ts","sourceRoot":"","sources":["../src/oh-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAC/D,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC5C,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnE,qBACa,QAAS,SAAQ,SAAS;IACrC,OAAgB,MAAM,4BA8YpB;IAGF,OAAO,EAAE,aAAa,CAAa;IAGnC,IAAI,EAAE,UAAU,CAAQ;IAGxB,OAAO,UAAS;IAGhB,QAAQ,UAAS;IAEjB;;;;OAIG;IAEH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IAEH,UAAU,EAAE,WAAW,CAAa;IAEpC,kEAAkE;IAElE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,uDAAuD;IAEvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,YAAY;IASpB,+CAA+C;IACtC,KAAK,CAAC,OAAO,CAAC,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