@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/properties/MultiSelectProperty.tsx
|
|
2
2
|
import { List, Plus as Plus2 } from "lucide-react";
|
|
3
|
-
import
|
|
3
|
+
import clsx12 from "clsx";
|
|
4
4
|
|
|
5
5
|
// src/localization/LanguageProvider.tsx
|
|
6
6
|
import { createContext, useContext, useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -90,9 +90,9 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
// src/components/user-action/MultiSelect.tsx
|
|
93
|
-
import { useCallback as
|
|
94
|
-
import { useEffect as
|
|
95
|
-
import
|
|
93
|
+
import { useCallback as useCallback5 } from "react";
|
|
94
|
+
import { useEffect as useEffect11, useState as useState10 } from "react";
|
|
95
|
+
import clsx10 from "clsx";
|
|
96
96
|
|
|
97
97
|
// src/components/user-action/Label.tsx
|
|
98
98
|
import clsx from "clsx";
|
|
@@ -112,169 +112,401 @@ var Label = ({
|
|
|
112
112
|
return /* @__PURE__ */ jsx2("label", { ...props, className: clsx(styleMapping[labelType], className), children: children ? children : name });
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
// src/components/user-action/
|
|
116
|
-
import {
|
|
117
|
-
import { useEffect as useEffect11, useState as useState9 } from "react";
|
|
118
|
-
import clsx8 from "clsx";
|
|
119
|
-
|
|
120
|
-
// src/components/layout-and-navigation/Tile.tsx
|
|
115
|
+
// src/components/user-action/Button.tsx
|
|
116
|
+
import { forwardRef } from "react";
|
|
121
117
|
import clsx2 from "clsx";
|
|
122
|
-
import { Check } from "lucide-react";
|
|
123
118
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
var ButtonColorUtil = {
|
|
120
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
121
|
+
text: ["primary", "negative", "neutral"],
|
|
122
|
+
outline: ["primary"]
|
|
123
|
+
};
|
|
124
|
+
var IconButtonUtil = {
|
|
125
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
126
|
+
};
|
|
127
|
+
var paddingMapping = {
|
|
128
|
+
small: "btn-sm",
|
|
129
|
+
medium: "btn-md",
|
|
130
|
+
large: "btn-lg"
|
|
131
|
+
};
|
|
132
|
+
var iconPaddingMapping = {
|
|
133
|
+
tiny: "icon-btn-xs",
|
|
134
|
+
small: "icon-btn-sm",
|
|
135
|
+
medium: "icon-btn-md",
|
|
136
|
+
large: "icon-btn-lg"
|
|
137
|
+
};
|
|
138
|
+
var ButtonUtil = {
|
|
139
|
+
paddingMapping,
|
|
140
|
+
iconPaddingMapping
|
|
141
|
+
};
|
|
142
|
+
var SolidButton = forwardRef(function SolidButton2({
|
|
143
|
+
children,
|
|
129
144
|
disabled = false,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
className
|
|
136
|
-
|
|
145
|
+
color = "primary",
|
|
146
|
+
size = "medium",
|
|
147
|
+
startIcon,
|
|
148
|
+
endIcon,
|
|
149
|
+
onClick,
|
|
150
|
+
className,
|
|
151
|
+
...restProps
|
|
152
|
+
}, ref) {
|
|
153
|
+
const colorClasses = {
|
|
154
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
155
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
156
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
157
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
158
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
159
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
160
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
161
|
+
}[color];
|
|
162
|
+
const iconColorClasses = {
|
|
163
|
+
primary: "text-button-solid-primary-icon",
|
|
164
|
+
secondary: "text-button-solid-secondary-icon",
|
|
165
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
166
|
+
positive: "text-button-solid-positive-icon",
|
|
167
|
+
warning: "text-button-solid-warning-icon",
|
|
168
|
+
negative: "text-button-solid-negative-icon",
|
|
169
|
+
neutral: "text-button-solid-neutral-icon"
|
|
170
|
+
}[color];
|
|
137
171
|
return /* @__PURE__ */ jsxs(
|
|
138
|
-
"
|
|
172
|
+
"button",
|
|
139
173
|
{
|
|
174
|
+
ref,
|
|
175
|
+
onClick,
|
|
176
|
+
disabled,
|
|
140
177
|
className: clsx2(
|
|
141
|
-
"
|
|
178
|
+
"font-semibold",
|
|
142
179
|
{
|
|
143
|
-
|
|
144
|
-
[
|
|
145
|
-
[disabledClassName]: disabled
|
|
180
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
181
|
+
[clsx2(colorClasses, "hover:brightness-90")]: !disabled
|
|
146
182
|
},
|
|
183
|
+
ButtonUtil.paddingMapping[size],
|
|
147
184
|
className
|
|
148
185
|
),
|
|
149
|
-
|
|
186
|
+
...restProps,
|
|
150
187
|
children: [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
188
|
+
startIcon && /* @__PURE__ */ jsx3(
|
|
189
|
+
"span",
|
|
190
|
+
{
|
|
191
|
+
className: clsx2({
|
|
192
|
+
[iconColorClasses]: !disabled,
|
|
193
|
+
[`text-disabled-icon`]: disabled
|
|
194
|
+
}),
|
|
195
|
+
children: startIcon
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
children,
|
|
199
|
+
endIcon && /* @__PURE__ */ jsx3(
|
|
200
|
+
"span",
|
|
201
|
+
{
|
|
202
|
+
className: clsx2({
|
|
203
|
+
[iconColorClasses]: !disabled,
|
|
204
|
+
[`text-disabled-icon`]: disabled
|
|
205
|
+
}),
|
|
206
|
+
children: endIcon
|
|
207
|
+
}
|
|
208
|
+
)
|
|
157
209
|
]
|
|
158
210
|
}
|
|
159
211
|
);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
// src/components/layout-and-navigation/Expandable.tsx
|
|
163
|
-
import { forwardRef, useCallback as useCallback2, useEffect as useEffect3, useState as useState3 } from "react";
|
|
164
|
-
import { ChevronDown } from "lucide-react";
|
|
165
|
-
import clsx3 from "clsx";
|
|
166
|
-
|
|
167
|
-
// src/util/noop.ts
|
|
168
|
-
var noop = () => void 0;
|
|
169
|
-
|
|
170
|
-
// src/components/layout-and-navigation/Expandable.tsx
|
|
171
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
172
|
-
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
173
|
-
return /* @__PURE__ */ jsx4(
|
|
174
|
-
ChevronDown,
|
|
175
|
-
{
|
|
176
|
-
className: clsx3(
|
|
177
|
-
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
178
|
-
{ "rotate-180": isExpanded },
|
|
179
|
-
className
|
|
180
|
-
)
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
};
|
|
184
|
-
var Expandable = forwardRef(function Expandable2({
|
|
212
|
+
});
|
|
213
|
+
var TextButton = ({
|
|
185
214
|
children,
|
|
186
|
-
label,
|
|
187
|
-
icon,
|
|
188
|
-
isExpanded = false,
|
|
189
|
-
onChange = noop,
|
|
190
|
-
clickOnlyOnHeader = true,
|
|
191
215
|
disabled = false,
|
|
216
|
+
color = "neutral",
|
|
217
|
+
size = "medium",
|
|
218
|
+
startIcon,
|
|
219
|
+
endIcon,
|
|
220
|
+
onClick,
|
|
221
|
+
coloredHoverBackground = true,
|
|
192
222
|
className,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
223
|
+
...restProps
|
|
224
|
+
}) => {
|
|
225
|
+
const colorClasses = {
|
|
226
|
+
primary: "bg-transparent text-button-text-primary-text",
|
|
227
|
+
negative: "bg-transparent text-button-text-negative-text",
|
|
228
|
+
neutral: "bg-transparent text-button-text-neutral-text"
|
|
229
|
+
}[color];
|
|
230
|
+
const backgroundColor = {
|
|
231
|
+
primary: "hover:bg-button-text-primary-text/20",
|
|
232
|
+
negative: "hover:bg-button-text-negative-text/20",
|
|
233
|
+
neutral: "hover:bg-button-text-neutral-text/20"
|
|
234
|
+
}[color];
|
|
235
|
+
const iconColorClasses = {
|
|
236
|
+
primary: "text-button-text-primary-icon",
|
|
237
|
+
negative: "text-button-text-negative-icon",
|
|
238
|
+
neutral: "text-button-text-neutral-icon"
|
|
239
|
+
}[color];
|
|
240
|
+
return /* @__PURE__ */ jsxs(
|
|
241
|
+
"button",
|
|
201
242
|
{
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
243
|
+
onClick,
|
|
244
|
+
disabled,
|
|
245
|
+
className: clsx2(
|
|
246
|
+
"font-semibold",
|
|
247
|
+
{
|
|
248
|
+
"text-disabled-text cursor-not-allowed": disabled,
|
|
249
|
+
[colorClasses]: !disabled,
|
|
250
|
+
[backgroundColor]: !disabled && coloredHoverBackground,
|
|
251
|
+
"hover:bg-button-text-hover-background": !disabled && !coloredHoverBackground
|
|
252
|
+
},
|
|
253
|
+
ButtonUtil.paddingMapping[size],
|
|
254
|
+
className
|
|
255
|
+
),
|
|
256
|
+
...restProps,
|
|
205
257
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
"
|
|
258
|
+
startIcon && /* @__PURE__ */ jsx3(
|
|
259
|
+
"span",
|
|
208
260
|
{
|
|
209
|
-
className:
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
215
|
-
},
|
|
216
|
-
headerClassName
|
|
217
|
-
),
|
|
218
|
-
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
219
|
-
children: [
|
|
220
|
-
label,
|
|
221
|
-
icon(isExpanded)
|
|
222
|
-
]
|
|
261
|
+
className: clsx2({
|
|
262
|
+
[iconColorClasses]: !disabled,
|
|
263
|
+
[`text-disabled-icon`]: disabled
|
|
264
|
+
}),
|
|
265
|
+
children: startIcon
|
|
223
266
|
}
|
|
224
267
|
),
|
|
225
|
-
|
|
226
|
-
|
|
268
|
+
children,
|
|
269
|
+
endIcon && /* @__PURE__ */ jsx3(
|
|
270
|
+
"span",
|
|
227
271
|
{
|
|
228
|
-
className:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
},
|
|
234
|
-
contentClassName
|
|
235
|
-
),
|
|
236
|
-
children
|
|
272
|
+
className: clsx2({
|
|
273
|
+
[iconColorClasses]: !disabled,
|
|
274
|
+
[`text-disabled-icon`]: disabled
|
|
275
|
+
}),
|
|
276
|
+
children: endIcon
|
|
237
277
|
}
|
|
238
278
|
)
|
|
239
279
|
]
|
|
240
280
|
}
|
|
241
281
|
);
|
|
242
|
-
}
|
|
243
|
-
var
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
282
|
+
};
|
|
283
|
+
var IconButton = ({
|
|
284
|
+
children,
|
|
285
|
+
disabled = false,
|
|
286
|
+
color = "primary",
|
|
287
|
+
size = "medium",
|
|
288
|
+
className,
|
|
289
|
+
...restProps
|
|
290
|
+
}) => {
|
|
291
|
+
const colorClasses = {
|
|
292
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
293
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
294
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
295
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
296
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
297
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
298
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
299
|
+
transparent: "bg-transparent"
|
|
300
|
+
}[color];
|
|
301
|
+
return /* @__PURE__ */ jsx3(
|
|
302
|
+
"button",
|
|
254
303
|
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
304
|
+
disabled,
|
|
305
|
+
className: clsx2(
|
|
306
|
+
{
|
|
307
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
308
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
309
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
310
|
+
[clsx2(colorClasses, "hover:brightness-90")]: !disabled
|
|
311
|
+
},
|
|
312
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
313
|
+
className
|
|
314
|
+
),
|
|
315
|
+
...restProps,
|
|
316
|
+
children
|
|
262
317
|
}
|
|
263
318
|
);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// src/components/user-action/Menu.tsx
|
|
267
|
-
import {
|
|
268
|
-
useEffect as useEffect6,
|
|
269
|
-
useRef,
|
|
270
|
-
useState as useState5
|
|
271
|
-
} from "react";
|
|
272
|
-
import clsx4 from "clsx";
|
|
319
|
+
};
|
|
273
320
|
|
|
274
|
-
// src/
|
|
275
|
-
import
|
|
321
|
+
// src/components/layout-and-navigation/Chip.tsx
|
|
322
|
+
import clsx3 from "clsx";
|
|
323
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
324
|
+
var Chip = ({
|
|
325
|
+
children,
|
|
326
|
+
trailingIcon,
|
|
327
|
+
color = "default",
|
|
328
|
+
variant = "normal",
|
|
329
|
+
className = "",
|
|
330
|
+
...restProps
|
|
331
|
+
}) => {
|
|
332
|
+
const colorMapping = {
|
|
333
|
+
default: "text-tag-default-text bg-tag-default-background",
|
|
334
|
+
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
335
|
+
red: "text-tag-red-text bg-tag-red-background",
|
|
336
|
+
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
337
|
+
green: "text-tag-green-text bg-tag-green-background",
|
|
338
|
+
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
339
|
+
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
340
|
+
}[color];
|
|
341
|
+
const colorMappingIcon = {
|
|
342
|
+
default: "text-tag-default-icon",
|
|
343
|
+
dark: "text-tag-dark-icon",
|
|
344
|
+
red: "text-tag-red-icon",
|
|
345
|
+
yellow: "text-tag-yellow-icon",
|
|
346
|
+
green: "text-tag-green-icon",
|
|
347
|
+
blue: "text-tag-blue-icon",
|
|
348
|
+
pink: "text-tag-pink-icon"
|
|
349
|
+
}[color];
|
|
350
|
+
return /* @__PURE__ */ jsxs2(
|
|
351
|
+
"div",
|
|
352
|
+
{
|
|
353
|
+
...restProps,
|
|
354
|
+
className: clsx3(
|
|
355
|
+
`row w-fit px-2 py-1 font-semibold`,
|
|
356
|
+
colorMapping,
|
|
357
|
+
{
|
|
358
|
+
"rounded-md": variant === "normal",
|
|
359
|
+
"rounded-full": variant === "fullyRounded"
|
|
360
|
+
},
|
|
361
|
+
className
|
|
362
|
+
),
|
|
363
|
+
children: [
|
|
364
|
+
children,
|
|
365
|
+
trailingIcon && /* @__PURE__ */ jsx4("span", { className: colorMappingIcon, children: trailingIcon })
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
};
|
|
370
|
+
var ChipList = ({
|
|
371
|
+
list,
|
|
372
|
+
className = ""
|
|
373
|
+
}) => {
|
|
374
|
+
return /* @__PURE__ */ jsx4("div", { className: clsx3("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx4(
|
|
375
|
+
Chip,
|
|
376
|
+
{
|
|
377
|
+
...value,
|
|
378
|
+
color: value.color ?? "default",
|
|
379
|
+
variant: value.variant ?? "normal",
|
|
380
|
+
children: value.children
|
|
381
|
+
},
|
|
382
|
+
index
|
|
383
|
+
)) });
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
// src/localization/defaults/form.ts
|
|
387
|
+
var formTranslation = {
|
|
388
|
+
en: {
|
|
389
|
+
add: "Add",
|
|
390
|
+
all: "All",
|
|
391
|
+
apply: "Apply",
|
|
392
|
+
back: "Back",
|
|
393
|
+
cancel: "Cancel",
|
|
394
|
+
change: "Change",
|
|
395
|
+
clear: "Clear",
|
|
396
|
+
click: "Click",
|
|
397
|
+
clickToCopy: "Click to Copy",
|
|
398
|
+
close: "Close",
|
|
399
|
+
confirm: "Confirm",
|
|
400
|
+
copy: "Copy",
|
|
401
|
+
copied: "Copied",
|
|
402
|
+
create: "Create",
|
|
403
|
+
decline: "Decline",
|
|
404
|
+
delete: "Delete",
|
|
405
|
+
discard: "Discard",
|
|
406
|
+
discardChanges: "Discard Changes",
|
|
407
|
+
done: "Done",
|
|
408
|
+
edit: "Edit",
|
|
409
|
+
enterText: "Enter text here",
|
|
410
|
+
error: "Error",
|
|
411
|
+
exit: "Exit",
|
|
412
|
+
fieldRequiredError: "This field is required.",
|
|
413
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
414
|
+
less: "Less",
|
|
415
|
+
loading: "Loading",
|
|
416
|
+
maxLengthError: "Maximum length exceeded.",
|
|
417
|
+
minLengthError: "Minimum length not met.",
|
|
418
|
+
more: "More",
|
|
419
|
+
next: "Next",
|
|
420
|
+
no: "No",
|
|
421
|
+
none: "None",
|
|
422
|
+
of: "of",
|
|
423
|
+
optional: "Optional",
|
|
424
|
+
pleaseWait: "Please wait...",
|
|
425
|
+
previous: "Previous",
|
|
426
|
+
remove: "Remove",
|
|
427
|
+
required: "Required",
|
|
428
|
+
reset: "Reset",
|
|
429
|
+
save: "Save",
|
|
430
|
+
saved: "Saved",
|
|
431
|
+
search: "Search",
|
|
432
|
+
select: "Select",
|
|
433
|
+
selectOption: "Select an option",
|
|
434
|
+
show: "Show",
|
|
435
|
+
showMore: "Show more",
|
|
436
|
+
showLess: "Show less",
|
|
437
|
+
submit: "Submit",
|
|
438
|
+
success: "Success",
|
|
439
|
+
update: "Update",
|
|
440
|
+
unsavedChanges: "Unsaved Changes",
|
|
441
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
442
|
+
yes: "Yes"
|
|
443
|
+
},
|
|
444
|
+
de: {
|
|
445
|
+
add: "Hinzuf\xFCgen",
|
|
446
|
+
all: "Alle",
|
|
447
|
+
apply: "Anwenden",
|
|
448
|
+
back: "Zur\xFCck",
|
|
449
|
+
cancel: "Abbrechen",
|
|
450
|
+
change: "\xC4ndern",
|
|
451
|
+
clear: "L\xF6schen",
|
|
452
|
+
click: "Klicken",
|
|
453
|
+
clickToCopy: "Zum kopieren klicken",
|
|
454
|
+
close: "Schlie\xDFen",
|
|
455
|
+
confirm: "Best\xE4tigen",
|
|
456
|
+
copy: "Kopieren",
|
|
457
|
+
copied: "Kopiert",
|
|
458
|
+
create: "Erstellen",
|
|
459
|
+
decline: "Ablehnen",
|
|
460
|
+
delete: "L\xF6schen",
|
|
461
|
+
discard: "Verwerfen",
|
|
462
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
463
|
+
done: "Fertig",
|
|
464
|
+
edit: "Bearbeiten",
|
|
465
|
+
enterText: "Text hier eingeben",
|
|
466
|
+
error: "Fehler",
|
|
467
|
+
exit: "Beenden",
|
|
468
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
469
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
470
|
+
less: "Weniger",
|
|
471
|
+
loading: "L\xE4dt",
|
|
472
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
473
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
474
|
+
more: "Mehr",
|
|
475
|
+
next: "Weiter",
|
|
476
|
+
no: "Nein",
|
|
477
|
+
none: "Nichts",
|
|
478
|
+
of: "von",
|
|
479
|
+
optional: "Optional",
|
|
480
|
+
pleaseWait: "Bitte warten...",
|
|
481
|
+
previous: "Vorherige",
|
|
482
|
+
remove: "Entfernen",
|
|
483
|
+
required: "Erforderlich",
|
|
484
|
+
reset: "Zur\xFCcksetzen",
|
|
485
|
+
save: "Speichern",
|
|
486
|
+
saved: "Gespeichert",
|
|
487
|
+
search: "Suche",
|
|
488
|
+
select: "Select",
|
|
489
|
+
selectOption: "Option ausw\xE4hlen",
|
|
490
|
+
show: "Anzeigen",
|
|
491
|
+
showMore: "Mehr anzeigen",
|
|
492
|
+
showLess: "Weniger anzeigen",
|
|
493
|
+
submit: "Abschicken",
|
|
494
|
+
success: "Erfolg",
|
|
495
|
+
update: "Update",
|
|
496
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
497
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
498
|
+
yes: "Ja"
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
// src/components/user-action/Menu.tsx
|
|
503
|
+
import { useEffect as useEffect5, useRef, useState as useState4 } from "react";
|
|
504
|
+
import clsx4 from "clsx";
|
|
505
|
+
|
|
506
|
+
// src/hooks/useOutsideClick.ts
|
|
507
|
+
import { useEffect as useEffect3 } from "react";
|
|
276
508
|
var useOutsideClick = (refs, handler) => {
|
|
277
|
-
|
|
509
|
+
useEffect3(() => {
|
|
278
510
|
const listener = (event) => {
|
|
279
511
|
if (event.target === null) return;
|
|
280
512
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -292,15 +524,15 @@ var useOutsideClick = (refs, handler) => {
|
|
|
292
524
|
};
|
|
293
525
|
|
|
294
526
|
// src/hooks/useHoverState.ts
|
|
295
|
-
import { useEffect as
|
|
527
|
+
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
296
528
|
var defaultUseHoverStateProps = {
|
|
297
529
|
closingDelay: 200,
|
|
298
530
|
isDisabled: false
|
|
299
531
|
};
|
|
300
532
|
var useHoverState = (props = void 0) => {
|
|
301
533
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
302
|
-
const [isHovered, setIsHovered] =
|
|
303
|
-
const [timer, setTimer] =
|
|
534
|
+
const [isHovered, setIsHovered] = useState3(false);
|
|
535
|
+
const [timer, setTimer] = useState3();
|
|
304
536
|
const onMouseEnter = () => {
|
|
305
537
|
if (isDisabled) {
|
|
306
538
|
return;
|
|
@@ -316,14 +548,14 @@ var useHoverState = (props = void 0) => {
|
|
|
316
548
|
setIsHovered(false);
|
|
317
549
|
}, closingDelay));
|
|
318
550
|
};
|
|
319
|
-
|
|
551
|
+
useEffect4(() => {
|
|
320
552
|
if (timer) {
|
|
321
553
|
return () => {
|
|
322
554
|
clearTimeout(timer);
|
|
323
555
|
};
|
|
324
556
|
}
|
|
325
557
|
});
|
|
326
|
-
|
|
558
|
+
useEffect4(() => {
|
|
327
559
|
if (timer) {
|
|
328
560
|
clearTimeout(timer);
|
|
329
561
|
}
|
|
@@ -425,7 +657,7 @@ var Menu = ({
|
|
|
425
657
|
const triggerRef = useRef(null);
|
|
426
658
|
const menuRef = useRef(null);
|
|
427
659
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
428
|
-
const [isHidden, setIsHidden] =
|
|
660
|
+
const [isHidden, setIsHidden] = useState4(true);
|
|
429
661
|
const bag = {
|
|
430
662
|
isOpen,
|
|
431
663
|
close: () => setIsOpen(false),
|
|
@@ -436,7 +668,7 @@ var Menu = ({
|
|
|
436
668
|
triggerRef.current?.getBoundingClientRect(),
|
|
437
669
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
438
670
|
);
|
|
439
|
-
|
|
671
|
+
useEffect5(() => {
|
|
440
672
|
if (!isOpen) return;
|
|
441
673
|
const triggerEl = triggerRef.current;
|
|
442
674
|
if (!triggerEl) return;
|
|
@@ -453,7 +685,7 @@ var Menu = ({
|
|
|
453
685
|
window.removeEventListener("resize", close);
|
|
454
686
|
};
|
|
455
687
|
}, [isOpen, setIsOpen]);
|
|
456
|
-
|
|
688
|
+
useEffect5(() => {
|
|
457
689
|
if (isOpen) {
|
|
458
690
|
setIsHidden(false);
|
|
459
691
|
}
|
|
@@ -466,7 +698,7 @@ var Menu = ({
|
|
|
466
698
|
ref: menuRef,
|
|
467
699
|
onClick: (e) => e.stopPropagation(),
|
|
468
700
|
className: clsx4(
|
|
469
|
-
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-[300]",
|
|
701
|
+
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg shadow-strong z-[300]",
|
|
470
702
|
{
|
|
471
703
|
"animate-pop-in": isOpen,
|
|
472
704
|
"animate-pop-out": !isOpen,
|
|
@@ -488,63 +720,167 @@ var Menu = ({
|
|
|
488
720
|
] });
|
|
489
721
|
};
|
|
490
722
|
|
|
491
|
-
// src/components/
|
|
492
|
-
import { forwardRef as forwardRef2,
|
|
723
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
724
|
+
import { forwardRef as forwardRef2, useCallback as useCallback2, useEffect as useEffect6, useState as useState5 } from "react";
|
|
725
|
+
import { ChevronDown } from "lucide-react";
|
|
493
726
|
import clsx5 from "clsx";
|
|
494
727
|
|
|
495
|
-
// src/
|
|
496
|
-
|
|
497
|
-
var defaultOptions = {
|
|
498
|
-
delay: 3e3,
|
|
499
|
-
disabled: false
|
|
500
|
-
};
|
|
501
|
-
function useDelay(options) {
|
|
502
|
-
const [timer, setTimer] = useState6(void 0);
|
|
503
|
-
const { delay, disabled } = {
|
|
504
|
-
...defaultOptions,
|
|
505
|
-
...options
|
|
506
|
-
};
|
|
507
|
-
const clearTimer = () => {
|
|
508
|
-
clearTimeout(timer);
|
|
509
|
-
setTimer(void 0);
|
|
510
|
-
};
|
|
511
|
-
const restartTimer = (onDelayFinish) => {
|
|
512
|
-
if (disabled) {
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
clearTimeout(timer);
|
|
516
|
-
setTimer(setTimeout(() => {
|
|
517
|
-
onDelayFinish();
|
|
518
|
-
setTimer(void 0);
|
|
519
|
-
}, delay));
|
|
520
|
-
};
|
|
521
|
-
useEffect7(() => {
|
|
522
|
-
return () => {
|
|
523
|
-
clearTimeout(timer);
|
|
524
|
-
};
|
|
525
|
-
}, [timer]);
|
|
526
|
-
useEffect7(() => {
|
|
527
|
-
if (disabled) {
|
|
528
|
-
clearTimeout(timer);
|
|
529
|
-
setTimer(void 0);
|
|
530
|
-
}
|
|
531
|
-
}, [disabled, timer]);
|
|
532
|
-
return { restartTimer, clearTimer, hasActiveTimer: !!timer };
|
|
533
|
-
}
|
|
728
|
+
// src/util/noop.ts
|
|
729
|
+
var noop = () => void 0;
|
|
534
730
|
|
|
535
|
-
// src/
|
|
536
|
-
import {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
731
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
732
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
733
|
+
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
734
|
+
return /* @__PURE__ */ jsx6(
|
|
735
|
+
ChevronDown,
|
|
736
|
+
{
|
|
737
|
+
className: clsx5(
|
|
738
|
+
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
739
|
+
{ "rotate-180": isExpanded },
|
|
740
|
+
className
|
|
542
741
|
)
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
};
|
|
745
|
+
var Expandable = forwardRef2(function Expandable2({
|
|
746
|
+
children,
|
|
747
|
+
label,
|
|
748
|
+
icon,
|
|
749
|
+
isExpanded = false,
|
|
750
|
+
onChange = noop,
|
|
751
|
+
clickOnlyOnHeader = true,
|
|
752
|
+
disabled = false,
|
|
753
|
+
className,
|
|
754
|
+
headerClassName,
|
|
755
|
+
contentClassName,
|
|
756
|
+
contentExpandedClassName
|
|
757
|
+
}, ref) {
|
|
758
|
+
const defaultIcon = useCallback2((expanded) => /* @__PURE__ */ jsx6(ExpansionIcon, { isExpanded: expanded }), []);
|
|
759
|
+
icon ??= defaultIcon;
|
|
760
|
+
return /* @__PURE__ */ jsxs4(
|
|
761
|
+
"div",
|
|
762
|
+
{
|
|
763
|
+
ref,
|
|
764
|
+
className: clsx5("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
765
|
+
onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
766
|
+
children: [
|
|
767
|
+
/* @__PURE__ */ jsxs4(
|
|
768
|
+
"div",
|
|
769
|
+
{
|
|
770
|
+
className: clsx5(
|
|
771
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
772
|
+
{
|
|
773
|
+
"group-hover:brightness-97": !isExpanded,
|
|
774
|
+
"hover:brightness-97": isExpanded && !disabled,
|
|
775
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
776
|
+
},
|
|
777
|
+
headerClassName
|
|
778
|
+
),
|
|
779
|
+
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
780
|
+
children: [
|
|
781
|
+
label,
|
|
782
|
+
icon(isExpanded)
|
|
783
|
+
]
|
|
784
|
+
}
|
|
785
|
+
),
|
|
786
|
+
/* @__PURE__ */ jsx6(
|
|
787
|
+
"div",
|
|
788
|
+
{
|
|
789
|
+
className: clsx5(
|
|
790
|
+
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
791
|
+
{
|
|
792
|
+
[clsx5("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
793
|
+
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
794
|
+
},
|
|
795
|
+
contentClassName
|
|
796
|
+
),
|
|
797
|
+
children
|
|
798
|
+
}
|
|
799
|
+
)
|
|
800
|
+
]
|
|
801
|
+
}
|
|
802
|
+
);
|
|
803
|
+
});
|
|
804
|
+
var ExpandableUncontrolled = forwardRef2(function ExpandableUncontrolled2({
|
|
805
|
+
isExpanded,
|
|
806
|
+
onChange = noop,
|
|
807
|
+
...props
|
|
808
|
+
}, ref) {
|
|
809
|
+
const [usedIsExpanded, setUsedIsExpanded] = useState5(isExpanded);
|
|
810
|
+
useEffect6(() => {
|
|
811
|
+
setUsedIsExpanded(isExpanded);
|
|
812
|
+
}, [isExpanded]);
|
|
813
|
+
return /* @__PURE__ */ jsx6(
|
|
814
|
+
Expandable,
|
|
815
|
+
{
|
|
816
|
+
...props,
|
|
817
|
+
ref,
|
|
818
|
+
isExpanded: usedIsExpanded,
|
|
819
|
+
onChange: (value) => {
|
|
820
|
+
onChange(value);
|
|
821
|
+
setUsedIsExpanded(value);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
);
|
|
825
|
+
});
|
|
826
|
+
|
|
827
|
+
// src/components/user-action/Input.tsx
|
|
828
|
+
import { forwardRef as forwardRef3, useEffect as useEffect9, useImperativeHandle, useRef as useRef2, useState as useState7 } from "react";
|
|
829
|
+
import clsx6 from "clsx";
|
|
830
|
+
|
|
831
|
+
// src/hooks/useDelay.ts
|
|
832
|
+
import { useEffect as useEffect7, useState as useState6 } from "react";
|
|
833
|
+
var defaultOptions = {
|
|
834
|
+
delay: 3e3,
|
|
835
|
+
disabled: false
|
|
836
|
+
};
|
|
837
|
+
function useDelay(options) {
|
|
838
|
+
const [timer, setTimer] = useState6(void 0);
|
|
839
|
+
const { delay, disabled } = {
|
|
840
|
+
...defaultOptions,
|
|
841
|
+
...options
|
|
842
|
+
};
|
|
843
|
+
const clearTimer = () => {
|
|
844
|
+
clearTimeout(timer);
|
|
845
|
+
setTimer(void 0);
|
|
846
|
+
};
|
|
847
|
+
const restartTimer = (onDelayFinish) => {
|
|
848
|
+
if (disabled) {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
clearTimeout(timer);
|
|
852
|
+
setTimer(setTimeout(() => {
|
|
853
|
+
onDelayFinish();
|
|
854
|
+
setTimer(void 0);
|
|
855
|
+
}, delay));
|
|
856
|
+
};
|
|
857
|
+
useEffect7(() => {
|
|
858
|
+
return () => {
|
|
859
|
+
clearTimeout(timer);
|
|
860
|
+
};
|
|
861
|
+
}, [timer]);
|
|
862
|
+
useEffect7(() => {
|
|
863
|
+
if (disabled) {
|
|
864
|
+
clearTimeout(timer);
|
|
865
|
+
setTimer(void 0);
|
|
866
|
+
}
|
|
867
|
+
}, [disabled, timer]);
|
|
868
|
+
return { restartTimer, clearTimer, hasActiveTimer: !!timer };
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
// src/hooks/useFocusManagement.ts
|
|
872
|
+
import { useCallback as useCallback3 } from "react";
|
|
873
|
+
function useFocusManagement() {
|
|
874
|
+
const getFocusableElements = useCallback3(() => {
|
|
875
|
+
return Array.from(
|
|
876
|
+
document.querySelectorAll(
|
|
877
|
+
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
878
|
+
)
|
|
879
|
+
).filter(
|
|
880
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
881
|
+
);
|
|
882
|
+
}, []);
|
|
883
|
+
const getNextFocusElement = useCallback3(() => {
|
|
548
884
|
const elements = getFocusableElements();
|
|
549
885
|
if (elements.length === 0) {
|
|
550
886
|
return void 0;
|
|
@@ -613,443 +949,131 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
613
949
|
};
|
|
614
950
|
|
|
615
951
|
// src/components/user-action/Input.tsx
|
|
616
|
-
import { jsx as
|
|
617
|
-
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
618
|
-
return
|
|
619
|
-
"px-2 py-1.5 rounded-md border-2",
|
|
620
|
-
{
|
|
621
|
-
"bg-
|
|
622
|
-
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
623
|
-
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
624
|
-
}
|
|
625
|
-
);
|
|
626
|
-
};
|
|
627
|
-
var defaultEditCompleteOptions = {
|
|
628
|
-
onBlur: true,
|
|
629
|
-
afterDelay: true,
|
|
630
|
-
delay: 2500
|
|
631
|
-
};
|
|
632
|
-
var Input = forwardRef2(function Input2({
|
|
633
|
-
id,
|
|
634
|
-
type = "text",
|
|
635
|
-
value,
|
|
636
|
-
label,
|
|
637
|
-
onChange = noop,
|
|
638
|
-
onChangeText = noop,
|
|
639
|
-
onEditCompleted,
|
|
640
|
-
className = "",
|
|
641
|
-
allowEnterComplete = true,
|
|
642
|
-
expanded = true,
|
|
643
|
-
autoFocus = false,
|
|
644
|
-
onBlur,
|
|
645
|
-
editCompleteOptions,
|
|
646
|
-
containerClassName,
|
|
647
|
-
disabled,
|
|
648
|
-
...restProps
|
|
649
|
-
}, forwardedRef) {
|
|
650
|
-
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
651
|
-
const {
|
|
652
|
-
restartTimer,
|
|
653
|
-
clearTimer
|
|
654
|
-
} = useDelay({ delay, disabled: !afterDelay });
|
|
655
|
-
const innerRef = useRef2(null);
|
|
656
|
-
const { focusNext } = useFocusManagement();
|
|
657
|
-
useFocusOnceVisible(innerRef, !autoFocus);
|
|
658
|
-
useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
659
|
-
const handleKeyDown = (e) => {
|
|
660
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
661
|
-
e.preventDefault();
|
|
662
|
-
innerRef.current?.blur();
|
|
663
|
-
focusNext();
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
return /* @__PURE__ */ jsxs4("div", { className: clsx5({ "w-full": expanded }, containerClassName), children: [
|
|
667
|
-
label && /* @__PURE__ */ jsx6(Label, { ...label, htmlFor: id, className: clsx5("mb-1", label.className) }),
|
|
668
|
-
/* @__PURE__ */ jsx6(
|
|
669
|
-
"input",
|
|
670
|
-
{
|
|
671
|
-
...restProps,
|
|
672
|
-
ref: innerRef,
|
|
673
|
-
value,
|
|
674
|
-
id,
|
|
675
|
-
type,
|
|
676
|
-
disabled,
|
|
677
|
-
className: clsx5(getInputClassName({ disabled }), className),
|
|
678
|
-
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
679
|
-
onBlur: (event) => {
|
|
680
|
-
onBlur?.(event);
|
|
681
|
-
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
682
|
-
onEditCompleted(event.target.value);
|
|
683
|
-
clearTimer();
|
|
684
|
-
}
|
|
685
|
-
},
|
|
686
|
-
onChange: (e) => {
|
|
687
|
-
const value2 = e.target.value;
|
|
688
|
-
if (onEditCompleted) {
|
|
689
|
-
restartTimer(() => {
|
|
690
|
-
if (innerRef.current) {
|
|
691
|
-
innerRef.current.blur();
|
|
692
|
-
if (!allowEditCompleteOnBlur) {
|
|
693
|
-
onEditCompleted(value2);
|
|
694
|
-
}
|
|
695
|
-
} else {
|
|
696
|
-
onEditCompleted(value2);
|
|
697
|
-
}
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
onChange(e);
|
|
701
|
-
onChangeText(value2);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
)
|
|
705
|
-
] });
|
|
706
|
-
});
|
|
707
|
-
var FormInput = forwardRef2(function FormInput2({
|
|
708
|
-
id,
|
|
709
|
-
labelText,
|
|
710
|
-
errorText,
|
|
711
|
-
className,
|
|
712
|
-
labelClassName,
|
|
713
|
-
errorClassName,
|
|
714
|
-
containerClassName,
|
|
715
|
-
required,
|
|
716
|
-
disabled,
|
|
717
|
-
...restProps
|
|
718
|
-
}, ref) {
|
|
719
|
-
const input = /* @__PURE__ */ jsx6(
|
|
720
|
-
"input",
|
|
721
|
-
{
|
|
722
|
-
...restProps,
|
|
723
|
-
ref,
|
|
724
|
-
id,
|
|
725
|
-
disabled,
|
|
726
|
-
className: clsx5(
|
|
727
|
-
getInputClassName({ disabled, hasError: !!errorText }),
|
|
728
|
-
className
|
|
729
|
-
)
|
|
730
|
-
}
|
|
731
|
-
);
|
|
732
|
-
return /* @__PURE__ */ jsxs4("div", { className: clsx5("flex flex-col gap-y-1", containerClassName), children: [
|
|
733
|
-
labelText && /* @__PURE__ */ jsxs4("label", { htmlFor: id, className: clsx5("textstyle-label-md", labelClassName), children: [
|
|
734
|
-
labelText,
|
|
735
|
-
required && /* @__PURE__ */ jsx6("span", { className: "text-primary font-bold", children: "*" })
|
|
736
|
-
] }),
|
|
737
|
-
input,
|
|
738
|
-
errorText && /* @__PURE__ */ jsx6("label", { htmlFor: id, className: clsx5("text-negative", errorClassName), children: errorText })
|
|
739
|
-
] });
|
|
740
|
-
});
|
|
741
|
-
|
|
742
|
-
// src/localization/defaults/form.ts
|
|
743
|
-
var formTranslation = {
|
|
744
|
-
en: {
|
|
745
|
-
add: "Add",
|
|
746
|
-
all: "All",
|
|
747
|
-
apply: "Apply",
|
|
748
|
-
back: "Back",
|
|
749
|
-
cancel: "Cancel",
|
|
750
|
-
change: "Change",
|
|
751
|
-
clear: "Clear",
|
|
752
|
-
click: "Click",
|
|
753
|
-
clickToCopy: "Click to Copy",
|
|
754
|
-
close: "Close",
|
|
755
|
-
confirm: "Confirm",
|
|
756
|
-
copy: "Copy",
|
|
757
|
-
copied: "Copied",
|
|
758
|
-
create: "Create",
|
|
759
|
-
decline: "Decline",
|
|
760
|
-
delete: "Delete",
|
|
761
|
-
discard: "Discard",
|
|
762
|
-
discardChanges: "Discard Changes",
|
|
763
|
-
done: "Done",
|
|
764
|
-
edit: "Edit",
|
|
765
|
-
enterText: "Enter text here",
|
|
766
|
-
error: "Error",
|
|
767
|
-
exit: "Exit",
|
|
768
|
-
fieldRequiredError: "This field is required.",
|
|
769
|
-
invalidEmailError: "Please enter a valid email address.",
|
|
770
|
-
less: "Less",
|
|
771
|
-
loading: "Loading",
|
|
772
|
-
maxLengthError: "Maximum length exceeded.",
|
|
773
|
-
minLengthError: "Minimum length not met.",
|
|
774
|
-
more: "More",
|
|
775
|
-
next: "Next",
|
|
776
|
-
no: "No",
|
|
777
|
-
none: "None",
|
|
778
|
-
of: "of",
|
|
779
|
-
optional: "Optional",
|
|
780
|
-
pleaseWait: "Please wait...",
|
|
781
|
-
previous: "Previous",
|
|
782
|
-
remove: "Remove",
|
|
783
|
-
required: "Required",
|
|
784
|
-
reset: "Reset",
|
|
785
|
-
save: "Save",
|
|
786
|
-
saved: "Saved",
|
|
787
|
-
search: "Search",
|
|
788
|
-
select: "Select",
|
|
789
|
-
selectOption: "Select an option",
|
|
790
|
-
show: "Show",
|
|
791
|
-
showMore: "Show more",
|
|
792
|
-
showLess: "Show less",
|
|
793
|
-
submit: "Submit",
|
|
794
|
-
success: "Success",
|
|
795
|
-
update: "Update",
|
|
796
|
-
unsavedChanges: "Unsaved Changes",
|
|
797
|
-
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
798
|
-
yes: "Yes"
|
|
799
|
-
},
|
|
800
|
-
de: {
|
|
801
|
-
add: "Hinzuf\xFCgen",
|
|
802
|
-
all: "Alle",
|
|
803
|
-
apply: "Anwenden",
|
|
804
|
-
back: "Zur\xFCck",
|
|
805
|
-
cancel: "Abbrechen",
|
|
806
|
-
change: "\xC4ndern",
|
|
807
|
-
clear: "L\xF6schen",
|
|
808
|
-
click: "Klicken",
|
|
809
|
-
clickToCopy: "Zum kopieren klicken",
|
|
810
|
-
close: "Schlie\xDFen",
|
|
811
|
-
confirm: "Best\xE4tigen",
|
|
812
|
-
copy: "Kopieren",
|
|
813
|
-
copied: "Kopiert",
|
|
814
|
-
create: "Erstellen",
|
|
815
|
-
decline: "Ablehnen",
|
|
816
|
-
delete: "L\xF6schen",
|
|
817
|
-
discard: "Verwerfen",
|
|
818
|
-
discardChanges: "\xC4nderungen Verwerfen",
|
|
819
|
-
done: "Fertig",
|
|
820
|
-
edit: "Bearbeiten",
|
|
821
|
-
enterText: "Text hier eingeben",
|
|
822
|
-
error: "Fehler",
|
|
823
|
-
exit: "Beenden",
|
|
824
|
-
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
825
|
-
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
826
|
-
less: "Weniger",
|
|
827
|
-
loading: "L\xE4dt",
|
|
828
|
-
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
829
|
-
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
830
|
-
more: "Mehr",
|
|
831
|
-
next: "Weiter",
|
|
832
|
-
no: "Nein",
|
|
833
|
-
none: "Nichts",
|
|
834
|
-
of: "von",
|
|
835
|
-
optional: "Optional",
|
|
836
|
-
pleaseWait: "Bitte warten...",
|
|
837
|
-
previous: "Vorherige",
|
|
838
|
-
remove: "Entfernen",
|
|
839
|
-
required: "Erforderlich",
|
|
840
|
-
reset: "Zur\xFCcksetzen",
|
|
841
|
-
save: "Speichern",
|
|
842
|
-
saved: "Gespeichert",
|
|
843
|
-
search: "Suche",
|
|
844
|
-
select: "Select",
|
|
845
|
-
selectOption: "Option ausw\xE4hlen",
|
|
846
|
-
show: "Anzeigen",
|
|
847
|
-
showMore: "Mehr anzeigen",
|
|
848
|
-
showLess: "Weniger anzeigen",
|
|
849
|
-
submit: "Abschicken",
|
|
850
|
-
success: "Erfolg",
|
|
851
|
-
update: "Update",
|
|
852
|
-
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
853
|
-
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
854
|
-
yes: "Ja"
|
|
855
|
-
}
|
|
856
|
-
};
|
|
857
|
-
|
|
858
|
-
// src/components/user-action/Button.tsx
|
|
859
|
-
import { forwardRef as forwardRef3 } from "react";
|
|
860
|
-
import clsx6 from "clsx";
|
|
861
|
-
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
862
|
-
var ButtonColorUtil = {
|
|
863
|
-
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
864
|
-
text: ["primary", "negative", "neutral"],
|
|
865
|
-
outline: ["primary"]
|
|
866
|
-
};
|
|
867
|
-
var IconButtonUtil = {
|
|
868
|
-
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
869
|
-
};
|
|
870
|
-
var paddingMapping = {
|
|
871
|
-
small: "btn-sm",
|
|
872
|
-
medium: "btn-md",
|
|
873
|
-
large: "btn-lg"
|
|
874
|
-
};
|
|
875
|
-
var iconPaddingMapping = {
|
|
876
|
-
tiny: "icon-btn-xs",
|
|
877
|
-
small: "icon-btn-sm",
|
|
878
|
-
medium: "icon-btn-md",
|
|
879
|
-
large: "icon-btn-lg"
|
|
880
|
-
};
|
|
881
|
-
var ButtonUtil = {
|
|
882
|
-
paddingMapping,
|
|
883
|
-
iconPaddingMapping
|
|
884
|
-
};
|
|
885
|
-
var SolidButton = forwardRef3(function SolidButton2({
|
|
886
|
-
children,
|
|
887
|
-
disabled = false,
|
|
888
|
-
color = "primary",
|
|
889
|
-
size = "medium",
|
|
890
|
-
startIcon,
|
|
891
|
-
endIcon,
|
|
892
|
-
onClick,
|
|
893
|
-
className,
|
|
894
|
-
...restProps
|
|
895
|
-
}, ref) {
|
|
896
|
-
const colorClasses = {
|
|
897
|
-
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
898
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
899
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
900
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
901
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
902
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
903
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
904
|
-
}[color];
|
|
905
|
-
const iconColorClasses = {
|
|
906
|
-
primary: "text-button-solid-primary-icon",
|
|
907
|
-
secondary: "text-button-solid-secondary-icon",
|
|
908
|
-
tertiary: "text-button-solid-tertiary-icon",
|
|
909
|
-
positive: "text-button-solid-positive-icon",
|
|
910
|
-
warning: "text-button-solid-warning-icon",
|
|
911
|
-
negative: "text-button-solid-negative-icon",
|
|
912
|
-
neutral: "text-button-solid-neutral-icon"
|
|
913
|
-
}[color];
|
|
914
|
-
return /* @__PURE__ */ jsxs5(
|
|
915
|
-
"button",
|
|
916
|
-
{
|
|
917
|
-
ref,
|
|
918
|
-
onClick,
|
|
919
|
-
disabled,
|
|
920
|
-
className: clsx6(
|
|
921
|
-
{
|
|
922
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
923
|
-
[clsx6(colorClasses, "hover:brightness-90")]: !disabled
|
|
924
|
-
},
|
|
925
|
-
ButtonUtil.paddingMapping[size],
|
|
926
|
-
className
|
|
927
|
-
),
|
|
928
|
-
...restProps,
|
|
929
|
-
children: [
|
|
930
|
-
startIcon && /* @__PURE__ */ jsx7(
|
|
931
|
-
"span",
|
|
932
|
-
{
|
|
933
|
-
className: clsx6({
|
|
934
|
-
[iconColorClasses]: !disabled,
|
|
935
|
-
[`text-disabled-icon`]: disabled
|
|
936
|
-
}),
|
|
937
|
-
children: startIcon
|
|
938
|
-
}
|
|
939
|
-
),
|
|
940
|
-
children,
|
|
941
|
-
endIcon && /* @__PURE__ */ jsx7(
|
|
942
|
-
"span",
|
|
943
|
-
{
|
|
944
|
-
className: clsx6({
|
|
945
|
-
[iconColorClasses]: !disabled,
|
|
946
|
-
[`text-disabled-icon`]: disabled
|
|
947
|
-
}),
|
|
948
|
-
children: endIcon
|
|
949
|
-
}
|
|
950
|
-
)
|
|
951
|
-
]
|
|
952
|
-
}
|
|
953
|
-
);
|
|
954
|
-
});
|
|
955
|
-
var TextButton = ({
|
|
956
|
-
children,
|
|
957
|
-
disabled = false,
|
|
958
|
-
color = "neutral",
|
|
959
|
-
size = "medium",
|
|
960
|
-
startIcon,
|
|
961
|
-
endIcon,
|
|
962
|
-
onClick,
|
|
963
|
-
className,
|
|
964
|
-
...restProps
|
|
965
|
-
}) => {
|
|
966
|
-
const colorClasses = {
|
|
967
|
-
primary: "bg-transparent text-button-text-primary-text",
|
|
968
|
-
negative: "bg-transparent text-button-text-negative-text",
|
|
969
|
-
neutral: "bg-transparent text-button-text-neutral-text"
|
|
970
|
-
}[color];
|
|
971
|
-
const iconColorClasses = {
|
|
972
|
-
primary: "text-button-text-primary-icon",
|
|
973
|
-
negative: "text-button-text-negative-icon",
|
|
974
|
-
neutral: "text-button-text-neutral-icon"
|
|
975
|
-
}[color];
|
|
976
|
-
return /* @__PURE__ */ jsxs5(
|
|
977
|
-
"button",
|
|
978
|
-
{
|
|
979
|
-
onClick,
|
|
980
|
-
disabled,
|
|
981
|
-
className: clsx6(
|
|
982
|
-
{
|
|
983
|
-
"text-disabled-text cursor-not-allowed": disabled,
|
|
984
|
-
[clsx6(colorClasses, "hover:bg-button-text-hover-background")]: !disabled
|
|
985
|
-
},
|
|
986
|
-
ButtonUtil.paddingMapping[size],
|
|
987
|
-
className
|
|
988
|
-
),
|
|
989
|
-
...restProps,
|
|
990
|
-
children: [
|
|
991
|
-
startIcon && /* @__PURE__ */ jsx7(
|
|
992
|
-
"span",
|
|
993
|
-
{
|
|
994
|
-
className: clsx6({
|
|
995
|
-
[iconColorClasses]: !disabled,
|
|
996
|
-
[`text-disabled-icon`]: disabled
|
|
997
|
-
}),
|
|
998
|
-
children: startIcon
|
|
999
|
-
}
|
|
1000
|
-
),
|
|
1001
|
-
children,
|
|
1002
|
-
endIcon && /* @__PURE__ */ jsx7(
|
|
1003
|
-
"span",
|
|
1004
|
-
{
|
|
1005
|
-
className: clsx6({
|
|
1006
|
-
[iconColorClasses]: !disabled,
|
|
1007
|
-
[`text-disabled-icon`]: disabled
|
|
1008
|
-
}),
|
|
1009
|
-
children: endIcon
|
|
1010
|
-
}
|
|
1011
|
-
)
|
|
1012
|
-
]
|
|
952
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
953
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
954
|
+
return clsx6(
|
|
955
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
956
|
+
{
|
|
957
|
+
"bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
958
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
959
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
1013
960
|
}
|
|
1014
961
|
);
|
|
1015
962
|
};
|
|
1016
|
-
var
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
963
|
+
var defaultEditCompleteOptions = {
|
|
964
|
+
onBlur: true,
|
|
965
|
+
afterDelay: true,
|
|
966
|
+
delay: 2500
|
|
967
|
+
};
|
|
968
|
+
var Input = forwardRef3(function Input2({
|
|
969
|
+
id,
|
|
970
|
+
type = "text",
|
|
971
|
+
value,
|
|
972
|
+
label,
|
|
973
|
+
onChange = noop,
|
|
974
|
+
onChangeText = noop,
|
|
975
|
+
onEditCompleted,
|
|
976
|
+
className = "",
|
|
977
|
+
allowEnterComplete = true,
|
|
978
|
+
expanded = true,
|
|
979
|
+
autoFocus = false,
|
|
980
|
+
onBlur,
|
|
981
|
+
editCompleteOptions,
|
|
982
|
+
containerClassName,
|
|
983
|
+
disabled,
|
|
984
|
+
...restProps
|
|
985
|
+
}, forwardedRef) {
|
|
986
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
987
|
+
const {
|
|
988
|
+
restartTimer,
|
|
989
|
+
clearTimer
|
|
990
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
991
|
+
const innerRef = useRef2(null);
|
|
992
|
+
const { focusNext } = useFocusManagement();
|
|
993
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
994
|
+
useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
995
|
+
const handleKeyDown = (e) => {
|
|
996
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
997
|
+
e.preventDefault();
|
|
998
|
+
innerRef.current?.blur();
|
|
999
|
+
focusNext();
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
return /* @__PURE__ */ jsxs5("div", { className: clsx6({ "w-full": expanded }, containerClassName), children: [
|
|
1003
|
+
label && /* @__PURE__ */ jsx7(Label, { ...label, htmlFor: id, className: clsx6("mb-1", label.className) }),
|
|
1004
|
+
/* @__PURE__ */ jsx7(
|
|
1005
|
+
"input",
|
|
1006
|
+
{
|
|
1007
|
+
...restProps,
|
|
1008
|
+
ref: innerRef,
|
|
1009
|
+
value,
|
|
1010
|
+
id,
|
|
1011
|
+
type,
|
|
1012
|
+
disabled,
|
|
1013
|
+
className: clsx6(getInputClassName({ disabled }), className),
|
|
1014
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
1015
|
+
onBlur: (event) => {
|
|
1016
|
+
onBlur?.(event);
|
|
1017
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
1018
|
+
onEditCompleted(event.target.value);
|
|
1019
|
+
clearTimer();
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
1022
|
+
onChange: (e) => {
|
|
1023
|
+
const value2 = e.target.value;
|
|
1024
|
+
if (onEditCompleted) {
|
|
1025
|
+
restartTimer(() => {
|
|
1026
|
+
if (innerRef.current) {
|
|
1027
|
+
innerRef.current.blur();
|
|
1028
|
+
if (!allowEditCompleteOnBlur) {
|
|
1029
|
+
onEditCompleted(value2);
|
|
1030
|
+
}
|
|
1031
|
+
} else {
|
|
1032
|
+
onEditCompleted(value2);
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
onChange(e);
|
|
1037
|
+
onChangeText(value2);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
)
|
|
1041
|
+
] });
|
|
1042
|
+
});
|
|
1043
|
+
var FormInput = forwardRef3(function FormInput2({
|
|
1044
|
+
id,
|
|
1045
|
+
labelText,
|
|
1046
|
+
errorText,
|
|
1021
1047
|
className,
|
|
1048
|
+
labelClassName,
|
|
1049
|
+
errorClassName,
|
|
1050
|
+
containerClassName,
|
|
1051
|
+
required,
|
|
1052
|
+
disabled,
|
|
1022
1053
|
...restProps
|
|
1023
|
-
})
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
1027
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
1028
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
1029
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
1030
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
1031
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
1032
|
-
transparent: "bg-transparent"
|
|
1033
|
-
}[color];
|
|
1034
|
-
return /* @__PURE__ */ jsx7(
|
|
1035
|
-
"button",
|
|
1054
|
+
}, ref) {
|
|
1055
|
+
const input = /* @__PURE__ */ jsx7(
|
|
1056
|
+
"input",
|
|
1036
1057
|
{
|
|
1058
|
+
...restProps,
|
|
1059
|
+
ref,
|
|
1060
|
+
id,
|
|
1037
1061
|
disabled,
|
|
1038
1062
|
className: clsx6(
|
|
1039
|
-
{
|
|
1040
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
1041
|
-
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
1042
|
-
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
1043
|
-
[clsx6(colorClasses, "hover:brightness-90")]: !disabled
|
|
1044
|
-
},
|
|
1045
|
-
ButtonUtil.iconPaddingMapping[size],
|
|
1063
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
1046
1064
|
className
|
|
1047
|
-
)
|
|
1048
|
-
...restProps,
|
|
1049
|
-
children
|
|
1065
|
+
)
|
|
1050
1066
|
}
|
|
1051
1067
|
);
|
|
1052
|
-
|
|
1068
|
+
return /* @__PURE__ */ jsxs5("div", { className: clsx6("flex flex-col gap-y-1", containerClassName), children: [
|
|
1069
|
+
labelText && /* @__PURE__ */ jsxs5("label", { htmlFor: id, className: clsx6("textstyle-label-md", labelClassName), children: [
|
|
1070
|
+
labelText,
|
|
1071
|
+
required && /* @__PURE__ */ jsx7("span", { className: "text-primary font-bold", children: "*" })
|
|
1072
|
+
] }),
|
|
1073
|
+
input,
|
|
1074
|
+
errorText && /* @__PURE__ */ jsx7("label", { htmlFor: id, className: clsx6("text-negative", errorClassName), children: errorText })
|
|
1075
|
+
] });
|
|
1076
|
+
});
|
|
1053
1077
|
|
|
1054
1078
|
// src/components/user-action/SearchBar.tsx
|
|
1055
1079
|
import { Search } from "lucide-react";
|
|
@@ -1143,96 +1167,12 @@ var useSearch = ({
|
|
|
1143
1167
|
};
|
|
1144
1168
|
};
|
|
1145
1169
|
|
|
1146
|
-
// src/components/user-action/Select.tsx
|
|
1147
|
-
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1148
|
-
var SelectTile = ({
|
|
1149
|
-
className,
|
|
1150
|
-
disabledClassName,
|
|
1151
|
-
title,
|
|
1152
|
-
...restProps
|
|
1153
|
-
}) => {
|
|
1154
|
-
return /* @__PURE__ */ jsx9(
|
|
1155
|
-
Tile,
|
|
1156
|
-
{
|
|
1157
|
-
...restProps,
|
|
1158
|
-
className: clsx8("px-2 py-1 rounded-md", className),
|
|
1159
|
-
disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
|
|
1160
|
-
title: { ...title, className: title.className ?? "font-semibold" }
|
|
1161
|
-
}
|
|
1162
|
-
);
|
|
1163
|
-
};
|
|
1164
|
-
|
|
1165
|
-
// src/components/layout-and-navigation/Chip.tsx
|
|
1166
|
-
import clsx9 from "clsx";
|
|
1167
|
-
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1168
|
-
var Chip = ({
|
|
1169
|
-
children,
|
|
1170
|
-
trailingIcon,
|
|
1171
|
-
color = "default",
|
|
1172
|
-
variant = "normal",
|
|
1173
|
-
className = "",
|
|
1174
|
-
...restProps
|
|
1175
|
-
}) => {
|
|
1176
|
-
const colorMapping = {
|
|
1177
|
-
default: "text-tag-default-text bg-tag-default-background",
|
|
1178
|
-
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
1179
|
-
red: "text-tag-red-text bg-tag-red-background",
|
|
1180
|
-
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
1181
|
-
green: "text-tag-green-text bg-tag-green-background",
|
|
1182
|
-
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
1183
|
-
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
1184
|
-
}[color];
|
|
1185
|
-
const colorMappingIcon = {
|
|
1186
|
-
default: "text-tag-default-icon",
|
|
1187
|
-
dark: "text-tag-dark-icon",
|
|
1188
|
-
red: "text-tag-red-icon",
|
|
1189
|
-
yellow: "text-tag-yellow-icon",
|
|
1190
|
-
green: "text-tag-green-icon",
|
|
1191
|
-
blue: "text-tag-blue-icon",
|
|
1192
|
-
pink: "text-tag-pink-icon"
|
|
1193
|
-
}[color];
|
|
1194
|
-
return /* @__PURE__ */ jsxs8(
|
|
1195
|
-
"div",
|
|
1196
|
-
{
|
|
1197
|
-
...restProps,
|
|
1198
|
-
className: clsx9(
|
|
1199
|
-
`row w-fit px-2 py-1`,
|
|
1200
|
-
colorMapping,
|
|
1201
|
-
{
|
|
1202
|
-
"rounded-md": variant === "normal",
|
|
1203
|
-
"rounded-full": variant === "fullyRounded"
|
|
1204
|
-
},
|
|
1205
|
-
className
|
|
1206
|
-
),
|
|
1207
|
-
children: [
|
|
1208
|
-
children,
|
|
1209
|
-
trailingIcon && /* @__PURE__ */ jsx10("span", { className: colorMappingIcon, children: trailingIcon })
|
|
1210
|
-
]
|
|
1211
|
-
}
|
|
1212
|
-
);
|
|
1213
|
-
};
|
|
1214
|
-
var ChipList = ({
|
|
1215
|
-
list,
|
|
1216
|
-
className = ""
|
|
1217
|
-
}) => {
|
|
1218
|
-
return /* @__PURE__ */ jsx10("div", { className: clsx9("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx10(
|
|
1219
|
-
Chip,
|
|
1220
|
-
{
|
|
1221
|
-
...value,
|
|
1222
|
-
color: value.color ?? "dark",
|
|
1223
|
-
variant: value.variant ?? "normal",
|
|
1224
|
-
children: value.children
|
|
1225
|
-
},
|
|
1226
|
-
index
|
|
1227
|
-
)) });
|
|
1228
|
-
};
|
|
1229
|
-
|
|
1230
1170
|
// src/components/user-action/Checkbox.tsx
|
|
1231
|
-
import { useState as
|
|
1171
|
+
import { useState as useState9 } from "react";
|
|
1232
1172
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
1233
|
-
import { Check
|
|
1234
|
-
import
|
|
1235
|
-
import { jsx as
|
|
1173
|
+
import { Check, Minus } from "lucide-react";
|
|
1174
|
+
import clsx8 from "clsx";
|
|
1175
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1236
1176
|
var checkboxSizeMapping = {
|
|
1237
1177
|
small: "size-5",
|
|
1238
1178
|
medium: "size-6",
|
|
@@ -1268,33 +1208,92 @@ var Checkbox = ({
|
|
|
1268
1208
|
const newValue = checked === "indeterminate" ? false : !checked;
|
|
1269
1209
|
propagateChange(newValue);
|
|
1270
1210
|
};
|
|
1271
|
-
return /* @__PURE__ */
|
|
1272
|
-
/* @__PURE__ */
|
|
1211
|
+
return /* @__PURE__ */ jsxs7("div", { className: clsx8("group flex-row-2 items-center cursor-pointer", containerClassName), onClick: changeValue, children: [
|
|
1212
|
+
/* @__PURE__ */ jsx9(
|
|
1273
1213
|
CheckboxPrimitive.Root,
|
|
1274
1214
|
{
|
|
1275
1215
|
onCheckedChange: propagateChange,
|
|
1276
1216
|
checked,
|
|
1277
1217
|
disabled,
|
|
1278
1218
|
id,
|
|
1279
|
-
className:
|
|
1219
|
+
className: clsx8(usedSizeClass, `items-center border-2 rounded outline-none `, {
|
|
1280
1220
|
"text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
|
|
1281
1221
|
"focus:border-primary group-hover:border-primary ": !disabled,
|
|
1282
|
-
"bg-
|
|
1222
|
+
"bg-input-background": !disabled && !checked,
|
|
1283
1223
|
"bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
|
|
1284
1224
|
}, className),
|
|
1285
|
-
children: /* @__PURE__ */
|
|
1286
|
-
checked === true && /* @__PURE__ */
|
|
1287
|
-
checked === "indeterminate" && /* @__PURE__ */
|
|
1225
|
+
children: /* @__PURE__ */ jsxs7(CheckboxPrimitive.Indicator, { children: [
|
|
1226
|
+
checked === true && /* @__PURE__ */ jsx9(Check, { className: innerIconSize }),
|
|
1227
|
+
checked === "indeterminate" && /* @__PURE__ */ jsx9(Minus, { className: innerIconSize })
|
|
1288
1228
|
] })
|
|
1289
1229
|
}
|
|
1290
1230
|
),
|
|
1291
|
-
label && /* @__PURE__ */
|
|
1231
|
+
label && /* @__PURE__ */ jsx9(Label, { ...label, className: clsx8(label.className), htmlFor: id })
|
|
1292
1232
|
] });
|
|
1293
1233
|
};
|
|
1294
1234
|
|
|
1295
1235
|
// src/components/user-action/MultiSelect.tsx
|
|
1296
1236
|
import { Plus } from "lucide-react";
|
|
1297
|
-
|
|
1237
|
+
|
|
1238
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
1239
|
+
import clsx9 from "clsx";
|
|
1240
|
+
import { Check as Check2 } from "lucide-react";
|
|
1241
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1242
|
+
var Tile = ({
|
|
1243
|
+
title,
|
|
1244
|
+
titleClassName,
|
|
1245
|
+
description,
|
|
1246
|
+
descriptionClassName,
|
|
1247
|
+
onClick,
|
|
1248
|
+
isSelected = false,
|
|
1249
|
+
disabled = false,
|
|
1250
|
+
prefix,
|
|
1251
|
+
suffix,
|
|
1252
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
1253
|
+
selectedClassName = "bg-primary/20",
|
|
1254
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
1255
|
+
className
|
|
1256
|
+
}) => {
|
|
1257
|
+
return /* @__PURE__ */ jsxs8(
|
|
1258
|
+
"div",
|
|
1259
|
+
{
|
|
1260
|
+
className: clsx9(
|
|
1261
|
+
"flex-row-2 w-full items-center",
|
|
1262
|
+
{
|
|
1263
|
+
[normalClassName]: onClick && !disabled,
|
|
1264
|
+
[selectedClassName]: isSelected && !disabled,
|
|
1265
|
+
[disabledClassName]: disabled
|
|
1266
|
+
},
|
|
1267
|
+
className
|
|
1268
|
+
),
|
|
1269
|
+
onClick: disabled ? void 0 : onClick,
|
|
1270
|
+
children: [
|
|
1271
|
+
prefix,
|
|
1272
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex-col-0 w-full", children: [
|
|
1273
|
+
/* @__PURE__ */ jsx10("span", { className: clsx9(titleClassName ?? "textstyle-title-normal"), children: title }),
|
|
1274
|
+
!!description && /* @__PURE__ */ jsx10("span", { className: clsx9(descriptionClassName ?? "textstyle-description"), children: description })
|
|
1275
|
+
] }),
|
|
1276
|
+
suffix ?? (isSelected ? /* @__PURE__ */ jsx10(Check2, { size: 24 }) : void 0)
|
|
1277
|
+
]
|
|
1278
|
+
}
|
|
1279
|
+
);
|
|
1280
|
+
};
|
|
1281
|
+
var ListTile = ({
|
|
1282
|
+
...props
|
|
1283
|
+
}) => {
|
|
1284
|
+
return /* @__PURE__ */ jsx10(
|
|
1285
|
+
Tile,
|
|
1286
|
+
{
|
|
1287
|
+
...props,
|
|
1288
|
+
titleClassName: props.titleClassName ?? "font-semibold",
|
|
1289
|
+
className: clsx9("px-2 py-1 rounded-md", props.className),
|
|
1290
|
+
disabledClassName: props.disabledClassName ?? "text-disabled-text cursor-not-allowed"
|
|
1291
|
+
}
|
|
1292
|
+
);
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
// src/components/user-action/MultiSelect.tsx
|
|
1296
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1298
1297
|
var defaultMultiSelectTranslation = {
|
|
1299
1298
|
en: {
|
|
1300
1299
|
selected: `{{amount}} selected`
|
|
@@ -1321,52 +1320,64 @@ var MultiSelect = ({
|
|
|
1321
1320
|
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
1322
1321
|
const { result, search, setSearch } = useSearch({
|
|
1323
1322
|
list: options,
|
|
1324
|
-
searchMapping:
|
|
1323
|
+
searchMapping: useCallback5((item) => item.searchTags, []),
|
|
1325
1324
|
...searchOptions
|
|
1326
1325
|
});
|
|
1327
1326
|
const selectedItems = options.filter((value) => value.selected);
|
|
1328
1327
|
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|
|
1329
|
-
return /* @__PURE__ */
|
|
1330
|
-
label && /* @__PURE__ */
|
|
1328
|
+
return /* @__PURE__ */ jsxs9("div", { className: clsx10(className), children: [
|
|
1329
|
+
label && /* @__PURE__ */ jsx11(
|
|
1331
1330
|
Label,
|
|
1332
1331
|
{
|
|
1333
1332
|
...label,
|
|
1334
1333
|
htmlFor: label.name,
|
|
1335
|
-
className:
|
|
1334
|
+
className: clsx10(" mb-1", label.className),
|
|
1336
1335
|
labelType: label.labelType ?? "labelBig"
|
|
1337
1336
|
}
|
|
1338
1337
|
),
|
|
1339
|
-
/* @__PURE__ */
|
|
1338
|
+
/* @__PURE__ */ jsx11(
|
|
1340
1339
|
Menu,
|
|
1341
1340
|
{
|
|
1342
1341
|
...menuProps,
|
|
1343
|
-
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */
|
|
1342
|
+
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ jsx11(
|
|
1344
1343
|
"button",
|
|
1345
1344
|
{
|
|
1346
1345
|
ref,
|
|
1347
|
-
className:
|
|
1348
|
-
"btn-md justify-between w-full border-2 h-auto",
|
|
1346
|
+
className: clsx10(
|
|
1347
|
+
"group btn-md justify-between w-full border-2 h-auto",
|
|
1349
1348
|
{
|
|
1350
1349
|
"min-h-14": useChipDisplay,
|
|
1351
|
-
"bg-
|
|
1350
|
+
"bg-input-background text-input-text hover:border-primary": !disabled,
|
|
1352
1351
|
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": disabled
|
|
1353
1352
|
},
|
|
1354
1353
|
triggerClassName
|
|
1355
1354
|
),
|
|
1356
1355
|
onClick: toggleOpen,
|
|
1357
1356
|
disabled,
|
|
1358
|
-
children: useChipDisplay ? /* @__PURE__ */
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1357
|
+
children: useChipDisplay ? /* @__PURE__ */ jsx11(Fragment2, { children: isShowingHint ? /* @__PURE__ */ jsx11(
|
|
1358
|
+
"div",
|
|
1359
|
+
{
|
|
1360
|
+
className: clsx10(
|
|
1361
|
+
"icon-btn-sm ",
|
|
1362
|
+
{
|
|
1363
|
+
"bg-button-solid-neutral-background text-button-solid-neutral-text hover:brightness-90 group-hover:brightness-90": !disabled,
|
|
1364
|
+
"bg-disabled-background text-disabled-text": disabled
|
|
1365
|
+
}
|
|
1366
|
+
),
|
|
1367
|
+
children: /* @__PURE__ */ jsx11(Plus, {})
|
|
1368
|
+
}
|
|
1369
|
+
) : /* @__PURE__ */ jsx11(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1370
|
+
!isShowingHint && /* @__PURE__ */ jsx11("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
|
|
1371
|
+
isShowingHint && /* @__PURE__ */ jsx11("span", { className: clsx10("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
|
|
1372
|
+
/* @__PURE__ */ jsx11(ExpansionIcon, { isExpanded: isOpen })
|
|
1362
1373
|
] })
|
|
1363
1374
|
}
|
|
1364
1375
|
),
|
|
1365
|
-
menuClassName:
|
|
1376
|
+
menuClassName: clsx10("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
|
|
1366
1377
|
children: (bag) => {
|
|
1367
1378
|
const { close } = bag;
|
|
1368
|
-
return /* @__PURE__ */
|
|
1369
|
-
!searchOptions?.disabled && /* @__PURE__ */
|
|
1379
|
+
return /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1380
|
+
!searchOptions?.disabled && /* @__PURE__ */ jsx11(
|
|
1370
1381
|
SearchBar,
|
|
1371
1382
|
{
|
|
1372
1383
|
value: search,
|
|
@@ -1374,7 +1385,7 @@ var MultiSelect = ({
|
|
|
1374
1385
|
autoFocus: true
|
|
1375
1386
|
}
|
|
1376
1387
|
),
|
|
1377
|
-
/* @__PURE__ */
|
|
1388
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-col-2 overflow-y-auto", children: [
|
|
1378
1389
|
result.map((option, index) => {
|
|
1379
1390
|
const update = () => {
|
|
1380
1391
|
onChange(options.map((value) => value.value === option.value ? {
|
|
@@ -1382,10 +1393,10 @@ var MultiSelect = ({
|
|
|
1382
1393
|
selected: !value.selected
|
|
1383
1394
|
} : value));
|
|
1384
1395
|
};
|
|
1385
|
-
return /* @__PURE__ */
|
|
1386
|
-
|
|
1396
|
+
return /* @__PURE__ */ jsx11(
|
|
1397
|
+
ListTile,
|
|
1387
1398
|
{
|
|
1388
|
-
prefix: /* @__PURE__ */
|
|
1399
|
+
prefix: /* @__PURE__ */ jsx11(
|
|
1389
1400
|
Checkbox,
|
|
1390
1401
|
{
|
|
1391
1402
|
checked: option.selected,
|
|
@@ -1394,7 +1405,7 @@ var MultiSelect = ({
|
|
|
1394
1405
|
disabled: option.disabled
|
|
1395
1406
|
}
|
|
1396
1407
|
),
|
|
1397
|
-
title:
|
|
1408
|
+
title: option.label,
|
|
1398
1409
|
onClick: update,
|
|
1399
1410
|
disabled: option.disabled
|
|
1400
1411
|
},
|
|
@@ -1403,9 +1414,9 @@ var MultiSelect = ({
|
|
|
1403
1414
|
}),
|
|
1404
1415
|
additionalItems && additionalItems({ ...bag, search })
|
|
1405
1416
|
] }),
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-row-2 justify-between", children: [
|
|
1418
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-row-2", children: [
|
|
1419
|
+
/* @__PURE__ */ jsx11(
|
|
1409
1420
|
SolidButton,
|
|
1410
1421
|
{
|
|
1411
1422
|
color: "neutral",
|
|
@@ -1420,7 +1431,7 @@ var MultiSelect = ({
|
|
|
1420
1431
|
children: translation("all")
|
|
1421
1432
|
}
|
|
1422
1433
|
),
|
|
1423
|
-
/* @__PURE__ */
|
|
1434
|
+
/* @__PURE__ */ jsx11(
|
|
1424
1435
|
SolidButton,
|
|
1425
1436
|
{
|
|
1426
1437
|
color: "neutral",
|
|
@@ -1435,7 +1446,7 @@ var MultiSelect = ({
|
|
|
1435
1446
|
}
|
|
1436
1447
|
)
|
|
1437
1448
|
] }),
|
|
1438
|
-
/* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ jsx11(SolidButton, { size: "small", onClick: close, children: "Done" })
|
|
1439
1450
|
] })
|
|
1440
1451
|
] });
|
|
1441
1452
|
}
|
|
@@ -1446,8 +1457,8 @@ var MultiSelect = ({
|
|
|
1446
1457
|
|
|
1447
1458
|
// src/components/properties/PropertyBase.tsx
|
|
1448
1459
|
import { AlertTriangle } from "lucide-react";
|
|
1449
|
-
import
|
|
1450
|
-
import { jsx as
|
|
1460
|
+
import clsx11 from "clsx";
|
|
1461
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1451
1462
|
var PropertyBase = ({
|
|
1452
1463
|
overwriteTranslation,
|
|
1453
1464
|
name,
|
|
@@ -1461,11 +1472,11 @@ var PropertyBase = ({
|
|
|
1461
1472
|
}) => {
|
|
1462
1473
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
1463
1474
|
const requiredAndNoValue = softRequired && !hasValue;
|
|
1464
|
-
return /* @__PURE__ */
|
|
1465
|
-
/* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ jsxs10("div", { className: clsx11("flex-row-0 group", className), children: [
|
|
1476
|
+
/* @__PURE__ */ jsxs10(
|
|
1466
1477
|
"div",
|
|
1467
1478
|
{
|
|
1468
|
-
className:
|
|
1479
|
+
className: clsx11(
|
|
1469
1480
|
"flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center rounded-l-xl border-2 border-r-0",
|
|
1470
1481
|
{
|
|
1471
1482
|
"bg-property-title-background text-property-title-text group-hover:border-primary": !requiredAndNoValue,
|
|
@@ -1474,31 +1485,31 @@ var PropertyBase = ({
|
|
|
1474
1485
|
className
|
|
1475
1486
|
),
|
|
1476
1487
|
children: [
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
/* @__PURE__ */
|
|
1488
|
+
/* @__PURE__ */ jsx12("div", { className: "max-w-6 min-w-6 text-text-primary", children: icon }),
|
|
1489
|
+
/* @__PURE__ */ jsx12("span", { className: "font-semibold", children: name })
|
|
1479
1490
|
]
|
|
1480
1491
|
}
|
|
1481
1492
|
),
|
|
1482
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ jsxs10(
|
|
1483
1494
|
"div",
|
|
1484
1495
|
{
|
|
1485
|
-
className:
|
|
1496
|
+
className: clsx11(
|
|
1486
1497
|
"flex-row-2 grow px-3 py-2 justify-between items-center rounded-r-xl border-2 border-l-0 min-h-15",
|
|
1487
1498
|
{
|
|
1488
|
-
"bg-
|
|
1499
|
+
"bg-input-background text-input-text group-hover:border-primary": !requiredAndNoValue,
|
|
1489
1500
|
"bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
1490
1501
|
},
|
|
1491
1502
|
className
|
|
1492
1503
|
),
|
|
1493
1504
|
children: [
|
|
1494
1505
|
input({ softRequired, hasValue }),
|
|
1495
|
-
requiredAndNoValue && /* @__PURE__ */
|
|
1496
|
-
onRemove && hasValue && /* @__PURE__ */
|
|
1506
|
+
requiredAndNoValue && /* @__PURE__ */ jsx12("div", { className: "text-warning", children: /* @__PURE__ */ jsx12(AlertTriangle, { size: 24 }) }),
|
|
1507
|
+
onRemove && hasValue && /* @__PURE__ */ jsx12(
|
|
1497
1508
|
TextButton,
|
|
1498
1509
|
{
|
|
1499
1510
|
onClick: onRemove,
|
|
1500
1511
|
color: "negative",
|
|
1501
|
-
className:
|
|
1512
|
+
className: clsx11("items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
1502
1513
|
disabled: !hasValue || readOnly,
|
|
1503
1514
|
children: translation("remove")
|
|
1504
1515
|
}
|
|
@@ -1510,7 +1521,7 @@ var PropertyBase = ({
|
|
|
1510
1521
|
};
|
|
1511
1522
|
|
|
1512
1523
|
// src/components/properties/MultiSelectProperty.tsx
|
|
1513
|
-
import { jsx as
|
|
1524
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1514
1525
|
var MultiSelectProperty = ({
|
|
1515
1526
|
overwriteTranslation,
|
|
1516
1527
|
options,
|
|
@@ -1523,7 +1534,7 @@ var MultiSelectProperty = ({
|
|
|
1523
1534
|
}) => {
|
|
1524
1535
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
1525
1536
|
const hasValue = options.some((value) => value.selected);
|
|
1526
|
-
return /* @__PURE__ */
|
|
1537
|
+
return /* @__PURE__ */ jsx13(
|
|
1527
1538
|
PropertyBase,
|
|
1528
1539
|
{
|
|
1529
1540
|
name,
|
|
@@ -1531,12 +1542,12 @@ var MultiSelectProperty = ({
|
|
|
1531
1542
|
readOnly,
|
|
1532
1543
|
softRequired,
|
|
1533
1544
|
hasValue,
|
|
1534
|
-
icon: /* @__PURE__ */
|
|
1535
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */
|
|
1545
|
+
icon: /* @__PURE__ */ jsx13(List, { size: 24 }),
|
|
1546
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ jsx13(
|
|
1536
1547
|
MultiSelect,
|
|
1537
1548
|
{
|
|
1538
1549
|
...multiSelectProps,
|
|
1539
|
-
className:
|
|
1550
|
+
className: clsx12("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
1540
1551
|
options,
|
|
1541
1552
|
disabled: readOnly,
|
|
1542
1553
|
useChipDisplay: true,
|
|
@@ -1549,11 +1560,11 @@ var MultiSelectProperty = ({
|
|
|
1549
1560
|
if (!onAddNew && !search.trim()) {
|
|
1550
1561
|
return void 0;
|
|
1551
1562
|
}
|
|
1552
|
-
return /* @__PURE__ */
|
|
1553
|
-
|
|
1563
|
+
return /* @__PURE__ */ jsx13(
|
|
1564
|
+
ListTile,
|
|
1554
1565
|
{
|
|
1555
|
-
prefix: /* @__PURE__ */
|
|
1556
|
-
title:
|
|
1566
|
+
prefix: /* @__PURE__ */ jsx13(Plus2, {}),
|
|
1567
|
+
title: `${translation("add")} ${search.trim()}`,
|
|
1557
1568
|
onClick: () => {
|
|
1558
1569
|
onAddNew(search);
|
|
1559
1570
|
close();
|
|
@@ -1562,7 +1573,7 @@ var MultiSelectProperty = ({
|
|
|
1562
1573
|
}
|
|
1563
1574
|
);
|
|
1564
1575
|
},
|
|
1565
|
-
triggerClassName:
|
|
1576
|
+
triggerClassName: clsx12(
|
|
1566
1577
|
"!border-none !p-0 !min-h-10",
|
|
1567
1578
|
{
|
|
1568
1579
|
"!bg-warning !text-surface-warning": softRequired2 && !hasValue,
|