@helpwave/hightide 0.0.15 → 0.0.16
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.
- package/dist/index.d.mts +86 -2
- package/dist/index.d.ts +86 -2
- package/dist/index.js +5714 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5541 -0
- package/dist/index.mjs.map +1 -1
- package/dist/util/news.d.mts +9 -9
- package/dist/util/news.d.ts +9 -9
- package/package.json +11 -7
- package/dist/components/Span.d.mts +0 -2
- package/dist/components/Span.d.ts +0 -2
- package/dist/components/Span.js +0 -2
- package/dist/components/Span.js.map +0 -1
- package/dist/components/Span.mjs +0 -1
- package/dist/components/Span.mjs.map +0 -1
- package/dist/components/examples/InputGroupExample.d.mts +0 -11
- package/dist/components/examples/InputGroupExample.d.ts +0 -11
- package/dist/components/examples/InputGroupExample.js +0 -466
- package/dist/components/examples/InputGroupExample.js.map +0 -1
- package/dist/components/examples/InputGroupExample.mjs +0 -436
- package/dist/components/examples/InputGroupExample.mjs.map +0 -1
- package/dist/components/examples/MultiSelectExample.d.mts +0 -14
- package/dist/components/examples/MultiSelectExample.d.ts +0 -14
- package/dist/components/examples/MultiSelectExample.js +0 -661
- package/dist/components/examples/MultiSelectExample.js.map +0 -1
- package/dist/components/examples/MultiSelectExample.mjs +0 -631
- package/dist/components/examples/MultiSelectExample.mjs.map +0 -1
- package/dist/components/examples/SearchableSelectExample.d.mts +0 -13
- package/dist/components/examples/SearchableSelectExample.d.ts +0 -13
- package/dist/components/examples/SearchableSelectExample.js +0 -365
- package/dist/components/examples/SearchableSelectExample.js.map +0 -1
- package/dist/components/examples/SearchableSelectExample.mjs +0 -335
- package/dist/components/examples/SearchableSelectExample.mjs.map +0 -1
- package/dist/components/examples/SelectExample.d.mts +0 -9
- package/dist/components/examples/SelectExample.d.ts +0 -9
- package/dist/components/examples/SelectExample.js +0 -180
- package/dist/components/examples/SelectExample.js.map +0 -1
- package/dist/components/examples/SelectExample.mjs +0 -145
- package/dist/components/examples/SelectExample.mjs.map +0 -1
- package/dist/components/examples/StackingModals.d.mts +0 -8
- package/dist/components/examples/StackingModals.d.ts +0 -8
- package/dist/components/examples/StackingModals.js +0 -498
- package/dist/components/examples/StackingModals.js.map +0 -1
- package/dist/components/examples/StackingModals.mjs +0 -463
- package/dist/components/examples/StackingModals.mjs.map +0 -1
- package/dist/components/examples/TableExample.d.mts +0 -13
- package/dist/components/examples/TableExample.d.ts +0 -13
- package/dist/components/examples/TableExample.js +0 -853
- package/dist/components/examples/TableExample.js.map +0 -1
- package/dist/components/examples/TableExample.mjs +0 -823
- package/dist/components/examples/TableExample.mjs.map +0 -1
- package/dist/components/examples/TextareaExample.d.mts +0 -12
- package/dist/components/examples/TextareaExample.d.ts +0 -12
- package/dist/components/examples/TextareaExample.js +0 -176
- package/dist/components/examples/TextareaExample.js.map +0 -1
- package/dist/components/examples/TextareaExample.mjs +0 -141
- package/dist/components/examples/TextareaExample.mjs.map +0 -1
- package/dist/components/examples/TileExample.d.mts +0 -14
- package/dist/components/examples/TileExample.d.ts +0 -14
- package/dist/components/examples/TileExample.js +0 -79
- package/dist/components/examples/TileExample.js.map +0 -1
- package/dist/components/examples/TileExample.mjs +0 -44
- package/dist/components/examples/TileExample.mjs.map +0 -1
- package/dist/components/examples/Title.d.mts +0 -2
- package/dist/components/examples/Title.d.ts +0 -2
- package/dist/components/examples/Title.js +0 -2
- package/dist/components/examples/Title.js.map +0 -1
- package/dist/components/examples/Title.mjs +0 -1
- package/dist/components/examples/Title.mjs.map +0 -1
- package/dist/components/examples/date/DateTimePickerExample.d.mts +0 -18
- package/dist/components/examples/date/DateTimePickerExample.d.ts +0 -18
- package/dist/components/examples/date/DateTimePickerExample.js +0 -879
- package/dist/components/examples/date/DateTimePickerExample.js.map +0 -1
- package/dist/components/examples/date/DateTimePickerExample.mjs +0 -844
- package/dist/components/examples/date/DateTimePickerExample.mjs.map +0 -1
- package/dist/components/examples/properties/CheckboxPropertyExample.d.mts +0 -16
- package/dist/components/examples/properties/CheckboxPropertyExample.d.ts +0 -16
- package/dist/components/examples/properties/CheckboxPropertyExample.js +0 -349
- package/dist/components/examples/properties/CheckboxPropertyExample.js.map +0 -1
- package/dist/components/examples/properties/CheckboxPropertyExample.mjs +0 -314
- package/dist/components/examples/properties/CheckboxPropertyExample.mjs.map +0 -1
- package/dist/components/examples/properties/DatePropertyExample.d.mts +0 -16
- package/dist/components/examples/properties/DatePropertyExample.d.ts +0 -16
- package/dist/components/examples/properties/DatePropertyExample.js +0 -460
- package/dist/components/examples/properties/DatePropertyExample.js.map +0 -1
- package/dist/components/examples/properties/DatePropertyExample.mjs +0 -430
- package/dist/components/examples/properties/DatePropertyExample.mjs.map +0 -1
- package/dist/components/examples/properties/MultiSelectPropertyExample.d.mts +0 -18
- package/dist/components/examples/properties/MultiSelectPropertyExample.d.ts +0 -18
- package/dist/components/examples/properties/MultiSelectPropertyExample.js +0 -848
- package/dist/components/examples/properties/MultiSelectPropertyExample.js.map +0 -1
- package/dist/components/examples/properties/MultiSelectPropertyExample.mjs +0 -818
- package/dist/components/examples/properties/MultiSelectPropertyExample.mjs.map +0 -1
- package/dist/components/examples/properties/NumberPropertyExample.d.mts +0 -14
- package/dist/components/examples/properties/NumberPropertyExample.d.ts +0 -14
- package/dist/components/examples/properties/NumberPropertyExample.js +0 -456
- package/dist/components/examples/properties/NumberPropertyExample.js.map +0 -1
- package/dist/components/examples/properties/NumberPropertyExample.mjs +0 -426
- package/dist/components/examples/properties/NumberPropertyExample.mjs.map +0 -1
- package/dist/components/examples/properties/SelectPropertyExample.d.mts +0 -17
- package/dist/components/examples/properties/SelectPropertyExample.d.ts +0 -17
- package/dist/components/examples/properties/SelectPropertyExample.js +0 -584
- package/dist/components/examples/properties/SelectPropertyExample.js.map +0 -1
- package/dist/components/examples/properties/SelectPropertyExample.mjs +0 -554
- package/dist/components/examples/properties/SelectPropertyExample.mjs.map +0 -1
- package/dist/components/examples/properties/TextPropertyExample.d.mts +0 -16
- package/dist/components/examples/properties/TextPropertyExample.d.ts +0 -16
- package/dist/components/examples/properties/TextPropertyExample.js +0 -405
- package/dist/components/examples/properties/TextPropertyExample.js.map +0 -1
- package/dist/components/examples/properties/TextPropertyExample.mjs +0 -370
- package/dist/components/examples/properties/TextPropertyExample.mjs.map +0 -1
|
@@ -1,436 +0,0 @@
|
|
|
1
|
-
// src/components/examples/InputGroupExample.tsx
|
|
2
|
-
import { useState as useState5 } from "react";
|
|
3
|
-
|
|
4
|
-
// src/components/InputGroup.tsx
|
|
5
|
-
import { useEffect, useState } from "react";
|
|
6
|
-
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
7
|
-
import clsx from "clsx";
|
|
8
|
-
|
|
9
|
-
// src/util/noop.ts
|
|
10
|
-
var noop = () => void 0;
|
|
11
|
-
|
|
12
|
-
// src/components/InputGroup.tsx
|
|
13
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
var InputGroup = ({
|
|
15
|
-
children,
|
|
16
|
-
title,
|
|
17
|
-
expanded = true,
|
|
18
|
-
isExpandable = true,
|
|
19
|
-
disabled = false,
|
|
20
|
-
onChange = noop,
|
|
21
|
-
className = ""
|
|
22
|
-
}) => {
|
|
23
|
-
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
setIsExpanded(expanded);
|
|
26
|
-
}, [expanded]);
|
|
27
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx("col gap-y-4 p-4 bg-white rounded-xl", className), children: [
|
|
28
|
-
/* @__PURE__ */ jsxs(
|
|
29
|
-
"div",
|
|
30
|
-
{
|
|
31
|
-
className: clsx(
|
|
32
|
-
"row justify-between items-center",
|
|
33
|
-
{
|
|
34
|
-
"cursor-pointer": isExpandable && !disabled,
|
|
35
|
-
"cursor-not-allowed": disabled
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"text-primary": !disabled,
|
|
39
|
-
"text-primary/40": disabled
|
|
40
|
-
}
|
|
41
|
-
),
|
|
42
|
-
onClick: () => {
|
|
43
|
-
if (!isExpandable) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const updatedIsExpanded = !isExpanded;
|
|
47
|
-
onChange(updatedIsExpanded);
|
|
48
|
-
setIsExpanded(updatedIsExpanded);
|
|
49
|
-
},
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ jsx("span", { className: "textstyle-title-md", children: title }),
|
|
52
|
-
/* @__PURE__ */ jsx("div", { className: clsx("rounded-full text-white w-6 h-6", {
|
|
53
|
-
"bg-primary": isExpandable && !disabled || expanded,
|
|
54
|
-
"bg-primary/40": disabled
|
|
55
|
-
}), children: isExpanded ? /* @__PURE__ */ jsx(ChevronUp, { className: "-translate-y-[1px]", size: 24 }) : /* @__PURE__ */ jsx(ChevronDown, { className: "translate-y-[1px]", size: 24 }) })
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
isExpanded && /* @__PURE__ */ jsx("div", { className: "col gap-y-2 h-full", children })
|
|
60
|
-
] });
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
// src/components/user-input/Select.tsx
|
|
64
|
-
import { Menu } from "@headlessui/react";
|
|
65
|
-
import { ChevronDown as ChevronDown2, ChevronUp as ChevronUp2 } from "lucide-react";
|
|
66
|
-
import clsx2 from "clsx";
|
|
67
|
-
|
|
68
|
-
// src/components/user-input/Label.tsx
|
|
69
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
70
|
-
var styleMapping = {
|
|
71
|
-
labelSmall: "textstyle-label-sm",
|
|
72
|
-
labelMedium: "textstyle-label-md",
|
|
73
|
-
labelBig: "textstyle-label-lg"
|
|
74
|
-
};
|
|
75
|
-
var Label = ({
|
|
76
|
-
children,
|
|
77
|
-
name,
|
|
78
|
-
labelType = "labelSmall",
|
|
79
|
-
...props
|
|
80
|
-
}) => {
|
|
81
|
-
return /* @__PURE__ */ jsx2("label", { ...props, children: children ? children : /* @__PURE__ */ jsx2("span", { className: styleMapping[labelType], children: name }) });
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
// src/components/user-input/Select.tsx
|
|
85
|
-
import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
86
|
-
var Select = ({
|
|
87
|
-
value,
|
|
88
|
-
label,
|
|
89
|
-
options,
|
|
90
|
-
onChange,
|
|
91
|
-
isHidingCurrentValue = true,
|
|
92
|
-
hintText = "",
|
|
93
|
-
showDisabledOptions = true,
|
|
94
|
-
isDisabled,
|
|
95
|
-
className,
|
|
96
|
-
textColor = "text-menu-text",
|
|
97
|
-
hoverColor = "hover:brightness-90",
|
|
98
|
-
additionalItems,
|
|
99
|
-
selectedDisplayOverwrite
|
|
100
|
-
}) => {
|
|
101
|
-
let filteredOptions = isHidingCurrentValue ? options.filter((option) => option.value !== value) : options;
|
|
102
|
-
if (!showDisabledOptions) {
|
|
103
|
-
filteredOptions = filteredOptions.filter((value2) => !value2.disabled);
|
|
104
|
-
}
|
|
105
|
-
const selectedOption = options.find((option) => option.value === value);
|
|
106
|
-
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|
|
107
|
-
console.warn("The selected value is not found in the options list. This might be an error on your part or default behavior if it is complex data type on which === does not work. In case of the latter use selectedDisplayOverwrite to set your selected text or component");
|
|
108
|
-
}
|
|
109
|
-
const borderColor = "border-menu-border";
|
|
110
|
-
return /* @__PURE__ */ jsxs2("div", { className: clsx2(className), children: [
|
|
111
|
-
label && /* @__PURE__ */ jsx3(Label, { ...label, labelType: label.labelType ?? "labelBig", className: clsx2("mb-1", label.className) }),
|
|
112
|
-
/* @__PURE__ */ jsx3(Menu, { as: "div", className: "relative text-menu-text", children: ({ open }) => /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
113
|
-
/* @__PURE__ */ jsxs2(
|
|
114
|
-
Menu.Button,
|
|
115
|
-
{
|
|
116
|
-
className: clsx2(
|
|
117
|
-
"inline-flex w-full justify-between items-center rounded-t-lg border-2 px-4 py-2 font-medium bg-menu-background text-menu-text",
|
|
118
|
-
textColor,
|
|
119
|
-
borderColor,
|
|
120
|
-
{
|
|
121
|
-
"rounded-b-lg": !open,
|
|
122
|
-
[hoverColor]: !isDisabled,
|
|
123
|
-
"bg-disabled-background cursor-not-allowed text-disabled": isDisabled
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
|
-
disabled: isDisabled,
|
|
127
|
-
children: [
|
|
128
|
-
/* @__PURE__ */ jsx3("span", { children: selectedDisplayOverwrite ?? selectedOption?.label ?? hintText }),
|
|
129
|
-
open ? /* @__PURE__ */ jsx3(ChevronUp2, {}) : /* @__PURE__ */ jsx3(ChevronDown2, {})
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
),
|
|
133
|
-
/* @__PURE__ */ jsxs2(
|
|
134
|
-
Menu.Items,
|
|
135
|
-
{
|
|
136
|
-
className: "absolute w-full z-10 rounded-b-lg bg-menu-background text-menu-text shadow-lg max-h-[500px] overflow-y-auto",
|
|
137
|
-
children: [
|
|
138
|
-
(additionalItems ?? []).map((item, index) => /* @__PURE__ */ jsx3(
|
|
139
|
-
"div",
|
|
140
|
-
{
|
|
141
|
-
className: clsx2(borderColor, "px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0", {
|
|
142
|
-
"border-b-0 rounded-b-lg": filteredOptions.length === 0 && index === (additionalItems?.length ?? 1) - 1
|
|
143
|
-
}),
|
|
144
|
-
children: item
|
|
145
|
-
},
|
|
146
|
-
`additionalItems${index}`
|
|
147
|
-
)),
|
|
148
|
-
filteredOptions.map((option, index) => /* @__PURE__ */ jsx3(Menu.Item, { children: /* @__PURE__ */ jsx3(
|
|
149
|
-
"div",
|
|
150
|
-
{
|
|
151
|
-
className: clsx2(
|
|
152
|
-
"px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0 cursor-pointer",
|
|
153
|
-
option.className,
|
|
154
|
-
borderColor,
|
|
155
|
-
{
|
|
156
|
-
"brightness-90": option.value === value,
|
|
157
|
-
"brightness-95": index % 2 === 1,
|
|
158
|
-
"text-disabled bg-disabled-background cursor-not-allowed": !!option.disabled,
|
|
159
|
-
"bg-menu-background text-menu-text hover:brightness-90 cursor-pointer": !option.disabled,
|
|
160
|
-
"rounded-b-lg": index === filteredOptions.length - 1
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
onClick: () => {
|
|
164
|
-
if (!option.disabled) {
|
|
165
|
-
onChange(option.value);
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
children: option.label
|
|
169
|
-
}
|
|
170
|
-
) }, `item${index}`))
|
|
171
|
-
]
|
|
172
|
-
}
|
|
173
|
-
)
|
|
174
|
-
] }) })
|
|
175
|
-
] });
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
// src/components/user-input/Input.tsx
|
|
179
|
-
import {
|
|
180
|
-
useEffect as useEffect3,
|
|
181
|
-
useRef,
|
|
182
|
-
useState as useState3,
|
|
183
|
-
forwardRef
|
|
184
|
-
} from "react";
|
|
185
|
-
import clsx3 from "clsx";
|
|
186
|
-
|
|
187
|
-
// src/hooks/useSaveDelay.ts
|
|
188
|
-
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
189
|
-
function useSaveDelay(setNotificationStatus, delay) {
|
|
190
|
-
const [updateTimer, setUpdateTimer] = useState2(void 0);
|
|
191
|
-
const [notificationTimer, setNotificationTimer] = useState2(void 0);
|
|
192
|
-
const restartTimer = (onSave) => {
|
|
193
|
-
clearTimeout(updateTimer);
|
|
194
|
-
setUpdateTimer(setTimeout(() => {
|
|
195
|
-
onSave();
|
|
196
|
-
setNotificationStatus(true);
|
|
197
|
-
clearTimeout(notificationTimer);
|
|
198
|
-
setNotificationTimer(setTimeout(() => {
|
|
199
|
-
setNotificationStatus(false);
|
|
200
|
-
clearTimeout(notificationTimer);
|
|
201
|
-
}, delay));
|
|
202
|
-
clearTimeout(updateTimer);
|
|
203
|
-
}, delay));
|
|
204
|
-
};
|
|
205
|
-
const clearUpdateTimer = (hasSaved = true) => {
|
|
206
|
-
clearTimeout(updateTimer);
|
|
207
|
-
if (hasSaved) {
|
|
208
|
-
setNotificationStatus(true);
|
|
209
|
-
clearTimeout(notificationTimer);
|
|
210
|
-
setNotificationTimer(setTimeout(() => {
|
|
211
|
-
setNotificationStatus(false);
|
|
212
|
-
clearTimeout(notificationTimer);
|
|
213
|
-
}, delay));
|
|
214
|
-
} else {
|
|
215
|
-
setNotificationStatus(false);
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
useEffect2(() => {
|
|
219
|
-
return () => {
|
|
220
|
-
clearTimeout(updateTimer);
|
|
221
|
-
clearTimeout(notificationTimer);
|
|
222
|
-
};
|
|
223
|
-
}, []);
|
|
224
|
-
return { restartTimer, clearUpdateTimer };
|
|
225
|
-
}
|
|
226
|
-
var useSaveDelay_default = useSaveDelay;
|
|
227
|
-
|
|
228
|
-
// src/components/user-input/Input.tsx
|
|
229
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
230
|
-
var ControlledInput = ({
|
|
231
|
-
id,
|
|
232
|
-
type = "text",
|
|
233
|
-
value,
|
|
234
|
-
label,
|
|
235
|
-
onChange = noop,
|
|
236
|
-
onChangeEvent = noop,
|
|
237
|
-
className = "",
|
|
238
|
-
onEditCompleted,
|
|
239
|
-
expanded = true,
|
|
240
|
-
onBlur,
|
|
241
|
-
containerClassName,
|
|
242
|
-
...restProps
|
|
243
|
-
}) => {
|
|
244
|
-
const {
|
|
245
|
-
restartTimer,
|
|
246
|
-
clearUpdateTimer
|
|
247
|
-
} = useSaveDelay_default(() => void 0, 3e3);
|
|
248
|
-
const ref = useRef(null);
|
|
249
|
-
useEffect3(() => {
|
|
250
|
-
if (restProps.autoFocus) {
|
|
251
|
-
ref.current?.focus();
|
|
252
|
-
}
|
|
253
|
-
}, [restProps.autoFocus]);
|
|
254
|
-
return /* @__PURE__ */ jsxs3("div", { className: clsx3({ "w-full": expanded }, containerClassName), children: [
|
|
255
|
-
label && /* @__PURE__ */ jsx4(Label, { ...label, htmlFor: id, className: clsx3("mb-1", label.className) }),
|
|
256
|
-
/* @__PURE__ */ jsx4(
|
|
257
|
-
"input",
|
|
258
|
-
{
|
|
259
|
-
ref,
|
|
260
|
-
value,
|
|
261
|
-
id,
|
|
262
|
-
type,
|
|
263
|
-
className: clsx3("block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary", className),
|
|
264
|
-
onBlur: (event) => {
|
|
265
|
-
if (onBlur) {
|
|
266
|
-
onBlur(event);
|
|
267
|
-
}
|
|
268
|
-
if (onEditCompleted) {
|
|
269
|
-
onEditCompleted(event.target.value, event);
|
|
270
|
-
clearUpdateTimer();
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
onChange: (e) => {
|
|
274
|
-
const value2 = e.target.value;
|
|
275
|
-
if (onEditCompleted) {
|
|
276
|
-
restartTimer(() => {
|
|
277
|
-
onEditCompleted(value2, e);
|
|
278
|
-
clearUpdateTimer();
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
onChange(value2, e);
|
|
282
|
-
onChangeEvent(e);
|
|
283
|
-
},
|
|
284
|
-
...restProps
|
|
285
|
-
}
|
|
286
|
-
)
|
|
287
|
-
] });
|
|
288
|
-
};
|
|
289
|
-
var FormInput = forwardRef(function FormInput2({
|
|
290
|
-
id,
|
|
291
|
-
labelText,
|
|
292
|
-
errorText,
|
|
293
|
-
className,
|
|
294
|
-
labelClassName,
|
|
295
|
-
errorClassName,
|
|
296
|
-
containerClassName,
|
|
297
|
-
required,
|
|
298
|
-
...restProps
|
|
299
|
-
}, ref) {
|
|
300
|
-
const input = /* @__PURE__ */ jsx4(
|
|
301
|
-
"input",
|
|
302
|
-
{
|
|
303
|
-
ref,
|
|
304
|
-
id,
|
|
305
|
-
...restProps,
|
|
306
|
-
className: clsx3(
|
|
307
|
-
"block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary",
|
|
308
|
-
{
|
|
309
|
-
"focus:border-primary focus:ring-primary": !errorText,
|
|
310
|
-
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
311
|
-
},
|
|
312
|
-
className
|
|
313
|
-
)
|
|
314
|
-
}
|
|
315
|
-
);
|
|
316
|
-
return /* @__PURE__ */ jsxs3("div", { className: clsx3("flex flex-col gap-y-1", containerClassName), children: [
|
|
317
|
-
labelText && /* @__PURE__ */ jsxs3("label", { htmlFor: id, className: clsx3("textstyle-label-md", labelClassName), children: [
|
|
318
|
-
labelText,
|
|
319
|
-
required && /* @__PURE__ */ jsx4("span", { className: "text-primary font-bold", children: "*" })
|
|
320
|
-
] }),
|
|
321
|
-
input,
|
|
322
|
-
errorText && /* @__PURE__ */ jsx4("label", { htmlFor: id, className: clsx3("text-negative", errorClassName), children: errorText })
|
|
323
|
-
] });
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
// src/components/user-input/Textarea.tsx
|
|
327
|
-
import { useState as useState4 } from "react";
|
|
328
|
-
import clsx4 from "clsx";
|
|
329
|
-
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
330
|
-
var Textarea = ({
|
|
331
|
-
label,
|
|
332
|
-
headline,
|
|
333
|
-
id,
|
|
334
|
-
resizable = false,
|
|
335
|
-
onChange = noop,
|
|
336
|
-
disclaimer,
|
|
337
|
-
onBlur = noop,
|
|
338
|
-
onEditCompleted = noop,
|
|
339
|
-
defaultStyle = true,
|
|
340
|
-
className,
|
|
341
|
-
...props
|
|
342
|
-
}) => {
|
|
343
|
-
const [hasFocus, setHasFocus] = useState4(false);
|
|
344
|
-
const { restartTimer, clearUpdateTimer } = useSaveDelay_default(() => void 0, 3e3);
|
|
345
|
-
const onEditCompletedWrapper = (text) => {
|
|
346
|
-
onEditCompleted(text);
|
|
347
|
-
clearUpdateTimer();
|
|
348
|
-
};
|
|
349
|
-
return /* @__PURE__ */ jsxs4("div", { className: "w-full", children: [
|
|
350
|
-
label && /* @__PURE__ */ jsx5(Label, { ...label, htmlFor: id, className: clsx4("mb-1", label.className), labelType: label.labelType ?? "labelSmall" }),
|
|
351
|
-
/* @__PURE__ */ jsxs4("div", { className: `${clsx4(" bg-surface text-on-surface focus-within:border-primary relative", { "shadow border-2 border-gray-300 hover:border-primary rounded-lg": defaultStyle })}`, children: [
|
|
352
|
-
headline && /* @__PURE__ */ jsx5("span", { className: "mx-3 mt-3 block text-gray-700 font-bold", children: headline }),
|
|
353
|
-
/* @__PURE__ */ jsx5(
|
|
354
|
-
"textarea",
|
|
355
|
-
{
|
|
356
|
-
id,
|
|
357
|
-
className: clsx4("pt-0 px-3 border-transparent focus:border-transparent focus:ring-0 appearance-none border w-full leading-tight focus:outline-none", { "resize-none": !resizable, "h-32": defaultStyle, "mt-3": !headline }, className),
|
|
358
|
-
onChange: (event) => {
|
|
359
|
-
const value = event.target.value;
|
|
360
|
-
restartTimer(() => {
|
|
361
|
-
onEditCompletedWrapper(value);
|
|
362
|
-
});
|
|
363
|
-
onChange(value);
|
|
364
|
-
},
|
|
365
|
-
onFocus: () => {
|
|
366
|
-
setHasFocus(true);
|
|
367
|
-
},
|
|
368
|
-
onBlur: (event) => {
|
|
369
|
-
onBlur(event);
|
|
370
|
-
onEditCompletedWrapper(event.target.value);
|
|
371
|
-
setHasFocus(false);
|
|
372
|
-
},
|
|
373
|
-
...props
|
|
374
|
-
}
|
|
375
|
-
)
|
|
376
|
-
] }),
|
|
377
|
-
hasFocus && disclaimer && /* @__PURE__ */ jsx5("label", { className: "text-negative", children: disclaimer })
|
|
378
|
-
] });
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
// src/components/examples/InputGroupExample.tsx
|
|
382
|
-
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
383
|
-
var InputGroupExample = ({
|
|
384
|
-
...props
|
|
385
|
-
}) => {
|
|
386
|
-
const [state, setState] = useState5({
|
|
387
|
-
propertyName: "",
|
|
388
|
-
description: ""
|
|
389
|
-
});
|
|
390
|
-
return /* @__PURE__ */ jsxs5(
|
|
391
|
-
InputGroup,
|
|
392
|
-
{
|
|
393
|
-
...props,
|
|
394
|
-
onChange: console.log,
|
|
395
|
-
children: [
|
|
396
|
-
/* @__PURE__ */ jsx6(
|
|
397
|
-
Select,
|
|
398
|
-
{
|
|
399
|
-
label: { name: "Subject Type", labelType: "labelSmall" },
|
|
400
|
-
value: state.subject,
|
|
401
|
-
options: [
|
|
402
|
-
{ value: "organization", label: "Organization" },
|
|
403
|
-
{ value: "ward", label: "Ward" },
|
|
404
|
-
{ value: "bed", label: "Bed" },
|
|
405
|
-
{ value: "patient", label: "Patient" }
|
|
406
|
-
],
|
|
407
|
-
onChange: (subject) => setState({ ...state, subject })
|
|
408
|
-
},
|
|
409
|
-
"item1"
|
|
410
|
-
),
|
|
411
|
-
/* @__PURE__ */ jsx6(
|
|
412
|
-
ControlledInput,
|
|
413
|
-
{
|
|
414
|
-
label: { name: "Property Name" },
|
|
415
|
-
value: state.propertyName,
|
|
416
|
-
onChange: (propertyName) => setState({ ...state, propertyName })
|
|
417
|
-
},
|
|
418
|
-
"item2"
|
|
419
|
-
),
|
|
420
|
-
/* @__PURE__ */ jsx6(
|
|
421
|
-
Textarea,
|
|
422
|
-
{
|
|
423
|
-
label: { name: "Description" },
|
|
424
|
-
value: state.description,
|
|
425
|
-
onChange: (description) => setState({ ...state, description })
|
|
426
|
-
},
|
|
427
|
-
"item3"
|
|
428
|
-
)
|
|
429
|
-
]
|
|
430
|
-
}
|
|
431
|
-
);
|
|
432
|
-
};
|
|
433
|
-
export {
|
|
434
|
-
InputGroupExample
|
|
435
|
-
};
|
|
436
|
-
//# sourceMappingURL=InputGroupExample.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/examples/InputGroupExample.tsx","../../../src/components/InputGroup.tsx","../../../src/util/noop.ts","../../../src/components/user-input/Select.tsx","../../../src/components/user-input/Label.tsx","../../../src/components/user-input/Input.tsx","../../../src/hooks/useSaveDelay.ts","../../../src/components/user-input/Textarea.tsx"],"sourcesContent":["import { useState } from 'react'\nimport type { InputGroupProps } from '../InputGroup'\nimport { InputGroup } from '../InputGroup'\nimport { Select } from '../user-input/Select'\nimport { Input } from '../user-input/Input'\nimport { Textarea } from '../user-input/Textarea'\n\nexport type InputGroupExampleProps = Omit<InputGroupProps, 'inputs' | 'onChange'>\n\ntype InputType = {\n subject?: string,\n propertyName: string,\n description: string,\n}\n\n/**\n * Example for an Input Group\n */\nexport const InputGroupExample = ({\n ...props\n}: InputGroupExampleProps) => {\n const [state, setState] = useState<InputType>({\n propertyName: '',\n description: ''\n })\n\n return (\n <InputGroup\n {...props}\n onChange={console.log}\n >\n <Select\n key=\"item1\"\n label={{ name: 'Subject Type', labelType: 'labelSmall' }}\n value={state.subject}\n options={[\n { value: 'organization', label: 'Organization' },\n { value: 'ward', label: 'Ward' },\n { value: 'bed', label: 'Bed' },\n { value: 'patient', label: 'Patient' },\n ]}\n onChange={subject => setState({ ...state, subject })}\n />\n <Input\n key=\"item2\"\n label={{ name: 'Property Name' }}\n value={state.propertyName}\n onChange={propertyName => setState({ ...state, propertyName })}\n />\n <Textarea\n key=\"item3\"\n label={{ name: 'Description' }}\n value={state.description}\n onChange={description => setState({ ...state, description })}\n />\n </InputGroup>\n )\n}\n","import type { PropsWithChildren } from 'react'\nimport { useEffect, useState } from 'react'\nimport { ChevronDown, ChevronUp } from 'lucide-react'\nimport clsx from 'clsx'\nimport { noop } from '../util/noop'\n\nexport type InputGroupProps = PropsWithChildren<{\n title: string,\n expanded?: boolean,\n isExpandable?: boolean,\n disabled?: boolean,\n onChange?: (value: boolean) => void,\n className?: string,\n}>\n\n/**\n * A Component for layouting inputs in an expandable group\n */\nexport const InputGroup = ({\n children,\n title,\n expanded = true,\n isExpandable = true,\n disabled = false,\n onChange = noop,\n className = '',\n}: InputGroupProps) => {\n const [isExpanded, setIsExpanded] = useState<boolean>(expanded)\n\n useEffect(() => {\n setIsExpanded(expanded)\n }, [expanded])\n\n return (\n <div className={clsx('col gap-y-4 p-4 bg-white rounded-xl', className)}>\n <div\n className={clsx('row justify-between items-center', {\n 'cursor-pointer': isExpandable && !disabled,\n 'cursor-not-allowed': disabled,\n },\n {\n 'text-primary': !disabled,\n 'text-primary/40': disabled\n })}\n onClick={() => {\n if (!isExpandable) {\n return\n }\n const updatedIsExpanded = !isExpanded\n onChange(updatedIsExpanded)\n setIsExpanded(updatedIsExpanded)\n }}\n >\n <span className=\"textstyle-title-md\">{title}</span>\n <div className={clsx('rounded-full text-white w-6 h-6', {\n 'bg-primary': (isExpandable && !disabled) || expanded,\n 'bg-primary/40': disabled,\n })}>\n {isExpanded\n ? <ChevronUp className=\"-translate-y-[1px]\" size={24}/>\n : <ChevronDown className=\"translate-y-[1px]\" size={24}/>\n }\n </div>\n </div>\n {isExpanded && (\n <div className=\"col gap-y-2 h-full\">\n {children}\n </div>\n )}\n </div>\n )\n}\n","export const noop = () => undefined\n","import { Menu } from '@headlessui/react'\nimport { ChevronDown, ChevronUp } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport clsx from 'clsx'\nimport type { LabelProps } from './Label'\nimport { Label } from './Label'\n\nexport type SelectOption<T> = {\n label: ReactNode,\n value: T,\n disabled?: boolean,\n className?: string,\n}\n\nexport type SelectProps<T> = {\n value?: T,\n label?: LabelProps,\n options: SelectOption<T>[],\n onChange: (value: T) => void,\n isHidingCurrentValue?: boolean,\n hintText?: string,\n showDisabledOptions?: boolean,\n className?: string,\n isDisabled?: boolean,\n textColor?: string,\n hoverColor?: string,\n /**\n * The items will be at the start of the select and aren't selectable\n */\n additionalItems?: ReactNode[],\n selectedDisplayOverwrite?: ReactNode,\n};\n\n/**\n * A Select Component for selecting form a list of options\n *\n * The State is managed by the parent\n */\nexport const Select = <T, >({\n value,\n label,\n options,\n onChange,\n isHidingCurrentValue = true,\n hintText = '',\n showDisabledOptions = true,\n isDisabled,\n className,\n textColor = 'text-menu-text',\n hoverColor = 'hover:brightness-90',\n additionalItems,\n selectedDisplayOverwrite,\n }: SelectProps<T>) => {\n // Notice: for more complex types this check here might need an additional compare method\n let filteredOptions = isHidingCurrentValue ? options.filter(option => option.value !== value) : options\n if (!showDisabledOptions) {\n filteredOptions = filteredOptions.filter(value => !value.disabled)\n }\n const selectedOption = options.find(option => option.value === value)\n if (value !== undefined && selectedOption === undefined && selectedDisplayOverwrite === undefined) {\n console.warn('The selected value is not found in the options list. This might be an error on your part or' +\n ' default behavior if it is complex data type on which === does not work. In case of the latter' +\n ' use selectedDisplayOverwrite to set your selected text or component')\n }\n\n const borderColor = 'border-menu-border'\n\n return (\n <div className={clsx(className)}>\n {label && (\n <Label {...label} labelType={label.labelType ?? 'labelBig'} className={clsx('mb-1', label.className)}/>\n )}\n <Menu as=\"div\" className=\"relative text-menu-text\">\n {({ open }) => (\n <>\n <Menu.Button\n className={clsx(\n 'inline-flex w-full justify-between items-center rounded-t-lg border-2 px-4 py-2 font-medium bg-menu-background text-menu-text',\n textColor, borderColor,\n {\n 'rounded-b-lg': !open,\n [hoverColor]: !isDisabled,\n 'bg-disabled-background cursor-not-allowed text-disabled': isDisabled\n }\n )}\n disabled={isDisabled}\n >\n <span>{selectedDisplayOverwrite ?? selectedOption?.label ?? hintText}</span>\n {open ? <ChevronUp/> : <ChevronDown/>}\n </Menu.Button>\n <Menu.Items\n className=\"absolute w-full z-10 rounded-b-lg bg-menu-background text-menu-text shadow-lg max-h-[500px] overflow-y-auto\"\n >\n {(additionalItems ?? []).map((item, index) => (\n <div key={`additionalItems${index}`}\n className={clsx(borderColor, 'px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0', {\n 'border-b-0 rounded-b-lg': filteredOptions.length === 0 && index === (additionalItems?.length ?? 1) - 1,\n })}\n >\n {item}\n </div>\n ))}\n {filteredOptions.map((option, index) => (\n <Menu.Item key={`item${index}`}>\n {\n <div\n className={clsx('px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0 cursor-pointer',\n option.className, borderColor, {\n 'brightness-90': option.value === value,\n 'brightness-95': index % 2 === 1,\n 'text-disabled bg-disabled-background cursor-not-allowed': !!option.disabled,\n 'bg-menu-background text-menu-text hover:brightness-90 cursor-pointer': !option.disabled,\n 'rounded-b-lg': index === filteredOptions.length - 1,\n })}\n onClick={() => {\n if (!option.disabled) {\n onChange(option.value)\n }\n }}\n >\n {option.label}\n </div>\n }\n </Menu.Item>\n ))}\n </Menu.Items>\n </>\n )}\n </Menu>\n </div>\n )\n}\n","import type { LabelHTMLAttributes } from 'react'\n\nexport type LabelType = 'labelSmall' | 'labelMedium' | 'labelBig'\nconst styleMapping: Record<LabelType, string> = {\n labelSmall: 'textstyle-label-sm',\n labelMedium: 'textstyle-label-md',\n labelBig: 'textstyle-label-lg',\n}\n\n\nexport type LabelProps = {\n /** The text for the label */\n name?: string,\n /** The styling for the label */\n labelType?: LabelType,\n} & LabelHTMLAttributes<HTMLLabelElement>\n\n/**\n * A Label component\n */\nexport const Label = ({\n children,\n name,\n labelType = 'labelSmall',\n ...props\n}: LabelProps) => {\n return (\n <label {...props}>\n {children ? children : (<span className={styleMapping[labelType]}>{name}</span>)}\n </label>\n )\n}\n","import React, {\n useEffect,\n useRef,\n useState,\n type ChangeEvent,\n type HTMLInputTypeAttribute,\n type InputHTMLAttributes, forwardRef\n} from 'react'\nimport clsx from 'clsx'\nimport useSaveDelay from '../../hooks/useSaveDelay'\nimport { noop } from '../../util/noop'\nimport type { LabelProps } from './Label'\nimport { Label } from './Label'\n\nexport type InputProps = {\n /**\n * used for the label's `for` attribute\n */\n id?: string,\n value: string,\n label?: Omit<LabelProps, 'id'>,\n /**\n * @default 'text'\n */\n type?: HTMLInputTypeAttribute,\n /**\n * Callback for when the input's value changes\n * This is pretty much required but made optional for the rare cases where it actually isn't need such as when used with disabled\n * That could be enforced through a union type but that seems a bit overkill\n * @default noop\n */\n onChange?: (text: string, event: ChangeEvent<HTMLInputElement>) => void,\n onChangeEvent?: (event: ChangeEvent<HTMLInputElement>) => void,\n className?: string,\n onEditCompleted?: (text: string, event: ChangeEvent<HTMLInputElement>) => void,\n expanded?: boolean,\n containerClassName?: string,\n} & Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'value' | 'label' | 'type' | 'onChange' | 'crossOrigin'>\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed must be managed by the parent\n */\nconst ControlledInput = ({\n id,\n type = 'text',\n value,\n label,\n onChange = noop,\n onChangeEvent = noop,\n className = '',\n onEditCompleted,\n expanded = true,\n onBlur,\n containerClassName,\n ...restProps\n }: InputProps) => {\n const {\n restartTimer,\n clearUpdateTimer\n } = useSaveDelay(() => undefined, 3000)\n const ref = useRef<HTMLInputElement>(null)\n\n useEffect(() => {\n if (restProps.autoFocus) {\n ref.current?.focus()\n }\n }, [restProps.autoFocus])\n return (\n <div className={clsx({ 'w-full': expanded }, containerClassName)}>\n {label && <Label {...label} htmlFor={id} className={clsx('mb-1', label.className)}/>}\n <input\n ref={ref}\n value={value}\n id={id}\n type={type}\n className={clsx('block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary', className)}\n onBlur={event => {\n if (onBlur) {\n onBlur(event)\n }\n if (onEditCompleted) {\n onEditCompleted(event.target.value, event)\n clearUpdateTimer()\n }\n }}\n onChange={e => {\n const value = e.target.value\n if (onEditCompleted) {\n restartTimer(() => {\n onEditCompleted(value, e)\n clearUpdateTimer()\n })\n }\n onChange(value, e)\n onChangeEvent(e)\n }}\n {...restProps}\n />\n </div>\n )\n}\n\ntype UncontrolledInputProps = Omit<InputProps, 'value'> & {\n /**\n * @default ''\n */\n defaultValue?: string,\n}\n\n/**\n * A Component for inputting text or other information\n *\n * Its state is managed by the component itself\n */\nconst UncontrolledInput = ({\n defaultValue = '',\n onChange = noop,\n ...props\n }: UncontrolledInputProps) => {\n const [value, setValue] = useState(defaultValue)\n\n const handleChange = (text: string, event: ChangeEvent<HTMLInputElement>) => {\n setValue(text)\n onChange(text, event)\n }\n\n return (\n <ControlledInput\n {...props}\n value={value}\n onChange={handleChange}\n />\n )\n}\n\nexport type FormInputProps = InputHTMLAttributes<HTMLInputElement> & {\n id: string,\n labelText?: string,\n errorText?: string,\n labelClassName?: string,\n errorClassName?: string,\n containerClassName?: string,\n}\n\nconst FormInput = forwardRef<HTMLInputElement, FormInputProps>(function FormInput({\n id,\n labelText,\n errorText,\n className,\n labelClassName,\n errorClassName,\n containerClassName,\n required,\n ...restProps\n }, ref) {\n const input = (\n <input\n ref={ref}\n id={id}\n {...restProps}\n className={clsx(\n 'block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary',\n {\n 'focus:border-primary focus:ring-primary': !errorText,\n 'focus:border-negative focus:ring-negative text-negative': !!errorText,\n },\n className\n )}\n />\n )\n\n return (\n <div className={clsx('flex flex-col gap-y-1', containerClassName)}>\n {labelText && (\n <label htmlFor={id} className={clsx('textstyle-label-md', labelClassName)}>\n {labelText}\n {required && <span className=\"text-primary font-bold\">*</span>}\n </label>\n )}\n {input}\n {errorText && <label htmlFor={id} className={clsx('text-negative', errorClassName)}>{errorText}</label>}\n </div>\n )\n})\n\nexport {\n UncontrolledInput,\n ControlledInput as Input,\n FormInput\n}\n","import { useEffect, useState } from 'react'\n\nfunction useSaveDelay(setNotificationStatus: (isShowing: boolean) => void, delay: number) {\n const [updateTimer, setUpdateTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n const [notificationTimer, setNotificationTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n\n const restartTimer = (onSave: () => void) => {\n clearTimeout(updateTimer)\n setUpdateTimer(setTimeout(() => {\n onSave()\n setNotificationStatus(true)\n // Show Saved Notification for fade animation duration\n clearTimeout(notificationTimer)\n setNotificationTimer(setTimeout(() => {\n setNotificationStatus(false)\n clearTimeout(notificationTimer)\n }, delay))\n clearTimeout(updateTimer)\n }, delay))\n }\n\n const clearUpdateTimer = (hasSaved = true) => {\n clearTimeout(updateTimer)\n if (hasSaved) {\n setNotificationStatus(true)\n clearTimeout(notificationTimer)\n setNotificationTimer(setTimeout(() => {\n setNotificationStatus(false)\n clearTimeout(notificationTimer)\n }, delay))\n } else {\n setNotificationStatus(false)\n }\n }\n\n useEffect(() => {\n return () => {\n clearTimeout(updateTimer)\n clearTimeout(notificationTimer)\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return { restartTimer, clearUpdateTimer }\n}\n\nexport default useSaveDelay\n","import type { TextareaHTMLAttributes } from 'react'\nimport { useState } from 'react'\nimport clsx from 'clsx'\nimport useSaveDelay from '../../hooks/useSaveDelay'\nimport { noop } from '../../util/noop'\nimport type { LabelProps } from './Label'\nimport { Label } from './Label'\n\nexport type TextareaProps = {\n /** Outside the area */\n label?: Omit<LabelProps, 'id'>,\n /** Inside the area */\n headline?: string,\n id?: string,\n resizable?: boolean,\n onChange?: (text: string) => void,\n disclaimer?: string,\n onEditCompleted?: (text: string) => void,\n defaultStyle?: boolean,\n} & Omit<TextareaHTMLAttributes<Element>, 'id' | 'onChange'>\n\n/**\n * A Textarea component for inputting longer texts\n *\n * The State is managed by the parent\n */\nexport const Textarea = ({\n label,\n headline,\n id,\n resizable = false,\n onChange = noop,\n disclaimer,\n onBlur = noop,\n onEditCompleted = noop,\n defaultStyle = true,\n className,\n ...props\n}: TextareaProps) => {\n const [hasFocus, setHasFocus] = useState(false)\n const { restartTimer, clearUpdateTimer } = useSaveDelay(() => undefined, 3000)\n\n const onEditCompletedWrapper = (text: string) => {\n onEditCompleted(text)\n clearUpdateTimer()\n }\n\n return (\n <div className=\"w-full\">\n {label && (<Label {...label} htmlFor={id} className={clsx('mb-1', label.className)} labelType={label.labelType ?? 'labelSmall'}/>)}\n <div className={`${clsx(' bg-surface text-on-surface focus-within:border-primary relative', { 'shadow border-2 border-gray-300 hover:border-primary rounded-lg': defaultStyle })}`}>\n {headline && (\n <span className=\"mx-3 mt-3 block text-gray-700 font-bold\">\n {headline}\n </span>\n )}\n <textarea\n id={id}\n className={clsx('pt-0 px-3 border-transparent focus:border-transparent focus:ring-0 appearance-none border w-full leading-tight focus:outline-none', { 'resize-none': !resizable, 'h-32': defaultStyle, 'mt-3': !headline }, className)}\n onChange={(event) => {\n const value = event.target.value\n restartTimer(() => {\n onEditCompletedWrapper(value)\n })\n onChange(value)\n }}\n onFocus={() => {\n setHasFocus(true)\n }}\n onBlur={(event) => {\n onBlur(event)\n onEditCompletedWrapper(event.target.value)\n setHasFocus(false)\n }}\n {...props}\n >\n </textarea>\n </div>\n {(hasFocus && disclaimer) && (\n <label className=\"text-negative\">\n {disclaimer}\n </label>\n )}\n </div>\n )\n}\n"],"mappings":";AAAA,SAAS,YAAAA,iBAAgB;;;ACCzB,SAAS,WAAW,gBAAgB;AACpC,SAAS,aAAa,iBAAiB;AACvC,OAAO,UAAU;;;ACHV,IAAM,OAAO,MAAM;;;ADmCpB,SAkBE,KAlBF;AAjBC,IAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,eAAe;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AACd,MAAuB;AACrB,QAAM,CAAC,YAAY,aAAa,IAAI,SAAkB,QAAQ;AAE9D,YAAU,MAAM;AACd,kBAAc,QAAQ;AAAA,EACxB,GAAG,CAAC,QAAQ,CAAC;AAEb,SACE,qBAAC,SAAI,WAAW,KAAK,uCAAuC,SAAS,GACnE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UAAK;AAAA,UAAoC;AAAA,YAClD,kBAAkB,gBAAgB,CAAC;AAAA,YACnC,sBAAsB;AAAA,UACxB;AAAA,UACA;AAAA,YACE,gBAAgB,CAAC;AAAA,YACjB,mBAAmB;AAAA,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,CAAC;AAAA;AAAA,UAHvD;AAAA,QAIN;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["useState","ChevronDown","ChevronUp","clsx","jsx","jsx","jsxs","value","clsx","ChevronUp","ChevronDown","useEffect","useState","clsx","useEffect","useState","jsx","jsxs","useEffect","clsx","value","FormInput","jsx","clsx","jsxs","useState","clsx","jsx","jsxs","useState","clsx","jsx","jsxs","useState"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { MultiSelectProps } from '../user-input/MultiSelect.mjs';
|
|
3
|
-
import 'react';
|
|
4
|
-
import '../../hooks/useTranslation.mjs';
|
|
5
|
-
import '../../hooks/useLanguage.mjs';
|
|
6
|
-
import '../user-input/Label.mjs';
|
|
7
|
-
|
|
8
|
-
type MultiSelectExampleProps = Omit<MultiSelectProps<string>, 'search' | 'selectedDisplay'> & {
|
|
9
|
-
enableSearch: boolean;
|
|
10
|
-
useChipDisplay: boolean;
|
|
11
|
-
};
|
|
12
|
-
declare const MultiSelectExample: ({ options, hintText, enableSearch, onChange, useChipDisplay, ...props }: MultiSelectExampleProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
-
|
|
14
|
-
export { MultiSelectExample };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { MultiSelectProps } from '../user-input/MultiSelect.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
import '../../hooks/useTranslation.js';
|
|
5
|
-
import '../../hooks/useLanguage.js';
|
|
6
|
-
import '../user-input/Label.js';
|
|
7
|
-
|
|
8
|
-
type MultiSelectExampleProps = Omit<MultiSelectProps<string>, 'search' | 'selectedDisplay'> & {
|
|
9
|
-
enableSearch: boolean;
|
|
10
|
-
useChipDisplay: boolean;
|
|
11
|
-
};
|
|
12
|
-
declare const MultiSelectExample: ({ options, hintText, enableSearch, onChange, useChipDisplay, ...props }: MultiSelectExampleProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
-
|
|
14
|
-
export { MultiSelectExample };
|