@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/components/status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/components/status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAa7C,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAkBlC,CAAA"}
|
|
@@ -2,18 +2,29 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { usePanelI18n } from '@owlmeans/client-panel';
|
|
4
4
|
import { ResilientError } from '@owlmeans/error';
|
|
5
|
-
import Alert from '
|
|
6
|
-
const prepareMessage = (msg) => msg.replace(
|
|
5
|
+
import { Alert, AlertDescription } from '@/components/ui/alert';
|
|
6
|
+
const prepareMessage = (msg) => msg.replace(/:/g, '.');
|
|
7
|
+
const variantToAlert = (variant) => {
|
|
8
|
+
if (variant === 'error' || variant === 'destructive')
|
|
9
|
+
return 'destructive';
|
|
10
|
+
if (variant === 'success')
|
|
11
|
+
return 'success';
|
|
12
|
+
return 'default';
|
|
13
|
+
};
|
|
7
14
|
export const Status = ({ ok, name, i18n, children, variant, message, error }) => {
|
|
8
15
|
variant = useMemo(() => variant ?? (ok ? 'success' : 'error'), [ok, variant]);
|
|
9
16
|
const t = usePanelI18n(name ?? variant, i18n);
|
|
10
17
|
message = useMemo(() => {
|
|
11
18
|
const resilient = error != null ? ResilientError.ensure(error) : null;
|
|
12
|
-
return message != null
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
return message != null
|
|
20
|
+
? t(message)
|
|
21
|
+
: resilient != null
|
|
22
|
+
? t([
|
|
23
|
+
`${resilient.type}.${prepareMessage(resilient.message)}`,
|
|
24
|
+
prepareMessage(resilient.message)
|
|
25
|
+
])
|
|
26
|
+
: t(variant);
|
|
16
27
|
}, [message, error?.name, ok, variant]);
|
|
17
|
-
return _jsx(Alert, {
|
|
28
|
+
return _jsx(Alert, { variant: variantToAlert(variant), children: _jsx(AlertDescription, { children: children ?? message }) });
|
|
18
29
|
};
|
|
19
30
|
//# sourceMappingURL=status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/components/status.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/components/status.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE/D,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AAE9D,MAAM,cAAc,GAAG,CAAC,OAAe,EAAyC,EAAE;IAChF,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,aAAa;QAAE,OAAO,aAAa,CAAA;IAC1E,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;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":"text.d.ts","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAO,MAAM,OAAO,CAAA;AACpC,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAA;AAuBxD,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAO9B,CAAA"}
|
package/build/components/text.js
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { usePanelI18n } from '@owlmeans/client-panel';
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
const variantClasses = {
|
|
5
|
+
h1: 'scroll-m-20 text-4xl font-extrabold tracking-tight',
|
|
6
|
+
h2: 'scroll-m-20 text-3xl font-semibold tracking-tight',
|
|
7
|
+
h3: 'scroll-m-20 text-2xl font-semibold tracking-tight',
|
|
8
|
+
h4: 'scroll-m-20 text-xl font-semibold tracking-tight',
|
|
9
|
+
p: 'leading-7',
|
|
10
|
+
lead: 'text-xl text-muted-foreground',
|
|
11
|
+
large: 'text-lg font-semibold',
|
|
12
|
+
small: 'text-sm font-medium leading-none',
|
|
13
|
+
muted: 'text-sm text-muted-foreground',
|
|
14
|
+
blockquote: 'mt-6 border-l-2 pl-6 italic',
|
|
15
|
+
};
|
|
16
|
+
const variantTag = (variant, nested) => {
|
|
17
|
+
if (nested)
|
|
18
|
+
return 'span';
|
|
19
|
+
if (variant === 'h1' || variant === 'h2' || variant === 'h3' || variant === 'h4')
|
|
20
|
+
return variant;
|
|
21
|
+
if (variant === 'blockquote')
|
|
22
|
+
return 'blockquote';
|
|
23
|
+
return 'p';
|
|
24
|
+
};
|
|
25
|
+
export const Text = ({ variant = 'p', name, children, center, className, style, nested = false, i18n }) => {
|
|
5
26
|
const t = usePanelI18n(undefined, i18n);
|
|
6
27
|
const label = name != null ? t(name) : undefined;
|
|
7
|
-
|
|
28
|
+
const Tag = variantTag(variant, nested);
|
|
29
|
+
const cls = cn(variantClasses[variant], center && 'text-center', className);
|
|
30
|
+
return _jsx(Tag, { className: cls, style: style, children: label ?? children });
|
|
8
31
|
};
|
|
9
32
|
//# sourceMappingURL=text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAGrD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,MAAM,cAAc,GAAgC;IAClD,EAAE,EAAE,oDAAoD;IACxD,EAAE,EAAE,mDAAmD;IACvD,EAAE,EAAE,mDAAmD;IACvD,EAAE,EAAE,kDAAkD;IACtD,CAAC,EAAE,WAAW;IACd,IAAI,EAAE,+BAA+B;IACrC,KAAK,EAAE,uBAAuB;IAC9B,KAAK,EAAE,kCAAkC;IACzC,KAAK,EAAE,+BAA+B;IACtC,UAAU,EAAE,6BAA6B;CAC1C,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,OAAoB,EAAE,MAAe,EAA+B,EAAE;IACxF,IAAI,MAAM;QAAE,OAAO,MAAM,CAAA;IACzB,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,OAAO,CAAA;IAChG,IAAI,OAAO,KAAK,YAAY;QAAE,OAAO,YAAY,CAAA;IACjD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAkB,CAAC,EAAE,OAAO,GAAG,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACvH,MAAM,CAAC,GAAG,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;IACvC,MAAM,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAChD,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IACvC,MAAM,GAAG,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,aAAa,EAAE,SAAS,CAAC,CAAA;IAE3E,OAAO,KAAC,GAAG,IAAC,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,YAAG,KAAK,IAAI,QAAQ,GAAO,CAAA;AACrE,CAAC,CAAA"}
|
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
import type { SxProps } from '@mui/material/styles';
|
|
2
1
|
import type { I18nProps } from '@owlmeans/client-i18n';
|
|
3
2
|
import type { BlockScaling } from '@owlmeans/client-panel';
|
|
4
|
-
import type { FC, PropsWithChildren } from 'react';
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import type { CSSProperties, FC, PropsWithChildren } from 'react';
|
|
4
|
+
import type { ClientEntrypoint } from '@owlmeans/client-entrypoint';
|
|
5
|
+
/**
|
|
6
|
+
* Shadcn `Typography`-equivalent text variants. Each value maps to a Tailwind
|
|
7
|
+
* class composition inside `Text` / `Link`. This replaces MUI's
|
|
8
|
+
* `TypographyOwnProps['variant']`.
|
|
9
|
+
*/
|
|
10
|
+
export type TextVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'lead' | 'large' | 'small' | 'muted' | 'blockquote';
|
|
11
|
+
export interface StyledProps {
|
|
12
|
+
/** Tailwind utility classes appended after the component's base classes. */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Raw inline CSS — escape hatch for non-class styling. */
|
|
15
|
+
style?: CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
export interface BlockProps extends PropsWithChildren<I18nProps>, StyledProps {
|
|
8
18
|
horizontal?: BlockScaling;
|
|
9
19
|
vertical?: BlockScaling;
|
|
10
20
|
Actions?: FC;
|
|
11
|
-
styles?: SxProps;
|
|
12
21
|
}
|
|
13
|
-
export interface TextProps extends PropsWithChildren<I18nProps
|
|
22
|
+
export interface TextProps extends PropsWithChildren<I18nProps>, StyledProps {
|
|
14
23
|
name?: string;
|
|
15
|
-
variant?:
|
|
24
|
+
variant?: TextVariant;
|
|
16
25
|
center?: boolean;
|
|
17
|
-
styles?: SxProps;
|
|
18
26
|
nested?: boolean;
|
|
19
27
|
}
|
|
20
28
|
export interface LinkProps extends TextProps {
|
|
21
29
|
src?: string;
|
|
22
|
-
module?: string |
|
|
30
|
+
module?: string | ClientEntrypoint;
|
|
23
31
|
open?: boolean;
|
|
24
32
|
}
|
|
25
33
|
export interface StatusProps extends PropsWithChildren<I18nProps> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACnB,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GACzB,GAAG,GAAG,MAAM,GAA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":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/uploader/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AASpD,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAkBhD,CAAA"}
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ImageUploader as Uploader } from '@owlmeans/web-client';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import { ImagePlus } from 'lucide-react';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
// Tailwind responsive sizes — mirrors the previous MUI breakpoint object.
|
|
6
|
+
// xs: 60/65px md: 120/125px lg: 200/205px
|
|
7
|
+
const wrapperClasses = 'w-[65px] h-[65px] md:w-[125px] md:h-[125px] lg:w-[205px] lg:h-[205px]';
|
|
8
|
+
const previewClasses = 'max-w-[60px] max-h-[60px] md:max-w-[120px] md:max-h-[120px] lg:max-w-[200px] lg:max-h-[200px]';
|
|
9
|
+
const iconClasses = 'size-[60px] md:size-[120px] lg:size-[200px] text-primary';
|
|
6
10
|
export const ImageUploader = ({ Root, rootProps, previewUrl, ...others }) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
height: wrapperSize,
|
|
12
|
-
display: "flex",
|
|
13
|
-
justifyContent: "center",
|
|
14
|
-
alignItems: "center",
|
|
15
|
-
cursor: 'pointer',
|
|
16
|
-
},
|
|
17
|
-
...rootProps
|
|
18
|
-
}, ...others, children: previewUrl != null
|
|
19
|
-
? _jsx(Box, { component: "img", src: previewUrl, sx: { maxWidth: previewSize, maxHeight: previewSize } })
|
|
20
|
-
: _jsx(AddPhotoAlternateOutlinedIcon, { sx: { fontSize: previewSize }, color: "primary" }) });
|
|
11
|
+
const DefaultRoot = ({ children, className, ...rest }) => (_jsx("div", { ...rest, className: cn('flex items-center justify-center rounded-md border bg-card shadow-sm cursor-pointer', wrapperClasses, className), children: children }));
|
|
12
|
+
return _jsx(Uploader, { Root: Root ?? DefaultRoot, rootProps: rootProps, ...others, children: previewUrl != null
|
|
13
|
+
? _jsx("img", { src: previewUrl, className: previewClasses })
|
|
14
|
+
: _jsx(ImagePlus, { className: iconClasses, "aria-hidden": true }) });
|
|
21
15
|
};
|
|
22
|
-
const previewSize = { xs: 60, md: 120, lg: 200 };
|
|
23
|
-
const wrapperSize = { xs: 65, md: 125, lg: 205 };
|
|
24
16
|
//# sourceMappingURL=image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/uploader/image.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/uploader/image.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,0EAA0E;AAC1E,iDAAiD;AACjD,MAAM,cAAc,GAAG,uEAAuE,CAAA;AAC9F,MAAM,cAAc,GAAG,+FAA+F,CAAA;AACtH,MAAM,WAAW,GAAM,0DAA0D,CAAA;AAEjF,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE;IAClG,MAAM,WAAW,GAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CACjE,iBACM,IAAI,EACR,SAAS,EAAE,EAAE,CACX,qFAAqF,EACrF,cAAc,EACd,SAAS,CACV,YACD,QAAQ,GAAO,CAClB,CAAA;IAED,OAAO,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,IAAI,WAAW,EAAE,SAAS,EAAE,SAAS,KAAM,MAAM,YACzE,UAAU,IAAI,IAAI;YACjB,CAAC,CAAC,cAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,GAAI;YACrD,CAAC,CAAC,KAAC,SAAS,IAAC,SAAS,EAAE,WAAW,wBAAgB,GAE5C,CAAA;AACb,CAAC,CAAA"}
|
package/build/exports.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { handler, useNavigate, useValue, useModule } from '@owlmeans/client';
|
|
2
2
|
export { config } from '@owlmeans/client-context';
|
|
3
3
|
export { service } from '@owlmeans/config';
|
|
4
|
-
export { guard, parent } from '@owlmeans/
|
|
4
|
+
export { guard, parent } from '@owlmeans/entrypoint';
|
|
5
5
|
export { addWebService } from '@owlmeans/client-config';
|
|
6
|
-
export {
|
|
7
|
-
export type {
|
|
6
|
+
export { entrypoint, elevate, provideRequest, stab } from '@owlmeans/client-entrypoint';
|
|
7
|
+
export type { ClientEntrypoint as Module } from '@owlmeans/client-entrypoint';
|
|
8
8
|
export { route as croute } from '@owlmeans/client-route';
|
|
9
9
|
export { route, frontend } from '@owlmeans/route';
|
|
10
10
|
export { DEFAULT_ALIAS as DAUTH_GUARD, setupExternalAuthentication } from '@owlmeans/client-auth';
|
package/build/exports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAA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,WAAW,IAAI,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA"}
|
package/build/exports.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { handler, useNavigate, useValue, useModule } from '@owlmeans/client';
|
|
2
2
|
export { config } from '@owlmeans/client-context';
|
|
3
3
|
export { service } from '@owlmeans/config';
|
|
4
|
-
export { guard, parent } from '@owlmeans/
|
|
4
|
+
export { guard, parent } from '@owlmeans/entrypoint';
|
|
5
5
|
export { addWebService } from '@owlmeans/client-config';
|
|
6
|
-
export {
|
|
6
|
+
export { entrypoint, elevate, provideRequest, stab } from '@owlmeans/client-entrypoint';
|
|
7
7
|
export { route as croute } from '@owlmeans/client-route';
|
|
8
8
|
export { route, frontend } from '@owlmeans/route';
|
|
9
9
|
export { DEFAULT_ALIAS as DAUTH_GUARD, setupExternalAuthentication } from '@owlmeans/client-auth';
|
package/build/exports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAEvF,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,aAAa,IAAI,WAAW,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AAEjG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEpE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAG/D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA"}
|
package/build/main.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { RenderOptions } from '@owlmeans/web-client';
|
|
2
2
|
import type { ClientConfig, ClientContext } from '@owlmeans/client-context';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface WebRenderOptions extends RenderOptions {
|
|
4
|
+
rootClassName?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const render: <C extends ClientConfig, T extends ClientContext<C>>(context: T, opts?: WebRenderOptions) => void;
|
|
5
7
|
//# sourceMappingURL=main.d.ts.map
|
package/build/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,sBAAsB,CAAA;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,sBAAsB,CAAA;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAO3E,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,gBAAgB,SAE7G,CAAA"}
|
package/build/main.js
CHANGED
|
@@ -3,12 +3,12 @@ import { render as basicRender, provide } from '@owlmeans/web-client';
|
|
|
3
3
|
import { useI18nInstance } from '@owlmeans/client-i18n/utils';
|
|
4
4
|
import detector from 'i18next-browser-languagedetector';
|
|
5
5
|
import { PanelApp } from './components/panel-app/component.js';
|
|
6
|
-
export const render = (context,
|
|
7
|
-
basicRender(_jsx(App, { context: context,
|
|
6
|
+
export const render = (context, opts) => {
|
|
7
|
+
basicRender(_jsx(App, { context: context, rootClassName: opts?.rootClassName }), opts);
|
|
8
8
|
};
|
|
9
|
-
const App = ({ context,
|
|
9
|
+
const App = ({ context, rootClassName }) => {
|
|
10
10
|
const i18nInstance = useI18nInstance(context.cfg);
|
|
11
11
|
i18nInstance.use(detector);
|
|
12
|
-
return _jsx(PanelApp, { context: context, provide: provide,
|
|
12
|
+
return _jsx(PanelApp, { context: context, provide: provide, rootClassName: rootClassName });
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=main.js.map
|
package/build/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,QAAQ,MAAM,kCAAkC,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,QAAQ,MAAM,kCAAkC,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAA;AAM9D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAqD,OAAU,EAAE,IAAuB,EAAE,EAAE;IAChH,WAAW,CAAC,KAAC,GAAG,IAAC,OAAO,EAAE,OAAgC,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,GAAG,EAAE,IAAI,CAAC,CAAA;AAC1G,CAAC,CAAA;AAED,MAAM,GAAG,GAA6D,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE;IACnG,MAAM,YAAY,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACjD,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAE1B,OAAO,KAAC,QAAQ,IAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,GAAI,CAAA;AACvF,CAAC,CAAA"}
|
package/build/modules.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const modules: (import("@owlmeans/client-
|
|
1
|
+
export declare const modules: (import("@owlmeans/client-entrypoint").ClientEntrypoint<{}, import("@owlmeans/client-entrypoint").ClientRequest<{}>> | import("@owlmeans/entrypoint").CommonEntrypoint)[];
|
|
2
2
|
//# sourceMappingURL=modules.d.ts.map
|
package/build/modules.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,2KAAuB,CAAA"}
|
package/components.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": false,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/@/globals.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"iconLibrary": "lucide",
|
|
14
|
+
"aliases": {
|
|
15
|
+
"components": "@/components",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"utils": "@/lib/utils",
|
|
18
|
+
"lib": "@/lib",
|
|
19
|
+
"hooks": "@/hooks"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/web-panel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"build": "tsc -b",
|
|
7
8
|
"dev": "sleep 384 && nodemon -e ts,tsx,json --watch src --exec \"tsc -p ./tsconfig.json\"",
|
|
8
|
-
"watch": "tsc -b -w --preserveWatchOutput --pretty"
|
|
9
|
+
"watch": "tsc -b -w --preserveWatchOutput --pretty",
|
|
10
|
+
"test": "bun test ./tests"
|
|
9
11
|
},
|
|
10
12
|
"main": "build/index.js",
|
|
11
13
|
"module": "build/index.js",
|
|
@@ -35,53 +37,71 @@
|
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@hookform/resolvers": "^3.9.0",
|
|
38
|
-
"@owlmeans/api-config-client": "^0.1.
|
|
39
|
-
"@owlmeans/auth": "^0.1.
|
|
40
|
-
"@owlmeans/auth-common": "^0.1.
|
|
41
|
-
"@owlmeans/basic-envelope": "^0.1.
|
|
42
|
-
"@owlmeans/client": "^0.1.
|
|
43
|
-
"@owlmeans/client-auth": "^0.1.
|
|
44
|
-
"@owlmeans/client-config": "^0.1.
|
|
45
|
-
"@owlmeans/client-context": "^0.1.
|
|
46
|
-
"@owlmeans/client-flow": "^0.1.
|
|
47
|
-
"@owlmeans/client-i18n": "^0.1.
|
|
48
|
-
"@owlmeans/client-
|
|
49
|
-
"@owlmeans/client-panel": "^0.1.
|
|
50
|
-
"@owlmeans/client-route": "^0.1.
|
|
51
|
-
"@owlmeans/config": "^0.1.
|
|
52
|
-
"@owlmeans/context": "^0.1.
|
|
53
|
-
"@owlmeans/error": "^0.1.
|
|
54
|
-
"@owlmeans/flow": "^0.1.
|
|
55
|
-
"@owlmeans/i18n": "^0.1.
|
|
56
|
-
"@owlmeans/
|
|
57
|
-
"@owlmeans/route": "^0.1.
|
|
58
|
-
"@owlmeans/web-client": "^0.1.
|
|
59
|
-
"@owlmeans/web-db": "^0.1.
|
|
60
|
-
"@owlmeans/web-flow": "^0.1.
|
|
61
|
-
"@owlmeans/web-router": "^0.1.
|
|
40
|
+
"@owlmeans/api-config-client": "^0.1.3",
|
|
41
|
+
"@owlmeans/auth": "^0.1.3",
|
|
42
|
+
"@owlmeans/auth-common": "^0.1.3",
|
|
43
|
+
"@owlmeans/basic-envelope": "^0.1.3",
|
|
44
|
+
"@owlmeans/client": "^0.1.3",
|
|
45
|
+
"@owlmeans/client-auth": "^0.1.3",
|
|
46
|
+
"@owlmeans/client-config": "^0.1.3",
|
|
47
|
+
"@owlmeans/client-context": "^0.1.3",
|
|
48
|
+
"@owlmeans/client-flow": "^0.1.3",
|
|
49
|
+
"@owlmeans/client-i18n": "^0.1.3",
|
|
50
|
+
"@owlmeans/client-entrypoint": "^0.1.3",
|
|
51
|
+
"@owlmeans/client-panel": "^0.1.3",
|
|
52
|
+
"@owlmeans/client-route": "^0.1.3",
|
|
53
|
+
"@owlmeans/config": "^0.1.3",
|
|
54
|
+
"@owlmeans/context": "^0.1.3",
|
|
55
|
+
"@owlmeans/error": "^0.1.3",
|
|
56
|
+
"@owlmeans/flow": "^0.1.3",
|
|
57
|
+
"@owlmeans/i18n": "^0.1.3",
|
|
58
|
+
"@owlmeans/entrypoint": "^0.1.3",
|
|
59
|
+
"@owlmeans/route": "^0.1.3",
|
|
60
|
+
"@owlmeans/web-client": "^0.1.3",
|
|
61
|
+
"@owlmeans/web-db": "^0.1.3",
|
|
62
|
+
"@owlmeans/web-flow": "^0.1.3",
|
|
63
|
+
"@owlmeans/web-router": "^0.1.3",
|
|
62
64
|
"i18next-browser-languagedetector": "^8.0.0",
|
|
63
65
|
"qrcode.react": "^4.2.0",
|
|
64
66
|
"react-google-recaptcha": "^3.1.0"
|
|
65
67
|
},
|
|
66
68
|
"peerDependencies": {
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
69
|
-
"@
|
|
69
|
+
"@radix-ui/react-label": "*",
|
|
70
|
+
"@radix-ui/react-progress": "*",
|
|
71
|
+
"@radix-ui/react-separator": "*",
|
|
72
|
+
"@radix-ui/react-slot": "*",
|
|
70
73
|
"ajv": "*",
|
|
74
|
+
"class-variance-authority": "*",
|
|
75
|
+
"clsx": "*",
|
|
76
|
+
"lucide-react": "*",
|
|
71
77
|
"react": "*",
|
|
72
78
|
"react-dom": "*",
|
|
73
|
-
"react-hook-form": "*"
|
|
79
|
+
"react-hook-form": "*",
|
|
80
|
+
"tailwind-merge": "*",
|
|
81
|
+
"tailwindcss": "*"
|
|
74
82
|
},
|
|
75
83
|
"devDependencies": {
|
|
76
|
-
"@
|
|
77
|
-
"@
|
|
78
|
-
"@
|
|
84
|
+
"@owlmeans/dep-config": "workspace:*",
|
|
85
|
+
"@owlmeans/test-ui": "^0.1.2",
|
|
86
|
+
"@radix-ui/react-label": "^2.1.0",
|
|
87
|
+
"@radix-ui/react-progress": "^1.1.0",
|
|
88
|
+
"@radix-ui/react-separator": "^1.1.0",
|
|
89
|
+
"@radix-ui/react-slot": "^1.1.0",
|
|
90
|
+
"@tailwindcss/vite": "^4.0.0",
|
|
79
91
|
"@types/react": "^19.2.7",
|
|
80
92
|
"@types/react-dom": "^19.2.3",
|
|
81
93
|
"@types/react-google-recaptcha": "^2.1.9",
|
|
94
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
95
|
+
"class-variance-authority": "^0.7.0",
|
|
96
|
+
"clsx": "^2.1.0",
|
|
97
|
+
"lucide-react": "^0.460.0",
|
|
82
98
|
"nodemon": "^3.1.11",
|
|
83
99
|
"npm-check": "^6.0.1",
|
|
84
|
-
"
|
|
100
|
+
"playwright": "^1.49.0",
|
|
101
|
+
"tailwind-merge": "^2.5.0",
|
|
102
|
+
"tailwindcss": "^4.0.0",
|
|
103
|
+
"typescript": "^6.0.2",
|
|
104
|
+
"vite": "^5.4.0"
|
|
85
105
|
},
|
|
86
106
|
"publishConfig": {
|
|
87
107
|
"access": "public"
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// shadcn alert — sourced from shadcn (new-york) 2026-05-23
|
|
2
|
+
// Extended with a `success` variant on top of the default `default` / `destructive`.
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
|
+
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
|
|
8
|
+
const alertVariants = cva(
|
|
9
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: "bg-card text-card-foreground",
|
|
14
|
+
destructive:
|
|
15
|
+
"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
|
|
16
|
+
success:
|
|
17
|
+
"text-success bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-success/90",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
function Alert({
|
|
27
|
+
className,
|
|
28
|
+
variant,
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
|
|
31
|
+
return (
|
|
32
|
+
<div
|
|
33
|
+
data-slot="alert"
|
|
34
|
+
role="alert"
|
|
35
|
+
className={cn(alertVariants({ variant }), className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
data-slot="alert-title"
|
|
45
|
+
className={cn(
|
|
46
|
+
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
47
|
+
className
|
|
48
|
+
)}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function AlertDescription({
|
|
55
|
+
className,
|
|
56
|
+
...props
|
|
57
|
+
}: React.ComponentProps<"div">) {
|
|
58
|
+
return (
|
|
59
|
+
<div
|
|
60
|
+
data-slot="alert-description"
|
|
61
|
+
className={cn(
|
|
62
|
+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
63
|
+
className
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { Alert, AlertTitle, AlertDescription }
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// shadcn button — sourced from shadcn (new-york) 2026-05-23
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
|
+
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
|
|
8
|
+
const buttonVariants = cva(
|
|
9
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default:
|
|
14
|
+
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
15
|
+
destructive:
|
|
16
|
+
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
17
|
+
outline:
|
|
18
|
+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
19
|
+
secondary:
|
|
20
|
+
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
21
|
+
ghost:
|
|
22
|
+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
23
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
27
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
28
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
29
|
+
icon: "size-9",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: "default",
|
|
34
|
+
size: "default",
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
function Button({
|
|
40
|
+
className,
|
|
41
|
+
variant,
|
|
42
|
+
size,
|
|
43
|
+
asChild = false,
|
|
44
|
+
...props
|
|
45
|
+
}: React.ComponentProps<"button"> &
|
|
46
|
+
VariantProps<typeof buttonVariants> & {
|
|
47
|
+
asChild?: boolean
|
|
48
|
+
}) {
|
|
49
|
+
const Comp = asChild ? Slot : "button"
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Comp
|
|
53
|
+
data-slot="button"
|
|
54
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { Button, buttonVariants }
|