@bigtablet/design-system 1.1.3 → 1.2.2
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/README.md +134 -2
- package/dist/index.css +1162 -0
- package/dist/index.d.ts +136 -1
- package/dist/index.js +605 -5
- package/dist/next.css +87 -0
- package/dist/next.d.ts +24 -0
- package/dist/next.js +68 -0
- package/package.json +19 -12
- package/dist/client.css +0 -943
- package/dist/client.d.ts +0 -135
- package/dist/client.js +0 -4185
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
interface SidebarItem {
|
|
5
|
+
href: string;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
icon?: React.ComponentType<{
|
|
8
|
+
size?: number;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
type MatchMode = "startsWith" | "exact";
|
|
12
|
+
interface SidebarProps {
|
|
13
|
+
items?: SidebarItem[];
|
|
14
|
+
activePath?: string;
|
|
15
|
+
onItemSelect?: (href: string) => void;
|
|
16
|
+
width?: number;
|
|
17
|
+
className?: string;
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
match?: MatchMode;
|
|
20
|
+
brandHref?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const Sidebar: ({ items, activePath, onItemSelect, width, className, style, match, brandHref, }: SidebarProps) => react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { Sidebar, type SidebarItem, type SidebarProps };
|
package/dist/next.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/ui/navigation/sidebar/index.tsx
|
|
7
|
+
var Sidebar = ({
|
|
8
|
+
items = [],
|
|
9
|
+
activePath,
|
|
10
|
+
onItemSelect,
|
|
11
|
+
width = 240,
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
match = "startsWith",
|
|
15
|
+
brandHref = "/main"
|
|
16
|
+
}) => {
|
|
17
|
+
const isActive = (href) => {
|
|
18
|
+
if (!activePath) return false;
|
|
19
|
+
return match === "exact" ? activePath === href : activePath.startsWith(href);
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsxs(
|
|
22
|
+
"aside",
|
|
23
|
+
{
|
|
24
|
+
className: ["sidebar", className].filter(Boolean).join(" "),
|
|
25
|
+
style: { width, ...style },
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsx("div", { className: "sidebar__brand", children: /* @__PURE__ */ jsx(
|
|
28
|
+
Link,
|
|
29
|
+
{
|
|
30
|
+
href: brandHref,
|
|
31
|
+
className: "sidebar__brand-link",
|
|
32
|
+
"aria-label": "Bigtablet \uD648\uC73C\uB85C",
|
|
33
|
+
children: /* @__PURE__ */ jsx(
|
|
34
|
+
Image,
|
|
35
|
+
{
|
|
36
|
+
src: "/assets/images/logo/bigtablet.svg",
|
|
37
|
+
alt: "Bigtablet",
|
|
38
|
+
width: 200,
|
|
39
|
+
height: 44,
|
|
40
|
+
priority: true,
|
|
41
|
+
className: "sidebar__brand-img"
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
) }),
|
|
46
|
+
/* @__PURE__ */ jsx("nav", { className: "sidebar__nav", children: items.map((it) => {
|
|
47
|
+
const active = isActive(it.href);
|
|
48
|
+
return /* @__PURE__ */ jsxs(
|
|
49
|
+
Link,
|
|
50
|
+
{
|
|
51
|
+
href: it.href,
|
|
52
|
+
className: ["sidebar__item", active && "is-active"].filter(Boolean).join(" "),
|
|
53
|
+
onClick: () => onItemSelect?.(it.href),
|
|
54
|
+
title: typeof it.label === "string" ? it.label : void 0,
|
|
55
|
+
children: [
|
|
56
|
+
it.icon && /* @__PURE__ */ jsx("span", { className: "sidebar__icon", children: React.createElement(it.icon, { size: 16 }) }),
|
|
57
|
+
/* @__PURE__ */ jsx("span", { className: "sidebar__label", children: it.label })
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
it.href
|
|
61
|
+
);
|
|
62
|
+
}) })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { Sidebar };
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigtablet/design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Bigtablet Design System UI Components",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"types": "dist/
|
|
7
|
-
"style": "dist/
|
|
6
|
+
"types": "dist/next.d.ts",
|
|
7
|
+
"style": "dist/next.css",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./dist/
|
|
11
|
-
"import": "./dist/
|
|
10
|
+
"types": "./dist/next.d.ts",
|
|
11
|
+
"import": "./dist/next.js"
|
|
12
12
|
},
|
|
13
|
-
"./
|
|
14
|
-
"types": "./dist/
|
|
15
|
-
"import": "./dist/
|
|
13
|
+
"./next": {
|
|
14
|
+
"types": "./dist/next.d.ts",
|
|
15
|
+
"import": "./dist/next.js"
|
|
16
16
|
},
|
|
17
|
-
"./
|
|
17
|
+
"./style.css": "./dist/next.css"
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
"LICENSE"
|
|
23
23
|
],
|
|
24
24
|
"sideEffects": [
|
|
25
|
-
"
|
|
25
|
+
"**/*.css",
|
|
26
|
+
"**/*.scss",
|
|
27
|
+
"./dist/next.css"
|
|
26
28
|
],
|
|
27
29
|
"scripts": {
|
|
28
30
|
"build": "tsup",
|
|
@@ -48,8 +50,12 @@
|
|
|
48
50
|
"react-dom": "^19",
|
|
49
51
|
"react-toastify": ">=11.0.5"
|
|
50
52
|
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"next": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
51
58
|
"devDependencies": {
|
|
52
|
-
"@changesets/cli": "^2.29.7",
|
|
53
59
|
"@semantic-release/changelog": "^6.0.3",
|
|
54
60
|
"@semantic-release/git": "^10.0.1",
|
|
55
61
|
"@semantic-release/github": "^12.0.1",
|
|
@@ -62,12 +68,13 @@
|
|
|
62
68
|
"@types/react-dom": "^19",
|
|
63
69
|
"chromatic": "^13.3.3",
|
|
64
70
|
"esbuild-sass-plugin": "^3",
|
|
65
|
-
"gh-pages": "^6.3.0",
|
|
66
71
|
"lucide-react": "^0.552.0",
|
|
67
72
|
"next": "16.0.1",
|
|
68
73
|
"react": "19.2.0",
|
|
69
74
|
"react-dom": "19.2.0",
|
|
75
|
+
"react-markdown": "^10.1.0",
|
|
70
76
|
"react-toastify": "^11.0.5",
|
|
77
|
+
"remark-gfm": "^4.0.1",
|
|
71
78
|
"sass-embedded": "^1.93.3",
|
|
72
79
|
"semantic-release": "^25.0.1",
|
|
73
80
|
"storybook": "8.6.14",
|