@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
@@ -42,152 +42,41 @@ var useTranslation = (defaults, translationOverwrite = {}) => {
42
42
  };
43
43
 
44
44
  // src/components/user-action/MultiSelect.tsx
45
- import { useState as useState7 } from "react";
46
- import { Search } from "lucide-react";
47
-
48
- // src/util/simpleSearch.ts
49
- var MultiSearchWithMapping = (search, objects, mapping) => {
50
- return objects.filter((object) => {
51
- const mappedSearchKeywords = mapping(object).map((value) => value.toLowerCase().trim());
52
- return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
53
- });
54
- };
55
-
56
- // src/components/user-action/MultiSelect.tsx
57
- import clsx5 from "clsx";
45
+ import { useEffect as useEffect7, useRef as useRef2, useState as useState6 } from "react";
46
+ import { ChevronDown, ChevronUp } from "lucide-react";
47
+ import clsx7 from "clsx";
58
48
 
59
- // src/components/user-action/Menu.tsx
60
- import { useRef } from "react";
49
+ // src/components/user-action/Label.tsx
61
50
  import clsx from "clsx";
62
-
63
- // src/hooks/useOutsideClick.ts
64
- import { useEffect as useEffect3 } from "react";
65
- var useOutsideClick = (refs, handler) => {
66
- useEffect3(() => {
67
- const listener = (event) => {
68
- if (event.target === null) return;
69
- if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
70
- return;
71
- }
72
- handler();
73
- };
74
- document.addEventListener("mousedown", listener);
75
- document.addEventListener("touchstart", listener);
76
- return () => {
77
- document.removeEventListener("mousedown", listener);
78
- document.removeEventListener("touchstart", listener);
79
- };
80
- }, [refs, handler]);
81
- };
82
-
83
- // src/hooks/useHoverState.ts
84
- import { useEffect as useEffect4, useState as useState3 } from "react";
85
- var defaultUseHoverStateProps = {
86
- closingDelay: 200,
87
- isDisabled: false
88
- };
89
- var useHoverState = (props = void 0) => {
90
- const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
91
- const [isHovered, setIsHovered] = useState3(false);
92
- const [timer, setTimer] = useState3();
93
- const onMouseEnter = () => {
94
- if (isDisabled) {
95
- return;
96
- }
97
- clearTimeout(timer);
98
- setIsHovered(true);
99
- };
100
- const onMouseLeave = () => {
101
- if (isDisabled) {
102
- return;
103
- }
104
- setTimer(setTimeout(() => {
105
- setIsHovered(false);
106
- }, closingDelay));
107
- };
108
- useEffect4(() => {
109
- if (timer) {
110
- return () => {
111
- clearTimeout(timer);
112
- };
113
- }
114
- });
115
- useEffect4(() => {
116
- if (timer) {
117
- clearTimeout(timer);
118
- }
119
- }, [isDisabled]);
120
- return {
121
- isHovered,
122
- setIsHovered,
123
- handlers: { onMouseEnter, onMouseLeave }
124
- };
51
+ import { jsx as jsx2 } from "react/jsx-runtime";
52
+ var styleMapping = {
53
+ labelSmall: "textstyle-label-sm",
54
+ labelMedium: "textstyle-label-md",
55
+ labelBig: "textstyle-label-lg"
125
56
  };
126
-
127
- // src/components/user-action/Menu.tsx
128
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
129
- var MenuItem = ({
130
- children,
131
- onClick,
132
- alignment = "left",
133
- className
134
- }) => /* @__PURE__ */ jsx2(
135
- "div",
136
- {
137
- className: clsx("block px-3 py-1 bg-menu-background text-menu-text hover:brightness-90", {
138
- "text-right": alignment === "right",
139
- "text-left": alignment === "left"
140
- }, className),
141
- onClick,
142
- children
143
- }
144
- );
145
- var Menu = ({
146
- trigger,
57
+ var Label = ({
147
58
  children,
148
- alignment = "tl",
149
- showOnHover = false,
150
- menuClassName = ""
59
+ name,
60
+ labelType = "labelSmall",
61
+ className,
62
+ ...props
151
63
  }) => {
152
- const { isHovered: isOpen, setIsHovered: setIsOpen, handlers } = useHoverState({ isDisabled: !showOnHover });
153
- const triggerRef = useRef(null);
154
- const menuRef = useRef(null);
155
- useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
156
- return /* @__PURE__ */ jsxs(
157
- "div",
158
- {
159
- className: "relative",
160
- ...handlers,
161
- children: [
162
- trigger(() => setIsOpen(!isOpen), triggerRef),
163
- isOpen ? /* @__PURE__ */ jsx2(
164
- "div",
165
- {
166
- ref: menuRef,
167
- onClick: (e) => e.stopPropagation(),
168
- className: clsx("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]", {
169
- " top-[8px]": alignment[0] === "t",
170
- " bottom-[8px]": alignment[0] === "b",
171
- " left-[-8px]": alignment[1] === "l",
172
- " right-[-8px]": alignment[1] === "r"
173
- }, menuClassName),
174
- children
175
- }
176
- ) : null
177
- ]
178
- }
179
- );
64
+ return /* @__PURE__ */ jsx2("label", { ...props, className: clsx(styleMapping[labelType], className), children: children ? children : name });
180
65
  };
181
66
 
67
+ // src/components/layout-and-navigation/SearchableList.tsx
68
+ import { Search } from "lucide-react";
69
+ import clsx4 from "clsx";
70
+
182
71
  // src/components/user-action/Input.tsx
183
- import { forwardRef, useEffect as useEffect6, useRef as useRef2, useState as useState5 } from "react";
184
- import clsx3 from "clsx";
72
+ import { forwardRef, useEffect as useEffect4, useRef, useState as useState4 } from "react";
73
+ import clsx2 from "clsx";
185
74
 
186
75
  // src/hooks/useSaveDelay.ts
187
- import { useEffect as useEffect5, useState as useState4 } from "react";
76
+ import { useEffect as useEffect3, useState as useState3 } from "react";
188
77
  function useSaveDelay(setNotificationStatus, delay) {
189
- const [updateTimer, setUpdateTimer] = useState4(void 0);
190
- const [notificationTimer, setNotificationTimer] = useState4(void 0);
78
+ const [updateTimer, setUpdateTimer] = useState3(void 0);
79
+ const [notificationTimer, setNotificationTimer] = useState3(void 0);
191
80
  const restartTimer = (onSave) => {
192
81
  clearTimeout(updateTimer);
193
82
  setUpdateTimer(setTimeout(() => {
@@ -214,7 +103,7 @@ function useSaveDelay(setNotificationStatus, delay) {
214
103
  setNotificationStatus(false);
215
104
  }
216
105
  };
217
- useEffect5(() => {
106
+ useEffect3(() => {
218
107
  return () => {
219
108
  clearTimeout(updateTimer);
220
109
  clearTimeout(notificationTimer);
@@ -226,26 +115,8 @@ function useSaveDelay(setNotificationStatus, delay) {
226
115
  // src/util/noop.ts
227
116
  var noop = () => void 0;
228
117
 
229
- // src/components/user-action/Label.tsx
230
- import clsx2 from "clsx";
231
- import { jsx as jsx3 } from "react/jsx-runtime";
232
- var styleMapping = {
233
- labelSmall: "textstyle-label-sm",
234
- labelMedium: "textstyle-label-md",
235
- labelBig: "textstyle-label-lg"
236
- };
237
- var Label = ({
238
- children,
239
- name,
240
- labelType = "labelSmall",
241
- className,
242
- ...props
243
- }) => {
244
- return /* @__PURE__ */ jsx3("label", { ...props, className: clsx2(styleMapping[labelType], className), children: children ? children : name });
245
- };
246
-
247
118
  // src/components/user-action/Input.tsx
248
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
119
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
249
120
  var Input = ({
250
121
  id,
251
122
  type = "text",
@@ -265,15 +136,15 @@ var Input = ({
265
136
  restartTimer,
266
137
  clearUpdateTimer
267
138
  } = useSaveDelay(() => void 0, 3e3);
268
- const ref = useRef2(null);
269
- useEffect6(() => {
139
+ const ref = useRef(null);
140
+ useEffect4(() => {
270
141
  if (autoFocus) {
271
142
  ref.current?.focus();
272
143
  }
273
144
  }, [autoFocus]);
274
- return /* @__PURE__ */ jsxs2("div", { className: clsx3({ "w-full": expanded }, containerClassName), children: [
275
- label && /* @__PURE__ */ jsx4(Label, { ...label, htmlFor: id, className: clsx3("mb-1", label.className) }),
276
- /* @__PURE__ */ jsx4(
145
+ return /* @__PURE__ */ jsxs("div", { className: clsx2({ "w-full": expanded }, containerClassName), children: [
146
+ label && /* @__PURE__ */ jsx3(Label, { ...label, htmlFor: id, className: clsx2("mb-1", label.className) }),
147
+ /* @__PURE__ */ jsx3(
277
148
  "input",
278
149
  {
279
150
  ref,
@@ -317,13 +188,13 @@ var FormInput = forwardRef(function FormInput2({
317
188
  required,
318
189
  ...restProps
319
190
  }, ref) {
320
- const input = /* @__PURE__ */ jsx4(
191
+ const input = /* @__PURE__ */ jsx3(
321
192
  "input",
322
193
  {
323
194
  ref,
324
195
  id,
325
196
  ...restProps,
326
- className: clsx3(
197
+ className: clsx2(
327
198
  {
328
199
  "focus:border-primary focus:ring-primary": !errorText,
329
200
  "focus:border-negative focus:ring-negative text-negative": !!errorText
@@ -332,208 +203,324 @@ var FormInput = forwardRef(function FormInput2({
332
203
  )
333
204
  }
334
205
  );
335
- return /* @__PURE__ */ jsxs2("div", { className: clsx3("flex flex-col gap-y-1", containerClassName), children: [
336
- labelText && /* @__PURE__ */ jsxs2("label", { htmlFor: id, className: clsx3("textstyle-label-md", labelClassName), children: [
206
+ return /* @__PURE__ */ jsxs("div", { className: clsx2("flex flex-col gap-y-1", containerClassName), children: [
207
+ labelText && /* @__PURE__ */ jsxs("label", { htmlFor: id, className: clsx2("textstyle-label-md", labelClassName), children: [
337
208
  labelText,
338
- required && /* @__PURE__ */ jsx4("span", { className: "text-primary font-bold", children: "*" })
209
+ required && /* @__PURE__ */ jsx3("span", { className: "text-primary font-bold", children: "*" })
339
210
  ] }),
340
211
  input,
341
- errorText && /* @__PURE__ */ jsx4("label", { htmlFor: id, className: clsx3("text-negative", errorClassName), children: errorText })
212
+ errorText && /* @__PURE__ */ jsx3("label", { htmlFor: id, className: clsx2("text-negative", errorClassName), children: errorText })
342
213
  ] });
343
214
  });
344
215
 
345
- // src/components/user-action/Checkbox.tsx
346
- import { useState as useState6 } from "react";
347
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
348
- import { Check, Minus } from "lucide-react";
349
- import clsx4 from "clsx";
350
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
351
- var checkboxSizeMapping = {
352
- small: "size-4",
353
- medium: "size-6",
354
- large: "size-8"
216
+ // src/components/user-action/Button.tsx
217
+ import clsx3 from "clsx";
218
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
219
+ var paddingMapping = {
220
+ small: "btn-sm",
221
+ medium: "btn-md",
222
+ large: "btn-lg"
355
223
  };
356
- var checkboxIconSizeMapping = {
357
- small: "size-3",
358
- medium: "size-5",
359
- large: "size-7"
224
+ var iconPaddingMapping = {
225
+ small: "icon-btn-sm",
226
+ medium: "icon-btn-md",
227
+ large: "icon-btn-lg"
360
228
  };
361
- var Checkbox = ({
362
- id,
363
- label,
364
- checked,
365
- disabled,
366
- onChange,
367
- onChangeTristate,
229
+ var ButtonUtil = {
230
+ paddingMapping,
231
+ iconPaddingMapping
232
+ };
233
+ var SolidButton = ({
234
+ children,
235
+ disabled = false,
236
+ color = "primary",
368
237
  size = "medium",
369
- className = "",
370
- containerClassName
238
+ startIcon,
239
+ endIcon,
240
+ onClick,
241
+ className,
242
+ ...restProps
371
243
  }) => {
372
- const usedSizeClass = checkboxSizeMapping[size];
373
- const innerIconSize = checkboxIconSizeMapping[size];
374
- const propagateChange = (checked2) => {
375
- if (onChangeTristate) {
376
- onChangeTristate(checked2);
244
+ const colorClasses = {
245
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
246
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
247
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
248
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
249
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
250
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
251
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
252
+ }[color];
253
+ const iconColorClasses = {
254
+ primary: "text-button-solid-primary-icon",
255
+ secondary: "text-button-solid-secondary-icon",
256
+ tertiary: "text-button-solid-tertiary-icon",
257
+ positive: "text-button-solid-positive-icon",
258
+ warning: "text-button-solid-warning-icon",
259
+ negative: "text-button-solid-negative-icon",
260
+ neutral: "text-button-solid-neutral-icon"
261
+ }[color];
262
+ return /* @__PURE__ */ jsxs2(
263
+ "button",
264
+ {
265
+ onClick: disabled ? void 0 : onClick,
266
+ disabled: disabled || onClick === void 0,
267
+ className: clsx3(
268
+ {
269
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
270
+ [clsx3(colorClasses, "hover:brightness-90")]: !disabled
271
+ },
272
+ ButtonUtil.paddingMapping[size],
273
+ className
274
+ ),
275
+ ...restProps,
276
+ children: [
277
+ startIcon && /* @__PURE__ */ jsx4(
278
+ "span",
279
+ {
280
+ className: clsx3({
281
+ [iconColorClasses]: !disabled,
282
+ [`text-disabled-icon`]: disabled
283
+ }),
284
+ children: startIcon
285
+ }
286
+ ),
287
+ children,
288
+ endIcon && /* @__PURE__ */ jsx4(
289
+ "span",
290
+ {
291
+ className: clsx3({
292
+ [iconColorClasses]: !disabled,
293
+ [`text-disabled-icon`]: disabled
294
+ }),
295
+ children: endIcon
296
+ }
297
+ )
298
+ ]
377
299
  }
378
- if (onChange) {
379
- onChange(checked2 === "indeterminate" ? false : checked2);
300
+ );
301
+ };
302
+ var TextButton = ({
303
+ children,
304
+ disabled = false,
305
+ color = "neutral",
306
+ size = "medium",
307
+ startIcon,
308
+ endIcon,
309
+ onClick,
310
+ className,
311
+ ...restProps
312
+ }) => {
313
+ const colorClasses = {
314
+ primary: "bg-transparent text-button-text-primary-text",
315
+ negative: "bg-transparent text-button-text-negative-text",
316
+ neutral: "bg-transparent text-button-text-neutral-text"
317
+ }[color];
318
+ const iconColorClasses = {
319
+ primary: "text-button-text-primary-icon",
320
+ negative: "text-button-text-negative-icon",
321
+ neutral: "text-button-text-neutral-icon"
322
+ }[color];
323
+ return /* @__PURE__ */ jsxs2(
324
+ "button",
325
+ {
326
+ onClick: disabled ? void 0 : onClick,
327
+ disabled: disabled || onClick === void 0,
328
+ className: clsx3(
329
+ {
330
+ "text-disabled-text cursor-not-allowed": disabled,
331
+ [clsx3(colorClasses, "hover:bg-button-text-hover-background rounded-full")]: !disabled
332
+ },
333
+ ButtonUtil.paddingMapping[size],
334
+ className
335
+ ),
336
+ ...restProps,
337
+ children: [
338
+ startIcon && /* @__PURE__ */ jsx4(
339
+ "span",
340
+ {
341
+ className: clsx3({
342
+ [iconColorClasses]: !disabled,
343
+ [`text-disabled-icon`]: disabled
344
+ }),
345
+ children: startIcon
346
+ }
347
+ ),
348
+ children,
349
+ endIcon && /* @__PURE__ */ jsx4(
350
+ "span",
351
+ {
352
+ className: clsx3({
353
+ [iconColorClasses]: !disabled,
354
+ [`text-disabled-icon`]: disabled
355
+ }),
356
+ children: endIcon
357
+ }
358
+ )
359
+ ]
380
360
  }
361
+ );
362
+ };
363
+ var IconButton = ({
364
+ children,
365
+ disabled = false,
366
+ color = "primary",
367
+ size = "medium",
368
+ onClick,
369
+ className,
370
+ ...restProps
371
+ }) => {
372
+ const colorClasses = {
373
+ primary: "bg-button-solid-primary-background text-button-solid-primary-text",
374
+ secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
375
+ tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
376
+ positive: "bg-button-solid-positive-background text-button-solid-positive-text",
377
+ warning: "bg-button-solid-warning-background text-button-solid-warning-text",
378
+ negative: "bg-button-solid-negative-background text-button-solid-negative-text",
379
+ neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
380
+ }[color];
381
+ return /* @__PURE__ */ jsx4(
382
+ "button",
383
+ {
384
+ onClick: disabled ? void 0 : onClick,
385
+ disabled: disabled || onClick === void 0,
386
+ className: clsx3(
387
+ {
388
+ "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
389
+ [clsx3(colorClasses, "hover:brightness-90")]: !disabled
390
+ },
391
+ ButtonUtil.iconPaddingMapping[size],
392
+ className
393
+ ),
394
+ ...restProps,
395
+ children
396
+ }
397
+ );
398
+ };
399
+
400
+ // src/hooks/useSearch.ts
401
+ import { useEffect as useEffect5, useMemo, useState as useState5 } from "react";
402
+
403
+ // src/util/simpleSearch.ts
404
+ var MultiSearchWithMapping = (search, objects, mapping) => {
405
+ return objects.filter((object) => {
406
+ const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
407
+ if (!mappedSearchKeywords) {
408
+ return true;
409
+ }
410
+ return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
411
+ });
412
+ };
413
+
414
+ // src/hooks/useSearch.ts
415
+ var useSearch = ({
416
+ list,
417
+ initialSearch,
418
+ searchMapping
419
+ }) => {
420
+ const [items, setItems] = useState5(list);
421
+ const [search, setSearch] = useState5(initialSearch);
422
+ useEffect5(() => {
423
+ setItems(list);
424
+ }, [list]);
425
+ const result = useMemo(
426
+ () => MultiSearchWithMapping(search, items, searchMapping),
427
+ [search, items, searchMapping]
428
+ );
429
+ return {
430
+ result,
431
+ hasResult: result.length > 0,
432
+ allItems: items,
433
+ setItems,
434
+ search,
435
+ setSearch
381
436
  };
382
- const changeValue = () => {
383
- const newValue = checked === "indeterminate" ? false : !checked;
384
- propagateChange(newValue);
385
- };
386
- return /* @__PURE__ */ jsxs3("div", { className: clsx4("row justify-center items-center", containerClassName), children: [
387
- /* @__PURE__ */ jsx5(
388
- CheckboxPrimitive.Root,
389
- {
390
- onCheckedChange: propagateChange,
391
- checked,
392
- disabled,
393
- id,
394
- className: clsx4(usedSizeClass, `items-center border-2 rounded outline-none focus:border-primary`, {
395
- "text-disabled-text border-disabled-text bg-disabled-background": disabled,
396
- "bg-surface": !disabled && !checked,
397
- "bg-primary/30 border-primary text-primary": checked === true || checked === "indeterminate",
398
- "hover:border-primary focus:hover:border-primary": !checked
399
- }, className),
400
- children: /* @__PURE__ */ jsxs3(CheckboxPrimitive.Indicator, { children: [
401
- checked === true && /* @__PURE__ */ jsx5(Check, { className: innerIconSize }),
402
- checked === "indeterminate" && /* @__PURE__ */ jsx5(Minus, { className: innerIconSize })
403
- ] })
404
- }
405
- ),
406
- label && /* @__PURE__ */ jsx5(
407
- Label,
408
- {
409
- ...label,
410
- className: clsx4("cursor-pointer", label.className),
411
- htmlFor: id,
412
- onClick: changeValue
413
- }
414
- )
415
- ] });
416
437
  };
417
438
 
418
- // src/components/user-action/MultiSelect.tsx
419
- import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
420
- var defaultMultiSelectTranslation = {
439
+ // src/components/layout-and-navigation/SearchableList.tsx
440
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
441
+ var defaultSearchableListTranslation = {
421
442
  en: {
422
- select: "Select",
423
443
  search: "Search",
424
- selected: "selected"
444
+ nothingFound: "Nothing found"
425
445
  },
426
446
  de: {
427
- select: "Ausw\xE4hlen",
428
447
  search: "Suche",
429
- selected: "ausgew\xE4hlt"
448
+ nothingFound: "Nichts gefunden"
430
449
  }
431
450
  };
432
- var MultiSelect = ({
451
+ var SearchableList = ({
433
452
  overwriteTranslation,
434
- options,
435
- onChange,
436
- search,
437
- disabled = false,
438
- selectedDisplay,
439
- label,
440
- hintText,
441
- showDisabledOptions = true,
442
- className = "",
443
- triggerClassName = ""
453
+ list,
454
+ initialSearch = "",
455
+ searchMapping,
456
+ autoFocus,
457
+ minimumItemsForSearch = 6,
458
+ itemMapper,
459
+ className,
460
+ resultListClassName
444
461
  }) => {
445
- const translation = useTranslation(defaultMultiSelectTranslation, overwriteTranslation);
446
- const [searchText, setSearchText] = useState7(search?.initialSearch ?? "");
447
- let filteredOptions = options;
448
- const enableSearch = !!search;
449
- if (enableSearch && !!searchText) {
450
- filteredOptions = MultiSearchWithMapping(
451
- searchText,
452
- filteredOptions,
453
- (value) => search.searchMapping(value)
454
- );
455
- }
456
- if (!showDisabledOptions) {
457
- filteredOptions = filteredOptions.filter((value) => !value.disabled);
458
- }
459
- const selectedItems = options.filter((value) => value.selected);
460
- const menuButtonText = selectedItems.length === 0 ? hintText ?? translation.select : /* @__PURE__ */ jsx6("span", { children: `${selectedItems.length} ${translation.selected}` });
461
- const borderColor = "border-menu-border";
462
- return /* @__PURE__ */ jsxs4("div", { className: clsx5(className), children: [
463
- label && /* @__PURE__ */ jsx6(
464
- Label,
465
- {
466
- ...label,
467
- htmlFor: label.name,
468
- className: clsx5(" mb-1", label.className),
469
- labelType: label.labelType ?? "labelBig"
470
- }
471
- ),
472
- /* @__PURE__ */ jsxs4(
473
- Menu,
474
- {
475
- alignment: "t_",
476
- trigger: (onClick, ref) => /* @__PURE__ */ jsx6(
477
- "div",
478
- {
479
- ref,
480
- onClick: disabled ? void 0 : onClick,
481
- className: clsx5(
482
- borderColor,
483
- "bg-menu-background text-menu-text inline-w-full justify-between items-center rounded-lg border-2 px-4 py-2 font-medium",
484
- {
485
- "hover:border-primary cursor-pointer": !disabled,
486
- "bg-disabled-background text-disabled cursor-not-allowed": disabled
487
- },
488
- triggerClassName
489
- ),
490
- children: selectedDisplay ? selectedDisplay({ items: options, disabled }) : menuButtonText
491
- }
492
- ),
493
- menuClassName: clsx5(
494
- "!rounded-lg !shadow-lg !max-h-[500px] !min-w-[400px] !max-w-[70vh] !overflow-y-auto !border !border-2",
495
- borderColor,
496
- { "!py-0": !enableSearch, "!pb-0": enableSearch }
497
- ),
498
- children: [
499
- enableSearch && /* @__PURE__ */ jsxs4("div", { className: "row gap-x-2 items-center px-2 py-2", children: [
500
- /* @__PURE__ */ jsx6(Input, { autoFocus: true, className: "w-full", value: searchText, onChangeText: setSearchText }),
501
- /* @__PURE__ */ jsx6(Search, {})
502
- ] }, "selectSearch"),
503
- filteredOptions.map((option, index) => /* @__PURE__ */ jsx6(
504
- MenuItem,
505
- {
506
- className: clsx5({
507
- "cursor-not-allowed !bg-disabled-background !text-disabled-text hover:brightness-100": !!option.disabled,
508
- "cursor-pointer": !option.disabled
509
- }),
510
- children: /* @__PURE__ */ jsxs4(
511
- "div",
512
- {
513
- className: clsx5("overflow-hidden whitespace-nowrap text-ellipsis row items-center gap-x-2", option.className),
514
- onClick: () => {
515
- if (!option.disabled) {
516
- onChange(options.map((value) => value.value === option.value ? {
517
- ...option,
518
- selected: !value.selected
519
- } : value));
520
- }
521
- },
522
- children: [
523
- /* @__PURE__ */ jsx6(Checkbox, { checked: option.selected, disabled: option.disabled, size: "small" }),
524
- option.label
525
- ]
526
- }
527
- )
528
- },
529
- `item${index}`
530
- ))
531
- ]
532
- }
533
- )
462
+ const translation = useTranslation(defaultSearchableListTranslation, overwriteTranslation);
463
+ const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
464
+ return /* @__PURE__ */ jsxs3("div", { className: clsx4("col gap-y-2", className), children: [
465
+ list.length > minimumItemsForSearch && /* @__PURE__ */ jsxs3("div", { className: "row justify-between gap-x-4 items-center", children: [
466
+ /* @__PURE__ */ jsx5(
467
+ Input,
468
+ {
469
+ value: search,
470
+ onChangeText: setSearch,
471
+ placeholder: translation.search,
472
+ autoFocus,
473
+ className: "w-full"
474
+ }
475
+ ),
476
+ /* @__PURE__ */ jsx5(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ jsx5(Search, { className: "w-full h-full" }) })
477
+ ] }),
478
+ hasResult ? /* @__PURE__ */ jsx5("div", { className: clsx4("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ jsx5("div", { className: "row text-description py-2 px-2", children: translation.nothingFound })
534
479
  ] });
535
480
  };
536
481
 
482
+ // src/components/layout-and-navigation/Tile.tsx
483
+ import clsx5 from "clsx";
484
+ import { Check } from "lucide-react";
485
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
486
+ var Tile = ({
487
+ title,
488
+ description,
489
+ onClick,
490
+ isSelected = false,
491
+ isDisabled = false,
492
+ prefix,
493
+ suffix,
494
+ normalClassName = "hover:bg-primary/40 cursor-pointer",
495
+ selectedClassName = " bg-primary/20",
496
+ disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
497
+ className
498
+ }) => {
499
+ return /* @__PURE__ */ jsxs4(
500
+ "div",
501
+ {
502
+ className: clsx5(
503
+ "row gap-x-2 w-full items-center",
504
+ {
505
+ [normalClassName]: !!onClick && !isDisabled,
506
+ [selectedClassName]: isSelected && !isDisabled,
507
+ [disabledClassName]: isDisabled
508
+ },
509
+ className
510
+ ),
511
+ onClick: isDisabled ? void 0 : onClick,
512
+ children: [
513
+ prefix ?? (isSelected ? /* @__PURE__ */ jsx6(Check, { size: 24 }) : void 0),
514
+ /* @__PURE__ */ jsxs4("div", { className: "col gap-y-0 w-full", children: [
515
+ /* @__PURE__ */ jsx6("h4", { className: clsx5(title.className ?? "textstyle-title-normal"), children: title.value }),
516
+ !!description && /* @__PURE__ */ jsx6("span", { className: clsx5(description.className ?? "textstyle-description"), children: description.value })
517
+ ] }),
518
+ suffix
519
+ ]
520
+ }
521
+ );
522
+ };
523
+
537
524
  // src/components/layout-and-navigation/Chip.tsx
538
525
  import clsx6 from "clsx";
539
526
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
@@ -599,90 +586,166 @@ var ChipList = ({
599
586
  )) });
600
587
  };
601
588
 
602
- // src/components/properties/PropertyBase.tsx
603
- import { AlertTriangle } from "lucide-react";
604
- import clsx8 from "clsx";
589
+ // src/hooks/useOutsideClick.ts
590
+ import { useEffect as useEffect6 } from "react";
591
+ var useOutsideClick = (refs, handler) => {
592
+ useEffect6(() => {
593
+ const listener = (event) => {
594
+ if (event.target === null) return;
595
+ if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
596
+ return;
597
+ }
598
+ handler();
599
+ };
600
+ document.addEventListener("mousedown", listener);
601
+ document.addEventListener("touchstart", listener);
602
+ return () => {
603
+ document.removeEventListener("mousedown", listener);
604
+ document.removeEventListener("touchstart", listener);
605
+ };
606
+ }, [refs, handler]);
607
+ };
605
608
 
606
- // src/components/user-action/Button.tsx
607
- import clsx7 from "clsx";
609
+ // src/components/user-action/MultiSelect.tsx
608
610
  import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
609
- var paddingMapping = {
610
- small: "btn-sm",
611
- medium: "btn-md",
612
- large: "btn-lg"
613
- };
614
- var iconPaddingMapping = {
615
- small: "icon-btn-sm",
616
- medium: "icon-btn-md",
617
- large: "icon-btn-lg"
618
- };
619
- var ButtonUtil = {
620
- paddingMapping,
621
- iconPaddingMapping
611
+ var defaultMultiSelectTranslation = {
612
+ en: {
613
+ select: "Select",
614
+ search: "Search",
615
+ selected: "selected"
616
+ },
617
+ de: {
618
+ select: "Ausw\xE4hlen",
619
+ search: "Suche",
620
+ selected: "ausgew\xE4hlt"
621
+ }
622
622
  };
623
- var TextButton = ({
624
- children,
625
- disabled = false,
626
- color = "neutral",
627
- size = "medium",
628
- startIcon,
629
- endIcon,
630
- onClick,
631
- className,
632
- ...restProps
623
+ var MultiSelect = ({
624
+ overwriteTranslation,
625
+ options,
626
+ label,
627
+ onChange,
628
+ hintText,
629
+ isDisabled = false,
630
+ isSearchEnabled = false,
631
+ selectedDisplayOverwrite,
632
+ useChipDisplay = false,
633
+ className = ""
633
634
  }) => {
634
- const colorClasses = {
635
- primary: "bg-transparent text-button-text-primary-text",
636
- negative: "bg-transparent text-button-text-negative-text",
637
- neutral: "bg-transparent text-button-text-neutral-text"
638
- }[color];
639
- const iconColorClasses = {
640
- primary: "text-button-text-primary-icon",
641
- negative: "text-button-text-negative-icon",
642
- neutral: "text-button-text-neutral-icon"
643
- }[color];
644
- return /* @__PURE__ */ jsxs6(
645
- "button",
646
- {
647
- onClick: disabled ? void 0 : onClick,
648
- disabled: disabled || onClick === void 0,
649
- className: clsx7(
635
+ const translation = useTranslation(defaultMultiSelectTranslation, overwriteTranslation);
636
+ const triggerRef = useRef2(null);
637
+ const menuRef = useRef2(null);
638
+ const [isOpen, setIsOpen] = useState6(false);
639
+ useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
640
+ const selectedItems = options.filter((value) => value.selected);
641
+ const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
642
+ return /* @__PURE__ */ jsxs6("div", { className: clsx7(className), children: [
643
+ label && /* @__PURE__ */ jsx8(
644
+ Label,
645
+ {
646
+ ...label,
647
+ htmlFor: label.name,
648
+ className: clsx7(" mb-1", label.className),
649
+ labelType: label.labelType ?? "labelBig"
650
+ }
651
+ ),
652
+ /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
653
+ /* @__PURE__ */ jsxs6(
654
+ "button",
650
655
  {
651
- "text-disabled-text cursor-not-allowed": disabled,
652
- [clsx7(colorClasses, "hover:bg-button-text-hover-background rounded-full")]: !disabled
653
- },
654
- ButtonUtil.paddingMapping[size],
655
- className
656
+ ref: triggerRef,
657
+ className: clsx7(
658
+ "btn-md justify-between w-full border-2 h-auto",
659
+ {
660
+ "rounded-b-lg": !open,
661
+ "bg-menu-background border-menu-border hover:border-primary": !isDisabled,
662
+ "bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
663
+ }
664
+ ),
665
+ onClick: () => setIsOpen(!isOpen),
666
+ disabled: isDisabled,
667
+ children: [
668
+ !isShowingHint && /* @__PURE__ */ jsx8("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? (useChipDisplay && selectedItems ? /* @__PURE__ */ jsx8(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) : `${selectedItems.length} ${translation.selected}`) }),
669
+ isShowingHint && /* @__PURE__ */ jsx8("span", { className: "textstyle-description", children: hintText ?? translation.select }),
670
+ isOpen ? /* @__PURE__ */ jsx8(ChevronUp, { size: 24, className: "min-w-6" }) : /* @__PURE__ */ jsx8(ChevronDown, { className: "min-w-6" })
671
+ ]
672
+ }
656
673
  ),
657
- ...restProps,
658
- children: [
659
- startIcon && /* @__PURE__ */ jsx8(
660
- "span",
661
- {
662
- className: clsx7({
663
- [iconColorClasses]: !disabled,
664
- [`text-disabled-icon`]: disabled
665
- }),
666
- children: startIcon
667
- }
668
- ),
669
- children,
670
- endIcon && /* @__PURE__ */ jsx8(
671
- "span",
672
- {
673
- className: clsx7({
674
- [iconColorClasses]: !disabled,
675
- [`text-disabled-icon`]: disabled
676
- }),
677
- children: endIcon
678
- }
679
- )
680
- ]
681
- }
682
- );
674
+ isOpen && /* @__PURE__ */ jsxs6(
675
+ "div",
676
+ {
677
+ ref: menuRef,
678
+ 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",
679
+ children: [
680
+ /* @__PURE__ */ jsx8(
681
+ SearchableList,
682
+ {
683
+ list: options,
684
+ minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
685
+ searchMapping: (item) => item.searchTags,
686
+ itemMapper: (option, index) => /* @__PURE__ */ jsx8(
687
+ Tile,
688
+ {
689
+ isSelected: option.selected,
690
+ className: "px-2 py-1 rounded-md",
691
+ disabledClassName: "text-disabled-text cursor-not-allowed",
692
+ title: { value: option.label, className: "font-semibold" },
693
+ onClick: () => {
694
+ onChange(options.map((value) => value.value === option.value ? {
695
+ ...option,
696
+ selected: !value.selected
697
+ } : value));
698
+ },
699
+ isDisabled: option.disabled
700
+ },
701
+ index
702
+ )
703
+ }
704
+ ),
705
+ /* @__PURE__ */ jsxs6("div", { className: "row justify-between mt-2", children: [
706
+ /* @__PURE__ */ jsxs6("div", { className: "row gap-x-2", children: [
707
+ /* @__PURE__ */ jsx8(
708
+ SolidButton,
709
+ {
710
+ color: "neutral",
711
+ size: "small",
712
+ onClick: () => {
713
+ onChange(options.map((option) => ({
714
+ ...option,
715
+ selected: !option.disabled
716
+ })));
717
+ },
718
+ disabled: options.every((value) => value.selected || value.disabled),
719
+ children: "All"
720
+ }
721
+ ),
722
+ /* @__PURE__ */ jsx8(
723
+ SolidButton,
724
+ {
725
+ color: "neutral",
726
+ size: "small",
727
+ onClick: () => {
728
+ onChange(options.map((option) => ({
729
+ ...option,
730
+ selected: false
731
+ })));
732
+ },
733
+ children: "None"
734
+ }
735
+ )
736
+ ] }),
737
+ /* @__PURE__ */ jsx8(SolidButton, { size: "small", onClick: () => setIsOpen(false), children: "Done" })
738
+ ] })
739
+ ]
740
+ }
741
+ )
742
+ ] })
743
+ ] });
683
744
  };
684
745
 
685
746
  // src/components/properties/PropertyBase.tsx
747
+ import { AlertTriangle } from "lucide-react";
748
+ import clsx8 from "clsx";
686
749
  import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
687
750
  var defaultPropertyBaseTranslation = {
688
751
  en: {
@@ -722,7 +785,7 @@ var PropertyBase = ({
722
785
  /* @__PURE__ */ jsxs7(
723
786
  "div",
724
787
  {
725
- className: clsx8("row grow justify-between items-center rounded-r-xl border-2 border-l-0", {
788
+ className: clsx8("row gap-x-0 grow justify-between items-center rounded-r-xl border-2 border-l-0", {
726
789
  "bg-surface group-hover:border-primary": !requiredAndNoValue,
727
790
  "bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
728
791
  }, className),
@@ -766,10 +829,6 @@ var MultiSelectProperty = ({
766
829
  }) => {
767
830
  const translation = useTranslation(defaultMultiSelectPropertyTranslation, overwriteTranslation);
768
831
  const hasValue = options.some((value) => value.selected);
769
- let triggerClassName;
770
- if (softRequired && !hasValue) {
771
- triggerClassName = "border-warning hover:brightness-90";
772
- }
773
832
  return /* @__PURE__ */ jsx10(
774
833
  PropertyBase,
775
834
  {
@@ -788,16 +847,9 @@ var MultiSelectProperty = ({
788
847
  {
789
848
  ...multiSelectProps,
790
849
  className: clsx9("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
791
- triggerClassName,
792
- selectedDisplay: ({ items }) => {
793
- const selected = items.filter((value) => value.selected);
794
- if (selected.length === 0) {
795
- return /* @__PURE__ */ jsx10("span", { children: "Select" });
796
- }
797
- return /* @__PURE__ */ jsx10(ChipList, { list: selected.map((value) => ({ children: value.label })) });
798
- },
799
850
  options,
800
- disabled: readOnly,
851
+ isDisabled: readOnly,
852
+ useChipDisplay: true,
801
853
  hintText: `${translation.select}...`
802
854
  }
803
855
  )