@helpwave/hightide 0.0.17 → 0.0.19
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/components/modals/ConfirmDialog.js +9 -7
- package/dist/components/modals/ConfirmDialog.js.map +1 -1
- package/dist/components/modals/ConfirmDialog.mjs +9 -7
- package/dist/components/modals/ConfirmDialog.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesDialog.js +9 -7
- package/dist/components/modals/DiscardChangesDialog.js.map +1 -1
- package/dist/components/modals/DiscardChangesDialog.mjs +9 -7
- package/dist/components/modals/DiscardChangesDialog.mjs.map +1 -1
- package/dist/components/modals/InputModal.js +9 -7
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +9 -7
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +9 -7
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +9 -7
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/Modal.js +9 -7
- package/dist/components/modals/Modal.js.map +1 -1
- package/dist/components/modals/Modal.mjs +9 -7
- package/dist/components/modals/Modal.mjs.map +1 -1
- package/dist/components/user-input/ToggleableInput.d.mts +7 -7
- package/dist/components/user-input/ToggleableInput.d.ts +7 -7
- package/dist/components/user-input/ToggleableInput.js +45 -9
- package/dist/components/user-input/ToggleableInput.js.map +1 -1
- package/dist/components/user-input/ToggleableInput.mjs +44 -9
- package/dist/components/user-input/ToggleableInput.mjs.map +1 -1
- package/dist/css/globals.css +8 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +52 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3882,14 +3882,16 @@ var ModalHeader = ({
|
|
|
3882
3882
|
descriptionText = ""
|
|
3883
3883
|
}) => {
|
|
3884
3884
|
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
3885
|
+
const hasTitleRow = !!title || !!titleText || !!onCloseClick;
|
|
3886
|
+
const titleRow = /* @__PURE__ */ jsxs31("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
3887
|
+
title ?? /* @__PURE__ */ jsx44("span", { className: clsx32("textstyle-title-lg", {
|
|
3888
|
+
"mb-1": description || descriptionText
|
|
3889
|
+
}), children: titleText }),
|
|
3890
|
+
!!onCloseClick && /* @__PURE__ */ jsx44(Tooltip, { tooltip: translation.close, children: /* @__PURE__ */ jsx44("button", { className: "row bg-gray-200 hover:bg-gray-300 rounded-md p-1", onClick: onCloseClick, children: /* @__PURE__ */ jsx44(X, {}) }) })
|
|
3891
|
+
] });
|
|
3885
3892
|
return /* @__PURE__ */ jsxs31("div", { className: "col", children: [
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
"mb-1": description || descriptionText
|
|
3889
|
-
}), children: titleText }),
|
|
3890
|
-
!!onCloseClick && /* @__PURE__ */ jsx44(Tooltip, { tooltip: translation.close, children: /* @__PURE__ */ jsx44("button", { className: "row bg-gray-200 hover:bg-gray-300 rounded-md p-1", onClick: onCloseClick, children: /* @__PURE__ */ jsx44(X, {}) }) })
|
|
3891
|
-
] }),
|
|
3892
|
-
description ?? /* @__PURE__ */ jsx44("span", { className: "textstyle-description", children: descriptionText })
|
|
3893
|
+
hasTitleRow && titleRow,
|
|
3894
|
+
description ?? (descriptionText && /* @__PURE__ */ jsx44("span", { className: "textstyle-description", children: descriptionText }))
|
|
3893
3895
|
] });
|
|
3894
3896
|
};
|
|
3895
3897
|
var modalRootName = "modal-root";
|
|
@@ -5242,29 +5244,35 @@ var ScrollPicker = ({
|
|
|
5242
5244
|
};
|
|
5243
5245
|
|
|
5244
5246
|
// src/components/user-input/ToggleableInput.tsx
|
|
5245
|
-
import { useState as useState25 } from "react";
|
|
5247
|
+
import { useEffect as useEffect19, useRef as useRef7, useState as useState25 } from "react";
|
|
5246
5248
|
import { Pencil } from "lucide-react";
|
|
5247
5249
|
import clsx45 from "clsx";
|
|
5248
5250
|
import { jsx as jsx63, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
5249
5251
|
var ToggleableInput = ({
|
|
5250
|
-
id,
|
|
5251
5252
|
type = "text",
|
|
5252
5253
|
value,
|
|
5253
5254
|
onChange = noop,
|
|
5255
|
+
onChangeText = noop,
|
|
5256
|
+
onEditCompleted = noop,
|
|
5254
5257
|
labelClassName = "",
|
|
5255
5258
|
initialState = "display",
|
|
5256
5259
|
size = 20,
|
|
5257
5260
|
disclaimer,
|
|
5258
5261
|
onBlur,
|
|
5259
|
-
onEditCompleted = noop,
|
|
5260
5262
|
...restProps
|
|
5261
5263
|
}) => {
|
|
5262
5264
|
const [isEditing, setIsEditing] = useState25(initialState !== "display");
|
|
5263
5265
|
const { restartTimer, clearUpdateTimer } = useSaveDelay(() => void 0, 3e3);
|
|
5266
|
+
const ref = useRef7(null);
|
|
5264
5267
|
const onEditCompletedWrapper = (text) => {
|
|
5265
5268
|
onEditCompleted(text);
|
|
5266
5269
|
clearUpdateTimer();
|
|
5267
5270
|
};
|
|
5271
|
+
useEffect19(() => {
|
|
5272
|
+
if (isEditing) {
|
|
5273
|
+
ref.current?.focus();
|
|
5274
|
+
}
|
|
5275
|
+
}, [isEditing]);
|
|
5268
5276
|
return /* @__PURE__ */ jsxs44("div", { children: [
|
|
5269
5277
|
/* @__PURE__ */ jsxs44(
|
|
5270
5278
|
"div",
|
|
@@ -5275,17 +5283,17 @@ var ToggleableInput = ({
|
|
|
5275
5283
|
/* @__PURE__ */ jsx63("div", { className: clsx45("row overflow-hidden", { "flex-1": isEditing }), children: isEditing ? /* @__PURE__ */ jsx63(
|
|
5276
5284
|
"input",
|
|
5277
5285
|
{
|
|
5278
|
-
|
|
5286
|
+
ref,
|
|
5279
5287
|
...restProps,
|
|
5280
5288
|
value,
|
|
5281
5289
|
type,
|
|
5282
|
-
id,
|
|
5283
5290
|
onChange: (event) => {
|
|
5284
5291
|
const value2 = event.target.value;
|
|
5285
5292
|
restartTimer(() => {
|
|
5286
5293
|
onEditCompletedWrapper(value2);
|
|
5287
5294
|
});
|
|
5288
|
-
|
|
5295
|
+
onChangeText(value2);
|
|
5296
|
+
onChange(event);
|
|
5289
5297
|
},
|
|
5290
5298
|
onBlur: (event) => {
|
|
5291
5299
|
if (onBlur) {
|
|
@@ -5300,7 +5308,7 @@ var ToggleableInput = ({
|
|
|
5300
5308
|
onEditCompletedWrapper(value);
|
|
5301
5309
|
}
|
|
5302
5310
|
},
|
|
5303
|
-
className: clsx45(labelClassName, `w-full border-none rounded-none
|
|
5311
|
+
className: clsx45(labelClassName, `w-full border-none rounded-none ring-0 outline-0 shadow-transparent decoration-primary p-0 underline-offset-4`, {
|
|
5304
5312
|
underline: isEditing
|
|
5305
5313
|
}),
|
|
5306
5314
|
onFocus: (event) => event.target.select()
|
|
@@ -5312,17 +5320,45 @@ var ToggleableInput = ({
|
|
|
5312
5320
|
children: value
|
|
5313
5321
|
}
|
|
5314
5322
|
) }),
|
|
5315
|
-
/* @__PURE__ */ jsx63(
|
|
5323
|
+
/* @__PURE__ */ jsx63(
|
|
5324
|
+
Pencil,
|
|
5325
|
+
{
|
|
5326
|
+
className: clsx45(`cursor-pointer`, { "text-transparent": isEditing }),
|
|
5327
|
+
size,
|
|
5328
|
+
style: { minWidth: `${size}px` }
|
|
5329
|
+
}
|
|
5330
|
+
)
|
|
5316
5331
|
]
|
|
5317
5332
|
}
|
|
5318
5333
|
),
|
|
5319
5334
|
isEditing && disclaimer && /* @__PURE__ */ jsx63("label", { className: "text-negative", children: disclaimer })
|
|
5320
5335
|
] });
|
|
5321
5336
|
};
|
|
5337
|
+
var ToggleableInputUncontrolled = ({
|
|
5338
|
+
value: initialValue,
|
|
5339
|
+
onChangeText = noop,
|
|
5340
|
+
...restProps
|
|
5341
|
+
}) => {
|
|
5342
|
+
const [value, setValue] = useState25(initialValue);
|
|
5343
|
+
useEffect19(() => {
|
|
5344
|
+
setValue(initialValue);
|
|
5345
|
+
}, [initialValue]);
|
|
5346
|
+
return /* @__PURE__ */ jsx63(
|
|
5347
|
+
ToggleableInput,
|
|
5348
|
+
{
|
|
5349
|
+
value,
|
|
5350
|
+
onChangeText: (text) => {
|
|
5351
|
+
setValue(text);
|
|
5352
|
+
onChangeText(text);
|
|
5353
|
+
},
|
|
5354
|
+
...restProps
|
|
5355
|
+
}
|
|
5356
|
+
);
|
|
5357
|
+
};
|
|
5322
5358
|
|
|
5323
5359
|
// src/hooks/useTheme.tsx
|
|
5324
5360
|
import { useContext as useContext3 } from "react";
|
|
5325
|
-
import { createContext as createContext3, useState as useState26, useEffect as
|
|
5361
|
+
import { createContext as createContext3, useState as useState26, useEffect as useEffect20 } from "react";
|
|
5326
5362
|
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
5327
5363
|
var defaultThemeTypeTranslation = {
|
|
5328
5364
|
en: {
|
|
@@ -5341,13 +5377,13 @@ var ThemeContext = createContext3({
|
|
|
5341
5377
|
});
|
|
5342
5378
|
var ThemeProvider = ({ children, initialTheme = "light" }) => {
|
|
5343
5379
|
const [theme, setTheme] = useState26(initialTheme);
|
|
5344
|
-
|
|
5380
|
+
useEffect20(() => {
|
|
5345
5381
|
if (theme !== initialTheme) {
|
|
5346
5382
|
console.warn("ThemeProvider initial state changed: Prefer using useTheme's setTheme instead");
|
|
5347
5383
|
setTheme(initialTheme);
|
|
5348
5384
|
}
|
|
5349
5385
|
}, [initialTheme]);
|
|
5350
|
-
|
|
5386
|
+
useEffect20(() => {
|
|
5351
5387
|
document.documentElement.setAttribute("data-theme", theme);
|
|
5352
5388
|
}, [theme]);
|
|
5353
5389
|
return /* @__PURE__ */ jsx64(ThemeContext.Provider, { value: { theme, setTheme }, children });
|
|
@@ -5483,6 +5519,7 @@ export {
|
|
|
5483
5519
|
TimeDisplay,
|
|
5484
5520
|
TimePicker,
|
|
5485
5521
|
ToggleableInput,
|
|
5522
|
+
ToggleableInputUncontrolled,
|
|
5486
5523
|
Tooltip,
|
|
5487
5524
|
UncontrolledCheckbox,
|
|
5488
5525
|
UncontrolledInput,
|