@helpwave/hightide 0.1.21 → 0.1.23
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/README.md +5 -0
- package/dist/components/branding/HelpwaveBadge.js +8 -5
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +8 -5
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.js +11 -1
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +11 -1
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/TimeDisplay.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js +1 -0
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +1 -0
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.js +2 -1
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +2 -1
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.d.mts +17 -7
- package/dist/components/icons-and-geometry/Avatar.d.ts +17 -7
- package/dist/components/icons-and-geometry/Avatar.js +2982 -42
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.mjs +3010 -40
- package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Tag.js +2912 -1
- package/dist/components/icons-and-geometry/Tag.js.map +1 -1
- package/dist/components/icons-and-geometry/Tag.mjs +2931 -1
- package/dist/components/icons-and-geometry/Tag.mjs.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.d.mts +2 -1
- package/dist/components/layout-and-navigation/BreadCrumb.d.ts +2 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js +15 -11
- package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.mjs +15 -11
- package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +1 -0
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +1 -0
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Chip.d.mts +6 -2
- package/dist/components/layout-and-navigation/Chip.d.ts +6 -2
- package/dist/components/layout-and-navigation/Chip.js +10 -4
- package/dist/components/layout-and-navigation/Chip.js.map +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs +8 -3
- package/dist/components/layout-and-navigation/Chip.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +3 -2
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +3 -2
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.js +3 -2
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +3 -2
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.js +2 -1
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +2 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +1 -0
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +1 -0
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Tile.d.mts +9 -10
- package/dist/components/layout-and-navigation/Tile.d.ts +9 -10
- package/dist/components/layout-and-navigation/Tile.js +21 -4
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +20 -4
- package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/LoadingButton.js +1 -0
- package/dist/components/loading-states/LoadingButton.js.map +1 -1
- package/dist/components/loading-states/LoadingButton.mjs +1 -0
- package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.js +2 -1
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +2 -1
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +2 -1
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +2 -1
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.js +3 -2
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +3 -2
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +26 -26
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +27 -31
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +32 -29
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +31 -32
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +14 -4
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +14 -4
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +14 -4
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +14 -4
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +0 -1
- package/dist/components/properties/MultiSelectProperty.d.ts +0 -1
- package/dist/components/properties/MultiSelectProperty.js +663 -648
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +779 -768
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +14 -4
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +14 -4
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +13 -3
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +13 -3
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +0 -1
- package/dist/components/properties/SelectProperty.d.ts +0 -1
- package/dist/components/properties/SelectProperty.js +39 -30
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +40 -35
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +16 -6
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +16 -6
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/table/Table.js +6 -5
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.mjs +7 -10
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/TableFilterButton.js +3 -2
- package/dist/components/table/TableFilterButton.js.map +1 -1
- package/dist/components/table/TableFilterButton.mjs +4 -7
- package/dist/components/table/TableFilterButton.mjs.map +1 -1
- package/dist/components/table/TableSortButton.js +1 -0
- package/dist/components/table/TableSortButton.js.map +1 -1
- package/dist/components/table/TableSortButton.mjs +1 -0
- package/dist/components/table/TableSortButton.mjs.map +1 -1
- package/dist/components/user-action/Button.d.mts +2 -1
- package/dist/components/user-action/Button.d.ts +2 -1
- package/dist/components/user-action/Button.js +12 -1
- package/dist/components/user-action/Button.js.map +1 -1
- package/dist/components/user-action/Button.mjs +12 -1
- package/dist/components/user-action/Button.mjs.map +1 -1
- package/dist/components/user-action/Checkbox.js +1 -1
- package/dist/components/user-action/Checkbox.js.map +1 -1
- package/dist/components/user-action/Checkbox.mjs +1 -1
- package/dist/components/user-action/Checkbox.mjs.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +11 -1
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +11 -1
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Input.js +1 -1
- package/dist/components/user-action/Input.js.map +1 -1
- package/dist/components/user-action/Input.mjs +1 -1
- package/dist/components/user-action/Input.mjs.map +1 -1
- package/dist/components/user-action/Menu.js +2 -2
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +3 -7
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +0 -1
- package/dist/components/user-action/MultiSelect.d.ts +0 -1
- package/dist/components/user-action/MultiSelect.js +622 -616
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +641 -639
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/ScrollPicker.js +1 -1
- package/dist/components/user-action/ScrollPicker.js.map +1 -1
- package/dist/components/user-action/ScrollPicker.mjs +1 -1
- package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
- package/dist/components/user-action/SearchBar.js +2 -1
- package/dist/components/user-action/SearchBar.js.map +1 -1
- package/dist/components/user-action/SearchBar.mjs +2 -1
- package/dist/components/user-action/SearchBar.mjs.map +1 -1
- package/dist/components/user-action/Select.d.mts +1 -4
- package/dist/components/user-action/Select.d.ts +1 -4
- package/dist/components/user-action/Select.js +25 -27
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +26 -31
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Textarea.js +3 -3
- package/dist/components/user-action/Textarea.js.map +1 -1
- package/dist/components/user-action/Textarea.mjs +3 -3
- package/dist/components/user-action/Textarea.mjs.map +1 -1
- package/dist/css/globals.css +431 -212
- package/dist/css/uncompiled/globals.css +5 -5
- package/dist/css/uncompiled/textstyles.css +5 -5
- package/dist/css/uncompiled/theme/colors-basic.css +13 -5
- package/dist/css/uncompiled/theme/colors-component.css +60 -49
- package/dist/css/uncompiled/theme/colors-semantic.css +76 -78
- package/dist/css/uncompiled/utitlity/shadow.css +45 -16
- package/dist/hooks/useLocalStorage.js +8 -3
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useLocalStorage.mjs +8 -3
- package/dist/hooks/useLocalStorage.mjs.map +1 -1
- package/dist/hooks/useLogOnce.d.mts +8 -0
- package/dist/hooks/useLogOnce.d.ts +8 -0
- package/dist/hooks/useLogOnce.js +53 -0
- package/dist/hooks/useLogOnce.js.map +1 -0
- package/dist/hooks/useLogOnce.mjs +29 -0
- package/dist/hooks/useLogOnce.mjs.map +1 -0
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +3301 -435
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3185 -324
- package/dist/index.mjs.map +1 -1
- package/dist/localization/LanguageProvider.js +8 -3
- package/dist/localization/LanguageProvider.js.map +1 -1
- package/dist/localization/LanguageProvider.mjs +8 -3
- package/dist/localization/LanguageProvider.mjs.map +1 -1
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs.map +1 -1
- package/dist/theming/useTheme.d.mts +2 -2
- package/dist/theming/useTheme.d.ts +2 -2
- package/dist/theming/useTheme.js +26 -22
- package/dist/theming/useTheme.js.map +1 -1
- package/dist/theming/useTheme.mjs +21 -17
- package/dist/theming/useTheme.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ __export(MultiSelectProperty_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(MultiSelectProperty_exports);
|
|
35
35
|
var import_lucide_react7 = require("lucide-react");
|
|
36
|
-
var
|
|
36
|
+
var import_clsx12 = __toESM(require("clsx"));
|
|
37
37
|
|
|
38
38
|
// src/localization/LanguageProvider.tsx
|
|
39
39
|
var import_react2 = require("react");
|
|
@@ -123,9 +123,9 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
// src/components/user-action/MultiSelect.tsx
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
var
|
|
126
|
+
var import_react14 = require("react");
|
|
127
|
+
var import_react15 = require("react");
|
|
128
|
+
var import_clsx10 = __toESM(require("clsx"));
|
|
129
129
|
|
|
130
130
|
// src/components/user-action/Label.tsx
|
|
131
131
|
var import_clsx = __toESM(require("clsx"));
|
|
@@ -145,156 +145,392 @@ var Label = ({
|
|
|
145
145
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
146
146
|
};
|
|
147
147
|
|
|
148
|
-
// src/components/user-action/
|
|
149
|
-
var
|
|
150
|
-
var import_react14 = require("react");
|
|
151
|
-
var import_clsx8 = __toESM(require("clsx"));
|
|
152
|
-
|
|
153
|
-
// src/components/layout-and-navigation/Tile.tsx
|
|
148
|
+
// src/components/user-action/Button.tsx
|
|
149
|
+
var import_react3 = require("react");
|
|
154
150
|
var import_clsx2 = __toESM(require("clsx"));
|
|
155
|
-
var import_lucide_react = require("lucide-react");
|
|
156
151
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
152
|
+
var ButtonColorUtil = {
|
|
153
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
154
|
+
text: ["primary", "negative", "neutral"],
|
|
155
|
+
outline: ["primary"]
|
|
156
|
+
};
|
|
157
|
+
var IconButtonUtil = {
|
|
158
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
159
|
+
};
|
|
160
|
+
var paddingMapping = {
|
|
161
|
+
small: "btn-sm",
|
|
162
|
+
medium: "btn-md",
|
|
163
|
+
large: "btn-lg"
|
|
164
|
+
};
|
|
165
|
+
var iconPaddingMapping = {
|
|
166
|
+
tiny: "icon-btn-xs",
|
|
167
|
+
small: "icon-btn-sm",
|
|
168
|
+
medium: "icon-btn-md",
|
|
169
|
+
large: "icon-btn-lg"
|
|
170
|
+
};
|
|
171
|
+
var ButtonUtil = {
|
|
172
|
+
paddingMapping,
|
|
173
|
+
iconPaddingMapping
|
|
174
|
+
};
|
|
175
|
+
var SolidButton = (0, import_react3.forwardRef)(function SolidButton2({
|
|
176
|
+
children,
|
|
162
177
|
disabled = false,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
className
|
|
169
|
-
|
|
178
|
+
color = "primary",
|
|
179
|
+
size = "medium",
|
|
180
|
+
startIcon,
|
|
181
|
+
endIcon,
|
|
182
|
+
onClick,
|
|
183
|
+
className,
|
|
184
|
+
...restProps
|
|
185
|
+
}, ref) {
|
|
186
|
+
const colorClasses = {
|
|
187
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
188
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
189
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
190
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
191
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
192
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
193
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
194
|
+
}[color];
|
|
195
|
+
const iconColorClasses = {
|
|
196
|
+
primary: "text-button-solid-primary-icon",
|
|
197
|
+
secondary: "text-button-solid-secondary-icon",
|
|
198
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
199
|
+
positive: "text-button-solid-positive-icon",
|
|
200
|
+
warning: "text-button-solid-warning-icon",
|
|
201
|
+
negative: "text-button-solid-negative-icon",
|
|
202
|
+
neutral: "text-button-solid-neutral-icon"
|
|
203
|
+
}[color];
|
|
170
204
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
171
|
-
"
|
|
205
|
+
"button",
|
|
172
206
|
{
|
|
207
|
+
ref,
|
|
208
|
+
onClick,
|
|
209
|
+
disabled,
|
|
173
210
|
className: (0, import_clsx2.default)(
|
|
174
|
-
"
|
|
211
|
+
"font-semibold",
|
|
175
212
|
{
|
|
176
|
-
|
|
177
|
-
[
|
|
178
|
-
[disabledClassName]: disabled
|
|
213
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
214
|
+
[(0, import_clsx2.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
179
215
|
},
|
|
216
|
+
ButtonUtil.paddingMapping[size],
|
|
180
217
|
className
|
|
181
218
|
),
|
|
182
|
-
|
|
219
|
+
...restProps,
|
|
183
220
|
children: [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
221
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
222
|
+
"span",
|
|
223
|
+
{
|
|
224
|
+
className: (0, import_clsx2.default)({
|
|
225
|
+
[iconColorClasses]: !disabled,
|
|
226
|
+
[`text-disabled-icon`]: disabled
|
|
227
|
+
}),
|
|
228
|
+
children: startIcon
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
children,
|
|
232
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
233
|
+
"span",
|
|
234
|
+
{
|
|
235
|
+
className: (0, import_clsx2.default)({
|
|
236
|
+
[iconColorClasses]: !disabled,
|
|
237
|
+
[`text-disabled-icon`]: disabled
|
|
238
|
+
}),
|
|
239
|
+
children: endIcon
|
|
240
|
+
}
|
|
241
|
+
)
|
|
190
242
|
]
|
|
191
243
|
}
|
|
192
244
|
);
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
// src/components/layout-and-navigation/Expandable.tsx
|
|
196
|
-
var import_react3 = require("react");
|
|
197
|
-
var import_lucide_react2 = require("lucide-react");
|
|
198
|
-
var import_clsx3 = __toESM(require("clsx"));
|
|
199
|
-
|
|
200
|
-
// src/util/noop.ts
|
|
201
|
-
var noop = () => void 0;
|
|
202
|
-
|
|
203
|
-
// src/components/layout-and-navigation/Expandable.tsx
|
|
204
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
205
|
-
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
206
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
207
|
-
import_lucide_react2.ChevronDown,
|
|
208
|
-
{
|
|
209
|
-
className: (0, import_clsx3.default)(
|
|
210
|
-
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
211
|
-
{ "rotate-180": isExpanded },
|
|
212
|
-
className
|
|
213
|
-
)
|
|
214
|
-
}
|
|
215
|
-
);
|
|
216
|
-
};
|
|
217
|
-
var Expandable = (0, import_react3.forwardRef)(function Expandable2({
|
|
245
|
+
});
|
|
246
|
+
var TextButton = ({
|
|
218
247
|
children,
|
|
219
|
-
label,
|
|
220
|
-
icon,
|
|
221
|
-
isExpanded = false,
|
|
222
|
-
onChange = noop,
|
|
223
|
-
clickOnlyOnHeader = true,
|
|
224
248
|
disabled = false,
|
|
249
|
+
color = "neutral",
|
|
250
|
+
size = "medium",
|
|
251
|
+
startIcon,
|
|
252
|
+
endIcon,
|
|
253
|
+
onClick,
|
|
254
|
+
coloredHoverBackground = true,
|
|
225
255
|
className,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
256
|
+
...restProps
|
|
257
|
+
}) => {
|
|
258
|
+
const colorClasses = {
|
|
259
|
+
primary: "bg-transparent text-button-text-primary-text",
|
|
260
|
+
negative: "bg-transparent text-button-text-negative-text",
|
|
261
|
+
neutral: "bg-transparent text-button-text-neutral-text"
|
|
262
|
+
}[color];
|
|
263
|
+
const backgroundColor = {
|
|
264
|
+
primary: "hover:bg-button-text-primary-text/20",
|
|
265
|
+
negative: "hover:bg-button-text-negative-text/20",
|
|
266
|
+
neutral: "hover:bg-button-text-neutral-text/20"
|
|
267
|
+
}[color];
|
|
268
|
+
const iconColorClasses = {
|
|
269
|
+
primary: "text-button-text-primary-icon",
|
|
270
|
+
negative: "text-button-text-negative-icon",
|
|
271
|
+
neutral: "text-button-text-neutral-icon"
|
|
272
|
+
}[color];
|
|
273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
274
|
+
"button",
|
|
234
275
|
{
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
276
|
+
onClick,
|
|
277
|
+
disabled,
|
|
278
|
+
className: (0, import_clsx2.default)(
|
|
279
|
+
"font-semibold",
|
|
280
|
+
{
|
|
281
|
+
"text-disabled-text cursor-not-allowed": disabled,
|
|
282
|
+
[colorClasses]: !disabled,
|
|
283
|
+
[backgroundColor]: !disabled && coloredHoverBackground,
|
|
284
|
+
"hover:bg-button-text-hover-background": !disabled && !coloredHoverBackground
|
|
285
|
+
},
|
|
286
|
+
ButtonUtil.paddingMapping[size],
|
|
287
|
+
className
|
|
288
|
+
),
|
|
289
|
+
...restProps,
|
|
238
290
|
children: [
|
|
239
|
-
/* @__PURE__ */ (0,
|
|
240
|
-
"
|
|
291
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
292
|
+
"span",
|
|
241
293
|
{
|
|
242
|
-
className: (0,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
248
|
-
},
|
|
249
|
-
headerClassName
|
|
250
|
-
),
|
|
251
|
-
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
252
|
-
children: [
|
|
253
|
-
label,
|
|
254
|
-
icon(isExpanded)
|
|
255
|
-
]
|
|
294
|
+
className: (0, import_clsx2.default)({
|
|
295
|
+
[iconColorClasses]: !disabled,
|
|
296
|
+
[`text-disabled-icon`]: disabled
|
|
297
|
+
}),
|
|
298
|
+
children: startIcon
|
|
256
299
|
}
|
|
257
300
|
),
|
|
258
|
-
|
|
259
|
-
|
|
301
|
+
children,
|
|
302
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
303
|
+
"span",
|
|
260
304
|
{
|
|
261
|
-
className: (0,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
},
|
|
267
|
-
contentClassName
|
|
268
|
-
),
|
|
269
|
-
children
|
|
305
|
+
className: (0, import_clsx2.default)({
|
|
306
|
+
[iconColorClasses]: !disabled,
|
|
307
|
+
[`text-disabled-icon`]: disabled
|
|
308
|
+
}),
|
|
309
|
+
children: endIcon
|
|
270
310
|
}
|
|
271
311
|
)
|
|
272
312
|
]
|
|
273
313
|
}
|
|
274
314
|
);
|
|
275
|
-
}
|
|
276
|
-
var
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
315
|
+
};
|
|
316
|
+
var IconButton = ({
|
|
317
|
+
children,
|
|
318
|
+
disabled = false,
|
|
319
|
+
color = "primary",
|
|
320
|
+
size = "medium",
|
|
321
|
+
className,
|
|
322
|
+
...restProps
|
|
323
|
+
}) => {
|
|
324
|
+
const colorClasses = {
|
|
325
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
326
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
327
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
328
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
329
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
330
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
331
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
332
|
+
transparent: "bg-transparent"
|
|
333
|
+
}[color];
|
|
334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
335
|
+
"button",
|
|
336
|
+
{
|
|
337
|
+
disabled,
|
|
338
|
+
className: (0, import_clsx2.default)(
|
|
339
|
+
{
|
|
340
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
341
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
342
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
343
|
+
[(0, import_clsx2.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
344
|
+
},
|
|
345
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
346
|
+
className
|
|
347
|
+
),
|
|
348
|
+
...restProps,
|
|
349
|
+
children
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
// src/components/layout-and-navigation/Chip.tsx
|
|
355
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
356
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
357
|
+
var Chip = ({
|
|
358
|
+
children,
|
|
359
|
+
trailingIcon,
|
|
360
|
+
color = "default",
|
|
361
|
+
variant = "normal",
|
|
362
|
+
className = "",
|
|
363
|
+
...restProps
|
|
364
|
+
}) => {
|
|
365
|
+
const colorMapping = {
|
|
366
|
+
default: "text-tag-default-text bg-tag-default-background",
|
|
367
|
+
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
368
|
+
red: "text-tag-red-text bg-tag-red-background",
|
|
369
|
+
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
370
|
+
green: "text-tag-green-text bg-tag-green-background",
|
|
371
|
+
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
372
|
+
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
373
|
+
}[color];
|
|
374
|
+
const colorMappingIcon = {
|
|
375
|
+
default: "text-tag-default-icon",
|
|
376
|
+
dark: "text-tag-dark-icon",
|
|
377
|
+
red: "text-tag-red-icon",
|
|
378
|
+
yellow: "text-tag-yellow-icon",
|
|
379
|
+
green: "text-tag-green-icon",
|
|
380
|
+
blue: "text-tag-blue-icon",
|
|
381
|
+
pink: "text-tag-pink-icon"
|
|
382
|
+
}[color];
|
|
383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
384
|
+
"div",
|
|
385
|
+
{
|
|
386
|
+
...restProps,
|
|
387
|
+
className: (0, import_clsx3.default)(
|
|
388
|
+
`row w-fit px-2 py-1 font-semibold`,
|
|
389
|
+
colorMapping,
|
|
390
|
+
{
|
|
391
|
+
"rounded-md": variant === "normal",
|
|
392
|
+
"rounded-full": variant === "fullyRounded"
|
|
393
|
+
},
|
|
394
|
+
className
|
|
395
|
+
),
|
|
396
|
+
children: [
|
|
397
|
+
children,
|
|
398
|
+
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
};
|
|
403
|
+
var ChipList = ({
|
|
404
|
+
list,
|
|
405
|
+
className = ""
|
|
406
|
+
}) => {
|
|
407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_clsx3.default)("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
408
|
+
Chip,
|
|
287
409
|
{
|
|
288
|
-
...
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
410
|
+
...value,
|
|
411
|
+
color: value.color ?? "default",
|
|
412
|
+
variant: value.variant ?? "normal",
|
|
413
|
+
children: value.children
|
|
414
|
+
},
|
|
415
|
+
index
|
|
416
|
+
)) });
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
// src/localization/defaults/form.ts
|
|
420
|
+
var formTranslation = {
|
|
421
|
+
en: {
|
|
422
|
+
add: "Add",
|
|
423
|
+
all: "All",
|
|
424
|
+
apply: "Apply",
|
|
425
|
+
back: "Back",
|
|
426
|
+
cancel: "Cancel",
|
|
427
|
+
change: "Change",
|
|
428
|
+
clear: "Clear",
|
|
429
|
+
click: "Click",
|
|
430
|
+
clickToCopy: "Click to Copy",
|
|
431
|
+
close: "Close",
|
|
432
|
+
confirm: "Confirm",
|
|
433
|
+
copy: "Copy",
|
|
434
|
+
copied: "Copied",
|
|
435
|
+
create: "Create",
|
|
436
|
+
decline: "Decline",
|
|
437
|
+
delete: "Delete",
|
|
438
|
+
discard: "Discard",
|
|
439
|
+
discardChanges: "Discard Changes",
|
|
440
|
+
done: "Done",
|
|
441
|
+
edit: "Edit",
|
|
442
|
+
enterText: "Enter text here",
|
|
443
|
+
error: "Error",
|
|
444
|
+
exit: "Exit",
|
|
445
|
+
fieldRequiredError: "This field is required.",
|
|
446
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
447
|
+
less: "Less",
|
|
448
|
+
loading: "Loading",
|
|
449
|
+
maxLengthError: "Maximum length exceeded.",
|
|
450
|
+
minLengthError: "Minimum length not met.",
|
|
451
|
+
more: "More",
|
|
452
|
+
next: "Next",
|
|
453
|
+
no: "No",
|
|
454
|
+
none: "None",
|
|
455
|
+
of: "of",
|
|
456
|
+
optional: "Optional",
|
|
457
|
+
pleaseWait: "Please wait...",
|
|
458
|
+
previous: "Previous",
|
|
459
|
+
remove: "Remove",
|
|
460
|
+
required: "Required",
|
|
461
|
+
reset: "Reset",
|
|
462
|
+
save: "Save",
|
|
463
|
+
saved: "Saved",
|
|
464
|
+
search: "Search",
|
|
465
|
+
select: "Select",
|
|
466
|
+
selectOption: "Select an option",
|
|
467
|
+
show: "Show",
|
|
468
|
+
showMore: "Show more",
|
|
469
|
+
showLess: "Show less",
|
|
470
|
+
submit: "Submit",
|
|
471
|
+
success: "Success",
|
|
472
|
+
update: "Update",
|
|
473
|
+
unsavedChanges: "Unsaved Changes",
|
|
474
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
475
|
+
yes: "Yes"
|
|
476
|
+
},
|
|
477
|
+
de: {
|
|
478
|
+
add: "Hinzuf\xFCgen",
|
|
479
|
+
all: "Alle",
|
|
480
|
+
apply: "Anwenden",
|
|
481
|
+
back: "Zur\xFCck",
|
|
482
|
+
cancel: "Abbrechen",
|
|
483
|
+
change: "\xC4ndern",
|
|
484
|
+
clear: "L\xF6schen",
|
|
485
|
+
click: "Klicken",
|
|
486
|
+
clickToCopy: "Zum kopieren klicken",
|
|
487
|
+
close: "Schlie\xDFen",
|
|
488
|
+
confirm: "Best\xE4tigen",
|
|
489
|
+
copy: "Kopieren",
|
|
490
|
+
copied: "Kopiert",
|
|
491
|
+
create: "Erstellen",
|
|
492
|
+
decline: "Ablehnen",
|
|
493
|
+
delete: "L\xF6schen",
|
|
494
|
+
discard: "Verwerfen",
|
|
495
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
496
|
+
done: "Fertig",
|
|
497
|
+
edit: "Bearbeiten",
|
|
498
|
+
enterText: "Text hier eingeben",
|
|
499
|
+
error: "Fehler",
|
|
500
|
+
exit: "Beenden",
|
|
501
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
502
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
503
|
+
less: "Weniger",
|
|
504
|
+
loading: "L\xE4dt",
|
|
505
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
506
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
507
|
+
more: "Mehr",
|
|
508
|
+
next: "Weiter",
|
|
509
|
+
no: "Nein",
|
|
510
|
+
none: "Nichts",
|
|
511
|
+
of: "von",
|
|
512
|
+
optional: "Optional",
|
|
513
|
+
pleaseWait: "Bitte warten...",
|
|
514
|
+
previous: "Vorherige",
|
|
515
|
+
remove: "Entfernen",
|
|
516
|
+
required: "Erforderlich",
|
|
517
|
+
reset: "Zur\xFCcksetzen",
|
|
518
|
+
save: "Speichern",
|
|
519
|
+
saved: "Gespeichert",
|
|
520
|
+
search: "Suche",
|
|
521
|
+
select: "Select",
|
|
522
|
+
selectOption: "Option ausw\xE4hlen",
|
|
523
|
+
show: "Anzeigen",
|
|
524
|
+
showMore: "Mehr anzeigen",
|
|
525
|
+
showLess: "Weniger anzeigen",
|
|
526
|
+
submit: "Abschicken",
|
|
527
|
+
success: "Erfolg",
|
|
528
|
+
update: "Update",
|
|
529
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
530
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
531
|
+
yes: "Ja"
|
|
532
|
+
}
|
|
533
|
+
};
|
|
298
534
|
|
|
299
535
|
// src/components/user-action/Menu.tsx
|
|
300
536
|
var import_react6 = require("react");
|
|
@@ -495,7 +731,7 @@ var Menu = ({
|
|
|
495
731
|
ref: menuRef,
|
|
496
732
|
onClick: (e) => e.stopPropagation(),
|
|
497
733
|
className: (0, import_clsx4.default)(
|
|
498
|
-
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-[300]",
|
|
734
|
+
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg shadow-strong z-[300]",
|
|
499
735
|
{
|
|
500
736
|
"animate-pop-in": isOpen,
|
|
501
737
|
"animate-pop-out": !isOpen,
|
|
@@ -513,22 +749,126 @@ var Menu = ({
|
|
|
513
749
|
},
|
|
514
750
|
children: BagFunctionUtil.resolve(children, bag)
|
|
515
751
|
}
|
|
516
|
-
), document.body)
|
|
517
|
-
] });
|
|
518
|
-
};
|
|
752
|
+
), document.body)
|
|
753
|
+
] });
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
757
|
+
var import_react7 = require("react");
|
|
758
|
+
var import_lucide_react = require("lucide-react");
|
|
759
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
760
|
+
|
|
761
|
+
// src/util/noop.ts
|
|
762
|
+
var noop = () => void 0;
|
|
763
|
+
|
|
764
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
765
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
766
|
+
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
768
|
+
import_lucide_react.ChevronDown,
|
|
769
|
+
{
|
|
770
|
+
className: (0, import_clsx5.default)(
|
|
771
|
+
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
772
|
+
{ "rotate-180": isExpanded },
|
|
773
|
+
className
|
|
774
|
+
)
|
|
775
|
+
}
|
|
776
|
+
);
|
|
777
|
+
};
|
|
778
|
+
var Expandable = (0, import_react7.forwardRef)(function Expandable2({
|
|
779
|
+
children,
|
|
780
|
+
label,
|
|
781
|
+
icon,
|
|
782
|
+
isExpanded = false,
|
|
783
|
+
onChange = noop,
|
|
784
|
+
clickOnlyOnHeader = true,
|
|
785
|
+
disabled = false,
|
|
786
|
+
className,
|
|
787
|
+
headerClassName,
|
|
788
|
+
contentClassName,
|
|
789
|
+
contentExpandedClassName
|
|
790
|
+
}, ref) {
|
|
791
|
+
const defaultIcon = (0, import_react7.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
792
|
+
icon ??= defaultIcon;
|
|
793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
794
|
+
"div",
|
|
795
|
+
{
|
|
796
|
+
ref,
|
|
797
|
+
className: (0, import_clsx5.default)("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
798
|
+
onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
799
|
+
children: [
|
|
800
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
801
|
+
"div",
|
|
802
|
+
{
|
|
803
|
+
className: (0, import_clsx5.default)(
|
|
804
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
805
|
+
{
|
|
806
|
+
"group-hover:brightness-97": !isExpanded,
|
|
807
|
+
"hover:brightness-97": isExpanded && !disabled,
|
|
808
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
809
|
+
},
|
|
810
|
+
headerClassName
|
|
811
|
+
),
|
|
812
|
+
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
813
|
+
children: [
|
|
814
|
+
label,
|
|
815
|
+
icon(isExpanded)
|
|
816
|
+
]
|
|
817
|
+
}
|
|
818
|
+
),
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
820
|
+
"div",
|
|
821
|
+
{
|
|
822
|
+
className: (0, import_clsx5.default)(
|
|
823
|
+
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
824
|
+
{
|
|
825
|
+
[(0, import_clsx5.default)("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
826
|
+
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
827
|
+
},
|
|
828
|
+
contentClassName
|
|
829
|
+
),
|
|
830
|
+
children
|
|
831
|
+
}
|
|
832
|
+
)
|
|
833
|
+
]
|
|
834
|
+
}
|
|
835
|
+
);
|
|
836
|
+
});
|
|
837
|
+
var ExpandableUncontrolled = (0, import_react7.forwardRef)(function ExpandableUncontrolled2({
|
|
838
|
+
isExpanded,
|
|
839
|
+
onChange = noop,
|
|
840
|
+
...props
|
|
841
|
+
}, ref) {
|
|
842
|
+
const [usedIsExpanded, setUsedIsExpanded] = (0, import_react7.useState)(isExpanded);
|
|
843
|
+
(0, import_react7.useEffect)(() => {
|
|
844
|
+
setUsedIsExpanded(isExpanded);
|
|
845
|
+
}, [isExpanded]);
|
|
846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
847
|
+
Expandable,
|
|
848
|
+
{
|
|
849
|
+
...props,
|
|
850
|
+
ref,
|
|
851
|
+
isExpanded: usedIsExpanded,
|
|
852
|
+
onChange: (value) => {
|
|
853
|
+
onChange(value);
|
|
854
|
+
setUsedIsExpanded(value);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
);
|
|
858
|
+
});
|
|
519
859
|
|
|
520
860
|
// src/components/user-action/Input.tsx
|
|
521
|
-
var
|
|
522
|
-
var
|
|
861
|
+
var import_react11 = require("react");
|
|
862
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
523
863
|
|
|
524
864
|
// src/hooks/useDelay.ts
|
|
525
|
-
var
|
|
865
|
+
var import_react8 = require("react");
|
|
526
866
|
var defaultOptions = {
|
|
527
867
|
delay: 3e3,
|
|
528
868
|
disabled: false
|
|
529
869
|
};
|
|
530
870
|
function useDelay(options) {
|
|
531
|
-
const [timer, setTimer] = (0,
|
|
871
|
+
const [timer, setTimer] = (0, import_react8.useState)(void 0);
|
|
532
872
|
const { delay, disabled } = {
|
|
533
873
|
...defaultOptions,
|
|
534
874
|
...options
|
|
@@ -547,12 +887,12 @@ function useDelay(options) {
|
|
|
547
887
|
setTimer(void 0);
|
|
548
888
|
}, delay));
|
|
549
889
|
};
|
|
550
|
-
(0,
|
|
890
|
+
(0, import_react8.useEffect)(() => {
|
|
551
891
|
return () => {
|
|
552
892
|
clearTimeout(timer);
|
|
553
893
|
};
|
|
554
894
|
}, [timer]);
|
|
555
|
-
(0,
|
|
895
|
+
(0, import_react8.useEffect)(() => {
|
|
556
896
|
if (disabled) {
|
|
557
897
|
clearTimeout(timer);
|
|
558
898
|
setTimer(void 0);
|
|
@@ -562,9 +902,9 @@ function useDelay(options) {
|
|
|
562
902
|
}
|
|
563
903
|
|
|
564
904
|
// src/hooks/useFocusManagement.ts
|
|
565
|
-
var
|
|
905
|
+
var import_react9 = require("react");
|
|
566
906
|
function useFocusManagement() {
|
|
567
|
-
const getFocusableElements = (0,
|
|
907
|
+
const getFocusableElements = (0, import_react9.useCallback)(() => {
|
|
568
908
|
return Array.from(
|
|
569
909
|
document.querySelectorAll(
|
|
570
910
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -573,7 +913,7 @@ function useFocusManagement() {
|
|
|
573
913
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
574
914
|
);
|
|
575
915
|
}, []);
|
|
576
|
-
const getNextFocusElement = (0,
|
|
916
|
+
const getNextFocusElement = (0, import_react9.useCallback)(() => {
|
|
577
917
|
const elements = getFocusableElements();
|
|
578
918
|
if (elements.length === 0) {
|
|
579
919
|
return void 0;
|
|
@@ -585,11 +925,11 @@ function useFocusManagement() {
|
|
|
585
925
|
}
|
|
586
926
|
return nextElement;
|
|
587
927
|
}, [getFocusableElements]);
|
|
588
|
-
const focusNext = (0,
|
|
928
|
+
const focusNext = (0, import_react9.useCallback)(() => {
|
|
589
929
|
const nextElement = getNextFocusElement();
|
|
590
930
|
nextElement?.focus();
|
|
591
931
|
}, [getNextFocusElement]);
|
|
592
|
-
const getPreviousFocusElement = (0,
|
|
932
|
+
const getPreviousFocusElement = (0, import_react9.useCallback)(() => {
|
|
593
933
|
const elements = getFocusableElements();
|
|
594
934
|
if (elements.length === 0) {
|
|
595
935
|
return void 0;
|
|
@@ -605,7 +945,7 @@ function useFocusManagement() {
|
|
|
605
945
|
}
|
|
606
946
|
return previousElement;
|
|
607
947
|
}, [getFocusableElements]);
|
|
608
|
-
const focusPrevious = (0,
|
|
948
|
+
const focusPrevious = (0, import_react9.useCallback)(() => {
|
|
609
949
|
const previousElement = getPreviousFocusElement();
|
|
610
950
|
if (previousElement) previousElement.focus();
|
|
611
951
|
}, [getPreviousFocusElement]);
|
|
@@ -619,10 +959,10 @@ function useFocusManagement() {
|
|
|
619
959
|
}
|
|
620
960
|
|
|
621
961
|
// src/hooks/useFocusOnceVisible.ts
|
|
622
|
-
var
|
|
962
|
+
var import_react10 = __toESM(require("react"));
|
|
623
963
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
624
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
625
|
-
(0,
|
|
964
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react10.default.useState(false);
|
|
965
|
+
(0, import_react10.useEffect)(() => {
|
|
626
966
|
if (disable || hasUsedFocus) {
|
|
627
967
|
return;
|
|
628
968
|
}
|
|
@@ -642,12 +982,12 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
642
982
|
};
|
|
643
983
|
|
|
644
984
|
// src/components/user-action/Input.tsx
|
|
645
|
-
var
|
|
985
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
646
986
|
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
647
|
-
return (0,
|
|
987
|
+
return (0, import_clsx6.default)(
|
|
648
988
|
"px-2 py-1.5 rounded-md border-2",
|
|
649
989
|
{
|
|
650
|
-
"bg-
|
|
990
|
+
"bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
651
991
|
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
652
992
|
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
653
993
|
}
|
|
@@ -658,7 +998,7 @@ var defaultEditCompleteOptions = {
|
|
|
658
998
|
afterDelay: true,
|
|
659
999
|
delay: 2500
|
|
660
1000
|
};
|
|
661
|
-
var Input = (0,
|
|
1001
|
+
var Input = (0, import_react11.forwardRef)(function Input2({
|
|
662
1002
|
id,
|
|
663
1003
|
type = "text",
|
|
664
1004
|
value,
|
|
@@ -681,10 +1021,10 @@ var Input = (0, import_react10.forwardRef)(function Input2({
|
|
|
681
1021
|
restartTimer,
|
|
682
1022
|
clearTimer
|
|
683
1023
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
684
|
-
const innerRef = (0,
|
|
1024
|
+
const innerRef = (0, import_react11.useRef)(null);
|
|
685
1025
|
const { focusNext } = useFocusManagement();
|
|
686
1026
|
useFocusOnceVisible(innerRef, !autoFocus);
|
|
687
|
-
(0,
|
|
1027
|
+
(0, import_react11.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
688
1028
|
const handleKeyDown = (e) => {
|
|
689
1029
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
690
1030
|
e.preventDefault();
|
|
@@ -692,9 +1032,9 @@ var Input = (0, import_react10.forwardRef)(function Input2({
|
|
|
692
1032
|
focusNext();
|
|
693
1033
|
}
|
|
694
1034
|
};
|
|
695
|
-
return /* @__PURE__ */ (0,
|
|
696
|
-
label && /* @__PURE__ */ (0,
|
|
697
|
-
/* @__PURE__ */ (0,
|
|
1035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx6.default)({ "w-full": expanded }, containerClassName), children: [
|
|
1036
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx6.default)("mb-1", label.className) }),
|
|
1037
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
698
1038
|
"input",
|
|
699
1039
|
{
|
|
700
1040
|
...restProps,
|
|
@@ -703,7 +1043,7 @@ var Input = (0, import_react10.forwardRef)(function Input2({
|
|
|
703
1043
|
id,
|
|
704
1044
|
type,
|
|
705
1045
|
disabled,
|
|
706
|
-
className: (0,
|
|
1046
|
+
className: (0, import_clsx6.default)(getInputClassName({ disabled }), className),
|
|
707
1047
|
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
708
1048
|
onBlur: (event) => {
|
|
709
1049
|
onBlur?.(event);
|
|
@@ -722,366 +1062,54 @@ var Input = (0, import_react10.forwardRef)(function Input2({
|
|
|
722
1062
|
onEditCompleted(value2);
|
|
723
1063
|
}
|
|
724
1064
|
} else {
|
|
725
|
-
onEditCompleted(value2);
|
|
726
|
-
}
|
|
727
|
-
});
|
|
728
|
-
}
|
|
729
|
-
onChange(e);
|
|
730
|
-
onChangeText(value2);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
)
|
|
734
|
-
] });
|
|
735
|
-
});
|
|
736
|
-
var FormInput = (0, import_react10.forwardRef)(function FormInput2({
|
|
737
|
-
id,
|
|
738
|
-
labelText,
|
|
739
|
-
errorText,
|
|
740
|
-
className,
|
|
741
|
-
labelClassName,
|
|
742
|
-
errorClassName,
|
|
743
|
-
containerClassName,
|
|
744
|
-
required,
|
|
745
|
-
disabled,
|
|
746
|
-
...restProps
|
|
747
|
-
}, ref) {
|
|
748
|
-
const input = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
749
|
-
"input",
|
|
750
|
-
{
|
|
751
|
-
...restProps,
|
|
752
|
-
ref,
|
|
753
|
-
id,
|
|
754
|
-
disabled,
|
|
755
|
-
className: (0, import_clsx5.default)(
|
|
756
|
-
getInputClassName({ disabled, hasError: !!errorText }),
|
|
757
|
-
className
|
|
758
|
-
)
|
|
759
|
-
}
|
|
760
|
-
);
|
|
761
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
762
|
-
labelText && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor: id, className: (0, import_clsx5.default)("textstyle-label-md", labelClassName), children: [
|
|
763
|
-
labelText,
|
|
764
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
765
|
-
] }),
|
|
766
|
-
input,
|
|
767
|
-
errorText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: id, className: (0, import_clsx5.default)("text-negative", errorClassName), children: errorText })
|
|
768
|
-
] });
|
|
769
|
-
});
|
|
770
|
-
|
|
771
|
-
// src/localization/defaults/form.ts
|
|
772
|
-
var formTranslation = {
|
|
773
|
-
en: {
|
|
774
|
-
add: "Add",
|
|
775
|
-
all: "All",
|
|
776
|
-
apply: "Apply",
|
|
777
|
-
back: "Back",
|
|
778
|
-
cancel: "Cancel",
|
|
779
|
-
change: "Change",
|
|
780
|
-
clear: "Clear",
|
|
781
|
-
click: "Click",
|
|
782
|
-
clickToCopy: "Click to Copy",
|
|
783
|
-
close: "Close",
|
|
784
|
-
confirm: "Confirm",
|
|
785
|
-
copy: "Copy",
|
|
786
|
-
copied: "Copied",
|
|
787
|
-
create: "Create",
|
|
788
|
-
decline: "Decline",
|
|
789
|
-
delete: "Delete",
|
|
790
|
-
discard: "Discard",
|
|
791
|
-
discardChanges: "Discard Changes",
|
|
792
|
-
done: "Done",
|
|
793
|
-
edit: "Edit",
|
|
794
|
-
enterText: "Enter text here",
|
|
795
|
-
error: "Error",
|
|
796
|
-
exit: "Exit",
|
|
797
|
-
fieldRequiredError: "This field is required.",
|
|
798
|
-
invalidEmailError: "Please enter a valid email address.",
|
|
799
|
-
less: "Less",
|
|
800
|
-
loading: "Loading",
|
|
801
|
-
maxLengthError: "Maximum length exceeded.",
|
|
802
|
-
minLengthError: "Minimum length not met.",
|
|
803
|
-
more: "More",
|
|
804
|
-
next: "Next",
|
|
805
|
-
no: "No",
|
|
806
|
-
none: "None",
|
|
807
|
-
of: "of",
|
|
808
|
-
optional: "Optional",
|
|
809
|
-
pleaseWait: "Please wait...",
|
|
810
|
-
previous: "Previous",
|
|
811
|
-
remove: "Remove",
|
|
812
|
-
required: "Required",
|
|
813
|
-
reset: "Reset",
|
|
814
|
-
save: "Save",
|
|
815
|
-
saved: "Saved",
|
|
816
|
-
search: "Search",
|
|
817
|
-
select: "Select",
|
|
818
|
-
selectOption: "Select an option",
|
|
819
|
-
show: "Show",
|
|
820
|
-
showMore: "Show more",
|
|
821
|
-
showLess: "Show less",
|
|
822
|
-
submit: "Submit",
|
|
823
|
-
success: "Success",
|
|
824
|
-
update: "Update",
|
|
825
|
-
unsavedChanges: "Unsaved Changes",
|
|
826
|
-
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
827
|
-
yes: "Yes"
|
|
828
|
-
},
|
|
829
|
-
de: {
|
|
830
|
-
add: "Hinzuf\xFCgen",
|
|
831
|
-
all: "Alle",
|
|
832
|
-
apply: "Anwenden",
|
|
833
|
-
back: "Zur\xFCck",
|
|
834
|
-
cancel: "Abbrechen",
|
|
835
|
-
change: "\xC4ndern",
|
|
836
|
-
clear: "L\xF6schen",
|
|
837
|
-
click: "Klicken",
|
|
838
|
-
clickToCopy: "Zum kopieren klicken",
|
|
839
|
-
close: "Schlie\xDFen",
|
|
840
|
-
confirm: "Best\xE4tigen",
|
|
841
|
-
copy: "Kopieren",
|
|
842
|
-
copied: "Kopiert",
|
|
843
|
-
create: "Erstellen",
|
|
844
|
-
decline: "Ablehnen",
|
|
845
|
-
delete: "L\xF6schen",
|
|
846
|
-
discard: "Verwerfen",
|
|
847
|
-
discardChanges: "\xC4nderungen Verwerfen",
|
|
848
|
-
done: "Fertig",
|
|
849
|
-
edit: "Bearbeiten",
|
|
850
|
-
enterText: "Text hier eingeben",
|
|
851
|
-
error: "Fehler",
|
|
852
|
-
exit: "Beenden",
|
|
853
|
-
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
854
|
-
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
855
|
-
less: "Weniger",
|
|
856
|
-
loading: "L\xE4dt",
|
|
857
|
-
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
858
|
-
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
859
|
-
more: "Mehr",
|
|
860
|
-
next: "Weiter",
|
|
861
|
-
no: "Nein",
|
|
862
|
-
none: "Nichts",
|
|
863
|
-
of: "von",
|
|
864
|
-
optional: "Optional",
|
|
865
|
-
pleaseWait: "Bitte warten...",
|
|
866
|
-
previous: "Vorherige",
|
|
867
|
-
remove: "Entfernen",
|
|
868
|
-
required: "Erforderlich",
|
|
869
|
-
reset: "Zur\xFCcksetzen",
|
|
870
|
-
save: "Speichern",
|
|
871
|
-
saved: "Gespeichert",
|
|
872
|
-
search: "Suche",
|
|
873
|
-
select: "Select",
|
|
874
|
-
selectOption: "Option ausw\xE4hlen",
|
|
875
|
-
show: "Anzeigen",
|
|
876
|
-
showMore: "Mehr anzeigen",
|
|
877
|
-
showLess: "Weniger anzeigen",
|
|
878
|
-
submit: "Abschicken",
|
|
879
|
-
success: "Erfolg",
|
|
880
|
-
update: "Update",
|
|
881
|
-
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
882
|
-
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
883
|
-
yes: "Ja"
|
|
884
|
-
}
|
|
885
|
-
};
|
|
886
|
-
|
|
887
|
-
// src/components/user-action/Button.tsx
|
|
888
|
-
var import_react11 = require("react");
|
|
889
|
-
var import_clsx6 = __toESM(require("clsx"));
|
|
890
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
891
|
-
var ButtonColorUtil = {
|
|
892
|
-
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
893
|
-
text: ["primary", "negative", "neutral"],
|
|
894
|
-
outline: ["primary"]
|
|
895
|
-
};
|
|
896
|
-
var IconButtonUtil = {
|
|
897
|
-
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
898
|
-
};
|
|
899
|
-
var paddingMapping = {
|
|
900
|
-
small: "btn-sm",
|
|
901
|
-
medium: "btn-md",
|
|
902
|
-
large: "btn-lg"
|
|
903
|
-
};
|
|
904
|
-
var iconPaddingMapping = {
|
|
905
|
-
tiny: "icon-btn-xs",
|
|
906
|
-
small: "icon-btn-sm",
|
|
907
|
-
medium: "icon-btn-md",
|
|
908
|
-
large: "icon-btn-lg"
|
|
909
|
-
};
|
|
910
|
-
var ButtonUtil = {
|
|
911
|
-
paddingMapping,
|
|
912
|
-
iconPaddingMapping
|
|
913
|
-
};
|
|
914
|
-
var SolidButton = (0, import_react11.forwardRef)(function SolidButton2({
|
|
915
|
-
children,
|
|
916
|
-
disabled = false,
|
|
917
|
-
color = "primary",
|
|
918
|
-
size = "medium",
|
|
919
|
-
startIcon,
|
|
920
|
-
endIcon,
|
|
921
|
-
onClick,
|
|
922
|
-
className,
|
|
923
|
-
...restProps
|
|
924
|
-
}, ref) {
|
|
925
|
-
const colorClasses = {
|
|
926
|
-
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
927
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
928
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
929
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
930
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
931
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
932
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
933
|
-
}[color];
|
|
934
|
-
const iconColorClasses = {
|
|
935
|
-
primary: "text-button-solid-primary-icon",
|
|
936
|
-
secondary: "text-button-solid-secondary-icon",
|
|
937
|
-
tertiary: "text-button-solid-tertiary-icon",
|
|
938
|
-
positive: "text-button-solid-positive-icon",
|
|
939
|
-
warning: "text-button-solid-warning-icon",
|
|
940
|
-
negative: "text-button-solid-negative-icon",
|
|
941
|
-
neutral: "text-button-solid-neutral-icon"
|
|
942
|
-
}[color];
|
|
943
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
944
|
-
"button",
|
|
945
|
-
{
|
|
946
|
-
ref,
|
|
947
|
-
onClick,
|
|
948
|
-
disabled,
|
|
949
|
-
className: (0, import_clsx6.default)(
|
|
950
|
-
{
|
|
951
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
952
|
-
[(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
953
|
-
},
|
|
954
|
-
ButtonUtil.paddingMapping[size],
|
|
955
|
-
className
|
|
956
|
-
),
|
|
957
|
-
...restProps,
|
|
958
|
-
children: [
|
|
959
|
-
startIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
960
|
-
"span",
|
|
961
|
-
{
|
|
962
|
-
className: (0, import_clsx6.default)({
|
|
963
|
-
[iconColorClasses]: !disabled,
|
|
964
|
-
[`text-disabled-icon`]: disabled
|
|
965
|
-
}),
|
|
966
|
-
children: startIcon
|
|
967
|
-
}
|
|
968
|
-
),
|
|
969
|
-
children,
|
|
970
|
-
endIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
971
|
-
"span",
|
|
972
|
-
{
|
|
973
|
-
className: (0, import_clsx6.default)({
|
|
974
|
-
[iconColorClasses]: !disabled,
|
|
975
|
-
[`text-disabled-icon`]: disabled
|
|
976
|
-
}),
|
|
977
|
-
children: endIcon
|
|
1065
|
+
onEditCompleted(value2);
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
978
1068
|
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
1069
|
+
onChange(e);
|
|
1070
|
+
onChangeText(value2);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
)
|
|
1074
|
+
] });
|
|
983
1075
|
});
|
|
984
|
-
var
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
size = "medium",
|
|
989
|
-
startIcon,
|
|
990
|
-
endIcon,
|
|
991
|
-
onClick,
|
|
1076
|
+
var FormInput = (0, import_react11.forwardRef)(function FormInput2({
|
|
1077
|
+
id,
|
|
1078
|
+
labelText,
|
|
1079
|
+
errorText,
|
|
992
1080
|
className,
|
|
1081
|
+
labelClassName,
|
|
1082
|
+
errorClassName,
|
|
1083
|
+
containerClassName,
|
|
1084
|
+
required,
|
|
1085
|
+
disabled,
|
|
993
1086
|
...restProps
|
|
994
|
-
})
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
negative: "bg-transparent text-button-text-negative-text",
|
|
998
|
-
neutral: "bg-transparent text-button-text-neutral-text"
|
|
999
|
-
}[color];
|
|
1000
|
-
const iconColorClasses = {
|
|
1001
|
-
primary: "text-button-text-primary-icon",
|
|
1002
|
-
negative: "text-button-text-negative-icon",
|
|
1003
|
-
neutral: "text-button-text-neutral-icon"
|
|
1004
|
-
}[color];
|
|
1005
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1006
|
-
"button",
|
|
1087
|
+
}, ref) {
|
|
1088
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1089
|
+
"input",
|
|
1007
1090
|
{
|
|
1008
|
-
onClick,
|
|
1009
|
-
disabled,
|
|
1010
|
-
className: (0, import_clsx6.default)(
|
|
1011
|
-
{
|
|
1012
|
-
"text-disabled-text cursor-not-allowed": disabled,
|
|
1013
|
-
[(0, import_clsx6.default)(colorClasses, "hover:bg-button-text-hover-background")]: !disabled
|
|
1014
|
-
},
|
|
1015
|
-
ButtonUtil.paddingMapping[size],
|
|
1016
|
-
className
|
|
1017
|
-
),
|
|
1018
1091
|
...restProps,
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
"span",
|
|
1022
|
-
{
|
|
1023
|
-
className: (0, import_clsx6.default)({
|
|
1024
|
-
[iconColorClasses]: !disabled,
|
|
1025
|
-
[`text-disabled-icon`]: disabled
|
|
1026
|
-
}),
|
|
1027
|
-
children: startIcon
|
|
1028
|
-
}
|
|
1029
|
-
),
|
|
1030
|
-
children,
|
|
1031
|
-
endIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1032
|
-
"span",
|
|
1033
|
-
{
|
|
1034
|
-
className: (0, import_clsx6.default)({
|
|
1035
|
-
[iconColorClasses]: !disabled,
|
|
1036
|
-
[`text-disabled-icon`]: disabled
|
|
1037
|
-
}),
|
|
1038
|
-
children: endIcon
|
|
1039
|
-
}
|
|
1040
|
-
)
|
|
1041
|
-
]
|
|
1042
|
-
}
|
|
1043
|
-
);
|
|
1044
|
-
};
|
|
1045
|
-
var IconButton = ({
|
|
1046
|
-
children,
|
|
1047
|
-
disabled = false,
|
|
1048
|
-
color = "primary",
|
|
1049
|
-
size = "medium",
|
|
1050
|
-
className,
|
|
1051
|
-
...restProps
|
|
1052
|
-
}) => {
|
|
1053
|
-
const colorClasses = {
|
|
1054
|
-
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
1055
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
1056
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
1057
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
1058
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
1059
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
1060
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
1061
|
-
transparent: "bg-transparent"
|
|
1062
|
-
}[color];
|
|
1063
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1064
|
-
"button",
|
|
1065
|
-
{
|
|
1092
|
+
ref,
|
|
1093
|
+
id,
|
|
1066
1094
|
disabled,
|
|
1067
1095
|
className: (0, import_clsx6.default)(
|
|
1068
|
-
{
|
|
1069
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
1070
|
-
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
1071
|
-
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
1072
|
-
[(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
1073
|
-
},
|
|
1074
|
-
ButtonUtil.iconPaddingMapping[size],
|
|
1096
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
1075
1097
|
className
|
|
1076
|
-
)
|
|
1077
|
-
...restProps,
|
|
1078
|
-
children
|
|
1098
|
+
)
|
|
1079
1099
|
}
|
|
1080
1100
|
);
|
|
1081
|
-
|
|
1101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx6.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
1102
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { htmlFor: id, className: (0, import_clsx6.default)("textstyle-label-md", labelClassName), children: [
|
|
1103
|
+
labelText,
|
|
1104
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
1105
|
+
] }),
|
|
1106
|
+
input,
|
|
1107
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: id, className: (0, import_clsx6.default)("text-negative", errorClassName), children: errorText })
|
|
1108
|
+
] });
|
|
1109
|
+
});
|
|
1082
1110
|
|
|
1083
1111
|
// src/components/user-action/SearchBar.tsx
|
|
1084
|
-
var
|
|
1112
|
+
var import_lucide_react2 = require("lucide-react");
|
|
1085
1113
|
var import_clsx7 = require("clsx");
|
|
1086
1114
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1087
1115
|
var SearchBar = ({
|
|
@@ -1100,7 +1128,7 @@ var SearchBar = ({
|
|
|
1100
1128
|
placeholder: placeholder ?? translation("search")
|
|
1101
1129
|
}
|
|
1102
1130
|
),
|
|
1103
|
-
onSearch && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1131
|
+
onSearch && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Search, { className: "w-full h-full" }) })
|
|
1104
1132
|
] });
|
|
1105
1133
|
};
|
|
1106
1134
|
|
|
@@ -1172,96 +1200,12 @@ var useSearch = ({
|
|
|
1172
1200
|
};
|
|
1173
1201
|
};
|
|
1174
1202
|
|
|
1175
|
-
// src/components/user-action/Select.tsx
|
|
1176
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1177
|
-
var SelectTile = ({
|
|
1178
|
-
className,
|
|
1179
|
-
disabledClassName,
|
|
1180
|
-
title,
|
|
1181
|
-
...restProps
|
|
1182
|
-
}) => {
|
|
1183
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1184
|
-
Tile,
|
|
1185
|
-
{
|
|
1186
|
-
...restProps,
|
|
1187
|
-
className: (0, import_clsx8.default)("px-2 py-1 rounded-md", className),
|
|
1188
|
-
disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
|
|
1189
|
-
title: { ...title, className: title.className ?? "font-semibold" }
|
|
1190
|
-
}
|
|
1191
|
-
);
|
|
1192
|
-
};
|
|
1193
|
-
|
|
1194
|
-
// src/components/layout-and-navigation/Chip.tsx
|
|
1195
|
-
var import_clsx9 = __toESM(require("clsx"));
|
|
1196
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1197
|
-
var Chip = ({
|
|
1198
|
-
children,
|
|
1199
|
-
trailingIcon,
|
|
1200
|
-
color = "default",
|
|
1201
|
-
variant = "normal",
|
|
1202
|
-
className = "",
|
|
1203
|
-
...restProps
|
|
1204
|
-
}) => {
|
|
1205
|
-
const colorMapping = {
|
|
1206
|
-
default: "text-tag-default-text bg-tag-default-background",
|
|
1207
|
-
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
1208
|
-
red: "text-tag-red-text bg-tag-red-background",
|
|
1209
|
-
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
1210
|
-
green: "text-tag-green-text bg-tag-green-background",
|
|
1211
|
-
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
1212
|
-
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
1213
|
-
}[color];
|
|
1214
|
-
const colorMappingIcon = {
|
|
1215
|
-
default: "text-tag-default-icon",
|
|
1216
|
-
dark: "text-tag-dark-icon",
|
|
1217
|
-
red: "text-tag-red-icon",
|
|
1218
|
-
yellow: "text-tag-yellow-icon",
|
|
1219
|
-
green: "text-tag-green-icon",
|
|
1220
|
-
blue: "text-tag-blue-icon",
|
|
1221
|
-
pink: "text-tag-pink-icon"
|
|
1222
|
-
}[color];
|
|
1223
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1224
|
-
"div",
|
|
1225
|
-
{
|
|
1226
|
-
...restProps,
|
|
1227
|
-
className: (0, import_clsx9.default)(
|
|
1228
|
-
`row w-fit px-2 py-1`,
|
|
1229
|
-
colorMapping,
|
|
1230
|
-
{
|
|
1231
|
-
"rounded-md": variant === "normal",
|
|
1232
|
-
"rounded-full": variant === "fullyRounded"
|
|
1233
|
-
},
|
|
1234
|
-
className
|
|
1235
|
-
),
|
|
1236
|
-
children: [
|
|
1237
|
-
children,
|
|
1238
|
-
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
|
|
1239
|
-
]
|
|
1240
|
-
}
|
|
1241
|
-
);
|
|
1242
|
-
};
|
|
1243
|
-
var ChipList = ({
|
|
1244
|
-
list,
|
|
1245
|
-
className = ""
|
|
1246
|
-
}) => {
|
|
1247
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: (0, import_clsx9.default)("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1248
|
-
Chip,
|
|
1249
|
-
{
|
|
1250
|
-
...value,
|
|
1251
|
-
color: value.color ?? "dark",
|
|
1252
|
-
variant: value.variant ?? "normal",
|
|
1253
|
-
children: value.children
|
|
1254
|
-
},
|
|
1255
|
-
index
|
|
1256
|
-
)) });
|
|
1257
|
-
};
|
|
1258
|
-
|
|
1259
1203
|
// src/components/user-action/Checkbox.tsx
|
|
1260
|
-
var
|
|
1204
|
+
var import_react13 = require("react");
|
|
1261
1205
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
1262
|
-
var
|
|
1263
|
-
var
|
|
1264
|
-
var
|
|
1206
|
+
var import_lucide_react3 = require("lucide-react");
|
|
1207
|
+
var import_clsx8 = __toESM(require("clsx"));
|
|
1208
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1265
1209
|
var checkboxSizeMapping = {
|
|
1266
1210
|
small: "size-5",
|
|
1267
1211
|
medium: "size-6",
|
|
@@ -1297,33 +1241,92 @@ var Checkbox = ({
|
|
|
1297
1241
|
const newValue = checked === "indeterminate" ? false : !checked;
|
|
1298
1242
|
propagateChange(newValue);
|
|
1299
1243
|
};
|
|
1300
|
-
return /* @__PURE__ */ (0,
|
|
1301
|
-
/* @__PURE__ */ (0,
|
|
1244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_clsx8.default)("group flex-row-2 items-center cursor-pointer", containerClassName), onClick: changeValue, children: [
|
|
1245
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1302
1246
|
CheckboxPrimitive.Root,
|
|
1303
1247
|
{
|
|
1304
1248
|
onCheckedChange: propagateChange,
|
|
1305
1249
|
checked,
|
|
1306
1250
|
disabled,
|
|
1307
1251
|
id,
|
|
1308
|
-
className: (0,
|
|
1252
|
+
className: (0, import_clsx8.default)(usedSizeClass, `items-center border-2 rounded outline-none `, {
|
|
1309
1253
|
"text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
|
|
1310
1254
|
"focus:border-primary group-hover:border-primary ": !disabled,
|
|
1311
|
-
"bg-
|
|
1255
|
+
"bg-input-background": !disabled && !checked,
|
|
1312
1256
|
"bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
|
|
1313
1257
|
}, className),
|
|
1314
|
-
children: /* @__PURE__ */ (0,
|
|
1315
|
-
checked === true && /* @__PURE__ */ (0,
|
|
1316
|
-
checked === "indeterminate" && /* @__PURE__ */ (0,
|
|
1258
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(CheckboxPrimitive.Indicator, { children: [
|
|
1259
|
+
checked === true && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Check, { className: innerIconSize }),
|
|
1260
|
+
checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Minus, { className: innerIconSize })
|
|
1317
1261
|
] })
|
|
1318
1262
|
}
|
|
1319
1263
|
),
|
|
1320
|
-
label && /* @__PURE__ */ (0,
|
|
1264
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Label, { ...label, className: (0, import_clsx8.default)(label.className), htmlFor: id })
|
|
1321
1265
|
] });
|
|
1322
1266
|
};
|
|
1323
1267
|
|
|
1324
1268
|
// src/components/user-action/MultiSelect.tsx
|
|
1325
1269
|
var import_lucide_react5 = require("lucide-react");
|
|
1326
|
-
|
|
1270
|
+
|
|
1271
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
1272
|
+
var import_clsx9 = __toESM(require("clsx"));
|
|
1273
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1274
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1275
|
+
var Tile = ({
|
|
1276
|
+
title,
|
|
1277
|
+
titleClassName,
|
|
1278
|
+
description,
|
|
1279
|
+
descriptionClassName,
|
|
1280
|
+
onClick,
|
|
1281
|
+
isSelected = false,
|
|
1282
|
+
disabled = false,
|
|
1283
|
+
prefix,
|
|
1284
|
+
suffix,
|
|
1285
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
1286
|
+
selectedClassName = "bg-primary/20",
|
|
1287
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
1288
|
+
className
|
|
1289
|
+
}) => {
|
|
1290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1291
|
+
"div",
|
|
1292
|
+
{
|
|
1293
|
+
className: (0, import_clsx9.default)(
|
|
1294
|
+
"flex-row-2 w-full items-center",
|
|
1295
|
+
{
|
|
1296
|
+
[normalClassName]: onClick && !disabled,
|
|
1297
|
+
[selectedClassName]: isSelected && !disabled,
|
|
1298
|
+
[disabledClassName]: disabled
|
|
1299
|
+
},
|
|
1300
|
+
className
|
|
1301
|
+
),
|
|
1302
|
+
onClick: disabled ? void 0 : onClick,
|
|
1303
|
+
children: [
|
|
1304
|
+
prefix,
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex-col-0 w-full", children: [
|
|
1306
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: (0, import_clsx9.default)(titleClassName ?? "textstyle-title-normal"), children: title }),
|
|
1307
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: (0, import_clsx9.default)(descriptionClassName ?? "textstyle-description"), children: description })
|
|
1308
|
+
] }),
|
|
1309
|
+
suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Check, { size: 24 }) : void 0)
|
|
1310
|
+
]
|
|
1311
|
+
}
|
|
1312
|
+
);
|
|
1313
|
+
};
|
|
1314
|
+
var ListTile = ({
|
|
1315
|
+
...props
|
|
1316
|
+
}) => {
|
|
1317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1318
|
+
Tile,
|
|
1319
|
+
{
|
|
1320
|
+
...props,
|
|
1321
|
+
titleClassName: props.titleClassName ?? "font-semibold",
|
|
1322
|
+
className: (0, import_clsx9.default)("px-2 py-1 rounded-md", props.className),
|
|
1323
|
+
disabledClassName: props.disabledClassName ?? "text-disabled-text cursor-not-allowed"
|
|
1324
|
+
}
|
|
1325
|
+
);
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
// src/components/user-action/MultiSelect.tsx
|
|
1329
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1327
1330
|
var defaultMultiSelectTranslation = {
|
|
1328
1331
|
en: {
|
|
1329
1332
|
selected: `{{amount}} selected`
|
|
@@ -1350,52 +1353,64 @@ var MultiSelect = ({
|
|
|
1350
1353
|
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
1351
1354
|
const { result, search, setSearch } = useSearch({
|
|
1352
1355
|
list: options,
|
|
1353
|
-
searchMapping: (0,
|
|
1356
|
+
searchMapping: (0, import_react14.useCallback)((item) => item.searchTags, []),
|
|
1354
1357
|
...searchOptions
|
|
1355
1358
|
});
|
|
1356
1359
|
const selectedItems = options.filter((value) => value.selected);
|
|
1357
1360
|
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|
|
1358
|
-
return /* @__PURE__ */ (0,
|
|
1359
|
-
label && /* @__PURE__ */ (0,
|
|
1361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: (0, import_clsx10.default)(className), children: [
|
|
1362
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1360
1363
|
Label,
|
|
1361
1364
|
{
|
|
1362
1365
|
...label,
|
|
1363
1366
|
htmlFor: label.name,
|
|
1364
|
-
className: (0,
|
|
1367
|
+
className: (0, import_clsx10.default)(" mb-1", label.className),
|
|
1365
1368
|
labelType: label.labelType ?? "labelBig"
|
|
1366
1369
|
}
|
|
1367
1370
|
),
|
|
1368
|
-
/* @__PURE__ */ (0,
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1369
1372
|
Menu,
|
|
1370
1373
|
{
|
|
1371
1374
|
...menuProps,
|
|
1372
|
-
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0,
|
|
1375
|
+
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1373
1376
|
"button",
|
|
1374
1377
|
{
|
|
1375
1378
|
ref,
|
|
1376
|
-
className: (0,
|
|
1377
|
-
"btn-md justify-between w-full border-2 h-auto",
|
|
1379
|
+
className: (0, import_clsx10.default)(
|
|
1380
|
+
"group btn-md justify-between w-full border-2 h-auto",
|
|
1378
1381
|
{
|
|
1379
1382
|
"min-h-14": useChipDisplay,
|
|
1380
|
-
"bg-
|
|
1383
|
+
"bg-input-background text-input-text hover:border-primary": !disabled,
|
|
1381
1384
|
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": disabled
|
|
1382
1385
|
},
|
|
1383
1386
|
triggerClassName
|
|
1384
1387
|
),
|
|
1385
1388
|
onClick: toggleOpen,
|
|
1386
1389
|
disabled,
|
|
1387
|
-
children: useChipDisplay ? /* @__PURE__ */ (0,
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1390
|
+
children: useChipDisplay ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children: isShowingHint ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1391
|
+
"div",
|
|
1392
|
+
{
|
|
1393
|
+
className: (0, import_clsx10.default)(
|
|
1394
|
+
"icon-btn-sm ",
|
|
1395
|
+
{
|
|
1396
|
+
"bg-button-solid-neutral-background text-button-solid-neutral-text hover:brightness-90 group-hover:brightness-90": !disabled,
|
|
1397
|
+
"bg-disabled-background text-disabled-text": disabled
|
|
1398
|
+
}
|
|
1399
|
+
),
|
|
1400
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react5.Plus, {})
|
|
1401
|
+
}
|
|
1402
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1403
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
|
|
1404
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: (0, import_clsx10.default)("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
|
|
1405
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ExpansionIcon, { isExpanded: isOpen })
|
|
1391
1406
|
] })
|
|
1392
1407
|
}
|
|
1393
1408
|
),
|
|
1394
|
-
menuClassName: (0,
|
|
1409
|
+
menuClassName: (0, import_clsx10.default)("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
|
|
1395
1410
|
children: (bag) => {
|
|
1396
1411
|
const { close } = bag;
|
|
1397
|
-
return /* @__PURE__ */ (0,
|
|
1398
|
-
!searchOptions?.disabled && /* @__PURE__ */ (0,
|
|
1412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1413
|
+
!searchOptions?.disabled && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1399
1414
|
SearchBar,
|
|
1400
1415
|
{
|
|
1401
1416
|
value: search,
|
|
@@ -1403,7 +1418,7 @@ var MultiSelect = ({
|
|
|
1403
1418
|
autoFocus: true
|
|
1404
1419
|
}
|
|
1405
1420
|
),
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1421
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-col-2 overflow-y-auto", children: [
|
|
1407
1422
|
result.map((option, index) => {
|
|
1408
1423
|
const update = () => {
|
|
1409
1424
|
onChange(options.map((value) => value.value === option.value ? {
|
|
@@ -1411,10 +1426,10 @@ var MultiSelect = ({
|
|
|
1411
1426
|
selected: !value.selected
|
|
1412
1427
|
} : value));
|
|
1413
1428
|
};
|
|
1414
|
-
return /* @__PURE__ */ (0,
|
|
1415
|
-
|
|
1429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1430
|
+
ListTile,
|
|
1416
1431
|
{
|
|
1417
|
-
prefix: /* @__PURE__ */ (0,
|
|
1432
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1418
1433
|
Checkbox,
|
|
1419
1434
|
{
|
|
1420
1435
|
checked: option.selected,
|
|
@@ -1423,7 +1438,7 @@ var MultiSelect = ({
|
|
|
1423
1438
|
disabled: option.disabled
|
|
1424
1439
|
}
|
|
1425
1440
|
),
|
|
1426
|
-
title:
|
|
1441
|
+
title: option.label,
|
|
1427
1442
|
onClick: update,
|
|
1428
1443
|
disabled: option.disabled
|
|
1429
1444
|
},
|
|
@@ -1432,9 +1447,9 @@ var MultiSelect = ({
|
|
|
1432
1447
|
}),
|
|
1433
1448
|
additionalItems && additionalItems({ ...bag, search })
|
|
1434
1449
|
] }),
|
|
1435
|
-
/* @__PURE__ */ (0,
|
|
1436
|
-
/* @__PURE__ */ (0,
|
|
1437
|
-
/* @__PURE__ */ (0,
|
|
1450
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-row-2 justify-between", children: [
|
|
1451
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-row-2", children: [
|
|
1452
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1438
1453
|
SolidButton,
|
|
1439
1454
|
{
|
|
1440
1455
|
color: "neutral",
|
|
@@ -1449,7 +1464,7 @@ var MultiSelect = ({
|
|
|
1449
1464
|
children: translation("all")
|
|
1450
1465
|
}
|
|
1451
1466
|
),
|
|
1452
|
-
/* @__PURE__ */ (0,
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1453
1468
|
SolidButton,
|
|
1454
1469
|
{
|
|
1455
1470
|
color: "neutral",
|
|
@@ -1464,7 +1479,7 @@ var MultiSelect = ({
|
|
|
1464
1479
|
}
|
|
1465
1480
|
)
|
|
1466
1481
|
] }),
|
|
1467
|
-
/* @__PURE__ */ (0,
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SolidButton, { size: "small", onClick: close, children: "Done" })
|
|
1468
1483
|
] })
|
|
1469
1484
|
] });
|
|
1470
1485
|
}
|
|
@@ -1475,8 +1490,8 @@ var MultiSelect = ({
|
|
|
1475
1490
|
|
|
1476
1491
|
// src/components/properties/PropertyBase.tsx
|
|
1477
1492
|
var import_lucide_react6 = require("lucide-react");
|
|
1478
|
-
var
|
|
1479
|
-
var
|
|
1493
|
+
var import_clsx11 = __toESM(require("clsx"));
|
|
1494
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1480
1495
|
var PropertyBase = ({
|
|
1481
1496
|
overwriteTranslation,
|
|
1482
1497
|
name,
|
|
@@ -1490,11 +1505,11 @@ var PropertyBase = ({
|
|
|
1490
1505
|
}) => {
|
|
1491
1506
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
1492
1507
|
const requiredAndNoValue = softRequired && !hasValue;
|
|
1493
|
-
return /* @__PURE__ */ (0,
|
|
1494
|
-
/* @__PURE__ */ (0,
|
|
1508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_clsx11.default)("flex-row-0 group", className), children: [
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1495
1510
|
"div",
|
|
1496
1511
|
{
|
|
1497
|
-
className: (0,
|
|
1512
|
+
className: (0, import_clsx11.default)(
|
|
1498
1513
|
"flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center rounded-l-xl border-2 border-r-0",
|
|
1499
1514
|
{
|
|
1500
1515
|
"bg-property-title-background text-property-title-text group-hover:border-primary": !requiredAndNoValue,
|
|
@@ -1503,31 +1518,31 @@ var PropertyBase = ({
|
|
|
1503
1518
|
className
|
|
1504
1519
|
),
|
|
1505
1520
|
children: [
|
|
1506
|
-
/* @__PURE__ */ (0,
|
|
1507
|
-
/* @__PURE__ */ (0,
|
|
1521
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "max-w-6 min-w-6 text-text-primary", children: icon }),
|
|
1522
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-semibold", children: name })
|
|
1508
1523
|
]
|
|
1509
1524
|
}
|
|
1510
1525
|
),
|
|
1511
|
-
/* @__PURE__ */ (0,
|
|
1526
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1512
1527
|
"div",
|
|
1513
1528
|
{
|
|
1514
|
-
className: (0,
|
|
1529
|
+
className: (0, import_clsx11.default)(
|
|
1515
1530
|
"flex-row-2 grow px-3 py-2 justify-between items-center rounded-r-xl border-2 border-l-0 min-h-15",
|
|
1516
1531
|
{
|
|
1517
|
-
"bg-
|
|
1532
|
+
"bg-input-background text-input-text group-hover:border-primary": !requiredAndNoValue,
|
|
1518
1533
|
"bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
1519
1534
|
},
|
|
1520
1535
|
className
|
|
1521
1536
|
),
|
|
1522
1537
|
children: [
|
|
1523
1538
|
input({ softRequired, hasValue }),
|
|
1524
|
-
requiredAndNoValue && /* @__PURE__ */ (0,
|
|
1525
|
-
onRemove && hasValue && /* @__PURE__ */ (0,
|
|
1539
|
+
requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "text-warning", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.AlertTriangle, { size: 24 }) }),
|
|
1540
|
+
onRemove && hasValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1526
1541
|
TextButton,
|
|
1527
1542
|
{
|
|
1528
1543
|
onClick: onRemove,
|
|
1529
1544
|
color: "negative",
|
|
1530
|
-
className: (0,
|
|
1545
|
+
className: (0, import_clsx11.default)("items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
1531
1546
|
disabled: !hasValue || readOnly,
|
|
1532
1547
|
children: translation("remove")
|
|
1533
1548
|
}
|
|
@@ -1539,7 +1554,7 @@ var PropertyBase = ({
|
|
|
1539
1554
|
};
|
|
1540
1555
|
|
|
1541
1556
|
// src/components/properties/MultiSelectProperty.tsx
|
|
1542
|
-
var
|
|
1557
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1543
1558
|
var MultiSelectProperty = ({
|
|
1544
1559
|
overwriteTranslation,
|
|
1545
1560
|
options,
|
|
@@ -1552,7 +1567,7 @@ var MultiSelectProperty = ({
|
|
|
1552
1567
|
}) => {
|
|
1553
1568
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
1554
1569
|
const hasValue = options.some((value) => value.selected);
|
|
1555
|
-
return /* @__PURE__ */ (0,
|
|
1570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1556
1571
|
PropertyBase,
|
|
1557
1572
|
{
|
|
1558
1573
|
name,
|
|
@@ -1560,12 +1575,12 @@ var MultiSelectProperty = ({
|
|
|
1560
1575
|
readOnly,
|
|
1561
1576
|
softRequired,
|
|
1562
1577
|
hasValue,
|
|
1563
|
-
icon: /* @__PURE__ */ (0,
|
|
1564
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0,
|
|
1578
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.List, { size: 24 }),
|
|
1579
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1565
1580
|
MultiSelect,
|
|
1566
1581
|
{
|
|
1567
1582
|
...multiSelectProps,
|
|
1568
|
-
className: (0,
|
|
1583
|
+
className: (0, import_clsx12.default)("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
1569
1584
|
options,
|
|
1570
1585
|
disabled: readOnly,
|
|
1571
1586
|
useChipDisplay: true,
|
|
@@ -1578,11 +1593,11 @@ var MultiSelectProperty = ({
|
|
|
1578
1593
|
if (!onAddNew && !search.trim()) {
|
|
1579
1594
|
return void 0;
|
|
1580
1595
|
}
|
|
1581
|
-
return /* @__PURE__ */ (0,
|
|
1582
|
-
|
|
1596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1597
|
+
ListTile,
|
|
1583
1598
|
{
|
|
1584
|
-
prefix: /* @__PURE__ */ (0,
|
|
1585
|
-
title:
|
|
1599
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Plus, {}),
|
|
1600
|
+
title: `${translation("add")} ${search.trim()}`,
|
|
1586
1601
|
onClick: () => {
|
|
1587
1602
|
onAddNew(search);
|
|
1588
1603
|
close();
|
|
@@ -1591,7 +1606,7 @@ var MultiSelectProperty = ({
|
|
|
1591
1606
|
}
|
|
1592
1607
|
);
|
|
1593
1608
|
},
|
|
1594
|
-
triggerClassName: (0,
|
|
1609
|
+
triggerClassName: (0, import_clsx12.default)(
|
|
1595
1610
|
"!border-none !p-0 !min-h-10",
|
|
1596
1611
|
{
|
|
1597
1612
|
"!bg-warning !text-surface-warning": softRequired2 && !hasValue,
|