@helpwave/hightide 0.1.27 → 0.1.28

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 (134) hide show
  1. package/dist/coloring/index.d.mts +2 -0
  2. package/dist/coloring/index.d.ts +2 -0
  3. package/dist/coloring/index.js +85 -0
  4. package/dist/coloring/index.js.map +1 -0
  5. package/dist/coloring/index.mjs +48 -0
  6. package/dist/coloring/index.mjs.map +1 -0
  7. package/dist/components/branding/index.d.mts +3 -0
  8. package/dist/components/branding/index.d.ts +3 -0
  9. package/dist/components/branding/index.js +140 -0
  10. package/dist/components/branding/index.js.map +1 -0
  11. package/dist/components/branding/index.mjs +104 -0
  12. package/dist/components/branding/index.mjs.map +1 -0
  13. package/dist/components/date/index.d.mts +10 -0
  14. package/dist/components/date/index.d.ts +10 -0
  15. package/dist/components/date/index.js +1168 -0
  16. package/dist/components/date/index.js.map +1 -0
  17. package/dist/components/date/index.mjs +1124 -0
  18. package/dist/components/date/index.mjs.map +1 -0
  19. package/dist/components/dialog/index.js.map +1 -1
  20. package/dist/components/form/index.d.mts +5 -0
  21. package/dist/components/form/index.d.ts +5 -0
  22. package/dist/components/form/index.js +100 -0
  23. package/dist/components/form/index.js.map +1 -0
  24. package/dist/components/form/index.mjs +64 -0
  25. package/dist/components/form/index.mjs.map +1 -0
  26. package/dist/components/icons-and-geometry/index.d.mts +7 -0
  27. package/dist/components/icons-and-geometry/index.d.ts +7 -0
  28. package/dist/components/icons-and-geometry/index.js +3955 -0
  29. package/dist/components/icons-and-geometry/index.js.map +1 -0
  30. package/dist/components/icons-and-geometry/index.mjs +3939 -0
  31. package/dist/components/icons-and-geometry/index.mjs.map +1 -0
  32. package/dist/components/index.d.mts +83 -0
  33. package/dist/components/index.d.ts +83 -0
  34. package/dist/components/index.js +15471 -0
  35. package/dist/components/index.js.map +1 -0
  36. package/dist/components/index.mjs +15377 -0
  37. package/dist/components/index.mjs.map +1 -0
  38. package/dist/components/layout/index.d.mts +18 -0
  39. package/dist/components/layout/index.d.ts +18 -0
  40. package/dist/components/layout/index.js +3111 -0
  41. package/dist/components/layout/index.js.map +1 -0
  42. package/dist/components/layout/index.mjs +3064 -0
  43. package/dist/components/layout/index.mjs.map +1 -0
  44. package/dist/components/loading-states/index.d.mts +12 -0
  45. package/dist/components/loading-states/index.d.ts +12 -0
  46. package/dist/components/loading-states/index.js +614 -0
  47. package/dist/components/loading-states/index.js.map +1 -0
  48. package/dist/components/loading-states/index.mjs +573 -0
  49. package/dist/components/loading-states/index.mjs.map +1 -0
  50. package/dist/components/navigation/index.d.mts +9 -0
  51. package/dist/components/navigation/index.d.ts +9 -0
  52. package/dist/components/navigation/index.js +4660 -0
  53. package/dist/components/navigation/index.js.map +1 -0
  54. package/dist/components/navigation/index.mjs +4648 -0
  55. package/dist/components/navigation/index.mjs.map +1 -0
  56. package/dist/components/properties/index.d.mts +12 -0
  57. package/dist/components/properties/index.d.ts +12 -0
  58. package/dist/components/properties/index.js +2983 -0
  59. package/dist/components/properties/index.js.map +1 -0
  60. package/dist/components/properties/index.mjs +2951 -0
  61. package/dist/components/properties/index.mjs.map +1 -0
  62. package/dist/components/table/index.d.mts +10 -0
  63. package/dist/components/table/index.d.ts +10 -0
  64. package/dist/components/table/index.js +2329 -0
  65. package/dist/components/table/index.js.map +1 -0
  66. package/dist/components/table/index.mjs +2293 -0
  67. package/dist/components/table/index.mjs.map +1 -0
  68. package/dist/components/user-action/index.d.mts +30 -0
  69. package/dist/components/user-action/index.d.ts +30 -0
  70. package/dist/components/user-action/index.js +4257 -0
  71. package/dist/components/user-action/index.js.map +1 -0
  72. package/dist/components/user-action/index.mjs +4195 -0
  73. package/dist/components/user-action/index.mjs.map +1 -0
  74. package/dist/components/user-action/input/index.d.mts +6 -0
  75. package/dist/components/user-action/input/index.d.ts +6 -0
  76. package/dist/components/user-action/input/index.js +398 -0
  77. package/dist/components/user-action/input/index.js.map +1 -0
  78. package/dist/components/user-action/input/index.mjs +357 -0
  79. package/dist/components/user-action/input/index.mjs.map +1 -0
  80. package/dist/components/user-action/select/index.d.mts +4 -0
  81. package/dist/components/user-action/select/index.d.ts +4 -0
  82. package/dist/components/user-action/select/index.js +1369 -0
  83. package/dist/components/user-action/select/index.js.map +1 -0
  84. package/dist/components/user-action/select/index.mjs +1333 -0
  85. package/dist/components/user-action/select/index.mjs.map +1 -0
  86. package/dist/components/utils/index.d.mts +4 -0
  87. package/dist/components/utils/index.d.ts +4 -0
  88. package/dist/components/utils/index.js +302 -0
  89. package/dist/components/utils/index.js.map +1 -0
  90. package/dist/components/utils/index.mjs +275 -0
  91. package/dist/components/utils/index.mjs.map +1 -0
  92. package/dist/hooks/focus/index.d.mts +6 -0
  93. package/dist/hooks/focus/index.d.ts +6 -0
  94. package/dist/hooks/focus/index.js +379 -0
  95. package/dist/hooks/focus/index.js.map +1 -0
  96. package/dist/hooks/focus/index.mjs +339 -0
  97. package/dist/hooks/focus/index.mjs.map +1 -0
  98. package/dist/hooks/index.d.mts +16 -0
  99. package/dist/hooks/index.d.ts +16 -0
  100. package/dist/hooks/index.js +844 -0
  101. package/dist/hooks/index.js.map +1 -0
  102. package/dist/hooks/index.mjs +794 -0
  103. package/dist/hooks/index.mjs.map +1 -0
  104. package/dist/index.d.mts +110 -0
  105. package/dist/index.d.ts +110 -0
  106. package/dist/index.js +16101 -0
  107. package/dist/index.js.map +1 -0
  108. package/dist/index.mjs +15941 -0
  109. package/dist/index.mjs.map +1 -0
  110. package/dist/localization/defaults/index.d.mts +4 -0
  111. package/dist/localization/defaults/index.d.ts +4 -0
  112. package/dist/localization/defaults/index.js +223 -0
  113. package/dist/localization/defaults/index.js.map +1 -0
  114. package/dist/localization/defaults/index.mjs +195 -0
  115. package/dist/localization/defaults/index.mjs.map +1 -0
  116. package/dist/localization/index.d.mts +7 -0
  117. package/dist/localization/index.d.ts +7 -0
  118. package/dist/localization/index.js +415 -0
  119. package/dist/localization/index.js.map +1 -0
  120. package/dist/localization/index.mjs +380 -0
  121. package/dist/localization/index.mjs.map +1 -0
  122. package/dist/theming/index.d.mts +5 -0
  123. package/dist/theming/index.d.ts +5 -0
  124. package/dist/theming/index.js +174 -0
  125. package/dist/theming/index.js.map +1 -0
  126. package/dist/theming/index.mjs +145 -0
  127. package/dist/theming/index.mjs.map +1 -0
  128. package/dist/utils/index.d.mts +15 -0
  129. package/dist/utils/index.d.ts +15 -0
  130. package/dist/utils/index.js +553 -0
  131. package/dist/utils/index.js.map +1 -0
  132. package/dist/utils/index.mjs +493 -0
  133. package/dist/utils/index.mjs.map +1 -0
  134. package/package.json +25 -24
@@ -0,0 +1,573 @@
1
+ // src/components/loading-states/ErrorComponent.tsx
2
+ import { AlertOctagon } from "lucide-react";
3
+
4
+ // src/localization/LanguageProvider.tsx
5
+ import { createContext, useContext, useEffect, useState as useState2 } from "react";
6
+
7
+ // src/hooks/useLocalStorage.ts
8
+ import { useCallback, useState } from "react";
9
+
10
+ // src/localization/util.ts
11
+ var languages = ["en", "de"];
12
+ var languagesLocalNames = {
13
+ en: "English",
14
+ de: "Deutsch"
15
+ };
16
+ var DEFAULT_LANGUAGE = "en";
17
+ var LanguageUtil = {
18
+ languages,
19
+ DEFAULT_LANGUAGE,
20
+ languagesLocalNames
21
+ };
22
+
23
+ // src/localization/LanguageProvider.tsx
24
+ import { jsx } from "react/jsx-runtime";
25
+ var LanguageContext = createContext({
26
+ language: LanguageUtil.DEFAULT_LANGUAGE,
27
+ setLanguage: (v) => v
28
+ });
29
+ var useLanguage = () => useContext(LanguageContext);
30
+
31
+ // src/localization/useTranslation.ts
32
+ var TranslationPluralCount = {
33
+ zero: 0,
34
+ one: 1,
35
+ two: 2,
36
+ few: 3,
37
+ many: 11,
38
+ other: -1
39
+ };
40
+ var useTranslation = (translations, overwriteTranslation = {}) => {
41
+ const { language: languageProp, translation: overwrite } = overwriteTranslation;
42
+ const { language: inferredLanguage } = useLanguage();
43
+ const usedLanguage = languageProp ?? inferredLanguage;
44
+ const usedTranslations = [...translations];
45
+ if (overwrite) {
46
+ usedTranslations.push(overwrite);
47
+ }
48
+ return (key, options) => {
49
+ const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
50
+ try {
51
+ for (let i = translations.length - 1; i >= 0; i--) {
52
+ const translation = translations[i];
53
+ const localizedTranslation = translation[usedLanguage];
54
+ if (!localizedTranslation) {
55
+ continue;
56
+ }
57
+ const value = localizedTranslation[key];
58
+ if (!value) {
59
+ continue;
60
+ }
61
+ let forProcessing;
62
+ if (typeof value !== "string") {
63
+ if (count === TranslationPluralCount.zero && value?.zero) {
64
+ forProcessing = value.zero;
65
+ } else if (count === TranslationPluralCount.one && value?.one) {
66
+ forProcessing = value.one;
67
+ } else if (count === TranslationPluralCount.two && value?.two) {
68
+ forProcessing = value.two;
69
+ } else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {
70
+ forProcessing = value.few;
71
+ } else if (count > TranslationPluralCount.many && value?.many) {
72
+ forProcessing = value.many;
73
+ } else {
74
+ forProcessing = value.other;
75
+ }
76
+ } else {
77
+ forProcessing = value;
78
+ }
79
+ forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
80
+ return replacements[placeholder] ?? `{{key:${placeholder}}}`;
81
+ });
82
+ return forProcessing;
83
+ }
84
+ } catch (e) {
85
+ console.error(e);
86
+ }
87
+ return `{{${usedLanguage}:${key}}}`;
88
+ };
89
+ };
90
+
91
+ // src/components/loading-states/ErrorComponent.tsx
92
+ import clsx from "clsx";
93
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
94
+ var defaultErrorComponentTranslation = {
95
+ en: {
96
+ errorOccurred: "An error occurred"
97
+ },
98
+ de: {
99
+ errorOccurred: "Ein Fehler ist aufgetreten"
100
+ }
101
+ };
102
+ var ErrorComponent = ({
103
+ overwriteTranslation,
104
+ errorText,
105
+ classname
106
+ }) => {
107
+ const translation = useTranslation([defaultErrorComponentTranslation], overwriteTranslation);
108
+ return /* @__PURE__ */ jsxs("div", { className: clsx("flex-col-4 items-center justify-center w-full h-24", classname), children: [
109
+ /* @__PURE__ */ jsx2(AlertOctagon, { size: 64, className: "text-warning" }),
110
+ errorText ?? `${translation("errorOccurred")} :(`
111
+ ] });
112
+ };
113
+
114
+ // src/components/loading-states/LoadingAndErrorComponent.tsx
115
+ import { useState as useState3 } from "react";
116
+
117
+ // src/components/loading-states/LoadingContainer.tsx
118
+ import { clsx as clsx2 } from "clsx";
119
+ import { jsx as jsx3 } from "react/jsx-runtime";
120
+ var LoadingContainer = ({ className }) => {
121
+ return /* @__PURE__ */ jsx3("div", { className: clsx2("relative overflow-hidden shimmer bg-disabled-background rounded-md", className) });
122
+ };
123
+
124
+ // src/components/loading-states/LoadingAndErrorComponent.tsx
125
+ import { clsx as clsx3 } from "clsx";
126
+ import { jsx as jsx4 } from "react/jsx-runtime";
127
+ var LoadingAndErrorComponent = ({
128
+ children,
129
+ isLoading = false,
130
+ hasError = false,
131
+ loadingComponent,
132
+ errorComponent,
133
+ minimumLoadingDuration = 200,
134
+ className
135
+ }) => {
136
+ const [isInMinimumLoading, setIsInMinimumLoading] = useState3(false);
137
+ const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = useState3(false);
138
+ if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
139
+ setIsInMinimumLoading(true);
140
+ setTimeout(() => {
141
+ setIsInMinimumLoading(false);
142
+ setHasUsedMinimumLoading(true);
143
+ }, minimumLoadingDuration);
144
+ }
145
+ if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
146
+ return loadingComponent ?? /* @__PURE__ */ jsx4(LoadingContainer, { className: clsx3(className) });
147
+ }
148
+ if (hasError) {
149
+ return errorComponent ?? /* @__PURE__ */ jsx4(LoadingContainer, { className: clsx3("bg-negative", className) });
150
+ }
151
+ return children;
152
+ };
153
+
154
+ // src/components/loading-states/LoadingAnimation.tsx
155
+ import clsx5 from "clsx";
156
+
157
+ // src/components/icons-and-geometry/HelpwaveLogo.tsx
158
+ import { clsx as clsx4 } from "clsx";
159
+ import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
160
+ var HelpwaveLogo = ({
161
+ color = "currentColor",
162
+ size,
163
+ animate = "none",
164
+ ...props
165
+ }) => {
166
+ const isLoadingAnimation = animate === "loading";
167
+ let svgAnimationKey = "";
168
+ if (animate === "pulse") {
169
+ svgAnimationKey = "animate-pulse";
170
+ } else if (animate === "bounce") {
171
+ svgAnimationKey = "animate-bounce";
172
+ }
173
+ return /* @__PURE__ */ jsx5(
174
+ "svg",
175
+ {
176
+ ...props,
177
+ viewBox: "0 0 1024 1024",
178
+ fill: "none",
179
+ strokeLinecap: "round",
180
+ strokeWidth: 65,
181
+ className: clsx4({
182
+ "max-w-16 max-h-16": size === "lg",
183
+ "max-w-12 max-h-12": size === "md",
184
+ "max-w-8 max-h-8": size === "sm"
185
+ }, props.className),
186
+ children: /* @__PURE__ */ jsxs2("g", { className: clsx4(svgAnimationKey), children: [
187
+ /* @__PURE__ */ jsx5(
188
+ "path",
189
+ {
190
+ className: clsx4({ "animate-wave-big-left-up": isLoadingAnimation }),
191
+ d: "M146 644.214C146 498.088 253.381 379.629 385.843 379.629",
192
+ stroke: color,
193
+ strokeDasharray: "1000"
194
+ }
195
+ ),
196
+ /* @__PURE__ */ jsx5(
197
+ "path",
198
+ {
199
+ className: clsx4({ "animate-wave-big-right-down": isLoadingAnimation }),
200
+ d: "M625.686 645.272C493.224 645.272 385.843 526.813 385.843 380.687",
201
+ stroke: color,
202
+ strokeDasharray: "1000"
203
+ }
204
+ ),
205
+ /* @__PURE__ */ jsx5(
206
+ "path",
207
+ {
208
+ className: clsx4({ "animate-wave-small-left-up": isLoadingAnimation }),
209
+ d: "M533.585 613.522C533.585 508.895 610.47 424.079 705.312 424.079",
210
+ stroke: color,
211
+ strokeDasharray: "1000"
212
+ }
213
+ ),
214
+ /* @__PURE__ */ jsx5(
215
+ "path",
216
+ {
217
+ className: clsx4({ "animate-wave-small-right-down": isLoadingAnimation }),
218
+ d: "M878 615.639C782.628 615.639 705.313 530.822 705.313 426.196",
219
+ stroke: color,
220
+ strokeDasharray: "1000"
221
+ }
222
+ )
223
+ ] })
224
+ }
225
+ );
226
+ };
227
+
228
+ // src/localization/defaults/form.ts
229
+ var formTranslation = {
230
+ en: {
231
+ add: "Add",
232
+ all: "All",
233
+ apply: "Apply",
234
+ back: "Back",
235
+ cancel: "Cancel",
236
+ change: "Change",
237
+ clear: "Clear",
238
+ click: "Click",
239
+ clickToCopy: "Click to Copy",
240
+ close: "Close",
241
+ confirm: "Confirm",
242
+ copy: "Copy",
243
+ copied: "Copied",
244
+ create: "Create",
245
+ decline: "Decline",
246
+ delete: "Delete",
247
+ discard: "Discard",
248
+ discardChanges: "Discard Changes",
249
+ done: "Done",
250
+ edit: "Edit",
251
+ enterText: "Enter text here",
252
+ error: "Error",
253
+ exit: "Exit",
254
+ fieldRequiredError: "This field is required.",
255
+ invalidEmailError: "Please enter a valid email address.",
256
+ less: "Less",
257
+ loading: "Loading",
258
+ maxLengthError: "Maximum length exceeded.",
259
+ minLengthError: "Minimum length not met.",
260
+ more: "More",
261
+ next: "Next",
262
+ no: "No",
263
+ none: "None",
264
+ nothingFound: "Nothing found",
265
+ of: "of",
266
+ optional: "Optional",
267
+ pleaseWait: "Please wait...",
268
+ previous: "Previous",
269
+ remove: "Remove",
270
+ required: "Required",
271
+ reset: "Reset",
272
+ save: "Save",
273
+ saved: "Saved",
274
+ search: "Search",
275
+ select: "Select",
276
+ selectOption: "Select an option",
277
+ show: "Show",
278
+ showMore: "Show more",
279
+ showLess: "Show less",
280
+ submit: "Submit",
281
+ success: "Success",
282
+ update: "Update",
283
+ unsavedChanges: "Unsaved Changes",
284
+ unsavedChangesSaveQuestion: "Do you want to save your changes?",
285
+ yes: "Yes"
286
+ },
287
+ de: {
288
+ add: "Hinzuf\xFCgen",
289
+ all: "Alle",
290
+ apply: "Anwenden",
291
+ back: "Zur\xFCck",
292
+ cancel: "Abbrechen",
293
+ change: "\xC4ndern",
294
+ clear: "L\xF6schen",
295
+ click: "Klicken",
296
+ clickToCopy: "Zum kopieren klicken",
297
+ close: "Schlie\xDFen",
298
+ confirm: "Best\xE4tigen",
299
+ copy: "Kopieren",
300
+ copied: "Kopiert",
301
+ create: "Erstellen",
302
+ decline: "Ablehnen",
303
+ delete: "L\xF6schen",
304
+ discard: "Verwerfen",
305
+ discardChanges: "\xC4nderungen Verwerfen",
306
+ done: "Fertig",
307
+ edit: "Bearbeiten",
308
+ enterText: "Text hier eingeben",
309
+ error: "Fehler",
310
+ exit: "Beenden",
311
+ fieldRequiredError: "Dieses Feld ist erforderlich.",
312
+ invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
313
+ less: "Weniger",
314
+ loading: "L\xE4dt",
315
+ maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
316
+ minLengthError: "Mindestl\xE4nge nicht erreicht.",
317
+ more: "Mehr",
318
+ next: "Weiter",
319
+ no: "Nein",
320
+ none: "Nichts",
321
+ nothingFound: "Nichts gefunden",
322
+ of: "von",
323
+ optional: "Optional",
324
+ pleaseWait: "Bitte warten...",
325
+ previous: "Vorherige",
326
+ remove: "Entfernen",
327
+ required: "Erforderlich",
328
+ reset: "Zur\xFCcksetzen",
329
+ save: "Speichern",
330
+ saved: "Gespeichert",
331
+ search: "Suche",
332
+ select: "Select",
333
+ selectOption: "Option ausw\xE4hlen",
334
+ show: "Anzeigen",
335
+ showMore: "Mehr anzeigen",
336
+ showLess: "Weniger anzeigen",
337
+ submit: "Abschicken",
338
+ success: "Erfolg",
339
+ update: "Update",
340
+ unsavedChanges: "Ungespeicherte \xC4nderungen",
341
+ unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
342
+ yes: "Ja"
343
+ }
344
+ };
345
+
346
+ // src/components/loading-states/LoadingAnimation.tsx
347
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
348
+ var LoadingAnimation = ({
349
+ overwriteTranslation,
350
+ loadingText,
351
+ classname
352
+ }) => {
353
+ const translation = useTranslation([formTranslation], overwriteTranslation);
354
+ return /* @__PURE__ */ jsxs3("div", { className: clsx5("flex-col-2 items-center justify-center w-full h-24", classname), children: [
355
+ /* @__PURE__ */ jsx6(HelpwaveLogo, { animate: "loading" }),
356
+ loadingText ?? `${translation("loading")}...`
357
+ ] });
358
+ };
359
+
360
+ // src/components/loading-states/LoadingButton.tsx
361
+ import clsx7 from "clsx";
362
+
363
+ // src/components/user-action/Button.tsx
364
+ import { forwardRef } from "react";
365
+ import clsx6 from "clsx";
366
+ import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
367
+ var ButtonColorUtil = {
368
+ solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
369
+ text: ["primary", "negative", "neutral"],
370
+ outline: ["primary"]
371
+ };
372
+ var IconButtonUtil = {
373
+ icon: [...ButtonColorUtil.solid, "transparent"]
374
+ };
375
+ var paddingMapping = {
376
+ small: "btn-sm",
377
+ medium: "btn-md",
378
+ large: "btn-lg"
379
+ };
380
+ var iconPaddingMapping = {
381
+ tiny: "icon-btn-xs",
382
+ small: "icon-btn-sm",
383
+ medium: "icon-btn-md",
384
+ large: "icon-btn-lg"
385
+ };
386
+ var ButtonUtil = {
387
+ paddingMapping,
388
+ iconPaddingMapping
389
+ };
390
+ var SolidButton = forwardRef(function SolidButton2({
391
+ children,
392
+ color = "primary",
393
+ size = "medium",
394
+ startIcon,
395
+ endIcon,
396
+ onClick,
397
+ className,
398
+ ...restProps
399
+ }, ref) {
400
+ const colorClasses = {
401
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
402
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
403
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
404
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
405
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
406
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
407
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
408
+ }[color];
409
+ const iconColorClasses = {
410
+ primary: "not-group-disabled:text-button-solid-primary-icon",
411
+ secondary: "not-group-disabled:text-button-solid-secondary-icon",
412
+ tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
413
+ positive: "not-group-disabled:text-button-solid-positive-icon",
414
+ warning: "not-group-disabled:text-button-solid-warning-icon",
415
+ negative: "not-group-disabled:text-button-solid-negative-icon",
416
+ neutral: "not-group-disabled:text-button-solid-neutral-icon"
417
+ }[color];
418
+ return /* @__PURE__ */ jsxs4(
419
+ "button",
420
+ {
421
+ ref,
422
+ onClick,
423
+ className: clsx6(
424
+ "group font-semibold",
425
+ colorClasses,
426
+ "not-disabled:hover:brightness-90",
427
+ "disabled:text-disabled-text disabled:bg-disabled-background",
428
+ ButtonUtil.paddingMapping[size],
429
+ className
430
+ ),
431
+ ...restProps,
432
+ children: [
433
+ startIcon && /* @__PURE__ */ jsx7(
434
+ "span",
435
+ {
436
+ className: clsx6(
437
+ iconColorClasses,
438
+ "group-disabled:text-disabled-icon"
439
+ ),
440
+ children: startIcon
441
+ }
442
+ ),
443
+ children,
444
+ endIcon && /* @__PURE__ */ jsx7(
445
+ "span",
446
+ {
447
+ className: clsx6(
448
+ iconColorClasses,
449
+ "group-disabled:text-disabled-icon"
450
+ ),
451
+ children: endIcon
452
+ }
453
+ )
454
+ ]
455
+ }
456
+ );
457
+ });
458
+ var IconButton = forwardRef(function IconButton2({
459
+ children,
460
+ color = "primary",
461
+ size = "medium",
462
+ className,
463
+ ...restProps
464
+ }, ref) {
465
+ const colorClasses = {
466
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
467
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
468
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
469
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
470
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
471
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
472
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
473
+ transparent: "not-disabled:bg-transparent"
474
+ }[color];
475
+ return /* @__PURE__ */ jsx7(
476
+ "button",
477
+ {
478
+ ref,
479
+ className: clsx6(
480
+ colorClasses,
481
+ "not-disabled:hover:brightness-90",
482
+ "disabled:text-disabled-text",
483
+ {
484
+ "disabled:bg-disabled-background": color !== "transparent",
485
+ "disabled:opacity-70": color === "transparent",
486
+ "not-disabled:hover:bg-button-text-hover-background": color === "transparent"
487
+ },
488
+ ButtonUtil.iconPaddingMapping[size],
489
+ className
490
+ ),
491
+ ...restProps,
492
+ children
493
+ }
494
+ );
495
+ });
496
+
497
+ // src/utils/noop.ts
498
+ var noop = () => void 0;
499
+
500
+ // src/components/loading-states/LoadingButton.tsx
501
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
502
+ var LoadingButton = ({ isLoading = false, size = "medium", onClick, ...rest }) => {
503
+ const paddingClass = ButtonUtil.paddingMapping[size];
504
+ return /* @__PURE__ */ jsxs5("div", { className: "inline-block relative", children: [
505
+ isLoading && /* @__PURE__ */ jsx8("div", { className: clsx7("flex-row-2 absolute inset-0 items-center justify-center bg-white/40", paddingClass), children: /* @__PURE__ */ jsx8(HelpwaveLogo, { animate: "loading", className: "text-white" }) }),
506
+ /* @__PURE__ */ jsx8(SolidButton, { ...rest, disabled: rest.disabled, onClick: isLoading ? noop : onClick })
507
+ ] });
508
+ };
509
+
510
+ // src/components/loading-states/ProgressIndicator.tsx
511
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
512
+ var sizeMapping = { small: 16, medium: 24, big: 48 };
513
+ var ProgressIndicator = ({
514
+ progress,
515
+ strokeWidth = 5,
516
+ size = "medium",
517
+ direction = "counterclockwise",
518
+ rotation = 0
519
+ }) => {
520
+ const currentSize = sizeMapping[size];
521
+ const center = currentSize / 2;
522
+ const radius = center - strokeWidth / 2;
523
+ const arcLength = 2 * Math.PI * radius;
524
+ const arcOffset = arcLength * progress;
525
+ if (direction === "clockwise") {
526
+ rotation += 360 * progress;
527
+ }
528
+ return /* @__PURE__ */ jsxs6(
529
+ "svg",
530
+ {
531
+ style: {
532
+ height: `${currentSize}px`,
533
+ width: `${currentSize}px`,
534
+ transform: `rotate(${rotation}deg)`
535
+ },
536
+ children: [
537
+ /* @__PURE__ */ jsx9(
538
+ "circle",
539
+ {
540
+ cx: center,
541
+ cy: center,
542
+ r: radius,
543
+ fill: "transparent",
544
+ strokeWidth,
545
+ className: "stroke-progress-indicator-fill"
546
+ }
547
+ ),
548
+ /* @__PURE__ */ jsx9(
549
+ "circle",
550
+ {
551
+ cx: center,
552
+ cy: center,
553
+ r: radius,
554
+ fill: "transparent",
555
+ strokeWidth,
556
+ strokeDasharray: arcLength,
557
+ strokeDashoffset: arcOffset,
558
+ className: "stroke-progress-indicator-background"
559
+ }
560
+ )
561
+ ]
562
+ }
563
+ );
564
+ };
565
+ export {
566
+ ErrorComponent,
567
+ LoadingAndErrorComponent,
568
+ LoadingAnimation,
569
+ LoadingButton,
570
+ LoadingContainer,
571
+ ProgressIndicator
572
+ };
573
+ //# sourceMappingURL=index.mjs.map