@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/user-action/MultiSelect.tsx
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { useEffect as
|
|
2
|
+
import { useCallback as useCallback5 } from "react";
|
|
3
|
+
import { useEffect as useEffect11, useState as useState10 } from "react";
|
|
4
4
|
|
|
5
5
|
// src/localization/LanguageProvider.tsx
|
|
6
6
|
import { createContext, useContext, useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -90,7 +90,7 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
// src/components/user-action/MultiSelect.tsx
|
|
93
|
-
import
|
|
93
|
+
import clsx10 from "clsx";
|
|
94
94
|
|
|
95
95
|
// src/components/user-action/Label.tsx
|
|
96
96
|
import clsx from "clsx";
|
|
@@ -110,169 +110,331 @@ var Label = ({
|
|
|
110
110
|
return /* @__PURE__ */ jsx2("label", { ...props, className: clsx(styleMapping[labelType], className), children: children ? children : name });
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
// src/components/user-action/
|
|
114
|
-
import {
|
|
115
|
-
import { useEffect as useEffect11, useState as useState9 } from "react";
|
|
116
|
-
import clsx8 from "clsx";
|
|
117
|
-
|
|
118
|
-
// src/components/layout-and-navigation/Tile.tsx
|
|
113
|
+
// src/components/user-action/Button.tsx
|
|
114
|
+
import { forwardRef } from "react";
|
|
119
115
|
import clsx2 from "clsx";
|
|
120
|
-
import { Check } from "lucide-react";
|
|
121
116
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
117
|
+
var ButtonColorUtil = {
|
|
118
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
119
|
+
text: ["primary", "negative", "neutral"],
|
|
120
|
+
outline: ["primary"]
|
|
121
|
+
};
|
|
122
|
+
var IconButtonUtil = {
|
|
123
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
124
|
+
};
|
|
125
|
+
var paddingMapping = {
|
|
126
|
+
small: "btn-sm",
|
|
127
|
+
medium: "btn-md",
|
|
128
|
+
large: "btn-lg"
|
|
129
|
+
};
|
|
130
|
+
var iconPaddingMapping = {
|
|
131
|
+
tiny: "icon-btn-xs",
|
|
132
|
+
small: "icon-btn-sm",
|
|
133
|
+
medium: "icon-btn-md",
|
|
134
|
+
large: "icon-btn-lg"
|
|
135
|
+
};
|
|
136
|
+
var ButtonUtil = {
|
|
137
|
+
paddingMapping,
|
|
138
|
+
iconPaddingMapping
|
|
139
|
+
};
|
|
140
|
+
var SolidButton = forwardRef(function SolidButton2({
|
|
141
|
+
children,
|
|
127
142
|
disabled = false,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
className
|
|
134
|
-
|
|
143
|
+
color = "primary",
|
|
144
|
+
size = "medium",
|
|
145
|
+
startIcon,
|
|
146
|
+
endIcon,
|
|
147
|
+
onClick,
|
|
148
|
+
className,
|
|
149
|
+
...restProps
|
|
150
|
+
}, ref) {
|
|
151
|
+
const colorClasses = {
|
|
152
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
153
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
154
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
155
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
156
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
157
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
158
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
159
|
+
}[color];
|
|
160
|
+
const iconColorClasses = {
|
|
161
|
+
primary: "text-button-solid-primary-icon",
|
|
162
|
+
secondary: "text-button-solid-secondary-icon",
|
|
163
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
164
|
+
positive: "text-button-solid-positive-icon",
|
|
165
|
+
warning: "text-button-solid-warning-icon",
|
|
166
|
+
negative: "text-button-solid-negative-icon",
|
|
167
|
+
neutral: "text-button-solid-neutral-icon"
|
|
168
|
+
}[color];
|
|
135
169
|
return /* @__PURE__ */ jsxs(
|
|
136
|
-
"
|
|
170
|
+
"button",
|
|
137
171
|
{
|
|
172
|
+
ref,
|
|
173
|
+
onClick,
|
|
174
|
+
disabled,
|
|
138
175
|
className: clsx2(
|
|
139
|
-
"
|
|
176
|
+
"font-semibold",
|
|
140
177
|
{
|
|
141
|
-
|
|
142
|
-
[
|
|
143
|
-
[disabledClassName]: disabled
|
|
178
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
179
|
+
[clsx2(colorClasses, "hover:brightness-90")]: !disabled
|
|
144
180
|
},
|
|
181
|
+
ButtonUtil.paddingMapping[size],
|
|
145
182
|
className
|
|
146
183
|
),
|
|
147
|
-
|
|
184
|
+
...restProps,
|
|
148
185
|
children: [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
186
|
+
startIcon && /* @__PURE__ */ jsx3(
|
|
187
|
+
"span",
|
|
188
|
+
{
|
|
189
|
+
className: clsx2({
|
|
190
|
+
[iconColorClasses]: !disabled,
|
|
191
|
+
[`text-disabled-icon`]: disabled
|
|
192
|
+
}),
|
|
193
|
+
children: startIcon
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
children,
|
|
197
|
+
endIcon && /* @__PURE__ */ jsx3(
|
|
198
|
+
"span",
|
|
199
|
+
{
|
|
200
|
+
className: clsx2({
|
|
201
|
+
[iconColorClasses]: !disabled,
|
|
202
|
+
[`text-disabled-icon`]: disabled
|
|
203
|
+
}),
|
|
204
|
+
children: endIcon
|
|
205
|
+
}
|
|
206
|
+
)
|
|
155
207
|
]
|
|
156
208
|
}
|
|
157
209
|
);
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
210
|
+
});
|
|
211
|
+
var IconButton = ({
|
|
212
|
+
children,
|
|
213
|
+
disabled = false,
|
|
214
|
+
color = "primary",
|
|
215
|
+
size = "medium",
|
|
216
|
+
className,
|
|
217
|
+
...restProps
|
|
218
|
+
}) => {
|
|
219
|
+
const colorClasses = {
|
|
220
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
221
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
222
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
223
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
224
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
225
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
226
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
227
|
+
transparent: "bg-transparent"
|
|
228
|
+
}[color];
|
|
229
|
+
return /* @__PURE__ */ jsx3(
|
|
230
|
+
"button",
|
|
173
231
|
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
{
|
|
232
|
+
disabled,
|
|
233
|
+
className: clsx2(
|
|
234
|
+
{
|
|
235
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
236
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
237
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
238
|
+
[clsx2(colorClasses, "hover:brightness-90")]: !disabled
|
|
239
|
+
},
|
|
240
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
177
241
|
className
|
|
178
|
-
)
|
|
242
|
+
),
|
|
243
|
+
...restProps,
|
|
244
|
+
children
|
|
179
245
|
}
|
|
180
246
|
);
|
|
181
247
|
};
|
|
182
|
-
|
|
248
|
+
|
|
249
|
+
// src/components/layout-and-navigation/Chip.tsx
|
|
250
|
+
import clsx3 from "clsx";
|
|
251
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
252
|
+
var Chip = ({
|
|
183
253
|
children,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
254
|
+
trailingIcon,
|
|
255
|
+
color = "default",
|
|
256
|
+
variant = "normal",
|
|
257
|
+
className = "",
|
|
258
|
+
...restProps
|
|
259
|
+
}) => {
|
|
260
|
+
const colorMapping = {
|
|
261
|
+
default: "text-tag-default-text bg-tag-default-background",
|
|
262
|
+
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
263
|
+
red: "text-tag-red-text bg-tag-red-background",
|
|
264
|
+
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
265
|
+
green: "text-tag-green-text bg-tag-green-background",
|
|
266
|
+
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
267
|
+
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
268
|
+
}[color];
|
|
269
|
+
const colorMappingIcon = {
|
|
270
|
+
default: "text-tag-default-icon",
|
|
271
|
+
dark: "text-tag-dark-icon",
|
|
272
|
+
red: "text-tag-red-icon",
|
|
273
|
+
yellow: "text-tag-yellow-icon",
|
|
274
|
+
green: "text-tag-green-icon",
|
|
275
|
+
blue: "text-tag-blue-icon",
|
|
276
|
+
pink: "text-tag-pink-icon"
|
|
277
|
+
}[color];
|
|
197
278
|
return /* @__PURE__ */ jsxs2(
|
|
198
279
|
"div",
|
|
199
280
|
{
|
|
200
|
-
|
|
201
|
-
className: clsx3(
|
|
202
|
-
|
|
281
|
+
...restProps,
|
|
282
|
+
className: clsx3(
|
|
283
|
+
`row w-fit px-2 py-1 font-semibold`,
|
|
284
|
+
colorMapping,
|
|
285
|
+
{
|
|
286
|
+
"rounded-md": variant === "normal",
|
|
287
|
+
"rounded-full": variant === "fullyRounded"
|
|
288
|
+
},
|
|
289
|
+
className
|
|
290
|
+
),
|
|
203
291
|
children: [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
{
|
|
207
|
-
className: clsx3(
|
|
208
|
-
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
209
|
-
{
|
|
210
|
-
"group-hover:brightness-97": !isExpanded,
|
|
211
|
-
"hover:brightness-97": isExpanded && !disabled,
|
|
212
|
-
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
213
|
-
},
|
|
214
|
-
headerClassName
|
|
215
|
-
),
|
|
216
|
-
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
217
|
-
children: [
|
|
218
|
-
label,
|
|
219
|
-
icon(isExpanded)
|
|
220
|
-
]
|
|
221
|
-
}
|
|
222
|
-
),
|
|
223
|
-
/* @__PURE__ */ jsx4(
|
|
224
|
-
"div",
|
|
225
|
-
{
|
|
226
|
-
className: clsx3(
|
|
227
|
-
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
228
|
-
{
|
|
229
|
-
[clsx3("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
230
|
-
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
231
|
-
},
|
|
232
|
-
contentClassName
|
|
233
|
-
),
|
|
234
|
-
children
|
|
235
|
-
}
|
|
236
|
-
)
|
|
292
|
+
children,
|
|
293
|
+
trailingIcon && /* @__PURE__ */ jsx4("span", { className: colorMappingIcon, children: trailingIcon })
|
|
237
294
|
]
|
|
238
295
|
}
|
|
239
296
|
);
|
|
240
|
-
}
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
useEffect3(() => {
|
|
248
|
-
setUsedIsExpanded(isExpanded);
|
|
249
|
-
}, [isExpanded]);
|
|
250
|
-
return /* @__PURE__ */ jsx4(
|
|
251
|
-
Expandable,
|
|
297
|
+
};
|
|
298
|
+
var ChipList = ({
|
|
299
|
+
list,
|
|
300
|
+
className = ""
|
|
301
|
+
}) => {
|
|
302
|
+
return /* @__PURE__ */ jsx4("div", { className: clsx3("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx4(
|
|
303
|
+
Chip,
|
|
252
304
|
{
|
|
253
|
-
...
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
305
|
+
...value,
|
|
306
|
+
color: value.color ?? "default",
|
|
307
|
+
variant: value.variant ?? "normal",
|
|
308
|
+
children: value.children
|
|
309
|
+
},
|
|
310
|
+
index
|
|
311
|
+
)) });
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// src/localization/defaults/form.ts
|
|
315
|
+
var formTranslation = {
|
|
316
|
+
en: {
|
|
317
|
+
add: "Add",
|
|
318
|
+
all: "All",
|
|
319
|
+
apply: "Apply",
|
|
320
|
+
back: "Back",
|
|
321
|
+
cancel: "Cancel",
|
|
322
|
+
change: "Change",
|
|
323
|
+
clear: "Clear",
|
|
324
|
+
click: "Click",
|
|
325
|
+
clickToCopy: "Click to Copy",
|
|
326
|
+
close: "Close",
|
|
327
|
+
confirm: "Confirm",
|
|
328
|
+
copy: "Copy",
|
|
329
|
+
copied: "Copied",
|
|
330
|
+
create: "Create",
|
|
331
|
+
decline: "Decline",
|
|
332
|
+
delete: "Delete",
|
|
333
|
+
discard: "Discard",
|
|
334
|
+
discardChanges: "Discard Changes",
|
|
335
|
+
done: "Done",
|
|
336
|
+
edit: "Edit",
|
|
337
|
+
enterText: "Enter text here",
|
|
338
|
+
error: "Error",
|
|
339
|
+
exit: "Exit",
|
|
340
|
+
fieldRequiredError: "This field is required.",
|
|
341
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
342
|
+
less: "Less",
|
|
343
|
+
loading: "Loading",
|
|
344
|
+
maxLengthError: "Maximum length exceeded.",
|
|
345
|
+
minLengthError: "Minimum length not met.",
|
|
346
|
+
more: "More",
|
|
347
|
+
next: "Next",
|
|
348
|
+
no: "No",
|
|
349
|
+
none: "None",
|
|
350
|
+
of: "of",
|
|
351
|
+
optional: "Optional",
|
|
352
|
+
pleaseWait: "Please wait...",
|
|
353
|
+
previous: "Previous",
|
|
354
|
+
remove: "Remove",
|
|
355
|
+
required: "Required",
|
|
356
|
+
reset: "Reset",
|
|
357
|
+
save: "Save",
|
|
358
|
+
saved: "Saved",
|
|
359
|
+
search: "Search",
|
|
360
|
+
select: "Select",
|
|
361
|
+
selectOption: "Select an option",
|
|
362
|
+
show: "Show",
|
|
363
|
+
showMore: "Show more",
|
|
364
|
+
showLess: "Show less",
|
|
365
|
+
submit: "Submit",
|
|
366
|
+
success: "Success",
|
|
367
|
+
update: "Update",
|
|
368
|
+
unsavedChanges: "Unsaved Changes",
|
|
369
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
370
|
+
yes: "Yes"
|
|
371
|
+
},
|
|
372
|
+
de: {
|
|
373
|
+
add: "Hinzuf\xFCgen",
|
|
374
|
+
all: "Alle",
|
|
375
|
+
apply: "Anwenden",
|
|
376
|
+
back: "Zur\xFCck",
|
|
377
|
+
cancel: "Abbrechen",
|
|
378
|
+
change: "\xC4ndern",
|
|
379
|
+
clear: "L\xF6schen",
|
|
380
|
+
click: "Klicken",
|
|
381
|
+
clickToCopy: "Zum kopieren klicken",
|
|
382
|
+
close: "Schlie\xDFen",
|
|
383
|
+
confirm: "Best\xE4tigen",
|
|
384
|
+
copy: "Kopieren",
|
|
385
|
+
copied: "Kopiert",
|
|
386
|
+
create: "Erstellen",
|
|
387
|
+
decline: "Ablehnen",
|
|
388
|
+
delete: "L\xF6schen",
|
|
389
|
+
discard: "Verwerfen",
|
|
390
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
391
|
+
done: "Fertig",
|
|
392
|
+
edit: "Bearbeiten",
|
|
393
|
+
enterText: "Text hier eingeben",
|
|
394
|
+
error: "Fehler",
|
|
395
|
+
exit: "Beenden",
|
|
396
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
397
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
398
|
+
less: "Weniger",
|
|
399
|
+
loading: "L\xE4dt",
|
|
400
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
401
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
402
|
+
more: "Mehr",
|
|
403
|
+
next: "Weiter",
|
|
404
|
+
no: "Nein",
|
|
405
|
+
none: "Nichts",
|
|
406
|
+
of: "von",
|
|
407
|
+
optional: "Optional",
|
|
408
|
+
pleaseWait: "Bitte warten...",
|
|
409
|
+
previous: "Vorherige",
|
|
410
|
+
remove: "Entfernen",
|
|
411
|
+
required: "Erforderlich",
|
|
412
|
+
reset: "Zur\xFCcksetzen",
|
|
413
|
+
save: "Speichern",
|
|
414
|
+
saved: "Gespeichert",
|
|
415
|
+
search: "Suche",
|
|
416
|
+
select: "Select",
|
|
417
|
+
selectOption: "Option ausw\xE4hlen",
|
|
418
|
+
show: "Anzeigen",
|
|
419
|
+
showMore: "Mehr anzeigen",
|
|
420
|
+
showLess: "Weniger anzeigen",
|
|
421
|
+
submit: "Abschicken",
|
|
422
|
+
success: "Erfolg",
|
|
423
|
+
update: "Update",
|
|
424
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
425
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
426
|
+
yes: "Ja"
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
// src/components/user-action/Menu.tsx
|
|
431
|
+
import { useEffect as useEffect5, useRef, useState as useState4 } from "react";
|
|
432
|
+
import clsx4 from "clsx";
|
|
271
433
|
|
|
272
434
|
// src/hooks/useOutsideClick.ts
|
|
273
|
-
import { useEffect as
|
|
435
|
+
import { useEffect as useEffect3 } from "react";
|
|
274
436
|
var useOutsideClick = (refs, handler) => {
|
|
275
|
-
|
|
437
|
+
useEffect3(() => {
|
|
276
438
|
const listener = (event) => {
|
|
277
439
|
if (event.target === null) return;
|
|
278
440
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -290,15 +452,15 @@ var useOutsideClick = (refs, handler) => {
|
|
|
290
452
|
};
|
|
291
453
|
|
|
292
454
|
// src/hooks/useHoverState.ts
|
|
293
|
-
import { useEffect as
|
|
455
|
+
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
294
456
|
var defaultUseHoverStateProps = {
|
|
295
457
|
closingDelay: 200,
|
|
296
458
|
isDisabled: false
|
|
297
459
|
};
|
|
298
460
|
var useHoverState = (props = void 0) => {
|
|
299
461
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
300
|
-
const [isHovered, setIsHovered] =
|
|
301
|
-
const [timer, setTimer] =
|
|
462
|
+
const [isHovered, setIsHovered] = useState3(false);
|
|
463
|
+
const [timer, setTimer] = useState3();
|
|
302
464
|
const onMouseEnter = () => {
|
|
303
465
|
if (isDisabled) {
|
|
304
466
|
return;
|
|
@@ -314,14 +476,14 @@ var useHoverState = (props = void 0) => {
|
|
|
314
476
|
setIsHovered(false);
|
|
315
477
|
}, closingDelay));
|
|
316
478
|
};
|
|
317
|
-
|
|
479
|
+
useEffect4(() => {
|
|
318
480
|
if (timer) {
|
|
319
481
|
return () => {
|
|
320
482
|
clearTimeout(timer);
|
|
321
483
|
};
|
|
322
484
|
}
|
|
323
485
|
});
|
|
324
|
-
|
|
486
|
+
useEffect4(() => {
|
|
325
487
|
if (timer) {
|
|
326
488
|
clearTimeout(timer);
|
|
327
489
|
}
|
|
@@ -423,7 +585,7 @@ var Menu = ({
|
|
|
423
585
|
const triggerRef = useRef(null);
|
|
424
586
|
const menuRef = useRef(null);
|
|
425
587
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
426
|
-
const [isHidden, setIsHidden] =
|
|
588
|
+
const [isHidden, setIsHidden] = useState4(true);
|
|
427
589
|
const bag = {
|
|
428
590
|
isOpen,
|
|
429
591
|
close: () => setIsOpen(false),
|
|
@@ -434,7 +596,7 @@ var Menu = ({
|
|
|
434
596
|
triggerRef.current?.getBoundingClientRect(),
|
|
435
597
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
436
598
|
);
|
|
437
|
-
|
|
599
|
+
useEffect5(() => {
|
|
438
600
|
if (!isOpen) return;
|
|
439
601
|
const triggerEl = triggerRef.current;
|
|
440
602
|
if (!triggerEl) return;
|
|
@@ -451,7 +613,7 @@ var Menu = ({
|
|
|
451
613
|
window.removeEventListener("resize", close);
|
|
452
614
|
};
|
|
453
615
|
}, [isOpen, setIsOpen]);
|
|
454
|
-
|
|
616
|
+
useEffect5(() => {
|
|
455
617
|
if (isOpen) {
|
|
456
618
|
setIsHidden(false);
|
|
457
619
|
}
|
|
@@ -464,7 +626,7 @@ var Menu = ({
|
|
|
464
626
|
ref: menuRef,
|
|
465
627
|
onClick: (e) => e.stopPropagation(),
|
|
466
628
|
className: clsx4(
|
|
467
|
-
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-[300]",
|
|
629
|
+
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg shadow-strong z-[300]",
|
|
468
630
|
{
|
|
469
631
|
"animate-pop-in": isOpen,
|
|
470
632
|
"animate-pop-out": !isOpen,
|
|
@@ -486,10 +648,114 @@ var Menu = ({
|
|
|
486
648
|
] });
|
|
487
649
|
};
|
|
488
650
|
|
|
489
|
-
// src/components/
|
|
490
|
-
import { forwardRef as forwardRef2,
|
|
651
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
652
|
+
import { forwardRef as forwardRef2, useCallback as useCallback2, useEffect as useEffect6, useState as useState5 } from "react";
|
|
653
|
+
import { ChevronDown } from "lucide-react";
|
|
491
654
|
import clsx5 from "clsx";
|
|
492
655
|
|
|
656
|
+
// src/util/noop.ts
|
|
657
|
+
var noop = () => void 0;
|
|
658
|
+
|
|
659
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
660
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
661
|
+
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
662
|
+
return /* @__PURE__ */ jsx6(
|
|
663
|
+
ChevronDown,
|
|
664
|
+
{
|
|
665
|
+
className: clsx5(
|
|
666
|
+
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
667
|
+
{ "rotate-180": isExpanded },
|
|
668
|
+
className
|
|
669
|
+
)
|
|
670
|
+
}
|
|
671
|
+
);
|
|
672
|
+
};
|
|
673
|
+
var Expandable = forwardRef2(function Expandable2({
|
|
674
|
+
children,
|
|
675
|
+
label,
|
|
676
|
+
icon,
|
|
677
|
+
isExpanded = false,
|
|
678
|
+
onChange = noop,
|
|
679
|
+
clickOnlyOnHeader = true,
|
|
680
|
+
disabled = false,
|
|
681
|
+
className,
|
|
682
|
+
headerClassName,
|
|
683
|
+
contentClassName,
|
|
684
|
+
contentExpandedClassName
|
|
685
|
+
}, ref) {
|
|
686
|
+
const defaultIcon = useCallback2((expanded) => /* @__PURE__ */ jsx6(ExpansionIcon, { isExpanded: expanded }), []);
|
|
687
|
+
icon ??= defaultIcon;
|
|
688
|
+
return /* @__PURE__ */ jsxs4(
|
|
689
|
+
"div",
|
|
690
|
+
{
|
|
691
|
+
ref,
|
|
692
|
+
className: clsx5("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
693
|
+
onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
694
|
+
children: [
|
|
695
|
+
/* @__PURE__ */ jsxs4(
|
|
696
|
+
"div",
|
|
697
|
+
{
|
|
698
|
+
className: clsx5(
|
|
699
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
700
|
+
{
|
|
701
|
+
"group-hover:brightness-97": !isExpanded,
|
|
702
|
+
"hover:brightness-97": isExpanded && !disabled,
|
|
703
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
704
|
+
},
|
|
705
|
+
headerClassName
|
|
706
|
+
),
|
|
707
|
+
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
708
|
+
children: [
|
|
709
|
+
label,
|
|
710
|
+
icon(isExpanded)
|
|
711
|
+
]
|
|
712
|
+
}
|
|
713
|
+
),
|
|
714
|
+
/* @__PURE__ */ jsx6(
|
|
715
|
+
"div",
|
|
716
|
+
{
|
|
717
|
+
className: clsx5(
|
|
718
|
+
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
719
|
+
{
|
|
720
|
+
[clsx5("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
721
|
+
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
722
|
+
},
|
|
723
|
+
contentClassName
|
|
724
|
+
),
|
|
725
|
+
children
|
|
726
|
+
}
|
|
727
|
+
)
|
|
728
|
+
]
|
|
729
|
+
}
|
|
730
|
+
);
|
|
731
|
+
});
|
|
732
|
+
var ExpandableUncontrolled = forwardRef2(function ExpandableUncontrolled2({
|
|
733
|
+
isExpanded,
|
|
734
|
+
onChange = noop,
|
|
735
|
+
...props
|
|
736
|
+
}, ref) {
|
|
737
|
+
const [usedIsExpanded, setUsedIsExpanded] = useState5(isExpanded);
|
|
738
|
+
useEffect6(() => {
|
|
739
|
+
setUsedIsExpanded(isExpanded);
|
|
740
|
+
}, [isExpanded]);
|
|
741
|
+
return /* @__PURE__ */ jsx6(
|
|
742
|
+
Expandable,
|
|
743
|
+
{
|
|
744
|
+
...props,
|
|
745
|
+
ref,
|
|
746
|
+
isExpanded: usedIsExpanded,
|
|
747
|
+
onChange: (value) => {
|
|
748
|
+
onChange(value);
|
|
749
|
+
setUsedIsExpanded(value);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
);
|
|
753
|
+
});
|
|
754
|
+
|
|
755
|
+
// src/components/user-action/Input.tsx
|
|
756
|
+
import { forwardRef as forwardRef3, useEffect as useEffect9, useImperativeHandle, useRef as useRef2, useState as useState7 } from "react";
|
|
757
|
+
import clsx6 from "clsx";
|
|
758
|
+
|
|
493
759
|
// src/hooks/useDelay.ts
|
|
494
760
|
import { useEffect as useEffect7, useState as useState6 } from "react";
|
|
495
761
|
var defaultOptions = {
|
|
@@ -609,384 +875,133 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
609
875
|
return () => observer.disconnect();
|
|
610
876
|
}, [disable, hasUsedFocus, ref]);
|
|
611
877
|
};
|
|
612
|
-
|
|
613
|
-
// src/components/user-action/Input.tsx
|
|
614
|
-
import { jsx as
|
|
615
|
-
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
616
|
-
return
|
|
617
|
-
"px-2 py-1.5 rounded-md border-2",
|
|
618
|
-
{
|
|
619
|
-
"bg-
|
|
620
|
-
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
621
|
-
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
622
|
-
}
|
|
623
|
-
);
|
|
624
|
-
};
|
|
625
|
-
var defaultEditCompleteOptions = {
|
|
626
|
-
onBlur: true,
|
|
627
|
-
afterDelay: true,
|
|
628
|
-
delay: 2500
|
|
629
|
-
};
|
|
630
|
-
var Input = forwardRef2(function Input2({
|
|
631
|
-
id,
|
|
632
|
-
type = "text",
|
|
633
|
-
value,
|
|
634
|
-
label,
|
|
635
|
-
onChange = noop,
|
|
636
|
-
onChangeText = noop,
|
|
637
|
-
onEditCompleted,
|
|
638
|
-
className = "",
|
|
639
|
-
allowEnterComplete = true,
|
|
640
|
-
expanded = true,
|
|
641
|
-
autoFocus = false,
|
|
642
|
-
onBlur,
|
|
643
|
-
editCompleteOptions,
|
|
644
|
-
containerClassName,
|
|
645
|
-
disabled,
|
|
646
|
-
...restProps
|
|
647
|
-
}, forwardedRef) {
|
|
648
|
-
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
649
|
-
const {
|
|
650
|
-
restartTimer,
|
|
651
|
-
clearTimer
|
|
652
|
-
} = useDelay({ delay, disabled: !afterDelay });
|
|
653
|
-
const innerRef = useRef2(null);
|
|
654
|
-
const { focusNext } = useFocusManagement();
|
|
655
|
-
useFocusOnceVisible(innerRef, !autoFocus);
|
|
656
|
-
useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
657
|
-
const handleKeyDown = (e) => {
|
|
658
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
659
|
-
e.preventDefault();
|
|
660
|
-
innerRef.current?.blur();
|
|
661
|
-
focusNext();
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
return /* @__PURE__ */ jsxs4("div", { className: clsx5({ "w-full": expanded }, containerClassName), children: [
|
|
665
|
-
label && /* @__PURE__ */ jsx6(Label, { ...label, htmlFor: id, className: clsx5("mb-1", label.className) }),
|
|
666
|
-
/* @__PURE__ */ jsx6(
|
|
667
|
-
"input",
|
|
668
|
-
{
|
|
669
|
-
...restProps,
|
|
670
|
-
ref: innerRef,
|
|
671
|
-
value,
|
|
672
|
-
id,
|
|
673
|
-
type,
|
|
674
|
-
disabled,
|
|
675
|
-
className: clsx5(getInputClassName({ disabled }), className),
|
|
676
|
-
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
677
|
-
onBlur: (event) => {
|
|
678
|
-
onBlur?.(event);
|
|
679
|
-
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
680
|
-
onEditCompleted(event.target.value);
|
|
681
|
-
clearTimer();
|
|
682
|
-
}
|
|
683
|
-
},
|
|
684
|
-
onChange: (e) => {
|
|
685
|
-
const value2 = e.target.value;
|
|
686
|
-
if (onEditCompleted) {
|
|
687
|
-
restartTimer(() => {
|
|
688
|
-
if (innerRef.current) {
|
|
689
|
-
innerRef.current.blur();
|
|
690
|
-
if (!allowEditCompleteOnBlur) {
|
|
691
|
-
onEditCompleted(value2);
|
|
692
|
-
}
|
|
693
|
-
} else {
|
|
694
|
-
onEditCompleted(value2);
|
|
695
|
-
}
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
onChange(e);
|
|
699
|
-
onChangeText(value2);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
)
|
|
703
|
-
] });
|
|
704
|
-
});
|
|
705
|
-
var FormInput = forwardRef2(function FormInput2({
|
|
706
|
-
id,
|
|
707
|
-
labelText,
|
|
708
|
-
errorText,
|
|
709
|
-
className,
|
|
710
|
-
labelClassName,
|
|
711
|
-
errorClassName,
|
|
712
|
-
containerClassName,
|
|
713
|
-
required,
|
|
714
|
-
disabled,
|
|
715
|
-
...restProps
|
|
716
|
-
}, ref) {
|
|
717
|
-
const input = /* @__PURE__ */ jsx6(
|
|
718
|
-
"input",
|
|
719
|
-
{
|
|
720
|
-
...restProps,
|
|
721
|
-
ref,
|
|
722
|
-
id,
|
|
723
|
-
disabled,
|
|
724
|
-
className: clsx5(
|
|
725
|
-
getInputClassName({ disabled, hasError: !!errorText }),
|
|
726
|
-
className
|
|
727
|
-
)
|
|
728
|
-
}
|
|
729
|
-
);
|
|
730
|
-
return /* @__PURE__ */ jsxs4("div", { className: clsx5("flex flex-col gap-y-1", containerClassName), children: [
|
|
731
|
-
labelText && /* @__PURE__ */ jsxs4("label", { htmlFor: id, className: clsx5("textstyle-label-md", labelClassName), children: [
|
|
732
|
-
labelText,
|
|
733
|
-
required && /* @__PURE__ */ jsx6("span", { className: "text-primary font-bold", children: "*" })
|
|
734
|
-
] }),
|
|
735
|
-
input,
|
|
736
|
-
errorText && /* @__PURE__ */ jsx6("label", { htmlFor: id, className: clsx5("text-negative", errorClassName), children: errorText })
|
|
737
|
-
] });
|
|
738
|
-
});
|
|
739
|
-
|
|
740
|
-
// src/localization/defaults/form.ts
|
|
741
|
-
var formTranslation = {
|
|
742
|
-
en: {
|
|
743
|
-
add: "Add",
|
|
744
|
-
all: "All",
|
|
745
|
-
apply: "Apply",
|
|
746
|
-
back: "Back",
|
|
747
|
-
cancel: "Cancel",
|
|
748
|
-
change: "Change",
|
|
749
|
-
clear: "Clear",
|
|
750
|
-
click: "Click",
|
|
751
|
-
clickToCopy: "Click to Copy",
|
|
752
|
-
close: "Close",
|
|
753
|
-
confirm: "Confirm",
|
|
754
|
-
copy: "Copy",
|
|
755
|
-
copied: "Copied",
|
|
756
|
-
create: "Create",
|
|
757
|
-
decline: "Decline",
|
|
758
|
-
delete: "Delete",
|
|
759
|
-
discard: "Discard",
|
|
760
|
-
discardChanges: "Discard Changes",
|
|
761
|
-
done: "Done",
|
|
762
|
-
edit: "Edit",
|
|
763
|
-
enterText: "Enter text here",
|
|
764
|
-
error: "Error",
|
|
765
|
-
exit: "Exit",
|
|
766
|
-
fieldRequiredError: "This field is required.",
|
|
767
|
-
invalidEmailError: "Please enter a valid email address.",
|
|
768
|
-
less: "Less",
|
|
769
|
-
loading: "Loading",
|
|
770
|
-
maxLengthError: "Maximum length exceeded.",
|
|
771
|
-
minLengthError: "Minimum length not met.",
|
|
772
|
-
more: "More",
|
|
773
|
-
next: "Next",
|
|
774
|
-
no: "No",
|
|
775
|
-
none: "None",
|
|
776
|
-
of: "of",
|
|
777
|
-
optional: "Optional",
|
|
778
|
-
pleaseWait: "Please wait...",
|
|
779
|
-
previous: "Previous",
|
|
780
|
-
remove: "Remove",
|
|
781
|
-
required: "Required",
|
|
782
|
-
reset: "Reset",
|
|
783
|
-
save: "Save",
|
|
784
|
-
saved: "Saved",
|
|
785
|
-
search: "Search",
|
|
786
|
-
select: "Select",
|
|
787
|
-
selectOption: "Select an option",
|
|
788
|
-
show: "Show",
|
|
789
|
-
showMore: "Show more",
|
|
790
|
-
showLess: "Show less",
|
|
791
|
-
submit: "Submit",
|
|
792
|
-
success: "Success",
|
|
793
|
-
update: "Update",
|
|
794
|
-
unsavedChanges: "Unsaved Changes",
|
|
795
|
-
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
796
|
-
yes: "Yes"
|
|
797
|
-
},
|
|
798
|
-
de: {
|
|
799
|
-
add: "Hinzuf\xFCgen",
|
|
800
|
-
all: "Alle",
|
|
801
|
-
apply: "Anwenden",
|
|
802
|
-
back: "Zur\xFCck",
|
|
803
|
-
cancel: "Abbrechen",
|
|
804
|
-
change: "\xC4ndern",
|
|
805
|
-
clear: "L\xF6schen",
|
|
806
|
-
click: "Klicken",
|
|
807
|
-
clickToCopy: "Zum kopieren klicken",
|
|
808
|
-
close: "Schlie\xDFen",
|
|
809
|
-
confirm: "Best\xE4tigen",
|
|
810
|
-
copy: "Kopieren",
|
|
811
|
-
copied: "Kopiert",
|
|
812
|
-
create: "Erstellen",
|
|
813
|
-
decline: "Ablehnen",
|
|
814
|
-
delete: "L\xF6schen",
|
|
815
|
-
discard: "Verwerfen",
|
|
816
|
-
discardChanges: "\xC4nderungen Verwerfen",
|
|
817
|
-
done: "Fertig",
|
|
818
|
-
edit: "Bearbeiten",
|
|
819
|
-
enterText: "Text hier eingeben",
|
|
820
|
-
error: "Fehler",
|
|
821
|
-
exit: "Beenden",
|
|
822
|
-
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
823
|
-
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
824
|
-
less: "Weniger",
|
|
825
|
-
loading: "L\xE4dt",
|
|
826
|
-
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
827
|
-
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
828
|
-
more: "Mehr",
|
|
829
|
-
next: "Weiter",
|
|
830
|
-
no: "Nein",
|
|
831
|
-
none: "Nichts",
|
|
832
|
-
of: "von",
|
|
833
|
-
optional: "Optional",
|
|
834
|
-
pleaseWait: "Bitte warten...",
|
|
835
|
-
previous: "Vorherige",
|
|
836
|
-
remove: "Entfernen",
|
|
837
|
-
required: "Erforderlich",
|
|
838
|
-
reset: "Zur\xFCcksetzen",
|
|
839
|
-
save: "Speichern",
|
|
840
|
-
saved: "Gespeichert",
|
|
841
|
-
search: "Suche",
|
|
842
|
-
select: "Select",
|
|
843
|
-
selectOption: "Option ausw\xE4hlen",
|
|
844
|
-
show: "Anzeigen",
|
|
845
|
-
showMore: "Mehr anzeigen",
|
|
846
|
-
showLess: "Weniger anzeigen",
|
|
847
|
-
submit: "Abschicken",
|
|
848
|
-
success: "Erfolg",
|
|
849
|
-
update: "Update",
|
|
850
|
-
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
851
|
-
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
852
|
-
yes: "Ja"
|
|
853
|
-
}
|
|
854
|
-
};
|
|
855
|
-
|
|
856
|
-
// src/components/user-action/Button.tsx
|
|
857
|
-
import { forwardRef as forwardRef3 } from "react";
|
|
858
|
-
import clsx6 from "clsx";
|
|
859
|
-
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
860
|
-
var ButtonColorUtil = {
|
|
861
|
-
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
862
|
-
text: ["primary", "negative", "neutral"],
|
|
863
|
-
outline: ["primary"]
|
|
864
|
-
};
|
|
865
|
-
var IconButtonUtil = {
|
|
866
|
-
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
867
|
-
};
|
|
868
|
-
var paddingMapping = {
|
|
869
|
-
small: "btn-sm",
|
|
870
|
-
medium: "btn-md",
|
|
871
|
-
large: "btn-lg"
|
|
872
|
-
};
|
|
873
|
-
var iconPaddingMapping = {
|
|
874
|
-
tiny: "icon-btn-xs",
|
|
875
|
-
small: "icon-btn-sm",
|
|
876
|
-
medium: "icon-btn-md",
|
|
877
|
-
large: "icon-btn-lg"
|
|
878
|
-
};
|
|
879
|
-
var ButtonUtil = {
|
|
880
|
-
paddingMapping,
|
|
881
|
-
iconPaddingMapping
|
|
882
|
-
};
|
|
883
|
-
var SolidButton = forwardRef3(function SolidButton2({
|
|
884
|
-
children,
|
|
885
|
-
disabled = false,
|
|
886
|
-
color = "primary",
|
|
887
|
-
size = "medium",
|
|
888
|
-
startIcon,
|
|
889
|
-
endIcon,
|
|
890
|
-
onClick,
|
|
891
|
-
className,
|
|
892
|
-
...restProps
|
|
893
|
-
}, ref) {
|
|
894
|
-
const colorClasses = {
|
|
895
|
-
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
896
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
897
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
898
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
899
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
900
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
901
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
902
|
-
}[color];
|
|
903
|
-
const iconColorClasses = {
|
|
904
|
-
primary: "text-button-solid-primary-icon",
|
|
905
|
-
secondary: "text-button-solid-secondary-icon",
|
|
906
|
-
tertiary: "text-button-solid-tertiary-icon",
|
|
907
|
-
positive: "text-button-solid-positive-icon",
|
|
908
|
-
warning: "text-button-solid-warning-icon",
|
|
909
|
-
negative: "text-button-solid-negative-icon",
|
|
910
|
-
neutral: "text-button-solid-neutral-icon"
|
|
911
|
-
}[color];
|
|
912
|
-
return /* @__PURE__ */ jsxs5(
|
|
913
|
-
"button",
|
|
914
|
-
{
|
|
915
|
-
ref,
|
|
916
|
-
onClick,
|
|
917
|
-
disabled,
|
|
918
|
-
className: clsx6(
|
|
919
|
-
{
|
|
920
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
921
|
-
[clsx6(colorClasses, "hover:brightness-90")]: !disabled
|
|
922
|
-
},
|
|
923
|
-
ButtonUtil.paddingMapping[size],
|
|
924
|
-
className
|
|
925
|
-
),
|
|
926
|
-
...restProps,
|
|
927
|
-
children: [
|
|
928
|
-
startIcon && /* @__PURE__ */ jsx7(
|
|
929
|
-
"span",
|
|
930
|
-
{
|
|
931
|
-
className: clsx6({
|
|
932
|
-
[iconColorClasses]: !disabled,
|
|
933
|
-
[`text-disabled-icon`]: disabled
|
|
934
|
-
}),
|
|
935
|
-
children: startIcon
|
|
936
|
-
}
|
|
937
|
-
),
|
|
938
|
-
children,
|
|
939
|
-
endIcon && /* @__PURE__ */ jsx7(
|
|
940
|
-
"span",
|
|
941
|
-
{
|
|
942
|
-
className: clsx6({
|
|
943
|
-
[iconColorClasses]: !disabled,
|
|
944
|
-
[`text-disabled-icon`]: disabled
|
|
945
|
-
}),
|
|
946
|
-
children: endIcon
|
|
947
|
-
}
|
|
948
|
-
)
|
|
949
|
-
]
|
|
878
|
+
|
|
879
|
+
// src/components/user-action/Input.tsx
|
|
880
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
881
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
882
|
+
return clsx6(
|
|
883
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
884
|
+
{
|
|
885
|
+
"bg-input-background text-input-text hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
886
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
887
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
950
888
|
}
|
|
951
889
|
);
|
|
890
|
+
};
|
|
891
|
+
var defaultEditCompleteOptions = {
|
|
892
|
+
onBlur: true,
|
|
893
|
+
afterDelay: true,
|
|
894
|
+
delay: 2500
|
|
895
|
+
};
|
|
896
|
+
var Input = forwardRef3(function Input2({
|
|
897
|
+
id,
|
|
898
|
+
type = "text",
|
|
899
|
+
value,
|
|
900
|
+
label,
|
|
901
|
+
onChange = noop,
|
|
902
|
+
onChangeText = noop,
|
|
903
|
+
onEditCompleted,
|
|
904
|
+
className = "",
|
|
905
|
+
allowEnterComplete = true,
|
|
906
|
+
expanded = true,
|
|
907
|
+
autoFocus = false,
|
|
908
|
+
onBlur,
|
|
909
|
+
editCompleteOptions,
|
|
910
|
+
containerClassName,
|
|
911
|
+
disabled,
|
|
912
|
+
...restProps
|
|
913
|
+
}, forwardedRef) {
|
|
914
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
915
|
+
const {
|
|
916
|
+
restartTimer,
|
|
917
|
+
clearTimer
|
|
918
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
919
|
+
const innerRef = useRef2(null);
|
|
920
|
+
const { focusNext } = useFocusManagement();
|
|
921
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
922
|
+
useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
923
|
+
const handleKeyDown = (e) => {
|
|
924
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
925
|
+
e.preventDefault();
|
|
926
|
+
innerRef.current?.blur();
|
|
927
|
+
focusNext();
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
return /* @__PURE__ */ jsxs5("div", { className: clsx6({ "w-full": expanded }, containerClassName), children: [
|
|
931
|
+
label && /* @__PURE__ */ jsx7(Label, { ...label, htmlFor: id, className: clsx6("mb-1", label.className) }),
|
|
932
|
+
/* @__PURE__ */ jsx7(
|
|
933
|
+
"input",
|
|
934
|
+
{
|
|
935
|
+
...restProps,
|
|
936
|
+
ref: innerRef,
|
|
937
|
+
value,
|
|
938
|
+
id,
|
|
939
|
+
type,
|
|
940
|
+
disabled,
|
|
941
|
+
className: clsx6(getInputClassName({ disabled }), className),
|
|
942
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
943
|
+
onBlur: (event) => {
|
|
944
|
+
onBlur?.(event);
|
|
945
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
946
|
+
onEditCompleted(event.target.value);
|
|
947
|
+
clearTimer();
|
|
948
|
+
}
|
|
949
|
+
},
|
|
950
|
+
onChange: (e) => {
|
|
951
|
+
const value2 = e.target.value;
|
|
952
|
+
if (onEditCompleted) {
|
|
953
|
+
restartTimer(() => {
|
|
954
|
+
if (innerRef.current) {
|
|
955
|
+
innerRef.current.blur();
|
|
956
|
+
if (!allowEditCompleteOnBlur) {
|
|
957
|
+
onEditCompleted(value2);
|
|
958
|
+
}
|
|
959
|
+
} else {
|
|
960
|
+
onEditCompleted(value2);
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
onChange(e);
|
|
965
|
+
onChangeText(value2);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
)
|
|
969
|
+
] });
|
|
952
970
|
});
|
|
953
|
-
var
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
size = "medium",
|
|
971
|
+
var FormInput = forwardRef3(function FormInput2({
|
|
972
|
+
id,
|
|
973
|
+
labelText,
|
|
974
|
+
errorText,
|
|
958
975
|
className,
|
|
976
|
+
labelClassName,
|
|
977
|
+
errorClassName,
|
|
978
|
+
containerClassName,
|
|
979
|
+
required,
|
|
980
|
+
disabled,
|
|
959
981
|
...restProps
|
|
960
|
-
})
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
964
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
965
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
966
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
967
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
968
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
969
|
-
transparent: "bg-transparent"
|
|
970
|
-
}[color];
|
|
971
|
-
return /* @__PURE__ */ jsx7(
|
|
972
|
-
"button",
|
|
982
|
+
}, ref) {
|
|
983
|
+
const input = /* @__PURE__ */ jsx7(
|
|
984
|
+
"input",
|
|
973
985
|
{
|
|
986
|
+
...restProps,
|
|
987
|
+
ref,
|
|
988
|
+
id,
|
|
974
989
|
disabled,
|
|
975
990
|
className: clsx6(
|
|
976
|
-
{
|
|
977
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
978
|
-
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
979
|
-
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
980
|
-
[clsx6(colorClasses, "hover:brightness-90")]: !disabled
|
|
981
|
-
},
|
|
982
|
-
ButtonUtil.iconPaddingMapping[size],
|
|
991
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
983
992
|
className
|
|
984
|
-
)
|
|
985
|
-
...restProps,
|
|
986
|
-
children
|
|
993
|
+
)
|
|
987
994
|
}
|
|
988
995
|
);
|
|
989
|
-
|
|
996
|
+
return /* @__PURE__ */ jsxs5("div", { className: clsx6("flex flex-col gap-y-1", containerClassName), children: [
|
|
997
|
+
labelText && /* @__PURE__ */ jsxs5("label", { htmlFor: id, className: clsx6("textstyle-label-md", labelClassName), children: [
|
|
998
|
+
labelText,
|
|
999
|
+
required && /* @__PURE__ */ jsx7("span", { className: "text-primary font-bold", children: "*" })
|
|
1000
|
+
] }),
|
|
1001
|
+
input,
|
|
1002
|
+
errorText && /* @__PURE__ */ jsx7("label", { htmlFor: id, className: clsx6("text-negative", errorClassName), children: errorText })
|
|
1003
|
+
] });
|
|
1004
|
+
});
|
|
990
1005
|
|
|
991
1006
|
// src/components/user-action/SearchBar.tsx
|
|
992
1007
|
import { Search } from "lucide-react";
|
|
@@ -1080,96 +1095,12 @@ var useSearch = ({
|
|
|
1080
1095
|
};
|
|
1081
1096
|
};
|
|
1082
1097
|
|
|
1083
|
-
// src/components/user-action/Select.tsx
|
|
1084
|
-
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1085
|
-
var SelectTile = ({
|
|
1086
|
-
className,
|
|
1087
|
-
disabledClassName,
|
|
1088
|
-
title,
|
|
1089
|
-
...restProps
|
|
1090
|
-
}) => {
|
|
1091
|
-
return /* @__PURE__ */ jsx9(
|
|
1092
|
-
Tile,
|
|
1093
|
-
{
|
|
1094
|
-
...restProps,
|
|
1095
|
-
className: clsx8("px-2 py-1 rounded-md", className),
|
|
1096
|
-
disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
|
|
1097
|
-
title: { ...title, className: title.className ?? "font-semibold" }
|
|
1098
|
-
}
|
|
1099
|
-
);
|
|
1100
|
-
};
|
|
1101
|
-
|
|
1102
|
-
// src/components/layout-and-navigation/Chip.tsx
|
|
1103
|
-
import clsx9 from "clsx";
|
|
1104
|
-
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1105
|
-
var Chip = ({
|
|
1106
|
-
children,
|
|
1107
|
-
trailingIcon,
|
|
1108
|
-
color = "default",
|
|
1109
|
-
variant = "normal",
|
|
1110
|
-
className = "",
|
|
1111
|
-
...restProps
|
|
1112
|
-
}) => {
|
|
1113
|
-
const colorMapping = {
|
|
1114
|
-
default: "text-tag-default-text bg-tag-default-background",
|
|
1115
|
-
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
1116
|
-
red: "text-tag-red-text bg-tag-red-background",
|
|
1117
|
-
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
1118
|
-
green: "text-tag-green-text bg-tag-green-background",
|
|
1119
|
-
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
1120
|
-
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
1121
|
-
}[color];
|
|
1122
|
-
const colorMappingIcon = {
|
|
1123
|
-
default: "text-tag-default-icon",
|
|
1124
|
-
dark: "text-tag-dark-icon",
|
|
1125
|
-
red: "text-tag-red-icon",
|
|
1126
|
-
yellow: "text-tag-yellow-icon",
|
|
1127
|
-
green: "text-tag-green-icon",
|
|
1128
|
-
blue: "text-tag-blue-icon",
|
|
1129
|
-
pink: "text-tag-pink-icon"
|
|
1130
|
-
}[color];
|
|
1131
|
-
return /* @__PURE__ */ jsxs8(
|
|
1132
|
-
"div",
|
|
1133
|
-
{
|
|
1134
|
-
...restProps,
|
|
1135
|
-
className: clsx9(
|
|
1136
|
-
`row w-fit px-2 py-1`,
|
|
1137
|
-
colorMapping,
|
|
1138
|
-
{
|
|
1139
|
-
"rounded-md": variant === "normal",
|
|
1140
|
-
"rounded-full": variant === "fullyRounded"
|
|
1141
|
-
},
|
|
1142
|
-
className
|
|
1143
|
-
),
|
|
1144
|
-
children: [
|
|
1145
|
-
children,
|
|
1146
|
-
trailingIcon && /* @__PURE__ */ jsx10("span", { className: colorMappingIcon, children: trailingIcon })
|
|
1147
|
-
]
|
|
1148
|
-
}
|
|
1149
|
-
);
|
|
1150
|
-
};
|
|
1151
|
-
var ChipList = ({
|
|
1152
|
-
list,
|
|
1153
|
-
className = ""
|
|
1154
|
-
}) => {
|
|
1155
|
-
return /* @__PURE__ */ jsx10("div", { className: clsx9("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx10(
|
|
1156
|
-
Chip,
|
|
1157
|
-
{
|
|
1158
|
-
...value,
|
|
1159
|
-
color: value.color ?? "dark",
|
|
1160
|
-
variant: value.variant ?? "normal",
|
|
1161
|
-
children: value.children
|
|
1162
|
-
},
|
|
1163
|
-
index
|
|
1164
|
-
)) });
|
|
1165
|
-
};
|
|
1166
|
-
|
|
1167
1098
|
// src/components/user-action/Checkbox.tsx
|
|
1168
|
-
import { useState as
|
|
1099
|
+
import { useState as useState9 } from "react";
|
|
1169
1100
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
1170
|
-
import { Check
|
|
1171
|
-
import
|
|
1172
|
-
import { jsx as
|
|
1101
|
+
import { Check, Minus } from "lucide-react";
|
|
1102
|
+
import clsx8 from "clsx";
|
|
1103
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1173
1104
|
var checkboxSizeMapping = {
|
|
1174
1105
|
small: "size-5",
|
|
1175
1106
|
medium: "size-6",
|
|
@@ -1205,33 +1136,92 @@ var Checkbox = ({
|
|
|
1205
1136
|
const newValue = checked === "indeterminate" ? false : !checked;
|
|
1206
1137
|
propagateChange(newValue);
|
|
1207
1138
|
};
|
|
1208
|
-
return /* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1139
|
+
return /* @__PURE__ */ jsxs7("div", { className: clsx8("group flex-row-2 items-center cursor-pointer", containerClassName), onClick: changeValue, children: [
|
|
1140
|
+
/* @__PURE__ */ jsx9(
|
|
1210
1141
|
CheckboxPrimitive.Root,
|
|
1211
1142
|
{
|
|
1212
1143
|
onCheckedChange: propagateChange,
|
|
1213
1144
|
checked,
|
|
1214
1145
|
disabled,
|
|
1215
1146
|
id,
|
|
1216
|
-
className:
|
|
1147
|
+
className: clsx8(usedSizeClass, `items-center border-2 rounded outline-none `, {
|
|
1217
1148
|
"text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
|
|
1218
1149
|
"focus:border-primary group-hover:border-primary ": !disabled,
|
|
1219
|
-
"bg-
|
|
1150
|
+
"bg-input-background": !disabled && !checked,
|
|
1220
1151
|
"bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
|
|
1221
1152
|
}, className),
|
|
1222
|
-
children: /* @__PURE__ */
|
|
1223
|
-
checked === true && /* @__PURE__ */
|
|
1224
|
-
checked === "indeterminate" && /* @__PURE__ */
|
|
1153
|
+
children: /* @__PURE__ */ jsxs7(CheckboxPrimitive.Indicator, { children: [
|
|
1154
|
+
checked === true && /* @__PURE__ */ jsx9(Check, { className: innerIconSize }),
|
|
1155
|
+
checked === "indeterminate" && /* @__PURE__ */ jsx9(Minus, { className: innerIconSize })
|
|
1225
1156
|
] })
|
|
1226
1157
|
}
|
|
1227
1158
|
),
|
|
1228
|
-
label && /* @__PURE__ */
|
|
1159
|
+
label && /* @__PURE__ */ jsx9(Label, { ...label, className: clsx8(label.className), htmlFor: id })
|
|
1229
1160
|
] });
|
|
1230
1161
|
};
|
|
1231
1162
|
|
|
1232
1163
|
// src/components/user-action/MultiSelect.tsx
|
|
1233
1164
|
import { Plus } from "lucide-react";
|
|
1234
|
-
|
|
1165
|
+
|
|
1166
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
1167
|
+
import clsx9 from "clsx";
|
|
1168
|
+
import { Check as Check2 } from "lucide-react";
|
|
1169
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1170
|
+
var Tile = ({
|
|
1171
|
+
title,
|
|
1172
|
+
titleClassName,
|
|
1173
|
+
description,
|
|
1174
|
+
descriptionClassName,
|
|
1175
|
+
onClick,
|
|
1176
|
+
isSelected = false,
|
|
1177
|
+
disabled = false,
|
|
1178
|
+
prefix,
|
|
1179
|
+
suffix,
|
|
1180
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
1181
|
+
selectedClassName = "bg-primary/20",
|
|
1182
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
1183
|
+
className
|
|
1184
|
+
}) => {
|
|
1185
|
+
return /* @__PURE__ */ jsxs8(
|
|
1186
|
+
"div",
|
|
1187
|
+
{
|
|
1188
|
+
className: clsx9(
|
|
1189
|
+
"flex-row-2 w-full items-center",
|
|
1190
|
+
{
|
|
1191
|
+
[normalClassName]: onClick && !disabled,
|
|
1192
|
+
[selectedClassName]: isSelected && !disabled,
|
|
1193
|
+
[disabledClassName]: disabled
|
|
1194
|
+
},
|
|
1195
|
+
className
|
|
1196
|
+
),
|
|
1197
|
+
onClick: disabled ? void 0 : onClick,
|
|
1198
|
+
children: [
|
|
1199
|
+
prefix,
|
|
1200
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex-col-0 w-full", children: [
|
|
1201
|
+
/* @__PURE__ */ jsx10("span", { className: clsx9(titleClassName ?? "textstyle-title-normal"), children: title }),
|
|
1202
|
+
!!description && /* @__PURE__ */ jsx10("span", { className: clsx9(descriptionClassName ?? "textstyle-description"), children: description })
|
|
1203
|
+
] }),
|
|
1204
|
+
suffix ?? (isSelected ? /* @__PURE__ */ jsx10(Check2, { size: 24 }) : void 0)
|
|
1205
|
+
]
|
|
1206
|
+
}
|
|
1207
|
+
);
|
|
1208
|
+
};
|
|
1209
|
+
var ListTile = ({
|
|
1210
|
+
...props
|
|
1211
|
+
}) => {
|
|
1212
|
+
return /* @__PURE__ */ jsx10(
|
|
1213
|
+
Tile,
|
|
1214
|
+
{
|
|
1215
|
+
...props,
|
|
1216
|
+
titleClassName: props.titleClassName ?? "font-semibold",
|
|
1217
|
+
className: clsx9("px-2 py-1 rounded-md", props.className),
|
|
1218
|
+
disabledClassName: props.disabledClassName ?? "text-disabled-text cursor-not-allowed"
|
|
1219
|
+
}
|
|
1220
|
+
);
|
|
1221
|
+
};
|
|
1222
|
+
|
|
1223
|
+
// src/components/user-action/MultiSelect.tsx
|
|
1224
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1235
1225
|
var defaultMultiSelectTranslation = {
|
|
1236
1226
|
en: {
|
|
1237
1227
|
selected: `{{amount}} selected`
|
|
@@ -1258,52 +1248,64 @@ var MultiSelect = ({
|
|
|
1258
1248
|
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
1259
1249
|
const { result, search, setSearch } = useSearch({
|
|
1260
1250
|
list: options,
|
|
1261
|
-
searchMapping:
|
|
1251
|
+
searchMapping: useCallback5((item) => item.searchTags, []),
|
|
1262
1252
|
...searchOptions
|
|
1263
1253
|
});
|
|
1264
1254
|
const selectedItems = options.filter((value) => value.selected);
|
|
1265
1255
|
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|
|
1266
|
-
return /* @__PURE__ */
|
|
1267
|
-
label && /* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ jsxs9("div", { className: clsx10(className), children: [
|
|
1257
|
+
label && /* @__PURE__ */ jsx11(
|
|
1268
1258
|
Label,
|
|
1269
1259
|
{
|
|
1270
1260
|
...label,
|
|
1271
1261
|
htmlFor: label.name,
|
|
1272
|
-
className:
|
|
1262
|
+
className: clsx10(" mb-1", label.className),
|
|
1273
1263
|
labelType: label.labelType ?? "labelBig"
|
|
1274
1264
|
}
|
|
1275
1265
|
),
|
|
1276
|
-
/* @__PURE__ */
|
|
1266
|
+
/* @__PURE__ */ jsx11(
|
|
1277
1267
|
Menu,
|
|
1278
1268
|
{
|
|
1279
1269
|
...menuProps,
|
|
1280
|
-
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */
|
|
1270
|
+
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ jsx11(
|
|
1281
1271
|
"button",
|
|
1282
1272
|
{
|
|
1283
1273
|
ref,
|
|
1284
|
-
className:
|
|
1285
|
-
"btn-md justify-between w-full border-2 h-auto",
|
|
1274
|
+
className: clsx10(
|
|
1275
|
+
"group btn-md justify-between w-full border-2 h-auto",
|
|
1286
1276
|
{
|
|
1287
1277
|
"min-h-14": useChipDisplay,
|
|
1288
|
-
"bg-
|
|
1278
|
+
"bg-input-background text-input-text hover:border-primary": !disabled,
|
|
1289
1279
|
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": disabled
|
|
1290
1280
|
},
|
|
1291
1281
|
triggerClassName
|
|
1292
1282
|
),
|
|
1293
1283
|
onClick: toggleOpen,
|
|
1294
1284
|
disabled,
|
|
1295
|
-
children: useChipDisplay ? /* @__PURE__ */
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1285
|
+
children: useChipDisplay ? /* @__PURE__ */ jsx11(Fragment2, { children: isShowingHint ? /* @__PURE__ */ jsx11(
|
|
1286
|
+
"div",
|
|
1287
|
+
{
|
|
1288
|
+
className: clsx10(
|
|
1289
|
+
"icon-btn-sm ",
|
|
1290
|
+
{
|
|
1291
|
+
"bg-button-solid-neutral-background text-button-solid-neutral-text hover:brightness-90 group-hover:brightness-90": !disabled,
|
|
1292
|
+
"bg-disabled-background text-disabled-text": disabled
|
|
1293
|
+
}
|
|
1294
|
+
),
|
|
1295
|
+
children: /* @__PURE__ */ jsx11(Plus, {})
|
|
1296
|
+
}
|
|
1297
|
+
) : /* @__PURE__ */ jsx11(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1298
|
+
!isShowingHint && /* @__PURE__ */ jsx11("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
|
|
1299
|
+
isShowingHint && /* @__PURE__ */ jsx11("span", { className: clsx10("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
|
|
1300
|
+
/* @__PURE__ */ jsx11(ExpansionIcon, { isExpanded: isOpen })
|
|
1299
1301
|
] })
|
|
1300
1302
|
}
|
|
1301
1303
|
),
|
|
1302
|
-
menuClassName:
|
|
1304
|
+
menuClassName: clsx10("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
|
|
1303
1305
|
children: (bag) => {
|
|
1304
1306
|
const { close } = bag;
|
|
1305
|
-
return /* @__PURE__ */
|
|
1306
|
-
!searchOptions?.disabled && /* @__PURE__ */
|
|
1307
|
+
return /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1308
|
+
!searchOptions?.disabled && /* @__PURE__ */ jsx11(
|
|
1307
1309
|
SearchBar,
|
|
1308
1310
|
{
|
|
1309
1311
|
value: search,
|
|
@@ -1311,7 +1313,7 @@ var MultiSelect = ({
|
|
|
1311
1313
|
autoFocus: true
|
|
1312
1314
|
}
|
|
1313
1315
|
),
|
|
1314
|
-
/* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-col-2 overflow-y-auto", children: [
|
|
1315
1317
|
result.map((option, index) => {
|
|
1316
1318
|
const update = () => {
|
|
1317
1319
|
onChange(options.map((value) => value.value === option.value ? {
|
|
@@ -1319,10 +1321,10 @@ var MultiSelect = ({
|
|
|
1319
1321
|
selected: !value.selected
|
|
1320
1322
|
} : value));
|
|
1321
1323
|
};
|
|
1322
|
-
return /* @__PURE__ */
|
|
1323
|
-
|
|
1324
|
+
return /* @__PURE__ */ jsx11(
|
|
1325
|
+
ListTile,
|
|
1324
1326
|
{
|
|
1325
|
-
prefix: /* @__PURE__ */
|
|
1327
|
+
prefix: /* @__PURE__ */ jsx11(
|
|
1326
1328
|
Checkbox,
|
|
1327
1329
|
{
|
|
1328
1330
|
checked: option.selected,
|
|
@@ -1331,7 +1333,7 @@ var MultiSelect = ({
|
|
|
1331
1333
|
disabled: option.disabled
|
|
1332
1334
|
}
|
|
1333
1335
|
),
|
|
1334
|
-
title:
|
|
1336
|
+
title: option.label,
|
|
1335
1337
|
onClick: update,
|
|
1336
1338
|
disabled: option.disabled
|
|
1337
1339
|
},
|
|
@@ -1340,9 +1342,9 @@ var MultiSelect = ({
|
|
|
1340
1342
|
}),
|
|
1341
1343
|
additionalItems && additionalItems({ ...bag, search })
|
|
1342
1344
|
] }),
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-row-2 justify-between", children: [
|
|
1346
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-row-2", children: [
|
|
1347
|
+
/* @__PURE__ */ jsx11(
|
|
1346
1348
|
SolidButton,
|
|
1347
1349
|
{
|
|
1348
1350
|
color: "neutral",
|
|
@@ -1357,7 +1359,7 @@ var MultiSelect = ({
|
|
|
1357
1359
|
children: translation("all")
|
|
1358
1360
|
}
|
|
1359
1361
|
),
|
|
1360
|
-
/* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ jsx11(
|
|
1361
1363
|
SolidButton,
|
|
1362
1364
|
{
|
|
1363
1365
|
color: "neutral",
|
|
@@ -1372,7 +1374,7 @@ var MultiSelect = ({
|
|
|
1372
1374
|
}
|
|
1373
1375
|
)
|
|
1374
1376
|
] }),
|
|
1375
|
-
/* @__PURE__ */
|
|
1377
|
+
/* @__PURE__ */ jsx11(SolidButton, { size: "small", onClick: close, children: "Done" })
|
|
1376
1378
|
] })
|
|
1377
1379
|
] });
|
|
1378
1380
|
}
|
|
@@ -1385,11 +1387,11 @@ var MultiSelectUncontrolled = ({
|
|
|
1385
1387
|
onChange,
|
|
1386
1388
|
...props
|
|
1387
1389
|
}) => {
|
|
1388
|
-
const [usedOptions, setUsedOptions] =
|
|
1389
|
-
|
|
1390
|
+
const [usedOptions, setUsedOptions] = useState10(options);
|
|
1391
|
+
useEffect11(() => {
|
|
1390
1392
|
setUsedOptions(options);
|
|
1391
1393
|
}, [options]);
|
|
1392
|
-
return /* @__PURE__ */
|
|
1394
|
+
return /* @__PURE__ */ jsx11(
|
|
1393
1395
|
MultiSelect,
|
|
1394
1396
|
{
|
|
1395
1397
|
...props,
|