@loword/loword-design-system 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/LDBreadCrumb/LDBreadCrumb.d.ts +1 -1
- package/dist/components/LDBreadCrumb/LDBreadCrumb.d.ts.map +1 -1
- package/dist/components/LDBreadCrumb/LDBreadCrumb.js +14 -2
- package/dist/components/LDButton/LDLink.d.ts +2 -2
- package/dist/components/LDButton/LDLink.d.ts.map +1 -1
- package/dist/components/LDButton/LDLink.js +1 -6
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ declare const LDBreadCrumb: {
|
|
|
36
36
|
Root: ({ className, ...props }: React.ComponentProps<"nav">) => import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
List: ({ className, ...props }: React.ComponentProps<"ol">) => import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
Item: ({ className, ...props }: React.ComponentProps<"li">) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
Link: ({ as, size, icon, className, ...props }: LDBreadCrumbLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
Link: ({ as, size, icon, className, href, ...props }: LDBreadCrumbLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
40
|
Page: ({ size, icon, className, children, ...props }: LDBreadCrumbPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
41
|
Separator: ({ size, className, ...props }: LDBreadCrumbSeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDBreadCrumb.d.ts","sourceRoot":"","sources":["../../../src/components/LDBreadCrumb/LDBreadCrumb.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LDBreadCrumb.d.ts","sourceRoot":"","sources":["../../../src/components/LDBreadCrumb/LDBreadCrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,SAAS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|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import NextLink from 'next/link';
|
|
3
2
|
import { Fragment } from 'react';
|
|
4
3
|
import BreadCrumbBase from '../../components/LDBreadCrumb/BreadCrumbBase.js';
|
|
5
4
|
import LDButton from '../../components/LDButton/LDButton.js';
|
|
5
|
+
import LDLink from '../../components/LDButton/LDLink.js';
|
|
6
6
|
import RenderIcon from '../../components/RenderIcon/RenderIcon.js';
|
|
7
7
|
import cn from '../../utils/cn.js';
|
|
8
8
|
const textSizeClasses = {
|
|
@@ -32,7 +32,19 @@ const separatorIconSizeClasses = {
|
|
|
32
32
|
// gap은 항목·구분자를 나란히 놓는 List(ol)가 담당한다.
|
|
33
33
|
// li의 자식은 Link 또는 Page 하나뿐이라 여기에 gap을 줘도 효과가 없다.
|
|
34
34
|
const Item = ({ className, ...props }) => (_jsx(BreadCrumbBase.Item, { className: className, ...props }));
|
|
35
|
-
|
|
35
|
+
// 기본(next/link)은 LDLink, 다른 라우터를 `as`로 넘긴 경우만 LDButton으로 렌더한다.
|
|
36
|
+
const Link = ({ as, size = 'small', icon, className, href = '', ...props }) => {
|
|
37
|
+
const linkProps = {
|
|
38
|
+
variant: 'ghost',
|
|
39
|
+
color: 'neutral',
|
|
40
|
+
size,
|
|
41
|
+
leftIcon: icon,
|
|
42
|
+
className: cn('flex h-auto min-w-0 flex-row gap-0.5 px-0 regular text-neutral700 hover:bg-transparent active:bg-transparent', className),
|
|
43
|
+
href,
|
|
44
|
+
...props,
|
|
45
|
+
};
|
|
46
|
+
return as ? _jsx(LDButton, { as: as, ...linkProps }) : _jsx(LDLink, { ...linkProps });
|
|
47
|
+
};
|
|
36
48
|
const Page = ({ size = 'small', icon, className, children, ...props }) => (_jsxs(BreadCrumbBase.Page, { className: cn(textSizeClasses[size], 'gap-0.5 text-neutral700', className), ...props, children: [_jsx(RenderIcon, { className: iconSizeClasses[size], children: icon }), children] }));
|
|
37
49
|
const Separator = ({ size = 'small', className, ...props }) => (_jsx(BreadCrumbBase.Separator, { className: cn(separatorIconSizeClasses[size], 'text-neutral700', className), ...props }));
|
|
38
50
|
const LDBreadCrumb = ({ items, as, size = 'small', separator, className, }) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Link from 'next/link';
|
|
2
2
|
import { type ComponentProps } from 'react';
|
|
3
3
|
import { type ButtonStyleProps } from '../../components/LDButton/buttonVariants.js';
|
|
4
|
-
export type LDLinkProps = ButtonStyleProps & Omit<ComponentProps<typeof Link>, keyof ButtonStyleProps | 'as'>;
|
|
5
|
-
declare const LDLink: ({ variant, color, size, shape, align, block, children, className, leftIcon, rightIcon, compact, replace, scroll,
|
|
4
|
+
export type LDLinkProps = ButtonStyleProps & Omit<ComponentProps<typeof Link>, keyof ButtonStyleProps | 'as' | 'legacyBehavior' | 'passHref' | 'shallow' | 'locale' | 'onNavigate'>;
|
|
5
|
+
declare const LDLink: ({ variant, color, size, shape, align, block, children, className, leftIcon, rightIcon, compact, replace, scroll, prefetch, ...props }: LDLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default LDLink;
|
|
7
7
|
//# sourceMappingURL=LDLink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDLink.d.ts","sourceRoot":"","sources":["../../../src/components/LDButton/LDLink.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"LDLink.d.ts","sourceRoot":"","sources":["../../../src/components/LDButton/LDLink.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,sCAAsC,CAAC;AAQ9C,MAAM,MAAM,WAAW,GAAG,gBAAgB,GACxC,IAAI,CACF,cAAc,CAAC,OAAO,IAAI,CAAC,EACzB,MAAM,gBAAgB,GACtB,IAAI,GACJ,gBAAgB,GAChB,UAAU,GACV,SAAS,GACT,QAAQ,GACR,YAAY,CACf,CAAC;AAEJ,QAAA,MAAM,MAAM,GAAI,uIAiBb,WAAW,4CA8Bb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -6,7 +6,7 @@ import RenderIcon from '../../components/RenderIcon/RenderIcon.js';
|
|
|
6
6
|
import Show from '../../components/Show/Show.js';
|
|
7
7
|
const LDLink = ({ variant = 'solid', color = 'point', size = 'small', shape = 'default', align = 'center', block = false, children, className, leftIcon, rightIcon, compact = false,
|
|
8
8
|
// Link 전용 prop — disabled면 span으로 렌더되므로 DOM 속성으로 새지 않게 뺀다.
|
|
9
|
-
replace, scroll,
|
|
9
|
+
replace, scroll, prefetch, ...props }) => (_jsxs(ButtonBase.Root, { as: Link, className: buttonVariants({
|
|
10
10
|
variant,
|
|
11
11
|
color,
|
|
12
12
|
size,
|
|
@@ -20,11 +20,6 @@ replace, scroll, shallow, passHref, prefetch, locale, legacyBehavior, onNavigate
|
|
|
20
20
|
}), ...props, ...(!props.disabled && {
|
|
21
21
|
replace,
|
|
22
22
|
scroll,
|
|
23
|
-
shallow,
|
|
24
|
-
passHref,
|
|
25
23
|
prefetch,
|
|
26
|
-
locale,
|
|
27
|
-
legacyBehavior,
|
|
28
|
-
onNavigate,
|
|
29
24
|
}), children: [_jsx(RenderIcon, { children: leftIcon }), _jsx(Show, { when: children, children: _jsx("span", { className: "shrink-0", children: children }) }), _jsx(RenderIcon, { children: rightIcon })] }));
|
|
30
25
|
export default LDLink;
|