@stihl-design-system/components 1.0.0-RC.41 → 1.0.0-RC.43

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 (167) hide show
  1. package/{accordion.CiiPLwYQ.js → accordion.CJYNJWAm.js} +2 -2
  2. package/action-card-example-image-1.webp +0 -0
  3. package/{actionbutton.DKb4ph1c.js → actionbutton.BLKEsCUm.js} +3 -3
  4. package/actioncard.WFXhVqOa.js +9 -0
  5. package/actioncard.d.ts +2 -0
  6. package/{actionlink.DEGta2h9.js → actionlink.xJDPIikL.js} +3 -3
  7. package/arialiveregions.BF6mUlPU.js +23 -0
  8. package/assets/ActionCard.C85bSGRa.css +1 -0
  9. package/assets/LinkCard.fwyPSY19.css +1 -0
  10. package/assets/Toast.CGl8z6mX.css +1 -0
  11. package/assets/filelist.CHVupL8T.css +1 -0
  12. package/assets/filepreview.2cdH-1Xs.css +1 -0
  13. package/assets/progressindicator.Cbbzo5-b.css +1 -0
  14. package/{banner.S_c1UQJe.js → banner.CYahlug-.js} +1 -1
  15. package/{breadcrumb.DiuuVblR.js → breadcrumb.Bg86bTsh.js} +3 -3
  16. package/{button.Z7Mmvwhv.js → button.oshwTInZ.js} +4 -4
  17. package/{buttonround.Bqi8Ej-y.js → buttonround.CPTvQIcE.js} +3 -3
  18. package/{checkbox.DtSSduSH.js → checkbox.BTnK5VzM.js} +3 -3
  19. package/{checkboxgroup.CSP1DOCW.js → checkboxgroup.DESMv2S7.js} +2 -2
  20. package/{chip.CyypeY5M.js → chip.BWL_yfeA.js} +3 -3
  21. package/chipgroup.DvoNDnTN.js +213 -0
  22. package/chunks/{Accordion.Q50G9LZ3.js → Accordion.D4jj5_nA.js} +1 -1
  23. package/chunks/{ActionButton.BEMy35Lh.js → ActionButton.BOKt8109.js} +2 -2
  24. package/chunks/ActionCard.oi3u27DL.js +242 -0
  25. package/chunks/{ActionLink.DECHT42B.js → ActionLink.BFwVQSTh.js} +2 -2
  26. package/chunks/AriaLiveRegions.utils.8ofDlHnN.js +65 -0
  27. package/chunks/{Breadcrumb.nflDJoKs.js → Breadcrumb.ClHgevZX.js} +2 -2
  28. package/chunks/{Button.DpGeheky.js → Button.BdqkFovu.js} +3 -3
  29. package/chunks/{Checkbox.B3NeB54s.js → Checkbox.vdWpXSUh.js} +2 -2
  30. package/chunks/{CheckboxGroup.BYZSvqF7.js → CheckboxGroup.BtVBLux3.js} +2 -2
  31. package/chunks/Chip.B_zwA2qc.js +157 -0
  32. package/chunks/{CustomReactSelect.DBsnmMPl.js → CustomReactSelect.Dtf3mXJ_.js} +4 -4
  33. package/chunks/{Dialog.C-rcs_Up.js → Dialog.9tejL9sZ.js} +1 -1
  34. package/chunks/{Drawer.D0d557c5.js → Drawer.DIFMs4Gh.js} +1 -1
  35. package/chunks/{Fieldset.7WM7w62l.js → Fieldset.8jatF24R.js} +2 -2
  36. package/chunks/Icon.BoxUJQDT.js +232 -0
  37. package/chunks/InputFile.zbXRpklU.js +260 -0
  38. package/chunks/{InputNumber.a44HnJ9B.js → InputNumber.d7gmAHaX.js} +3 -3
  39. package/chunks/{InputPassword.B1E0Maub.js → InputPassword.Cz41hBCt.js} +3 -3
  40. package/chunks/{InputSearch.C7AvD7Eu.js → InputSearch.DPQCT8Yo.js} +3 -3
  41. package/chunks/{LinkButton.CMjq2FKc.js → LinkButton.BGQOwjnE.js} +2 -2
  42. package/chunks/LinkCard.DRATPHdd.js +178 -0
  43. package/chunks/{NavigationTabList.ltT6igtk.js → NavigationTabList.Cf6csU_F.js} +1 -1
  44. package/chunks/{NavigationTabs.DsVepb7H.js → NavigationTabs.CSTtXPxd.js} +1 -1
  45. package/chunks/{Notification.COwLndR0.js → Notification.ChSYPU3r.js} +2 -2
  46. package/chunks/Popover.BSL3AilG.js +221 -0
  47. package/chunks/{RadioGroup.B-qTH31u.js → RadioGroup.DauFXAk6.js} +1 -1
  48. package/chunks/{Select.DrDVi9lg.js → Select.CWA7DHcL.js} +3 -3
  49. package/chunks/{Slider.DGMrDfWv.js → Slider.2ltYhUJb.js} +2 -2
  50. package/chunks/Stepper.Dh69BOVR.js +146 -0
  51. package/chunks/{SystemFeedback.DFN6Y2cw.js → SystemFeedback.C2XFC5WN.js} +1 -1
  52. package/chunks/{Tabs.DfH2q9EL.js → Tabs.BvwiBlXt.js} +1 -1
  53. package/chunks/{Textarea.ymNCbcvH.js → Textarea.Ck0sw4SI.js} +2 -2
  54. package/chunks/Toast.Ck4woVuy.js +76 -0
  55. package/chunks/battery-return.tBu7C6Q7.js +10 -0
  56. package/chunks/cookie.U09gK6it.js +10 -0
  57. package/chunks/credit-card.BmIN7RQ3.js +10 -0
  58. package/chunks/legal-info.-S9gzFzc.js +10 -0
  59. package/chunks/legal.CVCmbA3m.js +10 -0
  60. package/chunks/present.B4ImIJxi.js +10 -0
  61. package/chunks/return-package.Bt9FUc42.js +10 -0
  62. package/{combobox.DzSEFo_5.js → combobox.zkQtaMOE.js} +1 -1
  63. package/components/ActionButton/ActionButton.d.ts +1 -1
  64. package/components/ActionCard/ActionCard.d.ts +75 -0
  65. package/components/ActionCard/ActionCard.utils.d.ts +24 -0
  66. package/components/AriaLiveRegions/AriaLiveRegions.d.ts +22 -1
  67. package/components/AriaLiveRegions/AriaLiveRegions.test.d.ts +1 -0
  68. package/components/AriaLiveRegions/AriaLiveRegions.utils.d.ts +106 -0
  69. package/components/Breadcrumb/Breadcrumb.d.ts +1 -1
  70. package/components/Button/Button.d.ts +1 -1
  71. package/components/ChipGroup/ChipGroup.utils.d.ts +14 -15
  72. package/components/Icon/Icon.d.ts +1 -1
  73. package/components/InputFile/FileList/FileList.d.ts +14 -0
  74. package/components/InputFile/FileList/FileList.test.d.ts +1 -0
  75. package/components/{FileList → InputFile/FileList}/FileList.utils.d.ts +0 -6
  76. package/components/InputFile/FileList/FileList.utils.test.d.ts +1 -0
  77. package/components/InputFile/FileList/FilePreview/FilePreview.d.ts +15 -0
  78. package/components/InputFile/FileList/FilePreview/FilePreview.test.d.ts +1 -0
  79. package/components/InputFile/FileList/FilePreview/FilePreview.utils.d.ts +11 -0
  80. package/components/InputFile/FileList/FilePreview/FilePreview.utils.test.d.ts +1 -0
  81. package/components/InputFile/FileList/ProgressIndicator/ProgressIndicator.d.ts +34 -0
  82. package/components/InputFile/FileList/ProgressIndicator/ProgressIndicator.test.d.ts +1 -0
  83. package/components/InputFile/InputFile.d.ts +49 -15
  84. package/components/InputFile/InputFile.utils.d.ts +14 -0
  85. package/components/LinkButton/LinkButton.d.ts +1 -1
  86. package/components/LinkCard/LinkCard.d.ts +16 -4
  87. package/components/Logo/Logo.d.ts +1 -1
  88. package/components/NavigationTabs/NavigationTabs.d.ts +1 -1
  89. package/components/Spinner/Spinner.d.ts +1 -1
  90. package/components/Stepper/Stepper.d.ts +1 -1
  91. package/components/Stepper/Stepper.utils.d.ts +0 -1
  92. package/components/Switch/Switch.d.ts +1 -1
  93. package/components/Tabs/TabList/TabList.d.ts +1 -1
  94. package/components/Toast/ToastManager.utils.d.ts +0 -1
  95. package/components/TopBar/TopBar.d.ts +1 -1
  96. package/{customreactselect.D7YraWJ7.js → customreactselect.DbPXuk-C.js} +5 -5
  97. package/{dialog.CBovd8em.js → dialog.wzLHG12h.js} +2 -2
  98. package/{drawer.D5F0KXI2.js → drawer.DnHZCC60.js} +2 -2
  99. package/{fieldset.DgbZ_K_l.js → fieldset.DUU39krR.js} +3 -3
  100. package/filelist.d.ts +1 -1
  101. package/filelist.zRCzEN5D.js +128 -0
  102. package/filepreview.CK8DA0aR.js +94 -0
  103. package/filepreview.d.ts +2 -0
  104. package/{flag.D-wrUioF.js → flag.02uD-ADh.js} +1 -1
  105. package/{floatingactionbutton.CE-Rz0dx.js → floatingactionbutton.BwmRfmD_.js} +3 -3
  106. package/{icon.ByLYRkPZ.js → icon.DFM8rDOR.js} +1 -1
  107. package/index.d.ts +3 -0
  108. package/index.es.js +233 -219
  109. package/{input.MZXe6rlg.js → input.yBU7wjmW.js} +4 -4
  110. package/inputfile.BRt_BWK8.js +18 -0
  111. package/{inputnumber.DevQudIX.js → inputnumber.B0yCOPU1.js} +4 -4
  112. package/{inputpassword.C-XYK-JP.js → inputpassword.aQxGIeyf.js} +4 -4
  113. package/{inputsearch.CmJdxnzX.js → inputsearch.EbZnS29c.js} +4 -4
  114. package/{link.R1lfD5aN.js → link.Ck9Yd2y2.js} +3 -3
  115. package/{linkbutton.Y-ET1tc9.js → linkbutton.DzbJ1ws2.js} +3 -3
  116. package/{linkcard.CayqoQNo.js → linkcard.D65tvntF.js} +3 -3
  117. package/{navigationtablist.Cd9hZzFQ.js → navigationtablist.BMvJp48M.js} +2 -2
  118. package/{navigationtabs.DHG-TeF2.js → navigationtabs.BzYhrLVd.js} +2 -2
  119. package/{notification.u_LLz-O0.js → notification.B80f3Sh6.js} +3 -3
  120. package/{optioncheckbox.v8Plcgeg.js → optioncheckbox.DvF4Vr4C.js} +1 -1
  121. package/package.json +2 -2
  122. package/partials/index.js +15 -9
  123. package/partials/lib/partials.d.ts +1 -1
  124. package/{popover.T7-imfkx.js → popover.BR8IGyhi.js} +4 -3
  125. package/product-card-example-1.webp +0 -0
  126. package/product-card-example-2.webp +0 -0
  127. package/product-card-example-3.webp +0 -0
  128. package/product-card-example-4.webp +0 -0
  129. package/progressindicator.DYKf69nk.js +53 -0
  130. package/progressindicator.d.ts +2 -0
  131. package/{radiogroup.CAh4wto1.js → radiogroup.Cniqm1t0.js} +2 -2
  132. package/{scroller.DfhhZelk.js → scroller.CSSI5khP.js} +1 -1
  133. package/{select.CSCc_-6d.js → select.DPfXPv-k.js} +4 -4
  134. package/{skiptocontent.C2HpZt5q.js → skiptocontent.C_nrEIVL.js} +1 -1
  135. package/{slider.B2aQwfc2.js → slider.CyRU5Kys.js} +3 -3
  136. package/{spinner.CRVyui04.js → spinner.ww3wgdUU.js} +1 -1
  137. package/{step.C-LC5sKQ.js → step.C4gOI6c3.js} +2 -2
  138. package/{stepper.CRljfUF8.js → stepper.Bqdr6GS-.js} +4 -4
  139. package/{switch.DgKgzm-j.js → switch.DpYvgNSE.js} +2 -2
  140. package/{systemfeedback.BKLsE5sY.js → systemfeedback.g7odUaLC.js} +2 -2
  141. package/{tablist.DPiNeY3_.js → tablist.DLFJGmYV.js} +3 -3
  142. package/{tabs.Cxzm6ZZ-.js → tabs.Bne3Z3rz.js} +2 -2
  143. package/{textarea.CDXY-OVz.js → textarea.DcAoKkta.js} +3 -3
  144. package/{toast.Bev-Rfuw.js → toast.C_O0xDYn.js} +3 -3
  145. package/toastmanager.w_mhIehC.js +79 -0
  146. package/tooltip.C6HKano9.js +184 -0
  147. package/types/icon-types.d.ts +1 -1
  148. package/arialiveregions.B0AV2JcV.js +0 -18
  149. package/assets/LinkCard.C6HtgbjH.css +0 -1
  150. package/assets/Toast.DgRXxA0s.css +0 -1
  151. package/assets/filelist.H_wKcSPX.css +0 -1
  152. package/chipgroup.CSjQHeeW.js +0 -199
  153. package/chunks/AriaLiveRegions.utils.CLpOaVD9.js +0 -27
  154. package/chunks/Chip.SiGIIHR-.js +0 -133
  155. package/chunks/Icon.m6sMB6vl.js +0 -232
  156. package/chunks/InputFile.DRGNdtY0.js +0 -236
  157. package/chunks/LinkCard.CJ5P0ews.js +0 -199
  158. package/chunks/Popover.C5wtha5l.js +0 -214
  159. package/chunks/Stepper.DptsFh5n.js +0 -152
  160. package/chunks/Toast.RUzRjojQ.js +0 -76
  161. package/components/FileList/FileList.d.ts +0 -13
  162. package/filelist.CDEBo3Pi.js +0 -160
  163. package/inputfile.BO4wDnzQ.js +0 -18
  164. package/toastmanager.DII20_9k.js +0 -89
  165. package/tooltip._lP4aMV2.js +0 -177
  166. /package/components/{FileList/FileList.test.d.ts → ActionCard/ActionCard.test.d.ts} +0 -0
  167. /package/components/{FileList/FileList.utils.test.d.ts → ActionCard/ActionCard.utils.test.d.ts} +0 -0
@@ -1,160 +0,0 @@
1
- "use client";
2
- import { jsx as o, jsxs as w } from "react/jsx-runtime";
3
- import { d as P } from "./chunks/index.cKLI89Eg.js";
4
- import { D as k } from "./chunks/Button.DpGeheky.js";
5
- import { D as u } from "./chunks/Icon.m6sMB6vl.js";
6
- import { D as S } from "./chunks/SystemFeedback.DFN6Y2cw.js";
7
- import { c as j } from "./chunks/index.DQOqod3i.js";
8
- import './assets/filelist.H_wKcSPX.css';const F = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), z = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), y = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), C = /[^\p{L}\d]+/giu, I = "$1\0$2", E = "";
9
- function N(t) {
10
- let e = t.trim();
11
- e = e.replace(F, I).replace(z, I), e = e.replace(C, "\0");
12
- let a = 0, s = e.length;
13
- for (; e.charAt(a) === "\0"; )
14
- a++;
15
- if (a === s)
16
- return [];
17
- for (; e.charAt(s - 1) === "\0"; )
18
- s--;
19
- return e.slice(a, s).split(/\0/g);
20
- }
21
- function A(t) {
22
- const e = N(t);
23
- for (let a = 0; a < e.length; a++) {
24
- const s = e[a], c = y.exec(s);
25
- if (c) {
26
- const i = c.index + (c[1] ?? c[2]).length;
27
- e.splice(a, 1, s.slice(0, i), s.slice(i));
28
- }
29
- }
30
- return e;
31
- }
32
- function D(t, e) {
33
- const [a, s, c] = q(t, e);
34
- return a + s.map(U(e?.locale)).join(e?.delimiter ?? " ") + c;
35
- }
36
- function T(t, e) {
37
- return D(t, { delimiter: "-", ...e });
38
- }
39
- function U(t) {
40
- return t === !1 ? (e) => e.toLowerCase() : (e) => e.toLocaleLowerCase(t);
41
- }
42
- function q(t, e = {}) {
43
- const a = e.split ?? (e.separateNumbers ? A : N), s = e.prefixCharacters ?? E, c = e.suffixCharacters ?? E;
44
- let i = 0, f = t.length;
45
- for (; i < t.length; ) {
46
- const d = t.charAt(i);
47
- if (!s.includes(d))
48
- break;
49
- i++;
50
- }
51
- for (; f > i; ) {
52
- const d = f - 1, x = t.charAt(d);
53
- if (!c.includes(x))
54
- break;
55
- f = d;
56
- }
57
- return [
58
- t.slice(0, i),
59
- a(t.slice(i, f)),
60
- t.slice(f)
61
- ];
62
- }
63
- const W = "ds-file-list_root_qx1ja_1", $ = "ds-file-list_file-wrapper_qx1ja_7", O = "ds-file-list_file-wrapper--invalid_qx1ja_16", B = "ds-file-list_file-icon_qx1ja_19", X = "ds-file-list_preview_qx1ja_25", M = "ds-file-list_file-details_qx1ja_31", G = "ds-file-list_file-name_qx1ja_45", H = "ds-file-list_file-size_qx1ja_49", K = "ds-file-list_feedback_qx1ja_65", l = {
64
- root: W,
65
- fileWrapper: $,
66
- fileWrapperInvalid: O,
67
- fileIcon: B,
68
- preview: X,
69
- fileDetails: M,
70
- fileName: G,
71
- fileSize: H,
72
- feedback: K
73
- }, V = (t) => t >= 1024 * 1024 ? (t / (1024 * 1024)).toFixed(1) + " MB" : t >= 1024 ? (t / 1024).toFixed(0) + " KB" : t + " B", J = {
74
- nonDisplayableImages: ["heic", "heif", "raw", "cr2", "cr3", "nef", "arw", "orf", "rw2", "dng", "svgz", "jp2", "jxl", "dds", "exr", "psd", "ai", "indd"],
75
- documents: [
76
- "doc",
77
- "docx",
78
- "odt",
79
- "fodt",
80
- "gdoc",
81
- "rtf",
82
- "dot",
83
- "dotx",
84
- "pages",
85
- "wpd",
86
- "abw",
87
- "tmd",
88
- "lwp",
89
- "wps",
90
- "wks",
91
- // Excel and spreadsheet formats
92
- "xls",
93
- "xlsx",
94
- "xlsm",
95
- "xlsb",
96
- "xlt",
97
- "xltx",
98
- "ods",
99
- "fods",
100
- "csv",
101
- "tsv",
102
- "gsheet"
103
- ],
104
- videos: ["mp4", "m4v", "mov", "webm", "ogv", "avi", "wmv", "flv", "f4v", "mkv", "3gp", "3g2", "ts", "vob", "rm", "rmvb", "mpeg", "mpg"],
105
- archives: ["zip", "rar", "7z", "tar", "gz", "tar.gz", "tgz", "xz", "tar.xz", "bz2", "tar.bz2", "lzma", "cab", "iso"]
106
- }, ae = (t) => {
107
- const e = P.c(17), {
108
- files: a,
109
- onRemoveFile: s,
110
- fileListItemRemoveButtonProps: c,
111
- t: i
112
- } = t;
113
- let f;
114
- e[0] !== c ? (f = c === void 0 ? {} : c, e[0] = c, e[1] = f) : f = e[1];
115
- const d = f, x = Q;
116
- let b;
117
- e[2] !== i ? (b = (n) => {
118
- const r = n.name.split(".").pop()?.toLowerCase() || "", {
119
- nonDisplayableImages: p,
120
- documents: h,
121
- videos: g,
122
- archives: L
123
- } = J;
124
- return n.type.startsWith("image/") ? p.includes(r) ? /* @__PURE__ */ o(u, { name: "file-type-image", className: l.fileIcon }) : /* @__PURE__ */ o("img", { src: URL.createObjectURL(n), alt: `${i("fileListPreviewAltText")} ${n.name}`, className: l.preview }) : h.includes(r) ? /* @__PURE__ */ o(u, { name: "file-type-doc", className: l.fileIcon }) : n.type === "application/pdf" ? /* @__PURE__ */ o(u, { name: "file-type-pdf", className: l.fileIcon }) : n.type.startsWith("video/") && g.includes(r) ? /* @__PURE__ */ o(u, { name: "file-type-video", className: l.fileIcon }) : L.includes(r) ? /* @__PURE__ */ o(u, { name: "file-type-zip", className: l.fileIcon }) : /* @__PURE__ */ o(u, { name: "file", className: l.fileIcon });
125
- }, e[2] = i, e[3] = b) : b = e[3];
126
- const v = b;
127
- let m;
128
- if (e[4] !== d || e[5] !== a || e[6] !== v || e[7] !== s || e[8] !== i) {
129
- let n;
130
- e[10] !== d || e[11] !== v || e[12] !== s || e[13] !== i ? (n = (r, p) => {
131
- const h = Object.fromEntries(Object.entries(d).map((g) => {
132
- const [L, R] = g;
133
- return [L, `${R}-${p}`];
134
- }));
135
- return /* @__PURE__ */ w("div", { className: j(l.fileWrapper, {
136
- [l.fileWrapperInvalid]: r.feedback
137
- }), children: [
138
- v(r),
139
- /* @__PURE__ */ w("div", { className: l.fileDetails, children: [
140
- /* @__PURE__ */ o("span", { className: l.fileName, children: r.name }),
141
- /* @__PURE__ */ o("span", { className: l.fileSize, children: V(r.size) })
142
- ] }),
143
- /* @__PURE__ */ w(k, { ...h, className: l.removeButton, onClick: () => s(p), hideLabel: !0, iconName: "cross", size: "small", variant: "ghost", type: "button", "aria-describedby": r.feedback ? x(r.name) : void 0, "aria-invalid": r.feedback ? !0 : void 0, children: [
144
- i("fileListRemoveSelectionButtonLabel", [r.name]),
145
- "."
146
- ] }),
147
- r.feedback && /* @__PURE__ */ o(S, { variant: "error", id: x(r.name), message: r.feedback, className: l.feedback }, p)
148
- ] }, p);
149
- }, e[10] = d, e[11] = v, e[12] = s, e[13] = i, e[14] = n) : n = e[14], m = a.map(n), e[4] = d, e[5] = a, e[6] = v, e[7] = s, e[8] = i, e[9] = m;
150
- } else
151
- m = e[9];
152
- let _;
153
- return e[15] !== m ? (_ = /* @__PURE__ */ o("div", { className: l.root, children: m }), e[15] = m, e[16] = _) : _ = e[16], _;
154
- };
155
- function Q(t) {
156
- return `file-feedback-${T(t)}`;
157
- }
158
- export {
159
- ae as FileList
160
- };
@@ -1,18 +0,0 @@
1
- "use client";
2
- import "react/jsx-runtime";
3
- import "./chunks/index.DQOqod3i.js";
4
- import "react";
5
- import "./chunks/translate.nuU7uChI.js";
6
- import "./chunks/useBreakpoint.1txsny17.js";
7
- import "./chunks/index.cKLI89Eg.js";
8
- import "./chunks/AriaLiveRegions.utils.CLpOaVD9.js";
9
- import "./asterisk.Dwtdwpkq.js";
10
- import "./chunks/Button.DpGeheky.js";
11
- import "./filelist.CDEBo3Pi.js";
12
- import "./chunks/Icon.m6sMB6vl.js";
13
- import "./chunks/Popover.C5wtha5l.js";
14
- import "./chunks/SystemFeedback.DFN6Y2cw.js";
15
- import { D as x } from "./chunks/InputFile.DRGNdtY0.js";
16
- export {
17
- x as DSInputFile
18
- };
@@ -1,89 +0,0 @@
1
- "use client";
2
- import { jsxs as P, jsx as y } from "react/jsx-runtime";
3
- import { createContext as C, useContext as O, useState as g, useRef as _, useEffect as p, useMemo as U } from "react";
4
- import { g as u } from "./chunks/helpers.CexwVao7.js";
5
- import "./chunks/index.cKLI89Eg.js";
6
- import { b as A, g as w } from "./chunks/AriaLiveRegions.utils.CLpOaVD9.js";
7
- import { D as j, s as q } from "./chunks/Toast.RUzRjojQ.js";
8
- import { h as Q } from "./chunks/has-window.ut_-aShB.js";
9
- const k = () => {
10
- if (!A() || !w())
11
- throw new Error(u("DSToast", 'The DSAriaLiveRegions component has to be placed at the root of your application, as close to the "body" as possible, e.g. in your "App.tsx" or "layout.tsx".'));
12
- }, B = () => {
13
- if (!Q)
14
- return;
15
- if (document.querySelectorAll("[data-ds-toast]").length > 1)
16
- throw new Error(u("DSToast", 'The destructured "toast" element should only be used once in the DOM.'));
17
- }, i = "data-ds-toast-timeout-id", S = "closing", G = 1e4, D = C(void 0), K = () => {
18
- const r = O(D);
19
- if (!r)
20
- throw new Error(u("DSToastProvider", "useDSToast must be used within a <DSToastProvider />, which wraps around your root component."));
21
- return r;
22
- }, X = ({
23
- children: r
24
- }) => {
25
- const [a, c] = g([]), [o, l] = g(null), e = _(null);
26
- p(() => {
27
- !o && a.length > 0 && setTimeout(() => {
28
- l(a[0]);
29
- });
30
- }, [a]), p(() => {
31
- o && (x(o.message, o.variant), I());
32
- }, [o]);
33
- const m = () => e.current?.getAttribute(i) || null, T = (t) => {
34
- e.current?.setAttribute(i, t);
35
- }, E = () => e.current?.removeAttribute(i), x = (t, s) => {
36
- if (s === "warning") {
37
- const n = A();
38
- n && (n.innerText = t);
39
- } else if (s === "success" || s === "info") {
40
- const n = w();
41
- n && (n.innerText = t);
42
- }
43
- }, d = (t, s) => {
44
- k();
45
- const n = {
46
- message: t,
47
- hideIcon: s?.hideIcon,
48
- variant: s?.variant || "info",
49
- ...s,
50
- onClick: () => {
51
- v();
52
- },
53
- onMouseEnter: L,
54
- onMouseLeave: M
55
- };
56
- c((b) => [...b, n]);
57
- }, L = () => {
58
- f();
59
- }, f = () => {
60
- const t = m();
61
- t && (clearTimeout(t), e.current?.removeAttribute(i));
62
- }, h = () => {
63
- const t = setTimeout(() => {
64
- v();
65
- }, G);
66
- T(String(t));
67
- }, M = () => {
68
- m() !== S && e.current && h();
69
- }, I = () => {
70
- B(), o && e.current?.showPopover && (e.current.showPopover(), h());
71
- }, v = () => {
72
- f(), T(S), e.current && (e.current.addEventListener("animationend", () => {
73
- e.current?.hidePopover && (e.current.hidePopover(), E(), e.current = null, c((t) => t.slice(1)), l(null));
74
- }, {
75
- once: !0
76
- // removes event listener after being called once
77
- }), e.current.classList.add(q.rootClosing));
78
- }, R = U(() => ({
79
- queueDSToastMessage: d
80
- }), [d]);
81
- return /* @__PURE__ */ P(D.Provider, { value: R, children: [
82
- o ? /* @__PURE__ */ y(j, { ...o, ref: e }) : null,
83
- r
84
- ] });
85
- };
86
- export {
87
- X as DSToastProvider,
88
- K as useDSToast
89
- };
@@ -1,177 +0,0 @@
1
- "use client";
2
- import { jsx as k } from "react/jsx-runtime";
3
- import { d as S } from "./chunks/index.cKLI89Eg.js";
4
- import { isValidElement as V, useState as G, createContext as J, forwardRef as U, cloneElement as K, useContext as L } from "react";
5
- import { j as Q, o as W, s as X, a as Y, u as Z, m as tt, n as et, c as ot, d as st, e as nt, f as H, g as lt, i as it } from "./chunks/floating-ui.react.CP5A99-c.js";
6
- import { c as ct } from "./chunks/index.DQOqod3i.js";
7
- import { g as y, c as I } from "./chunks/helpers.CexwVao7.js";
8
- import './assets/tooltip.BPcysHGE.css';const rt = "ds-tooltip_tooltip_503ch_5", at = {
9
- tooltip: rt
10
- };
11
- function pt(s) {
12
- const t = S.c(24), {
13
- initialOpen: e,
14
- placement: o,
15
- isOpen: r,
16
- tooltipOffset: n,
17
- onOpenChange: u
18
- } = s === void 0 ? {} : s, a = e === void 0 ? !1 : e, l = o === void 0 ? "top" : o, i = n === void 0 ? 6 : n, [x, T] = G(a), p = r ?? x, d = u ?? T, O = "fixed", w = Y, v = W(i), C = Q({
19
- crossAxis: l.includes("-"),
20
- fallbackAxisSideDirection: "start",
21
- padding: i
22
- }), m = X({
23
- padding: i
24
- });
25
- let c;
26
- t[0] !== v || t[1] !== C || t[2] !== m ? (c = [v, C, m], t[0] = v, t[1] = C, t[2] = m, t[3] = c) : c = t[3];
27
- let g;
28
- t[4] !== p || t[5] !== l || t[6] !== d || t[7] !== w || t[8] !== c ? (g = {
29
- placement: l,
30
- open: p,
31
- strategy: O,
32
- onOpenChange: d,
33
- whileElementsMounted: w,
34
- middleware: c
35
- }, t[4] = p, t[5] = l, t[6] = d, t[7] = w, t[8] = c, t[9] = g) : g = t[9];
36
- const f = Z(g), h = f.context;
37
- let E;
38
- t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = {
39
- move: !1,
40
- enabled: !0,
41
- mouseOnly: !0,
42
- delay: {
43
- open: 400,
44
- close: 0
45
- }
46
- }, t[10] = E) : E = t[10];
47
- const P = tt(h, E);
48
- let A;
49
- t[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = {
50
- enabled: !0
51
- }, t[11] = A) : A = t[11];
52
- const D = et(h, A), R = ot(h);
53
- let _;
54
- t[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = {
55
- role: "tooltip"
56
- }, t[12] = _) : _ = t[12];
57
- const M = st(h, _);
58
- let N;
59
- t[13] !== R || t[14] !== D || t[15] !== P || t[16] !== M ? (N = [P, D, R, M], t[13] = R, t[14] = D, t[15] = P, t[16] = M, t[17] = N) : N = t[17];
60
- const $ = nt(N);
61
- let b;
62
- return t[18] !== f || t[19] !== $ || t[20] !== p || t[21] !== d || t[22] !== i ? (b = {
63
- open: p,
64
- tooltipOffset: i,
65
- setOpen: d,
66
- ...$,
67
- ...f
68
- }, t[18] = f, t[19] = $, t[20] = p, t[21] = d, t[22] = i, t[23] = b) : b = t[23], b;
69
- }
70
- const ft = (s) => {
71
- if (!V(s))
72
- throw new Error(y("Tooltip", "Tooltip.Anchor child must be a valid React element."));
73
- }, dt = ({
74
- children: s,
75
- hasContent: t,
76
- hasAnchor: e
77
- }) => {
78
- if (!s)
79
- throw new Error(y("Tooltip", "A Tooltip must have children."));
80
- if (!t)
81
- throw new Error(y("Tooltip", "A Tooltip must have a <Tooltip.Content> component as a child. Please add it to the children of Tooltip."));
82
- if (!e)
83
- throw new Error(y("Tooltip", "A Tooltip must have a <Tooltip.Anchor> component as a child. Please add it to the children of Tooltip."));
84
- }, q = J(null), z = () => {
85
- const s = L(q);
86
- if (s == null)
87
- throw new Error(y("Tooltip", "Components like Tooltip.Anchor or Tooltip.Content must be wrapped in <Tooltip />."));
88
- return s;
89
- }, F = (s) => {
90
- const t = S.c(9);
91
- let e, o;
92
- t[0] !== s ? ({
93
- children: e,
94
- ...o
95
- } = s, t[0] = s, t[1] = e, t[2] = o) : (e = t[1], o = t[2]);
96
- let r;
97
- t[3] !== o ? (r = {
98
- ...o
99
- }, t[3] = o, t[4] = r) : r = t[4];
100
- const n = pt(r), u = I(e, F.Content), a = I(e, j);
101
- process.env.NODE_ENV !== "production" && dt({
102
- children: e,
103
- hasContent: u,
104
- hasAnchor: a
105
- });
106
- let l;
107
- return t[5] !== e || t[6] !== o || t[7] !== n ? (l = /* @__PURE__ */ k(q.Provider, { value: n, ...o, children: e }), t[5] = e, t[6] = o, t[7] = n, t[8] = l) : l = t[8], l;
108
- }, j = U((s, t) => {
109
- const e = S.c(4), {
110
- children: o,
111
- ...r
112
- } = s;
113
- process.env.NODE_ENV !== "production" && ft(o);
114
- const n = z(), u = V(o) ? o.ref : null;
115
- let a;
116
- e[0] !== u || e[1] !== n.refs.setReference || e[2] !== t ? (a = [n.refs.setReference, t, u], e[0] = u, e[1] = n.refs.setReference, e[2] = t, e[3] = a) : a = e[3];
117
- const l = H(a);
118
- if (V(o))
119
- return K(o, n.getReferenceProps({
120
- ...o.props,
121
- ...r,
122
- ref: l,
123
- "data-state": n.open ? "open" : "closed"
124
- }));
125
- });
126
- j.displayName = "Tooltip.Anchor";
127
- const B = U((s, t) => {
128
- const e = S.c(24), {
129
- style: o,
130
- className: r,
131
- children: n,
132
- ...u
133
- } = s, a = z();
134
- let l, i, x, T;
135
- e[0] !== a ? ({
136
- context: l,
137
- floatingStyles: i,
138
- getFloatingProps: x,
139
- ...T
140
- } = a, e[0] = a, e[1] = l, e[2] = i, e[3] = x, e[4] = T) : (l = e[1], i = e[2], x = e[3], T = e[4]);
141
- let p;
142
- e[5] !== t || e[6] !== T.refs.setFloating ? (p = [T.refs.setFloating, t], e[5] = t, e[6] = T.refs.setFloating, e[7] = p) : p = e[7];
143
- const d = H(p);
144
- let O;
145
- e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = {
146
- duration: {
147
- open: 400,
148
- close: 100
149
- }
150
- }, e[8] = O) : O = e[8];
151
- const {
152
- isMounted: w,
153
- status: v
154
- } = lt(l, O);
155
- if (!w)
156
- return null;
157
- const C = it;
158
- let m;
159
- e[9] !== i || e[10] !== o ? (m = {
160
- ...i,
161
- ...o
162
- }, e[9] = i, e[10] = o, e[11] = m) : m = e[11];
163
- let c;
164
- e[12] !== r ? (c = ct(at.tooltip, r), e[12] = r, e[13] = c) : c = e[13];
165
- const g = x(u);
166
- let f;
167
- e[14] !== n || e[15] !== d || e[16] !== v || e[17] !== m || e[18] !== c || e[19] !== g ? (f = /* @__PURE__ */ k("div", { ref: d, style: m, className: c, ...g, "data-status": v, children: n }), e[14] = n, e[15] = d, e[16] = v, e[17] = m, e[18] = c, e[19] = g, e[20] = f) : f = e[20];
168
- let h;
169
- return e[21] !== C || e[22] !== f ? (h = /* @__PURE__ */ k(C, { children: f }), e[21] = C, e[22] = f, e[23] = h) : h = e[23], h;
170
- });
171
- B.displayName = "Tooltip.Content";
172
- F.Anchor = j;
173
- F.Content = B;
174
- F.displayName = "Tooltip";
175
- export {
176
- F as Tooltip
177
- };