@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
@@ -0,0 +1,102 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
+ if (kind === "m") throw new TypeError("Private method is not writable");
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
+ };
12
+ var _NewTabAnchorController_instances, _NewTabAnchorController_described, _NewTabAnchorController_observer, _NewTabAnchorController_clear;
13
+ /**
14
+ * Class of a visually-hidden "opens in a new tab" text the consumer writes
15
+ * inside the slotted anchor, hidden by `links-ssr.css`. It's part of the
16
+ * anchor's accessible name and of the server-rendered HTML, so it's
17
+ * announced everywhere, links lists and no-JS pages included, and the
18
+ * controller then leaves the anchor's `aria-description` alone.
19
+ */
20
+ export const NEW_TAB_HINT_CLASS = "eun-new-tab-hint";
21
+ /**
22
+ * Announces a slotted anchor opening in a new tab, for a link, button or
23
+ * card whose native `<a>` is slotted as a direct child. The anchor belongs
24
+ * to the consumer (and to their framework, which would undo or trip over an
25
+ * injected child during hydration), so the hint goes on its
26
+ * `aria-description` rather than into its content, leaving its text and
27
+ * `aria-label` untouched. A description the consumer set themselves is
28
+ * never overwritten, and only the one this controller wrote is ever removed.
29
+ * A description only reaches some assistive technology, so an anchor
30
+ * holding a {@link NEW_TAB_HINT_CLASS} text of its own gets none.
31
+ *
32
+ * The anchor's `target` and content can change after the first render (a
33
+ * framework re-render), which no `slotchange` reports, so they're observed
34
+ * directly and re-render the host, whose visible new-tab icon keys off
35
+ * {@link isBlank}.
36
+ */
37
+ export class NewTabAnchorController {
38
+ /**
39
+ * @param host the link, button or card.
40
+ * @param getAnchor returns the slotted anchor, or null outside that mode.
41
+ * @param getHint returns the localized "opens in a new tab" wording.
42
+ */
43
+ constructor(host, getAnchor, getHint) {
44
+ _NewTabAnchorController_instances.add(this);
45
+ this.host = host;
46
+ this.getAnchor = getAnchor;
47
+ this.getHint = getHint;
48
+ /**
49
+ * The anchor this controller last wrote `aria-description` on, so it can
50
+ * clear it once the anchor stops opening in a new tab or is swapped out.
51
+ */
52
+ _NewTabAnchorController_described.set(this, void 0);
53
+ _NewTabAnchorController_observer.set(this, new MutationObserver((records) => {
54
+ const anchor = this.getAnchor();
55
+ if (anchor && records.some((record) => anchor.contains(record.target))) {
56
+ this.host.requestUpdate();
57
+ }
58
+ }));
59
+ host.addController(this);
60
+ }
61
+ /**
62
+ * Whether the slotted anchor, if any, opens in a new tab.
63
+ */
64
+ get isBlank() {
65
+ return this.getAnchor()?.target === "_blank";
66
+ }
67
+ hostConnected() {
68
+ __classPrivateFieldGet(this, _NewTabAnchorController_observer, "f").observe(this.host, {
69
+ subtree: true,
70
+ childList: true,
71
+ attributeFilter: ["target"],
72
+ });
73
+ }
74
+ hostDisconnected() {
75
+ __classPrivateFieldGet(this, _NewTabAnchorController_observer, "f").disconnect();
76
+ }
77
+ hostUpdated() {
78
+ const anchor = this.getAnchor();
79
+ if (__classPrivateFieldGet(this, _NewTabAnchorController_described, "f") && __classPrivateFieldGet(this, _NewTabAnchorController_described, "f") !== anchor) {
80
+ __classPrivateFieldGet(this, _NewTabAnchorController_instances, "m", _NewTabAnchorController_clear).call(this);
81
+ }
82
+ if (!anchor) {
83
+ return;
84
+ }
85
+ const ownHint = !!anchor.querySelector(`.${NEW_TAB_HINT_CLASS}`);
86
+ if (!this.isBlank || ownHint) {
87
+ if (__classPrivateFieldGet(this, _NewTabAnchorController_described, "f") === anchor) {
88
+ __classPrivateFieldGet(this, _NewTabAnchorController_instances, "m", _NewTabAnchorController_clear).call(this);
89
+ }
90
+ return;
91
+ }
92
+ if (__classPrivateFieldGet(this, _NewTabAnchorController_described, "f") !== anchor && anchor.hasAttribute("aria-description")) {
93
+ return;
94
+ }
95
+ anchor.setAttribute("aria-description", this.getHint());
96
+ __classPrivateFieldSet(this, _NewTabAnchorController_described, anchor, "f");
97
+ }
98
+ }
99
+ _NewTabAnchorController_described = new WeakMap(), _NewTabAnchorController_observer = new WeakMap(), _NewTabAnchorController_instances = new WeakSet(), _NewTabAnchorController_clear = function _NewTabAnchorController_clear() {
100
+ __classPrivateFieldGet(this, _NewTabAnchorController_described, "f")?.removeAttribute("aria-description");
101
+ __classPrivateFieldSet(this, _NewTabAnchorController_described, undefined, "f");
102
+ };
@@ -21,7 +21,7 @@ export declare const SEVERITY_ICONS: {
21
21
  * difference in what `severity` means on each family of component :
22
22
  * - `"icon"` (the default) — action components (`eun-button`,
23
23
  * `eun-dropdown-button`) and `eun-chip`, where `severity` only ever
24
- * drives the icon, never the color (color stays on `variant`/`color`) ;
24
+ * drives the icon, never the color (color stays on `color`) ;
25
25
  * an explicit `icon` naming something more specific than the generic
26
26
  * severity glyph should still win.
27
27
  * - `"severity"` — `eun-alert`/`eun-toast`/`eun-tag`, where `severity`
@@ -23,7 +23,7 @@ export const SEVERITY_ICONS = {
23
23
  * difference in what `severity` means on each family of component :
24
24
  * - `"icon"` (the default) — action components (`eun-button`,
25
25
  * `eun-dropdown-button`) and `eun-chip`, where `severity` only ever
26
- * drives the icon, never the color (color stays on `variant`/`color`) ;
26
+ * drives the icon, never the color (color stays on `color`) ;
27
27
  * an explicit `icon` naming something more specific than the generic
28
28
  * severity glyph should still win.
29
29
  * - `"severity"` — `eun-alert`/`eun-toast`/`eun-tag`, where `severity`
@@ -7,7 +7,9 @@
7
7
  *
8
8
  * Only `buildPalette`, `buildTints`, `initializeTheme`, and
9
9
  * `buildThemeCss` (plus the types their signatures need) are exported
10
- * from `index.ts`. Everything
10
+ * from `index.ts`, and this file is also published as-is as the
11
+ * `./theme.js` subpath. It must stay free of imports and side effects for
12
+ * that subpath to remain safe on a server. Everything
11
13
  * else below, the raw color math, the shade/tint step definitions, is
12
14
  * kept file-private on purpose: none of it is meant to be reached on its
13
15
  * own, it exists to be composed by those four, and every extra export
@@ -7,7 +7,9 @@
7
7
  *
8
8
  * Only `buildPalette`, `buildTints`, `initializeTheme`, and
9
9
  * `buildThemeCss` (plus the types their signatures need) are exported
10
- * from `index.ts`. Everything
10
+ * from `index.ts`, and this file is also published as-is as the
11
+ * `./theme.js` subpath. It must stay free of imports and side effects for
12
+ * that subpath to remain safe on a server. Everything
11
13
  * else below, the raw color math, the shade/tint step definitions, is
12
14
  * kept file-private on purpose: none of it is meant to be reached on its
13
15
  * own, it exists to be composed by those four, and every extra export
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eunomia/elements",
3
- "version": "1.0.0-beta.4",
4
- "description": "Eunomia — a framework-agnostic web component design system",
3
+ "version": "1.0.0-beta.5",
4
+ "description": "Eunomia the framework-agnostic web component design system",
5
5
  "type": "module",
6
6
  "homepage": "https://eunomia-ds.vercel.app",
7
7
  "license": "SEE LICENSE IN LICENSE",
@@ -297,6 +297,10 @@
297
297
  "types": "./dist/utils/rich-text.utils.d.ts",
298
298
  "default": "./dist/utils/rich-text.utils.js"
299
299
  },
300
+ "./theme.js": {
301
+ "types": "./dist/utils/theme-generator.utils.d.ts",
302
+ "default": "./dist/utils/theme-generator.utils.js"
303
+ },
300
304
  "./jsx": {
301
305
  "types": "./dist/jsx.d.ts",
302
306
  "default": "./dist/jsx.js"
@@ -307,6 +311,8 @@
307
311
  "./toolbar-ssr.css": "./dist/ssr/toolbar-ssr.css",
308
312
  "./sidebar-ssr.css": "./dist/ssr/sidebar-ssr.css",
309
313
  "./overlay-ssr.css": "./dist/ssr/overlay-ssr.css",
314
+ "./links-ssr.css": "./dist/ssr/links-ssr.css",
315
+ "./rich-text.css": "./dist/ssr/rich-text.css",
310
316
  "./native-table.css": "./dist/features/table/native-table.css"
311
317
  },
312
318
  "files": [
@@ -1,48 +0,0 @@
1
- import{a as k,b as f,c as _}from"./chunk-SGM2X2TC.js";import{a as c,b as v,c as y,d as x,f as T,g as E,h,i as I,n as b,o as w,p as d,s as S}from"./chunk-XH6NREVZ.js";var o=class extends _{constructor(r){if(super(r),this.it=d,r.type!==k.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===d||r==null)return this._t=void 0,this.it=r;if(r===w)return r;if(typeof r!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this._t;this.it=r;let e=[r];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};o.directiveName="unsafeHTML",o.resultType=1;var H=f(o);var l=class extends o{};l.directiveName="unsafeSVG",l.resultType=2;var $=f(l);var N=E`
2
- :host {
3
- display: flex;
4
- --_size: var(--icon-size, 1rem);
5
- --_color: var(--icon-color, currentColor);
6
- --_background: var(--icon-background, transparent);
7
- }
8
- span {
9
- box-sizing: content-box;
10
- width: var(--_size);
11
- height: var(--_size);
12
- padding: var(--icon-padding, 0);
13
- fill: var(--_color);
14
- color: var(--_color);
15
- background-color: var(--_background);
16
- border-radius: var(--icon-border-radius, var(--eun-border-radius-m, 8px));
17
- text-decoration: none;
18
- display: inline-block;
19
- user-select: none;
20
- transition: 0.2s;
21
- }
22
- svg {
23
- width: 100%;
24
- height: 100%;
25
- display: block;
26
- }
27
- svg path {
28
- stroke-width: 0;
29
- }
30
-
31
- @media (prefers-reduced-motion: reduce) {
32
- span {
33
- transition: none;
34
- }
35
- }
36
- `;var U="eun-icon",M=new RegExp("_(outline|round|sharp)$"),C=import.meta.url,m,g=new Set;function q(a){m=a.endsWith("/")?a.slice(0,-1):a,g.forEach(r=>r.reload())}var p,i=class extends S{constructor(){super(...arguments);y(this,p)}set size(e){x(this,p,e);let t;e?/%$/.test(e)?t=`${parseFloat(e)/100}rem`:/^\d+(\.\d+)?$/.test(e)?t=`${e}px`:t=e:t="1rem",this.style.setProperty("--_size",t)}get size(){return v(this,p)}connectedCallback(){super.connectedCallback(),g.add(this)}disconnectedCallback(){super.disconnectedCallback(),g.delete(this)}reload(){this.updateSvg(this.name)}updated(e){(e.has("name")||e.has("shape"))&&this.updateSvg(this.name)}updateSvg(e){if(!e)return;this.name=e;let t=this.getTargetIconFolder(e),s=this.stripShapeSuffix(e),u=t==="default"?s:`${s}_${t}`;this.fetchIconSvg(t,u).then(n=>{this.svgMarkup=n}).catch(()=>{t!=="default"&&this.fetchIconSvg("default",s).then(n=>{this.svgMarkup=n}).catch(()=>{})})}async fetchIconSvg(e,t){let s;if(m)s=`${m}/${e}/${t}.svg`;else{let n=new URL(C);if(n.protocol==="file:")throw new Error("eun-icon can't locate its icons: the bundler rewrote import.meta.url to a file: URL. Serve the icons folder and call setIconBaseUrl().");let L=n.pathname.slice(0,n.pathname.lastIndexOf("/"));n.pathname=`${L}/icons/${e}/${t}.svg`,s=n.href}let u=await fetch(s);if(!u.ok)throw new Error(`Icon not found: ${s}`);return u.text()}getTargetIconFolder(e){if(this.shape)return this.shape;let t=this.extractKeywordFromIconName(e);return t||"default"}extractKeywordFromIconName(e){let t=e.match(M);if(t)return t[1]}stripShapeSuffix(e){return e.replace(M,"")}render(){return this.name?b`<span part="wrapper" aria-hidden="true">
37
- ${this.svgMarkup?$(this.svgMarkup):d}
38
- </span>`:d}};p=new WeakMap,i.styles=[N],c([h()],i.prototype,"name",2),c([h()],i.prototype,"shape",2),c([I()],i.prototype,"svgMarkup",2),c([h({hasChanged:()=>!1})],i.prototype,"size",1),i=c([T(U)],i);export{U as a,q as b,i as c};
39
- /*! Bundled license information:
40
-
41
- lit-html/directives/unsafe-html.js:
42
- lit-html/directives/unsafe-svg.js:
43
- (**
44
- * @license
45
- * Copyright 2017 Google LLC
46
- * SPDX-License-Identifier: BSD-3-Clause
47
- *)
48
- */
@@ -1 +0,0 @@
1
- import{a,h as i}from"./chunk-XH6NREVZ.js";var o={datePicker:{previousMonth:"Previous month",chooseMonthYear:"Choose month and year",nextMonth:"Next month",previousYear:"Previous year",chooseYear:"Choose year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",time:"Time",amPm:"AM/PM",hour:"Hour",minute:"Minute",heading:{day:{single:"Select a date",range:"Select a date range"},month:{single:"Select a month",range:"Select a month range"},year:{single:"Select a year",range:"Select a year range"}},modalPreview:{day:{single:"Select date",range:"Select date range"},month:{single:"Select month",range:"Select month range"},year:{single:"Select year",range:"Select year range"}}},timePicker:{amPm:"AM/PM",hour:"Hour",minute:"Minute",time:"Time",selectATime:"Select a time",mustBeAtOrAfter:e=>`Time must be at or after ${e}`,mustBeAtOrBefore:e=>`Time must be at or before ${e}`},scheduler:{calendarView:"Calendar view"},carousel:{ofTotal:(e,r)=>`${e} of ${r}`,slideNavigation:"Slide navigation",goToSlide:(e,r)=>`Go to slide ${e} of ${r}`},imageCarousel:{selectImage:"Select image",showImage:(e,r)=>`Show image ${e} of ${r}`,imageNavigation:"Image navigation",goToImage:(e,r)=>`Go to image ${e} of ${r}`,allImages:"All images"},chip:{remove:"Remove"}};var s={datePicker:{previousMonth:"Mois pr\xE9c\xE9dent",chooseMonthYear:"Choisir le mois et l'ann\xE9e",nextMonth:"Mois suivant",previousYear:"Ann\xE9e pr\xE9c\xE9dente",chooseYear:"Choisir l'ann\xE9e",nextYear:"Ann\xE9e suivante",previousYears:"Ann\xE9es pr\xE9c\xE9dentes",nextYears:"Ann\xE9es suivantes",time:"Heure",amPm:"AM/PM",hour:"Heure",minute:"Minute",heading:{day:{single:"S\xE9lectionner une date",range:"S\xE9lectionner une plage de dates"},month:{single:"S\xE9lectionner un mois",range:"S\xE9lectionner une plage de mois"},year:{single:"S\xE9lectionner une ann\xE9e",range:"S\xE9lectionner une plage d'ann\xE9es"}},modalPreview:{day:{single:"S\xE9lectionner une date",range:"S\xE9lectionner une plage de dates"},month:{single:"S\xE9lectionner un mois",range:"S\xE9lectionner une plage de mois"},year:{single:"S\xE9lectionner une ann\xE9e",range:"S\xE9lectionner une plage d'ann\xE9es"}}},timePicker:{amPm:"AM/PM",hour:"Heure",minute:"Minute",time:"Heure",selectATime:"S\xE9lectionner une heure",mustBeAtOrAfter:e=>`L'heure doit \xEAtre \xE0 ${e} ou apr\xE8s`,mustBeAtOrBefore:e=>`L'heure doit \xEAtre \xE0 ${e} ou avant`},scheduler:{calendarView:"Vue du calendrier"},carousel:{ofTotal:(e,r)=>`${e} sur ${r}`,slideNavigation:"Navigation des diapositives",goToSlide:(e,r)=>`Aller \xE0 la diapositive ${e} sur ${r}`},imageCarousel:{selectImage:"S\xE9lectionner une image",showImage:(e,r)=>`Afficher l'image ${e} sur ${r}`,imageNavigation:"Navigation des images",goToImage:(e,r)=>`Aller \xE0 l'image ${e} sur ${r}`,allImages:"Toutes les images"},chip:{remove:"Retirer"}};var m="en";function n(){return m}var t={en:o,fr:s};var P=e=>{class r extends e{get dictionary(){let l=this.locale??n();return t[l]??t.en}}return a([i({reflect:!0})],r.prototype,"locale",2),r};export{P as a};
@@ -1 +0,0 @@
1
- var n=class e extends Event{static{this.eventName="eunnavigate"}constructor(t){super(e.eventName,{bubbles:!0,composed:!0,cancelable:!0}),this.href=t}};function l(e){return e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey}function u(e,t,a,i){if(!a||i&&i!=="_self"||!l(t))return;let r=new n(a);e.dispatchEvent(r),r.defaultPrevented&&t.preventDefault()}export{u as a};
@@ -1 +0,0 @@
1
- import{a as r,h as i}from"./chunk-XH6NREVZ.js";var l=s=>{class e extends s{constructor(){super(...arguments);this.disabled=!1}updated(t){super.updated(t),t.has("disabled")&&(this.setAttribute("tabindex",this.disabled?"-1":"0"),this.setAttribute("aria-disabled",String(this.disabled)))}}return r([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),e};export{l as a};
@@ -1 +0,0 @@
1
- import{a as e,h as r}from"./chunk-XH6NREVZ.js";var l=i=>{class t extends i{constructor(){super(...arguments);this.variant="outline"}}return e([r({reflect:!0})],t.prototype,"variant",2),t};export{l as a};
@@ -1,22 +0,0 @@
1
- import { LitElement } from "lit";
2
- import { Constructor } from "../utils/constructor.type.js";
3
- /**
4
- * All available visual variants for a text-like form field.
5
- */
6
- export type FieldVariant = "outline" | "fill" | "underline";
7
- /**
8
- * Interface defining the contract for components using FieldVariantMixin.
9
- */
10
- export declare class FieldVariantMixinInterface {
11
- variant?: FieldVariant;
12
- }
13
- /**
14
- * A mixin that adds a `variant` property to a text-like form field
15
- * component, controlling its visual style: bordered box (`outline`,
16
- * default), filled background with no border (`fill`), or a bottom-only
17
- * border (`underline`).
18
- *
19
- * @param superClass - The base class to extend.
20
- * @returns A new class extending the base with `variant` behavior.
21
- */
22
- export declare const FieldVariantMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<FieldVariantMixinInterface> & T;