@owlmeans/web-panel 0.1.1 → 0.1.3
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/LICENSE +1 -1
- package/README.md +88 -1160
- package/build/@/components/ui/alert.d.ts +10 -0
- package/build/@/components/ui/alert.d.ts.map +1 -0
- package/build/@/components/ui/alert.js +26 -0
- package/build/@/components/ui/alert.js.map +1 -0
- package/build/@/components/ui/button.d.ts +11 -0
- package/build/@/components/ui/button.d.ts.map +1 -0
- package/build/@/components/ui/button.js +32 -0
- package/build/@/components/ui/button.js.map +1 -0
- package/build/@/components/ui/card.d.ts +10 -0
- package/build/@/components/ui/card.d.ts.map +1 -0
- package/build/@/components/ui/card.js +25 -0
- package/build/@/components/ui/card.js.map +1 -0
- package/build/@/components/ui/input.d.ts +4 -0
- package/build/@/components/ui/input.d.ts.map +1 -0
- package/build/@/components/ui/input.js +7 -0
- package/build/@/components/ui/input.js.map +1 -0
- package/build/@/components/ui/label.d.ts +5 -0
- package/build/@/components/ui/label.d.ts.map +1 -0
- package/build/@/components/ui/label.js +8 -0
- package/build/@/components/ui/label.js.map +1 -0
- package/build/@/components/ui/progress.d.ts +5 -0
- package/build/@/components/ui/progress.d.ts.map +1 -0
- package/build/@/components/ui/progress.js +11 -0
- package/build/@/components/ui/progress.js.map +1 -0
- package/build/@/components/ui/separator.d.ts +5 -0
- package/build/@/components/ui/separator.d.ts.map +1 -0
- package/build/@/components/ui/separator.js +8 -0
- package/build/@/components/ui/separator.js.map +1 -0
- package/build/@/lib/utils.d.ts +3 -0
- package/build/@/lib/utils.d.ts.map +1 -0
- package/build/@/lib/utils.js +6 -0
- package/build/@/lib/utils.js.map +1 -0
- package/build/auth/exports.d.ts +4 -4
- package/build/auth/exports.d.ts.map +1 -1
- package/build/auth/exports.js +2 -2
- package/build/auth/exports.js.map +1 -1
- package/build/auth/modules.d.ts +1 -1
- package/build/auth/modules.d.ts.map +1 -1
- package/build/auth/plugins/basic-ed25519.js +2 -2
- package/build/auth/plugins/basic-ed25519.js.map +1 -1
- package/build/auth/plugins/re-captcha.d.ts.map +1 -1
- package/build/auth/plugins/re-captcha.js +4 -12
- package/build/auth/plugins/re-captcha.js.map +1 -1
- package/build/auth/plugins/tunnel-consumer.d.ts.map +1 -1
- package/build/auth/plugins/tunnel-consumer.js +28 -16
- package/build/auth/plugins/tunnel-consumer.js.map +1 -1
- package/build/components/block.d.ts.map +1 -1
- package/build/components/block.js +5 -8
- package/build/components/block.js.map +1 -1
- package/build/components/button/selector.d.ts.map +1 -1
- package/build/components/button/selector.js +1 -2
- package/build/components/button/selector.js.map +1 -1
- package/build/components/form/button/component.d.ts +1 -1
- package/build/components/form/button/component.d.ts.map +1 -1
- package/build/components/form/button/component.js +39 -8
- package/build/components/form/button/component.js.map +1 -1
- package/build/components/form/component.d.ts.map +1 -1
- package/build/components/form/component.js +10 -13
- package/build/components/form/component.js.map +1 -1
- package/build/components/form/text/component.d.ts +1 -1
- package/build/components/form/text/component.d.ts.map +1 -1
- package/build/components/form/text/component.js +23 -24
- package/build/components/form/text/component.js.map +1 -1
- package/build/components/form/types.d.ts +3 -2
- package/build/components/form/types.d.ts.map +1 -1
- package/build/components/helper.d.ts +11 -2
- package/build/components/helper.d.ts.map +1 -1
- package/build/components/helper.js +50 -40
- package/build/components/helper.js.map +1 -1
- package/build/components/layout/component.d.ts.map +1 -1
- package/build/components/layout/component.js +2 -3
- package/build/components/layout/component.js.map +1 -1
- package/build/components/layout/types.d.ts +3 -1
- package/build/components/layout/types.d.ts.map +1 -1
- package/build/components/link.d.ts.map +1 -1
- package/build/components/link.js +6 -4
- package/build/components/link.js.map +1 -1
- package/build/components/panel-app/component.d.ts.map +1 -1
- package/build/components/panel-app/component.js +4 -7
- package/build/components/panel-app/component.js.map +1 -1
- package/build/components/panel-app/types.d.ts +6 -2
- package/build/components/panel-app/types.d.ts.map +1 -1
- package/build/components/status.d.ts.map +1 -1
- package/build/components/status.js +18 -7
- package/build/components/status.js.map +1 -1
- package/build/components/text.d.ts.map +1 -1
- package/build/components/text.js +26 -3
- package/build/components/text.js.map +1 -1
- package/build/components/types.d.ts +18 -10
- package/build/components/types.d.ts.map +1 -1
- package/build/components/uploader/image.d.ts.map +1 -1
- package/build/components/uploader/image.js +11 -19
- package/build/components/uploader/image.js.map +1 -1
- package/build/exports.d.ts +3 -3
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +2 -2
- package/build/exports.js.map +1 -1
- package/build/main.d.ts +4 -2
- package/build/main.d.ts.map +1 -1
- package/build/main.js +4 -4
- package/build/main.js.map +1 -1
- package/build/modules.d.ts +1 -1
- package/build/modules.d.ts.map +1 -1
- package/components.json +21 -0
- package/package.json +54 -34
- package/src/@/components/ui/alert.tsx +70 -0
- package/src/@/components/ui/button.tsx +60 -0
- package/src/@/components/ui/card.tsx +93 -0
- package/src/@/components/ui/input.tsx +22 -0
- package/src/@/components/ui/label.tsx +23 -0
- package/src/@/components/ui/progress.tsx +44 -0
- package/src/@/components/ui/separator.tsx +27 -0
- package/src/@/globals.css +64 -0
- package/src/@/lib/utils.ts +6 -0
- package/src/auth/exports.ts +4 -4
- package/src/auth/plugins/basic-ed25519.tsx +2 -2
- package/src/auth/plugins/re-captcha.tsx +14 -22
- package/src/auth/plugins/tunnel-consumer.tsx +32 -24
- package/src/components/block.tsx +10 -14
- package/src/components/button/selector.tsx +9 -9
- package/src/components/form/button/component.tsx +54 -14
- package/src/components/form/component.tsx +23 -24
- package/src/components/form/text/component.tsx +39 -30
- package/src/components/form/types.ts +4 -3
- package/src/components/helper.ts +56 -42
- package/src/components/layout/component.tsx +2 -3
- package/src/components/layout/types.ts +3 -1
- package/src/components/link.tsx +17 -7
- package/src/components/panel-app/component.tsx +5 -9
- package/src/components/panel-app/types.ts +6 -2
- package/src/components/status.tsx +20 -9
- package/src/components/text.tsx +28 -9
- package/src/components/types.ts +22 -10
- package/src/components/uploader/image.tsx +23 -23
- package/src/exports.ts +3 -3
- package/src/main.tsx +8 -5
- package/tests/smoke.spec.ts +24 -0
- package/tsconfig.json +9 -11
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import ButtonGroup from '@mui/material/ButtonGroup';
|
|
3
2
|
import { Button } from '../form/button/component.js';
|
|
4
3
|
export const ButtonSelector = ({ name, options, current, onSelect }) => {
|
|
5
4
|
const prefix = name != null ? `${name}.` : '';
|
|
6
|
-
return _jsx(
|
|
5
|
+
return (_jsx("div", { className: "inline-flex rounded-md shadow-xs [&>button:not(:first-child)]:rounded-l-none [&>button:not(:last-child)]:rounded-r-none [&>button:not(:last-child)]:border-r-0", children: options.map(option => _jsx(Button, { label: `${prefix}${option}`, onClick: () => onSelect?.(option), variant: current === option ? 'contained' : 'outlined' }, option)) }));
|
|
7
6
|
};
|
|
8
7
|
//# sourceMappingURL=selector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selector.js","sourceRoot":"","sources":["../../../src/components/button/selector.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"selector.js","sourceRoot":"","sources":["../../../src/components/button/selector.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAsB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxF,MAAM,MAAM,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IAC7C,OAAO,CACL,cAAK,SAAS,EAAC,gKAAgK,YAC5K,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CACpB,KAAC,MAAM,IAAc,KAAK,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,EAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,EACjC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,IAF3C,MAAM,CAEyC,CAC7D,GACG,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type { ButtonProps, SubmitProps } from './types';
|
|
2
|
+
import type { ButtonProps, SubmitProps } from './types.js';
|
|
3
3
|
export declare const Button: FC<ButtonProps>;
|
|
4
4
|
export declare const SubmitButton: FC<SubmitProps>;
|
|
5
5
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/components/form/button/component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/components/form/button/component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AA2C1D,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CA8BjC,CAAA;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,WAAW,CAcvC,CAAA"}
|
|
@@ -1,12 +1,45 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { memo } from 'react';
|
|
4
|
-
import MUIButton from '@mui/material/Button';
|
|
5
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
6
4
|
import { useFormContext } from 'react-hook-form';
|
|
5
|
+
import { Loader2 } from 'lucide-react';
|
|
7
6
|
import { useCommonI18n, useI18nApp, useI18nLib } from '@owlmeans/client-i18n';
|
|
8
7
|
import { useContext } from '@owlmeans/client';
|
|
9
8
|
import { useFormI18n, usePanelHelper } from '@owlmeans/client-panel';
|
|
9
|
+
import { Button as UIButton } from '@/components/ui/button';
|
|
10
|
+
import { cn } from '@/lib/utils';
|
|
11
|
+
/**
|
|
12
|
+
* MUI → shadcn variant mapping:
|
|
13
|
+
* contained → default
|
|
14
|
+
* outlined → outline
|
|
15
|
+
* text → ghost
|
|
16
|
+
* Any other value is forwarded as-is (shadcn variants: default, destructive,
|
|
17
|
+
* outline, secondary, ghost, link).
|
|
18
|
+
*/
|
|
19
|
+
const mapVariant = (v) => {
|
|
20
|
+
switch (v) {
|
|
21
|
+
case undefined:
|
|
22
|
+
case 'contained': return 'default';
|
|
23
|
+
case 'outlined': return 'outline';
|
|
24
|
+
case 'text': return 'ghost';
|
|
25
|
+
case 'destructive':
|
|
26
|
+
case 'outline':
|
|
27
|
+
case 'secondary':
|
|
28
|
+
case 'ghost':
|
|
29
|
+
case 'link':
|
|
30
|
+
case 'default':
|
|
31
|
+
return v;
|
|
32
|
+
default: return 'default';
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const mapSize = (s) => {
|
|
36
|
+
switch (s) {
|
|
37
|
+
case 'small': return 'sm';
|
|
38
|
+
case 'large': return 'lg';
|
|
39
|
+
case 'medium':
|
|
40
|
+
default: return 'default';
|
|
41
|
+
}
|
|
42
|
+
};
|
|
10
43
|
export const Button = memo(({ label, onClick, i18n, loader, size, fullWidth, variant = 'contained' }) => {
|
|
11
44
|
const context = useContext();
|
|
12
45
|
const panel = usePanelHelper();
|
|
@@ -16,11 +49,9 @@ export const Button = memo(({ label, onClick, i18n, loader, size, fullWidth, var
|
|
|
16
49
|
label = useMemo(() => i18n?.suppress ? label : t(label, {
|
|
17
50
|
defaultValue: appT(label, { defaultValue: libT(label) })
|
|
18
51
|
}), [i18n?.suppress, label]);
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
: size === 'medium' ? 16 : 14;
|
|
23
|
-
return _jsx(MUIButton, { variant: variant, size: size, fullWidth: fullWidth, startIcon: loader != null && loader.opened === true ? _jsx(CircularProgress, { size: progressSize }) : undefined, disabled: loader != null && loader.opened === true, onClick: onClick, children: label });
|
|
52
|
+
const disabled = loader != null && loader.opened === true;
|
|
53
|
+
const showLoader = disabled;
|
|
54
|
+
return (_jsxs(UIButton, { type: "button", variant: mapVariant(variant), size: mapSize(size), disabled: disabled, onClick: onClick, className: cn(fullWidth && 'w-full'), children: [showLoader && _jsx(Loader2, { className: "animate-spin", "aria-hidden": true }), label] }));
|
|
24
55
|
});
|
|
25
56
|
export const SubmitButton = memo((props) => {
|
|
26
57
|
let { i18n, label } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/components/form/button/component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/components/form/button/component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAa,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MA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CAAC,GAAG,WAAW,EAAE,CAAA;IAEvB,KAAK,GAAG,KAAK,IAAI,QAAQ,CAAA;IACzB,MAAM,KAAK,GAAsB,EAAE,GAAG,IAAI,EAAE,CAAA;IAC5C,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAA;IAErB,OAAO,KAAC,MAAM,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EACpD,OAAO,EAAE,YAAY,CACnB,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA,CAAC,CAAC,CAAC,EAC3E,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,OAAO,CAAC,CACxE,GAAI,CAAA;AACT,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/form/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/form/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAa/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAO9C,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,YAAY,CA+EjC,CAAA"}
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useMemo } from 'react';
|
|
2
|
+
import { Children, useCallback, useMemo } from 'react';
|
|
3
3
|
import { FormProvider, useForm } from 'react-hook-form';
|
|
4
4
|
import { ajvResolver } from '@hookform/resolvers/ajv';
|
|
5
|
-
import Grid from '@mui/material/Grid';
|
|
6
|
-
import Card from '@mui/material/Card';
|
|
7
|
-
import CardContent from '@mui/material/CardContent';
|
|
8
|
-
import CardActions from '@mui/material/CardActions';
|
|
9
5
|
import { FormContext, schemaToFormDefault } from '@owlmeans/client-panel';
|
|
10
6
|
import Ajv from 'ajv';
|
|
11
7
|
import formatsPlugin from 'ajv-formats';
|
|
12
|
-
import { useTheme } from '@mui/material/styles';
|
|
13
8
|
import { SubmitButton } from './button/component.js';
|
|
14
9
|
import { useToggle } from '@owlmeans/client';
|
|
15
10
|
import { scalingToStyles } from '../helper.js';
|
|
16
11
|
import { ResilientError } from '@owlmeans/error';
|
|
17
12
|
import { Status } from '../status.js';
|
|
13
|
+
import { Card, CardContent, CardFooter } from '@/components/ui/card';
|
|
14
|
+
import { cn } from '@/lib/utils';
|
|
18
15
|
const ajv = new Ajv({ coerceTypes: true });
|
|
19
16
|
formatsPlugin(ajv);
|
|
20
17
|
export const Form = (props) => {
|
|
21
|
-
const { defaults, children, formRef, validation, name, horizontal, vertical, decorate, onSubmit, i18n,
|
|
22
|
-
const theme = useTheme();
|
|
18
|
+
const { defaults, children, formRef, validation, name, horizontal, vertical, decorate, onSubmit, i18n, className, style } = props;
|
|
23
19
|
const _defaults = useMemo(() => defaults ?? (validation != null ? schemaToFormDefault(validation) : undefined), [name, defaults != null, validation != null]);
|
|
24
20
|
const loader = useToggle(false);
|
|
25
21
|
const form = useForm({
|
|
@@ -46,13 +42,14 @@ export const Form = (props) => {
|
|
|
46
42
|
if (formRef != null) {
|
|
47
43
|
formRef.current = { form, update, loader, error: setError };
|
|
48
44
|
}
|
|
49
|
-
const
|
|
50
|
-
const content = () => _jsx(
|
|
51
|
-
?
|
|
45
|
+
const scaling = useMemo(() => scalingToStyles(horizontal, vertical), [horizontal, vertical]);
|
|
46
|
+
const content = () => (_jsx("div", { className: cn('flex flex-col items-stretch justify-start gap-4', !decorate && scaling, !decorate && className), style: !decorate ? style : undefined, children: Array.isArray(children)
|
|
47
|
+
? Children.map(children, (child, index) => _jsx("div", { children: child }, index))
|
|
48
|
+
: children }));
|
|
52
49
|
if (decorate === true) {
|
|
53
50
|
const root = form.getFieldState('root');
|
|
54
|
-
return _jsx(FormProvider, { ...form, children: _jsx(FormContext, { ...props, loader: loader, children: _jsxs(Card, {
|
|
55
|
-
_jsx(Status, { ok: false, i18n: i18n, error: ResilientError.ensure(root.error.message) })] }), onSubmit != null
|
|
51
|
+
return _jsx(FormProvider, { ...form, children: _jsx(FormContext, { ...props, loader: loader, children: _jsxs(Card, { className: cn(scaling, 'flex flex-col justify-between', className), style: style, children: [_jsxs(CardContent, { children: [content(), root.invalid && root.error?.message &&
|
|
52
|
+
_jsx("div", { className: "mt-4", children: _jsx(Status, { ok: false, i18n: i18n, error: ResilientError.ensure(root.error.message) }) })] }), onSubmit != null && (_jsx(CardFooter, { className: "flex flex-row justify-end gap-2 pr-4 pb-2", children: _jsx(SubmitButton, { loader: loader, onSubmit: async (data) => onSubmit(data, update) }) }))] }) }) });
|
|
56
53
|
}
|
|
57
54
|
return _jsx(FormProvider, { ...form, children: _jsx(FormContext, { ...props, loader: loader, children: content() }) });
|
|
58
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/form/component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/form/component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAEzE,OAAO,GAAG,MA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IAAI,EAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,GAAI,GACrE,CACd,IACI,GACK,GACD,CAAA;IACjB,CAAC;IAED,OAAO,KAAC,YAAY,OAAK,IAAI,YAC3B,KAAC,WAAW,OAAK,KAAK,EAAE,MAAM,EAAE,MAAM,YAAG,OAAO,EAAE,GAAe,GACpD,CAAA;AACjB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/components/form/text/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/components/form/text/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAKhD,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA8CxC,CAAA"}
|
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useFormError, useFormI18n, useClientFormContext } from '@owlmeans/client-panel';
|
|
4
|
+
import { Input } from '@/components/ui/input';
|
|
5
|
+
import { Label } from '@/components/ui/label';
|
|
6
6
|
export const TextInput = ({ name, label, placeholder, hint, type, def, disableAutocomplete }) => {
|
|
7
7
|
const { control } = useFormContext();
|
|
8
8
|
const t = useFormI18n();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (typeof placeholder === 'boolean' && placeholder)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (typeof hint === '
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
hint = undefined;
|
|
27
|
-
}
|
|
9
|
+
let resolvedLabel;
|
|
10
|
+
let resolvedPlaceholder;
|
|
11
|
+
let resolvedHint;
|
|
12
|
+
if (typeof label === 'boolean' && label)
|
|
13
|
+
resolvedLabel = t(`${name}.label`);
|
|
14
|
+
else if (typeof label === 'string')
|
|
15
|
+
resolvedLabel = label;
|
|
16
|
+
if (typeof placeholder === 'boolean' && placeholder)
|
|
17
|
+
resolvedPlaceholder = t(`${name}.placeholder`);
|
|
18
|
+
else if (typeof placeholder === 'string')
|
|
19
|
+
resolvedPlaceholder = placeholder;
|
|
20
|
+
if (typeof hint === 'boolean' && hint)
|
|
21
|
+
resolvedHint = t(`${name}.hint`);
|
|
22
|
+
else if (typeof hint === 'string')
|
|
23
|
+
resolvedHint = hint;
|
|
28
24
|
return _jsx(Controller, { control: control, name: name, defaultValue: def, render: ({ field, fieldState }) => {
|
|
29
25
|
const error = useFormError(name, fieldState.error);
|
|
30
26
|
const { loader } = useClientFormContext();
|
|
31
|
-
|
|
27
|
+
const disabled = loader != null && loader.opened === true;
|
|
28
|
+
return (_jsxs("div", { className: "flex w-full flex-col gap-1.5", children: [resolvedLabel != null && _jsx(Label, { htmlFor: name, children: resolvedLabel }), _jsx(Input, { id: name, ...field, type: type ?? 'text', placeholder: resolvedPlaceholder, autoComplete: disableAutocomplete ? 'off' : 'on', disabled: disabled, "aria-invalid": fieldState.error != null }), (error != null || resolvedHint != null) && (_jsx("p", { className: error != null
|
|
29
|
+
? 'text-sm text-destructive'
|
|
30
|
+
: 'text-sm text-muted-foreground', children: error ?? resolvedHint }))] }));
|
|
32
31
|
} });
|
|
33
32
|
};
|
|
34
33
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/components/form/text/component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/components/form/text/component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACxF,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAE7C,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,mBAAmB,EAAE,EAAE,EAAE;IAClH,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAA;IACpC,MAAM,CAAC,GAAG,WAAW,EAAE,CAAA;IAEvB,IAAI,aAAiC,CAAA;IACrC,IAAI,mBAAuC,CAAA;IAC3C,IAAI,YAAgC,CAAA;IAEpC,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK;QAAE,aAAa,GAAG,CAAC,CAAC,GAAG,IAAI,QAAQ,CAAC,CAAA;SACtE,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,aAAa,GAAG,KAAK,CAAA;IAEzD,IAAI,OAAO,WAAW,KAAK,SAAS,IAAI,WAAW;QAAE,mBAAmB,GAAG,CAAC,CAAC,GAAG,IAAI,cAAc,CAAC,CAAA;SAC9F,IAAI,OAAO,WAAW,KAAK,QAAQ;QAAE,mBAAmB,GAAG,WAAW,CAAA;IAE3E,IAAI,OAAO,IAAI,KAAK,SAAS,IA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|
2
1
|
import type { FormProps } from '@owlmeans/client-panel';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
3
|
export interface WebFormProps extends FormProps {
|
|
4
|
-
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: CSSProperties;
|
|
5
6
|
}
|
|
6
7
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/form/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/form/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import type { SxProps, Theme } from '@mui/material/styles';
|
|
2
1
|
import { BlockScaling } from '@owlmeans/client-panel';
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Map MUI's previous `scalingToStyles(horizontal, vertical, theme): SxProps`
|
|
4
|
+
* to a Tailwind utility class composition string. Consumers compose this
|
|
5
|
+
* with their own classes via `cn()` or template literals.
|
|
6
|
+
*
|
|
7
|
+
* Breakpoint semantics mirror the old MUI implementation:
|
|
8
|
+
* - Half: capped width/height on >=md, expanded on <md, `flex-grow: 1`
|
|
9
|
+
* - Wide: 10% horizontal/vertical margin, `flex-grow: 1`
|
|
10
|
+
* - Full: fill axis, `flex-grow: 1`
|
|
11
|
+
*/
|
|
12
|
+
export declare const scalingToStyles: (horizontal?: BlockScaling, vertical?: BlockScaling) => string;
|
|
4
13
|
export declare const useBreakPoint: () => string;
|
|
5
14
|
export declare const useMapBreakpoint: <T>(map: Record<string, T>, def?: T, breakpoint?: string) => T;
|
|
6
15
|
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/components/helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/components/helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAC1B,aAAa,YAAY,EACzB,WAAW,YAAY,KACtB,MA4BF,CAAA;AAwBD,eAAO,MAAM,aAAa,QAAO,MAchC,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAE,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,aAAa,MAAM,KAAG,CAQ1F,CAAA"}
|
|
@@ -1,62 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
3
2
|
import { BlockScaling } from '@owlmeans/client-panel';
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Map MUI's previous `scalingToStyles(horizontal, vertical, theme): SxProps`
|
|
5
|
+
* to a Tailwind utility class composition string. Consumers compose this
|
|
6
|
+
* with their own classes via `cn()` or template literals.
|
|
7
|
+
*
|
|
8
|
+
* Breakpoint semantics mirror the old MUI implementation:
|
|
9
|
+
* - Half: capped width/height on >=md, expanded on <md, `flex-grow: 1`
|
|
10
|
+
* - Wide: 10% horizontal/vertical margin, `flex-grow: 1`
|
|
11
|
+
* - Full: fill axis, `flex-grow: 1`
|
|
12
|
+
*/
|
|
13
|
+
export const scalingToStyles = (horizontal, vertical) => {
|
|
14
|
+
const parts = [];
|
|
6
15
|
switch (horizontal) {
|
|
7
16
|
case BlockScaling.Half:
|
|
8
|
-
|
|
9
|
-
maxWidth: '50%',
|
|
10
|
-
[theme?.breakpoints.down('md') ?? 'xs']: {
|
|
11
|
-
maxWidth: '90%'
|
|
12
|
-
},
|
|
13
|
-
flexGrow: 1
|
|
14
|
-
});
|
|
17
|
+
parts.push('max-w-[90%]', 'md:max-w-[50%]', 'grow');
|
|
15
18
|
break;
|
|
16
19
|
case BlockScaling.Wide:
|
|
17
|
-
|
|
20
|
+
parts.push('mx-[10%]', 'grow');
|
|
18
21
|
break;
|
|
19
22
|
case BlockScaling.Full:
|
|
20
|
-
|
|
23
|
+
parts.push('grow');
|
|
21
24
|
break;
|
|
22
25
|
}
|
|
23
26
|
switch (vertical) {
|
|
24
27
|
case BlockScaling.Half:
|
|
25
|
-
|
|
26
|
-
maxHeight: '50%',
|
|
27
|
-
[theme?.breakpoints.down('md') ?? 'xs']: {
|
|
28
|
-
maxHeight: '90%'
|
|
29
|
-
},
|
|
30
|
-
flexGrow: 1
|
|
31
|
-
});
|
|
28
|
+
parts.push('max-h-[90%]', 'md:max-h-[50%]', 'grow');
|
|
32
29
|
break;
|
|
33
30
|
case BlockScaling.Wide:
|
|
34
|
-
|
|
31
|
+
parts.push('my-[10%]', 'grow');
|
|
35
32
|
break;
|
|
36
33
|
case BlockScaling.Full:
|
|
37
|
-
|
|
34
|
+
parts.push('h-full', 'grow');
|
|
38
35
|
break;
|
|
39
36
|
}
|
|
40
|
-
return
|
|
37
|
+
return parts.join(' ');
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Tailwind default breakpoints — kept stable across consumers. If a consumer
|
|
41
|
+
* has customised Tailwind breakpoints in their app config, override this
|
|
42
|
+
* via a wrapping hook in the app.
|
|
43
|
+
*/
|
|
44
|
+
const BREAKPOINTS = [
|
|
45
|
+
{ name: 'xs', min: 0, max: 639 },
|
|
46
|
+
{ name: 'sm', min: 640, max: 767 },
|
|
47
|
+
{ name: 'md', min: 768, max: 1023 },
|
|
48
|
+
{ name: 'lg', min: 1024, max: 1279 },
|
|
49
|
+
{ name: 'xl', min: 1280, max: Number.POSITIVE_INFINITY },
|
|
50
|
+
];
|
|
51
|
+
const matchBreakpoint = (width) => {
|
|
52
|
+
for (const bp of BREAKPOINTS) {
|
|
53
|
+
if (width >= bp.min && width <= bp.max) {
|
|
54
|
+
return bp.name;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return 'xs';
|
|
41
58
|
};
|
|
42
59
|
export const useBreakPoint = () => {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (isMd)
|
|
54
|
-
currentBreakpoint = 'md';
|
|
55
|
-
if (isLg)
|
|
56
|
-
currentBreakpoint = 'lg';
|
|
57
|
-
if (isXl)
|
|
58
|
-
currentBreakpoint = 'xl';
|
|
59
|
-
return currentBreakpoint;
|
|
60
|
+
const [bp, setBp] = useState(() => typeof window === 'undefined' ? 'lg' : matchBreakpoint(window.innerWidth));
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (typeof window === 'undefined')
|
|
63
|
+
return;
|
|
64
|
+
const onResize = () => setBp(matchBreakpoint(window.innerWidth));
|
|
65
|
+
onResize();
|
|
66
|
+
window.addEventListener('resize', onResize);
|
|
67
|
+
return () => window.removeEventListener('resize', onResize);
|
|
68
|
+
}, []);
|
|
69
|
+
return bp;
|
|
60
70
|
};
|
|
61
71
|
export const useMapBreakpoint = (map, def, breakpoint) => {
|
|
62
72
|
const _breakpoint = useBreakPoint();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/components/helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/components/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAA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AAI,GAAsB,EAAE,GAAO,EAAE,UAAmB,EAAK,EAAE;IAC7F,MAAM,WAAW,GAAG,aAAa,EAAE,CAAA;IACnC,UAAU,GAAG,UAAU,IAAI,WAAW,CAAA;IACtC,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,IAAI,GAAG,CAAA;IACrC,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,WAAW,CAAC,kDAAkD,UAAU,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;IACzI,CAAC;IACD,OAAO,MAAW,CAAA;AACpB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/layout/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/layout/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAElC,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return _jsx(Box, { children: children });
|
|
2
|
+
export const Layout = ({ children, className, style }) => {
|
|
3
|
+
return _jsx("div", { className: className, style: style, children: children });
|
|
5
4
|
};
|
|
6
5
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/layout/component.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/layout/component.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;IACxE,OAAO,cAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAO,CAAA;AAClE,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/layout/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/layout/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE7D,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAM3C,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAmC9B,CAAA"}
|
package/build/components/link.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { usePanelI18n } from '@owlmeans/client-panel';
|
|
3
|
-
import MUILink from '@mui/material/Link';
|
|
4
3
|
import { useValue } from '@owlmeans/client';
|
|
5
4
|
import { useContext } from '@owlmeans/web-client';
|
|
6
|
-
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
|
+
export const Link = ({ src, module, name, children, center, open, className, style }) => {
|
|
7
7
|
const t = usePanelI18n();
|
|
8
8
|
const context = useContext();
|
|
9
9
|
const href = useValue(async () => {
|
|
@@ -20,8 +20,10 @@ export const Link = ({ src, module, name, variant, children, center, open, style
|
|
|
20
20
|
const label = name != null
|
|
21
21
|
? t(name)
|
|
22
22
|
: children != null || module == null
|
|
23
|
-
? undefined
|
|
23
|
+
? undefined
|
|
24
|
+
: t(`modules.${typeof module === 'string' ? module : module.alias}`);
|
|
24
25
|
const target = open ? '_blank' : undefined;
|
|
25
|
-
|
|
26
|
+
const rel = open ? 'noopener noreferrer' : undefined;
|
|
27
|
+
return _jsx("a", { href: href ?? undefined, target: target, rel: rel, className: cn('text-primary underline-offset-4 hover:underline', center && 'text-center', className), style: style, children: label ?? children });
|
|
26
28
|
};
|
|
27
29
|
//# sourceMappingURL=link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAGrD,OAAO,
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAGrD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC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L,IAAI,EAAE,IAAI,IAAI,SAAS,EACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,iDAAiD,EACjD,MAAM,IAAI,aAAa,EACvB,SAAS,CACV,EACD,KAAK,EAAE,KAAK,YACZ,KAAK,IAAI,QAAQ,GAAK,CAAA;AAC1B,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/panel-app/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/panel-app/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAM/C,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAQtC,CAAA"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { useMemo } from 'react';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { App } from '@owlmeans/client';
|
|
4
3
|
import { I18nContext } from '@owlmeans/client-i18n';
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
theme = useMemo(() => theme ?? createTheme(), [theme]);
|
|
9
|
-
return _jsx(ThemeProvider, { theme: theme, children: _jsx(I18nContext, { config: context.cfg, children: _jsxs(App, { context: context, provide: provide, children: [_jsx(CssBaseline, {}), children] }) }) });
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
export const PanelApp = ({ context, provide, children, rootClassName }) => {
|
|
6
|
+
return _jsx("div", { className: cn('min-h-screen bg-background text-foreground', rootClassName), children: _jsx(I18nContext, { config: context.cfg, children: _jsx(App, { context: context, provide: provide, children: children }) }) });
|
|
10
7
|
};
|
|
11
8
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/panel-app/component.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/panel-app/component.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,MAAM,CAAC,MAAM,QAAQ,GAAsB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,EAAE;IAC3F,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,aAAa,CAAC,YACpF,KAAC,WAAW,IAAC,MAAM,EAAE,OAAO,CAAC,GAAG,YAC9B,KAAC,GAAG,IAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,YACpC,QAAQ,GACL,GACM,GACV,CAAA;AACR,CAAC,CAAA"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type { Theme } from '@mui/material/styles';
|
|
2
1
|
import type { AppProps } from '@owlmeans/client';
|
|
3
2
|
export interface PanelAppProps extends AppProps {
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Optional CSS class added to the outermost wrapper. Use to scope
|
|
5
|
+
* Tailwind theme overrides (e.g. `'dark'` or a custom theme class).
|
|
6
|
+
* Replaces the legacy MUI `theme?: Theme` prop.
|
|
7
|
+
*/
|
|
8
|
+
rootClassName?: string;
|
|
5
9
|
}
|
|
6
10
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/panel-app/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/panel-app/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEhD,MAAM,WAAW,aAAc,SAAQ,QAAQ;IAC7C;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB"}
|