@nypl/design-system-react-components 3.1.7-rc-breadcrumbs → 3.1.7-rc-breadcrumbs-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.
|
@@ -2162,15 +2162,16 @@ const O_ = A1(
|
|
|
2162
2162
|
}
|
|
2163
2163
|
);
|
|
2164
2164
|
})
|
|
2165
|
-
), sp = 40, N_ = (r, a, o = !1,
|
|
2166
|
-
const
|
|
2165
|
+
), sp = 40, N_ = (r, a, o, s = !1, i = !1) => {
|
|
2166
|
+
const p = r.text.length, C = p >= sp, v = p <= sp ? r.text : g_(r.text, sp), y = /* @__PURE__ */ x.jsxs(
|
|
2167
2167
|
GS,
|
|
2168
2168
|
{
|
|
2169
|
-
as:
|
|
2169
|
+
as: o,
|
|
2170
2170
|
href: r.url,
|
|
2171
|
-
"aria-current":
|
|
2171
|
+
"aria-current": i ? "page" : void 0,
|
|
2172
|
+
...r.linkProps,
|
|
2172
2173
|
children: [
|
|
2173
|
-
|
|
2174
|
+
s && /* @__PURE__ */ x.jsx(
|
|
2174
2175
|
B3,
|
|
2175
2176
|
{
|
|
2176
2177
|
name: "arrow",
|
|
@@ -2181,52 +2182,58 @@ const O_ = A1(
|
|
|
2181
2182
|
type: "breadcrumbs"
|
|
2182
2183
|
}
|
|
2183
2184
|
),
|
|
2184
|
-
/* @__PURE__ */ x.jsx("span", { className: "breadcrumb-label", children:
|
|
2185
|
+
/* @__PURE__ */ x.jsx("span", { className: "breadcrumb-label", children: v })
|
|
2185
2186
|
]
|
|
2186
2187
|
}
|
|
2187
2188
|
);
|
|
2188
|
-
return
|
|
2189
|
+
return C ? /* @__PURE__ */ x.jsx(
|
|
2189
2190
|
pb,
|
|
2190
2191
|
{
|
|
2191
2192
|
content: r.text,
|
|
2192
2193
|
id: `breadcrumb-${a}-tooltip`,
|
|
2193
|
-
children:
|
|
2194
|
+
children: y
|
|
2194
2195
|
}
|
|
2195
|
-
) : /* @__PURE__ */ x.jsx(x.Fragment, { children:
|
|
2196
|
-
}, P_ = (r, a) => r != null && r.length ? r.map((
|
|
2197
|
-
const
|
|
2196
|
+
) : /* @__PURE__ */ x.jsx(x.Fragment, { children: y });
|
|
2197
|
+
}, P_ = (r, a, o) => r != null && r.length ? r.map((i, p) => {
|
|
2198
|
+
const C = p === r.length - 2, v = p === r.length - 1;
|
|
2198
2199
|
return /* @__PURE__ */ x.jsx(qS, { children: N_(
|
|
2199
|
-
|
|
2200
|
+
i,
|
|
2200
2201
|
a,
|
|
2201
|
-
|
|
2202
|
-
C
|
|
2203
|
-
|
|
2202
|
+
o,
|
|
2203
|
+
C,
|
|
2204
|
+
v
|
|
2205
|
+
) }, p);
|
|
2204
2206
|
}) : null, aI = A1(
|
|
2205
2207
|
f2((r, a) => {
|
|
2206
2208
|
const {
|
|
2207
2209
|
breadcrumbsData: o,
|
|
2208
2210
|
breadcrumbsType: s = "whatsOn",
|
|
2209
2211
|
className: i,
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
+
customLink: p,
|
|
2213
|
+
id: C,
|
|
2214
|
+
...v
|
|
2212
2215
|
} = r;
|
|
2213
2216
|
if (!o || o.length === 0)
|
|
2214
2217
|
throw new Error(
|
|
2215
2218
|
"NYPL Reservoir Breadcrumbs: No data was passed to the `breadcrumbsData` prop."
|
|
2216
2219
|
);
|
|
2217
|
-
const
|
|
2220
|
+
const y = R3("CustomBreadcrumb", {
|
|
2218
2221
|
variant: s
|
|
2219
|
-
}),
|
|
2222
|
+
}), L = P_(
|
|
2223
|
+
o,
|
|
2224
|
+
C,
|
|
2225
|
+
p
|
|
2226
|
+
);
|
|
2220
2227
|
return /* @__PURE__ */ x.jsx(
|
|
2221
2228
|
QS,
|
|
2222
2229
|
{
|
|
2223
2230
|
"aria-label": "Breadcrumb",
|
|
2224
2231
|
className: i,
|
|
2225
|
-
id:
|
|
2232
|
+
id: C,
|
|
2226
2233
|
ref: a,
|
|
2227
|
-
__css:
|
|
2228
|
-
...
|
|
2229
|
-
children:
|
|
2234
|
+
__css: y,
|
|
2235
|
+
...v,
|
|
2236
|
+
children: L
|
|
2230
2237
|
}
|
|
2231
2238
|
);
|
|
2232
2239
|
})
|
|
@@ -32840,6 +32847,7 @@ const { defineMultiStyleConfig: QP, definePartsStyle: qP } = Y2(["container", "b
|
|
|
32840
32847
|
paddingEnd: "s"
|
|
32841
32848
|
},
|
|
32842
32849
|
a: {
|
|
32850
|
+
_visited: { color: "unset" },
|
|
32843
32851
|
_hover: {
|
|
32844
32852
|
color: "ui.gray.light-cool",
|
|
32845
32853
|
textDecoration: "none"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ChakraComponent } from "@chakra-ui/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
export declare const breadcrumbTypeArray: readonly ["blogs", "booksAndMore", "brand", "connect", "digitalCollections", "education", "locations", "research", "whatsOn"];
|
|
4
|
-
export type BreadcrumbsTypes =
|
|
4
|
+
export type BreadcrumbsTypes = typeof breadcrumbTypeArray[number];
|
|
5
5
|
export interface BreadcrumbsDataProps {
|
|
6
6
|
url: string;
|
|
7
7
|
text: string | React.ReactNode;
|
|
8
|
-
|
|
8
|
+
linkProps?: any;
|
|
9
9
|
}
|
|
10
10
|
export interface BreadcrumbProps {
|
|
11
11
|
/** Breadcrumb links as an array */
|
|
@@ -16,6 +16,8 @@ export interface BreadcrumbProps {
|
|
|
16
16
|
className?: string;
|
|
17
17
|
/** ID that other components can cross reference for accessibility purposes */
|
|
18
18
|
id?: string;
|
|
19
|
+
/** Custom Link component for apps with internal routing, defaults to BreadcrumbLink if not passed */
|
|
20
|
+
customLink?: any;
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* The `Breadcrumbs` component is a navigation element that provides a
|