@xfilecom/front-core 0.1.0 → 0.2.5

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.
Files changed (49) hide show
  1. package/dist/base.css +518 -0
  2. package/dist/components/Badge.d.ts +6 -0
  3. package/dist/components/Badge.js +8 -0
  4. package/dist/components/Box.d.ts +6 -0
  5. package/dist/components/Box.js +9 -0
  6. package/dist/components/Button.d.ts +5 -0
  7. package/dist/components/Button.js +8 -0
  8. package/dist/components/Card.d.ts +5 -0
  9. package/dist/components/Card.js +8 -0
  10. package/dist/components/InlineErrorList.d.ts +12 -0
  11. package/dist/components/InlineErrorList.js +11 -0
  12. package/dist/components/Input.d.ts +3 -0
  13. package/dist/components/Input.js +9 -0
  14. package/dist/components/LoadingOverlay.d.ts +8 -0
  15. package/dist/components/LoadingOverlay.js +11 -0
  16. package/dist/components/Stack.d.ts +8 -0
  17. package/dist/components/Stack.js +16 -0
  18. package/dist/components/Text.d.ts +22 -0
  19. package/dist/components/Text.js +20 -0
  20. package/dist/components/Toast.d.ts +25 -0
  21. package/dist/components/Toast.js +42 -0
  22. package/dist/components/atoms/Badge.d.ts +6 -0
  23. package/dist/components/atoms/Badge.js +8 -0
  24. package/dist/components/atoms/Box.d.ts +6 -0
  25. package/dist/components/atoms/Box.js +9 -0
  26. package/dist/components/atoms/Button.d.ts +5 -0
  27. package/dist/components/atoms/Button.js +8 -0
  28. package/dist/components/atoms/Card.d.ts +5 -0
  29. package/dist/components/atoms/Card.js +8 -0
  30. package/dist/components/atoms/InlineErrorList.d.ts +12 -0
  31. package/dist/components/atoms/InlineErrorList.js +11 -0
  32. package/dist/components/atoms/Input.d.ts +3 -0
  33. package/dist/components/atoms/Input.js +9 -0
  34. package/dist/components/atoms/LoadingOverlay.d.ts +8 -0
  35. package/dist/components/atoms/LoadingOverlay.js +11 -0
  36. package/dist/components/atoms/Stack.d.ts +8 -0
  37. package/dist/components/atoms/Stack.js +16 -0
  38. package/dist/components/atoms/Text.d.ts +22 -0
  39. package/dist/components/atoms/Text.js +20 -0
  40. package/dist/components/atoms/Toast.d.ts +25 -0
  41. package/dist/components/atoms/Toast.js +42 -0
  42. package/dist/components/atoms/index.d.ts +14 -0
  43. package/dist/components/atoms/index.js +29 -0
  44. package/dist/components/index.d.ts +1 -0
  45. package/dist/components/index.js +17 -0
  46. package/dist/index.d.ts +37 -3
  47. package/dist/index.js +50 -4
  48. package/dist/tokens.css +80 -4
  49. package/package.json +18 -7
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Text = Text;
4
+ const react_1 = require("react");
5
+ const variantClass = {
6
+ title: 'xfc-text xfc-text--title',
7
+ appbar: 'xfc-text xfc-text--appbar',
8
+ section: 'xfc-text xfc-text--section',
9
+ subtitle: 'xfc-text xfc-text--subtitle',
10
+ body: 'xfc-text xfc-text--body',
11
+ muted: 'xfc-text xfc-text--body xfc-text--muted',
12
+ small: 'xfc-text xfc-text--small',
13
+ label: 'xfc-text xfc-text--small xfc-text--muted',
14
+ labelBlock: 'xfc-text xfc-text--label-block',
15
+ accent: 'xfc-text xfc-text--body xfc-text--accent',
16
+ };
17
+ function Text({ as = 'p', variant = 'body', className = '', children, ...rest }) {
18
+ const cls = [variantClass[variant], className].filter(Boolean).join(' ');
19
+ return (0, react_1.createElement)(as, { className: cls, ...rest }, children);
20
+ }
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from 'react';
2
+ export type ToastSeverity = 'info' | 'success' | 'warn' | 'error';
3
+ export declare function ToastSeverityIcon({ severity }: {
4
+ severity: ToastSeverity;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export type ToastProps = {
7
+ severity: ToastSeverity;
8
+ message: ReactNode;
9
+ onDismiss?: () => void;
10
+ className?: string;
11
+ };
12
+ /** 단일 토스트 행 (목록·커스텀 레이아웃용). */
13
+ export declare function Toast({ severity, message, onDismiss, className }: ToastProps): import("react/jsx-runtime").JSX.Element;
14
+ export type ToastEntry = {
15
+ id: string;
16
+ severity: ToastSeverity;
17
+ message: ReactNode;
18
+ };
19
+ export type ToastListProps = {
20
+ toasts: ToastEntry[];
21
+ onDismiss: (id: string) => void;
22
+ className?: string;
23
+ };
24
+ /** 하단 고정 토스트 스택 (business-promotion `ToastList` UI, 상태는 부모에서 주입). */
25
+ export declare function ToastList({ toasts, onDismiss, className }: ToastListProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToastSeverityIcon = ToastSeverityIcon;
4
+ exports.Toast = Toast;
5
+ exports.ToastList = ToastList;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const iconSvgProps = {
8
+ width: 20,
9
+ height: 20,
10
+ viewBox: '0 0 20 20',
11
+ fill: 'none',
12
+ xmlns: 'http://www.w3.org/2000/svg',
13
+ 'aria-hidden': true,
14
+ };
15
+ function ToastSeverityIcon({ severity }) {
16
+ switch (severity) {
17
+ case 'success':
18
+ return ((0, jsx_runtime_1.jsxs)("svg", { ...iconSvgProps, children: [(0, jsx_runtime_1.jsx)("path", { d: "M10 18.5a8.5 8.5 0 100-17 8.5 8.5 0 000 17z", stroke: "currentColor", strokeWidth: "1.33" }), (0, jsx_runtime_1.jsx)("path", { d: "M6.2 10.1l2.4 2.4 5.2-5.2", stroke: "currentColor", strokeWidth: "1.33", strokeLinecap: "round", strokeLinejoin: "round" })] }));
19
+ case 'error':
20
+ return ((0, jsx_runtime_1.jsxs)("svg", { ...iconSvgProps, children: [(0, jsx_runtime_1.jsx)("path", { d: "M10 18.5a8.5 8.5 0 100-17 8.5 8.5 0 000 17z", stroke: "currentColor", strokeWidth: "1.33" }), (0, jsx_runtime_1.jsx)("path", { d: "M10 6.2v5.2M10 13.7v.1", stroke: "currentColor", strokeWidth: "1.33", strokeLinecap: "round" })] }));
21
+ case 'warn':
22
+ return ((0, jsx_runtime_1.jsxs)("svg", { ...iconSvgProps, children: [(0, jsx_runtime_1.jsx)("path", { d: "M10 3.2L17.3 16H2.7L10 3.2z", stroke: "currentColor", strokeWidth: "1.33", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M10 8v3.2M10 13.5v.1", stroke: "currentColor", strokeWidth: "1.33", strokeLinecap: "round" })] }));
23
+ case 'info':
24
+ default:
25
+ return ((0, jsx_runtime_1.jsxs)("svg", { ...iconSvgProps, children: [(0, jsx_runtime_1.jsx)("path", { d: "M10 18.5a8.5 8.5 0 100-17 8.5 8.5 0 000 17z", stroke: "currentColor", strokeWidth: "1.33" }), (0, jsx_runtime_1.jsx)("path", { d: "M10 8.8V14M10 5.8v.1", stroke: "currentColor", strokeWidth: "1.33", strokeLinecap: "round" })] }));
26
+ }
27
+ }
28
+ function ToastCloseIcon() {
29
+ return ((0, jsx_runtime_1.jsx)("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": true, children: (0, jsx_runtime_1.jsx)("path", { d: "M5 5l10 10M15 5L5 15", stroke: "currentColor", strokeWidth: "1.33", strokeLinecap: "round" }) }));
30
+ }
31
+ /** 단일 토스트 행 (목록·커스텀 레이아웃용). */
32
+ function Toast({ severity, message, onDismiss, className = '' }) {
33
+ const root = ['xfc-toast', `xfc-toast--${severity}`, className].filter(Boolean).join(' ');
34
+ return ((0, jsx_runtime_1.jsxs)("div", { className: root, role: "alert", children: [(0, jsx_runtime_1.jsx)("span", { className: "xfc-toast__icon", children: (0, jsx_runtime_1.jsx)(ToastSeverityIcon, { severity: severity }) }), (0, jsx_runtime_1.jsx)("div", { className: "xfc-toast__message", children: message }), onDismiss ? ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "xfc-toast-dismiss", onClick: onDismiss, "aria-label": "\uB2EB\uAE30", children: (0, jsx_runtime_1.jsx)(ToastCloseIcon, {}) })) : null] }));
35
+ }
36
+ /** 하단 고정 토스트 스택 (business-promotion `ToastList` UI, 상태는 부모에서 주입). */
37
+ function ToastList({ toasts, onDismiss, className = '' }) {
38
+ if (!toasts.length)
39
+ return null;
40
+ const listCls = ['xfc-toast-list', className].filter(Boolean).join(' ');
41
+ return ((0, jsx_runtime_1.jsx)("div", { className: listCls, "aria-live": "polite", children: toasts.map((t) => ((0, jsx_runtime_1.jsx)(Toast, { severity: t.severity, message: t.message, onDismiss: () => onDismiss(t.id) }, t.id))) }));
42
+ }
@@ -0,0 +1,6 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export type BadgeProps = HTMLAttributes<HTMLSpanElement> & {
3
+ tone?: 'neutral' | 'accent' | 'success' | 'danger';
4
+ children?: ReactNode;
5
+ };
6
+ export declare function Badge({ tone, className, children, ...rest }: BadgeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Badge = Badge;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function Badge({ tone = 'neutral', className = '', children, ...rest }) {
6
+ const cls = ['xfc-badge', `xfc-badge--${tone}`, className].filter(Boolean).join(' ');
7
+ return ((0, jsx_runtime_1.jsx)("span", { className: cls, ...rest, children: children }));
8
+ }
@@ -0,0 +1,6 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export type BoxProps = HTMLAttributes<HTMLDivElement> & {
3
+ padding?: 'none' | 'sm' | 'md' | 'lg';
4
+ children?: ReactNode;
5
+ };
6
+ export declare function Box({ padding, className, children, ...rest }: BoxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Box = Box;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function Box({ padding = 'none', className = '', children, ...rest }) {
6
+ const padClass = padding === 'none' ? '' : padding === 'sm' ? 'xfc-box--p-sm' : padding === 'md' ? 'xfc-box--p-md' : 'xfc-box--p-lg';
7
+ const cls = ['xfc-box', padClass, className].filter(Boolean).join(' ');
8
+ return ((0, jsx_runtime_1.jsx)("div", { className: cls, ...rest, children: children }));
9
+ }
@@ -0,0 +1,5 @@
1
+ import type { ButtonHTMLAttributes } from 'react';
2
+ export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
3
+ variant?: 'primary' | 'secondary' | 'outline' | 'muted' | 'ghost';
4
+ };
5
+ export declare function Button({ variant, className, type, ...rest }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Button = Button;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function Button({ variant = 'primary', className = '', type = 'button', ...rest }) {
6
+ const cls = ['xfc-btn', `xfc-btn--${variant}`, className].filter(Boolean).join(' ');
7
+ return (0, jsx_runtime_1.jsx)("button", { type: type, className: cls, ...rest });
8
+ }
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export type CardProps = HTMLAttributes<HTMLDivElement> & {
3
+ children?: ReactNode;
4
+ };
5
+ export declare function Card({ className, children, ...rest }: CardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Card = Card;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function Card({ className = '', children, ...rest }) {
6
+ const cls = ['xfc-card', className].filter(Boolean).join(' ');
7
+ return ((0, jsx_runtime_1.jsx)("div", { className: cls, ...rest, children: children }));
8
+ }
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+ export type InlineErrorEntry = {
3
+ id: string;
4
+ message: ReactNode;
5
+ };
6
+ export type InlineErrorListProps = {
7
+ errors: InlineErrorEntry[];
8
+ onDismiss: (id: string) => void;
9
+ className?: string;
10
+ };
11
+ /** 상단 고정 에러 배너 목록 (business-promotion `ErrorList` UI, MobX 없음). */
12
+ export declare function InlineErrorList({ errors, onDismiss, className }: InlineErrorListProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InlineErrorList = InlineErrorList;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ /** 상단 고정 에러 배너 목록 (business-promotion `ErrorList` UI, MobX 없음). */
6
+ function InlineErrorList({ errors, onDismiss, className = '' }) {
7
+ if (!errors.length)
8
+ return null;
9
+ const listCls = ['xfc-inline-error-list', className].filter(Boolean).join(' ');
10
+ return ((0, jsx_runtime_1.jsx)("div", { className: listCls, "aria-live": "assertive", role: "alert", children: errors.map((e) => ((0, jsx_runtime_1.jsxs)("div", { className: "xfc-inline-error-item", children: [(0, jsx_runtime_1.jsx)("span", { children: e.message }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "xfc-inline-error-dismiss", onClick: () => onDismiss(e.id), "aria-label": "\uB2EB\uAE30", children: "\u00D7" })] }, e.id))) }));
11
+ }
@@ -0,0 +1,3 @@
1
+ import { type InputHTMLAttributes } from 'react';
2
+ export type InputProps = InputHTMLAttributes<HTMLInputElement>;
3
+ export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Input = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ exports.Input = (0, react_1.forwardRef)(function Input({ className = '', ...rest }, ref) {
7
+ const cls = ['xfc-input', className].filter(Boolean).join(' ');
8
+ return (0, jsx_runtime_1.jsx)("input", { ref: ref, className: cls, ...rest });
9
+ });
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ export type LoadingOverlayProps = {
3
+ active: boolean;
4
+ message?: ReactNode;
5
+ className?: string;
6
+ };
7
+ /** 전역 로딩 오버레이 (business-promotion `GlobalIndicator` UI, 상태는 부모에서 주입). */
8
+ export declare function LoadingOverlay({ active, message, className }: LoadingOverlayProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoadingOverlay = LoadingOverlay;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ /** 전역 로딩 오버레이 (business-promotion `GlobalIndicator` UI, 상태는 부모에서 주입). */
6
+ function LoadingOverlay({ active, message, className = '' }) {
7
+ if (!active)
8
+ return null;
9
+ const root = ['xfc-loading-overlay', className].filter(Boolean).join(' ');
10
+ return ((0, jsx_runtime_1.jsxs)("div", { className: root, role: "status", "aria-live": "polite", "aria-busy": "true", children: [(0, jsx_runtime_1.jsx)("span", { className: "xfc-loading-overlay-spinner", "aria-hidden": true }), message ? (0, jsx_runtime_1.jsx)("p", { className: "xfc-loading-overlay-message", children: message }) : null] }));
11
+ }
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export type StackProps = HTMLAttributes<HTMLDivElement> & {
3
+ direction?: 'row' | 'column';
4
+ gap?: 'none' | 'sm' | 'md' | 'lg';
5
+ align?: 'start' | 'center' | 'stretch';
6
+ children?: ReactNode;
7
+ };
8
+ export declare function Stack({ direction, gap, align, className, children, ...rest }: StackProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Stack = Stack;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function Stack({ direction = 'column', gap = 'md', align = 'start', className = '', children, ...rest }) {
6
+ const cls = [
7
+ 'xfc-stack',
8
+ direction === 'column' ? 'xfc-stack--column' : 'xfc-stack--row',
9
+ `xfc-stack--gap-${gap}`,
10
+ `xfc-stack--align-${align}`,
11
+ className,
12
+ ]
13
+ .filter(Boolean)
14
+ .join(' ');
15
+ return ((0, jsx_runtime_1.jsx)("div", { className: cls, ...rest, children: children }));
16
+ }
@@ -0,0 +1,22 @@
1
+ import { type ElementType, type HTMLAttributes, type ReactNode } from 'react';
2
+ declare const variantClass: {
3
+ readonly title: "xfc-text xfc-text--title";
4
+ readonly appbar: "xfc-text xfc-text--appbar";
5
+ readonly section: "xfc-text xfc-text--section";
6
+ readonly subtitle: "xfc-text xfc-text--subtitle";
7
+ readonly body: "xfc-text xfc-text--body";
8
+ readonly muted: "xfc-text xfc-text--body xfc-text--muted";
9
+ readonly small: "xfc-text xfc-text--small";
10
+ readonly label: "xfc-text xfc-text--small xfc-text--muted";
11
+ readonly labelBlock: "xfc-text xfc-text--label-block";
12
+ readonly accent: "xfc-text xfc-text--body xfc-text--accent";
13
+ };
14
+ export type TextVariant = keyof typeof variantClass;
15
+ export type TextProps = {
16
+ as?: ElementType;
17
+ variant?: TextVariant;
18
+ children?: ReactNode;
19
+ className?: string;
20
+ } & HTMLAttributes<HTMLElement>;
21
+ export declare function Text({ as, variant, className, children, ...rest }: TextProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
22
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Text = Text;
4
+ const react_1 = require("react");
5
+ const variantClass = {
6
+ title: 'xfc-text xfc-text--title',
7
+ appbar: 'xfc-text xfc-text--appbar',
8
+ section: 'xfc-text xfc-text--section',
9
+ subtitle: 'xfc-text xfc-text--subtitle',
10
+ body: 'xfc-text xfc-text--body',
11
+ muted: 'xfc-text xfc-text--body xfc-text--muted',
12
+ small: 'xfc-text xfc-text--small',
13
+ label: 'xfc-text xfc-text--small xfc-text--muted',
14
+ labelBlock: 'xfc-text xfc-text--label-block',
15
+ accent: 'xfc-text xfc-text--body xfc-text--accent',
16
+ };
17
+ function Text({ as = 'p', variant = 'body', className = '', children, ...rest }) {
18
+ const cls = [variantClass[variant], className].filter(Boolean).join(' ');
19
+ return (0, react_1.createElement)(as, { className: cls, ...rest }, children);
20
+ }
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from 'react';
2
+ export type ToastSeverity = 'info' | 'success' | 'warn' | 'error';
3
+ export declare function ToastSeverityIcon({ severity }: {
4
+ severity: ToastSeverity;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export type ToastProps = {
7
+ severity: ToastSeverity;
8
+ message: ReactNode;
9
+ onDismiss?: () => void;
10
+ className?: string;
11
+ };
12
+ /** 단일 토스트 행 (목록·커스텀 레이아웃용). */
13
+ export declare function Toast({ severity, message, onDismiss, className }: ToastProps): import("react/jsx-runtime").JSX.Element;
14
+ export type ToastEntry = {
15
+ id: string;
16
+ severity: ToastSeverity;
17
+ message: ReactNode;
18
+ };
19
+ export type ToastListProps = {
20
+ toasts: ToastEntry[];
21
+ onDismiss: (id: string) => void;
22
+ className?: string;
23
+ };
24
+ /** 하단 고정 토스트 스택 (business-promotion `ToastList` UI, 상태는 부모에서 주입). */
25
+ export declare function ToastList({ toasts, onDismiss, className }: ToastListProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToastSeverityIcon = ToastSeverityIcon;
4
+ exports.Toast = Toast;
5
+ exports.ToastList = ToastList;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const iconSvgProps = {
8
+ width: 20,
9
+ height: 20,
10
+ viewBox: '0 0 20 20',
11
+ fill: 'none',
12
+ xmlns: 'http://www.w3.org/2000/svg',
13
+ 'aria-hidden': true,
14
+ };
15
+ function ToastSeverityIcon({ severity }) {
16
+ switch (severity) {
17
+ case 'success':
18
+ return ((0, jsx_runtime_1.jsxs)("svg", { ...iconSvgProps, children: [(0, jsx_runtime_1.jsx)("path", { d: "M10 18.5a8.5 8.5 0 100-17 8.5 8.5 0 000 17z", stroke: "currentColor", strokeWidth: "1.33" }), (0, jsx_runtime_1.jsx)("path", { d: "M6.2 10.1l2.4 2.4 5.2-5.2", stroke: "currentColor", strokeWidth: "1.33", strokeLinecap: "round", strokeLinejoin: "round" })] }));
19
+ case 'error':
20
+ return ((0, jsx_runtime_1.jsxs)("svg", { ...iconSvgProps, children: [(0, jsx_runtime_1.jsx)("path", { d: "M10 18.5a8.5 8.5 0 100-17 8.5 8.5 0 000 17z", stroke: "currentColor", strokeWidth: "1.33" }), (0, jsx_runtime_1.jsx)("path", { d: "M10 6.2v5.2M10 13.7v.1", stroke: "currentColor", strokeWidth: "1.33", strokeLinecap: "round" })] }));
21
+ case 'warn':
22
+ return ((0, jsx_runtime_1.jsxs)("svg", { ...iconSvgProps, children: [(0, jsx_runtime_1.jsx)("path", { d: "M10 3.2L17.3 16H2.7L10 3.2z", stroke: "currentColor", strokeWidth: "1.33", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M10 8v3.2M10 13.5v.1", stroke: "currentColor", strokeWidth: "1.33", strokeLinecap: "round" })] }));
23
+ case 'info':
24
+ default:
25
+ return ((0, jsx_runtime_1.jsxs)("svg", { ...iconSvgProps, children: [(0, jsx_runtime_1.jsx)("path", { d: "M10 18.5a8.5 8.5 0 100-17 8.5 8.5 0 000 17z", stroke: "currentColor", strokeWidth: "1.33" }), (0, jsx_runtime_1.jsx)("path", { d: "M10 8.8V14M10 5.8v.1", stroke: "currentColor", strokeWidth: "1.33", strokeLinecap: "round" })] }));
26
+ }
27
+ }
28
+ function ToastCloseIcon() {
29
+ return ((0, jsx_runtime_1.jsx)("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": true, children: (0, jsx_runtime_1.jsx)("path", { d: "M5 5l10 10M15 5L5 15", stroke: "currentColor", strokeWidth: "1.33", strokeLinecap: "round" }) }));
30
+ }
31
+ /** 단일 토스트 행 (목록·커스텀 레이아웃용). */
32
+ function Toast({ severity, message, onDismiss, className = '' }) {
33
+ const root = ['xfc-toast', `xfc-toast--${severity}`, className].filter(Boolean).join(' ');
34
+ return ((0, jsx_runtime_1.jsxs)("div", { className: root, role: "alert", children: [(0, jsx_runtime_1.jsx)("span", { className: "xfc-toast__icon", children: (0, jsx_runtime_1.jsx)(ToastSeverityIcon, { severity: severity }) }), (0, jsx_runtime_1.jsx)("div", { className: "xfc-toast__message", children: message }), onDismiss ? ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "xfc-toast-dismiss", onClick: onDismiss, "aria-label": "\uB2EB\uAE30", children: (0, jsx_runtime_1.jsx)(ToastCloseIcon, {}) })) : null] }));
35
+ }
36
+ /** 하단 고정 토스트 스택 (business-promotion `ToastList` UI, 상태는 부모에서 주입). */
37
+ function ToastList({ toasts, onDismiss, className = '' }) {
38
+ if (!toasts.length)
39
+ return null;
40
+ const listCls = ['xfc-toast-list', className].filter(Boolean).join(' ');
41
+ return ((0, jsx_runtime_1.jsx)("div", { className: listCls, "aria-live": "polite", children: toasts.map((t) => ((0, jsx_runtime_1.jsx)(Toast, { severity: t.severity, message: t.message, onDismiss: () => onDismiss(t.id) }, t.id))) }));
42
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Atomic UI — design tokens + base.css 의 `.xfc-*` 와 1:1.
3
+ * 패키지 루트는 `components/index.ts` → 여기서 동일 심볼을 재export.
4
+ */
5
+ export { Badge, type BadgeProps } from './Badge';
6
+ export { Box, type BoxProps } from './Box';
7
+ export { Button, type ButtonProps } from './Button';
8
+ export { Card, type CardProps } from './Card';
9
+ export { Input, type InputProps } from './Input';
10
+ export { InlineErrorList, type InlineErrorEntry, type InlineErrorListProps, } from './InlineErrorList';
11
+ export { LoadingOverlay, type LoadingOverlayProps } from './LoadingOverlay';
12
+ export { Stack, type StackProps } from './Stack';
13
+ export { Toast, ToastList, ToastSeverityIcon, type ToastEntry, type ToastListProps, type ToastProps, type ToastSeverity, } from './Toast';
14
+ export { Text, type TextProps, type TextVariant } from './Text';
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Text = exports.ToastSeverityIcon = exports.ToastList = exports.Toast = exports.Stack = exports.LoadingOverlay = exports.InlineErrorList = exports.Input = exports.Card = exports.Button = exports.Box = exports.Badge = void 0;
4
+ /**
5
+ * Atomic UI — design tokens + base.css 의 `.xfc-*` 와 1:1.
6
+ * 패키지 루트는 `components/index.ts` → 여기서 동일 심볼을 재export.
7
+ */
8
+ var Badge_1 = require("./Badge");
9
+ Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return Badge_1.Badge; } });
10
+ var Box_1 = require("./Box");
11
+ Object.defineProperty(exports, "Box", { enumerable: true, get: function () { return Box_1.Box; } });
12
+ var Button_1 = require("./Button");
13
+ Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
14
+ var Card_1 = require("./Card");
15
+ Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return Card_1.Card; } });
16
+ var Input_1 = require("./Input");
17
+ Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return Input_1.Input; } });
18
+ var InlineErrorList_1 = require("./InlineErrorList");
19
+ Object.defineProperty(exports, "InlineErrorList", { enumerable: true, get: function () { return InlineErrorList_1.InlineErrorList; } });
20
+ var LoadingOverlay_1 = require("./LoadingOverlay");
21
+ Object.defineProperty(exports, "LoadingOverlay", { enumerable: true, get: function () { return LoadingOverlay_1.LoadingOverlay; } });
22
+ var Stack_1 = require("./Stack");
23
+ Object.defineProperty(exports, "Stack", { enumerable: true, get: function () { return Stack_1.Stack; } });
24
+ var Toast_1 = require("./Toast");
25
+ Object.defineProperty(exports, "Toast", { enumerable: true, get: function () { return Toast_1.Toast; } });
26
+ Object.defineProperty(exports, "ToastList", { enumerable: true, get: function () { return Toast_1.ToastList; } });
27
+ Object.defineProperty(exports, "ToastSeverityIcon", { enumerable: true, get: function () { return Toast_1.ToastSeverityIcon; } });
28
+ var Text_1 = require("./Text");
29
+ Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return Text_1.Text; } });
@@ -0,0 +1 @@
1
+ export * from './atoms';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./atoms"), exports);
package/dist/index.d.ts CHANGED
@@ -1,12 +1,46 @@
1
1
  /**
2
- * @xfilecom/front-core — design tokens (components expand later).
3
- * CSS: import '@xfilecom/front-core/tokens.css' in Vite/React entry.
2
+ * @xfilecom/front-core — design tokens + atomic React components (browser-only).
3
+ *
4
+ * CSS (xframe 템플릿·web/shared 권장 순서):
5
+ * import '@xfilecom/front-core/tokens.css';
6
+ * import '<shared>/styles/xfc-theme.css'; // 앱 토큰 덮어쓰기(선택)
7
+ * import '@xfilecom/front-core/base.css';
8
+ * import '<shared>/styles/app.css'; // 레이아웃 + .xfc-* 오버라이드
9
+ *
10
+ * React atoms: 패키지 루트 또는 `@xfilecom/front-core/atoms`.
4
11
  */
5
- export declare const XFRAME_FRONT_CORE_VERSION = "0.1.0";
12
+ export declare const XFRAME_FRONT_CORE_VERSION = "0.2.4";
13
+ /** CSS 커스텀 프로퍼티 이름 (-- 제외 시 var()와 함께 사용) */
6
14
  export declare const tokenVars: {
7
15
  readonly colorBg: "--xfc-bg";
16
+ readonly colorBgElevated: "--xfc-bg-elevated";
17
+ readonly colorBgMuted: "--xfc-bg-muted";
8
18
  readonly colorFg: "--xfc-fg";
19
+ readonly colorFgMuted: "--xfc-fg-muted";
20
+ readonly colorBorder: "--xfc-border";
21
+ readonly colorBorderStrong: "--xfc-border-strong";
9
22
  readonly colorAccent: "--xfc-accent";
23
+ readonly colorAccentHover: "--xfc-accent-hover";
24
+ readonly colorDanger: "--xfc-danger";
25
+ readonly radiusXs: "--xfc-radius-xs";
10
26
  readonly radiusSm: "--xfc-radius-sm";
27
+ readonly radiusMd: "--xfc-radius-md";
28
+ readonly radiusLg: "--xfc-radius-lg";
29
+ readonly spaceXs: "--xfc-space-xs";
30
+ readonly spaceSm: "--xfc-space-sm";
11
31
  readonly spaceMd: "--xfc-space-md";
32
+ readonly spaceLg: "--xfc-space-lg";
33
+ readonly spaceXl: "--xfc-space-xl";
34
+ readonly space2xl: "--xfc-space-2xl";
35
+ readonly fontSans: "--xfc-font-sans";
36
+ readonly textDisplay: "--xfc-text-display";
37
+ readonly textAppbar: "--xfc-text-appbar";
38
+ readonly textSection: "--xfc-text-section";
39
+ readonly textBody: "--xfc-text-body";
40
+ readonly textSmall: "--xfc-text-small";
41
+ readonly toastInfoBg: "--xfc-toast-info-bg";
42
+ readonly toastSuccessBg: "--xfc-toast-success-bg";
43
+ readonly toastWarnBg: "--xfc-toast-warn-bg";
44
+ readonly toastErrorBg: "--xfc-toast-error-bg";
12
45
  };
46
+ export { Badge, Box, Button, Card, InlineErrorList, Input, LoadingOverlay, Stack, Text, Toast, ToastList, ToastSeverityIcon, type BadgeProps, type BoxProps, type ButtonProps, type CardProps, type InlineErrorEntry, type InlineErrorListProps, type InputProps, type LoadingOverlayProps, type StackProps, type TextProps, type TextVariant, type ToastEntry, type ToastListProps, type ToastProps, type ToastSeverity, } from './components';
package/dist/index.js CHANGED
@@ -1,15 +1,61 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tokenVars = exports.XFRAME_FRONT_CORE_VERSION = void 0;
3
+ exports.ToastSeverityIcon = exports.ToastList = exports.Toast = exports.Text = exports.Stack = exports.LoadingOverlay = exports.Input = exports.InlineErrorList = exports.Card = exports.Button = exports.Box = exports.Badge = exports.tokenVars = exports.XFRAME_FRONT_CORE_VERSION = void 0;
4
4
  /**
5
- * @xfilecom/front-core — design tokens (components expand later).
6
- * CSS: import '@xfilecom/front-core/tokens.css' in Vite/React entry.
5
+ * @xfilecom/front-core — design tokens + atomic React components (browser-only).
6
+ *
7
+ * CSS (xframe 템플릿·web/shared 권장 순서):
8
+ * import '@xfilecom/front-core/tokens.css';
9
+ * import '<shared>/styles/xfc-theme.css'; // 앱 토큰 덮어쓰기(선택)
10
+ * import '@xfilecom/front-core/base.css';
11
+ * import '<shared>/styles/app.css'; // 레이아웃 + .xfc-* 오버라이드
12
+ *
13
+ * React atoms: 패키지 루트 또는 `@xfilecom/front-core/atoms`.
7
14
  */
8
- exports.XFRAME_FRONT_CORE_VERSION = '0.1.0';
15
+ exports.XFRAME_FRONT_CORE_VERSION = '0.2.4';
16
+ /** CSS 커스텀 프로퍼티 이름 (-- 제외 시 var()와 함께 사용) */
9
17
  exports.tokenVars = {
10
18
  colorBg: '--xfc-bg',
19
+ colorBgElevated: '--xfc-bg-elevated',
20
+ colorBgMuted: '--xfc-bg-muted',
11
21
  colorFg: '--xfc-fg',
22
+ colorFgMuted: '--xfc-fg-muted',
23
+ colorBorder: '--xfc-border',
24
+ colorBorderStrong: '--xfc-border-strong',
12
25
  colorAccent: '--xfc-accent',
26
+ colorAccentHover: '--xfc-accent-hover',
27
+ colorDanger: '--xfc-danger',
28
+ radiusXs: '--xfc-radius-xs',
13
29
  radiusSm: '--xfc-radius-sm',
30
+ radiusMd: '--xfc-radius-md',
31
+ radiusLg: '--xfc-radius-lg',
32
+ spaceXs: '--xfc-space-xs',
33
+ spaceSm: '--xfc-space-sm',
14
34
  spaceMd: '--xfc-space-md',
35
+ spaceLg: '--xfc-space-lg',
36
+ spaceXl: '--xfc-space-xl',
37
+ space2xl: '--xfc-space-2xl',
38
+ fontSans: '--xfc-font-sans',
39
+ textDisplay: '--xfc-text-display',
40
+ textAppbar: '--xfc-text-appbar',
41
+ textSection: '--xfc-text-section',
42
+ textBody: '--xfc-text-body',
43
+ textSmall: '--xfc-text-small',
44
+ toastInfoBg: '--xfc-toast-info-bg',
45
+ toastSuccessBg: '--xfc-toast-success-bg',
46
+ toastWarnBg: '--xfc-toast-warn-bg',
47
+ toastErrorBg: '--xfc-toast-error-bg',
15
48
  };
49
+ var components_1 = require("./components");
50
+ Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return components_1.Badge; } });
51
+ Object.defineProperty(exports, "Box", { enumerable: true, get: function () { return components_1.Box; } });
52
+ Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return components_1.Button; } });
53
+ Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return components_1.Card; } });
54
+ Object.defineProperty(exports, "InlineErrorList", { enumerable: true, get: function () { return components_1.InlineErrorList; } });
55
+ Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return components_1.Input; } });
56
+ Object.defineProperty(exports, "LoadingOverlay", { enumerable: true, get: function () { return components_1.LoadingOverlay; } });
57
+ Object.defineProperty(exports, "Stack", { enumerable: true, get: function () { return components_1.Stack; } });
58
+ Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return components_1.Text; } });
59
+ Object.defineProperty(exports, "Toast", { enumerable: true, get: function () { return components_1.Toast; } });
60
+ Object.defineProperty(exports, "ToastList", { enumerable: true, get: function () { return components_1.ToastList; } });
61
+ Object.defineProperty(exports, "ToastSeverityIcon", { enumerable: true, get: function () { return components_1.ToastSeverityIcon; } });