@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
package/dist/oh-link.js CHANGED
@@ -1,29 +1,18 @@
1
1
  /**
2
2
  * oh-link
3
3
  *
4
- * A warm, playful link with retro-inspired styling.
5
- * Two variants: inline (for body text) and standalone (for CTAs).
6
- *
7
4
  * DESIGN DECISIONS:
8
5
  * ─────────────────
9
- * 1. INLINE VARIANT
10
- * - Dotted underline (quirky, retro feel)
11
- * - Becomes solid on hover
12
- * - Warm brand orange
13
- * - Subtle but distinctive
14
- *
15
- * 2. STANDALONE VARIANT
16
- * - Bolder presence for CTAs
17
- * - Offset shadow on hover (mini sticker effect)
18
- * - Lift animation like other components
19
- * - Arrow icon option
20
- *
21
- * 3. ACCESSIBILITY
22
- * - Underline always visible (not color-only)
23
- * - Clear focus state
24
- * - Proper contrast ratios
25
- *
26
- * @element oh-link
6
+ * 1. Two variants: `inline` for links inside body text, `standalone` for
7
+ * links that stand on their own (CTAs, "View all").
8
+ * 2. The underline is a pseudo-element so it can transition. Its shape comes
9
+ * from the `decoration.underline*` tokens; it retracts on hover.
10
+ * 3. Keyboard focus swaps in a solid underline (`color.brand.primary`,
11
+ * `decoration.underlineFocusThickness`) as the indicator; the
12
+ * `focus.glowColor` tint behind it is decoration only.
13
+ * 4. Links are never colour-only: the underline is visible at rest.
14
+ * 5. `target="_blank"` adds an icon, a visually hidden "(opens in new tab)"
15
+ * and `rel="noopener noreferrer"` (unless `rel` is set).
27
16
  */
28
17
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
29
18
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -34,6 +23,40 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
34
23
  import { html, css, nothing } from "lit";
35
24
  import { customElement, property } from "lit/decorators.js";
36
25
  import { OhElement, baseStyles } from "./base.js";
26
+ /**
27
+ * A text link, for use inside body copy or on its own as a call to action.
28
+ *
29
+ * **Use it for** navigating to another page or place. **Don't use it for**
30
+ * actions that don't navigate (use `oh-button` instead).
31
+ *
32
+ * **Variants:** `inline` (default) sits in running text; `standalone` is
33
+ * larger and bolder for links on their own, and can show a trailing arrow
34
+ * (`arrow`). `inverse` is for links on accent surfaces.
35
+ *
36
+ * **Behaviour:** renders a native `<a>`, so Enter follows it and it takes
37
+ * focus in tab order. On hover the underline retracts and the arrow nudges
38
+ * forward. Keyboard focus (`:focus-visible`) shows a solid underline and a
39
+ * tint; mouse focus doesn't. Transitions are cut short under
40
+ * `prefers-reduced-motion`. With `target="_blank"` it adds an external icon,
41
+ * screen-reader text "(opens in new tab)" and `rel="noopener noreferrer"`
42
+ * when `rel` isn't set; the arrow is not shown on external links.
43
+ *
44
+ * **Accessibility:** the underline shows at rest and on focus, so links
45
+ * don't rely on colour. Write link text that makes sense out of context.
46
+ *
47
+ * **Look:** set by tokens — `color.text.link` the colour (`color.text.onAccent`
48
+ * when `inverse`); `decoration.underlineThickness`, `decoration.underlineDash`
49
+ * and `decoration.underlinePeriod` the underline; `color.brand.primary`
50
+ * (`color.text.onAccent` when `inverse`) and
51
+ * `decoration.underlineFocusThickness` the focus underline; `focus.glowColor`
52
+ * (`link.inverse.focusBackground` when `inverse`) the focus tint;
53
+ * `typography.body.fontFamily`, plus `typography.body.lg.fontSize` and
54
+ * `typography.emphasis.fontWeight` for `standalone`; `motion.slow` and
55
+ * `motion.snappy` the transitions.
56
+ *
57
+ * @element oh-link
58
+ * @slot - The link text.
59
+ */
37
60
  let OhLink = class OhLink extends OhElement {
38
61
  constructor() {
39
62
  super(...arguments);
@@ -47,11 +70,6 @@ let OhLink = class OhLink extends OhElement {
47
70
  static { this.styles = [
48
71
  baseStyles,
49
72
  css `
50
- /* ═══════════════════════════════════════════════════════════════
51
- ORANGE HALO LINK
52
- Warm • Playful • Retro-inspired
53
- ═══════════════════════════════════════════════════════════════ */
54
-
55
73
  :host {
56
74
  display: inline;
57
75
  }
@@ -74,12 +92,11 @@ let OhLink = class OhLink extends OhElement {
74
92
  text-decoration: none;
75
93
  }
76
94
 
77
- /* Dashed underline via pseudo-element (animatable) */
95
+ /* Underline via pseudo-element (animatable), shaped by decoration tokens */
78
96
  .link__text::after {
79
97
  content: "";
80
98
  position: absolute;
81
- left: 0;
82
- right: 0;
99
+ inset-inline: 0;
83
100
  bottom: 0;
84
101
  height: var(--oh-decoration-underline-thickness);
85
102
  background: repeating-linear-gradient(
@@ -89,14 +106,14 @@ let OhLink = class OhLink extends OhElement {
89
106
  transparent var(--oh-decoration-underline-dash),
90
107
  transparent var(--oh-decoration-underline-period)
91
108
  );
92
- transform-origin: right;
109
+ transform-origin: calc(50% + 50% * var(--_oh-dir)); /* the end side */
93
110
  transform: scaleX(1);
94
111
  transition: transform var(--oh-motion-slow) ease;
95
112
  }
96
113
 
97
114
  /* ═══════════════════════════════════════════════════════════════
98
115
  INLINE VARIANT
99
- Dashed underline shrinks right-to-left on hover
116
+ Underline shrinks right-to-left on hover
100
117
  ═══════════════════════════════════════════════════════════════ */
101
118
 
102
119
  .link--inline {
@@ -148,7 +165,7 @@ let OhLink = class OhLink extends OhElement {
148
165
 
149
166
  /* ═══════════════════════════════════════════════════════════════
150
167
  STANDALONE VARIANT
151
- CTA-style with hover lift, dashed underline shrinks on hover
168
+ CTA-style; underline shrinks on hover
152
169
  ═══════════════════════════════════════════════════════════════ */
153
170
 
154
171
  .link--standalone {
@@ -214,8 +231,13 @@ let OhLink = class OhLink extends OhElement {
214
231
  transition: transform var(--oh-motion-snappy) ease;
215
232
  }
216
233
 
234
+ /* The arrow points along the line: mirrored in RTL */
235
+ .link__arrow {
236
+ transform: scaleX(var(--_oh-dir));
237
+ }
238
+
217
239
  .link--standalone:hover .link__arrow {
218
- transform: translateX(3px);
240
+ transform: translateX(calc(3px * var(--_oh-dir))) scaleX(var(--_oh-dir));
219
241
  }
220
242
 
221
243
  /* ═══════════════════════════════════════════════════════════════
@@ -227,7 +249,7 @@ let OhLink = class OhLink extends OhElement {
227
249
  .link__external {
228
250
  width: 1em;
229
251
  height: 1em;
230
- margin-left: 0.25em;
252
+ margin-inline-start: 0.25em;
231
253
  flex-shrink: 0;
232
254
  }
233
255
 
@@ -1 +1 @@
1
- {"version":3,"file":"oh-link.js","sourceRoot":"","sources":["../src/oh-link.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,MAAM,GAAZ,MAAM,MAAO,SAAQ,SAAS;IAA9B;;QA2SL,SAAI,GAAG,EAAE,CAAC;QAGV,WAAM,GAAG,EAAE,CAAC;QAGZ,QAAG,GAAG,EAAE,CAAC;QAGT,YAAO,GAAgB,QAAQ,CAAC;QAGhC,UAAK,GAAG,KAAK,CAAC;QAGd,YAAO,GAAG,KAAK,CAAC;IA2DlB,CAAC;aApXiB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAI,EAAE,MAAM,EAAE,CAAC;mCAClB;AAGT;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACK;AAGhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACd;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAC3B;AAzTL,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CAoXlB"}
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * oh-modal
3
3
  *
4
- * A chunky, accessible modal dialog with focus trapping.
4
+ * An accessible modal dialog with focus trapping.
5
5
  *
6
6
  * DESIGN DECISIONS:
7
7
  * ─────────────────
8
- * 1. CHUNKY & LIFTED
8
+ * 1. LOOK FROM TOKENS
9
9
  * - stroke.control border like other components
10
- * - Offset shadow (elevation.offset.2xl) — feels like a lifted surface
11
- * - Warm backdrop, not pure black
10
+ * - Offset shadow: elevation.offset.2xl in elevation.color.overlay
11
+ * - Backdrop: modal.overlay
12
12
  *
13
13
  * 2. ACCESSIBLE
14
14
  * - Focus trap when open (focus guards at each end of the dialog)
@@ -20,11 +20,34 @@
20
20
  * - Optional heading
21
21
  * - Scrollable body content
22
22
  * - Optional footer slot for actions
23
- *
24
- * @element oh-modal
25
23
  */
26
24
  import { OhElement } from "./base.js";
27
25
  export type ModalSize = "sm" | "md" | "lg";
26
+ /**
27
+ * A dialog that opens over the page and holds the user's attention until they close it or act on it.
28
+ *
29
+ * **Use it for** a short task or decision that must be done before going on: a confirmation, a small form. **Don't use it for** content the user may want alongside the page (use `oh-drawer`); for a message that doesn't need an answer (use `oh-alert`); or for long, multi-step flows (use a page).
30
+ *
31
+ * **Parts:** `heading` (a visible `h2`); the default slot for the body, which scrolls when it's taller than the viewport; the `footer` slot for actions.
32
+ *
33
+ * **Sizes:** `sm`, `md` (default) and `lg` set the dialog's width (never wider than the viewport).
34
+ *
35
+ * **Behaviour:** set `open` to show it. On open, focus moves to the Close button (or the first focusable element when there's none), Tab and Shift+Tab wrap inside the dialog, and the page behind stops scrolling. On close, focus returns to the element that had it. With `dismissible` (the default), the Close button, Escape and a click on the backdrop each fire `oh-close` and set `open` to false; without it, only your own buttons close it. Motion is reduced under `prefers-reduced-motion`.
36
+ *
37
+ * **Accessibility:** the panel is `role="dialog"` with `aria-modal="true"`, named by `heading`. Without a visible heading, set `accessible-label` (not `aria-label` on the host, which isn't forwarded). The close button has a visible "Close" label.
38
+ *
39
+ * **Look:** set by tokens. `modal.overlay` sets the backdrop; the panel uses `color.surface.base`, a `stroke.control` border in `color.border.emphasis`, `shape.container` corners and an `elevation.offset.2xl` shadow in `elevation.color.overlay`. Header and footer dividers use `stroke.control` in `color.border.subtle`; the title uses `typography.heading.h4.*`, the body `typography.body.*`. The close button uses `closeButton.*`, `lift.*` and `shape.compact`. Motion uses `motion.gentle` and `motion.easeEmphasized`.
40
+ *
41
+ * @element oh-modal
42
+ * @slot - The dialog body.
43
+ * @slot footer - Actions, below the body.
44
+ * @csspart modal - The dialog panel.
45
+ * @csspart header - The header (heading and close button).
46
+ * @csspart close - The close button (only when `dismissible`).
47
+ * @csspart body - The scrolling body.
48
+ * @csspart footer - The footer.
49
+ * @fires oh-close - When the user closes the dialog with the Close button, Escape or the backdrop. Not fired when you set `open` to false yourself.
50
+ */
28
51
  export declare class OhModal extends OhElement {
29
52
  static styles: import("lit").CSSResult[];
30
53
  open: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"oh-modal.d.ts","sourceRoot":"","sources":["../src/oh-modal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAGlD,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,qBACa,OAAQ,SAAQ,SAAS;IACpC,OAAgB,MAAM,4BAgP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,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAU/C,OAAO,CAAC,OAAO;IAyBf,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,cAAc;IAOtB,4EAA4E;IAC5E,OAAO,CAAC,qBAAqB;IAS7B;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,aAAa;IAKrB,oBAAoB;IAMpB,MAAM;CAqFP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
package/dist/oh-modal.js CHANGED
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * oh-modal
3
3
  *
4
- * A chunky, accessible modal dialog with focus trapping.
4
+ * An accessible modal dialog with focus trapping.
5
5
  *
6
6
  * DESIGN DECISIONS:
7
7
  * ─────────────────
8
- * 1. CHUNKY & LIFTED
8
+ * 1. LOOK FROM TOKENS
9
9
  * - stroke.control border like other components
10
- * - Offset shadow (elevation.offset.2xl) — feels like a lifted surface
11
- * - Warm backdrop, not pure black
10
+ * - Offset shadow: elevation.offset.2xl in elevation.color.overlay
11
+ * - Backdrop: modal.overlay
12
12
  *
13
13
  * 2. ACCESSIBLE
14
14
  * - Focus trap when open (focus guards at each end of the dialog)
@@ -20,8 +20,6 @@
20
20
  * - Optional heading
21
21
  * - Scrollable body content
22
22
  * - Optional footer slot for actions
23
- *
24
- * @element oh-modal
25
23
  */
26
24
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
27
25
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -33,6 +31,31 @@ import { html, css, nothing } from "lit";
33
31
  import { customElement, property, query, state } from "lit/decorators.js";
34
32
  import { OhElement, baseStyles } from "./base.js";
35
33
  import { getFocusableElementsDeep } from "@orange-halo/utils";
34
+ /**
35
+ * A dialog that opens over the page and holds the user's attention until they close it or act on it.
36
+ *
37
+ * **Use it for** a short task or decision that must be done before going on: a confirmation, a small form. **Don't use it for** content the user may want alongside the page (use `oh-drawer`); for a message that doesn't need an answer (use `oh-alert`); or for long, multi-step flows (use a page).
38
+ *
39
+ * **Parts:** `heading` (a visible `h2`); the default slot for the body, which scrolls when it's taller than the viewport; the `footer` slot for actions.
40
+ *
41
+ * **Sizes:** `sm`, `md` (default) and `lg` set the dialog's width (never wider than the viewport).
42
+ *
43
+ * **Behaviour:** set `open` to show it. On open, focus moves to the Close button (or the first focusable element when there's none), Tab and Shift+Tab wrap inside the dialog, and the page behind stops scrolling. On close, focus returns to the element that had it. With `dismissible` (the default), the Close button, Escape and a click on the backdrop each fire `oh-close` and set `open` to false; without it, only your own buttons close it. Motion is reduced under `prefers-reduced-motion`.
44
+ *
45
+ * **Accessibility:** the panel is `role="dialog"` with `aria-modal="true"`, named by `heading`. Without a visible heading, set `accessible-label` (not `aria-label` on the host, which isn't forwarded). The close button has a visible "Close" label.
46
+ *
47
+ * **Look:** set by tokens. `modal.overlay` sets the backdrop; the panel uses `color.surface.base`, a `stroke.control` border in `color.border.emphasis`, `shape.container` corners and an `elevation.offset.2xl` shadow in `elevation.color.overlay`. Header and footer dividers use `stroke.control` in `color.border.subtle`; the title uses `typography.heading.h4.*`, the body `typography.body.*`. The close button uses `closeButton.*`, `lift.*` and `shape.compact`. Motion uses `motion.gentle` and `motion.easeEmphasized`.
48
+ *
49
+ * @element oh-modal
50
+ * @slot - The dialog body.
51
+ * @slot footer - Actions, below the body.
52
+ * @csspart modal - The dialog panel.
53
+ * @csspart header - The header (heading and close button).
54
+ * @csspart close - The close button (only when `dismissible`).
55
+ * @csspart body - The scrolling body.
56
+ * @csspart footer - The footer.
57
+ * @fires oh-close - When the user closes the dialog with the Close button, Escape or the backdrop. Not fired when you set `open` to false yourself.
58
+ */
36
59
  let OhModal = class OhModal extends OhElement {
37
60
  constructor() {
38
61
  super(...arguments);
@@ -46,8 +69,8 @@ let OhModal = class OhModal extends OhElement {
46
69
  baseStyles,
47
70
  css `
48
71
  /* ═══════════════════════════════════════════════════════════════
49
- ORANGE HALO MODAL
50
- Chunky • Lifted • Accessible
72
+ MODAL
73
+ Focus-trapped • Accessible
51
74
  ═══════════════════════════════════════════════════════════════ */
52
75
 
53
76
  :host {
@@ -63,7 +86,7 @@ let OhModal = class OhModal extends OhElement {
63
86
  inset: 0;
64
87
  z-index: 1000;
65
88
 
66
- /* Warm semi-transparent overlay */
89
+ /* Overlay: modal.overlay */
67
90
  background-color: var(--oh-modal-overlay);
68
91
 
69
92
  /* Flexbox centering */
@@ -101,22 +124,20 @@ let OhModal = class OhModal extends OhElement {
101
124
  max-height: calc(100vh - var(--oh-spacing-8));
102
125
  max-width: 100%;
103
126
 
104
- /* Warm surface */
105
127
  background-color: var(--oh-color-surface-base);
106
128
 
107
- /* Chunky border */
108
129
  border: var(--oh-stroke-control) solid var(--oh-color-border-emphasis);
109
130
  border-radius: var(--oh-shape-container);
110
131
 
111
- /* Offset shadow — lifted surface */
132
+ /* Offset shadow: elevation.offset.2xl */
112
133
  box-shadow: var(--oh-elevation-offset-2xl)
113
- var(--oh-elevation-offset-2xl) 0 0 var(--oh-shadow-overlay);
134
+ var(--oh-elevation-offset-2xl) 0 0 var(--oh-elevation-color-overlay);
114
135
 
115
136
  /* Animation */
116
137
  transform: scale(0.95) translateY(10px);
117
138
  opacity: 0;
118
139
  transition:
119
- transform var(--oh-motion-gentle) var(--oh-motion-ease-playful),
140
+ transform var(--oh-motion-gentle) var(--oh-motion-ease-emphasized),
120
141
  opacity var(--oh-motion-gentle) ease;
121
142
  }
122
143
 
@@ -184,8 +205,8 @@ let OhModal = class OhModal extends OhElement {
184
205
  color: var(--oh-color-text-primary);
185
206
 
186
207
  transition:
187
- transform var(--oh-motion-snappy) var(--oh-motion-ease-playful),
188
- box-shadow var(--oh-motion-snappy) var(--oh-motion-ease-playful),
208
+ transform var(--oh-motion-snappy) var(--oh-motion-ease-emphasized),
209
+ box-shadow var(--oh-motion-snappy) var(--oh-motion-ease-emphasized),
189
210
  background-color var(--oh-motion-quick) ease;
190
211
  }
191
212
 
@@ -1 +1 @@
1
- {"version":3,"file":"oh-modal.js","sourceRoot":"","sources":["../src/oh-modal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAKvD,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,SAAS;IAA/B;;QAoPL,SAAI,GAAG,KAAK,CAAC;QAGb,YAAO,GAAG,EAAE,CAAC;QAWb,gBAAW,GAAG,IAAI,CAAC;QAGnB,SAAI,GAAc,IAAI,CAAC;QAGf,2BAAsB,GAAuB,IAAI,CAAC;IAmM5D,CAAC;aA1ciB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6OF;KACF,AAhPqB,CAgPpB;IA4BF,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC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IAAI,EAAE,MAAM,EAAE,CAAC;wCACd;AAQb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;gDACjC;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACxB;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCACnB;AAGf;IADP,KAAK,EAAE;uDACkD;AAGlD;IADP,KAAK,CAAC,cAAc,CAAC;6CACmB;AAzQ9B,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAycnB"}
@@ -1,30 +1,21 @@
1
1
  /**
2
2
  * oh-navbar
3
3
  *
4
- * A responsive navigation bar component with logo, links, and mobile drawer.
5
- *
6
4
  * DESIGN DECISIONS:
7
5
  * ─────────────────
8
6
  * 1. LAYOUT
9
- * - Logo on the left
10
- * - Navigation links on the right (desktop)
11
- * - Hamburger menu on mobile triggers drawer
12
- *
13
- * 2. STYLING
14
- * - Surface base background
15
- * - Chunky bottom border
16
- * - Links use oh-link styling
17
- *
18
- * 3. RESPONSIVE
19
- * - Desktop: horizontal links
20
- * - Mobile (< 768px): hamburger + drawer
21
- *
22
- * @element oh-navbar
7
+ * - Logo on the left, links pushed to the right, inside an
8
+ * oh-container (size lg)
9
+ * - At and below `size.breakpoint.md` the links hide and a menu button
10
+ * opens an oh-drawer from the left
23
11
  *
24
- * @slot logo - Slot for logo/brand element
25
- * @slot - Default slot for navigation links
12
+ * 2. DRAWER LINKS ARE A SEPARATE SLOT
13
+ * - The drawer lives outside the bar, so links for it are passed again
14
+ * in the `mobile` slot
26
15
  *
27
- * @cssprop --oh-navbar-breakpoint - Mobile breakpoint (default: 768px)
16
+ * 3. LOOK FROM TOKENS
17
+ * - `color.surface.base` background, a shadow in `focus.glowColor`,
18
+ * `stroke.divider` / `color.border.subtle` between drawer links
28
19
  */
29
20
  import { OhElement } from "./base.js";
30
21
  import "./oh-container.js";
@@ -32,6 +23,38 @@ import "./oh-cluster.js";
32
23
  import "./oh-drawer.js";
33
24
  import "./oh-button.js";
34
25
  import "./oh-icon.js";
26
+ /**
27
+ * A site header bar with a logo and the site's main navigation links, which move into a drawer on narrow viewports.
28
+ *
29
+ * **Use it for** the main navigation at the top of every page. **Don't use
30
+ * it for** in-page sections (use `oh-tabs`) or a trail through the hierarchy
31
+ * (use `oh-breadcrumb`).
32
+ *
33
+ * **Parts:** the `logo` slot (a link to the home page), the default slot for
34
+ * the bar's links (`oh-link`), and the `mobile` slot for the same links in the
35
+ * drawer. `drawer-heading` names the drawer (defaults to "Menu").
36
+ *
37
+ * **Behaviour:** at and below the `size.breakpoint.md` width the links hide
38
+ * and an icon-only menu button ("Open navigation menu") opens an `oh-drawer`
39
+ * from the left, which traps focus and closes on Escape or its close button.
40
+ *
41
+ * **Accessibility:** the bar and the drawer each wrap their links in a
42
+ * `<nav>`; the drawer is a modal dialog. Give the logo link an accessible
43
+ * name (`alt` on its image, or text).
44
+ *
45
+ * **Look:** set by tokens — `color.surface.base` the background,
46
+ * `focus.glowColor` the shadow, `typography.body.*` the text, `spacing.*` the
47
+ * padding and gaps, `stroke.divider` and `color.border.subtle` the dividers
48
+ * between drawer links. `--oh-navbar-logo-height` sets the logo height.
49
+ *
50
+ * @element oh-navbar
51
+ *
52
+ * @slot logo - Slot for logo/brand element
53
+ * @slot - Default slot for navigation links
54
+ * @slot mobile - The navigation links again, shown in the drawer
55
+ *
56
+ * @cssprop --oh-navbar-logo-height - Height of the slotted logo link or image
57
+ */
35
58
  export declare class OhNavbar extends OhElement {
36
59
  static styles: import("lit").CSSResult[];
37
60
  /** Heading shown in the mobile drawer */
@@ -1 +1 @@
1
- {"version":3,"file":"oh-navbar.d.ts","sourceRoot":"","sources":["../src/oh-navbar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AAEtB,qBACa,QAAS,SAAQ,SAAS;IACrC,OAAgB,MAAM,4BA2EpB;IAEF,yCAAyC;IAEzC,aAAa,SAAU;IAGvB,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAIpB,MAAM;CA0CP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
1
+ {"version":3,"file":"oh-navbar.d.ts","sourceRoot":"","sources":["../src/oh-navbar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBACa,QAAS,SAAQ,SAAS;IACrC,OAAgB,MAAM,4BA2EpB;IAEF,yCAAyC;IAEzC,aAAa,SAAU;IAGvB,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAIpB,MAAM;CA0CP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
package/dist/oh-navbar.js CHANGED
@@ -1,30 +1,21 @@
1
1
  /**
2
2
  * oh-navbar
3
3
  *
4
- * A responsive navigation bar component with logo, links, and mobile drawer.
5
- *
6
4
  * DESIGN DECISIONS:
7
5
  * ─────────────────
8
6
  * 1. LAYOUT
9
- * - Logo on the left
10
- * - Navigation links on the right (desktop)
11
- * - Hamburger menu on mobile triggers drawer
12
- *
13
- * 2. STYLING
14
- * - Surface base background
15
- * - Chunky bottom border
16
- * - Links use oh-link styling
17
- *
18
- * 3. RESPONSIVE
19
- * - Desktop: horizontal links
20
- * - Mobile (< 768px): hamburger + drawer
21
- *
22
- * @element oh-navbar
7
+ * - Logo on the left, links pushed to the right, inside an
8
+ * oh-container (size lg)
9
+ * - At and below `size.breakpoint.md` the links hide and a menu button
10
+ * opens an oh-drawer from the left
23
11
  *
24
- * @slot logo - Slot for logo/brand element
25
- * @slot - Default slot for navigation links
12
+ * 2. DRAWER LINKS ARE A SEPARATE SLOT
13
+ * - The drawer lives outside the bar, so links for it are passed again
14
+ * in the `mobile` slot
26
15
  *
27
- * @cssprop --oh-navbar-breakpoint - Mobile breakpoint (default: 768px)
16
+ * 3. LOOK FROM TOKENS
17
+ * - `color.surface.base` background, a shadow in `focus.glowColor`,
18
+ * `stroke.divider` / `color.border.subtle` between drawer links
28
19
  */
29
20
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
30
21
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -40,6 +31,38 @@ import "./oh-cluster.js";
40
31
  import "./oh-drawer.js";
41
32
  import "./oh-button.js";
42
33
  import "./oh-icon.js";
34
+ /**
35
+ * A site header bar with a logo and the site's main navigation links, which move into a drawer on narrow viewports.
36
+ *
37
+ * **Use it for** the main navigation at the top of every page. **Don't use
38
+ * it for** in-page sections (use `oh-tabs`) or a trail through the hierarchy
39
+ * (use `oh-breadcrumb`).
40
+ *
41
+ * **Parts:** the `logo` slot (a link to the home page), the default slot for
42
+ * the bar's links (`oh-link`), and the `mobile` slot for the same links in the
43
+ * drawer. `drawer-heading` names the drawer (defaults to "Menu").
44
+ *
45
+ * **Behaviour:** at and below the `size.breakpoint.md` width the links hide
46
+ * and an icon-only menu button ("Open navigation menu") opens an `oh-drawer`
47
+ * from the left, which traps focus and closes on Escape or its close button.
48
+ *
49
+ * **Accessibility:** the bar and the drawer each wrap their links in a
50
+ * `<nav>`; the drawer is a modal dialog. Give the logo link an accessible
51
+ * name (`alt` on its image, or text).
52
+ *
53
+ * **Look:** set by tokens — `color.surface.base` the background,
54
+ * `focus.glowColor` the shadow, `typography.body.*` the text, `spacing.*` the
55
+ * padding and gaps, `stroke.divider` and `color.border.subtle` the dividers
56
+ * between drawer links. `--oh-navbar-logo-height` sets the logo height.
57
+ *
58
+ * @element oh-navbar
59
+ *
60
+ * @slot logo - Slot for logo/brand element
61
+ * @slot - Default slot for navigation links
62
+ * @slot mobile - The navigation links again, shown in the drawer
63
+ *
64
+ * @cssprop --oh-navbar-logo-height - Height of the slotted logo link or image
65
+ */
43
66
  let OhNavbar = class OhNavbar extends OhElement {
44
67
  constructor() {
45
68
  super(...arguments);
@@ -85,7 +108,7 @@ let OhNavbar = class OhNavbar extends OhElement {
85
108
 
86
109
  /* Desktop links - pushed to the right */
87
110
  .navbar__links {
88
- margin-left: auto;
111
+ margin-inline-start: auto;
89
112
  width: auto; /* Override oh-cluster's width: 100% */
90
113
  }
91
114
 
@@ -160,7 +183,7 @@ let OhNavbar = class OhNavbar extends OhElement {
160
183
 
161
184
  <!-- Mobile Navigation Drawer -->
162
185
  <oh-drawer
163
- position="left"
186
+ position="start"
164
187
  heading=${this.drawerHeading}
165
188
  ?open=${this._drawerOpen}
166
189
  @oh-close=${this._closeDrawer}
@@ -1 +1 @@
1
- {"version":3,"file":"oh-navbar.js","sourceRoot":"","sources":["../src/oh-navbar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBA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valuenow, aria-valuemin, aria-valuemax
11
11
  * - aria-label for screen reader context
12
- * - Percentage announced to screen readers
12
+ * - The visible percentage is aria-hidden; screen readers get the value
13
+ * from the progressbar's aria-value* attributes
13
14
  *
14
15
  * 2. VISUAL + NUMERIC
15
16
  * - Bar shows progress visually
16
17
  * - Percentage text for precise feedback
17
18
  * - Text can be hidden if needed
18
19
  *
19
- * 3. ORANGE HALO STYLING
20
- * - Chunky track with soft corners
21
- * - Warm fill colors
22
- * - Gentle animation on value change
23
- *
24
- * @element oh-progress
20
+ * 3. LOOK FROM TOKENS
21
+ * - Track: color.surface.inset, stroke.control, shape.pill and
22
+ * progress.track.insetShadow; fill: the variant's role colour
23
+ * - Inverse uses progress.inverse.*, one fill for every variant, so the
24
+ * fill keeps 3:1 against the track (a pair in contrast-pairs.json)
25
+ * - Width change animates over motion.relaxed, off under reduced motion
25
26
  */
26
27
  import { OhElement } from "./base.js";
27
28
  export type ProgressVariant = "brand" | "success" | "info" | "warning" | "error";
28
29
  export type ProgressSize = "sm" | "md" | "lg";
30
+ /**
31
+ * A bar that shows how much of a task is done, with an optional percentage and visible label.
32
+ *
33
+ * **Use it for** a task with a known end: an upload, a download, steps completed. **Don't use it for** a wait of unknown length (it has no indeterminate state); or for a measurement that isn't progress, like storage used against a quota (a meter).
34
+ *
35
+ * **Variants:** `brand` (default), and `success`, `info`, `warning`, `error` by their feedback role. **Sizes:** `sm`, `md` (default), `lg` set the track height and the value's text size. **`inverse`:** for use on a brand-coloured or dark background.
36
+ *
37
+ * **Behaviour:** `value` runs from 0 to `max` (default 100) and is clamped to that range; the bar and the percentage show `value / max`, rounded. `show-value` (on by default) shows the percentage; `show-label` shows `label` above the bar. The fill's width animates when the value changes, except under `prefers-reduced-motion`.
38
+ *
39
+ * **Accessibility:** the bar is a `progressbar` with `aria-valuenow`, `aria-valuemin`, `aria-valuemax` and `aria-label` from `label` (default "Progress"). Always set `label` to say what is progressing. The visible percentage is `aria-hidden`, since screen readers read the value from the progressbar.
40
+ *
41
+ * **Look:** set by tokens. The track uses `color.surface.inset`, a `stroke.control` border in `color.border.default`, `shape.pill` corners and an inset `elevation.offset.sm` shadow in `progress.track.insetShadow`. The fill is `color.brand.primary` or `color.feedback.<variant>`. Text uses `color.text.primary` and `typography.body.*`. Inverse uses `progress.inverse.trackBackground`, `progress.inverse.trackBorder`, `progress.inverse.fill` and `color.text.onBrand`. Motion uses `motion.relaxed` and `motion.easeGentle`.
42
+ *
43
+ * @element oh-progress
44
+ * @csspart track - The bar's track.
45
+ * @csspart fill - The filled part of the track.
46
+ * @csspart value - The percentage text.
47
+ */
29
48
  export declare class OhProgress extends OhElement {
30
49
  static styles: import("lit").CSSResult[];
31
50
  /** Current progress value (0-100 by default, or 0-max) */
@@ -1 +1 @@
1
- {"version":3,"file":"oh-progress.d.ts","sourceRoot":"","sources":["../src/oh-progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,SAAS,GACT,MAAM,GACN,SAAS,GACT,OAAO,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,qBACa,UAAW,SAAQ,SAAS;IACvC,OAAgB,MAAM,4BAgKpB;IAEF,0DAA0D;IAE1D,KAAK,SAAK;IAEV,kCAAkC;IAElC,GAAG,SAAO;IAEV,+DAA+D;IAE/D,KAAK,SAAc;IAEnB,sDAAsD;IAEtD,SAAS,UAAS;IAElB,4CAA4C;IAE5C,SAAS,UAAQ;IAEjB,mBAAmB;IAEnB,IAAI,EAAE,YAAY,CAAQ;IAE1B,oBAAoB;IAEpB,OAAO,EAAE,eAAe,CAAW;IAEnC,0CAA0C;IAE1C,OAAO,UAAS;IAEhB,2CAA2C;IAC3C,OAAO,KAAK,UAAU,GAGrB;IAED,MAAM;CAwCP;AAED,OAAO,CA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