@camped-ui/breadcrumb 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +13 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/package.json +33 -0
package/README.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# breadcrumb
|
2
|
+
|
3
|
+
The Breadcrumb component is a fundamental navigational element that displays a hierarchical trail of links, typically representing the user's location within a website or application. It helps users understand their current position and facilitates navigation back to previous pages or sections. The Breadcrumb component enhances the user experience by providing clear and intuitive navigation pathways, aiding in seamless exploration of your application's content.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```bash
|
8
|
+
yarn add @camped-ui/breadcrumb
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
View docs [here](https://ui.camped.academy/docs/components/breadcrumb).
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
3
|
+
separator?: React.ReactNode;
|
4
|
+
} & React.RefAttributes<HTMLElement>>;
|
5
|
+
declare const BreadcrumbList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
6
|
+
declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
7
|
+
declare const BreadcrumbLink: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
8
|
+
asChild?: boolean;
|
9
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
10
|
+
declare const BreadcrumbPage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
11
|
+
declare const BreadcrumbSeparator: {
|
12
|
+
({ children, className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
13
|
+
displayName: string;
|
14
|
+
};
|
15
|
+
declare const BreadcrumbEllipsis: {
|
16
|
+
({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
17
|
+
displayName: string;
|
18
|
+
};
|
19
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,QAAA,MAAM,UAAU;gBAGA,MAAM,SAAS;qCAE+C,CAAA;AAG9E,QAAA,MAAM,cAAc,2KAYlB,CAAA;AAGF,QAAA,MAAM,cAAc,kKASlB,CAAA;AAGF,QAAA,MAAM,cAAc;cAGN,OAAO;2CAYnB,CAAA;AAGF,QAAA,MAAM,cAAc,sKAYlB,CAAA;AAGF,QAAA,MAAM,mBAAmB;wCAItB,MAAM,cAAc,CAAC,IAAI,CAAC;;CAS5B,CAAA;AAGD,QAAA,MAAM,kBAAkB;8BAGrB,MAAM,cAAc,CAAC,MAAM,CAAC;;CAU9B,CAAA;AAGD,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GACnB,CAAA"}
|
package/dist/index.js
ADDED
@@ -0,0 +1,86 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
26
|
+
var t = {};
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
28
|
+
t[p] = s[p];
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
32
|
+
t[p[i]] = s[p[i]];
|
33
|
+
}
|
34
|
+
return t;
|
35
|
+
};
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
37
|
+
exports.BreadcrumbEllipsis = exports.BreadcrumbSeparator = exports.BreadcrumbPage = exports.BreadcrumbLink = exports.BreadcrumbItem = exports.BreadcrumbList = exports.Breadcrumb = void 0;
|
38
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
39
|
+
const React = __importStar(require("react"));
|
40
|
+
const react_slot_1 = require("@radix-ui/react-slot");
|
41
|
+
const lucide_react_1 = require("lucide-react");
|
42
|
+
const lib_1 = require("@camped-ui/lib");
|
43
|
+
const Breadcrumb = React.forwardRef((_a, ref) => {
|
44
|
+
var props = __rest(_a, []);
|
45
|
+
return (0, jsx_runtime_1.jsx)("nav", Object.assign({ ref: ref, "aria-label": "breadcrumb" }, props));
|
46
|
+
});
|
47
|
+
exports.Breadcrumb = Breadcrumb;
|
48
|
+
Breadcrumb.displayName = "Breadcrumb";
|
49
|
+
const BreadcrumbList = React.forwardRef((_a, ref) => {
|
50
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
51
|
+
return ((0, jsx_runtime_1.jsx)("ol", Object.assign({ ref: ref, className: (0, lib_1.cn)("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className) }, props)));
|
52
|
+
});
|
53
|
+
exports.BreadcrumbList = BreadcrumbList;
|
54
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
55
|
+
const BreadcrumbItem = React.forwardRef((_a, ref) => {
|
56
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
57
|
+
return ((0, jsx_runtime_1.jsx)("li", Object.assign({ ref: ref, className: (0, lib_1.cn)("inline-flex items-center gap-1.5", className) }, props)));
|
58
|
+
});
|
59
|
+
exports.BreadcrumbItem = BreadcrumbItem;
|
60
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
61
|
+
const BreadcrumbLink = React.forwardRef((_a, ref) => {
|
62
|
+
var { asChild, className } = _a, props = __rest(_a, ["asChild", "className"]);
|
63
|
+
const Comp = asChild ? react_slot_1.Slot : "a";
|
64
|
+
return ((0, jsx_runtime_1.jsx)(Comp, Object.assign({ ref: ref, className: (0, lib_1.cn)("transition-colors hover:text-foreground", className) }, props)));
|
65
|
+
});
|
66
|
+
exports.BreadcrumbLink = BreadcrumbLink;
|
67
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
68
|
+
const BreadcrumbPage = React.forwardRef((_a, ref) => {
|
69
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
70
|
+
return ((0, jsx_runtime_1.jsx)("span", Object.assign({ ref: ref, role: "link", "aria-disabled": "true", "aria-current": "page", className: (0, lib_1.cn)("font-normal text-foreground", className) }, props)));
|
71
|
+
});
|
72
|
+
exports.BreadcrumbPage = BreadcrumbPage;
|
73
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
74
|
+
const BreadcrumbSeparator = (_a) => {
|
75
|
+
var { children, className } = _a, props = __rest(_a, ["children", "className"]);
|
76
|
+
return ((0, jsx_runtime_1.jsx)("li", Object.assign({ role: "presentation", "aria-hidden": "true", className: (0, lib_1.cn)("[&>svg]:size-3.5", className) }, props, { children: children !== null && children !== void 0 ? children : (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, {}) })));
|
77
|
+
};
|
78
|
+
exports.BreadcrumbSeparator = BreadcrumbSeparator;
|
79
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
80
|
+
const BreadcrumbEllipsis = (_a) => {
|
81
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
82
|
+
return ((0, jsx_runtime_1.jsxs)("span", Object.assign({ role: "presentation", "aria-hidden": "true", className: (0, lib_1.cn)("flex h-9 w-9 items-center justify-center", className) }, props, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.MoreHorizontal, { className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "More" })] })));
|
83
|
+
};
|
84
|
+
exports.BreadcrumbEllipsis = BreadcrumbEllipsis;
|
85
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
86
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.t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oB,EAD1B,KAAK,cAFkB,aAG3B,CADS;IAC0B,OAAA,CAClC,gDACE,IAAI,EAAC,cAAc,iBACP,MAAM,EAClB,SAAS,EAAE,IAAA,QAAE,EAAC,0CAA0C,EAAE,SAAS,CAAC,IAChE,KAAK,eAET,uBAAC,6BAAc,IAAC,SAAS,EAAC,SAAS,GAAG,EACtC,iCAAM,SAAS,EAAC,SAAS,qBAAY,KAChC,CACR,CAAA;CAAA,CAAA;AAUC,gDAAkB;AATpB,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAA"}
|
package/package.json
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"name": "@camped-ui/breadcrumb",
|
3
|
+
"version": "2.0.0",
|
4
|
+
"main": "dist/index.js",
|
5
|
+
"scripts": {
|
6
|
+
"publish-package": "npm publish --access public",
|
7
|
+
"build": "rimraf dist && tsc",
|
8
|
+
"clean": "rimraf dist"
|
9
|
+
},
|
10
|
+
"dependencies": {
|
11
|
+
"@camped-ui/lib": "^2.0.2",
|
12
|
+
"@radix-ui/react-slot": "^1.0.2",
|
13
|
+
"class-variance-authority": "^0.4.0",
|
14
|
+
"lucide-react": "^0.357.0"
|
15
|
+
},
|
16
|
+
"peerDependencies": {
|
17
|
+
"@camped-ui/lib": "*",
|
18
|
+
"react": "*"
|
19
|
+
},
|
20
|
+
"publishConfig": {
|
21
|
+
"registry": "https://registry.npmjs.org/",
|
22
|
+
"access": "public"
|
23
|
+
},
|
24
|
+
"author": "incresco",
|
25
|
+
"homepage": "https://ui.camped.academy",
|
26
|
+
"keywords": [
|
27
|
+
"breadcrumb",
|
28
|
+
"camped",
|
29
|
+
"camped-ui",
|
30
|
+
"next.js",
|
31
|
+
"components"
|
32
|
+
]
|
33
|
+
}
|