@helpwave/hightide 0.1.7 → 0.1.8

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 (175) hide show
  1. package/dist/components/branding/HelpwaveBadge.js +30 -8
  2. package/dist/components/branding/HelpwaveBadge.js.map +1 -1
  3. package/dist/components/branding/HelpwaveBadge.mjs +30 -8
  4. package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
  5. package/dist/components/date/DatePicker.js +18 -20
  6. package/dist/components/date/DatePicker.js.map +1 -1
  7. package/dist/components/date/DatePicker.mjs +18 -20
  8. package/dist/components/date/DatePicker.mjs.map +1 -1
  9. package/dist/components/date/DayPicker.d.mts +1 -1
  10. package/dist/components/date/DayPicker.d.ts +1 -1
  11. package/dist/components/date/DayPicker.js +23 -11
  12. package/dist/components/date/DayPicker.js.map +1 -1
  13. package/dist/components/date/DayPicker.mjs +23 -11
  14. package/dist/components/date/DayPicker.mjs.map +1 -1
  15. package/dist/components/date/YearMonthPicker.js +106 -22
  16. package/dist/components/date/YearMonthPicker.js.map +1 -1
  17. package/dist/components/date/YearMonthPicker.mjs +106 -22
  18. package/dist/components/date/YearMonthPicker.mjs.map +1 -1
  19. package/dist/components/dialogs/ConfirmDialog.js +2 -2
  20. package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
  21. package/dist/components/dialogs/ConfirmDialog.mjs +2 -2
  22. package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
  23. package/dist/components/icons-and-geometry/Avatar.js +2 -2
  24. package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
  25. package/dist/components/icons-and-geometry/Avatar.mjs +2 -2
  26. package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
  27. package/dist/components/layout-and-navigation/Carousel.d.mts +1 -1
  28. package/dist/components/layout-and-navigation/Carousel.d.ts +1 -1
  29. package/dist/components/layout-and-navigation/Carousel.js +86 -28
  30. package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
  31. package/dist/components/layout-and-navigation/Carousel.mjs +86 -28
  32. package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
  33. package/dist/components/layout-and-navigation/Expandable.d.mts +3 -0
  34. package/dist/components/layout-and-navigation/Expandable.d.ts +3 -0
  35. package/dist/components/layout-and-navigation/Expandable.js +4 -3
  36. package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
  37. package/dist/components/layout-and-navigation/Expandable.mjs +4 -3
  38. package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
  39. package/dist/components/layout-and-navigation/FAQSection.js +4 -3
  40. package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
  41. package/dist/components/layout-and-navigation/FAQSection.mjs +4 -3
  42. package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
  43. package/dist/components/layout-and-navigation/Overlay.js +2 -2
  44. package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
  45. package/dist/components/layout-and-navigation/Overlay.mjs +2 -2
  46. package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
  47. package/dist/components/layout-and-navigation/SearchableList.d.mts +7 -6
  48. package/dist/components/layout-and-navigation/SearchableList.d.ts +7 -6
  49. package/dist/components/layout-and-navigation/SearchableList.js +114 -21
  50. package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
  51. package/dist/components/layout-and-navigation/SearchableList.mjs +114 -21
  52. package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
  53. package/dist/components/layout-and-navigation/StepperBar.js +6 -6
  54. package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
  55. package/dist/components/layout-and-navigation/StepperBar.mjs +6 -6
  56. package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
  57. package/dist/components/layout-and-navigation/Table.js +1 -1
  58. package/dist/components/layout-and-navigation/Table.js.map +1 -1
  59. package/dist/components/layout-and-navigation/Table.mjs +1 -1
  60. package/dist/components/layout-and-navigation/Table.mjs.map +1 -1
  61. package/dist/components/layout-and-navigation/Tile.d.mts +10 -15
  62. package/dist/components/layout-and-navigation/Tile.d.ts +10 -15
  63. package/dist/components/layout-and-navigation/Tile.js +30 -8
  64. package/dist/components/layout-and-navigation/Tile.js.map +1 -1
  65. package/dist/components/layout-and-navigation/Tile.mjs +30 -8
  66. package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
  67. package/dist/components/loading-states/ProgressIndicator.js +2 -2
  68. package/dist/components/loading-states/ProgressIndicator.js.map +1 -1
  69. package/dist/components/loading-states/ProgressIndicator.mjs +2 -2
  70. package/dist/components/loading-states/ProgressIndicator.mjs.map +1 -1
  71. package/dist/components/modals/ConfirmModal.js +2 -2
  72. package/dist/components/modals/ConfirmModal.js.map +1 -1
  73. package/dist/components/modals/ConfirmModal.mjs +2 -2
  74. package/dist/components/modals/ConfirmModal.mjs.map +1 -1
  75. package/dist/components/modals/DiscardChangesModal.js +2 -2
  76. package/dist/components/modals/DiscardChangesModal.js.map +1 -1
  77. package/dist/components/modals/DiscardChangesModal.mjs +2 -2
  78. package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
  79. package/dist/components/modals/InputModal.js +2 -2
  80. package/dist/components/modals/InputModal.js.map +1 -1
  81. package/dist/components/modals/InputModal.mjs +2 -2
  82. package/dist/components/modals/InputModal.mjs.map +1 -1
  83. package/dist/components/modals/LanguageModal.js +384 -150
  84. package/dist/components/modals/LanguageModal.js.map +1 -1
  85. package/dist/components/modals/LanguageModal.mjs +383 -149
  86. package/dist/components/modals/LanguageModal.mjs.map +1 -1
  87. package/dist/components/modals/ThemeModal.js +385 -154
  88. package/dist/components/modals/ThemeModal.js.map +1 -1
  89. package/dist/components/modals/ThemeModal.mjs +382 -151
  90. package/dist/components/modals/ThemeModal.mjs.map +1 -1
  91. package/dist/components/properties/CheckboxProperty.js +1 -1
  92. package/dist/components/properties/CheckboxProperty.js.map +1 -1
  93. package/dist/components/properties/CheckboxProperty.mjs +1 -1
  94. package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
  95. package/dist/components/properties/DateProperty.js +1 -1
  96. package/dist/components/properties/DateProperty.js.map +1 -1
  97. package/dist/components/properties/DateProperty.mjs +1 -1
  98. package/dist/components/properties/DateProperty.mjs.map +1 -1
  99. package/dist/components/properties/MultiSelectProperty.d.mts +1 -0
  100. package/dist/components/properties/MultiSelectProperty.d.ts +1 -0
  101. package/dist/components/properties/MultiSelectProperty.js +482 -430
  102. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  103. package/dist/components/properties/MultiSelectProperty.mjs +478 -426
  104. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  105. package/dist/components/properties/NumberProperty.js +1 -1
  106. package/dist/components/properties/NumberProperty.js.map +1 -1
  107. package/dist/components/properties/NumberProperty.mjs +1 -1
  108. package/dist/components/properties/NumberProperty.mjs.map +1 -1
  109. package/dist/components/properties/PropertyBase.js +1 -1
  110. package/dist/components/properties/PropertyBase.js.map +1 -1
  111. package/dist/components/properties/PropertyBase.mjs +1 -1
  112. package/dist/components/properties/PropertyBase.mjs.map +1 -1
  113. package/dist/components/properties/SelectProperty.d.mts +3 -3
  114. package/dist/components/properties/SelectProperty.d.ts +3 -3
  115. package/dist/components/properties/SelectProperty.js +404 -263
  116. package/dist/components/properties/SelectProperty.js.map +1 -1
  117. package/dist/components/properties/SelectProperty.mjs +404 -263
  118. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  119. package/dist/components/properties/TextProperty.js +1 -1
  120. package/dist/components/properties/TextProperty.js.map +1 -1
  121. package/dist/components/properties/TextProperty.mjs +1 -1
  122. package/dist/components/properties/TextProperty.mjs.map +1 -1
  123. package/dist/components/user-action/DateAndTimePicker.js +18 -20
  124. package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
  125. package/dist/components/user-action/DateAndTimePicker.mjs +18 -20
  126. package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
  127. package/dist/components/user-action/Menu.d.mts +14 -8
  128. package/dist/components/user-action/Menu.d.ts +14 -8
  129. package/dist/components/user-action/Menu.js +32 -11
  130. package/dist/components/user-action/Menu.js.map +1 -1
  131. package/dist/components/user-action/Menu.mjs +32 -11
  132. package/dist/components/user-action/Menu.mjs.map +1 -1
  133. package/dist/components/user-action/MultiSelect.d.mts +10 -16
  134. package/dist/components/user-action/MultiSelect.d.ts +10 -16
  135. package/dist/components/user-action/MultiSelect.js +485 -312
  136. package/dist/components/user-action/MultiSelect.js.map +1 -1
  137. package/dist/components/user-action/MultiSelect.mjs +482 -310
  138. package/dist/components/user-action/MultiSelect.mjs.map +1 -1
  139. package/dist/components/user-action/Select.d.mts +5 -18
  140. package/dist/components/user-action/Select.d.ts +5 -18
  141. package/dist/components/user-action/Select.js +309 -113
  142. package/dist/components/user-action/Select.js.map +1 -1
  143. package/dist/components/user-action/Select.mjs +304 -107
  144. package/dist/components/user-action/Select.mjs.map +1 -1
  145. package/dist/components/user-action/Tooltip.js +2 -2
  146. package/dist/components/user-action/Tooltip.js.map +1 -1
  147. package/dist/components/user-action/Tooltip.mjs +2 -2
  148. package/dist/components/user-action/Tooltip.mjs.map +1 -1
  149. package/dist/css/globals.css +213 -205
  150. package/dist/css/uncompiled/globals.css +136 -72
  151. package/dist/hooks/useSearch.d.mts +17 -0
  152. package/dist/hooks/useSearch.d.ts +17 -0
  153. package/dist/hooks/useSearch.js +66 -0
  154. package/dist/hooks/useSearch.js.map +1 -0
  155. package/dist/hooks/useSearch.mjs +42 -0
  156. package/dist/hooks/useSearch.mjs.map +1 -0
  157. package/dist/index.d.mts +7 -5
  158. package/dist/index.d.ts +7 -5
  159. package/dist/index.js +555 -463
  160. package/dist/index.js.map +1 -1
  161. package/dist/index.mjs +517 -427
  162. package/dist/index.mjs.map +1 -1
  163. package/dist/util/PropsWithFunctionChildren.d.mts +14 -0
  164. package/dist/util/PropsWithFunctionChildren.d.ts +14 -0
  165. package/dist/util/PropsWithFunctionChildren.js +38 -0
  166. package/dist/util/PropsWithFunctionChildren.js.map +1 -0
  167. package/dist/util/PropsWithFunctionChildren.mjs +14 -0
  168. package/dist/util/PropsWithFunctionChildren.mjs.map +1 -0
  169. package/dist/util/simpleSearch.d.mts +2 -2
  170. package/dist/util/simpleSearch.d.ts +2 -2
  171. package/dist/util/simpleSearch.js +4 -1
  172. package/dist/util/simpleSearch.js.map +1 -1
  173. package/dist/util/simpleSearch.mjs +4 -1
  174. package/dist/util/simpleSearch.mjs.map +1 -1
  175. package/package.json +1 -2
@@ -29,11 +29,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/components/user-action/MultiSelect.tsx
30
30
  var MultiSelect_exports = {};
31
31
  __export(MultiSelect_exports, {
32
- MultiSelect: () => MultiSelect
32
+ MultiSelect: () => MultiSelect,
33
+ MultiSelectUncontrolled: () => MultiSelectUncontrolled
33
34
  });
34
35
  module.exports = __toCommonJS(MultiSelect_exports);
35
- var import_react9 = require("react");
36
- var import_lucide_react2 = require("lucide-react");
36
+ var import_react7 = require("react");
37
+ var import_lucide_react3 = require("lucide-react");
37
38
 
38
39
  // src/localization/LanguageProvider.tsx
39
40
  var import_react2 = require("react");
@@ -74,149 +75,40 @@ var useTranslation = (defaults, translationOverwrite = {}) => {
74
75
  return defaultValues;
75
76
  };
76
77
 
77
- // src/util/simpleSearch.ts
78
- var MultiSearchWithMapping = (search, objects, mapping) => {
79
- return objects.filter((object) => {
80
- const mappedSearchKeywords = mapping(object).map((value) => value.toLowerCase().trim());
81
- return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
82
- });
83
- };
84
-
85
78
  // src/components/user-action/MultiSelect.tsx
86
- var import_clsx5 = __toESM(require("clsx"));
79
+ var import_clsx7 = __toESM(require("clsx"));
87
80
 
88
- // src/components/user-action/Menu.tsx
89
- var import_react5 = require("react");
81
+ // src/components/user-action/Label.tsx
90
82
  var import_clsx = __toESM(require("clsx"));
91
-
92
- // src/hooks/useOutsideClick.ts
93
- var import_react3 = require("react");
94
- var useOutsideClick = (refs, handler) => {
95
- (0, import_react3.useEffect)(() => {
96
- const listener = (event) => {
97
- if (event.target === null) return;
98
- if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
99
- return;
100
- }
101
- handler();
102
- };
103
- document.addEventListener("mousedown", listener);
104
- document.addEventListener("touchstart", listener);
105
- return () => {
106
- document.removeEventListener("mousedown", listener);
107
- document.removeEventListener("touchstart", listener);
108
- };
109
- }, [refs, handler]);
110
- };
111
-
112
- // src/hooks/useHoverState.ts
113
- var import_react4 = require("react");
114
- var defaultUseHoverStateProps = {
115
- closingDelay: 200,
116
- isDisabled: false
117
- };
118
- var useHoverState = (props = void 0) => {
119
- const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
120
- const [isHovered, setIsHovered] = (0, import_react4.useState)(false);
121
- const [timer, setTimer] = (0, import_react4.useState)();
122
- const onMouseEnter = () => {
123
- if (isDisabled) {
124
- return;
125
- }
126
- clearTimeout(timer);
127
- setIsHovered(true);
128
- };
129
- const onMouseLeave = () => {
130
- if (isDisabled) {
131
- return;
132
- }
133
- setTimer(setTimeout(() => {
134
- setIsHovered(false);
135
- }, closingDelay));
136
- };
137
- (0, import_react4.useEffect)(() => {
138
- if (timer) {
139
- return () => {
140
- clearTimeout(timer);
141
- };
142
- }
143
- });
144
- (0, import_react4.useEffect)(() => {
145
- if (timer) {
146
- clearTimeout(timer);
147
- }
148
- }, [isDisabled]);
149
- return {
150
- isHovered,
151
- setIsHovered,
152
- handlers: { onMouseEnter, onMouseLeave }
153
- };
154
- };
155
-
156
- // src/components/user-action/Menu.tsx
157
83
  var import_jsx_runtime2 = require("react/jsx-runtime");
158
- var MenuItem = ({
159
- children,
160
- onClick,
161
- alignment = "left",
162
- className
163
- }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
164
- "div",
165
- {
166
- className: (0, import_clsx.default)("block px-3 py-1 bg-menu-background text-menu-text hover:brightness-90", {
167
- "text-right": alignment === "right",
168
- "text-left": alignment === "left"
169
- }, className),
170
- onClick,
171
- children
172
- }
173
- );
174
- var Menu = ({
175
- trigger,
84
+ var styleMapping = {
85
+ labelSmall: "textstyle-label-sm",
86
+ labelMedium: "textstyle-label-md",
87
+ labelBig: "textstyle-label-lg"
88
+ };
89
+ var Label = ({
176
90
  children,
177
- alignment = "tl",
178
- showOnHover = false,
179
- menuClassName = ""
91
+ name,
92
+ labelType = "labelSmall",
93
+ className,
94
+ ...props
180
95
  }) => {
181
- const { isHovered: isOpen, setIsHovered: setIsOpen, handlers } = useHoverState({ isDisabled: !showOnHover });
182
- const triggerRef = (0, import_react5.useRef)(null);
183
- const menuRef = (0, import_react5.useRef)(null);
184
- useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
185
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
186
- "div",
187
- {
188
- className: "relative",
189
- ...handlers,
190
- children: [
191
- trigger(() => setIsOpen(!isOpen), triggerRef),
192
- isOpen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
193
- "div",
194
- {
195
- ref: menuRef,
196
- onClick: (e) => e.stopPropagation(),
197
- className: (0, import_clsx.default)("absolute top-full mt-1 py-2 w-60 rounded-lg bg-menu-background text-menu-text ring-1 ring-slate-900/5 text-sm leading-6 font-semibold shadow-md z-[1]", {
198
- " top-[8px]": alignment[0] === "t",
199
- " bottom-[8px]": alignment[0] === "b",
200
- " left-[-8px]": alignment[1] === "l",
201
- " right-[-8px]": alignment[1] === "r"
202
- }, menuClassName),
203
- children
204
- }
205
- ) : null
206
- ]
207
- }
208
- );
96
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
209
97
  };
210
98
 
99
+ // src/components/layout-and-navigation/SearchableList.tsx
100
+ var import_lucide_react = require("lucide-react");
101
+ var import_clsx4 = __toESM(require("clsx"));
102
+
211
103
  // src/components/user-action/Input.tsx
212
- var import_react7 = require("react");
213
- var import_clsx3 = __toESM(require("clsx"));
104
+ var import_react4 = require("react");
105
+ var import_clsx2 = __toESM(require("clsx"));
214
106
 
215
107
  // src/hooks/useSaveDelay.ts
216
- var import_react6 = require("react");
108
+ var import_react3 = require("react");
217
109
  function useSaveDelay(setNotificationStatus, delay) {
218
- const [updateTimer, setUpdateTimer] = (0, import_react6.useState)(void 0);
219
- const [notificationTimer, setNotificationTimer] = (0, import_react6.useState)(void 0);
110
+ const [updateTimer, setUpdateTimer] = (0, import_react3.useState)(void 0);
111
+ const [notificationTimer, setNotificationTimer] = (0, import_react3.useState)(void 0);
220
112
  const restartTimer = (onSave) => {
221
113
  clearTimeout(updateTimer);
222
114
  setUpdateTimer(setTimeout(() => {
@@ -243,7 +135,7 @@ function useSaveDelay(setNotificationStatus, delay) {
243
135
  setNotificationStatus(false);
244
136
  }
245
137
  };
246
- (0, import_react6.useEffect)(() => {
138
+ (0, import_react3.useEffect)(() => {
247
139
  return () => {
248
140
  clearTimeout(updateTimer);
249
141
  clearTimeout(notificationTimer);
@@ -255,26 +147,8 @@ function useSaveDelay(setNotificationStatus, delay) {
255
147
  // src/util/noop.ts
256
148
  var noop = () => void 0;
257
149
 
258
- // src/components/user-action/Label.tsx
259
- var import_clsx2 = __toESM(require("clsx"));
260
- var import_jsx_runtime3 = require("react/jsx-runtime");
261
- var styleMapping = {
262
- labelSmall: "textstyle-label-sm",
263
- labelMedium: "textstyle-label-md",
264
- labelBig: "textstyle-label-lg"
265
- };
266
- var Label = ({
267
- children,
268
- name,
269
- labelType = "labelSmall",
270
- className,
271
- ...props
272
- }) => {
273
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { ...props, className: (0, import_clsx2.default)(styleMapping[labelType], className), children: children ? children : name });
274
- };
275
-
276
150
  // src/components/user-action/Input.tsx
277
- var import_jsx_runtime4 = require("react/jsx-runtime");
151
+ var import_jsx_runtime3 = require("react/jsx-runtime");
278
152
  var Input = ({
279
153
  id,
280
154
  type = "text",
@@ -294,15 +168,15 @@ var Input = ({
294
168
  restartTimer,
295
169
  clearUpdateTimer
296
170
  } = useSaveDelay(() => void 0, 3e3);
297
- const ref = (0, import_react7.useRef)(null);
298
- (0, import_react7.useEffect)(() => {
171
+ const ref = (0, import_react4.useRef)(null);
172
+ (0, import_react4.useEffect)(() => {
299
173
  if (autoFocus) {
300
174
  ref.current?.focus();
301
175
  }
302
176
  }, [autoFocus]);
303
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx3.default)({ "w-full": expanded }, containerClassName), children: [
304
- label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx3.default)("mb-1", label.className) }),
305
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
177
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)({ "w-full": expanded }, containerClassName), children: [
178
+ label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx2.default)("mb-1", label.className) }),
179
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
306
180
  "input",
307
181
  {
308
182
  ref,
@@ -335,7 +209,7 @@ var Input = ({
335
209
  )
336
210
  ] });
337
211
  };
338
- var FormInput = (0, import_react7.forwardRef)(function FormInput2({
212
+ var FormInput = (0, import_react4.forwardRef)(function FormInput2({
339
213
  id,
340
214
  labelText,
341
215
  errorText,
@@ -346,13 +220,13 @@ var FormInput = (0, import_react7.forwardRef)(function FormInput2({
346
220
  required,
347
221
  ...restProps
348
222
  }, ref) {
349
- const input = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
223
+ const input = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
350
224
  "input",
351
225
  {
352
226
  ref,
353
227
  id,
354
228
  ...restProps,
355
- className: (0, import_clsx3.default)(
229
+ className: (0, import_clsx2.default)(
356
230
  {
357
231
  "focus:border-primary focus:ring-primary": !errorText,
358
232
  "focus:border-negative focus:ring-negative text-negative": !!errorText
@@ -361,91 +235,350 @@ var FormInput = (0, import_react7.forwardRef)(function FormInput2({
361
235
  )
362
236
  }
363
237
  );
364
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx3.default)("flex flex-col gap-y-1", containerClassName), children: [
365
- labelText && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { htmlFor: id, className: (0, import_clsx3.default)("textstyle-label-md", labelClassName), children: [
238
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)("flex flex-col gap-y-1", containerClassName), children: [
239
+ labelText && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { htmlFor: id, className: (0, import_clsx2.default)("textstyle-label-md", labelClassName), children: [
366
240
  labelText,
367
- required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-primary font-bold", children: "*" })
241
+ required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-primary font-bold", children: "*" })
368
242
  ] }),
369
243
  input,
370
- errorText && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: id, className: (0, import_clsx3.default)("text-negative", errorClassName), children: errorText })
244
+ errorText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: id, className: (0, import_clsx2.default)("text-negative", errorClassName), children: errorText })
371
245
  ] });
372
246
  });
373
247
 
374
- // src/components/user-action/Checkbox.tsx
375
- var import_react8 = require("react");
376
- var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
377
- var import_lucide_react = require("lucide-react");
378
- var import_clsx4 = __toESM(require("clsx"));
379
- var import_jsx_runtime5 = require("react/jsx-runtime");
380
- var checkboxSizeMapping = {
381
- small: "size-4",
382
- medium: "size-6",
383
- large: "size-8"
248
+ // src/components/user-action/Button.tsx
249
+ var import_clsx3 = __toESM(require("clsx"));
250
+ var import_jsx_runtime4 = require("react/jsx-runtime");
251
+ var paddingMapping = {
252
+ small: "btn-sm",
253
+ medium: "btn-md",
254
+ large: "btn-lg"
384
255
  };
385
- var checkboxIconSizeMapping = {
386
- small: "size-3",
387
- medium: "size-5",
388
- large: "size-7"
256
+ var iconPaddingMapping = {
257
+ small: "icon-btn-sm",
258
+ medium: "icon-btn-md",
259
+ large: "icon-btn-lg"
389
260
  };
390
- var Checkbox = ({
391
- id,
392
- label,
393
- checked,
394
- disabled,
395
- onChange,
396
- onChangeTristate,
261
+ var ButtonUtil = {
262
+ paddingMapping,
263
+ iconPaddingMapping
264
+ };
265
+ var SolidButton = ({
266
+ children,
267
+ disabled = false,
268
+ color = "primary",
397
269
  size = "medium",
398
- className = "",
399
- containerClassName
270
+ startIcon,
271
+ endIcon,
272
+ onClick,
273
+ className,
274
+ ...restProps
400
275
  }) => {
401
- const usedSizeClass = checkboxSizeMapping[size];
402
- const innerIconSize = checkboxIconSizeMapping[size];
403
- const propagateChange = (checked2) => {
404
- if (onChangeTristate) {
405
- onChangeTristate(checked2);
276
+ const colorClasses = {
277
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
278
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
279
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
280
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
281
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
282
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
283
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
284
+ }[color];
285
+ const iconColorClasses = {
286
+ primary: "text-button-solid-primary-icon",
287
+ secondary: "text-button-solid-secondary-icon",
288
+ tertiary: "text-button-solid-tertiary-icon",
289
+ positive: "text-button-solid-positive-icon",
290
+ warning: "text-button-solid-warning-icon",
291
+ negative: "text-button-solid-negative-icon",
292
+ neutral: "text-button-solid-neutral-icon"
293
+ }[color];
294
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
295
+ "button",
296
+ {
297
+ onClick: disabled ? void 0 : onClick,
298
+ disabled: disabled || onClick === void 0,
299
+ className: (0, import_clsx3.default)(
300
+ {
301
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
302
+ [(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
303
+ },
304
+ ButtonUtil.paddingMapping[size],
305
+ className
306
+ ),
307
+ ...restProps,
308
+ children: [
309
+ startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
310
+ "span",
311
+ {
312
+ className: (0, import_clsx3.default)({
313
+ [iconColorClasses]: !disabled,
314
+ [`text-disabled-icon`]: disabled
315
+ }),
316
+ children: startIcon
317
+ }
318
+ ),
319
+ children,
320
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
321
+ "span",
322
+ {
323
+ className: (0, import_clsx3.default)({
324
+ [iconColorClasses]: !disabled,
325
+ [`text-disabled-icon`]: disabled
326
+ }),
327
+ children: endIcon
328
+ }
329
+ )
330
+ ]
406
331
  }
407
- if (onChange) {
408
- onChange(checked2 === "indeterminate" ? false : checked2);
332
+ );
333
+ };
334
+ var IconButton = ({
335
+ children,
336
+ disabled = false,
337
+ color = "primary",
338
+ size = "medium",
339
+ onClick,
340
+ className,
341
+ ...restProps
342
+ }) => {
343
+ const colorClasses = {
344
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
345
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
346
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
347
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
348
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
349
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
350
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
351
+ }[color];
352
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
353
+ "button",
354
+ {
355
+ onClick: disabled ? void 0 : onClick,
356
+ disabled: disabled || onClick === void 0,
357
+ className: (0, import_clsx3.default)(
358
+ {
359
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
360
+ [(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
361
+ },
362
+ ButtonUtil.iconPaddingMapping[size],
363
+ className
364
+ ),
365
+ ...restProps,
366
+ children
409
367
  }
368
+ );
369
+ };
370
+
371
+ // src/hooks/useSearch.ts
372
+ var import_react5 = require("react");
373
+
374
+ // src/util/simpleSearch.ts
375
+ var MultiSearchWithMapping = (search, objects, mapping) => {
376
+ return objects.filter((object) => {
377
+ const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
378
+ if (!mappedSearchKeywords) {
379
+ return true;
380
+ }
381
+ return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
382
+ });
383
+ };
384
+
385
+ // src/hooks/useSearch.ts
386
+ var useSearch = ({
387
+ list,
388
+ initialSearch,
389
+ searchMapping
390
+ }) => {
391
+ const [items, setItems] = (0, import_react5.useState)(list);
392
+ const [search, setSearch] = (0, import_react5.useState)(initialSearch);
393
+ (0, import_react5.useEffect)(() => {
394
+ setItems(list);
395
+ }, [list]);
396
+ const result = (0, import_react5.useMemo)(
397
+ () => MultiSearchWithMapping(search, items, searchMapping),
398
+ [search, items, searchMapping]
399
+ );
400
+ return {
401
+ result,
402
+ hasResult: result.length > 0,
403
+ allItems: items,
404
+ setItems,
405
+ search,
406
+ setSearch
410
407
  };
411
- const changeValue = () => {
412
- const newValue = checked === "indeterminate" ? false : !checked;
413
- propagateChange(newValue);
414
- };
415
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("row justify-center items-center", containerClassName), children: [
416
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
417
- CheckboxPrimitive.Root,
418
- {
419
- onCheckedChange: propagateChange,
420
- checked,
421
- disabled,
422
- id,
423
- className: (0, import_clsx4.default)(usedSizeClass, `items-center border-2 rounded outline-none focus:border-primary`, {
424
- "text-disabled-text border-disabled-text bg-disabled-background": disabled,
425
- "bg-surface": !disabled && !checked,
426
- "bg-primary/30 border-primary text-primary": checked === true || checked === "indeterminate",
427
- "hover:border-primary focus:hover:border-primary": !checked
428
- }, className),
429
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(CheckboxPrimitive.Indicator, { children: [
430
- checked === true && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Check, { className: innerIconSize }),
431
- checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Minus, { className: innerIconSize })
432
- ] })
433
- }
434
- ),
435
- label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
436
- Label,
437
- {
438
- ...label,
439
- className: (0, import_clsx4.default)("cursor-pointer", label.className),
440
- htmlFor: id,
441
- onClick: changeValue
442
- }
443
- )
408
+ };
409
+
410
+ // src/components/layout-and-navigation/SearchableList.tsx
411
+ var import_jsx_runtime5 = require("react/jsx-runtime");
412
+ var defaultSearchableListTranslation = {
413
+ en: {
414
+ search: "Search",
415
+ nothingFound: "Nothing found"
416
+ },
417
+ de: {
418
+ search: "Suche",
419
+ nothingFound: "Nichts gefunden"
420
+ }
421
+ };
422
+ var SearchableList = ({
423
+ overwriteTranslation,
424
+ list,
425
+ initialSearch = "",
426
+ searchMapping,
427
+ autoFocus,
428
+ minimumItemsForSearch = 6,
429
+ itemMapper,
430
+ className,
431
+ resultListClassName
432
+ }) => {
433
+ const translation = useTranslation(defaultSearchableListTranslation, overwriteTranslation);
434
+ const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
435
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("col gap-y-2", className), children: [
436
+ list.length > minimumItemsForSearch && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "row justify-between gap-x-4 items-center", children: [
437
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
438
+ Input,
439
+ {
440
+ value: search,
441
+ onChangeText: setSearch,
442
+ placeholder: translation.search,
443
+ autoFocus,
444
+ className: "w-full"
445
+ }
446
+ ),
447
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Search, { className: "w-full h-full" }) })
448
+ ] }),
449
+ hasResult ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx4.default)("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row text-description py-2 px-2", children: translation.nothingFound })
444
450
  ] });
445
451
  };
446
452
 
447
- // src/components/user-action/MultiSelect.tsx
453
+ // src/components/layout-and-navigation/Tile.tsx
454
+ var import_clsx5 = __toESM(require("clsx"));
455
+ var import_lucide_react2 = require("lucide-react");
448
456
  var import_jsx_runtime6 = require("react/jsx-runtime");
457
+ var Tile = ({
458
+ title,
459
+ description,
460
+ onClick,
461
+ isSelected = false,
462
+ isDisabled = false,
463
+ prefix,
464
+ suffix,
465
+ normalClassName = "hover:bg-primary/40 cursor-pointer",
466
+ selectedClassName = " bg-primary/20",
467
+ disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
468
+ className
469
+ }) => {
470
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
471
+ "div",
472
+ {
473
+ className: (0, import_clsx5.default)(
474
+ "row gap-x-2 w-full items-center",
475
+ {
476
+ [normalClassName]: !!onClick && !isDisabled,
477
+ [selectedClassName]: isSelected && !isDisabled,
478
+ [disabledClassName]: isDisabled
479
+ },
480
+ className
481
+ ),
482
+ onClick: isDisabled ? void 0 : onClick,
483
+ children: [
484
+ prefix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Check, { size: 24 }) : void 0),
485
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "col gap-y-0 w-full", children: [
486
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h4", { className: (0, import_clsx5.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
487
+ !!description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_clsx5.default)(description.className ?? "textstyle-description"), children: description.value })
488
+ ] }),
489
+ suffix
490
+ ]
491
+ }
492
+ );
493
+ };
494
+
495
+ // src/components/layout-and-navigation/Chip.tsx
496
+ var import_clsx6 = __toESM(require("clsx"));
497
+ var import_jsx_runtime7 = require("react/jsx-runtime");
498
+ var Chip = ({
499
+ children,
500
+ trailingIcon,
501
+ color = "default",
502
+ variant = "normal",
503
+ className = "",
504
+ ...restProps
505
+ }) => {
506
+ const colorMapping = {
507
+ default: "text-tag-default-text bg-tag-default-background",
508
+ dark: "text-tag-dark-text bg-tag-dark-background",
509
+ red: "text-tag-red-text bg-tag-red-background",
510
+ yellow: "text-tag-yellow-text bg-tag-yellow-background",
511
+ green: "text-tag-green-text bg-tag-green-background",
512
+ blue: "text-tag-blue-text bg-tag-blue-background",
513
+ pink: "text-tag-pink-text bg-tag-pink-background"
514
+ }[color];
515
+ const colorMappingIcon = {
516
+ default: "text-tag-default-icon",
517
+ dark: "text-tag-dark-icon",
518
+ red: "text-tag-red-icon",
519
+ yellow: "text-tag-yellow-icon",
520
+ green: "text-tag-green-icon",
521
+ blue: "text-tag-blue-icon",
522
+ pink: "text-tag-pink-icon"
523
+ }[color];
524
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
525
+ "div",
526
+ {
527
+ ...restProps,
528
+ className: (0, import_clsx6.default)(
529
+ `row w-fit px-2 py-1`,
530
+ colorMapping,
531
+ {
532
+ "rounded-md": variant === "normal",
533
+ "rounded-full": variant === "fullyRounded"
534
+ },
535
+ className
536
+ ),
537
+ children: [
538
+ children,
539
+ trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
540
+ ]
541
+ }
542
+ );
543
+ };
544
+ var ChipList = ({
545
+ list,
546
+ className = ""
547
+ }) => {
548
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_clsx6.default)("flex flex-wrap gap-x-4 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
549
+ Chip,
550
+ {
551
+ ...value,
552
+ color: value.color ?? "dark",
553
+ variant: value.variant ?? "normal",
554
+ children: value.children
555
+ },
556
+ index
557
+ )) });
558
+ };
559
+
560
+ // src/hooks/useOutsideClick.ts
561
+ var import_react6 = require("react");
562
+ var useOutsideClick = (refs, handler) => {
563
+ (0, import_react6.useEffect)(() => {
564
+ const listener = (event) => {
565
+ if (event.target === null) return;
566
+ if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
567
+ return;
568
+ }
569
+ handler();
570
+ };
571
+ document.addEventListener("mousedown", listener);
572
+ document.addEventListener("touchstart", listener);
573
+ return () => {
574
+ document.removeEventListener("mousedown", listener);
575
+ document.removeEventListener("touchstart", listener);
576
+ };
577
+ }, [refs, handler]);
578
+ };
579
+
580
+ // src/components/user-action/MultiSelect.tsx
581
+ var import_jsx_runtime8 = require("react/jsx-runtime");
449
582
  var defaultMultiSelectTranslation = {
450
583
  en: {
451
584
  select: "Select",
@@ -461,109 +594,149 @@ var defaultMultiSelectTranslation = {
461
594
  var MultiSelect = ({
462
595
  overwriteTranslation,
463
596
  options,
464
- onChange,
465
- search,
466
- disabled = false,
467
- selectedDisplay,
468
597
  label,
598
+ onChange,
469
599
  hintText,
470
- showDisabledOptions = true,
471
- className = "",
472
- triggerClassName = ""
600
+ isDisabled = false,
601
+ isSearchEnabled = false,
602
+ selectedDisplayOverwrite,
603
+ useChipDisplay = false,
604
+ className = ""
473
605
  }) => {
474
606
  const translation = useTranslation(defaultMultiSelectTranslation, overwriteTranslation);
475
- const [searchText, setSearchText] = (0, import_react9.useState)(search?.initialSearch ?? "");
476
- let filteredOptions = options;
477
- const enableSearch = !!search;
478
- if (enableSearch && !!searchText) {
479
- filteredOptions = MultiSearchWithMapping(
480
- searchText,
481
- filteredOptions,
482
- (value) => search.searchMapping(value)
483
- );
484
- }
485
- if (!showDisabledOptions) {
486
- filteredOptions = filteredOptions.filter((value) => !value.disabled);
487
- }
607
+ const triggerRef = (0, import_react7.useRef)(null);
608
+ const menuRef = (0, import_react7.useRef)(null);
609
+ const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
610
+ useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
488
611
  const selectedItems = options.filter((value) => value.selected);
489
- const menuButtonText = selectedItems.length === 0 ? hintText ?? translation.select : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: `${selectedItems.length} ${translation.selected}` });
490
- const borderColor = "border-menu-border";
491
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)(className), children: [
492
- label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
612
+ const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
613
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.default)(className), children: [
614
+ label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
493
615
  Label,
494
616
  {
495
617
  ...label,
496
618
  htmlFor: label.name,
497
- className: (0, import_clsx5.default)(" mb-1", label.className),
619
+ className: (0, import_clsx7.default)(" mb-1", label.className),
498
620
  labelType: label.labelType ?? "labelBig"
499
621
  }
500
622
  ),
501
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
502
- Menu,
503
- {
504
- alignment: "t_",
505
- trigger: (onClick, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
506
- "div",
507
- {
508
- ref,
509
- onClick: disabled ? void 0 : onClick,
510
- className: (0, import_clsx5.default)(
511
- borderColor,
512
- "bg-menu-background text-menu-text inline-w-full justify-between items-center rounded-lg border-2 px-4 py-2 font-medium",
513
- {
514
- "hover:border-primary cursor-pointer": !disabled,
515
- "bg-disabled-background text-disabled cursor-not-allowed": disabled
516
- },
517
- triggerClassName
518
- ),
519
- children: selectedDisplay ? selectedDisplay({ items: options, disabled }) : menuButtonText
520
- }
521
- ),
522
- menuClassName: (0, import_clsx5.default)(
523
- "!rounded-lg !shadow-lg !max-h-[500px] !min-w-[400px] !max-w-[70vh] !overflow-y-auto !border !border-2",
524
- borderColor,
525
- { "!py-0": !enableSearch, "!pb-0": enableSearch }
526
- ),
527
- children: [
528
- enableSearch && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "row gap-x-2 items-center px-2 py-2", children: [
529
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Input, { autoFocus: true, className: "w-full", value: searchText, onChangeText: setSearchText }),
530
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Search, {})
531
- ] }, "selectSearch"),
532
- filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
533
- MenuItem,
623
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
624
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
625
+ "button",
626
+ {
627
+ ref: triggerRef,
628
+ className: (0, import_clsx7.default)(
629
+ "btn-md justify-between w-full border-2 h-auto",
534
630
  {
535
- className: (0, import_clsx5.default)({
536
- "cursor-not-allowed !bg-disabled-background !text-disabled-text hover:brightness-100": !!option.disabled,
537
- "cursor-pointer": !option.disabled
538
- }),
539
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
540
- "div",
541
- {
542
- className: (0, import_clsx5.default)("overflow-hidden whitespace-nowrap text-ellipsis row items-center gap-x-2", option.className),
543
- onClick: () => {
544
- if (!option.disabled) {
631
+ "rounded-b-lg": !open,
632
+ "bg-menu-background border-menu-border hover:border-primary": !isDisabled,
633
+ "bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
634
+ }
635
+ ),
636
+ onClick: () => setIsOpen(!isOpen),
637
+ disabled: isDisabled,
638
+ children: [
639
+ !isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? (useChipDisplay && selectedItems ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) : `${selectedItems.length} ${translation.selected}`) }),
640
+ isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "textstyle-description", children: hintText ?? translation.select }),
641
+ isOpen ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronUp, { size: 24, className: "min-w-6" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronDown, { className: "min-w-6" })
642
+ ]
643
+ }
644
+ ),
645
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
646
+ "div",
647
+ {
648
+ ref: menuRef,
649
+ className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-md max-h-[500px] overflow-y-auto p-2",
650
+ children: [
651
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
652
+ SearchableList,
653
+ {
654
+ list: options,
655
+ minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
656
+ searchMapping: (item) => item.searchTags,
657
+ itemMapper: (option, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
658
+ Tile,
659
+ {
660
+ isSelected: option.selected,
661
+ className: "px-2 py-1 rounded-md",
662
+ disabledClassName: "text-disabled-text cursor-not-allowed",
663
+ title: { value: option.label, className: "font-semibold" },
664
+ onClick: () => {
545
665
  onChange(options.map((value) => value.value === option.value ? {
546
666
  ...option,
547
667
  selected: !value.selected
548
668
  } : value));
549
- }
669
+ },
670
+ isDisabled: option.disabled
550
671
  },
551
- children: [
552
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Checkbox, { checked: option.selected, disabled: option.disabled, size: "small" }),
553
- option.label
554
- ]
555
- }
556
- )
557
- },
558
- `item${index}`
559
- ))
560
- ]
561
- }
562
- )
672
+ index
673
+ )
674
+ }
675
+ ),
676
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row justify-between mt-2", children: [
677
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row gap-x-2", children: [
678
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
679
+ SolidButton,
680
+ {
681
+ color: "neutral",
682
+ size: "small",
683
+ onClick: () => {
684
+ onChange(options.map((option) => ({
685
+ ...option,
686
+ selected: !option.disabled
687
+ })));
688
+ },
689
+ disabled: options.every((value) => value.selected || value.disabled),
690
+ children: "All"
691
+ }
692
+ ),
693
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
694
+ SolidButton,
695
+ {
696
+ color: "neutral",
697
+ size: "small",
698
+ onClick: () => {
699
+ onChange(options.map((option) => ({
700
+ ...option,
701
+ selected: false
702
+ })));
703
+ },
704
+ children: "None"
705
+ }
706
+ )
707
+ ] }),
708
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SolidButton, { size: "small", onClick: () => setIsOpen(false), children: "Done" })
709
+ ] })
710
+ ]
711
+ }
712
+ )
713
+ ] })
563
714
  ] });
564
715
  };
716
+ var MultiSelectUncontrolled = ({
717
+ options,
718
+ onChange,
719
+ ...props
720
+ }) => {
721
+ const [usedOptions, setUsedOptions] = (0, import_react7.useState)(options);
722
+ (0, import_react7.useEffect)(() => {
723
+ setUsedOptions(options);
724
+ }, [options]);
725
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
726
+ MultiSelect,
727
+ {
728
+ ...props,
729
+ options: usedOptions,
730
+ onChange: (options2) => {
731
+ setUsedOptions(options2);
732
+ onChange(options2);
733
+ }
734
+ }
735
+ );
736
+ };
565
737
  // Annotate the CommonJS export names for ESM import in node:
566
738
  0 && (module.exports = {
567
- MultiSelect
739
+ MultiSelect,
740
+ MultiSelectUncontrolled
568
741
  });
569
742
  //# sourceMappingURL=MultiSelect.js.map