@eunomia/elements 1.0.0-beta.4 → 1.0.0-beta.5

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 (181) hide show
  1. package/dist/cdn/components/chunks/{chunk-SIHZFOTK.js → chunk-2XASWWKR.js} +1 -1
  2. package/dist/cdn/components/chunks/chunk-32DTNR52.js +1 -0
  3. package/dist/cdn/components/chunks/chunk-3MTUVMM5.js +1 -0
  4. package/dist/cdn/components/chunks/chunk-5GKM5DIB.js +1 -0
  5. package/dist/cdn/components/chunks/{chunk-GSJEJLFA.js → chunk-6ETDXUH2.js} +1 -1
  6. package/dist/cdn/components/chunks/{chunk-EJIX2D4Z.js → chunk-AIS3UICU.js} +7 -7
  7. package/dist/cdn/components/chunks/{chunk-BMQOI7HX.js → chunk-DKOPI7QA.js} +99 -55
  8. package/dist/cdn/components/chunks/{chunk-NHFWATVN.js → chunk-EAKYD33D.js} +3 -3
  9. package/dist/cdn/components/chunks/{chunk-EOWBYZV7.js → chunk-IDKZKLJR.js} +5 -5
  10. package/dist/cdn/components/chunks/chunk-JRGM3W7I.js +53 -0
  11. package/dist/cdn/components/chunks/{chunk-UAGCQF23.js → chunk-L65WUTXM.js} +5 -5
  12. package/dist/cdn/components/chunks/chunk-LFCXUVDO.js +1 -0
  13. package/dist/cdn/components/chunks/{chunk-YGUJJ25C.js → chunk-MPQP4R54.js} +2 -2
  14. package/dist/cdn/components/chunks/{chunk-RJCJXB7Y.js → chunk-NBIENHLV.js} +1 -1
  15. package/dist/cdn/components/chunks/{chunk-4MXL6PZC.js → chunk-OW7XKDCH.js} +13 -13
  16. package/dist/cdn/components/chunks/{chunk-IJ5WFMK4.js → chunk-SD2WHGPF.js} +7 -6
  17. package/dist/cdn/components/chunks/chunk-SJWRE6PW.js +1 -0
  18. package/dist/cdn/components/eun-animate.js +5 -3
  19. package/dist/cdn/components/eun-badge.js +7 -7
  20. package/dist/cdn/components/eun-breadcrumb-item.js +1 -1
  21. package/dist/cdn/components/eun-breadcrumb.js +1 -1
  22. package/dist/cdn/components/eun-button.js +1 -1
  23. package/dist/cdn/components/eun-calendar.js +13 -13
  24. package/dist/cdn/components/eun-card.js +42 -3
  25. package/dist/cdn/components/eun-carousel.js +2 -2
  26. package/dist/cdn/components/eun-check-card.js +1 -1
  27. package/dist/cdn/components/eun-checkbox-list.js +1 -1
  28. package/dist/cdn/components/eun-checkbox.js +1 -1
  29. package/dist/cdn/components/eun-chip.js +1 -1
  30. package/dist/cdn/components/eun-collapse.js +39 -20
  31. package/dist/cdn/components/eun-color-picker.js +3 -3
  32. package/dist/cdn/components/eun-counter.js +8 -8
  33. package/dist/cdn/components/eun-date-picker.js +19 -19
  34. package/dist/cdn/components/eun-drawer.js +9 -9
  35. package/dist/cdn/components/eun-dropdown-button.js +1 -1
  36. package/dist/cdn/components/eun-fab.js +6 -6
  37. package/dist/cdn/components/eun-icon.js +1 -1
  38. package/dist/cdn/components/eun-image-card.js +1 -1
  39. package/dist/cdn/components/eun-image-carousel.js +3 -3
  40. package/dist/cdn/components/eun-input-file.js +1 -1
  41. package/dist/cdn/components/eun-input-phone.js +18 -18
  42. package/dist/cdn/components/eun-input.js +1 -1
  43. package/dist/cdn/components/eun-link.js +116 -18
  44. package/dist/cdn/components/eun-modal.js +15 -15
  45. package/dist/cdn/components/eun-radio-card.js +1 -1
  46. package/dist/cdn/components/eun-radio-list.js +1 -1
  47. package/dist/cdn/components/eun-radio.js +1 -1
  48. package/dist/cdn/components/eun-scheduler-event-editor.js +7 -7
  49. package/dist/cdn/components/eun-scheduler-event.js +1 -1
  50. package/dist/cdn/components/eun-scheduler.js +18 -18
  51. package/dist/cdn/components/eun-search.js +15 -15
  52. package/dist/cdn/components/eun-select.js +2 -2
  53. package/dist/cdn/components/eun-slider.js +1 -1
  54. package/dist/cdn/components/eun-sliding-card.js +1 -1
  55. package/dist/cdn/components/eun-switch.js +1 -1
  56. package/dist/cdn/components/eun-tab-group.js +1 -1
  57. package/dist/cdn/components/eun-tab.js +1 -1
  58. package/dist/cdn/components/eun-table-action-bar.js +1 -1
  59. package/dist/cdn/components/eun-table.js +1 -1
  60. package/dist/cdn/components/eun-textarea.js +2 -2
  61. package/dist/cdn/components/eun-time-picker.js +11 -11
  62. package/dist/cdn/components/eun-toggle-group.js +30 -22
  63. package/dist/cdn/components/eun-toggle-item.js +10 -8
  64. package/dist/cdn/components/eun-toggle.js +1 -1
  65. package/dist/cdn/components/eun-toolbar.js +1 -1
  66. package/dist/components/action/button/button.d.ts +44 -17
  67. package/dist/components/action/button/button.js +100 -22
  68. package/dist/components/action/button/button.styles.js +77 -39
  69. package/dist/components/action/dropdown-button/dropdown-button.d.ts +8 -8
  70. package/dist/components/action/dropdown-button/dropdown-button.js +7 -7
  71. package/dist/components/action/fab/fab.d.ts +7 -6
  72. package/dist/components/action/fab/fab.js +11 -8
  73. package/dist/components/action/fab/fab.styles.js +4 -4
  74. package/dist/components/action/link/link.d.ts +65 -6
  75. package/dist/components/action/link/link.js +176 -20
  76. package/dist/components/action/link/link.styles.js +86 -1
  77. package/dist/components/action/shared-styles/button-palette.styles.d.ts +3 -3
  78. package/dist/components/action/shared-styles/button-palette.styles.js +14 -14
  79. package/dist/components/action/toggle/toggle-group.d.ts +15 -5
  80. package/dist/components/action/toggle/toggle-group.js +42 -17
  81. package/dist/components/action/toggle/toggle-group.styles.d.ts +2 -1
  82. package/dist/components/action/toggle/toggle-group.styles.js +15 -7
  83. package/dist/components/action/toggle/toggle-item.d.ts +4 -4
  84. package/dist/components/action/toggle/toggle-item.js +2 -2
  85. package/dist/components/action/toggle/toggle-item.styles.js +8 -6
  86. package/dist/components/alert/drawer/drawer.js +1 -1
  87. package/dist/components/alert/modal/modal.d.ts +8 -8
  88. package/dist/components/alert/modal/modal.js +11 -11
  89. package/dist/components/content/badge/badge.d.ts +6 -6
  90. package/dist/components/content/badge/badge.js +4 -4
  91. package/dist/components/content/badge/badge.styles.js +4 -4
  92. package/dist/components/content/card/card.d.ts +32 -4
  93. package/dist/components/content/card/card.js +64 -4
  94. package/dist/components/content/card/card.styles.js +33 -1
  95. package/dist/components/content/card/image-card.d.ts +2 -1
  96. package/dist/components/content/card/image-card.js +1 -0
  97. package/dist/components/content/card/sliding-card.d.ts +2 -1
  98. package/dist/components/content/card/sliding-card.js +1 -0
  99. package/dist/components/content/collapse/collapse.d.ts +29 -11
  100. package/dist/components/content/collapse/collapse.js +53 -23
  101. package/dist/components/content/collapse/collapse.styles.js +13 -0
  102. package/dist/components/content/icon/icon.d.ts +12 -2
  103. package/dist/components/content/icon/icon.js +52 -22
  104. package/dist/components/content/icon/icon.style.d.ts +2 -0
  105. package/dist/components/content/icon/icon.style.js +4 -1
  106. package/dist/components/content/shared-styles/card-link.styles.js +1 -0
  107. package/dist/components/form/color-picker/color-picker.d.ts +3 -3
  108. package/dist/components/form/color-picker/color-picker.js +4 -4
  109. package/dist/components/form/counter/counter.d.ts +3 -3
  110. package/dist/components/form/counter/counter.js +3 -3
  111. package/dist/components/form/counter/counter.styles.js +5 -5
  112. package/dist/components/form/date-picker/date-picker.d.ts +3 -3
  113. package/dist/components/form/date-picker/date-picker.js +3 -3
  114. package/dist/components/form/date-picker/date-picker.styles.js +5 -5
  115. package/dist/components/form/input/input.d.ts +3 -3
  116. package/dist/components/form/input/input.js +4 -4
  117. package/dist/components/form/input-phone/input-phone.d.ts +3 -3
  118. package/dist/components/form/input-phone/input-phone.js +3 -3
  119. package/dist/components/form/input-phone/input-phone.styles.js +12 -12
  120. package/dist/components/form/search/search.styles.js +3 -3
  121. package/dist/components/form/select/select.d.ts +3 -3
  122. package/dist/components/form/select/select.js +3 -3
  123. package/dist/components/form/shared-styles/field.styles.js +5 -5
  124. package/dist/components/form/textarea/textarea.d.ts +3 -3
  125. package/dist/components/form/textarea/textarea.js +4 -4
  126. package/dist/components/form/time-picker/time-picker.d.ts +3 -3
  127. package/dist/components/form/time-picker/time-picker.js +3 -3
  128. package/dist/components/form/time-picker/time-picker.styles.js +5 -5
  129. package/dist/components/layout/animate/animate.d.ts +8 -0
  130. package/dist/components/layout/animate/animate.js +20 -8
  131. package/dist/features/scheduler/calendar/calendar.d.ts +6 -6
  132. package/dist/features/scheduler/calendar/calendar.js +9 -9
  133. package/dist/features/scheduler/scheduler/scheduler.d.ts +6 -6
  134. package/dist/features/scheduler/scheduler/scheduler.js +13 -13
  135. package/dist/features/scheduler/scheduler-event/scheduler-event.d.ts +10 -8
  136. package/dist/features/scheduler/scheduler-event/scheduler-event.js +7 -7
  137. package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +6 -6
  138. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +5 -5
  139. package/dist/features/scheduler/shared/scheduler-event-popover.js +2 -2
  140. package/dist/features/scheduler/shared/scheduler-hour-grid.d.ts +2 -2
  141. package/dist/features/scheduler/shared/scheduler-hour-grid.js +3 -3
  142. package/dist/features/scheduler/shared/scheduler-month-view.d.ts +3 -3
  143. package/dist/features/scheduler/shared/scheduler-month-view.js +2 -2
  144. package/dist/features/table/table/table.types.d.ts +7 -3
  145. package/dist/features/table/table-action-bar/table-action-bar.js +3 -3
  146. package/dist/features/table/table-managed/table-managed.js +2 -2
  147. package/dist/i18n/en.d.ts +3 -0
  148. package/dist/i18n/en.js +3 -0
  149. package/dist/i18n/fr.js +3 -0
  150. package/dist/index.d.ts +3 -3
  151. package/dist/jsx.d.ts +1 -1
  152. package/dist/mixins/button.mixin.d.ts +10 -9
  153. package/dist/mixins/button.mixin.js +14 -6
  154. package/dist/mixins/card-link.mixin.d.ts +3 -2
  155. package/dist/mixins/card-link.mixin.js +12 -5
  156. package/dist/mixins/disabled.mixin.d.ts +3 -3
  157. package/dist/mixins/disabled.mixin.js +10 -5
  158. package/dist/mixins/field-appearance.mixin.d.ts +19 -0
  159. package/dist/mixins/{field-variant.mixin.js → field-appearance.mixin.js} +11 -11
  160. package/dist/ssr/animate-ssr.css +26 -72
  161. package/dist/ssr/links-ssr.css +35 -0
  162. package/dist/ssr/overlay-ssr.css +0 -41
  163. package/dist/ssr/rich-text.css +38 -0
  164. package/dist/ssr/sidebar-ssr.css +0 -38
  165. package/dist/ssr/toolbar-ssr.css +73 -39
  166. package/dist/types/variant.type.d.ts +26 -10
  167. package/dist/utils/navigation.utils.d.ts +14 -0
  168. package/dist/utils/navigation.utils.js +33 -0
  169. package/dist/utils/new-tab-anchor.controller.d.ts +44 -0
  170. package/dist/utils/new-tab-anchor.controller.js +102 -0
  171. package/dist/utils/severity-icon.utils.d.ts +1 -1
  172. package/dist/utils/severity-icon.utils.js +1 -1
  173. package/dist/utils/theme-generator.utils.d.ts +3 -1
  174. package/dist/utils/theme-generator.utils.js +3 -1
  175. package/package.json +8 -2
  176. package/dist/cdn/components/chunks/chunk-2JLDJFYD.js +0 -48
  177. package/dist/cdn/components/chunks/chunk-ATH2OAMU.js +0 -1
  178. package/dist/cdn/components/chunks/chunk-BKHD4S57.js +0 -1
  179. package/dist/cdn/components/chunks/chunk-T7WABJEJ.js +0 -1
  180. package/dist/cdn/components/chunks/chunk-XSMCT4DF.js +0 -1
  181. package/dist/mixins/field-variant.mixin.d.ts +0 -22
@@ -6,27 +6,27 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { property } from "lit/decorators.js";
8
8
  /**
9
- * A mixin that adds a `variant` property to a text-like form field
10
- * component, controlling its visual style: bordered box (`outline`,
11
- * default), filled background with no border (`fill`), or a bottom-only
12
- * border (`underline`).
9
+ * A mixin that adds an `appearance` property to a text-like form field
10
+ * component, controlling how its surface is drawn: bordered box
11
+ * (`outline`, default), muted background with no border (`flat`), or a
12
+ * bottom-only border (`underline`).
13
13
  *
14
14
  * @param superClass - The base class to extend.
15
- * @returns A new class extending the base with `variant` behavior.
15
+ * @returns A new class extending the base with `appearance` behavior.
16
16
  */
17
- export const FieldVariantMixin = (superClass) => {
18
- class FieldVariantMixinClass extends superClass {
17
+ export const FieldAppearanceMixin = (superClass) => {
18
+ class FieldAppearanceMixinClass extends superClass {
19
19
  constructor() {
20
20
  super(...arguments);
21
21
  /**
22
- * The visual variant to apply to the field.
22
+ * How the field's surface is drawn.
23
23
  * By default, set to "outline".
24
24
  */
25
- this.variant = "outline";
25
+ this.appearance = "outline";
26
26
  }
27
27
  }
28
28
  __decorate([
29
29
  property({ reflect: true })
30
- ], FieldVariantMixinClass.prototype, "variant", void 0);
31
- return FieldVariantMixinClass;
30
+ ], FieldAppearanceMixinClass.prototype, "appearance", void 0);
31
+ return FieldAppearanceMixinClass;
32
32
  };
@@ -1,84 +1,38 @@
1
- /**
2
- * Optional light-DOM stylesheet for `<eun-animate>` in server-rendered
3
- * pages (Next.js, or any framework/setup without Declarative Shadow DOM
4
- * for Lit components). It closes the SSR flash described in the eun-animate
5
- * documentation's Accessibility/SSR notes : server HTML has no Shadow DOM
6
- * yet, so `<eun-animate>`'s own `:host([animation="fade"]) { opacity: 0 }`
7
- * (and the other animation variants) can't apply until the element is
8
- * upgraded client-side, meaning content renders visible first, then snaps
9
- * hidden the instant the custom element registers, then fades back in.
10
- *
11
- * This stylesheet lives in the host document instead, applying the exact
12
- * same starting state through `:not(:defined)`, which is true from first
13
- * paint and stops matching permanently the moment the browser upgrades the
14
- * element — handing off to the component's own Shadow DOM styles at
15
- * exactly the point they take over, with no gap and no double transition.
16
- *
17
- * Usage — link it in the page `<head>`, alongside (not instead of)
18
- * importing "@eunomia/elements/animate.js" :
19
- *
20
- * <link
21
- * rel="stylesheet"
22
- * href="node_modules/@eunomia/elements/dist/ssr/animate-ssr.css"
23
- * />
24
- *
25
- * Requires every server-rendered `<eun-animate>` to write its `animation`
26
- * attribute explicitly (even when it's the "fade" default), since that
27
- * default only ever becomes an attribute once Lit initializes the
28
- * property client-side — invisible to this stylesheet, or any plain CSS,
29
- * before then :
30
- *
31
- * <eun-animate animation="fade">...</eun-animate>
32
- */
33
-
34
1
  eun-animate:not(:defined) {
35
2
  --_distance: var(--animate-distance, 80px);
36
3
  }
37
4
 
38
- eun-animate[animation="fade"]:not(:defined),
39
- eun-animate[animation="faded-scroll-right"]:not(:defined),
40
- eun-animate[animation="faded-scroll-left"]:not(:defined),
41
- eun-animate[animation="faded-scroll-top"]:not(:defined),
42
- eun-animate[animation="faded-scroll-bottom"]:not(:defined) {
43
- opacity: 0;
44
- }
5
+ @media (scripting: enabled) {
6
+ eun-animate[animation="fade"]:not(:defined),
7
+ eun-animate[animation="faded-scroll-right"]:not(:defined),
8
+ eun-animate[animation="faded-scroll-left"]:not(:defined),
9
+ eun-animate[animation="faded-scroll-top"]:not(:defined),
10
+ eun-animate[animation="faded-scroll-bottom"]:not(:defined) {
11
+ opacity: 0;
12
+ }
45
13
 
46
- eun-animate[animation="scroll-right"]:not(:defined),
47
- eun-animate[animation="faded-scroll-right"]:not(:defined) {
48
- transform: translateX(calc(-1 * var(--_distance)));
49
- }
14
+ eun-animate[animation="scroll-right"]:not(:defined),
15
+ eun-animate[animation="faded-scroll-right"]:not(:defined) {
16
+ transform: translateX(calc(-1 * var(--_distance)));
17
+ }
50
18
 
51
- eun-animate[animation="scroll-left"]:not(:defined),
52
- eun-animate[animation="faded-scroll-left"]:not(:defined) {
53
- transform: translateX(var(--_distance));
54
- }
19
+ eun-animate[animation="scroll-left"]:not(:defined),
20
+ eun-animate[animation="faded-scroll-left"]:not(:defined) {
21
+ transform: translateX(var(--_distance));
22
+ }
55
23
 
56
- eun-animate[animation="scroll-top"]:not(:defined),
57
- eun-animate[animation="faded-scroll-top"]:not(:defined) {
58
- transform: translateY(var(--_distance));
59
- }
24
+ eun-animate[animation="scroll-top"]:not(:defined),
25
+ eun-animate[animation="faded-scroll-top"]:not(:defined) {
26
+ transform: translateY(var(--_distance));
27
+ }
60
28
 
61
- eun-animate[animation="scroll-bottom"]:not(:defined),
62
- eun-animate[animation="faded-scroll-bottom"]:not(:defined) {
63
- transform: translateY(calc(-1 * var(--_distance)));
29
+ eun-animate[animation="scroll-bottom"]:not(:defined),
30
+ eun-animate[animation="faded-scroll-bottom"]:not(:defined) {
31
+ transform: translateY(calc(-1 * var(--_distance)));
32
+ }
64
33
  }
65
34
 
66
- /**
67
- * `tablet-animation`/`mobile-animation` overrides, mirroring the rules
68
- * above and the same-named `@media` blocks in the component's own
69
- * `animate.styles.ts` — kept in sync by hand, since this file has to
70
- * duplicate the shadow DOM's styles for the light-DOM pre-hydration
71
- * window regardless. Placed after the unscoped rules above so an
72
- * equal-specificity tie (e.g. both `animation="fade"` and
73
- * `tablet-animation="none"` set at once) resolves in the narrower
74
- * breakpoint's favor, once its `@media` condition is true — same
75
- * source-order reasoning as `animate.styles.ts`.
76
- *
77
- * `max-width` values match `EUNOMIA_BREAKPOINTS.tablet`/`.mobile`
78
- * (`breakpoints.ts`) — hardcoded here since plain CSS can't read a JS
79
- * constant.
80
- */
81
- @media (max-width: 768px) {
35
+ @media (scripting: enabled) and (max-width: 768px) {
82
36
  eun-animate[tablet-animation="none"]:not(:defined) {
83
37
  opacity: 1;
84
38
  transform: none;
@@ -113,7 +67,7 @@ eun-animate[animation="faded-scroll-bottom"]:not(:defined) {
113
67
  }
114
68
  }
115
69
 
116
- @media (max-width: 600px) {
70
+ @media (scripting: enabled) and (max-width: 600px) {
117
71
  eun-animate[mobile-animation="none"]:not(:defined) {
118
72
  opacity: 1;
119
73
  transform: none;
@@ -0,0 +1,35 @@
1
+ :is(eun-link, eun-button, eun-card):not(:defined) > a {
2
+ color: inherit;
3
+ text-decoration: none;
4
+ }
5
+
6
+ .eun-new-tab-hint {
7
+ position: absolute;
8
+ width: 1px;
9
+ height: 1px;
10
+ padding: 0;
11
+ margin: -1px;
12
+ overflow: hidden;
13
+ clip: rect(0 0 0 0);
14
+ white-space: nowrap;
15
+ border: 0;
16
+ }
17
+
18
+ :is(eun-link, eun-button):not(:defined) > a[target="_blank"]::after {
19
+ content: "";
20
+ display: inline-block;
21
+ width: 14px;
22
+ height: 14px;
23
+ margin-inline-start: 4px;
24
+ vertical-align: middle;
25
+ background: currentColor;
26
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 13h11.17l-4.88 4.88c-.39.39-.39 1.03 0 1.42.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41l-6.58-6.6c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L16.17 11H5c-.55 0-1 .45-1 1s.45 1 1 1z'/%3E%3C/svg%3E")
27
+ center / contain no-repeat;
28
+ rotate: -45deg;
29
+ }
30
+
31
+ eun-button:not(:defined) > a[target="_blank"]::after {
32
+ width: 12px;
33
+ height: 12px;
34
+ margin-inline-start: 8px;
35
+ }
@@ -1,44 +1,3 @@
1
- /**
2
- * Optional light-DOM stylesheet for server-rendered pages (Next.js, or
3
- * any framework/setup without Declarative Shadow DOM for Lit
4
- * components), covering every closed-by-default overlay/disclosure
5
- * component in one file : `eun-collapse`, `eun-drawer`, `eun-modal`,
6
- * `eun-dropdown-button`, and `eun-tooltip`. Each hides its own slotted
7
- * content only through its own Shadow DOM (a `grid-template-rows: 0fr`
8
- * panel for collapse, a `popover="manual"`/`popover="auto"` surface for
9
- * the rest), which doesn't exist yet in server-rendered HTML. That
10
- * content renders as plain, unstyled light-DOM children instead, on top
11
- * of everything else on the page, until the element upgrades — the same
12
- * SSR flash `animate-ssr.css`/`toolbar-ssr.css`/`sidebar-ssr.css`
13
- * document for their own components, just for content that's meant to
14
- * stay hidden until something opens it, rather than a starting animation
15
- * state or a persistent, always-visible layout piece.
16
- *
17
- * This stylesheet lives in the host document instead, hiding that exact
18
- * content through `:not(:defined)`, which is true from first paint and
19
- * stops matching permanently the moment the browser upgrades the
20
- * element — handing off to each component's own Shadow DOM at exactly
21
- * the point it takes over, with no gap.
22
- *
23
- * Usage — link it in the page `<head>`, alongside (not instead of)
24
- * importing whichever of these components the page actually uses :
25
- *
26
- * <link
27
- * rel="stylesheet"
28
- * href="node_modules/@eunomia/elements/dist/ssr/overlay-ssr.css"
29
- * />
30
- *
31
- * `eun-drawer`/`eun-modal` are skipped whenever `open` is written
32
- * explicitly in the server-rendered markup, so a dialog meant to be
33
- * visible on first paint (a startup announcement, for instance) still
34
- * renders — see the `open` attribute on the component's own doc page for
35
- * the same requirement `animate-ssr.css` documents for `animation`, and
36
- * `eun-collapse`'s own `open` attribute for the same reasoning there.
37
- * `eun-dropdown-button`'s own trigger label (its default slot) and
38
- * `eun-tooltip`'s own trigger (`slot="anchor"`) are never hidden, only
39
- * their menu/panel content is.
40
- */
41
-
42
1
  eun-collapse:not(:defined):not([open]) > :not([slot]) {
43
2
  display: none;
44
3
  }
@@ -0,0 +1,38 @@
1
+ .eun-rich-text p,
2
+ .eun-rich-text ul {
3
+ margin-block: 1em;
4
+ }
5
+
6
+ .eun-rich-text ul {
7
+ padding-inline-start: 40px;
8
+ list-style: disc;
9
+ }
10
+
11
+ .eun-rich-text li {
12
+ display: list-item;
13
+ }
14
+
15
+ .eun-rich-text :first-child {
16
+ margin-block-start: 0;
17
+ }
18
+
19
+ .eun-rich-text :last-child {
20
+ margin-block-end: 0;
21
+ }
22
+
23
+ .eun-rich-text strong {
24
+ font-weight: bold;
25
+ }
26
+
27
+ .eun-rich-text em {
28
+ font-style: italic;
29
+ }
30
+
31
+ .eun-rich-text u {
32
+ text-decoration: underline;
33
+ }
34
+
35
+ .eun-rich-text a {
36
+ color: var(--rich-text-link-color, var(--eun-color-primary-500, #3d6fff));
37
+ text-decoration: underline;
38
+ }
@@ -1,41 +1,3 @@
1
- /**
2
- * Optional light-DOM stylesheet for `<eun-sidebar>` in server-rendered
3
- * pages (Next.js, or any framework/setup without Declarative Shadow DOM
4
- * for Lit components). Closes the same SSR flash described in
5
- * eun-toolbar's own SSR notes (see `toolbar-ssr.css`), but here it hits
6
- * every instance, not just a mobile-only panel : `display: flex` and the
7
- * sidebar's own width live in eun-sidebar's Shadow DOM, which doesn't
8
- * exist yet in server-rendered HTML. An unregistered custom element
9
- * defaults to `display: inline` with no layout of its own, so a
10
- * server-rendered sidebar renders as a plain run of unstyled inline
11
- * content (header, body, footer flowing one after another) first, then
12
- * snaps into a proper flex column the instant the element upgrades. A
13
- * sidebar meant to start `collapsed` (mini or fully hidden) makes this
14
- * worse : that state lives in the same Shadow DOM too, so it renders at
15
- * full width first, then shrinks down on upgrade instead of the other
16
- * way around.
17
- *
18
- * This stylesheet lives in the host document instead, mirroring
19
- * eun-sidebar's own resting layout through `:not(:defined)`, which is
20
- * true from first paint and stops matching permanently the moment the
21
- * browser upgrades the element — handing off to eun-sidebar's own Shadow
22
- * DOM styles at exactly the point they take over, with no gap.
23
- *
24
- * Usage — link it in the page `<head>`, alongside (not instead of)
25
- * importing "@eunomia/elements/sidebar.js" :
26
- *
27
- * <link
28
- * rel="stylesheet"
29
- * href="node_modules/@eunomia/elements/dist/ssr/sidebar-ssr.css"
30
- * />
31
- *
32
- * `collapsed`/`collapse-mode`/`dragged-hidden` only take effect here when
33
- * written explicitly in the server-rendered markup, same requirement
34
- * `animate-ssr.css` documents for `animation` :
35
- *
36
- * <eun-sidebar collapsed collapse-mode="mini">...</eun-sidebar>
37
- */
38
-
39
1
  eun-sidebar:not(:defined) {
40
2
  display: flex;
41
3
  position: sticky;
@@ -1,41 +1,75 @@
1
- /**
2
- * Optional light-DOM stylesheet for `<eun-toolbar>` in server-rendered
3
- * pages (Next.js, or any framework/setup without Declarative Shadow DOM
4
- * for Lit components). It closes the SSR flash described in the
5
- * eun-toolbar documentation's Server-side rendering notes : the default
6
- * slot (the mobile panel's own content, everything slotted in without a
7
- * `slot` attribute) is only ever hidden by eun-toolbar's own Shadow DOM,
8
- * either tucked inside a closed native popover once the element is
9
- * upgraded and `mobile` is true, or simply never projected anywhere once
10
- * upgraded and it's false. Server-rendered HTML has no Shadow DOM yet,
11
- * so that content renders as plain, unstyled light-DOM children instead —
12
- * visible, unpositioned, and often full-width/height, on top of
13
- * everything else on the page, until the element upgrades.
14
- *
15
- * This stylesheet lives in the host document instead, hiding that exact
16
- * content through `:not(:defined)`, which is true from first paint and
17
- * stops matching permanently the moment the browser upgrades the
18
- * element — handing off to eun-toolbar's own Shadow DOM at exactly the
19
- * point it takes over, with no gap. Safe regardless of viewport : the
20
- * content stays exactly as hidden post-upgrade whether `mobile` ends up
21
- * true (closed popover) or false (never rendered at all), so this never
22
- * has to guess at the breakpoint.
23
- *
24
- * Usage — link it in the page `<head>`, alongside (not instead of)
25
- * importing "@eunomia/elements/toolbar.js" :
26
- *
27
- * <link
28
- * rel="stylesheet"
29
- * href="node_modules/@eunomia/elements/dist/ssr/toolbar-ssr.css"
30
- * />
31
- *
32
- * The `start`/`center`/`end` slots aren't covered here : that content is
33
- * meant to stay visible (and stay part of LCP) before upgrade too, same
34
- * as after, so hiding it isn't this stylesheet's job. Style its own
35
- * pre-upgrade layout, if needed, directly with `eun-toolbar:not(:defined)`
36
- * in the host page's own CSS.
37
- */
38
-
39
- eun-toolbar:not(:defined) > :not([slot]) {
1
+ eun-toolbar:not(:defined) > :not([slot]),
2
+ eun-toolbar:not(:defined) > [slot="skip-links"],
3
+ eun-toolbar:not(:defined) > [slot="menu-icon"],
4
+ eun-toolbar:not(:defined) > [slot="close-icon"] {
40
5
  display: none;
41
6
  }
7
+
8
+ eun-toolbar:not(:defined) {
9
+ box-sizing: border-box;
10
+ display: flex;
11
+ align-items: center;
12
+ gap: var(--toolbar-gap, 16px);
13
+ width: 100%;
14
+ height: var(--toolbar-height, 72px);
15
+ padding: var(--toolbar-padding, 0 24px);
16
+ position: sticky;
17
+ top: 0;
18
+ z-index: var(--toolbar-z-index, 100);
19
+ }
20
+
21
+ eun-toolbar[position="fixed"]:not(:defined) {
22
+ position: fixed;
23
+ inset-inline: 0;
24
+ }
25
+
26
+ eun-toolbar[position="static"]:not(:defined) {
27
+ position: static;
28
+ }
29
+
30
+ eun-toolbar:not(:defined) > [slot="start"] {
31
+ order: 1;
32
+ }
33
+
34
+ eun-toolbar:not(:defined) > [slot="center"] {
35
+ order: 2;
36
+ }
37
+
38
+ eun-toolbar:not(:defined) > [slot="end"] {
39
+ order: 3;
40
+ }
41
+
42
+ eun-toolbar:not(:defined)
43
+ > [slot="center"]:where(:nth-child(1 of [slot="center"])) {
44
+ margin-inline-start: auto;
45
+ }
46
+
47
+ eun-toolbar:not(:defined)
48
+ > [slot="center"]:where(:nth-last-child(1 of [slot="center"])) {
49
+ margin-inline-end: auto;
50
+ }
51
+
52
+ eun-toolbar:not(:defined):where(:not(:has(> [slot="center"])))
53
+ > [slot="end"]:where(:nth-child(1 of [slot="end"])) {
54
+ margin-inline-start: auto;
55
+ }
56
+
57
+ eun-toolbar:not(:defined):where(
58
+ :has(> [slot="start"]):has(> [slot="end"]):not(
59
+ :has(> :nth-child(2 of [slot="start"]), > :nth-child(2 of [slot="end"]))
60
+ )
61
+ )
62
+ > :is([slot="start"], [slot="end"]) {
63
+ flex: 1 1 0;
64
+ }
65
+
66
+ eun-toolbar:not(:defined):where(
67
+ :has(> [slot="start"]):has(> [slot="end"]):not(
68
+ :has(> :nth-child(2 of [slot="start"]), > :nth-child(2 of [slot="end"]))
69
+ )
70
+ )
71
+ > [slot="end"] {
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: flex-end;
75
+ }
@@ -3,7 +3,7 @@
3
3
  * independent of whether that something is an action being taken or a
4
4
  * state being observed. Shared by feedback/display components (alert,
5
5
  * toast, chip, tag, tooltip, progress-bar), and partly borrowed by
6
- * {@link EunomiaActionVariant} : a "critical" button and a "critical" alert
6
+ * {@link EunomiaActionColor} : a "critical" button and a "critical" alert
7
7
  * mean the same thing and must share the same red, or the app ends up with
8
8
  * two unrelated definitions of "critical" depending on whether the thing
9
9
  * wearing the color is clickable.
@@ -12,7 +12,9 @@ export type EunomiaSeverity = "info" | "success" | "warning" | "critical" | "neu
12
12
  /**
13
13
  * Canonical color union for interactive/action components (button, fab,
14
14
  * dropdown-button, toggle-group/-item, badge, modal's confirm/cancel
15
- * buttons). Composed of two genuinely different things sharing one visual
15
+ * buttons), always exposed as `color`, like tag, chip and tooltip's own
16
+ * {@link EunomiaTone} palette. `variant` stays reserved for a shape or
17
+ * style (a field's outline/fill/underline, a loader's dots, ...). Composed of two genuinely different things sharing one visual
16
18
  * slot — an action only ever needs one color, never both at once, so they
17
19
  * live in a single prop rather than two independently-precedenced ones :
18
20
  * - `"primary"` / `"secondary"` : pure emphasis/hierarchy, meaningless
@@ -26,18 +28,18 @@ export type EunomiaSeverity = "info" | "success" | "warning" | "critical" | "neu
26
28
  * three do.
27
29
  *
28
30
  * Most components expose this union as-is ; only a genuine subset (see
29
- * {@link EunomiaModalConfirmVariant}) needs a further narrowing on top of it.
31
+ * {@link EunomiaModalConfirmColor}) needs a further narrowing on top of it.
30
32
  */
31
- export type EunomiaActionVariant = "primary" | "secondary" | Extract<EunomiaSeverity, "critical" | "success" | "warning">;
33
+ export type EunomiaActionColor = "primary" | "secondary" | Extract<EunomiaSeverity, "critical" | "success" | "warning">;
32
34
  /**
33
- * The two-value {@link EunomiaActionVariant} subset `eun-modal`'s
34
- * `confirmVariant` uses — a confirm button is only ever the modal's default
35
+ * The two-value {@link EunomiaActionColor} subset `eun-modal`'s
36
+ * `confirmColor` uses — a confirm button is only ever the modal's default
35
37
  * emphasis or a destructive warning, never `secondary`/`success`/`warning`.
36
38
  */
37
- export type EunomiaModalConfirmVariant = Extract<EunomiaActionVariant, "primary" | "critical">;
39
+ export type EunomiaModalConfirmColor = Extract<EunomiaActionColor, "primary" | "critical">;
38
40
  /**
39
41
  * Canonical surface-treatment union : how a component's background/border is
40
- * rendered, independent of its `variant`/`severity`/`color`. Always named
42
+ * rendered, independent of its `severity`/`color`. Always named
41
43
  * `appearance` on the components that expose it — never `type`, which stays
42
44
  * reserved for a native HTML mechanism (e.g. `eun-button`'s `type="submit"`)
43
45
  * wherever it appears.
@@ -53,8 +55,16 @@ export type EunomiaModalConfirmVariant = Extract<EunomiaActionVariant, "primary"
53
55
  * (elevated, drop shadow) doesn't share that constraint : it's a static
54
56
  * effect, not one gated behind interaction, so `eun-card` also exposes it
55
57
  * (see {@link EunomiaCardAppearance}) despite being a passive container.
58
+ * `underline` (a bottom border only) is a form field's own look, and
59
+ * `transparent` (the pale tint, see-through instead of opaque) a scheduler
60
+ * event chip's : each belongs to a single family, like `ghost`.
61
+ *
62
+ * `appearance` only ever paints the surface (background, border, shadow)
63
+ * and combines with `color`/`severity`. A property changing what is drawn
64
+ * (a loader's dots or bar, a skeleton's shape) is a `variant` instead,
65
+ * with values of its own that mean nothing outside that component.
56
66
  */
57
- export type EunomiaAppearance = "default" | "fill" | "outline" | "flat" | "raised" | "ghost";
67
+ export type EunomiaAppearance = "default" | "fill" | "outline" | "flat" | "raised" | "ghost" | "underline" | "transparent";
58
68
  /**
59
69
  * The four-value {@link EunomiaAppearance} subset feedback/display components
60
70
  * (alert, toast, chip, tag, tooltip) actually use — no `raised`/`ghost`,
@@ -82,9 +92,15 @@ export type EunomiaToggleAppearance = Extract<EunomiaAppearance, "default" | "ou
82
92
  * share `ghost`'s constraint.
83
93
  */
84
94
  export type EunomiaCardAppearance = Extract<EunomiaAppearance, "default" | "fill" | "raised">;
95
+ /**
96
+ * The three-value {@link EunomiaAppearance} subset text-like form fields
97
+ * use : a bordered box (`outline`, their default), a muted background with
98
+ * no border (`flat`), or a bottom border only (`underline`).
99
+ */
100
+ export type EunomiaFieldAppearance = Extract<EunomiaAppearance, "outline" | "flat" | "underline">;
85
101
  /**
86
102
  * Canonical decorative, non-semantic palette : a plain brand/neutral color
87
- * pick with no status meaning, as opposed to {@link EunomiaActionVariant}/
103
+ * pick with no status meaning, as opposed to {@link EunomiaActionColor}/
88
104
  * {@link EunomiaSeverity}. Always named `color` on the components that expose
89
105
  * it.
90
106
  */
@@ -15,3 +15,17 @@
15
15
  * @param target the anchor's target, if any.
16
16
  */
17
17
  export declare function handleLinkNavigation(host: HTMLElement, event: MouseEvent, href: string | undefined, target?: string | null): void;
18
+ /**
19
+ * Warns once when a host in slotted anchor mode (a native `<a>` as a direct
20
+ * child, `href` unset) still carries link attributes of its own. The
21
+ * anchor is the link in that mode, so `aria-label`, `target`, `rel` and
22
+ * `download` left on the host are ignored without any visible sign : a
23
+ * forgotten `aria-label` ends up on an element with no role, and the link
24
+ * loses its accessible name.
25
+ *
26
+ * @param host the link, button or card whose anchor is slotted.
27
+ */
28
+ export declare function warnIgnoredHostLinkAttributes(host: HTMLElement & {
29
+ target?: string;
30
+ download?: string;
31
+ }): void;
@@ -42,3 +42,36 @@ export function handleLinkNavigation(host, event, href, target) {
42
42
  event.preventDefault();
43
43
  }
44
44
  }
45
+ /**
46
+ * Hosts already warned by {@link warnIgnoredHostLinkAttributes}, so each
47
+ * one only logs once however often it updates.
48
+ */
49
+ const warnedHosts = new WeakSet();
50
+ /**
51
+ * Warns once when a host in slotted anchor mode (a native `<a>` as a direct
52
+ * child, `href` unset) still carries link attributes of its own. The
53
+ * anchor is the link in that mode, so `aria-label`, `target`, `rel` and
54
+ * `download` left on the host are ignored without any visible sign : a
55
+ * forgotten `aria-label` ends up on an element with no role, and the link
56
+ * loses its accessible name.
57
+ *
58
+ * @param host the link, button or card whose anchor is slotted.
59
+ */
60
+ export function warnIgnoredHostLinkAttributes(host) {
61
+ if (warnedHosts.has(host)) {
62
+ return;
63
+ }
64
+ const ignored = ['aria-label', 'target', 'rel', 'download'].filter((name) => host.hasAttribute(name));
65
+ if (!ignored.includes('target') && host.target && host.target !== '_self') {
66
+ ignored.push('target');
67
+ }
68
+ if (!ignored.includes('download') && host.download) {
69
+ ignored.push('download');
70
+ }
71
+ if (!ignored.length) {
72
+ return;
73
+ }
74
+ warnedHosts.add(host);
75
+ console.warn(`<${host.localName}>: ${ignored.join(', ')} ignored on the host, since ` +
76
+ 'the slotted <a> is the link. Move them onto the <a> itself.', host);
77
+ }
@@ -0,0 +1,44 @@
1
+ import { ReactiveController, ReactiveControllerHost } from "lit";
2
+ /**
3
+ * Class of a visually-hidden "opens in a new tab" text the consumer writes
4
+ * inside the slotted anchor, hidden by `links-ssr.css`. It's part of the
5
+ * anchor's accessible name and of the server-rendered HTML, so it's
6
+ * announced everywhere, links lists and no-JS pages included, and the
7
+ * controller then leaves the anchor's `aria-description` alone.
8
+ */
9
+ export declare const NEW_TAB_HINT_CLASS = "eun-new-tab-hint";
10
+ /**
11
+ * Announces a slotted anchor opening in a new tab, for a link, button or
12
+ * card whose native `<a>` is slotted as a direct child. The anchor belongs
13
+ * to the consumer (and to their framework, which would undo or trip over an
14
+ * injected child during hydration), so the hint goes on its
15
+ * `aria-description` rather than into its content, leaving its text and
16
+ * `aria-label` untouched. A description the consumer set themselves is
17
+ * never overwritten, and only the one this controller wrote is ever removed.
18
+ * A description only reaches some assistive technology, so an anchor
19
+ * holding a {@link NEW_TAB_HINT_CLASS} text of its own gets none.
20
+ *
21
+ * The anchor's `target` and content can change after the first render (a
22
+ * framework re-render), which no `slotchange` reports, so they're observed
23
+ * directly and re-render the host, whose visible new-tab icon keys off
24
+ * {@link isBlank}.
25
+ */
26
+ export declare class NewTabAnchorController implements ReactiveController {
27
+ #private;
28
+ private readonly host;
29
+ private readonly getAnchor;
30
+ private readonly getHint;
31
+ /**
32
+ * @param host the link, button or card.
33
+ * @param getAnchor returns the slotted anchor, or null outside that mode.
34
+ * @param getHint returns the localized "opens in a new tab" wording.
35
+ */
36
+ constructor(host: ReactiveControllerHost & HTMLElement, getAnchor: () => HTMLAnchorElement | null, getHint: () => string);
37
+ /**
38
+ * Whether the slotted anchor, if any, opens in a new tab.
39
+ */
40
+ get isBlank(): boolean;
41
+ hostConnected(): void;
42
+ hostDisconnected(): void;
43
+ hostUpdated(): void;
44
+ }