@helpwave/hightide 0.6.8 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +68 -26
- package/dist/index.d.ts +68 -26
- package/dist/index.js +559 -466
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +555 -466
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +17 -8
- package/dist/style/uncompiled/theme/components/form-field.css +4 -4
- package/dist/style/uncompiled/theme/components/table.css +4 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6909,277 +6909,7 @@ var TagIcon = ({
|
|
|
6909
6909
|
|
|
6910
6910
|
// src/components/form/FieldLayout.tsx
|
|
6911
6911
|
import { useId, useMemo as useMemo2, forwardRef as forwardRef2 } from "react";
|
|
6912
|
-
|
|
6913
|
-
// src/utils/array.ts
|
|
6914
|
-
var equalSizeGroups = (array, groupSize) => {
|
|
6915
|
-
if (groupSize <= 0) {
|
|
6916
|
-
console.warn(`group size should be greater than 0: groupSize = ${groupSize}`);
|
|
6917
|
-
return [[...array]];
|
|
6918
|
-
}
|
|
6919
|
-
const groups = [];
|
|
6920
|
-
for (let i = 0; i < array.length; i += groupSize) {
|
|
6921
|
-
groups.push(array.slice(i, Math.min(i + groupSize, array.length)));
|
|
6922
|
-
}
|
|
6923
|
-
return groups;
|
|
6924
|
-
};
|
|
6925
|
-
var defaultRangeOptions = {
|
|
6926
|
-
allowEmptyRange: false,
|
|
6927
|
-
stepSize: 1,
|
|
6928
|
-
exclusiveStart: false,
|
|
6929
|
-
exclusiveEnd: true
|
|
6930
|
-
};
|
|
6931
|
-
var range = (endOrRange, options) => {
|
|
6932
|
-
const { allowEmptyRange, stepSize, exclusiveStart, exclusiveEnd } = { ...defaultRangeOptions, ...options };
|
|
6933
|
-
let start = 0;
|
|
6934
|
-
let end;
|
|
6935
|
-
if (typeof endOrRange === "number") {
|
|
6936
|
-
end = endOrRange;
|
|
6937
|
-
} else {
|
|
6938
|
-
start = endOrRange[0];
|
|
6939
|
-
end = endOrRange[1];
|
|
6940
|
-
}
|
|
6941
|
-
if (!exclusiveEnd) {
|
|
6942
|
-
end -= 1;
|
|
6943
|
-
}
|
|
6944
|
-
if (exclusiveStart) {
|
|
6945
|
-
start += 1;
|
|
6946
|
-
}
|
|
6947
|
-
if (end - 1 < start) {
|
|
6948
|
-
if (!allowEmptyRange) {
|
|
6949
|
-
console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set options.allowEmptyRange to true`);
|
|
6950
|
-
}
|
|
6951
|
-
return [];
|
|
6952
|
-
}
|
|
6953
|
-
return Array.from({ length: end - start }, (_, index) => index * stepSize + start);
|
|
6954
|
-
};
|
|
6955
|
-
var closestMatch = (list, firstCloser) => {
|
|
6956
|
-
return list.reduce((item1, item2) => {
|
|
6957
|
-
return firstCloser(item1, item2) ? item1 : item2;
|
|
6958
|
-
});
|
|
6959
|
-
};
|
|
6960
|
-
var getNeighbours = (list, item, neighbourDistance = 2) => {
|
|
6961
|
-
const index = list.indexOf(item);
|
|
6962
|
-
const totalItems = neighbourDistance * 2 + 1;
|
|
6963
|
-
if (list.length < totalItems) {
|
|
6964
|
-
console.warn("List is to short");
|
|
6965
|
-
return list;
|
|
6966
|
-
}
|
|
6967
|
-
if (index === -1) {
|
|
6968
|
-
console.error("item not found in list");
|
|
6969
|
-
return list.splice(0, totalItems);
|
|
6970
|
-
}
|
|
6971
|
-
let start = index - neighbourDistance;
|
|
6972
|
-
if (start < 0) {
|
|
6973
|
-
start += list.length;
|
|
6974
|
-
}
|
|
6975
|
-
const end = (index + neighbourDistance + 1) % list.length;
|
|
6976
|
-
const result = [];
|
|
6977
|
-
let ignoreOnce = list.length === totalItems;
|
|
6978
|
-
for (let i = start; i !== end || ignoreOnce; i = (i + 1) % list.length) {
|
|
6979
|
-
result.push(list[i]);
|
|
6980
|
-
if (end === i && ignoreOnce) {
|
|
6981
|
-
ignoreOnce = false;
|
|
6982
|
-
}
|
|
6983
|
-
}
|
|
6984
|
-
return result;
|
|
6985
|
-
};
|
|
6986
|
-
var createLoopingListWithIndex = (list, startIndex = 0, length = 0, forwards = true) => {
|
|
6987
|
-
if (length < 0) {
|
|
6988
|
-
console.warn(`createLoopingList: length must be >= 0, given ${length}`);
|
|
6989
|
-
} else if (length === 0) {
|
|
6990
|
-
length = list.length;
|
|
6991
|
-
}
|
|
6992
|
-
const returnList = [];
|
|
6993
|
-
if (forwards) {
|
|
6994
|
-
for (let i = startIndex; returnList.length < length; i = (i + 1) % list.length) {
|
|
6995
|
-
returnList.push([i, list[i]]);
|
|
6996
|
-
}
|
|
6997
|
-
} else {
|
|
6998
|
-
for (let i = startIndex; returnList.length < length; i = i === 0 ? i = list.length - 1 : i - 1) {
|
|
6999
|
-
returnList.push([i, list[i]]);
|
|
7000
|
-
}
|
|
7001
|
-
}
|
|
7002
|
-
return returnList;
|
|
7003
|
-
};
|
|
7004
|
-
var createLoopingList = (list, startIndex = 0, length = 0, forwards = true) => {
|
|
7005
|
-
return createLoopingListWithIndex(list, startIndex, length, forwards).map(([_, item]) => item);
|
|
7006
|
-
};
|
|
7007
|
-
var moveItems = (list, move = 0) => {
|
|
7008
|
-
const result = [];
|
|
7009
|
-
let start = move;
|
|
7010
|
-
if (start < 0) {
|
|
7011
|
-
start = list.length - move;
|
|
7012
|
-
}
|
|
7013
|
-
start = start % list.length;
|
|
7014
|
-
for (let i = 0; i < list.length; i++) {
|
|
7015
|
-
result[i] = list[(i + start) % list.length];
|
|
7016
|
-
}
|
|
7017
|
-
return result;
|
|
7018
|
-
};
|
|
7019
|
-
function resolveSingleOrArray(value) {
|
|
7020
|
-
if (Array.isArray(value)) {
|
|
7021
|
-
return value;
|
|
7022
|
-
} else if (value) {
|
|
7023
|
-
return [value];
|
|
7024
|
-
}
|
|
7025
|
-
return [];
|
|
7026
|
-
}
|
|
7027
|
-
var ArrayUtil = {
|
|
7028
|
-
unique: (list) => {
|
|
7029
|
-
const seen = /* @__PURE__ */ new Set();
|
|
7030
|
-
return list.filter((item) => {
|
|
7031
|
-
if (seen.has(item)) {
|
|
7032
|
-
return false;
|
|
7033
|
-
}
|
|
7034
|
-
seen.add(item);
|
|
7035
|
-
return true;
|
|
7036
|
-
});
|
|
7037
|
-
},
|
|
7038
|
-
difference: (list, removeList) => {
|
|
7039
|
-
const remove = new Set(removeList);
|
|
7040
|
-
return list.filter((item) => !remove.has(item));
|
|
7041
|
-
},
|
|
7042
|
-
moveItems,
|
|
7043
|
-
resolveSingleOrArray
|
|
7044
|
-
};
|
|
7045
|
-
|
|
7046
|
-
// src/utils/propsUtil.ts
|
|
7047
|
-
function bool(isActive) {
|
|
7048
|
-
return isActive ? "" : void 0;
|
|
7049
|
-
}
|
|
7050
|
-
function name(name2, props = {}) {
|
|
7051
|
-
return props["data-name"] ? String(props["data-name"]) : name2;
|
|
7052
|
-
}
|
|
7053
|
-
function interactionStatesData(interactionStates) {
|
|
7054
|
-
return {
|
|
7055
|
-
"data-disabled": bool(!!interactionStates.disabled),
|
|
7056
|
-
"data-invalid": bool(!!interactionStates.invalid),
|
|
7057
|
-
"data-readonly": bool(!!interactionStates.readOnly),
|
|
7058
|
-
"data-required": bool(!!interactionStates.required)
|
|
7059
|
-
};
|
|
7060
|
-
}
|
|
7061
|
-
var dataAttributes = {
|
|
7062
|
-
bool,
|
|
7063
|
-
name,
|
|
7064
|
-
interactionStates: interactionStatesData
|
|
7065
|
-
};
|
|
7066
|
-
function mouseEventExtender({
|
|
7067
|
-
fromProps,
|
|
7068
|
-
extensions
|
|
7069
|
-
}) {
|
|
7070
|
-
return (event) => {
|
|
7071
|
-
fromProps?.(event);
|
|
7072
|
-
ArrayUtil.resolveSingleOrArray(extensions).forEach((element) => element(event));
|
|
7073
|
-
};
|
|
7074
|
-
}
|
|
7075
|
-
function keyboardEventExtender({
|
|
7076
|
-
fromProps,
|
|
7077
|
-
extensions
|
|
7078
|
-
}) {
|
|
7079
|
-
return (event) => {
|
|
7080
|
-
fromProps?.(event);
|
|
7081
|
-
ArrayUtil.resolveSingleOrArray(extensions).forEach((element) => element(event));
|
|
7082
|
-
};
|
|
7083
|
-
}
|
|
7084
|
-
var extender = {
|
|
7085
|
-
mouseEvent: mouseEventExtender,
|
|
7086
|
-
keyboardEvent: keyboardEventExtender
|
|
7087
|
-
};
|
|
7088
|
-
function click(onClick) {
|
|
7089
|
-
const keyboardEventHandler = (event) => {
|
|
7090
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
7091
|
-
event.preventDefault();
|
|
7092
|
-
event.stopPropagation();
|
|
7093
|
-
onClick();
|
|
7094
|
-
}
|
|
7095
|
-
};
|
|
7096
|
-
return {
|
|
7097
|
-
onClick,
|
|
7098
|
-
onKeyDown: keyboardEventHandler
|
|
7099
|
-
};
|
|
7100
|
-
}
|
|
7101
|
-
function close2(onClose) {
|
|
7102
|
-
return (event) => {
|
|
7103
|
-
if (event.key === "Escape") {
|
|
7104
|
-
event.preventDefault();
|
|
7105
|
-
event.stopPropagation();
|
|
7106
|
-
onClose?.();
|
|
7107
|
-
}
|
|
7108
|
-
};
|
|
7109
|
-
}
|
|
7110
|
-
function navigate({
|
|
7111
|
-
left,
|
|
7112
|
-
right,
|
|
7113
|
-
up: up2,
|
|
7114
|
-
down: down2
|
|
7115
|
-
}) {
|
|
7116
|
-
return (event) => {
|
|
7117
|
-
switch (event.key) {
|
|
7118
|
-
case "ArrowLeft":
|
|
7119
|
-
left(event);
|
|
7120
|
-
event.preventDefault();
|
|
7121
|
-
event.stopPropagation();
|
|
7122
|
-
break;
|
|
7123
|
-
case "ArrowRight":
|
|
7124
|
-
right(event);
|
|
7125
|
-
event.preventDefault();
|
|
7126
|
-
event.stopPropagation();
|
|
7127
|
-
break;
|
|
7128
|
-
case "ArrowUp":
|
|
7129
|
-
up2(event);
|
|
7130
|
-
event.preventDefault();
|
|
7131
|
-
event.stopPropagation();
|
|
7132
|
-
break;
|
|
7133
|
-
case "ArrowDown":
|
|
7134
|
-
down2(event);
|
|
7135
|
-
event.preventDefault();
|
|
7136
|
-
event.stopPropagation();
|
|
7137
|
-
break;
|
|
7138
|
-
}
|
|
7139
|
-
};
|
|
7140
|
-
}
|
|
7141
|
-
function mergeProps(slotProps, childProps) {
|
|
7142
|
-
const result = { ...childProps };
|
|
7143
|
-
for (const key in slotProps) {
|
|
7144
|
-
const slotValue = slotProps[key];
|
|
7145
|
-
const childValue = childProps[key];
|
|
7146
|
-
if (key === "className") {
|
|
7147
|
-
result.className = [slotValue, childValue].filter(Boolean).join(" ");
|
|
7148
|
-
} else if (key === "style") {
|
|
7149
|
-
result.style = { ...slotValue, ...childValue };
|
|
7150
|
-
} else if (key.startsWith("on") && typeof slotValue === "function" && typeof childValue === "function") {
|
|
7151
|
-
result[key] = (...args) => {
|
|
7152
|
-
slotValue(...args);
|
|
7153
|
-
childValue(...args);
|
|
7154
|
-
};
|
|
7155
|
-
} else {
|
|
7156
|
-
result[key] = childValue ?? slotValue;
|
|
7157
|
-
}
|
|
7158
|
-
}
|
|
7159
|
-
return result;
|
|
7160
|
-
}
|
|
7161
|
-
function interactionStatesAria(interactionStates, props = {}) {
|
|
7162
|
-
return {
|
|
7163
|
-
"aria-disabled": props["aria-disabled"] ?? interactionStates.disabled,
|
|
7164
|
-
"aria-invalid": props["aria-invalid"] ?? interactionStates.invalid,
|
|
7165
|
-
"aria-readonly": props["aria-readonly"] ?? interactionStates.readOnly,
|
|
7166
|
-
"aria-required": props["aria-required"] ?? interactionStates.required
|
|
7167
|
-
};
|
|
7168
|
-
}
|
|
7169
|
-
var aria = {
|
|
7170
|
-
close: close2,
|
|
7171
|
-
click,
|
|
7172
|
-
navigate,
|
|
7173
|
-
interactionStates: interactionStatesAria
|
|
7174
|
-
};
|
|
7175
|
-
var PropsUtil = {
|
|
7176
|
-
extender,
|
|
7177
|
-
dataAttributes,
|
|
7178
|
-
aria,
|
|
7179
|
-
mergeProps
|
|
7180
|
-
};
|
|
7181
|
-
|
|
7182
|
-
// src/components/form/FieldLayout.tsx
|
|
6912
|
+
import clsx5 from "clsx";
|
|
7183
6913
|
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
7184
6914
|
var FormFieldLayout = forwardRef2(function FormFieldLayout2({
|
|
7185
6915
|
children,
|
|
@@ -7193,6 +6923,7 @@ var FormFieldLayout = forwardRef2(function FormFieldLayout2({
|
|
|
7193
6923
|
invalidDescriptionProps,
|
|
7194
6924
|
description,
|
|
7195
6925
|
descriptionProps,
|
|
6926
|
+
showRequiredIndicator = true,
|
|
7196
6927
|
...props
|
|
7197
6928
|
}, ref) {
|
|
7198
6929
|
const generatedId = useId();
|
|
@@ -7230,7 +6961,7 @@ var FormFieldLayout = forwardRef2(function FormFieldLayout2({
|
|
|
7230
6961
|
{
|
|
7231
6962
|
...props,
|
|
7232
6963
|
ref,
|
|
7233
|
-
|
|
6964
|
+
className: clsx5("form-field-container", props.className),
|
|
7234
6965
|
children: [
|
|
7235
6966
|
label && /* @__PURE__ */ jsxs6(
|
|
7236
6967
|
"label",
|
|
@@ -7238,10 +6969,10 @@ var FormFieldLayout = forwardRef2(function FormFieldLayout2({
|
|
|
7238
6969
|
...labelProps,
|
|
7239
6970
|
id: ids.label,
|
|
7240
6971
|
htmlFor: ids.input,
|
|
7241
|
-
|
|
6972
|
+
className: clsx5("form-field-label", labelProps?.className),
|
|
7242
6973
|
children: [
|
|
7243
6974
|
label,
|
|
7244
|
-
required && /* @__PURE__ */ jsx12("div", { role: "none", className: "bg-primary w-2 h-2 rounded-full" })
|
|
6975
|
+
showRequiredIndicator && required && /* @__PURE__ */ jsx12("div", { role: "none", className: "bg-primary w-2 h-2 rounded-full" })
|
|
7245
6976
|
]
|
|
7246
6977
|
}
|
|
7247
6978
|
),
|
|
@@ -7250,7 +6981,7 @@ var FormFieldLayout = forwardRef2(function FormFieldLayout2({
|
|
|
7250
6981
|
{
|
|
7251
6982
|
...descriptionProps,
|
|
7252
6983
|
id: ids.description,
|
|
7253
|
-
|
|
6984
|
+
className: clsx5("form-field-description", descriptionProps?.className),
|
|
7254
6985
|
children: description
|
|
7255
6986
|
}
|
|
7256
6987
|
),
|
|
@@ -7260,10 +6991,10 @@ var FormFieldLayout = forwardRef2(function FormFieldLayout2({
|
|
|
7260
6991
|
{
|
|
7261
6992
|
...invalidDescriptionProps,
|
|
7262
6993
|
id: ids.description,
|
|
7263
|
-
"data-name": "form-field-error",
|
|
7264
6994
|
role: "alert",
|
|
7265
6995
|
"aria-hidden": !invalid,
|
|
7266
6996
|
"aria-live": "polite",
|
|
6997
|
+
className: clsx5("form-field-error", invalidDescriptionProps?.className),
|
|
7267
6998
|
children: invalidDescription
|
|
7268
6999
|
}
|
|
7269
7000
|
)
|
|
@@ -7284,13 +7015,18 @@ function useForm() {
|
|
|
7284
7015
|
if (!ctx) throw new Error("FormContext is only available inside a <Form>");
|
|
7285
7016
|
return ctx;
|
|
7286
7017
|
}
|
|
7287
|
-
function useFormField(key, { triggerUpdate = true }) {
|
|
7018
|
+
function useFormField(key, { triggerUpdate = true, validationBehaviour = "touched" }) {
|
|
7288
7019
|
const context = useContext(FormContext);
|
|
7289
7020
|
const subscribe = useCallback2((cb) => {
|
|
7290
7021
|
if (!context) return () => {
|
|
7291
7022
|
};
|
|
7292
7023
|
return context.store.subscribe(key, cb);
|
|
7293
7024
|
}, [context, key]);
|
|
7025
|
+
const subscribeAll = useCallback2((cb) => {
|
|
7026
|
+
if (!context) return () => {
|
|
7027
|
+
};
|
|
7028
|
+
return context.store.subscribe("ALL", cb);
|
|
7029
|
+
}, [context]);
|
|
7294
7030
|
const value = useSyncExternalStore(
|
|
7295
7031
|
subscribe,
|
|
7296
7032
|
() => context ? context.store.getValue(key) : void 0
|
|
@@ -7299,31 +7035,85 @@ function useFormField(key, { triggerUpdate = true }) {
|
|
|
7299
7035
|
subscribe,
|
|
7300
7036
|
() => context ? context.store.getError(key) : void 0
|
|
7301
7037
|
);
|
|
7038
|
+
const touched = useSyncExternalStore(
|
|
7039
|
+
subscribe,
|
|
7040
|
+
() => context ? context.store.getTouched(key) : void 0
|
|
7041
|
+
);
|
|
7042
|
+
const hasTriedSubmitting = useSyncExternalStore(
|
|
7043
|
+
subscribeAll,
|
|
7044
|
+
() => context ? context.store.getHasTriedSubmitting() : void 0
|
|
7045
|
+
);
|
|
7046
|
+
const isShowingErrors = validationBehaviour === "always" || validationBehaviour === "touched" && (touched ?? false) || validationBehaviour === "submit" && (hasTriedSubmitting ?? false);
|
|
7302
7047
|
const getDataProps = useCallback2(() => {
|
|
7303
7048
|
return {
|
|
7304
|
-
value
|
|
7049
|
+
value,
|
|
7305
7050
|
onValueChange: (val) => context?.store.setValue(key, val),
|
|
7306
7051
|
onEditComplete: (val) => {
|
|
7307
7052
|
context?.store.setTouched(key);
|
|
7308
7053
|
context?.store.setValue(key, val, triggerUpdate);
|
|
7309
7054
|
}
|
|
7310
7055
|
};
|
|
7311
|
-
}, [context, key, triggerUpdate]);
|
|
7056
|
+
}, [context?.store, key, triggerUpdate, value]);
|
|
7312
7057
|
if (!context) return null;
|
|
7313
7058
|
const { registerRef } = context;
|
|
7314
7059
|
return {
|
|
7315
7060
|
store: context.store,
|
|
7316
7061
|
value,
|
|
7317
|
-
error,
|
|
7062
|
+
error: isShowingErrors ? error : void 0,
|
|
7063
|
+
touched: touched ?? false,
|
|
7064
|
+
hasTriedSubmitting: hasTriedSubmitting ?? false,
|
|
7318
7065
|
dataProps: getDataProps(),
|
|
7319
7066
|
registerRef: registerRef(key)
|
|
7320
7067
|
};
|
|
7321
7068
|
}
|
|
7069
|
+
function useFormObserver({ formStore } = {}) {
|
|
7070
|
+
const context = useContext(FormContext);
|
|
7071
|
+
const store = formStore ?? context?.store;
|
|
7072
|
+
const subscribe = useCallback2((cb) => {
|
|
7073
|
+
if (!store) return () => {
|
|
7074
|
+
};
|
|
7075
|
+
return store.subscribe("ALL", cb);
|
|
7076
|
+
}, [store]);
|
|
7077
|
+
const values = useSyncExternalStore(subscribe, () => store ? store.getAllValues() : void 0);
|
|
7078
|
+
const errors = useSyncExternalStore(subscribe, () => store ? store.getErrors() : void 0);
|
|
7079
|
+
const touched = useSyncExternalStore(subscribe, () => store ? store.getAllTouched() : void 0);
|
|
7080
|
+
const hasErrors = useSyncExternalStore(subscribe, () => store ? store.getHasError() : void 0);
|
|
7081
|
+
const hasTriedSubmitting = useSyncExternalStore(subscribe, () => store ? store.getHasTriedSubmitting() : void 0);
|
|
7082
|
+
if (!store) return null;
|
|
7083
|
+
return {
|
|
7084
|
+
store,
|
|
7085
|
+
values,
|
|
7086
|
+
errors,
|
|
7087
|
+
touched,
|
|
7088
|
+
hasErrors,
|
|
7089
|
+
hasTriedSubmitting
|
|
7090
|
+
};
|
|
7091
|
+
}
|
|
7092
|
+
function useFormObserverKey({ formStore, key }) {
|
|
7093
|
+
const context = useContext(FormContext);
|
|
7094
|
+
const store = formStore ?? context?.store;
|
|
7095
|
+
const subscribe = useCallback2((cb) => {
|
|
7096
|
+
if (!store) return () => {
|
|
7097
|
+
};
|
|
7098
|
+
return store.subscribe(key, cb);
|
|
7099
|
+
}, [store, key]);
|
|
7100
|
+
const value = useSyncExternalStore(subscribe, () => store ? store.getValue(key) : void 0);
|
|
7101
|
+
const error = useSyncExternalStore(subscribe, () => store ? store.getError(key) : void 0);
|
|
7102
|
+
const touched = useSyncExternalStore(subscribe, () => store ? store.getTouched(key) : void 0);
|
|
7103
|
+
if (!store) return null;
|
|
7104
|
+
return {
|
|
7105
|
+
store,
|
|
7106
|
+
value,
|
|
7107
|
+
error,
|
|
7108
|
+
touched,
|
|
7109
|
+
hasError: !!error
|
|
7110
|
+
};
|
|
7111
|
+
}
|
|
7322
7112
|
|
|
7323
7113
|
// src/components/form/FormField.tsx
|
|
7324
7114
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
7325
|
-
var FormField = ({ children, name: name2, triggerUpdateOnEditComplete, ...props }) => {
|
|
7326
|
-
const formField = useFormField(name2, { triggerUpdate: triggerUpdateOnEditComplete });
|
|
7115
|
+
var FormField = ({ children, name: name2, triggerUpdateOnEditComplete, validationBehaviour, ...props }) => {
|
|
7116
|
+
const formField = useFormField(name2, { triggerUpdate: triggerUpdateOnEditComplete, validationBehaviour });
|
|
7327
7117
|
if (!formField) {
|
|
7328
7118
|
throw new Error("<FormField> can only be used inside a FormContext try wrapping your app in a <FormProvider>");
|
|
7329
7119
|
}
|
|
@@ -7335,20 +7125,47 @@ var FormField = ({ children, name: name2, triggerUpdateOnEditComplete, ...props
|
|
|
7335
7125
|
ref: formField.registerRef
|
|
7336
7126
|
},
|
|
7337
7127
|
interactionStates: formFieldLayoutBag.interactionStates,
|
|
7128
|
+
touched: formField.touched,
|
|
7338
7129
|
other: {
|
|
7339
7130
|
updateValue: (value) => formField.store.setValue(name2, value, true)
|
|
7340
7131
|
}
|
|
7341
7132
|
}) });
|
|
7342
7133
|
};
|
|
7343
7134
|
|
|
7135
|
+
// src/utils/bagFunctions.ts
|
|
7136
|
+
var resolve = (bagFunctionOrValue, bag) => {
|
|
7137
|
+
if (typeof bagFunctionOrValue === "function") {
|
|
7138
|
+
return bagFunctionOrValue(bag);
|
|
7139
|
+
}
|
|
7140
|
+
return bagFunctionOrValue;
|
|
7141
|
+
};
|
|
7142
|
+
var BagFunctionUtil = {
|
|
7143
|
+
resolve
|
|
7144
|
+
};
|
|
7145
|
+
|
|
7146
|
+
// src/components/form/FormObserver.tsx
|
|
7147
|
+
var FormObserver = ({ children, formStore }) => {
|
|
7148
|
+
const formObserver = useFormObserver({ formStore });
|
|
7149
|
+
if (!formObserver) {
|
|
7150
|
+
throw new Error("<FormObserver> can only be used inside a <FormProvider>");
|
|
7151
|
+
}
|
|
7152
|
+
return BagFunctionUtil.resolve(children, formObserver);
|
|
7153
|
+
};
|
|
7154
|
+
var FormObserverKey = ({ children, formStore, key }) => {
|
|
7155
|
+
const formObserver = useFormObserverKey({ formStore, key });
|
|
7156
|
+
if (!formObserver) {
|
|
7157
|
+
throw new Error("<FormObserverKey> can only be used inside a <FormProvider>");
|
|
7158
|
+
}
|
|
7159
|
+
return BagFunctionUtil.resolve(children, formObserver);
|
|
7160
|
+
};
|
|
7161
|
+
|
|
7344
7162
|
// src/components/form/FormStore.ts
|
|
7345
7163
|
var FormStore = class {
|
|
7346
7164
|
constructor({
|
|
7347
7165
|
initialValues,
|
|
7348
7166
|
hasTriedSubmitting,
|
|
7349
7167
|
submittingTouchesAll = true,
|
|
7350
|
-
validators = {}
|
|
7351
|
-
validationBehaviour = "touched"
|
|
7168
|
+
validators = {}
|
|
7352
7169
|
}) {
|
|
7353
7170
|
this.hasTriedSubmitting = false;
|
|
7354
7171
|
this.errors = {};
|
|
@@ -7365,7 +7182,6 @@ var FormStore = class {
|
|
|
7365
7182
|
});
|
|
7366
7183
|
}
|
|
7367
7184
|
this.validators = validators;
|
|
7368
|
-
this.validationBehaviour = validationBehaviour;
|
|
7369
7185
|
this.validateAll();
|
|
7370
7186
|
}
|
|
7371
7187
|
// Values
|
|
@@ -7378,8 +7194,8 @@ var FormStore = class {
|
|
|
7378
7194
|
setValue(key, value, triggerUpdate = false) {
|
|
7379
7195
|
if (this.values[key] !== value) {
|
|
7380
7196
|
this.values[key] = value;
|
|
7381
|
-
this.validate(key);
|
|
7382
7197
|
this.notify({ type: "onChange", key, value, values: this.values });
|
|
7198
|
+
this.validate(key);
|
|
7383
7199
|
}
|
|
7384
7200
|
if (triggerUpdate) {
|
|
7385
7201
|
this.notify({
|
|
@@ -7411,10 +7227,12 @@ var FormStore = class {
|
|
|
7411
7227
|
getTouched(key) {
|
|
7412
7228
|
return !!this.touched[key];
|
|
7413
7229
|
}
|
|
7230
|
+
getAllTouched() {
|
|
7231
|
+
return { ...this.touched };
|
|
7232
|
+
}
|
|
7414
7233
|
setTouched(key, isTouched = true) {
|
|
7415
7234
|
if (this.touched[key] === isTouched) return;
|
|
7416
7235
|
this.touched[key] = isTouched;
|
|
7417
|
-
this.validate(key);
|
|
7418
7236
|
this.notify({ type: "onTouched", key, value: this.values[key], values: { ...this.values } });
|
|
7419
7237
|
}
|
|
7420
7238
|
// Error and Validation
|
|
@@ -7436,10 +7254,8 @@ var FormStore = class {
|
|
|
7436
7254
|
}
|
|
7437
7255
|
this.notify({ type: "onError", key, value: this.values[key], error, values: { ...this.values } });
|
|
7438
7256
|
}
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
this.validationBehaviour = validationBehaviour;
|
|
7442
|
-
this.validateAll();
|
|
7257
|
+
getHasTriedSubmitting() {
|
|
7258
|
+
return this.hasTriedSubmitting;
|
|
7443
7259
|
}
|
|
7444
7260
|
changeValidators(validators) {
|
|
7445
7261
|
this.validators = { ...this.validators, ...validators };
|
|
@@ -7447,8 +7263,7 @@ var FormStore = class {
|
|
|
7447
7263
|
}
|
|
7448
7264
|
validate(key) {
|
|
7449
7265
|
const validator = this.validators[key];
|
|
7450
|
-
|
|
7451
|
-
if (!validator || !shouldValidate) {
|
|
7266
|
+
if (!validator) {
|
|
7452
7267
|
this.setError(key, void 0);
|
|
7453
7268
|
return;
|
|
7454
7269
|
}
|
|
@@ -7486,7 +7301,6 @@ var FormStore = class {
|
|
|
7486
7301
|
if (this.submittingTouchesAll) {
|
|
7487
7302
|
Object.keys(this.initialValues).forEach((k) => {
|
|
7488
7303
|
this.touched[k] = true;
|
|
7489
|
-
this.validate(k);
|
|
7490
7304
|
});
|
|
7491
7305
|
}
|
|
7492
7306
|
const hasErrors = Object.keys(this.errors).length > 0;
|
|
@@ -7521,7 +7335,6 @@ function useCreateForm({
|
|
|
7521
7335
|
initialValues,
|
|
7522
7336
|
hasTriedSubmitting,
|
|
7523
7337
|
validators,
|
|
7524
|
-
validationBehaviour,
|
|
7525
7338
|
scrollToElements = true,
|
|
7526
7339
|
scrollOptions = { behavior: "smooth", block: "center" }
|
|
7527
7340
|
}) {
|
|
@@ -7529,13 +7342,9 @@ function useCreateForm({
|
|
|
7529
7342
|
new FormStore({
|
|
7530
7343
|
initialValues,
|
|
7531
7344
|
hasTriedSubmitting,
|
|
7532
|
-
validators
|
|
7533
|
-
validationBehaviour
|
|
7345
|
+
validators
|
|
7534
7346
|
})
|
|
7535
7347
|
);
|
|
7536
|
-
useEffect3(() => {
|
|
7537
|
-
storeRef.current.changeValidationBehavoir(validationBehaviour);
|
|
7538
|
-
}, [validationBehaviour]);
|
|
7539
7348
|
useEffect3(() => {
|
|
7540
7349
|
storeRef.current.changeValidators(validators);
|
|
7541
7350
|
}, [validators]);
|
|
@@ -7606,12 +7415,7 @@ function useCreateForm({
|
|
|
7606
7415
|
storeRef.current.setValues(updater);
|
|
7607
7416
|
}
|
|
7608
7417
|
},
|
|
7609
|
-
validateAll: () => storeRef.current.validateAll()
|
|
7610
|
-
getError: (key) => storeRef.current.getError(key),
|
|
7611
|
-
getErrors: () => storeRef.current.getErrors(),
|
|
7612
|
-
getIsValid: () => !storeRef.current.getHasError(),
|
|
7613
|
-
getValue: (key) => storeRef.current.getValue(key),
|
|
7614
|
-
getValues: () => storeRef.current.getAllValues()
|
|
7418
|
+
validateAll: () => storeRef.current.validateAll()
|
|
7615
7419
|
}), []);
|
|
7616
7420
|
return {
|
|
7617
7421
|
store: storeRef.current,
|
|
@@ -7914,9 +7718,142 @@ import {
|
|
|
7914
7718
|
useRef as useRef3,
|
|
7915
7719
|
useState as useState7
|
|
7916
7720
|
} from "react";
|
|
7917
|
-
import
|
|
7721
|
+
import clsx6 from "clsx";
|
|
7918
7722
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
7919
7723
|
|
|
7724
|
+
// src/utils/array.ts
|
|
7725
|
+
var equalSizeGroups = (array, groupSize) => {
|
|
7726
|
+
if (groupSize <= 0) {
|
|
7727
|
+
console.warn(`group size should be greater than 0: groupSize = ${groupSize}`);
|
|
7728
|
+
return [[...array]];
|
|
7729
|
+
}
|
|
7730
|
+
const groups = [];
|
|
7731
|
+
for (let i = 0; i < array.length; i += groupSize) {
|
|
7732
|
+
groups.push(array.slice(i, Math.min(i + groupSize, array.length)));
|
|
7733
|
+
}
|
|
7734
|
+
return groups;
|
|
7735
|
+
};
|
|
7736
|
+
var defaultRangeOptions = {
|
|
7737
|
+
allowEmptyRange: false,
|
|
7738
|
+
stepSize: 1,
|
|
7739
|
+
exclusiveStart: false,
|
|
7740
|
+
exclusiveEnd: true
|
|
7741
|
+
};
|
|
7742
|
+
var range = (endOrRange, options) => {
|
|
7743
|
+
const { allowEmptyRange, stepSize, exclusiveStart, exclusiveEnd } = { ...defaultRangeOptions, ...options };
|
|
7744
|
+
let start = 0;
|
|
7745
|
+
let end;
|
|
7746
|
+
if (typeof endOrRange === "number") {
|
|
7747
|
+
end = endOrRange;
|
|
7748
|
+
} else {
|
|
7749
|
+
start = endOrRange[0];
|
|
7750
|
+
end = endOrRange[1];
|
|
7751
|
+
}
|
|
7752
|
+
if (!exclusiveEnd) {
|
|
7753
|
+
end -= 1;
|
|
7754
|
+
}
|
|
7755
|
+
if (exclusiveStart) {
|
|
7756
|
+
start += 1;
|
|
7757
|
+
}
|
|
7758
|
+
if (end - 1 < start) {
|
|
7759
|
+
if (!allowEmptyRange) {
|
|
7760
|
+
console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set options.allowEmptyRange to true`);
|
|
7761
|
+
}
|
|
7762
|
+
return [];
|
|
7763
|
+
}
|
|
7764
|
+
return Array.from({ length: end - start }, (_, index) => index * stepSize + start);
|
|
7765
|
+
};
|
|
7766
|
+
var closestMatch = (list, firstCloser) => {
|
|
7767
|
+
return list.reduce((item1, item2) => {
|
|
7768
|
+
return firstCloser(item1, item2) ? item1 : item2;
|
|
7769
|
+
});
|
|
7770
|
+
};
|
|
7771
|
+
var getNeighbours = (list, item, neighbourDistance = 2) => {
|
|
7772
|
+
const index = list.indexOf(item);
|
|
7773
|
+
const totalItems = neighbourDistance * 2 + 1;
|
|
7774
|
+
if (list.length < totalItems) {
|
|
7775
|
+
console.warn("List is to short");
|
|
7776
|
+
return list;
|
|
7777
|
+
}
|
|
7778
|
+
if (index === -1) {
|
|
7779
|
+
console.error("item not found in list");
|
|
7780
|
+
return list.splice(0, totalItems);
|
|
7781
|
+
}
|
|
7782
|
+
let start = index - neighbourDistance;
|
|
7783
|
+
if (start < 0) {
|
|
7784
|
+
start += list.length;
|
|
7785
|
+
}
|
|
7786
|
+
const end = (index + neighbourDistance + 1) % list.length;
|
|
7787
|
+
const result = [];
|
|
7788
|
+
let ignoreOnce = list.length === totalItems;
|
|
7789
|
+
for (let i = start; i !== end || ignoreOnce; i = (i + 1) % list.length) {
|
|
7790
|
+
result.push(list[i]);
|
|
7791
|
+
if (end === i && ignoreOnce) {
|
|
7792
|
+
ignoreOnce = false;
|
|
7793
|
+
}
|
|
7794
|
+
}
|
|
7795
|
+
return result;
|
|
7796
|
+
};
|
|
7797
|
+
var createLoopingListWithIndex = (list, startIndex = 0, length = 0, forwards = true) => {
|
|
7798
|
+
if (length < 0) {
|
|
7799
|
+
console.warn(`createLoopingList: length must be >= 0, given ${length}`);
|
|
7800
|
+
} else if (length === 0) {
|
|
7801
|
+
length = list.length;
|
|
7802
|
+
}
|
|
7803
|
+
const returnList = [];
|
|
7804
|
+
if (forwards) {
|
|
7805
|
+
for (let i = startIndex; returnList.length < length; i = (i + 1) % list.length) {
|
|
7806
|
+
returnList.push([i, list[i]]);
|
|
7807
|
+
}
|
|
7808
|
+
} else {
|
|
7809
|
+
for (let i = startIndex; returnList.length < length; i = i === 0 ? i = list.length - 1 : i - 1) {
|
|
7810
|
+
returnList.push([i, list[i]]);
|
|
7811
|
+
}
|
|
7812
|
+
}
|
|
7813
|
+
return returnList;
|
|
7814
|
+
};
|
|
7815
|
+
var createLoopingList = (list, startIndex = 0, length = 0, forwards = true) => {
|
|
7816
|
+
return createLoopingListWithIndex(list, startIndex, length, forwards).map(([_, item]) => item);
|
|
7817
|
+
};
|
|
7818
|
+
var moveItems = (list, move = 0) => {
|
|
7819
|
+
const result = [];
|
|
7820
|
+
let start = move;
|
|
7821
|
+
if (start < 0) {
|
|
7822
|
+
start = list.length - move;
|
|
7823
|
+
}
|
|
7824
|
+
start = start % list.length;
|
|
7825
|
+
for (let i = 0; i < list.length; i++) {
|
|
7826
|
+
result[i] = list[(i + start) % list.length];
|
|
7827
|
+
}
|
|
7828
|
+
return result;
|
|
7829
|
+
};
|
|
7830
|
+
function resolveSingleOrArray(value) {
|
|
7831
|
+
if (Array.isArray(value)) {
|
|
7832
|
+
return value;
|
|
7833
|
+
} else if (value) {
|
|
7834
|
+
return [value];
|
|
7835
|
+
}
|
|
7836
|
+
return [];
|
|
7837
|
+
}
|
|
7838
|
+
var ArrayUtil = {
|
|
7839
|
+
unique: (list) => {
|
|
7840
|
+
const seen = /* @__PURE__ */ new Set();
|
|
7841
|
+
return list.filter((item) => {
|
|
7842
|
+
if (seen.has(item)) {
|
|
7843
|
+
return false;
|
|
7844
|
+
}
|
|
7845
|
+
seen.add(item);
|
|
7846
|
+
return true;
|
|
7847
|
+
});
|
|
7848
|
+
},
|
|
7849
|
+
difference: (list, removeList) => {
|
|
7850
|
+
const remove = new Set(removeList);
|
|
7851
|
+
return list.filter((item) => !remove.has(item));
|
|
7852
|
+
},
|
|
7853
|
+
moveItems,
|
|
7854
|
+
resolveSingleOrArray
|
|
7855
|
+
};
|
|
7856
|
+
|
|
7920
7857
|
// src/global-contexts/LocaleContext.tsx
|
|
7921
7858
|
import { createContext as createContext3, useContext as useContext3, useEffect as useEffect5, useMemo as useMemo5, useState as useState6 } from "react";
|
|
7922
7859
|
|
|
@@ -8830,7 +8767,7 @@ function CarouselTabs({
|
|
|
8830
8767
|
},
|
|
8831
8768
|
onClick: () => onChange(index),
|
|
8832
8769
|
onKeyDown: (e) => handleKeyDown(e, index),
|
|
8833
|
-
className:
|
|
8770
|
+
className: clsx6(
|
|
8834
8771
|
"w-8 min-w-8 h-3 min-h-3 first:rounded-l-md last:rounded-r-md",
|
|
8835
8772
|
{
|
|
8836
8773
|
"bg-carousel-dot-disabled hover:bg-carousel-dot-active": currentIndex !== index,
|
|
@@ -8865,7 +8802,7 @@ var CarouselSlide = forwardRef4(
|
|
|
8865
8802
|
...props,
|
|
8866
8803
|
ref,
|
|
8867
8804
|
id: `${id}-slide-${index}`,
|
|
8868
|
-
className:
|
|
8805
|
+
className: clsx6("focus-style-none group/slide", props.className),
|
|
8869
8806
|
tabIndex: isSelected ? 0 : void 0,
|
|
8870
8807
|
role: "group",
|
|
8871
8808
|
"aria-roledescription": translation("slide"),
|
|
@@ -9014,7 +8951,7 @@ var Carousel = ({
|
|
|
9014
8951
|
{
|
|
9015
8952
|
ref: carouselContainerRef,
|
|
9016
8953
|
...props,
|
|
9017
|
-
className:
|
|
8954
|
+
className: clsx6("flex-col-2 items-center w-full", props.className),
|
|
9018
8955
|
id,
|
|
9019
8956
|
role: "region",
|
|
9020
8957
|
"aria-roledescription": translation("slide"),
|
|
@@ -9023,7 +8960,7 @@ var Carousel = ({
|
|
|
9023
8960
|
"div",
|
|
9024
8961
|
{
|
|
9025
8962
|
...slideContainerProps,
|
|
9026
|
-
className:
|
|
8963
|
+
className: clsx6(`relative w-full overflow-hidden`, heightClassName, slideContainerProps?.className),
|
|
9027
8964
|
children: [
|
|
9028
8965
|
hintNext ? /* @__PURE__ */ jsxs7(
|
|
9029
8966
|
"div",
|
|
@@ -9032,7 +8969,7 @@ var Carousel = ({
|
|
|
9032
8969
|
onPointerMove: handlePointerMove,
|
|
9033
8970
|
onPointerUp: handlePointerUp,
|
|
9034
8971
|
onPointerLeave: handlePointerUp,
|
|
9035
|
-
className:
|
|
8972
|
+
className: clsx6(`flex-row-2 relative h-full`, heightClassName),
|
|
9036
8973
|
children: [
|
|
9037
8974
|
/* @__PURE__ */ jsx18("div", { className: "flex-row-2 relative h-full w-full px-2 overflow-hidden", children: items.map(({
|
|
9038
8975
|
item,
|
|
@@ -9045,7 +8982,7 @@ var Carousel = ({
|
|
|
9045
8982
|
ref: isInItems ? slideRefs[index] : void 0,
|
|
9046
8983
|
index,
|
|
9047
8984
|
isSelected: isInItems && currentIndex === index,
|
|
9048
|
-
className:
|
|
8985
|
+
className: clsx6(
|
|
9049
8986
|
`absolute left-[50%] h-full overflow-hidden transition-transform ease-in-out`,
|
|
9050
8987
|
slideClassName
|
|
9051
8988
|
),
|
|
@@ -9062,13 +8999,13 @@ var Carousel = ({
|
|
|
9062
8999
|
/* @__PURE__ */ jsx18(
|
|
9063
9000
|
"div",
|
|
9064
9001
|
{
|
|
9065
|
-
className:
|
|
9002
|
+
className: clsx6(`hidden desktop:block pointer-events-none absolute left-0 h-full w-[20%] bg-gradient-to-r to-transparent`, blurColor)
|
|
9066
9003
|
}
|
|
9067
9004
|
),
|
|
9068
9005
|
/* @__PURE__ */ jsx18(
|
|
9069
9006
|
"div",
|
|
9070
9007
|
{
|
|
9071
|
-
className:
|
|
9008
|
+
className: clsx6(`hidden desktop:block pointer-events-none absolute right-0 h-full w-[20%] bg-gradient-to-l to-transparent`, blurColor)
|
|
9072
9009
|
}
|
|
9073
9010
|
)
|
|
9074
9011
|
]
|
|
@@ -9077,7 +9014,7 @@ var Carousel = ({
|
|
|
9077
9014
|
"div",
|
|
9078
9015
|
{
|
|
9079
9016
|
ref: slideRefs[currentIndex],
|
|
9080
|
-
className:
|
|
9017
|
+
className: clsx6("px-16 h-full"),
|
|
9081
9018
|
tabIndex: 0,
|
|
9082
9019
|
role: "group",
|
|
9083
9020
|
"aria-roledescription": translation("slide"),
|
|
@@ -9094,7 +9031,7 @@ var Carousel = ({
|
|
|
9094
9031
|
{
|
|
9095
9032
|
layout: "icon",
|
|
9096
9033
|
color: "neutral",
|
|
9097
|
-
className:
|
|
9034
|
+
className: clsx6("absolute z-10 left-2 top-1/2 -translate-y-1/2 shadow-md", { hidden: !canGoLeft() }),
|
|
9098
9035
|
disabled: !canGoLeft(),
|
|
9099
9036
|
onClick: () => left(),
|
|
9100
9037
|
children: /* @__PURE__ */ jsx18(ChevronLeft, { size: 24 })
|
|
@@ -9105,7 +9042,7 @@ var Carousel = ({
|
|
|
9105
9042
|
{
|
|
9106
9043
|
layout: "icon",
|
|
9107
9044
|
color: "neutral",
|
|
9108
|
-
className:
|
|
9045
|
+
className: clsx6("absolute z-10 right-2 top-1/2 -translate-y-1/2 shadow-md", { hidden: !canGoRight() }),
|
|
9109
9046
|
disabled: !canGoRight(),
|
|
9110
9047
|
onClick: () => right(),
|
|
9111
9048
|
children: /* @__PURE__ */ jsx18(ChevronRight, { size: 24 })
|
|
@@ -9122,7 +9059,7 @@ var Carousel = ({
|
|
|
9122
9059
|
};
|
|
9123
9060
|
|
|
9124
9061
|
// src/components/layout/DividerInserter.tsx
|
|
9125
|
-
import
|
|
9062
|
+
import clsx7 from "clsx";
|
|
9126
9063
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
9127
9064
|
var DividerInserter = ({
|
|
9128
9065
|
children,
|
|
@@ -9140,7 +9077,7 @@ var DividerInserter = ({
|
|
|
9140
9077
|
}
|
|
9141
9078
|
}
|
|
9142
9079
|
}
|
|
9143
|
-
return /* @__PURE__ */ jsx19("div", { className:
|
|
9080
|
+
return /* @__PURE__ */ jsx19("div", { className: clsx7(className), ...restProps, children: nodes });
|
|
9144
9081
|
};
|
|
9145
9082
|
|
|
9146
9083
|
// src/hooks/focus/useFocusTrap.ts
|
|
@@ -9547,6 +9484,142 @@ var useTransitionState = ({
|
|
|
9547
9484
|
};
|
|
9548
9485
|
};
|
|
9549
9486
|
|
|
9487
|
+
// src/utils/propsUtil.ts
|
|
9488
|
+
function bool(isActive) {
|
|
9489
|
+
return isActive ? "" : void 0;
|
|
9490
|
+
}
|
|
9491
|
+
function name(name2, props = {}) {
|
|
9492
|
+
return props["data-name"] ? String(props["data-name"]) : name2;
|
|
9493
|
+
}
|
|
9494
|
+
function interactionStatesData(interactionStates) {
|
|
9495
|
+
return {
|
|
9496
|
+
"data-disabled": bool(!!interactionStates.disabled),
|
|
9497
|
+
"data-invalid": bool(!!interactionStates.invalid),
|
|
9498
|
+
"data-readonly": bool(!!interactionStates.readOnly),
|
|
9499
|
+
"data-required": bool(!!interactionStates.required)
|
|
9500
|
+
};
|
|
9501
|
+
}
|
|
9502
|
+
var dataAttributes = {
|
|
9503
|
+
bool,
|
|
9504
|
+
name,
|
|
9505
|
+
interactionStates: interactionStatesData
|
|
9506
|
+
};
|
|
9507
|
+
function mouseEventExtender({
|
|
9508
|
+
fromProps,
|
|
9509
|
+
extensions
|
|
9510
|
+
}) {
|
|
9511
|
+
return (event) => {
|
|
9512
|
+
fromProps?.(event);
|
|
9513
|
+
ArrayUtil.resolveSingleOrArray(extensions).forEach((element) => element(event));
|
|
9514
|
+
};
|
|
9515
|
+
}
|
|
9516
|
+
function keyboardEventExtender({
|
|
9517
|
+
fromProps,
|
|
9518
|
+
extensions
|
|
9519
|
+
}) {
|
|
9520
|
+
return (event) => {
|
|
9521
|
+
fromProps?.(event);
|
|
9522
|
+
ArrayUtil.resolveSingleOrArray(extensions).forEach((element) => element(event));
|
|
9523
|
+
};
|
|
9524
|
+
}
|
|
9525
|
+
var extender = {
|
|
9526
|
+
mouseEvent: mouseEventExtender,
|
|
9527
|
+
keyboardEvent: keyboardEventExtender
|
|
9528
|
+
};
|
|
9529
|
+
function click(onClick) {
|
|
9530
|
+
const keyboardEventHandler = (event) => {
|
|
9531
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
9532
|
+
event.preventDefault();
|
|
9533
|
+
event.stopPropagation();
|
|
9534
|
+
onClick();
|
|
9535
|
+
}
|
|
9536
|
+
};
|
|
9537
|
+
return {
|
|
9538
|
+
onClick,
|
|
9539
|
+
onKeyDown: keyboardEventHandler
|
|
9540
|
+
};
|
|
9541
|
+
}
|
|
9542
|
+
function close2(onClose) {
|
|
9543
|
+
return (event) => {
|
|
9544
|
+
if (event.key === "Escape") {
|
|
9545
|
+
event.preventDefault();
|
|
9546
|
+
event.stopPropagation();
|
|
9547
|
+
onClose?.();
|
|
9548
|
+
}
|
|
9549
|
+
};
|
|
9550
|
+
}
|
|
9551
|
+
function navigate({
|
|
9552
|
+
left,
|
|
9553
|
+
right,
|
|
9554
|
+
up: up2,
|
|
9555
|
+
down: down2
|
|
9556
|
+
}) {
|
|
9557
|
+
return (event) => {
|
|
9558
|
+
switch (event.key) {
|
|
9559
|
+
case "ArrowLeft":
|
|
9560
|
+
left(event);
|
|
9561
|
+
event.preventDefault();
|
|
9562
|
+
event.stopPropagation();
|
|
9563
|
+
break;
|
|
9564
|
+
case "ArrowRight":
|
|
9565
|
+
right(event);
|
|
9566
|
+
event.preventDefault();
|
|
9567
|
+
event.stopPropagation();
|
|
9568
|
+
break;
|
|
9569
|
+
case "ArrowUp":
|
|
9570
|
+
up2(event);
|
|
9571
|
+
event.preventDefault();
|
|
9572
|
+
event.stopPropagation();
|
|
9573
|
+
break;
|
|
9574
|
+
case "ArrowDown":
|
|
9575
|
+
down2(event);
|
|
9576
|
+
event.preventDefault();
|
|
9577
|
+
event.stopPropagation();
|
|
9578
|
+
break;
|
|
9579
|
+
}
|
|
9580
|
+
};
|
|
9581
|
+
}
|
|
9582
|
+
function mergeProps(slotProps, childProps) {
|
|
9583
|
+
const result = { ...childProps };
|
|
9584
|
+
for (const key in slotProps) {
|
|
9585
|
+
const slotValue = slotProps[key];
|
|
9586
|
+
const childValue = childProps[key];
|
|
9587
|
+
if (key === "className") {
|
|
9588
|
+
result.className = [slotValue, childValue].filter(Boolean).join(" ");
|
|
9589
|
+
} else if (key === "style") {
|
|
9590
|
+
result.style = { ...slotValue, ...childValue };
|
|
9591
|
+
} else if (key.startsWith("on") && typeof slotValue === "function" && typeof childValue === "function") {
|
|
9592
|
+
result[key] = (...args) => {
|
|
9593
|
+
slotValue(...args);
|
|
9594
|
+
childValue(...args);
|
|
9595
|
+
};
|
|
9596
|
+
} else {
|
|
9597
|
+
result[key] = childValue ?? slotValue;
|
|
9598
|
+
}
|
|
9599
|
+
}
|
|
9600
|
+
return result;
|
|
9601
|
+
}
|
|
9602
|
+
function interactionStatesAria(interactionStates, props = {}) {
|
|
9603
|
+
return {
|
|
9604
|
+
"aria-disabled": props["aria-disabled"] ?? interactionStates.disabled,
|
|
9605
|
+
"aria-invalid": props["aria-invalid"] ?? interactionStates.invalid,
|
|
9606
|
+
"aria-readonly": props["aria-readonly"] ?? interactionStates.readOnly,
|
|
9607
|
+
"aria-required": props["aria-required"] ?? interactionStates.required
|
|
9608
|
+
};
|
|
9609
|
+
}
|
|
9610
|
+
var aria = {
|
|
9611
|
+
close: close2,
|
|
9612
|
+
click,
|
|
9613
|
+
navigate,
|
|
9614
|
+
interactionStates: interactionStatesAria
|
|
9615
|
+
};
|
|
9616
|
+
var PropsUtil = {
|
|
9617
|
+
extender,
|
|
9618
|
+
dataAttributes,
|
|
9619
|
+
aria,
|
|
9620
|
+
mergeProps
|
|
9621
|
+
};
|
|
9622
|
+
|
|
9550
9623
|
// src/components/layout/Drawer.tsx
|
|
9551
9624
|
import { jsx as jsx20, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
9552
9625
|
var Drawer = forwardRef5(function Drawer2({
|
|
@@ -9655,7 +9728,7 @@ var Drawer = forwardRef5(function Drawer2({
|
|
|
9655
9728
|
import { useEffect as useEffect11, useImperativeHandle as useImperativeHandle3, useRef as useRef7 } from "react";
|
|
9656
9729
|
import { useState as useState12 } from "react";
|
|
9657
9730
|
import { createContext as createContext5, forwardRef as forwardRef6, useCallback as useCallback9, useContext as useContext5, useId as useId6, useMemo as useMemo10 } from "react";
|
|
9658
|
-
import
|
|
9731
|
+
import clsx8 from "clsx";
|
|
9659
9732
|
|
|
9660
9733
|
// src/hooks/useOverwritableState.ts
|
|
9661
9734
|
import { useEffect as useEffect10, useState as useState11 } from "react";
|
|
@@ -9821,7 +9894,7 @@ var Expandable = forwardRef6(function Expandable2({
|
|
|
9821
9894
|
/* @__PURE__ */ jsx21(ExpandableContext.Consumer, { children: (ctx) => /* @__PURE__ */ jsx21(
|
|
9822
9895
|
ExpandableContent,
|
|
9823
9896
|
{
|
|
9824
|
-
className:
|
|
9897
|
+
className: clsx8(contentClassName, { [contentExpandedClassName ?? ""]: !!ctx?.isExpanded }),
|
|
9825
9898
|
children
|
|
9826
9899
|
}
|
|
9827
9900
|
) })
|
|
@@ -9872,7 +9945,7 @@ import {
|
|
|
9872
9945
|
useMemo as useMemo11,
|
|
9873
9946
|
useCallback as useCallback10
|
|
9874
9947
|
} from "react";
|
|
9875
|
-
import
|
|
9948
|
+
import clsx9 from "clsx";
|
|
9876
9949
|
import { ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
9877
9950
|
import { jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
9878
9951
|
function InfiniteScroll({
|
|
@@ -9949,7 +10022,7 @@ function InfiniteScroll({
|
|
|
9949
10022
|
{
|
|
9950
10023
|
ref: containerRef,
|
|
9951
10024
|
onScroll: isUsingInfiteScroll ? handleScroll : void 0,
|
|
9952
|
-
className:
|
|
10025
|
+
className: clsx9("overflow-y-auto", className),
|
|
9953
10026
|
style,
|
|
9954
10027
|
children: [
|
|
9955
10028
|
/* @__PURE__ */ jsx23(Visibility, { isVisible: windowState.start > 0, children: /* @__PURE__ */ jsx23(Button, { color: "neutral", onClick: () => addToStart(), children: /* @__PURE__ */ jsx23(ChevronUp, {}) }) }),
|
|
@@ -9962,7 +10035,7 @@ function InfiniteScroll({
|
|
|
9962
10035
|
|
|
9963
10036
|
// src/components/layout/ListBox.tsx
|
|
9964
10037
|
import React2, { createContext as createContext6, forwardRef as forwardRef7, useCallback as useCallback11, useContext as useContext6, useEffect as useEffect12, useRef as useRef9, useState as useState14 } from "react";
|
|
9965
|
-
import { clsx as
|
|
10038
|
+
import { clsx as clsx10 } from "clsx";
|
|
9966
10039
|
|
|
9967
10040
|
// src/utils/match.ts
|
|
9968
10041
|
var match = (key, values) => {
|
|
@@ -10012,7 +10085,7 @@ var ListBoxItem = forwardRef7(
|
|
|
10012
10085
|
"data-highlighted": isHighlighted ? "" : void 0,
|
|
10013
10086
|
"data-selected": selected ? "" : void 0,
|
|
10014
10087
|
"data-disabled": disabled ? "" : void 0,
|
|
10015
|
-
className:
|
|
10088
|
+
className: clsx10(
|
|
10016
10089
|
"flex-row-1 items-center px-2 py-1 rounded-md",
|
|
10017
10090
|
"data-highlighted:bg-primary/20",
|
|
10018
10091
|
"data-disabled:text-disabled data-disabled:cursor-not-allowed",
|
|
@@ -10627,7 +10700,7 @@ function TabPanel({ label, ...props }) {
|
|
|
10627
10700
|
}
|
|
10628
10701
|
|
|
10629
10702
|
// src/components/layout/TextImage.tsx
|
|
10630
|
-
import
|
|
10703
|
+
import clsx11 from "clsx";
|
|
10631
10704
|
import { jsx as jsx27, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
10632
10705
|
var TextImage = ({
|
|
10633
10706
|
title,
|
|
@@ -10653,7 +10726,7 @@ var TextImage = ({
|
|
|
10653
10726
|
return /* @__PURE__ */ jsx27(
|
|
10654
10727
|
"div",
|
|
10655
10728
|
{
|
|
10656
|
-
className:
|
|
10729
|
+
className: clsx11("rounded-2xl w-full", className),
|
|
10657
10730
|
style: {
|
|
10658
10731
|
backgroundImage: `url(${imageUrl})`,
|
|
10659
10732
|
backgroundSize: "cover"
|
|
@@ -10661,9 +10734,9 @@ var TextImage = ({
|
|
|
10661
10734
|
children: /* @__PURE__ */ jsxs12(
|
|
10662
10735
|
"div",
|
|
10663
10736
|
{
|
|
10664
|
-
className:
|
|
10737
|
+
className: clsx11(`flex-col-2 px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
|
|
10665
10738
|
children: [
|
|
10666
|
-
badge && /* @__PURE__ */ jsx27("div", { className:
|
|
10739
|
+
badge && /* @__PURE__ */ jsx27("div", { className: clsx11(`chip-full mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ jsx27("span", { className: "text-lg font-bold", children: badge }) }),
|
|
10667
10740
|
/* @__PURE__ */ jsxs12("div", { className: "flex-col-1 overflow-hidden", children: [
|
|
10668
10741
|
/* @__PURE__ */ jsx27("span", { className: "typography-title-lg", children: title }),
|
|
10669
10742
|
/* @__PURE__ */ jsx27("span", { className: "text-ellipsis overflow-hidden", children: description })
|
|
@@ -10774,7 +10847,7 @@ var Portal = ({ children, container }) => {
|
|
|
10774
10847
|
};
|
|
10775
10848
|
|
|
10776
10849
|
// src/components/layout/dialog/Dialog.tsx
|
|
10777
|
-
import
|
|
10850
|
+
import clsx12 from "clsx";
|
|
10778
10851
|
|
|
10779
10852
|
// src/components/utils/FocusTrap.tsx
|
|
10780
10853
|
import { useRef as useRef11 } from "react";
|
|
@@ -10886,7 +10959,7 @@ var Dialog = forwardRef9(function Dialog2({
|
|
|
10886
10959
|
ref: containerRef,
|
|
10887
10960
|
id: ids.container,
|
|
10888
10961
|
"data-open": PropsUtil.dataAttributes.bool(isOpen),
|
|
10889
|
-
className:
|
|
10962
|
+
className: clsx12("dialog-container", containerClassName),
|
|
10890
10963
|
style: { zIndex },
|
|
10891
10964
|
children: [
|
|
10892
10965
|
/* @__PURE__ */ jsx30(
|
|
@@ -10896,7 +10969,7 @@ var Dialog = forwardRef9(function Dialog2({
|
|
|
10896
10969
|
onClick: onCloseWrapper,
|
|
10897
10970
|
"data-state": transitionState,
|
|
10898
10971
|
"aria-hidden": true,
|
|
10899
|
-
className:
|
|
10972
|
+
className: clsx12("dialog-background", backgroundClassName)
|
|
10900
10973
|
}
|
|
10901
10974
|
),
|
|
10902
10975
|
/* @__PURE__ */ jsx30(FocusTrap, { active: isPresent && isOpen, container: ref, children: /* @__PURE__ */ jsxs14(
|
|
@@ -10912,7 +10985,7 @@ var Dialog = forwardRef9(function Dialog2({
|
|
|
10912
10985
|
"aria-modal": isModal,
|
|
10913
10986
|
"aria-labelledby": ids.title,
|
|
10914
10987
|
"aria-describedby": hasDescription ? ids.description : void 0,
|
|
10915
|
-
className:
|
|
10988
|
+
className: clsx12("dialog-content", props.className),
|
|
10916
10989
|
children: [
|
|
10917
10990
|
/* @__PURE__ */ jsx30("div", { className: "typography-title-lg mr-8", children: titleElement }),
|
|
10918
10991
|
/* @__PURE__ */ jsx30(Visibility, { isVisible: hasDescription, children: /* @__PURE__ */ jsx30("div", { className: "text-description", children: description }) }),
|
|
@@ -10948,19 +11021,6 @@ var Dialog = forwardRef9(function Dialog2({
|
|
|
10948
11021
|
|
|
10949
11022
|
// src/components/layout/dialog/DialogOpener.tsx
|
|
10950
11023
|
import { useMemo as useMemo13 } from "react";
|
|
10951
|
-
|
|
10952
|
-
// src/utils/bagFunctions.ts
|
|
10953
|
-
var resolve = (bagFunctionOrValue, bag) => {
|
|
10954
|
-
if (typeof bagFunctionOrValue === "function") {
|
|
10955
|
-
return bagFunctionOrValue(bag);
|
|
10956
|
-
}
|
|
10957
|
-
return bagFunctionOrValue;
|
|
10958
|
-
};
|
|
10959
|
-
var BagFunctionUtil = {
|
|
10960
|
-
resolve
|
|
10961
|
-
};
|
|
10962
|
-
|
|
10963
|
-
// src/components/layout/dialog/DialogOpener.tsx
|
|
10964
11024
|
function DialogOpenerWrapper({ children }) {
|
|
10965
11025
|
const context = useDialogContext();
|
|
10966
11026
|
const bag = useMemo13(() => ({
|
|
@@ -11020,7 +11080,7 @@ function DialogRoot({
|
|
|
11020
11080
|
}
|
|
11021
11081
|
|
|
11022
11082
|
// src/components/layout/dialog/premade/ConfirmDialog.tsx
|
|
11023
|
-
import
|
|
11083
|
+
import clsx13 from "clsx";
|
|
11024
11084
|
import { jsx as jsx32, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
11025
11085
|
var ConfirmDialog = ({
|
|
11026
11086
|
children,
|
|
@@ -11039,7 +11099,7 @@ var ConfirmDialog = ({
|
|
|
11039
11099
|
positive: "positive",
|
|
11040
11100
|
primary: "primary"
|
|
11041
11101
|
};
|
|
11042
|
-
return /* @__PURE__ */ jsxs15(Dialog, { ...restProps, onClose: onCancel, className:
|
|
11102
|
+
return /* @__PURE__ */ jsxs15(Dialog, { ...restProps, onClose: onCancel, className: clsx13("justify-between", className), children: [
|
|
11043
11103
|
/* @__PURE__ */ jsx32("div", { className: "flex-col-2 grow", children }),
|
|
11044
11104
|
/* @__PURE__ */ jsxs15("div", { className: "flex-row-4 mt-3 justify-end", children: [
|
|
11045
11105
|
onCancel && /* @__PURE__ */ jsx32(
|
|
@@ -11549,12 +11609,12 @@ var MultiSelectRoot = ({ value, onValueChange, onEditComplete, ...props }) => {
|
|
|
11549
11609
|
|
|
11550
11610
|
// src/components/user-interaction/select/SelectComponents.tsx
|
|
11551
11611
|
import { forwardRef as forwardRef12, useEffect as useEffect19, useImperativeHandle as useImperativeHandle8, useRef as useRef16 } from "react";
|
|
11552
|
-
import
|
|
11612
|
+
import clsx15 from "clsx";
|
|
11553
11613
|
import { CheckIcon } from "lucide-react";
|
|
11554
11614
|
|
|
11555
11615
|
// src/components/layout/popup/PopUp.tsx
|
|
11556
11616
|
import { forwardRef as forwardRef11, useContext as useContext12, useImperativeHandle as useImperativeHandle7, useMemo as useMemo15 } from "react";
|
|
11557
|
-
import { clsx as
|
|
11617
|
+
import { clsx as clsx14 } from "clsx";
|
|
11558
11618
|
|
|
11559
11619
|
// src/hooks/useOutsideClick.ts
|
|
11560
11620
|
import { useEffect as useEffect18 } from "react";
|
|
@@ -11644,7 +11704,7 @@ var PopUp = forwardRef11(function PopUp2({
|
|
|
11644
11704
|
transition: `top ${props.options?.pollingInterval ?? 100}ms linear, left ${props.options?.pollingInterval ?? 100}ms linear`,
|
|
11645
11705
|
...props.style
|
|
11646
11706
|
},
|
|
11647
|
-
className:
|
|
11707
|
+
className: clsx14("pop-up", props.className),
|
|
11648
11708
|
children
|
|
11649
11709
|
}
|
|
11650
11710
|
) }) }) });
|
|
@@ -11686,7 +11746,7 @@ var SelectOption = forwardRef12(
|
|
|
11686
11746
|
"data-highlighted": isHighlighted ? "" : void 0,
|
|
11687
11747
|
"data-selected": isSelected ? "" : void 0,
|
|
11688
11748
|
"data-disabled": disabled ? "" : void 0,
|
|
11689
|
-
className:
|
|
11749
|
+
className: clsx15(
|
|
11690
11750
|
"flex-row-1 items-center px-2 py-1 rounded-md",
|
|
11691
11751
|
"data-highlighted:bg-primary/20",
|
|
11692
11752
|
"data-disabled:text-disabled data-disabled:cursor-not-allowed",
|
|
@@ -11712,7 +11772,7 @@ var SelectOption = forwardRef12(
|
|
|
11712
11772
|
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ jsx38(
|
|
11713
11773
|
CheckIcon,
|
|
11714
11774
|
{
|
|
11715
|
-
className:
|
|
11775
|
+
className: clsx15("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
11716
11776
|
"aria-hidden": true
|
|
11717
11777
|
}
|
|
11718
11778
|
),
|
|
@@ -11720,7 +11780,7 @@ var SelectOption = forwardRef12(
|
|
|
11720
11780
|
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ jsx38(
|
|
11721
11781
|
CheckIcon,
|
|
11722
11782
|
{
|
|
11723
|
-
className:
|
|
11783
|
+
className: clsx15("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
11724
11784
|
"aria-hidden": true
|
|
11725
11785
|
}
|
|
11726
11786
|
)
|
|
@@ -11792,7 +11852,7 @@ var SelectButton = forwardRef12(function SelectButton2({
|
|
|
11792
11852
|
"aria-expanded": state.isOpen,
|
|
11793
11853
|
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
11794
11854
|
children: [
|
|
11795
|
-
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */ jsx38("div", { className:
|
|
11855
|
+
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */ jsx38("div", { className: clsx15("flex flex-wrap gap-x-1 gap-y-2"), children: state.selectedOptions.map(({ value, label }, index) => /* @__PURE__ */ jsxs16("span", { className: "flex-row-0", children: [
|
|
11796
11856
|
label,
|
|
11797
11857
|
index < state.value.length - 1 && /* @__PURE__ */ jsx38("span", { children: "," })
|
|
11798
11858
|
] }, value)) }) : placeholder ?? translation("clickToSelect"),
|
|
@@ -11864,7 +11924,7 @@ var SelectContent = forwardRef12(function SelectContent2({
|
|
|
11864
11924
|
break;
|
|
11865
11925
|
}
|
|
11866
11926
|
},
|
|
11867
|
-
className:
|
|
11927
|
+
className: clsx15("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-outline-within overflow-auto", props.className),
|
|
11868
11928
|
role: "listbox",
|
|
11869
11929
|
"aria-multiselectable": config.isMultiSelect,
|
|
11870
11930
|
"aria-orientation": "vertical",
|
|
@@ -11957,7 +12017,7 @@ var LanguageDialog = ({
|
|
|
11957
12017
|
|
|
11958
12018
|
// src/components/layout/dialog/premade/ThemeDialog.tsx
|
|
11959
12019
|
import { MonitorCog, MoonIcon, SunIcon } from "lucide-react";
|
|
11960
|
-
import
|
|
12020
|
+
import clsx16 from "clsx";
|
|
11961
12021
|
|
|
11962
12022
|
// src/global-contexts/ThemeContext.tsx
|
|
11963
12023
|
import { createContext as createContext11, useCallback as useCallback16, useContext as useContext13, useEffect as useEffect20, useMemo as useMemo16, useState as useState21 } from "react";
|
|
@@ -12048,11 +12108,11 @@ var useTheme = () => {
|
|
|
12048
12108
|
import { jsx as jsx42, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
12049
12109
|
var ThemeIcon = ({ theme, className }) => {
|
|
12050
12110
|
if (theme === "dark") {
|
|
12051
|
-
return /* @__PURE__ */ jsx42(MoonIcon, { className:
|
|
12111
|
+
return /* @__PURE__ */ jsx42(MoonIcon, { className: clsx16("w-4 h-4", className) });
|
|
12052
12112
|
} else if (theme === "light") {
|
|
12053
|
-
return /* @__PURE__ */ jsx42(SunIcon, { className:
|
|
12113
|
+
return /* @__PURE__ */ jsx42(SunIcon, { className: clsx16("w-4 h-4", className) });
|
|
12054
12114
|
} else {
|
|
12055
|
-
return /* @__PURE__ */ jsx42(MonitorCog, { className:
|
|
12115
|
+
return /* @__PURE__ */ jsx42(MonitorCog, { className: clsx16("w-4 h-4", className) });
|
|
12056
12116
|
}
|
|
12057
12117
|
};
|
|
12058
12118
|
var ThemeDialog = ({
|
|
@@ -12098,14 +12158,14 @@ var ThemeDialog = ({
|
|
|
12098
12158
|
|
|
12099
12159
|
// src/components/layout/loading/ErrorComponent.tsx
|
|
12100
12160
|
import { AlertOctagon } from "lucide-react";
|
|
12101
|
-
import
|
|
12161
|
+
import clsx17 from "clsx";
|
|
12102
12162
|
import { jsx as jsx43, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
12103
12163
|
var ErrorComponent = ({
|
|
12104
12164
|
errorText,
|
|
12105
12165
|
classname
|
|
12106
12166
|
}) => {
|
|
12107
12167
|
const translation = useHightideTranslation();
|
|
12108
|
-
return /* @__PURE__ */ jsxs20("div", { className:
|
|
12168
|
+
return /* @__PURE__ */ jsxs20("div", { className: clsx17("flex-col-4 items-center justify-center w-full h-24", classname), children: [
|
|
12109
12169
|
/* @__PURE__ */ jsx43(AlertOctagon, { size: 64, className: "text-warning" }),
|
|
12110
12170
|
errorText ?? `${translation("errorOccurred")} :(`
|
|
12111
12171
|
] });
|
|
@@ -12115,14 +12175,14 @@ var ErrorComponent = ({
|
|
|
12115
12175
|
import { useState as useState22 } from "react";
|
|
12116
12176
|
|
|
12117
12177
|
// src/components/layout/loading/LoadingContainer.tsx
|
|
12118
|
-
import { clsx as
|
|
12178
|
+
import { clsx as clsx18 } from "clsx";
|
|
12119
12179
|
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
12120
12180
|
var LoadingContainer = ({ className }) => {
|
|
12121
|
-
return /* @__PURE__ */ jsx44("div", { className:
|
|
12181
|
+
return /* @__PURE__ */ jsx44("div", { className: clsx18("relative overflow-hidden shimmer bg-disabled/30 rounded-md", className) });
|
|
12122
12182
|
};
|
|
12123
12183
|
|
|
12124
12184
|
// src/components/layout/loading/LoadingAndErrorComponent.tsx
|
|
12125
|
-
import { clsx as
|
|
12185
|
+
import { clsx as clsx19 } from "clsx";
|
|
12126
12186
|
import { Fragment as Fragment4, jsx as jsx45 } from "react/jsx-runtime";
|
|
12127
12187
|
var LoadingAndErrorComponent = ({
|
|
12128
12188
|
children,
|
|
@@ -12143,23 +12203,23 @@ var LoadingAndErrorComponent = ({
|
|
|
12143
12203
|
}, minimumLoadingDuration);
|
|
12144
12204
|
}
|
|
12145
12205
|
if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
|
|
12146
|
-
return /* @__PURE__ */ jsx45(Fragment4, { children: loadingComponent ?? /* @__PURE__ */ jsx45(LoadingContainer, { className:
|
|
12206
|
+
return /* @__PURE__ */ jsx45(Fragment4, { children: loadingComponent ?? /* @__PURE__ */ jsx45(LoadingContainer, { className: clsx19(className) }) });
|
|
12147
12207
|
}
|
|
12148
12208
|
if (hasError) {
|
|
12149
|
-
return /* @__PURE__ */ jsx45(Fragment4, { children: errorComponent ?? /* @__PURE__ */ jsx45(LoadingContainer, { className:
|
|
12209
|
+
return /* @__PURE__ */ jsx45(Fragment4, { children: errorComponent ?? /* @__PURE__ */ jsx45(LoadingContainer, { className: clsx19("bg-negative", className) }) });
|
|
12150
12210
|
}
|
|
12151
12211
|
return /* @__PURE__ */ jsx45(Fragment4, { children });
|
|
12152
12212
|
};
|
|
12153
12213
|
|
|
12154
12214
|
// src/components/layout/loading/LoadingAnimation.tsx
|
|
12155
|
-
import
|
|
12215
|
+
import clsx20 from "clsx";
|
|
12156
12216
|
import { jsx as jsx46, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
12157
12217
|
var LoadingAnimation = ({
|
|
12158
12218
|
loadingText,
|
|
12159
12219
|
classname
|
|
12160
12220
|
}) => {
|
|
12161
12221
|
const translation = useHightideTranslation();
|
|
12162
|
-
return /* @__PURE__ */ jsxs21("div", { className:
|
|
12222
|
+
return /* @__PURE__ */ jsxs21("div", { className: clsx20("flex-col-2 items-center justify-center w-full h-24", classname), children: [
|
|
12163
12223
|
/* @__PURE__ */ jsx46(HelpwaveLogo, { animate: "loading" }),
|
|
12164
12224
|
loadingText ?? `${translation("loading")}...`
|
|
12165
12225
|
] });
|
|
@@ -12199,7 +12259,7 @@ var import_link2 = __toESM(require_link2());
|
|
|
12199
12259
|
import { Menu as MenuIcon, XIcon } from "lucide-react";
|
|
12200
12260
|
import { useEffect as useEffect21 } from "react";
|
|
12201
12261
|
import { useCallback as useCallback17, useId as useId10, useRef as useRef17, useState as useState23 } from "react";
|
|
12202
|
-
import
|
|
12262
|
+
import clsx21 from "clsx";
|
|
12203
12263
|
import { Fragment as Fragment5, jsx as jsx48, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
12204
12264
|
function isSubItem(item) {
|
|
12205
12265
|
return "items" in item && Array.isArray(item.items);
|
|
@@ -12263,7 +12323,7 @@ var NavigationItemWithSubItem = ({
|
|
|
12263
12323
|
},
|
|
12264
12324
|
onBlur,
|
|
12265
12325
|
hidden: !isOpen,
|
|
12266
|
-
className:
|
|
12326
|
+
className: clsx21(
|
|
12267
12327
|
"fixed flex-col-4 p-4 bg-surface text-on-surface shadow-side shadow-hw-bottom rounded-md",
|
|
12268
12328
|
{ "opacity-0": !style }
|
|
12269
12329
|
),
|
|
@@ -12282,7 +12342,7 @@ var NavigationItemWithSubItem = ({
|
|
|
12282
12342
|
] });
|
|
12283
12343
|
};
|
|
12284
12344
|
var NavigationItemList = ({ items, ...restProps }) => {
|
|
12285
|
-
return /* @__PURE__ */ jsx48("ul", { ...restProps, className:
|
|
12345
|
+
return /* @__PURE__ */ jsx48("ul", { ...restProps, className: clsx21("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ jsx48("li", { children: isSubItem(item) ? /* @__PURE__ */ jsx48(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ jsx48(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
|
|
12286
12346
|
};
|
|
12287
12347
|
var Navigation = ({ ...props }) => {
|
|
12288
12348
|
const [isMobileOpen, setIsMobileOpen] = useState23(false);
|
|
@@ -12297,7 +12357,7 @@ var Navigation = ({ ...props }) => {
|
|
|
12297
12357
|
NavigationItemList,
|
|
12298
12358
|
{
|
|
12299
12359
|
...props,
|
|
12300
|
-
className:
|
|
12360
|
+
className: clsx21("hidden", { "desktop:flex": !isMobileOpen }, props.className)
|
|
12301
12361
|
}
|
|
12302
12362
|
),
|
|
12303
12363
|
/* @__PURE__ */ jsx48(
|
|
@@ -12327,7 +12387,7 @@ var Navigation = ({ ...props }) => {
|
|
|
12327
12387
|
event.stopPropagation();
|
|
12328
12388
|
}
|
|
12329
12389
|
},
|
|
12330
|
-
className:
|
|
12390
|
+
className: clsx21(
|
|
12331
12391
|
"flex-col-8 items-center justify-center fixed inset-0 p-8 w-screen h-screen bg-surface text-on-surface",
|
|
12332
12392
|
{
|
|
12333
12393
|
"desktop:hidden": isMobileOpen
|
|
@@ -12346,7 +12406,7 @@ var Navigation = ({ ...props }) => {
|
|
|
12346
12406
|
children: /* @__PURE__ */ jsx48(XIcon, {})
|
|
12347
12407
|
}
|
|
12348
12408
|
),
|
|
12349
|
-
/* @__PURE__ */ jsx48(NavigationItemList, { ...props, className:
|
|
12409
|
+
/* @__PURE__ */ jsx48(NavigationItemList, { ...props, className: clsx21("flex-col-8", props.className) })
|
|
12350
12410
|
]
|
|
12351
12411
|
}
|
|
12352
12412
|
)
|
|
@@ -12355,14 +12415,14 @@ var Navigation = ({ ...props }) => {
|
|
|
12355
12415
|
|
|
12356
12416
|
// src/components/layout/navigation/Pagination.tsx
|
|
12357
12417
|
import { ChevronFirst, ChevronLast, ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
12358
|
-
import
|
|
12418
|
+
import clsx23 from "clsx";
|
|
12359
12419
|
import { useEffect as useEffect23, useState as useState25 } from "react";
|
|
12360
12420
|
|
|
12361
12421
|
// src/components/user-interaction/Tooltip.tsx
|
|
12362
12422
|
import { useEffect as useEffect22 } from "react";
|
|
12363
12423
|
import { useId as useId11 } from "react";
|
|
12364
12424
|
import { useCallback as useCallback18, useMemo as useMemo17, useRef as useRef18, useState as useState24 } from "react";
|
|
12365
|
-
import { clsx as
|
|
12425
|
+
import { clsx as clsx22 } from "clsx";
|
|
12366
12426
|
import { jsx as jsx49, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
12367
12427
|
var Tooltip = ({
|
|
12368
12428
|
tooltip,
|
|
@@ -12442,7 +12502,7 @@ var Tooltip = ({
|
|
|
12442
12502
|
"div",
|
|
12443
12503
|
{
|
|
12444
12504
|
ref: anchor,
|
|
12445
|
-
className:
|
|
12505
|
+
className: clsx22("relative inline-block", containerClassName),
|
|
12446
12506
|
"aria-describedby": isVisible ? id : void 0,
|
|
12447
12507
|
onPointerEnter: openWithDelay,
|
|
12448
12508
|
onPointerLeave: close3,
|
|
@@ -12465,7 +12525,7 @@ var Tooltip = ({
|
|
|
12465
12525
|
"data-state": transitionState,
|
|
12466
12526
|
"data-animated": isAnimated ? "" : void 0,
|
|
12467
12527
|
role: "tooltip",
|
|
12468
|
-
className:
|
|
12528
|
+
className: clsx22("tooltip", tooltipClassName),
|
|
12469
12529
|
style: { zIndex, position: "fixed" },
|
|
12470
12530
|
children: tooltip
|
|
12471
12531
|
}
|
|
@@ -12499,7 +12559,7 @@ var Pagination = ({
|
|
|
12499
12559
|
const changePage = (page) => {
|
|
12500
12560
|
onPageIndexChanged(page);
|
|
12501
12561
|
};
|
|
12502
|
-
return /* @__PURE__ */ jsxs25("div", { className:
|
|
12562
|
+
return /* @__PURE__ */ jsxs25("div", { className: clsx23("flex-row-1", className), style, children: [
|
|
12503
12563
|
/* @__PURE__ */ jsx50(Tooltip, { tooltip: translation("first"), children: /* @__PURE__ */ jsx50(
|
|
12504
12564
|
Button,
|
|
12505
12565
|
{
|
|
@@ -12527,7 +12587,7 @@ var Pagination = ({
|
|
|
12527
12587
|
Input,
|
|
12528
12588
|
{
|
|
12529
12589
|
value,
|
|
12530
|
-
className:
|
|
12590
|
+
className: clsx23(
|
|
12531
12591
|
"w-24 text-center font-bold input-indicator-hidden h-10"
|
|
12532
12592
|
),
|
|
12533
12593
|
type: "number",
|
|
@@ -12583,7 +12643,7 @@ var Pagination = ({
|
|
|
12583
12643
|
|
|
12584
12644
|
// src/components/layout/navigation/StepperBar.tsx
|
|
12585
12645
|
import { Check, ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
12586
|
-
import
|
|
12646
|
+
import clsx24 from "clsx";
|
|
12587
12647
|
import { jsx as jsx51, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
12588
12648
|
var defaultState = {
|
|
12589
12649
|
currentStep: 0,
|
|
@@ -12609,7 +12669,7 @@ var StepperBar = ({
|
|
|
12609
12669
|
return /* @__PURE__ */ jsxs26(
|
|
12610
12670
|
"div",
|
|
12611
12671
|
{
|
|
12612
|
-
className:
|
|
12672
|
+
className: clsx24("flex-row-2 justify-between", className),
|
|
12613
12673
|
children: [
|
|
12614
12674
|
/* @__PURE__ */ jsx51("div", { className: "flex-row-2 flex-[2] justify-start", children: /* @__PURE__ */ jsxs26(
|
|
12615
12675
|
Button,
|
|
@@ -12631,7 +12691,7 @@ var StepperBar = ({
|
|
|
12631
12691
|
"div",
|
|
12632
12692
|
{
|
|
12633
12693
|
onClick: () => seen && update(index),
|
|
12634
|
-
className:
|
|
12694
|
+
className: clsx24(
|
|
12635
12695
|
"rounded-full w-4 h-4",
|
|
12636
12696
|
{
|
|
12637
12697
|
"bg-stepperbar-dot-active hover:brightness-75": index === currentStep && seen && !disabledSteps.has(currentStep),
|
|
@@ -12748,7 +12808,7 @@ function PopUpRoot({
|
|
|
12748
12808
|
}
|
|
12749
12809
|
|
|
12750
12810
|
// src/components/layout/table/FillerCell.tsx
|
|
12751
|
-
import
|
|
12811
|
+
import clsx25 from "clsx";
|
|
12752
12812
|
import { Minus } from "lucide-react";
|
|
12753
12813
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
12754
12814
|
var FillerCell = ({ ...props }) => {
|
|
@@ -12756,7 +12816,7 @@ var FillerCell = ({ ...props }) => {
|
|
|
12756
12816
|
"div",
|
|
12757
12817
|
{
|
|
12758
12818
|
...props,
|
|
12759
|
-
className:
|
|
12819
|
+
className: clsx25("table-filler-cell", props.className),
|
|
12760
12820
|
children: /* @__PURE__ */ jsx53(Minus, { className: "max-w-4 max-h-4" })
|
|
12761
12821
|
}
|
|
12762
12822
|
);
|
|
@@ -13107,13 +13167,13 @@ var useResizeCallbackWrapper = (callback) => {
|
|
|
13107
13167
|
};
|
|
13108
13168
|
|
|
13109
13169
|
// src/components/layout/table/TableCell.tsx
|
|
13110
|
-
import { clsx as
|
|
13170
|
+
import { clsx as clsx26 } from "clsx";
|
|
13111
13171
|
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
13112
13172
|
var TableCell = ({
|
|
13113
13173
|
children,
|
|
13114
13174
|
className
|
|
13115
13175
|
}) => {
|
|
13116
|
-
return /* @__PURE__ */ jsx54("span", { className:
|
|
13176
|
+
return /* @__PURE__ */ jsx54("span", { className: clsx26("table-default-cell", className), children });
|
|
13117
13177
|
};
|
|
13118
13178
|
|
|
13119
13179
|
// src/components/layout/table/TableProvider.tsx
|
|
@@ -13121,9 +13181,10 @@ import { jsx as jsx55 } from "react/jsx-runtime";
|
|
|
13121
13181
|
var TableProvider = ({
|
|
13122
13182
|
data,
|
|
13123
13183
|
isUsingFillerRows = true,
|
|
13124
|
-
|
|
13184
|
+
fillerRowCell,
|
|
13125
13185
|
initialState,
|
|
13126
13186
|
onRowClick,
|
|
13187
|
+
onFillerRowClick,
|
|
13127
13188
|
defaultColumn: defaultColumnOverwrite,
|
|
13128
13189
|
state,
|
|
13129
13190
|
columns: columnsProp,
|
|
@@ -13262,15 +13323,16 @@ var TableProvider = ({
|
|
|
13262
13323
|
pagination,
|
|
13263
13324
|
rowSelection,
|
|
13264
13325
|
isUsingFillerRows,
|
|
13265
|
-
|
|
13326
|
+
fillerRowCell,
|
|
13266
13327
|
onRowClick,
|
|
13328
|
+
onFillerRowClick,
|
|
13267
13329
|
rows,
|
|
13268
13330
|
columnOrder,
|
|
13269
13331
|
columnFilters,
|
|
13270
13332
|
columnVisibility,
|
|
13271
13333
|
columnPinning,
|
|
13272
13334
|
columnSorting
|
|
13273
|
-
}), [table, data, pagination, rowSelection, isUsingFillerRows,
|
|
13335
|
+
}), [table, data, pagination, rowSelection, isUsingFillerRows, fillerRowCell, onRowClick, onFillerRowClick, columns, rows, columnOrder, columnFilters, columnVisibility, columnPinning, columnSorting]);
|
|
13274
13336
|
const tableColumnDefinitionContextValue = useMemo20(() => ({
|
|
13275
13337
|
table,
|
|
13276
13338
|
registerColumn
|
|
@@ -13289,11 +13351,21 @@ var TableProvider = ({
|
|
|
13289
13351
|
// src/components/layout/table/TableBody.tsx
|
|
13290
13352
|
import { flexRender } from "@tanstack/react-table";
|
|
13291
13353
|
import React5 from "react";
|
|
13292
|
-
import
|
|
13354
|
+
import clsx27 from "clsx";
|
|
13293
13355
|
import { jsx as jsx56, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
13294
13356
|
var TableBody = React5.memo(function TableBodyVisual() {
|
|
13295
|
-
const { table, onRowClick, isUsingFillerRows,
|
|
13296
|
-
const
|
|
13357
|
+
const { table, onRowClick, onFillerRowClick, isUsingFillerRows, fillerRowCell, pagination, rows } = useTableDataContext();
|
|
13358
|
+
const pinnedColumnsLeft = table.getState().columnPinning?.left ?? [];
|
|
13359
|
+
const pinnedColumnsRight = table.getState().columnPinning?.right ?? [];
|
|
13360
|
+
let columnOrder = table.getState().columnOrder;
|
|
13361
|
+
columnOrder = [...pinnedColumnsLeft, ...columnOrder.filter((id) => !pinnedColumnsLeft.includes(id) && !pinnedColumnsRight.includes(id)), ...pinnedColumnsRight];
|
|
13362
|
+
const columnVisibility = table.getState().columnVisibility;
|
|
13363
|
+
const columns = columnOrder.map((id) => {
|
|
13364
|
+
const column = table.getColumn(id);
|
|
13365
|
+
if (!column) return null;
|
|
13366
|
+
if (columnVisibility[id] === false) return null;
|
|
13367
|
+
return column;
|
|
13368
|
+
}).filter(Boolean);
|
|
13297
13369
|
return /* @__PURE__ */ jsxs27("tbody", { children: [
|
|
13298
13370
|
rows.map((row) => {
|
|
13299
13371
|
return /* @__PURE__ */ jsx56(
|
|
@@ -13301,9 +13373,9 @@ var TableBody = React5.memo(function TableBodyVisual() {
|
|
|
13301
13373
|
{
|
|
13302
13374
|
onClick: () => onRowClick?.(row, table),
|
|
13303
13375
|
"data-clickable": PropsUtil.dataAttributes.bool(!!onRowClick),
|
|
13304
|
-
className:
|
|
13376
|
+
className: clsx27("table-body-row", BagFunctionUtil.resolve(table.options.meta?.bodyRowClassName, row.original)),
|
|
13305
13377
|
children: row.getVisibleCells().map((cell) => {
|
|
13306
|
-
return /* @__PURE__ */ jsx56("td", { className:
|
|
13378
|
+
return /* @__PURE__ */ jsx56("td", { className: clsx27("table-body-cell", cell.column.columnDef.meta?.className), children: flexRender(
|
|
13307
13379
|
cell.column.columnDef.cell,
|
|
13308
13380
|
cell.getContext()
|
|
13309
13381
|
) }, cell.id);
|
|
@@ -13312,21 +13384,30 @@ var TableBody = React5.memo(function TableBodyVisual() {
|
|
|
13312
13384
|
row.id
|
|
13313
13385
|
);
|
|
13314
13386
|
}),
|
|
13315
|
-
isUsingFillerRows
|
|
13316
|
-
return /* @__PURE__ */ jsx56(
|
|
13317
|
-
|
|
13318
|
-
|
|
13319
|
-
|
|
13387
|
+
/* @__PURE__ */ jsx56(Visibility, { isVisible: isUsingFillerRows, children: range(pagination.pageSize - rows.length, { allowEmptyRange: true }).map((index) => {
|
|
13388
|
+
return /* @__PURE__ */ jsx56(
|
|
13389
|
+
"tr",
|
|
13390
|
+
{
|
|
13391
|
+
className: clsx27("table-body-filler-row"),
|
|
13392
|
+
onClick: () => onFillerRowClick?.(index, table),
|
|
13393
|
+
"data-clickable": PropsUtil.dataAttributes.bool(!!onFillerRowClick),
|
|
13394
|
+
children: columns.map((column) => {
|
|
13395
|
+
return /* @__PURE__ */ jsx56("td", { className: clsx27("table-body-filler-cell", column.columnDef.meta?.className), children: fillerRowCell ? fillerRowCell(column.id, table) : /* @__PURE__ */ jsx56(FillerCell, {}) }, column.id);
|
|
13396
|
+
})
|
|
13397
|
+
},
|
|
13398
|
+
"filler-row-" + index
|
|
13399
|
+
);
|
|
13400
|
+
}) })
|
|
13320
13401
|
] });
|
|
13321
13402
|
});
|
|
13322
13403
|
|
|
13323
13404
|
// src/components/layout/table/TableHeader.tsx
|
|
13324
13405
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
13325
|
-
import
|
|
13406
|
+
import clsx33 from "clsx";
|
|
13326
13407
|
|
|
13327
13408
|
// src/components/layout/table/TableSortButton.tsx
|
|
13328
13409
|
import { ChevronDown as ChevronDown3, ChevronsUpDown, ChevronUp as ChevronUp2 } from "lucide-react";
|
|
13329
|
-
import
|
|
13410
|
+
import clsx28 from "clsx";
|
|
13330
13411
|
import { jsx as jsx57, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
13331
13412
|
var TableSortButton = ({
|
|
13332
13413
|
sortDirection,
|
|
@@ -13354,13 +13435,13 @@ var TableSortButton = ({
|
|
|
13354
13435
|
layout: hasSortingIndex ? "default" : "icon",
|
|
13355
13436
|
color,
|
|
13356
13437
|
size,
|
|
13357
|
-
className:
|
|
13438
|
+
className: clsx28("relative", className),
|
|
13358
13439
|
...props,
|
|
13359
13440
|
children: [
|
|
13360
13441
|
/* @__PURE__ */ jsx57(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ jsx57(
|
|
13361
13442
|
"div",
|
|
13362
13443
|
{
|
|
13363
|
-
className:
|
|
13444
|
+
className: clsx28("absolute bottom-0 right-1/2 translate-x-1/2 translate-y-2/3 z-1 primary coloring-solid rounded-full h-4 w-5 text-sm"),
|
|
13364
13445
|
children: `${index}.`
|
|
13365
13446
|
}
|
|
13366
13447
|
) }),
|
|
@@ -13377,7 +13458,7 @@ import { useEffect as useEffect30, useId as useId14, useMemo as useMemo26, useRe
|
|
|
13377
13458
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
13378
13459
|
import { forwardRef as forwardRef14, useCallback as useCallback21, useEffect as useEffect29, useId as useId13, useImperativeHandle as useImperativeHandle9, useMemo as useMemo24, useRef as useRef23, useState as useState30 } from "react";
|
|
13379
13460
|
import { CalendarIcon } from "lucide-react";
|
|
13380
|
-
import
|
|
13461
|
+
import clsx32 from "clsx";
|
|
13381
13462
|
|
|
13382
13463
|
// src/utils/date.ts
|
|
13383
13464
|
var monthsList = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
|
|
@@ -13550,7 +13631,7 @@ var DateUtils = {
|
|
|
13550
13631
|
};
|
|
13551
13632
|
|
|
13552
13633
|
// src/components/user-interaction/date/DateTimePicker.tsx
|
|
13553
|
-
import
|
|
13634
|
+
import clsx31 from "clsx";
|
|
13554
13635
|
|
|
13555
13636
|
// src/components/user-interaction/date/TimePicker.tsx
|
|
13556
13637
|
import { useEffect as useEffect27, useRef as useRef21 } from "react";
|
|
@@ -13672,7 +13753,7 @@ var TimePickerUncontrolled = ({
|
|
|
13672
13753
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
13673
13754
|
import { useState as useState29 } from "react";
|
|
13674
13755
|
import { ArrowDown, ArrowUp, Calendar, ChevronDown as ChevronDown4 } from "lucide-react";
|
|
13675
|
-
import
|
|
13756
|
+
import clsx30 from "clsx";
|
|
13676
13757
|
|
|
13677
13758
|
// src/components/user-interaction/date/DayPicker.tsx
|
|
13678
13759
|
import { useMemo as useMemo21 } from "react";
|
|
@@ -13752,7 +13833,7 @@ var DayPickerUncontrolled = ({
|
|
|
13752
13833
|
|
|
13753
13834
|
// src/components/user-interaction/date/YearMonthPicker.tsx
|
|
13754
13835
|
import { memo, useCallback as useCallback20, useEffect as useEffect28, useLayoutEffect as useLayoutEffect4, useMemo as useMemo22, useRef as useRef22, useState as useState28 } from "react";
|
|
13755
|
-
import
|
|
13836
|
+
import clsx29 from "clsx";
|
|
13756
13837
|
import { jsx as jsx60, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
13757
13838
|
var YearRow = memo(function YearRow2({
|
|
13758
13839
|
year,
|
|
@@ -13778,7 +13859,7 @@ var YearRow = memo(function YearRow2({
|
|
|
13778
13859
|
isExpanded,
|
|
13779
13860
|
onExpandedChange: setIsExpanded,
|
|
13780
13861
|
children: [
|
|
13781
|
-
/* @__PURE__ */ jsx60(ExpandableHeader, { className:
|
|
13862
|
+
/* @__PURE__ */ jsx60(ExpandableHeader, { className: clsx29("px-2", { "text-primary font-bold": isSelectedYear }), children: year }),
|
|
13782
13863
|
/* @__PURE__ */ jsx60(ExpandableContent, { className: "gap-y-1 px-2 expandable-content-h-39", children: isExpanded && monthGrid.map((group, groupIdx) => /* @__PURE__ */ jsx60("div", { className: "flex-row-1", children: group.map((month) => {
|
|
13783
13864
|
const monthIndex = DateUtils.monthsList.indexOf(month);
|
|
13784
13865
|
const currentTimestamp = new Date(year, monthIndex).getTime();
|
|
@@ -13847,7 +13928,7 @@ var YearMonthPicker = ({
|
|
|
13847
13928
|
InfiniteScroll,
|
|
13848
13929
|
{
|
|
13849
13930
|
itemCount: years.length,
|
|
13850
|
-
className:
|
|
13931
|
+
className: clsx29("flex-col-1 h-full select-none", className),
|
|
13851
13932
|
initialIndex: years.findIndex((year) => year === value.getFullYear()),
|
|
13852
13933
|
children: (index) => {
|
|
13853
13934
|
const year = years[index];
|
|
@@ -13902,14 +13983,14 @@ var DatePicker = ({
|
|
|
13902
13983
|
const { locale } = useLocale();
|
|
13903
13984
|
const [displayedMonth, setDisplayedMonth] = useState29(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
13904
13985
|
const [displayMode, setDisplayMode] = useState29(initialDisplay);
|
|
13905
|
-
return /* @__PURE__ */ jsxs32("div", { className:
|
|
13986
|
+
return /* @__PURE__ */ jsxs32("div", { className: clsx30("flex-col-3", className), children: [
|
|
13906
13987
|
/* @__PURE__ */ jsxs32("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
13907
13988
|
/* @__PURE__ */ jsxs32(
|
|
13908
13989
|
Button,
|
|
13909
13990
|
{
|
|
13910
13991
|
size: "sm",
|
|
13911
13992
|
coloringStyle: "text",
|
|
13912
|
-
className:
|
|
13993
|
+
className: clsx30("flex-row-1 items-center cursor-pointer select-none", {
|
|
13913
13994
|
"text-disabled": displayMode !== "day"
|
|
13914
13995
|
}),
|
|
13915
13996
|
onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
|
|
@@ -14049,7 +14130,7 @@ var DateTimePicker = ({
|
|
|
14049
14130
|
...timePickerProps,
|
|
14050
14131
|
is24HourFormat,
|
|
14051
14132
|
minuteIncrement,
|
|
14052
|
-
className:
|
|
14133
|
+
className: clsx31({ "justify-between": mode === "time" }),
|
|
14053
14134
|
value,
|
|
14054
14135
|
onValueChange,
|
|
14055
14136
|
onEditComplete
|
|
@@ -14205,11 +14286,7 @@ var DateTimeInput = forwardRef14(function DateTimeInput2({
|
|
|
14205
14286
|
label: `date-time-input-label-${id}`
|
|
14206
14287
|
}), [id]);
|
|
14207
14288
|
const innerRef = useRef23(null);
|
|
14208
|
-
|
|
14209
|
-
useImperativeHandle9(forwardedRef, () => ({
|
|
14210
|
-
input: innerRef.current,
|
|
14211
|
-
popup: containerRef.current
|
|
14212
|
-
}));
|
|
14289
|
+
useImperativeHandle9(forwardedRef, () => innerRef.current);
|
|
14213
14290
|
useEffect29(() => {
|
|
14214
14291
|
if (readOnly || disabled) {
|
|
14215
14292
|
changeOpenWrapper(false);
|
|
@@ -14217,11 +14294,12 @@ var DateTimeInput = forwardRef14(function DateTimeInput2({
|
|
|
14217
14294
|
}, [changeOpenWrapper, readOnly, disabled]);
|
|
14218
14295
|
const clickHandler = PropsUtil.aria.click(() => changeOpenWrapper(true));
|
|
14219
14296
|
return /* @__PURE__ */ jsxs35(Fragment7, { children: [
|
|
14220
|
-
/* @__PURE__ */ jsxs35("div", { ...containerProps,
|
|
14297
|
+
/* @__PURE__ */ jsxs35("div", { ...containerProps, className: clsx32("relative w-full", containerProps?.className), children: [
|
|
14221
14298
|
/* @__PURE__ */ jsx64(
|
|
14222
14299
|
"div",
|
|
14223
14300
|
{
|
|
14224
14301
|
...props,
|
|
14302
|
+
ref: innerRef,
|
|
14225
14303
|
id: ids.input,
|
|
14226
14304
|
onClick: (event) => {
|
|
14227
14305
|
clickHandler.onClick();
|
|
@@ -14229,13 +14307,14 @@ var DateTimeInput = forwardRef14(function DateTimeInput2({
|
|
|
14229
14307
|
},
|
|
14230
14308
|
onKeyDown: clickHandler.onKeyDown,
|
|
14231
14309
|
...PropsUtil.dataAttributes.interactionStates({ disabled, readOnly, invalid, required }),
|
|
14310
|
+
"data-value": PropsUtil.dataAttributes.bool(!!state),
|
|
14232
14311
|
...PropsUtil.aria.interactionStates({ disabled, readOnly, invalid, required }, props),
|
|
14233
14312
|
tabIndex: 0,
|
|
14234
14313
|
role: "combobox",
|
|
14235
14314
|
"aria-haspopup": "dialog",
|
|
14236
14315
|
"aria-expanded": isOpen,
|
|
14237
14316
|
"aria-controls": isOpen ? ids.popup : void 0,
|
|
14238
|
-
className:
|
|
14317
|
+
className: clsx32(
|
|
14239
14318
|
"pr-10 w-full flex-row-2 items-center justify-between h-10 px-3 rounded-md input-element",
|
|
14240
14319
|
"outline-offset-0 outline-primary focus:outline-1 focus:outline-offset-1 focus:border-primary duration-(--animation-duration-in)",
|
|
14241
14320
|
{ "hover:cursor-pointer": !readOnly },
|
|
@@ -14267,7 +14346,6 @@ var DateTimeInput = forwardRef14(function DateTimeInput2({
|
|
|
14267
14346
|
/* @__PURE__ */ jsx64(
|
|
14268
14347
|
PopUp,
|
|
14269
14348
|
{
|
|
14270
|
-
ref: containerRef,
|
|
14271
14349
|
id: ids.popup,
|
|
14272
14350
|
isOpen,
|
|
14273
14351
|
anchor: innerRef,
|
|
@@ -14983,13 +15061,13 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
14983
15061
|
},
|
|
14984
15062
|
header.id
|
|
14985
15063
|
)) }, headerGroup.id)),
|
|
14986
|
-
/* @__PURE__ */ jsx68("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx68("tr", { className:
|
|
15064
|
+
/* @__PURE__ */ jsx68("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx68("tr", { className: clsx33("table-header-row", table.options.meta?.headerRowClassName), children: headerGroup.headers.map((header) => {
|
|
14987
15065
|
return /* @__PURE__ */ jsxs39(
|
|
14988
15066
|
"th",
|
|
14989
15067
|
{
|
|
14990
15068
|
colSpan: header.colSpan,
|
|
14991
15069
|
"data-sticky": isSticky ? "" : void 0,
|
|
14992
|
-
className:
|
|
15070
|
+
className: clsx33("table-header-cell group/table-header-cell", header.column.columnDef.meta?.className),
|
|
14993
15071
|
children: [
|
|
14994
15072
|
/* @__PURE__ */ jsx68(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ jsxs39("div", { className: "flex-row-1 items-center", children: [
|
|
14995
15073
|
/* @__PURE__ */ jsx68(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ jsx68(
|
|
@@ -15061,7 +15139,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15061
15139
|
};
|
|
15062
15140
|
|
|
15063
15141
|
// src/components/layout/table/TableDisplay.tsx
|
|
15064
|
-
import
|
|
15142
|
+
import clsx34 from "clsx";
|
|
15065
15143
|
import { jsx as jsx69, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
15066
15144
|
var TableDisplay = ({
|
|
15067
15145
|
children,
|
|
@@ -15072,11 +15150,11 @@ var TableDisplay = ({
|
|
|
15072
15150
|
const { table } = useTableDataContext();
|
|
15073
15151
|
const { containerRef } = useTableContainerContext();
|
|
15074
15152
|
const { sizeVars } = useTableHeaderContext();
|
|
15075
|
-
return /* @__PURE__ */ jsx69("div", { ...containerProps, ref: containerRef, className:
|
|
15153
|
+
return /* @__PURE__ */ jsx69("div", { ...containerProps, ref: containerRef, className: clsx34("table-container", containerProps?.className), children: /* @__PURE__ */ jsxs40(
|
|
15076
15154
|
"table",
|
|
15077
15155
|
{
|
|
15078
15156
|
...props,
|
|
15079
|
-
className:
|
|
15157
|
+
className: clsx34("table", props.className),
|
|
15080
15158
|
style: {
|
|
15081
15159
|
...sizeVars,
|
|
15082
15160
|
width: Math.floor(Math.max(table.getTotalSize(), containerRef.current?.offsetWidth ?? table.getTotalSize()))
|
|
@@ -15092,7 +15170,7 @@ var TableDisplay = ({
|
|
|
15092
15170
|
|
|
15093
15171
|
// src/components/layout/table/TablePagination.tsx
|
|
15094
15172
|
import { useEffect as useEffect32 } from "react";
|
|
15095
|
-
import
|
|
15173
|
+
import clsx35 from "clsx";
|
|
15096
15174
|
import { jsx as jsx70, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
15097
15175
|
var TablePaginationMenu = () => {
|
|
15098
15176
|
const { table } = useTableDataContext();
|
|
@@ -15130,7 +15208,7 @@ var TablePageSizeSelect = ({
|
|
|
15130
15208
|
);
|
|
15131
15209
|
};
|
|
15132
15210
|
var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props }) => {
|
|
15133
|
-
return /* @__PURE__ */ jsx70("div", { ...props, className:
|
|
15211
|
+
return /* @__PURE__ */ jsx70("div", { ...props, className: clsx35("flex-row-2 items-center justify-center", props.className), children: /* @__PURE__ */ jsxs41("div", { className: "relative", children: [
|
|
15134
15212
|
/* @__PURE__ */ jsx70(TablePaginationMenu, {}),
|
|
15135
15213
|
/* @__PURE__ */ jsx70(Visibility, { isVisible: allowChangingPageSize, children: /* @__PURE__ */ jsx70(TablePageSizeSelect, { pageSizeOptions, buttonProps: { className: "absolute left-1/1 top-1/2 -translate-y-1/2 translate-x-4 h-10 min-w-24" } }) })
|
|
15136
15214
|
] }) });
|
|
@@ -15139,7 +15217,7 @@ var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props
|
|
|
15139
15217
|
// src/components/user-interaction/Checkbox.tsx
|
|
15140
15218
|
import { Check as Check2, Minus as Minus2 } from "lucide-react";
|
|
15141
15219
|
import { useCallback as useCallback23 } from "react";
|
|
15142
|
-
import
|
|
15220
|
+
import clsx36 from "clsx";
|
|
15143
15221
|
import { jsx as jsx71, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
15144
15222
|
var Checkbox = ({
|
|
15145
15223
|
value = false,
|
|
@@ -15183,7 +15261,7 @@ var Checkbox = ({
|
|
|
15183
15261
|
tabIndex: disabled ? -1 : 0,
|
|
15184
15262
|
"aria-checked": indeterminate ? "mixed" : value,
|
|
15185
15263
|
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
15186
|
-
className:
|
|
15264
|
+
className: clsx36("checkbox", props.className),
|
|
15187
15265
|
children: [
|
|
15188
15266
|
/* @__PURE__ */ jsx71(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ jsx71(Minus2, { className: "checkbox-indicator", "aria-hidden": true }) }),
|
|
15189
15267
|
/* @__PURE__ */ jsx71(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ jsx71(Check2, { className: "checkbox-indicator", "aria-hidden": true }) })
|
|
@@ -15213,7 +15291,7 @@ import { jsx as jsx72 } from "react/jsx-runtime";
|
|
|
15213
15291
|
var TableWithSelectionProvider = ({
|
|
15214
15292
|
children,
|
|
15215
15293
|
state,
|
|
15216
|
-
|
|
15294
|
+
fillerRowCell,
|
|
15217
15295
|
rowSelection,
|
|
15218
15296
|
disableClickRowClickSelection = false,
|
|
15219
15297
|
selectionRowId = "selection",
|
|
@@ -15237,7 +15315,14 @@ var TableWithSelectionProvider = ({
|
|
|
15237
15315
|
);
|
|
15238
15316
|
},
|
|
15239
15317
|
cell: ({ row }) => {
|
|
15240
|
-
return /* @__PURE__ */ jsx72(
|
|
15318
|
+
return /* @__PURE__ */ jsx72(
|
|
15319
|
+
Checkbox,
|
|
15320
|
+
{
|
|
15321
|
+
disabled: !row.getCanSelect(),
|
|
15322
|
+
value: row.getIsSelected(),
|
|
15323
|
+
onValueChange: row.getToggleSelectedHandler()
|
|
15324
|
+
}
|
|
15325
|
+
);
|
|
15241
15326
|
},
|
|
15242
15327
|
size: 60,
|
|
15243
15328
|
minSize: 60,
|
|
@@ -15253,12 +15338,12 @@ var TableWithSelectionProvider = ({
|
|
|
15253
15338
|
TableProvider,
|
|
15254
15339
|
{
|
|
15255
15340
|
...props,
|
|
15256
|
-
|
|
15341
|
+
fillerRowCell: useCallback24((columnId, table) => {
|
|
15257
15342
|
if (columnId === selectionRowId) {
|
|
15258
|
-
return /* @__PURE__ */ jsx72(Checkbox, { value: false, disabled: true
|
|
15343
|
+
return /* @__PURE__ */ jsx72(Checkbox, { value: false, disabled: true });
|
|
15259
15344
|
}
|
|
15260
|
-
return
|
|
15261
|
-
}, [
|
|
15345
|
+
return fillerRowCell?.(columnId, table) ?? /* @__PURE__ */ jsx72(FillerCell, {});
|
|
15346
|
+
}, [fillerRowCell, selectionRowId]),
|
|
15262
15347
|
columns: columnDef,
|
|
15263
15348
|
initialState: {
|
|
15264
15349
|
...props.initialState,
|
|
@@ -15283,11 +15368,11 @@ var TableWithSelectionProvider = ({
|
|
|
15283
15368
|
};
|
|
15284
15369
|
|
|
15285
15370
|
// src/components/layout/table/Table.tsx
|
|
15286
|
-
import
|
|
15371
|
+
import clsx37 from "clsx";
|
|
15287
15372
|
import { jsx as jsx73, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
15288
15373
|
var Table = ({ children, table, paginationOptions, displayProps, header, footer, ...props }) => {
|
|
15289
15374
|
const { showPagination = true, allowChangingPageSize, pageSizeOptions } = paginationOptions ?? {};
|
|
15290
|
-
return /* @__PURE__ */ jsx73("div", { ...props, className:
|
|
15375
|
+
return /* @__PURE__ */ jsx73("div", { ...props, className: clsx37("flex-col-3", props.className), children: /* @__PURE__ */ jsxs43(TableProvider, { ...table, children: [
|
|
15291
15376
|
header,
|
|
15292
15377
|
/* @__PURE__ */ jsx73(TableDisplay, { ...displayProps, children }),
|
|
15293
15378
|
/* @__PURE__ */ jsx73(Visibility, { isVisible: showPagination, children: /* @__PURE__ */ jsx73(TablePagination, { allowChangingPageSize, pageSizeOptions }) }),
|
|
@@ -15304,7 +15389,7 @@ var TableWithSelection = ({
|
|
|
15304
15389
|
...props
|
|
15305
15390
|
}) => {
|
|
15306
15391
|
const { showPagination = true, allowChangingPageSize, pageSizeOptions } = paginationOptions ?? {};
|
|
15307
|
-
return /* @__PURE__ */ jsx73("div", { ...props, className:
|
|
15392
|
+
return /* @__PURE__ */ jsx73("div", { ...props, className: clsx37("flex-col-3", props.className), children: /* @__PURE__ */ jsxs43(TableWithSelectionProvider, { ...table, children: [
|
|
15308
15393
|
header,
|
|
15309
15394
|
/* @__PURE__ */ jsx73(TableDisplay, { ...displayProps, children }),
|
|
15310
15395
|
/* @__PURE__ */ jsx73(Visibility, { isVisible: showPagination, children: /* @__PURE__ */ jsx73(TablePagination, { allowChangingPageSize, pageSizeOptions }) }),
|
|
@@ -15614,7 +15699,7 @@ var TableColumnSwitcher = ({ buttonProps, ...props }) => {
|
|
|
15614
15699
|
|
|
15615
15700
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
15616
15701
|
import { useState as useState34 } from "react";
|
|
15617
|
-
import { clsx as
|
|
15702
|
+
import { clsx as clsx38 } from "clsx";
|
|
15618
15703
|
|
|
15619
15704
|
// src/utils/writeToClipboard.ts
|
|
15620
15705
|
var writeToClipboard = (text) => {
|
|
@@ -15657,7 +15742,7 @@ var CopyToClipboardWrapper = ({
|
|
|
15657
15742
|
return /* @__PURE__ */ jsxs45(
|
|
15658
15743
|
"div",
|
|
15659
15744
|
{
|
|
15660
|
-
className:
|
|
15745
|
+
className: clsx38("relative inline-block cursor-copy", containerClassName),
|
|
15661
15746
|
onMouseEnter: () => {
|
|
15662
15747
|
setIsShowingIndication(true);
|
|
15663
15748
|
},
|
|
@@ -15675,7 +15760,7 @@ var CopyToClipboardWrapper = ({
|
|
|
15675
15760
|
/* @__PURE__ */ jsxs45(
|
|
15676
15761
|
"div",
|
|
15677
15762
|
{
|
|
15678
|
-
className:
|
|
15763
|
+
className: clsx38(
|
|
15679
15764
|
`absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
15680
15765
|
shadow-around-md bg-tooltip-background cursor-default pointer-events-none`,
|
|
15681
15766
|
"transition-opacity duration-200",
|
|
@@ -15698,7 +15783,7 @@ var CopyToClipboardWrapper = ({
|
|
|
15698
15783
|
/* @__PURE__ */ jsx76(
|
|
15699
15784
|
"div",
|
|
15700
15785
|
{
|
|
15701
|
-
className:
|
|
15786
|
+
className: clsx38(`absolute w-0 h-0`, triangleClasses[position]),
|
|
15702
15787
|
style: { ...triangleStyle[position], zIndex: zIndex + 1 }
|
|
15703
15788
|
}
|
|
15704
15789
|
)
|
|
@@ -15712,7 +15797,7 @@ var CopyToClipboardWrapper = ({
|
|
|
15712
15797
|
|
|
15713
15798
|
// src/components/user-interaction/Menu.tsx
|
|
15714
15799
|
import { useCallback as useCallback25, useRef as useRef26 } from "react";
|
|
15715
|
-
import
|
|
15800
|
+
import clsx39 from "clsx";
|
|
15716
15801
|
|
|
15717
15802
|
// src/hooks/useHoverState.ts
|
|
15718
15803
|
import { useEffect as useEffect34, useState as useState35 } from "react";
|
|
@@ -15768,7 +15853,7 @@ var MenuItem = ({
|
|
|
15768
15853
|
}) => /* @__PURE__ */ jsx77(
|
|
15769
15854
|
"div",
|
|
15770
15855
|
{
|
|
15771
|
-
className:
|
|
15856
|
+
className: clsx39("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
|
|
15772
15857
|
"text-disabled cursor-not-allowed": isDisabled,
|
|
15773
15858
|
"text-menu-text hover:bg-primary/20": !isDisabled,
|
|
15774
15859
|
"cursor-pointer": !!onClick
|
|
@@ -15816,7 +15901,7 @@ var Menu = ({
|
|
|
15816
15901
|
|
|
15817
15902
|
// src/components/user-interaction/ScrollPicker.tsx
|
|
15818
15903
|
import { useCallback as useCallback26, useEffect as useEffect35, useState as useState36 } from "react";
|
|
15819
|
-
import
|
|
15904
|
+
import clsx40 from "clsx";
|
|
15820
15905
|
import { jsx as jsx78, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
15821
15906
|
var up = 1;
|
|
15822
15907
|
var down = -1;
|
|
@@ -15986,7 +16071,7 @@ var ScrollPicker = ({
|
|
|
15986
16071
|
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ jsx78(
|
|
15987
16072
|
"div",
|
|
15988
16073
|
{
|
|
15989
|
-
className:
|
|
16074
|
+
className: clsx40(
|
|
15990
16075
|
`flex-col-2 items-center justify-center rounded-md`,
|
|
15991
16076
|
{
|
|
15992
16077
|
"text-primary font-bold": currentIndex === index,
|
|
@@ -16014,7 +16099,7 @@ var ScrollPicker = ({
|
|
|
16014
16099
|
|
|
16015
16100
|
// src/components/user-interaction/Textarea.tsx
|
|
16016
16101
|
import { forwardRef as forwardRef16, useId as useId16 } from "react";
|
|
16017
|
-
import
|
|
16102
|
+
import clsx41 from "clsx";
|
|
16018
16103
|
import { jsx as jsx79, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
16019
16104
|
var Textarea = forwardRef16(function Textarea2({
|
|
16020
16105
|
invalid = false,
|
|
@@ -16081,7 +16166,7 @@ var TextareaWithHeadline = ({
|
|
|
16081
16166
|
return /* @__PURE__ */ jsxs48(
|
|
16082
16167
|
"div",
|
|
16083
16168
|
{
|
|
16084
|
-
className:
|
|
16169
|
+
className: clsx41(
|
|
16085
16170
|
"group flex-col-3 border-2 rounded-lg",
|
|
16086
16171
|
{
|
|
16087
16172
|
"bg-input-background text-input-text hover:border-primary focus-within:border-primary": !disabled,
|
|
@@ -16090,13 +16175,13 @@ var TextareaWithHeadline = ({
|
|
|
16090
16175
|
containerClassName
|
|
16091
16176
|
),
|
|
16092
16177
|
children: [
|
|
16093
|
-
headline && /* @__PURE__ */ jsx79("label", { ...headlineProps, htmlFor: usedId, className:
|
|
16178
|
+
headline && /* @__PURE__ */ jsx79("label", { ...headlineProps, htmlFor: usedId, className: clsx41("typography-lable-md text-label", headlineProps.className), children: headline }),
|
|
16094
16179
|
/* @__PURE__ */ jsx79(
|
|
16095
16180
|
Textarea,
|
|
16096
16181
|
{
|
|
16097
16182
|
...props,
|
|
16098
16183
|
id: usedId,
|
|
16099
|
-
className:
|
|
16184
|
+
className: clsx41(
|
|
16100
16185
|
"border-transparent focus:ring-0 focus-visible:ring-0 resize-none h-32",
|
|
16101
16186
|
className
|
|
16102
16187
|
)
|
|
@@ -16151,7 +16236,7 @@ var TimeDisplay = ({
|
|
|
16151
16236
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
16152
16237
|
import { useId as useId17 } from "react";
|
|
16153
16238
|
import { forwardRef as forwardRef17, useState as useState37 } from "react";
|
|
16154
|
-
import
|
|
16239
|
+
import clsx42 from "clsx";
|
|
16155
16240
|
import { jsx as jsx81, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
16156
16241
|
var InsideLabelInput = forwardRef17(function InsideLabelInput2({
|
|
16157
16242
|
id: customId,
|
|
@@ -16162,13 +16247,13 @@ var InsideLabelInput = forwardRef17(function InsideLabelInput2({
|
|
|
16162
16247
|
const [isFocused, setIsFocused] = useState37(false);
|
|
16163
16248
|
const generatedId = useId17();
|
|
16164
16249
|
const id = customId ?? generatedId;
|
|
16165
|
-
return /* @__PURE__ */ jsxs49("div", { className:
|
|
16250
|
+
return /* @__PURE__ */ jsxs49("div", { className: clsx42("relative"), children: [
|
|
16166
16251
|
/* @__PURE__ */ jsx81(
|
|
16167
16252
|
Input,
|
|
16168
16253
|
{
|
|
16169
16254
|
...props,
|
|
16170
16255
|
id,
|
|
16171
|
-
className:
|
|
16256
|
+
className: clsx42("h-14 px-4 pb-2 py-6.5", props.className),
|
|
16172
16257
|
ref: forwardedRef,
|
|
16173
16258
|
"aria-labelledby": id + "-label",
|
|
16174
16259
|
onFocus: (event) => {
|
|
@@ -16187,7 +16272,7 @@ var InsideLabelInput = forwardRef17(function InsideLabelInput2({
|
|
|
16187
16272
|
id: id + "-label",
|
|
16188
16273
|
"aria-hidden": true,
|
|
16189
16274
|
"data-display": isFocused || !!value ? "small" : "full",
|
|
16190
|
-
className:
|
|
16275
|
+
className: clsx42(
|
|
16191
16276
|
// margin left to account for the border which is ignored for absolute positions
|
|
16192
16277
|
"absolute left-4 ml-0.5 top-2 transition-all delay-25 pointer-events-none touch-none",
|
|
16193
16278
|
"data-[display=small]:top-2 data-[display=small]:h-force-4.5 data-[display=small]:typography-caption-sm data-[display=small]:overflow-y-hidden",
|
|
@@ -16215,7 +16300,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
16215
16300
|
|
|
16216
16301
|
// src/components/user-interaction/input/SearchBar.tsx
|
|
16217
16302
|
import { Search } from "lucide-react";
|
|
16218
|
-
import { clsx as
|
|
16303
|
+
import { clsx as clsx43 } from "clsx";
|
|
16219
16304
|
import { jsx as jsx82, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
16220
16305
|
var SearchBar = ({
|
|
16221
16306
|
value: initialValue,
|
|
@@ -16227,7 +16312,7 @@ var SearchBar = ({
|
|
|
16227
16312
|
}) => {
|
|
16228
16313
|
const translation = useHightideTranslation();
|
|
16229
16314
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
16230
|
-
return /* @__PURE__ */ jsxs50("div", { ...containerProps, className:
|
|
16315
|
+
return /* @__PURE__ */ jsxs50("div", { ...containerProps, className: clsx43("relative", containerProps?.className), children: [
|
|
16231
16316
|
/* @__PURE__ */ jsx82(
|
|
16232
16317
|
InputUncontrolled,
|
|
16233
16318
|
{
|
|
@@ -16236,7 +16321,7 @@ var SearchBar = ({
|
|
|
16236
16321
|
onValueChange: setValue,
|
|
16237
16322
|
onEditComplete: onSearch,
|
|
16238
16323
|
placeholder: inputProps.placeholder ?? translation("search"),
|
|
16239
|
-
className:
|
|
16324
|
+
className: clsx43("pr-10 w-full", inputProps.className)
|
|
16240
16325
|
}
|
|
16241
16326
|
),
|
|
16242
16327
|
/* @__PURE__ */ jsx82(
|
|
@@ -16248,7 +16333,7 @@ var SearchBar = ({
|
|
|
16248
16333
|
color: "neutral",
|
|
16249
16334
|
coloringStyle: "text",
|
|
16250
16335
|
onClick: () => onSearch(value),
|
|
16251
|
-
className:
|
|
16336
|
+
className: clsx43("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
|
|
16252
16337
|
children: /* @__PURE__ */ jsx82(Search, { className: "w-full h-full" })
|
|
16253
16338
|
}
|
|
16254
16339
|
)
|
|
@@ -16258,7 +16343,7 @@ var SearchBar = ({
|
|
|
16258
16343
|
// src/components/user-interaction/input/ToggleableInput.tsx
|
|
16259
16344
|
import { forwardRef as forwardRef18, useEffect as useEffect36, useImperativeHandle as useImperativeHandle10, useRef as useRef27, useState as useState38 } from "react";
|
|
16260
16345
|
import { Pencil } from "lucide-react";
|
|
16261
|
-
import
|
|
16346
|
+
import clsx44 from "clsx";
|
|
16262
16347
|
import { jsx as jsx83, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
16263
16348
|
var ToggleableInput = forwardRef18(function ToggleableInput2({
|
|
16264
16349
|
value,
|
|
@@ -16274,7 +16359,7 @@ var ToggleableInput = forwardRef18(function ToggleableInput2({
|
|
|
16274
16359
|
innerRef.current?.focus();
|
|
16275
16360
|
}
|
|
16276
16361
|
}, [isEditing]);
|
|
16277
|
-
return /* @__PURE__ */ jsxs51("div", { className:
|
|
16362
|
+
return /* @__PURE__ */ jsxs51("div", { className: clsx44("relative flex-row-2", { "flex-1": isEditing }), children: [
|
|
16278
16363
|
/* @__PURE__ */ jsx83(
|
|
16279
16364
|
Input,
|
|
16280
16365
|
{
|
|
@@ -16296,14 +16381,14 @@ var ToggleableInput = forwardRef18(function ToggleableInput2({
|
|
|
16296
16381
|
},
|
|
16297
16382
|
"data-name": props["data-name"] ?? "togglable-input",
|
|
16298
16383
|
"data-isEditing": isEditing ? "" : void 0,
|
|
16299
|
-
className:
|
|
16384
|
+
className: clsx44(`w-full rounded-md`, {
|
|
16300
16385
|
"text-transparent": !isEditing
|
|
16301
16386
|
})
|
|
16302
16387
|
}
|
|
16303
16388
|
),
|
|
16304
16389
|
!isEditing && /* @__PURE__ */ jsxs51("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
|
|
16305
|
-
/* @__PURE__ */ jsx83("span", { className:
|
|
16306
|
-
/* @__PURE__ */ jsx83(Pencil, { className:
|
|
16390
|
+
/* @__PURE__ */ jsx83("span", { className: clsx44(" truncate"), children: value }),
|
|
16391
|
+
/* @__PURE__ */ jsx83(Pencil, { className: clsx44(`size-force-4`, { "text-transparent": isEditing }) })
|
|
16307
16392
|
] })
|
|
16308
16393
|
] });
|
|
16309
16394
|
});
|
|
@@ -17451,6 +17536,8 @@ export {
|
|
|
17451
17536
|
FormContext,
|
|
17452
17537
|
FormField,
|
|
17453
17538
|
FormFieldLayout,
|
|
17539
|
+
FormObserver,
|
|
17540
|
+
FormObserverKey,
|
|
17454
17541
|
FormProvider,
|
|
17455
17542
|
FormStore,
|
|
17456
17543
|
GenericFilter,
|
|
@@ -17615,6 +17702,8 @@ export {
|
|
|
17615
17702
|
useFocusTrap,
|
|
17616
17703
|
useForm,
|
|
17617
17704
|
useFormField,
|
|
17705
|
+
useFormObserver,
|
|
17706
|
+
useFormObserverKey,
|
|
17618
17707
|
useHandleRefs,
|
|
17619
17708
|
useHightideConfig,
|
|
17620
17709
|
useHightideTranslation,
|