@douglasneuroinformatics/libui 3.2.0 → 3.4.0
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.d.ts +8 -3
- package/dist/components.js +30 -19
- package/dist/components.js.map +1 -1
- package/dist/douglasneuroinformatics-libui-3.4.0.tgz +0 -0
- package/dist/tailwind/config.cjs +82 -72
- package/dist/tailwind/config.cjs.map +1 -1
- package/dist/tailwind/config.d.cts +5 -2
- package/package.json +2 -2
- package/src/components/Form/BaseRadioField.tsx +1 -1
- package/src/components/Form/BooleanField/BooleanFieldCheckbox.tsx +1 -1
- package/src/components/Form/BooleanField/BooleanFieldRadio.tsx +1 -1
- package/src/components/Form/DateField/DateField.tsx +1 -1
- package/src/components/Form/FieldGroup/FieldGroupRoot.tsx +4 -2
- package/src/components/Form/Form.tsx +3 -0
- package/src/components/Form/NumberField/NumberFieldInput.tsx +1 -1
- package/src/components/Form/NumberField/NumberFieldRadio.tsx +1 -1
- package/src/components/Form/NumberField/NumberFieldSelect.tsx +1 -1
- package/src/components/Form/NumberField/NumberFieldSlider.tsx +1 -1
- package/src/components/Form/SetField/SetFieldListbox.tsx +1 -1
- package/src/components/Form/SetField/SetFieldSelect.tsx +2 -1
- package/src/components/Form/StringField/StringFieldInput.tsx +1 -1
- package/src/components/Form/StringField/StringFieldPassword.tsx +1 -1
- package/src/components/Form/StringField/StringFieldSelect.tsx +1 -1
- package/src/components/Form/StringField/StringFieldTextArea.tsx +1 -1
- package/src/components/SearchBar/SearchBar.tsx +13 -2
- package/src/components/StatisticCard/StatisticCard.tsx +3 -2
- package/src/tailwind/config.cts +86 -73
- package/dist/douglasneuroinformatics-libui-3.2.0.tgz +0 -0
package/dist/components.d.ts
CHANGED
|
@@ -1166,6 +1166,7 @@ type FormProps<TSchema extends z.ZodType<FormDataType>, TData extends z.TypeOf<T
|
|
|
1166
1166
|
[key: `data-${string}`]: unknown;
|
|
1167
1167
|
className?: string;
|
|
1168
1168
|
content: FormContent<TData>;
|
|
1169
|
+
fieldsFooter?: React$1.ReactNode;
|
|
1169
1170
|
id?: string;
|
|
1170
1171
|
initialValues?: PartialNullableFormDataType<TData>;
|
|
1171
1172
|
onError?: (error: z.ZodError<TData>) => void;
|
|
@@ -1177,7 +1178,7 @@ type FormProps<TSchema extends z.ZodType<FormDataType>, TData extends z.TypeOf<T
|
|
|
1177
1178
|
submitBtnLabel?: string;
|
|
1178
1179
|
validationSchema: z.ZodType<TData>;
|
|
1179
1180
|
};
|
|
1180
|
-
declare const Form: <TSchema extends z.ZodType<FormDataType>, TData extends z.TypeOf<TSchema> = z.TypeOf<TSchema>>({ className, content, id, initialValues, onError, onSubmit, preventResetValuesOnReset, readOnly, resetBtn, revalidateOnBlur, submitBtnLabel, validationSchema, ...props }: FormProps<TSchema, TData>) => react_jsx_runtime.JSX.Element;
|
|
1181
|
+
declare const Form: <TSchema extends z.ZodType<FormDataType>, TData extends z.TypeOf<TSchema> = z.TypeOf<TSchema>>({ className, content, fieldsFooter, id, initialValues, onError, onSubmit, preventResetValuesOnReset, readOnly, resetBtn, revalidateOnBlur, submitBtnLabel, validationSchema, ...props }: FormProps<TSchema, TData>) => react_jsx_runtime.JSX.Element;
|
|
1181
1182
|
|
|
1182
1183
|
type HeadingProps = {
|
|
1183
1184
|
children: string;
|
|
@@ -1344,8 +1345,11 @@ declare const Resizable: ResizableType;
|
|
|
1344
1345
|
declare const ScrollArea: React$1.ForwardRefExoticComponent<Omit<_radix_ui_react_scroll_area.ScrollAreaProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1345
1346
|
|
|
1346
1347
|
type BaseSearchBarProps = {
|
|
1348
|
+
[key: `data-${string}`]: unknown;
|
|
1347
1349
|
/** Additional CSS classes to add to the wrapper form component, potentially overriding default styling */
|
|
1348
1350
|
className?: string;
|
|
1351
|
+
/** The ID to pass to the HTMLFormElement */
|
|
1352
|
+
id?: string;
|
|
1349
1353
|
/** An optional callback invoked when the user clicks the search bar */
|
|
1350
1354
|
onClick?: () => void;
|
|
1351
1355
|
/** Custom placeholder to use instead of the default */
|
|
@@ -1364,7 +1368,7 @@ type UncontrolledSearchBarProps = {
|
|
|
1364
1368
|
value?: never;
|
|
1365
1369
|
} & BaseSearchBarProps;
|
|
1366
1370
|
type SearchBarProps = ControlledSearchBarProps | UncontrolledSearchBarProps;
|
|
1367
|
-
declare const SearchBar: ({ className, onClick, onValueChange, placeholder, readOnly, value }: SearchBarProps) => react_jsx_runtime.JSX.Element;
|
|
1371
|
+
declare const SearchBar: ({ className, onClick, onValueChange, placeholder, readOnly, value, ...props }: SearchBarProps) => react_jsx_runtime.JSX.Element;
|
|
1368
1372
|
|
|
1369
1373
|
declare const Select: React$1.FC<SelectPrimitive.SelectProps> & {
|
|
1370
1374
|
Content: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
@@ -1402,12 +1406,13 @@ declare const Spinner: ({ className, ...props }: HTMLProps<HTMLDivElement>) => r
|
|
|
1402
1406
|
declare const SpinnerIcon: ({ className, ...props }: React$1.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
|
|
1403
1407
|
|
|
1404
1408
|
type StatisticCardProps = {
|
|
1409
|
+
[key: `data-${string}`]: unknown;
|
|
1405
1410
|
className?: string;
|
|
1406
1411
|
icon?: JSX.Element;
|
|
1407
1412
|
label: string;
|
|
1408
1413
|
value: number;
|
|
1409
1414
|
};
|
|
1410
|
-
declare const StatisticCard: ({ className, icon, label, value }: StatisticCardProps) => react_jsx_runtime.JSX.Element;
|
|
1415
|
+
declare const StatisticCard: ({ className, icon, label, value, ...props }: StatisticCardProps) => react_jsx_runtime.JSX.Element;
|
|
1411
1416
|
|
|
1412
1417
|
declare const Switch: React$1.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1413
1418
|
|
package/dist/components.js
CHANGED
|
@@ -1921,7 +1921,7 @@ var FieldGroupDescription = ({ description }) => description ? /* @__PURE__ */ j
|
|
|
1921
1921
|
// src/components/Form/FieldGroup/FieldGroupRoot.tsx
|
|
1922
1922
|
import "react";
|
|
1923
1923
|
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
1924
|
-
var FieldGroupRoot = ({ children }) => /* @__PURE__ */ jsx94("div", { className: "flex flex-col gap-3 @container", children });
|
|
1924
|
+
var FieldGroupRoot = ({ children, name }) => /* @__PURE__ */ jsx94("div", { className: "flex flex-col gap-3 @container", "data-field-group": name, children });
|
|
1925
1925
|
|
|
1926
1926
|
// src/components/Form/FieldGroup/FieldGroupRow.tsx
|
|
1927
1927
|
import "react";
|
|
@@ -1969,7 +1969,7 @@ var NumberFieldInput = ({
|
|
|
1969
1969
|
setValue(newValue);
|
|
1970
1970
|
}
|
|
1971
1971
|
};
|
|
1972
|
-
return /* @__PURE__ */ jsxs24(FieldGroup, { children: [
|
|
1972
|
+
return /* @__PURE__ */ jsxs24(FieldGroup, { name, children: [
|
|
1973
1973
|
/* @__PURE__ */ jsxs24(FieldGroup.Row, { children: [
|
|
1974
1974
|
/* @__PURE__ */ jsx96(Label3, { children: label }),
|
|
1975
1975
|
/* @__PURE__ */ jsx96(FieldGroup.Description, { description })
|
|
@@ -2044,7 +2044,7 @@ var NumberFieldRadio = ({
|
|
|
2044
2044
|
value
|
|
2045
2045
|
}) => {
|
|
2046
2046
|
const optionsCount = Object.keys(options).length;
|
|
2047
|
-
return /* @__PURE__ */ jsxs25(FieldGroup, { children: [
|
|
2047
|
+
return /* @__PURE__ */ jsxs25(FieldGroup, { name, children: [
|
|
2048
2048
|
/* @__PURE__ */ jsxs25(FieldGroup.Row, { children: [
|
|
2049
2049
|
/* @__PURE__ */ jsx99(Label3, { children: label }),
|
|
2050
2050
|
/* @__PURE__ */ jsx99(FieldGroup.Description, { description })
|
|
@@ -2227,7 +2227,7 @@ var NumberFieldSelect = ({
|
|
|
2227
2227
|
setValue,
|
|
2228
2228
|
value
|
|
2229
2229
|
}) => {
|
|
2230
|
-
return /* @__PURE__ */ jsxs28(FieldGroup, { children: [
|
|
2230
|
+
return /* @__PURE__ */ jsxs28(FieldGroup, { name, children: [
|
|
2231
2231
|
/* @__PURE__ */ jsxs28(FieldGroup.Row, { children: [
|
|
2232
2232
|
/* @__PURE__ */ jsx107(Label3, { children: label }),
|
|
2233
2233
|
/* @__PURE__ */ jsx107(FieldGroup.Description, { description })
|
|
@@ -2294,7 +2294,7 @@ var NumberFieldSlider = ({
|
|
|
2294
2294
|
setValue,
|
|
2295
2295
|
value
|
|
2296
2296
|
}) => {
|
|
2297
|
-
return /* @__PURE__ */ jsxs30(FieldGroup, { children: [
|
|
2297
|
+
return /* @__PURE__ */ jsxs30(FieldGroup, { name, children: [
|
|
2298
2298
|
/* @__PURE__ */ jsxs30(FieldGroup.Row, { children: [
|
|
2299
2299
|
/* @__PURE__ */ jsx109(Label3, { children: label }),
|
|
2300
2300
|
/* @__PURE__ */ jsx109(FieldGroup.Description, { description })
|
|
@@ -2384,7 +2384,7 @@ var BooleanFieldCheckbox = ({
|
|
|
2384
2384
|
setValue,
|
|
2385
2385
|
value
|
|
2386
2386
|
}) => {
|
|
2387
|
-
return /* @__PURE__ */ jsxs32(FieldGroup, { children: [
|
|
2387
|
+
return /* @__PURE__ */ jsxs32(FieldGroup, { name, children: [
|
|
2388
2388
|
/* @__PURE__ */ jsxs32(FieldGroup.Row, { children: [
|
|
2389
2389
|
/* @__PURE__ */ jsx112(
|
|
2390
2390
|
Checkbox,
|
|
@@ -2428,7 +2428,7 @@ var BooleanFieldRadio = ({
|
|
|
2428
2428
|
},
|
|
2429
2429
|
[match3, setValue]
|
|
2430
2430
|
);
|
|
2431
|
-
return /* @__PURE__ */ jsxs33(FieldGroup, { children: [
|
|
2431
|
+
return /* @__PURE__ */ jsxs33(FieldGroup, { name, children: [
|
|
2432
2432
|
/* @__PURE__ */ jsx113(Label3, { children: label }),
|
|
2433
2433
|
/* @__PURE__ */ jsxs33(
|
|
2434
2434
|
RadioGroup4,
|
|
@@ -2497,7 +2497,7 @@ var DateField = ({ disabled, error, label, name, readOnly, setValue, value }) =>
|
|
|
2497
2497
|
useEffect4(() => {
|
|
2498
2498
|
setInputValue(value ? toBasicISOString2(value) : "");
|
|
2499
2499
|
}, [value]);
|
|
2500
|
-
return /* @__PURE__ */ jsxs34(FieldGroup, { children: [
|
|
2500
|
+
return /* @__PURE__ */ jsxs34(FieldGroup, { name, children: [
|
|
2501
2501
|
/* @__PURE__ */ jsx115(Label3, { htmlFor: name, children: label }),
|
|
2502
2502
|
/* @__PURE__ */ jsxs34(Popover, { open: isDatePickerOpen, onOpenChange: setIsDatePickerOpen, children: [
|
|
2503
2503
|
/* @__PURE__ */ jsx115(Popover.Trigger, { children: /* @__PURE__ */ jsx115(
|
|
@@ -2546,7 +2546,7 @@ var SetFieldListbox = ({
|
|
|
2546
2546
|
readOnly,
|
|
2547
2547
|
value
|
|
2548
2548
|
}) => {
|
|
2549
|
-
return /* @__PURE__ */ jsxs35(FieldGroup, { children: [
|
|
2549
|
+
return /* @__PURE__ */ jsxs35(FieldGroup, { name, children: [
|
|
2550
2550
|
/* @__PURE__ */ jsxs35(FieldGroup.Row, { children: [
|
|
2551
2551
|
/* @__PURE__ */ jsx116(Label3, { children: label }),
|
|
2552
2552
|
/* @__PURE__ */ jsx116(FieldGroup.Description, { description })
|
|
@@ -2576,12 +2576,13 @@ var SetFieldSelect = ({
|
|
|
2576
2576
|
disabled,
|
|
2577
2577
|
error,
|
|
2578
2578
|
label,
|
|
2579
|
+
name,
|
|
2579
2580
|
onCheckedChange,
|
|
2580
2581
|
options,
|
|
2581
2582
|
readOnly,
|
|
2582
2583
|
value
|
|
2583
2584
|
}) => {
|
|
2584
|
-
return value ? /* @__PURE__ */ jsxs36(FieldGroup, { children: [
|
|
2585
|
+
return value ? /* @__PURE__ */ jsxs36(FieldGroup, { name, children: [
|
|
2585
2586
|
/* @__PURE__ */ jsxs36(FieldGroup.Row, { children: [
|
|
2586
2587
|
/* @__PURE__ */ jsx117(Label3, { children: label }),
|
|
2587
2588
|
/* @__PURE__ */ jsx117(FieldGroup.Description, { description })
|
|
@@ -2646,7 +2647,7 @@ var StringFieldInput = ({
|
|
|
2646
2647
|
setValue,
|
|
2647
2648
|
value
|
|
2648
2649
|
}) => {
|
|
2649
|
-
return /* @__PURE__ */ jsxs37(FieldGroup, { children: [
|
|
2650
|
+
return /* @__PURE__ */ jsxs37(FieldGroup, { name, children: [
|
|
2650
2651
|
/* @__PURE__ */ jsxs37(FieldGroup.Row, { children: [
|
|
2651
2652
|
/* @__PURE__ */ jsx119(Label3, { htmlFor: name, children: label }),
|
|
2652
2653
|
/* @__PURE__ */ jsx119(FieldGroup.Description, { description })
|
|
@@ -2690,7 +2691,7 @@ var StringFieldPassword = ({
|
|
|
2690
2691
|
setStrength(value ? calculateStrength(value) : 0);
|
|
2691
2692
|
}
|
|
2692
2693
|
}, [value]);
|
|
2693
|
-
return /* @__PURE__ */ jsxs38(FieldGroup, { children: [
|
|
2694
|
+
return /* @__PURE__ */ jsxs38(FieldGroup, { name, children: [
|
|
2694
2695
|
/* @__PURE__ */ jsxs38(FieldGroup.Row, { children: [
|
|
2695
2696
|
/* @__PURE__ */ jsx120(Label3, { htmlFor: name, children: label }),
|
|
2696
2697
|
/* @__PURE__ */ jsx120(FieldGroup.Description, { description })
|
|
@@ -2773,7 +2774,7 @@ var BaseRadioField = ({
|
|
|
2773
2774
|
value
|
|
2774
2775
|
}) => {
|
|
2775
2776
|
const optionsCount = Object.keys(options).length;
|
|
2776
|
-
return /* @__PURE__ */ jsxs39(FieldGroup, { children: [
|
|
2777
|
+
return /* @__PURE__ */ jsxs39(FieldGroup, { name, children: [
|
|
2777
2778
|
/* @__PURE__ */ jsxs39(FieldGroup.Row, { children: [
|
|
2778
2779
|
/* @__PURE__ */ jsx121(Label3, { children: label }),
|
|
2779
2780
|
/* @__PURE__ */ jsx121(FieldGroup.Description, { description })
|
|
@@ -2822,7 +2823,7 @@ var StringFieldSelect = ({
|
|
|
2822
2823
|
setValue,
|
|
2823
2824
|
value
|
|
2824
2825
|
}) => {
|
|
2825
|
-
return /* @__PURE__ */ jsxs40(FieldGroup, { children: [
|
|
2826
|
+
return /* @__PURE__ */ jsxs40(FieldGroup, { name, children: [
|
|
2826
2827
|
/* @__PURE__ */ jsxs40(FieldGroup.Row, { children: [
|
|
2827
2828
|
/* @__PURE__ */ jsx123(Label3, { children: label }),
|
|
2828
2829
|
/* @__PURE__ */ jsx123(FieldGroup.Description, { description })
|
|
@@ -2867,7 +2868,7 @@ var StringFieldTextArea = ({
|
|
|
2867
2868
|
setValue,
|
|
2868
2869
|
value
|
|
2869
2870
|
}) => {
|
|
2870
|
-
return /* @__PURE__ */ jsxs41(FieldGroup, { children: [
|
|
2871
|
+
return /* @__PURE__ */ jsxs41(FieldGroup, { name, children: [
|
|
2871
2872
|
/* @__PURE__ */ jsxs41(FieldGroup.Row, { children: [
|
|
2872
2873
|
/* @__PURE__ */ jsx125(Label3, { htmlFor: name, children: label }),
|
|
2873
2874
|
/* @__PURE__ */ jsx125(FieldGroup.Description, { description })
|
|
@@ -3118,6 +3119,7 @@ import { jsx as jsx131, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
|
3118
3119
|
var Form = ({
|
|
3119
3120
|
className,
|
|
3120
3121
|
content,
|
|
3122
|
+
fieldsFooter,
|
|
3121
3123
|
id,
|
|
3122
3124
|
initialValues,
|
|
3123
3125
|
onError,
|
|
@@ -3226,6 +3228,7 @@ var Form = ({
|
|
|
3226
3228
|
values
|
|
3227
3229
|
}
|
|
3228
3230
|
),
|
|
3231
|
+
fieldsFooter,
|
|
3229
3232
|
/* @__PURE__ */ jsxs43("div", { className: "flex w-full gap-3", children: [
|
|
3230
3233
|
/* @__PURE__ */ jsx131(Button, { "aria-label": "Submit", className: "block w-full", disabled: readOnly, type: "submit", variant: "primary", children: submitBtnLabel ?? t("form.submit") }),
|
|
3231
3234
|
resetBtn && /* @__PURE__ */ jsx131(
|
|
@@ -3879,9 +3882,17 @@ var Resizable = Object.assign(ResizableRoot, {
|
|
|
3879
3882
|
// src/components/SearchBar/SearchBar.tsx
|
|
3880
3883
|
import { SearchIcon as SearchIcon2 } from "lucide-react";
|
|
3881
3884
|
import { jsx as jsx160, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
3882
|
-
var SearchBar = ({
|
|
3885
|
+
var SearchBar = ({
|
|
3886
|
+
className,
|
|
3887
|
+
onClick,
|
|
3888
|
+
onValueChange,
|
|
3889
|
+
placeholder,
|
|
3890
|
+
readOnly,
|
|
3891
|
+
value,
|
|
3892
|
+
...props
|
|
3893
|
+
}) => {
|
|
3883
3894
|
const { t } = useTranslation("libui");
|
|
3884
|
-
return /* @__PURE__ */ jsxs54("form", { className: cn("relative", className), children: [
|
|
3895
|
+
return /* @__PURE__ */ jsxs54("form", { className: cn("relative", className), ...props, children: [
|
|
3885
3896
|
/* @__PURE__ */ jsx160(SearchIcon2, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
3886
3897
|
/* @__PURE__ */ jsx160(
|
|
3887
3898
|
Input,
|
|
@@ -4075,13 +4086,13 @@ var SpinnerIcon = ({ className, ...props }) => /* @__PURE__ */ jsx170(
|
|
|
4075
4086
|
import { useEffect as useEffect10 } from "react";
|
|
4076
4087
|
import { motion as motion6, useSpring, useTransform } from "framer-motion";
|
|
4077
4088
|
import { jsx as jsx171, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
4078
|
-
var StatisticCard = ({ className, icon, label, value }) => {
|
|
4089
|
+
var StatisticCard = ({ className, icon, label, value, ...props }) => {
|
|
4079
4090
|
const spring = useSpring(0, { bounce: 0 });
|
|
4080
4091
|
const rounded = useTransform(spring, (latest) => Math.floor(latest));
|
|
4081
4092
|
useEffect10(() => {
|
|
4082
4093
|
spring.set(value);
|
|
4083
4094
|
}, [spring, value]);
|
|
4084
|
-
return /* @__PURE__ */ jsxs56(Card, { className: cn("flex w-full rounded-lg p-4", className), children: [
|
|
4095
|
+
return /* @__PURE__ */ jsxs56(Card, { className: cn("flex w-full rounded-lg p-4", className), ...props, children: [
|
|
4085
4096
|
icon && /* @__PURE__ */ jsx171("div", { className: "mr-2 flex items-center justify-center text-4xl", children: icon }),
|
|
4086
4097
|
/* @__PURE__ */ jsxs56("div", { className: "w-full text-center", children: [
|
|
4087
4098
|
/* @__PURE__ */ jsx171(motion6.h3, { className: "title-font text-2xl font-semibold text-slate-900 dark:text-slate-100 sm:text-3xl", children: rounded }),
|