@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
@@ -32,7 +32,7 @@ __export(MultiSelectProperty_exports, {
32
32
  MultiSelectProperty: () => MultiSelectProperty
33
33
  });
34
34
  module.exports = __toCommonJS(MultiSelectProperty_exports);
35
- var import_lucide_react4 = require("lucide-react");
35
+ var import_lucide_react5 = require("lucide-react");
36
36
  var import_clsx9 = __toESM(require("clsx"));
37
37
 
38
38
  // src/localization/LanguageProvider.tsx
@@ -75,152 +75,41 @@ var useTranslation = (defaults, translationOverwrite = {}) => {
75
75
  };
76
76
 
77
77
  // src/components/user-action/MultiSelect.tsx
78
- var import_react9 = require("react");
79
- var import_lucide_react2 = require("lucide-react");
80
-
81
- // src/util/simpleSearch.ts
82
- var MultiSearchWithMapping = (search, objects, mapping) => {
83
- return objects.filter((object) => {
84
- const mappedSearchKeywords = mapping(object).map((value) => value.toLowerCase().trim());
85
- return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
86
- });
87
- };
88
-
89
- // src/components/user-action/MultiSelect.tsx
90
- var import_clsx5 = __toESM(require("clsx"));
78
+ var import_react7 = require("react");
79
+ var import_lucide_react3 = require("lucide-react");
80
+ var import_clsx7 = __toESM(require("clsx"));
91
81
 
92
- // src/components/user-action/Menu.tsx
93
- var import_react5 = require("react");
82
+ // src/components/user-action/Label.tsx
94
83
  var import_clsx = __toESM(require("clsx"));
95
-
96
- // src/hooks/useOutsideClick.ts
97
- var import_react3 = require("react");
98
- var useOutsideClick = (refs, handler) => {
99
- (0, import_react3.useEffect)(() => {
100
- const listener = (event) => {
101
- if (event.target === null) return;
102
- if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
103
- return;
104
- }
105
- handler();
106
- };
107
- document.addEventListener("mousedown", listener);
108
- document.addEventListener("touchstart", listener);
109
- return () => {
110
- document.removeEventListener("mousedown", listener);
111
- document.removeEventListener("touchstart", listener);
112
- };
113
- }, [refs, handler]);
114
- };
115
-
116
- // src/hooks/useHoverState.ts
117
- var import_react4 = require("react");
118
- var defaultUseHoverStateProps = {
119
- closingDelay: 200,
120
- isDisabled: false
121
- };
122
- var useHoverState = (props = void 0) => {
123
- const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
124
- const [isHovered, setIsHovered] = (0, import_react4.useState)(false);
125
- const [timer, setTimer] = (0, import_react4.useState)();
126
- const onMouseEnter = () => {
127
- if (isDisabled) {
128
- return;
129
- }
130
- clearTimeout(timer);
131
- setIsHovered(true);
132
- };
133
- const onMouseLeave = () => {
134
- if (isDisabled) {
135
- return;
136
- }
137
- setTimer(setTimeout(() => {
138
- setIsHovered(false);
139
- }, closingDelay));
140
- };
141
- (0, import_react4.useEffect)(() => {
142
- if (timer) {
143
- return () => {
144
- clearTimeout(timer);
145
- };
146
- }
147
- });
148
- (0, import_react4.useEffect)(() => {
149
- if (timer) {
150
- clearTimeout(timer);
151
- }
152
- }, [isDisabled]);
153
- return {
154
- isHovered,
155
- setIsHovered,
156
- handlers: { onMouseEnter, onMouseLeave }
157
- };
158
- };
159
-
160
- // src/components/user-action/Menu.tsx
161
84
  var import_jsx_runtime2 = require("react/jsx-runtime");
162
- var MenuItem = ({
163
- children,
164
- onClick,
165
- alignment = "left",
166
- className
167
- }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
168
- "div",
169
- {
170
- className: (0, import_clsx.default)("block px-3 py-1 bg-menu-background text-menu-text hover:brightness-90", {
171
- "text-right": alignment === "right",
172
- "text-left": alignment === "left"
173
- }, className),
174
- onClick,
175
- children
176
- }
177
- );
178
- var Menu = ({
179
- trigger,
85
+ var styleMapping = {
86
+ labelSmall: "textstyle-label-sm",
87
+ labelMedium: "textstyle-label-md",
88
+ labelBig: "textstyle-label-lg"
89
+ };
90
+ var Label = ({
180
91
  children,
181
- alignment = "tl",
182
- showOnHover = false,
183
- menuClassName = ""
92
+ name,
93
+ labelType = "labelSmall",
94
+ className,
95
+ ...props
184
96
  }) => {
185
- const { isHovered: isOpen, setIsHovered: setIsOpen, handlers } = useHoverState({ isDisabled: !showOnHover });
186
- const triggerRef = (0, import_react5.useRef)(null);
187
- const menuRef = (0, import_react5.useRef)(null);
188
- useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
189
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
190
- "div",
191
- {
192
- className: "relative",
193
- ...handlers,
194
- children: [
195
- trigger(() => setIsOpen(!isOpen), triggerRef),
196
- isOpen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
197
- "div",
198
- {
199
- ref: menuRef,
200
- onClick: (e) => e.stopPropagation(),
201
- 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]", {
202
- " top-[8px]": alignment[0] === "t",
203
- " bottom-[8px]": alignment[0] === "b",
204
- " left-[-8px]": alignment[1] === "l",
205
- " right-[-8px]": alignment[1] === "r"
206
- }, menuClassName),
207
- children
208
- }
209
- ) : null
210
- ]
211
- }
212
- );
97
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
213
98
  };
214
99
 
100
+ // src/components/layout-and-navigation/SearchableList.tsx
101
+ var import_lucide_react = require("lucide-react");
102
+ var import_clsx4 = __toESM(require("clsx"));
103
+
215
104
  // src/components/user-action/Input.tsx
216
- var import_react7 = require("react");
217
- var import_clsx3 = __toESM(require("clsx"));
105
+ var import_react4 = require("react");
106
+ var import_clsx2 = __toESM(require("clsx"));
218
107
 
219
108
  // src/hooks/useSaveDelay.ts
220
- var import_react6 = require("react");
109
+ var import_react3 = require("react");
221
110
  function useSaveDelay(setNotificationStatus, delay) {
222
- const [updateTimer, setUpdateTimer] = (0, import_react6.useState)(void 0);
223
- const [notificationTimer, setNotificationTimer] = (0, import_react6.useState)(void 0);
111
+ const [updateTimer, setUpdateTimer] = (0, import_react3.useState)(void 0);
112
+ const [notificationTimer, setNotificationTimer] = (0, import_react3.useState)(void 0);
224
113
  const restartTimer = (onSave) => {
225
114
  clearTimeout(updateTimer);
226
115
  setUpdateTimer(setTimeout(() => {
@@ -247,7 +136,7 @@ function useSaveDelay(setNotificationStatus, delay) {
247
136
  setNotificationStatus(false);
248
137
  }
249
138
  };
250
- (0, import_react6.useEffect)(() => {
139
+ (0, import_react3.useEffect)(() => {
251
140
  return () => {
252
141
  clearTimeout(updateTimer);
253
142
  clearTimeout(notificationTimer);
@@ -259,26 +148,8 @@ function useSaveDelay(setNotificationStatus, delay) {
259
148
  // src/util/noop.ts
260
149
  var noop = () => void 0;
261
150
 
262
- // src/components/user-action/Label.tsx
263
- var import_clsx2 = __toESM(require("clsx"));
264
- var import_jsx_runtime3 = require("react/jsx-runtime");
265
- var styleMapping = {
266
- labelSmall: "textstyle-label-sm",
267
- labelMedium: "textstyle-label-md",
268
- labelBig: "textstyle-label-lg"
269
- };
270
- var Label = ({
271
- children,
272
- name,
273
- labelType = "labelSmall",
274
- className,
275
- ...props
276
- }) => {
277
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { ...props, className: (0, import_clsx2.default)(styleMapping[labelType], className), children: children ? children : name });
278
- };
279
-
280
151
  // src/components/user-action/Input.tsx
281
- var import_jsx_runtime4 = require("react/jsx-runtime");
152
+ var import_jsx_runtime3 = require("react/jsx-runtime");
282
153
  var Input = ({
283
154
  id,
284
155
  type = "text",
@@ -298,15 +169,15 @@ var Input = ({
298
169
  restartTimer,
299
170
  clearUpdateTimer
300
171
  } = useSaveDelay(() => void 0, 3e3);
301
- const ref = (0, import_react7.useRef)(null);
302
- (0, import_react7.useEffect)(() => {
172
+ const ref = (0, import_react4.useRef)(null);
173
+ (0, import_react4.useEffect)(() => {
303
174
  if (autoFocus) {
304
175
  ref.current?.focus();
305
176
  }
306
177
  }, [autoFocus]);
307
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx3.default)({ "w-full": expanded }, containerClassName), children: [
308
- label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx3.default)("mb-1", label.className) }),
309
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
178
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)({ "w-full": expanded }, containerClassName), children: [
179
+ label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx2.default)("mb-1", label.className) }),
180
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
310
181
  "input",
311
182
  {
312
183
  ref,
@@ -339,7 +210,7 @@ var Input = ({
339
210
  )
340
211
  ] });
341
212
  };
342
- var FormInput = (0, import_react7.forwardRef)(function FormInput2({
213
+ var FormInput = (0, import_react4.forwardRef)(function FormInput2({
343
214
  id,
344
215
  labelText,
345
216
  errorText,
@@ -350,13 +221,13 @@ var FormInput = (0, import_react7.forwardRef)(function FormInput2({
350
221
  required,
351
222
  ...restProps
352
223
  }, ref) {
353
- const input = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
224
+ const input = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
354
225
  "input",
355
226
  {
356
227
  ref,
357
228
  id,
358
229
  ...restProps,
359
- className: (0, import_clsx3.default)(
230
+ className: (0, import_clsx2.default)(
360
231
  {
361
232
  "focus:border-primary focus:ring-primary": !errorText,
362
233
  "focus:border-negative focus:ring-negative text-negative": !!errorText
@@ -365,208 +236,324 @@ var FormInput = (0, import_react7.forwardRef)(function FormInput2({
365
236
  )
366
237
  }
367
238
  );
368
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx3.default)("flex flex-col gap-y-1", containerClassName), children: [
369
- labelText && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { htmlFor: id, className: (0, import_clsx3.default)("textstyle-label-md", labelClassName), children: [
239
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)("flex flex-col gap-y-1", containerClassName), children: [
240
+ labelText && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { htmlFor: id, className: (0, import_clsx2.default)("textstyle-label-md", labelClassName), children: [
370
241
  labelText,
371
- required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-primary font-bold", children: "*" })
242
+ required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-primary font-bold", children: "*" })
372
243
  ] }),
373
244
  input,
374
- errorText && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: id, className: (0, import_clsx3.default)("text-negative", errorClassName), children: errorText })
245
+ errorText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: id, className: (0, import_clsx2.default)("text-negative", errorClassName), children: errorText })
375
246
  ] });
376
247
  });
377
248
 
378
- // src/components/user-action/Checkbox.tsx
379
- var import_react8 = require("react");
380
- var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
381
- var import_lucide_react = require("lucide-react");
382
- var import_clsx4 = __toESM(require("clsx"));
383
- var import_jsx_runtime5 = require("react/jsx-runtime");
384
- var checkboxSizeMapping = {
385
- small: "size-4",
386
- medium: "size-6",
387
- large: "size-8"
249
+ // src/components/user-action/Button.tsx
250
+ var import_clsx3 = __toESM(require("clsx"));
251
+ var import_jsx_runtime4 = require("react/jsx-runtime");
252
+ var paddingMapping = {
253
+ small: "btn-sm",
254
+ medium: "btn-md",
255
+ large: "btn-lg"
256
+ };
257
+ var iconPaddingMapping = {
258
+ small: "icon-btn-sm",
259
+ medium: "icon-btn-md",
260
+ large: "icon-btn-lg"
388
261
  };
389
- var checkboxIconSizeMapping = {
390
- small: "size-3",
391
- medium: "size-5",
392
- large: "size-7"
262
+ var ButtonUtil = {
263
+ paddingMapping,
264
+ iconPaddingMapping
393
265
  };
394
- var Checkbox = ({
395
- id,
396
- label,
397
- checked,
398
- disabled,
399
- onChange,
400
- onChangeTristate,
266
+ var SolidButton = ({
267
+ children,
268
+ disabled = false,
269
+ color = "primary",
401
270
  size = "medium",
402
- className = "",
403
- containerClassName
271
+ startIcon,
272
+ endIcon,
273
+ onClick,
274
+ className,
275
+ ...restProps
404
276
  }) => {
405
- const usedSizeClass = checkboxSizeMapping[size];
406
- const innerIconSize = checkboxIconSizeMapping[size];
407
- const propagateChange = (checked2) => {
408
- if (onChangeTristate) {
409
- onChangeTristate(checked2);
277
+ const colorClasses = {
278
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
279
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
280
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
281
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
282
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
283
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
284
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
285
+ }[color];
286
+ const iconColorClasses = {
287
+ primary: "text-button-solid-primary-icon",
288
+ secondary: "text-button-solid-secondary-icon",
289
+ tertiary: "text-button-solid-tertiary-icon",
290
+ positive: "text-button-solid-positive-icon",
291
+ warning: "text-button-solid-warning-icon",
292
+ negative: "text-button-solid-negative-icon",
293
+ neutral: "text-button-solid-neutral-icon"
294
+ }[color];
295
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
296
+ "button",
297
+ {
298
+ onClick: disabled ? void 0 : onClick,
299
+ disabled: disabled || onClick === void 0,
300
+ className: (0, import_clsx3.default)(
301
+ {
302
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
303
+ [(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
304
+ },
305
+ ButtonUtil.paddingMapping[size],
306
+ className
307
+ ),
308
+ ...restProps,
309
+ children: [
310
+ startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
311
+ "span",
312
+ {
313
+ className: (0, import_clsx3.default)({
314
+ [iconColorClasses]: !disabled,
315
+ [`text-disabled-icon`]: disabled
316
+ }),
317
+ children: startIcon
318
+ }
319
+ ),
320
+ children,
321
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
322
+ "span",
323
+ {
324
+ className: (0, import_clsx3.default)({
325
+ [iconColorClasses]: !disabled,
326
+ [`text-disabled-icon`]: disabled
327
+ }),
328
+ children: endIcon
329
+ }
330
+ )
331
+ ]
410
332
  }
411
- if (onChange) {
412
- onChange(checked2 === "indeterminate" ? false : checked2);
333
+ );
334
+ };
335
+ var TextButton = ({
336
+ children,
337
+ disabled = false,
338
+ color = "neutral",
339
+ size = "medium",
340
+ startIcon,
341
+ endIcon,
342
+ onClick,
343
+ className,
344
+ ...restProps
345
+ }) => {
346
+ const colorClasses = {
347
+ primary: "bg-transparent text-button-text-primary-text",
348
+ negative: "bg-transparent text-button-text-negative-text",
349
+ neutral: "bg-transparent text-button-text-neutral-text"
350
+ }[color];
351
+ const iconColorClasses = {
352
+ primary: "text-button-text-primary-icon",
353
+ negative: "text-button-text-negative-icon",
354
+ neutral: "text-button-text-neutral-icon"
355
+ }[color];
356
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
357
+ "button",
358
+ {
359
+ onClick: disabled ? void 0 : onClick,
360
+ disabled: disabled || onClick === void 0,
361
+ className: (0, import_clsx3.default)(
362
+ {
363
+ "text-disabled-text cursor-not-allowed": disabled,
364
+ [(0, import_clsx3.default)(colorClasses, "hover:bg-button-text-hover-background rounded-full")]: !disabled
365
+ },
366
+ ButtonUtil.paddingMapping[size],
367
+ className
368
+ ),
369
+ ...restProps,
370
+ children: [
371
+ startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
372
+ "span",
373
+ {
374
+ className: (0, import_clsx3.default)({
375
+ [iconColorClasses]: !disabled,
376
+ [`text-disabled-icon`]: disabled
377
+ }),
378
+ children: startIcon
379
+ }
380
+ ),
381
+ children,
382
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
383
+ "span",
384
+ {
385
+ className: (0, import_clsx3.default)({
386
+ [iconColorClasses]: !disabled,
387
+ [`text-disabled-icon`]: disabled
388
+ }),
389
+ children: endIcon
390
+ }
391
+ )
392
+ ]
413
393
  }
394
+ );
395
+ };
396
+ var IconButton = ({
397
+ children,
398
+ disabled = false,
399
+ color = "primary",
400
+ size = "medium",
401
+ onClick,
402
+ className,
403
+ ...restProps
404
+ }) => {
405
+ const colorClasses = {
406
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
407
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
408
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
409
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
410
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
411
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
412
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
413
+ }[color];
414
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
415
+ "button",
416
+ {
417
+ onClick: disabled ? void 0 : onClick,
418
+ disabled: disabled || onClick === void 0,
419
+ className: (0, import_clsx3.default)(
420
+ {
421
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
422
+ [(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
423
+ },
424
+ ButtonUtil.iconPaddingMapping[size],
425
+ className
426
+ ),
427
+ ...restProps,
428
+ children
429
+ }
430
+ );
431
+ };
432
+
433
+ // src/hooks/useSearch.ts
434
+ var import_react5 = require("react");
435
+
436
+ // src/util/simpleSearch.ts
437
+ var MultiSearchWithMapping = (search, objects, mapping) => {
438
+ return objects.filter((object) => {
439
+ const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
440
+ if (!mappedSearchKeywords) {
441
+ return true;
442
+ }
443
+ return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
444
+ });
445
+ };
446
+
447
+ // src/hooks/useSearch.ts
448
+ var useSearch = ({
449
+ list,
450
+ initialSearch,
451
+ searchMapping
452
+ }) => {
453
+ const [items, setItems] = (0, import_react5.useState)(list);
454
+ const [search, setSearch] = (0, import_react5.useState)(initialSearch);
455
+ (0, import_react5.useEffect)(() => {
456
+ setItems(list);
457
+ }, [list]);
458
+ const result = (0, import_react5.useMemo)(
459
+ () => MultiSearchWithMapping(search, items, searchMapping),
460
+ [search, items, searchMapping]
461
+ );
462
+ return {
463
+ result,
464
+ hasResult: result.length > 0,
465
+ allItems: items,
466
+ setItems,
467
+ search,
468
+ setSearch
414
469
  };
415
- const changeValue = () => {
416
- const newValue = checked === "indeterminate" ? false : !checked;
417
- propagateChange(newValue);
418
- };
419
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("row justify-center items-center", containerClassName), children: [
420
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
421
- CheckboxPrimitive.Root,
422
- {
423
- onCheckedChange: propagateChange,
424
- checked,
425
- disabled,
426
- id,
427
- className: (0, import_clsx4.default)(usedSizeClass, `items-center border-2 rounded outline-none focus:border-primary`, {
428
- "text-disabled-text border-disabled-text bg-disabled-background": disabled,
429
- "bg-surface": !disabled && !checked,
430
- "bg-primary/30 border-primary text-primary": checked === true || checked === "indeterminate",
431
- "hover:border-primary focus:hover:border-primary": !checked
432
- }, className),
433
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(CheckboxPrimitive.Indicator, { children: [
434
- checked === true && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Check, { className: innerIconSize }),
435
- checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Minus, { className: innerIconSize })
436
- ] })
437
- }
438
- ),
439
- label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
440
- Label,
441
- {
442
- ...label,
443
- className: (0, import_clsx4.default)("cursor-pointer", label.className),
444
- htmlFor: id,
445
- onClick: changeValue
446
- }
447
- )
448
- ] });
449
470
  };
450
471
 
451
- // src/components/user-action/MultiSelect.tsx
452
- var import_jsx_runtime6 = require("react/jsx-runtime");
453
- var defaultMultiSelectTranslation = {
472
+ // src/components/layout-and-navigation/SearchableList.tsx
473
+ var import_jsx_runtime5 = require("react/jsx-runtime");
474
+ var defaultSearchableListTranslation = {
454
475
  en: {
455
- select: "Select",
456
476
  search: "Search",
457
- selected: "selected"
477
+ nothingFound: "Nothing found"
458
478
  },
459
479
  de: {
460
- select: "Ausw\xE4hlen",
461
480
  search: "Suche",
462
- selected: "ausgew\xE4hlt"
481
+ nothingFound: "Nichts gefunden"
463
482
  }
464
483
  };
465
- var MultiSelect = ({
484
+ var SearchableList = ({
466
485
  overwriteTranslation,
467
- options,
468
- onChange,
469
- search,
470
- disabled = false,
471
- selectedDisplay,
472
- label,
473
- hintText,
474
- showDisabledOptions = true,
475
- className = "",
476
- triggerClassName = ""
486
+ list,
487
+ initialSearch = "",
488
+ searchMapping,
489
+ autoFocus,
490
+ minimumItemsForSearch = 6,
491
+ itemMapper,
492
+ className,
493
+ resultListClassName
477
494
  }) => {
478
- const translation = useTranslation(defaultMultiSelectTranslation, overwriteTranslation);
479
- const [searchText, setSearchText] = (0, import_react9.useState)(search?.initialSearch ?? "");
480
- let filteredOptions = options;
481
- const enableSearch = !!search;
482
- if (enableSearch && !!searchText) {
483
- filteredOptions = MultiSearchWithMapping(
484
- searchText,
485
- filteredOptions,
486
- (value) => search.searchMapping(value)
487
- );
488
- }
489
- if (!showDisabledOptions) {
490
- filteredOptions = filteredOptions.filter((value) => !value.disabled);
491
- }
492
- const selectedItems = options.filter((value) => value.selected);
493
- const menuButtonText = selectedItems.length === 0 ? hintText ?? translation.select : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: `${selectedItems.length} ${translation.selected}` });
494
- const borderColor = "border-menu-border";
495
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)(className), children: [
496
- label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
497
- Label,
498
- {
499
- ...label,
500
- htmlFor: label.name,
501
- className: (0, import_clsx5.default)(" mb-1", label.className),
502
- labelType: label.labelType ?? "labelBig"
503
- }
504
- ),
505
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
506
- Menu,
507
- {
508
- alignment: "t_",
509
- trigger: (onClick, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
510
- "div",
511
- {
512
- ref,
513
- onClick: disabled ? void 0 : onClick,
514
- className: (0, import_clsx5.default)(
515
- borderColor,
516
- "bg-menu-background text-menu-text inline-w-full justify-between items-center rounded-lg border-2 px-4 py-2 font-medium",
517
- {
518
- "hover:border-primary cursor-pointer": !disabled,
519
- "bg-disabled-background text-disabled cursor-not-allowed": disabled
520
- },
521
- triggerClassName
522
- ),
523
- children: selectedDisplay ? selectedDisplay({ items: options, disabled }) : menuButtonText
524
- }
525
- ),
526
- menuClassName: (0, import_clsx5.default)(
527
- "!rounded-lg !shadow-lg !max-h-[500px] !min-w-[400px] !max-w-[70vh] !overflow-y-auto !border !border-2",
528
- borderColor,
529
- { "!py-0": !enableSearch, "!pb-0": enableSearch }
530
- ),
531
- children: [
532
- enableSearch && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "row gap-x-2 items-center px-2 py-2", children: [
533
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Input, { autoFocus: true, className: "w-full", value: searchText, onChangeText: setSearchText }),
534
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Search, {})
535
- ] }, "selectSearch"),
536
- filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
537
- MenuItem,
538
- {
539
- className: (0, import_clsx5.default)({
540
- "cursor-not-allowed !bg-disabled-background !text-disabled-text hover:brightness-100": !!option.disabled,
541
- "cursor-pointer": !option.disabled
542
- }),
543
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
544
- "div",
545
- {
546
- className: (0, import_clsx5.default)("overflow-hidden whitespace-nowrap text-ellipsis row items-center gap-x-2", option.className),
547
- onClick: () => {
548
- if (!option.disabled) {
549
- onChange(options.map((value) => value.value === option.value ? {
550
- ...option,
551
- selected: !value.selected
552
- } : value));
553
- }
554
- },
555
- children: [
556
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Checkbox, { checked: option.selected, disabled: option.disabled, size: "small" }),
557
- option.label
558
- ]
559
- }
560
- )
561
- },
562
- `item${index}`
563
- ))
564
- ]
565
- }
566
- )
495
+ const translation = useTranslation(defaultSearchableListTranslation, overwriteTranslation);
496
+ const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
497
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("col gap-y-2", className), children: [
498
+ list.length > minimumItemsForSearch && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "row justify-between gap-x-4 items-center", children: [
499
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
500
+ Input,
501
+ {
502
+ value: search,
503
+ onChangeText: setSearch,
504
+ placeholder: translation.search,
505
+ autoFocus,
506
+ className: "w-full"
507
+ }
508
+ ),
509
+ /* @__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" }) })
510
+ ] }),
511
+ 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 })
567
512
  ] });
568
513
  };
569
514
 
515
+ // src/components/layout-and-navigation/Tile.tsx
516
+ var import_clsx5 = __toESM(require("clsx"));
517
+ var import_lucide_react2 = require("lucide-react");
518
+ var import_jsx_runtime6 = require("react/jsx-runtime");
519
+ var Tile = ({
520
+ title,
521
+ description,
522
+ onClick,
523
+ isSelected = false,
524
+ isDisabled = false,
525
+ prefix,
526
+ suffix,
527
+ normalClassName = "hover:bg-primary/40 cursor-pointer",
528
+ selectedClassName = " bg-primary/20",
529
+ disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
530
+ className
531
+ }) => {
532
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
533
+ "div",
534
+ {
535
+ className: (0, import_clsx5.default)(
536
+ "row gap-x-2 w-full items-center",
537
+ {
538
+ [normalClassName]: !!onClick && !isDisabled,
539
+ [selectedClassName]: isSelected && !isDisabled,
540
+ [disabledClassName]: isDisabled
541
+ },
542
+ className
543
+ ),
544
+ onClick: isDisabled ? void 0 : onClick,
545
+ children: [
546
+ prefix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Check, { size: 24 }) : void 0),
547
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "col gap-y-0 w-full", children: [
548
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h4", { className: (0, import_clsx5.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
549
+ !!description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_clsx5.default)(description.className ?? "textstyle-description"), children: description.value })
550
+ ] }),
551
+ suffix
552
+ ]
553
+ }
554
+ );
555
+ };
556
+
570
557
  // src/components/layout-and-navigation/Chip.tsx
571
558
  var import_clsx6 = __toESM(require("clsx"));
572
559
  var import_jsx_runtime7 = require("react/jsx-runtime");
@@ -632,90 +619,166 @@ var ChipList = ({
632
619
  )) });
633
620
  };
634
621
 
635
- // src/components/properties/PropertyBase.tsx
636
- var import_lucide_react3 = require("lucide-react");
637
- var import_clsx8 = __toESM(require("clsx"));
622
+ // src/hooks/useOutsideClick.ts
623
+ var import_react6 = require("react");
624
+ var useOutsideClick = (refs, handler) => {
625
+ (0, import_react6.useEffect)(() => {
626
+ const listener = (event) => {
627
+ if (event.target === null) return;
628
+ if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
629
+ return;
630
+ }
631
+ handler();
632
+ };
633
+ document.addEventListener("mousedown", listener);
634
+ document.addEventListener("touchstart", listener);
635
+ return () => {
636
+ document.removeEventListener("mousedown", listener);
637
+ document.removeEventListener("touchstart", listener);
638
+ };
639
+ }, [refs, handler]);
640
+ };
638
641
 
639
- // src/components/user-action/Button.tsx
640
- var import_clsx7 = __toESM(require("clsx"));
642
+ // src/components/user-action/MultiSelect.tsx
641
643
  var import_jsx_runtime8 = require("react/jsx-runtime");
642
- var paddingMapping = {
643
- small: "btn-sm",
644
- medium: "btn-md",
645
- large: "btn-lg"
646
- };
647
- var iconPaddingMapping = {
648
- small: "icon-btn-sm",
649
- medium: "icon-btn-md",
650
- large: "icon-btn-lg"
651
- };
652
- var ButtonUtil = {
653
- paddingMapping,
654
- iconPaddingMapping
644
+ var defaultMultiSelectTranslation = {
645
+ en: {
646
+ select: "Select",
647
+ search: "Search",
648
+ selected: "selected"
649
+ },
650
+ de: {
651
+ select: "Ausw\xE4hlen",
652
+ search: "Suche",
653
+ selected: "ausgew\xE4hlt"
654
+ }
655
655
  };
656
- var TextButton = ({
657
- children,
658
- disabled = false,
659
- color = "neutral",
660
- size = "medium",
661
- startIcon,
662
- endIcon,
663
- onClick,
664
- className,
665
- ...restProps
656
+ var MultiSelect = ({
657
+ overwriteTranslation,
658
+ options,
659
+ label,
660
+ onChange,
661
+ hintText,
662
+ isDisabled = false,
663
+ isSearchEnabled = false,
664
+ selectedDisplayOverwrite,
665
+ useChipDisplay = false,
666
+ className = ""
666
667
  }) => {
667
- const colorClasses = {
668
- primary: "bg-transparent text-button-text-primary-text",
669
- negative: "bg-transparent text-button-text-negative-text",
670
- neutral: "bg-transparent text-button-text-neutral-text"
671
- }[color];
672
- const iconColorClasses = {
673
- primary: "text-button-text-primary-icon",
674
- negative: "text-button-text-negative-icon",
675
- neutral: "text-button-text-neutral-icon"
676
- }[color];
677
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
678
- "button",
679
- {
680
- onClick: disabled ? void 0 : onClick,
681
- disabled: disabled || onClick === void 0,
682
- className: (0, import_clsx7.default)(
668
+ const translation = useTranslation(defaultMultiSelectTranslation, overwriteTranslation);
669
+ const triggerRef = (0, import_react7.useRef)(null);
670
+ const menuRef = (0, import_react7.useRef)(null);
671
+ const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
672
+ useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
673
+ const selectedItems = options.filter((value) => value.selected);
674
+ const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
675
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.default)(className), children: [
676
+ label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
677
+ Label,
678
+ {
679
+ ...label,
680
+ htmlFor: label.name,
681
+ className: (0, import_clsx7.default)(" mb-1", label.className),
682
+ labelType: label.labelType ?? "labelBig"
683
+ }
684
+ ),
685
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
686
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
687
+ "button",
683
688
  {
684
- "text-disabled-text cursor-not-allowed": disabled,
685
- [(0, import_clsx7.default)(colorClasses, "hover:bg-button-text-hover-background rounded-full")]: !disabled
686
- },
687
- ButtonUtil.paddingMapping[size],
688
- className
689
+ ref: triggerRef,
690
+ className: (0, import_clsx7.default)(
691
+ "btn-md justify-between w-full border-2 h-auto",
692
+ {
693
+ "rounded-b-lg": !open,
694
+ "bg-menu-background border-menu-border hover:border-primary": !isDisabled,
695
+ "bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
696
+ }
697
+ ),
698
+ onClick: () => setIsOpen(!isOpen),
699
+ disabled: isDisabled,
700
+ children: [
701
+ !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}`) }),
702
+ isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "textstyle-description", children: hintText ?? translation.select }),
703
+ 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" })
704
+ ]
705
+ }
689
706
  ),
690
- ...restProps,
691
- children: [
692
- startIcon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
693
- "span",
694
- {
695
- className: (0, import_clsx7.default)({
696
- [iconColorClasses]: !disabled,
697
- [`text-disabled-icon`]: disabled
698
- }),
699
- children: startIcon
700
- }
701
- ),
702
- children,
703
- endIcon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
704
- "span",
705
- {
706
- className: (0, import_clsx7.default)({
707
- [iconColorClasses]: !disabled,
708
- [`text-disabled-icon`]: disabled
709
- }),
710
- children: endIcon
711
- }
712
- )
713
- ]
714
- }
715
- );
707
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
708
+ "div",
709
+ {
710
+ ref: menuRef,
711
+ 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",
712
+ children: [
713
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
714
+ SearchableList,
715
+ {
716
+ list: options,
717
+ minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
718
+ searchMapping: (item) => item.searchTags,
719
+ itemMapper: (option, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
720
+ Tile,
721
+ {
722
+ isSelected: option.selected,
723
+ className: "px-2 py-1 rounded-md",
724
+ disabledClassName: "text-disabled-text cursor-not-allowed",
725
+ title: { value: option.label, className: "font-semibold" },
726
+ onClick: () => {
727
+ onChange(options.map((value) => value.value === option.value ? {
728
+ ...option,
729
+ selected: !value.selected
730
+ } : value));
731
+ },
732
+ isDisabled: option.disabled
733
+ },
734
+ index
735
+ )
736
+ }
737
+ ),
738
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row justify-between mt-2", children: [
739
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row gap-x-2", children: [
740
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
741
+ SolidButton,
742
+ {
743
+ color: "neutral",
744
+ size: "small",
745
+ onClick: () => {
746
+ onChange(options.map((option) => ({
747
+ ...option,
748
+ selected: !option.disabled
749
+ })));
750
+ },
751
+ disabled: options.every((value) => value.selected || value.disabled),
752
+ children: "All"
753
+ }
754
+ ),
755
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
756
+ SolidButton,
757
+ {
758
+ color: "neutral",
759
+ size: "small",
760
+ onClick: () => {
761
+ onChange(options.map((option) => ({
762
+ ...option,
763
+ selected: false
764
+ })));
765
+ },
766
+ children: "None"
767
+ }
768
+ )
769
+ ] }),
770
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SolidButton, { size: "small", onClick: () => setIsOpen(false), children: "Done" })
771
+ ] })
772
+ ]
773
+ }
774
+ )
775
+ ] })
776
+ ] });
716
777
  };
717
778
 
718
779
  // src/components/properties/PropertyBase.tsx
780
+ var import_lucide_react4 = require("lucide-react");
781
+ var import_clsx8 = __toESM(require("clsx"));
719
782
  var import_jsx_runtime9 = require("react/jsx-runtime");
720
783
  var defaultPropertyBaseTranslation = {
721
784
  en: {
@@ -755,13 +818,13 @@ var PropertyBase = ({
755
818
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
756
819
  "div",
757
820
  {
758
- className: (0, import_clsx8.default)("row grow justify-between items-center rounded-r-xl border-2 border-l-0", {
821
+ className: (0, import_clsx8.default)("row gap-x-0 grow justify-between items-center rounded-r-xl border-2 border-l-0", {
759
822
  "bg-surface group-hover:border-primary": !requiredAndNoValue,
760
823
  "bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
761
824
  }, className),
762
825
  children: [
763
826
  input({ softRequired, hasValue }),
764
- requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-warning pr-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.AlertTriangle, { size: 24 }) }),
827
+ requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-warning pr-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.AlertTriangle, { size: 24 }) }),
765
828
  onRemove && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
766
829
  TextButton,
767
830
  {
@@ -799,10 +862,6 @@ var MultiSelectProperty = ({
799
862
  }) => {
800
863
  const translation = useTranslation(defaultMultiSelectPropertyTranslation, overwriteTranslation);
801
864
  const hasValue = options.some((value) => value.selected);
802
- let triggerClassName;
803
- if (softRequired && !hasValue) {
804
- triggerClassName = "border-warning hover:brightness-90";
805
- }
806
865
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
807
866
  PropertyBase,
808
867
  {
@@ -811,7 +870,7 @@ var MultiSelectProperty = ({
811
870
  readOnly,
812
871
  softRequired,
813
872
  hasValue,
814
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.List, { size: 16 }),
873
+ icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.List, { size: 16 }),
815
874
  input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
816
875
  "div",
817
876
  {
@@ -821,16 +880,9 @@ var MultiSelectProperty = ({
821
880
  {
822
881
  ...multiSelectProps,
823
882
  className: (0, import_clsx9.default)("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
824
- triggerClassName,
825
- selectedDisplay: ({ items }) => {
826
- const selected = items.filter((value) => value.selected);
827
- if (selected.length === 0) {
828
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Select" });
829
- }
830
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChipList, { list: selected.map((value) => ({ children: value.label })) });
831
- },
832
883
  options,
833
- disabled: readOnly,
884
+ isDisabled: readOnly,
885
+ useChipDisplay: true,
834
886
  hintText: `${translation.select}...`
835
887
  }
836
888
  )