@mattilsynet/design 3.3.10 → 3.4.1

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 (191) hide show
  1. package/mtds/_virtual/_rolldown/runtime.js +17 -0
  2. package/mtds/ai/card.stories.tsx +54 -77
  3. package/mtds/ai/layout.mdx +37 -1
  4. package/mtds/ai/layout.stories.tsx +126 -1
  5. package/mtds/ai/print.mdx +1 -1
  6. package/mtds/ai/print.stories.tsx +1 -2
  7. package/mtds/alert/alert.js +16 -11
  8. package/mtds/alert/alert.js.map +1 -1
  9. package/mtds/analytics/analytics.js +118 -118
  10. package/mtds/analytics/analytics.js.map +1 -1
  11. package/mtds/app/app-observer.js +31 -36
  12. package/mtds/app/app-observer.js.map +1 -1
  13. package/mtds/app/app-toggle.js +12 -26
  14. package/mtds/app/app-toggle.js.map +1 -1
  15. package/mtds/app/app-toggle2.js +6 -11
  16. package/mtds/app/app-toggle2.js.map +1 -1
  17. package/mtds/app/app.js +66 -60
  18. package/mtds/app/app.js.map +1 -1
  19. package/mtds/atlas/atlas-element.js +83 -93
  20. package/mtds/atlas/atlas-element.js.map +1 -1
  21. package/mtds/atlas/atlas-marker.js +63 -52
  22. package/mtds/atlas/atlas-marker.js.map +1 -1
  23. package/mtds/atlas/atlas-matgeo.js +67 -61
  24. package/mtds/atlas/atlas-matgeo.js.map +1 -1
  25. package/mtds/atlas/atlas-wms.js +33 -28
  26. package/mtds/atlas/atlas-wms.js.map +1 -1
  27. package/mtds/atlas/atlas.js +6 -38
  28. package/mtds/atlas/atlas.js.map +1 -1
  29. package/mtds/atlas/atlas2.js +39 -0
  30. package/mtds/atlas/atlas2.js.map +1 -0
  31. package/mtds/atlas/cluster.js +759 -1149
  32. package/mtds/atlas/cluster.js.map +1 -1
  33. package/mtds/atlas.iife.js +3 -4
  34. package/mtds/atlas.js +6 -14
  35. package/mtds/avatar/avatar.js +14 -10
  36. package/mtds/avatar/avatar.js.map +1 -1
  37. package/mtds/badge/badge.js +15 -10
  38. package/mtds/badge/badge.js.map +1 -1
  39. package/mtds/breadcrumbs/breadcrumbs.js +15 -19
  40. package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
  41. package/mtds/button/button.js +18 -20
  42. package/mtds/button/button.js.map +1 -1
  43. package/mtds/card/card.js +22 -15
  44. package/mtds/card/card.js.map +1 -1
  45. package/mtds/chart/chart-axis.js +33 -21
  46. package/mtds/chart/chart-axis.js.map +1 -1
  47. package/mtds/chart/chart-bars.js +23 -21
  48. package/mtds/chart/chart-bars.js.map +1 -1
  49. package/mtds/chart/chart-element.js +94 -88
  50. package/mtds/chart/chart-element.js.map +1 -1
  51. package/mtds/chart/chart-lines.js +35 -37
  52. package/mtds/chart/chart-lines.js.map +1 -1
  53. package/mtds/chart/chart-pies.js +17 -17
  54. package/mtds/chart/chart-pies.js.map +1 -1
  55. package/mtds/chart/chart.js +6 -52
  56. package/mtds/chart/chart.js.map +1 -1
  57. package/mtds/chart/chart2.js +21 -0
  58. package/mtds/chart/chart2.js.map +1 -0
  59. package/mtds/chip/chip.js +15 -11
  60. package/mtds/chip/chip.js.map +1 -1
  61. package/mtds/deprecations.js +76 -158
  62. package/mtds/deprecations.js.map +1 -1
  63. package/mtds/details/details.js +21 -24
  64. package/mtds/details/details.js.map +1 -1
  65. package/mtds/dialog/dialog.js +17 -21
  66. package/mtds/dialog/dialog.js.map +1 -1
  67. package/mtds/divider/divider.js +15 -20
  68. package/mtds/divider/divider.js.map +1 -1
  69. package/mtds/errorsummary/errorsummary.js +14 -16
  70. package/mtds/errorsummary/errorsummary.js.map +1 -1
  71. package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js +22 -25
  72. package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
  73. package/mtds/external/@turf/helpers/dist/esm/index.js +21 -24
  74. package/mtds/external/@turf/helpers/dist/esm/index.js.map +1 -1
  75. package/mtds/external/@turf/invariant/dist/esm/index.js +15 -19
  76. package/mtds/external/@turf/invariant/dist/esm/index.js.map +1 -1
  77. package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +270 -297
  78. package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +1 -1
  79. package/mtds/external/@u-elements/u-details/dist/u-details.js +75 -101
  80. package/mtds/external/@u-elements/u-details/dist/u-details.js.map +1 -1
  81. package/mtds/external/leaflet/dist/leaflet-src.js +4257 -6151
  82. package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -1
  83. package/mtds/external/leaflet/dist/leaflet.css.js +5 -606
  84. package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -1
  85. package/mtds/external/point-in-polygon-hao/dist/esm/index.js +24 -25
  86. package/mtds/external/point-in-polygon-hao/dist/esm/index.js.map +1 -1
  87. package/mtds/external/robust-predicates/esm/incircle.js +5 -0
  88. package/mtds/external/robust-predicates/esm/incircle.js.map +1 -0
  89. package/mtds/external/robust-predicates/esm/insphere.js +5 -0
  90. package/mtds/external/robust-predicates/esm/insphere.js.map +1 -0
  91. package/mtds/external/robust-predicates/esm/orient2d.js +20 -22
  92. package/mtds/external/robust-predicates/esm/orient2d.js.map +1 -1
  93. package/mtds/external/robust-predicates/esm/orient3d.js +5 -0
  94. package/mtds/external/robust-predicates/esm/orient3d.js.map +1 -0
  95. package/mtds/external/robust-predicates/esm/util.js +20 -28
  96. package/mtds/external/robust-predicates/esm/util.js.map +1 -1
  97. package/mtds/external/robust-predicates/index.js +5 -0
  98. package/mtds/field/field.js +167 -214
  99. package/mtds/field/field.js.map +1 -1
  100. package/mtds/fieldset/fieldset.js +32 -30
  101. package/mtds/fieldset/fieldset.js.map +1 -1
  102. package/mtds/fileupload/fileupload.js +16 -13
  103. package/mtds/fileupload/fileupload.js.map +1 -1
  104. package/mtds/helptext/helptext.js +25 -27
  105. package/mtds/helptext/helptext.js.map +1 -1
  106. package/mtds/identitet/illustrasjons-generator/illustrasjons-generator.d.ts +1 -0
  107. package/mtds/identitet/illustrasjons-generator/index-old-1.d.ts +1 -0
  108. package/mtds/identitet/infografikk-generator/infografikk-generator.d.ts +1 -0
  109. package/mtds/index.iife.js +21 -21
  110. package/mtds/index.js +38 -31
  111. package/mtds/index.js.map +1 -1
  112. package/mtds/input/input.js +33 -47
  113. package/mtds/input/input.js.map +1 -1
  114. package/mtds/law/law-helper.js +106 -95
  115. package/mtds/law/law-helper.js.map +1 -1
  116. package/mtds/law/law.js +15 -10
  117. package/mtds/law/law.js.map +1 -1
  118. package/mtds/layout/layout.js +21 -13
  119. package/mtds/layout/layout.js.map +1 -1
  120. package/mtds/layout/layout.stories.d.ts +1 -0
  121. package/mtds/link/link.js +15 -10
  122. package/mtds/link/link.js.map +1 -1
  123. package/mtds/logo/logo-observer.js +18 -18
  124. package/mtds/logo/logo-observer.js.map +1 -1
  125. package/mtds/logo/logo.js +18 -18
  126. package/mtds/logo/logo.js.map +1 -1
  127. package/mtds/package.js +6 -0
  128. package/mtds/package.js.map +1 -0
  129. package/mtds/package.json.d.ts +112 -0
  130. package/mtds/pagination/pagination.js +46 -60
  131. package/mtds/pagination/pagination.js.map +1 -1
  132. package/mtds/popover/popover-observer.js +15 -15
  133. package/mtds/popover/popover-observer.js.map +1 -1
  134. package/mtds/popover/popover.js +18 -20
  135. package/mtds/popover/popover.js.map +1 -1
  136. package/mtds/print/print.js +15 -10
  137. package/mtds/print/print.js.map +1 -1
  138. package/mtds/print/print.stories.d.ts +0 -1
  139. package/mtds/profilering/epost.d.ts +1 -0
  140. package/mtds/progress/progress.js +15 -13
  141. package/mtds/progress/progress.js.map +1 -1
  142. package/mtds/react-atlas.js +7 -16
  143. package/mtds/react.js +36 -84
  144. package/mtds/skeleton/skeleton.js +15 -11
  145. package/mtds/skeleton/skeleton.js.map +1 -1
  146. package/mtds/spinner/spinner.js +16 -13
  147. package/mtds/spinner/spinner.js.map +1 -1
  148. package/mtds/steps/steps.js +15 -10
  149. package/mtds/steps/steps.js.map +1 -1
  150. package/mtds/styles.css +2 -1
  151. package/mtds/styles.module.js +122 -0
  152. package/mtds/styles.module.js.map +1 -0
  153. package/mtds/table/table-observer.js +23 -28
  154. package/mtds/table/table-observer.js.map +1 -1
  155. package/mtds/table/table.js +88 -60
  156. package/mtds/table/table.js.map +1 -1
  157. package/mtds/tabs/tabs.js +32 -27
  158. package/mtds/tabs/tabs.js.map +1 -1
  159. package/mtds/tag/tag.js +16 -19
  160. package/mtds/tag/tag.js.map +1 -1
  161. package/mtds/tailwind.css +0 -4
  162. package/mtds/toast/toast-helper.js +45 -25
  163. package/mtds/toast/toast-helper.js.map +1 -1
  164. package/mtds/toast/toast-observer.js +18 -18
  165. package/mtds/toast/toast-observer.js.map +1 -1
  166. package/mtds/toast/toast.js +67 -54
  167. package/mtds/toast/toast.js.map +1 -1
  168. package/mtds/togglegroup/togglegroup.js +31 -40
  169. package/mtds/togglegroup/togglegroup.js.map +1 -1
  170. package/mtds/tooltip/tooltip-element.js +12 -25
  171. package/mtds/tooltip/tooltip-element.js.map +1 -1
  172. package/mtds/typography/typography.js +38 -21
  173. package/mtds/typography/typography.js.map +1 -1
  174. package/mtds/utils.js +53 -70
  175. package/mtds/utils.js.map +1 -1
  176. package/mtds/validation/validation-observer.js +40 -47
  177. package/mtds/validation/validation-observer.js.map +1 -1
  178. package/mtds/validation/validation.js +17 -21
  179. package/mtds/validation/validation.js.map +1 -1
  180. package/package.json +9 -9
  181. package/mtds/atlas/atlas.css.js +0 -138
  182. package/mtds/atlas/atlas.css.js.map +0 -1
  183. package/mtds/atlas.js.map +0 -1
  184. package/mtds/chart/chart.css.js +0 -187
  185. package/mtds/chart/chart.css.js.map +0 -1
  186. package/mtds/package.json.js +0 -5
  187. package/mtds/package.json.js.map +0 -1
  188. package/mtds/react-atlas.js.map +0 -1
  189. package/mtds/react.js.map +0 -1
  190. package/mtds/styles.module.css.js +0 -118
  191. package/mtds/styles.module.css.js.map +0 -1
@@ -1,160 +1,78 @@
1
- import "@u-elements/u-progress";
2
- import { DSFieldElement as g } from "@digdir/designsystemet-web";
3
- import "./external/@u-elements/u-combobox/dist/u-combobox.js";
4
- import "./external/@u-elements/u-details/dist/u-details.js";
5
- import "./analytics/analytics.js";
6
- import "./app/app-observer.js";
7
- import { getByCSSModule as l, isBrowser as n, onHotReload as y, on as u, QUICK_EVENT as S, onMutation as E, attr as s, debounce as D } from "./utils.js";
8
- import c from "./styles.module.css.js";
9
- import "./toast/toast-helper.js";
10
- import "./chart/chart-element.js";
11
- import "./logo/logo-observer.js";
12
- import "./popover/popover-observer.js";
13
- import "./table/table-observer.js";
14
- import "./toast/toast-observer.js";
15
- import "./tooltip/tooltip-element.js";
16
- import "./validation/validation-observer.js";
17
- const f = /* @__PURE__ */ new WeakSet(), a = (t) => !f.has(t) && f.add(t), o = (t, e, r) => window.dsWarnings === !1 || console.warn(
18
- `\x1B[1m@mattilsynet/design:\x1B[m ${t} is deprecated, please use ${e}:`,
19
- r
20
- ), A = l("togglegroup"), p = c.button.split(" "), L = () => {
21
- for (const t of A) {
22
- a(t) && !t.hasAttribute("data-toggle-group") && (s(t, "data-toggle-group", "Valgknapper"), o(
23
- 'Only setting class="styles.togglegroup"',
24
- 'data-toggle-group="LABEL-HERE" attribute also for better accessibility',
25
- t
26
- ));
27
- for (const e of t.getElementsByTagName("label"))
28
- a(e) && !e.classList.contains(p[0]) && (e.classList.add(...p), o(
29
- 'Only setting class="styles.button"',
30
- '<label class="styles.button">',
31
- e
32
- ));
33
- }
34
- }, N = l("breadcrumbs"), O = () => {
35
- for (const t of N)
36
- a(t) && t.nodeName !== "DS-BREADCRUMBS" && (t.classList.add(...c.breadcrumbs.split(" ")), o(
37
- 'Only setting class="styles.breadcrumbs"',
38
- '<ds-breadcrumbs class="styles.breadcrumbs">',
39
- t
40
- ));
41
- }, T = l("errorsummary"), B = () => {
42
- for (const t of T)
43
- a(t) && t.nodeName !== "DS-ERROR-SUMMARY" && o(
44
- 'Only setting class="styles.errorsummary"',
45
- '<ds-error-summary class="styles.errorsummary">',
46
- t
47
- );
48
- }, C = l("dialog"), b = () => {
49
- for (const t of C) {
50
- if (a(t)) {
51
- const e = s(t, "data-closedby");
52
- e && (s(t, "closedby", e), o(
53
- `<dialog data-closedby="${e}">`,
54
- `<dialog closedby="${e}">`,
55
- t
56
- )), t.hasAttribute("data-variant") && o(
57
- '<dialog data-variant="drawer">',
58
- '<dialog data-placement="center|left|right|top|bottom">',
59
- t
60
- );
61
- }
62
- t.isConnected && t.showModal && t.close && (t.matches('[open][data-modal]:not([data-modal="false"]):not(:modal)') ? (o(
63
- '<dialog data-modal="true">',
64
- '.showModal() or <button command="show-modal" commandfor="DIALOG-ID"></button>',
65
- t
66
- ), s(t, "open", null), t.showModal()) : t.matches(":modal:not([open])") && (s(t, "open", ""), t.close()));
67
- }
68
- }, R = () => {
69
- for (const t of document.querySelectorAll("[data-count]"))
70
- if (a(t)) {
71
- const e = s(t, "data-count");
72
- t.classList.add(...c.validation.split(" ")), s(t, "data-limit", e), o(
73
- `data-count="${e}"`,
74
- `class="styles.validation" data-field="counter" data-limit="${e}"`,
75
- t
76
- );
77
- }
78
- }, w = () => {
79
- for (const t of document.querySelectorAll("[data-command]"))
80
- if (a(t)) {
81
- const e = s(t, "data-command");
82
- e === "row" ? o(
83
- `<${t.nodeName.toLowerCase()} data-command="${e}">`,
84
- `<tr data-clickdelegatefor="${t.nodeName}-ID">`,
85
- t
86
- ) : o(
87
- `<button data-command="${e}">`,
88
- `<button command="${e?.replace("toggle-app-expanded", "show-modal")}" commandfor="TARGET-ID">`,
89
- t
90
- );
91
- }
92
- }, I = n() ? document.getElementsByTagName("u-tabs") : [], h = () => {
93
- for (const t of I) a(t) && o("u-tabs", "ds-tabs", t);
94
- }, v = n() ? document.getElementsByTagName("u-details") : [], U = () => {
95
- for (const t of v) a(t) && o("u-details", "details", t);
96
- }, i = c.suggestion.split(" "), $ = n() ? document.getElementsByTagName("u-combobox") : [], M = n() ? document.getElementsByTagName("ds-suggestion") : [], k = () => {
97
- for (const t of $)
98
- a(t) && (t.classList.add(...i), o("<u-combobox>", '<ds-suggestion class="styles.suggestion">', t));
99
- for (const t of M)
100
- a(t) && !t.classList.contains(i[0]) && (t.classList.add(...i), o(
101
- "Only using <ds-suggestion>",
102
- '<ds-suggestion class="styles.suggestion">',
103
- t
104
- ));
105
- }, F = ({ target: t }) => {
106
- if (!(t instanceof Element)) return;
107
- const e = t?.closest("tr")?.querySelector('[data-command="row"]');
108
- e && !t?.closest('a,button,label,input,select,textarea,[role="button"]') && e.click();
109
- const m = t?.closest("dialog");
110
- m && t?.closest('[data-command="close"]') && m.close();
111
- }, G = l("field"), d = /* @__PURE__ */ new Set(), x = () => {
112
- for (const t of G)
113
- t.nodeName !== "DS-FIELD" && (a(t) || o(
114
- 'Only setting class="styles.field"',
115
- '<ds-field class="styles.field">',
116
- t
117
- ), !d.has(t) && d.add(t) && g.prototype.connectedCallback.call(t));
118
- }, q = () => {
119
- for (const t of d)
120
- g.prototype.disconnectedCallback.call(t), d.delete(t);
121
- }, P = `[data-description], .${c.field.split(" ")[0]} label + p`, _ = () => {
122
- for (const t of document.querySelectorAll(P))
123
- a(t) && t.getAttribute("data-field") !== "description" && (s(t, "data-field", "description"), o(
124
- "Descriptions created by data-description of <p> only",
125
- 'data-field="data-description"',
126
- t
127
- ));
128
- }, V = l("validation"), W = () => {
129
- for (const t of V)
130
- a(t) && !t.hasAttribute("data-field") && (s(t, "data-field", "validation"), o(
131
- 'Only setting class="styles.validation"',
132
- 'class="styles.validation" data-field="validation"',
133
- t
134
- ));
135
- }, H = () => {
136
- for (const t of document.querySelectorAll("[popover][data-position]"))
137
- a(t) && (s(t, "data-placement", s(t, "data-position")), o("data-position", "data-placement", t));
138
- }, Y = D(() => {
139
- n() && (R(), w(), O(), b(), B(), _(), W(), H(), x(), L(), k(), h(), U());
1
+ import e from "./styles.module.js";
2
+ import { QUICK_EVENT as t, attr as n, debounce as r, getByCSSModule as i, isBrowser as a, on as o, onHotReload as s, onMutation as c } from "./utils.js";
3
+ import { designsystem_exports as l } from "./index.js";
4
+ //#region designsystem/deprecations.ts
5
+ var u = /* @__PURE__ */ new WeakSet(), d = (e) => !u.has(e) && u.add(e), f = (e, t, n) => window.dsWarnings === !1 || console.warn(`\x1B[1m@mattilsynet/design:\x1B[m ${e} is deprecated, please use ${t}:`, n), p = i("togglegroup"), m = e.button.split(" "), h = () => {
6
+ for (let e of p) {
7
+ d(e) && !e.hasAttribute("data-toggle-group") && (n(e, "data-toggle-group", "Valgknapper"), f("Only setting class=\"styles.togglegroup\"", "data-toggle-group=\"LABEL-HERE\" attribute also for better accessibility", e));
8
+ for (let t of e.getElementsByTagName("label")) d(t) && !t.classList.contains(m[0]) && (t.classList.add(...m), f("Only setting class=\"styles.button\"", "<label class=\"styles.button\">", t));
9
+ }
10
+ }, g = i("breadcrumbs"), _ = () => {
11
+ for (let t of g) d(t) && t.nodeName !== "DS-BREADCRUMBS" && (t.classList.add(...e.breadcrumbs.split(" ")), f("Only setting class=\"styles.breadcrumbs\"", "<ds-breadcrumbs class=\"styles.breadcrumbs\">", t));
12
+ }, v = i("errorsummary"), y = () => {
13
+ for (let e of v) d(e) && e.nodeName !== "DS-ERROR-SUMMARY" && f("Only setting class=\"styles.errorsummary\"", "<ds-error-summary class=\"styles.errorsummary\">", e);
14
+ }, b = i("dialog"), x = () => {
15
+ for (let e of b) {
16
+ if (d(e)) {
17
+ let t = n(e, "data-closedby");
18
+ t && (n(e, "closedby", t), f(`<dialog data-closedby="${t}">`, `<dialog closedby="${t}">`, e)), e.hasAttribute("data-variant") && f("<dialog data-variant=\"drawer\">", "<dialog data-placement=\"center|left|right|top|bottom\">", e);
19
+ }
20
+ e.isConnected && e.showModal && e.close && (e.matches("[open][data-modal]:not([data-modal=\"false\"]):not(:modal)") ? (f("<dialog data-modal=\"true\">", ".showModal() or <button command=\"show-modal\" commandfor=\"DIALOG-ID\"></button>", e), n(e, "open", null), e.showModal()) : e.matches(":modal:not([open])") && (n(e, "open", ""), e.close()));
21
+ }
22
+ }, S = () => {
23
+ for (let t of document.querySelectorAll("[data-count]")) if (d(t)) {
24
+ let r = n(t, "data-count");
25
+ t.classList.add(...e.validation.split(" ")), n(t, "data-limit", r), f(`data-count="${r}"`, `class="styles.validation" data-field="counter" data-limit="${r}"`, t);
26
+ }
27
+ }, C = () => {
28
+ for (let e of document.querySelectorAll("[data-command]")) if (d(e)) {
29
+ let t = n(e, "data-command");
30
+ t === "row" ? f(`<${e.nodeName.toLowerCase()} data-command="${t}">`, `<tr data-clickdelegatefor="${e.nodeName}-ID">`, e) : f(`<button data-command="${t}">`, `<button command="${t?.replace("toggle-app-expanded", "show-modal")}" commandfor="TARGET-ID">`, e);
31
+ }
32
+ }, w = a() ? document.getElementsByTagName("u-tabs") : [], T = () => {
33
+ for (let e of w) d(e) && f("u-tabs", "ds-tabs", e);
34
+ }, E = a() ? document.getElementsByTagName("u-details") : [], D = () => {
35
+ for (let e of E) d(e) && f("u-details", "details", e);
36
+ }, O = e.suggestion.split(" "), k = a() ? document.getElementsByTagName("u-combobox") : [], A = a() ? document.getElementsByTagName("ds-suggestion") : [], j = () => {
37
+ for (let e of k) d(e) && (e.classList.add(...O), f("<u-combobox>", "<ds-suggestion class=\"styles.suggestion\">", e));
38
+ for (let e of A) d(e) && !e.classList.contains(O[0]) && (e.classList.add(...O), f("Only using <ds-suggestion>", "<ds-suggestion class=\"styles.suggestion\">", e));
39
+ }, M = ({ target: e }) => {
40
+ if (!(e instanceof Element)) return;
41
+ let t = e?.closest("tr")?.querySelector("[data-command=\"row\"]");
42
+ t && !e?.closest("a,button,label,input,select,textarea,[role=\"button\"]") && t.click();
43
+ let n = e?.closest("dialog");
44
+ n && e?.closest("[data-command=\"close\"]") && n.close();
45
+ }, N = i("field"), P = /* @__PURE__ */ new Set(), F = () => {
46
+ for (let e of N) e.nodeName !== "DS-FIELD" && (d(e) || f("Only setting class=\"styles.field\"", "<ds-field class=\"styles.field\">", e), !P.has(e) && P.add(e) && l.DSFieldElement.prototype.connectedCallback.call(e));
47
+ }, I = () => {
48
+ for (let e of P) l.DSFieldElement.prototype.disconnectedCallback.call(e), P.delete(e);
49
+ }, L = `[data-description], .${e.field.split(" ")[0]} label + p`, R = () => {
50
+ for (let e of document.querySelectorAll(L)) d(e) && e.getAttribute("data-field") !== "description" && (n(e, "data-field", "description"), f("Descriptions created by data-description of <p> only", "data-field=\"data-description\"", e));
51
+ }, z = i("validation"), B = () => {
52
+ for (let e of z) d(e) && !e.hasAttribute("data-field") && (n(e, "data-field", "validation"), f("Only setting class=\"styles.validation\"", "class=\"styles.validation\" data-field=\"validation\"", e));
53
+ }, V = () => {
54
+ for (let e of document.querySelectorAll("[popover][data-position]")) d(e) && (n(e, "data-placement", n(e, "data-position")), f("data-position", "data-placement", e));
55
+ }, H = r(() => {
56
+ a() && (S(), C(), _(), x(), y(), R(), B(), V(), F(), h(), j(), T(), D());
140
57
  }, 200);
141
- y("deprecations", () => [
142
- q,
143
- // Return as cleanup function
144
- u(document, "click", F, S),
145
- u(document, "toggle", b, !0),
146
- E(document, Y, {
147
- attributeFilter: [
148
- "class",
149
- "data-command",
150
- "data-count",
151
- "data-description",
152
- "data-variant",
153
- "open"
154
- ],
155
- attributes: !0,
156
- childList: !0,
157
- subtree: !0
158
- })
58
+ s("deprecations", () => [
59
+ I,
60
+ o(document, "click", M, t),
61
+ o(document, "toggle", x, !0),
62
+ c(document, H, {
63
+ attributeFilter: [
64
+ "class",
65
+ "data-command",
66
+ "data-count",
67
+ "data-description",
68
+ "data-variant",
69
+ "open"
70
+ ],
71
+ attributes: !0,
72
+ childList: !0,
73
+ subtree: !0
74
+ })
159
75
  ]);
160
- //# sourceMappingURL=deprecations.js.map
76
+ //#endregion
77
+
78
+ //# sourceMappingURL=deprecations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deprecations.js","sources":["../designsystem/deprecations.ts"],"sourcesContent":["import { DSFieldElement } from \".\";\nimport styles from \"./styles.module.css\";\nimport {\n\tattr,\n\tdebounce,\n\tgetByCSSModule,\n\tisBrowser,\n\ton,\n\tonHotReload,\n\tonMutation,\n\tQUICK_EVENT,\n} from \"./utils\";\n\nconst DEPRECATIONS = new WeakSet<Element>();\nconst deprecate = (el: Element) =>\n\t!DEPRECATIONS.has(el) && DEPRECATIONS.add(el);\n\nconst warn = (from: string, to: string, el: Element) =>\n\twindow.dsWarnings === false ||\n\tconsole.warn(\n\t\t`\\x1B[1m@mattilsynet/design:\\x1B[m ${from} is deprecated, please use ${to}:`,\n\t\tel,\n\t);\n\n// Deprecate togglegroup without data-toggle-group attribute\nconst TOGGLEGROUPS = getByCSSModule(\"togglegroup\");\nconst CSS_BUTTON = styles.button.split(\" \");\nconst deprecateToggleGroup = () => {\n\tfor (const el of TOGGLEGROUPS) {\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-toggle-group\")) {\n\t\t\tattr(el, \"data-toggle-group\", \"Valgknapper\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.togglegroup\"',\n\t\t\t\t'data-toggle-group=\"LABEL-HERE\" attribute also for better accessibility',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n\t\tfor (const label of el.getElementsByTagName(\"label\")) {\n\t\t\tif (deprecate(label) && !label.classList.contains(CSS_BUTTON[0])) {\n\t\t\t\tlabel.classList.add(...CSS_BUTTON);\n\t\t\t\twarn(\n\t\t\t\t\t'Only setting class=\"styles.button\"',\n\t\t\t\t\t`<label class=\"styles.button\">`,\n\t\t\t\t\tlabel,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst BREADCRUMBS = getByCSSModule(\"breadcrumbs\");\nconst deprecateBreadcrumbs = () => {\n\tfor (const el of BREADCRUMBS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-BREADCRUMBS\") {\n\t\t\tel.classList.add(...styles.breadcrumbs.split(\" \"));\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.breadcrumbs\"',\n\t\t\t\t'<ds-breadcrumbs class=\"styles.breadcrumbs\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst ERRORSUMMARYS = getByCSSModule(\"errorsummary\");\nconst deprecateErrorSummary = () => {\n\tfor (const el of ERRORSUMMARYS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-ERROR-SUMMARY\") {\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.errorsummary\"',\n\t\t\t\t'<ds-error-summary class=\"styles.errorsummary\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-variant and data-modal and data-closedby on dialogs\nconst DIALOGS = getByCSSModule(\"dialog\") as HTMLCollectionOf<HTMLDialogElement>;\nconst deprecateDialog = () => {\n\tfor (const el of DIALOGS) {\n\t\tif (deprecate(el)) {\n\t\t\tconst closedby = attr(el, \"data-closedby\");\n\t\t\tif (closedby) {\n\t\t\t\tattr(el, \"closedby\", closedby);\n\t\t\t\twarn(\n\t\t\t\t\t`<dialog data-closedby=\"${closedby}\">`,\n\t\t\t\t\t`<dialog closedby=\"${closedby}\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (el.hasAttribute(\"data-variant\")) {\n\t\t\t\twarn(\n\t\t\t\t\t'<dialog data-variant=\"drawer\">',\n\t\t\t\t\t'<dialog data-placement=\"center|left|right|top|bottom\">',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (el.isConnected && el.showModal && el.close) {\n\t\t\tif (\n\t\t\t\tel.matches('[open][data-modal]:not([data-modal=\"false\"]):not(:modal)')\n\t\t\t) {\n\t\t\t\twarn(\n\t\t\t\t\t'<dialog data-modal=\"true\">',\n\t\t\t\t\t'.showModal() or <button command=\"show-modal\" commandfor=\"DIALOG-ID\"></button>',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t\tattr(el, \"open\", null); // Using attribute instead of .close to avoid `close` event\n\t\t\t\tel.showModal();\n\t\t\t} else if (el.matches(\":modal:not([open])\")) {\n\t\t\t\tattr(el, \"open\", \"\"); // Set as open\n\t\t\t\tel.close(); // So we correctly can call .close, removing <dialog> from #top-layer\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Deprecate data-count in favor of data-limit\nconst deprecateCounter = () => {\n\tfor (const el of document.querySelectorAll(\"[data-count]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst count = attr(el, \"data-count\");\n\t\t\tel.classList.add(...styles.validation.split(\" \"));\n\t\t\tattr(el, \"data-limit\", count);\n\t\t\twarn(\n\t\t\t\t`data-count=\"${count}\"`,\n\t\t\t\t`class=\"styles.validation\" data-field=\"counter\" data-limit=\"${count}\"`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-command on buttons and other elements\nconst deprecateDataCommand = () => {\n\tfor (const el of document.querySelectorAll(\"[data-command]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst command = attr(el, \"data-command\");\n\n\t\t\tif (command === \"row\")\n\t\t\t\twarn(\n\t\t\t\t\t`<${el.nodeName.toLowerCase()} data-command=\"${command}\">`,\n\t\t\t\t\t`<tr data-clickdelegatefor=\"${el.nodeName}-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\telse\n\t\t\t\twarn(\n\t\t\t\t\t`<button data-command=\"${command}\">`,\n\t\t\t\t\t`<button command=\"${command?.replace(\"toggle-app-expanded\", \"show-modal\")}\" commandfor=\"TARGET-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t}\n};\n\n// Deprecate u-tabs\nconst TABS = isBrowser() ? document.getElementsByTagName(\"u-tabs\") : [];\nconst deprecateUTabs = () => {\n\tfor (const el of TABS) if (deprecate(el)) warn(\"u-tabs\", \"ds-tabs\", el);\n};\n\n// Deprecate u-details\nconst DETAILS = isBrowser() ? document.getElementsByTagName(\"u-details\") : [];\nconst deprecateUDetails = () => {\n\tfor (const el of DETAILS) if (deprecate(el)) warn(\"u-details\", \"details\", el);\n};\n\n// Deprecate u-combobox and add class to ds-suggestion\nconst CSS_SUGGESTION = styles.suggestion.split(\" \");\nconst OLD = isBrowser() ? document.getElementsByTagName(\"u-combobox\") : [];\nconst NEW = isBrowser() ? document.getElementsByTagName(\"ds-suggestion\") : [];\nconst deprecateUCombobox = () => {\n\tfor (const el of OLD)\n\t\tif (deprecate(el)) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\"<u-combobox>\", `<ds-suggestion class=\"styles.suggestion\">`, el);\n\t\t}\n\tfor (const el of NEW)\n\t\tif (deprecate(el) && !el.classList.contains(CSS_SUGGESTION[0])) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\n\t\t\t\t\"Only using <ds-suggestion>\",\n\t\t\t\t`<ds-suggestion class=\"styles.suggestion\">`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst handleCommandClick = ({ target: el }: Event) => {\n\tif (el instanceof Element === false) return;\n\tconst row = el?.closest(\"tr\")?.querySelector('[data-command=\"row\"]');\n\tconst click =\n\t\trow && !el?.closest('a,button,label,input,select,textarea,[role=\"button\"]');\n\tif (click) (row as HTMLElement).click(); // Forward click to data-command=\"row\" element\n\n\tconst dialog = el?.closest(\"dialog\");\n\tconst close = dialog && el?.closest('[data-command=\"close\"]');\n\tif (close) dialog.close();\n};\n\n// Deprecate fields without ds-field element\nconst FIELDS = getByCSSModule(\"field\");\nconst FIELD_UNBIND = new Set<Element>();\nconst deprecateField = () => {\n\tfor (const el of FIELDS)\n\t\tif (el.nodeName !== \"DS-FIELD\") {\n\t\t\tif (!deprecate(el))\n\t\t\t\twarn(\n\t\t\t\t\t'Only setting class=\"styles.field\"',\n\t\t\t\t\t'<ds-field class=\"styles.field\">',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\tif (!FIELD_UNBIND.has(el) && FIELD_UNBIND.add(el)) {\n\t\t\t\tDSFieldElement.prototype.connectedCallback.call(el as DSFieldElement);\n\t\t\t}\n\t\t}\n};\nconst unbindFields = () => {\n\tfor (const el of FIELD_UNBIND) {\n\t\tDSFieldElement.prototype.disconnectedCallback.call(el as DSFieldElement);\n\t\tFIELD_UNBIND.delete(el);\n\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst CSS_DESCRIPTIONS = `[data-description], .${styles.field.split(\" \")[0]} label + p`;\nconst deprecateFeildDescription = () => {\n\tfor (const el of document.querySelectorAll(CSS_DESCRIPTIONS))\n\t\tif (deprecate(el) && el.getAttribute(\"data-field\") !== \"description\") {\n\t\t\tattr(el, \"data-field\", \"description\");\n\t\t\twarn(\n\t\t\t\t\"Descriptions created by data-description of <p> only\",\n\t\t\t\t'data-field=\"data-description\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst VALIDATIONS = getByCSSModule(\"validation\");\nconst deprecateFieldValidation = () => {\n\tfor (const el of VALIDATIONS)\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-field\")) {\n\t\t\tattr(el, \"data-field\", \"validation\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.validation\"',\n\t\t\t\t'class=\"styles.validation\" data-field=\"validation\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst deprecatePopoverPosition = () => {\n\tfor (const el of document.querySelectorAll(\"[popover][data-position]\"))\n\t\tif (deprecate(el)) {\n\t\t\tattr(el, \"data-placement\", attr(el, \"data-position\"));\n\t\t\twarn(\"data-position\", \"data-placement\", el);\n\t\t}\n};\n\nconst handleDeprecations = debounce(() => {\n\tif (!isBrowser()) return; // Check if document is still available, since this can run in test environments after document is destroyed\n\tdeprecateCounter();\n\tdeprecateDataCommand();\n\tdeprecateBreadcrumbs();\n\tdeprecateDialog();\n\tdeprecateErrorSummary();\n\tdeprecateFeildDescription();\n\tdeprecateFieldValidation();\n\tdeprecatePopoverPosition();\n\tdeprecateField(); // Should run after other field deprecations to access correct data-attributes\n\tdeprecateToggleGroup();\n\tdeprecateUCombobox();\n\tdeprecateUTabs();\n\tdeprecateUDetails();\n}, 200);\n\nonHotReload(\"deprecations\", () => [\n\tunbindFields, // Return as cleanup function\n\ton(document, \"click\", handleCommandClick, QUICK_EVENT),\n\ton(document, \"toggle\", deprecateDialog, true),\n\tonMutation(document, handleDeprecations, {\n\t\tattributeFilter: [\n\t\t\t\"class\",\n\t\t\t\"data-command\",\n\t\t\t\"data-count\",\n\t\t\t\"data-description\",\n\t\t\t\"data-variant\",\n\t\t\t\"open\",\n\t\t],\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true,\n\t}),\n]);\n"],"names":["DEPRECATIONS","deprecate","el","warn","from","to","TOGGLEGROUPS","getByCSSModule","CSS_BUTTON","styles","deprecateToggleGroup","attr","label","BREADCRUMBS","deprecateBreadcrumbs","ERRORSUMMARYS","deprecateErrorSummary","DIALOGS","deprecateDialog","closedby","deprecateCounter","count","deprecateDataCommand","command","TABS","isBrowser","deprecateUTabs","DETAILS","deprecateUDetails","CSS_SUGGESTION","OLD","NEW","deprecateUCombobox","handleCommandClick","row","dialog","FIELDS","FIELD_UNBIND","deprecateField","DSFieldElement","unbindFields","CSS_DESCRIPTIONS","deprecateFeildDescription","VALIDATIONS","deprecateFieldValidation","deprecatePopoverPosition","handleDeprecations","debounce","onHotReload","on","QUICK_EVENT","onMutation"],"mappings":";;;;;;;;;;;;;;;;AAaA,MAAMA,wBAAmB,QAAA,GACnBC,IAAY,CAACC,MAClB,CAACF,EAAa,IAAIE,CAAE,KAAKF,EAAa,IAAIE,CAAE,GAEvCC,IAAO,CAACC,GAAcC,GAAYH,MACvC,OAAO,eAAe,MACtB,QAAQ;AAAA,EACP,qCAAqCE,CAAI,8BAA8BC,CAAE;AAAA,EACzEH;AACD,GAGKI,IAAeC,EAAe,aAAa,GAC3CC,IAAaC,EAAO,OAAO,MAAM,GAAG,GACpCC,IAAuB,MAAM;AAClC,aAAWR,KAAMI,GAAc;AAC9B,IAAIL,EAAUC,CAAE,KAAK,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;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAED,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAS;AAAA,EAAA,CACT;AACF,CAAC;"}
1
+ {"version":3,"file":"deprecations.js","names":[],"sources":["../designsystem/deprecations.ts"],"sourcesContent":["import { DSFieldElement } from \".\";\nimport styles from \"./styles.module.css\";\nimport {\n\tattr,\n\tdebounce,\n\tgetByCSSModule,\n\tisBrowser,\n\ton,\n\tonHotReload,\n\tonMutation,\n\tQUICK_EVENT,\n} from \"./utils\";\n\nconst DEPRECATIONS = new WeakSet<Element>();\nconst deprecate = (el: Element) =>\n\t!DEPRECATIONS.has(el) && DEPRECATIONS.add(el);\n\nconst warn = (from: string, to: string, el: Element) =>\n\twindow.dsWarnings === false ||\n\tconsole.warn(\n\t\t`\\x1B[1m@mattilsynet/design:\\x1B[m ${from} is deprecated, please use ${to}:`,\n\t\tel,\n\t);\n\n// Deprecate togglegroup without data-toggle-group attribute\nconst TOGGLEGROUPS = getByCSSModule(\"togglegroup\");\nconst CSS_BUTTON = styles.button.split(\" \");\nconst deprecateToggleGroup = () => {\n\tfor (const el of TOGGLEGROUPS) {\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-toggle-group\")) {\n\t\t\tattr(el, \"data-toggle-group\", \"Valgknapper\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.togglegroup\"',\n\t\t\t\t'data-toggle-group=\"LABEL-HERE\" attribute also for better accessibility',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n\t\tfor (const label of el.getElementsByTagName(\"label\")) {\n\t\t\tif (deprecate(label) && !label.classList.contains(CSS_BUTTON[0])) {\n\t\t\t\tlabel.classList.add(...CSS_BUTTON);\n\t\t\t\twarn(\n\t\t\t\t\t'Only setting class=\"styles.button\"',\n\t\t\t\t\t`<label class=\"styles.button\">`,\n\t\t\t\t\tlabel,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst BREADCRUMBS = getByCSSModule(\"breadcrumbs\");\nconst deprecateBreadcrumbs = () => {\n\tfor (const el of BREADCRUMBS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-BREADCRUMBS\") {\n\t\t\tel.classList.add(...styles.breadcrumbs.split(\" \"));\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.breadcrumbs\"',\n\t\t\t\t'<ds-breadcrumbs class=\"styles.breadcrumbs\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst ERRORSUMMARYS = getByCSSModule(\"errorsummary\");\nconst deprecateErrorSummary = () => {\n\tfor (const el of ERRORSUMMARYS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-ERROR-SUMMARY\") {\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.errorsummary\"',\n\t\t\t\t'<ds-error-summary class=\"styles.errorsummary\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-variant and data-modal and data-closedby on dialogs\nconst DIALOGS = getByCSSModule(\"dialog\") as HTMLCollectionOf<HTMLDialogElement>;\nconst deprecateDialog = () => {\n\tfor (const el of DIALOGS) {\n\t\tif (deprecate(el)) {\n\t\t\tconst closedby = attr(el, \"data-closedby\");\n\t\t\tif (closedby) {\n\t\t\t\tattr(el, \"closedby\", closedby);\n\t\t\t\twarn(\n\t\t\t\t\t`<dialog data-closedby=\"${closedby}\">`,\n\t\t\t\t\t`<dialog closedby=\"${closedby}\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (el.hasAttribute(\"data-variant\")) {\n\t\t\t\twarn(\n\t\t\t\t\t'<dialog data-variant=\"drawer\">',\n\t\t\t\t\t'<dialog data-placement=\"center|left|right|top|bottom\">',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (el.isConnected && el.showModal && el.close) {\n\t\t\tif (\n\t\t\t\tel.matches('[open][data-modal]:not([data-modal=\"false\"]):not(:modal)')\n\t\t\t) {\n\t\t\t\twarn(\n\t\t\t\t\t'<dialog data-modal=\"true\">',\n\t\t\t\t\t'.showModal() or <button command=\"show-modal\" commandfor=\"DIALOG-ID\"></button>',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t\tattr(el, \"open\", null); // Using attribute instead of .close to avoid `close` event\n\t\t\t\tel.showModal();\n\t\t\t} else if (el.matches(\":modal:not([open])\")) {\n\t\t\t\tattr(el, \"open\", \"\"); // Set as open\n\t\t\t\tel.close(); // So we correctly can call .close, removing <dialog> from #top-layer\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Deprecate data-count in favor of data-limit\nconst deprecateCounter = () => {\n\tfor (const el of document.querySelectorAll(\"[data-count]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst count = attr(el, \"data-count\");\n\t\t\tel.classList.add(...styles.validation.split(\" \"));\n\t\t\tattr(el, \"data-limit\", count);\n\t\t\twarn(\n\t\t\t\t`data-count=\"${count}\"`,\n\t\t\t\t`class=\"styles.validation\" data-field=\"counter\" data-limit=\"${count}\"`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-command on buttons and other elements\nconst deprecateDataCommand = () => {\n\tfor (const el of document.querySelectorAll(\"[data-command]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst command = attr(el, \"data-command\");\n\n\t\t\tif (command === \"row\")\n\t\t\t\twarn(\n\t\t\t\t\t`<${el.nodeName.toLowerCase()} data-command=\"${command}\">`,\n\t\t\t\t\t`<tr data-clickdelegatefor=\"${el.nodeName}-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\telse\n\t\t\t\twarn(\n\t\t\t\t\t`<button data-command=\"${command}\">`,\n\t\t\t\t\t`<button command=\"${command?.replace(\"toggle-app-expanded\", \"show-modal\")}\" commandfor=\"TARGET-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t}\n};\n\n// Deprecate u-tabs\nconst TABS = isBrowser() ? document.getElementsByTagName(\"u-tabs\") : [];\nconst deprecateUTabs = () => {\n\tfor (const el of TABS) if (deprecate(el)) warn(\"u-tabs\", \"ds-tabs\", el);\n};\n\n// Deprecate u-details\nconst DETAILS = isBrowser() ? document.getElementsByTagName(\"u-details\") : [];\nconst deprecateUDetails = () => {\n\tfor (const el of DETAILS) if (deprecate(el)) warn(\"u-details\", \"details\", el);\n};\n\n// Deprecate u-combobox and add class to ds-suggestion\nconst CSS_SUGGESTION = styles.suggestion.split(\" \");\nconst OLD = isBrowser() ? document.getElementsByTagName(\"u-combobox\") : [];\nconst NEW = isBrowser() ? document.getElementsByTagName(\"ds-suggestion\") : [];\nconst deprecateUCombobox = () => {\n\tfor (const el of OLD)\n\t\tif (deprecate(el)) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\"<u-combobox>\", `<ds-suggestion class=\"styles.suggestion\">`, el);\n\t\t}\n\tfor (const el of NEW)\n\t\tif (deprecate(el) && !el.classList.contains(CSS_SUGGESTION[0])) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\n\t\t\t\t\"Only using <ds-suggestion>\",\n\t\t\t\t`<ds-suggestion class=\"styles.suggestion\">`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst handleCommandClick = ({ target: el }: Event) => {\n\tif (el instanceof Element === false) return;\n\tconst row = el?.closest(\"tr\")?.querySelector('[data-command=\"row\"]');\n\tconst click =\n\t\trow && !el?.closest('a,button,label,input,select,textarea,[role=\"button\"]');\n\tif (click) (row as HTMLElement).click(); // Forward click to data-command=\"row\" element\n\n\tconst dialog = el?.closest(\"dialog\");\n\tconst close = dialog && el?.closest('[data-command=\"close\"]');\n\tif (close) dialog.close();\n};\n\n// Deprecate fields without ds-field element\nconst FIELDS = getByCSSModule(\"field\");\nconst FIELD_UNBIND = new Set<Element>();\nconst deprecateField = () => {\n\tfor (const el of FIELDS)\n\t\tif (el.nodeName !== \"DS-FIELD\") {\n\t\t\tif (!deprecate(el))\n\t\t\t\twarn(\n\t\t\t\t\t'Only setting class=\"styles.field\"',\n\t\t\t\t\t'<ds-field class=\"styles.field\">',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\tif (!FIELD_UNBIND.has(el) && FIELD_UNBIND.add(el)) {\n\t\t\t\tDSFieldElement.prototype.connectedCallback.call(el as DSFieldElement);\n\t\t\t}\n\t\t}\n};\nconst unbindFields = () => {\n\tfor (const el of FIELD_UNBIND) {\n\t\tDSFieldElement.prototype.disconnectedCallback.call(el as DSFieldElement);\n\t\tFIELD_UNBIND.delete(el);\n\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst CSS_DESCRIPTIONS = `[data-description], .${styles.field.split(\" \")[0]} label + p`;\nconst deprecateFeildDescription = () => {\n\tfor (const el of document.querySelectorAll(CSS_DESCRIPTIONS))\n\t\tif (deprecate(el) && el.getAttribute(\"data-field\") !== \"description\") {\n\t\t\tattr(el, \"data-field\", \"description\");\n\t\t\twarn(\n\t\t\t\t\"Descriptions created by data-description of <p> only\",\n\t\t\t\t'data-field=\"data-description\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst VALIDATIONS = getByCSSModule(\"validation\");\nconst deprecateFieldValidation = () => {\n\tfor (const el of VALIDATIONS)\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-field\")) {\n\t\t\tattr(el, \"data-field\", \"validation\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.validation\"',\n\t\t\t\t'class=\"styles.validation\" data-field=\"validation\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst deprecatePopoverPosition = () => {\n\tfor (const el of document.querySelectorAll(\"[popover][data-position]\"))\n\t\tif (deprecate(el)) {\n\t\t\tattr(el, \"data-placement\", attr(el, \"data-position\"));\n\t\t\twarn(\"data-position\", \"data-placement\", el);\n\t\t}\n};\n\nconst handleDeprecations = debounce(() => {\n\tif (!isBrowser()) return; // Check if document is still available, since this can run in test environments after document is destroyed\n\tdeprecateCounter();\n\tdeprecateDataCommand();\n\tdeprecateBreadcrumbs();\n\tdeprecateDialog();\n\tdeprecateErrorSummary();\n\tdeprecateFeildDescription();\n\tdeprecateFieldValidation();\n\tdeprecatePopoverPosition();\n\tdeprecateField(); // Should run after other field deprecations to access correct data-attributes\n\tdeprecateToggleGroup();\n\tdeprecateUCombobox();\n\tdeprecateUTabs();\n\tdeprecateUDetails();\n}, 200);\n\nonHotReload(\"deprecations\", () => [\n\tunbindFields, // Return as cleanup function\n\ton(document, \"click\", handleCommandClick, QUICK_EVENT),\n\ton(document, \"toggle\", deprecateDialog, true),\n\tonMutation(document, handleDeprecations, {\n\t\tattributeFilter: [\n\t\t\t\"class\",\n\t\t\t\"data-command\",\n\t\t\t\"data-count\",\n\t\t\t\"data-description\",\n\t\t\t\"data-variant\",\n\t\t\t\"open\",\n\t\t],\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true,\n\t}),\n]);\n"],"mappings":";;;;AAaA,IAAM,oBAAe,IAAI,QAAiB,GACpC,KAAa,MAClB,CAAC,EAAa,IAAI,CAAE,KAAK,EAAa,IAAI,CAAE,GAEvC,KAAQ,GAAc,GAAY,MACvC,OAAO,eAAe,MACtB,QAAQ,KACP,qCAAqC,EAAK,6BAA6B,EAAG,IAC1E,CACD,GAGK,IAAe,EAAe,aAAa,GAC3C,IAAa,EAAO,OAAO,MAAM,GAAG,GACpC,UAA6B;CAClC,KAAK,IAAM,KAAM,GAAc;EAC9B,AAAI,EAAU,CAAE,KAAK,CAAC,EAAG,aAAa,mBAAmB,MACxD,EAAK,GAAI,qBAAqB,aAAa,GAC3C,EACC,6CACA,4EACA,CACD;EAED,KAAK,IAAM,KAAS,EAAG,qBAAqB,OAAO,GAClD,AAAI,EAAU,CAAK,KAAK,CAAC,EAAM,UAAU,SAAS,EAAW,EAAE,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,GACtB,EAA0B,GAC1B,EAAyB,GACzB,EAAyB,GACzB,EAAe,GACf,EAAqB,GACrB,EAAmB,GACnB,EAAe,GACf,EAAkB;AACnB,GAAG,GAAG;AAEN,EAAY,sBAAsB;CACjC;CACA,EAAG,UAAU,SAAS,GAAoB,CAAW;CACrD,EAAG,UAAU,UAAU,GAAiB,EAAI;CAC5C,EAAW,UAAU,GAAoB;EACxC,iBAAiB;GAChB;GACA;GACA;GACA;GACA;GACA;EACD;EACA,YAAY;EACZ,WAAW;EACX,SAAS;CACV,CAAC;AACF,CAAC"}
@@ -1,24 +1,21 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import e from "clsx";
3
- import { forwardRef as m } from "react";
4
- import i from "../styles.module.css.js";
5
- const l = m(
6
- function({ className: t, ...r }, a) {
7
- return /* @__PURE__ */ s(
8
- "details",
9
- {
10
- ref: a,
11
- className: e(i.details, t),
12
- ...r
13
- }
14
- );
15
- }
16
- ), n = m(
17
- function(t, r) {
18
- return /* @__PURE__ */ s("summary", { ref: r, ...t });
19
- }
20
- ), y = Object.assign(l, { Summary: n });
21
- export {
22
- y as Details
23
- };
24
- //# sourceMappingURL=details.js.map
1
+ import e from "../styles.module.js";
2
+ import t from "clsx";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region designsystem/details/details.tsx
6
+ var i = n(function({ className: n, ...i }, a) {
7
+ return /* @__PURE__ */ r("details", {
8
+ ref: a,
9
+ className: t(e.details, n),
10
+ ...i
11
+ });
12
+ }), a = n(function(e, t) {
13
+ return /* @__PURE__ */ r("summary", {
14
+ ref: t,
15
+ ...e
16
+ });
17
+ }), o = Object.assign(i, { Summary: a });
18
+ //#endregion
19
+ export { o as Details };
20
+
21
+ //# sourceMappingURL=details.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"details.js","sources":["../../designsystem/details/details.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DetailsProps = React.ComponentPropsWithoutRef<\"details\"> & {\n\t\"data-align\"?: \"start\" | \"center\";\n\t\"data-variant\"?: \"default\" | \"card\";\n};\nconst DetailsComp = forwardRef<HTMLDetailsElement, DetailsProps>(\n\tfunction Details({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<details\n\t\t\t\tref={ref}\n\t\t\t\tclassName={clsx(styles.details, className)}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport type SummaryProps = React.ComponentPropsWithoutRef<\"summary\">;\nconst DetailsSummary = forwardRef<HTMLElement, SummaryProps>(\n\tfunction DetailsSummary(rest, ref) {\n\t\treturn <summary ref={ref} {...rest} />;\n\t},\n);\n\nexport const Details = Object.assign(DetailsComp, { Summary: DetailsSummary });\n"],"names":["DetailsComp","forwardRef","className","rest","ref","jsx","clsx","styles","DetailsSummary","Details"],"mappings":";;;;AAQA,MAAMA,IAAcC;AAAA,EACnB,SAAiB,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAAQC,GAAK;AAC7C,WACC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,KAAAD;AAAA,QACA,WAAWE,EAAKC,EAAO,SAASL,CAAS;AAAA,QACxC,GAAGC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACD,GAGMK,IAAiBP;AAAA,EACtB,SAAwBE,GAAMC,GAAK;AAClC,WAAO,gBAAAC,EAAC,WAAA,EAAQ,KAAAD,GAAW,GAAGD,EAAA,CAAM;AAAA,EACrC;AACD,GAEaM,IAAU,OAAO,OAAOT,GAAa,EAAE,SAASQ,GAAgB;"}
1
+ {"version":3,"file":"details.js","names":[],"sources":["../../designsystem/details/details.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DetailsProps = React.ComponentPropsWithoutRef<\"details\"> & {\n\t\"data-align\"?: \"start\" | \"center\";\n\t\"data-variant\"?: \"default\" | \"card\";\n};\nconst DetailsComp = forwardRef<HTMLDetailsElement, DetailsProps>(\n\tfunction Details({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<details\n\t\t\t\tref={ref}\n\t\t\t\tclassName={clsx(styles.details, className)}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport type SummaryProps = React.ComponentPropsWithoutRef<\"summary\">;\nconst DetailsSummary = forwardRef<HTMLElement, SummaryProps>(\n\tfunction DetailsSummary(rest, ref) {\n\t\treturn <summary ref={ref} {...rest} />;\n\t},\n);\n\nexport const Details = Object.assign(DetailsComp, { Summary: DetailsSummary });\n"],"mappings":";;;;;AAQA,IAAM,IAAc,EACnB,SAAiB,EAAE,cAAW,GAAG,KAAQ,GAAK;CAC7C,OACC,kBAAC,WAAD;EACM;EACL,WAAW,EAAK,EAAO,SAAS,CAAS;EACzC,GAAI;CACJ,CAAA;AAEH,CACD,GAGM,IAAiB,EACtB,SAAwB,GAAM,GAAK;CAClC,OAAO,kBAAC,WAAD;EAAc;EAAK,GAAI;CAAO,CAAA;AACtC,CACD,GAEa,IAAU,OAAO,OAAO,GAAa,EAAE,SAAS,EAAe,CAAC"}
@@ -1,21 +1,17 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import i from "clsx";
3
- import { forwardRef as l } from "react";
4
- import d from "../styles.module.css.js";
5
- const g = l(
6
- function({ className: a, modal: r = !0, ...o }, m) {
7
- return /* @__PURE__ */ t(
8
- "dialog",
9
- {
10
- className: i(d.dialog, a),
11
- "data-modal": o["data-modal"] ?? r,
12
- ref: m,
13
- ...o
14
- }
15
- );
16
- }
17
- );
18
- export {
19
- g as Dialog
20
- };
21
- //# sourceMappingURL=dialog.js.map
1
+ import e from "../styles.module.js";
2
+ import t from "clsx";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region designsystem/dialog/dialog.tsx
6
+ var i = n(function({ className: n, modal: i = !0, ...a }, o) {
7
+ return /* @__PURE__ */ r("dialog", {
8
+ className: t(e.dialog, n),
9
+ "data-modal": a["data-modal"] ?? i,
10
+ ref: o,
11
+ ...a
12
+ });
13
+ });
14
+ //#endregion
15
+ export { i as Dialog };
16
+
17
+ //# sourceMappingURL=dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sources":["../../designsystem/dialog/dialog.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DialogProps = React.ComponentPropsWithoutRef<\"dialog\"> & {\n\t\"data-placement\"?: \"center\" | \"top\" | \"bottom\" | \"left\" | \"right\";\n\t/**\n\t * @deprecated Use 'closedby' instead\n\t */\n\t\"data-closedby\"?: \"any\" | \"closerequest\";\n\t/**\n\t * @deprecated Use '<button command=\"show-modal\" commandfor=\"DIALOG-ID\">' instead\n\t */\n\t\"data-modal\"?: boolean | \"true\" | \"false\";\n\t/**\n\t * @deprecated Use '<button command=\"show-modal\" commandfor=\"DIALOG-ID\">' instead\n\t */\n\tmodal?: boolean;\n};\n\nexport const Dialog = forwardRef<HTMLDialogElement, DialogProps>(\n\tfunction Dialog({ className, modal = true, ...rest }, ref) {\n\t\treturn (\n\t\t\t<dialog\n\t\t\t\tclassName={clsx(styles.dialog, className)}\n\t\t\t\tdata-modal={rest[\"data-modal\"] ?? modal}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Dialog","forwardRef","className","modal","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAoBO,MAAMA,IAASC;AAAA,EACrB,SAAgB,EAAE,WAAAC,GAAW,OAAAC,IAAQ,IAAM,GAAGC,EAAA,GAAQC,GAAK;AAC1D,WACC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAWC,EAAKC,EAAO,QAAQN,CAAS;AAAA,QACxC,cAAYE,EAAK,YAAY,KAAKD;AAAA,QAClC,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACD;"}
1
+ {"version":3,"file":"dialog.js","names":[],"sources":["../../designsystem/dialog/dialog.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DialogProps = React.ComponentPropsWithoutRef<\"dialog\"> & {\n\t\"data-placement\"?: \"center\" | \"top\" | \"bottom\" | \"left\" | \"right\";\n\t/**\n\t * @deprecated Use 'closedby' instead\n\t */\n\t\"data-closedby\"?: \"any\" | \"closerequest\";\n\t/**\n\t * @deprecated Use '<button command=\"show-modal\" commandfor=\"DIALOG-ID\">' instead\n\t */\n\t\"data-modal\"?: boolean | \"true\" | \"false\";\n\t/**\n\t * @deprecated Use '<button command=\"show-modal\" commandfor=\"DIALOG-ID\">' instead\n\t */\n\tmodal?: boolean;\n};\n\nexport const Dialog = forwardRef<HTMLDialogElement, DialogProps>(\n\tfunction Dialog({ className, modal = true, ...rest }, ref) {\n\t\treturn (\n\t\t\t<dialog\n\t\t\t\tclassName={clsx(styles.dialog, className)}\n\t\t\t\tdata-modal={rest[\"data-modal\"] ?? modal}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"mappings":";;;;;AAoBA,IAAa,IAAS,EACrB,SAAgB,EAAE,cAAW,WAAQ,IAAM,GAAG,KAAQ,GAAK;CAC1D,OACC,kBAAC,UAAD;EACC,WAAW,EAAK,EAAO,QAAQ,CAAS;EACxC,cAAY,EAAK,iBAAiB;EAC7B;EACL,GAAI;CACJ,CAAA;AAEH,CACD"}
@@ -1,22 +1,17 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import e from "../styles.module.js";
2
2
  import t from "clsx";
3
- import { forwardRef as m } from "react";
4
- import d from "../styles.module.css.js";
5
- const c = m(function({ className: r, ...i }, o) {
6
- return (
7
- // biome-ignore lint/a11y/noAriaHiddenOnFocusable: This is a decorative element
8
- /* @__PURE__ */ e(
9
- "hr",
10
- {
11
- "aria-hidden": "true",
12
- className: t(d.divider, r),
13
- ref: o,
14
- ...i
15
- }
16
- )
17
- );
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region designsystem/divider/divider.tsx
6
+ var i = n(function({ className: n, ...i }, a) {
7
+ return /* @__PURE__ */ r("hr", {
8
+ "aria-hidden": "true",
9
+ className: t(e.divider, n),
10
+ ref: a,
11
+ ...i
12
+ });
18
13
  });
19
- export {
20
- c as Divider
21
- };
22
- //# sourceMappingURL=divider.js.map
14
+ //#endregion
15
+ export { i as Divider };
16
+
17
+ //# sourceMappingURL=divider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"divider.js","sources":["../../designsystem/divider/divider.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DividerProps = React.ComponentPropsWithoutRef<\"hr\"> & {\n\t\"data-gap\"?:\n\t\t| \"0\"\n\t\t| \"1\"\n\t\t| \"2\"\n\t\t| \"3\"\n\t\t| \"4\"\n\t\t| \"5\"\n\t\t| \"6\"\n\t\t| \"7\"\n\t\t| \"8\"\n\t\t| \"9\"\n\t\t| \"10\"\n\t\t| \"11\"\n\t\t| \"12\"\n\t\t| \"13\"\n\t\t| \"14\"\n\t\t| \"15\"\n\t\t| \"18\"\n\t\t| \"22\"\n\t\t| \"26\"\n\t\t| \"30\"\n\t\t| 0\n\t\t| 1\n\t\t| 2\n\t\t| 3\n\t\t| 4\n\t\t| 5\n\t\t| 6\n\t\t| 7\n\t\t| 8\n\t\t| 9\n\t\t| 10\n\t\t| 11\n\t\t| 12\n\t\t| 13\n\t\t| 14\n\t\t| 15\n\t\t| 18\n\t\t| 22\n\t\t| 26\n\t\t| 30\n\t\t// Backwards compatibility:\n\t\t| \"none\"\n\t\t| \"xs\"\n\t\t| \"sm\"\n\t\t| \"md\"\n\t\t| \"lg\"\n\t\t| \"xl\";\n};\n\nexport const Divider = forwardRef<HTMLHRElement, DividerProps>(function Divider(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn (\n\t\t// biome-ignore lint/a11y/noAriaHiddenOnFocusable: This is a decorative element\n\t\t<hr\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={clsx(styles.divider, className)}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n});\n"],"names":["Divider","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAuDO,MAAMA,IAAUC,EAAwC,SAC9D,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAChBC,GACC;AACD;AAAA;AAAA,IAEC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,eAAY;AAAA,QACZ,WAAWC,EAAKC,EAAO,SAASL,CAAS;AAAA,QACzC,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA;AAGP,CAAC;"}
1
+ {"version":3,"file":"divider.js","names":[],"sources":["../../designsystem/divider/divider.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DividerProps = React.ComponentPropsWithoutRef<\"hr\"> & {\n\t\"data-gap\"?:\n\t\t| \"0\"\n\t\t| \"1\"\n\t\t| \"2\"\n\t\t| \"3\"\n\t\t| \"4\"\n\t\t| \"5\"\n\t\t| \"6\"\n\t\t| \"7\"\n\t\t| \"8\"\n\t\t| \"9\"\n\t\t| \"10\"\n\t\t| \"11\"\n\t\t| \"12\"\n\t\t| \"13\"\n\t\t| \"14\"\n\t\t| \"15\"\n\t\t| \"18\"\n\t\t| \"22\"\n\t\t| \"26\"\n\t\t| \"30\"\n\t\t| 0\n\t\t| 1\n\t\t| 2\n\t\t| 3\n\t\t| 4\n\t\t| 5\n\t\t| 6\n\t\t| 7\n\t\t| 8\n\t\t| 9\n\t\t| 10\n\t\t| 11\n\t\t| 12\n\t\t| 13\n\t\t| 14\n\t\t| 15\n\t\t| 18\n\t\t| 22\n\t\t| 26\n\t\t| 30\n\t\t// Backwards compatibility:\n\t\t| \"none\"\n\t\t| \"xs\"\n\t\t| \"sm\"\n\t\t| \"md\"\n\t\t| \"lg\"\n\t\t| \"xl\";\n};\n\nexport const Divider = forwardRef<HTMLHRElement, DividerProps>(function Divider(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn (\n\t\t// biome-ignore lint/a11y/noAriaHiddenOnFocusable: This is a decorative element\n\t\t<hr\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={clsx(styles.divider, className)}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n});\n"],"mappings":";;;;;AAuDA,IAAa,IAAU,EAAwC,SAC9D,EAAE,cAAW,GAAG,KAChB,GACC;CACD,OAEC,kBAAC,MAAD;EACC,eAAY;EACZ,WAAW,EAAK,EAAO,SAAS,CAAS;EACpC;EACL,GAAI;CACJ,CAAA;AAEH,CAAC"}
@@ -1,17 +1,15 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { forwardRef as t } from "react";
3
- import s from "../styles.module.css.js";
4
- import { toCustomElementProps as e } from "../utils.js";
5
- const n = t(function(r, o) {
6
- return /* @__PURE__ */ m(
7
- "ds-error-summary",
8
- {
9
- ref: o,
10
- ...e(r, s.errorsummary)
11
- }
12
- );
1
+ import e from "../styles.module.js";
2
+ import { toCustomElementProps as t } from "../utils.js";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region designsystem/errorsummary/errorsummary.tsx
6
+ var i = n(function(n, i) {
7
+ return /* @__PURE__ */ r("ds-error-summary", {
8
+ ref: i,
9
+ ...t(n, e.errorsummary)
10
+ });
13
11
  });
14
- export {
15
- n as Errorsummary
16
- };
17
- //# sourceMappingURL=errorsummary.js.map
12
+ //#endregion
13
+ export { i as Errorsummary };
14
+
15
+ //# sourceMappingURL=errorsummary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errorsummary.js","sources":["../../designsystem/errorsummary/errorsummary.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { DSErrorSummaryElement } from \"../\";\nimport type { CustomReactElementProps } from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type ErrorsummaryProps = CustomReactElementProps<DSErrorSummaryElement>;\n\nexport const Errorsummary = forwardRef<\n\tDSErrorSummaryElement,\n\tErrorsummaryProps\n>(function Errorsummary(rest, ref) {\n\treturn (\n\t\t<ds-error-summary\n\t\t\tref={ref}\n\t\t\t{...toCustomElementProps(rest, styles.errorsummary)}\n\t\t/>\n\t);\n});\n"],"names":["Errorsummary","forwardRef","rest","ref","jsx","toCustomElementProps","styles"],"mappings":";;;;AAQO,MAAMA,IAAeC,EAG1B,SAAsBC,GAAMC,GAAK;AAClC,SACC,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,KAAAD;AAAA,MACC,GAAGE,EAAqBH,GAAMI,EAAO,YAAY;AAAA,IAAA;AAAA,EAAA;AAGrD,CAAC;"}
1
+ {"version":3,"file":"errorsummary.js","names":[],"sources":["../../designsystem/errorsummary/errorsummary.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { DSErrorSummaryElement } from \"../\";\nimport type { CustomReactElementProps } from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\n\nexport type ErrorsummaryProps = CustomReactElementProps<DSErrorSummaryElement>;\n\nexport const Errorsummary = forwardRef<\n\tDSErrorSummaryElement,\n\tErrorsummaryProps\n>(function Errorsummary(rest, ref) {\n\treturn (\n\t\t<ds-error-summary\n\t\t\tref={ref}\n\t\t\t{...toCustomElementProps(rest, styles.errorsummary)}\n\t\t/>\n\t);\n});\n"],"mappings":";;;;;AAQA,IAAa,IAAe,EAG1B,SAAsB,GAAM,GAAK;CAClC,OACC,kBAAC,oBAAD;EACM;EACL,GAAI,EAAqB,GAAM,EAAO,YAAY;CAClD,CAAA;AAEH,CAAC"}
@@ -1,27 +1,24 @@
1
- import c from "../../../../point-in-polygon-hao/dist/esm/index.js";
2
- import { getCoord as g, getGeom as y } from "../../../invariant/dist/esm/index.js";
3
- function w(r, o, u = {}) {
4
- if (!r)
5
- throw new Error("point is required");
6
- if (!o)
7
- throw new Error("polygon is required");
8
- const n = g(r), i = y(o), a = i.type, s = o.bbox;
9
- let e = i.coordinates;
10
- if (s && m(n, s) === !1)
11
- return !1;
12
- a === "Polygon" && (e = [e]);
13
- let f = !1;
14
- for (var t = 0; t < e.length; ++t) {
15
- const l = c(n, e[t]);
16
- if (l === 0) return !u.ignoreBoundary;
17
- l && (f = !0);
18
- }
19
- return f;
1
+ import e from "../../../../point-in-polygon-hao/dist/esm/index.js";
2
+ import { getCoord as t, getGeom as n } from "../../../invariant/dist/esm/index.js";
3
+ //#region node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js
4
+ function r(r, a, o = {}) {
5
+ if (!r) throw Error("point is required");
6
+ if (!a) throw Error("polygon is required");
7
+ let s = t(r), c = n(a), l = c.type, u = a.bbox, d = c.coordinates;
8
+ if (u && i(s, u) === !1) return !1;
9
+ l === "Polygon" && (d = [d]);
10
+ let f = !1;
11
+ for (var p = 0; p < d.length; ++p) {
12
+ let t = e(s, d[p]);
13
+ if (t === 0) return !o.ignoreBoundary;
14
+ t && (f = !0);
15
+ }
16
+ return f;
20
17
  }
21
- function m(r, o) {
22
- return o[0] <= r[0] && o[1] <= r[1] && o[2] >= r[0] && o[3] >= r[1];
18
+ function i(e, t) {
19
+ return t[0] <= e[0] && t[1] <= e[1] && t[2] >= e[0] && t[3] >= e[1];
23
20
  }
24
- export {
25
- w as booleanPointInPolygon
26
- };
27
- //# sourceMappingURL=index.js.map
21
+ //#endregion
22
+ export { r as booleanPointInPolygon };
23
+
24
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js"],"sourcesContent":["// index.ts\nimport pip from \"point-in-polygon-hao\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nfunction booleanPointInPolygon(point, polygon, options = {}) {\n if (!point) {\n throw new Error(\"point is required\");\n }\n if (!polygon) {\n throw new Error(\"polygon is required\");\n }\n const pt = getCoord(point);\n const geom = getGeom(polygon);\n const type = geom.type;\n const bbox = polygon.bbox;\n let polys = geom.coordinates;\n if (bbox && inBBox(pt, bbox) === false) {\n return false;\n }\n if (type === \"Polygon\") {\n polys = [polys];\n }\n let result = false;\n for (var i = 0; i < polys.length; ++i) {\n const polyResult = pip(pt, polys[i]);\n if (polyResult === 0) return options.ignoreBoundary ? false : true;\n else if (polyResult) result = true;\n }\n return result;\n}\nfunction inBBox(pt, bbox) {\n return bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1];\n}\nvar index_default = booleanPointInPolygon;\nexport {\n booleanPointInPolygon,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"names":["booleanPointInPolygon","point","polygon","options","pt","getCoord","geom","getGeom","type","bbox","polys","inBBox","result","i","polyResult","pip"],"mappings":";;AAGA,SAASA,EAAsBC,GAAOC,GAASC,IAAU,CAAA,GAAI;AAC3D,MAAI,CAACF;AACH,UAAM,IAAI,MAAM,mBAAmB;AAErC,MAAI,CAACC;AACH,UAAM,IAAI,MAAM,qBAAqB;AAEvC,QAAME,IAAKC,EAASJ,CAAK,GACnBK,IAAOC,EAAQL,CAAO,GACtBM,IAAOF,EAAK,MACZG,IAAOP,EAAQ;AACrB,MAAIQ,IAAQJ,EAAK;AACjB,MAAIG,KAAQE,EAAOP,GAAIK,CAAI,MAAM;AAC/B,WAAO;AAET,EAAID,MAAS,cACXE,IAAQ,CAACA,CAAK;AAEhB,MAAIE,IAAS;AACb,WAASC,IAAI,GAAGA,IAAIH,EAAM,QAAQ,EAAEG,GAAG;AACrC,UAAMC,IAAaC,EAAIX,GAAIM,EAAMG,CAAC,CAAC;AACnC,QAAIC,MAAe,EAAG,QAAO,CAAAX,EAAQ;AAChC,IAAIW,MAAYF,IAAS;AAAA,EAChC;AACA,SAAOA;AACT;AACA,SAASD,EAAOP,GAAIK,GAAM;AACxB,SAAOA,EAAK,CAAC,KAAKL,EAAG,CAAC,KAAKK,EAAK,CAAC,KAAKL,EAAG,CAAC,KAAKK,EAAK,CAAC,KAAKL,EAAG,CAAC,KAAKK,EAAK,CAAC,KAAKL,EAAG,CAAC;AACpF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","names":["pip"],"sources":["../../../../../../node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js"],"sourcesContent":["// index.ts\nimport pip from \"point-in-polygon-hao\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nfunction booleanPointInPolygon(point, polygon, options = {}) {\n if (!point) {\n throw new Error(\"point is required\");\n }\n if (!polygon) {\n throw new Error(\"polygon is required\");\n }\n const pt = getCoord(point);\n const geom = getGeom(polygon);\n const type = geom.type;\n const bbox = polygon.bbox;\n let polys = geom.coordinates;\n if (bbox && inBBox(pt, bbox) === false) {\n return false;\n }\n if (type === \"Polygon\") {\n polys = [polys];\n }\n let result = false;\n for (var i = 0; i < polys.length; ++i) {\n const polyResult = pip(pt, polys[i]);\n if (polyResult === 0) return options.ignoreBoundary ? false : true;\n else if (polyResult) result = true;\n }\n return result;\n}\nfunction inBBox(pt, bbox) {\n return bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1];\n}\nvar index_default = booleanPointInPolygon;\nexport {\n booleanPointInPolygon,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAGA,SAAS,EAAsB,GAAO,GAAS,IAAU,CAAC,GAAG;CAC3D,IAAI,CAAC,GACH,MAAU,MAAM,mBAAmB;CAErC,IAAI,CAAC,GACH,MAAU,MAAM,qBAAqB;CAEvC,IAAM,IAAK,EAAS,CAAK,GACnB,IAAO,EAAQ,CAAO,GACtB,IAAO,EAAK,MACZ,IAAO,EAAQ,MACjB,IAAQ,EAAK;CACjB,IAAI,KAAQ,EAAO,GAAI,CAAI,MAAM,IAC/B,OAAO;CAET,AAAI,MAAS,cACX,IAAQ,CAAC,CAAK;CAEhB,IAAI,IAAS;CACb,KAAK,IAAI,IAAI,GAAG,IAAI,EAAM,QAAQ,EAAE,GAAG;EACrC,IAAM,IAAaA,EAAI,GAAI,EAAM,EAAE;EACnC,IAAI,MAAe,GAAG,OAAO,GAAQ;EAChC,AAAI,MAAY,IAAS;CAChC;CACA,OAAO;AACT;AACA,SAAS,EAAO,GAAI,GAAM;CACxB,OAAO,EAAK,MAAM,EAAG,MAAM,EAAK,MAAM,EAAG,MAAM,EAAK,MAAM,EAAG,MAAM,EAAK,MAAM,EAAG;AACnF"}