@fremtind/jkl-breadcrumb-react
Advanced tools
Comparing version 5.0.24 to 5.0.25
@@ -36,11 +36,35 @@ "use strict"; | ||
var import_react = __toESM(require("react")); | ||
const Breadcrumb = ({ className, children, density, ...rest }) => { | ||
const Breadcrumb = ({ | ||
className, | ||
children, | ||
density, | ||
...rest | ||
}) => { | ||
const numberOfChildren = import_react.default.Children.count(children); | ||
return /* @__PURE__ */ import_react.default.createElement("nav", { "aria-label": "Sti", className: (0, import_classnames.default)("jkl-breadcrumb", className), "data-layout-density": density, ...rest }, /* @__PURE__ */ import_react.default.createElement("ol", { className: "jkl-breadcrumb__list" }, import_react.default.Children.map(children, (child, index) => { | ||
const isLastElement = index + 1 === numberOfChildren; | ||
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, import_react.default.isValidElement(child) ? import_react.default.cloneElement(child, { | ||
isLastElement | ||
}) : child, !isLastElement && /* @__PURE__ */ import_react.default.createElement("span", { className: "jkl-breadcrumb__item-separator", "aria-hidden": "true" }, "\u203A")); | ||
}))); | ||
return /* @__PURE__ */ import_react.default.createElement( | ||
"nav", | ||
{ | ||
"aria-label": "Sti", | ||
className: (0, import_classnames.default)("jkl-breadcrumb", className), | ||
"data-layout-density": density, | ||
...rest | ||
}, | ||
/* @__PURE__ */ import_react.default.createElement("ol", { className: "jkl-breadcrumb__list" }, import_react.default.Children.map(children, (child, index) => { | ||
const isLastElement = index + 1 === numberOfChildren; | ||
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, import_react.default.isValidElement(child) ? import_react.default.cloneElement( | ||
child, | ||
{ | ||
isLastElement | ||
} | ||
) : child, !isLastElement && /* @__PURE__ */ import_react.default.createElement( | ||
"span", | ||
{ | ||
className: "jkl-breadcrumb__item-separator", | ||
"aria-hidden": "true" | ||
}, | ||
"\u203A" | ||
)); | ||
})) | ||
); | ||
}; | ||
//# sourceMappingURL=Breadcrumb.js.map |
@@ -36,3 +36,8 @@ "use strict"; | ||
var import_react = __toESM(require("react")); | ||
const BreadcrumbItem = ({ className, children, isLastElement, ...rest }) => { | ||
const BreadcrumbItem = ({ | ||
className, | ||
children, | ||
isLastElement, | ||
...rest | ||
}) => { | ||
return /* @__PURE__ */ import_react.default.createElement("li", { className: (0, import_classnames.default)("jkl-breadcrumb__item", className), ...rest }, import_react.default.Children.map(children, (child) => { | ||
@@ -39,0 +44,0 @@ if (import_react.default.isValidElement(child)) { |
import cn from "classnames"; | ||
import React from "react"; | ||
const Breadcrumb = ({ className, children, density, ...rest }) => { | ||
const Breadcrumb = ({ | ||
className, | ||
children, | ||
density, | ||
...rest | ||
}) => { | ||
const numberOfChildren = React.Children.count(children); | ||
return /* @__PURE__ */ React.createElement("nav", { "aria-label": "Sti", className: cn("jkl-breadcrumb", className), "data-layout-density": density, ...rest }, /* @__PURE__ */ React.createElement("ol", { className: "jkl-breadcrumb__list" }, React.Children.map(children, (child, index) => { | ||
const isLastElement = index + 1 === numberOfChildren; | ||
return /* @__PURE__ */ React.createElement(React.Fragment, null, React.isValidElement(child) ? React.cloneElement(child, { | ||
isLastElement | ||
}) : child, !isLastElement && /* @__PURE__ */ React.createElement("span", { className: "jkl-breadcrumb__item-separator", "aria-hidden": "true" }, "\u203A")); | ||
}))); | ||
return /* @__PURE__ */ React.createElement( | ||
"nav", | ||
{ | ||
"aria-label": "Sti", | ||
className: cn("jkl-breadcrumb", className), | ||
"data-layout-density": density, | ||
...rest | ||
}, | ||
/* @__PURE__ */ React.createElement("ol", { className: "jkl-breadcrumb__list" }, React.Children.map(children, (child, index) => { | ||
const isLastElement = index + 1 === numberOfChildren; | ||
return /* @__PURE__ */ React.createElement(React.Fragment, null, React.isValidElement(child) ? React.cloneElement( | ||
child, | ||
{ | ||
isLastElement | ||
} | ||
) : child, !isLastElement && /* @__PURE__ */ React.createElement( | ||
"span", | ||
{ | ||
className: "jkl-breadcrumb__item-separator", | ||
"aria-hidden": "true" | ||
}, | ||
"\u203A" | ||
)); | ||
})) | ||
); | ||
}; | ||
@@ -12,0 +36,0 @@ export { |
import cn from "classnames"; | ||
import React from "react"; | ||
const BreadcrumbItem = ({ className, children, isLastElement, ...rest }) => { | ||
const BreadcrumbItem = ({ | ||
className, | ||
children, | ||
isLastElement, | ||
...rest | ||
}) => { | ||
return /* @__PURE__ */ React.createElement("li", { className: cn("jkl-breadcrumb__item", className), ...rest }, React.Children.map(children, (child) => { | ||
@@ -5,0 +10,0 @@ if (React.isValidElement(child)) { |
{ | ||
"name": "@fremtind/jkl-breadcrumb-react", | ||
"version": "5.0.24", | ||
"version": "5.0.25", | ||
"publishConfig": { | ||
@@ -39,4 +39,4 @@ "access": "public" | ||
"dependencies": { | ||
"@fremtind/jkl-breadcrumb": "^5.1.5", | ||
"@fremtind/jkl-core": "^14.8.1", | ||
"@fremtind/jkl-breadcrumb": "^5.1.6", | ||
"@fremtind/jkl-core": "^14.8.2", | ||
"classnames": "^2.3.2" | ||
@@ -57,3 +57,3 @@ }, | ||
}, | ||
"gitHead": "9c4193c00f51b351ca7c65f951c78adf682c2c15" | ||
"gitHead": "82508b6f72780226367f81cd8a6a2f5417484c9a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23391
274